diff --git a/.editorconfig b/.editorconfig index e4ab4a9fd38..4ca23b300fd 100644 --- a/.editorconfig +++ b/.editorconfig @@ -11,5 +11,8 @@ trim_trailing_whitespace = true [*.md] trim_trailing_whitespace = false +[*.yml] +indent_size = 2 + [Makefile] indent_style = tab diff --git a/.github/workflows/arma.yml b/.github/workflows/arma.yml index d0649a0adec..1af2e7e0602 100644 --- a/.github/workflows/arma.yml +++ b/.github/workflows/arma.yml @@ -27,15 +27,6 @@ jobs: - name: Validate function headers run: python3 docs/tools/document_functions.py --debug - lint: - runs-on: ubuntu-latest - steps: - - name: Checkout the source code - uses: actions/checkout@v4 - - name: Lint (sqflint) - uses: arma-actions/sqflint@master - continue-on-error: true # No failure due to many false-positives - build: runs-on: ubuntu-latest steps: @@ -52,3 +43,4 @@ jobs: with: name: ace3-${{ github.sha }}-nobin path: .hemttout/@* + include-hidden-files: true # Because .hemttout is a hidden directory diff --git a/.github/workflows/extensions.yml b/.github/workflows/extensions.yml index 9693d2df22b..ce475e5a006 100644 --- a/.github/workflows/extensions.yml +++ b/.github/workflows/extensions.yml @@ -1,29 +1,65 @@ name: Extensions on: - pull_request: + push: paths: - - 'extensions/**' + - 'extension/**' + - 'Cargo.toml' + - 'Cargo.lock' + - '.github/workflows/extensions.yml' jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout the source code + uses: actions/checkout@master + - name: Install dependencies + run: | + rustup toolchain update stable --no-self-update + rustup default stable + rustup component add clippy rustfmt + - name: Run rustfmt + run: cargo fmt -- --check + - name: Run clippy + run: cargo clippy --all -- -Dwarnings + + test: + runs-on: ubuntu-latest + container: + image: xd009642/tarpaulin + options: --security-opt seccomp=unconfined + steps: + - name: Checkout the source code + uses: actions/checkout@master + - name: Test & Coverage + run: cargo tarpaulin --verbose --no-default-features --workspace --timeout 240 + build: - runs-on: ${{ matrix.os }} strategy: matrix: - os: [windows-latest] - + arrays: [ + os: { tag: "windows-latest", target: "i686-pc-windows-msvc" }, + os: { tag: "windows-latest", target: "x86_64-pc-windows-msvc" }, + ] + runs-on: ${{ matrix.arrays.os.tag }} steps: - name: Checkout the source code uses: actions/checkout@v4 + - name: Install stable Rust + uses: actions-rs/toolchain@v1 + with: + target: ${{ matrix.arrays.os.target }} + toolchain: stable + default: true + - name: Rust Cache + uses: Swatinem/rust-cache@v2 - name: Build - shell: cmd - run: | - cd extensions - mkdir build - cd build - cmake .. && cmake --build . - - name: Upload Artifact + run: cargo build --verbose + - name: Upload uses: actions/upload-artifact@v4 with: - name: ace3_extensions-${{ matrix.os }}-debug - path: extensions/build + name: ${{ matrix.arrays.os.target }} + path: target/debug/ace.dll + if-no-files-found: error + retention-days: 30 diff --git a/.github/workflows/hemtt.yml b/.github/workflows/hemtt.yml index e606852285d..79286fc45c3 100644 --- a/.github/workflows/hemtt.yml +++ b/.github/workflows/hemtt.yml @@ -33,6 +33,8 @@ jobs: xcopy /e /h /q pullrequest\addons addons\ xcopy /e /h /q pullrequest\optionals optionals\ xcopy /e /h /q pullrequest\include include\ + xcopy /y /h /q pullrequest\ace.dll ace.dll + xcopy /y /h /q pullrequest\ace_x64.dll ace_x64.dll - name: Run HEMTT build run: hemtt build - name: Rename build folder @@ -42,3 +44,4 @@ jobs: with: name: ace3-${{ github.sha }} path: .hemttout/@* + include-hidden-files: true # Because .hemttout is a hidden directory diff --git a/.gitignore b/.gitignore index 4ad0a5e1eb9..15cc59d0d5a 100644 --- a/.gitignore +++ b/.gitignore @@ -2,8 +2,6 @@ *.zip release/* releases/* -extensions/vcproj32/* -extensions/vcproj64/* .vscode/* hemtt hemtt.exe @@ -20,4 +18,5 @@ CHANGELOG.md sqfvm.exe ArmaScriptCompiler.exe *.sqfc +target/ !extras/**/*.zip diff --git a/.hemtt/launch.toml b/.hemtt/launch.toml new file mode 100644 index 00000000000..d0726cbdded --- /dev/null +++ b/.hemtt/launch.toml @@ -0,0 +1,31 @@ +[default] +workshop = [ + "450814997", # CBA_A3 +] + +[spe] +extends = "default" +dlc = [ + "Spearhead 1944" +] + +[vn] +extends = "default" +dlc = [ + "S.O.G. Prairie Fire", +] + +[ws] +extends = "default" +dlc = [ + "Western Sahara", +] + +[rhs] +extends = "default" +workshop = [ + "843425103", # RHS AFRF Workshop ID + "843577117", # RHS USAF Workshop ID + "843593391", # RHS GREF Workshop ID + "843632231", # RHS SAF Workshop ID +] diff --git a/.hemtt/lints.toml b/.hemtt/lints.toml new file mode 100644 index 00000000000..eac28147c00 --- /dev/null +++ b/.hemtt/lints.toml @@ -0,0 +1,5 @@ +[sqf.banned_commands] +options.ignore = [ + "addPublicVariableEventHandler", # Alt syntax is broken, we are using main syntax + "createSoundSource", # Greatly attenuated when in first person and in a vehicle +] diff --git a/.hemtt/project.toml b/.hemtt/project.toml index f5ed361e3e1..6ab1c3a1afc 100644 --- a/.hemtt/project.toml +++ b/.hemtt/project.toml @@ -27,41 +27,3 @@ exclude = [ "common/functions/fnc_dummy.sqf", "zeus/functions/fnc_zeusAttributes.sqf", ] - -[hemtt.launch.default] -workshop = [ - "450814997", # CBA_A3 -] - -[hemtt.launch.spe] -workshop = [ - "450814997", # CBA_A3 -] -dlc = [ - "spe" -] - -[hemtt.launch.vn] -workshop = [ - "450814997", # CBA_A3's Workshop ID -] -dlc = [ - "S.O.G. Prairie Fire", -] - -[hemtt.launch.ws] -workshop = [ - "450814997", # CBA_A3's Workshop ID -] -dlc = [ - "Western Sahara", -] - -[hemtt.launch.rhs] -workshop = [ - "450814997", # CBA_A3's Workshop ID - "843425103", # RHS AFRF Workshop ID - "843577117", # RHS USAF Workshop ID - "843593391", # RHS GREF Workshop ID - "843632231", # RHS SAF Workshop ID -] diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 00000000000..9ce88373eeb --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,1410 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "ace" +version = "0.1.0" +dependencies = [ + "arboard", + "arma-rs", + "git2", + "rand", + "rand_chacha", + "rayon", + "uuid", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "arboard" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb4009533e8ff8f1450a5bcbc30f4242a1d34442221f72314bea1f5dc9c7f89" +dependencies = [ + "clipboard-win", + "core-graphics", + "image", + "log", + "objc2", + "objc2-app-kit", + "objc2-foundation", + "parking_lot", + "windows-sys 0.48.0", + "x11rb", +] + +[[package]] +name = "arma-rs" +version = "1.11.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e722ed20b6266ceccf4334d32a528fcef9a2dca341b8bbcceb99eb7152081239" +dependencies = [ + "arma-rs-proc", + "crossbeam-channel", + "libc", + "link_args", + "log", + "seq-macro", + "state", + "uuid", + "winapi", + "windows 0.58.0", +] + +[[package]] +name = "arma-rs-proc" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "936ed035ff4e775bd50ff94ccdb44f236d1ca012c376347b048fb6b9861833b7" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" + +[[package]] +name = "block2" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c132eebf10f5cad5289222520a4a058514204aed6d791f1cf4fe8088b82d15f" +dependencies = [ + "objc2", +] + +[[package]] +name = "bytemuck" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fd4c6dcc3b0aea2f5c0b4b82c2b15fe39ddbc76041a310848f4706edf76bb31" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "byteorder-lite" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" + +[[package]] +name = "cc" +version = "1.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72db2f7947ecee9b03b510377e8bb9077afa27176fdbff55c51027e976fdcc48" +dependencies = [ + "jobserver", + "libc", + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "clipboard-win" +version = "5.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15efe7a882b08f34e38556b14f2fb3daa98769d06c7f0c1b076dfd0d983bc892" +dependencies = [ + "error-code", +] + +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "core-graphics" +version = "0.23.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c07782be35f9e1140080c6b96f0d44b739e2278479f64e02fdab4e32dfd8b081" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "core-graphics-types", + "foreign-types", + "libc", +] + +[[package]] +name = "core-graphics-types" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45390e6114f68f718cc7a830514a96f903cccd70d02a8f6d9f643ac4ba45afaf" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" + +[[package]] +name = "either" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" + +[[package]] +name = "errno" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "error-code" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0474425d51df81997e2f90a21591180b38eccf27292d755f3e30750225c175b" + +[[package]] +name = "fdeflate" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f9bfee30e4dedf0ab8b422f03af778d9612b63f502710fc500a334ebe2de645" +dependencies = [ + "simd-adler32", +] + +[[package]] +name = "flate2" +version = "1.0.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f211bbe8e69bbd0cfdea405084f128ae8b4aaa6b0b522fc8f2b009084797920" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "foreign-types" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" +dependencies = [ + "foreign-types-macros", + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-macros" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "foreign-types-shared" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "generator" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cc16584ff22b460a382b7feec54b23d2908d858152e5739a120b949293bd74e" +dependencies = [ + "cc", + "libc", + "log", + "rustversion", + "windows 0.48.0", +] + +[[package]] +name = "gethostname" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0176e0459c2e4a1fe232f984bca6890e681076abb9934f6cea7c326f3fc47818" +dependencies = [ + "libc", + "windows-targets 0.48.5", +] + +[[package]] +name = "getrandom" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "git2" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b903b73e45dc0c6c596f2d37eccece7c1c8bb6e4407b001096387c63d0d93724" +dependencies = [ + "bitflags 2.6.0", + "libc", + "libgit2-sys", + "log", + "openssl-probe", + "openssl-sys", + "url", +] + +[[package]] +name = "idna" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "image" +version = "0.25.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99314c8a2152b8ddb211f924cdae532d8c5e4c8bb54728e12fff1b0cd5963a10" +dependencies = [ + "bytemuck", + "byteorder-lite", + "num-traits", + "png", + "tiff", +] + +[[package]] +name = "itoa" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" + +[[package]] +name = "jobserver" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" +dependencies = [ + "libc", +] + +[[package]] +name = "jpeg-decoder" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5d4a7da358eff58addd2877a45865158f0d78c911d43a5784ceb7bbf52833b0" + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "libc" +version = "0.2.158" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" + +[[package]] +name = "libgit2-sys" +version = "0.17.0+1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10472326a8a6477c3c20a64547b0059e4b0d086869eee31e6d7da728a8eb7224" +dependencies = [ + "cc", + "libc", + "libssh2-sys", + "libz-sys", + "openssl-sys", + "pkg-config", +] + +[[package]] +name = "libssh2-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dc8a030b787e2119a731f1951d6a773e2280c660f8ec4b0f5e1505a386e71ee" +dependencies = [ + "cc", + "libc", + "libz-sys", + "openssl-sys", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "libz-sys" +version = "1.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc53a7799a7496ebc9fd29f31f7df80e83c9bda5299768af5f9e59eeea74647" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "link_args" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c7721e472624c9aaad27a5eb6b7c9c6045c7a396f2efb6dabaec1b640d5e89b" + +[[package]] +name = "linux-raw-sys" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" + +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" + +[[package]] +name = "loom" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff50ecb28bb86013e935fb6683ab1f6d3a20016f123c76fd4c27470076ac30f5" +dependencies = [ + "cfg-if", + "generator", + "scoped-tls", + "serde", + "serde_json", + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata 0.1.10", +] + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "miniz_oxide" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" +dependencies = [ + "adler", + "simd-adler32", +] + +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "objc-sys" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdb91bdd390c7ce1a8607f35f3ca7151b65afc0ff5ff3b34fa350f7d7c7e4310" + +[[package]] +name = "objc2" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46a785d4eeff09c14c487497c162e92766fbb3e4059a71840cecc03d9a50b804" +dependencies = [ + "objc-sys", + "objc2-encode", +] + +[[package]] +name = "objc2-app-kit" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4e89ad9e3d7d297152b17d39ed92cd50ca8063a89a9fa569046d41568891eff" +dependencies = [ + "bitflags 2.6.0", + "block2", + "libc", + "objc2", + "objc2-core-data", + "objc2-core-image", + "objc2-foundation", + "objc2-quartz-core", +] + +[[package]] +name = "objc2-core-data" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "617fbf49e071c178c0b24c080767db52958f716d9eabdf0890523aeae54773ef" +dependencies = [ + "bitflags 2.6.0", + "block2", + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-core-image" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55260963a527c99f1819c4f8e3b47fe04f9650694ef348ffd2227e8196d34c80" +dependencies = [ + "block2", + "objc2", + "objc2-foundation", + "objc2-metal", +] + +[[package]] +name = "objc2-encode" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7891e71393cd1f227313c9379a26a584ff3d7e6e7159e988851f0934c993f0f8" + +[[package]] +name = "objc2-foundation" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8" +dependencies = [ + "bitflags 2.6.0", + "block2", + "libc", + "objc2", +] + +[[package]] +name = "objc2-metal" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd0cba1276f6023976a406a14ffa85e1fdd19df6b0f737b063b95f6c8c7aadd6" +dependencies = [ + "bitflags 2.6.0", + "block2", + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-quartz-core" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e42bee7bff906b14b167da2bac5efe6b6a07e6f7c0a21a7308d40c960242dc7a" +dependencies = [ + "bitflags 2.6.0", + "block2", + "objc2", + "objc2-foundation", + "objc2-metal", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "openssl-sys" +version = "0.9.103" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "parking_lot" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.52.6", +] + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "pin-project-lite" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" + +[[package]] +name = "pkg-config" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" + +[[package]] +name = "png" +version = "0.17.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06e4b0d3d1312775e782c86c91a111aa1f910cbb65e1337f9975b5f9a554b5e1" +dependencies = [ + "bitflags 1.3.2", + "crc32fast", + "fdeflate", + "flate2", + "miniz_oxide", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "proc-macro2" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rayon" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "redox_syscall" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" +dependencies = [ + "bitflags 2.6.0", +] + +[[package]] +name = "regex" +version = "1.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata 0.4.7", + "regex-syntax 0.8.4", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", +] + +[[package]] +name = "regex-automata" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.8.4", +] + +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "regex-syntax" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" + +[[package]] +name = "rustix" +version = "0.38.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +dependencies = [ + "bitflags 2.6.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustversion" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" + +[[package]] +name = "ryu" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + +[[package]] +name = "scoped-tls" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "seq-macro" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3f0bf26fd526d2a95683cd0f87bf103b8539e2ca1ef48ce002d67aad59aa0b4" + +[[package]] +name = "serde" +version = "1.0.208" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cff085d2cb684faa248efb494c39b68e522822ac0de72ccf08109abde717cfb2" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.208" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24008e81ff7613ed8e5ba0cfaf24e2c2f1e5b8a0495711e44fcd4882fca62bcf" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.125" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83c8e735a073ccf5be70aa8066aa984eaf2fa000db6c8d0100ae605b366d31ed" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "simd-adler32" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "state" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b8c4a4445d81357df8b1a650d0d0d6fbbbfe99d064aa5e02f3e4022061476d8" +dependencies = [ + "loom", +] + +[[package]] +name = "syn" +version = "2.0.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6af063034fc1935ede7be0122941bafa9bacb949334d090b77ca98b5817c7d9" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "thread_local" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +dependencies = [ + "cfg-if", + "once_cell", +] + +[[package]] +name = "tiff" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba1310fcea54c6a9a4fd1aad794ecc02c31682f6bfbecdf460bf19533eed1e3e" +dependencies = [ + "flate2", + "jpeg-decoder", + "weezl", +] + +[[package]] +name = "tinyvec" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unicode-normalization" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "url" +version = "2.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "uuid" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" +dependencies = [ + "getrandom", +] + +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "weezl" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53a85b86a771b1c87058196170769dd264f66c0782acf1ae6cc51bfd64b39082" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd04d41d93c4992d421894c18c8b43496aa748dd4c081bac0dc93eb0489272b6" +dependencies = [ + "windows-core", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-core" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ba6d44ec8c2591c134257ce647b7ea6b20335bf6379a27dac5f1641fcf59f99" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-result", + "windows-strings", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-implement" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-interface" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-result" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-strings" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +dependencies = [ + "windows-result", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "x11rb" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d91ffca73ee7f68ce055750bf9f6eca0780b8c85eff9bc046a3b0da41755e12" +dependencies = [ + "gethostname", + "rustix", + "x11rb-protocol", +] + +[[package]] +name = "x11rb-protocol" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec107c4503ea0b4a98ef47356329af139c0a4f7750e621cf2973cd3385ebcb3d" + +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "byteorder", + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 00000000000..a13ce613fd6 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,11 @@ +[workspace] +resolver = "2" +members = [ + "extension" +] + +[profile.release] +opt-level = "z" +lto = true +codegen-units = 1 +strip = true diff --git a/README.md b/README.md index feb9194d65a..e5df6556e02 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ The mod is **built modularly**, so almost any included PBO can be easily removed - Carrying and dragging - Realistic names for vehicles and weapons - A fire control system (FCS) for armored vehicles and helicopters -- Realistic ballistics/FCS calculated in C/C++ extensions +- Realistic ballistics/FCS calculated in Rust extensions - Backblast area and overpressure simulation - Disposable launchers - Realistic G-forces diff --git a/ace.dll b/ace.dll new file mode 100644 index 00000000000..088ffda15ba Binary files /dev/null and b/ace.dll differ diff --git a/ace_advanced_ballistics.dll b/ace_advanced_ballistics.dll deleted file mode 100644 index f5686a5a3f8..00000000000 Binary files a/ace_advanced_ballistics.dll and /dev/null differ diff --git a/ace_advanced_ballistics_x64.dll b/ace_advanced_ballistics_x64.dll deleted file mode 100644 index f1802ce5e88..00000000000 Binary files a/ace_advanced_ballistics_x64.dll and /dev/null differ diff --git a/ace_artillerytables.dll b/ace_artillerytables.dll deleted file mode 100644 index 2f5855c81a3..00000000000 Binary files a/ace_artillerytables.dll and /dev/null differ diff --git a/ace_artillerytables_x64.dll b/ace_artillerytables_x64.dll deleted file mode 100644 index 97a061c2570..00000000000 Binary files a/ace_artillerytables_x64.dll and /dev/null differ diff --git a/ace_break_line.dll b/ace_break_line.dll deleted file mode 100644 index 8fc92175fe2..00000000000 Binary files a/ace_break_line.dll and /dev/null differ diff --git a/ace_break_line_x64.dll b/ace_break_line_x64.dll deleted file mode 100644 index d021bf25d23..00000000000 Binary files a/ace_break_line_x64.dll and /dev/null differ diff --git a/ace_clipboard.dll b/ace_clipboard.dll deleted file mode 100644 index 8cf6744964f..00000000000 Binary files a/ace_clipboard.dll and /dev/null differ diff --git a/ace_clipboard_x64.dll b/ace_clipboard_x64.dll deleted file mode 100644 index db7730f0fed..00000000000 Binary files a/ace_clipboard_x64.dll and /dev/null differ diff --git a/ace_fcs.dll b/ace_fcs.dll deleted file mode 100644 index 9c2a871b3d9..00000000000 Binary files a/ace_fcs.dll and /dev/null differ diff --git a/ace_fcs_x64.dll b/ace_fcs_x64.dll deleted file mode 100644 index 4ee8dc1d896..00000000000 Binary files a/ace_fcs_x64.dll and /dev/null differ diff --git a/ace_x64.dll b/ace_x64.dll new file mode 100644 index 00000000000..98d675bde45 Binary files /dev/null and b/ace_x64.dll differ diff --git a/addons/advanced_ballistics/XEH_postInit.sqf b/addons/advanced_ballistics/XEH_postInit.sqf index 9d0dd0ee4b9..25545d02aa0 100644 --- a/addons/advanced_ballistics/XEH_postInit.sqf +++ b/addons/advanced_ballistics/XEH_postInit.sqf @@ -1,10 +1,10 @@ #include "script_component.hpp" -GVAR(currentbulletID) = -1; +#include "initKeybinds.inc.sqf" GVAR(Protractor) = false; GVAR(ProtractorStart) = CBA_missionTime; -GVAR(allBullets) = []; +GVAR(allBullets) = createHashMap; GVAR(currentGrid) = 0; if (!hasInterface) exitWith {}; @@ -24,22 +24,6 @@ if (!hasInterface) exitWith {}; // Register Perframe Handler [LINKFUNC(handleFirePFH), GVAR(simulationInterval)] call CBA_fnc_addPerFrameHandler; - - //Add warnings for missing compat PBOs (only if AB is on) - { - _x params ["_modPBO", "_compatPBO"]; - if ([_modPBO] call EFUNC(common,isModLoaded) && {!([_compatPBO] call EFUNC(common,isModLoaded))}) then { - WARNING_2("Weapon Mod [%1] missing ace compat pbo [%2] (from @ace\optionals)",_modPBO,_compatPBO); - }; - } forEach [ - ["RH_acc","ace_compat_rh_acc"], - ["RH_de_cfg","ace_compat_rh_de"], - ["RH_m4_cfg","ace_compat_rh_m4"], - ["RH_PDW","ace_compat_rh_pdw"], - ["RKSL_PMII","ace_compat_rksl_pm_ii"], - ["iansky_opt","ace_compat_sma3_iansky"], - ["R3F_Armes","ace_compat_r3f"] - ]; }] call CBA_fnc_addEventHandler; #ifdef DEBUG_MODE_FULL diff --git a/addons/advanced_ballistics/config.cpp b/addons/advanced_ballistics/config.cpp index 17647d0647d..e3fe6957d78 100644 --- a/addons/advanced_ballistics/config.cpp +++ b/addons/advanced_ballistics/config.cpp @@ -18,10 +18,3 @@ class CfgPatches { #include "CfgVehicles.hpp" #include "RscTitles.hpp" #include "ACE_Settings.hpp" - -class ACE_Extensions { - class ace_advanced_ballistics { - windows = 1; - client = 1; - }; -}; diff --git a/addons/advanced_ballistics/functions/fnc_diagnoseWeapons.sqf b/addons/advanced_ballistics/functions/fnc_diagnoseWeapons.sqf index a2156349f6d..b3f4053bdd9 100644 --- a/addons/advanced_ballistics/functions/fnc_diagnoseWeapons.sqf +++ b/addons/advanced_ballistics/functions/fnc_diagnoseWeapons.sqf @@ -80,7 +80,7 @@ for "_i" from 0 to (count _cfgWeapons)-1 do { diag_log text format ["AB_Diagnose_barrelTwist,%1,%2,%3,%4,%5",_weapon,_magazine,_ammo,_twistDirection,_barrelTwist]; }; if (_barrelLength == 0) then { - diag_log text format ["AB_Diagnose_barrelLength,%1,%2,%3,%4,%5",_weapon,_magazine,_ammo,_barrelLength]; + diag_log text format ["AB_Diagnose_barrelLength,%1,%2,%3,%4",_weapon,_magazine,_ammo,_barrelLength]; }; }; } forEach _magazines; @@ -108,16 +108,16 @@ for "_i" from 0 to (count _cfgWeapons)-1 do { }; if (_weapons find _weapon == -1) then { _weapons pushBack _weapon; - _magIndex = _magazines find _magazine; - _magSpeed = _magazineInitSpeeds select _magIndex; + private _magIndex = _magazines find _magazine; + private _magSpeed = _magazineInitSpeeds select _magIndex; _weaponInitSpeeds pushBack (_abInitialSpeed / _magSpeed); }; } forEach _data; { _x params ["_magazineIndex", "_abInitialSpeed", "_magazine", "_weapon"]; - _magIndex = _magazines find _magazine; - _magSpeed = _magazineInitSpeeds select _magIndex; - _wepIndex = _weapons find _weapon; + private _magIndex = _magazines find _magazine; + private _magSpeed = _magazineInitSpeeds select _magIndex; + private _wepIndex = _weapons find _weapon; _wepSpeed = _weaponInitSpeeds select _wepIndex; } forEach _data; { diff --git a/addons/advanced_ballistics/functions/fnc_displayProtractor.sqf b/addons/advanced_ballistics/functions/fnc_displayProtractor.sqf index ceaef17badf..a426f6ba99a 100644 --- a/addons/advanced_ballistics/functions/fnc_displayProtractor.sqf +++ b/addons/advanced_ballistics/functions/fnc_displayProtractor.sqf @@ -50,7 +50,7 @@ GVAR(Protractor) = true; __ctrl1 ctrlSetTextColor [1, 1, 1, 1]; __ctrl2 ctrlSetScale 1; - __ctrl2 ctrlSetPosition [SafeZoneX + 0.001, SafeZoneY - 0.001 - 0.1074 * (-0.86 max ((ACE_player weaponDirection currentWeapon ACE_player) select 2) min 0.86), 0.2, 0.2 * 4/3]; + __ctrl2 ctrlSetPosition [safeZoneX + 0.001, safeZoneY - 0.001 - 0.1074 * (-0.86 max ((ACE_player weaponDirection currentWeapon ACE_player) select 2) min 0.86), 0.2, 0.2 * 4/3]; __ctrl2 ctrlCommit 0; __ctrl2 ctrlSetText QPATHTOF(UI\protractor_marker.paa); __ctrl2 ctrlSetTextColor [1, 1, 1, 1]; diff --git a/addons/advanced_ballistics/functions/fnc_handleFirePFH.sqf b/addons/advanced_ballistics/functions/fnc_handleFirePFH.sqf index e9180cb1c44..9c359bf833e 100644 --- a/addons/advanced_ballistics/functions/fnc_handleFirePFH.sqf +++ b/addons/advanced_ballistics/functions/fnc_handleFirePFH.sqf @@ -1,6 +1,6 @@ #include "..\script_component.hpp" /* - * Author: Glowbal, Ruthberg, joko // Jonas + * Author: Glowbal, Ruthberg, joko // Jonas, Brett Mayson * Handle the PFH for Bullets * * Arguments: @@ -17,7 +17,7 @@ private _deleted = false; { - _x params ["_bullet","_caliber","_bulletTraceVisible","_index"]; + _y params ["_bullet","_caliber","_bulletTraceVisible"]; if (alive _bullet) then { private _bulletVelocity = velocity _bullet; @@ -27,13 +27,21 @@ private _deleted = false; drop ["\A3\data_f\ParticleEffects\Universal\Refract","","Billboard",1,0.1,getPos _bullet,[0,0,0],0,1.275,1,0,[0.02*_caliber,0.01*_caliber],[[0,0,0,0.65],[0,0,0,0.2]],[1,0],0,0,"","",""]; }; - _bullet setVelocity (_bulletVelocity vectorAdd (parseSimpleArray ("ace_advanced_ballistics" callExtension format["simulate:%1:%2:%3:%4:%5:%6", _index, _bulletVelocity, _bulletPosition, wind, ASLToATL(_bulletPosition) select 2, CBA_missionTime toFixed 6]))); + ( + "ace" callExtension ["ballistics:bullet:simulate", [ + _x, + _bulletVelocity, + _bulletPosition, + wind, + ASLToATL(_bulletPosition) select 2, + CBA_missionTime toFixed 6 + ]] + ) params ["_data", "_code"]; + if (_code == 0) then { + _bullet setVelocity (_bulletVelocity vectorAdd (parseSimpleArray (_data))); + }; } else { - GVAR(allBullets) set [_forEachIndex, objNull]; - _deleted = true; + GVAR(allBullets) deleteAt _x; + "ace" callExtension ["ballistics:bullet:delete", [_x]]; }; -} forEach GVAR(allBullets); - -if (_deleted) then { - GVAR(allBullets) = GVAR(allBullets) - [objNull]; -}; +} forEach GVAR(allBullets) diff --git a/addons/advanced_ballistics/functions/fnc_handleFired.sqf b/addons/advanced_ballistics/functions/fnc_handleFired.sqf index ff2fe85ae4f..7d00168160f 100644 --- a/addons/advanced_ballistics/functions/fnc_handleFired.sqf +++ b/addons/advanced_ballistics/functions/fnc_handleFired.sqf @@ -1,6 +1,6 @@ #include "..\script_component.hpp" /* - * Author: Glowbal, Ruthberg + * Author: Glowbal, Ruthberg, Brett Mayson * * Handles advanced ballistics for (BulletBase) projectiles. Called from the unified fired EH only for players. * @@ -62,11 +62,11 @@ if (_abort) exitWith {}; // Get Weapon and Ammo Configurations private _AmmoCacheEntry = uiNamespace getVariable format[QGVAR(%1), _ammo]; if (isNil "_AmmoCacheEntry") then { - _AmmoCacheEntry = _ammo call FUNC(readAmmoDataFromConfig); + _AmmoCacheEntry = _ammo call FUNC(readAmmoDataFromConfig); }; private _WeaponCacheEntry = uiNamespace getVariable format[QGVAR(%1), _weapon]; if (isNil "_WeaponCacheEntry") then { - _WeaponCacheEntry = _weapon call FUNC(readWeaponDataFromConfig); + _WeaponCacheEntry = _weapon call FUNC(readWeaponDataFromConfig); }; _AmmoCacheEntry params ["_airFriction", "_caliber", "_bulletLength", "_bulletMass", "_transonicStabilityCoef", "_dragModel", "_ballisticCoefficients", "_velocityBoundaries", "_atmosphereModel", "_ammoTempMuzzleVelocityShifts", "_muzzleVelocityTable", "_barrelLengthTable", "_muzzleVelocityVariationSD"]; @@ -120,8 +120,26 @@ if (_caliber * _bulletLength * _bulletMass * _barrelTwist > 0) then { _stabilityFactor = [_caliber, _bulletLength, _bulletMass, _barrelTwist, _muzzleVelocity, _temperature, _barometricPressure] call FUNC(calculateStabilityFactor); }; -GVAR(currentbulletID) = (GVAR(currentbulletID) + 1) % 10000; - -"ace_advanced_ballistics" callExtension format["new:%1:%2:%3:%4:%5:%6:%7:%8:%9:%10:%11:%12:%13:%14:%15:%16:%17:%18", GVAR(currentbulletID), _ammoCount, _airFriction, _ballisticCoefficients, _velocityBoundaries, _atmosphereModel, _dragModel, _stabilityFactor, _twistDirection, _transonicStabilityCoef, getPosASL _projectile, _bulletVelocity, EGVAR(common,mapLatitude), EGVAR(weather,currentTemperature), EGVAR(common,mapAltitude), EGVAR(weather,currentHumidity), EGVAR(weather,currentOvercast), CBA_missionTime toFixed 6]; - -GVAR(allBullets) pushBack [_projectile, _caliber, _bulletTraceVisible, GVAR(currentbulletID)]; +("ace" callExtension [ + "ballistics:bullet:new", [ + _ammoCount, + _airFriction, + _ballisticCoefficients, + _velocityBoundaries, + _atmosphereModel, + _dragModel, + _stabilityFactor, + _twistDirection, + _transonicStabilityCoef, + _bulletVelocity, + EGVAR(common,mapLatitude), + EGVAR(weather,currentTemperature), + EGVAR(common,mapAltitude), + EGVAR(weather,currentHumidity), + EGVAR(weather,currentOvercast), + CBA_missionTime toFixed 6 + ] +]) params ["_id", "_code"]; +if (_code == 0) then { + GVAR(allBullets) set [_id, [_projectile, _caliber, _bulletTraceVisible]]; +}; diff --git a/addons/advanced_ballistics/functions/fnc_initializeTerrainExtension.sqf b/addons/advanced_ballistics/functions/fnc_initializeTerrainExtension.sqf index 89e89b9f7ea..8c908639c30 100644 --- a/addons/advanced_ballistics/functions/fnc_initializeTerrainExtension.sqf +++ b/addons/advanced_ballistics/functions/fnc_initializeTerrainExtension.sqf @@ -21,7 +21,14 @@ if (!GVAR(enabled)) exitWith {}; private _initStartTime = diag_tickTime; private _mapSize = worldSize; -if (("ace_advanced_ballistics" callExtension format["init:%1:%2", worldName, _mapSize]) == "Terrain already initialized") exitWith { +( + "ace" callExtension ["ballistics:map:init", [worldName, _mapSize]] +) params ["_data", "_code"]; +if (_code != 0) exitWith { + ERROR("Error initializing map") +}; + +if (_data == "true") exitWith { INFO_1("Terrain already initialized [world: %1]",worldName); #ifdef DEBUG_MODE_FULL systemChat "AdvancedBallistics: Terrain already initialized"; @@ -53,8 +60,7 @@ INFO_2("Starting Terrain Extension [cells: %1] [world: %2]",_gridCells,worldName private _gridCenter = [_x + 25, _y + 25]; private _gridHeight = round(getTerrainHeightASL _gridCenter); private _gridNumObjects = count (_gridCenter nearObjects ["Building", 50]); - private _gridSurfaceIsWater = parseNumber (surfaceIsWater _gridCenter); - "ace_advanced_ballistics" callExtension format["set:%1:%2:%3", _gridHeight, _gridNumObjects, _gridSurfaceIsWater]; + "ace" callExtension ["ballistics:map:set", [GVAR(currentGrid), _gridHeight, _gridNumObjects, surfaceIsWater _gridCenter]]; GVAR(currentGrid) = GVAR(currentGrid) + 1; if (GVAR(currentGrid) >= _gridCells) exitWith {}; }; diff --git a/addons/advanced_ballistics/initSettings.inc.sqf b/addons/advanced_ballistics/initSettings.inc.sqf index 957044f343a..28a1d6d8262 100644 --- a/addons/advanced_ballistics/initSettings.inc.sqf +++ b/addons/advanced_ballistics/initSettings.inc.sqf @@ -5,7 +5,9 @@ private _category = format ["ACE %1", localize LSTRING(DisplayName)]; [LSTRING(enabled_DisplayName), LSTRING(enabled_Description)], _category, false, - 1 + 1, + {[QGVAR(enabled), _this] call EFUNC(common,cbaSettings_settingChanged)}, + true // Needs mission restart ] call CBA_fnc_addSetting; [ @@ -45,5 +47,7 @@ private _category = format ["ACE %1", localize LSTRING(DisplayName)]; [LSTRING(simulationInterval_DisplayName), LSTRING(simulationInterval_Description)], _category, [0, 0.2, 0.05, 2], - 1 + 1, + {[QGVAR(simulationInterval), _this] call EFUNC(common,cbaSettings_settingChanged)}, + true // Needs mission restart ] call CBA_fnc_addSetting; diff --git a/addons/advanced_ballistics/stringtable.xml b/addons/advanced_ballistics/stringtable.xml index b077f53b6ae..67022f7deba 100644 --- a/addons/advanced_ballistics/stringtable.xml +++ b/addons/advanced_ballistics/stringtable.xml @@ -46,7 +46,7 @@ <Hungarian>Fejlett ballisztika</Hungarian> <Russian>Продвинутая баллистика</Russian> <Italian>Balistica Avanzata</Italian> - <Japanese>アドバンスド弾道計算</Japanese> + <Japanese>高度な弾道計算</Japanese> <Korean>고급 탄도학</Korean> <Chinese>先進彈道系統</Chinese> <Chinesesimp>进阶弹道系统</Chinesesimp> @@ -63,7 +63,7 @@ <Hungarian>Fejlett ballisztika</Hungarian> <Russian>Продвинутая баллистика</Russian> <Italian>Balistica Avanzata</Italian> - <Japanese>アドバンスド弾道計算を有効化</Japanese> + <Japanese>高度な弾道計算を有効化</Japanese> <Korean>고급 탄도학</Korean> <Chinese>先進彈道系統</Chinese> <Chinesesimp>进阶弹道系统</Chinesesimp> @@ -80,7 +80,7 @@ <Hungarian>Engedélyezi a fejlett ballisztikát</Hungarian> <Russian>Включает продвинутую баллистику</Russian> <Italian>Abilita Balistica Avanzata</Italian> - <Japanese>アドバンスド弾道計算は高度な弾道計算処理を有効化します。</Japanese> + <Japanese>高度な弾道計算を有効化します。</Japanese> <Korean>고급 탄도학을 적용합니다</Korean> <Chinese>啟用先進彈道系統</Chinese> <Chinesesimp>启用进阶弹道系统</Chinesesimp> @@ -280,7 +280,7 @@ <Hungarian>Meghatározza a játékos körüli hatókört (méterben), ahol a lövedékek fejlett ballisztikát használnak</Hungarian> <Russian>Определяет радиус вокруг игрока (в метрах), в котором продвинутая баллистика применяется к снарядам</Russian> <Italian>Definisce il raggio attorno al giocatore (in metri) entro il quale la Balistica Avanzata è applicata ai proiettili</Italian> - <Japanese>アドバンスド弾道計算の適用半径範囲 (プレイヤー中心、メートル単位) を定義します。</Japanese> + <Japanese>高度な弾道計算が飛翔体に適用される半径距離 (プレイヤー中心、メートル単位) を定義します。</Japanese> <Korean>플레이어 주위의 발사체를 고급 탄도학으로 정의하는 범위를 정합니다(미터)</Korean> <Chinese>以玩家的半徑距離(公尺)定義先進彈道系統啟用範圍</Chinese> <Chinesesimp>定义玩家周围的半径(米),在这个半径内,进阶弹道系统会被启用</Chinesesimp> @@ -297,7 +297,7 @@ <Russian>Этот модуль включает симуляцию продвинутой баллистики - при этом на траекторию полета снаряда влияют различные параметры, такие как температура воздуха, атмосферное давление, влажность, гравитация, тип боеприпаса и оружия, из которого произвели выстрел.</Russian> <Spanish>Este módulo permite la simulación balística avanzada - es decir, la trayectoria de los proyectiles está influenciada por variables como la temperatura del aire, la presión atmosférica, la humedad, la gravedad, el tipo de municiones y el arma desde el que fue disparada.</Spanish> <Italian>Questo modulo abilita la simulazione della Balistica Avanzata - essa comporta che la traiettoria dei proiettili è influenzata da variabili come la temperatura dell'aria, pressione atmosferica, umidità, gravità, il tipo di munizione e l'arma da cui è sparata.</Italian> - <Japanese>アドバンスド弾道計算のシミュレーションを有効化します。 弾道は気温・気圧・湿度・重力・弾薬の種類・発射する武器などの変化による影響を受けるようになります。</Japanese> + <Japanese>高度な弾道計算のシミュレーションを有効化します。 弾道は気温・気圧・湿度・重力・弾薬の種類・発射する武器などの変化による影響を受けるようになります。</Japanese> <Korean>이 모듈은 고급 탄도학을 적용시킵니다 - 이는 발사체의 궤적이 기온, 대기압, 습도, 중력, 탄환의 종류와 어느 무기에서 발사되는지에 따라 영향을 받습니다.</Korean> <Chinese>該模塊實現先進的彈道仿真 - 這意味著子彈的軌跡是由空氣溫度、大氣壓力、濕度、重力、彈藥類型以及射擊的武器所影響</Chinese> <Chinesesimp>该模块实现增强的弹道模拟—子弹的轨迹由空气温度、大气压力、湿度、重力、弹药类型和射击的武器等变量所影响</Chinesesimp> diff --git a/addons/advanced_fatigue/CfgEden.hpp b/addons/advanced_fatigue/CfgEden.hpp index 8307c8a2a57..50147c8e8c6 100644 --- a/addons/advanced_fatigue/CfgEden.hpp +++ b/addons/advanced_fatigue/CfgEden.hpp @@ -2,9 +2,35 @@ class Cfg3DEN { class Attributes { class Slider; class GVAR(slider): Slider { - attributeLoad = "params [""_ctrlGroup""]; private _slider = _ctrlGroup controlsGroupCtrl 100; private _edit = _ctrlGroup controlsGroupCtrl 101; _slider sliderSetPosition _value; _edit ctrlSetText ([_value, 1, 1] call CBA_fnc_formatNumber); "; - attributeSave = "params [""_ctrlGroup""]; sliderPosition (_ctrlGroup controlsGroupCtrl 100); "; - onLoad = "params [""_ctrlGroup""]; private _slider = _ctrlGroup controlsGroupCtrl 100; private _edit = _ctrlGroup controlsGroupCtrl 101; _slider sliderSetRange [0, 2]; _slider ctrlAddEventHandler [""SliderPosChanged"", { params [""_slider""]; private _edit = (ctrlParentControlsGroup _slider) controlsGroupCtrl 101; private _value = sliderPosition _slider; _edit ctrlSetText ([_value, 1, 1] call CBA_fnc_formatNumber); }]; _edit ctrlAddEventHandler [""KillFocus"", { params [""_edit""]; private _slider = (ctrlParentControlsGroup _edit) controlsGroupCtrl 100; private _value = ((parseNumber ctrlText _edit) min 2) max 0; _slider sliderSetPosition _value; _edit ctrlSetText str _value; }];"; + #pragma hemtt suppress pw3_padded_arg + attributeLoad = QUOTE(\ + params ['_ctrlGroup']; \ + private _slider = _ctrlGroup controlsGroupCtrl 100; \ + private _edit = _ctrlGroup controlsGroupCtrl 101; \ + _slider sliderSetPosition _value; \ + _edit ctrlSetText ([ARR_3(_value,1,1)] call CBA_fnc_formatNumber); \ + ); + attributeSave = QUOTE(params ['_ctrlGroup']; sliderPosition (_ctrlGroup controlsGroupCtrl 100)); + #pragma hemtt suppress pw3_padded_arg + onLoad = QUOTE(\ + params ['_ctrlGroup']; \ + private _slider = _ctrlGroup controlsGroupCtrl 100; \ + private _edit = _ctrlGroup controlsGroupCtrl 101; \ + _slider sliderSetRange [ARR_2(0,MAX_PERFORMANCE_FACTOR)]; \ + _slider ctrlAddEventHandler [ARR_2('SliderPosChanged',{ \ + params ['_slider']; \ + private _edit = (ctrlParentControlsGroup _slider) controlsGroupCtrl 101; \ + private _value = sliderPosition _slider; \ + _edit ctrlSetText ([ARR_3(_value,1,1)] call CBA_fnc_formatNumber); \ + })]; \ + _edit ctrlAddEventHandler [ARR_2('KillFocus',{ \ + params ['_edit']; \ + private _slider = (ctrlParentControlsGroup _edit) controlsGroupCtrl 100; \ + private _value = ((parseNumber ctrlText _edit) min MAX_PERFORMANCE_FACTOR) max 0; \ + _slider sliderSetPosition _value; \ + _edit ctrlSetText str _value; \ + })]; \ + ); }; }; class Object { diff --git a/addons/advanced_fatigue/Dialog.hpp b/addons/advanced_fatigue/Dialog.hpp index df019f3800c..7b57e00ced9 100644 --- a/addons/advanced_fatigue/Dialog.hpp +++ b/addons/advanced_fatigue/Dialog.hpp @@ -2,18 +2,18 @@ class RscControlsGroupNoScrollbars; class RscPicture; class GVAR(StaminaBarContainer): RscControlsGroupNoScrollbars { - x = "(profilenamespace getvariable [""IGUI_GRID_STAMINA_X"", ((safezoneX + safezoneW) - (10 * (((safezoneW / safezoneH) min 1.2) / 40)) - 4.3 * (((safezoneW / safezoneH) min 1.2) / 40))])"; - y = "(profilenamespace getvariable [""IGUI_GRID_STAMINA_Y"", (safezoneY + 4.05 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25))])"; - w = "10 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "0.15 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = "(profilenamespace getvariable [""IGUI_GRID_STAMINA_X"", ((safeZoneX + safeZoneW) - (10 * (((safeZoneW / safeZoneH) min 1.2) / 40)) - 4.3 * (((safeZoneW / safeZoneH) min 1.2) / 40))])"; + y = "(profilenamespace getvariable [""IGUI_GRID_STAMINA_Y"", (safeZoneY + 4.05 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25))])"; + w = "10 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "0.15 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; class Controls { class StaminaBar: RscPicture { idc = 10; x = 0; y = 0; - w = "10 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "0.15 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w = "10 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "0.15 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; text = "\A3\Ui_f\data\IGUI\RscIngameUI\RscUnitInfo\stamina_ca.paa"; }; }; diff --git a/addons/advanced_fatigue/XEH_PREP.hpp b/addons/advanced_fatigue/XEH_PREP.hpp index 22bb99617a7..509c85e3755 100644 --- a/addons/advanced_fatigue/XEH_PREP.hpp +++ b/addons/advanced_fatigue/XEH_PREP.hpp @@ -10,3 +10,4 @@ PREP(mainLoop); PREP(moduleSettings); PREP(removeDutyFactor); PREP(renderDebugLines); +PREP(updateStaminaBar); diff --git a/addons/advanced_fatigue/XEH_postInit.sqf b/addons/advanced_fatigue/XEH_postInit.sqf index 519d218b8cd..e3b75a64a61 100644 --- a/addons/advanced_fatigue/XEH_postInit.sqf +++ b/addons/advanced_fatigue/XEH_postInit.sqf @@ -14,6 +14,8 @@ call FUNC(renderDebugLines); ["CBA_settingsInitialized", { if (!GVAR(enabled)) exitWith {}; + [QEGVAR(ui,hideHud), LINKFUNC(updateStaminaBar)] call CBA_fnc_addEventHandler; + ["baseline", { private _fatigue = ACE_player getVariable [QGVAR(aimFatigue), 0]; switch (stance ACE_player) do { diff --git a/addons/advanced_fatigue/XEH_preInit.sqf b/addons/advanced_fatigue/XEH_preInit.sqf index 643b7b0be00..ed1bd966229 100644 --- a/addons/advanced_fatigue/XEH_preInit.sqf +++ b/addons/advanced_fatigue/XEH_preInit.sqf @@ -8,7 +8,7 @@ PREP_RECOMPILE_END; #include "initSettings.inc.sqf" -GVAR(staminaBarWidth) = 10 * (((safezoneW / safezoneH) min 1.2) / 40); +GVAR(staminaBarWidth) = 10 * (((safeZoneW / safeZoneH) min 1.2) / 40); GVAR(dutyList) = createHashMap; GVAR(setAnimExclusions) = []; GVAR(inertia) = 0; diff --git a/addons/advanced_fatigue/functions/fnc_mainLoop.sqf b/addons/advanced_fatigue/functions/fnc_mainLoop.sqf index a07abae7944..2955e9d6ee0 100644 --- a/addons/advanced_fatigue/functions/fnc_mainLoop.sqf +++ b/addons/advanced_fatigue/functions/fnc_mainLoop.sqf @@ -27,9 +27,18 @@ if (!alive ACE_player) exitWith { private _velocity = velocity ACE_player; private _normal = surfaceNormal (getPosWorld ACE_player); private _movementVector = vectorNormalized _velocity; -private _sideVector = vectorNormalized (_movementVector vectorCrossProduct _normal); private _fwdAngle = asin (_movementVector select 2); -private _sideAngle = asin (_sideVector select 2); +private _sideAngle = if ((getPosATL ACE_player) select 2 > 0.01) then { + 0 // ignore terrain normal if not touching it +} else { + private _sideVector = vectorNormalized (_movementVector vectorCrossProduct _normal); + asin (_sideVector select 2); +}; +if (GVAR(isSwimming)) then { // ignore when floating + _fwdAngle = 0; + _sideAngle = 0; +}; + private _currentWork = REE; private _currentSpeed = (vectorMagnitude _velocity) min 6; @@ -62,14 +71,15 @@ if (isNull objectParent ACE_player && {_currentSpeed > 0.1} && {isTouchingGround }; // Used to simulate the unevenness/roughness of the terrain - if ((getPosATL ACE_player) select 2 < 0.01) then { + if (_sideAngle != 0) then { private _sideGradient = abs (_sideAngle / 45) min 1; _terrainFactor = 1 + _sideGradient ^ 4; }; }; - _currentWork = [_duty, _gearMass, _terrainGradient * GVAR(terrainGradientFactor), _terrainFactor, _currentSpeed] call FUNC(getMetabolicCosts); + // Add a scaling factor of 0.1 to reduce excessive stamina consumption on default settings (see #10361) + _currentWork = [_duty, _gearMass, _terrainGradient * GVAR(terrainGradientFactor) * 0.1, _terrainFactor, _currentSpeed] call FUNC(getMetabolicCosts); _currentWork = _currentWork max REE; }; @@ -140,7 +150,7 @@ systemChat format ["---- velocity %1 - respiratoryRate: %2 ----", (vectorMagnitu [ACE_player, _perceivedFatigue, GVAR(anReserve) == 0, _fwdAngle, _sideAngle] call FUNC(handleEffects); -if (GVAR(enableStaminaBar)) then { +if (GVAR(enableStaminaBarRealized)) then { [GVAR(anReserve) / AN_MAXRESERVE] call FUNC(handleStaminaBar); }; diff --git a/addons/advanced_fatigue/functions/fnc_updateStaminaBar.sqf b/addons/advanced_fatigue/functions/fnc_updateStaminaBar.sqf new file mode 100644 index 00000000000..627430c8201 --- /dev/null +++ b/addons/advanced_fatigue/functions/fnc_updateStaminaBar.sqf @@ -0,0 +1,25 @@ +#include "..\script_component.hpp" +/* + * Author: PabstMirror + * Updates the stamina bar state + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ace_advanced_fatigue_fnc_updateStaminaBar + * + * Public: No + */ + +GVAR(enableStaminaBarRealized) = GVAR(enabled) && GVAR(enableStaminaBar) && {!(missionNamespace getVariable [QEGVAR(ui,hideHud), false])}; +TRACE_1("updateStaminaBar",GVAR(enableStaminaBarRealized)); + +private _staminaBarContainer = uiNamespace getVariable [QGVAR(staminaBarContainer), controlNull]; +if (isNull _staminaBarContainer) exitWith {}; + +_staminaBarContainer ctrlSetFade ([1, 0] select GVAR(enableStaminaBarRealized)); +_staminaBarContainer ctrlCommit 0; diff --git a/addons/advanced_fatigue/initSettings.inc.sqf b/addons/advanced_fatigue/initSettings.inc.sqf index 01eba8652dc..bd8bd7d9281 100644 --- a/addons/advanced_fatigue/initSettings.inc.sqf +++ b/addons/advanced_fatigue/initSettings.inc.sqf @@ -6,12 +6,7 @@ true, 1, { - if (!_this) then { - private _staminaBarContainer = uiNamespace getVariable [QGVAR(staminaBarContainer), controlNull]; - _staminaBarContainer ctrlSetFade 1; - _staminaBarContainer ctrlCommit 0; - }; - + call FUNC(updateStaminaBar); [QGVAR(enabled), _this] call EFUNC(common,cbaSettings_settingChanged) }, true // Needs mission restart @@ -24,13 +19,7 @@ LSTRING(DisplayName), true, 1, - { - if (!_this) then { - private _staminaBarContainer = uiNamespace getVariable [QGVAR(staminaBarContainer), controlNull]; - _staminaBarContainer ctrlSetFade 1; - _staminaBarContainer ctrlCommit 0; - }; - } + {call FUNC(updateStaminaBar)} ] call CBA_fnc_addSetting; [ @@ -54,7 +43,7 @@ "SLIDER", [LSTRING(PerformanceFactor), LSTRING(PerformanceFactor_Description)], LSTRING(DisplayName), - [0, 10, 1, 2], + [0, MAX_PERFORMANCE_FACTOR, 1, 2], 1, { // Recalculate values if the setting is changed mid-mission diff --git a/addons/advanced_fatigue/script_component.hpp b/addons/advanced_fatigue/script_component.hpp index 7e3255439ff..11228ff3f25 100644 --- a/addons/advanced_fatigue/script_component.hpp +++ b/addons/advanced_fatigue/script_component.hpp @@ -41,3 +41,5 @@ #define AE1_MAXRESERVE 4000000 // mmol #define AE2_MAXRESERVE 84000 // mmol #define AN_MAXRESERVE 2300 // mmol + +#define MAX_PERFORMANCE_FACTOR 10 diff --git a/addons/advanced_fatigue/stringtable.xml b/addons/advanced_fatigue/stringtable.xml index 5cd36ffce60..76e33a64e5f 100644 --- a/addons/advanced_fatigue/stringtable.xml +++ b/addons/advanced_fatigue/stringtable.xml @@ -7,7 +7,7 @@ <German>ACE Erweiterte Ausdauer</German> <Chinese>ACE 進階疲勞</Chinese> <Chinesesimp>ACE 进阶体力</Chinesesimp> - <Japanese>ACE アドバンスド疲労</Japanese> + <Japanese>ACE 高度な疲労</Japanese> <Italian>ACE Fatica Avanzata</Italian> <Korean>ACE 고급 피로도</Korean> <French>ACE Fatigue avancée</French> @@ -173,7 +173,7 @@ <English>Enables/disables Advanced Fatigue.</English> <Spanish>Activa/desactiva la fatiga avanzada</Spanish> <German>Aktiviert/deaktiviert Advanced Fatigue.</German> - <Japanese>アドバンスド疲労は高度な疲労管理システムを有効化します。</Japanese> + <Japanese>高度な疲労を有効/無効化します。</Japanese> <Polish>Włącza/wyłącza zaawansowaną wytrzymałość</Polish> <Korean>고급 피로도 활성화/비활성화</Korean> <French>Active/Désactive la fatigue avancée.</French> diff --git a/addons/advanced_throwing/functions/fnc_throw.sqf b/addons/advanced_throwing/functions/fnc_throw.sqf index d6b38a6a0c7..d1773373411 100644 --- a/addons/advanced_throwing/functions/fnc_throw.sqf +++ b/addons/advanced_throwing/functions/fnc_throw.sqf @@ -89,7 +89,7 @@ GVAR(flightPath) = []; GVAR(flightRotation) = []; (_unit getVariable QGVAR(activeThrowable)) spawn { while {!isNull _this && {(getPosATL _this) select 2 > 0.05}} do { - GVAR(flightPath) pushBack [ASLtoAGL (getPosASL _this), vectorUp _this]; + GVAR(flightPath) pushBack [ASLToAGL (getPosASL _this), vectorUp _this]; sleep 0.05; }; }; diff --git a/addons/advanced_throwing/stringtable.xml b/addons/advanced_throwing/stringtable.xml index fc9cf2705a5..99fba866305 100644 --- a/addons/advanced_throwing/stringtable.xml +++ b/addons/advanced_throwing/stringtable.xml @@ -5,7 +5,7 @@ <English>Advanced Throwing</English> <Spanish>Lanzamiento Avanzado</Spanish> <Russian>Улучшенный бросок гранат</Russian> - <Japanese>アドバンスド投擲</Japanese> + <Japanese>高度な投擲</Japanese> <Polish>Zaawansowane rzucanie</Polish> <German>Erweitertes Wurfsystem</German> <Korean>고급 투척</Korean> @@ -21,7 +21,7 @@ <English>Allows changing advanced throwing behaviour.</English> <Spanish>Permite modificar el comportamiento del lanzamiento avanzado</Spanish> <Russian>Позволяет настраивать поведение улучшенного броска гранат.</Russian> - <Japanese>アドバンスド投擲は投擲の高度な動作挙動を変更可能にします。</Japanese> + <Japanese>高度な投擲挙動への変更を可能にします。</Japanese> <Polish>Zezwala na zmianę zachowania zaawansowanego trybu rzucania.</Polish> <German>Erlaubt es, das Verhalten des erweiterten Wurfsystems zu ändern.</German> <Korean>고급 투척 행위를 허가합니다</Korean> @@ -36,7 +36,7 @@ <English>Enable Advanced Throwing</English> <Spanish>Activar Lanzamiento Avanzado</Spanish> <Russian>Вкл. улучшенный бросок</Russian> - <Japanese>アドバンスド投擲を有効化</Japanese> + <Japanese>高度な投擲を有効化</Japanese> <Polish>Aktywuj zaawansowane rzucanie</Polish> <German>Aktiviere erweitertes Wurfsystem</German> <Korean>고급 투척 활성화 </Korean> @@ -52,7 +52,7 @@ <English>Enables advanced throwing system.</English> <Spanish>Activa el Lanzamiento Avanzado</Spanish> <Russian>Включает систему улучшенного броска.</Russian> - <Japanese>アドバンスド投擲は高度な投擲システムを有効化します。</Japanese> + <Japanese>高度な投擲システムを有効化します。</Japanese> <Polish>Aktywuje system zaawansowanego rzucania.</Polish> <German>Aktiviert das erweiterte Wurfsystem.</German> <Korean>고급 투척을 활성화 합니다</Korean> diff --git a/addons/ai/functions/fnc_drawCuratorGarrisonPathing.sqf b/addons/ai/functions/fnc_drawCuratorGarrisonPathing.sqf index 561c8748a65..8a312d95cc5 100644 --- a/addons/ai/functions/fnc_drawCuratorGarrisonPathing.sqf +++ b/addons/ai/functions/fnc_drawCuratorGarrisonPathing.sqf @@ -16,10 +16,11 @@ */ if (isNull findDisplay 312) exitWith { + //IGNORE_PRIVATE_WARNING ["_thisEventHandler"]; removeMissionEventHandler ["Draw3D", _thisEventHandler]; }; -private _unitMoveList = missionNameSpace getVariable [QGVAR(garrison_unitMoveList), []]; +private _unitMoveList = missionNamespace getVariable [QGVAR(garrison_unitMoveList), []]; { _x params ["_unit", "_pos"]; @@ -27,9 +28,9 @@ private _unitMoveList = missionNameSpace getVariable [QGVAR(garrison_unitMoveLis switch (true) do { case (surfaceIsWater (getPos _unit) && {surfaceIsWater _pos}) : { for "_i" from 0 to 3 do { - drawLine3D [_unit modelToWorldVisualWorld [0,0,1], (AGLtoASL _pos), [1,0,0,1]]; + drawLine3D [_unit modelToWorldVisualWorld [0,0,1], (AGLToASL _pos), [1,0,0,1]]; }; - drawIcon3D ["\a3\ui_f\data\map\groupicons\waypoint.paa", [1,0,0,1], (AGLtoASL _pos), 0.75, 0.75, 0.75]; + drawIcon3D ["\a3\ui_f\data\map\groupicons\waypoint.paa", [1,0,0,1], (AGLToASL _pos), 0.75, 0.75, 0.75]; }; case (!surfaceIsWater (getPos _unit) && {!surfaceIsWater _pos}) : { @@ -43,7 +44,7 @@ private _unitMoveList = missionNameSpace getVariable [QGVAR(garrison_unitMoveLis for "_i" from 0 to 3 do { drawLine3D [_unit modelToWorldVisual [0,0,1], (AGLToASL _pos), [1,0,0,1]]; }; - drawIcon3D ["\a3\ui_f\data\map\groupicons\waypoint.paa", [1,0,0,1], (AGLtoASL _pos), 0.75, 0.75, 0.75]; + drawIcon3D ["\a3\ui_f\data\map\groupicons\waypoint.paa", [1,0,0,1], (AGLToASL _pos), 0.75, 0.75, 0.75]; }; case (surfaceIsWater (getPos _unit) && {!surfaceIsWater _pos}) : { diff --git a/addons/ai/functions/fnc_garrison.sqf b/addons/ai/functions/fnc_garrison.sqf index 4b8f84fce63..042c4fde3cb 100644 --- a/addons/ai/functions/fnc_garrison.sqf +++ b/addons/ai/functions/fnc_garrison.sqf @@ -26,7 +26,7 @@ params [["_startingPos",[0,0,0], [[]], 3], ["_buildingTypes", ["Building"], [[]] TRACE_6("fnc_garrison: Start",_startingPos,_buldingTypes,count _unitsArray,_fillingRadius,_fillingTYpe,_topDownFilling); _unitsArray = _unitsArray select {alive _x && {!isPlayer _x}}; -private _currentUnitMoveList = missionNameSpace getVariable [QGVAR(garrison_unitMoveList), []]; +private _currentUnitMoveList = missionNamespace getVariable [QGVAR(garrison_unitMoveList), []]; if (_startingPos isEqualTo [0,0,0]) exitWith { TRACE_1("fnc_garrison: StartingPos error",_startingPos); @@ -57,38 +57,38 @@ if (_topDownFilling) then { // Those reverse are necessary, as dumb as it is there's no better way to sort those subarrays in sqf { reverse _x; - } foreach _buildingPos; + } forEach _buildingPos; _buildingPos sort false; { reverse _x; - } foreach _buildingPos; + } forEach _buildingPos; _buildingsIndex pushBack _buildingPos; - } foreach _buildings; + } forEach _buildings; } else { { _buildingsIndex pushBack (_x buildingPos -1); - } foreach _buildings; + } forEach _buildings; }; // Remove buildings without positions { _buildingsIndex deleteAt (_buildingsIndex find _x); -} foreach (_buildingsIndex select {count _x == 0}); +} forEach (_buildingsIndex select {count _x == 0}); //Remove positions units are already pathing to _buildingsIndex = _buildingsIndex apply { _x select { private _testedPos = _x; - ({(_x select 1) isEqualTo _testedPos} count (missionNameSpace getVariable [QGVAR(garrison_unitMoveList), []])) == 0 + ({(_x select 1) isEqualTo _testedPos} count (missionNamespace getVariable [QGVAR(garrison_unitMoveList), []])) == 0 } }; // Warn the user that there's not enough positions to place all units private _count = 0; -{_count = _count + count _x} foreach _buildingsIndex; +{_count = _count + count _x} forEach _buildingsIndex; if ( (count _unitsArray) - _count > 0) then { TRACE_4("fnc_garrison: Not enough spots to place all units",_unitsArray,count _unitsArray,_count,((count _unitsArray) - _count > 0)); [LSTRING(GarrisonNotEnoughPos)] call EFUNC(common,displayTextStructured); @@ -104,7 +104,7 @@ private _fnc_comparePos = { params ["_nearestUnits", "_pos"]; ({ if (surfaceIsWater getPos _x) then { - floor ((getPosASL _x) select 2) == floor ((AGLtoASL _pos) select 2) + floor ((getPosASL _x) select 2) == floor ((AGLToASL _pos) select 2) } else { floor ((getPosATL _x) select 2) == floor (_pos select 2) }; @@ -141,7 +141,7 @@ switch (_fillingType) do { if (_teleport) then { doStop _unit; if (_posSurface) then { - _unit setPosASL (AGLtoASL _pos); + _unit setPosASL (AGLToASL _pos); } else { _unit setPosATL _pos; }; @@ -190,7 +190,7 @@ switch (_fillingType) do { if (_teleport) then { doStop _unit; if (_posSurface) then { - _unit setPosASL (AGLtoASL _pos); + _unit setPosASL (AGLToASL _pos); } else { _unit setPosATL _pos; }; @@ -237,7 +237,7 @@ switch (_fillingType) do { if (_teleport) then { doStop _unit; if (_posSurface) then { - _unit setPosASL (AGLtoASL _pos); + _unit setPosASL (AGLToASL _pos); } else { _unit setPosATL _pos; }; @@ -261,7 +261,7 @@ switch (_fillingType) do { TRACE_1(format [ARR_2("fnc_garrison: while loop ended | %1 units ready to be treated by PFH",count _unitMoveList)],_teleport); // Update the unit list and remove duplicate positions and units -private _garrison_unitMoveList = missionNameSpace getVariable [QGVAR(garrison_unitMoveList), []]; +private _garrison_unitMoveList = missionNamespace getVariable [QGVAR(garrison_unitMoveList), []]; _garrison_unitMoveList = _garrison_unitMoveList select { _x params ["_testedUnit", "_testedPos"]; @@ -270,7 +270,7 @@ _garrison_unitMoveList = _garrison_unitMoveList select { _garrison_unitMoveList append _unitMoveList; -missionNameSpace setVariable [QGVAR(garrison_unitMoveList), _garrison_unitMoveList, true]; +missionNamespace setVariable [QGVAR(garrison_unitMoveList), _garrison_unitMoveList, true]; if (_teleport) then { [QGVAR(AISection), [_placedUnits, ["PATH"], false], _placedUnits] call CBA_fnc_targetEvent; diff --git a/addons/ai/functions/fnc_garrisonMove.sqf b/addons/ai/functions/fnc_garrisonMove.sqf index 4d1c471a0ea..46313f12e38 100644 --- a/addons/ai/functions/fnc_garrisonMove.sqf +++ b/addons/ai/functions/fnc_garrisonMove.sqf @@ -31,21 +31,21 @@ private _unitMoveListUnits = (_unitMoveList apply {_x select 0}); { _x setVariable [QGVAR(garrisonMove_failSafe), nil, true]; _x setVariable [QGVAR(garrisonMove_unitPosMemory), nil, true]; -} foreach _unitMoveListUnits; +} forEach _unitMoveListUnits; // Avoid duplicate PFHs if (isNil QGVAR(garrison_moveUnitPFH)) then { - missionNameSpace setVariable [QGVAR(garrison_moveUnitPFH), true, true]; + missionNamespace setVariable [QGVAR(garrison_moveUnitPFH), true, true]; // PFH checking if the units have reached their destination [{ params ["_args", "_pfhID"]; - private _unitMoveList = missionNameSpace getVariable [QGVAR(garrison_unitMoveList), []]; + private _unitMoveList = missionNamespace getVariable [QGVAR(garrison_unitMoveList), []]; // End PFH if all units are placed / unable to reach position if (_unitMoveList isEqualTo []) then { - missionNameSpace setVariable [QGVAR(garrison_moveUnitPFH), nil, true]; + missionNamespace setVariable [QGVAR(garrison_moveUnitPFH), nil, true]; LOG("garrisonMove PFH: PFH finished it's job | deleting PFH"); _pfhID call CBA_fnc_removePerFrameHandler; @@ -91,7 +91,7 @@ if (isNil QGVAR(garrison_moveUnitPFH)) then { } else { private _unitPos = getPos _unit; - if (surfaceisWater _unitPos) then { + if (surfaceIsWater _unitPos) then { _unitPos = getPosASL _unit; } else { _unitPos = getPosATL _unit; @@ -131,9 +131,9 @@ if (isNil QGVAR(garrison_moveUnitPFH)) then { }; }; }; - } foreach _unitMoveList; + } forEach _unitMoveList; - missionNameSpace setVariable [QGVAR(garrison_unitMoveList), _unitMoveList, true]; + missionNamespace setVariable [QGVAR(garrison_unitMoveList), _unitMoveList, true]; }; }, 0.5, []] call CBA_fnc_addPerFrameHandler; }; diff --git a/addons/ai/functions/fnc_unGarrison.sqf b/addons/ai/functions/fnc_unGarrison.sqf index 09ebc3e63da..f17d9aa4ab7 100644 --- a/addons/ai/functions/fnc_unGarrison.sqf +++ b/addons/ai/functions/fnc_unGarrison.sqf @@ -32,7 +32,7 @@ _units = _units select {local _x}; _unit setVariable [QGVAR(garrisonned), false, true]; - private _unitMoveList = missionNameSpace getVariable [QGVAR(garrison_unitMoveList), []]; + private _unitMoveList = missionNamespace getVariable [QGVAR(garrison_unitMoveList), []]; _unitMoveList deleteAt (_unitMoveList findIf {_x select 0 == _unit}); if (_leader != _unit) then { @@ -43,9 +43,9 @@ _units = _units select {local _x}; _unit doMove ((nearestBuilding (getPos _unit)) buildingExit 0); }; - if ((units _unit) findif {(_x getVariable [QGVAR(garrisonned), false]) && !isPlayer _x} == -1) then { + if ((units _unit) findIf {(_x getVariable [QGVAR(garrisonned), false]) && !isPlayer _x} == -1) then { LOG("fnc_ungarrison: enableAttack true"); (group _unit) enableAttack true; }; }; -} foreach _units; +} forEach _units; diff --git a/addons/aircraft/functions/fnc_droneSetWaypoint.sqf b/addons/aircraft/functions/fnc_droneSetWaypoint.sqf index 953b99a357a..45c18c63da2 100644 --- a/addons/aircraft/functions/fnc_droneSetWaypoint.sqf +++ b/addons/aircraft/functions/fnc_droneSetWaypoint.sqf @@ -62,6 +62,8 @@ if (_type == "FOLLOW" && {["CAManBase", "LandVehicle", "Ship"] findIf {_target i _waypoint setWaypointPosition [getPosASL _target, -1]; }; }, 3, [_vehicle, _group, _waypoint, _target]] call CBA_fnc_addPerFrameHandler; +} else { + _waypoint setWaypointType _type; }; TRACE_3("",_currentHeight,_currentLoiterRadius,_currentLoiterType); diff --git a/addons/aircraft/stringtable.xml b/addons/aircraft/stringtable.xml index 041653fe2b2..a3abe94a810 100644 --- a/addons/aircraft/stringtable.xml +++ b/addons/aircraft/stringtable.xml @@ -182,14 +182,18 @@ <Italian>Distanza di seguimento</Italian> <German>Folge-Entfernung</German> <Korean>따라가는 거리</Korean> + <French>Distance de suivi</French> <Japanese>追跡距離</Japanese> + <Russian>Расстояние отслеживания</Russian> </Key> <Key ID="STR_ACE_Aircraft_DroneFollowHint"> <English>Following unit within %1m</English> <Italian>Seguendo unità entro %1m</Italian> <German>Folgt Einheit bis zu %1m</German> <Korean>%1m 이내로 유닛을 따라갑니다</Korean> + <French>Suivre l'unité jusqu'à %1m</French> <Japanese>%1m 間隔で 目標を追跡します</Japanese> + <Russian>Отслеживание в пределах %1m</Russian> </Key> </Package> </Project> diff --git a/addons/arsenal/XEH_PREP.hpp b/addons/arsenal/XEH_PREP.hpp index 94d4739b604..d0819056f25 100644 --- a/addons/arsenal/XEH_PREP.hpp +++ b/addons/arsenal/XEH_PREP.hpp @@ -78,6 +78,7 @@ PREP(removeStat); PREP(removeVirtualItems); PREP(renameDefaultLoadout); PREP(replaceUniqueItemsLoadout); +PREP(saveLoadout); PREP(scanConfig); PREP(showItem); PREP(sortPanel); diff --git a/addons/arsenal/XEH_preInit.sqf b/addons/arsenal/XEH_preInit.sqf index 10cc3989e94..248fc16db2c 100644 --- a/addons/arsenal/XEH_preInit.sqf +++ b/addons/arsenal/XEH_preInit.sqf @@ -85,10 +85,10 @@ private _insigniaCondition = toString { // Ref fnc_addListBoxItem, 0/nil = configFile, 1 = campaignConfigFile, 2 = missionConfigFile { - GVAR(insigniaCache) set [_x, 1]; + GVAR(insigniaCache) set [configName _x, 1]; } forEach (_insigniaCondition configClasses (campaignConfigFile >> "CfgUnitInsignia")); { - GVAR(insigniaCache) set [_x, 2]; + GVAR(insigniaCache) set [configName _x, 2]; } forEach (_insigniaCondition configClasses (missionConfigFile >> "CfgUnitInsignia")); ADDON = true; diff --git a/addons/arsenal/defines.hpp b/addons/arsenal/defines.hpp index cd6d937426a..5b8a733724b 100644 --- a/addons/arsenal/defines.hpp +++ b/addons/arsenal/defines.hpp @@ -3,7 +3,7 @@ #define GRID_W (pixelW * pixelGridNoUIScale * pixelScale) #define GRID_H (pixelH * pixelGridNoUIScale * pixelScale) -#define WIDTH_TOTAL (safezoneW - 2 * (93 * GRID_W)) +#define WIDTH_TOTAL (safeZoneW - 2 * (93 * GRID_W)) #define WIDTH_GAP (WIDTH_TOTAL / 100) #define WIDTH_SINGLE ((WIDTH_TOTAL - 7 * WIDTH_GAP) / 6) @@ -154,6 +154,8 @@ #define IDC_statsPreviousPage 52 #define IDC_statsNextPage 53 #define IDC_statsCurrentPage 54 +#define IDC_statsBoxTitleBackground 55 +#define IDC_statsBoxBackground 56 #define IDC_actionsBox 90 #define IDC_actionsBackground1 90010 #define IDC_actionsBackground2 90011 @@ -360,10 +362,10 @@ _buttonCurrentMag2Ctrl ctrlCommit FADE_DELAY;\ {\ _x = _display displayCtrl _x;\ _x ctrlSetPosition [\ - safezoneX + safezoneW - 93 * GRID_W,\ - safezoneY + 14 * GRID_H,\ + safeZoneX + safeZoneW - 93 * GRID_W,\ + safeZoneY + 14 * GRID_H,\ 80 * GRID_W,\ - safezoneH - 28 * GRID_H\ + safeZoneH - 28 * GRID_H\ ];\ _x ctrlCommit 0;\ } forEach [\ @@ -406,10 +408,10 @@ _buttonCurrentMag2Ctrl ctrlCommit FADE_DELAY;\ {\ _x = _display displayCtrl _x;\ _x ctrlSetPosition [\ - safezoneX + safezoneW - 93 * GRID_W,\ - safezoneY + 14 * GRID_H,\ + safeZoneX + safeZoneW - 93 * GRID_W,\ + safeZoneY + 14 * GRID_H,\ 80 * GRID_W,\ - safezoneH - 34 * GRID_H\ + safeZoneH - 34 * GRID_H\ ];\ _x ctrlCommit 0;\ } forEach [\ @@ -426,16 +428,16 @@ if (!isNil QGVAR(customRightPanelButtons)) then {\ if (isNull (_display displayCtrl (60 + _plusId))) then {\ private _ctrl = _display ctrlCreate [QGVAR(customArsenalButton_Background), 60 + _plusId];\ _ctrl ctrlSetPosition [\ - safezoneW + safezoneX - 13 * GRID_W,\ - safezoneY + (88 + (10 * _forEachIndex)) * GRID_H\ + safeZoneW + safeZoneX - 13 * GRID_W,\ + safeZoneY + (88 + (10 * _forEachIndex)) * GRID_H\ ];\ _ctrl ctrlCommit 0;\ };\ if (isNull (_display displayCtrl (61 + _plusId))) then {\ - _ctrl = _display ctrlCreate [QGVAR(customArsenalButton_Button), 61 + _plusId];\ + private _ctrl = _display ctrlCreate [QGVAR(customArsenalButton_Button), 61 + _plusId];\ _ctrl ctrlSetPosition [\ - safezoneW + safezoneX - 10 * GRID_W,\ - safezoneY + (88 + (10 * _forEachIndex)) * GRID_H\ + safeZoneW + safeZoneX - 10 * GRID_W,\ + safeZoneY + (88 + (10 * _forEachIndex)) * GRID_H\ ];\ _ctrl ctrlSetText _picture;\ _ctrl ctrlSetTooltip _tooltip;\ @@ -446,8 +448,8 @@ if (!isNil QGVAR(customRightPanelButtons)) then {\ {\ _x = _display displayCtrl _x;\ _x ctrlSetPosition [\ - safezoneW + safezoneX - (10 + (3 * _forEachIndex)) * GRID_W,\ - safezoneY + (88 + (10 * _miscOffset)) * GRID_H\ + safeZoneW + safeZoneX - (10 + (3 * _forEachIndex)) * GRID_W,\ + safeZoneY + (88 + (10 * _miscOffset)) * GRID_H\ ];\ _x ctrlCommit 0;\ } forEach [IDC_buttonMisc, IDC_iconBackgroundMisc];\ diff --git a/addons/arsenal/functions/fnc_baseAttachment.sqf b/addons/arsenal/functions/fnc_baseAttachment.sqf index 968fd05d9b8..1d6155c9ee2 100644 --- a/addons/arsenal/functions/fnc_baseAttachment.sqf +++ b/addons/arsenal/functions/fnc_baseAttachment.sqf @@ -22,7 +22,7 @@ TRACE_1("looking up base attachment",_item); private _switchableClasses = []; -private _cfgWeapons = configfile >> "CfgWeapons"; +private _cfgWeapons = configFile >> "CfgWeapons"; private _config = _cfgWeapons >> _item; _item = configName _config; diff --git a/addons/arsenal/functions/fnc_baseWeapon.sqf b/addons/arsenal/functions/fnc_baseWeapon.sqf index abeb0e0ab9b..2b1b219e65c 100644 --- a/addons/arsenal/functions/fnc_baseWeapon.sqf +++ b/addons/arsenal/functions/fnc_baseWeapon.sqf @@ -20,7 +20,7 @@ params [["_weapon", "", [""]]]; // Check if item is cached (uiNamespace getVariable QGVAR(baseWeaponNameCache)) getOrDefaultCall [toLowerANSI _weapon, { - private _cfgWeapons = configfile >> "CfgWeapons"; + private _cfgWeapons = configFile >> "CfgWeapons"; private _config = _cfgWeapons >> _weapon; // If class doesn't exist, exit diff --git a/addons/arsenal/functions/fnc_buttonExport.sqf b/addons/arsenal/functions/fnc_buttonExport.sqf index 3e5039a5040..abf7c7d6fcb 100644 --- a/addons/arsenal/functions/fnc_buttonExport.sqf +++ b/addons/arsenal/functions/fnc_buttonExport.sqf @@ -26,28 +26,27 @@ if (GVAR(shiftState)) then { switch (true) do { // Beginning case (_index == -1): { - "ace_clipboard" callExtension (format ["[%1", endl]); + "ace" callExtension ["clipboard:append", [format ["[%1", endl]]]; }; // End case (_index == _listLength): { - "ace_clipboard" callExtension "];"; + "ace" callExtension ["clipboard:append", ["];"]]; }; // Rest default { - "ace_clipboard" callExtension ([" ", str (GVAR(defaultLoadoutsList) select _index), [",", ""] select (_index == _listLength - 1), endl] joinString ""); + "ace" callExtension ["clipboard:append", [[" ", str (GVAR(defaultLoadoutsList) select _index), [",", ""] select (_index == _listLength - 1), endl] joinString ""]]; }; }; }; - "ace_clipboard" callExtension "--COMPLETE--"; + "ace" callExtension ["clipboard:complete", []]; [_display, LLSTRING(exportDefault)] call FUNC(message); } else { // Export singular loadout private _export = str (GVAR(center) call CBA_fnc_getLoadout); - - "ace_clipboard" callExtension (_export + ";"); - "ace_clipboard" callExtension "--COMPLETE--"; + "ace" callExtension ["clipboard:append", [_export]]; + "ace" callExtension ["clipboard:complete", []]; [_display, LLSTRING(exportCurrent)] call FUNC(message); }; diff --git a/addons/arsenal/functions/fnc_buttonImport.sqf b/addons/arsenal/functions/fnc_buttonImport.sqf index 8a83fe3ff0c..494bf159daa 100644 --- a/addons/arsenal/functions/fnc_buttonImport.sqf +++ b/addons/arsenal/functions/fnc_buttonImport.sqf @@ -16,7 +16,13 @@ params ["_display"]; // Can be either a singular loadout or an array of loadouts -private _extendedLoadout = call compile copyFromClipboard; +private _extendedLoadout = if (isMultiplayer) then { + ("ace" callExtension ["clipboard:loadout", []]) params ["_loadout", "_code"]; + if (_code != 0) exitWith {}; + parseSimpleArray _loadout +} else { + call compile copyFromClipboard +}; // If error, exit if (isNil "_extendedLoadout" || {!(_extendedLoadout isEqualType [])}) exitWith { diff --git a/addons/arsenal/functions/fnc_handleStats.sqf b/addons/arsenal/functions/fnc_handleStats.sqf index b5d435a101e..0511c05a25a 100644 --- a/addons/arsenal/functions/fnc_handleStats.sqf +++ b/addons/arsenal/functions/fnc_handleStats.sqf @@ -19,6 +19,8 @@ params ["_display", "_control", "_curSel", ["_itemCfg", configNull]]; private _statsBoxCtrl = _display displayCtrl IDC_statsBox; +private _statsBoxTitleBackgroundCtrl = _display displayCtrl IDC_statsBoxTitleBackground; +private _statsBoxBackgroundCtrl = _display displayCtrl IDC_statsBoxBackground; private _statsPreviousPageCtrl = _display displayCtrl IDC_statsPreviousPage; private _statsNextPageCtrl = _display displayCtrl IDC_statsNextPage; private _statsCurrentPageCtrl = _display displayCtrl IDC_statsCurrentPage; @@ -53,7 +55,7 @@ private _fnc_hideEverything = { // Hide the stats box _statsBoxCtrl ctrlSetPosition [ (0.5 - WIDTH_TOTAL / 2) + WIDTH_GAP, - safezoneY + 1.8 * GRID_H, + safeZoneY + 1.8 * GRID_H, 0, 0 ]; @@ -62,7 +64,7 @@ private _fnc_hideEverything = { // Move action display private _ctrl = _display displayCtrl IDC_actionsBox; private _pos = ctrlPosition _ctrl; - _pos set [1, safezoneY + 1.8 * GRID_H]; + _pos set [1, safeZoneY + 1.8 * GRID_H]; _ctrl ctrlSetPosition _pos; _ctrl ctrlCommit 0; @@ -111,6 +113,7 @@ private _fnc_handleStats = { private _statsBarCtrl = controlNull; private _statsTextCtrl = controlNull; private _textStatementResult = ""; + private _lastCtrl = _statsBoxTitleBackgroundCtrl; { _x params ["", "_configEntry", "_title", "_bools", "_statements"]; @@ -127,6 +130,17 @@ private _fnc_handleStats = { _statsTitleCtrl ctrlSetText _title; _statsTitleCtrl ctrlSetFade 0; + // Vertical Position + ctrlPosition _lastCtrl params ["", "_lastPosY", "", "_lastPosH"]; + _statsTitleCtrl ctrlSetPositionY (_lastPosY + _lastPosH + GRID_H); + { + _x ctrlSetPositionY (_lastPosY + _lastPosH + GRID_H + (5 * GRID_H)); + } forEach [ + _statsBackgroundCtrl, + _statsBarCtrl, + _statsTextCtrl + ]; + // Handle bars if (_showBar) then { _statsBarCtrl progressSetPosition ([_configEntry, _itemCfg] call _barStatement); @@ -140,18 +154,39 @@ private _fnc_handleStats = { // Handle text entries if (_showText) then { _textStatementResult = [_configEntry, _itemCfg] call _textStatement; - - if !(_textStatementResult isEqualtype "") then { - _textStatementResult = str _textStatementResult; + if (_textStatementResult isEqualType []) then { + _textStatementResult = _textStatementResult joinString endl; + } else { + if !(_textStatementResult isEqualType "") then { + _textStatementResult = str _textStatementResult; + }; }; _statsTextCtrl ctrlSetText _textStatementResult; _statsTextCtrl ctrlSetTextColor ([[1, 1, 1, 1], [0, 0, 0, 1]] select (_showBar)); + + //Height based on Text lines + { + _x ctrlSetPositionH (ctrlTextHeight _statsTextCtrl); + } forEach [ + _statsBackgroundCtrl, + _statsBarCtrl, + _statsTextCtrl + ]; + _statsTextCtrl ctrlSetFade 0; } else { _statsTextCtrl ctrlSetFade 1; + //Ensure default height + { + _x ctrlSetPositionH (5 * GRID_H); + } forEach [ + _statsBackgroundCtrl, + _statsBarCtrl, + _statsTextCtrl + ]; }; - + { _x ctrlCommit 0; } forEach [ @@ -160,24 +195,29 @@ private _fnc_handleStats = { _statsBarCtrl, _statsTextCtrl ]; + + _lastCtrl = _statsTextCtrl; + } forEach _statsToDisplay; // Resize the window (5 - _statsCount) call _fnc_hideUnused; - private _height = 10 * _statsCount + 5; + ctrlPosition _lastCtrl params ["", "_lastPosY", "", "_lastPosH"]; _statsBoxCtrl ctrlSetPosition [ (0.5 - WIDTH_TOTAL / 2) + WIDTH_GAP, - safezoneY + 1.8 * GRID_H, + safeZoneY + 1.8 * GRID_H, 47 * GRID_W, - _height * GRID_H + _lastPosY + _lastPosH + GRID_H ]; + _statsBoxBackgroundCtrl ctrlSetPositionH (_lastPosY + _lastPosH + GRID_H); + _statsBoxBackgroundCtrl ctrlCommit 0; _statsBoxCtrl ctrlCommit 0; // Move the actions box private _ctrl = _display displayCtrl IDC_actionsBox; private _pos = ctrlPosition _ctrl; - _pos set [1, safezoneY + (_height + 3.6) * GRID_H]; + _pos set [1, safeZoneY + (_lastPosY + _lastPosH + GRID_H + (3.6 * GRID_H))]; _ctrl ctrlSetPosition _pos; _ctrl ctrlCommit 0; diff --git a/addons/arsenal/functions/fnc_itemInfo.sqf b/addons/arsenal/functions/fnc_itemInfo.sqf index 676783a8b54..2662600aaee 100644 --- a/addons/arsenal/functions/fnc_itemInfo.sqf +++ b/addons/arsenal/functions/fnc_itemInfo.sqf @@ -32,11 +32,11 @@ if (isClass _itemCfg) then { (_display displayCtrl IDC_infoName) ctrlSetText ([_control lbText _curSel, _control lnbText [_curSel, 1]] select (ctrlType _control == CT_LISTNBOX)); private _itemAuthor = getText (_itemCfg >> "author"); - (_display displayctrl IDC_infoAuthor) ctrlSetText ([localize "STR_AUTHOR_UNKNOWN", format [localize "STR_FORMAT_AUTHOR_SCRIPTED", _itemAuthor]] select (_itemAuthor != "")); + (_display displayCtrl IDC_infoAuthor) ctrlSetText ([localize "STR_AUTHOR_UNKNOWN", format [localize "STR_FORMAT_AUTHOR_SCRIPTED", _itemAuthor]] select (_itemAuthor != "")); // DLC / mod icon - private _ctrlDLC = _display displayctrl IDC_DLCIcon; - private _ctrlDLCBackground = _display displayctrl IDC_DLCBackground; + private _ctrlDLC = _display displayCtrl IDC_DLCIcon; + private _ctrlDLCBackground = _display displayCtrl IDC_DLCBackground; private _dlc = _itemCfg call EFUNC(common,getAddon); if (_dlc != "") then { @@ -48,7 +48,7 @@ if (isClass _itemCfg) then { _ctrlDLC ctrlSetFade 0; // If an item is from a DLC, set it so when you press the icon on the bottom right it opens the DLC page - if ((getNumber (configfile >> "CfgMods" >> _dlc >> "appId")) > 0) then { + if ((getNumber (configFile >> "CfgMods" >> _dlc >> "appId")) > 0) then { _ctrlDLC ctrlSetEventHandler ["MouseExit", format ["(_this select 0) ctrlSetText '%1';", _logo]]; _ctrlDLC ctrlSetEventHandler ["MouseEnter", format ["(_this select 0) ctrlSetText '%1';", _logoOver]]; _ctrlDLC ctrlSetEventHandler [ diff --git a/addons/arsenal/functions/fnc_message.sqf b/addons/arsenal/functions/fnc_message.sqf index b20689f6b9c..5d2846bafc6 100644 --- a/addons/arsenal/functions/fnc_message.sqf +++ b/addons/arsenal/functions/fnc_message.sqf @@ -25,6 +25,7 @@ if (!isNil "_handle") then { }; _handle = [_display, _messageBoxCtrl, time + 5, _message, FADE_DELAY] spawn { + //IGNORE_PRIVATE_WARNING ["_thisScript"]; disableSerialization; params ["_display", "_control", "_timer", "_message", "_delay"]; diff --git a/addons/arsenal/functions/fnc_onArsenalOpen.sqf b/addons/arsenal/functions/fnc_onArsenalOpen.sqf index 0f0a5817c6e..2a2d8716c84 100644 --- a/addons/arsenal/functions/fnc_onArsenalOpen.sqf +++ b/addons/arsenal/functions/fnc_onArsenalOpen.sqf @@ -121,7 +121,7 @@ _mouseBlockCtrl ctrlEnable false; private _statsBoxCtrl = _display displayCtrl IDC_statsBox; _statsBoxCtrl ctrlSetPosition [ (0.5 - WIDTH_TOTAL / 2) + WIDTH_GAP, - safezoneY + 1.8 * GRID_H, + safeZoneY + 1.8 * GRID_H, 47 * GRID_W, 11 * GRID_H ]; @@ -132,20 +132,12 @@ _statsBoxCtrl ctrlCommit 0; private _actionsBoxCtrl = _display displayCtrl IDC_actionsBox; _actionsBoxCtrl ctrlSetPosition [ (0.5 - WIDTH_TOTAL / 2) + WIDTH_GAP, - safezoneY + 58.6 * GRID_H, + safeZoneY + 58.6 * GRID_H, 47 * GRID_W, 11 * GRID_H ]; _actionsBoxCtrl ctrlCommit 0; -// Disable import in MP -if (isMultiplayer) then { - private _importButtonCtrl = _display displayCtrl IDC_buttonImport; - _importButtonCtrl ctrlEnable false; - _importButtonCtrl ctrlSetFade 0.6; - _importButtonCtrl ctrlCommit 0; -}; - //--------------- Camera prep cutText ["", "PLAIN"]; showCommandingMenu ""; diff --git a/addons/arsenal/functions/fnc_onKeyDown.sqf b/addons/arsenal/functions/fnc_onKeyDown.sqf index 4d62075f78f..fe69bb3486d 100644 --- a/addons/arsenal/functions/fnc_onKeyDown.sqf +++ b/addons/arsenal/functions/fnc_onKeyDown.sqf @@ -94,8 +94,8 @@ if (!isNull _loadoutsDisplay) then { }; } params ["_className"]; - "ace_clipboard" callExtension (_className + ";"); - "ace_clipboard" callExtension "--COMPLETE--"; + "ace" callExtension ["clipboard:append", [_className]]; + "ace" callExtension ["clipboard:complete", []]; [_display, LLSTRING(exportedClassnameText)] call FUNC(message); } else { diff --git a/addons/arsenal/functions/fnc_onSelChangedLeft.sqf b/addons/arsenal/functions/fnc_onSelChangedLeft.sqf index e25016b303d..a5a32a85188 100644 --- a/addons/arsenal/functions/fnc_onSelChangedLeft.sqf +++ b/addons/arsenal/functions/fnc_onSelChangedLeft.sqf @@ -17,7 +17,7 @@ params ["_control", "_curSel"]; -if (_curSel < 0) exitwith {}; +if (_curSel < 0) exitWith {}; private _display = ctrlParent _control; private _item = [_control lbData _curSel, _control lnbData [_curSel, 0]] select (ctrlType _control == CT_LISTNBOX); @@ -33,6 +33,7 @@ private _fnc_clearCurrentWeaponMags = { // If nothing was selected, remove all magazines from the current weapon if (_item != "") then { + //IGNORE_PRIVATE_WARNING ["_compatibleMags"]; _compatibleMagsCurrentWeapon = _compatibleMagsCurrentWeapon - _compatibleMags; }; diff --git a/addons/arsenal/functions/fnc_onSelChangedRight.sqf b/addons/arsenal/functions/fnc_onSelChangedRight.sqf index abec68ceeef..66315f7dc79 100644 --- a/addons/arsenal/functions/fnc_onSelChangedRight.sqf +++ b/addons/arsenal/functions/fnc_onSelChangedRight.sqf @@ -16,7 +16,7 @@ params ["_control", "_curSel"]; -if (_curSel < 0) exitwith {}; +if (_curSel < 0) exitWith {}; private _display = ctrlParent _control; private _item = _control lbData _curSel; diff --git a/addons/arsenal/functions/fnc_saveLoadout.sqf b/addons/arsenal/functions/fnc_saveLoadout.sqf new file mode 100644 index 00000000000..05e712e45f6 --- /dev/null +++ b/addons/arsenal/functions/fnc_saveLoadout.sqf @@ -0,0 +1,37 @@ +#include "..\script_component.hpp" +/* + * Author: DartRuffian + * Saves a given loadout to the client's profile. + * + * Arguments: + * 0: Name of loadout <STRING> + * 1: CBA extended loadout or getUnitLoadout array <ARRAY> + * 2: Replace existing loadout <BOOL> (default: false) + * + * Return Value: + * True if loadout was saved, otherwise false <BOOL> + * + * Example: + * ["Current Loadout", getUnitLoadout ACE_player] call ace_arsenal_fnc_saveLoadout + * + * Public: Yes + */ + +params [["_name", "", [""]], ["_loadout", [], [[]]], ["_replaceExisting", false, [false]]]; + +if (_name == "" || {_loadout isEqualTo []}) exitWith { false }; + +private _loadouts = profileNamespace getVariable [QGVAR(saved_loadouts), []]; +private _loadoutIndex = _loadouts findIf {(_x#0) == _name}; + +// If a loadout with same name already exists and no overwriting enabled, quit +if (!_replaceExisting && {_loadoutIndex != -1}) exitWith { false }; + +if (_loadoutIndex == -1) then { + _loadouts pushBack [_name, _loadout]; +} else { + _loadouts set [_loadoutIndex, [_name, _loadout]]; +}; + +profileNamespace setVariable [QGVAR(saved_loadouts), _loadouts]; +true diff --git a/addons/arsenal/functions/fnc_scanConfig.sqf b/addons/arsenal/functions/fnc_scanConfig.sqf index fef97e8bd85..b5c6627cc7a 100644 --- a/addons/arsenal/functions/fnc_scanConfig.sqf +++ b/addons/arsenal/functions/fnc_scanConfig.sqf @@ -228,10 +228,10 @@ private _faceCategory = ""; _faceCache set [configName _x, [getText (_x >> "displayName"), _modPicture, _faceCategory]]; }; } forEach ("true" configClasses _x); -} forEach ("true" configClasses (configfile >> "CfgFaces")); +} forEach ("true" configClasses (configFile >> "CfgFaces")); // Get all voices -private _voiceCache = (configProperties [configFile >> "CfgVoice", "isClass _x && {getNumber (_x >> 'scope') == 2}", true]) - [configfile >> "CfgVoice" >> "NoVoice"]; +private _voiceCache = (configProperties [configFile >> "CfgVoice", "isClass _x && {getNumber (_x >> 'scope') == 2}", true]) - [configFile >> "CfgVoice" >> "NoVoice"]; _voiceCache = _voiceCache apply {configName _x}; // Get all insignia diff --git a/addons/arsenal/functions/fnc_sortPanel.sqf b/addons/arsenal/functions/fnc_sortPanel.sqf index f9803a429e7..e47ece9d17b 100644 --- a/addons/arsenal/functions/fnc_sortPanel.sqf +++ b/addons/arsenal/functions/fnc_sortPanel.sqf @@ -155,6 +155,7 @@ private _for = if (_right) then { for "_i" from 0 to (lbSize _panel) - 1 }; +//IGNORE_PRIVATE_WARNING ["_i"]; _for do { // Get item _item = if (_right) then { diff --git a/addons/arsenal/functions/fnc_sortStatement_mod.sqf b/addons/arsenal/functions/fnc_sortStatement_mod.sqf index ab945202171..063aba0dbc4 100644 --- a/addons/arsenal/functions/fnc_sortStatement_mod.sqf +++ b/addons/arsenal/functions/fnc_sortStatement_mod.sqf @@ -14,4 +14,9 @@ params ["_config"]; -(modParams [_config call EFUNC(common,getAddon), ["name"]]) param [0, ""] +private _addon = _config call EFUNC(common,getAddon); + +// Calling modParams with "" prints 'ModParams - Undefined or empty mod directory' in RPT +if (_addon == "") exitWith {""}; + +(modParams [_addon, ["name"]]) param [0, ""] diff --git a/addons/arsenal/functions/fnc_statTextStatement_load.sqf b/addons/arsenal/functions/fnc_statTextStatement_load.sqf index 032019f5825..a7a132b1844 100644 --- a/addons/arsenal/functions/fnc_statTextStatement_load.sqf +++ b/addons/arsenal/functions/fnc_statTextStatement_load.sqf @@ -17,7 +17,7 @@ params ["_stats", "_config"]; TRACE_2("statTextStatement_load",_stats,_config); if (!isNull (_config >> "ItemInfo" >> "containerClass")) then { // Uniform/Vest - _config = configfile >> "CfgVehicles" >> getText (_config >> "ItemInfo" >> "containerClass"); + _config = configFile >> "CfgVehicles" >> getText (_config >> "ItemInfo" >> "containerClass"); }; private _load = getNumber (_config >> (_stats # 0)); diff --git a/addons/arsenal/ui/RscAttributes.hpp b/addons/arsenal/ui/RscAttributes.hpp index dc70caa0c27..b487cffd617 100644 --- a/addons/arsenal/ui/RscAttributes.hpp +++ b/addons/arsenal/ui/RscAttributes.hpp @@ -15,14 +15,14 @@ class GVAR(display) { class ControlsBackground { class blackLeft: ctrlStatic { colorBackground[] = {0,0,0,1}; - x = QUOTE(safezoneXAbs); - y = QUOTE(safezoneY); - w = QUOTE(safezoneXAbs - safezoneX); - h = QUOTE(safezoneH); + x = QUOTE(safeZoneXAbs); + y = QUOTE(safeZoneY); + w = QUOTE(safeZoneXAbs - safeZoneX); + h = QUOTE(safeZoneH); }; class blackRight: blackLeft { - x = QUOTE(safezoneX + safezoneW); + x = QUOTE(safeZoneX + safeZoneW); }; class mouseArea: ctrlStatic { @@ -31,10 +31,10 @@ class GVAR(display) { onMouseMoving = QUOTE([ARR_3('onMouseMoving',_this,GVAR(display))] call FUNC(handleMouse)); onMouseHolding = QUOTE([ARR_3('onMouseHolding',_this,GVAR(display))] call FUNC(handleMouse)); onMouseZChanged = QUOTE([ARR_3('onMouseZChanged',_this,GVAR(display))] call FUNC(handleScrollWheel)); - x = QUOTE(safezoneX); - y = QUOTE(safezoneY); - w = QUOTE(safezoneW); - h = QUOTE(safezoneH); + x = QUOTE(safeZoneX); + y = QUOTE(safeZoneY); + w = QUOTE(safeZoneW); + h = QUOTE(safeZoneH); }; }; class controls { @@ -58,34 +58,34 @@ class GVAR(display) { }; class blockLeftFrame: RscFrame { idc = IDC_blockLeftFrame; - x = QUOTE(safezoneX + 13 * GRID_W); - y = QUOTE(safezoneY + 14 * GRID_H); + x = QUOTE(safeZoneX + 13 * GRID_W); + y = QUOTE(safeZoneY + 14 * GRID_H); w = QUOTE(80 * GRID_W); - h = QUOTE(safezoneH - 24 * GRID_H); + h = QUOTE(safeZoneH - 24 * GRID_H); colorText[] = {0,0,0,1}; }; class blockLeftBackground: ctrlStaticBackground { idc = IDC_blockLeftBackground; - x = QUOTE(safezoneX + 13 * GRID_W); - y = QUOTE(safezoneY + 14 * GRID_H); + x = QUOTE(safeZoneX + 13 * GRID_W); + y = QUOTE(safeZoneY + 14 * GRID_H); w = QUOTE(80 * GRID_W); - h = QUOTE(safezoneH - 24 * GRID_H); + h = QUOTE(safeZoneH - 24 * GRID_H); colorBackground[] = {0,0,0,0.5}; }; class blockRightFrame: blockLeftFrame { idc = IDC_blockRightFrame; - x = QUOTE(safezoneX + safezoneW - 93 * GRID_W); - h = QUOTE(safezoneH - 34 * GRID_H); + x = QUOTE(safeZoneX + safeZoneW - 93 * GRID_W); + h = QUOTE(safeZoneH - 34 * GRID_H); }; class blockRighttBackground: blockLeftBackground { idc = IDC_blockRighttBackground; - x = QUOTE(safezoneX + safezoneW - 93 * GRID_W); - h = QUOTE(safezoneH - 34 * GRID_H); + x = QUOTE(safeZoneX + safeZoneW - 93 * GRID_W); + h = QUOTE(safeZoneH - 34 * GRID_H); }; class loadIndicator: RscControlsGroupNoScrollbars { idc = IDC_loadIndicator; - x = QUOTE(safezoneX + safezoneW - 93 * GRID_W); - y = QUOTE(safeZoneH + safezoneY - 20 * GRID_H); + x = QUOTE(safeZoneX + safeZoneW - 93 * GRID_W); + y = QUOTE(safeZoneH + safeZoneY - 20 * GRID_H); w = QUOTE(80 * GRID_W); h = QUOTE(6 * GRID_H); class controls { @@ -112,8 +112,8 @@ class GVAR(display) { }; class totalWeight: RscControlsGroupNoScrollbars { idc = IDC_totalWeight; - x = QUOTE(safezoneX + 13 * GRID_W); - y = QUOTE(safeZoneH + safezoneY - 10 * GRID_H); + x = QUOTE(safeZoneX + 13 * GRID_W); + y = QUOTE(safeZoneH + safeZoneY - 10 * GRID_H); w = QUOTE(80 * GRID_W); h = QUOTE(8 * GRID_H); class controls { @@ -154,7 +154,7 @@ class GVAR(display) { colorBackground[] = {0,0,0,0.69999999}; text = ""; x = QUOTE(0.5 - WIDTH_TOTAL / 2); - y = QUOTE(safeZoneH + safezoneY - 25 * GRID_H); + y = QUOTE(safeZoneH + safeZoneY - 25 * GRID_H); w = QUOTE(WIDTH_TOTAL); h = QUOTE(10 * GRID_H); sizeEx = QUOTE(5 * GRID_H); @@ -162,7 +162,7 @@ class GVAR(display) { class menuBar: RscControlsGroupNoScrollbars { idc = IDC_menuBar; x = QUOTE(0.5 - WIDTH_TOTAL / 2); - y = QUOTE(safezoneH + safezoneY - 9 * GRID_H); + y = QUOTE(safeZoneH + safeZoneY - 9 * GRID_H); w = QUOTE(WIDTH_TOTAL); h = QUOTE(7 * GRID_H); class controls { @@ -223,8 +223,8 @@ class GVAR(display) { class infoBox: RscControlsGroupNoScrollbars { idc = IDC_infoBox; fade = 1; - x = QUOTE(safezoneX + safezoneW - 93 * GRID_W); - y = QUOTE(safeZoneH + safezoneY - 14 * GRID_H); + x = QUOTE(safeZoneX + safeZoneW - 93 * GRID_W); + y = QUOTE(safeZoneH + safeZoneY - 14 * GRID_H); w = QUOTE(92 * GRID_W); h = QUOTE(12 * GRID_H); class controls { @@ -278,12 +278,12 @@ class GVAR(display) { class statsBox: RscControlsGroupNoScrollbars { idc = IDC_statsBox; x = QUOTE((0.5 - WIDTH_TOTAL / 2) + WIDTH_GAP); - y = QUOTE(safezoneY + 1.8 * GRID_H); + y = QUOTE(safeZoneY + 1.8 * GRID_H); w = QUOTE(47 * GRID_W); h = QUOTE(55 * GRID_H); class controls { class statsStaticBackground1: ctrlStaticBackground { - idc = -1; + idc = IDC_statsBoxBackground; x = QUOTE(0); y = QUOTE(0); w = QUOTE(47 * GRID_W); @@ -291,7 +291,7 @@ class GVAR(display) { colorBackground[] = {0.1,0.1,0.1,0.5}; }; class statsStaticBackground2: ctrlStaticBackground { - idc = -1; + idc = IDC_statsBoxTitleBackground; x = QUOTE(0); y = QUOTE(0); w = QUOTE(47 * GRID_W); @@ -316,7 +316,7 @@ class GVAR(display) { x = QUOTE(1 * GRID_W); y = QUOTE(10 * GRID_H); w = QUOTE(45 * GRID_W); - h = QUOTE(4 * GRID_H); + h = QUOTE(5 * GRID_H); colorBackground[] = {1,1,1,0.15}; }; class statsBar1: ctrlProgress { @@ -329,9 +329,9 @@ class GVAR(display) { x = QUOTE(1 * GRID_W); y = QUOTE(10 * GRID_H); w = QUOTE(45 * GRID_W); - h = QUOTE(4 * GRID_H); + h = QUOTE(5 * GRID_H); }; - class statsText1: RscText { + class statsText1: RscTextMulti { idc = IDC_statsText1; shadow = 0; fade = 1; @@ -340,7 +340,7 @@ class GVAR(display) { x = QUOTE(0 * GRID_W); y = QUOTE(10 * GRID_H); w = QUOTE(45 * GRID_W); - h = QUOTE(4 * GRID_H); + h = QUOTE(5 * GRID_H); sizeEx = QUOTE(5 * GRID_H); text = ""; }; @@ -419,7 +419,7 @@ class GVAR(display) { colorBackgroundDisabled[] = {0,0,0,0}; onButtonClick = QUOTE([ARR_2(QQGVAR(statsChangePage),[ARR_3(ctrlParent (_this select 0),_this select 0,false)])] call CBA_fnc_localEvent); x = QUOTE((0.5 - WIDTH_TOTAL / 2) + WIDTH_GAP); - y = QUOTE(safezoneY + 1.8 * GRID_H); + y = QUOTE(safeZoneY + 1.8 * GRID_H); w = QUOTE(5 * GRID_W); h = QUOTE(5 * GRID_H); sizeEx = QUOTE(5.5 * GRID_H); @@ -434,7 +434,7 @@ class GVAR(display) { idc = IDC_statsCurrentPage; style = ST_CENTER; x = QUOTE((0.5 - WIDTH_TOTAL / 2) + WIDTH_GAP + 5 * GRID_W); - y = QUOTE(safezoneY + 1.8 * GRID_H); + y = QUOTE(safeZoneY + 1.8 * GRID_H); w = QUOTE(37 * GRID_W); h = QUOTE(5 * GRID_H); colorBackground[] = {0,0,0,0}; @@ -445,7 +445,7 @@ class GVAR(display) { class actionsBox: RscControlsGroupNoScrollbars { idc = IDC_actionsBox; x = QUOTE((0.5 - WIDTH_TOTAL / 2) + WIDTH_GAP); - y = QUOTE(safezoneY + 58.6 * GRID_H); + y = QUOTE(safeZoneY + 58.6 * GRID_H); w = QUOTE(47 * GRID_W); h = QUOTE(55 * GRID_H); class controls { @@ -482,7 +482,7 @@ class GVAR(display) { x = QUOTE(1 * GRID_W); y = QUOTE(6 * GRID_H); w = QUOTE(45 * GRID_W); - h = QUOTE(4 * GRID_H); + h = QUOTE(5 * GRID_H); }; class actionsText2: actionsText1 { idc = IDC_actionsText2; @@ -550,10 +550,10 @@ class GVAR(display) { class mouseBlock: RscText { idc = IDC_mouseBlock; style = 16; - x = QUOTE(safezoneX); - y = QUOTE(safezoneY); - w = QUOTE(safezoneW); - h = QUOTE(safezoneH); + x = QUOTE(safeZoneX); + y = QUOTE(safeZoneY); + w = QUOTE(safeZoneW); + h = QUOTE(safeZoneH); }; class leftTabContent: RscListBox { idc = IDC_leftTabContent; @@ -569,10 +569,10 @@ class GVAR(display) { onLBDblClick = QUOTE(_this call FUNC(onPanelDblClick)); onSetFocus = QUOTE(GVAR(leftTabFocus) = true); onKillFocus = QUOTE(GVAR(leftTabFocus) = false); - x = QUOTE(safezoneX + 13 * GRID_W); - y = QUOTE(safezoneY + 14 * GRID_H); + x = QUOTE(safeZoneX + 13 * GRID_W); + y = QUOTE(safeZoneY + 14 * GRID_H); w = QUOTE(80 * GRID_W); - h = QUOTE(safezoneH - 24.5 * GRID_H); + h = QUOTE(safeZoneH - 24.5 * GRID_H); sizeEx = QUOTE(7 * GRID_H); }; class rightTabContent: leftTabContent { @@ -583,8 +583,8 @@ class GVAR(display) { onLBDblClick = QUOTE(_this call FUNC(onPanelDblClick)); onSetFocus = QUOTE(GVAR(rightTabFocus) = true); onKillFocus = QUOTE(GVAR(rightTabFocus) = false); - x = QUOTE(safezoneX + safezoneW - 93 * GRID_W); - h = QUOTE(safezoneH - 28 * GRID_H); + x = QUOTE(safeZoneX + safeZoneW - 93 * GRID_W); + h = QUOTE(safeZoneH - 28 * GRID_H); }; class rightTabContentListnBox: RscListNBox { idc = IDC_rightTabContentListnBox; @@ -605,16 +605,16 @@ class GVAR(display) { onLBDblClick = QUOTE(_this call FUNC(onPanelDblClick)); onSetFocus = QUOTE(GVAR(rightTabLnBFocus) = true); onKillFocus = QUOTE(GVAR(rightTabLnBFocus) = false); - x = QUOTE(safezoneX + safezoneW - 93 * GRID_W); - y = QUOTE(safezoneY + 14 * GRID_H); + x = QUOTE(safeZoneX + safeZoneW - 93 * GRID_W); + y = QUOTE(safeZoneY + 14 * GRID_H); w = QUOTE(80 * GRID_W); - h = QUOTE(safezoneH - 34 * GRID_H); + h = QUOTE(safeZoneH - 34 * GRID_H); sizeEx = QUOTE(7 * GRID_H); }; class sortLeftTab: RscCombo { idc = IDC_sortLeftTab; - x = QUOTE(safezoneX + 13 * GRID_W); - y = QUOTE(safezoneY + 8 * GRID_H); + x = QUOTE(safeZoneX + 13 * GRID_W); + y = QUOTE(safeZoneY + 8 * GRID_H); w = QUOTE(40 * GRID_W); h = QUOTE(6 * GRID_H); onLBSelChanged = QUOTE(_this call FUNC(sortPanel)); @@ -622,16 +622,16 @@ class GVAR(display) { }; class sortLeftTabDirection: sortLeftTab { idc = IDC_sortLeftTabDirection; - x = QUOTE(safezoneX + 53 * GRID_W); + x = QUOTE(safeZoneX + 53 * GRID_W); w = QUOTE(40 * GRID_W); }; class sortRightTab: sortLeftTab { idc = IDC_sortRightTab; - x = QUOTE(safezoneX + safezoneW - 93 * GRID_W); + x = QUOTE(safeZoneX + safeZoneW - 93 * GRID_W); }; class sortRightTabDirection: sortLeftTabDirection { idc = IDC_sortRightTabDirection; - x = QUOTE(safezoneX + safezoneW - 53 * GRID_W); + x = QUOTE(safeZoneX + safeZoneW - 53 * GRID_W); }; class leftSearchbar: ctrlEdit { idc = IDC_leftSearchbar; @@ -639,8 +639,8 @@ class GVAR(display) { onKillFocus = QUOTE(GVAR(leftSearchbarFocus) = false); onMouseButtonClick = QUOTE([ARR_3(ctrlParent (_this select 0),_this select 0,_this select 1)] call FUNC(clearSearchbar)); onEditChanged = QUOTE(call FUNC(handleSearchInputChanged)); - x = QUOTE(safezoneX + 13 * GRID_W); - y = QUOTE(safezoneY + 1.8 * GRID_H); + x = QUOTE(safeZoneX + 13 * GRID_W); + y = QUOTE(safeZoneY + 1.8 * GRID_H); w = QUOTE(74 * GRID_W); h = QUOTE(6 * GRID_H); sizeEx = QUOTE(6 * GRID_H); @@ -652,8 +652,8 @@ class GVAR(display) { colorBackground[] = {0,0,0,0.5}; onButtonClick = QUOTE([ARR_2(ctrlParent (_this select 0),ctrlParent (_this select 0) displayCtrl IDC_leftSearchbar)] call FUNC(handleSearchbar)); onMouseButtonDown = QUOTE(call FUNC(handleSearchModeToggle)); - x = QUOTE(safezoneX + 87 * GRID_W); - y = QUOTE(safezoneY + 1.8 * GRID_H); + x = QUOTE(safeZoneX + 87 * GRID_W); + y = QUOTE(safeZoneY + 1.8 * GRID_H); w = QUOTE(6 * GRID_W); h = QUOTE(6 * GRID_H); }; @@ -661,17 +661,17 @@ class GVAR(display) { idc = IDC_rightSearchbar; onSetFocus = QUOTE(GVAR(rightSearchbarFocus) = true); onKillFocus = QUOTE(GVAR(rightSearchbarFocus) = false); - x = QUOTE(safezoneX + safezoneW - 87 * GRID_W); + x = QUOTE(safeZoneX + safeZoneW - 87 * GRID_W); }; class rightSearchbarButton: leftSearchbarButton { idc = IDC_rightSearchbarButton; onButtonClick = QUOTE([ARR_2(ctrlParent (_this select 0),ctrlParent (_this select 0) displayCtrl IDC_rightSearchbar)] call FUNC(handleSearchbar)); - x = QUOTE(safezoneX + safezoneW - 93 * GRID_W); + x = QUOTE(safeZoneX + safeZoneW - 93 * GRID_W); }; class tabLeft: RscControlsGroupNoScrollbars { idc = IDC_tabLeft; - x = QUOTE(safezoneX + 1 * GRID_W); - y = QUOTE(safezoneY + 8 * GRID_H); + x = QUOTE(safeZoneX + 1 * GRID_W); + y = QUOTE(safeZoneY + 8 * GRID_H); w = QUOTE(12 * GRID_W); h = QUOTE(200 * GRID_H); class controls { @@ -873,8 +873,8 @@ class GVAR(display) { colorBackground[] = {0,0,0,1}; fade = 1; enable = 0; - x = QUOTE(safezoneW + safezoneX - 13 * GRID_W); - y = QUOTE(safezoneY + 8 * GRID_H); + x = QUOTE(safeZoneW + safeZoneX - 13 * GRID_W); + y = QUOTE(safeZoneY + 8 * GRID_H); w = QUOTE(12 * GRID_W); h = QUOTE(9 * GRID_H); }; @@ -884,110 +884,110 @@ class GVAR(display) { text = "\A3\Ui_f\data\GUI\Rsc\RscDisplayArsenal\ItemOptic_ca.paa"; onButtonClick = QUOTE([ARR_2(ctrlParent (_this select 0),_this select 0)] call FUNC(fillRightPanel)); colorBackground[] = {0,0,0,0.5}; - x = QUOTE(safezoneW + safezoneX - 10 * GRID_W); - y = QUOTE(safezoneY + 8 * GRID_H); + x = QUOTE(safeZoneW + safeZoneX - 10 * GRID_W); + y = QUOTE(safeZoneY + 8 * GRID_H); w = QUOTE(9 * GRID_W); h = QUOTE(9 * GRID_H); }; class iconBackgroundItemAcc: iconBackgroundOptic { idc = IDC_iconBackgroundItemAcc; - y = QUOTE(safezoneY + 18 * GRID_H); + y = QUOTE(safeZoneY + 18 * GRID_H); }; class buttonItemAcc: buttonOptic { idc = IDC_buttonItemAcc; text = "\A3\Ui_f\data\GUI\Rsc\RscDisplayArsenal\ItemAcc_ca.paa"; tooltip = "$STR_A3_RscDisplayArsenal_tab_ItemAcc"; - y = QUOTE(safezoneY + 18 * GRID_H); + y = QUOTE(safeZoneY + 18 * GRID_H); }; class iconBackgroundMuzzle: iconBackgroundOptic { idc = IDC_iconBackgroundMuzzle; - y = QUOTE(safezoneY + 28 * GRID_H); + y = QUOTE(safeZoneY + 28 * GRID_H); }; class buttonMuzzle: buttonOptic { idc = IDC_buttonMuzzle; text = "\A3\Ui_f\data\GUI\Rsc\RscDisplayArsenal\ItemMuzzle_ca.paa"; tooltip = "$STR_A3_RscDisplayArsenal_tab_ItemMuzzle"; - y = QUOTE(safezoneY + 28 * GRID_H); + y = QUOTE(safeZoneY + 28 * GRID_H); }; class iconBackgroundBipod: iconBackgroundOptic { idc = IDC_iconBackgroundBipod; - y = QUOTE(safezoneY + 38 * GRID_H); + y = QUOTE(safeZoneY + 38 * GRID_H); }; class buttonBipod: buttonOptic { idc = IDC_buttonBipod; text = "\A3\Ui_f\data\GUI\Rsc\RscDisplayArsenal\ItemBipod_ca.paa"; tooltip = "$STR_A3_RscDisplayArsenal_tab_ItemBipod"; - y = QUOTE(safezoneY + 38 * GRID_H); + y = QUOTE(safeZoneY + 38 * GRID_H); }; class iconBackgroundCurrentMag: iconBackgroundOptic { idc = IDC_iconBackgroundCurrentMag; - y = QUOTE(safezoneY + 48 * GRID_H); + y = QUOTE(safeZoneY + 48 * GRID_H); }; class buttonCurrentMag: buttonOptic { idc = IDC_buttonCurrentMag; text = "\A3\Ui_f\data\GUI\Rsc\RscDisplayArsenal\CargoMag_ca.paa"; tooltip = CSTRING(buttonCurrentMagTooltip); - y = QUOTE(safezoneY + 48 * GRID_H); + y = QUOTE(safeZoneY + 48 * GRID_H); }; class iconBackgroundCurrentMag2: iconBackgroundOptic { idc = IDC_iconBackgroundCurrentMag2; - y = QUOTE(safezoneY + 58 * GRID_H); + y = QUOTE(safeZoneY + 58 * GRID_H); }; class buttonCurrentMag2: buttonOptic { idc = IDC_buttonCurrentMag2; text = QPATHTOF(data\iconSecondaryMuzzle); tooltip = CSTRING(buttonCurrentMag2Tooltip); - y = QUOTE(safezoneY + 58 * GRID_H); + y = QUOTE(safeZoneY + 58 * GRID_H); }; class iconBackgroundMag: iconBackgroundOptic { idc = IDC_iconBackgroundMag; - y = QUOTE(safezoneY + 48 * GRID_H); + y = QUOTE(safeZoneY + 48 * GRID_H); }; class buttonMag: buttonOptic { idc = IDC_buttonMag; text = "\A3\Ui_f\data\GUI\Rsc\RscDisplayArsenal\CargoMag_ca.paa"; tooltip = "$STR_A3_RscDisplayArsenal_tab_CargoMag"; - y = QUOTE(safezoneY + 48 * GRID_H); + y = QUOTE(safeZoneY + 48 * GRID_H); }; class iconBackgroundMagALL: iconBackgroundOptic { idc = IDC_iconBackgroundMagALL; - y = QUOTE(safezoneY + 58 * GRID_H); + y = QUOTE(safeZoneY + 58 * GRID_H); }; class buttonMagALL: buttonOptic { idc = IDC_buttonMagALL; text = "\A3\Ui_f\data\GUI\Rsc\RscDisplayArsenal\CargoMagAll_ca.paa"; tooltip = "$STR_A3_RscDisplayArsenal_tab_CargoMagAll"; - y = QUOTE(safezoneY + 58 * GRID_H); + y = QUOTE(safeZoneY + 58 * GRID_H); }; class iconBackgroundThrow: iconBackgroundOptic { idc = IDC_iconBackgroundThrow; - y = QUOTE(safezoneY + 68 * GRID_H); + y = QUOTE(safeZoneY + 68 * GRID_H); }; class buttonThrow: buttonOptic { idc = IDC_buttonThrow; text = "\A3\Ui_f\data\GUI\Rsc\RscDisplayArsenal\CargoThrow_ca.paa"; tooltip = "$STR_A3_RscDisplayArsenal_tab_CargoThrow"; - y = QUOTE(safezoneY + 68 * GRID_H); + y = QUOTE(safeZoneY + 68 * GRID_H); }; class iconBackgroundPut: iconBackgroundOptic { idc = IDC_iconBackgroundPut; - y = QUOTE(safezoneY + 78 * GRID_H); + y = QUOTE(safeZoneY + 78 * GRID_H); }; class buttonPut: buttonOptic { idc = IDC_buttonPut; text = "\A3\Ui_f\data\GUI\Rsc\RscDisplayArsenal\CargoPut_ca.paa"; tooltip = "$STR_A3_RscDisplayArsenal_tab_CargoPut"; - y = QUOTE(safezoneY + 78 * GRID_H); + y = QUOTE(safeZoneY + 78 * GRID_H); }; class iconBackgroundMisc: iconBackgroundOptic { idc = IDC_iconBackgroundMisc; - y = QUOTE(safezoneY + 88 * GRID_H); + y = QUOTE(safeZoneY + 88 * GRID_H); }; class buttonMisc: buttonOptic { idc = IDC_buttonMisc; text = "\A3\Ui_f\data\GUI\Rsc\RscDisplayArsenal\CargoMisc_ca.paa"; tooltip = "$STR_A3_RscDisplayArsenal_tab_CargoMisc"; - y = QUOTE(safezoneY + 88 * GRID_H); + y = QUOTE(safeZoneY + 88 * GRID_H); }; class buttonRemoveAll: ctrlButtonPicture { @@ -998,8 +998,8 @@ class GVAR(display) { onButtonClick = QUOTE(ctrlParent (_this select 0) call FUNC(buttonClearAll)); fade = 1; enable = 0; - x = QUOTE(safezoneW + safezoneX - 11 * GRID_W); - y = QUOTE(safeZoneH + safezoneY - 29 * GRID_H); + x = QUOTE(safeZoneW + safeZoneX - 11 * GRID_W); + y = QUOTE(safeZoneH + safeZoneY - 29 * GRID_H); w = QUOTE(9 * GRID_W); h = QUOTE(9 * GRID_H); }; @@ -1013,17 +1013,17 @@ class GVAR(loadoutsDisplay) { class controls { class centerBox: ctrlControlsGroupNoScrollbars { idc = IDC_centerBox; - x = QUOTE(safezoneW + safezoneX - (180 * GRID_W)); - y = QUOTE(safezoneY + (5 * GRID_H)); + x = QUOTE(safeZoneW + safeZoneX - (180 * GRID_W)); + y = QUOTE(safeZoneY + (5 * GRID_H)); w = QUOTE(160 * GRID_W); - h = QUOTE(safezoneH - (34 * GRID_H)); + h = QUOTE(safeZoneH - (34 * GRID_H)); class controls { class centerFrame: RscFrame { idc = -1; x = QUOTE(0 * GRID_W); y = QUOTE(0 * GRID_H); w = QUOTE(160 * GRID_W); - h = QUOTE(safezoneH - (45 * GRID_H)); + h = QUOTE(safeZoneH - (45 * GRID_H)); colorText[] = {0,0,0,1}; }; class centerBackground: ctrlStaticBackground { @@ -1031,7 +1031,7 @@ class GVAR(loadoutsDisplay) { x = QUOTE(0); y = QUOTE(0); w = QUOTE(160 * GRID_W); - h = QUOTE(safezoneH - (45 * GRID_H)); + h = QUOTE(safeZoneH - (45 * GRID_H)); colorBackground[] = {0.13,0.13,0.13,0.9}; }; class centerTitle: ctrlStaticTitle { @@ -1056,14 +1056,14 @@ class GVAR(loadoutsDisplay) { x = QUOTE(0); y = QUOTE(5 * GRID_H); w = QUOTE(160 * GRID_W); - h = QUOTE(safezoneH - (57 * GRID_H)); + h = QUOTE(safeZoneH - (57 * GRID_H)); sizeEx = QUOTE(7 * GRID_H); }; class textTitle: RscText { idc = -1; text = "$STR_DISP_GAME_NAME"; x = QUOTE(0 * GRID_W); - y = QUOTE(safezoneH - (51 * GRID_H)); + y = QUOTE(safeZoneH - (51 * GRID_H)); w = QUOTE(15 * GRID_W); h = QUOTE(5 * GRID_H); sizeEx = QUOTE(5 * GRID_H); @@ -1072,7 +1072,7 @@ class GVAR(loadoutsDisplay) { class textEditBox: ctrlEdit { idc = IDC_textEditBox; x = QUOTE(15 * GRID_W); - y = QUOTE(safezoneH - (51 * GRID_H)); + y = QUOTE(safeZoneH - (51 * GRID_H)); w = QUOTE(65 * GRID_W); h = QUOTE(5 * GRID_H); sizeEx = QUOTE(6 * GRID_H); @@ -1083,7 +1083,7 @@ class GVAR(loadoutsDisplay) { onKillFocus = QUOTE(GVAR(loadoutsSearchbarFocus) = false); onMouseButtonClick = QUOTE([ARR_3(ctrlParent (_this select 0),_this select 0,_this select 1)] call FUNC(clearSearchbar)); x = QUOTE(83 * GRID_W); - y = QUOTE(safezoneH - (51 * GRID_H)); + y = QUOTE(safeZoneH - (51 * GRID_H)); w = QUOTE(72 * GRID_W); h = QUOTE(5 * GRID_H); sizeEx = QUOTE(6 * GRID_H); @@ -1094,14 +1094,14 @@ class GVAR(loadoutsDisplay) { colorBackground[] = {0,0,0,0.5}; onButtonClick = QUOTE([ARR_2(ctrlParent (_this select 0),ctrlParent (_this select 0) displayCtrl IDC_loadoutsSearchbar)] call FUNC(handleLoadoutsSearchbar)); x = QUOTE(155 * GRID_W); - y = QUOTE(safezoneH - (51 * GRID_H)); + y = QUOTE(safeZoneH - (51 * GRID_H)); w = QUOTE(5 * GRID_W); h = QUOTE(5 * GRID_H); }; class buttonSave: ctrlButton { idc = IDC_buttonSave; x = QUOTE(0 * GRID_W); - y = QUOTE(safezoneH - (44 * GRID_H)); + y = QUOTE(safeZoneH - (44 * GRID_H)); w = QUOTE(30 * GRID_W); h = QUOTE(10 * GRID_H); text = CSTRING(buttonSaveText); @@ -1143,8 +1143,8 @@ class GVAR(loadoutsDisplay) { }; class buttonClose: ctrlButton { idc = -1; - x = QUOTE(safezoneW + safezoneX - 32 * GRID_W); - y = QUOTE(safezoneH + safezoneY - 9 * GRID_H); + x = QUOTE(safeZoneW + safeZoneX - 32 * GRID_W); + y = QUOTE(safeZoneH + safeZoneY - 9 * GRID_H); w = QUOTE(30 * GRID_W); h = QUOTE(7 * GRID_H); sizeEx = QUOTE(5 * GRID_H); @@ -1154,8 +1154,8 @@ class GVAR(loadoutsDisplay) { }; class buttonBar: ctrlControlsGroupNoScrollbars { idc = -1; - x = QUOTE((safezoneW * 0.5) + safezoneX - (80.5 * GRID_W)); - y = QUOTE(safezoneH + safezoneY - 9 * GRID_H); + x = QUOTE((safeZoneW * 0.5) + safeZoneX - (80.5 * GRID_W)); + y = QUOTE(safeZoneH + safeZoneY - 9 * GRID_H); w = QUOTE(161 * GRID_W); h = QUOTE(7 * GRID_H); class controls { diff --git a/addons/arsenal/ui/RscCommon.hpp b/addons/arsenal/ui/RscCommon.hpp index f74326bcfb7..cb36a67aed3 100644 --- a/addons/arsenal/ui/RscCommon.hpp +++ b/addons/arsenal/ui/RscCommon.hpp @@ -86,12 +86,12 @@ #define TR_AUTOCOLLAPSE 2 // Default grid -#define GUI_GRID_WAbs ((safezoneW / safezoneH) min 1.2) +#define GUI_GRID_WAbs ((safeZoneW / safeZoneH) min 1.2) #define GUI_GRID_HAbs (GUI_GRID_WAbs / 1.2) #define GUI_GRID_W (GUI_GRID_WAbs / 40) #define GUI_GRID_H (GUI_GRID_HAbs / 25) -#define GUI_GRID_X (safezoneX) -#define GUI_GRID_Y (safezoneY + safezoneH - GUI_GRID_HAbs) +#define GUI_GRID_X (safeZoneX) +#define GUI_GRID_Y (safeZoneY + safeZoneH - GUI_GRID_HAbs) // Default text sizes #define GUI_TEXT_SIZE_SMALL (GUI_GRID_H * 0.8) diff --git a/addons/arsenal/ui/RscCustomArsenalButton.hpp b/addons/arsenal/ui/RscCustomArsenalButton.hpp index 0aa077f424c..e745203e7ea 100644 --- a/addons/arsenal/ui/RscCustomArsenalButton.hpp +++ b/addons/arsenal/ui/RscCustomArsenalButton.hpp @@ -1,6 +1,6 @@ class GVAR(customArsenalButton_Button): RscButtonArsenal { - x = QUOTE(safezoneW + safezoneX - 10 * GRID_W); - y = QUOTE(safezoneY + 88 * GRID_H); + x = QUOTE(safeZoneW + safeZoneX - 10 * GRID_W); + y = QUOTE(safeZoneY + 88 * GRID_H); w = QUOTE(9 * GRID_W); h = QUOTE(9 * GRID_H); @@ -11,8 +11,8 @@ class GVAR(customArsenalButton_Button): RscButtonArsenal { }; class GVAR(customArsenalButton_Background): ctrlStaticBackground { - x = QUOTE(safezoneW + safezoneX - 13 * GRID_W); - y = QUOTE(safezoneY + 88 * GRID_H); + x = QUOTE(safeZoneW + safeZoneX - 13 * GRID_W); + y = QUOTE(safeZoneY + 88 * GRID_H); w = QUOTE(12 * GRID_W); h = QUOTE(9 * GRID_H); diff --git a/addons/artillerytables/RscRangeTable.hpp b/addons/artillerytables/RscRangeTable.hpp index ef11d7eac82..a24aa503cb5 100644 --- a/addons/artillerytables/RscRangeTable.hpp +++ b/addons/artillerytables/RscRangeTable.hpp @@ -8,16 +8,16 @@ class GVAR(rangeTableDialog) { class TableBackground: RscPicture { idc = -1; text = QPATHTOF(UI\RangeTable_background.paa); - x = "18 *(safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH) / 2)"; - y = "1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2)) / 2)"; + x = "18 *(safeZoneH / 40) + (safeZoneX + (safeZoneW - safeZoneH) / 2)"; + y = "1 * ((safeZoneH / 1.2) / 25) + (safeZoneY + (safeZoneH - (safeZoneH / 1.2)) / 2)"; w = "16.2634559672906 * (safeZoneH / 40)"; h = "23 * ((safeZoneH / 1.2) / 25)"; colorBackground[] = {1,1,1,1}; }; class LeftSideBackground: RscText { idc = -1; - x = "13 *(safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH) / 2)"; - y = "1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2)) / 2)"; + x = "13 *(safeZoneH / 40) + (safeZoneX + (safeZoneW - safeZoneH) / 2)"; + y = "1 * ((safeZoneH / 1.2) / 25) + (safeZoneY + (safeZoneH - (safeZoneH / 1.2)) / 2)"; w = "5 * (safeZoneH / 40)"; h = "23 * ((safeZoneH / 1.2) / 25)"; colorBackground[] = {0,0,0,0.8}; @@ -26,8 +26,8 @@ class GVAR(rangeTableDialog) { class controls { class TheTable: RscListNBox { idc = IDC_TABLE; - x = "18 *(safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH) / 2)"; - y = "3.76 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2)) / 2)"; + x = "18 *(safeZoneH / 40) + (safeZoneX + (safeZoneW - safeZoneH) / 2)"; + y = "3.76 * ((safeZoneH / 1.2) / 25) + (safeZoneY + (safeZoneH - (safeZoneH / 1.2)) / 2)"; w = "16.2634559672906 * (safeZoneH / 40)"; h = "20.24 * ((safeZoneH / 1.2) / 25)"; columns[] = {"10/867", "86/867", "171/867", "238/867", "320/867", "405/867", "485/867", "546/867", "607/867", "668/867", "729/867", "790/867"}; @@ -48,8 +48,8 @@ class GVAR(rangeTableDialog) { }; class ChargeListBox: RscListBox { idc = IDC_CHARGELIST; - x = "13 *(safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH) / 2)"; - y = "2 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2)) / 2)"; + x = "13 *(safeZoneH / 40) + (safeZoneX + (safeZoneW - safeZoneH) / 2)"; + y = "2 * ((safeZoneH / 1.2) / 25) + (safeZoneY + (safeZoneH - (safeZoneH / 1.2)) / 2)"; w = "5 * (safeZoneH / 40)"; h = "22 * ((safeZoneH / 1.2) / 25)"; onLBSelChanged = QUOTE([] call FUNC(rangeTableUpdate)); @@ -58,8 +58,8 @@ class GVAR(rangeTableDialog) { idc = IDC_BUTTON_ELEV_HIGH; text = "High"; onButtonClick = QUOTE([true] call FUNC(rangeTableUpdate)); - x = "13.1 *(safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH) / 2)"; - y = "1.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2)) / 2)"; + x = "13.1 *(safeZoneH / 40) + (safeZoneX + (safeZoneW - safeZoneH) / 2)"; + y = "1.1 * ((safeZoneH / 1.2) / 25) + (safeZoneY + (safeZoneH - (safeZoneH / 1.2)) / 2)"; w = "2.3 * (safeZoneH / 40)"; h = "0.8 * ((safeZoneH / 1.2) / 25)"; }; @@ -67,12 +67,12 @@ class GVAR(rangeTableDialog) { idc = IDC_BUTTON_ELEV_LOW; text = "Low"; onButtonClick = QUOTE([false] call FUNC(rangeTableUpdate)); - x = "15.6 *(safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH) / 2)"; + x = "15.6 *(safeZoneH / 40) + (safeZoneX + (safeZoneW - safeZoneH) / 2)"; }; class CloseBackground: RscText { idc = -1; - x = "33.7634559672906 *(safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH) / 2)"; - y = "1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2)) / 2)"; + x = "33.7634559672906 *(safeZoneH / 40) + (safeZoneX + (safeZoneW - safeZoneH) / 2)"; + y = "1 * ((safeZoneH / 1.2) / 25) + (safeZoneY + (safeZoneH - (safeZoneH / 1.2)) / 2)"; w = "0.5 * (safeZoneH / 40)"; h = "0.5 * ((safeZoneH / 1.2) / 25)"; colorBackground[] = {0,0,0,0.5}; @@ -82,8 +82,8 @@ class GVAR(rangeTableDialog) { style = 48; color[] = {1,1,1,0.7}; text = "A3\Ui_f\data\GUI\Rsc\RscDisplayArcadeMap\icon_exit_cross_ca.paa"; - x = "33.7634559672906 *(safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH) / 2)"; - y = "1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2)) / 2)"; + x = "33.7634559672906 *(safeZoneH / 40) + (safeZoneX + (safeZoneW - safeZoneH) / 2)"; + y = "1 * ((safeZoneH / 1.2) / 25) + (safeZoneY + (safeZoneH - (safeZoneH / 1.2)) / 2)"; w = "0.5 * (safeZoneH / 40)"; h = "0.5 * ((safeZoneH / 1.2) / 25)"; colorText[] = {1,1,1,0.7}; diff --git a/addons/artillerytables/RscTitles.hpp b/addons/artillerytables/RscTitles.hpp index c26f302a00f..e0c4cc34495 100644 --- a/addons/artillerytables/RscTitles.hpp +++ b/addons/artillerytables/RscTitles.hpp @@ -9,10 +9,10 @@ class RscTitles { class controls { class ModeControlGroup: RscControlsGroupNoScrollbars { idc = IDC_MODECONTROLGROUP; - x = "3.8 * (((safezoneW / safezoneH) min 1.2) / 40) + (profilenamespace getvariable ['IGUI_GRID_WEAPON_X',((safezoneX + safezoneW) - (10 * (((safezoneW / safezoneH) min 1.2) / 40)) - 4.3 * (((safezoneW / safezoneH) min 1.2) / 40))])"; - y = "2.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (profilenamespace getVariable ['IGUI_GRID_WEAPON_Y', (safezoneY + 0.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25))])"; - w = "10 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = "3.8 * (((safeZoneW / safeZoneH) min 1.2) / 40) + (profilenamespace getvariable ['IGUI_GRID_WEAPON_X',((safeZoneX + safeZoneW) - (10 * (((safeZoneW / safeZoneH) min 1.2) / 40)) - 4.3 * (((safeZoneW / safeZoneH) min 1.2) / 40))])"; + y = "2.5 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (profilenamespace getVariable ['IGUI_GRID_WEAPON_Y', (safeZoneY + 0.5 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25))])"; + w = "10 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; class controls { class Charge: RscText { @@ -21,18 +21,18 @@ class RscTitles { colorBackground[] = {0, 0, 0, 0}; x = "0"; y = "0"; - w = "(2) * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - sizeEx = "0.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w = "(2) * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; + sizeEx = "0.8 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class Azimuth: Charge { idc = IDC_AZIMUTH; - x = "(2) * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "(3) * (((safezoneW / safezoneH) min 1.2) / 40)"; + x = "(2) * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; + w = "(3) * (((safeZoneW / safeZoneH) min 1.2) / 40)"; }; class Elevation: Azimuth { idc = IDC_ELEVATION; - x = "(5) * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = "(5) * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; }; }; diff --git a/addons/artillerytables/XEH_PREP.hpp b/addons/artillerytables/XEH_PREP.hpp index 7ef48b61dd8..7f977dd6b32 100644 --- a/addons/artillerytables/XEH_PREP.hpp +++ b/addons/artillerytables/XEH_PREP.hpp @@ -1,8 +1,14 @@ TRACE_1("prep",_this); +PREP(adjustFire); +PREP(calculateElevation); +PREP(calculateMaxAngle); +PREP(calculateMuzzleVelocity); +PREP(calculateSolution); PREP(firedEH); PREP(interactMenuOpened); PREP(rangeTableOpen); PREP(rangeTableUpdate); +PREP(simulateShot); PREP(turretChanged); PREP(turretPFEH); diff --git a/addons/artillerytables/XEH_postInit.sqf b/addons/artillerytables/XEH_postInit.sqf index 4f0e2032088..0696302ea9b 100644 --- a/addons/artillerytables/XEH_postInit.sqf +++ b/addons/artillerytables/XEH_postInit.sqf @@ -4,10 +4,13 @@ TRACE_2("CBA_settingsInitialized",GVAR(advancedCorrections),GVAR(disableArtilleryComputer)); if (hasInterface) then { - // Add hud overlay for actuall azimuth and elevation: + // Add hud overlay for actual azimuth and elevation: GVAR(pfID) = -1; ["turret", LINKFUNC(turretChanged), true] call CBA_fnc_addPlayerEventHandler; + // Handles being teleported from one vehicle to another + ["vehicle", {[_this select 0, (_this select 1) unitTurret (_this select 0)] call FUNC(turretChanged)}] call CBA_fnc_addPlayerEventHandler; + // Add ability to dynamically open rangetables: ["ace_interactMenuOpened", LINKFUNC(interactMenuOpened)] call CBA_fnc_addEventHandler; }; @@ -30,6 +33,33 @@ }; }] call CBA_fnc_addEventHandler; +addMissionEventHandler ["ExtensionCallback", { + params ["_name", "_function", "_data"]; + if (_name == "ace:artillery" && {_function == "calculate_table"}) then { + (parseSimpleArray _data) params ["_line", "_data"]; + if (_data isEqualType []) then { + GVAR(tableData) set [_line, _data]; + }; + GVAR(tableSizeReceived) = GVAR(tableSizeReceived) + 1; + if (GVAR(tableSizeReceived) == GVAR(tableSizeActual)) then { + private _dialog = uiNamespace getVariable [QGVAR(rangeTableDialog), displayNull]; + private _ctrlRangeTable = _dialog displayCtrl IDC_TABLE; + if (isNull _dialog) exitWith {true}; + for "_i" from 0 to GVAR(tableSizeActual) do { + private _row = GVAR(tableData) getOrDefault [_i, []]; + if (count _row == 12) then { + _ctrlRangeTable lnbAddRow _row; + }; + }; + private _dialog = uiNamespace getVariable [QGVAR(rangeTableDialog), displayNull]; + private _ctrlRangeTable = _dialog displayCtrl IDC_TABLE; + if (isNull _dialog) exitWith {TRACE_1("dialog closed",_this);}; + _ctrlRangeTable lnbAddRow ["", "", "", "", "", "", "", "", "", "", ""]; + TRACE_1("table filled",_ctrlRangeTable); + }; + }; +}]; + #ifdef DEBUG_MODE_FULL #include "dev\showShotInfo.inc.sqf" #include "dev\checkConfigs.inc.sqf" diff --git a/addons/artillerytables/config.cpp b/addons/artillerytables/config.cpp index 1f6fa9f74e7..5aafdfb9b2e 100644 --- a/addons/artillerytables/config.cpp +++ b/addons/artillerytables/config.cpp @@ -14,13 +14,6 @@ class CfgPatches { }; }; -class ACE_Extensions { - class ace_artillerytables { - windows = 1; - client = 1; - }; -}; - #include "CfgEventHandlers.hpp" #include "CfgMagazines.hpp" #include "CfgVehicles.hpp" diff --git a/addons/artillerytables/dev/showShotInfo.inc.sqf b/addons/artillerytables/dev/showShotInfo.inc.sqf index ac99acbdc16..6945e95ba0b 100644 --- a/addons/artillerytables/dev/showShotInfo.inc.sqf +++ b/addons/artillerytables/dev/showShotInfo.inc.sqf @@ -35,7 +35,7 @@ INFO("showing shot info"); private _diff = _lastPos vectorDiff _shootPos; _mkrB setMarkerText format ["%1", _diff apply {round _x}]; - private _dist2d = _shootPos distance2d _lastPos; + private _dist2d = _shootPos distance2D _lastPos; private _dir = _shootPos getDir _lastPos; private _height = (_lastPos select 2) - (_shootPos select 2); _mkrB setMarkerText format ["Dist: %1m Az: %2[%3] Height:%4", _dist2d toFixed 0, _dir toFixed 2, ((6400 / 360) * _dir) toFixed 0, _height toFixed 0]; diff --git a/addons/artillerytables/functions/fnc_adjustFire.sqf b/addons/artillerytables/functions/fnc_adjustFire.sqf new file mode 100644 index 00000000000..1e07c5ca212 --- /dev/null +++ b/addons/artillerytables/functions/fnc_adjustFire.sqf @@ -0,0 +1,41 @@ +#include "..\script_component.hpp" +/* + * Author: LorenLuke + * Adjusts a target point north and east, and recalculates a solution in air based on atmospheric conditions + * + * Arguments: + * 0: Gun Position ASL <ARRAY> + * 1: Target Position ASL <ARRAY> + * 2: Adjustment to the East (negative is West); meters <NUMBER> + * 3: Adjustment to the North (negative is South); meters <NUMBER> + * 4: Adjustment vertically (negative is Down); meters <NUMBER> + * 5: Muzzle velocity; meters/second <NUMBER> + * 6: Air Friction; meters^-1 (m/s^2)/(m^2/s^2) <NUMBER> + * 7: High angle boolean (true is high angle) <BOOL> + * 8: Temperature; degrees Celsius <NUMBER> + * 9: Atmospheric Density; kg/(meters^3) <NUMBER> + * 10: Direction of wind; degrees clockwise from north <NUMBER> + * 11: Speed of wind; meters/second <NUMBER> + * + * Return Value: + * Array of returns <ARRAY> + * 0: Angle of shot; Milliradians <NUMBER> + * 1: Angle adjust left or right; Milliradians <NUMBER> + * 2: Time of flight; seconds <NUMBER> + * + * Example: + * [getposASL vehicle player, targetPos, 20, 50, 0, 200, -0.0001, true, 15, 1.225, 225, 5] call ace_artilleryTables_fnc_adjustFire + * + * Public: No + */ + +params ["_gunPos", "_targetPos", "_adjustEast", "_adjustNorth", "_adjustUp", "_muzzleVelocity", "_airFriction", ["_highAngle", true], ["_temperature", 15], ["_airDensity", 1.225], ["_windDir", 0], ["_windSpeed", 0]]; + +//DEFAULT_AIR_FRICTION == -0.00006 +//MK6_82mm_AIR_FRICTION == -0.0001 + +private _resultPos = [_adjustEast + _targetPos select 0, _adjustNorth + _targetPos select 1, _adjustUp + _targetPos select 2]; + +private _returns = [_gunPos, _resultPos, _muzzleVelocity, _highAngle, _airFriction, _temperature, _airDensity, _windDir, _windSpeed] call FUNC(calculateSolution); + +_returns diff --git a/addons/artillerytables/functions/fnc_calculateElevation.sqf b/addons/artillerytables/functions/fnc_calculateElevation.sqf new file mode 100644 index 00000000000..977253eff93 --- /dev/null +++ b/addons/artillerytables/functions/fnc_calculateElevation.sqf @@ -0,0 +1,71 @@ +#include "..\script_component.hpp" +/* + * Author: LorenLuke + * Adjusts a target point north and east, and recalculates a solution in air based on atmospheric conditions + * + * Arguments: + * 0: Distance to Target; meters <NUMBER> + * 1: Height of target; meters, relative to gun altitude (positive means target higher than gun) <NUMBER> + * 2: Muzzle velocity; meters/second <NUMBER> + * 3: High angle boolean (true is high angle) <BOOL> + * 4: Air Friction; meters^-1 [(m/s^2)/(m^2/s^2)] <NUMBER> + * 5: Temperature; degrees Celsius <NUMBER> + * 6: Atmospheric Density; kg/(meters^3) <NUMBER> + * 7: Cross wind; meters/second (negative is Right to Left) <NUMBER> + * 8: Tail wind; meters/second (negative is flying against the wind) <NUMBER> + * + * Return Value: + * Array of returns <ARRAY> + * 0: Angle of shot; Milliradians <NUMBER> + * 1: Angle adjust left or right; Milliradians <NUMBER> + * 2: Time of flight; seconds <NUMBER> + * + * Example: + * [myPos, 0, 200, true, -0.0001, 15, 1.225, 5, -10] call ace_artilleryTables_fnc_calculateElevation + * + * Public: No + */ + +params ["_targetDistance", "_targetHeight", "_muzzleVelocity", ["_highArc", true], ["_airFriction", 0], ["_temperature", 15], ["_airDensity", 1.225], ["_crossWind", 0], ["_tailWind", 0]]; + +//DEFAULT_AIR_FRICTION == -0.00006 +//MK6_82mm_AIR_FRICTION == -0.0001 + +if (_airFriction != 0) then { + _muzzleVelocity = [_muzzleVelocity, _temperature, _airDensity] call FUNC(calculateMuzzleVelocity); +}; +private _maxResults = [_muzzleVelocity, _airFriction] call FUNC(calculateMaxAngle); + +private _testShot = [_maxResults select 0, _targetHeight, _muzzleVelocity, _airFriction, _crossWind, _tailWind, _temperature, _airDensity] call FUNC(simulateShot); +if (_testShot select 1 < _targetDistance) exitWith { + //No way we can hit it so don't bother; + [-1, -1, -1] +}; + +private _useDistance = _targetDistance; +private _useAngle = 0; +private _resultDistance = 0; +private _xDeviation = 0; +private _tof = 0; + +while {abs(_resultDistance - _targetDistance) > 0.5} do { + TRACE_7("callExtension:artillery:simulate_find_solution",_useDistance,_targetHeight,_muzzleVelocity,_airFriction,_higharc,DEFAULT_MIN_ELEV,DEFAULT_MAX_ELEV); + ( + "ace" callExtension ["artillery:simulate_find_solution", [_useDistance, _targetHeight, _muzzleVelocity, _airFriction, _higharc, DEFAULT_MIN_ELEV, DEFAULT_MAX_ELEV]] + ) params ["_data", "_code"]; + TRACE_1("",_code); + (parseSimpleArray _data) params ["", "_useAngleRad", ""]; + _useAngle = deg(_useAngleRad) * DEGTOMILS; + + private _shotResults = [_useAngle, _targetHeight, _muzzleVelocity, _airFriction, _crossWind, _tailWind, _temperature, _airDensity] call FUNC(simulateShot); + + _xDeviation = _shotResults select 0; + _resultDistance = _shotResults select 1; + _tof = _shotResults select 2; + _useDistance = (2 * _targetDistance) - _resultDistance; +}; + +private _angleOffsetDeg = _xDeviation atan2 _resultDistance; +private _angleOffset = _angleOffsetDeg * DEGTOMILS; + +[_useAngle, -_angleOffset, _tof] diff --git a/addons/artillerytables/functions/fnc_calculateMaxAngle.sqf b/addons/artillerytables/functions/fnc_calculateMaxAngle.sqf new file mode 100644 index 00000000000..9866ec4b28e --- /dev/null +++ b/addons/artillerytables/functions/fnc_calculateMaxAngle.sqf @@ -0,0 +1,28 @@ +#include "..\script_component.hpp" +/* + * Author: LorenLuke + * Calculates the best possible angle to shoot farthest based on muzzle velocity and air friction. + * + * Arguments: + * 0: Initial Muzzle Velocity; meters/second <NUMBER> + * 1: Air Friction; meters^-1 (m/s^2)/(m^2/s^2) <NUMBER> + * + * Return Values: <ARRAY> + * 1: Best Angle; Milliradians <NUMBER> + * 2: Furthest Distance; Meters <NUMBER> + * + * Example: + * [200, -0.00006] call ace_artilleryTables_fnc_calculateMaxAngle + * + * Public: No + */ + +params ["_muzzleVelocity", "_airFriction"]; + +TRACE_2("callExtension:artillery:find_max_angle",_muzzleVelocity,_airFriction); +( + "ace" callExtension ["artillery:find_max_angle", [_muzzleVelocity, _airFriction]] +) params ["_data", "_code"]; +TRACE_1("",_code); +(parseSimpleArray _data) params ["_bestAngle", "_bestDistance"]; +[deg _bestAngle * 6400 / 360, _bestDistance] // return diff --git a/addons/artillerytables/functions/fnc_calculateMuzzleVelocity.sqf b/addons/artillerytables/functions/fnc_calculateMuzzleVelocity.sqf new file mode 100644 index 00000000000..6f00f74c148 --- /dev/null +++ b/addons/artillerytables/functions/fnc_calculateMuzzleVelocity.sqf @@ -0,0 +1,28 @@ +#include "..\script_component.hpp" +/* + * Author: LorenLuke + * Calculates the muzzleVelocity change with advanced calculations. + * + * Arguments: + * 0: Initial Muzzle velocity; meters/second <NUMBER> + * 1: Temperature; degrees Celsius <NUMBER> + * 2: Atmospheric Density; kg/(meters^3) <NUMBER> + * + * Return Value: + * Adjusted Muzzle Velocity; Meters <NUMBER> + * + * Example: + * [200, 15, 1.225] call ace_artilleryTables_fnc_calculateMuzzleVelocity + * + * Public: No + */ + +params ["_muzzleVelocity", "_temperature", "_airDensity"]; + +// Calculate air density +private _relativeDensity = _airDensity / 1.225; +private _newMuzzleVelocityCoefficient = (((_temperature + 273.13) / 288.13 - 1) / 40 + 1); + +private _newMuzzleVelocity = _muzzleVelocity * _newMuzzleVelocityCoefficient; + +_newMuzzleVelocity diff --git a/addons/artillerytables/functions/fnc_calculateSolution.sqf b/addons/artillerytables/functions/fnc_calculateSolution.sqf new file mode 100644 index 00000000000..13e798568c4 --- /dev/null +++ b/addons/artillerytables/functions/fnc_calculateSolution.sqf @@ -0,0 +1,44 @@ +#include "..\script_component.hpp" +/* + * Author: LorenLuke + * Provides fire angle and deflection solutions on a target of set distance and height, including accounting for drag and atmospheric wind conditions. + * + * Arguments: + * 0: Gun Position ASL; <ARRAY> + * 1: Target Position ASL; <ARRAY> + * 2: Muzzle Velocity; meters/second <NUMBER> + * 3: High angle boolean (true is high angle) <BOOL> + * 4: Air Friction; meters^-1 [(m/s^2)/(m^2/s^2)] <NUMBER> + * 5: Temperature; degrees Celsius <NUMBER> + * 6: Atmospheric Density; kg/(meters^3) <NUMBER> + * 7: Direction of wind; degrees clockwise from north <NUMBER> + * 8: Speed of wind; meters/second <NUMBER> + * + * Return Value: + * array of returns <ARRAY> + * 0: Angle of shot; Milliradians <NUMBER> + * 1: Angle adjust left or right; Milliradians <NUMBER> + * 2: Time of flight; seconds <NUMBER> + * + * Example: + * [myPos, targetPos, 200, true, -0.0001, 15, 1.225, 225, 5] call ace_artilleryTables_fnc_calculateSolution + * + * Public: No + */ + +params ["_ownPos", "_targetPos", "_muzzleVelocity", ["_highAngle", true], ["_airFriction", 0], ["_temperature", 15], ["_airDensity", 1.225], ["_windDir", 0], ["_windSpeed", 0]]; + +//DEFAULT_AIR_FRICTION == -0.00006 +//MK6_82mm_AIR_FRICTION == -0.0001 + +private _relPos = _targetPos vectorDiff _ownPos; + +private _targetDir = (_relpos select 0) atan2 (_relPos select 1); +private _targetDist = sqrt( (_relPos select 0)^2 + (_relpos select 1)^2 ); +private _heightDif = _relPos select 2; +private _crossWind = sin(_targetDir - _windDir) * _windSpeed; +private _tailWind = -cos(_targetDir - _windDir) * _windSpeed; + +private _solutionReturns = [_targetDist, _heightDif, _muzzleVelocity, _highAngle, _airFriction, _crossWind, _tailWind, _temperature, _airDensity] call FUNC(calculateElevation); + +_solutionReturns diff --git a/addons/artillerytables/functions/fnc_rangeTableOpen.sqf b/addons/artillerytables/functions/fnc_rangeTableOpen.sqf index 508b8c894ce..3984e4dacb9 100644 --- a/addons/artillerytables/functions/fnc_rangeTableOpen.sqf +++ b/addons/artillerytables/functions/fnc_rangeTableOpen.sqf @@ -34,7 +34,7 @@ TRACE_2("created dialog",_dialog,_ctrlChargeList); // Get Mags: private _mags = [_weaponName] call CBA_fnc_compatibleMagazines; -if (_mags isEqualTo []) exitWith {WARNING_1("No Mags",_weaponName);}; +if (_mags isEqualTo []) exitWith {WARNING_1("No Mags %1",_weaponName);}; private _magCfg = configFile >> "CfgMagazines"; private _magParamsArray = []; _mags = _mags apply { diff --git a/addons/artillerytables/functions/fnc_rangeTableUpdate.sqf b/addons/artillerytables/functions/fnc_rangeTableUpdate.sqf index 3e50f9d7ad2..4cce2499cf4 100644 --- a/addons/artillerytables/functions/fnc_rangeTableUpdate.sqf +++ b/addons/artillerytables/functions/fnc_rangeTableUpdate.sqf @@ -34,31 +34,12 @@ _ctrlElevationLow ctrlSetTextColor ([[1,1,1,1],[0.25,0.25,0.25,1]] select GVAR(l lnbClear _ctrlRangeTable; // Call extension with current data and start workers -TRACE_5("callExtension:start",_muzzleVelocity,_airFriction,_elevMin,_elevMax,GVAR(lastElevationMode)); -private _ret = "ace_artillerytables" callExtension ["start", [_muzzleVelocity,_airFriction,_elevMin,_elevMax,GVAR(lastElevationMode)]]; -TRACE_1("",_ret); - -// Non-blocking read data out of extension as it becomes availiable -[{ - private _dialog = uiNamespace getVariable [QGVAR(rangeTableDialog), displayNull]; - private _ctrlRangeTable = _dialog displayCtrl IDC_TABLE; - if (isNull _dialog) exitWith {true}; - - private _status = 1; // 1 = data on line, 2 - data not ready, 3 - done - while {_status == 1} do { - private _ret = ("ace_artillerytables" callExtension ["getline", []]); - // TRACE_1("callExtension:getline",_ret); - _status = _ret select 1; - if (_status == 1) then { _ctrlRangeTable lnbAddRow parseSimpleArray (_ret select 0) }; - }; - - (_status == 3) // exit loop when all data read -}, { - // put dummy line at end because scrolling is problematic and can't see last line - private _dialog = uiNamespace getVariable [QGVAR(rangeTableDialog), displayNull]; - private _ctrlRangeTable = _dialog displayCtrl IDC_TABLE; - if (isNull _dialog) exitWith {TRACE_1("dialog closed",_this);}; - - _ctrlRangeTable lnbAddRow ["", "", "", "", "", "", "", "", "", "", ""]; - TRACE_1("table filled",_ctrlRangeTable); -}, []] call CBA_fnc_waitUntilAndExecute; +TRACE_5("callExtension:artillery:calculate_table",_muzzleVelocity,_airFriction,_elevMin,_elevMax,GVAR(lastElevationMode)); +( + "ace" callExtension ["artillery:calculate_table", [_muzzleVelocity, _airFriction, _elevMin, _elevMax, GVAR(lastElevationMode)]] +) params ["_data", "_code"]; +TRACE_1("",_code); + +GVAR(tableData) = createHashMap; +GVAR(tableSizeActual) = (parseSimpleArray _data) select 1; +GVAR(tableSizeReceived) = 0; diff --git a/addons/artillerytables/functions/fnc_simulateShot.sqf b/addons/artillerytables/functions/fnc_simulateShot.sqf new file mode 100644 index 00000000000..be747e862ae --- /dev/null +++ b/addons/artillerytables/functions/fnc_simulateShot.sqf @@ -0,0 +1,47 @@ +#include "..\script_component.hpp" +/* + * Author: LorenLuke + * Simulates an indirect shot on a target of known height with given drag, wind, and atmospheric conditions + * + * Arguments: + * 0: Gun Elevation Angle; milliradians <NUMBER> + * 1: Relative Target Height; meters, relative to gun altitude (positive means target higher than gun) <NUMBER> + * 2: Muzzle Velocity; meters/second <NUMBER> + * 3: Air Friction; meters^-1 [(m/s^2)/(m^2/s^2)] <NUMBER> + * 4: Cross wind; meters/second (negative is Right to Left) <NUMBER> + * 5: Tail wind; meters/second (negative is flying against the wind) <NUMBER> + * 6: Temperature; degrees Celsius <NUMBER> + * 7: Atmospheric Density; kg/(meters^3) <NUMBER> + * + * Return Value: + * array of returns <ARRAY> + * 0: Deflection Adjustment To Hit; Milliradians (negative is Left) <NUMBER> + * 1: Distance of Shot; meters <NUMBER> + * 2: Time of Flight; seconds <NUMBER> + * + * Example: + * [900, 10, 200, -0.0001, 4, 0, 15, 1.225] call ace_artilleryTables_fnc_simulateShot + * + * Public: No + */ + +params ["_angle", "_targetHeight", "_muzzleVelocity", ["_airFriction", 0], ["_crossWind", 0], ["_tailWind", 0], ["_temperature", 15], ["_atmosphericDensity", 1.225]]; + +//DEFAULT_AIR_FRICTION == -0.00006 +//MK6_82mm_AIR_FRICTION == -0.0001 + +if (_airFriction != 0) then { + _muzzleVelocity = [_muzzleVelocity, _temperature, _atmosphericDensity] call FUNC(calculateMuzzleVelocity); +}; + +private _atmosphericDensityRatio = _atmosphericDensity / 1.225; +private _radAngle = rad(_angle / DEGTOMILS); + +TRACE_8("callExtension:artillery:simulate_shot",_radAngle,_targetHeight,_muzzleVelocity,_airFriction,_crossWind,_tailWind,_temperature,_atmosphericDensityRatio); +( + "ace" callExtension ["artillery:simulate_shot", [_radAngle, _targetHeight, _muzzleVelocity, _airFriction, _crossWind, _tailWind, _temperature, _atmosphericDensityRatio]] +) params ["_data", "_code"]; +TRACE_1("",_code); + +//[xDeviation, yDistance, timeOfFlight] +parseSimpleArray _data diff --git a/addons/artillerytables/functions/fnc_turretPFEH.sqf b/addons/artillerytables/functions/fnc_turretPFEH.sqf index 9ad10de1aa8..5e4e6c94657 100644 --- a/addons/artillerytables/functions/fnc_turretPFEH.sqf +++ b/addons/artillerytables/functions/fnc_turretPFEH.sqf @@ -30,7 +30,10 @@ if (isNull (uiNamespace getVariable [QGVAR(display), displayNull])) then { }; private _ctrlGroup = (uiNamespace getVariable [QGVAR(display), displayNull]) displayCtrl 1000; -if (cameraView != "GUNNER") exitWith { // need to be in gunner mode, so we can check where the optics are aiming at + +// Need to be in gunner mode, so we can check where the optics are aiming at +// However, if there are no optics, ignore the above +if (!_invalidGunnerMem && {cameraView != "GUNNER"}) exitWith { _ctrlGroup ctrlShow false; }; _ctrlGroup ctrlShow true; @@ -40,7 +43,7 @@ BEGIN_COUNTER(pfeh); private _currentFireMode = (weaponState [_vehicle, _turret]) select 2; private _currentChargeMode = _fireModes find _currentFireMode; -private _lookVector = (AGLtoASL (positionCameraToWorld [0,0,0])) vectorFromTo (AGLtoASL (positionCameraToWorld [0,0,1])); +private _lookVector = (AGLToASL (positionCameraToWorld [0,0,0])) vectorFromTo (AGLToASL (positionCameraToWorld [0,0,1])); private _weaponDir = _vehicle weaponDirection (currentWeapon _vehicle); // Calc real azimuth/elevation @@ -48,7 +51,7 @@ private _weaponDir = _vehicle weaponDirection (currentWeapon _vehicle); private _display = uiNamespace getVariable ["ACE_dlgArtillery", displayNull]; private _useRealWeaponDir = if ((isNull (_display displayCtrl 173)) || {(_vehicle ammo (currentWeapon _vehicle)) == 0}) then { // With no ammo, distance display will be empty, but gun will still fire at wonky angle if aimed at ground - private _testSeekerPosASL = AGLtoASL (positionCameraToWorld [0,0,0]); + private _testSeekerPosASL = AGLToASL (positionCameraToWorld [0,0,0]); private _testPoint = _testSeekerPosASL vectorAdd (_lookVector vectorMultiply viewDistance); !((terrainIntersectASL [_testSeekerPosASL, _testPoint]) || {lineIntersects [_testSeekerPosASL, _testPoint, _vehicle]}); } else { @@ -81,8 +84,8 @@ private _ctrlCharge = (uiNamespace getVariable [QGVAR(display), displayNull]) di private _ctrlAzimuth = (uiNamespace getVariable [QGVAR(display), displayNull]) displayCtrl IDC_AZIMUTH; private _ctrlElevation = (uiNamespace getVariable [QGVAR(display), displayNull]) displayCtrl IDC_ELEVATION; -_ctrlAzimuth ctrlSetText Format ["AZ: %1", [DEGTOMILS * _realAzimuth, 4, 0] call CBA_fnc_formatNumber]; -_ctrlElevation ctrlSetText Format ["EL: %1", [DEGTOMILS * _realElevation, 4, 0] call CBA_fnc_formatNumber]; +_ctrlAzimuth ctrlSetText format ["AZ: %1", [DEGTOMILS * _realAzimuth, 4, 0] call CBA_fnc_formatNumber]; +_ctrlElevation ctrlSetText format ["EL: %1", [DEGTOMILS * _realElevation, 4, 0] call CBA_fnc_formatNumber]; _ctrlCharge ctrlSetText format ["CH: %1", _currentChargeMode]; // avalible for other addons (mk6) diff --git a/addons/artillerytables/script_component.hpp b/addons/artillerytables/script_component.hpp index 128c3c17ff1..a2303b2a762 100644 --- a/addons/artillerytables/script_component.hpp +++ b/addons/artillerytables/script_component.hpp @@ -12,6 +12,10 @@ // This is a good fit for most large artillery, but a little low for lighter mortars #define DEFAULT_AIR_FRICTION -0.00006 +#define DEFAULT_MIN_ELEV 0 +// 90 degrees in radians +#define DEFAULT_MAX_ELEV 1.5708 + #define DEGTOMILS 17.7777778 #define IDC_MODECONTROLGROUP 1000 diff --git a/addons/atragmx/RscTitles.hpp b/addons/atragmx/RscTitles.hpp index 6196346c575..33b8c8036a0 100644 --- a/addons/atragmx/RscTitles.hpp +++ b/addons/atragmx/RscTitles.hpp @@ -157,8 +157,8 @@ class ATragMX_Display { SizeEX="0.025"; idc=720000; style=48; - x="0.55*safezoneW+safezoneX-0.256"; - y="0.265*safezoneH+safezoneY-0.1"; + x="0.55*safeZoneW+safeZoneX-0.256"; + y="0.265*safeZoneH+safeZoneY-0.1"; w="1.024"; h="1.024*4/3"; colorBackground[]={1,1,1,1}; @@ -167,8 +167,8 @@ class ATragMX_Display { }; class POWER: ATragMX_RscButton { idc=-1; - x="0.55*safezoneW+safezoneX+0.145"; - y="0.265*safezoneH+safezoneY+0.94"; + x="0.55*safeZoneW+safeZoneX+0.145"; + y="0.265*safeZoneH+safeZoneY+0.94"; w="0.045"; h="0.045*4/3"; colorBackground[]={0,0,0,0.0}; @@ -177,26 +177,26 @@ class ATragMX_Display { class BACK: POWER { idc=-1; w="0.06"; - x="0.55*safezoneW+safezoneX+0.3122"; + x="0.55*safeZoneW+safeZoneX+0.3122"; action=QUOTE(call FUNC(init); call FUNC(update_target_selection)); }; class WINDOWS: ATragMX_RscButton { idc=-1; - x="0.55*safezoneW+safezoneX+0.130"; - y="0.265*safezoneH+safezoneY+0.88"; + x="0.55*safeZoneW+safeZoneX+0.130"; + y="0.265*safeZoneH+safeZoneY+0.88"; w="0.035"; h="0.035*4/3"; colorBackground[]={0,0,0,0.0}; }; class OK: WINDOWS { idc=-1; - x="0.55*safezoneW+safezoneX+0.347"; - y="0.265*safezoneH+safezoneY+0.878"; + x="0.55*safeZoneW+safeZoneX+0.347"; + y="0.265*safeZoneH+safeZoneY+0.878"; }; class TOP: ATragMX_RscButton { idc=-1; - x="0.55*safezoneW+safezoneX+0.242"; - y="0.265*safezoneH+safezoneY+0.85"; + x="0.55*safeZoneW+safeZoneX+0.242"; + y="0.265*safeZoneH+safeZoneY+0.85"; w="0.03"; h="0.03"; colorBackground[]={0,0,0,0.0}; @@ -204,13 +204,13 @@ class ATragMX_Display { }; class BOTTOM: TOP { idc=-1; - y="0.265*safezoneH+safezoneY+0.955"; + y="0.265*safeZoneH+safeZoneY+0.955"; action=QUOTE(+1 call FUNC(cycle_gun_list)); }; class LEFT: ATragMX_RscButton { idc=-1; - x="0.55*safezoneW+safezoneX+0.1925"; - y="0.265*safezoneH+safezoneY+0.9"; + x="0.55*safeZoneW+safeZoneX+0.1925"; + y="0.265*safeZoneH+safeZoneY+0.9"; w="0.05"; h="0.03"; colorBackground[]={0,0,0,0}; @@ -218,50 +218,50 @@ class ATragMX_Display { }; class RIGHT: LEFT { idc=-1; - x="0.55*safezoneW+safezoneX+0.2725"; + x="0.55*safeZoneW+safeZoneX+0.2725"; action=QUOTE(((4 + GVAR(currentTarget) + 1) % 4) call FUNC(change_target_slot)); }; class TOP_LEFT: ATragMX_RscButton { idc=-1; - x="0.55*safezoneW+safezoneX+0.162"; - y="0.265*safezoneH+safezoneY+0.82"; + x="0.55*safeZoneW+safeZoneX+0.162"; + y="0.265*safeZoneH+safeZoneY+0.82"; w="0.031"; h="0.031*4/3"; colorBackground[]={0,0,0,0.0}; }; class TOP_RIGHT: TOP_LEFT { idc=-1; - x="0.55*safezoneW+safezoneX+0.315"; + x="0.55*safeZoneW+safeZoneX+0.315"; }; class TEXT_GUN_FRAME: ATragMX_RscText { idc=1001; style=64; - x="0.550*safezoneW+safezoneX+0.11"; - y="0.265*safezoneH+safezoneY+0.25"; + x="0.550*safeZoneW+safeZoneX+0.11"; + y="0.265*safeZoneH+safeZoneY+0.25"; w="0.0925"; h="0.205"; text=""; }; class TEXT_ATMOSPHERE_FRAME: TEXT_GUN_FRAME { idc=1002; - x="0.550*safezoneW+safezoneX+0.205"; + x="0.550*safeZoneW+safeZoneX+0.205"; }; class TEXT_TARGET_FRAME: TEXT_GUN_FRAME { idc=1003; - x="0.550*safezoneW+safezoneX+0.3"; + x="0.550*safeZoneW+safeZoneX+0.3"; }; class TEXT_RESULT_FRAME: TEXT_GUN_FRAME { idc=1004; - x="0.550*safezoneW+safezoneX+0.11"; - y="0.265*safezoneH+safezoneY+0.46"; + x="0.550*safeZoneW+safeZoneX+0.11"; + y="0.265*safeZoneH+safeZoneY+0.46"; w="0.2825"; h="0.15"; }; class TEXT_GUN_PROFILE: ATragMX_RscText { idc=1000; - x="0.550*safezoneW+safezoneX+0.11"; - y="0.265*safezoneH+safezoneY+0.20"; + x="0.550*safeZoneW+safeZoneX+0.11"; + y="0.265*safeZoneH+safeZoneY+0.20"; w="0.18"; h="0.03"; style=ST_LEFT; @@ -271,8 +271,8 @@ class ATragMX_Display { class TEXT_D: ATragMX_RscButton { idc=600; w="0.0231"; - x="0.550*safezoneW+safezoneX+0.29"; - y="0.265*safezoneH+safezoneY+0.20"; + x="0.550*safeZoneW+safeZoneX+0.29"; + y="0.265*safeZoneH+safeZoneY+0.20"; colorText[]={0,0,0,1}; colorDisabled[]={0.8,0.8,0.8,1}; colorBackgroundDisabled[]={0,0,0,1}; @@ -282,20 +282,20 @@ class ATragMX_Display { }; class TEXT_E: TEXT_D { idc=601; - x="0.550*safezoneW+safezoneX+0.3131"; + x="0.550*safeZoneW+safeZoneX+0.3131"; text="E"; action=QUOTE(GVAR(currentUnit)=1; call FUNC(update_unit_selection)); }; class TEXT_M: TEXT_E { idc=602; - x="0.550*safezoneW+safezoneX+0.3362"; + x="0.550*safeZoneW+safeZoneX+0.3362"; text="M"; action=QUOTE(GVAR(currentUnit)=2; call FUNC(update_unit_selection)); }; class TEXT_RANGE_CARD: TEXT_D { idc=603; w="0.03"; - x="0.550*safezoneW+safezoneX+0.36"; + x="0.550*safeZoneW+safeZoneX+0.36"; colorBackground[]={0.15,0.21,0.23,0.3}; colorFocused[]={0.15,0.21,0.23,0.2}; text="RC"; @@ -305,8 +305,8 @@ class ATragMX_Display { class TEXT_GUN: ATragMX_RscButton { idc=4000; w="0.0925"; - x="0.550*safezoneW+safezoneX+0.11"; - y="0.265*safezoneH+safezoneY+0.25"; + x="0.550*safeZoneW+safeZoneX+0.11"; + y="0.265*safeZoneH+safeZoneY+0.25"; colorBackground[]={0.15,0.21,0.23,0.3}; colorFocused[]={0.15,0.21,0.23,0.2}; text="Gun"; @@ -315,41 +315,41 @@ class ATragMX_Display { class TEXT_BORE_HEIGHT: TEXT_GUN_PROFILE { idc=10; style=ST_LEFT; - y="0.265*safezoneH+safezoneY+0.285"; + y="0.265*safeZoneH+safeZoneY+0.285"; text="BH"; }; class TEXT_BORE_HEIGHT_OUTPUT: TEXT_BORE_HEIGHT { idc=100; style=ST_RIGHT; w="0.058"; - x="0.550*safezoneW+safezoneX+0.145"; - y="0.265*safezoneH+safezoneY+0.285"; + x="0.550*safeZoneW+safeZoneX+0.145"; + y="0.265*safeZoneH+safeZoneY+0.285"; }; class TEXT_BULLET_MASS: TEXT_BORE_HEIGHT { idc=11; style=ST_LEFT; - y="0.265*safezoneH+safezoneY+0.320"; + y="0.265*safeZoneH+safeZoneY+0.320"; text="BW"; }; class TEXT_BULLET_MASS_OUTPUT: TEXT_BORE_HEIGHT_OUTPUT { idc=110; - y="0.265*safezoneH+safezoneY+0.320"; + y="0.265*safeZoneH+safeZoneY+0.320"; }; class TEXT_AIR_FRICTION: TEXT_BORE_HEIGHT { idc=12; - y="0.265*safezoneH+safezoneY+0.355"; + y="0.265*safeZoneH+safeZoneY+0.355"; text="C1"; }; class TEXT_AIR_FRICTION_OUTPUT: TEXT_BORE_HEIGHT_OUTPUT { idc=120; - y="0.265*safezoneH+safezoneY+0.355"; + y="0.265*safeZoneH+safeZoneY+0.355"; }; class TEXT_MUZZLE_VELOCITY: ATragMX_RscButton { idc=13; style=0; w="0.03"; - x="0.550*safezoneW+safezoneX+0.11"; - y="0.265*safezoneH+safezoneY+0.390"; + x="0.550*safeZoneW+safeZoneX+0.11"; + y="0.265*safeZoneH+safeZoneY+0.390"; colorBackground[]={0.15,0.21,0.23,0.3}; colorFocused[]={0.15,0.21,0.23,0.2}; text="MV"; @@ -357,69 +357,69 @@ class ATragMX_Display { }; class TEXT_MUZZLE_VELOCITY_OUTPUT: TEXT_BORE_HEIGHT_OUTPUT { idc=130; - y="0.265*safezoneH+safezoneY+0.390"; + y="0.265*safeZoneH+safeZoneY+0.390"; }; class TEXT_ZERO_RANGE: TEXT_BORE_HEIGHT { idc=14; - y="0.265*safezoneH+safezoneY+0.425"; + y="0.265*safeZoneH+safeZoneY+0.425"; text="ZR"; }; class TEXT_ZERO_RANGE_OUTPUT: TEXT_BORE_HEIGHT_OUTPUT { idc=140; - y="0.265*safezoneH+safezoneY+0.425"; + y="0.265*safeZoneH+safeZoneY+0.425"; }; class TEXT_ATMOSPHERE: TEXT_GUN { idc=4001; - x="0.550*safezoneW+safezoneX+0.205"; + x="0.550*safeZoneW+safeZoneX+0.205"; text="Atmsphr"; action=QUOTE(0 call FUNC(toggle_atmo_env_data)); }; class TEXT_TEMPERATURE: TEXT_BULLET_MASS { idc=20; - x="0.550*safezoneW+safezoneX+0.20"; + x="0.550*safeZoneW+safeZoneX+0.20"; text="Tmp"; }; class TEXT_TEMPERATURE_OUTPUT: TEXT_TEMPERATURE { idc=200; style=ST_RIGHT; w="0.050"; - x="0.550*safezoneW+safezoneX+0.245"; - y="0.265*safezoneH+safezoneY+0.320"; + x="0.550*safeZoneW+safeZoneX+0.245"; + y="0.265*safeZoneH+safeZoneY+0.320"; text=""; }; class TEXT_BAROMETRIC_PRESSURE: TEXT_TEMPERATURE { idc=21; - x="0.550*safezoneW+safezoneX+0.20"; - y="0.265*safezoneH+safezoneY+0.355"; + x="0.550*safeZoneW+safeZoneX+0.20"; + y="0.265*safeZoneH+safeZoneY+0.355"; text="BP"; }; class TEXT_BAROMETRIC_PRESSURE_OUTPUT: TEXT_TEMPERATURE_OUTPUT { idc=210; - y="0.265*safezoneH+safezoneY+0.355"; + y="0.265*safeZoneH+safeZoneY+0.355"; }; class TEXT_RELATIVE_HUMIDITY: TEXT_BAROMETRIC_PRESSURE { idc=22; - y="0.265*safezoneH+safezoneY+0.390"; + y="0.265*safeZoneH+safeZoneY+0.390"; text="RH"; }; class TEXT_RELATIVE_HUMIDITY_OUTPUT: TEXT_TEMPERATURE_OUTPUT { idc=220; - y="0.265*safezoneH+safezoneY+0.390"; + y="0.265*safeZoneH+safeZoneY+0.390"; }; class TEXT_ALTITUDE: TEXT_BORE_HEIGHT { idc=23; - x="0.550*safezoneW+safezoneX+0.20"; + x="0.550*safeZoneW+safeZoneX+0.20"; text="Alt"; }; class TEXT_ALTITUDE_OUTPUT: TEXT_TEMPERATURE_OUTPUT { idc=230; - y="0.265*safezoneH+safezoneY+0.285"; + y="0.265*safeZoneH+safeZoneY+0.285"; }; class TEXT_TARGET_A: ATragMX_RscButton { idc=500; w="0.0231"; - x="0.550*safezoneW+safezoneX+0.205"; - y="0.265*safezoneH+safezoneY+0.425"; + x="0.550*safeZoneW+safeZoneX+0.205"; + y="0.265*safeZoneH+safeZoneY+0.425"; colorText[]={0,0,0,1}; colorDisabled[]={0.8,0.8,0.8,1}; colorBackgroundDisabled[]={0,0,0,1}; @@ -429,103 +429,103 @@ class ATragMX_Display { }; class TEXT_TARGET_B: TEXT_TARGET_A { idc=501; - x="0.550*safezoneW+safezoneX+0.2281"; + x="0.550*safeZoneW+safeZoneX+0.2281"; text="B"; action=QUOTE(1 call FUNC(change_target_slot)); }; class TEXT_TARGET_C: TEXT_TARGET_A { idc=502; - x="0.550*safezoneW+safezoneX+0.2512"; + x="0.550*safeZoneW+safeZoneX+0.2512"; text="C"; action=QUOTE(2 call FUNC(change_target_slot)); }; class TEXT_TARGET_D: TEXT_TARGET_A { idc=503; - x="0.550*safezoneW+safezoneX+0.2743"; + x="0.550*safeZoneW+safeZoneX+0.2743"; text="D"; action=QUOTE(3 call FUNC(change_target_slot)); }; class TEXT_TARGET: TEXT_GUN { idc=4002; - x="0.550*safezoneW+safezoneX+0.3"; + x="0.550*safeZoneW+safeZoneX+0.3"; text="Target"; action=QUOTE(0 call FUNC(toggle_target_data)); }; class TEXT_WIND_SPEED: TEXT_BORE_HEIGHT { idc=30; - x="0.550*safezoneW+safezoneX+0.3"; + x="0.550*safeZoneW+safeZoneX+0.3"; text="WS"; }; class TEXT_WIND_SPEED_OUTPUT: TEXT_BORE_HEIGHT_OUTPUT { idc=300; w="0.058"; - x="0.550*safezoneW+safezoneX+0.335"; - y="0.265*safezoneH+safezoneY+0.285"; + x="0.550*safeZoneW+safeZoneX+0.335"; + y="0.265*safeZoneH+safeZoneY+0.285"; text="0"; }; class TEXT_WIND_DIRECTION: TEXT_BULLET_MASS { idc=31; - x="0.550*safezoneW+safezoneX+0.3"; + x="0.550*safeZoneW+safeZoneX+0.3"; text="WD"; }; class TEXT_WIND_DIRECTION_OUTPUT: TEXT_WIND_SPEED_OUTPUT { idc=310; - y="0.265*safezoneH+safezoneY+0.32"; + y="0.265*safeZoneH+safeZoneY+0.32"; }; class TEXT_INCLINATION_ANGLE: TEXT_AIR_FRICTION { idc=32; - x="0.550*safezoneW+safezoneX+0.3"; + x="0.550*safeZoneW+safeZoneX+0.3"; text="IA"; }; class TEXT_INCLINATION_ANGLE_OUTPUT: TEXT_WIND_SPEED_OUTPUT { idc=320; - y="0.265*safezoneH+safezoneY+0.355"; + y="0.265*safeZoneH+safeZoneY+0.355"; }; class TEXT_TARGET_SPEED: TEXT_MUZZLE_VELOCITY { idc=33; - x="0.550*safezoneW+safezoneX+0.3"; + x="0.550*safeZoneW+safeZoneX+0.3"; text="TS"; action=QUOTE(0 call FUNC(toggle_target_speed_assist)); }; class TEXT_TARGET_SPEED_OUTPUT: TEXT_WIND_SPEED_OUTPUT { idc=330; - y="0.265*safezoneH+safezoneY+0.39"; + y="0.265*safeZoneH+safeZoneY+0.39"; }; class TEXT_TARGET_RANGE: TEXT_TARGET_SPEED { idc=34; - y="0.265*safezoneH+safezoneY+0.425"; + y="0.265*safeZoneH+safeZoneY+0.425"; text="TR"; action=QUOTE(0 call FUNC(toggle_target_range_assist)); }; class TEXT_TARGET_RANGE_INPUT: TEXT_WIND_SPEED_OUTPUT { idc=340; - y="0.265*safezoneH+safezoneY+0.425"; + y="0.265*safeZoneH+safeZoneY+0.425"; }; class TEXT_ELEVATION: TEXT_GUN_PROFILE { idc=40; w="0.05"; - x="0.550*safezoneW+safezoneX+0.115"; - y="0.265*safezoneH+safezoneY+0.50"; + x="0.550*safeZoneW+safeZoneX+0.115"; + y="0.265*safeZoneH+safeZoneY+0.50"; text="Elev"; }; class TEXT_ABSOLUTE: TEXT_GUN_PROFILE { idc=4003; w="0.07"; style=ST_CENTER; - x="0.550*safezoneW+safezoneX+0.17"; - y="0.265*safezoneH+safezoneY+0.47"; + x="0.550*safeZoneW+safeZoneX+0.17"; + y="0.265*safeZoneH+safeZoneY+0.47"; text="Abs"; }; class TEXT_RELATIVE: TEXT_ABSOLUTE { idc=4004; - x="0.550*safezoneW+safezoneX+0.245"; + x="0.550*safeZoneW+safeZoneX+0.245"; text="Rel"; }; class TEXT_CURRENT: TEXT_ABSOLUTE { idc=4005; - x="0.550*safezoneW+safezoneX+0.32"; + x="0.550*safeZoneW+safeZoneX+0.32"; text="Cur"; }; class TEXT_ELEVATION_OUTPUT_ABSOLUTE: ATragMX_RscText { @@ -534,67 +534,67 @@ class ATragMX_Display { sizeEx="0.025"; w="0.065"; h="0.032"; - x="0.550*safezoneW+safezoneX+0.17"; - y="0.265*safezoneH+safezoneY+0.50"; + x="0.550*safeZoneW+safeZoneX+0.17"; + y="0.265*safeZoneH+safeZoneY+0.50"; text=""; }; class TEXT_ELEVATION_OUTPUT_RELATIVE: TEXT_ELEVATION_OUTPUT_ABSOLUTE { idc=401; - x="0.550*safezoneW+safezoneX+0.2465"; + x="0.550*safeZoneW+safeZoneX+0.2465"; }; class TEXT_ELEVATION_INPUT_CURRENT: TEXT_ELEVATION_OUTPUT_ABSOLUTE { idc=402; - x="0.550*safezoneW+safezoneX+0.323"; + x="0.550*safeZoneW+safeZoneX+0.323"; }; class TEXT_WINDAGE: TEXT_ELEVATION { idc=41; - y="0.265*safezoneH+safezoneY+0.535"; + y="0.265*safeZoneH+safeZoneY+0.535"; text="Wind"; }; class TEXT_WINDAGE_OUTPUT_ABSOLUTE: TEXT_ELEVATION_OUTPUT_ABSOLUTE { idc=410; - y="0.265*safezoneH+safezoneY+0.535"; + y="0.265*safeZoneH+safeZoneY+0.535"; }; class TEXT_WINDAGE_OUTPUT_RELATIVE: TEXT_WINDAGE_OUTPUT_ABSOLUTE { idc=411; - x="0.550*safezoneW+safezoneX+0.2465"; + x="0.550*safeZoneW+safeZoneX+0.2465"; }; class TEXT_WINDAGE_INPUT_CURRENT: TEXT_WINDAGE_OUTPUT_ABSOLUTE { idc=412; - x="0.550*safezoneW+safezoneX+0.323"; + x="0.550*safeZoneW+safeZoneX+0.323"; }; class TEXT_LEAD: TEXT_GUN { idc=42; w="0.05"; - x="0.550*safezoneW+safezoneX+0.115"; - y="0.265*safezoneH+safezoneY+0.57"; + x="0.550*safeZoneW+safeZoneX+0.115"; + y="0.265*safeZoneH+safeZoneY+0.57"; text="Lead"; action=QUOTE(GVAR(showWind2) = !GVAR(showWind2); call FUNC(update_result); call FUNC(update_target)); }; class TEXT_LEAD_OUTPUT: TEXT_ELEVATION_OUTPUT_ABSOLUTE { idc=420; - y="0.265*safezoneH+safezoneY+0.57"; + y="0.265*safeZoneH+safeZoneY+0.57"; }; class TEXT_RESET_SCOPE_ZERO: TEXT_GUN { idc=4006; w="0.07"; style=ST_CENTER; colorBackground[]={0,0,0,0}; - x="0.550*safezoneW+safezoneX+0.2465"; - y="0.265*safezoneH+safezoneY+0.57"; + x="0.550*safeZoneW+safeZoneX+0.2465"; + y="0.265*safeZoneH+safeZoneY+0.57"; text="Reset"; action=QUOTE(call FUNC(reset_relative_click_memory)); }; class TEXT_UPDATE_SCOPE_ZERO: TEXT_RESET_SCOPE_ZERO { idc=4007; - x="0.550*safezoneW+safezoneX+0.323"; + x="0.550*safeZoneW+safeZoneX+0.323"; text="Update"; action=QUOTE(call FUNC(update_relative_click_memory)); }; class TEXT_GUN_LIST: TEXT_GUN { idc=4008; style=ST_LEFT; - y="0.265*safezoneH+safezoneY+0.65"; + y="0.265*safeZoneH+safeZoneY+0.65"; text="GunList"; action=QUOTE(call FUNC(toggle_gun_list)); }; @@ -602,7 +602,7 @@ class ATragMX_Display { idc=2000; style=ST_CENTER; w="0.06"; - x="0.550*safezoneW+safezoneX+0.205"; + x="0.550*safeZoneW+safeZoneX+0.205"; colorBackground[]={0,0,0,0}; text="TMOA"; action=QUOTE(call FUNC(cycle_scope_unit)); @@ -611,14 +611,14 @@ class ATragMX_Display { idc=2001; style=ST_CENTER; w="0.025"; - x="0.550*safezoneW+safezoneX+0.27"; + x="0.550*safeZoneW+safeZoneX+0.27"; text="4"; action=QUOTE(call FUNC(toggle_solution_setup)); }; class TEXT_OPTIONS: TEXT_GUN_LIST { idc=3000; style=ST_RIGHT; - x="0.550*safezoneW+safezoneX+0.3"; + x="0.550*safeZoneW+safeZoneX+0.3"; text="Options"; action=QUOTE(false call FUNC(toggle_option_menu)); }; @@ -627,8 +627,8 @@ class ATragMX_Display { colorBackground[]={0.15,0.21,0.23,0.2}; colorBackgroundActive[]={0.15,0.21,0.23,0.2}; colorFocused[]={0.15,0.21,0.23,0.2}; - x="0.550*safezoneW+safezoneX+0.105"; - y="0.265*safezoneH+safezoneY+0.17"; + x="0.550*safeZoneW+safeZoneX+0.105"; + y="0.265*safeZoneH+safeZoneY+0.17"; w="0.3"; h="0.535"; offsetPressedX="0.0"; @@ -640,8 +640,8 @@ class ATragMX_Display { style=0; w="0.17"; h="0.28"; - x="0.550*safezoneW+safezoneX+0.225"; - y="0.265*safezoneH+safezoneY+0.355"; + x="0.550*safeZoneW+safeZoneX+0.225"; + y="0.265*safeZoneH+safeZoneY+0.355"; sizeEx="0.025"; onMouseButtonClick=QUOTE(true call FUNC(toggle_option_menu)); }; @@ -653,8 +653,8 @@ class ATragMX_Display { class TEXT_RANGE_CARD_SETUP: ATragMX_RscButton { idc=5001; w="0.055675"; - x="0.550*safezoneW+safezoneX+0.28"; - y="0.265*safezoneH+safezoneY+0.20"; + x="0.550*safeZoneW+safeZoneX+0.28"; + y="0.265*safeZoneH+safeZoneY+0.20"; colorBackground[]={0.15,0.21,0.23,0.3}; colorFocused[]={0.15,0.21,0.23,0.2}; text="Setup"; @@ -662,7 +662,7 @@ class ATragMX_Display { }; class TEXT_RANGE_CARD_DONE: TEXT_RANGE_CARD_SETUP { idc=5002; - x="0.550*safezoneW+safezoneX+0.3362"; + x="0.550*safeZoneW+safeZoneX+0.3362"; text="Done"; action=QUOTE(call FUNC(toggle_range_card)); }; @@ -670,24 +670,24 @@ class ATragMX_Display { idc=5003; style=ST_LEFT; w="0.07"; - x="0.550*safezoneW+safezoneX+0.11"; - y="0.265*safezoneH+safezoneY+0.24"; + x="0.550*safeZoneW+safeZoneX+0.11"; + y="0.265*safeZoneH+safeZoneY+0.24"; colorBackground[]={0.15,0.21,0.23,0.3}; text="Meters"; }; class TEXT_RANGE_CARD_COLUMN_2_CAPTION: TEXT_RANGE_CARD_COLUMN_1_CAPTION { idc=5004; - x="0.550*safezoneW+safezoneX+0.180625"; + x="0.550*safeZoneW+safeZoneX+0.180625"; text="Elev"; }; class TEXT_RANGE_CARD_COLUMN_3_CAPTION: TEXT_RANGE_CARD_COLUMN_1_CAPTION { idc=5005; - x="0.550*safezoneW+safezoneX+0.25125"; + x="0.550*safeZoneW+safeZoneX+0.25125"; text="Wind"; }; class TEXT_RANGE_CARD_COLUMN_4_CAPTION: TEXT_RANGE_CARD_COLUMN_1_CAPTION { idc=5006; - x="0.550*safezoneW+safezoneX+0.321875"; + x="0.550*safeZoneW+safeZoneX+0.321875"; text="TmFlt"; action=QUOTE(call FUNC(cycle_range_card_columns)); }; @@ -698,8 +698,8 @@ class ATragMX_Display { idcRight=50062; w="0.285"; h="0.42"; - x="0.550*safezoneW+safezoneX+0.11"; - y="0.265*safezoneH+safezoneY+0.27"; + x="0.550*safeZoneW+safeZoneX+0.11"; + y="0.265*safeZoneH+safeZoneY+0.27"; }; class TEXT_GUN_LIST_OUTPUT: ATragMX_RscListNBox { @@ -707,8 +707,8 @@ class ATragMX_Display { columns[]={-0.05}; w="0.16"; h="0.45"; - x="0.550*safezoneW+safezoneX+0.11"; - y="0.265*safezoneH+safezoneY+0.24"; + x="0.550*safeZoneW+safeZoneX+0.11"; + y="0.265*safeZoneH+safeZoneY+0.24"; sizeEx="0.018"; colorSelectBackground[]={0.15,0.21,0.23,0.3}; colorSelectBackground2[]={0.15,0.21,0.23,0.3}; @@ -724,8 +724,8 @@ class ATragMX_Display { idc=6002; style=ST_RIGHT; w="0.115"; - x="0.550*safezoneW+safezoneX+0.28"; - y="0.265*safezoneH+safezoneY+0.20"; + x="0.550*safeZoneW+safeZoneX+0.28"; + y="0.265*safeZoneH+safeZoneY+0.20"; colorBackground[]={0.15,0.21,0.23,0.3}; colorFocused[]={0.15,0.21,0.23,0.2}; sizeEx="0.024"; @@ -734,30 +734,30 @@ class ATragMX_Display { }; class TEXT_GUN_LIST_SAVE_GUN: TEXT_GUN_LIST_OPEN_GUN { idc=6003; - y="0.265*safezoneH+safezoneY+0.24"; + y="0.265*safeZoneH+safeZoneY+0.24"; text="Save Gun"; action=QUOTE(call FUNC(save_gun)); }; class TEXT_GUN_LIST_ADD_NEW_GUN: TEXT_GUN_LIST_OPEN_GUN { idc=6004; - y="0.265*safezoneH+safezoneY+0.28"; + y="0.265*safeZoneH+safeZoneY+0.28"; text="Add New Gun"; action=QUOTE(false call FUNC(show_gun_list); true call FUNC(show_add_new_gun)); }; class TEXT_GUN_LIST_DELETE_GUN: TEXT_GUN_LIST_OPEN_GUN { idc=6005; - y="0.265*safezoneH+safezoneY+0.34"; + y="0.265*safeZoneH+safeZoneY+0.34"; text="Delete Gun"; action=QUOTE(call FUNC(delete_gun)); }; class TEXT_GUN_LIST_NOTE: TEXT_GUN_LIST_OPEN_GUN { idc=6006; - y="0.265*safezoneH+safezoneY+0.40"; + y="0.265*safeZoneH+safeZoneY+0.40"; text="Note"; }; class TEXT_GUN_LIST_DONE: TEXT_GUN_LIST_OPEN_GUN { idc=6007; - y="0.265*safezoneH+safezoneY+0.65"; + y="0.265*safeZoneH+safeZoneY+0.65"; text="Done"; action=QUOTE(false call FUNC(toggle_gun_list)); }; @@ -766,8 +766,8 @@ class ATragMX_Display { idc=7000; style="16+0x200"; lineSpacing=1.0; - x="0.550*safezoneW+safezoneX+0.11"; - y="0.265*safezoneH+safezoneY+0.24"; + x="0.550*safeZoneW+safeZoneX+0.11"; + y="0.265*safeZoneH+safeZoneY+0.24"; w="0.29"; h="0.10"; sizeEx="0.022"; @@ -776,8 +776,8 @@ class ATragMX_Display { class TEXT_TARGET_RANGE_ASSIST_MEASUREMENT_METHOD: TEXT_TARGET_RANGE_ASSIST_CAPTION { idc=7001; style=ST_LEFT; - x="0.550*safezoneW+safezoneX+0.115"; - y="0.265*safezoneH+safezoneY+0.35"; + x="0.550*safeZoneW+safeZoneX+0.115"; + y="0.265*safeZoneH+safeZoneY+0.35"; w="0.12"; h="0.03"; sizeEx="0.027"; @@ -786,8 +786,8 @@ class ATragMX_Display { class TEXT_TARGET_RANGE_ASSIST_WIDTH_HEIGHT: ATragMX_RscToolbox { idc=7002; w="0.14"; - x="0.550*safezoneW+safezoneX+0.24"; - y="0.265*safezoneH+safezoneY+0.35"; + x="0.550*safeZoneW+safeZoneX+0.24"; + y="0.265*safeZoneH+safeZoneY+0.35"; strings[]={"Height","Width"}; values[]={1,0}; onToolBoxSelChanged=QUOTE(GVAR(rangeAssistUseTargetHeight) = ((_this select 1) == 0)); @@ -795,73 +795,73 @@ class ATragMX_Display { class TEXT_TARGET_RANGE_ASSIST_TARGET_SIZE: TEXT_TARGET_RANGE_ASSIST_MEASUREMENT_METHOD { idc=7003; style=ST_RIGHT; - x="0.550*safezoneW+safezoneX+0.092"; - y="0.265*safezoneH+safezoneY+0.4"; + x="0.550*safeZoneW+safeZoneX+0.092"; + y="0.265*safeZoneH+safeZoneY+0.4"; w="0.128"; text="Target Size"; }; class TEXT_TARGET_RANGE_ASSIST_IMAGE_SIZE: TEXT_TARGET_RANGE_ASSIST_TARGET_SIZE { idc=7004; - y="0.265*safezoneH+safezoneY+0.45"; + y="0.265*safeZoneH+safeZoneY+0.45"; text="Image Size"; }; class TEXT_TARGET_RANGE_ASSIST_ANGLE: TEXT_TARGET_RANGE_ASSIST_TARGET_SIZE { idc=7005; - y="0.265*safezoneH+safezoneY+0.5"; + y="0.265*safeZoneH+safeZoneY+0.5"; text="Angle"; }; class TEXT_TARGET_RANGE_ASSIST_ESTIMATED_RANGE: TEXT_TARGET_RANGE_ASSIST_TARGET_SIZE { idc=7006; - y="0.265*safezoneH+safezoneY+0.55"; + y="0.265*safeZoneH+safeZoneY+0.55"; text="Est Range"; }; class TEXT_TARGET_RANGE_ASSIST_CALC_1: TEXT_MUZZLE_VELOCITY { idc=7007; w="0.0231"; - x="0.550*safezoneW+safezoneX+0.22"; - y="0.265*safezoneH+safezoneY+0.4"; + x="0.550*safeZoneW+safeZoneX+0.22"; + y="0.265*safeZoneH+safeZoneY+0.4"; sizeEx="0.03"; text="!"; action=QUOTE(0 call FUNC(calculate_target_range_assist)); }; class TEXT_TARGET_RANGE_ASSIST_CALC_2: TEXT_TARGET_RANGE_ASSIST_CALC_1 { idc=7008; - y="0.265*safezoneH+safezoneY+0.45"; + y="0.265*safeZoneH+safeZoneY+0.45"; action=QUOTE(1 call FUNC(calculate_target_range_assist)); }; class TEXT_TARGET_RANGE_ASSIST_CALC_3: TEXT_TARGET_RANGE_ASSIST_CALC_1 { idc=7009; - y="0.265*safezoneH+safezoneY+0.55"; + y="0.265*safeZoneH+safeZoneY+0.55"; action=QUOTE(2 call FUNC(calculate_target_range_assist)); }; class TEXT_TARGET_RANGE_ASSIST_TARGET_SIZE_INPUT: ATragMX_RscEdit { idc=7010; w="0.065"; - x="0.550*safezoneW+safezoneX+0.2475"; - y="0.265*safezoneH+safezoneY+0.4"; + x="0.550*safeZoneW+safeZoneX+0.2475"; + y="0.265*safeZoneH+safeZoneY+0.4"; }; class TEXT_TARGET_RANGE_ASSIST_IMAGE_SIZE_INPUT: TEXT_TARGET_RANGE_ASSIST_TARGET_SIZE_INPUT { idc=7011; - y="0.265*safezoneH+safezoneY+0.45"; + y="0.265*safeZoneH+safeZoneY+0.45"; }; class TEXT_TARGET_RANGE_ASSIST_ANGLE_INPUT: TEXT_TARGET_RANGE_ASSIST_TARGET_SIZE_INPUT { idc=7012; - y="0.265*safezoneH+safezoneY+0.5"; + y="0.265*safeZoneH+safeZoneY+0.5"; }; class TEXT_TARGET_RANGE_ASSIST_ESTIMATED_RANGE_INPUT: TEXT_TARGET_RANGE_ASSIST_TARGET_SIZE_INPUT { idc=7013; - y="0.265*safezoneH+safezoneY+0.55"; + y="0.265*safeZoneH+safeZoneY+0.55"; }; class TEXT_TARGET_RANGE_ASSIST_TARGET_SIZE_UNIT: TEXT_TARGET_RANGE_ASSIST_CALC_1 { idc=7014; w="0.07"; - x="0.550*safezoneW+safezoneX+0.32"; + x="0.550*safeZoneW+safeZoneX+0.32"; text="cm"; action=QUOTE(call FUNC(cycle_target_size_units)); }; class TEXT_TARGET_RANGE_ASSIST_IMAGE_SIZE_UNIT: TEXT_TARGET_RANGE_ASSIST_TARGET_SIZE_UNIT { idc=7015; - y="0.265*safezoneH+safezoneY+0.45"; + y="0.265*safeZoneH+safeZoneY+0.45"; text="MIL"; action=QUOTE(call FUNC(cycle_image_size_units)); }; @@ -869,15 +869,15 @@ class ATragMX_Display { idc=7016; style=ST_LEFT; w="0.07"; - x="0.550*safezoneW+safezoneX+0.32"; + x="0.550*safeZoneW+safeZoneX+0.32"; text="Meters"; }; class TEXT_TARGET_RANGE_ASSIST_DONE: ATragMX_RscButton { idc=7017; style=ST_CENTER; w="0.07"; - x="0.550*safezoneW+safezoneX+0.11"; - y="0.265*safezoneH+safezoneY+0.60"; + x="0.550*safeZoneW+safeZoneX+0.11"; + y="0.265*safeZoneH+safeZoneY+0.60"; colorBackground[]={0.15,0.21,0.23,0.3}; colorFocused[]={0.15,0.21,0.23,0.2}; text="Done"; @@ -885,41 +885,41 @@ class ATragMX_Display { }; class TEXT_TARGET_RANGE_ASSIST_CANCEL: TEXT_TARGET_RANGE_ASSIST_DONE { idc=7018; - x="0.550*safezoneW+safezoneX+0.180625"; + x="0.550*safeZoneW+safeZoneX+0.180625"; text="Cancel"; action=QUOTE(0 call FUNC(toggle_target_range_assist)); }; class TEXT_TARGET_RANGE_ASSIST_PREV: TEXT_TARGET_RANGE_ASSIST_DONE { idc=7019; - x="0.550*safezoneW+safezoneX+0.25125"; + x="0.550*safeZoneW+safeZoneX+0.25125"; text="Prev"; action=""; }; class TEXT_TARGET_RANGE_ASSIST_NEXT: TEXT_TARGET_RANGE_ASSIST_DONE { idc=7020; - x="0.550*safezoneW+safezoneX+0.321875"; + x="0.550*safeZoneW+safeZoneX+0.321875"; text="Next"; action=""; }; class TEXT_TARGET_SPEED_ASSIST_TARGET_RANGE: TEXT_TARGET_RANGE_ASSIST_TARGET_SIZE { idc=8000; - x="0.550*safezoneW+safezoneX+0.12"; + x="0.550*safeZoneW+safeZoneX+0.12"; text="Target Range"; }; class TEXT_TARGET_SPEED_ASSIST_NUM_TICKS: TEXT_TARGET_RANGE_ASSIST_IMAGE_SIZE { idc=8001; - x="0.550*safezoneW+safezoneX+0.12"; + x="0.550*safeZoneW+safeZoneX+0.12"; text="Num Ticks"; }; class TEXT_TARGET_SPEED_ASSIST_TIME: TEXT_TARGET_RANGE_ASSIST_ANGLE { idc=8002; - x="0.550*safezoneW+safezoneX+0.12"; + x="0.550*safeZoneW+safeZoneX+0.12"; text="Time (secs)"; }; class TEXT_TARGET_SPEED_ASSIST_TARGET_ESTIMATED_SPEED: TEXT_TARGET_RANGE_ASSIST_ESTIMATED_RANGE { idc=8003; - x="0.550*safezoneW+safezoneX+0.12"; + x="0.550*safeZoneW+safeZoneX+0.12"; text="Est Speed"; }; class TEXT_TARGET_SPEED_ASSIST_TARGET_RANGE_INPUT: TEXT_TARGET_RANGE_ASSIST_TARGET_SIZE_INPUT { @@ -937,14 +937,14 @@ class ATragMX_Display { class TEXT_TARGET_SPEED_ASSIST_TARGET_ESTIMATED_SPEED_OUTPUT: TEXT_TARGET_RANGE_ASSIST_ESTIMATED_RANGE { idc=8007; w="0.065"; - x="0.550*safezoneW+safezoneX+0.2475"; - y="0.265*safezoneH+safezoneY+0.55"; + x="0.550*safeZoneW+safeZoneX+0.2475"; + y="0.265*safeZoneH+safeZoneY+0.55"; colorBackground[]={0.15,0.21,0.23,0.3}; text="0"; }; class TEXT_TARGET_SPEED_ASSIST_TARGET_RANGE_UNIT: TEXT_TARGET_RANGE_ASSIST_ESTIMATED_RANGE_UNIT { idc=8008; - y="0.265*safezoneH+safezoneY+0.4"; + y="0.265*safeZoneH+safeZoneY+0.4"; text="Meters"; }; class TEXT_TARGET_SPEED_ASSIST_NUM_TICKS_UNIT: TEXT_TARGET_RANGE_ASSIST_IMAGE_SIZE_UNIT { @@ -954,7 +954,7 @@ class ATragMX_Display { }; class TEXT_TARGET_SPEED_ASSIST_TIMER_START: TEXT_TARGET_RANGE_ASSIST_IMAGE_SIZE_UNIT { idc=8010; - y="0.265*safezoneH+safezoneY+0.5"; + y="0.265*safeZoneH+safeZoneY+0.5"; text="Start"; action=QUOTE(call FUNC(target_speed_assist_timer)); }; @@ -981,16 +981,16 @@ class ATragMX_Display { idc=9000; w="0.285"; h="0.49"; - x="0.550*safezoneW+safezoneX+0.11"; - y="0.265*safezoneH+safezoneY+0.2"; + x="0.550*safeZoneW+safeZoneX+0.11"; + y="0.265*safeZoneH+safeZoneY+0.2"; colorBackground[]={0,0,0,0}; colorBackgroundActive[]={0,0,0,0}; action=QUOTE(GVAR(speedAssistTimer)=false); }; class TEXT_TARGET_SPEED_ASSIST_TIME_OUTPUT: ATragMX_RscText { idc=9001; - x="0.550*safezoneW+safezoneX+0.22"; - y="0.265*safezoneH+safezoneY+0.51"; + x="0.550*safeZoneW+safeZoneX+0.22"; + y="0.265*safeZoneH+safeZoneY+0.51"; w="0.08"; h="0.09"; style=ST_CENTER; @@ -1002,8 +1002,8 @@ class ATragMX_Display { style=ST_CENTER; w="0.07"; h="0.04"; - x="0.550*safezoneW+safezoneX+0.225"; - y="0.265*safezoneH+safezoneY+0.60"; + x="0.550*safeZoneW+safeZoneX+0.225"; + y="0.265*safeZoneH+safeZoneY+0.60"; colorBackground[]={0.15,0.21,0.23,0.3}; colorFocused[]={0.15,0.21,0.23,0.2}; text="Stop"; @@ -1012,17 +1012,17 @@ class ATragMX_Display { class TEXT_RANGE_CARD_SETUP_START_RANGE: TEXT_TARGET_RANGE_ASSIST_TARGET_SIZE { idc=10000; - x="0.550*safezoneW+safezoneX+0.12"; + x="0.550*safeZoneW+safeZoneX+0.12"; text="Start Range"; }; class TEXT_RANGE_CARD_SETUP_END_RANGE: TEXT_TARGET_RANGE_ASSIST_IMAGE_SIZE { idc=10001; - x="0.550*safezoneW+safezoneX+0.12"; + x="0.550*safeZoneW+safeZoneX+0.12"; text="End Range"; }; class TEXT_RANGE_CARD_SETUP_INCREMENT: TEXT_TARGET_RANGE_ASSIST_ANGLE { idc=10002; - x="0.550*safezoneW+safezoneX+0.12"; + x="0.550*safeZoneW+safeZoneX+0.12"; text="Increment"; }; class TEXT_RANGE_CARD_SETUP_START_RANGE_INPUT: TEXT_TARGET_RANGE_ASSIST_TARGET_SIZE_INPUT { @@ -1057,8 +1057,8 @@ class ATragMX_Display { style=ST_LEFT; w="0.25"; h="0.04"; - x="0.550*safezoneW+safezoneX+0.12"; - y="0.265*safezoneH+safezoneY+0.24"; + x="0.550*safeZoneW+safeZoneX+0.12"; + y="0.265*safeZoneH+safeZoneY+0.24"; sizeEx="0.025"; text="New Gun Name"; }; @@ -1067,8 +1067,8 @@ class ATragMX_Display { style=ST_LEFT; w="0.225"; h="0.04"; - x="0.550*safezoneW+safezoneX+0.12"; - y="0.265*safezoneH+safezoneY+0.28"; + x="0.550*safeZoneW+safeZoneX+0.12"; + y="0.265*safeZoneH+safeZoneY+0.28"; text=""; onKeyDown=QUOTE(call FUNC(trim_gun_name)); onKeyUp=QUOTE(call FUNC(trim_gun_name)); @@ -1078,8 +1078,8 @@ class ATragMX_Display { style=ST_CENTER; w="0.1"; h="0.04"; - x="0.550*safezoneW+safezoneX+0.12"; - y="0.265*safezoneH+safezoneY+0.33"; + x="0.550*safeZoneW+safeZoneX+0.12"; + y="0.265*safeZoneH+safeZoneY+0.33"; colorBackground[]={0.15,0.21,0.23,0.3}; colorFocused[]={0.15,0.21,0.23,0.2}; text="OK"; @@ -1087,7 +1087,7 @@ class ATragMX_Display { }; class TEXT_ADD_NEW_GUN_CANCEL: TEXT_ADD_NEW_GUN_OK { idc=11003; - x="0.550*safezoneW+safezoneX+0.245"; + x="0.550*safeZoneW+safeZoneX+0.245"; text="Cancel"; action=QUOTE(false call FUNC(show_add_new_gun); true call FUNC(show_gun_list)); }; @@ -1095,74 +1095,74 @@ class ATragMX_Display { class TEXT_GUN_AMMO_DATA_BORE_HEIGHT: TEXT_BORE_HEIGHT { idc=12000; w="0.22"; - y="0.265*safezoneH+safezoneY+0.28"; + y="0.265*safeZoneH+safeZoneY+0.28"; text="Bore (cm)"; }; class TEXT_GUN_AMMO_DATA_BORE_HEIGHT_INPUT: ATragMX_RscEdit { idc=120000; w="0.06"; - x="0.550*safezoneW+safezoneX+0.335"; - y="0.265*safezoneH+safezoneY+0.28"; + x="0.550*safeZoneW+safeZoneX+0.335"; + y="0.265*safeZoneH+safeZoneY+0.28"; }; class TEXT_GUN_AMMO_DATA_BULLET_MASS: TEXT_GUN_AMMO_DATA_BORE_HEIGHT { idc=12001; - y="0.265*safezoneH+safezoneY+0.320"; + y="0.265*safeZoneH+safeZoneY+0.320"; text="Bullet Weight (grams)"; }; class TEXT_GUN_AMMO_DATA_BULLET_MASS_INPUT: TEXT_GUN_AMMO_DATA_BORE_HEIGHT_INPUT { idc=120010; - y="0.265*safezoneH+safezoneY+0.320"; + y="0.265*safeZoneH+safeZoneY+0.320"; }; class TEXT_GUN_AMMO_DATA_BULLET_DIAMETER: TEXT_GUN_AMMO_DATA_BORE_HEIGHT { idc=12002; - y="0.265*safezoneH+safezoneY+0.360"; + y="0.265*safeZoneH+safeZoneY+0.360"; text="Bullet Diam (cm)"; }; class TEXT_GUN_AMMO_DATA_BULLET_DIAMETER_INPUT: TEXT_GUN_AMMO_DATA_BORE_HEIGHT_INPUT { idc=120020; - y="0.265*safezoneH+safezoneY+0.360"; + y="0.265*safeZoneH+safeZoneY+0.360"; }; class TEXT_GUN_AMMO_DATA_AIR_FRICTION: TEXT_GUN_AMMO_DATA_BORE_HEIGHT { idc=12003; - y="0.265*safezoneH+safezoneY+0.400"; + y="0.265*safeZoneH+safeZoneY+0.400"; text="C1 Coefficient"; }; class TEXT_GUN_AMMO_DATA_AIR_FRICTION_INPUT: TEXT_GUN_AMMO_DATA_BORE_HEIGHT_INPUT { idc=120030; - y="0.265*safezoneH+safezoneY+0.400"; + y="0.265*safeZoneH+safeZoneY+0.400"; }; class TEXT_GUN_AMMO_DATA_RIFLE_TWIST: TEXT_GUN_AMMO_DATA_BORE_HEIGHT { idc=12004; - y="0.265*safezoneH+safezoneY+0.440"; + y="0.265*safeZoneH+safeZoneY+0.440"; text="Rifle Twist (cm/trn)"; }; class TEXT_GUN_AMMO_DATA_RIFLE_TWIST_INPUT: TEXT_GUN_AMMO_DATA_BORE_HEIGHT_INPUT { idc=120040; - y="0.265*safezoneH+safezoneY+0.440"; + y="0.265*safeZoneH+safeZoneY+0.440"; }; class TEXT_GUN_AMMO_DATA_MUZZLE_VELOCITY: TEXT_GUN_AMMO_DATA_BORE_HEIGHT { idc=12005; - y="0.265*safezoneH+safezoneY+0.480"; + y="0.265*safeZoneH+safeZoneY+0.480"; text="Muzzle Velocity (m/s)"; }; class TEXT_GUN_AMMO_DATA_MUZZLE_VELOCITY_INPUT: TEXT_GUN_AMMO_DATA_BORE_HEIGHT_INPUT { idc=120050; - y="0.265*safezoneH+safezoneY+0.480"; + y="0.265*safeZoneH+safeZoneY+0.480"; }; class TEXT_GUN_AMMO_DATA_ZERO_RANGE: TEXT_GUN_AMMO_DATA_BORE_HEIGHT { idc=12006; - y="0.265*safezoneH+safezoneY+0.520"; + y="0.265*safeZoneH+safeZoneY+0.520"; text="Zero Range (meters)"; }; class TEXT_GUN_AMMO_DATA_ZERO_RANGE_INPUT: TEXT_GUN_AMMO_DATA_BORE_HEIGHT_INPUT { idc=120060; - y="0.265*safezoneH+safezoneY+0.520"; + y="0.265*safeZoneH+safeZoneY+0.520"; }; class TEXT_GUN_AMMO_DATA_ZERO_RANGE_METER_INDICATOR: TEXT_GUN_AMMO_DATA_BORE_HEIGHT { idc=120061; w="0.05"; - x="0.550*safezoneW+safezoneX+0.315"; - y="0.265*safezoneH+safezoneY+0.520"; + x="0.550*safeZoneW+safeZoneX+0.315"; + y="0.265*safeZoneH+safeZoneY+0.520"; text=""; }; class TEXT_GUN_AMMO_DATA_DONE: TEXT_TARGET_SPEED_ASSIST_DONE { @@ -1183,62 +1183,62 @@ class ATragMX_Display { class TEXT_ATMO_ENV_DATA_DEFAULT: TEXT_LEAD { idc=13000; w="0.08"; - x="0.550*safezoneW+safezoneX+0.15"; - y="0.265*safezoneH+safezoneY+0.320"; + x="0.550*safeZoneW+safeZoneX+0.15"; + y="0.265*safeZoneH+safeZoneY+0.320"; text="Default"; action=QUOTE(call FUNC(restore_atmo_default)); }; class TEXT_ATMO_ENV_DATA_AT: TEXT_TARGET_A { idc=13001; w="0.04"; - x="0.550*safezoneW+safezoneX+0.24"; - y="0.265*safezoneH+safezoneY+0.320"; + x="0.550*safeZoneW+safeZoneX+0.24"; + y="0.265*safeZoneH+safeZoneY+0.320"; text="AT"; action=QUOTE(GVAR(atmosphereModeTBH) = false; call FUNC(update_atmo_selection)); }; class TEXT_ATMO_ENV_DATA_TBH: TEXT_ATMO_ENV_DATA_AT { idc=13002; - x="0.550*safezoneW+safezoneX+0.28"; + x="0.550*safeZoneW+safeZoneX+0.28"; text="TBH"; action=QUOTE(GVAR(atmosphereModeTBH) = true; call FUNC(update_atmo_selection)); }; class TEXT_ATMO_ENV_DATA_ALTITUDE: TEXT_GUN_AMMO_DATA_BORE_HEIGHT { idc=13003; - x="0.550*safezoneW+safezoneX+0.115"; - y="0.265*safezoneH+safezoneY+0.400"; + x="0.550*safeZoneW+safeZoneX+0.115"; + y="0.265*safeZoneH+safeZoneY+0.400"; text="Altitude (ft)"; }; class TEXT_ATMO_ENV_DATA_ALTITUDE_INPUT: TEXT_GUN_AMMO_DATA_BORE_HEIGHT_INPUT { idc=130030; - x="0.550*safezoneW+safezoneX+0.330"; - y="0.265*safezoneH+safezoneY+0.400"; + x="0.550*safeZoneW+safeZoneX+0.330"; + y="0.265*safeZoneH+safeZoneY+0.400"; }; class TEXT_ATMO_ENV_DATA_TEMPERATURE: TEXT_ATMO_ENV_DATA_ALTITUDE { idc=13004; - y="0.265*safezoneH+safezoneY+0.440"; + y="0.265*safeZoneH+safeZoneY+0.440"; text="temperature (F)"; }; class TEXT_ATMO_ENV_DATA_TEMPERATURE_INPUT: TEXT_ATMO_ENV_DATA_ALTITUDE_INPUT { idc=130040; - y="0.265*safezoneH+safezoneY+0.440"; + y="0.265*safeZoneH+safeZoneY+0.440"; }; class TEXT_ATMO_ENV_DATA_BAROMETRIC_PRESSURE: TEXT_ATMO_ENV_DATA_ALTITUDE { idc=13005; - y="0.265*safezoneH+safezoneY+0.480"; + y="0.265*safeZoneH+safeZoneY+0.480"; text="Barom Pres (in.merc.)"; }; class TEXT_ATMO_ENV_DATA_BAROMETRIC_PRESSURE_INPUT: TEXT_ATMO_ENV_DATA_ALTITUDE_INPUT { idc=130050; - y="0.265*safezoneH+safezoneY+0.480"; + y="0.265*safeZoneH+safeZoneY+0.480"; }; class TEXT_ATMO_ENV_DATA_RELATIVE_HUMIDITY: TEXT_ATMO_ENV_DATA_ALTITUDE { idc=13006; - y="0.265*safezoneH+safezoneY+0.520"; + y="0.265*safeZoneH+safeZoneY+0.520"; text="Relative Humidity (%)"; }; class TEXT_ATMO_ENV_DATA_RELATIVE_HUMIDITY_INPUT: TEXT_ATMO_ENV_DATA_ALTITUDE_INPUT { idc=130060; - y="0.265*safezoneH+safezoneY+0.520"; + y="0.265*safeZoneH+safeZoneY+0.520"; }; class TEXT_ATMO_ENV_DATA_DONE: TEXT_TARGET_SPEED_ASSIST_DONE { idc=13007; @@ -1259,36 +1259,36 @@ class ATragMX_Display { style=64; w="0.14"; h="0.07"; - x="0.550*safezoneW+safezoneX+0.235"; - y="0.265*safezoneH+safezoneY+0.29"; + x="0.550*safeZoneW+safeZoneX+0.235"; + y="0.265*safeZoneH+safeZoneY+0.29"; text="Calc Method"; }; class TEXT_TARGET_DATA_LATITUDE: TEXT_BORE_HEIGHT { idc=14000; w="0.22"; - y="0.265*safezoneH+safezoneY+0.28"; + y="0.265*safeZoneH+safeZoneY+0.28"; text="Latitude"; }; class TEXT_TARGET_DATA_LATITUDE_INPUT: ATragMX_RscEdit { idc=140000; w="0.06"; - x="0.550*safezoneW+safezoneX+0.335"; - y="0.265*safezoneH+safezoneY+0.28"; + x="0.550*safeZoneW+safeZoneX+0.335"; + y="0.265*safeZoneH+safeZoneY+0.28"; }; class TEXT_TARGET_DATA_DIR_OF_FIRE: TEXT_TARGET_DATA_LATITUDE { idc=14001; - y="0.265*safezoneH+safezoneY+0.320"; + y="0.265*safeZoneH+safeZoneY+0.320"; text="Dir of Fire (deg from N)"; }; class TEXT_TARGET_DATA_DIR_OF_FIRE_INPUT: TEXT_TARGET_DATA_LATITUDE_INPUT { idc=140010; - y="0.265*safezoneH+safezoneY+0.320"; + y="0.265*safeZoneH+safeZoneY+0.320"; }; class TEXT_TARGET_DATA_WIND_SPEED: TEXT_TARGET_DATA_LATITUDE { idc=14002; w="1.2"; - y="0.265*safezoneH+safezoneY+0.360"; + y="0.265*safeZoneH+safeZoneY+0.360"; text="Wind Speed (m/s)"; }; class TEXT_TARGET_DATA_WIND_SPEED_1: TEXT_TARGET_DATA_LATITUDE { @@ -1297,40 +1297,40 @@ class ATragMX_Display { w="0.05"; h="0.03"; sizeEx="0.025"; - x="0.550*safezoneW+safezoneX+0.270"; - y="0.265*safezoneH+safezoneY+0.357"; + x="0.550*safeZoneW+safeZoneX+0.270"; + y="0.265*safeZoneH+safeZoneY+0.357"; text="1"; }; class TEXT_TARGET_DATA_WIND_SPEED_INPUT_1: TEXT_TARGET_DATA_LATITUDE_INPUT { idc=140020; w="0.045"; - x="0.550*safezoneW+safezoneX+0.290"; - y="0.265*safezoneH+safezoneY+0.360"; + x="0.550*safeZoneW+safeZoneX+0.290"; + y="0.265*safeZoneH+safeZoneY+0.360"; }; class TEXT_TARGET_DATA_WIND_SPEED_2: TEXT_TARGET_DATA_WIND_SPEED_1 { idc=141021; - x="0.550*safezoneW+safezoneX+0.330"; + x="0.550*safeZoneW+safeZoneX+0.330"; text="2"; }; class TEXT_TARGET_DATA_WIND_SPEED_INPUT_2: TEXT_TARGET_DATA_LATITUDE_INPUT { idc=140021; w="0.045"; - x="0.550*safezoneW+safezoneX+0.350"; - y="0.265*safezoneH+safezoneY+0.360"; + x="0.550*safeZoneW+safeZoneX+0.350"; + y="0.265*safeZoneH+safeZoneY+0.360"; }; class TEXT_TARGET_DATA_WIND_DIRECTION: TEXT_TARGET_DATA_LATITUDE { idc=14003; - y="0.265*safezoneH+safezoneY+0.400"; + y="0.265*safeZoneH+safeZoneY+0.400"; text="Wind Direction (clock)"; }; class TEXT_TARGET_DATA_WIND_DIRECTION_INPUT: TEXT_TARGET_DATA_LATITUDE_INPUT { idc=140030; - y="0.265*safezoneH+safezoneY+0.400"; + y="0.265*safeZoneH+safeZoneY+0.400"; }; class TEXT_TARGET_DATA_INCLINATION_ANGLE: TEXT_TARGET_DATA_LATITUDE { idc=14004; w="1.2"; - y="0.265*safezoneH+safezoneY+0.440"; + y="0.265*safeZoneH+safeZoneY+0.440"; text="Inclination Angle"; }; class TEXT_TARGET_DATA_INCLINATION_ANGLE_COSINE: TEXT_TARGET_DATA_LATITUDE { @@ -1339,62 +1339,62 @@ class ATragMX_Display { w="0.05"; h="0.03"; sizeEx="0.025"; - x="0.550*safezoneW+safezoneX+0.270"; - y="0.265*safezoneH+safezoneY+0.437"; + x="0.550*safeZoneW+safeZoneX+0.270"; + y="0.265*safeZoneH+safeZoneY+0.437"; text="c"; }; class TEXT_TARGET_DATA_INCLINATION_ANGLE_INPUT_COSINE: TEXT_TARGET_DATA_LATITUDE_INPUT { idc=140041; w="0.045"; - x="0.550*safezoneW+safezoneX+0.290"; - y="0.265*safezoneH+safezoneY+0.440"; + x="0.550*safeZoneW+safeZoneX+0.290"; + y="0.265*safeZoneH+safeZoneY+0.440"; onKeyUp=QUOTE(if (_this select 1 == 28) then {0 call FUNC(update_inclination_angle)}); }; class TEXT_TARGET_DATA_INCLINATION_ANGLE_DEGREE: TEXT_TARGET_DATA_INCLINATION_ANGLE_COSINE { idc=141040; - x="0.550*safezoneW+safezoneX+0.330"; + x="0.550*safeZoneW+safeZoneX+0.330"; text="d"; }; class TEXT_TARGET_DATA_INCLINATION_ANGLE_INPUT_DEGREE: TEXT_TARGET_DATA_LATITUDE_INPUT { idc=140040; w="0.045"; - x="0.550*safezoneW+safezoneX+0.350"; - y="0.265*safezoneH+safezoneY+0.440"; + x="0.550*safeZoneW+safeZoneX+0.350"; + y="0.265*safeZoneH+safeZoneY+0.440"; onKeyUp=QUOTE(if (_this select 1 == 28) then {1 call FUNC(update_inclination_angle)}); }; class TEXT_TARGET_DATA_TARGET_SPEED: TEXT_TARGET_DATA_LATITUDE { idc=14005; - y="0.265*safezoneH+safezoneY+0.480"; + y="0.265*safeZoneH+safeZoneY+0.480"; text="Target Speed (m/s)"; }; class TEXT_TARGET_DATA_TARGET_SPEED_INPUT: TEXT_TARGET_DATA_LATITUDE_INPUT { idc=140050; - y="0.265*safezoneH+safezoneY+0.480"; + y="0.265*safeZoneH+safeZoneY+0.480"; }; class TEXT_TARGET_DATA_TARGET_SPEED_DIRECTION: ATragMX_RscButton { idc=140051; colorBackground[]={0.15,0.21,0.23,0.3}; colorFocused[]={0.15,0.21,0.23,0.2}; w="0.0231"; - x="0.550*safezoneW+safezoneX+0.305"; - y="0.265*safezoneH+safezoneY+0.480"; + x="0.550*safeZoneW+safeZoneX+0.305"; + y="0.265*safeZoneH+safeZoneY+0.480"; text=">"; action=QUOTE(call FUNC(cycle_target_speed_direction)); }; class TEXT_TARGET_DATA_TARGET_RANGE: TEXT_TARGET_DATA_LATITUDE { idc=14006; - y="0.265*safezoneH+safezoneY+0.520"; + y="0.265*safeZoneH+safeZoneY+0.520"; text="Target Range (meters)"; }; class TEXT_TARGET_DATA_TARGET_RANGE_INPUT: TEXT_TARGET_DATA_LATITUDE_INPUT { idc=140060; - y="0.265*safezoneH+safezoneY+0.520"; + y="0.265*safeZoneH+safeZoneY+0.520"; }; class TEXT_TARGET_DATA_TARGET_RANGE_METER_INDICATOR: TEXT_TARGET_DATA_LATITUDE { idc=140061; w="0.05"; - x="0.550*safezoneW+safezoneX+0.315"; - y="0.265*safezoneH+safezoneY+0.520"; + x="0.550*safeZoneW+safeZoneX+0.315"; + y="0.265*safeZoneH+safeZoneY+0.520"; text=""; }; class TEXT_TARGET_DATA_DONE: TEXT_TARGET_SPEED_ASSIST_DONE { @@ -1417,45 +1417,45 @@ class ATragMX_Display { style=64; w="0.25"; h="0.07"; - x="0.550*safezoneW+safezoneX+0.13"; - y="0.265*safezoneH+safezoneY+0.32"; + x="0.550*safeZoneW+safeZoneX+0.13"; + y="0.265*safeZoneH+safeZoneY+0.32"; text="Show result in"; }; class TEXT_SOLUTION_SETUP_SHOW_RESULT_IN_1: TEXT_TARGET_A { idc=15001; w="0.04"; - x="0.550*safezoneW+safezoneX+0.14"; - y="0.265*safezoneH+safezoneY+0.35"; + x="0.550*safeZoneW+safeZoneX+0.14"; + y="0.265*safeZoneH+safeZoneY+0.35"; text="1"; action=QUOTE(GVAR(currentScopeClickNumberTemp) = 1; call FUNC(update_solution_setup)); }; class TEXT_SOLUTION_SETUP_SHOW_RESULT_IN_2: TEXT_SOLUTION_SETUP_SHOW_RESULT_IN_1 { idc=15002; - x="0.550*safezoneW+safezoneX+0.18"; + x="0.550*safeZoneW+safeZoneX+0.18"; text="2"; action=QUOTE(GVAR(currentScopeClickNumberTemp) = 2; call FUNC(update_solution_setup)); }; class TEXT_SOLUTION_SETUP_SHOW_RESULT_IN_3: TEXT_SOLUTION_SETUP_SHOW_RESULT_IN_1 { idc=15003; - x="0.550*safezoneW+safezoneX+0.22"; + x="0.550*safeZoneW+safeZoneX+0.22"; text="3"; action=QUOTE(GVAR(currentScopeClickNumberTemp) = 3; call FUNC(update_solution_setup)); }; class TEXT_SOLUTION_SETUP_SHOW_RESULT_IN_4: TEXT_SOLUTION_SETUP_SHOW_RESULT_IN_1 { idc=15004; - x="0.550*safezoneW+safezoneX+0.26"; + x="0.550*safeZoneW+safeZoneX+0.26"; text="4"; action=QUOTE(GVAR(currentScopeClickNumberTemp) = 4; call FUNC(update_solution_setup)); }; class TEXT_SOLUTION_SETUP_SHOW_RESULT_IN_8: TEXT_SOLUTION_SETUP_SHOW_RESULT_IN_1 { idc=15005; - x="0.550*safezoneW+safezoneX+0.30"; + x="0.550*safeZoneW+safeZoneX+0.30"; text="8"; action=QUOTE(GVAR(currentScopeClickNumberTemp) = 8; call FUNC(update_solution_setup)); }; class TEXT_SOLUTION_SETUP_SHOW_RESULT_IN_10: TEXT_SOLUTION_SETUP_SHOW_RESULT_IN_1 { idc=15006; - x="0.550*safezoneW+safezoneX+0.34"; + x="0.550*safeZoneW+safeZoneX+0.34"; text="10"; action=QUOTE(GVAR(currentScopeClickNumberTemp) = 10; call FUNC(update_solution_setup)); }; @@ -1464,53 +1464,53 @@ class ATragMX_Display { style=64; w="0.25"; h="0.07"; - x="0.550*safezoneW+safezoneX+0.13"; - y="0.265*safezoneH+safezoneY+0.42"; + x="0.550*safeZoneW+safeZoneX+0.13"; + y="0.265*safeZoneH+safeZoneY+0.42"; text="Clicks per"; }; class TEXT_SOLUTION_SETUP_CLICKS_PER_TMOA: TEXT_TARGET_A { idc=15008; w="0.05"; - x="0.550*safezoneW+safezoneX+0.15"; - y="0.265*safezoneH+safezoneY+0.45"; + x="0.550*safeZoneW+safeZoneX+0.15"; + y="0.265*safeZoneH+safeZoneY+0.45"; text="TMOA"; action=QUOTE(GVAR(currentScopeClickUnitTemp) = 0; call FUNC(update_solution_setup)); }; class TEXT_SOLUTION_SETUP_CLICKS_PER_SMOA: TEXT_SOLUTION_SETUP_CLICKS_PER_TMOA { idc=15009; - x="0.550*safezoneW+safezoneX+0.23"; + x="0.550*safeZoneW+safeZoneX+0.23"; text="SMOA"; action=QUOTE(GVAR(currentScopeClickUnitTemp) = 1; call FUNC(update_solution_setup)); }; class TEXT_SOLUTION_SETUP_CLICKS_PER_MILS: TEXT_SOLUTION_SETUP_CLICKS_PER_TMOA { idc=15010; - x="0.550*safezoneW+safezoneX+0.31"; + x="0.550*safeZoneW+safeZoneX+0.31"; text="MILS"; action=QUOTE(GVAR(currentScopeClickUnitTemp) = 2; call FUNC(update_solution_setup)); }; class TEXT_SOLUTION_SETUP_DONE: TEXT_TARGET_SPEED_ASSIST_DONE { idc=15011; - x="0.550*safezoneW+safezoneX+0.18"; - y="0.265*safezoneH+safezoneY+0.55"; + x="0.550*safeZoneW+safeZoneX+0.18"; + y="0.265*safeZoneH+safeZoneY+0.55"; action=QUOTE(1 call FUNC(toggle_solution_setup)); }; class TEXT_SOLUTION_SETUP_CANCEL: TEXT_TARGET_SPEED_ASSIST_CANCEL { idc=15012; - x="0.550*safezoneW+safezoneX+0.26"; - y="0.265*safezoneH+safezoneY+0.55"; + x="0.550*safeZoneW+safeZoneX+0.26"; + y="0.265*safeZoneH+safeZoneY+0.55"; action=QUOTE(0 call FUNC(toggle_solution_setup)); }; class TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE: TEXT_BORE_HEIGHT { idc=16000; w="0.22"; - y="0.265*safezoneH+safezoneY+0.25"; + y="0.265*safeZoneH+safeZoneY+0.25"; sizeEx="0.022"; text="Temperature"; }; class TEXT_MUZZLE_VELOCITY_DATA_MUZZLE_VELOCITY: TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE { idc=16001; - x="0.550*safezoneW+safezoneX+0.215"; + x="0.550*safeZoneW+safeZoneX+0.215"; sizeEx="0.022"; text="Muzzle velocity"; }; @@ -1518,73 +1518,73 @@ class ATragMX_Display { idc=160021; w="0.082"; h="0.035"; - x="0.550*safezoneW+safezoneX+0.128"; - y="0.265*safezoneH+safezoneY+0.29"; + x="0.550*safeZoneW+safeZoneX+0.128"; + y="0.265*safeZoneH+safeZoneY+0.29"; text="0"; }; class TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_2: TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_1 { idc=160022; - y="0.265*safezoneH+safezoneY+0.325"; + y="0.265*safeZoneH+safeZoneY+0.325"; }; class TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_3: TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_1 { idc=160023; - y="0.265*safezoneH+safezoneY+0.360"; + y="0.265*safeZoneH+safeZoneY+0.360"; }; class TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_4: TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_1 { idc=160024; - y="0.265*safezoneH+safezoneY+0.395"; + y="0.265*safeZoneH+safeZoneY+0.395"; }; class TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_5: TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_1 { idc=160025; - y="0.265*safezoneH+safezoneY+0.430"; + y="0.265*safeZoneH+safeZoneY+0.430"; }; class TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_6: TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_1 { idc=160026; - y="0.265*safezoneH+safezoneY+0.465"; + y="0.265*safeZoneH+safeZoneY+0.465"; }; class TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_7: TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_1 { idc=160027; - y="0.265*safezoneH+safezoneY+0.500"; + y="0.265*safeZoneH+safeZoneY+0.500"; }; class TEXT_MUZZLE_VELOCITY_DATA_MUZZLE_VELOCITY_INPUT_1: TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_1 { idc=160031; - x="0.550*safezoneW+safezoneX+0.225"; + x="0.550*safeZoneW+safeZoneX+0.225"; }; class TEXT_MUZZLE_VELOCITY_DATA_MUZZLE_VELOCITY_INPUT_2: TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_2 { idc=160032; - x="0.550*safezoneW+safezoneX+0.225"; + x="0.550*safeZoneW+safeZoneX+0.225"; }; class TEXT_MUZZLE_VELOCITY_DATA_MUZZLE_VELOCITY_INPUT_3: TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_3 { idc=160033; - x="0.550*safezoneW+safezoneX+0.225"; + x="0.550*safeZoneW+safeZoneX+0.225"; }; class TEXT_MUZZLE_VELOCITY_DATA_MUZZLE_VELOCITY_INPUT_4: TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_4 { idc=160034; - x="0.550*safezoneW+safezoneX+0.225"; + x="0.550*safeZoneW+safeZoneX+0.225"; }; class TEXT_MUZZLE_VELOCITY_DATA_MUZZLE_VELOCITY_INPUT_5: TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_5 { idc=160035; - x="0.550*safezoneW+safezoneX+0.225"; + x="0.550*safeZoneW+safeZoneX+0.225"; }; class TEXT_MUZZLE_VELOCITY_DATA_MUZZLE_VELOCITY_INPUT_6: TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_6 { idc=160036; - x="0.550*safezoneW+safezoneX+0.225"; + x="0.550*safeZoneW+safeZoneX+0.225"; }; class TEXT_MUZZLE_VELOCITY_DATA_MUZZLE_VELOCITY_INPUT_7: TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_7 { idc=160037; - x="0.550*safezoneW+safezoneX+0.225"; + x="0.550*safeZoneW+safeZoneX+0.225"; }; class TEXT_MUZZLE_VELOCITY_DATA_CLEAR: TEXT_TARGET_DATA_NEXT { idc=16004; style=ST_CENTER; h="0.035"; - y="0.265*safezoneH+safezoneY+0.3625"; + y="0.265*safeZoneH+safeZoneY+0.3625"; text="Clear"; action=QUOTE(call FUNC(clear_muzzle_velocity_data)); }; class TEXT_MUZZLE_VELOCITY_DATA_QUESTIONMARK: TEXT_MUZZLE_VELOCITY_DATA_CLEAR { idc=16005; - y="0.265*safezoneH+safezoneY+0.430"; + y="0.265*safeZoneH+safeZoneY+0.430"; text="?"; action=""; }; @@ -1606,14 +1606,14 @@ class ATragMX_Display { class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE: TEXT_BORE_HEIGHT { idc=17000; w="0.22"; - x="0.550*safezoneW+safezoneX+0.15"; - y="0.265*safezoneH+safezoneY+0.25"; + x="0.550*safeZoneW+safeZoneX+0.15"; + y="0.265*safeZoneH+safeZoneY+0.25"; sizeEx="0.022"; text="Meters"; }; class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_C1_BALLISTIC_COEFFICIENT: TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE { idc=17001; - x="0.550*safezoneW+safezoneX+0.235"; + x="0.550*safeZoneW+safeZoneX+0.235"; sizeEx="0.022"; text="BC-Coef"; }; @@ -1621,75 +1621,75 @@ class ATragMX_Display { idc=170021; w="0.082"; h="0.035"; - x="0.550*safezoneW+safezoneX+0.128"; - y="0.265*safezoneH+safezoneY+0.29"; + x="0.550*safeZoneW+safeZoneX+0.128"; + y="0.265*safeZoneH+safeZoneY+0.29"; text="0"; }; class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_2: TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_1 { idc=170022; - y="0.265*safezoneH+safezoneY+0.325"; + y="0.265*safeZoneH+safeZoneY+0.325"; }; class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_3: TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_1 { idc=170023; - y="0.265*safezoneH+safezoneY+0.360"; + y="0.265*safeZoneH+safeZoneY+0.360"; }; class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_4: TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_1 { idc=170024; - y="0.265*safezoneH+safezoneY+0.395"; + y="0.265*safeZoneH+safeZoneY+0.395"; }; class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_5: TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_1 { idc=170025; - y="0.265*safezoneH+safezoneY+0.430"; + y="0.265*safeZoneH+safeZoneY+0.430"; }; class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_6: TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_1 { idc=170026; - y="0.265*safezoneH+safezoneY+0.465"; + y="0.265*safeZoneH+safeZoneY+0.465"; }; class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_7: TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_1 { idc=170027; - y="0.265*safezoneH+safezoneY+0.500"; + y="0.265*safeZoneH+safeZoneY+0.500"; }; class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_C1_BALLISTIC_COEFFICIENT_INPUT_1: TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_1 { idc=170031; - x="0.550*safezoneW+safezoneX+0.225"; + x="0.550*safeZoneW+safeZoneX+0.225"; }; class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_C1_BALLISTIC_COEFFICIENT_INPUT_2: TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_2 { idc=170032; - x="0.550*safezoneW+safezoneX+0.225"; + x="0.550*safeZoneW+safeZoneX+0.225"; }; class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_C1_BALLISTIC_COEFFICIENT_INPUT_3: TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_3 { idc=170033; - x="0.550*safezoneW+safezoneX+0.225"; + x="0.550*safeZoneW+safeZoneX+0.225"; }; class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_C1_BALLISTIC_COEFFICIENT_INPUT_4: TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_4 { idc=170034; - x="0.550*safezoneW+safezoneX+0.225"; + x="0.550*safeZoneW+safeZoneX+0.225"; }; class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_C1_BALLISTIC_COEFFICIENT_INPUT_5: TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_5 { idc=170035; - x="0.550*safezoneW+safezoneX+0.225"; + x="0.550*safeZoneW+safeZoneX+0.225"; }; class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_C1_BALLISTIC_COEFFICIENT_INPUT_6: TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_6 { idc=170036; - x="0.550*safezoneW+safezoneX+0.225"; + x="0.550*safeZoneW+safeZoneX+0.225"; }; class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_C1_BALLISTIC_COEFFICIENT_INPUT_7: TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_7 { idc=170037; - x="0.550*safezoneW+safezoneX+0.225"; + x="0.550*safeZoneW+safeZoneX+0.225"; }; class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_QUESTIONMARK: TEXT_TARGET_DATA_NEXT { idc=17004; style=ST_CENTER; w="0.04"; h="0.035"; - y="0.265*safezoneH+safezoneY+0.35"; + y="0.265*safeZoneH+safeZoneY+0.35"; text="?"; action=""; }; class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_CLEAR: TEXT_C1_BALLISTIC_COEFFICIENT_DATA_QUESTIONMARK { idc=17005; w="0.07"; - y="0.265*safezoneH+safezoneY+0.4175"; + y="0.265*safeZoneH+safeZoneY+0.4175"; text="Clear"; action=QUOTE(call FUNC(clear_c1_ballistic_coefficient_data)); }; @@ -1711,8 +1711,8 @@ class ATragMX_Display { class TEXT_TRUING_DROP_ZERO_RANGE: ATragMX_RscText { idc=18000; style=ST_LEFT; - x="0.550*safezoneW+safezoneX+0.115"; - y="0.265*safezoneH+safezoneY+0.220"; + x="0.550*safeZoneW+safeZoneX+0.115"; + y="0.265*safeZoneH+safeZoneY+0.220"; w="0.135"; h="0.03"; sizeEx="0.025"; @@ -1721,29 +1721,29 @@ class ATragMX_Display { class TEXT_TRUING_DROP_DROP_UNIT: TEXT_TRUING_DROP_ZERO_RANGE { idc=18001; style=ST_LEFT; - x="0.550*safezoneW+safezoneX+0.25"; + x="0.550*safeZoneW+safeZoneX+0.25"; text="Drop=mil"; }; class TEXT_TRUING_DROP_TARGET_RANGE: TEXT_TRUING_DROP_ZERO_RANGE { idc=18002; - y="0.265*safezoneH+safezoneY+0.35"; + y="0.265*safeZoneH+safeZoneY+0.35"; sizeEx="0.027"; text="Target Range"; }; class TEXT_TRUING_DROP_DROP: TEXT_TRUING_DROP_TARGET_RANGE { idc=18003; w="0.07"; - y="0.265*safezoneH+safezoneY+0.40"; + y="0.265*safeZoneH+safeZoneY+0.40"; text="Drop"; }; class TEXT_TRUING_DROP_MUZZLE_VELOCITY: TEXT_TRUING_DROP_DROP { idc=18004; - y="0.265*safezoneH+safezoneY+0.50"; + y="0.265*safeZoneH+safeZoneY+0.50"; text="MV"; }; class TEXT_TRUING_DROP_C1_BALLISTIC_COEFFICIENT: TEXT_TRUING_DROP_DROP { idc=18005; - y="0.265*safezoneH+safezoneY+0.55"; + y="0.265*safeZoneH+safeZoneY+0.55"; text="C1"; }; class TEXT_TRUING_DROP_DROP_OUTPUT: ATragMX_RscEdit { @@ -1752,31 +1752,31 @@ class ATragMX_Display { colorBackground[]={0.15,0.21,0.23,0.3}; colorDisabled[]={0,0,0,1}; w="0.06"; - y="0.265*safezoneH+safezoneY+0.40"; - x="0.550*safezoneW+safezoneX+0.17"; + y="0.265*safeZoneH+safeZoneY+0.40"; + x="0.550*safeZoneW+safeZoneX+0.17"; text=""; }; class TEXT_TRUING_DROP_MUZZLE_VELOCITY_OUTPUT: TEXT_TRUING_DROP_DROP_OUTPUT { idc=18007; - y="0.265*safezoneH+safezoneY+0.50"; + y="0.265*safeZoneH+safeZoneY+0.50"; text=""; }; class TEXT_TRUING_DROP_C1_BALLISTIC_COEFFICIENT_OUTPUT: TEXT_TRUING_DROP_DROP_OUTPUT { idc=18008; - y="0.265*safezoneH+safezoneY+0.55"; + y="0.265*safeZoneH+safeZoneY+0.55"; text=""; }; class TEXT_TRUING_DROP_SUPER: TEXT_TARGET_A { idc=18009; w="0.06"; - x="0.550*safezoneW+safezoneX+0.25"; - y="0.265*safezoneH+safezoneY+0.30"; + x="0.550*safeZoneW+safeZoneX+0.25"; + y="0.265*safeZoneH+safeZoneY+0.30"; text="SUPER"; action=QUOTE(GVAR(truingDropMode) = 0; call FUNC(update_truing_drop_selection)); }; class TEXT_TRUING_DROP_SUB: TEXT_TRUING_DROP_SUPER { idc=18010; - x="0.550*safezoneW+safezoneX+0.32"; + x="0.550*safeZoneW+safeZoneX+0.32"; text="SUB"; action=QUOTE(GVAR(truingDropMode) = 1; call FUNC(update_truing_drop_selection)); }; @@ -1785,56 +1785,56 @@ class ATragMX_Display { style=QUOTE(ST_WITH_RECT+ST_RIGHT); colorDisabled[]={0,0,0,0.6}; w="0.06"; - x="0.550*safezoneW+safezoneX+0.25"; - y="0.265*safezoneH+safezoneY+0.35"; + x="0.550*safeZoneW+safeZoneX+0.25"; + y="0.265*safeZoneH+safeZoneY+0.35"; }; class TEXT_TRUING_DROP_TARGET_RANGE_SUB_INPUT: TEXT_TRUING_DROP_TARGET_RANGE_SUPER_INPUT { idc=18012; - x="0.550*safezoneW+safezoneX+0.32"; + x="0.550*safeZoneW+safeZoneX+0.32"; }; class TEXT_TRUING_DROP_DROP_SUPER_INPUT: TEXT_TRUING_DROP_TARGET_RANGE_SUPER_INPUT { idc=18013; - y="0.265*safezoneH+safezoneY+0.40"; + y="0.265*safeZoneH+safeZoneY+0.40"; }; class TEXT_TRUING_DROP_DROP_SUB_INPUT: TEXT_TRUING_DROP_TARGET_RANGE_SUB_INPUT { idc=18014; - y="0.265*safezoneH+safezoneY+0.40"; + y="0.265*safeZoneH+safeZoneY+0.40"; }; class TEXT_TRUING_DROP_CALC: TEXT_GUN_LIST { idc=18015; style=ST_CENTER; w="0.11"; - x="0.550*safezoneW+safezoneX+0.26"; - y="0.265*safezoneH+safezoneY+0.45"; + x="0.550*safeZoneW+safeZoneX+0.26"; + y="0.265*safeZoneH+safeZoneY+0.45"; text="Calc"; action=QUOTE(true call FUNC(calculate_truing_drop)); }; class TEXT_TRUING_DROP_MV_INPUT: TEXT_TRUING_DROP_TARGET_RANGE_SUPER_INPUT { idc=18016; - y="0.265*safezoneH+safezoneY+0.50"; + y="0.265*safeZoneH+safeZoneY+0.50"; }; class TEXT_TRUING_DROP_C1_BALLISTIC_COEFFICIENT_INPUT: TEXT_TRUING_DROP_TARGET_RANGE_SUB_INPUT { idc=18017; - y="0.265*safezoneH+safezoneY+0.55"; + y="0.265*safeZoneH+safeZoneY+0.55"; }; class TEXT_TRUING_DROP_ACCEPT: TEXT_GUN_LIST { idc=18018; w="0.085"; h="0.04"; - x="0.550*safezoneW+safezoneX+0.125"; - y="0.265*safezoneH+safezoneY+0.60"; + x="0.550*safeZoneW+safeZoneX+0.125"; + y="0.265*safeZoneH+safeZoneY+0.60"; text="Accept"; action=QUOTE(1 call FUNC(toggle_truing_drop)); }; class TEXT_TRUING_DROP_CANCEL: TEXT_TRUING_DROP_ACCEPT { idc=18019; - x="0.550*safezoneW+safezoneX+0.210"; + x="0.550*safeZoneW+safeZoneX+0.210"; text="Cancel"; action=QUOTE(0 call FUNC(toggle_truing_drop)); }; class TEXT_TRUING_DROP_RESTORE: TEXT_TRUING_DROP_CANCEL { idc=18020; - x="0.550*safezoneW+safezoneX+0.29525"; + x="0.550*safeZoneW+safeZoneX+0.29525"; text="Restore"; action=QUOTE(true call FUNC(restore_truing_drop)); }; diff --git a/addons/atragmx/config.cpp b/addons/atragmx/config.cpp index 125d4a488e0..9b02aba4919 100644 --- a/addons/atragmx/config.cpp +++ b/addons/atragmx/config.cpp @@ -6,7 +6,7 @@ class CfgPatches { units[] = {"ACE_Item_ATragMX"}; weapons[] = {"ACE_ATragMX"}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"ACE_Advanced_Ballistics", "ACE_common", "ACE_weather"}; + requiredAddons[] = {"ace_advanced_ballistics", "ace_common", "ace_weather"}; author = ECSTRING(common,ACETeam); authors[] = {"Ruthberg"}; url = ECSTRING(main,URL); diff --git a/addons/atragmx/functions/fnc_calculate_distance_at_velocity.sqf b/addons/atragmx/functions/fnc_calculate_distance_at_velocity.sqf index 9fe18a258d6..e667d22e75e 100644 --- a/addons/atragmx/functions/fnc_calculate_distance_at_velocity.sqf +++ b/addons/atragmx/functions/fnc_calculate_distance_at_velocity.sqf @@ -30,9 +30,16 @@ while {_velocity > _thresholdVelocity} do { private _bc = GVAR(targetSolutionInput) select 14; private _dragModel = GVAR(targetSolutionInput) select 15; private _temperature = GVAR(targetSolutionInput) select 5; - private _drag = parseNumber(("ace_advanced_ballistics" callExtension format["retard:%1:%2:%3:%4", _dragModel, _bc, _velocity, _temperature])); _distance = _distance + _velocity * __DELTA_T; - _velocity = _velocity - (_drag * __DELTA_T); + private _data = ( + "ace" callExtension ["ballistics:retard", [ + _dragModel, + _bc, + _velocity, + _temperature + ]] + ) select 0; + _velocity = _velocity - ((parseNumber _data) * __DELTA_T); }; _distance diff --git a/addons/atragmx/functions/fnc_calculate_solution.sqf b/addons/atragmx/functions/fnc_calculate_solution.sqf index 7efc25ebbf4..e910017f2fc 100644 --- a/addons/atragmx/functions/fnc_calculate_solution.sqf +++ b/addons/atragmx/functions/fnc_calculate_solution.sqf @@ -90,7 +90,14 @@ private _wind1 = [cos(270 - _windDirection * 30) * _windSpeed1, sin(270 - _windD private _wind2 = [cos(270 - _windDirection * 30) * _windSpeed2, sin(270 - _windDirection * 30) * _windSpeed2, 0]; private _windDrift = 0; if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { - _bc = parseNumber(("ace_advanced_ballistics" callExtension format["atmosphericCorrection:%1:%2:%3:%4:%5", _bc, _temperature, _barometricPressure, _relativeHumidity, _atmosphereModel])); + _bc = parseNumber (("ace" callExtension ["ballistics:atmospheric_correction", [ + _bc, + _temperature, + _barometricPressure, + _relativeHumidity, + _atmosphereModel + ]] + ) select 0); }; private _eoetvoesMultiplier = 0; @@ -103,8 +110,8 @@ _bulletPos set [1, 0]; _bulletPos set [2, -(_boreHeight / 100)]; _bulletVelocity set [0, 0]; -_bulletVelocity set [1, Cos(_scopeBaseAngle) * _muzzleVelocity]; -_bulletVelocity set [2, Sin(_scopeBaseAngle) * _muzzleVelocity]; +_bulletVelocity set [1, cos(_scopeBaseAngle) * _muzzleVelocity]; +_bulletVelocity set [2, sin(_scopeBaseAngle) * _muzzleVelocity]; while {_TOF < 15 && (_bulletPos select 1) < _targetRange} do { _bulletSpeed = vectorMagnitude _bulletVelocity; @@ -113,8 +120,15 @@ while {_TOF < 15 && (_bulletPos select 1) < _targetRange} do { _trueSpeed = vectorMagnitude _trueVelocity; if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { - private _drag = parseNumber(("ace_advanced_ballistics" callExtension format["retard:%1:%2:%3:%4", _dragModel, _bc, _trueSpeed, _temperature])); - _bulletAccel = (vectorNormalized _trueVelocity) vectorMultiply (-1 * _drag); + private _data = ( + "ace" callExtension ["ballistics:retard", [ + _dragModel, + _bc, + _trueSpeed, + _temperature + ]] + ) select 0; + _bulletAccel = (vectorNormalized _trueVelocity) vectorMultiply (-1 * (parseNumber _data)); } else { _bulletAccel = _trueVelocity vectorMultiply (_trueSpeed * _airFriction); }; @@ -139,9 +153,9 @@ while {_TOF < 15 && (_bulletPos select 1) < _targetRange} do { _windage1 = - atan(_tx / _trueRange); _windDrift = (_wind2 select 0) * (_TOF - _trueRange / _muzzleVelocity); _windage2 = - atan(_windDrift / _trueRange); - _lead = (_targetSpeed * _TOF) / (Tan(MRAD_TO_DEG(1)) * _trueRange); + _lead = (_targetSpeed * _TOF) / (tan(MRAD_TO_DEG(1)) * _trueRange); }; - _kineticEnergy = 0.5 * (_bulletMass / 1000 * (_bulletSpeed ^ 2)); + private _kineticEnergy = 0.5 * (_bulletMass / 1000 * (_bulletSpeed ^ 2)); _kineticEnergy = _kineticEnergy * 0.737562149; if ((missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) && (_bulletPos select 1) > 0) then { @@ -174,10 +188,10 @@ if (_targetRange != 0) then { _windage1 = - atan(_tx / _targetRange); _windDrift = (_wind2 select 0) * (_TOF - _targetRange / _muzzleVelocity); _windage2 = - atan(_windDrift / _targetRange); - _lead = (_targetSpeed * _TOF) / (Tan(MRAD_TO_DEG(1)) * _targetRange); + _lead = (_targetSpeed * _TOF) / (tan(MRAD_TO_DEG(1)) * _targetRange); }; -_kineticEnergy = 0.5 * (_bulletMass / 1000 * (_bulletSpeed ^ 2)); +private _kineticEnergy = 0.5 * (_bulletMass / 1000 * (_bulletSpeed ^ 2)); _kineticEnergy = _kineticEnergy * 0.737562149; if ((missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) && (_bulletPos select 1) > 0) then { diff --git a/addons/atragmx/functions/fnc_calculate_target_range_assist.sqf b/addons/atragmx/functions/fnc_calculate_target_range_assist.sqf index dc9c62c3fc5..5ad543ccc94 100644 --- a/addons/atragmx/functions/fnc_calculate_target_range_assist.sqf +++ b/addons/atragmx/functions/fnc_calculate_target_range_assist.sqf @@ -68,7 +68,7 @@ switch (_this) do { }; }; - ctrlSetText [7010, Str(Round(_targetSize * 100) / 100)]; + ctrlSetText [7010, str(round(_targetSize * 100) / 100)]; }; case 1: { if (_estRange > 0) then { @@ -87,13 +87,13 @@ switch (_this) do { }; }; - ctrlSetText [7011, Str(Round(_imageSize * 100) / 100)]; + ctrlSetText [7011, str(round(_imageSize * 100) / 100)]; }; case 2: { if (tan(_imageSize) != 0) then { _estRange = _targetSize / tan(_imageSize); }; - ctrlSetText [7013, Str(Round(_estRange))]; + ctrlSetText [7013, str(round(_estRange))]; }; }; diff --git a/addons/atragmx/functions/fnc_calculate_target_speed_assist.sqf b/addons/atragmx/functions/fnc_calculate_target_speed_assist.sqf index 69af9eba165..25106c794e9 100644 --- a/addons/atragmx/functions/fnc_calculate_target_speed_assist.sqf +++ b/addons/atragmx/functions/fnc_calculate_target_speed_assist.sqf @@ -44,4 +44,4 @@ if (GVAR(currentUnit) != 2) then { _estSpeed = _estSpeed * 2.23693629; }; -ctrlSetText [8007, Str(Round(_estSpeed * 10) / 10)]; +ctrlSetText [8007, str(round(_estSpeed * 10) / 10)]; diff --git a/addons/atragmx/functions/fnc_calculate_truing_drop.sqf b/addons/atragmx/functions/fnc_calculate_truing_drop.sqf index 5191848d050..5f7adee2838 100644 --- a/addons/atragmx/functions/fnc_calculate_truing_drop.sqf +++ b/addons/atragmx/functions/fnc_calculate_truing_drop.sqf @@ -29,8 +29,8 @@ if (_parseInput) then { _transonicRange = _transonicRange * 0.9144; _subsonicRange = _subsonicRange * 0.9144; }; - _transonicRange = Round(_transonicRange); - _subsonicRange = Round(_subsonicRange); + _transonicRange = round(_transonicRange); + _subsonicRange = round(_subsonicRange); _subsonicRange = _transonicRange max _subsonicRange; @@ -54,8 +54,8 @@ if (_parseInput) then { _subsonicDrop = _subsonicDrop / 1.047; }; }; - _transonicDrop = Round(_transonicDrop * 100) / 100; - _subsonicDrop = Round(_subsonicDrop * 100) / 100; + _transonicDrop = round(_transonicDrop * 100) / 100; + _subsonicDrop = round(_subsonicDrop * 100) / 100; _subsonicDrop = _transonicDrop max _subsonicDrop; }; @@ -67,11 +67,11 @@ if ((GVAR(truingDropDropData) select 0) == 0 || {[_transonicRange, _subsonicRang private _solutionInput = +GVAR(targetSolutionInput); if (_transonicRange == 0) then { - _transonicRange = Round(403 call FUNC(calculate_distance_at_velocity)); + _transonicRange = round(403 call FUNC(calculate_distance_at_velocity)); }; _solutionInput set [13, _transonicRange]; private _result1 = _solutionInput call FUNC(calculate_solution); - _transonicDrop = Round((_result1 select 0) * 100) / 100; + _transonicDrop = round((_result1 select 0) * 100) / 100; GVAR(truingDropRangeData) set [0, _transonicRange]; GVAR(truingDropDropData) set [1, _transonicDrop]; GVAR(truingDropReferenceDropData) set [0, _transonicDrop]; @@ -84,11 +84,11 @@ if ((GVAR(truingDropDropData) select 0) == 0 || {[_transonicRange, _subsonicRang } else { _subsonicRange = _subsonicRange + 200 * 1.0936133; }; - _subsonicRange = Round(_subsonicRange); + _subsonicRange = round(_subsonicRange); }; _solutionInput set [13, _subsonicRange]; private _result2 = _solutionInput call FUNC(calculate_solution); - _subsonicDrop = Round((_result2 select 0) * 100) / 100; + _subsonicDrop = round((_result2 select 0) * 100) / 100; GVAR(truingDropRangeData) set [1, _subsonicRange]; GVAR(truingDropDropData) set [2, _subsonicDrop]; GVAR(truingDropReferenceDropData) set [1, _subsonicDrop]; diff --git a/addons/atragmx/functions/fnc_parse_input.sqf b/addons/atragmx/functions/fnc_parse_input.sqf index 1c3ea3398a5..4f62f301160 100644 --- a/addons/atragmx/functions/fnc_parse_input.sqf +++ b/addons/atragmx/functions/fnc_parse_input.sqf @@ -100,11 +100,11 @@ if (GVAR(currentUnit) == 1) then { _targetRange = 25 max _targetRange min 3700; }; GVAR(targetRangeDirtyFlag) = GVAR(targetRangeDirtyFlag) || {_targetRange != GVAR(targetRange) select GVAR(currentTarget)}; -GVAR(latitude) set [GVAR(currentTarget), -90 max Round(parseNumber(ctrlText 140000)) min 90]; -GVAR(directionOfFire) set [GVAR(currentTarget), 0 max abs(Round(parseNumber(ctrlText 140010))) min 359]; +GVAR(latitude) set [GVAR(currentTarget), -90 max round(parseNumber(ctrlText 140000)) min 90]; +GVAR(directionOfFire) set [GVAR(currentTarget), 0 max abs(round(parseNumber(ctrlText 140010))) min 359]; GVAR(windSpeed1) set [GVAR(currentTarget), _windSpeed1]; GVAR(windSpeed2) set [GVAR(currentTarget), _windSpeed2]; -GVAR(windDirection) set [GVAR(currentTarget), 1 max Round(parseNumber(ctrlText 140030)) min 12]; +GVAR(windDirection) set [GVAR(currentTarget), 1 max round(parseNumber(ctrlText 140030)) min 12]; GVAR(targetSpeed) set [GVAR(currentTarget), _targetSpeed]; GVAR(targetRange) set [GVAR(currentTarget), _targetRange]; private _inclinationAngleCosine = 0.5 max parseNumber(ctrlText 140041) min 1; @@ -112,7 +112,7 @@ private _inclinationAngleDegree = -60 max round(parseNumber(ctrlText 140040)) mi if (_inclinationAngleDegree != GVAR(inclinationAngle) select GVAR(currentTarget)) then { GVAR(inclinationAngle) set [GVAR(currentTarget), _inclinationAngleDegree]; } else { - if (_inclinationAngleCosine != Round(cos(GVAR(inclinationAngle) select GVAR(currentTarget)) * 100) / 100) then { + if (_inclinationAngleCosine != round(cos(GVAR(inclinationAngle) select GVAR(currentTarget)) * 100) / 100) then { GVAR(inclinationAngle) set [GVAR(currentTarget), round(acos(_inclinationAngleCosine))]; }; }; diff --git a/addons/atragmx/functions/fnc_recalculate_muzzle_velocity.sqf b/addons/atragmx/functions/fnc_recalculate_muzzle_velocity.sqf index f7e4709cc11..0d5c83ae01c 100644 --- a/addons/atragmx/functions/fnc_recalculate_muzzle_velocity.sqf +++ b/addons/atragmx/functions/fnc_recalculate_muzzle_velocity.sqf @@ -45,7 +45,7 @@ for "_index" from 1 to (_lookupTableSize - 1) do { (_lookupTable select _lowerIndex) params ["_lowerDistance", "_lowerMuzzleVelocity"]; (_lookupTable select _upperIndex) params ["_upperDistance", "_upperMuzzleVelocity"]; -_muzzleVelocity = 100 max (linearConversion [_lowerDistance, _upperDistance, GVAR(temperature), _lowerMuzzleVelocity, _upperMuzzleVelocity]) min 1400; +private _muzzleVelocity = 100 max (linearConversion [_lowerDistance, _upperDistance, GVAR(temperature), _lowerMuzzleVelocity, _upperMuzzleVelocity]) min 1400; if (_muzzleVelocity != GVAR(workingMemory) select 1) then { GVAR(workingMemory) set [1, _muzzleVelocity]; diff --git a/addons/atragmx/functions/fnc_show_range_card_setup.sqf b/addons/atragmx/functions/fnc_show_range_card_setup.sqf index 15558ceb983..a4301f5b761 100644 --- a/addons/atragmx/functions/fnc_show_range_card_setup.sqf +++ b/addons/atragmx/functions/fnc_show_range_card_setup.sqf @@ -22,7 +22,7 @@ GVAR(showRangeCardSetup) = _this; if (_this) then { ctrlSetFocus ((uiNamespace getVariable "ATragMX_Display") displayCtrl 10006); - ctrlSetText [10003, Str(Round(GVAR(rangeCardStartRange)))]; - ctrlSetText [10004, Str(Round(GVAR(rangeCardEndRange)))]; - ctrlSetText [10005, Str(Round(GVAR(rangeCardIncrement)))]; + ctrlSetText [10003, str(round(GVAR(rangeCardStartRange)))]; + ctrlSetText [10004, str(round(GVAR(rangeCardEndRange)))]; + ctrlSetText [10005, str(round(GVAR(rangeCardIncrement)))]; }; diff --git a/addons/atragmx/functions/fnc_show_target_range_assist.sqf b/addons/atragmx/functions/fnc_show_target_range_assist.sqf index 83516ef5c6a..b13352d22f9 100644 --- a/addons/atragmx/functions/fnc_show_target_range_assist.sqf +++ b/addons/atragmx/functions/fnc_show_target_range_assist.sqf @@ -21,8 +21,8 @@ GVAR(showTargetRangeAssist) = _this; if (_this) then { ctrlSetFocus ((uiNamespace getVariable "ATragMX_Display") displayCtrl 7018); - ctrlSetText [7012, Str(parseNumber(ctrlText 320))]; - ctrlSetText [7013, Str(parseNumber(ctrlText 340))]; + ctrlSetText [7012, str(parseNumber(ctrlText 320))]; + ctrlSetText [7013, str(parseNumber(ctrlText 340))]; if (GVAR(currentUnit) == 1) then { ctrlSetText [7016, "Yards"]; diff --git a/addons/atragmx/functions/fnc_show_target_speed_assist.sqf b/addons/atragmx/functions/fnc_show_target_speed_assist.sqf index 3efa6ed6d43..c2b34bd9081 100644 --- a/addons/atragmx/functions/fnc_show_target_speed_assist.sqf +++ b/addons/atragmx/functions/fnc_show_target_speed_assist.sqf @@ -22,7 +22,7 @@ GVAR(showTargetSpeedAssist) = _this; if (_this) then { ctrlSetFocus ((uiNamespace getVariable "ATragMX_Display") displayCtrl 8012); - ctrlSetText [8004, Str(Round((GVAR(targetRange) select GVAR(currentTarget))))]; + ctrlSetText [8004, str(round((GVAR(targetRange) select GVAR(currentTarget))))]; if (GVAR(currentUnit) == 1) then { ctrlSetText [8008, "Yards"]; diff --git a/addons/atragmx/functions/fnc_show_truing_drop.sqf b/addons/atragmx/functions/fnc_show_truing_drop.sqf index 5e7f60f4d4e..f75d3f7758c 100644 --- a/addons/atragmx/functions/fnc_show_truing_drop.sqf +++ b/addons/atragmx/functions/fnc_show_truing_drop.sqf @@ -21,9 +21,9 @@ GVAR(showTruingDrop) = _this; if (_this) then { if (GVAR(currentUnit) == 2) then { - ctrlSetText [18000, format["ZR=%1meters", Round(GVAR(workingMemory) select 2)]]; + ctrlSetText [18000, format["ZR=%1meters", round(GVAR(workingMemory) select 2)]]; } else { - ctrlSetText [18000, format["ZR=%1yards", Round((GVAR(workingMemory) select 2) * 1.0936133)]]; + ctrlSetText [18000, format["ZR=%1yards", round((GVAR(workingMemory) select 2) * 1.0936133)]]; }; private _dropUnit = GVAR(currentScopeUnit); if (_dropUnit == 3) then { diff --git a/addons/atragmx/functions/fnc_target_speed_assist_timer.sqf b/addons/atragmx/functions/fnc_target_speed_assist_timer.sqf index 5408edee3af..40c0ac7cd8f 100644 --- a/addons/atragmx/functions/fnc_target_speed_assist_timer.sqf +++ b/addons/atragmx/functions/fnc_target_speed_assist_timer.sqf @@ -29,7 +29,7 @@ if !(ctrlVisible 9000) then { if !(GVAR(speedAssistTimer)) exitWith { GVAR(speedAssistTimer) = true; - ctrlSetText [8006, Str(Round((CBA_missionTime - _startTime) * 10) / 10)]; + ctrlSetText [8006, str(round((CBA_missionTime - _startTime) * 10) / 10)]; [] call FUNC(calculate_target_speed_assist); @@ -39,7 +39,7 @@ if !(ctrlVisible 9000) then { [_this select 1] call CBA_fnc_removePerFrameHandler; }; - ctrlSetText [9001, Str(Round((CBA_missionTime - _startTime) * 10) / 10)]; + ctrlSetText [9001, str(round((CBA_missionTime - _startTime) * 10) / 10)]; }, 0.1, [CBA_missionTime]] call CBA_fnc_addPerFrameHandler; }; diff --git a/addons/atragmx/functions/fnc_toggle_range_card_setup.sqf b/addons/atragmx/functions/fnc_toggle_range_card_setup.sqf index 5c499b8b826..29c856013b4 100644 --- a/addons/atragmx/functions/fnc_toggle_range_card_setup.sqf +++ b/addons/atragmx/functions/fnc_toggle_range_card_setup.sqf @@ -20,9 +20,9 @@ if (ctrlVisible 10000) then { true call FUNC(show_range_card); if (_this == 1) then { - GVAR(rangeCardStartRange) = 0 max Round(parseNumber(ctrlText 10003)) min 3000; - GVAR(rangeCardEndRange) = 0 max Round(parseNumber(ctrlText 10004)) min 3000; - GVAR(rangeCardIncrement) = 1 max Round(parseNumber(ctrlText 10005)) min 3000; + GVAR(rangeCardStartRange) = 0 max round(parseNumber(ctrlText 10003)) min 3000; + GVAR(rangeCardEndRange) = 0 max round(parseNumber(ctrlText 10004)) min 3000; + GVAR(rangeCardIncrement) = 1 max round(parseNumber(ctrlText 10005)) min 3000; [] call FUNC(calculate_range_card); [] call FUNC(update_range_card); diff --git a/addons/atragmx/functions/fnc_toggle_target_range_assist.sqf b/addons/atragmx/functions/fnc_toggle_target_range_assist.sqf index 1e6c485e995..dd14f2ddcd0 100644 --- a/addons/atragmx/functions/fnc_toggle_target_range_assist.sqf +++ b/addons/atragmx/functions/fnc_toggle_target_range_assist.sqf @@ -20,10 +20,10 @@ if (ctrlVisible 7000) then { true call FUNC(show_main_page); if (_this == 1) then { - ctrlSetText [320, Str(parseNumber(ctrlText 7012))]; - ctrlSetText [140040, Str(parseNumber(ctrlText 7012))]; - ctrlSetText [340, Str(parseNumber(ctrlText 7013))]; - ctrlSetText [140060, Str(parseNumber(ctrlText 7013))]; + ctrlSetText [320, str(parseNumber(ctrlText 7012))]; + ctrlSetText [140040, str(parseNumber(ctrlText 7012))]; + ctrlSetText [340, str(parseNumber(ctrlText 7013))]; + ctrlSetText [140060, str(parseNumber(ctrlText 7013))]; [] call FUNC(calculate_target_solution); }; } else { diff --git a/addons/atragmx/functions/fnc_toggle_target_speed_assist.sqf b/addons/atragmx/functions/fnc_toggle_target_speed_assist.sqf index 009074105e8..fec9e528e57 100644 --- a/addons/atragmx/functions/fnc_toggle_target_speed_assist.sqf +++ b/addons/atragmx/functions/fnc_toggle_target_speed_assist.sqf @@ -23,8 +23,8 @@ if (ctrlVisible 8000) then { [] call FUNC(calculate_target_speed_assist); private _targetSpeed = parseNumber(ctrlText 8007); if (_targetSpeed != 0) then { - ctrlSetText [330, Str(_targetSpeed)]; - ctrlSetText [140050, Str(_targetSpeed)]; + ctrlSetText [330, str(_targetSpeed)]; + ctrlSetText [140050, str(_targetSpeed)]; [] call FUNC(calculate_target_solution); }; }; diff --git a/addons/atragmx/functions/fnc_true_c1_ballistic_coefficient.sqf b/addons/atragmx/functions/fnc_true_c1_ballistic_coefficient.sqf index 84371ca8527..06824cc7a20 100644 --- a/addons/atragmx/functions/fnc_true_c1_ballistic_coefficient.sqf +++ b/addons/atragmx/functions/fnc_true_c1_ballistic_coefficient.sqf @@ -18,7 +18,7 @@ private _referenceDrop = GVAR(truingDropDropData) select 0; private _actualDrop = GVAR(truingDropDropData) select 2; -if (Round(_actualDrop * 10) / 10 == Round(_referenceDrop * 10) / 10) exitWith {}; +if (round(_actualDrop * 10) / 10 == round(_referenceDrop * 10) / 10) exitWith {}; private _step = 0.01; if (_actualDrop > _referenceDrop) then { diff --git a/addons/atragmx/functions/fnc_true_muzzle_velocity.sqf b/addons/atragmx/functions/fnc_true_muzzle_velocity.sqf index f8fb9e621c4..75e1fbdc78d 100644 --- a/addons/atragmx/functions/fnc_true_muzzle_velocity.sqf +++ b/addons/atragmx/functions/fnc_true_muzzle_velocity.sqf @@ -18,7 +18,7 @@ private _referenceDrop = GVAR(truingDropDropData) select 0; private _actualDrop = GVAR(truingDropDropData) select 1; -if (Round(_actualDrop * 10) / 10 == Round(_referenceDrop * 10) / 10) exitWith {}; +if (round(_actualDrop * 10) / 10 == round(_referenceDrop * 10) / 10) exitWith {}; private _step = 10; if (_actualDrop > _referenceDrop) then { diff --git a/addons/atragmx/functions/fnc_update_atmo_env_data.sqf b/addons/atragmx/functions/fnc_update_atmo_env_data.sqf index 340924b5aa7..3118bee2233 100644 --- a/addons/atragmx/functions/fnc_update_atmo_env_data.sqf +++ b/addons/atragmx/functions/fnc_update_atmo_env_data.sqf @@ -18,20 +18,20 @@ ctrlSetFocus ((uiNamespace getVariable "ATragMX_Display") displayCtrl 13007); if (GVAR(currentUnit) == 2) then { - ctrlSetText [130040, Str(Round(GVAR(temperature) * 10) / 10)]; + ctrlSetText [130040, str(round(GVAR(temperature) * 10) / 10)]; } else { - ctrlSetText [130040, Str(Round((GVAR(temperature) * 1.8 + 32) * 10) / 10)]; + ctrlSetText [130040, str(round((GVAR(temperature) * 1.8 + 32) * 10) / 10)]; }; if (GVAR(currentUnit) == 2) then { - ctrlSetText [130050, Str(Round(GVAR(barometricPressure)))]; + ctrlSetText [130050, str(round(GVAR(barometricPressure)))]; } else { - ctrlSetText [130050, Str(Round(GVAR(barometricPressure) / 33.8638866667 * 100) / 100)]; + ctrlSetText [130050, str(round(GVAR(barometricPressure) / 33.8638866667 * 100) / 100)]; }; -ctrlSetText [130060, Str(Round(GVAR(relativeHumidity) * 100 * 10) / 10)]; +ctrlSetText [130060, str(round(GVAR(relativeHumidity) * 100 * 10) / 10)]; if (GVAR(currentUnit) == 2) then { - ctrlSetText [130030, Str(Round(GVAR(altitude)))]; + ctrlSetText [130030, str(round(GVAR(altitude)))]; } else { - ctrlSetText [130030, Str(Round(GVAR(altitude) * 3.2808399))]; + ctrlSetText [130030, str(round(GVAR(altitude) * 3.2808399))]; }; if (GVAR(currentUnit) == 2) then { diff --git a/addons/atragmx/functions/fnc_update_atmosphere.sqf b/addons/atragmx/functions/fnc_update_atmosphere.sqf index 7d523158925..ac04d19ba9a 100644 --- a/addons/atragmx/functions/fnc_update_atmosphere.sqf +++ b/addons/atragmx/functions/fnc_update_atmosphere.sqf @@ -16,18 +16,18 @@ */ if (GVAR(currentUnit) == 2) then { - ctrlSetText [200, Str(Round(GVAR(temperature) * 10) / 10)]; + ctrlSetText [200, str(round(GVAR(temperature) * 10) / 10)]; } else { - ctrlSetText [200, Str(Round((GVAR(temperature) * 1.8 + 32) * 10) / 10)]; + ctrlSetText [200, str(round((GVAR(temperature) * 1.8 + 32) * 10) / 10)]; }; if (GVAR(currentUnit) == 2) then { - ctrlSetText [210, Str(Round(GVAR(barometricPressure)))]; + ctrlSetText [210, str(round(GVAR(barometricPressure)))]; } else { - ctrlSetText [210, Str(Round(GVAR(barometricPressure) / 33.8638866667 * 100) / 100)]; + ctrlSetText [210, str(round(GVAR(barometricPressure) / 33.8638866667 * 100) / 100)]; }; -ctrlSetText [220, Str(Round(GVAR(relativeHumidity) * 100 * 10) / 10)]; +ctrlSetText [220, str(round(GVAR(relativeHumidity) * 100 * 10) / 10)]; if (GVAR(currentUnit) == 2) then { - ctrlSetText [230, Str(Round(GVAR(altitude)))]; + ctrlSetText [230, str(round(GVAR(altitude)))]; } else { - ctrlSetText [230, Str(Round(GVAR(altitude) * 3.2808399))]; + ctrlSetText [230, str(round(GVAR(altitude) * 3.2808399))]; }; diff --git a/addons/atragmx/functions/fnc_update_c1_ballistic_coefficient_data.sqf b/addons/atragmx/functions/fnc_update_c1_ballistic_coefficient_data.sqf index 4c0c6d7175b..886ad33ba97 100644 --- a/addons/atragmx/functions/fnc_update_c1_ballistic_coefficient_data.sqf +++ b/addons/atragmx/functions/fnc_update_c1_ballistic_coefficient_data.sqf @@ -17,9 +17,9 @@ // Distances if (GVAR(currentUnit) != 1) then { - {ctrlSetText [_x, Str(Round(((GVAR(workingMemory) select 19) select _forEachIndex) select 0))]} forEach [170021, 170022, 170023, 170024, 170025, 170026, 170027]; + {ctrlSetText [_x, str(round(((GVAR(workingMemory) select 19) select _forEachIndex) select 0))]} forEach [170021, 170022, 170023, 170024, 170025, 170026, 170027]; } else { - {ctrlSetText [_x, Str(Round((((GVAR(workingMemory) select 19) select _forEachIndex) select 0) * 1.0936133))]} forEach [170021, 170022, 170023, 170024, 170025, 170026, 170027]; + {ctrlSetText [_x, str(round((((GVAR(workingMemory) select 19) select _forEachIndex) select 0) * 1.0936133))]} forEach [170021, 170022, 170023, 170024, 170025, 170026, 170027]; }; // Ballistic coefficients -{ctrlSetText [_x, Str(Round((((GVAR(workingMemory) select 19) select _forEachIndex) select 1) * 1000) / 1000)]} forEach [170031, 170032, 170033, 170034, 170035, 170036, 170037]; +{ctrlSetText [_x, str(round((((GVAR(workingMemory) select 19) select _forEachIndex) select 1) * 1000) / 1000)]} forEach [170031, 170032, 170033, 170034, 170035, 170036, 170037]; diff --git a/addons/atragmx/functions/fnc_update_gun.sqf b/addons/atragmx/functions/fnc_update_gun.sqf index 5a5dab00fa8..67f726e92e6 100644 --- a/addons/atragmx/functions/fnc_update_gun.sqf +++ b/addons/atragmx/functions/fnc_update_gun.sqf @@ -17,34 +17,34 @@ ctrlSetText [1000, GVAR(workingMemory) select 0]; if (GVAR(currentUnit) != 2) then { - ctrlSetText [100, Str(Round((GVAR(workingMemory) select 5) / 2.54 * 100) / 100)]; + ctrlSetText [100, str(round((GVAR(workingMemory) select 5) / 2.54 * 100) / 100)]; } else { - ctrlSetText [100, Str(Round((GVAR(workingMemory) select 5) * 100) / 100)]; + ctrlSetText [100, str(round((GVAR(workingMemory) select 5) * 100) / 100)]; }; if (GVAR(currentUnit) != 2) then { - ctrlSetText [110, Str(Round((GVAR(workingMemory) select 12) * 15.4323584))]; + ctrlSetText [110, str(round((GVAR(workingMemory) select 12) * 15.4323584))]; } else { - ctrlSetText [110, Str(Round((GVAR(workingMemory) select 12) * 10) / 10)]; + ctrlSetText [110, str(round((GVAR(workingMemory) select 12) * 10) / 10)]; }; if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { - ctrlSetText [120, Str(Round((GVAR(workingMemory) select 15) * 1000) / 1000)]; + ctrlSetText [120, str(round((GVAR(workingMemory) select 15) * 1000) / 1000)]; } else { - ctrlSetText [120, Str(Round((GVAR(workingMemory) select 4) * -1000 * 1000) / 1000)]; + ctrlSetText [120, str(round((GVAR(workingMemory) select 4) * -1000 * 1000) / 1000)]; }; if (GVAR(currentUnit) != 2) then { - ctrlSetText [130, Str(Round((GVAR(workingMemory) select 1) * 3.2808399))]; + ctrlSetText [130, str(round((GVAR(workingMemory) select 1) * 3.2808399))]; } else { - ctrlSetText [130, Str(Round(GVAR(workingMemory) select 1))]; + ctrlSetText [130, str(round(GVAR(workingMemory) select 1))]; }; switch (GVAR(currentUnit)) do { case 0: { - ctrlSetText [140, format["*%1", Round(GVAR(workingMemory) select 2)]]; + ctrlSetText [140, format["*%1", round(GVAR(workingMemory) select 2)]]; }; case 1: { - ctrlSetText [140, Str(Round((GVAR(workingMemory) select 2) * 1.0936133))]; + ctrlSetText [140, str(round((GVAR(workingMemory) select 2) * 1.0936133))]; }; case 2: { - ctrlSetText [140, Str(Round(GVAR(workingMemory) select 2))]; + ctrlSetText [140, str(round(GVAR(workingMemory) select 2))]; }; }; [] call FUNC(update_scope_unit); diff --git a/addons/atragmx/functions/fnc_update_gun_ammo_data.sqf b/addons/atragmx/functions/fnc_update_gun_ammo_data.sqf index 59bd0149733..56347ac6db6 100644 --- a/addons/atragmx/functions/fnc_update_gun_ammo_data.sqf +++ b/addons/atragmx/functions/fnc_update_gun_ammo_data.sqf @@ -18,39 +18,39 @@ ctrlSetFocus ((uiNamespace getVariable "ATragMX_Display") displayCtrl 12008); if (GVAR(currentUnit) != 2) then { - ctrlSetText [120000, Str(Round((GVAR(workingMemory) select 5) / 2.54 * 100) / 100)]; + ctrlSetText [120000, str(round((GVAR(workingMemory) select 5) / 2.54 * 100) / 100)]; } else { - ctrlSetText [120000, Str(Round((GVAR(workingMemory) select 5) * 100) / 100)]; + ctrlSetText [120000, str(round((GVAR(workingMemory) select 5) * 100) / 100)]; }; if (GVAR(currentUnit) != 2) then { - ctrlSetText [120010, Str(Round((GVAR(workingMemory) select 12) * 15.4323584))]; + ctrlSetText [120010, str(round((GVAR(workingMemory) select 12) * 15.4323584))]; } else { - ctrlSetText [120010, Str(Round((GVAR(workingMemory) select 12) * 10) / 10)]; + ctrlSetText [120010, str(round((GVAR(workingMemory) select 12) * 10) / 10)]; }; if (GVAR(currentUnit) != 2) then { - ctrlSetText [120020, Str(Round((GVAR(workingMemory) select 13) / 10 / 2.54 * 1000) / 1000)]; + ctrlSetText [120020, str(round((GVAR(workingMemory) select 13) / 10 / 2.54 * 1000) / 1000)]; } else { - ctrlSetText [120020, Str(Round((GVAR(workingMemory) select 13) / 10 * 1000) / 1000)]; + ctrlSetText [120020, str(round((GVAR(workingMemory) select 13) / 10 * 1000) / 1000)]; }; if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { - ctrlSetText [120030, Str(Round((GVAR(workingMemory) select 15) * 1000) / 1000)]; + ctrlSetText [120030, str(round((GVAR(workingMemory) select 15) * 1000) / 1000)]; } else { - ctrlSetText [120030, Str(Round((GVAR(workingMemory) select 4) * -1000 * 1000) / 1000)]; + ctrlSetText [120030, str(round((GVAR(workingMemory) select 4) * -1000 * 1000) / 1000)]; }; if (GVAR(currentUnit) != 2) then { - ctrlSetText [120040, Str(Round((GVAR(workingMemory) select 14) / 2.54 * 10) / 10)]; + ctrlSetText [120040, str(round((GVAR(workingMemory) select 14) / 2.54 * 10) / 10)]; } else { - ctrlSetText [120040, Str(Round((GVAR(workingMemory) select 14) * 100) / 100)]; + ctrlSetText [120040, str(round((GVAR(workingMemory) select 14) * 100) / 100)]; }; if (GVAR(currentUnit) != 2) then { - ctrlSetText [120050, Str(Round((GVAR(workingMemory) select 1) * 3.2808399))]; + ctrlSetText [120050, str(round((GVAR(workingMemory) select 1) * 3.2808399))]; } else { - ctrlSetText [120050, Str(Round(GVAR(workingMemory) select 1))]; + ctrlSetText [120050, str(round(GVAR(workingMemory) select 1))]; }; if (GVAR(currentUnit) == 1) then { - ctrlSetText [120060, Str(Round((GVAR(workingMemory) select 2) * 1.0936133))]; + ctrlSetText [120060, str(round((GVAR(workingMemory) select 2) * 1.0936133))]; } else { - ctrlSetText [120060, Str(Round(GVAR(workingMemory) select 2))]; + ctrlSetText [120060, str(round(GVAR(workingMemory) select 2))]; }; if (GVAR(currentUnit) == 0) then { ctrlSetText [120061, "*"]; diff --git a/addons/atragmx/functions/fnc_update_inclination_angle.sqf b/addons/atragmx/functions/fnc_update_inclination_angle.sqf index 532b3d94e8f..b7ae40160c6 100644 --- a/addons/atragmx/functions/fnc_update_inclination_angle.sqf +++ b/addons/atragmx/functions/fnc_update_inclination_angle.sqf @@ -19,7 +19,7 @@ private _inclinationAngleCosine = 0.5 max parseNumber(ctrlText 140041) min 1; private _inclinationAngleDegree = -60 max parseNumber(ctrlText 140040) min 60; if (_this == 0) then { - ctrlSetText [140040, Str(round(acos(_inclinationAngleCosine)))]; + ctrlSetText [140040, str(round(acos(_inclinationAngleCosine)))]; } else { - ctrlSetText [140041, Str(round(cos(_inclinationAngleDegree) * 100) / 100)]; + ctrlSetText [140041, str(round(cos(_inclinationAngleDegree) * 100) / 100)]; }; diff --git a/addons/atragmx/functions/fnc_update_muzzle_velocity_data.sqf b/addons/atragmx/functions/fnc_update_muzzle_velocity_data.sqf index 23193aa9036..36af09d6427 100644 --- a/addons/atragmx/functions/fnc_update_muzzle_velocity_data.sqf +++ b/addons/atragmx/functions/fnc_update_muzzle_velocity_data.sqf @@ -17,12 +17,12 @@ if (GVAR(currentUnit) == 2) then { // Temperatures - {ctrlSetText [_x, Str(Round((((GVAR(workingMemory) select 18) select _forEachIndex) select 0) * 10) / 10)]} forEach [160021, 160022, 160023, 160024, 160025, 160026, 160027]; + {ctrlSetText [_x, str(round((((GVAR(workingMemory) select 18) select _forEachIndex) select 0) * 10) / 10)]} forEach [160021, 160022, 160023, 160024, 160025, 160026, 160027]; // Muzzle velocities - {ctrlSetText [_x, Str(Round(((GVAR(workingMemory) select 18) select _forEachIndex) select 1))]} forEach [160031, 160032, 160033, 160034, 160035, 160036, 160037]; + {ctrlSetText [_x, str(round(((GVAR(workingMemory) select 18) select _forEachIndex) select 1))]} forEach [160031, 160032, 160033, 160034, 160035, 160036, 160037]; } else { // Temperatures - {ctrlSetText [_x, Str(Round(((((GVAR(workingMemory) select 18) select _forEachIndex) select 0) * 1.8 + 32) * 10) / 10)]} forEach [160021, 160022, 160023, 160024, 160025, 160026, 160027]; + {ctrlSetText [_x, str(round(((((GVAR(workingMemory) select 18) select _forEachIndex) select 0) * 1.8 + 32) * 10) / 10)]} forEach [160021, 160022, 160023, 160024, 160025, 160026, 160027]; // Muzzle velocities - {ctrlSetText [_x, Str(Round((((GVAR(workingMemory) select 18) select _forEachIndex) select 1) * 3.2808399))]} forEach [160031, 160032, 160033, 160034, 160035, 160036, 160037]; + {ctrlSetText [_x, str(round((((GVAR(workingMemory) select 18) select _forEachIndex) select 1) * 3.2808399))]} forEach [160031, 160032, 160033, 160034, 160035, 160036, 160037]; }; diff --git a/addons/atragmx/functions/fnc_update_range_card.sqf b/addons/atragmx/functions/fnc_update_range_card.sqf index 066bd651746..e280c7d137a 100644 --- a/addons/atragmx/functions/fnc_update_range_card.sqf +++ b/addons/atragmx/functions/fnc_update_range_card.sqf @@ -59,16 +59,16 @@ private _speedOfSound = GVAR(temperature) call EFUNC(weather,calculateSpeedOfSou private _clickNumber = GVAR(workingMemory) select 8; private _clickInterval = _clickSize / _clickNumber; - _elevation = Round(_elevation / _clickInterval); - _windage1 = Round(_windage1 / _clickInterval); - _windage2 = Round(_windage2 / _clickInterval); + _elevation = round(_elevation / _clickInterval); + _windage1 = round(_windage1 / _clickInterval); + _windage2 = round(_windage2 / _clickInterval); }; }; - private _elevationOutput = Str(Round(_elevation * 100) / 100); - private _windageOutput = Str(Round(_windage1 * 100) / 100); + private _elevationOutput = str(round(_elevation * 100) / 100); + private _windageOutput = str(round(_windage1 * 100) / 100); - private _rangeOutput = Str(_range); + private _rangeOutput = str(_range); if (_velocity < _speedOfSound) then { _rangeOutput = _rangeOutput + "*"; }; @@ -80,19 +80,19 @@ private _speedOfSound = GVAR(temperature) call EFUNC(weather,calculateSpeedOfSou switch (GVAR(rangeCardCurrentColumn)) do { case 0: { if (GVAR(showWind2)) then { - _lastColumnOutput = Str(Round(_windage2 * 100) / 100); + _lastColumnOutput = str(round(_windage2 * 100) / 100); } else { - _lastColumnOutput = Str(Round(_lead * 100) / 100); + _lastColumnOutput = str(round(_lead * 100) / 100); }; }; case 1: { - _lastColumnOutput = Str(Round(_velocity)); + _lastColumnOutput = str(round(_velocity)); }; case 2: { - _lastColumnOutput = Str(Round(_kineticEnergy)); + _lastColumnOutput = str(round(_kineticEnergy)); }; case 3: { - _lastColumnOutput = Str(Round(_TOF * 100) / 100); + _lastColumnOutput = str(round(_TOF * 100) / 100); } }; diff --git a/addons/atragmx/functions/fnc_update_result.sqf b/addons/atragmx/functions/fnc_update_result.sqf index cfd8f460a93..3e8d4ef9bd3 100644 --- a/addons/atragmx/functions/fnc_update_result.sqf +++ b/addons/atragmx/functions/fnc_update_result.sqf @@ -69,16 +69,16 @@ switch (GVAR(currentScopeUnit)) do { private _clickNumber = GVAR(workingMemory) select 8; private _clickInterval = _clickSize / _clickNumber; - _elevationAbs = Round(_elevationAbs / _clickInterval); - _windageAbs = Round(_windageAbs / _clickInterval); + _elevationAbs = round(_elevationAbs / _clickInterval); + _windageAbs = round(_windageAbs / _clickInterval); - _wind2 = Round(_wind2 / _clickInterval); + _wind2 = round(_wind2 / _clickInterval); - _elevationRel = Round(_elevationRel / _clickInterval); - _windageRel = Round(_windageRel / _clickInterval); + _elevationRel = round(_elevationRel / _clickInterval); + _windageRel = round(_windageRel / _clickInterval); - _elevationCur = Round(_elevationCur / _clickInterval); - _windageCur = Round(_windageCur / _clickInterval); + _elevationCur = round(_elevationCur / _clickInterval); + _windageCur = round(_windageCur / _clickInterval); }; }; @@ -88,7 +88,7 @@ if (GVAR(showWind2)) then { ctrlSetText [42, "Lead"]; }; -_elevationAbs = Round(_elevationAbs * 100) / 100; +_elevationAbs = round(_elevationAbs * 100) / 100; if (_elevationAbs > 0) then { ctrlSetText [400, str abs _elevationAbs]; } else { @@ -98,7 +98,7 @@ if (_elevationAbs > 0) then { ctrlSetText [400, "0.0"]; }; }; -_elevationRel = Round(_elevationRel * 100) / 100; +_elevationRel = round(_elevationRel * 100) / 100; if (_elevationRel > 0) then { ctrlSetText [401, str abs _elevationRel]; } else { @@ -108,7 +108,7 @@ if (_elevationRel > 0) then { ctrlSetText [401, "0.0"]; }; }; -_elevationCur = Round(_elevationCur * 100) / 100; +_elevationCur = round(_elevationCur * 100) / 100; if (_elevationCur > 0) then { ctrlSetText [402, str abs _elevationCur]; } else { @@ -119,7 +119,7 @@ if (_elevationCur > 0) then { }; }; -_windageAbs = Round(_windageAbs * 100) / 100; +_windageAbs = round(_windageAbs * 100) / 100; if (_windageAbs > 0) then { ctrlSetText [410, format["%1R", abs(_windageAbs)]]; } else { @@ -129,7 +129,7 @@ if (_windageAbs > 0) then { ctrlSetText [410, "0.0"]; }; }; -_windageRel = Round(_windageRel * 100) / 100; +_windageRel = round(_windageRel * 100) / 100; if (_windageRel > 0) then { ctrlSetText [411, format["%1R", abs(_windageRel)]]; } else { @@ -139,7 +139,7 @@ if (_windageRel > 0) then { ctrlSetText [411, "0.0"]; }; }; -_windageCur = Round(_windageCur * 100) / 100; +_windageCur = round(_windageCur * 100) / 100; if (_windageCur > 0) then { ctrlSetText [412, format["%1R", abs(_windageCur)]]; } else { @@ -151,7 +151,7 @@ if (_windageCur > 0) then { }; if (GVAR(showWind2)) then { - _wind2 = Round(_wind2 * 100) / 100; + _wind2 = round(_wind2 * 100) / 100; if (_wind2 > 0) then { ctrlSetText [420, format["%1R", abs(_wind2)]]; } else { @@ -162,7 +162,7 @@ if (GVAR(showWind2)) then { }; }; } else { - _lead = Round(_lead * 100) / 100; + _lead = round(_lead * 100) / 100; if (_lead > 0) then { if ((GVAR(targetSpeedDirection) select GVAR(currentTarget)) == 1) then { ctrlSetText [420, format["%1R", abs(_lead)]]; diff --git a/addons/atragmx/functions/fnc_update_scope_unit.sqf b/addons/atragmx/functions/fnc_update_scope_unit.sqf index d1f0e9cf170..e72b490ef03 100644 --- a/addons/atragmx/functions/fnc_update_scope_unit.sqf +++ b/addons/atragmx/functions/fnc_update_scope_unit.sqf @@ -16,7 +16,7 @@ */ ctrlSetText [2000, GVAR(scopeUnits) select GVAR(currentScopeUnit)]; -ctrlSetText [2001, Str(GVAR(currentScopeClickNumber))]; +ctrlSetText [2001, str(GVAR(currentScopeClickNumber))]; if (GVAR(currentScopeUnit) == 3) then { ctrlSetText [5000, format["Clicks=%1", GVAR(currentScopeClickNumber)]]; diff --git a/addons/atragmx/functions/fnc_update_target.sqf b/addons/atragmx/functions/fnc_update_target.sqf index a87ba9ba54f..df37e7848e4 100644 --- a/addons/atragmx/functions/fnc_update_target.sqf +++ b/addons/atragmx/functions/fnc_update_target.sqf @@ -17,32 +17,32 @@ if (GVAR(showWind2)) then { if (GVAR(currentUnit) != 2) then { - ctrlSetText [300, format["%1/%2", Round((GVAR(windSpeed1) select GVAR(currentTarget)) * 2.23693629), Round((GVAR(windSpeed2) select GVAR(currentTarget)) * 2.23693629)]]; + ctrlSetText [300, format["%1/%2", round((GVAR(windSpeed1) select GVAR(currentTarget)) * 2.23693629), round((GVAR(windSpeed2) select GVAR(currentTarget)) * 2.23693629)]]; } else { - ctrlSetText [300, format["%1/%2", Round(GVAR(windSpeed1) select GVAR(currentTarget)), Round(GVAR(windSpeed2) select GVAR(currentTarget))]]; + ctrlSetText [300, format["%1/%2", round(GVAR(windSpeed1) select GVAR(currentTarget)), round(GVAR(windSpeed2) select GVAR(currentTarget))]]; }; } else { if (GVAR(currentUnit) != 2) then { - ctrlSetText [300, Str(Round((GVAR(windSpeed1) select GVAR(currentTarget)) * 2.23693629 * 100) / 100)]; + ctrlSetText [300, str(round((GVAR(windSpeed1) select GVAR(currentTarget)) * 2.23693629 * 100) / 100)]; } else { - ctrlSetText [300, Str(Round((GVAR(windSpeed1) select GVAR(currentTarget)) * 100) / 100)]; + ctrlSetText [300, str(round((GVAR(windSpeed1) select GVAR(currentTarget)) * 100) / 100)]; }; }; -ctrlSetText [310, Str(Round((GVAR(windDirection) select GVAR(currentTarget))))]; -ctrlSetText [320, Str(Round((GVAR(inclinationAngle) select GVAR(currentTarget))))]; +ctrlSetText [310, str(round((GVAR(windDirection) select GVAR(currentTarget))))]; +ctrlSetText [320, str(round((GVAR(inclinationAngle) select GVAR(currentTarget))))]; if (GVAR(currentUnit) != 2) then { - ctrlSetText [330, Str(Round((GVAR(targetSpeed) select GVAR(currentTarget)) * 2.23693629 * 100) / 100)]; + ctrlSetText [330, str(round((GVAR(targetSpeed) select GVAR(currentTarget)) * 2.23693629 * 100) / 100)]; } else { - ctrlSetText [330, Str(Round((GVAR(targetSpeed) select GVAR(currentTarget)) * 100) / 100)]; + ctrlSetText [330, str(round((GVAR(targetSpeed) select GVAR(currentTarget)) * 100) / 100)]; }; switch (GVAR(currentUnit)) do { case 0: { - ctrlSetText [340, format["*%1", Round((GVAR(targetRange) select GVAR(currentTarget)))]]; + ctrlSetText [340, format["*%1", round((GVAR(targetRange) select GVAR(currentTarget)))]]; }; case 1: { - ctrlSetText [340, Str(Round((GVAR(targetRange) select GVAR(currentTarget)) * 1.0936133))]; + ctrlSetText [340, str(round((GVAR(targetRange) select GVAR(currentTarget)) * 1.0936133))]; }; case 2: { - ctrlSetText [340, Str(Round((GVAR(targetRange) select GVAR(currentTarget))))]; + ctrlSetText [340, str(round((GVAR(targetRange) select GVAR(currentTarget))))]; }; }; diff --git a/addons/atragmx/functions/fnc_update_target_data.sqf b/addons/atragmx/functions/fnc_update_target_data.sqf index 92b5df50a06..f47d0401ddb 100644 --- a/addons/atragmx/functions/fnc_update_target_data.sqf +++ b/addons/atragmx/functions/fnc_update_target_data.sqf @@ -15,22 +15,22 @@ * Public: No */ -ctrlSetText [140000, Str(Round((GVAR(latitude) select GVAR(currentTarget)) * 100) / 100)]; -ctrlSetText [140010, Str(Round((GVAR(directionOfFire) select GVAR(currentTarget)) * 100) / 100)]; +ctrlSetText [140000, str(round((GVAR(latitude) select GVAR(currentTarget)) * 100) / 100)]; +ctrlSetText [140010, str(round((GVAR(directionOfFire) select GVAR(currentTarget)) * 100) / 100)]; if (GVAR(currentUnit) != 2) then { - ctrlSetText [140020, Str(Round((GVAR(windSpeed1) select GVAR(currentTarget)) * 2.23693629 * 100) / 100)]; - ctrlSetText [140021, Str(Round((GVAR(windSpeed2) select GVAR(currentTarget)) * 2.23693629 * 100) / 100)]; + ctrlSetText [140020, str(round((GVAR(windSpeed1) select GVAR(currentTarget)) * 2.23693629 * 100) / 100)]; + ctrlSetText [140021, str(round((GVAR(windSpeed2) select GVAR(currentTarget)) * 2.23693629 * 100) / 100)]; } else { - ctrlSetText [140020, Str(Round((GVAR(windSpeed1) select GVAR(currentTarget)) * 100) / 100)]; - ctrlSetText [140021, Str(Round((GVAR(windSpeed2) select GVAR(currentTarget)) * 100) / 100)]; + ctrlSetText [140020, str(round((GVAR(windSpeed1) select GVAR(currentTarget)) * 100) / 100)]; + ctrlSetText [140021, str(round((GVAR(windSpeed2) select GVAR(currentTarget)) * 100) / 100)]; }; -ctrlSetText [140030, Str(Round((GVAR(windDirection) select GVAR(currentTarget))))]; -ctrlSetText [140040, Str(Round((GVAR(inclinationAngle) select GVAR(currentTarget))))]; -ctrlSetText [140041, Str(Round(cos(GVAR(inclinationAngle) select GVAR(currentTarget)) * 100) / 100)]; +ctrlSetText [140030, str(round((GVAR(windDirection) select GVAR(currentTarget))))]; +ctrlSetText [140040, str(round((GVAR(inclinationAngle) select GVAR(currentTarget))))]; +ctrlSetText [140041, str(round(cos(GVAR(inclinationAngle) select GVAR(currentTarget)) * 100) / 100)]; if (GVAR(currentUnit) != 2) then { - ctrlSetText [140050, Str(Round((GVAR(targetSpeed) select GVAR(currentTarget)) * 2.23693629 * 100) / 100)]; + ctrlSetText [140050, str(round((GVAR(targetSpeed) select GVAR(currentTarget)) * 2.23693629 * 100) / 100)]; } else { - ctrlSetText [140050, Str(Round((GVAR(targetSpeed) select GVAR(currentTarget)) * 100) / 100)]; + ctrlSetText [140050, str(round((GVAR(targetSpeed) select GVAR(currentTarget)) * 100) / 100)]; }; if ((GVAR(targetSpeedDirection) select GVAR(currentTarget)) == 1) then { ctrlSetText [140051, ">"]; @@ -38,9 +38,9 @@ if ((GVAR(targetSpeedDirection) select GVAR(currentTarget)) == 1) then { ctrlSetText [140051, "<"]; }; if (GVAR(currentUnit) == 1) then { - ctrlSetText [140060, Str(Round((GVAR(targetRange) select GVAR(currentTarget)) * 1.0936133))]; + ctrlSetText [140060, str(round((GVAR(targetRange) select GVAR(currentTarget)) * 1.0936133))]; } else { - ctrlSetText [140060, Str(Round((GVAR(targetRange) select GVAR(currentTarget))))]; + ctrlSetText [140060, str(round((GVAR(targetRange) select GVAR(currentTarget))))]; }; if (GVAR(currentUnit) == 0) then { ctrlSetText [140061, "*"]; diff --git a/addons/atragmx/functions/fnc_update_truing_drop_data.sqf b/addons/atragmx/functions/fnc_update_truing_drop_data.sqf index ad0f0dda0e8..1180b689cd0 100644 --- a/addons/atragmx/functions/fnc_update_truing_drop_data.sqf +++ b/addons/atragmx/functions/fnc_update_truing_drop_data.sqf @@ -16,11 +16,11 @@ */ if (GVAR(currentUnit) == 2) then { - ctrlSetText [18011, Str(Round(GVAR(truingDropRangeData) select 0))]; - ctrlSetText [18012, Str(Round(GVAR(truingDropRangeData) select 1))]; + ctrlSetText [18011, str(round(GVAR(truingDropRangeData) select 0))]; + ctrlSetText [18012, str(round(GVAR(truingDropRangeData) select 1))]; } else { - ctrlSetText [18011, Str(Round((GVAR(truingDropRangeData) select 0) * 1.0936133))]; - ctrlSetText [18012, Str(Round((GVAR(truingDropRangeData) select 1) * 1.0936133))]; + ctrlSetText [18011, str(round((GVAR(truingDropRangeData) select 0) * 1.0936133))]; + ctrlSetText [18012, str(round((GVAR(truingDropRangeData) select 1) * 1.0936133))]; }; if (GVAR(truingDropMode) == 0) then { @@ -53,25 +53,25 @@ switch (_dropUnit) do { }; }; -ctrlSetText [18006, Str(Round((_dropData select 0) * 100) / 100)]; -ctrlSetText [18013, Str(Round((_dropData select 1) * 100) / 100)]; -ctrlSetText [18014, Str(Round((_dropData select 2) * 100) / 100)]; +ctrlSetText [18006, str(round((_dropData select 0) * 100) / 100)]; +ctrlSetText [18013, str(round((_dropData select 1) * 100) / 100)]; +ctrlSetText [18014, str(round((_dropData select 2) * 100) / 100)]; if (GVAR(currentUnit) != 2) then { - ctrlSetText [18007, Str(Round((GVAR(workingMemory) select 1) * 3.2808399))]; - ctrlSetText [18016, Str(Round((GVAR(workingMemory) select 1) * 3.2808399))]; + ctrlSetText [18007, str(round((GVAR(workingMemory) select 1) * 3.2808399))]; + ctrlSetText [18016, str(round((GVAR(workingMemory) select 1) * 3.2808399))]; if (GVAR(truingDropMuzzleVelocity) > 0) then { - ctrlSetText [18016, Str(Round(GVAR(truingDropMuzzleVelocity) * 3.2808399))]; + ctrlSetText [18016, str(round(GVAR(truingDropMuzzleVelocity) * 3.2808399))]; }; } else { - ctrlSetText [18007, Str(Round(GVAR(workingMemory) select 1))]; - ctrlSetText [18016, Str(Round(GVAR(workingMemory) select 1))]; + ctrlSetText [18007, str(round(GVAR(workingMemory) select 1))]; + ctrlSetText [18016, str(round(GVAR(workingMemory) select 1))]; if (GVAR(truingDropMuzzleVelocity) > 0) then { - ctrlSetText [18016, Str(Round(GVAR(truingDropMuzzleVelocity)))]; + ctrlSetText [18016, str(round(GVAR(truingDropMuzzleVelocity)))]; }; }; -ctrlSetText [18008, Str(Round((GVAR(workingMemory) select 15) * 1000) / 1000)]; -ctrlSetText [18017, Str(Round((GVAR(workingMemory) select 15) * 1000) / 1000)]; +ctrlSetText [18008, str(round((GVAR(workingMemory) select 15) * 1000) / 1000)]; +ctrlSetText [18017, str(round((GVAR(workingMemory) select 15) * 1000) / 1000)]; if (GVAR(truingDropC1) > 0) then { - ctrlSetText [18017, Str(Round(GVAR(truingDropC1) * 1000) / 1000)]; + ctrlSetText [18017, str(round(GVAR(truingDropC1) * 1000) / 1000)]; }; diff --git a/addons/atragmx/functions/fnc_update_zero_range.sqf b/addons/atragmx/functions/fnc_update_zero_range.sqf index 8a3eca13448..d29ad18b688 100644 --- a/addons/atragmx/functions/fnc_update_zero_range.sqf +++ b/addons/atragmx/functions/fnc_update_zero_range.sqf @@ -36,11 +36,25 @@ if (!GVAR(atmosphereModeTBH)) then { }; private _scopeBaseAngle = if !(missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { - private _zeroAngle = "ace_advanced_ballistics" callExtension format ["calcZero:%1:%2:%3:%4", _zeroRange, _muzzleVelocity, _airFriction, _boreHeight]; - (parseNumber _zeroAngle) + parseNumber (("ace" callExtension ["ballistics:zero_vanilla", [ + _zeroRange, + _muzzleVelocity, + _airFriction, + _boreHeight + ]]) select 0) } else { - private _zeroAngle = "ace_advanced_ballistics" callExtension format ["calcZeroAB:%1:%2:%3:%4:%5:%6:%7:%8:%9", _zeroRange, _muzzleVelocity, _boreHeight, _temperature, _barometricPressure, _relativeHumidity, _bc, _dragModel, _atmosphereModel]; - (parseNumber _zeroAngle) + parseNumber (("ace" callExtension ["ballistics:zero_advanced", [ + _zeroRange, + _muzzleVelocity, + _airFriction, + _boreHeight, + _temperature, + _barometricPressure, + _relativeHumidity, + _bc, + _dragModel, + _atmosphereModel + ]]) select 0) }; GVAR(workingMemory) set [2, _zeroRange]; diff --git a/addons/attach/functions/fnc_attach.sqf b/addons/attach/functions/fnc_attach.sqf index 6a0c4082711..d1e9f129875 100644 --- a/addons/attach/functions/fnc_attach.sqf +++ b/addons/attach/functions/fnc_attach.sqf @@ -50,8 +50,8 @@ if (_unit == _attachToVehicle) then { //Self Attachment } else { GVAR(placeAction) = PLACE_WAITING; - [_unit, "forceWalk", "ACE_Attach", true] call EFUNC(common,statusEffect_set); - [_unit, "blockThrow", "ACE_Attach", true] call EFUNC(common,statusEffect_set); + [_unit, "forceWalk", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); + [_unit, "blockThrow", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); [{[localize LSTRING(PlaceAction), ""] call EFUNC(interaction,showMouseHint)}, []] call CBA_fnc_execNextFrame; _unit setVariable [QGVAR(placeActionEH), [_unit, "DefaultAction", {true}, {GVAR(placeAction) = PLACE_APPROVE;}] call EFUNC(common,AddActionEventHandler)]; @@ -88,8 +88,8 @@ if (_unit == _attachToVehicle) then { //Self Attachment {!([_attachToVehicle, _unit, _itemClassname] call FUNC(canAttach))}) then { [_idPFH] call CBA_fnc_removePerFrameHandler; - [_unit, "forceWalk", "ACE_Attach", false] call EFUNC(common,statusEffect_set); - [_unit, "blockThrow", "ACE_Attach", false] call EFUNC(common,statusEffect_set); + [_unit, "forceWalk", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); + [_unit, "blockThrow", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); [] call EFUNC(interaction,hideMouseHint); [_unit, "DefaultAction", (_unit getVariable [QGVAR(placeActionEH), -1])] call EFUNC(common,removeActionEventHandler); _unit removeAction _actionID; diff --git a/addons/attach/functions/fnc_canDetach.sqf b/addons/attach/functions/fnc_canDetach.sqf index 7202ba410fc..9b70d35ff4e 100644 --- a/addons/attach/functions/fnc_canDetach.sqf +++ b/addons/attach/functions/fnc_canDetach.sqf @@ -32,7 +32,7 @@ private _inRange = false; _attachedList deleteAt _forEachIndex; _attachToVehicle setVariable [QGVAR(attached), _attachedList, true]; }; - if (((getPos _unit) distance2d (getPos _xObject)) < 4) exitWith {_inRange = true}; + if (((getPos _unit) distance2D (getPos _xObject)) < 4) exitWith {_inRange = true}; } forEach _attachedList; _inRange && diff --git a/addons/attach/functions/fnc_detach.sqf b/addons/attach/functions/fnc_detach.sqf index d953b02bd16..8eab98e0720 100644 --- a/addons/attach/functions/fnc_detach.sqf +++ b/addons/attach/functions/fnc_detach.sqf @@ -31,8 +31,8 @@ private _minDistance = 1000; { _x params ["_xObject", "_xItemName"]; - if (((getPos _unit) distance2d (getPos _xObject)) < _minDistance) then { - _minDistance = ((getPos _unit) distance2d (getPos _xObject)); + if (((getPos _unit) distance2D (getPos _xObject)) < _minDistance) then { + _minDistance = ((getPos _unit) distance2D (getPos _xObject)); _attachedObject = _xObject; _itemName = _xItemName; _attachedIndex = _forEachIndex; diff --git a/addons/attach/functions/fnc_placeApprove.sqf b/addons/attach/functions/fnc_placeApprove.sqf index 2f0c4d6b751..9e9f8effba4 100644 --- a/addons/attach/functions/fnc_placeApprove.sqf +++ b/addons/attach/functions/fnc_placeApprove.sqf @@ -48,10 +48,10 @@ while {(_closeInMax - _closeInMin) > 0.01} do { { if (_doesIntersect) exitWith {}; private _startingPosShifted = _startingPosition vectorAdd _x; - private _startASL = if (surfaceIsWater _startingPosShifted) then {_startingPosShifted} else {ATLtoASL _startingPosShifted}; + private _startASL = if (surfaceIsWater _startingPosShifted) then {_startingPosShifted} else {ATLToASL _startingPosShifted}; { private _endPosShifted = _endPosTest vectorAdd _x; - private _endASL = if (surfaceIsWater _startingPosShifted) then {_endPosShifted} else {ATLtoASL _endPosShifted}; + private _endASL = if (surfaceIsWater _startingPosShifted) then {_endPosShifted} else {ATLToASL _endPosShifted}; #ifdef DRAW_ATTACH_SCAN [{ diff --git a/addons/ballistics/stringtable.xml b/addons/ballistics/stringtable.xml index 71377352338..58d46f0d4f9 100644 --- a/addons/ballistics/stringtable.xml +++ b/addons/ballistics/stringtable.xml @@ -256,7 +256,7 @@ <Portuguese>Chumbo Grosso #0 Calibre Doze 2 Tiros</Portuguese> <Russian>12 Калибр 2 патр. #0 Картечь</Russian> <Turkish>12 kalibre 2 mermi #0 İrisaçma</Turkish> - <Korean>12 게이지 2발 #00 벅샷</Korean> + <Korean>12 게이지 2발 #0 벅샷</Korean> </Key> <Key ID="STR_ACE_Ballistics_2Rnd_12Gauge_Pellets_No1_Buck_Name"> <English>12 Gauge 2Rnd #1 Buckshot</English> @@ -479,7 +479,7 @@ <Portuguese>Carregador 6.5x47 mm com 20 cartuchos (HPBT Scenar)</Portuguese> <Hungarian>6,5x47 mm 20-lövedékes tár (HPBT Scenar)</Hungarian> <Japanese>6.5x47 mm 20Rnd マガジン (HPBT Scenar)</Japanese> - <Korean>20발 들이 6.5x47mm (HPBT Scenar)</Korean> + <Korean>6.5x47mm 20발 들이 탄창 (Scenar제 HPBT)</Korean> <Chinese>6.5x47毫米 20發 彈匣 (拉普 空尖艇尾狙擊專用彈)</Chinese> <Chinesesimp>6.5x47 mm 20发 弹匣(HPBT Scenar)</Chinesesimp> <Turkish>6.5x47 mm 20Rnd Mag (HPBT Scenar)</Turkish> @@ -513,7 +513,7 @@ <Portuguese>Calibre: 6.5x47 mm (HPBT Scenar)<br/>Cartuchos: 20<br/>Usado em: QBU-88</Portuguese> <Hungarian>Kaliber: 6,5x47 mm (HPBT Scenar)<br />Lövedékek: 20<br />Használható: QBU-88</Hungarian> <Japanese>口径: 6.5x47 mm (HPBT Scenar)<br />装填数: 20<br />次で使用: QBU-88</Japanese> - <Korean>구경: 6.5x47mm (HPBT Scenar)<br/>장탄수: 20<br/>사용처: QBU-88</Korean> + <Korean>구경: 6.5x47mm (Scenar제 보트 테일 할로우 포인트)<br/>장탄수: 20<br/>사용처: QBU-88</Korean> <Chinese>口徑: 6.5x47毫米 (拉普 空尖艇尾狙擊專用彈)<br />發數: 20<br />使用於: QBU-88</Chinese> <Chinesesimp>口径:6.5x47 mm(HPBT Scenar)<br />发数:20<br />使用于:QBU-88</Chinesesimp> <Turkish>Kalibre: 6.5x47 mm (HPBT Scenar)<br />Mermi: 20<br />Kullanıyor: QBU-88</Turkish> @@ -530,7 +530,7 @@ <Portuguese>Carregador 6.5 mm com 20 cartuchos Creedmor</Portuguese> <Hungarian>6,5 mm Creedmor 20-lövedékes tár</Hungarian> <Japanese>6.5 mm クリードモア 20Rnd マガジン</Japanese> - <Korean>20발 들이 6.5mm 크리드무어 탄창</Korean> + <Korean>6.5mm 크리드무어 20발 들이 탄창</Korean> <Chinese>6.5毫米 20發 彈匣 (克里德莫爾(CM) 狙擊專用彈)</Chinese> <Chinesesimp>6.5 mm 20发 弹匣(Creedmor)</Chinesesimp> <Turkish>6.5 mm Creedmor 20Rnd Mag</Turkish> @@ -581,7 +581,7 @@ <Portuguese>Carregador 5.8 mm com 10 cartuchos DBP88</Portuguese> <Hungarian>5,8 mm DBP88 10-lövedékes tár</Hungarian> <Japanese>5.8 mm DBP88 10Rnd マガジン</Japanese> - <Korean>10발 들이 5.8mm DBP88 탄창</Korean> + <Korean>5.8mm 10발 들이 탄창 (DBP88)</Korean> <Chinese>5.8毫米 10發 彈匣 (DBP88)</Chinese> <Chinesesimp>5.8 mm 10发 弹匣(DBP88)</Chinesesimp> <Turkish>5.8 mm DBP88 10Rnd Mag</Turkish> @@ -633,7 +633,7 @@ <Italian>Caricatore 6.5 mm 30cp Traccianti IR-DIM</Italian> <Russian>Магазин из 30-ти 6,5 мм ИК-трассирующих</Russian> <Japanese>6.5 mm 30Rnd IR-DIM トレーサー ケースレスマガジン</Japanese> - <Korean>30발 들이 6.5mm IR-DIM 예광탄 탄창</Korean> + <Korean>6.5mm 30발 들이 탄창 (IR-DIM 예광탄)</Korean> <Chinese>6.5毫米 30發 低視度紅外線曳光彈 彈匣</Chinese> <Chinesesimp>6.5 mm 30发 弹匣(红外曳光)</Chinesesimp> <Turkish>6.5 mm 30Rnd Tracer IR-DIM Mag</Turkish> @@ -667,7 +667,7 @@ <Italian>Calibro: 6.5x39 mm Tracciante IR-DIM <br />Munizioni: 30<br />In uso su: MX/C/M/SW/3GL</Italian> <Russian>Калибр: 6,5x39 мм ИК-трассирующие<br />Патронов: 30<br />Используются с: MX/C/M/SW/3GL</Russian> <Japanese>口径: 6.5x39 mm IR-DIM トレーサー<br />装填数: 30<br />次で使用: MX/C/M/SW/3GL</Japanese> - <Korean>구경: 6.5x39mm IR-DIM 예광탄<br/>장탄수: 30<br/>사용처: MX/C/M/SW/3GL</Korean> + <Korean>구경: 6.5x39mm IR-DIM 적외선 예광탄<br/>장탄수: 30<br/>사용처: MX/C/M/SW/3GL</Korean> <Chinese>口徑: 6.5x39毫米 低視度紅外線曳光彈<br />發數: 30<br />使用於: MX/C/M/SW/3GL</Chinese> <Chinesesimp>口径:6.5x39 mm 红外曳光<br />发数:30<br />使用于:MX/C/M/SW/3GL</Chinesesimp> <Turkish>Kalibre: 6.5x39 mm Tracer IR-DIM<br />Mermi: 30<br />Kullanıyor: MX/C/M/SW/3GL</Turkish> @@ -684,7 +684,7 @@ <Italian>Caricatore 6.5 mm 30cp Sil.</Italian> <Russian>Магазин из 30-ти 6,5 мм дозвуковых</Russian> <Japanese>6.5 mm 30Rnd 亜音速弾 マガジン</Japanese> - <Korean>30발 들이 6.5mm 아음속탄 탄창</Korean> + <Korean>6.5mm 30발 들이 탄창 (아음속탄)</Korean> <Chinese>6.5毫米 30發 消音彈 彈匣</Chinese> <Chinesesimp>6.5 mm 30发 弹匣(亚音速)</Chinesesimp> <Turkish>6.5 mm 30Rnd SD Mag</Turkish> @@ -735,7 +735,7 @@ <Italian>Caricatore 6.5 mm 30cp AP</Italian> <Russian>Магазин из 30-ти 6,5 мм бронебойных</Russian> <Japanese>6.5 mm 30Rnd 徹甲弾 マガジン</Japanese> - <Korean>30발 들이 6.5mm 철갑탄 탄창</Korean> + <Korean>6.5mm 30발 들이 탄창 (철갑탄)</Korean> <Chinese>6.5毫米30發 穿甲彈 彈匣</Chinese> <Chinesesimp>6.5 mm 30发 弹匣(穿甲)</Chinesesimp> <Turkish>6.5 mm 30Rnd AP Mag</Turkish> @@ -787,7 +787,7 @@ <Italian>Caricatore 6.5 mm 30cp Traccianti IR-DIM</Italian> <Russian>Магазин из 30-ти 6,5 мм ИК-трассирующих</Russian> <Japanese>6.5 mm 30Rnd IR-DIM トレーサー マガジン</Japanese> - <Korean>30발 들이 6.5mm IR-DIM 예광탄 탄창</Korean> + <Korean>6.5mm 30발 들이 탄창 (IR-DIM 예광탄)</Korean> <Chinese>6.5毫米 30發 低視度紅外線曳光彈 彈匣</Chinese> <Chinesesimp>6.5 mm 30发 弹匣(红外曳光)</Chinesesimp> <Turkish>6.5 mm 30Rnd Tracer IR-DIM Mag</Turkish> @@ -821,7 +821,7 @@ <Italian>Calibro: 6.5x39 mm Tracciant IR-DIM<br />Munizioni: 30<br />In uso su: Katiba</Italian> <Russian>Калибр: 6,5x39 мм ИК-трассирующие<br />Патронов: 30<br />Используются с: Katiba</Russian> <Japanese>口径: 6.5x39 mm IR-DIM トレーサー<br />装填数: 30<br />次で使用: Katiba</Japanese> - <Korean>구경: 6.5x39mm IR-DIM 예광탄<br/>장탄수: 30<br/>사용처: KH-2002</Korean> + <Korean>구경: 6.5x39mm IR-DIM 적외선 예광탄<br/>장탄수: 30<br/>사용처: KH-2002</Korean> <Chinese>口徑: 6.5x39毫米 低視度紅外線曳光彈<br />發數: 30<br />使用於: Katiba</Chinese> <Chinesesimp>口径:6.5x39 mm 红外曳光<br />发数:30<br />使用于:Katiba</Chinesesimp> <Turkish>Kalibre: 6.5x39 mm Tracer IR-DIM<br />Mermi: 30<br />Kullanıyor: Katiba</Turkish> @@ -838,7 +838,7 @@ <Italian>Caricatore 6.5 mm 30cp Sil.</Italian> <Russian>Магазин из 30-ти 6,5 мм дозвуковых</Russian> <Japanese>6.5 mm 30Rnd 亜音速弾 マガジン</Japanese> - <Korean>30발 들이 6.5mm 아음속탄 탄창</Korean> + <Korean>6.5mm 30발 들이 탄창 (아음속탄)</Korean> <Chinese>6.5毫米 30發 消音彈 彈匣</Chinese> <Chinesesimp>6.5 mm 30发 弹匣(亚音速)</Chinesesimp> <Turkish>6.5 mm 30Rnd SD Mag</Turkish> @@ -889,7 +889,7 @@ <Italian>Caricatore 6.5 mm 30cp AP</Italian> <Russian>Магазин из 30-ти 6,5 мм бронебойных</Russian> <Japanese>6.5 mm 30Rnd 徹甲弾 マガジン</Japanese> - <Korean>30발 들이 6.5mm 철갑탄 탄창</Korean> + <Korean>6.5mm 30발 들이 탄창 (철갑탄)</Korean> <Chinese>6.5毫米 30發 穿甲彈 彈匣</Chinese> <Chinesesimp>6.5 mm 30发 弹匣(穿甲)</Chinesesimp> <Turkish>6.5 mm 30Rnd AP Mag</Turkish> @@ -941,7 +941,7 @@ <Italian>Caricatore 5.56 mm 30cp Traccianti IR-DIM</Italian> <Russian>Магазин из 30-ти 5,56 мм ИК-трассирующих</Russian> <Japanese>5.56mm 30Rnd IR-DIM トレーサー マガジン</Japanese> - <Korean>30발 들이 5.56mm IR-DIM 예광탄 탄창</Korean> + <Korean>5.56mm 30발 들이 탄창 (IR-DIM 예광탄)</Korean> <Chinese>5.56毫米 30發 低視度紅外線曳光彈 彈匣</Chinese> <Chinesesimp>5.56 mm 30发 弹匣(红外曳光)</Chinesesimp> <Turkish>5.56 mm 30rnd Tracer IR-DIM Mag</Turkish> @@ -975,7 +975,7 @@ <Italian>Calibro: 5.56x45 mm Tracciante IR-DIM<br />Munizioni: 30<br />In uso su: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR</Italian> <Russian>Калибр: 5,56x45 мм ИК-трассирующие<br />Патронов: 30<br />Используются с: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR</Russian> <Japanese>口径: 5.56x45 mm IR-DIM トレーサー<br />装填数: 30<br />次で使用: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR</Japanese> - <Korean>구경: 5.56x45 mm IR-DIM 예광탄<br/>장탄수: 30<br/>사용처: CTAR-21, TAR-21/GTAR-21 EGLM, F2000/택티컬/EGLM, SDAR</Korean> + <Korean>구경: 5.56x45 mm IR-DIM 적외선 예광탄<br/>장탄수: 30<br/>사용처: CTAR-21, TAR-21/GTAR-21 EGLM, F2000/택티컬/EGLM, SDAR</Korean> <Chinese>口徑: 5.56x45毫米 低視度紅外線曳光彈<br />發數: 30<br />使用於: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR</Chinese> <Chinesesimp>口径:5.56x45 mm 红外曳光<br />发数:30<br />使用于:TRG-20,TRG-21/EGLM, Mk20/C/EGLM, SDAR</Chinesesimp> <Turkish>Kalibre: 5.56x45 mm Tracer IR-DIM<br />Mermi: 30<br />Kullanıyor: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR</Turkish> @@ -993,7 +993,7 @@ <Italian>Caricatore 7.62 mm 20cp Traccianti</Italian> <Russian>Магазин из 20-ти 7,62 мм трассирующих</Russian> <Japanese>7.62mm 20Rnd マガジン (トレーサー)</Japanese> - <Korean>20발 들이 7.62mm 예광탄 탄창</Korean> + <Korean>7.62mm 20발 들이 탄창 (예광탄)</Korean> <Chinese>7.62毫米 20發 曳光彈 彈匣</Chinese> <Chinesesimp>7.62 mm 20发 弹匣(曳光)</Chinesesimp> <Turkish>7.62 mm 20Rnd Mag (Tracer)</Turkish> @@ -1044,7 +1044,7 @@ <Italian>Caricatore 7.62 mm 20cp Traccianti IR-DIM</Italian> <Russian>Магазин из 20-ти 7,62 мм ИК-трассирующих</Russian> <Japanese>7.62mm 20Rnd マガジン (IR-DIM)</Japanese> - <Korean>20발 들이 7.62mm IR-DIM 예광탄 탄창</Korean> + <Korean>7.62mm 20발 들이 탄창 (IR-DIM 예광탄)</Korean> <Chinese>7.62毫米 20發 低視度紅外線曳光彈 彈匣</Chinese> <Chinesesimp>7.62 mm 20发 弹匣(红外曳光)</Chinesesimp> <Turkish>7.62 mm 20Rnd Mag (IR-DIM)</Turkish> @@ -1095,7 +1095,7 @@ <Italian>Caricatore 7.62 mm 20cp Sil.</Italian> <Russian>Магазин из 20-ти 7,62 мм дозвуковых</Russian> <Japanese>7.62mm 20Rnd マガジン (亜音速弾)</Japanese> - <Korean>20발 들이 7.62mm 아음속탄 탄창</Korean> + <Korean>7.62mm 20발 들이 탄창 (아음속탄)</Korean> <Chinese>7.62毫米 20發 消音彈 彈匣</Chinese> <Chinesesimp>7.62 mm 20发 弹匣(亚音速)</Chinesesimp> <Turkish>7.62 mm 20Rnd Mag (SD)</Turkish> @@ -1146,7 +1146,7 @@ <Italian>Caricatore 7.62 mm 10cp Traccianti</Italian> <Russian>Магазин из 10-ти 7,62 мм трассирующих</Russian> <Japanese>7.62mm 10Rnd マガジン (トレーサー)</Japanese> - <Korean>10발 들이 7.62mm 예광탄 탄창</Korean> + <Korean>7.62mm 10발 들이 탄창 (예광탄)</Korean> <Chinese>7.62毫米 10發 曳光彈 彈匣</Chinese> <Chinesesimp>7.62 mm 10发 弹匣(曳光)</Chinesesimp> <Turkish>7.62 mm 10Rnd Mag (Tracer)</Turkish> @@ -1197,7 +1197,7 @@ <Italian>Caricatore 7.62 mm 10cp Traccianti IR-DIM</Italian> <Russian>Магазин из 10-ти 7,62 мм ИК-трассирующих</Russian> <Japanese>7.62mm 10Rnd マガジン (IR-DIM)</Japanese> - <Korean>10발 들이 7.62mm IR-DIM 예광탄 탄창</Korean> + <Korean>7.62mm 10발 들이 탄창 (IR-DIM 예광탄)</Korean> <Chinese>7.62毫米 10發 低視度紅外線曳光彈 彈匣</Chinese> <Chinesesimp>7.62 mm 10发 弹匣(红外曳光)</Chinesesimp> <Turkish>7.62 mm 10Rnd Mag (IR-DIM)</Turkish> @@ -1231,7 +1231,7 @@ <Italian>Calibro: 7.62x51 mm Tracciante IR-DIM<br />Munizioni: 10<br />In uso su: Mk18 ABR</Italian> <Russian>Калибр: 7,62x51 мм ИК-трассирующие<br />Патронов: 10<br />Используются с: Mk18 ABR</Russian> <Japanese>口径: 7.62x51 mm IR-DIM トレーサー<br />装填数: 10<br />次で使用: Mk18 ABR</Japanese> - <Korean>구경: 7.62x51mm IR-DIM 예광탄<br/>장탄수: 10<br/>사용처: Mk.14 Mod 1 EBR</Korean> + <Korean>구경: 7.62x51mm IR-DIM 적외선 예광탄<br/>장탄수: 10<br/>사용처: Mk.14 Mod 1 EBR</Korean> <Chinese>口徑: 7.62x51毫米 低視度紅外線曳光彈<br />發數: 10<br />使用於: Mk18 ABR</Chinese> <Chinesesimp>口径:7.62x51 mm 红外曳光<br />发数:10<br />使用于:Mk18 ABR</Chinesesimp> <Turkish>Kalibre: 7.62x51 mm Tracer IR-DIM<br />Mermi: 10<br />Kullanıyor: Mk18 ABR</Turkish> @@ -1248,7 +1248,7 @@ <Italian>Caricatore 7.62 mm 10cp Sil.</Italian> <Russian>Магазин из 10-ти 7,62 мм дозвуковых</Russian> <Japanese>7.62mm 10Rnd マガジン (亜音速弾)</Japanese> - <Korean>10발 들이 7.62mm 아음속탄 탄창</Korean> + <Korean>7.62mm 10발 들이 탄창 (아음속탄)</Korean> <Chinese>7.62毫米 10發 消音彈 彈匣</Chinese> <Chinesesimp>7.62 mm 10发 弹匣(亚音速)</Chinesesimp> <Turkish>7.62 mm 10Rnd Mag (SD)</Turkish> @@ -1300,7 +1300,7 @@ <Portuguese>Cinto de munição .338 NM com 130 cartuchos</Portuguese> <Hungarian>.338 NM 130-lövedékes nyomkövető heveder</Hungarian> <Japanese>.338 NM 130Rnd トレーサー ベルト</Japanese> - <Korean>130발 들이 .338구경 노르마 매그넘 예광탄 벨트</Korean> + <Korean>.338구경 노르마 매그넘 130발 들이 벨트 (예광탄)</Korean> <Chinese>.338 拉普麥格農(NM) 130發 曳光彈 彈鏈</Chinese> <Chinesesimp>.338 NM 130发 弹链(曳光)</Chinesesimp> <Turkish>.338 NM 130Rnd Tracer Belt</Turkish> @@ -1351,7 +1351,7 @@ <Portuguese>Cinto de munição traçante .338 NM IR-DIM com 130 cartuchos</Portuguese> <Hungarian>.338 NM 130-lövedékes infravörös nyomkövető heveder</Hungarian> <Japanese>.338 NM 130Rnd IR-DIM ベルト</Japanese> - <Korean>130발 들이 .338rnrud 노르마 매그넘 IR-DIM 예광탄 벨트</Korean> + <Korean>.338구경 노르마 매그넘 130발 들이 벨트 (IR-DIM 예광탄)</Korean> <Chinese>.338 拉普麥格農(NM) 130發 低視度紅外線曳光彈 彈鏈</Chinese> <Chinesesimp>.338 NM 130发 弹链(红外曳光)</Chinesesimp> <Turkish>.338 NM 130Rnd IR-DIM Belt</Turkish> @@ -1385,7 +1385,7 @@ <Portuguese>Calibre: .338 Norma Magnum Traçante IR-DIM<br />Cartuchos: 130<br />Usado em: SPMG</Portuguese> <Hungarian>Kaliber: .338 Norma Magnum infravörös nyomkövető<br />Lövedékek: 130<br />Használható: SPMG</Hungarian> <Japanese>口径: .338 Norma Magnum IR-DIM トレーサー<br />装填数: 130<br />次で使用: SPMG</Japanese> - <Korean>구경: .338구경 노르마 매그넘 IR-DIM 예광탄<br/>장탄수: 130<br/>사용처: LWMMG</Korean> + <Korean>구경: .338구경 노르마 매그넘 IR-DIM 적외선 예광탄<br/>장탄수: 130<br/>사용처: LWMMG</Korean> <Chinese>口徑: .338 拉普麥格農 低視度紅外線曳光彈<br />發數: 130<br />使用於: SPMG</Chinese> <Chinesesimp>口径:.338 Norma Magnum 红外曳光<br />发数:130<br />使用于:SPMG</Chinesesimp> <Turkish>Kalibre: .338 Norma Magnum Tracer IR-DIM<br />Mermi: 130<br />Kullanıyor: SPMG</Turkish> @@ -1402,7 +1402,7 @@ <Portuguese>Cinto de munição .338 NM com 130 cartuchos AP</Portuguese> <Hungarian>.338 NM 130-lövedékes páncéltörő heveder</Hungarian> <Japanese>.338 NM 130Rnd 徹甲弾 ベルト</Japanese> - <Korean>130발 들이 .338구경 노르마 매그넘 철갑탄 벨트</Korean> + <Korean>.338구경 노르마 매그넘 130발 들이 벨트 (철갑탄)</Korean> <Chinese>.338 拉普麥格農(NM) 130發 穿甲彈 彈鏈</Chinese> <Chinesesimp>.338 NM 130发 弹链(穿甲)</Chinesesimp> <Turkish>.338 NM 130Rnd AP Belt</Turkish> @@ -1454,7 +1454,7 @@ <Portuguese>Carregador de 10 cartuchos 9.3 mm traçantes </Portuguese> <Hungarian>9,3 mm 10-lövedékes nyomkövető tár</Hungarian> <Japanese>9.3mm 10Rnd トレーサー マガジン</Japanese> - <Korean>10발 들이 9.3 mm 예광탄 탄창</Korean> + <Korean>9.3mm 10발 들이 탄창 (예광탄)</Korean> <Chinese>9.3毫米 10發 曳光彈 彈匣</Chinese> <Chinesesimp>9.3 mm 10发 弹匣(曳光)</Chinesesimp> <Turkish>9.3 mm 10Rnd Tracer Mag</Turkish> @@ -1505,7 +1505,7 @@ <Portuguese>Carregador de 10 cartuchos 9.3 mm traçantes IR-DIM</Portuguese> <Hungarian>9,3 mm 10-lövedékes infravörös nyomkövető tár</Hungarian> <Japanese>9.3mm 10Rnd IR-DIM トレーサー マガジン</Japanese> - <Korean>10발 들이 9.3mm IR-DIM 예광탄 탄창</Korean> + <Korean>9.3mm 10발 들이 탄창 (IR-DIM 예광탄)</Korean> <Chinese>9.3毫米 10發 低視度紅外線曳光彈 彈匣</Chinese> <Chinesesimp>9.3 mm 10发 弹匣(红外曳光)</Chinesesimp> <Turkish>9.3 mm 10Rnd Tracer IR-DIM Mag</Turkish> @@ -1539,7 +1539,7 @@ <Portuguese>Calibre: 9.3x64 mm Traçante IR-DIM<br />Cartuchos: 10<br />Usado em: Cyrus</Portuguese> <Hungarian>Kaliber: 9,3x64 mm infravörös nyomkövető<br />Lövedékek: 10<br /> Használható: Cyrus</Hungarian> <Japanese>口径: 9.3x64 mm IR-DIM トレーサー<br />装填数: 10<br />次で使用: Cyrus</Japanese> - <Korean>구경: 9.3x64mm IR-DIM 예광탄<br/>장탄수: 10<br/>사용처: 사이러스</Korean> + <Korean>구경: 9.3x64mm IR-DIM 적외선 예광탄<br/>장탄수: 10<br/>사용처: 사이러스</Korean> <Chinese>口徑: 9.3x64毫米 低視度紅外線曳光彈<br />發數: 10<br />使用於: Cyrus</Chinese> <Chinesesimp>口径:9.3x64 mm 红外曳光<br />发数:10<br />使用于:"居鲁士"</Chinesesimp> <Turkish>Kalibre: 9.3x64 mm Tracer IR-DIM<br />Mermi: 10<br />Kullanıyor: Cyrus</Turkish> @@ -1557,7 +1557,7 @@ <Portuguese>Cinto de munição traçante 9.3 mm com 150 cartuchos</Portuguese> <Hungarian>9,3 mm 150-lövedékes nyomkövető heveder</Hungarian> <Japanese>9.3mm 150Rnd トレーサー ベルト</Japanese> - <Korean>150발 들이 9.3mm 예광탄 벨트</Korean> + <Korean>9.3mm 150발 들이 벨트 (예광탄)</Korean> <Chinese>9.3毫米 150發 曳光彈 彈鏈</Chinese> <Chinesesimp>9.3 mm 150发 弹链(曳光)</Chinesesimp> <Turkish>9.3 mm 150Rnd Tracer Belt</Turkish> @@ -1608,7 +1608,7 @@ <Portuguese>Cinto de munição traçante 9.3 mm IR-DIM com 150 cartuchos</Portuguese> <Hungarian>9,3 mm 150-lövedékes infravörös nyomkövető heveder</Hungarian> <Japanese>9.3mm 150Rnd IR-DIM トレーサー ベルト</Japanese> - <Korean>150발 들이 9.3mm IR-DIM 예광탄 벨트</Korean> + <Korean>9.3mm 150발 들이 벨트 (IR-DIM 예광탄)</Korean> <Chinese>9.3毫米 150發 低視度紅外線曳光彈 彈鏈</Chinese> <Chinesesimp>9.3 mm 150发 弹链(红外曳光)</Chinesesimp> <Turkish>9.3 mm 150Rnd Tracer IR-DIM Belt</Turkish> @@ -1642,7 +1642,7 @@ <Portuguese>Calibre: 9.3x64 mm Traçante IR-DIM<br />Cartuchos: 150<br />Usado em: Navid</Portuguese> <Hungarian>Kaliber: 9,3x64 mm infravörös nyomkövető<br />Lövedékek: 150<br />Használható: Navid</Hungarian> <Japanese>口径: 9.3x64 mm IR-DIM トレーサー<br />装填数: 150<br />次で使用: Navid</Japanese> - <Korean>구경: 9.3x64mm IR-DIM 예광탄<br/>장탄수: 150<br/>사용처: HK121</Korean> + <Korean>구경: 9.3x64mm IR-DIM 적외선 예광탄<br/>장탄수: 150<br/>사용처: HK121</Korean> <Chinese>口徑: 9.3x64毫米 低視度紅外線曳光彈<br />發數: 150<br />使用於: Navid</Chinese> <Chinesesimp>口径:9.3x64 mm 红外曳光<br />发数:150<br />使用于:Navid</Chinesesimp> <Turkish>Kalibre: 9.3x64 mm Tracer IR-DIM<br />Mermi: 150<br />Kullanıyor: Navid</Turkish> @@ -1659,7 +1659,7 @@ <Portuguese>Cinto de munição 9.3 mm AP com 150 cartuchos</Portuguese> <Hungarian>9,3 mm 150-lövedékes páncéltörő heveder</Hungarian> <Japanese>9.3mm 150Rnd 徹甲弾 ベルト</Japanese> - <Korean>150발 들이 9.3mm 철갑탄 벨트</Korean> + <Korean>9.3mm 150발 들이 벨트 (철갑탄)</Korean> <Chinese>9.3毫米 150發 穿甲彈 彈鏈</Chinese> <Chinesesimp>9.3 mm 150发 弹链(穿甲)</Chinesesimp> <Turkish>9.3 mm 150Rnd AP Belt</Turkish> @@ -1710,7 +1710,7 @@ <Portuguese>Carregador de 16 cartuchos 9x19 mm</Portuguese> <Hungarian>9x19 mm 16-lövedékes tár</Hungarian> <Japanese>9x19 mm 16Rnd マガジン</Japanese> - <Korean>16발 들이 9x19mm 탄창</Korean> + <Korean>9x19mm 16발 들이 탄창</Korean> <Chinese>9x19毫米 16發 彈匣</Chinese> <Chinesesimp>9x19 mm 16发 弹匣</Chinesesimp> <Turkish>9x19 mm 16Rnd Mag</Turkish> @@ -1744,7 +1744,7 @@ <Portuguese>Carregador de 16 cartuchos 9x19 mm</Portuguese> <Hungarian>9x19 mm 16-lövedékes tár</Hungarian> <Japanese>9x19 mm 30Rnd マガジン</Japanese> - <Korean>30발 들이 9x19mm 탄창</Korean> + <Korean>9x19mm 30발 들이 탄창</Korean> <Chinese>9x19毫米 30發 彈匣</Chinese> <Chinesesimp>9x19 mm 30发 弹匣</Chinesesimp> <Turkish>9x19 mm 30Rnd Mag</Turkish> @@ -1761,7 +1761,7 @@ <Portuguese>Carregador de 30 cartuchos 9x19 mm</Portuguese> <Hungarian>9x19 mm 30-lövedékes tár</Hungarian> <Japanese>9x19 mm 30Rnd マガジン</Japanese> - <Korean>30발 들이 9x19mm 탄창</Korean> + <Korean>9x19mm 30발 들이 탄창</Korean> <Chinese>9x19毫米 30發 彈匣</Chinese> <Chinesesimp>9x19 mm 30发 弹匣</Chinesesimp> <Turkish>9x19 mm 30Rnd Mag</Turkish> @@ -1795,7 +1795,7 @@ <Portuguese>Carregador de 30 cartuchos 9x19 mm</Portuguese> <Hungarian>9x19 mm 30-lövedékes tár</Hungarian> <Japanese>9x19 mm 30Rnd マガジン</Japanese> - <Korean>30발 들이 9x19mm 탄창</Korean> + <Korean>9x19mm 30발 들이 탄창</Korean> <Chinese>9x19毫米 30發 彈匣</Chinese> <Chinesesimp>9x19 mm 30发 弹匣</Chinesesimp> <Turkish>9x19 mm 30Rnd Mag</Turkish> @@ -1812,7 +1812,7 @@ <Portuguese>Carregador com 10 cartuchos 7.62x54 mm Traçante</Portuguese> <Hungarian>7,62x54 mm 10-lövedékes nyomkövető tár</Hungarian> <Japanese>7.62mm 10Rnd マガジン (トレーサー)</Japanese> - <Korean>10발 들이 7.62x54mm 예광탄 탄창</Korean> + <Korean>7.62x54mmR 10발 들이 탄창 (예광탄)</Korean> <Chinese>7.62x54毫米 10發 曳光彈 彈匣</Chinese> <Chinesesimp>7.62x54 mm 10发 弹匣(曳光)</Chinesesimp> <Turkish>7.62x54 mm 10Rnd Tracer Mag</Turkish> @@ -1846,7 +1846,7 @@ <Portuguese>Carregador com 10 cartuchos 7.62x54 mm Traçante</Portuguese> <Hungarian>7,62x54 mm 10-lövedékes nyomkövető tár</Hungarian> <Japanese>口径: 7.62x54 mm トレーサー<br />弾薬: 10<br />使用: ラヒム</Japanese> - <Korean>10발 들이 7.62x54mm 예광탄 탄창</Korean> + <Korean>7.62x54mmR 10발 들이 탄창 (예광탄)</Korean> <Chinese>7.62x54毫米 10發 曳光彈 彈匣</Chinese> <Chinesesimp>7.62x54 mm 10发 弹匣(曳光)</Chinesesimp> <Turkish>7.62x54 mm 10Rnd Tracer Mag</Turkish> @@ -1863,7 +1863,7 @@ <Portuguese>Carregador com 100 cartuchos 6.5 mm IR-DIM Traçante</Portuguese> <Hungarian>6,5 mm 100-lövedékes infravörös nyomkövető tár</Hungarian> <Japanese>6.5mm 100Rnd IR-DIM トレーサー マガジン</Japanese> - <Korean>100발 들이 6.5mm IR-DIM 예광탄 탄창</Korean> + <Korean>6.5mm 100발 들이 탄창 (IR-DIM 예광탄)</Korean> <Chinese>6.5毫米 100發 低視度紅外線曳光彈 彈匣</Chinese> <Chinesesimp>6.5 mm 100发 弹匣(红外曳光)</Chinesesimp> <Turkish>6.5 mm 100Rnd Tracer IR-DIM Mag</Turkish> @@ -1897,7 +1897,7 @@ <Portuguese>Carregador 6.5 mm 100 Cartuchos Traçantes IR-DIM<br />Cartuchos: 100<br />Usado em: MX LSW</Portuguese> <Hungarian>6.5 mm 100-lövedékes infravörös nyomkövető tár<br />Lövedékek: 100<br />Használható: MX LSW</Hungarian> <Japanese>6.5 mm 100Rnd IR-DIM トレーサー マガジン<br />装填数: 100<br />次で使用: MX LSW</Japanese> - <Korean>6.5mm IR-DIM 예광탄<br/>장탄수: 100<br/>사용처: MX LSW</Korean> + <Korean>6.5mm IR-DIM 적외선 예광탄<br/>장탄수: 100<br/>사용처: MX LSW</Korean> <Chinese>6.5毫米 100發 低視度紅外線曳光彈<br />發數: 100<br />使用於: MX LSW</Chinese> <Chinesesimp>口径:6.5 mm 100发 红外曳光<br />发数:100<br />使用于:MX LSW</Chinesesimp> <Turkish>6.5 mm 100Rnd Tracer IR-DIM Mag<br />Mermi: 100<br />Kullanıyor: MX LSW</Turkish> @@ -1914,7 +1914,7 @@ <Portuguese>Cinto de munição traçante 6.5 mm IR-DIM com 200 cartuchos</Portuguese> <Hungarian>6,5 mm 200-lövedékes infravörös nyomkövető heveder</Hungarian> <Japanese>6.5mm 200Rnd ベルト トレーサー(IR-DIM)</Japanese> - <Korean>200발 들이 6.5mm IR-DIM 예광탄 탄창</Korean> + <Korean>6.5mm 200발 들이 탄창 (IR-DIM 예광탄)</Korean> <Chinese>6.5毫米 200發 低視度紅外線曳光彈 彈鏈</Chinese> <Chinesesimp>6.5 mm 200发 弹链(红外曳光)</Chinesesimp> <Turkish>6.5 mm 200Rnd Belt Tracer (IR-DIM)</Turkish> @@ -1948,7 +1948,7 @@ <Portuguese>Cinto de munição traçante 6.5 mm IR-DIM com 200 cartuchos<br />Cartuchos: 200<br />Usado em: Stoner 99 LMG</Portuguese> <Hungarian>6.5 mm 200-lövedékes infravörös nyomkövető heveder<br />Lövedékek: 200<br />Használható: Stoner 99 LMG</Hungarian> <Japanese>6.5 mm 200Rnd ベルト トレーサー (IR-DIM)<br />装填数: 200<br />次で使用: Stoner 99 LMG</Japanese> - <Korean>200발 들이 6.5mm IR-DIM 예광탄 벨트<br/>장탄수: 200<br/>사용처: 스토너 99 LMG</Korean> + <Korean>6.5mm IR-DIM 적외선 예광탄 벨트<br/>장탄수: 200<br/>사용처: 스토너 99 LMG</Korean> <Chinese>6.5毫米 200發 低視度紅外線曳光彈<br />發數: 200<br />使用於: Stoner 99 重機槍</Chinese> <Chinesesimp>口径:6.5 mm 200发 红外曳光<br />发数:200<br />使用于:Stoner 99 LMG</Chinesesimp> <Turkish>6.5 mm 200Rnd Belt Tracer (IR-DIM)<br />Mermi: 200<br />Kullanıyor: Stoner 99 LMG</Turkish> @@ -1965,7 +1965,7 @@ <Portuguese>Carregador 5.56 mm com 30 cartuchos (Mk262)</Portuguese> <Hungarian>5,56 mm 30-lövedékes tár (Mk262)</Hungarian> <Japanese>5.56mm 30Rnd マガジン (Mk262)</Japanese> - <Korean>30발 들이 5.56mm 탄창 (Mk.262)</Korean> + <Korean>5.56mm 30발 들이 탄창 (Mk.262)</Korean> <Chinese>5.56毫米 30發 彈匣 (Mk262 狙擊專用彈)</Chinese> <Chinesesimp>5.56 mm 30发 弹匣(Mk262)</Chinesesimp> <Turkish>5.56 mm 30Rnd Mag (Mk262)</Turkish> @@ -1999,7 +1999,7 @@ <Portuguese>Calibre: 5.56x45 mm NATO (Mk262)<br/>Cartuchos: 30</Portuguese> <Hungarian>Kaliber: 5,56x45 mm NATO (Mk262)<br />Lövedékek: 30</Hungarian> <Japanese>口径: 5.56x45 mm NATO (Mk262)<br />装填数: 30</Japanese> - <Korean>구경: 5.56x45mm NATO (Mk.262)<br/>장탄수: 30</Korean> + <Korean>구경: 5.56x45mm NATO (Mk.262 매치그레이드)<br/>장탄수: 30</Korean> <Chinese>口徑: 5.56x45毫米 NATO標準 (Mk262 狙擊專用彈)<br />發數: 30</Chinese> <Chinesesimp>口径:5.56x45 mm 北约(Mk262 狙击专用弹)<br />发数:30</Chinesesimp> <Turkish>Kalibre: 5.56x45 mm NATO (Mk262)<br />Mermi: 30</Turkish> @@ -2016,7 +2016,7 @@ <Portuguese>Carregador 5.56 mm com 30 cartuchos (Mk318)</Portuguese> <Hungarian>5,56 mm 30-lövedékes tár (Mk318)</Hungarian> <Japanese>5.56mm 30Rnd マガジン (Mk318)</Japanese> - <Korean>30발 들이 5.56mm 탄창 (Mk.318)</Korean> + <Korean>5.56mm 30발 들이 탄창 (Mk.318)</Korean> <Chinese>5.56毫米 30發 彈匣 (Mk318 特戰專用彈)</Chinese> <Chinesesimp>5.56 mm 30发 弹匣(Mk318)</Chinesesimp> <Turkish>5.56 mm 30Rnd Mag (Mk318)</Turkish> @@ -2067,7 +2067,7 @@ <Portuguese>Carregador 5.56 mm com 30 cartuchos (M995 AP)</Portuguese> <Hungarian>5,56 mm 30-lövedékes tár (M995 páncéltörő)</Hungarian> <Japanese>5.56mm 30Rnd マガジン (M995 徹甲弾)</Japanese> - <Korean>30발 들이 5.56mm 탄창 (M995 철갑탄)</Korean> + <Korean>5.56mm 30발 들이 탄창 (M995)</Korean> <Chinese>5.56毫米 30發 彈匣 (M995 穿甲彈)</Chinese> <Chinesesimp>5.56 mm 30发 弹匣(M995 穿甲)</Chinesesimp> <Turkish>5.56 mm 30Rnd Mag (M995 AP)</Turkish> @@ -2118,7 +2118,7 @@ <Portuguese>Carregador 7.62 mm com 10 cartuchos (M118LR)</Portuguese> <Hungarian>7,62 mm 10-lövedékes tár (M118LR)</Hungarian> <Japanese>7.62mm 10Rnd マガジン (M118LR)</Japanese> - <Korean>10발 들이 7.62mm 탄창 (M118LR)</Korean> + <Korean>7.62mm 10발 들이 탄창 (M118LR)</Korean> <Chinese>7.62毫米 10發 彈匣 (M118LR 狙擊專用彈)</Chinese> <Chinesesimp>7.62 mm 10发 弹匣(M118LR)</Chinesesimp> <Turkish>7.62 mm 10Rnd Mag (M118LR)</Turkish> @@ -2152,7 +2152,7 @@ <Portuguese>Calibre: 7.26x51 mm NATO (M118LR)<br/>Cartuchos: 10</Portuguese> <Hungarian>Kaliber: 7,62x51 mm NATO (M118LR)<br />Lövedékek: 10</Hungarian> <Japanese>口径: 7.62x51 mm NATO (M118LR)<br />装填数: 10</Japanese> - <Korean>구경: 7.62x51mm NATO (M118LR)<br/>장탄수: 10</Korean> + <Korean>구경: 7.62x51mm NATO (M118LR 할로우 포인트 매치그레이드)<br/>장탄수: 10</Korean> <Chinese>口徑: 7.62x51毫米 NATO標準 (M118LR 狙擊專用彈)<br />發數: 10</Chinese> <Chinesesimp>口径:7.62x51 mm 北约(M118LR 狙击专用弹)<br />发数:10</Chinesesimp> <Turkish>Kalibre: 7.62x51 mm NATO (M118LR)<br />Mermi: 10</Turkish> @@ -2169,7 +2169,7 @@ <Portuguese>Carregador 7.62 mm com 20 cartuchos (M118LR)</Portuguese> <Hungarian>7,62 mm 20-lövedékes tár (M118LR)</Hungarian> <Japanese>7.62mm 20Rnd マガジン (M118LR)</Japanese> - <Korean>20발 들이 7.62mm 탄창 (M118LR)</Korean> + <Korean>7.62mm 20발 들이 탄창 (M118LR)</Korean> <Chinese>7.62毫米 20發 彈匣 (M118LR 狙擊專用彈)</Chinese> <Chinesesimp>7.62 mm 20发 弹匣(M118LR)</Chinesesimp> <Turkish>7.62 mm 20Rnd Mag (M118LR)</Turkish> @@ -2203,7 +2203,7 @@ <Portuguese>Calibre: 7.26x51 mm NATO (M118LR)<br/>Cartuchos: 20</Portuguese> <Hungarian>Kaliber: 7,62x51 mm NATO (M118LR)<br />Lövedékek: 20</Hungarian> <Japanese>口径: 7.62x51 mm NATO (M118LR)<br />装填数: 20</Japanese> - <Korean>구경: 7.62x51mm NATO (M118LR)<br/>장탄수: 20</Korean> + <Korean>구경: 7.62x51mm NATO (M118LR 할로우 포인트 매치그레이드)<br/>장탄수: 20</Korean> <Chinese>口徑: 7.62x51毫米 NATO標準 (M118LR 狙擊專用彈)<br />發數: 20</Chinese> <Chinesesimp>口径:7.62x51 mm 北约(M118LR 狙击专用弹)<br />发数:20</Chinesesimp> <Turkish>Kalibre: 7.62x51 mm NATO (M118LR)<br />Mermi: 20</Turkish> @@ -2220,7 +2220,7 @@ <Portuguese>Carregador 7.62 mm com 10 cartuchos (Mk316 Mod 0)</Portuguese> <Hungarian>7,62 mm 10-lövedékes tár (Mk316 Mod 0)</Hungarian> <Japanese>7.62mm 10Rnd マガジン (Mk316 Mod 0)</Japanese> - <Korean>10발 들이 7.62mm 탄창 (Mk.316 Mod 0)</Korean> + <Korean>7.62mm 10발 들이 탄창 (Mk.316 Mod 0)</Korean> <Chinese>7.62毫米 10發 彈匣 (Mk316 Mod 0 狙擊專用彈)</Chinese> <Chinesesimp>7.62 mm 10发 弹匣(Mk316 Mod 0)</Chinesesimp> <Turkish>7.62 mm 10Rnd Mag (Mk316 Mod 0)</Turkish> @@ -2271,7 +2271,7 @@ <Portuguese>Carregador 7.62 mm com 20 cartuchos (Mk316 Mod 0)</Portuguese> <Hungarian>7,62 mm 20-lövedékes tár (Mk316 Mod 0)</Hungarian> <Japanese>7.62mm 20Rnd マガジン (Mk316 Mod 0)</Japanese> - <Korean>20발 들이 7.62mm 탄창 (Mk.316 Mod 0)</Korean> + <Korean>7.62mm 20발 들이 탄창 (Mk.316 Mod 0)</Korean> <Chinese>7.62毫米 20發 彈匣 (Mk316 Mod 0 狙擊專用彈)</Chinese> <Chinesesimp>7.62 mm 20发 弹匣(Mk316 Mod 0)</Chinesesimp> <Turkish>7.62 mm 20Rnd Mag (Mk316 Mod 0)</Turkish> @@ -2305,7 +2305,7 @@ <Portuguese>Calibre: 7.26x51 mm NATO (Mk316 Mod 0)<br/>Cartuchos: 20</Portuguese> <Hungarian>Kaliber: 7,62x51 mm NATO (Mk316 Mod 0)<br />Lövedékek: 20</Hungarian> <Japanese>口径: 7.62x51 mm NATO (Mk316 Mod 0)<br />装填数: 20</Japanese> - <Korean>구경: 7.62x51mm NATO (Mk.316 Mod 0)<br/>장탄수: 20</Korean> + <Korean>구경: 7.62x51mm NATO (Mk.316 Mod 0 특수작전용 장거리 저격 탄환)<br/>장탄수: 20</Korean> <Chinese>口徑: 7.62x51毫米 NATO標準 (Mk316 Mod 0 狙擊專用彈)<br />發數: 20</Chinese> <Chinesesimp>口径:7.62x51 mm 北约(Mk316 Mod 0 狙击专用弹)<br />发数:20</Chinesesimp> <Turkish>Kalibre: 7.62x51 mm NATO (Mk316 Mod 0)<br />Mermi: 20</Turkish> @@ -2322,7 +2322,7 @@ <Portuguese>Carregador 7.62 mm com 10 cartuchos (Mk319 Mod 0)</Portuguese> <Hungarian>7,62 mm 10-lövedékes tár (Mk319 Mod 0)</Hungarian> <Japanese>7.62mm 10Rnd マガジン (Mk319 Mod 0)</Japanese> - <Korean>10발 들이 7.62mm 탄창 (Mk.319 Mod 0)</Korean> + <Korean>7.62mm 10발 들이 탄창 (Mk.319 Mod 0)</Korean> <Chinese>7.62毫米 10發 彈匣 (Mk319 Mod 0 特戰專用彈)</Chinese> <Chinesesimp>7.62 mm 10发 弹匣(Mk319 Mod 0)</Chinesesimp> <Turkish>7.62 mm 10Rnd Mag (Mk319 Mod 0)</Turkish> @@ -2356,7 +2356,7 @@ <Portuguese>Calibre: 7.26x51 mm NATO (Mk319 Mod 0)<br/>Cartuchos: 10</Portuguese> <Hungarian>Kaliber: 7,62x51 mm NATO (Mk319 Mod 0)<br />Lövedékek: 10</Hungarian> <Japanese>口径: 7.62x51 mm NATO (Mk319 Mod 0)<br />装填数: 10</Japanese> - <Korean>구경: 7.62x51mm NATO (Mk.319 Mod 0)<br/>장탄수: 10</Korean> + <Korean>구경: 7.62x51mm NATO (Mk.319 Mod 0 단총신 카빈 성능향상 탄환)<br/>장탄수: 10</Korean> <Chinese>口徑: 7.62x51毫米 NATO標準 (Mk319 Mod 0 特戰專用彈)<br />發數: 10</Chinese> <Chinesesimp>口径:7.62x51 mm 北约(Mk319 Mod 0 特战专用弹)<br />发数:10</Chinesesimp> <Turkish>Kalibre: 7.62x51 mm NATO (Mk319 Mod 0)<br />Mermi: 20</Turkish> @@ -2373,7 +2373,7 @@ <Portuguese>Carregador 7.62 mm com 20 cartuchos (Mk319 Mod 0)</Portuguese> <Hungarian>7,62 mm 20-lövedékes tár (Mk319 Mod 0)</Hungarian> <Japanese>7.62mm 20Rnd マガジン (Mk319 Mod 0)</Japanese> - <Korean>20들이 7.62mm 탄창 (Mk.319 Mod 0)</Korean> + <Korean>7.62mm 20발 들이 탄창 (Mk.319 Mod 0)</Korean> <Chinese>7.62毫米 20發 彈匣 (Mk319 Mod 0 特戰專用彈)</Chinese> <Chinesesimp>7.62 mm 20发 弹匣(Mk319 Mod 0)</Chinesesimp> <Turkish>7.62 mm 20Rnd Mag (Mk319 Mod 0)</Turkish> @@ -2407,7 +2407,7 @@ <Portuguese>Calibre: 7.26x51 mm NATO (Mk319 Mod 0)<br/>Cartuchos: 20</Portuguese> <Hungarian>Kaliber: 7,62x51 mm NATO (Mk319 Mod 0)<br />Lövedékek: 20</Hungarian> <Japanese>口径: 7.62x51 mm NATO (Mk319 Mod 0)<br />装填数: 20</Japanese> - <Korean>구경: 7.62x51mm NATO (Mk.319 Mod 0)<br/>장탄수: 20</Korean> + <Korean>구경: 7.62x51mm NATO (Mk.319 Mod 0 단총신 카빈 성능향상 탄환)<br/>장탄수: 20</Korean> <Chinese>口徑: 7.62x51毫米 NATO標準 (Mk319 Mod 0 特戰專用彈)<br />發數: 20</Chinese> <Chinesesimp>口径:7.62x51 mm 北约(Mk319 Mod 0)<br />发数:20</Chinesesimp> <Turkish>Kalibre: 7.62x51 mm NATO (Mk319 Mod 0)<br />Mermi: 20</Turkish> @@ -2424,7 +2424,7 @@ <Portuguese>Carregador 7.62 mm com 10 cartuchos (M993 AP)</Portuguese> <Hungarian>7,62 mm 10-lövedékes tár (M993 páncéltörő)</Hungarian> <Japanese>7.62mm 10Rnd マガジン (M993 徹甲弾)</Japanese> - <Korean>10발 들이 7.62mm 탄창 (M993 철갑탄)</Korean> + <Korean>7.62mm 10발 들이 탄창 (M993)</Korean> <Chinese>7.62毫米 10發 彈匣 (M993 穿甲專用彈)</Chinese> <Chinesesimp>7.62 mm 10发 弹匣(M993 穿甲)</Chinesesimp> <Turkish>7.62 mm 10Rnd Mag (M993 AP)</Turkish> @@ -2475,7 +2475,7 @@ <Portuguese>Carregador 7.62 mm com 20 cartuchos (M993 AP)</Portuguese> <Hungarian>7,62 mm 20-lövedékes tár (M993 páncéltörő)</Hungarian> <Japanese>7.62mm 20Rnd マガジン (M993 徹甲弾)</Japanese> - <Korean>20발 들이 7.62mm 탄창 (M993 철갑탄)</Korean> + <Korean>7.62mm 20발 들이 탄창 (M993)</Korean> <Chinese>7.62毫米 20發 彈匣 (M993 穿甲專用彈)</Chinese> <Chinesesimp>7.62 mm 20发 弹匣(M993 穿甲)</Chinesesimp> <Turkish>7.62 mm 20Rnd Mag (M993 AP)</Turkish> @@ -2526,7 +2526,7 @@ <Portuguese>Carregador .300 WM com 20 cartuchos (Mk248 Mod 0)</Portuguese> <Hungarian>.300 WM 20-lövedékes tár (Mk248 Mod 0)</Hungarian> <Japanese>.300 WM 20Rnd マガジン (Mk248 Mod 0)</Japanese> - <Korean>20발 들이 .300구경 윈체스터 매그넘 탄창 (Mk.248 Mod 0)</Korean> + <Korean>.300구경 윈체스터 매그넘 20발 들이 탄창 (Mk.248 Mod 0)</Korean> <Chinese>.300 萬能(WM) 20發 彈匣 (Mk248 Mod 0 狙擊專用彈)</Chinese> <Chinesesimp>.300 WM 20发 弹匣(Mk248 Mod 0)</Chinesesimp> <Turkish>.300 WM 20Rnd Mag (Mk248 Mod 0)</Turkish> @@ -2560,7 +2560,7 @@ <Portuguese>Calibre: .300 WM NATO (Mk248 Mod 0)<br/>Cartuchos: 20</Portuguese> <Hungarian>Kaliber: .300 WM NATO (Mk248 Mod 0)<br />Lövedékek: 20</Hungarian> <Japanese>口径: .300 WM NATO (Mk248 Mod 0)<br />装填数: 20</Japanese> - <Korean>구경: .300 윈체스터 매그넘 (Mk.248 Mod 0)<br/>장탄수: 20</Korean> + <Korean>구경: .300 윈체스터 매그넘 (Mk.248 Mod 0 장거리 저격용 탄환)<br/>장탄수: 20</Korean> <Chinese>口徑: .300 西米 NATO標準 (Mk248 Mod 0 狙擊專用彈)<br />發數: 20</Chinese> <Chinesesimp>口径:.300 WM 北约(Mk248 Mod 0 狙击专用弹)<br />发数:20</Chinesesimp> <Turkish>Kalibre: .300 WM NATO (Mk248 Mod 0)<br />Mermi: 20</Turkish> @@ -2577,7 +2577,7 @@ <Portuguese>Carregador .300 WM com 20 cartuchos (Mk248 Mod 1)</Portuguese> <Hungarian>.300 WM 20-lövedékes tár (Mk248 Mod 1)</Hungarian> <Japanese>.300 WM 20Rnd マガジン (Mk248 Mod 1)</Japanese> - <Korean>20발 들이 .300구경 윈체스터 매그넘 탄창 (Mk.248 Mod 1)</Korean> + <Korean>.300구경 윈체스터 매그넘 20발 들이 탄창 (Mk.248 Mod 1)</Korean> <Chinese>.300 西米 20發 彈匣 (Mk248 Mod 1 狙擊專用彈)</Chinese> <Chinesesimp>.300 WM 20发 弹匣(Mk248 Mod 1)</Chinesesimp> <Turkish>.300 WM 20Rnd Mag (Mk248 Mod 1)</Turkish> @@ -2611,7 +2611,7 @@ <Portuguese>Calibre: .300 WM NATO (Mk248 Mod 1)<br/>Cartuchos: 20</Portuguese> <Hungarian>Kaliber: .300 WM NATO (Mk248 Mod 1)<br />Lövedékek: 20</Hungarian> <Japanese>口径: .300 WM NATO (Mk248 Mod 1)<br />装填数: 20</Japanese> - <Korean>구경: .300구경 윈체스터 매그넘 (Mk.248 Mod 1)<br/>장탄수: 20</Korean> + <Korean>구경: .300구경 윈체스터 매그넘 (Mk.248 Mod 1 개선판 장거리 저격용 탄환)<br/>장탄수: 20</Korean> <Chinese>口徑: .300 西米 NATO標準 (Mk248 Mod 1 狙擊專用彈)<br />發數: 20</Chinese> <Chinesesimp>口径:.300 WM 北约(Mk248 Mod 1 狙击专用弹)<br />发数:20</Chinesesimp> <Turkish>Kalibre: .300 WM NATO (Mk248 Mod 1)<br />Mermi: 20</Turkish> @@ -2628,7 +2628,7 @@ <Portuguese>Carregador .300 WM com 20 cartuchos (Berger Hybrid OTM)</Portuguese> <Hungarian>.300 WM 20-lövedékes tár (Berger Hybrid OTM)</Hungarian> <Japanese>.300 WM 20Rnd マガジン (Berger Hybrid OTM)</Japanese> - <Korean>20발 들이 .300구경 윈체스터 매그넘 탄창 (Berger Hybrid OTM)</Korean> + <Korean>.300구경 윈체스터 매그넘 20발 들이 탄창 (Berger제 하이브리드 OTM)</Korean> <Chinese>.300 西米 20發 彈匣 (Berger Hybrid 空尖比賽專用彈)</Chinese> <Chinesesimp>.300 WM 20发 弹匣(Berger Hybrid 空尖)</Chinesesimp> <Turkish>.300 WM 20Rnd Mag (Berger Hybrid OTM)</Turkish> @@ -2662,7 +2662,7 @@ <Portuguese>Calibre: .300 WM OTM NATO (Berger Hybrid OTM)<br/>Cartuchos: 20</Portuguese> <Hungarian>Kaliber: .300 WM NATO (Berger Hybrid OTM)<br />Lövedékek: 20</Hungarian> <Japanese>口径: .300 WM NATO (Berger Hybrid OTM)<br />装填数: 20</Japanese> - <Korean>구경: .300구경 윈체스터 매그넘 (Berger Hybrid OTM)<br/>장탄수: 20</Korean> + <Korean>구경: .300구경 윈체스터 매그넘 (Berger제 하이브리드 오픈 팁 매치탄)<br/>장탄수: 20</Korean> <Chinese>口徑: .300 西米 NATO標準 (Berger Hybrid 空尖比賽專用彈)<br />發數: 20</Chinese> <Chinesesimp>口径:.300 WM 北约(Berger Hybrid 空尖)<br />发数:20</Chinesesimp> <Turkish>Kalibre: .300 WM NATO (Berger Hybrid OTM)<br />Mermi: 20</Turkish> @@ -2679,7 +2679,7 @@ <Portuguese>Carregador .300 WM com 10 cartuchos (Mk248 Mod 0)</Portuguese> <Hungarian>.300 WM 10-lövedékes tár (Mk248 Mod 0)</Hungarian> <Japanese>.300 WM 10Rnd マガジン (Mk248 Mod 0)</Japanese> - <Korean>10발 들이 .300구경 윈체스터 매그넘 탄창 (Mk.248 Mod 0)</Korean> + <Korean>.300구경 윈체스터 매그넘 10발 들이 탄창 (Mk.248 Mod 0)</Korean> <Chinese>.300 萬能(WM) 10發 彈匣 (Mk248 Mod 0 狙擊專用彈)</Chinese> <Chinesesimp>.300 WM 10发 弹匣(Mk248 Mod 0)</Chinesesimp> <Turkish>.300 WM 10Rnd Mag (Mk248 Mod 0)</Turkish> @@ -2713,7 +2713,7 @@ <Portuguese>Calibre: .300 WM NATO (Mk248 Mod 0)<br/>Cartuchos: 10</Portuguese> <Hungarian>Kaliber: .300 WM NATO (Mk248 Mod 0)<br />Lövedékek: 10</Hungarian> <Japanese>口径: .300 WM NATO (Mk248 Mod 0)<br />装填数: 10</Japanese> - <Korean>구경: .300구경 윈체스터 매그넘 (Mk.248 Mod 0)<br/>장탄수: 10</Korean> + <Korean>구경: .300 윈체스터 매그넘 (Mk.248 Mod 0 장거리 저격용 탄환)<br/>장탄수: 10</Korean> <Chinese>口徑: .300 西米 NATO標準 (Mk248 Mod 0 狙擊專用彈)<br />發數: 10</Chinese> <Chinesesimp>口径:.300 WM 北约(Mk248 Mod 0 狙击专用弹)<br />发数:10</Chinesesimp> <Turkish>Kalibre: .300 WM NATO (Mk248 Mod 0)<br />Mermi: 10</Turkish> @@ -2730,7 +2730,7 @@ <Portuguese>Carregador .300 WM com 10 cartuchos (Mk248 Mod 1)</Portuguese> <Hungarian>.300 WM 10-lövedékes tár (Mk248 Mod 1)</Hungarian> <Japanese>.300 WM 10Rnd マガジン (Mk248 Mod 1)</Japanese> - <Korean>10발 들이 .300구경 윈체스터 매그넘 탄창 (Mk.248 Mod 1)</Korean> + <Korean>.300구경 윈체스터 매그넘 10발 들이 탄창 (Mk.248 Mod 1)</Korean> <Chinese>.300 西米 10發 彈匣 (Mk248 Mod 1 狙擊專用彈)</Chinese> <Chinesesimp>.300 WM 10发 弹匣(Mk248 Mod 1)</Chinesesimp> <Turkish>.300 WM 10Rnd Mag (Mk248 Mod 1)</Turkish> @@ -2764,7 +2764,7 @@ <Portuguese>Calibre: .300 WM NATO (Mk248 Mod 1)<br/>Cartuchos: 10</Portuguese> <Hungarian>Kaliber: .300 WM NATO (Mk248 Mod 1)<br />Lövedékek: 10</Hungarian> <Japanese>口径: .300 WM NATO (Mk248 Mod 1)<br />装填数: 10</Japanese> - <Korean>구경: .300구경 윈체스터 매그넘 (Mk.248 Mod 1)<br/>장탄수: 10</Korean> + <Korean>구경: .300구경 윈체스터 매그넘 (Mk.248 Mod 1 개선판 장거리 저격용 탄환)<br/>장탄수: 10</Korean> <Chinese>口徑: .300 西米 NATO標準 (Mk248 Mod 1 狙擊專用彈)<br />發數: 10</Chinese> <Chinesesimp>口径:.300 WM 北约(Mk248 Mod 1 狙击专用弹)<br />发数:10</Chinesesimp> <Turkish>Kalibre: .300 WM NATO (Mk248 Mod 1)<br />Mermi: 10</Turkish> @@ -2781,7 +2781,7 @@ <Portuguese>Carregador .300 WM com 10 cartuchos (Berger Hybrid OTM)</Portuguese> <Hungarian>.300 WM 10-lövedékes tár (Berger Hybrid OTM)</Hungarian> <Japanese>.300 WM 10Rnd マガジン (Berger Hybrid OTM)</Japanese> - <Korean>10발 들이 .300구경 윈체스터 매그넘 탄창 (Berger Hybrid OTM)</Korean> + <Korean>.300구경 윈체스터 매그넘 10발 들이 탄창 (Berger제 하이브리드 OTM)</Korean> <Chinese>.300 西米 10發 彈匣 (Berger Hybrid 空尖比賽專用彈)</Chinese> <Chinesesimp>.300 WM 10发 弹匣(Berger Hybrid 空尖)</Chinesesimp> <Turkish>.300 WM 10Rnd Mag (Berger Hybrid OTM)</Turkish> @@ -2815,7 +2815,7 @@ <Portuguese>Calibre: .300 WM OTM NATO (Berger Hybrid OTM)<br/>Cartuchos: 10</Portuguese> <Hungarian>Kaliber: .300 WM NATO (Berger Hybrid OTM)<br />Lövedékek: 10</Hungarian> <Japanese>口径: .300 WM NATO (Berger Hybrid OTM)<br />装填数: 10</Japanese> - <Korean>구경: .300구경 윈체스터 매그넘 (Berger Hybrid OTM)<br/>장탄수: 10</Korean> + <Korean>구경: .300구경 윈체스터 매그넘 (Berger제 하이브리드 오픈 팁 매치탄)<br/>장탄수: 10</Korean> <Chinese>口徑: .300 西米 NATO標準 (Berger Hybrid 空尖比賽專用彈)<br />發數: 10</Chinese> <Chinesesimp>口径:.300 WM 北约(Berger Hybrid 空尖)<br />发数:10</Chinesesimp> <Turkish>Kalibre: .300 WM NATO (Berger Hybrid OTM)<br />Mermi: 10</Turkish> @@ -2828,7 +2828,7 @@ <Italian>6.5x47 mm 30cp Sabbia (HPBT Scenar)</Italian> <Polish>Magazynek 6.5x47 mm 30rd Piaskowy (HPBT Scenar)</Polish> <Chinesesimp>6.5x47 mm 30发 沙色弹匣(HPBT Scenar)</Chinesesimp> - <Korean>6.5x47mm 30발 사막 탄창 (HPBT Scenar)</Korean> + <Korean>6.5x47mm 30발 들이 탄창/모래 (HPBT Scenar)</Korean> <Russian>Магазин из 30-ти 6.5x47 мм Песочный (HPBT Scenar)</Russian> <Spanish>Cargador de 30 balas de 6.5x47mm Arena (HPBT Scenar)</Spanish> <Portuguese>Carregador 6.5x47 mm com 30 cartuchos Areia (HPBT Scenar)</Portuguese> @@ -2841,7 +2841,7 @@ <Italian>6.5x47 mm 30cp Car Promet (HPBT Scenar)</Italian> <Polish>Magazynek 6.5x47 mm 30rd Promet (HPBT Scenar)</Polish> <Chinesesimp>6.5x47 mm 30发 Promet 弹匣(HPBT Scenar)</Chinesesimp> - <Korean>6.5x47mm 30발 그롯 탄창 (HPBT Scenar)</Korean> + <Korean>6.5x47mm 30발 들이 탄창/프로멧용 (Scenar제 HPBT)</Korean> <Russian>Магазин из 30-ти 6.5x47 мм Promet (HPBT Scenar)</Russian> <Spanish>Cargador de 30 balas de 6.5x47mm Promet (HPBT Scenar)</Spanish> <Portuguese>Carregador 6.5x47 mm com 30 cartuchos Promet (HPBT Scenar)</Portuguese> @@ -2854,7 +2854,7 @@ <Italian>6.5x47 mm 30cp Car Nero (HPBT Scenar)</Italian> <Polish>Magazynek 6.5x47 mm 30rd Czarny (HPBT Scenar)</Polish> <Chinesesimp>6.5x47 mm 30发 黑色弹匣(HPBT Scenar)</Chinesesimp> - <Korean>6.5x47mm 30발 검정 탄창 (HPBT Scenar)</Korean> + <Korean>6.5x47mm 30발 들이 탄창/검정 (Scenar제 HPBT)</Korean> <Russian>Магазин из 30-ти 6.5x47 мм Чёрный (HPBT Scenar)</Russian> <Spanish>Cargador de 30 balas de 6.5x47mm Negro (HPBT Scenar)</Spanish> <Portuguese>Carregador 6.5x47 mm com 30 cartuchos Preto (HPBT Scenar)</Portuguese> @@ -2867,7 +2867,7 @@ <Italian>6.5x47 mm 30cp Car Cachi (HPBT Scenar)</Italian> <Polish>Magazynek 6.5x47 mm 30rd Khaki (HPBT Scenar)</Polish> <Chinesesimp>6.5x47 mm 30发 卡其色弹匣(HPBT Scenar)</Chinesesimp> - <Korean>6.5x47mm 30발 카키 탄창 (HPBT Scenar)</Korean> + <Korean>6.5x47mm 30발 들이 탄창/카키 (Scenar제 HPBT)</Korean> <Russian>Магазин из 30-ти 6.5x47 мм Хаки (HPBT Scenar)</Russian> <Spanish>Cargador de 30 balas de 6.5x47mm Caqui (HPBT Scenar)</Spanish> <Portuguese>Carregador 6.5x47 mm com 30 cartuchos Caqui (HPBT Scenar)</Portuguese> @@ -2901,7 +2901,7 @@ <Portuguese>Calibre: 6.5x47 mm (HPBT Scenar)<br/>Cartuchos: 30<br/>Usado em: MXM</Portuguese> <Hungarian>Kaliber: 6,5x47 mm (HPBT Scenar)<br />Lövedékek: 30<br />Használható: MXM</Hungarian> <Japanese>口径: 6.5x47 mm (HPBT Scenar)<br />装填数: 30<br />次で使用: MXM</Japanese> - <Korean>구경: 6.5x47mm (HPBT Scenar)<br/>장탄수: 30<br/>사용처: MXM</Korean> + <Korean>구경: 6.5x47mm (Scenar제 보트 테일 할로우 포인트)<br/>장탄수: 30<br/>사용처: MXM</Korean> <Chinese>口徑: 6.5x47毫米 (拉普 空尖艇尾狙擊專用彈)<br />發數: 30<br />使用於: MXM</Chinese> <Chinesesimp>口径:6.5x47 mm(HPBT Scenar 狙击专用弹)<br />发数:30<br />使用于:MXM</Chinesesimp> <Turkish>Kalibre: 6.5x47 mm (HPBT Scenar)<br />Mermi: 30<br />Kullanıyor: MXM</Turkish> @@ -2918,7 +2918,7 @@ <Portuguese>Calibre: 6.5x47 mm (HPBT Scenar)<br/>Cartuchos: 30<br/>Usado em: Promet MR</Portuguese> <Hungarian>Kaliber: 6,5x47 mm (HPBT Scenar)<br />Lövedékek: 30<br />Használható: Promet MR</Hungarian> <Japanese>口径: 6.5x47 mm (HPBT Scenar)<br />装填数: 30<br />次で使用: Promet MR</Japanese> - <Korean>구경: 6.5x47mm (HPBT Scenar)<br/>장탄수: 30<br/>사용처: MSBS 그롯/GL/MR/SG</Korean> + <Korean>구경: 6.5x47mm (Scenar제 보트 테일 할로우 포인트)<br/>장탄수: 30<br/>사용처: MSBS 그롯/GL/MR/SG</Korean> <Chinese>口徑: 6.5x47毫米 (拉普 空尖艇尾狙擊專用彈)<br />發數: 30<br />使用於: Promet MR</Chinese> <Chinesesimp>口径:6.5x47 mm(HPBT Scenar 狙击专用弹)<br />发数:30<br />使用于:Promet MR</Chinesesimp> <Turkish>Kalibre: 6.5x47 mm (HPBT Scenar)<br />Mermi: 30<br />Kullanıyor: Promet MR</Turkish> @@ -2931,7 +2931,7 @@ <Italian>6.5 mm Creedmor 30cp Car Sabbia</Italian> <Polish>Magazynek 6.5 mm Creedmor 30Rnd Piaskowy</Polish> <Chinesesimp>6.5 mm 30发 沙色弹匣(Creedmor)</Chinesesimp> - <Korean>6.5mm 크리드무어 30발 사막 탄창</Korean> + <Korean>6.5mm 크리드무어 30발 들이 탄창/사막</Korean> <Russian>Магазин из 30-ти 6.5 мм Creedmor Песочный</Russian> <Spanish>Cargador de 30 balas de 6.5mm Creedmor Arena</Spanish> <Portuguese>Carregador 6.5 mm com 30 cartuchos Creedmor Areia</Portuguese> @@ -2944,7 +2944,7 @@ <Italian>6.5 mm Creedmor 30cp Car Promet</Italian> <Polish>Magazynek 6.5 mm Creedmor 30Rnd Promet</Polish> <Chinesesimp>6.5 mm 30发 Promet 弹匣(Creedmor)</Chinesesimp> - <Korean>6.5mm 크리드무어 30발 프로멧 탄창</Korean> + <Korean>6.5mm 크리드무어 30발 들이 탄창/프로멧용</Korean> <Russian>Магазин из 30-ти 6.5 мм Creedmor Promet</Russian> <Spanish>Cargador de 30 balas de 6.5mm Creedmor Promet</Spanish> <Portuguese>Carregador 6.5 mm com 30 cartuchos Creedmor Promet</Portuguese> @@ -2957,7 +2957,7 @@ <Italian>6.5 mm Creedmor 30cp Car Nero</Italian> <Polish>Magazynek 6.5 mm Creedmor 30Rnd Czarny</Polish> <Chinesesimp>6.5 mm 30发 黑色弹匣(Creedmor)</Chinesesimp> - <Korean>6.5mm 크리드무어 30발 검정 탄창</Korean> + <Korean>6.5mm 크리드무어 30발 들이 탄창/검정</Korean> <Russian>Магазин из 30-ти 6.5 мм Creedmor Чёрный</Russian> <Spanish>Cargador de 30 balas de 6.5mm Creedmor Negro</Spanish> <Portuguese>Carregador 6.5 mm com 30 cartuchos Creedmor Preto</Portuguese> @@ -2970,7 +2970,7 @@ <Italian>6.5 mm Creedmor 30cp Car Cachi</Italian> <Polish>Magazynek 6.5 mm Creedmor 30Rnd Khaki</Polish> <Chinesesimp>6.5 mm 30发 卡其色弹匣(Creedmor)</Chinesesimp> - <Korean>6.5mm 크리드무어 30발 카키 탄창</Korean> + <Korean>6.5mm 크리드무어 30발 들이 탄창/카키</Korean> <Russian>Магазин из 30-ти 6.5 мм Creedmor Хаки</Russian> <Spanish>Cargador de 30 balas de 6.5mm Creedmor Caqui</Spanish> <Portuguese>Carregador 6.5 mm com 30 cartuchos Creedmor Caqui</Portuguese> @@ -3038,7 +3038,7 @@ <Portuguese>Carregador .338 LM (300gr Lapua Scenar) com 10 cartuchos </Portuguese> <Hungarian>.338 LM 10-lövedékes tár (300gr Lapua Scenar)</Hungarian> <Japanese>.338 LM 10Rnd マガジン (300gr Lapua Scenar)</Japanese> - <Korean>10발 들이 .338구경 라푸아 매그넘 탄창 (300그레인 Scenar)</Korean> + <Korean>.338구경 라푸아 매그넘 10발 들이 탄창 (Scenar제 300그레인)</Korean> <Chinese>.338 10發 彈匣 (300公克 Lapua Scenar)</Chinese> <Chinesesimp>.338 LM 10发 弹匣(300gr Lapua Scenar)</Chinesesimp> <Turkish>.338 LM 10Rnd Mag (300gr Lapua Scenar)</Turkish> @@ -3072,7 +3072,7 @@ <Portuguese>Calibre: 8.6x70mm (300gr Lapua Scenar)<br/>Cartuchos: 10</Portuguese> <Hungarian>Kaliber: 8,6x70mm (300gr Lapua Scenar)<br />Lövedékek: 10</Hungarian> <Japanese>口径: 8.6x70mm (300gr Lapua Scenar)<br />装填数: 10</Japanese> - <Korean>구경: 8.6x70mm 라푸아 매그넘 (300그레인 Scenar)<br/>장탄수: 10</Korean> + <Korean>구경: 8.6x70mm 라푸아 매그넘 (Scenar제 300그레인)<br/>장탄수: 10</Korean> <Chinese>口徑: 8.6x70毫米 (300公克 Lapua Scenar)<br />發數: 10</Chinese> <Chinesesimp>口径:8.6x70 mm(300gr Lapua Scenar)<br />发数:10</Chinesesimp> <Turkish>Kalibre: 8.6x70mm (300gr Lapua Scenar)<br />Mermi: 10</Turkish> @@ -3089,7 +3089,7 @@ <Portuguese>Carregador .338 LM (API526) com 10 cartuchos </Portuguese> <Hungarian>.338 LM 10-lövedékes tár (API526)</Hungarian> <Japanese>.338 LM 10Rnd マガジン (API526)</Japanese> - <Korean>10발 들이 .338구경 라푸아 매그넘 탄창 (API526)</Korean> + <Korean>.338구경 라푸아 매그넘 10발 들이 탄창 (API526)</Korean> <Chinese>.338 10發 彈匣 (API526 穿甲燃燒彈)</Chinese> <Chinesesimp>.338 LM 10发 弹匣(API526 穿燃)</Chinesesimp> <Turkish>.338 LM 10Rnd Mag (API526)</Turkish> @@ -3106,7 +3106,7 @@ <Portuguese>.338 AP</Portuguese> <Hungarian>.338 páncéltörő</Hungarian> <Japanese>.338 AP</Japanese> - <Korean>.338구경 라푸아 매그넘 철갑탄</Korean> + <Korean>.338구경 라푸아 매그넘 철갑소이탄</Korean> <Chinese>.338 API526 穿甲燃燒彈</Chinese> <Chinesesimp>.338 穿燃</Chinesesimp> <Turkish>.338 AP</Turkish> @@ -3123,7 +3123,7 @@ <Portuguese>Calibre: 8.6x70mm (API526)<br/>Cartuchos: 10</Portuguese> <Hungarian>Kaliber: 8,6x70mm (API526)<br />Lövedékek: 10</Hungarian> <Japanese>口径: 8.6x70mm (API526)<br />装填数: 10</Japanese> - <Korean>구경: 8.6x70mm 라푸아 매그넘 (API526)<br/>장탄수: 10</Korean> + <Korean>구경: 8.6x70mm 라푸아 매그넘 (API526 철갑소이탄)<br/>장탄수: 10</Korean> <Chinese>口徑: 8.6x70毫米 (API526 穿甲燃燒彈)<br />發數: 10</Chinese> <Chinesesimp>口径:8.6x70 mm(API526 穿燃)<br />发数:10</Chinesesimp> <Turkish>Kalibre: 8.6x70mm (API526)<br />Mermi: 10</Turkish> @@ -3140,7 +3140,7 @@ <Portuguese>Carregador .408 (305gr) com 7 cartuchos </Portuguese> <Hungarian>.408 7-lövedékes tár (305gr)</Hungarian> <Japanese>.408 7Rnd マガジン (305gr)</Japanese> - <Korean>7발 들이 .408구경 샤이택 탄창 (305그레인)</Korean> + <Korean>.408구경 샤이택 7발 들이 탄창 (305그레인)</Korean> <Chinese>.408 7發 彈匣 (305公克)</Chinese> <Chinesesimp>.408 7发 弹匣(305gr)</Chinesesimp> <Turkish>.408 7Rnd Mag (305gr)</Turkish> @@ -3191,7 +3191,7 @@ <Portuguese>Carregador 12.7x99 mm com 5 cartuchos </Portuguese> <Hungarian>12,7x99 mm 5-lövedékes tár</Hungarian> <Japanese>12.7x99mm 5Rnd マガジン</Japanese> - <Korean>5발 들이 12.7x99mm 탄창</Korean> + <Korean>12.7x99mm 5발 들이 탄창</Korean> <Chinese>12.7x99毫米 5發 彈匣</Chinese> <Chinesesimp>12.7x99 mm 5发 弹匣</Chinesesimp> <Turkish>12.7x99 mm 5Rnd Mag</Turkish> @@ -3225,7 +3225,7 @@ <Portuguese>Carregador 12.7x99 mm com 10 cartuchos </Portuguese> <Hungarian>12,7x99 mm 10-lövedékes tár</Hungarian> <Japanese>12.7x99mm 10Rnd マガジン</Japanese> - <Korean>10발 들이 12.7x99mm 탄창</Korean> + <Korean>12.7x99mm 10발 들이 탄창</Korean> <Chinese>12.7x99毫米 10發 彈匣</Chinese> <Chinesesimp>12.7x99 mm 10发 弹匣</Chinesesimp> <Turkish>12.7x99 mm 10Rnd Mag</Turkish> @@ -3276,7 +3276,7 @@ <Portuguese>Carregador 12.7x99 mm API com 5 cartuchos </Portuguese> <Hungarian>12,7x99 mm 5-lövedékes tár (páncéltörő-gyújtó)</Hungarian> <Japanese>12.7x99mm 5Rnd 焼夷徹甲弾 マガジン</Japanese> - <Korean>5발 들이 12.7x99mm 철갑소이탄 탄창</Korean> + <Korean>12.7x99mm 5발 들이 탄창 (철갑소이탄)</Korean> <Chinese>12.7x99毫米 穿甲燃燒彈 5發 彈匣</Chinese> <Chinesesimp>12.7x99 mm 穿燃 5发 弹匣</Chinesesimp> <Turkish>12.7x99 mm API 5Rnd Mag</Turkish> @@ -3310,7 +3310,7 @@ <Portuguese>Carregador 12.7x99 mm API com 10 cartuchos </Portuguese> <Hungarian>12,7x99 mm 10-lövedékes tár (páncéltörő-gyújtó)</Hungarian> <Japanese>12.7x99mm 10Rnd 焼夷徹甲弾 マガジン</Japanese> - <Korean>10발 들이 12.7x99mm 철갑소이탄 탄창</Korean> + <Korean>12.7x99mm 10발 들이 탄창 (철갑소이탄)</Korean> <Chinese>12.7x99毫米 穿甲燃燒彈 10發 彈匣</Chinese> <Chinesesimp>12.7x99 mm 穿燃 10发 弹匣</Chinesesimp> <Turkish>12.7x99 mm API 10Rnd Mag</Turkish> @@ -3344,7 +3344,7 @@ <Portuguese>Carregador 12.7x99 mm (AMAX) com 5 cartuchos </Portuguese> <Hungarian>12,7x99 mm 5-lövedékes tár (AMAX)</Hungarian> <Japanese>12.7x99mm 5Rnd マガジン (AMAX)</Japanese> - <Korean>5발 들이 12.7x99mm 탄창 (AMAX)</Korean> + <Korean>12.7x99mm 5발 들이 탄창 (A-MAX)</Korean> <Chinese>12.7x99毫米 5發 彈匣 (AMAX 比賽專用彈)</Chinese> <Chinesesimp>12.7x99 mm 5发 弹匣(AMAX)</Chinesesimp> <Turkish>12.7x99 mm 5Rnd Şarjör (AMAX)</Turkish> @@ -3361,7 +3361,7 @@ <Portuguese>Calibre: 12.7x99 mm (AMAX)<br/>Cartuchos: 5</Portuguese> <Hungarian>Kaliber: 12,7x99 mm (AMAX)<br />Lövedékek: 5</Hungarian> <Japanese>口径: 12.7x99 mm (AMAX)<br />装填数: 5</Japanese> - <Korean>구경: 12.7x99mm (AMAX)<br/>장탄수: 5</Korean> + <Korean>구경: 12.7x99mm (A-MAX 매치그레이드)<br/>장탄수: 5</Korean> <Chinese>口徑: 12.7x99毫米 (AMAX 比賽專用彈)<br />發數: 5</Chinese> <Chinesesimp>口径:12.7x99 mm(AMAX)<br />发数:5</Chinesesimp> <Turkish>Kalibre: 12.7x99 mm (AMAX)<br />Mermi: 5</Turkish> @@ -3378,7 +3378,7 @@ <Portuguese>Carregador 12.7x99 mm (AMAX) com 10 cartuchos </Portuguese> <Hungarian>12,7x99 mm 10-lövedékes tár (AMAX)</Hungarian> <Japanese>12.7x99mm 10Rnd マガジン (AMAX)</Japanese> - <Korean>10발 들이 12.7x99mm 탄창 (AMAX)</Korean> + <Korean>12.7x99mm 10발 들이 탄창 (A-MAX)</Korean> <Chinese>12.7x99毫米 10發 彈匣 (AMAX 比賽專用彈)</Chinese> <Chinesesimp>12.7x99 mm 10发 弹匣(AMAX)</Chinesesimp> <Turkish>12.7x99 mm 10Rnd Şarjör (AMAX)</Turkish> @@ -3395,7 +3395,7 @@ <Portuguese>Calibre: 12.7x99 mm (AMAX)<br/>Cartuchos: 10</Portuguese> <Hungarian>Kaliber: 12,7x99 mm (AMAX)<br />Lövedékek: 10</Hungarian> <Japanese>口径: 12.7x99 mm (AMAX)<br />装填数: 10</Japanese> - <Korean>구경: 12.7x99mm (AMAX)<br/>장탄수: 10</Korean> + <Korean>구경: 12.7x99mm (A-MAX 매치그레이드)<br/>장탄수: 10</Korean> <Chinese>口徑: 12.7x99毫米 (AMAX 比賽專用彈)<br />發數: 10</Chinese> <Chinesesimp>口径:12.7x99 mm(AMAX)<br />发数:10</Chinesesimp> <Turkish>Kalibre: 12.7x99 mm (AMAX)<br />Mermi: 10</Turkish> @@ -3412,7 +3412,7 @@ <Portuguese>12.7 mm AMAX</Portuguese> <Hungarian>12,7 mm AMAX</Hungarian> <Japanese>12.7 mm AMAX</Japanese> - <Korean>12.7mm AMAX</Korean> + <Korean>12.7mm A-MAX</Korean> <Chinese>12.7毫米 AMAX 比賽專用彈</Chinese> <Chinesesimp>12.7 mm AMAX</Chinesesimp> <Turkish>12.7 mm AMAX</Turkish> diff --git a/addons/captives/functions/fnc_handleRespawn.sqf b/addons/captives/functions/fnc_handleRespawn.sqf index 1dc6ca7bfa3..f3c728d0538 100644 --- a/addons/captives/functions/fnc_handleRespawn.sqf +++ b/addons/captives/functions/fnc_handleRespawn.sqf @@ -40,12 +40,12 @@ if (_respawn > 3) then { if (_unit getVariable [QGVAR(isHandcuffed), false]) then { [_unit, false] call FUNC(setHandcuffed); }; - [_unit, "setCaptive", QGVAR(Handcuffed), false] call EFUNC(common,statusEffect_set); + [_unit, "setCaptive", QGVAR(handcuffed), false] call EFUNC(common,statusEffect_set); if (_unit getVariable [QGVAR(isSurrendering), false]) then { [_unit, false] call FUNC(setSurrendered); }; - [_unit, "setCaptive", QGVAR(Surrendered), false] call EFUNC(common,statusEffect_set); + [_unit, "setCaptive", QGVAR(surrendered), false] call EFUNC(common,statusEffect_set); if (_unit getVariable [QGVAR(isEscorting), false]) then { _unit setVariable [QGVAR(isEscorting), false, true]; diff --git a/addons/captives/functions/fnc_setHandcuffed.sqf b/addons/captives/functions/fnc_setHandcuffed.sqf index d3d9fa4e6b6..2ccd36493c8 100644 --- a/addons/captives/functions/fnc_setHandcuffed.sqf +++ b/addons/captives/functions/fnc_setHandcuffed.sqf @@ -41,8 +41,8 @@ if ((_unit getVariable [QGVAR(isHandcuffed), false]) isEqualTo _state) exitWith if (_state) then { _unit setVariable [QGVAR(isHandcuffed), true, true]; - [_unit, "setCaptive", QGVAR(Handcuffed), true] call EFUNC(common,statusEffect_set); - [_unit, "blockRadio", QGVAR(Handcuffed), true] call EFUNC(common,statusEffect_set); + [_unit, "setCaptive", QGVAR(handcuffed), true] call EFUNC(common,statusEffect_set); + [_unit, "blockRadio", QGVAR(handcuffed), true] call EFUNC(common,statusEffect_set); if (_unit getVariable [QGVAR(isSurrendering), false]) then { //If surrendering, stop [_unit, false] call FUNC(setSurrendered); @@ -82,8 +82,8 @@ if (_state) then { }, [_unit], 0.01] call CBA_fnc_waitAndExecute; } else { _unit setVariable [QGVAR(isHandcuffed), false, true]; - [_unit, "setCaptive", QGVAR(Handcuffed), false] call EFUNC(common,statusEffect_set); - [_unit, "blockRadio", QGVAR(Handcuffed), false] call EFUNC(common,statusEffect_set); + [_unit, "setCaptive", QGVAR(handcuffed), false] call EFUNC(common,statusEffect_set); + [_unit, "blockRadio", QGVAR(handcuffed), false] call EFUNC(common,statusEffect_set); //remove AnimChanged EH private _animChangedEHID = _unit getVariable [QGVAR(handcuffAnimEHID), -1]; diff --git a/addons/captives/functions/fnc_setSurrendered.sqf b/addons/captives/functions/fnc_setSurrendered.sqf index 887bfb26808..3a3724c94d2 100644 --- a/addons/captives/functions/fnc_setSurrendered.sqf +++ b/addons/captives/functions/fnc_setSurrendered.sqf @@ -44,8 +44,8 @@ if (_state) then { _unit setVariable [QGVAR(isSurrendering), true, true]; - [_unit, "setCaptive", QGVAR(Surrendered), true] call EFUNC(common,statusEffect_set); - [_unit, "blockRadio", QGVAR(Surrendered), true] call EFUNC(common,statusEffect_set); + [_unit, "setCaptive", QGVAR(surrendered), true] call EFUNC(common,statusEffect_set); + [_unit, "blockRadio", QGVAR(surrendered), true] call EFUNC(common,statusEffect_set); if (_unit == ACE_player) then { ["captive", [false, false, false, false, false, false, false, false, false, true]] call EFUNC(common,showHud); @@ -71,8 +71,8 @@ if (_state) then { }, [_unit], 0.01] call CBA_fnc_waitAndExecute; } else { _unit setVariable [QGVAR(isSurrendering), false, true]; - [_unit, "setCaptive", QGVAR(Surrendered), false] call EFUNC(common,statusEffect_set); - [_unit, "blockRadio", QGVAR(Surrendered), false] call EFUNC(common,statusEffect_set); + [_unit, "setCaptive", QGVAR(surrendered), false] call EFUNC(common,statusEffect_set); + [_unit, "blockRadio", QGVAR(surrendered), false] call EFUNC(common,statusEffect_set); //remove AnimChanged EH private _animChangedEHID = _unit getVariable [QGVAR(surrenderAnimEHID), -1]; diff --git a/addons/captives/stringtable.xml b/addons/captives/stringtable.xml index 4fc86ec58fe..dfc293028dc 100644 --- a/addons/captives/stringtable.xml +++ b/addons/captives/stringtable.xml @@ -158,6 +158,7 @@ <Japanese>目隠しを外す</Japanese> <Russian>Снять повязку с глаз</Russian> <Spanish>Quitar vendas de los ojos</Spanish> + <Portuguese>Remover a venda</Portuguese> </Key> <Key ID="STR_ACE_Captives_CableTie"> <English>Cable Tie</English> diff --git a/addons/cargo/CfgVehicles.hpp b/addons/cargo/CfgVehicles.hpp index 66fa98159e3..9b4e316a19a 100644 --- a/addons/cargo/CfgVehicles.hpp +++ b/addons/cargo/CfgVehicles.hpp @@ -1,4 +1,3 @@ - class CBA_Extended_EventHandlers; class CfgVehicles { @@ -55,7 +54,7 @@ class CfgVehicles { GVAR(space) = 4; GVAR(hasCargo) = 1; }; - class Tank_F: Tank {}; + class Tank_F; class UGV_02_Base_F: Tank_F { GVAR(space) = 0; GVAR(hasCargo) = 0; @@ -237,8 +236,6 @@ class CfgVehicles { GVAR(hasCargo) = 1; }; - class O_Heli_Transport_04_fuel_F: Heli_Transport_04_base_F {}; - class O_Heli_Transport_04_medevac_F: Heli_Transport_04_base_F { GVAR(space) = 10; GVAR(hasCargo) = 1; @@ -259,7 +256,7 @@ class CfgVehicles { GVAR(hasCargo) = 0; }; - class Plane_Base_F: Plane {}; + class Plane_Base_F; class Plane_Civil_01_base_F: Plane_Base_F { // Tanoa Civilian Prop Plane GVAR(space) = 2; GVAR(hasCargo) = 1; @@ -300,7 +297,7 @@ class CfgVehicles { GVAR(hasCargo) = 1; }; - class Boat_F: Ship_F {}; + class Boat_F; class Rubber_duck_base_F: Boat_F { GVAR(space) = 0; GVAR(hasCargo) = 0; @@ -356,7 +353,7 @@ class CfgVehicles { }; // Slingload pallets - class Slingload_base_F: ReammoBox_F {}; + class Slingload_base_F; class CargoNet_01_base_F: Slingload_base_F { GVAR(size) = 6; }; @@ -512,10 +509,6 @@ class CfgVehicles { transportMaxWeapons = 12; }; class Land_WoodenCrate_01_F: ThingX { - class EventHandlers { - class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {}; - }; - GVAR(space) = 3; GVAR(hasCargo) = 1; GVAR(size) = 3; @@ -545,240 +538,141 @@ class CfgVehicles { }; }; class Cargo10_base_F: Cargo_base_F { - class EventHandlers { - class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {}; - }; - GVAR(space) = 14; GVAR(size) = 15; }; - class Land_Cargo20_blue_F: Cargo_base_F { - class EventHandlers { - class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {}; - }; + class Land_Cargo10_IDAP_F: ThingX { + GVAR(space) = 14; + GVAR(size) = 15; + }; + class Land_Cargo20_blue_F: Cargo_base_F { GVAR(space) = 49; GVAR(size) = 50; }; class Land_Cargo20_brick_red_F: Cargo_base_F { - class EventHandlers { - class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {}; - }; - GVAR(space) = 49; GVAR(size) = 50; }; class Land_Cargo20_cyan_F: Cargo_base_F { - class EventHandlers { - class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {}; - }; - GVAR(space) = 49; GVAR(size) = 50; }; class Land_Cargo20_grey_F: Cargo_base_F { - class EventHandlers { - class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {}; - }; - GVAR(space) = 49; GVAR(size) = 50; }; class Land_Cargo20_light_blue_F: Cargo_base_F { - class EventHandlers { - class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {}; - }; - GVAR(space) = 49; GVAR(size) = 50; }; class Land_Cargo20_light_green_F: Cargo_base_F { - class EventHandlers { - class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {}; - }; - GVAR(space) = 49; GVAR(size) = 50; }; class Land_Cargo20_military_green_F: Cargo_base_F { - class EventHandlers { - class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {}; - }; - GVAR(space) = 49; GVAR(size) = 50; }; class Land_Cargo20_orange_F: Cargo_base_F { - class EventHandlers { - class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {}; - }; - GVAR(space) = 49; GVAR(size) = 50; }; class Land_Cargo20_red_F: Cargo_base_F { - class EventHandlers { - class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {}; - }; - GVAR(space) = 49; GVAR(size) = 50; }; class Land_Cargo20_sand_F: Cargo_base_F { - class EventHandlers { - class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {}; - }; - GVAR(space) = 49; GVAR(size) = 50; }; class Land_Cargo20_vr_F: Cargo_base_F { - class EventHandlers { - class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {}; - }; - GVAR(space) = 49; GVAR(size) = 50; }; class Land_Cargo20_white_F: Cargo_base_F { - class EventHandlers { - class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {}; - }; - GVAR(space) = 49; GVAR(size) = 50; }; class Land_Cargo20_yellow_F: Cargo_base_F { - class EventHandlers { - class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {}; - }; - GVAR(space) = 49; GVAR(size) = 50; }; - class Cargo_IDAP_base_F: Cargo_base_F {}; + + class Cargo_IDAP_base_F; class Land_Cargo20_IDAP_F: Cargo_IDAP_base_F { - class EventHandlers { - class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {}; - }; + GVAR(space) = 49; + GVAR(size) = 50; + }; + class Cargo_EMP_base_F; + class Land_Cargo20_EMP_F: Cargo_EMP_base_F { + GVAR(space) = 49; + GVAR(size) = 50; + }; + class Land_Cargo20_EMP_Training_F: Cargo_EMP_base_F { GVAR(space) = 49; GVAR(size) = 50; }; class Land_Cargo40_blue_F: Cargo_base_F { - class EventHandlers { - class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {}; - }; - GVAR(space) = 99; GVAR(size) = 100; }; class Land_Cargo40_brick_red_F: Cargo_base_F { - class EventHandlers { - class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {}; - }; - GVAR(space) = 99; GVAR(size) = 100; }; class Land_Cargo40_cyan_F: Cargo_base_F { - class EventHandlers { - class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {}; - }; - GVAR(space) = 99; GVAR(size) = 100; }; class Land_Cargo40_grey_F: Cargo_base_F { - class EventHandlers { - class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {}; - }; - GVAR(space) = 99; GVAR(size) = 100; }; class Land_Cargo40_light_blue_F: Cargo_base_F { - class EventHandlers { - class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {}; - }; - GVAR(space) = 99; GVAR(size) = 100; }; class Land_Cargo40_light_green_F: Cargo_base_F { - class EventHandlers { - class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {}; - }; - GVAR(space) = 99; GVAR(size) = 100; }; class Land_Cargo40_military_green_F: Cargo_base_F { - class EventHandlers { - class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {}; - }; - GVAR(space) = 99; GVAR(size) = 100; }; class Land_Cargo40_orange_F: Cargo_base_F { - class EventHandlers { - class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {}; - }; - GVAR(space) = 99; GVAR(size) = 100; }; class Land_Cargo40_red_F: Cargo_base_F { - class EventHandlers { - class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {}; - }; - GVAR(space) = 99; GVAR(size) = 100; }; class Land_Cargo40_sand_F: Cargo_base_F { - class EventHandlers { - class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {}; - }; - GVAR(space) = 99; GVAR(size) = 100; }; - class Land_Cargo40_vr_F: Cargo_base_F { - class EventHandlers { - class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {}; - }; - + class Land_Cargo40_white_F: Cargo_base_F { GVAR(space) = 99; GVAR(size) = 100; }; - class Land_Cargo40_white_F: Cargo_base_F { - class EventHandlers { - class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {}; - }; - + class Land_Cargo40_yellow_F: Cargo_base_F { GVAR(space) = 99; GVAR(size) = 100; }; - class Land_Cargo40_yellow_F: Cargo_base_F { - class EventHandlers { - class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {}; - }; + class Land_Cargo40_IDAP_F: Cargo_IDAP_base_F { GVAR(space) = 99; GVAR(size) = 100; }; // Small class Land_CargoBox_V1_F: ThingX { - class EventHandlers { - class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {}; - }; - GVAR(space) = 7; GVAR(hasCargo) = 1; GVAR(size) = 7; diff --git a/addons/cargo/XEH_PREP.hpp b/addons/cargo/XEH_PREP.hpp index 10281e29674..4632a401f17 100644 --- a/addons/cargo/XEH_PREP.hpp +++ b/addons/cargo/XEH_PREP.hpp @@ -5,6 +5,7 @@ PREP(canUnloadItem); PREP(deployCancel); PREP(deployConfirm); PREP(getCargoSpaceLeft); +PREP(getDelayItem); PREP(getNameItem); PREP(getSelectedItem); PREP(getSizeItem); diff --git a/addons/cargo/XEH_postInit.sqf b/addons/cargo/XEH_postInit.sqf index f48849b50bc..84597b1c216 100644 --- a/addons/cargo/XEH_postInit.sqf +++ b/addons/cargo/XEH_postInit.sqf @@ -51,7 +51,7 @@ params ["_item", "_emptyPosAGL"]; _item hideObjectGlobal false; - _item setPosASL (AGLtoASL _emptyPosAGL); + _item setPosASL (AGLToASL _emptyPosAGL); // Let objects remain invulernable for a short while after placement [EFUNC(common,statusEffect_set), [_item, "blockDamage", QUOTE(ADDON), false], 2] call CBA_fnc_waitAndExecute; @@ -111,6 +111,20 @@ GVAR(objectActions) = [ {[_player, _target] call EFUNC(interaction,canInteractWithVehicleCrew)} } ] call EFUNC(interact_menu,createAction), + [QGVAR(checkSize), LLSTRING(checkSize), "\a3\ui_f\data\igui\cfg\simpletasks\types\box_ca.paa", + { + //IGNORE_PRIVATE_WARNING ["_target", "_player"]; + [format [LLSTRING(SizeMenu), _target call FUNC(getSizeItem)], 3] call EFUNC(common,displayTextStructured); + }, + { + //IGNORE_PRIVATE_WARNING ["_target", "_player"]; + GVAR(enable) && + {alive _target} && + {_target getVariable [QGVAR(canLoad), getNumber (configOf _target >> QGVAR(canLoad)) == 1]} && + {[_player, _target, ["isNotSwimming"]] call EFUNC(common,canInteractWith)} && + {[_player, _target] call EFUNC(interaction,canInteractWithVehicleCrew)} + } + ] call EFUNC(interact_menu,createAction), [QGVAR(load), LLSTRING(loadObject), "a3\ui_f\data\IGUI\Cfg\Actions\loadVehicle_ca.paa", { //IGNORE_PRIVATE_WARNING ["_target", "_player"]; diff --git a/addons/cargo/functions/fnc_deployConfirm.sqf b/addons/cargo/functions/fnc_deployConfirm.sqf index 27674b0515b..e4c87342f04 100644 --- a/addons/cargo/functions/fnc_deployConfirm.sqf +++ b/addons/cargo/functions/fnc_deployConfirm.sqf @@ -24,7 +24,7 @@ if (!isNull GVAR(itemPreviewObject) && {[GVAR(selectedItem), GVAR(interactionVeh // Position is AGL for unloading event private _position = ASLToAGL getPosASL GVAR(itemPreviewObject); private _direction = getDir GVAR(itemPreviewObject); - private _duration = GVAR(loadTimeCoefficient) * (GVAR(selectedItem) call FUNC(getSizeItem)); + private _duration = [GVAR(selectedItem), false] call FUNC(getDelayItem); // If unload time is 0, don't show a progress bar if (_duration <= 0) exitWith { diff --git a/addons/cargo/functions/fnc_getDelayItem.sqf b/addons/cargo/functions/fnc_getDelayItem.sqf new file mode 100644 index 00000000000..7f1d6b4d401 --- /dev/null +++ b/addons/cargo/functions/fnc_getDelayItem.sqf @@ -0,0 +1,26 @@ +#include "..\script_component.hpp" +/* + * Author: tcvm + * Gets the delay duration an item should take to load/unload. + * + * Arguments: + * 0: Item <OBJECT> or <TEXT> + * 1: If delay is for paradrop context <BOOLEAN> + * + * Return Value: + * Item load/unload duration <NUMBER> + * + * Example: + * [cursorObject, false] call ace_cargo_fnc_getDelayItem + * + * Public: No + */ + +params ["_item", "_isParadrop"]; + +if ((_item isEqualType objNull) && {_item getVariable [QGVAR(delay), -1] >= 0}) exitWith { + _item getVariable QGVAR(delay) // return +}; + +([GVAR(loadTimeCoefficient), GVAR(paradropTimeCoefficent)] select _isParadrop) * (_item call FUNC(getSizeItem)) // return + diff --git a/addons/cargo/functions/fnc_handleScrollWheel.sqf b/addons/cargo/functions/fnc_handleScrollWheel.sqf index 9ec2c498e64..e6f3b23e76f 100644 --- a/addons/cargo/functions/fnc_handleScrollWheel.sqf +++ b/addons/cargo/functions/fnc_handleScrollWheel.sqf @@ -38,7 +38,7 @@ if (!CBA_events_control) then { // Uses this method of selecting position because setPosATL did not have immediate effect private _positionChange = _position vectorDiff (getPosASL _deployedItem); - private _selectionPosition = _unit worldToModel (ASLtoAGL getPosWorld _deployedItem); + private _selectionPosition = _unit worldToModel (ASLToAGL getPosWorld _deployedItem); _selectionPosition = _selectionPosition vectorAdd _positionChange; _deployedItem attachTo [_unit, _selectionPosition]; diff --git a/addons/cargo/functions/fnc_loadItem.sqf b/addons/cargo/functions/fnc_loadItem.sqf index 21ebc0d52ad..aa3117c7dde 100644 --- a/addons/cargo/functions/fnc_loadItem.sqf +++ b/addons/cargo/functions/fnc_loadItem.sqf @@ -62,6 +62,17 @@ if (_item isEqualType objNull) then { // Some objects below water will take damage over time, eventually becoming "water logged" and unfixable (because of negative z attach) [_item, "blockDamage", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); + + // Prevent UAVs from firing + private _UAVCrew = _item call EFUNC(common,getVehicleUAVCrew); + + if (_UAVCrew isNotEqualTo []) then { + { + [_x, true] call EFUNC(common,disableAiUAV); + } forEach _UAVCrew; + + _item setVariable [QGVAR(isUAV), _UAVCrew, true]; + }; }; // Invoke listenable event diff --git a/addons/cargo/functions/fnc_paradropItem.sqf b/addons/cargo/functions/fnc_paradropItem.sqf index acd780f4635..934beb2aad2 100644 --- a/addons/cargo/functions/fnc_paradropItem.sqf +++ b/addons/cargo/functions/fnc_paradropItem.sqf @@ -63,7 +63,7 @@ if (_item isEqualType objNull) then { [QGVAR(serverUnload), [_object, _posBehindVehicleAGL]] call CBA_fnc_serverEvent; } else { _object = createVehicle [_item, _posBehindVehicleAGL, [], 0, "NONE"]; - _object setPosASL (AGLtoASL _posBehindVehicleAGL); + _object setPosASL (AGLToASL _posBehindVehicleAGL); }; [QEGVAR(common,setVelocity), [_object, (velocity _vehicle) vectorAdd ((vectorNormalized (vectorDir _vehicle)) vectorMultiply -5)], _object] call CBA_fnc_targetEvent; @@ -100,14 +100,26 @@ if (_item isEqualType objNull) then { // Create smoke effect when crate landed [{ - (_this select 0) params ["_object"]; + params ["_object", "_pfhID"]; if (isNull _object) exitWith { - [_this select 1] call CBA_fnc_removePerFrameHandler; + _pfhID call CBA_fnc_removePerFrameHandler; }; if (getPos _object select 2 < 1) exitWith { - [_this select 1] call CBA_fnc_removePerFrameHandler; + _pfhID call CBA_fnc_removePerFrameHandler; + + // Reenable UAV crew + private _UAVCrew = _object getVariable [QGVAR(isUAV), []]; + + if (_UAVCrew isNotEqualTo []) then { + // Reenable AI + { + [_x, false] call EFUNC(common,disableAiUAV); + } forEach _UAVCrew; + + _object setVariable [QGVAR(isUAV), nil, true]; + }; if ((GVAR(disableParadropEffectsClasstypes) findIf {_object isKindOf _x}) == -1) then { private _smoke = "SmokeshellYellow" createVehicle [0, 0, 0]; diff --git a/addons/cargo/functions/fnc_setSpace.sqf b/addons/cargo/functions/fnc_setSpace.sqf index 01c078496c2..514b84ea176 100644 --- a/addons/cargo/functions/fnc_setSpace.sqf +++ b/addons/cargo/functions/fnc_setSpace.sqf @@ -35,7 +35,7 @@ private _cargoSpace = _space; } forEach _loaded; // If the new value is the same as the old, do nothing -if (_cargoSpace == (_vehicle call FUNC(getCargoSpaceLeft))) exitwith {}; +if (_cargoSpace == (_vehicle call FUNC(getCargoSpaceLeft))) exitWith {}; // Apply new space globally // Necessary to update value, even if no space, as API could be used again diff --git a/addons/cargo/functions/fnc_startLoadIn.sqf b/addons/cargo/functions/fnc_startLoadIn.sqf index 7212d89c229..23d62c7c01b 100644 --- a/addons/cargo/functions/fnc_startLoadIn.sqf +++ b/addons/cargo/functions/fnc_startLoadIn.sqf @@ -36,7 +36,7 @@ if (isNull _vehicle) exitWith { // Start progress bar if ([_item, _vehicle] call FUNC(canLoadItemIn)) then { - private _duration = GVAR(loadTimeCoefficient) * (_item call FUNC(getSizeItem)); + private _duration = [_item, false] call FUNC(getDelayItem); // If load time is 0, don't show a progress bar if (_duration <= 0) exitWith { diff --git a/addons/cargo/functions/fnc_startUnload.sqf b/addons/cargo/functions/fnc_startUnload.sqf index 39dbf59f48a..e5eaab76dc7 100644 --- a/addons/cargo/functions/fnc_startUnload.sqf +++ b/addons/cargo/functions/fnc_startUnload.sqf @@ -26,7 +26,7 @@ if (GVAR(interactionParadrop)) exitWith { // Close the cargo menu closeDialog 0; - private _duration = GVAR(paradropTimeCoefficent) * (_item call FUNC(getSizeItem)); + private _duration = [_item, true] call FUNC(getDelayItem); // If drop time is 0, don't show a progress bar if (_duration <= 0) exitWith { @@ -81,7 +81,7 @@ if ([_item, GVAR(interactionVehicle), _unit] call FUNC(canUnloadItem)) then { // Close the cargo menu closeDialog 0; - private _duration = GVAR(loadTimeCoefficient) * (_item call FUNC(getSizeItem)); + private _duration = [_item, false] call FUNC(getDelayItem); // If unload time is 0, don't show a progress bar if (_duration <= 0) exitWith { diff --git a/addons/cargo/functions/fnc_unloadItem.sqf b/addons/cargo/functions/fnc_unloadItem.sqf index f32215fdd7d..e22d87a098b 100644 --- a/addons/cargo/functions/fnc_unloadItem.sqf +++ b/addons/cargo/functions/fnc_unloadItem.sqf @@ -96,6 +96,18 @@ if (_object isEqualType objNull) then { [QEGVAR(zeus,addObjects), [[_object], _objectCurators]] call CBA_fnc_serverEvent; }; + + // Reenable UAV crew + private _UAVCrew = _object getVariable [QGVAR(isUAV), []]; + + if (_UAVCrew isNotEqualTo []) then { + // Reenable AI + { + [_x, false] call EFUNC(common,disableAiUAV); + } forEach _UAVCrew; + + _object setVariable [QGVAR(isUAV), nil, true]; + }; } else { _object = createVehicle [_item, _emptyPosAGL, [], 0, "NONE"]; @@ -104,7 +116,7 @@ if (_object isEqualType objNull) then { _object setDir _direction; }; - _object setPosASL (AGLtoASL _emptyPosAGL); + _object setPosASL (AGLToASL _emptyPosAGL); [QEGVAR(common,fixCollision), _object] call CBA_fnc_localEvent; [QEGVAR(common,fixPosition), _object] call CBA_fnc_localEvent; diff --git a/addons/cargo/menu.hpp b/addons/cargo/menu.hpp index 1811369d7d5..51020335d45 100644 --- a/addons/cargo/menu.hpp +++ b/addons/cargo/menu.hpp @@ -8,16 +8,16 @@ class GVAR(menu) { class controlsBackground { class HeaderBackground: ACE_gui_backgroundBase { idc = -1; - SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; - x = "13 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "13 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + SizeEx = "(((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) * 1)"; + x = "13 * (((safeZoneW / safeZoneH) min 1.2) / 40) + (safeZoneX + (safeZoneW - ((safeZoneW / safeZoneH) min 1.2))/2)"; + y = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = "13 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; text = "#(argb,8,8,3)color(0,0,0,0)"; }; class CenterBackground: HeaderBackground { - y = "2.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - h = "14.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + y = "2.1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + h = "14.2 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; text = "#(argb,8,8,3)color(0,0,0,0.8)"; colorText[] = {0, 0, 0, "(profilenamespace getVariable ['GUI_BCG_RGB_A',0.9])"}; colorBackground[] = {0, 0, 0, "(profilenamespace getVariable ['GUI_BCG_RGB_A',0.9])"}; @@ -28,36 +28,36 @@ class GVAR(menu) { class HeaderName { idc = 1; type = CT_STATIC; - x = "13 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "13 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = "13 * (((safeZoneW / safeZoneH) min 1.2) / 40) + (safeZoneX + (safeZoneW - ((safeZoneW / safeZoneH) min 1.2))/2)"; + y = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = "13 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; style = QUOTE(ST_LEFT + ST_SHADOW); font = "RobotoCondensed"; - SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + SizeEx = "(((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) * 1)"; colorText[] = {0.95, 0.95, 0.95, 0.75}; colorBackground[] = {"(profilenamespace getVariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getVariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getVariable ['GUI_BCG_RGB_B',0.5])", "(profilenamespace getVariable ['GUI_BCG_RGB_A',0.9])"}; text = CSTRING(cargoMenu); }; class SubHeader: HeaderName { idc = 2; - x = "13 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "2.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "13 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = "13 * (((safeZoneW / safeZoneH) min 1.2) / 40) + (safeZoneX + (safeZoneW - ((safeZoneW / safeZoneH) min 1.2))/2)"; + y = "2.5 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = "13 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; style = ST_CENTER; colorText[] = {1, 1, 1, 0.9}; colorBackground[] = {0, 0, 0, 0}; - SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.2)"; + SizeEx = "(((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) * 1.2)"; text = ""; }; class cargoList: ACE_gui_listBoxBase { idc = 100; - x = "13.1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "12.8 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "10 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.7)"; + x = "13.1 * (((safeZoneW / safeZoneH) min 1.2) / 40) + (safeZoneX + (safeZoneW - ((safeZoneW / safeZoneH) min 1.2))/2)"; + y = "4 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = "12.8 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "10 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; + SizeEx = "(((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) * 0.7)"; rowHeight = 0.03; colorBackground[] = {0, 0, 0, 0.2}; colorText[] = {1, 1, 1, 1.0}; @@ -70,12 +70,12 @@ class GVAR(menu) { class btnCancel: ACE_gui_buttonBase { text = "$STR_DISP_CANCEL"; idc = 11; - x = "13.1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "14.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "6 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; - SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.7)"; + x = "13.1 * (((safeZoneW / safeZoneH) min 1.2) / 40) + (safeZoneX + (safeZoneW - ((safeZoneW / safeZoneH) min 1.2))/2)"; + y = "14.1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = "6 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; + size = "(((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) * 1)"; + SizeEx = "(((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) * 0.7)"; animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.9)"; animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.8)"; animTextureOver = "#(argb,8,8,3)color(1,1,1,1)"; @@ -96,13 +96,13 @@ class GVAR(menu) { class btnUnload: btnCancel { text = CSTRING(unloadObject); idc = 12; - x = "19.9 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + x = "19.9 * (((safeZoneW / safeZoneH) min 1.2) / 40) + (safeZoneX + (safeZoneW - ((safeZoneW / safeZoneH) min 1.2))/2)"; action = QUOTE(ACE_player call FUNC(startUnload)); }; class btnPlace: btnUnload { text = CSTRING(deployObject); idc = 13; - y = "15.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = "15.2 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; action = QUOTE(ACE_player call FUNC(startDeploy)); colorDisabled[] = {0.25, 0.25, 0.25, 1}; }; diff --git a/addons/cargo/renameMenu.hpp b/addons/cargo/renameMenu.hpp index b6acc9ad4e3..a3cb845c6b7 100644 --- a/addons/cargo/renameMenu.hpp +++ b/addons/cargo/renameMenu.hpp @@ -8,16 +8,16 @@ class GVAR(renameMenu) { class controlsBackground { class HeaderBackground: ACE_gui_backgroundBase { idc = -1; - SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; - x = "13 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "13 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + SizeEx = "(((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) * 1)"; + x = "13 * (((safeZoneW / safeZoneH) min 1.2) / 40) + (safeZoneX + (safeZoneW - ((safeZoneW / safeZoneH) min 1.2))/2)"; + y = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = "13 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; text = "#(argb,8,8,3)color(0,0,0,0)"; }; class CenterBackground: HeaderBackground { - y = "2.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - h = "2.9 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + y = "2.1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + h = "2.9 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; text = "#(argb,8,8,3)color(0,0,0,0.8)"; colorText[] = {0, 0, 0, "(profilenamespace getVariable ['GUI_BCG_RGB_A',0.9])"}; colorBackground[] = {0, 0, 0, "(profilenamespace getVariable ['GUI_BCG_RGB_A',0.9])"}; @@ -28,13 +28,13 @@ class GVAR(renameMenu) { class HeaderName { idc = 1; type = CT_STATIC; - x = "13 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "13 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = "13 * (((safeZoneW / safeZoneH) min 1.2) / 40) + (safeZoneX + (safeZoneW - ((safeZoneW / safeZoneH) min 1.2))/2)"; + y = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = "13 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; style = QUOTE(ST_LEFT + ST_SHADOW); font = "RobotoCondensed"; - SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + SizeEx = "(((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) * 1)"; colorText[] = {0.95, 0.95, 0.95, 0.75}; colorBackground[] = {"(profilenamespace getVariable ['GUI_BCG_RGB_R',0.69])", "(profilenamespace getVariable ['GUI_BCG_RGB_G',0.75])", "(profilenamespace getVariable ['GUI_BCG_RGB_B',0.5])", "(profilenamespace getVariable ['GUI_BCG_RGB_A',0.9])"}; text = CSTRING(renameObjectUI); @@ -43,21 +43,21 @@ class GVAR(renameMenu) { onLoad = QUOTE((_this select 0) ctrlSetText (GVAR(interactionVehicle) getVariable [ARR_2(QQGVAR(customName),'')])); idc = 100; canModify = 1; - x = "13.1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "2.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "12.8 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - SizeEx = "1.5 * (((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.7)"; + x = "13.1 * (((safeZoneW / safeZoneH) min 1.2) / 40) + (safeZoneX + (safeZoneW - ((safeZoneW / safeZoneH) min 1.2))/2)"; + y = "2.3 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = "12.8 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "1.5 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; + SizeEx = "1.5 * (((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) * 0.7)"; }; class btnCancel: ACE_gui_buttonBase { text = "$STR_DISP_CANCEL"; idc = 11; - x = "13.1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "3.9 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "5 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; - SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.7)"; + x = "13.1 * (((safeZoneW / safeZoneH) min 1.2) / 40) + (safeZoneX + (safeZoneW - ((safeZoneW / safeZoneH) min 1.2))/2)"; + y = "3.9 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = "5 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; + size = "(((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) * 1)"; + SizeEx = "(((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) * 0.7)"; animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.9)"; animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.8)"; animTextureOver = "#(argb,8,8,3)color(1,1,1,1)"; @@ -78,7 +78,7 @@ class GVAR(renameMenu) { class btnSave: btnCancel { text = ECSTRING(Common,Save); idc = 12; - x = "20.9 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + x = "20.9 * (((safeZoneW / safeZoneH) min 1.2) / 40) + (safeZoneX + (safeZoneW - ((safeZoneW / safeZoneH) min 1.2))/2)"; action = QUOTE(closeDialog 1; call FUNC(renameObject)); }; }; diff --git a/addons/cargo/stringtable.xml b/addons/cargo/stringtable.xml index 8e16f500901..43f707a19d8 100644 --- a/addons/cargo/stringtable.xml +++ b/addons/cargo/stringtable.xml @@ -343,6 +343,9 @@ <Russian>Не может быть выгружен</Russian> <Spanish>No puede ser descargado</Spanish> </Key> + <Key ID="STR_ACE_Cargo_checkSize"> + <English>Check Cargo Size</English> + </Key> <Key ID="STR_ACE_Cargo_SizeMenu"> <English>Cargo Size: %1</English> <German>Frachtgröße: %1</German> diff --git a/addons/casings/functions/fnc_createCasing.sqf b/addons/casings/functions/fnc_createCasing.sqf index fe35ad5945c..428d940414a 100644 --- a/addons/casings/functions/fnc_createCasing.sqf +++ b/addons/casings/functions/fnc_createCasing.sqf @@ -47,7 +47,7 @@ private _modelPath = GVAR(cachedCasings) getOrDefaultCall [_ammo, { if (_modelPath isEqualTo "") exitWith {}; -private _unitPos = getposASL _unit; +private _unitPos = getPosASL _unit; // Distant shooters don't produce as many cases if ((AGLToASL positionCameraToWorld [0,0,0]) vectorDistance _unitPos > 100 && {random 1 < 0.9}) exitWith {}; diff --git a/addons/chemlights/config.cpp b/addons/chemlights/config.cpp index 263fcb1a575..7f30429e798 100644 --- a/addons/chemlights/config.cpp +++ b/addons/chemlights/config.cpp @@ -3,6 +3,7 @@ class CfgPatches { class ADDON { + name = COMPONENT_NAME; units[] = {"ACE_Box_Chemlights","ACE_Item_Chemlight_Shield","ACE_Item_Chemlight_Shield_Green","ACE_Item_Chemlight_Shield_Red","ACE_Item_Chemlight_Shield_Blue","ACE_Item_Chemlight_Shield_Yellow","ACE_Item_Chemlight_Shield_Orange","ACE_Item_Chemlight_Shield_White","ModuleChemlightOrange","ModuleChemlightWhite","ModuleChemlightHiRed","ModuleChemlightHiYellow","ModuleChemlightHiWhite","ModuleChemlightHiBlue","ModuleChemlightHiGreen","ModuleChemlightUltraHiOrange"}; weapons[] = {"ACE_Chemlight_Shield", "ACE_Chemlight_Shield_Green","ACE_Chemlight_Shield_Red","ACE_Chemlight_Shield_Blue","ACE_Chemlight_Shield_Yellow","ACE_Chemlight_Shield_Orange","ACE_Chemlight_Shield_White"}; requiredVersion = REQUIRED_VERSION; diff --git a/addons/chemlights/script_component.hpp b/addons/chemlights/script_component.hpp index 324af2c55c1..5095ebe6664 100644 --- a/addons/chemlights/script_component.hpp +++ b/addons/chemlights/script_component.hpp @@ -1,4 +1,5 @@ #define COMPONENT chemlights +#define COMPONENT_BEAUTIFIED Chemlights #include "\z\ace\addons\main\script_mod.hpp" // #define DEBUG_MODE_FULL diff --git a/addons/common/CfgUIGrids.hpp b/addons/common/CfgUIGrids.hpp index 1e8963e03e1..7c48886bafd 100644 --- a/addons/common/CfgUIGrids.hpp +++ b/addons/common/CfgUIGrids.hpp @@ -5,13 +5,13 @@ class CfgUIGrids { class Variables { grid_ACE_displayText[] = { { - "((safezoneX + safezoneW) - (10 *(((safezoneW / safezoneH) min 1.2) / 40)) - 2.9 *(((safezoneW / safezoneH) min 1.2) / 40))", - "safeZoneY + 0.175 * safezoneH", - "(10 *(((safezoneW / safezoneH) min 1.2) / 40))", - "(3 *((((safezoneW / safezoneH) min 1.2) / 1.2) / 25))" + "((safeZoneX + safeZoneW) - (10 *(((safeZoneW / safeZoneH) min 1.2) / 40)) - 2.9 *(((safeZoneW / safeZoneH) min 1.2) / 40))", + "safeZoneY + 0.175 * safeZoneH", + "(10 *(((safeZoneW / safeZoneH) min 1.2) / 40))", + "(3 *((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25))" }, - "(((safezoneW / safezoneH) min 1.2) / 40)", - "((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)" + "(((safeZoneW / safeZoneH) min 1.2) / 40)", + "((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)" }; }; }; diff --git a/addons/common/CompassControl.hpp b/addons/common/CompassControl.hpp index 627e18d2f8d..16b1b3cf43d 100644 --- a/addons/common/CompassControl.hpp +++ b/addons/common/CompassControl.hpp @@ -10,7 +10,7 @@ #define POINTER_WIDTH_FACTOR (1/128) #define LEFT (0.5 - 8 * GUI_GRID_W) -#define TOP (safezoneY + 1.6 * GUI_GRID_H) +#define TOP (safeZoneY + 1.6 * GUI_GRID_H) #define WIDTH (16 * GUI_GRID_W) #define HEIGHT (0.5 * GUI_GRID_H) diff --git a/addons/common/DisableMouseDialog.hpp b/addons/common/DisableMouseDialog.hpp index 75689cf6526..1d1d6cfaa74 100644 --- a/addons/common/DisableMouseDialog.hpp +++ b/addons/common/DisableMouseDialog.hpp @@ -8,10 +8,10 @@ class GVAR(DisableMouse_Dialog) { class Background: ctrlMapEmpty { idc = 101; fade = 1; - x = "safezoneXAbs"; - y = "safezoneY"; - w = "safezoneWAbs"; - h = "safezoneH"; + x = "safeZoneXAbs"; + y = "safeZoneY"; + w = "safeZoneWAbs"; + h = "safeZoneH"; }; }; }; diff --git a/addons/common/HintConfig.hpp b/addons/common/HintConfig.hpp index c299bee8dfb..c3eda57d6bb 100644 --- a/addons/common/HintConfig.hpp +++ b/addons/common/HintConfig.hpp @@ -39,11 +39,11 @@ class RscTitles { idc = 1; text = ""; //size = "1 / 40 / (getResolution select 5)"; - SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + SizeEx = "(((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) * 1)"; colorText[] = {1, 1, 1, 1}; colorBackground[] = {0, 0, 0, 0.5}; - x = "safeZoneW + safeZoneX - 0 * safezoneW"; //safeZoneW + safeZoneX - 0.2 * safezoneW; - y = "safeZoneY + 0.2 * safezoneH"; + x = "safeZoneW + safeZoneX - 0 * safeZoneW"; //safeZoneW + safeZoneX - 0.2 * safeZoneW; + y = "safeZoneY + 0.2 * safeZoneH"; w = "0.2 * safeZoneW"; h = "0.1 * SafeZoneH"; font = "RobotoCondensed"; @@ -63,11 +63,11 @@ class RscTitles { idc = 1; text = ""; //size = "1 / 40 / (getResolution select 5)"; - SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + SizeEx = "(((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) * 1)"; colorText[] = {1, 1, 1, 1}; colorBackground[] = {0.8, 0, 0, 0.5}; x = "0.3 * safeZoneW + safeZoneX"; - y = "0.4 * safezoneH + safeZoneY"; + y = "0.4 * safeZoneH + safeZoneY"; w = "0.4 * safeZoneW"; h = "0.2 * SafeZoneH"; }; diff --git a/addons/common/ProgressScreen.hpp b/addons/common/ProgressScreen.hpp index bef2994e7d9..c3026a9fe4f 100644 --- a/addons/common/ProgressScreen.hpp +++ b/addons/common/ProgressScreen.hpp @@ -18,28 +18,28 @@ class GVAR(ProgressBar_Dialog) { size = 1; colorBackground[] = {0, 0, 0, 0.0}; colorText[] = {0, 0, 0, 0}; - x = "safezoneX"; - y = "safezoneY"; - w = "safezoneW"; - h = "safezoneH"; + x = "safeZoneX"; + y = "safeZoneY"; + w = "safeZoneW"; + h = "safeZoneH"; }; class TitleBackground: ACE_gui_staticBase { idc = 1; style = ST_CENTER; - sizeEx = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + sizeEx = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; colorBackground[] = {0, 0, 0, 0.5}; colorText[] = {1, 1, 1, 1}; - x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "0 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = "1 * (((safeZoneW / safeZoneH) min 1.2) / 40) + (safeZoneX + (safeZoneW - ((safeZoneW / safeZoneH) min 1.2))/2)"; + y = "0 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = "38 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class Progress: ACE_gui_RscProgress { idc = 2; - x = "1.2 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "0.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = "1.2 * (((safeZoneW / safeZoneH) min 1.2) / 40) + (safeZoneX + (safeZoneW - ((safeZoneW / safeZoneH) min 1.2))/2)"; + y = "0.1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = "38 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; colorFrame[] = {1,1,1,0.5}; colorBar[] = {"(profilenamespace getVariable ['GUI_BCG_RGB_R',0.77])","(profilenamespace getVariable ['GUI_BCG_RGB_G',0.51])","(profilenamespace getVariable ['GUI_BCG_RGB_B',0.08])","(profilenamespace getVariable ['GUI_BCG_RGB_A',0.8])"}; texture = "#(argb,8,8,3)color(1,1,1,0.7)"; diff --git a/addons/common/RscInfoType.hpp b/addons/common/RscInfoType.hpp index 672d043276c..89d3c02ec1d 100644 --- a/addons/common/RscInfoType.hpp +++ b/addons/common/RscInfoType.hpp @@ -6,19 +6,19 @@ class RscInGameUI { }; class RscUnitInfoSoldier: RscUnitInfo { - onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgSoldier',_this select 0)]; [ARR_2('ace_infoDisplayChanged',[ARR_2(_this select 0,'Soldier')])] call CBA_fnc_localEvent;); + onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uiNamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgSoldier',_this select 0)]; [ARR_2('ace_infoDisplayChanged',[ARR_2(_this select 0,'Soldier')])] call CBA_fnc_localEvent;); }; class RscUnitInfoTank: RscUnitInfo { - onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgVehicle',_this select 0)];); + onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uiNamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgVehicle',_this select 0)];); }; class RscUnitInfoAirNoWeapon: RscUnitInfo { - onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgAircraft',_this select 0)];); + onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uiNamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgAircraft',_this select 0)];); }; class RscUnitInfoAir: RscUnitInfoAirNoWeapon { - onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgAircraft',_this select 0)];); + onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uiNamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgAircraft',_this select 0)];); }; class RscUnitInfo_AH64D_gunner { @@ -30,11 +30,11 @@ class RscInGameUI { }; class RscUnitInfoSubmarine: RscUnitInfo { - onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgSubmarine',_this select 0)];); + onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uiNamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgSubmarine',_this select 0)];); }; class RscUnitInfoShip: RscUnitInfo { - onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgShip',_this select 0)];); + onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uiNamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgShip',_this select 0)];); }; class RscWeaponEmpty { @@ -94,7 +94,7 @@ class RscInGameUI { }; class RscUnitInfoParachute: RscUnitInfo { - onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgParachute',_this select 0)]; [ARR_2('ace_infoDisplayChanged',[ARR_2(_this select 0,'Parachute')])] call CBA_fnc_localEvent;); + onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uiNamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgParachute',_this select 0)]; [ARR_2('ace_infoDisplayChanged',[ARR_2(_this select 0,'Parachute')])] call CBA_fnc_localEvent;); }; class RscUnitVehicle { @@ -106,10 +106,10 @@ class RscInGameUI { }; class RscStaminaBar { - onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscStaminaBar"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2(QUOTE(QGVAR(dlgStaminaBar)),_this select 0)]); + onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscStaminaBar"",'IGUI')] call (uiNamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2(QUOTE(QGVAR(dlgStaminaBar)),_this select 0)]); }; class RscStanceInfo { - onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscStanceInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); [ARR_2('ace_infoDisplayChanged',[ARR_2(_this select 0,'Stance')])] call CBA_fnc_localEvent;); + onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscStanceInfo"",'IGUI')] call (uiNamespace getvariable 'BIS_fnc_initDisplay'); [ARR_2('ace_infoDisplayChanged',[ARR_2(_this select 0,'Stance')])] call CBA_fnc_localEvent;); }; }; diff --git a/addons/common/XEH_PREP.hpp b/addons/common/XEH_PREP.hpp index 3a5838a230f..529da07da2b 100644 --- a/addons/common/XEH_PREP.hpp +++ b/addons/common/XEH_PREP.hpp @@ -43,6 +43,7 @@ PREP(deviceKeyFindValidIndex); PREP(deviceKeyRegisterNew); PREP(deprecateComponent); PREP(disableAI); +PREP(disableAiUAV); PREP(disableUserInput); PREP(displayIcon); PREP(displayText); @@ -177,6 +178,7 @@ PREP(setupLocalUnitsHandler); PREP(setVariableJIP); PREP(setVariablePublic); PREP(setVolume); +PREP(setWeaponLightLaserState); PREP(showHud); PREP(statusEffect_addType); PREP(statusEffect_get); @@ -189,6 +191,7 @@ PREP(stopGesture); PREP(stringCompare); PREP(stringToColoredText); PREP(swayLoop); +PREP(switchAttachmentMode); PREP(switchPersistentLaser); PREP(switchToGroupSide); PREP(throttledPublicVariable); @@ -266,6 +269,7 @@ PREP(_handleRequestAllSyncedEvents); // other eventhandlers PREP(addActionEventHandler); PREP(addActionMenuEventHandler); +PREP(addExplosionEventHandler); PREP(addMapMarkerCreatedEventHandler); PREP(addPlayerEH); diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index b569a4608e4..98520aef937 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -19,16 +19,16 @@ //Status Effect EHs: [QGVAR(setStatusEffect), LINKFUNC(statusEffect_set)] call CBA_fnc_addEventHandler; -["forceWalk", false, ["ace_advanced_fatigue", "ACE_SwitchUnits", "ACE_Attach", "ace_dragging", "ACE_Explosives", "ACE_Ladder", "ACE_Sandbag", "ACE_refuel", "ACE_rearm", "ACE_Trenches", "ace_medical_fracture"]] call FUNC(statusEffect_addType); -["blockSprint", false, ["ace_advanced_fatigue", "ace_dragging", "ace_medical_fracture"]] call FUNC(statusEffect_addType); -["setCaptive", true, [QEGVAR(captives,Handcuffed), QEGVAR(captives,Surrendered)]] call FUNC(statusEffect_addType); -["blockDamage", false, ["fixCollision", "ACE_cargo"]] call FUNC(statusEffect_addType); -["blockEngine", false, ["ACE_Refuel"]] call FUNC(statusEffect_addType); -["blockThrow", false, ["ACE_Attach", "ACE_concertina_wire", "ace_dragging", "ACE_Explosives", "ACE_Ladder", "ACE_rearm", "ACE_refuel", "ACE_Sandbag", "ACE_Trenches", "ACE_tripod"]] call FUNC(statusEffect_addType); +["forceWalk", false, ["ace_advanced_fatigue", "ace_attach", "ace_dragging", "ace_explosives", QEGVAR(medical,fracture), "ace_rearm", "ace_refuel", "ace_sandbag", "ace_switchunits", "ace_tacticalladder", "ace_trenches"]] call FUNC(statusEffect_addType); +["blockSprint", false, ["ace_advanced_fatigue", "ace_dragging", QEGVAR(medical,fracture)]] call FUNC(statusEffect_addType); +["setCaptive", true, [QEGVAR(captives,handcuffed), QEGVAR(captives,surrendered)]] call FUNC(statusEffect_addType); +["blockDamage", false, ["fixCollision", "ace_cargo"]] call FUNC(statusEffect_addType); +["blockEngine", false, ["ace_refuel"]] call FUNC(statusEffect_addType); +["blockThrow", false, ["ace_attach", "ace_concertina_wire", "ace_dragging", "ace_explosives", "ace_rearm", "ace_refuel", "ace_sandbag", "ace_tacticalladder", "ace_trenches", "ace_tripod"]] call FUNC(statusEffect_addType); ["setHidden", true, ["ace_unconscious"]] call FUNC(statusEffect_addType); -["blockRadio", false, [QEGVAR(captives,Handcuffed), QEGVAR(captives,Surrendered), "ace_unconscious"]] call FUNC(statusEffect_addType); +["blockRadio", false, [QEGVAR(captives,handcuffed), QEGVAR(captives,surrendered), "ace_unconscious"]] call FUNC(statusEffect_addType); ["blockSpeaking", false, ["ace_unconscious"]] call FUNC(statusEffect_addType); -["disableWeaponAssembly", false, ["ace_common", "ace_common_lockVehicle", "ace_csw"]] call FUNC(statusEffect_addType); +["disableWeaponAssembly", false, ["ace_common", QGVAR(lockVehicle), "ace_csw"]] call FUNC(statusEffect_addType); ["lockInventory", true, [], true] call FUNC(statusEffect_addType); [QGVAR(forceWalk), { @@ -133,6 +133,30 @@ _object lockInventory (_set > 0); }] call CBA_fnc_addEventHandler; +[QGVAR(disableAiUAV), { + params ["_unit", "_disable"]; + + if (_disable) then { + private _features = ["AUTOTARGET", "TARGET", "WEAPONAIM"/*, "FIREWEAPON"*/, "RADIOPROTOCOL"]; // TODO: Uncomment in 2.18 + + // Save current status + _unit setVariable [QGVAR(featuresAiUAV), _features apply {[_x, _unit checkAIFeature _x]}]; + + { + _unit enableAIFeature [_x, false]; + } forEach _features; + } else { + // Restore previous status + private _features = _unit getVariable [QGVAR(featuresAiUAV), []]; + + { + _unit enableAIFeature [_x select 0, _x select 1]; + } forEach _features; + + _unit setVariable [QGVAR(featuresAiUAV), nil]; + }; +}] call CBA_fnc_addEventHandler; + //Add a fix for BIS's zeus remoteControl module not reseting variables on DC when RC a unit //This variable is used for isPlayer checks if (isServer) then { @@ -141,7 +165,7 @@ if (isServer) then { private _zeusLogic = getAssignedCuratorLogic _dcPlayer; if ((!isNil "_zeusLogic") && {!isNull _zeusLogic}) then { { - if ((_x getvariable ["bis_fnc_moduleRemoteControl_owner", objnull]) isEqualTo _dcPlayer) exitWith { + if ((_x getVariable ["bis_fnc_moduleRemoteControl_owner", objNull]) isEqualTo _dcPlayer) exitWith { INFO_3("[%1] DC - Was Zeus [%2] while controlling unit [%3] - manually clearing `bis_fnc_moduleRemoteControl_owner`",[_x] call FUNC(getName),_dcPlayer,_x); _x setVariable ["bis_fnc_moduleRemoteControl_owner", nil, true]; }; @@ -173,7 +197,7 @@ if (isServer) then { [QGVAR(unlockVehicle), { _this lock (_this getVariable [QGVAR(lockStatus), locked _this]); - if ([] isNotEqualTo getArray (configOf _target >> "assembleInfo" >> "dissasembleTo")) then { + if ([] isNotEqualTo getArray (configOf _this >> "assembleInfo" >> "dissasembleTo")) then { [_this, "disableWeaponAssembly", QGVAR(lockVehicle), false] call FUNC(statusEffect_set); }; }] call CBA_fnc_addEventHandler; @@ -191,7 +215,9 @@ if (isServer) then { [QGVAR(switchMove), {(_this select 0) switchMove (_this select 1)}] call CBA_fnc_addEventHandler; [QGVAR(setVectorDirAndUp), {(_this select 0) setVectorDirAndUp (_this select 1)}] call CBA_fnc_addEventHandler; [QGVAR(addWeaponItem), {(_this select 0) addWeaponItem [(_this select 1), (_this select 2)]}] call CBA_fnc_addEventHandler; +[QGVAR(addMagazineTurret), {(_this select 0) addMagazineTurret (_this select 1)}] call CBA_fnc_addEventHandler; [QGVAR(removeMagazinesTurret), {(_this select 0) removeMagazinesTurret [_this select 1, _this select 2]}] call CBA_fnc_addEventHandler; +[QGVAR(triggerAmmo), {triggerAmmo _this}] call CBA_fnc_addEventHandler; [QGVAR(setVanillaHitPointDamage), { params ["_object", "_hitPointAnddamage"]; @@ -470,10 +496,10 @@ GVAR(reloadMutex_lastMagazines) = []; private _isLauncher = _weapon isKindOf ["Launcher", configFile >> "CfgWeapons"]; private _duration = 0; if (_isLauncher) then { - _duration = getNumber (configfile >> "CfgMovesMaleSdr" >> "States" >> _gesture >> "speed"); + _duration = getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> _gesture >> "speed"); }; if (_duration == 0) then { - _duration = getNumber (configfile >> "CfgGesturesMale" >> "States" >> _gesture >> "speed"); + _duration = getNumber (configFile >> "CfgGesturesMale" >> "States" >> _gesture >> "speed"); }; if (_duration != 0) then { @@ -536,7 +562,7 @@ GVAR(reloadMutex_lastMagazines) = []; // Lastly, do JIP events // JIP Detection and event trigger. Run this at the very end, just in case anything uses it // Note: usage of player is most likely on purpose -if (didJip) then { +if (didJIP) then { // We are jipping! Get ready and wait, and throw the event [{ if(!isNull player && GVAR(settingsInitFinished)) then { diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index b559cb5dd90..f2194deb64f 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -12,6 +12,8 @@ GVAR(showHudHash) = createHashMap; GVAR(vehicleIconCache) = createHashMap; // for getVehicleIcon GVAR(wheelSelections) = createHashMap; +GVAR(InteractionConditions) = createHashMap; + GVAR(blockItemReplacement) = false; // Cache for FUNC(isModLoaded) diff --git a/addons/common/XEH_preStart.sqf b/addons/common/XEH_preStart.sqf index 208adea7b15..5e02fb26f17 100644 --- a/addons/common/XEH_preStart.sqf +++ b/addons/common/XEH_preStart.sqf @@ -3,7 +3,7 @@ #include "XEH_PREP.hpp" if (isFilePatchingEnabled) then { - private _notLoaded = configProperties [configfile >> "ace_notLoaded", "isText _x"]; + private _notLoaded = configProperties [configFile >> "ace_notLoaded", "isText _x"]; { INFO_2("%1 not loaded because %2",configName _x,getText _x); } forEach _notLoaded; @@ -15,3 +15,25 @@ uiNamespace setVariable [QGVAR(addonCache), createHashMap]; // Cache for FUNC(getConfigName) uiNamespace setVariable [QGVAR(configNames), createHashMap]; + +//Add warnings for missing compat PBOs +GVAR(isModLoadedCache) = createHashMap; +{ + _x params ["_modPBO", "_compatPBO"]; + if ([_modPBO] call FUNC(isModLoaded) && {!([_compatPBO] call FUNC(isModLoaded))}) then { + WARNING_2("Weapon Mod [%1] missing ace compat pbo [%2]",_modPBO,_compatPBO); + }; +} forEach [ + ["CUP_Creatures_People_LoadOrder","ace_compat_cup_units"], + ["CUP_Vehicles_LoadOrder","ace_compat_cup_vehicles"], + ["CUP_Weapons_LoadOrder","ace_compat_cup_weapons"], + ["r3f_armes_c","ace_compat_r3f"], + ["RF_Data_Loadorder","ace_compat_rf"], + ["RH_acc","ace_compat_rh_acc"], + ["RH_de_cfg","ace_compat_rh_de"], + ["RH_m4_cfg","ace_compat_rh_m4"], + ["RH_PDW","ace_compat_rh_pdw"], + ["RKSL_PMII","ace_compat_rksl_pm_ii"], + ["iansky_opt","ace_compat_sma3_iansky"], + ["R3F_Armes","ace_compat_r3f"] +]; diff --git a/addons/common/config.cpp b/addons/common/config.cpp index 144e7d96c61..f7b27ce3749 100644 --- a/addons/common/config.cpp +++ b/addons/common/config.cpp @@ -70,8 +70,6 @@ class ctrlMapEmpty; #include "CompassControl.hpp" #include "CfgUIGrids.hpp" -class ACE_Extensions {}; - class ACE_Tests { vehicleTransportInventory = QPATHTOF(dev\test_vehicleInventory.sqf); mapConfigs = QPATHTOF(dev\test_mapConfigs.sqf); diff --git a/addons/common/define.hpp b/addons/common/define.hpp index ce8765ec9f4..e27c369146b 100644 --- a/addons/common/define.hpp +++ b/addons/common/define.hpp @@ -107,7 +107,7 @@ class ACE_gui_editBase { style = "0x00 + 0x40"; font = "RobotoCondensed"; shadow = 2; - sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + sizeEx = "(((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) * 1)"; colorDisabled[] = {1, 1, 1, 0.25}; }; @@ -187,10 +187,10 @@ class ACE_gui_RscProgress { colorFrame[] = {1, 1, 1, 0.7}; colorBar[] = {1, 1, 1, 0.7}; texture = "#(argb,8,8,3)color(1,1,1,0.7)"; - x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "10 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "0.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = "1 * (((safeZoneW / safeZoneH) min 1.2) / 40) + (safeZoneX + (safeZoneW - ((safeZoneW / safeZoneH) min 1.2))/2)"; + y = "10 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = "38 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "0.5 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class ACE_gui_staticBase { @@ -384,9 +384,9 @@ class ACE_gui_comboBoxBase: RscCombo { class ACE_gui_mapBase { moveOnEdges = 1; x = "SafeZoneXAbs"; - y = "SafeZoneY + 1.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + y = "SafeZoneY + 1.5 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; w = "SafeZoneWAbs"; - h = "SafeZoneH - 1.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + h = "SafeZoneH - 1.5 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; type = 100; // Use 100 to hide markers style = 48; shadow = 0; @@ -440,15 +440,15 @@ class ACE_gui_mapBase { onMouseButtonDblClick = ""; fontLabel = "RobotoCondensed"; - sizeExLabel = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8)"; + sizeExLabel = "(((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) * 0.8)"; fontGrid = "TahomaB"; sizeExGrid = 0.02; fontUnits = "TahomaB"; - sizeExUnits = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8)"; + sizeExUnits = "(((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) * 0.8)"; fontNames = "RobotoCondensed"; - sizeExNames = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8) * 2"; + sizeExNames = "(((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) * 0.8) * 2"; fontInfo = "RobotoCondensed"; - sizeExInfo = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8)"; + sizeExInfo = "(((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) * 0.8)"; fontLevel = "TahomaB"; sizeExLevel = 0.02; text = "#(argb,8,8,3)color(1,1,1,1)"; @@ -458,12 +458,12 @@ class ACE_gui_mapBase { size = 50; }; class Legend { - x = "SafeZoneX + (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "SafeZoneY + safezoneH - 4.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "10 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "3.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = "SafeZoneX + (((safeZoneW / safeZoneH) min 1.2) / 40)"; + y = "SafeZoneY + safeZoneH - 4.5 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; + w = "10 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "3.5 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; font = "RobotoCondensed"; - sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8)"; + sizeEx = "(((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) * 0.8)"; colorBackground[] = {1, 1, 1, 0.5}; color[] = {0, 0, 0, 1}; }; diff --git a/addons/common/dev/test_mapConfigs.sqf b/addons/common/dev/test_mapConfigs.sqf index 369b2b18089..261dc0a9abd 100644 --- a/addons/common/dev/test_mapConfigs.sqf +++ b/addons/common/dev/test_mapConfigs.sqf @@ -28,7 +28,7 @@ private _maps = configProperties [configFile >> "CfgWorldList", "(isClass _x)", private _stepX = 1e10; private _stepY = 1e10; { - private _zoom = getnumber (_x >> "zoomMax"); + private _zoom = getNumber (_x >> "zoomMax"); if (_zoom < _zoomMax) then { _zoomMax = _zoom; _formatX = getText (_x >> "formatX"); diff --git a/addons/common/functions/fnc_ASLToPosition.sqf b/addons/common/functions/fnc_ASLToPosition.sqf index b99e9fb88a3..991e79c4331 100644 --- a/addons/common/functions/fnc_ASLToPosition.sqf +++ b/addons/common/functions/fnc_ASLToPosition.sqf @@ -20,5 +20,5 @@ if (surfaceIsWater _this) then { _this } else { - ASLtoATL _this + ASLToATL _this }; diff --git a/addons/common/functions/fnc_addCanInteractWithCondition.sqf b/addons/common/functions/fnc_addCanInteractWithCondition.sqf index 3dce27cf554..1d315f5aa53 100644 --- a/addons/common/functions/fnc_addCanInteractWithCondition.sqf +++ b/addons/common/functions/fnc_addCanInteractWithCondition.sqf @@ -19,17 +19,4 @@ params ["_conditionName", "_conditionFunc"]; _conditionName = toLowerANSI _conditionName; - -private _conditions = missionNamespace getVariable [QGVAR(InteractionConditions), [[],[]]]; -_conditions params ["_conditionNames", "_conditionFuncs"]; - -private _index = _conditionNames find _conditionName; - -if (_index == -1) then { - _index = count _conditionNames; -}; - -_conditionNames set [_index, _conditionName]; -_conditionFuncs set [_index, _conditionFunc]; - -GVAR(InteractionConditions) = _conditions; +GVAR(InteractionConditions) set [_conditionName, _conditionFunc]; diff --git a/addons/common/functions/fnc_addExplosionEventHandler.sqf b/addons/common/functions/fnc_addExplosionEventHandler.sqf new file mode 100644 index 00000000000..9fb5ef80f24 --- /dev/null +++ b/addons/common/functions/fnc_addExplosionEventHandler.sqf @@ -0,0 +1,48 @@ +#include "..\script_component.hpp" +/* + * Author: johnb432, PabstMirror + * Adds event hander for explosions (for local projectiles) + * Warning: For shots that are tracers and explosive the event will trigger on all machines in range + * This function may be changed after 2.18! + * + * Arguments: + * 0: Code to execute <CODE> + * + * Return Value: + * The CBA Event Handler Index <NUMBER> + * + * Example: + * [{systemChat "boom"}] call ace_common_fnc_addExplosionEventHandler + * + * Public: No (maybe after 2.18) + */ + +params [["_code", {}, [{}]]]; + +if !(missionNamespace getVariable [QGVAR(addExplosionEventHandlerActive), false]) then { + GVAR(addExplosionEventHandlerActive) = true; + + // Add EH to existing projectiles and mines + { + TRACE_2("existing",typeOf _x,local _x); + // Rockets only explode on local clients + _x addEventHandler ["Explode", { + TRACE_1("exp (existing)",_this); + [QGVAR(explosion), _this] call CBA_fnc_localEvent; + }]; + } forEach ((8 allObjects 2) select {local _x}); + + addMissionEventHandler ["ProjectileCreated", { + params ["_projectile"]; + TRACE_2("pc",typeOf _projectile,local _projectile); + + if (!local _projectile) exitWith {}; // Rockets only explode on local clients + + _projectile addEventHandler ["Explode", { + TRACE_1("exp",_this); + [QGVAR(explosion), _this] call CBA_fnc_localEvent; + }]; + }]; +}; + +[QGVAR(explosion), _code] call CBA_fnc_addEventHandler diff --git a/addons/common/functions/fnc_addLineToDebugDraw.sqf b/addons/common/functions/fnc_addLineToDebugDraw.sqf index 016c99ddf48..3d6309fdd43 100644 --- a/addons/common/functions/fnc_addLineToDebugDraw.sqf +++ b/addons/common/functions/fnc_addLineToDebugDraw.sqf @@ -25,10 +25,10 @@ if (isNil QGVAR(debugLines)) then { }; if (count GVAR(debugLines) < 100) then { - GVAR(debugLines) pushBack [ASLtoAGL _startASL, ASLtoAGL _endASL, _color]; + GVAR(debugLines) pushBack [ASLToAGL _startASL, ASLToAGL _endASL, _color]; GVAR(debugLinesIndex) = 0; } else { - GVAR(debugLines) set [GVAR(debugLinesIndex), [ASLtoAGL _startASL, ASLtoAGL _endASL, _color]]; + GVAR(debugLines) set [GVAR(debugLinesIndex), [ASLToAGL _startASL, ASLToAGL _endASL, _color]]; GVAR(debugLinesIndex) = (GVAR(debugLinesIndex) + 1) mod 100; }; diff --git a/addons/common/functions/fnc_canInteractWith.sqf b/addons/common/functions/fnc_canInteractWith.sqf index dd684d0619b..134a3101e4b 100644 --- a/addons/common/functions/fnc_canInteractWith.sqf +++ b/addons/common/functions/fnc_canInteractWith.sqf @@ -27,15 +27,11 @@ private _owner = _target getVariable [QGVAR(owner), objNull]; if (!isNull _owner && {_unit != _owner}) exitWith {false}; // check general conditions -private _conditions = missionNamespace getVariable [QGVAR(InteractionConditions), [[],[]]]; -_conditions params ["_conditionNames", "_conditionFuncs"]; - private _canInteract = true; - { - if (!(_x in _exceptions) && {!([_unit, _target] call (_conditionFuncs select _forEachIndex))}) exitWith { + if (!(_x in _exceptions) && {!([_unit, _target] call _y)}) exitWith { _canInteract = false; }; -} forEach _conditionNames; +} forEach GVAR(InteractionConditions); _canInteract diff --git a/addons/common/functions/fnc_cbaSettings.sqf b/addons/common/functions/fnc_cbaSettings.sqf index 29e4d532b1f..bd23fef6976 100644 --- a/addons/common/functions/fnc_cbaSettings.sqf +++ b/addons/common/functions/fnc_cbaSettings.sqf @@ -88,7 +88,7 @@ for "_index" from 0 to (_countOptions - 1) do { if (isNil (configName _optionEntry)) then { [_optionEntry] call FUNC(cbaSettings_loadFromConfig); } else { - WARNING_1("Setting [%1] - Already defined from somewhere else??",_varName); + WARNING_1("Setting [%1] - Already defined from somewhere else??",configName _optionEntry); }; #ifdef DEBUG_MODE_FULL } else { @@ -104,7 +104,7 @@ for "_index" from 0 to (_countOptions - 1) do { private _optionEntry = _missionSettingsConfig select _index; private _settingName = configName _optionEntry; if ((toLowerANSI _settingName) in GVAR(cbaSettings_forcedSettings)) then { - WARNING_1("Setting [%1] - Already Forced - ignoring missionConfig",_varName); + WARNING_1("Setting [%1] - Already Forced - ignoring missionConfig",configName _optionEntry); } else { if ((isNil _settingName) && {(getNumber (_settingsConfig >> _settingName >> "movedToSQF")) == 0}) then { // New setting, that was first defined in missionConfigFile diff --git a/addons/common/functions/fnc_checkFiles.sqf b/addons/common/functions/fnc_checkFiles.sqf index 7b90a1b0a85..185ec7e5d1a 100644 --- a/addons/common/functions/fnc_checkFiles.sqf +++ b/addons/common/functions/fnc_checkFiles.sqf @@ -103,47 +103,29 @@ if (_oldCompats isNotEqualTo []) then { /////////////// private _platform = toLowerANSI (productVersion select 6); -if (!isServer && {_platform in ["linux", "osx"]}) then { +if (_platform in ["linux", "osx"]) then { // Linux and OSX client ports do not support extensions at all - INFO("Operating system does not support extensions"); + if (hasInterface) then { + WARNING("Operating system does not support extensions"); + } else { + INFO("Operating system does not support extensions"); + }; } else { - { - private _extension = configName _x; - private _isWindows = _platform == "windows" && {getNumber (_x >> "windows") == 1}; - private _isLinux = _platform == "linux" && {getNumber (_x >> "linux") == 1}; - private _isClient = hasInterface && {getNumber (_x >> "client") == 1}; - private _isServer = !hasInterface && {getNumber (_x >> "server") == 1}; - - if ((_isWindows || _isLinux) && {_isClient || _isServer}) then { - private _versionEx = _extension callExtension "version"; - - if (_versionEx == "") then { - private _extensionFile = _extension; - - if (productVersion select 7 == "x64") then { - _extensionFile = format ["%1_x64", _extensionFile]; - }; - - private _platformExt = [".dll", ".so"] select (_platform == "linux"); - _extensionFile = format ["%1%2", _extensionFile, _platformExt]; + ("ace" callExtension ["version", []]) params [["_versionEx", "", [""]], ["_returnCode", -1, [-1]]]; - private _errorMsg = format ["Extension %1 not found.", _extensionFile]; - ERROR(_errorMsg); + if (_returnCode != 0 || {_versionEx == ""}) then { + private _errorMsg = format ["Extension not found. [Return Code: %1]", _returnCode]; + ERROR(_errorMsg); - if (hasInterface) then { - ["[ACE] ERROR", _errorMsg] call FUNC(errorMessage); - }; - } else { - // Print the current extension version - INFO_2("Extension version: %1: %2",_extension,_versionEx); - }; + if (hasInterface) then { + ["[ACE] ERROR", _errorMsg] call FUNC(errorMessage); }; - } forEach ("true" configClasses (configFile >> "ACE_Extensions")); + } else { + _versionEx = _versionEx select [0, 8]; // git hash + INFO_1("Extension [Version: %1]",_versionEx); + }; }; -if (isArray (configFile >> "ACE_Extensions" >> "extensions")) then { - WARNING("extensions[] array no longer supported"); -}; /////////////// // Check server version/addons @@ -162,7 +144,7 @@ if (isMultiplayer) then { publicVariable QGVAR(serverAddons); publicVariable QGVAR(serverSource); } else { - GVAR(clientVersion) = _version; + GVAR(clientVersion) = _mainVersion; GVAR(clientAddons) = _addons; private _fnc_check = { diff --git a/addons/common/functions/fnc_checkFiles_diagnoseACE.sqf b/addons/common/functions/fnc_checkFiles_diagnoseACE.sqf index f9271ca2137..82241c45274 100644 --- a/addons/common/functions/fnc_checkFiles_diagnoseACE.sqf +++ b/addons/common/functions/fnc_checkFiles_diagnoseACE.sqf @@ -16,7 +16,7 @@ */ // Only run once -if (missionNameSpace getVariable [QGVAR(checkFiles_diagnoseACE), false]) exitWith { +if (missionNamespace getVariable [QGVAR(checkFiles_diagnoseACE), false]) exitWith { createHashMap // return }; diff --git a/addons/common/functions/fnc_checkPBOs.sqf b/addons/common/functions/fnc_checkPBOs.sqf index 4f2e3f4fa6b..d54fda78ba8 100644 --- a/addons/common/functions/fnc_checkPBOs.sqf +++ b/addons/common/functions/fnc_checkPBOs.sqf @@ -38,6 +38,7 @@ if (!_checkAll) exitWith {}; if (!isServer) then { ["ace_versioning_clientCheckDone", { // Don't let this event get triggered again + //IGNORE_PRIVATE_WARNING ["_thisType", "_thisId", "_thisArgs"]; [_thisType, _thisId] call CBA_fnc_removeEventHandler; params ["_clientErrors"]; diff --git a/addons/common/functions/fnc_checkVersionNumber.sqf b/addons/common/functions/fnc_checkVersionNumber.sqf index a2861299174..61ed7f62313 100644 --- a/addons/common/functions/fnc_checkVersionNumber.sqf +++ b/addons/common/functions/fnc_checkVersionNumber.sqf @@ -155,7 +155,7 @@ private _fnc_check = { // Wait for server to send the servers files and version numbers if (isNil "ACE_Version_ServerVersions") then { - ACE_Version_ServerVersions addPublicVariableEventHandler _fnc_check; + "ACE_Version_ServerVersions" addPublicVariableEventHandler _fnc_check; } else { call _fnc_check; }; diff --git a/addons/common/functions/fnc_claim.sqf b/addons/common/functions/fnc_claim.sqf index 997d54f33b8..170c2c6a8f3 100644 --- a/addons/common/functions/fnc_claim.sqf +++ b/addons/common/functions/fnc_claim.sqf @@ -30,10 +30,10 @@ _target setVariable [QGVAR(owner), _unit, true]; // lock target object if (_lockTarget) then { - if (!isNull _unit) then { - [QGVAR(lockVehicle), _target, _target] call CBA_fnc_targetEvent; - } else { + if (isNull _unit) then { [QGVAR(unlockVehicle), _target, _target] call CBA_fnc_targetEvent; + } else { + [QGVAR(lockVehicle), _target, _target] call CBA_fnc_targetEvent; }; }; diff --git a/addons/common/functions/fnc_defineVariable.sqf b/addons/common/functions/fnc_defineVariable.sqf index 85eb7b447f2..e0e7c49e4de 100644 --- a/addons/common/functions/fnc_defineVariable.sqf +++ b/addons/common/functions/fnc_defineVariable.sqf @@ -24,7 +24,7 @@ params ["_name", "_value", "_defaultGlobal", "_category", ["_code", 0], ["_persi if (isNil "_defaultGlobal") exitWith {}; -if !(_name isEqualType "") exitwith { +if !(_name isEqualType "") exitWith { [format ["Tried to the deinfe a variable with an invalid name: %1 Arguments: %2", _name, _this]] call FUNC(debug); }; diff --git a/addons/common/functions/fnc_deprecateComponent.sqf b/addons/common/functions/fnc_deprecateComponent.sqf index 5408a896a10..1ed85de2336 100644 --- a/addons/common/functions/fnc_deprecateComponent.sqf +++ b/addons/common/functions/fnc_deprecateComponent.sqf @@ -23,8 +23,8 @@ _oldComponent params ["_oldComponentName", "_oldSettingName"]; _newComponent params ["_newComponentName", "_newSettingName"]; private _isReplacementAvailable = [_newComponentName] call FUNC(isModLoaded); -private _isDeprecatedLoaded = missionNamespace getvariable [_oldSettingName, false]; -private _isReplacementLoaded = missionNamespace getvariable [_newSettingName, false]; +private _isDeprecatedLoaded = missionNamespace getVariable [_oldSettingName, false]; +private _isReplacementLoaded = missionNamespace getVariable [_newSettingName, false]; if (_isDeprecatedLoaded && {_isReplacementAvailable} && {!_isReplacementLoaded}) then { [_newSettingName, true, true, true] call FUNC(setSetting); @@ -38,7 +38,7 @@ if (_isDeprecatedLoaded && {!_isReplacementLoaded}) then { switch (true) do { case (_componentMajor >= _major && {_componentMinor >= _minor} && {_componentPatch >= _patch}): { // Removed from this version private _message = format[ - "Component %1 is deprecated. It has been replaced by %2. The component %1 is no longer usable on this version. ", _oldComponentName, _newComponentName, _version]; + "Component %1 is deprecated. It has been replaced by %2. The component %1 is no longer usable on this version %3. ", _oldComponentName, _newComponentName, _version]; systemChat format["ACE [ERROR] - %1", _message]; ERROR(_message); }; diff --git a/addons/common/functions/fnc_disableAiUAV.sqf b/addons/common/functions/fnc_disableAiUAV.sqf new file mode 100644 index 00000000000..195e3ed2dc1 --- /dev/null +++ b/addons/common/functions/fnc_disableAiUAV.sqf @@ -0,0 +1,45 @@ +#include "..\script_component.hpp" +/* + * Author: johnb43 + * Disables/Enables UAV AI crew members, can be run on any machine and is applied globally. + * + * Arguments: + * 0: Unit <OBJECT> + * 1: Disable AI <BOOL> + * + * Return Value: + * None + * + * Example: + * [cursorObject, true] call ace_common_fnc_disableAiUAV + * + * Public: No + */ + +params [["_unit", objNull, [objNull]], ["_disable", true, [false]]]; + +// Allow disabling of Zeus remote controlled units +if (!alive _unit || {isPlayer _unit} || {!unitIsUAV _unit}) exitWith {}; + +if (_disable) then { + // Ignore if already disabled + if (!isNil "_jipID") exitWith {}; + + // Disable shooting and targeting on every machine + // Give predefined JIP ID, in case of simultaneous executions on different machines + private _jipID = [QGVAR(disableAiUAV), [_unit, _disable], QGVAR(disableAiUAV_) + hashValue _unit] call CBA_fnc_globalEventJIP; + [_jipID, _unit] call CBA_fnc_removeGlobalEventJIP; + + _unit setVariable [QGVAR(disableAiUavJipID), _jipID, true]; +} else { + // Restore shooting and targeting to each client's individual state prior to disabling + private _jipID = _unit getVariable QGVAR(disableAiUavJipID); + + if (isNil "_jipID") exitWith {}; + + _jipID call CBA_fnc_removeGlobalEventJIP; + + _unit setVariable [QGVAR(disableAiUavJipID), nil, true]; + + [QGVAR(disableAiUAV), [_unit, _disable]] call CBA_fnc_globalEvent; +}; diff --git a/addons/common/functions/fnc_displayIcon.sqf b/addons/common/functions/fnc_displayIcon.sqf index da08fa832a4..db01bedb043 100644 --- a/addons/common/functions/fnc_displayIcon.sqf +++ b/addons/common/functions/fnc_displayIcon.sqf @@ -21,11 +21,11 @@ */ // positions for the icon UI -#define RIGHT_SIDE (safezoneW + safezoneX) -#define LEFT_SIDE safezoneX +#define RIGHT_SIDE (safeZoneW + safeZoneX) +#define LEFT_SIDE safeZoneX #define TOP_SIDE safeZoneY -#define BOTTOM_SIDE (safeZoneH + safezoneY) -#define ICON_WIDTH (2 * (((safezoneW / safezoneH) min 1.2) / 40)) +#define BOTTOM_SIDE (safeZoneH + safeZoneY) +#define ICON_WIDTH (2 * (((safeZoneW / safeZoneH) min 1.2) / 40)) #define X_POS_ICONS (RIGHT_SIDE - (1.5 * ICON_WIDTH)) #define Y_POS_ICONS (TOP_SIDE + (2.5 * ICON_WIDTH)) #define DIFFERENCE_ICONS (1.1 * ICON_WIDTH) diff --git a/addons/common/functions/fnc_displayTextStructured.sqf b/addons/common/functions/fnc_displayTextStructured.sqf index a9376552a95..ed494627702 100644 --- a/addons/common/functions/fnc_displayTextStructured.sqf +++ b/addons/common/functions/fnc_displayTextStructured.sqf @@ -30,7 +30,7 @@ if (typeName _text != "TEXT") then { if (_x isEqualType "" && {isLocalized _x}) then { _text set [_foreachIndex, localize _x]; }; - }foreach _text; + } forEach _text; _text = format _text; }; }; @@ -51,18 +51,18 @@ _ctrlHint ctrlSetBackgroundColor GVAR(displayTextColor); _ctrlHint ctrlSetTextColor GVAR(displayTextFontColor); // Use profile settings from CfgUIGrids.hpp -private _xPos = profilenamespace getVariable ["IGUI_GRID_ACE_displayText_X", ((safezoneX + safezoneW) - (10 *(((safezoneW / safezoneH) min 1.2) / 40)) - 2.9 *(((safezoneW / safezoneH) min 1.2) / 40))]; -private _yPos = profilenamespace getVariable ["IGUI_GRID_ACE_displayText_Y", safeZoneY + 0.175 * safezoneH]; -private _wPos = (_width *(((safezoneW / safezoneH) min 1.2) / 40)); -private _hPos = _size * (2 *((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)); +private _xPos = profileNamespace getVariable ["IGUI_GRID_ACE_displayText_X", ((safeZoneX + safeZoneW) - (10 *(((safeZoneW / safeZoneH) min 1.2) / 40)) - 2.9 *(((safeZoneW / safeZoneH) min 1.2) / 40))]; +private _yPos = profileNamespace getVariable ["IGUI_GRID_ACE_displayText_Y", safeZoneY + 0.175 * safeZoneH]; +private _wPos = (_width *(((safeZoneW / safeZoneH) min 1.2) / 40)); +private _hPos = _size * (2 *((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)); // Ensure still in bounds for large width/height -_xPos = safezoneX max (_xPos min (safezoneX + safezoneW - _wPos)); -_yPos = safeZoneY max (_yPos min (safeZoneY + safezoneH - _hPos)); +_xPos = safeZoneX max (_xPos min (safeZoneX + safeZoneW - _wPos)); +_yPos = safeZoneY max (_yPos min (safeZoneY + safeZoneH - _hPos)); // Zeus Interface Open and Display would be under the "CREATE" list if (!isNull curatorCamera) then { - _xPos = _xPos min ((safezoneX + safezoneW - 12.5 * (((safezoneW / safezoneH) min 1.2) / 40)) - _wPos); + _xPos = _xPos min ((safeZoneX + safeZoneW - 12.5 * (((safeZoneW / safeZoneH) min 1.2) / 40)) - _wPos); }; private _position = [_xPos, _yPos, _wPos, _hPos]; diff --git a/addons/common/functions/fnc_findUnloadPosition.sqf b/addons/common/functions/fnc_findUnloadPosition.sqf index 2047f7349d8..7fb4e41a73c 100644 --- a/addons/common/functions/fnc_findUnloadPosition.sqf +++ b/addons/common/functions/fnc_findUnloadPosition.sqf @@ -61,7 +61,7 @@ if (isNull _unloader || {_unloader in _vehicle}) then { // Ideal unload pos is halfway between unloader and vehicle (at the unloader's height) private _originASL = ((getPosASL _unloader) vectorAdd (getPosASL _vehicle)) vectorMultiply 0.5; _originASL set [2, (getPosASL _unloader) select 2]; -private _originAGL = ASLtoAGL _originASL; +private _originAGL = ASLToAGL _originASL; // Do a manual search for empty pos (handles underwater, buildings or piers) TRACE_2("Checking for unload",_originAGL,_radiusOfItem); @@ -74,9 +74,9 @@ while {_rangeToCheck < _maxDistance} do { private _roundPointIsValid = false; - if (((AGLtoASL _roundAGL) select 2) > 0) then { + if (((AGLToASL _roundAGL) select 2) > 0) then { // Shoot a ray down, and make sure we hit something solid like a building or the ground - private _belowRoundArray = lineIntersectsSurfaces [(AGLtoASL _roundAGL) vectorAdd [0, 0, 0.5], (AGLtoASL _roundAGL) vectorAdd [0, 0, -1]]; + private _belowRoundArray = lineIntersectsSurfaces [(AGLToASL _roundAGL) vectorAdd [0, 0, 0.5], (AGLToASL _roundAGL) vectorAdd [0, 0, -1]]; TRACE_4("Testing for solid",_roundDistance,_roundAngle,_roundAGL,_belowRoundArray); if (_belowRoundArray isNotEqualTo []) then { @@ -85,7 +85,7 @@ while {_rangeToCheck < _maxDistance} do { // Point is above something: Terrain (null) or Building if ((isNull _aboveBuilding) || {_aboveBuilding isKindOf "Building"}) then { // Get the real intersection point - _roundAGL = ASLtoAGL ((_belowRoundArray select 0) select 0); + _roundAGL = ASLToAGL ((_belowRoundArray select 0) select 0); _roundPointIsValid = true; }; @@ -102,13 +102,13 @@ while {_rangeToCheck < _maxDistance} do { for "_index" from 0 to (COL_TEST_COUNT -1) do { // Scan for collisions with objects with lineIntersectsSurfaces private _angle = _index * (360 / COL_TEST_COUNT); - private _point1ASL = (AGLtoASL _roundAGL) vectorAdd [_radiusOfItem * cos _angle, _radiusOfItem * sin _angle, 0.1]; - private _point2ASL = (AGLtoASL _roundAGL) vectorAdd [-_radiusOfItem * cos _angle, -_radiusOfItem * sin _angle, _radiusOfItem + 0.5]; + private _point1ASL = (AGLToASL _roundAGL) vectorAdd [_radiusOfItem * cos _angle, _radiusOfItem * sin _angle, 0.1]; + private _point2ASL = (AGLToASL _roundAGL) vectorAdd [-_radiusOfItem * cos _angle, -_radiusOfItem * sin _angle, _radiusOfItem + 0.5]; private _testIntersections = lineIntersectsSurfaces [_point1ASL, _point2ASL]; if (((count _testIntersections) == 1) && {isNull ((_testIntersections select 0) select 2)}) then { private _hitGroundASL = (_testIntersections select 0) select 0; - private _hitHeightOffset = ((AGLtoASL _roundAGL) select 2) - (_hitGroundASL select 2); + private _hitHeightOffset = ((AGLToASL _roundAGL) select 2) - (_hitGroundASL select 2); private _hit2dOffset = _roundAGL distance2D _hitGroundASL; private _slope = _hitHeightOffset atan2 _hit2dOffset; @@ -124,8 +124,8 @@ while {_rangeToCheck < _maxDistance} do { _roundPointIsValid = false; }; - _point1ASL = (AGLtoASL _roundAGL) vectorAdd [_radiusOfItem * cos _angle, _radiusOfItem * sin _angle, 0.5]; - _point2ASL = (AGLtoASL _roundAGL) vectorAdd [-_radiusOfItem * cos _angle, -_radiusOfItem * sin _angle, 1]; + _point1ASL = (AGLToASL _roundAGL) vectorAdd [_radiusOfItem * cos _angle, _radiusOfItem * sin _angle, 0.5]; + _point2ASL = (AGLToASL _roundAGL) vectorAdd [-_radiusOfItem * cos _angle, -_radiusOfItem * sin _angle, 1]; _testIntersections = lineIntersectsSurfaces [_point1ASL, _point2ASL]; if (_testIntersections isNotEqualTo []) exitWith { diff --git a/addons/common/functions/fnc_getAddon.sqf b/addons/common/functions/fnc_getAddon.sqf index b1a6f7cf995..ab3ad1c2173 100644 --- a/addons/common/functions/fnc_getAddon.sqf +++ b/addons/common/functions/fnc_getAddon.sqf @@ -22,7 +22,7 @@ params ["_config"]; // Return first addon if (_addons isNotEqualTo []) then { - (configSourceModList (configfile >> "CfgPatches" >> _addons select 0)) param [0, ""] + (configSourceModList (configFile >> "CfgPatches" >> _addons select 0)) param [0, ""] } else { // If nothing found at all, return "" "" diff --git a/addons/common/functions/fnc_getDeathAnim.sqf b/addons/common/functions/fnc_getDeathAnim.sqf index 18c6c93c074..4e0b0578729 100644 --- a/addons/common/functions/fnc_getDeathAnim.sqf +++ b/addons/common/functions/fnc_getDeathAnim.sqf @@ -29,7 +29,9 @@ private _unitActionsCfg = configFile >> "CfgMovesBasic" >> "Actions" >> getText TRACE_2("Animation/Action",configName _unitAnimationCfg,configName _unitActionsCfg); -if (!isNull objectParent _unit) then { +if (isNull objectParent _unit) then { + _returnAnimation = getText (_unitActionsCfg >> "die"); +} else { private _interpolateArray = getArray (_unitAnimationCfg >> "interpolateTo"); for "_index" from 0 to (count _interpolateArray - 1) step 2 do { @@ -42,8 +44,6 @@ if (!isNull objectParent _unit) then { _returnAnimation = _indexAnimation; }; }; -} else { - _returnAnimation = getText (_unitActionsCfg >> "die"); }; //Fallback if nothing valid found: diff --git a/addons/common/functions/fnc_getInPosition.sqf b/addons/common/functions/fnc_getInPosition.sqf index 076fd7a23cf..eca21b125a9 100644 --- a/addons/common/functions/fnc_getInPosition.sqf +++ b/addons/common/functions/fnc_getInPosition.sqf @@ -40,6 +40,7 @@ private _enemiesInVehicle = false; //Possible Side Restriction if (side _unit getFriend side _x < 0.6) exitWith {_enemiesInVehicle = true}; } forEach crew _vehicle; +//IGNORE_PRIVATE_WARNING ["_unit", "_isInside", "_vehicle", "_turret", "_index", "_fnc_getInEH", "_position"]; switch (_position) do { case "driver" : { if (CANGETINDRIVER) then { diff --git a/addons/common/functions/fnc_getMapGridData.sqf b/addons/common/functions/fnc_getMapGridData.sqf index daa4bd86cdf..c6817b5d5b5 100644 --- a/addons/common/functions/fnc_getMapGridData.sqf +++ b/addons/common/functions/fnc_getMapGridData.sqf @@ -30,7 +30,7 @@ private _stepX = 1e10; private _stepY = 1e10; { - private _zoom = getnumber (_x >> "zoomMax"); + private _zoom = getNumber (_x >> "zoomMax"); if (_zoom < _zoomMax) then { _zoomMax = _zoom; _formatX = getText (_x >> "formatX"); diff --git a/addons/common/functions/fnc_getVehicleIcon.sqf b/addons/common/functions/fnc_getVehicleIcon.sqf index c63d54a8d80..6bda8f63108 100644 --- a/addons/common/functions/fnc_getVehicleIcon.sqf +++ b/addons/common/functions/fnc_getVehicleIcon.sqf @@ -28,14 +28,18 @@ private _objectType = if (_object isEqualType objNull) then { private _cachedValue = GVAR(vehicleIconCache) get _objectType; if (isNil "_cachedValue") then { - private _vehicleValue = getText (configfile >> "CfgVehicles" >> _objectType >> "icon"); - private _vehicleIconValue = getText (configfile >> "CfgVehicleIcons" >> _vehicleValue); + private _vehicleValue = getText (configFile >> "CfgVehicles" >> _objectType >> "icon"); + private _vehicleIconValue = getText (configFile >> "CfgVehicleIcons" >> _vehicleValue); if (_vehicleIconValue == "") then { if (_vehicleValue != "" && {((toLowerANSI _vehicleValue) find ".paa") > -1}) then { _cachedValue = _vehicleValue; } else { - _cachedValue = DEFAULT_TEXTURE; + if (_vehicleValue != "" && {fileExists (_vehicleValue + ".paa")}) then { + _cachedValue = _vehicleValue + ".paa"; + } else { + _cachedValue = DEFAULT_TEXTURE; + }; }; } else { _cachedValue = _vehicleIconValue; diff --git a/addons/common/functions/fnc_getWeaponModes.sqf b/addons/common/functions/fnc_getWeaponModes.sqf index c1ca241cab7..42a29681f23 100644 --- a/addons/common/functions/fnc_getWeaponModes.sqf +++ b/addons/common/functions/fnc_getWeaponModes.sqf @@ -1,34 +1,45 @@ #include "..\script_component.hpp" /* - * Author: commy2 + * Author: commy2, johnb43 * Get the available firing modes of a weapon. Will ignore the AI helper modes. * * Arguments: * 0: Weapon <STRING> + * 1: Muzzle <STRING> (default: weapon) * * Return Value: * Firing Modes <ARRAY> * * Example: - * ["gun"] call ace_common_fnc_getWeaponModes + * "arifle_AK12_F" call ace_common_fnc_getWeaponModes * * Public: Yes */ -params [["_weapon", "", [""]]]; +params [["_weapon", "", [""]], ["_muzzle", nil, [""]]]; private _config = configFile >> "CfgWeapons" >> _weapon; +if (!isNil "_muzzle") then { + _config = _config >> _muzzle +}; + +if (!isClass _config) exitWith { + [] // return +}; + private _modes = []; { if (getNumber (_config >> _x >> "showToPlayer") == 1) then { - _modes pushBack _x; - }; - - if (_x == "this") then { - _modes pushBack _weapon; + if (_x == "this") then { + _modes pushBack (configName _config); + } else { + if (isClass (_config >> _x)) then { + _modes pushBack (configName (_config >> _x)); + }; + }; }; } forEach getArray (_config >> "modes"); -_modes +_modes // return diff --git a/addons/common/functions/fnc_getWeaponMuzzles.sqf b/addons/common/functions/fnc_getWeaponMuzzles.sqf index 11fffaf1960..0184a0c8c83 100644 --- a/addons/common/functions/fnc_getWeaponMuzzles.sqf +++ b/addons/common/functions/fnc_getWeaponMuzzles.sqf @@ -1,6 +1,6 @@ #include "..\script_component.hpp" /* - * Author: commy2 + * Author: commy2, johnb43 * Get the muzzles of a weapon. * * Arguments: @@ -10,19 +10,30 @@ * All weapon muzzles <ARRAY> * * Example: - * ["gun"] call ace_common_fnc_getWeaponMuzzles + * "arifle_AK12_F" call ace_common_fnc_getWeaponMuzzles * * Public: Yes */ params [["_weapon", "", [""]]]; -private _muzzles = getArray (configFile >> "CfgWeapons" >> _weapon >> "muzzles"); +private _config = configFile >> "CfgWeapons" >> _weapon; +if (!isClass _config) exitWith { + [] // return +}; + +private _muzzles = []; + +// Get config case muzzle names { if (_x == "this") then { - _muzzles set [_forEachIndex, configName (configFile >> "CfgWeapons" >> _weapon)]; + _muzzles pushBack (configName _config); + } else { + if (isClass (_config >> _x)) then { + _muzzles pushBack (configName (_config >> _x)); + }; }; -} forEach _muzzles; +} forEach getArray (_config >> "muzzles"); -_muzzles +_muzzles // return diff --git a/addons/common/functions/fnc_isAwake.sqf b/addons/common/functions/fnc_isAwake.sqf index f564e5e8728..1ab4ed21b0b 100644 --- a/addons/common/functions/fnc_isAwake.sqf +++ b/addons/common/functions/fnc_isAwake.sqf @@ -17,4 +17,4 @@ params ["_unit"]; -alive _unit && {!(_unit getVariable ["ACE_isUnconscious", false])} +lifeState _unit in ["HEALTHY", "INJURED"] diff --git a/addons/common/functions/fnc_moduleLSDVehicles.sqf b/addons/common/functions/fnc_moduleLSDVehicles.sqf index 35e1f07eba6..16a6235ee1a 100644 --- a/addons/common/functions/fnc_moduleLSDVehicles.sqf +++ b/addons/common/functions/fnc_moduleLSDVehicles.sqf @@ -24,7 +24,7 @@ if (isNil QGVAR(LSD_Vehicles)) then { }; { - _hSCount = count (getArray (configOf _x >> "hiddenSelections")); + private _hSCount = count (getArray (configOf _x >> "hiddenSelections")); if (_hSCount > 0) then { GVAR(LSD_Vehicles) pushBack [_x, _hSCount]; }; diff --git a/addons/common/functions/fnc_positionToASL.sqf b/addons/common/functions/fnc_positionToASL.sqf index b286d2f7ab6..808bfe35636 100644 --- a/addons/common/functions/fnc_positionToASL.sqf +++ b/addons/common/functions/fnc_positionToASL.sqf @@ -20,5 +20,5 @@ if (surfaceIsWater _this) then { _this } else { - ATLtoASL _this + ATLToASL _this }; diff --git a/addons/common/functions/fnc_progressBar.sqf b/addons/common/functions/fnc_progressBar.sqf index 9b5519c232f..36f04b18f8c 100644 --- a/addons/common/functions/fnc_progressBar.sqf +++ b/addons/common/functions/fnc_progressBar.sqf @@ -57,7 +57,7 @@ if (_dialog) then { //Adjust position based on user setting: private _ctrlPos = ctrlPosition (uiNamespace getVariable QGVAR(ctrlProgressBarTitle)); -_ctrlPos set [1, ((0 + 29 * GVAR(settingProgressBarLocation)) * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2))]; +_ctrlPos set [1, ((0 + 29 * GVAR(settingProgressBarLocation)) * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2))]; (uiNamespace getVariable QGVAR(ctrlProgressBG)) ctrlSetPosition _ctrlPos; (uiNamespace getVariable QGVAR(ctrlProgressBG)) ctrlCommit 0; diff --git a/addons/common/functions/fnc_readSettingsFromParamsArray.sqf b/addons/common/functions/fnc_readSettingsFromParamsArray.sqf index 7273fc61caf..0134bc210c2 100644 --- a/addons/common/functions/fnc_readSettingsFromParamsArray.sqf +++ b/addons/common/functions/fnc_readSettingsFromParamsArray.sqf @@ -17,7 +17,7 @@ */ //paramsArray is a normal variable not a command -private _paramsArray = missionnamespace getVariable ["paramsArray", []]; +private _paramsArray = missionNamespace getVariable ["paramsArray", []]; TRACE_1("Reading missionConfigFile params",_paramsArray); diff --git a/addons/common/functions/fnc_removeCanInteractWithCondition.sqf b/addons/common/functions/fnc_removeCanInteractWithCondition.sqf index 6c5e8b56b66..841a9a00b15 100644 --- a/addons/common/functions/fnc_removeCanInteractWithCondition.sqf +++ b/addons/common/functions/fnc_removeCanInteractWithCondition.sqf @@ -18,16 +18,4 @@ params ["_conditionName"]; _conditionName = toLowerANSI _conditionName; - -private _conditions = missionNamespace getVariable [QGVAR(InteractionConditions), [[],[]]]; - -_conditions params ["_conditionNames", "_conditionFuncs"]; - -private _index = _conditionNames find _conditionName; - -if (_index == -1) exitWith {}; - -_conditionNames deleteAt _index; -_conditionFuncs deleteAt _index; - -GVAR(InteractionConditions) = _conditions; +GVAR(InteractionConditions) deleteAt _conditionName; diff --git a/addons/common/functions/fnc_runTests.sqf b/addons/common/functions/fnc_runTests.sqf index 4a449fb7eb8..a430cadabaa 100644 --- a/addons/common/functions/fnc_runTests.sqf +++ b/addons/common/functions/fnc_runTests.sqf @@ -30,7 +30,7 @@ INFO_1("ace_common_fnc_runTests starting for [%1]",_specificTest); _total = _total + 1; private _testFile = getText _x; diag_log text format ["----- Starting Testing %1 [%2] -----", _testName, _testFile]; - private _return = ([nil] apply (compile preProcessFileLineNumbers _testFile)) select 0; + private _return = ([nil] apply (compile preprocessFileLineNumbers _testFile)) select 0; if ((isNil "_return") || {_return isNotEqualTo true}) then { systemChat format ["Test [%1] Failed", _testName]; diag_log text format ["----- Finished Testing %1 [Failed] -----", _testName]; diff --git a/addons/common/functions/fnc_setPlayerOwner.sqf b/addons/common/functions/fnc_setPlayerOwner.sqf index 2b37349f9af..010f0b9b462 100644 --- a/addons/common/functions/fnc_setPlayerOwner.sqf +++ b/addons/common/functions/fnc_setPlayerOwner.sqf @@ -17,7 +17,7 @@ * Public: No */ -if (missionNameSpace getVariable [QGVAR(setPlayerOwnerRunning), false]) exitWith {}; +if (missionNamespace getVariable [QGVAR(setPlayerOwnerRunning), false]) exitWith {}; GVAR(setPlayerOwnerRunning) = true; if (isServer) then { diff --git a/addons/common/functions/fnc_setSetting.sqf b/addons/common/functions/fnc_setSetting.sqf index 93c6045a6cf..9135c12ea52 100644 --- a/addons/common/functions/fnc_setSetting.sqf +++ b/addons/common/functions/fnc_setSetting.sqf @@ -29,8 +29,8 @@ if (!_broadcastChanges) exitWith { ERROR_1("Setting [%1] - SetSetting no longer supports non-global settings",_name); }; -if ([_settingName, "mission"] call CBA_settings_fnc_isForced) then { - WARNING_1("Setting [%1] - Already mission forced - Ignoring",_settingName); +if ([_name, "mission"] call CBA_settings_fnc_isForced) then { + WARNING_1("Setting [%1] - Already mission forced - Ignoring",_name); }; [QGVAR(setSetting), [_name, _value], (format [QGVAR(setSetting_%1), _name])] call CBA_fnc_globalEventJIP; diff --git a/addons/common/functions/fnc_setWeaponLightLaserState.sqf b/addons/common/functions/fnc_setWeaponLightLaserState.sqf new file mode 100644 index 00000000000..7f50573acb7 --- /dev/null +++ b/addons/common/functions/fnc_setWeaponLightLaserState.sqf @@ -0,0 +1,59 @@ +#include "..\script_component.hpp" +/* + * Author: johnb43 + * Toggles the unit's current weapon's light & laser. + * API for persistent lasers. Doesn't work on AI, as they have their own logic. + * + * Arguments: + * 0: Unit <OBJECT> + * 1: Weapon light/laser state <BOOL> (default: false) + * + * Return Value: + * None + * + * Example: + * [player, true] call ace_common_fnc_setWeaponLightLaserState + * + * Public: Yes + */ + +params [["_unit", objNull, [objNull]], ["_state", false, [false]]]; + +if (!local _unit || {!alive _unit} || {!(_unit call FUNC(isPlayer))}) exitWith {}; + +if !(_unit call CBA_fnc_canUseWeapon) exitWith {}; + +private _currentWeapon = currentWeapon _unit; + +// Exit if unit has no weapon selected +if (_currentWeapon == "") exitWith {}; + +private _weaponIndex = [_unit, _currentWeapon] call FUNC(getWeaponIndex); + +// Ignore binoculars +if (_weaponIndex == -1) exitWith {}; + +_unit setVariable [QGVAR(laserEnabled_) + str _weaponIndex, _state]; + +// Turn off light/laser (switching between weapons can leave previous weapon laser on) +action ["GunLightOff", _unit]; +action ["IRLaserOff", _unit]; + +// Light/laser is off, don't need to do anything more +if (!_state) exitWith {}; + +// Turn laser on next frame (if weapon hasn't changed) +[{ + params ["_unit", "_currentWeapon"]; + + private _weaponState = (weaponState _unit) select [0, 3]; + + if (_weaponState select 0 != _currentWeapon) exitWith {}; + + action ["GunLightOn", _unit]; + action ["IRLaserOn", _unit]; + + _unit selectWeapon _weaponState; +}, [_unit, _currentWeapon]] call CBA_fnc_execNextFrame; + +nil diff --git a/addons/common/functions/fnc_showHud.sqf b/addons/common/functions/fnc_showHud.sqf index 5bb0153772d..b552b7230af 100644 --- a/addons/common/functions/fnc_showHud.sqf +++ b/addons/common/functions/fnc_showHud.sqf @@ -6,8 +6,8 @@ * * Arguments: * 0: Source ID <STRING> (default: "") - * 1: Show Hud Bool Array (8 to set, empty to remove) <ARRAY> (default: []) - * - [hud, info, radar, compass, direction, menu, group, cursors] + * 1: Show Hud Bool Array (10 to set, empty to remove) <ARRAY> (default: []) + * - [hud, info, radar, compass, direction, menu, group, cursors, panels, kills] * - hud: Boolean - show scripted HUD (same as normal showHUD true/false) * - info: Boolean - show vehicle + soldier info (hides weapon info from the HUD as well) * - radar: Boolean - show vehicle radar @@ -17,7 +17,8 @@ * - group: Boolean - show group info bar (hides squad leader info bar) * - cursors: Boolean - show HUD weapon cursors (connected with scripted HUD) * - panels: Boolean - show vehicle panels / GPS - * - ???: Boolean - Possibly related to changelog entry `Added: A new showKillConfirmations parameter for the showHud command` + * - kills: Boolean - show "x killed by y" systemChat messages + * - showIcon3D: is unsupported as it has inverted logic * * Return Value: * Resulting ShowHud Array <ARRAY> @@ -64,6 +65,6 @@ for "_index" from 0 to 9 do { }; TRACE_2("showHud",_resultMask,keys GVAR(showHudHash)); -showHud _resultMask; +showHUD _resultMask; _resultMask diff --git a/addons/common/functions/fnc_switchAttachmentMode.sqf b/addons/common/functions/fnc_switchAttachmentMode.sqf new file mode 100644 index 00000000000..ab1dac6c1c7 --- /dev/null +++ b/addons/common/functions/fnc_switchAttachmentMode.sqf @@ -0,0 +1,73 @@ +#include "..\script_component.hpp" +/* + * Author: PabstMirror + * Switch attachment from one mode to another - based on CBA_accessory_fnc_switchAttachment + * ToDo: Port this to CBA? + * + * Arguments: + * 0: Unit <OBJECT> + * 1: Weapon (String or CBA-Weapon-Index (not ace's getWeaponIndex)) <STRING|NUMBER> + * 2: From <STRING> + * 3: To <STRING> + * + * Return Value: + * None + * + * Example: + * [player, 0, "ACE_DBAL_A3_Green_VP", "ACE_DBAL_A3_Green"] call ace_common_fnc_switchAttachmentMode + * + * Public: No + */ + +params ["_unit", "_weapon", "_currItem", "_switchItem"]; +TRACE_4("switchAttachmentMode",_unit,_weapon,_currItem,_switchItem); + +if (_weapon isEqualTo "") exitWith {}; + +private _exit = _unit != ACE_player; +switch (_weapon) do { + case 0; + case (primaryWeapon _unit): { + private _currWeaponType = 0; + _unit removePrimaryWeaponItem _currItem; + [{ + params ["_unit", "", "_switchItem"]; + _unit addPrimaryWeaponItem _switchItem; + ["CBA_attachmentSwitched", _this] call CBA_fnc_localEvent; + }, [_unit, _currItem, _switchItem, _currWeaponType]] call CBA_fnc_execNextFrame; + }; + case 1; + case (handgunWeapon _unit): { + private _currWeaponType = 1; + _unit removeHandgunItem _currItem; + [{ + params ["_unit", "", "_switchItem"]; + _unit addHandgunItem _switchItem; + ["CBA_attachmentSwitched", _this] call CBA_fnc_localEvent; + }, [_unit, _currItem, _switchItem, _currWeaponType]] call CBA_fnc_execNextFrame; + }; + case 2; + case (secondaryWeapon _unit): { + private _currWeaponType = 2; + _unit removeSecondaryWeaponItem _currItem; + [{ + params ["_unit", "", "_switchItem"]; + _unit addSecondaryWeaponItem _switchItem; + ["CBA_attachmentSwitched", _this] call CBA_fnc_localEvent; + }, [_unit, _currItem, _switchItem, _currWeaponType]] call CBA_fnc_execNextFrame; + }; + default { + ERROR_1("bad weapon - %1",_this); + _exit = true; + }; +}; +if (_exit) exitWith {}; // Don't notify if the unit isn't the local player or if an invalid weapon was passed + +private _configSwitchItem = configFile >> "CfgWeapons" >> _switchItem; +private _switchItemHintText = getText (_configSwitchItem >> "MRT_SwitchItemHintText"); +private _switchItemHintImage = getText (_configSwitchItem >> "picture"); + +playSound "click"; +if (_switchItemHintText != "") then { + [[_switchItemHintImage, 2.0], [_switchItemHintText], true] call CBA_fnc_notify; +}; diff --git a/addons/common/functions/fnc_switchPersistentLaser.sqf b/addons/common/functions/fnc_switchPersistentLaser.sqf index a2b7b9c1a8d..5c61693c54f 100644 --- a/addons/common/functions/fnc_switchPersistentLaser.sqf +++ b/addons/common/functions/fnc_switchPersistentLaser.sqf @@ -1,6 +1,6 @@ #include "..\script_component.hpp" /* - * Author: Dystopian + * Author: Dystopian, johnb43 * Controls persistent laser state. * * Arguments: @@ -17,51 +17,87 @@ params ["_enabled"]; +if (!hasInterface) exitWith {}; + +// Reset state +{ + ACE_player setVariable [QGVAR(laserEnabled_) + str _x, nil]; +} forEach [0, 1, 2]; + if (!_enabled) exitWith { if (isNil QGVAR(laserKeyDownEH)) exitWith {}; - ["KeyDown", GVAR(laserKeyDownEH)] call CBA_fnc_removeDisplayHandler; + + removeUserActionEventHandler ["headlights", "Activate", GVAR(laserKeyDownEH)]; + ["loadout", GVAR(laserLoadoutEH)] call CBA_fnc_removePlayerEventHandler; ["turret", GVAR(laserTurretEH)] call CBA_fnc_removePlayerEventHandler; ["vehicle", GVAR(laserVehicleEH)] call CBA_fnc_removePlayerEventHandler; ["weapon", GVAR(laserWeaponEH)] call CBA_fnc_removePlayerEventHandler; + + GVAR(laserKeyDownEH) = nil; + GVAR(laserLoadoutEH) = nil; + GVAR(laserTurretEH) = nil; + GVAR(laserVehicleEH) = nil; + GVAR(laserWeaponEH) = nil; }; -GVAR(laserKeyDownEH) = ["KeyDown", { - if !((_this select 1) in actionKeys "headlights") exitWith {false}; - private _weapon = currentWeapon ACE_player; +private _fnc_getLightLaserState = { + private _currentWeapon = currentWeapon ACE_player; + + if (_currentWeapon == "") exitWith {}; + + // Ignore in vehicle except FFV + if !(ACE_player call CBA_fnc_canUseWeapon) exitWith {}; + + private _weaponIndex = [ACE_player, _currentWeapon] call FUNC(getWeaponIndex); + + if (_weaponIndex == -1) exitWith {}; + + // Light/laser state only changes in the next frame + // However, as by default changing attachment modes is CTRL + L, the vanilla EH triggers when lights are bound to L (even despite CBA intercepting keystroke) + // Therefore, add an extra frame of delay, after which the previous laser state will have been restored + [{ + ACE_player setVariable [ + QGVAR(laserEnabled_) + str (_this select 1), + ACE_player isIRLaserOn (_this select 0) || {ACE_player isFlashlightOn (_this select 0)} + ]; + }, [_currentWeapon, _weaponIndex], 2] call CBA_fnc_execAfterNFrames; +}; + +// Get current weapon light/laser state +call _fnc_getLightLaserState; + +// Update state every time it's changed +GVAR(laserKeyDownEH) = addUserActionEventHandler ["headlights", "Activate", _fnc_getLightLaserState]; + +// Dropping weapons, as well as switching light/laser attachments turns off lights/lasers +GVAR(lastWeapons) = (getUnitLoadout ACE_player) select [0, 3]; + +// Monitor weapon addition/removal here +GVAR(laserLoadoutEH) = ["loadout", { + params ["_unit", "_loadout"]; + + private _weapons = _loadout select [0, 3]; + + if (_weapons isEqualTo GVAR(lastWeapons)) exitWith {}; + + GVAR(lastWeapons) = _weapons; + [ - { - params ["_weapon", "_laserWasEnabled"]; - private _laserEnabled = ACE_player isIRLaserOn _weapon || {ACE_player isFlashlightOn _weapon}; - if (_laserEnabled && {_laserWasEnabled} || {!_laserEnabled && {!_laserWasEnabled}}) exitWith {}; - private _weaponIndex = [ACE_player, _weapon] call FUNC(getWeaponIndex); - ACE_player setVariable [QGVAR(laserEnabled_) + str _weaponIndex, [nil, true] select _laserEnabled]; - }, - [_weapon, ACE_player isIRLaserOn _weapon || {ACE_player isFlashlightOn _weapon}] - ] call CBA_fnc_execNextFrame; - false -}] call CBA_fnc_addDisplayHandler; - -private _laserEH = { - if (sunOrMoon == 1) exitWith {}; - params ["_player"]; - private _weaponIndex = [_player, currentWeapon _player] call FUNC(getWeaponIndex); - if ( - !(_player getVariable [QGVAR(laserEnabled_) + str _weaponIndex, false]) - || {_weaponIndex > 0 && {"" != primaryWeapon _player}} // Arma switches to primary weapon if exists - || {!(_player call CBA_fnc_canUseWeapon)} // ignore in vehicle except FFV - ) exitWith {}; + _unit, + _unit getVariable [QGVAR(laserEnabled_) + str ([_unit, currentWeapon _unit] call FUNC(getWeaponIndex)), false] + ] call FUNC(setWeaponLightLaserState); +}] call CBA_fnc_addPlayerEventHandler; + +private _fnc_switchPersistentLaserEH = { + params ["_unit"]; + [ - // wait for weapon in "ready to fire" direction - {0.01 > getCameraViewDirection _this vectorDistance (_this weaponDirection currentWeapon _this)}, - {{_this action [_x, _this]} forEach ["GunLightOn", "IRLaserOn"]}, - _player, - 3, - {{_this action [_x, _this]} forEach ["GunLightOn", "IRLaserOn"]} - ] call CBA_fnc_waitUntilAndExecute; + _unit, + _unit getVariable [QGVAR(laserEnabled_) + str ([_unit, currentWeapon _unit] call FUNC(getWeaponIndex)), false] + ] call FUNC(setWeaponLightLaserState); }; -GVAR(laserLoadoutEH) = ["loadout", _laserEH] call CBA_fnc_addPlayerEventHandler; -GVAR(laserTurretEH) = ["turret", _laserEH] call CBA_fnc_addPlayerEventHandler; -GVAR(laserVehicleEH) = ["vehicle", _laserEH] call CBA_fnc_addPlayerEventHandler; -GVAR(laserWeaponEH) = ["weapon", _laserEH] call CBA_fnc_addPlayerEventHandler; +GVAR(laserTurretEH) = ["turret", _fnc_switchPersistentLaserEH] call CBA_fnc_addPlayerEventHandler; +GVAR(laserVehicleEH) = ["vehicle", _fnc_switchPersistentLaserEH] call CBA_fnc_addPlayerEventHandler; +GVAR(laserWeaponEH) = ["weapon", _fnc_switchPersistentLaserEH] call CBA_fnc_addPlayerEventHandler; diff --git a/addons/common/functions/fnc_unloadPersonLocal.sqf b/addons/common/functions/fnc_unloadPersonLocal.sqf index 0378c6a4b86..24e44fc6797 100644 --- a/addons/common/functions/fnc_unloadPersonLocal.sqf +++ b/addons/common/functions/fnc_unloadPersonLocal.sqf @@ -34,7 +34,7 @@ if (_emptyPos isEqualTo []) then { }; }; -if (count _emptyPos != 3) exitwith { +if (count _emptyPos != 3) exitWith { WARNING_4("Could not find unload pos %1-ASL: %2 isTouchingGround: %3 Speed: %4",_vehicle,getPosASL _vehicle,isTouchingGround _vehicle,speed _vehicle); if ((!isNull _unloader) && {[_unloader] call FUNC(isPlayer)}) then { //display text saying there are no safe places to exit the vehicle diff --git a/addons/common/stringtable.xml b/addons/common/stringtable.xml index 8c59d065167..edc47ccbdf2 100644 --- a/addons/common/stringtable.xml +++ b/addons/common/stringtable.xml @@ -44,7 +44,7 @@ <French>Avancé</French> <Hungarian>Fejlett</Hungarian> <Italian>Avanzato</Italian> - <Japanese>アドバンスド</Japanese> + <Japanese>高度な</Japanese> <Korean>고급</Korean> <Chinese>進階</Chinese> <Chinesesimp>进阶</Chinesesimp> @@ -658,7 +658,7 @@ <Hungarian>Az ACE-súgók hátterének színe.</Hungarian> <Portuguese>A cor de fundo das hints do ACE.</Portuguese> <Japanese>ACE によるヒントの背景色を指定します。</Japanese> - <Korean>ACE힌트의 배경색을 정합니다.</Korean> + <Korean>ACE 힌트의 배경색을 정합니다.</Korean> <Chinese>設定ACE提示的背景顏色.</Chinese> <Chinesesimp>设定 ACE 提示的背景颜色。</Chinesesimp> </Key> @@ -1932,5 +1932,22 @@ <Russian>Влияет на величину колебания прицела оружия при его развертывании.</Russian> <Spanish>Afecta la cantidad de oscilación del arma cuando se está desplegado.</Spanish> </Key> + <Key ID="STR_ACE_Common_Drop"> + <English>Release</English> + <Russian>Отпустить</Russian> + <Spanish>Soltar</Spanish> + <Polish>Puść</Polish> + <Czech>Položit</Czech> + <French>Lâcher</French> + <German>Loslassen</German> + <Portuguese>Soltar</Portuguese> + <Italian>Lascia</Italian> + <Hungarian>Elengedés</Hungarian> + <Japanese>離す</Japanese> + <Korean>놓기</Korean> + <Chinese>放開</Chinese> + <Chinesesimp>放开</Chinesesimp> + <Turkish>Bırak</Turkish> + </Key> </Package> </Project> diff --git a/addons/compat_aegis/$PBOPREFIX$ b/addons/compat_aegis/$PBOPREFIX$ new file mode 100644 index 00000000000..1fc86838473 --- /dev/null +++ b/addons/compat_aegis/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\compat_aegis diff --git a/addons/compat_aegis/compat_aegis_realisticnames/CfgVehicles.hpp b/addons/compat_aegis/compat_aegis_realisticnames/CfgVehicles.hpp new file mode 100644 index 00000000000..19a1bef5104 --- /dev/null +++ b/addons/compat_aegis/compat_aegis_realisticnames/CfgVehicles.hpp @@ -0,0 +1,21 @@ +class CfgVehicles { + class APC_Wheeled_01_base_v2_F; + class B_APC_Wheeled_01_cannon_v2_F: APC_Wheeled_01_base_v2_F { + displayName = ECSTRING(realisticnames,APC_Wheeled_01_cannon_Name); + }; + + class B_APC_Wheeled_01_base_F; + class B_APC_Wheeled_01_medical_F: B_APC_Wheeled_01_base_F { + displayName = SUBCSTRING(APC_Wheeled_01_medical_Name); + }; + + class APC_Tracked_02_medical_base_F; + class O_R_APC_Tracked_02_medical_F: APC_Tracked_02_medical_base_F { + displayName = SUBCSTRING(APC_Tracked_02_medical_Name); + }; + + class APC_Tracked_03_base_v2_F; + class B_A_APC_tracked_03_cannon_v2_F: APC_Tracked_03_base_v2_F { + displayName = ECSTRING(realisticnames,APC_tracked_03_cannon_Name); + }; +}; diff --git a/addons/compat_aegis/compat_aegis_realisticnames/config.cpp b/addons/compat_aegis/compat_aegis_realisticnames/config.cpp new file mode 100644 index 00000000000..add9f50a3a4 --- /dev/null +++ b/addons/compat_aegis/compat_aegis_realisticnames/config.cpp @@ -0,0 +1,26 @@ +#include "script_component.hpp" + +class CfgPatches { + class SUBADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { + "A3_Aegis_Armor_F_Aegis_APC_Wheeled_01", + "A3_Aegis_Armor_F_Aegis_APC_Tracked_02", + "A3_Aegis_Armor_F_Aegis_APC_Tracked_03", + "ace_realisticnames" + }; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {"johnb43"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + + // this prevents any patched class from requiring this addon + addonRootClass = "A3_Characters_F"; + }; +}; + +#include "CfgVehicles.hpp" diff --git a/addons/compat_aegis/compat_aegis_realisticnames/script_component.hpp b/addons/compat_aegis/compat_aegis_realisticnames/script_component.hpp new file mode 100644 index 00000000000..b8d0682fa4f --- /dev/null +++ b/addons/compat_aegis/compat_aegis_realisticnames/script_component.hpp @@ -0,0 +1,3 @@ +#define SUBCOMPONENT realisticnames +#define SUBCOMPONENT_BEAUTIFIED Realistic Names +#include "..\script_component.hpp" diff --git a/addons/compat_aegis/compat_aegis_realisticnames/stringtable.xml b/addons/compat_aegis/compat_aegis_realisticnames/stringtable.xml new file mode 100644 index 00000000000..6d7dfa47a12 --- /dev/null +++ b/addons/compat_aegis/compat_aegis_realisticnames/stringtable.xml @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project name="ACE"> + <Package name="Compat_Aegis_RealisticNames"> + <Key ID="STR_ACE_Compat_Aegis_RealisticNames_APC_Wheeled_01_medical_Name"> + <English>Badger IFV (Medical)</English> + <German>SPz Badger (Medizin)</German> + <Spanish>Badger IFV (médico)</Spanish> + <Polish>Badger IFV (sprzęt medyczny)</Polish> + <Czech>Badger IFV (zdravotnický)</Czech> + <French>Badger IFV (médical)</French> + <Russian>БМП Badger (медицинский)</Russian> + <Portuguese>Badger IFV (médico)</Portuguese> + <Italian>Badger IFV (medico)</Italian> + <Japanese>バジャー IFV(医療)</Japanese> + <Korean>뱃져 보병전투차 (의료)</Korean> + <Chinese>"蜜獾"步兵戰車(醫療用)</Chinese> + <Chinesesimp>"蜜獾"(医疗)</Chinesesimp> + <Turkish>Badger IFV (Sıhhiye)</Turkish> + </Key> + <Key ID="STR_ACE_Compat_Aegis_RealisticNames_APC_Tracked_02_medical_Name"> + <English>BM-2T Stalker (Medical)</English> + <German>BM-2T Stalker (Medizin)</German> + <Spanish>BM-2T Stalker (médico)</Spanish> + <Polish>BM-2T Stalker (sprzęt medyczny)</Polish> + <Czech>BM-2T Stalker (zdravotnický)</Czech> + <French>BM-2T Stalker (médical)</French> + <Russian>БМ-2Т Сталкер (медицинский)</Russian> + <Portuguese>BM-2T Stalker (médico)</Portuguese> + <Italian>BM-2T Stalker (medico)</Italian> + <Japanese>BM-2T ストーカー(医療)</Japanese> + <Korean>BM-2T 스토커 (의료)</Korean> + <Chinese>BM-2T"潛行者"步兵戰車(醫療用)</Chinese> + <Chinesesimp>BM-2T "潜行者"(医疗)</Chinesesimp> + <Turkish>BM-2T Stalker (Sıhhiye)</Turkish> + </Key> + </Package> +</Project> diff --git a/addons/compat_aegis/compat_aegis_vehicles/CfgVehicles.hpp b/addons/compat_aegis/compat_aegis_vehicles/CfgVehicles.hpp new file mode 100644 index 00000000000..5d0e86faafd --- /dev/null +++ b/addons/compat_aegis/compat_aegis_vehicles/CfgVehicles.hpp @@ -0,0 +1,95 @@ +class CfgVehicles { + class Tank; + class Tank_F: Tank { + class Turrets { + class MainTurret; + }; + }; + + class APC_Tracked_03_base_F: Tank_F { + class Turrets: Turrets { + class MainTurret: MainTurret {}; + }; + }; + class APC_Tracked_03_base_v2_F: APC_Tracked_03_base_F { + class Turrets: Turrets { + class MainTurret: MainTurret { + weapons[] = {"autocannon_40mm_CTWS", "ACE_LMG_coax_L94A1_mem3"}; // Aegis upgrades to a 40mm cannon, but we want realistic MG name + }; + }; + }; + + class MBT_01_base_F: Tank_F { + class Turrets: Turrets { + class MainTurret: MainTurret { + // Overwrite the changes Aegis makes for the .338 coax MG on the Slammer/Merkava + // The idea is: + // 1) keep it as realistic as possible + // 2) easier to overwrite something with skipWhenMissingDependencies than to not overwrite something if another mod is loaded + weapons[] = {"cannon_120mm", "ACE_LMG_coax_MAG58_mem3"}; // Base 1.82: "cannon_120mm","LMG_coax" + magazines[] = { + "24Rnd_120mm_APFSDS_shells_Tracer_Red", + "12Rnd_120mm_HE_shells_Tracer_Red", + "12Rnd_120mm_HEAT_MP_T_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "4Rnd_120mm_LG_cannon_missiles" // Aegis adds laser-guided munitions + }; + }; + }; + }; + + class B_MBT_01_base_F: MBT_01_base_F {}; + class B_MBT_01_cannon_F: B_MBT_01_base_F {}; + class B_MBT_01_TUSK_F: B_MBT_01_cannon_F { + class Turrets: Turrets { + class MainTurret: MainTurret { + weapons[] = {"cannon_120mm", "ACE_LMG_coax_MAG58_mem3"}; // Base 1.82: "cannon_120mm","LMG_coax" + magazines[] = { + "24Rnd_120mm_APFSDS_shells_Tracer_Red", + "12Rnd_120mm_HE_shells_Tracer_Red", + "12Rnd_120mm_HEAT_MP_T_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "4Rnd_120mm_LG_cannon_missiles" // Aegis adds laser-guided munitions + }; + }; + }; + }; +}; diff --git a/addons/compat_aegis/compat_aegis_vehicles/config.cpp b/addons/compat_aegis/compat_aegis_vehicles/config.cpp new file mode 100644 index 00000000000..fd16fa86865 --- /dev/null +++ b/addons/compat_aegis/compat_aegis_vehicles/config.cpp @@ -0,0 +1,25 @@ +#include "script_component.hpp" + +class CfgPatches { + class SUBADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { + "A3_Aegis_Armor_F_Aegis_MBT_01", + "A3_Aegis_Armor_F_Aegis_APC_Tracked_03", + "ace_vehicles" + }; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {"johnb43"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + + // this prevents any patched class from requiring this addon + addonRootClass = "A3_Characters_F"; + }; +}; + +#include "CfgVehicles.hpp" diff --git a/addons/compat_aegis/compat_aegis_vehicles/script_component.hpp b/addons/compat_aegis/compat_aegis_vehicles/script_component.hpp new file mode 100644 index 00000000000..17370c415fd --- /dev/null +++ b/addons/compat_aegis/compat_aegis_vehicles/script_component.hpp @@ -0,0 +1,3 @@ +#define SUBCOMPONENT vehicles +#define SUBCOMPONENT_BEAUTIFIED Vehicles +#include "..\script_component.hpp" diff --git a/addons/compat_aegis/config.cpp b/addons/compat_aegis/config.cpp new file mode 100644 index 00000000000..2de723b9a48 --- /dev/null +++ b/addons/compat_aegis/config.cpp @@ -0,0 +1,19 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common"}; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {"johnb43"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + + // this prevents any patched class from requiring this addon + addonRootClass = "A3_Characters_F"; + }; +}; diff --git a/addons/compat_aegis/script_component.hpp b/addons/compat_aegis/script_component.hpp new file mode 100644 index 00000000000..d6fb73bd462 --- /dev/null +++ b/addons/compat_aegis/script_component.hpp @@ -0,0 +1,5 @@ +#define COMPONENT compat_aegis +#define COMPONENT_BEAUTIFIED Aegis Compatibility + +#include "\z\ace\addons\main\script_mod.hpp" +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/addons/compat_csla/compat_csla_explosives/CfgMagazines.hpp b/addons/compat_csla/compat_csla_explosives/CfgMagazines.hpp index b29f7e717dc..0c8a8aa6fd8 100644 --- a/addons/compat_csla/compat_csla_explosives/CfgMagazines.hpp +++ b/addons/compat_csla/compat_csla_explosives/CfgMagazines.hpp @@ -1,15 +1,15 @@ class CfgMagazines { class US85_Magazine; class US85_ATMine_mag: US85_Magazine { - EGVAR(explosives,SetupObject) = "ACE_Explosives_Place_US85_ATMine_mag"; + EGVAR(explosives,setupObject) = "ACE_Explosives_Place_US85_ATMine_mag"; useAction = 0; }; class US85_M14Mine_mag: US85_Magazine { - EGVAR(explosives,SetupObject) = "ACE_Explosives_Place_US85_M14Mine"; + EGVAR(explosives,setupObject) = "ACE_Explosives_Place_US85_M14Mine"; useAction = 0; }; class US85_SatchelCharge_Mag: US85_Magazine { - EGVAR(explosives,SetupObject) = "ACE_Explosives_Place_US85_SatchelCharge_Mag"; + EGVAR(explosives,setupObject) = "ACE_Explosives_Place_US85_SatchelCharge_Mag"; useAction = 0; }; }; diff --git a/addons/compat_cup_vehicles/CfgVehicles.hpp b/addons/compat_cup_vehicles/CfgVehicles.hpp index 5334987fff6..ce502abad53 100644 --- a/addons/compat_cup_vehicles/CfgVehicles.hpp +++ b/addons/compat_cup_vehicles/CfgVehicles.hpp @@ -1,4 +1,31 @@ class CfgVehicles { + class CUP_nHMMWV_Base; + class CUP_nM1025_SOV_Base: CUP_nHMMWV_Base { + class EGVAR(interaction,anims) { + class hide_backpacks { + positions[] = { + "(_target selectionPosition ['vhc_backpacks', 'ViewGeometry', 'AveragePoint']) vectorAdd [-1, 0, 0]", + "(_target selectionPosition ['vhc_backpacks', 'ViewGeometry', 'AveragePoint']) vectorAdd [1.3, 0, 0]" + }; + items[] = {"CUP_B_USPack_Coyote", "CUP_B_USPack_Coyote", "CUP_B_AssaultPack_ACU", "CUP_B_AssaultPack_ACU", "CUP_B_AssaultPack_Coyote"}; + name = "$STR_a3_cfgvehicleclasses_backpacks0"; + text = "$STR_a3_cfgvehicleclasses_backpacks0"; + }; + }; + }; + + class Car_F; + class CUP_ECVHMMWV_Base: Car_F { + class EGVAR(interaction,anims) { + class hide_deploy2 { + positions[] = {"(_target selectionPosition ['vhc_rear_trunk_door', 'FireGeometry', 'AveragePoint']) vectorAdd [-0.7, 0, 0]"}; + items[] = {"CUP_B_USPack_Coyote", "CUP_B_AssaultPack_ACU"}; + name = "$STR_a3_cfgvehicleclasses_backpacks0"; + text = "$STR_a3_cfgvehicleclasses_backpacks0"; + }; + }; + }; + class CUP_MTVR_Base; class CUP_MTVR_Reammo_Base: CUP_MTVR_Base { EGVAR(rearm,defaultSupply) = 1200; @@ -106,6 +133,17 @@ class CfgVehicles { class CUP_BTR90_HQ_Base: CUP_BTR90_Base { delete ace_viewports; }; // no cargo seats class Tank_F; + class CUP_AAV_Base: Tank_F { + class EGVAR(interaction,anims) { + class Hide_Bags_Deployment { + positions[] = {{1.7, -0.7, -0.3}, {1.7, -2.55, -0.3}}; + items[] = {"CUP_B_USPack_Coyote", "CUP_B_USPack_Coyote"}; + name = "$STR_CUP_dn_USpack_coyote"; + text = "$STR_CUP_dn_USpack_coyote"; + }; + }; + }; + class CUP_M2Bradley_Base: Tank_F { ace_hunterkiller = 1; class ace_viewports { diff --git a/addons/compat_cup_vehicles/compat_cup_repair/CfgVehicles.hpp b/addons/compat_cup_vehicles/compat_cup_repair/CfgVehicles.hpp new file mode 100644 index 00000000000..29a471f4516 --- /dev/null +++ b/addons/compat_cup_vehicles/compat_cup_repair/CfgVehicles.hpp @@ -0,0 +1,196 @@ +class CfgVehicles { + class Car_F; + class CUP_Datsun_Base: Car_F { + class EGVAR(interaction,anims) { + class hideSpareTire { + positions[] = {{-0.23, -0.25, -0.8}}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + class CUP_Datsun_AA_Base: CUP_Datsun_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hideSpareTire: hideSpareTire { + enabled = 0; + }; + }; + }; + + class CUP_Tigr_Base: Car_F { + class EGVAR(interaction,anims) { + class hide_ReserveWheel { + positions[] = {{0.57, -2.3, -0.55}}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + class CUP_Tigr_STS_PK_Base: CUP_Tigr_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_ReserveWheel: hide_ReserveWheel {}; + }; + }; + class CUP_Tigr_233014_PK_Base: CUP_Tigr_STS_PK_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_ReserveWheel: hide_ReserveWheel { + positions[] = {{0.57, -2.3, -0.85}}; + }; + }; + }; + class CUP_Tigr_M_PK_Base: CUP_Tigr_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_ReserveWheel: hide_ReserveWheel {}; + }; + }; + class CUP_Tigr_233114_PK_Base: CUP_Tigr_M_PK_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_ReserveWheel: hide_ReserveWheel { + positions[] = {{0.57, -2.3, -0.85}}; + }; + }; + }; + + class CUP_LR_Base: Car_F { + class EGVAR(interaction,anims) { + class selection_wheelfront { + positions[] = {"_target selectionPosition ['selection_wheelfront', 'ViewGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + class selection_wheels { + positions[] = { + "(_target selectionPosition ['selection_wheels', 'ViewGeometry', 'AveragePoint']) vectorAdd [-1.1, 0, 0]", + "(_target selectionPosition ['selection_wheels', 'ViewGeometry', 'AveragePoint']) vectorAdd [1.1, 0, 0]" + }; + items[] = {"ACE_Wheel", "ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + + class CUP_nHMMWV_Base: Car_F { + class EGVAR(interaction,anims) { + class hide_spare_wheel { + positions[] = {"_target selectionPosition ['vhc_spare_wheel', 'FireGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + // Don't inherit, as it's easier for the main compat + class CUP_nM1025_SOV_Base: CUP_nHMMWV_Base { + class EGVAR(interaction,anims) { + class hide_spare_wheel { + positions[] = {"_target selectionPosition ['vhc_spare_wheel', 'FireGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + + class CUP_RG31_BASE: Car_F { + class EGVAR(interaction,anims) { + class left_spare { + positions[] = {"_target selectionPosition ['left_spare', 'FireGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + class right_spare { + positions[] = {"_target selectionPosition ['right_spare', 'FireGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + + class CUP_UAZ_Base: Car_F { + class EGVAR(interaction,anims) { + class hide_spare_wheel { + positions[] = {"_target selectionPosition ['spare_wheel', 'ViewGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + class CUP_UAZ_Armed_Base: CUP_UAZ_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_spare_wheel: hide_spare_wheel {}; + }; + }; + class CUP_UAZ_AA_Base: CUP_UAZ_Armed_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_spare_wheel: hide_spare_wheel { + positions[] = {{0.18, -1.8, 0.75}}; + }; + }; + }; + class CUP_UAZ_AGS30_Base: CUP_UAZ_Armed_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_spare_wheel: hide_spare_wheel { + positions[] = {{0.18, -1.9, 0.75}}; + }; + }; + }; + class CUP_UAZ_MG_Base: CUP_UAZ_Armed_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_spare_wheel: hide_spare_wheel { + positions[] = {{0.18, -1.9, 0.2}}; + }; + }; + }; + // Visual is bugged, but it works + class CUP_UAZ_METIS_Base: CUP_UAZ_Armed_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_spare_wheel: hide_spare_wheel { + positions[] = {{0.18, -1.9, 0.65}}; + }; + }; + }; + class CUP_UAZ_SPG9_Base: CUP_UAZ_Armed_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_spare_wheel: hide_spare_wheel { + positions[] = {{0.18, -1.9, 1.05}}; + }; + }; + }; + + class CUP_UAZ_Unarmed_Base: CUP_UAZ_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_spare_wheel: hide_spare_wheel {}; + }; + }; + class CUP_UAZ_Open_Base: CUP_UAZ_Unarmed_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_spare_wheel: hide_spare_wheel { + positions[] = {{0.135, -1.3, 0.7}}; + }; + }; + }; + + class CUP_ECVHMMWV_Base: Car_F { + class EGVAR(interaction,anims) { + class hide_spare_tire { + positions[] = {"(_target selectionPosition ['vhc_rear_trunk_door', 'FireGeometry', 'AveragePoint']) vectorAdd [0.05, -0.4, 0.2]"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + class hide_deploy1 { + positions[] = {"(_target selectionPosition ['vhc_rear_trunk_door', 'FireGeometry', 'AveragePoint']) vectorAdd [0.05, 0.5, 0.7]"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; +}; diff --git a/addons/compat_cup_vehicles/compat_cup_repair/config.cpp b/addons/compat_cup_vehicles/compat_cup_repair/config.cpp new file mode 100644 index 00000000000..9a2785e7ef2 --- /dev/null +++ b/addons/compat_cup_vehicles/compat_cup_repair/config.cpp @@ -0,0 +1,23 @@ +#include "script_component.hpp" + +class CfgPatches { + class SUBADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { + "CUP_Vehicles_LoadOrder", + "ace_repair" + }; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {"johnb43"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + + addonRootClass = QUOTE(ADDON); + }; +}; + +#include "CfgVehicles.hpp" diff --git a/addons/compat_cup_vehicles/compat_cup_repair/script_component.hpp b/addons/compat_cup_vehicles/compat_cup_repair/script_component.hpp new file mode 100644 index 00000000000..1af928486c3 --- /dev/null +++ b/addons/compat_cup_vehicles/compat_cup_repair/script_component.hpp @@ -0,0 +1,3 @@ +#define SUBCOMPONENT repair +#define SUBCOMPONENT_BEAUTIFIED Repair +#include "..\script_component.hpp" diff --git a/addons/compat_cup_vehicles/compat_cup_trenches/CfgVehicles.hpp b/addons/compat_cup_vehicles/compat_cup_trenches/CfgVehicles.hpp new file mode 100644 index 00000000000..9d9bc2d62ee --- /dev/null +++ b/addons/compat_cup_vehicles/compat_cup_trenches/CfgVehicles.hpp @@ -0,0 +1,111 @@ +class CfgVehicles { + class Car_F; + class CUP_Tigr_Base: Car_F { + class EGVAR(interaction,anims) { + class hide_tools { + positions[] = {{1.15, -1.5, -0.68}}; + items[] = {"ACE_EntrenchingTool"}; + name = ECSTRING(trenches,EntrenchingToolName); + text = ECSTRING(trenches,EntrenchingToolName); + }; + }; + }; + class CUP_Tigr_STS_PK_Base: CUP_Tigr_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_tools: hide_tools {}; + }; + }; + class CUP_Tigr_233014_PK_Base: CUP_Tigr_STS_PK_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_tools: hide_tools { + positions[] = {{1.15, -1.5, -1}}; + }; + }; + }; + class CUP_Tigr_M_PK_Base: CUP_Tigr_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_tools: hide_tools {}; + }; + }; + class CUP_Tigr_233114_PK_Base: CUP_Tigr_M_PK_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_tools: hide_tools { + positions[] = {{1.15, -1.5, -1}}; + }; + }; + }; + + // Interaction added to both sides, as the whole vehicle is mirrored if in left/right side + class CUP_LR_Base: Car_F { + class EGVAR(interaction,anims) { + class selection_tool { + positions[] = {{-0.53, 1.65, -0.2}, {0.53, 1.65, -0.2}}; + items[] = {"ACE_EntrenchingTool"}; + name = ECSTRING(trenches,EntrenchingToolName); + text = ECSTRING(trenches,EntrenchingToolName); + }; + }; + }; + class CUP_LR_MG_Base: CUP_LR_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class selection_tool: selection_tool { + positions[] = {{-0.6, 1.4, 1.4}, {0.45, 1.4, 1.4}}; + }; + }; + }; + class CUP_LR_SPG9_Base: CUP_LR_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class selection_tool: selection_tool {}; + }; + }; + class CUP_LR_AA_Base: CUP_LR_SPG9_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class selection_tool: selection_tool { + positions[] = {{-0.55, 1.77, -0.75}, {0.55, 1.77, -0.75}}; + }; + }; + }; + class CUP_LR_Ambulance_Base: CUP_LR_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class selection_tool: selection_tool { + positions[] = {{-0.55, 2.1, -0.2}, {0.55, 2.1, -0.2}}; + }; + }; + }; + class CUP_LR_Special_Base: CUP_LR_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class selection_tool: selection_tool { + positions[] = {{-0.6, 1.4, 1.4}, {0.45, 1.4, 1.4}}; + }; + }; + }; + + class CUP_ECVHMMWV_Base: Car_F { + class EGVAR(interaction,anims) { + class hide_front_tool_rack { + positions[] = {"(_target selectionPosition ['vhc_rear_trunk_door', 'FireGeometry', 'AveragePoint']) vectorAdd [0.37, 4, 0.2]"}; + items[] = {"ACE_EntrenchingTool"}; + name = ECSTRING(trenches,EntrenchingToolName); + text = ECSTRING(trenches,EntrenchingToolName); + }; + }; + }; + + class Tank_F; + class CUP_leopard_1A3_base: Tank_F { + class EGVAR(interaction,anims) { + class hide_Tools_L { + positions[] = {{-2.2, 0, 0.2}, {-2.2, -1.8, 0.2}}; + items[] = {"ACE_EntrenchingTool", "ACE_wirecutter"}; + name = "$STR_a3_cfgeditorsubcategories_edsubcat_tools0"; + text = "$STR_a3_cfgeditorsubcategories_edsubcat_tools0"; + }; + class hide_Tools_R { + positions[] = {{0.9, -1.5, 0.23}}; + items[] = {"ACE_EntrenchingTool"}; + name = ECSTRING(trenches,EntrenchingToolName); + text = ECSTRING(trenches,EntrenchingToolName); + }; + }; + }; +}; diff --git a/addons/compat_cup_vehicles/compat_cup_trenches/config.cpp b/addons/compat_cup_vehicles/compat_cup_trenches/config.cpp new file mode 100644 index 00000000000..8f05885bd6f --- /dev/null +++ b/addons/compat_cup_vehicles/compat_cup_trenches/config.cpp @@ -0,0 +1,23 @@ +#include "script_component.hpp" + +class CfgPatches { + class SUBADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { + "CUP_Vehicles_LoadOrder", + "ace_trenches" + }; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {"johnb43"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + + addonRootClass = QUOTE(ADDON); + }; +}; + +#include "CfgVehicles.hpp" diff --git a/addons/compat_cup_vehicles/compat_cup_trenches/script_component.hpp b/addons/compat_cup_vehicles/compat_cup_trenches/script_component.hpp new file mode 100644 index 00000000000..10b90eb71e5 --- /dev/null +++ b/addons/compat_cup_vehicles/compat_cup_trenches/script_component.hpp @@ -0,0 +1,3 @@ +#define SUBCOMPONENT trenches +#define SUBCOMPONENT_BEAUTIFIED Trenches +#include "..\script_component.hpp" diff --git a/addons/compat_cup_vehicles/compat_cup_vehicles_fastroping/config.cpp b/addons/compat_cup_vehicles/compat_cup_vehicles_fastroping/config.cpp index 1abe0de6ea6..10eb5da69f0 100644 --- a/addons/compat_cup_vehicles/compat_cup_vehicles_fastroping/config.cpp +++ b/addons/compat_cup_vehicles/compat_cup_vehicles_fastroping/config.cpp @@ -15,6 +15,8 @@ class CfgPatches { authors[] = {"Community Upgrade Project", "Mike"}; url = ECSTRING(main,URL); VERSION_CONFIG; + + addonRootClass = QUOTE(ADDON); }; }; diff --git a/addons/compat_cup_vehicles/compat_cup_vehicles_refuel/CfgVehicles.hpp b/addons/compat_cup_vehicles/compat_cup_vehicles_refuel/CfgVehicles.hpp index 1042c0eacf3..60a83030df2 100644 --- a/addons/compat_cup_vehicles/compat_cup_vehicles_refuel/CfgVehicles.hpp +++ b/addons/compat_cup_vehicles/compat_cup_vehicles_refuel/CfgVehicles.hpp @@ -28,4 +28,90 @@ class CfgVehicles { EGVAR(refuel,hooks)[] = {{-1.09, -0.01, -0.5},{1, -0.01, -0.5}}; EGVAR(refuel,fuelCargo) = 10000; }; + + class Car_F; + class CUP_LR_Base: Car_F { + class EGVAR(interaction,anims) { + class selection_jerry { + positions[] = {{-0.65, 2.7, -0.55}, {0.65, 2.7, -0.55}, {-1, -0.25, -0.75}, {1, -0.25, -0.75}}; + items[] = {"Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + }; + }; + class CUP_LR_MG_Base: CUP_LR_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class selection_jerry: selection_jerry { + positions[] = {{-0.55, 2.45, 1.05}, {0.55, 2.45, 1.05}, {-1, -0.53, 0.9}, {1, -0.53, 0.9}}; + }; + }; + }; + class CUP_LR_SPG9_Base: CUP_LR_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class selection_jerry: selection_jerry {}; + }; + }; + class CUP_LR_AA_Base: CUP_LR_SPG9_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class selection_jerry: selection_jerry { + positions[] = {{-0.65, 2.8, -1.1}, {0.65, 2.8, -1.1}, {-1, -0.15, -1.3}, {1, -0.15, -1.3}}; + }; + }; + }; + class CUP_LR_Ambulance_Base: CUP_LR_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class selection_jerry: selection_jerry { + positions[] = {{-0.65, 3.1, -0.55}, {0.65, 3.1, -0.55}}; + items[] = {"Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F"}; + }; + }; + }; + class CUP_LR_Special_Base: CUP_LR_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class selection_jerry: selection_jerry { + positions[] = {{-0.7, 2.45, 1.05}, {0.55, 2.45, 1.05}}; + items[] = {"Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F"}; + }; + }; + }; + + class CUP_nHMMWV_Base: Car_F { + class EGVAR(interaction,anims) { + class hide_jerrycans { + positions[] = {"(_target selectionPosition 'vhc_jerrycans') vectorAdd [0, 0, 0.15]"}; + items[] = {"Land_CanisterFuel_F", "Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + }; + }; + // Don't inherit, as it's easier for the main compat + class CUP_nM1025_SOV_Base: CUP_nHMMWV_Base { + class EGVAR(interaction,anims) { + class hide_jerrycans { + positions[] = {"(_target selectionPosition 'vhc_jerrycans') vectorAdd [0, 0, 0.15]"}; + items[] = {"Land_CanisterFuel_F", "Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + class hide_rear_rack_content { + positions[] = {"_target selectionPosition ['vhc_rear_rack_content', 'FireGeometry', 'AveragePoint']"}; + items[] = {"Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + }; + }; + + class CUP_ECVHMMWV_Base: Car_F { + class EGVAR(interaction,anims) { + class hide_jerrycans { + positions[] = {"(_target selectionPosition ['vhc_rear_trunk_door', 'FireGeometry', 'AveragePoint']) vectorAdd [-0.85, -0.22, -0.1]"}; + items[] = {"Land_CanisterFuel_F", "Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + }; + }; }; diff --git a/addons/compat_cup_weapons/compat_cup_weapons_csw/CfgVehicles.hpp b/addons/compat_cup_weapons/compat_cup_weapons_csw/CfgVehicles.hpp index 3924ae03861..c96253ec51c 100644 --- a/addons/compat_cup_weapons/compat_cup_weapons_csw/CfgVehicles.hpp +++ b/addons/compat_cup_weapons/compat_cup_weapons_csw/CfgVehicles.hpp @@ -19,7 +19,7 @@ class CfgVehicles { magazineLocation = "_target selectionPosition 'otochlaven'"; proxyWeapon = "CUP_proxy_mortar_82mm"; disassembleWeapon = "CUP_2b14_carry"; - disassembleTurret = "ace_csw_mortarBaseplate"; + disassembleTurret = QEGVAR(csw,mortarBaseplate); desiredAmmo = 1; ammoLoadTime = 3; ammoUnloadTime = 3; @@ -29,14 +29,14 @@ class CfgVehicles { class CUP_M252_base: CUP_2b14_82mm_Base { class ace_csw: ace_csw { disassembleWeapon = "CUP_m252_carry"; - disassembleTurret = "ace_csw_mortarBaseplate"; + disassembleTurret = QEGVAR(csw,mortarBaseplate); }; }; class CUP_L16A2_base: CUP_M252_base { class ace_csw: ace_csw { disassembleWeapon = "CUP_l16a2_carry"; - disassembleTurret = "ace_csw_mortarBaseplate"; + disassembleTurret = QEGVAR(csw,mortarBaseplate); }; }; @@ -47,7 +47,7 @@ class CfgVehicles { proxyWeapon = "CUP_proxy_m2"; magazineLocation = "_target selectionPosition 'magazine'"; disassembleWeapon = "CUP_m2_carry"; - disassembleTurret = "ace_csw_m3Tripod"; + disassembleTurret = QEGVAR(csw,m3Tripod); desiredAmmo = 100; ammoLoadTime = 10; ammoUnloadTime = 8; @@ -57,7 +57,7 @@ class CfgVehicles { class CUP_M2StaticMG_MiniTripod_base: CUP_M2StaticMG_base { class ace_csw: ace_csw { enabled = 1; - disassembleTurret = "ace_csw_m3TripodLow"; + disassembleTurret = QEGVAR(csw,m3TripodLow); }; }; @@ -65,9 +65,9 @@ class CfgVehicles { class ace_csw { enabled = 1; proxyWeapon = "CUP_proxy_DSHKM"; - magazineLocation = "_target selectionPosition 'magazine'"; + magazineLocation = "_target selectionPosition 'otocvez'"; disassembleWeapon = "CUP_DSHKM_carry"; - disassembleTurret = "ace_csw_kordTripod"; + disassembleTurret = QEGVAR(csw,kordTripod); desiredAmmo = 100; ammoLoadTime = 10; ammoUnloadTime = 8; @@ -87,7 +87,7 @@ class CfgVehicles { proxyWeapon = "CUP_proxy_KORD"; magazineLocation = "_target selectionPosition 'magazine'"; disassembleWeapon = "CUP_KORD_carry"; - disassembleTurret = "ace_csw_kordTripod"; + disassembleTurret = QEGVAR(csw,kordTripod); desiredAmmo = 100; ammoLoadTime = 10; ammoUnloadTime = 8; @@ -97,7 +97,7 @@ class CfgVehicles { class CUP_KORD_MiniTripod_Base: CUP_KORD_Base { class ace_csw: ace_csw { enabled = 1; - disassembleTurret = "ace_csw_kordTripodLow"; + disassembleTurret = QEGVAR(csw,kordTripodLow); }; }; @@ -108,7 +108,7 @@ class CfgVehicles { proxyWeapon = "CUP_proxy_AGS30"; magazineLocation = "_target selectionPosition 'otochlaven'"; disassembleWeapon = "CUP_AGS30_carry"; - disassembleTurret = "ace_csw_sag30Tripod"; + disassembleTurret = QEGVAR(csw,sag30Tripod); desiredAmmo = 29; ammoLoadTime = 10; ammoUnloadTime = 8; @@ -119,9 +119,9 @@ class CfgVehicles { class ace_csw { enabled = 1; proxyWeapon = "CUP_proxy_MK19"; - magazineLocation = "_target selectionPosition 'magazine'"; + magazineLocation = "_target selectionPosition 'otochlaven'"; disassembleWeapon = "CUP_MK19_carry"; - disassembleTurret = "ace_csw_m3TripodLow"; + disassembleTurret = QEGVAR(csw,m3TripodLow); desiredAmmo = 48; ammoLoadTime = 10; ammoUnloadTime = 8; @@ -148,7 +148,7 @@ class CfgVehicles { proxyWeapon = "CUP_proxy_TOW"; magazineLocation = "_target selectionPosition 'otochlaven'"; disassembleWeapon = "CUP_TOW_carry"; - disassembleTurret = "ace_csw_m220Tripod"; + disassembleTurret = QEGVAR(csw,m220Tripod); desiredAmmo = 1; ammoLoadTime = 8; ammoUnloadTime = 5; @@ -165,9 +165,9 @@ class CfgVehicles { class ace_csw { enabled = 1; proxyWeapon = "CUP_proxy_SPG9"; - magazineLocation = "_target selectionPosition 'otochlaven'"; + magazineLocation = "_target selectionPosition 'handle'"; disassembleWeapon = "CUP_SPG9_carry"; - disassembleTurret = "ace_csw_spg9Tripod"; + disassembleTurret = QEGVAR(csw,spg9Tripod); desiredAmmo = 1; ammoLoadTime = 5; ammoUnloadTime = 3; diff --git a/addons/compat_cup_weapons/compat_cup_weapons_csw/CfgWeapons.hpp b/addons/compat_cup_weapons/compat_cup_weapons_csw/CfgWeapons.hpp index 9ff8519ce11..56213219040 100644 --- a/addons/compat_cup_weapons/compat_cup_weapons_csw/CfgWeapons.hpp +++ b/addons/compat_cup_weapons/compat_cup_weapons_csw/CfgWeapons.hpp @@ -60,6 +60,7 @@ class CfgWeapons { class assembleTo { ace_csw_m3Tripod = "CUP_I_M2StaticMG_AAF"; ace_csw_m3TripodLow = "CUP_I_M2StaticMG_MiniTripod_AAF"; + EGVAR(compat_spe,m3Tripod) = "CUP_I_M2StaticMG_MiniTripod_AAF"; }; }; class WeaponSlotsInfo: WeaponSlotsInfo { diff --git a/addons/compat_cup_weapons/compat_cup_weapons_csw/stringtable.xml b/addons/compat_cup_weapons/compat_cup_weapons_csw/stringtable.xml index ea16be2905a..86e56ee3d90 100644 --- a/addons/compat_cup_weapons/compat_cup_weapons_csw/stringtable.xml +++ b/addons/compat_cup_weapons/compat_cup_weapons_csw/stringtable.xml @@ -9,6 +9,8 @@ <German>[CSW] AGS30 Gurt</German> <Spanish>[CSW] Cinta de AGS30</Spanish> <Italian>[CSW] Nastro AGS30</Italian> + <Portuguese>[CSW] Cinto de AGS30</Portuguese> + <French>[CSW] Ceinture AGS30</French> </Key> <Key ID="STR_ACE_Compat_CUP_Weapons_CSW_mag_MK19_displayName"> <English>[CSW] MK19 Belt</English> @@ -18,6 +20,8 @@ <German>[CSW] MK19 Gurt</German> <Spanish>[CSW] Cinta de MK19</Spanish> <Italian>[CSW] Nastro MK19</Italian> + <Portuguese>[CSW] Cinto de MK19</Portuguese> + <French>[CSW] Ceinture MK19</French> </Key> <Key ID="STR_ACE_Compat_CUP_Weapons_CSW_mag_TOW_displayName"> <English>[CSW] TOW Tube</English> @@ -27,6 +31,8 @@ <German>[CSW] TOW Rohr</German> <Spanish>[CSW] Tubo de TOW</Spanish> <Italian>[CSW] Tubo TOW</Italian> + <Portuguese>[CSW] Tubo de TOW</Portuguese> + <French>[CSW] Tube TOW</French> </Key> <Key ID="STR_ACE_Compat_CUP_Weapons_CSW_mag_TOW2_displayName"> <English>[CSW] TOW2 Tube</English> @@ -36,6 +42,8 @@ <German>[CSW] TOW2 Rohr</German> <Spanish>[CSW] Tubo de TOW2</Spanish> <Italian>[CSW] Tubo TOW2</Italian> + <Portuguese>[CSW] Tubo de TOW2</Portuguese> + <French>[CSW] Tube TOW2</French> </Key> <Key ID="STR_ACE_Compat_CUP_Weapons_CSW_mag_PG9_displayName"> <English>[CSW] PG-9 Round</English> @@ -45,6 +53,8 @@ <German>[CSW] PG-9 Rakete</German> <Spanish>[CSW] Carga de PG-9</Spanish> <Italian>[CSW] Razzo PG-9</Italian> + <Portuguese>[CSW] Cartucho PG-9</Portuguese> + <French>[CSW] Projectile PG-9</French> </Key> <Key ID="STR_ACE_Compat_CUP_Weapons_CSW_mag_OG9_displayName"> <English>[CSW] OG-9 Round</English> @@ -54,6 +64,8 @@ <German>[CSW] OG-9 Rakete</German> <Spanish>[CSW] Carga de OG-9</Spanish> <Italian>[CSW] Razzo OG-9</Italian> + <Portuguese>[CSW] Cartucho OG-9</Portuguese> + <French>[CSW] Projectile OG-9.</French> </Key> <Key ID="STR_ACE_Compat_CUP_Weapons_CSW_mag_M1HE_displayName"> <English>[CSW] M1 HE</English> @@ -74,6 +86,7 @@ <German>[CSW] M84 Rauch</German> <Spanish>[CSW] Humo M84</Spanish> <Italian>[CSW] M84 Fumogeno</Italian> + <Portuguese>[CSW] M84 Fumígeno</Portuguese> </Key> <Key ID="STR_ACE_Compat_CUP_Weapons_CSW_mag_M60A2_displayName"> <English>[CSW] M60A2 WP</English> diff --git a/addons/compat_cup_weapons/compat_cup_weapons_explosives/CfgAmmo.hpp b/addons/compat_cup_weapons/compat_cup_weapons_explosives/CfgAmmo.hpp index 1658715ddbd..eeb7e6037f2 100644 --- a/addons/compat_cup_weapons/compat_cup_weapons_explosives/CfgAmmo.hpp +++ b/addons/compat_cup_weapons/compat_cup_weapons_explosives/CfgAmmo.hpp @@ -4,18 +4,18 @@ class CfgAmmo { hit = 3000; indirectHit = 3000; indirectHitRange = 5; - ace_explosives_explodeOnDefuse = 0.02; + EGVAR(explosives,explodeOnDefuse) = 0.02; }; class CUP_PipeBomb_Ammo: PipeBombBase { hit = 3000; indirectHit = 3000; indirectHitRange = 5; - ace_explosives_explodeOnDefuse = 0.02; + EGVAR(explosives,explodeOnDefuse) = 0.02; }; class CUP_Mine_Ammo; class CUP_IED_V1_Ammo: CUP_Mine_Ammo { - ace_explosives_explodeOnDefuse = 0.06; + EGVAR(explosives,explodeOnDefuse) = 0.06; triggerWhenDestroyed = 1; }; }; diff --git a/addons/compat_cup_weapons/compat_cup_weapons_explosives/CfgMagazines.hpp b/addons/compat_cup_weapons/compat_cup_weapons_explosives/CfgMagazines.hpp index 15df2f73335..51dc9d0d781 100644 --- a/addons/compat_cup_weapons/compat_cup_weapons_explosives/CfgMagazines.hpp +++ b/addons/compat_cup_weapons/compat_cup_weapons_explosives/CfgMagazines.hpp @@ -2,9 +2,9 @@ class CfgMagazines { class CA_Magazine; class CUP_TimeBomb_M: CA_Magazine { scope = 1; - ace_explosives_placeable = 1; + EGVAR(explosives,placeable) = 1; useAction = 0; - ace_explosives_setupObject = "ACE_PipeBomb_place_CUP"; + EGVAR(explosives,setupObject) = "ACE_PipeBomb_place_CUP"; class ACE_Triggers { SupportedTriggers[] = {"Timer", "Command", "MK16_Transmitter", "DeadmanSwitch", "Cellphone"}; class Timer { @@ -16,9 +16,9 @@ class CfgMagazines { }; }; class CUP_Mine_M: CUP_TimeBomb_M { - ace_explosives_placeable = 1; + EGVAR(explosives,placeable) = 1; useAction = 0; - ace_explosives_setupObject = "ACE_Mine_place_CUP"; + EGVAR(explosives,setupObject) = "ACE_Mine_place_CUP"; class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; class PressurePlate { @@ -27,9 +27,9 @@ class CfgMagazines { }; }; class CUP_MineE_M: CUP_TimeBomb_M { - ace_explosives_placeable = 1; + EGVAR(explosives,placeable) = 1; useAction = 0; - ace_explosives_setupObject = "ACE_MineE_place_CUP"; + EGVAR(explosives,setupObject) = "ACE_MineE_place_CUP"; class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; class PressurePlate { @@ -39,20 +39,20 @@ class CfgMagazines { }; class CUP_IED_V1_M: CUP_Mine_M { - ace_explosives_placeable = 1; + EGVAR(explosives,placeable) = 1; useAction = 0; - ace_explosives_setupObject = "ACE_IED_V1_place_CUP"; + EGVAR(explosives,setupObject) = "ACE_IED_V1_place_CUP"; class ACE_Triggers { SupportedTriggers[] = {"Timer", "Command", "MK16_Transmitter", "DeadmanSwitch", "Cellphone", "PressurePlate"}; }; }; class CUP_IED_V2_M: CUP_IED_V1_M { useAction = 0; - ace_explosives_setupObject = "ACE_IED_V2_place_CUP"; + EGVAR(explosives,setupObject) = "ACE_IED_V2_place_CUP"; }; class CUP_IED_V3_M: CUP_IED_V1_M { useAction = 0; - ace_explosives_setupObject = "ACE_IED_V3_place_CUP"; + EGVAR(explosives,setupObject) = "ACE_IED_V3_place_CUP"; class ACE_Triggers { SupportedTriggers[] = {"Timer", "Command", "MK16_Transmitter", "DeadmanSwitch", "Cellphone", "PressurePlate"}; class Timer { @@ -77,7 +77,7 @@ class CfgMagazines { }; class CUP_IED_V4_M: CUP_IED_V1_M { useAction = 0; - ace_explosives_setupObject = "ACE_IED_V4_place_CUP"; + EGVAR(explosives,setupObject) = "ACE_IED_V4_place_CUP"; class ACE_Triggers { SupportedTriggers[] = {"Timer", "Command", "MK16_Transmitter", "DeadmanSwitch", "Cellphone", "PressurePlate"}; class Timer { diff --git a/addons/compat_cup_weapons/compat_cup_weapons_explosives/CfgVehicles.hpp b/addons/compat_cup_weapons/compat_cup_weapons_explosives/CfgVehicles.hpp index d10c315c3d7..17a7c59848e 100644 --- a/addons/compat_cup_weapons/compat_cup_weapons_explosives/CfgVehicles.hpp +++ b/addons/compat_cup_weapons/compat_cup_weapons_explosives/CfgVehicles.hpp @@ -1,32 +1,31 @@ class CfgVehicles { class ACE_Explosives_Place; class ACE_PipeBomb_place_CUP: ACE_Explosives_Place { - displayName = "Satchel Charge"; + displayName = "$STR_CUP_dn_PipeBomb"; model = "\CUP\Weapons\CUP_Weapons_Put\CUP_Satchel.p3d"; - ace_explosives_offset[] = {0, 0, 0}; }; class ACE_Mine_place_CUP: ACE_Explosives_Place { - displayName = "AT-15 Anti-Tank Mine"; + displayName = "$STR_CUP_dn_Mine"; model = "\CUP\Weapons\CUP_Weapons_Put\CUP_AT15.p3d"; - ace_explosives_offset[] = {0, 0, 0}; }; class ACE_MineE_place_CUP: ACE_Explosives_Place { - displayName = "TM46 Anti-Tank Mine"; + displayName = "$STR_CUP_dn_MineE"; model = "\CUP\Weapons\CUP_Weapons_Put\CUP_TM46.p3d"; - ace_explosives_offset[] = {0, 0, 0}; }; class ACE_IED_V1_place_CUP: ACE_Explosives_Place { - displayName = "IED"; + displayName = "$STR_A3_CfgVehicles_IEDUrbanSmall_F"; model = "\CUP\Weapons\CUP_Weapons_Put\CUP_IED_V1.p3d"; - ace_explosives_offset[] = {0, 0, 0}; }; class ACE_IED_V2_place_CUP: ACE_IED_V1_place_CUP { + displayName = "$STR_A3_CfgVehicles_IEDUrbanBig_F"; model = "\CUP\Weapons\CUP_Weapons_Put\CUP_IED_V2.p3d"; }; class ACE_IED_V3_place_CUP: ACE_IED_V1_place_CUP { + displayName = "$STR_A3_CfgVehicles_IEDLandSmall_F"; model = "\CUP\Weapons\CUP_Weapons_Put\CUP_IED_V3.p3d"; }; class ACE_IED_V4_place_CUP: ACE_IED_V1_place_CUP { + displayName = "$STR_A3_CfgVehicles_IEDLandBig_F"; model = "\CUP\Weapons\CUP_Weapons_Put\CUP_IED_V4.p3d"; }; }; diff --git a/addons/compat_cup_weapons/compat_cup_weapons_javelin/CfgAmmo.hpp b/addons/compat_cup_weapons/compat_cup_weapons_javelin/CfgAmmo.hpp index 2632a43e61e..220af016575 100644 --- a/addons/compat_cup_weapons/compat_cup_weapons_javelin/CfgAmmo.hpp +++ b/addons/compat_cup_weapons/compat_cup_weapons_javelin/CfgAmmo.hpp @@ -7,20 +7,51 @@ class CfgAmmo { class ace_missileguidance { enabled = 1; - minDeflection = 0.00005; - maxDeflection = 0.025; - incDeflection = 0.00005; + + pitchRate = 120; // degrees per second + yawRate = 120; + stabilityCoefficient = 0.2; + bangBangGuidance = 0; + canVanillaLock = 0; + + // Guidance type for munitions defaultSeekerType = "Optic"; - seekerTypes[] = {"Optic"}; + seekerTypes[] = { "Optic" }; + defaultSeekerLockMode = "LOBL"; - seekerLockModes[] = {"LOBL"}; - seekerAngle = 180; - seekerAccuracy = 1; + seekerLockModes[] = { "LOBL" }; + + defaultNavigationType = "Direct"; + navigationTypes[] = { "Direct", "ZeroEffortMiss" }; + + navigationGain = 3; + + seekerAngle = 180; // Angle in front of the missile which can be searched + seekerAccuracy = 1; // seeker accuracy multiplier + seekerMinRange = 0; - seekerMaxRange = 2500; + seekerMaxRange = 2500; // Range from the missile which the seeker can visually search + + seekLastTargetPos = 1; // seek last target position [if seeker loses LOS of target, continue to last known pos] + + // Attack profile type selection defaultAttackProfile = "JAV_TOP"; - attackProfiles[] = {"JAV_TOP", "JAV_DIR"}; + attackProfiles[] = { "JAV_TOP", "JAV_DIR" }; + useModeForAttackProfile = 1; + + class navigationStates { + class initial { + transitionCondition = QEFUNC(missileguidance,javelin_midCourseTransition); + navigationType = "Direct"; + }; + class terminal { + transitionCondition = ""; + navigationType = "ZeroEffortMiss"; + }; + // transitions from initial -> termimal + states[] = {"initial", "terminal"}; + }; }; }; }; diff --git a/addons/compat_cup_weapons/compat_cup_weapons_nightvision/CfgWeapons.hpp b/addons/compat_cup_weapons/compat_cup_weapons_nightvision/CfgWeapons.hpp index 04d26b8ead8..5a8e1ca4e33 100644 --- a/addons/compat_cup_weapons/compat_cup_weapons_nightvision/CfgWeapons.hpp +++ b/addons/compat_cup_weapons/compat_cup_weapons_nightvision/CfgWeapons.hpp @@ -34,7 +34,7 @@ class CfgWeapons { // Binocular class CUP_NVG_PVS14: NVGoggles { - NVG_BINO_PRESET; + NVG_MONO_PRESET(3); NVG_GREEN_PRESET; }; class CUP_NVG_PVS15_black: NVGoggles { diff --git a/addons/compat_gm/CfgVehicles.hpp b/addons/compat_gm/CfgVehicles.hpp index 6d03465cd7f..d470e8a615d 100644 --- a/addons/compat_gm/CfgVehicles.hpp +++ b/addons/compat_gm/CfgVehicles.hpp @@ -81,15 +81,242 @@ class CfgVehicles { class gm_brdm2_base: gm_wheeled_APC_base { EGVAR(refuel,fuelCapacity) = 290; + + class EGVAR(interaction,anims) { + class AmmoBox_01_unhide { + phase = 0; + positions[] = {"_target selectionPosition ['ammobox_01', 'FireGeometry', 'AveragePoint']"}; + items[] = {"gm_AmmoBox_wood_04_empty"}; + name = "$STR_DN_gm_AmmoBox_wood_04_base"; + text = "$STR_DN_gm_AmmoBox_wood_04_base"; + }; + class AmmoBox_02_unhide { + phase = 0; + positions[] = {"_target selectionPosition ['ammobox_02', 'FireGeometry', 'AveragePoint']"}; + items[] = {"gm_AmmoBox_wood_04_empty"}; + name = "$STR_DN_gm_AmmoBox_wood_04_base"; + text = "$STR_DN_gm_AmmoBox_wood_04_base"; + }; + class AmmoBox_03_unhide { + phase = 0; + positions[] = {"_target selectionPosition ['ammobox_03', 'FireGeometry', 'AveragePoint']"}; + items[] = {"gm_AmmoBox_wood_04_empty"}; + name = "$STR_DN_gm_AmmoBox_wood_04_base"; + text = "$STR_DN_gm_AmmoBox_wood_04_base"; + }; + }; + }; + class gm_brdm2um_base: gm_brdm2_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class AmmoBox_01_unhide: AmmoBox_01_unhide { + positions[] = {{-0.1, -1.9, -0.5}}; + }; + class AmmoBox_02_unhide: AmmoBox_02_unhide { + positions[] = {{-0.55, -0.35, -0.35}}; + }; + class AmmoBox_03_unhide: AmmoBox_03_unhide { + positions[] = {{0.3, -1.85, -0.5}}; + }; + }; }; class gm_btr60_base: gm_wheeled_APC_base { EGVAR(refuel,fuelCapacity) = 290; EGVAR(cookoff,cookoffSelections)[] = {"commanderturret_hatch"}; + + class EGVAR(interaction,anims) { + class AmmoBox_01_unhide { + phase = 0; + positions[] = {"_target selectionPosition ['ammobox_01', 'FireGeometry', 'AveragePoint']"}; + items[] = {"gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"}; + name = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + text = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + }; + class AmmoBox_02_unhide { + phase = 0; + positions[] = {"_target selectionPosition ['ammobox_02', 'FireGeometry', 'AveragePoint']"}; + items[] = {"gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"}; + name = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + text = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + }; + class AmmoBox_03_unhide { + phase = 0; + positions[] = {"_target selectionPosition ['ammobox_03', 'FireGeometry', 'AveragePoint']"}; + items[] = {"gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"}; + name = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + text = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + }; + class AmmoBox_04_unhide { + phase = 0; + positions[] = {"_target selectionPosition ['ammobox_04', 'FireGeometry', 'AveragePoint']"}; + items[] = {"gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"}; + name = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + text = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + }; + class AmmoBox_05_unhide { + phase = 0; + positions[] = {"_target selectionPosition ['ammobox_05', 'FireGeometry', 'AveragePoint']"}; + items[] = {"gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"}; + name = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + text = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + }; + class AmmoBox_06_unhide { + phase = 0; + positions[] = {"_target selectionPosition ['ammobox_06', 'FireGeometry', 'AveragePoint']"}; + items[] = {"gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"}; + name = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + text = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + }; + class AmmoBox_07_unhide { + phase = 0; + positions[] = {"_target selectionPosition ['ammobox_07', 'FireGeometry', 'AveragePoint']"}; + items[] = {"gm_AmmoBox_wood_04_empty"}; + name = "$STR_DN_gm_AmmoBox_wood_04_base"; + text = "$STR_DN_gm_AmmoBox_wood_04_base"; + }; + }; + }; + + class gm_ural375d_base: gm_wheeled_truck_base { + EGVAR(refuel,fuelCapacity) = 360; + + class EGVAR(interaction,anims) { + class AmmoBox_01_unhide { + phase = 0; + positions[] = {{-0.55, 1.83, 0.7}}; + items[] = {"gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"}; + name = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + text = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + distance = 2.5; + }; + class AmmoBox_02_unhide { + phase = 0; + positions[] = {{0, 1.83, 0.7}}; + items[] = {"gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"}; + name = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + text = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + distance = 3; + }; + class AmmoBox_03_unhide { + phase = 0; + positions[] = {{0.55, 1.83, 0.7}}; + items[] = {"gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"}; + name = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + text = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + distance = 2.5; + }; + class AmmoBox_04_unhide { + phase = 0; + positions[] = {{-0.45, 1.83, 0.7}}; + items[] = {"gm_AmmoBox_wood_04_empty"}; + name = "$STR_DN_gm_AmmoBox_wood_04_base"; + text = "$STR_DN_gm_AmmoBox_wood_04_base"; + distance = 2.5; + }; + }; + }; + class gm_ural375d_mlrs_base: gm_ural375d_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class AmmoBox_01_unhide: AmmoBox_01_unhide { + positions[] = {{-0.55, 2, 0.5}}; + }; + class AmmoBox_02_unhide: AmmoBox_02_unhide { + positions[] = {{0, 2, 0.5}}; + }; + class AmmoBox_03_unhide: AmmoBox_03_unhide { + positions[] = {{0.55, 2, 0.5}}; + }; + class AmmoBox_04_unhide: AmmoBox_04_unhide { + positions[] = {{-0.45, 2, 0.5}}; + }; + }; + }; + class gm_ural375d_medic_base: gm_ural375d_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class AmmoBox_01_unhide: AmmoBox_01_unhide { + positions[] = {{-0.55, 2, 0.7}}; + }; + class AmmoBox_02_unhide: AmmoBox_02_unhide { + positions[] = {{0, 2, 0.7}}; + }; + class AmmoBox_03_unhide: AmmoBox_03_unhide { + positions[] = {{0.55, 2, 0.7}}; + }; + class AmmoBox_04_unhide: AmmoBox_04_unhide { + positions[] = {{-0.45, 2, 0.7}}; + }; + }; }; class gm_ural4320_base: gm_wheeled_truck_base { EGVAR(refuel,fuelCapacity) = 360; + + class EGVAR(interaction,anims) { + class AmmoBox_01_unhide { + phase = 0; + positions[] = {{-0.55, 1.47, 0.7}}; + items[] = {"gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"}; + name = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + text = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + distance = 2.5; + }; + class AmmoBox_02_unhide { + phase = 0; + positions[] = {{0, 1.47, 0.7}}; + items[] = {"gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"}; + name = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + text = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + distance = 3; + }; + class AmmoBox_03_unhide { + phase = 0; + positions[] = {{0.55, 1.47, 0.7}}; + items[] = {"gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"}; + name = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + text = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + distance = 2.5; + }; + class AmmoBox_04_unhide { + phase = 0; + positions[] = {{-0.45, 1.47, 0.7}}; + items[] = {"gm_AmmoBox_wood_04_empty"}; + name = "$STR_DN_gm_AmmoBox_wood_04_base"; + text = "$STR_DN_gm_AmmoBox_wood_04_base"; + distance = 2.5; + }; + }; + }; + class gm_ural4320_repair_base: gm_ural4320_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class AmmoBox_01_unhide: AmmoBox_01_unhide { + positions[] = {{-0.55, 1.62, 0.7}}; + }; + class AmmoBox_02_unhide: AmmoBox_02_unhide { + positions[] = {{0, 1.62, 0.7}}; + }; + class AmmoBox_03_unhide: AmmoBox_03_unhide { + positions[] = {{0.55, 1.62, 0.7}}; + }; + class AmmoBox_04_unhide: AmmoBox_04_unhide { + positions[] = {{-0.45, 1.62, 0.7}}; + }; + }; + }; + class gm_ural44202_base: gm_ural4320_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class AmmoBox_01_unhide: AmmoBox_01_unhide { + positions[] = {{-0.55, 1.37, 0.7}}; + }; + class AmmoBox_02_unhide: AmmoBox_02_unhide { + positions[] = {{0, 1.37, 0.7}}; + }; + class AmmoBox_03_unhide: AmmoBox_03_unhide { + positions[] = {{0.55, 1.37, 0.7}}; + }; + class AmmoBox_04_unhide: AmmoBox_04_unhide { + positions[] = {{-0.45, 1.37, 0.7}}; + }; + }; }; class gm_ural4320_reammo_base: gm_ural4320_base { @@ -190,9 +417,103 @@ class CfgVehicles { EGVAR(refuel,fuelCapacity) = 460; EGVAR(cookoff,cookoffSelections)[] = {"mainturret_hatch","commanderturret_hatch"}; }; + class gm_bmp1sp2_base: gm_bmp1_base { + class EGVAR(interaction,anims) { + class AmmoBox_01_unhide { + phase = 0; + positions[] = {{-1.2, -2.52, -1.2}}; + items[] = {"gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"}; + name = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + text = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + }; + class AmmoBox_02_unhide { + phase = 0; + positions[] = {{-1.3, -2, -1.2}}; + items[] = {"gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"}; + name = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + text = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + }; + class AmmoBox_03_unhide { + phase = 0; + positions[] = {{-1.35, -1.43, -1.2}}; + items[] = {"gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"}; + name = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + text = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + }; + class AmmoBox_04_unhide { + phase = 0; + positions[] = {{1.2, -2.52, -1.2}}; + items[] = {"gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"}; + name = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + text = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + }; + class AmmoBox_05_unhide { + phase = 0; + positions[] = {{1.3, -2, -1.2}}; + items[] = {"gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"}; + name = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + text = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + }; + class AmmoBox_06_unhide { + phase = 0; + positions[] = {{1.35, -1.43, -1.2}}; + items[] = {"gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"}; + name = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + text = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + }; + class AmmoBox_07_unhide { + phase = 0; + positions[] = {{-1.45, 0.1, -1.3}}; + items[] = {"gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"}; + name = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + text = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + }; + class AmmoBox_08_unhide { + phase = 0; + positions[] = {{-1.45, 2, -1.3}}; + items[] = {"gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"}; + name = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + text = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + }; + class AmmoBox_09_unhide { + phase = 0; + positions[] = {{1.45, 2, -1.3}}; + items[] = {"gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"}; + name = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + text = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + }; + }; + }; class gm_pt76_base: gm_tracked_Tank_base { EGVAR(refuel,fuelCapacity) = 250; + + class EGVAR(interaction,anims) { + class AmmoBox_01_unhide { + phase = 0; + positions[] = {{0.08, -1.75, -1}}; + items[] = {"gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"}; + name = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + text = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + distance = 2.5; + }; + class AmmoBox_02_unhide { + phase = 0; + positions[] = {{0.08, -1.38, -1}}; + items[] = {"gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"}; + name = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + text = "$STR_DN_gm_AmmoBox_880Rnd_762x39mm_b_M43_ak47"; + distance = 2.5; + }; + class AmmoBox_03_unhide { + phase = 0; + positions[] = {{0.08, -2.15, -1}}; + items[] = {"gm_AmmoBox_wood_04_empty"}; + name = "$STR_DN_gm_AmmoBox_wood_04_base"; + text = "$STR_DN_gm_AmmoBox_wood_04_base"; + distance = 2.5; + }; + }; }; class gm_t55_base: gm_tracked_Tank_base { @@ -204,6 +525,21 @@ class CfgVehicles { EGVAR(refuel,fuelCapacity) = 812; }; + class gm_tracked_Artillery_base; + class gm_2s1_base: gm_tracked_Artillery_base { + class EGVAR(interaction,anims) { + class AmmoBox_01_unhide { + phase = 0; + // Rotate interactions with turret rotation + positions[] = {"[0, -1.3, 0] vectorAdd ([[0, -1.1, -0.35], [0, 0, 1], deg (_target animationPhase 'mainturret_trav_anim')] call CBA_fnc_vectRotate3D)"}; + items[] = {"gm_AmmoBox_wood_04_empty"}; + name = "$STR_DN_gm_AmmoBox_wood_04_base"; + text = "$STR_DN_gm_AmmoBox_wood_04_base"; + distance = 2.5; + }; + }; + }; + // WEST class gm_Leopard1_base; class gm_Leopard1a0_base: gm_Leopard1_base { @@ -211,6 +547,27 @@ class CfgVehicles { EGVAR(cookoff,cookoffSelections)[] = {"mainturret_hatch_1","commanderturret_hatch"}; }; + class gm_Leopard1a1_base: gm_Leopard1a0_base { + class EGVAR(interaction,anims) { + class AmmoBox_01_unhide { + phase = 0; + // Rotate interactions with turret rotation + positions[] = {"[0, -0.6, 0] vectorAdd ([[0.7, -2, -0.6], [0, 0, 1], deg (_target animationPhase 'mainturret_trav_anim')] call CBA_fnc_vectRotate3D)"}; + items[] = {"gm_AmmoBox_wood_04_empty"}; + name = "$STR_DN_gm_AmmoBox_wood_04_base"; + text = "$STR_DN_gm_AmmoBox_wood_04_base"; + }; + class AmmoBox_02_unhide { + phase = 0; + // Rotate interactions with turret rotation + positions[] = {"[0, -0.6, 0] vectorAdd ([[-0.3, -1.95, -0.6], [0, 0, 1], deg (_target animationPhase 'mainturret_trav_anim')] call CBA_fnc_vectRotate3D)"}; + items[] = {"gm_AmmoBox_wood_04_empty"}; + name = "$STR_DN_gm_AmmoBox_wood_04_base"; + text = "$STR_DN_gm_AmmoBox_wood_04_base"; + }; + }; + }; + class gm_Gepard_base: gm_Leopard1_base { EGVAR(refuel,fuelCapacity) = 985; }; @@ -257,42 +614,39 @@ class CfgVehicles { EGVAR(refuel,fuelCapacity) = 3700; EGVAR(fastroping,enabled) = 0; - // TODO: stringtables class UserActions { - class openDoor_L { - displayNameDefault = "Open left Door"; - displayName = "Open left Door"; - position = ""; - radius = 2.7; - onlyForPlayer = 1; - condition = QUOTE((this animationSourcePhase 'door_2_1_unhide' > 0.5) && (this doorPhase 'door_2_1_source' < 0.5) && {alive this} && {!(this getVariable [ARR_2(QUOTE(QEGVAR(fastroping,doorsLocked)),false)])}); - statement = "this animateDoor ['door_2_1_source',1]"; - }; - - class openDoor_R: openDoor_L { - displayNameDefault = "Open right Door"; - displayName = "Open right Door"; - condition = QUOTE((this animationSourcePhase 'door_2_2_unhide' > 0.5) && (this doorPhase 'door_2_2_source' < 0.5) && {alive this} && {!(this getVariable [ARR_2(QUOTE(QEGVAR(fastroping,doorsLocked)),false)])}); - statement = "this animateDoor ['door_2_2_source',1]"; - }; - - class closeDoor_L { - displayNameDefault = "Close left Door"; - displayName = "Close left Door"; - position = ""; - radius = 2.7; - onlyForPlayer = 1; - condition = QUOTE((this animationSourcePhase 'door_2_1_unhide' > 0.5) && (this doorPhase 'door_2_1_source' > 0.5) && {alive this} && {!(this getVariable [ARR_2(QUOTE(QEGVAR(fastroping,doorsLocked)),false)])}); - statement = "this animateDoor ['door_2_1_source',0]"; - }; - - class closeDoor_R: closeDoor_L { - displayNameDefault = "Close right Door"; - displayName = "Close right Door"; - condition = QUOTE((this animationSourcePhase 'door_2_2_unhide' > 0.5) && (this doorPhase 'door_2_2_source' > 0.5) && {alive this} && {!(this getVariable [ARR_2(QUOTE(QEGVAR(fastroping,doorsLocked)),false)])}); - statement = "this animateDoor ['door_2_2_source',0]"; - }; + class openDoor_L { + displayNameDefault = "$STR_a3_cfgvehicles_useractions_openldoor0"; + displayName = "$STR_a3_cfgvehicles_useractions_openldoor0"; + position = ""; + radius = 2.7; + onlyForPlayer = 1; + condition = QUOTE((this animationSourcePhase 'door_2_1_unhide' > 0.5) && (this doorPhase 'door_2_1_source' < 0.5) && {alive this} && {!(this getVariable [ARR_2(QQEGVAR(fastroping,doorsLocked),false)])}); + statement = "this animateDoor ['door_2_1_source',1]"; + }; + class openDoor_R: openDoor_L { + displayNameDefault = "$STR_a3_cfgvehicles_useractions_openrdoor0"; + displayName = "$STR_a3_cfgvehicles_useractions_openrdoor0"; + condition = QUOTE((this animationSourcePhase 'door_2_2_unhide' > 0.5) && (this doorPhase 'door_2_2_source' < 0.5) && {alive this} && {!(this getVariable [ARR_2(QQEGVAR(fastroping,doorsLocked),false)])}); + statement = "this animateDoor ['door_2_2_source',1]"; + }; + + class closeDoor_L { + displayNameDefault = "$STR_a3_cfgvehicles_useractions_closeldoor0"; + displayName = "$STR_a3_cfgvehicles_useractions_closeldoor0"; + position = ""; + radius = 2.7; + onlyForPlayer = 1; + condition = QUOTE((this animationSourcePhase 'door_2_1_unhide' > 0.5) && (this doorPhase 'door_2_1_source' > 0.5) && {alive this} && {!(this getVariable [ARR_2(QQEGVAR(fastroping,doorsLocked),false)])}); + statement = "this animateDoor ['door_2_1_source',0]"; + }; + class closeDoor_R: closeDoor_L { + displayNameDefault = "$STR_a3_cfgvehicles_useractions_closerdoor0"; + displayName = "$STR_a3_cfgvehicles_useractions_closerdoor0"; + condition = QUOTE((this animationSourcePhase 'door_2_2_unhide' > 0.5) && (this doorPhase 'door_2_2_source' > 0.5) && {alive this} && {!(this getVariable [ARR_2(QQEGVAR(fastroping,doorsLocked),false)])}); + statement = "this animateDoor ['door_2_2_source',0]"; }; + }; }; class gm_bo105p1m_vbh_base; class gm_bo105p1m_vbh_swooper_base: gm_bo105p1m_vbh_base { diff --git a/addons/compat_gm/compat_gm_explosives/CfgAmmo.hpp b/addons/compat_gm/compat_gm_explosives/CfgAmmo.hpp index 3da49f45abe..a8f9ca632e5 100644 --- a/addons/compat_gm/compat_gm_explosives/CfgAmmo.hpp +++ b/addons/compat_gm/compat_gm_explosives/CfgAmmo.hpp @@ -1,9 +1,10 @@ class CfgAmmo { - class PipeBombBase; - class gm_explosive_petn_charge: PipeBombBase { + class gm_explosive_petn_base; + class gm_explosive_charge_petn: gm_explosive_petn_base { EGVAR(explosives,defuseObjectPosition)[] = {0, 0, 0.02}; }; - class gm_explosive_plnp_charge: PipeBombBase { + class gm_explosive_plnp_base; + class gm_explosive_charge_plnp: gm_explosive_plnp_base { EGVAR(explosives,defuseObjectPosition)[] = {0, 0, 0.02}; }; diff --git a/addons/compat_gm/compat_gm_explosives/CfgMagazines.hpp b/addons/compat_gm/compat_gm_explosives/CfgMagazines.hpp index 17d51d3b457..f0afb3b90cd 100644 --- a/addons/compat_gm/compat_gm_explosives/CfgMagazines.hpp +++ b/addons/compat_gm/compat_gm_explosives/CfgMagazines.hpp @@ -2,9 +2,8 @@ class CfgMagazines { // Explosives class gm_explosive_petn_charge_base; class gm_explosive_petn_charge: gm_explosive_petn_charge_base { - EGVAR(explosives,DelayTime) = 1; - EGVAR(explosives,Placeable) = 1; - EGVAR(explosives,SetupObject) =QEGVAR(explosives,Place_gm_explosive_petn); + EGVAR(explosives,placeable) = 1; + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_gm_explosive_petn); useAction = 0; class ACE_Triggers { SupportedTriggers[] = {"Timer", "Command", "MK16_Transmitter", "DeadmanSwitch"}; @@ -21,9 +20,8 @@ class CfgMagazines { class gm_explosive_plnp_charge_base; class gm_explosive_plnp_charge: gm_explosive_plnp_charge_base { - EGVAR(explosives,DelayTime) = 1; - EGVAR(explosives,Placeable) = 1; - EGVAR(explosives,SetupObject) =QEGVAR(explosives,Place_gm_explosive_plnp); + EGVAR(explosives,placeable) = 1; + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_gm_explosive_plnp); useAction = 0; class ACE_Triggers { SupportedTriggers[] = {"Timer", "Command", "MK16_Transmitter", "DeadmanSwitch"}; @@ -40,8 +38,8 @@ class CfgMagazines { class gm_mine_at_base; class gm_mine_at_tm46: gm_mine_at_base { - EGVAR(explosives,Placeable) = 1; - EGVAR(explosives,SetupObject) =QEGVAR(explosives,Place_gm_mine_tm46); + EGVAR(explosives,placeable) = 1; + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_gm_mine_tm46); useAction = 0; class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; @@ -51,8 +49,8 @@ class CfgMagazines { }; }; class gm_mine_at_dm21: gm_mine_at_base { - EGVAR(explosives,Placeable) = 1; - EGVAR(explosives,SetupObject) =QEGVAR(explosives,Place_gm_explosive_dm21); + EGVAR(explosives,placeable) = 1; + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_gm_explosive_dm21); useAction = 0; class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; @@ -62,8 +60,8 @@ class CfgMagazines { }; }; class gm_mine_at_mn111: gm_mine_at_base { - EGVAR(explosives,Placeable) = 1; - EGVAR(explosives,SetupObject) =QEGVAR(explosives,Place_gm_explosive_m111); + EGVAR(explosives,placeable) = 1; + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_gm_explosive_m111); useAction = 0; class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; @@ -74,8 +72,8 @@ class CfgMagazines { }; class gm_mine_ap_dm31: gm_mine_at_base { - EGVAR(explosives,Placeable) = 1; - EGVAR(explosives,SetupObject) =QEGVAR(explosives,Place_gm_explosive_dm31); + EGVAR(explosives,placeable) = 1; + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_gm_explosive_dm31); useAction = 0; class ACE_Triggers { SupportedTriggers[] = {"Tripwire"}; diff --git a/addons/compat_gm/compat_gm_explosives/CfgVehicles.hpp b/addons/compat_gm/compat_gm_explosives/CfgVehicles.hpp index bb279c82b94..ea201aa579a 100644 --- a/addons/compat_gm/compat_gm_explosives/CfgVehicles.hpp +++ b/addons/compat_gm/compat_gm_explosives/CfgVehicles.hpp @@ -9,7 +9,7 @@ class CfgVehicles { // CHARGE class EGVAR(explosives,Place_gm_explosive_petn): EGVAR(explosives,Place) { - displayName = "PETN Charge"; + displayName = "$STR_DN_GM_EXPLOSIVE_PETN_CHARGE"; model = "gm\gm_weapons\gm_put\gm_explosive_charge_petn"; class ACE_Actions: ACE_Actions { class ACE_MainActions: ACE_MainActions { @@ -18,7 +18,7 @@ class CfgVehicles { }; }; class EGVAR(explosives,Place_gm_explosive_plnp): EGVAR(explosives,Place) { - displayName = "PLNP Charge"; + displayName = "$STR_DN_GM_EXPLOSIVE_PLNP_CHARGE"; model = "gm\gm_weapons\gm_put\gm_explosive_charge_plnp"; class ACE_Actions: ACE_Actions { class ACE_MainActions: ACE_MainActions { @@ -28,7 +28,7 @@ class CfgVehicles { }; // AT MINE class EGVAR(explosives,Place_gm_mine_tm46): EGVAR(explosives,Place) { - displayName = "AT Mine TM46"; + displayName = "$STR_DN_GM_MINE_AT_TM46"; model = "gm\gm_weapons\gm_put\gm_mine_at_tm46"; class ACE_Actions: ACE_Actions { class ACE_MainActions: ACE_MainActions { @@ -37,7 +37,7 @@ class CfgVehicles { }; }; class EGVAR(explosives,Place_gm_explosive_dm21): EGVAR(explosives,Place) { - displayName = "AT Mine DM21"; + displayName = "$STR_DN_GM_MINE_AT_DM21"; model = "gm\gm_weapons\gm_put\gm_mine_at_dm21"; class ACE_Actions: ACE_Actions { class ACE_MainActions: ACE_MainActions { @@ -46,7 +46,7 @@ class CfgVehicles { }; }; class EGVAR(explosives,Place_gm_explosive_m111): EGVAR(explosives,Place) { - displayName = "MN 111"; + displayName = "$STR_DN_GM_MINE_AT_MN111"; model = "gm\gm_weapons\gm_launchers\gm_platan\gm_mine_at_mn111_disarmed"; class ACE_Actions: ACE_Actions { class ACE_MainActions: ACE_MainActions { @@ -56,7 +56,7 @@ class CfgVehicles { }; // AP class EGVAR(explosives,Place_gm_explosive_dm31): EGVAR(explosives,Place) { - displayName = "AP Mine DM31"; + displayName = "$STR_DN_GM_MINE_AP_DM31"; model = "gm\gm_weapons\gm_put\gm_mine_ap_dm31"; class ACE_Actions: ACE_Actions { class ACE_MainActions: ACE_MainActions { diff --git a/addons/compat_gm/compat_gm_explosives/config.cpp b/addons/compat_gm/compat_gm_explosives/config.cpp index e240c283896..9b4d16a1e6c 100644 --- a/addons/compat_gm/compat_gm_explosives/config.cpp +++ b/addons/compat_gm/compat_gm_explosives/config.cpp @@ -8,6 +8,7 @@ class CfgPatches { requiredVersion = REQUIRED_VERSION; requiredAddons[] = { "gm_core", + "gm_weapons_put", "ace_explosives" }; skipWhenMissingDependencies = 1; diff --git a/addons/compat_gm/compat_gm_refuel/CfgVehicles.hpp b/addons/compat_gm/compat_gm_refuel/CfgVehicles.hpp new file mode 100644 index 00000000000..aa51d469799 --- /dev/null +++ b/addons/compat_gm/compat_gm_refuel/CfgVehicles.hpp @@ -0,0 +1,336 @@ +class CfgVehicles { + class gm_typ2_base; + class gm_typ251_base: gm_typ2_base { + class EGVAR(interaction,anims) { + class canister_01_unhide { + phase = 0; + positions[] = {{-0.55, -0.17, 0.4}}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + class canister_02_unhide { + phase = 0; + positions[] = {{-0.55, -0.65, 0.4}}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + }; + }; + class gm_typ253_base: gm_typ2_base { + class EGVAR(interaction,anims) { + class canister_01_unhide { + phase = 0; + positions[] = {{-0.55, -0.19, 0.4}}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + class canister_02_unhide { + phase = 0; + positions[] = {{-0.55, -0.68, 0.4}}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + }; + }; + + class gm_wheeled_truck_base; + class gm_ural375d_base: gm_wheeled_truck_base { + class EGVAR(interaction,anims) { + class fuelcan_1_1_unhide { + phase = 0; + positions[] = {{-0.95, 3.15, -0.45}}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + class fuelcan_1_2_unhide { + phase = 0; + positions[] = {{0.9, 3.15, -0.45}}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + }; + }; + class gm_ural375d_mlrs_base: gm_ural375d_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class fuelcan_1_1_unhide: fuelcan_1_1_unhide { + positions[] = {{-0.95, 3.35, -0.55}}; + }; + class fuelcan_1_2_unhide: fuelcan_1_2_unhide { + positions[] = {{0.9, 3.35, -0.55}}; + }; + }; + }; + class gm_ural375d_medic_base: gm_ural375d_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class fuelcan_1_1_unhide: fuelcan_1_1_unhide { + positions[] = {{-0.95, 3.35, -0.45}}; + }; + class fuelcan_1_2_unhide: fuelcan_1_2_unhide { + positions[] = {{0.9, 3.35, -0.45}}; + }; + }; + }; + + class gm_ural4320_base: gm_wheeled_truck_base { + class EGVAR(interaction,anims) { + class fuelcan_1_1_unhide { + phase = 0; + positions[] = {{-0.9, 3.1, -0.4}}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + class fuelcan_1_2_unhide { + phase = 0; + positions[] = {{0.9, 3.1, -0.4}}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + }; + }; + class gm_ural4320_repair_base: gm_ural4320_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class fuelcan_1_1_unhide: fuelcan_1_1_unhide { + positions[] = {{-0.9, 3.25, -0.4}}; + }; + class fuelcan_1_2_unhide: fuelcan_1_2_unhide { + positions[] = {{0.9, 3.25, -0.4}}; + }; + }; + }; + class gm_ural44202_base: gm_ural4320_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class fuelcan_1_1_unhide: fuelcan_1_1_unhide { + positions[] = {{-0.9, 3, -0.4}}; + }; + class fuelcan_1_2_unhide: fuelcan_1_2_unhide { + positions[] = {{0.9, 3, -0.4}}; + }; + }; + }; + + class gm_wheeled_APC_base; + class gm_brdm2_base: gm_wheeled_APC_base { + class EGVAR(interaction,anims) { + class FuelCanister_01_unhide { + phase = 0; + positions[] = {"_target selectionPosition ['fuelcanister_01', 'FireGeometry', 'AveragePoint']"}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + class FuelCanister_02_unhide { + phase = 0; + positions[] = {"_target selectionPosition ['fuelcanister_02', 'FireGeometry', 'AveragePoint']"}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + class FuelCanister_03_unhide { + phase = 0; + positions[] = {"_target selectionPosition ['fuelcanister_03', 'FireGeometry', 'AveragePoint']"}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + }; + }; + class gm_brdm2um_base: gm_brdm2_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class FuelCanister_01_unhide: FuelCanister_01_unhide { + positions[] = {{0.87, -3, -1.2}}; + }; + class FuelCanister_02_unhide: FuelCanister_02_unhide { + positions[] = {{-0.87, -3, -1.2}}; + }; + class FuelCanister_03_unhide: FuelCanister_03_unhide { + positions[] = {{-0.4, -1.85, -0.5}}; + }; + }; + }; + + class gm_btr60_base: gm_wheeled_APC_base { + class EGVAR(interaction,anims) { + class FuelCanister_01_unhide { + phase = 0; + positions[] = {"_target selectionPosition ['fuelcanister_01', 'FireGeometry', 'AveragePoint']"}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + class FuelCanister_02_unhide { + phase = 0; + positions[] = {"_target selectionPosition ['fuelcanister_02', 'FireGeometry', 'AveragePoint']"}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + class FuelCanister_03_unhide { + phase = 0; + positions[] = {"_target selectionPosition ['fuelcanister_03', 'FireGeometry', 'AveragePoint']"}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + class FuelCanister_04_unhide { + phase = 0; + positions[] = {"_target selectionPosition ['fuelcanister_04', 'FireGeometry', 'AveragePoint']"}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + class FuelCanister_05_unhide { + phase = 0; + positions[] = {"_target selectionPosition ['fuelcanister_05', 'FireGeometry', 'AveragePoint']"}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + class FuelCanister_06_unhide { + phase = 0; + positions[] = {"_target selectionPosition ['fuelcanister_06', 'FireGeometry', 'AveragePoint']"}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + }; + }; + class gm_btr60pa_base: gm_btr60_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class FuelCanister_05_unhide: FuelCanister_05_unhide { + items[] = {"Land_CanisterFuel_F", "Land_CanisterFuel_F"}; + }; + class FuelCanister_06_unhide: FuelCanister_06_unhide { + items[] = {"Land_CanisterFuel_F", "Land_CanisterFuel_F"}; + }; + }; + }; + class gm_btr60pb_base: gm_btr60_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class FuelCanister_03_unhide: FuelCanister_03_unhide { + items[] = {"Land_CanisterFuel_F", "Land_CanisterFuel_F"}; + }; + class FuelCanister_04_unhide: FuelCanister_04_unhide { + items[] = {"Land_CanisterFuel_F", "Land_CanisterFuel_F"}; + }; + }; + }; + class gm_btr60pu12_base: gm_btr60_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class FuelCanister_03_unhide: FuelCanister_03_unhide { + items[] = {"Land_CanisterFuel_F", "Land_CanisterFuel_F"}; + }; + class FuelCanister_04_unhide: FuelCanister_04_unhide { + items[] = {"Land_CanisterFuel_F", "Land_CanisterFuel_F"}; + }; + }; + }; + + class gm_bmp1_base; + class gm_bmp1sp2_base: gm_bmp1_base { + class EGVAR(interaction,anims) { + class FuelCanister_01_unhide { + phase = 0; + positions[] = {{-1.2, -2.52, -1.2}}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + class FuelCanister_02_unhide { + phase = 0; + positions[] = {{1.2, -2.52, -1.2}}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + }; + }; + + class gm_zsu234_base; + class gm_zsu234v1_base: gm_zsu234_base { + class EGVAR(interaction,anims) { + class FuelCanister_01_unhide { + phase = 0; + // Rotate interactions with turret rotation + positions[] = {"[0, 0.2, 0] vectorAdd ([[-0.85, -2.2, -0.9], [0, 0, 1], deg (_target animationPhase 'mainturret_trav_anim')] call CBA_fnc_vectRotate3D)"}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + class FuelCanister_02_unhide { + phase = 0; + // Rotate interactions with turret rotation + positions[] = {"[0, 0.2, 0] vectorAdd ([[0.7, -2.25, -0.85], [0, 0, 1], deg (_target animationPhase 'mainturret_trav_anim')] call CBA_fnc_vectRotate3D)"}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + class FuelCanister_03_unhide { + phase = 0; + // Rotate interactions with turret rotation + positions[] = {"[0, 0.2, 0] vectorAdd ([[0.92, -2.25, -0.85], [0, 0, 1], deg (_target animationPhase 'mainturret_trav_anim')] call CBA_fnc_vectRotate3D)"}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + }; + }; + + class gm_tracked_Tank_base; + class gm_pt76_base: gm_tracked_Tank_base { + class EGVAR(interaction,anims) { + class FuelTank_01_unhide { + phase = 0; + positions[] = {{-1, -2.85, -1}}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + class FuelTank_02_unhide { + phase = 0; + positions[] = {{1, -2.85, -1}}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + }; + }; + + class gm_Leopard1a0_base; + class gm_Leopard1a1_base: gm_Leopard1a0_base { + class EGVAR(interaction,anims) { + class FuelCanister_01_unhide { + phase = 0; + // Rotate interactions with turret rotation + positions[] = {"[0, -0.6, 0] vectorAdd ([[0.25, -1.9, -0.55], [0, 0, 1], deg (_target animationPhase 'mainturret_trav_anim')] call CBA_fnc_vectRotate3D)"}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + distance = 2.5; + }; + class FuelCanister_02_unhide { + phase = 0; + // Rotate interactions with turret rotation + positions[] = {"[0, -0.6, 0] vectorAdd ([[-0.8, -1.65, -0.55], [0, 0, 1], deg (_target animationPhase 'mainturret_trav_anim')] call CBA_fnc_vectRotate3D)"}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + class FuelCanister_03_unhide { + phase = 0; + // Rotate interactions with turret rotation + positions[] = {"[0, -0.6, 0] vectorAdd ([[0.8, -1.8, -0.55], [0, 0, 1], deg (_target animationPhase 'mainturret_trav_anim')] call CBA_fnc_vectRotate3D)"}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + }; + }; +}; diff --git a/addons/compat_gm/compat_gm_refuel/config.cpp b/addons/compat_gm/compat_gm_refuel/config.cpp index 05688eff702..6becabe70a9 100644 --- a/addons/compat_gm/compat_gm_refuel/config.cpp +++ b/addons/compat_gm/compat_gm_refuel/config.cpp @@ -21,3 +21,4 @@ class CfgPatches { }; #include "CfgEventHandlers.hpp" +#include "CfgVehicles.hpp" diff --git a/addons/compat_gm/compat_gm_repair/CfgVehicles.hpp b/addons/compat_gm/compat_gm_repair/CfgVehicles.hpp new file mode 100644 index 00000000000..12f9253bba6 --- /dev/null +++ b/addons/compat_gm/compat_gm_repair/CfgVehicles.hpp @@ -0,0 +1,100 @@ +class CfgVehicles { + class gm_wheeled_car_base; + class gm_uaz469_base: gm_wheeled_car_base { + class EGVAR(interaction,anims) { + class spare_wheel_unhide { + phase = 0; + positions[] = {"_target selectionPosition ['spare_wheel', 'FireGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + + class gm_wheeled_APC_base; + class gm_brdm2_base: gm_wheeled_APC_base { + class EGVAR(interaction,anims) { + class SpareWheel_01_unhide { + phase = 0; + positions[] = {"_target selectionPosition ['sparewheel_01', 'FireGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + distance = 2.5; + }; + class SpareWheel_02_unhide { + phase = 0; + positions[] = {"_target selectionPosition ['sparewheel_02', 'FireGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + class gm_brdm2um_base: gm_brdm2_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class SpareWheel_01_unhide: SpareWheel_01_unhide { + positions[] = {{0.2, -0.7, -0.25}}; + distance = 2; + }; + class SpareWheel_02_unhide: SpareWheel_02_unhide { + positions[] = {{0, -1.6, -0.4}}; + }; + }; + }; + + class gm_btr60_base: gm_wheeled_APC_base { + class EGVAR(interaction,anims) { + class SpareWheel_01_unhide { + phase = 0; + positions[] = {"_target selectionPosition ['sparewheel_01', 'FireGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + distance = 3; + }; + class SpareWheel_02_unhide { + phase = 0; + positions[] = {"_target selectionPosition ['sparewheel_02', 'FireGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + class SpareWheel_03_unhide { + phase = 0; + positions[] = {"_target selectionPosition ['sparewheel_03', 'FireGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + + class gm_bmp1_base; + class gm_bmp1sp2_base: gm_bmp1_base { + class EGVAR(interaction,anims) { + class spareTracks_1_1_unhide { + phase = 0; + positions[] = {"(_target selectionPosition ['door_1_1', 'FireGeometry', 'AveragePoint']) vectorAdd [0, 0, -0.15]"}; + items[] = {"ACE_Track"}; + name = ECSTRING(repair,RemoveTrack); + text = ECSTRING(repair,RemovingTrack); + }; + class spareTracks_1_2_unhide { + phase = 0; + positions[] = {"(_target selectionPosition ['door_1_2', 'FireGeometry', 'AveragePoint']) vectorAdd [0, 0, -0.15]"}; + items[] = {"ACE_Track"}; + name = ECSTRING(repair,RemoveTrack); + text = ECSTRING(repair,RemovingTrack); + }; + class spareTracks_2_1_unhide { + phase = 0; + positions[] = {{-1.1, -2.7, -1.3}, {1.1, -2.7, -1.3}}; + items[] = {"ACE_Track", "ACE_Track"}; + name = ECSTRING(repair,RemoveTrack); + text = ECSTRING(repair,RemovingTrack); + }; + }; + }; +}; diff --git a/addons/compat_gm/compat_gm_repair/config.cpp b/addons/compat_gm/compat_gm_repair/config.cpp new file mode 100644 index 00000000000..6fae9858b4b --- /dev/null +++ b/addons/compat_gm/compat_gm_repair/config.cpp @@ -0,0 +1,23 @@ +#include "script_component.hpp" + +class CfgPatches { + class SUBADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { + "gm_core", + "ace_repair" + }; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {"johnb43"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + + addonRootClass = QUOTE(ADDON); + }; +}; + +#include "CfgVehicles.hpp" diff --git a/addons/compat_gm/compat_gm_repair/script_component.hpp b/addons/compat_gm/compat_gm_repair/script_component.hpp new file mode 100644 index 00000000000..1af928486c3 --- /dev/null +++ b/addons/compat_gm/compat_gm_repair/script_component.hpp @@ -0,0 +1,3 @@ +#define SUBCOMPONENT repair +#define SUBCOMPONENT_BEAUTIFIED Repair +#include "..\script_component.hpp" diff --git a/addons/compat_gm/compat_gm_trenches/CfgVehicles.hpp b/addons/compat_gm/compat_gm_trenches/CfgVehicles.hpp new file mode 100644 index 00000000000..b5c32d8be1e --- /dev/null +++ b/addons/compat_gm/compat_gm_trenches/CfgVehicles.hpp @@ -0,0 +1,47 @@ +class CfgVehicles { + class gm_wheeled_truck_base; + class gm_ural375d_base: gm_wheeled_truck_base { + class EGVAR(interaction,anims) { + class tools_unhide { + phase = 0; + positions[] = {{0.9, 3.15, -0.5}}; + items[] = {"ACE_EntrenchingTool"}; + name = ECSTRING(trenches,EntrenchingToolName); + text = ECSTRING(trenches,EntrenchingToolName); + }; + }; + }; + class gm_ural375d_mlrs_base: gm_ural375d_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class tools_unhide: tools_unhide { + positions[] = {{0.9, 3.35, -0.65}}; + }; + }; + }; + class gm_ural375d_medic_base: gm_ural375d_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class tools_unhide: tools_unhide { + positions[] = {{0.9, 3.35, -0.5}}; + }; + }; + }; + + class gm_ural4320_base: gm_wheeled_truck_base { + class EGVAR(interaction,anims) { + class tools_unhide { + phase = 0; + positions[] = {{0.93, 2.7, -0.5}}; + items[] = {"ACE_EntrenchingTool"}; + name = ECSTRING(trenches,EntrenchingToolName); + text = ECSTRING(trenches,EntrenchingToolName); + }; + }; + }; + class gm_ural44202_base: gm_ural4320_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class tools_unhide: tools_unhide { + positions[] = {{0.9, 2.6, -0.5}}; + }; + }; + }; +}; diff --git a/addons/compat_gm/compat_gm_trenches/config.cpp b/addons/compat_gm/compat_gm_trenches/config.cpp new file mode 100644 index 00000000000..13c4dd0816d --- /dev/null +++ b/addons/compat_gm/compat_gm_trenches/config.cpp @@ -0,0 +1,23 @@ +#include "script_component.hpp" + +class CfgPatches { + class SUBADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { + "gm_core", + "ace_trenches" + }; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {"johnb43"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + + addonRootClass = QUOTE(ADDON); + }; +}; + +#include "CfgVehicles.hpp" diff --git a/addons/compat_gm/compat_gm_trenches/script_component.hpp b/addons/compat_gm/compat_gm_trenches/script_component.hpp new file mode 100644 index 00000000000..10b90eb71e5 --- /dev/null +++ b/addons/compat_gm/compat_gm_trenches/script_component.hpp @@ -0,0 +1,3 @@ +#define SUBCOMPONENT trenches +#define SUBCOMPONENT_BEAUTIFIED Trenches +#include "..\script_component.hpp" diff --git a/addons/compat_rf/CfgVehicles.hpp b/addons/compat_rf/CfgVehicles.hpp new file mode 100644 index 00000000000..fa0343908a9 --- /dev/null +++ b/addons/compat_rf/CfgVehicles.hpp @@ -0,0 +1,25 @@ +class CfgVehicles { + // Applies the offset to all RF Offroads which can have the optional tank in the back + class Offroad_01_unarmed_base_F; + class Pickup_01_base_rf: Offroad_01_unarmed_base_F { + EXGVAR(field_rations,offset)[] = {-0.04, -2.45, -0.9}; + }; + + // Enable Water Source by Default + class C_IDAP_Pickup_rf; + class C_IDAP_Pickup_water_rf: C_IDAP_Pickup_rf { + EXGVAR(field_rations,waterSupply) = 500; + }; + + class O_Truck_03_fuel_F; + class C_Truck_03_water_rf: O_Truck_03_fuel_F { + EXGVAR(field_rations,waterSupply) = 10000; + EXGVAR(field_rations,offset)[] = {0, -5.05, -0.3}; + }; + + class B_Truck_01_fuel_F; + class C_Truck_01_water_rf: B_Truck_01_fuel_F { + EXGVAR(field_rations,waterSupply) = 10000; + EXGVAR(field_rations,offset)[] = {-0.41, -5.15, -0.3}; + }; +}; diff --git a/addons/compat_rf/compat_rf_realisticnames/stringtable.xml b/addons/compat_rf/compat_rf_realisticnames/stringtable.xml index 03d5003a620..16a6e927897 100644 --- a/addons/compat_rf/compat_rf_realisticnames/stringtable.xml +++ b/addons/compat_rf/compat_rf_realisticnames/stringtable.xml @@ -7,6 +7,7 @@ <Korean>이오텍 MRDS (카키)</Korean> <German>EOTech MRDS (Khaki)</German> <Italian>EOTech MRDS (Cachi)</Italian> + <French>EOTech MRDS (Khaki)</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_optic_mrd_tan_Name"> <English>EOTech MRDS (Tan)</English> @@ -14,6 +15,7 @@ <Korean>이오텍 MRDS (황갈)</Korean> <German>EOTech MRDS (Hellbraun)</German> <Italian>EOTech MRDS (Marroncino)</Italian> + <French>EOTech MRDS (Marron)</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_optic_aco_grn_desert_Name"> <English>C-More Railway (Green, Desert)</English> @@ -21,6 +23,7 @@ <Korean>씨모어 레일웨이 (녹색, 사막)</Korean> <German>C-More Railway (Grün, Wüste)</German> <Italian>C-More Railway (Verde, Deserto)</Italian> + <French>C-More Railway (Vert, Désert)</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_optic_aco_grn_wood_Name"> <English>C-More Railway (Green, Woodland)</English> @@ -28,6 +31,7 @@ <Korean>씨모어 레일웨이 (녹색, 수풀 위장)</Korean> <German>C-More Railway (Grün, Grünes Tarnmuster)</German> <Italian>C-More Railway (Verde, Boschivo)</Italian> + <French>C-More Railway (Vert, Woodland)</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_optic_aco_desert_Name"> <English>C-More Railway (Red, Desert)</English> @@ -35,6 +39,7 @@ <Korean>씨모어 레일웨이 (빨강, 사막)</Korean> <German>C-More Railway (Rot, Wüste)</German> <Italian>C-More Railway (Rosso, Desert)</Italian> + <French>C-More Railway (Rouge, Désert)</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_optic_aco_wood_Name"> <English>C-More Railway (Red, Woodland)</English> @@ -42,6 +47,7 @@ <Korean>씨모어 레일웨이 (빨강, 수풀)</Korean> <German>C-More Railway (Rot, Grünes Tarnmuster)</German> <Italian>C-More Railway (Rosso, Boschivo)</Italian> + <French>C-More Railway (Rouge, Woodland)</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_optic_rds_Name"> <English>Aimpoint Micro R-1</English> @@ -49,6 +55,7 @@ <Korean>에임포인트 마이크로 R-1</Korean> <German>Aimpoint Micro R-1</German> <Italian>Aimpoint Micro R-1</Italian> + <French>Aimpoint Micro R-1</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_optic_vrco_Name"> <English>Vortex Spitfire Prism</English> @@ -56,6 +63,7 @@ <Korean>버텍스 스핏파이어 프리즘</Korean> <German>Vortex Spitfire Prism</German> <Italian>Vortex Spitfire Prism</Italian> + <French>Vortex Spitfire Prism</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_optic_vrco_tan_Name"> <English>Vortex Spitfire Prism (Tan)</English> @@ -63,6 +71,7 @@ <Korean>버텍스 스핏파이어 프리즘 (황갈)</Korean> <German>Vortex Spitfire Prism (Hellbraun)</German> <Italian>Vortex Spitfire Prism (Marroncino)</Italian> + <French>Vortex Spitfire Prism (Marron)</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_optic_vrco_khk_Name"> <English>Vortex Spitfire Prism (Khaki)</English> @@ -70,6 +79,7 @@ <Korean>버텍스 스핏파이어 프리즘 (카키)</Korean> <German>Vortex Spitfire Prism (Khaki)</German> <Italian>Vortex Spitfire Prism (Cachi)</Italian> + <French>Vortex Spitfire Prism (Khaki)</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_optic_vrco_pistol_Name"> <English>Vortex Spitfire Prism (Pistol)</English> @@ -77,6 +87,7 @@ <Korean>버텍스 스핏파이어 프리즘 (권총용)</Korean> <German>Vortex Spitfire Prism (Pistole)</German> <Italian>Vortex Spitfire Prism (Pistola)</Italian> + <French>Vortex Spitfire Prism (Pistol)</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_glock19_Name"> <English>Glock 19X</English> @@ -84,6 +95,7 @@ <Korean>글록 19X</Korean> <German>Glock 19X</German> <Italian>Glock 19X</Italian> + <French>Glock 19X</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_glock19_khk_Name"> <English>Glock 19X (Khaki)</English> @@ -91,6 +103,7 @@ <Korean>글록 19X (카키)</Korean> <German>Glock 19X (Khaki)</German> <Italian>Glock 19X (Cachi)</Italian> + <French>Glock 19X (Khaki)</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_glock19_tan_Name"> <English>Glock 19X (Tan)</English> @@ -98,6 +111,7 @@ <Korean>글록 19X (황갈)</Korean> <German>Glock 19X (Hellbraun)</German> <Italian>Glock 19X (Marroncino)</Italian> + <French>Glock 19X (Marron)</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_glock19_auto_Name"> <English>Glock 19X Auto</English> @@ -105,6 +119,7 @@ <Korean>글록 19X 기관권총</Korean> <German>Glock 19X Auto</German> <Italian>Glock 19X Auto</Italian> + <French>Glock 19X Auto</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_glock19_auto_khk_Name"> <English>Glock 19X Auto (Khaki)</English> @@ -112,6 +127,7 @@ <Korean>글록 19X 기관권총 (카키)</Korean> <German>Glock 19X Auto (Khaki)</German> <Italian>Glock 19X Auto (Cachi)</Italian> + <French>Glock 19X Auto (Khaki)</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_glock19_auto_tan_Name"> <English>Glock 19X Auto (Tan)</English> @@ -119,6 +135,7 @@ <Korean>글록 19X 기관권총 (황갈)</Korean> <German>Glock 19X Auto (Hellbraun)</German> <Italian>Glock 19X Auto (Marroncino)</Italian> + <French>Glock 19X Auto (Marron)</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_deagle_Name"> <English>Desert Eagle Mark XIX L5</English> @@ -126,6 +143,7 @@ <Korean>데저트 이글 마크 XIX L5</Korean> <German>Desert Eagle Mark XIX L5</German> <Italian>Desert Eagle Mark XIX L5</Italian> + <French>Desert Eagle Mark XIX L5</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_deagle_classic_Name"> <English>Desert Eagle Mark XIX L5 (Classic)</English> @@ -133,6 +151,7 @@ <Korean>데저트 이글 마크 XIX L5 (클래식)</Korean> <German>Desert Eagle Mark XIX L5 (Klassisch)</German> <Italian>Desert Eagle Mark XIX L5 (Classico)</Italian> + <French>Desert Eagle Mark XIX L5 (Classique)</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_deagle_bronze_Name"> <English>Desert Eagle Mark XIX L5 (Bronze)</English> @@ -140,6 +159,7 @@ <Korean>데저트 이글 마크 XIX L5 (브론즈)</Korean> <German>Desert Eagle Mark XIX L5 (Bronze)</German> <Italian>Desert Eagle Mark XIX L5 (Bronzo)</Italian> + <French>Desert Eagle Mark XIX L5 (Bronze)</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_deagle_copper_Name"> <English>Desert Eagle Mark XIX L5 (Copper)</English> @@ -147,6 +167,7 @@ <Korean>데저트 이글 마크 XIX L5 (구리)</Korean> <German>Desert Eagle Mark XIX L5 (Kupfer)</German> <Italian>Desert Eagle Mark XIX L5 (Rame)</Italian> + <French>Desert Eagle Mark XIX L5 (Cuivre)</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_deagle_gold_Name"> <English>Desert Eagle Mark XIX L5 (Gold)</English> @@ -154,6 +175,7 @@ <Korean>데저트 이글 마크 XIX L5 (금색)</Korean> <German>Desert Eagle Mark XIX L5 (Gold)</German> <Italian>Desert Eagle Mark XIX L5 (Oro)</Italian> + <French>Desert Eagle Mark XIX L5 (Or)</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_h6_tan_Name"> <English>HERA H6 (Tan)</English> @@ -161,6 +183,7 @@ <Korean>헤라 H6 (황갈)</Korean> <German>HERA H6 (Hellbraun)</German> <Italian>HERA H6 (Marroncino)</Italian> + <French>HERA H6 (Marron)</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_h6_oli_Name"> <English>HERA H6 (Olive)</English> @@ -168,6 +191,7 @@ <Korean>헤라 H6 (올리브)</Korean> <German>HERA H6 (Olivgrün)</German> <Italian>HERA H6 (Oliva)</Italian> + <French>HERA H6 (Olive)</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_h6_blk_Name"> <English>HERA H6 (Black)</English> @@ -175,6 +199,7 @@ <Korean>헤라 H6 (검정)</Korean> <German>HERA H6 (Schwarz)</German> <Italian>HERA H6 (Nero)</Italian> + <French>HERA H6 (Noir)</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_h6_digi_Name"> <English>HERA H6 (Digital)</English> @@ -182,6 +207,7 @@ <Korean>헤라 H6 (AAF 디지털)</Korean> <German>HERA H6 (Digital)</German> <Italian>HERA H6 (Digitale)</Italian> + <French>HERA H6 (Digital)</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_h6_gold_Name"> <English>HERA H6 (Gold)</English> @@ -189,6 +215,7 @@ <Korean>헤라 H6 (금색)</Korean> <German>HERA H6 (Gold)</German> <Italian>HERA H6 (Oro)</Italian> + <French>HERA H6 (Or)</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_dmr_01_black_Name"> <English>VS-121 (Black)</English> @@ -196,6 +223,7 @@ <Korean>VS-121 (검정)</Korean> <German>VS-121 (Schwarz)</German> <Italian>VS-121 (Nero)</Italian> + <French>VS-121 (Noir)</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_dmr_01_tan_Name"> <English>VS-121 (Tan)</English> @@ -203,6 +231,7 @@ <Korean>VS-121 (황갈)</Korean> <German>VS-121 (Hellbraun)</German> <Italian>VS-121 (Marroncino)</Italian> + <French>VS-121 (Marron)</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_smg_01_black_Name"> <English>Vector SMG (Black)</English> @@ -210,6 +239,7 @@ <Korean>벡터 SMG (검정)</Korean> <German>Vector SMG (Schwarz)</German> <Italian>Vector SMG (Nero)</Italian> + <French>Vector SMG (Noir)</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_ash12_blk_Name"> <English>ASh-12 (Black)</English> @@ -217,6 +247,7 @@ <Korean>ASh-12 (검정)</Korean> <German>ASh-12 (Schwarz)</German> <Italian>ASh-12 (Nero)</Italian> + <French>ASh-12 (Noir)</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_ash12_desert_Name"> <English>ASh-12 (Desert)</English> @@ -224,6 +255,7 @@ <Korean>ASh-12 (사막)</Korean> <German>ASh-12 (Wüste)</German> <Italian>ASh-12 (Deserto)</Italian> + <French>ASh-12 (Désert )</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_ash12_urban_Name"> <English>ASh-12 (Urban)</English> @@ -231,6 +263,7 @@ <Korean>ASh-12 (도심)</Korean> <German>ASh-12 (Urban)</German> <Italian>ASh-12 (Urbano)</Italian> + <French>ASh-12 (Urbain)</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_ash12_wood_Name"> <English>ASh-12 (Woodland)</English> @@ -238,6 +271,7 @@ <Korean>ASh-12 (수풀)</Korean> <German>ASh-12 (Grünes Tarnmuster)</German> <Italian>ASh-12 (Boschivo)</Italian> + <French>ASh-12 (Woodland)</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_ash12_gl_blk_Name"> <English>ASh-12 GL (Black)</English> @@ -245,6 +279,7 @@ <Korean>ASh-12 GL (검정)</Korean> <German>ASh-12 GL (Schwarz)</German> <Italian>ASh-12 GL (Nero)</Italian> + <French>ASh-12 GL (Noir)</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_ash12_gl_desert_Name"> <English>ASh-12 GL (Desert)</English> @@ -252,6 +287,7 @@ <Korean>ASh-12 GL (사막)</Korean> <German>ASh-12 GL (Wüste)</German> <Italian>ASh-12 GL (Deserto)</Italian> + <French>ASh-12 GL (Désert)</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_ash12_gl_urban_Name"> <English>ASh-12 GL (Urban)</English> @@ -259,6 +295,7 @@ <Korean>ASh-12 GL (도심)</Korean> <German>ASh-12 GL (Urban)</German> <Italian>ASh-12 GL (Urbano)</Italian> + <French>ASh-12 GL (Urbain)</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_ash12_gl_wood_Name"> <English>ASh-12 GL (Woodland)</English> @@ -266,6 +303,7 @@ <Korean>ASh-12 GL (수풀)</Korean> <German>ASh-12 GL (Grünes Tarnmuster)</German> <Italian>ASh-12 GL (Boschivo)</Italian> + <French>ASh-12 GL (Woodland)</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_ash12_lr_blk_Name"> <English>ASh-12 LR (Black)</English> @@ -273,6 +311,7 @@ <Korean>ASh-12 LR (검정)</Korean> <German>ASh-12 LR (Schwarz)</German> <Italian>ASh-12 LR (Nero)</Italian> + <French>ASh-12 LR (Noir)</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_ash12_lr_desert_Name"> <English>ASh-12 LR (Desert)</English> @@ -280,6 +319,7 @@ <Korean>ASh-12 LR (사막)</Korean> <German>ASh-12 LR (Wüste)</German> <Italian>ASh-12 LR (Deserto)</Italian> + <French>ASh-12 LR (Désert)</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_ash12_lr_urban_Name"> <English>ASh-12 LR (Urban)</English> @@ -287,6 +327,7 @@ <Korean>ASh-12 LR (도심)</Korean> <German>ASh-12 LR (Urban)</German> <Italian>ASh-12 LR (Urbano)</Italian> + <French>ASh-12 LR (Urbain)</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_ash12_lr_wood_Name"> <English>ASh-12 LR (Woodland)</English> @@ -294,6 +335,7 @@ <Korean>ASh-12 LR (수풀)</Korean> <German>ASh-12 LR (Grünes Tarnmuster)</German> <Italian>ASh-12 LR (Boschivo)</Italian> + <French>ASh-12 LR (Woodland)</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_heli_light_03_Name"> <English>AW159 Wildcat ASW</English> @@ -301,6 +343,7 @@ <Korean>AW159 와일드캣 ASW</Korean> <German>AW159 Wildcat ASW</German> <Italian>AW159 Wildcat ASW</Italian> + <French>AW159 Wildcat ASW</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_heli_light_03_unarmed_Name"> <English>AW159 Wildcat ASW (Unarmed)</English> @@ -308,6 +351,7 @@ <Korean>AW159 와일드캣 ASW (비무장)</Korean> <German>AW159 Wildcat ASW (Unbewaffnet)</German> <Italian>AW159 Wildcat ASW (Disarmato)</Italian> + <French>AW159 Wildcat ASW (non armé)</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_ec_01_base_Name"> <English>H225 Super Puma (Transport)</English> @@ -315,6 +359,7 @@ <Korean>H225 슈퍼 퓨마 (비무장)</Korean> <German>H225 Super Puma (Transport)</German> <Italian>H225 Super Puma (Trasporto)</Italian> + <French>H225 Super Puma (Transport )</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_ec_01_civ_base_Name"> <English>H225 Super Puma (Civilian)</English> @@ -322,6 +367,7 @@ <Korean>H225 슈퍼 퓨마 (비무장)</Korean> <German>H225 Super Puma (Zivil)</German> <Italian>H225 Super Puma (Civile)</Italian> + <French>H225 Super Puma (Civil)</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_ec_01a_base_Name"> <English>H215 Super Puma (Transport)</English> @@ -329,6 +375,7 @@ <Korean>H215 슈퍼 퓨마 (비무장)</Korean> <German>H215 Super Puma (Transport)</German> <Italian>H215 Super Puma (Trasporto)</Italian> + <French>H215 Super Puma (Transport)</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_ec_01a_civ_base_Name"> <English>H215 Super Puma (Civilian)</English> @@ -336,6 +383,7 @@ <Korean>H215 슈퍼 퓨마 (비무장)</Korean> <German>H215 Super Puma (Zivil)</German> <Italian>H215 Super Puma (Civile)</Italian> + <French>H215 Super Puma (Civil)</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_ec_01a_military_base_Name"> <English>H215 Super Puma (Unarmed)</English> @@ -343,6 +391,7 @@ <Korean>H215 슈퍼 퓨마 (비무장)</Korean> <German>H215 Super Puma (Unbewaffnet)</German> <Italian>H215 Super Puma (Disarmato)</Italian> + <French>H215 Super Puma (non armé)</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_ec_02_base_Name"> <English>H225M Super Cougar SOCAT</English> @@ -350,6 +399,7 @@ <Korean>H225M 슈퍼 쿠거 SOCAT</Korean> <German>H225M Super Cougar SOCAT</German> <Italian>H225M Super Cougar SOCAT</Italian> + <French>H225M Super Cougar SOCAT</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_ec_02_nato_Name"> <English>H225M Super Cougar SOCAT</English> @@ -357,6 +407,7 @@ <Korean>H225M 슈퍼 쿠거 SOCAT</Korean> <German>H225M Super Cougar SOCAT</German> <Italian>H225M Super Cougar SOCAT</Italian> + <French>H225M Super Cougar SOCAT</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_ec_03_base_Name"> <English>H225M Super Cougar</English> @@ -364,6 +415,7 @@ <Korean>H225M 슈퍼 쿠거</Korean> <German>H225M Super Cougar</German> <Italian>H225M Super Cougar</Italian> + <French>H225M Super Cougar</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_ec_04_base_Name"> <English>H225 Super Puma SAR</English> @@ -371,6 +423,7 @@ <Korean>H225 슈퍼 퓨마 SAR</Korean> <German>H225 Super Puma SAR</German> <Italian>H225 Super Puma SAR</Italian> + <French>H225 Super Puma SAR</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_ec_04_military_base_Name"> <English>H225M Super Cougar (Unarmed)</English> @@ -378,6 +431,7 @@ <German>H225M Super Cougar (Unbewaffnet)</German> <Italian>H225M Super Cougar (Disarmato)</Italian> <Korean>H225M 슈퍼 쿠거 (비무장)</Korean> + <French>H225M Super Cougar (Non armé)</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_truck_01_water_Name"> <English>HEMTT Fire Truck</English> @@ -398,6 +452,7 @@ <Korean>타이푼 급수</Korean> <German>Typhoon Water</German> <Italian>Typhoon Acqua</Italian> + <French>Typhoon Water</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_pickup_01_Name"> <English>Ram 1500</English> @@ -405,6 +460,7 @@ <Korean>램 1500</Korean> <German>Ram 1500</German> <Italian>Ram 1500</Italian> + <French>Ram 1500</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_pickup_01_Fuel_Name"> <English>Ram 1500 (Fuel)</English> @@ -412,6 +468,7 @@ <Korean>램 1500 (연료)</Korean> <German>Ram 1500 (Treibstoff)</German> <Italian>Ram 1500 (Carburante)</Italian> + <French>Ram 1500 (Carburant)</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_pickup_01_service_Name"> <English>Ram 1500 (Services)</English> @@ -419,6 +476,7 @@ <Korean>램 1500 (서비스)</Korean> <German>Ram 1500 (Pannenhilfe)</German> <Italian>Ram 1500 (Servizi)</Italian> + <French>Ram 1500 (Dépannage)</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_pickup_01_repair_Name"> <English>Ram 1500 (Repair)</English> @@ -426,6 +484,7 @@ <Korean>램 1500 (정비)</Korean> <German>Ram 1500 (Instandsetzung)</German> <Italian>Ram 1500 (Riparazioni)</Italian> + <French>Ram 1500 (Réparation)</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_pickup_01_comms_Name"> <English>Ram 1500 (Comms)</English> @@ -433,6 +492,7 @@ <Korean>램 1500 (통신)</Korean> <German>Ram 1500 (Kommunikation)</German> <Italian>Ram 1500 (Comunicazioni)</Italian> + <French>Ram 1500 (Communication)</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_pickup_01_hmg_Name"> <English>Ram 1500 (HMG)</English> @@ -440,6 +500,7 @@ <Korean>램 1500 (중기관총)</Korean> <German>Ram 1500 (HMG)</German> <Italian>Ram 1500 (HMG)</Italian> + <French>Ram 1500 (HMG)</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_pickup_01_mmg_Name"> <English>Ram 1500 (MMG)</English> @@ -447,6 +508,7 @@ <Korean>램 1500 (중형기관총)</Korean> <German>Ram 1500 (MMG)</German> <Italian>Ram 1500 (MMG)</Italian> + <French>Ram 1500 (MMG)</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_pickup_01_mrl_Name"> <English>Ram 1500 (MRL)</English> @@ -454,6 +516,7 @@ <Korean>램 1500 (다연장로켓)</Korean> <German>Ram 1500 (MRL)</German> <Italian>Ram 1500 (MRL)</Italian> + <French>Ram 1500 (MRL)</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_pickup_01_aa_Name"> <English>Ram 1500 (AA)</English> @@ -461,6 +524,7 @@ <Korean>램 1500 (대공)</Korean> <German>Ram 1500 (AA)</German> <Italian>Ram 1500 (AA)</Italian> + <French>Ram 1500 (AA)</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_pickup_01_covered_Name"> <English>Ram 1500 (Covered)</English> @@ -468,6 +532,7 @@ <Korean>램 1500 (커버)</Korean> <German>Ram 1500 (Abgedeckt)</German> <Italian>Ram 1500 (Coperto)</Italian> + <French>Ram 1500 (couvert)</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_pickup_01_water_Name"> <English>Ram 1500 (Water)</English> @@ -475,6 +540,7 @@ <Korean>램 1500 (급수)</Korean> <German>Ram 1500 (Wasser)</German> <Italian>Ram 1500 (Acqua)</Italian> + <French>Ram 1500 (eau)</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_commando_Name"> <English>RSG60</English> @@ -482,6 +548,7 @@ <Korean>RSG60</Korean> <German>RSG60</German> <Italian>RSG60</Italian> + <French>RSG60</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_twinmortar_Name"> <English>AMOS Container</English> @@ -489,6 +556,7 @@ <Korean>AMOS 컨테이너</Korean> <German>AMOS Container</German> <Italian>AMOS Container</Italian> + <French>AMOS Container</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_rc40_base_Name"> <English>Drone40</English> @@ -496,6 +564,7 @@ <Korean>드론40</Korean> <German>Drone40</German> <Italian>Drone40</Italian> + <French>Drone40</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_rc40_Name"> <English>Drone40 Scout</English> @@ -503,6 +572,7 @@ <Korean>드론40 정찰</Korean> <German>Drone40 Scout</German> <Italian>Drone40 Scout</Italian> + <French>Drone40 Scout</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_rc40_he_Name"> <English>Drone40 HE</English> @@ -510,6 +580,7 @@ <Korean>드론40 고폭</Korean> <German>Drone40 HE</German> <Italian>Drone40 HE</Italian> + <French>Drone40 HE</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_rc40_white_Name"> <English>Drone40 Smoke (White)</English> @@ -517,6 +588,7 @@ <Korean>드론40 연막 (백색)</Korean> <German>Drone40 Smoke (Weiß)</German> <Italian>Drone40 Smoke (Bianco)</Italian> + <French>Drone40 Fumée (Blanc)</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_rc40_blue_Name"> <English>Drone40 Smoke (Blue)</English> @@ -524,6 +596,7 @@ <Korean>드론40 연막 (청색)</Korean> <German>Drone40 Smoke (Blau)</German> <Italian>Drone40 Smoke (Blu)</Italian> + <French>Drone40 Fumée (Bleu)</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_rc40_red_Name"> <English>Drone40 Smoke (Red)</English> @@ -531,6 +604,7 @@ <Korean>드론40 연막 (적색)</Korean> <German>Drone40 Smoke (Rot)</German> <Italian>Drone40 Smoke (Rosso)</Italian> + <French>Drone40 Fumée (Rouge)</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_rc40_green_Name"> <English>Drone40 Smoke (Green)</English> @@ -538,6 +612,7 @@ <Korean>드론40 연막 (녹색)</Korean> <German>Drone40 Smoke (Grün)</German> <Italian>Drone40 Smoke (Verde)</Italian> + <French>Drone40 Fumée (Vert)</French> </Key> <Key ID="STR_ACE_Compat_RF_RealisticNames_rc40_orange_Name"> <English>Drone40 Smoke (Orange)</English> @@ -545,6 +620,7 @@ <Korean>드론40 연막 (주황색)</Korean> <German>Drone40 Smoke (Orange)</German> <Italian>Drone40 Smoke (Arancione)</Italian> + <French>Drone40 Fumée (Orange)</French> </Key> </Package> </Project> diff --git a/addons/compat_rf/config.cpp b/addons/compat_rf/config.cpp index ab6fb942751..52ef83c1b74 100644 --- a/addons/compat_rf/config.cpp +++ b/addons/compat_rf/config.cpp @@ -9,10 +9,11 @@ class CfgPatches { requiredAddons[] = {"RF_Data_Loadorder"}; skipWhenMissingDependencies = 1; author = ECSTRING(common,ACETeam); - authors[] = {"Mike"}; + authors[] = {"Mike", "OverlordZorn[CVO]"}; url = ECSTRING(main,URL); VERSION_CONFIG; }; }; #include "CfgWeapons.hpp" +#include "CfgVehicles.hpp" diff --git a/addons/compat_rhs_afrf3/CfgVehicles.hpp b/addons/compat_rhs_afrf3/CfgVehicles.hpp index 1cf5029bc34..2ba6caf56f9 100644 --- a/addons/compat_rhs_afrf3/CfgVehicles.hpp +++ b/addons/compat_rhs_afrf3/CfgVehicles.hpp @@ -60,6 +60,8 @@ class CfgVehicles { EGVAR(vehicle_damage,turretFireProb) = 0.7; EGVAR(vehicle_damage,engineFireProb) = 0.7; EGVAR(vehicle_damage,detonationDuringFireProb) = 0.5; + + class EGVAR(interaction,anims); }; class rhs_infantry_msv_base; @@ -156,68 +158,186 @@ class CfgVehicles { EGVAR(vehicle_damage,engineFireProb) = 0.8; EGVAR(vehicle_damage,detonationDuringFireProb) = 0.8; EGVAR(vehicle_damage,canHaveFireRing) = 1; - }; + }; class rhs_btr60_base: rhs_btr_base { EGVAR(refuel,fuelCapacity) = 290; + + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class crate_l1_unhide { + positions[] = {{-1.1, 2, -0.3}}; + items[] = {"rhs_3Ya40_1_single"}; + name = "3Ya40-1 Crate"; + text = "3Ya40-1 Crate"; + }; + class crate_l2_unhide { + positions[] = {{-1.1, 1.05, -0.3}}; + items[] = {"rhs_3Ya40_1_single"}; + name = "3Ya40-1 Crate"; + text = "3Ya40-1 Crate"; + }; + class crate_l3_unhide { + positions[] = {{-1.1, -1.1, -0.3}}; + items[] = {"rhs_3Ya40_1_single"}; + name = "3Ya40-1 Crate"; + text = "3Ya40-1 Crate"; + }; + class crate_r1_unhide { + positions[] = {{1.1, 1.93, -0.3}}; + items[] = {"rhs_3Ya40_1_single"}; + name = "3Ya40-1 Crate"; + text = "3Ya40-1 Crate"; + }; + class crate_r2_unhide { + positions[] = {{1.1, 0.25, -0.3}}; + items[] = {"rhs_3Ya40_1_single"}; + name = "3Ya40-1 Crate"; + text = "3Ya40-1 Crate"; + }; + class crate_r3_unhide { + positions[] = {{1.1, -1.1, -0.3}}; + items[] = {"rhs_3Ya40_1_single"}; + name = "3Ya40-1 Crate"; + text = "3Ya40-1 Crate"; + }; + }; }; class rhs_btr70_vmf: rhs_btr_base { EGVAR(refuel,fuelCapacity) = 350; + class ace_viewports { class view_0 { camLocation[] = {0.478394, -0.575, -0.145}; camAttach = 90; - compartments[]={"Compartment1"}; - roles[]={"cargo"}; + compartments[] = {"Compartment1"}; + roles[] = {"cargo"}; }; class view_1 { camLocation[] = {-1.38184, -0.575, -0.145}; camAttach = -90; - compartments[]={"Compartment1"}; - roles[]={"cargo"}; + compartments[] = {"Compartment1"}; + roles[] = {"cargo"}; }; }; - }; + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class crate_l1_unhide { + positions[] = {{-1.7, 0.55, -0.4}}; + items[] = {"rhs_3Ya40_1_single"}; + name = "3Ya40-1 Crate"; + text = "3Ya40-1 Crate"; + }; + class crate_l2_unhide { + positions[] = {{-1.7, -0.95, -0.4}}; + items[] = {"rhs_3Ya40_1_single"}; + name = "3Ya40-1 Crate"; + text = "3Ya40-1 Crate"; + }; + class crate_l3_unhide { + positions[] = {{-1.7, -1.45, -0.4}}; + items[] = {"rhs_3Ya40_1_single"}; + name = "3Ya40-1 Crate"; + text = "3Ya40-1 Crate"; + }; + class crate_l4_unhide { + positions[] = {{-1.7, -2.7, -0.4}}; + items[] = {"rhs_3Ya40_1_single"}; + name = "3Ya40-1 Crate"; + text = "3Ya40-1 Crate"; + }; + class crate_r1_unhide { + positions[] = {{0.8, 1, -0.4}}; + items[] = {"rhs_3Ya40_1_single"}; + name = "3Ya40-1 Crate"; + text = "3Ya40-1 Crate"; + }; + class crate_r2_unhide { + positions[] = {{0.8, 0.12, -0.4}}; + items[] = {"rhs_3Ya40_1_single"}; + name = "3Ya40-1 Crate"; + text = "3Ya40-1 Crate"; + }; + class crate_r3_unhide { + positions[] = {{0.8, -0.7, -0.4}}; + items[] = {"rhs_3Ya40_1_single"}; + name = "3Ya40-1 Crate"; + text = "3Ya40-1 Crate"; + }; + class crate_r4_unhide { + positions[] = {{0.8, -1.85, -0.4}}; + items[] = {"rhs_3Ya40_1_single"}; + name = "3Ya40-1 Crate"; + text = "3Ya40-1 Crate"; + }; + }; + }; class rhs_btr70_msv: rhs_btr70_vmf {}; class rhs_btr80_msv: rhs_btr70_msv { EGVAR(refuel,fuelCapacity) = 300; + class ace_viewports { class view_0 { camLocation[] = {0.534424, -0.336914, 0.636819}; camAttach = 45; - compartments[]={"Compartment1"}; - roles[]={"cargo"}; + compartments[] = {"Compartment1"}; + roles[] = {"cargo"}; }; class view_1 { camLocation[] = {0.760254, -0.459473, 0.526328}; camAttach = 90; - compartments[]={"Compartment1"}; - roles[]={"cargo"}; + compartments[] = {"Compartment1"}; + roles[] = {"cargo"}; }; class view_2 { camLocation[] = {0.770508, -1.21924, 0.526954}; camAttach = 90; - compartments[]={"Compartment1"}; - roles[]={"cargo"}; + compartments[] = {"Compartment1"}; + roles[] = {"cargo"}; }; class view_3 { camLocation[] = {-1.13, -1.2085, 0.490339}; camAttach = -90; - compartments[]={"Compartment1"}; - roles[]={"cargo"}; + compartments[] = {"Compartment1"}; + roles[] = {"cargo"}; }; class view_4 { camLocation[] = {-1.14124, -0.416992, 0.460611}; camAttach = -90; - compartments[]={"Compartment1"}; - roles[]={"cargo"}; + compartments[] = {"Compartment1"}; + roles[] = {"cargo"}; }; class view_5 { camLocation[] = {-0.932983, -0.326172, 0.647666}; camAttach = -45; - compartments[]={"Compartment1"}; - roles[]={"cargo"}; + compartments[] = {"Compartment1"}; + roles[] = {"cargo"}; + }; + }; + + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class crate_l1_unhide: crate_l1_unhide { + positions[] = {{-1.45, 0, 0.25}}; + }; + class crate_l2_unhide: crate_l2_unhide { + positions[] = {{-1.45, -1.68, 0.15}}; + }; + class crate_l3_unhide: crate_l3_unhide { + positions[] = {{-1.45, -2.87, 0.15}}; + }; + class crate_l4_unhide: crate_l4_unhide { + enabled = 0; + }; + class crate_r1_unhide: crate_r1_unhide { + positions[] = {{1.1, 0.97, 0.15}}; + }; + class crate_r2_unhide: crate_r2_unhide { + positions[] = {{1.1, -1.5, 0.15}}; + }; + class crate_r3_unhide: crate_r3_unhide { + enabled = 0; + }; + class crate_r4_unhide: crate_r4_unhide { + enabled = 0; }; }; }; @@ -226,38 +346,56 @@ class CfgVehicles { class view_0 { camLocation[] = {0.589844, -0.314941, 0.449678}; camAttach = 45; - compartments[]={"Compartment1"}; - roles[]={"cargo"}; + compartments[] = {"Compartment1"}; + roles[] = {"cargo"}; }; class view_1 { camLocation[] = {0.809082, -0.442871, 0.276865}; camAttach = 90; - compartments[]={"Compartment1"}; - roles[]={"cargo"}; + compartments[] = {"Compartment1"}; + roles[] = {"cargo"}; }; class view_2 { camLocation[] = {0.819092, -1.24414, 0.27857}; camAttach = 90; - compartments[]={"Compartment1"}; - roles[]={"cargo"}; + compartments[] = {"Compartment1"}; + roles[] = {"cargo"}; }; class view_3 { camLocation[] = {-1.1012, -1.22461, 0.341089}; camAttach = -90; - compartments[]={"Compartment1"}; - roles[]={"cargo"}; + compartments[] = {"Compartment1"}; + roles[] = {"cargo"}; }; class view_4 { camLocation[] = {-1.11597, -0.458984, 0.307256}; camAttach = -90; - compartments[]={"Compartment1"}; - roles[]={"cargo"}; + compartments[] = {"Compartment1"}; + roles[] = {"cargo"}; }; class view_5 { camLocation[] = {-0.869995, -0.304688, 0.461181}; camAttach = -45; - compartments[]={"Compartment1"}; - roles[]={"cargo"}; + compartments[] = {"Compartment1"}; + roles[] = {"cargo"}; + }; + }; + + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class crate_l1_unhide: crate_l1_unhide { + positions[] = {{-1.45, 0, 0}}; + }; + class crate_l2_unhide: crate_l2_unhide { + positions[] = {{-1.45, -1.68, 0}}; + }; + class crate_l3_unhide: crate_l3_unhide { + positions[] = {{-1.45, -2.87, 0}}; + }; + class crate_r1_unhide: crate_l3_unhide { + positions[] = {{1.1, 0.97, 0}}; + }; + class crate_r2_unhide: crate_r2_unhide { + positions[] = {{1.1, -1.5, 0}}; }; }; }; @@ -279,11 +417,289 @@ class CfgVehicles { EGVAR(vehicle_damage,turretFireProb) = 0.5; EGVAR(vehicle_damage,engineFireProb) = 0.8; EGVAR(vehicle_damage,detonationDuringFireProb) = 0.5; + + class EGVAR(interaction,anims) { + class crate_l1_unhide { + positions[] = {{-1.45, 0.5, -0.65}}; + items[] = {"rhs_3Ya40_1_single"}; + name = "3Ya40-1 Crate"; + text = "3Ya40-1 Crate"; + }; + class crate_l2_unhide { + positions[] = {{-1.45, -0.2, -0.65}}; + items[] = {"rhs_3Ya40_1_single"}; + name = "3Ya40-1 Crate"; + text = "3Ya40-1 Crate"; + }; + class crate_l3_unhide { + positions[] = {{-1.45, -1.2, -0.65}}; + items[] = {"rhs_3Ya40_1_single"}; + name = "3Ya40-1 Crate"; + text = "3Ya40-1 Crate"; + }; + class crate_r1_unhide { + positions[] = {{1.45, 0.6, -0.65}}; + items[] = {"rhs_3Ya40_1_single"}; + name = "3Ya40-1 Crate"; + text = "3Ya40-1 Crate"; + }; + class crate_r2_unhide { + positions[] = {{1.45, -0.4, -0.65}}; + items[] = {"rhs_3Ya40_1_single"}; + name = "3Ya40-1 Crate"; + text = "3Ya40-1 Crate"; + }; + class crate_r3_unhide { + positions[] = {{1.45, -1.2, -0.65}}; + items[] = {"rhs_3Ya40_1_single"}; + name = "3Ya40-1 Crate"; + text = "3Ya40-1 Crate"; + }; + }; + }; + class rhs_bmd1_base: rhs_bmd_base {}; + class rhs_bmd1p: rhs_bmd1_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class crate_l1_unhide: crate_l1_unhide { + positions[] = {{-1.45, 0.5, -0.8}}; + }; + class crate_l2_unhide: crate_l2_unhide { + positions[] = {{-1.45, -0.2, -0.8}}; + }; + class crate_l3_unhide: crate_l3_unhide { + positions[] = {{-1.45, -1.2, -0.8}}; + }; + class crate_r1_unhide: crate_l3_unhide { + positions[] = {{1.45, 0.6, -0.8}}; + }; + class crate_r2_unhide: crate_r2_unhide { + positions[] = {{1.45, -0.4, -0.8}}; + }; + class crate_r3_unhide: crate_r3_unhide { + positions[] = {{1.45, -1.2, -0.8}}; + }; + }; }; + class rhs_bmd2_base: rhs_bmd_base {}; + class rhs_bmd2: rhs_bmd2_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class crate_l1_unhide: crate_l1_unhide { + positions[] = {{-1.45, 0.5, -0.8}}; + }; + class crate_l2_unhide: crate_l2_unhide { + positions[] = {{-1.45, -0.2, -0.8}}; + }; + class crate_l3_unhide: crate_l3_unhide { + positions[] = {{-1.45, -1.2, -0.8}}; + }; + class crate_r1_unhide: crate_l3_unhide { + positions[] = {{1.45, 0.6, -0.8}}; + }; + class crate_r2_unhide: crate_r2_unhide { + positions[] = {{1.45, -0.4, -0.8}}; + }; + class crate_r3_unhide: crate_r3_unhide { + positions[] = {{1.45, -1.2, -0.8}}; + }; + }; + }; + class rhs_bmd2m: rhs_bmd2 { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class crate_l1_unhide: crate_l1_unhide { + positions[] = {{-1.45, 0.5, -0.7}}; + }; + class crate_l2_unhide: crate_l2_unhide { + positions[] = {{-1.45, -0.2, -0.7}}; + }; + class crate_l3_unhide: crate_l3_unhide { + positions[] = {{-1.45, -1.2, -0.7}}; + }; + class crate_r1_unhide: crate_l3_unhide { + positions[] = {{1.45, 0.6, -0.7}}; + }; + class crate_r2_unhide: crate_r2_unhide { + positions[] = {{1.45, -0.4, -0.7}}; + }; + class crate_r3_unhide: crate_r3_unhide { + positions[] = {{1.45, -1.2, -0.7}}; + }; + }; + }; + class rhs_bmp1tank_base: Tank_F { EGVAR(map,vehicleLightColor)[] = {0,1,0,0.1}; EGVAR(refuel,fuelCapacity) = 460; }; + class rhs_bmp_base: rhs_bmp1tank_base { + EGVAR(vehicle_damage,hullDetonationProb) = 0; + EGVAR(vehicle_damage,turretDetonationProb) = 0.2; + EGVAR(vehicle_damage,engineDetonationProb) = 0; + EGVAR(vehicle_damage,hullFireProb) = 0.8; + EGVAR(vehicle_damage,turretFireProb) = 0.5; + EGVAR(vehicle_damage,engineFireProb) = 0.8; + EGVAR(vehicle_damage,detonationDuringFireProb) = 0.5; + + class EGVAR(interaction,anims) { + class crate_l1_unhide { + positions[] = {{-1.55, 1.1, -0.55}}; + items[] = {"rhs_3Ya40_1_single"}; + name = "3Ya40-1 Crate"; + text = "3Ya40-1 Crate"; + }; + class crate_l2_unhide { + positions[] = {{-1.55, 0.35, -0.55}}; + items[] = {"rhs_3Ya40_1_single"}; + name = "3Ya40-1 Crate"; + text = "3Ya40-1 Crate"; + }; + class crate_l3_unhide { + positions[] = {{-1.55, -0.6, -0.55}}; + items[] = {"rhs_3Ya40_1_single"}; + name = "3Ya40-1 Crate"; + text = "3Ya40-1 Crate"; + }; + class crate_r1_unhide { + positions[] = {{1.55, 1.75, -0.55}}; + items[] = {"rhs_3Ya40_1_single"}; + name = "3Ya40-1 Crate"; + text = "3Ya40-1 Crate"; + }; + class crate_r2_unhide { + positions[] = {{1.55, -0.25, -0.55}}; + items[] = {"rhs_3Ya40_1_single"}; + name = "3Ya40-1 Crate"; + text = "3Ya40-1 Crate"; + }; + class crate_r3_unhide { + positions[] = {{1.55, -1, -0.55}}; + items[] = {"rhs_3Ya40_1_single"}; + name = "3Ya40-1 Crate"; + text = "3Ya40-1 Crate"; + }; + }; + }; + class rhs_bmp1_vdv: rhs_bmp_base {}; + class rhs_bmp1d_vdv: rhs_bmp1_vdv { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class crate_r3_unhide: crate_r3_unhide { + positions[] = {{1.5, -1.2, -0.55}}; + }; + }; + }; + class rhs_prp3_vdv: rhs_bmp1_vdv { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class crate_l1_unhide: crate_l1_unhide { + enabled = 0; + }; + class crate_l2_unhide: crate_l2_unhide { + enabled = 0; + }; + class crate_l3_unhide: crate_l3_unhide { + enabled = 0; + }; + class crate_r1_unhide: crate_l3_unhide { + enabled = 0; + }; + class crate_r2_unhide: crate_r2_unhide { + enabled = 0; + }; + class crate_r3_unhide: crate_r3_unhide { + enabled = 0; + }; + }; + }; + + class rhs_bmp2e_vdv: rhs_bmp1_vdv { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class crate_l1_unhide: crate_l1_unhide { + positions[] = {{-1.8, 1.05, -0.55}}; + }; + class crate_l2_unhide: crate_l2_unhide { + positions[] = {{-1.8, 0.35, -0.55}}; + }; + class crate_l3_unhide: crate_l3_unhide { + positions[] = {{-1.8, -0.65, -0.55}}; + }; + class crate_r1_unhide: crate_l3_unhide { + positions[] = {{1.4, 1.7, -0.55}}; + }; + class crate_r2_unhide: crate_r2_unhide { + positions[] = {{1.4, -0.25, -0.55}}; + }; + class crate_r3_unhide: crate_r3_unhide { + positions[] = {{1.4, -1.05, -0.55}}; + }; + }; + }; + class rhs_bmp2_vdv: rhs_bmp2e_vdv { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class crate_l1_unhide: crate_l1_unhide { + positions[] = {{-1.8, 1.2, -0.55}}; + }; + class crate_l2_unhide: crate_l2_unhide { + positions[] = {{-1.8, 0.5, -0.55}}; + }; + class crate_l3_unhide: crate_l3_unhide { + positions[] = {{-1.8, -0.5, -0.55}}; + }; + class crate_r1_unhide: crate_l3_unhide { + positions[] = {{1.4, 1.85, -0.55}}; + }; + class crate_r2_unhide: crate_r2_unhide { + positions[] = {{1.4, -0.1, -0.55}}; + }; + class crate_r3_unhide: crate_r3_unhide { + positions[] = {{1.4, -0.9, -0.55}}; + }; + }; + }; + class rhs_bmp2e_msv: rhs_bmp2e_vdv {}; + class rhs_Ob_681_2: rhs_bmp2e_msv { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class crate_l1_unhide: crate_l1_unhide { + positions[] = {{-1.8, 1.2, -0.55}}; + }; + class crate_l2_unhide: crate_l2_unhide { + positions[] = {{-1.8, 0.5, -0.55}}; + }; + class crate_l3_unhide: crate_l3_unhide { + positions[] = {{-1.8, -0.5, -0.55}}; + }; + class crate_r1_unhide: crate_l3_unhide { + positions[] = {{1.4, 1.85, -0.55}}; + }; + class crate_r2_unhide: crate_r2_unhide { + positions[] = {{1.4, -0.1, -0.55}}; + }; + class crate_r3_unhide: crate_r3_unhide { + positions[] = {{1.4, -0.9, -0.55}}; + }; + }; + }; + + class rhs_brm1k_base: rhs_bmp2e_vdv { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class crate_l1_unhide: crate_l1_unhide { + enabled = 0; + }; + class crate_l2_unhide: crate_l2_unhide { + enabled = 0; + }; + class crate_l3_unhide: crate_l3_unhide { + enabled = 0; + }; + class crate_r1_unhide: crate_l3_unhide { + enabled = 0; + }; + class crate_r2_unhide: crate_r2_unhide { + enabled = 0; + }; + class crate_r3_unhide: crate_r3_unhide { + enabled = 0; + }; + }; + }; + class rhs_bmp3tank_base: Tank_F { EGVAR(refuel,fuelCapacity) = 460; EGVAR(vehicle_damage,hullDetonationProb) = 0.2; @@ -293,37 +709,39 @@ class CfgVehicles { EGVAR(vehicle_damage,turretFireProb) = 0.2; EGVAR(vehicle_damage,engineFireProb) = 0.8; EGVAR(vehicle_damage,detonationDuringFireProb) = 0.5; + class ace_viewports { class view_0 { camLocation[] = {1.02881, -0.923828, -0.647231}; screenLocation[] = {1.12881, -0.653828, -1.08223}; camAttach = 50; maxDistance = 0.5; - roles[]={"cargo"}; + roles[] = {"cargo"}; }; class view_1 { camLocation[] = {1.01709, -1.55664, -0.647231}; screenLocation[] = {1.10709, -1.42664, -1.14223}; camAttach = 82; maxDistance = 0.5; - roles[]={"cargo"}; + roles[] = {"cargo"}; }; class view_2 { camLocation[] = {-0.871094, -1.55762, -0.647231}; screenLocation[] = {-0.981094, -1.42762, -1.13223}; camAttach = 285; maxDistance = 0.5; - roles[]={"cargo"}; + roles[] = {"cargo"}; }; class view_3 { camLocation[] = {-1.00879, -0.939941, -0.650259}; screenLocation[] = {-0.97879, -0.689941, -1.09526}; camAttach = 310; maxDistance = 0.5; - roles[]={"cargo"}; + roles[] = {"cargo"}; }; }; }; + class rhs_a3spruttank_base: Tank_F { EGVAR(refuel,fuelCapacity) = 400; EGVAR(vehicle_damage,hullDetonationProb) = 0.2; @@ -334,6 +752,7 @@ class CfgVehicles { EGVAR(vehicle_damage,engineFireProb) = 0.8; EGVAR(vehicle_damage,detonationDuringFireProb) = 0.5; }; + class rhs_a3t72tank_base: Tank_F { EGVAR(refuel,fuelCapacity) = 1200; EGVAR(vehicle_damage,hullDetonationProb) = 0.8; @@ -344,15 +763,6 @@ class CfgVehicles { EGVAR(vehicle_damage,engineFireProb) = 0.5; EGVAR(vehicle_damage,detonationDuringFireProb) = 0.2; }; - class rhs_bmp_base: rhs_bmp1tank_base { - EGVAR(vehicle_damage,hullDetonationProb) = 0; - EGVAR(vehicle_damage,turretDetonationProb) = 0.2; - EGVAR(vehicle_damage,engineDetonationProb) = 0; - EGVAR(vehicle_damage,hullFireProb) = 0.8; - EGVAR(vehicle_damage,turretFireProb) = 0.5; - EGVAR(vehicle_damage,engineFireProb) = 0.8; - EGVAR(vehicle_damage,detonationDuringFireProb) = 0.5; - }; class rhs_t72bd_tv: rhs_a3t72tank_base { EGVAR(vehicle_damage,eraHitpoints)[] = { "era_1_hitpoint", "era_2_hitpoint", "era_3_hitpoint", "era_4_hitpoint", "era_5_hitpoint", "era_6_hitpoint", "era_7_hitpoint", diff --git a/addons/compat_rhs_afrf3/CfgWeapons.hpp b/addons/compat_rhs_afrf3/CfgWeapons.hpp index a6def44c402..a25d1f7cd05 100644 --- a/addons/compat_rhs_afrf3/CfgWeapons.hpp +++ b/addons/compat_rhs_afrf3/CfgWeapons.hpp @@ -108,19 +108,7 @@ class CfgWeapons { EGVAR(overpressure,offset) = 1.65; }; - class H_HelmetB; - class rhs_tsh4: H_HelmetB { - HEARING_PROTECTION_VICCREW; - }; - - class rhs_6b47_bare; - class rhs_6b48: rhs_6b47_bare { - HEARING_PROTECTION_VICCREW; - }; - - class rhs_zsh7a: H_HelmetB { - HEARING_PROTECTION_VICCREW; - }; + class rhs_zsh7a; class rhs_zsh7a_alt: rhs_zsh7a { ACE_Protection = 1; }; @@ -133,22 +121,6 @@ class CfgWeapons { ACE_Protection = 1; }; - class rhs_gssh18: H_HelmetB { - HEARING_PROTECTION_EARMUFF; - }; - - class rhs_6b47; - class rhs_6b47_6m2: rhs_6b47 { - HEARING_PROTECTION_PELTOR; - }; - class rhs_6b47_6m2_1: rhs_6b47 { - HEARING_PROTECTION_PELTOR; - }; - - class rhs_6m2: H_HelmetB { - HEARING_PROTECTION_PELTOR; - }; - class rhs_weap_d81; class rhs_weap_2a70: rhs_weap_d81 { // "Low pressure" 100mm cannon EGVAR(overpressure,range) = 15; diff --git a/addons/compat_rhs_afrf3/XEH_postInit.sqf b/addons/compat_rhs_afrf3/XEH_postInit.sqf index be180179a55..e740d0d8a66 100644 --- a/addons/compat_rhs_afrf3/XEH_postInit.sqf +++ b/addons/compat_rhs_afrf3/XEH_postInit.sqf @@ -1,5 +1,7 @@ #include "script_component.hpp" +if !(["ace_nametags"] call EFUNC(common,isModLoaded)) exitWith {}; + private _russianRankIcons = [ QPATHTOEF(nametags,UI\icons_russia\private_gs.paa), QPATHTOEF(nametags,UI\icons_russia\corporal_gs.paa), diff --git a/addons/compat_rhs_afrf3/XEH_preInit.sqf b/addons/compat_rhs_afrf3/XEH_preInit.sqf index b47cf6628db..2ca4338e90c 100644 --- a/addons/compat_rhs_afrf3/XEH_preInit.sqf +++ b/addons/compat_rhs_afrf3/XEH_preInit.sqf @@ -6,4 +6,12 @@ PREP_RECOMPILE_START; #include "XEH_PREP.hpp" PREP_RECOMPILE_END; +// Disable RHS' wheel replacement mechanic +if (["ace_repair"] call EFUNC(common,isModLoaded)) then { + RHS_Retread_Enabled = false; + rhs_btr70_EnableRetread = false; + rhs_TypeTirePressure = 1; + RHS_BTR_Effects_Init = true; +}; + ADDON = true; diff --git a/addons/compat_rhs_afrf3/compat_rhs_afrf3_csw/CfgVehicles.hpp b/addons/compat_rhs_afrf3/compat_rhs_afrf3_csw/CfgVehicles.hpp index 6a3bb0a083e..fb52cc6373c 100644 --- a/addons/compat_rhs_afrf3/compat_rhs_afrf3_csw/CfgVehicles.hpp +++ b/addons/compat_rhs_afrf3/compat_rhs_afrf3_csw/CfgVehicles.hpp @@ -5,7 +5,7 @@ class CfgVehicles { class StaticGrenadeLauncher; class rhs_SPG9_base: AT_01_base_F { - class ACE_CSW { + class ace_csw { enabled = 1; proxyWeapon = QGVAR(rhs_weap_SPG9); magazineLocation = "_target selectionPosition 'breach'"; @@ -18,14 +18,14 @@ class CfgVehicles { }; class rhs_SPG9M_base: rhs_SPG9_base { - class ACE_CSW: ACE_CSW { + class ace_csw: ace_csw { enabled = 1; disassembleWeapon = QGVAR(spg9m_carry); }; }; class rhs_Kornet_Base: AT_01_base_F { - class ACE_CSW { + class ace_csw { enabled = 1; proxyWeapon = QGVAR(rhs_weap_9K133_launcher); magazineLocation = "_target selectionPosition 'gun'"; @@ -38,7 +38,7 @@ class CfgVehicles { }; class rhs_Metis_Base: AT_01_base_F { - class ACE_CSW { + class ace_csw { enabled = 1; proxyWeapon = QGVAR(rhs_weap_9K115_2_launcher); magazineLocation = "_target selectionPosition 'gun'"; @@ -51,7 +51,7 @@ class CfgVehicles { }; class rhs_2b14_82mm_Base: StaticMortar { - class ACE_CSW { + class ace_csw { enabled = 1; magazineLocation = ""; proxyWeapon = QGVAR(rhs_weap_2b14); @@ -64,7 +64,7 @@ class CfgVehicles { }; class rhs_nsv_tripod_base: StaticMGWeapon { - class ACE_CSW { + class ace_csw { enabled = 1; proxyWeapon = QGVAR(rhs_weap_nsvt_effects); magazineLocation = "_target selectionPosition 'magazine'"; @@ -77,7 +77,7 @@ class CfgVehicles { }; class RHS_KORD_Base: rhs_nsv_tripod_base { - class ACE_CSW: ACE_CSW { + class ace_csw: ace_csw { enabled = 1; proxyWeapon = QGVAR(rhs_weap_KORD); disassembleWeapon = QGVAR(kord_carry); @@ -86,7 +86,7 @@ class CfgVehicles { }; class RHS_KORD_high_base: RHS_KORD_Base { - class ACE_CSW: ACE_CSW { + class ace_csw: ace_csw { enabled = 1; proxyWeapon = QGVAR(rhs_weap_KORD); disassembleWeapon = QGVAR(kord_carry); @@ -95,7 +95,7 @@ class CfgVehicles { }; class RHS_AGS30_TriPod_base: StaticGrenadeLauncher { - class ACE_CSW { + class ace_csw { enabled = 1; proxyWeapon = QGVAR(rhs_weap_AGS30); magazineLocation = "_target selectionPosition 'magazine'"; diff --git a/addons/compat_rhs_afrf3/compat_rhs_afrf3_csw/CfgWeapons.hpp b/addons/compat_rhs_afrf3/compat_rhs_afrf3_csw/CfgWeapons.hpp index 1e8f4dbdfd1..e444a2aa32f 100644 --- a/addons/compat_rhs_afrf3/compat_rhs_afrf3_csw/CfgWeapons.hpp +++ b/addons/compat_rhs_afrf3/compat_rhs_afrf3_csw/CfgWeapons.hpp @@ -14,7 +14,7 @@ class CfgWeapons { class GVAR(2b14_carry): Launcher_Base_F { dlc = "ace"; - class ACE_CSW { + class ace_csw { type = "weapon"; deployTime = 20; pickupTime = 25; @@ -40,7 +40,7 @@ class CfgWeapons { class GVAR(nsv_carry): Launcher_Base_F { dlc = "ace"; - class ACE_CSW { + class ace_csw { type = "weapon"; deployTime = 4; pickupTime = 4; @@ -64,7 +64,7 @@ class CfgWeapons { class GVAR(kord_carry): Launcher_Base_F { dlc = "ace"; - class ACE_CSW { + class ace_csw { type = "weapon"; deployTime = 4; pickupTime = 4; @@ -89,7 +89,7 @@ class CfgWeapons { class GVAR(ags30_carry): Launcher_Base_F { dlc = "ace"; - class ACE_CSW { + class ace_csw { type = "weapon"; deployTime = 4; pickupTime = 4; @@ -113,7 +113,7 @@ class CfgWeapons { class GVAR(spg9_carry): Launcher_Base_F { dlc = "ace"; - class ACE_CSW { + class ace_csw { type = "weapon"; deployTime = 4; pickupTime = 4; @@ -136,7 +136,7 @@ class CfgWeapons { }; class GVAR(spg9m_carry): GVAR(spg9_carry) { - class ACE_CSW: ACE_CSW { + class ace_csw: ace_csw { class assembleTo { EGVAR(csw,spg9Tripod) = "rhs_SPG9M_MSV"; }; @@ -147,7 +147,7 @@ class CfgWeapons { class GVAR(metis_carry): Launcher_Base_F { dlc = "ace"; - class ACE_CSW { + class ace_csw { type = "mount"; deployTime = 4; pickupTime = 4; @@ -169,7 +169,7 @@ class CfgWeapons { class GVAR(kornet_carry): Launcher_Base_F { dlc = "ace"; - class ACE_CSW { + class ace_csw { type = "mount"; deployTime = 4; pickupTime = 4; diff --git a/addons/compat_rhs_afrf3/compat_rhs_afrf3_explosives/CfgMagazines.hpp b/addons/compat_rhs_afrf3/compat_rhs_afrf3_explosives/CfgMagazines.hpp index 4f8e808bd59..4ad71e5e24c 100644 --- a/addons/compat_rhs_afrf3/compat_rhs_afrf3_explosives/CfgMagazines.hpp +++ b/addons/compat_rhs_afrf3/compat_rhs_afrf3_explosives/CfgMagazines.hpp @@ -2,7 +2,7 @@ class CfgMagazines { // ACE Explosives class ATMine_Range_Mag; class rhs_mine_tm62m_mag: ATMine_Range_Mag { - EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhs_mine_tm62m); + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhs_mine_tm62m); class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; class PressurePlate { @@ -12,7 +12,7 @@ class CfgMagazines { }; class rhs_mine_pmn2_mag: ATMine_Range_Mag { - EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhs_mine_pmn2); + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhs_mine_pmn2); class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; class PressurePlate { @@ -22,7 +22,7 @@ class CfgMagazines { }; class rhs_mag_mine_ptm1: ATMine_Range_Mag { - EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhs_mine_ptm1); + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhs_mine_ptm1); class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; class PressurePlate { @@ -32,7 +32,7 @@ class CfgMagazines { }; class rhs_mag_mine_pfm1: ATMine_Range_Mag { - EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhs_mine_pfm1); + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhs_mine_pfm1); class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; class PressurePlate { @@ -42,8 +42,7 @@ class CfgMagazines { }; class rhs_ec75_mag: ATMine_Range_Mag { - EGVAR(explosives,DelayTime) = 1; - EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhs_ec75); + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhs_ec75); useAction = 0; class ACE_Triggers { SupportedTriggers[] = {"Timer", "Command", "MK16_Transmitter", "DeadmanSwitch"}; @@ -59,27 +58,27 @@ class CfgMagazines { }; class rhs_ec75_sand_mag: rhs_ec75_mag { - EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhs_ec75_sand); + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhs_ec75_sand); }; class rhs_ec200_mag: rhs_ec75_mag { - EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhs_ec200); + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhs_ec200); }; class rhs_ec200_sand_mag: rhs_ec200_mag { - EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhs_ec200_sand); + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhs_ec200_sand); }; class rhs_ec400_mag: rhs_ec75_mag { - EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhs_ec400); + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhs_ec400); }; class rhs_ec400_sand_mag: rhs_ec400_mag { - EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhs_ec400_sand); + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhs_ec400_sand); }; class rhs_mine_msk40p_white_mag: ATMine_Range_Mag { - EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhs_mine_msk40p_white); + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhs_mine_msk40p_white); class ACE_Triggers { SupportedTriggers[] = {"Tripwire"}; class Tripwire { @@ -89,19 +88,19 @@ class CfgMagazines { }; class rhs_mine_msk40p_red_mag: rhs_mine_msk40p_white_mag { - EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhs_mine_msk40p_red); + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhs_mine_msk40p_red); }; class rhs_mine_msk40p_green_mag: rhs_mine_msk40p_white_mag { - EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhs_mine_msk40p_green); + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhs_mine_msk40p_green); }; class rhs_mine_msk40p_blue_mag: rhs_mine_msk40p_white_mag { - EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhs_mine_msk40p_blue); + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhs_mine_msk40p_blue); }; class rhs_mine_sm320_white_mag: rhs_mine_msk40p_white_mag { - EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhs_mine_sm320_white); + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhs_mine_sm320_white); class ACE_Triggers { SupportedTriggers[] = {"Tripwire"}; class Tripwire { @@ -111,15 +110,15 @@ class CfgMagazines { }; class rhs_mine_sm320_red_mag: rhs_mine_sm320_white_mag { - EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhs_mine_sm320_red); + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhs_mine_sm320_red); }; class rhs_mine_sm320_green_mag: rhs_mine_sm320_white_mag { - EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhs_mine_sm320_green); + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhs_mine_sm320_green); }; class rhs_mine_ozm72_a_mag: ATMine_Range_Mag { - EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhs_mine_ozm72_a); + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhs_mine_ozm72_a); class ACE_Triggers { SupportedTriggers[] = {"Tripwire"}; class Tripwire { @@ -129,12 +128,11 @@ class CfgMagazines { }; class rhs_mine_ozm72_b_mag: rhs_mine_ozm72_a_mag { - EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhs_mine_ozm72_b); + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhs_mine_ozm72_b); }; class rhs_mine_ozm72_c_mag: rhs_mine_ozm72_a_mag { - EGVAR(explosives,DelayTime) = 1; - EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhs_mine_ozm72_c); + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhs_mine_ozm72_c); useAction = 0; class ACE_Triggers { SupportedTriggers[] = {"Command", "MK16_Transmitter"}; diff --git a/addons/compat_rhs_afrf3/compat_rhs_afrf3_hearing/CfgWeapons.hpp b/addons/compat_rhs_afrf3/compat_rhs_afrf3_hearing/CfgWeapons.hpp new file mode 100644 index 00000000000..04edf4d754f --- /dev/null +++ b/addons/compat_rhs_afrf3/compat_rhs_afrf3_hearing/CfgWeapons.hpp @@ -0,0 +1,28 @@ +class CfgWeapons { + class H_HelmetB; + class rhs_tsh4: H_HelmetB { + HEARING_PROTECTION_VICCREW; + }; + class rhs_zsh7a: H_HelmetB { + HEARING_PROTECTION_VICCREW; + }; + class rhs_gssh18: H_HelmetB { + HEARING_PROTECTION_EARMUFF; + }; + class rhs_6m2: H_HelmetB { + HEARING_PROTECTION_PELTOR; + }; + + class rhs_6b47; + class rhs_6b47_6m2: rhs_6b47 { + HEARING_PROTECTION_PELTOR; + }; + class rhs_6b47_6m2_1: rhs_6b47 { + HEARING_PROTECTION_PELTOR; + }; + + class rhs_6b47_bare; + class rhs_6b48: rhs_6b47_bare { + HEARING_PROTECTION_VICCREW; + }; +}; diff --git a/addons/compat_rhs_afrf3/compat_rhs_afrf3_hearing/config.cpp b/addons/compat_rhs_afrf3/compat_rhs_afrf3_hearing/config.cpp new file mode 100644 index 00000000000..4a8056bf0c3 --- /dev/null +++ b/addons/compat_rhs_afrf3/compat_rhs_afrf3_hearing/config.cpp @@ -0,0 +1,19 @@ +#include "script_component.hpp" +#include "\z\ace\addons\hearing\script_macros_hearingProtection.hpp" + +class CfgPatches { + class SUBADDON { + addonRootClass = QUOTE(COMPONENT); + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { + "rhs_main_loadorder", + "ace_hearing" + }; + skipWhenMissingDependencies = 1; + VERSION_CONFIG; + }; +}; + +#include "CfgWeapons.hpp" diff --git a/addons/compat_rhs_afrf3/compat_rhs_afrf3_hearing/script_component.hpp b/addons/compat_rhs_afrf3/compat_rhs_afrf3_hearing/script_component.hpp new file mode 100644 index 00000000000..8edb825af34 --- /dev/null +++ b/addons/compat_rhs_afrf3/compat_rhs_afrf3_hearing/script_component.hpp @@ -0,0 +1,3 @@ +#define SUBCOMPONENT hearing +#define SUBCOMPONENT_BEAUTIFIED Hearing +#include "..\script_component.hpp" diff --git a/addons/compat_rhs_afrf3/compat_rhs_afrf3_repair/CfgVehicles.hpp b/addons/compat_rhs_afrf3/compat_rhs_afrf3_repair/CfgVehicles.hpp new file mode 100644 index 00000000000..48da0552b85 --- /dev/null +++ b/addons/compat_rhs_afrf3/compat_rhs_afrf3_repair/CfgVehicles.hpp @@ -0,0 +1,145 @@ +class CfgVehicles { + class Wheeled_APC_F; + class rhs_btr_base: Wheeled_APC_F { + class EGVAR(interaction,anims) { + class wheel_1_unhide { + positions[] = {{-0.8, -1.7, 0}}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + class wheel_2_unhide { + positions[] = {{0.35, -2.9, -0.1}}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + class rhs_btr70_vmf: rhs_btr_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class wheel_1_unhide: wheel_1_unhide { + positions[] = {{-1.2, -2.6, 0.2}}; + }; + class wheel_2_unhide: wheel_2_unhide { + positions[] = {{-0.3, -3.8, 0}}; + }; + }; + }; + + class rhs_btr70_msv: rhs_btr70_vmf {}; + class rhs_btr80_msv: rhs_btr70_msv { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class wheel_1_unhide: wheel_1_unhide { + positions[] = {{-1, -2.5, 0.6}}; + }; + class wheel_2_unhide: wheel_2_unhide { + enabled = 0; + }; + }; + }; + + class Truck_F; + class rhs_truck: Truck_F { + class EGVAR(interaction,anims) { + class spare_hide { + positions[] = {"_target selectionPosition ['spare', 'ViewGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + class rhs_gaz66_vmf: rhs_truck {}; + class rhs_gaz66_ammo_base: rhs_gaz66_vmf { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class spare_hide: spare_hide { + positions[] = {"_target selectionPosition ['spare', 'FireGeometry', 'AveragePoint']"}; + }; + }; + }; + class rhs_gaz66_repair_base: rhs_gaz66_vmf { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class spare_hide: spare_hide { + positions[] = {"_target selectionPosition ['spare', 'FireGeometry', 'AveragePoint']"}; + }; + }; + }; + class rhs_gaz66_ap2_base: rhs_gaz66_vmf { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class spare_hide: spare_hide { + positions[] = {"_target selectionPosition ['spare', 'FireGeometry', 'AveragePoint']"}; + }; + }; + }; + + class RHS_Ural_BaseTurret: Truck_F { + class EGVAR(interaction,anims) { + class spare_hide { + positions[] = {"_target selectionPosition ['spare', 'ViewGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + + class rhs_zil131_base: Truck_F { + class EGVAR(interaction,anims) { + class spare_hide { + positions[] = {"_target selectionPosition ['spare', 'ViewGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + + class rhs_kraz255_base; + class rhs_kraz255b1_base: rhs_kraz255_base { + class EGVAR(interaction,anims) { + class spare_hide { + positions[] = {"_target selectionPosition ['spare', 'FireGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + + class O_Truck_02_covered_F; + class rhs_kamaz5350: O_Truck_02_covered_F { + class EGVAR(interaction,anims) { + class spare_hide { + positions[] = {"_target selectionPosition ['spare', 'FireGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + + class MRAP_02_base_F; + class rhs_tigr_base: MRAP_02_base_F { + class EGVAR(interaction,anims) { + class spare_hide { + positions[] = {"_target selectionPosition ['spare', 'ViewGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + + class Offroad_01_base_f; + class RHS_UAZ_Base: Offroad_01_base_f { + class EGVAR(interaction,anims) { + class spare_hide { + positions[] = {"_target selectionPosition ['spare', 'ViewGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; +}; diff --git a/addons/compat_rhs_afrf3/compat_rhs_afrf3_repair/config.cpp b/addons/compat_rhs_afrf3/compat_rhs_afrf3_repair/config.cpp new file mode 100644 index 00000000000..d6d4fab1077 --- /dev/null +++ b/addons/compat_rhs_afrf3/compat_rhs_afrf3_repair/config.cpp @@ -0,0 +1,21 @@ +#include "script_component.hpp" + +class CfgPatches { + class SUBADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { + "rhs_main_loadorder", + "ace_repair" + }; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {"Dystopian", "johnb43"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + }; +}; + +#include "CfgVehicles.hpp" diff --git a/addons/compat_rhs_afrf3/compat_rhs_afrf3_repair/script_component.hpp b/addons/compat_rhs_afrf3/compat_rhs_afrf3_repair/script_component.hpp new file mode 100644 index 00000000000..1af928486c3 --- /dev/null +++ b/addons/compat_rhs_afrf3/compat_rhs_afrf3_repair/script_component.hpp @@ -0,0 +1,3 @@ +#define SUBCOMPONENT repair +#define SUBCOMPONENT_BEAUTIFIED Repair +#include "..\script_component.hpp" diff --git a/addons/compat_rhs_afrf3/config.cpp b/addons/compat_rhs_afrf3/config.cpp index 44fcd30fcbe..8bf56684858 100644 --- a/addons/compat_rhs_afrf3/config.cpp +++ b/addons/compat_rhs_afrf3/config.cpp @@ -1,5 +1,4 @@ #include "script_component.hpp" -#include "\z\ace\addons\hearing\script_macros_hearingProtection.hpp" class CfgPatches { class ADDON { @@ -7,7 +6,7 @@ class CfgPatches { units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"rhs_main_loadorder"}; + requiredAddons[] = {"ace_common", "rhs_main_loadorder"}; author = ECSTRING(common,ACETeam); authors[] = {"Ruthberg", "GitHawk", "BaerMitUmlaut", "commy2", "Skengman2"}; url = ECSTRING(main,URL); diff --git a/addons/compat_rhs_gref3/compat_rhs_gref3_csw/CfgVehicles.hpp b/addons/compat_rhs_gref3/compat_rhs_gref3_csw/CfgVehicles.hpp index 7e58387dabc..1a15fc03f40 100644 --- a/addons/compat_rhs_gref3/compat_rhs_gref3_csw/CfgVehicles.hpp +++ b/addons/compat_rhs_gref3/compat_rhs_gref3_csw/CfgVehicles.hpp @@ -1,7 +1,7 @@ class CfgVehicles { class StaticMGWeapon; class rhs_DSHKM_base: StaticMGWeapon { - class ACE_CSW { + class ace_csw { enabled = 1; proxyWeapon = QGVAR(rhs_weap_DSHKM); magazineLocation = "_target selectionPosition 'otocvez'"; @@ -13,7 +13,7 @@ class CfgVehicles { }; }; class rhs_DSHkM_Mini_TriPod_base: rhs_DSHKM_base { - class ACE_CSW: ACE_CSW { + class ace_csw: ace_csw { enabled = 1; disassembleTurret = QEGVAR(csw,kordTripodLow); }; diff --git a/addons/compat_rhs_gref3/compat_rhs_gref3_csw/CfgWeapons.hpp b/addons/compat_rhs_gref3/compat_rhs_gref3_csw/CfgWeapons.hpp index 15ff9488cad..279ec98eaa4 100644 --- a/addons/compat_rhs_gref3/compat_rhs_gref3_csw/CfgWeapons.hpp +++ b/addons/compat_rhs_gref3/compat_rhs_gref3_csw/CfgWeapons.hpp @@ -7,7 +7,7 @@ class CfgWeapons { }; class GVAR(dshkm_carry): Launcher_Base_F { - class ACE_CSW { + class ace_csw { type = "weapon"; deployTime = 4; pickupTime = 4; diff --git a/addons/compat_rhs_gref3/compat_rhs_gref3_explosives/CfgAmmo.hpp b/addons/compat_rhs_gref3/compat_rhs_gref3_explosives/CfgAmmo.hpp index 0808c7ff1d2..458969b7c0b 100644 --- a/addons/compat_rhs_gref3/compat_rhs_gref3_explosives/CfgAmmo.hpp +++ b/addons/compat_rhs_gref3/compat_rhs_gref3_explosives/CfgAmmo.hpp @@ -1,83 +1,83 @@ class CfgAmmo { class APERSMine_Range_Ammo; class rhs_mine_a200_bz_ammo: APERSMine_Range_Ammo { - ace_explosives_defuseObjectPosition[] = {0, 0, 0.035}; + EGVAR(explosives,defuseObjectPosition)[] = {0, 0, 0.035}; }; class rhs_mine_a200_dz35_ammo: rhs_mine_a200_bz_ammo { - ace_explosives_defuseObjectPosition[] = {0, 0, 0.02}; + EGVAR(explosives,defuseObjectPosition)[] = {0, 0, 0.02}; }; class rhs_mine_glasmine43_hz_ammo: APERSMine_Range_Ammo { - ace_explosives_defuseObjectPosition[] = {0, 0, 0.015}; + EGVAR(explosives,defuseObjectPosition)[] = {0, 0, 0.015}; }; class rhs_mine_glasmine43_bz_ammo: rhs_mine_glasmine43_hz_ammo { - ace_minedetector_detectable = 0; + EGVAR(minedetector,detectable) = 0; }; class rhs_mine_bounding_trigger_base; class rhs_mine_m2a3b_press_ammo: rhs_mine_bounding_trigger_base { - ace_explosives_defuseObjectPosition[] = {0, 0.046, 0.02}; + EGVAR(explosives,defuseObjectPosition)[] = {0, 0.046, 0.02}; }; class rhs_mine_m2a3b_trip_ammo: rhs_mine_m2a3b_press_ammo { - ace_explosives_defuseObjectPosition[] = {0, 0.046, 0.055}; + EGVAR(explosives,defuseObjectPosition)[] = {0, 0.046, 0.055}; }; class rhs_mine_M3_pressure_ammo: APERSMine_Range_Ammo { - ace_explosives_defuseObjectPosition[] = {0, 0, 0.015}; + EGVAR(explosives,defuseObjectPosition)[] = {0, 0, 0.015}; }; class rhs_mine_M3_tripwire_ammo: rhs_mine_M3_pressure_ammo { - ace_explosives_defuseObjectPosition[] = {0, 0, 0.055}; + EGVAR(explosives,defuseObjectPosition)[] = {0, 0, 0.055}; }; class ATMine_Range_Ammo; class rhs_mine_TM43_ammo: ATMine_Range_Ammo { - ace_explosives_defuseObjectPosition[] = {0, 0, 0.072}; + EGVAR(explosives,defuseObjectPosition)[] = {0, 0, 0.072}; }; class rhs_mine_M7A2_ammo: APERSMine_Range_Ammo { - ace_explosives_defuseObjectPosition[] = {0, 0, 0.067}; + EGVAR(explosives,defuseObjectPosition)[] = {0, 0, 0.067}; }; class rhs_mine_Mk2_pressure_ammo: APERSMine_Range_Ammo { - ace_explosives_defuseObjectPosition[] = {0, 0, 0.02}; + EGVAR(explosives,defuseObjectPosition)[] = {0, 0, 0.02}; }; class rhs_mine_Mk2_tripwire_ammo: rhs_mine_Mk2_pressure_ammo { - ace_explosives_defuseObjectPosition[] = {0, 0, 0.055}; + EGVAR(explosives,defuseObjectPosition)[] = {0, 0, 0.055}; }; class APERSBoundingMine_Range_Ammo; class rhs_mine_smine35_press_ammo: APERSBoundingMine_Range_Ammo { - ace_explosives_defuseObjectPosition[] = {0, 0, 0.03}; + EGVAR(explosives,defuseObjectPosition)[] = {0, 0, 0.03}; }; class rhs_mine_smine35_trip_ammo: rhs_mine_bounding_trigger_base { - ace_explosives_defuseObjectPosition[] = {0, 0, 0.04}; + EGVAR(explosives,defuseObjectPosition)[] = {0, 0, 0.04}; }; class rhs_mine_smine44_trip_ammo: rhs_mine_smine35_trip_ammo { - ace_explosives_defuseObjectPosition[] = {-0.03, 0, 0.015}; + EGVAR(explosives,defuseObjectPosition)[] = {-0.03, 0, 0.015}; }; class rhs_mine_smine44_press_ammo: APERSBoundingMine_Range_Ammo { - ace_explosives_defuseObjectPosition[] = {-0.02, 0, 0.02}; + EGVAR(explosives,defuseObjectPosition)[] = {-0.02, 0, 0.02}; }; class APERSTripMine_Wire_Ammo; class rhs_mine_stockmine43_2m_ammo: APERSTripMine_Wire_Ammo { - ace_explosives_defuseObjectPosition[] = {-1, 0, 0.25}; + EGVAR(explosives,defuseObjectPosition)[] = {-1, 0, 0.25}; }; class rhs_mine_stockmine43_4m_ammo: rhs_mine_stockmine43_2m_ammo { - ace_explosives_defuseObjectPosition[] = {-2, 0, 0.25}; + EGVAR(explosives,defuseObjectPosition)[] = {-2, 0, 0.25}; }; class DemoCharge_Remote_Ammo; class rhs_charge_M2tet_x2_ammo: DemoCharge_Remote_Ammo { - ace_explosives_defuseObjectPosition[] = {0.095, 0, 0.055}; + EGVAR(explosives,defuseObjectPosition)[] = {0.095, 0, 0.055}; }; }; diff --git a/addons/compat_rhs_gref3/compat_rhs_gref3_explosives/CfgMagazines.hpp b/addons/compat_rhs_gref3/compat_rhs_gref3_explosives/CfgMagazines.hpp index ce882e18258..d25a27bebd8 100644 --- a/addons/compat_rhs_gref3/compat_rhs_gref3_explosives/CfgMagazines.hpp +++ b/addons/compat_rhs_gref3/compat_rhs_gref3_explosives/CfgMagazines.hpp @@ -1,7 +1,7 @@ class CfgMagazines { class APERSMine_Range_Mag; class rhs_mine_a200_bz_mag: APERSMine_Range_Mag { - ace_explosives_SetupObject = "ACE_Explosives_Place_rhs_mine_a200_bz"; + EGVAR(explosives,setupObject) = "ACE_Explosives_Place_rhs_mine_a200_bz"; class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; class PressurePlate { @@ -11,7 +11,7 @@ class CfgMagazines { }; class rhs_mine_a200_dz35_mag: rhs_mine_a200_bz_mag { - ace_explosives_SetupObject = "ACE_Explosives_Place_rhs_mine_a200_dz35"; + EGVAR(explosives,setupObject) = "ACE_Explosives_Place_rhs_mine_a200_dz35"; class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; class PressurePlate { @@ -21,7 +21,7 @@ class CfgMagazines { }; class rhs_mine_glasmine43_hz_mag: APERSMine_Range_Mag { - ace_explosives_SetupObject = "ACE_Explosives_Place_rhs_mine_glasmine43_hz"; + EGVAR(explosives,setupObject) = "ACE_Explosives_Place_rhs_mine_glasmine43_hz"; class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; class PressurePlate { @@ -31,12 +31,12 @@ class CfgMagazines { }; class rhs_mine_glasmine43_bz_mag: rhs_mine_glasmine43_hz_mag { - ace_explosives_SetupObject = "ACE_Explosives_Place_rhs_mine_glasmine43_bz"; + EGVAR(explosives,setupObject) = "ACE_Explosives_Place_rhs_mine_glasmine43_bz"; }; class APERSBoundingMine_Range_Mag; class rhs_mine_m2a3b_press_mag: APERSBoundingMine_Range_Mag { - ace_explosives_SetupObject = "ACE_Explosives_Place_rhs_mine_m2a3b_press"; + EGVAR(explosives,setupObject) = "ACE_Explosives_Place_rhs_mine_m2a3b_press"; class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; class PressurePlate { @@ -46,7 +46,7 @@ class CfgMagazines { }; class rhs_mine_m2a3b_trip_mag: rhs_mine_m2a3b_press_mag { - ace_explosives_SetupObject = "ACE_Explosives_Place_rhs_mine_m2a3b_trip"; + EGVAR(explosives,setupObject) = "ACE_Explosives_Place_rhs_mine_m2a3b_trip"; class ACE_Triggers { SupportedTriggers[] = {"Tripwire"}; class Tripwire { @@ -56,7 +56,7 @@ class CfgMagazines { }; class rhs_mine_m3_pressure_mag: APERSMine_Range_Mag { - ace_explosives_SetupObject = "ACE_Explosives_Place_rhs_mine_m3_pressure"; + EGVAR(explosives,setupObject) = "ACE_Explosives_Place_rhs_mine_m3_pressure"; class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; class PressurePlate { @@ -67,7 +67,7 @@ class CfgMagazines { class APERSTripMine_Wire_Mag; class rhs_mine_M3_tripwire_mag: APERSTripMine_Wire_Mag { - ace_explosives_SetupObject = "ACE_Explosives_Place_rhs_mine_M3_tripwire"; + EGVAR(explosives,setupObject) = "ACE_Explosives_Place_rhs_mine_M3_tripwire"; class ACE_Triggers { SupportedTriggers[] = {"Tripwire"}; class Tripwire { @@ -78,7 +78,7 @@ class CfgMagazines { class ATMine_Range_Mag; class rhs_mine_TM43_mag: ATMine_Range_Mag { - ace_explosives_SetupObject = "ACE_Explosives_Place_rhs_mine_TM43"; + EGVAR(explosives,setupObject) = "ACE_Explosives_Place_rhs_mine_TM43"; class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; class PressurePlate { @@ -88,7 +88,7 @@ class CfgMagazines { }; class rhs_mine_M7A2_mag: APERSMine_Range_Mag { - ace_explosives_SetupObject = "ACE_Explosives_Place_rhs_mine_M7A2"; + EGVAR(explosives,setupObject) = "ACE_Explosives_Place_rhs_mine_M7A2"; class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; class PressurePlate { @@ -98,7 +98,7 @@ class CfgMagazines { }; class rhs_mine_mk2_pressure_mag: APERSMine_Range_Mag { - ace_explosives_SetupObject = "ACE_Explosives_Place_rhs_mine_mk2_pressure"; + EGVAR(explosives,setupObject) = "ACE_Explosives_Place_rhs_mine_mk2_pressure"; class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; class PressurePlate { @@ -108,7 +108,7 @@ class CfgMagazines { }; class rhs_mine_Mk2_tripwire_mag: APERSTripMine_Wire_Mag { - ace_explosives_SetupObject = "ACE_Explosives_Place_rhs_mine_Mk2_tripwire"; + EGVAR(explosives,setupObject) = "ACE_Explosives_Place_rhs_mine_Mk2_tripwire"; class ACE_Triggers { SupportedTriggers[] = {"Tripwire"}; class Tripwire { @@ -118,7 +118,7 @@ class CfgMagazines { }; class rhs_mine_smine35_press_mag: APERSBoundingMine_Range_Mag { - ace_explosives_SetupObject = "ACE_Explosives_Place_rhs_mine_smine35_press"; + EGVAR(explosives,setupObject) = "ACE_Explosives_Place_rhs_mine_smine35_press"; class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; class PressurePlate { @@ -128,7 +128,7 @@ class CfgMagazines { }; class rhs_mine_smine35_trip_mag: rhs_mine_smine35_press_mag { - ace_explosives_SetupObject = "ACE_Explosives_Place_rhs_mine_smine35_trip"; + EGVAR(explosives,setupObject) = "ACE_Explosives_Place_rhs_mine_smine35_trip"; class ACE_Triggers { SupportedTriggers[] = {"Tripwire"}; class Tripwire { @@ -138,7 +138,7 @@ class CfgMagazines { }; class rhs_mine_smine44_trip_mag: APERSBoundingMine_Range_Mag { - ace_explosives_SetupObject = "ACE_Explosives_Place_rhs_mine_smine44_trip"; + EGVAR(explosives,setupObject) = "ACE_Explosives_Place_rhs_mine_smine44_trip"; class ACE_Triggers { SupportedTriggers[] = {"Tripwire"}; class Tripwire { @@ -148,7 +148,7 @@ class CfgMagazines { }; class rhs_mine_smine44_press_mag: rhs_mine_smine44_trip_mag { - ace_explosives_SetupObject = "ACE_Explosives_Place_rhs_mine_smine44_press"; + EGVAR(explosives,setupObject) = "ACE_Explosives_Place_rhs_mine_smine44_press"; class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; class PressurePlate { @@ -158,7 +158,7 @@ class CfgMagazines { }; class rhs_mine_stockmine43_2m_mag: APERSTripMine_Wire_Mag { - ace_explosives_SetupObject = "ACE_Explosives_Place_rhs_mine_stockmine43_2m"; + EGVAR(explosives,setupObject) = "ACE_Explosives_Place_rhs_mine_stockmine43_2m"; class ACE_Triggers { SupportedTriggers[] = {"Tripwire"}; class Tripwire { @@ -168,7 +168,7 @@ class CfgMagazines { }; class rhs_mine_stockmine43_4m_mag: rhs_mine_stockmine43_2m_mag { - ace_explosives_SetupObject = "ACE_Explosives_Place_rhs_mine_stockmine43_4m"; + EGVAR(explosives,setupObject) = "ACE_Explosives_Place_rhs_mine_stockmine43_4m"; class ACE_Triggers { SupportedTriggers[] = {"Tripwire"}; class Tripwire { @@ -179,7 +179,7 @@ class CfgMagazines { class DemoCharge_Remote_Mag; class rhs_charge_M2tet_x2_mag: DemoCharge_Remote_Mag { - ace_explosives_SetupObject = "ACE_Explosives_Place_rhs_charge_M2tet_x2"; + EGVAR(explosives,setupObject) = "ACE_Explosives_Place_rhs_charge_M2tet_x2"; class ACE_Triggers { SupportedTriggers[] = {"Timer", "Command", "MK16_Transmitter", "DeadmanSwitch"}; class Timer { diff --git a/addons/compat_rhs_gref3/config.cpp b/addons/compat_rhs_gref3/config.cpp index f2e7aeacde3..84717435bed 100644 --- a/addons/compat_rhs_gref3/config.cpp +++ b/addons/compat_rhs_gref3/config.cpp @@ -6,7 +6,7 @@ class CfgPatches { units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"rhsgref_main_loadorder"}; + requiredAddons[] = {"ace_common", "rhsgref_main_loadorder"}; skipWhenMissingDependencies = 1; author = ECSTRING(common,ACETeam); authors[] = {"PabstMirror", "Ruthberg", "Anton"}; diff --git a/addons/compat_rhs_saf3/compat_rhs_saf3_explosives/CfgMagazines.hpp b/addons/compat_rhs_saf3/compat_rhs_saf3_explosives/CfgMagazines.hpp index c004f584467..e7c00c95d2b 100644 --- a/addons/compat_rhs_saf3/compat_rhs_saf3_explosives/CfgMagazines.hpp +++ b/addons/compat_rhs_saf3/compat_rhs_saf3_explosives/CfgMagazines.hpp @@ -3,22 +3,22 @@ class CfgMagazines { // ACE Explosives class ATMine_Range_Mag; class rhssaf_mine_mrud_a_mag: ATMine_Range_Mag { - EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhssaf_mine_mrud_a); + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhssaf_mine_mrud_a); class ACE_Triggers { SupportedTriggers[] = {"Tripwire"}; }; }; class rhssaf_mine_mrud_b_mag: rhssaf_mine_mrud_a_mag { - EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhssaf_mine_mrud_b); + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhssaf_mine_mrud_b); }; class rhssaf_mine_mrud_c_mag: rhssaf_mine_mrud_a_mag { - EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhssaf_mine_mrud_c); + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhssaf_mine_mrud_c); }; class rhssaf_mine_mrud_d_mag: rhssaf_mine_mrud_a_mag { - EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhssaf_mine_mrud_d); + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhssaf_mine_mrud_d); class ACE_Triggers { SupportedTriggers[] = {"Command", "MK16_Transmitter"}; class Command { @@ -29,7 +29,7 @@ class CfgMagazines { }; class rhssaf_mine_pma3_mag: ATMine_Range_Mag { - EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhssaf_mine_pma3); + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhssaf_mine_pma3); class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; class PressurePlate { @@ -39,7 +39,7 @@ class CfgMagazines { }; class rhssaf_mine_tma4_mag: ATMine_Range_Mag { - EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhssaf_mine_tma4); + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhssaf_mine_tma4); class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; class PressurePlate { @@ -51,9 +51,8 @@ class CfgMagazines { class CA_Magazine; class rhssaf_tm100_mag: CA_Magazine { useAction = 0; - EGVAR(explosives,DelayTime) = 1; - EGVAR(explosives,Placeable) = 1; - EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhssaf_tm100); + EGVAR(explosives,placeable) = 1; + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhssaf_tm100); class ACE_Triggers { SupportedTriggers[] = {"Timer", "Command", "MK16_Transmitter"}; class Timer { @@ -67,10 +66,10 @@ class CfgMagazines { }; class rhssaf_tm200_mag: rhssaf_tm100_mag { - EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhssaf_tm200); + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhssaf_tm200); }; class rhssaf_tm500_mag: rhssaf_tm100_mag { - EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhssaf_tm500); + EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhssaf_tm500); }; }; diff --git a/addons/compat_rhs_saf3/config.cpp b/addons/compat_rhs_saf3/config.cpp index 75ee4f55307..71340640ce3 100644 --- a/addons/compat_rhs_saf3/config.cpp +++ b/addons/compat_rhs_saf3/config.cpp @@ -6,7 +6,7 @@ class CfgPatches { units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"rhssaf_main_loadorder"}; + requiredAddons[] = {"ace_common", "rhssaf_main_loadorder"}; skipWhenMissingDependencies = 1; author = ECSTRING(common,ACETeam); authors[] = {}; diff --git a/addons/compat_rhs_usf3/CfgVehicles.hpp b/addons/compat_rhs_usf3/CfgVehicles.hpp index 0593c5a868a..3933e543ecf 100644 --- a/addons/compat_rhs_usf3/CfgVehicles.hpp +++ b/addons/compat_rhs_usf3/CfgVehicles.hpp @@ -43,8 +43,7 @@ class CfgVehicles { EGVAR(refuel,fuelCapacity) = 302; }; - class Truck_F; - class Truck_01_base_F: Truck_F {}; + class Truck_01_base_F; class rhsusf_fmtv_base: Truck_01_base_F { EGVAR(refuel,fuelCapacity) = 219; }; @@ -55,8 +54,7 @@ class CfgVehicles { EGVAR(refuel,fuelCargo) = 900; // 45 jerrycans }; - class rhsusf_HEMTT_A4_base: Truck_01_base_F {}; - class rhsusf_M977A4_usarmy_wd: rhsusf_HEMTT_A4_base {}; + class rhsusf_M977A4_usarmy_wd; class rhsusf_M977A4_AMMO_usarmy_wd: rhsusf_M977A4_usarmy_wd { EGVAR(rearm,defaultSupply) = 1200; }; diff --git a/addons/compat_rhs_usf3/CfgWeapons.hpp b/addons/compat_rhs_usf3/CfgWeapons.hpp index 46ac7e56ba3..50b09c760f9 100644 --- a/addons/compat_rhs_usf3/CfgWeapons.hpp +++ b/addons/compat_rhs_usf3/CfgWeapons.hpp @@ -206,170 +206,7 @@ class CfgWeapons { EGVAR(overpressure,offset) = 0.9; }; - // Fast Helmets - class rhsusf_opscore_01; - class rhsusf_opscore_ut_pelt_nsw: rhsusf_opscore_01 { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_aor1_pelt: rhsusf_opscore_01 { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_aor1_pelt_nsw: rhsusf_opscore_01 { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_bk_pelt: rhsusf_opscore_01 { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_fg_pelt: rhsusf_opscore_01 { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_fg_pelt_nsw: rhsusf_opscore_01 { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_fg_pelt_cam: rhsusf_opscore_01 { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_paint_pelt: rhsusf_opscore_01 { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_paint_pelt_nsw: rhsusf_opscore_01 { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_paint_pelt_nsw_cam: rhsusf_opscore_01 { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_aor2_pelt: rhsusf_opscore_01 { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_aor2_pelt_nsw: rhsusf_opscore_01 { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_ut_pelt: rhsusf_opscore_01 { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_ut_pelt_cam: rhsusf_opscore_01 { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_ut_pelt_nsw_cam: rhsusf_opscore_01 { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_mc_pelt: rhsusf_opscore_01 { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_mc_pelt_nsw: rhsusf_opscore_01 { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_cover; - class rhsusf_opscore_mc_cover_pelt_nsw: rhsusf_opscore_cover { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_mc_cover_pelt: rhsusf_opscore_cover { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_mc_cover_pelt_cam: rhsusf_opscore_cover { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_rg_cover_pelt: rhsusf_opscore_cover { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_coy_cover_pelt: rhsusf_opscore_cover { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_mar_01; - class rhsusf_opscore_mar_ut_pelt: rhsusf_opscore_mar_01 { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_mar_fg_pelt: rhsusf_opscore_mar_01 { - HEARING_PROTECTION_PELTOR; - }; - - // ACH Helmets - class rhsusf_ach_helmet_ocp; - class rhsusf_ach_bare_des_headset: rhsusf_ach_helmet_ocp { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_ach_bare_des_headset_ess: rhsusf_ach_helmet_ocp { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_ach_bare_headset: rhsusf_ach_helmet_ocp { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_ach_bare_headset_ess: rhsusf_ach_helmet_ocp { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_ach_bare_semi_headset: rhsusf_ach_helmet_ocp { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_ach_bare_semi_headset_ess: rhsusf_ach_helmet_ocp { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_ach_bare_tan_headset: rhsusf_ach_helmet_ocp { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_ach_bare_tan_headset_ess: rhsusf_ach_helmet_ocp { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_ach_bare_wood_headset: rhsusf_ach_helmet_ocp { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_ach_bare_wood_headset_ess: rhsusf_ach_helmet_ocp { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_ach_helmet_headset_ocp: rhsusf_ach_helmet_ocp { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_ach_helmet_headset_ess_ocp: rhsusf_ach_helmet_ocp { - HEARING_PROTECTION_PELTOR; - }; - - // ACVC Helmets - class rhsusf_cvc_helmet: rhsusf_opscore_01 { - HEARING_PROTECTION_VICCREW; - }; - - // MICH Helmets - class rhsusf_mich_bare; - class rhsusf_mich_bare_alt: rhsusf_mich_bare { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_mich_bare_norotos; - class rhsusf_mich_bare_norotos_alt: rhsusf_mich_bare_norotos { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_mich_bare_norotos_arc; - class rhsusf_mich_bare_norotos_arc_alt: rhsusf_mich_bare_norotos_arc { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_mich_bare_semi; - class rhsusf_mich_bare_alt_semi: rhsusf_mich_bare_semi { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_mich_bare_norotos_semi; - class rhsusf_mich_bare_norotos_alt_semi: rhsusf_mich_bare_norotos_semi { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_mich_bare_norotos_arc_semi: rhsusf_mich_bare_norotos_alt_semi { - HEARING_PROTECTION_OPEN; - }; - class rhsusf_mich_bare_norotos_arc_alt_semi: rhsusf_mich_bare_norotos_arc_semi { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_mich_bare_tan; - class rhsusf_mich_bare_alt_tan: rhsusf_mich_bare_tan { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_mich_bare_norotos_tan; - class rhsusf_mich_bare_norotos_alt_tan: rhsusf_mich_bare_norotos_tan { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_mich_bare_norotos_arc_tan; - class rhsusf_mich_bare_norotos_arc_alt_tan: rhsusf_mich_bare_norotos_arc_tan { - HEARING_PROTECTION_PELTOR; - }; - - class rhsusf_hgu56p: rhsusf_opscore_01 { - HEARING_PROTECTION_VICCREW; - }; + class rhsusf_hgu56p; class rhsusf_hgu56p_visor: rhsusf_hgu56p { ACE_Protection = 1; }; @@ -420,13 +257,9 @@ class CfgWeapons { class rhsusf_hgu56p_mask_black_skull: rhsusf_hgu56p_visor_mask_black_skull { ACE_Protection = 0; }; - class rhsusf_ihadss: rhsusf_opscore_01 { - HEARING_PROTECTION_VICCREW; - }; class H_HelmetB; class RHS_jetpilot_usaf: H_HelmetB { ACE_Protection = 1; - HEARING_PROTECTION_VICCREW; }; }; diff --git a/addons/compat_rhs_usf3/compat_rhs_usf3_csw/CfgVehicles.hpp b/addons/compat_rhs_usf3/compat_rhs_usf3_csw/CfgVehicles.hpp index cbca20cce76..bfe157c6099 100644 --- a/addons/compat_rhs_usf3/compat_rhs_usf3_csw/CfgVehicles.hpp +++ b/addons/compat_rhs_usf3/compat_rhs_usf3_csw/CfgVehicles.hpp @@ -14,7 +14,7 @@ class CfgVehicles { }; }; - class ACE_CSW { + class ace_csw { enabled = 1; magazineLocation = ""; proxyWeapon = QGVAR(rhs_mortar_81mm); @@ -28,7 +28,7 @@ class CfgVehicles { class StaticMGWeapon; class rhs_m2staticmg_base: StaticMGWeapon { - class ACE_CSW { + class ace_csw { enabled = 1; proxyWeapon = QGVAR(rhs_M2); magazineLocation = "_target selectionPosition 'magazine'"; @@ -41,7 +41,7 @@ class CfgVehicles { }; class RHS_M2StaticMG_MiniTripod_base: rhs_m2staticmg_base { - class ACE_CSW: ACE_CSW { + class ace_csw: ace_csw { enabled = 1; disassembleTurret = QEGVAR(csw,m3TripodLow); }; @@ -49,7 +49,7 @@ class CfgVehicles { class StaticGrenadeLauncher; class RHS_MK19_TriPod_base: StaticGrenadeLauncher { - class ACE_CSW { + class ace_csw { enabled = 1; proxyWeapon = QGVAR(rhs_MK19); magazineLocation = "_target selectionPosition 'magazine'"; @@ -63,7 +63,7 @@ class CfgVehicles { class StaticATWeapon; class RHS_TOW_TriPod_base: StaticATWeapon { - class ACE_CSW { + class ace_csw { enabled = 1; proxyWeapon = QGVAR(rhs_weap_TOW_Launcher_static); magazineLocation = "_target selectionPosition 'tube'"; diff --git a/addons/compat_rhs_usf3/compat_rhs_usf3_csw/CfgWeapons.hpp b/addons/compat_rhs_usf3/compat_rhs_usf3_csw/CfgWeapons.hpp index d373e7fe673..b1a8bd88593 100644 --- a/addons/compat_rhs_usf3/compat_rhs_usf3_csw/CfgWeapons.hpp +++ b/addons/compat_rhs_usf3/compat_rhs_usf3_csw/CfgWeapons.hpp @@ -11,7 +11,7 @@ class CfgWeapons { class GVAR(m252_carry): Launcher_Base_F { dlc = "ace"; - class ACE_CSW { + class ace_csw { type = "weapon"; deployTime = 20; pickupTime = 25; @@ -37,13 +37,14 @@ class CfgWeapons { class GVAR(m2_carry): Launcher_Base_F { dlc = "ace"; - class ACE_CSW { + class ace_csw { type = "weapon"; deployTime = 4; pickupTime = 4; class assembleTo { EGVAR(csw,m3Tripod) = "RHS_M2StaticMG_WD"; EGVAR(csw,m3TripodLow) = "RHS_M2StaticMG_MiniTripod_WD"; + EGVAR(compat_spe,m3Tripod) = "RHS_M2StaticMG_MiniTripod_WD"; }; }; class WeaponSlotsInfo: WeaponSlotsInfo { @@ -62,7 +63,7 @@ class CfgWeapons { class GVAR(mk19_carry): Launcher_Base_F { dlc = "ace"; - class ACE_CSW { + class ace_csw { type = "weapon"; deployTime = 4; pickupTime = 4; @@ -86,7 +87,7 @@ class CfgWeapons { class GVAR(tow_carry): Launcher_Base_F { dlc = "ace"; - class ACE_CSW { + class ace_csw { type = "weapon"; deployTime = 4; pickupTime = 4; diff --git a/addons/compat_rhs_usf3/compat_rhs_usf3_explosives/CfgMagazines.hpp b/addons/compat_rhs_usf3/compat_rhs_usf3_explosives/CfgMagazines.hpp index 332c2bf1f25..aa2485dcdc2 100644 --- a/addons/compat_rhs_usf3/compat_rhs_usf3_explosives/CfgMagazines.hpp +++ b/addons/compat_rhs_usf3/compat_rhs_usf3_explosives/CfgMagazines.hpp @@ -1,7 +1,6 @@ class CfgMagazines { class CA_Magazine; class rhsusf_m112_mag: CA_Magazine { - EGVAR(explosives,delayTime) = 1; EGVAR(explosives,placeable) = 1; EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhsusf_explosive_m112); useAction = 0; diff --git a/addons/compat_rhs_usf3/compat_rhs_usf3_hearing/CfgWeapons.hpp b/addons/compat_rhs_usf3/compat_rhs_usf3_hearing/CfgWeapons.hpp new file mode 100644 index 00000000000..f0571e876f7 --- /dev/null +++ b/addons/compat_rhs_usf3/compat_rhs_usf3_hearing/CfgWeapons.hpp @@ -0,0 +1,174 @@ +class CfgWeapons { + // Fast Helmets + class rhsusf_opscore_01; + class rhsusf_opscore_ut_pelt_nsw: rhsusf_opscore_01 { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_aor1_pelt: rhsusf_opscore_01 { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_aor1_pelt_nsw: rhsusf_opscore_01 { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_bk_pelt: rhsusf_opscore_01 { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_fg_pelt: rhsusf_opscore_01 { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_fg_pelt_nsw: rhsusf_opscore_01 { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_fg_pelt_cam: rhsusf_opscore_01 { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_paint_pelt: rhsusf_opscore_01 { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_paint_pelt_nsw: rhsusf_opscore_01 { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_paint_pelt_nsw_cam: rhsusf_opscore_01 { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_aor2_pelt: rhsusf_opscore_01 { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_aor2_pelt_nsw: rhsusf_opscore_01 { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_ut_pelt: rhsusf_opscore_01 { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_ut_pelt_cam: rhsusf_opscore_01 { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_ut_pelt_nsw_cam: rhsusf_opscore_01 { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_mc_pelt: rhsusf_opscore_01 { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_mc_pelt_nsw: rhsusf_opscore_01 { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_cover; + class rhsusf_opscore_mc_cover_pelt_nsw: rhsusf_opscore_cover { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_mc_cover_pelt: rhsusf_opscore_cover { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_mc_cover_pelt_cam: rhsusf_opscore_cover { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_rg_cover_pelt: rhsusf_opscore_cover { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_coy_cover_pelt: rhsusf_opscore_cover { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_mar_01; + class rhsusf_opscore_mar_ut_pelt: rhsusf_opscore_mar_01 { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_mar_fg_pelt: rhsusf_opscore_mar_01 { + HEARING_PROTECTION_PELTOR; + }; + + // ACH Helmets + class rhsusf_ach_helmet_ocp; + class rhsusf_ach_bare_des_headset: rhsusf_ach_helmet_ocp { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_ach_bare_des_headset_ess: rhsusf_ach_helmet_ocp { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_ach_bare_headset: rhsusf_ach_helmet_ocp { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_ach_bare_headset_ess: rhsusf_ach_helmet_ocp { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_ach_bare_semi_headset: rhsusf_ach_helmet_ocp { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_ach_bare_semi_headset_ess: rhsusf_ach_helmet_ocp { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_ach_bare_tan_headset: rhsusf_ach_helmet_ocp { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_ach_bare_tan_headset_ess: rhsusf_ach_helmet_ocp { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_ach_bare_wood_headset: rhsusf_ach_helmet_ocp { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_ach_bare_wood_headset_ess: rhsusf_ach_helmet_ocp { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_ach_helmet_headset_ocp: rhsusf_ach_helmet_ocp { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_ach_helmet_headset_ess_ocp: rhsusf_ach_helmet_ocp { + HEARING_PROTECTION_PELTOR; + }; + + // ACVC Helmets + class rhsusf_cvc_helmet: rhsusf_opscore_01 { + HEARING_PROTECTION_VICCREW; + }; + + // MICH Helmets + class rhsusf_mich_bare; + class rhsusf_mich_bare_alt: rhsusf_mich_bare { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_mich_bare_norotos; + class rhsusf_mich_bare_norotos_alt: rhsusf_mich_bare_norotos { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_mich_bare_norotos_arc; + class rhsusf_mich_bare_norotos_arc_alt: rhsusf_mich_bare_norotos_arc { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_mich_bare_semi; + class rhsusf_mich_bare_alt_semi: rhsusf_mich_bare_semi { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_mich_bare_norotos_semi; + class rhsusf_mich_bare_norotos_alt_semi: rhsusf_mich_bare_norotos_semi { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_mich_bare_norotos_arc_semi: rhsusf_mich_bare_norotos_alt_semi { + HEARING_PROTECTION_OPEN; + }; + class rhsusf_mich_bare_norotos_arc_alt_semi: rhsusf_mich_bare_norotos_arc_semi { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_mich_bare_tan; + class rhsusf_mich_bare_alt_tan: rhsusf_mich_bare_tan { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_mich_bare_norotos_tan; + class rhsusf_mich_bare_norotos_alt_tan: rhsusf_mich_bare_norotos_tan { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_mich_bare_norotos_arc_tan; + class rhsusf_mich_bare_norotos_arc_alt_tan: rhsusf_mich_bare_norotos_arc_tan { + HEARING_PROTECTION_PELTOR; + }; + + class rhsusf_hgu56p: rhsusf_opscore_01 { + HEARING_PROTECTION_VICCREW; + }; + class rhsusf_ihadss: rhsusf_opscore_01 { + HEARING_PROTECTION_VICCREW; + }; + + class H_HelmetB; + class RHS_jetpilot_usaf: H_HelmetB { + HEARING_PROTECTION_VICCREW; + }; +}; diff --git a/addons/compat_rhs_usf3/compat_rhs_usf3_hearing/config.cpp b/addons/compat_rhs_usf3/compat_rhs_usf3_hearing/config.cpp new file mode 100644 index 00000000000..e52454b1848 --- /dev/null +++ b/addons/compat_rhs_usf3/compat_rhs_usf3_hearing/config.cpp @@ -0,0 +1,19 @@ +#include "script_component.hpp" +#include "\z\ace\addons\hearing\script_macros_hearingProtection.hpp" + +class CfgPatches { + class SUBADDON { + addonRootClass = QUOTE(COMPONENT); + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { + "rhsusf_main_loadorder", + "ace_hearing" + }; + skipWhenMissingDependencies = 1; + VERSION_CONFIG; + }; +}; + +#include "CfgWeapons.hpp" diff --git a/addons/compat_rhs_usf3/compat_rhs_usf3_hearing/script_component.hpp b/addons/compat_rhs_usf3/compat_rhs_usf3_hearing/script_component.hpp new file mode 100644 index 00000000000..8edb825af34 --- /dev/null +++ b/addons/compat_rhs_usf3/compat_rhs_usf3_hearing/script_component.hpp @@ -0,0 +1,3 @@ +#define SUBCOMPONENT hearing +#define SUBCOMPONENT_BEAUTIFIED Hearing +#include "..\script_component.hpp" diff --git a/addons/compat_rhs_usf3/compat_rhs_usf3_javelin/CfgAmmo.hpp b/addons/compat_rhs_usf3/compat_rhs_usf3_javelin/CfgAmmo.hpp index 65ca880587f..b0df767e3a0 100644 --- a/addons/compat_rhs_usf3/compat_rhs_usf3_javelin/CfgAmmo.hpp +++ b/addons/compat_rhs_usf3/compat_rhs_usf3_javelin/CfgAmmo.hpp @@ -9,9 +9,10 @@ class CfgAmmo { class ace_missileguidance { enabled = 1; - minDeflection = 0.00005; // Minium flap deflection for guidance - maxDeflection = 0.025; // Maximum flap deflection for guidance - incDeflection = 0.00005; // The incrmeent in which deflection adjusts. + pitchRate = 120; // degrees per second + yawRate = 120; + stabilityCoefficient = 0.2; + bangBangGuidance = 0; canVanillaLock = 0; @@ -22,6 +23,11 @@ class CfgAmmo { defaultSeekerLockMode = "LOBL"; seekerLockModes[] = { "LOBL" }; + defaultNavigationType = "Direct"; + navigationTypes[] = { "Direct", "ZeroEffortMiss" }; + + navigationGain = 3; + seekerAngle = 180; // Angle in front of the missile which can be searched seekerAccuracy = 1; // seeker accuracy multiplier @@ -34,6 +40,19 @@ class CfgAmmo { defaultAttackProfile = "JAV_TOP"; attackProfiles[] = { "JAV_TOP", "JAV_DIR" }; useModeForAttackProfile = 1; + + class navigationStates { + class initial { + transitionCondition = QEFUNC(missileguidance,javelin_midCourseTransition); + navigationType = "Direct"; + }; + class terminal { + transitionCondition = ""; + navigationType = "ZeroEffortMiss"; + }; + // transitions from initial -> termimal + states[] = {"initial", "terminal"}; + }; }; }; }; diff --git a/addons/compat_rhs_usf3/compat_rhs_usf3_refuel/CfgVehicles.hpp b/addons/compat_rhs_usf3/compat_rhs_usf3_refuel/CfgVehicles.hpp new file mode 100644 index 00000000000..10607ab6b5a --- /dev/null +++ b/addons/compat_rhs_usf3/compat_rhs_usf3_refuel/CfgVehicles.hpp @@ -0,0 +1,52 @@ +class CfgVehicles { + class rhsusf_stryker_base; + class rhsusf_stryker_m1126_base: rhsusf_stryker_base { + class EGVAR(interaction,anims) { + class Hide_FCans { + positions[] = {{-0.7, -3, -0.4}}; + items[] = {"Land_CanisterFuel_F", "Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + }; + }; + class rhsusf_stryker_m1127_base: rhsusf_stryker_m1126_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class Hide_FCans: Hide_FCans { + positions[] = {{-0.5, -3, -0.4}}; + }; + }; + }; + + class rhsusf_stryker_m1126_m2_base: rhsusf_stryker_m1126_base {}; + class rhsusf_stryker_m1132_m2_base: rhsusf_stryker_m1126_m2_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class Hide_FCans: Hide_FCans { + positions[] = {{-1, -4, -0.4}}; + }; + }; + }; + class rhsusf_stryker_m1134_base: rhsusf_stryker_m1126_m2_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class Hide_FCans: Hide_FCans { + positions[] = {{-0.7, -3, -0.7}}; + }; + }; + }; + + class rhsusf_m1a2tank_base; + class rhsusf_m1a2sep2_base: rhsusf_m1a2tank_base { + class EGVAR(interaction,anims) { + class fuelcans_hide { + // Rotate interactions with turret rotation + positions[] = { + "[0.23, -0.6, 0] vectorAdd ([[1.1, -3.6, 0.6], [0, 0, 1], deg (_target animationPhase 'MainTurret')] call CBA_fnc_vectRotate3D)", + "[0.23, -0.6, 0] vectorAdd ([[-1.1, -3.6, 0.6], [0, 0, 1], deg (_target animationPhase 'MainTurret')] call CBA_fnc_vectRotate3D)" + }; + items[] = {"Land_CanisterFuel_F", "Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + }; + }; +}; diff --git a/addons/compat_rhs_usf3/compat_rhs_usf3_refuel/config.cpp b/addons/compat_rhs_usf3/compat_rhs_usf3_refuel/config.cpp index bf600d5d5ae..391e22d95e8 100644 --- a/addons/compat_rhs_usf3/compat_rhs_usf3_refuel/config.cpp +++ b/addons/compat_rhs_usf3/compat_rhs_usf3_refuel/config.cpp @@ -21,3 +21,4 @@ class CfgPatches { }; #include "CfgEventHandlers.hpp" +#include "CfgVehicles.hpp" diff --git a/addons/compat_rhs_usf3/compat_rhs_usf3_repair/CfgVehicles.hpp b/addons/compat_rhs_usf3/compat_rhs_usf3_repair/CfgVehicles.hpp new file mode 100644 index 00000000000..91bed1dc5a1 --- /dev/null +++ b/addons/compat_rhs_usf3/compat_rhs_usf3_repair/CfgVehicles.hpp @@ -0,0 +1,127 @@ +class CfgVehicles { + class Truck_01_base_F; + class rhsusf_fmtv_base: Truck_01_base_F { + class EGVAR(interaction,anims) { + class hide_spare { + positions[] = {{1, 1.4, 0}}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + class rhsusf_M1078A1P2_fmtv_usarmy: rhsusf_fmtv_base {}; + class rhsusf_M1078A1P2_B_fmtv_usarmy: rhsusf_M1078A1P2_fmtv_usarmy {}; + class rhsusf_M1078A1P2_B_M2_fmtv_usarmy: rhsusf_M1078A1P2_B_fmtv_usarmy { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_spare: hide_spare { + positions[] = {{1, 1.4, -0.5}}; + }; + }; + }; + class rhsusf_M1078A1R_SOV_M2_D_fmtv_socom: rhsusf_M1078A1P2_B_M2_fmtv_usarmy { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_spare: hide_spare { + positions[] = {{1, 1, -0.5}}; + }; + }; + }; + class rhsusf_M1083A1P2_fmtv_usarmy: rhsusf_M1078A1P2_fmtv_usarmy {}; + class rhsusf_M1083A1P2_B_fmtv_usarmy: rhsusf_M1083A1P2_fmtv_usarmy {}; + class rhsusf_M1083A1P2_B_M2_fmtv_usarmy: rhsusf_M1083A1P2_B_fmtv_usarmy { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_spare: hide_spare { + positions[] = {{1, 1.4, -0.5}}; + }; + }; + }; + class rhsusf_M1084A1P2_fmtv_usarmy: rhsusf_M1083A1P2_fmtv_usarmy { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_spare: hide_spare { + positions[] = {{1, 1.8, 0}}; + }; + }; + }; + class rhsusf_M1084A1P2_B_M2_fmtv_usarmy: rhsusf_M1083A1P2_B_M2_fmtv_usarmy { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_spare: hide_spare { + positions[] = {{1, 1.8, -0.5}}; + }; + }; + }; + class rhsusf_M1085A1P2_B_Medical_fmtv_usarmy: rhsusf_M1083A1P2_B_fmtv_usarmy { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_spare: hide_spare { + positions[] = {{1, 6.1, 0}}; + }; + }; + }; + + class rhsusf_HEMTT_A4_base: Truck_01_base_F { + class EGVAR(interaction,anims) { + class hide_spare { + positions[] = {"_target selectionPosition ['sparewheel', 'FireGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + distance = 2.5; + }; + }; + }; + + class MRAP_01_base_F; + class rhsusf_m1151_base: MRAP_01_base_F { + class EGVAR(interaction,anims) { + class hide_spare { + positions[] = {"_target selectionPosition ['sparewheel', 'FireGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + // Don't inherit, as it's easier for the trenches compat + class rhsusf_M1165A1_GMV_SAG2_base: rhsusf_m1151_base { + class EGVAR(interaction,anims) { + class hide_spare { + positions[] = {"_target selectionPosition ['sparewheel_gmv', 'Geometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + + class rhsusf_rg33_base: MRAP_01_base_F { + class EGVAR(interaction,anims) { + class hide_spare { + positions[] = {"_target selectionPosition ['sparewheel', 'FireGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + + class rhsusf_M1239_base: MRAP_01_base_F { + class EGVAR(interaction,anims) { + class hide_spare { + positions[] = {"_target selectionPosition ['sparewheel', 'FireGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + + class rhsusf_MATV_base: MRAP_01_base_F { + class EGVAR(interaction,anims) { + class hide_spare { + positions[] = {"_target selectionPosition ['sparewheel', 'Geometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; +}; diff --git a/addons/compat_rhs_usf3/compat_rhs_usf3_repair/config.cpp b/addons/compat_rhs_usf3/compat_rhs_usf3_repair/config.cpp new file mode 100644 index 00000000000..b204f64166a --- /dev/null +++ b/addons/compat_rhs_usf3/compat_rhs_usf3_repair/config.cpp @@ -0,0 +1,23 @@ +#include "script_component.hpp" + +class CfgPatches { + class SUBADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { + "rhsusf_main_loadorder", + "ace_repair" + }; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {"johnb43"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + + addonRootClass = QUOTE(ADDON); + }; +}; + +#include "CfgVehicles.hpp" diff --git a/addons/compat_rhs_usf3/compat_rhs_usf3_repair/script_component.hpp b/addons/compat_rhs_usf3/compat_rhs_usf3_repair/script_component.hpp new file mode 100644 index 00000000000..1af928486c3 --- /dev/null +++ b/addons/compat_rhs_usf3/compat_rhs_usf3_repair/script_component.hpp @@ -0,0 +1,3 @@ +#define SUBCOMPONENT repair +#define SUBCOMPONENT_BEAUTIFIED Repair +#include "..\script_component.hpp" diff --git a/addons/compat_rhs_usf3/compat_rhs_usf3_trenches/CfgVehicles.hpp b/addons/compat_rhs_usf3/compat_rhs_usf3_trenches/CfgVehicles.hpp new file mode 100644 index 00000000000..e914b24d600 --- /dev/null +++ b/addons/compat_rhs_usf3/compat_rhs_usf3_trenches/CfgVehicles.hpp @@ -0,0 +1,48 @@ +class CfgVehicles { + class rhsusf_stryker_base; + class rhsusf_stryker_m1126_base: rhsusf_stryker_base { + class EGVAR(interaction,anims) { + class Hide_PioKit { + positions[] = {{-1, -2.2, -0.5}}; + items[] = {"ACE_EntrenchingTool"}; + name = ECSTRING(trenches,EntrenchingToolName); + text = ECSTRING(trenches,EntrenchingToolName); + }; + }; + }; + class rhsusf_stryker_m1127_base: rhsusf_stryker_m1126_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class Hide_PioKit: Hide_PioKit { + positions[] = {{-0.8, -2.2, -0.5}}; + }; + }; + }; + + class rhsusf_stryker_m1126_m2_base: rhsusf_stryker_m1126_base {}; + class rhsusf_stryker_m1132_m2_base: rhsusf_stryker_m1126_m2_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class Hide_PioKit: Hide_PioKit { + positions[] = {{-1.3, -3.3, -0.5}}; + }; + }; + }; + class rhsusf_stryker_m1134_base: rhsusf_stryker_m1126_m2_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class Hide_PioKit: Hide_PioKit { + positions[] = {{-1, -2.2, -0.8}}; + }; + }; + }; + + class rhsusf_m1151_base; + class rhsusf_M1165A1_GMV_SAG2_base: rhsusf_m1151_base { + class EGVAR(interaction,anims) { + class tools_hide { + positions[] = {{0.365, 1.5, -0.4}}; + items[] = {"ACE_EntrenchingTool"}; + name = ECSTRING(trenches,EntrenchingToolName); + text = ECSTRING(trenches,EntrenchingToolName); + }; + }; + }; +}; diff --git a/addons/compat_rhs_usf3/compat_rhs_usf3_trenches/config.cpp b/addons/compat_rhs_usf3/compat_rhs_usf3_trenches/config.cpp new file mode 100644 index 00000000000..aea4c9daeb0 --- /dev/null +++ b/addons/compat_rhs_usf3/compat_rhs_usf3_trenches/config.cpp @@ -0,0 +1,23 @@ +#include "script_component.hpp" + +class CfgPatches { + class SUBADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { + "rhsusf_main_loadorder", + "ace_trenches" + }; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {"johnb43"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + + addonRootClass = QUOTE(ADDON); + }; +}; + +#include "CfgVehicles.hpp" diff --git a/addons/compat_rhs_usf3/compat_rhs_usf3_trenches/script_component.hpp b/addons/compat_rhs_usf3/compat_rhs_usf3_trenches/script_component.hpp new file mode 100644 index 00000000000..10b90eb71e5 --- /dev/null +++ b/addons/compat_rhs_usf3/compat_rhs_usf3_trenches/script_component.hpp @@ -0,0 +1,3 @@ +#define SUBCOMPONENT trenches +#define SUBCOMPONENT_BEAUTIFIED Trenches +#include "..\script_component.hpp" diff --git a/addons/compat_rhs_usf3/config.cpp b/addons/compat_rhs_usf3/config.cpp index 73b4723b2c8..b28a08b22e9 100644 --- a/addons/compat_rhs_usf3/config.cpp +++ b/addons/compat_rhs_usf3/config.cpp @@ -1,5 +1,4 @@ #include "script_component.hpp" -#include "\z\ace\addons\hearing\script_macros_hearingProtection.hpp" class CfgPatches { class ADDON { @@ -7,7 +6,7 @@ class CfgPatches { units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"rhsusf_main_loadorder"}; + requiredAddons[] = {"ace_common", "rhsusf_main_loadorder"}; skipWhenMissingDependencies = 1; author = ECSTRING(common,ACETeam); authors[] = {"Ruthberg", "GitHawk", "BaerMitUmlaut", "Fyuran"}; diff --git a/addons/compat_sog/ACE_CSW_Groups.hpp b/addons/compat_sog/ACE_CSW_Groups.hpp index 2bc81dbb65b..a8914204398 100644 --- a/addons/compat_sog/ACE_CSW_Groups.hpp +++ b/addons/compat_sog/ACE_CSW_Groups.hpp @@ -2,7 +2,7 @@ class ACE_CSW_Groups { // --- Gun Turrets ------------------------------------------------------------- - class ace_csw_100Rnd_127x99_mag { + class EGVAR(csw,100Rnd_127x99_mag) { vn_m2_v_100_mag = 1; }; diff --git a/addons/compat_sog/CfgAmmo/explosives.hpp b/addons/compat_sog/CfgAmmo/explosives.hpp index 849f7e69480..6922962fb3e 100644 --- a/addons/compat_sog/CfgAmmo/explosives.hpp +++ b/addons/compat_sog/CfgAmmo/explosives.hpp @@ -2,16 +2,10 @@ class DirectionalBombBase; class vn_mine_m18_ammo: DirectionalBombBase { EGVAR(explosives,defuseObjectPosition)[] = {0, 0, 0.15}; EGVAR(explosives,size) = 1; - EGVAR(explosives,explosive) = "vn_mine_m18_ammo_scripted"; }; class vn_mine_m18_x3_ammo: vn_mine_m18_ammo { EGVAR(explosives,defuseObjectPosition)[] = {0, 0, 0.1}; - EGVAR(explosives,explosive) = "vn_mine_m18_x3_ammo_scripted"; -}; - -class vn_mine_m18_wp_ammo: vn_mine_m18_ammo { - EGVAR(explosives,explosive) = "vn_mine_m18_wp_ammo_scripted"; }; class vn_mine_m16_base; @@ -99,13 +93,7 @@ class vn_mine_punji_05_ammo: vn_mine_punji_04_ammo { }; class APERSMine_Range_Ammo; -class vn_mine_bike_ammo: APERSMine_Range_Ammo { - EGVAR(explosives,explosive) = "vn_mine_bike_ammo_scripted"; -}; - class vn_mine_cartridge_ammo: APERSMine_Range_Ammo { - EGVAR(explosives,explosive) = "vn_mine_cartridge_ammo_scripted"; - // bump range and damage slightly, default values do not work well with ACE Medical indirectHit = QUOTE(getNumber (configFile >> 'CfgAmmo' >> 'vn_mine_cartridge_ammo' >> 'GVAR(indirectHit)')); GVAR(indirectHit) = QUOTE([ARR_2(2,1)] select isNull (configFile >> 'CfgPatches' >> 'ace_medical')); @@ -116,50 +104,8 @@ class vn_mine_cartridge_ammo: APERSMine_Range_Ammo { class vn_mine_lighter_ammo: APERSMine_Range_Ammo { ACE_damageType = QGVAR(explosive_incendiary); - - EGVAR(explosives,explosive) = "vn_mine_lighter_ammo_scripted"; }; class vn_mine_jerrycan_ammo: APERSMine_Range_Ammo { ACE_damageType = QGVAR(explosive_incendiary); - - EGVAR(explosives,explosive) = "vn_mine_jerrycan_ammo_scripted"; -}; - -class vn_mine_pot_ammo: APERSMine_Range_Ammo { - EGVAR(explosives,explosive) = "vn_mine_pot_ammo_scripted"; -}; - -class vn_mine_mortar_range_ammo: APERSMine_Range_Ammo { - EGVAR(explosives,explosive) = "vn_mine_mortar_range_ammo_scripted"; -}; - -class vn_mine_limpet_01_ammo: DemoCharge_Remote_Ammo { - EGVAR(explosives,explosive) = "vn_mine_limpet_01_ammo_scripted"; -}; - -class vn_mine_limpet_02_ammo: vn_mine_limpet_01_ammo { - EGVAR(explosives,explosive) = "vn_mine_limpet_02_ammo_scripted"; -}; - -class vn_mine_chicom_no8_ammo: APERSMine_Range_Ammo { - EGVAR(explosives,explosive) = "vn_mine_chicom_no8_ammo_scripted"; -}; - -class vn_mine_dh10_ammo: DirectionalBombBase { - EGVAR(explosives,explosive) = "vn_mine_dh10_ammo_scripted"; -}; - -class PipeBombBase; -class vn_mine_gboard_range_ammo: PipeBombBase { - EGVAR(explosives,explosive) = "vn_mine_gboard_range_ammo_scripted"; -}; - -class SatchelCharge_Remote_Ammo; -class vn_mine_satchelcharge_02_ammo: SatchelCharge_Remote_Ammo { - EGVAR(explosives,explosive) = "vn_mine_satchelcharge_02_ammo_scripted"; -}; - -class vn_mine_bangalore_ammo: SatchelCharge_Remote_Ammo { - EGVAR(explosives,explosive) = "vn_mine_bangalore_ammo_scripted"; }; diff --git a/addons/compat_sog/CfgMagazines/explosives.hpp b/addons/compat_sog/CfgMagazines/explosives.hpp index 7e25609fc8a..a8d6ca76bd3 100644 --- a/addons/compat_sog/CfgMagazines/explosives.hpp +++ b/addons/compat_sog/CfgMagazines/explosives.hpp @@ -6,8 +6,8 @@ class vn_mine_m18_mag: vn_magazine { displayNameShort = ""; // Every explosive inherits this and it breaks naming in the placing menu - EGVAR(explosives,Placeable) = 1; - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(m18); + EGVAR(explosives,placeable) = 1; + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(m18); class ACE_Triggers { SupportedTriggers[] = {"Command", "MK16_Transmitter"}; @@ -42,7 +42,7 @@ class vn_mine_m18_fuze10_mag: vn_mine_m18_mag { // Claymore x3 (Remote) class vn_mine_m18_x3_mag: vn_mine_m18_mag { - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(m18_x3); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(m18_x3); class ACE_Triggers { SupportedTriggers[] = {"Command", "MK16_Transmitter"}; @@ -65,7 +65,7 @@ class vn_mine_m18_x3_range_mag: vn_mine_m18_x3_mag { // WP Claymore (Remote) class vn_mine_m18_wp_mag: vn_mine_m18_fuze10_mag { - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(m18_wp); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(m18_wp); class ACE_Triggers { SupportedTriggers[] = {"Command", "MK16_Transmitter"}; @@ -101,7 +101,7 @@ class vn_mine_m18_wp_fuze10_mag: vn_mine_m18_wp_mag { // Toe-Popper class vn_mine_m14_mag: vn_mine_m18_mag { - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(m14); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(m14); class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; @@ -113,7 +113,7 @@ class vn_mine_m14_mag: vn_mine_m18_mag { // Bounding Mine class vn_mine_m16_mag: vn_mine_m18_mag { - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(m16); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(m16); class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; @@ -125,7 +125,7 @@ class vn_mine_m16_mag: vn_mine_m18_mag { // Bounding Mine (Trip Wire 2m) class vn_mine_tripwire_m16_02_mag: vn_mine_m16_mag { - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(m16_tripwire_2m); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(m16_tripwire_2m); class ACE_Triggers { SupportedTriggers[] = {"Tripwire"}; @@ -136,7 +136,7 @@ class vn_mine_tripwire_m16_02_mag: vn_mine_m16_mag { }; // Bounding Mine (Trip Wire 4m) class vn_mine_tripwire_m16_04_mag: vn_mine_tripwire_m16_02_mag { - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(m16_tripwire_4m); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(m16_tripwire_4m); class ACE_Triggers { SupportedTriggers[] = {"Tripwire"}; @@ -148,22 +148,22 @@ class vn_mine_tripwire_m16_04_mag: vn_mine_tripwire_m16_02_mag { // F1 (Trip Wire 2m) class vn_mine_tripwire_f1_02_mag: vn_mine_tripwire_m16_02_mag { - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(f1_tripwire_2m); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(f1_tripwire_2m); }; // F1 (Trip Wire 4m) class vn_mine_tripwire_f1_04_mag: vn_mine_tripwire_f1_02_mag { - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(f1_tripwire_4m); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(f1_tripwire_4m); }; // Arty Shell (Trip Wire 4m) class vn_mine_tripwire_arty_mag: vn_mine_tripwire_m16_02_mag { - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(arty_tripwire_4m); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(arty_tripwire_4m); }; // Satchel Charge class vn_mine_satchel_remote_02_mag: vn_mine_m18_mag { useAction = 0; - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(satchel_remote_02); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(satchel_remote_02); class ACE_Triggers { SupportedTriggers[] = {"Timer", "Command", "MK16_Transmitter", "DeadmanSwitch"}; @@ -180,7 +180,7 @@ class vn_mine_satchel_remote_02_mag: vn_mine_m18_mag { // TM57 Anti-Tank Mine class vn_mine_tm57_mag: vn_mine_m18_mag { - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(tm57); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(tm57); class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; @@ -190,7 +190,7 @@ class vn_mine_tm57_mag: vn_mine_m18_mag { // M15 Anti-Tank Mine class vn_mine_m15_mag: vn_mine_tm57_mag { - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(m15); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(m15); class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; @@ -202,7 +202,7 @@ class vn_mine_m15_mag: vn_mine_tm57_mag { // M112 Breaching charge class vn_mine_m112_remote_mag: vn_mine_m18_mag { - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(m112); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(m112); class ACE_Triggers { SupportedTriggers[] = {"Timer", "Command", "MK16_Transmitter", "DeadmanSwitch"}; @@ -221,7 +221,7 @@ class vn_mine_m112_remote_mag: vn_mine_m18_mag { // Spiked ammo box class vn_mine_ammobox_range_mag: vn_mine_m18_mag { - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(ammobox_range); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(ammobox_range); class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; @@ -234,7 +234,7 @@ class vn_mine_ammobox_range_mag: vn_mine_m18_mag { // Punji large class vn_mine_punji_01_mag: vn_mine_m18_mag { useAction = 0; - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(punji_01); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(punji_01); class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; @@ -246,18 +246,18 @@ class vn_mine_punji_01_mag: vn_mine_m18_mag { // Punji small class vn_mine_punji_02_mag: vn_mine_punji_01_mag { - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(punji_02); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(punji_02); }; // Punji whip class vn_mine_punji_03_mag: vn_mine_punji_01_mag { - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(punji_03); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(punji_03); }; // Punji door-way class vn_mine_punji_04_mag: vn_mine_m18_mag { useAction = 0; - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(punji_04); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(punji_04); class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; @@ -270,7 +270,7 @@ class vn_mine_punji_04_mag: vn_mine_m18_mag { // Punji side whip class vn_mine_punji_05_mag: vn_mine_punji_04_mag { - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(punji_05); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(punji_05); class ACE_Triggers: ACE_Triggers { class PressurePlate: PressurePlate { @@ -281,7 +281,7 @@ class vn_mine_punji_05_mag: vn_mine_punji_04_mag { // Bike mine (Remote) class vn_mine_bike_mag: vn_mine_m18_mag { - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(bike); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(bike); class ACE_Triggers { SupportedTriggers[] = {QGVAR(Command), QGVAR(MK16_Transmitter)}; @@ -304,7 +304,7 @@ class vn_mine_bike_range_mag: vn_mine_bike_mag { // Cartridge mine class vn_mine_cartridge_mag: vn_mine_m18_mag { - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(cartridge); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(cartridge); class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; @@ -316,7 +316,7 @@ class vn_mine_cartridge_mag: vn_mine_m18_mag { // Lighter mine (Proximity) class vn_mine_lighter_mag: vn_mine_m18_mag { - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(lighter); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(lighter); class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; @@ -328,7 +328,7 @@ class vn_mine_lighter_mag: vn_mine_m18_mag { // Pot mine (Remote) class vn_mine_pot_mag: vn_mine_m18_mag { - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(pot); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(pot); class ACE_Triggers { SupportedTriggers[] = {"Command", "MK16_Transmitter"}; @@ -351,7 +351,7 @@ class vn_mine_pot_range_mag: vn_mine_pot_mag { // Jerrycan mine (Remote) class vn_mine_jerrycan_mag: vn_mine_m18_mag { - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(jerrycan); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(jerrycan); class ACE_Triggers { SupportedTriggers[] = {"Command", "MK16_Transmitter"}; @@ -374,7 +374,7 @@ class vn_mine_jerrycan_range_mag: vn_mine_jerrycan_mag { // Mortar shell on a stick (Proximity) class vn_mine_mortar_range_mag: vn_mine_m18_mag { - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(mortar_range); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(mortar_range); class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; @@ -386,17 +386,17 @@ class vn_mine_mortar_range_mag: vn_mine_m18_mag { // Limpet mine USA (Remote) class vn_mine_limpet_01_mag: vn_mine_m18_mag { - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(limpet_01); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(limpet_01); }; // Limpet mine RUS (Remote) class vn_mine_limpet_02_mag: vn_mine_limpet_01_mag { - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(limpet_02); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(limpet_02); }; // Chicom NO8 mine class vn_mine_chicom_no8_mag: vn_mine_m18_mag { - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(chicom_no8); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(chicom_no8); class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; @@ -408,7 +408,7 @@ class vn_mine_chicom_no8_mag: vn_mine_m18_mag { // DH10 mine (Remote) class vn_mine_dh10_mag: vn_mine_m18_mag { - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(dh10); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(dh10); }; // DH10 mine (Proximity) class vn_mine_dh10_range_mag: vn_mine_dh10_mag { @@ -422,7 +422,7 @@ class vn_mine_dh10_range_mag: vn_mine_dh10_mag { // Grenade board mine (Tripwire 4m) class vn_mine_gboard_range_mag: vn_mine_m18_mag { - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(gboard); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(gboard); class ACE_Triggers { SupportedTriggers[] = {"Tripwire"}; @@ -434,10 +434,10 @@ class vn_mine_gboard_range_mag: vn_mine_m18_mag { // Satchel charge class vn_mine_satchelcharge_02_mag: vn_mine_satchel_remote_02_mag { - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(satchelcharge_02); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(satchelcharge_02); }; // Bangalore mine class vn_mine_bangalore_mag: vn_mine_satchel_remote_02_mag { - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(bangalore); + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(bangalore); }; diff --git a/addons/compat_sog/CfgVehicles/tracked.hpp b/addons/compat_sog/CfgVehicles/tracked.hpp index e2832796a97..7adc0193c63 100644 --- a/addons/compat_sog/CfgVehicles/tracked.hpp +++ b/addons/compat_sog/CfgVehicles/tracked.hpp @@ -1,18 +1,55 @@ +// M113A1 https://man.fas.org/dod-101/sys/land/m113.htm +class Tank_F; +class APC_Tracked_01_base_F: Tank_F { + class ACE_Actions; +}; +class vn_armor_m113_base: APC_Tracked_01_base_F { + EGVAR(refuel,fuelCapacity) = 360; + class ACE_Actions: ACE_Actions { + class ACE_MainActions; + }; +}; +class vn_armor_m577_base: vn_armor_m113_base { + class ACE_Actions: ACE_Actions { + class ACE_MainActions: ACE_MainActions { + position = "[0, 3.5, -1]"; + }; + }; +}; + // M41 class vn_armor_tank_base; class vn_armor_m41_base: vn_armor_tank_base { EGVAR(refuel,fuelCapacity) = 530; }; -// Type 63 -class vn_armor_type63_base: vn_armor_tank_base { - EGVAR(refuel,fuelCapacity) = 545; +// M48 +class vn_armor_m48_base: vn_armor_tank_base { + class EGVAR(interaction,anims) { + class hide_mainturret_backpacks { + // Rotate interactions with turret rotation + positions[] = { + "[[-1.3, -0.7, -0.4], [0, 0, 1], deg (_target animationPhase 'MainTurret')] call CBA_fnc_vectRotate3D", + "[[0.1, -2, -0.2], [0, 0, 1], deg (_target animationPhase 'MainTurret')] call CBA_fnc_vectRotate3D" + }; + items[] = {"vn_b_pack_02_02", "vn_b_pack_04_02"}; + name = "$STR_a3_cfgvehicleclasses_backpacks0"; + text = "$STR_a3_cfgvehicleclasses_backpacks0"; + }; + }; }; -// M113A1 https://man.fas.org/dod-101/sys/land/m113.htm -class APC_Tracked_01_base_F; -class vn_armor_m113_base: APC_Tracked_01_base_F { - EGVAR(refuel,fuelCapacity) = 360; +// T-54 +class vn_armor_t54_base: vn_armor_tank_base { + class EGVAR(interaction,anims) { + class hide_mainturret_backpacks { + // Rotate interactions with turret rotation + positions[] = {"[0, -0.2, 0] vectorAdd ([[-1.1, -0.85, -1.3], [0, 0, 1], deg (_target animationPhase 'MainTurret')] call CBA_fnc_vectRotate3D)"}; + items[] = {"vn_o_pack_01", "vn_o_pack_02"}; + name = "$STR_a3_cfgvehicleclasses_backpacks0"; + text = "$STR_a3_cfgvehicleclasses_backpacks0"; + }; + }; }; // PT-76A https://en.wikipedia.org/wiki/PT-76 @@ -24,3 +61,8 @@ class vn_armor_pt76_base: vn_armor_tank_base { class vn_armor_pt76b_base: vn_armor_pt76_base { EGVAR(refuel,fuelCapacity) = 400; }; + +// Type 63 +class vn_armor_type63_base: vn_armor_tank_base { + EGVAR(refuel,fuelCapacity) = 545; +}; diff --git a/addons/compat_sog/CfgVehicles/turrets.hpp b/addons/compat_sog/CfgVehicles/turrets.hpp index 6142a018e81..928b80716a4 100644 --- a/addons/compat_sog/CfgVehicles/turrets.hpp +++ b/addons/compat_sog/CfgVehicles/turrets.hpp @@ -17,7 +17,7 @@ class vn_static_m2_high_base: StaticMGWeapon { }; }; - class ACE_CSW { + class ace_csw { enabled = 1; proxyWeapon = "vn_m2_v_01"; magazineLocation = "_target selectionPosition 'mg1_magazine'"; @@ -31,7 +31,7 @@ class vn_static_m2_high_base: StaticMGWeapon { // M2 Browning - Low class vn_static_m2_low_base: vn_static_m2_high_base { - class ACE_CSW: ACE_CSW { + class ace_csw: ace_csw { disassembleTurret = QEGVAR(csw,m3TripodLow); }; }; @@ -45,7 +45,7 @@ class vn_static_m1919a6_base: vn_static_m2_low_base { }; }; - class ACE_CSW: ACE_CSW { + class ace_csw: ace_csw { enabled = 1; proxyWeapon = "vn_m1919_v_01"; magazineLocation = "_target selectionPosition 'mg1_magazine' vectorAdd [-0.3, 0, 0]"; @@ -66,7 +66,7 @@ class vn_static_m1919a4_high_base: vn_static_m1919a6_base { }; }; - class ACE_CSW: ACE_CSW { + class ace_csw: ace_csw { enabled = 1; proxyWeapon = "vn_m1919_v_01"; magazineLocation = "_target selectionPosition 'mg1_magazine'"; @@ -80,7 +80,7 @@ class vn_static_m1919a4_high_base: vn_static_m1919a6_base { // M1919A4 - Low class vn_static_m1919a4_low_base: vn_static_m1919a4_high_base { - class ACE_CSW: ACE_CSW { + class ace_csw: ace_csw { disassembleTurret = QEGVAR(csw,m3TripodLow); }; }; @@ -93,7 +93,7 @@ class vn_static_m60_high_base: vn_static_m2_low_base { }; }; - class ACE_CSW: ACE_CSW { + class ace_csw: ace_csw { enabled = 1; proxyWeapon = "vn_m60_v_01"; magazineLocation = "_target selectionPosition 'mg1_trigger'"; @@ -113,7 +113,7 @@ class vn_static_m60_low_base: vn_static_m60_high_base { }; }; - class ACE_CSW: ACE_CSW { + class ace_csw: ace_csw { magazineLocation = "_target selectionPosition 'mg1_otochlaven_recoil'"; disassembleTurret = QEGVAR(csw,m3TripodLow); }; @@ -131,7 +131,7 @@ class vn_static_tow_base: vn_static_at3_base { }; }; - class ACE_CSW { + class ace_csw { enabled = 1; proxyWeapon = "vn_missile_tow_launcher"; magazineLocation = "_target selectionPosition 'magazine'"; @@ -145,7 +145,7 @@ class vn_static_tow_base: vn_static_at3_base { // DShKM - High class vn_static_dp28_high_base: vn_static_m2_high_base { - class ACE_CSW: ACE_CSW { + class ace_csw: ace_csw { enabled = 0; }; }; @@ -156,7 +156,7 @@ class vn_static_dshkm_high_01_base: vn_static_dp28_high_base { }; }; - class ACE_CSW: ACE_CSW { + class ace_csw: ace_csw { enabled = 1; proxyWeapon = "vn_dshkm_v_01"; magazineLocation = "_target selectionPosition 'mg1_boxmag'"; @@ -170,7 +170,7 @@ class vn_static_dshkm_high_01_base: vn_static_dp28_high_base { // DShKM - High, with AA sight class vn_static_dshkm_high_02_base: vn_static_dshkm_high_01_base { - class ACE_CSW: ACE_CSW { + class ace_csw: ace_csw { disassembleWeapon = QGVAR(dshkm_AA_carry); }; }; @@ -185,7 +185,7 @@ class vn_static_dshkm_low_01_base: vn_static_dshkm_high_01_base { }; }; - class ACE_CSW: ACE_CSW { + class ace_csw: ace_csw { disassembleWeapon = QGVAR(dshkm_shield_carry); disassembleTurret = QEGVAR(csw,kordTripodLow); }; @@ -193,7 +193,7 @@ class vn_static_dshkm_low_01_base: vn_static_dshkm_high_01_base { // DShKM - Low class vn_static_dshkm_low_02_base: vn_static_dshkm_low_01_base { - class ACE_CSW: ACE_CSW { + class ace_csw: ace_csw { disassembleWeapon = QGVAR(dshkm_carry); }; }; @@ -206,7 +206,7 @@ class vn_static_rpd_high_base: vn_static_dp28_high_base { }; }; - class ACE_CSW: ACE_CSW { + class ace_csw: ace_csw { enabled = 1; proxyWeapon = "vn_rpd_v_01"; magazineLocation = "_target selectionPosition 'mg1_otochlaven_recoil'"; @@ -226,7 +226,7 @@ class vn_static_pk_high_base: vn_static_rpd_high_base { }; }; - class ACE_CSW: ACE_CSW { + class ace_csw: ace_csw { enabled = 1; proxyWeapon = "vn_pk_v_01"; magazineLocation = "_target selectionPosition 'mg1_otochlaven_recoil'"; @@ -246,7 +246,7 @@ class vn_static_pk_low_base: vn_static_pk_high_base { }; }; - class ACE_CSW: ACE_CSW { + class ace_csw: ace_csw { disassembleTurret = QEGVAR(csw,kordTripodLow); }; }; @@ -259,7 +259,7 @@ class vn_static_mg42_high_base: vn_static_rpd_high_base { }; }; - class ACE_CSW { + class ace_csw { enabled = 1; proxyWeapon = "vn_mg42_v_01"; magazineLocation = "_target selectionPosition 'mg1_otochlaven_recoil'"; @@ -278,7 +278,7 @@ class vn_static_mg42_low_base: vn_static_mg42_high_base { }; }; - class ACE_CSW: ACE_CSW { + class ace_csw: ace_csw { disassembleTurret = ""; }; }; @@ -294,7 +294,7 @@ class vn_static_sgm_high_base: vn_static_sgm_base { }; }; - class ACE_CSW { + class ace_csw { enabled = 1; proxyWeapon = "vn_sgm_v_01"; magazineLocation = "_target selectionPosition 'mg1_otochlaven_recoil'"; @@ -308,7 +308,7 @@ class vn_static_sgm_high_base: vn_static_sgm_base { // SGM - Low class vn_static_sgm_low_base: vn_static_sgm_high_base { - class ACE_CSW: ACE_CSW { + class ace_csw: ace_csw { disassembleWeapon = QGVAR(sgm_carry); disassembleTurret = QEGVAR(csw,kordTripodLow); }; @@ -316,25 +316,25 @@ class vn_static_sgm_low_base: vn_static_sgm_high_base { // SGM - Shield class vn_o_pl_static_sgm_low_01: vn_static_sgm_low_base { - class ACE_CSW: ACE_CSW { + class ace_csw: ace_csw { disassembleWeapon = QGVAR(sgm_shield_carry); disassembleTurret = QEGVAR(csw,kordTripodLow); }; }; class vn_o_nva_65_static_sgm_low_01: vn_static_sgm_low_base { - class ACE_CSW: ACE_CSW { + class ace_csw: ace_csw { disassembleWeapon = QGVAR(sgm_shield_carry); disassembleTurret = QEGVAR(csw,kordTripodLow); }; }; class vn_o_nva_static_sgm_low_01: vn_static_sgm_low_base { - class ACE_CSW: ACE_CSW { + class ace_csw: ace_csw { disassembleWeapon = QGVAR(sgm_shield_carry); disassembleTurret = QEGVAR(csw,kordTripodLow); }; }; class vn_o_nva_navy_static_sgm_low_01: vn_static_sgm_low_base { - class ACE_CSW: ACE_CSW { + class ace_csw: ace_csw { disassembleWeapon = QGVAR(sgm_shield_carry); disassembleTurret = QEGVAR(csw,kordTripodLow); }; @@ -351,7 +351,7 @@ class vn_static_mk18_base: StaticCannon { }; }; - class ACE_CSW { + class ace_csw { enabled = 1; proxyWeapon = "vn_mk18_v_01"; magazineLocation = "_target selectionPosition 'mg1_magazine'"; @@ -378,7 +378,7 @@ class vn_static_mortar_m29_base: Mortar_01_base_F { }; }; - class ACE_CSW { + class ace_csw { enabled = 1; proxyWeapon = QGVAR(vn_mortar_m29); magazineLocation = "_target selectionPosition 'pohon'"; @@ -392,7 +392,7 @@ class vn_static_mortar_m29_base: Mortar_01_base_F { // M2 / Type 63 Mortar class vn_static_mortar_m2_base: vn_static_mortar_m29_base { - class ACE_CSW: ACE_CSW { + class ace_csw: ace_csw { enabled = 1; proxyWeapon = QGVAR(vn_mortar_m2); magazineLocation = "_target selectionPosition 'pohon'"; @@ -406,7 +406,7 @@ class vn_static_mortar_m2_base: vn_static_mortar_m29_base { // Type 53 Mortar class vn_static_mortar_type53_base: vn_static_mortar_m29_base { - class ACE_CSW: ACE_CSW { + class ace_csw: ace_csw { enabled = 1; proxyWeapon = QGVAR(vn_mortar_type53); magazineLocation = "_target selectionPosition 'pohon'"; @@ -430,7 +430,7 @@ class vn_static_h12_base: Mortar_01_base_F { }; }; - class ACE_CSW { + class ace_csw { enabled = 0; }; }; @@ -441,7 +441,7 @@ class vn_static_m45_base: vn_static_m2_high_base { EGVAR(dragging,canCarry) = 0; EGVAR(dragging,canDrag) = 0; - class ACE_CSW: ACE_CSW { + class ace_csw: ace_csw { enabled = 0; }; }; @@ -450,7 +450,7 @@ class vn_static_zpu4_base: vn_static_m2_high_base { EGVAR(dragging,canCarry) = 0; EGVAR(dragging,canDrag) = 0; - class ACE_CSW: ACE_CSW { + class ace_csw: ace_csw { enabled = 0; }; }; @@ -466,7 +466,7 @@ class vn_o_static_rsna75: StaticMGWeapon { }; }; - class ACE_CSW { + class ace_csw { enabled = 0; }; }; diff --git a/addons/compat_sog/CfgWeapons/csw.hpp b/addons/compat_sog/CfgWeapons/csw.hpp index 87b1b16c5ec..b5ca942f6e8 100644 --- a/addons/compat_sog/CfgWeapons/csw.hpp +++ b/addons/compat_sog/CfgWeapons/csw.hpp @@ -20,7 +20,7 @@ class GVAR(m2_carry): Launcher_Base_F { modes[] = {}; picture = QPATHTOF(UI\csw_m2b_ca.paa); - class ACE_CSW { + class ace_csw { type = "weapon"; deployTime = 4; pickupTime = 4; @@ -48,7 +48,7 @@ class GVAR(m1919a4_carry): Launcher_Base_F { modes[] = {}; picture = QPATHTOF(UI\csw_m1919a4_ca.paa); - class ACE_CSW { + class ace_csw { type = "weapon"; deployTime = 4; pickupTime = 4; @@ -76,7 +76,7 @@ class GVAR(m1919a6_carry): Launcher_Base_F { modes[] = {}; picture = QPATHTOF(UI\csw_m1919a6_ca.paa); - class ACE_CSW { + class ace_csw { type = "mount"; deployTime = 2; pickupTime = 2; @@ -100,7 +100,7 @@ class GVAR(m60_carry): Launcher_Base_F { modes[] = {}; picture = QPATHTOF(UI\csw_m60_ca.paa); - class ACE_CSW { + class ace_csw { type = "weapon"; deployTime = 4; pickupTime = 4; @@ -128,7 +128,7 @@ class GVAR(tow_carry): Launcher_Base_F { modes[] = {}; picture = QPATHTOF(UI\csw_tow_ca.paa); - class ACE_CSW { + class ace_csw { type = "weapon"; deployTime = 4; pickupTime = 4; @@ -155,7 +155,7 @@ class GVAR(dshkm_carry): Launcher_Base_F { modes[] = {}; picture = QPATHTOF(UI\csw_dshkm_ca.paa); - class ACE_CSW { + class ace_csw { type = "weapon"; deployTime = 4; pickupTime = 4; @@ -183,7 +183,7 @@ class GVAR(dshkm_shield_carry): Launcher_Base_F { modes[] = {}; picture = QPATHTOF(UI\csw_dshkm_shield_ca.paa); - class ACE_CSW { + class ace_csw { type = "weapon"; deployTime = 4; pickupTime = 4; @@ -210,7 +210,7 @@ class GVAR(dshkm_AA_carry): Launcher_Base_F { modes[] = {}; picture = QPATHTOF(UI\csw_dshkm_aa_ca.paa); - class ACE_CSW { + class ace_csw { type = "weapon"; deployTime = 4; pickupTime = 4; @@ -237,7 +237,7 @@ class GVAR(rpd_carry): Launcher_Base_F { modes[] = {}; picture = QPATHTOF(UI\csw_rpd_ca.paa); - class ACE_CSW { + class ace_csw { type = "weapon"; deployTime = 4; pickupTime = 4; @@ -264,7 +264,7 @@ class GVAR(pk_carry): Launcher_Base_F { modes[] = {}; picture = QPATHTOF(UI\csw_pk_ca.paa); - class ACE_CSW { + class ace_csw { type = "weapon"; deployTime = 4; pickupTime = 4; @@ -292,7 +292,7 @@ class GVAR(mortar_m29_carry): Launcher_Base_F { modes[] = {}; picture = QPATHTOF(UI\csw_m29_ca.paa); - class ACE_CSW { + class ace_csw { type = "weapon"; deployTime = 20; pickupTime = 25; @@ -319,7 +319,7 @@ class GVAR(mg42_carry): Launcher_Base_F { modes[] = {}; picture = QPATHTOF(UI\csw_mg42_ca.paa); - class ACE_CSW { + class ace_csw { type = "mount"; deployTime = 4; pickupTime = 4; @@ -347,7 +347,7 @@ class GVAR(sgm_carry): Launcher_Base_F { modes[] = {}; picture = QPATHTOF(UI\csw_sgm_ca.paa); - class ACE_CSW { + class ace_csw { type = "weapon"; deployTime = 4; pickupTime = 4; @@ -374,7 +374,7 @@ class GVAR(sgm_shield_carry): Launcher_Base_F { modes[] = {}; picture = QPATHTOF(UI\csw_sgm_shield_ca.paa); - class ACE_CSW { + class ace_csw { type = "weapon"; deployTime = 4; pickupTime = 4; @@ -401,7 +401,7 @@ class GVAR(mk18_carry): Launcher_Base_F { modes[] = {}; picture = QPATHTOF(UI\csw_mk18_ca.paa); - class ACE_CSW { + class ace_csw { type = "weapon"; deployTime = 4; pickupTime = 4; @@ -430,7 +430,7 @@ class GVAR(mortar_m2_carry): Launcher_Base_F { modes[] = {}; picture = QPATHTOF(UI\csw_m2_ca.paa); - class ACE_CSW { + class ace_csw { type = "weapon"; deployTime = 20; pickupTime = 25; @@ -457,7 +457,7 @@ class GVAR(mortar_type53_carry): Launcher_Base_F { modes[] = {}; picture = QPATHTOF(UI\csw_type53_ca.paa); - class ACE_CSW { + class ace_csw { type = "weapon"; deployTime = 20; pickupTime = 25; diff --git a/addons/compat_sog/compat_sog_refuel/CfgVehicles.hpp b/addons/compat_sog/compat_sog_refuel/CfgVehicles.hpp new file mode 100644 index 00000000000..c3dcfb719e5 --- /dev/null +++ b/addons/compat_sog/compat_sog_refuel/CfgVehicles.hpp @@ -0,0 +1,163 @@ +class CfgVehicles { + // Vehicle animation interactions + // BTR-40 + class vn_wheeled_car_base; + class vn_wheeled_btr40_base: vn_wheeled_car_base { + class EGVAR(interaction,anims) { + class refuel_can_hide { + positions[] = {{0.7, -2.35, -0.9}}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + }; + }; + class vn_wheeled_btr40_01_base: vn_wheeled_btr40_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class refuel_can_hide: refuel_can_hide { + positions[] = {{0.72, -2.35, -0.45}}; + }; + }; + }; + class vn_wheeled_btr40_ambulance_base: vn_wheeled_btr40_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class refuel_can_hide: refuel_can_hide { + positions[] = {{0.72, -2.35, -0.45}}; + }; + }; + }; + class vn_wheeled_btr40_mg_01_base: vn_wheeled_btr40_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class refuel_can_hide: refuel_can_hide { + positions[] = {{0.72, -2.35, -0.9}}; + }; + }; + }; + class vn_wheeled_btr40_mg_03_base: vn_wheeled_btr40_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class refuel_can_hide: refuel_can_hide { + positions[] = {{0.82, -2.35, -1.25}}; + }; + }; + }; + class vn_wheeled_btr40_mg_04_base: vn_wheeled_btr40_mg_01_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class refuel_can_hide: refuel_can_hide { + positions[] = {{0.72, -2.35, -1}}; + }; + }; + }; + class vn_wheeled_btr40_mg_05_base: vn_wheeled_btr40_mg_04_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class refuel_can_hide: refuel_can_hide { + positions[] = {{0.65, -2.25, -1}}; + }; + }; + }; + + // M151 + class vn_wheeled_m151_base: vn_wheeled_car_base { + class EGVAR(interaction,anims) { + class user_refuel_can_hide { + positions[] = {{-0.48, -1.5, -1.1}}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + }; + }; + class vn_wheeled_m151_mg_03_base: vn_wheeled_m151_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class user_refuel_can_hide: user_refuel_can_hide { + positions[] = {{-0.75, -1.5, -1}}; + }; + }; + }; + class vn_wheeled_m151_mg_05_base: vn_wheeled_m151_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class user_refuel_can_hide: user_refuel_can_hide { + positions[] = {{0.9, -0.1, -1.1}}; + }; + }; + }; + class vn_wheeled_m151_mg_06_base: vn_wheeled_m151_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class user_refuel_can_hide: user_refuel_can_hide { + positions[] = {{0.3, 0.1, -1.1}}; + }; + }; + }; + class vn_wheeled_m151_01_base: vn_wheeled_m151_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class user_refuel_can_hide: user_refuel_can_hide { + positions[] = {{-0.4, -1.5, -0.7}}; + }; + }; + }; + + // M577 + class vn_armor_m113_base; + class vn_armor_m577_base: vn_armor_m113_base { + class EGVAR(interaction,anims) { + class hide_fuel_cans { + selections[] = {"hide_fuel_cans"}; + positions[] = {{1.07, 1.05, -1}}; + items[] = {"Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + }; + }; + + // M48 + class vn_armor_tank_base; + class vn_armor_m48_base: vn_armor_tank_base { + class EGVAR(interaction,anims) { + class hide_mainturret_jerrycan { + positions[] = {"_target selectionPosition ['hide_jerrycan', 'FireGeometry', 'AveragePoint']"}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + }; + }; + + // BTR-50PK + class vn_armor_btr50pk_base: vn_armor_tank_base { + class EGVAR(interaction,anims) { + class hide_barrels { + selections[] = {"hide_barrels"}; + positions[] = {"private _pos = _target selectionPosition 'hide_barrels'; _pos set [0, -(_pos select 0)]; _pos"}; // Mirror position to other side of vehicle + items[] = {"Land_CanisterFuel_F", "Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + }; + }; + + // PT-76 + class vn_armor_pt76_base: vn_armor_tank_base { + class EGVAR(interaction,anims) { + class hide_barrels { + selections[] = {"hide_barrels"}; + positions[] = {"private _pos = _target selectionPosition 'hide_barrels'; _pos set [0, -(_pos select 0)]; _pos"}; // Mirror position to other side of vehicle + items[] = {"Land_CanisterFuel_F", "Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + }; + }; + + // Type 63 + class vn_armor_type63_base: vn_armor_tank_base { + class EGVAR(interaction,anims) { + class hide_barrels { + selections[] = {"hide_barrels"}; + positions[] = {"private _pos = _target selectionPosition 'hide_barrels'; _pos set [0, -(_pos select 0)]; _pos"}; // Mirror position to other side of vehicle + items[] = {"Land_CanisterFuel_F", "Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + }; + }; +}; diff --git a/addons/compat_sog/compat_sog_refuel/config.cpp b/addons/compat_sog/compat_sog_refuel/config.cpp new file mode 100644 index 00000000000..793cf90fc4e --- /dev/null +++ b/addons/compat_sog/compat_sog_refuel/config.cpp @@ -0,0 +1,18 @@ +#include "script_component.hpp" + +class CfgPatches { + class SUBADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"loadorder_f_vietnam", "ace_refuel"}; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {"johnb43"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + }; +}; + +#include "CfgVehicles.hpp" diff --git a/addons/compat_sog/compat_sog_refuel/script_component.hpp b/addons/compat_sog/compat_sog_refuel/script_component.hpp new file mode 100644 index 00000000000..af997fb8d4d --- /dev/null +++ b/addons/compat_sog/compat_sog_refuel/script_component.hpp @@ -0,0 +1,3 @@ +#define SUBCOMPONENT refuel +#define SUBCOMPONENT_BEAUTIFIED refuel +#include "..\script_component.hpp" diff --git a/addons/compat_sog/compat_sog_repair/CfgVehicles.hpp b/addons/compat_sog/compat_sog_repair/CfgVehicles.hpp new file mode 100644 index 00000000000..de93243251e --- /dev/null +++ b/addons/compat_sog/compat_sog_repair/CfgVehicles.hpp @@ -0,0 +1,141 @@ +class CfgVehicles { + // Vehicle animation interactions + // M39 / M54 / M49 + class vn_wheeled_truck_base; + class vn_wheeled_m54_base: vn_wheeled_truck_base { + class EGVAR(interaction,anims) { + class user_sparewheel_hide { + positions[] = {"_target selectionPosition ['hide_spare_wheel', 'FireGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + class vn_wheeled_m54_mg_01_base: vn_wheeled_m54_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class user_sparewheel_hide: user_sparewheel_hide { + items[] = {"ACE_Wheel", "ACE_Wheel", "ACE_Wheel", "ACE_Wheel"}; + }; + }; + }; + + // M151 + class vn_wheeled_car_base; + class vn_wheeled_m151_base: vn_wheeled_car_base { + class EGVAR(interaction,anims) { + class user_sparewheel_hide { + positions[] = {"_target selectionPosition ['hide_sparewheel', 'ViewGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + + // Dirt Ranger + class vn_wheeled_lr2a_base: vn_wheeled_car_base { + class EGVAR(interaction,anims) { + class hide_sparewheel { + positions[] = {"_target selectionPosition ['hide_sparewheel', 'ViewGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + + // BTR-40 + class vn_wheeled_btr40_base: vn_wheeled_car_base { + class EGVAR(interaction,anims) { + class sparewheel_hide { + positions[] = {"_target selectionPosition ['hide_sparewheel', 'ViewGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + + // M48 + class vn_armor_tank_base; + class vn_armor_m48_base: vn_armor_tank_base { + class EGVAR(interaction,anims) { + class hide_mainturret_tracks { + // Rotate interactions with turret rotation + positions[] = { + "[[1.3, 0.2, -0.5], [0, 0, 1], deg (_target animationPhase 'MainTurret')] call CBA_fnc_vectRotate3D", + "[[-1.3, 0.2, -0.5], [0, 0, 1], deg (_target animationPhase 'MainTurret')] call CBA_fnc_vectRotate3D" + }; + items[] = {"ACE_Track", "ACE_Track", "ACE_Track", "ACE_Track", "ACE_Track"}; + name = ECSTRING(repair,RemoveTrack); + text = ECSTRING(repair,RemovingTrack); + }; + }; + }; + + // BTR-50PK + class vn_armor_btr50pk_base: vn_armor_tank_base { + class EGVAR(interaction,anims) { + class hide_tracks { + positions[] = {{1.35, 2.5, -0.5}}; + items[] = {"ACE_Track"}; + name = ECSTRING(repair,RemoveTrack); + text = ECSTRING(repair,RemovingTrack); + }; + }; + }; + class vn_armor_btr50pk_01_base: vn_armor_btr50pk_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_tracks: hide_tracks { + positions[] = {{1.35, 2.5, -0.8}}; + }; + }; + }; + + class vn_armor_btr50pk_02_base: vn_armor_btr50pk_01_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_tracks: hide_tracks { + positions[] = {{1.35, 2.9, -0.8}}; + }; + }; + }; + + // T-54 + class vn_armor_t54_base: vn_armor_tank_base { + class EGVAR(interaction,anims) { + class hide_tracks { + positions[] = {{1.4, 2.1, -1.7}}; + items[] = {"ACE_Track"}; + name = ECSTRING(repair,RemoveTrack); + text = ECSTRING(repair,RemovingTrack); + }; + }; + }; + + // PT-76 + class vn_armor_pt76_base: vn_armor_tank_base { + class EGVAR(interaction,anims) { + class hide_tracks { + // Rotate interactions with turret rotation + positions[] = {"[0, 0.9, 0] vectorAdd ([[-0.6, -0.9, -0.3], [0, 0, 1], deg (_target animationPhase 'MainTurret')] call CBA_fnc_vectRotate3D)"}; + items[] = {"ACE_Track"}; + name = ECSTRING(repair,RemoveTrack); + text = ECSTRING(repair,RemovingTrack); + }; + }; + }; + + // Type 63 + class vn_armor_type63_base: vn_armor_tank_base { + class EGVAR(interaction,anims) { + class hide_tracks { + // Rotate interactions with turret rotation + positions[] = {"[0, 0.7, 0] vectorAdd ([[0.4, -1.1, -0.4], [0, 0, 1], deg (_target animationPhase 'MainTurret')] call CBA_fnc_vectRotate3D)"}; + items[] = {"ACE_Track"}; + name = ECSTRING(repair,RemoveTrack); + text = ECSTRING(repair,RemovingTrack); + }; + }; + }; +}; diff --git a/addons/compat_sog/compat_sog_repair/config.cpp b/addons/compat_sog/compat_sog_repair/config.cpp new file mode 100644 index 00000000000..b2cffd8a364 --- /dev/null +++ b/addons/compat_sog/compat_sog_repair/config.cpp @@ -0,0 +1,18 @@ +#include "script_component.hpp" + +class CfgPatches { + class SUBADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"loadorder_f_vietnam", "ace_repair"}; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {"johnb43"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + }; +}; + +#include "CfgVehicles.hpp" diff --git a/addons/compat_sog/compat_sog_repair/script_component.hpp b/addons/compat_sog/compat_sog_repair/script_component.hpp new file mode 100644 index 00000000000..1af928486c3 --- /dev/null +++ b/addons/compat_sog/compat_sog_repair/script_component.hpp @@ -0,0 +1,3 @@ +#define SUBCOMPONENT repair +#define SUBCOMPONENT_BEAUTIFIED Repair +#include "..\script_component.hpp" diff --git a/addons/compat_sog/compat_sog_trenches/CfgVehicles.hpp b/addons/compat_sog/compat_sog_trenches/CfgVehicles.hpp index bb222eaed16..bc67a39f784 100644 --- a/addons/compat_sog/compat_sog_trenches/CfgVehicles.hpp +++ b/addons/compat_sog/compat_sog_trenches/CfgVehicles.hpp @@ -60,4 +60,199 @@ class CfgVehicles { class EGVAR(compat_sog,spiderhole_03_nogeo): vn_o_vc_spiderhole_03 { scope = 1; }; + + // Vehicle animation interactions + // BTR-40 + class vn_wheeled_car_base; + class vn_wheeled_btr40_base: vn_wheeled_car_base { + class EGVAR(interaction,anims) { + class shovel_hide { + positions[] = {{0.95, -1.5, -0.75}}; + items[] = {"ACE_EntrenchingTool"}; + name = ECSTRING(trenches,EntrenchingToolName); + text = ECSTRING(trenches,EntrenchingToolName); + }; + }; + }; + class vn_wheeled_btr40_01_base: vn_wheeled_btr40_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class shovel_hide: shovel_hide { + positions[] = {{0.95, -1.5, -0.3}}; + }; + }; + }; + class vn_wheeled_btr40_ambulance_base: vn_wheeled_btr40_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class shovel_hide: shovel_hide { + positions[] = {{0.95, -1.5, -0.3}}; + }; + }; + }; + class vn_wheeled_btr40_mg_01_base: vn_wheeled_btr40_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class shovel_hide: shovel_hide { + positions[] = {{0.95, -1.5, -0.8}}; + }; + }; + }; + class vn_wheeled_btr40_mg_03_base: vn_wheeled_btr40_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class shovel_hide: shovel_hide { + positions[] = {{1.05, -1.55, -1.1}}; + }; + }; + }; + class vn_wheeled_btr40_mg_04_base: vn_wheeled_btr40_mg_01_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class shovel_hide: shovel_hide { + positions[] = {{0.95, -1.5, -0.85}}; + }; + }; + }; + class vn_wheeled_btr40_mg_05_base: vn_wheeled_btr40_mg_04_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class shovel_hide: shovel_hide { + positions[] = {{0.9, -1.4, -0.85}}; + }; + }; + }; + + // Dirt Ranger + class vn_wheeled_lr2a_base: vn_wheeled_car_base { + class EGVAR(interaction,anims) { + class hide_shovel { + positions[] = {"_target selectionPosition ['hide_shovel', 'FireGeometry', 'AveragePoint']"}; + items[] = {"ACE_EntrenchingTool"}; + name = ECSTRING(trenches,EntrenchingToolName); + text = ECSTRING(trenches,EntrenchingToolName); + }; + }; + }; + + // M151 + class vn_wheeled_m151_base: vn_wheeled_car_base { + class EGVAR(interaction,anims) { + class user_shovel_hide { + positions[] = {{0.65, 0.2, -1.4}}; + items[] = {"ACE_EntrenchingTool"}; + name = ECSTRING(trenches,EntrenchingToolName); + text = ECSTRING(trenches,EntrenchingToolName); + }; + }; + }; + class vn_wheeled_m151_mg_03_base: vn_wheeled_m151_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class user_shovel_hide: user_shovel_hide { + positions[] = {{0.35, 0.2, -1.27}}; + }; + }; + }; + class vn_wheeled_m151_mg_05_base: vn_wheeled_m151_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class user_shovel_hide: user_shovel_hide { + enabled = 0; + }; + }; + }; + class vn_wheeled_m151_mg_06_base: vn_wheeled_m151_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class user_shovel_hide: user_shovel_hide { + enabled = 0; + }; + }; + }; + class vn_wheeled_m151_01_base: vn_wheeled_m151_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class user_shovel_hide: user_shovel_hide { + positions[] = {{0.72, 0.2, -0.92}}; + }; + }; + }; + + // M113 + class APC_Tracked_01_base_F; + class vn_armor_m113_base: APC_Tracked_01_base_F { + class EGVAR(interaction,anims) { + class hide_shovel { + positions[] = {{0.2, 2.2, -0.5}}; + items[] = {"ACE_EntrenchingTool"}; + name = ECSTRING(trenches,EntrenchingToolName); + text = ECSTRING(trenches,EntrenchingToolName); + }; + }; + }; + class vn_armor_m113_01_base: vn_armor_m113_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_shovel: hide_shovel {}; + }; + }; + class vn_armor_m132_base: vn_armor_m113_01_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_shovel: hide_shovel { + positions[] = {{0.2, 2.2, -0.35}}; + }; + }; + }; + + // Don't inherit, as it's easier for the refuel compat + // M577 + class vn_armor_m577_base: vn_armor_m113_base { + class EGVAR(interaction,anims) { + class hide_shovel { + positions[] = {{0.2, 5.05, -0.57}}; + items[] = {"ACE_EntrenchingTool"}; + name = ECSTRING(trenches,EntrenchingToolName); + text = ECSTRING(trenches,EntrenchingToolName); + }; + }; + }; + + // M48 + class vn_armor_tank_base; + class vn_armor_m48_base: vn_armor_tank_base { + class EGVAR(interaction,anims) { + class hide_mainturret_tools { + positions[] = {"_target selectionPosition ['hide_tools', 'FireGeometry', 'AveragePoint']"}; + items[] = {"ACE_EntrenchingTool"}; + name = ECSTRING(trenches,EntrenchingToolName); + text = ECSTRING(trenches,EntrenchingToolName); + }; + }; + }; + + // BTR-50PK + class vn_armor_btr50pk_base: vn_armor_tank_base { + class EGVAR(interaction,anims) { + class hide_shovel { + positions[] = {"_target selectionPosition ['hide_shovel', 'FireGeometry', 'AveragePoint']"}; + items[] = {"ACE_EntrenchingTool", "ACE_EntrenchingTool"}; + name = ECSTRING(trenches,EntrenchingToolName); + text = ECSTRING(trenches,EntrenchingToolName); + }; + }; + }; + + // PT-76 + class vn_armor_pt76_base: vn_armor_tank_base { + class EGVAR(interaction,anims) { + class hide_shovel { + positions[] = {"_target selectionPosition ['hide_shovel', 'FireGeometry', 'AveragePoint']"}; + items[] = {"ACE_EntrenchingTool"}; + name = ECSTRING(trenches,EntrenchingToolName); + text = ECSTRING(trenches,EntrenchingToolName); + }; + }; + }; + + // Type 63 + class vn_armor_type63_base: vn_armor_tank_base { + class EGVAR(interaction,anims) { + class hide_shovel { + positions[] = {"_target selectionPosition ['hide_shovel', 'FireGeometry', 'AveragePoint']"}; + items[] = {"ACE_EntrenchingTool"}; + name = ECSTRING(trenches,EntrenchingToolName); + text = ECSTRING(trenches,EntrenchingToolName); + }; + }; + }; }; diff --git a/addons/compat_spe/CfgMagazines/csw.hpp b/addons/compat_spe/CfgMagazines/csw.hpp index 404156bd8f8..6b4c385a42a 100644 --- a/addons/compat_spe/CfgMagazines/csw.hpp +++ b/addons/compat_spe/CfgMagazines/csw.hpp @@ -2,43 +2,16 @@ class CA_Magazine; // M1919A4/A6 class SPE_50Rnd_762x63: CA_Magazine { - ACE_isBelt = 0; -}; - -class SPE_100Rnd_762x63: SPE_50Rnd_762x63 { - ACE_isBelt = 1; -}; - -class SPE_100Rnd_762x63_M1: SPE_100Rnd_762x63 { ACE_isBelt = 1; }; -class SPE_100Rnd_762x63_M2_AP: SPE_100Rnd_762x63 { +// M2 +class VehicleMagazine; +class SPE_100Rnd_127x99_M2: VehicleMagazine { ACE_isBelt = 1; }; -//MG34/42 - +// MG34/42 class SPE_50Rnd_792x57: CA_Magazine { - ACE_isBelt = 0; -}; - -class SPE_50Rnd_792x57_sS: SPE_50Rnd_792x57 { - ACE_isBelt = 0; -}; - -class SPE_50Rnd_792x57_SMK: SPE_50Rnd_792x57_sS { - ACE_isBelt = 0; -}; - -class SPE_100Rnd_792x57: SPE_50Rnd_792x57 { - ACE_isBelt = 1; -}; - -class SPE_100Rnd_792x57_sS: SPE_50Rnd_792x57_sS { - ACE_isBelt = 1; -}; - -class SPE_100Rnd_792x57_SMK: SPE_50Rnd_792x57_SMK { ACE_isBelt = 1; }; diff --git a/addons/compat_spe/CfgVehicles/wheeled.hpp b/addons/compat_spe/CfgVehicles/wheeled.hpp index 6ed68dfbdfb..f645db29e64 100644 --- a/addons/compat_spe/CfgVehicles/wheeled.hpp +++ b/addons/compat_spe/CfgVehicles/wheeled.hpp @@ -56,8 +56,12 @@ class SPE_OpelBlitz_Ammo: SPE_OpelBlitz_base { EGVAR(rearm,defaultSupply) = 1200; }; -// WHEELED - ALLIED FORCES +class SPE_OpelBlitz_Fuel: SPE_OpelBlitz_base { + EGVAR(refuel,hooks)[] = {{-0.23, -2.58, -0.59}}; + EGVAR(refuel,fuelCargo) = 2000; +}; +// WHEELED - ALLIED FORCES class SPE_US_M3_Halftrack_Ambulance: SPE_Halftrack_base { EGVAR(medical,medicClass) = 1; }; @@ -69,3 +73,69 @@ class SPE_US_M3_Halftrack_Repair: SPE_Halftrack_base { class SPE_US_M3_Halftrack_Ammo: SPE_Halftrack_base { EGVAR(rearm,defaultSupply) = 1200; }; + +class SPE_US_M3_Halftrack_Fuel: SPE_Halftrack_base { + EGVAR(refuel,hooks)[] = {{-0.23, -2.58, -0.59}}; + EGVAR(refuel,fuelCargo) = 2000; +}; + +class SPE_Car_base; +class SPE_G503_MB_base: SPE_Car_base { + class EGVAR(interaction,anims) { + class hide_musette_source { + positions[] = {{0.8, -0.97, -0.6}, {-0.8, -0.92, -0.6}}; + items[] = {"B_SPE_US_M36", "B_SPE_US_M36"}; + name = "$STR_CTH_B_SPE_US_M36"; + text = "$STR_CTH_B_SPE_US_M36"; + }; + }; +}; +class SPE_US_G503_MB_M1919_base: SPE_G503_MB_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_musette_source: hide_musette_source { + positions[] = {{0.8, -0.5, -0.6}, {-0.8, -0.45, -0.6}}; + }; + }; +}; +class SPE_US_G503_MB_M1919_Armoured_base: SPE_G503_MB_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_musette_source: hide_musette_source { + positions[] = {{0.8, -0.5, -0.6}, {-0.8, -0.45, -0.6}}; + }; + }; +}; +class SPE_US_G503_MB_M1919_PATROL_base: SPE_G503_MB_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_musette_source: hide_musette_source { + positions[] = {{0.8, -0.5, -0.6}, {-0.8, -0.45, -0.6}}; + }; + }; +}; +class SPE_US_G503_MB_M2_base: SPE_G503_MB_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_musette_source: hide_musette_source { + positions[] = {{0.8, -0.5, -0.6}, {-0.8, -0.45, -0.6}}; + }; + }; +}; +class SPE_US_G503_MB_M2_Armoured_base: SPE_G503_MB_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_musette_source: hide_musette_source { + positions[] = {{0.8, -0.5, -0.6}, {-0.8, -0.45, -0.6}}; + }; + }; +}; +class SPE_US_G503_MB_M2_PATROL_base: SPE_G503_MB_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_musette_source: hide_musette_source { + positions[] = {{0.8, -0.5, -0.6}, {-0.8, -0.45, -0.6}}; + }; + }; +}; +class SPE_G503_MB_Ambulance_base: SPE_G503_MB_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_musette_source: hide_musette_source { + positions[] = {{0.8, -0.5, -0.6}, {-0.8, -0.45, -0.6}}; + }; + }; +}; diff --git a/addons/compat_spe/compat_spe_csw/ACE_CSW_Groups.hpp b/addons/compat_spe/compat_spe_csw/ACE_CSW_Groups.hpp deleted file mode 100644 index 35758ed5333..00000000000 --- a/addons/compat_spe/compat_spe_csw/ACE_CSW_Groups.hpp +++ /dev/null @@ -1,50 +0,0 @@ -class ACE_CSW_Groups { - - // --- Gun Turrets ------------------------------------------------------------- - - class SPE_100Rnd_762x63 { - SPE_100Rnd_762x63 = 1; - }; - - class SPE_100Rnd_762x63_M1 { - SPE_100Rnd_762x63_M1 = 1; - }; - - class SPE_100Rnd_762x63_M2_AP { - SPE_100Rnd_762x63_M2_AP = 1; - }; - - class SPE_100Rnd_792x57 { - SPE_100Rnd_792x57 = 1; - }; - - class SPE_100Rnd_792x57_sS { - SPE_100Rnd_792x57_sS = 1; - }; - - class SPE_100Rnd_792x57_SMK { - SPE_100Rnd_792x57_SMK = 1; - }; - - // --- Mortars ------------------------------------------------------------- - - class SPE_1Rnd_81mmHE_M1_M43A1 { - SPE_1Rnd_81mmHE_M1_M43A1 = 1; - }; - class SPE_1Rnd_81mmWP_M1_M57 { - SPE_1Rnd_81mmWP_M1_M57 = 1; - }; - class SPE_81mm_M1_M57_SmokeShell { - SPE_81mm_M1_M57_SmokeShell = 1; - }; - - class SPE_1Rnd_81mm_FA_Mle_1932_HE { - SPE_1Rnd_81mm_FA_Mle_1932_HE = 1; - }; - class SPE_81mm_FA_Mle_1932_Smoke { - SPE_81mm_FA_Mle_1932_Smoke = 1; - }; - class SPE_81mm_FA_Mle_1932_Illu { - SPE_81mm_FA_Mle_1932_Illu = 1; - }; -}; diff --git a/addons/compat_spe/compat_spe_csw/CfgMagazineGroups.hpp b/addons/compat_spe/compat_spe_csw/CfgMagazineGroups.hpp new file mode 100644 index 00000000000..78f6d0629dd --- /dev/null +++ b/addons/compat_spe/compat_spe_csw/CfgMagazineGroups.hpp @@ -0,0 +1,94 @@ +class EGVAR(csw,groups) { + // --- Gun Turrets ------------------------------------------------------------- + class SPE_50Rnd_762x63 { + SPE_50Rnd_762x63 = 1; + }; + class SPE_100Rnd_762x63 { + SPE_100Rnd_762x63 = 1; + }; + + class SPE_50Rnd_762x63_M1 { + SPE_50Rnd_762x63_M1 = 1; + }; + class SPE_100Rnd_762x63_M1 { + SPE_100Rnd_762x63_M1 = 1; + }; + + class SPE_50Rnd_762x63_M2_AP { + SPE_50Rnd_762x63_M2_AP = 1; + }; + class SPE_100Rnd_762x63_M2_AP { + SPE_100Rnd_762x63_M2_AP = 1; + }; + + class SPE_50Rnd_762x63_Tracer { + SPE_50Rnd_762x63_Tracer = 1; + }; + class SPE_100Rnd_762x63_Tracer { + SPE_100Rnd_762x63_Tracer = 1; + }; + + class SPE_50Rnd_792x57 { + SPE_50Rnd_792x57 = 1; + }; + class SPE_100Rnd_792x57 { + SPE_100Rnd_792x57 = 1; + SPE_250Rnd_792x57 = 1; + }; + + class SPE_50Rnd_792x57_sS { + SPE_50Rnd_792x57_sS = 1; + }; + class SPE_100Rnd_792x57_sS { + SPE_100Rnd_792x57_sS = 1; + SPE_250Rnd_792x57_sS = 1; + }; + + class SPE_50Rnd_792x57_SMK { + SPE_50Rnd_792x57_SMK = 1; + }; + class SPE_100Rnd_792x57_SMK { + SPE_100Rnd_792x57_SMK = 1; + SPE_250Rnd_792x57_SMK = 1; + }; + + class SPE_50Rnd_792x57_Tracer { + SPE_50Rnd_792x57_Tracer = 1; + }; + class SPE_100Rnd_792x57_Tracer { + SPE_100Rnd_792x57_Tracer = 1; + }; + + // Makes it compatible with other mods' .50 BMG + class EGVAR(csw,100Rnd_127x99_mag) { + SPE_100Rnd_127x99_M2 = 1; + }; + class SPE_100Rnd_127x99_M2: EGVAR(csw,100Rnd_127x99_mag) {}; + + // --- Mortars ------------------------------------------------------------- + class SPE_1Rnd_81mmHE_M1_M43A1 { + SPE_8Rnd_81mmHE_M1_M43A1 = 1; + SPE_1Rnd_81mmHE_M1_M43A1 = 1; + }; + class SPE_1Rnd_81mmWP_M1_M57 { + SPE_8Rnd_81mmWP_M1_M57 = 1; + SPE_1Rnd_81mmWP_M1_M57 = 1; + }; + class SPE_81mm_M1_M57_SmokeShell { + SPE_8rnd_81mm_M1_M57_SmokeShell = 1; + SPE_81mm_M1_M57_SmokeShell = 1; + }; + + class SPE_1Rnd_81mm_FA_Mle_1932_HE { + SPE_8Rnd_81mm_FA_Mle_1932_HE = 1; + SPE_1Rnd_81mm_FA_Mle_1932_HE = 1; + }; + class SPE_81mm_FA_Mle_1932_Smoke { + SPE_8Rnd_81mm_FA_Mle_1932_Smoke = 1; + SPE_81mm_FA_Mle_1932_Smoke = 1; + }; + class SPE_81mm_FA_Mle_1932_Illu { + SPE_8Rnd_81mm_FA_Mle_1932_Illu = 1; + SPE_81mm_FA_Mle_1932_Illu = 1; + }; +}; diff --git a/addons/compat_spe/compat_spe_csw/CfgMagazines.hpp b/addons/compat_spe/compat_spe_csw/CfgMagazines.hpp new file mode 100644 index 00000000000..9c255c28008 --- /dev/null +++ b/addons/compat_spe/compat_spe_csw/CfgMagazines.hpp @@ -0,0 +1,26 @@ +// In SPE 1.1.1, the tracer magazines don't have proper names +class CfgMagazines { + class SPE_50Rnd_762x63; + class SPE_50Rnd_762x63_Tracer: SPE_50Rnd_762x63 { + displayName = SUBCSTRING(50Rnd_762x63_Tracer); + displayNameShort = "$STR_A3_tracer_dns"; + }; + + class SPE_100Rnd_762x63; + class SPE_100Rnd_762x63_Tracer: SPE_100Rnd_762x63 { + displayName = SUBCSTRING(100Rnd_762x63_Tracer); + displayNameShort = "$STR_A3_tracer_dns"; + }; + + class SPE_50Rnd_792x57; + class SPE_50Rnd_792x57_Tracer: SPE_50Rnd_792x57 { + displayName = SUBCSTRING(50Rnd_792x57_Tracer); + displayNameShort = "$STR_A3_tracer_dns"; + }; + + class SPE_100Rnd_792x57; + class SPE_100Rnd_792x57_Tracer: SPE_100Rnd_792x57 { + displayName = SUBCSTRING(100Rnd_792x57_Tracer); + displayNameShort = "$STR_A3_tracer_dns"; + }; +}; diff --git a/addons/compat_spe/compat_spe_csw/CfgVehicles.hpp b/addons/compat_spe/compat_spe_csw/CfgVehicles.hpp index e0a38aa341c..30d39301f38 100644 --- a/addons/compat_spe/compat_spe_csw/CfgVehicles.hpp +++ b/addons/compat_spe/compat_spe_csw/CfgVehicles.hpp @@ -9,90 +9,267 @@ class CfgVehicles { class ACE_Actions { class ACE_MainActions; }; - class Turrets { - class MainTurret; + }; + + // --- Gun Turrets ------------------------------------------------------------- + class StaticMGWeapon: StaticWeapon {}; + class SPE_StaticMGWeapon_base: StaticMGWeapon {}; + class SPE_M2_M3: SPE_StaticMGWeapon_base { + class ACE_Actions: ACE_Actions { + class ACE_MainActions: ACE_MainActions { + position = ""; + selection = "zamerny"; + }; + }; + class ace_csw { + enabled = 1; + proxyWeapon = QGVAR(M2_proxy); + magazineLocation = ""; + disassembleWeapon = "SPE_M2_50"; + disassembleTurret = QGVAR(m3Tripod); + ammoLoadTime = 10; + ammoUnloadTime = 8; + desiredAmmo = 100; + }; + }; + class SPE_M2_M3_Trench: SPE_M2_M3 { + class ace_csw: ace_csw { + disassembleWeapon = ""; + disassembleTurret = ""; }; - class UserActions; }; - // --- Mortars ----------------------------------------------------------------- - class StaticMortar: StaticWeapon { - class Turrets: Turrets { - class MainTurret: MainTurret {}; + + class SPE_M1919_M2: SPE_StaticMGWeapon_base { + class ace_csw { + enabled = 1; + proxyWeapon = QGVAR(M1919A4_proxy); + magazineLocation = "_target selectionPosition ['magazine', 'FireGeometry', 'AveragePoint']"; + disassembleWeapon = "SPE_M1919A4"; + disassembleTurret = QGVAR(m2Tripod); + ammoLoadTime = 8; + ammoUnloadTime = 6; + desiredAmmo = 100; }; }; - class SPE_StaticMortar_base: StaticMortar { - class Turrets: Turrets { - class MainTurret: MainTurret {}; + class SPE_M1919_M2_Trench_Deployed: SPE_M1919_M2 { + class ace_csw: ace_csw { + disassembleWeapon = ""; + disassembleTurret = ""; }; - class EventHandlers: EventHandlers { - class SPE_StaticWeaponsHandler { - init = ""; + }; + + + class SPE_MG42_Lafette: SPE_StaticMGWeapon_base { + class ACE_Actions: ACE_Actions { + class ACE_MainActions: ACE_MainActions { + class GVAR(alterHeight) { + condition = "getText (configOf _target >> 'SPE_AltHeight_Tripod_Name') != '' && {[_target, true] call SPE_WEAPONS_STATIC_fnc_can_alter_height}"; + displayName = "$STR_SPE_DN_ASSETS_VEHICLES_ADJUST_TRIPOD_HEIGHT"; + statement = "[_target, getText (configOf _target >> 'SPE_AltHeight_Tripod_Name'), true] call SPE_Weapons_Static_fnc_alter_height"; + icon = "\A3\Ui_f\data\IGUI\Cfg\Actions\repair_ca.paa"; + modifierFunction = "(_this select 3) set [1, format [localize 'STR_SPE_DN_ASSETS_VEHICLES_ADJUST_TRIPOD_HEIGHT', getText (configOf _target >> 'displayName')]]"; + }; }; }; }; + class SPE_MG42_Lafette_Deployed: SPE_MG42_Lafette { + class ace_csw { + enabled = 1; + proxyWeapon = QGVAR(MG42_proxy); + magazineLocation = ""; + disassembleWeapon = "SPE_MG42"; + disassembleTurret = QGVAR(LafetteTripod); + ammoLoadTime = 7; + ammoUnloadTime = 5; + desiredAmmo = 100; + }; + }; + class SPE_MG34_Lafette_Deployed: SPE_MG42_Lafette { + class ace_csw { + enabled = 1; + proxyWeapon = QGVAR(MG34_proxy); + magazineLocation = ""; + disassembleWeapon = "SPE_MG34"; + disassembleTurret = QGVAR(LafetteTripod); + ammoLoadTime = 7; + ammoUnloadTime = 5; + desiredAmmo = 100; + }; + }; - class SPE_US_Mortar_base: SPE_StaticMortar_base {}; - class SPE_M1_81: SPE_US_Mortar_base { - class Turrets: Turrets { - class MainTurret: MainTurret { - magazines[] = {}; + class SPE_MG42_Lafette_low; + class SPE_MG42_Lafette_low_Deployed: SPE_MG42_Lafette_low { + class ace_csw { + enabled = 1; + proxyWeapon = QGVAR(MG42_proxy); + magazineLocation = ""; + disassembleWeapon = "SPE_MG42"; + disassembleTurret = QGVAR(LafetteTripodLow); + ammoLoadTime = 7; + ammoUnloadTime = 5; + desiredAmmo = 100; + }; + }; + class SPE_MG42_Lafette_trench_Deployed: SPE_MG42_Lafette_low_Deployed { + class ace_csw: ace_csw { + disassembleWeapon = ""; + disassembleTurret = ""; + }; + }; + + class SPE_MG34_Lafette_low_Deployed: SPE_MG42_Lafette_low { + class ace_csw { + enabled = 1; + proxyWeapon = QGVAR(MG34_proxy); + magazineLocation = ""; + disassembleWeapon = "SPE_MG34"; + disassembleTurret = QGVAR(LafetteTripodLow); + ammoLoadTime = 7; + ammoUnloadTime = 5; + desiredAmmo = 100; + }; + }; + class SPE_MG34_Lafette_Trench_Deployed: SPE_MG34_Lafette_low_Deployed { + class ace_csw: ace_csw { + disassembleWeapon = ""; + disassembleTurret = ""; + }; + }; + + + class SPE_MG_Bipod_base; + class SPE_M1919A6_Bipod: SPE_MG_Bipod_base { + class ace_csw { + enabled = 1; + proxyWeapon = QGVAR(M1919A6_proxy); + magazineLocation = ""; + disassembleWeapon = ""; + disassembleTurret = ""; + ammoLoadTime = 8; + ammoUnloadTime = 6; + desiredAmmo = 100; + }; + }; + + + class SPE_MG42_Bipod: SPE_MG_Bipod_base { + class ace_csw { + enabled = 1; + proxyWeapon = QGVAR(MG42_proxy); + magazineLocation = ""; + disassembleWeapon = ""; + disassembleTurret = ""; + ammoLoadTime = 7; + ammoUnloadTime = 5; + desiredAmmo = 100; + }; + }; + class SPE_MG34_Bipod: SPE_MG_Bipod_base { + class ace_csw { + enabled = 1; + proxyWeapon = QGVAR(MG34_proxy); + magazineLocation = ""; + disassembleWeapon = ""; + disassembleTurret = ""; + ammoLoadTime = 7; + ammoUnloadTime = 5; + desiredAmmo = 100; + }; + }; + + + class ThingX; + class EGVAR(csw,baseTripod): ThingX { + class ACE_Actions { + class ACE_MainActions; + }; + }; + class GVAR(m3Tripod): EGVAR(csw,baseTripod) { + scope = 2; + displayName = "$STR_DN_SPE_M3_Tripod"; + model = "\WW2\SPE_Assets_m\Vehicles\StaticWeapons_U1_m\SPE_M3_Tripod.p3d"; + picture = "\WW2\SPE_Assets_t\Weapons\Equipment_U1_t\Weapons\Launchers\Gear_M3_Tripod_X_ca.paa"; + class ace_csw { + disassembleTo = "SPE_M3_Tripod"; + }; + }; + + class GVAR(m2Tripod): EGVAR(csw,baseTripod) { + scope = 2; + displayName = "$STR_DN_SPE_M2_Tripod"; + model = "\WW2\SPE_Assets_m\Vehicles\StaticWeapons_m\SPE_M2_Tripod_Low.p3d"; + picture = "\WW2\SPE_Assets_t\Weapons\Equipment_t\Weapons\Launchers\Gear_M2_Tripod_X_ca.paa"; + class ace_csw { + disassembleTo = "SPE_M2_Tripod"; + }; + }; + + class GVAR(LafetteTripodLow): EGVAR(csw,baseTripod) { + class ACE_Actions: ACE_Actions { + class ACE_MainActions: ACE_MainActions { + class GVAR(alterHeight) { + condition = "getText (configOf _target >> 'SPE_AltHeight_Tripod_Name') != '' && {[_target, true] call SPE_WEAPONS_STATIC_fnc_can_alter_height}"; + displayName = "$STR_SPE_DN_ASSETS_VEHICLES_ADJUST_TRIPOD_HEIGHT"; + statement = "[_target, getText (configOf _target >> 'SPE_AltHeight_Tripod_Name'), true] call SPE_Weapons_Static_fnc_alter_height"; + icon = "\A3\Ui_f\data\IGUI\Cfg\Actions\repair_ca.paa"; + modifierFunction = "(_this select 3) set [1, format [localize 'STR_SPE_DN_ASSETS_VEHICLES_ADJUST_TRIPOD_HEIGHT', getText (configOf _target >> 'displayName')]]"; + }; }; }; + scope = 2; + displayName = "$STR_DN_SPE_Lafette_Tripod"; + model = "\WW2\SPE_Assets_m\Vehicles\StaticWeapons_m\SPE_Lafette_Tripod_Low.p3d"; + picture = "\WW2\SPE_Assets_t\Weapons\Equipment_t\Weapons\Launchers\Gear_Lafette_Tripod_X_ca.paa"; + SPE_AltHeight_Tripod_Name = QGVAR(LafetteTripod); + class ace_csw { + disassembleTo = "SPE_Lafette_Tripod"; + }; + }; + + class GVAR(LafetteTripod): GVAR(LafetteTripodLow) { + model = "\WW2\SPE_Assets_m\Vehicles\StaticWeapons_m\SPE_Lafette_Tripod_High.p3d"; + SPE_AltHeight_Tripod_Name = QGVAR(LafetteTripodLow); + class ace_csw { + disassembleTo = "SPE_Lafette_Tripod"; + }; + }; + + // --- Mortars ----------------------------------------------------------------- + class StaticMortar: StaticWeapon {}; + class SPE_StaticMortar_base: StaticMortar {}; + class SPE_US_Mortar_base: SPE_StaticMortar_base {}; + class SPE_M1_81: SPE_US_Mortar_base { class ACE_Actions: ACE_Actions { class ACE_MainActions: ACE_MainActions { position = ""; selection = "zamerny"; }; }; - class UserActions { - delete Prepare_WP_Selected; - delete Prepare_WP; - delete Prepare_Smoke_Selected; - delete Prepare_Smoke; - delete Prepare_HE_Selected; - delete Prepare_HE; - delete Reload; - delete Unload; - }; - class ACE_CSW { + class ace_csw { enabled = 1; - proxyWeapon = "SPE_M1_81_proxy"; + proxyWeapon = QGVAR(M1_proxy); magazineLocation = "_target selectionPosition 'usti hlavne'"; disassembleWeapon = "SPE_M1_81_Barrel"; - disassembleTurret = QGVAR(M1_81_baseplate); + disassembleTurret = QGVAR(m1Baseplate); ammoLoadTime = 3; ammoUnloadTime = 3; desiredAmmo = 1; }; }; + class SPE_FR_Mortar_base: SPE_StaticMortar_base {}; class SPE_MLE_27_31: SPE_FR_Mortar_base { - class Turrets: Turrets { - class MainTurret: MainTurret { - magazines[] = {}; - }; - }; class ACE_Actions: ACE_Actions { class ACE_MainActions: ACE_MainActions { position = ""; selection = "zamerny"; }; }; - class UserActions { - delete Prepare_Illu_Selected; - delete Prepare_Illu; - delete Prepare_Smoke_Selected; - delete Prepare_Smoke; - delete Prepare_HE_Selected; - delete Prepare_HE; - delete Reload; - delete Unload; - }; - class ACE_CSW { + class ace_csw { enabled = 1; - proxyWeapon = "SPE_MLE_27_31_proxy"; + proxyWeapon = QGVAR(MLE_27_31_proxy); magazineLocation = "_target selectionPosition 'usti hlavne'"; disassembleWeapon = "SPE_MLE_27_31_Barrel"; disassembleTurret = QGVAR(MLE_27_31_baseplate); @@ -103,30 +280,9 @@ class CfgVehicles { }; class SPE_GrW278_1: SPE_MLE_27_31 { - class Turrets: Turrets { - class MainTurret: MainTurret { - magazines[] = {}; - }; - }; - class ACE_Actions: ACE_Actions { - class ACE_MainActions: ACE_MainActions { - position = ""; - selection = "zamerny"; - }; - }; - class UserActions { - delete Prepare_Illu_Selected; - delete Prepare_Illu; - delete Prepare_Smoke_Selected; - delete Prepare_Smoke; - delete Prepare_HE_Selected; - delete Prepare_HE; - delete Reload; - delete Unload; - }; - class ACE_CSW { + class ace_csw { enabled = 1; - proxyWeapon = "SPE_GrW278_1_proxy"; + proxyWeapon = QGVAR(GrW278_1_proxy); magazineLocation = "_target selectionPosition 'usti hlavne'"; disassembleWeapon = "SPE_GrW278_1_Barrel"; disassembleTurret = QGVAR(GrW278_baseplate); @@ -137,7 +293,15 @@ class CfgVehicles { }; - class EGVAR(csw,baseTripod); + class GVAR(m1Baseplate): EGVAR(csw,baseTripod) { + scope = 2; + displayName = "$STR_DN_SPE_M1_81_STAND"; + model = "\WW2\SPE_Assets_m\Weapons\Mortars_m\SPE_M1_Mortar_Stand_Deployed.p3d"; + picture = "\WW2\SPE_Assets_t\Weapons\Equipment_t\Weapons\Launchers\Gear_M1_81_Stand_X_ca.paa"; + class ace_csw { + disassembleTo = "SPE_M1_81_Stand"; + }; + }; class GVAR(MLE_27_31_baseplate): EGVAR(csw,baseTripod) { scope = 2; @@ -146,7 +310,7 @@ class CfgVehicles { picture = "\WW2\SPE_Assets_t\Weapons\Equipment_t\Weapons\Launchers\Gear_MLE_27_31_Stand_X_ca.paa"; hiddenSelections[] = {"camo_0","camo_1"}; hiddenSelectionsTextures[] = {"ww2\spe_assets_t\weapons\mortars_t\m1_mortar\Brandt_81mm_Mortar_French_co.paa","WW2\SPE_Assets_t\Weapons\Mortars_t\M1_Mortar\Brandt_81mm_Sight_French_co.paa"}; - class ACE_CSW { + class ace_csw { disassembleTo = "SPE_MLE_27_31_Stand"; }; }; @@ -158,83 +322,8 @@ class CfgVehicles { picture = "\WW2\SPE_Assets_t\Weapons\Equipment_t\Weapons\Launchers\Gear_GrW278_1_Stand_X_ca.paa"; hiddenSelections[] = {"camo_0"}; hiddenSelectionsTextures[] = {"ww2\spe_assets_t\weapons\mortars_t\m1_mortar\Brandt_81mm_Mortar_Gelb_co.paa"}; - class ACE_CSW { + class ace_csw { disassembleTo = "SPE_GrW278_1_Stand"; }; }; - - class GVAR(M1_81_baseplate): EGVAR(csw,baseTripod) { - scope = 2; - displayName = "$STR_DN_SPE_M1_81_STAND"; - model = "\WW2\SPE_Assets_m\Weapons\Mortars_m\SPE_M1_Mortar_Stand_Deployed.p3d"; - picture = "\WW2\SPE_Assets_t\Weapons\Equipment_t\Weapons\Launchers\Gear_M1_81_Stand_X_ca.paa"; - class ACE_CSW { - disassembleTo = "SPE_M1_81_Stand"; - }; - }; - - - class ACE_SPE_M1_81_Stand_Deployed: EGVAR(csw,baseTripod) { - author = "SPE"; - scope = 2; - displayName = "$STR_DN_SPE_M1_81_STAND"; - model = "\WW2\SPE_Assets_m\Weapons\Mortars_m\SPE_M1_Mortar_Stand_Deployed.p3d"; - picture = "\WW2\SPE_Assets_t\Weapons\Equipment_t\Weapons\Launchers\Gear_M1_81_Stand_X_ca.paa"; - class assembleInfo { - base = ""; - primary = 0; - displayName = ""; - assembleTo = ""; - class SPE_M1_81_Barrel { - deployTime = 0; - assembleTo = ""; - }; - }; - class ACE_CSW { - disassembleTo = "SPE_M1_81_Stand"; - }; - }; - class ACE_SPE_GrW278_1_Stand_Deployed: EGVAR(csw,baseTripod) { - author = "SPE"; - scope = 2; - displayName = "$STR_DN_SPE_GrW278_1_STAND"; - model = "\WW2\SPE_Assets_m\Weapons\Mortars_m\SPE_M1_Mortar_Stand_Deployed.p3d"; - picture = "\WW2\SPE_Assets_t\Weapons\Equipment_t\Weapons\Launchers\Gear_GrW278_1_Stand_X_ca.paa"; - hiddenSelectionsTextures[] = {"ww2\spe_assets_t\weapons\mortars_t\m1_mortar\Brandt_81mm_Mortar_Gelb_co.paa","WW2\SPE_Assets_t\Weapons\Mortars_t\M1_Mortar\Brandt_81mm_Sight_Gelb_co.paa"}; - class assembleInfo { - base = ""; - primary = 0; - displayName = ""; - assembleTo = ""; - class SPE_GrW278_1_Barrel { - deployTime = 0; - assembleTo = ""; - }; - }; - class ACE_CSW { - disassembleTo = "SPE_GrW278_1_Stand"; - }; - }; - class ACE_SPE_MLE_27_31_Stand_Deployed: EGVAR(csw,baseTripod) { - author = "SPE"; - scope = 2; - displayName = "$STR_DN_SPE_MLE_27_31_STAND"; - model = "\WW2\SPE_Assets_m\Weapons\Mortars_m\SPE_M1_Mortar_Stand_Deployed.p3d"; - picture = "\WW2\SPE_Assets_t\Weapons\Equipment_t\Weapons\Launchers\Gear_MLE_27_31_Stand_X_ca.paa"; - hiddenSelections[] = {"camo_0","camo_1"}; - hiddenSelectionsTextures[] = {"ww2\spe_assets_t\weapons\mortars_t\m1_mortar\Brandt_81mm_Mortar_French_co.paa","WW2\SPE_Assets_t\Weapons\Mortars_t\M1_Mortar\Brandt_81mm_Sight_French_co.paa"}; - class assembleInfo { - base = ""; - primary = 0; - displayName = ""; - assembleTo = ""; - class SPE_MLE_27_31_Barrel { - deployTime = 0; - assembleTo = ""; - }; - }; - class ACE_CSW { - disassembleTo = "SPE_MLE_27_31_Stand"; - }; - }; }; diff --git a/addons/compat_spe/compat_spe_csw/CfgWeapons.hpp b/addons/compat_spe/compat_spe_csw/CfgWeapons.hpp index db090c77080..b6e71dcb6a9 100644 --- a/addons/compat_spe/compat_spe_csw/CfgWeapons.hpp +++ b/addons/compat_spe/compat_spe_csw/CfgWeapons.hpp @@ -1,43 +1,162 @@ class CfgWeapons { - class Launcher; - class Launcher_Base_F: Launcher { - class WeaponSlotsInfo; + class Launcher_Base_F; + class SPE_Slung_Static_Weapon_Base: Launcher_Base_F {}; + + // --- Vanilla Compat ------------------------------------------------------------- + class EGVAR(csw,staticHMGCarry): Launcher_Base_F { + class ace_csw { + class assembleTo { + GVAR(m3Tripod) = "B_HMG_01_F"; + }; + }; + }; + class EGVAR(csw,staticM2ShieldCarry): EGVAR(csw,staticHMGCarry) { + class ace_csw: ace_csw { + class assembleTo { + GVAR(m3Tripod) = "B_HMG_02_F"; + }; + }; }; - class SPE_Slung_Static_Weapon_Base: Launcher_Base_F {}; + class EGVAR(csw,staticGMGCarry): Launcher_Base_F { + class ace_csw { + class assembleTo { + GVAR(m3Tripod) = "B_GMG_01_F"; + }; + }; + }; + + // --- Gun Turrets ------------------------------------------------------------- + class SPE_M2_M3_Tripod; + class GVAR(M2_proxy): SPE_M2_M3_Tripod { + magazineReloadTime = 0.5; + }; + class SPE_M3_Tripod: SPE_Slung_Static_Weapon_Base { + class ace_csw { + type = "mount"; + deployTime = 4; + pickupTime = 4; + deploy = QGVAR(m3Tripod); + }; + }; + class SPE_M2_50: SPE_Slung_Static_Weapon_Base { + class ace_csw { + type = "weapon"; + deployTime = 4; + pickupTime = 4; + class assembleTo { + GVAR(m3Tripod) = "SPE_M2_M3"; + EGVAR(csw,m3TripodLow) = "SPE_M2_M3"; + }; + }; + }; + + class SPE_M1919A4_tripod; + class GVAR(M1919A4_proxy): SPE_M1919A4_tripod { + magazineReloadTime = 0.5; + }; + + class SPE_M2_Tripod: SPE_Slung_Static_Weapon_Base { + class ace_csw { + type = "mount"; + deployTime = 4; + pickupTime = 4; + deploy = QGVAR(m2Tripod); + }; + }; + + class SPE_LMG; + class SPE_M1919A4: SPE_LMG { + class ace_csw { + type = "weapon"; + deployTime = 4; + pickupTime = 4; + class assembleTo { + GVAR(m2Tripod) = "SPE_M1919_M2"; + }; + }; + }; + + class SPE_M1919A6_StaticBipod; + class GVAR(M1919A6_proxy): SPE_M1919A6_StaticBipod { + magazineReloadTime = 0.5; + }; + + class SPE_MG42_Tripod; + class GVAR(MG42_proxy): SPE_MG42_Tripod { + magazineReloadTime = 0.5; + }; + + class SPE_MG34_Tripod; + class GVAR(MG34_proxy): SPE_MG34_Tripod { + magazineReloadTime = 0.5; + }; + + class SPE_Lafette_Tripod: SPE_Slung_Static_Weapon_Base { + class ace_csw { + type = "mount"; + deployTime = 4; + pickupTime = 4; + deploy = QGVAR(LafetteTripodLow); + }; + }; + class SPE_MG42: SPE_LMG { + class ace_csw { + type = "weapon"; + deployTime = 4; + pickupTime = 4; + class assembleTo { + GVAR(LafetteTripodLow) = "SPE_MG42_Lafette_low_Deployed"; + GVAR(LafetteTripod) = "SPE_MG42_Lafette_Deployed"; + }; + }; + }; + class SPE_MG34: SPE_LMG { + class ace_csw { + type = "weapon"; + deployTime = 4; + pickupTime = 4; + class assembleTo { + GVAR(LafetteTripodLow) = "SPE_MG34_Lafette_low_Deployed"; + GVAR(LafetteTripod) = "SPE_MG34_Lafette_Deployed"; + }; + }; + }; + + // --- Mortars ----------------------------------------------------------------- class SPE_M1_81; - class SPE_M1_81_proxy: SPE_M1_81 { + class GVAR(M1_proxy): SPE_M1_81 { magazineReloadTime = 0.5; }; class SPE_M1_81_Stand: SPE_Slung_Static_Weapon_Base { - class ACE_CSW { + class ace_csw { type = "mount"; deployTime = 4; pickupTime = 4; - deploy = QGVAR(M1_81_baseplate); + deploy = QGVAR(m1Baseplate); }; }; class SPE_M1_81_Barrel: SPE_Slung_Static_Weapon_Base { - class ACE_CSW { + class ace_csw { type = "weapon"; - deployTime = 4; - pickupTime = 4; + deployTime = 20; + pickupTime = 25; class assembleTo { - GVAR(M1_81_baseplate) = "SPE_M1_81"; + GVAR(m1Baseplate) = "SPE_M1_81"; EGVAR(csw,mortarBaseplate) = "SPE_M1_81"; }; }; }; class SPE_MLE_27_31; - class SPE_MLE_27_31_proxy: SPE_MLE_27_31 { + class GVAR(MLE_27_31_proxy): SPE_MLE_27_31 { magazineReloadTime = 0.5; }; class SPE_MLE_27_31_Stand: SPE_Slung_Static_Weapon_Base { - class ACE_CSW { + class ace_csw { type = "mount"; deployTime = 4; pickupTime = 4; @@ -45,7 +164,7 @@ class CfgWeapons { }; }; class SPE_MLE_27_31_Barrel: SPE_Slung_Static_Weapon_Base { - class ACE_CSW { + class ace_csw { type = "weapon"; deployTime = 20; pickupTime = 25; @@ -57,21 +176,20 @@ class CfgWeapons { }; class SPE_GrW278_1; - class SPE_GrW278_1_proxy: SPE_GrW278_1 { + class GVAR(GrW278_1_proxy): SPE_GrW278_1 { magazineReloadTime = 0.5; }; class SPE_GrW278_1_Stand: SPE_MLE_27_31_Stand { - class ACE_CSW { + class ace_csw { type = "mount"; deployTime = 4; pickupTime = 4; deploy = QGVAR(GrW278_baseplate); }; }; - class SPE_GrW278_1_Barrel: SPE_MLE_27_31_Barrel { - class ACE_CSW { + class ace_csw { type = "weapon"; deployTime = 20; pickupTime = 25; diff --git a/addons/compat_spe/compat_spe_csw/config.cpp b/addons/compat_spe/compat_spe_csw/config.cpp index 6ff669629bf..05627a8f6db 100644 --- a/addons/compat_spe/compat_spe_csw/config.cpp +++ b/addons/compat_spe/compat_spe_csw/config.cpp @@ -23,7 +23,22 @@ class CfgPatches { }; }; -#include "ACE_CSW_Groups.hpp" -// Todo: https://github.com/acemod/ACE3/pull/9292#discussion_r1327738181 -// #include "CfgVehicles.hpp" -// #include "CfgWeapons.hpp" +#include "CfgMagazines.hpp" +#include "CfgMagazineGroups.hpp" +#include "CfgVehicles.hpp" +#include "CfgWeapons.hpp" + +class CfgFunctions { + class SPE_WEAPONS_STATIC { + class SPE_Weapons_Static { + OVERWRITE_FUNC(alter_height); + OVERWRITE_FUNC(can_alter_height); + OVERWRITE_FUNC(can_assemble_weapon); + OVERWRITE_FUNC(can_disassemble_weapon); + OVERWRITE_FUNC(can_prepare_ammo); + OVERWRITE_FUNC(can_Reload); + OVERWRITE_FUNC(can_resupply_ammo); + OVERWRITE_FUNC(can_unload_ammo); + }; + }; +}; diff --git a/addons/compat_spe/compat_spe_csw/functions/fnc_alter_height.sqf b/addons/compat_spe/compat_spe_csw/functions/fnc_alter_height.sqf new file mode 100644 index 00000000000..0179c881537 --- /dev/null +++ b/addons/compat_spe/compat_spe_csw/functions/fnc_alter_height.sqf @@ -0,0 +1,107 @@ +#include "..\script_component.hpp" +/* + * Author: Kerc (SPE), original by www.3commandobrigade.com, edited by johnb43 to be made CSW compatible + * Alters the static weapon's height. + * + * Arguments: + * 0: Static Weapon <OBJECT> + * 1: New static weapon (i.e. the weapon to replace the current weapon) <STRING> + * 2: Use ACE's progress bar <BOOL> (default: false) + * + * Return Value: + * None + * + * Example: + * cursorObject call SPE_Weapons_Static_fnc_can_alter_height + * + * Public: No + */ + +private _unit = call SPE_fnc_findPlayer; + +if !(alive _unit) exitWith {}; + +params ["_weaponPlatform", "_newStaticWeapon", ["_playProgressBar", false, [false]]]; + +if (_playProgressBar) exitWith { + [10 * EGVAR(csw,progressBarTimeCoefficent), [_weaponPlatform, _newStaticWeapon], { + (_this select 0) params ["_weaponPlatform", "_newStaticWeapon"]; + + [_weaponPlatform, _newStaticWeapon] call SPE_Weapons_Static_fnc_alter_height; + }, {}, LSUBLSTRING(alteringHeight), { + //IGNORE_PRIVATE_WARNING ["_player"]; + (_this select 0) params ["_weaponPlatform"]; + + _player distance _weaponPlatform <= 4 && {[_weaponPlatform, true] call SPE_Weapons_Static_fnc_can_alter_height} + }] call EFUNC(common,progressBar); +}; + +private _dir = vectorDir _weaponPlatform; +private _pos = (getPosATL _weaponPlatform) vectorAdd [0, 0, 0.1]; // 10 cm above terrain surface + +// Save state +private _magazines = magazinesAmmoFull _weaponPlatform; +private _assemblyModeIndex = _weaponPlatform getVariable QEGVAR(csw,assemblyMode); + +// Delete weapon and create new one +deleteVehicle _weaponPlatform; + +[{ + params ["_unit", "_newStaticWeapon", "_magazines", "_pos", "_dir", "_assemblyModeIndex"]; + + private _weaponPlatform = createVehicle [_newStaticWeapon, _pos, [], 0, "CAN_COLLIDE"]; + + if (!isNil "_assemblyModeIndex") then { + // Don't empty the weapon of its existing mags + _weaponPlatform setVariable [QEGVAR(csw,assemblyMode), 0, true]; + + if (_assemblyModeIndex == 0) exitWith {}; + + // Reset variable to original after initVehicle has run + [{ + (_this select 0) setVariable [QEGVAR(csw,assemblyMode), _this select 1, true]; + }, [_weaponPlatform, _assemblyModeIndex], 1.5] call CBA_fnc_waitAndExecute; + }; + + _weaponPlatform disableCollisionWith _unit; + _weaponPlatform setVectorDir _dir; + + [{ + _this remoteExecCall ["enableCollisionWith", _this]; + }, [_weaponPlatform, _unit], 0.5] call CBA_fnc_waitAndExecute; + + // Restore state + // First remove magazines that were spawned in with new weapon + { + _weaponPlatform removeMagazineTurret [_x, [0]]; + } forEach (_weaponPlatform magazinesTurret [0]); + + // Remove weapon temporarily and readd it to instantly load previous magazine + private _weapon = (_weaponPlatform weaponsTurret [0]) param [0, ""]; + + if (_weapon != "") then { + _weaponPlatform removeWeaponTurret [_weapon, [0]]; + }; + + if (_magazines isEqualTo []) exitWith {}; + + // Find loaded magazine + private _loadedIndex = _magazines findIf {_x select 2}; + + // If there was a loaded magazine, add that one first + if (_loadedIndex != -1) then { + (_magazines deleteAt _loadedIndex) params ["_magClass", "_ammoCount"]; + _weaponPlatform addMagazineTurret [_magClass, [0], _ammoCount]; + }; + + _weaponPlatform addWeaponTurret [_weapon, [0]]; + + { + _x params ["_magClass", "_ammoCount", "_loaded"]; + + // In some instances the loaded magazine is listed twice, so we skip it. + if (!_loaded) then { + _weaponPlatform addMagazineTurret [_magClass, [0], _ammoCount]; + }; + } forEach _magazines; +}, [_unit, _newStaticWeapon, _magazines, _pos, _dir, _assemblyModeIndex]] call CBA_fnc_execNextFrame; diff --git a/addons/compat_spe/compat_spe_csw/functions/fnc_can_Reload.sqf b/addons/compat_spe/compat_spe_csw/functions/fnc_can_Reload.sqf new file mode 100644 index 00000000000..c8a666753a1 --- /dev/null +++ b/addons/compat_spe/compat_spe_csw/functions/fnc_can_Reload.sqf @@ -0,0 +1,42 @@ +#include "..\script_component.hpp" +/* + * Author: Kerc (SPE), edited by johnb43 to be made CSW compatible + * Checks if the prepped magazine for the static weapon can be loaded. + * + * Arguments: + * 0: Static Weapon <OBJECT> + * 1: Default magazine to load (unused) (default: "") + * + * Return Value: + * If the player can load the selected ammo for the static weapon's <BOOL> + * + * Example: + * cursorObject call SPE_Weapons_Static_fnc_can_Reload + * + * Public: No + */ + +params ["_weaponPlatform"]; + +private _unit = call SPE_fnc_findPlayer; + +alive _unit && +{alive _weaponPlatform} && +{vehicle _unit in [_unit, _weaponPlatform]} && +{(magazines _weaponPlatform) isEqualTo []} && +{ + private _selectedMagazine = _unit getVariable ["SPE_Static_Weapon_Magazine", ""]; + + if (_selectedMagazine == "") exitWith { + false + }; + + _selectedMagazine = _selectedMagazine call EFUNC(common,getConfigName); + + if (_selectedMagazine == "") exitWith { + false + }; + + _selectedMagazine in compatibleMagazines ((_weaponPlatform weaponsTurret [0]) select 0) +} && +{CONDITION_NO_CSW(_weaponPlatform)} // CSW check diff --git a/addons/compat_spe/compat_spe_csw/functions/fnc_can_alter_height.sqf b/addons/compat_spe/compat_spe_csw/functions/fnc_can_alter_height.sqf new file mode 100644 index 00000000000..7c3f8c1f84b --- /dev/null +++ b/addons/compat_spe/compat_spe_csw/functions/fnc_can_alter_height.sqf @@ -0,0 +1,31 @@ +#include "..\script_component.hpp" +/* + * Author: Kerc (SPE), original by www.3commandobrigade.com, edited by johnb43 to be made CSW compatible + * Checks if the static weapon's height can be adjusted. + * + * Arguments: + * 0: Static Weapon <OBJECT> + * 1: Check for ACE CSW <STRING> (default: false) + * + * Return Value: + * If the player can alter the static weapon's height <BOOL> + * + * Example: + * cursorObject call SPE_Weapons_Static_fnc_can_alter_height + * + * Public: No + */ + +params ["_weaponPlatform", ["_checkForCSW", false, [false]]]; + +private _unit = call SPE_fnc_findPlayer; + +alive _unit && +{alive _weaponPlatform} && +{isNull objectParent _unit} && +{crew _weaponPlatform isEqualTo []} && +{!(_weaponPlatform lockedTurret [0])} && { + // CSW check + (!_checkForCSW && {CONDITION_NO_CSW(_weaponPlatform)}) || + {_checkForCSW && {!(CONDITION_NO_CSW(_weaponPlatform))}} +} diff --git a/addons/compat_spe/compat_spe_csw/functions/fnc_can_assemble_weapon.sqf b/addons/compat_spe/compat_spe_csw/functions/fnc_can_assemble_weapon.sqf new file mode 100644 index 00000000000..60911d49fe1 --- /dev/null +++ b/addons/compat_spe/compat_spe_csw/functions/fnc_can_assemble_weapon.sqf @@ -0,0 +1,27 @@ +#include "..\script_component.hpp" +/* + * Author: Kerc (SPE), original by www.3commandobrigade.com, edited by johnb43 to be made CSW compatible + * Determines whether the player can assemble the static weapon. + * + * Arguments: + * 0: Tripod <OBJECT> + * 1: Weapon <STRING> + * + * Return Value: + * If the player can assemble the static weapon <BOOL> + * + * Example: + * cursorObject call SPE_Weapons_Static_fnc_can_assemble_weapon + * + * Public: No + */ + +params ["_tripod", "_weaponComponent"]; + +private _unit = call SPE_fnc_findPlayer; + +alive _unit && +{alive _tripod} && +{isNull objectParent _unit} && +{_weaponComponent in (weapons _unit)} && +{CONDITION_NO_CSW(_tripod)} // CSW check diff --git a/addons/compat_spe/compat_spe_csw/functions/fnc_can_disassemble_weapon.sqf b/addons/compat_spe/compat_spe_csw/functions/fnc_can_disassemble_weapon.sqf new file mode 100644 index 00000000000..66a54829537 --- /dev/null +++ b/addons/compat_spe/compat_spe_csw/functions/fnc_can_disassemble_weapon.sqf @@ -0,0 +1,29 @@ +#include "..\script_component.hpp" +/* + * Author: Kerc (SPE), original by www.3commandobrigade.com, edited by johnb43 to be made CSW compatible + * Checks if the static weapon can be disassembled. + * + * Arguments: + * 0: Static Weapon <OBJECT> + * + * Return Value: + * If the player can disassemble the static weapon <BOOL> + * + * Example: + * cursorObject call SPE_Weapons_Static_fnc_can_Reload + * + * Public: No + */ + +params ["_weaponPlatform"]; + +private _unit = call SPE_fnc_findPlayer; + +alive _unit && +{alive _weaponPlatform} && +{isNull objectParent _unit} && +{crew _weaponPlatform isEqualTo []} && +{weaponDisassemblyEnabled _unit} && +{weaponDisassemblyEnabled _weaponPlatform} && +{!(_weaponPlatform lockedTurret [0])} && +{CONDITION_NO_CSW(_weaponPlatform)} // CSW check diff --git a/addons/compat_spe/compat_spe_csw/functions/fnc_can_prepare_ammo.sqf b/addons/compat_spe/compat_spe_csw/functions/fnc_can_prepare_ammo.sqf new file mode 100644 index 00000000000..e310b2a63cb --- /dev/null +++ b/addons/compat_spe/compat_spe_csw/functions/fnc_can_prepare_ammo.sqf @@ -0,0 +1,38 @@ +#include "..\script_component.hpp" +/* + * Author: ? (SPE), edited by johnb43 to be made CSW compatible + * Checks if the player can prepare the static weapon's ammo. + * + * Arguments: + * 0: Static Weapon <OBJECT> + * 1: Magazine to load <STRING> + * 2: If the magazine has been selected to be prepped for loading <BOOL> (default: false) + * + * Return Value: + * If the player can prepare the static weapon's ammo <BOOL> + * + * Example: + * cursorObject call SPE_Weapons_Static_fnc_can_prepare_ammo + * + * Public: No + */ + +params ["_weaponPlatform", "_ammo", ["_isSelected", false]]; + +private _unit = call SPE_fnc_findPlayer; + +alive _unit && +{alive _weaponPlatform} && +{vehicle _unit in [_unit, _weaponPlatform]} && +{ + private _defaultMags = getArray (configOf _weaponPlatform >> "Turrets" >> "MainTurret" >> "magazines"); + + if (({_x in _defaultMags} count (magazines _weaponPlatform)) > 1) exitWith { + false + }; + + private _selectedMagazine = _unit getVariable ["SPE_Static_Weapon_Magazine", ""]; + + _isSelected == (_selectedMagazine == _ammo) +} && +{CONDITION_NO_CSW(_weaponPlatform)} // CSW check diff --git a/addons/compat_spe/compat_spe_csw/functions/fnc_can_resupply_ammo.sqf b/addons/compat_spe/compat_spe_csw/functions/fnc_can_resupply_ammo.sqf new file mode 100644 index 00000000000..283c11d98d9 --- /dev/null +++ b/addons/compat_spe/compat_spe_csw/functions/fnc_can_resupply_ammo.sqf @@ -0,0 +1,27 @@ +#include "..\script_component.hpp" +/* + * Author: Kerc (SPE), original by www.3commandobrigade.com, edited by johnb43 to be made CSW compatible + * Checks if resupply of ammo to a static weapon is available. + * + * Arguments: + * 0: Static Weapon <OBJECT> + * 1: Default magazine to load (unused) (default: "") + * + * Return Value: + * If the player can load the static weapon's ammo <BOOL> + * + * Example: + * cursorObject call SPE_Weapons_Static_fnc_can_resupply_ammo + * + * Public: No + */ + +params ["_weaponPlatform"]; + +private _unit = call SPE_fnc_findPlayer; + +alive _unit && +{alive _weaponPlatform} && +{vehicle _unit in [_unit, _weaponPlatform]} && +{(_weaponPlatform magazinesTurret [[0], false]) isEqualTo []} && // Limit the reload capacity of a static weapon to 1 magazines +{CONDITION_NO_CSW(_weaponPlatform)} // CSW check diff --git a/addons/compat_spe/compat_spe_csw/functions/fnc_can_unload_ammo.sqf b/addons/compat_spe/compat_spe_csw/functions/fnc_can_unload_ammo.sqf new file mode 100644 index 00000000000..23384d29733 --- /dev/null +++ b/addons/compat_spe/compat_spe_csw/functions/fnc_can_unload_ammo.sqf @@ -0,0 +1,27 @@ +#include "..\script_component.hpp" +/* + * Author: Kerc (SPE), original by www.3commandobrigade.com, edited by johnb43 to be made CSW compatible + * Checks if the player can unload a static weapon's magazines. + * + * Arguments: + * 0: Static Weapon <OBJECT> + * + * Return Value: + * If the player can unload the static weapon's ammo <BOOL> + * + * Example: + * cursorObject call SPE_Weapons_Static_fnc_can_unload_ammo + * + * Public: No + */ + +params ["_weaponPlatform"]; + +private _unit = call SPE_fnc_findPlayer; + +alive _unit && +{alive _weaponPlatform} && +{_unit in _weaponPlatform || {isNull objectParent _unit && {(crew _weaponPlatform) isEqualTo []}}} && +{!(_weaponPlatform lockedTurret [0])} && +{(_weaponPlatform magazinesTurret [[0], false]) isNotEqualTo []} && +{CONDITION_NO_CSW(_weaponPlatform)} // CSW check diff --git a/addons/compat_spe/compat_spe_csw/script_component.hpp b/addons/compat_spe/compat_spe_csw/script_component.hpp index 1f7ace46a9e..8803d6fd261 100644 --- a/addons/compat_spe/compat_spe_csw/script_component.hpp +++ b/addons/compat_spe/compat_spe_csw/script_component.hpp @@ -1,3 +1,10 @@ #define SUBCOMPONENT csw #define SUBCOMPONENT_BEAUTIFIED Crew-Served Weapons #include "..\script_component.hpp" + +#define CONDITION_NO_CSW(var) (EGVAR(csw,ammoHandling) == 0) && {!([false, true, true, EGVAR(csw,defaultAssemblyMode)] select (var getVariable [ARR_2('EGVAR(csw,assemblyMode)',3)]))} + +#define OVERWRITE_FUNC(funcName)\ +class funcName {\ + file = QPATHTOF(DOUBLES(COMPONENT,SUBCOMPONENT)\functions\DOUBLES(fnc,funcName).sqf);\ +} diff --git a/addons/compat_spe/compat_spe_csw/stringtable.xml b/addons/compat_spe/compat_spe_csw/stringtable.xml new file mode 100644 index 00000000000..aa1476d330e --- /dev/null +++ b/addons/compat_spe/compat_spe_csw/stringtable.xml @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project name="ACE"> + <Package name="Compat_SPE_CSW"> + <Key ID="STR_ACE_Compat_SPE_CSW_alteringHeight"> + <English>Altering Height...</English> + <Korean>높이 변경 중...</Korean> + <Japanese>高さを変更・・・</Japanese> + </Key> + <Key ID="STR_ACE_Compat_SPE_CSW_50Rnd_762x63_Tracer"> + <English>.30-06 50Rnd Belt (M2/Tracer)</English> + <Korean>.30-06구경 스프링필드 50발 들이 벨트 (M2 훈련용/예광탄)</Korean> + <Japanese>.30-06 50Rnd Belt (M2/Tracer)</Japanese> + </Key> + <Key ID="STR_ACE_Compat_SPE_CSW_100Rnd_762x63_Tracer"> + <English>.30-06 100Rnd Belt (M2/Tracer)</English> + <Korean>.30-06구경 스프링필드 100발 들이 벨트 (M2 훈련용/예광탄)</Korean> + <Japanese>.30-06 100Rnd Belt (M2/Tracer)</Japanese> + </Key> + <Key ID="STR_ACE_Compat_SPE_CSW_50Rnd_792x57_Tracer"> + <English>7.92x57 50Rnd Gurttrommel (L.S./Tracer)</English> + <Korean>7.92x57mm 50발 들이 벨트 (L.S. 훈련용/예광탄)</Korean> + <Japanese>7.92x57 50Rnd Gurttrommel (L.S./Tracer)</Japanese> + </Key> + <Key ID="STR_ACE_Compat_SPE_CSW_100Rnd_792x57_Tracer"> + <English>7.92x57 100Rnd Belt (L.S./Tracer)</English> + <Korean>7.92x57mm 100발 들이 벨트 (L.S. 훈련용/예광탄)</Korean> + <Japanese>7.92x57 100Rnd Belt (L.S./Tracer)</Japanese> + </Key> + </Package> +</Project> diff --git a/addons/compat_spe/compat_spe_explosives/CfgMagazines.hpp b/addons/compat_spe/compat_spe_explosives/CfgMagazines.hpp index 7c1945fcb8f..810a5bc5bf1 100644 --- a/addons/compat_spe/compat_spe_explosives/CfgMagazines.hpp +++ b/addons/compat_spe/compat_spe_explosives/CfgMagazines.hpp @@ -1,9 +1,8 @@ class CfgMagazines { class SPE_Mine_Magazine; class SPE_US_TNT_4pound_mag: SPE_Mine_Magazine { - EGVAR(explosives,DelayTime) = 1; - EGVAR(explosives,Placeable) = 1; - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(4LBTNT); + EGVAR(explosives,placeable) = 1; + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(4LBTNT); useAction = 0; class ACE_Triggers { SupportedTriggers[] = {"Timer", "Command", "MK16_Transmitter", "FireCord", "LIB_LadungPM"}; @@ -19,9 +18,8 @@ class CfgMagazines { }; class SPE_US_TNT_half_pound_mag: SPE_Mine_Magazine { - EGVAR(explosives,DelayTime) = 1; - EGVAR(explosives,Placeable) = 1; - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(halfLBTNT); + EGVAR(explosives,placeable) = 1; + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(halfLBTNT); useAction = 0; class ACE_Triggers { SupportedTriggers[] = {"Timer", "Command", "MK16_Transmitter", "FireCord", "LIB_LadungPM"}; @@ -37,9 +35,8 @@ class CfgMagazines { }; class SPE_US_Bangalore_mag: SPE_Mine_Magazine { - EGVAR(explosives,DelayTime) = 1; - EGVAR(explosives,Placeable) = 1; - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(bangalore); + EGVAR(explosives,placeable) = 1; + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(bangalore); useAction = 0; class ACE_Triggers { SupportedTriggers[] = {"Timer", "Command", "MK16_Transmitter", "FireCord", "LIB_LadungPM"}; @@ -55,9 +52,8 @@ class CfgMagazines { }; class SPE_Ladung_Small_MINE_mag: SPE_Mine_Magazine { - EGVAR(explosives,DelayTime) = 1; - EGVAR(explosives,Placeable) = 1; - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(smallLadung); + EGVAR(explosives,placeable) = 1; + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(smallLadung); useAction = 0; class ACE_Triggers { SupportedTriggers[] = {"Timer", "Command", "MK16_Transmitter", "FireCord", "LIB_LadungPM"}; @@ -73,9 +69,8 @@ class CfgMagazines { }; class SPE_Ladung_Big_MINE_mag: SPE_Mine_Magazine { - EGVAR(explosives,DelayTime) = 1; - EGVAR(explosives,Placeable) = 1; - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(bigLadung); + EGVAR(explosives,placeable) = 1; + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(bigLadung); useAction = 0; class ACE_Triggers { SupportedTriggers[] = {"Timer", "Command", "MK16_Transmitter", "FireCord", "LIB_LadungPM"}; @@ -91,8 +86,8 @@ class CfgMagazines { }; class SPE_US_M1A1_ATMINE_mag: SPE_Mine_Magazine { - EGVAR(explosives,Placeable) = 1; - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(M1A1at); + EGVAR(explosives,placeable) = 1; + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(M1A1at); useAction = 0; class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; @@ -102,8 +97,8 @@ class CfgMagazines { }; }; class SPE_US_M3_MINE_mag: SPE_Mine_Magazine { - EGVAR(explosives,Placeable) = 1; - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(M3ap); + EGVAR(explosives,placeable) = 1; + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(M3ap); useAction = 0; class ACE_Triggers { SupportedTriggers[] = {"Tripwire"}; @@ -113,8 +108,8 @@ class CfgMagazines { }; }; class SPE_US_M3_Pressure_MINE_mag: SPE_Mine_Magazine { - EGVAR(explosives,Placeable) = 1; - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(M3Pressure); + EGVAR(explosives,placeable) = 1; + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(M3Pressure); useAction = 0; class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; @@ -125,8 +120,8 @@ class CfgMagazines { }; class SPE_Shg24x7_Improvised_Mine_mag: SPE_Mine_Magazine { - EGVAR(explosives,Placeable) = 1; - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(Shg24x7); + EGVAR(explosives,placeable) = 1; + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(Shg24x7); useAction = 0; class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; @@ -137,8 +132,8 @@ class CfgMagazines { }; class SPE_TMI_42_MINE_mag: SPE_Mine_Magazine { - EGVAR(explosives,Placeable) = 1; - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(TMI42); + EGVAR(explosives,placeable) = 1; + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(TMI42); useAction = 0; class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; @@ -149,8 +144,8 @@ class CfgMagazines { }; class SPE_SMI_35_1_MINE_mag: SPE_Mine_Magazine { - EGVAR(explosives,Placeable) = 1; - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(SMI35_1); + EGVAR(explosives,placeable) = 1; + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(SMI35_1); useAction = 0; class ACE_Triggers { SupportedTriggers[] = {"Tripwire"}; @@ -161,8 +156,8 @@ class CfgMagazines { }; class SPE_SMI_35_MINE_mag: SPE_Mine_Magazine { - EGVAR(explosives,Placeable) = 1; - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(SMI35); + EGVAR(explosives,placeable) = 1; + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(SMI35); useAction = 0; class ACE_Triggers { SupportedTriggers[] = {"Tripwire"}; @@ -173,8 +168,8 @@ class CfgMagazines { }; class SPE_SMI_35_Pressure_MINE_mag: SPE_Mine_Magazine { - EGVAR(explosives,Placeable) = 1; - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(SMI35Pressure); + EGVAR(explosives,placeable) = 1; + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(SMI35Pressure); useAction = 0; class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; @@ -185,8 +180,8 @@ class CfgMagazines { }; class SPE_STMI_MINE_mag: SPE_Mine_Magazine { - EGVAR(explosives,Placeable) = 1; - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(STMI); + EGVAR(explosives,placeable) = 1; + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(STMI); useAction = 0; class ACE_Triggers { SupportedTriggers[] = {"Tripwire"}; @@ -197,8 +192,8 @@ class CfgMagazines { }; class SPE_shumine_42_MINE_mag: SPE_Mine_Magazine { - EGVAR(explosives,Placeable) = 1; - EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(shumine42); + EGVAR(explosives,placeable) = 1; + EGVAR(explosives,setupObject) = QEXPLOSIVES_PLACE(shumine42); useAction = 0; class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; diff --git a/addons/compat_spe/compat_spe_explosives/CfgVehicles.hpp b/addons/compat_spe/compat_spe_explosives/CfgVehicles.hpp index d4d5737bb23..9137a9b802b 100644 --- a/addons/compat_spe/compat_spe_explosives/CfgVehicles.hpp +++ b/addons/compat_spe/compat_spe_explosives/CfgVehicles.hpp @@ -8,7 +8,7 @@ class CfgVehicles { // 4 Pound TNT Charge class EXPLOSIVES_PLACE(4LBTNT): EGVAR(explosives,Place) { - displayName = "4 Pound TNT Charge"; + displayName = "$STR_DN_SPE_US_TNT_4POUND"; model = "\WW2\SPE_Assets_m\Weapons\Mines_m\SPE_TNT_4pound"; class ACE_Actions: ACE_Actions { class ACE_MainActions: ACE_MainActions { @@ -19,7 +19,7 @@ class CfgVehicles { // Half Pound TNT Charge class EXPLOSIVES_PLACE(halfLBTNT): EGVAR(explosives,Place) { - displayName = "Half Pound TNT Charge"; + displayName = "$STR_DN_SPE_US_TNT_HALF_POUND"; model = "\WW2\SPE_Assets_m\Weapons\Mines_m\SPE_TNT_Half_Pound"; class ACE_Actions: ACE_Actions { class ACE_MainActions: ACE_MainActions { @@ -30,7 +30,7 @@ class CfgVehicles { // M1A1 Bangalore Torpedo class EXPLOSIVES_PLACE(bangalore): EGVAR(explosives,Place) { - displayName = "M1A1 Bangalore Torpedo"; + displayName = "$STR_DN_SPE_US_BANGALORE"; model = "\WW2\SPE_Assets_m\Weapons\Mines_m\SPE_Bangalore"; class ACE_Actions: ACE_Actions { class ACE_MainActions: ACE_MainActions { @@ -41,7 +41,7 @@ class CfgVehicles { // 1 Kg Charge class EXPLOSIVES_PLACE(smallLadung): EGVAR(explosives,Place) { - displayName = "1 Kg Charge"; + displayName = "$STR_SPE_Ladung_Small"; model = "\WW2\SPE_Assets_m\Weapons\Mines_m\SPE_Ladung"; class ACE_Actions: ACE_Actions { class ACE_MainActions: ACE_MainActions { @@ -52,7 +52,7 @@ class CfgVehicles { // 3 Kg Charge class EXPLOSIVES_PLACE(bigLadung): EGVAR(explosives,Place) { - displayName = "3 Kg Charge"; + displayName = "$STR_SPE_Ladung_Big"; model = "\WW2\SPE_Assets_m\Weapons\Mines_m\SPE_Ladung_Big"; class ACE_Actions: ACE_Actions { class ACE_MainActions: ACE_MainActions { @@ -63,7 +63,7 @@ class CfgVehicles { // M1A1 AT Mine class EXPLOSIVES_PLACE(M1A1at): EGVAR(explosives,Place) { - displayName = "M1A1 AT Mine"; + displayName = "$STR_DN_SPE_US_M1A1_ATMINE"; model = "\WW2\SPE_Assets_m\Weapons\Mines_m\SPE_M1A1_AT"; class ACE_Actions: ACE_Actions { class ACE_MainActions: ACE_MainActions { @@ -72,9 +72,9 @@ class CfgVehicles { }; }; - // M1A1 AT Mine + // Shg24x7 Improvised AT Mine class EXPLOSIVES_PLACE(Shg24x7): EGVAR(explosives,Place) { - displayName = "M1A1 AT Mine"; + displayName = "$STR_SPE_Shg24x7_Improvised_Mine"; model = "\WW2\SPE_Assets_m\Weapons\Mines_m\SPE_GER_Improvised_Mine"; class ACE_Actions: ACE_Actions { class ACE_MainActions: ACE_MainActions { @@ -83,9 +83,9 @@ class CfgVehicles { }; }; - // M1A1 AT Mine + // TMI-42 AT Mine class EXPLOSIVES_PLACE(TMI42): EGVAR(explosives,Place) { - displayName = "M1A1 AT Mine"; + displayName = "$STR_SPE_TMI_42"; model = "\WW2\SPE_Assets_m\Weapons\Mines_m\SPE_Tmi42"; class ACE_Actions: ACE_Actions { class ACE_MainActions: ACE_MainActions { @@ -96,7 +96,7 @@ class CfgVehicles { // M3 AP Tripwire Mine class EXPLOSIVES_PLACE(M3ap): EGVAR(explosives,Place) { - displayName = "M3 AP Tripwire Mine"; + displayName = "$STR_DN_SPE_US_M3"; model = "\WW2\SPE_Assets_m\Weapons\Mines_m\SPE_M3_AP"; class ACE_Actions: ACE_Actions { class ACE_MainActions: ACE_MainActions { @@ -107,7 +107,7 @@ class CfgVehicles { // M3 AP Mine class EXPLOSIVES_PLACE(M3Pressure): EGVAR(explosives,Place) { - displayName = "M3 AP Mine"; + displayName = "$STR_DN_SPE_US_M3_Pressure"; model = "\WW2\SPE_Assets_m\Weapons\Mines_m\SPE_M3_AP_Pressure"; class ACE_Actions: ACE_Actions { class ACE_MainActions: ACE_MainActions { @@ -118,7 +118,7 @@ class CfgVehicles { // SMi-35 AP Mine class EXPLOSIVES_PLACE(SMI35Pressure): EGVAR(explosives,Place) { - displayName = "SMi-35 AP Mine"; + displayName = "$STR_SPE_SMI_35_Pressure"; model = "\WW2\SPE_Assets_m\Weapons\Mines_m\SPE_Smi35"; class ACE_Actions: ACE_Actions { class ACE_MainActions: ACE_MainActions { @@ -129,7 +129,7 @@ class CfgVehicles { // SMi-35 Tripwire Mine class EXPLOSIVES_PLACE(SMI35): EGVAR(explosives,Place) { - displayName = "SMi-35 Tripwire Mine"; + displayName = "$STR_SPE_SMI_35"; model = "\WW2\SPE_Assets_m\Weapons\Mines_m\SPE_Smi35_1"; class ACE_Actions: ACE_Actions { class ACE_MainActions: ACE_MainActions { @@ -140,7 +140,7 @@ class CfgVehicles { // SMi-35 Tripwire (x2) Mine class EXPLOSIVES_PLACE(SMI35_1): EGVAR(explosives,Place) { - displayName = "SMi-35 Tripwire (x2) Mine"; + displayName = "$STR_SPE_SMI_35_1"; model = "\WW2\SPE_Assets_m\Weapons\Mines_m\SPE_Smi35_2"; class ACE_Actions: ACE_Actions { class ACE_MainActions: ACE_MainActions { @@ -151,7 +151,7 @@ class CfgVehicles { // StMi Mine class EXPLOSIVES_PLACE(STMI): EGVAR(explosives,Place) { - displayName = "StMi Mine"; + displayName = "$STR_SPE_STMI"; model = "\WW2\SPE_Assets_m\Weapons\Mines_m\SPE_Stmi"; class ACE_Actions: ACE_Actions { class ACE_MainActions: ACE_MainActions { @@ -162,7 +162,7 @@ class CfgVehicles { // Schuetzenmine 42 class EXPLOSIVES_PLACE(shumine42): EGVAR(explosives,Place) { - displayName = "Schuetzenmine 42"; + displayName = "$STR_SPE_shumine42"; model = "\WW2\SPE_Assets_m\Weapons\Mines_m\SPE_Shumine42"; class ACE_Actions: ACE_Actions { class ACE_MainActions: ACE_MainActions { diff --git a/addons/compat_spe/compat_spe_refuel/CfgVehicles.hpp b/addons/compat_spe/compat_spe_refuel/CfgVehicles.hpp index fc1ebc9b4e0..8819f205590 100644 --- a/addons/compat_spe/compat_spe_refuel/CfgVehicles.hpp +++ b/addons/compat_spe/compat_spe_refuel/CfgVehicles.hpp @@ -1,12 +1,57 @@ class CfgVehicles { - class SPE_Halftrack_base; - class SPE_US_M3_Halftrack_Fuel: SPE_Halftrack_base { - EGVAR(refuel,hooks)[] = {{-0.23,-2.58,-0.59}}; - EGVAR(refuel,fuelCargo) = 2000; - }; - class SPE_OpelBlitz_base; - class SPE_OpelBlitz_Fuel: SPE_OpelBlitz_base { - EGVAR(refuel,hooks)[] = {{-0.23,-2.58,-0.59}}; - EGVAR(refuel,fuelCargo) = 2000; + // Vehicle animation interactions + class SPE_Car_base; + class SPE_G503_MB_base: SPE_Car_base { + class EGVAR(interaction,anims) { + class hide_jerry_can_source { + positions[] = {"_target selectionPosition ['hide_jerry_can', 'ViewGeometry', 'AveragePoint']"}; + items[] = {"Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + }; + }; + + class SPE_Truck_base; + class SPE_CCKW_353_Base: SPE_Truck_base { + class EGVAR(interaction,anims) { + class spare_fuel_hide_source { + positions[] = {{0.8, 1.8, -1}, {-0.8, 1.8, -1}, {0.8, 3.5, -1}, {-0.8, 3.5, -1}}; + items[] = {"Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + }; + }; + class SPE_CCKW_353_Ammo: SPE_CCKW_353_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class spare_fuel_hide_source: spare_fuel_hide_source { + positions[] = {{0.8, 1.8, -0.85}, {-0.8, 1.8, -0.85}, {0.8, 3.5, -0.85}, {-0.8, 3.5, -0.85}}; + }; + }; + }; + class SPE_CCKW_353_Repair: SPE_CCKW_353_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class spare_fuel_hide_source: spare_fuel_hide_source { + positions[] = {{0.8, 1.9, -0.85}, {-0.8, 1.9, -0.85}, {0.8, 3.6, -0.85}, {-0.8, 3.6, -0.85}}; + }; + }; + }; + class SPE_CCKW_353_Fuel: SPE_CCKW_353_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class spare_fuel_hide_source: spare_fuel_hide_source { + positions[] = {{0.8, 1.25, -0.8}, {-0.8, 1.25, -0.8}, {0.8, 2.95, -0.8}, {-0.8, 2.95, -0.8}, {0.8, -1, -0.3}, {-0.8, -1, -0.3}}; + items[] = { // 32x + "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", + "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", + "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", + "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", + "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", + "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", + "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", + "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F" + }; + }; + }; }; }; diff --git a/addons/compat_spe/compat_spe_repair/CfgVehicles.hpp b/addons/compat_spe/compat_spe_repair/CfgVehicles.hpp new file mode 100644 index 00000000000..2f20e427d83 --- /dev/null +++ b/addons/compat_spe/compat_spe_repair/CfgVehicles.hpp @@ -0,0 +1,120 @@ +class CfgVehicles { + // Vehicle animation interactions + class SPE_Car_base; + class SPE_G503_MB_base: SPE_Car_base { + class EGVAR(interaction,anims) { + class hide_spare_wheel_source { + positions[] = {"_target selectionPosition ['hide_spare_wheel', 'ViewGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + + class SPE_Truck_base; + class SPE_CCKW_353_Base: SPE_Truck_base { + class EGVAR(interaction,anims) { + class spare_wheel_hide_source { + positions[] = {{-0.9, 0.35, -0.95}}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + class SPE_CCKW_353_Ammo: SPE_CCKW_353_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class spare_wheel_hide_source: spare_wheel_hide_source { + positions[] = {{-0.9, 0.35, -0.8}}; + }; + }; + }; + class SPE_CCKW_353_Repair: SPE_CCKW_353_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class spare_wheel_hide_source: spare_wheel_hide_source { + positions[] = {{-0.9, 0.43, -0.75}}; + }; + }; + }; + class SPE_CCKW_353_Fuel: SPE_CCKW_353_Base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class spare_wheel_hide_source: spare_wheel_hide_source { + positions[] = {{-0.9, -0.2, -0.7}}; + }; + }; + }; + + class SPE_R200_base: SPE_Car_base { + class EGVAR(interaction,anims) { + class hide_spare_wheel_source { + positions[] = {"_target selectionPosition ['hide_sparetire', 'FireGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + + class SPE_Tank_base; + class SPE_M18_Hellcat_Base: SPE_Tank_base { + class EGVAR(interaction,anims) { + class hull_armour_hide_source { + positions[] = {"_target selectionPosition ['spare_track_hull', 'FireGeometry', 'AveragePoint']"}; + items[] = {"ACE_Track", "ACE_Track", "ACE_Track"}; + name = ECSTRING(repair,RemoveTrack); + text = ECSTRING(repair,RemovingTrack); + }; + }; + }; + + class SPE_PzKpfwV_base: SPE_Tank_base { + class EGVAR(interaction,anims) { + class spare_tracks_hide_source { + selections[] = {"spare_tracks"}; + positions[] = {"private _pos = _target selectionPosition 'spare_tracks'; _pos set [0, -(_pos select 0)]; _pos"}; // Mirror position to other side of vehicle + items[] = {"ACE_Track", "ACE_Track", "ACE_Track"}; + name = ECSTRING(repair,RemoveTrack); + text = ECSTRING(repair,RemovingTrack); + }; + }; + }; + + class SPE_PzKpfwVI_H1_base: SPE_Tank_base { + class EGVAR(interaction,anims) { + class hull_armour_hide_source { + positions[] = {{-1.3, 1.7, -0.75}, {1.1, 1.7, -0.75}, {-0.05, 2.35, -1.5}}; + items[] = {"ACE_Track", "ACE_Track", "ACE_Track", "ACE_Track", "ACE_Track"}; + name = ECSTRING(repair,RemoveTrack); + text = ECSTRING(repair,RemovingTrack); + }; + class turret_armour_hide_source { + // Rotate interactions with turret rotation + positions[] = { + "[0, -0.6, 0] vectorAdd ([[1.2, 0, -0.2], [0, 0, 1], deg (_target animationPhase 'MainTurret')] call CBA_fnc_vectRotate3D)", + "[0, -0.6, 0] vectorAdd ([[-1.3, -0.3, -0.2], [0, 0, 1], deg (_target animationPhase 'MainTurret')] call CBA_fnc_vectRotate3D)" + }; + items[] = {"ACE_Track", "ACE_Track"}; + name = ECSTRING(repair,RemoveTrack); + text = ECSTRING(repair,RemovingTrack); + }; + }; + }; + + class SPE_Jagdpanther_G1_base: SPE_Tank_base { + class EGVAR(interaction,anims) { + class hide_spare_tracks_left_source { + positions[] = {"private _pos = _target selectionPosition ['hide_spare_tracks_right', 'FireGeometry', 'AveragePoint']; _pos set [0, -(_pos select 0)]; _pos vectorAdd [0, 0.335, 0]"}; + items[] = {"ACE_Track"}; + name = ECSTRING(repair,RemoveTrack); + text = ECSTRING(repair,RemovingTrack); + }; + class hide_spare_tracks_right_source { + positions[] = {"_target selectionPosition ['hide_spare_tracks_right', 'FireGeometry', 'AveragePoint']"}; + items[] = {"ACE_Track", "ACE_Track"}; + name = ECSTRING(repair,RemoveTrack); + text = ECSTRING(repair,RemovingTrack); + }; + }; + }; +}; diff --git a/addons/compat_spe/compat_spe_repair/config.cpp b/addons/compat_spe/compat_spe_repair/config.cpp new file mode 100644 index 00000000000..356ef6a6be9 --- /dev/null +++ b/addons/compat_spe/compat_spe_repair/config.cpp @@ -0,0 +1,27 @@ +#include "script_component.hpp" + +class CfgPatches { + class SUBADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { + "ww2_spe_assets_c_weapons_infantryweapons_c", + "ww2_spe_assets_c_vehicles_staticweapons_c", + "ww2_spe_assets_c_vehicles_weapons_c", + "ww2_spe_core_f_system_staticweapons_f", + "ww2_spe_core_c_core_c_eventhandlers", + "ace_repair" + }; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {"johnb43"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + + addonRootClass = QUOTE(ADDON); + }; +}; + +#include "CfgVehicles.hpp" diff --git a/addons/compat_spe/compat_spe_repair/script_component.hpp b/addons/compat_spe/compat_spe_repair/script_component.hpp new file mode 100644 index 00000000000..1af928486c3 --- /dev/null +++ b/addons/compat_spe/compat_spe_repair/script_component.hpp @@ -0,0 +1,3 @@ +#define SUBCOMPONENT repair +#define SUBCOMPONENT_BEAUTIFIED Repair +#include "..\script_component.hpp" diff --git a/addons/compat_spe/compat_spe_trenches/CfgVehicles.hpp b/addons/compat_spe/compat_spe_trenches/CfgVehicles.hpp new file mode 100644 index 00000000000..bb4b78721df --- /dev/null +++ b/addons/compat_spe/compat_spe_trenches/CfgVehicles.hpp @@ -0,0 +1,119 @@ +class CfgVehicles { + // Vehicle animation interactions + class SPE_Car_base; + class SPE_G503_MB_base: SPE_Car_base { + class EGVAR(interaction,anims) { + class hide_tools_source { + positions[] = {{-0.7, 0, -0.9}}; + items[] = {"ACE_EntrenchingTool"}; + name = ECSTRING(trenches,EntrenchingToolName); + text = ECSTRING(trenches,EntrenchingToolName); + }; + }; + }; + class SPE_US_G503_MB_M1919_base: SPE_G503_MB_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_tools_source: hide_tools_source { + positions[] = {{-0.7, 0.45, -0.9}}; + }; + }; + }; + class SPE_US_G503_MB_M1919_Armoured_base: SPE_G503_MB_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_tools_source: hide_tools_source { + positions[] = {{-0.7, 0.45, -0.9}}; + }; + }; + }; + class SPE_US_G503_MB_M1919_PATROL_base: SPE_G503_MB_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_tools_source: hide_tools_source { + positions[] = {{-0.7, 0.45, -0.9}}; + }; + }; + }; + class SPE_US_G503_MB_M2_base: SPE_G503_MB_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_tools_source: hide_tools_source { + positions[] = {{-0.7, 0.45, -0.9}}; + }; + }; + }; + class SPE_US_G503_MB_M2_Armoured_base: SPE_G503_MB_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_tools_source: hide_tools_source { + positions[] = {{-0.7, 0.45, -0.9}}; + }; + }; + }; + class SPE_US_G503_MB_M2_PATROL_base: SPE_G503_MB_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_tools_source: hide_tools_source { + positions[] = {{-0.7, 0.45, -0.9}}; + }; + }; + }; + class SPE_G503_MB_Ambulance_base: SPE_G503_MB_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_tools_source: hide_tools_source { + positions[] = {{-0.7, 0.45, -0.9}}; + }; + }; + }; + + class SPE_R200_base: SPE_Car_base { + class EGVAR(interaction,anims) { + class hide_shovel_source { + positions[] = {{0.5, 1.2, -1.05}}; + items[] = {"ACE_EntrenchingTool"}; + name = ECSTRING(trenches,EntrenchingToolName); + text = ECSTRING(trenches,EntrenchingToolName); + }; + }; + }; + + class SPE_Tank_base; + class SPE_PzKpfwV_base: SPE_Tank_base { + class EGVAR(interaction,anims) { + class tools_hide_source { + positions[] = {{-1.45, 0.7, -0.4}}; + items[] = {"ACE_EntrenchingTool", "ACE_wirecutter"}; + name = "$STR_a3_cfgeditorsubcategories_edsubcat_tools0"; + text = "$STR_a3_cfgeditorsubcategories_edsubcat_tools0"; + }; + }; + }; + + class SPE_PzKpfwVI_H1_base: SPE_Tank_base { + class EGVAR(interaction,anims) { + class tools_hide_source { + positions[] = {{0, 1, -0.6}, {1.1, 0.1, -0.6}}; + items[] = {"ACE_EntrenchingTool", "ACE_wirecutter"}; + name = "$STR_a3_cfgeditorsubcategories_edsubcat_tools0"; + text = "$STR_a3_cfgeditorsubcategories_edsubcat_tools0"; + }; + }; + }; + + class SPE_StuG_III_base: SPE_Tank_base { + class EGVAR(interaction,anims) { + class hide_tools_left_source { + positions[] = {{-1.4, -1.4, -0.7}, {-1, -2.2, -0.65}}; + items[] = {"ACE_EntrenchingTool", "ACE_wirecutter"}; + name = "$STR_a3_cfgeditorsubcategories_edsubcat_tools0"; + text = "$STR_a3_cfgeditorsubcategories_edsubcat_tools0"; + }; + }; + }; + + class SPE_Jagdpanther_G1_base: SPE_Tank_base { + class EGVAR(interaction,anims) { + class hide_tools_left_source { + positions[] = {{-1.4, 0.5, -0.7}}; + items[] = {"ACE_EntrenchingTool", "ACE_wirecutter"}; + name = "$STR_a3_cfgeditorsubcategories_edsubcat_tools0"; + text = "$STR_a3_cfgeditorsubcategories_edsubcat_tools0"; + }; + }; + }; +}; diff --git a/addons/compat_spe/compat_spe_trenches/config.cpp b/addons/compat_spe/compat_spe_trenches/config.cpp new file mode 100644 index 00000000000..1b742b57825 --- /dev/null +++ b/addons/compat_spe/compat_spe_trenches/config.cpp @@ -0,0 +1,27 @@ +#include "script_component.hpp" + +class CfgPatches { + class SUBADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { + "ww2_spe_assets_c_weapons_infantryweapons_c", + "ww2_spe_assets_c_vehicles_staticweapons_c", + "ww2_spe_assets_c_vehicles_weapons_c", + "ww2_spe_core_f_system_staticweapons_f", + "ww2_spe_core_c_core_c_eventhandlers", + "ace_trenches" + }; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {"johnb43"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + + addonRootClass = QUOTE(ADDON); + }; +}; + +#include "CfgVehicles.hpp" diff --git a/addons/compat_spe/compat_spe_trenches/script_component.hpp b/addons/compat_spe/compat_spe_trenches/script_component.hpp new file mode 100644 index 00000000000..10b90eb71e5 --- /dev/null +++ b/addons/compat_spe/compat_spe_trenches/script_component.hpp @@ -0,0 +1,3 @@ +#define SUBCOMPONENT trenches +#define SUBCOMPONENT_BEAUTIFIED Trenches +#include "..\script_component.hpp" diff --git a/addons/compat_ws/CfgVehicles.hpp b/addons/compat_ws/CfgVehicles.hpp new file mode 100644 index 00000000000..98dc922d982 --- /dev/null +++ b/addons/compat_ws/CfgVehicles.hpp @@ -0,0 +1,27 @@ +class CfgVehicles { + // Vehicle animation interactions + // Easier to not inherit + class Offroad_01_base_lxWS; + class Offroad_01_armor_base_lxWS: Offroad_01_base_lxWS { + class EGVAR(interaction,anims) { + class HideBackpacks { + positions[] = {{-1.15, -1.17, -0.66}, {1.05, -1.17, -0.66}, {1.05, -2.52, -0.66}}; + items[] = {"B_TacticalPack_blk", "B_TacticalPack_blk", "B_Carryall_khk", "B_Carryall_khk"}; + name = "$STR_a3_cfgvehicleclasses_backpacks0"; + text = "$STR_a3_cfgvehicleclasses_backpacks0"; + }; + }; + }; + + class Offroad_01_AT_lxWS; + class Offroad_01_armor_AT_lxWS: Offroad_01_AT_lxWS { + class EGVAR(interaction,anims) { + class HideBackpacks { + positions[] = {{-1.15, -1.27, -0.66}, {1.05, -1.27, -0.66}, {1.05, -2.62, -0.66}}; + items[] = {"B_TacticalPack_blk", "B_TacticalPack_blk", "B_Carryall_khk", "B_Carryall_khk"}; + name = "$STR_a3_cfgvehicleclasses_backpacks0"; + text = "$STR_a3_cfgvehicleclasses_backpacks0"; + }; + }; + }; +}; diff --git a/addons/compat_ws/compat_ws_realisticnames/CfgVehicles.hpp b/addons/compat_ws/compat_ws_realisticnames/CfgVehicles.hpp index fe1aed7e17d..5396b8f186c 100644 --- a/addons/compat_ws/compat_ws_realisticnames/CfgVehicles.hpp +++ b/addons/compat_ws/compat_ws_realisticnames/CfgVehicles.hpp @@ -57,4 +57,173 @@ class CfgVehicles { class B_ION_Heli_Light_02_unarmed_lxWS: O_Heli_Light_02_unarmed_F { displayName = SUBCSTRING(heli_light_02_unarmed_Name); }; + + #include "CfgVehiclesAttachments.hpp" + + // AA12 + class Weapon_Base_F; + class Weapon_sgun_aa40_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(AA40_Name); + }; + class Weapon_sgun_aa40_tan_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(AA40_Tan_Name); + }; + class Weapon_sgun_aa40_snake_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(AA40_Snake_Name); + }; + + // Galil ARM + class Weapon_arifle_Galat_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(Galat_Name); + }; + class Weapon_arifle_Galat_worn_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(Galat_Old_Name); + }; + + // GLX 160 + class Weapon_glaunch_GLX_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(GLX_Name); + }; + class Weapon_glaunch_GLX_snake_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(GLX_Snake_Name); + }; + class Weapon_glaunch_GLX_hex_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(GLX_Hex_Name); + }; + class Weapon_glaunch_GLX_ghex_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(GLX_GreenHex_Name); + }; + class Weapon_glaunch_GLX_camo_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(GLX_Camo_Name); + }; + class Weapon_glaunch_GLX_tan_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(GLX_Tan_Name); + }; + + // Mk14 Mod 1 EBR + class Weapon_srifle_EBR_blk_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(EBR_Black_Name); + }; + class Weapon_srifle_EBR_snake_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(EBR_Snake_Name); + }; + + // Vektor SS-77 + class Weapon_LMG_S77_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(S77_Name); + }; + class Weapon_LMG_S77_AAF_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(S77_AAF_Name); + }; + class Weapon_LMG_S77_Hex_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(S77_Hex_Name); + }; + class Weapon_LMG_S77_GHex_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(S77_GreenHex_Name); + }; + class Weapon_LMG_S77_Desert_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(S77_Desert_Name); + }; + + // Vektor SS-77 (Compact) + class Weapon_LMG_S77_Compact_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(S77_Compact_Name); + }; + class Weapon_LMG_S77_Compact_Snakeskin_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(S77_Compact_Snake_Name); + }; + + // FN FAL (Wood) - Closest match is the 50.00 + class Weapon_arifle_SLR_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(SLR_Wood_Name); + }; + class Weapon_arifle_SLR_GL_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(SLR_GL_Wood_Name); + }; + + // FN FAL + class Weapon_arifle_SLR_V_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(SLR_Name); + }; + class Weapon_arifle_SLR_V_GL_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(SLR_GL_Name); + }; + class Weapon_arifle_SLR_D_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(SLR_Desert_Name); + }; + class Weapon_arifle_SLR_V_camo_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(SLR_Camo_Name); + }; + class Weapon_arifle_SLR_Para_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(SLR_Para_Name); + }; + class Weapon_arifle_SLR_Para_snake_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(SLR_Para_Snake_Name); + }; + + // Vektor R4/R5 + class Weapon_arifle_Velko_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(Velko_R4_Name); + }; + class Weapon_arifle_VelkoR5_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(Velko_R5_Name); + }; + class Weapon_arifle_VelkoR5_GL_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(Velko_R5_GL_Name); + }; + class Weapon_arifle_VelkoR5_snake_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(Velko_R5_Snake_Name); + }; + class Weapon_arifle_VelkoR5_GL_snake_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(Velko_R5_GL_Snake_Name); + }; + + // XMS has no realistic name as it's a make believe hybrid of the XM8/VHS-K2: XM8+VHS = XMS, this just removes the 5.56 mm from the name. + class Weapon_arifle_XMS_Base_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(XMS_Name); + }; + class Weapon_arifle_XMS_Base_khk_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(XMS_Khaki_Name); + }; + class Weapon_arifle_XMS_Base_Sand_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(XMS_Sand_Name); + }; + class Weapon_arifle_XMS_GL_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(XMS_GL_Name); + }; + class Weapon_arifle_XMS_GL_khk_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(XMS_GL_Khaki_Name); + }; + class Weapon_arifle_XMS_GL_Sand_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(XMS_GL_Sand_Name); + }; + class Weapon_arifle_XMS_Shot_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(XMS_SG_Name); + }; + class Weapon_arifle_XMS_Shot_khk_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(XMS_SG_Khaki_Name); + }; + class Weapon_arifle_XMS_Shot_Sand_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(XMS_SG_Sand_Name); + }; + class Weapon_arifle_XMS_M_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(XMS_SW_Name); + }; + class arifle_XMS_M_khk_lxWS: Weapon_Base_F { + diWeapon_splayName = SUBCSTRING(XMS_SW_Khaki_Name); + }; + class Weapon_arifle_XMS_M_Sand_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(XMS_SW_Sand_Name); + }; + + // GM6 Lynx + class Weapon_srifle_GM6_snake_lxWS: Weapon_Base_F { + displayName = SUBCSTRING(gm6_snake_Name); + }; + + // RPG-32 + class Launcher_Base_F; + class Weapon_launch_RPG32_tan_lxWS: Launcher_Base_F { + displayName = SUBCSTRING(rpg32_tan_Name); + }; }; diff --git a/addons/compat_ws/compat_ws_realisticnames/CfgVehiclesAttachments.hpp b/addons/compat_ws/compat_ws_realisticnames/CfgVehiclesAttachments.hpp new file mode 100644 index 00000000000..5dbeab9bc48 --- /dev/null +++ b/addons/compat_ws/compat_ws_realisticnames/CfgVehiclesAttachments.hpp @@ -0,0 +1,71 @@ +// Attachments +class Item_Base_F; +class Item_optic_arco_hex_lxWS: Item_Base_F { + displayName = SUBCSTRING(arco_hex_Name); +}; + +class Item_optic_Holosight_snake_lxWS: Item_Base_F { + displayName = SUBCSTRING(holosight_snake_Name); +}; + +class Item_optic_Holosight_smg_snake_lxWS: Item_Base_F { + displayName = SUBCSTRING(holosight_snake_smg_Name); +}; + +class Item_optic_Hamr_arid_lxWS: Item_Base_F { + displayName = SUBCSTRING(hamr_arid_Name); +}; +class Item_optic_Hamr_lush_lxWS: Item_Base_F { + displayName = SUBCSTRING(hamr_lush_Name); +}; +class Item_optic_Hamr_sand_lxWS: Item_Base_F { + displayName = SUBCSTRING(hamr_sand_Name); +}; +class Item_optic_Hamr_snake_lxWS: Item_Base_F { + displayName = SUBCSTRING(hamr_snake_Name); +}; + +class Item_optic_r1_high_lxWS: Item_Base_F { + displayName = SUBCSTRING(r1_high_black_Name); +}; +class Item_optic_r1_high_khaki_lxWS: Item_Base_F { + displayName = SUBCSTRING(r1_high_khaki_Name); +}; +class Item_optic_r1_high_sand_lxWS: Item_Base_F { + displayName = SUBCSTRING(r1_high_sand_Name); +}; +class Item_optic_r1_high_snake_lxWS: Item_Base_F { + displayName = SUBCSTRING(r1_high_snake_Name); +}; +class Item_optic_r1_high_arid_lxWS: Item_Base_F { + displayName = SUBCSTRING(r1_high_arid_Name); +}; +class Item_optic_r1_high_lush_lxWS: Item_Base_F { + displayName = SUBCSTRING(r1_high_lush_Name); +}; +class Item_optic_r1_high_black_sand_lxWS: Item_Base_F { + displayName = SUBCSTRING(r1_high_black_sand_Name); +}; + +class Item_optic_r1_low_lxWS: Item_Base_F { + displayName = SUBCSTRING(r1_low_black_Name); +}; +class Item_optic_r1_low_khaki_lxWS: Item_Base_F { + displayName = SUBCSTRING(r1_low_khaki_Name); +}; +class Item_optic_r1_low_sand_lxWS: Item_Base_F { + displayName = SUBCSTRING(r1_low_sand_Name); +}; +class Item_optic_r1_low_snake_lxWS: Item_Base_F { + displayName = SUBCSTRING(r1_low_snake_Name); +}; +class Item_optic_r1_low_arid_lxWS: Item_Base_F { + displayName = SUBCSTRING(r1_low_arid_Name); +}; +class Item_optic_r1_low_lush_lxWS: Item_Base_F { + displayName = SUBCSTRING(r1_low_lush_Name); +}; + +class Item_optic_DMS_snake_lxWS: Item_Base_F { + displayName = SUBCSTRING(dms_snake_Name); +}; diff --git a/addons/compat_ws/compat_ws_realisticnames/CfgWeapons.hpp b/addons/compat_ws/compat_ws_realisticnames/CfgWeapons.hpp index e9cf3c6934d..b1929a49043 100644 --- a/addons/compat_ws/compat_ws_realisticnames/CfgWeapons.hpp +++ b/addons/compat_ws/compat_ws_realisticnames/CfgWeapons.hpp @@ -1,5 +1,5 @@ class CfgWeapons { - #include "Attachments.hpp" + #include "CfgWeaponsAttachments.hpp" // AA12 class sgun_aa40_base_lxWS; diff --git a/addons/compat_ws/compat_ws_realisticnames/Attachments.hpp b/addons/compat_ws/compat_ws_realisticnames/CfgWeaponsAttachments.hpp similarity index 99% rename from addons/compat_ws/compat_ws_realisticnames/Attachments.hpp rename to addons/compat_ws/compat_ws_realisticnames/CfgWeaponsAttachments.hpp index 95801e04e92..a805e82edcf 100644 --- a/addons/compat_ws/compat_ws_realisticnames/Attachments.hpp +++ b/addons/compat_ws/compat_ws_realisticnames/CfgWeaponsAttachments.hpp @@ -1,3 +1,4 @@ +// Attachments class optic_Arco; class optic_arco_hex_lxWS: optic_Arco { displayName = SUBCSTRING(arco_hex_Name); diff --git a/addons/compat_ws/compat_ws_realisticnames/config.cpp b/addons/compat_ws/compat_ws_realisticnames/config.cpp index 0eb75926a82..167e83fa356 100644 --- a/addons/compat_ws/compat_ws_realisticnames/config.cpp +++ b/addons/compat_ws/compat_ws_realisticnames/config.cpp @@ -15,6 +15,8 @@ class CfgPatches { authors[] = {"Mike"}; url = ECSTRING(main,URL); VERSION_CONFIG; + + addonRootClass = QUOTE(ADDON); }; }; diff --git a/addons/compat_ws/compat_ws_realisticnames/stringtable.xml b/addons/compat_ws/compat_ws_realisticnames/stringtable.xml index 606bbb79326..9da3af7b05f 100644 --- a/addons/compat_ws/compat_ws_realisticnames/stringtable.xml +++ b/addons/compat_ws/compat_ws_realisticnames/stringtable.xml @@ -29,6 +29,7 @@ <Japanese>AA12 (ヘビ柄迷彩)</Japanese> <Russian>AA12 (Змея)</Russian> <Spanish>AA12 (Serpiente)</Spanish> + <French>AA12 (Sable)</French> </Key> <Key ID="STR_ACE_Compat_WS_RealisticNames_Galat_Name"> <English>Galil ARM</English> @@ -68,6 +69,7 @@ <Japanese>GLX 160 (ヘビ柄迷彩)</Japanese> <Russian>GLX 160 (Змея)</Russian> <Spanish>GLX 160 (Serpiente)</Spanish> + <French>GLX 160</French> </Key> <Key ID="STR_ACE_Compat_WS_RealisticNames_GLX_Hex_Name"> <English>GLX 160 (Hex)</English> @@ -127,6 +129,7 @@ <Japanese>Mk14 Mod 1 EBR (ヘビ柄迷彩)</Japanese> <Russian>Mk14 Mod 1 EBR (Змея)</Russian> <Spanish>Mk14 Mod 1 EBR (Serpiente)</Spanish> + <French>Mk14 Mod 1 EBR (Serpent)</French> </Key> <Key ID="STR_ACE_Compat_WS_RealisticNames_S77_Name"> <English>Vektor SS-77</English> @@ -195,6 +198,7 @@ <Japanese>ヴェクター SS-77 コンパクト (ヘビ柄迷彩)</Japanese> <Russian>Vektor SS-77 Compact (змея)</Russian> <Spanish>Vektor SS-77 Compacta (Serpiente)</Spanish> + <French>Vektor SS-77 Compacte (Serpent)</French> </Key> <Key ID="STR_ACE_Compat_WS_RealisticNames_SLR_Wood_Name"> <English>FN FAL 50.00 (Wood)</English> @@ -262,6 +266,7 @@ <Korean>FN FAL OSW 파라</Korean> <German>FN FAL OSW Fallschirmjäger</German> <Italian>FN FAL OSW Para</Italian> + <French>FN FAL OSW Para</French> </Key> <Key ID="STR_ACE_Compat_WS_RealisticNames_SLR_Para_Snake_Name"> <English>FN FAL OSW Para (Snake)</English> @@ -269,6 +274,7 @@ <Korean>FN FAL OSW 파라 (뱀 위장)</Korean> <German>FN FAL OSW Fallschirmjäger (Schlange)</German> <Italian>FN FAL OSW Para (Serpe)</Italian> + <French>FN FAL OSW Para (Serpent)</French> </Key> <Key ID="STR_ACE_Compat_WS_RealisticNames_Velko_R4_Name"> <English>Vektor R4</English> @@ -308,6 +314,7 @@ <Japanese>ヴェクター R5 カービン (ヘビ柄迷彩)</Japanese> <Russian>Vektor R5 Carbine (Змея)</Russian> <Spanish>Vektor R5 Carabina (Serpiente)</Spanish> + <French>Vektor R5 Carbine (Serpent)</French> </Key> <Key ID="STR_ACE_Compat_WS_RealisticNames_Velko_R5_GL_Snake_Name"> <English>Vektor R5 Carbine GL (Snake)</English> @@ -317,6 +324,7 @@ <Japanese>ヴェクター R5 カービン GL (ヘビ柄迷彩)</Japanese> <Russian>Vektor R5 Carbine GL (Змея)</Russian> <Spanish>Vektor R5 Carabina GL (Serpiente)</Spanish> + <French>Vektor R5 Carbine GL (Serpent)</French> </Key> <Key ID="STR_ACE_Compat_WS_RealisticNames_XMS_Name"> <English>XMS</English> @@ -468,6 +476,7 @@ <Korean>GM6 링스 (뱀 위장)</Korean> <German>GM6 Lynx (Schlange)</German> <Italian>GM6 Lynx (Serpe)</Italian> + <French>GM6 Lynx (Serpent)</French> </Key> <Key ID="STR_ACE_Compat_WS_RealisticNames_rpg32_tan_Name"> <English>RPG-32 (Sand)</English> @@ -475,6 +484,7 @@ <Korean>RPG-32 (모래)</Korean> <German>RPG-32 (Sand)</German> <Italian>RPG-32 (Sabbia)</Italian> + <French>RPG-32 (Sable)</French> </Key> <Key ID="STR_ACE_Compat_WS_RealisticNames_arco_hex_Name"> <English>ELCAN SpecterOS (Hex)</English> @@ -482,6 +492,7 @@ <Korean>엘칸 스펙터OS (육각)</Korean> <German>ELCAN SpecterOS (Hex)</German> <Italian>ELCAN SpecterOS (Hex)</Italian> + <French>ELCAN SpecterOS (Hex)</French> </Key> <Key ID="STR_ACE_Compat_WS_RealisticNames_holosight_snake_Name"> <English>EOTech XPS3 (Snake)</English> @@ -489,6 +500,7 @@ <Korean>이오텍 XPS3 (뱀 위장)</Korean> <German>EOTech XPS3 (Schlange)</German> <Italian>EOTech XPS3 (Serpe)</Italian> + <French>EOTech XPS3 (Serpent)</French> </Key> <Key ID="STR_ACE_Compat_WS_RealisticNames_holosight_snake_smg_Name"> <English>EOTech XPS3 SMG (Snake)</English> @@ -496,6 +508,7 @@ <Korean>이오텍 XPS3 SMG (뱀 위장)</Korean> <German>EOTech XPS3 SMG (Schlange)</German> <Italian>EOTech XPS3 SMG (Serpe)</Italian> + <French>EOTech XPS3 SMG (Serpent)</French> </Key> <Key ID="STR_ACE_Compat_WS_RealisticNames_hamr_arid_Name"> <English>Leupold Mark 4 HAMR (Arid)</English> @@ -503,6 +516,7 @@ <Korean>류폴드 마크 4 HAMR (건조)</Korean> <German>Leupold Mark 4 HAMR (Trocken)</German> <Italian>Leupold Mark 4 HAMR (Arido)</Italian> + <French>Leupold Mark 4 HAMR (Aride)</French> </Key> <Key ID="STR_ACE_Compat_WS_RealisticNames_hamr_lush_Name"> <English>Leupold Mark 4 HAMR (Lush)</English> @@ -510,6 +524,7 @@ <Korean>류폴드 마크 4 HAMR (초목)</Korean> <German>Leupold Mark 4 HAMR (Grün)</German> <Italian>Leupold Mark 4 HAMR (Verdeggiante)</Italian> + <French>Leupold Mark 4 HAMR (Vert)</French> </Key> <Key ID="STR_ACE_Compat_WS_RealisticNames_hamr_sand_Name"> <English>Leupold Mark 4 HAMR (Sand)</English> @@ -517,6 +532,7 @@ <Korean>류폴드 마크 4 HAMR (모래)</Korean> <German>Leupold Mark 4 HAMR (Sand)</German> <Italian>Leupold Mark 4 HAMR (Sabbia)</Italian> + <French>Leupold Mark 4 HAMR (Sable)</French> </Key> <Key ID="STR_ACE_Compat_WS_RealisticNames_hamr_snake_Name"> <English>Leupold Mark 4 HAMR (Snake)</English> @@ -524,6 +540,7 @@ <Korean>류폴드 마크 4 HAMR (뱀 위장)</Korean> <German>Leupold Mark 4 HAMR (Schlange)</German> <Italian>Leupold Mark 4 HAMR (Serpe)</Italian> + <French>Leupold Mark 4 HAMR (Serpent)</French> </Key> <Key ID="STR_ACE_Compat_WS_RealisticNames_r1_high_black_Name"> <English>Aimpoint Micro R-1 (High, Black)</English> @@ -531,6 +548,7 @@ <Korean>에임포인트 마이크로 R-1 (높음, 검정)</Korean> <German>Aimpoint Micro R-1 (Hoch, Schwarz)</German> <Italian>Aimpoint Micro R-1 (Alto, Nero)</Italian> + <French>Aimpoint Micro R-1 (Haut, Noir)</French> </Key> <Key ID="STR_ACE_Compat_WS_RealisticNames_r1_high_khaki_Name"> <English>Aimpoint Micro R-1 (High, Khaki)</English> @@ -538,6 +556,7 @@ <Korean>에임포인트 마이크로 R-1 (높음, 카키)</Korean> <German>Aimpoint Micro R-1 (Hoch, Khaki)</German> <Italian>Aimpoint Micro R-1 (Alto, Cachi)</Italian> + <French>Aimpoint Micro R-1 (Haut, Kaki)</French> </Key> <Key ID="STR_ACE_Compat_WS_RealisticNames_r1_high_sand_Name"> <English>Aimpoint Micro R-1 (High, Sand)</English> @@ -545,6 +564,7 @@ <Korean>에임포인트 마이크로 R-1 (높음, 모래)</Korean> <German>Aimpoint Micro R-1 (Hoch, Sand)</German> <Italian>Aimpoint Micro R-1 (Alto, Sabbia)</Italian> + <French>Aimpoint Micro R-1 (Haut, Sable)</French> </Key> <Key ID="STR_ACE_Compat_WS_RealisticNames_r1_high_snake_Name"> <English>Aimpoint Micro R-1 (High, Snake)</English> @@ -552,6 +572,7 @@ <Korean>에임포인트 마이크로 R-1 (높음, 뱀 위장)</Korean> <German>Aimpoint Micro R-1 (Hoch, Schlange)</German> <Italian>Aimpoint Micro R-1 (Alto, Serpe)</Italian> + <French>Aimpoint Micro R-1 (Haut, Serpent)</French> </Key> <Key ID="STR_ACE_Compat_WS_RealisticNames_r1_high_arid_Name"> <English>Aimpoint Micro R-1 (High, Arid)</English> @@ -559,6 +580,7 @@ <Korean>에임포인트 마이크로 R-1 (높음, 건조)</Korean> <German>Aimpoint Micro R-1 (Hoch, Trocken)</German> <Italian>Aimpoint Micro R-1 (Alto, Arido)</Italian> + <French>Aimpoint Micro R-1 (Hoch, Arid</French> </Key> <Key ID="STR_ACE_Compat_WS_RealisticNames_r1_high_lush_Name"> <English>Aimpoint Micro R-1 (High, Lush)</English> @@ -566,6 +588,7 @@ <Korean>에임포인트 마이크로 R-1 (높음, 초목)</Korean> <German>Aimpoint Micro R-1 (Hoch, Grün)</German> <Italian>Aimpoint Micro R-1 (Alto, Verdeggiante)</Italian> + <French>Aimpoint Micro R-1 (Haute, Vert)</French> </Key> <Key ID="STR_ACE_Compat_WS_RealisticNames_r1_high_black_sand_Name"> <English>Aimpoint Micro R-1 (High, Black/Sand)</English> @@ -573,6 +596,7 @@ <Korean>에임포인트 마이크로 R-1 (높음, 검정/모래)</Korean> <German>Aimpoint Micro R-1 (Hoch, Schwarz/Sand)</German> <Italian>Aimpoint Micro R-1 (Alto, Nero/Sabbia)</Italian> + <French>Aimpoint Micro R-1 (Haut, Noir/Sable)</French> </Key> <Key ID="STR_ACE_Compat_WS_RealisticNames_r1_low_black_Name"> <English>Aimpoint Micro R-1 (Low, Black)</English> @@ -580,6 +604,7 @@ <Korean>에임포인트 마이크로 R-1 (낮음, 검정)</Korean> <German>Aimpoint Micro R-1 (Tief, Schwarz)</German> <Italian>Aimpoint Micro R-1 (Basso, Nero)</Italian> + <French>Aimpoint Micro R-1 (Bas, Noir)</French> </Key> <Key ID="STR_ACE_Compat_WS_RealisticNames_r1_low_khaki_Name"> <English>Aimpoint Micro R-1 (Low, Khaki)</English> @@ -587,6 +612,7 @@ <Korean>에임포인트 마이크로 R-1 (낮음, 카키)</Korean> <German>Aimpoint Micro R-1 (Tief, Khaki)</German> <Italian>Aimpoint Micro R-1 (Basso, Cachi)</Italian> + <French>Aimpoint Micro R-1 (Bas, Kaki)</French> </Key> <Key ID="STR_ACE_Compat_WS_RealisticNames_r1_low_sand_Name"> <English>Aimpoint Micro R-1 (Low, Sand)</English> @@ -594,6 +620,7 @@ <Korean>에임포인트 마이크로 R-1 (낮음, 모래)</Korean> <German>Aimpoint Micro R-1 (Tief, Sand)</German> <Italian>Aimpoint Micro R-1 (Basso, Sabbia)</Italian> + <French>Aimpoint Micro R-1 ( Bas, Sable )</French> </Key> <Key ID="STR_ACE_Compat_WS_RealisticNames_r1_low_snake_Name"> <English>Aimpoint Micro R-1 (Low, Snake)</English> @@ -601,6 +628,7 @@ <Korean>에임포인트 마이크로 R-1 (낮음, 뱀 위장)</Korean> <German>Aimpoint Micro R-1 (Tief, Schlange)</German> <Italian>Aimpoint Micro R-1 (Basso, Serpe)</Italian> + <French>Aimpoint Micro R-1 (Bas, Serpent)</French> </Key> <Key ID="STR_ACE_Compat_WS_RealisticNames_r1_low_arid_Name"> <English>Aimpoint Micro R-1 (Low, Arid)</English> @@ -608,6 +636,7 @@ <Korean>에임포인트 마이크로 R-1 (낮음, 건조)</Korean> <German>Aimpoint Micro R-1 (Tief, Trocken)</German> <Italian>Aimpoint Micro R-1 (Basso, Arido)</Italian> + <French>Aimpoint Micro R-1 (Bas, Arid)</French> </Key> <Key ID="STR_ACE_Compat_WS_RealisticNames_r1_low_lush_Name"> <English>Aimpoint Micro R-1 (Low, Lush)</English> @@ -615,6 +644,7 @@ <Korean>에임포인트 마이크로 R-1 (낮음, 초목)</Korean> <German>Aimpoint Micro R-1 (Tief, Grün)</German> <Italian>Aimpoint Micro R-1 (Basso, Verdeggiante)</Italian> + <French>Aimpoint Micro R-1 (Bas, Vert)</French> </Key> <Key ID="STR_ACE_Compat_WS_RealisticNames_dms_snake_Name"> <English>Burris XTR II (Snake)</English> @@ -622,6 +652,7 @@ <Korean>버리스 XTR II (뱀 위장)</Korean> <German>Burris XTR II (Schlange)</German> <Italian>Burris XTR II (Serpe)</Italian> + <French>Burris XTR II (Serpent)</French> </Key> <Key ID="STR_ACE_Compat_WS_RealisticNames_apc_wheeled_01_atgm_Name"> <English>Badger IFV (ATGM)</English> @@ -629,6 +660,7 @@ <Korean>뱃져 보병전투차 (대전차미사일)</Korean> <German>Badger IFV (PzAbw)</German> <Italian>Badger IFV (ATGM)</Italian> + <French>Badger IFV (ATGM)</French> </Key> <Key ID="STR_ACE_Compat_WS_RealisticNames_apc_wheeled_01_command_Name"> <English>Badger IFV (Command)</English> @@ -636,6 +668,7 @@ <Korean>뱃져 보병전투차 (지휘)</Korean> <German>Badger IFV (Kommando)</German> <Italian>Badger IFV (Comando)</Italian> + <French>Badger IFV (Commandement)</French> </Key> <Key ID="STR_ACE_Compat_WS_RealisticNames_apc_wheeled_01_mortar_Name"> <English>Badger IFV (Mortar)</English> @@ -643,6 +676,7 @@ <Korean>뱃져 보병전투차 (자주박격포)</Korean> <German>Badger IFV (Mörser)</German> <Italian>Badger IFV (Mortaio)</Italian> + <French>Badger IFV (mortier)</French> </Key> <Key ID="STR_ACE_Compat_WS_RealisticNames_truck_02_aa_Name"> <English>KamAZ (Zu-23-2)</English> @@ -650,6 +684,7 @@ <Korean>카마즈 (ZU-23-2)</Korean> <German>KamAZ (Zu-23-2)</German> <Italian>KamAZ (Zu-23-2)</Italian> + <French>KamAZ (Zu-23-2)</French> </Key> <Key ID="STR_ACE_Compat_WS_RealisticNames_truck_02_cargo_Name"> <English>KamAZ Cargo</English> @@ -657,6 +692,7 @@ <Korean>카마즈 화물</Korean> <German>KamAZ Fracht</German> <Italian>KamAZ Carico</Italian> + <French>KamAZ Cargo</French> </Key> <Key ID="STR_ACE_Compat_WS_RealisticNames_truck_02_repair_Name"> <English>KamAZ Repair</English> @@ -664,6 +700,7 @@ <Korean>카마즈 정비</Korean> <German>KamAZ Instandsetzung</German> <Italian>KamAZ Riparazione</Italian> + <French>KamAZ Réparation</French> </Key> <Key ID="STR_ACE_Compat_WS_RealisticNames_truck_02_racing_Name"> <English>KamAZ Racing</English> @@ -671,6 +708,7 @@ <Korean>카마즈 경주용</Korean> <German>KamAZ Rennlaster</German> <Italian>KamAZ da corsa</Italian> + <French>KamAZ de course</French> </Key> <Key ID="STR_ACE_Compat_WS_RealisticNames_truck_02_ammo_Name"> <English>KamAZ Ammo</English> @@ -678,6 +716,7 @@ <Korean>카마즈 탄약</Korean> <German>KamAZ Munition</German> <Italian>KamAZ Munizioni</Italian> + <French>KamAZ Munitions</French> </Key> <Key ID="STR_ACE_Compat_WS_RealisticNames_truck_02_flatbed_Name"> <English>KamAZ Flatbed</English> @@ -685,6 +724,7 @@ <Korean>카마즈 플랫베드</Korean> <German>KamAZ Flachbett</German> <Italian>KamAZ Pianale</Italian> + <French>KamAZ Flatbed</French> </Key> <Key ID="STR_ACE_Compat_WS_RealisticNames_heli_transport_02_Name"> <English>AW101 Merlin</English> @@ -692,6 +732,7 @@ <Korean>AW101 멀린</Korean> <German>AW101 Merlin</German> <Italian>AW101 Merlin</Italian> + <French>AW101 Merlin</French> </Key> <Key ID="STR_ACE_Compat_WS_RealisticNames_apc_tracked_02_Name"> <English>BM-2T Stalker (Bumerang-BM)</English> @@ -699,20 +740,23 @@ <Korean>BM-2T 스토커 (부메랑-BM)</Korean> <German>BM-2T Stalker (Bumerang-BM)</German> <Italian>BM-2T Stalker (Bumerang-BM)</Italian> + <French>BM-2T Stalker (Boomerang-BM)</French> </Key> <Key ID="STR_ACE_Compat_WS_RealisticNames_apc_wheeled_02_hmg_Name"> <English>Otokar ARMA (HMG)</English> <Japanese>オトカ アルマ (HMG)</Japanese> - <Korean>오토카르 아르마 APC (중기관총)</Korean> + <Korean>오토카 아르마 APC (중기관총)</Korean> <German>Otokar ARMA (HMG)</German> <Italian>Otokar ARMA (HMG)</Italian> + <French>Otokar ARMA (HMG)</French> </Key> <Key ID="STR_ACE_Compat_WS_RealisticNames_apc_wheeled_02_unarmed_Name"> <English>Otokar ARMA (Unarmed)</English> <Japanese>オトカ アルマ (非武装)</Japanese> - <Korean>오토카르 아르마 APC (비무장)</Korean> + <Korean>오토카 아르마 APC (비무장)</Korean> <German>Otokar ARMA (Unbewaffnet)</German> <Italian>Otokar ARMA (Disarmato)</Italian> + <French>Otokar ARMA (non armé)</French> </Key> <Key ID="STR_ACE_Compat_WS_RealisticNames_heli_light_02_armed_Name"> <English>Ka-60 Kasatka (UP)</English> @@ -720,6 +764,7 @@ <Korean>Ka-60 카사트카 (UP)</Korean> <German>Ka-60 Kasatka (UP)</German> <Italian>Ka-60 Kasatka (UP)</Italian> + <French>Ka-60 Kasatka (UP)</French> </Key> <Key ID="STR_ACE_Compat_WS_RealisticNames_heli_light_02_unarmed_Name"> <English>Ka-60 Kasatka (UP, Unarmed)</English> @@ -727,6 +772,7 @@ <Korean>Ka-60 카사트카 (UP, 비무장))</Korean> <German>Ka-60 Kasatka (UP, Unbewaffnet)</German> <Italian>Ka-60 Kasatka (UP, Disarmato)</Italian> + <French>Ka-60 Kasatka (UP, non armé)</French> </Key> </Package> </Project> diff --git a/addons/compat_ws/compat_ws_repair/CfgVehicles.hpp b/addons/compat_ws/compat_ws_repair/CfgVehicles.hpp new file mode 100644 index 00000000000..d7fcbc7cd97 --- /dev/null +++ b/addons/compat_ws/compat_ws_repair/CfgVehicles.hpp @@ -0,0 +1,34 @@ +class CfgVehicles { + // Vehicle animation interactions + class Truck_02_base_F; + class Truck_02_aa_base_lxWS: Truck_02_base_F { + class EGVAR(interaction,anims) { + class hideSpareWheel { + positions[] = {{1, 1.93, -0.85}}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + class Truck_02_cargo_base_lxWS: Truck_02_base_F { + class EGVAR(interaction,anims) { + class hideSpareWheel { + positions[] = {{1, 1.93, -0.35}}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + class Truck_02_box_base_lxWS: Truck_02_base_F { + class EGVAR(interaction,anims) { + class hideSpareWheel { + positions[] = {{1, 1.7, -0.35}}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; +}; diff --git a/addons/compat_ws/compat_ws_repair/config.cpp b/addons/compat_ws/compat_ws_repair/config.cpp new file mode 100644 index 00000000000..4f37c831cb6 --- /dev/null +++ b/addons/compat_ws/compat_ws_repair/config.cpp @@ -0,0 +1,20 @@ +#include "script_component.hpp" + +class CfgPatches { + class SUBADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"data_f_lxWS_Loadorder", "ace_repair"}; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {"johnb43"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + + addonRootClass = QUOTE(ADDON); + }; +}; + +#include "CfgVehicles.hpp" diff --git a/addons/compat_ws/compat_ws_repair/script_component.hpp b/addons/compat_ws/compat_ws_repair/script_component.hpp new file mode 100644 index 00000000000..1af928486c3 --- /dev/null +++ b/addons/compat_ws/compat_ws_repair/script_component.hpp @@ -0,0 +1,3 @@ +#define SUBCOMPONENT repair +#define SUBCOMPONENT_BEAUTIFIED Repair +#include "..\script_component.hpp" diff --git a/addons/compat_ws/compat_ws_vehicles/CfgVehicles.hpp b/addons/compat_ws/compat_ws_vehicles/CfgVehicles.hpp new file mode 100644 index 00000000000..ffc69d60758 --- /dev/null +++ b/addons/compat_ws/compat_ws_vehicles/CfgVehicles.hpp @@ -0,0 +1,27 @@ +class CfgVehicles { + class Car_F; + class Wheeled_APC_F: Car_F { + class Turrets { + class MainTurret; + }; + }; + class APC_Wheeled_01_base_F: Wheeled_APC_F { + class Turrets: Turrets { + class MainTurret: MainTurret {}; + }; + }; + class APC_Wheeled_01_atgm_base_lxWS: APC_Wheeled_01_base_F { + class Turrets: Turrets { + class MainTurret: MainTurret { + weapons[] = {"autocannon_40mm_CTWS", "ACE_LMG_coax_MAG58_mem3", "missiles_titan"}; // For realistic MG name + }; + }; + }; + class APC_Wheeled_01_command_base_lxWS: APC_Wheeled_01_base_F { + class Turrets: Turrets { + class MainTurret: MainTurret { + weapons[] = {"HMG_127_lxWS", "ACE_LMG_coax_MAG58_mem3"}; // For realistic MG name + }; + }; + }; +}; diff --git a/addons/compat_ws/compat_ws_vehicles/config.cpp b/addons/compat_ws/compat_ws_vehicles/config.cpp new file mode 100644 index 00000000000..07d6c1f608c --- /dev/null +++ b/addons/compat_ws/compat_ws_vehicles/config.cpp @@ -0,0 +1,23 @@ +#include "script_component.hpp" + +class CfgPatches { + class SUBADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { + "data_f_lxWS_Loadorder", + "ace_vehicles" + }; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {"johnb43"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + + addonRootClass = QUOTE(ADDON); + }; +}; + +#include "CfgVehicles.hpp" diff --git a/addons/compat_ws/compat_ws_vehicles/script_component.hpp b/addons/compat_ws/compat_ws_vehicles/script_component.hpp new file mode 100644 index 00000000000..17370c415fd --- /dev/null +++ b/addons/compat_ws/compat_ws_vehicles/script_component.hpp @@ -0,0 +1,3 @@ +#define SUBCOMPONENT vehicles +#define SUBCOMPONENT_BEAUTIFIED Vehicles +#include "..\script_component.hpp" diff --git a/addons/compat_ws/config.cpp b/addons/compat_ws/config.cpp index 32a3f6f73cb..54a6df99eec 100644 --- a/addons/compat_ws/config.cpp +++ b/addons/compat_ws/config.cpp @@ -6,7 +6,7 @@ class CfgPatches { units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"data_f_lxWS_Loadorder"}; + requiredAddons[] = {"data_f_lxWS_Loadorder", "ace_common"}; skipWhenMissingDependencies = 1; author = ECSTRING(common,ACETeam); authors[] = {"Mike"}; @@ -15,4 +15,5 @@ class CfgPatches { }; }; +#include "CfgVehicles.hpp" #include "CfgWeapons.hpp" diff --git a/addons/concertina_wire/functions/fnc_deploy.sqf b/addons/concertina_wire/functions/fnc_deploy.sqf index c915109e1b0..b1699ffc857 100644 --- a/addons/concertina_wire/functions/fnc_deploy.sqf +++ b/addons/concertina_wire/functions/fnc_deploy.sqf @@ -48,7 +48,7 @@ GVAR(deployPFH) = [{ private _anim = 0 max (1 - (_range / 12)); if (!(alive _unit) || _range >= 12 || (_unit getVariable [QGVAR(wireDeployed), false])) exitWith { - private _wire = "ACE_ConcertinaWire" createvehicle [0, 0, 0]; + private _wire = "ACE_ConcertinaWire" createVehicle [0, 0, 0]; { _wire animate [_x, _anim]; } forEach WIRE_FAST; diff --git a/addons/concertina_wire/functions/fnc_dismountSuccess.sqf b/addons/concertina_wire/functions/fnc_dismountSuccess.sqf index 86aac9e8bf5..d90d3931dab 100644 --- a/addons/concertina_wire/functions/fnc_dismountSuccess.sqf +++ b/addons/concertina_wire/functions/fnc_dismountSuccess.sqf @@ -31,7 +31,7 @@ params ["_wire"]; private _dir = getDir _wire; private _pos = getPosASL _wire; - private _wirecoil = "ACE_ConcertinaWireCoil" createvehicle [0, 0, 0]; + private _wirecoil = "ACE_ConcertinaWireCoil" createVehicle [0, 0, 0]; deleteVehicle _wire; diff --git a/addons/cookoff/functions/fnc_cookOffLocal.sqf b/addons/cookoff/functions/fnc_cookOffLocal.sqf index cbd160bba1d..4c61a4e5a63 100644 --- a/addons/cookoff/functions/fnc_cookOffLocal.sqf +++ b/addons/cookoff/functions/fnc_cookOffLocal.sqf @@ -7,7 +7,7 @@ * 0: Vehicle <OBJECT> * 1: Spawn fire jet <BOOL> * 2: Spawn fire ring <BOOL> - * 3: What selection fire will originate from <STRING> + * 3: What selection fire will originate from <STRING><ARRAY> * 4: Cookoff intensity value <NUMBER> * 5: Start time <NUMBER> * 6: Duration of effect (max 20 seconds) <NUMBER> @@ -127,12 +127,13 @@ if (isServer) then { if (_ring) then { private _ringOrigin = (_vehicle selectionPosition _fireSelection) vectorAdd [-0.1 + random 0.2, -0.1 + random 0.2, -1]; + private _dir = 20 * (_factor / 2); drop [ - ["\A3\data_f\ParticleEffects\Universal\Universal",16,2,32], + ["\A3\data_f\ParticleEffects\Universal\Universal", 16, 2, 32], "", "Billboard", 1, (0.1 + random 0.2) * _factor, _ringOrigin, - [0, 20 * (_factor / 2), 0], + [0, _dir, 0], 0, 10, 7.9, 0.075, [1.25 * _factor, FLAME_SIZE * _factor], [[1, 1, 1, -2], [1, 1, 1, -2], [1, 1, 1, -1], [1, 1, 1, -0]], @@ -142,7 +143,7 @@ if (isServer) then { ["\A3\data_f\ParticleEffects\Universal\Universal", 16, 2, 32], "", "Billboard", 1, (0.1 + random 0.2) * _factor, _ringOrigin, - [0, -20 * (_factor / 2), 0], + [0, -_dir, 0], 0, 10, 7.9, 0.075, [1.25 * _factor, FLAME_SIZE * _factor], [[1, 1, 1, -2], [1, 1, 1, -2], [1, 1, 1, -1], [1, 1, 1, -0]], @@ -152,7 +153,7 @@ if (isServer) then { ["\A3\data_f\ParticleEffects\Universal\Universal", 16, 2, 32], "", "Billboard", 1, (0.1 + random 0.2) * _factor, _ringOrigin, - [20 * (_factor / 2), 0, 0], + [_dir, 0, 0], 0, 10, 7.9, 0.075, [1.25 * _factor, FLAME_SIZE * _factor], [[1, 1, 1, -2], [1, 1, 1, -2], [1, 1, 1, -1], [1, 1, 1, -0]], @@ -161,15 +162,14 @@ if (isServer) then { drop [ ["\A3\data_f\ParticleEffects\Universal\Universal", 16, 2, 32], "", "Billboard", 1, (0.1 + random 0.2) * _factor, - [-0.1 + random 0.2, -0.1 + random 0.2, -1], - [-20 * (_factor / 2), 0, 0], + _ringOrigin, + [-_dir, 0, 0], 0, 10, 7.9, 0.075, [1.25 * _factor, FLAME_SIZE * _factor], [[1, 1, 1, -2], [1, 1, 1, -2], [1, 1, 1, -1], [1, 1, 1, -0]], [2 + random 1], 1, 0, "", "", _vehicle ]; - private _dir = 20 * (_factor / 2); drop [ ["\A3\data_f\ParticleEffects\Universal\Universal", 16, 2, 32], "", "Billboard", 1, (0.1 + random 0.2) * _factor, @@ -181,21 +181,19 @@ if (isServer) then { [2 + random 1], 1, 0, "", "", _vehicle ]; - _dir = -20 * (_factor / 2); drop [ ["\A3\data_f\ParticleEffects\Universal\Universal", 16, 2, 32], "", "Billboard", 1, (0.1 + (random 0.2)) * _factor, _ringOrigin, - [_dir, _dir, 0], + [-_dir, -_dir, 0], 0, 10, 7.9, 0.075, [1.25 * _factor, FLAME_SIZE * _factor], [[1, 1, 1, -2],[1, 1, 1, -2], [1, 1, 1, -1], [1, 1, 1, -0]], [2 + random 1], 1, 0, "", "", _vehicle ]; - _dir = 20 * (_factor / 2); drop [ - ["\A3\data_f\ParticleEffects\Universal\Universal",16,2,32], + ["\A3\data_f\ParticleEffects\Universal\Universal", 16, 2, 32], "", "Billboard", 1, (0.1 + (random 0.2)) * _factor, _ringOrigin, [_dir, -_dir, 0], @@ -205,7 +203,6 @@ if (isServer) then { [2 + random 1], 1, 0, "", "", _vehicle ]; - _dir = 20 * (_factor / 2); drop [ ["\A3\data_f\ParticleEffects\Universal\Universal", 16, 2, 32], "", "Billboard", 1, (0.1 + random 0.2) * _factor, diff --git a/addons/cookoff/functions/fnc_cookOffServer.sqf b/addons/cookoff/functions/fnc_cookOffServer.sqf index 05111d7e694..d1e5347be5e 100644 --- a/addons/cookoff/functions/fnc_cookOffServer.sqf +++ b/addons/cookoff/functions/fnc_cookOffServer.sqf @@ -12,7 +12,7 @@ * 4: Delay between smoke and fire enabled <BOOL> (default: true) * 5: Ammo detonation chance <NUMBER> (default: 0) * 6: Detonate after cook-off <BOOL> (default: false) - * 7: Selection for fire source <STRING> (default: "") + * 7: Selection for fire source <STRING><ARRAY> (default: "") * 8: Can spawn fire ring <BOOL> (default: true) * 9: Can spawn fire jet <BOOL> (default: true) * 10: Maximum intensity <NUMBER> (default: MAX_COOKOFF_INTENSITY) @@ -199,4 +199,4 @@ if (_delayBetweenSmokeAndFire) then { }, [_vehicle, _selections, _ammoDetonationChance, _detonateAfterCookoff, _source, _instigator, _fireSelection, _canRing, _canJet, _smokeJipID, _fireJipID], _delay] call CBA_fnc_waitAndExecute; // API -[QGVAR(cookoff), [_vehicle, _intensity, _instigator, _smokeDelayEnabled, _ammoDetonationChance, _detonateAfterCookoff, _fireSelection, _canRing, _maxIntensity, _canJet]] call CBA_fnc_globalEvent; +[QGVAR(cookoff), [_vehicle, _intensity, _instigator, _delayBetweenSmokeAndFire, _ammoDetonationChance, _detonateAfterCookoff, _fireSelection, _canRing, _maxIntensity, _canJet]] call CBA_fnc_globalEvent; diff --git a/addons/cookoff/functions/fnc_detonateAmmunitionServerLoop.sqf b/addons/cookoff/functions/fnc_detonateAmmunitionServerLoop.sqf index 7fdcedda51d..946cb4f7d8f 100644 --- a/addons/cookoff/functions/fnc_detonateAmmunitionServerLoop.sqf +++ b/addons/cookoff/functions/fnc_detonateAmmunitionServerLoop.sqf @@ -91,7 +91,7 @@ private _configMagazine = configFile >> "CfgMagazines" >> _magazineClassname; private _ammo = getText (_configMagazine >> "ammo"); private _configAmmo = configFile >> "CfgAmmo" >> _ammo; -private _simType = toLower getText (_configAmmo >> "simulation"); +private _simType = toLowerANSI getText (_configAmmo >> "simulation"); private _speed = linearConversion [0, 1, random 1, 1, 20, true]; private _effect2pos = _object selectionPosition "destructionEffect2"; @@ -100,7 +100,7 @@ private _fnc_spawnProjectile = { // If the magazines are inside of the cargo (inventory), don't let their projectiles escape the interior of the vehicle if (!_spawnProjectile) exitWith {}; - params ["_object", "_ammo", "_speed", "_flyAway"]; + params ["_flyAway"]; private _spawnPos = _object modelToWorld [-0.2 + random 0.4, -0.2 + random 0.4, random 3]; @@ -117,7 +117,7 @@ private _fnc_spawnProjectile = { _projectile setVectorDir _vectorVelocity; _projectile setVelocity _vectorVelocity; } else { - _projectile setDamage 1; + triggerAmmo _projectile; }; }; @@ -126,14 +126,14 @@ switch (_simType) do { [QGVAR(playCookoffSound), [_object, _simType]] call CBA_fnc_globalEvent; if (random 1 < 0.6) then { - [_object, _ammo, _speed, true] call _fnc_spawnProjectile; + true call _fnc_spawnProjectile; }; }; case "shotshell": { [QGVAR(playCookoffSound), [_object, _simType]] call CBA_fnc_globalEvent; if (random 1 < 0.15) then { - [_object, _ammo, _speed, true] call _fnc_spawnProjectile; + true call _fnc_spawnProjectile; }; }; case "shotgrenade": { @@ -141,7 +141,7 @@ switch (_simType) do { _speed = 0; }; - [_object, _ammo, _speed, random 1 < 0.5] call _fnc_spawnProjectile; + (random 1 < 0.5) call _fnc_spawnProjectile; }; case "shotrocket"; case "shotmissile"; @@ -149,7 +149,7 @@ switch (_simType) do { if (random 1 < 0.1) then { [QGVAR(playCookoffSound), [_object, _simType]] call CBA_fnc_globalEvent; - [_object, _ammo, _speed, random 1 < 0.3] call _fnc_spawnProjectile; + (random 1 < 0.3) call _fnc_spawnProjectile; } else { createVehicle ["ACE_ammoExplosionLarge", _object modelToWorld _effect2pos, [], 0 , "CAN_COLLIDE"]; }; @@ -157,22 +157,13 @@ switch (_simType) do { case "shotdirectionalbomb"; case "shotmine": { if (random 1 < 0.5) then { - // Not all explosives detonate on destruction, some have scripted alternatives - if (getNumber (_configAmmo >> "triggerWhenDestroyed") != 1) then { - _ammo = getText (_configAmmo >> QEGVAR(explosives,explosive)); - }; - - // If a scripted alternative doesn't exist use generic explosion - if (_ammo != "") then { - [_object, _ammo, 0, false] call _fnc_spawnProjectile; - } else { - createVehicle ["SmallSecondary", _object modelToWorld _effect2pos, [], 0 , "CAN_COLLIDE"]; - }; + // _speed should be 0, but as it doesn't fly away, no need to set _speed + false call _fnc_spawnProjectile; }; }; case "shotilluminating": { if (random 1 < 0.15) then { - [_object, _ammo, _speed, random 1 < 0.3] call _fnc_spawnProjectile; + (random 1 < 0.3) call _fnc_spawnProjectile; }; }; }; diff --git a/addons/cookoff/functions/fnc_engineFireLocal.sqf b/addons/cookoff/functions/fnc_engineFireLocal.sqf index afd6827d6b1..5960a518ce7 100644 --- a/addons/cookoff/functions/fnc_engineFireLocal.sqf +++ b/addons/cookoff/functions/fnc_engineFireLocal.sqf @@ -27,7 +27,11 @@ if (hasInterface) then { private _hitPoints = getAllHitPointsDamage _vehicle; // Get hitpoint for engine - private _index = (_hitPoints select 0) findIf {_x == "hitengine"}; + private _index = if (_hitPoints isNotEqualTo []) then { + (_hitPoints select 0) findIf {_x == "hitengine"} + } else { + -1 + }; // Get corresponding selection private _position = if (_index != -1) then { diff --git a/addons/cookoff/functions/fnc_getVehicleAmmo.sqf b/addons/cookoff/functions/fnc_getVehicleAmmo.sqf index df4385d30da..35ca6fae263 100644 --- a/addons/cookoff/functions/fnc_getVehicleAmmo.sqf +++ b/addons/cookoff/functions/fnc_getVehicleAmmo.sqf @@ -52,7 +52,7 @@ private _ammo = ""; _x params ["_magazine", "_count"]; if (_count > 0 && {!(_magazine call FUNC(isMagazineFlare))}) then { - _ammoToDetonate pushBack [_magazine, _count, false]; + _ammoToDetonate pushBack [_magazine, _count, random 1 < 0.5]; _totalAmmo = _totalAmmo + _count; }; } forEach (magazinesAmmoCargo _object); diff --git a/addons/cookoff/stringtable.xml b/addons/cookoff/stringtable.xml index 15d2d2adec0..838b3490bba 100644 --- a/addons/cookoff/stringtable.xml +++ b/addons/cookoff/stringtable.xml @@ -23,6 +23,7 @@ <Korean>차량 유폭 화재를 활성화합니다</Korean> <Italian>Abilita incendio dei veicoli</Italian> <German>Aktiviert Fahrzeug Munitionsbrand</German> + <French>Permettre l'incendie du véhicule</French> </Key> <Key ID="STR_ACE_CookOff_enableFire_tooltip"> <English>Enables vehicle cook-off fire effects.\nThis doesn't include ammunition detonations.</English> @@ -31,6 +32,7 @@ <Korean>차량 유폭 효과를 활성화합니다.\n여기엔 탄약 유폭이 포함되지 않습니다.</Korean> <Italian>Abilita effetti di incendio del veicolo dovuto all'esplosione delle munizioni.\nQuesto non include gli effetti di esplosione.</Italian> <German>Aktiviert Fahrzeug Brandeffekte durch Durchzündung.\nExplosionseffekte sind nicht mit einbegriffen.</German> + <French>Permet d'obtenir des effets de feu de véhicule à partir de munitions qui explosent.\nCela n'inclut pas les effets d'explosion.</French> </Key> <Key ID="STR_ACE_CookOff_cookoffDuration_name"> <English>Vehicle cook-off fire duration multiplier</English> @@ -39,6 +41,7 @@ <Korean>차량 유폭 화재 지속 시간 계수</Korean> <Italian>Coefficiente di durata incendio dei veicoli</Italian> <German>Fahrzeugbrand Dauer-Multiplikator</German> + <French>Coefficient de durée d'incendie du véhicule</French> </Key> <Key ID="STR_ACE_CookOff_cookoffDuration_tooltip"> <English>Multiplier for how long vehicle cook-off fire lasts.\nSetting to 0 will disable vehicle cook-off fire.</English> @@ -47,6 +50,7 @@ <Korean>차량 유폭 화재가 지속되는 시간에 대한 계수입니다.\n0으로 설정하면 차량 쿸오프 화재가 비활성화됩니다.</Korean> <Italian>Coefficiente di durata degli incendi dei veicoli.\nImpostarlo su 0 disabilita incendi dei veicoli.</Italian> <German>Multiplikator der Fahrzeugbrand Dauer.\nIhn auf 0 zu setzen wird Munitionsbrände deaktivieren.</German> + <French>Coefficient de durée des feux de véhicules.\nLa valeur 0 désactive les feux de véhicules.</French> </Key> <Key ID="STR_ACE_CookOff_probabilityCoef_name"> <English>Vehicle cook-off fire probability multiplier</English> @@ -55,6 +59,7 @@ <Korean>차량 유폭 화재 확률 계수</Korean> <Italian>Probabilità di incendio dei veicoli</Italian> <German>Fahrzeug Munitionsbrand Wahrscheinlichkeit-Multiplikator</German> + <French>Probabilité d'incendies de véhicules</French> </Key> <Key ID="STR_ACE_CookOff_probabilityCoef_tooltip"> <English>Multiplier for vehicle cook-off fire probability. Higher value results in higher cook-off probability.\nSetting to 0 will disable vehicle cook-off fire.</English> @@ -63,6 +68,7 @@ <Korean>차량 유폭 화재 확률에 대한 계수입니다. 값이 높을 수록 유폭 확률이 높아집니다.\n0으로 설정하면 차량 유폭 화재가 비활성화됩니다.</Korean> <Italian>Coefficiente di probabilità degli incendi dei veicoli.\nValori maggiori aumentano la probabilità di incendi.\nImpostarlo su 0 disabilita incendi dei veicoli.</Italian> <German>Multiplikator der Fahrzeugbrand Wahrscheinlichkeit.\nHöhere Werte erhöhen die Wahrscheinlichkeit.\nEin Null-Wert wird Munitionsbrände deaktivieren.</German> + <French>Coefficient de probabilité des incendies de véhicules.\nLes valeurs élevées augmentent la probabilité des incendies.\nLa valeur 0 désactive les incendies de véhicules.</French> </Key> <Key ID="STR_ACE_CookOff_destroyVehicleAfterCookoff_name"> <English>Destroy vehicles after cook-off</English> @@ -96,6 +102,7 @@ <Korean>차량 내 탄약 유폭 활성화</Korean> <Italian>Abilita esplosioni delle munizioni dei veicoli</Italian> <German>Aktiviert Fahrzeug Munitionsdurchzündung</German> + <French>Permet l'explosion des munitions des véhicules</French> </Key> <Key ID="STR_ACE_CookOff_enableAmmoCookoff_tooltip"> <English>Enables cooking off of vehicle ammunition. Fires ammunition projectiles while vehicle has ammunition remaining.\nThis doesn't include fire effects.</English> @@ -104,6 +111,7 @@ <Korean>차량 내 탄약 유폭을 활성화합니다. 차량에 탄약이 남아 있는 동안 탄약 발사체를 발사합니다.\n여기엔 화재 효과가 포함되지 않습니다.</Korean> <Italian>Abilita l'esplosione delle munizioni dei veicoli. Spara via pezzi di munizioni se il veicolo ha ancora munizioni rimanenti.\nNon include gli effetti di fuoco.</Italian> <German>Aktiviert Durchzündung von Fahrzeugmunition. Schleudert Munitionsfragmente umher wenn das Fahrzeug noch Munition an Bord hat.\nBrandeffekte sind nicht mit einbegriffen.</German> + <French>Permet l'explosion des munitions du véhicule. Tire des morceaux de munitions si le véhicule a encore des munitions restantes.\nIl n'y a pas d'effets de feu.</French> </Key> <Key ID="STR_ACE_CookOff_enableBoxCookoff_name"> <English>Enable ammo box cook-off</English> @@ -127,6 +135,7 @@ <Korean>탄약 상자 유폭을 활성화합니다.\n여기엔 화재 효과가 포함되지 않습니다.</Korean> <Italian>Abilita esplosioni delle casse di munizioni.\nNon include effetti di fuoco.</Italian> <German>Aktiviert Munitionskisten Durchzündung.\nBrandeffekte sind nicht mit einbegriffen.</German> + <French>Permet l'explosion des caisses de munitions.\nN'inclut pas les effets de feu.</French> </Key> <Key ID="STR_ACE_CookOff_ammoCookoffDuration_name"> <English>Ammo cook-off duration multiplier</English> @@ -135,6 +144,7 @@ <Korean>탄약 유폭 시간 계수</Korean> <Italian>Coefficiente di durata esplisioni di munizioni</Italian> <German>Fahrzeug Munitionsdurchzündung Dauer-Multiplikator</German> + <French>Coefficient de durée d'explosion des munitions</French> </Key> <Key ID="STR_ACE_CookOff_ammoCookoffDuration_tooltip"> <English>Multiplier for how long ammunition cook-off lasts, for both vehicles and ammo boxes.\nSetting to 0 will disable ammo cook-off for both vehicles and ammo boxes.</English> @@ -143,6 +153,7 @@ <Korean>차량과 탄약 상자 모두에 대해 탄약 유폭이 지속되는 시간에 대한 계수입니다.\n0으로 설정하면 차량과 탄약 상자 모두에 대해 탄약 유폭이 비활성화됩니다.</Korean> <Italian>Coefficiente della durata di esplosioni delle munizioni, sia per veicoli che casse.\nImpostarlo su 0 disabilita esplosioni di veicoli e casse.</Italian> <German>Multiplikator der Munitionsdurchzündungs-Dauer, gilt für Fahrzeuge und Munitionskisten.\nIhn auf 0 zu setzen wird Durchzünden deaktivieren.</German> + <French>Coefficient de durée d'explosion des munitions pour les véhicules et les caisses.\nLa valeur 0 désactive les explosions des véhicules et des caisses.</French> </Key> <Key ID="STR_ACE_CookOff_removeAmmoDuringCookoff_name"> <English>Enable ammo removal during cook-off</English> diff --git a/addons/csw/CfgMagazines.hpp b/addons/csw/CfgMagazines.hpp index 86ad73c58fc..2466bbe6967 100644 --- a/addons/csw/CfgMagazines.hpp +++ b/addons/csw/CfgMagazines.hpp @@ -58,6 +58,7 @@ class CfgMagazines { class GVAR(20Rnd_20mm_G_belt): 40Rnd_20mm_G_belt { author = ECSTRING(common,ACETeam); displayName = CSTRING(GMGBelt_displayName); + descriptionShort = CSTRING(GMGBelt_descriptionShort); model = "\A3\Structures_F_EPB\Items\Military\Ammobox_rounds_F.p3d"; picture = QPATHTOF(UI\ammoBox_50bmg_ca.paa); type = 256; diff --git a/addons/csw/XEH_postInit.sqf b/addons/csw/XEH_postInit.sqf index 87196f33772..419e7013809 100644 --- a/addons/csw/XEH_postInit.sqf +++ b/addons/csw/XEH_postInit.sqf @@ -8,18 +8,32 @@ GVAR(vehicleMagCache) = createHashMap; // needs a small delay for network syncing, or we end up with duplicate mags with ammo handling [LINKFUNC(initVehicle), _this, 1] call CBA_fnc_waitAndExecute; }, true, [], true] call CBA_fnc_addClassEventHandler; - - GVAR(quickmountEnabled) = ( - missionNamespace getVariable [QEGVAR(quickmount,enabled), false] && - {(missionNamespace getVariable [QEGVAR(quickmount,enableMenu), -1]) in [1,3]} - ); }] call CBA_fnc_addEventHandler; +// Also triggered at mission start ["CBA_SettingChanged", { GVAR(quickmountEnabled) = ( missionNamespace getVariable [QEGVAR(quickmount,enabled), false] && {(missionNamespace getVariable [QEGVAR(quickmount,enableMenu), -1]) in [1,3]} ); + + // Do not allow no ammo handling when advanced assembly is enabled + // Reason: When using advanced assembly, the amount of ammo is not stored anywhere, so when you reassemble a static, it will spawn full ammo + if (GVAR(defaultAssemblyMode) && GVAR(ammoHandling) == 0) then { + if (isServer) then { + [QGVAR(ammoHandling), 2, 2, "server"] call CBA_settings_fnc_set; + }; + + // Notify everyone about change + [QEGVAR(common,displayTextStructured), [composeText [ + lineBreak, + parseText format [ + "<t align='center'>%1</t>", format ["%1 requires %2 to be set higher than 0.", QGVAR(defaultAssemblyMode), QGVAR(ammoHandling)] + ], + lineBreak, + parseText format ["<t align='center'>%1</t>", "No mission restart is required."] + ], 4]] call CBA_fnc_localEvent; + }; }] call CBA_fnc_addEventHandler; // Event handlers: diff --git a/addons/csw/dev/checkStaticWeapons.sqf b/addons/csw/dev/checkStaticWeapons.sqf index 7d9917daa71..137dc953341 100644 --- a/addons/csw/dev/checkStaticWeapons.sqf +++ b/addons/csw/dev/checkStaticWeapons.sqf @@ -16,7 +16,7 @@ private _inherited = []; private _config = _x; private _configEnabled = (getNumber (_config >> QUOTE(ADDON) >> "enabled")) == 1; if (_configEnabled) then { - private _configExplicit = (count configProperties [_config, "configName _x == 'ace_csw'", false]) == 1; + private _configExplicit = (count configProperties [_config, toString {configName _x == QUOTE(ADDON)}, false]) == 1; if (_configExplicit) then { _explicitBases pushBack (configName _config); _inherited pushBack []; @@ -43,8 +43,8 @@ private _inherited = []; INFO("------ Logging static magazines with no carry version -------"); private _hash = createHashMap; -// private _logAll = true; // logs all possible weapon magazines (even if not used in a static weapon) -private _logAll = false; +private _logAll = false; // logs all possible weapon magazines (even if not used in a static weapon) when set to true + { private _vehicleType = configName _x; private _turretConfig = [_vehicleType, [0]] call CBA_fnc_getTurret; diff --git a/addons/csw/functions/fnc_aceRearmGetCarryMagazines.sqf b/addons/csw/functions/fnc_aceRearmGetCarryMagazines.sqf index 5230fccf521..f3a6bbde5f9 100644 --- a/addons/csw/functions/fnc_aceRearmGetCarryMagazines.sqf +++ b/addons/csw/functions/fnc_aceRearmGetCarryMagazines.sqf @@ -1,11 +1,11 @@ #include "..\script_component.hpp" /* * Author: PabstMirror - * Helper function for ace_rearm; Gets magazines that should be loaded by csw + * Helper function for ace_rearm; Gets magazines that should be loaded by csw. * * Arguments: - * 0: Vehicle <OBJECT> - * 1: Specific Turret or pass bool to check all turrets <ARRAY><BOOL>(default: true) + * 0: CSW <OBJECT> + * 1: Specific Turret or pass bool to check all turrets <ARRAY|BOOL> (default: true) * * Return Value: * [0: compatible veh mags, 1: carry mags] <ARRAY> diff --git a/addons/csw/functions/fnc_ai_handleFired.sqf b/addons/csw/functions/fnc_ai_handleFired.sqf index d92e517091b..4a6615f4043 100644 --- a/addons/csw/functions/fnc_ai_handleFired.sqf +++ b/addons/csw/functions/fnc_ai_handleFired.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: PabstMirror - * Handles AI Fired EH + * Handles AI Fired EH. * * Arguments: * Fired EH @@ -12,6 +12,8 @@ * Public: No */ +if (GVAR(ammoHandling) != 2) exitWith {}; + params ["_vehicle", "_weapon", "", "", "", "_magazine", "", "_gunner"]; TRACE_4("firedEH:",_vehicle,_weapon,_magazine,_gunner); diff --git a/addons/csw/functions/fnc_ai_handleGetIn.sqf b/addons/csw/functions/fnc_ai_handleGetIn.sqf index f14a4ccbc7a..bbbddaf537f 100644 --- a/addons/csw/functions/fnc_ai_handleGetIn.sqf +++ b/addons/csw/functions/fnc_ai_handleGetIn.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* - * Author: Grim - * Handles AI GetIn on an empty weapon + * Author: LinkIsGrim + * Handles AI GetIn on an empty CSW. * * Arguments: * GetIn EH @@ -12,6 +12,8 @@ * Public: No */ +if (GVAR(ammoHandling) != 2) exitWith {}; + params ["_vehicle", "", "_gunner"]; TRACE_2("getInEH:",_vehicle,_gunner); diff --git a/addons/csw/functions/fnc_ai_reload.sqf b/addons/csw/functions/fnc_ai_reload.sqf index 4d6234f94a9..288d718a2f7 100644 --- a/addons/csw/functions/fnc_ai_reload.sqf +++ b/addons/csw/functions/fnc_ai_reload.sqf @@ -1,10 +1,10 @@ #include "..\script_component.hpp" /* - * Author: PabstMirror, modified by Grim - * Handles AI reloading + * Author: PabstMirror, LinkIsGrim + * Handles AI reloading. * * Arguments: - * 0: Static Weapon <OBJECT> + * 0: CSW <OBJECT> * 1: Gunner <OBJECT> * 2: Weapon <STRING> * 3: Magazine <STRING> (default: "") @@ -15,7 +15,7 @@ * Public: No */ -params ["_staticWeapon", "_gunner", "_weapon", ["_magazine", ""]]; +params ["_vehicle", "_gunner", "_weapon", ["_magazine", ""]]; private _turretPath = [_gunner] call EFUNC(common,getTurretIndex); private _reloadSource = objNull; @@ -24,7 +24,7 @@ private _reloadNeededAmmo = -1; private _cfgMagGroups = configFile >> QGVAR(groups); -private _nearSupplies = [_gunner] + ((_staticWeapon nearSupplies 10) select { +private _nearSupplies = [_gunner] + ((_vehicle nearSupplies 10) select { isNull (group _x) || {!([_x] call EFUNC(common,isPlayer)) && {[side group _gunner, side group _x] call BIS_fnc_sideIsFriendly}} }); @@ -49,7 +49,7 @@ private _nearSupplies = [_gunner] + ((_staticWeapon nearSupplies 10) select { private _xWeaponMag = _x; { if ((getNumber (_cfgMagGroups >> _x >> _xWeaponMag)) == 1) then { - private _loadInfo = [_staticWeapon, _turretPath, _x, _xSource] call FUNC(reload_canLoadMagazine); + private _loadInfo = [_vehicle, _turretPath, _x, _xSource] call FUNC(reload_canLoadMagazine); if (_loadInfo select 0) then { _reloadMag = _x; _reloadSource = _xSource; @@ -81,16 +81,16 @@ if (_bestAmmoToSend == -1) exitWith {ERROR("No ammo");}; [_reloadSource, _reloadMag, _bestAmmoToSend] call EFUNC(common,removeSpecificMagazine); private _timeToLoad = 1; -if (!isNull(configOf _staticWeapon >> QUOTE(ADDON) >> "ammoLoadTime")) then { - _timeToLoad = getNumber(configOf _staticWeapon >> QUOTE(ADDON) >> "ammoLoadTime"); +if (!isNull(configOf _vehicle >> QUOTE(ADDON) >> "ammoLoadTime")) then { + _timeToLoad = getNumber(configOf _vehicle >> QUOTE(ADDON) >> "ammoLoadTime"); }; TRACE_1("Reloading in progress",_timeToLoad); [{ - params ["_staticWeapon", "_turretPath", "_gunner", "_reloadMag", "_bestAmmoToSend"]; - if ((!alive _staticWeapon) || {!alive _gunner} || {(_staticWeapon distance _gunner) > 10}) exitWith {TRACE_1("invalid state",_this);}; + params ["_vehicle", "_turretPath", "_gunner", "_reloadMag", "_bestAmmoToSend"]; + if ((!alive _vehicle) || {!alive _gunner} || {(_vehicle distance _gunner) > 10}) exitWith {TRACE_1("invalid state",_this);}; // Reload the static weapon - TRACE_5("calling addTurretMag event",_staticWeapon,_turretPath,_gunner,_reloadMag,_bestAmmoToSend); + TRACE_5("calling addTurretMag event",_vehicle,_turretPath,_gunner,_reloadMag,_bestAmmoToSend); [QGVAR(addTurretMag), _this] call CBA_fnc_globalEvent; -}, [_staticWeapon, _turretPath, _gunner, _reloadMag, _bestAmmoToSend], _timeToLoad] call CBA_fnc_waitAndExecute; +}, [_vehicle, _turretPath, _gunner, _reloadMag, _bestAmmoToSend], _timeToLoad] call CBA_fnc_waitAndExecute; diff --git a/addons/csw/functions/fnc_assemble_canDeployWeapon.sqf b/addons/csw/functions/fnc_assemble_canDeployWeapon.sqf index 65dd81cc417..12d00ca44e9 100644 --- a/addons/csw/functions/fnc_assemble_canDeployWeapon.sqf +++ b/addons/csw/functions/fnc_assemble_canDeployWeapon.sqf @@ -1,14 +1,14 @@ #include "..\script_component.hpp" /* * Author: tcvm - * Checks if you can deploy a weapon on the tripod + * Checks if you can deploy a weapon on the tripod. * * Arguments: - * 0: Target Tripod <OBJECT> + * 0: Target <OBJECT> * 1: Player <OBJECT> * * Return Value: - * Wether or not you can deploy the weapon <BOOL> + * Whether or not you can deploy the weapon <BOOL> * * Example: * [cursorObject, player] call ace_csw_fnc_assemble_canDeployWeapon @@ -20,4 +20,7 @@ params ["_target", "_player"]; // If the current launcher has a config-value that defines the tripod, it is a CSW (alive _target) && -{(getText (configFile >> "CfgWeapons" >> secondaryWeapon _player >> QUOTE(ADDON) >> "assembleTo" >> typeOf _target)) != ""} +{ + (getText (configFile >> "CfgWeapons" >> secondaryWeapon _player >> QUOTE(ADDON) >> "assembleTo" >> typeOf _target)) != "" || + {(getText (configFile >> "CfgWeapons" >> primaryWeapon _player >> QUOTE(ADDON) >> "assembleTo" >> typeOf _target)) != ""} +} diff --git a/addons/csw/functions/fnc_assemble_canPickupWeapon.sqf b/addons/csw/functions/fnc_assemble_canPickupWeapon.sqf index 0d508bfa896..3228373b401 100644 --- a/addons/csw/functions/fnc_assemble_canPickupWeapon.sqf +++ b/addons/csw/functions/fnc_assemble_canPickupWeapon.sqf @@ -1,23 +1,23 @@ #include "..\script_component.hpp" /* * Author: tcvm - * If the CSW is mounted or in use this will not allow you to dismount the weapon + * If the CSW is mounted or in use this will not allow you to dismount the weapon. * * Arguments: - * 0: Static Weapon <OBJECT> + * 0: CSW <OBJECT> * * Return Value: - * Can Dismount <BOOL> + * Can dismount weapon <BOOL> * * Example: - * [cursorObject] call ace_csw_fnc_assemble_canPickupWeapon + * cursorObject call ace_csw_fnc_assemble_canPickupWeapon * * Public: No */ -params ["_staticWeapon"]; +params ["_vehicle"]; // Assembly mode: [0=disabled, 1=enabled, 2=enabled&unload, 3=default] -private _assemblyMode = [false, true, true, GVAR(defaultAssemblyMode)] select (_staticWeapon getVariable [QGVAR(assemblyMode), 3]); +private _assemblyMode = [false, true, true, GVAR(defaultAssemblyMode)] select (_vehicle getVariable [QGVAR(assemblyMode), 3]); -_assemblyMode && {alive _staticWeapon} && {((crew _staticWeapon) findIf {alive _x && {!unitIsUAV _x}}) == -1} // return +_assemblyMode && {alive _vehicle} && {((crew _vehicle) findIf {alive _x && {!unitIsUAV _x}}) == -1} // return diff --git a/addons/csw/functions/fnc_assemble_deployTripod.sqf b/addons/csw/functions/fnc_assemble_deployTripod.sqf index 29cc4b58763..e0a058a1af0 100644 --- a/addons/csw/functions/fnc_assemble_deployTripod.sqf +++ b/addons/csw/functions/fnc_assemble_deployTripod.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: tcvm - * Deploys the tripod + * Deploys the tripod. * * Arguments: * 0: Unit <OBJECT> @@ -10,7 +10,7 @@ * None * * Example: - * [player] call ace_csw_fnc_assemble_deployTripod + * player call ace_csw_fnc_assemble_deployTripod * * Public: No */ @@ -34,7 +34,7 @@ _args params ["_player", "_secondaryWeaponClassname", "_secondaryWeaponInfo"]; TRACE_3("deployTripod finish",_player,_secondaryWeaponClassname,_secondaryWeaponInfo); - private _tripodClassname = getText(configFile >> "CfgWeapons" >> _secondaryWeaponClassname >> QUOTE(ADDON) >> "deploy"); + private _tripodClassname = getText (configFile >> "CfgWeapons" >> _secondaryWeaponClassname >> QUOTE(ADDON) >> "deploy"); // Create a tripod private _cswTripod = createVehicle [_tripodClassname, [0, 0, 0], [], 0, "NONE"]; @@ -58,9 +58,8 @@ _cswTripod setVariable [QGVAR(secondaryWeaponMagazines), _secondaryWeaponMagazines, true]; }; - if (!GVAR(defaultAssemblyMode)) then { - [_cswTripod, "disableWeaponAssembly", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); - }; + // Disable vanilla assembly until FUNC(initVehicle) runs and sets the definite value + [_cswTripod, "disableWeaponAssembly", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); private _posATL = _player getRelPos [2, 0]; _posATL set [2, ((getPosATL _player) select 2) + 0.5]; @@ -96,6 +95,6 @@ } forEach _secondaryWeaponInfo; }; - private _deployTime = getNumber(configFile >> "CfgWeapons" >> _secondaryWeaponClassname >> QUOTE(ADDON) >> "deployTime"); + private _deployTime = getNumber (configFile >> "CfgWeapons" >> _secondaryWeaponClassname >> QUOTE(ADDON) >> "deployTime"); [TIME_PROGRESSBAR(_deployTime), [_player, _secondaryWeaponClassname, _secondaryWeaponInfo], _onFinish, _onFailure, LLSTRING(PlaceTripod_progressBar)] call EFUNC(common,progressBar); }, _this] call CBA_fnc_execNextFrame; diff --git a/addons/csw/functions/fnc_assemble_deployWeapon.sqf b/addons/csw/functions/fnc_assemble_deployWeapon.sqf index 974bf034319..a0cdc102ca8 100644 --- a/addons/csw/functions/fnc_assemble_deployWeapon.sqf +++ b/addons/csw/functions/fnc_assemble_deployWeapon.sqf @@ -1,11 +1,11 @@ #include "..\script_component.hpp" /* * Author: tcvm - * Deploys the current CSW + * Deploys the current CSW. * * Arguments: * 0: Target <OBJECT> - * 1: Unit <OBJECT> + * 1: Player <OBJECT> * 2: Args <ANY> * 3: Action Data <ARRAY> * @@ -21,8 +21,19 @@ [{ params ["_tripod", "_player"]; + private _tripodClassname = typeOf _tripod; + private _assembledClassname = getText (configFile >> "CfgWeapons" >> secondaryWeapon _player >> QUOTE(ADDON) >> "assembleTo" >> _tripodClassname); + private _index = 1; + + if (_assembledClassname == "") then { + _assembledClassname = getText (configFile >> "CfgWeapons" >> primaryWeapon _player >> QUOTE(ADDON) >> "assembleTo" >> _tripodClassname); + _index = 0; + }; + + if (!isClass (configFile >> "CfgVehicles" >> _assembledClassname)) exitWith {ERROR_1("bad static classname [%1]",_assembledClassname);}; + // Save magazines and attachments (handle loaded launchers which can become csw like CUP Metis) - private _carryWeaponInfo = (getUnitLoadout _player) select 1; + private _carryWeaponInfo = (getUnitLoadout _player) select _index; private _carryWeaponClassname = _carryWeaponInfo deleteAt 0; // Remove empty entries @@ -30,21 +41,15 @@ TRACE_3("assemble_deployWeapon_carryWeaponClassname",_tripod,_player,_carryWeaponClassname); - private _tripodClassname = typeOf _tripod; - private _weaponConfig = configfile >> "CfgWeapons" >> _carryWeaponClassname >> QUOTE(ADDON); - private _assembledClassname = getText (_weaponConfig >> "assembleTo" >> _tripodClassname); - - if (!isClass (configFile >> "CfgVehicles" >> _assembledClassname)) exitWith {ERROR_1("bad static classname [%1]",_assembledClassname);}; - _player removeWeaponGlobal _carryWeaponClassname; - private _deployTime = getNumber (_weaponConfig >> "deployTime"); + private _deployTime = getNumber (configFile >> "CfgWeapons" >> _carryWeaponClassname >> QUOTE(ADDON) >> "deployTime"); TRACE_4("",_carryWeaponClassname,_tripodClassname,_assembledClassname,_deployTime); private _onFinish = { params ["_args"]; - _args params ["_tripod", "_player", "_assembledClassname", "", "_carryWeaponInfo"]; + _args params ["_tripod", "_player", "_assembledClassname", "_tripodClassname", "_carryWeaponClassname", "_carryWeaponInfo"]; TRACE_3("deployWeapon finish",_tripod,_player,_assembledClassname); private _secondaryWeaponMagazines = _tripod getVariable [QGVAR(secondaryWeaponMagazines), []]; @@ -56,10 +61,11 @@ _tripodPos set [2, (_tripodPos select 2) + 0.1]; // Delay a frame so tripod has a chance to be deleted [{ - params ["_assembledClassname", "_tripodDir", "_tripodPos", "_player", "_carryWeaponInfo", "_secondaryWeaponMagazines"]; + params ["_assembledClassname", "_componentClasses", "_tripodDir", "_tripodPos", "_player", "_carryWeaponInfo", "_secondaryWeaponMagazines"]; private _csw = createVehicle [_assembledClassname, [0, 0, 0], [], 0, "NONE"]; // Assembly mode: [0=disabled, 1=enabled, 2=enabled&unload, 3=default] _csw setVariable [QGVAR(assemblyMode), 2, true]; // Explicitly set advanced assembly mode + unload, and broadcast + _csw setVariable [QGVAR(componentClasses), _componentClasses, true]; { // Magazines @@ -76,9 +82,9 @@ _csw setVariable [QGVAR(secondaryWeaponMagazines), _secondaryWeaponMagazines, true]; }; - if (!GVAR(defaultAssemblyMode)) then { - [_csw, "disableWeaponAssembly", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); - }; + // Disable vanilla assembly until FUNC(initVehicle) runs and sets the definite value + [_csw, "disableWeaponAssembly", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); + _csw setDir _tripodDir; _csw setPosATL _tripodPos; if ((_tripodPos select 2) < 0.5) then { @@ -86,12 +92,12 @@ }; [QGVAR(deployWeaponSucceeded), [_csw]] call CBA_fnc_localEvent; TRACE_2("csw placed",_csw,_assembledClassname); - }, [_assembledClassname, _tripodDir, _tripodPos, _player, _carryWeaponInfo, _secondaryWeaponMagazines]] call CBA_fnc_execNextFrame; + }, [_assembledClassname, [_tripodClassname, _carryWeaponClassname], _tripodDir, _tripodPos, _player, _carryWeaponInfo, _secondaryWeaponMagazines]] call CBA_fnc_execNextFrame; }; private _onFailure = { params ["_args"]; - _args params ["", "_player", "", "_carryWeaponClassname", "_carryWeaponInfo"]; + _args params ["", "_player", "", "", "_carryWeaponClassname", "_carryWeaponInfo"]; TRACE_2("deployWeapon failure",_player,_carryWeaponClassname); // Add weapon back @@ -110,5 +116,5 @@ alive _tripod }; - [TIME_PROGRESSBAR(_deployTime), [_tripod, _player, _assembledClassname, _carryWeaponClassname, _carryWeaponInfo], _onFinish, _onFailure, LLSTRING(AssembleCSW_progressBar), _condition] call EFUNC(common,progressBar); + [TIME_PROGRESSBAR(_deployTime), [_tripod, _player, _assembledClassname, _tripodClassname, _carryWeaponClassname, _carryWeaponInfo], _onFinish, _onFailure, LLSTRING(AssembleCSW_progressBar), _condition] call EFUNC(common,progressBar); }, _this] call CBA_fnc_execNextFrame; diff --git a/addons/csw/functions/fnc_assemble_deployWeaponModifier.sqf b/addons/csw/functions/fnc_assemble_deployWeaponModifier.sqf index 85b13464156..f3f1fd7bfcb 100644 --- a/addons/csw/functions/fnc_assemble_deployWeaponModifier.sqf +++ b/addons/csw/functions/fnc_assemble_deployWeaponModifier.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: PabstMirror - * Modifies interaction for deploying weapon + * Modifies interaction for deploying weapon. * * Arguments: * 0: Target <OBJECT> @@ -20,9 +20,14 @@ params ["_target", "_player", "", "_actionData"]; -private _carryWeaponClassname = secondaryWeapon _player; -private _assembleTo = (getText(configFile >> "CfgWeapons" >> _carryWeaponClassname >> QUOTE(ADDON) >> "assembleTo" >> (typeOf _target))); -private _icon = getText (configFile >> "CfgVehicles" >> _assembleTo >> "picture"); -TRACE_2("",_assembleTo,_icon); +private _tripodClassname = typeOf _target; +private _assembledClassname = getText (configFile >> "CfgWeapons" >> secondaryWeapon _player >> QUOTE(ADDON) >> "assembleTo" >> _tripodClassname); + +if (_assembledClassname == "") then { + _assembledClassname = getText (configFile >> "CfgWeapons" >> primaryWeapon _player >> QUOTE(ADDON) >> "assembleTo" >> _tripodClassname); +}; + +private _icon = getText (configFile >> "CfgVehicles" >> _assembledClassname >> "picture"); +TRACE_2("",_assembledClassname,_icon); _actionData set [2, _icon]; diff --git a/addons/csw/functions/fnc_assemble_pickupTripod.sqf b/addons/csw/functions/fnc_assemble_pickupTripod.sqf index 0996c0f3d3b..c09400a87f6 100644 --- a/addons/csw/functions/fnc_assemble_pickupTripod.sqf +++ b/addons/csw/functions/fnc_assemble_pickupTripod.sqf @@ -1,11 +1,11 @@ #include "..\script_component.hpp" /* * Author: tcvm - * Picks up the tripod and adds it to the player launcher slot + * Picks up the tripod and adds it to the player launcher slot. * * Arguments: * 0: Tripod <OBJECT> - * 1: Unit <OBJECT> + * 1: Player <OBJECT> * * Return Value: * None @@ -56,7 +56,7 @@ if (isNull _weaponHolder || {_tripodPos distance _weaponHolder > 2}) then { _weaponHolder = createVehicle ["GroundWeaponHolder", [0, 0, 0], [], 0, "CAN_COLLIDE"]; _weaponHolder setDir random [0, 180, 360]; - _weaponHolder setVehiclePosition [_tripodPos, [], 0, "CAN_COLLIDE"]; // places object on surface below + _weaponHolder setVehiclePosition [_tripodPos, [], 0, "CAN_COLLIDE"]; // Places object on surface below }; _weaponHolder addWeaponCargoGlobal [_tripodClassname, 1]; diff --git a/addons/csw/functions/fnc_assemble_pickupWeapon.sqf b/addons/csw/functions/fnc_assemble_pickupWeapon.sqf index 468f385efaf..023143710b6 100644 --- a/addons/csw/functions/fnc_assemble_pickupWeapon.sqf +++ b/addons/csw/functions/fnc_assemble_pickupWeapon.sqf @@ -1,11 +1,11 @@ #include "..\script_component.hpp" /* * Author: tcvm - * Dismounts the weapon from the tripod and drops its backpack beside + * Dismounts the weapon from the tripod and drops its backpack beside. * * Arguments: - * 0: Static Weapon <OBJECT> - * 1: Unit <OBJECT> + * 0: CSW <OBJECT> + * 1: Player <OBJECT> * * Return Value: * None @@ -17,18 +17,22 @@ */ [{ - params ["_staticWeapon", "_player"]; - TRACE_2("assemble_pickupWeapon",_staticWeapon,_player); + params ["_vehicle", "_player"]; + TRACE_2("assemble_pickupWeapon",_vehicle,_player); - private _weaponConfig = configOf _staticWeapon >> QUOTE(ADDON); - private _carryWeaponClassname = getText (_weaponConfig >> "disassembleWeapon"); + private _weaponConfig = configOf _vehicle >> QUOTE(ADDON); + private _componentClasses = _vehicle getVariable QGVAR(componentClasses); + + (if (!isNil "_componentClasses") then { + _componentClasses + } else { + [getText (_weaponConfig >> "disassembleTurret"), getText (_weaponConfig >> "disassembleWeapon")] + }) params ["_turretClassname", "_carryWeaponClassname"]; if (!isClass (configFile >> "CfgWeapons" >> _carryWeaponClassname)) exitWith { ERROR_1("bad weapon classname [%1]",_carryWeaponClassname); }; - private _turretClassname = getText (_weaponConfig >> "disassembleTurret"); - // Turret classname can equal nothing if the deploy bag is the "whole" weapon. e.g Kornet, Metis, other ATGMs if ((_turretClassname != "") && {!isClass (configFile >> "CfgVehicles" >> _turretClassname)}) exitWith { ERROR_1("bad turret classname [%1]",_turretClassname); @@ -37,15 +41,15 @@ private _onDisassembleFunc = getText (_weaponConfig >> "disassembleFunc"); private _pickupTime = getNumber (configFile >> "CfgWeapons" >> _carryWeaponClassname >> QUOTE(ADDON) >> "pickupTime"); - TRACE_4("",typeOf _staticWeapon,_carryWeaponClassname,_turretClassname,_pickupTime); + TRACE_4("",typeOf _vehicle,_carryWeaponClassname,_turretClassname,_pickupTime); private _onFinish = { params ["_args"]; - _args params ["_staticWeapon", "_player", "_carryWeaponClassname", "_turretClassname", "_onDisassembleFunc"]; - TRACE_4("disassemble finish",_staticWeapon,_player,_carryWeaponClassname,_turretClassname); + _args params ["_vehicle", "_player", "_carryWeaponClassname", "_turretClassname", "_onDisassembleFunc"]; + TRACE_4("disassemble finish",_vehicle,_player,_carryWeaponClassname,_turretClassname); - private _weaponPos = (getPosATL _staticWeapon) vectorAdd [0, 0, 0.1]; - private _weaponDir = getDir _staticWeapon; + private _weaponPos = (getPosATL _vehicle) vectorAdd [0, 0, 0.1]; + private _weaponDir = getDir _vehicle; private _carryWeaponMag = []; private _carryWeaponMags = compatibleMagazines _carryWeaponClassname; @@ -58,13 +62,15 @@ if (_carryWeaponMag isEqualTo [] && {_carryMag in _carryWeaponMags}) then { TRACE_3("Adding mag to secondary weapon",_xMag,_xAmmo,_carryMag); _carryWeaponMag = [_carryMag, _xAmmo]; - DEC(_xAmmo); + + // Do not return this magazine, as it will be put into the weapon + continue; }; if ((_xAmmo > 0) && {_carryMag != ""}) then { TRACE_2("Removing ammo",_xMag,_carryMag); [_player, _carryMag, _xAmmo] call FUNC(reload_handleReturnAmmo); }; - } forEach (magazinesAllTurrets _staticWeapon); + } forEach (magazinesAllTurrets _vehicle); if (_turretClassname isNotEqualTo "") then { private _cswTripod = createVehicle [_turretClassname, [0, 0, 0], [], 0, "NONE"]; @@ -76,14 +82,25 @@ _cswTripod setVelocity [0, 0, -0.05]; _cswTripod setVectorUp (surfaceNormal _weaponPos); }, [_cswTripod, _weaponDir, _weaponPos]] call CBA_fnc_execNextFrame; - [_cswTripod, _staticWeapon] call (missionNamespace getVariable _onDisassembleFunc); + [_cswTripod, _vehicle] call (missionNamespace getVariable _onDisassembleFunc); }; [{ params ["_player", "_weaponPos", "_carryWeaponClassname", "_carryWeaponMag", "_turretClassname"]; + private _carryWeaponType = _carryWeaponClassname call EFUNC(common,getWeaponType); + + if !(_carryWeaponType in [1, 2]) exitWith { + ERROR_1("bad carry weapon type [%1]",_carryWeaponClassname); + + if (_carryWeaponMag isEqualTo []) exitWith {}; + + // Return the ammo, so it doesn't vanish + [_player, _carryWeaponMag select 0, _carryWeaponMag select 1] call FUNC(reload_handleReturnAmmo); + }; + // Give the weapon to the player if possible - if ((alive _player) && {(secondaryWeapon _player) == ""}) exitWith { + if ((alive _player) && {([primaryWeapon _player, secondaryWeapon _player] select (_carryWeaponType - 1)) == ""}) exitWith { [_player, _carryWeaponClassname] call CBA_fnc_addWeaponWithoutItems; if (_carryWeaponMag isNotEqualTo []) then { @@ -99,7 +116,7 @@ // Create a new weapon holder (don't try to get an existing one, as no guarantee where it could be) private _weaponHolder = createVehicle ["GroundWeaponHolder", [0, 0, 0], [], 0, "CAN_COLLIDE"]; _weaponHolder setDir random [0, 180, 360]; - _weaponHolder setVehiclePosition [_weaponPos, [], 0, "CAN_COLLIDE"]; // places object on surface below + _weaponHolder setVehiclePosition [_weaponPos, [], 0, "CAN_COLLIDE"]; // Places object on surface below _weaponHolder addWeaponWithAttachmentsCargoGlobal [[_carryWeaponClassname, "", "", "", _carryWeaponMag, [], ""], 1]; }, [_player, _weaponPos, _carryWeaponClassname, _carryWeaponMag, _turretClassname]] call CBA_fnc_execNextFrame; @@ -108,23 +125,23 @@ // Eject dead units (all crew are dead or UAV at this point, otherwise condition would have failed), but ignore UAV units { if (unitIsUAV _x) then { - _staticWeapon deleteVehicleCrew _x; + _vehicle deleteVehicleCrew _x; } else { moveOut _x; }; - } forEach (crew _staticWeapon); + } forEach (crew _vehicle); - deleteVehicle _staticWeapon; + deleteVehicle _vehicle; LOG("end"); }; private _condition = { params ["_args"]; - _args params ["_staticWeapon"]; + _args params ["_vehicle"]; - _staticWeapon call FUNC(assemble_canPickupWeapon) + _vehicle call FUNC(assemble_canPickupWeapon) }; - [TIME_PROGRESSBAR(_pickupTime), [_staticWeapon, _player, _carryWeaponClassname, _turretClassname, _onDisassembleFunc], _onFinish, {}, LLSTRING(DisassembleCSW_progressBar), _condition] call EFUNC(common,progressBar); + [TIME_PROGRESSBAR(_pickupTime), [_vehicle, _player, _carryWeaponClassname, _turretClassname, _onDisassembleFunc], _onFinish, {}, LLSTRING(DisassembleCSW_progressBar), _condition] call EFUNC(common,progressBar); }, _this] call CBA_fnc_execNextFrame; diff --git a/addons/csw/functions/fnc_canDeployTripod.sqf b/addons/csw/functions/fnc_canDeployTripod.sqf index 8969758e4d4..9eb7f0a133a 100644 --- a/addons/csw/functions/fnc_canDeployTripod.sqf +++ b/addons/csw/functions/fnc_canDeployTripod.sqf @@ -1,10 +1,10 @@ #include "..\script_component.hpp" /* * Author: tcvm - * Checks if the unit can deploy a tripod + * Checks if the player can deploy the tripod. * * Arguments: - * 0: Unit <OBJECT> + * 0: Player <OBJECT> * * Return Value: * Can deploy <BOOL> @@ -15,8 +15,8 @@ * Public: No */ -params ["_unit"]; +params ["_player"]; -private _secondaryWeapon = secondaryWeapon _unit; +private _secondaryWeapon = secondaryWeapon _player; _secondaryWeapon != "" && {getText (configFile >> "CfgWeapons" >> _secondaryWeapon >> QUOTE(ADDON) >> "type") == "mount"} // return diff --git a/addons/csw/functions/fnc_canGetIn.sqf b/addons/csw/functions/fnc_canGetIn.sqf index 16446c4fb23..9e017c16ef0 100644 --- a/addons/csw/functions/fnc_canGetIn.sqf +++ b/addons/csw/functions/fnc_canGetIn.sqf @@ -1,10 +1,10 @@ #include "..\script_component.hpp" /* * Author: tcvm - * Checks if it's possible to get in the CSW + * Checks if it's possible to get in the CSW. * * Arguments: - * 0: Vehicle <OBJECT> + * 0: CSW <OBJECT> * * Return Value: * None diff --git a/addons/csw/functions/fnc_canPickupTripod.sqf b/addons/csw/functions/fnc_canPickupTripod.sqf index 2ec3b065da0..bf25b5a9e87 100644 --- a/addons/csw/functions/fnc_canPickupTripod.sqf +++ b/addons/csw/functions/fnc_canPickupTripod.sqf @@ -1,17 +1,16 @@ #include "..\script_component.hpp" /* * Author: tcvm - * Checks if the unit can pickup the tripod + * Checks if the player can pickup the tripod. * * Arguments: * 0: Tripod <OBJECT> - * 1: Unit (not used) <OBJECT> * * Return Value: * Can pickup <BOOL> * * Example: - * [cursorObject, player] call ace_csw_fnc_canPickupTripod + * cursorObject call ace_csw_fnc_canPickupTripod * * Public: No */ diff --git a/addons/csw/functions/fnc_getCarryMagazine.sqf b/addons/csw/functions/fnc_getCarryMagazine.sqf index 81e07c6f103..3d94ca2fe1c 100644 --- a/addons/csw/functions/fnc_getCarryMagazine.sqf +++ b/addons/csw/functions/fnc_getCarryMagazine.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: PabstMirror, Dystopian - * Gets magazine that the player can carry, suitable to vehicle magazine + * Gets magazine that the player can carry, suitable to vehicle magazine. * * Arguments: * 0: Vehicle Magazine <STRING> diff --git a/addons/csw/functions/fnc_getLoadActions.sqf b/addons/csw/functions/fnc_getLoadActions.sqf index e505c7f50fb..59b368b3686 100644 --- a/addons/csw/functions/fnc_getLoadActions.sqf +++ b/addons/csw/functions/fnc_getLoadActions.sqf @@ -1,10 +1,10 @@ #include "..\script_component.hpp" /* * Author: PabstMirror - * Gets sub actions for what the unit can load into the CSW + * Gets sub actions for what the player can load into the CSW. * * Arguments: - * 0: Vehicle <OBJECT> + * 0: CSW <OBJECT> * 1: Unit <OBJECT> * * Return Value: @@ -32,10 +32,11 @@ private _condition = { params ["_target", "_player", "_args"]; _args params ["_carryMag", "_turretPath", "", "_magSource"]; - ([_target, _turretPath, _carryMag, _magSource] call FUNC(reload_canLoadMagazine)) select 0 + [_player, _target] call EFUNC(interaction,canInteractWithVehicleCrew) && + {([_target, _turretPath, _carryMag, _magSource] call FUNC(reload_canLoadMagazine)) select 0} }; -private _cfgMagazines = configFile >> "CfgMagazines"; // micro-optimization +private _cfgMagazines = configFile >> "CfgMagazines"; // Micro-optimization private _actions = []; { _x params ["_carryMag", "", "_loadInfo"]; diff --git a/addons/csw/functions/fnc_getUnloadActions.sqf b/addons/csw/functions/fnc_getUnloadActions.sqf index dd119b06226..1c7b629ebcc 100644 --- a/addons/csw/functions/fnc_getUnloadActions.sqf +++ b/addons/csw/functions/fnc_getUnloadActions.sqf @@ -32,6 +32,7 @@ private _statement = { TIME_PROGRESSBAR(_timeToUnload), [_target, _turretPath, _player, _carryMag, _vehMag], { + //IGNORE_PRIVATE_WARNING ["_player"]; (_this select 0) params ["_target", "_turretPath", "", "_carryMag", "_vehMag"]; TRACE_5("unload progressBar finish",_target,_turretPath,_carryMag,_vehMag,_player); [QGVAR(removeTurretMag), [_target, _turretPath, _carryMag, _vehMag, _player]] call CBA_fnc_globalEvent; @@ -46,7 +47,9 @@ private _statement = { private _condition = { params ["_target", "_player", "_args"]; _args params ["_vehMag", "_turretPath", "_carryMag"]; - [_target, _turretPath, _player, _carryMag, _vehMag] call FUNC(reload_canUnloadMagazine) + + [_player, _target] call EFUNC(interaction,canInteractWithVehicleCrew) && + {[_target, _turretPath, _player, _carryMag, _vehMag] call FUNC(reload_canUnloadMagazine)} }; private _actions = []; diff --git a/addons/csw/functions/fnc_initVehicle.sqf b/addons/csw/functions/fnc_initVehicle.sqf index 2d7241029f8..1c4660260fd 100644 --- a/addons/csw/functions/fnc_initVehicle.sqf +++ b/addons/csw/functions/fnc_initVehicle.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: tcvm - * Initializes CSW systems on vehicle + * Initializes CSW systems on vehicle. * * Arguments: * 0: Vehicle <OBJECT> @@ -34,30 +34,33 @@ if (_configEnabled && {GVAR(ammoHandling) == 2}) then { }; TRACE_2("",local _vehicle,_vehicle turretLocal [0]); -if (_configEnabled && {_vehicle turretLocal [0]}) then { // if turret is local to us, then handle mags/weapon - [{ - params ["_vehicle"]; - if (!alive _vehicle) exitWith { TRACE_1("dead/deleted",_vehicle); }; - // Assembly mode: [0=disabled, 1=enabled, 2=enabled&unload, 3=default] - private _assemblyModeIndex = _vehicle getVariable [QGVAR(assemblyMode), 3]; + +if (_vehicle turretLocal [0]) then { + // Assembly mode: [0=disabled, 1=enabled, 2=enabled&unload, 3=default] + private _assemblyModeIndex = _vehicle getVariable [QGVAR(assemblyMode), 3]; + private _assemblyMode = [false, true, true, GVAR(defaultAssemblyMode)] select _assemblyModeIndex; + + TRACE_2("turretLocal",_vehicle,_assemblyMode); + + // If turret is local, handle unloading mags and proxy weapons + if (_configEnabled) then { + TRACE_2("config enabled",_vehicle,_assemblyMode); + private _emptyWeapon = _assemblyModeIndex isEqualTo 2; - private _assemblyMode = [false, true, true, GVAR(defaultAssemblyMode)] select _assemblyModeIndex; - TRACE_2("turretLocal",_vehicle,_assemblyMode); + [_vehicle, [0], _assemblyMode, _emptyWeapon] call FUNC(proxyWeapon); - [_vehicle, _assemblyMode, _emptyWeapon] call FUNC(staticWeaponInit_unloadExtraMags); - }, [_vehicle]] call CBA_fnc_execNextFrame; // need to wait a frame to allow setting object vars during assembly -}; -if (_assemblyConfig) then { - [{ - params ["_vehicle"]; - if (!alive _vehicle) exitWith { TRACE_1("dead/deleted",_vehicle); }; - private _assemblyMode = [false, true, true, GVAR(defaultAssemblyMode)] select (_vehicle getVariable [QGVAR(assemblyMode), 3]); + if (!_assemblyMode) exitWith {}; + + [_vehicle, _emptyWeapon] call FUNC(staticWeaponInit_unloadExtraMags); + }; + + if (_assemblyConfig) then { TRACE_2("assemblyConfig present",_vehicle,_assemblyMode); - if (_assemblyMode) then { // Disable vanilla assembly if assemblyMode enabled - [_vehicle, "disableWeaponAssembly", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); - }; - }, [_vehicle]] call CBA_fnc_execNextFrame; // need to wait a frame to allow setting object vars during assembly + // Disable vanilla assembly if assemblyMode enabled + // Need to wait to allow setting object vars during assembly, but since this function runs 1 second after vehicle init, it can run immediately + [_vehicle, "disableWeaponAssembly", QUOTE(ADDON), _assemblyMode] call EFUNC(common,statusEffect_set); + }; }; // Add interactions for players @@ -78,7 +81,7 @@ if (hasInterface && {!(_typeOf in GVAR(initializedStaticTypes))}) then { if ((GVAR(ammoHandling) == 0) && {!([false, true, true, GVAR(defaultAssemblyMode)] select (_target getVariable [QGVAR(assemblyMode), 3]))}) exitWith { false }; [_player, _target, ["isNotSwimming", "isNotSitting"]] call EFUNC(common,canInteractWith) }; - private _childenCode = { + private _childrenCode = { BEGIN_COUNTER(getActions); // can remove for final release private _ret = (call FUNC(getLoadActions)) + (call FUNC(getUnloadActions)); END_COUNTER(getActions); @@ -86,17 +89,25 @@ if (hasInterface && {!(_typeOf in GVAR(initializedStaticTypes))}) then { }; if (_configEnabled && {_magazineLocation != ""}) then { private _positionCode = compile _magazineLocation; - private _ammoAction = [QGVAR(magazine), LLSTRING(AmmoHandling_displayName), "", {}, _condition, _childenCode, [], _positionCode, 4] call EFUNC(interact_menu,createAction); + private _ammoAction = [QGVAR(magazine), LLSTRING(AmmoHandling_displayName), "", {}, _condition, _childrenCode, [], _positionCode, 4] call EFUNC(interact_menu,createAction); _ammoActionPath = [_typeOf, 0, [], _ammoAction] call EFUNC(interact_menu,addActionToClass); } else { - private _ammoAction = [QGVAR(magazine), LLSTRING(AmmoHandling_displayName), "", {}, _condition, _childenCode] call EFUNC(interact_menu,createAction); + private _ammoAction = [QGVAR(magazine), LLSTRING(AmmoHandling_displayName), "", {}, _condition, _childrenCode] call EFUNC(interact_menu,createAction); _ammoActionPath = [_typeOf, 0, ["ACE_MainActions"], _ammoAction] call EFUNC(interact_menu,addActionToClass); }; if (["ace_reload"] call EFUNC(common,isModLoaded)) then { - // move reload's check ammo action to the ammo handling point (remove and re-add) [_typeOf, 0, ["ACE_MainActions", QEGVAR(reload,CheckAmmo)]] call EFUNC(interact_menu,removeActionFromClass); - private _checkAmmoAction = [QGVAR(checkAmmo), LELSTRING(reload,checkAmmo), "", EFUNC(reload,checkAmmo), EFUNC(reload,canCheckAmmo)] call EFUNC(interact_menu,createAction); + + // Replace existing check ammo interaction with one that takes into account if the magazine actions are available + private _checkAmmoAction = [QEGVAR(reload,CheckAmmo), LELSTRING(reload,checkAmmo), "", EFUNC(reload,checkAmmo), { + if !((GVAR(ammoHandling) == 0) && {!([false, true, true, GVAR(defaultAssemblyMode)] select (_target getVariable [QGVAR(assemblyMode), 3]))}) exitWith { false }; + _this call EFUNC(reload,canCheckAmmo) + }] call EFUNC(interact_menu,createAction); + [_typeOf, 0, ["ACE_MainActions"], _checkAmmoAction] call EFUNC(interact_menu,addActionToClass); + + // Add another check ammo action to the ammo handling point + _checkAmmoAction = [QGVAR(checkAmmo), LELSTRING(reload,checkAmmo), "", EFUNC(reload,checkAmmo), EFUNC(reload,canCheckAmmo)] call EFUNC(interact_menu,createAction); [_typeOf, 0, _ammoActionPath, _checkAmmoAction] call EFUNC(interact_menu,addActionToClass); }; }; diff --git a/addons/csw/functions/fnc_proxyWeapon.sqf b/addons/csw/functions/fnc_proxyWeapon.sqf index fedd1d412b3..47897c43c22 100644 --- a/addons/csw/functions/fnc_proxyWeapon.sqf +++ b/addons/csw/functions/fnc_proxyWeapon.sqf @@ -1,10 +1,10 @@ #include "..\script_component.hpp" /* * Author: tcvm, PabstMirror - * Handles the use of proxy weapons to bypass engine reload times + * Handles the use of proxy weapons to fix engine-reload times. * * Arguments: - * 0: Vehicle <OBJECT> + * 0: CSW <OBJECT> * 1: Turret <ARRAY> * 2: Proxy weapon needed <BOOL> * 2: Weapon should be emptied <BOOL> @@ -21,6 +21,11 @@ params ["_vehicle", "_turret", "_needed", "_emptyWeapon"]; TRACE_4("proxyWeapon",_vehicle,_turret,_needed,_emptyWeapon); +// addWeaponTurret/removeWeaponTurret need to be executed where turret is local +if !(_vehicle turretLocal _turret) exitWith { + WARNING_2("[%1]'s turret [%2] isn't local, skipping proxy weapon change",_vehicle,_turret); +}; + if (_vehicle getVariable [format [QGVAR(proxyHandled_%1), _turret], false]) exitWith { TRACE_1("already handled",typeOf _vehicle); }; private _proxyWeapon = getText (configOf _vehicle >> QUOTE(ADDON) >> "proxyWeapon"); diff --git a/addons/csw/functions/fnc_reload_canLoadMagazine.sqf b/addons/csw/functions/fnc_reload_canLoadMagazine.sqf index 70c673299af..d4049706bdb 100644 --- a/addons/csw/functions/fnc_reload_canLoadMagazine.sqf +++ b/addons/csw/functions/fnc_reload_canLoadMagazine.sqf @@ -1,16 +1,16 @@ #include "..\script_component.hpp" /* - * Author: PabstMirror &tcvm - * Tests if unit can load a magazine into a static weapon. + * Author: PabstMirror, tcvm + * Tests if unit can load a magazine into a CSW. * * Arguments: - * 0: Static Weapon <OBJECT> + * 0: CSW <OBJECT> * 1: Turret Path <ARRAY> * 2: Carryable Magazine <STRING> - * 3: Supplier <OBJECT> + * 3: Supplier <OBJECT> (default: objNull) * * Return Value: - * [CanLoad<BOOL>, LoadedMag<STRING>, AmmoNeeded<NUMBER>, IsBeltLinking<BOOL>]<ARRAY> + * [Can Load <BOOL>, Loaded Mag <STRING>, Ammo Needed <NUMBER>, Is Belt Linking <BOOL>] <ARRAY> * * Example: * [cursorObject, [0], "ACE_csw_100Rnd_127x99_mag_red", player] call ace_csw_fnc_reload_canLoadMagazine @@ -28,7 +28,7 @@ if (!alive _vehicle) exitWith { _return }; // Verify holder has carry magazine if ( (!isNull _magSource) && - {!((_magSource isKindOf "Bag_Base") || {_magSource isKindOf "ContainerSupply"})} && // hacky workaround for magazines within dropped backpacks + {!((_magSource isKindOf "Bag_Base") || {_magSource isKindOf "ContainerSupply"})} && // Hacky workaround for magazines within dropped backpacks { ((_vehicle distance _magSource) > 10) || {((magazineCargo _magSource) findIf {_x == _carryMag}) == -1} @@ -42,7 +42,7 @@ private _cfgGroupsCarryMag = configFile >> QGVAR(groups) >> _carryMag; private _desiredAmmo = getNumber (configOf _vehicle >> QUOTE(ADDON) >> "desiredAmmo"); if (_desiredAmmo == 0) then { _desiredAmmo = 100; }; -private _ammoNeeded = _desiredAmmo min getNumber (_cfgMagazinesCarryMag >> "count"); // assume it needs full carry mag +private _ammoNeeded = _desiredAmmo min getNumber (_cfgMagazinesCarryMag >> "count"); // Assume it needs full carry mag private _loadedMag = ""; private _isBeltLinking = false; @@ -62,7 +62,7 @@ scopeName "main"; }; private _maxMagazineAmmo = _desiredAmmo min getNumber (_cfgMagazines >> _xMag >> "count"); if (_xAmmo >= _maxMagazineAmmo) exitWith { - [false, _loadedMag, -6, false] breakOut "main"; // Already at capicity + [false, _loadedMag, -6, false] breakOut "main"; // Already at capacity }; _ammoNeeded = _maxMagazineAmmo - _xAmmo; _isBeltLinking = true; diff --git a/addons/csw/functions/fnc_reload_canUnloadMagazine.sqf b/addons/csw/functions/fnc_reload_canUnloadMagazine.sqf index 4e03625a294..d7899e655a6 100644 --- a/addons/csw/functions/fnc_reload_canUnloadMagazine.sqf +++ b/addons/csw/functions/fnc_reload_canUnloadMagazine.sqf @@ -1,10 +1,10 @@ #include "..\script_component.hpp" /* * Author: PabstMirror - * Tests if unit can unload a magazine from a static weapon. + * Tests if unit can unload a magazine from a CSW. * * Arguments: - * 0: Static Weapon <OBJECT> + * 0: CSW <OBJECT> * 1: Turret Path <ARRAY> * 2: Player <OBJECT> * 3: Carryable Magazine <STRING> diff --git a/addons/csw/functions/fnc_reload_getLoadableMagazines.sqf b/addons/csw/functions/fnc_reload_getLoadableMagazines.sqf index 724ee4d09cc..861f70350d1 100644 --- a/addons/csw/functions/fnc_reload_getLoadableMagazines.sqf +++ b/addons/csw/functions/fnc_reload_getLoadableMagazines.sqf @@ -1,15 +1,15 @@ #include "..\script_component.hpp" /* * Author: PabstMirror - * Gets magazines that the player is carrying that can be loaded into the static weapon + * Gets nearby magazines that can be loaded into the CSW. * * Arguments: - * 0: Vehicle <OBJECT> - * 1: Player <OBJECT> + * 0: CSW <OBJECT> + * 1: Unit <OBJECT> * * Return Value: * Mags <ARRAY> - * [Carry Magazine <STRING>, Turret Path <ARRAY>, Load Info <NUMBER>, Magazine Source <OBJECT>] + * [Carry Magazine <STRING>, Turret Path <ARRAY>, Load Info <ARRAY>, Magazine Source <OBJECT>] * * Example: * [cursorObject, player] call ace_csw_fnc_reload_getLoadableMagazines diff --git a/addons/csw/functions/fnc_reload_getVehicleMagazine.sqf b/addons/csw/functions/fnc_reload_getVehicleMagazine.sqf index 6b5b77efeec..24d21534ee2 100644 --- a/addons/csw/functions/fnc_reload_getVehicleMagazine.sqf +++ b/addons/csw/functions/fnc_reload_getVehicleMagazine.sqf @@ -4,7 +4,7 @@ * Finds the best vehicle magazines to create from a carryable magazine for a given weapon. * * Arguments: - * 0: Vehicle <OBJECT> + * 0: CSW <OBJECT> * 1: Turret <ARRAY> * 2: Magazine that is carryable <STRING> * @@ -37,7 +37,7 @@ private _bestMagCount = -1; _bestMagCount = _xAmmo; }; }; - } forEach (getArray (configFile >> "CfgWeapons" >> _weapon >> "magazines")); + } forEach (compatibleMagazines _weapon); } forEach (_vehicle weaponsTurret _turret); TRACE_3("best fit",_desiredAmmo,_bestMag,_bestMagCount); diff --git a/addons/csw/functions/fnc_reload_handleAddTurretMag.sqf b/addons/csw/functions/fnc_reload_handleAddTurretMag.sqf index d7af22d319a..389ae699a4a 100644 --- a/addons/csw/functions/fnc_reload_handleAddTurretMag.sqf +++ b/addons/csw/functions/fnc_reload_handleAddTurretMag.sqf @@ -1,16 +1,16 @@ #include "..\script_component.hpp" /* * Author: tcvm, PabstMirror - * Handles adding ammo to a turret - * Called from a global event but only runs where turret is local + * Handles adding ammo to a turret. + * Called from a global event but only runs where turret is local. * * Arguments: - * 0: Static Weapon <OBJECT> + * 0: CSW <OBJECT> * 1: Turret Path <ARRAY> * 2: Source of magazine <OBJECT> * 3: Vehicle Magazine <STRING> * 4: Ammo in magazine <NUMBER> - * 5: Unit or object to return ammo to <OBJECT> + * 5: Unit or object to return ammo to <OBJECT> (default: Source of magazine) * * Return Value: * None @@ -21,7 +21,8 @@ * Public: No */ -params ["_vehicle", "_turret", "_magSource", "_carryMag", "_ammoReceived", ["_returnTo", _magSource]]; +params ["_vehicle", "_turret", "_magSource", "_carryMag", "_ammoReceived"]; +private _returnTo = param [5, _magSource]; TRACE_6("reload_handleAddTurretMag",_vehicle,_turret,_magSource,_carryMag,_ammoReceived,_returnTo); TRACE_2("",local _vehicle,_vehicle turretLocal _turret); diff --git a/addons/csw/functions/fnc_reload_handleRemoveTurretMag.sqf b/addons/csw/functions/fnc_reload_handleRemoveTurretMag.sqf index 51036b525a3..dccc9b16d4c 100644 --- a/addons/csw/functions/fnc_reload_handleRemoveTurretMag.sqf +++ b/addons/csw/functions/fnc_reload_handleRemoveTurretMag.sqf @@ -1,13 +1,13 @@ #include "..\script_component.hpp" /* * Author: tcvm - * Handles removing ammo from a turret - * Called from a global event but only runs where turret is local + * Handles removing ammo from a turret. + * Called from a global event but only runs where turret is local. * * Arguments: - * 0: Static Weapon <OBJECT> + * 0: CSW <OBJECT> * 1: Turret Path <ARRAY> - * 2: Magainze Unit Can Carry <STRING> + * 2: Magazine Unit Can Carry <STRING> * 3: Magazine To Remove From Static <STRING> * 4: Unit or container to unload to <OBJECT> * diff --git a/addons/csw/functions/fnc_reload_handleReturnAmmo.sqf b/addons/csw/functions/fnc_reload_handleReturnAmmo.sqf index ca445400b02..009a39c0d10 100644 --- a/addons/csw/functions/fnc_reload_handleReturnAmmo.sqf +++ b/addons/csw/functions/fnc_reload_handleReturnAmmo.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* - * Author: tcvm and PabstMirror - * Handles returned ammo (either from unloading or leftovers from linking) + * Author: tcvm, PabstMirror + * Handles returned ammo (either from unloading or leftovers from linking). * * Arguments: * 0: Man or Vehicle <OBJECT> @@ -18,13 +18,15 @@ */ params ["_unloadTo", "_carryMag", "_ammo"]; -TRACE_3("reload_handleReturnAmmo",_unloadTo,_carryMag,_ammo); +TRACE_4("reload_handleReturnAmmo",_unloadTo,typeOf _unloadTo,_carryMag,_ammo); private _carryMaxAmmo = getNumber (configFile >> "CfgMagazines" >> _carryMag >> "count"); private _fullMagazines = floor (_ammo / _carryMaxAmmo); private _bulletsRemaining = _ammo % _carryMaxAmmo; -if (_unloadTo isKindOf "CaManBase") then { +private _unloadToUnit = _unloadTo isKindOf "CAManBase"; + +if (_unloadToUnit) then { while {(_fullMagazines > 0) && {[_unloadTo, _carryMag] call CBA_fnc_canAddItem}} do { _unloadTo addMagazine [_carryMag, _carryMaxAmmo]; _fullMagazines = _fullMagazines - 1; @@ -37,19 +39,21 @@ if (_unloadTo isKindOf "CaManBase") then { if ((_fullMagazines == 0) && {_bulletsRemaining == 0}) exitWith {}; -// Try to use existing container -private _container = _unloadTo getVariable [QGVAR(container), objNull]; -if ((_container distance _unloadTo) > 10) then { _container = objNull; }; -if (isNull _container) then { - _container = (nearestObjects [_unloadTo, [["GroundWeaponHolder"], [QGVAR(ammo_holder)]] select GVAR(handleExtraMagazinesType), 10]) param [0, objNull]; +// Try to use object inventory or existing container +private _container = [_unloadTo, objNull] select _unloadToUnit; +if ((maxLoad _container) isEqualTo 0) then { + _container = _unloadTo getVariable [QGVAR(container), objNull]; + if ((_container distance _unloadTo) > 10) then { _container = objNull; }; + if (isNull _container) then { + _container = (nearestObjects [_unloadTo, [["GroundWeaponHolder"], [QGVAR(ammo_holder)]] select GVAR(handleExtraMagazinesType), 10]) param [0, objNull]; + }; }; - if (isNull _container) then { // Create ammo storage container private _weaponRelPos = _unloadTo getRelPos RELATIVE_DIRECTION(270); _weaponRelPos set [2, ((getPosATL _unloadTo) select 2) + 0.05]; - _container = createVehicle [["GroundWeaponHolder", QGVAR(ammo_holder)] select GVAR(handleExtraMagazinesType), [0, 0, 0], [], 0, "NONE"]; + _container = createVehicle [["GroundWeaponHolder", QGVAR(ammo_holder)] select GVAR(handleExtraMagazinesType), [0, 0, 0], [], 0, "CAN_COLLIDE"]; _unloadTo setVariable [QGVAR(container), _container, true]; _container setDir random [0, 180, 360]; _container setPosATL _weaponRelPos; @@ -59,7 +63,7 @@ if (isNull _container) then { TRACE_2("Creating NEW Container",_container,_weaponRelPos); }; -TRACE_3("adding to container",_container,_fullMagazines,_bulletsRemaining); +TRACE_4("adding to container",_container,typeOf _container,_fullMagazines,_bulletsRemaining); if (_fullMagazines > 0) then { _container addMagazineAmmoCargo [_carryMag, _fullMagazines, _carryMaxAmmo]; diff --git a/addons/csw/functions/fnc_reload_loadMagazine.sqf b/addons/csw/functions/fnc_reload_loadMagazine.sqf index 50081a87a5c..a5a3e07c06e 100644 --- a/addons/csw/functions/fnc_reload_loadMagazine.sqf +++ b/addons/csw/functions/fnc_reload_loadMagazine.sqf @@ -1,10 +1,10 @@ #include "..\script_component.hpp" /* * Author: PabstMirror - * Loads a magazine into a static weapon from a magazine carried by or next to the player. + * Loads a magazine into a CSW from a magazine carried by or next to the player. * * Arguments: - * 0: Vehicle <OBJECT> + * 0: CSW <OBJECT> * 1: Turret <ARRAY> * 2: Unit Carried Magazine <STRING> * 3: Magazine source <OBJECT> @@ -48,12 +48,23 @@ private _onFinish = { }; } forEach (if (_magSource isKindOf "CAManBase") then {magazinesAmmo _magSource} else {magazinesAmmoCargo _magSource}); - if (_bestAmmoToSend == -1) exitWith {ERROR_2("No ammo [%1 - %2]?",_xMag,_bestAmmoToSend);}; + if (_bestAmmoToSend == -1) exitWith {ERROR_2("No ammo [%1 - %2]?",_carryMag,_bestAmmoToSend);}; [_magSource, _carryMag, _bestAmmoToSend] call EFUNC(common,removeSpecificMagazine); if (_bestAmmoToSend == 0) exitWith {}; - TRACE_6("calling addTurretMag event",_vehicle,_turret,_magSource,_carryMag,_bestAmmoToSend,_unit); - [QGVAR(addTurretMag), [_vehicle, _turret, _magSource, _carryMag, _bestAmmoToSend, _unit]] call CBA_fnc_globalEvent; + // Workaround for removeSpecificMagazine and WeaponHolders being deleted when empty, give back to the unit if the weapon holder was deleted + // TODO: Pass type and position of deleted object to create a new one + // TODO: Use '_magSource getEntityInfo 14' in 2.18 and the isSetForDeletion flag to execute in same frame + [{ + params ["_magSource", "_unit", "_args"]; + + if (isNull _magSource) then { + _args pushBack _unit; + }; + + TRACE_1("calling addTurretMag event",_args); + [QGVAR(addTurretMag), _args] call CBA_fnc_globalEvent; + }, [_magSource, _unit, [_vehicle, _turret, _magSource, _carryMag, _bestAmmoToSend]]] call CBA_fnc_execNextFrame; }; diff --git a/addons/csw/functions/fnc_staticWeaponInit_unloadExtraMags.sqf b/addons/csw/functions/fnc_staticWeaponInit_unloadExtraMags.sqf index 98200840a35..975d5dbb9c2 100644 --- a/addons/csw/functions/fnc_staticWeaponInit_unloadExtraMags.sqf +++ b/addons/csw/functions/fnc_staticWeaponInit_unloadExtraMags.sqf @@ -1,11 +1,11 @@ #include "..\script_component.hpp" /* * Author: tcvm, PabstMirror - * Dumps ammo to container + * Dumps ammo to container. * * Arguments: - * 0: Weapon <OBJECT> - * 1: Using advanced assembly <BOOL> + * 0: CSW <OBJECT> + * 1: Empty weapon <BOOL> * * Return Value: * None @@ -16,11 +16,10 @@ * Public: No */ -params ["_staticWeapon", "_assemblyMode", "_emptyWeapon"]; -TRACE_3("staticWeaponInit_unloadExtraMags",_staticWeapon,_assemblyMode,_emptyWeapon); -if (!_assemblyMode) exitWith {}; +params ["_vehicle", "_emptyWeapon"]; +TRACE_2("staticWeaponInit_unloadExtraMags",_vehicle,_emptyWeapon); -private _desiredAmmo = getNumber (configOf _staticWeapon >> QUOTE(ADDON) >> "desiredAmmo"); +private _desiredAmmo = getNumber (configOf _vehicle >> QUOTE(ADDON) >> "desiredAmmo"); private _storeExtraMagazines = GVAR(handleExtraMagazines); if (_emptyWeapon) then { _desiredAmmo = 0; @@ -56,41 +55,43 @@ private _containerMagazineCount = []; } else { if ((_xMag select [0,4]) != "fake") then { WARNING_1("Unable to unload [%1] - No matching carry mag",_xMag); }; }; -} forEach (magazinesAllTurrets _staticWeapon); +} forEach (magazinesAllTurrets _vehicle); TRACE_1("Remove all loaded magazines",_magsToRemove); { - _staticWeapon removeMagazinesTurret _x; + [QEGVAR(common,removeMagazinesTurret), [_vehicle, _x select 0, _x select 1], _vehicle, _x select 1] call CBA_fnc_turretEvent; + if ((_loadedMagazineInfo select [0,2]) isEqualTo _x) then { TRACE_1("Re-add the starting mag",_loadedMagazineInfo); - _staticWeapon addMagazineTurret _loadedMagazineInfo; + + [QEGVAR(common,addMagazineTurret), [_vehicle, _loadedMagazineInfo], _vehicle, _x select 1] call CBA_fnc_turretEvent; }; } forEach _magsToRemove; -private _secondaryWeaponMagazines = _staticWeapon getVariable [QGVAR(secondaryWeaponMagazines), []]; +private _secondaryWeaponMagazines = _vehicle getVariable [QGVAR(secondaryWeaponMagazines), []]; if (_secondaryWeaponMagazines isNotEqualTo []) then { // Check if the static weapon can take magazines - private _turret = (allTurrets _staticWeapon) param [0, []]; - private _compatibleMagazinesTurret = flatten ((_staticWeapon weaponsTurret _turret) apply {compatibleMagazines _x}); + private _turret = (allTurrets _vehicle) param [0, []]; + private _compatibleMagazinesTurret = flatten ((_vehicle weaponsTurret _turret) apply {compatibleMagazines _x}); private _container = objNull; { - private _vehicleMag = [_staticWeapon, _turret, _x select 0] call FUNC(reload_getVehicleMagazine); + private _vehicleMag = [_vehicle, _turret, _x select 0] call FUNC(reload_getVehicleMagazine); TRACE_3("Re-add previous mag",_x select 0,_turret,_vehicleMag); // If the magazine can be added to the static weapon, do it now if (_vehicleMag in _compatibleMagazinesTurret) then { - _staticWeapon addMagazineTurret [_vehicleMag, _turret, _x select 1]; + [QEGVAR(common,addMagazineTurret), [_vehicle, [_vehicleMag, _turret, _x select 1]], _vehicle, _turret] call CBA_fnc_turretEvent; } else { // Find a suitable container to place items in if necessary if (isNull _container) then { - _container = (nearestObjects [_staticWeapon, ["GroundWeaponHolder"], 10]) param [0, objNull]; + _container = (nearestObjects [_vehicle, ["GroundWeaponHolder"], 10]) param [0, objNull]; // Create ammo storage container if (isNull _container) then { - _container = createVehicle ["GroundWeaponHolder", getPosATL _staticWeapon, [], 0, "NONE"]; + _container = createVehicle ["GroundWeaponHolder", getPosATL _vehicle, [], 0, "NONE"]; }; }; @@ -99,12 +100,12 @@ if (_secondaryWeaponMagazines isNotEqualTo []) then { }; } forEach _secondaryWeaponMagazines; - _staticWeapon setVariable [QGVAR(secondaryWeaponMagazines), nil, true]; + _vehicle setVariable [QGVAR(secondaryWeaponMagazines), nil, true]; }; if (_storeExtraMagazines) then { TRACE_1("saving extra mags to container",_containerMagazineCount); { - [_staticWeapon, _x, _containerMagazineCount select _forEachIndex] call FUNC(reload_handleReturnAmmo); + [_vehicle, _x, _containerMagazineCount select _forEachIndex] call FUNC(reload_handleReturnAmmo); } forEach _containerMagazineClassnames; }; diff --git a/addons/csw/initSettings.inc.sqf b/addons/csw/initSettings.inc.sqf index bc157e1164b..4a58ed80b03 100644 --- a/addons/csw/initSettings.inc.sqf +++ b/addons/csw/initSettings.inc.sqf @@ -1,56 +1,53 @@ -private _categoryArray = [format ["ACE %1", localize LSTRING(DisplayName)]]; +private _categoryArray = [format ["ACE %1", LLSTRING(DisplayName)]]; [ - QGVAR(defaultAssemblyMode), "CHECKBOX", + QGVAR(defaultAssemblyMode), + "CHECKBOX", [LSTRING(defaultAssemblyMode_displayName), LSTRING(defaultAssemblyMode_description)], _categoryArray, false, // default value - true, // isGlobal - {[QGVAR(defaultAssemblyMode), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true // Needs mission restart + 1 // isGlobal ] call CBA_fnc_addSetting; [ - QGVAR(handleExtraMagazines), "CHECKBOX", + QGVAR(handleExtraMagazines), + "CHECKBOX", [LSTRING(handleExtraMagazines_displayName), LSTRING(handleExtraMagazines_description)], _categoryArray, true, // default value - true, // isGlobal - {[QGVAR(handleExtraMagazines), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true // Needs mission restart + 1 // isGlobal ] call CBA_fnc_addSetting; [ - QGVAR(handleExtraMagazinesType), "LIST", + QGVAR(handleExtraMagazinesType), + "LIST", [LSTRING(handleExtraMagazinesType_displayName), LSTRING(handleExtraMagazinesType_description)], _categoryArray, [[0, 1], [LSTRING(handleExtraMagazinesType_weaponHolder), LSTRING(handleExtraMagazinesType_ammoBox)], 0], - true, // isGlobal - {[QGVAR(handleExtraMagazinesType), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true // Needs mission restart + 1 // isGlobal ] call CBA_fnc_addSetting; [ - QGVAR(ammoHandling), "LIST", + QGVAR(ammoHandling), + "LIST", [LSTRING(ammoHandling_displayName), LSTRING(ammoHandling_description)], _categoryArray, [[0, 1, 2], [LELSTRING(common,Disabled), LELSTRING(common,playerOnly), LELSTRING(common,playersAndAI)], 2], // [_values, _valueTitles, _defaultIndex] - true, // isGlobal - {[QGVAR(ammoHandling), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true // Needs mission restart + 1 // isGlobal ] call CBA_fnc_addSetting; [ - QGVAR(progressBarTimeCoefficent), "SLIDER", + QGVAR(progressBarTimeCoefficent), + "SLIDER", [LSTRING(progressBarTimeCoefficent_displayName), LSTRING(progressBarTimeCoefficent_description)], _categoryArray, - [0,2,1,2], // [min, max, default value, trailing decimals (-1 for whole numbers only)] - true // isGlobal + [0, 2, 1, 2], // [min, max, default value, trailing decimals (-1 for whole numbers only)] + 1 // isGlobal ] call CBA_fnc_addSetting; [ - QGVAR(dragAfterDeploy), "CHECKBOX", + QGVAR(dragAfterDeploy), + "CHECKBOX", [LSTRING(dragAfterDeploy_displayName), LSTRING(dragAfterDeploy_description)], - _categoryArray, - false // default value + _categoryArray ] call CBA_fnc_addSetting; diff --git a/addons/csw/stringtable.xml b/addons/csw/stringtable.xml index da794376ab9..5d11773490b 100644 --- a/addons/csw/stringtable.xml +++ b/addons/csw/stringtable.xml @@ -672,6 +672,22 @@ <Russian>[CSW] Лента 20-мм гранат для ст. гранатомёта</Russian> <Korean>[CSW] 20mm 고속유탄발사기 탄띠</Korean> </Key> + <Key ID="STR_ACE_CSW_GMGBelt_descriptionShort"> + <English>Caliber: 20 mm<br/>Rounds: 20<br />Used in: Grenade Launcher</English> + <Chinese>口徑:20 mm<br/>個數:20<br />用於:榴彈發射器</Chinese> + <French>Calibre : 20 mm<br/>Munitions : 20<br />Application : lance-grenades</French> + <Spanish>Calibre: 20 mm<br/>Cargas: 20<br />Se usa en: lanzagranadas</Spanish> + <Italian>Calibro: 20 mm<br/>Munizioni: 20<br />Si usa in: lanciagranate</Italian> + <Polish>Kaliber: 20 mm<br/>Naboje: 20<br />Używane w: granatniku</Polish> + <Russian>Калибр: 20 мм<br/>Кол-во: 20<br />Применение: гранатомет</Russian> + <German>Kaliber: 20 mm<br/>Patronen: 20<br />Eingesetzt von: Granatenwerfer</German> + <Czech>Ráže: 20 mm<br/>Munice: 20<br />Použití: Granátomet</Czech> + <Portuguese>Calibre: 20 mm<br/>Balas: 20<br />Uso em: Lança-granadas</Portuguese> + <Korean>구경: 20mm<br />탄 수: 20<br />사용 가능: 유탄발사기</Korean> + <Chinesesimp>口径:20 毫米<br/>容弹量:20<br />用于:枪榴弹发射器</Chinesesimp> + <Japanese>口径:20 mm <br/>弾薬:20<br />使用:グレネードランチャー</Japanese> + <Turkish>Kalibre: 20 mm<br/>Mermi: 20<br />Kullanıldığı Yer: Bombaatar</Turkish> + </Key> <Key ID="STR_ACE_CSW_m3Tripod_displayName"> <English>M3 Tripod</English> <Spanish>Trípode M3</Spanish> diff --git a/addons/dagr/functions/fnc_menuInit.sqf b/addons/dagr/functions/fnc_menuInit.sqf index fc05185638f..b7433b92aae 100644 --- a/addons/dagr/functions/fnc_menuInit.sqf +++ b/addons/dagr/functions/fnc_menuInit.sqf @@ -584,7 +584,7 @@ GVAR(menuRun) = true; }; GVAR(tmpUpdateRate) = 0.1 max GVAR(tmpUpdateRate) min 2.0; if (!GVAR(busy)) then { - (__dsp displayCtrl __mainText) ctrlSetText (Str(GVAR(tmpUpdateRate) * 1000) + "ms"); + (__dsp displayCtrl __mainText) ctrlSetText (str(GVAR(tmpUpdateRate) * 1000) + "ms"); (__dsp displayCtrl __F1) ctrlSetText "Save"; (__dsp displayCtrl __F3) ctrlSetText "Cancel"; }; diff --git a/addons/dagr/functions/fnc_outputData.sqf b/addons/dagr/functions/fnc_outputData.sqf index b7064ce248a..646f56d1c88 100644 --- a/addons/dagr/functions/fnc_outputData.sqf +++ b/addons/dagr/functions/fnc_outputData.sqf @@ -17,7 +17,7 @@ 135471 cutRsc ["DAGR_DISPLAY", "plain down"]; -#define __display (uiNameSpace getVariable "DAGR_DISPLAY") +#define __display (uiNamespace getVariable "DAGR_DISPLAY") #define __gridControl (__display displayCtrl 266851) #define __speedControl (__display displayCtrl 266852) @@ -62,7 +62,7 @@ GVAR(outputPFH) = [{ }; // Time - private _dagrTime = [daytime, "HH:MM"] call bis_fnc_timeToString; + private _dagrTime = [dayTime, "HH:MM"] call bis_fnc_timeToString; // Output __gridControl ctrlSetText _dagrGrid; diff --git a/addons/dagr/functions/fnc_outputVector.sqf b/addons/dagr/functions/fnc_outputVector.sqf index e9bd0ea6c38..816ed2e4b23 100644 --- a/addons/dagr/functions/fnc_outputVector.sqf +++ b/addons/dagr/functions/fnc_outputVector.sqf @@ -17,7 +17,7 @@ 135471 cutRsc ["DAGR_DISPLAY", "plain down"]; -#define __display (uiNameSpace getVariable "DAGR_DISPLAY") +#define __display (uiNamespace getVariable "DAGR_DISPLAY") #define __gridControl (__display displayCtrl 266851) #define __speedControl (__display displayCtrl 266858) @@ -36,7 +36,7 @@ if (_lazPosX < 0) then { _lazPosX = _lazPosX + 99999;}; if (_lazPosY < 0) then {_lazPosY = _lazPosY + 99999;}; // Find laser position -private _xGrid = toArray Str(round _lazPosX); +private _xGrid = toArray str(round _lazPosX); while {count _xGrid < 5} do { _xGrid = [48] + _xGrid; @@ -45,7 +45,7 @@ _xGrid resize 4; _xGrid = toString _xGrid; _xGrid = parseNumber _xGrid; -private _yGrid = toArray Str(round _lazPosY); +private _yGrid = toArray str(round _lazPosY); while {count _yGrid < 5} do { _yGrid = [48] + _yGrid; }; @@ -54,17 +54,17 @@ _yGrid = toString _yGrid; _yGrid = parseNumber _yGrid; private _xCoord = switch true do { - case (_xGrid >= 1000): { "" + Str(_xGrid) }; - case (_xGrid >= 100): { "0" + Str(_xGrid) }; - case (_xGrid >= 10): { "00" + Str(_xGrid) }; - default { "000" + Str(_xGrid) }; + case (_xGrid >= 1000): { "" + str(_xGrid) }; + case (_xGrid >= 100): { "0" + str(_xGrid) }; + case (_xGrid >= 10): { "00" + str(_xGrid) }; + default { "000" + str(_xGrid) }; }; private _yCoord = switch true do { - case (_yGrid >= 1000): { "" + Str(_yGrid) }; - case (_yGrid >= 100): { "0" + Str(_yGrid) }; - case (_yGrid >= 10): { "00" + Str(_yGrid) }; - default { "000" + Str(_yGrid) }; + case (_yGrid >= 1000): { "" + str(_yGrid) }; + case (_yGrid >= 100): { "0" + str(_yGrid) }; + case (_yGrid >= 10): { "00" + str(_yGrid) }; + default { "000" + str(_yGrid) }; }; private _dagrGrid = _xCoord + " " + _yCoord; @@ -74,7 +74,7 @@ private _elevation = floor ((_lazPosZ) + EGVAR(common,mapAltitude)); private _dagrElevation = str _elevation + "m"; // Time -private _dagrTime = [daytime, "HH:MM"] call bis_fnc_timeToString; +private _dagrTime = [dayTime, "HH:MM"] call bis_fnc_timeToString; // Bearing private _bearing = GVAR(LAZHEADING); diff --git a/addons/dagr/functions/fnc_outputWP.sqf b/addons/dagr/functions/fnc_outputWP.sqf index 27944f0bb91..bf25118c9ea 100644 --- a/addons/dagr/functions/fnc_outputWP.sqf +++ b/addons/dagr/functions/fnc_outputWP.sqf @@ -17,7 +17,7 @@ 135471 cutRsc ["DAGR_DISPLAY", "plain down"]; -#define __display (uiNameSpace getVariable "DAGR_DISPLAY") +#define __display (uiNamespace getVariable "DAGR_DISPLAY") #define __gridControl (__display displayCtrl 266851) #define __speedControl (__display displayCtrl 266858) @@ -47,18 +47,18 @@ GVAR(outputPFH) = [{ private _xGrid2 = floor (DAGR_WP_INFO / 10000); private _yGrid2 = DAGR_WP_INFO - _xGrid2 * 10000; - _xCoord2 = switch true do { - case (_xGrid2 >= 1000): { "" + Str(_xGrid2) }; - case (_xGrid2 >= 100): { "0" + Str(_xGrid2) }; - case (_xGrid2 >= 10): { "00" + Str(_xGrid2) }; - default { "000" + Str(_xGrid2) }; + private _xCoord2 = switch true do { + case (_xGrid2 >= 1000): { "" + str(_xGrid2) }; + case (_xGrid2 >= 100): { "0" + str(_xGrid2) }; + case (_xGrid2 >= 10): { "00" + str(_xGrid2) }; + default { "000" + str(_xGrid2) }; }; - _yCoord2 = switch true do { - case (_yGrid2 >= 1000): { "" + Str(_yGrid2) }; - case (_yGrid2 >= 100): { "0" + Str(_yGrid2) }; - case (_yGrid2 >= 10): { "00" + Str(_yGrid2) }; - default { "000" + Str(_yGrid2) }; + private _yCoord2 = switch true do { + case (_yGrid2 >= 1000): { "" + str(_yGrid2) }; + case (_yGrid2 >= 100): { "0" + str(_yGrid2) }; + case (_yGrid2 >= 10): { "00" + str(_yGrid2) }; + default { "000" + str(_yGrid2) }; }; _dagrGrid2 = _xCoord2 + " " + _yCoord2; diff --git a/addons/dagr/stringtable.xml b/addons/dagr/stringtable.xml index 32510520021..621440ffbac 100644 --- a/addons/dagr/stringtable.xml +++ b/addons/dagr/stringtable.xml @@ -59,7 +59,7 @@ <Czech>Defense Advanced GPS Receiver</Czech> <Italian>Defense Advanced GPS Receiver</Italian> <French>Defense Advanced GPS Receiver</French> - <Japanese>国防のための高度なGPS受信機 (Defense Advanced GPS Receiver)</Japanese> + <Japanese>国防のための高機能なGPS受信機 (Defense Advanced GPS Receiver)</Japanese> <Korean>국방 고급위성항법시스템 수신기</Korean> <Chinese>軍用高級防禦GPS接收器</Chinese> <Chinesesimp>军用高级防御 GPS 接收器</Chinesesimp> diff --git a/addons/disarming/functions/fnc_disarmDropItems.sqf b/addons/disarming/functions/fnc_disarmDropItems.sqf index 6e842e739a4..c95647b82ab 100644 --- a/addons/disarming/functions/fnc_disarmDropItems.sqf +++ b/addons/disarming/functions/fnc_disarmDropItems.sqf @@ -50,7 +50,7 @@ if (!_doNotDropAmmo) then { if ((_x getVariable [QGVAR(disarmUnit), objNull]) == _target) exitWith { _holder = _x; }; - } forEach ((getpos _target) nearObjects [DISARM_CONTAINER, 3]); + } forEach ((getPos _target) nearObjects [DISARM_CONTAINER, 3]); }; //Create a new weapon holder @@ -101,7 +101,7 @@ if !([_targetMagazinesStart, _targetMagazinesEnd, _holderMagazinesStart, _holder }; //Remove Items, Assigned Items and NVG -private _holderItemsStart = getitemCargo _holder; +private _holderItemsStart = getItemCargo _holder; private _targetItemsStart = (assignedItems _target) + (items _target) - (weapons _target); if ((headgear _target) != "") then {_targetItemsStart pushBack (headgear _target);}; if ((goggles _target) != "") then {_targetItemsStart pushBack (goggles _target);}; @@ -131,7 +131,7 @@ private _addToCrateCount = []; _holder addItemCargoGlobal [(_addToCrateClassnames select _forEachIndex), (_addToCrateCount select _forEachIndex)]; } forEach _addToCrateClassnames; -private _holderItemsEnd = getitemCargo _holder; +private _holderItemsEnd = getItemCargo _holder; private _targetItemsEnd = (assignedItems _target) + (items _target) - (weapons _target); if ((headgear _target) != "") then {_targetItemsEnd pushBack (headgear _target);}; if ((goggles _target) != "") then {_targetItemsEnd pushBack (goggles _target);}; @@ -172,7 +172,7 @@ if (_holderIsEmpty) then { private _needToRemoveWeapon = ({_x in _listOfItemsToRemove} count (weapons _target)) > 0; private _needToRemoveMagazines = ({_x in _listOfItemsToRemove} count (magazines _target)) > 0; - private _needToRemoveBackpack = ((backPack _target) != "") && {(backPack _target) in _listOfItemsToRemove}; + private _needToRemoveBackpack = ((backpack _target) != "") && {(backpack _target) in _listOfItemsToRemove}; private _needToRemoveVest = ((vest _target) != "") && {(vest _target) in _listOfItemsToRemove}; private _needToRemoveUniform = ((uniform _target) != "") && {(uniform _target) in _listOfItemsToRemove}; @@ -192,7 +192,7 @@ if (_holderIsEmpty) then { } forEach (magazines _target); //Drop backpack (Keeps variables for ACRE/TFR) - if (_needToRemoveBackpack) then {_target action ["DropBag", _holder, (backPack _target)];}; + if (_needToRemoveBackpack) then {_target action ["DropBag", _holder, (backpack _target)];}; } else { [_pfID] call CBA_fnc_removePerFrameHandler; diff --git a/addons/disarming/functions/fnc_openDisarmDialog.sqf b/addons/disarming/functions/fnc_openDisarmDialog.sqf index 6cf15f4cad1..0054cc09fde 100644 --- a/addons/disarming/functions/fnc_openDisarmDialog.sqf +++ b/addons/disarming/functions/fnc_openDisarmDialog.sqf @@ -23,7 +23,7 @@ params ["_caller", "_target"]; //Sanity Checks if (_caller != ACE_player) exitWith {ERROR("Player isn't caller?");}; -if !([_player, _target] call FUNC(canPlayerDisarmUnit)) exitWith {ERROR("Can't Disarm Unit");}; +if !([_caller, _target] call FUNC(canPlayerDisarmUnit)) exitWith {ERROR("Can't Disarm Unit");}; if (dialog) then {ERROR("Dialog open when trying to open disarm dialog"); closeDialog 0;}; disableSerialization; @@ -96,7 +96,7 @@ GVAR(disarmTarget) = _target; if ((_x getVariable [QGVAR(disarmUnit), objNull]) == _target) exitWith { _holder = _x; }; - } forEach ((getpos _target) nearObjects [DISARM_CONTAINER, 3]); + } forEach ((getPos _target) nearObjects [DISARM_CONTAINER, 3]); //If a holder exists, show it's inventory if (!isNull _holder) then { diff --git a/addons/disarming/gui_disarm.hpp b/addons/disarming/gui_disarm.hpp index 4c8ce53e6c0..b6afa26551d 100644 --- a/addons/disarming/gui_disarm.hpp +++ b/addons/disarming/gui_disarm.hpp @@ -7,13 +7,13 @@ class RscActiveText; class RscListBox; //Use the definese from -#define X_BIS(num) (num * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)) -#define Y_BIS(num) (num * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)) -#define W_BIS(num) (num * (((safezoneW / safezoneH) min 1.2) / 40)) -#define H_BIS(num) (num * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)) +#define X_BIS(num) (num * (((safeZoneW / safeZoneH) min 1.2) / 40) + (safeZoneX + (safeZoneW - ((safeZoneW / safeZoneH) min 1.2))/2)) +#define Y_BIS(num) (num * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)) +#define W_BIS(num) (num * (((safeZoneW / safeZoneH) min 1.2) / 40)) +#define H_BIS(num) (num * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)) -#define X_MAKEITBIGGA(num) (num * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)) -#define Y_MAKEITBIGGA(num) (num * (safeZoneH / 30) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)) +#define X_MAKEITBIGGA(num) (num * (safeZoneH / 40) + (safeZoneX + (safeZoneW - safeZoneH)/2)) +#define Y_MAKEITBIGGA(num) (num * (safeZoneH / 30) + (safeZoneY + (safeZoneH - (safeZoneH / 1.2))/2)) #define W_MAKEITBIGGA(num) (num * (safeZoneH / 40)) #define H_MAKEITBIGGA(num) (num * (safeZoneH / 30)) @@ -140,9 +140,9 @@ class GVAR(remoteInventory) { }; class GroundContainer: RscListBox { idc = 632; - sizeEx = "0.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - sizeEx2 = "0.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - rowHeight = "1.75 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + sizeEx = "0.8 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; + sizeEx2 = "0.8 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; + rowHeight = "1.75 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; canDrag = 0; colorText[] = {1,1,1,1}; colorBackground[] = {0,0,0,0}; diff --git a/addons/dogtags/CfgEventHandlers.hpp b/addons/dogtags/CfgEventHandlers.hpp index 2a3f71f852d..f6503c2479b 100644 --- a/addons/dogtags/CfgEventHandlers.hpp +++ b/addons/dogtags/CfgEventHandlers.hpp @@ -3,11 +3,13 @@ class Extended_PreStart_EventHandlers { init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); }; }; + class Extended_PreInit_EventHandlers { class ADDON { init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); }; }; + class Extended_PostInit_EventHandlers { class ADDON { init = QUOTE(call COMPILE_SCRIPT(XEH_postInit)); diff --git a/addons/dogtags/CfgVehicles.hpp b/addons/dogtags/CfgVehicles.hpp index cc564106998..56be52b53e2 100644 --- a/addons/dogtags/CfgVehicles.hpp +++ b/addons/dogtags/CfgVehicles.hpp @@ -4,7 +4,7 @@ class CfgVehicles { class ACE_Actions { class ACE_Dogtag { displayName = CSTRING(itemName); - condition = QUOTE([ARR_2(_player,_target)] call FUNC(canTakeDogtag)); + condition = QUOTE([ARR_2(_player,_target)] call FUNC(canCheckDogtag)); statement = ""; exceptions[] = {"isNotSwimming", "isNotInside"}; showDisabled = 0; diff --git a/addons/dogtags/CfgWeapons.hpp b/addons/dogtags/CfgWeapons.hpp index 0f795d8d08d..ac73ee68f74 100644 --- a/addons/dogtags/CfgWeapons.hpp +++ b/addons/dogtags/CfgWeapons.hpp @@ -16,8 +16,8 @@ class CfgWeapons { author = ECSTRING(common,ACETeam); scope = 0; displayName = CSTRING(itemName); - model = QUOTE(PATHTOF(data\ace_dogtag.p3d)); - picture = QUOTE(PATHTOF(data\dogtagSingle.paa)); + model = QPATHTOF(data\ace_dogtag.p3d); + picture = QPATHTOF(data\dogtagSingle.paa); class ItemInfo: CBA_MiscItem_ItemInfo { mass = 0; //too small to for 1 ? }; diff --git a/addons/dogtags/XEH_PREP.hpp b/addons/dogtags/XEH_PREP.hpp index a34a04a982a..9ff33a26a2a 100644 --- a/addons/dogtags/XEH_PREP.hpp +++ b/addons/dogtags/XEH_PREP.hpp @@ -1,13 +1,11 @@ - PREP(addDogtagActions); -PREP(addDogtagItem); PREP(bloodType); PREP(canCheckDogtag); PREP(canTakeDogtag); PREP(checkDogtag); +PREP(disableFactionDogtags); PREP(getDogtagData); PREP(getDogtagItem); PREP(showDogtag); PREP(ssn); PREP(takeDogtag); -PREP(disableFactionDogtags); diff --git a/addons/dogtags/XEH_postInit.sqf b/addons/dogtags/XEH_postInit.sqf index 6e676671ae0..ab4daf6e29e 100644 --- a/addons/dogtags/XEH_postInit.sqf +++ b/addons/dogtags/XEH_postInit.sqf @@ -1,12 +1,20 @@ #include "script_component.hpp" -[QGVAR(showDogtag), LINKFUNC(showDogtag)] call CBA_fnc_addEventHandler; -[QGVAR(getDogtagItem), LINKFUNC(getDogtagItem)] call CBA_fnc_addEventHandler; -[QGVAR(addDogtagItem), LINKFUNC(addDogtagItem)] call CBA_fnc_addEventHandler; - if (hasInterface || isServer) then { [QGVAR(broadcastDogtagInfo), { GVAR(dogtagsData) set _this; + + if (isNil "CBA_fnc_renameInventoryItem") exitWith {}; // requires https://github.com/CBATeam/CBA_A3/pull/1329 + params ["_item", "_dogTagData"]; + private _name = _dogtagData param [0, ""]; + + // If data doesn't exist or body has no name, set name as "unknown" + if (_name == "") then { + _name = LELSTRING(common,unknown); + }; + + _name = [LLSTRING(itemName), ": ", _name] joinString ""; + [_item, _name] call CBA_fnc_renameInventoryItem; }] call CBA_fnc_addEventHandler; if (isServer) then { @@ -18,23 +26,75 @@ if (hasInterface || isServer) then { [QGVAR(broadcastDogtagInfo), [_x, _y], _clientOwner] call CBA_fnc_ownerEvent; } forEach GVAR(dogtagsData); }] call CBA_fnc_addEventHandler; + + [QGVAR(getDogtagItem), LINKFUNC(getDogtagItem)] call CBA_fnc_addEventHandler; } else { // To be here, hasInterface must be true [QGVAR(requestSyncDogtagDataJIP), clientOwner] call CBA_fnc_serverEvent; }; }; +if (hasInterface) then { + // If the arsenal is loaded, show the custom names for dog tags when in the arsenal + if (["ace_arsenal"] call EFUNC(common,isModLoaded)) then { + [QEGVAR(arsenal,rightPanelFilled), { + params ["_display", "_leftPanelIDC", "_rightPanelIDC"]; + + if !(_leftPanelIDC in [2010, 2012, 2014] && {_rightPanelIDC == 38}) exitWith {}; + + private _rightPanel = _display displayCtrl 15; + private _cfgWeapons = configFile >> "CfgWeapons"; + + TRACE_1("passed",_rightPanel); + + for "_i" from 0 to (lnbSize _rightPanel select 0) - 1 do { + private _item = _rightPanel lnbData [_i, 0]; + + if (_item isKindOf ["ACE_dogtag", _cfgWeapons]) then { + private _name = (GVAR(dogtagsData) getOrDefault [_item, []]) param [0, ""]; + + // If data doesn't exist or body has no name, set name as "unknown" + if (_name == "") then { + _name = LELSTRING(common,unknown); + }; + + _rightPanel lnbSetText [[_i, 1], [LLSTRING(itemName), ": ", _name] joinString ""]; + }; + }; + }] call CBA_fnc_addEventHandler; + }; + + // Add context menu option + [ + "ACE_dogtag", + ["GROUND", "CARGO", "CONTAINER"], + LLSTRING(checkItem), + nil, + QPATHTOF(data\dogtag_icon_ca.paa), + [ + {true}, + {true} + ], + { + [GVAR(dogtagsData) getOrDefault [_this select 2, []]] call FUNC(showDogtag); + + false + } + ] call CBA_fnc_addItemContextMenuOption; +}; + // Add actions and event handlers only if ace_medical is enabled // - Adding actions via config would create a dependency ["CBA_settingsInitialized", { if !(GETEGVAR(medical,enabled,false)) exitWith {}; if (hasInterface) then { + //IGNORE_PRIVATE_WARNING ["_target", "_player"]; private _checkTagAction = [ "ACE_CheckDogtag", - format ["%1: %2", localize LSTRING(itemName), localize LSTRING(checkDogtag)], + format ["%1: %2", LLSTRING(itemName), LLSTRING(checkDogtag)], QPATHTOF(data\dogtag_icon_ca.paa), - {[_player,_target] call FUNC(checkDogtag)}, + {[_player, _target] call FUNC(checkDogtag)}, {!isNil {_target getVariable QGVAR(dogtagData)}} ] call EFUNC(interact_menu,createAction); @@ -42,9 +102,9 @@ if (hasInterface || isServer) then { private _takeTagAction = [ "ACE_TakeDogtag", - format ["%1: %2", localize LSTRING(itemName), localize LSTRING(takeDogtag)], + format ["%1: %2", LLSTRING(itemName), LLSTRING(takeDogtag)], QPATHTOF(data\dogtag_icon_ca.paa), - {[_player,_target] call FUNC(takeDogtag)}, + {[_player, _target] call FUNC(takeDogtag)}, {(!isNil {_target getVariable QGVAR(dogtagData)}) && {((_target getVariable [QGVAR(dogtagTaken), objNull]) != _target)}} ] call EFUNC(interact_menu,createAction); @@ -54,11 +114,12 @@ if (hasInterface || isServer) then { if (isServer) then { ["ace_placedInBodyBag", { params ["_target", "_bodyBag", "_isGrave"]; + if (_isGrave) exitWith {}; TRACE_2("ace_placedInBodyBag eh",_target,_bodyBag); - private _dogTagData = [_target] call FUNC(getDogtagData); - _bodyBag setVariable [QGVAR(dogtagData), _dogTagData, true]; + private _dogtagData = _target call FUNC(getDogtagData); + _bodyBag setVariable [QGVAR(dogtagData), _dogtagData, true]; if ((_target getVariable [QGVAR(dogtagTaken), objNull]) == _target) then { _bodyBag setVariable [QGVAR(dogtagTaken), _bodyBag, true]; @@ -67,53 +128,5 @@ if (hasInterface || isServer) then { }; }] call CBA_fnc_addEventHandler; -// If the arsenal is loaded, show the custom names for dog tags when in the arsenal -if (["ace_arsenal"] call EFUNC(common,isModLoaded)) then { - [QEGVAR(arsenal,rightPanelFilled), { - params ["_display", "_leftPanelIDC", "_rightPanelIDC"]; - - if (_leftPanelIDC in [2010, 2012, 2014] && {_rightPanelIDC == 38}) then { - LOG("passed"); - private _rightPanel = _display displayCtrl 15; - private _cfgWeapons = configFile >> "CfgWeapons"; - private _item = ""; - private _dogtagData = []; - - for "_i" from 0 to (lnbSize _rightPanel select 0) - 1 do { - _item = _rightPanel lnbData [_i, 0]; - - if (_item isKindOf ["ACE_dogtag", _cfgWeapons]) then { - private _name = (GVAR(dogtagsData) getOrDefault [_item, []]) param [0, ""]; - - // If data doesn't exist or body has no name, set name as "unknown" - if (_name == "") then { - _name = LELSTRING(common,unknown); - }; - - _rightPanel lnbSetText [[_i, 1], [LLSTRING(itemName), ": ", _name] joinString ""]; - }; - }; - }; - }] call CBA_fnc_addEventHandler; -}; - -// Add context menu option -[ - "ACE_dogtag", - ["GROUND", "CARGO", "CONTAINER"], - LLSTRING(checkItem), - nil, - QPATHTOF(data\dogtag_icon_ca.paa), - [ - {true}, - {true} - ], - { - [GVAR(dogtagsData) getOrDefault [_this select 2, []]] call FUNC(showDogtag); - - false - } -] call CBA_fnc_addItemContextMenuOption; - -// Disable dogtags for civilians +// Disable dog tags for civilians "CIV_F" call FUNC(disableFactionDogtags); diff --git a/addons/dogtags/functions/fnc_addDogtagActions.sqf b/addons/dogtags/functions/fnc_addDogtagActions.sqf index b41cce1be84..310cbc3f340 100644 --- a/addons/dogtags/functions/fnc_addDogtagActions.sqf +++ b/addons/dogtags/functions/fnc_addDogtagActions.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: SzwedzikPL, mharis001 - * Returns children actions for checking dogtags in player's inventory. + * Returns children actions for checking dog tags in the player's inventory. * * Arguments: * 0: Player <OBJECT> @@ -10,7 +10,7 @@ * Actions <ARRAY> * * Example: - * [_player] call ace_dogtags_fnc_addDogtagActions + * player call ace_dogtags_fnc_addDogtagActions * * Public: No */ @@ -18,19 +18,27 @@ params ["_player"]; private _fnc_getActions = { + //IGNORE_PRIVATE_WARNING ["_player"]; private _actions = []; private _cfgWeapons = configFile >> "CfgWeapons"; { private _config = _cfgWeapons >> _x; - if (getNumber (_config >> QGVAR(tagID)) > 0) then { - private _displayName = getText (_config >> "displayName"); - private _picture = getText (_config >> "picture"); - private _action = [_x, _displayName, _picture, { - [GVAR(dogtagsData) getOrDefault [_this select 2, []]] call FUNC(showDogtag); - }, {true}, {}, _x] call EFUNC(interact_menu,createAction); - _actions pushBack [_action, [], _player]; + if (getNumber (_config >> QGVAR(tagID)) > 0) then { + _actions pushBack [ + [ + _x, + getText (_config >> "displayName"), + getText (_config >> "picture"), + {[GVAR(dogtagsData) getOrDefault [_this select 2, []]] call FUNC(showDogtag)}, + {true}, + {}, + _x + ] call EFUNC(interact_menu,createAction), + [], + _player + ]; }; } forEach (_player call EFUNC(common,uniqueItems)); diff --git a/addons/dogtags/functions/fnc_addDogtagItem.sqf b/addons/dogtags/functions/fnc_addDogtagItem.sqf deleted file mode 100644 index 6979299db33..00000000000 --- a/addons/dogtags/functions/fnc_addDogtagItem.sqf +++ /dev/null @@ -1,38 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: SzwedzikPL - * Adds dogtag item to unit (triggered by server). - * - * Arguments: - * 0: Item class <STRING> - * 1: Dogtag data <ARRAY> - * - * Return Value: - * None - * - * Example: - * ["itemClass", ["name", "610-27-5955", "A POS"]] call ace_dogtags_fnc_addDogtagItem - * - * Public: No - */ - -params ["_item", "_dogtagData"]; - -if (_item == "") exitWith {}; - -// Verify that the unit has inventory space, otherwise drop the dogtag on the ground -[ace_player, _item, true] call CBA_fnc_addItem; - -_dogtagData params ["_name"]; - -// If data doesn't exist or body has no name, set name as "unknown" -if (_name == "") then { - _name = LELSTRING(common,unknown); -}; - -private _displayText = format [localize LSTRING(takeDogtagSuccess), _name]; - -// display message -[{ - [_this, 2.5] call EFUNC(common,displayTextStructured); -}, _displayText, DOGTAG_SHOW_DELAY] call CBA_fnc_waitAndExecute; diff --git a/addons/dogtags/functions/fnc_bloodType.sqf b/addons/dogtags/functions/fnc_bloodType.sqf index 5e03c586fa8..53b60073709 100644 --- a/addons/dogtags/functions/fnc_bloodType.sqf +++ b/addons/dogtags/functions/fnc_bloodType.sqf @@ -1,16 +1,16 @@ #include "..\script_component.hpp" /* * Author: commy2 - * Reports a blood type depending on the units name. + * Reports a blood type depending on the unit's name. * * Arguments: - * 0: Name of a unit <STRING> + * 0: Unit name <STRING> * * Return Value: * A random blood type <STRING> * * Example: - * _bloodType = ["name"] call ace_dogtags_fnc_bloodType + * "name" call ace_dogtags_fnc_bloodType * * Public: No */ diff --git a/addons/dogtags/functions/fnc_canCheckDogtag.sqf b/addons/dogtags/functions/fnc_canCheckDogtag.sqf index 98d437cbac6..a5ed987fc0f 100644 --- a/addons/dogtags/functions/fnc_canCheckDogtag.sqf +++ b/addons/dogtags/functions/fnc_canCheckDogtag.sqf @@ -1,26 +1,26 @@ #include "..\script_component.hpp" /* * Author: SzwedzikPL - * Checks if dogtag can be checked. + * Checks if the target's dog tag can be checked by the unit. * * Arguments: - * 0: Player <OBJECT> + * 0: Player (not used) <OBJECT> * 1: Target <OBJECT> * * Return Value: - * True if dogtag can be checked <BOOL> + * If dog tag can be checked <BOOL> * * Example: - * _canCheck = [player, unit] call ace_dogtags_fnc_canCheckDogtag + * [player, cursorObject] call ace_dogtags_fnc_canCheckDogtag * * Public: No */ -params ["_player", "_target"]; +params ["", "_target"]; if (isNull _target) exitWith {false}; -// check if disabled for faction +// Check if disabled for faction if ((faction _target) in GVAR(disabledFactions)) exitWith {false}; !(_target call EFUNC(common,isAwake)) diff --git a/addons/dogtags/functions/fnc_canTakeDogtag.sqf b/addons/dogtags/functions/fnc_canTakeDogtag.sqf index 5f0a6d1afe5..c56db0b8933 100644 --- a/addons/dogtags/functions/fnc_canTakeDogtag.sqf +++ b/addons/dogtags/functions/fnc_canTakeDogtag.sqf @@ -1,17 +1,17 @@ #include "..\script_component.hpp" /* * Author: SzwedzikPL - * Checks if dogtag can be taken. + * Checks if the target's dog tag can be taken by the unit. * * Arguments: * 0: Player <OBJECT> * 1: Target <OBJECT> * * Return Value: - * True if dogtag can be taken <BOOL> + * If dog tag can be taken <BOOL> * * Example: - * _canTake = [player, unit] call ace_dogtags_fnc_canTakeDogtag + * [player, cursorObject] call ace_dogtags_fnc_canTakeDogtag * * Public: No */ @@ -20,7 +20,10 @@ params ["_player", "_target"]; if (isNull _target) exitWith {false}; -// check if disabled for faction +// Check if disabled for faction if ((faction _target) in GVAR(disabledFactions)) exitWith {false}; -!(_target call EFUNC(common,isAwake)) && {_player canAdd ["ACE_dogtag_1", 1/*, true*/]} // Todo: Uncomment in 2.18 +// CBA_fnc_canAddItem doesn't account for mass 0 items and unit not having any containers +!(_target call EFUNC(common,isAwake)) && {(uniform _player + vest _player + backpack _player) != ""} && {[_player, "ACE_dogtag_1"] call CBA_fnc_canAddItem} +// Todo: Use code below in 2.18 +// _player canAdd ["ACE_dogtag_1", 1, true] diff --git a/addons/dogtags/functions/fnc_checkDogtag.sqf b/addons/dogtags/functions/fnc_checkDogtag.sqf index dcceb8c2c0b..4b2f2d533f2 100644 --- a/addons/dogtags/functions/fnc_checkDogtag.sqf +++ b/addons/dogtags/functions/fnc_checkDogtag.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: SzwedzikPL - * Checks unit dogtag. + * Checks the unit's dog tag. * * Arguments: * 0: Player <OBJECT> @@ -11,17 +11,17 @@ * None * * Example: - * [player, unit] call ace_dogtags_fnc_checkDogtag + * [player, cursorObject] call ace_dogtags_fnc_checkDogtag * * Public: No */ params ["_player", "_target"]; -// animation +// Animation _player call EFUNC(common,goKneeling); -// sound +// Sound private _position = _target modelToWorldWorld (_target selectionPosition "neck"); playSound3D [ @@ -34,10 +34,8 @@ playSound3D [ 50 ]; -// display dogtag +// Display dog tag private _doubleTags = (_target getVariable [QGVAR(dogtagTaken), objNull]) != _target; -private _dogTagData = [_target] call FUNC(getDogTagData); +private _dogtagData = _target call FUNC(getDogtagData); -[{ - [QGVAR(showDogtag), _this] call CBA_fnc_localEvent; -}, [_dogTagData, _doubleTags], DOGTAG_SHOW_DELAY] call CBA_fnc_waitAndExecute; +[LINKFUNC(showDogtag), [_dogtagData, _doubleTags], DOGTAG_SHOW_DELAY] call CBA_fnc_waitAndExecute; diff --git a/addons/dogtags/functions/fnc_disableFactionDogtags.sqf b/addons/dogtags/functions/fnc_disableFactionDogtags.sqf index c4642ef4b5d..b1ac145d9a0 100644 --- a/addons/dogtags/functions/fnc_disableFactionDogtags.sqf +++ b/addons/dogtags/functions/fnc_disableFactionDogtags.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: commy2 - * Disable this faction from using dogtags. + * Disables this faction from using dog tags. * * Arguments: * 0: Faction <STRING> diff --git a/addons/dogtags/functions/fnc_getDogtagData.sqf b/addons/dogtags/functions/fnc_getDogtagData.sqf index 6a850543fc2..4aaf930fa21 100644 --- a/addons/dogtags/functions/fnc_getDogtagData.sqf +++ b/addons/dogtags/functions/fnc_getDogtagData.sqf @@ -1,19 +1,19 @@ #include "..\script_component.hpp" /* * Author: esteldunedain - * Get unit dogtag data. + * Gets unit's dog tag data. * * Arguments: * 0: Target <OBJECT> * * Return Value: - * Dogtag Data <ARRAY> + * Dog tag Data <ARRAY> * 0: Name <STRING> * 1: SSN <STRING> * 2: Blood Type <STRING> * * Example: - * _dogtagData = [unit, player] call ace_dogtags_fnc_getDogtagData + * player call ace_dogtags_fnc_getDogtagData * * Public: No */ @@ -21,17 +21,20 @@ params ["_target"]; // Check if the data was already created -private _dogTagData = _target getVariable QGVAR(dogtagData); -if (!isNil "_dogTagData") exitWith {_dogTagData}; +private _dogtagData = _target getVariable QGVAR(dogtagData); + +if (!isNil "_dogtagData") exitWith {_dogtagData}; // Create dog tag data once for the unit: nickname, code (eg. 135-13-900) and blood type private _targetName = [_target, false, true] call EFUNC(common,getName); -private _dogTagData = [ +private _dogtagData = [ _targetName, _targetName call FUNC(ssn), _targetName call FUNC(bloodType) ]; + // Store it -_target setVariable [QGVAR(dogtagData), _dogTagData, true]; -_dogTagData +_target setVariable [QGVAR(dogtagData), _dogtagData, true]; + +_dogtagData diff --git a/addons/dogtags/functions/fnc_getDogtagItem.sqf b/addons/dogtags/functions/fnc_getDogtagItem.sqf index e5f05eb19b2..4f8cc94cc76 100644 --- a/addons/dogtags/functions/fnc_getDogtagItem.sqf +++ b/addons/dogtags/functions/fnc_getDogtagItem.sqf @@ -1,7 +1,8 @@ #include "..\script_component.hpp" /* * Author: SzwedzikPL - * Server: creates new dogtag item and send it to client. + * Server: Creates a new dog tag item and sends it to client. + * It broacasts the dog tag info to all machines with interfaces. * * Arguments: * 0: Player <OBJECT> @@ -11,12 +12,12 @@ * None * * Example: - * [player, unit] call ace_dogtags_fnc_getDogtagItem + * [player, cursorObject] call ace_dogtags_fnc_getDogtagItem * * Public: No */ -if(!isServer) exitWith {}; +if (!isServer) exitWith {}; params ["_player", "_target"]; TRACE_2("getDogtagItem",_player,_target); @@ -28,7 +29,20 @@ if (GVAR(idCounter) > 999) exitWith {ERROR("Ran out of IDs");}; private _dogTagData = [_target] call FUNC(getDogTagData); private _item = format ["ACE_dogtag_%1", GVAR(idCounter)]; -[QGVAR(addDogtagItem), [_item, _dogTagData], [_player]] call CBA_fnc_targetEvent; - // Broadcast data globally, so that clients can use it where needed [QGVAR(broadcastDogtagInfo), [_item, _dogTagData]] call CBA_fnc_globalEvent; + +// Dog tags have no mass, so no need to check if it can fit in container, but check if unit has an inventory at all +[_player, _item, true] call CBA_fnc_addItem; + +private _name = _dogtagData param [0, ""]; + +// If data doesn't exist or body has no name, set name as "unknown" +if (_name == "") then { + _name = LELSTRING(common,unknown); +}; + +// Display message +[{ + [QEGVAR(common,displayTextStructured), [_this select 0, 2.5], _this select 1] call CBA_fnc_targetEvent; +}, [format [LLSTRING(takeDogtagSuccess), _name], _player], DOGTAG_SHOW_DELAY] call CBA_fnc_waitAndExecute; diff --git a/addons/dogtags/functions/fnc_showDogtag.sqf b/addons/dogtags/functions/fnc_showDogtag.sqf index 9e01bfc3cda..5de9a9fc62a 100644 --- a/addons/dogtags/functions/fnc_showDogtag.sqf +++ b/addons/dogtags/functions/fnc_showDogtag.sqf @@ -1,10 +1,10 @@ #include "..\script_component.hpp" /* * Author: SzwedzikPL - * Shows dogtag. + * Shows dog tag. * * Arguments: - * 0: Dogtag data <ARRAY> + * 0: Dog tag data <ARRAY> * 1: Display as double tag <BOOLEAN> * * Return Value: @@ -27,8 +27,10 @@ if (_doubleTags) then { } else { (QGVAR(tag) call BIS_fnc_rscLayer) cutRsc [QGVAR(singleTag), "PLAIN", 1, true]; }; -private _display = uiNamespace getvariable [QGVAR(tag), displayNull]; -if(isNull _display) exitWith {}; + +private _display = uiNamespace getVariable [QGVAR(tag), displayNull]; + +if (isNull _display) exitWith {}; private _control = _display displayCtrl 1001; _dogtagData params ["_name", "_code", "_bloodType"]; diff --git a/addons/dogtags/functions/fnc_ssn.sqf b/addons/dogtags/functions/fnc_ssn.sqf index 0ba3499c0b0..794422ddd11 100644 --- a/addons/dogtags/functions/fnc_ssn.sqf +++ b/addons/dogtags/functions/fnc_ssn.sqf @@ -1,16 +1,16 @@ #include "..\script_component.hpp" /* * Author: kymckay - * Reports a social security number generated from the units name. + * Reports a social security number generated from the unit's name. * * Arguments: - * 0: Name of a unit <STRING> + * 0: Unit name <STRING> * * Return Value: * A random three/two/four format social security number <STRING> * * Example: - * _ssn = ["AAA"] call ace_dogtags_fnc_ssn + * "name" call ace_dogtags_fnc_ssn * * Public: No */ @@ -18,19 +18,20 @@ params ["_name"]; private _chars = toArray _name; -private _length = count _chars; + // Warning, for strings containing non-latin characters, `_count _name` != `_count _chars` +private _length = count _chars; _chars pushBack _length; _length = _length + 1; private _remainder = 0; -private _nums = [0,0,0,0,0,0,0,0,0]; +private _nums = [0, 0, 0, 0, 0, 0, 0, 0, 0]; for "_index" from 0 to (8 max _length) do { private _inputChar = _chars select (_index % _length); - _nums set [(_index % 9), ((_nums select (_index % 9)) + _inputChar + _remainder) % 10]; + _nums set [_index % 9, ((_nums select (_index % 9)) + _inputChar + _remainder) % 10]; _remainder = (_inputChar + _remainder) % 256; }; -([_nums select [0,3],_nums select [3,2], _nums select [5,4]] apply { _x joinString "" }) joinString "-" +([_nums select [0, 3], _nums select [3, 2], _nums select [5, 4]] apply { _x joinString "" }) joinString "-" diff --git a/addons/dogtags/functions/fnc_takeDogtag.sqf b/addons/dogtags/functions/fnc_takeDogtag.sqf index 1972c91ee09..b374c271219 100644 --- a/addons/dogtags/functions/fnc_takeDogtag.sqf +++ b/addons/dogtags/functions/fnc_takeDogtag.sqf @@ -1,8 +1,8 @@ #include "..\script_component.hpp" /* * Author: SzwedzikPL - * If dogtag is not already taken triggers event on server. - * If dogtag already taken displays info about it. + * If the dog tag hasn't already been taken, it triggers an event on the server. + * If the dog tag has already been taken, it displays info about it. * * Arguments: * 0: Player <OBJECT> @@ -12,17 +12,17 @@ * None * * Example: - * [player, unit] call ace_dogtags_fnc_takeDogtag + * [player, cursorObject] call ace_dogtags_fnc_takeDogtag * * Public: No */ params ["_player", "_target"]; -// animation +// Animation _player call EFUNC(common,goKneeling); -// sound +// Sound private _position = _target modelToWorldWorld (_target selectionPosition "neck"); playSound3D [ @@ -35,12 +35,11 @@ playSound3D [ 50 ]; -// display message +// Display message if ((_target getVariable [QGVAR(dogtagTaken), objNull]) == _target) then { - [{ - [_this, 2.5] call EFUNC(common,displayTextStructured); - }, localize LSTRING(dogtagAlreadyTaken), DOGTAG_SHOW_DELAY] call CBA_fnc_waitAndExecute; + [EFUNC(common,displayTextStructured), [LLSTRING(dogtagAlreadyTaken), 2.5], DOGTAG_SHOW_DELAY] call CBA_fnc_waitAndExecute; } else { _target setVariable [QGVAR(dogtagTaken), _target, true]; + [QGVAR(getDogtagItem), [_player, _target]] call CBA_fnc_serverEvent; }; diff --git a/addons/dogtags/stringtable.xml b/addons/dogtags/stringtable.xml index 73d2d07e56b..ff0af0db4e9 100644 --- a/addons/dogtags/stringtable.xml +++ b/addons/dogtags/stringtable.xml @@ -13,7 +13,7 @@ <Italian>Piastrina</Italian> <Chinese>兵籍牌</Chinese> <Chinesesimp>兵籍牌</Chinesesimp> - <Portuguese>Dog Tag</Portuguese> + <Portuguese>Chapa de Identificação</Portuguese> <Spanish>Placa de identidad</Spanish> <Turkish>Künye</Turkish> </Key> @@ -29,7 +29,7 @@ <Italian>Controlla Piastrina</Italian> <Chinese>檢查兵籍牌</Chinese> <Chinesesimp>检查兵籍牌</Chinesesimp> - <Portuguese>Verificar Dog Tag</Portuguese> + <Portuguese>Verificar chapa de identificação</Portuguese> <Spanish>Verificar placa de identidad</Spanish> <Turkish>Künyeyi Kontrol Et</Turkish> </Key> @@ -77,7 +77,7 @@ <Italian>Piastrina presa da %1...</Italian> <Chinese>從%1身上拿取兵籍牌...</Chinese> <Chinesesimp>从%1身上拿取兵籍牌...</Chinesesimp> - <Portuguese>Dogtag pego de %1...</Portuguese> + <Portuguese>Chapa de identificação pega de %1...</Portuguese> <Spanish>Tomada placa de identidad de %1...</Spanish> <Turkish>Künye %1 kişisinden alındı</Turkish> </Key> @@ -93,7 +93,7 @@ <Italian>Qualcun altro ha già preso la piastrina...</Italian> <Chinese>已經有人把他的兵籍牌拿走了...</Chinese> <Chinesesimp>已经有人把他的兵籍牌拿走了...</Chinesesimp> - <Portuguese>Alguém já pegou essa dogtag...</Portuguese> + <Portuguese>Alguém já pegou essa chapa de identificação...</Portuguese> <Spanish>Alguien más ha tomado la placa de identidad</Spanish> <Turkish>Başka biri zaten künyeyi almış</Turkish> </Key> @@ -106,7 +106,7 @@ <Italian>Indicatore su schermo per il controllo delle piastrine</Italian> <Polish>Wyświetlacz ekranowy dla sprawdzania nieśmiertelników</Polish> <Russian>Экран для проверки жетонов</Russian> - <Portuguese>Tela de Exibição para verificar dogtags</Portuguese> + <Portuguese>Tela de exibição para verificar chapas de identificação</Portuguese> <Spanish>Visualización en pantalla de placa de identidad</Spanish> <French>Affichage à l'écran pour le contrôle des plaques.</French> <Czech>Okno na obrazovce pro kontrolu známek</Czech> diff --git a/addons/dragging/CfgVehicles.hpp b/addons/dragging/CfgVehicles.hpp index 395133e9464..bd9758447bf 100644 --- a/addons/dragging/CfgVehicles.hpp +++ b/addons/dragging/CfgVehicles.hpp @@ -3,6 +3,9 @@ class CBA_Extended_EventHandlers; class CfgVehicles { + class C_man_1; + class GVAR(clone): C_man_1 {}; + // Static weapons class LandVehicle; class StaticWeapon: LandVehicle { diff --git a/addons/dragging/XEH_PREP.hpp b/addons/dragging/XEH_PREP.hpp index 0861c9533d2..aeba3135ab5 100644 --- a/addons/dragging/XEH_PREP.hpp +++ b/addons/dragging/XEH_PREP.hpp @@ -5,6 +5,8 @@ PREP(canDrop_carry); PREP(canRun_carry); PREP(carryObject); PREP(carryObjectPFH); +PREP(createClone); +PREP(deleteClone); PREP(dragObject); PREP(dragObjectPFH); PREP(dropObject); diff --git a/addons/dragging/XEH_postInit.sqf b/addons/dragging/XEH_postInit.sqf index ae277bf4d24..48655c5833a 100644 --- a/addons/dragging/XEH_postInit.sqf +++ b/addons/dragging/XEH_postInit.sqf @@ -1,9 +1,62 @@ // by PabstMirror, commy2 #include "script_component.hpp" +[QGVAR(moveCorpse), { + params ["_corpse", "_dir", "_posATL"]; + + if (isNull _corpse) exitWith {}; + + // Check if the corpse is already close to the target + // If so, don't teleport + if ((getPosATL _corpse) distance _posATL > 0.25) then { + // Set direction before position + _corpse setDir _dir; + + // Bring corpse back to clone's position + _corpse setPosATL _posATL; + }; + + // Sync the corpse with its position + [{ + _this awake true; + + [{ + _this awake false; + }, _this] call CBA_fnc_execNextFrame; + }, _corpse] call CBA_fnc_execNextFrame; + + // Allow the corpse to be synced for JIP players + if (isServer) exitWith { + GVAR(movedCorpses) pushBackUnique _corpse; + }; +}] call CBA_fnc_addEventHandler; + if (isServer) then { // Release object on disconnection. Function is identical to killed addMissionEventHandler ["HandleDisconnect", LINKFUNC(handleKilled)]; + + GVAR(movedCorpses) = []; + + ["CAManBase", "Deleted", { + GVAR(movedCorpses) deleteAt (GVAR(movedCorpses) find (_this select 0)); + }, true, [], true] call CBA_fnc_addClassEventHandler; + + [QGVAR(disableSyncMovedCorpseOnJIP), { + params ["_corpse"]; + + GVAR(movedCorpses) deleteAt (GVAR(movedCorpses) find _corpse); + }] call CBA_fnc_addEventHandler; + + // Sync position of dead corpse for JIP unit (prevents weird invisible hitboxes on corpses) + [QGVAR(requestSyncMovedCorpsesJIP), { + params ["_clientOwner"]; + + { + [QGVAR(moveCorpse), [_x, getDir _x, getPosATL _x], _clientOwner] call CBA_fnc_ownerEvent; + } forEach GVAR(movedCorpses); + }] call CBA_fnc_addEventHandler; +} else { + [QGVAR(requestSyncMovedCorpsesJIP), clientOwner] call CBA_fnc_serverEvent; }; if (!hasInterface) exitWith {}; @@ -20,6 +73,11 @@ if (isNil QGVAR(maxWeightCarryRun)) then { GVAR(maxWeightCarryRun) = 50; }; +// Extended EH doesn't fire for dead units, so add interactions manually +{ + _x call FUNC(initPerson); +} forEach allDeadMen; + ["isNotDragging", {!((_this select 0) getVariable [QGVAR(isDragging), false])}] call EFUNC(common,addCanInteractWithCondition); ["isNotCarrying", {!((_this select 0) getVariable [QGVAR(isCarrying), false])}] call EFUNC(common,addCanInteractWithCondition); @@ -57,6 +115,14 @@ if (isNil QGVAR(maxWeightCarryRun)) then { // Display event handler ["MouseZChanged", {(_this select 1) call FUNC(handleScrollWheel)}] call CBA_fnc_addDisplayHandler; +// Handle local effect commands for clones +[QGVAR(setCloneFace), { + params ["_clone", "_corpse"]; + + _clone setFace face _corpse; + _clone setMimic "unconscious"; +}] call CBA_fnc_addEventHandler; + // Handle surrendering and handcuffing ["ace_captiveStatusChanged", { params ["_unit", "_state"]; @@ -70,6 +136,9 @@ if (isNil QGVAR(maxWeightCarryRun)) then { [QGVAR(startCarry), LINKFUNC(startCarryLocal)] call CBA_fnc_addEventHandler; [QGVAR(startDrag), LINKFUNC(startDragLocal)] call CBA_fnc_addEventHandler; +[QGVAR(setCarryable), LINKFUNC(setCarryable)] call CBA_fnc_addEventHandler; +[QGVAR(setDraggable), LINKFUNC(setDraggable)] call CBA_fnc_addEventHandler; + [QGVAR(carryingContainerClosed), { params ["_container", "_owner"]; TRACE_2("carryingContainerClosed EH",_container,_owner); diff --git a/addons/dragging/functions/fnc_canCarry.sqf b/addons/dragging/functions/fnc_canCarry.sqf index be3015868b5..a38f37a02ee 100644 --- a/addons/dragging/functions/fnc_canCarry.sqf +++ b/addons/dragging/functions/fnc_canCarry.sqf @@ -18,7 +18,10 @@ params ["_unit", "_target"]; -if !(alive _target && {_target getVariable [QGVAR(canCarry), false]} && {isNull objectParent _target}) exitWith {false}; +private _alive = alive _target; +private _isPerson = _target isKindOf "CAManBase"; + +if !((_alive || _isPerson) && {_target getVariable [QGVAR(canCarry), false]} && {isNull objectParent _target}) exitWith {false}; if !([_unit, _target, []] call EFUNC(common,canInteractWith)) exitWith {false}; @@ -26,18 +29,19 @@ if !([_unit, _target, []] call EFUNC(common,canInteractWith)) exitWith {false}; // The fireman carry animation does not slow down for injured legs, so you could carry and run if ((_unit getHitPointDamage "HitLegs") >= 0.5) exitWith {false}; +// Units need to be unconscious or limping; Units also need to not be in ragdoll if alive, as that causes desync issues +if (_isPerson) exitWith { + ((!_alive) && {missionNamespace getVariable [QGVAR(canMoveDead), true]}) || + {(isAwake _target) && // not ragdolled if alive + {!(_target call EFUNC(common,isAwake)) || + {_target getHitPointDamage "HitLegs" >= 0.5}}} +}; + // Static weapons need to be empty for carrying (ignore UAV AI) if (_target isKindOf "StaticWeapon") exitWith { (crew _target) findIf {!unitIsUAV _x} == -1 }; -// Units need to be unconscious or limping; Units also need to not be in ragdoll, as that causes desync issues -if (_target isKindOf "CAManBase") exitWith { - isAwake _target && // not ragdolled - {lifeState _target == "INCAPACITATED" || - {_target getHitPointDamage "HitLegs" >= 0.5}} -}; - // Check max items for WeaponHolders if (["WeaponHolder", "WeaponHolderSimulated"] findIf {_target isKindOf _x} != -1) exitWith { (count (weaponCargo _target + magazineCargo _target + itemCargo _target)) <= MAX_DRAGGED_ITEMS diff --git a/addons/dragging/functions/fnc_canDrag.sqf b/addons/dragging/functions/fnc_canDrag.sqf index 586e23feaf8..2616d6d1447 100644 --- a/addons/dragging/functions/fnc_canDrag.sqf +++ b/addons/dragging/functions/fnc_canDrag.sqf @@ -18,22 +18,26 @@ params ["_unit", "_target"]; -if !(alive _target && {_target getVariable [QGVAR(canDrag), false]} && {isNull objectParent _target}) exitWith {false}; +private _alive = alive _target; +private _isPerson = _target isKindOf "CAManBase"; + +if !((_alive || _isPerson) && {_target getVariable [QGVAR(canDrag), false]} && {isNull objectParent _target}) exitWith {false}; if !([_unit, _target, ["isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; +// Units need to be unconscious or limping; Units also need to not be in ragdoll if alive, as that causes desync issues +if (_isPerson) exitWith { + ((!_alive) && {missionNamespace getVariable [QGVAR(canMoveDead), true]}) || + {(isAwake _target) && // not ragdolled if alive + {!(_target call EFUNC(common,isAwake)) || + {_target getHitPointDamage "HitLegs" >= 0.5}}} +}; + // Static weapons need to be empty for dragging (ignore UAV AI) if (_target isKindOf "StaticWeapon") exitWith { (crew _target) findIf {!unitIsUAV _x} == -1 }; -// Units need to be unconscious or limping; Units also need to not be in ragdoll, as that causes desync issues -if (_target isKindOf "CAManBase") exitWith { - isAwake _target && // not ragdolled - {lifeState _target == "INCAPACITATED" || - {_target getHitPointDamage "HitLegs" >= 0.5}} -}; - // Check max items for WeaponHolders if (["WeaponHolder", "WeaponHolderSimulated"] findIf {_target isKindOf _x} != -1) exitWith { (count (weaponCargo _target + magazineCargo _target + itemCargo _target)) <= MAX_DRAGGED_ITEMS diff --git a/addons/dragging/functions/fnc_carryObject.sqf b/addons/dragging/functions/fnc_carryObject.sqf index 4d5ac8b61b3..d765020f96e 100644 --- a/addons/dragging/functions/fnc_carryObject.sqf +++ b/addons/dragging/functions/fnc_carryObject.sqf @@ -19,6 +19,12 @@ params ["_unit", "_target"]; TRACE_2("params",_unit,_target); +// If in ViV cargo, unload it first +// Warn user if it failed to unload (shouldn't happen) +if (!isNull isVehicleCargo _target && {!(objNull setVehicleCargo _target)}) then { + WARNING_1("ViV Unload Failed %1",_target); +}; + // Get attachTo offset and direction private _position = _target getVariable [QGVAR(carryPosition), [0, 0, 0]]; private _direction = _target getVariable [QGVAR(carryDirection), 0]; @@ -42,9 +48,6 @@ if (_target isKindOf "CAManBase") then { [QEGVAR(common,setDir), [_target, _direction], _target] call CBA_fnc_targetEvent; -_unit setVariable [QGVAR(isCarrying), true, true]; -_unit setVariable [QGVAR(carriedObject), _target, true]; - // Add drop action _unit setVariable [QGVAR(releaseActionID), [ _unit, "DefaultAction", @@ -60,11 +63,14 @@ private _UAVCrew = _target call EFUNC(common,getVehicleUAVCrew); if (_UAVCrew isNotEqualTo []) then { { - _target deleteVehicleCrew _x; + [_x, true] call EFUNC(common,disableAiUAV); } forEach _UAVCrew; - _target setVariable [QGVAR(isUAV), true, true]; + _target setVariable [QGVAR(isUAV), _UAVCrew, true]; }; // Check everything [LINKFUNC(carryObjectPFH), 0.5, [_unit, _target, CBA_missionTime]] call CBA_fnc_addPerFrameHandler; + +// API +[QGVAR(startedCarry), [_unit, _target]] call CBA_fnc_localEvent; diff --git a/addons/dragging/functions/fnc_carryObjectPFH.sqf b/addons/dragging/functions/fnc_carryObjectPFH.sqf index fcd0f053768..a615d282521 100644 --- a/addons/dragging/functions/fnc_carryObjectPFH.sqf +++ b/addons/dragging/functions/fnc_carryObjectPFH.sqf @@ -73,8 +73,8 @@ if (_unit getHitPointDamage "HitLegs" >= 0.5) exitWith { _idPFH call CBA_fnc_removePerFrameHandler; }; -// Drop static if crew is in it (UAV crew deletion may take a few frames) -if (_target isKindOf "StaticWeapon" && {!(_target getVariable [QGVAR(isUAV), false])} && {(crew _target) isNotEqualTo []}) exitWith { +// Drop static if either non-UAV crew or new UAV crew is in it (ignore saved UAV crew) +if (_target isKindOf "StaticWeapon" && {((crew _target) - (_target getVariable [QGVAR(isUAV), []])) isNotEqualTo []}) exitWith { TRACE_2("static weapon crewed",_unit,_target); [_unit, _target] call FUNC(dropObject_carry); @@ -91,7 +91,7 @@ private _previousHint = _unit getVariable [QGVAR(hint), []]; if (_previousHint isEqualType "") exitWith {}; // Mouse hint -private _hintLMB = LLSTRING(Drop); +private _hintLMB = LELSTRING(common,Drop); private _cursorObject = cursorObject; if ( diff --git a/addons/dragging/functions/fnc_createClone.sqf b/addons/dragging/functions/fnc_createClone.sqf new file mode 100644 index 00000000000..6cb4aa0ec69 --- /dev/null +++ b/addons/dragging/functions/fnc_createClone.sqf @@ -0,0 +1,101 @@ +#include "..\script_component.hpp" +/* + * Author: BaerMitUmlaut, johnb43 + * Creates a draggable / carryable clone of a dead unit. + * + * Arguments: + * 0: Unit dragging/carrying <OBJECT> + * 1: Dead unit <OBJECT> + * + * Return Value: + * Cloned unit <OBJECT> + * + * Example: + * [player, cursorObject] call ace_dragging_fnc_createClone; + * + * Public: No + */ + +params ["_unit", "_target"]; + +// Don't sync corpse when a player joins in progress until the corpse is in its proper position +[QGVAR(disableSyncMovedCorpseOnJIP), _target] call CBA_fnc_serverEvent; + +private _posATL = getPosATL _target; + +// Create clone +private _clone = createVehicle [[configOf _target >> QGVAR(cloneClass), "TEXT", QGVAR(clone)] call CBA_fnc_getConfigEntry, _posATL, [], 0, "CAN_COLLIDE"]; + +// Claim the clone +[_unit, _clone] call EFUNC(common,claim); + +// Move unit -10 m below terrain in order to hide it and remove its inventory access +_posATL set [2, -10]; + +// Corpse is desynced, but it doesn't matter here +_target setPosATL _posATL; + +// Hide unit until it can be moved below terrain +private _isObjectHidden = isObjectHidden _target; + +if (!_isObjectHidden) then { + [QEGVAR(common,hideObjectGlobal), [_target, true]] call CBA_fnc_serverEvent; +}; + +// Prevents unit from falling when below terrain +private _simulationEnabled = simulationEnabled _target; + +if (_simulationEnabled) then { + [QEGVAR(common,enableSimulationGlobal), [_target, false]] call CBA_fnc_serverEvent; +}; + +private _isInRemainsCollector = isInRemainsCollector _target; + +// Make sure corpse isn't deleted by engine's garbage collector +if (_isInRemainsCollector) then { + removeFromRemainsCollector [_target]; +}; + +// Make sure clone has the same wound textures as the corpse +_clone setDamage ((damage _target) min 0.99); // Don't kill the clone + +{ + _clone setHitPointDamage [_x, (_target getHitPointDamage _x) min 0.99]; +} forEach ["HitHead", "HitBody", "HitHands", "HitLegs"]; // Relevant hitpoints + +// Disable all damage +_clone allowDamage false; +_clone setVariable [QGVAR(original), [_target, _isInRemainsCollector, _isObjectHidden, _simulationEnabled], true]; + +[_clone, _target call CBA_fnc_getLoadout] call CBA_fnc_setLoadout; + +// Sets the facial expression +[[QGVAR(setCloneFace), [_clone, _target]] call CBA_fnc_globalEventJIP, _clone] call CBA_fnc_removeGlobalEventJIP; + +// API +[QGVAR(cloneCreated), [_clone, _target]] call CBA_fnc_localEvent; + +[{ + params ["_clone", "_target"]; + + // Remove clone from all zeuses + if (["ace_zeus"] call EFUNC(common,isModLoaded)) then { + [QEGVAR(zeus,removeObjects), [[_clone]]] call CBA_fnc_serverEvent; + }; + + // Release claim on corpse + [objNull, _target] call EFUNC(common,claim); +}, [_clone, _target], 0.25] call CBA_fnc_waitAndExecute; + +// Save which curators had this object as editable +if (["ace_zeus"] call EFUNC(common,isModLoaded)) then { + private _objectCurators = objectCurators _target; + + _target setVariable [QGVAR(objectCurators), _objectCurators, true]; + + if (_objectCurators isEqualTo []) exitWith {}; + + [QEGVAR(zeus,removeObjects), [[_target], _objectCurators]] call CBA_fnc_serverEvent; +}; + +_clone diff --git a/addons/dragging/functions/fnc_deleteClone.sqf b/addons/dragging/functions/fnc_deleteClone.sqf new file mode 100644 index 00000000000..148b88a3a31 --- /dev/null +++ b/addons/dragging/functions/fnc_deleteClone.sqf @@ -0,0 +1,80 @@ +#include "..\script_component.hpp" +/* + * Author: BaerMitUmlaut, johnb43 + * Drops a draggable / carryable clone of a dead unit. + * + * Arguments: + * 0: Unit dragging / carrying <OBJECT> + * 1: Clone <OBJECT> + * 2: If unit is in building <BOOL> + * + * Return Value: + * Original unit <OBJECT> + * + * Example: + * [player, cursorObject, false] call ace_dragging_fnc_deleteClone; + * + * Public: No + */ + +params ["_unit", "_clone", "_inBuilding"]; + +(_clone getVariable [QGVAR(original), []]) params [ + ["_target", objNull], + ["_isInRemainsCollector", true], + ["_isObjectHidden", false], + ["_simulationEnabled", true] +]; + +// API +[QGVAR(cloneDeleted), [_clone, _target]] call CBA_fnc_localEvent; + +// Check if unit was deleted +if (!isNull _target) then { + private _posATL = getPosATL _clone; + + if (_inBuilding) then { + _posATL = _posATL vectorAdd [0, 0, 0.05]; + }; + + // Make sure position isn't underground + if (_posATL select 2 < 0.05) then { + _posATL set [2, 0.05]; + }; + + // Move the unit globally (important, as it desyncs the corpse position otherwise) + [QGVAR(moveCorpse), [_target, getDir _unit + 180, _posATL]] call CBA_fnc_globalEvent; + + // Unhide unit + if (!_isObjectHidden) then { + [QEGVAR(common,hideObjectGlobal), [_target, false]] call CBA_fnc_serverEvent; + }; + + // Enable simulation again + if (_simulationEnabled) then { + [QEGVAR(common,enableSimulationGlobal), [_target, true]] call CBA_fnc_serverEvent; + }; + + // Detach first to prevent objNull in attachedObjects + detach _clone; + deleteVehicle _clone; + + // Get which curators had this object as editable + if (["ace_zeus"] call EFUNC(common,isModLoaded)) then { + private _objectCurators = _target getVariable [QGVAR(objectCurators), []]; + + if (_objectCurators isEqualTo []) exitWith {}; + + [QEGVAR(zeus,addObjects), [[_target], _objectCurators]] call CBA_fnc_serverEvent; + }; + + if (_isInRemainsCollector) then { + addToRemainsCollector [_target]; + }; +} else { + // Detach first to prevent objNull in attachedObjects + detach _clone; + deleteVehicle _clone; +}; + +_target diff --git a/addons/dragging/functions/fnc_dragObject.sqf b/addons/dragging/functions/fnc_dragObject.sqf index 5116f440b32..3169db26795 100644 --- a/addons/dragging/functions/fnc_dragObject.sqf +++ b/addons/dragging/functions/fnc_dragObject.sqf @@ -19,6 +19,12 @@ params ["_unit", "_target"]; TRACE_2("params",_unit,_target); +// If in ViV cargo, unload it first +// Warn user if it failed to unload (shouldn't happen) +if (!isNull isVehicleCargo _target && {!(objNull setVehicleCargo _target)}) then { + WARNING_1("ViV Unload Failed %1",_target); +}; + // Get attachTo offset and direction. private _position = _target getVariable [QGVAR(dragPosition), [0, 0, 0]]; private _direction = _target getVariable [QGVAR(dragDirection), 0]; @@ -43,9 +49,6 @@ if (_target isKindOf "CAManBase") then { [_target, "AinjPpneMrunSnonWnonDb_still", 0] call EFUNC(common,doAnimation); }; -_unit setVariable [QGVAR(isDragging), true, true]; -_unit setVariable [QGVAR(draggedObject), _target, true]; - // Add drop action GVAR(unit) = _unit; @@ -54,7 +57,7 @@ GVAR(releaseActionID) = [0xF1, [false, false, false], { }, "keydown", "", false, 0] call CBA_fnc_addKeyHandler; // Show mouse hint -["", LLSTRING(Drop)] call EFUNC(interaction,showMouseHint); +["", LELSTRING(common,Drop)] call EFUNC(interaction,showMouseHint); // Block firing if (!GVAR(dragAndFire)) then { @@ -73,10 +76,10 @@ private _UAVCrew = _target call EFUNC(common,getVehicleUAVCrew); if (_UAVCrew isNotEqualTo []) then { { - _target deleteVehicleCrew _x; + [_x, true] call EFUNC(common,disableAiUAV); } forEach _UAVCrew; - _target setVariable [QGVAR(isUAV), true, true]; + _target setVariable [QGVAR(isUAV), _UAVCrew, true]; }; // Check everything @@ -84,3 +87,6 @@ if (_UAVCrew isNotEqualTo []) then { // Fixes not being able to move when in combat pace [_unit, "forceWalk", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); + +// API +[QGVAR(startedDrag), [_unit, _target]] call CBA_fnc_localEvent; diff --git a/addons/dragging/functions/fnc_dragObjectPFH.sqf b/addons/dragging/functions/fnc_dragObjectPFH.sqf index 7c3a6be3074..13400aa349f 100644 --- a/addons/dragging/functions/fnc_dragObjectPFH.sqf +++ b/addons/dragging/functions/fnc_dragObjectPFH.sqf @@ -51,8 +51,8 @@ if (_unit distance _target > 10 && {(CBA_missionTime - _startTime) >= 1}) exitWi _idPFH call CBA_fnc_removePerFrameHandler; }; -// Drop static if crew is in it (UAV crew deletion may take a few frames) -if (_target isKindOf "StaticWeapon" && {!(_target getVariable [QGVAR(isUAV), false])} && {(crew _target) isNotEqualTo []}) exitWith { +// Drop static if either non-UAV crew or new UAV crew is in it (ignore saved UAV crew) +if (_target isKindOf "StaticWeapon" && {((crew _target) - (_target getVariable [QGVAR(isUAV), []])) isNotEqualTo []}) exitWith { TRACE_2("static weapon crewed",_unit,_target); [_unit, _target] call FUNC(dropObject); @@ -62,3 +62,8 @@ if (_target isKindOf "StaticWeapon" && {!(_target getVariable [QGVAR(isUAV), fal _idPFH call CBA_fnc_removePerFrameHandler; }; + +// Clones can die of drowning if oxygen is under 0.5, so refill their oxygen from time to time +if (_target isKindOf QGVAR(clone) && {getOxygenRemaining _target < 0.8}) then { + _target setOxygenRemaining 1; +}; diff --git a/addons/dragging/functions/fnc_dropObject.sqf b/addons/dragging/functions/fnc_dropObject.sqf index 4115f288204..049f8228168 100644 --- a/addons/dragging/functions/fnc_dropObject.sqf +++ b/addons/dragging/functions/fnc_dropObject.sqf @@ -31,6 +31,12 @@ if (!GVAR(dragAndFire)) then { }; private _inBuilding = _unit call FUNC(isObjectOnObject); +private _isClone = _target isKindOf QGVAR(clone); + +// Drop cloned dead units +if (_isClone) then { + _target = [_unit, _target, _inBuilding] call FUNC(deleteClone); +}; // Play release animation if (_unit call EFUNC(common,isAwake)) then { @@ -57,7 +63,7 @@ _unit removeWeapon "ACE_FakePrimaryWeapon"; [_unit, "blockThrow", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); // Prevent object from flipping inside buildings -if (_inBuilding) then { +if (_inBuilding && {!_isClone}) then { _target setPosASL (getPosASL _target vectorAdd [0, 0, 0.05]); TRACE_2("setPos",getPosASL _unit,getPosASL _target); }; @@ -80,16 +86,16 @@ if (_unit getVariable ["ACE_isUnconscious", false]) then { [_unit, "unconscious", 2] call EFUNC(common,doAnimation); }; -// Recreate UAV crew (add a frame delay or this may cause the vehicle to be moved to [0,0,0]) -if (_target getVariable [QGVAR(isUAV), false]) then { - _target setVariable [QGVAR(isUAV), nil, true]; +// Reenable UAV crew +private _UAVCrew = _target getVariable [QGVAR(isUAV), []]; - [{ - params ["_target"]; - if (!alive _target) exitWith {}; - TRACE_2("restoring uav crew",_target,getPosASL _target); - createVehicleCrew _target; - }, [_target]] call CBA_fnc_execNextFrame; +if (_UAVCrew isNotEqualTo []) then { + // Reenable AI + { + [_x, false] call EFUNC(common,disableAiUAV); + } forEach _UAVCrew; + + _target setVariable [QGVAR(isUAV), nil, true]; }; // Fixes not being able to move when in combat pace @@ -101,3 +107,6 @@ private _mass = _target getVariable [QGVAR(originalMass), 0]; if (_mass != 0) then { [QEGVAR(common,setMass), [_target, _mass]] call CBA_fnc_globalEvent; // Force global sync }; + +// API +[QGVAR(stoppedDrag), [_unit, _target]] call CBA_fnc_localEvent; diff --git a/addons/dragging/functions/fnc_dropObject_carry.sqf b/addons/dragging/functions/fnc_dropObject_carry.sqf index ff6324e0f39..525a150bcff 100644 --- a/addons/dragging/functions/fnc_dropObject_carry.sqf +++ b/addons/dragging/functions/fnc_dropObject_carry.sqf @@ -25,6 +25,12 @@ TRACE_1("params",_this); _unit setVariable [QGVAR(releaseActionID), nil]; private _inBuilding = _unit call FUNC(isObjectOnObject); +private _isClone = _target isKindOf QGVAR(clone); + +// Drop cloned dead units +if (_isClone) then { + _target = [_unit, _target, _inBuilding] call FUNC(deleteClone); +}; // Prevent collision damage [QEGVAR(common,fixCollision), _unit] call CBA_fnc_localEvent; @@ -59,11 +65,12 @@ if (_target isKindOf "CAManBase" || {animationState _unit in CARRY_ANIMATIONS}) _unit removeWeapon "ACE_FakePrimaryWeapon"; // Reselect weapon and re-enable sprint -private _previousWeaponIndex = _unit getVariable [QGVAR(previousWeapon), -1]; -_unit setVariable [QGVAR(previousWeapon), nil, true]; +private _previousWeaponState = _unit getVariable QGVAR(previousWeapon); -if (_previousWeaponIndex != -1) then { - _unit action ["SwitchWeapon", _unit, _unit, _previousWeaponIndex]; +if (!isNil "_previousWeaponState") then { + _unit selectWeapon _previousWeaponState; + + _unit setVariable [QGVAR(previousWeapon), nil, true]; }; [_unit, "forceWalk", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); @@ -71,8 +78,9 @@ if (_previousWeaponIndex != -1) then { [_unit, "blockThrow", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); // Prevent object from flipping inside buildings -if (_inBuilding) then { +if (_inBuilding && {!_isClone}) then { _target setPosASL (getPosASL _target vectorAdd [0, 0, 0.05]); + TRACE_2("setPos",getPosASL _unit,getPosASL _target); }; _unit setVariable [QGVAR(isCarrying), false, true]; @@ -86,16 +94,16 @@ if !(_target isKindOf "CAManBase") then { [QEGVAR(common,fixFloating), _target, _target] call CBA_fnc_targetEvent; }; -// Recreate UAV crew (add a frame delay or this may cause the vehicle to be moved to [0,0,0]) -if (_target getVariable [QGVAR(isUAV), false]) then { - _target setVariable [QGVAR(isUAV), nil, true]; +// Reenable UAV crew +private _UAVCrew = _target getVariable [QGVAR(isUAV), []]; - [{ - params ["_target"]; - if (!alive _target) exitWith {}; - TRACE_2("restoring uav crew",_target,getPosASL _target); - createVehicleCrew _target; - }, [_target]] call CBA_fnc_execNextFrame; +if (_UAVCrew isNotEqualTo []) then { + // Reenable AI + { + [_x, false] call EFUNC(common,disableAiUAV); + } forEach _UAVCrew; + + _target setVariable [QGVAR(isUAV), nil, true]; }; // Reset mass @@ -121,6 +129,12 @@ if (_loadCargo) then { } else { [_unit, _target, _cursorObject] call EFUNC(common,loadPerson); }; + + // Repurpose variable for flag used in event below + _loadCargo = true; }; }; }; + +// API +[QGVAR(stoppedCarry), [_unit, _target, _loadCargo]] call CBA_fnc_localEvent; diff --git a/addons/dragging/functions/fnc_getWeight.sqf b/addons/dragging/functions/fnc_getWeight.sqf index f6b93feca0a..f6cb4661659 100644 --- a/addons/dragging/functions/fnc_getWeight.sqf +++ b/addons/dragging/functions/fnc_getWeight.sqf @@ -11,7 +11,7 @@ * Weight <NUMBER> * * Example: - * [cursorTarget] call ace_dragging_fnc_getWeight + * cursorTarget call ace_dragging_fnc_getWeight * * Public: No */ @@ -23,19 +23,20 @@ if (GVAR(weightCoefficient) == 0) exitWith {0}; private _weight = loadAbs _object; -if !(GVAR(skipContainerWeight)) then { +if (!GVAR(skipContainerWeight)) then { // Add the mass of the object itself // getMass handles PhysX mass, this should be 0 for SupplyX containers and WeaponHolders // Use originalMass in case we're checking weight for a carried object - _weight = _weight + ((_object getVariable [QGVAR(originalMass), getMass _object])); + _weight = _weight + (_object getVariable [QGVAR(originalMass), getMass _object]); }; -// Contents of backpacks get counted twice (https://github.com/acemod/ACE3/pull/8457#issuecomment-1062522447 and https://feedback.bistudio.com/T167469) -// This is a workaround until that is fixed on BI's end -{ - _x params ["", "_container"]; - _weight = _weight - (loadAbs _container); -} forEach (everyContainer _object); +// Fixed in https://feedback.bistudio.com/T167469 on 2.16 profiling branch and for 2.18 stable +if ((productVersion select 3) < 152017) then { + { + _x params ["", "_container"]; + _weight = _weight - (loadAbs _container); + } forEach (everyContainer _object); +}; // Mass in Arma isn't an exact amount but rather a volume/weight value // This attempts to work around that by making it a usable value (sort of) diff --git a/addons/dragging/functions/fnc_handleAnimChanged.sqf b/addons/dragging/functions/fnc_handleAnimChanged.sqf index 24b8f582057..49ccc18d3f1 100644 --- a/addons/dragging/functions/fnc_handleAnimChanged.sqf +++ b/addons/dragging/functions/fnc_handleAnimChanged.sqf @@ -5,7 +5,7 @@ * * Arguments: * 0: Unit <OBJECT> - * 1: Animaion <STRING> + * 1: Animation <STRING> * * Return Value: * None @@ -17,6 +17,7 @@ */ params ["_unit", "_anim"]; +//IGNORE_PRIVATE_WARNING ["_thisArgs", "_thisID"]; _thisArgs params ["_realUnit"]; TRACE_4("params",_unit,_anim,_realUnit,_thisID); diff --git a/addons/dragging/functions/fnc_handleScrollWheel.sqf b/addons/dragging/functions/fnc_handleScrollWheel.sqf index c7641a8ffa7..065701bbd44 100644 --- a/addons/dragging/functions/fnc_handleScrollWheel.sqf +++ b/addons/dragging/functions/fnc_handleScrollWheel.sqf @@ -42,7 +42,7 @@ if (!CBA_events_control) then { // Uses this method of selecting position because setPosATL did not have immediate effect private _positionChange = _position vectorDiff (getPosASL _carriedItem); - private _selectionPosition = _unit worldToModel (ASLtoAGL getPosWorld _carriedItem); + private _selectionPosition = _unit worldToModel (ASLToAGL getPosWorld _carriedItem); _selectionPosition = _selectionPosition vectorAdd _positionChange; _carriedItem attachTo [_unit, _selectionPosition]; diff --git a/addons/dragging/functions/fnc_resumeDrag.sqf b/addons/dragging/functions/fnc_resumeDrag.sqf index d0fea988fb8..7ae7c1a8f3c 100644 --- a/addons/dragging/functions/fnc_resumeDrag.sqf +++ b/addons/dragging/functions/fnc_resumeDrag.sqf @@ -29,4 +29,4 @@ GVAR(releaseActionID) = [0xF1, [false, false, false], { }, "keydown", "", false, 0] call CBA_fnc_addKeyHandler; // Show mouse hint -["", LLSTRING(Drop)] call EFUNC(interaction,showMouseHint); +["", LELSTRING(common,Drop)] call EFUNC(interaction,showMouseHint); diff --git a/addons/dragging/functions/fnc_setCarryable.sqf b/addons/dragging/functions/fnc_setCarryable.sqf index 60b9854f419..757f7baa045 100644 --- a/addons/dragging/functions/fnc_setCarryable.sqf +++ b/addons/dragging/functions/fnc_setCarryable.sqf @@ -5,21 +5,52 @@ * * Arguments: * 0: Object <OBJECT> - * 1: True to enable carrying, false to disable <BOOL> + * 1: True to enable carrying, false to disable <BOOL> (default: false) * 2: Position offset for attachTo command <ARRAY> (default: [0, 1, 1]) * 3: Direction in degrees to rotate the object after attachTo <NUMBER> (default: 0) * 4: Override weight limit <BOOL> (default: false) + * 5: Apply globally <BOOL> (default: false) * * Return Value: * None * * Example: - * [cursorTarget, true, [0, 1, 1], 0, false] call ace_dragging_fnc_setCarryable; + * [cursorTarget, true, [0, 1, 1], 0, false] call ace_dragging_fnc_setCarryable * * Public: Yes */ -params ["_object", "_enableCarry", "_position", "_direction", ["_ignoreWeightCarry", false, [false]]]; +params [ + ["_object", objNull, [objNull]], + ["_enableCarry", false, [false]], + "_position", + "_direction", + ["_ignoreWeightCarry", false, [false]], + ["_global", false, [false]] +]; + +if (isNull _object) exitWith {}; + +if (!isNil "_position" && {!(_position isEqualType []) || {!(_position isEqualTypeArray [0, 0, 0])}}) exitWith { + ERROR_2("setCarryable: Bad position parameter [%1] for [%2], should be a 3D position or nil",_position,_object); +}; + +if (!isNil "_direction" && {!(_direction isEqualType 0)}) exitWith { + ERROR_2("setCarryable: Bad direction parameter [%1] for [%2], should be a number or nil",_direction,_object); +}; + +// Handle global here +if (_global) exitWith { + private _jipID = format [QGVAR(carrying_%1), hashValue _object]; + [QGVAR(setCarryable), [_object, _enableCarry, _position, _direction, _ignoreWeightCarry], _jipID] call CBA_fnc_globalEventJIP; + + // Remove from JIP queue if object is deleted + if !(_object getVariable [QGVAR(setCarryableRemoveJip), false]) then { + [_jipID, _object] call CBA_fnc_removeGlobalEventJIP; + + _object setVariable [QGVAR(setCarryableRemoveJip), true, true]; + }; +}; if (isNil "_position") then { _position = _object getVariable [QGVAR(carryPosition), [0, 1, 1]]; @@ -56,6 +87,7 @@ GVAR(initializedClasses_carry) = _initializedClasses; private _icon = [QPATHTOF(UI\icons\box_carry.paa), QPATHTOF(UI\icons\person_carry.paa)] select (_object isKindOf "CAManBase"); +//IGNORE_PRIVATE_WARNING ["_target", "_player"]; private _carryAction = [ QGVAR(carry), LLSTRING(Carry), @@ -68,7 +100,7 @@ private _carryAction = [ private _dropAction = [ QGVAR(drop_carry), - LLSTRING(Drop), + LELSTRING(common,Drop), "", { [_player, _target] call FUNC(dropObject_carry) @@ -78,3 +110,5 @@ private _dropAction = [ [_type, 0, ["ACE_MainActions"], _carryAction] call EFUNC(interact_menu,addActionToClass); [_type, 0, [], _dropAction] call EFUNC(interact_menu,addActionToClass); + +nil // return diff --git a/addons/dragging/functions/fnc_setDraggable.sqf b/addons/dragging/functions/fnc_setDraggable.sqf index e024ec5be29..ebec7d64267 100644 --- a/addons/dragging/functions/fnc_setDraggable.sqf +++ b/addons/dragging/functions/fnc_setDraggable.sqf @@ -5,21 +5,52 @@ * * Arguments: * 0: Object <OBJECT> - * 1: True to enable dragging, false to disable <BOOL> - * 2: Position offset for attachTo command (optional; default: [0, 1.5, 0]) <ARRAY> - * 3: Direction in degrees to rotate the object after attachTo (optional; default: 0) <NUMBER> + * 1: True to enable dragging, false to disable <BOOL> (default: false) + * 2: Position offset for attachTo command <ARRAY> (default: [0, 1.5, 0]) + * 3: Direction in degrees to rotate the object after attachTo <NUMBER> (default: 0) * 4: Override weight limit <BOOL> (default: false) + * 5: Apply globally <BOOL> (default: false) * * Return Value: * None * * Example: - * [cursorTarget, true, [0, 0, 0], 0, false] call ace_dragging_fnc_setDraggable; + * [cursorTarget, true, [0, 0, 0], 0, false] call ace_dragging_fnc_setDraggable * * Public: Yes */ -params ["_object", "_enableDrag", "_position", "_direction", ["_ignoreWeightDrag", false, [false]]]; +params [ + ["_object", objNull, [objNull]], + ["_enableDrag", false, [false]], + "_position", + "_direction", + ["_ignoreWeightDrag", false, [false]], + ["_global", false, [false]] +]; + +if (isNull _object) exitWith {}; + +if (!isNil "_position" && {!(_position isEqualType []) || {!(_position isEqualTypeArray [0, 0, 0])}}) exitWith { + ERROR_2("setDraggable: Bad position parameter [%1] for [%2], should be a 3D position or nil",_position,_object); +}; + +if (!isNil "_direction" && {!(_direction isEqualType 0)}) exitWith { + ERROR_2("setDraggable: Bad direction parameter [%1] for [%2], should be a number or nil",_direction,_object); +}; + +// Handle global here +if (_global) exitWith { + private _jipID = format [QGVAR(dragging_%1), hashValue _object]; + [QGVAR(setDraggable), [_object, _enableDrag, _position, _direction, _ignoreWeightDrag], _jipID] call CBA_fnc_globalEventJIP; + + // Remove from JIP queue if object is deleted + if !(_object getVariable [QGVAR(setDraggableRemoveJip), false]) then { + [_jipID, _object] call CBA_fnc_removeGlobalEventJIP; + + _object setVariable [QGVAR(setDraggableRemoveJip), true, true]; + }; +}; if (isNil "_position") then { _position = _object getVariable [QGVAR(dragPosition), [0, 1.5, 0]]; @@ -56,6 +87,7 @@ GVAR(initializedClasses) = _initializedClasses; private _icon = [QPATHTOF(UI\icons\box_drag.paa), QPATHTOF(UI\icons\person_drag.paa)] select (_object isKindOf "CAManBase"); +//IGNORE_PRIVATE_WARNING ["_target", "_player"]; private _dragAction = [ QGVAR(drag), LLSTRING(Drag), @@ -68,7 +100,7 @@ private _dragAction = [ private _dropAction = [ QGVAR(drop), - LLSTRING(Drop), + LELSTRING(common,Drop), "", { [_player, _target] call FUNC(dropObject); @@ -78,3 +110,5 @@ private _dropAction = [ [_type, 0, ["ACE_MainActions"], _dragAction] call EFUNC(interact_menu,addActionToClass); [_type, 0, [], _dropAction] call EFUNC(interact_menu,addActionToClass); + +nil // return diff --git a/addons/dragging/functions/fnc_startCarry.sqf b/addons/dragging/functions/fnc_startCarry.sqf index 3e2cc17efde..99652fc263d 100644 --- a/addons/dragging/functions/fnc_startCarry.sqf +++ b/addons/dragging/functions/fnc_startCarry.sqf @@ -15,6 +15,7 @@ * * Public: No */ + params ["_unit", "_target"]; // Try to claim the object diff --git a/addons/dragging/functions/fnc_startCarryLocal.sqf b/addons/dragging/functions/fnc_startCarryLocal.sqf index 6ba2c689343..cf17dfb311d 100644 --- a/addons/dragging/functions/fnc_startCarryLocal.sqf +++ b/addons/dragging/functions/fnc_startCarryLocal.sqf @@ -41,6 +41,11 @@ private _timer = CBA_missionTime + 5; // Handle objects vs. persons if (_target isKindOf "CAManBase") then { + // Create clone for dead units + if (!alive _target) then { + _target = [_unit, _target] call FUNC(createClone); + }; + private _primaryWeapon = primaryWeapon _unit; // Add a primary weapon if the unit has none @@ -50,7 +55,7 @@ if (_target isKindOf "CAManBase") then { }; // Select primary, otherwise the carry animation actions don't work - _unit selectWeapon _primaryWeapon; + _unit selectWeapon _primaryWeapon; // This turns off lasers/lights // Move a bit closer and adjust direction when trying to pick up a person [QEGVAR(common,setDir), [_target, getDir _unit + 180], _target] call CBA_fnc_targetEvent; @@ -62,10 +67,11 @@ if (_target isKindOf "CAManBase") then { _timer = CBA_missionTime + 10; } else { // Select no weapon and stop sprinting - private _previousWeaponIndex = [_unit] call EFUNC(common,getFiremodeIndex); - _unit setVariable [QGVAR(previousWeapon), _previousWeaponIndex, true]; + if (currentWeapon _unit != "") then { + _unit setVariable [QGVAR(previousWeapon), (weaponState _unit) select [0, 3], true]; - _unit action ["SwitchWeapon", _unit, _unit, 299]; + _unit action ["SwitchWeapon", _unit, _unit, 299]; + }; [_unit, "AmovPercMstpSnonWnonDnon", 0] call EFUNC(common,doAnimation); @@ -81,7 +87,7 @@ if (_target isKindOf "CAManBase") then { // Prevents dragging and carrying at the same time _unit setVariable [QGVAR(isCarrying), true, true]; -// Required for aborting animation +// Required for aborting (animation & keybind) _unit setVariable [QGVAR(carriedObject), _target, true]; [LINKFUNC(startCarryPFH), 0.2, [_unit, _target, _timer]] call CBA_fnc_addPerFrameHandler; @@ -93,3 +99,6 @@ if (_mass > 1) then { _target setVariable [QGVAR(originalMass), _mass, true]; [QEGVAR(common,setMass), [_target, 1e-12]] call CBA_fnc_globalEvent; // Force global sync }; + +// API +[QGVAR(setupCarry), [_unit, _target]] call CBA_fnc_localEvent; diff --git a/addons/dragging/functions/fnc_startCarryPFH.sqf b/addons/dragging/functions/fnc_startCarryPFH.sqf index f928ef942a5..aefe6d76fcb 100644 --- a/addons/dragging/functions/fnc_startCarryPFH.sqf +++ b/addons/dragging/functions/fnc_startCarryPFH.sqf @@ -53,10 +53,9 @@ if (_target isKindOf "CAManBase") then { // Timeout: Drop target. CBA_missionTime, because anim length is linked to ingame time if (CBA_missionTime > _timeOut) exitWith { TRACE_4("timeout",_unit,_target,_timeOut,CBA_missionTime); - _idPFH call CBA_fnc_removePerFrameHandler; + [_unit, _target] call FUNC(dropObject_carry); - private _carriedObject = _unit getVariable [QGVAR(carriedObject), objNull]; - [_unit, _carriedObject] call FUNC(dropObject_carry); + _idPFH call CBA_fnc_removePerFrameHandler; }; // Wait for the unit to stand up diff --git a/addons/dragging/functions/fnc_startDrag.sqf b/addons/dragging/functions/fnc_startDrag.sqf index 8dd6db6dee5..d65f218acd7 100644 --- a/addons/dragging/functions/fnc_startDrag.sqf +++ b/addons/dragging/functions/fnc_startDrag.sqf @@ -15,6 +15,7 @@ * * Public: No */ + params ["_unit", "_target"]; // Try to claim the object diff --git a/addons/dragging/functions/fnc_startDragLocal.sqf b/addons/dragging/functions/fnc_startDragLocal.sqf index 22c7cecd24f..f0468f133ba 100644 --- a/addons/dragging/functions/fnc_startDragLocal.sqf +++ b/addons/dragging/functions/fnc_startDragLocal.sqf @@ -46,7 +46,10 @@ if (!GVAR(dragAndFire)) then { _primaryWeapon = "ACE_FakePrimaryWeapon"; }; - _unit selectWeapon _primaryWeapon; + // Keep the laser/light on if the weapon is already selected + if (currentWeapon _unit != _primaryWeapon) then { + _unit selectWeapon _primaryWeapon; + }; } else { // Making sure the unit is holding a primary weapon or handgun private _handgunWeapon = handgunWeapon _unit; @@ -87,6 +90,11 @@ if !(_unit call EFUNC(common,isSwimming)) then { // Move a bit closer and adjust direction when trying to pick up a person if (_target isKindOf "CAManBase") then { + // Create clone for dead units + if (!alive _target) then { + _target = [_unit, _target] call FUNC(createClone); + }; + [QEGVAR(common,setDir), [_target, getDir _unit + 180], _target] call CBA_fnc_targetEvent; _target setPosASL (getPosASL _unit vectorAdd (vectorDir _unit vectorMultiply 1.5)); @@ -96,6 +104,9 @@ if (_target isKindOf "CAManBase") then { // Prevents dragging and carrying at the same time _unit setVariable [QGVAR(isDragging), true, true]; +// Required for aborting (keybind) +_unit setVariable [QGVAR(draggedObject), _target, true]; + [LINKFUNC(startDragPFH), 0.2, [_unit, _target, CBA_missionTime + 5]] call CBA_fnc_addPerFrameHandler; // Disable collisions by setting the physx mass to almost zero @@ -105,3 +116,6 @@ if (_mass > 1) then { _target setVariable [QGVAR(originalMass), _mass, true]; [QEGVAR(common,setMass), [_target, 1e-12]] call CBA_fnc_globalEvent; // Force global sync }; + +// API +[QGVAR(setupDrag), [_unit, _target]] call CBA_fnc_localEvent; diff --git a/addons/dragging/functions/fnc_startDragPFH.sqf b/addons/dragging/functions/fnc_startDragPFH.sqf index daf887c362a..e1cf75b38e0 100644 --- a/addons/dragging/functions/fnc_startDragPFH.sqf +++ b/addons/dragging/functions/fnc_startDragPFH.sqf @@ -43,11 +43,9 @@ if (!alive _target || {_unit distance _target > 10}) exitWith { // Timeout: Drop target. CBA_missionTime, because anim length is linked to ingame time if (CBA_missionTime > _timeOut) exitWith { TRACE_4("timeout",_unit,_target,_timeOut,CBA_missionTime); - _idPFH call CBA_fnc_removePerFrameHandler; + [_unit, _target] call FUNC(dropObject); - // Drop if in timeout - private _draggedObject = _unit getVariable [QGVAR(draggedObject), objNull]; - [_unit, _draggedObject] call FUNC(dropObject); + _idPFH call CBA_fnc_removePerFrameHandler; }; // Unit is ready to start dragging diff --git a/addons/dragging/initKeybinds.inc.sqf b/addons/dragging/initKeybinds.inc.sqf index a8792f35763..b7c3a2ace00 100644 --- a/addons/dragging/initKeybinds.inc.sqf +++ b/addons/dragging/initKeybinds.inc.sqf @@ -19,6 +19,7 @@ }; private _cursorObject = cursorObject; + if (_cursorObject isKindOf "CaManBase" && {unitIsUAV _cursorObject}) then { _cursorObject = vehicle _cursorObject }; if (isNull _cursorObject || {(_cursorObject distance _player) > 2.6}) exitWith {false}; if !([_player, _cursorObject] call FUNC(canDrag)) exitWith {false}; @@ -48,6 +49,7 @@ }; private _cursorObject = cursorObject; + if (_cursorObject isKindOf "CaManBase" && {unitIsUAV _cursorObject}) then { _cursorObject = vehicle _cursorObject }; if (isNull _cursorObject || {(_cursorObject distance _player) > 2.6}) exitWith {false}; if !([_player, _cursorObject] call FUNC(canCarry)) exitWith {false}; diff --git a/addons/dragon/CfgAmmo.hpp b/addons/dragon/CfgAmmo.hpp index f736e8451ba..3a5a4a1ed6d 100644 --- a/addons/dragon/CfgAmmo.hpp +++ b/addons/dragon/CfgAmmo.hpp @@ -1,3 +1,4 @@ +class ace_missileguidance_type_Dragon; class CfgAmmo { class ammo_Penetrator_Base; class M_Scalpel_AT; @@ -37,39 +38,7 @@ class CfgAmmo { EGVAR(vehicle_damage,incendiary) = 1.0; - class ace_missileguidance { - minDeflection = 0; - maxDeflection = 0; - incDeflection = 0; - - canVanillaLock = 0; - - // Guidance type for munitions - defaultSeekerType = "SACLOS"; - seekerTypes[] = { "SACLOS" }; - - defaultSeekerLockMode = "LOAL"; - seekerLockModes[] = { "LOAL", "LOBL" }; - - seekLastTargetPos = 0; - seekerAngle = 30; - seekerAccuracy = 1; - - seekerMinRange = 65; - seekerMaxRange = 1000; - - correctionDistance = 30; - missileLeadDistance = 0; - offsetFromCrosshair[] = { 0, 0, 0 }; - - serviceInterval = 0.33; // how many seconds between pops - serviceCharges = 32; // how many charges are in this missile - serviceChargeAcceleration = 6.5; - dragonSpeed = 100; // meters per second - - defaultAttackProfile = "DRAGON"; - attackProfiles[] = {"DRAGON"}; - }; + class ace_missileguidance: ace_missileguidance_type_Dragon {}; }; class GVAR(super): GVAR(dragonBase) { @@ -79,33 +48,11 @@ class CfgAmmo { submunitionParentSpeedCoef = 0; submunitionInitialOffset[] = { 0, 0, -0.2 }; - class ace_missileguidance { + class ace_missileguidance: ace_missileguidance { enabled = 1; - - // Guidance type for munitions - defaultSeekerType = "SACLOS"; - seekerTypes[] = { "SACLOS" }; - - defaultSeekerLockMode = "LOAL"; - seekerLockModes[] = { "LOAL", "LOBL" }; - - seekLastTargetPos = 0; - seekerAngle = 30; - seekerAccuracy = 1; - seekerMinRange = 30; seekerMaxRange = 1500; - - correctionDistance = 30; - missileLeadDistance = 0; - - serviceInterval = 0.33; // how many seconds between pops serviceCharges = 60; // how many charges are in this missile - serviceChargeAcceleration = 6.5; - dragonSpeed = 100; // meters per second - - defaultAttackProfile = "DRAGON"; - attackProfiles[] = {"DRAGON"}; }; }; diff --git a/addons/dragon/CfgVehicles.hpp b/addons/dragon/CfgVehicles.hpp index 13441c6c26a..9cc60771b51 100644 --- a/addons/dragon/CfgVehicles.hpp +++ b/addons/dragon/CfgVehicles.hpp @@ -107,7 +107,7 @@ class CfgVehicles { soundGetIn[] = {"A3\sounds_f\dummysound",0.00031622776,1,5}; armorStructural = 10.0; - class ACE_CSW { + class ace_csw { disassembleTo = QGVAR(super); }; diff --git a/addons/dragon/CfgWeapons.hpp b/addons/dragon/CfgWeapons.hpp index 9cb58e2c1f4..0bdd53e34f2 100644 --- a/addons/dragon/CfgWeapons.hpp +++ b/addons/dragon/CfgWeapons.hpp @@ -19,7 +19,7 @@ class CfgWeapons { descriptionShort = CSTRING(dragonDescription); scope = 2; - class ACE_CSW { + class ace_csw { type = "mount"; deployTime = 2; pickupTime = 2; @@ -75,7 +75,7 @@ class CfgWeapons { opticsZoomMin = 0.055; opticsZoomMax = 0.055; scope = 2; - class ACE_CSW { + class ace_csw { type = "weapon"; deployTime = 2; pickupTime = 1; diff --git a/addons/dragon/functions/fnc_attackProfile_DRAGON.sqf b/addons/dragon/functions/fnc_attackProfile_DRAGON.sqf index 58e3844c882..6642d7d7de0 100644 --- a/addons/dragon/functions/fnc_attackProfile_DRAGON.sqf +++ b/addons/dragon/functions/fnc_attackProfile_DRAGON.sqf @@ -23,7 +23,7 @@ _attackProfileStateParams params ["_maxCorrectableDistance", "_wireCut", "_seeke private _projectilePos = getPosASL _projectile; private _distanceToProjectile = (getPosASL _shooter) vectorDistanceSqr _projectilePos; -private _retPos = _projectilePos vectorAdd (AGLtoASL (_projectile vectorModelToWorld [0, 50, 0])); +private _retPos = _projectilePos vectorAdd (AGLToASL (_projectile vectorModelToWorld [0, 50, 0])); // _shooter returns the vehicle that shot it. If the launcher dies, the wire would probably be cut so assume it if ((_distanceToProjectile > _seekerMaxRangeSqr) || _wireCut || { !alive _shooter }) exitWith { diff --git a/addons/explosives/ACE_Arsenal_Stats.hpp b/addons/explosives/ACE_Arsenal_Stats.hpp index 821ac65bfd1..c2c33b7f0a7 100644 --- a/addons/explosives/ACE_Arsenal_Stats.hpp +++ b/addons/explosives/ACE_Arsenal_Stats.hpp @@ -7,7 +7,7 @@ class EGVAR(arsenal,stats) { displayName = CSTRING(statExploRange); showText = 1; textStatement = QUOTE(params [ARR_2('_stat','_config')]; private _exploRangeStat = getNumber (_config >> _stat select 0); format [ARR_3('%1m (%2ft)',_exploRangeStat,(_exploRangeStat / 0.3048) toFixed 1)]); - condition = QUOTE(params [ARR_2('','_config')]; (getNumber (_config >> QQGVAR(Detonator))) > 0); + condition = QUOTE(getNumber (_this select 1 >> QQGVAR(detonator)) > 0); tabs[] = {{}, {7}}; }; }; diff --git a/addons/explosives/ACE_Triggers.hpp b/addons/explosives/ACE_Triggers.hpp index 27d63a736dd..a94ad95eaa4 100644 --- a/addons/explosives/ACE_Triggers.hpp +++ b/addons/explosives/ACE_Triggers.hpp @@ -18,7 +18,7 @@ class ACE_Triggers { isAttachable = 1; displayName = CSTRING(clacker_displayName); picture = QPATHTOF(Data\UI\Clacker.paa); - onPlace = QUOTE(_this call FUNC(AddClacker);false); + onPlace = QUOTE(_this call FUNC(addClacker); false); requires[] = {"ACE_Clacker"}; }; class MK16_Transmitter: Command { @@ -37,7 +37,7 @@ class ACE_Triggers { isAttachable = 1; displayName = CSTRING(cellphone_displayName); picture = QPATHTOF(Data\UI\Cellphone_UI.paa); - onPlace = QUOTE(_this call FUNC(addCellphoneIED);false); + onPlace = QUOTE(_this call FUNC(addCellphoneIED); false); requires[] = {"ACE_Cellphone"}; }; class PressurePlate { diff --git a/addons/explosives/CfgAmmo.hpp b/addons/explosives/CfgAmmo.hpp index c02885362ee..bfe48d8fa9e 100644 --- a/addons/explosives/CfgAmmo.hpp +++ b/addons/explosives/CfgAmmo.hpp @@ -3,47 +3,41 @@ class CfgAmmo { class Default; class TimeBombCore: Default { - GVAR(DefuseTime) = 5; + GVAR(defuseTime) = 5; }; - /* - class BoundingMineCore: TimeBombCore; - class BoundingMineBase: BoundingMineCore; - class APERSBoundingMine_Range_Ammo: BoundingMineBase; - class MineCore: TimeBombCore; - class MineBase: MineCore; - class APERSMine_Range_Ammo: MineBase; - class ATMine_Range_Ammo: MineBase; - - class DirectionalBombCore: TimeBombCore; - class DirectionalBombBase: DirectionalBombCore; - - class SLAMDirectionalMine_Wire_Ammo: DirectionalBombBase; - - class PipeBombCore: TimeBombCore; - class PipeBombBase: PipeBombCore; - */ // GVAR(size) = 0; is small size // GVAR(size) = 1; is large size - class DirectionalBombBase; - class ClaymoreDirectionalMine_Remote_Ammo: DirectionalBombBase { + class ClaymoreDirectionalMine_Remote_Ammo; + class ACE_ClaymoreDirectionalMine_Remote_Ammo: ClaymoreDirectionalMine_Remote_Ammo { // Wrapper class to avoid unintentional changes to third-party mods. Ref #10105 GVAR(magazine) = "ClaymoreDirectionalMine_Remote_Mag"; - GVAR(Explosive) = "ClaymoreDirectionalMine_Remote_Ammo_Scripted"; GVAR(size) = 0; GVAR(defuseObjectPosition)[] = {0, 0, 0.038}; soundActivation[] = {"", 0, 0, 0}; soundDeactivation[] = {"", 0, 0, 0}; + + // Reduce vanilla damage, so that it doesn't destroy buildings + hit = 10; + indirectHit = 10; }; - // class ClaymoreDirectionalMine_Remote_Ammo_Scripted: ClaymoreDirectionalMine_Remote_Ammo {}; + class DirectionalBombBase; class APERSTripMine_Wire_Ammo: DirectionalBombBase { GVAR(defuseObjectPosition)[] = {-1.415, 0, 0.12}; GVAR(size) = 0; }; + class APERSBoundingMine_Range_Ammo; + class ACE_APERSBoundingMine_Range_Ammo: APERSBoundingMine_Range_Ammo { + // Reduce vanilla damage, so that it doesn't destroy buildings + hit = 10; + indirectHit = 10; + CraterEffects = "MineCrater"; + }; + class ACE_FlareTripMine_Wire_Ammo: APERSTripMine_Wire_Ammo { SoundSetExplosion[] = {}; - defaultMagazine = "ACE_FlareTripMine_Mag"; //Mag that gets dropped after defuse + defaultMagazine = "ACE_FlareTripMine_Mag"; // Mag that gets dropped after defuse hit = 0; indirectHit = 0; indirectHitRange = 0; @@ -65,9 +59,16 @@ class CfgAmmo { GVAR(size) = 0; }; + // More sensitive pressure-fuze for the Vanilla AT Mine. + class MineBase; + class ATMine_Range_Ammo: MineBase { + mineTrigger = "ACE_TankTriggerLight"; + }; + // "The SLAM has an anti-tamper feature that is only active in the bottom- and side-attack modes." class SLAMDirectionalMine_Wire_Ammo: DirectionalBombBase { indirectHitRange = 20; + explosionAngle = 60; GVAR(explodeOnDefuseChance) = 1; GVAR(magazine) = "SLAMDirectionalMine_Wire_Mag"; GVAR(size) = 0; @@ -83,16 +84,17 @@ class CfgAmmo { class ACE_SLAMDirectionalMine_Magnetic_Ammo: SLAMDirectionalMine_Wire_Ammo { mineTrigger = "ACE_MagneticTrigger"; GVAR(explodeOnDefuseChance) = 1; - explosionAngle = 360; - indirectHitRange = 1; + explosionAngle = 60; + hit = 3000; + indirectHit = 3000; + indirectHitRange = 10; mineInconspicuousness = 25; icon = "iconExplosiveGP"; }; - class PipeBombBase; - class DemoCharge_Remote_Ammo: PipeBombBase { + class DemoCharge_Remote_Ammo; + class ACE_DemoCharge_Remote_Ammo: DemoCharge_Remote_Ammo { GVAR(magazine) = "DemoCharge_Remote_Mag"; - GVAR(Explosive) = "DemoCharge_Remote_Ammo_Scripted"; // can probably remove as base ammo now has triggerWhenDestroyed GVAR(size) = 0; GVAR(defuseObjectPosition)[] = {0.07, 0, 0.055}; soundActivation[] = {"", 0, 0, 0}; @@ -101,16 +103,14 @@ class CfgAmmo { indirectHit = 500; indirectHitRange = 7; }; + class PipeBombBase; class SatchelCharge_Remote_Ammo: PipeBombBase { GVAR(magazine) = "SatchelCharge_Remote_Mag"; - GVAR(Explosive) = "SatchelCharge_Remote_Ammo_Scripted"; // can probably remove as base ammo now has triggerWhenDestroyed GVAR(size) = 0; GVAR(defuseObjectPosition)[] = {0.1, 0.1, 0.05}; soundActivation[] = {"", 0, 0, 0}; soundDeactivation[] = {"", 0, 0, 0}; }; - // class DemoCharge_Remote_Ammo_Scripted: DemoCharge_Remote_Ammo {}; - // class SatchelCharge_Remote_Ammo_Scripted: SatchelCharge_Remote_Ammo {}; class IEDUrbanBig_Remote_Ammo: PipeBombBase { triggerWhenDestroyed = 1; @@ -168,10 +168,9 @@ class CfgAmmo { mineTrigger = "RangeTriggerShort"; }; - // Orange DLC: + // Orange DLC class APERSMineDispenser_Ammo: PipeBombBase { GVAR(magazine) = "APERSMineDispenser_Mag"; - GVAR(Explosive) = "APERSMineDispenser_Ammo_Scripted"; // triggerWhenDestroyed = 1; GVAR(size) = 0; GVAR(defuseObjectPosition)[] = {0.0, -0.05, 0.15}; }; @@ -181,7 +180,6 @@ class CfgAmmo { GVAR(size) = 0; GVAR(defuseObjectPosition)[] = {0, 0, 0.15}; }; - class MineBase; class UnderwaterMine_Range_Ammo: MineBase { GVAR(size) = 1; }; diff --git a/addons/explosives/CfgEventHandlers.hpp b/addons/explosives/CfgEventHandlers.hpp index ae0e5fe5410..fe3119a580b 100644 --- a/addons/explosives/CfgEventHandlers.hpp +++ b/addons/explosives/CfgEventHandlers.hpp @@ -9,6 +9,7 @@ class Extended_PreInit_EventHandlers { init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); }; }; + class Extended_PostInit_EventHandlers { class ADDON { init = QUOTE(call COMPILE_SCRIPT(XEH_postInit)); @@ -26,6 +27,7 @@ class Extended_Take_EventHandlers { GVAR(takeHandler) = QUOTE(call FUNC(onInventoryChanged)); }; }; + class Extended_Put_EventHandlers { class CAManBase { GVAR(takeHandler) = QUOTE([ARR_3(_this select 1,_this select 0,_this select 2)] call FUNC(onInventoryChanged)); @@ -42,4 +44,9 @@ class Extended_Init_EventHandlers { class ACE_Explosives_Place_SLAM { ADDON = QUOTE(params ['_mine']; if (local _mine) then {_mine setCenterOfMass [ARR_3(0,-0.035,0.05)]; _mine setMass 5}); }; + class ACE_ModuleMine_SLAMBottomMine { + class ADDON { + init = QUOTE(params ['_mine']; if (local _mine) then { [ARR_2({_this call CALLSTACK(BIS_fnc_setPitchBank)},[ARR_3(_mine,MINE_PITCH_UP,0)])] call CBA_fnc_execNextFrame }); + }; + }; }; diff --git a/addons/explosives/CfgMagazines.hpp b/addons/explosives/CfgMagazines.hpp index 7bb2c6ff02d..71e374be1d5 100644 --- a/addons/explosives/CfgMagazines.hpp +++ b/addons/explosives/CfgMagazines.hpp @@ -1,10 +1,9 @@ class CfgMagazines { class CA_Magazine; class ATMine_Range_Mag: CA_Magazine { - GVAR(Placeable) = 1; useAction = 0; - GVAR(SetupObject) = "ACE_Explosives_Place_ATMine"; // CfgVehicle class for setup object. - GVAR(DelayTime) = 2.5; + GVAR(placeable) = 1; + GVAR(setupObject) = "ACE_Explosives_Place_ATMine"; // CfgVehicle class for setup object class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; class PressurePlate { @@ -13,7 +12,7 @@ class CfgMagazines { }; }; class APERSBoundingMine_Range_Mag: ATMine_Range_Mag { - GVAR(SetupObject) = "ACE_Explosives_Place_APERSBoundingMine"; + GVAR(setupObject) = "ACE_Explosives_Place_APERSBoundingMine"; class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; class PressurePlate { @@ -22,7 +21,7 @@ class CfgMagazines { }; }; class APERSMine_Range_Mag: ATMine_Range_Mag { - GVAR(SetupObject) = "ACE_Explosives_Place_APERSMine"; + GVAR(setupObject) = "ACE_Explosives_Place_APERSMine"; class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; class PressurePlate { @@ -31,7 +30,7 @@ class CfgMagazines { }; }; class APERSTripMine_Wire_Mag: ATMine_Range_Mag { - GVAR(SetupObject) = "ACE_Explosives_Place_APERSTripwireMine"; + GVAR(setupObject) = "ACE_Explosives_Place_APERSTripwireMine"; class ACE_Triggers { SupportedTriggers[] = {"Tripwire"}; class Tripwire; @@ -40,17 +39,16 @@ class CfgMagazines { class ACE_FlareTripMine_Mag: APERSTripMine_Wire_Mag { author = ECSTRING(common,aceteam); ammo = "ACE_FlareTripMine_Wire_Ammo"; - GVAR(SetupObject) = "ACE_Explosives_Place_APERSTripwireMine"; + GVAR(setupObject) = "ACE_Explosives_Place_APERSTripwireMine"; displayName = CSTRING(TripFlare_Name); descriptionShort = CSTRING(TripFlare_Description); class Library {libTextDesc = CSTRING(TripFlare_Description);}; }; class ClaymoreDirectionalMine_Remote_Mag: CA_Magazine { - GVAR(Placeable) = 1; useAction = 0; - GVAR(SetupObject) = "ACE_Explosives_Place_Claymore"; - GVAR(DelayTime) = 1.5; + GVAR(placeable) = 1; + GVAR(setupObject) = "ACE_Explosives_Place_Claymore"; class ACE_Triggers { SupportedTriggers[] = {"Command", "MK16_Transmitter"}; class Command { @@ -61,10 +59,9 @@ class CfgMagazines { }; class SatchelCharge_Remote_Mag: CA_Magazine { - GVAR(Placeable) = 1; useAction = 0; - GVAR(SetupObject) = "ACE_Explosives_Place_SatchelCharge"; - GVAR(DelayTime) = 1; + GVAR(placeable) = 1; + GVAR(setupObject) = "ACE_Explosives_Place_SatchelCharge"; class ACE_Triggers { SupportedTriggers[] = {"Timer", "Command", "MK16_Transmitter", "DeadmanSwitch"}; class Timer { @@ -78,19 +75,19 @@ class CfgMagazines { }; }; class DemoCharge_Remote_Mag: SatchelCharge_Remote_Mag { - GVAR(SetupObject) = "ACE_Explosives_Place_DemoCharge"; + GVAR(setupObject) = "ACE_Explosives_Place_DemoCharge"; model = "\A3\Weapons_F\explosives\c4_charge_small_d"; }; class SLAMDirectionalMine_Wire_Mag: ATMine_Range_Mag { - GVAR(SetupObject) = "ACE_Explosives_Place_SLAM"; + GVAR(setupObject) = "ACE_Explosives_Place_SLAM"; class ACE_Triggers { SupportedTriggers[] = {"IRSensor", "PressurePlate", "Timer", "Command", "MK16_Transmitter"}; class PressurePlate { displayName = CSTRING(SLAME_Magnetic); digDistance = 0; ammo = "ACE_SLAMDirectionalMine_Magnetic_Ammo"; - pitch = 90; + pitch = MINE_PITCH_UP; }; class IRSensor { displayName = CSTRING(SLAME_IRSensor); @@ -107,7 +104,7 @@ class CfgMagazines { }; class IEDUrbanBig_Remote_Mag: DemoCharge_Remote_Mag { - GVAR(SetupObject) = "ACE_Explosives_Place_IEDUrbanBig"; + GVAR(setupObject) = "ACE_Explosives_Place_IEDUrbanBig"; class ACE_Triggers { SupportedTriggers[] = {"Command", "DeadmanSwitch", "Cellphone", "PressurePlate"}; class Command { @@ -125,7 +122,7 @@ class CfgMagazines { }; }; class IEDLandBig_Remote_Mag: IEDUrbanBig_Remote_Mag { - GVAR(SetupObject) = "ACE_Explosives_Place_IEDLandBig"; + GVAR(setupObject) = "ACE_Explosives_Place_IEDLandBig"; picture = "\A3\Weapons_F\Data\UI\gear_mine_AT_CA.paa"; // Fix inconsistent picture class ACE_Triggers: ACE_Triggers { class Command: Command { @@ -139,7 +136,7 @@ class CfgMagazines { }; }; class IEDUrbanSmall_Remote_Mag: DemoCharge_Remote_Mag { - GVAR(SetupObject) = "ACE_Explosives_Place_IEDUrbanSmall"; + GVAR(setupObject) = "ACE_Explosives_Place_IEDUrbanSmall"; picture = "\A3\Weapons_F\Data\UI\gear_mine_AP_bouncing_CA.paa"; // Fix inconsistent picture class ACE_Triggers { SupportedTriggers[] = {"Command", "DeadmanSwitch", "Cellphone", "PressurePlate"}; @@ -158,7 +155,7 @@ class CfgMagazines { }; }; class IEDLandSmall_Remote_Mag: IEDUrbanSmall_Remote_Mag { - GVAR(SetupObject) = "ACE_Explosives_Place_IEDLandSmall"; + GVAR(setupObject) = "ACE_Explosives_Place_IEDLandSmall"; class ACE_Triggers: ACE_Triggers { class Command: Command { ammo = "ACE_IEDLandSmall_Command_Ammo"; @@ -174,7 +171,7 @@ class CfgMagazines { // Orange DLC: class APERSMineDispenser_Mag: SatchelCharge_Remote_Mag { - GVAR(SetupObject) = "ACE_Explosives_Place_APERSMineDispenser"; + GVAR(setupObject) = "ACE_Explosives_Place_APERSMineDispenser"; class ACE_Triggers { SupportedTriggers[] = {"Timer", "Command", "MK16_Transmitter"}; class Timer { @@ -187,7 +184,7 @@ class CfgMagazines { }; }; class TrainingMine_Mag: APERSMine_Range_Mag { - GVAR(SetupObject) = "ACE_Explosives_Place_TrainingMine"; + GVAR(setupObject) = "ACE_Explosives_Place_TrainingMine"; class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; class PressurePlate { diff --git a/addons/explosives/CfgVehicles.hpp b/addons/explosives/CfgVehicles.hpp index 91a708beb87..bf3eb1b12bd 100644 --- a/addons/explosives/CfgVehicles.hpp +++ b/addons/explosives/CfgVehicles.hpp @@ -6,24 +6,24 @@ class CfgVehicles { class ACE_SelfActions { class ACE_Explosives { displayName = CSTRING(Menu); - condition = QUOTE(!(_player getVariable [ARR_2(QQGVAR(PlantingExplosive),false)])); + condition = QUOTE(!(_player getVariable [ARR_2(QQGVAR(plantingExplosive),false)])); statement = ""; exceptions[] = {"isNotSwimming", "isNotInside", "isNotSitting"}; showDisabled = 1; icon = QPATHTOF(UI\Explosives_Menu_ca.paa); - insertChildren = QUOTE([_player] call FUNC(addTransmitterActions)); + insertChildren = QUOTE(_player call FUNC(addTransmitterActions)); class ACE_Place { displayName = CSTRING(Place); statement = ""; - condition = "true"; + condition = QUOTE(true); exceptions[] = {"isNotSwimming"}; icon = QPATHTOF(UI\Place_Explosive_ca.paa); insertChildren = QUOTE(_player call FUNC(addExplosiveActions)); }; class ACE_Cellphone { displayName = CSTRING(cellphone_displayName); - condition = "('ACE_Cellphone' in (items ace_player))"; - statement = "closeDialog 0;createDialog 'Rsc_ACE_PhoneInterface';"; + condition = QUOTE([ARR_2(_player,'ACE_Cellphone')] call EFUNC(common,hasItem)); + statement = QUOTE(closeDialog 0; createDialog 'Rsc_ACE_PhoneInterface'); exceptions[] = {"isNotSwimming", "isNotInside", "isNotSitting"}; showDisabled = 0; icon = QPATHTOF(Data\UI\Cellphone_UI.paa); @@ -87,7 +87,7 @@ class CfgVehicles { displayName = CSTRING(TriggerMenu); condition = "true"; statement = ""; - insertChildren = QUOTE([ARR_3(_target getVariable QUOTE(QGVAR(class)),_target,_player)] call FUNC(addTriggerActions)); + insertChildren = QUOTE([ARR_3(_target getVariable QQGVAR(class),_target,_player)] call FUNC(addTriggerActions)); showDisabled = 0; exceptions[] = {"isNotSwimming"}; icon = QPATHTOF(UI\Explosives_Menu_ca.paa); @@ -96,7 +96,7 @@ class CfgVehicles { selection = ""; displayName = CSTRING(Pickup); condition = "true"; - statement = QUOTE([ARR_2(_player,_target getVariable QUOTE(QGVAR(class)))] call EFUNC(common,addToInventory);deleteVehicle _target;); + statement = QUOTE([ARR_2(_player,_target getVariable QQGVAR(class))] call EFUNC(common,addToInventory); deleteVehicle _target); showDisabled = 0; exceptions[] = {"isNotSwimming"}; icon = "\A3\ui_f\data\IGUI\Cfg\Actions\Obsolete\ui_action_takemine_ca.paa"; @@ -106,60 +106,60 @@ class CfgVehicles { }; class ACE_Explosives_Place_DemoCharge: ACE_Explosives_Place { - displayName = "Demo Charge"; + displayName = "$STR_A3_cfgMagazines_DemoCharge0"; model = "\A3\Weapons_F\explosives\c4_charge_small_d"; class ACE_Actions: ACE_Actions { class ACE_MainActions: ACE_MainActions { - position = "[-0.07,0,0.055]"; + position = "[-0.07, 0, 0.055]"; }; }; }; class ACE_Explosives_Place_APERSBoundingMine: ACE_Explosives_Place { - displayName = "APERS Bounding Mine"; + displayName = "$STR_A3_cfgMagazines_BouncingMineRangeMagazine0"; model = "\A3\Weapons_F\explosives\mine_AP_bouncing"; }; class ACE_Explosives_Place_APERSMine: ACE_Explosives_Place { - displayName = "APERS Mine"; + displayName = "$STR_A3_cfgMagazines_ClassicMineRangeMagazine0"; model = "\A3\Weapons_F\explosives\mine_ap"; }; class ACE_Explosives_Place_APERSTripwireMine: ACE_Explosives_Place { - displayName = "APERS Tripwire Mine"; + displayName = "$STR_A3_cfgMagazines_ClassicMineWireMagazine0"; model = "\A3\Weapons_F\explosives\mine_AP_tripwire"; class ACE_Actions: ACE_Actions { class ACE_MainActions: ACE_MainActions { - position = "[1.415,0,0.12]"; + position = "[1.415, 0, 0.12]"; }; }; }; class ACE_Explosives_Place_ATMine: ACE_Explosives_Place { - displayName = "AT Mine"; + displayName = "$STR_A3_CfgMagazines_Mine0"; model = "\A3\Weapons_f\Explosives\mine_at"; }; class ACE_Explosives_Place_Claymore: ACE_Explosives_Place { - displayName = "Claymore"; + displayName = "$STR_A3_cfgMagazines_DirectionalMineRemoteMagazine0"; model = "\A3\Weapons_F\explosives\mine_AP_miniclaymore"; class ACE_Actions: ACE_Actions { class ACE_MainActions: ACE_MainActions { - position = "[0,0,0.038]"; + position = "[0, 0, 0.038]"; }; }; }; class ACE_Explosives_Place_SatchelCharge: ACE_Explosives_Place { - displayName = "Satchel Charge"; + displayName = "$STR_A3_cfgMagazines_PipeBomb0"; model = "\A3\Weapons_F\Explosives\satchel"; class ACE_Actions: ACE_Actions { class ACE_MainActions: ACE_MainActions { - position = "[-0.1,-0.1,0.05]"; + position = "[-0.1, -0.1, 0.05]"; }; }; }; // Orange DLC: class ACE_Explosives_Place_APERSMineDispenser: ACE_Explosives_Place { - displayName = "APERSMineDispenser"; + displayName = "$STR_A3_CfgMagazines_APERSMineDispenser_Mag0"; model = "\A3\Weapons_F_Orange\Explosives\APERSmineDispenser"; class ACE_Actions: ACE_Actions { class ACE_MainActions: ACE_MainActions { @@ -168,7 +168,7 @@ class CfgVehicles { }; }; class ACE_Explosives_Place_TrainingMine: ACE_Explosives_Place { - displayName = "TrainingMine"; + displayName = "$STR_A3_CfgMagazines_TrainingMine_Mag0"; model = "\A3\Weapons_F_Orange\Explosives\TrainingMine_F"; class ACE_Actions: ACE_Actions { class ACE_MainActions: ACE_MainActions { @@ -179,28 +179,28 @@ class CfgVehicles { class ACE_Explosives_Place_SLAM: ACE_Explosives_Place { - displayName = "SLAM"; + displayName = "$STR_A3_cfgMagazines_DirectionalMineRangeMagazine0"; model = "\A3\Weapons_F\Explosives\mine_SLAM_directional"; }; // IEDs class ACE_Explosives_Place_IEDUrbanBig: ACE_Explosives_Place { - displayName = "IED Urban Big"; + displayName = "$STR_A3_CfgVehicles_IEDUrbanBig_F"; model = "\A3\Weapons_F\Explosives\IED_urban_big"; }; class ACE_Explosives_Place_IEDLandBig: ACE_Explosives_Place { - displayName = "IED Land Big"; + displayName = "$STR_A3_CfgVehicles_IEDLandBig_F"; model = "\A3\Weapons_F\Explosives\IED_land_big"; }; class ACE_Explosives_Place_IEDUrbanSmall: ACE_Explosives_Place { - displayName = "IED Urban Small"; + displayName = "$STR_A3_CfgVehicles_IEDUrbanSmall_F"; model = "\A3\Weapons_F\Explosives\IED_urban_small"; }; class ACE_Explosives_Place_IEDLandSmall: ACE_Explosives_Place { - displayName = "IED Land Small"; + displayName = "$STR_A3_CfgVehicles_IEDLandSmall_F"; model = "\A3\Weapons_F\Explosives\IED_land_small"; }; @@ -364,7 +364,6 @@ class CfgVehicles { author = ECSTRING(common,aceteam); ammo = "ACE_SLAMDirectionalMine_Magnetic_Ammo"; displayName = CSTRING(Module_SLAMBottomAttack_DisplayName); - // TODO: Find a way to place the mine laying down instead of standing up }; class APERSTripMine: MineBase {}; @@ -374,6 +373,18 @@ class CfgVehicles { displayName = CSTRING(TripFlare_Name); }; + class Claymore_F: MineBase { + ammo = "ACE_ClaymoreDirectionalMine_Remote_Ammo"; + }; + + class APERSBoundingMine: MineBase { + ammo = "ACE_APERSBoundingMine_Range_Ammo"; + }; + + class DemoCharge_F: MineBase { + ammo = "ACE_DemoCharge_Remote_Ammo"; + }; + class IEDUrbanBig_F; class ACE_IEDUrbanBig_Range: IEDUrbanBig_F { author = ECSTRING(common,aceteam); diff --git a/addons/explosives/CfgWeapons.hpp b/addons/explosives/CfgWeapons.hpp index 30e1fb95cbb..5c81cb9aec0 100644 --- a/addons/explosives/CfgWeapons.hpp +++ b/addons/explosives/CfgWeapons.hpp @@ -12,8 +12,7 @@ class CfgWeapons { class CBA_MiscItem_ItemInfo; class ACE_ExplosiveItem: CBA_MiscItem_ItemInfo { - allowedSlots[] = {TYPE_UNIFORM,TYPE_VEST,TYPE_BACKPACK}; - //type = 201; + allowedSlots[] = {TYPE_UNIFORM, TYPE_VEST, TYPE_BACKPACK}; }; class ACE_Clacker: ACE_ItemCore { @@ -23,8 +22,8 @@ class CfgWeapons { descriptionShort = CSTRING(clacker_description); picture = QPATHTOF(Data\UI\Clacker.paa); model = QPATHTOF(data\ace_m57.p3d); - GVAR(Range) = 250; - GVAR(Detonator) = 1; + GVAR(range) = 250; + GVAR(detonator) = 1; GVAR(triggerType) = "Command"; ACE_isTool = 1; @@ -37,7 +36,7 @@ class CfgWeapons { author = ECSTRING(common,ACETeam); displayName = CSTRING(M152_Clacker_displayName); picture = QPATHTOF(Data\UI\MK26_Transmitter_ca.paa); - GVAR(Range) = 5000; + GVAR(range) = 5000; GVAR(triggerType) = "MK16_Transmitter"; }; class ACE_DefusalKit: ACE_ItemCore { @@ -47,8 +46,8 @@ class CfgWeapons { descriptionShort = CSTRING(DefusalKit_description); picture = QPATHTOF(Data\UI\Pliers.paa); model = "\A3\Structures_F\Items\Tools\Pliers_F.p3d"; - ACE_isTool = 1; GVAR(defusalKit) = 1; + ACE_isTool = 1; class ItemInfo: ACE_ExplosiveItem { mass = 5; @@ -62,8 +61,8 @@ class CfgWeapons { descriptionShort = CSTRING(DeadManSwitch_description); picture = QPATHTOF(Data\UI\DeadmanSwitch.paa); model = "\A3\weapons_F\ammo\mag_univ.p3d"; - GVAR(Range) = 100; - GVAR(Detonator) = 1; + GVAR(range) = 100; + GVAR(detonator) = 1; GVAR(triggerType) = "DeadManSwitch"; ACE_isTool = 1; @@ -79,8 +78,8 @@ class CfgWeapons { descriptionShort = CSTRING(cellphone_description); picture = QPATHTOF(Data\UI\Cellphone_UI.paa); model = "\A3\weapons_F\ammo\mag_univ.p3d"; - GVAR(Range) = 15000; - GVAR(Detonator) = 1; + GVAR(range) = 15000; + GVAR(detonator) = 1; GVAR(triggerType) = "Cellphone"; ACE_isTool = 1; diff --git a/addons/explosives/ExplosivesUI.hpp b/addons/explosives/ExplosivesUI.hpp index ef32c0c04b6..1b14ba5e887 100644 --- a/addons/explosives/ExplosivesUI.hpp +++ b/addons/explosives/ExplosivesUI.hpp @@ -12,10 +12,10 @@ class Rsc_ACE_CallScreen_Edit: RscEdit { text = ""; style = "0x00 + 0x40 + 0x200"; shadow = 1; - SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 20) * 1)"; - x = "0.288594 * safezoneW + safezoneX"; - w = "0.0825 * safezoneW"; - h = "0.044 * safezoneH"; + SizeEx = "(((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 20) * 1)"; + x = "0.288594 * safeZoneW + safeZoneX"; + w = "0.0825 * safeZoneW"; + h = "0.044 * safeZoneH"; }; class Rsc_ACE_HiddenButton: RscButton { colorText[] = {0, 0, 0, 0}; @@ -40,175 +40,175 @@ class Rsc_ACE_PhoneInterface { class RscPicture_1200: RscPicture { idc = 1200; text = QPATHTOF(Data\UI\Cellphone_Background.paa); - x = "0.231875 * safezoneW + safezoneX"; - y = "0.104 * safezoneH + safezoneY"; - w = "0.195937 * safezoneW"; - h = "0.704 * safezoneH"; + x = "0.231875 * safeZoneW + safeZoneX"; + y = "0.104 * safeZoneH + safeZoneY"; + w = "0.195937 * safeZoneW"; + h = "0.704 * safeZoneH"; }; class numkey_1: Rsc_ACE_NumKeyButton { idc = 1600; - x = "0.278281 * safezoneW + safezoneX"; - y = "0.533 * safezoneH + safezoneY"; - w = "0.0309375 * safezoneW"; - h = "0.033 * safezoneH"; + x = "0.278281 * safeZoneW + safeZoneX"; + y = "0.533 * safeZoneH + safeZoneY"; + w = "0.0309375 * safeZoneW"; + h = "0.033 * safeZoneH"; tooltip = "1"; action = "ctrlSetText [1400,((ctrlText 1400) + '1')];"; }; class numkey_2: Rsc_ACE_NumKeyButton { idc = 1601; - x = "0.314375 * safezoneW + safezoneX"; - y = "0.533 * safezoneH + safezoneY"; - w = "0.0309375 * safezoneW"; - h = "0.033 * safezoneH"; + x = "0.314375 * safeZoneW + safeZoneX"; + y = "0.533 * safeZoneH + safeZoneY"; + w = "0.0309375 * safeZoneW"; + h = "0.033 * safeZoneH"; tooltip = "2"; action = "ctrlSetText [1400,((ctrlText 1400) + '2')];"; }; class numkey_3: Rsc_ACE_NumKeyButton { idc = 1602; - x = "0.350469 * safezoneW + safezoneX"; - y = "0.533 * safezoneH + safezoneY"; - w = "0.0309375 * safezoneW"; - h = "0.033 * safezoneH"; + x = "0.350469 * safeZoneW + safeZoneX"; + y = "0.533 * safeZoneH + safeZoneY"; + w = "0.0309375 * safeZoneW"; + h = "0.033 * safeZoneH"; tooltip = "3"; action = "ctrlSetText [1400,((ctrlText 1400) + '3')];"; }; class numkey_4: Rsc_ACE_NumKeyButton { idc = 1603; - x = "0.278281 * safezoneW + safezoneX"; - y = "0.577 * safezoneH + safezoneY"; - w = "0.0309375 * safezoneW"; - h = "0.033 * safezoneH"; + x = "0.278281 * safeZoneW + safeZoneX"; + y = "0.577 * safeZoneH + safeZoneY"; + w = "0.0309375 * safeZoneW"; + h = "0.033 * safeZoneH"; tooltip = "4"; action = "ctrlSetText [1400,((ctrlText 1400) + '4')];"; }; class numkey_5: Rsc_ACE_NumKeyButton { idc = 1604; - x = "0.314375 * safezoneW + safezoneX"; - y = "0.577 * safezoneH + safezoneY"; - w = "0.0309375 * safezoneW"; - h = "0.033 * safezoneH"; + x = "0.314375 * safeZoneW + safeZoneX"; + y = "0.577 * safeZoneH + safeZoneY"; + w = "0.0309375 * safeZoneW"; + h = "0.033 * safeZoneH"; tooltip = "5"; action = "ctrlSetText [1400,((ctrlText 1400) + '5')];"; }; class numkey_6: Rsc_ACE_NumKeyButton { idc = 1605; - x = "0.350469 * safezoneW + safezoneX"; - y = "0.577 * safezoneH + safezoneY"; - w = "0.0309375 * safezoneW"; - h = "0.033 * safezoneH"; + x = "0.350469 * safeZoneW + safeZoneX"; + y = "0.577 * safeZoneH + safeZoneY"; + w = "0.0309375 * safeZoneW"; + h = "0.033 * safeZoneH"; tooltip = "6"; action = "ctrlSetText [1400,((ctrlText 1400) + '6')];"; }; class numkey_7: Rsc_ACE_NumKeyButton { idc = 1606; - x = "0.278281 * safezoneW + safezoneX"; - y = "0.621 * safezoneH + safezoneY"; - w = "0.0309375 * safezoneW"; - h = "0.033 * safezoneH"; + x = "0.278281 * safeZoneW + safeZoneX"; + y = "0.621 * safeZoneH + safeZoneY"; + w = "0.0309375 * safeZoneW"; + h = "0.033 * safeZoneH"; tooltip = "7"; action = "ctrlSetText [1400,((ctrlText 1400) + '7')];"; }; class numkey_8: Rsc_ACE_NumKeyButton { idc = 1607; - x = "0.314375 * safezoneW + safezoneX"; - y = "0.621 * safezoneH + safezoneY"; - w = "0.0309375 * safezoneW"; - h = "0.033 * safezoneH"; + x = "0.314375 * safeZoneW + safeZoneX"; + y = "0.621 * safeZoneH + safeZoneY"; + w = "0.0309375 * safeZoneW"; + h = "0.033 * safeZoneH"; tooltip = "8"; action = "ctrlSetText [1400,((ctrlText 1400) + '8')];"; }; class numkey_9: Rsc_ACE_NumKeyButton { idc = 1608; - x = "0.350469 * safezoneW + safezoneX"; - y = "0.621 * safezoneH + safezoneY"; - w = "0.0309375 * safezoneW"; - h = "0.033 * safezoneH"; + x = "0.350469 * safeZoneW + safeZoneX"; + y = "0.621 * safeZoneH + safeZoneY"; + w = "0.0309375 * safeZoneW"; + h = "0.033 * safeZoneH"; tooltip = "9"; action = "ctrlSetText [1400,((ctrlText 1400) + '9')];"; }; class numkey_0: Rsc_ACE_NumKeyButton { idc = 1609; - x = "0.314375 * safezoneW + safezoneX"; - y = "0.676 * safezoneH + safezoneY"; - w = "0.0309375 * safezoneW"; - h = "0.033 * safezoneH"; + x = "0.314375 * safeZoneW + safeZoneX"; + y = "0.676 * safeZoneH + safeZoneY"; + w = "0.0309375 * safeZoneW"; + h = "0.033 * safeZoneH"; tooltip = "0"; action = "ctrlSetText [1400,((ctrlText 1400) + '0')];"; }; class speedDialAdd: Rsc_ACE_NumKeyButton { idc = 1610; - x = "0.278281 * safezoneW + safezoneX"; - y = "0.676 * safezoneH + safezoneY"; - w = "0.0309375 * safezoneW"; - h = "0.033 * safezoneH"; + x = "0.278281 * safeZoneW + safeZoneX"; + y = "0.676 * safeZoneH + safeZoneY"; + w = "0.0309375 * safeZoneW"; + h = "0.033 * safeZoneH"; tooltip = CSTRING(Phone_AddToSpeedDial); action = QUOTE([ARR_2(ctrlText 1401,ctrlText 1400)] call FUNC(addToSpeedDial)); }; class clear: Rsc_ACE_HiddenButton { idc = 1610; - x = "0.278281 * safezoneW + safezoneX"; - y = "0.445 * safezoneH + safezoneY"; - w = "0.020625 * safezoneW"; - h = "0.033 * safezoneH"; + x = "0.278281 * safeZoneW + safeZoneX"; + y = "0.445 * safeZoneH + safeZoneY"; + w = "0.020625 * safeZoneW"; + h = "0.033 * safeZoneH"; tooltip = CSTRING(Clear); action = QUOTE(ctrlSetText [ARR_2(1400,'')];[ctrlText 1401] call FUNC(removeFromSpeedDial);ctrlSetText [ARR_2(1401,'')];); }; class dial: Rsc_ACE_HiddenButton { idc = 1611; - x = "0.309219 * safezoneW + safezoneX"; - y = "0.445 * safezoneH + safezoneY"; - w = "0.04125 * safezoneW"; - h = "0.033 * safezoneH"; + x = "0.309219 * safeZoneW + safeZoneX"; + y = "0.445 * safeZoneH + safeZoneY"; + w = "0.04125 * safeZoneW"; + h = "0.033 * safeZoneH"; tooltip = CSTRING(Phone_Dial); action = QUOTE([ARR_2(ace_player,ctrlText 1400)] call FUNC(dialPhone)); }; class up: Rsc_ACE_HiddenButton { idc = 1612; - x = "0.360781 * safezoneW + safezoneX"; - y = "0.445 * safezoneH + safezoneY"; - w = "0.020625 * safezoneW"; - h = "0.033 * safezoneH"; + x = "0.360781 * safeZoneW + safeZoneX"; + y = "0.445 * safeZoneH + safeZoneY"; + w = "0.020625 * safeZoneW"; + h = "0.033 * safeZoneH"; tooltip = CSTRING(Phone_Up); action = QUOTE([true] call FUNC(setSpeedDial)); }; class down: Rsc_ACE_HiddenButton { idc = 1613; - x = "0.345312 * safezoneW + safezoneX"; - y = "0.485 * safezoneH + safezoneY"; - w = "0.020625 * safezoneW"; - h = "0.033 * safezoneH"; + x = "0.345312 * safeZoneW + safeZoneX"; + y = "0.485 * safeZoneH + safeZoneY"; + w = "0.020625 * safeZoneW"; + h = "0.033 * safeZoneH"; tooltip = CSTRING(Phone_Down); action = QUOTE([false] call FUNC(setSpeedDial)); }; class speedDial_Text: RscText { idc = 1405; - y = "0.302 * safezoneH + safezoneY"; - SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 22) * 1)"; - x = "0.288594 * safezoneW + safezoneX"; - w = "0.0825 * safezoneW"; - h = "0.044 * safezoneH"; + y = "0.302 * safeZoneH + safeZoneY"; + SizeEx = "(((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 22) * 1)"; + x = "0.288594 * safeZoneW + safeZoneX"; + w = "0.0825 * safeZoneW"; + h = "0.044 * safeZoneH"; text = "Name"; }; class speedDial_edit: Rsc_ACE_CallScreen_Edit { idc = 1401; - y = "0.302 * safezoneH + safezoneY"; - x = "0.318 * safezoneW + safezoneX"; + y = "0.302 * safeZoneH + safeZoneY"; + x = "0.318 * safeZoneW + safeZoneX"; w = "0.1"; }; class numberEdit_Text: RscText { idc = 1406; - y = "0.348 * safezoneH + safezoneY"; - SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 22) * 1)"; - x = "0.288594 * safezoneW + safezoneX"; - w = "0.0825 * safezoneW"; - h = "0.044 * safezoneH"; + y = "0.348 * safeZoneH + safeZoneY"; + SizeEx = "(((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 22) * 1)"; + x = "0.288594 * safeZoneW + safeZoneX"; + w = "0.0825 * safeZoneW"; + h = "0.044 * safeZoneH"; text = "#"; }; class number_edit: Rsc_ACE_CallScreen_Edit { canModify = 0; idc = 1400; - y = "0.348 * safezoneH + safezoneY"; - x = "0.3 * safezoneW + safezoneX"; + y = "0.348 * safeZoneH + safeZoneY"; + x = "0.3 * safeZoneW + safeZoneX"; }; }; }; diff --git a/addons/explosives/XEH_postInit.sqf b/addons/explosives/XEH_postInit.sqf index 81ab1b54069..4331ba3596c 100644 --- a/addons/explosives/XEH_postInit.sqf +++ b/addons/explosives/XEH_postInit.sqf @@ -22,9 +22,8 @@ _this call FUNC(setPosition); if (isServer) then { - if (missionNamespace getVariable [QGVAR(setShotParents), true]) then { - _explosive setShotParents [_unit, _unit]; - }; + private _owner = [objNull, _unit] select (missionNamespace getVariable [QGVAR(setShotParents), false]); + _explosive setShotParents [_owner, _unit]; }; }] call CBA_fnc_addEventHandler; [QGVAR(startDefuse), LINKFUNC(startDefuse)] call CBA_fnc_addEventHandler; @@ -35,14 +34,13 @@ if (isServer) then { [QGVAR(detonate), { params ["_unit", "_explosive", "_delay"]; TRACE_3("server detonate EH",_unit,_explosive,_delay); - if (missionNamespace getVariable [QGVAR(setShotParents), true]) then { - _explosive setShotParents [_unit, _unit]; - }; + private _owner = [objNull, _unit] select (missionNamespace getVariable [QGVAR(setShotParents), false]); + _explosive setShotParents [_owner, _unit]; [{ params ["_explosive"]; TRACE_1("exploding",_explosive); if (!isNull _explosive) then { - _explosive setDamage 1; + [QEGVAR(common,triggerAmmo), _explosive, _explosive] call CBA_fnc_targetEvent; }; }, _explosive, _delay] call CBA_fnc_waitAndExecute; }] call CBA_fnc_addEventHandler; @@ -53,6 +51,14 @@ if (isServer) then { TRACE_1("Knocked Out, Doing Deadman",_unit); [_unit] call FUNC(onIncapacitated); }] call CBA_fnc_addEventHandler; + + // Orient all Editor-placed SLAM (Bottom attack) mines facing upward + { + private _mine = _x; + if (typeOf _mine == "ACE_SLAMDirectionalMine_Magnetic_Ammo") then { + [_mine, MINE_PITCH_UP, 0] call CALLSTACK(BIS_fnc_setPitchBank); + }; + } forEach allMines; }; if (!hasInterface) exitWith {}; diff --git a/addons/explosives/config.cpp b/addons/explosives/config.cpp index b60186ab684..00909533ac9 100644 --- a/addons/explosives/config.cpp +++ b/addons/explosives/config.cpp @@ -32,6 +32,7 @@ class RscEdit; class RscPicture; class RscButton; class ctrlXSliderH; + #include "ExplosivesUI.hpp" #include "TimerDialog.hpp" #include "GUI_VirtualAmmo.hpp" @@ -53,9 +54,15 @@ class CfgActions { }; class CfgMineTriggers { - class RangeTrigger; - class ACE_MagneticTrigger: RangeTrigger { - mineMagnetic = 1; - mineTriggerRange = 1; + class IRTrigger; + class ACE_MagneticTrigger: IRTrigger { + mineWireEnd[] = {0,0.1,0.5}; + }; + + class TankTriggerMagnetic; + class ACE_TankTriggerLight: TankTriggerMagnetic { + // Reduce mass needed to trigger vanilla AT Mine to realistic levels (https://en.wikipedia.org/wiki/M15_mine#Specifications). + // Will now trigger for any vehicle heavier than the Vanilla ATV (280kg) + mineTriggerMass = 300; // Default: 7000 }; }; diff --git a/addons/explosives/dev/test_magazines.sqf b/addons/explosives/dev/test_magazines.sqf index ca9744f08da..afd091b24c4 100644 --- a/addons/explosives/dev/test_magazines.sqf +++ b/addons/explosives/dev/test_magazines.sqf @@ -5,20 +5,24 @@ INFO("--- Checking Explosive Mags ---"); private _explosivesMags = compatibleMagazines "Put"; private _setupHash = createHashMap; + { private _mag = _x; private _cfg = configFile >> "CfgMagazines" >> _mag; private _scope = getNumber (_cfg >> "scope"); - private _setupObject = getText (_cfg >> QGVAR(SetupObject)); + private _setupObject = getText (_cfg >> QGVAR(setupObject)); + if (_setupObject == "") then { WARNING_2("[%1](scope %2) has no setupObject",_mag,_scope); - continue + continue; }; + if (!isClass (configFile >> "CfgVehicles" >> _setupObject)) then { ERROR_2("[%1](scope %2) has invalid setup object",_mag,_scope); }; - if ((((_setupHash getOrDefault [_setupObject, [], true]) pushBack _mag) > 0)) then { + + if (((_setupHash getOrDefault [_setupObject, [], true]) pushBack _mag) > 0) then { INFO_2("[%1] setupObject has multiple mags %2",_setupObject,_setupHash get _setupObject); }; } forEach _explosivesMags; diff --git a/addons/explosives/functions/fnc_addClacker.sqf b/addons/explosives/functions/fnc_addClacker.sqf index 794aec0a107..ace01a15265 100644 --- a/addons/explosives/functions/fnc_addClacker.sqf +++ b/addons/explosives/functions/fnc_addClacker.sqf @@ -34,7 +34,7 @@ private _detonators = [_unit] call FUNC(getDetonators); } forEach _requiredItems; if !(_hasRequired) exitWith {}; -private _config = ConfigFile >> "CfgMagazines" >> _magazineClass >> "ACE_Triggers" >> configName _config; +private _config = configFile >> "CfgMagazines" >> _magazineClass >> "ACE_Triggers" >> configName _config; private _clacker = _unit getVariable [QGVAR(Clackers), []]; GVAR(PlacedCount) = GVAR(PlacedCount) + 1; diff --git a/addons/explosives/functions/fnc_addDetonateActions.sqf b/addons/explosives/functions/fnc_addDetonateActions.sqf index d950278c357..2e99f2bd4f0 100644 --- a/addons/explosives/functions/fnc_addDetonateActions.sqf +++ b/addons/explosives/functions/fnc_addDetonateActions.sqf @@ -19,16 +19,16 @@ params ["_unit", "_detonator"]; TRACE_2("params",_unit,_detonator); -private _range = getNumber (ConfigFile >> "CfgWeapons" >> _detonator >> QGVAR(Range)); +private _range = getNumber (configFile >> "CfgWeapons" >> _detonator >> QGVAR(Range)); private _result = [_unit] call FUNC(getPlacedExplosives); private _children = []; private _explosivesList = []; { if (!isNull(_x select 0)) then { - private _required = getArray (ConfigFile >> "ACE_Triggers" >> (_x select 4) >> "requires"); + private _required = getArray (configFile >> "ACE_Triggers" >> (_x select 4) >> "requires"); if (_detonator in _required) then { - private _item = ConfigFile >> "CfgMagazines" >> (_x select 3); + private _item = configFile >> "CfgMagazines" >> (_x select 3); _explosivesList pushBack _x; @@ -92,19 +92,6 @@ if (_detonator != "ACE_DeadManSwitch") then { ]; }; } else { - //Add action to detonate all explosives (including the inventory explosive): - _children pushBack [ - [ - "Explosive_All_Deadman", - LLSTRING(DetonateAll), - getText (configFile >> "CfgWeapons" >> _detonator >> "picture"), - {[_player] call FUNC(onIncapacitated)}, - {true} - ] call EFUNC(interact_menu,createAction), - [], - _unit - ]; - //Adds actions for the explosives you can connect to the deadman switch. private _connectedInventoryExplosive = _unit getVariable [QGVAR(deadmanInvExplosive), ""]; if ((_connectedInventoryExplosive != "") && {!(_connectedInventoryExplosive in (magazines _unit))}) then { @@ -113,14 +100,26 @@ if (_detonator != "ACE_DeadManSwitch") then { }; _connectedInventoryExplosive = _unit getVariable [QGVAR(deadmanInvExplosive), ""]; + + //Add action to detonate all explosives (including the inventory explosive): + if (_connectedInventoryExplosive != "" || {count _explosivesList > 1}) then { + _children pushBack [ + [ + "Explosive_All_Deadman", + LLSTRING(DetonateAll), + getText (configFile >> "CfgWeapons" >> _detonator >> "picture"), + {[_player] call FUNC(onIncapacitated)}, + {true} + ] call EFUNC(interact_menu,createAction), + [], + _unit + ]; + }; + if (_connectedInventoryExplosive != "") then { //Add the disconnect action private _magConfig = configFile >> "CfgMagazines" >> _connectedInventoryExplosive; - private _name = if ((getText (_magConfig >> "displayNameShort")) != "") then { - getText (_magConfig >> "displayNameShort") - } else { - getText(_magConfig >> "displayName") - }; + private _name = getText (_magConfig >> "displayName"); private _picture = getText (_magConfig >> "picture"); _children pushBack [ @@ -149,11 +148,7 @@ if (_detonator != "ACE_DeadManSwitch") then { private _magConfig = configFile >> "CfgMagazines" >> _mag; private _supportedTriggers = getArray (_magConfig >> "ACE_Triggers" >> "SupportedTriggers"); if (({_x == "DeadmanSwitch"} count _supportedTriggers) == 1) then { //case insensitive search - private _name = if ((getText (_magConfig >> "displayNameShort")) != "") then { - getText (_magConfig >> "displayNameShort") - } else { - getText(_magConfig >> "displayName") - }; + private _name = getText (_magConfig >> "displayName"); private _picture = getText (_magConfig >> "picture"); _children pushBack [ @@ -162,6 +157,7 @@ if (_detonator != "ACE_DeadManSwitch") then { format [localize LSTRING(connectInventoryExplosiveToDeadman), _name], _picture, { + //IGNORE_PRIVATE_WARNING ["_player"]; params ["_player", "", "_mag"]; TRACE_2("set new",_player,_mag); _player setVariable [QGVAR(deadmanInvExplosive), _mag, true]; diff --git a/addons/explosives/functions/fnc_addExplosiveActions.sqf b/addons/explosives/functions/fnc_addExplosiveActions.sqf index 480ecd27012..6276e48afe6 100644 --- a/addons/explosives/functions/fnc_addExplosiveActions.sqf +++ b/addons/explosives/functions/fnc_addExplosiveActions.sqf @@ -27,11 +27,8 @@ { private _config = _cfgMagazines >> _x; if (getNumber (_config >> QGVAR(Placeable)) == 1) then { - private _name = getText (_config >> "displayNameShort"); + private _name = getText (_config >> "displayName"); private _picture = getText (_config >> "picture"); - if (_name isEqualTo "") then { - _name = getText (_config >> "displayName"); - }; private _action = [_x, format ["%1 (%2)", _name, _totalCount - count (_magazines - [_x])], _picture, {[{_this call FUNC(setupExplosive)}, _this] call CBA_fnc_execNextFrame}, {true}, {}, _x] call EFUNC(interact_menu,createAction); _actions pushBack [_action, [], _player]; diff --git a/addons/explosives/functions/fnc_addTransmitterActions.sqf b/addons/explosives/functions/fnc_addTransmitterActions.sqf index 043c9db661f..d225aeda056 100644 --- a/addons/explosives/functions/fnc_addTransmitterActions.sqf +++ b/addons/explosives/functions/fnc_addTransmitterActions.sqf @@ -21,7 +21,7 @@ TRACE_1("params",_unit); private _detonators = [_unit] call FUNC(getDetonators); private _children = []; { - private _config = ConfigFile >> "CfgWeapons" >> _x; + private _config = configFile >> "CfgWeapons" >> _x; _children pushBack [ [ diff --git a/addons/explosives/functions/fnc_addTriggerActions.sqf b/addons/explosives/functions/fnc_addTriggerActions.sqf index b6b6e0ce415..8be63fbc4f9 100644 --- a/addons/explosives/functions/fnc_addTriggerActions.sqf +++ b/addons/explosives/functions/fnc_addTriggerActions.sqf @@ -22,7 +22,7 @@ TRACE_2("params",_magazine,_explosive); private _isAttached = !isNull (attachedTo _explosive); private _detonators = [ACE_player] call FUNC(getDetonators); private _triggerTypes = [_magazine] call FUNC(triggerType); -private _magTriggers = ConfigFile >> "CfgMagazines" >> _magazine >> "ACE_Triggers"; +private _magTriggers = configFile >> "CfgMagazines" >> _magazine >> "ACE_Triggers"; private _children = []; { private _required = getArray (_x >> "requires"); diff --git a/addons/explosives/functions/fnc_defuseExplosive.sqf b/addons/explosives/functions/fnc_defuseExplosive.sqf index 049fff88469..1c8b687c8f3 100644 --- a/addons/explosives/functions/fnc_defuseExplosive.sqf +++ b/addons/explosives/functions/fnc_defuseExplosive.sqf @@ -19,7 +19,7 @@ params ["_unit", "_explosive"]; TRACE_2("params",_unit,_explosive); -if (GVAR(ExplodeOnDefuse) && {(random 1.0) < (getNumber (ConfigFile >> "CfgAmmo" >> typeOf _explosive >> QGVAR(explodeOnDefuseChance)))}) exitWith { +if (GVAR(ExplodeOnDefuse) && {(random 1.0) < (getNumber (configFile >> "CfgAmmo" >> typeOf _explosive >> QGVAR(explodeOnDefuseChance)))}) exitWith { TRACE_1("exploding on defuse",_explosive); [_unit, -1, [_explosive, 1], "#ExplodeOnDefuse"] call FUNC(detonateExplosive); [QGVAR(explodeOnDefuse), [_explosive, _unit]] call CBA_fnc_globalEvent; diff --git a/addons/explosives/functions/fnc_detonateExplosive.sqf b/addons/explosives/functions/fnc_detonateExplosive.sqf index 5e276745b59..e9ad9856fba 100644 --- a/addons/explosives/functions/fnc_detonateExplosive.sqf +++ b/addons/explosives/functions/fnc_detonateExplosive.sqf @@ -31,25 +31,9 @@ private _result = true; if !([_unit, _range, _item select 0, _item select 1, _triggerClassname] call FUNC(checkDetonateHandlers)) exitWith {false}; -if (getNumber (ConfigFile >> "CfgAmmo" >> typeOf (_item select 0) >> "TriggerWhenDestroyed") == 0) then { - private _previousExp = _item select 0; - private _exp = getText (ConfigFile >> "CfgAmmo" >> typeOf (_previousExp) >> QGVAR(Explosive)); - if (_exp != "") then { - _exp = createVehicle [_exp, [0,0,15001], [], 0, "NONE"]; - _exp setDir (getDir _previousExp); - _item set [0, _exp]; - private _pos = getPosASL _previousExp; - deleteVehicle _previousExp; - _exp setPosASL _pos; - }; -}; - if (isNull (_item select 0)) then { WARNING_1("Explosive is null [%1]",_this); }; -if ((getNumber (configFile >> "CfgAmmo" >> (typeOf (_item select 0)) >> "triggerWhenDestroyed")) != 1) then { - WARNING_1("Explosive is not triggerWhenDestroyed [%1]",typeOf (_item select 0)); -}; [QGVAR(detonate), [_unit, _item select 0, _item select 1]] call CBA_fnc_serverEvent; diff --git a/addons/explosives/functions/fnc_getPlacedExplosives.sqf b/addons/explosives/functions/fnc_getPlacedExplosives.sqf index 867bae2275f..2e6d8840d9a 100644 --- a/addons/explosives/functions/fnc_getPlacedExplosives.sqf +++ b/addons/explosives/functions/fnc_getPlacedExplosives.sqf @@ -16,14 +16,14 @@ * * Public: Yes */ -// IGNORE_PRIVATE_WARNING(_allExplosives,_deadmanExplosives); +//IGNORE_PRIVATE_WARNING ["_allExplosives", "_deadmanExplosives"]; params ["_unit"]; TRACE_1("params",_unit); private _filter = nil; if (count _this > 1) then { - _filter = ConfigFile >> "ACE_Triggers" >> (_this select 1); + _filter = configFile >> "ACE_Triggers" >> (_this select 1); }; private _clackerList = []; private _adjustedList = false; @@ -34,7 +34,7 @@ private _list = []; _clackerList set [_forEachIndex, "X"]; _adjustedList = true; } else { - if (isNil "_filter" || {(ConfigFile >> "ACE_Triggers" >> (_x select 4)) == _filter}) then { + if (isNil "_filter" || {(configFile >> "ACE_Triggers" >> (_x select 4)) == _filter}) then { _list pushBack _x; }; }; diff --git a/addons/explosives/functions/fnc_hasPlacedExplosives.sqf b/addons/explosives/functions/fnc_hasPlacedExplosives.sqf index c697afb371a..7838a29e1bc 100644 --- a/addons/explosives/functions/fnc_hasPlacedExplosives.sqf +++ b/addons/explosives/functions/fnc_hasPlacedExplosives.sqf @@ -14,6 +14,6 @@ * * Public: Yes */ -// IGNORE_PRIVATE_WARNING(_hasPlacedExplosives); +//IGNORE_PRIVATE_WARNING ["getPlacedExplosives"]; (count (_this call FUNC(getPlacedExplosives)) > 0) diff --git a/addons/explosives/functions/fnc_onInventoryChanged.sqf b/addons/explosives/functions/fnc_onInventoryChanged.sqf index 7cf01c2a142..d5f1077dc2d 100644 --- a/addons/explosives/functions/fnc_onInventoryChanged.sqf +++ b/addons/explosives/functions/fnc_onInventoryChanged.sqf @@ -23,7 +23,7 @@ TRACE_3("params",_receiver,_giver,_item); if ((_receiver != ace_player) && {_giver != ace_player}) exitWith {}; -private _config = ConfigFile >> "CfgWeapons" >> _item; +private _config = configFile >> "CfgWeapons" >> _item; if (isClass _config && {getNumber(_config >> QGVAR(Detonator)) == 1}) then { private _clackerItems = _giver getVariable [QGVAR(Clackers), []]; _receiver setVariable [QGVAR(Clackers), (_receiver getVariable [QGVAR(Clackers), []]) + _clackerItems, true]; diff --git a/addons/explosives/functions/fnc_openTimerUI.sqf b/addons/explosives/functions/fnc_openTimerUI.sqf index 0a490a096dd..391c71b3b24 100644 --- a/addons/explosives/functions/fnc_openTimerUI.sqf +++ b/addons/explosives/functions/fnc_openTimerUI.sqf @@ -64,14 +64,14 @@ _display displayAddEventHandler ["MouseZChanged", { [{ params ["_display", "_pfhID"]; - // Make sure explosive still exists and is near player - if ((!isNull _display) && {!alive ACE_player} || {!alive GVAR(explosive)} || {(ACE_player distance GVAR(explosive)) > 5}) exitWith { - INFO_2("explosive became invalid",ACE_player,GVAR(explosive)); - closeDialog 0; + if (isNull _display || {!alive ACE_player}) exitWith { _pfhID call CBA_fnc_removePerFrameHandler; }; - if (isNull _display) exitWith { + // Make sure explosive still exists and is near player + if (!alive GVAR(explosive) || {(ACE_player distance GVAR(explosive)) > 5}) exitWith { + INFO_2("%1's explosive %2 became invalid",ACE_player,GVAR(explosive)); + closeDialog 0; _pfhID call CBA_fnc_removePerFrameHandler; }; diff --git a/addons/explosives/functions/fnc_placeExplosive.sqf b/addons/explosives/functions/fnc_placeExplosive.sqf index ec19a6f6fd9..bb6fcea6ab3 100644 --- a/addons/explosives/functions/fnc_placeExplosive.sqf +++ b/addons/explosives/functions/fnc_placeExplosive.sqf @@ -37,15 +37,15 @@ if (isNil "_triggerConfig") exitWith { objNull }; -private _magazineTrigger = ConfigFile >> "CfgMagazines" >> _magazineClass >> "ACE_Triggers" >> _triggerConfig; -_triggerConfig = ConfigFile >> "ACE_Triggers" >> _triggerConfig; +private _magazineTrigger = configFile >> "CfgMagazines" >> _magazineClass >> "ACE_Triggers" >> _triggerConfig; +_triggerConfig = configFile >> "ACE_Triggers" >> _triggerConfig; if (isNil "_triggerConfig") exitWith { ERROR_1("Config not found in PlaceExplosive: %1",_this); objNull }; -private _ammo = getText(ConfigFile >> "CfgMagazines" >> _magazineClass >> "ammo"); +private _ammo = getText(configFile >> "CfgMagazines" >> _magazineClass >> "ammo"); if (isText(_magazineTrigger >> "ammo")) then { _ammo = getText (_magazineTrigger >> "ammo"); }; diff --git a/addons/explosives/functions/fnc_selectTrigger.sqf b/addons/explosives/functions/fnc_selectTrigger.sqf index 7c7d5e58d46..0a864a77c48 100644 --- a/addons/explosives/functions/fnc_selectTrigger.sqf +++ b/addons/explosives/functions/fnc_selectTrigger.sqf @@ -20,7 +20,7 @@ params ["_explosive", "_magazine", "_trigger"]; TRACE_3("params",_explosive,_magazine,_trigger); -private _config = ConfigFile >> "ACE_Triggers" >> _trigger; +private _config = configFile >> "ACE_Triggers" >> _trigger; // Make selected trigger the active one (for keybind) if it's the first to be connected private _activeTrigger = GVAR(activeTrigger); diff --git a/addons/explosives/functions/fnc_setupExplosive.sqf b/addons/explosives/functions/fnc_setupExplosive.sqf index 918bbb0c33c..9214b999146 100644 --- a/addons/explosives/functions/fnc_setupExplosive.sqf +++ b/addons/explosives/functions/fnc_setupExplosive.sqf @@ -29,8 +29,8 @@ if (!isClass (configFile >> "CfgVehicles" >> _setupObjectClass)) exitWith {ERROR private _p3dModel = getText (configFile >> "CfgVehicles" >> _setupObjectClass >> "model"); if (_p3dModel == "") exitWith {ERROR("No Model");}; //"" - will crash game! -[_unit, "forceWalk", "ACE_Explosives", true] call EFUNC(common,statusEffect_set); -[_unit, "blockThrow", "ACE_Explosives", true] call EFUNC(common,statusEffect_set); +[_unit, "forceWalk", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); +[_unit, "blockThrow", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); //Show mouse buttons: [localize LSTRING(PlaceAction), localize LSTRING(CancelAction), localize LSTRING(ScrollAction)] call EFUNC(interaction,showMouseHint); @@ -78,7 +78,7 @@ GVAR(TweakedAngle) = 0; { private _testPos = _testBase vectorAdd [0.1 * (_x select 0) * (cos _cameraAngle), 0.1 * (_x select 0) * (sin _cameraAngle), 0.1 * (_x select 1)]; #ifdef DEBUG_MODE_FULL - drawLine3d [(eyePos _unit) call EFUNC(common,ASLToPosition), (_testPos) call EFUNC(common,ASLToPosition), [1,0,0,1]]; + drawLine3D [(eyePos _unit) call EFUNC(common,ASLToPosition), (_testPos) call EFUNC(common,ASLToPosition), [1,0,0,1]]; #endif if ((lineIntersectsSurfaces [eyePos _unit, _testPos, _unit]) isNotEqualTo []) exitWith {_return = false;}; } forEach [[0,0], [-1,-1], [1,-1], [-1,1], [1,1]]; @@ -149,8 +149,8 @@ GVAR(TweakedAngle) = 0; [_pfID] call CBA_fnc_removePerFrameHandler; GVAR(pfeh_running) = false; - [_unit, "forceWalk", "ACE_Explosives", false] call EFUNC(common,statusEffect_set); - [_unit, "blockThrow", "ACE_Explosives", false] call EFUNC(common,statusEffect_set); + [_unit, "forceWalk", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); + [_unit, "blockThrow", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); [] call EFUNC(interaction,hideMouseHint); [_unit, "DefaultAction", (_unit getVariable [QGVAR(placeActionEH), -1])] call EFUNC(common,removeActionEventHandler); [_unit, "zoomtemp", (_unit getVariable [QGVAR(cancelActionEH), -1])] call EFUNC(common,removeActionEventHandler); @@ -167,7 +167,7 @@ GVAR(TweakedAngle) = 0; if (isNull _attachVehicle) then { _placeAngle = _cameraAngle - GVAR(TweakedAngle) + 180; - _expSetupVehicle setPosAsl _virtualPosASL; + _expSetupVehicle setPosASL _virtualPosASL; _expSetupVehicle setDir _placeAngle; _placeAngle = _placeAngle + 180; //CfgAmmos seem to be 180 for some reason } else { diff --git a/addons/explosives/functions/fnc_startDefuse.sqf b/addons/explosives/functions/fnc_startDefuse.sqf index e023592547c..ef3efac885f 100644 --- a/addons/explosives/functions/fnc_startDefuse.sqf +++ b/addons/explosives/functions/fnc_startDefuse.sqf @@ -25,8 +25,8 @@ private _fnc_DefuseTime = { params ["_specialist", "_target"]; TRACE_2("defuseTime",_specialist,_target); private _defuseTime = 5; - if (isNumber(ConfigFile >> "CfgAmmo" >> typeOf (_target) >> QGVAR(DefuseTime))) then { - _defuseTime = getNumber(ConfigFile >> "CfgAmmo" >> typeOf (_target) >> QGVAR(DefuseTime)); + if (isNumber(configFile >> "CfgAmmo" >> typeOf (_target) >> QGVAR(DefuseTime))) then { + _defuseTime = getNumber(configFile >> "CfgAmmo" >> typeOf (_target) >> QGVAR(DefuseTime)); }; if (!_specialist && {GVAR(PunishNonSpecialists)}) then { _defuseTime = _defuseTime * 1.5; @@ -34,7 +34,7 @@ private _fnc_DefuseTime = { _defuseTime }; private _actionToPlay = "MedicOther"; -if (STANCE _unit == "Prone") then { +if (stance _unit == "Prone") then { _actionToPlay = "PutDown"; }; diff --git a/addons/explosives/functions/fnc_triggerType.sqf b/addons/explosives/functions/fnc_triggerType.sqf index 0fba459491b..aa890c049f2 100644 --- a/addons/explosives/functions/fnc_triggerType.sqf +++ b/addons/explosives/functions/fnc_triggerType.sqf @@ -19,10 +19,10 @@ params ["_magazineClassname"]; TRACE_1("params",_magazineClassname); private _result = []; -private _config = getArray (ConfigFile >> "CfgMagazines" >> _magazineClassname >> "ACE_Triggers" >> "SupportedTriggers"); +private _config = getArray (configFile >> "CfgMagazines" >> _magazineClassname >> "ACE_Triggers" >> "SupportedTriggers"); private _count = count _config; for "_index" from 0 to (_count - 1) do { - _result set [_index, ConfigFile >> "ACE_Triggers" >> (_config select _index)]; + _result set [_index, configFile >> "ACE_Triggers" >> (_config select _index)]; }; _result diff --git a/addons/explosives/initSettings.inc.sqf b/addons/explosives/initSettings.inc.sqf index bdbd488550d..baa38f0d8f9 100644 --- a/addons/explosives/initSettings.inc.sqf +++ b/addons/explosives/initSettings.inc.sqf @@ -6,7 +6,7 @@ private _categoryStr = format ["ACE %1", LLSTRING(Menu)]; [LLSTRING(RequireSpecialist_DisplayName),LLSTRING(RequireSpecialist_Description)], _categoryStr, false, - true + 1 ] call CBA_fnc_addSetting; [ @@ -15,7 +15,7 @@ private _categoryStr = format ["ACE %1", LLSTRING(Menu)]; [LLSTRING(PunishNonSpecialists_DisplayName),LLSTRING(PunishNonSpecialists_Description)], _categoryStr, true, - true + 1 ] call CBA_fnc_addSetting; [ @@ -24,7 +24,7 @@ private _categoryStr = format ["ACE %1", LLSTRING(Menu)]; [LLSTRING(ExplodeOnDefuse_DisplayName),LLSTRING(ExplodeOnDefuse_Description)], _categoryStr, true, - true + 1 ] call CBA_fnc_addSetting; // Variable names to preserve https://github.com/acemod/ACE3/pull/6882 @@ -34,7 +34,7 @@ private _categoryStr = format ["ACE %1", LLSTRING(Menu)]; [LLSTRING(TimerMin_DisplayName), LLSTRING(TimerMin_Description)], [_categoryStr, LLSTRING(ExplosiveTimer)], [0, 5999, TIMER_VALUE_MIN], - true + 1 ] call CBA_fnc_addSetting; [ @@ -43,7 +43,7 @@ private _categoryStr = format ["ACE %1", LLSTRING(Menu)]; [LLSTRING(TimerMax_DisplayName), LLSTRING(TimerMax_Description)], [_categoryStr, LLSTRING(ExplosiveTimer)], [0, 5999, TIMER_VALUE_MAX], - true + 1 ] call CBA_fnc_addSetting; [ @@ -51,6 +51,5 @@ private _categoryStr = format ["ACE %1", LLSTRING(Menu)]; "TIME", [LLSTRING(TimerDefault_DisplayName), LLSTRING(TimerDefault_Description)], [_categoryStr, LLSTRING(ExplosiveTimer)], - [0, 5999, TIMER_VALUE_DEFAULT], - false + [0, 5999, TIMER_VALUE_DEFAULT] ] call CBA_fnc_addSetting; diff --git a/addons/explosives/script_component.hpp b/addons/explosives/script_component.hpp index 77ca89d32e5..de27ff45c03 100644 --- a/addons/explosives/script_component.hpp +++ b/addons/explosives/script_component.hpp @@ -34,3 +34,5 @@ #define PLACE_WAITING -1 #define PLACE_CANCEL 0 #define PLACE_APPROVE 1 + +#define MINE_PITCH_UP 90 diff --git a/addons/explosives/stringtable.xml b/addons/explosives/stringtable.xml index 168a8302542..d8397320b88 100644 --- a/addons/explosives/stringtable.xml +++ b/addons/explosives/stringtable.xml @@ -221,7 +221,7 @@ <Portuguese>Ativar Thor III</Portuguese> <Russian>Активировать Thor III</Russian> <Japanese>Thor III を使う</Japanese> - <Korean>Thor III 켜기</Korean> + <Korean>토르 III 켜기</Korean> <Chinesesimp>开启索尔三型</Chinesesimp> <Chinese>開啟索爾三型</Chinese> <Turkish>Thor III ü aç</Turkish> @@ -238,7 +238,7 @@ <Portuguese>Desativar Thor III</Portuguese> <Russian>Деактивировать Thor III</Russian> <Japanese>Thor III を止める</Japanese> - <Korean>Thor III 끄기</Korean> + <Korean>토르 III 끄기</Korean> <Chinesesimp>关闭索尔三型</Chinesesimp> <Chinese>關閉索爾三型</Chinese> <Turkish>Thor III ü kapat</Turkish> @@ -847,7 +847,7 @@ <Russian>Требуется ли специалист по минному делу для обезвреживания взрывчатки? По умолчанию: Нет</Russian> <Italian>Richiedi specialisti esplosivi per disabilitare esplosivi? Predefinito: No</Italian> <Japanese>爆発物を無効にするために爆発物専門兵の特性を必要としますか? デフォルト: 不要</Japanese> - <Korean>폭발물을 해제하기 위해서는 전문가가 필요합니까? 기본설정: 아니요</Korean> + <Korean>폭발물을 해체하기 위해서는 전문가가 필요합니까? 기본설정: 아니요</Korean> <Chinesesimp>需要爆破专业兵才能拆除爆炸物? 预设:否</Chinesesimp> <Chinese>需要炸彈專家才能拆除炸彈? 預設: 否</Chinese> <Turkish>Patlayıcı uzmanlarının patlayıcıları etkisiz hale getirmesini ister misiniz? Varsayılan: Hayır</Turkish> @@ -880,7 +880,7 @@ <Russian>Увеличивать время завершения действий для не-специалистов? По умолчанию: Нет</Russian> <Italian>Aumenta il tempo richiesto per completare azioni per non-specialisti? Predefinito: Si</Italian> <Japanese>専門兵以外がアクション完了するのに必要な時間を増加しますか? デフォルト: 有効</Japanese> - <Korean>비전문가가 폭발물을 해제 시 더욱 많은 시간을 소요합니까? 기본설정: 예</Korean> + <Korean>비전문가가 폭발물을 해체 시 더욱 많은 시간을 소요합니까? 기본설정: 예</Korean> <Chinesesimp>增加非专业人员相关操作的时间? 预设:是</Chinesesimp> <Chinese>增加非專業人員相關操作的時間? 預設: 是</Chinese> </Key> @@ -896,7 +896,7 @@ <Russian>Взрыв при разминировании?</Russian> <Italian>Detona se disarmati?</Italian> <Japanese>解除中に爆発するか?</Japanese> - <Korean>해제 시 폭발합니까?</Korean> + <Korean>해체 시 폭발합니까?</Korean> <Chinesesimp>拆除时引爆?</Chinesesimp> <Chinese>拆除時引爆?</Chinese> </Key> @@ -912,7 +912,7 @@ <Russian>Разрешить определенным взрывным устройствам взрываться при разминировании? По умолчанию: Да</Russian> <Italian>Permettere ad alcuni esplosivi di esplodere quando si tenta il disinnesco? Predefinito: Si</Italian> <Japanese>特定の爆発物を解除中に爆発可能にしますか? デフォルト: 有効</Japanese> - <Korean>특정 폭발물이 해제 시 폭발하게 합니까? 기본설정: 예</Korean> + <Korean>특정 폭발물이 해체 시 폭발하게 합니까? 기본설정: 예</Korean> <Chinesesimp>启用后,某些爆炸物会在拆除时引爆? 预设:是</Chinesesimp> <Chinese>啟用後, 某些炸彈會在拆除時引爆? 預設: 是</Chinese> </Key> diff --git a/addons/fastroping/XEH_postInit.sqf b/addons/fastroping/XEH_postInit.sqf index 0ba92312153..0cfeee67bd9 100644 --- a/addons/fastroping/XEH_postInit.sqf +++ b/addons/fastroping/XEH_postInit.sqf @@ -40,13 +40,21 @@ if (isServer) then { }, true, ["ACE_friesBase"], true] call CBA_fnc_addClassEventHandler; }; +// Handles the Vanilla respawn module +[missionNamespace, "respawn", { + params ["_vehicle"]; + + if !(_vehicle getVariable [QGVAR(addFRIESOnRespawn), false]) exitWith {}; + + _vehicle call FUNC(equipFRIES); +}] call BIS_fnc_addScriptedEventHandler; #ifdef DRAW_FASTROPE_INFO addMissionEventHandler ["Draw3D", { if !(cursorObject isKindOf "Helicopter") exitWith {}; private _config = configOf cursorObject; private _enabled = getNumber (_config >> QGVAR(enabled)); - drawIcon3D ["", [.5,.5,1,1], (ASLtoAGL getPosASL cursorObject), 0.5, 0.5, 0, format ["%1 = %2", typeOf cursorObject, _enabled], 0.5, 0.025, "TahomaB"]; + drawIcon3D ["", [.5,.5,1,1], (ASLToAGL getPosASL cursorObject), 0.5, 0.5, 0, format ["%1 = %2", typeOf cursorObject, _enabled], 0.5, 0.025, "TahomaB"]; if (_enabled > 0) then { { private _hookAttachment = cursorObject getVariable [QGVAR(FRIES), cursorObject]; diff --git a/addons/fastroping/functions/fnc_deployRopes.sqf b/addons/fastroping/functions/fnc_deployRopes.sqf index eea81a77461..c4e999db17c 100644 --- a/addons/fastroping/functions/fnc_deployRopes.sqf +++ b/addons/fastroping/functions/fnc_deployRopes.sqf @@ -26,7 +26,7 @@ private _ropeOrigins = getArray (_config >> QGVAR(ropeOrigins)); private _deployedRopes = _vehicle getVariable [QGVAR(deployedRopes), []]; private _hookAttachment = _vehicle getVariable [QGVAR(FRIES), _vehicle]; -private _ropeLength = getNumber (configfile >> "CfgWeapons" >> _ropeClass >> QEGVAR(logistics_rope,length)); +private _ropeLength = getNumber (configFile >> "CfgWeapons" >> _ropeClass >> QEGVAR(logistics_rope,length)); if (_ropeLength <= 0) then { _ropeLength = DEFAULT_ROPE_LENGTH; diff --git a/addons/fastroping/functions/fnc_equipFRIES.sqf b/addons/fastroping/functions/fnc_equipFRIES.sqf index 615840cb75d..869473cdd14 100644 --- a/addons/fastroping/functions/fnc_equipFRIES.sqf +++ b/addons/fastroping/functions/fnc_equipFRIES.sqf @@ -19,7 +19,7 @@ params ["_vehicle"]; if (!alive _vehicle) exitWith { WARNING_1("bad vehicle %1",_this); }; - if (alive (_vehicle getVariable [QGVAR(FRIES),objNull])) exitWith { WARNING_1("already equiped %1",_this); }; + if (alive (_vehicle getVariable [QGVAR(FRIES), objNull])) exitWith { WARNING_1("already equipped %1",_this); }; private _config = configOf _vehicle; if !(isNumber (_config >> QGVAR(enabled))) then { @@ -29,6 +29,12 @@ private _fries = (getText (_config >> QGVAR(friesType))) createVehicle [0, 0, 0]; _fries attachTo [_vehicle, getArray (_config >> QGVAR(friesAttachmentPoint))]; _vehicle setVariable [QGVAR(FRIES), _fries, true]; + + // The Vanilla respawn module copies all variables from old object to new one + // Use that to move variable from wreck to new vehicle + _vehicle setVariable [QGVAR(addFRIESOnRespawn), true, true]; }; }; }, _this] call CBA_fnc_execNextFrame; + +nil diff --git a/addons/fastroping/stringtable.xml b/addons/fastroping/stringtable.xml index 10ea50a7c51..b8245c77829 100644 --- a/addons/fastroping/stringtable.xml +++ b/addons/fastroping/stringtable.xml @@ -134,10 +134,10 @@ <Spanish>Equipa el helicoptero seleccionado con un Sistema de Inserción/Extracción Rápida por Cuerda</Spanish> <Italian>Equipaggia l'elicottero selezionato con il Fast Rope Insertion Extraction System</Italian> <Czech>Vybavit vybraný vrtulník systémem Fast Rope Insertion Extraction (FRIES)</Czech> - <Portuguese>Equipa um helicóptero selecionado com um sistema de Fast Rope Insertion Extraction System</Portuguese> + <Portuguese>Equipa o helicóptero selecionado com um Sistema de Inserção/Extração Rápida por Corda</Portuguese> <Russian>Снаряжает выбранный вертолет оборудованием для спуска десанта по канатам</Russian> <Japanese>選択されたヘリコプターで Fast Rope Insertion Extraction System を使えるようにします。</Japanese> - <Korean>선택된 헬리콥터에 패스트로프 투입 및 탈출 시스템을 장착합니다.</Korean> + <Korean>선택된 헬리콥터에 패스트로프 투입 및 탈출 시스템(FRIES)을 장착합니다.</Korean> <Chinesesimp>使指定的直升机启用快速绳降及撤离系统</Chinesesimp> <Chinese>使指定的直升機啟用快速繩降及撤離系統</Chinese> </Key> @@ -298,6 +298,7 @@ <German>Schnelles-Abseilen</German> <Italian>Fast Rope</Italian> <Korean>패스트로프</Korean> + <Portuguese>Descida rápida pela corda</Portuguese> </Key> <Key ID="STR_ACE_Fastroping_setting_requireRopeItems_displayName"> <English>Require rope item to deploy</English> @@ -321,7 +322,7 @@ <Japanese>FRIESの自動装備</Japanese> <German>FRIES automatisch ausrüsten</German> <Italian>Auto-Aggiungi FRIES</Italian> - <Korean>FRIES 로프 자동 장착</Korean> + <Korean>패스트로프 자동 장착</Korean> <French>Equipement automatique FRIES</French> <Portuguese>Auto-equipar FRIES</Portuguese> <Russian>Авто-подготовка канатов</Russian> @@ -333,7 +334,7 @@ <Japanese>FRIESをサポートするヘリコプターに自動的にFRIESを追加します。</Japanese> <German>FRIES automatisch Helikoptern hinzufügen, die es unterstützen</German> <Italian>Aggiunge il sistema FRIES in automatico su elicotteri compatibili.</Italian> - <Korean>로프를 지원하는 헬기에 자동으로 FRIES 로프를 추가합니다.</Korean> + <Korean>로프를 지원하는 헬기에 자동으로 패스트로프를 추가합니다.</Korean> <French>Ajoute automatiquement des FRIES aux hélicoptères qui les supportent.</French> <Portuguese>Adiciona automaticamente FRIES a helicópteros que os suportam.</Portuguese> <Russian>Автоматически добавляйте канаты в вертолеты, которые их поддерживают.</Russian> diff --git a/addons/fcs/CfgOptics.hpp b/addons/fcs/CfgOptics.hpp index f8770d7327d..551a965a60d 100644 --- a/addons/fcs/CfgOptics.hpp +++ b/addons/fcs/CfgOptics.hpp @@ -26,7 +26,7 @@ class RscInGameUI { }; }; class Rsc_ACE_Helo_UI_Turret: RscUnitInfo { // RscOptics_Heli_Attack_01_gunner - onLoad = "[""onLoad"",_this,""RscUnitInfo"",'IGUI'] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];"; + onLoad = "[""onLoad"",_this,""RscUnitInfo"",'IGUI'] call (uiNamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];"; class CA_IGUI_elements_group: RscControlsGroup { class controls { MACRO_RANGEFINDER diff --git a/addons/fcs/config.cpp b/addons/fcs/config.cpp index 88e803d0ca4..433f17ac8be 100644 --- a/addons/fcs/config.cpp +++ b/addons/fcs/config.cpp @@ -27,13 +27,6 @@ class CfgPatches { #include "CfgOptics.hpp" -class ACE_Extensions { - class ace_fcs { - windows = 1; - client = 1; - }; -}; - class ACE_Tests { fcs = QPATHTOF(dev\test_debugConfigs.sqf); }; diff --git a/addons/fcs/dev/test_debugConfigs.sqf b/addons/fcs/dev/test_debugConfigs.sqf index c3739123639..dacf8624f37 100644 --- a/addons/fcs/dev/test_debugConfigs.sqf +++ b/addons/fcs/dev/test_debugConfigs.sqf @@ -71,13 +71,13 @@ private _problemUIs = []; _problemUIs pushBackUnique format ["%1: ACE_FCS, but missing ACE_CA_DIST", _turretInfo]; }; if (_aceFCS && {(198 in _idcList)}) then { - _problemUIs pushBackUnique format ["%1: ACE_FCS, but NEW Lazr CA_DIST", _turretInfo, _vehicleType]; + _problemUIs pushBackUnique format ["%1-%2: ACE_FCS, but NEW Lazr CA_DIST", _turretInfo, _vehicleType]; }; if ((!_aceFCS) && {(1713151 in _idcList)}) then { - _problemUIs pushBackUnique format ["%1: Not ACE but has ACE_CA_DIST", _turretInfo, _vehicleType]; + _problemUIs pushBackUnique format ["%1-%2: Not ACE but has ACE_CA_DIST", _turretInfo, _vehicleType]; }; if (_vanillaFCS && {!(198 in _idcList)}) then { - _problemUIs pushBackUnique format ["%1: vanillaFCS but missing NEW Lazr CA_DIST [just a warning]", _turretInfo, _vehicleType]; + _problemUIs pushBackUnique format ["%1-%2: vanillaFCS but missing NEW Lazr CA_DIST [just a warning]", _turretInfo, _vehicleType]; }; }; }; diff --git a/addons/fcs/functions/fnc_calculateSolution.sqf b/addons/fcs/functions/fnc_calculateSolution.sqf index b0cb2ea1c4e..de9462848d7 100644 --- a/addons/fcs/functions/fnc_calculateSolution.sqf +++ b/addons/fcs/functions/fnc_calculateSolution.sqf @@ -63,7 +63,7 @@ private _turretConfig = [configOf _vehicle, _turret] call EFUNC(common,getTurret }; } forEach (_vehicle weaponsTurret _turret); - private _offset = "ace_fcs" callExtension format ["%1,%2,%3,%4", _initSpeed, _airFriction, _angleTarget, _distance]; + private _offset = ("ace" callExtension ["fcs", [_initSpeed, _airFriction, _angleTarget, _distance]]) # 0; _offset = parseNumber _offset; _FCSInitSpeed pushBack _initSpeed; diff --git a/addons/fcs/functions/fnc_firedEH.sqf b/addons/fcs/functions/fnc_firedEH.sqf index e99416593af..d4e79e84617 100644 --- a/addons/fcs/functions/fnc_firedEH.sqf +++ b/addons/fcs/functions/fnc_firedEH.sqf @@ -41,7 +41,7 @@ if (_zeroDistance > 0) then { private _weaponCombo = [_weapon, _magazine, _ammo, _zeroDistance]; if (_weaponCombo isNotEqualTo (_gunner getVariable [QGVAR(lastWeaponCombo), []])) then { private _airFriction = getNumber (configFile >> "CfgAmmo" >> _ammo >> "airFriction"); - private _antiOffset = "ace_fcs" callExtension format ["%1,%2,%3,%4", _initSpeed, _airFriction, 0, _zeroDistance]; + private _antiOffset = ("ace" callExtension ["fcs", [_initSpeed, _airFriction, 0, _zeroDistance]]) # 0; _antiOffset = parseNumber _antiOffset; _gunner setVariable [QGVAR(lastWeaponCombo), _weaponCombo]; diff --git a/addons/fcs/functions/fnc_getAngle.sqf b/addons/fcs/functions/fnc_getAngle.sqf index 9a856d46c97..03e8b4fdc8e 100644 --- a/addons/fcs/functions/fnc_getAngle.sqf +++ b/addons/fcs/functions/fnc_getAngle.sqf @@ -21,7 +21,7 @@ * Public: No */ -#define PRECISION 0.1 +#define VAR_PRECISION 0.1 params ["_distance", "_angleTarget", "_maxElev", "_initSpeed", "_airFriction", "_timeToLive", "_simulationStep"]; @@ -69,9 +69,9 @@ private _it2 = 0; _data set [7, _maxElev]; private _f1 = _data call _fnc_traceBullet; -if (abs _f1 <= PRECISION) exitWith {0}; +if (abs _f1 <= VAR_PRECISION) exitWith {0}; -while {abs _f1 > PRECISION} do { +while {abs _f1 > VAR_PRECISION} do { _data set [7, _angle2]; private _f2 = _data call _fnc_traceBullet; diff --git a/addons/field_rations/XEH_postInit.sqf b/addons/field_rations/XEH_postInit.sqf index 9fc8406abaf..dac701845f4 100644 --- a/addons/field_rations/XEH_postInit.sqf +++ b/addons/field_rations/XEH_postInit.sqf @@ -38,6 +38,7 @@ if !(hasInterface) exitWith {}; [false, false, false, false, true] ] call EFUNC(interact_menu,createAction); + //IGNORE_PRIVATE_WARNING ["_player", "_target"]; private _subActions = [ [ QGVAR(checkWater), diff --git a/addons/field_rations/functions/fnc_getActionOffset.sqf b/addons/field_rations/functions/fnc_getActionOffset.sqf index dd7658dfda1..763654c6559 100644 --- a/addons/field_rations/functions/fnc_getActionOffset.sqf +++ b/addons/field_rations/functions/fnc_getActionOffset.sqf @@ -18,11 +18,11 @@ params ["_object"]; private _configOf = configOf _object; -if !(isNull _configOf) then { +if (isNull _configOf) then { + // Check for offset corresponding to p3d list + GVAR(waterSourceOffsets) param [GVAR(waterSourceP3ds) find (getModelInfo _object select 0), [0, 0, 0], [[]]]; +} else { // Check for offset in config since we have valid typeOf private _offset = getArray (_configOf >> QXGVAR(offset)); if (_offset isEqualTo []) then {[0, 0, 0]} else {_offset}; -} else { - // Check for offset corresponding to p3d list - GVAR(waterSourceOffsets) param [GVAR(waterSourceP3ds) find (getModelInfo _object select 0), [0, 0, 0], [[]]]; }; diff --git a/addons/field_rations/functions/fnc_getConsumableChildren.sqf b/addons/field_rations/functions/fnc_getConsumableChildren.sqf index 9fe422109c0..73e75e29a47 100644 --- a/addons/field_rations/functions/fnc_getConsumableChildren.sqf +++ b/addons/field_rations/functions/fnc_getConsumableChildren.sqf @@ -18,6 +18,7 @@ params ["_player"]; private _fnc_getActions = { + //IGNORE_PRIVATE_WARNING ["_player"]; TRACE_1("Creating consumable item actions",_player); private _actions = []; diff --git a/addons/field_rations/functions/fnc_getRemainingWater.sqf b/addons/field_rations/functions/fnc_getRemainingWater.sqf index 253fd62285d..1011136e0ce 100644 --- a/addons/field_rations/functions/fnc_getRemainingWater.sqf +++ b/addons/field_rations/functions/fnc_getRemainingWater.sqf @@ -23,7 +23,10 @@ private _water = _source getVariable QGVAR(currentWaterSupply); if (isNil "_water") then { private _configOf = configOf _source; - if !(isNull _configOf) then { + if (isNull _configOf) then { + // Check the p3d name against list + _water = if ((getModelInfo _source select 0) in GVAR(waterSourceP3ds)) then {REFILL_WATER_INFINITE} else {REFILL_WATER_DISABLED}; + } else { // Check for waterSupply entry since we have valid typeOf _water = getNumber (_configOf >> QXGVAR(waterSupply)); if (_water == 0) then {_water = REFILL_WATER_DISABLED}; @@ -35,9 +38,6 @@ if (isNil "_water") then { _source setVariable [QGVAR(currentWaterSupply), _water, true]; }; }; - } else { - // Check the p3d name against list - _water = if ((getModelInfo _source select 0) in GVAR(waterSourceP3ds)) then {REFILL_WATER_INFINITE} else {REFILL_WATER_DISABLED}; }; }; diff --git a/addons/field_rations/initSettings.inc.sqf b/addons/field_rations/initSettings.inc.sqf index 86bf04aed2f..16e2d4eb2d6 100644 --- a/addons/field_rations/initSettings.inc.sqf +++ b/addons/field_rations/initSettings.inc.sqf @@ -4,9 +4,9 @@ [ELSTRING(common,Enabled), LSTRING(Enabled_Description)], LSTRING(DisplayName), false, - true, - {}, - true // Needs restart + 1, + {[QXGVAR(enabled), _this] call EFUNC(common,cbaSettings_settingChanged)}, + true // Needs mission restart ] call CBA_fnc_addSetting; [ diff --git a/addons/field_rations/stringtable.xml b/addons/field_rations/stringtable.xml index 2b443ccc3c0..50fece7cfb1 100644 --- a/addons/field_rations/stringtable.xml +++ b/addons/field_rations/stringtable.xml @@ -302,7 +302,7 @@ <Italian>Influenza la Fatica Avanzata</Italian> <Chinese>與進階疲勞聯動</Chinese> <Chinesesimp>与进阶疲劳联动</Chinesesimp> - <Japanese>アドバンスド疲労への影響</Japanese> + <Japanese>高度な疲労への影響</Japanese> <Russian>Влияние на продвинутую усталость</Russian> <Polish>Wpływ na zaawansowane zmęczenie</Polish> <Turkish>Gelişmiş Yorgunluk</Turkish> @@ -317,7 +317,7 @@ <Italian>Determina se fame e sete influenzano la Fatica Avanzata ACE.</Italian> <Chinese>是否讓飲食影響到ACE的進階疲勞。</Chinese> <Chinesesimp>是否让饮食影响到 ACE 的进阶疲劳。</Chinesesimp> - <Japanese>喉の渇きと空腹度が ACE アドバンスド疲労へ与える影響を定義します。</Japanese> + <Japanese>喉の渇きと空腹度が ACE 高度な疲労へ与える影響を定義します。</Japanese> <Russian>Определяет, будет ли жажда и голод влиять на продвинутую усталость ACE.</Russian> <Polish>Kontroluje czy pragnienie i głód mają wpływ na zaawansowane zmęczenie ACE.</Polish> <Turkish>Acıkınca veya susayınca kişinin yorulup yorulmayacağını belirler.</Turkish> @@ -870,7 +870,7 @@ <Hungarian>A vízzel töltött kantin</Hungarian> <Italian>Una borraccia riempita per metà di acqua</Italian> <Japanese>半分入っている水筒</Japanese> - <Korean>반이 차 있는 수통입니다</Korean> + <Korean>물이 반 정도 차 있는 수통입니다</Korean> <Polish>Manierka w połowie wypełniona wodą</Polish> <Portuguese>Uma meia cantina cheia de água</Portuguese> <Russian>Наполовину заполненая водой фляга</Russian> diff --git a/addons/fieldmanual/stringtable.xml b/addons/fieldmanual/stringtable.xml index 12e34d0e34d..9cf2290de2d 100644 --- a/addons/fieldmanual/stringtable.xml +++ b/addons/fieldmanual/stringtable.xml @@ -169,6 +169,7 @@ <Japanese>%3IV 輸液%4は失われた血液を回復します。血液、血漿、生理食塩水は機能的には同じです。<br/><br/>%3使用方法:%4<br/>%2[%3%13%4] または [%3%14%4] を使って四肢を選択します。<br/>%2希望の%3IV 輸液%4の種類を選択して、血液量を復元します。</Japanese> <Russian>%%3Внутривенные жидкости%4восстанавливают потерянный объем крови. Кровь, плазма и физраствор функционально идентичны.<br/><br/>%3 Использование:%4<br/>%2 Используйте [%3%13%4] или [%3%14%4] и выберите добавку.<br/>%2 Восстановите объем крови выбрав желаемый %4тип %3жидкости</Russian> <Spanish>Los %3Fluidos IV%4 restauran el volumen de sangre. Sangre, Plasma, y Salino funcionan de manera similar.<br/><br/>%3Uso:%4<br/>%2Uso [%3%13%4] o [%3%14%4] y seleccionar una extremidad.<br/>%2Restaura el volumen de sangre seleccionando el tipo de %3Fluido IV%4 elegido.</Spanish> + <French>%3IV fluides%4 restaurer le volume sanguin perdu. Sang, Plasma, and Saline fonctionnent de la même manière.<br/><br/>%3Utilisation:%4<br/>%2Utiliser [%3%13%4] ou [%3%14%4] et sélectionner un appendice.<br/>%2Restaurer le volume sanguin en sélectionnant le volume désiré %3IV Fluide%4 type.</French> </Key> <Key ID="STR_ACE_FieldManual_Medical_Treatment_Epinephrine_ShortName"> <English>Increase Heart Rate | Wake Up Faster</English> @@ -624,7 +625,7 @@ <Polish>Zaawansowany DAGR</Polish> <Italian>DAGR Avanzato</Italian> <Korean>고급형 DAGR입니다</Korean> - <Japanese>より高度なDAGR</Japanese> + <Japanese>高機能なDAGR</Japanese> <Russian>Продвинутый DAGR</Russian> <French>DAGR avancé</French> <Spanish>DAGR Avanzado</Spanish> @@ -634,7 +635,7 @@ <Polish>%3MicroDAGR GPS%4 jest zaawansowaną wersją %3DAGR%4. Dostarcza dane oparte o pozycję, nawigację, i czas (PNT): <br/>%2Kompas i kierunek<br/>%2Datę i godzinę zsynchronizowaną z misją<br/>%2Elewację (relatywną do poziomu morza)<br/>%2Obecną prędkość<br/>%2GPS z widokiem topograficznym i satelitarnym<br/>%2Tworzenie, nazywanie oraz usuwanie waypointów<br/>%2Identyfikację sojuszników (Wymaga ACE BLUFOR Tracker)<br/>Połączenie do dalmierza Vector-21 w celu importu danych (waypointy i współrzędne zmierzonego celu)<br/><br/>%3Użycie: %4<br/>%2Po instrukcję użycia odwiedź %3MicroDAGR%4 wiki.</Polish> <Italian>Il %3GPS MicroDAGR%4 è una versione avanzata del %3DAGR%4. Esso mostra dati su posizione, navigazione e tempismo (PNT), includendo:<br/>%2Bussola e azimut<br/>%2Data e ora sincronizzate con la missione<br/>%2Elevazione (dal livello del mare)<br/>%2Velocità attuale<br/>%2GPS con visuale topografica e satellitare<br/>%2Creazione, rinomina e rimozione di waypoint<br/>%2Identificazione di alleati (Richiede Impostazioni ACE BLUFOR Tracker)<br/>Connessione al Telemetro Vector-21 per importazione di dati (creazione waypoint e indicazione di griglia su bersagli puntati)<br/><br/>%3Utilizzo:%4<br/>%2Per informazioni sull'utilizzo sei pregato di visitare la pagina wiki dedicata al %3MicroDAGR%4.</Italian> <Korean>%3마이크로DAGR GPS%4는 %3DAGR%4의 고급 버전입니다. 다음과 같이 위치, 내비게이션 및 타이밍(PNT) 데이터를 제공합니다:<br/>%2나침반 및 방향<br/>%2임무와 동기화된 날짜 및 시간<br/>%2고도 (해수면 기준)<br/>%2현재 속도<br/>%2지형 및 위성 시점 기능이 있는 GPS<br/>%2웨이포인트 생성, 작명 및 삭제<br/>%2아군 식별 (ACE의 GPS 피아식별기 켜기 체크 필요)<br/>%2데이터를 가져오기 위한 벡터-21 거리계에 연결(원거리 대상의 웨이포인트 생성 및 좌표 참조)<br/><br/>%3사용 방법:%4<br/>%2사용 방법을 보려면 전용 %3마이크로DAGR%4의 위키를 방문하십시오.</Korean> - <Japanese>%3MicroDAGR GPS%4は%3DAGR%4のより高度なバージョンです。測位、航法、計時(PNT)データが提供されます。これには以下の情報を含みます:<br/>%2コンパスと方位<br/>%2ミッションに同期された日付と時間<br/>%2標高 (海面に対する相対値)<br/>%2現在の速度<br/>%2地形図と衛星ビューを備えたGPS<br/>%2ウェイポイントの作成、名前付け、および削除<br/>%2友軍の識別 (ACE ブルーフォーストラッキング設定が必要)<br/>ベクター21レンジファインダーへの接続とデータのインポート (ウェイポイントの作成と遠距離ターゲットのグリッド参照)<br/><br/>%3使用方法:%4<br/>%2使用手順については、専用の %3MicroDAGR%4 wiki を参照してください。</Japanese> + <Japanese>%3MicroDAGR GPS%4は%3DAGR%4のより高機能なバージョンです。測位、航法、計時(PNT)データが提供されます。これには以下の情報を含みます:<br/>%2コンパスと方位<br/>%2ミッションに同期された日付と時間<br/>%2標高 (海面に対する相対値)<br/>%2現在の速度<br/>%2地形図と衛星ビューを備えたGPS<br/>%2ウェイポイントの作成、名前付け、および削除<br/>%2友軍の識別 (ACE ブルーフォーストラッキング設定が必要)<br/>ベクター21レンジファインダーへの接続とデータのインポート (ウェイポイントの作成と遠距離ターゲットのグリッド参照)<br/><br/>%3使用方法:%4<br/>%2使用手順については、専用の %3MicroDAGR%4 wiki を参照してください。</Japanese> <Spanish>El %3GPS MicroDAGR%4 es una versión avanzada del %3DAGR%4. Provee de posicionamiento, navegación y datos de temporización (PNT) que incluye:<br/>%2Brújula y dirección<br/>%2Fecha y hora sincronizada con la misión<br/>%2Elevación (relativa al nivel del mar)<br/>%2Velocidad actual<br/>%2GPS con vista topográfica y satelital<br/>%2Creación, nombrado y borrado de puntos de ruta<br/>%2Identificación de aliados (Requiere la opción de ACE BLUFOR Tracker)<br/>Conexión con el telémetro Vector-21 para importación de datos (creación de puntos de ruta y referenciado en eje de coordenada para objetivos a distancia)<br/><br/>%3Uso:%4<br/>%2Para instrucciones de uso, por favor visita la Wiki dedicada de %3MicroDAGR%4.</Spanish> </Key> <Key ID="STR_ACE_FieldManual_Items_RangeTables_DisplayName"> diff --git a/addons/finger/functions/fnc_keyPress.sqf b/addons/finger/functions/fnc_keyPress.sqf index 2445986d15b..16dca938b34 100644 --- a/addons/finger/functions/fnc_keyPress.sqf +++ b/addons/finger/functions/fnc_keyPress.sqf @@ -29,8 +29,8 @@ if (diag_tickTime < (GVAR(lastFPTime) + FP_ACTION_TIMEOUT)) exitWith {true}; GVAR(lastFPTime) = diag_tickTime; // Find where is the finger pointing -private _originASL = AGLtoASL positionCameraToWorld [0, 0, 0]; -private _fingerPosASL = AGLtoASL positionCameraToWorld [0, 0, FP_DISTANCE]; +private _originASL = AGLToASL positionCameraToWorld [0, 0, 0]; +private _fingerPosASL = AGLToASL positionCameraToWorld [0, 0, FP_DISTANCE]; private _intersections = lineIntersectsSurfaces [_originASL, _fingerPosASL, ACE_player, vehicle ACE_player, true, 1]; if (_intersections isNotEqualTo []) then { _fingerPosASL = _intersections select 0 select 0; diff --git a/addons/finger/functions/fnc_perFrameEH.sqf b/addons/finger/functions/fnc_perFrameEH.sqf index 4af4f6b643e..36acea8a447 100644 --- a/addons/finger/functions/fnc_perFrameEH.sqf +++ b/addons/finger/functions/fnc_perFrameEH.sqf @@ -39,7 +39,7 @@ private _iconBaseSize = GVAR(sizeCoef) * BASE_SIZE * 0.10713 * (call EFUNC(commo _iconSize = _iconSize * linearConversion [0, GVAR(maxRange), (getPosASL ACE_player) vectorDistance (getPosASL _sourceUnit), 0.25, 2, true]; }; - drawIcon3D [QPATHTOF(UI\fp_icon2.paa), _drawColor, ASLtoAGL _pos, _iconSize, _iconSize, 0, _name, 1, 0.03, "RobotoCondensed"]; + drawIcon3D [QPATHTOF(UI\fp_icon2.paa), _drawColor, ASLToAGL _pos, _iconSize, _iconSize, 0, _name, 1, 0.03, "RobotoCondensed"]; }; } forEach GVAR(fingersHash); diff --git a/addons/finger/stringtable.xml b/addons/finger/stringtable.xml index bdb0c835b6b..66c97c70daa 100644 --- a/addons/finger/stringtable.xml +++ b/addons/finger/stringtable.xml @@ -62,7 +62,7 @@ <Spanish>Distancia máxima de señalado</Spanish> <Czech>Maximální dosah pro ukazování směru</Czech> <Italian>Raggio massimo puntamento</Italian> - <Japanese>指差しの最大範囲</Japanese> + <Japanese>指差しの最大距離</Japanese> <Korean>가리키기 최대 범위</Korean> <Chinesesimp>指向标记最大显示距离</Chinesesimp> <Chinese>指向指示器最大顯示距離</Chinese> @@ -79,7 +79,7 @@ <Spanish>Distancia máxima entre los jugadores para mostrar el indicador que señala [por defecto: 4 metros]</Spanish> <Czech>Maximální vzdálenost mezi hráči pro ukázání směru [výchozí: 4 metry]</Czech> <Italian>Distanza massima tra giocatori per mostrare l'indicatore di puntamento [Predefinito: 4 metri]</Italian> - <Japanese>指差しのマーカー表示が他のプレイヤーに表示される最大範囲 [デフォルト: 4メートル]</Japanese> + <Japanese>指差しのマーカー表示が他のプレイヤーに表示される最大距離 [デフォルト: 4メートル]</Japanese> <Korean>플레이어 사이에서 가리키기 표시를 보이게 하는 최대거리를 설정합니다[기본설정: 4 미터]</Korean> <Chinesesimp>设定指向标记最大显示距离。[预设:4米]</Chinesesimp> <Chinese>設定指向指示器最大顯示距離。[預設: 4公尺]</Chinese> diff --git a/addons/fire/XEH_postInit.sqf b/addons/fire/XEH_postInit.sqf index 641b74fffe1..1050d757538 100644 --- a/addons/fire/XEH_postInit.sqf +++ b/addons/fire/XEH_postInit.sqf @@ -1,24 +1,24 @@ #include "script_component.hpp" -[QGVAR(burn), LINKFUNC(burn)] call CBA_fnc_addEventHandler; -[QGVAR(burnEffects), LINKFUNC(burnEffects)] call CBA_fnc_addEventHandler; -[QGVAR(burnSimulation), LINKFUNC(burnSimulation)] call CBA_fnc_addEventHandler; +["CBA_settingsInitialized", { + TRACE_1("settingsInitialized",GVAR(enabled)); -[QGVAR(playScream), { - params ["_scream", "_source"]; + if (!GVAR(enabled)) exitWith {}; - // Only play sound if enabled in settings and enabled for the unit - if (GVAR(enableScreams) && {_source getVariable [QGVAR(enableScreams), true]}) then { - _source say3D _scream; - }; -}] call CBA_fnc_addEventHandler; + [QGVAR(burn), LINKFUNC(burn)] call CBA_fnc_addEventHandler; + [QGVAR(burnEffects), LINKFUNC(burnEffects)] call CBA_fnc_addEventHandler; + [QGVAR(burnSimulation), LINKFUNC(burnSimulation)] call CBA_fnc_addEventHandler; -if (!isServer) exitWith {}; + [QGVAR(playScream), { + params ["_scream", "_source"]; -["CBA_settingsInitialized", { - TRACE_1("settingsInit",GVAR(enabled)); + // Only play sound if enabled in settings and enabled for the unit + if (GVAR(enableScreams) && {_source getVariable [QGVAR(enableScreams), true]}) then { + _source say3D _scream; + }; + }] call CBA_fnc_addEventHandler; - if (!GVAR(enabled)) exitWith {}; + if (!isServer) exitWith {}; GVAR(fireSources) = createHashMap; diff --git a/addons/fire/addon.toml b/addons/fire/addon.toml deleted file mode 100644 index bf39213892e..00000000000 --- a/addons/fire/addon.toml +++ /dev/null @@ -1,3 +0,0 @@ -[tools] -pboProject_noBinConfig = true -sqfvm_skipConfigChecks = true diff --git a/addons/fire/ACE_Medical_Treatment_Actions.hpp b/addons/fire/compat_medical_engine/ACE_Medical_Treatment_Actions.hpp similarity index 100% rename from addons/fire/ACE_Medical_Treatment_Actions.hpp rename to addons/fire/compat_medical_engine/ACE_Medical_Treatment_Actions.hpp diff --git a/addons/fire/compat_medical_engine/config.cpp b/addons/fire/compat_medical_engine/config.cpp new file mode 100644 index 00000000000..cc4431b18f3 --- /dev/null +++ b/addons/fire/compat_medical_engine/config.cpp @@ -0,0 +1,20 @@ +#include "script_component.hpp" + +class CfgPatches { + class SUBADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_medical_engine"}; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + + addonRootClass = QUOTE(ADDON); + }; +}; + +#include "ACE_Medical_Treatment_Actions.hpp" diff --git a/addons/fire/compat_medical_engine/script_component.hpp b/addons/fire/compat_medical_engine/script_component.hpp new file mode 100644 index 00000000000..b2ce8adc8d7 --- /dev/null +++ b/addons/fire/compat_medical_engine/script_component.hpp @@ -0,0 +1,3 @@ +#define SUBCOMPONENT medical_engine +#define SUBCOMPONENT_BEAUTIFIED Medical Engine +#include "..\script_component.hpp" diff --git a/addons/fire/config.cpp b/addons/fire/config.cpp index df2eb5cb79c..7a13dd079b9 100644 --- a/addons/fire/config.cpp +++ b/addons/fire/config.cpp @@ -1,20 +1,12 @@ #include "script_component.hpp" -#pragma hemtt flag pe23_ignore_has_include -#if __has_include("\z\ace\addons\nomedical\script_component.hpp") -#define PATCH_SKIP "No Medical" -#endif - -#ifdef PATCH_SKIP -ACE_PATCH_NOT_LOADED(ADDON,PATCH_SKIP) -#else class CfgPatches { class ADDON { name = COMPONENT_NAME; units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"ace_common", "ace_medical_engine"}; + requiredAddons[] = {"ace_common"}; author = ECSTRING(common,ACETeam); authors[] = {"commy2", "tcvm"}; url = ECSTRING(main,URL); @@ -25,7 +17,4 @@ class CfgPatches { #include "CfgEventHandlers.hpp" #include "CfgSounds.hpp" #include "CfgVehicles.hpp" -#include "ACE_Medical_Treatment_Actions.hpp" #include "RscTitles.hpp" - -#endif diff --git a/addons/fire/functions/fnc_burnSimulation.sqf b/addons/fire/functions/fnc_burnSimulation.sqf index b50afab5dcd..e061d1ce915 100644 --- a/addons/fire/functions/fnc_burnSimulation.sqf +++ b/addons/fire/functions/fnc_burnSimulation.sqf @@ -148,19 +148,29 @@ params ["_unit", "_instigator"]; _unit call FUNC(burnReaction); }; - if (!isNull _instigator) then { - _unit setVariable [QEGVAR(medical,lastDamageSource), _instigator]; - _unit setVariable [QEGVAR(medical,lastInstigator), _instigator]; - }; + // Keep pain around unconsciousness limit to allow for more fun interactions + private _painPercieved = (0 max ((_unit getVariable [QEGVAR(medical,pain), 0]) - (_unit getVariable [QEGVAR(medical,painSuppress), 0])) min 1); + private _painUnconscious = missionNamespace getVariable [QEGVAR(medical,painUnconsciousThreshold), 0]; + private _damageToAdd = [0.15, _intensity / BURN_MAX_INTENSITY] select (!alive _unit || {_painPercieved < _painUnconscious + random 0.2}); + + if (GETEGVAR(medical,enabled,false)) then { + if (!isNull _instigator) then { + _unit setVariable [QEGVAR(medical,lastDamageSource), _instigator]; + _unit setVariable [QEGVAR(medical,lastInstigator), _instigator]; + }; - // Common burn areas are the hands and face https://www.ncbi.nlm.nih.gov/pubmed/16899341/ - private _bodyPart = ["Head", "Body", "LeftArm", "RightArm", "LeftLeg", "RightLeg"] selectRandomWeighted [0.77, 0.5, 0.8, 0.8, 0.3, 0.3]; + // Common burn areas are the hands and face https://www.ncbi.nlm.nih.gov/pubmed/16899341/ + private _bodyPart = ["Head", "Body", "LeftArm", "RightArm", "LeftLeg", "RightLeg"] selectRandomWeighted [0.77, 0.5, 0.8, 0.8, 0.3, 0.3]; - // Keep pain around unconciousness limit to allow for more fun interactions - private _damageToAdd = [0.15, _intensity / BURN_MAX_INTENSITY] select (!alive _unit || {GET_PAIN_PERCEIVED(_unit) < (PAIN_UNCONSCIOUS + random 0.2)}); + // Use event directly, as ace_medical_fnc_addDamageToUnit requires unit to be alive + [QEGVAR(medical,woundReceived), [_unit, [[_damageToAdd, _bodyPart, _damageToAdd]], _instigator, "burn"]] call CBA_fnc_localEvent; + } else { + private _bodyParts = [["HitFace", "HitNeck", "HitHead"], ["HitPelvis", "HitAbdomen", "HitDiaphragm", "HitChest", "HitBody"], ["HitArms", "HitHands"], ["HitLegs"]] selectRandomWeighted [0.77, 0.5, 0.8, 0.3]; - // Use event directly, as ace_medical_fnc_addDamageToUnit requires unit to be alive - [QEGVAR(medical,woundReceived), [_unit, [[_damageToAdd, _bodyPart, _damageToAdd]], _instigator, "burn"]] call CBA_fnc_localEvent; + { + _unit setHitPointDamage [_x, (_unit getHitPointDamage _x) + _damageToAdd, true, _instigator, _instigator]; + } forEach _bodyParts; + }; _unit setVariable [QGVAR(intensity), _intensity, true]; // Globally sync intensity across all clients to make sure simulation is deterministic }; diff --git a/addons/fire/initSettings.inc.sqf b/addons/fire/initSettings.inc.sqf index edcd51a8a7e..d9649c2ad9b 100644 --- a/addons/fire/initSettings.inc.sqf +++ b/addons/fire/initSettings.inc.sqf @@ -5,7 +5,7 @@ LSTRING(Category_DisplayName), true, 1, - {[QGVAR(fireEnabled), _this] call EFUNC(common,cbaSettings_settingChanged)}, + {[QGVAR(enabled), _this] call EFUNC(common,cbaSettings_settingChanged)}, true // Needs mission restart ] call CBA_fnc_addSetting; diff --git a/addons/fire/script_component.hpp b/addons/fire/script_component.hpp index ebb0002ff6f..f4b636286b1 100644 --- a/addons/fire/script_component.hpp +++ b/addons/fire/script_component.hpp @@ -16,7 +16,6 @@ #endif #include "\z\ace\addons\main\script_macros.hpp" -#include "\z\ace\addons\medical_engine\script_macros_medical.hpp" #define FIRE_MANAGER_PFH_DELAY 0.25 #define FLARE_SIZE_MODIFIER 5 diff --git a/addons/fortify/CfgWeapons.hpp b/addons/fortify/CfgWeapons.hpp index 66ff7f52d88..82396288721 100644 --- a/addons/fortify/CfgWeapons.hpp +++ b/addons/fortify/CfgWeapons.hpp @@ -10,6 +10,7 @@ class CfgWeapons { picture = QPATHTOF(UI\hammer_ca.paa); scope = 2; ACE_isTool = 1; + GVAR(fortifyTool) = 1; class ItemInfo: CBA_MiscItem_ItemInfo { mass = 0; }; diff --git a/addons/fortify/XEH_postInit.sqf b/addons/fortify/XEH_postInit.sqf index ed13a116c7f..91ce3b7b877 100644 --- a/addons/fortify/XEH_postInit.sqf +++ b/addons/fortify/XEH_postInit.sqf @@ -50,6 +50,7 @@ GVAR(objectRotationZ) = 0; private _text = [format ["Remove Object +$%1", _cost], "Remove Object"] select (_budget == -1); // Remove object action + //IGNORE_PRIVATE_WARNING ["_player"]; private _removeAction = [ QGVAR(removeObject), _text, diff --git a/addons/fortify/XEH_preInit.sqf b/addons/fortify/XEH_preInit.sqf index 382fc805660..50f641f9cf7 100644 --- a/addons/fortify/XEH_preInit.sqf +++ b/addons/fortify/XEH_preInit.sqf @@ -13,6 +13,8 @@ GVAR(locations) = []; // Custom deploy handlers GVAR(deployHandlers) = []; +GVAR(fortifyTools) = keys (uiNamespace getVariable QGVAR(fortifyTools)); + #include "initSettings.inc.sqf" ADDON = true; diff --git a/addons/fortify/XEH_preStart.sqf b/addons/fortify/XEH_preStart.sqf index 022888575ed..4da9eeb40da 100644 --- a/addons/fortify/XEH_preStart.sqf +++ b/addons/fortify/XEH_preStart.sqf @@ -1,3 +1,9 @@ #include "script_component.hpp" #include "XEH_PREP.hpp" + +private _fortifyTools = (QUOTE(getNumber (_x >> QQGVAR(fortifyTool)) > 0) configClasses (configFile >> "CfgWeapons") apply {configName _x}); +_fortifyTools append (QUOTE(getNumber (_x >> QQGVAR(fortifyTool)) > 0) configClasses (configFile >> "CfgVehicles") apply {configName _x}); +TRACE_1("",_fortifyTools); + +uiNamespace setVariable [QGVAR(fortifyTools), compileFinal (_fortifyTools createHashMapFromArray [])]; diff --git a/addons/fortify/config.cpp b/addons/fortify/config.cpp index ab12338982f..2808b56cba5 100644 --- a/addons/fortify/config.cpp +++ b/addons/fortify/config.cpp @@ -2,6 +2,7 @@ class CfgPatches { class ADDON { + name = COMPONENT_NAME; units[] = {QXGVAR(setupModule), QXGVAR(buildLocationModule)}; weapons[] = {"ACE_Fortify"}; requiredVersion = REQUIRED_VERSION; diff --git a/addons/fortify/functions/fnc_addActions.sqf b/addons/fortify/functions/fnc_addActions.sqf index 4802effa01d..7ac07d1693a 100644 --- a/addons/fortify/functions/fnc_addActions.sqf +++ b/addons/fortify/functions/fnc_addActions.sqf @@ -21,7 +21,7 @@ private _side = side group _player; private _objects = missionNamespace getVariable [format [QGVAR(Objects_%1), _side], []]; private _actions = []; private _infiniteBudget = ([side group _player] call FUNC(getBudget)) == -1; -private _subActions = createHashmap; +private _subActions = createHashMap; { _x params ["_classname", "_cost", ["_category", ""]]; diff --git a/addons/fortify/functions/fnc_buildLocationModule.sqf b/addons/fortify/functions/fnc_buildLocationModule.sqf index c777b80d4e4..497af641f41 100644 --- a/addons/fortify/functions/fnc_buildLocationModule.sqf +++ b/addons/fortify/functions/fnc_buildLocationModule.sqf @@ -18,7 +18,7 @@ params ["_logic"]; TRACE_1("buildLocations",_logic); -private _area = _logic getvariable ["objectArea",[0,0,0,false,0]]; // seems to be set via the canSetArea config +private _area = _logic getVariable ["objectArea",[0,0,0,false,0]]; // seems to be set via the canSetArea config if ((_area param [0, 0]) == 0) exitWith {WARNING_1("Bad size? %1",_area);}; private _locationArray = [_logic]; _locationArray append _area; diff --git a/addons/fortify/functions/fnc_canFortify.sqf b/addons/fortify/functions/fnc_canFortify.sqf index 3a382bc98c9..ad676a91031 100644 --- a/addons/fortify/functions/fnc_canFortify.sqf +++ b/addons/fortify/functions/fnc_canFortify.sqf @@ -19,8 +19,12 @@ params ["_player", ["_cost", 0]]; (missionNamespace getVariable [QGVAR(fortifyAllowed), true]) && -{"ACE_Fortify" in (_player call EFUNC(common,uniqueItems))} && { + private _items = _player call EFUNC(common,uniqueItems); + _items append weapons _player; + _items pushBack backpack _player; + GVAR(fortifyTools) findAny _items != -1 +} && { private _budget = [side group _player] call FUNC(getBudget); ((_budget == -1) || {_budget >= _cost}) } && { diff --git a/addons/fortify/functions/fnc_getPlaceableSet.sqf b/addons/fortify/functions/fnc_getPlaceableSet.sqf index 9643d541906..dfe5a01a1b8 100644 --- a/addons/fortify/functions/fnc_getPlaceableSet.sqf +++ b/addons/fortify/functions/fnc_getPlaceableSet.sqf @@ -20,7 +20,7 @@ TRACE_1("getPlaceableSet",_preset); private _config = missionConfigFile >> "ACEX_Fortify_Presets" >> _preset; if (!isClass _config) then { - _config = configfile >> "ACEX_Fortify_Presets" >> _preset; + _config = configFile >> "ACEX_Fortify_Presets" >> _preset; }; if (!isClass _config) exitWith { private _msg = format ["Could not find [%1]", _preset]; @@ -37,11 +37,11 @@ _objects = _objects select { if (isClass (configFile >> "CfgVehicles" >> _classname)) then { true } else { - ERROR_2("Preset [%1] - Classname does not exist",_preset,_classname); + ERROR_2("Preset [%1] - Classname [%2] does not exist",_preset,_classname); false }; } else { - ERROR_2("Preset [%1] - Bad data in objects array %2",_preset,_x); + ERROR_2("Preset [%1] - Bad data [%2] in objects array %2",_preset,_x); false }; }; diff --git a/addons/frag/CfgAmmo.hpp b/addons/frag/CfgAmmo.hpp index 7a124833b3c..ac3605499d8 100644 --- a/addons/frag/CfgAmmo.hpp +++ b/addons/frag/CfgAmmo.hpp @@ -4,272 +4,16 @@ class CfgAmmo { - // ~~~~ Bombs: - class ammo_Bomb_LaserGuidedBase; - class Bo_GBU12_LGB: ammo_Bomb_LaserGuidedBase { - GVAR(enabled) = 1; + #include "CfgAmmoBaseClasses.hpp" - GVAR(classes)[] = {QGVAR(large), QGVAR(large), QGVAR(large_HD), QGVAR(large), QGVAR(huge), QGVAR(huge_HD), QGVAR(huge)}; - GVAR(metal) = 140000; - GVAR(charge) = 87000; - GVAR(gurney_c) = 2320; - GVAR(gurney_k) = "1/2"; - }; - class Bomb_04_F: ammo_Bomb_LaserGuidedBase { - GVAR(enabled) = 1; - - GVAR(classes)[] = {QGVAR(large), QGVAR(large), QGVAR(large_HD), QGVAR(large), QGVAR(huge), QGVAR(huge_HD), QGVAR(huge)}; - GVAR(metal) = 140000; - GVAR(charge) = 87000; - GVAR(gurney_c) = 2320; - GVAR(gurney_k) = "1/2"; - }; - class BombCore; - class Bo_Mk82: BombCore { - GVAR(enabled) = 1; - - GVAR(classes)[] = {QGVAR(large), QGVAR(large), QGVAR(large_HD), QGVAR(large), QGVAR(huge), QGVAR(huge_HD), QGVAR(huge)}; - GVAR(metal) = 140000; - GVAR(charge) = 87000; - GVAR(gurney_c) = 2320; - GVAR(gurney_k) = "1/2"; - }; - - // ~~~~ Grenades: - class GrenadeBase; - class Grenade; - class GrenadeHand: Grenade { - GVAR(enabled) = 1; - - GVAR(skip) = 0; - GVAR(force) = 1; - // This is a good high-drag frag type for grenades. - GVAR(classes)[] = {QGVAR(tiny_HD)}; - /* - These values are based on the M67 Grenade, should be tweaked for - individual grenades. - */ - GVAR(metal) = 210; // metal in grams - GVAR(charge) = 185; // explosive in grams - GVAR(gurney_c) = 2843; // Gurney velocity constant for explosive type. See: http://en.wikipedia.org/wiki/Gurney_equations - GVAR(gurney_k) = "3/5"; // Gurney shape factor, in this case a sphere. See: http://en.wikipedia.org/wiki/Gurney_equations - }; - class GrenadeHand_stone: GrenadeHand { - GVAR(skip) = 1; - }; - class SmokeShell: GrenadeHand { - GVAR(skip) = 1; - }; - class G_40mm_HE: GrenadeBase { - // Source: http://www.inetres.com/gp/military/infantry/grenade/40mm_ammo.html#M441 - GVAR(enabled) = 1; - GVAR(force) = 1; - - GVAR(classes)[] = {QGVAR(tiny_HD)}; - GVAR(metal) = 200; - GVAR(charge) = 32; - GVAR(gurney_c) = 2700; - GVAR(gurney_k) = "1/2"; - }; - class G_40mm_HEDP: G_40mm_HE { - // Source: http://www.inetres.com/gp/military/infantry/grenade/40mm_ammo.html#M433 - GVAR(enabled) = 1; - - GVAR(classes)[] = {QGVAR(tiny_HD)}; - GVAR(metal) = 200; - GVAR(charge) = 45; - GVAR(gurney_c) = 2830; - GVAR(gurney_k) = "1/2"; - }; - - class ACE_G_40mm_HEDP: G_40mm_HEDP {}; - class ACE_G_40mm_HE: G_40mm_HE {}; - class ACE_G_40mm_Practice: ACE_G_40mm_HE { - GVAR(skip) = 1; - GVAR(force) = 0; - EGVAR(vehicle_damage,incendiary) = 0; - }; - class ACE_G40mm_HE_VOG25P: G_40mm_HE { - GVAR(skip) = 0; - GVAR(force) = 1; - }; - - - // ~~~~ RPGs: - class MissileBase; - class R_PG32V_F; - class R_TBG32V_F: R_PG32V_F { // HE - GVAR(enabled) = 1; - GVAR(metal) = 400; - GVAR(charge) = 210; - GVAR(gurney_c) = 2800; - GVAR(gurney_k) = "3/5"; - GVAR(classes)[] = {"ACE_frag_medium_HD"}; - }; - class M_Titan_AA: MissileBase { - GVAR(skip) = 1; - }; - class M_Titan_AT: MissileBase { - GVAR(skip) = 1; - }; - class M_Titan_AP: M_Titan_AT { // "anti personnel" - GVAR(skip) = 0; - GVAR(enabled) = 1; - GVAR(metal) = 400; - GVAR(charge) = 210; - GVAR(gurney_c) = 2800; - GVAR(gurney_k) = "3/5"; - GVAR(classes)[] = {"ACE_frag_medium_HD"}; - }; - - // https://ofb.gov.in/product/products/product-details/84-mm-he-round-ffv-441-b - // https://armypubs.army.mil/epubs/DR_pubs/DR_a/pdf/web/ARN18072_TC%203-22x84%20FINAL%20WEB.pdf (page 99, Table A-6. HE 441D RS, 84-mm projectile) - class R_MRAAWS_HEAT_F; - class R_MRAAWS_HE_F: R_MRAAWS_HEAT_F { - GVAR(enabled) = 1; - GVAR(metal) = 2300; - GVAR(charge) = 590; - GVAR(gurney_c) = 2800; - GVAR(gurney_k) = "1/2"; - GVAR(classes)[] = {"ACE_frag_small"}; - }; - - - // ~~~~ Missiles: - class M_PG_AT; - class M_AT: M_PG_AT { // DAR (Hydra 70) - // Source: http://fas.org/man/dod-101/sys/missile/hydra-70.htm - GVAR(enabled) = 1; - - GVAR(classes)[] = {QGVAR(medium), QGVAR(medium_HD)}; - GVAR(metal) = 3850; - GVAR(charge) = 1040; - GVAR(gurney_c) = 2700; - GVAR(gurney_k) = "1/2"; - }; - class RocketBase; - class R_80mm_HE: RocketBase { - GVAR(skip) = 1; - }; - class Missile_AGM_02_F: MissileBase { - // Source: http://fas.org/man/dod-101/sys/smart/agm-65.htm - GVAR(enabled) = 1; - - GVAR(classes)[] = {QGVAR(medium), QGVAR(medium_HD)}; - GVAR(metal) = 56250; - GVAR(charge) = 39000; - GVAR(gurney_c) = 2700; - GVAR(gurney_k) = "1/2"; - }; - class Rocket_04_HE_F: MissileBase { // Shrieker (Hydra 70) - GVAR(enabled) = 1; - GVAR(classes)[] = {QGVAR(medium), QGVAR(medium_HD)}; - GVAR(metal) = 3850; - GVAR(charge) = 1040; - GVAR(gurney_c) = 2700; - GVAR(gurney_k) = "1/2"; - }; - class M_Scalpel_AT: MissileBase { // 9K121 Vikhr - GVAR(enabled) = 1; - GVAR(classes)[] = {QGVAR(medium), QGVAR(medium_HD)}; - GVAR(metal) = 10000; - GVAR(charge) = 3000; - GVAR(gurney_c) = 2700; - GVAR(gurney_k) = "1/2"; - }; - class ACE_Hellfire_AGM114K: M_Scalpel_AT { - // Source: http://www.designation-systems.net/dusrm/m-114.html - GVAR(enabled) = 1; - - GVAR(classes)[] = {QGVAR(medium), QGVAR(medium_HD)}; - GVAR(metal) = 8000; - GVAR(charge) = 2400; - GVAR(gurney_c) = 2700; - GVAR(gurney_k) = "1/2"; - }; - class M_Air_AA: MissileBase { - GVAR(skip) = 1; - }; - class Missile_AA_04_F: MissileBase { - GVAR(skip) = 1; - }; - - // curator ammo entries - class ShellBase; - class Sh_125mm_HEAT; - class Sh_155mm_AMOS: ShellBase { - // Source: http://www.globalsecurity.org/military/systems/munitions/m795.htm - GVAR(enabled) = 1; - - GVAR(classes)[] = {QGVAR(large), QGVAR(large), QGVAR(large_HD), QGVAR(large), QGVAR(huge), QGVAR(huge_HD), QGVAR(huge)}; - GVAR(metal) = 36000; - GVAR(charge) = 9979; - GVAR(gurney_c) = 2440; - GVAR(gurney_k) = "1/2"; - }; - class Sh_82mm_AMOS: Sh_155mm_AMOS { - // Source: http://www.arsenal-bg.com/defense_police/mortar_bombs_82mm.htm - GVAR(enabled) = 1; - - GVAR(classes)[] = {QGVAR(medium), QGVAR(medium_HD)}; - GVAR(metal) = 3200; - GVAR(charge) = 420; - GVAR(gurney_c) = 2440; - GVAR(gurney_k) = "1/2"; - }; - class ModuleOrdnanceMortar_F_Ammo: Sh_82mm_AMOS { - GVAR(enabled) = 1; - - GVAR(classes)[] = {QGVAR(medium), QGVAR(medium_HD)}; - GVAR(metal) = 800; - GVAR(charge) = 4200; - GVAR(gurney_c) = 2320; - GVAR(gurney_k) = "1/2"; - }; - class Sh_105mm_HEAT_MP: Sh_125mm_HEAT { - GVAR(enabled) = 1; - - GVAR(classes)[] = {QGVAR(medium), QGVAR(medium_HD)}; - GVAR(metal) = 11400; - GVAR(charge) = 7100; - GVAR(gurney_c) = 2800; - GVAR(gurney_k) = "1/2"; - }; - class Sh_120mm_HE: ShellBase { - GVAR(enabled) = 1; - - GVAR(classes)[] = {QGVAR(medium), QGVAR(medium_HD)}; - GVAR(metal) = 23000; - GVAR(charge) = 3148; - GVAR(gurney_c) = 2830; - GVAR(gurney_k) = "1/2"; - }; - class Sh_125mm_HE: Sh_120mm_HE { - GVAR(enabled) = 1; - - GVAR(classes)[] = {QGVAR(medium), QGVAR(medium_HD)}; - GVAR(metal) = 16000; - GVAR(charge) = 3200; - GVAR(gurney_c) = 2440; - GVAR(gurney_k) = "1/2"; - }; - class ModuleOrdnanceHowitzer_F_ammo: Sh_155mm_AMOS { - GVAR(enabled) = 1; - - GVAR(classes)[] = {QGVAR(large), QGVAR(large), QGVAR(large_HD), QGVAR(large), QGVAR(huge), QGVAR(huge_HD), QGVAR(huge)}; - GVAR(metal) = 1950; - GVAR(charge) = 15800; - GVAR(gurney_c) = 2320; - GVAR(gurney_k) = "1/2"; - }; - - - class B_65x39_Caseless; + class B_65x39_Caseless: BulletBase {}; class GVAR(base): B_65x39_Caseless { ACE_damageType = "grenade"; // compatibility with medical_damage, shrapnel should produce grenade wounds - timeToLive = 12; + timeToLive = 4; typicalSpeed = 1500; + maxSpeed = 1500; deflecting = 65; + GVAR(skip) = 1; }; class GVAR(tiny): GVAR(base) { @@ -317,7 +61,7 @@ class CfgAmmo { }; class GVAR(large_HD): GVAR(large) { - hit = 28; + hit = 28; indirectHit = 2; indirectHitRange = 0.25; airFriction = QUOTE(BASE_DRAG_HD*0.65); @@ -340,21 +84,6 @@ class CfgAmmo { caliber = 2.8; }; - class GVAR(spall_small): GVAR(small) { - timeToLive = 0.1; - }; - - class GVAR(spall_medium): GVAR(medium) { - timeToLive = 0.15; - }; - - class GVAR(spall_large): GVAR(large) { - timeToLive = 0.25; - }; - - class GVAR(spall_huge): GVAR(huge) { - timeToLive = 0.3; - }; - - #include "CfgAmmoReflections.hpp" + #include "CfgAmmoSpall.hpp" + #include "CfgAmmoFragParameters.hpp" }; diff --git a/addons/frag/CfgAmmoBaseClasses.hpp b/addons/frag/CfgAmmoBaseClasses.hpp new file mode 100644 index 00000000000..413dfe3dd93 --- /dev/null +++ b/addons/frag/CfgAmmoBaseClasses.hpp @@ -0,0 +1,47 @@ +// We need this since autocannons generally inherit from BulletBase +class BulletCore; +class BulletBase: BulletCore {}; + +class GrenadeCore; +class GrenadeBase: GrenadeCore {}; + +class LaserBombCore; +class ammo_Bomb_LaserGuidedBase: LaserBombCore {}; + +class MissileCore; +class MissileBase: MissileCore {}; + +class RocketCore; +class RocketBase: RocketCore { + GVAR(skip) = 1; +}; + +class ArtilleryRocketCore: RocketCore {}; + +class ShellCore; +class ShellBase: ShellCore {}; + +class ShotDeployCore; +class ShotDeployBase: ShotDeployCore { + GVAR(skip) = 1; +}; + +class ShotgunCore; +class ShotgunBase: ShotgunCore {}; + +class SubmunitionCore; +class SubmunitionBase: SubmunitionCore { + GVAR(skip) = 1; +}; + +class BoundingMineCore; +class BoundingMineBase: BoundingMineCore {}; + +class PipeBombCore; +class PipeBombBase: PipeBombCore {}; + +class DirectionalBombCore; +class DirectionalBombBase: DirectionalBombCore {}; + +class MineCore; +class MineBase: MineCore {}; diff --git a/addons/frag/CfgAmmoFragParameters.hpp b/addons/frag/CfgAmmoFragParameters.hpp new file mode 100644 index 00000000000..588032673d2 --- /dev/null +++ b/addons/frag/CfgAmmoFragParameters.hpp @@ -0,0 +1,803 @@ +// ~~~~ Autocannons +class B_19mm_HE: BulletBase { + GVAR(skip) = 1; +}; + +class B_20mm: BulletBase { + // Used in Weisel/AWC Nyx, which makes it a Rheinmetall Mk 20 Rh-202 + // Based on jane's ammunition handbook ~2002 (archive.org) + GVAR(skip) = 1; + GVAR(charge) = 6; + GVAR(metal) = 114; + GVAR(gurney_c) = 2830; + GVAR(gurney_k) = "1/2"; + GVAR(classes)[] = {QGVAR(tiny_HD)}; +}; + +class B_20mm_AP: BulletBase { + GVAR(skip) = 1; +}; + +class ammo_Gun20mmAABase: BulletBase { // 20x139mm + GVAR(skip) = 1; + GVAR(charge) = 6; + GVAR(metal) = 114; + GVAR(gurney_c) = 2830; + GVAR(gurney_k) = "1/2"; + GVAR(classes)[] = {QGVAR(tiny_HD)}; +}; + +class ammo_Gun30mmAABase: BulletBase { // 30x210mm HEI + GVAR(skip) = 0; + GVAR(charge) = 40; + GVAR(metal) = 410; + GVAR(gurney_k) = "1/2"; + GVAR(gurney_c) = 2901; + GVAR(classes)[] = {QGVAR(tiny_HD), QGVAR(tiny_HD), QGVAR(small_HD)}; + +}; + +class B_30mm_HE: B_19mm_HE { + // Used in Gorgon (Pandur II), assuming it's a L21A1 RARDEN, specifically HEI-T due to tracers + // https://ordtech-industries.com/30x170-mm-ammunition-for-cannons-oerlikon-kcb-hispano-hs831l-l21-rarden/ + GVAR(skip) = 0; + GVAR(charge) = 25; + GVAR(metal) = 320; + GVAR(gurney_c) = 2552; + GVAR(gurney_k) = "1/2"; + GVAR(classes)[] = {QGVAR(tiny_HD), QGVAR(tiny_HD), QGVAR(small_HD)}; +}; +class B_30mm_MP: B_30mm_HE { + // Used in Mora (FV510 Warrior), assuming it's a Mk44 Bushmaster II, specifically HEI-T due to tracers + // http://www.navweaps.com/Weapons/WNUS_30mm_BushmasterII.php + GVAR(metal) = 388; + GVAR(charge) = 56; + GVAR(gurney_c) = 2600; + GVAR(gurney_k) = "1/2"; + GVAR(classes)[] = {QGVAR(tiny_HD), QGVAR(tiny_HD), QGVAR(small_HD)}; +}; + +class Gatling_30mm_HE_Plane_CAS_01_F: BulletBase { + GVAR(skip) = 0; + GVAR(classes)[] = {QGVAR(tiny_HD), QGVAR(small_HD)}; + GVAR(metal) = 388; + GVAR(charge) = 56; + GVAR(gurney_c) = 2600; // guessed + GVAR(gurney_k) = "1/2"; +}; + +class ammo_Gun35mmAABase: BulletBase { + // Gepard uses an Oerlikon GDF and the AA vehicles mimics it like it + // https://en.wikipedia.org/wiki/Oerlikon_GDF#Ammunition + // https://www.nammo.com/product/our-products/ammunition/medium-caliber-ammunition/35-mm-series/35-mm-x-228-hei-sd-and-hei-t-sd/ + GVAR(skip) = 0; + GVAR(charge) = 98; + GVAR(metal) = 400; + GVAR(gurney_k) = "1/2"; + GVAR(gurney_c) = 2700; + GVAR(classes)[] = {QGVAR(tiny_HD), QGVAR(tiny_HD), QGVAR(small_HD)}; +}; + +class B_35mm_AA: BulletBase { + // Gepard uses an Oerlikon GDF and the AA vehicles mimics it like it + // https://en.wikipedia.org/wiki/Oerlikon_GDF#Ammunition + // https://www.nammo.com/product/our-products/ammunition/medium-caliber-ammunition/35-mm-series/35-mm-x-228-hei-sd-and-hei-t-sd/ + GVAR(skip) = 0; + GVAR(charge) = 98; + GVAR(metal) = 400; + GVAR(gurney_k) = "1/2"; + GVAR(gurney_c) = 2700; + GVAR(classes)[] = {QGVAR(tiny_HD), QGVAR(tiny_HD), QGVAR(small_HD)}; +}; + +class B_40mm_GPR: B_30mm_HE { + // Based on noted 40mm Autocannons, base ROF, and ammo names, looks to be a CTAS40, specifically GPR-PD-T + // https://www.cta-international.com/ammunition/ + // https://ndiastorage.blob.core.usgovcloudapi.net/ndia/2002/gun/leslie.pdf + GVAR(classes)[] = {QGVAR(tiny_HD), QGVAR(small_HD)}; + GVAR(metal) = 750; + GVAR(charge) = 120; + GVAR(gurney_c) = 2700; // guessed + GVAR(gurney_k) = "1/2"; +}; +class UnderwaterMine_Range_Ammo: MineBase { + GVAR(skip) = 1; +}; + +// ~~~~ Bombs: +class Bo_GBU12_LGB: ammo_Bomb_LaserGuidedBase { + GVAR(skip) = 0; + GVAR(charge) = 87000; + GVAR(metal) = 140000; + GVAR(gurney_c) = 2320; + GVAR(gurney_k) = "1/2"; + GVAR(classes)[] = {QGVAR(large), QGVAR(large), QGVAR(large_HD), QGVAR(large_HD), QGVAR(huge_HD), QGVAR(huge_HD), QGVAR(huge_HD)}; +}; +class Bomb_03_F: ammo_Bomb_LaserGuidedBase { + GVAR(skip) = 0; + GVAR(charge) = 100000; + GVAR(metal) = 150000; + GVAR(gurney_c) = 2320; + GVAR(gurney_k) = "1/2"; + GVAR(classes)[] = {QGVAR(large), QGVAR(large), QGVAR(large_HD), QGVAR(large_HD), QGVAR(huge_HD), QGVAR(huge_HD), QGVAR(huge_HD)}; +}; +class Bomb_04_F: ammo_Bomb_LaserGuidedBase { + GVAR(skip) = 0; + GVAR(charge) = 87000; + GVAR(metal) = 140000; + GVAR(gurney_c) = 2320; + GVAR(gurney_k) = "1/2"; + GVAR(classes)[] = {QGVAR(large), QGVAR(large), QGVAR(large_HD), QGVAR(large_HD), QGVAR(huge_HD), QGVAR(huge_HD), QGVAR(huge_HD)}; +}; +class BombCluster_01_Ammo_F: Bomb_04_F { + GVAR(skip) = 1; +}; +class ammo_Bomb_SmallDiameterBase: ammo_Bomb_LaserGuidedBase { + GVAR(skip) = 0; + GVAR(charge) = 160; // kg + GVAR(metal) = 113; // kg + GVAR(gurney_c) = 2830; + GVAR(gurney_k) = "1/2"; + GVAR(classes)[] = {QGVAR(medium), QGVAR(medium_HD), QGVAR(large), QGVAR(large_HD), QGVAR(huge_HD), QGVAR(huge_HD)}; +}; + +class BombCore; +class Bo_Mk82: BombCore { + GVAR(classes)[] = {QGVAR(large), QGVAR(large), QGVAR(large_HD), QGVAR(large_HD), QGVAR(huge_HD), QGVAR(huge_HD), QGVAR(huge_HD)}; + GVAR(metal) = 140000; + GVAR(charge) = 87000; + GVAR(gurney_c) = 2320; + GVAR(gurney_k) = "1/2"; +}; + +class Mo_cluster_AP: ShellBase { + GVAR(skip) = 1; + GVAR(force) = 0; +}; +class Mo_cluster_Bomb_01_F: Mo_cluster_AP { // Mk 118 Rockeye + GVAR(skip) = 0; + GVAR(classes)[] = {QGVAR(small_HD)}; + GVAR(metal) = 400; + GVAR(charge) = 180; + GVAR(gurney_c) = 2700; + GVAR(gurney_k) = "1/2"; +}; +class Mo_cluster_Bomb_02_F: Mo_cluster_Bomb_01_F { // ShOAB-0.5 + GVAR(classes)[] = {QGVAR(small_HD)}; + GVAR(metal) = 400; + GVAR(charge) = 100; + GVAR(gurney_c) = 2700; +}; +class Mo_cluster_Bomb_03_F: Mo_cluster_Bomb_01_F { // idk, @lambda.tiger on the ace discord if you find out + GVAR(classes)[] = {QGVAR(small_HD)}; + GVAR(metal) = 400; + GVAR(charge) = 140; + GVAR(gurney_c) = 2400; +}; + +// ~~~~ Grenades: +class Grenade; +class GrenadeHand: Grenade { + GVAR(skip) = 0; + GVAR(force) = 1; + /* + These values are based on the M67 Grenade, should be tweaked for + individual grenades. + */ + GVAR(classes)[] = {QGVAR(tiny_HD)}; + GVAR(metal) = 210; // metal in grams + GVAR(charge) = 185; // explosive in grams + GVAR(gurney_c) = 2843; // Gurney velocity constant for explosive type. See: http://en.wikipedia.org/wiki/Gurney_equations + GVAR(gurney_k) = "3/5"; // Gurney shape factor, in this case a sphere. See: http://en.wikipedia.org/wiki/Gurney_equations +}; +class mini_Grenade: GrenadeHand { + GVAR(classes)[] = {QGVAR(tiny_HD)}; + GVAR(metal) = 104; + GVAR(charge) = 36; +}; +class GrenadeHand_stone: GrenadeHand { + GVAR(skip) = 1; +}; +class SmokeShell: GrenadeHand { + GVAR(skip) = 1; +}; +class G_40mm_HE: GrenadeBase { + // Source: http://www.inetres.com/gp/military/infantry/grenade/40mm_ammo.html#M441 + GVAR(skip) = 0; + GVAR(force) = 1; + GVAR(classes)[] = {QGVAR(small_HD), QGVAR(tiny_HD), QGVAR(small_HD)}; + GVAR(metal) = 200; + GVAR(charge) = 32; + GVAR(gurney_c) = 2700; + GVAR(gurney_k) = "3/5"; // interior fragmenter/charge is a sphere +}; +class G_20mm_HE: G_40mm_HE { + GVAR(classes)[] = {QGVAR(tiny_HD)}; + GVAR(metal) = 50; + GVAR(charge) = 8; + GVAR(gurney_c) = 2700; + GVAR(gurney_k) = "3/5"; // interior fragmenter/charge is a sphere +}; +class G_40mm_HEDP: G_40mm_HE { + // Source: http://www.inetres.com/gp/military/infantry/grenade/40mm_ammo.html#M433 + GVAR(classes)[] = {QGVAR(tiny_HD), QGVAR(small_HD), QGVAR(small_HD)}; + GVAR(metal) = 200; + GVAR(charge) = 45; + GVAR(gurney_c) = 2830; + GVAR(gurney_k) = "1/2"; +}; + +class ACE_G_40mm_HEDP: G_40mm_HEDP {}; +class ACE_G_40mm_HE: G_40mm_HE {}; +class ACE_G_40mm_Practice: ACE_G_40mm_HE { + GVAR(skip) = 1; + GVAR(force) = 0; + EGVAR(vehicle_damage,incendiary) = 0; +}; + +// ~~~~ Mines & UXO +class ATMine_Range_Ammo: MineBase { + GVAR(skip) = 1; +}; + +class APERSMine_Range_Ammo: MineBase { // VS-50 + GVAR(skip) = 0; + GVAR(force) = 1; + GVAR(classes)[] = {QGVAR(tiny_HD), QGVAR(tiny_HD), QGVAR(small_HD)}; + GVAR(metal) = 100; + GVAR(charge) = 50; + GVAR(gurney_c) = 2700; + GVAR(gurney_k) = "1/3"; +}; + +class APERSBoundingMine_Range_Ammo: BoundingMineBase { + GVAR(skip) = 0; + GVAR(force) = 0; + GVAR(classes)[] = {QGVAR(tiny_HD)}; + GVAR(metal) = 80; + GVAR(charge) = 170; + GVAR(gurney_c) = 2700; + GVAR(gurney_k) = "3/5"; +}; + +class TrainingMine_Ammo: APERSMine_Range_Ammo { + GVAR(skip) = 1; +}; + +class SLAMDirectionalMine_Wire_Ammo: DirectionalBombBase { + GVAR(skip) = 1; +}; + +class APERSTripMine_Wire_Ammo: DirectionalBombBase { + GVAR(skip) = 0; + GVAR(force) = 0; + GVAR(classes)[] = {QGVAR(tiny_HD)}; + GVAR(metal) = 210; + GVAR(charge) = 185; + GVAR(gurney_c) = 2843; + GVAR(gurney_k) = "3/5"; +}; + +class IEDUrbanBig_Remote_Ammo: PipeBombBase { + GVAR(skip) = 0; + GVAR(classes)[] = {QGVAR(large), QGVAR(large_HD), QGVAR(large_HD), QGVAR(large_HD), QGVAR(huge_HD), QGVAR(huge_HD), QGVAR(huge_HD)}; + GVAR(metal) = 36000; + GVAR(charge) = 9979; + GVAR(gurney_c) = 2440; + GVAR(gurney_k) = "3/5"; +}; +class IEDLandBig_Remote_Ammo: PipeBombBase { + GVAR(skip) = 0; + GVAR(classes)[] = {QGVAR(large), QGVAR(large_HD), QGVAR(large_HD), QGVAR(large_HD), QGVAR(huge_HD), QGVAR(huge_HD), QGVAR(huge_HD)}; + GVAR(metal) = 36000; + GVAR(charge) = 9979; + GVAR(gurney_c) = 2440; + GVAR(gurney_k) = "3/5"; +}; +class IEDUrbanSmall_Remote_Ammo: PipeBombBase { + GVAR(skip) = 0; + GVAR(metal) = 23000; + GVAR(charge) = 3148; + GVAR(gurney_c) = 2830; + GVAR(gurney_k) = "3/5"; + GVAR(classes)[] = {QGVAR(small), QGVAR(medium_HD), QGVAR(medium_HD)}; +}; +class IEDLandSmall_Remote_Ammo: PipeBombBase { + GVAR(skip) = 0; + GVAR(metal) = 23000; + GVAR(charge) = 3148; + GVAR(gurney_c) = 2830; + GVAR(gurney_k) = "3/5"; + GVAR(classes)[] = {QGVAR(small), QGVAR(medium_HD), QGVAR(medium_HD)}; +}; + +class APERSMineDispenser_Ammo: PipeBombBase { + GVAR(skip) = 1; +}; + +class UXO1_Ammo_Base_F: APERSMine_Range_Ammo { // Mk 118 Rockeye + GVAR(skip) = 0; + GVAR(charge) = 180; + GVAR(metal) = 400; + GVAR(gurney_c) = 2700; + GVAR(gurney_k) = "1/2"; + GVAR(classes)[] = {QGVAR(small_HD)}; +}; + +class UXO2_Ammo_Base_F: UXO1_Ammo_Base_F { + GVAR(charge) = 100; + GVAR(classes)[] = {QGVAR(small_HD), QGVAR(tiny_HD)}; +}; + +class APERSMineDispenser_Mine_Ammo: APERSMine_Range_Ammo { + GVAR(skip) = 1; +}; + +class UXO_deploy_base_f: SubmunitionBase {}; + +class ClaymoreDirectionalMine_Remote_Ammo: DirectionalBombBase { + GVAR(skip) = 0; + GVAR(force) = 0; + GVAR(classes)[] = {QGVAR(tiny), QGVAR(small)}; + GVAR(fragCount) = 700; + GVAR(metal) = 700; + GVAR(charge) = 680; + GVAR(gurney_c) = 2700; + GVAR(gurney_k) = "3/5"; +}; + +class SatchelCharge_Remote_Ammo: PipeBombBase { + GVAR(skip) = 1; +}; + +class DemoCharge_Remote_Ammo: PipeBombBase { + GVAR(skip) = 1; +}; + +class Drone_explosive_ammo: MineBase { + GVAR(skip) = 1; +}; + +class BombDemine_01_Ammo_F: BombCore { + GVAR(skip) = 1; +}; + +class BombDemine_01_SubAmmo_F: ShellBase { + GVAR(skip) = 1; +}; + +// ~~~~ Rockets: +class R_PG7_F: RocketBase { + GVAR(skip) = 0; + GVAR(force) = 0; + GVAR(classes)[] = {QGVAR(tiny), QGVAR(small_HD)}; + GVAR(metal) = 100; + GVAR(charge) = 560; + GVAR(gurney_c) = 2730; + GVAR(gurney_k) = "1/2"; +}; + +class R_PG32V_F: RocketBase { + GVAR(skip) = 1; +}; +class R_TBG32V_F: R_PG32V_F { // Thermobaric + GVAR(skip) = 0; + GVAR(metal) = 400; + GVAR(charge) = 210; + GVAR(gurney_c) = 2800; + GVAR(gurney_k) = "3/5"; + GVAR(classes)[] = {QGVAR(medium_HD)}; +}; + +class M_SPG9_HEAT: RocketBase { + GVAR(skip) = 0; + GVAR(metal) = 4150; + GVAR(charge) = 340; + GVAR(gurney_c) = 2970; + GVAR(gurney_k) = "1/2"; + GVAR(classes)[] = {QGVAR(small_HD), QGVAR(medium_HD)}; +}; +class M_SPG9_HE: M_SPG9_HEAT { + GVAR(metal) = 4695; + GVAR(charge) = 655; + GVAR(gurney_c) = 2800; + GVAR(gurney_k) = "1/2"; + GVAR(classes)[] = {QGVAR(small_HD), QGVAR(tiny), QGVAR(medium_HD), QGVAR(medium_HD)}; +}; + +// https://armypubs.army.mil/epubs/DR_pubs/DR_a/pdf/web/ARN18072_TC%203-22x84%20FINAL%20WEB.pdf +class R_MRAAWS_HEAT_F: RocketBase { // Table A-20. HEAT 751 + GVAR(skip) = 0; + GVAR(metal) = 2265; + GVAR(charge) = 635; + GVAR(gurney_c) = 2970; + GVAR(gurney_k) = "1/2"; + GVAR(classes)[] = {QGVAR(small_HD)}; + +}; +class R_MRAAWS_HEAT55_F: R_MRAAWS_HEAT_F { // Table A-16. HEAT 551C + GVAR(metal) = 1940; + GVAR(charge) = 460; +}; +class R_MRAAWS_HE_F: R_MRAAWS_HEAT_F { // Table A-6. HE 441D RS + GVAR(metal) = 2300; + GVAR(charge) = 590; + GVAR(gurney_c) = 2800; + GVAR(gurney_k) = "3/5"; + GVAR(classes)[] = {QGVAR(small_HD)}; +}; + +class R_80mm_HE: RocketBase { // S-8D + GVAR(skip) = 0; + GVAR(charge) = 2150; + GVAR(metal) = 1650; + GVAR(gurney_c) = 2700; + GVAR(gurney_k) = "1/2"; + GVAR(classes)[] = {QGVAR(small_HD), QGVAR(tiny_HD), QGVAR(tiny)}; +}; +class R_60mm_HE: R_80mm_HE { // no idea but looks like a FFAR so made it weaker + GVAR(metal) = 1040; + GVAR(charge) = 3850; +}; + +class m_70mm_saami: MissileBase { + GVAR(skip) = 0; + GVAR(charge) = 2150; + GVAR(metal) = 1650; + GVAR(gurney_c) = 2700; + GVAR(gurney_k) = "1/2"; + GVAR(classes)[] = {QGVAR(small_HD), QGVAR(tiny_HD), QGVAR(tiny)}; +}; + +class Rocket_04_HE_F: MissileBase { // Shrieker (Hydra 70) + GVAR(skip) = 0; + GVAR(classes)[] = {QGVAR(medium), QGVAR(medium_HD)}; + GVAR(metal) = 3850; + GVAR(charge) = 1040; + GVAR(gurney_c) = 2700; + GVAR(gurney_k) = "1/2"; +}; +class Rocket_03_HE_F: Rocket_04_HE_F { // S-8DM makes the most sense + GVAR(metal) = 1800; + GVAR(charge) = 2000; + GVAR(gurney_c) = 2300; +}; +class Rocket_04_AP_F: Rocket_04_HE_F { + GVAR(skip) = 1; +}; + +class ammo_Missile_CannonLaunchedBase: MissileBase { + GVAR(skip) = 1; +}; + +class R_230mm_fly: ShellBase { + GVAR(skip) = 0; + GVAR(charge) = 100; // kg + GVAR(metal) = 150; // kg + GVAR(gurney_c) = 2320; + GVAR(gurney_k) = "3/5"; + GVAR(classes)[] = {QGVAR(large_HD), QGVAR(large), QGVAR(large), QGVAR(large), QGVAR(huge_HD), QGVAR(huge_HD), QGVAR(huge)}; +}; + +class M_PG_AT: MissileBase { // DAGR M247 warhead + GVAR(skip) = 0; + GVAR(classes)[] = {QGVAR(tiny_HD), QGVAR(small_HD), QGVAR(small), QGVAR(medium)}; + GVAR(charge) = 910; + GVAR(metal) = 3085; + GVAR(gurney_c) = 2700; + GVAR(gurney_k) = "1/2"; +}; +class M_AT: M_PG_AT { // DAR (Hydra 70) M151 warhead + GVAR(classes)[] = {QGVAR(medium), QGVAR(medium_HD)}; + GVAR(charge) = 1040; + GVAR(metal) = 3850; + GVAR(gurney_c) = 2700; +}; + +// ~~~~ Missiles: +class Missile_AGM_02_F: MissileBase { + // Source: http://fas.org/man/dod-101/sys/smart/agm-65.htm + GVAR(skip) = 0; + GVAR(classes)[] = {QGVAR(medium), QGVAR(medium_HD)}; + GVAR(metal) = 56250; + GVAR(charge) = 39000; + GVAR(gurney_c) = 2700; + GVAR(gurney_k) = "1/2"; +}; +class Missile_AGM_01_F: Missile_AGM_02_F { // Kh-25MTP !!! fix me +}; +class M_Jian_AT: Missile_AGM_01_F { // imaginary missile? Not simiklar to any modern HJ-x or otherwise +}; + +class M_Titan_AA: MissileBase { + GVAR(skip) = 0; + GVAR(metal) = 1980; + GVAR(charge) = 1020; + GVAR(gurney_c) = 2501; + GVAR(gurney_k) = "1/2"; + GVAR(classes)[] = {QGVAR(tiny), QGVAR(tiny_HD), QGVAR(small_HD)}; +}; +class M_Titan_AT: MissileBase { + GVAR(skip) = 1; +}; +class M_Titan_AP: M_Titan_AT { + GVAR(skip) = 0; + GVAR(metal) = 400; + GVAR(charge) = 210; + GVAR(gurney_c) = 2800; + GVAR(gurney_k) = "3/5"; + GVAR(classes)[] = {QGVAR(medium_HD)}; +}; + +class M_Scalpel_AT: MissileBase { // 9K121 Vikhr + GVAR(skip) = 0; + GVAR(classes)[] = {QGVAR(medium), QGVAR(medium_HD)}; + GVAR(metal) = 10000; + GVAR(charge) = 3000; + GVAR(gurney_c) = 2700; + GVAR(gurney_k) = "1/2"; +}; +class ACE_Hellfire_AGM114K: M_Scalpel_AT { + // Source: http://www.designation-systems.net/dusrm/m-114.html + GVAR(skip) = 0; + + GVAR(classes)[] = {QGVAR(medium), QGVAR(medium_HD)}; + GVAR(metal) = 8000; + GVAR(charge) = 2400; + GVAR(gurney_c) = 2700; + GVAR(gurney_k) = "1/2"; +}; + +class ammo_Missile_CruiseBase: MissileBase {}; +class ammo_missile_cruise_01: ammo_Missile_CruiseBase { + GVAR(skip) = 0; + GVAR(classes)[] = {QGVAR(small), QGVAR(medium_HD), QGVAR(large_HD)}; + GVAR(metal) = 700000; + GVAR(charge) = 110000; + GVAR(gurney_c) = 2600; + GVAR(gurney_k) = "3/5"; +}; +class ammo_Missile_Cruise_01_Cluster: ammo_missile_cruise_01 {}; + +class ammo_Missile_AntiRadiationBase: MissileBase { + GVAR(gurney_k) = "1/2"; + GVAR(gurney_c) = 2400; +}; +class ammo_Missile_HARM: ammo_Missile_AntiRadiationBase { + GVAR(skip) = 0; + GVAR(classes)[] = {QGVAR(small), QGVAR(medium_HD), QGVAR(large_HD)}; + GVAR(charge) = 10000; + GVAR(metal) = 58000; +}; +class ammo_Missile_KH58: ammo_Missile_AntiRadiationBase { + GVAR(skip) = 0; + GVAR(classes)[] = {QGVAR(small), QGVAR(medium_HD), QGVAR(large_HD)}; + GVAR(charge) = 20000; + GVAR(metal) = 129000; +}; + +class M_Zephyr: M_Titan_AA { // model is an AMRAAM- WDU-41/B warhead + GVAR(skip) = 0; + GVAR(metal) = 12800; + GVAR(charge) = 4000; + GVAR(gurney_c) = 2900; + GVAR(gurney_k) = "1/2"; + GVAR(classes)[] = {QGVAR(tiny), QGVAR(medium_HD), QGVAR(small), QGVAR(small_HD)}; +}; + +class M_Air_AA: MissileBase { // Looks not real, maybe r-73 inspired? + GVAR(skip) = 0; + GVAR(charge) = 2450; + GVAR(metal) = 4950; + GVAR(gurney_c) = 2700; + GVAR(gurney_k) = "1/2"; + GVAR(classes)[] = {QGVAR(tiny), QGVAR(medium_HD), QGVAR(small_HD), QGVAR(small_HD)}; +}; + +class Missile_AA_04_F: MissileBase { + GVAR(skip) = 0; + GVAR(charge) = 4400; + GVAR(metal) = 5000; + GVAR(gurney_c) = 2830; + GVAR(gurney_k) = "1/2"; +}; +class Missile_AA_03_F: Missile_AA_04_F { + GVAR(charge) = 2450; + GVAR(metal) = 4950; + GVAR(gurney_c) = 2700; +}; + +class ammo_Missile_ShortRangeAABase: MissileBase { + GVAR(gurney_k) = "1/2"; +}; +class ammo_Missile_rim116: ammo_Missile_ShortRangeAABase { + GVAR(skip) = 0; + GVAR(charge) = 400; + GVAR(metal) = 730; + GVAR(gurney_c) = 2400; + GVAR(classes)[] = {QGVAR(tiny), QGVAR(small_HD)}; +}; +class ammo_Missile_BIM9X: ammo_Missile_ShortRangeAABase { + GVAR(skip) = 0; + GVAR(charge) = 440; + GVAR(metal) = 500; + GVAR(gurney_c) = 2900; + GVAR(classes)[] = {QGVAR(small), QGVAR(tiny)}; +}; +class ammo_Missile_AA_R73: ammo_Missile_ShortRangeAABase { + GVAR(skip) = 0; + GVAR(charge) = 2450; + GVAR(metal) = 4950; + GVAR(gurney_c) = 2700; + GVAR(classes)[] = {QGVAR(small), QGVAR(small), QGVAR(tiny)}; +}; + +class ammo_Missile_MediumRangeAABase: MissileBase { + GVAR(gurney_c) = 2900; + GVAR(gurney_k) = "1/2"; +}; +class ammo_Missile_rim162: ammo_Missile_MediumRangeAABase { + GVAR(skip) = 0; + GVAR(charge) = 138; // dg + GVAR(metal) = 252; // dg + GVAR(gurney_c) = 2400; + GVAR(classes)[] = {QGVAR(small), QGVAR(medium), QGVAR(medium), QGVAR(large)}; +}; +class ammo_Missile_AMRAAM_C: ammo_Missile_MediumRangeAABase { + GVAR(skip) = 0; + GVAR(charge) = 70; // dg + GVAR(metal) = 128; // dg + GVAR(classes)[] = {QGVAR(small), QGVAR(medium), QGVAR(medium)}; +}; +class ammo_Missile_AMRAAM_D: ammo_Missile_MediumRangeAABase { + GVAR(skip) = 0; + GVAR(charge) = 70; // dg + GVAR(metal) = 128; // dg + GVAR(classes)[] = {QGVAR(small), QGVAR(medium), QGVAR(medium)}; +}; +class ammo_Missile_AA_R77: ammo_Missile_MediumRangeAABase { + GVAR(skip) = 0; + GVAR(charge) = 80; // dg + GVAR(metal) = 145; // dg + GVAR(gurney_c) = 2700; + GVAR(classes)[] = {QGVAR(small), QGVAR(medium), QGVAR(large), QGVAR(large)}; +}; + +class M_Vorona_HEAT: MissileBase { + // tandem shaped charges + GVAR(skip) = 1; +}; +class M_Vorona_HE: M_Vorona_HEAT { + // All signs point to this being a thermobaric round so low frag count + GVAR(skip) = 0; + GVAR(metal) = 13800; + GVAR(charge) = 4950; + GVAR(gurney_c) = 2800; + GVAR(gurney_k) = "1/2"; + GVAR(classes)[] = {QGVAR(tiny)}; +}; + +class M_127mm_Firefist_AT: MissileBase { // HOT missile + GVAR(skip) = 1; +}; + +class M_NLAW_AT_F: MissileBase { + GVAR(skip) = 1; +}; + +// ~~~~ Shell +class Sh_75mm_Railgun_APFSDS: ShellBase { + GVAR(skip) = 1; +}; +class Sh_120mm_APFSDS: ShellBase { + GVAR(skip) = 1; +}; +class Sh_125mm_APFSDS: Sh_120mm_APFSDS { + GVAR(skip) = 1; +}; + +class Sh_155mm_AMOS: ShellBase { + // Source: http://www.globalsecurity.org/military/systems/munitions/m795.htm + GVAR(skip) = 0; + GVAR(charge) = 9979; + GVAR(metal) = 36000; + GVAR(gurney_c) = 2440; + GVAR(gurney_k) = "1/2"; + GVAR(classes)[] = {QGVAR(large), QGVAR(large), QGVAR(large_HD), QGVAR(large), QGVAR(huge), QGVAR(huge_HD), QGVAR(huge)}; +}; + +class Sh_82mm_AMOS: Sh_155mm_AMOS { // VO-832DU + GVAR(charge) = 420; + GVAR(metal) = 2680; + GVAR(classes)[] = {QGVAR(medium), QGVAR(medium_HD)}; +}; + +class Sh_120mm_HE: ShellBase { + GVAR(skip) = 0; + GVAR(charge) = 3148; + GVAR(metal) = 23000; + GVAR(gurney_c) = 2830; + GVAR(gurney_k) = "1/2"; + GVAR(classes)[] = {QGVAR(medium), QGVAR(medium_HD)}; +}; +class Sh_120mm_HEAT_MP: ShellBase { + GVAR(skip) = 0; + GVAR(charge) = 2500; + GVAR(metal) = 5000; + GVAR(gurney_c) = 2500; + GVAR(gurney_k) = "1/2"; + GVAR(classes)[] = {QGVAR(small), QGVAR(medium), QGVAR(medium_HD), QGVAR(medium_HD)}; +}; + +class ammo_ShipCannon_120mm_HE: Sh_155mm_AMOS { + GVAR(charge) = 3148; + GVAR(metal) = 23000; + GVAR(gurney_c) = 2830; + GVAR(classes)[] = {QGVAR(small), QGVAR(small), QGVAR(medium_HD), QGVAR(large_HD)}; +}; + +class Sh_125mm_HE: Sh_120mm_HE { + GVAR(metal) = 19900; + GVAR(charge) = 3400; + GVAR(gurney_c) = 2901; +}; + +class Sh_125mm_HEAT: Sh_125mm_HE { + GVAR(skip) = 1; + GVAR(metal) = 16760; + GVAR(charge) = 1640; + GVAR(gurney_c) = 2901; +}; + +class Sh_105mm_HEAT_MP: Sh_125mm_HEAT { + GVAR(skip) = 0; + GVAR(classes)[] = {QGVAR(small), QGVAR(medium_HD), QGVAR(medium_HD), QGVAR(medium_HD)}; + GVAR(metal) = 11400; + GVAR(charge) = 7100; + GVAR(gurney_c) = 2800; +}; + +class ModuleOrdnanceHowitzer_F_ammo: Sh_155mm_AMOS { + GVAR(skip) = 0; + GVAR(metal) = 1950; + GVAR(charge) = 15800; + GVAR(gurney_c) = 2320; + GVAR(gurney_k) = "1/2"; + GVAR(classes)[] = {QGVAR(large), QGVAR(large_HD), QGVAR(large_HD), QGVAR(large_HD), QGVAR(huge_HD), QGVAR(huge_HD), QGVAR(huge_HD)}; +}; +class ammo_Penetrator_Base: ShellBase { + GVAR(skip) = 1; +}; + +// ~~~~ Special +class ProbingBeam_01_F: BulletBase { + GVAR(skip) = 1; +}; + +class IRStrobeBase: GrenadeCore { + GVAR(skip) = 1; +}; +class FlareCore: GrenadeCore { // flares shouldn't have EH, but in case + GVAR(skip) = 1; +}; + +class Default; +class Laserbeam: Default { + GVAR(skip) = 1; +}; + +class FuelExplosion: Default { + GVAR(skip) = 1; +}; + +class HelicopterExploSmall: ShellBase { + GVAR(skip) = 1; +}; + +class LightningBolt: ShellBase { + GVAR(skip) = 1; +}; + +class M_Mo_82mm_AT: MissileBase { + GVAR(skip) = 1; +}; diff --git a/addons/frag/CfgAmmoSpall.hpp b/addons/frag/CfgAmmoSpall.hpp new file mode 100644 index 00000000000..c53ce4db4a8 --- /dev/null +++ b/addons/frag/CfgAmmoSpall.hpp @@ -0,0 +1,158 @@ +class GVAR(spallBase): B_65x39_Caseless { + GVAR(skip) = 1; + submunitionAmmo[] = {QGVAR(small), 4, QGVAR(medium), 3, QGVAR(large), 2, QGVAR(huge), 1}; + submunitionConeType[] = {"random", 20}; + submunitionConeAngle = 40; + submunitionDirectionType = "SubmunitionModelDirection"; + triggerTime = 0; + submunitionInitialOffset[] = {0, 0, 0}; + submunitionInitSpeed = 0; + triggerSpeedCoef[] = {0.75, 1.25}; + deleteParentWhenTriggered = 1; + submunitionParentSpeedCoef = 1; +}; + + +/* + * ground + */ +class GVAR(ground_spall_tiny): GVAR(spallBase) { + submunitionAmmo[] = {QGVAR(tiny), 9, QGVAR(small), 1}; + submunitionConeType[] = {"poissondisccenter", 4}; +}; + +class GVAR(ground_spall_small): GVAR(spallBase) { + submunitionAmmo[] = {QGVAR(small), 4, QGVAR(medium), 1}; + submunitionConeType[] = {"poissondisccenter", 6}; +}; + +class GVAR(ground_spall_medium): GVAR(spallBase) { + submunitionAmmo[] = {QGVAR(small), 2, QGVAR(small_HD), 1, QGVAR(medium), 3, QGVAR(medium_HD), 1, QGVAR(large), 2}; + submunitionConeType[] = {"poissondisccenter", 15}; +}; + +class GVAR(ground_spall_large): GVAR(spallBase) { + submunitionAmmo[] = {QGVAR(tiny), 3, QGVAR(tiny_HD), 3, QGVAR(small), 4, QGVAR(small_HD), 4, QGVAR(medium_HD), 5, QGVAR(large), 1, QGVAR(large_HD), 2}; + submunitionConeType[] = {"poissondisccenter", 15}; +}; + +class GVAR(ground_spall_huge): GVAR(spallBase) { + submunitionAmmo[] = {QGVAR(tiny), 3, QGVAR(tiny_HD), 3, QGVAR(small), 4, QGVAR(small_HD), 4, QGVAR(medium), 5, QGVAR(large), 1, QGVAR(large_HD), 2}; + submunitionConeType[] = {"poissondisccenter", 20}; +}; + + +/* + * rock + */ +class GVAR(rock_spall_tiny): GVAR(spallBase) { + submunitionAmmo[] = {QGVAR(small), 4, QGVAR(medium_HD), 1}; + submunitionConeType[] = {"poissondisccenter", 4}; +}; + +class GVAR(rock_spall_small): GVAR(spallBase) { + submunitionAmmo[] = {QGVAR(small), 4, QGVAR(medium), 1}; + submunitionConeType[] = {"poissondisccenter", 5}; +}; + +class GVAR(rock_spall_medium): GVAR(spallBase) { + submunitionAmmo[] = {QGVAR(small), 4, QGVAR(medium), 1, QGVAR(medium_HD), 2, QGVAR(large_HD), 1}; + submunitionConeType[] = {"poissondisccenter", 7}; +}; + +class GVAR(rock_spall_large): GVAR(spallBase) { + submunitionAmmo[] = {QGVAR(small), 5, QGVAR(medium), 2, QGVAR(large), 1}; + submunitionConeType[] = {"poissondisccenter", 10}; +}; + +class GVAR(rock_spall_huge): GVAR(spallBase) { + submunitionAmmo[] = {QGVAR(small), 5, QGVAR(medium), 2, QGVAR(large), 1, QGVAR(huge_HD), 1}; + submunitionConeType[] = {"poissondisccenter", 13}; +}; + + +/* + * wood + */ +class GVAR(wood_spall_tiny): GVAR(spallBase) { + submunitionAmmo[] = {QGVAR(tiny), 2, QGVAR(small), 4}; + submunitionConeType[] = {"poissondisccenter", 4}; +}; + +class GVAR(wood_spall_small): GVAR(spallBase) { + submunitionAmmo[] = {QGVAR(tiny), 2, QGVAR(small), 4, QGVAR(medium), 1}; + submunitionConeType[] = {"poissondisccenter", 6}; +}; + +class GVAR(wood_spall_medium): GVAR(spallBase) { + submunitionAmmo[] = {QGVAR(tiny), 2, QGVAR(small), 2, QGVAR(medium), 2, QGVAR(medium_HD), 1, QGVAR(large_HD), 1}; + submunitionConeType[] = {"poissondisccenter", 8}; +}; + +class GVAR(wood_spall_large): GVAR(spallBase) { + submunitionAmmo[] = {QGVAR(tiny), 1, QGVAR(small), 3, QGVAR(medium), 2, QGVAR(large_HD), 2, QGVAR(huge_HD), 1}; + submunitionConeType[] = {"poissondisccenter", 10}; +}; + +class GVAR(wood_spall_huge): GVAR(spallBase) { + submunitionAmmo[] = {QGVAR(tiny), 1, QGVAR(small), 3, QGVAR(medium), 2, QGVAR(large_HD), 2, QGVAR(huge_HD), 1}; + submunitionConeType[] = {"poissondisccenter", 12}; +}; + + +/* + * concrete + */ +class GVAR(concrete_spall_tiny): GVAR(spallBase) { + submunitionAmmo[] = {QGVAR(tiny), 6, QGVAR(tiny_HD), 3, QGVAR(small), 1}; + submunitionConeType[] = {"poissondisccenter", 4}; +}; + +class GVAR(concrete_spall_small): GVAR(spallBase) { + submunitionAmmo[] = {QGVAR(tiny), 4, QGVAR(tiny_HD), 2, QGVAR(small), 2, QGVAR(medium), 1}; + submunitionConeType[] = {"poissondisccenter", 6}; +}; + +class GVAR(concrete_spall_medium): GVAR(spallBase) { + submunitionAmmo[] = {QGVAR(tiny), 6, QGVAR(tiny_HD), 1, QGVAR(small), 4, QGVAR(medium), 5, QGVAR(large_HD), 1}; + submunitionConeType[] = {"poissondisccenter", 9}; +}; + +class GVAR(concrete_spall_large): GVAR(spallBase) { + submunitionAmmo[] = {QGVAR(tiny), 6, QGVAR(small), 4, QGVAR(medium), 3, QGVAR(large), 1, QGVAR(large_HD), 2}; + submunitionConeType[] = {"poissondisccenter", 12}; +}; + +class GVAR(concrete_spall_huge): GVAR(spallBase) { + submunitionAmmo[] = {QGVAR(tiny), 8, QGVAR(small), 4, QGVAR(medium), 3, QGVAR(large), 1, QGVAR(large_HD), 1, QGVAR(huge_HD), 1}; + submunitionConeType[] = {"poissondisccenter", 18}; +}; + + +/* + * metal + */ +class GVAR(metal_spall_tiny): GVAR(spallBase) { + submunitionAmmo[] = {QGVAR(tiny), 9, QGVAR(small), 1}; + submunitionConeType[] = {"poissondisccenter", 4}; +}; + +class GVAR(metal_spall_small): GVAR(spallBase) { + submunitionAmmo[] = {QGVAR(tiny), 4, QGVAR(small), 2, QGVAR(medium), 1}; + submunitionConeType[] = {"poissondisccenter", 6}; +}; + +class GVAR(metal_spall_medium): GVAR(spallBase) { + submunitionAmmo[] = {QGVAR(tiny), 5, QGVAR(small), 4, QGVAR(medium), 2, QGVAR(large), 1}; + submunitionConeType[] = {"poissondisccenter", 8}; +}; + +class GVAR(metal_spall_large): GVAR(spallBase) { + submunitionAmmo[] = {QGVAR(tiny), 4, QGVAR(small), 3, QGVAR(medium), 2, QGVAR(large), 1, QGVAR(huge), 1}; + submunitionConeType[] = {"poissondisccenter", 12}; +}; + +class GVAR(metal_spall_huge): GVAR(spallBase) { + submunitionAmmo[] = {QGVAR(tiny), 8, QGVAR(small), 3, QGVAR(medium), 2, QGVAR(large), 3, QGVAR(huge), 1}; + submunitionConeType[] = {"poissondisccenter", 18}; +}; diff --git a/addons/frag/README.md b/addons/frag/README.md index ca62771f00e..797e652b207 100644 --- a/addons/frag/README.md +++ b/addons/frag/README.md @@ -1,4 +1,4 @@ ace_frag ======== -Shrapnel system for explosives. +Explosive fragmentation, round spalling, and explosive reflection diff --git a/addons/frag/XEH_PREP.hpp b/addons/frag/XEH_PREP.hpp index a7fb8ff8c34..127f027f98e 100644 --- a/addons/frag/XEH_PREP.hpp +++ b/addons/frag/XEH_PREP.hpp @@ -1,25 +1,22 @@ -PREP(dev_debugAmmo); - -PREP(doSpall); -PREP(fired); -PREP(frago); -PREP(spallTrack); - -// * Other */ PREP(addBlackList); -PREP(dev_addTrack); -PREP(dev_drawTraces); -PREP(spallHP); -PREP(dev_startTracing); -PREP(dev_stopTracing); -PREP(dev_trackTrace); - -// New tracking mechanisms -PREP(masterPFH); -PREP(pfhRound); -PREP(addPfhRound); - -// Explosive Reflection -PREP(findReflections); +PREP(dev_clearTraces); +PREP(dev_debugAmmo); +PREP(dev_drawTrace); +PREP(dev_fragCalcDump); +PREP(dev_sphereDraw); +PREP(dev_trackHitBox); +PREP(dev_trackObj); PREP(doExplosions); PREP(doReflections); +PREP(doSpallHitPart); +PREP(doSpallPenetrate); +PREP(findReflections); +PREP(fired); +PREP(frago); +PREP(getFragInfo); +PREP(getMaterialInfo); +PREP(getSpallInfo); +PREP(initMaterialCache); +PREP(setClassBlacklisted); +PREP(shouldFrag); +PREP(shouldSpall); diff --git a/addons/frag/XEH_postInit.sqf b/addons/frag/XEH_postInit.sqf index cc58e1d15b2..7b0e32e04c9 100644 --- a/addons/frag/XEH_postInit.sqf +++ b/addons/frag/XEH_postInit.sqf @@ -1,32 +1,54 @@ #include "script_component.hpp" -if (isServer) then { - GVAR(lastFragTime) = -1; - [QGVAR(frag_eh), LINKFUNC(frago)] call CBA_fnc_addEventHandler; -}; - ["CBA_settingsInitialized", { - if (!GVAR(enabled)) exitWith {}; + [{ + params ["_projectile", "_posASL"]; + + if (_projectile getVariable [QGVAR(blacklisted), false]) exitWith {}; + + private _ammo = typeOf _projectile; + if (GVAR(reflectionsEnabled)) then { + [_posASL, _ammo] call FUNC(doReflections); + }; + if (GVAR(enabled) && _ammo call FUNC(shouldFrag)) then { + // only let a unit make a frag event once per second + private _shotParents = getShotParents _projectile; + private _instigator = _shotParents select !isNull (_shotParents#1); + if (CBA_missionTime < (_instigator getVariable [QGVAR(nextFragEvent), -1])) exitWith {}; + _instigator setVariable [QGVAR(nextFragEvent), CBA_missionTime + ACE_FRAG_FRAG_UNIT_HOLDOFF]; + + // Wait a frame to make sure it doesn't target the dead + [{ + [QGVAR(frag_eh), _this] call CBA_fnc_serverEvent + }, [_posASL, _ammo, [objNull, _instigator]]] call CBA_fnc_execNextFrame; + }; + }] call EFUNC(common,addExplosionEventHandler); - // Register fire event handler ["ace_firedPlayer", LINKFUNC(fired)] call CBA_fnc_addEventHandler; ["ace_firedNonPlayer", LINKFUNC(fired)] call CBA_fnc_addEventHandler; ["ace_firedPlayerVehicle", LINKFUNC(fired)] call CBA_fnc_addEventHandler; ["ace_firedNonPlayerVehicle", LINKFUNC(fired)] call CBA_fnc_addEventHandler; - - addMissionEventHandler ["EachFrame", {call FUNC(masterPFH)}]; -}] call CBA_fnc_addEventHandler; - -// Cache for ammo type configs -GVAR(cacheRoundsTypesToTrack) = createHashMap; - - -// Debug stuff: - -#ifdef DRAW_FRAG_INFO -[] call FUNC(dev_startTracing); +#ifdef DEBUG_MODE_DRAW + [QGVAR(dev_clearTraces), LINKFUNC(dev_clearTraces)] call CBA_fnc_addEventHandler; + + if (!hasInterface) exitWith {}; + GVAR(dev_drawPFEH) = [LINKFUNC(dev_drawTrace), 0] call CBA_fnc_addPerFrameHandler; + ["ace_interact_menu_newControllableObject", { + params ["_type"]; + + private _action = [ + QGVAR(debugReset), + "Reset ACE Frag traces", + "", + {[QGVAR(dev_clearTraces), []] call CBA_fnc_globalEvent;}, + {GVAR(dev_trackLines) isNotEqualTo createHashMap} + ] call EFUNC(interact_menu,createAction); + + [_type, 1, ["ACE_SelfActions"], _action, true] call EFUNC(interact_menu,addActionToClass); + }] call CBA_fnc_addEventHandler; #endif +}] call CBA_fnc_addEventHandler; -#ifdef DEBUG_MODE_FULL +#ifdef LOG_FRAG_INFO [true, true, 30] call FUNC(dev_debugAmmo); #endif diff --git a/addons/frag/XEH_preInit.sqf b/addons/frag/XEH_preInit.sqf index dc616917b88..2cb4a8e368d 100644 --- a/addons/frag/XEH_preInit.sqf +++ b/addons/frag/XEH_preInit.sqf @@ -6,20 +6,32 @@ PREP_RECOMPILE_START; #include "XEH_PREP.hpp" PREP_RECOMPILE_END; -GVAR(blackList) = []; -GVAR(traceFrags) = false; +GVAR(spallMaterialCache) = uiNamespace getVariable QGVAR(spallMaterialCache); +GVAR(spallInfoCache) = createHashMap; +GVAR(shouldSpallCache) = createHashMap; +GVAR(nextSpallAllowTime) = -1; -GVAR(spallHPData) = []; -GVAR(spallIsTrackingCount) = 0; - -GVAR(traceID) = -1; -GVAR(traces) = []; -GVAR(tracesStarted) = false; - -GVAR(lastIterationIndex) = 0; -GVAR(objects) = []; -GVAR(arguments) = []; +GVAR(shouldFragCache) = createHashMap; +GVAR(fragInfoCache) = createHashMap; +GVAR(lastFragTime) = -1; #include "initSettings.inc.sqf" +GVAR(dev_trackLines) = createHashMap; +GVAR(dev_hitBoxes) = createHashMap; +GVAR(dev_eventSpheres) = []; +GVAR(dev_drawPFEH) = -1; + +#ifdef DEBUG_MODE_DRAW +#include "initSettingsDebug.inc.sqf" +#else +GVAR(debugOptions) = false; +GVAR(dbgSphere) = false; +GVAR(drawHitBox) = false; +#endif + +if (isServer) then { + [QGVAR(frag_eh), LINKFUNC(frago)] call CBA_fnc_addEventHandler; +}; + ADDON = true; diff --git a/addons/frag/XEH_preStart.sqf b/addons/frag/XEH_preStart.sqf index 022888575ed..d3e2573e07e 100644 --- a/addons/frag/XEH_preStart.sqf +++ b/addons/frag/XEH_preStart.sqf @@ -1,3 +1,4 @@ #include "script_component.hpp" #include "XEH_PREP.hpp" +call FUNC(initMaterialCache); diff --git a/addons/frag/config.cpp b/addons/frag/config.cpp index f3b409dbd03..488b72c5070 100644 --- a/addons/frag/config.cpp +++ b/addons/frag/config.cpp @@ -8,7 +8,7 @@ class CfgPatches { requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_common"}; author = ECSTRING(common,ACETeam); - authors[] = {"Nou"}; + authors[] = {"Nou", "johnb43", "Lambda.Tiger"}; url = ECSTRING(main,URL); VERSION_CONFIG; }; diff --git a/addons/frag/functions/fnc_addBlackList.sqf b/addons/frag/functions/fnc_addBlackList.sqf deleted file mode 100644 index d0cc127d059..00000000000 --- a/addons/frag/functions/fnc_addBlackList.sqf +++ /dev/null @@ -1,21 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: Jaynus, NouberNou - * Adds a round to the blacklist (will be ignored). - * - * Arguments: - * 0: Projectile <OBJECT> - * - * Return Value: - * None - * - * Example: - * [bullet] call ace_frag_fnc_addBlackList - * - * Public: No - */ - -params ["_round"]; -TRACE_1("addBlackList",_round); - -GVAR(blackList) pushBack _round; diff --git a/addons/frag/functions/fnc_addBlacklist.sqf b/addons/frag/functions/fnc_addBlacklist.sqf new file mode 100644 index 00000000000..a835dc33702 --- /dev/null +++ b/addons/frag/functions/fnc_addBlacklist.sqf @@ -0,0 +1,32 @@ +#include "..\script_component.hpp" +/* + * Author: Jaynus, NouberNou, Lambda.Tiger + * Adds a round to the blacklist (will be ignored) and removes any ace_frag event handlers added to it. + * Once blacklisted a projectile can not be "unblacklisted." + * + * Arguments: + * 0: Projectile to be blacklisted <OBJECT> + * + * Return Value: + * Was the projectile blacklisted <BOOL> + * + * Example: + * [_projectile] call ace_frag_fnc_addBlackList + * + * Public: Yes + */ + +params [["_projectile", objNull, [objNull]]]; +TRACE_2("addBlackList",_projectile,typeOf projectile); + +if (isNull _projectile || {!isClass (configFile >> "CfgAmmo" >> (typeOf _projectile))}) exitWith { + TRACE_1("Invalid projectile",_this); + false +}; + +_projectile setVariable [QGVAR(blacklisted), true]; +(_projectile getVariable [QGVAR(spallEH), [-1, -1]]) params ["_hitPartEH", "_penetratedEH"]; +_projectile removeEventHandler ["HitPart", _hitPartEH]; +_projectile removeEventHandler ["Penetrated", _penetratedEH]; + +true diff --git a/addons/frag/functions/fnc_addPfhRound.sqf b/addons/frag/functions/fnc_addPfhRound.sqf deleted file mode 100644 index 358a9ee71ea..00000000000 --- a/addons/frag/functions/fnc_addPfhRound.sqf +++ /dev/null @@ -1,77 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: Jaynus, NouberNou - * Starts tracking a round that will frag. - * Should only be called once per round. - * - * Arguments: - * 0: Shooter <OBJECT> - * 1: Ammo classname <STRING> - * 2: Projectile <OBJECT> - * - * Return Value: - * None - * - * Example: - * [player, "handGrenade", bullet] call ace_frag_fnc_addPfhRound - * - * Public: No - */ - -params ["_gun", "_type", "_round"]; -TRACE_3("addPfhRound",_gun,_type,_round); - -if (!GVAR(enabled)) exitWith {TRACE_1("setting disabled",_this);}; - -if (!alive _round) exitWith {TRACE_1("round dead?",_this);}; - -if (_round in GVAR(blackList)) exitWith { - TRACE_1("round in blackList",_this); - REM(GVAR(blackList),_round); -}; - -// Exit on max track -if ((count GVAR(objects)) >= GVAR(maxTrack)) exitWith {TRACE_1("maxTrack limit",count GVAR(objects));}; - -private _doSpall = false; -if (GVAR(SpallEnabled)) then { - if (GVAR(spallIsTrackingCount) <= 0) then { - GVAR(spallHPData) = []; - }; - if (GVAR(spallIsTrackingCount) > 5) then { - TRACE_1("At Spall Limit",GVAR(spallIsTrackingCount)); - } else { - _doSpall = true; - INC(GVAR(spallIsTrackingCount)); - }; - TRACE_2("",_doSpall,GVAR(spallIsTrackingCount)); -}; - -#ifdef DRAW_FRAG_INFO -[ACE_player, _round, [0, 1, 0, 1]] call FUNC(dev_addTrack); -#endif - -// We only do the single track object check here. -// We should do an {!(_round in GVAR(objects))} -// But we leave that out here for optimization. So this cannot be a framework function -// Otherwise, it should only be added once and from the FiredEH -if (alive _round) then { - private _spallTrack = []; - private _spallTrackID = []; - - private _args = [ - _round, getPosASL _round, velocity _round, _type, diag_frameno, getPosASL _round, _doSpall, _spallTrack, _spallTrackID, - getNumber (configFile >> "CfgAmmo" >> _type >> QGVAR(skip)), - getNumber (configFile >> "CfgAmmo" >> _type >> "explosive"), - getNumber (configFile >> "CfgAmmo" >> _type >> "indirectHitRange"), - getNumber (configFile >> "CfgAmmo" >> _type >> QGVAR(force)), - getNumber (configFile >> "CfgAmmo" >> _type >> "indirecthit") * (sqrt (getNumber (configFile >> "CfgAmmo" >> _type >> "indirectHitRange"))) - ]; - TRACE_1("Initializing track",_round); - GVAR(objects) pushBack _round; - GVAR(arguments) pushBack _args; - - if (_doSpall) then { - [_round, 1, _spallTrack, _spallTrackID] call FUNC(spallTrack); - }; -}; diff --git a/addons/frag/functions/fnc_dev_addTrack.sqf b/addons/frag/functions/fnc_dev_addTrack.sqf deleted file mode 100644 index 0e75a9fb994..00000000000 --- a/addons/frag/functions/fnc_dev_addTrack.sqf +++ /dev/null @@ -1,26 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: ACE-Team - * - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * call ace_frag_fnc_dev_addTrack - * - * Public: No - */ - -params ["_origin", "_obj", ["_color", [1, 0, 0, 1]]]; - -private _positions = []; -private _objSpd = vectorMagnitude (velocity _obj); -_positions pushBack [getPos _obj, _objSpd]; -private _data = [_origin, typeOf _origin, typeOf _obj, _objSpd, _positions, _color]; - -private _index = GVAR(traces) pushBack _data; -[DFUNC(dev_trackTrace), 0, [_obj, _index, CBA_missionTime]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/frag/functions/fnc_dev_clearTraces.sqf b/addons/frag/functions/fnc_dev_clearTraces.sqf new file mode 100644 index 00000000000..6e2b820bacb --- /dev/null +++ b/addons/frag/functions/fnc_dev_clearTraces.sqf @@ -0,0 +1,25 @@ +#include "..\script_component.hpp" +/* + * Author: Lambda.Tiger + * Clears all dev spheres and traces. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_frag_fnc_dev_clearTraces + * + * Public: No + */ + +{ + deleteVehicle _x; +} forEach GVAR(dev_eventSpheres); + +GVAR(dev_eventSpheres) = []; + +GVAR(dev_trackLines) = createHashMap; +GVAR(dev_hitBoxes) = createHashMap; diff --git a/addons/frag/functions/fnc_dev_debugAmmo.sqf b/addons/frag/functions/fnc_dev_debugAmmo.sqf index 4484edbdc43..fe868df3428 100644 --- a/addons/frag/functions/fnc_dev_debugAmmo.sqf +++ b/addons/frag/functions/fnc_dev_debugAmmo.sqf @@ -1,11 +1,15 @@ -#define DEBUG_MODE_FULL #include "..\script_component.hpp" /* - * Author: ACE-Team - * + * Author: ACE-Team, Lambda.Tiger + * This function will dump every ammo config that would generate ace_frag + * fragments that could be fired from a weapon. * * Arguments: - * None + * 0: Log ammo types that wouldn't normally frag <BOOL> (default: false) + * 1: Only print ammo without ACE_frag entries, inherited or otherwise <BOOL> (default: true) + * 2: Only export ammo classes of classes referenced in CfgMagazines and their + * submunitions <BOOL> (default: false) + * 3: Force a CSV format on debug print. <BOOL> (default: false) * * Return Value: * None @@ -17,65 +21,90 @@ */ params [ - ["_debugMissing", true, [false]], - ["_debugForce", false, [false]], - ["_debugSkippedFragPower", 30, [0]] + ["_logAll", false, [false]], + ["_printOnlyIncomplete", true, [true]], + ["_onlyShotAmmoTypes", false, [false]], + ["_csvFormat", false, [false]] ]; diag_log text format ["~~~~~~~~~~~~~Start [%1]~~~~~~~~~~~~~", _this]; +if (_csvFormat) then { + diag_log text format ["ammo,gurney_c,gurney_m,gurney_k,gurney_gC,skip,Inheritance"]; +}; -private _allMagsConfigs = configProperties [configFile >> "CfgMagazines", "isClass _x", true]; -private _processedCfgAmmos = []; - -{ - private _ammo = toLowerANSI getText (_x >> "ammo"); - if (_ammo != "" && {!(_ammo in _processedCfgAmmos)}) then { - _processedCfgAmmos pushBack _ammo; - - //Ignore mines/bombs - if (_ammo isKindOf "TimeBombCore") exitWith {}; - - _ammoConfig = configFile >> "CfgAmmo" >> _ammo; - - //Read configs and test if it would actually cause a frag, using same logic as FUNC(pfhRound) - private _skip = getNumber (_ammoConfig >> QGVAR(skip)); - private _explosive = getNumber (_ammoConfig >> "explosive"); - private _indirectRange = getNumber (_ammoConfig >> "indirectHitRange"); - private _force = getNumber (_ammoConfig >> QGVAR(force)); - private _fragPower = getNumber (_ammoConfig >> "indirecthit") * (sqrt ((getNumber (_ammoConfig >> "indirectHitRange")))); +// Gather all configs, either those that could be created from firing or all classes +private _allAmmoConfigs = createHashMap; +if (_onlyShotAmmoTypes) then { + private _configSearchFunction = { + params [ + ["_ammo", "", [""]] + ]; + if (_ammo isEqualTo "" || {_ammo in _allAmmoConfigs}) exitWith {}; + _allAmmoConfigs set [_ammo, 1]; + private _cfgAmmoRoot = configFile >> "CfgAmmo"; + private _submunitionConfig = _cfgAmmoRoot >> _ammo >> "submunitionAmmo"; + if (isArray _submunitionConfig) then { + private _subMunition = getArray _submunitionConfig; + for "_i" from 0 to count _subMunition - 1 do { + if (_i mod 2 == 0) then { + configName (_cfgAmmoRoot >> (_subMunition#_i)) call _configSearchFunction; + }; + }; + } else { + private _subMunition = getText _submunitionConfig; + if (_subMunition isNotEqualTo "") then { + configName (_cfgAmmoRoot >> _subMunition) call _configSearchFunction; + }; + }; + }; + private _allMagazineConfigs = configProperties [configFile >> "CfgMagazines", "isClass _x", true]; + private _cfgAmmoCfgPath = configFile >> "CfgAmmo"; + { + private _magAmmo = getText (_x >> "ammo"); + configName (_cfgAmmoCfgPath >> _magAmmo) call _configSearchFunction; + } forEach _allMagazineConfigs; + _allAmmoConfigs = keys _allAmmoConfigs; +} else { + _allAmmoConfigs = configProperties [configFile >> "CfgAmmo", "isClass _x && !('ace_frag' in configName _x)", true] apply {configName _x}; +}; - private _shouldAdd = (_skip == 0) && {(_force == 1) || {_explosive > 0.5 && {_indirectRange >= 4.5} && {_fragPower >= 35}}}; +private _processedCfgAmmos = 0; +private _printCount = 0; +{ // Begin forEach to check each ammo type + private _ammo = _x; + if (_ammo isNotEqualTo "") then { + INC(_processedCfgAmmos); - if (_shouldAdd) then { - if (_debugForce && {((getNumber(_ammoConfig >> "hit")) < 5) || {_fragPower < 10}}) then { - diag_log text format ["Ammo [%1] from Mag [%2] - Weak but will still frag!", _ammo, configName _x]; - diag_log text format [" - _force=%1,_fragPower=%2", _force, _fragPower]; - }; + private _ammoConfig = configFile >> "CfgAmmo" >> _ammo; + _ammo call FUNC(shouldFrag) params ["_shouldFrag"]; - private _warn = false; + if (_shouldFrag || _logAll) then { - _fragTypes = getArray (_ammoConfig >> QGVAR(CLASSES)); - if (_fragTypes isEqualTo []) then {_warn = true;}; - _c = getNumber(_ammoConfig >> QGVAR(CHARGE)); - if (_c == 0) then {_warn = true;}; - _m = getNumber(_ammoConfig >> QGVAR(METAL)); - if (_m == 0) then {_warn = true;}; - _k = getNumber(_ammoConfig >> QGVAR(GURNEY_K)); - if (_k == 0) then {_warn = true;}; - _gC = getNumber(_ammoConfig >> QGVAR(GURNEY_C)); - if (_gC == 0) then {_warn = true;}; + private _print = false; + private _skip = getNumber (_ammoConfig >> QGVAR(skip)); + private _fragTypes = getArray (_ammoConfig >> QGVAR(classes)); + if (_fragTypes isEqualTo []) then {_print = true;}; + private _c = getNumber (_ammoConfig >> QGVAR(charge)); + if (_c == 0) then {_print = true;}; + private _m = getNumber (_ammoConfig >> QGVAR(metal)); + if (_m == 0) then {_print = true;}; + private _k = getNumber (_ammoConfig >> QGVAR(gurney_k)); + if (_k == 0) then {_print = true;}; + private _gC = getNumber (_ammoConfig >> QGVAR(gurney_c)); + if (_gC == 0) then {_print = true;}; - if (_debugMissing && {_warn}) then { - diag_log text format ["Ammo [%1] from Mag [%2] MISSING frag configs:", _ammo, configName _x]; - diag_log text format [" - _c=%1,_m=%2,_k=%3,_gC=%4,_fragTypes=%5", _c, _m, _k, _gC, _fragTypes]; - }; - } else { - if ((_fragPower > _debugSkippedFragPower) && {isArray (_ammoConfig >> QGVAR(CLASSES))}) then { - diag_log text format ["Ammo [%1] from Mag [%2] has frag configs but will NOT frag:", _ammo, configName _x]; - diag_log text format ["- skip=%1,explosive=%2,indirectHitRange=%3,force=%4,fragPower=%5", _skip, _explosive, _indirectRange, _force, _fragPower]; + if (!_printOnlyIncomplete || {_print && _skip != 0}) then { + INC(_printCount); + if (_csvFormat) then { + diag_log text format ["%6,%1,%2,%3,%4,%5,%8,%7", _c, _m, _k, _gC, _skip, _ammo, [_ammoConfig, true] call BIS_fnc_returnParents, _shouldFrag]; + } else { + diag_log text format ["Ammo [%1] MISSING frag configs:", _ammo]; + diag_log text format ["_c=%1,_m=%2,_k=%3,_gC=%4,_skip=%5,_fragTypes=%6", _c, _m, _k, _gC, _skip, _fragTypes]; + }; }; }; }; -} forEach _allMagsConfigs; +} forEach _allAmmoConfigs; -diag_log text format ["~~~~~~~~~~~~~End [%1-%2]~~~~~~~~~~~~~", count _allMagsConfigs, count _processedCfgAmmos]; +diag_log text format ["~~~~~~~~~~~~~~End [%1-%2]~~~~~~~~~~~~~~", count _allAmmoConfigs, _processedCfgAmmos]; +diag_log text format ["~~~~~~~~~~~~~~Printed: %1~~~~~~~~~~~", _printCount]; diff --git a/addons/frag/functions/fnc_dev_drawTrace.sqf b/addons/frag/functions/fnc_dev_drawTrace.sqf new file mode 100644 index 00000000000..8b027e1f3ca --- /dev/null +++ b/addons/frag/functions/fnc_dev_drawTrace.sqf @@ -0,0 +1,45 @@ +#include "..\script_component.hpp" +/* + * Author: Lambda.Tiger + * This function draws all development traces and is intended to be called on each frame. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_frag_fnc_dev_drawTrace + * + * Public: No + */ + +#define HITBOX_DRAW_PATH [[3, 2, 1, 5, 6, 7, 3, 0, 4, 5], [0, 1], [2, 6], [7, 4]] + +if (!GVAR(debugOptions)) exitWith {}; + +{ + _y params ["_posArray", "_color"]; + if (count _posArray > 1) then { + for "_j" from 1 to count _posArray - 1 do { + drawLine3D [_posArray#(_j - 1), _posArray#_j, _color]; + }; + }; +} forEach GVAR(dev_trackLines); + +if (GVAR(drawHitBox)) then { + { + _y params ["_object", "_boxPoints", "_color"]; + if (!alive _object) then { + GVAR(dev_hitBoxes) deleteAt _x; + continue; + }; + + { + for "_i" from 1 to count _x - 1 do { + drawLine3D [_object modelToWorld (_boxPoints#(_x#_i)), _object modelToWorld (_boxPoints#(_x#(_i - 1))), _color]; + }; + } forEach HITBOX_DRAW_PATH; + } forEach GVAR(dev_hitBoxes); +}; diff --git a/addons/frag/functions/fnc_dev_drawTraces.sqf b/addons/frag/functions/fnc_dev_drawTraces.sqf deleted file mode 100644 index 7fcca3c48fe..00000000000 --- a/addons/frag/functions/fnc_dev_drawTraces.sqf +++ /dev/null @@ -1,37 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: ACE-Team - * - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * call ace_frag_fnc_dev_drawTraces - * - * Public: No - */ - -{ - _x params ["", "", "", "", "_positions", "_color"]; - private _index = 0; - private _max = count _positions; - // private _lastSpd = []; - private _lastPos = []; - while {_index < _max} do { - _data1 = _positions select _index; - _data2 = _positions select ([_index + ACE_TRACE_DRAW_INC, _max - 1] select (_index + ACE_TRACE_DRAW_INC >= _max)); - - _pos1 = _data1 select 0; - _pos2 = _data2 select 0; - ADD(_index,ACE_TRACE_DRAW_INC); - - drawLine3D [_pos1, _pos2, _color]; - _lastPos = _pos2; - // _lastSpd = _data1 select 1; - }; - // drawIcon3D ["", [1,0,0,1], _lastPos, 0, 0, 0, format ["%1m/s", _lastSpd], 1, 0.05, "RobotoCondensed"]; -} forEach GVAR(traces); diff --git a/addons/frag/functions/fnc_dev_fragCalcDump.sqf b/addons/frag/functions/fnc_dev_fragCalcDump.sqf new file mode 100644 index 00000000000..88be643c258 --- /dev/null +++ b/addons/frag/functions/fnc_dev_fragCalcDump.sqf @@ -0,0 +1,56 @@ +#include "..\script_component.hpp" +/* + * Author: Lambda.Tiger, based on fnc_dev_debugAmmo by "ACE-Team" + * Dumps all ammo types to see if there's any reason to spawn fragments given hit power and distance. + * Good for grasping the values used in shouldFrag to cull non-fragmenting rounds. + * + * Arguments: + * 0: Display rounds that will never frag <BOOL> (default: false) + * + * Return Value: + * None + * + * Example: + * false call ace_frag_fnc_dev_fragCalcDump + * + * Public: No + */ + +params [["_logAll", false, [false]]]; + +private _allAmmoConfigs = configProperties [configFile >> "CfgAmmo", "isClass _x && !('ace_frag' in configName _x)", true]; +private _processedCfgAmmos = createHashMap; + +private _numberPrinted = 0; + +diag_log text "//****************** fragCalcDump Beg ******************//"; +{ // Begin _allAmmoConfigs forEach + private _ammo = configName _x; + + if (_ammo isEqualTo "" || {_ammo in _processedCfgAmmos}) then { + continue; + }; + + _ammo call FUNC(shouldFrag) params ["_shouldFrag"]; + if (_shouldFrag || _logAll) then { + private _fragInfo = _ammo call FUNC(getFragInfo); + _fragInfo params ["_fragRange", "_fragMaxSpeed"]; + private _ammoConfig = configFile >> "CfgAmmo" >> _ammo; + private _indirectHitRange = getNumber (_ammoConfig >> "indirectHitRange"); + private _indirectHit = getNumber (_ammoConfig >> "indirectHit"); + private _fragPowerSpeedRange = [0.5, 1] vectorMultiply _fragMaxSpeed; + + diag_log text format ["Ammo type: %1 | Should frag: %2", _ammo, _shouldFrag]; + diag_log text format [" Indirect hit range: %1", _indirectHitRange]; + diag_log text format [" Indirect hit: %1", _indirectHit]; + diag_log text format [" Max frag speed: %1", _fragMaxSpeed]; + diag_log text format [" Frag range: %1", _fragRange]; + diag_log text format [" Frag speed range: %1", _fragPowerSpeedRange]; + INC(_numberPrinted); + }; + + _processedCfgAmmos set [_ammo, 1]; +} forEach _allAmmoConfigs; + +diag_log text "//****************** fragCalcDump End ******************//"; +diag_log text format ["//********************** printed %1 *********************//", _numberPrinted]; diff --git a/addons/frag/functions/fnc_dev_sphereDraw.sqf b/addons/frag/functions/fnc_dev_sphereDraw.sqf new file mode 100644 index 00000000000..31a1393991e --- /dev/null +++ b/addons/frag/functions/fnc_dev_sphereDraw.sqf @@ -0,0 +1,41 @@ +#include "..\script_component.hpp" +/* + * Author: Lambda.Tiger + * Add a colored sphere at a specified point. + * + * Arguments: + * 0: Position (posASL) to add sphere <ARRAY> + * 1: Color of sphere <STRING> (default: "blue") + * + * Return Value: + * The created sphere object <OBJECT> + * + * Example: + * [getPosASL player, "red"] call ace_frag_fnc_dev_sphereDraw + * + * Public: No + */ + +params ["_posASL", ["_color", "blue"]]; + +if (!isServer) exitWith {}; + +if (_color select [0,1] != "(") then { + _color = switch (toLowerANSI _color) do { + case "blue": {"(0,0,0.8,0.5)"}; + case "black": {"(1,1,1,0.5)"}; + case "white": {"(0,0,0,0.5)"}; + case "red": {"(0.8,0,0,0.5)"}; + case "green": {"(0,0.8,0,0.5)"}; + case "yellow": {"(0.8,0.8,0,0.5)"}; + case "orange": {"(0.8,0.518,0,0.5)"}; + default {"(0.8,0.8,0,0.5)"}; + }; +}; +private _colorString = "#(argb,8,8,3)color" + _color; + +private _sphere = createVehicle ["Sign_Sphere10cm_F", ASLToATL _posASL, [], 0, "CAN_COLLIDE"]; +_sphere setObjectTextureGlobal [0, _colorString]; +GVAR(dev_eventSpheres) pushBack _sphere; + +_sphere // return diff --git a/addons/frag/functions/fnc_dev_startTracing.sqf b/addons/frag/functions/fnc_dev_startTracing.sqf deleted file mode 100644 index 897dde3011e..00000000000 --- a/addons/frag/functions/fnc_dev_startTracing.sqf +++ /dev/null @@ -1,23 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: ACE-Team - * - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * call ace_frag_fnc_dev_startTracing - * - * Public: No - */ - -if (GVAR(tracesStarted)) exitWith {}; - -INFO("Starting Trace Drawing"); - -GVAR(tracesStarted) = true; -GVAR(traceID) = [LINKFUNC(dev_drawTraces), 0, []] call CBA_fnc_addPerFrameHandler; diff --git a/addons/frag/functions/fnc_dev_stopTracing.sqf b/addons/frag/functions/fnc_dev_stopTracing.sqf deleted file mode 100644 index 949d3cd55d6..00000000000 --- a/addons/frag/functions/fnc_dev_stopTracing.sqf +++ /dev/null @@ -1,23 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: ACE-Team - * Dev things - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * None - * - * Public: No - */ - -if (!GVAR(tracesStarted)) exitWith {}; - -INFO("Ending Trace Drawing"); - -GVAR(tracesStarted) = false; -[GVAR(traceID)] call CBA_fnc_removePerFrameHandler; diff --git a/addons/frag/functions/fnc_dev_trackHitBox.sqf b/addons/frag/functions/fnc_dev_trackHitBox.sqf new file mode 100644 index 00000000000..327e45cf0d3 --- /dev/null +++ b/addons/frag/functions/fnc_dev_trackHitBox.sqf @@ -0,0 +1,75 @@ +#include "..\script_component.hpp" +/* + * Author: Lambda.Tiger + * Add a hit box outline to an object. + * + * Arguments: + * 0: Object that should have it's hit box drawn <OBJECT> (default: objNull) + * 1: Add sphere at object origin <BOOL> (default: true) + * + * Return Value: + * None + * + * Example: + * player call ace_frag_fnc_dev_trackHitBox + * + * Public: No + */ + +params [ + ["_object", objNull], + ["_addSphere", true] +]; +TRACE_2("Adding hitbox",_object,_addSphere); + +if (isNull _object) exitWith {}; + +// Grab the right hitBox +private _boundingBox = []; +if (_object isKindOf "CAManBase") then { + if (isNull objectParent _object) then { + _boundingBox = 0 boundingBox _object; + } else { + _boundingBox = boundingBoxReal [_object, "Geometry"]; + }; +} else { + _boundingBox = boundingBoxReal [_object, "FireGeometry"]; +}; +_boundingBox params ["_lowerPoint", "_upperPoint"]; + +// adjust with stance +switch (stance _object) do { + case "STAND": {_upperPoint set [2, 1.9];}; + case "CROUCH": {_upperPoint set [2, 1.3];}; + case "PRONE": {_upperPoint set [2, 0.8];}; +}; +private _centerPoint = ASLToAGL getPosASL _object; + +if (GVAR(dbgSphere) && _addSphere && {isNull objectParent _object}) then { + private _centerSphere = [getPosASL _object, "yellow"] call FUNC(dev_sphereDraw); + _centerSphere attachTo [_object, _object worldToModel _centerPoint]; +}; + +// create an optimized outline +_upperPoint params ["_x1","_y1","_z1"]; +_lowerPoint params ["_x2","_y2","_z2"]; +private _p1 = _upperPoint; +private _p7 = _lowerPoint; +private _points = [ + _upperPoint, + [_x1, _y2, _z1], + [_x2, _y2, _z1], + [_x2, _y1, _z1], + [_x1, _y1, _z2], + [_x1, _y2, _z2], + _lowerPoint, + [_x2, _y1, _z2] +]; + +private _color = switch (side _object) do { + case east: {[0.8, 0, 0, 1]}; + case resistance: {[0, 0.8, 0, 1]}; + default {[0, 0, 0.8, 1]}; +}; + +GVAR(dev_hitBoxes) set [getObjectID _object, [_object, _points, _color]]; diff --git a/addons/frag/functions/fnc_dev_trackObj.sqf b/addons/frag/functions/fnc_dev_trackObj.sqf new file mode 100644 index 00000000000..88b298fa0b8 --- /dev/null +++ b/addons/frag/functions/fnc_dev_trackObj.sqf @@ -0,0 +1,87 @@ +#include "..\script_component.hpp" +/* + * Author: Lambda.Tiger + * This function adds an object to have its course tracked (every frame). + * + * Arguments: + * 0: Object to draw track <OBJECT> (default: objNull) + * 1: Color of trace <STRING> (default: "blue") + * 2: Whether the object is a projectile or whether to add projectile EHs <BOOL> (default: false) + * + * Return Value: + * None + * + * Example: + * player call ace_frag_fnc_dev_trackObj + * + * Public: No + */ + +params [ + ["_object", objNull], + ["_color", "blue"], + ["_isProj", false] +]; +TRACE_3("devDraw",_object,_color,_isProj); + +// pick color and add it to the array +private _colorArray = switch (toLowerANSI _color) do { + case "purple": {[0.8, 0, 0.8, 1]}; + case "blue": {[0, 0, 0.8, 1]}; + case "green": {[0, 0.8, 0, 1]}; + case "orange": {[0.8, 0.518, 0, 1]}; + case "yellow": {[0.8, 0.8, 0, 1]}; + case "red": {[0.8, 0, 0, 1]}; + case "black": {[1, 1, 1, 1]}; + case "white": {[0, 0, 0, 1]}; + default {[0, 0.8, 0.8, 1]}; +}; +GVAR(dev_trackLines) set [getObjectID _object, [[getPosATL _object], _colorArray]]; + +// event handler to track round and cleanup when round is "dead" +[{ + if (isGamePaused || accTime == 0) exitWith {}; + params ["_object", "_handle"]; + + if (!alive _object) exitWith { + _handle call CBA_fnc_removePerFrameHandler; + }; + + private _objectArray = GVAR(dev_trackLines) get (getObjectID _object); + + if (isNil "_objectArray") exitWith { + _handle call CBA_fnc_removePerFrameHandler; + }; + + (_objectArray#0) pushBack getPosATL _object; +}, 0, _object] call CBA_fnc_addPerFrameHandler; + +// Projectile event handlers that add spheres and points for more accurate round tracking +if (!_isProj) exitWith {}; + +_object addEventHandler ["HitPart", { + params ["_projectile", "", "", "_posASL"]; + private _posArr = (GVAR(dev_trackLines) get (getObjectID _projectile))#0; + _posArr pushBack ASLToATL _posASL; + if (GVAR(dbgSphere)) then { + [_posASL, "green"] call FUNC(dev_sphereDraw); + }; +}]; + +_object addEventHandler ["Explode", { + params ["_projectile", "_posASL"]; + private _posArr = (GVAR(dev_trackLines) get (getObjectID _projectile))#0; + _posArr pushBack ASLToATL _posASL; + if (GVAR(dbgSphere)) then { + [_posASL, "red"] call FUNC(dev_sphereDraw); + }; +}]; + +_object addEventHandler ["Deflected", { + params ["_projectile", "_posASL"]; + private _posArr = (GVAR(dev_trackLines) get (getObjectID _projectile))#0; + _posArr pushBack ASLToATL _posASL; + if (GVAR(dbgSphere)) then { + [_posASL, "blue"] call FUNC(dev_sphereDraw); + }; +}]; diff --git a/addons/frag/functions/fnc_dev_trackTrace.sqf b/addons/frag/functions/fnc_dev_trackTrace.sqf deleted file mode 100644 index 6c010bdb631..00000000000 --- a/addons/frag/functions/fnc_dev_trackTrace.sqf +++ /dev/null @@ -1,27 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: ACE-Team - * Dev things - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * call ace_frag_fnc_dev_trackTrace - * - * Public: No - */ - -params ["_args", "_pfhID"]; -_args params ["_tracerObj", "_index"]; - -if (alive _tracerObj && {GVAR(traces) isNotEqualTo []}) then { - private _data = GVAR(traces) select _index; - private _positions = _data select 4; - _positions pushBack [getPos _tracerObj, vectorMagnitude (velocity _tracerObj)]; -} else { - [_pfhID] call CBA_fnc_removePerFrameHandler; -}; diff --git a/addons/frag/functions/fnc_doExplosions.sqf b/addons/frag/functions/fnc_doExplosions.sqf index a5a687aa538..74e191532a5 100644 --- a/addons/frag/functions/fnc_doExplosions.sqf +++ b/addons/frag/functions/fnc_doExplosions.sqf @@ -21,7 +21,7 @@ _args params ["_explosions", "_index"]; for "_i" from _index to ((_index + 2) min (count _explosions)) do { private _exp = _explosions select _i; _exp params ["_refExp", "_bpos", "_hit", "_distance", "_indirectHitRange", "_depth"]; - _refExp createVehicle (ASLtoATL _bpos); + _refExp createVehicle (ASLToATL _bpos); // if (_hit >= 150 && _distance > _indirectHitRange) then { // [_bpos, _refExp, _depth] call FUNC(doReflections); // }; diff --git a/addons/frag/functions/fnc_doSpall.sqf b/addons/frag/functions/fnc_doSpall.sqf deleted file mode 100644 index b206c701b21..00000000000 --- a/addons/frag/functions/fnc_doSpall.sqf +++ /dev/null @@ -1,139 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: ACE-Team - * Dev things - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * call ace_frag_fnc_doSpall - * - * Public: No - */ - -#define WEIGHTED_SIZE [QGVAR(spall_small), 4, QGVAR(spall_medium), 3, QGVAR(spall_large), 2, QGVAR(spall_huge), 1] - -params ["_hitData", "_hitPartDataIndex"]; -private _initialData = GVAR(spallHPData) select (_hitData select 0); -_initialData params ["_hpId", "_object", "_roundType", "_round", "_curPos", "_velocity"]; - -private _hpData = (_hitData select 1) select _hitPartDataIndex; -private _objectHit = _hpData param [0, objNull]; -TRACE_1("",_objectHit); -if ((isNil "_objectHit") || {isNull _objectHit}) exitWith {WARNING_1("Problem with hitPart data - bad object [%1]",_objectHit);}; -_objectHit removeEventHandler ["HitPart", _hpId]; - -private _caliber = getNumber (configFile >> "CfgAmmo" >> _roundType >> "caliber"); -private _explosive = getNumber (configFile >> "CfgAmmo" >> _roundType >> "explosive"); -private _idh = getNumber (configFile >> "CfgAmmo" >> _roundType >> "indirectHitRange"); - -if !(_caliber >= 2.5 || {(_explosive > 0 && {_idh >= 1})}) exitWith {}; -// ACE_player sideChat format ["BBBB"]; -private _exit = false; -private _vm = 1; - -private _oldVelocity = vectorMagnitude _velocity; -private _curVelocity = vectorMagnitude (velocity _round); - -if (alive _round) then { - private _diff = _velocity vectorDiff (velocity _round); - private _polar = _diff call CBA_fnc_vect2polar; - // ACE_player sideChat format ["polar: %1", _polar]; - if (abs (_polar select 1) > 45 || {abs (_polar select 2) > 45}) then { - if (_caliber < 2.5) then { - // ACE_player sideChat format ["exit!"]; - _exit = true; - } else { - SUB(_vm,_curVelocity / _oldVelocity); - }; - }; -}; -if (_exit) exitWith {}; - -private _unitDir = vectorNormalized _velocity; -private _pos = _hpData select 3; -private _spallPos = []; -if ((isNil "_pos") || {!(_pos isEqualTypeArray [0,0,0])}) exitWith {WARNING_1("Problem with hitPart data - bad pos [%1]",_pos);}; -for "_i" from 0 to 100 do { - private _pos1 = _pos vectorAdd (_unitDir vectorMultiply (0.01 * _i)); - private _pos2 = _pos vectorAdd (_unitDir vectorMultiply (0.01 * (_i + 1))); - // _data = [nil, nil, nil, 1, [[ASLtoATL _pos1, 1], [ASLtoATL _pos2, 1]]]; - // NOU_TRACES pushBack _data; - - if (!lineIntersects [_pos1, _pos2]) exitWith { - // ACE_player sideChat format ["FOUND!"]; - _spallPos = _pos2; - }; -}; -if (_spallPos isEqualTo []) exitWith {}; -private _spallPolar = _velocity call CBA_fnc_vect2polar; - -if (_explosive > 0) then { - // ACE_player sideChat format ["EXPLOSIVE!"]; - private _warn = false; - private _c = getNumber (configFile >> "CfgAmmo" >> _roundType >> QGVAR(CHARGE)); - if (_c == 0) then {_c = 1; _warn = true;}; - private _m = getNumber (configFile >> "CfgAmmo" >> _roundType >> QGVAR(METAL)); - if (_m == 0) then {_m = 2; _warn = true;}; - private _k = getNumber (configFile >> "CfgAmmo" >> _roundType >> QGVAR(GURNEY_K)); - if (_k == 0) then {_k = 1 / 2; _warn = true;}; - private _gC = getNumber (configFile >> "CfgAmmo" >> _roundType >> QGVAR(GURNEY_C)); - if (_gC == 0) then {_gC = 2440; _warn = true;}; - - // if (_warn) then { - // WARNING_1("Ammo class %1 lacks proper explosive properties definitions for frag!",_roundType); //TODO: turn this off when we get closer to release - // }; - - private _fragPower = (((_m / _c) + _k) ^ - (1 / 2)) * _gC; - _spallPolar set [0, _fragPower * 0.66]; -}; - -// diag_log text format ["SPALL POWER: %1", _spallPolar select 0]; -private _spread = 15 + (random 25); -private _spallCount = 5 + (random 10); -TRACE_1("",_spallCount); -for "_i" from 1 to _spallCount do { - private _elev = ((_spallPolar select 2) - _spread) + (random (_spread * 2)); - private _dir = ((_spallPolar select 1) - _spread) + (random (_spread * 2)); - if (abs _elev > 90) then { - ADD(_dir,180); - }; - _dir = _dir % 360; - private _vel = (_spallPolar select 0) * 0.33 * _vm; - _vel = (_vel - (_vel * 0.25)) + (random (_vel * 0.5)); - - private _spallFragVect = [_vel, _dir, _elev] call CBA_fnc_polar2vect; - private _fragment = (selectRandomWeighted WEIGHTED_SIZE) createVehicleLocal [0,0,10000]; - _fragment setPosASL _spallPos; - _fragment setVelocity _spallFragVect; - - #ifdef DRAW_FRAG_INFO - [ACE_player, _fragment, [1, 0.5, 0, 1]] call FUNC(dev_addTrack); - #endif -}; - -_spread = 5 + (random 5); -_spallCount = 3 + (random 5); -for "_i" from 1 to _spallCount do { - private _elev = ((_spallPolar select 2) - _spread) + (random (_spread * 2)); - private _dir = ((_spallPolar select 1) - _spread) + (random (_spread * 2)); - if (abs _elev > 90) then { - ADD(_dir,180); - }; - _dir = _dir % 360; - private _vel = (_spallPolar select 0) * 0.55 * _vm; - _vel = (_vel - (_vel * 0.25)) + (random (_vel * 0.5)); - - private _spallFragVect = [_vel, _dir, _elev] call CBA_fnc_polar2vect; - private _fragment = (selectRandomWeighted WEIGHTED_SIZE) createVehicleLocal [0, 0, 10000]; - _fragment setPosASL _spallPos; - _fragment setVelocity _spallFragVect; - - #ifdef DRAW_FRAG_INFO - [ACE_player, _fragment, [1, 0, 0, 1]] call FUNC(dev_addTrack); - #endif -}; diff --git a/addons/frag/functions/fnc_doSpallHitPart.sqf b/addons/frag/functions/fnc_doSpallHitPart.sqf new file mode 100644 index 00000000000..dc22c66a63c --- /dev/null +++ b/addons/frag/functions/fnc_doSpallHitPart.sqf @@ -0,0 +1,133 @@ +#include "..\script_component.hpp" +/* + * Author: Jaynus, NouberNou, Lambda.Tiger, + * This function creates spalling when a projectile hits a object and comes to a stop. + * + * Arguments: + * 0: The projectile that may generate spalling <OBJECT> + * 1: The object the projectile hit <OBJECT> + * 2: The position (ASL) of the projectile hit<ARRAY> + * 3: The velocity of the projectile before it hit the surface <ARRAY> + * 4: The surface normal of the surface hit <ARRAY> + * 5: The name of the config name or path to bisurf of the surface hit <STRING> + * 6: The projectiles ammo config <STRING> + * 7: The projectiles shot parent <ARRAY> + * 8: The "up" vector of the projectile when it hit the object <ARRAY> + * + * Return Value: + * None + * + * Example: + * [BIS_HITPART_EH_ARGS] call ace_frag_fnc_doSpallHitPart; + * + * Public: No + */ +TRACE_1("doSpallHitPart",_this); +if (CBA_missionTime < GVAR(nextSpallAllowTime)) exitWith { + TRACE_2("timeExit",CBA_missionTime,GVAR(nextSpallAllowTime)); +}; +params ["_projectile", "_objectHit", "_lastPosASL", "_lastVelocity", "_surfaceNorm", "_surfaceType", "_ammo", "_vectorUp"]; + +// Find spall speed / fragment info +_ammo call FUNC(getSpallInfo) params ["_caliber", "_explosive", "_indirectHit"]; +// Add in v2.18 `getShotInfo`'s `fuseDistanceLeft <= 0` to _explosive +if ((alive _projectile && _explosive < 0.5) || + _ammo == "" || + _lastPosASL isEqualTo [0,0,0] || + {_objectHit isKindOf "CAManBase"}) exitWith { + TRACE_3("exitEarly",alive _projectile,_lastPosASL,_objectHit); +}; + +private _material = _surfaceType call FUNC(getMaterialInfo); +if (_material == "ground") exitWith { + TRACE_1("hitGround",_surfaceType); +}; + +private _speedChange = vectorMagnitude _lastVelocity; +/* + * This is all fudge factor since real spalling is too complex for calculation. + * There are two terms. The first is from round impact, taking a quasi scale + * of caliber coefficient * round caliber * srqt(change in speed). The second term is + * explosive * indirect hit, for any explosive contribution + */ +private _spallPower = (ACE_FRAG_SPALL_CALIBER_COEF * _caliber * sqrt _speedChange + _explosive * _indirectHit) * GVAR(spallIntensity); +TRACE_3("found speed",_speedChange,_caliber,_spallPower); + +if (_spallPower < ACE_FRAG_SPALL_POWER_MIN) exitWith { + TRACE_1("lowImpulse",_ammo); +}; + +private _lastVelocityNorm = vectorNormalized _lastVelocity; +private _deltaStep = _lastVelocityNorm vectorMultiply 0.05; + +if (terrainIntersectASL [_lastPosASL vectorAdd _deltaStep, _lastPosASL]) exitWith { + TRACE_2("terrainIntersect",_lastPosASL,_deltaStep); +}; + +#ifdef DEBUG_MODE_DRAW +if GVAR(dbgSphere) then { + [_lastPosASL vectorAdd _lastVelocityNorm, "orange"] call FUNC(dev_sphereDraw); + [_lastPosASL, "yellow"] call FUNC(dev_sphereDraw); +}; +#endif + +/* + * Improve performance of finding otherside of object on shallow angle + * impacts. 120 degrees due to 90 degree offset with _lastVelocityNorm into object. + */ +private _spallPosASL = _lastPosASL vectorAdd _deltaStep; +if (120 > acos (_lastVelocityNorm vectorDotProduct _surfaceNorm)) then { + _spallPosASL = _spallPosASL vectorAdd (_deltaStep vectorMultiply 5); +}; +private _lastSpallPos = _spallPosASL; +// we need to check 1.05 m in the direction of last velocity incrementing by delta step +// Our initial check is from 0m to 5 cm, so we only need to iterate from 2 to 21 to get +// to the full 1.05m +for "_stepNumber" from 2 to 21 do +{ + _spallPosASL = _lastSpallPos vectorAdd _deltaStep; + if (!lineIntersects [_lastSpallPos, _spallPosASL]) exitWith { + _spallPosASL = _lastSpallPos vectorAdd _deltaStep; + }; + _lastSpallPos = _spallPosASL; +}; + +if (_spallPosASL isEqualTo _lastSpallPos) exitWith { + TRACE_2("insideObj",_lastPosASL,_spallPosASL); +}; + +#ifdef DEBUG_MODE_DRAW +if GVAR(dbgSphere) then { + [_spallPosASL, "green"] call FUNC(dev_sphereDraw); +}; +#endif + +private _spawnSize = switch (true) do { + case (_spallPower < ACE_FRAG_SPALL_POWER_TINY_MAX): {"_spall_tiny"}; + case (_spallPower < ACE_FRAG_SPALL_POWER_SMALL_MAX): {"_spall_small"}; + case (_spallPower < ACE_FRAG_SPALL_POWER_MEDIUM_MAX): {"_spall_medium"}; + case (_spallPower < ACE_FRAG_SPALL_POWER_LARGE_MAX): {"_spall_large"}; + default {"_spall_huge"}; +}; +GVAR(nextSpallAllowTime) = CBA_missionTime + ACE_FRAG_SPALL_HOLDOFF; + +private _spallSpawner = createVehicleLocal [ + QUOTE(GLUE(ADDON,_)) + _material + _spawnSize, + ASLToAGL _spallPosASL, + [], + 0, + "CAN_COLLIDE" +]; +_spallSpawner setVectorDirAndUp [_lastVelocityNorm, _vectorUp]; +_spallSpawner setVelocityModelSpace [0, _speedChange * ACE_FRAG_SPALL_VELOCITY_INHERIT_COEFF, 0]; + +TRACE_3("createSpallSpawner",speed _spallSpawner,_material + _spawnSize,_spallPower); +#ifdef DEBUG_MODE_DRAW +_spallSpawner addEventHandler [ + "SubmunitionCreated", + { + params ["", "_subProj"]; + [_subProj, "purple", true] call FUNC(dev_trackObj); + } +]; +#endif diff --git a/addons/frag/functions/fnc_doSpallPenetrate.sqf b/addons/frag/functions/fnc_doSpallPenetrate.sqf new file mode 100644 index 00000000000..6c8feda7a9d --- /dev/null +++ b/addons/frag/functions/fnc_doSpallPenetrate.sqf @@ -0,0 +1,98 @@ +#include "..\script_component.hpp" +/* + * Author: Jaynus, NouberNou, Lambda.Tiger, + * This function creates spalling if a projectile penetrated a surface and was slowed down enough proportional to the caliber. + * It is dissimilar in function from fnc_doSpallHitPart, but leveraging the "Penetrated" projectile EH to process faster. + * + * Arguments: + * Arguments are the same as BI's "Penetratred" EH: + * https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#Penetrated + * + * Return Value: + * None + * + * Example: + * [BIS_PENETRATED_EH_ARGS] call ace_frag_fnc_doSpallPenetrate; + * + * Public: No + */ +#define EPSILON 0.1 + +TRACE_1("doSpallPenetration",_this); +if (CBA_missionTime < GVAR(nextSpallAllowTime)) exitWith { + TRACE_1("timeExit",_this); +}; +params ["_projectile", "_hitObject", "_surfaceType", "", "_spallPosASL", "_newVelocity"]; + +private _ammo = typeOf _projectile; +if (_spallPosASL isEqualTo [0,0,0] || + {_ammo isEqualTo ""} || + {_hitObject isKindOf "CAManBase"}) exitWith { + TRACE_4("time/invalidHit",CBA_missionTime,GVAR(nextSpallAllowTime),_hitObject,_spallPosASL); +}; + +private _material = _surfaceType call FUNC(getMaterialInfo); +if (_material == "ground") exitWith { + #ifdef DEBUG_MODE_FULL + systemChat "ground spall"; + #endif +}; + +_ammo call FUNC(getSpallInfo) params ["_caliber", "_explosive", "_indirectHit"]; +private _velocityChange = velocity _projectile vectorDiff _newVelocity; +private _speedChange = vectorMagnitude _velocityChange; +/* + * This is all fudge factor since real spalling is too complex for calculation. + * The equation takes taking a quasi scale of energy using caliber and change in speed. + */ +private _spallPower = ACE_FRAG_SPALL_CALIBER_COEF * _caliber * sqrt _speedChange * GVAR(spallIntensity); +TRACE_5("found speed",_velocityChange,_speedChange,_caliber,_spallPower,_material); + +if (_spallPower < ACE_FRAG_SPALL_POWER_MIN) exitWith { + TRACE_1("lowImpulse",_ammo); +}; +private _spallDirection = vectorNormalized _velocityChange; + +#ifdef DEBUG_MODE_DRAW +if GVAR(dbgSphere) then { + [_spallPosASL, "green"] call FUNC(dev_sphereDraw); +}; +#endif + +private _spawnSize = switch (true) do { + case (_spallPower < ACE_FRAG_SPALL_POWER_TINY_MAX): {"_spall_tiny"}; + case (_spallPower < ACE_FRAG_SPALL_POWER_SMALL_MAX): {"_spall_small"}; + case (_spallPower < ACE_FRAG_SPALL_POWER_MEDIUM_MAX): {"_spall_medium"}; + case (_spallPower < ACE_FRAG_SPALL_POWER_LARGE_MAX): {"_spall_large"}; + default {"_spall_huge"}; +}; +GVAR(nextSpallAllowTime) = CBA_missionTime + ACE_FRAG_SPALL_HOLDOFF; + +// Solve for one of the vectors normal to _spallDirection on y = 0 plane +private _spallVectorUp = [0, 0, 1]; +if (_spallDirection#2 > EPSILON) then { + private _newZ = _spallDirection#0 / _spallDirection#2; + _spallVectorUp = vectorNormalized [1, 0, -_newZ]; +}; + +private _spallSpawner = createVehicleLocal [ + QUOTE(GLUE(ADDON,_)) + _material + _spawnSize, + ASLToAGL _spallPosASL, + [], + 0, + "CAN_COLLIDE" +]; +_spallSpawner setVectorDirAndUp [_spallDirection, _spallVectorUp]; +_spallSpawner setVelocityModelSpace [0, _speedChange * ACE_FRAG_SPALL_VELOCITY_INHERIT_COEFF, 0]; +TRACE_4("dir&up",_spallDirection,vectorDir _spallSpawner,_spallVectorUp,vectorUp _spallSpawner); + +TRACE_3("createSpallSpawner",speed _spallSpawner,_material + _spawnSize,_spallPower); +#ifdef DEBUG_MODE_DRAW +_spallSpawner addEventHandler [ + "SubmunitionCreated", + { + params ["", "_subProj"]; + [_subProj, "purple", true] call FUNC(dev_trackObj); + } +]; +#endif diff --git a/addons/frag/functions/fnc_findReflections.sqf b/addons/frag/functions/fnc_findReflections.sqf index a753934fe85..00a26022e2b 100644 --- a/addons/frag/functions/fnc_findReflections.sqf +++ b/addons/frag/functions/fnc_findReflections.sqf @@ -75,7 +75,7 @@ if (_zIndex < 5) then { } forEach _nlos; { if !(_forEachIndex in _excludes) then { - _testPos = _x; + private _testPos = _x; if (_testPos vectorDistanceSqr _bucketPos <= 30) then { _bucketList pushBack _x; _excludes pushBack _forEachIndex; diff --git a/addons/frag/functions/fnc_fired.sqf b/addons/frag/functions/fnc_fired.sqf index 03d2fab6096..1cc72af2af6 100644 --- a/addons/frag/functions/fnc_fired.sqf +++ b/addons/frag/functions/fnc_fired.sqf @@ -1,14 +1,14 @@ #include "..\script_component.hpp" /* - * Author: nou, jaynus, PabstMirror - * Called from the unified fired EH for all. - * If spall is not enabled (default), then cache and only track those that will actually trigger fragmentation. + * Author: nou, jaynus, Lambda.Tiger, PabstMirror + * Add "Exploded" eventhandler to a projectile if it will produce fragments + * and a "HitPart" eventhandler if it will produce spall. * * Arguments: - * None. Parameters inherited from EFUNC(common,firedEH) + * Parameters inherited from EFUNC(common,firedEH) * * Return Value: - * None + * Nothing Useful * * Example: * [clientFiredBIS-XEH] call ace_frag_fnc_fired @@ -19,40 +19,33 @@ //IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"]; TRACE_10("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_vehicle,_gunner,_turret); -private _shouldAdd = GVAR(cacheRoundsTypesToTrack) get _ammo; -if (isNil "_shouldAdd") then { - TRACE_1("no cache for round",_ammo); - - //Read configs and test if it would actually cause a frag, using same logic as FUNC(pfhRound) - private _skip = getNumber (configFile >> "CfgAmmo" >> _ammo >> QGVAR(skip)); - private _explosive = getNumber (configFile >> "CfgAmmo" >> _ammo >> "explosive"); - private _indirectRange = getNumber (configFile >> "CfgAmmo" >> _ammo >> "indirectHitRange"); - private _force = getNumber (configFile >> "CfgAmmo" >> _ammo >> QGVAR(force)); - private _fragPower = getNumber (configFile >> "CfgAmmo" >> _ammo >> "indirecthit") * (sqrt (getNumber (configFile >> "CfgAmmo" >> _ammo >> "indirectHitRange"))); - - _shouldAdd = (_skip == 0) && {(_force == 1) || {_explosive > 0.5 && {_indirectRange >= 4.5} && {_fragPower >= 35}}}; +if (_ammo isEqualTo "" || {isNull _projectile} || + !(if (isNil "_gunner") then {local _unit} else {local _gunner}) || + {_projectile getVariable [QGVAR(blacklisted), false]}) exitWith { + TRACE_2("bad ammo or projectile, or blackList",_ammo,_projectile); +}; - if (GVAR(spallEnabled) && {!_shouldAdd}) then { - private _caliber = getNumber (configFile >> "CfgAmmo" >> _ammo >> "caliber"); - if !(_caliber >= 2.5 || {(_explosive > 0 && {_indirectRange >= 1})}) exitWith {}; // from check in doSpall: line 34 - TRACE_1("Won't frag, but will spall",_caliber); - _shouldAdd = true; - }; +#ifdef DEBUG_MODE_DRAW +if (GVAR(debugOptions) && {_ammo call FUNC(shouldFrag) || {_ammo call FUNC(shouldSpall)}}) then { + [_projectile, "red", true] call FUNC(dev_trackObj); +}; +#endif - TRACE_6("Setting Cache",_skip,_explosive,_indirectRange,_force,_fragPower,_shouldAdd); - GVAR(cacheRoundsTypesToTrack) set [_ammo, _shouldAdd]; +if (!GVAR(spallEnabled) || {!(_ammo call FUNC(shouldSpall))}) exitWith { + TRACE_2("No spall",GVAR(spallEnabled),_ammo call FUNC(shouldSpall)); }; -if (_shouldAdd) then { - // firedMan will have nil "_gunner", so just check _unit; for firedVehicle we want to check _gunner - private _localShooter = if (isNil "_gunner") then {local _unit} else {local _gunner}; - TRACE_4("",_localShooter,_unit,_ammo,_projectile); - if (!_localShooter) exitWith {}; - if (_weapon == "Put") exitWith {}; // Ignore explosives placed without ace_explosives +private _hitPartEventHandler = _projectile addEventHandler ["HitPart", { + params ["_projectile", "_objectHit", "", "_posASL", "_velocity", "_surfNorm", "", "" ,"_surfType"]; + private _ammo = typeOf _projectile; + private _vectorUp = vectorUp _projectile; - // Skip if less than 0.5 second from last shot - if ((CBA_missionTime - (_unit getVariable [QGVAR(lastTrack), -1])) < 0.5) exitWith {}; - _unit setVariable [QGVAR(lastTrack), CBA_missionTime]; + /* + * Wait a frame to see what happens to the round + */ + [LINKFUNC(doSpallHitPart), [_projectile, _objectHit, _posASL, _velocity, _surfNorm, _surfType, _ammo, _vectorUp]] call CBA_fnc_execNextFrame; +}]; +private _penetratedEventHandler = _projectile addEventHandler ["Penetrated",LINKFUNC(doSpallPenetrate)]; +_projectile setVariable [QGVAR(hitPartEventHandler), [_hitPartEventHandler, _penetratedEventHandler]]; - [_unit, _ammo, _projectile] call FUNC(addPfhRound); -}; +TRACE_1("firedExit",_ammo); diff --git a/addons/frag/functions/fnc_frago.sqf b/addons/frag/functions/fnc_frago.sqf index 8fd77dbc739..bda1aa58f6d 100644 --- a/addons/frag/functions/fnc_frago.sqf +++ b/addons/frag/functions/fnc_frago.sqf @@ -1,15 +1,15 @@ #include "..\script_component.hpp" /* - * Author: Jaynus, NouberNou + * Author: Jaynus, NouberNou, Lambda.Tiger * Server func to create the fragmentation for a round. * * Arguments: - * 0: Last Position (ASL) <ARRAY> - * 1: Velocity <ARRAY> - * 2: Ammo Classname <STRING> + * 0: ASL position projetile is fragmenting at <ARRAY> + * 1: Projectile ammo classname <STRING> + * 2: Projectile shot parents <ARRAY> * * Return Value: - * None + * The number of fragments created <NUMBER> * * Example: * [[], [], "handGrenade"] call ace_frag_fnc_frago @@ -17,139 +17,109 @@ * Public: No */ -#define FRAG_VEC_VAR 0.004 -#define MAX_FRAG_COUNT 50 +#define FRAG_VEC_VAR 0.008 BEGIN_COUNTER(frago); -params ["_lastPos", "_lastVel", "_shellType"]; -TRACE_3("frago",_lastPos,_lastVel,_shellType); +params ["_fragPosASL", "_shellType", "_shotParents"]; +TRACE_3("frago",_fragPosASL,_shellType,_shotParents); // Limit max frag count if there was a recent frag -private _maxFrags = round (MAX_FRAG_COUNT * linearConversion [0.1, 1.5, (CBA_missionTime - GVAR(lastFragTime)), 0.1, 1, true]); +private _maxFrags = round linearConversion [ + ACE_FRAG_COUNT_MIN_TIME, + ACE_FRAG_COUNT_MAX_TIME, + (CBA_missionTime - GVAR(lastFragTime)), + ACE_FRAG_COUNT_MIN, + ACE_FRAG_COUNT_MAX, + true +]; TRACE_2("",_maxFrags,CBA_missionTime - GVAR(lastFragTime)); GVAR(lastFragTime) = CBA_missionTime; -private _fragTypes = [ - QGVAR(tiny), QGVAR(tiny), QGVAR(tiny), - QGVAR(tiny_HD), QGVAR(tiny_HD), QGVAR(tiny_HD), - QGVAR(small), QGVAR(small), QGVAR(small), QGVAR(small), - QGVAR(small_HD), QGVAR(small_HD), QGVAR(small_HD), QGVAR(small_HD), - QGVAR(medium_HD), QGVAR(medium_HD), QGVAR(medium_HD), QGVAR(medium_HD), QGVAR(medium_HD) -]; - -private _warn = false; -if (isArray (configFile >> "CfgAmmo" >> _shellType >> QGVAR(CLASSES))) then { - _fragTypes = getArray (configFile >> "CfgAmmo" >> _shellType >> QGVAR(CLASSES)); -} else { - _warn = true; -}; +_shellType call FUNC(getFragInfo) params ["_fragRange", "_fragVelocity", "_fragTypes", "_metalMassModifier"]; -private _indirectHitRange = getNumber(configFile >> "CfgAmmo" >> _shellType >> "indirecthitrange"); -private _fragRange = 20 * _indirectHitRange * 4; -// _c = 185; // grams of comp-b -// _m = 210; // grams of fragmentating metal -// _k = 3/5; // spherical K factor -// _gC = 2843; // Gurney constant of comp-b in /ms - -// _c = 429; // grams of tritonal -// _m = 496; // grams of fragmentating metal -// _k = 1/2; // spherical K factor -// _gC = 2320; // Gurney constant of tritonal in /ms - -private _c = getNumber (configFile >> "CfgAmmo" >> _shellType >> QGVAR(CHARGE)); -if (_c == 0) then {_c = 1; _warn = true;}; -private _m = getNumber (configFile >> "CfgAmmo" >> _shellType >> QGVAR(METAL)); -if (_m == 0) then {_m = 2; _warn = true;}; -private _k = getNumber (configFile >> "CfgAmmo" >> _shellType >> QGVAR(GURNEY_K)); -if (_k == 0) then {_k = 0.5; _warn = true;}; -private _gC = getNumber (configFile >> "CfgAmmo" >> _shellType >> QGVAR(GURNEY_C)); -if (_gC == 0) then {_gC = 2440; _warn = true;}; - -if (_warn) then { - INFO_1("Ammo class %1 lacks proper explosive properties definitions for frag!",_shellType); +private _fragPosAGL = ASLToAGL _fragPosASL; +TRACE_5("fragValues",_fragPosASL,_fragPosAGL,_fragRange,_fragVelocity,_metalMassModifier); +// Post 2.18 change - uncomment line 43, modify lines 45, and remove lines 44, 51-57, 64-66 +// private _targets = [ASLToAGL _fragPosAGL, _fragRange, _fragRange, 0, false, _fragRange] nearEntities [["Car", "Motorcycle", "Tank", "StaticWeapon", "CAManBase", "Air", "Ship"], false, true, true]; +private _objects = _fragPosAGL nearEntities [["Car", "Motorcycle", "Tank", "StaticWeapon", "CAManBase", "Air", "Ship"], _fragRange]; +if (_objects isEqualTo []) exitWith { + TRACE_2("No nearby targets",_fragPosAGL,_fragRange); + 0 }; -// Gunery equation is for a non-fragmenting metal, imperical value of 80% represents fragmentation -private _fragPower = 0.8 * (((_m / _c) + _k) ^ - (1 / 2)) * _gC; - -private _atlPos = ASLtoATL _lastPos; - -private _fragPowerRandom = _fragPower * 0.5; -if ((_atlPos select 2) < 0.5) then { - _lastPos vectorAdd [0, 0, 0.5]; -}; - -private _objects = _atlPos nearEntities [["Car", "Motorcycle", "Tank", "StaticWeapon", "CAManBase", "Air", "Ship"], _fragRange]; -// Add unique crews in faster way +// grab crews and add them in so that targets stay approx. sorted by distance +TRACE_1("",_objects); +private _targets = []; { - { - _objects pushBackUnique _x; - } forEach (crew _x); + private _crew = crew _x; + _crew pushBackUnique _x; + _targets append _crew; } forEach _objects; -TRACE_2("",_fragRange,count _objects); +TRACE_2("",_fragRange,count _targets); private _fragCount = 0; private _fragArcs = []; _fragArcs set [360, 0]; -private _doRandom = true; -if (_objects isNotEqualTo []) then { +if (_targets isNotEqualTo []) then { if (GVAR(reflectionsEnabled)) then { - [_lastPos, _shellType] call FUNC(doReflections); + [_fragPosASL, _shellType] call FUNC(doReflections); }; { private _target = _x; - if (alive _target) then { + if (alive _target && {getNumber ((configOf _target) >> "isPlayableLogic") == 0}) then { (boundingBox _target) params ["_boundingBoxA", "_boundingBoxB"]; private _cubic = ((abs (_boundingBoxA select 0)) + (_boundingBoxB select 0)) * ((abs (_boundingBoxA select 1)) + (_boundingBoxB select 1)) * ((abs (_boundingBoxA select 2)) + (_boundingBoxB select 2)); if (_cubic <= 1) exitWith {}; - // _doRandom = true; private _targetVel = velocity _target; private _targetPos = getPosASL _target; - private _distance = _targetPos vectorDistance _lastPos; - private _add = ((_boundingBoxB select 2) / 2) + ((((_distance - (_fragpower / 8)) max 0) / _fragPower) * 10); + private _distance = _target distance _fragPosAGL; + private _add = ((_boundingBoxB select 2) / 2) + ((((_distance - (_fragVelocity / 8)) max 0) / _fragVelocity) * 10); _targetPos = _targetPos vectorAdd [ - (_targetVel select 0) * (_distance / _fragPower), - (_targetVel select 1) * (_distance / _fragPower), - _add + (_targetVel select 0) * (_distance / _fragVelocity), + (_targetVel select 1) * (_distance / _fragVelocity), + _add ]; - private _baseVec = _lastPos vectorFromTo _targetPos; + private _baseVec = _fragPosASL vectorFromTo _targetPos; private _dir = floor (_baseVec call CBA_fnc_vectDir); private _currentCount = RETDEF(_fragArcs select _dir,0); if (_currentCount < 10) then { - private _count = ceil (random (sqrt (_m / 1000))); + private _count = ceil (random _metalMassModifier); private _vecVar = FRAG_VEC_VAR; - if !(_target isKindOf "Man") then { + if !(_target isKindOf "CAManBase") then { ADD(_vecVar,(sqrt _cubic) / 2000); if ((crew _target) isEqualTo [] && {_count > 0}) then { _count = 0 max (_count / 2); }; }; + private _vecVarHalf = _vecVar / 2; for "_i" from 1 to _count do { - private _vec = _baseVec vectorDiff [ - (_vecVar / 2) + (random _vecVar), - (_vecVar / 2) + (random _vecVar), - (_vecVar / 2) + (random _vecVar) + private _vectorDir = _baseVec vectorDiff [ + _vecVarHalf - (random _vecVar), + _vecVarHalf - (random _vecVar), + _vecVarHalf - (random _vecVar) ]; - private _fp = _fragPower - (random (_fragPowerRandom)); - private _vel = _vec vectorMultiply _fp; - - private _fragObj = (selectRandom _fragTypes) createVehicleLocal [0,0,10000]; - // TRACE_4("targeted",_fp,typeOf _fragObj,_lastPos vectorDistance _targetPos,typeOf _x); - _fragObj setPosASL _lastPos; - _fragObj setVectorDir _vec; - _fragObj setVelocity _vel; - #ifdef DRAW_FRAG_INFO - [ACE_player, _fragObj, [1,0,0,1]] call FUNC(dev_addTrack); + private _fragObjSpeed = _fragVelocity * (1 - random 0.5); + private _fragObjVelocity = _vectorDir vectorMultiply _fragObjSpeed; + + private _fragObj = createVehicleLocal [selectRandom _fragTypes, _fragPosAGL, [], 0, "CAN_COLLIDE"]; + _fragObj setVectorDir _vectorDir; + _fragObj setVelocity _fragObjVelocity; + _fragObj setShotParents _shotParents; + #ifdef DEBUG_MODE_DRAW + [_fragObj, "green", true] call FUNC(dev_trackObj); + if (GVAR(dbgSphere)) then { + [_targetPos, "(0.88,0.36,0.92,0.8)"] call FUNC(dev_sphereDraw); + }; #endif INC(_fragCount); INC(_currentCount); @@ -158,34 +128,31 @@ if (_objects isNotEqualTo []) then { }; }; if (_fragCount > _maxFrags) exitWith {}; - } forEach _objects; + } forEach _targets; TRACE_1("targeted",_fragCount); if (_fragCount > _maxFrags) exitWith {}; private _randomCount = ceil ((_maxFrags - _fragCount) * 0.35); TRACE_1("",_randomCount); private _sectorSize = 360 / (_randomCount max 1); - if (_doRandom) then { - for "_i" from 1 to _randomCount do { - // Distribute evenly - private _sectorOffset = 360 * (_i - 1) / (_randomCount max 1); - private _randomDir = random (_sectorSize); - _vec = [cos (_sectorOffset + _randomDir), sin (_sectorOffset + _randomDir), sin (30 - (random 45))]; - - _fp = (_fragPower - (random (_fragPowerRandom))); + for "_i" from 1 to _randomCount do { + // Distribute evenly + private _sectorOffset = 360 * (_i - 1) / (_randomCount max 1); + private _randomDir = random (_sectorSize); + private _vectorDir = [cos (_sectorOffset + _randomDir), sin (_sectorOffset + _randomDir), sin (30 - (random 45))]; - _vel = _vec vectorMultiply _fp; + private _fragObjSpeed = _fragVelocity * (1 - random 0.5); + private _fragObjVelocity = _vectorDir vectorMultiply _fragObjSpeed; - _fragObj = (selectRandom _fragTypes) createVehicleLocal [0, 0, 10000]; - _fragObj setPosASL _lastPos; - _fragObj setVectorDir _vec; - _fragObj setVelocity _vel; + private _fragObj = createVehicleLocal [selectRandom _fragTypes, _fragPosAGL, [], 0, "CAN_COLLIDE"]; + _fragObj setVectorDir _vectorDir; + _fragObj setVelocity _fragObjVelocity; + _fragObj setShotParents _shotParents; - #ifdef DRAW_FRAG_INFO - [ACE_player, _fragObj, [1,0.5,0,1]] call FUNC(dev_addTrack); - #endif - INC(_fragCount); - }; + #ifdef DEBUG_MODE_DRAW + [_fragObj, "blue", true] call FUNC(dev_trackObj); + #endif + INC(_fragCount); }; }; diff --git a/addons/frag/functions/fnc_getFragInfo.sqf b/addons/frag/functions/fnc_getFragInfo.sqf new file mode 100644 index 00000000000..77222234235 --- /dev/null +++ b/addons/frag/functions/fnc_getFragInfo.sqf @@ -0,0 +1,96 @@ +#include "..\script_component.hpp" +/* + * Author: Jaynus, NouberNou, Lambda.Tiger + * This function returns fragmentation parameters for a specific ammo type. + * + * Arguments: + * 0: Ammo classname <STRING> + * + * Return Value: + * _ammoInfo <ARRAY> + * 0: Search range for fragments in meters <NUMBER> + * 1: Gurney equation calculated speed <NUMBER> + * 2: Array of fragment types <ARRAY> + * 3: Mass of fragmenting metal modified for frag count <NUMBER> + * + * Example: + * "B_556x45_Ball" call ace_frag_fnc_getFragInfo + * + * Public: No + */ + +params ["_ammo"]; + +GVAR(fragInfoCache) getOrDefaultCall [_ammo, { + private _ammoConfig = configFile >> "CfgAmmo" >> _ammo; + private _fragTypes = ACE_FRAG_DEFAULT_FRAG_TYPES; + private _notifyMissingEntries = false; + if (isArray (_ammoConfig >> QGVAR(classes))) then { + _fragTypes = getArray (_ammoConfig >> QGVAR(classes)); + } else { + _notifyMissingEntries = true; + }; + + /************ Gurney equation notes *****************//* + * see https://en.wikipedia.org/wiki/Gurney_equations + * + * gurney_k is the geometry constant added to _metalMass/_chargeMass + * gurney_c = sqrt(2E) + * + * _chargeMass = 185; - grams of comp-b + * _metalMass = 210; - grams of metal are accelerated by explosion + * _geometryCoefficient = 3/5; - spherical K factor + * _gurneyConstant = 2843; - Gurney constant of comp-b in /ms + * + * _chargeMass = 429; - grams of tritonal + * _metalMass = 496; - grams of metal are accelerated by explosion + * _geometryCoefficient = 1/2; - cylindrical K factor + * _gurneyConstant = 2320; - Gurney constant of tritonal in m/s + * Equation - 0.8 for empirical 80% speed + * 0.8 * (((_metalMass / _chargeMass) + _geometryCoefficient) ^ - (1 / 2)) * _gurneyConstant; + * or 0.8 * _gurneyConstant * sqrt (_chargeMass /(_metalMass + _chargeMass * _geometryCoefficient)); (slightly faster to compute) + */ + + private _chargeMass = getNumber (_ammoConfig >> QGVAR(charge)); + if (_chargeMass == 0) then { + _chargeMass = 1; + _notifyMissingEntries = true; + }; + + private _metalMass = getNumber (_ammoConfig >> QGVAR(metal)); + if (_metalMass == 0) then { + _metalMass = 2; + _notifyMissingEntries = true; + }; + + private _geometryCoefficient = getNumber (_ammoConfig >> QGVAR(gurney_k)); + if (_geometryCoefficient == 0) then { + _geometryCoefficient = 0.5; + _notifyMissingEntries = true; + }; + + private _gurneyConstant = getNumber (_ammoConfig >> QGVAR(gurney_c)); + if (_gurneyConstant == 0) then { + _gurneyConstant = 2440; + _notifyMissingEntries = true; + }; + + if (_notifyMissingEntries) then { + INFO_1("Ammo class %1 lacks proper explosive properties definitions for frag!",_ammo); + }; + + private _indirectHitRange = getNumber (_ammoConfig >> "indirecthitrange"); + + /********************** _ammoInfo format *************************//* + * 0: _fragRange - search range for fragments + * 1: _fragVelocity - gurney equation calculated velocity + * 2: _fragTypes - array of fragment types + * 3: _metalMassModified - mass of fragmenting metal modified for frag count + */ + [ + 80 * _indirectHitRange, + ACE_FRAG_IMPERIC_VELOCITY_CONSTANT * _gurneyConstant * sqrt (_chargeMass / (_metalMass + _chargeMass * _geometryCoefficient)), + _fragTypes, + sqrt (_metalMass / 1000) + ] // return +}, true] diff --git a/addons/frag/functions/fnc_getMaterialInfo.sqf b/addons/frag/functions/fnc_getMaterialInfo.sqf new file mode 100644 index 00000000000..199953b237b --- /dev/null +++ b/addons/frag/functions/fnc_getMaterialInfo.sqf @@ -0,0 +1,62 @@ +#include "..\script_component.hpp" +/* + * Author: Lambda.Tiger + * This function returns a classification of material type based on the surface hit. + * + * Arguments: + * 0: Surface type given as either a CfgSurfaces path or .bisurf filepath, same format as "HitPart" projectile parameter <STRING> + * + * Return Value: + * Material categories as expanded on in line 44 below <STRING> + * + * Example: + * "a3\data_f\penetration\concrete.bisurf" call ace_frag_fnc_getMaterialInfo + * + * Public: No + */ + +#define ACE_FRAG_SOUNDENVIRON_STR_LEN 12 +#define ACE_FRAG_SOUNDHIT_STR_LEN 8 +#define ACE_FRAG_MATERIAL_SEARCH_LEN 10 + +params ["_surfType"]; + +private _material = GVAR(spallMaterialCache) get _surfType; + +TRACE_2("materialCache",_surfType,_material); +if (!isNil "_material") exitWith {_material}; +// Use 'soundEnviron' or 'soundHit' to extract approx material +private _surfaceConfig = configFile >> "CfgSurfaces" >> _surfType; +if (isClass _surfaceConfig) then { + _material = getText (_surfaceConfig >> "soundEnviron"); + if (_material == "" || {_material == "empty"}) then { + _material = getText (_surfaceConfig >> "soundhit"); + }; +} else { // Messy way when a surface isn't added to CfgSurfaces + private _surfFileText = toLowerANSI preprocessFile _surfType; + _surfFileText = _surfFileText regexReplace ["[^a-z0-9]", ""]; + private _idx = ACE_FRAG_SOUNDENVIRON_STR_LEN + (_surfFileText find "soundenviron"); + if (_surfFileText select [_idx, 5] isEqualTo "empty") then { + _idx = ACE_FRAG_SOUNDHIT_STR_LEN + (_surfFileText find "soundhit"); + }; + _material = _surfFileText select [_idx, ACE_FRAG_MATERIAL_SEARCH_LEN]; +}; +TRACE_1("materialSubString",_material); + +_material = switch (true) do { + case ("dirt" in _material); + case ("grass" in _material): { "ground" }; + case ("gravel" in _material); + case ("rock" in _material): { "rock" }; + case ("wood" in _material): { "wood" }; + case ("lino" in _material); + case ("building" in _material); + case ("concrete" in _material): { "concrete" }; + case ("metal" in _material): { "metal" }; + default { "ground" }; +}; + +GVAR(spallMaterialCache) set [_surfType, _material]; +TRACE_2("materialCacheSet",_surfType,_material); + +_material diff --git a/addons/frag/functions/fnc_getSpallInfo.sqf b/addons/frag/functions/fnc_getSpallInfo.sqf new file mode 100644 index 00000000000..7bb566064ba --- /dev/null +++ b/addons/frag/functions/fnc_getSpallInfo.sqf @@ -0,0 +1,30 @@ +#include "..\script_component.hpp" +/* + * Author: Lambda.Tiger + * This function returns spalling parameters for a specific ammo type. + * + * Arguments: + * 0: Ammo classname <STRING> + * + * Return Value: + * _ammoInfo <ARRAY> + * 0: Caliber config value <NUMBER> + * 1: What part of the hit damage is from ballistic vs explosive energy (1 for all explosive) <NUMBER> + * 2: Indirect hit damage <NUMBER> + * + * Example: + * "B_556x45_Ball" call ace_frag_fnc_getSpallInfo + * + * Public: No + */ + +params ["_ammo"]; + +GVAR(spallInfoCache) getOrDefaultCall [_ammo, { + private _ammoConfig = configFile >> "CfgAmmo" >> _ammo; + private _caliber = getNumber (_ammoConfig >> "caliber"); + private _explosive = getNumber (_ammoConfig >> "explosive"); + private _indirectHit = getNumber (_ammoConfig >> "indirectHitRange"); + + [_caliber, _explosive, _indirectHit] // return +}, true] diff --git a/addons/frag/functions/fnc_initMaterialCache.sqf b/addons/frag/functions/fnc_initMaterialCache.sqf new file mode 100644 index 00000000000..820133cae0a --- /dev/null +++ b/addons/frag/functions/fnc_initMaterialCache.sqf @@ -0,0 +1,96 @@ +#include "..\script_component.hpp" +/* + * Author: Lambda.Tiger + * For performance, we load a bunch of vanilla materials preemptively into the spall material cache. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_frag_fnc_initMaterialCache + * + * Public: No + */ + +uiNamespace setVariable [QGVAR(spallMaterialCache), createHashMapFromArray [ + ["a3\data_f\penetration\armour.bisurf","metal"], + ["a3\data_f\penetration\armour_plate.bisurf","metal"], + ["a3\data_f\penetration\armour_plate_100mm.bisurf","metal"], + ["a3\data_f\penetration\armour_plate_12mm.bisurf","metal"], + ["a3\data_f\penetration\armour_plate_16mm.bisurf","metal"], + ["a3\data_f\penetration\armour_plate_1mm.bisurf","metal"], + ["a3\data_f\penetration\armour_plate_20mm.bisurf","metal"], + ["a3\data_f\penetration\armour_plate_23mm.bisurf","metal"], + ["a3\data_f\penetration\armour_plate_250mm.bisurf","metal"], + ["a3\data_f\penetration\armour_plate_30mm.bisurf","metal"], + ["a3\data_f\penetration\armour_plate_3mm.bisurf","metal"], + ["a3\data_f\penetration\armour_plate_40mm.bisurf","metal"], + ["a3\data_f\penetration\armour_plate_5mm.bisurf","metal"], + ["a3\data_f\penetration\armour_plate_60mm.bisurf","metal"], + ["a3\data_f\penetration\armour_plate_7mm.bisurf","metal"], + ["a3\data_f\penetration\armour_plate_80mm.bisurf","metal"], + ["a3\data_f\penetration\armour_plate_heavy.bisurf","metal"], + ["a3\data_f\penetration\armour_plate_medium.bisurf","metal"], + ["a3\data_f\penetration\armour_plate_thin.bisurf","metal"], + ["a3\data_f\penetration\bell.bisurf","ground"], + ["a3\data_f\penetration\body.bisurf","ground"], + ["a3\data_f\penetration\building.bisurf","concrete"], + ["a3\data_f\penetration\building_dust_particle.bisurf","concrete"], + ["a3\data_f\penetration\building_dust_soft.bisurf","concrete"], + ["a3\data_f\penetration\building_plate.bisurf","concrete"], + ["a3\data_f\penetration\building_wood_particle.bisurf","wood"], + ["a3\data_f\penetration\cactus.bisurf","ground"], + ["a3\data_f\penetration\cloth.bisurf","ground"], + ["a3\data_f\penetration\cloth_plate.bisurf","ground"], + ["a3\data_f\penetration\concrete.bisurf","concrete"], + ["a3\data_f\penetration\concrete_plate.bisurf","concrete"], + ["a3\data_f\penetration\default.bisurf","ground"], + ["a3\data_f\penetration\engine.bisurf","metal"], + ["a3\data_f\penetration\foliage.bisurf","ground"], + ["a3\data_f\penetration\foliage_dead.bisurf","ground"], + ["a3\data_f\penetration\foliage_dead_plate.bisurf","ground"], + ["a3\data_f\penetration\foliage_green.bisurf","ground"], + ["a3\data_f\penetration\foliage_green_big.bisurf","ground"], + ["a3\data_f\penetration\foliage_green_big_plate.bisurf","ground"], + ["a3\data_f\penetration\foliage_green_plate.bisurf","ground"], + ["a3\data_f\penetration\foliage_palm.bisurf","ground"], + ["a3\data_f\penetration\foliage_palm_plate.bisurf","ground"], + ["a3\data_f\penetration\foliage_pine.bisurf","ground"], + ["a3\data_f\penetration\foliage_pine_plate.bisurf","ground"], + ["a3\data_f\penetration\foliage_plate.bisurf","ground"], + ["a3\data_f\penetration\fueltank.bisurf","metal"], + ["a3\data_f\penetration\glass.bisurf","ground"], + ["a3\data_f\penetration\glass_armored.bisurf","ground"], + ["a3\data_f\penetration\glass_armored_plate.bisurf","ground"], + ["a3\data_f\penetration\glass_plate.bisurf","ground"], + ["a3\data_f\penetration\granite.bisurf","ground"], + ["a3\data_f\penetration\granite_plate.bisurf","ground"], + ["a3\data_f\penetration\hard_ground.bisurf","ground"], + ["a3\data_f\penetration\hay.bisurf","ground"], + ["a3\data_f\penetration\iron_cast.bisurf","metal"], + ["a3\data_f\penetration\iron_cast_plate.bisurf","metal"], + ["a3\data_f\penetration\leather.bisurf","ground"], + ["a3\data_f\penetration\meat.bisurf","ground"], + ["a3\data_f\penetration\meatbones.bisurf","ground"], + ["a3\data_f\penetration\medium_ground.bisurf","ground"], + ["a3\data_f\penetration\metal.bisurf","metal"], + ["a3\data_f\penetration\metal_plate.bisurf","metal"], + ["a3\data_f\penetration\metal_plate_thin.bisurf","metal"], + ["a3\data_f\penetration\plastic.bisurf","ground"], + ["a3\data_f\penetration\plastic_plate.bisurf","ground"], + ["a3\data_f\penetration\plexiglass.bisurf","ground"], + ["a3\data_f\penetration\plexiglass_plate.bisurf","ground"], + ["a3\data_f\penetration\rubber.bisurf","ground"], + ["a3\data_f\penetration\soft_ground.bisurf","ground"], + ["a3\data_f\penetration\tyre.bisurf","ground"], + ["a3\data_f\penetration\tyre_armored.bisurf","ground"], + ["a3\data_f\penetration\vehicle_interior.bisurf","metal"], + ["a3\data_f\penetration\void.bisurf","ground"], + ["a3\data_f\penetration\water.bisurf","ground"], + ["a3\data_f\penetration\weapon_plate.bisurf","metal"], + ["a3\data_f\penetration\wood.bisurf","wood"], + ["a3\data_f\penetration\wood_plate.bisurf","wood"] +]]; diff --git a/addons/frag/functions/fnc_masterPFH.sqf b/addons/frag/functions/fnc_masterPFH.sqf deleted file mode 100644 index 004af9a9ce5..00000000000 --- a/addons/frag/functions/fnc_masterPFH.sqf +++ /dev/null @@ -1,56 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: jaynus - * Master single PFH abstraction for all rounds being tracked by frag/spall. - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * call ace_frag_fnc_masterPFH - * - * Public: No - */ - -BEGIN_COUNTER(PFH); - -// Fast exit if nothing to do -if (GVAR(objects) isEqualTo []) exitWith {END_COUNTER(PFH);}; - -private _gcIndex = []; - -private _iter = 0; -private _objectCount = count GVAR(objects); -while {_objectCount > 0 && {_iter < (GVAR(maxTrackPerFrame) min _objectCount)}} do { - - if (GVAR(lastIterationIndex) >= _objectCount) then { - GVAR(lastIterationIndex) = 0; - }; - private _object = GVAR(objects) select GVAR(lastIterationIndex); - - if (!isNil "_object") then { - private _args = GVAR(arguments) select GVAR(lastIterationIndex); - - if !(_args call FUNC(pfhRound)) then { - _gcIndex pushBack GVAR(lastIterationIndex); // Add it to the GC if it returns false - }; - }; - INC(_iter); - INC(GVAR(lastIterationIndex)); -}; - -// Clean up dead object references -private _deletionCount = 0; -{ - TRACE_1("GC Projectile",_x); - private _deleteIndex = _x - _deletionCount; - GVAR(objects) deleteAt _deleteIndex; - GVAR(arguments) deleteAt _deleteIndex; - - INC(_deletionCount); -} forEach _gcIndex; - -END_COUNTER(PFH); diff --git a/addons/frag/functions/fnc_pfhRound.sqf b/addons/frag/functions/fnc_pfhRound.sqf deleted file mode 100644 index 0c261dcffba..00000000000 --- a/addons/frag/functions/fnc_pfhRound.sqf +++ /dev/null @@ -1,59 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: ACE-Team - * - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * call ace_frag_fnc_pfhRound - * - * Public: No - */ - -params ["_round", "_lastPos", "_lastVel", "_shellType", "_firedFrame", "_firedPos", "_doSpall", "_spallTrack", "_foundObjectHPIds", "_skip", "_explosive", "_indirectRange", "_force", "_fragPower"]; - -if (_round in GVAR(blackList)) exitWith { - false -}; - -if (!alive _round) exitWith { - if ((diag_frameno - _firedFrame) > 1) then { //skip if deleted within a single frame - if (_skip == 0) then { - if ((_explosive > 0.5 && {_indirectRange >= 4.5} && {_fragPower >= 35}) || {_force == 1}) then { - // shotbullet, shotShell don't seem to explode when touching water, so don't create frags - if ((surfaceIsWater _lastPos) && {(toLowerANSI getText (configFile >> "CfgAmmo" >> _shellType >> "simulation")) in ["shotbullet", "shotshell"]}) exitWith {}; - private _fuseDist = getNumber(configFile >> "CfgAmmo" >> _shellType >> "fuseDistance"); - private _isArmed = _firedPos vectorDistance _lastPos >= _fuseDist; // rounds explode at exactly fuseDistance, so check inclusive - TRACE_2("",_fuseDist,_isArmed); - if (!_isArmed) exitWith {TRACE_1("round not armed",_this);}; - TRACE_3("Sending frag event to server",_lastPos,_lastVel,_shellType); - [QGVAR(frag_eh), [_lastPos,_lastVel,_shellType]] call CBA_fnc_serverEvent; - }; - }; - }; - if (_doSpall) then { - DEC(GVAR(spallIsTrackingCount)); - TRACE_1("doSpall",_foundObjectHPIds); - { - if (!isNil "_x") then { - _x removeEventHandler ["HitPart", _foundObjectHPIds select _forEachIndex]; - }; - } forEach _spallTrack; - }; - false -}; - -_this set [1, getPosASL _round]; -_this set [2, velocity _round]; - -if (_doSpall) then { - private _scale = ((count GVAR(objects)) / GVAR(maxTrackPerFrame)) max 0.1; - [_round, _scale, _spallTrack, _foundObjectHPIds] call FUNC(spallTrack); -}; - -true diff --git a/addons/frag/functions/fnc_setClassBlacklisted.sqf b/addons/frag/functions/fnc_setClassBlacklisted.sqf new file mode 100644 index 00000000000..03a13500258 --- /dev/null +++ b/addons/frag/functions/fnc_setClassBlacklisted.sqf @@ -0,0 +1,49 @@ +#include "..\script_component.hpp" +/* + * Author: Lambda.Tiger + * Blacklist an ammo class preventing it from producing fragments and/or spall. + * This function will not allow you to force a projectile to produce fragments or spall. + * Once an ammo class has been blacklisted, it can be removed from the blacklist using this function without restarting the mission. + * + * Arguments: + * 0: Class name of the ammo to be blacklisted <STRING> + * 1: Should a projectile be blacklisted from producing fragments <BOOL> (default: true) + * 2: Should a projectile be blacklisted from producing spall <BOOL> (default: true) + * + * Return Value: + * Were the changes properly applied <BOOL> + * + * Example: + * // Stop "ACE_20mm_HE" from producing spall + * ["ACE_20mm_HE", false, true] call ace_frag_fnc_setClassBlacklisted; + * + * Public: Yes + */ +params [ + ["_ammo", "", [""]], + ["_blacklistFrag", true, [true]], + ["_blacklistSpall", true, [true]] +]; +TRACE_3("addBlackListClass",_ammo,_blacklistFrag,_blacklistSpall); + +if (_ammo isEqualTo "" || {!isClass (configFile >> "CfgAmmo" >> _ammo)}) exitWith { + INFO_1("Invalid ammo class [%1]",_ammo); + false +}; + +if (_blacklistFrag) then { + GVAR(shouldFragCache) set [_ammo, false]; +} else { + GVAR(shouldFragCache) deleteAt _ammo; + _ammo call FUNC(shouldFrag); +}; + + +if (_blacklistSpall) then { + GVAR(shouldSpallCache) set [_ammo, false]; +} else { + GVAR(shouldSpallCache) deleteAt _ammo; + _ammo call FUNC(shouldSpall); +}; + +true diff --git a/addons/frag/functions/fnc_shouldFrag.sqf b/addons/frag/functions/fnc_shouldFrag.sqf new file mode 100644 index 00000000000..8cc62f3dac0 --- /dev/null +++ b/addons/frag/functions/fnc_shouldFrag.sqf @@ -0,0 +1,46 @@ +#include "..\script_component.hpp" +/* + * Author: Lambda.Tiger + * This function checks whether an ammunition type should create fragments. + * + * Arguments: + * 0: Ammo classname <STRING> + * + * Return Value: + * Could the ammo class generate fragments <BOOL> + * + * Example: + * "B_556x45_Ball" call ace_frag_fnc_shouldFrag + * + * Public: No + */ + +params ["_ammo"]; + +GVAR(shouldFragCache) getOrDefaultCall [_ammo, { + private _shouldFrag = true; + + private _ammoConfig = configFile >> "CfgAmmo" >> _ammo; + private _skip = getNumber (_ammoConfig >> QGVAR(skip)); + if (_skip == 1) then { + _shouldFrag = false; + TRACE_1("No frag: skip",_skip); + }; + + private _force = getNumber (_ammoConfig >> QGVAR(force)); + if (_shouldFrag && _force == 0) then { + private _explosive = getNumber (_ammoConfig >> "explosive"); + if (_explosive < 0.5) exitWith { + _shouldFrag = false; + TRACE_3("No frag: _explosive",_skip,_force,_explosive); + }; + private _indirectHit = getNumber (_ammoConfig >> "indirectHit"); + private _indirectRange = getNumber (_ammoConfig >> "indirectHitRange"); + if (_indirectRange < 4.5 || {_indirectHit * sqrt(_indirectRange) < 35}) then { + _shouldFrag = false; + TRACE_5("No frag",_ammo,_skip,_explosive,_indirectRange,_indirectHit); + }; + }; + + _shouldFrag +}, true] diff --git a/addons/frag/functions/fnc_shouldSpall.sqf b/addons/frag/functions/fnc_shouldSpall.sqf new file mode 100644 index 00000000000..430a4da8229 --- /dev/null +++ b/addons/frag/functions/fnc_shouldSpall.sqf @@ -0,0 +1,24 @@ +#include "..\script_component.hpp" +/* + * Author: Lambda.Tiger + * This function checks whether an ammunition type should cause spalling. + * + * Arguments: + * 0: Ammo classname <STRING> + * + * Return Value: + * Whether the round type could spall when hitting an object <BOOL> + * + * Example: + * "B_556x45_Ball" call ace_frag_fnc_shouldSpall + * + * Public: No + */ + +params ["_ammo"]; + +GVAR(shouldSpallCache) getOrDefaultCall [_ammo, { + (_ammo call FUNC(getSpallInfo)) params ["_caliber", "_explosive", "_indirectHit"]; + + _caliber >= 2.5 || (_explosive > 0 && _indirectHit >= 1) // return +}, true] diff --git a/addons/frag/functions/fnc_spallHP.sqf b/addons/frag/functions/fnc_spallHP.sqf deleted file mode 100644 index 367bea76449..00000000000 --- a/addons/frag/functions/fnc_spallHP.sqf +++ /dev/null @@ -1,42 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: ACE-Team - * Handles the HitPart event - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * call ace_frag_fnc_spallHP - * - * Public: No - */ - -//player sideChat format ["f: %1 c: %2", (_this select 0), (count GVAR(spallHPData))]; - -params ["_index", "_hitPartData"]; - -private _initialData = GVAR(spallHPData) param [_index, []]; -if (_initialData isEqualTo []) exitWith {}; - -private _hpRound = (_hitPartData select 0) select 2; -private _round = _initialData select 3; -private _hpDirect = (_hitPartData select 0) select 10; - -if (_hpDirect && {_round == _hpRound}) then { - { - // diag_log text format ["HPDUMP-------------------------------------"]; - // { - // _hp = _x; - // diag_log text format ["%1 --", _forEachIndex]; - // { - // diag_log text format ["%1: %2", _forEachIndex, _x]; - // } forEach _hp; - // } forEach (_this select 1); - [DFUNC(doSpall), [_this, _forEachIndex]] call CBA_fnc_execNextFrame; - // player sideChat "WEEE"; - } forEach _hitPartData; -}; diff --git a/addons/frag/functions/fnc_spallTrack.sqf b/addons/frag/functions/fnc_spallTrack.sqf deleted file mode 100644 index 50ca64b6ec4..00000000000 --- a/addons/frag/functions/fnc_spallTrack.sqf +++ /dev/null @@ -1,39 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: ACE-Team - * Add HitPart EventHandler to objects in the projectile's path - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * call ace_frag_fnc_spallTrack - * - * Public: No - */ - -params ["_round", "_multiplier", "_foundObjects", "_foundObjectHPIds"]; - -private _delta = (1 / diag_fps) * _multiplier; -private _curPos = getPosASL _round; -private _velocity = velocity _round; - -private _velocityStep = _velocity vectorMultiply _delta; -private _forwardPos = _curPos vectorAdd _velocityStep; - - -private _intersectsWith = lineIntersectsWith [_curPos, _forwardPos]; - -if (_intersectsWith isEqualTo []) exitWith {}; -{ - // diag_log text format ["Adding HP: %1", _x]; - private _index = count GVAR(spallHPData); - private _hpId = _x addEventHandler ["HitPart", compile format ["[%1, _this] call " + QFUNC(spallHP), _index]]; - _foundObjects pushBack _x; - _foundObjectHPIds pushBack _hpId; - private _data = [_hpId, _x, typeOf _round, _round, _curPos, _velocity, 0, _foundObjects, _foundObjectHPIds]; - GVAR(spallHPData) pushBack _data; -} forEach (_intersectsWith select {!(_x in _foundObjects)}); diff --git a/addons/frag/initSettings.inc.sqf b/addons/frag/initSettings.inc.sqf index 421d5d45664..c4730a3dd0c 100644 --- a/addons/frag/initSettings.inc.sqf +++ b/addons/frag/initSettings.inc.sqf @@ -8,13 +8,6 @@ private _category = format ["ACE %1", localize LSTRING(Module_DisplayName)]; 1 ] call CBA_fnc_addSetting; -[ - QGVAR(spallEnabled), "CHECKBOX", - [LSTRING(EnableSpall), LSTRING(EnableSpall_Desc)], - _category, - false, - 1 -] call CBA_fnc_addSetting; [ QGVAR(reflectionsEnabled), "CHECKBOX", [LSTRING(EnableReflections), LSTRING(EnableReflections_Desc)], @@ -24,17 +17,20 @@ private _category = format ["ACE %1", localize LSTRING(Module_DisplayName)]; ] call CBA_fnc_addSetting; [ - QGVAR(maxTrack), "SLIDER", - [LSTRING(MaxTrack), LSTRING(MaxTrack_Desc)], + QGVAR(spallEnabled), "CHECKBOX", + [LSTRING(EnableSpall), LSTRING(EnableSpall_Desc)], _category, - [0, 50, 10, -1], + false, 1 ] call CBA_fnc_addSetting; [ - QGVAR(maxTrackPerFrame), "SLIDER", - [LSTRING(MaxTrackPerFrame), LSTRING(MaxTrackPerFrame_Desc)], + QGVAR(spallIntensity), "SLIDER", + [LSTRING(SpallIntensity), LSTRING(SpallIntensity_Desc)], _category, - [0, 50, 10, -1], - 1 + [0.1, 2, 1, 1], + 1, + { + GVAR(shouldSpallCache) = createHashMap; + } ] call CBA_fnc_addSetting; diff --git a/addons/frag/initSettingsDebug.inc.sqf b/addons/frag/initSettingsDebug.inc.sqf new file mode 100644 index 00000000000..a1528a446cf --- /dev/null +++ b/addons/frag/initSettingsDebug.inc.sqf @@ -0,0 +1,25 @@ +private _category = format ["ACE %1", LLSTRING(Module_DisplayName)]; + +[ + QGVAR(debugOptions), + "CHECKBOX", + [LSTRING(EnableDebugTrace), LSTRING(EnableDebugTrace_Desc)], + [_category, LSTRING(Debug)], + true +] call CBA_fnc_addSetting; + +[ + QGVAR(dbgSphere), + "CHECKBOX", + [LSTRING(HitSphereEnable), LSTRING(HitSphereEnable_Desc)], + [_category, LSTRING(Debug)], + false +] call CBA_fnc_addSetting; + +[ + QGVAR(drawHitBox), + "CHECKBOX", + [LSTRING(DrawHitBox), LSTRING(DrawHitBox_Desc)], + [_category, LSTRING(Debug)], + true +] call CBA_fnc_addSetting; diff --git a/addons/frag/script_component.hpp b/addons/frag/script_component.hpp index 0215e9f4d74..bc69597a16b 100644 --- a/addons/frag/script_component.hpp +++ b/addons/frag/script_component.hpp @@ -2,13 +2,15 @@ #define COMPONENT_BEAUTIFIED Frag #include "\z\ace\addons\main\script_mod.hpp" -// #define DRAW_FRAG_INFO +// #define LOG_FRAG_INFO // #define DEBUG_MODE_FULL +// #define DEBUG_MODE_DRAW // #define DISABLE_COMPILE_CACHE // #define ENABLE_PERFORMANCE_COUNTERS #ifdef DEBUG_ENABLED_FRAG #define DEBUG_MODE_FULL + #define DEBUG_MODE_DRAW #endif #ifdef DEBUG_SETTINGS_FRAG @@ -17,4 +19,32 @@ #include "\z\ace\addons\main\script_macros.hpp" -#define ACE_TRACE_DRAW_INC 1 +#define GLUE(g1,g2) g1##g2 + +// Mimimum hold-off time between frag events per unit +#define ACE_FRAG_FRAG_UNIT_HOLDOFF 0.5 +#define ACE_FRAG_SPALL_UNIT_HOLDOFF 0.5 +// Scaling for the min/max # of fragments since last frag event +#define ACE_FRAG_COUNT_MIN_TIME 0.1 +#define ACE_FRAG_COUNT_MIN 5 +#define ACE_FRAG_COUNT_MAX_TIME 1.5 +#define ACE_FRAG_COUNT_MAX 50 +#define ACE_FRAG_IMPERIC_VELOCITY_CONSTANT 0.8 +#define ACE_FRAG_DEFAULT_FRAG_TYPES [\ + QGVAR(tiny), QGVAR(tiny), QGVAR(tiny),\ + QGVAR(tiny_HD), QGVAR(tiny_HD), QGVAR(tiny_HD),\ + QGVAR(small), QGVAR(small), QGVAR(small), QGVAR(small),\ + QGVAR(small_HD), QGVAR(small_HD), QGVAR(small_HD), QGVAR(small_HD),\ + QGVAR(medium_HD), QGVAR(medium_HD), QGVAR(medium_HD), QGVAR(medium_HD), QGVAR(medium_HD)\ +] + +// Spall values +#define ACE_FRAG_SPALL_HOLDOFF 0.2 +#define ACE_FRAG_SPALL_VELOCITY_INHERIT_COEFF 0.8 +// sqrt(2)/50 +#define ACE_FRAG_SPALL_CALIBER_COEF 0.02828427 +#define ACE_FRAG_SPALL_POWER_MIN 2 +#define ACE_FRAG_SPALL_POWER_TINY_MAX 5 +#define ACE_FRAG_SPALL_POWER_SMALL_MAX 8 +#define ACE_FRAG_SPALL_POWER_MEDIUM_MAX 11 +#define ACE_FRAG_SPALL_POWER_LARGE_MAX 15 diff --git a/addons/frag/stringtable.xml b/addons/frag/stringtable.xml index f88877448d8..4fa2d34412b 100644 --- a/addons/frag/stringtable.xml +++ b/addons/frag/stringtable.xml @@ -13,7 +13,7 @@ <Russian>Симуляция осколков</Russian> <Italian>Simulazione Frammentazione</Italian> <Japanese>破片シミュレーション</Japanese> - <Korean>파편화 시뮬레이션</Korean> + <Korean>파열 시뮬레이션</Korean> <Chinesesimp>破片模拟</Chinesesimp> <Chinese>模擬碎片</Chinese> </Key> @@ -28,8 +28,8 @@ <Hungarian>Repesz-szimuláció</Hungarian> <Russian>Симуляция осколков</Russian> <Italian>Simulazione Frammentazione</Italian> - <Japanese>破片シミュレーション</Japanese> - <Korean>파편화 시뮬레이션</Korean> + <Japanese>フラグメンテーション シミュレーション</Japanese> + <Korean>파열 시뮬레이션</Korean> <Chinesesimp>破片模拟</Chinesesimp> <Chinese>模擬碎片</Chinese> </Key> @@ -44,8 +44,8 @@ <Hungarian>Az ACE repesz-szimuláció engedélyezése</Hungarian> <Russian>Включить симуляцию осколков ACE</Russian> <Italian>Abilita la Simulazione Frammentazione di ACE</Italian> - <Japanese>ACE 破片シミュレーションを有効化</Japanese> - <Korean>ACE 파편화 시뮬레이션을 적용합니다.</Korean> + <Japanese>ACE フラグメンテーション シミュレーションを有効化</Japanese> + <Korean>ACE 파열 시뮬레이션을 적용합니다.</Korean> <Chinesesimp>启用 ACE 破片模拟</Chinesesimp> <Chinese>啟用ACE模擬碎片</Chinese> </Key> @@ -60,8 +60,8 @@ <Hungarian>Pattogzás-szimuláció</Hungarian> <Russian>Симуляция обломков</Russian> <Italian>Simulazione Spalling</Italian> - <Japanese>剥離シミュレーション</Japanese> - <Korean>탄환파편 시뮬레이션</Korean> + <Japanese>スポーリング シミュレーション</Japanese> + <Korean>파편 시뮬레이션</Korean> <Chinesesimp>模拟剥落</Chinesesimp> <Chinese>模擬剝落</Chinese> </Key> @@ -76,8 +76,8 @@ <Hungarian>Az ACE pattogzás-szimuláció engedélyezése</Hungarian> <Russian>Включить симуляцию обломков ACE</Russian> <Italian>Abilita la Simulazione Spalling di ACE</Italian> - <Japanese>ACE 剥離シミュレーションを有効化</Japanese> - <Korean>ACE 탄환파편 시뮬레이션을 적용합니다.</Korean> + <Japanese>ACE スポーリング シミュレーションを有効化</Japanese> + <Korean>ACE 파편 시뮬레이션을 적용합니다.</Korean> <Chinesesimp>启用 ACE 模拟剥落</Chinesesimp> <Chinese>啟用ACE模擬剝落</Chinese> </Key> @@ -90,7 +90,7 @@ <French>Simulation de la réflexion des explosions</French> <Portuguese>Simulação de reflexo de explosão</Portuguese> <Russian>Cимуляция отражения взрывов ACE</Russian> - <Japanese>爆発反射シミュレーション</Japanese> + <Japanese>爆風反射シミュレーション</Japanese> <Korean>폭발 반사 시뮬레이션</Korean> <Chinesesimp>模拟爆炸反射</Chinesesimp> <Chinese>模擬爆炸反射</Chinese> @@ -105,107 +105,77 @@ <French>Active la simulation de la réflexion des explosions ACE.</French> <Portuguese>Ativa a simulação de reflexo de explosão do ACE</Portuguese> <Russian>Включить симуляцию отражения взрывов ACE</Russian> - <Japanese>ACE 爆発反射シミュレーションを有効化</Japanese> + <Japanese>ACE 爆風反射シミュレーションを有効化</Japanese> <Korean>ACE 폭발 반사 시뮬레이션을 적용합니다.</Korean> <Chinesesimp>启用 ACE 模拟爆炸反射</Chinesesimp> <Chinese>啟用ACE模擬爆炸反射</Chinese> <Czech>Povolit ACE simulaci odrazu exploze</Czech> </Key> - <Key ID="STR_ACE_Frag_MaxTrack"> - <English>Maximum Projectiles Tracked</English> - <Spanish>Máximos proyectiles rastreados</Spanish> - <Polish>Maks. liczba śledzonych pocisków</Polish> - <German>Maximalzahl der verfolgten Projektile</German> - <Czech>Maximální počet sledovaných projektilů</Czech> - <Portuguese>Máximo de projéteis rastreados</Portuguese> - <French>Nombre maximum de projectiles suivis</French> - <Hungarian>Maximum követett repeszek</Hungarian> - <Russian>Макс. количество отслеживаемых снарядов</Russian> - <Italian>Numero massimo di Proiettili Tracciati</Italian> - <Japanese>飛翔体最大追跡数</Japanese> - <Korean>최대 발사체 추적수</Korean> - <Chinesesimp>最大破片粒子追踪数量</Chinesesimp> - <Chinese>最大碎片/剝落粒子追蹤數量</Chinese> - </Key> - <Key ID="STR_ACE_Frag_MaxTrack_Desc"> - <English>This setting controls the maximum amount of projectiles the fragmentation and spalling system will track at any given time. If more projectiles are fired, they will not be tracked. Lower this setting if you do not want FPS drops at high-count projectile scenarios ( >200 rounds in the air at once)</English> - <Spanish>Este ajuste controla la cantidad máxima de proyectiles del sistema de fragmentación y astillamiento de los que se hará un seguimiento en cualquier momento dado. Si se disparan más proyectiles, no serán rastreados. Baja esta opción si no deseas una bajada de FPS en escenarios con muchos proyectiles (>200 proyectiles en el aire a la vez)</Spanish> - <Polish>To ustawienie kontroluje maksymalną ilość pocisków, jakie fragmentacja i odpryski symulują w danym momencie. Jeżeli więcej pocisków będzie wystrzelonych, wtedy nie będą one śledzone. Zmniejsz tą opcję jeżeli nie chcesz odczuwać spadków FPS podczas ciężkiej wymiany ognia (więcej niż 200 pocisków w powietrzu na raz).</Polish> - <German>Diese Einstellung steuert die maximale Anzahl an Projektilen, die das Splitter- und Explosionssystem gleichzeitig verfolgen wird. Wenn mehr Projektile abgefeuert werden, werden sie nicht verfolgt werden. Diese Einstellung zu verringern, kann FPS-Einbrüche bei Szenarien mit vielen Projektilen verhindern (>200 Objekte gleichzeitig in der Luft)</German> - <Czech>Toto nastavení kontroluje maximální množství projektilů z fragmentace a úlomků, která jsou sledována v dané době. Pokud je vystřeleno více projektilů, tak nebudou sledovány. Snižte toto nastavení pokud si nepřejete propady FPS v situacích, kde je velké množství projektilů ( >200 nábojů najednou ve vzduchu)</Czech> - <Portuguese>Esta definição controla a quantidade máxima de projéteis que o sistema de fragmentação e estilhaçamento irá acompanhar em qualquer momento. Se mais projéteis são disparados, eles não serão rastreados. Diminua essa configuração se você não quiser que o FPS caia em cenários com alta contagem de projéteis (> 200 projéteis no ar ao mesmo tempo)</Portuguese> - <French>Ce paramètre contrôle le nombre maximum de projectiles et d'éclats résultant de la fragmentation, que le système peut suivre à chaque instant.\nSi plus de projectiles sont générés, ils ne seront pas pris en compte. Baissez ce réglage si vous ne voulez pas de chute de FPS en cas de nombre important de projectiles (>200 éclats en même temps).</French> - <Hungarian>Ez a beállítás szabályozza a repeszeződés és pattogzás által kilőtt objektumok követett számát. Ha több ez a szám, ezek az objektumok nem lesznek követve. Csökkentsd ezt a beállítást, ha nem akarsz lassulásokat magas-törmelékmennyiségű helyzetekben (200+ repesz a levegőben egyszerre)</Hungarian> - <Russian>Эта настройка контролирует максимальное количество снарядов, которок отслеживает система осколков и обломков в каждый момент времени. /nСнаряды, выстреленные сверх этого числа, отслеживаться не будут. Уменьшите это значение, если вы не хотите падения FPS при большом количестве снарядов в одной перестрелке (> 200 одновременно летящих снарядов)</Russian> - <Italian>Questo parametro controlla il numero massimo di proiettili che la frammentazione e il sistema di spalling tracciano in ogni momento. Se vengono sparati ulteriori proiettili, non verranno tracciati. Abbassa questo parametro se non vuoi cali di FPS in scenari con molti proiettili (>200 proiettili in aria contemporaneamente)</Italian> - <Japanese>この設定では、断片化および剥離システムが常に追跡する飛翔体の最大量を制御します。 この値より多くの飛翔体が発射された場合、それらは追跡されません。 弾数が多いシナリオでFPSを低下させたくない場合は、この設定を下げてください。 (一度に200発以上が空中に発射されます)</Japanese> - <Korean>이 설정은 탄환파편 및 파편 시스템으로 인해 생긴 발사체의 수를 결정합니다. 만약 더 많은 발사체가 나올 경우 정해진 수 이외에는 추적하지 않습니다. 이 설정을 낮춤으로써 파편이 많은 시나리오를 실행할때 더욱 원활히 진행할 수 있습니다 (한 번에 200개 이하)</Korean> - <Chinesesimp>设定在指定时间内,系统最大可追踪的破片粒子数量。如有更多的碎片在这之后产生,这些粒子将不会被追踪。如果你想要维持好的帧数,此设定勿调的过高。( >一次200颗粒子)</Chinesesimp> - <Chinese>設定在指定時間內,系統最大可追蹤的碎片/剝落粒子數量。如有更多的碎片在這之後產生,這些粒子將不會被追蹤。如果你想要維持好的幀數,此設定勿調的過高。( >一次200顆粒子)</Chinese> - </Key> - <Key ID="STR_ACE_Frag_MaxTrackPerFrame"> - <English>Maximum Projectiles Per Frame</English> - <Spanish>Máximos proyectiles por cuadro</Spanish> - <German>Maximale Anzahl an Projektilen pro Frame</German> - <Polish>Maks. liczba pocisków na klatkę</Polish> - <Czech>Maximální počet projektilů za jeden snímek</Czech> - <Portuguese>Projéteis máximos por quadro</Portuguese> - <French>Nombre maximal de projectiles par image</French> - <Hungarian>Maximum repesz/képkocka</Hungarian> - <Russian>Макс. количество снарядов за кадр</Russian> - <Italian>Numero massimo di proiettili per Frame</Italian> - <Japanese>フレームごとの飛翔体最大数</Japanese> - <Korean>프레임 당 최대 발사체 수</Korean> - <Chinesesimp>每帧最大破片粒子数量</Chinesesimp> - <Chinese>每一幀數(FPS)最大碎片/剝落粒子數量</Chinese> - </Key> - <Key ID="STR_ACE_Frag_MaxTrackPerFrame_Desc"> - <English>The number of spall track calculations to perform in any given frame. This helps spread the FPS impact of tracking spall rounds across multiple frames, limiting its impact even further.</English> - <Polish>Ilość obliczeń wykonywanych przez symulację odprysków w danej klatce. Ta opcja pomaga rozprzestrzenić obliczenia odprysków na więcej klatek, zmniejszając spadek FPS jeszcze bardziej.</Polish> - <German>Gibt die Anzahl der Explosionverfolgungsberechnungen an, die gleichzeitig ausgeführt werden. Das kann dabei helfen den FPS-Einfluss abzuschwächen, wenn Teile über mehrere Frames hinweg verfolgt werden.</German> - <Spanish>El número de cálculos de esquirlas que se hará en cualquier cuadro. Esto ayuda a dispersar el impacto en FPS del seguimiento de esquirlas de balas a través de múltiples cuadros, lo que limita aún más su impacto.</Spanish> - <Czech>Počet úlomků v daném snímku. Toto pomáhá rozšířit FPS dopad sledovaného úlomku napříč více snímky, omezuje jeho vliv ještě více.</Czech> - <Portuguese>O número de cálculos por estilhaço rastreado para executar em qualquer quadro. Isso ajuda a distribuir o impacto no FPS do rastreamento de estilhaço em vários quadros, o que limita o seu impacto ainda mais.</Portuguese> - <French>Le nombre de calculs de suivi à effectuer pour chaque image. Cela aide à répartir l'impact des calculs sur plusieurs images, limitant ainsi encore davantage l'impact sur les FPS.</French> - <Hungarian>A lepattogzási útvonalak számításának darabjai képkockánként. Ez eloszlatja az FPS-megszakadást több képkockára, ezzel csökkentve a súlyosságát.</Hungarian> - <Russian>Число обрабатываемых осколков за кадр. Это позволяет распределить нагрузку по отслеживанию осколков между несколькими кадрами, чтобы предотвратить падение FPS.</Russian> - <Italian>Il numero di calcoli per tracciamento di spalling ad ogni frame. Questo aiuta a distribuire l'impatto del tracciamento dello spalling su più frame, riducendolo ulteriormente.</Italian> - <Japanese>任意のフレームごとに追跡される剥離飛翔体の数。剥離による飛翔体を追跡することによるFPSへの影響を複数フレームに分散させ抑えることが出来ます。</Japanese> - <Korean>가능한 프레임마다 파편을 추적 및 계산합니다. 여러 프레임에 걸쳐 파편난 발사체를 추적하여 FPS에 도움을 줍니다. 이를 제한함으로써 더욱 큰 효과를 볼 수 있습니다.</Korean> - <Chinesesimp>设定在每一帧数内,系统最大可追踪的破片粒子数量。此设定可有效帮助系统减低计算压力。</Chinesesimp> - <Chinese>設定在每一幀數內,系統最大可追蹤的碎片/剝落粒子數量。此設定可有效幫助系統減低計算壓力</Chinese> + <Key ID="STR_ACE_Frag_Debug"> + <English>Debug</English> + <Korean>디버그</Korean> + <Japanese>デバッグ</Japanese> + <Russian>Отладка</Russian> + <Italian>Debug</Italian> + </Key> + <Key ID="STR_ACE_Frag_SpallIntensity"> + <English>Spalling Intensity</English> + <Korean>파편 강도</Korean> + <Japanese>スポーリング強度</Japanese> + <Russian>Интенсивность обрушения</Russian> + <Italian>Intensità dello spalling</Italian> + </Key> + <Key ID="STR_ACE_Frag_SpallIntensity_Desc"> + <English>Modifier to increase or decrease the number and intensity of spalling events. Increasing this value may cause performance degradation.</English> + <Korean>파편 이벤트 수와 강도를 늘리거나 줄입니다. 이 값을 늘리면 성능이 저하될 수 있습니다.</Korean> + <Japanese>スポーリング現象が発生する数と強度を増減することが出来ます。この値を大きくすることはパフォーマンスの低下につながる可能性があります。</Japanese> + <Russian>Модификатор для увеличения или уменьшения количества и интенсивности событий обрушения. Увеличение этого значения может привести к ухудшению производительности.</Russian> + <Italian>Modificatore per il numero e intensità di spalling simulato, ovvero la frammentazione interna ad un veicolo colpito. Valori alti possono causare una degradazione della performance.</Italian> </Key> <Key ID="STR_ACE_Frag_EnableDebugTrace"> - <English>(SP Only) Frag/Spall Debug Tracing</English> - <Spanish>(Solo SP) Seguimiento de depuración de Fragmentación/Astillamiento </Spanish> - <Polish>(Tylko SP) Wizualny debug odł./odpr.</Polish> - <Czech>(Pouze SP) Debug sledování Frag/Úlomků</Czech> - <German>(nur SP) Splitter-/Explosions-Debug-Verfolgung</German> - <Portuguese>(Somente SP) Depuração de fragmentação e estilhaços traçantes</Portuguese> - <French>(SP uniquement) Fragmentation/éclat debug</French> - <Hungarian>(Csak SP) Repesz/Pattogzás debug követés</Hungarian> - <Russian>(Только для одиночной игры) Отслеживаение/отладка осколков</Russian> - <Italian>(Solo SP) Debug Tracciamento Frag/Spall</Italian> - <Japanese>(SP のみ) 破片/剥離のデバッグ用表示</Japanese> - <Korean>(싱글플레이 전용) 탄환파편/파편 디버그 추적화</Korean> - <Chinesesimp>(仅单人)追踪显示破片粒子</Chinesesimp> - <Chinese>(僅在單人模式) 碎片/剝落除錯追蹤</Chinese> + <English>Frag/Spall Debug Tracing</English> + <German>Splitter-/Explosions-Debug-Verfolgung</German> + <Japanese>フラグとスポールの追跡デバッグ</Japanese> + <Korean>파열/파편 디버그 추적</Korean> + <Russian>Отладка трассировки фрагментации/осколков</Russian> + <Italian>Traccia Frag/Spall per Debug</Italian> </Key> <Key ID="STR_ACE_Frag_EnableDebugTrace_Desc"> - <English>(SP Only) Requires a mission/editor restart. Enables visual tracing of fragmentation and spalling rounds in SP game mode only.</English> - <Spanish>(Solo SP) Requiere un reinicio misión/editor. Permite el seguimiento visual de la fragmentación y astillamientos de los proyectiles en modo SP.</Spanish> - <Polish>(Tylko SP) Wymaga restartu misji/edytora. Aktywuje wizualne śledzenie odłamków oraz odprysków w trybie gry Single Player.</Polish> - <German>(nur SP) Splitter-/Explosions-Debugging</German> - <Czech>(Pouze SP) Vyžaduje restart mise/editoru. Aktivuje vizuální stopování fragmentace a úlomů pouze v režimu jednoho hráče.</Czech> - <Portuguese>(Somente SP) Requer um reinício de missão / editor. Habilita o rastreamento visual de projéteis de fragmentação e estilhaçamento apenas no modo de jogo SP.</Portuguese> - <French>(SP seulement) Requiert un redémarrage de mission ou de l'éditeur. Active les traceurs visuels de fragmentation et d'éclats en mode solo seulement.</French> - <Hungarian>(Csak SP) Küldetés/Editor újraindítás szükséges. Engedélyezi a repeszek és pattogzó lövedékek vizuális nyomkövetését, csak egyjátékos módok alatt.</Hungarian> - <Russian>(Только для одиночной игры) Требует перезапуска миссии/редактора. Включает визуальные следы от осколков и обломков в режиме одиночной игры.</Russian> - <Italian>(Solo SP) Richiede un restart editor/missione. Abilita il tracciamento visivo di schegge da frammentazione/spalling in modalità Giocatore Singolo.</Italian> - <Japanese>(SP のみ) ミッションとエディタの再起動が必要です。有効化すると、シングルプレイでのみ破片と剥離の飛翔体が見えるようになります。</Japanese> - <Chinesesimp>(仅单人)激活后,只有在单人模式下才可观察到破片粒子的移动轨迹。</Chinesesimp> - <Chinese>(僅在單人模式) 讓你在單人模式下可觀察到碎片/剝落粒子的移動軌跡</Chinese> - <Korean>(SP 전용) 임무 / 편집자가 다시 시작해야합니다. SP 게임 모드에서만 파편화 및 탄환파편의 시각적 추적을 가능하게 합니다.</Korean> + <English>Enables visual tracing of fragmentation and spalling rounds.</English> + <German>Splitter-/Explosions-Debugging</German> + <Korean>파열과 파편의 시각적 추적을 활성화합니다.</Korean> + <Japanese>フラグメンテーションとスポーリングによって発生した破片飛翔体の動きを視覚的に追跡できる機能を有効化します。</Japanese> + <Russian>Включает визуальную трассировку фрагментации и осколочных снарядов.</Russian> + <Italian>Abilita il tracciamento visivo di effetti di frammentazione e spalling.</Italian> + </Key> + <Key ID="STR_ACE_Frag_HitSphereEnable"> + <English>Draw Event Spheres</English> + <Korean>이벤트 구체 그리기</Korean> + <Japanese>イベントを球体として描画</Japanese> + <Russian>Изобразить сферы событий</Russian> + <Italian>Visualizza sfere eventi</Italian> + </Key> + <Key ID="STR_ACE_Frag_HitSphereEnable_Desc"> + <English>Draw color coded spheres at any event for tracked rounds.</English> + <Korean>모든 이벤트에서 추적된 파편을 위한 색상으로 구분하는 구체를 그립니다.</Korean> + <Japanese>追跡中の飛翔体に発生した全てのイベントを色付けた球体として描画します。</Japanese> + <Russian>Изобразить цветные сферы на любом событии для отслеживаемых раундов.</Russian> + <Italian>Visualizza sfere colorate su ogni evento di un frammento tracciato.</Italian> + </Key> + <Key ID="STR_ACE_Frag_DrawHitBox"> + <English>Draw Hitboxes</English> + <Korean>히트박스 그리기</Korean> + <Japanese>ヒットボックスを描画</Japanese> + <Russian>Изобразить хитбоксы</Russian> + <Italian>Visualizza hitbox</Italian> + </Key> + <Key ID="STR_ACE_Frag_DrawHitBox_Desc"> + <English>Draw hitboxes on objects that were targeted.</English> + <German>Splitter-/Explosions-Debugging</German> + <Japanese>被弾した物体のヒットボックスを描画します。</Japanese> + <Korean>타겟팅된 오브젝트에 히트박스를 그립니다.</Korean> + <Russian>Изобразить хитбоксы на объектах, которые были нацелены.</Russian> + <Italian>Visualizza hitbox su potenziali bersagli della frammentazione.</Italian> </Key> </Package> </Project> diff --git a/addons/goggles/define.hpp b/addons/goggles/define.hpp index 81d3fcb6896..4e641b692c4 100644 --- a/addons/goggles/define.hpp +++ b/addons/goggles/define.hpp @@ -18,8 +18,8 @@ class RscPicture { fixedWidth = 0; shadow = 0; text = ""; - x = "safezoneX"; - y = "safezoneY"; - w = "safezoneW"; - h = "safezoneH"; + x = "safeZoneX"; + y = "safeZoneY"; + w = "safeZoneW"; + h = "safeZoneH"; }; diff --git a/addons/goggles/functions/fnc_applyDirtEffect.sqf b/addons/goggles/functions/fnc_applyDirtEffect.sqf index 38fc57f0ce6..a246f1293fc 100644 --- a/addons/goggles/functions/fnc_applyDirtEffect.sqf +++ b/addons/goggles/functions/fnc_applyDirtEffect.sqf @@ -33,6 +33,7 @@ if ([_unit] call FUNC(isGogglesVisible)) then { private _effectBrightness = linearConversion [0,1,([] call EFUNC(common,ambientBrightness)),0.25,1]; (GETUVAR(GVAR(DisplayEffects),displayNull) displayCtrl 10660) ctrlSetTextColor [_effectBrightness, _effectBrightness, _effectBrightness, 1]; + [QGVAR(effect), [_unit, "dirt"]] call CBA_fnc_localEvent; TRACE_1("dirt",_effectBrightness); }; }; diff --git a/addons/goggles/functions/fnc_applyDustEffect.sqf b/addons/goggles/functions/fnc_applyDustEffect.sqf index 93bcbad1d6b..c00754c4eaa 100644 --- a/addons/goggles/functions/fnc_applyDustEffect.sqf +++ b/addons/goggles/functions/fnc_applyDustEffect.sqf @@ -57,7 +57,7 @@ GVAR(DustHandler) = [{ private _amount = 1 - (GETDUSTT(DAMOUNT) * 0.125); - if !(_unit getVariable ["ACE_EyesDamaged", false]) then { + if !(ACE_player getVariable ["ACE_EyesDamaged", false]) then { GVAR(PostProcessEyes) ppEffectAdjust [1, 1, 0, [0, 0, 0, 0], [_amount, _amount, _amount, _amount], [1, 1, 1, 0]]; GVAR(PostProcessEyes) ppEffectCommit 0.5; }; @@ -68,6 +68,7 @@ GVAR(DustHandler) = [{ GVAR(PostProcessEyes) ppEffectAdjust [1, 1, 0, [0, 0, 0, 0], [1, 1, 1, 1], [1, 1, 1, 0]]; GVAR(PostProcessEyes) ppEffectCommit 2; + [QGVAR(effect), [ACE_player, "dust"]] call CBA_fnc_localEvent; [{ if (GVAR(DustHandler) == -1) then { diff --git a/addons/goggles/functions/fnc_applyRainEffect.sqf b/addons/goggles/functions/fnc_applyRainEffect.sqf index 0058209acd6..bf1d6fd04aa 100644 --- a/addons/goggles/functions/fnc_applyRainEffect.sqf +++ b/addons/goggles/functions/fnc_applyRainEffect.sqf @@ -52,6 +52,7 @@ if (GVAR(RainLastLevel) != rain) then { GVAR(RainDrops) setParticleClass "ACERainEffect"; GVAR(RainDrops) setDropInterval (0.07 * (1.1 - GVAR(RainLastLevel))); GVAR(RainDrops) attachTo [vehicle _unit, [0,0,0]]; + [QGVAR(effect), [_unit, "rain"]] call CBA_fnc_localEvent; }; } else { if (GVAR(RainLastLevel) > 0.05) then { diff --git a/addons/goggles/functions/fnc_applyRotorWashEffect.sqf b/addons/goggles/functions/fnc_applyRotorWashEffect.sqf index 85b7e60934d..b2369d15107 100644 --- a/addons/goggles/functions/fnc_applyRotorWashEffect.sqf +++ b/addons/goggles/functions/fnc_applyRotorWashEffect.sqf @@ -64,18 +64,18 @@ if !(_safe) then { if !([_unit] call FUNC(isGogglesVisible)) exitWith {}; if (GETDUSTT(DAMOUNT) < 2) then { - if !(GETDUSTT(DACTIVE)) then { - SETDUST(DACTIVE,true); - - call FUNC(applyDustEffect); - } else { + if (GETDUSTT(DACTIVE)) then { if (_rotorWash select 1 > 0.5) then { call FUNC(applyDustEffect); }; + } else { + SETDUST(DACTIVE,true); + + call FUNC(applyDustEffect); }; }; - _safe = getNumber (ConfigFile >> "CfgGlasses" >> goggles _unit >> "ACE_Protection") == 1; + _safe = getNumber (configFile >> "CfgGlasses" >> goggles _unit >> "ACE_Protection") == 1; }; // quit if protected by goggles or helmet @@ -101,5 +101,6 @@ if (_rotorWash select 1 > 0) then { GVAR(PostProcessEyes) ppEffectAdjust [1, 1, 0, [0, 0, 0, 0], [_scale, _scale, _scale, _scale], [1, 1, 1, 0]]; GVAR(PostProcessEyes) ppEffectCommit 0.5; GVAR(PostProcessEyes) ppEffectEnable true; + [QGVAR(effect), [_unit, "rotorWash"]] call CBA_fnc_localEvent; }; }; diff --git a/addons/grenades/functions/fnc_flashbangExplosionEH.sqf b/addons/grenades/functions/fnc_flashbangExplosionEH.sqf index 33c4bdffc21..a1be243b4fa 100644 --- a/addons/grenades/functions/fnc_flashbangExplosionEH.sqf +++ b/addons/grenades/functions/fnc_flashbangExplosionEH.sqf @@ -20,7 +20,7 @@ TRACE_1("params",_grenadePosASL); // Affect local AI (players are not local, except for ACE_player) // @todo: Affect units in static weapons, turned out, etc -private _affected = ((ASLtoAGL _grenadePosASL) nearEntities ["CAManBase", 20]) - [ACE_player]; +private _affected = ((ASLToAGL _grenadePosASL) nearEntities ["CAManBase", 20]) - [ACE_player]; { private _unit = _x; @@ -69,7 +69,7 @@ private _affected = ((ASLtoAGL _grenadePosASL) nearEntities ["CAManBase", 20]) - if (!hasInterface) exitWith {}; // Create flash to illuminate environment -private _light = "#lightpoint" createVehicleLocal ASLtoAGL _grenadePosASL; +private _light = "#lightpoint" createVehicleLocal ASLToAGL _grenadePosASL; _light setPosASL _grenadePosASL; _light setLightBrightness 20; @@ -113,7 +113,7 @@ if (["ace_hearing"] call EFUNC(common,isModLoaded) && {_strength > 0} && {EGVAR( }; // Add ace_medical pain effect -if (GETEGVAR(medical,enabled,false) && {_strength > 0.1} && {isDamageAllowed _unit} && {_unit getVariable [QEGVAR(medical,allowDamage), true]}) then { +if (GETEGVAR(medical,enabled,false) && {_strength > 0.1} && {isDamageAllowed ACE_player} && {ACE_player getVariable [QEGVAR(medical,allowDamage), true]}) then { [ACE_player, _strength / 2] call EFUNC(medical,adjustPainLevel); }; @@ -122,7 +122,7 @@ _strength = 1 - (((_eyePos vectorDistance _grenadePosASL) min 25) / 25) ^ 0.4; _strength = _strength * _losCoefficient; // Account for people looking away by slightly reducing the effect for visual effects. -private _eyeDir = ((AGLtoASL positionCameraToWorld [0, 0, 1]) vectorDiff (AGLtoASL positionCameraToWorld [0, 0, 0])); +private _eyeDir = ((AGLToASL positionCameraToWorld [0, 0, 1]) vectorDiff (AGLToASL positionCameraToWorld [0, 0, 0])); private _dirToUnitVector = _eyePos vectorFromTo _grenadePosASL; private _angleDiff = acos (_eyeDir vectorDotProduct _dirToUnitVector); TRACE_2("",_angleDiff,((1 - (_angleDiff - 45) / (120 - 45)) max 0)); diff --git a/addons/grenades/functions/fnc_incendiary.sqf b/addons/grenades/functions/fnc_incendiary.sqf index f0caf82ed8e..9d416c5e115 100644 --- a/addons/grenades/functions/fnc_incendiary.sqf +++ b/addons/grenades/functions/fnc_incendiary.sqf @@ -202,7 +202,7 @@ if (isServer) then { {EGVAR(cookoff,ammoCookoffDuration) != 0} && {_x getVariable [QEGVAR(cookoff,enableAmmoCookoff), true]} ) then { - [QEGVAR(cookOff,cookOffBoxServer), _box] call CBA_fnc_serverEvent; + [QEGVAR(cookOff,cookOffBoxServer), _x] call CBA_fnc_serverEvent; } else { _x setDamage 1; }; diff --git a/addons/grenades/stringtable.xml b/addons/grenades/stringtable.xml index b0630e3a437..1a6243464fa 100644 --- a/addons/grenades/stringtable.xml +++ b/addons/grenades/stringtable.xml @@ -110,6 +110,7 @@ <Korean>이 수류탄은 굴릴 수 없습니다. %1(으)로 전환되었습니다.</Korean> <German>Granate kann nicht rollen, zu %1 gewechselt</German> <Italian>Granata non può rotolare, cambiato a %1</Italian> + <French>Grenade ne peut pas rouler, passé à %1</French> </Key> <Key ID="STR_ACE_Grenades_M84_Name"> <English>M84 Stun Grenade</English> diff --git a/addons/gunbag/functions/fnc_calculateMass.sqf b/addons/gunbag/functions/fnc_calculateMass.sqf index 6dd6a5a660d..b614d95f587 100644 --- a/addons/gunbag/functions/fnc_calculateMass.sqf +++ b/addons/gunbag/functions/fnc_calculateMass.sqf @@ -23,7 +23,7 @@ private _mass = getNumber (configFile >> "CfgWeapons" >> _weapon >> "WeaponSlots { _mass = _mass + getNumber (configFile >> "CfgWeapons" >> _x >> "ItemInfo" >> "mass"); -} foreach _items; +} forEach _items; { _mass = _mass + getNumber (configFile >> "CfgMagazines" >> _x >> "mass"); diff --git a/addons/headless/functions/fnc_transferGroups.sqf b/addons/headless/functions/fnc_transferGroups.sqf index 0efbe263652..920470c335f 100644 --- a/addons/headless/functions/fnc_transferGroups.sqf +++ b/addons/headless/functions/fnc_transferGroups.sqf @@ -74,13 +74,9 @@ private _numTransferredHC1 = 0; private _numTransferredHC2 = 0; private _numTransferredHC3 = 0; -private _units = []; -private _transfer = false; -private _previousOwner = -1; - // Transfer AI groups { - _units = units _x; + private _units = units _x; // No transfer if empty group or if group is blacklisted if (_units isEqualTo [] || {_x getVariable [QXGVAR(blacklist), false]}) then { @@ -92,6 +88,8 @@ private _previousOwner = -1; continue; }; + private _transfer = true; + { // No transfer if already transferred if (!_force && {(owner _x) in [_idHC1, _idHC2, _idHC3]}) exitWith { @@ -126,7 +124,7 @@ private _previousOwner = -1; }; // Round robin between HCs if load balance enabled, else pass all to one HC - _previousOwner = groupOwner _x; + private _previousOwner = groupOwner _x; switch (_currentHC) do { case 1: { @@ -145,11 +143,13 @@ private _previousOwner = -1; // Don't transfer if it's already local to HC1 if (_previousOwner == _idHC1) exitWith {}; - [QGVAR(groupTransferPre), [_x, _HC1, _previousOwner, _idHC1], [_previousOwner, _idHC1]] call CBA_fnc_targetEvent; // API + [QGVAR(groupTransferPre), [_x, _HC1, _previousOwner, _idHC1], _previousOwner] call CBA_fnc_ownerEvent; // API + [QGVAR(groupTransferPre), [_x, _HC1, _previousOwner, _idHC1], _idHC1] call CBA_fnc_ownerEvent; // API private _transferred = _x setGroupOwner _idHC1; - [QGVAR(groupTransferPost), [_x, _HC1, _previousOwner, _idHC1, _transferred], [_previousOwner, _idHC1]] call CBA_fnc_targetEvent; // API + [QGVAR(groupTransferPost), [_x, _HC1, _previousOwner, _idHC1, _transferred], _previousOwner] call CBA_fnc_ownerEvent; // API + [QGVAR(groupTransferPost), [_x, _HC1, _previousOwner, _idHC1, _transferred], _idHC1] call CBA_fnc_ownerEvent; // API if (_transferred) then { _numTransferredHC1 = _numTransferredHC1 + 1; @@ -171,11 +171,13 @@ private _previousOwner = -1; // Don't transfer if it's already local to HC2 if (_previousOwner == _idHC2) exitWith {}; - [QGVAR(groupTransferPre), [_x, _HC2, _previousOwner, _idHC2], [_previousOwner, _idHC2]] call CBA_fnc_targetEvent; // API + [QGVAR(groupTransferPre), [_x, _HC2, _previousOwner, _idHC2], _previousOwner] call CBA_fnc_ownerEvent; // API + [QGVAR(groupTransferPre), [_x, _HC2, _previousOwner, _idHC2], _idHC2] call CBA_fnc_ownerEvent; // API private _transferred = _x setGroupOwner _idHC2; - [QGVAR(groupTransferPost), [_x, _HC2, _previousOwner, _idHC2, _transferred], [_previousOwner, _idHC2]] call CBA_fnc_targetEvent; // API + [QGVAR(groupTransferPost), [_x, _HC2, _previousOwner, _idHC2, _transferred], _previousOwner] call CBA_fnc_ownerEvent; // API + [QGVAR(groupTransferPost), [_x, _HC2, _previousOwner, _idHC2, _transferred], _idHC2] call CBA_fnc_ownerEvent; // API if (_transferred) then { _numTransferredHC2 = _numTransferredHC2 + 1; @@ -197,11 +199,13 @@ private _previousOwner = -1; // Don't transfer if it's already local to HC3 if (_previousOwner == _idHC3) exitWith {}; - [QGVAR(groupTransferPre), [_x, _HC3, _previousOwner, _idHC3], [_previousOwner, _idHC3]] call CBA_fnc_targetEvent; // API + [QGVAR(groupTransferPre), [_x, _HC3, _previousOwner, _idHC3], _previousOwner] call CBA_fnc_ownerEvent; // API + [QGVAR(groupTransferPre), [_x, _HC3, _previousOwner, _idHC3], _idHC3] call CBA_fnc_ownerEvent; // API private _transferred = _x setGroupOwner _idHC2; - [QGVAR(groupTransferPost), [_x, _HC3, _previousOwner, _idHC3, _transferred], [_previousOwner, _idHC3]] call CBA_fnc_targetEvent; // API + [QGVAR(groupTransferPost), [_x, _HC3, _previousOwner, _idHC3, _transferred], _previousOwner] call CBA_fnc_ownerEvent; // API + [QGVAR(groupTransferPost), [_x, _HC3, _previousOwner, _idHC3, _transferred], _idHC3] call CBA_fnc_ownerEvent; // API if (_transferred) then { _numTransferredHC3 = _numTransferredHC3 + 1; diff --git a/addons/headless/stringtable.xml b/addons/headless/stringtable.xml index 35dcb118620..063f72d1404 100644 --- a/addons/headless/stringtable.xml +++ b/addons/headless/stringtable.xml @@ -88,7 +88,7 @@ <Key ID="STR_ACE_Headless_EndMissionDesc"> <English>End mission when there are no players connected (same as 'persistent = 0' in server configuration but with Headless Client support).</English> <German>Beende die Mission, wenn keine Spieler mehr verbunden sind (das gleiche wie 'persitent = 0' in den Serverkonfigurationen aber mit Headless Client Unterstützung).</German> - <Korean>연결된 플레이어가 없을 때 임무 종료. (서버 구성에서는 'persistent = 0'과 같지만 Headless Client는 지원함)</Korean> + <Korean>연결된 플레이어가 없으면 미션을 종료합니다(서버 설정의 'persistent = 0'과 같지만 헤드리스 클라이언트는 지원합니다).</Korean> <Japanese>プレイヤーが接続していない場合はミッション終了します。(サーバ設定の'presistent =0'と同じですが、ヘッドレスクライアントをサポートします)</Japanese> <French>Termine la mission lorsqu'il n'y a plus de joueur connecté (idem que 'persistent = 0' dans la config serveur mais avec la gestion du Headless Client).</French> <Chinesesimp>当服务器里没有任何玩家还连线时自动结束任务(效果同于伺服器设定的'persistent = 0',但支援 Headless 客户端)。</Chinesesimp> @@ -145,7 +145,7 @@ <English>Log transfer statistics and Headless Client (dis)connections to RPT. (Default: No)</English> <German>Zeichnet Transferstatistiken, Verbindungen und Verbindungsabbrüche in einer RPT-Datei auf. (Standard: Nein)</German> <Polish>Zapisz statystyki transferu i status połączenia Headless Clienta do RPT. (Domyślnie: Tak)</Polish> - <Korean>전송 통계 및 헤드리스 클라이언트 연결(해제)를 RPT파일에 로그함. (기본값: No)</Korean> + <Korean>전송 통계 및 헤드리스 클라이언트 연결(해제)를 RPT파일에 기록합니다. (기본값: No)</Korean> <Japanese>統計とヘッドレスクライアントの接続有無を PRT へ記録します。 (デフォルト: 無効)</Japanese> <French>Archive les statistiques de transfert et de (dé)connections du Headless Client dans le RPT. (Défaut: Non)</French> <Chinesesimp>记录 Headless 客户端间的转换数量与连线/断线等记录到 RPT 报告档中。(预设:关闭)</Chinesesimp> diff --git a/addons/hearing/XEH_PREP.hpp b/addons/hearing/XEH_PREP.hpp index a2bcbb708a4..64161300d3e 100644 --- a/addons/hearing/XEH_PREP.hpp +++ b/addons/hearing/XEH_PREP.hpp @@ -1,6 +1,6 @@ PREP(addEarPlugs); PREP(earRinging); -PREP(explosionNear); +PREP(explosion); PREP(firedNear); PREP(getAmmoLoudness); PREP(handleRespawn); diff --git a/addons/hearing/XEH_postInit.sqf b/addons/hearing/XEH_postInit.sqf index 4261933bd92..f9fb2043334 100644 --- a/addons/hearing/XEH_postInit.sqf +++ b/addons/hearing/XEH_postInit.sqf @@ -11,6 +11,26 @@ if (isServer) then { }] call CBA_fnc_addEventHandler; }; +["CBA_settingsInitialized", { + TRACE_1("settingInit - common",GVAR(enableCombatDeafness)); + // Only install event handler if combat deafness is enabled + if (!GVAR(enableCombatDeafness)) exitWith {}; + + [{ // Convert ace_common's local explosion to a hearing global explosion event + params ["_projectile", "_pos"]; + TRACE_1("Explode",_this); + + // If projectile is local only, don't raise event globally + // TODO: netId always returns valid after 2.18 + // use _projectile getShotInfo 5 (https://community.bistudio.com/wiki/getShotInfo) + if (isMultiplayer && {(netId _projectile) == "0:0"}) then { + [QGVAR(explosion), [_projectile, _pos]] call CBA_fnc_localEvent; + } else { + [QGVAR(explosion), [_projectile, _pos]] call CBA_fnc_globalEvent; + }; + }] call EFUNC(common,addExplosionEventHandler); +}] call CBA_fnc_addEventHandler; + if (!hasInterface) exitWith {}; #include "initKeybinds.inc.sqf" @@ -27,7 +47,7 @@ GVAR(volumeAttenuation) = 1; GVAR(lastPlayerVehicle) = objNull; ["CBA_settingsInitialized", { - TRACE_1("settingInit",GVAR(enableCombatDeafness)); + TRACE_1("settingInit - client",GVAR(enableCombatDeafness)); // Only run PFEH and install event handlers if combat deafness is enabled if (!GVAR(enableCombatDeafness)) exitWith {}; @@ -35,6 +55,7 @@ GVAR(lastPlayerVehicle) = objNull; // Spawn volume updating process [LINKFUNC(updateVolume), 1, false] call CBA_fnc_addPerFrameHandler; + [QGVAR(explosion), LINKFUNC(explosion)] call CBA_fnc_addEventHandler; [QGVAR(updateVolume), LINKFUNC(updateVolume)] call CBA_fnc_addEventHandler; // Update veh attunation when player veh changes @@ -71,12 +92,7 @@ GVAR(lastPlayerVehicle) = objNull; private _firedEH = _oldPlayer getVariable [QGVAR(firedEH), -1]; _oldPlayer removeEventHandler ["FiredNear", _firedEH]; _oldPlayer setVariable [QGVAR(firedEH), nil]; - - private _explosionEH = _oldPlayer getVariable [QGVAR(explosionEH), -1]; - _oldPlayer removeEventHandler ["Explosion", _explosionEH]; - _oldPlayer setVariable [QGVAR(explosionEH), nil]; - - TRACE_3("removed unit eh",_oldPlayer,_firedEH,_explosionEH); + TRACE_2("removed unit eh",_oldPlayer,_firedEH); }; // Don't add a new EH if the unit respawned if ((_player getVariable [QGVAR(firedEH), -1]) == -1) then { @@ -86,11 +102,7 @@ GVAR(lastPlayerVehicle) = objNull; private _firedEH = _player addEventHandler ["FiredNear", {call FUNC(firedNear)}]; _player setVariable [QGVAR(firedEH), _firedEH]; - - private _explosionEH = _player addEventHandler ["Explosion", {call FUNC(explosionNear)}]; - _player setVariable [QGVAR(explosionEH), _explosionEH]; - - TRACE_3("added unit eh",_player,_firedEH,_explosionEH); + TRACE_2("added unit eh",_player,_firedEH); }; GVAR(deafnessDV) = 0; diff --git a/addons/hearing/functions/fnc_explosion.sqf b/addons/hearing/functions/fnc_explosion.sqf new file mode 100644 index 00000000000..f0a1ee6aab1 --- /dev/null +++ b/addons/hearing/functions/fnc_explosion.sqf @@ -0,0 +1,56 @@ +#include "..\script_component.hpp" +/* + * Author: johnb43 + * Handles deafness due to explosions going off near the player. + * + * Arguments: + * 0: Projectile <OBJECT> + * 1: Explosion position ASL <ARRAY> + * + * Return Value: + * None + * + * Example: + * [_projectile, [0, 0, 0]] call ace_hearing_fnc_explosion + * + * Public: No + */ + +// Ignore spectators, curators and alike +if ((getNumber (configOf ACE_player >> "isPlayableLogic")) == 1) exitWith {}; + +params ["_projectile", "_pos"]; + +// Don't allow for distances under 1 +private _distance = ((eyePos ACE_player) vectorDistance _pos) max 1; + +// Fast exit if explosion far away +if (_distance > 100) exitWith { + TRACE_1("too far away",_distance); +}; + +private _ammoConfig = configOf _projectile; +private _hit = getNumber (_ammoConfig >> "hit"); +if (_hit < 0.5) exitWith { TRACE_1("ignore smoke/flare",_hit) }; +private _explosive = getNumber (_ammoConfig >> "explosive"); + +private _vehAttenuation = [GVAR(playerVehAttenuation), 1] select (isNull objectParent ACE_player || {isTurnedOut ACE_player}); + +TRACE_4("",typeOf _projectile,_distance,_explosive,_vehAttenuation); + +(if (isArray (_ammoConfig >> "soundHit1")) then { + getArray (_ammoConfig >> "soundHit1") +} else { + getArray (_ammoConfig >> "soundHit") +}) params ["", ["_volume", 1], "", ["_maxDistance", 1500]]; + +if (_distance > _maxDistance) exitWith { + TRACE_2("too far away",_distance,_maxDistance); +}; + +private _strength = _vehAttenuation * _explosive * _volume * _maxDistance / _distance^2; + +TRACE_2("strength",_volume,_strength); + +// Call immediately, as it will get picked up later by the update thread anyway +_strength call FUNC(earRinging); diff --git a/addons/hearing/functions/fnc_explosionNear.sqf b/addons/hearing/functions/fnc_explosionNear.sqf deleted file mode 100644 index 583c55749e9..00000000000 --- a/addons/hearing/functions/fnc_explosionNear.sqf +++ /dev/null @@ -1,26 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: KoffeinFlummi, commy2, Ruthberg - * Handles deafness due to explosions going off near the player. - * - * Arguments: - * 0: Unit <OBJECT> - * 1: Damage inflicted to the unit <NUMBER> - * - * Return Value: - * None - * - * Example: - * [clientExplosionEvent] call ace_hearing_fnc_explosionNear - * - * Public: No - */ - -params ["_unit", "_damage"]; - -TRACE_2("explosion near player",_unit,_damage); - -private _strength = (0 max _damage) * 30; - -// Call immediately, as it will get picked up later by the update thread anyway -_strength call FUNC(earRinging); diff --git a/addons/hearing/stringtable.xml b/addons/hearing/stringtable.xml index 9aba1ab56b0..08419d4e42b 100644 --- a/addons/hearing/stringtable.xml +++ b/addons/hearing/stringtable.xml @@ -372,6 +372,7 @@ <French>Mettre/enlever les bouchons</French> <German>Ohrstöpsel einsetzen/herausnehmen</German> <Spanish>Poner/quitar tapones</Spanish> + <Portuguese>Colocar/retirar protetores auriculares</Portuguese> </Key> <Key ID="STR_ACE_Hearing_heavyWeaponUnits"> <English>Only units with heavy weapons</English> @@ -382,6 +383,7 @@ <Spanish>Sólo unidades con armas pesadas</Spanish> <Italian>Solo a unità con armi pesanti</Italian> <Korean>중화기를 가진 유닛만 해당</Korean> + <Portuguese>Apenas unidades com armas pesadas</Portuguese> </Key> </Package> </Project> diff --git a/addons/hellfire/CfgAmmo.hpp b/addons/hellfire/CfgAmmo.hpp index 5eef9ad47eb..8789be711ce 100644 --- a/addons/hellfire/CfgAmmo.hpp +++ b/addons/hellfire/CfgAmmo.hpp @@ -1,3 +1,4 @@ +class ace_missileguidance_type_Hellfire; class CfgAmmo { class M_Scalpel_AT; @@ -23,32 +24,8 @@ class CfgAmmo { EGVAR(rearm,caliber) = 178; - class ace_missileguidance { + class ace_missileguidance: ace_missileguidance_type_Hellfire { enabled = 1; - - minDeflection = 0.0005; // Minium flap deflection for guidance - maxDeflection = 0.01; // Maximum flap deflection for guidance - incDeflection = 0.0005; // The incrmeent in which deflection adjusts. - - canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode - - // Guidance type for munitions - defaultSeekerType = "SALH"; - seekerTypes[] = { "SALH", "LIDAR", "SARH", "Optic", "Thermal", "GPS", "SACLOS", "MCLOS" }; - - defaultSeekerLockMode = "LOAL"; - seekerLockModes[] = { "LOAL", "LOBL" }; - - seekLastTargetPos = 1; // seek last target position [if seeker loses LOS of target, continue to last known pos] - seekerAngle = 70; // Angle in front of the missile which can be searched - seekerAccuracy = 1; // seeker accuracy multiplier - - seekerMinRange = 1; - seekerMaxRange = 8000; // Range from the missile which the seeker can visually search - - // Attack profile type selection - defaultAttackProfile = "hellfire"; - attackProfiles[] = {"hellfire", "hellfire_hi", "hellfire_lo"}; }; }; class ACE_Hellfire_AGM114N: ACE_Hellfire_AGM114K { @@ -75,8 +52,8 @@ class CfgAmmo { canVanillaLock = 1; enabled = 1; // Missile Guidance must be explicitly enabled seekLastTargetPos = 0; - defaultSeekerType = "ARH"; - seekerTypes[] = { "ARH" }; + defaultSeekerType = "MillimeterWaveRadar"; + seekerTypes[] = { "MillimeterWaveRadar" }; defaultSeekerLockMode = "LOBL"; seekerLockModes[] = { "LOBL" }; diff --git a/addons/hellfire/XEH_PREP.hpp b/addons/hellfire/XEH_PREP.hpp index f30cf0bffdf..011810aa044 100644 --- a/addons/hellfire/XEH_PREP.hpp +++ b/addons/hellfire/XEH_PREP.hpp @@ -2,3 +2,4 @@ LOG("prep"); PREP(attackProfile); PREP(getAttackProfileSettings); PREP(setupVehicle); +PREP(midCourseTransition); diff --git a/addons/hellfire/functions/fnc_attackProfile.sqf b/addons/hellfire/functions/fnc_attackProfile.sqf index 26bc3f1ff07..aa457d02fa5 100644 --- a/addons/hellfire/functions/fnc_attackProfile.sqf +++ b/addons/hellfire/functions/fnc_attackProfile.sqf @@ -18,80 +18,99 @@ */ params ["_seekerTargetPos", "_args", "_attackProfileStateParams"]; -_args params ["_firedEH", "_launchParams", "", "", "_stateParams"]; +_args params ["_firedEH", "_launchParams", "_flightParams", "", "_stateParams"]; _stateParams params ["", "_seekerStateParams"]; _launchParams params ["","_targetLaunchParams","_seekerType"]; -_targetLaunchParams params ["", "", "_launchPos"]; +_targetLaunchParams params ["", "", "_launchPos", "_launchDir"]; _firedEH params ["","","","","","","_projectile"]; // Get state params: if (_attackProfileStateParams isEqualTo []) then { _this call FUNC(getAttackProfileSettings); }; -_attackProfileStateParams params ["_attackStage", "_configLaunchHeightClear"]; - +_attackProfileStateParams params ["_attackStage", "_configLaunchHeightClear", "_missileStateData"]; private _projectilePos = getPosASL _projectile; -private _distanceFromLaunch2d = _launchPos distance2d _projectilePos; +private _distanceFromLaunch2d = _launchPos distance2D _projectilePos; private _heightAboveLaunch = (_projectilePos select 2) - (_launchPos select 2); // Add height depending on distance for compensate -private _returnTargetPos = nil; +private _returnTargetPos = _seekerTargetPos; +if (_returnTargetPos isEqualTo [0, 0, 0]) then { + private _initialDistanceToTarget = 8000; + _returnTargetPos = _launchPos vectorAdd (_launchDir vectorMultiply _initialDistanceToTarget); +}; + +private _closingRate = vectorMagnitude velocity _projectile; +// subtract 500 meters to account for the fact that we don't want to be at the perfect pitch exactly when we cross the target +// 500 seemed good in testing +private _timeToGo = ((_projectilePos distance2D _seekerTargetPos) - 500) / _closingRate; + +// we could do stuff like desired attack angle, but I'm not going that far today +private _los = _projectilePos vectorFromTo _seekerTargetPos; + +_flightParams params ["_pitchRate", "_yawRate"]; + +private _angleToTarget = acos ((vectorDir _projectile) vectorCos _los); +private _atMinRotationAngle = _angleToTarget >= (_pitchRate * _timeToGo); switch (_attackStage) do { case STAGE_LAUNCH: { // Gain height quickly to pass terrain mask - _returnTargetPos = _projectilePos getPos [100, getDir _projectile]; - _returnTargetPos set [2, (_projectilePos select 2) + 36.4]; // 100 and 36.4 gives a 20 deg angle + _missileStateData params ["_heightBeforeStateSwitch", "_initialDistanceToTarget"]; + + _returnTargetPos set [2, _heightBeforeStateSwitch + (_initialDistanceToTarget * sin 20)]; // 100 and 36.4 gives a 20 deg angle if (_heightAboveLaunch > _configLaunchHeightClear) then { _attackProfileStateParams set [0, STAGE_SEEK_CRUISE]; + + _attackProfileStateParams set [2, [_projectilePos select 2, _seekerTargetPos distance2D _projectilePos]]; TRACE_2("New Stage: STAGE_SEEK_CRUISE",_distanceFromLaunch2d,_heightAboveLaunch); }; + + if (_atMinRotationAngle) then { + _attackProfileStateParams set [0, STAGE_ATTACK_TERMINAL]; + + _attackProfileStateParams set [2, [_projectilePos select 2, _seekerTargetPos distance2D _projectilePos]]; + TRACE_2("New Stage: STAGE_ATTACK_TERMINAL",_distanceToTarget2d,_currentHeightOverTarget); + }; }; case STAGE_SEEK_CRUISE: { // Slowly gain altitude while searching for target + _missileStateData params ["_heightBeforeStateSwitch", "_initialDistanceToTarget"]; + // Before 4000 cruise at 5.7 degrees up, then level out - private _cruiseHeight = linearConversion [3000, 5000, _distanceFromLaunch2d, 10, 0, true]; - - _returnTargetPos = _projectilePos getPos [100, getDir _projectile]; - _returnTargetPos set [2, (_projectilePos select 2) + _cruiseHeight]; - + _returnTargetPos set [2, _heightBeforeStateSwitch + (_initialDistanceToTarget * sin 5.7)]; + if (_seekerTargetPos isNotEqualTo [0,0,0]) then { _attackProfileStateParams set [0, STAGE_ATTACK_CRUISE]; + + _attackProfileStateParams set [2, [_projectilePos select 2, _seekerTargetPos distance2D _projectilePos]]; TRACE_1("New Stage: STAGE_ATTACK_CRUISE",_distanceFromLaunch2d); }; }; case STAGE_ATTACK_CRUISE: { + _missileStateData params ["_heightBeforeStateSwitch", "_initialDistanceToTarget"]; + private _currentHeightOverTarget = (_projectilePos select 2) - (_seekerTargetPos select 2); - private _distanceToTarget2d = _seekerTargetPos distance2d _projectilePos; - private _distToGoRatio = _distanceToTarget2d / (_launchPos distance2d _seekerTargetPos); + private _distanceToTarget2d = _seekerTargetPos distance2D _projectilePos; - // arcing up at 7 degrees to start until 50% left, then smooth curve to a downward attack - private _gainSlope = linearConversion [0.5, 0.1, _distToGoRatio, 7, -7, true]; - _returnTargetPos = +_seekerTargetPos; - _returnTargetPos set [2, ((_projectilePos select 2) + (_distanceToTarget2d * sin _gainSlope)) max (_seekerTargetPos select 2)]; + _returnTargetPos set [2, _heightBeforeStateSwitch + (_initialDistanceToTarget * sin 7)]; - if ((_distanceToTarget2d < 500) || {(_currentHeightOverTarget atan2 _distanceToTarget2d) > 15}) then { // Wait until we can come down at a sharp angle + // if we are at the rotation limit, rotate to target + if (_atMinRotationAngle || {(_currentHeightOverTarget atan2 _distanceToTarget2d) > 15}) then { // Wait until we can come down at a sharp angle _attackProfileStateParams set [0, STAGE_ATTACK_TERMINAL]; + + _attackProfileStateParams set [2, [_projectilePos select 2, _seekerTargetPos distance2D _projectilePos]]; TRACE_2("New Stage: STAGE_ATTACK_TERMINAL",_distanceToTarget2d,_currentHeightOverTarget); }; }; case STAGE_ATTACK_TERMINAL: { - private _distanceToTarget2d = _seekerTargetPos distance2d _projectilePos; - _returnTargetPos = _seekerTargetPos vectorAdd [0, 0, _distanceToTarget2d * 0.02]; }; }; -// Special radar case. Adjust target position such that we are leading it -if (_attackStage >= 3 && { _seekerType isEqualTo "ARH" }) then { - _seekerStateParams params ["", "", "", "", "", "", "", "_lastKnownVelocity"]; - private _projectileVelocity = velocity _projectile; - if (_projectileVelocity#2 < 0) then { - private _projectileSpeed = vectorMagnitude _projectileVelocity; // this gives a precise impact time versus using speed _projectile. Dont change - private _timeUntilImpact = (_seekerTargetPos distance _projectilePos) / _projectileSpeed; - _returnTargetPos = _returnTargetPos vectorAdd (_lastKnownVelocity vectorMultiply _timeUntilImpact); - }; -}; +// missile guidance defines this variable in doAttackProfile +//IGNORE_PRIVATE_WARNING ["_attackProfileName"]; +_attackProfileName = ["na", "hellfire - LAUNCH", "hellfire - SEEK CRUISE", "hellfire - ATTACK CRUISE", "hellfire - TERMINAL"] select _attackStage; -// TRACE_1("Adjusted target position",_returnTargetPos); +TRACE_1("Adjusted target position",_returnTargetPos); _returnTargetPos; diff --git a/addons/hellfire/functions/fnc_getAttackProfileSettings.sqf b/addons/hellfire/functions/fnc_getAttackProfileSettings.sqf index 14d89f82e31..d9e1c23b205 100644 --- a/addons/hellfire/functions/fnc_getAttackProfileSettings.sqf +++ b/addons/hellfire/functions/fnc_getAttackProfileSettings.sqf @@ -27,6 +27,8 @@ private _attackConfig = configFile >> QEGVAR(missileguidance,AttackProfiles) >> // Launch (clearing terrain mask for LO/HI): private _configLaunchHeightClear = getNumber (_attackConfig >> QGVAR(launchHeightClear)); +private _projectilePos = getPosASL _projectile; + // Get starting stage private _startingStage = if (_configLaunchHeightClear > 0) then { STAGE_LAUNCH; // LOAL-HI / LO @@ -40,5 +42,9 @@ private _startingStage = if (_configLaunchHeightClear > 0) then { // Set data in param array _attackProfileStateParams set [0, _startingStage]; _attackProfileStateParams set [1, _configLaunchHeightClear]; +_attackProfileStateParams set [2, [ + _projectilePos select 2, + _seekerTargetPos distance2D _projectilePos +]]; TRACE_1("new shot settings",_attackProfileStateParams); diff --git a/addons/hellfire/functions/fnc_midCourseTransition.sqf b/addons/hellfire/functions/fnc_midCourseTransition.sqf new file mode 100644 index 00000000000..034bd25d61a --- /dev/null +++ b/addons/hellfire/functions/fnc_midCourseTransition.sqf @@ -0,0 +1,30 @@ +#include "..\script_component.hpp" +/* + * Author: tcvm + * Condition to switch to next navigation profile + * + * Arguments: + * Guidance Arg Array <ARRAY> + * + * Return Value: + * None + * + * Example: + * [] call ace_hellfire_fnc_midCourseTransition + * + * Public: No + */ + +params ["_args", "_timestep"]; +_args params ["_firedEH", "_launchParams", "_flightParams", "_seekerParams", "_stateParams", "_targetData", "_navigationStateData"]; +_firedEH params ["_shooter","","","","_ammo","","_projectile"]; +_launchParams params ["_shooter","_targetLaunchParams","_seekerType","_attackProfile","_lockMode","_laserInfo","_navigationType"]; +_targetLaunchParams params ["_target", "_targetPos", "_launchPos", "_launchDir", "_launchTime"]; +_flightParams params ["_pitchRate", "_yawRate", "_isBangBangGuidance"]; +_stateParams params ["_lastRunTime", "_seekerStateParams", "_attackProfileStateParams", "_lastKnownPosState","_navigationParams", "_guidanceParameters"]; +_seekerParams params ["_seekerAngle", "_seekerAccuracy", "_seekerMaxRange", "_seekerMinRange"]; +_targetData params ["_targetDirection", "_attackProfileDirection", "_targetRange", "_targetVelocity", "_targetAcceleration"]; + +_attackProfileStateParams params ["_state"]; +_state isEqualTo STAGE_ATTACK_TERMINAL; + diff --git a/addons/hitreactions/functions/fnc_getRandomAnimation.sqf b/addons/hitreactions/functions/fnc_getRandomAnimation.sqf index 8b26bf70efd..a52f2958dca 100644 --- a/addons/hitreactions/functions/fnc_getRandomAnimation.sqf +++ b/addons/hitreactions/functions/fnc_getRandomAnimation.sqf @@ -25,6 +25,7 @@ if (_weapon == "") exitWith { if (_weapon == primaryWeapon _unit) exitWith { if (_unit call EFUNC(common,isPlayer)) then { + //IGNORE_PRIVATE_WARNING ["_velocity"]; // from upper scope private _isRunning = _velocity > 4; [ diff --git a/addons/hitreactions/stringtable.xml b/addons/hitreactions/stringtable.xml index ff541ad6a34..e60be5b353a 100644 --- a/addons/hitreactions/stringtable.xml +++ b/addons/hitreactions/stringtable.xml @@ -24,6 +24,8 @@ <Korean>플레이어가 무기를 떨굴 확률 (팔 피격)</Korean> <German>Spieler Wahrscheinlichkeit, die Waffe fallen zu lassen (Arm Treffer)</German> <Italian>Probabilità dei giocatori di far cadere l'arma (colpo al braccio)</Italian> + <French>Probabilité de lâcher l'arme (coup au bras)</French> + <Portuguese>Probabilidade do jogador de largar a arma após tiro no braço</Portuguese> </Key> <Key ID="STR_ACE_HitReactions_weaponDropChanceArmHitAI_displayName"> <English>AI Weapon Drop Chance (Arm Hit)</English> @@ -32,6 +34,8 @@ <Korean>인공지능이 무기를 떨굴 확률 (팔 피격)</Korean> <German>KI-Wahrscheinlichkeit, die Waffe fallen zu lassen (Arm Treffer)</German> <Italian>Probabilità dell'IA di far cadere l'arma (colpo al braccio)</Italian> + <French>Probabilité de l'IA de lâcher l'arme (coup au bras)</French> + <Portuguese>Probabilidade da IA de largar a arma após tiro no braço</Portuguese> </Key> </Package> </Project> diff --git a/addons/hot/CfgAmmo.hpp b/addons/hot/CfgAmmo.hpp index 1be8c6067f6..6f91d241fb9 100644 --- a/addons/hot/CfgAmmo.hpp +++ b/addons/hot/CfgAmmo.hpp @@ -1,3 +1,4 @@ +class ace_missileguidance_type_Hot; class CfgAmmo { class M_Scalpel_AT; class ammo_Penetrator_Base; @@ -55,35 +56,8 @@ class CfgAmmo { EGVAR(rearm,caliber) = 178; EGVAR(vehicle_damage,incendiary) = 1.0; - class ace_missileguidance { + class ace_missileguidance: ace_missileguidance_type_Hot { enabled = 1; - - minDeflection = 0; // Minium flap deflection for guidance - maxDeflection = 0.0030; // Maximum flap deflection for guidance - incDeflection = 0.0005; // The incrmeent in which deflection adjusts. - - canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode - - // Guidance type for munitions - defaultSeekerType = "SACLOS"; - seekerTypes[] = { "SACLOS" }; - - defaultSeekerLockMode = "LOAL"; - seekerLockModes[] = { "LOAL", "LOBL" }; - - seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] - seekerAngle = 30; // Angle from the shooter's view that can track the missile - seekerAccuracy = 1; // seeker accuracy multiplier - - seekerMinRange = 75; - seekerMaxRange = 4000; // Range from the missile which the seeker can visually search - - correctionDistance = 8; // distance from center of crosshair where missile slows down - offsetFromCrosshair[] = { 0, 0, 0.5 }; // where the missile wants to stay in relation to the center of the crosshair. - - // Attack profile type selection - defaultAttackProfile = "WIRE"; - attackProfiles[] = {"WIRE"}; }; }; @@ -135,6 +109,7 @@ class CfgAmmo { class ace_missileguidance: ace_missileguidance { enabled = 1; seekerMaxRange = 4300; + offsetFromCrosshair[] = { 0, 0, 0.5 }; // where the missile wants to stay in relation to the center of the crosshair. }; }; }; diff --git a/addons/hot/CfgVehicles.hpp b/addons/hot/CfgVehicles.hpp index db5b8b5262e..46ac7d5136b 100644 --- a/addons/hot/CfgVehicles.hpp +++ b/addons/hot/CfgVehicles.hpp @@ -4,11 +4,22 @@ class CfgVehicles { class Turrets; }; class LT_01_base_F: Tank_F { + class AnimationSources; class Turrets: Turrets { class MainTurret; }; }; class LT_01_AT_base_F: LT_01_base_F { + class AnimationSources: AnimationSources { + class Missiles_revolving { + source = "revolving"; + weapon = QGVAR(generic_launcher); + }; + class Missiles_reloadMagazine { + source = "reloadMagazine"; + weapon = QGVAR(generic_launcher); + }; + }; class Turrets: Turrets { class MainTurret: MainTurret { weapons[] = {"SmokeLauncher","HMG_127",QGVAR(generic_launcher)}; diff --git a/addons/huntir/functions/fnc_cam.sqf b/addons/huntir/functions/fnc_cam.sqf index 411dbfe30eb..4a80a4819e9 100644 --- a/addons/huntir/functions/fnc_cam.sqf +++ b/addons/huntir/functions/fnc_cam.sqf @@ -31,10 +31,10 @@ GVAR(ELEVAT) = 0.01; HUNTIR_BACKGROUND_LAYER_ID cutText["","PLAIN"]; -closedialog 0; +closeDialog 0; createDialog QGVAR(cam_dialog); -uiNameSpace setVariable [QGVAR(monitor), findDisplay 18880]; -(uiNameSpace getVariable QGVAR(monitor)) displaySetEventHandler ["Keydown", QUOTE(_this call FUNC(keyPressed))]; +uiNamespace setVariable [QGVAR(monitor), findDisplay 18880]; +(uiNamespace getVariable QGVAR(monitor)) displaySetEventHandler ["Keydown", QUOTE(_this call FUNC(keyPressed))]; ctrlSetText [4, "0X"]; @@ -68,8 +68,9 @@ GVAR(no_cams) sort true; } forEach GVAR(no_cams); [{ //Close monitor if we no longer have the item: - if ((!([ACE_player, "ACE_HuntIR_monitor"] call EFUNC(common,hasItem))) && {!isNull (uiNameSpace getVariable [QGVAR(monitor), displayNull])}) then { + if ((!([ACE_player, "ACE_HuntIR_monitor"] call EFUNC(common,hasItem))) && {!isNull (uiNamespace getVariable [QGVAR(monitor), displayNull])}) then { closeDialog 0; + [QGVAR(monitorClosed), [ACE_player]] call CBA_fnc_localEvent; }; GVAR(nearHuntIRs) = ACE_player nearEntities ["ACE_HuntIR", HUNTIR_MAX_TRANSMISSION_RANGE]; @@ -104,32 +105,33 @@ GVAR(no_cams) sort true; GVAR(NV) = 0; setAperture -1; - closedialog 0; - titletext [" ", "BLACK IN", 4]; + closeDialog 0; + titleText [" ", "BLACK IN", 4]; ACE_player switchCamera "INTERNAL"; - GVAR(cam) CameraEffect ["Terminate", "Back"]; - CamDestroy GVAR(cam); + GVAR(cam) cameraEffect ["Terminate", "Back"]; + camDestroy GVAR(cam); deleteVehicle GVAR(logic); if (player != ACE_player) then { player remoteControl ACE_player; }; + [QGVAR(monitorClosed), [ACE_player]] call CBA_fnc_localEvent; }; switch (GVAR(ZOOM)) do { case 0: { - GVAR(cam) camsetFOV 0.7; + GVAR(cam) camSetFov 0.7; GVAR(cam) camSetFocus [GVAR(pos) select 2, 1]; }; case 1: { - GVAR(cam) camsetFOV 0.35; + GVAR(cam) camSetFov 0.35; GVAR(cam) camSetFocus [(GVAR(pos) select 2)/2, 1]; }; case 2: { - GVAR(cam) camsetFOV 0.17; + GVAR(cam) camSetFov 0.17; GVAR(cam) camSetFocus [(GVAR(pos) select 2)/4, 1]; }; case 3: { - GVAR(cam) camsetFOV 0.1; + GVAR(cam) camSetFov 0.1; GVAR(cam) camSetFocus [(GVAR(pos) select 2)/8, 1]; }; }; @@ -137,7 +139,7 @@ GVAR(no_cams) sort true; GVAR(logic) setPosATL (GVAR(pos) vectorAdd [0, 0, -5]); GVAR(logic) setDir GVAR(ROTATE); GVAR(logic) setVectorUp [0.0001, 0.0001, 1]; - GVAR(cam) CameraEffect ["internal", "BACK"]; + GVAR(cam) cameraEffect ["internal", "BACK"]; private _cam_coord_y = GVAR(ELEVAT) * cos(GVAR(ROTATE)); private _cam_coord_x = GVAR(ELEVAT) * sin(GVAR(ROTATE)); GVAR(cam) camSetRelPos [_cam_coord_x, _cam_coord_y, 2]; diff --git a/addons/huntir/functions/fnc_huntir.sqf b/addons/huntir/functions/fnc_huntir.sqf index 60b7a1fc141..c54d193d9e3 100644 --- a/addons/huntir/functions/fnc_huntir.sqf +++ b/addons/huntir/functions/fnc_huntir.sqf @@ -18,20 +18,23 @@ #define __TYPE_WRITER_DELAY 0.05 -if ((ACE_player call CBA_fnc_getUnitAnim) select 0 == "stand") then { +if (missionNamespace getVariable [QGVAR(animatePlayer), true] && {(ACE_player call CBA_fnc_getUnitAnim) select 0 == "stand"}) then { ACE_player playMove "AmovPercMstpSrasWrflDnon_diary"; }; HUNTIR_BACKGROUND_LAYER_ID cutText ["", "BLACK", 0]; createDialog QGVAR(cam_dialog_off); +[QGVAR(monitorOpened), [ACE_player]] call CBA_fnc_localEvent; + [{ if (!dialog) exitWith { HUNTIR_BACKGROUND_LAYER_ID cutText ["", "PLAIN", 0]; + [QGVAR(monitorClosed), [ACE_player]] call CBA_fnc_localEvent; }; closeDialog 0; createDialog QGVAR(cam_dialog_inactive); - uiNameSpace setVariable [QGVAR(monitor), findDisplay 18881]; + uiNamespace setVariable [QGVAR(monitor), findDisplay 18881]; [{ GVAR(startTime) = CBA_missionTime; GVAR(done) = false; @@ -40,10 +43,12 @@ createDialog QGVAR(cam_dialog_off); GVAR(message) = []; GVAR(messageSearching) = toArray "Searching....."; GVAR(messageConnecting) = toArray "Connecting....."; + [QGVAR(monitorStarted), [ACE_player]] call CBA_fnc_localEvent; [{ //Close monitor if we no longer have item: - if ((!([ACE_player, "ACE_HuntIR_monitor"] call EFUNC(common,hasItem))) && {!isNull (uiNameSpace getVariable [QGVAR(monitor), displayNull])}) then { + if ((!([ACE_player, "ACE_HuntIR_monitor"] call EFUNC(common,hasItem))) && {!isNull (uiNamespace getVariable [QGVAR(monitor), displayNull])}) then { closeDialog 0; + [QGVAR(monitorClosed), [ACE_player]] call CBA_fnc_localEvent; }; private _elapsedTime = CBA_missionTime - GVAR(startTime); @@ -55,6 +60,7 @@ createDialog QGVAR(cam_dialog_off); GVAR(done) = false; GVAR(message) = []; GVAR(connectionDelay) = 5; + [QGVAR(monitorDisconnected), [ACE_player]] call CBA_fnc_localEvent; }; if ((!dialog) || GVAR(done)) exitWith { @@ -64,6 +70,7 @@ createDialog QGVAR(cam_dialog_off); [_nearestHuntIRs select 0] call FUNC(cam); } else { HUNTIR_BACKGROUND_LAYER_ID cutText ["", "PLAIN"]; + [QGVAR(monitorClosed), [ACE_player]] call CBA_fnc_localEvent; }; }; switch (GVAR(state)) do { @@ -75,9 +82,11 @@ createDialog QGVAR(cam_dialog_off); GVAR(message) = []; if (_elapsedTime > 10) then { GVAR(state) = "noGDS"; + [QGVAR(monitorNoGDS), [ACE_player]] call CBA_fnc_localEvent; }; if (_elapsedTime > 5 && {{_x getHitPointDamage "HitCamera" < 0.25} count _nearestHuntIRs > 0}) then { GVAR(state) = "connecting"; + [QGVAR(monitorConnecting), [ACE_player]] call CBA_fnc_localEvent; }; }; }; @@ -91,6 +100,7 @@ createDialog QGVAR(cam_dialog_off); if (GVAR(connectionDelay) <= 0) then { GVAR(done) = true; GVAR(state) = "connected"; + [QGVAR(monitorConnected), [ACE_player, _nearestHuntIRs select 0]] call CBA_fnc_localEvent; }; }; }; @@ -98,8 +108,9 @@ createDialog QGVAR(cam_dialog_off); ctrlSetText [1, "No GDS System detected"]; [{ GVAR(done) = true; - closedialog 0; + closeDialog 0; HUNTIR_BACKGROUND_LAYER_ID cutText ["", "PLAIN"]; + [QGVAR(monitorClosed), [ACE_player]] call CBA_fnc_localEvent; }, [], 3, 0] call CBA_fnc_waitAndExecute; }; }; diff --git a/addons/intelitems/CfgWeapons.hpp b/addons/intelitems/CfgWeapons.hpp new file mode 100644 index 00000000000..727b163de28 --- /dev/null +++ b/addons/intelitems/CfgWeapons.hpp @@ -0,0 +1,17 @@ +class CfgWeapons { + class ACE_ItemCore; + class CBA_MiscItem_ItemInfo; + + // Since base game doesn't support misc. items, this is needed to filling inventories in the editor + class GVAR(notepad_Item): ACE_ItemCore { + displayName = CSTRING(Notepad_DisplayName); + author = ECSTRING(common,ACETeam); + scope = 2; + scopeArsenal = 0; + descriptionShort = CSTRING(Notepad_Description); + picture = QPATHTOF(ui\notepad_ca.paa); + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 0.1; + }; + }; +}; diff --git a/addons/intelitems/XEH_postInit.sqf b/addons/intelitems/XEH_postInit.sqf index f416b3667ed..f79ae9f6362 100644 --- a/addons/intelitems/XEH_postInit.sqf +++ b/addons/intelitems/XEH_postInit.sqf @@ -1,5 +1,8 @@ #include "script_component.hpp" +// Notepad item to magazine +[QGVAR(notepad_Item), QXGVAR(notepad)] call EFUNC(common,registerItemReplacement); + // Only handle loadout change when on map or have open controls ["loadout", { if (!visibleMap && {GVAR(controlsGroups) isEqualTo []}) exitWith {}; diff --git a/addons/intelitems/config.cpp b/addons/intelitems/config.cpp index 3b9b37b5b63..1eafb3fe860 100644 --- a/addons/intelitems/config.cpp +++ b/addons/intelitems/config.cpp @@ -8,7 +8,7 @@ class CfgPatches { QXGVAR(document), QXGVAR(photo) }; - weapons[] = {}; + weapons[] = {QGVAR(notepad_Item)}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_interact_menu", "ace_zeus"}; author = ECSTRING(common,ACETeam); @@ -23,5 +23,6 @@ class CfgPatches { #include "CfgEventHandlers.hpp" #include "CfgEditorSubcategories.hpp" #include "CfgMagazines.hpp" +#include "CfgWeapons.hpp" #include "CfgVehicles.hpp" #include "gui.hpp" diff --git a/addons/interact_menu/CursorMenus.hpp b/addons/interact_menu/CursorMenus.hpp index 79f1109598c..82cb9e79e66 100644 --- a/addons/interact_menu/CursorMenus.hpp +++ b/addons/interact_menu/CursorMenus.hpp @@ -28,10 +28,10 @@ class RscTitles { size = 1; colorBackground[] = {0, 0, 0, 0.65}; colorText[] = {0, 0, 0, 0}; - x = "safezoneX"; - y = "safezoneY"; - w = "safezoneW"; - h = "safezoneH"; + x = "safeZoneX"; + y = "safeZoneY"; + w = "safeZoneW"; + h = "safeZoneH"; }; }; }; diff --git a/addons/interact_menu/XEH_preInit.sqf b/addons/interact_menu/XEH_preInit.sqf index 88269bcc04d..a62996df688 100644 --- a/addons/interact_menu/XEH_preInit.sqf +++ b/addons/interact_menu/XEH_preInit.sqf @@ -88,8 +88,8 @@ GVAR(inheritedClassesMan) = []; if (GVAR(inheritedClassesAll) pushBackUnique _type == -1) exitWith { END_COUNTER(InitPost); }; { - _x params ["_objectType", "_typeNum", "_parentPath", "_action"]; - if (_object isKindOf _objectType) then { + _x params ["_objectType", "_typeNum", "_parentPath", "_action", "_excludedClasses"]; + if (_type isKindOf _objectType && {_excludedClasses findIf {_type isKindOf _x} == -1}) then { [_type, _typeNum, _parentPath, _action] call FUNC(addActionToClass); }; } forEach GVAR(inheritedActionsAll); @@ -102,8 +102,10 @@ GVAR(inheritedClassesMan) = []; if (GVAR(inheritedClassesMan) pushBackUnique _type == -1) exitWith { END_COUNTER(InitPost); }; { - _x params ["_typeNum", "_parentPath", "_action"]; - [_type, _typeNum, _parentPath, _action] call FUNC(addActionToClass); + _x params ["_typeNum", "_parentPath", "_action", "_excludedClasses"]; + if (_excludedClasses findIf {_type isKindOf _x} == -1) then { // skip excluded classes and children + [_type, _typeNum, _parentPath, _action] call FUNC(addActionToClass); + }; } forEach GVAR(inheritedActionsMan); END_COUNTER(InitPost); }, true, ["VirtualMan_F"]] call CBA_fnc_addClassEventHandler; diff --git a/addons/interact_menu/config.cpp b/addons/interact_menu/config.cpp index 756e8775abc..d29a9fb6879 100644 --- a/addons/interact_menu/config.cpp +++ b/addons/interact_menu/config.cpp @@ -21,10 +21,3 @@ class CfgPatches { #include "CursorMenus.hpp" #include "ACE_Settings.hpp" - -class ACE_Extensions { - class ace_break_line { - windows = 1; - client = 1; - }; -}; diff --git a/addons/interact_menu/functions/fnc_addActionToClass.sqf b/addons/interact_menu/functions/fnc_addActionToClass.sqf index ccea8c4654d..d2167c8079c 100644 --- a/addons/interact_menu/functions/fnc_addActionToClass.sqf +++ b/addons/interact_menu/functions/fnc_addActionToClass.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: esteldunedain - * Insert an ACE action to a class, under a certain path + * Inserts an ACE action to a class, under a certain path. * Note: This function is NOT global. * * Arguments: @@ -10,12 +10,13 @@ * 2: Parent path of the new action <ARRAY> * 3: Action <ARRAY> * 4: Use Inheritance <BOOL> (default: false) + * 5: Classes excluded from inheritance (children included) <ARRAY> (default: []) * * Return Value: * The entry full path, which can be used to remove the entry, or add children entries <ARRAY>. * * Example: - * [typeOf cursorTarget, 0, ["ACE_TapShoulderRight"],VulcanPinchAction] call ace_interact_menu_fnc_addActionToClass; + * [typeOf cursorTarget, 0, ["ACE_TapShoulderRight"], VulcanPinchAction] call ace_interact_menu_fnc_addActionToClass; * * Public: Yes */ @@ -25,22 +26,30 @@ if (!params [["_objectType", "", [""]], ["_typeNum", 0, [0]], ["_parentPath", [] ERROR("Bad Params"); [] }; -TRACE_4("addActionToClass",_objectType,_typeNum,_parentPath,_action); +private _useInheritance = _this param [4, false, [false]]; +private _excludedClasses = _this param [5, [], [[]]]; +TRACE_6("addActionToClass",_objectType,_typeNum,_parentPath,_action,_useInheritance,_excludedClasses); -if (param [4, false, [false]]) exitwith { +if (_useInheritance) exitWith { BEGIN_COUNTER(addAction); + private _cfgVehicles = configFile >> "CfgVehicles"; // store this so we don't resolve for every element + _excludedClasses = (_excludedClasses apply {configName (_cfgVehicles >> _x)}) - [""]; // ends up being faster than toLower'ing everything else if (_objectType == "CAManBase") then { - GVAR(inheritedActionsMan) pushBack [_typeNum, _parentPath, _action]; + GVAR(inheritedActionsMan) pushBack [_typeNum, _parentPath, _action, _excludedClasses]; { - [_x, _typeNum, _parentPath, _action] call FUNC(addActionToClass); - } forEach GVAR(inheritedClassesMan); + private _type = _x; + if (_excludedClasses findIf {_type isKindOf _x} == -1) then { // skip excluded classes and children + [_x, _typeNum, _parentPath, _action] call FUNC(addActionToClass); + }; + } forEach (GVAR(inheritedClassesMan) - _excludedClasses); } else { - GVAR(inheritedActionsAll) pushBack [_objectType, _typeNum, _parentPath, _action]; + GVAR(inheritedActionsAll) pushBack [_objectType, _typeNum, _parentPath, _action, _excludedClasses]; { - if (_x isKindOf _objectType) then { - [_x, _typeNum, _parentPath, _action] call FUNC(addActionToClass); + private _type = _x; + if (_type isKindOf _objectType && {_excludedClasses findIf {_type isKindOf _x} == -1}) then { + [_type, _typeNum, _parentPath, _action] call FUNC(addActionToClass); }; - } forEach GVAR(inheritedClassesAll); + } forEach (GVAR(inheritedClassesAll) - _excludedClasses); }; END_COUNTER(addAction); diff --git a/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf b/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf index 8f19dfabbec..a7fe168a5d9 100644 --- a/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf +++ b/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf @@ -109,6 +109,7 @@ if (_objectType isKindOf "CAManBase") then { TRACE_1("Building ACE_SelfActions",_objectType); // Create a master action to base on self action +//IGNORE_PRIVATE_WARNING ["_target"]; private _actions = [ [ [ @@ -119,7 +120,7 @@ private _actions = [ // Dummy statement so it's not collapsed when there's no available actions true }, - {[ACE_player, _target, ["isNotInside","isNotDragging", "isNotCarrying", "isNotSwimming", "notOnMap", "isNotEscorting", "isNotSurrendering", "isNotSitting", "isNotOnLadder", "isNotRefueling"]] call EFUNC(common,canInteractWith)}, + {[ACE_player, _target, ["isNotInside","isNotDragging", "isNotCarrying", "isNotSwimming", "notOnMap", "isNotEscorting", "isNotSurrendering", "isNotHandcuffed", "isNotSitting", "isNotOnLadder", "isNotRefueling"]] call EFUNC(common,canInteractWith)}, {}, {}, "Spine3", diff --git a/addons/interact_menu/functions/fnc_createAction.sqf b/addons/interact_menu/functions/fnc_createAction.sqf index ae00f4fb820..f099ae9fb03 100644 --- a/addons/interact_menu/functions/fnc_createAction.sqf +++ b/addons/interact_menu/functions/fnc_createAction.sqf @@ -26,7 +26,8 @@ * Public: Yes */ -// IGNORE_PRIVATE_WARNING(_actionName,_displayName,_icon,_statement,_condition,_insertChildren,_customParams,_position,_distance,_params,_modifierFunction); +//IGNORE_PRIVATE_WARNING ["_actionName", "_displayName", "_icon", "_statement", "_condition", "_insertChildren"]; +//IGNORE_PRIVATE_WARNING ["_customParams", "_position", "_distance", "_params", "_modifierFunction"]; if (!hasInterface) exitWith { [] }; params [ diff --git a/addons/interact_menu/functions/fnc_keyDown.sqf b/addons/interact_menu/functions/fnc_keyDown.sqf index 9cb638bcea4..d87f6cfa3ba 100644 --- a/addons/interact_menu/functions/fnc_keyDown.sqf +++ b/addons/interact_menu/functions/fnc_keyDown.sqf @@ -36,7 +36,7 @@ if (_isTextEditing) then { if ( _isTextEditing || {(isNull curatorCamera) && { - !([ACE_player, objNull, ["isNotInside","isNotDragging", "isNotCarrying", "isNotSwimming", "notOnMap", "isNotEscorting", "isNotSurrendering", "isNotSitting", "isNotOnLadder", "isNotRefueling"]] call EFUNC(common,canInteractWith)) + !([ACE_player, objNull, ["isNotInside","isNotDragging", "isNotCarrying", "isNotSwimming", "notOnMap", "isNotEscorting", "isNotSurrendering", "isNotHandcuffed", "isNotSitting", "isNotOnLadder", "isNotRefueling"]] call EFUNC(common,canInteractWith)) } }) exitWith {false}; @@ -84,8 +84,8 @@ if (GVAR(useCursorMenu)) then { } else { createDialog QGVAR(cursorMenu); }; - (finddisplay 91919) displayAddEventHandler ["KeyUp", {[_this,'keyup'] call CBA_events_fnc_keyHandler}]; - (finddisplay 91919) displayAddEventHandler ["KeyDown", { + (findDisplay 91919) displayAddEventHandler ["KeyUp", {[_this,'keyup'] call CBA_events_fnc_keyHandler}]; + (findDisplay 91919) displayAddEventHandler ["KeyDown", { // Handle the escape key being pressed with menu open: if ((_this select [1,4]) isEqualTo [1,false,false,false]) exitWith { // escape key with no modifiers [displayNull] call FUNC(handleEscapeMenu); @@ -102,8 +102,8 @@ if (GVAR(useCursorMenu)) then { _ctrl ctrlCommit 0; // handles Mouse moving and LMB in cursor mode when action on keyrelease is disabled - ((finddisplay 91919) displayctrl 9922) ctrlAddEventHandler ["MouseMoving", DFUNC(handleMouseMovement)]; - ((finddisplay 91919) displayctrl 9922) ctrlAddEventHandler ["MouseButtonDown", DFUNC(handleMouseButtonDown)]; + ((findDisplay 91919) displayCtrl 9922) ctrlAddEventHandler ["MouseMoving", DFUNC(handleMouseMovement)]; + ((findDisplay 91919) displayCtrl 9922) ctrlAddEventHandler ["MouseButtonDown", DFUNC(handleMouseButtonDown)]; setMousePosition [0.5, 0.5]; } else { if (uiNamespace getVariable [QGVAR(cursorMenuOpened),false]) then { @@ -111,18 +111,12 @@ if (GVAR(useCursorMenu)) then { }; }; -GVAR(selfMenuOffset) = (AGLtoASL (positionCameraToWorld [0, 0, 2])) vectorDiff (AGLtoASL (positionCameraToWorld [0, 0, 0])); +GVAR(selfMenuOffset) = (AGLToASL (positionCameraToWorld [0, 0, 2])) vectorDiff (AGLToASL (positionCameraToWorld [0, 0, 0])); //Auto expand the first level when self, mounted vehicle or zeus (skips the first animation as there is only one choice) if (GVAR(openedMenuType) == 0) then { if (isNull curatorCamera) then { - if !(isNull (ACE_controlledUAV select 0)) then { - GVAR(menuDepthPath) = [["ACE_SelfActions", (ACE_controlledUAV select 0)]]; - GVAR(expanded) = true; - GVAR(expandedTime) = diag_tickTime; - GVAR(lastPath) = +GVAR(menuDepthPath); - GVAR(startHoverTime) = -1000; - } else { + if (isNull (ACE_controlledUAV select 0)) then { if (vehicle ACE_player != ACE_player) then { GVAR(menuDepthPath) = [["ACE_SelfActions", (vehicle ACE_player)]]; GVAR(expanded) = true; @@ -130,6 +124,12 @@ if (GVAR(openedMenuType) == 0) then { GVAR(lastPath) = +GVAR(menuDepthPath); GVAR(startHoverTime) = -1000; }; + } else { + GVAR(menuDepthPath) = [["ACE_SelfActions", (ACE_controlledUAV select 0)]]; + GVAR(expanded) = true; + GVAR(expandedTime) = diag_tickTime; + GVAR(lastPath) = +GVAR(menuDepthPath); + GVAR(startHoverTime) = -1000; }; } else { GVAR(menuDepthPath) = [["ACE_ZeusActions", (getAssignedCuratorLogic player)]]; diff --git a/addons/interact_menu/functions/fnc_removeActionFromClass.sqf b/addons/interact_menu/functions/fnc_removeActionFromClass.sqf index 7585616ef6a..87cc8609ccc 100644 --- a/addons/interact_menu/functions/fnc_removeActionFromClass.sqf +++ b/addons/interact_menu/functions/fnc_removeActionFromClass.sqf @@ -1,29 +1,63 @@ #include "..\script_component.hpp" /* * Author: esteldunedain - * Removes an action from a class + * Removes an action from a class. * * Arguments: * 0: TypeOf of the class <STRING> * 1: Type of action, 0 for actions, 1 for self-actions <NUMBER> * 2: Full path of the new action <ARRAY> + * 3: Remove action from child classes <BOOL> (default: false) * * Return Value: * None * * Example: - * [typeOf cursorTarget, 0,["ACE_TapShoulderRight","VulcanPinch"]] call ace_interact_menu_fnc_removeActionFromClass; + * [typeOf cursorTarget, 0, ["ACE_TapShoulderRight", "VulcanPinch"]] call ace_interact_menu_fnc_removeActionFromClass; * * Public: No */ -params ["_objectType", "_typeNum", "_fullPath"]; +params ["_objectType", "_typeNum", "_fullPath", ["_useInheritance", false, [false]]]; _objectType = _objectType call EFUNC(common,getConfigName); private _res = _fullPath call FUNC(splitPath); _res params ["_parentPath", "_actionName"]; +if (_useInheritance) exitWith { + // Only need to run for classes that have already been initialized + { + [_x, _typeNum, _fullPath] call FUNC(removeActionFromClass); + } forEach (GVAR(inheritedClassesAll) select {_x isKindOf _objectType}); + + // Find same path and actionName, and check if it's a parent class, needs to be checked for all classes + private _index = GVAR(inheritedActionsAll) findIf { + _x params ["_currentType", "", "_currentParentPath", "_currentAction"]; + + [_objectType isKindOf _currentType, _currentParentPath, _currentAction select 0] isEqualTo [true, _parentPath, _actionName] + }; + + // Add to exclude classes + if (_index != -1) then { + (GVAR(inheritedActionsAll) select _index select 4) pushBackUnique _objectType; + }; + + // Children of CAManBase need special treatment because of inheritedActionsMan array + if (_objectType isKindOf "CAManBase") then { + private _index = GVAR(inheritedActionsMan) findIf { + _x params ["", "_currentParentPath", "_currentAction"]; + + [_currentParentPath, _currentAction select 0] isEqualTo [_parentPath, _actionName] + }; + + // Different index because array doesn't include _objectType + if (_index != -1) then { + (GVAR(inheritedActionsMan) select _index select 3) pushBackUnique _objectType; + }; + }; +}; + private _namespace = [GVAR(ActNamespace), GVAR(ActSelfNamespace)] select _typeNum; private _actionTrees = _namespace getOrDefault [_objectType, []]; diff --git a/addons/interact_menu/functions/fnc_render.sqf b/addons/interact_menu/functions/fnc_render.sqf index e4ee0d63575..2089f6b1060 100644 --- a/addons/interact_menu/functions/fnc_render.sqf +++ b/addons/interact_menu/functions/fnc_render.sqf @@ -38,7 +38,7 @@ if (GVAR(openedMenuType) >= 0) then { private _closestSelection = -1; { _x params ["", "_sPos"]; - private _distanceFromCursor = _cursorScreenPos distance2d _sPos; + private _distanceFromCursor = _cursorScreenPos distance2D _sPos; if ((_distanceFromCursor < 0.1118) && {_distanceFromCursor < _closestDistance}) then { _closestDistance = _distanceFromCursor; _closestSelection = _forEachIndex; diff --git a/addons/interact_menu/functions/fnc_renderActionPoints.sqf b/addons/interact_menu/functions/fnc_renderActionPoints.sqf index 62d29be91f4..1887a6d790e 100644 --- a/addons/interact_menu/functions/fnc_renderActionPoints.sqf +++ b/addons/interact_menu/functions/fnc_renderActionPoints.sqf @@ -19,8 +19,8 @@ GVAR(currentOptions) = []; private _player = ACE_player; -GVAR(cameraPosASL) = AGLtoASL (positionCameraToWorld [0, 0, 0]); -GVAR(cameraDir) = (AGLtoASL (positionCameraToWorld [0, 0, 1])) vectorDiff GVAR(cameraPosASL); +GVAR(cameraPosASL) = AGLToASL (positionCameraToWorld [0, 0, 0]); +GVAR(cameraDir) = (AGLToASL (positionCameraToWorld [0, 0, 1])) vectorDiff GVAR(cameraPosASL); private _fnc_renderNearbyActions = { // Render all nearby interaction menus @@ -97,15 +97,15 @@ private _fnc_renderSelfActions = { // Iterate through base level class actions and render them if appropiate private _classActions = GVAR(ActSelfNamespace) get typeOf _target; - private _pos = if !(GVAR(useCursorMenu)) then { - //Convert to ASL, add offset and then convert back to AGL (handles waves when over water) - ASLtoAGL ((AGLtoASL (positionCameraToWorld [0, 0, 0])) vectorAdd GVAR(selfMenuOffset)); - } else { + private _pos = if (GVAR(useCursorMenu)) then { [0.5, 0.5] + } else { + //Convert to ASL, add offset and then convert back to AGL (handles waves when over water) + ASLToAGL ((AGLToASL (positionCameraToWorld [0, 0, 0])) vectorAdd GVAR(selfMenuOffset)); }; { - _action = _x; + private _action = _x; [_target, _action, _pos] call FUNC(renderBaseMenu); } forEach _classActions; }; @@ -123,10 +123,7 @@ GVAR(collectedActionPoints) resize 0; // Render nearby actions, unit self actions or vehicle self actions as appropiate if (GVAR(openedMenuType) == 0) then { if (isNull curatorCamera) then { - if !(isNull (ACE_controlledUAV select 0)) then { - // Render UAV self actions when in control of UAV AI - (ACE_controlledUAV select 0) call _fnc_renderSelfActions; - } else { + if (isNull (ACE_controlledUAV select 0)) then { if (vehicle ACE_player == ACE_player) then { if (diag_tickTime > GVAR(lastTimeSearchedActions) + 0.20) then { // Once every 0.2 secs, collect nearby objects active and visible action points and render them @@ -139,6 +136,10 @@ if (GVAR(openedMenuType) == 0) then { // Render vehicle self actions when in vehicle (vehicle ACE_player) call _fnc_renderSelfActions; }; + } else { + // Render UAV self actions when in control of UAV AI + (ACE_controlledUAV select 0) call _fnc_renderSelfActions; + }; } else { // Render zeus actions when zeus open @@ -160,7 +161,7 @@ if (count GVAR(collectedActionPoints) > 1) then { private _delta = vectorNormalized ((GVAR(collectedActionPoints) select _i select 1) vectorDiff (GVAR(collectedActionPoints) select _j select 1)); // If _i is inside a cone with 20º half angle with origin on _j - if ((_delta select 2 > 0.94) && {((GVAR(collectedActionPoints) select _i select 1) distance2d (GVAR(collectedActionPoints) select _j select 1)) < 0.1}) exitWith { + if ((_delta select 2 > 0.94) && {((GVAR(collectedActionPoints) select _i select 1) distance2D (GVAR(collectedActionPoints) select _j select 1)) < 0.1}) exitWith { GVAR(collectedActionPoints) deleteAt _i; }; }; diff --git a/addons/interact_menu/functions/fnc_renderBaseMenu.sqf b/addons/interact_menu/functions/fnc_renderBaseMenu.sqf index 9e3aaa53a92..5af5afcc7ca 100644 --- a/addons/interact_menu/functions/fnc_renderBaseMenu.sqf +++ b/addons/interact_menu/functions/fnc_renderBaseMenu.sqf @@ -46,7 +46,7 @@ if ((GVAR(openedMenuType) == 0) && {isNull (ACE_controlledUAV select 0)} && {veh if ((_distanceToBasePoint > 1.2) && {!(_params select 4)}) exitWith { // If distance to action is greater than 1.2 m and check isn't disabled in params, check LOS - lineIntersects [AGLtoASL _headPos, AGLtoASL _pos, _object, ACE_player] + lineIntersects [AGLToASL _headPos, AGLToASL _pos, _object, ACE_player] }; false }) exitWith {false}; @@ -91,7 +91,7 @@ if (_activeActionTree isEqualTo []) exitWith {false}; BEGIN_COUNTER(fnc_renderMenus); if (count _pos > 2) then { - _sPos pushBack (((AGLtoASL _pos) vectorDiff GVAR(cameraPosASL)) vectorDotProduct GVAR(cameraDir)); + _sPos pushBack (((AGLToASL _pos) vectorDiff GVAR(cameraPosASL)) vectorDotProduct GVAR(cameraDir)); } else { _sPos pushBack 0; }; diff --git a/addons/interact_menu/functions/fnc_renderIcon.sqf b/addons/interact_menu/functions/fnc_renderIcon.sqf index fffa5e91a7f..a1118b77b0c 100644 --- a/addons/interact_menu/functions/fnc_renderIcon.sqf +++ b/addons/interact_menu/functions/fnc_renderIcon.sqf @@ -27,8 +27,8 @@ if(GVAR(iconCount) > (count GVAR(iconCtrls))-1) then { private _displayNum = [[46, 12] select visibleMap, 91919] select (uiNamespace getVariable [QGVAR(cursorMenuOpened),false]); GVAR(iconCtrls) pushBack ((findDisplay _displayNum) ctrlCreate ["RscStructuredText", 54021 + GVAR(iconCount)]); if (GVAR(useCursorMenu)) then { - ((finddisplay _displayNum) displayctrl (54021 + GVAR(iconCount))) ctrlAddEventHandler ["MouseMoving", DFUNC(handleMouseMovement)]; - ((finddisplay _displayNum) displayctrl (54021 + GVAR(iconCount))) ctrlAddEventHandler ["MouseButtonDown", DFUNC(handleMouseButtonDown)]; + ((findDisplay _displayNum) displayCtrl (54021 + GVAR(iconCount))) ctrlAddEventHandler ["MouseMoving", DFUNC(handleMouseMovement)]; + ((findDisplay _displayNum) displayCtrl (54021 + GVAR(iconCount))) ctrlAddEventHandler ["MouseButtonDown", DFUNC(handleMouseButtonDown)]; }; }; private _ctrl = GVAR(iconCtrls) select GVAR(iconCount); @@ -41,16 +41,16 @@ if (_iconFile isEqualTo "") then { _text = if ([GVAR(useListMenu), GVAR(useListMenuSelf)] select GVAR(keyDownSelfAction)) then { format ["<img image='%1' align='left' color='%2'/><t %3>%4</t>", _iconFile, _iconColor, _textSettings, _text] } else { - format ["<img image='%1' align='center' color='%2'/><br/><t %3 align='center'>%4</t>", _iconFile, _iconColor, _textSettings, "ace_break_line" callExtension _text]; + format ["<img image='%1' align='center' color='%2'/><br/><t %3 align='center'>%4</t>", _iconFile, _iconColor, _textSettings, ("ace" callExtension ["break_line", [_text]]) select 0]; }; [_ctrl, GVAR(iconCount), _text] call FUNC(ctrlSetParsedTextCached); GVAR(iconCount) = GVAR(iconCount) + 1; private _pos = if ([GVAR(useListMenu), GVAR(useListMenuSelf)] select GVAR(keyDownSelfAction)) then { - [(_sPos select 0) - (0.0095 * SafeZoneW), (_sPos select 1) - (0.0095 * SafeZoneW), 0.20 * SafeZoneW, 0.035 * SafeZoneW] + [(_sPos select 0) - (0.0095 * safeZoneW), (_sPos select 1) - (0.0095 * safeZoneW), 0.20 * safeZoneW, 0.035 * safeZoneW] } else { - [(_sPos select 0) - (0.0750 * SafeZoneW), (_sPos select 1) - (0.0095 * SafeZoneW), 0.15 * SafeZoneW, 0.100 * SafeZoneW] + [(_sPos select 0) - (0.0750 * safeZoneW), (_sPos select 1) - (0.0095 * safeZoneW), 0.15 * safeZoneW, 0.100 * safeZoneW] }; diff --git a/addons/interact_menu/functions/fnc_renderSelector.sqf b/addons/interact_menu/functions/fnc_renderSelector.sqf index bf719299244..27170d9fa83 100644 --- a/addons/interact_menu/functions/fnc_renderSelector.sqf +++ b/addons/interact_menu/functions/fnc_renderSelector.sqf @@ -22,8 +22,8 @@ if(GVAR(iconCount) > (count GVAR(iconCtrls))-1) then { private _displayNum = [[46, 12] select visibleMap,91919] select (uiNamespace getVariable [QGVAR(cursorMenuOpened),false]); GVAR(iconCtrls) pushBack ((findDisplay _displayNum) ctrlCreate ["RscStructuredText", 54021+GVAR(iconCount)]); if (GVAR(useCursorMenu)) then { - ((finddisplay _displayNum) displayctrl (54021+GVAR(iconCount))) ctrlAddEventHandler ["MouseMoving", DFUNC(handleMouseMovement)]; - ((finddisplay _displayNum) displayctrl (54021+GVAR(iconCount))) ctrlAddEventHandler ["MouseButtonDown", DFUNC(handleMouseButtonDown)]; + ((findDisplay _displayNum) displayCtrl (54021+GVAR(iconCount))) ctrlAddEventHandler ["MouseMoving", DFUNC(handleMouseMovement)]; + ((findDisplay _displayNum) displayCtrl (54021+GVAR(iconCount))) ctrlAddEventHandler ["MouseButtonDown", DFUNC(handleMouseButtonDown)]; }; }; @@ -31,10 +31,10 @@ private _ctrl = GVAR(iconCtrls) select GVAR(iconCount); private _pos = if (GVAR(UseListMenu)) then { [_ctrl, GVAR(iconCount), format ["<img image='%1' color='%2' size='1.6'/>", _icon, GVAR(selectorColorHex)]] call FUNC(ctrlSetParsedTextCached); - [(_sPos select 0)-(0.014*SafeZoneW), (_sPos select 1)-(0.014*SafeZoneW), 0.05*SafeZoneW, 0.035*SafeZoneW] + [(_sPos select 0)-(0.014*safeZoneW), (_sPos select 1)-(0.014*safeZoneW), 0.05*safeZoneW, 0.035*safeZoneW] } else { [_ctrl, GVAR(iconCount), format ["<img image='%1' color='%2' size='1.6' align='center'/>", _icon, GVAR(selectorColorHex)]] call FUNC(ctrlSetParsedTextCached); - [(_sPos select 0)-(0.050*SafeZoneW), (_sPos select 1)-(0.014*SafeZoneW), 0.1*SafeZoneW, 0.035*SafeZoneW] + [(_sPos select 0)-(0.050*safeZoneW), (_sPos select 1)-(0.014*safeZoneW), 0.1*safeZoneW, 0.035*safeZoneW] }; GVAR(iconCount) = GVAR(iconCount) + 1; diff --git a/addons/interaction/CfgVehicles.hpp b/addons/interaction/CfgVehicles.hpp index 6ae0d4a9821..614cd3e0e06 100644 --- a/addons/interaction/CfgVehicles.hpp +++ b/addons/interaction/CfgVehicles.hpp @@ -78,7 +78,7 @@ class CfgVehicles { class ACE_AssignTeamRed { displayName = CSTRING(AssignTeamRed); - condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam)); + condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam) && {assignedTeam _target != 'RED'}); statement = QUOTE([ARR_3(_target,'RED',true)] call DFUNC(joinTeam)); exceptions[] = {"isNotSwimming"}; showDisabled = 1; @@ -86,7 +86,7 @@ class CfgVehicles { }; class ACE_AssignTeamGreen { displayName = CSTRING(AssignTeamGreen); - condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam)); + condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam) && {assignedTeam _target != 'GREEN'}); statement = QUOTE([ARR_3(_target,'GREEN',true)] call DFUNC(joinTeam)); exceptions[] = {"isNotSwimming"}; showDisabled = 1; @@ -94,7 +94,7 @@ class CfgVehicles { }; class ACE_AssignTeamBlue { displayName = CSTRING(AssignTeamBlue); - condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam)); + condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam) && {assignedTeam _target != 'BLUE'}); statement = QUOTE([ARR_3(_target,'BLUE',true)] call DFUNC(joinTeam)); exceptions[] = {"isNotSwimming"}; showDisabled = 1; @@ -102,14 +102,14 @@ class CfgVehicles { }; class ACE_AssignTeamYellow { displayName = CSTRING(AssignTeamYellow); - condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam)); + condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam) && {assignedTeam _target != 'YELLOW'}); statement = QUOTE([ARR_3(_target,'YELLOW',true)] call DFUNC(joinTeam)); exceptions[] = {"isNotSwimming"}; showDisabled = 1; modifierFunction = QUOTE([ARR_3('YELLOW','PATHTOF(UI\team\team_white_ca.paa)',_this select 3)] call FUNC(modifyTeamManagementAction)); }; - class ACE_UnassignTeam { - displayName = CSTRING(LeaveTeam); + class ACE_AssignTeamMain { + displayName = "$STR_assign_main"; condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam) && {assignedTeam _target != 'MAIN'}); statement = QUOTE([ARR_3(_target,'MAIN',true)] call DFUNC(joinTeam)); exceptions[] = {"isNotSwimming"}; @@ -164,7 +164,7 @@ class CfgVehicles { }; class GVAR(Gear) { displayName = "$STR_ACTION_GEAR"; - condition = QUOTE(!(lifeState _target in [ARR_2('HEALTHY','INJURED')]) && {isNull objectParent _target}); + condition = QUOTE(!(_target call EFUNC(common,isAwake)) && {isNull objectParent _target}); statement = QUOTE(_player action [ARR_2(QUOTE(QUOTE(Gear)),_target)]); icon = "\A3\ui_f\data\igui\cfg\actions\gear_ca.paa"; }; @@ -253,9 +253,16 @@ class CfgVehicles { modifierFunction = QUOTE([ARR_3(assignedTeam _target,'PATHTOF(UI\team\team_management_ca.paa)',_this select 3)] call FUNC(modifyTeamManagementAction)); showDisabled = 1; + class ACE_remoteTeamManagement { + displayName = CSTRING(Squad); + icon = QPATHTOF(UI\team\team_management_ca.paa); + condition = QUOTE(GVAR(remoteTeamManagement) && {_player == leader _player}); + exceptions[] = {"isNotSwimming", "isNotInside", "isNotSitting", "isNotOnLadder", "isNotRefueling"}; + insertChildren = QUOTE(call FUNC(addSquadChildren)); + }; class ACE_JoinTeamRed { displayName = CSTRING(JoinTeamRed); - condition = QUOTE(true); + condition = QUOTE(assignedTeam _player != 'RED'); exceptions[] = {"isNotSwimming", "isNotInside", "isNotSitting", "isNotOnLadder", "isNotRefueling"}; statement = QUOTE([ARR_3(_player,'RED',true)] call DFUNC(joinTeam)); showDisabled = 1; @@ -263,7 +270,7 @@ class CfgVehicles { }; class ACE_JoinTeamGreen { displayName = CSTRING(JoinTeamGreen); - condition = QUOTE(true); + condition = QUOTE(assignedTeam _player != 'GREEN'); exceptions[] = {"isNotSwimming", "isNotInside", "isNotSitting", "isNotOnLadder", "isNotRefueling"}; statement = QUOTE([ARR_3(_player,'GREEN',true)] call DFUNC(joinTeam)); showDisabled = 1; @@ -271,7 +278,7 @@ class CfgVehicles { }; class ACE_JoinTeamBlue { displayName = CSTRING(JoinTeamBlue); - condition = QUOTE(true); + condition = QUOTE(assignedTeam _player != 'BLUE'); exceptions[] = {"isNotSwimming", "isNotInside", "isNotSitting", "isNotOnLadder", "isNotRefueling"}; statement = QUOTE([ARR_3(_player,'BLUE',true)] call DFUNC(joinTeam)); showDisabled = 1; @@ -279,14 +286,14 @@ class CfgVehicles { }; class ACE_JoinTeamYellow { displayName = CSTRING(JoinTeamYellow); - condition = QUOTE(true); + condition = QUOTE(assignedTeam _player != 'YELLOW'); exceptions[] = {"isNotSwimming", "isNotInside", "isNotSitting", "isNotOnLadder", "isNotRefueling"}; statement = QUOTE([ARR_3(_player,'YELLOW',true)] call DFUNC(joinTeam)); showDisabled = 1; modifierFunction = QUOTE([ARR_3('YELLOW','PATHTOF(UI\team\team_white_ca.paa)',_this select 3)] call FUNC(modifyTeamManagementAction)); }; - class ACE_LeaveTeam { - displayName = CSTRING(LeaveTeam); + class ACE_JoinTeamMain { + displayName = CSTRING(JoinTeamMain); condition = QUOTE(assignedTeam _player != 'MAIN'); exceptions[] = {"isNotSwimming", "isNotInside", "isNotSitting", "isNotOnLadder", "isNotRefueling"}; statement = QUOTE([ARR_3(_player,'MAIN',true)] call DFUNC(joinTeam)); @@ -372,6 +379,39 @@ class CfgVehicles { }; class Car_F: Car {}; + class Offroad_01_base_F: Car_F { + class GVAR(anims) { + class HideBackpacks { + positions[] = {{-1.15, -1.15, -0.2}, {1.05, -1.15, -0.2}, {1.05, -2.5, -0.2}}; + items[] = {"B_TacticalPack_blk", "B_TacticalPack_blk", "B_Carryall_khk", "B_Carryall_khk"}; + name = "$STR_a3_cfgvehicleclasses_backpacks0"; + text = "$STR_a3_cfgvehicleclasses_backpacks0"; + }; + }; + }; + class Offroad_01_military_base_F: Offroad_01_base_F {}; + class Offroad_01_armed_base_F: Offroad_01_military_base_F { + class GVAR(anims): GVAR(anims) { + class HideBackpacks: HideBackpacks { + positions[] = {{-1.15, -1.03, -0.8}, {1.05, -1.03, -0.8}, {1.05, -2.38, -0.8}}; + }; + }; + }; + class Offroad_01_AT_base_F: Offroad_01_military_base_F { + class GVAR(anims): GVAR(anims) { + class HideBackpacks: HideBackpacks { + positions[] = {{-1.15, -1.25, -0.2}, {1.05, -1.25, -0.2}, {1.05, -2.6, -0.2}}; + }; + }; + }; + class Offroad_01_military_covered_base_F: Offroad_01_military_base_F { + class GVAR(anims): GVAR(anims) { + class HideBackpacks: HideBackpacks { + positions[] = {{-1.15, -1, -0.27}, {1.05, -1, -0.27}, {1.05, -2.35, -0.27}}; + }; + }; + }; + class Quadbike_01_base_F: Car_F { class ACE_Actions: ACE_Actions { class ACE_MainActions: ACE_MainActions { @@ -405,6 +445,45 @@ class CfgVehicles { }; }; + class Wheeled_APC_F; + class APC_Wheeled_01_base_F: Wheeled_APC_F { + class GVAR(anims) { + class showBags { + phase = 0; + selections[] = {"vhc_bags"}; + items[] = {"B_Carryall_cbr", "B_Carryall_cbr"}; + name = "$STR_A3_B_Carryall_cbr0"; + text = "$STR_A3_B_Carryall_cbr0"; + distance = 3; + }; + }; + }; + class APC_Wheeled_02_base_F: Wheeled_APC_F { + class GVAR(anims); + }; + class APC_Wheeled_02_base_v2_F: APC_Wheeled_02_base_F { + class GVAR(anims): GVAR(anims) { + class showBags { + phase = 0; + positions[] = {"_target selectionPosition ['vhc_bags', 'FireGeometry', 'AveragePoint']"}; + items[] = {"B_Carryall_cbr"}; + name = "$STR_A3_B_Carryall_cbr0"; + text = "$STR_A3_B_Carryall_cbr0"; + }; + }; + }; + class APC_Wheeled_03_base_F: Wheeled_APC_F { + class GVAR(anims) { + class showBags { + phase = 0; + positions[] = {"_target selectionPosition ['vhc_bags', 'FireGeometry', 'AveragePoint']"}; + items[] = {"B_Carryall_cbr", "B_Carryall_cbr"}; + name = "$STR_A3_B_Carryall_cbr0"; + text = "$STR_A3_B_Carryall_cbr0"; + }; + }; + }; + class Tank: LandVehicle { class ACE_Actions { class ACE_MainActions { @@ -432,6 +511,82 @@ class CfgVehicles { }; }; }; + class Tank_F; + class LT_01_base_F: Tank_F { + class GVAR(anims) { + class showBags { + phase = 0; + positions[] = {"_target selectionPosition ['vhc_bags', 'FireGeometry', 'AveragePoint']"}; + items[] = {"B_Carryall_cbr"}; + name = "$STR_A3_B_Carryall_cbr0"; + text = "$STR_A3_B_Carryall_cbr0"; + }; + class showBags2: showBags { + positions[] = {"_target selectionPosition ['vhc_bags2', 'FireGeometry', 'AveragePoint']"}; + }; + }; + }; + + class APC_Tracked_01_base_F: Tank_F { + class GVAR(anims) { + class showBags { + phase = 0; + selections[] = {"vhc_bags"}; + positions[] = {"private _pos = _target selectionPosition 'vhc_bags'; _pos set [0, -(_pos select 0)]; _pos"}; // Mirror position to other side of vehicle + items[] = {"B_Carryall_cbr", "B_Carryall_cbr", "B_Carryall_cbr", "B_Carryall_cbr", "B_Carryall_cbr"}; + name = "$STR_A3_B_Carryall_cbr0"; + text = "$STR_A3_B_Carryall_cbr0"; + }; + }; + }; + class B_APC_Tracked_01_base_F: APC_Tracked_01_base_F {}; + class B_APC_Tracked_01_CRV_F: B_APC_Tracked_01_base_F { + class GVAR(anims): GVAR(anims) { + class showBags: showBags { + items[] = {"B_Carryall_cbr", "B_Carryall_cbr", "B_Carryall_cbr", "B_Carryall_cbr"}; + }; + }; + }; + + class APC_Tracked_02_base_F: Tank_F { + class GVAR(anims) { + class showBags { + phase = 0; + selections[] = {"vhc_bags"}; + items[] = {"B_Carryall_cbr", "B_Carryall_cbr", "B_Carryall_cbr"}; + name = "$STR_A3_B_Carryall_cbr0"; + text = "$STR_A3_B_Carryall_cbr0"; + }; + }; + }; + + class APC_Tracked_03_base_F: Tank_F { + class GVAR(anims) { + class showBags { + phase = 0; + selections[] = {"vhc_bags"}; + items[] = {"B_Carryall_cbr", "B_Carryall_cbr"}; + name = "$STR_A3_B_Carryall_cbr0"; + text = "$STR_A3_B_Carryall_cbr0"; + }; + }; + }; + + class MBT_01_base_F: Tank_F { + class GVAR(anims); + }; + class B_MBT_01_base_F: MBT_01_base_F {}; + class B_MBT_01_cannon_F: B_MBT_01_base_F { + class GVAR(anims): GVAR(anims) { + class showBags { + phase = 0; + selections[] = {"vhc_bags"}; + items[] = {"B_Carryall_cbr", "B_Carryall_cbr", "B_Carryall_cbr", "B_Carryall_cbr", "B_Carryall_cbr", "B_Carryall_cbr"}; + name = "$STR_A3_B_Carryall_cbr0"; + text = "$STR_A3_B_Carryall_cbr0"; + }; + }; + }; class Motorcycle: LandVehicle { class ACE_Actions { diff --git a/addons/interaction/RscTitles.hpp b/addons/interaction/RscTitles.hpp index ec7856c62cb..d2f2f0ef92c 100644 --- a/addons/interaction/RscTitles.hpp +++ b/addons/interaction/RscTitles.hpp @@ -13,8 +13,8 @@ class ACE_Interaction_Button_Base { style = 2; x = 0; y = 0; - w = "2.0 / 16 * safezoneW"; - h = "0.3 / 9 * safezoneH"; + w = "2.0 / 16 * safeZoneW"; + h = "0.3 / 9 * safeZoneH"; offsetX = 0.003; offsetY = 0.003; diff --git a/addons/interaction/XEH_PREP.hpp b/addons/interaction/XEH_PREP.hpp index 554f9037047..63053fd5122 100644 --- a/addons/interaction/XEH_PREP.hpp +++ b/addons/interaction/XEH_PREP.hpp @@ -13,6 +13,7 @@ PREP(showMouseHint); PREP(hideMouseHint); // interaction with units +PREP(addSquadChildren); PREP(canInteractWithCivilian); PREP(canInteractWithVehicleCrew); PREP(getDown); @@ -54,4 +55,5 @@ PREP(push); // misc PREP(canFlip); +PREP(initAnimActions); PREP(replaceTerrainObject); diff --git a/addons/interaction/XEH_postInit.sqf b/addons/interaction/XEH_postInit.sqf index f461e2a770e..d341c27fd38 100644 --- a/addons/interaction/XEH_postInit.sqf +++ b/addons/interaction/XEH_postInit.sqf @@ -149,11 +149,20 @@ GVAR(isOpeningDoor) = false; ["isNotOnLadder", {getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> animationState (_this select 0) >> "ACE_isLadder") != 1}] call EFUNC(common,addCanInteractWithCondition); ["CBA_settingsInitialized", { + TRACE_2("settingsInitialized",GVAR(disableNegativeRating),GVAR(enableAnimActions)); + if (GVAR(disableNegativeRating)) then { player addEventHandler ["HandleRating", { (_this select 1) max 0 }]; }; + + if (!GVAR(enableAnimActions)) exitWith {}; + + // Don't add inherited anim actions (but actions are added to child classes) + { + [_x, "InitPost", LINKFUNC(initAnimActions), true, [], true] call CBA_fnc_addClassEventHandler; + } forEach (keys (uiNamespace getVariable QGVAR(animActionsClasses))); }] call CBA_fnc_addEventHandler; { @@ -162,8 +171,8 @@ GVAR(isOpeningDoor) = false; }] call CBA_fnc_addPlayerEventHandler; } forEach ["loadout", "weapon"]; - // add "Take _weapon_" action to dropped weapons +//IGNORE_PRIVATE_WARNING ["_target", "_player"]; private _action = [ // action display name will be overwritten in modifier function QGVAR(takeWeapon), "take", "\A3\ui_f\data\igui\cfg\actions\take_ca.paa", @@ -172,7 +181,7 @@ private _action = [ nil, nil, nil, nil, nil, { params ["_target", "", "", "_actionData"]; - _actionData set [1, format [localize "STR_ACTION_TAKE_BAG", getText (configfile >> "CfgWeapons" >> weaponCargo _target select 0 >> "displayName")]]; + _actionData set [1, format [localize "STR_ACTION_TAKE_BAG", getText (configFile >> "CfgWeapons" >> weaponCargo _target select 0 >> "displayName")]]; } ] call EFUNC(interact_menu,createAction); diff --git a/addons/interaction/XEH_preInit.sqf b/addons/interaction/XEH_preInit.sqf index c5873bcfc98..ec73b62b1b9 100644 --- a/addons/interaction/XEH_preInit.sqf +++ b/addons/interaction/XEH_preInit.sqf @@ -16,6 +16,7 @@ DFUNC(repair_Statement) = { // moved from config because of build problems }; if (hasInterface) then { + GVAR(initializedAnimClasses) = []; GVAR(replaceTerrainModels) = createHashMapFromArray call (uiNamespace getVariable QGVAR(cacheReplaceTerrainModels)); }; diff --git a/addons/interaction/XEH_preStart.sqf b/addons/interaction/XEH_preStart.sqf index 331b5c6d36c..39da54b3b58 100644 --- a/addons/interaction/XEH_preStart.sqf +++ b/addons/interaction/XEH_preStart.sqf @@ -23,3 +23,13 @@ private _cacheReplaceTerrainModels = createHashMap; } forEach _replaceTerrainClasses; uiNamespace setVariable [QGVAR(cacheReplaceTerrainModels), compileFinal str _cacheReplaceTerrainModels]; + + +// Cache classes with anim actions +private _animActionsClasses = (QUOTE(isClass (_x >> QQGVAR(anims)) && {!isClass (inheritsFrom _x >> QQGVAR(anims))}) configClasses (configFile >> "CfgVehicles")); +_animActionsClasses = _animActionsClasses apply { configName _x }; +_animActionsClasses = _animActionsClasses select { + private _class = _x; + (_animActionsClasses findIf {(_class != _x) && {_class isKindOf _x}}) == -1 // filter classes that already have a parent in the list +}; +uiNamespace setVariable [QGVAR(animActionsClasses), compileFinal (_animActionsClasses createHashMapFromArray [])]; diff --git a/addons/interaction/dev/initReplaceTerrainCursorObject.sqf b/addons/interaction/dev/initReplaceTerrainCursorObject.sqf index a1708be423d..6dadf678b7c 100644 --- a/addons/interaction/dev/initReplaceTerrainCursorObject.sqf +++ b/addons/interaction/dev/initReplaceTerrainCursorObject.sqf @@ -47,12 +47,12 @@ DFUNC(replaceTerrainModelsAdd) = { ) then { // wait while server replaces object, then init dragging on all clients [{ - if (typeOf cursorObject == "") exitwith {}; - [cursorObject, { - if !hasInterface exitWith {}; - [_this, true] call EFUNC(dragging,setDraggable); - [_this, true] call EFUNC(dragging,setCarryable); - }] remoteExec ["call", 0]; + private _object = cursorObject; + + if (isNull _object) exitWith {}; + + [_object, true, nil, nil, nil, true] call EFUNC(dragging,setCarryable); + [_object, true, nil, nil, nil, true] call EFUNC(dragging,setDraggable); }, [], 1] call CBA_fnc_waitAndExecute; }; true diff --git a/addons/interaction/functions/fnc_addPassengersActions.sqf b/addons/interaction/functions/fnc_addPassengersActions.sqf index 50b0d98a21c..4a88485a3f1 100644 --- a/addons/interaction/functions/fnc_addPassengersActions.sqf +++ b/addons/interaction/functions/fnc_addPassengersActions.sqf @@ -41,6 +41,7 @@ private _icon = ""; _icon = QPATHTOEF(captives,UI\handcuff_ca.paa); }; + //IGNORE_PRIVATE_WARNING ["_target"]; _actions pushBack [ [ str _unit, diff --git a/addons/interaction/functions/fnc_addSquadChildren.sqf b/addons/interaction/functions/fnc_addSquadChildren.sqf new file mode 100644 index 00000000000..a34c2e884c3 --- /dev/null +++ b/addons/interaction/functions/fnc_addSquadChildren.sqf @@ -0,0 +1,52 @@ +#include "..\script_component.hpp" +/* + * Author: PabstMirror + * Gets the squad child actions + * + * Arguments: + * 1: Player <OBJECT> + * + * Return Value: + * Children actions <ARRAY> + * + * Example: + * [player, player] call ace_interaction_fnc_addSquadChildren + * + * Public: No + */ + +params ["", "_player"]; + +private _fnc_color = { + (switch (toUpper _this) do { + case "RED": {missionNamespace getVariable [QEGVAR(nametags,nametagColorRed), [221, 0, 0]]}; + case "GREEN": {missionNamespace getVariable [QEGVAR(nametags,nametagColorGreen), [0, 221, 0]]}; + case "BLUE": {missionNamespace getVariable [QEGVAR(nametags,nametagColorBlue), [0, 0, 221]]}; + case "YELLOW": {missionNamespace getVariable [QEGVAR(nametags,nametagColorYellow), [221, 221, 0]]}; + default {missionNamespace getVariable [QEGVAR(nametags,nametagColorMain), [255, 255, 255]]}; + }) call BIS_fnc_colorRGBtoHTML +}; + +private _units = (units group _player) - [_player]; + +//IGNORE_PRIVATE_WARNING ["_target"]; +private _subActions = []; +_subActions pushBack (["drop", localize "str_a3_endgame_notifications_title_drop", "\a3\ui_f\data\igui\cfg\actions\ico_off_ca.paa", + {[_target] joinSilent grpNull}, {true}] call EFUNC(interact_menu,createAction)); + +{ + private _icon = [QPATHTOF(UI\team\team_white_ca.paa), _x call _fnc_color]; + private _name = localize format ["str_assign_%1", _x]; + _subActions pushBack ([_x, _name, _icon, + {[_target, _this#2] call FUNC(joinTeam)}, {assignedTeam _target != _this#2}, {}, _x] call EFUNC(interact_menu,createAction)); +} forEach ["RED", "GREEN", "BLUE", "YELLOW", "MAIN"]; + +private _actions = _units apply { + private _unit = _x; + private _icon = [QPATHTOF(UI\team\team_white_ca.paa), (assignedTeam _unit) call _fnc_color]; + private _actionUnit = [hashValue _x, [_x, true] call EFUNC(common,getName), _icon, {}, {true}] call EFUNC(interact_menu,createAction); + + [_actionUnit, _subActions apply { [_x, [], _unit] }, _unit] +}; + +_actions diff --git a/addons/interaction/functions/fnc_canInteractWithVehicleCrew.sqf b/addons/interaction/functions/fnc_canInteractWithVehicleCrew.sqf index a314a8b601a..e8b7e47d754 100644 --- a/addons/interaction/functions/fnc_canInteractWithVehicleCrew.sqf +++ b/addons/interaction/functions/fnc_canInteractWithVehicleCrew.sqf @@ -11,13 +11,16 @@ * Unit can interact with vehicle crew <BOOL> * * Example: - * [cursorObject, player] call ace_interaction_fnc_canInteractWithVehicleCrew + * [player, cursorObject] call ace_interaction_fnc_canInteractWithVehicleCrew * * Public: No */ params ["_player", "_vehicle"]; +if (GVAR(interactWithEnemyCrew) == 2) exitWith { true }; +if ((GVAR(interactWithEnemyCrew) == 1) && {_vehicle isKindOf "StaticWeapon"}) exitWith { true }; + private _crew = crew _vehicle; // If vehicle is empty, quit diff --git a/addons/interaction/functions/fnc_doRemoteControl.sqf b/addons/interaction/functions/fnc_doRemoteControl.sqf index a2ec19b1801..d728190b3e3 100644 --- a/addons/interaction/functions/fnc_doRemoteControl.sqf +++ b/addons/interaction/functions/fnc_doRemoteControl.sqf @@ -13,6 +13,7 @@ * * Public: No */ +//IGNORE_PRIVATE_WARNING ["_target"]; private _units = curatorSelected select 0; private _index = _units findIf { diff --git a/addons/interaction/functions/fnc_getVehiclePos.sqf b/addons/interaction/functions/fnc_getVehiclePos.sqf index ce2ce9377b7..d90bc228d2d 100644 --- a/addons/interaction/functions/fnc_getVehiclePos.sqf +++ b/addons/interaction/functions/fnc_getVehiclePos.sqf @@ -14,7 +14,7 @@ * * Public: No */ -// IGNORE_PRIVATE_WARNING(_target); +//IGNORE_PRIVATE_WARNING ["_target"]; private _bb = boundingBoxReal _target; (_bb select 0) params ["_bbX", "_bbY", "_bbZ"]; diff --git a/addons/interaction/functions/fnc_getWeaponAttachmentsActions.sqf b/addons/interaction/functions/fnc_getWeaponAttachmentsActions.sqf index c771589904f..e91a027068c 100644 --- a/addons/interaction/functions/fnc_getWeaponAttachmentsActions.sqf +++ b/addons/interaction/functions/fnc_getWeaponAttachmentsActions.sqf @@ -1,6 +1,6 @@ #include "..\script_component.hpp" /* - * Author: mharis001, Dystopian + * Author: mharis001, Dystopian, PabstMirror, johnb43 * Returns children actions for weapon attachment switching. * * Arguments: @@ -21,48 +21,115 @@ params ["_unit"]; params ["_unit"]; private _currentWeapon = currentWeapon _unit; - if (_currentWeapon isEqualTo "") exitWith {[]}; - private _weaponItems = _unit weaponAccessories _currentWeapon; + + if (_currentWeapon == "") exitWith {[]}; + private _cfgWeapons = configFile >> "CfgWeapons"; - private _actions = []; + private _weaponItems = _unit weaponAccessories _currentWeapon; - // "attach" actions - private _items = _unit call EFUNC(common,uniqueItems); - private _compatibleItems = _currentWeapon call CBA_fnc_compatibleItems; - { - private _config = _cfgWeapons >> _x; - private _name = format [LLSTRING(weaponAttachmentsAttach), getText (_config >> "displayName")]; - private _picture = getText (_config >> "picture"); - private _type = getNumber (_config >> "itemInfo" >> "type"); - private _oldAttachment = _weaponItems select ([TYPE_MUZZLE, TYPE_FLASHLIGHT, TYPE_OPTICS, TYPE_BIPOD] find _type); - - private _action = [ - _x, _name, _picture, - LINKFUNC(switchWeaponAttachment), - {true}, - {}, - [_currentWeapon, _x, _oldAttachment] - ] call EFUNC(interact_menu,createAction); - _actions pushBack [_action, [], _unit]; - } forEach ((_items arrayIntersect _compatibleItems) - _weaponItems); - - // "detach" actions - { - if (_x isEqualTo "") then {continue}; + // Get current weapon attachments, as well as compatible attachments in inventory + private _allAttachments = (+_weaponItems) - [""]; + _allAttachments append ((_unit call EFUNC(common,uniqueItems)) arrayIntersect (compatibleItems _currentWeapon)); + (_allAttachments arrayIntersect _allAttachments) apply { private _config = _cfgWeapons >> _x; - private _name = format [LLSTRING(weaponAttachmentsDetach), getText (_config >> "displayName")]; + private _name = getText (_config >> "displayName"); private _picture = getText (_config >> "picture"); - private _action = [ - _x, _name, _picture, - LINKFUNC(switchWeaponAttachment), - {true}, - {}, - [_currentWeapon, "", _x] - ] call EFUNC(interact_menu,createAction); - _actions pushBack [_action, [], _unit]; - } forEach _weaponItems; - - _actions + [ + [ + _x, + _name, + _picture, + {}, + {true}, + { + params ["", "_unit", "_args"]; + _args params ["_attachment", "_name", "_picture", "_weaponItems", "_currentWeapon"]; + + private _cfgWeapons = configFile >> "CfgWeapons"; + private _attachmentNotOnGun = !(_attachment in _weaponItems); + private _actions = []; + + // "attach" action + if (_attachmentNotOnGun && {[_unit, _attachment] call EFUNC(common,hasItem)}) then { + private _type = getNumber (_cfgWeapons >> _attachment >> "itemInfo" >> "type"); + private _currentAttachment = _weaponItems select ([TYPE_MUZZLE, TYPE_FLASHLIGHT, TYPE_OPTICS, TYPE_BIPOD] find _type); + + _actions pushBack [ + [ + QGVAR(attach_) + _attachment, + LLSTRING(weaponAttachmentsAttach), + _picture, + LINKFUNC(switchWeaponAttachment), + {true}, + {}, + [_currentWeapon, _attachment, _currentAttachment] + ] call EFUNC(interact_menu,createAction), + [], + _unit + ]; + }; + + // Don't show interaction with attachments that aren't on the current weapon + if (_attachmentNotOnGun) exitWith {_actions}; + + // "detach" action + _actions pushBack [ + [ + QGVAR(detach_) + _attachment, + LLSTRING(weaponAttachmentsDetach), + _picture, + LINKFUNC(switchWeaponAttachment), + {true}, + {}, + [_currentWeapon, "", _attachment] + ] call EFUNC(interact_menu,createAction), + [], + _unit + ]; + + private _CBA_PIPItems = configFile >> "CBA_PIPItems"; + + // "switch" action + { + // Ignore 2D scopes when using a PIP scope (e.g. CUP uses this) + if (getText (_CBA_PIPItems >> _x) == _attachment) then { + continue; + }; + + private _config = _cfgWeapons >> _x; + private _modeName = getText (_config >> "MRT_SwitchItemHintText"); + + if (_modeName == "") then { + _modeName = getText (_config >> "displayName"); + }; + + _actions pushBack [ + [ + QGVAR(switch_) + _x, + format ["%1: %2", localize "str_sensortype_switch", _modeName], + getText (_config >> "picture"), + { + params ["", "_unit", "_actionParams"]; + _actionParams params ["_weapon", "_newAttachment", "_oldAttachment"]; + [_unit, _weapon, _oldAttachment, _newAttachment] call EFUNC(common,switchAttachmentMode); + }, + {true}, + {}, + [_currentWeapon, _x, _attachment] + ] call EFUNC(interact_menu,createAction), + [], + _unit + ]; + } forEach ((_attachment call CBA_fnc_switchableAttachments) - [_attachment]); // Don't allow switching to current mode + + _actions + }, + [_x, _name, _picture, _weaponItems, _currentWeapon] + ] call EFUNC(interact_menu,createAction), + [], + _unit + ] + } // return }, _unit, QGVAR(weaponAttachmentsActions), 5, QGVAR(clearWeaponAttachmentsActionsCache)] call EFUNC(common,cachedCall); diff --git a/addons/interaction/functions/fnc_getWeaponPos.sqf b/addons/interaction/functions/fnc_getWeaponPos.sqf index 85cb3dc0076..429a012ec4d 100644 --- a/addons/interaction/functions/fnc_getWeaponPos.sqf +++ b/addons/interaction/functions/fnc_getWeaponPos.sqf @@ -14,7 +14,7 @@ * * Public: No */ -// IGNORE_PRIVATE_WARNING(_target); +//IGNORE_PRIVATE_WARNING ["_target"]; private _weaponDir = _target weaponDirection currentWeapon _target; private _refSystem = _weaponDir call EFUNC(common,createOrthonormalReference); diff --git a/addons/interaction/functions/fnc_initAnimActions.sqf b/addons/interaction/functions/fnc_initAnimActions.sqf new file mode 100644 index 00000000000..e47f80008b8 --- /dev/null +++ b/addons/interaction/functions/fnc_initAnimActions.sqf @@ -0,0 +1,202 @@ +#include "..\script_component.hpp" +/* + * Author: Dystopian + * Initializes object interactions based on animations. + * + * Arguments: + * 0: Target <OBJECT> + * + * Return Value: + * None + * + * Example: + * cursorObject call ace_interaction_fnc_initAnimActions + * + * Public: No + */ + +params ["_object"]; + +private _class = typeOf _object; + +if (_class in GVAR(initializedAnimClasses)) exitWith {}; + +GVAR(initializedAnimClasses) pushBack _class; + +private _statement = { + params ["_target", "_player", "_params"]; + _params params ["_anim", "_phase", "_duration", "_text"]; + TRACE_5("statement",_target,_player,_anim,_phase,_duration); + + [ + _duration, + [_target, _player, _anim, _phase], + { + (_this select 0) params ["_target", "_player", "_anim", "_phase"]; + + private _items = _target getVariable [ + format [QGVAR(animsItems_%1), _anim], + getArray (configOf _target >> QGVAR(anims) >> _anim >> "items") + ]; + + // If 1 object was spawned in, consider it a success + private _success = false; + + if (_items isNotEqualTo []) then { + if (_items isEqualType "") then { + _items = [_items]; + }; + + private _weaponHolder = objNull; + + { + private _type = (_x call EFUNC(common,getItemType)) select 0; + + if (_type == "") then { + private _emptyPosAGL = []; + + // This covers testing vehicle stability and finding a safe position + for "_i" from 1 to 3 do { + _emptyPosAGL = [_target, _x, _player] call EFUNC(common,findUnloadPosition); + + if (_emptyPosAGL isNotEqualTo []) exitWith {}; + }; + + // If still no valid position, try the next item + if (_emptyPosAGL isEqualTo []) then { + [LELSTRING(common,NoRoomToUnload)] call EFUNC(common,displayTextStructured); + + continue; + }; + + private _object = createVehicle [_x, _emptyPosAGL, [], 0, "CAN_COLLIDE"]; + + if (!isNull _object) then { + // Prevent items from taking damage when unloaded + [_object, "blockDamage", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); + [EFUNC(common,statusEffect_set), [_object, "blockDamage", QUOTE(ADDON), false], 2] call CBA_fnc_waitAndExecute; + + _success = true; + } else { + WARNING_1("Failed to create object of type '%1'",_x); + }; + + continue; + }; + + // Functions/code below are guaranteed to spawn in objects + _success = true; + + // getItemType considers backpacks as weapons, so handle them first + if (getNumber (configFile >> "CfgVehicles" >> _x >> "isBackpack") == 1) then { + if (backpack _player == "") then { + _player addBackpackGlobal _x; + } else { + if (isNull _weaponHolder) then { + _weaponHolder = nearestObject [_player, "WeaponHolder"]; + + if (isNull _weaponHolder || {_player distance _weaponHolder > 2}) then { + _weaponHolder = createVehicle ["GroundWeaponHolder", [0, 0, 0], [], 0, "NONE"]; + _weaponHolder setPosASL getPosASL _player; + }; + }; + + _weaponHolder addBackpackCargoGlobal [_x, 1]; + }; + + continue; + }; + + switch (_type) do { + case "weapon": { + [_player, _x, true] call CBA_fnc_addWeapon; + }; + case "item": { + [_player, _x, true] call CBA_fnc_addItem; + }; + case "magazine": { + [_player, _x, -1, true] call CBA_fnc_addMagazine; + }; + }; + } forEach _items; + } else { + [LELSTRING(common,disabled)] call EFUNC(common,displayTextStructured); + }; + + if (!_success) exitWith {}; + + _target animate [_anim, _phase, true]; + }, + {}, + _text, + { + (_this select 0) params ["_target", "", "_anim", "_phase"]; + + _target animationPhase _anim != _phase + }, + ["isNotSwimming"] + ] call EFUNC(common,progressBar); +}; + +private _condition = { + params ["_target", "_player", "_params"]; + _params params ["_anim", "_phase"]; + + _target animationPhase _anim != _phase + && {[_player, _target, ["isNotSwimming"]] call EFUNC(common,canInteractWith)} +}; + +private _config = configOf _object; + +{ + private _animConfig = _x; + private _anim = configName _animConfig; + + private _animationSourcesConfig = _config >> "AnimationSources" >> _anim; + + if !( + isClass _animationSourcesConfig // anim exist + && {0 != [_animationSourcesConfig >> "scope", "NUMBER", 1] call CBA_fnc_getConfigEntry} // anim not hidden + && {isNumber (_animationSourcesConfig >> "initPhase")} // anim correct (some CUP anims are inherited and cleared) + && {0 != [_animConfig >> "enabled", "NUMBER", 1] call CBA_fnc_getConfigEntry} // anim enabled + ) then {continue}; + + private _positions = []; + { + if (_x isEqualType "") then { + _positions pushBack compile _x; + } else { + _positions pushBack _x; + }; + } forEach getArray (_animConfig >> "positions"); + + _positions append getArray (_animConfig >> "selections"); + + if (_positions isEqualTo []) then { + ERROR_2("No action position for _class %1 anim %2",_class,_anim); + continue; + }; + + private _phase = [_animConfig >> "phase", "NUMBER", 1] call CBA_fnc_getConfigEntry; + private _name = [_animConfig >> "name", "TEXT", localize "str_a3_cfgactions_unmountitem0"] call CBA_fnc_getConfigEntry; + private _icon = [_animConfig >> "icon", "TEXT", "\A3\ui_f\data\igui\cfg\actions\take_ca.paa"] call CBA_fnc_getConfigEntry; + private _duration = [_animConfig >> "duration", "NUMBER", 10] call CBA_fnc_getConfigEntry; + private _text = getText (_animConfig >> "text"); + private _distance = [_animConfig >> "distance", "NUMBER", 2] call CBA_fnc_getConfigEntry; + + { + private _action = [ + format [QGVAR(anim_%1_%2), _anim, _forEachIndex], + _name, + _icon, + _statement, + _condition, + {}, + [_anim, _phase, _duration, _text], + _x, + _distance + ] call EFUNC(interact_menu,createAction); + [_class, 0, [], _action] call EFUNC(interact_menu,addActionToClass); + TRACE_3("add anim",_class,_anim,_x); + } forEach _positions; +} forEach configProperties [_config >> QGVAR(anims), "isClass _x"]; diff --git a/addons/interaction/functions/fnc_joinTeam.sqf b/addons/interaction/functions/fnc_joinTeam.sqf index 977e9022229..0d1928eb2fc 100644 --- a/addons/interaction/functions/fnc_joinTeam.sqf +++ b/addons/interaction/functions/fnc_joinTeam.sqf @@ -22,16 +22,8 @@ params ["_unit", "_team", ["_displayHint", false, [false]]]; _unit assignTeam _team; // display message -if (_unit == ACE_player) then { - private _message = ""; - - if (_team == "MAIN") then { - _message = localize LSTRING(LeftTeam); - } else { - _team = localize format [LSTRING(Team%1), _team]; - _message = format [localize LSTRING(JoinedTeam), _team]; - }; - if (_displayHint) then { - [_message] call EFUNC(common,displayTextStructured); - }; +if (_displayHint && {_unit == ACE_player}) then { + private _team = localize format ["str_team_%1", _team]; + private _message = format [LLSTRING(JoinedTeam), _team]; + [_message] call EFUNC(common,displayTextStructured); }; diff --git a/addons/interaction/functions/fnc_modifyJoinGroupAction.sqf b/addons/interaction/functions/fnc_modifyJoinGroupAction.sqf index eef77dfd37d..9eeda7ee3c4 100644 --- a/addons/interaction/functions/fnc_modifyJoinGroupAction.sqf +++ b/addons/interaction/functions/fnc_modifyJoinGroupAction.sqf @@ -20,7 +20,7 @@ params ["_target", "_player", "", "_actionData"]; -private _actionText = format ["%1: %2", localize LSTRING(JoinGroup), groupID group _target]; +private _actionText = format ["%1: %2", localize LSTRING(JoinGroup), groupId group _target]; TRACE_3("",_target,group _target,_actionText); _actionData set [1, _actionText]; diff --git a/addons/interaction/functions/fnc_openDoor.sqf b/addons/interaction/functions/fnc_openDoor.sqf index 11b9c67c918..f83cc88b1ec 100644 --- a/addons/interaction/functions/fnc_openDoor.sqf +++ b/addons/interaction/functions/fnc_openDoor.sqf @@ -89,9 +89,9 @@ GVAR(usedScrollWheel) = false; }; // this allows for holding the door in it's current state. - if (CBA_missionTime > _time && {diag_frameno > _frame}) then { + if (CBA_missionTime > _time && {diag_frameNo > _frame}) then { GVAR(usedScrollWheel) = true; }; // do incremental door opening {_house animate [_x, GVAR(doorTargetPhase)]} forEach _animations; -}, 0.1, [_house, _animations, getPosASL ACE_player, CBA_missionTime + 0.2, diag_frameno + 2, _door]] call CBA_fnc_addPerFrameHandler; +}, 0.1, [_house, _animations, getPosASL ACE_player, CBA_missionTime + 0.2, diag_frameNo + 2, _door]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/interaction/functions/fnc_passMagazine.sqf b/addons/interaction/functions/fnc_passMagazine.sqf index 87500785026..757700ce8ba 100644 --- a/addons/interaction/functions/fnc_passMagazine.sqf +++ b/addons/interaction/functions/fnc_passMagazine.sqf @@ -34,7 +34,7 @@ private _magToPassIndex = 0; _magToPass = _x; _magToPassIndex = _forEachIndex; }; -} foreach _filteredMags; +} forEach _filteredMags; //remove the magazine from _player and add it to _target _magToPass params ["_magToPassClassName", "_magToPassAmmoCount"]; diff --git a/addons/interaction/functions/fnc_renameGroup.sqf b/addons/interaction/functions/fnc_renameGroup.sqf index 4ffff5771a1..8ad606a1eb1 100644 --- a/addons/interaction/functions/fnc_renameGroup.sqf +++ b/addons/interaction/functions/fnc_renameGroup.sqf @@ -20,12 +20,12 @@ params [ ["_group", grpNull, [grpNull]], ["_newName", "", [""]] ]; -if (_newName isEqualTo (groupID _group)) exitWith {true}; +if (_newName isEqualTo (groupId _group)) exitWith {true}; private _lowerName = toLower _newName; // Case insensitive name search private _nameAlreadyTaken = allGroups findIf { side _x isEqualTo side _group - && {_lowerName isEqualTo toLower (groupID _x)} + && {_lowerName isEqualTo toLower (groupId _x)} && {_group != _x} } != -1; diff --git a/addons/interaction/functions/fnc_renameGroupUI.sqf b/addons/interaction/functions/fnc_renameGroupUI.sqf index 5d891b0cf8e..9e0973327da 100644 --- a/addons/interaction/functions/fnc_renameGroupUI.sqf +++ b/addons/interaction/functions/fnc_renameGroupUI.sqf @@ -21,7 +21,7 @@ private _display = findDisplay 46 createDisplay QGVAR(groupNameDisplay); private _textCtrl = _display displayCtrl 451; - _textCtrl ctrlSetText (groupID group _unit); + _textCtrl ctrlSetText (groupId group _unit); _display setVariable [QGVAR(renamedGroup), group _unit]; _display displayAddEventHandler ["Unload", { params ["_display", "_exitCode"]; diff --git a/addons/interaction/functions/fnc_switchWeaponAttachment.sqf b/addons/interaction/functions/fnc_switchWeaponAttachment.sqf index aaefb3315ed..6fede349624 100644 --- a/addons/interaction/functions/fnc_switchWeaponAttachment.sqf +++ b/addons/interaction/functions/fnc_switchWeaponAttachment.sqf @@ -4,9 +4,12 @@ * Switches weapon attachment. * * Arguments: - * 0: Target <OBJECT> - * 1: Player (not used) <OBJECT> + * 0: Target (not used) <OBJECT> + * 1: Player <OBJECT> * 2: Action params <ARRAY> + * - 0: Weapon <STRING> + * - 1: New Attachment <STRING> + * - 2: Old Attachment <STRING> * * Return Value: * None @@ -17,11 +20,13 @@ * Public: No */ -params ["_unit", "", "_actionParams"]; +params ["", "_unit", "_actionParams"]; _actionParams params ["_weapon", "_newAttachment", "_oldAttachment"]; TRACE_3("Switching attachment",_weapon,_newAttachment,_oldAttachment); -[_unit, "Gear"] call EFUNC(common,doGesture); +private _currWeaponType = [_unit, _weapon] call EFUNC(common,getWeaponIndex); + +if (_currWeaponType == -1) exitWith {}; private _addNew = _newAttachment isNotEqualTo ""; private _removeOld = _oldAttachment isNotEqualTo ""; @@ -38,22 +43,33 @@ if (_removeOld && {!([_unit, _oldAttachment] call CBA_fnc_canAddItem)}) exitWith }; }; +[_unit, "Gear"] call EFUNC(common,doGesture); + if (_removeOld) then { [{ - params ["_unit", "_weapon", "_oldAttachment"]; - switch (_weapon) do { - case (primaryWeapon _unit): {_unit removePrimaryWeaponItem _oldAttachment;}; - case (handgunWeapon _unit): {_unit removeHandgunItem _oldAttachment;}; - default {_unit removeSecondaryWeaponItem _oldAttachment;}; + params ["_unit", "_currWeaponType", "_oldAttachment"]; + + switch (_currWeaponType) do { + case 0: {_unit removePrimaryWeaponItem _oldAttachment}; + case 1: {_unit removeSecondaryWeaponItem _oldAttachment}; + case 2: {_unit removeHandgunItem _oldAttachment}; + default {}; }; + _unit addItem _oldAttachment; - }, [_unit, _weapon, _oldAttachment], 0.3] call CBA_fnc_waitAndExecute; + }, [_unit, _currWeaponType, _oldAttachment], 0.3] call CBA_fnc_waitAndExecute; }; if (!_addNew) exitWith {}; [{ params ["_unit", "_weapon", "_newAttachment"]; + _unit addWeaponItem [_weapon, _newAttachment]; + + if (_unit != ACE_player) exitWith {}; + [[getText (configFile >> "CfgWeapons" >> _newAttachment >> "picture"), 4], true] call CBA_fnc_notify; + + playSound "click"; }, [_unit, _weapon, _newAttachment], 1] call CBA_fnc_waitAndExecute; diff --git a/addons/interaction/groupRename_GUI.hpp b/addons/interaction/groupRename_GUI.hpp index 20684b0e463..977b9b3efda 100644 --- a/addons/interaction/groupRename_GUI.hpp +++ b/addons/interaction/groupRename_GUI.hpp @@ -1,4 +1,4 @@ -#define FONT_H (((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1) +#define FONT_H (((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) * 1) #define FONT_W (FONT_H / pixelH * pixelW) #define GAP_W (pixelW * 2) #define GAP_H (pixelH * 2) diff --git a/addons/interaction/initSettings.inc.sqf b/addons/interaction/initSettings.inc.sqf index 2cefb162a76..f634b44313f 100644 --- a/addons/interaction/initSettings.inc.sqf +++ b/addons/interaction/initSettings.inc.sqf @@ -6,6 +6,14 @@ true ] call CBA_fnc_addSetting; +[ + QGVAR(remoteTeamManagement), "CHECKBOX", + [LSTRING(remoteTeamManagement_DisplayName), LSTRING(remoteTeamManagement_Description)], + format ["ACE %1", LLSTRING(DisplayName)], + true, + true +] call CBA_fnc_addSetting; + [ QGVAR(enableMagazinePassing), "CHECKBOX", LSTRING(PassMagazineSetting), @@ -38,6 +46,16 @@ true ] call CBA_fnc_addSetting; +[ + QGVAR(enableAnimActions), "CHECKBOX", + LSTRING(SettingAnimActionsName), + format ["ACE %1", LLSTRING(DisplayName)], + true, + true, + {[QGVAR(enableAnimActions), _this] call EFUNC(common,cbaSettings_settingChanged)}, + true // Needs mission restart +] call CBA_fnc_addSetting; + [ QGVAR(interactWithTerrainObjects), "CHECKBOX", ["str_a3_modules_moduleomquest_defend_f_attributes_useterrainobject0", LSTRING(interactWithTerrainObjects_Description)], @@ -45,3 +63,11 @@ false, true ] call CBA_fnc_addSetting; + +[ + QGVAR(interactWithEnemyCrew), "LIST", + [LSTRING(interactWithEnemyCrew_DisplayName), LSTRING(interactWithEnemyCrew_Description)], + format ["ACE %1", LLSTRING(DisplayName)], + [[0, 1, 2], [ELSTRING(common,Never), LSTRING(interactWithEnemyCrew_allowCSW), ELSTRING(common,Always)], 0], + true +] call CBA_fnc_addSetting; diff --git a/addons/interaction/stringtable.xml b/addons/interaction/stringtable.xml index 38c86f5f99b..b9dfbf8c903 100644 --- a/addons/interaction/stringtable.xml +++ b/addons/interaction/stringtable.xml @@ -283,7 +283,7 @@ <Hungarian>Csatlakozás a csoporthoz</Hungarian> <Portuguese>Unir-se ao grupo</Portuguese> <Italian>Unisciti alla squadra</Italian> - <Japanese>グループに入る</Japanese> + <Japanese>グループに参加</Japanese> <Korean>그룹 참여</Korean> <Chinesesimp>加入小队</Chinesesimp> <Chinese>加入小隊</Chinese> @@ -373,7 +373,7 @@ <Hungarian>TÁNC!</Hungarian> <Portuguese>DANCE!</Portuguese> <Italian>DANZA!</Italian> - <Japanese>おどれ!</Japanese> + <Japanese>踊ろう!</Japanese> <Korean>춤추기!</Korean> <Chinesesimp>跳舞</Chinesesimp> <Chinese>跳舞</Chinese> @@ -582,6 +582,38 @@ <Chinese>小隊管理</Chinese> <Turkish>Takım Yönetimi</Turkish> </Key> + <Key ID="STR_ACE_Interaction_remoteTeamManagement_DisplayName"> + <English>Remote Squad Management</English> + <French>Gestion à distance de l'escouade</French> + <Russian>Дистанционное управление отрядом</Russian> + <Japanese>遠隔分隊管理</Japanese> + <Korean>분대 원격 관리</Korean> + <Italian>Gestione squadra da remoto</Italian> + </Key> + <Key ID="STR_ACE_Interaction_remoteTeamManagement_Description"> + <English>Allow dropping and changing team colors of any unit in player's squad</English> + <French>Permettre d'abandonner et de changer les couleurs de n'importe quelle unité de l'escouade du joueur</French> + <Russian>Позволяет сбрасывать и менять командные цвета любого подразделения в отряде игрока</Russian> + <Japanese>プレイヤー分隊内の任意のユニットにチームからの脱退と色の変更を許可します</Japanese> + <Korean>플레이어 분대의 모든 유닛을 삭제하고 팀 색상 변경하는 것을 허용합니다.</Korean> + <Italian>Permetti di cambiare il colore o rimuovere una qualsiasi unità della propria squadra</Italian> + </Key> + <Key ID="STR_ACE_Interaction_Squad"> + <English>Squad</English> + <Czech>Družstvo</Czech> + <German>Trupp</German> + <Russian>Отряд</Russian> + <Polish>Drużyna</Polish> + <Italian>Squadra</Italian> + <Spanish>Escuadrón</Spanish> + <French>Escouade</French> + <Chinese>分隊</Chinese> + <Japanese>分隊</Japanese> + <Korean>분대</Korean> + <Portuguese>Esquadrão</Portuguese> + <Chinesesimp>小队</Chinesesimp> + <Turkish>Manga</Turkish> + </Key> <Key ID="STR_ACE_Interaction_TeamRED"> <English>Red</English> <German>Rot</German> @@ -729,7 +761,7 @@ <Russian>Присоединиться к Красной группе</Russian> <French>Rejoindre rouge</French> <Italian>Unirsi al team rosso</Italian> - <Japanese>レッドに入る</Japanese> + <Japanese>レッドに参加</Japanese> <Korean>빨강에 참여</Korean> <Chinesesimp>加入红组</Chinesesimp> <Chinese>加入紅組</Chinese> @@ -746,7 +778,7 @@ <Russian>Присоединиться к Зеленой группе</Russian> <French>Rejoindre vert</French> <Italian>Unirsi al team verde</Italian> - <Japanese>グリーンに入る</Japanese> + <Japanese>グリーンに参加</Japanese> <Korean>초록에 참여</Korean> <Chinesesimp>加入绿组</Chinesesimp> <Chinese>加入綠組</Chinese> @@ -763,7 +795,7 @@ <Russian>Присоединиться к Синей группе</Russian> <French>Rejoindre bleu</French> <Italian>Unirsi al team blu</Italian> - <Japanese>ブルーに入る</Japanese> + <Japanese>ブルーに参加</Japanese> <Korean>파랑에 참여</Korean> <Chinesesimp>加入蓝组</Chinesesimp> <Chinese>加入藍組</Chinese> @@ -780,12 +812,25 @@ <Russian>Присоединиться к Жёлтой группе</Russian> <French>Rejoindre jaune</French> <Italian>Unirsi al team giallo</Italian> - <Japanese>イエローに入る</Japanese> + <Japanese>イエローに参加</Japanese> <Korean>노랑에 참여</Korean> <Chinesesimp>加入黄组</Chinesesimp> <Chinese>加入黃組</Chinese> <Turkish>Sarıya Katıl</Turkish> </Key> + <Key ID="STR_ACE_Interaction_JoinTeamMain"> + <English>Join White</English> + <German>Weiss beitreten</German> + <Spanish>Unirse a Blanco</Spanish> + <Polish>Dołącz do Biała</Polish> + <Portuguese>Entrar em Branco</Portuguese> + <Czech>Připojit k Bílý Tým</Czech> + <Russian>Присоединиться к Белая</Russian> + <French>Rejoindre Blanc</French> + <Italian>Unirsi al team Bianco</Italian> + <Korean>백팀 참여</Korean> + <Japanese>ホワイトに参加</Japanese> + </Key> <Key ID="STR_ACE_Interaction_JoinedTeam"> <English>You joined Team %1</English> <German>Du bist Gruppe %1 beigetreten</German> @@ -797,7 +842,7 @@ <Portuguese>Você uniu-se à Equipe %1</Portuguese> <Italian>Sei entrato nel team %1</Italian> <Hungarian>Csatlakoztál a %1 csapathoz</Hungarian> - <Japanese>チーム %1 に入りました</Japanese> + <Japanese>チーム %1 に参加しました</Japanese> <Korean>당신은 %1팀에 참여했습니다</Korean> <Chinesesimp>你已加入%1组</Chinesesimp> <Chinese>你已加入%1組</Chinese> @@ -1060,7 +1105,7 @@ <Key ID="STR_ACE_Interaction_DisableNegativeRating_DisplayName"> <English>Disable negative rating</English> <German>Negative Bewertung deaktivieren</German> - <Japanese>否定評価を無効化</Japanese> + <Japanese>ネガティブな評価を無効化</Japanese> <Italian>Impedisci Valutazione Negativa</Italian> <Chinese>關閉負面評價</Chinese> <Chinesesimp>关闭负面评价</Chinesesimp> @@ -1075,7 +1120,7 @@ <Key ID="STR_ACE_Interaction_DisableNegativeRating_Description"> <English>Should players receive negative rating? When enabled players are only receiving positive ratings which prevents friendly AI fire when destroying friendly equipment or killing team members.</English> <German>Sollen Spieler negative Bewertungen erhalten dürfen? Wenn diese Option aktiviert ist, erhalten Spieler nur positive Bewertungen, was Freundbeschuss durch KI verhindert, wenn befreundete Ausrüstung zerstört oder befreundete Einheiten von Spielern des selben Teams getötet werden.</German> - <Japanese>否定評価を受けますか?有効化した場合プレイヤーは肯定評価のみを受け、友軍の装備を壊したり殺害をしてもAIからの攻撃を防ぎます。</Japanese> + <Japanese>プレイヤーはネガティブな評価を受けるべきですか? これを有効化すると、プレイヤーはポジティブな評価のみ受けるようになり、仮に味方の兵器を破壊したり、友軍兵士を殺害したとしても、友軍AI兵がプレイヤーに対して発砲するのを防ぐことができます。</Japanese> <Italian>I giocatori possono ricevere valutazioni negative? Se abilitato i giocatori riceveranno esclusivamente valutazioni positive, impedendo l'ingaggio da parte di IA alleate quando distruggono equipaggiamenti o uccidono alleati/civili.</Italian> <Chinese>玩家是否會收到負面評價? 當本功能開啟時玩家只會接收到正面評價,所以當玩家做出擊殺友軍AI、毀壞友軍裝備或殺害小隊夥伴都不會收到負面評價</Chinese> <Chinesesimp>玩家是否会收到负面评价? 当本功能开启时玩家只会接收到正面评价,所以当玩家做出击杀友军 AI、毁坏友军装备或杀害小队伙伴都不会收到负面评价。</Chinesesimp> @@ -1208,7 +1253,7 @@ <Italian>Mostra l'interazione "passa caricatore"</Italian> <Spanish>Mostrar "Pasar cargador" en el menú de interacción</Spanish> <French>Montrer l'interaction "Passer un chargeur"</French> - <Japanese>"弾倉を渡す"をインタラクションに表示</Japanese> + <Japanese>弾倉を渡すをインタラクションに表示</Japanese> <Korean>'탄창 건네기'를 상호작용에서 보여줌</Korean> <Chinesesimp>显示"给予弹匣"互动动作</Chinesesimp> <Chinese>顯示"給予彈匣"互動動作</Chinese> @@ -1237,7 +1282,7 @@ <Russian>Выбить лобовое стекло</Russian> <Polish>Wyłam szybę</Polish> <Hungarian>Szélvédő széttörése</Hungarian> - <Japanese>フロントガラスを破る</Japanese> + <Japanese>風防を破る</Japanese> <Italian>Sfonda il parabrezza</Italian> <Portuguese>Quebrar pára-brisa</Portuguese> <Chinese>踹開擋風玻璃</Chinese> @@ -1247,30 +1292,30 @@ <Korean>전면유리 부수기</Korean> </Key> <Key ID="STR_ACE_Interaction_weaponAttachmentsAttach"> - <English>Attach %1</English> - <Russian>Установить %1</Russian> - <Japanese>%1 を取り付け</Japanese> - <Spanish>Acoplar %1</Spanish> - <French>Fixer %1</French> - <Polish>Przyczep %1</Polish> - <German>Befestige %1</German> - <Italian>Attacca %1</Italian> - <Chinesesimp>附加 %1</Chinesesimp> - <Korean>%1 붙이기</Korean> - <Portuguese>Fixar %1</Portuguese> + <English>Attach</English> + <Russian>Установить</Russian> + <Japanese>を取り付け</Japanese> + <Spanish>Acoplar</Spanish> + <French>Fixer</French> + <Polish>Przyczep</Polish> + <German>Befestige</German> + <Italian>Attacca</Italian> + <Chinesesimp>附加</Chinesesimp> + <Korean>붙이기</Korean> + <Portuguese>Fixar</Portuguese> </Key> <Key ID="STR_ACE_Interaction_weaponAttachmentsDetach"> - <English>Detach %1</English> - <Russian>Снять %1</Russian> - <Japanese>%1 を外す</Japanese> - <Spanish>Desacoplar %1</Spanish> - <French>Retirer %1</French> - <Polish>Odczep %1</Polish> - <German>Löse %1</German> - <Italian>Stacca %1</Italian> - <Chinesesimp>拆卸 %1</Chinesesimp> - <Korean>%1 떼내기</Korean> - <Portuguese>Desfixar %1</Portuguese> + <English>Detach</English> + <Russian>Снять</Russian> + <Japanese>を外す</Japanese> + <Spanish>Desacoplar</Spanish> + <French>Retirer</French> + <Polish>Odczep</Polish> + <German>Löse</German> + <Italian>Stacca</Italian> + <Chinesesimp>拆卸</Chinesesimp> + <Korean>떼내기</Korean> + <Portuguese>Desfixar</Portuguese> </Key> <Key ID="STR_ACE_Interaction_weaponAttachments_Description"> <English>Enables attach/detach weapon attachment actions for current weapon.</English> @@ -1324,5 +1369,37 @@ <Spanish>Advertencia: puede provocar que algunos objetos choquen con otros.</Spanish> <Portuguese>Aviso: pode causar que alguns objetos colidam com outros.</Portuguese> </Key> + <Key ID="STR_ACE_Interaction_SettingAnimActionsName"> + <English>Interaction with animations</English> + <Russian>Взаимодействие с анимациями</Russian> + <French>Interaction avec les animations</French> + <Japanese>車両アニメーションベースのインタラクション</Japanese> + <Korean>애니메이션 있는 상호작용</Korean> + <Italian>Interazione con animazioni</Italian> + </Key> + <Key ID="STR_ACE_Interaction_interactWithEnemyCrew_DisplayName"> + <English>Interact With Enemy Crew</English> + <Japanese>敵乗員がいる状態でのインタラクト</Japanese> + <French>Interagir avec l'équipage ennemi</French> + <Russian>Взаимодействие с вражеским экипажем</Russian> + <Korean>적 승무원과의 상호작용</Korean> + <Italian>Interazioni con equipaggio nemico</Italian> + </Key> + <Key ID="STR_ACE_Interaction_interactWithEnemyCrew_Description"> + <English>Limit some interactions on vehicles crewed by enemy factions.</English> + <Japanese>敵性力の乗員が乗っている車両へのインタラクションを一部制限します。</Japanese> + <French>Limiter certaines interactions sur les véhicules dont l'équipage appartient à des factions ennemies.</French> + <Russian>Ограничьте некоторые взаимодействия на транспортных средствах, управляемых вражеской стороной.</Russian> + <Korean>적 진영이 탑승한 차량과의 일부 상호작용을 제한합니다.</Korean> + <Italian>Limita alcune interazioni su veicoli con nemici a bordo.</Italian> + </Key> + <Key ID="STR_ACE_Interaction_interactWithEnemyCrew_allowCSW"> + <English>Allow for Static Weapons</English> + <Japanese>固定火器での許可</Japanese> + <French>Autoriser les armes statiques</French> + <Russian>Разрешить использование статического оружия</Russian> + <Korean>고정화기 허용</Korean> + <Italian>Permetti con armi statiche</Italian> + </Key> </Package> </Project> diff --git a/addons/inventory/RscDisplayInventory.hpp b/addons/inventory/RscDisplayInventory.hpp index 91e68f5fb1c..06752dcfec5 100644 --- a/addons/inventory/RscDisplayInventory.hpp +++ b/addons/inventory/RscDisplayInventory.hpp @@ -17,13 +17,13 @@ class RscStructuredText; class RscActiveText; class RscCombo; -#define X_BIS(num) (num * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)) -#define Y_BIS(num) (num * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)) -#define W_BIS(num) (num * (((safezoneW / safezoneH) min 1.2) / 40)) -#define H_BIS(num) (num * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)) +#define X_BIS(num) (num * (((safeZoneW / safeZoneH) min 1.2) / 40) + (safeZoneX + (safeZoneW - ((safeZoneW / safeZoneH) min 1.2))/2)) +#define Y_BIS(num) (num * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)) +#define W_BIS(num) (num * (((safeZoneW / safeZoneH) min 1.2) / 40)) +#define H_BIS(num) (num * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)) -#define X_MAKEITBIGGA(num) (num * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)) -#define Y_MAKEITBIGGA(num) (num * (safeZoneH / 30) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)) +#define X_MAKEITBIGGA(num) (num * (safeZoneH / 40) + (safeZoneX + (safeZoneW - safeZoneH)/2)) +#define Y_MAKEITBIGGA(num) (num * (safeZoneH / 30) + (safeZoneY + (safeZoneH - (safeZoneH / 1.2))/2)) #define W_MAKEITBIGGA(num) (num * (safeZoneH / 40)) #define H_MAKEITBIGGA(num) (num * (safeZoneH / 30)) diff --git a/addons/inventory/functions/fnc_forceItemListUpdate.sqf b/addons/inventory/functions/fnc_forceItemListUpdate.sqf index fb8f09b5c84..ede73b01519 100644 --- a/addons/inventory/functions/fnc_forceItemListUpdate.sqf +++ b/addons/inventory/functions/fnc_forceItemListUpdate.sqf @@ -29,9 +29,9 @@ private _itemKeyCache = uiNamespace getVariable QGVAR(itemKeyCache); private _backpackKeyCache = uiNamespace getVariable QGVAR(backpackKeyCache); private _config = configNull; -for "_i" from (lbSize _itemList) to 0 step -1 do { +for "_i" from (lbSize _itemList) - 1 to 0 step -1 do { // All items have their classnames in lbData, except backpacks - _className = _itemList lbData _i; + private _className = _itemList lbData _i; _config = if (_className != "") then { _itemKeyCache get _className diff --git a/addons/irlight/XEH_PREP.hpp b/addons/irlight/XEH_PREP.hpp index db1a29d22e1..83c619aab87 100644 --- a/addons/irlight/XEH_PREP.hpp +++ b/addons/irlight/XEH_PREP.hpp @@ -1,3 +1 @@ -PREP(getGlowOffset); PREP(initItemContextMenu); -PREP(onLightToggled); diff --git a/addons/irlight/XEH_postInit.sqf b/addons/irlight/XEH_postInit.sqf index d95186f07bb..77b98936c19 100644 --- a/addons/irlight/XEH_postInit.sqf +++ b/addons/irlight/XEH_postInit.sqf @@ -1,30 +1,27 @@ #include "script_component.hpp" -[] call FUNC(initItemContextMenu); - -addUserActionEventHandler ["headlights", "Deactivate", LINKFUNC(onLightToggled)]; +call FUNC(initItemContextMenu); ["ACE3 Equipment", QGVAR(hold), LLSTRING(MomentarySwitch), { - ACE_player action ["GunLightOn", ACE_player]; - ACE_player action ["IRLaserOn", ACE_player]; - [] call FUNC(onLightToggled); + if !(ACE_player call CBA_fnc_canUseWeapon) exitWith {}; + + // Save current weapon state to reapply later + private _weaponState = (weaponState ACE_player) select [0, 3]; + + action ["GunLightOn", ACE_player]; + action ["IRLaserOn", ACE_player]; + + ACE_player selectWeapon _weaponState; + true }, { - ACE_player action ["GunLightOff", ACE_player]; - ACE_player action ["IRLaserOff", ACE_player]; - [] call FUNC(onLightToggled); - true -}] call CBA_fnc_addKeybind; + if !(ACE_player call CBA_fnc_canUseWeapon) exitWith {}; + + // Save current weapon state to reapply later + private _weaponState = (weaponState ACE_player) select [0, 3]; -["CBA_attachmentSwitched", { - params ["", "", "_item"]; - - private _substr = _item select [0, 8]; - if ( - ACE_player getVariable [QGVAR(isTurnedOn), false] - && {_substr == "ACE_SPIR" || {_substr == "ACE_DBAL"}} - ) then { - ACE_player action ["GunLightOn", ACE_player]; - ACE_player action ["IRLaserOn", ACE_player]; - }; -}] call CBA_fnc_addEventHandler; + action ["GunLightOff", ACE_player]; + action ["IRLaserOff", ACE_player]; + + ACE_player selectWeapon _weaponState; +}] call CBA_fnc_addKeybind; diff --git a/addons/irlight/functions/fnc_getGlowOffset.sqf b/addons/irlight/functions/fnc_getGlowOffset.sqf deleted file mode 100644 index 613e551111c..00000000000 --- a/addons/irlight/functions/fnc_getGlowOffset.sqf +++ /dev/null @@ -1,41 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: BaerMitUmlaut - * Gets the player model offset of the IR laser origin. - * Currently unused, see onLightToggled. - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * [] call ace_irlight_fnc_getGlowOffset - * - * Public: No - */ - -if (isNil QGVAR(offsetCache)) then { - GVAR(offsetCache) = createHashMap; -}; - -private _weapon = currentWeapon ACE_player; -private _laser = ((weaponsItems ACE_player) select {_x#0 == _weapon})#0#2; - -GVAR(offsetCache) getOrDefaultCall [[_weapon, _laser], { - private _model = getText (configFile >> "CfgWeapons" >> _weapon >> "model"); - private _dummy = createSimpleObject [_model, [0, 0, 0], true]; - private _proxyOffset = _dummy selectionPosition ["\a3\data_f\proxies\weapon_slots\SIDE.001", 1]; - _proxyOffset = [_proxyOffset#1, _proxyOffset#0 * -1, _proxyOffset#2]; - deleteVehicle _dummy; - - _model = getText (configFile >> "CfgWeapons" >> _laser >> "model"); - _dummy = createSimpleObject [_model, [0, 0, 0], true]; - private _selection = getText (configFile >> "CfgWeapons" >> _laser >> "ItemInfo" >> "Pointer" >> "irLaserPos"); - private _laserOffset = _dummy selectionPosition [_selection, "Memory"]; - _laserOffset = [_laserOffset#1, _laserOffset#0 * -1, _laserOffset#2 * -1]; - deleteVehicle _dummy; - - _proxyOffset vectorAdd _laserOffset -}, true]; diff --git a/addons/irlight/functions/fnc_initItemContextMenu.sqf b/addons/irlight/functions/fnc_initItemContextMenu.sqf index fa75eba77be..75a9508b180 100644 --- a/addons/irlight/functions/fnc_initItemContextMenu.sqf +++ b/addons/irlight/functions/fnc_initItemContextMenu.sqf @@ -10,7 +10,7 @@ * None * * Example: - * [] call ace_irlight_fnc_initItemContextMenu + * call ace_irlight_fnc_initItemContextMenu * * Public: No */ @@ -19,30 +19,34 @@ _x params ["_variant", "_displayName"]; [ - "ACE_DBAL_A3_Red", "POINTER", _displayName, [], "", { + "ACE_DBAL_A3_Red", + "POINTER", + _displayName, + [], + "", + { params ["", "", "_item", "", "_variant"]; private _baseClass = getText (configFile >> "CfgWeapons" >> _item >> "baseWeapon"); _item != _baseClass + _variant }, { - params ["", "", "_item", "", "_variant"]; + params ["_unit", "", "_item", "_slot", "_variant"]; - private _baseClass = getText (configFile >> "CfgWeapons" >> _item >> "baseWeapon"); + private _weapon = switch (_slot) do { + case "RIFLE_POINTER": {primaryWeapon _unit}; + case "LAUNCHER_POINTER": {secondaryWeapon _unit}; + case "PISTOL_POINTER": {handgunWeapon _unit}; + default {""}; + }; - ACE_player removePrimaryWeaponItem _item; - ACE_player addPrimaryWeaponItem (_baseClass + _variant); - playSound "click"; + if (_weapon == "") exitWith {}; - if (_turnedOn) then { - // Force update of flashlight - ACE_player action ["GunLightOff", ACE_player]; + private _baseClass = getText (configFile >> "CfgWeapons" >> _item >> "baseWeapon"); - { - ACE_player action ["GunLightOn", ACE_player]; - ACE_player action ["IRLaserOn", ACE_player]; - } call CBA_fnc_execNextFrame; - }; - }, false, _variant + [_unit, _weapon, _item, _baseClass + _variant] call EFUNC(common,switchAttachmentMode); + }, + false, + _variant ] call CBA_fnc_addItemContextMenuOption; } forEach [ ["", LSTRING(Mode_IRDual)], diff --git a/addons/irlight/functions/fnc_onLightToggled.sqf b/addons/irlight/functions/fnc_onLightToggled.sqf deleted file mode 100644 index b3592f28f60..00000000000 --- a/addons/irlight/functions/fnc_onLightToggled.sqf +++ /dev/null @@ -1,36 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: BaerMitUmlaut - * Handles toggling flashlights on and off. - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * [] call ace_irlight_fnc_onLightToggled - * - * Public: No - */ - -private _isTurnedOn = ACE_player isFlashlightOn primaryWeapon ACE_player - || ACE_player isIRLaserOn primaryWeapon ACE_player; -ACE_player setVariable [QGVAR(isTurnedOn), _isTurnedOn]; - -// This is a surprise tool that will help us later -// Requires: https://feedback.bistudio.com/T170774 -/* -deleteVehicle (ACE_player getVariable [QGVAR(glow), objNull]); - -if (ACE_player isIRLaserOn currentWeapon ACE_player) then { - private _offset = [] call FUNC(getGlowOffset); - private _glow = createSimpleObject [QPATHTOF(data\irglow.p3d), [0, 0, 0]]; - _glow attachTo [ACE_player, _offset, "proxy:\a3\characters_f\proxies\weapon.001", true]; - _glow setObjectTexture [0, "#(rgb,8,8,3)color(0.35,0,0.38,0.1)"]; - _glow setObjectScale 0.1; - - ACE_player setVariable [QGVAR(glow), _glow]; -}; -*/ diff --git a/addons/javelin/functions/fnc_getTarget.sqf b/addons/javelin/functions/fnc_getTarget.sqf index 6fd4686eb8d..926e400a18b 100644 --- a/addons/javelin/functions/fnc_getTarget.sqf +++ b/addons/javelin/functions/fnc_getTarget.sqf @@ -20,8 +20,8 @@ params ["_lastTarget", "_maxRange"]; scopeName "main"; -private _viewASL = AGLtoASL positionCameraToWorld [0,0,0]; -private _viewDir = _viewASL vectorFromTo (AGLtoASL positionCameraToWorld [0,0,1]); +private _viewASL = AGLToASL positionCameraToWorld [0,0,0]; +private _viewDir = _viewASL vectorFromTo (AGLToASL positionCameraToWorld [0,0,1]); // Attempt to lock onto current target if it is still valid if (!isNull _lastTarget) then { @@ -65,7 +65,7 @@ if ((cursorTarget isKindOf "AllVehicles") && {(cursorObject distance ace_player) // Attempt to scan using multiple rayscasts - This is expensive (n^2) and care should be given to balance accuracy vs speed for "_xOffset" from -14 to 14 step 2 do { for "_yOffset" from -12 to 12 step 4 do { - private _testPosASL = AGLtoASL (positionCameraToWorld [_xOffset, _yOffset, _maxRange]); + private _testPosASL = AGLToASL (positionCameraToWorld [_xOffset, _yOffset, _maxRange]); private _intersectionsToCursorTarget = lineIntersectsSurfaces [_viewASL, _testPosASL, ace_player, vehicle ace_player, true, 1]; // drawIcon3D ["\A3\ui_f\data\map\markers\military\dot_CA.paa", [[0,1,0,1], [1,0,0,1]] select (count _intersectionsToCursorTarget), (ASLtoAGL _testPosASL), 0.25, 0.25, 0, "", 0.5, 0.025, "TahomaB"]; if (_intersectionsToCursorTarget isNotEqualTo []) then { diff --git a/addons/javelin/functions/fnc_mapHelperDraw.sqf b/addons/javelin/functions/fnc_mapHelperDraw.sqf index 4f7ac84b4a6..e8b917a933e 100644 --- a/addons/javelin/functions/fnc_mapHelperDraw.sqf +++ b/addons/javelin/functions/fnc_mapHelperDraw.sqf @@ -25,7 +25,7 @@ if (isNil QGVAR(arguments)) then { _currentShooter setVariable ["ace_missileguidance_target", nil, false]; GVAR(arguments) = [ - diag_frameno, // Last run frame + diag_frameNo, // Last run frame objNull, // currentTargetObject 0, // Lock Start Time 0, // Next Sound timer @@ -37,7 +37,7 @@ if (isNil QGVAR(arguments)) then { [{ if (isNull (uiNamespace getVariable ["ACE_RscOptics_javelin", displayNull])) exitWith {true}; GVAR(arguments) params ["_lastRunFrame"]; - (diag_frameno < _lastRunFrame) || {diag_frameno > (_lastRunFrame + 1)} + (diag_frameNo < _lastRunFrame) || {diag_frameNo > (_lastRunFrame + 1)} }, { TRACE_1("old/null display - ending optic draw",_this); private _fireDisabledEH = GVAR(arguments) param [4, -1]; diff --git a/addons/javelin/functions/fnc_onOpticDraw.sqf b/addons/javelin/functions/fnc_onOpticDraw.sqf index aacc4f5fa1f..9dfb7d2e484 100644 --- a/addons/javelin/functions/fnc_onOpticDraw.sqf +++ b/addons/javelin/functions/fnc_onOpticDraw.sqf @@ -53,7 +53,7 @@ if ((_ammoCount == 0) || // No ammo loaded __JavelinIGUISeek ctrlSetTextColor __ColorGray; _fireDisabledEH = [_fireDisabledEH] call FUNC(enableFire); - _this set [0, diag_frameno]; + _this set [0, diag_frameNo]; _this set [4, _fireDisabledEH]; // Fix weapon being in top-attack when loading AP magazine (https://feedback.bistudio.com/T171012) @@ -194,7 +194,7 @@ if (isNull _newTarget) then { }; // Save arguments for next run -_this set [0, diag_frameno]; +_this set [0, diag_frameNo]; _this set [1, _currentTarget]; _this set [2, _lockStartTime]; _this set [3, _soundNextPlayTime]; diff --git a/addons/javelin/functions/fnc_showFireMode.sqf b/addons/javelin/functions/fnc_showFireMode.sqf index 85ed9837185..a3315188f1f 100644 --- a/addons/javelin/functions/fnc_showFireMode.sqf +++ b/addons/javelin/functions/fnc_showFireMode.sqf @@ -14,11 +14,12 @@ * * Public: No */ +//IGNORE_PRIVATE_WARNING ["_currentShooter"]; // from upper scope (if (((vehicle ACE_player) == ACE_player) || {ACE_player call CBA_fnc_canUseWeapon}) then { weaponState ACE_player } else { - _turretPath = if (ACE_player == (driver _currentShooter)) then {[-1]} else {ACE_player call CBA_fnc_turretPath}; + private _turretPath = if (ACE_player == (driver _currentShooter)) then {[-1]} else {ACE_player call CBA_fnc_turretPath}; weaponState [vehicle ACE_player, _turretPath] }) params ["_weapon", "", "_mode"]; diff --git a/addons/javelin/script_component.hpp b/addons/javelin/script_component.hpp index 3e9ad4ebfc1..b5cf7bea3ce 100644 --- a/addons/javelin/script_component.hpp +++ b/addons/javelin/script_component.hpp @@ -18,7 +18,7 @@ // Javelin IGUI defines -#define __JavelinIGUI (uinamespace getVariable "ACE_RscOptics_javelin") +#define __JavelinIGUI (uiNamespace getVariable "ACE_RscOptics_javelin") // Custom controls #define __JavelinIGUITargeting (__JavelinIGUI displayCtrl 6999) diff --git a/addons/kestrel4500/RscTitles.hpp b/addons/kestrel4500/RscTitles.hpp index faae6a8f32b..ffb44de9132 100644 --- a/addons/kestrel4500/RscTitles.hpp +++ b/addons/kestrel4500/RscTitles.hpp @@ -64,7 +64,7 @@ class Kestrel4500_Display { SizeEX=0.025; idc=74000; style=48; - x="safezoneX"; + x="safeZoneX"; y = DIALOG_SAFE_Y(0); w="1.024"; h="1.024*4/3"; @@ -74,7 +74,7 @@ class Kestrel4500_Display { }; class POWER: Kestrel4500_RscButton { idc=-1; - x="safezoneX+0.385"; + x="safeZoneX+0.385"; y = DIALOG_SAFE_Y(1.125); w="0.042"; h="0.042*4/3"; @@ -83,7 +83,7 @@ class Kestrel4500_Display { }; class ENTER: POWER { idc=-1; - x="safezoneX+0.46"; + x="safeZoneX+0.46"; y = DIALOG_SAFE_Y(1.0); w=0.1; action=QUOTE(0 call FUNC(buttonPressed)); @@ -91,7 +91,7 @@ class Kestrel4500_Display { }; class TOP: Kestrel4500_RscButton { idc=-1; - x="safezoneX+0.46"; + x="safeZoneX+0.46"; y = DIALOG_SAFE_Y(0.93); w=0.1; h=0.03; @@ -106,7 +106,7 @@ class Kestrel4500_Display { }; class LEFT: Kestrel4500_RscButton { idc=-1; - x="safezoneX+0.4"; + x="safeZoneX+0.4"; y = DIALOG_SAFE_Y(0.97); w=0.046; h=0.11; @@ -115,13 +115,13 @@ class Kestrel4500_Display { }; class RIGHT: LEFT { idc=-1; - x="safezoneX+0.58"; + x="safeZoneX+0.58"; action=QUOTE(4 call FUNC(buttonPressed)); onMouseButtonDown = "playSound 'kestrel4500_right_button_click'"; }; class MEMORY: Kestrel4500_RscButton { idc=-1; - x="safezoneX+0.395"; + x="safeZoneX+0.395"; y = DIALOG_SAFE_Y(0.87); w=0.05; h="0.045*4/3"; @@ -129,13 +129,13 @@ class Kestrel4500_Display { }; class BACKLIGHT: MEMORY { idc=-1; - x="safezoneX+0.585"; + x="safeZoneX+0.585"; action=QUOTE(6 call FUNC(buttonPressed)); }; class TEXT_TOP: Kestrel4500_RscText { idc=74100; - x="safezoneX+0.40"; + x="safeZoneX+0.40"; y = DIALOG_SAFE_Y(0.58); w=0.22; h=0.04; @@ -236,7 +236,7 @@ class RscTitles { font="TahomaB"; SizeEX=".025*0.75"; style=48; - x="safezoneX+0.14"; + x="safeZoneX+0.14"; y = DISPLAY_SAFE_Y(0); w="0.512*0.75"; h="1.024*4/3*0.75"; @@ -246,7 +246,7 @@ class RscTitles { }; class RscTextTop: Kestrel4500_RscText { idc=75100; - x="safezoneX-0.05+0.40*0.75"; + x="safeZoneX-0.05+0.40*0.75"; y = DISPLAY_SAFE_Y(0.58*0.75); w="0.22*0.75"; h="0.04*0.75"; diff --git a/addons/kestrel4500/config.cpp b/addons/kestrel4500/config.cpp index 5ea15f07ffe..fc339ccf6b0 100644 --- a/addons/kestrel4500/config.cpp +++ b/addons/kestrel4500/config.cpp @@ -6,7 +6,7 @@ class CfgPatches { units[] = {"ACE_Item_Kestrel4500"}; weapons[] = {"ACE_Kestrel4500"}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"ACE_common", "ACE_weather"}; + requiredAddons[] = {"ace_common", "ace_weather"}; author = ECSTRING(common,ACETeam); authors[] = {ECSTRING(common,ACETeam), "Ruthberg"}; url = ECSTRING(main,URL); diff --git a/addons/kestrel4500/functions/fnc_generateOutputData.sqf b/addons/kestrel4500/functions/fnc_generateOutputData.sqf index 59bb3056dd1..1aeac9a182a 100644 --- a/addons/kestrel4500/functions/fnc_generateOutputData.sqf +++ b/addons/kestrel4500/functions/fnc_generateOutputData.sqf @@ -89,7 +89,7 @@ if (GVAR(referenceHeadingMenu) == 0) then { private _monthString = localize (["str_january","str_february","str_march","str_april","str_may","str_june","str_july","str_august","str_september","str_october","str_november","str_december"] select (_month - 1)); _textTop = _dayString; _textCenter = format["%1 %2 %3", _day, _monthString, _year]; - _textBottomBig = [daytime, "HH:MM:SS"] call bis_fnc_timeToString; + _textBottomBig = [dayTime, "HH:MM:SS"] call bis_fnc_timeToString; }; case 1: { // Direction if (!GVAR(MinAvgMax)) then { @@ -105,7 +105,7 @@ if (GVAR(referenceHeadingMenu) == 0) then { }; case 2: { // Wind SPD if (!GVAR(MinAvgMax)) then { - _textCenterBig = Str(round(_windSpeed * 10) / 10); + _textCenterBig = str(round(_windSpeed * 10) / 10); } else { _textCenterLine1Left = "Max"; _textCenterLine2Left = "Avg"; @@ -116,13 +116,13 @@ if (GVAR(referenceHeadingMenu) == 0) then { _textInfoLine2 = "- average"; }; case 1: { - _textCenterLine1Right = Str(round((GVAR(Max) select 2) * 10) / 10); - _textCenterLine2Right = Str(round((GVAR(Total) select 2) / (GVAR(Entries) select 2) * 10) / 10); + _textCenterLine1Right = str(round((GVAR(Max) select 2) * 10) / 10); + _textCenterLine2Right = str(round((GVAR(Total) select 2) / (GVAR(Entries) select 2) * 10) / 10); _textInfoLine2 = "- stop"; }; case 2: { - _textCenterLine1Right = Str(round((GVAR(Max) select 2) * 10) / 10); - _textCenterLine2Right = Str(round((GVAR(Total) select 2) / (GVAR(Entries) select 2) * 10) / 10); + _textCenterLine1Right = str(round((GVAR(Max) select 2) * 10) / 10); + _textCenterLine2Right = str(round((GVAR(Total) select 2) / (GVAR(Entries) select 2) * 10) / 10); _textInfoLine2 = "- clear"; }; }; @@ -131,10 +131,10 @@ if (GVAR(referenceHeadingMenu) == 0) then { case 3: { // CROSSWIND if (!GVAR(MinAvgMax)) then { if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { - _textCenterBig = Str(round(abs(sin(GVAR(RefHeading) - _playerDir) * _windSpeed) * 10) / 10); + _textCenterBig = str(round(abs(sin(GVAR(RefHeading) - _playerDir) * _windSpeed) * 10) / 10); _textInfoLine1 = format["%1 m/s @ %2", round(_windSpeed * 10) / 10, round(_playerDir)]; } else { - _textCenterBig = Str(round(abs(sin(GVAR(RefHeading) - _windDir) * _windSpeed) * 10) / 10); + _textCenterBig = str(round(abs(sin(GVAR(RefHeading) - _windDir) * _windSpeed) * 10) / 10); _textInfoLine1 = format["%1 m/s @ %2", round(_windSpeed * 10) / 10, round(180 + _windDir)]; }; _textInfoLine2 = "- set heading"; @@ -148,13 +148,13 @@ if (GVAR(referenceHeadingMenu) == 0) then { _textInfoLine2 = "- average"; }; case 1: { - _textCenterLine1Right = Str(round((GVAR(Max) select 3) * 10) / 10); - _textCenterLine2Right = Str(round((GVAR(Total) select 3) / (GVAR(Entries) select 3) * 10) / 10); + _textCenterLine1Right = str(round((GVAR(Max) select 3) * 10) / 10); + _textCenterLine2Right = str(round((GVAR(Total) select 3) / (GVAR(Entries) select 3) * 10) / 10); _textInfoLine2 = "- stop"; }; case 2: { - _textCenterLine1Right = Str(round((GVAR(Max) select 3) * 10) / 10); - _textCenterLine2Right = Str(round((GVAR(Total) select 3) / (GVAR(Entries) select 3) * 10) / 10); + _textCenterLine1Right = str(round((GVAR(Max) select 3) * 10) / 10); + _textCenterLine2Right = str(round((GVAR(Total) select 3) / (GVAR(Entries) select 3) * 10) / 10); _textInfoLine2 = "- clear"; }; }; @@ -163,10 +163,10 @@ if (GVAR(referenceHeadingMenu) == 0) then { case 4: { // HEADWIND if (!GVAR(MinAvgMax)) then { if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { - _textCenterBig = Str(round(cos(GVAR(RefHeading) - _playerDir) * _windSpeed * 10) / 10); + _textCenterBig = str(round(cos(GVAR(RefHeading) - _playerDir) * _windSpeed * 10) / 10); _textInfoLine1 = format["%1 m/s @ %2", round(_windSpeed * 10) / 10, round(_playerDir)]; } else { - _textCenterBig = Str(round(-cos(GVAR(RefHeading) - _windDir) * _windSpeed * 10) / 10); + _textCenterBig = str(round(-cos(GVAR(RefHeading) - _windDir) * _windSpeed * 10) / 10); _textInfoLine1 = format["%1 m/s @ %2", round(_windSpeed * 10) / 10, round(180 + _windDir)]; }; _textInfoLine2 = "- set heading"; @@ -180,13 +180,13 @@ if (GVAR(referenceHeadingMenu) == 0) then { _textInfoLine2 = "- average"; }; case 1: { - _textCenterLine1Right = Str(round((GVAR(Max) select 4) * 10) / 10); - _textCenterLine2Right = Str(round((GVAR(Total) select 4) / (GVAR(Entries) select 4) * 10) / 10); + _textCenterLine1Right = str(round((GVAR(Max) select 4) * 10) / 10); + _textCenterLine2Right = str(round((GVAR(Total) select 4) / (GVAR(Entries) select 4) * 10) / 10); _textInfoLine2 = "- stop"; }; case 2: { - _textCenterLine1Right = Str(round((GVAR(Max) select 4) * 10) / 10); - _textCenterLine2Right = Str(round((GVAR(Total) select 4) / (GVAR(Entries) select 4) * 10) / 10); + _textCenterLine1Right = str(round((GVAR(Max) select 4) * 10) / 10); + _textCenterLine2Right = str(round((GVAR(Total) select 4) / (GVAR(Entries) select 4) * 10) / 10); _textInfoLine2 = "- clear"; }; }; @@ -194,124 +194,124 @@ if (GVAR(referenceHeadingMenu) == 0) then { }; case 5: { // TEMP if (!GVAR(MinAvgMax)) then { - _textCenterBig = Str(round(_temperature * 10) / 10); + _textCenterBig = str(round(_temperature * 10) / 10); } else { _textCenterLine1Left = "Min"; _textCenterLine2Left = "Avg"; _textCenterLine3Left = "Max"; - _textCenterLine1Right = Str(round((GVAR(Min) select 5) * 10) / 10); - _textCenterLine2Right = Str(round((GVAR(Total) select 5) / (GVAR(Entries) select 5) * 10) / 10); - _textCenterLine3Right = Str(round((GVAR(Max) select 5) * 10) / 10); + _textCenterLine1Right = str(round((GVAR(Min) select 5) * 10) / 10); + _textCenterLine2Right = str(round((GVAR(Total) select 5) / (GVAR(Entries) select 5) * 10) / 10); + _textCenterLine3Right = str(round((GVAR(Max) select 5) * 10) / 10); }; }; case 6: { // CHILL if (!GVAR(MinAvgMax)) then { - _textCenterBig = Str(round(_chill * 10) / 10); + _textCenterBig = str(round(_chill * 10) / 10); } else { _textCenterLine1Left = "Min"; _textCenterLine2Left = "Avg"; _textCenterLine3Left = "Max"; - _textCenterLine1Right = Str(round((GVAR(Min) select 6) * 10) / 10); - _textCenterLine2Right = Str(round((GVAR(Total) select 6) / (GVAR(Entries) select 6) * 10) / 10); - _textCenterLine3Right = Str(round((GVAR(Max) select 6) * 10) / 10); + _textCenterLine1Right = str(round((GVAR(Min) select 6) * 10) / 10); + _textCenterLine2Right = str(round((GVAR(Total) select 6) / (GVAR(Entries) select 6) * 10) / 10); + _textCenterLine3Right = str(round((GVAR(Max) select 6) * 10) / 10); }; }; case 7: { // HUMIDITY if (!GVAR(MinAvgMax)) then { - _textCenterBig = Str(round(_humidity * 100 * 10) / 10); + _textCenterBig = str(round(_humidity * 100 * 10) / 10); } else { _textCenterLine1Left = "Min"; _textCenterLine2Left = "Avg"; _textCenterLine3Left = "Max"; - _textCenterLine1Right = Str(round((GVAR(Min) select 7) * 100 * 10) / 10); - _textCenterLine2Right = Str(round((GVAR(Total) select 7) / (GVAR(Entries) select 7) * 100 * 10) / 10); - _textCenterLine3Right = Str(round((GVAR(Max) select 7) * 100 * 10) / 10); + _textCenterLine1Right = str(round((GVAR(Min) select 7) * 100 * 10) / 10); + _textCenterLine2Right = str(round((GVAR(Total) select 7) / (GVAR(Entries) select 7) * 100 * 10) / 10); + _textCenterLine3Right = str(round((GVAR(Max) select 7) * 100 * 10) / 10); }; }; case 8: { // HEAT INDEX if (!GVAR(MinAvgMax)) then { - _textCenterBig = Str(round(_heatIndex * 10) / 10); + _textCenterBig = str(round(_heatIndex * 10) / 10); } else { _textCenterLine1Left = "Min"; _textCenterLine2Left = "Avg"; _textCenterLine3Left = "Max"; - _textCenterLine1Right = Str(round((GVAR(Min) select 8) * 10) / 10); - _textCenterLine2Right = Str(round((GVAR(Total) select 8) / (GVAR(Entries) select 8) * 10) / 10); - _textCenterLine3Right = Str(round((GVAR(Max) select 8) * 10) / 10); + _textCenterLine1Right = str(round((GVAR(Min) select 8) * 10) / 10); + _textCenterLine2Right = str(round((GVAR(Total) select 8) / (GVAR(Entries) select 8) * 10) / 10); + _textCenterLine3Right = str(round((GVAR(Max) select 8) * 10) / 10); }; }; case 9: { // DEW POINT if (!GVAR(MinAvgMax)) then { - _textCenterBig = Str(round(_dewPoint * 10) / 10); + _textCenterBig = str(round(_dewPoint * 10) / 10); } else { _textCenterLine1Left = "Min"; _textCenterLine2Left = "Avg"; _textCenterLine3Left = "Max"; - _textCenterLine1Right = Str(round((GVAR(Min) select 9) * 10) / 10); - _textCenterLine2Right = Str(round((GVAR(Total) select 9) / (GVAR(Entries) select 9) * 10) / 10); - _textCenterLine3Right = Str(round((GVAR(Max) select 9) * 10) / 10); + _textCenterLine1Right = str(round((GVAR(Min) select 9) * 10) / 10); + _textCenterLine2Right = str(round((GVAR(Total) select 9) / (GVAR(Entries) select 9) * 10) / 10); + _textCenterLine3Right = str(round((GVAR(Max) select 9) * 10) / 10); }; }; case 10: { // WET BULB if (!GVAR(MinAvgMax)) then { - _textCenterBig = Str(round(_wetBulb * 10) / 10); + _textCenterBig = str(round(_wetBulb * 10) / 10); } else { _textCenterLine1Left = "Min"; _textCenterLine2Left = "Avg"; _textCenterLine3Left = "Max"; - _textCenterLine1Right = Str(round((GVAR(Min) select 10) * 10) / 10); - _textCenterLine2Right = Str(round((GVAR(Total) select 10) / (GVAR(Entries) select 10) * 10) / 10); - _textCenterLine3Right = Str(round((GVAR(Max) select 10) * 10) / 10); + _textCenterLine1Right = str(round((GVAR(Min) select 10) * 10) / 10); + _textCenterLine2Right = str(round((GVAR(Total) select 10) / (GVAR(Entries) select 10) * 10) / 10); + _textCenterLine3Right = str(round((GVAR(Max) select 10) * 10) / 10); }; }; case 11: { // BARO if (!GVAR(MinAvgMax)) then { - _textCenterBig = Str(round(_barometricPressure * 10) / 10); + _textCenterBig = str(round(_barometricPressure * 10) / 10); } else { _textCenterLine1Left = "Min"; _textCenterLine2Left = "Avg"; _textCenterLine3Left = "Max"; - _textCenterLine1Right = Str(round((GVAR(Min) select 11) * 10) / 10); - _textCenterLine2Right = Str(round((GVAR(Total) select 11) / (GVAR(Entries) select 11) * 10) / 10); - _textCenterLine3Right = Str(round((GVAR(Max) select 11) * 10) / 10); + _textCenterLine1Right = str(round((GVAR(Min) select 11) * 10) / 10); + _textCenterLine2Right = str(round((GVAR(Total) select 11) / (GVAR(Entries) select 11) * 10) / 10); + _textCenterLine3Right = str(round((GVAR(Max) select 11) * 10) / 10); }; }; case 12: { // ALTITUDE if (!GVAR(MinAvgMax)) then { - _textCenterBig = Str(round(EGVAR(common,mapAltitude) + _playerAltitude)); + _textCenterBig = str(round(EGVAR(common,mapAltitude) + _playerAltitude)); } else { _textCenterLine1Left = "Min"; _textCenterLine2Left = "Avg"; _textCenterLine3Left = "Max"; - _textCenterLine1Right = Str(round(GVAR(Min) select 12)); - _textCenterLine2Right = Str(round((GVAR(Total) select 12) / (GVAR(Entries) select 12))); - _textCenterLine3Right = Str(round(GVAR(Max) select 12)); + _textCenterLine1Right = str(round(GVAR(Min) select 12)); + _textCenterLine2Right = str(round((GVAR(Total) select 12) / (GVAR(Entries) select 12))); + _textCenterLine3Right = str(round(GVAR(Max) select 12)); }; }; case 13: { // DENSITY ALTITUDE if (!GVAR(MinAvgMax)) then { - _textCenterBig = Str(round(_densityAltitude)); + _textCenterBig = str(round(_densityAltitude)); } else { _textCenterLine1Left = "Min"; _textCenterLine2Left = "Avg"; _textCenterLine3Left = "Max"; - _textCenterLine1Right = Str(round(GVAR(Min) select 13)); - _textCenterLine2Right = Str(round((GVAR(Total) select 13) / (GVAR(Entries) select 13))); - _textCenterLine3Right = Str(round(GVAR(Max) select 13)); + _textCenterLine1Right = str(round(GVAR(Min) select 13)); + _textCenterLine2Right = str(round((GVAR(Total) select 13) / (GVAR(Entries) select 13))); + _textCenterLine3Right = str(round(GVAR(Max) select 13)); }; }; case 14: { // User Screen 1 - _textCenterLine1Left = Str(round(_playerDir)); - _textCenterLine2Left = Str(round(EGVAR(common,mapAltitude) + _playerAltitude)); - _textCenterLine3Left = Str(round(abs(_windSpeed) * 10) / 10); + _textCenterLine1Left = str(round(_playerDir)); + _textCenterLine2Left = str(round(EGVAR(common,mapAltitude) + _playerAltitude)); + _textCenterLine3Left = str(round(abs(_windSpeed) * 10) / 10); _textCenterLine1Right = GVAR(Directions) select GVAR(Direction); _textCenterLine2Right = "m"; _textCenterLine3Right = "m/s"; }; case 15: { // User Screen 2 - _textCenterLine1Left = Str(round(_temperature * 10) / 10); - _textCenterLine2Left = Str(round(_humidity * 100 * 10) / 10); - _textCenterLine3Left = Str(round((_playerAltitude call EFUNC(weather,calculateBarometricPressure)) * 10) / 10); + _textCenterLine1Left = str(round(_temperature * 10) / 10); + _textCenterLine2Left = str(round(_humidity * 100 * 10) / 10); + _textCenterLine3Left = str(round((_playerAltitude call EFUNC(weather,calculateBarometricPressure)) * 10) / 10); _textCenterLine1Right = "C"; _textCenterLine2Right = "%"; _textCenterLine3Right = "hPA"; @@ -322,7 +322,7 @@ if (GVAR(referenceHeadingMenu) == 0) then { switch (GVAR(referenceHeadingMenu)) do { case 1: { _textCenterLine1 = "MAGNETIC HEADING"; - _textCenterLine2 = Str(round(GVAR(RefHeading))); + _textCenterLine2 = str(round(GVAR(RefHeading))); _textCenterLine3 = "Auto Set "; _textCenterLine4 = "Manual Set "; _textCenterLine5 = "================"; @@ -330,7 +330,7 @@ if (GVAR(referenceHeadingMenu) == 0) then { }; case 2: { _textCenterLine1 = "MAGNETIC HEADING"; - _textCenterLine2 = Str(round(_playerDir)); + _textCenterLine2 = str(round(_playerDir)); _textCenterLine3 = "Point Down the"; _textCenterLine4 = "Runway or Range"; _textCenterLine5 = "================"; @@ -338,7 +338,7 @@ if (GVAR(referenceHeadingMenu) == 0) then { }; case 3: { _textCenterLine1 = "MAGNETIC HEADING"; - _textCenterLine2 = Str(round(GVAR(TmpHeading))); + _textCenterLine2 = str(round(GVAR(TmpHeading))); _textCenterLine3 = "Press < and >"; _textCenterLine4 = "to Adjust"; _textCenterLine5 = "================"; diff --git a/addons/kestrel4500/functions/fnc_measureWindSpeed.sqf b/addons/kestrel4500/functions/fnc_measureWindSpeed.sqf index 9ecbca180cc..756a5418a49 100644 --- a/addons/kestrel4500/functions/fnc_measureWindSpeed.sqf +++ b/addons/kestrel4500/functions/fnc_measureWindSpeed.sqf @@ -15,7 +15,7 @@ * Public: No */ -private _playerDir = getDir ACE_player; +private _playerDir = (ACE_player call CBA_fnc_headDir) select 0; private _windSpeed = vectorMagnitude wind; private _windDir = (wind select 0) atan2 (wind select 1); if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { diff --git a/addons/killtracker/XEH_postInit.sqf b/addons/killtracker/XEH_postInit.sqf index 35050d1dc30..bf944c930e0 100644 --- a/addons/killtracker/XEH_postInit.sqf +++ b/addons/killtracker/XEH_postInit.sqf @@ -16,7 +16,7 @@ * Public: No */ -if ((getText (missionconfigfile >> "CfgDebriefingSections" >> QUOTE(XADDON) >> "variable")) != QXGVAR(outputText)) exitWith { +if ((getText (missionConfigFile >> "CfgDebriefingSections" >> QUOTE(XADDON) >> "variable")) != QXGVAR(outputText)) exitWith { TRACE_1("no mission debriefing config",_this); }; @@ -65,7 +65,7 @@ GVAR(killCount) = 0; private _killInfo = []; if (!isNull _killer) then { - if !(_killer isKindof "CAManBase") then { // If killer is a vehicle log the vehicle type + if !(_killer isKindOf "CAManBase") then { // If killer is a vehicle log the vehicle type _killInfo pushBack format [LLSTRING(Vehicle), getText ((configOf _killer) >> "displayName")]; }; if (isNull _instigator) then { diff --git a/addons/killtracker/stringtable.xml b/addons/killtracker/stringtable.xml index 64b9ee764d4..9ab1423f1f5 100644 --- a/addons/killtracker/stringtable.xml +++ b/addons/killtracker/stringtable.xml @@ -126,6 +126,7 @@ <Italian>Mostra uccisioni del veicolo a membri dell'equipaggio</Italian> <Japanese>車両でのキルを乗員全員に表示する</Japanese> <Korean>다른 승무원에게 차량 처치 표시</Korean> + <French>Montrer les véhicules tués aux membres de l'équipage</French> </Key> <Key ID="STR_ACE_KillTracker_showCrewKills_Description"> <English>Show kills from a vehicle to driver, gunner and commander</English> @@ -134,6 +135,7 @@ <Italian>Mostra uccisioni del veicolo al pilota, artigliere e comandante</Italian> <Japanese>車両でのキルを操縦手、砲手、車長で共有して表示する</Japanese> <Korean>차량 처치를 운전수, 사수, 지휘관에게 보여줍니다</Korean> + <French>Montrer les véhicules tués au pilote, à l'artilleur et au commandant.</French> </Key> </Package> </Project> diff --git a/addons/laser/RscTitles.hpp b/addons/laser/RscTitles.hpp index 7421246181b..c63b601ab77 100644 --- a/addons/laser/RscTitles.hpp +++ b/addons/laser/RscTitles.hpp @@ -9,10 +9,10 @@ class RscTitles { class controls { class ModeControlGroup: RscControlsGroupNoScrollbars { idc = IDC_MODECONTROLGROUP; - x = "3.8 * (((safezoneW / safezoneH) min 1.2) / 40) + (profilenamespace getvariable ['IGUI_GRID_WEAPON_X',((safezoneX + safezoneW) - (10 * (((safezoneW / safezoneH) min 1.2) / 40)) - 4.3 * (((safezoneW / safezoneH) min 1.2) / 40))])"; - y = "2.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (profilenamespace getVariable ['IGUI_GRID_WEAPON_Y', (safezoneY + 0.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25))])"; - w = "10 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = "3.8 * (((safeZoneW / safeZoneH) min 1.2) / 40) + (profilenamespace getvariable ['IGUI_GRID_WEAPON_X',((safeZoneX + safeZoneW) - (10 * (((safeZoneW / safeZoneH) min 1.2) / 40)) - 4.3 * (((safeZoneW / safeZoneH) min 1.2) / 40))])"; + y = "2.5 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (profilenamespace getVariable ['IGUI_GRID_WEAPON_Y', (safeZoneY + 0.5 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25))])"; + w = "10 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; class controls { class AttackMode: RscText { @@ -21,29 +21,29 @@ class RscTitles { colorBackground[] = {0, 0, 0, 0}; x = "0"; y = "0"; - w = "(2.6) * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - sizeEx = "0.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w = "(2.6) * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; + sizeEx = "0.8 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class LaserCode: RscText { idc = IDC_LASERCODE; colorText[] = {1, 1, 1, 1}; colorBackground[] = {0, 0, 0, 0}; - x = "(3.6) * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = "(3.6) * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; y = "0"; - w = "(2.5) * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - h = "(1) * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - sizeEx = "0.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w = "(2.5) * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; + h = "(1) * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; + sizeEx = "0.8 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class LaserIcon: RscPictureKeepAspect { idc = IDC_LASERICON; colorText[] = {1, 0, 0, 1}; colorBackground[] = {0, 0, 0, 0}; text = "\a3\Ui_F_Curator\Data\CfgCurator\laser_ca.paa"; - x = "(6.1) * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = "(6.1) * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; y = "0"; - w = "(1) * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - h = "(1) * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w = "(1) * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; + h = "(1) * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; }; }; diff --git a/addons/laser/XEH_postInit.sqf b/addons/laser/XEH_postInit.sqf index 768752bee2e..eb4cb247ed7 100644 --- a/addons/laser/XEH_postInit.sqf +++ b/addons/laser/XEH_postInit.sqf @@ -21,10 +21,10 @@ if (hasInterface) then { ["ACE_controlledUAV", { params ["_UAV", "_seatAI", "_turret", "_position"]; TRACE_4("ACE_controlledUAV EH",_UAV,_seatAI,_turret,_position); - if (!isNull _seatAI) then { - [_seatAI] call FUNC(showVehicleHud); - } else { + if (isNull _seatAI) then { [ace_player] call FUNC(showVehicleHud); + } else { + [_seatAI] call FUNC(showVehicleHud); }; }] call CBA_fnc_addEventHandler; }] call CBA_fnc_addEventHandler; diff --git a/addons/laser/functions/fnc_addLaserTarget.sqf b/addons/laser/functions/fnc_addLaserTarget.sqf index 3fc02b2189c..f0414fd3ad2 100644 --- a/addons/laser/functions/fnc_addLaserTarget.sqf +++ b/addons/laser/functions/fnc_addLaserTarget.sqf @@ -20,9 +20,9 @@ params ["_targetObject", "_vehicle"]; TRACE_2("params",_targetObject,_vehicle); // Get the designator variables, or use defaults -private _waveLength = _vehicle getVariable [QEGVAR(laser,waveLength), ACE_DEFAULT_LASER_WAVELENGTH]; -private _laserCode = _vehicle getVariable [QEGVAR(laser,code), ACE_DEFAULT_LASER_CODE]; -private _beamSpread = _vehicle getVariable [QEGVAR(laser,beamSpread), ACE_DEFAULT_LASER_BEAMSPREAD]; +private _waveLength = _vehicle getVariable [QGVAR(waveLength), ACE_DEFAULT_LASER_WAVELENGTH]; +private _laserCode = _vehicle getVariable [QGVAR(code), ACE_DEFAULT_LASER_CODE]; +private _beamSpread = _vehicle getVariable [QGVAR(beamSpread), ACE_DEFAULT_LASER_BEAMSPREAD]; TRACE_3("codes",_waveLength,_laserCode,_beamSpread); // Laser method is the method ACE_Laser will use to determine from where to where it should project the designator cone diff --git a/addons/laser/functions/fnc_dev_drawVisibleLaserTargets.sqf b/addons/laser/functions/fnc_dev_drawVisibleLaserTargets.sqf index 4c57a613252..294a0262385 100644 --- a/addons/laser/functions/fnc_dev_drawVisibleLaserTargets.sqf +++ b/addons/laser/functions/fnc_dev_drawVisibleLaserTargets.sqf @@ -35,8 +35,8 @@ private _testSeekerDir = vectorDirVisual _seekerVehicle; private _resultPos = _results select 0; if (!isNil "_resultPos") then { // Draw lock results - drawLine3D [ASLtoAGL _testSeekerPosASL, ASLtoAGL _resultPos, [0,0,1,1]]; - drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\select_target_ca.paa", [0,0,1,1], (ASLtoAGL _resultPos), 1.5, 1.5, 45, format ["%1 from %2", _code, _results select 1], 0.5, 0.025, "TahomaB"]; + drawLine3D [ASLToAGL _testSeekerPosASL, ASLToAGL _resultPos, [0,0,1,1]]; + drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\select_target_ca.paa", [0,0,1,1], (ASLToAGL _resultPos), 1.5, 1.5, 45, format ["%1 from %2", _code, _results select 1], 0.5, 0.025, "TahomaB"]; }; } forEach [ACE_DEFAULT_LASER_CODE, 1688]; // Scan at codes 1111 and 1688 @@ -51,29 +51,29 @@ private _testSeekerDir = vectorDirVisual _seekerVehicle; if (_laserMethod isEqualTo QFUNC(findLaserSource)) then { // Normal vanilla laserTarget func private _targetObject = _obj getVariable [QGVAR(targetObject), objNull]; private _targetPosASL = getPosASL _targetObject; - drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\select_target_ca.paa", [1,0,0,1], (ASLtoAGL _targetPosASL), 0.5, 0.5, 0, "", 0.5, 0.025, "TahomaB"]; + drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\select_target_ca.paa", [1,0,0,1], (ASLToAGL _targetPosASL), 0.5, 0.5, 0, "", 0.5, 0.025, "TahomaB"]; (_y call FUNC(findLaserSource)) params ["_laserPosASL", "_laserDir"]; private _resultsRay = [_laserPosASL, _laserDir, _obj] call FUNC(shootRay); private _rayPos = _resultsRay select 0; if (isNil "_rayPos") then { - drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\select_target_ca.paa", [1,0,0,1], (ASLtoAGL _targetPosASL), 2, 2, 0, "Nil Ray", 0.5, 0.025, "TahomaB"]; + drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\select_target_ca.paa", [1,0,0,1], (ASLToAGL _targetPosASL), 2, 2, 0, "Nil Ray", 0.5, 0.025, "TahomaB"]; } else { private _diff = _rayPos vectorDistance (getPosASL _targetObject); // Diff from ray position compared to actual - drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\select_target_ca.paa", [1,0,0,1], (ASLtoAGL _rayPos), 2, 2, 0, format ["Diff %1",_diff], 0.5, 0.025, "TahomaB"]; + drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\select_target_ca.paa", [1,0,0,1], (ASLToAGL _rayPos), 2, 2, 0, format ["Diff %1",_diff], 0.5, 0.025, "TahomaB"]; }; }; // Draw array weapon lasers [YELLOW] if ((_laserMethod isEqualType []) && {(count _laserMethod) == 2}) then { _laserMethod params ["_modelPosition", "_weaponName"]; private _laserPosASL = _obj modelToWorldVisualWorld _modelPosition; - drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\select_target_ca.paa", [1,1,0,1], (ASLtoAGL _laserPosASL), 0.5, 0.5, 0, _weaponName, 0.5, 0.025, "TahomaB"]; + drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\select_target_ca.paa", [1,1,0,1], (ASLToAGL _laserPosASL), 0.5, 0.5, 0, _weaponName, 0.5, 0.025, "TahomaB"]; private _laserDir = _obj weaponDirection _weaponName; private _resultsRay = [_laserPosASL, _laserDir, _obj] call FUNC(shootRay); private _rayPos = _resultsRay select 0; if (!isNil "_rayPos") then { - drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\select_target_ca.paa", [1,1,0,1], (ASLtoAGL _rayPos), 2, 2, 0, _weaponName, 0.5, 0.025, "TahomaB"]; + drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\select_target_ca.paa", [1,1,0,1], (ASLToAGL _rayPos), 2, 2, 0, _weaponName, 0.5, 0.025, "TahomaB"]; }; }; } forEach GVAR(laserEmitters); diff --git a/addons/laser/functions/fnc_handleLaserTargetCreation.sqf b/addons/laser/functions/fnc_handleLaserTargetCreation.sqf index bd42a3e5a53..4d5a7164b75 100644 --- a/addons/laser/functions/fnc_handleLaserTargetCreation.sqf +++ b/addons/laser/functions/fnc_handleLaserTargetCreation.sqf @@ -22,13 +22,13 @@ TRACE_1("params",_this); // Only handle locally created lasers if(!(local _targetObject)) exitWith {TRACE_1("not local",_targetObject);}; - private _owners = allUnits select {(lasertarget _x) == _targetObject}; + private _owners = allUnits select {(laserTarget _x) == _targetObject}; if (count _owners == 1) exitWith { TRACE_2("Laser target owner [allUnits]",_targetObject,_owners select 0); [_targetObject, _owners select 0] call FUNC(addLaserTarget); }; - _owners = vehicles select {(lasertarget _x) == _targetObject}; + _owners = vehicles select {(laserTarget _x) == _targetObject}; if (count _owners == 1) exitWith { TRACE_2("Laser target owner [vehicles]",_targetObject,_owners select 0); [_targetObject, _owners select 0] call FUNC(addLaserTarget); @@ -58,7 +58,7 @@ TRACE_1("params",_this); }; }; if (!_foundSource) then { - WARNING_1("Laser target doesn't have owner",_targetObject); + WARNING_1("Laser target %1 doesn't have owner",_targetObject); }; }, _this] call CBA_fnc_execNextFrame; diff --git a/addons/laser/functions/fnc_laserTargetPFH.sqf b/addons/laser/functions/fnc_laserTargetPFH.sqf index 0b19b4d1c34..af2098a6f8d 100644 --- a/addons/laser/functions/fnc_laserTargetPFH.sqf +++ b/addons/laser/functions/fnc_laserTargetPFH.sqf @@ -29,7 +29,7 @@ GVAR(trackedLaserTargets) = GVAR(trackedLaserTargets) select { TRACE_1("Laser off:",_laserUuid); false } else { - private _newCode = _owner getVariable [QEGVAR(laser,code), ACE_DEFAULT_LASER_CODE]; + private _newCode = _owner getVariable [QGVAR(code), ACE_DEFAULT_LASER_CODE]; if (_laserCode != _newCode) then { TRACE_2("code change",_newCode,_laserCode); [QGVAR(updateCode), [_laserUuid, _newCode]] call CBA_fnc_globalEvent; diff --git a/addons/laser/functions/fnc_seekerFindLaserSpot.sqf b/addons/laser/functions/fnc_seekerFindLaserSpot.sqf index 4ceb15d8148..cf805f7496f 100644 --- a/addons/laser/functions/fnc_seekerFindLaserSpot.sqf +++ b/addons/laser/functions/fnc_seekerFindLaserSpot.sqf @@ -72,7 +72,7 @@ private _finalOwner = objNull; TRACE_1("",_laser); //Handle Weird Data Return - skips over this laser in the for loop - if ((_laser isEqualTo []) || {_laser isEqualTo [-1, -1]}) exitWith {WARNING_1("Bad Laser Return",_laser);}; + if ((_laser isEqualTo []) || {_laser isEqualTo [-1, -1]}) exitWith {WARNING_1("Bad Laser Return %1",_laser);}; _laser params [["_laserPos", [], [[]], 3], ["_laserDir", [], [[]], 3]]; if (GVAR(dispersionCount) > 0) then { @@ -192,10 +192,10 @@ END_COUNTER(seekerFindLaserSpot); #ifdef DRAW_LASER_INFO if (isNil "_finalPos") then { - drawIcon3D ["\A3\ui_f\data\map\vehicleicons\iconMan_ca.paa", [0.9,1,0,1], (ASLtoAGL _posASL), 1, 1, 0, format ["Seeker: %1", _seekerCode], 0.5, 0.025, "TahomaB"]; + drawIcon3D ["\A3\ui_f\data\map\vehicleicons\iconMan_ca.paa", [0.9,1,0,1], (ASLToAGL _posASL), 1, 1, 0, format ["Seeker: %1", _seekerCode], 0.5, 0.025, "TahomaB"]; } else { - drawIcon3D ["\A3\ui_f\data\map\vehicleicons\iconManAT_ca.paa", [0.5,1,0,1], (ASLtoAGL _posASL), 1, 1, 0, format ["Seeker: %1", _seekerCode], 0.5, 0.025, "TahomaB"]; - drawLine3D [ASLtoAGL _posASL, ASLtoAGL _finalPos, [0.5,1,0,1]]; + drawIcon3D ["\A3\ui_f\data\map\vehicleicons\iconManAT_ca.paa", [0.5,1,0,1], (ASLToAGL _posASL), 1, 1, 0, format ["Seeker: %1", _seekerCode], 0.5, 0.025, "TahomaB"]; + drawLine3D [ASLToAGL _posASL, ASLToAGL _finalPos, [0.5,1,0,1]]; }; #endif diff --git a/addons/laser/functions/fnc_shootRay.sqf b/addons/laser/functions/fnc_shootRay.sqf index 862e972dd1b..9b8341909c3 100644 --- a/addons/laser/functions/fnc_shootRay.sqf +++ b/addons/laser/functions/fnc_shootRay.sqf @@ -48,8 +48,8 @@ TRACE_3("",_resultPos,_distance,_intersects); #ifdef DRAW_LASER_INFO if (!isNil "_resultPos") then { private _text = [_distance, 4, 0] call CBA_fnc_formatNumber; - drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [0, 1, 0, 1], ASLtoAGL _resultPos, 0.5, 0.5, 0, _text, 0.4, 0.025, "TahomaB"]; - drawLine3D [ASLtoAGL _posASL, ASLtoAGL _resultPos, [0,1,0,1]]; + drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [0, 1, 0, 1], ASLToAGL _resultPos, 0.5, 0.5, 0, _text, 0.4, 0.025, "TahomaB"]; + drawLine3D [ASLToAGL _posASL, ASLToAGL _resultPos, [0,1,0,1]]; }; #endif diff --git a/addons/laser/functions/fnc_showVehicleHud.sqf b/addons/laser/functions/fnc_showVehicleHud.sqf index 778df61a6ca..856030bf8cb 100644 --- a/addons/laser/functions/fnc_showVehicleHud.sqf +++ b/addons/laser/functions/fnc_showVehicleHud.sqf @@ -68,7 +68,7 @@ GVAR(pfID) = [{ if (_adjustDown) then { private _ctrl = (uiNamespace getVariable [QGVAR(display), displayNull]) displayCtrl IDC_MODECONTROLGROUP; private _pos = ctrlPosition _ctrl; - _pos set [1, (_pos select 1) + ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)]; + _pos set [1, (_pos select 1) + ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)]; _ctrl ctrlSetPosition _pos; _ctrl ctrlCommit 0; }; @@ -91,7 +91,7 @@ GVAR(pfID) = [{ // Do Laser Scan: private _ammo = getText (configFile >> "CfgMagazines" >> _vehicle currentMagazineTurret _turretPath >> "ammo"); private _laserSource = _vehicle modelToWorldWorld (_vehicle selectionPosition _seekerSource); - private _laserCode = _vehicle getVariable [QEGVAR(laser,code), ACE_DEFAULT_LASER_CODE]; + private _laserCode = _vehicle getVariable [QGVAR(code), ACE_DEFAULT_LASER_CODE]; private _seekerAngle = getNumber (configFile >> "CfgAmmo" >> _ammo >> "ace_missileguidance" >> "seekerAngle"); private _seekerMaxRange = getNumber (configFile >> "CfgAmmo" >> _ammo >> "ace_missileguidance" >> "seekerMaxRange"); private _laserResult = [_laserSource, vectorDir _vehicle, _seekerAngle, _seekerMaxRange, [ACE_DEFAULT_LASER_WAVELENGTH,ACE_DEFAULT_LASER_WAVELENGTH], _laserCode, _vehicle] call EFUNC(laser,seekerFindLaserSpot); diff --git a/addons/laser/functions/fnc_toggleLST.sqf b/addons/laser/functions/fnc_toggleLST.sqf index 59969d014eb..eae4ad68ef7 100644 --- a/addons/laser/functions/fnc_toggleLST.sqf +++ b/addons/laser/functions/fnc_toggleLST.sqf @@ -39,7 +39,7 @@ if (_enabled) exitWith {}; [_pfhID] call CBA_fnc_removePerFrameHandler; }; - private _laserCode = _vehicle getVariable [QEGVAR(laser,code), ACE_DEFAULT_LASER_CODE]; + private _laserCode = _vehicle getVariable [QGVAR(code), ACE_DEFAULT_LASER_CODE]; private _angle = 25; private _pos = _vehicle modelToWorldVisualWorld [0,0,0]; diff --git a/addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf b/addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf index 2176793aed5..8b44f7be5a6 100644 --- a/addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf +++ b/addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf @@ -63,7 +63,7 @@ if !(_unit call EFUNC(common,isSwimming)) then { !isNull _fence && {damage _fence < 1} - && {HAS_WIRECUTTER(_player)} + && {HAS_WIRECUTTER(_unit)} }, ["isNotSwimming"] ] call EFUNC(common,progressBar); diff --git a/addons/magazinerepack/functions/fnc_canRepackMagazine.sqf b/addons/magazinerepack/functions/fnc_canRepackMagazine.sqf index d6d8f3b827c..2c32ec57276 100644 --- a/addons/magazinerepack/functions/fnc_canRepackMagazine.sqf +++ b/addons/magazinerepack/functions/fnc_canRepackMagazine.sqf @@ -18,6 +18,9 @@ params ["_unit", "_magazine"]; +// Exit if repack is disabled for this magazine. +if (getNumber (configFile >> "CfgMagazines" >> _magazine >> "ace_disableRepacking") == 1) exitWith {false}; + private _maxAmmoCount = getNumber (configFile >> "CfgMagazines" >> _magazine >> "count"); { diff --git a/addons/magazinerepack/functions/fnc_getMagazineChildren.sqf b/addons/magazinerepack/functions/fnc_getMagazineChildren.sqf index b4cf8b16ef6..09d6974fefe 100644 --- a/addons/magazinerepack/functions/fnc_getMagazineChildren.sqf +++ b/addons/magazinerepack/functions/fnc_getMagazineChildren.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: PabstMirror, commy2, esteldunedain, Ruthberg - * Gets magazine children for interaciton menu. + * Gets magazine children for interaction menu. * * Arguments: * 0: Target <OBJECT> @@ -18,16 +18,20 @@ params ["_target", "_player"]; +private _cfgMagazines = configFile >> "CfgMagazines"; + // get all mags and ammo count private _unitMagazines = []; private _unitMagCounts = []; { _x params ["_xClassname", "_xCount", "_xLoaded", "_xType"]; - private _xFullMagazineCount = getNumber (configFile >> "CfgMagazines" >> _xClassname >> "count"); + private _configMagazine = _cfgMagazines >> _xClassname; + private _xFullMagazineCount = getNumber (_configMagazine >> "count"); + private _isRepackDisabled = getNumber (_configMagazine >> "ace_disableRepacking") == 1; //for every partial magazine, that is either in inventory or can be moved there - if ((_xCount < _xFullMagazineCount) && {_xCount > 0} && {(!_xLoaded) || {GVAR(repackLoadedMagazines) && {[_player, _xClassname] call CBA_fnc_canAddItem}}}) then { + if ((!_isRepackDisabled) && {_xCount < _xFullMagazineCount} && {_xCount > 0} && {(!_xLoaded) || {GVAR(repackLoadedMagazines) && {[_player, _xClassname] call CBA_fnc_canAddItem}}}) then { private _index = _unitMagazines find _xClassname; if (_index == -1) then { _unitMagazines pushBack _xClassname; diff --git a/addons/main/script_mod.hpp b/addons/main/script_mod.hpp index 12faeb07c07..7ca3793586c 100644 --- a/addons/main/script_mod.hpp +++ b/addons/main/script_mod.hpp @@ -10,7 +10,7 @@ #define VERSION_AR MAJOR,MINOR,PATCHLVL,BUILD // MINIMAL required version for the Mod. Components can specify others.. -#define REQUIRED_VERSION 2.14 +#define REQUIRED_VERSION 2.16 #define REQUIRED_CBA_VERSION {3,16,0} #ifndef COMPONENT_BEAUTIFIED diff --git a/addons/main/script_version.hpp b/addons/main/script_version.hpp index 75b323ede34..2ccada406ec 100644 --- a/addons/main/script_version.hpp +++ b/addons/main/script_version.hpp @@ -1,4 +1,4 @@ #define MAJOR 3 -#define MINOR 17 -#define PATCHLVL 1 -#define BUILD 86 +#define MINOR 18 +#define PATCHLVL 0 +#define BUILD 90 diff --git a/addons/map/XEH_postInitClient.sqf b/addons/map/XEH_postInitClient.sqf index 717d6756183..d116bf04f75 100644 --- a/addons/map/XEH_postInitClient.sqf +++ b/addons/map/XEH_postInitClient.sqf @@ -116,6 +116,7 @@ GVAR(vehicleLightColor) = [1,1,1,0]; compile _vehicleLightCondition }; } else { + //IGNORE_PRIVATE_WARNING ["_vehicle", "_unit"]; switch (true) do { case (_vehicle isKindOf "Tank"); case (_vehicle isKindOf "Wheeled_APC_F"): { {true} }; diff --git a/addons/map/config.cpp b/addons/map/config.cpp index 943a63c228e..a4d086d6029 100644 --- a/addons/map/config.cpp +++ b/addons/map/config.cpp @@ -119,16 +119,16 @@ class RscDisplayDiary { onButtonClick = ""; }; class CA_PlayerName: RscText { - x = "2 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; + x = "2 * ( ((safeZoneW / safeZoneH) min 1.2) / 40)"; }; class ProfilePicture: RscPicture { - x = "13.5 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; + x = "13.5 * ( ((safeZoneW / safeZoneH) min 1.2) / 40)"; }; class ProfileBackground: RscText { - x = "13.3 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; + x = "13.3 * ( ((safeZoneW / safeZoneH) min 1.2) / 40)"; }; class Separator1: RscPicture { - x = "14.5 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; + x = "14.5 * ( ((safeZoneW / safeZoneH) min 1.2) / 40)"; }; }; }; diff --git a/addons/map/functions/fnc_blueForceTrackingModule.sqf b/addons/map/functions/fnc_blueForceTrackingModule.sqf index af95ce3d6d0..8a2dcbf2452 100644 --- a/addons/map/functions/fnc_blueForceTrackingModule.sqf +++ b/addons/map/functions/fnc_blueForceTrackingModule.sqf @@ -22,4 +22,4 @@ params ["_logic"]; [_logic, QGVAR(BFT_HideAiGroups), "HideAiGroups"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(BFT_ShowPlayerNames), "ShowPlayerNames"] call EFUNC(common,readSettingFromModule); -INFO_3("Blue Force Tracking Module Initialized:",GVAR(BFT_Enabled),GVAR(BFT_Interval),GVAR(BFT_HideAiGroups)); +INFO_3("Blue Force Tracking Module Initialized:%1-%2-%3",GVAR(BFT_Enabled),GVAR(BFT_Interval),GVAR(BFT_HideAiGroups)); diff --git a/addons/map/functions/fnc_compileFlashlightMenu.sqf b/addons/map/functions/fnc_compileFlashlightMenu.sqf index 4dc24a23f64..b0778981a7e 100644 --- a/addons/map/functions/fnc_compileFlashlightMenu.sqf +++ b/addons/map/functions/fnc_compileFlashlightMenu.sqf @@ -30,6 +30,7 @@ _unitLight params ["_flashlight", ""]; private _displayName = getText (_cfg >> "displayName"); private _icon = getText (_cfg >> "picture"); + //IGNORE_PRIVATE_WARNING ["_player"]; private _statement = if (_flashlight == _x) then { _displayName = format [localize LSTRING(turnLightOff), _displayName]; {[_player, ""] call FUNC(switchFlashlight)} diff --git a/addons/map/stringtable.xml b/addons/map/stringtable.xml index 5d91167639b..13ee042d1f0 100644 --- a/addons/map/stringtable.xml +++ b/addons/map/stringtable.xml @@ -492,7 +492,7 @@ <Spanish>Setear canal al comenzar</Spanish> <French>Définir un canal par défaut</French> <Japanese>開始時のチャンネルを指定</Japanese> - <Korean>시작시 채널</Korean> + <Korean>시작 시 채널 설정</Korean> <Chinesesimp>设定游戏开始时的聊天频道</Chinesesimp> <Chinese>設定遊戲開始時的聊天頻道</Chinese> </Key> @@ -507,7 +507,7 @@ <Spanish>Cambiar el canal de marcadores inicial al comenzar la misión</Spanish> <French>Change le canal de communication par défaut au début de la mission.</French> <Japanese>ミッション開始時に使用されるマーカーチャンネルの指定を変更します</Japanese> - <Korean>미션 시작시 마커채널을 변경합니다</Korean> + <Korean>미션 시작 시 마커채널을 변경합니다</Korean> <Chinesesimp>更改任务启动时的聊天频道</Chinesesimp> <Chinese>更改任務啟動時的聊天頻道</Chinese> </Key> diff --git a/addons/map_gestures/functions/fnc_addGroupColorMapping.sqf b/addons/map_gestures/functions/fnc_addGroupColorMapping.sqf index f533f9df345..c5577fb7e88 100644 --- a/addons/map_gestures/functions/fnc_addGroupColorMapping.sqf +++ b/addons/map_gestures/functions/fnc_addGroupColorMapping.sqf @@ -22,7 +22,7 @@ if (!params [["_group", "", [grpNull, ""]], ["_leadColor", [1,1,1,1], [[]], 4], }; TRACE_3("params",_group,_leadColor,_unitColor); -if (_group isEqualType grpNull) then {_group = groupID _group}; +if (_group isEqualType grpNull) then {_group = groupId _group}; if (_group == "") exitWith {ERROR("Group ID is blank, which is not valid.")}; if !([_leadColor] call FUNC(isValidColorArray)) exitWith {ERROR("leadColor is not a valid color array.")}; diff --git a/addons/map_gestures/functions/fnc_drawMapGestures.sqf b/addons/map_gestures/functions/fnc_drawMapGestures.sqf index 0a69c1924b8..35b462910a8 100644 --- a/addons/map_gestures/functions/fnc_drawMapGestures.sqf +++ b/addons/map_gestures/functions/fnc_drawMapGestures.sqf @@ -41,7 +41,7 @@ private _players = [_positions, FUNC(getProximityPlayers), missionNamespace, QGV }; // If color settings for the group exist, then use those, otherwise fall back to the default colors - private _colorMap = GVAR(GroupColorCfgMappingNew) getOrDefault [toLower groupID (group _x), [GVAR(defaultLeadColor), GVAR(defaultColor)]]; + private _colorMap = GVAR(GroupColorCfgMappingNew) getOrDefault [toLower groupId (group _x), [GVAR(defaultLeadColor), GVAR(defaultColor)]]; private _color = _colorMap select (_x != leader _x); TRACE_2("",_colorMap,_color); diff --git a/addons/map_gestures/functions/fnc_initDisplaySpectator.sqf b/addons/map_gestures/functions/fnc_initDisplaySpectator.sqf index dbbd31ae65c..7c1f09bbf53 100644 --- a/addons/map_gestures/functions/fnc_initDisplaySpectator.sqf +++ b/addons/map_gestures/functions/fnc_initDisplaySpectator.sqf @@ -23,11 +23,11 @@ _mapCtrl ctrlAddEventHandler ["Draw", { private _aceSpectatorFocus = missionNamespace getVariable [QEGVAR(spectator,camFocus), objNull]; if (!isNull _aceSpectatorFocus) then { - _targets pushback [_aceSpectatorFocus, GVAR(maxRange)]; + _targets pushBack [_aceSpectatorFocus, GVAR(maxRange)]; }; private _vanillaSpectatorFocus = uiNamespace getVariable ["RscEGSpectator_focus", objNull]; if (!isNull _vanillaSpectatorFocus) then { - _targets pushback [_vanillaSpectatorFocus, GVAR(maxRange)]; + _targets pushBack [_vanillaSpectatorFocus, GVAR(maxRange)]; }; [_this select 0, _targets] call FUNC(drawMapGestures); }]; diff --git a/addons/map_gestures/stringtable.xml b/addons/map_gestures/stringtable.xml index cff2d15f4ff..94c6d05ef10 100644 --- a/addons/map_gestures/stringtable.xml +++ b/addons/map_gestures/stringtable.xml @@ -75,7 +75,7 @@ <German>Maximale Reichweite zwischen Spielern um Kartenzeichen anzuzeigen</German> <Spanish>Máxima distancia a la cual pueden verse el indicador de gestos</Spanish> <French>Définit le rayon au-delà duquel un joueur ne verra plus l'indicateur de pointage des autres joueurs.</French> - <Japanese>マップ ジェスチャのインジケータを表示可能なプレーヤー間の最大距離</Japanese> + <Japanese>マップ ジェスチャのインジケータを表示可能なプレーヤー間の最大範囲距離</Japanese> <Korean>플레이어간에 지도 신호 표시거리를 설정합니다.</Korean> <Chinesesimp>设定地图指示显示的最大范围距离</Chinesesimp> <Chinese>設定地圖指示器顯示的最大範圍距離</Chinese> diff --git a/addons/maptools/functions/fnc_drawLinesOnRoamer.sqf b/addons/maptools/functions/fnc_drawLinesOnRoamer.sqf index 782d8762a07..652edf8768b 100644 --- a/addons/maptools/functions/fnc_drawLinesOnRoamer.sqf +++ b/addons/maptools/functions/fnc_drawLinesOnRoamer.sqf @@ -73,11 +73,11 @@ switch (true) do { GVAR(freeDrawingData) = ["left", _currentMousePos, _currentMousePos]; } else { if ((GVAR(freeDrawingData) select 0) == "left") then { // We are already drawing on this line, find best spot - if ((_currentMousePos distance2d _posTopLeft) < ((GVAR(freeDrawingData) select 1) distance2d _posTopLeft)) then { + if ((_currentMousePos distance2D _posTopLeft) < ((GVAR(freeDrawingData) select 1) distance2D _posTopLeft)) then { GVAR(freeDrawingData) set [1, _currentMousePos]; }; - if ((_currentMousePos distance2d _posBottomLeft) < ((GVAR(freeDrawingData) select 2) distance2d _posBottomLeft)) then { + if ((_currentMousePos distance2D _posBottomLeft) < ((GVAR(freeDrawingData) select 2) distance2D _posBottomLeft)) then { GVAR(freeDrawingData) set [2, _currentMousePos]; }; }; @@ -95,11 +95,11 @@ switch (true) do { GVAR(freeDrawingData) = ["top", _currentMousePos, _currentMousePos]; } else { if ((GVAR(freeDrawingData) select 0) == "top") then { // We are already drawing on this line, find best spot - if ((_currentMousePos distance2d _posTopLeft) < ((GVAR(freeDrawingData) select 1) distance2d _posTopLeft)) then { + if ((_currentMousePos distance2D _posTopLeft) < ((GVAR(freeDrawingData) select 1) distance2D _posTopLeft)) then { GVAR(freeDrawingData) set [1, _currentMousePos]; }; - if ((_currentMousePos distance2d _posTopRight) < ((GVAR(freeDrawingData) select 2) distance2d _posTopRight)) then { + if ((_currentMousePos distance2D _posTopRight) < ((GVAR(freeDrawingData) select 2) distance2D _posTopRight)) then { GVAR(freeDrawingData) set [2, _currentMousePos]; }; }; @@ -117,11 +117,11 @@ switch (true) do { GVAR(freeDrawingData) = ["right", _currentMousePos, _currentMousePos]; } else { if ((GVAR(freeDrawingData) select 0) == "right") then { // We are already drawing on this line, find best spot - if ((_currentMousePos distance2d _posTopRight) < ((GVAR(freeDrawingData) select 1) distance2d _posTopRight)) then { + if ((_currentMousePos distance2D _posTopRight) < ((GVAR(freeDrawingData) select 1) distance2D _posTopRight)) then { GVAR(freeDrawingData) set [1, _currentMousePos]; }; - if ((_currentMousePos distance2d _posBottomRight) < ((GVAR(freeDrawingData) select 2) distance2d _posBottomRight)) then { + if ((_currentMousePos distance2D _posBottomRight) < ((GVAR(freeDrawingData) select 2) distance2D _posBottomRight)) then { GVAR(freeDrawingData) set [2, _currentMousePos]; }; }; @@ -139,11 +139,11 @@ switch (true) do { GVAR(freeDrawingData) = ["bottom", _currentMousePos, _currentMousePos]; } else { if ((GVAR(freeDrawingData) select 0) == "bottom") then { // We are already drawing on this line, find best spot - if ((_currentMousePos distance2d _posBottomLeft) < ((GVAR(freeDrawingData) select 1) distance2d _posBottomLeft)) then { + if ((_currentMousePos distance2D _posBottomLeft) < ((GVAR(freeDrawingData) select 1) distance2D _posBottomLeft)) then { GVAR(freeDrawingData) set [1, _currentMousePos]; }; - if ((_currentMousePos distance2d _posBottomRight) < ((GVAR(freeDrawingData) select 2) distance2d _posBottomRight)) then { + if ((_currentMousePos distance2D _posBottomRight) < ((GVAR(freeDrawingData) select 2) distance2D _posBottomRight)) then { GVAR(freeDrawingData) set [2, _currentMousePos]; }; }; diff --git a/addons/maptools/functions/fnc_isInsidePlottingBoard.sqf b/addons/maptools/functions/fnc_isInsidePlottingBoard.sqf index e3e64675080..b9c4b7f4570 100644 --- a/addons/maptools/functions/fnc_isInsidePlottingBoard.sqf +++ b/addons/maptools/functions/fnc_isInsidePlottingBoard.sqf @@ -27,7 +27,6 @@ private _isRuler = if (GVAR(plottingBoard_Shown) == 2) then { if (_dist <= PLOTTINGBOARD_RULERCENTER) exitWith {true}; private _rulerVector = [sin GVAR(plottingBoard_rulerAngle), cos GVAR(plottingBoard_rulerAngle)]; - private _dirRightVector = [_dirVector select 1, -(_dirVector select 0)]; private _rulerAng = acos (_rulerVector vectorCos _relPos); if (cos _rulerAng > 0 && {(tan _rulerAng) * _dist < PLOTTINGBOARD_RULERHALFWIDTH}) exitWith {true}; diff --git a/addons/maptools/functions/fnc_updateMapToolMarkers.sqf b/addons/maptools/functions/fnc_updateMapToolMarkers.sqf index 1a6d83b6985..f26c831b7e8 100644 --- a/addons/maptools/functions/fnc_updateMapToolMarkers.sqf +++ b/addons/maptools/functions/fnc_updateMapToolMarkers.sqf @@ -71,7 +71,7 @@ if (GVAR(plottingBoard_Shown) == 0) then { // Rotate all points of polyline if (_count >= 4) then { // polylines need at least 2 points (2 components per point) - _rotatedPolyline = []; + private _rotatedPolyline = []; for "_i" from 0 to _count - 1 step 2 do { _rotatedPolyPos = [[0, 0], [_polyline select _i, _polyline select (_i + 1)], -_angle] call CBA_fnc_vectRotate2D; diff --git a/addons/marker_flags/XEH_postInit.sqf b/addons/marker_flags/XEH_postInit.sqf index 19011893cca..da13925d9cc 100644 --- a/addons/marker_flags/XEH_postInit.sqf +++ b/addons/marker_flags/XEH_postInit.sqf @@ -15,6 +15,7 @@ private _weapons = (call (uiNamespace getVariable [QGVAR(flagItems), {[]}])) app private _icon = getText (_x >> QGVAR(icon)); GVAR(flagCache) set [_name, [_vehicleClass, _displayName, _icon]]; + //IGNORE_PRIVATE_WARNING ["_player", "_target"]; private _action = [ QGVAR(pickup), LLSTRING(ActionPickUp), diff --git a/addons/marker_flags/XEH_preStart.sqf b/addons/marker_flags/XEH_preStart.sqf index 2a2bc521616..e671b522a4c 100644 --- a/addons/marker_flags/XEH_preStart.sqf +++ b/addons/marker_flags/XEH_preStart.sqf @@ -2,5 +2,5 @@ #include "XEH_PREP.hpp" -private _weapons = (configProperties [configfile >> "CfgWeapons", QUOTE(isClass _x && {isText (_x >> QQGVAR(vehicle))}), true]) apply {configName _x}; +private _weapons = (configProperties [configFile >> "CfgWeapons", QUOTE(isClass _x && {isText (_x >> QQGVAR(vehicle))}), true]) apply {configName _x}; uiNamespace setVariable [QGVAR(flagItems), compileFinal str _weapons]; diff --git a/addons/markers/XEH_preInit.sqf b/addons/markers/XEH_preInit.sqf index 142dedb89a1..605920b7770 100644 --- a/addons/markers/XEH_preInit.sqf +++ b/addons/markers/XEH_preInit.sqf @@ -12,7 +12,7 @@ PREP_RECOMPILE_END; if (isNil QGVAR(MarkersCache)) then { GVAR(MarkersCache) = []; - private _config = configfile >> "CfgMarkers"; + private _config = configFile >> "CfgMarkers"; for "_a" from 0 to (count _config - 1) do { private _marker = _config select _a; @@ -31,7 +31,7 @@ if (isNil QGVAR(MarkersCache)) then { if (isNil QGVAR(MarkerColorsCache)) then { GVAR(MarkerColorsCache) = []; - private _config = configfile >> "CfgMarkerColors"; + private _config = configFile >> "CfgMarkerColors"; for "_a" from 0 to (count _config - 1) do { private _marker = _config select _a; diff --git a/addons/markers/functions/fnc_initInsertMarker.sqf b/addons/markers/functions/fnc_initInsertMarker.sqf index a102502b24c..2a3804959f2 100644 --- a/addons/markers/functions/fnc_initInsertMarker.sqf +++ b/addons/markers/functions/fnc_initInsertMarker.sqf @@ -19,7 +19,7 @@ #define BORDER 0.005 [{ - disableserialization; + disableSerialization; params ["_display"]; TRACE_1("params",_display); @@ -29,24 +29,24 @@ }; //BIS Controls: - private _text = _display displayctrl IDC_INSERT_MARKER; - private _picture = _display displayctrl IDC_INSERT_MARKER_PICTURE; - private _channel = _display displayctrl IDC_INSERT_MARKER_CHANNELS; - private _buttonOK = _display displayctrl IDC_OK; - private _buttonCancel = _display displayctrl IDC_CANCEL; - private _description = _display displayctrl 1100; - private _title = _display displayctrl 1001; - private _descriptionChannel = _display displayctrl 1101; + private _text = _display displayCtrl IDC_INSERT_MARKER; + private _picture = _display displayCtrl IDC_INSERT_MARKER_PICTURE; + private _channel = _display displayCtrl IDC_INSERT_MARKER_CHANNELS; + private _buttonOK = _display displayCtrl IDC_OK; + private _buttonCancel = _display displayCtrl IDC_CANCEL; + private _description = _display displayCtrl 1100; + private _title = _display displayCtrl 1001; + private _descriptionChannel = _display displayCtrl 1101; //ACE Controls: private _ctrlTimestamp = _display displayCtrl IDC_ACE_INSERT_MARKER_TIMESTAMP; private _ctrlTimestampText = _display displayCtrl IDC_ACE_INSERT_MARKER_TIMESTAMP_TEXT; - private _aceShapeLB = _display displayctrl IDC_ACE_INSERT_MARKER_SHAPE; - private _aceColorLB = _display displayctrl IDC_ACE_INSERT_MARKER_COLOR; - private _aceAngleSlider = _display displayctrl IDC_ACE_INSERT_MARKER_ANGLE; - private _aceAngleSliderText = _display displayctrl IDC_ACE_INSERT_MARKER_ANGLE_TEXT; - private _aceScaleSlider = _display displayctrl IDC_ACE_INSERT_MARKER_SCALE; - private _aceScaleSliderText = _display displayctrl IDC_ACE_INSERT_MARKER_SCALE_TEXT; + private _aceShapeLB = _display displayCtrl IDC_ACE_INSERT_MARKER_SHAPE; + private _aceColorLB = _display displayCtrl IDC_ACE_INSERT_MARKER_COLOR; + private _aceAngleSlider = _display displayCtrl IDC_ACE_INSERT_MARKER_ANGLE; + private _aceAngleSliderText = _display displayCtrl IDC_ACE_INSERT_MARKER_ANGLE_TEXT; + private _aceScaleSlider = _display displayCtrl IDC_ACE_INSERT_MARKER_SCALE; + private _aceScaleSliderText = _display displayCtrl IDC_ACE_INSERT_MARKER_SCALE_TEXT; private _mapDisplay = displayParent _display; if (isNull _mapDisplay) exitWith {ERROR("No Map");}; @@ -102,7 +102,7 @@ ctrlSetFocus _text; //--- Background - private _pos = ctrlposition _text; + private _pos = ctrlPosition _text; _pos params ["_posX", "_posY", "_posW", "_posH"]; _posX = _posX + 0.01; _posY = _posY min ((safeZoneH + safeZoneY) - (11 * _posH + 11 * BORDER)); //prevent buttons being placed below bottom edge of screen diff --git a/addons/markers/functions/fnc_mapDisplayInitEH.sqf b/addons/markers/functions/fnc_mapDisplayInitEH.sqf index e5242b9067c..6d26d3dab81 100644 --- a/addons/markers/functions/fnc_mapDisplayInitEH.sqf +++ b/addons/markers/functions/fnc_mapDisplayInitEH.sqf @@ -18,14 +18,14 @@ params ["_display"]; TRACE_1("params",_display); -private _bisShapeLB = _display displayctrl 1091; +private _bisShapeLB = _display displayCtrl 1091; private _curSelShape = missionNamespace getVariable [QGVAR(curSelMarkerShape), 0]; TRACE_2("shape",_bisShapeLB,_curSelShape); _bisShapeLB ctrlAddEventHandler ["LBSelChanged", {_this call FUNC(onLBSelChangedShape)}]; _bisShapeLB lbSetCurSel _curSelShape; -private _bisColorLB = _display displayctrl 1090; +private _bisColorLB = _display displayCtrl 1090; private _curSelColor = missionNamespace getVariable [QGVAR(curSelMarkerColor), 0]; TRACE_2("color",_bisColorLB,_curSelColor); _bisColorLB ctrlAddEventHandler ["LBSelChanged", {_this call FUNC(onLBSelChangedColor)}]; diff --git a/addons/markers/functions/fnc_placeMarker.sqf b/addons/markers/functions/fnc_placeMarker.sqf index fdd758be5e1..1899dff5fd5 100644 --- a/addons/markers/functions/fnc_placeMarker.sqf +++ b/addons/markers/functions/fnc_placeMarker.sqf @@ -35,7 +35,7 @@ if (_closeNum isEqualTo 1) then { private _newestMarkerDist = 1e10; { - private _distX = GVAR(currentMarkerPosition) distance2d (getMarkerPos _x); + private _distX = GVAR(currentMarkerPosition) distance2D (getMarkerPos _x); if (_distX < _newestMarkerDist) then { _newestMarker = _x; _newestMarkerDist = _distX; diff --git a/addons/markers/functions/fnc_setMarkerJIP.sqf b/addons/markers/functions/fnc_setMarkerJIP.sqf index 12dfe5de77d..fe4a1b68ae5 100644 --- a/addons/markers/functions/fnc_setMarkerJIP.sqf +++ b/addons/markers/functions/fnc_setMarkerJIP.sqf @@ -27,7 +27,7 @@ TRACE_2("params",_allMapMarkers,_allMapMarkersProperties); private _data = _allMapMarkersProperties select _index; _data params ["_markerClassname", "_colorClassname", "_pos", "_dir", "_scale"]; - private _config = (configfile >> "CfgMarkers") >> _markerClassname; + private _config = (configFile >> "CfgMarkers") >> _markerClassname; if (!isClass _config) then { WARNING("CfgMarker not found, changed to milDot"); @@ -36,7 +36,7 @@ TRACE_2("params",_allMapMarkers,_allMapMarkersProperties); _x setMarkerTypeLocal configName _config; - _config = configfile >> "CfgMarkerColors" >> _colorClassname; + _config = configFile >> "CfgMarkerColors" >> _colorClassname; if (!isClass _config) then { WARNING("CfgMarkerColors not found, changed to Default"); diff --git a/addons/markers/functions/fnc_setMarkerNetwork.sqf b/addons/markers/functions/fnc_setMarkerNetwork.sqf index 7d0cc0e8271..94c66f40789 100644 --- a/addons/markers/functions/fnc_setMarkerNetwork.sqf +++ b/addons/markers/functions/fnc_setMarkerNetwork.sqf @@ -21,7 +21,7 @@ params ["_marker", "_data"]; TRACE_2("params",_marker,_data); _data params ["_markerClassname", "_colorClassname", "_pos", "_dir", "_scale"]; -private _config = configfile >> "CfgMarkers" >> _markerClassname; +private _config = configFile >> "CfgMarkers" >> _markerClassname; if (!isClass _config) then { WARNING("CfgMarker not found, changed to milDot"); @@ -30,7 +30,7 @@ if (!isClass _config) then { _marker setMarkerTypeLocal configName _config; -_config = configfile >> "CfgMarkerColors" >> _colorClassname; +_config = configFile >> "CfgMarkerColors" >> _colorClassname; if (!isClass _config) then { WARNING("CfgMarkerColors not found, changed to Default"); diff --git a/addons/maverick/ACE_GuidanceConfig.hpp b/addons/maverick/ACE_GuidanceConfig.hpp index 948404b7cce..4360bd4a87d 100644 --- a/addons/maverick/ACE_GuidanceConfig.hpp +++ b/addons/maverick/ACE_GuidanceConfig.hpp @@ -2,6 +2,6 @@ class EGVAR(missileguidance,AttackProfiles) { class maverick { name = "LOAL-DIR"; nameLocked = "LOBL-DIR"; - functionName = QEFUNC(missileguidance,attackProfile_DIR); + functionName = QEFUNC(missileguidance,attackProfile_LIN); }; }; diff --git a/addons/maverick/CfgAmmo.hpp b/addons/maverick/CfgAmmo.hpp index 654c1fbe80c..dbf847b10d6 100644 --- a/addons/maverick/CfgAmmo.hpp +++ b/addons/maverick/CfgAmmo.hpp @@ -1,3 +1,4 @@ +class ace_missileguidance_type_Maverick; class CfgAmmo { class MissileCore; class MissileBase: MissileCore { @@ -5,6 +6,21 @@ class CfgAmmo { }; class Missile_AGM_02_F: MissileBase {}; + class GVAR(D): Missile_AGM_02_F { + author = "Dani (TCVM)"; + missileLockMaxDistance = 14000; + maneuvrability = 0; + class ace_missileguidance: ace_missileguidance_type_Maverick { + enabled = 1; + }; + }; + + class GVAR(G): GVAR(D) { + class ace_missileguidance: ace_missileguidance { + enabled = 1; + }; + }; + class GVAR(L): Missile_AGM_02_F { author = "xrufix"; autoSeekTarget = 0; @@ -13,30 +29,15 @@ class CfgAmmo { manualControl = 0; missileLockMaxDistance = 16000; weaponLockSystem = 4; - class ace_missileguidance { + class ace_missileguidance: ace_missileguidance_type_Maverick { enabled = 1; - - minDeflection = 0; - maxDeflection = 0.002; - incDeflection = 0.001; - - canVanillaLock = 0; - defaultSeekerType = "SALH"; seekerTypes[] = {"SALH"}; defaultSeekerLockMode = "LOAL"; - seekerLockModes[] = {"LOAL","LOBL"}; - - seekLastTargetPos = 1; - seekerAngle = 60; - seekerAccuracy = 1; + seekerLockModes[] = {"LOAL"}; - seekerMinRange = 1; seekerMaxRange = 16000; - - defaultAttackProfile = "maverick"; - attackProfiles[] = {"maverick"}; }; }; @@ -46,14 +47,10 @@ class CfgAmmo { irLock = 0; missileLockMaxDistance = 10000; weaponLockSystem = 4; - class ace_missileguidance { + class ace_missileguidance: ace_missileguidance_type_Maverick { enabled = 1; - - minDeflection = 0; - maxDeflection = 0.002; - incDeflection = 0.001; - - canVanillaLock = 0; + pitchRate = 20; + yawRate = 20; defaultSeekerType = "SALH"; seekerTypes[] = {"SALH"}; @@ -61,15 +58,8 @@ class CfgAmmo { defaultSeekerLockMode = "LOAL"; seekerLockModes[] = {"LOAL"}; - seekLastTargetPos = 1; seekerAngle = 40; - seekerAccuracy = 1; - - seekerMinRange = 1; seekerMaxRange = 10000; - - defaultAttackProfile = "maverick"; - attackProfiles[] = {"maverick"}; }; }; }; diff --git a/addons/maverick/CfgMagazines.hpp b/addons/maverick/CfgMagazines.hpp index 705d52010d2..1e51ede8b01 100644 --- a/addons/maverick/CfgMagazines.hpp +++ b/addons/maverick/CfgMagazines.hpp @@ -12,7 +12,71 @@ class CfgMagazines { class PylonRack_Missile_AGM_02_x1: magazine_Missile_AGM_02_x1 {}; class PylonRack_Missile_AGM_02_x2: magazine_Missile_AGM_02_x1 {}; + + // Optical Mavericks + class GVAR(D_magazine): 6Rnd_Missile_AGM_02_F { + ammo = QGVAR(D); + author = "Dani (TCVM)"; + displayName = CSTRING(d_mag_x1); + }; + class GVAR(D_pylonRack_1Rnd): PylonRack_1Rnd_Missile_AGM_02_F { + ammo = QGVAR(D); + author = "Dani (TCVM)"; + displayName = CSTRING(d_mag_x1); + pylonWeapon = QGVAR(D_Launcher); + }; + class GVAR(D_pylonRack_3Rnd): PylonRack_3Rnd_Missile_AGM_02_F { + ammo = QGVAR(D); + author = "Dani (TCVM)"; + displayName = CSTRING(d_mag_x3); + pylonWeapon = QGVAR(D_Launcher); + }; + + class GVAR(G_magazine_x1): magazine_Missile_AGM_02_x1 { + ammo = QGVAR(G); + author = "Dani (TCVM)"; + displayName = CSTRING(g_mag_x1); + }; + class GVAR(G_pylonmissile_x1): PylonMissile_Missile_AGM_02_x1 { + ammo = QGVAR(G); + author = "Dani (TCVM)"; + displayName = CSTRING(g_mag_x1); + pylonWeapon = QGVAR(G_Launcher); + }; + class GVAR(G_pylonmissile_x2): PylonMissile_Missile_AGM_02_x2 { + ammo = QGVAR(G); + author = "Dani (TCVM)"; + displayName = CSTRING(g_mag_x2); + pylonWeapon = QGVAR(G_Launcher); + }; + + class GVAR(G_pylonRack_1Rnd): PylonRack_1Rnd_Missile_AGM_02_F { + ammo = QGVAR(G); + author = "Dani (TCVM)"; + displayName = CSTRING(g_mag_x1); + pylonWeapon = QGVAR(G_Launcher); + }; + class GVAR(G_PylonRack_3Rnd): PylonRack_3Rnd_Missile_AGM_02_F { + ammo = QGVAR(G); + author = "Dani (TCVM)"; + displayName = CSTRING(g_mag_x3); + pylonWeapon = QGVAR(G_Launcher); + }; + + class GVAR(G_PylonRack_x1): PylonRack_Missile_AGM_02_x1 { + ammo = QGVAR(G); + author = "Dani (TCVM)"; + displayName = CSTRING(g_mag_x1); + pylonWeapon = QGVAR(G_Launcher); + }; + class GVAR(G_PylonRack_x2): PylonRack_Missile_AGM_02_x2 { + ammo = QGVAR(G); + author = "Dani (TCVM)"; + displayName = CSTRING(g_mag_x2); + pylonWeapon = QGVAR(G_Launcher); + }; + // Laser Mavericks class GVAR(L_magazine_x1): magazine_Missile_AGM_02_x1 { ammo = QGVAR(L); author = "xrufix"; diff --git a/addons/maverick/CfgWeapons.hpp b/addons/maverick/CfgWeapons.hpp index 1c0ae744efe..a60681a3cf1 100644 --- a/addons/maverick/CfgWeapons.hpp +++ b/addons/maverick/CfgWeapons.hpp @@ -6,6 +6,22 @@ class CfgWeapons { class MissileLauncher: LauncherCore {}; class Missile_AGM_02_Plane_CAS_01_F: MissileLauncher {}; + class GVAR(D_Launcher): Missile_AGM_02_Plane_CAS_01_F { + author = "Dani (TCVM)"; + displayname = CSTRING(D); + magazines[] = {QGVAR(D_magazine), QGVAR(D_pylonRack_1Rnd), QGVAR(D_pylonRack_3Rnd)}; + weaponLockDelay = 0.1; + weaponLockSystem = 2; + }; + + class GVAR(G_Launcher): weapon_AGM_65Launcher { + author = "Dani (TCVM)"; + displayname = CSTRING(G); + magazines[] = {QGVAR(G_magazine_x1), QGVAR(G_pylonmissile_x1), QGVAR(G_pylonmissile_x2), QGVAR(G_pylonRack_1Rnd), QGVAR(G_PylonRack_3Rnd), QGVAR(G_PylonRack_x1), QGVAR(G_PylonRack_x2)}; + weaponLockDelay = 0.1; + weaponLockSystem = 2; + }; + class GVAR(L_Launcher): weapon_AGM_65Launcher { author = "xrufix"; displayname = CSTRING(L); diff --git a/addons/maverick/stringtable.xml b/addons/maverick/stringtable.xml index 6bf1d80e042..21039200b26 100644 --- a/addons/maverick/stringtable.xml +++ b/addons/maverick/stringtable.xml @@ -6,7 +6,7 @@ <English>AGM-65 Maverick L, Laser Guided Anti-Ground-Missile</English> <German>AGM-65 Maverick L, lasergelenkte Luft-Boden-Rakete</German> <Italian>AGM-65 Maverick L, Missile Aria-Terra Laserguidato</Italian> - <Japanese>AGM-65 マーベリック L、レーザー誘導対地ミサイル</Japanese> + <Japanese>AGM-65 マーベリック L、 レーザー誘導対地ミサイル</Japanese> <Chinese>AGM-65"小牛"飛彈L型,雷射導引對地導彈</Chinese> <Chinesesimp>AGM-65"小牛"L型激光制导对地导弹</Chinesesimp> <Korean>AGM-65 매버릭 L, 레이저 유도 대지 미사일</Korean> @@ -82,10 +82,10 @@ <Key ID="STR_ACE_Maverick_kh25ml_mag_descr"> <English>Kh-25ML, Laser Guided Air-to-Ground-Missile</English> <German>Ch-25ML, Lasergelenkte Luft-Boden-Rakete</German> - <Korean>Kh-25ML, 레이저 유도 대공 미사일</Korean> + <Korean>Kh-25ML, 레이저 유도 공대지 미사일</Korean> <Chinese>Kh-25ML,雷射導引對地導彈</Chinese> <Chinesesimp>Kh-25ML,激光制导空地导弹</Chinesesimp> - <Japanese>Kh-25ML、レーザー誘導対地ミサイル</Japanese> + <Japanese>Kh-25ML、 レーザー誘導対地ミサイル</Japanese> <Italian>Kh-25ML, Missile Aria-Terra Laserguidato</Italian> <Polish>Kh-25ML, Kierowany laserowo pocisk powietrze-ziemia</Polish> <Russian>Х-25МЛ, ракета Воздух-Земля с лазерным наведением</Russian> @@ -111,6 +111,62 @@ <Turkish>1x Kh-25ML [ACE]</Turkish> <Spanish>1x Kh-25ML [ACE]</Spanish> </Key> + <Key ID="STR_ACE_Maverick_d"> + <English>AGM-65 Maverick D</English> + <French>AGM-65 Maverick D</French> + <Russian>AGM-65 Maverick D</Russian> + <Japanese>AGM-65 マーベリック D</Japanese> + <Korean>AGM-65 매버릭 D</Korean> + <Italian>AGM-65 Maverick D</Italian> + </Key> + <Key ID="STR_ACE_Maverick_g"> + <English>AGM-65 Maverick G</English> + <French>AGM-65 Maverick G</French> + <Russian>AGM-65 Maverick G</Russian> + <Japanese>AGM-65 マーベリック G</Japanese> + <Korean>AGM-65 매버릭 G</Korean> + <Italian>AGM-65 Maverick G</Italian> + </Key> + <Key ID="STR_ACE_Maverick_d_mag_x1"> + <English>AGM-65 Maverick D [ACE]</English> + <French>AGM-65 Maverick D [ACE]</French> + <Russian>AGM-65 Maverick D [ACE]</Russian> + <Japanese>AGM-65 マーベリック D [ACE]</Japanese> + <Korean>AGM-65 매버릭 D [ACE]</Korean> + <Italian>AGM-65 Maverick D [ACE]</Italian> + </Key> + <Key ID="STR_ACE_Maverick_d_mag_x3"> + <English>3x AGM-65 Maverick D [ACE]</English> + <French>3x AGM-65 Maverick D [ACE]</French> + <Russian>3x AGM-65 Maverick D [ACE]</Russian> + <Japanese>3x AGM-65 マーベリック D [ACE]</Japanese> + <Korean>3x AGM-65 매버릭 D [ACE]</Korean> + <Italian>3x AGM-65 Maverick D [ACE]</Italian> + </Key> + <Key ID="STR_ACE_Maverick_g_mag_x1"> + <English>AGM-65 Maverick G [ACE]</English> + <French>AGM-65 Maverick G [ACE]</French> + <Russian>AGM-65 Maverick G [ACE]</Russian> + <Japanese>AGM-65 マーベリック G [ACE]</Japanese> + <Korean>AGM-65 매버릭 G [ACE]</Korean> + <Italian>AGM-65 Maverick G [ACE]</Italian> + </Key> + <Key ID="STR_ACE_Maverick_g_mag_x2"> + <English>2x AGM-65 Maverick G [ACE]</English> + <French>2x AGM-65 Maverick G [ACE]</French> + <Russian>2x AGM-65 Maverick G [ACE]</Russian> + <Japanese>2x AGM-65 マーベリック G [ACE]</Japanese> + <Korean>2x AGM-65 매버릭 G [ACE]</Korean> + <Italian>2x AGM-65 Maverick G [ACE]</Italian> + </Key> + <Key ID="STR_ACE_Maverick_g_mag_x3"> + <English>3x AGM-65 Maverick G [ACE]</English> + <French>3x AGM-65 Maverick G [ACE]</French> + <Russian>3x AGM-65 Maverick G [ACE]</Russian> + <Japanese>3x AGM-65 マーベリック G [ACE]</Japanese> + <Korean>3x AGM-65 매버릭 G [ACE]</Korean> + <Italian>3x AGM-65 Maverick G [ACE]</Italian> + </Key> </Container> <Container name="weapons"> <Key ID="STR_ACE_Maverick_l"> diff --git a/addons/medical/dev/test_hitpointConfigs.sqf b/addons/medical/dev/test_hitpointConfigs.sqf index 7bdeb189c23..ff1c3a95b7d 100644 --- a/addons/medical/dev/test_hitpointConfigs.sqf +++ b/addons/medical/dev/test_hitpointConfigs.sqf @@ -10,7 +10,11 @@ private _cfgWeapons = configFile >> "CfgWeapons"; private _cfgVehicles = configFile >> "CfgVehicles"; private _uniforms = "getNumber (_x >> 'scope') == 2 && {configName _x isKindOf ['Uniform_Base', _cfgWeapons]}" configClasses _cfgWeapons; -private _units = _uniforms apply {_cfgVehicles >> getText (_x >> "ItemInfo" >> "uniformClass")}; +private _units = _uniforms apply { + private _unitCfg = _cfgVehicles >> getText (_x >> "ItemInfo" >> "uniformClass"); + if (isNull _unitCfg) then { WARNING_2("%1 has invalid uniformClass %2",configName _x,getText (_x >> "ItemInfo" >> "uniformClass")) }; + _unitCfg +}; if (param [0, false]) then { // Check all units (if naked) INFO("checking ALL units"); _units append ((configProperties [configFile >> "CfgVehicles", "(isClass _x) && {(getNumber (_x >> 'scope')) == 2} && {configName _x isKindOf 'CAManBase'}", true])); @@ -21,6 +25,7 @@ INFO_1("Checking uniforms for correct medical hitpoints [%1 units]",count _units private _testPass = true; { private _typeOf = configName _x; + if (_typeOf == "") then { continue }; private _hitpoints = (configProperties [_x >> "HitPoints", "isClass _x", true]) apply {toLowerANSI configName _x}; private _expectedHitPoints = ["hitleftarm","hitrightarm","hitleftleg","hitrightleg","hithead","hitbody"]; private _missingHitPoints = _expectedHitPoints select {!(_x in _hitpoints)}; diff --git a/addons/medical/functions/fnc_deserializeState.sqf b/addons/medical/functions/fnc_deserializeState.sqf index b7846bf9015..6fbb00985db 100644 --- a/addons/medical/functions/fnc_deserializeState.sqf +++ b/addons/medical/functions/fnc_deserializeState.sqf @@ -29,6 +29,7 @@ if (!local _unit) exitWith { ERROR_1("unit [%1] is not local",_unit) }; if !(_unit getVariable [QGVAR(initialized), false]) exitWith { [QEGVAR(medical_status,initialized), { params ["_unit"]; + //IGNORE_PRIVATE_WARNING ["_thisArgs", "_thisId", "_thisType"]; _thisArgs params ["_target"]; if (_unit == _target) then { diff --git a/addons/medical/initSettings.inc.sqf b/addons/medical/initSettings.inc.sqf index 3c54f47cee1..adc53c2ea83 100644 --- a/addons/medical/initSettings.inc.sqf +++ b/addons/medical/initSettings.inc.sqf @@ -34,7 +34,7 @@ "SLIDER", [LSTRING(SpontaneousWakeUpChance_DisplayName), LSTRING(SpontaneousWakeUpChance_Description)], LSTRING(Category), - [0, 1, 0.05, 2, true], + [0, 1, 0.1, 2, true], true ] call CBA_fnc_addSetting; @@ -43,6 +43,6 @@ "SLIDER", [LSTRING(spontaneousWakeUpEpinephrineBoost_DisplayName), LSTRING(spontaneousWakeUpEpinephrineBoost_Description)], LSTRING(Category), - [1, 30, 1, 1], + [1, 30, 1.5, 1], true ] call CBA_fnc_addSetting; diff --git a/addons/medical_ai/XEH_PREP.hpp b/addons/medical_ai/XEH_PREP.hpp index de4ac3c38a3..3cf2b3e2441 100644 --- a/addons/medical_ai/XEH_PREP.hpp +++ b/addons/medical_ai/XEH_PREP.hpp @@ -1,3 +1,4 @@ +PREP(addHealingCommandActions); PREP(canRequestMedic); PREP(healingLogic); PREP(healSelf); diff --git a/addons/medical_ai/XEH_postInit.sqf b/addons/medical_ai/XEH_postInit.sqf index 0b225c7f0b0..22f2fa5f23f 100644 --- a/addons/medical_ai/XEH_postInit.sqf +++ b/addons/medical_ai/XEH_postInit.sqf @@ -2,10 +2,12 @@ ["CBA_settingsInitialized", { TRACE_1("settingsInitialized",GVAR(enabledFor)); + if (GVAR(enabledFor) == 0) exitWith {}; // 0: disabled if ((GVAR(enabledFor) == 1) && {!isServer} && {hasInterface}) exitWith {}; // 1: Don't Run on non-hc Clients ["ace_firedNonPlayer", { + //IGNORE_PRIVATE_WARNING ["_unit"]; _unit setVariable [QGVAR(lastFired), CBA_missionTime]; }] call CBA_fnc_addEventHandler; @@ -19,6 +21,19 @@ _unit setVariable [QGVAR(lastSuppressed), CBA_missionTime]; }] call CBA_fnc_addClassEventHandler; - #include "stateMachine.inc.sqf" + // Add command actions to command AI medics to treat other units + call FUNC(addHealingCommandActions); + if (GVAR(requireItems) == 2) then { + ["CAManBase", "InitPost", { + [{ + params ["_unit"]; + if ((!local _unit) || {!alive _unit} || {isPlayer _unit}) exitWith {}; + TRACE_2("replacing medical items on AI",_unit,typeOf _unit); + [_unit] call EFUNC(common,replaceRegisteredItems); + }, _this] call CBA_fnc_execNextFrame; // need to delay a frame before modifying items in a backpack + }, nil, [IGNORE_BASE_UAVPILOTS], true] call CBA_fnc_addClassEventHandler; + }; + + #include "stateMachine.inc.sqf" }] call CBA_fnc_addEventHandler; diff --git a/addons/medical_ai/XEH_preInit.sqf b/addons/medical_ai/XEH_preInit.sqf index 5725d1e119e..8cdc2ee6ad8 100644 --- a/addons/medical_ai/XEH_preInit.sqf +++ b/addons/medical_ai/XEH_preInit.sqf @@ -13,6 +13,6 @@ if (isNil QGVAR(timeSafe_shoot)) then { GVAR(timeSafe_shoot) = 30; }; if (isNil QGVAR(timeSafe_hit)) then { GVAR(timeSafe_hit) = 30; }; if (isNil QGVAR(timeSafe_suppressed)) then { GVAR(timeSafe_suppressed) = 30; }; -GVAR(itemHash) = uinamespace getVariable QGVAR(itemHash); +GVAR(itemHash) = uiNamespace getVariable QGVAR(itemHash); ADDON = true; diff --git a/addons/medical_ai/XEH_preStart.sqf b/addons/medical_ai/XEH_preStart.sqf index b4d795cbbf6..3782a3eab78 100644 --- a/addons/medical_ai/XEH_preStart.sqf +++ b/addons/medical_ai/XEH_preStart.sqf @@ -20,8 +20,9 @@ private _itemHash = createHashMap; } forEach [ ["@bandage", ["FieldDressing", "PackingBandage", "ElasticBandage", "QuikClot"]], ["@iv", ["SalineIV", "SalineIV_500", "SalineIV_250", "BloodIV", "BloodIV_500", "BloodIV_250", "PlasmaIV", "PlasmaIV_500", "PlasmaIV_250"]], + ["tourniquet", ["ApplyTourniquet"]], ["splint", ["splint"]], ["morphine", ["morphine"]], ["epinephrine", ["epinephrine"]] ]; -uinamespace setVariable [QGVAR(itemHash), compileFinal _itemHash]; +uiNamespace setVariable [QGVAR(itemHash), compileFinal _itemHash]; diff --git a/addons/medical_ai/functions/fnc_addHealingCommandActions.sqf b/addons/medical_ai/functions/fnc_addHealingCommandActions.sqf new file mode 100644 index 00000000000..853fdad8582 --- /dev/null +++ b/addons/medical_ai/functions/fnc_addHealingCommandActions.sqf @@ -0,0 +1,89 @@ +#include "..\script_component.hpp" +/* + * Author: johnb43 + * Adds ACE actions for the player to command medics to heal injured units. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_medical_ai_fnc_addHealingCommandActions + * + * Public: No + */ + +if (!hasInterface) exitWith {}; + +//IGNORE_PRIVATE_WARNING ["_player", "_target"]; +private _action = [ + QGVAR(heal), + localize "STR_A3_Task180_name", + "", + {}, + {_player == leader _player}, + { + private _units = units _player; + + (_units select {_x call EFUNC(common,isAwake) && {_x call EFUNC(medical_treatment,isMedic)} && {!(_x call EFUNC(common,isPlayer))}}) apply { + [ + [ + QGVAR(medicHeal_) + str _x, + format ["%1: (%2)", [_x, false, true] call EFUNC(common,getName), groupId _x], + "", + {}, + {true}, + { + (_this select 2) params ["_healer", "_units"]; + + (_units select {_x call FUNC(isInjured)}) apply { + [ + [ + QGVAR(healUnit_) + str _x, + format [localize "str_action_heal_soldier", ([_x, false, true] call EFUNC(common,getName)) + " (" + str groupId _x + ")"], + "", + { + (_this select 2) params ["_healer", "_target"]; + + private _assignedMedic = _target getVariable [QGVAR(assignedMedic), objNull]; + + // Remove from previous medic's queue + if (!isNull _assignedMedic && {_healer != _assignedMedic}) then { + private _healQueue = _assignedMedic getVariable [QGVAR(healQueue), []]; + + _healQueue deleteAt (_healQueue find _target); + + _assignedMedic setVariable [QGVAR(healQueue), _healQueue]; + }; + + _target setVariable [QGVAR(assignedMedic), _healer]; + + // Add to new medic + private _healQueue = _healer getVariable [QGVAR(healQueue), []]; + + _healQueue deleteAt (_healQueue find _target); + _healQueue insert [0, [_target]]; + + _healer setVariable [QGVAR(healQueue), _healQueue]; + }, + {true}, + {}, + [_healer, _x] + ] call EFUNC(interact_menu,createAction), + [], + _x + ] + }; + }, + [_x, _units] + ] call EFUNC(interact_menu,createAction), + [], + _x + ] + }; + } +] call EFUNC(interact_menu,createAction); + +["CAManBase", 1, ["ACE_SelfActions"], _action, true] call EFUNC(interact_menu,addActionToClass); diff --git a/addons/medical_ai/functions/fnc_canRequestMedic.sqf b/addons/medical_ai/functions/fnc_canRequestMedic.sqf index 685bd57f540..5064e1a7321 100644 --- a/addons/medical_ai/functions/fnc_canRequestMedic.sqf +++ b/addons/medical_ai/functions/fnc_canRequestMedic.sqf @@ -4,13 +4,13 @@ * Checks if there is a medic available in the unit's group. * * Arguments: - * None + * Unit <OBJECT> * * Return Value: * Can request medic <BOOL> * * Example: - * player call ACE_medical_ai_fnc_canRequestMedic + * player call ace_medical_ai_fnc_canRequestMedic * * Public: No */ diff --git a/addons/medical_ai/functions/fnc_healSelf.sqf b/addons/medical_ai/functions/fnc_healSelf.sqf index 5747637995e..60f2b837124 100644 --- a/addons/medical_ai/functions/fnc_healSelf.sqf +++ b/addons/medical_ai/functions/fnc_healSelf.sqf @@ -4,13 +4,13 @@ * Makes the unit heal itself. * * Arguments: - * None + * Unit <OBJECT> * * Return Value: * None * * Example: - * call ACE_medical_ai_fnc_healSelf + * cursorObject call ace_medical_ai_fnc_healSelf * * Public: No */ diff --git a/addons/medical_ai/functions/fnc_healUnit.sqf b/addons/medical_ai/functions/fnc_healUnit.sqf index ad867d25700..6d94749d1f9 100644 --- a/addons/medical_ai/functions/fnc_healUnit.sqf +++ b/addons/medical_ai/functions/fnc_healUnit.sqf @@ -4,16 +4,17 @@ * Makes a medic heal the next unit that needs treatment. * * Arguments: - * None + * Unit <OBJECT> * * Return Value: * None * * Example: - * call ACE_medical_ai_fnc_healUnit + * cursorObject call ace_medical_ai_fnc_healUnit * * Public: No */ + // Player will have to do this manually of course if ([_this] call EFUNC(common,isPlayer)) exitWith {}; // Can't heal other units when unconscious @@ -23,10 +24,16 @@ if IS_UNCONSCIOUS(_this) exitWith { // Find next unit to treat private _healQueue = _this getVariable [QGVAR(healQueue), []]; -private _target = _healQueue select 0; +private _target = _healQueue param [0, objNull]; // If unit died or was healed, be lazy and wait for the next tick -if (isNull _target || {!alive _target} || {!(_target call FUNC(isInjured))}) exitWith { +// If the unit can't be healed, go to the next unit to be healed +if (!alive _target || {!(_target call FUNC(isInjured))} || { + private _treatmentEvent = (_this getVariable [QGVAR(currentTreatment), []]) param [2, ""]; + + // Target still needs healing, but the healer doesn't have the required items (only happens if GVAR(requireItems) != 0) or needs to wait + (_treatmentEvent select [0, 6]) == "#needs" +}) exitWith { _this forceSpeed -1; _target forceSpeed -1; _healQueue deleteAt 0; @@ -46,6 +53,10 @@ if (_this distance _target > 2.5) exitWith { _this setVariable [QGVAR(currentTreatment), nil]; if (CBA_missionTime >= (_this getVariable [QGVAR(nextMoveOrder), CBA_missionTime])) then { _this setVariable [QGVAR(nextMoveOrder), CBA_missionTime + 10]; + + // Medic, when doing a lot of treatment, moves away from injured over time (because of animations) + // Need to allow the medic to move back to the injured again + _this forceSpeed -1; _this doMove getPosATL _target; #ifdef DEBUG_MODE_FULL systemChat format ["%1 moving to %2", _this, _target]; diff --git a/addons/medical_ai/functions/fnc_healingLogic.sqf b/addons/medical_ai/functions/fnc_healingLogic.sqf index fa35b49284d..9c7ce1c847f 100644 --- a/addons/medical_ai/functions/fnc_healingLogic.sqf +++ b/addons/medical_ai/functions/fnc_healingLogic.sqf @@ -1,7 +1,9 @@ #include "..\script_component.hpp" /* - * Author: BaerMitUmlaut, PabstMirror - * Applies healing to target + * Author: BaerMitUmlaut, PabstMirror, johnb43 + * Applies healing to target. + * States that contain "needs" are states in which the medic is blocked, either temporairly (HR too high/low) or until resupplied, from treating. + * States that contain "wait" are states where the medic waits temporairly before continuing treatment. * * Arguments: * 0: Healer <OBJECT> @@ -11,7 +13,7 @@ * Nothing * * Example: - * [a, b] call ACE_medical_ai_fnc_healingLogic + * [cursorObject, cursorObject] call ace_medical_ai_fnc_healingLogic * * Public: No */ @@ -24,14 +26,58 @@ if (_finishTime > 0) exitWith { if (CBA_missionTime >= _finishTime) then { TRACE_5("treatment finished",_finishTime,_treatmentTarget,_treatmentEvent,_treatmentArgs,_treatmentItem); _healer setVariable [QGVAR(currentTreatment), nil]; + + private _usedItem = ""; + if ((GVAR(requireItems) > 0) && {_treatmentItem != ""}) then { ([_healer, _treatmentItem] call FUNC(itemCheck)) params ["_itemOk", "_itemClassname", "_treatmentClass"]; - if (!_itemOk) exitWith { _treatmentEvent = "#fail"; }; // no item after delay + // No item after treatment done + if (!_itemOk) exitWith { + _treatmentEvent = "#fail"; + }; + _healer removeItem _itemClassname; - if (_treatmentClass != "") then { _treatmentArgs set [2, _treatmentClass]; }; + _usedItem = _itemClassname; + + if (_treatmentClass != "") then { + _treatmentArgs set [2, _treatmentClass]; + }; }; if ((_treatmentTarget == _target) && {(_treatmentEvent select [0, 1]) != "#"}) then { + // There is no event for tourniquet removal, so handle calling function directly + if (_treatmentEvent == QGVAR(tourniquetRemove)) exitWith { + _treatmentArgs call EFUNC(medical_treatment,tourniquetRemove); + }; + [_treatmentEvent, _treatmentArgs, _target] call CBA_fnc_targetEvent; + + // Splints are already logged on their own + switch (_treatmentEvent) do { + case QEGVAR(medical_treatment,bandageLocal): { + [_target, "activity", ELSTRING(medical_treatment,Activity_bandagedPatient), [[_healer, false, true] call EFUNC(common,getName)]] call EFUNC(medical_treatment,addToLog); + }; + case QEGVAR(medical_treatment,ivBagLocal): { + if (_usedItem == "") then { + _usedItem = "ACE_salineIV"; + }; + + [_target, _usedItem] call EFUNC(medical_treatment,addToTriageCard); + [_target, "activity", ELSTRING(medical_treatment,Activity_gaveIV), [[_healer, false, true] call EFUNC(common,getName)]] call EFUNC(medical_treatment,addToLog); + }; + case QEGVAR(medical_treatment,medicationLocal): { + if (_usedItem == "") then { + _usedItem = ["ACE_epinephrine", "ACE_morphine"] select (_treatmentArgs select 2 == "Morphine"); + }; + + [_target, _usedItem] call EFUNC(medical_treatment,addToTriageCard); + [_target, "activity", ELSTRING(medical_treatment,Activity_usedItem), [[_healer, false, true] call EFUNC(common,getName), getText (configFile >> "CfgWeapons" >> _usedItem >> "displayName")]] call EFUNC(medical_treatment,addToLog); + }; + case QEGVAR(medical_treatment,tourniquetLocal): { + [_target, "ACE_tourniquet"] call EFUNC(medical_treatment,addToTriageCard); + [_target, "activity", ELSTRING(medical_treatment,Activity_appliedTourniquet), [[_healer, false, true] call EFUNC(common,getName)]] call EFUNC(medical_treatment,addToLog); + }; + }; + #ifdef DEBUG_MODE_FULL INFO_4("%1->%2: %3 - %4",_healer,_target,_treatmentEvent,_treatmentArgs); systemChat format ["Applying [%1->%2]: %3", _healer, _treatmentTarget, _treatmentEvent]; @@ -40,38 +86,164 @@ if (_finishTime > 0) exitWith { }; }; -private _isMedic = [_healer] call EFUNC(medical_treatment,isMedic); -private _heartRate = GET_HEART_RATE(_target); -private _fractures = GET_FRACTURES(_target); +// Bandage a limb up, then remove the tourniquet on it +private _fnc_removeTourniquet = { + params [["_removeAllTourniquets", false]]; + + // Ignore head & torso if not removing all tourniquets (= administering drugs/IVs) + private _offset = [2, 0] select _removeAllTourniquets; + + // Bandage the least bleeding body part + private _bodyPartBleeding = []; + _bodyPartBleeding resize [[4, 6] select _removeAllTourniquets, -1]; + + { + // Ignore head and torso, if only looking for place to administer drugs/IVs + private _partIndex = (ALL_BODY_PARTS find _x) - _offset; + + if (_partIndex >= 0 && {_tourniquets select _partIndex != 0}) then { + { + _x params ["", "_amountOf", "_bleeding"]; + + // max 0, to set the baseline to 0, as body parts with no wounds are marked with -1 + _bodyPartBleeding set [_partIndex, ((_bodyPartBleeding select _partIndex) max 0) + (_amountOf * _bleeding)]; + } forEach _y; + }; + } forEach GET_OPEN_WOUNDS(_target); + + // If there are no open wounds, check if there are tourniquets on limbs with no open wounds (stitched or fully healed), + // as we know there have to be tourniquets at this point + if (_bodyPartBleeding findIf {_x != -1} == -1) then { + _bodyPartBleeding set [_tourniquets findIf {_x != 0}, 0]; + }; + + // Ignore body parts that don't have open wounds (-1) + private _minBodyPartBleeding = selectMin (_bodyPartBleeding select {_x != -1}); + private _selection = ALL_BODY_PARTS select ((_bodyPartBleeding find _minBodyPartBleeding) + _offset); + + // If not bleeding anymore, remove the tourniquet + if (_minBodyPartBleeding == 0) exitWith { + _treatmentEvent = QGVAR(tourniquetRemove); + _treatmentTime = 7; + _treatmentArgs = [_healer, _target, _selection]; + }; + + // If no bandages available, wait + // If check is done at the start of the scope, it will miss the edge case where the unit ran out of bandages just as they finished bandaging tourniqueted body part + if !(([_healer, "@bandage"] call FUNC(itemCheck)) # 0) exitWith { + _treatmentEvent = "#needsBandage"; + }; + + // Otherwise keep bandaging + _treatmentEvent = QEGVAR(medical_treatment,bandageLocal); + _treatmentTime = 5; + _treatmentArgs = [_target, _selection, "FieldDressing"]; + _treatmentItem = "@bandage"; +}; + +// Find a suitable limb (no tourniquets) for adminstering drugs/IVs +private _fnc_findNoTourniquet = { + private _bodyPart = ""; + + // If all limbs have tourniquets, find the least damaged limb and try to bandage it + if ((_tourniquets select [2]) find 0 == -1) then { + call _fnc_removeTourniquet; + } else { + // Select a random non-tourniqueted limb otherwise + private _bodyParts = ["leftarm", "rightarm", "leftleg", "rightleg"]; + + while {_bodyParts isNotEqualTo []} do { + _bodyPart = selectRandom _bodyParts; + + // If no tourniquet on, use that body part + if (_tourniquets select (ALL_BODY_PARTS find _bodyPart) == 0) exitWith {}; + + _bodyParts deleteAt (_bodyParts find _bodyPart); + }; + }; + + _bodyPart // return +}; + +private _tourniquets = GET_TOURNIQUETS(_target); private _treatmentEvent = "#none"; private _treatmentArgs = []; private _treatmentTime = 6; private _treatmentItem = ""; -switch (true) do { - case ((GET_WOUND_BLEEDING(_target) > 0) - && {([_healer, "@bandage"] call FUNC(itemCheck)) # 0}): { - // Select first bleeding wound and bandage it - private _selection = "?"; + +if (true) then { + if (IS_BLEEDING(_target)) exitWith { + private _hasBandage = ([_healer, "@bandage"] call FUNC(itemCheck)) # 0; + private _hasTourniquet = ([_healer, "tourniquet"] call FUNC(itemCheck)) # 0; + + // Patient is not worth treating if bloodloss can't be stopped + if !(_hasBandage || _hasTourniquet) exitWith { + _treatmentEvent = "#needsBandageOrTourniquet"; + }; + + // Bandage the heaviest bleeding body part + private _bodyPartBleeding = [0, 0, 0, 0, 0, 0]; + { - private _foundBleeding = _y findIf { - _x params ["", "_amount", "_percentage"]; - (_amount * _percentage) > 0 + private _partIndex = ALL_BODY_PARTS find _x; + + // Ignore tourniqueted limbs + if (_tourniquets select _partIndex == 0) then { + { + _x params ["", "_amountOf", "_bleeding"]; + _bodyPartBleeding set [_partIndex, (_bodyPartBleeding select _partIndex) + (_amountOf * _bleeding)]; + } forEach _y; }; - if (_foundBleeding != -1) exitWith { _selection = _x; }; } forEach GET_OPEN_WOUNDS(_target); + + private _maxBodyPartBleeding = selectMax _bodyPartBleeding; + private _bodyPartIndex = _bodyPartBleeding find _maxBodyPartBleeding; + private _selection = ALL_BODY_PARTS select _bodyPartIndex; + + // Apply tourniquet if moderate bleeding or no bandage is available, and if not head and torso + if (_hasTourniquet && {_bodyPartIndex > HITPOINT_INDEX_BODY} && {!_hasBandage || {_maxBodyPartBleeding > 0.3}}) exitWith { + _treatmentEvent = QEGVAR(medical_treatment,tourniquetLocal); + _treatmentTime = 7; + _treatmentArgs = [_target, _selection]; + _treatmentItem = "tourniquet"; + }; + _treatmentEvent = QEGVAR(medical_treatment,bandageLocal); _treatmentTime = 5; _treatmentArgs = [_target, _selection, "FieldDressing"]; _treatmentItem = "@bandage"; }; - case (IN_CRDC_ARRST(_target) && {EGVAR(medical_treatment,cprSuccessChanceMin) > 0}): { + + private _bloodVolume = GET_BLOOD_VOLUME(_target); + private _needsIV = _bloodVolume < MINIMUM_BLOOD_FOR_STABLE_VITALS; + private _canGiveIV = _needsIV && + {_healer call EFUNC(medical_treatment,isMedic)} && + {([_healer, "@iv"] call FUNC(itemCheck)) # 0}; // Has IVs + private _doCPR = IN_CRDC_ARRST(_target) && {EGVAR(medical_treatment,cprSuccessChanceMin) > 0}; + + // If in cardiac arrest, first add some blood to injured if necessary, then do CPR (doing CPR when not enough blood is suboptimal if you have IVs) + // If healer has no IVs, allow AI to do CPR to keep injured alive + if ( + _doCPR && + {!_canGiveIV || {_bloodVolume >= BLOOD_VOLUME_CLASS_3_HEMORRHAGE}} + ) exitWith { _treatmentEvent = QEGVAR(medical_treatment,cprLocal); _treatmentArgs = [_healer, _target]; _treatmentTime = 15; }; - case (_isMedic && {GET_BLOOD_VOLUME(_target) < MINIMUM_BLOOD_FOR_STABLE_VITALS} - && {([_healer, "@iv"] call FUNC(itemCheck)) # 0}): { + + private _bodypart = ""; + + if ( + _canGiveIV && { + // If all limbs are tourniqueted, bandage the one with the least amount of wounds, so that the tourniquet can be removed + _bodyPart = call _fnc_findNoTourniquet; + _bodyPart == "" + } + ) exitWith {}; + + if (_canGiveIV) then { // Check if patient's blood volume + remaining IV volume is enough to allow the patient to wake up private _totalIvVolume = 0; //in ml { @@ -79,57 +251,132 @@ switch (true) do { _totalIvVolume = _totalIvVolume + _volumeRemaining; } forEach (_target getVariable [QEGVAR(medical,ivBags), []]); - if (GET_BLOOD_VOLUME(_target) + (_totalIvVolume / 1000) > MINIMUM_BLOOD_FOR_STABLE_VITALS) exitWith { - _treatmentEvent = "#waitForBlood"; + // Check if the medic has to wait, which allows for a little multitasking + if (_bloodVolume + (_totalIvVolume / 1000) >= MINIMUM_BLOOD_FOR_STABLE_VITALS) then { + _treatmentEvent = "#waitForIV"; + _needsIV = false; + _canGiveIV = false; }; + }; + + if (_canGiveIV) exitWith { _treatmentEvent = QEGVAR(medical_treatment,ivBagLocal); _treatmentTime = 5; - _treatmentArgs = [_target, selectRandom ["leftarm", "rightarm", "leftleg", "rightleg"], "SalineIV"]; + _treatmentArgs = [_target, _bodyPart, "SalineIV"]; _treatmentItem = "@iv"; }; - case ((count (_target getVariable [VAR_MEDICATIONS, []])) >= 6): { - _treatmentEvent = "#tooManyMeds"; - }; - case (((_fractures select 4) == 1) - && {([_healer, "splint"] call FUNC(itemCheck)) # 0}): { + + // Leg fractures + private _index = (GET_FRACTURES(_target) select [4, 2]) find 1; + + if ( + _index != -1 && { + // In case the unit doesn't have a splint, set state here + _treatmentEvent = "#needsSplint"; + + ([_healer, "splint"] call FUNC(itemCheck)) # 0 + } + ) exitWith { _treatmentEvent = QEGVAR(medical_treatment,splintLocal); _treatmentTime = 6; - _treatmentArgs = [_healer, _target, "leftleg"]; + _treatmentArgs = [_healer, _target, ALL_BODY_PARTS select (_index + 4)]; _treatmentItem = "splint"; }; - case (((_fractures select 5) == 1) - && {([_healer, "splint"] call FUNC(itemCheck)) # 0}): { - _treatmentEvent = QEGVAR(medical_treatment,splintLocal); - _treatmentTime = 6; - _treatmentArgs = [_healer, _target, "rightleg"]; - _treatmentItem = "splint"; + + // Wait until the injured has enough blood before administering drugs + // (_needsIV && !_canGiveIV), but _canGiveIV is false here, otherwise IV would be given + if (_needsIV || {_doCPR && {_treatmentEvent == "#waitForIV"}}) exitWith { + // If injured is in cardiac arrest and the healer is doing nothing else, start CPR + if (_doCPR) exitWith { + // Medic remains in this loop until injured is given enough IVs or dies + _treatmentEvent = QEGVAR(medical_treatment,cprLocal); + _treatmentArgs = [_healer, _target]; + _treatmentTime = 15; + }; + + // If the injured needs IVs, but healer can't give it to them, have healder wait + if (_needsIV) exitWith { + _treatmentEvent = "#needsIV"; + }; }; - case ((IS_UNCONSCIOUS(_target) || {_heartRate <= 50}) - && {([_healer, "epinephrine"] call FUNC(itemCheck)) # 0}): { - if (CBA_missionTime < (_target getVariable [QGVAR(nextEpinephrine), -1])) exitWith { + + // These checks are not exitWith, so that the medic can try to bandage up tourniqueted body parts + if ((count (_target getVariable [VAR_MEDICATIONS, []])) >= 6) then { + _treatmentEvent = "#needsFewerMeds"; + }; + + private _heartRate = GET_HEART_RATE(_target); + private _canGiveEpinephrine = !(_treatmentEvent in ["#needsFewerMeds", "#waitForIV"]) && + {IS_UNCONSCIOUS(_target) || {_heartRate <= 50}} && + { + // In case the unit doesn't have a epinephrine injector, set state here + _treatmentEvent = "#needsEpinephrine"; + + ([_healer, "epinephrine"] call FUNC(itemCheck)) # 0 + }; + + // This allows for some multitasking + if (_canGiveEpinephrine) then { + if (CBA_missionTime < (_target getVariable [QGVAR(nextEpinephrine), -1])) then { _treatmentEvent = "#waitForEpinephrineToTakeEffect"; + _canGiveEpinephrine = false; }; - if (_heartRate > 180) exitWith { - _treatmentEvent = "#waitForSlowerHeart"; + + if (_heartRate > 180) then { + _treatmentEvent = "#needsSlowerHeart"; + _canGiveEpinephrine = false; }; + }; + + if (_canGiveEpinephrine) exitWith { + // If all limbs are tourniqueted, bandage the one with the least amount of wounds, so that the tourniquet can be removed + _bodyPart = call _fnc_findNoTourniquet; + + if (_bodyPart == "") exitWith {}; + _target setVariable [QGVAR(nextEpinephrine), CBA_missionTime + 10]; _treatmentEvent = QEGVAR(medical_treatment,medicationLocal); _treatmentTime = 2.5; - _treatmentArgs = [_target, selectRandom ["leftarm", "rightarm", "leftleg", "rightleg"], "Epinephrine"]; + _treatmentArgs = [_target, _bodyPart, "Epinephrine"]; _treatmentItem = "epinephrine"; }; - case (((GET_PAIN_PERCEIVED(_target) > 0.25) || {_heartRate >= 180}) - && {([_healer, "morphine"] call FUNC(itemCheck)) # 0}): { + + // Remove all remaining tourniquets by bandaging all body parts + if (_tourniquets isNotEqualTo DEFAULT_TOURNIQUET_VALUES) then { + true call _fnc_removeTourniquet; + }; + + // If the healer can bandage or remove tourniquets, do that + if (_treatmentEvent in [QEGVAR(medical_treatment,bandageLocal), QGVAR(tourniquetRemove)]) exitWith {}; + + // Otherwise, if the healer is either done or out of bandages, continue + if ( + !(_treatmentEvent in ["#needsFewerMeds", "#waitForIV"]) && + {(GET_PAIN_PERCEIVED(_target) > 0.25) || {_heartRate >= 180}} && + { + // In case the unit doesn't have a morphine injector, set state here + _treatmentEvent = "#needsMorphine"; + + ([_healer, "morphine"] call FUNC(itemCheck)) # 0 + } + ) exitWith { if (CBA_missionTime < (_target getVariable [QGVAR(nextMorphine), -1])) exitWith { _treatmentEvent = "#waitForMorphineToTakeEffect"; }; + if (_heartRate < 60) exitWith { - _treatmentEvent = "#waitForFasterHeart"; + _treatmentEvent = "#needsFasterHeart"; }; + + // If all limbs are tourniqueted, bandage the one with the least amount of wounds, so that the tourniquet can be removed + _bodyPart = call _fnc_findNoTourniquet; + + if (_bodyPart == "") exitWith {}; + _target setVariable [QGVAR(nextMorphine), CBA_missionTime + 30]; _treatmentEvent = QEGVAR(medical_treatment,medicationLocal); _treatmentTime = 2.5; - _treatmentArgs = [_target, selectRandom ["leftarm", "rightarm", "leftleg", "rightleg"], "Morphine"]; + _treatmentArgs = [_target, _bodyPart, "Morphine"]; _treatmentItem = "morphine"; }; }; @@ -137,10 +384,16 @@ switch (true) do { _healer setVariable [QGVAR(currentTreatment), [CBA_missionTime + _treatmentTime, _target, _treatmentEvent, _treatmentArgs, _treatmentItem]]; // Play animation -if ((_treatmentEvent select [0,1]) != "#") then { - private _treatmentClassname = _treatmentArgs select 2; - if (_treatmentEvent == QEGVAR(medical_treatment,splintLocal)) then { _treatmentClassname = "Splint" }; - [_healer, _treatmentClassname, (_healer == _target)] call FUNC(playTreatmentAnim); +if ((_treatmentEvent select [0, 1]) != "#") then { + private _treatmentClassname = switch (_treatmentEvent) do { + case QEGVAR(medical_treatment,splintLocal): {"Splint"}; + case QEGVAR(medical_treatment,cprLocal): {"CPR"}; + case QEGVAR(medical_treatment,tourniquetLocal): {"ApplyTourniquet"}; + case QGVAR(tourniquetRemove): {"RemoveTourniquet"}; + default {_treatmentArgs select 2}; + }; + + [_healer, _treatmentClassname, _healer == _target] call FUNC(playTreatmentAnim); }; #ifdef DEBUG_MODE_FULL diff --git a/addons/medical_ai/functions/fnc_isInjured.sqf b/addons/medical_ai/functions/fnc_isInjured.sqf index a163a4c808b..2a4b6895143 100644 --- a/addons/medical_ai/functions/fnc_isInjured.sqf +++ b/addons/medical_ai/functions/fnc_isInjured.sqf @@ -10,7 +10,7 @@ * Does unit need treatment <BOOL> * * Example: - * player call ACE_medical_ai_fnc_isInjured + * cursorObject call ace_medical_ai_fnc_isInjured * * Public: No */ @@ -24,3 +24,4 @@ if !(alive _this) exitWith {false}; private _fractures = GET_FRACTURES(_this); ((_fractures select 4) == 1) || {(_fractures select 5) == 1} } +|| { GET_TOURNIQUETS(_this) isNotEqualTo DEFAULT_TOURNIQUET_VALUES } diff --git a/addons/medical_ai/functions/fnc_isSafe.sqf b/addons/medical_ai/functions/fnc_isSafe.sqf index 04da058ce0c..21d59a15d63 100644 --- a/addons/medical_ai/functions/fnc_isSafe.sqf +++ b/addons/medical_ai/functions/fnc_isSafe.sqf @@ -10,7 +10,7 @@ * Is unit safe enough <BOOL> * * Example: - * call ACE_medical_ai_fnc_isSafe + * cursorObject call ace_medical_ai_fnc_isSafe * * Public: No */ diff --git a/addons/medical_ai/functions/fnc_itemCheck.sqf b/addons/medical_ai/functions/fnc_itemCheck.sqf index 6d91594ce47..320ae62410c 100644 --- a/addons/medical_ai/functions/fnc_itemCheck.sqf +++ b/addons/medical_ai/functions/fnc_itemCheck.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: PabstMirror - * Checks if AI healer has items + * Checks if AI healer has items. * * Arguments: * 0: Healer <OBJECT> @@ -13,7 +13,7 @@ * 2: Treatment <STRING> (Optional) * * Example: - * [cursorObject, "@bandage"] call ACE_medical_ai_fnc_itemCheck + * [cursorObject, "@bandage"] call ace_medical_ai_fnc_itemCheck * * Public: No */ diff --git a/addons/medical_ai/functions/fnc_playTreatmentAnim.sqf b/addons/medical_ai/functions/fnc_playTreatmentAnim.sqf index b8e77aab43e..9b663f65b22 100644 --- a/addons/medical_ai/functions/fnc_playTreatmentAnim.sqf +++ b/addons/medical_ai/functions/fnc_playTreatmentAnim.sqf @@ -12,10 +12,11 @@ * None * * Example: - * [bob, true, true] call ACE_medical_ai_fnc_playTreatmentAnim + * [cursorObject, "Splint", true] call ace_medical_ai_fnc_playTreatmentAnim * * Public: No */ + params ["_unit", "_actionName", "_isSelfTreatment"]; TRACE_3("playTreatmentAnim",_unit,_actionName,_isSelfTreatment); diff --git a/addons/medical_ai/functions/fnc_requestMedic.sqf b/addons/medical_ai/functions/fnc_requestMedic.sqf index 9e59181204d..758fa80a1fd 100644 --- a/addons/medical_ai/functions/fnc_requestMedic.sqf +++ b/addons/medical_ai/functions/fnc_requestMedic.sqf @@ -4,21 +4,24 @@ * Sends a request to the units assigned medic to heal it. * * Arguments: - * None + * Unit <OBJECT> * * Return Value: * None * * Example: - * call ACE_medical_ai_fnc_requestMedic + * cursorObject call ace_medical_ai_fnc_requestMedic * * Public: No */ private _assignedMedic = _this getVariable QGVAR(assignedMedic); private _healQueue = _assignedMedic getVariable [QGVAR(healQueue), []]; -_healQueue pushBack _this; -_assignedMedic setVariable [QGVAR(healQueue), _healQueue]; + +// Only update if it was actually changed +if (_healQueue pushBackUnique _this != -1) then { + _assignedMedic setVariable [QGVAR(healQueue), _healQueue]; +}; #ifdef DEBUG_MODE_FULL systemChat format ["%1 requested %2 for medical treatment", _this, _assignedMedic]; diff --git a/addons/medical_ai/functions/fnc_wasRequested.sqf b/addons/medical_ai/functions/fnc_wasRequested.sqf index 3b6c1cf0592..ffb9aa37808 100644 --- a/addons/medical_ai/functions/fnc_wasRequested.sqf +++ b/addons/medical_ai/functions/fnc_wasRequested.sqf @@ -4,13 +4,13 @@ * Checks if the unit was requested to treat another unit. * * Arguments: - * None + * Unit <OBJECT> * * Return Value: * Was requested <BOOL> * * Example: - * call ACE_medical_ai_fnc_wasRequested + * cursorObject call ace_medical_ai_fnc_wasRequested * * Public: No */ diff --git a/addons/medical_ai/initSettings.inc.sqf b/addons/medical_ai/initSettings.inc.sqf index a2b06519a48..b8ff7e61346 100644 --- a/addons/medical_ai/initSettings.inc.sqf +++ b/addons/medical_ai/initSettings.inc.sqf @@ -1,7 +1,8 @@ private _categoryArray = [ELSTRING(medical,Category), "STR_TEAM_SWITCH_AI"]; [ - QGVAR(enabledFor), "LIST", + QGVAR(enabledFor), + "LIST", [LLSTRING(enableFor_title), LLSTRING(enableFor_desc)], _categoryArray, [ @@ -15,7 +16,8 @@ private _categoryArray = [ELSTRING(medical,Category), "STR_TEAM_SWITCH_AI"]; ] call CBA_fnc_addSetting; [ - QGVAR(requireItems), "LIST", + QGVAR(requireItems), + "LIST", [LSTRING(requireItems_title), LSTRING(requireItems_desc)], _categoryArray, [ @@ -24,16 +26,6 @@ private _categoryArray = [ELSTRING(medical,Category), "STR_TEAM_SWITCH_AI"]; 0 ], true, // isGlobal - { - if (GVAR(requireItems) != 2) exitWith {}; - ["CAManBase", "initPost", { - [{ - params ["_unit"]; - if ((!local _unit) || {!alive _unit} || {isPlayer _unit}) exitWith {}; - TRACE_2("replacing medical items on AI",_unit,typeOf _unit); - [_unit] call EFUNC(common,replaceRegisteredItems); - }, _this] call CBA_fnc_execNextFrame; // need to delay a frame before modifying items in a backpack - }, nil, [IGNORE_BASE_UAVPILOTS], true] call CBA_fnc_addClassEventHandler; - }, + {[QGVAR(requireItems), _this] call EFUNC(common,cbaSettings_settingChanged)}, true // Needs mission restart ] call CBA_fnc_addSetting; diff --git a/addons/medical_ai/stateMachine.inc.sqf b/addons/medical_ai/stateMachine.inc.sqf index 03483f49815..73b82f98a9c 100644 --- a/addons/medical_ai/stateMachine.inc.sqf +++ b/addons/medical_ai/stateMachine.inc.sqf @@ -17,13 +17,8 @@ GVAR(stateMachine) = [{call EFUNC(common,getLocalUnits)}, true] call CBA_statema #endif }, {}, {}, "Safe"] call CBA_statemachine_fnc_addState; -[GVAR(stateMachine), LINKFUNC(healSelf), {}, { - _this setVariable [QGVAR(treatmentOverAt), nil]; -}, "HealSelf"] call CBA_statemachine_fnc_addState; - -[GVAR(stateMachine), LINKFUNC(healUnit), {}, { - _this setVariable [QGVAR(treatmentOverAt), nil]; -}, "HealUnit"] call CBA_statemachine_fnc_addState; +[GVAR(stateMachine), LINKFUNC(healSelf), {}, {}, "HealSelf"] call CBA_statemachine_fnc_addState; +[GVAR(stateMachine), LINKFUNC(healUnit), {}, {}, "HealUnit"] call CBA_statemachine_fnc_addState; // Add Transistions [statemachine, originalState, targetState, condition, onTransition, name] [GVAR(stateMachine), "Initial", "Injured", LINKFUNC(isInjured), {}, "Injured"] call CBA_statemachine_fnc_addTransition; diff --git a/addons/medical_damage/CfgEventHandlers.hpp b/addons/medical_damage/CfgEventHandlers.hpp index 865276cfba9..f6503c2479b 100644 --- a/addons/medical_damage/CfgEventHandlers.hpp +++ b/addons/medical_damage/CfgEventHandlers.hpp @@ -9,3 +9,9 @@ class Extended_PreInit_EventHandlers { init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); }; }; + +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_SCRIPT(XEH_postInit)); + }; +}; diff --git a/addons/medical_damage/XEH_postInit.sqf b/addons/medical_damage/XEH_postInit.sqf new file mode 100644 index 00000000000..39b1c9301e9 --- /dev/null +++ b/addons/medical_damage/XEH_postInit.sqf @@ -0,0 +1,4 @@ +#include "script_component.hpp" + +// Reload configs (handle functions being compiled after medical_damage's preInit) +call FUNC(parseConfigForInjuries); diff --git a/addons/medical_damage/XEH_preInit.sqf b/addons/medical_damage/XEH_preInit.sqf index 344b9c81ee0..b389a0eaa0c 100644 --- a/addons/medical_damage/XEH_preInit.sqf +++ b/addons/medical_damage/XEH_preInit.sqf @@ -10,11 +10,13 @@ PREP_RECOMPILE_END; call FUNC(parseConfigForInjuries); +/* addMissionEventHandler ["Loaded",{ INFO("Mission Loaded - Reloading medical configs for extension"); // Reload configs into extension (handle full game restart) call FUNC(parseConfigForInjuries); }]; +*/ [QEGVAR(medical,woundReceived), LINKFUNC(woundReceived)] call CBA_fnc_addEventHandler; diff --git a/addons/medical_damage/config.cpp b/addons/medical_damage/config.cpp index 4df519a648e..89ac2955250 100644 --- a/addons/medical_damage/config.cpp +++ b/addons/medical_damage/config.cpp @@ -27,13 +27,4 @@ class CfgPatches { #include "CfgEventHandlers.hpp" #include "CfgAmmo.hpp" #include "CfgEden.hpp" - -/* -class ACE_Extensions { - class ace_medical { - // Not yet used - }; -}; - */ - #endif diff --git a/addons/medical_damage/functions/fnc_debug_explosiveTest.sqf b/addons/medical_damage/functions/fnc_debug_explosiveTest.sqf index d17b268c157..a867a654707 100644 --- a/addons/medical_damage/functions/fnc_debug_explosiveTest.sqf +++ b/addons/medical_damage/functions/fnc_debug_explosiveTest.sqf @@ -34,7 +34,7 @@ params [ _distances params [["_min", 1], ["_max", 10], ["_step", 1]]; -if (isNil "_center") exitwith {}; +if (isNil "_center") exitWith {}; _max = _max max _min; private _nSteps = 0 max ceil ((_max - _min) / _step); diff --git a/addons/medical_damage/functions/fnc_parseWoundHandlersCfg.sqf b/addons/medical_damage/functions/fnc_parseWoundHandlersCfg.sqf index 0dad747c683..010f02b7f5d 100644 --- a/addons/medical_damage/functions/fnc_parseWoundHandlersCfg.sqf +++ b/addons/medical_damage/functions/fnc_parseWoundHandlersCfg.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: Pterolatypus - * Read a list of wound handler entries from config, accounting for inheritance + * Read a list of wound handler entries from config, accounting for inheritance. * * Arguments: * 0: The config class containing the entries <CONFIG> @@ -10,24 +10,43 @@ * None * * Example: - * [configFile >> "ace_medical_injuries" >> "damageTypes"] call ace_medical_damage_fnc_parseWoundHandlersCfg + * [configFile >> "ace_medical_injuries" >> "damageTypes" >> "woundHandlers"] call ace_medical_damage_fnc_parseWoundHandlersCfg * * Public: No */ + params ["_config"]; -// read all valid entries from config and store +// Read all valid entries from config and store private _entries = []; + { - private _entryResult = call compile getText _x; - if !(isNil "_entryResult") then { - _entries pushBack _entryResult; - } + private _entryResult = getText _x; + + if (_entryResult != "") then { + if (ADDON) then { + // Runs in postInit + _entryResult = call compile _entryResult; + + if (!isNil "_entryResult") then { + if (_entryResult isEqualType {}) then { + _entries pushBack _entryResult; + } else { + ERROR_2("Wound handler '%1' needs to be a function, but is of type %2.",configName _x,toLowerANSI typeName _entryResult); + }; + }; + } else { + // Runs in preInit + // In case function doesn't exist yet, wrap in extra layer + _entries pushBack (compile format ["call %1", _entryResult]); + }; + }; } forEach configProperties [_config, "isText _x", false]; private _parent = inheritsFrom _config; + if (isNull _parent) exitWith {_entries}; -// recursive call for parent -// can't use configProperties for inheritance since it returns entries in the wrong order -([_parent] call FUNC(parseWoundHandlersCfg)) + _entries; +// Recursive call for parent +// Can't use configProperties for inheritance since it returns entries in the wrong order +([_parent] call FUNC(parseWoundHandlersCfg)) + _entries // return diff --git a/addons/medical_damage/functions/fnc_woundReceived.sqf b/addons/medical_damage/functions/fnc_woundReceived.sqf index a7e3861dee1..c31cf5b3789 100644 --- a/addons/medical_damage/functions/fnc_woundReceived.sqf +++ b/addons/medical_damage/functions/fnc_woundReceived.sqf @@ -17,18 +17,23 @@ * * Public: No */ + params ["_unit", "_allDamages", "_shooter", "_ammo"]; private _typeOfDamage = _ammo call FUNC(getTypeOfDamage); + if (_typeOfDamage in GVAR(damageTypeDetails)) then { (GVAR(damageTypeDetails) get _typeOfDamage) params ["", "", "_woundHandlers"]; private _damageData = [_unit, _allDamages, _typeOfDamage]; + { _damageData = _damageData call _x; TRACE_1("Wound handler returned",_damageData); - if !(_damageData isEqualType [] && {(count _damageData) >= 3}) exitWith { - TRACE_1("Return invalid, terminating wound handling",_damageData); + + // If invalid return, exit + if (isNil "_damageData" || {!(_damageData isEqualType [])} || {(count _damageData) < 3}) exitWith { + TRACE_1("Return invalid, skipping wound handling",_damageData); }; } forEach _woundHandlers; }; diff --git a/addons/medical_damage/functions/fnc_woundsHandlerBase.sqf b/addons/medical_damage/functions/fnc_woundsHandlerBase.sqf index fb82f383b6e..92effda9bd5 100644 --- a/addons/medical_damage/functions/fnc_woundsHandlerBase.sqf +++ b/addons/medical_damage/functions/fnc_woundsHandlerBase.sqf @@ -22,7 +22,7 @@ TRACE_3("woundsHandlerBase",_unit,_allDamages,_typeOfDamage); if !(_typeOfDamage in GVAR(damageTypeDetails)) then { - WARNING_1("damage type not found",_typeOfDamage); + WARNING_1("damage type %1 not found",_typeOfDamage); _typeOfDamage = "unknown"; }; @@ -80,7 +80,7 @@ private _bodyPartVisParams = [_unit, false, false, false, false]; // params arra // Select the injury we are going to add selectRandomWeighted _weightedWoundTypes params ["_woundTypeToAdd", "", "_dmgMultiplier", "_bleedMultiplier", "_sizeMultiplier", "_painMultiplier", "_fractureMultiplier"]; if (isNil "_woundTypeToAdd") then { - WARNING_4("No valid wound types",_damage,_dmgPerWound,_typeOfDamage,_bodyPart); + WARNING_4("No valid wound types %1-%2-%3-%4",_damage,_dmgPerWound,_typeOfDamage,_bodyPart); continue }; GVAR(woundDetails) get _woundTypeToAdd params ["","_injuryBleedingRate","_injuryPain","_causeLimping","_causeFracture"]; diff --git a/addons/medical_damage/functions/fnc_woundsHandlerBurning.sqf b/addons/medical_damage/functions/fnc_woundsHandlerBurning.sqf index 47c625684ac..1130c8d3f53 100644 --- a/addons/medical_damage/functions/fnc_woundsHandlerBurning.sqf +++ b/addons/medical_damage/functions/fnc_woundsHandlerBurning.sqf @@ -37,7 +37,7 @@ TRACE_3("woundsHandlerBurning",_unit,_allDamages,_typeOfDamage); [{ params ["_unit"]; - _bodyPart = selectRandom ["body", "leftleg", "rightleg"]; + private _bodyPart = selectRandom ["body", "leftleg", "rightleg"]; private _storedDamage = _unit getVariable [QGVAR(storedBurnDamage), 0]; [QEGVAR(medical,woundReceived), [_unit, [[_storedDamage, _bodyPart, _storedDamage]], _unit, "burn"]] call CBA_fnc_localEvent; _unit setVariable [QGVAR(storedBurnDamage), 0, true]; diff --git a/addons/medical_engine/functions/fnc_handleDamage.sqf b/addons/medical_engine/functions/fnc_handleDamage.sqf index 168203366c2..591e68e2533 100644 --- a/addons/medical_engine/functions/fnc_handleDamage.sqf +++ b/addons/medical_engine/functions/fnc_handleDamage.sqf @@ -94,7 +94,7 @@ if ( GET_NUMBER(_ammoCfg >> "explosive",0) > 0 || {GET_NUMBER(_ammoCfg >> "indirectHit",0) > 0} } -) exitwith { +) exitWith { TRACE_5("Vehicle hit",_unit,_shooter,_instigator,_damage,_newDamage); _unit setVariable [QEGVAR(medical,lastDamageSource), _shooter]; @@ -165,7 +165,11 @@ if (_context == 2) then { if (_environmentDamage) then { // Any collision with terrain/vehicle/object has a shooter // Check this first because burning can happen at any velocity - if !(isNull _shooter) then { + if (isNull _shooter) then { + // Anything else is almost guaranteed to be fire damage + _ammo = "fire"; + TRACE_5("Fire Damage",_unit,_shooter,_instigator,_damage,_allDamages); + } else { /* If shooter != unit then they hit unit, otherwise it could be: - Unit hitting anything at speed @@ -180,10 +184,6 @@ if (_context == 2) then { _ammo = "collision"; TRACE_5("Collision",_unit,_shooter,_instigator,_damage,_allDamages); }; - } else { - // Anything else is almost guaranteed to be fire damage - _ammo = "fire"; - TRACE_5("Fire Damage",_unit,_shooter,_instigator,_damage,_allDamages); }; }; diff --git a/addons/medical_engine/functions/fnc_lockUnconsciousSeat.sqf b/addons/medical_engine/functions/fnc_lockUnconsciousSeat.sqf index cc29e75cc1a..8441df4ad83 100644 --- a/addons/medical_engine/functions/fnc_lockUnconsciousSeat.sqf +++ b/addons/medical_engine/functions/fnc_lockUnconsciousSeat.sqf @@ -11,7 +11,6 @@ * * Public: No */ -if (missionNamespace getVariable [QGVAR(disableSeatLocking), false]) exitWith {}; params ["_unit"]; private _vehicle = objectParent _unit; @@ -20,6 +19,13 @@ TRACE_3("lockUnconsciousSeat",_unit,_vehicle,lifeState _unit); if (isNull _vehicle) exitWith {}; if (alive _unit && {lifeState _unit != "INCAPACITATED"}) exitWith {}; +private _disable = missionNamespace getVariable [QGVAR(disableSeatLocking), false]; +if (_disable isEqualTo true || { + _disable isEqualType [] && { + (_disable findIf {_vehicle isKindOf _x}) != -1 + } +}) exitWith {}; + switch (true) do { case (_unit isEqualTo (driver _vehicle)): { _vehicle lockDriver true; diff --git a/addons/medical_engine/functions/fnc_updateDamageEffects.sqf b/addons/medical_engine/functions/fnc_updateDamageEffects.sqf index 7dc73e04f47..f4a18094a60 100644 --- a/addons/medical_engine/functions/fnc_updateDamageEffects.sqf +++ b/addons/medical_engine/functions/fnc_updateDamageEffects.sqf @@ -67,7 +67,7 @@ if (!_isLimping && {EGVAR(medical,limping) > 0}) then { (_xAmountOf > 0) && {_xDamage > LIMPING_DAMAGE_THRESHOLD} // select _causeLimping from woundDetails - && {(EGVAR(medical_damage,woundDetails) get (_xClassID / 10)) select 3} + && {(EGVAR(medical_damage,woundDetails) get (floor (_xClassID / 10))) select 3} ) exitWith { TRACE_1("limping because of wound",_x); _isLimping = true; diff --git a/addons/medical_feedback/functions/fnc_playInjuredSound.sqf b/addons/medical_feedback/functions/fnc_playInjuredSound.sqf index c278e6e08ae..b33b533e25f 100644 --- a/addons/medical_feedback/functions/fnc_playInjuredSound.sqf +++ b/addons/medical_feedback/functions/fnc_playInjuredSound.sqf @@ -6,8 +6,11 @@ * * Arguments: * 0: Unit <OBJECT> - * 1: Type (optional) ["hit" (default) or "moan"] <STRING> - * 2: Severity (optional) [0 (default), 1, 2] <NUMBER> + * 1: Type ["hit", "moan"] <STRING> (default: "hit") + * 2: Severity [0, 1, 2] <NUMBER> (default: 0) + * 3: Hit sound distances <ARRAY> (default: [50, 60, 70]) + * 4: Moan sound distances <ARRAY> (default: [10, 15, 20]) + * 5: Allow unconscious units <BOOL> (default: false) * * Return Value: * None @@ -20,18 +23,18 @@ #define TIME_OUT_HIT 1 #define TIME_OUT_MOAN [12, 7.5, 5] -params [["_unit", objNull, [objNull]], ["_type", "hit", [""]], ["_severity", 0, [0]]]; +params [["_unit", objNull, [objNull]], ["_type", "hit", [""]], ["_severity", 0, [0]], ["_hitDistances", [50, 60, 70], [[]], [3]], ["_moanDistances", [10, 15, 20], [[]], [3]], ["_allowUnconscious", false, [true]]]; // TRACE_3("",_unit,_type,_severity); if (!local _unit) exitWith { ERROR_2("playInjuredSound: Unit not local or null [%1:%2]",_unit,typeOf _unit); }; -if !(_unit call EFUNC(common,isAwake)) exitWith {}; +if (!_allowUnconscious && {!(_unit call EFUNC(common,isAwake))}) exitWith {}; // Limit network traffic by only sending the event to players who can potentially hear it private _distance = if (_type == "hit") then { - [50, 60, 70] select _severity; + _hitDistances select _severity } else { - [10, 15, 20] select _severity; + _moanDistances select _severity }; private _targets = allPlayers inAreaArray [ASLToAGL getPosASL _unit, _distance, _distance, 0, false, _distance]; if (_targets isEqualTo []) exitWith {}; diff --git a/addons/medical_gui/XEH_postInit.sqf b/addons/medical_gui/XEH_postInit.sqf index 2b7fb8ce523..6d18696b0e7 100644 --- a/addons/medical_gui/XEH_postInit.sqf +++ b/addons/medical_gui/XEH_postInit.sqf @@ -2,6 +2,8 @@ if (!hasInterface) exitWith {}; +#include "initKeybinds.inc.sqf" + GVAR(target) = objNull; GVAR(previousTarget) = objNull; GVAR(selectedBodyPart) = 0; @@ -35,64 +37,6 @@ GVAR(selfInteractionActions) = []; }; }] call CBA_fnc_addEventHandler; -["ACE3 Common", QGVAR(openMedicalMenuKey), localize LSTRING(OpenMedicalMenu), { - // Get target (cursorTarget, cursorObject, and lineIntersectsSurfaces along camera to maxDistance), if not valid then target is ACE_player - TRACE_3("Open menu key",cursorTarget,cursorObject,ACE_player); - private _target = cursorTarget; - if !(_target isKindOf "CAManBase" && {[ACE_player, _target] call FUNC(canOpenMenu)}) then { - _target = cursorObject; - if !(_target isKindOf "CAManBase" && {[ACE_player, _target] call FUNC(canOpenMenu)}) then { - private _start = AGLToASL positionCameraToWorld [0, 0, 0]; - private _end = AGLToASL positionCameraToWorld [0, 0, GVAR(maxDistance)]; - private _intersections = lineIntersectsSurfaces [_start, _end, ACE_player, objNull, true, -1, "FIRE"]; - { - _x params ["", "", "_intersectObject"]; - // Only look "through" player and player's vehicle - if (!(_intersectObject isKindOf "CAManBase") && {_intersectObject != vehicle ACE_player}) exitWith {}; - if (_intersectObject != ACE_player && {_intersectObject isKindOf "CAManBase" && {[ACE_player, _intersectObject] call FUNC(canOpenMenu)}}) exitWith { - _target =_intersectObject - }; - } forEach _intersections; - if (!(_target isKindOf "CAManBase") || {!([ACE_player, _target] call FUNC(canOpenMenu))}) then { - _target = ACE_player; - }; - }; - }; - - // Check conditions: canInteract and canOpenMenu - if !([ACE_player, _target, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; - if !([ACE_player, _target] call FUNC(canOpenMenu)) exitWith {false}; - - // Statement - [_target] call FUNC(openMenu); - false -}, { - // Close menu if enough time passed from opening - if (CBA_missionTime - GVAR(lastOpenedOn) > 0.5) exitWith { - [objNull] call FUNC(openMenu); - }; - false -}, [DIK_H, [false, false, false]], false, 0] call CBA_fnc_addKeybind; - -["ACE3 Common", QGVAR(peekMedicalInfoKey), localize LSTRING(PeekMedicalInfo), -{ - // Conditions: canInteract - if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; - - // Statement - [ACE_player, -1] call FUNC(displayPatientInformation); - false -}, { - if (CBA_missionTime - GVAR(peekLastOpenedOn) > GVAR(peekMedicalInfoReleaseDelay)) then { - [{ - CBA_missionTime - GVAR(peekLastOpenedOn) > GVAR(peekMedicalInfoReleaseDelay) - }, {QGVAR(RscPatientInfo) cutFadeOut 0.3}] call CBA_fnc_waitUntilAndExecute; - }; - GVAR(peekLastOpenedOn) = CBA_missionTime; - false -}, [DIK_H, [false, true, false]], false, 0] call CBA_fnc_addKeybind; - - // Close patient information display when interaction menu is closed ["ace_interactMenuClosed", { QGVAR(RscPatientInfo) cutFadeOut 0.3; diff --git a/addons/medical_gui/functions/fnc_displayPatientInformation.sqf b/addons/medical_gui/functions/fnc_displayPatientInformation.sqf index 65660eec798..abea0ec07bb 100644 --- a/addons/medical_gui/functions/fnc_displayPatientInformation.sqf +++ b/addons/medical_gui/functions/fnc_displayPatientInformation.sqf @@ -40,6 +40,7 @@ if (isNull _display) then { if (ACE_player distance _target > MAX_DISTANCE && {vehicle _target != vehicle ACE_player}) exitWith { [_pfhID] call CBA_fnc_removePerFrameHandler; QGVAR(RscPatientInfo) cutFadeOut 0.3; + if (((getPosATL _target) # 2) < -9) exitWith {}; // handle dragging corpse/clone [[ELSTRING(medical,DistanceToFar), _target call EFUNC(common,getName)], 2] call EFUNC(common,displayTextStructured); }; diff --git a/addons/medical_gui/functions/fnc_menuPFH.sqf b/addons/medical_gui/functions/fnc_menuPFH.sqf index b3d51c2dc9c..0e213eaf5ec 100644 --- a/addons/medical_gui/functions/fnc_menuPFH.sqf +++ b/addons/medical_gui/functions/fnc_menuPFH.sqf @@ -23,6 +23,8 @@ if !( closeDialog 0; // Show hint if distance condition failed if ((ACE_player distance GVAR(target) > GVAR(maxDistance)) && {vehicle ACE_player != vehicle GVAR(target)}) then { + if (((getPosATL GVAR(target)) # 2) < -9) exitWith {}; // handle dragging corpse/clone + [[ELSTRING(medical,DistanceToFar), GVAR(target) call EFUNC(common,getName)], 2] call EFUNC(common,displayTextStructured); }; }; diff --git a/addons/medical_gui/initKeybinds.inc.sqf b/addons/medical_gui/initKeybinds.inc.sqf new file mode 100644 index 00000000000..53c577084e9 --- /dev/null +++ b/addons/medical_gui/initKeybinds.inc.sqf @@ -0,0 +1,55 @@ +["ACE3 Common", QGVAR(openMedicalMenuKey), LLSTRING(OpenMedicalMenu), { + // Get target (cursorTarget, cursorObject, and lineIntersectsSurfaces along camera to maxDistance), if not valid then target is ACE_player + TRACE_3("Open menu key",cursorTarget,cursorObject,ACE_player); + private _target = cursorTarget; + if !(_target isKindOf "CAManBase" && {[ACE_player, _target] call FUNC(canOpenMenu)}) then { + _target = cursorObject; + if !(_target isKindOf "CAManBase" && {[ACE_player, _target] call FUNC(canOpenMenu)}) then { + private _start = AGLToASL positionCameraToWorld [0, 0, 0]; + private _end = AGLToASL positionCameraToWorld [0, 0, GVAR(maxDistance)]; + private _intersections = lineIntersectsSurfaces [_start, _end, ACE_player, objNull, true, -1, "FIRE"]; + { + _x params ["", "", "_intersectObject"]; + // Only look "through" player and player's vehicle + if (!(_intersectObject isKindOf "CAManBase") && {_intersectObject != vehicle ACE_player}) exitWith {}; + if (_intersectObject != ACE_player && {_intersectObject isKindOf "CAManBase" && {[ACE_player, _intersectObject] call FUNC(canOpenMenu)}}) exitWith { + _target = _intersectObject; + }; + } forEach _intersections; + if (!(_target isKindOf "CAManBase") || {!([ACE_player, _target] call FUNC(canOpenMenu))}) then { + _target = ACE_player; + }; + }; + }; + + // Check conditions: canInteract and canOpenMenu + if !([ACE_player, _target, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, _target] call FUNC(canOpenMenu)) exitWith {false}; + + // Statement + [_target] call FUNC(openMenu); + false +}, { + // Close menu if enough time passed from opening + if (CBA_missionTime - GVAR(lastOpenedOn) > 0.5) exitWith { + [objNull] call FUNC(openMenu); + }; +}, [DIK_H, [false, false, false]], false, 0] call CBA_fnc_addKeybind; + +["ACE3 Common", QGVAR(peekMedicalInfoKey), LLSTRING(PeekMedicalInfo), { + // Conditions: canInteract + if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; + + // Statement + [ACE_player, -1] call FUNC(displayPatientInformation); + false +}, { + if (CBA_missionTime - GVAR(peekLastOpenedOn) > GVAR(peekMedicalInfoReleaseDelay)) then { + [{ + CBA_missionTime - GVAR(peekLastOpenedOn) > GVAR(peekMedicalInfoReleaseDelay) + }, { + QGVAR(RscPatientInfo) cutFadeOut 0.3; + }] call CBA_fnc_waitUntilAndExecute; + }; + GVAR(peekLastOpenedOn) = CBA_missionTime; +}, [DIK_H, [false, true, false]], false, 0] call CBA_fnc_addKeybind; diff --git a/addons/medical_gui/stringtable.xml b/addons/medical_gui/stringtable.xml index 3f816aa39bb..6dfc16f9b95 100644 --- a/addons/medical_gui/stringtable.xml +++ b/addons/medical_gui/stringtable.xml @@ -222,6 +222,7 @@ <German>Zeige Triage-Einstufung im Interaktionsmenü</German> <Chinesesimp>在交互式菜单中显示分诊级别</Chinesesimp> <Korean>상호작용 메뉴에서 부상자 카드 보기</Korean> + <Portuguese>Mostrar Nível de Triagem no Menu de Interação</Portuguese> </Key> <Key ID="STR_ACE_Medical_GUI_InteractionMenuShowTriage_Description"> <English>Shows the patient's triage level by changing the color of the main and medical menu actions.</English> @@ -234,6 +235,7 @@ <German>Zeigt die Triage-Einstufung des Patienten durch Ändern der Farbe der Aktionen des Hauptmenüs und des medizinischen Menüs an.</German> <Chinesesimp>通过改变主菜单和医疗菜单动作的颜色来显示伤员的分诊级别。</Chinesesimp> <Korean>환자의 부상자 카드를 상호작용에서 볼 수 있게 합니다.</Korean> + <Portuguese>Mostra o nível de triagem do paciente alterando a cor das ações do menu principal e do menu médico.</Portuguese> </Key> <Key ID="STR_ACE_Medical_GUI_Medical"> <English>Medical</English> @@ -294,6 +296,7 @@ <Japanese>医療情報一時表示</Japanese> <Russian>Просмотр медицинской информации</Russian> <Spanish>Ojear Información Médica</Spanish> + <Portuguese>Visualização rápida das informações médicas</Portuguese> </Key> <Key ID="STR_ACE_Medical_GUI_PeekMedicalInfoReleaseDelay_DisplayName"> <English>Medical Peek Duration</English> @@ -305,6 +308,7 @@ <Japanese>医療情報一時表示の表示時間</Japanese> <Russian>Продолжительность медицинского осмотра</Russian> <Spanish>Duración del Ojear Información Médica</Spanish> + <Portuguese>Duração da visualização geral das informações médicas</Portuguese> </Key> <Key ID="STR_ACE_Medical_GUI_PeekMedicalInfoReleaseDelay_Description"> <English>How long the medical info peek remains open after releasing the key.</English> @@ -316,6 +320,7 @@ <Japanese>医療情報一時表示キーを放してからどれだけ長く情報表示するか。</Japanese> <Russian>Как долго окно просмотра медицинской информации остается открытым после отпускания клавиши.</Russian> <Spanish>Durante cuánto tiempo la información médica ojeada permanece abierta una ves se deje de apretar la tecla.</Spanish> + <Portuguese>Quanto tempo a visualização rápida das informações médicas permanece aberta após soltar a tecla.</Portuguese> </Key> <Key ID="STR_ACE_Medical_GUI_LoadPatient"> <English>Load Patient</English> @@ -570,6 +575,7 @@ <Japanese>自分に切り替え</Japanese> <Russian>Переключиться на себя </Russian> <Spanish>Cambiar a uno mismo</Spanish> + <Portuguese>Trocar para si mesmo</Portuguese> </Key> <Key ID="STR_ACE_Medical_GUI_ToggleToOther"> <English>Switch to target</English> @@ -581,6 +587,7 @@ <Japanese>相手に切り替え</Japanese> <Russian>Переключиться на цель</Russian> <Spanish>Cambiar al objetivo</Spanish> + <Portuguese>Trocar para paciente</Portuguese> </Key> <Key ID="STR_ACE_Medical_GUI_Head"> <English>Head</English> @@ -1008,6 +1015,7 @@ <Japanese>出血はしていない</Japanese> <Russian>Кровотечения нет</Russian> <Spanish>Sin sangrado</Spanish> + <Portuguese>Sem sangramento</Portuguese> </Key> <Key ID="STR_ACE_Medical_GUI_Bleed_Rate1"> <English>Slow bleeding</English> @@ -1019,6 +1027,7 @@ <Japanese>出血は穏やか</Japanese> <Russian>Медленное кровотечение</Russian> <Spanish>Sangrado lento</Spanish> + <Portuguese>Sangramento lento</Portuguese> </Key> <Key ID="STR_ACE_Medical_GUI_Bleed_Rate2"> <English>Moderate bleeding</English> @@ -1030,6 +1039,7 @@ <Japanese>出血はそこそこ速い</Japanese> <Russian>Умеренное кровотечение</Russian> <Spanish>Sangrado moderado</Spanish> + <Portuguese>Sangramento moderado</Portuguese> </Key> <Key ID="STR_ACE_Medical_GUI_Bleed_Rate3"> <English>Severe bleeding</English> @@ -1041,6 +1051,7 @@ <Japanese>出血は激しい</Japanese> <Russian>Сильное кровотечение</Russian> <Spanish>Sangrado severo</Spanish> + <Portuguese>Sangramento grave</Portuguese> </Key> <Key ID="STR_ACE_Medical_GUI_Bleed_Rate4"> <English>Massive bleeding</English> @@ -1052,6 +1063,7 @@ <Japanese>出血は酷く多い</Japanese> <Russian>Огромное кровотечение</Russian> <Spanish>Sangrado masivo</Spanish> + <Portuguese>Sangramento massivo</Portuguese> </Key> <Key ID="STR_ACE_Medical_GUI_STATUS_PAIN"> <English>in Pain</English> @@ -1127,6 +1139,7 @@ <Japanese>失血なし</Japanese> <Russian>Потери крови нет</Russian> <Spanish>Sin pérdida de sangre</Spanish> + <Portuguese>Sem perda de sangue</Portuguese> </Key> <!--Strings above match Blood2 but seem to differ in some languages, determine which is best to use--> <Key ID="STR_ACE_Medical_GUI_Lost_Blood1"> @@ -1271,6 +1284,7 @@ <Spanish>Información de paciente</Spanish> <German>Patienteninformation</German> <Korean>환자 정보</Korean> + <Portuguese>Informações do paciente</Portuguese> </Key> <Key ID="STR_ACE_Medical_GUI_BloodLossColors"> <English>Blood Loss Colors</English> @@ -1283,6 +1297,7 @@ <Chinesesimp>失血颜色</Chinesesimp> <Korean>출혈 색상</Korean> <Spanish>Colores de pérdida de sangre</Spanish> + <Portuguese>Cores de perda de sangue</Portuguese> </Key> <Key ID="STR_ACE_Medical_GUI_BloodLossColor_Description"> <English>Defines the 10 color gradient used to indicate blood loss in Medical GUIs.</English> @@ -1295,6 +1310,7 @@ <Chinesesimp>失血颜色,用于医学图形用户界面。10种渐变颜色。</Chinesesimp> <Korean>출혈로 인한 의료 GUI의 색상을 변경합니다. 총 10가지 색상이 있습니다.</Korean> <Spanish>Define los 10 gradientes de color utilizados para indicar la pérdida de sangre en la interfaz gráfica del sistema Médico.</Spanish> + <Portuguese>Define os 10 gradientes de cores utilizados para indicar perda de sangue nas interfaces médicas.</Portuguese> </Key> <Key ID="STR_ACE_Medical_GUI_BloodLossColorX_DisplayName"> <English>Blood Loss Color %1</English> @@ -1307,6 +1323,7 @@ <Chinesesimp>失血颜色 %1</Chinesesimp> <Korean>출혈 색상 %1</Korean> <Spanish>Color de pérdida de sangre %1</Spanish> + <Portuguese>Cor de perda de sangue %1</Portuguese> </Key> <Key ID="STR_ACE_Medical_GUI_DamageColors"> <English>Damage Colors</English> @@ -1319,6 +1336,7 @@ <Chinesesimp>负伤颜色</Chinesesimp> <Korean>피해 색상</Korean> <Spanish>Colores de daño</Spanish> + <Portuguese>Cores de dano</Portuguese> </Key> <Key ID="STR_ACE_Medical_GUI_DamageColor_Description"> <English>Defines the 10 color gradient used to indicate damage in Medical GUIs.</English> @@ -1331,6 +1349,7 @@ <Chinesesimp>负伤颜色,用于医学图形用户界面。10种渐变颜色。</Chinesesimp> <Korean>의료 GUI에 쓰이는 피해 색상입니다. 총 10가지 색상이 있습니다.</Korean> <Spanish>Define los 10 gradientes de color utilizados para indicar el daño en la interfaz gráfiica del sistema Médico.</Spanish> + <Portuguese>Define os 10 gradientes de cor utilizados para indicar dano nas interfaces médicas.</Portuguese> </Key> <Key ID="STR_ACE_Medical_GUI_DamageColorX_DisplayName"> <English>Damage Color %1</English> @@ -1343,6 +1362,7 @@ <Chinesesimp>负伤颜色 %1</Chinesesimp> <Korean>피해 색상 %1</Korean> <Spanish>Color de daño %1</Spanish> + <Portuguese>Cor de dano %1</Portuguese> </Key> <Key ID="STR_ACE_Medical_GUI_ShowBloodlossEntry_DisplayName"> <English>Show Blood Loss</English> @@ -1355,6 +1375,7 @@ <Russian>Показывать кровопотерю</Russian> <Spanish>Mostrar pérdida de sangre</Spanish> <French>Afficher les pertes de sang</French> + <Portuguese>Mostrar perda de sangue</Portuguese> </Key> <Key ID="STR_ACE_Medical_GUI_ShowBloodlossEntry_Description"> <English>Show qualitative blood loss in the injury list.</English> @@ -1367,6 +1388,7 @@ <Russian>Показывать тяжесть кровопотери в списке ранений.</Russian> <Spanish>Mostrar la pérdida de sangre cualitativa en la lista de heridas.</Spanish> <French>Afficher la quantité de sang perdue</French> + <Portuguese>Mostrar perda de sangue qualitativa na lista de feridas.</Portuguese> </Key> <Key ID="STR_ACE_Medical_GUI_showBleeding_DisplayName"> <English>Show Bleeding State</English> @@ -1412,6 +1434,7 @@ <Japanese>被弾時の医療情報一時表示</Japanese> <Russian>Показать медицинскую информацию о попадании</Russian> <Spanish>Ojear Información Médica en Impacto</Spanish> + <Portuguese>Visualização rápida das informações médicas durante uma lesão</Portuguese> </Key> <Key ID="STR_ACE_Medical_GUI_PeekMedicalOnHit_Description"> <English>Temporarily show medical info when injured.</English> @@ -1424,6 +1447,7 @@ <Japanese>被弾時に医療情報を一時的に表示します。</Japanese> <Russian>Временно показывать медицинскую информацию при травме.</Russian> <Spanish>Temporalmente muestra la información médica cuando es herido.</Spanish> + <Portuguese>Mostrar informações médicas temporariamente durante uma lesão.</Portuguese> </Key> <Key ID="STR_ACE_Medical_GUI_PeekMedicalOnHitDuration_DisplayName"> <English>Medical Peek Duration on Hit</English> @@ -1436,6 +1460,7 @@ <Japanese>被弾時の医療情報一時表示の表示時間</Japanese> <Russian>Продолжительность медицинского осмотра при попадании</Russian> <Spanish>Duración de Ojear la Información Médica cuando hay Impacto</Spanish> + <Portuguese>Duração da visualização rápida de informações médicas durante uma lesão</Portuguese> </Key> <Key ID="STR_ACE_Medical_GUI_PeekMedicalOnHitDuration_Description"> <English>How long the medical info peek remains open after being injured.</English> @@ -1448,6 +1473,7 @@ <Japanese>被弾時の医療情報の一時表示をどれだけ長く表示するか。</Japanese> <Russian>Как долго окно просмотра медицинской информации остается открытым после получения травмы.</Russian> <Spanish>Durante cuánto tiempo la información médica ojeada permanece abierta una tras haber sido herido.</Spanish> + <Portuguese>Quanto tempo a visualização rápida de informações médicas permanece aberta após ser ferido.</Portuguese> </Key> <Key ID="STR_ACE_Medical_GUI_showDamageEntry_DisplayName"> <English>Show Trauma Sustained</English> @@ -1486,6 +1512,7 @@ <Japanese>身体部位の輪郭表示の色</Japanese> <Russian>Цвет контура части тела</Russian> <Spanish>Color de Contorno de las Partes del Cuerpo</Spanish> + <Portuguese>Cor do contorno da parte do corpo</Portuguese> </Key> <Key ID="STR_ACE_Medical_GUI_bodyPartOutlineColor_Description"> <English>Color of outline around selected body part.</English> @@ -1498,6 +1525,7 @@ <Japanese>選択した身体部位の輪郭表示の色。</Japanese> <Russian>Цвет контура вокруг выбранной части тела.</Russian> <Spanish>Color del contorno alrededor de la parte del cuerpo seleccionada.</Spanish> + <Portuguese>Cor do contorno em volta da parte do corpo selecionada.</Portuguese> </Key> <Key ID="STR_ACE_Medical_GUI_traumaSustained1"> <English>Minor Trauma</English> @@ -1562,6 +1590,7 @@ <Japanese>左</Japanese> <Russian>Лево</Russian> <Spanish>I</Spanish> + <Portuguese>E</Portuguese> </Key> <Key ID="STR_ACE_Medical_GUI_BodyLabelRight"> <English>R</English> @@ -1574,6 +1603,7 @@ <Japanese>右</Japanese> <Russian>Право</Russian> <Spanish>D</Spanish> + <Portuguese>D</Portuguese> </Key> <Key ID="STR_ACE_Medical_GUI_TreatmentItemCount_Medic"> <English>in your inventory</English> @@ -1586,6 +1616,7 @@ <Japanese>個あなたが保有</Japanese> <Russian>в вашем инвентаре</Russian> <Spanish>en tu inventario</Spanish> + <Portuguese>em seu inventário</Portuguese> </Key> <Key ID="STR_ACE_Medical_GUI_TreatmentItemCount_Patient"> <English>in patient's inventory</English> @@ -1598,6 +1629,7 @@ <Japanese>個患者が保有</Japanese> <Russian>в инвентаре пациента</Russian> <Spanish>en el inventario del paciente</Spanish> + <Portuguese>no inventário do paciente</Portuguese> </Key> <Key ID="STR_ACE_Medical_GUI_TreatmentItemCount_Vehicle"> <English>in vehicle's inventory</English> @@ -1610,6 +1642,7 @@ <Japanese>個車両内に保有</Japanese> <Russian>в инвентаре транспорта</Russian> <Spanish>en el inventario del vehículo</Spanish> + <Portuguese>no inventário do veículo</Portuguese> </Key> <Key ID="STR_ACE_Medical_GUI_TourniquetWarning"> <English>No effect until tourniquet removed</English> @@ -1621,6 +1654,7 @@ <Japanese>止血帯を外すまで効果を発揮しません</Japanese> <Russian>Никакого эффекта до тех пор, пока жгут не будет снят</Russian> <Spanish>Sin efecto hasta que se quita el torniquete</Spanish> + <Portuguese>Sem efeito até o torniquete ser removido</Portuguese> </Key> <Key ID="STR_ACE_Medical_GUI_TourniquetWarning_DisplayName"> <English>Show Tourniquet Warning</English> @@ -1632,6 +1666,7 @@ <Japanese>止血帯の警告を表示</Japanese> <Russian>Показать предупреждение о наложении жгута</Russian> <Spanish>Mostrar Advertencia de Torniquete</Spanish> + <Portuguese>Mostrar aviso de torniquete</Portuguese> </Key> <Key ID="STR_ACE_Medical_GUI_TourniquetWarning_Description"> <English>Show a warning tooltip when a tourniquet will interfere with a medical action.</English> @@ -1643,6 +1678,7 @@ <Japanese>止血帯が医療行為を妨げる場合には、警告ツールチップを表示します。</Japanese> <Russian>Показать всплывающую подсказку с предупреждением, когда жгут помешает медицинскому вмешательству.</Russian> <Spanish>Muestra un mensaje de advertencia cuando un torniquete interfiera con una acción médica.</Spanish> + <Portuguese>Mostra uma dica de aviso quando um torniquete interfere com uma ação médica.</Portuguese> </Key> </Package> </Project> diff --git a/addons/medical_statemachine/stringtable.xml b/addons/medical_statemachine/stringtable.xml index 2b828d506e9..9c1d807bd00 100644 --- a/addons/medical_statemachine/stringtable.xml +++ b/addons/medical_statemachine/stringtable.xml @@ -173,6 +173,7 @@ <Polish>Wykrwawienie podczas zatrzymanej akcji serca</Polish> <Chinesesimp>心脏骤停期间失血情况</Chinesesimp> <Korean>심정지 중 출혈</Korean> + <Portuguese>Sangramento durante parada cardíaca</Portuguese> </Key> <Key ID="STR_ACE_Medical_Statemachine_CardiacArrestBleedout_Description"> <English>Controls whether a person can die in cardiac arrest by blood loss before the cardiac arrest time runs out.</English> @@ -185,6 +186,7 @@ <Polish>Kontroluje czy śmierć osoby może nastąpić poprzez wykrwawienie zanim wyczerpię się Czas Zatrzymania Akcji Serca.</Polish> <Chinesesimp>控制单位是否会在心脏骤停时间耗完之前因失血过多而死亡。</Chinesesimp> <Korean>지정한 심정지 시간이 다 되기 전에 출혈로 인해 사망할 수 있는 지를 결정합니다.</Korean> + <Portuguese>Controla se uma pessoa pode morrer em parada cardíaca por perda de sangue antes que o tempo de parada cardíaca acabe.</Portuguese> </Key> </Package> </Project> diff --git a/addons/medical_status/functions/fnc_addInventoryActions.sqf b/addons/medical_status/functions/fnc_addInventoryActions.sqf index 8041eb06135..e4e65a31649 100644 --- a/addons/medical_status/functions/fnc_addInventoryActions.sqf +++ b/addons/medical_status/functions/fnc_addInventoryActions.sqf @@ -46,5 +46,6 @@ _unit addAction ["OpenBag", { {!lockedInventory _backpackContainer} && {maxLoad _backpackContainer > 0} && {getNumber (_backpackConfig >> "disableInventory") != 1} && + {!(_target isKindOf QEGVAR(dragging,clone))} && {_target setUserActionText [_actionId, format [localize "STR_ACTION_OPEN_BAG", getText (_backpackConfig >> "displayName")]]; true} }, 2]; diff --git a/addons/medical_status/functions/fnc_getBloodLoss.sqf b/addons/medical_status/functions/fnc_getBloodLoss.sqf index c2a66046791..5193ccbb0b0 100644 --- a/addons/medical_status/functions/fnc_getBloodLoss.sqf +++ b/addons/medical_status/functions/fnc_getBloodLoss.sqf @@ -21,9 +21,10 @@ private _woundBleeding = GET_WOUND_BLEEDING(_unit); if (_woundBleeding == 0) exitWith {0}; private _cardiacOutput = [_unit] call FUNC(getCardiacOutput); +private _resistance = _unit getVariable [VAR_PERIPH_RES, DEFAULT_PERIPH_RES]; // can use value directly since this is sum of default and adjustments // even if heart stops blood will still flow slowly (gravity) -private _bloodLoss = (_woundBleeding * (_cardiacOutput max CARDIAC_OUTPUT_MIN) * EGVAR(medical,bleedingCoefficient)); +private _bloodLoss = (_woundBleeding * (_cardiacOutput max CARDIAC_OUTPUT_MIN) * (DEFAULT_PERIPH_RES / _resistance) * EGVAR(medical,bleedingCoefficient)); private _eventArgs = [_unit, _bloodLoss]; // Pass by reference diff --git a/addons/medical_status/stringtable.xml b/addons/medical_status/stringtable.xml index ea3f77429b2..cefc85ff421 100644 --- a/addons/medical_status/stringtable.xml +++ b/addons/medical_status/stringtable.xml @@ -127,6 +127,7 @@ <Japanese>武器を落とす確率</Japanese> <Russian>Шанс выпадения оружия</Russian> <Spanish>Probabilidad de Soltar Arma</Spanish> + <Portuguese>Probabilidade de largar a arma</Portuguese> </Key> <Key ID="STR_ACE_Medical_Status_DropWeaponUnconsciousChance_Description"> <English>Chance for a player to drop their weapon when going unconscious.\nHas no effect on AI.</English> @@ -138,6 +139,7 @@ <Japanese>プレーヤーが意識を失ったときに武器を落とす可能性。\nAI には影響しません。</Japanese> <Russian>Шанс для игрока выронить свое оружие, когда он теряет сознание.\nНе влияет на ИИ</Russian> <Spanish>Probabilidad del jugador de soltar su arma cuando quedan inconscientes.\nNo tiene efecto sobre la IA.</Spanish> + <Portuguese>Chance de um jogador largar sua arma quando ficar inconsciente.\nNão tem efeito sobre a IA.</Portuguese> </Key> </Package> </Project> diff --git a/addons/medical_treatment/CfgWeapons.hpp b/addons/medical_treatment/CfgWeapons.hpp index 7b31e10bee6..aae3fbb69cc 100644 --- a/addons/medical_treatment/CfgWeapons.hpp +++ b/addons/medical_treatment/CfgWeapons.hpp @@ -310,4 +310,17 @@ class CfgWeapons { hiddenSelectionsTextures[] = {QPATHTOF(data\bodybagItem_white_co.paa)}; GVAR(bodyBagObject) = "ACE_bodyBagObject_white"; }; + + // Since base game doesn't support misc. items, this is needed to filling inventories in the editor + class ACE_painkillers_Item: ACE_ItemCore { + displayName = CSTRING(painkillers_Display); + author = ECSTRING(common,ACETeam); + scope = 2; + scopeArsenal = 0; + descriptionShort = CSTRING(painkillers_Desc_Short); + picture = QPATHTOF(ui\painkillers_ca.paa); + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 1; + }; + }; }; diff --git a/addons/medical_treatment/XEH_postInit.sqf b/addons/medical_treatment/XEH_postInit.sqf index 4c7a780fc3b..eda15a4bfcf 100644 --- a/addons/medical_treatment/XEH_postInit.sqf +++ b/addons/medical_treatment/XEH_postInit.sqf @@ -1,5 +1,8 @@ #include "script_component.hpp" +// Pain killers item to magazine +["ACE_painkillers_Item", "ACE_painkillers"] call EFUNC(common,registerItemReplacement); + [QEGVAR(medical_status,initialized), { params ["_unit"]; @@ -69,6 +72,7 @@ if (["ace_trenches"] call EFUNC(common,isModLoaded)) then { LLSTRING(checkHeadstoneName), QPATHTOEF(medical_gui,ui\grave.paa), { + //IGNORE_PRIVATE_WARNING ["_target"]; [ [_target getVariable QGVAR(headstoneData)], true @@ -77,7 +81,7 @@ if (["ace_trenches"] call EFUNC(common,isModLoaded)) then { {!isNil {_target getVariable QGVAR(headstoneData)}} ] call EFUNC(interact_menu,createAction); - [missionNameSpace getVariable [QGVAR(graveClassname), "ACE_Grave"], 0, [], _checkHeadstoneAction] call EFUNC(interact_menu,addActionToClass); + [missionNamespace getVariable [QGVAR(graveClassname), "ACE_Grave"], 0, [], _checkHeadstoneAction] call EFUNC(interact_menu,addActionToClass); }; if (isServer) then { diff --git a/addons/medical_treatment/config.cpp b/addons/medical_treatment/config.cpp index 3782645019d..7b340d01091 100644 --- a/addons/medical_treatment/config.cpp +++ b/addons/medical_treatment/config.cpp @@ -12,7 +12,7 @@ class CfgPatches { class ADDON { name = COMPONENT_NAME; units[] = {"ACE_fieldDressingItem","ACE_packingBandageItem","ACE_elasticBandageItem","ACE_tourniquetItem","ACE_splintItem","ACE_painkillersItem","ACE_morphineItem","ACE_adenosineItem","ACE_epinephrineItem","ACE_plasmaIVItem","ACE_bloodIVItem","ACE_salineIVItem","ACE_quikClotItem","ACE_personalAidKitItem","ACE_surgicalKitItem","ACE_sutureItem","ACE_bodyBagItem","ACE_medicalSupplyCrate","ACE_medicalSupplyCrate_advanced"}; - weapons[] = {"ACE_fieldDressing","ACE_packingBandage","ACE_elasticBandage","ACE_tourniquet","ACE_splint","ACE_painkillers","ACE_morphine","ACE_adenosine","ACE_epinephrine","ACE_plasmaIV","ACE_plasmaIV_500","ACE_plasmaIV_250","ACE_bloodIV","ACE_bloodIV_500","ACE_bloodIV_250","ACE_salineIV","ACE_salineIV_500","ACE_salineIV_250","ACE_quikclot","ACE_personalAidKit","ACE_surgicalKit","ACE_suture","ACE_bodyBag","ACE_bodyBag_blue","ACE_bodyBag_white"}; + weapons[] = {"ACE_fieldDressing","ACE_packingBandage","ACE_elasticBandage","ACE_tourniquet","ACE_splint","ACE_painkillers","ACE_morphine","ACE_adenosine","ACE_epinephrine","ACE_plasmaIV","ACE_plasmaIV_500","ACE_plasmaIV_250","ACE_bloodIV","ACE_bloodIV_500","ACE_bloodIV_250","ACE_salineIV","ACE_salineIV_500","ACE_salineIV_250","ACE_quikclot","ACE_personalAidKit","ACE_surgicalKit","ACE_suture","ACE_bodyBag","ACE_bodyBag_blue","ACE_bodyBag_white","ACE_painkillers_Item"}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_medical_status", "ace_medical_damage", "ace_apl"}; author = ECSTRING(common,ACETeam); diff --git a/addons/medical_treatment/functions/fnc_hasItem.sqf b/addons/medical_treatment/functions/fnc_hasItem.sqf index e0ef4c8a4fe..8faea65652f 100644 --- a/addons/medical_treatment/functions/fnc_hasItem.sqf +++ b/addons/medical_treatment/functions/fnc_hasItem.sqf @@ -31,7 +31,7 @@ private _fnc_checkItems = { _unitItems append (itemCargo _unitVehicle); _unitItems append (magazineCargo _unitVehicle); }; - _items findIf {_x in _unitItems} != -1 + _items findAny _unitItems != -1 }; _medic call _fnc_checkItems || {GVAR(allowSharedEquipment) != 2 && {_patient call _fnc_checkItems}} diff --git a/addons/medical_treatment/functions/fnc_isInMedicalFacility.sqf b/addons/medical_treatment/functions/fnc_isInMedicalFacility.sqf index d04c1497bdb..dfae6782a33 100644 --- a/addons/medical_treatment/functions/fnc_isInMedicalFacility.sqf +++ b/addons/medical_treatment/functions/fnc_isInMedicalFacility.sqf @@ -18,6 +18,7 @@ #define CHECK_OBJECTS(var) ((var) findIf {typeOf _x in GVAR(facilityClasses) || {_x getVariable [QEGVAR(medical,isMedicalFacility), false]}} != -1) params ["_unit"]; +//IGNORE_PRIVATE_WARNING ["_unit"]; private _fnc_check = { private _position = _unit modelToWorldVisual [0, 0, eyePos _unit select 2]; diff --git a/addons/medical_treatment/functions/fnc_ivBagLocal.sqf b/addons/medical_treatment/functions/fnc_ivBagLocal.sqf index 80f06fc11e0..dc416f90c50 100644 --- a/addons/medical_treatment/functions/fnc_ivBagLocal.sqf +++ b/addons/medical_treatment/functions/fnc_ivBagLocal.sqf @@ -23,7 +23,7 @@ params ["_patient", "_bodyPart", "_classname"]; private _bloodVolume = GET_BLOOD_VOLUME(_patient); if (_bloodVolume >= DEFAULT_BLOOD_VOLUME) exitWith {}; -private _partIndex = ALL_BODY_PARTS find tolowerANSI _bodyPart; +private _partIndex = ALL_BODY_PARTS find toLowerANSI _bodyPart; // Get attributes for the used IV private _defaultConfig = configFile >> QUOTE(ADDON) >> "IV"; diff --git a/addons/medical_treatment/functions/fnc_medicationLocal.sqf b/addons/medical_treatment/functions/fnc_medicationLocal.sqf index 0b23b365e84..18ef4e4d680 100644 --- a/addons/medical_treatment/functions/fnc_medicationLocal.sqf +++ b/addons/medical_treatment/functions/fnc_medicationLocal.sqf @@ -49,7 +49,7 @@ TRACE_1("Running treatmentMedicationLocal with Advanced configuration for",_pati // Handle tourniquet on body part blocking blood flow at injection site -private _partIndex = ALL_BODY_PARTS find tolowerANSI _bodyPart; +private _partIndex = ALL_BODY_PARTS find toLowerANSI _bodyPart; if (HAS_TOURNIQUET_APPLIED_ON(_patient,_partIndex)) exitWith { TRACE_1("unit has tourniquets blocking blood flow on injection site",_tourniquets); diff --git a/addons/medical_treatment/functions/fnc_placeBodyBagInGrave.sqf b/addons/medical_treatment/functions/fnc_placeBodyBagInGrave.sqf index 82cd2bc080b..55908b1e17d 100644 --- a/addons/medical_treatment/functions/fnc_placeBodyBagInGrave.sqf +++ b/addons/medical_treatment/functions/fnc_placeBodyBagInGrave.sqf @@ -29,7 +29,7 @@ TRACE_2("placeBodyBagInGrave",_bodybag,_medic); if (GVAR(graveDiggingMarker)) then { _graveClassname = missionNamespace getVariable [QGVAR(graveClassname), "ACE_Grave"]; }; - private _graveRotation = missionNameSpace getVariable [QGVAR(graveRotation), 0]; + private _graveRotation = missionNamespace getVariable [QGVAR(graveRotation), 0]; [[_medic, _bodybag], _graveClassname, [0,0,0], _graveRotation, true] call FUNC(placeInBodyBagOrGrave); }, diff --git a/addons/medical_treatment/functions/fnc_placeInBodyBagOrGrave.sqf b/addons/medical_treatment/functions/fnc_placeInBodyBagOrGrave.sqf index b72d0ddda47..fb0536db54f 100644 --- a/addons/medical_treatment/functions/fnc_placeInBodyBagOrGrave.sqf +++ b/addons/medical_treatment/functions/fnc_placeInBodyBagOrGrave.sqf @@ -69,7 +69,7 @@ if (_restingPlaceClass != "") then { // Server will handle hiding and deleting the body // Keep event name as body bag only to avoid breaking things for others -["ace_placedInBodyBag", [_patient, _restingPlace, _isGrave]] call CBA_fnc_globalEvent; +["ace_placedInBodyBag", [_patient, _restingPlace, _isGrave, _medic]] call CBA_fnc_globalEvent; if (_isGrave) then { - ["ace_placedInGrave", [_patient, _restingPlace]] call CBA_fnc_globalEvent; + ["ace_placedInGrave", [_patient, _restingPlace, _medic]] call CBA_fnc_globalEvent; }; diff --git a/addons/medical_treatment/functions/fnc_placeInGrave.sqf b/addons/medical_treatment/functions/fnc_placeInGrave.sqf index 6bea5c6db96..afc6a1fe4a2 100644 --- a/addons/medical_treatment/functions/fnc_placeInGrave.sqf +++ b/addons/medical_treatment/functions/fnc_placeInGrave.sqf @@ -27,7 +27,7 @@ private _graveClassname = ""; if (GVAR(graveDiggingMarker)) then { _graveClassname = missionNamespace getVariable [QGVAR(graveClassname), "ACE_Grave"]; }; -private _graveRotation = missionNameSpace getVariable [QGVAR(graveRotation), 0]; +private _graveRotation = missionNamespace getVariable [QGVAR(graveRotation), 0]; [_this, _graveClassname, [0,0,0], _graveRotation, true] call FUNC(placeInBodyBagOrGrave) diff --git a/addons/medical_treatment/functions/fnc_splintLocal.sqf b/addons/medical_treatment/functions/fnc_splintLocal.sqf index ee15a63bf0c..4861f428cdd 100644 --- a/addons/medical_treatment/functions/fnc_splintLocal.sqf +++ b/addons/medical_treatment/functions/fnc_splintLocal.sqf @@ -20,7 +20,7 @@ params ["_medic", "_patient", "_bodyPart"]; TRACE_3("splintLocal",_medic,_patient,_bodyPart); -private _partIndex = ALL_BODY_PARTS find tolowerANSI _bodyPart; +private _partIndex = ALL_BODY_PARTS find toLowerANSI _bodyPart; private _fractures = GET_FRACTURES(_patient); _fractures set [_partIndex, -1]; diff --git a/addons/medical_treatment/functions/fnc_tourniquetLocal.sqf b/addons/medical_treatment/functions/fnc_tourniquetLocal.sqf index 9a0480bcb01..0ed8afd37c9 100644 --- a/addons/medical_treatment/functions/fnc_tourniquetLocal.sqf +++ b/addons/medical_treatment/functions/fnc_tourniquetLocal.sqf @@ -19,7 +19,7 @@ params ["_patient", "_bodyPart"]; TRACE_2("tourniquetLocal",_patient,_bodyPart); -private _partIndex = ALL_BODY_PARTS find tolowerANSI _bodyPart; +private _partIndex = ALL_BODY_PARTS find toLowerANSI _bodyPart; private _tourniquets = GET_TOURNIQUETS(_patient); _tourniquets set [_partIndex, CBA_missionTime]; diff --git a/addons/medical_treatment/functions/fnc_tourniquetRemove.sqf b/addons/medical_treatment/functions/fnc_tourniquetRemove.sqf index 8a6be10bb49..80dab5094cf 100644 --- a/addons/medical_treatment/functions/fnc_tourniquetRemove.sqf +++ b/addons/medical_treatment/functions/fnc_tourniquetRemove.sqf @@ -22,11 +22,13 @@ params ["_medic", "_patient", "_bodyPart"]; TRACE_3("tourniquetRemove",_medic,_patient,_bodyPart); // Remove tourniquet from body part, exit if no tourniquet applied -private _partIndex = ALL_BODY_PARTS find tolowerANSI _bodyPart; +private _partIndex = ALL_BODY_PARTS find toLowerANSI _bodyPart; private _tourniquets = GET_TOURNIQUETS(_patient); if (_tourniquets select _partIndex == 0) exitWith { - [LSTRING(noTourniquetOnBodyPart), 1.5] call EFUNC(common,displayTextStructured); + if (_medic == ACE_player) then { + [LSTRING(noTourniquetOnBodyPart), 1.5] call EFUNC(common,displayTextStructured); + }; }; _tourniquets set [_partIndex, 0]; @@ -39,8 +41,15 @@ TRACE_1("clearConditionCaches: tourniquetRemove",_nearPlayers); [QEGVAR(interact_menu,clearConditionCaches), [], _nearPlayers] call CBA_fnc_targetEvent; // Add tourniquet item to medic or patient -private _receiver = [_patient, _medic, _medic] select GVAR(allowSharedEquipment); -[_receiver, "ACE_tourniquet"] call EFUNC(common,addToInventory); +if (_medic call EFUNC(common,isPlayer)) then { + private _receiver = [_patient, _medic, _medic] select GVAR(allowSharedEquipment); + [_receiver, "ACE_tourniquet"] call EFUNC(common,addToInventory); +} else { + // If the medic is AI, only return tourniquet if enabled + if (missionNamespace getVariable [QEGVAR(medical_ai,requireItems), 0] > 0) then { + [_medic, "ACE_tourniquet"] call EFUNC(common,addToInventory); + }; +}; // Handle occluded medications that were blocked due to tourniquet private _occludedMedications = _patient getVariable [QEGVAR(medical,occludedMedications), []]; diff --git a/addons/medical_treatment/initSettings.inc.sqf b/addons/medical_treatment/initSettings.inc.sqf index d080965eb9e..7f0fc06764c 100644 --- a/addons/medical_treatment/initSettings.inc.sqf +++ b/addons/medical_treatment/initSettings.inc.sqf @@ -86,7 +86,9 @@ [LSTRING(ConvertItems_DisplayName), LSTRING(ConvertItems_Description)], [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], [[0, 1, 2], [ELSTRING(common,Enabled), LSTRING(ConvertItems_RemoveOnly), ELSTRING(common,Disabled)], 0], - true + 1, + {[QGVAR(convertItems), _this] call EFUNC(common,cbaSettings_settingChanged)}, + true // Needs mission restart ] call CBA_fnc_addSetting; [ diff --git a/addons/medical_treatment/stringtable.xml b/addons/medical_treatment/stringtable.xml index 383048626ab..cbe76041a0c 100644 --- a/addons/medical_treatment/stringtable.xml +++ b/addons/medical_treatment/stringtable.xml @@ -75,6 +75,7 @@ <Chinesesimp>已启用 & 可以诊断死亡/心搏骤停</Chinesesimp> <Korean>활성화 및 사망/심정지 진찰 가능</Korean> <Spanish>Habilitado y poder diagnosticar Muerte/Parada cardíaca</Spanish> + <Portuguese>Habilitado e permite diagnosticar morte/parada cardíaca</Portuguese> <Italian>Abilitato e può diagnosticare Morte/Arresto Cardiaco</Italian> </Key> <Key ID="STR_ACE_Medical_Treatment_AdvancedDiagnose_DiagnoseCardiacArrestDirect"> @@ -84,6 +85,7 @@ <Korean>활성화 및 사망/심정지 진찰 가능 [직접]</Korean> <German>Aktiviert & kann Tod/Herzstillstand diagnostizieren [Direkt]</German> <Italian>Abilitato e può diagnosticare Morte/Arresto Cardiaco [Esplicito]</Italian> + <French>Activé & peut diagnostiquer la mort/l'arrêt cardiaque [Direct].</French> </Key> <Key ID="STR_ACE_Medical_Treatment_AdvancedMedication_DisplayName"> <English>Advanced Medication</English> @@ -161,6 +163,7 @@ <Italian>Attivi e possono riaprirsi</Italian> <Chinesesimp>已启用 & 可以伤口开裂</Chinesesimp> <Korean>활성화 및 붕대 풀림 구현</Korean> + <Portuguese>Habilitado e pode reabrir</Portuguese> </Key> <Key ID="STR_ACE_Medical_Treatment_WoundReopenChance_DisplayName"> <English>Wound Reopening Coefficient</English> @@ -175,6 +178,7 @@ <Spanish>Coeficiente de reapertura de heridas</Spanish> <Chinesesimp>伤口开裂系数</Chinesesimp> <Korean>붕대 풀림 계수</Korean> + <Portuguese>Coeficiente de reabertura de feridas</Portuguese> </Key> <Key ID="STR_ACE_Medical_Treatment_WoundReopenChance_Description"> <English>Coefficient for controlling the wound reopening chance. The final reopening chance is determined by multiplying this value with the specific reopening chance for the wound type and bandage used.</English> @@ -189,6 +193,7 @@ <Spanish>Coeficiente que controla la probabilidad de reapertura de heridas. La probabilidad final de reapertura de heridas queda determinada multiplicando este valor por la probabilidad específica del tipo de herida y venda usada.</Spanish> <Chinesesimp>用于控制伤口开裂概率的系数。最终的重开放概率=该值x伤口类型x所使用的绷带的具体开裂概率。</Chinesesimp> <Korean>붕대가 풀리는 확률 계수를 정합니다. 최종 붕대 풀림 계수는 상처의 종류와 쓰인 붕대의 합의 결과에 계수를 곱한 결과입니다.</Korean> + <Portuguese>Coeficiente para controlar a chance de reabertura da ferida. A chance final de reabertura é determinada multiplicando este valor com a chance específica de reabertura para o tipo de ferida e bandagem usada.</Portuguese> </Key> <Key ID="STR_ACE_Medical_Treatment_ClearTrauma_DisplayName"> <English>Clear Trauma</English> @@ -201,6 +206,7 @@ <Chinesesimp>清理创伤</Chinesesimp> <Korean>상처 제거</Korean> <Spanish>Despejar trauma</Spanish> + <Portuguese>Remover trauma</Portuguese> </Key> <Key ID="STR_ACE_Medical_Treatment_ClearTrauma_Description"> <English>Controls when hitpoint damage from wounds is healed.</English> @@ -213,6 +219,7 @@ <Chinesesimp>控制伤口治疗后确定受伤部位的受伤情况。</Chinesesimp> <Korean>상처가 언제 제거되는 지를 결정합니다.</Korean> <Spanish>Controla cuando los puntos de daño de las heridas son curados.</Spanish> + <Portuguese>Controla quando o dano de pontos de vida de feridas é curado.</Portuguese> </Key> <Key ID="STR_ACE_Medical_Treatment_ClearTrauma_AfterBandage"> <English>After Bandage</English> @@ -225,6 +232,7 @@ <Chinesesimp>包扎后</Chinesesimp> <Korean>붕대 묶은 후</Korean> <Spanish>Después de vendado</Spanish> + <Portuguese>Após fechamento com bandagens</Portuguese> </Key> <Key ID="STR_ACE_Medical_Treatment_ClearTrauma_AfterStitch"> <English>After Stitch</English> @@ -237,6 +245,7 @@ <Chinesesimp>缝合后</Chinesesimp> <Korean>상처 봉합 후</Korean> <Spanish>Después de sutura</Spanish> + <Portuguese>Após sutura</Portuguese> </Key> <Key ID="STR_ACE_Medical_Treatment_LocationsBoostTraining_Description"> <English>Boost medical training when in medical vehicles or facilities. Untrained becomes medic, medic becomes doctor.</English> @@ -329,6 +338,7 @@ <Italian>Tempo di utilizzo dell'autoiniettore</Italian> <Chinesesimp>自动注射器治疗时间</Chinesesimp> <Korean>주사기 사용 시간</Korean> + <Portuguese>Tempo de tratamento de auto-injetores</Portuguese> </Key> <Key ID="STR_ACE_Medical_Treatment_TreatmentTimeAutoinjector_Description"> <English>Time, in seconds, required to administer medication using an autoinjector.</English> @@ -341,6 +351,7 @@ <Italian>Tempo in secondi richiesto per ricevere medicina da un autoiniettore.</Italian> <Chinesesimp>使用自动注射器给药所需的时间(秒)</Chinesesimp> <Korean>초 단위로 주사기를 사용하는데 걸리는 시간을 정합니다.</Korean> + <Portuguese>Tempo, em segundos, necessário para administrar medicações usando o auto-injetor.</Portuguese> </Key> <Key ID="STR_ACE_Medical_Treatment_TreatmentTimeTourniquet_DisplayName"> <English>Tourniquet Treatment Time</English> @@ -353,6 +364,7 @@ <Polish>Czas aplikacji stazy</Polish> <Chinesesimp>止血带治疗时间</Chinesesimp> <Korean>지혈대 사용 시간</Korean> + <Portuguese>Tempo de tratamento de torniquetes</Portuguese> </Key> <Key ID="STR_ACE_Medical_Treatment_TreatmentTimeTourniquet_Description"> <English>Time, in seconds, required to apply/remove a tourniquet.</English> @@ -365,6 +377,7 @@ <Polish>Czas w sekundach potrzebny do założenia/zdjęcia stazy.</Polish> <Chinesesimp>使用/移除止血带所需的时间(秒)</Chinesesimp> <Korean>초 단위로 지혈대를 사용/제거하는 데 걸리는 시간을 정합니다.</Korean> + <Portuguese>Tempo, em segundos, necessário para aplicar/remover um torniquete.</Portuguese> </Key> <Key ID="STR_ACE_Medical_Treatment_TreatmentTimeIV_DisplayName"> <English>IV Bag Treatment Time</English> @@ -377,6 +390,7 @@ <Polish>Czas aplikacji IV</Polish> <Chinesesimp>静脉输液袋治疗时间</Chinesesimp> <Korean>수액용기 사용 시간</Korean> + <Portuguese>Tempo de tratamento de bolsas de IV</Portuguese> </Key> <Key ID="STR_ACE_Medical_Treatment_TreatmentTimeIV_Description"> <English>Time, in seconds, required to administer an IV bag.</English> @@ -389,6 +403,7 @@ <Polish>Czas w sekundach potrzebny na aplikację transfuzji IV.</Polish> <Chinesesimp>使用静脉输液所需的时间(秒)</Chinesesimp> <Korean>초 단위로 수액용기를 사용하는 데 걸리는 시간을 정합니다.</Korean> + <Portuguese>Tempo, em segundos, necessário para administrar uma bolsa de IV.</Portuguese> </Key> <Key ID="STR_ACE_Medical_Treatment_TreatmentTimeSplint_DisplayName"> <English>Splint Treatment Time</English> @@ -401,6 +416,7 @@ <Polish>Czas aplikacji szyny</Polish> <Chinesesimp>夹板治疗时间</Chinesesimp> <Korean>부목 사용 시간</Korean> + <Portuguese>Tempo de tratamento de talas</Portuguese> </Key> <Key ID="STR_ACE_Medical_Treatment_TreatmentTimeSplint_Description"> <English>Time, in seconds, required to apply a splint.</English> @@ -413,6 +429,7 @@ <Polish>Czas w sekundach potrzebny na aplikację szyny.</Polish> <Chinesesimp>使用夹板所需的时间(秒)</Chinesesimp> <Korean>초 단위로 부목을 사용하는데 걸리는 시간을 정합니다.</Korean> + <Portuguese>Tempo, em segundos, necessário para aplicar uma talas.</Portuguese> </Key> <Key ID="STR_ACE_Medical_Treatment_TreatmentTimeBodyBag_DisplayName"> <English>Body Bag Use Time</English> @@ -425,6 +442,7 @@ <Polish>Czas użycia worka na ciało</Polish> <Chinesesimp>尸袋使用时间</Chinesesimp> <Korean>시체 운반용 부대 사용 시간</Korean> + <Portuguese>Tempo de uso de sacos de cadáver</Portuguese> </Key> <Key ID="STR_ACE_Medical_Treatment_TreatmentTimeBodyBag_Description"> <English>Time, in seconds, required to put a patient in a body bag.</English> @@ -437,6 +455,7 @@ <Polish>Czas w sekundach potrzebny na spakowanie ciała do worka na ciało.</Polish> <Chinesesimp>装入裹尸袋时间</Chinesesimp> <Korean>초 단위로 시체 운반용 부대를 사용하는데 걸리는 시간을 정합니다.</Korean> + <Portuguese>Tempo, em segundos, necessário para colocar um paciente em um saco de cadáver.</Portuguese> </Key> <Key ID="STR_ACE_Medical_Treatment_TreatmentTimeGrave_DisplayName"> <English>Grave Digging Time</English> @@ -448,6 +467,7 @@ <Japanese>墓掘りの所要時間</Japanese> <Russian>Время рытья могилы</Russian> <Spanish>Tiempo de Cavado de Tumba</Spanish> + <Portuguese>Tempo de escavação de cova</Portuguese> </Key> <Key ID="STR_ACE_Medical_Treatment_TreatmentTimeGrave_Description"> <English>Time, in seconds, required to dig a grave for a body.</English> @@ -459,6 +479,7 @@ <Japanese>遺体の墓を掘るのに掛かる時間。 (秒単位)</Japanese> <Russian>Время в секундах, необходимое для того, чтобы выкопать могилу для тела.</Russian> <Spanish>Tiempo, en segundos, requerido para cavar una tumba para un cuerpo.</Spanish> + <Portuguese>Tempo, em segundos, necessário para cavar uma cova para um corpo.</Portuguese> </Key> <Key ID="STR_ACE_Medical_Treatment_MedicEpinephrine_DisplayName"> <English>Allow Epinephrine</English> @@ -636,6 +657,7 @@ <Turkish>Kendi PAK Kullanımı</Turkish> <Spanish>Usar EPA sobre uno mismo</Spanish> <Korean>개인응급키트 자가 사용</Korean> + <Portuguese>Auto-tratamento com KPS</Portuguese> </Key> <Key ID="STR_ACE_Medical_Treatment_AllowSelfPAK_Description"> <English>Enables the use of PAKs to heal oneself.</English> @@ -651,6 +673,7 @@ <Turkish>Kendini iyileştirmek için PAK'ların kullanılmasını sağlar.</Turkish> <Spanish>Habilita el uso de EPA para curarse a uno mismo.</Spanish> <Korean>개인응급키트를 사용자 본인에게 쓸 수 있는 지를 정합니다.</Korean> + <Portuguese>Permite o uso de KPS para se tratar.</Portuguese> </Key> <Key ID="STR_ACE_Medical_Treatment_TimeCoefficientPAK_DisplayName"> <English>Time Coefficient PAK</English> @@ -815,6 +838,7 @@ <Italian>Tempo di suturazione ferita.</Italian> <Chinesesimp>伤口缝合时间</Chinesesimp> <Korean>상처 봉합 시간</Korean> + <Portuguese>Tempo de sutura de feridas</Portuguese> </Key> <Key ID="STR_ACE_Medical_Treatment_WoundStitchTime_Description"> <English>Time, in seconds, required to stitch a single wound.</English> @@ -827,6 +851,7 @@ <Italian>Tempo in secondi richiesto per suturare una singola ferita.</Italian> <Chinesesimp>缝合一个伤口所需的时间(秒)</Chinesesimp> <Korean>초 단위로, 한 상처를 봉합하는데 걸리는 시간을 설정합니다.</Korean> + <Portuguese>Tempo, em segundos, necessário para suturar uma única ferida.</Portuguese> </Key> <Key ID="STR_ACE_Medical_Treatment_AllowSelfIV_DisplayName"> <English>Self IV Transfusion</English> @@ -869,6 +894,7 @@ <Italian>Permetti di insaccare un paziente svenuto</Italian> <Chinesesimp>允许昏迷者装入尸袋</Chinesesimp> <Korean>기절 인원 시체 운반용 부대에 옮기기</Korean> + <Portuguese>Permitir inconscientes em sacos de cadáver</Portuguese> </Key> <Key ID="STR_ACE_Medical_Treatment_AllowBodyBagUnconscious_Description"> <English>Enables placing an unconscious patient in a body bag.</English> @@ -881,6 +907,7 @@ <Italian>Permette l'uso della sacca per morti anche su pazienti che sono solo svenuti (causa la morte del paziente)</Italian> <Chinesesimp>能够将昏迷的伤员装入尸袋中。</Chinesesimp> <Korean>기절 상태의 인원을 시체 운반용 부대에 옮겨 담을 수 있는 지를 정합니다.</Korean> + <Portuguese>Permite colocar um paciente inconsciente em um saco de cadáver.</Portuguese> </Key> <Key ID="STR_ACE_Medical_Treatment_AllowGraveDigging_DisplayName"> <English>Allow Grave Digging</English> @@ -892,6 +919,7 @@ <French>Autoriser le creusement de tombes</French> <Japanese>墓掘りを許可</Japanese> <Russian>Рытье могил</Russian> + <Portuguese>Permitir escavamento de cova</Portuguese> </Key> <Key ID="STR_ACE_Medical_Treatment_AllowGraveDigging_Description"> <English>Enables digging graves to dispose of corpses.</English> @@ -903,6 +931,7 @@ <French>Active la possibilité de creuser des tombes pour enterrer les cadavres.</French> <Japanese>墓を掘って死体を処理できるようになります。</Japanese> <Russian>Позволяет рыть могилы для захоронения трупов.</Russian> + <Portuguese>Permite escavar covas para se livrar de cadáveres.</Portuguese> </Key> <Key ID="STR_ACE_Medical_Treatment_AllowGraveDigging_graveOnlyDead"> <English>Only if dead</English> @@ -914,6 +943,7 @@ <French>Uniquement s'il est mort</French> <Japanese>死体のみ</Japanese> <Russian>Только если мертв</Russian> + <Portuguese>Apenas se estiver morto</Portuguese> </Key> <Key ID="STR_ACE_Medical_Treatment_GraveDiggingMarker_DisplayName"> <English>Create Grave Markers</English> @@ -925,6 +955,7 @@ <French>Créer des pierres tombales</French> <Japanese>墓標を作成</Japanese> <Russian>Надгробные знаки</Russian> + <Portuguese>Criar marcadores de covas</Portuguese> </Key> <Key ID="STR_ACE_Medical_Treatment_GraveDiggingMarker_Description"> <English>Enables the creation of grave markers when digging graves.</English> @@ -936,6 +967,7 @@ <French>Active la création de pierres tombales lors de l'enterrement de cadavres.</French> <Japanese>墓を掘った際、墓標を作成できるようにします。</Japanese> <Russian>Позволяет создавать надгробные знаки при рытье могил.</Russian> + <Portuguese>Permite a criação de marcadores de covas ao escavá-las.</Portuguese> </Key> <Key ID="STR_ACE_Medical_Treatment_MedicIV_DisplayName"> <English>Allow IV Transfusion</English> @@ -950,6 +982,7 @@ <Russian>Доступ к внутривенному переливанию</Russian> <Spanish>Permitir transfusión de IV</Spanish> <Korean>수액용기 사용 허가</Korean> + <Portuguese>Permitir transfusão IV</Portuguese> </Key> <Key ID="STR_ACE_Medical_Treatment_MedicIV_Description"> <English>Training level required to transfuse IVs.</English> @@ -964,6 +997,7 @@ <Russian>Уровень навыка, требуемый для осуществления внутривенного переливания.</Russian> <Spanish>Nivel de capacitación requerido para transfusiones de IV.</Spanish> <Korean>수액용기를 사용하는데 필요한 등급을 정합니다.</Korean> + <Portuguese>Nível de treinamento necessário para transfusões IV.</Portuguese> </Key> <Key ID="STR_ACE_Medical_Treatment_LocationIV_DisplayName"> <English>Locations IV Transfusion</English> @@ -976,6 +1010,7 @@ <Italian>Luoghi Fleboclisi EV</Italian> <Chinesesimp>静脉输液地点</Chinesesimp> <Korean>수액용기 사용 장소</Korean> + <Portuguese>Locais para transfusão IV</Portuguese> </Key> <Key ID="STR_ACE_Medical_Treatment_LocationIV_Description"> <English>Controls where IV transfusions can be performed.</English> @@ -988,6 +1023,7 @@ <Italian>Luoghi in cui è possibile applicare Fleboclisi Endovenose.</Italian> <Chinesesimp>控制何地可以静脉输液</Chinesesimp> <Korean>수액용기를 사용할 수 있는 장소를 정합니다.</Korean> + <Portuguese>Controla onde as transfusões IV podem ser realizadas.</Portuguese> </Key> <Key ID="STR_ACE_Medical_Treatment_ConvertItems_DisplayName"> <English>Convert Vanilla Items</English> @@ -1220,6 +1256,7 @@ <Chinesesimp>心肺复苏的最低成功率</Chinesesimp> <Korean>최소 심폐소생술 성공 가능성</Korean> <Spanish>RCP posibilidad mínima de resultado satisfactorio</Spanish> + <Portuguese>Probabilidade mínima de sucesso de RCP</Portuguese> </Key> <Key ID="STR_ACE_Medical_Treatment_CPRSuccessChanceMax_DisplayName"> <English>CPR Success Chance Maximum</English> @@ -1232,6 +1269,7 @@ <Chinesesimp>心肺复苏的最高成功率</Chinesesimp> <Korean>최대 심폐소생술 성공 가능성</Korean> <Spanish>RCP posibilidad máxima de resultado satisfactorio</Spanish> + <Portuguese>Probabilidade máxima de sucesso de RCP</Portuguese> </Key> <Key ID="STR_ACE_Medical_Treatment_CPRSuccessChanceMin_Description"> <English>Minimum probability that performing CPR will restore heart rhythm.\nThis minimum value is used when the patient has at least "Lost a fatal amount of blood".\nAn interpolated probability is used when the patient's blood volume is between the minimum and maximum thresholds.</English> @@ -1244,6 +1282,7 @@ <Chinesesimp>实施心肺复苏恢复心律的最小可能性。\n当伤员至少有"致命失血量"时,就取该最小值。\n当伤员的血量介于最小和最大阈值之间时,将使用插值概率。</Chinesesimp> <Korean>심폐소생술 시 제일 낮은 성공 가능성을 결정합니다.\n이 가능성은 환자가 최소 "심각한 양의 혈액을 잃음"일 때 사용됩니다.</Korean> <Spanish>Probabilidad mínima de que realizar RCP restaure el ritmo cardíaco.\n Este valor mínimo es utilizado cuando el paciente tiene al menos "Pérdida fatal de sangre".\n Una probabilidad interpolada es usada cuando el volumen de sangre del paciente está entre el umbral mínimo y máximo.</Spanish> + <Portuguese>Probabilidade mínima do RCP restaurar a frequência cardíaca.\nEste valor é usado em pacientes que "perderam uma quantidade fatal de sangue".\nValores entre quantidades extremas de sangue resultam em uma probabilidade interpolada entre a mínima e a máxima.</Portuguese> </Key> <Key ID="STR_ACE_Medical_Treatment_CPRSuccessChanceMax_Description"> <English>Maximum probability that performing CPR will restore heart rhythm.\nThis maximum value is used when the patient has at most "Lost some blood".\nAn interpolated probability is used when the patient's blood volume is between the minimum and maximum thresholds.</English> @@ -1256,6 +1295,7 @@ <Chinesesimp>实施心肺复苏恢复心律的最大可能性。\n当伤员最多“失血一些”时,就取该最大值。\n当伤员的血量介于最小和最大阈值之间时,将使用插值概率。</Chinesesimp> <Korean>심폐소생술 시 제일 높은 성공 가능성을 결정합니다.\n이 가능성은 환자가 최소 "혈액을 조금 잃음"일 때 사용됩니다.</Korean> <Spanish>Probabilidad máxima de que realizar RCP restaure el ritmo cardíaco.\n Este valor máximo es utilizado cuando el paciente tiene como mucho "Pérdida de un poco de sangre".\n Una probabilidad interpolada es usada cuando el volumen de sangre del paciente está entre el umbral mínimo y máximo.</Spanish> + <Portuguese>Probabilidade máxima do RCP restaurar a frequência cardíaca.\nEste valor é usado em pacientes que "perderam pouco sangue".\nValores entre quantidades extremas de sangue resultam em uma probabilidade interpolada entre a mínima e a máxima.</Portuguese> </Key> <Key ID="STR_ACE_Medical_Treatment_TreatmentTimeCPR_DisplayName"> <English>CPR Treatment Time</English> @@ -1268,6 +1308,7 @@ <German>HLW Behandlungsdauer</German> <Chinesesimp>心肺复苏时间</Chinesesimp> <Korean>심폐소생술 시행 시간</Korean> + <Portuguese>Duração do RCP</Portuguese> </Key> <Key ID="STR_ACE_Medical_Treatment_TreatmentTimeCPR_Description"> <English>Time, in seconds, required to perform CPR on a patient.</English> @@ -1280,6 +1321,7 @@ <German>Zeit in Sekunden, die benötigt wird, um eine HLW durzuführen.</German> <Chinesesimp>对伤员实施心肺复苏所需的时间(秒)</Chinesesimp> <Korean>초 단위로, 심폐소생술을 진행하는 시간을 결정합니다.</Korean> + <Portuguese>Tempo, em segundos, necessário para realizar RCP em um paciente.</Portuguese> </Key> <Key ID="STR_ACE_Medical_Treatment_HolsterRequired_DisplayName"> <English>Holster Required</English> @@ -1294,6 +1336,7 @@ <Russian>Необходимость убирать оружие</Russian> <Spanish>Requiere enfundar</Spanish> <Korean>무장여부</Korean> + <Portuguese>Necessário guardar armas</Portuguese> </Key> <Key ID="STR_ACE_Medical_Treatment_HolsterRequired_Description"> <English>Controls whether weapons must be holstered / lowered in order to perform medical actions.\nExcept Exam options allow examination actions (checking pulse, blood pressure, response) at all times regardless of this setting.</English> @@ -1308,6 +1351,7 @@ <Russian>Нужно ли убирать оружие для проведения медицинских действий.\nОпция «Проверка разрешена» разрешает проверять пульс, кровяное давление или реакцию независимо от этого параметра.</Russian> <Spanish>Controla si las armas deben estar enfundadas / bajadas para realizar acciones médicas. \n Excepto Las opciones de examen permiten acciones de examen (control del pulso, presión arterial, respuesta) en todo momento, independientemente de esta configuración.</Spanish> <Korean>치료하기에 앞서 손에서 무기를 집어넣을 지/내릴지를 결정합니다.\n검사제외 옵션의 경우 맥박 확인, 혈압 확인, 반응 확인은 앞선 옵션에 구애받지 않고 사용할 수 있습니다.</Korean> + <Portuguese>Controla se as armas devem ser guardadas/abaixadas para realizar ações médicas.\n"Exceto exame" faz com que ações de verificação de pulso, pressão arterial e resposta sejam permitidas a qualquer momento.</Portuguese> </Key> <Key ID="STR_ACE_Medical_Treatment_HolsterRequired_Lowered"> <English>Lowered or Holstered</English> @@ -1322,6 +1366,7 @@ <Russian>Опущено или убрано</Russian> <Spanish>Bajada o enfundada</Spanish> <Korean>내리거나 집어넣기</Korean> + <Portuguese>Abaixada ou guardada</Portuguese> </Key> <Key ID="STR_ACE_Medical_Treatment_HolsterRequired_LoweredExam"> <English>Lowered or Holstered (Except Exam)</English> @@ -1336,6 +1381,7 @@ <Russian>Опущено или убрано (Проверка разрешена)</Russian> <Spanish>Bajada o enfundada (excepto examen)</Spanish> <Korean>내리거나 집어넣기(검사 제외)</Korean> + <Portuguese>Abaixada ou guardada (exceto exame)</Portuguese> </Key> <Key ID="STR_ACE_Medical_Treatment_HolsterRequired_Holstered"> <English>Holstered Only</English> @@ -1350,6 +1396,7 @@ <Russian>Только убрано</Russian> <Spanish>Solo enfundada</Spanish> <Korean>집어넣기</Korean> + <Portuguese>Guardada apenas</Portuguese> </Key> <Key ID="STR_ACE_Medical_Treatment_HolsterRequired_HolsteredExam"> <English>Holstered Only (Except Exam)</English> @@ -1364,6 +1411,7 @@ <Russian>Только убрано (Проверка разрешена)</Russian> <Spanish>Solo enfundada (excepto examen)</Spanish> <Korean>집어넣기(검사 제외)</Korean> + <Portuguese>Guardada apenas (exceto exame)</Portuguese> </Key> <Key ID="STR_ACE_Medical_Treatment_medicalSupplyCrate"> <English>[ACE] Medical Supply Crate (Basic)</English> @@ -1376,7 +1424,7 @@ <French>[ACE] Caisse médicale (basique)</French> <Hungarian>[ACE] Orvosi láda (Alap)</Hungarian> <Italian>[ACE] Cassa Rifornimenti Medici (Basici)</Italian> - <Japanese>[ACE] 医療物資箱 (ベーシック)</Japanese> + <Japanese>[ACE] 医療物資箱 (基本)</Japanese> <Korean>[ACE] 의료 물자 (기본)</Korean> <Chinesesimp>[ACE] 医疗补给箱(基础)</Chinesesimp> <Chinese>[ACE] 醫療補給箱(基本)</Chinese> @@ -1393,7 +1441,7 @@ <French>[ACE] Caisse médicale (avancée)</French> <Hungarian>[ACE] Orvosi láda (Fejlett)</Hungarian> <Italian>[ACE] Cassa Rifornimenti Medici (Avanzati)</Italian> - <Japanese>[ACE] 医療物資箱 (アドバンスド)</Japanese> + <Japanese>[ACE] 医療物資箱 (高度)</Japanese> <Korean>[ACE] 의료 물자 (고급)</Korean> <Chinesesimp>[ACE] 医疗补给箱(高级)</Chinesesimp> <Chinese>[ACE] 醫療補給箱(進階)</Chinese> @@ -1827,7 +1875,7 @@ <Czech>Auto-morfin</Czech> <Hungarian>Morfium autoinjektor</Hungarian> <Italian>Autoiniettore di Morfina</Italian> - <Portuguese>Auto-injetor de morfina</Portuguese> + <Portuguese>Autoinjetor de Morfina</Portuguese> <Japanese>モルヒネ自動注射器</Japanese> <Korean>자동주사기 (모르핀)</Korean> <Chinesesimp>吗啡自动注射器</Chinesesimp> @@ -1874,7 +1922,7 @@ <French>Auto-injecteur d'adénosine</French> <Italian>Autoiniettore di Adenosina</Italian> <Czech>Auto-adenosine</Czech> - <Portuguese>Auto-injetor de Adenosina</Portuguese> + <Portuguese>Autoinjetor de Adenosina</Portuguese> <Russian>Аденозин в пневмошприце</Russian> <Japanese>アデノシン自動注射器</Japanese> <Korean>자동주사기 (아데노신)</Korean> @@ -1922,7 +1970,7 @@ <Czech>Auto-atropine</Czech> <Hungarian>Atropin autoinjektor</Hungarian> <Italian>Autoiniettore di Atropina</Italian> - <Portuguese>Auto-injetor de Atropina</Portuguese> + <Portuguese>Autoinjetor de Atropina</Portuguese> <Japanese>アトロピン自動注射器</Japanese> <Korean>자동주사기 (아트로핀)</Korean> <Chinesesimp>阿托品自动注射器</Chinesesimp> @@ -1971,7 +2019,7 @@ <Czech>Auto-adrenalin</Czech> <Hungarian>Epinefrin autoinjektor</Hungarian> <Italian>Autoiniettore di Epinefrina</Italian> - <Portuguese>Auto-injetor de epinefrina</Portuguese> + <Portuguese>Autoinjetor de Epinefrina</Portuguese> <Japanese>アドレナリン自動注射器</Japanese> <Korean>자동주사기 (에피네프린)</Korean> <Chinesesimp>肾上腺素自动注射器</Chinesesimp> @@ -2385,7 +2433,7 @@ <German>Operationsset</German> <Hungarian>Sebészeti készlet</Hungarian> <Italian>Kit chirurgico</Italian> - <Portuguese>Kit Cirurgico</Portuguese> + <Portuguese>Kit Cirúrgico</Portuguese> <Czech>Chirurgická sada</Czech> <Japanese>手術キット</Japanese> <Korean>봉합 키트</Korean> @@ -2402,7 +2450,7 @@ <German>Operationsset für fortgeschrittene medizinische Feldversorgung</German> <Hungarian>Sebészeti készlet komplex orvosi feladatok terepen való ellátására</Hungarian> <Italian>Kit chirurgico per trattamenti avanzati sul campo.</Italian> - <Portuguese>Kit Cirurgico para uso de tratamento médico avançado em campo</Portuguese> + <Portuguese>Kit Cirúrgico para uso de tratamento médico avançado em campo</Portuguese> <Czech>Chirurgická sada určená k pokročilejším zdravotnickým zákrokům v poli</Czech> <Japanese>手術キットは戦場で高度な処置をする為に用いる</Japanese> <Korean>야전 상황에서 고급 의료 처치를 위해 사용되는 봉합 키트</Korean> @@ -2419,7 +2467,7 @@ <French>Trousse chirurgicale pour le traitement avancé sur le terrain.</French> <Hungarian>Sebészeti készlet komplex orvosi feladatok terepen való ellátására</Hungarian> <Italian>Kit chirurgico per trattamenti avanzati sul campo.</Italian> - <Portuguese>Kit Cirurgico para uso de tratamento médico avançado em campo.</Portuguese> + <Portuguese>Kit Cirúrgico para uso de tratamento médico avançado em campo.</Portuguese> <Czech>Chirurgická sada určená k pokročilejším zdravotnickým zákrokům v poli</Czech> <Japanese>手術キットは戦場で高度な処置をする為に用いる</Japanese> <Korean>야전 상황에서 고급 의료 처치를 위해 사용되는 봉합 키트</Korean> @@ -2454,6 +2502,7 @@ <Korean>봉합술</Korean> <French>Suture</French> <Russian>Нить</Russian> + <Portuguese>Sutura</Portuguese> </Key> <Key ID="STR_ACE_Medical_Treatment_Suture_Desc_Short"> <English>Surgical Suture for stitching injuries.</English> @@ -2465,6 +2514,7 @@ <Korean>상처를 꿰메는 수술용 봉합술.</Korean> <French>Suture chirurgicale pour suturer les blessures.</French> <Russian>Хирургическая нить для зашивания травм.</Russian> + <Portuguese>Sutura cirúrgica para fechar feridas.</Portuguese> </Key> <Key ID="STR_ACE_Medical_Treatment_Suture_Desc_Use"> <English>Surgical Suture for stitching injuries.</English> @@ -2476,6 +2526,7 @@ <Korean>상처를 꿰메는 수술용 봉합술.</Korean> <French>Suture chirurgicale pour suturer les blessures.</French> <Russian>Хирургическая нить для зашивания травм.</Russian> + <Portuguese>Sutura cirúrgica para fechar feridas.</Portuguese> </Key> <Key ID="STR_ACE_Medical_Treatment_Bodybag_Display"> <English>Bodybag</English> @@ -4147,7 +4198,7 @@ <Key ID="STR_ACE_Medical_Treatment_Check_Response_Unresponsive"> <English>%1 is not responsive</English> <Russian>%1 не реагирует на раздражители</Russian> - <French>%1 est inconscient.</French> + <French>%1 ne répond pas aux stimuli</French> <Spanish>%1 no reacciona</Spanish> <Polish>%1 jest nieprzytomny</Polish> <German>%1 ist nicht ansprechbar</German> @@ -4168,6 +4219,7 @@ <Korean>%1은(는) 의식불명입니다</Korean> <German>%1 ist bewusstlos</German> <Italian>%1 è privo di sensi</Italian> + <French>%1 est inconscient</French> </Key> <Key ID="STR_ACE_Medical_Treatment_Check_Response_CardiacArrest"> <English>%1 is not responsive, taking shallow gasps and convulsing</English> @@ -4180,6 +4232,7 @@ <Korean>%1 은 반응이 없고, 얕은 헐떡임과 경련증세를 보입니다</Korean> <Russian>%1 не реагирует на раздражители, поверхностно дышит, в конвульсиях</Russian> <Spanish>%1 no responde, dando pequeñas bocanadas y convulsionando</Spanish> + <Portuguese>%1 está inconsciente, com respiração curta e convulsionando</Portuguese> </Key> <Key ID="STR_ACE_Medical_Treatment_Check_Response_CardiacArrestDirect"> <English>%1 is in cardiac arrest</English> @@ -4188,6 +4241,7 @@ <Korean>%1은(는) 심정지 상태입니다</Korean> <German>%1 ist im Herzstillstand</German> <Italian>%1 è in arresto cardiaco</Italian> + <French>%1 est en arrêt cardiaque</French> </Key> <Key ID="STR_ACE_Medical_Treatment_Check_Response_Dead"> <English>%1 is not responsive, motionless and cold</English> @@ -4200,6 +4254,7 @@ <Korean>%1 은 반응이 없고, 움직임이 없으며 차갑습니다</Korean> <Russian>%1 не реагирует на раздражители, не шевелится и холодный</Russian> <Spanish>%1 no responde, sin movimiento y frío</Spanish> + <Portuguese>%1 está inconsciente, sem movimento e frio</Portuguese> </Key> <Key ID="STR_ACE_Medical_Treatment_Check_Response_DeadDirect"> <English>%1 is dead</English> @@ -4208,6 +4263,7 @@ <Korean>%1은(는) 사망했습니다</Korean> <German>%1 ist tod</German> <Italian>%1 è morto</Italian> + <French>%1 est mort</French> </Key> <Key ID="STR_ACE_Medical_Treatment_Check_Response_You_Checked"> <English>You checked %1</English> @@ -4694,6 +4750,7 @@ <Japanese>墓を掘る</Japanese> <Russian>Выкопать могилу для тела</Russian> <Spanish>Cavar tumba para cuerpo</Spanish> + <Portuguese>Escavar cova para cadáver</Portuguese> </Key> <Key ID="STR_ACE_Medical_Treatment_DiggingGrave"> <English>Digging grave for body...</English> @@ -4705,6 +4762,7 @@ <Japanese>墓を掘っています</Japanese> <Russian>Рытьё могилы для тела...</Russian> <Spanish>Cavando tumba para cuerpo...</Spanish> + <Portuguese>Escavando cova para cadáver...</Portuguese> </Key> <Key ID="STR_ACE_Medical_Treatment_Activity_bandagedPatient"> <English>%1 has bandaged patient</English> @@ -4947,6 +5005,7 @@ <German>Der Körper zuckte und kann nicht tot sein!</German> <Chinesesimp>身体抽搐了一下,可能还没死!</Chinesesimp> <Korean>꿈틀대는걸 보니 죽은 것 같지는 않습니다!</Korean> + <Portuguese>O corpo se retorceu e pode não estar morto!</Portuguese> </Key> <Key ID="STR_ACE_Medical_Treatment_checkHeadstoneName"> <English>Check name on headstone</English> @@ -4958,6 +5017,7 @@ <Japanese>墓石の名前を確認</Japanese> <Russian>Проверьте имя на надгробии</Russian> <Spanish>Comprobar nombre en la lápida</Spanish> + <Portuguese>Checar nome na lápide</Portuguese> </Key> <Key ID="STR_ACE_Medical_Treatment_bandageRollover_DisplayName"> <English>Bandage Rollover</English> @@ -4969,6 +5029,7 @@ <Japanese>包帯の繰り越し</Japanese> <Russian>Перевязка множественных ран</Russian> <Spanish>Vendaje múltiple</Spanish> + <Portuguese>Bandagem de Múltiplas Feridas</Portuguese> </Key> <Key ID="STR_ACE_Medical_Treatment_bandageRollover_Description"> <English>If enabled, bandages can close different types of wounds on the same body part.\nBandaging multiple injuries will scale bandaging time accordingly.</English> @@ -4980,6 +5041,7 @@ <Japanese>有効にすると、体の同じ部分にある別の種類の傷を一つの包帯で閉じることができます。\n複数の傷に包帯を巻くと、それに応じて包帯時間が変動します。</Japanese> <Russian>Если эта функция включена, бинты могут закрывать различные типы ран на одной и той же части тела.\nПри перевязке нескольких повреждений время перевязки будет увеличено соответствующим образом.</Russian> <Spanish>Si se habilita, las vendas pueden cerrar diferentes tipos de heridas en la misma parte del cuerpo.n\Vendar múltiples heridas escala el tiempo de vendado acorde.</Spanish> + <Portuguese>Se habilitado, bandagens podem fechar diferentes tipos de ferimento na mesma parte do corpo.\nO fechamento de múltiplas feridas modificará o tempo de aplicação proporcionalmente.</Portuguese> </Key> <Key ID="STR_ACE_Medical_Treatment_bandageEffectiveness_DisplayName"> <English>Bandage Effectiveness Coefficient</English> @@ -4991,6 +5053,7 @@ <Japanese>包帯有効性係数</Japanese> <Russian>Коэф. эффективности повязки</Russian> <Spanish>Coeficiente de Efectividad de Vendado</Spanish> + <Portuguese>Coeficiente de Eficácia da Bandagem</Portuguese> </Key> <Key ID="STR_ACE_Medical_Treatment_bandageEffectiveness_Description"> <English>Determines how effective bandages are at closing wounds.</English> @@ -5002,6 +5065,7 @@ <Japanese>包帯が傷をふさぐのにどれだけ効果的かを定義します。</Japanese> <Russian>Определяет, насколько эффективны бинты при закрытии ран.</Russian> <Spanish>Determina como de efectivos son los vendajes cerrando heridas.</Spanish> + <Portuguese>Determina o quão efetivas as bandagens são em fechar ferimentos.</Portuguese> </Key> <Key ID="STR_ACE_Medical_Treatment_medicalTab"> <English>Medical Items</English> @@ -5016,6 +5080,7 @@ <German>Medizinisches Material</German> <Japanese>医療品</Japanese> <Spanish>Objetos médicos</Spanish> + <Portuguese>Objetos médicos</Portuguese> </Key> <Key ID="STR_ACE_Medical_Treatment_TreatmentTimeCoeffZeus_DisplayName"> <English>Zeus Treatment Time Coefficient</English> diff --git a/addons/medical_vitals/functions/fnc_handleUnitVitals.sqf b/addons/medical_vitals/functions/fnc_handleUnitVitals.sqf index c284b00701d..77aec7fd621 100644 --- a/addons/medical_vitals/functions/fnc_handleUnitVitals.sqf +++ b/addons/medical_vitals/functions/fnc_handleUnitVitals.sqf @@ -85,17 +85,17 @@ if (_adjustments isNotEqualTo []) then { private _timeInSystem = CBA_missionTime - _timeAdded; if (_timeInSystem >= _maxTimeInSystem) then { _deleted = true; - _adjustments set [_forEachIndex, objNull]; + _adjustments deleteAt _forEachIndex; } else { private _effectRatio = (((_timeInSystem / _timeTillMaxEffect) ^ 2) min 1) * (_maxTimeInSystem - _timeInSystem) / _maxTimeInSystem; if (_hrAdjust != 0) then { _hrTargetAdjustment = _hrTargetAdjustment + _hrAdjust * _effectRatio; }; if (_painAdjust != 0) then { _painSupressAdjustment = _painSupressAdjustment + _painAdjust * _effectRatio; }; if (_flowAdjust != 0) then { _peripheralResistanceAdjustment = _peripheralResistanceAdjustment + _flowAdjust * _effectRatio; }; }; - } forEach _adjustments; + } forEachReversed _adjustments; if (_deleted) then { - _unit setVariable [VAR_MEDICATIONS, _adjustments - [objNull], true]; + _unit setVariable [VAR_MEDICATIONS, _adjustments, true]; _syncValues = true; }; }; diff --git a/addons/medical_vitals/functions/fnc_updatePeripheralResistance.sqf b/addons/medical_vitals/functions/fnc_updatePeripheralResistance.sqf index 30f8038d80f..05056fa0a33 100644 --- a/addons/medical_vitals/functions/fnc_updatePeripheralResistance.sqf +++ b/addons/medical_vitals/functions/fnc_updatePeripheralResistance.sqf @@ -20,4 +20,4 @@ params ["_unit", "_peripheralResistanceAdjustment", "_deltaT", "_syncValue"]; -_unit setVariable [VAR_PERIPH_RES, 0 max (DEFAULT_PERIPH_RES + _peripheralResistanceAdjustment), _syncValue]; +_unit setVariable [VAR_PERIPH_RES, 1 max (DEFAULT_PERIPH_RES + _peripheralResistanceAdjustment), _syncValue]; diff --git a/addons/medical_vitals/stringtable.xml b/addons/medical_vitals/stringtable.xml index 2fe7336dc08..25b278732ea 100644 --- a/addons/medical_vitals/stringtable.xml +++ b/addons/medical_vitals/stringtable.xml @@ -21,6 +21,7 @@ <French>Activer la simulation de la SpO2</French> <German>SpO2-Simulation aktivieren</German> <Spanish>Habilitar Simulación SpO2</Spanish> + <Portuguese>Habilitar simulação de SpO2</Portuguese> </Key> <Key ID="STR_ACE_Medical_Vitals_simulateSpO2_Description"> <English>Enables oxygen saturation simulation, providing variable heart rate and oxygen demand based on physical activity and altitude. Required for Airway Management.</English> @@ -31,6 +32,7 @@ <French>Permet de simuler la saturation en oxygène, de modifier la fréquence cardiaque et la consommation d'oxygène en fonction de l'activité physique et de l'altitude. Nécessaire pour la gestion des voies respiratoires.</French> <German>Aktiviert die Simulation der Sauerstoffsättigung und bietet variable Herzfrequenz und Sauerstoffbedarf basierend auf körperlicher Aktivität und Geländehöhe. Erforderlich für das Atemwegsmanagement.</German> <Spanish>Habilita la saturación de oxígeno, utilizando la demanda de oxígeno y ritmo cardíaco basado en la actividad física y la altitud. Requerido para el Manejo de las Vías Aéreas.</Spanish> + <Portuguese>Habilita a saturação de oxigênio, tornando variáveis o batimento cardíaco e demanda de oxigênio baseados em atividade física e altitude. Necessário para o gerenciamento de vias aéreas.</Portuguese> </Key> </Package> </Project> diff --git a/addons/metis/CfgAmmo.hpp b/addons/metis/CfgAmmo.hpp index 1f613a36b18..4a6fe513d23 100644 --- a/addons/metis/CfgAmmo.hpp +++ b/addons/metis/CfgAmmo.hpp @@ -1,3 +1,4 @@ +class ace_missileguidance_type_Metis; class CfgAmmo { class M_Vorona_HEAT; class GVAR(HEAT): M_Vorona_HEAT { @@ -7,35 +8,8 @@ class CfgAmmo { airLock = 0; lockType = 0; - class ace_missileguidance { + class ace_missileguidance: ace_missileguidance_type_Metis { enabled = 1; - - minDeflection = 0; // Minium flap deflection for guidance - maxDeflection = 0.0027; // Maximum flap deflection for guidance - incDeflection = 0.0005; // The incrmeent in which deflection adjusts. - - canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode - - // Guidance type for munitions - defaultSeekerType = "SACLOS"; - seekerTypes[] = { "SACLOS" }; - - defaultSeekerLockMode = "LOAL"; - seekerLockModes[] = { "LOAL", "LOBL" }; - - seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] - seekerAngle = 15; // Angle from the shooter's view that can track the missile - seekerAccuracy = 1; // seeker accuracy multiplier - - seekerMinRange = 80; - seekerMaxRange = 2000; // Range from the missile which the seeker can visually search - - correctionDistance = 3; // distance from center of crosshair where missile slows down - offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. - - // Attack profile type selection - defaultAttackProfile = "WIRE"; - attackProfiles[] = {"WIRE"}; }; }; @@ -47,35 +21,8 @@ class CfgAmmo { airLock = 0; lockType = 0; - class ace_missileguidance { + class ace_missileguidance: ace_missileguidance_type_Metis { enabled = 1; - - minDeflection = 0; // Minium flap deflection for guidance - maxDeflection = 0.0027; // Maximum flap deflection for guidance - incDeflection = 0.0005; // The incrmeent in which deflection adjusts. - - canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode - - // Guidance type for munitions - defaultSeekerType = "SACLOS"; - seekerTypes[] = { "SACLOS" }; - - defaultSeekerLockMode = "LOAL"; - seekerLockModes[] = { "LOAL", "LOBL" }; - - seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] - seekerAngle = 15; // Angle from the shooter's view that can track the missile - seekerAccuracy = 1; // seeker accuracy multiplier - - seekerMinRange = 80; - seekerMaxRange = 2000; // Range from the missile which the seeker can visually search - - correctionDistance = 3; // distance from center of crosshair where missile slows down - offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. - - // Attack profile type selection - defaultAttackProfile = "WIRE"; - attackProfiles[] = {"WIRE"}; }; }; }; diff --git a/addons/microdagr/CfgUIGrids.hpp b/addons/microdagr/CfgUIGrids.hpp index 5d7b921800a..3c5379f879d 100644 --- a/addons/microdagr/CfgUIGrids.hpp +++ b/addons/microdagr/CfgUIGrids.hpp @@ -3,7 +3,7 @@ class CfgUIGrids { class Presets { class Arma3 { class Variables { - grid_ACE_microDagr[] = {{"(safezoneX + safezoneW - 11 * (((safezoneW / safezoneH) min 1.2) / 40))","(safezoneY + safezoneH - 15 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25))","(10 * (((safezoneW / safezoneH) min 1.2) / 40))","(10 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25))"},"(((safezoneW / safezoneH) min 1.2) / 40)","((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"}; + grid_ACE_microDagr[] = {{"(safeZoneX + safeZoneW - 11 * (((safeZoneW / safeZoneH) min 1.2) / 40))","(safeZoneY + safeZoneH - 15 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25))","(10 * (((safeZoneW / safeZoneH) min 1.2) / 40))","(10 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25))"},"(((safeZoneW / safeZoneH) min 1.2) / 40)","((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"}; }; }; }; diff --git a/addons/microdagr/functions/fnc_showApplicationPage.sqf b/addons/microdagr/functions/fnc_showApplicationPage.sqf index 75f817ad3f3..daa5edd28a5 100644 --- a/addons/microdagr/functions/fnc_showApplicationPage.sqf +++ b/addons/microdagr/functions/fnc_showApplicationPage.sqf @@ -57,8 +57,8 @@ if (GVAR(currentApplicationPage) == APP_MODE_INFODISPLAY) then { (_display displayCtrl IDC_MAPDETAILS) ctrlShow ((GVAR(currentApplicationPage) == APP_MODE_MAP) && {GVAR(mapShowTexture)}); if (GVAR(currentApplicationPage) == APP_MODE_MAP) then { - _theMap = if (!GVAR(mapShowTexture)) then {_display displayCtrl IDC_MAPPLAIN} else {_display displayCtrl IDC_MAPDETAILS}; - _mapSize = (ctrlPosition _theMap) select 3; + private _theMap = if (GVAR(mapShowTexture)) then {_display displayCtrl IDC_MAPDETAILS} else {_display displayCtrl IDC_MAPPLAIN}; + private _mapSize = (ctrlPosition _theMap) select 3; _theMap ctrlMapAnimAdd [0, (GVAR(mapZoom) / _mapSize), GVAR(mapPosition)]; ctrlMapAnimCommit _theMap; if (GVAR(mapAutoTrackPosition)) then { diff --git a/addons/microdagr/functions/fnc_updateDisplay.sqf b/addons/microdagr/functions/fnc_updateDisplay.sqf index 3e5775b86dc..e5de2b2fe49 100644 --- a/addons/microdagr/functions/fnc_updateDisplay.sqf +++ b/addons/microdagr/functions/fnc_updateDisplay.sqf @@ -24,7 +24,7 @@ if (isNull _display) exitWith {ERROR("No Display");}; private _daylight = [] call EFUNC(common,ambientBrightness); (_display displayCtrl IDC_MICRODAGRSHELL) ctrlSetTextColor [_daylight, _daylight, _daylight, 1]; -(_display displayCtrl IDC_CLOCKTEXT) ctrlSetText ([daytime, "HH:MM"] call bis_fnc_timeToString); +(_display displayCtrl IDC_CLOCKTEXT) ctrlSetText ([dayTime, "HH:MM"] call bis_fnc_timeToString); private _waypoints = [] call FUNC(deviceGetWaypoints); @@ -61,7 +61,7 @@ case (APP_MODE_INFODISPLAY): { private _dayString = if ((date select 2) < 10) then {"0" + str (date select 2)} else {str (date select 2)}; (_display displayCtrl IDC_MODEDISPLAY_TIMEDISPLAYGREEN1) ctrlSetText format ["%1-%2-%3", _yearString, _monthSring, _dayString]; //"18-Feb-2010"; - (_display displayCtrl IDC_MODEDISPLAY_TIMEDISPLAYGREEN2) ctrlSetText ([daytime, "HH:MM:SS"] call bis_fnc_timeToString); + (_display displayCtrl IDC_MODEDISPLAY_TIMEDISPLAYGREEN2) ctrlSetText ([dayTime, "HH:MM:SS"] call bis_fnc_timeToString); } else { private _targetPosName = ""; private _targetPosLocationASL = []; diff --git a/addons/microdagr/gui.hpp b/addons/microdagr/gui.hpp index 1404f6b81db..2a3f52deb43 100644 --- a/addons/microdagr/gui.hpp +++ b/addons/microdagr/gui.hpp @@ -40,8 +40,8 @@ class GVAR(RscText): RscText { }; //Redfine Scaling for the Dialog -#define X_PART(num) QUOTE((((60 - 25)/2) + (num)) * (safeZoneH / 64) + (safezoneX + (safezoneW - safeZoneH)/2)) -#define Y_PART(num) QUOTE((0 + (num)) * (safeZoneH / 36) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)) +#define X_PART(num) QUOTE((((60 - 25)/2) + (num)) * (safeZoneH / 64) + (safeZoneX + (safeZoneW - safeZoneH)/2)) +#define Y_PART(num) QUOTE((0 + (num)) * (safeZoneH / 36) + (safeZoneY + (safeZoneH - (safeZoneH / 1.2))/2)) #define W_PART(num) QUOTE((num) * (safeZoneH / 64)) #define H_PART(num) QUOTE((num) * (safeZoneH / 36)) diff --git a/addons/microdagr/stringtable.xml b/addons/microdagr/stringtable.xml index c9bd546afce..79b66e18ebb 100644 --- a/addons/microdagr/stringtable.xml +++ b/addons/microdagr/stringtable.xml @@ -29,7 +29,7 @@ <Hungarian>MicroDAGR fejlett GPS vevőegység</Hungarian> <Italian>Ricevitore GPS avanzato MicroDAGR</Italian> <Portuguese>Receptor GPS avançado MicroDAGR</Portuguese> - <Japanese>MicroDAGRは改良された高度なGPS受信機です</Japanese> + <Japanese>MicroDAGRは高機能なGPS受信機です</Japanese> <Korean>마이크로DAGR 고급 위성항법 수신기</Korean> <Chinesesimp>微型军用高级防御 GPS 接收器</Chinesesimp> <Chinese>微型軍用高級防禦GPS接收器</Chinese> @@ -605,6 +605,7 @@ <Polish>MicroDAGR - Poprzedni Tryb</Polish> <Chinesesimp>微型 GPS 接收器—上一个模式</Chinesesimp> <Korean>마이크로DAGR - 이전 모드</Korean> + <Portuguese>MicroDAGR - Modo Anterior</Portuguese> </Key> <Key ID="STR_ACE_MicroDAGR_nextMode"> <English>MicroDAGR - Next Mode</English> @@ -617,6 +618,7 @@ <Polish>MicroDAGR - Kolejny Tryb</Polish> <Chinesesimp>微型 GPS 接收器—下一个模式</Chinesesimp> <Korean>마이크로DAGR - 다음 모드</Korean> + <Portuguese>MicroDAGR - Modo Seguinte</Portuguese> </Key> </Package> </Project> diff --git a/addons/minedetector/XEH_postInit.sqf b/addons/minedetector/XEH_postInit.sqf index f5f5de0ca8a..0671699f9e8 100644 --- a/addons/minedetector/XEH_postInit.sqf +++ b/addons/minedetector/XEH_postInit.sqf @@ -16,9 +16,9 @@ addMissionEventHandler ["Draw3D", { { private _name = format ["%1@%2", typeOf _x, (floor ((_x distance _detectorPointAGL) * 10)) / 10]; if ((getNumber (configOf _x >> QGVAR(detectable))) == 1) then { - drawIcon3D ["\A3\ui_f\data\map\markers\military\dot_CA.paa", [1,0,0,1], (ASLtoAGL (getPosASL _x)), 1, 1, 0, _name, 1, 0.02, "PuristaMedium"]; + drawIcon3D ["\A3\ui_f\data\map\markers\military\dot_CA.paa", [1,0,0,1], (ASLToAGL (getPosASL _x)), 1, 1, 0, _name, 1, 0.02, "PuristaMedium"]; } else { - drawIcon3D ["\A3\ui_f\data\map\markers\military\dot_CA.paa", [1,1,0,1], (ASLtoAGL (getPosASL _x)), 1, 1, 0, _name, 1, 0.02, "PuristaMedium"]; + drawIcon3D ["\A3\ui_f\data\map\markers\military\dot_CA.paa", [1,1,0,1], (ASLToAGL (getPosASL _x)), 1, 1, 0, _name, 1, 0.02, "PuristaMedium"]; }; } forEach _mines; }]; diff --git a/addons/missile_gbu/$PBOPREFIX$ b/addons/missile_gbu/$PBOPREFIX$ new file mode 100644 index 00000000000..3249d48864f --- /dev/null +++ b/addons/missile_gbu/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\missile_gbu \ No newline at end of file diff --git a/addons/missile_gbu/CfgAmmo.hpp b/addons/missile_gbu/CfgAmmo.hpp new file mode 100644 index 00000000000..9521c8566d1 --- /dev/null +++ b/addons/missile_gbu/CfgAmmo.hpp @@ -0,0 +1,22 @@ +class EGVAR(missileguidance,type_Paveway); +class EGVAR(missileguidance,type_KAB); +class CfgAmmo { + class Bo_GBU12_LGB; + class GVAR(12): Bo_GBU12_LGB { + maneuvrability = 0; // no maneuvrability so that default guidance doesnt work + airFriction = 0.25; // bombs have high drag who woulda thunk + class ace_missileguidance: EGVAR(missileguidance,type_Paveway) { + enabled = 1; + }; + }; + + class Bomb_03_F; + class GVAR(FAB250): Bomb_03_F { + maneuvrability = 0; // no maneuvrability so that default guidance doesnt work + airFriction = 0.25; // bombs have high drag who woulda thunk + class ace_missileguidance: EGVAR(missileguidance,type_KAB) { + enabled = 1; + }; + }; +}; + diff --git a/addons/missile_gbu/CfgMagazines.hpp b/addons/missile_gbu/CfgMagazines.hpp new file mode 100644 index 00000000000..2841a3006eb --- /dev/null +++ b/addons/missile_gbu/CfgMagazines.hpp @@ -0,0 +1,87 @@ +class CfgMagazines { + class 2Rnd_GBU12_LGB; + // GBU + class GVAR(2Rnd_12): 2Rnd_GBU12_LGB { + displayName = CSTRING(12_2x); + author = "Dani (TCVM)"; + ammo = QGVAR(12); + }; + + class 4Rnd_Bomb_04_F; + class GVAR(4Rnd_GBU12): 4Rnd_Bomb_04_F { + displayName = CSTRING(12_4x); + author = "Dani (TCVM)"; + ammo = QGVAR(12); + }; + + class magazine_Bomb_GBU12_x1; + class GVAR(gbu12): magazine_Bomb_GBU12_x1 { + displayName = CSTRING(12_1x); + author = "Dani (TCVM)"; + ammo = QGVAR(12); + }; + + class PylonMissile_1Rnd_Bomb_04_F; + class GVAR(1_PylonMissile_1Rnd_12): PylonMissile_1Rnd_Bomb_04_F { + displayName = CSTRING(12_1x); + author = "Dani (TCVM)"; + ammo = QGVAR(12); + pylonWeapon = QGVAR(12); + }; + + class 2Rnd_GBU12_LGB_MI10; + class GVAR(2Rnd_GBU12_LGB_MI10): 2Rnd_GBU12_LGB_MI10 { + displayName = CSTRING(12_2x); + author = "Dani (TCVM)"; + ammo = QGVAR(12); + pylonWeapon = QGVAR(12); + }; + + class PylonMissile_Bomb_GBU12_x1; + class GVAR(PylonMissile_Bomb_GBU12_x1): PylonMissile_Bomb_GBU12_x1 { + displayName = CSTRING(12_1x); + author = "Dani (TCVM)"; + ammo = QGVAR(12); + pylonWeapon = QGVAR(12); + }; + + class PylonRack_Bomb_GBU12_x2; + class GVAR(PylonRack_Bomb_GBU12_x2): PylonRack_Bomb_GBU12_x2 { + displayName = CSTRING(12_2x); + author = "Dani (TCVM)"; + ammo = QGVAR(12); + pylonWeapon = QGVAR(12); + }; + + // KAB + class magazine_Bomb_KAB250_x1; + class GVAR(1Rnd_FAB250): magazine_Bomb_KAB250_x1 { + displayName = CSTRING(fab250_1x); + author = "Dani (TCVM)"; + ammo = QGVAR(FAB250); + }; + + class PylonMissile_Bomb_KAB250_x1; + class GVAR(1_PylonMissile_1Rnd_FAB250): PylonMissile_Bomb_KAB250_x1 { + displayName = CSTRING(fab250_1x); + author = "Dani (TCVM)"; + ammo = QGVAR(FAB250); + pylonWeapon = QGVAR(FAB250); + }; + + class 2Rnd_Bomb_03_F; + class GVAR(2Rnd_FAB250): 2Rnd_Bomb_03_F { + displayName = CSTRING(fab250_2x); + author = "Dani (TCVM)"; + ammo = QGVAR(FAB250); + }; + + class PylonMissile_1Rnd_Bomb_03_F; + class GVAR(PylonMissile_1Rnd_FAB250): PylonMissile_1Rnd_Bomb_03_F { + displayName = CSTRING(fab250_1x); + author = "Dani (TCVM)"; + ammo = QGVAR(FAB250); + pylonWeapon = QGVAR(FAB250); + }; +}; + diff --git a/addons/missile_gbu/CfgWeapons.hpp b/addons/missile_gbu/CfgWeapons.hpp new file mode 100644 index 00000000000..0728f93f7c2 --- /dev/null +++ b/addons/missile_gbu/CfgWeapons.hpp @@ -0,0 +1,32 @@ +class CfgWeapons { + class weapon_LGBLauncherBase; + class GVAR(12): weapon_LGBLauncherBase { + displayName = CSTRING(12); + magazines[] = { + QGVAR(2Rnd_12), + QGVAR(2Rnd_GBU12_LGB_MI10), + QGVAR(4Rnd_GBU12), + QGVAR(gbu12), + QGVAR(1_PylonMissile_1Rnd_12), + QGVAR(PylonMissile_Bomb_GBU12_x1), + QGVAR(PylonRack_Bomb_GBU12_x2) + }; + + EGVAR(laser,canSelect) = 1; // can ace_laser lock (allows switching laser code) + EGVAR(laser,showHud) = 1; // show attack profile / lock on hud + }; + + class GVAR(FAB250): weapon_LGBLauncherBase { + displayName = CSTRING(fab250); + magazines[] = { + QGVAR(1Rnd_FAB250), + QGVAR(2Rnd_FAB250), + QGVAR(1_PylonMissile_1Rnd_FAB250), + QGVAR(PylonMissile_1Rnd_FAB250) + }; + + EGVAR(laser,canSelect) = 1; // can ace_laser lock (allows switching laser code) + EGVAR(laser,showHud) = 1; // show attack profile / lock on hud + }; +}; + diff --git a/addons/missile_gbu/README.md b/addons/missile_gbu/README.md new file mode 100644 index 00000000000..07eb5ca8e95 --- /dev/null +++ b/addons/missile_gbu/README.md @@ -0,0 +1,4 @@ +ace_missile_gbu +=================== + +Adds GBU-12 LGB diff --git a/addons/missile_gbu/config.cpp b/addons/missile_gbu/config.cpp new file mode 100644 index 00000000000..6b84b38bb70 --- /dev/null +++ b/addons/missile_gbu/config.cpp @@ -0,0 +1,20 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common","ace_missileguidance"}; + author = ECSTRING(common,ACETeam); + authors[] = {"Dani (TCVM)"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + }; +}; + +#include "CfgAmmo.hpp" +#include "CfgMagazines.hpp" +#include "CfgWeapons.hpp" + diff --git a/addons/missile_gbu/script_component.hpp b/addons/missile_gbu/script_component.hpp new file mode 100644 index 00000000000..707200109d0 --- /dev/null +++ b/addons/missile_gbu/script_component.hpp @@ -0,0 +1,18 @@ +#define COMPONENT missile_gbu +#define COMPONENT_BEAUTIFIED Guided Bomb Unit +#include "\z\ace\addons\main\script_mod.hpp" + +// #define DEBUG_MODE_FULL +// #define DISABLE_COMPILE_CACHE +// #define ENABLE_PERFORMANCE_COUNTERS + +#ifdef DEBUG_ENABLED_MISSILE_GBU + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_MISSILE_GBU + #define DEBUG_SETTINGS DEBUG_SETTINGS_MISSILE_GBU +#endif + +#include "\z\ace\addons\main\script_macros.hpp" + diff --git a/addons/missile_gbu/stringtable.xml b/addons/missile_gbu/stringtable.xml new file mode 100644 index 00000000000..e94094b3de6 --- /dev/null +++ b/addons/missile_gbu/stringtable.xml @@ -0,0 +1,40 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project name="ACE"> + <Package name="MISSILE_GBU"> + <Key ID="STR_ACE_MISSILE_GBU_12"> + <English>GBU-12 [ACE]</English> + <Italian>GBU-12 [ACE]</Italian> + <Japanese>GBU-12 [ACE]</Japanese> + </Key> + <Key ID="STR_ACE_MISSILE_GBU_fab250"> + <English>FAB-250M-54 [ACE]</English> + <Italian>FAB-250M-54 [ACE]</Italian> + <Japanese>FAB-250M-54 [ACE]</Japanese> + </Key> + <Key ID="STR_ACE_MISSILE_GBU_12_1x"> + <English>1x GBU-12 [ACE]</English> + <Italian>1x GBU-12 [ACE]</Italian> + <Japanese>1x GBU-12 [ACE]</Japanese> + </Key> + <Key ID="STR_ACE_MISSILE_GBU_12_2x"> + <English>2x GBU-12 [ACE]</English> + <Italian>2x GBU-12 [ACE]</Italian> + <Japanese>2x GBU-12 [ACE]</Japanese> + </Key> + <Key ID="STR_ACE_MISSILE_GBU_12_4x"> + <English>4x GBU-12 [ACE]</English> + <Italian>4x GBU-12 [ACE]</Italian> + <Japanese>4x GBU-12 [ACE]</Japanese> + </Key> + <Key ID="STR_ACE_MISSILE_GBU_fab250_1x"> + <English>1x FAB-250M-54 [ACE]</English> + <Italian>1x FAB-250M-54 [ACE]</Italian> + <Japanese>1x FAB-250M-54 [ACE]</Japanese> + </Key> + <Key ID="STR_ACE_MISSILE_GBU_fab250_2x"> + <English>2x FAB-250M-54 [ACE]</English> + <Italian>2x FAB-250M-54 [ACE]</Italian> + <Japanese>2x FAB-250M-54 [ACE]</Japanese> + </Key> + </Package> +</Project> diff --git a/addons/missile_vikhr/$PBOPREFIX$ b/addons/missile_vikhr/$PBOPREFIX$ new file mode 100644 index 00000000000..4522cea1660 --- /dev/null +++ b/addons/missile_vikhr/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\missile_vikhr \ No newline at end of file diff --git a/addons/missile_vikhr/CfgAmmo.hpp b/addons/missile_vikhr/CfgAmmo.hpp new file mode 100644 index 00000000000..544b9d53a5d --- /dev/null +++ b/addons/missile_vikhr/CfgAmmo.hpp @@ -0,0 +1,17 @@ +class EGVAR(missileguidance,type_Vikhr); +class CfgAmmo { + class M_Scalpel_AT; + class GVAR(9k121): M_Scalpel_AT { + author = "Dani (TCVM)"; + maneuvrability = 0; + + irLock = 0; + laserLock = 0; + manualControl = 0; + + class ace_missileguidance: EGVAR(missileguidance,type_Vikhr) { + enabled = 1; + }; + }; +}; + diff --git a/addons/missile_vikhr/CfgMagazines.hpp b/addons/missile_vikhr/CfgMagazines.hpp new file mode 100644 index 00000000000..93084a98737 --- /dev/null +++ b/addons/missile_vikhr/CfgMagazines.hpp @@ -0,0 +1,53 @@ +class CfgMagazines { + class 2Rnd_LG_scalpel; + class 6Rnd_LG_scalpel; + class 8Rnd_LG_scalpel; + class PylonRack_1Rnd_LG_scalpel; + class PylonMissile_1Rnd_LG_scalpel; + class PylonRack_3Rnd_LG_scalpel; + class PylonRack_4Rnd_LG_scalpel; + + class GVAR(2Rnd): 2Rnd_LG_scalpel { + author = "Dani (TCVM)"; + displayName = CSTRING(2x); + ammo = QGVAR(9k121); + }; + + class GVAR(6Rnd): 6Rnd_LG_scalpel { + author = "Dani (TCVM)"; + displayName = CSTRING(6x); + ammo = QGVAR(9k121); + }; + + class GVAR(8Rnd): 8Rnd_LG_scalpel { + author = "Dani (TCVM)"; + displayName = CSTRING(8x); + ammo = QGVAR(9k121); + }; + + class GVAR(PylonRack_1Rnd): PylonRack_1Rnd_LG_scalpel { + author = "Dani (TCVM)"; + displayName = CSTRING(1x); + ammo = QGVAR(9k121); + pylonWeapon = QGVAR(9k121); + }; + class GVAR(PylonMissile_1Rnd): PylonMissile_1Rnd_LG_scalpel { + author = "Dani (TCVM)"; + displayName = CSTRING(1x); + ammo = QGVAR(9k121); + pylonWeapon = QGVAR(9k121); + }; + class GVAR(PylonRack_3Rnd): PylonRack_3Rnd_LG_scalpel { + author = "Dani (TCVM)"; + displayName = CSTRING(3x); + ammo = QGVAR(9k121); + pylonWeapon = QGVAR(9k121); + }; + class GVAR(PylonRack_4Rnd): PylonRack_4Rnd_LG_scalpel { + author = "Dani (TCVM)"; + displayName = CSTRING(4x); + ammo = QGVAR(9k121); + pylonWeapon = QGVAR(9k121); + }; +}; + diff --git a/addons/missile_vikhr/CfgWeapons.hpp b/addons/missile_vikhr/CfgWeapons.hpp new file mode 100644 index 00000000000..3db46a69ab0 --- /dev/null +++ b/addons/missile_vikhr/CfgWeapons.hpp @@ -0,0 +1,17 @@ +class CfgWeapons { + class missiles_SCALPEL; + class GVAR(9k121): missiles_SCALPEL { + author = "Dani (TCVM)"; + displayName = CSTRING(9k121); + magazines[] = { + QGVAR(2Rnd), + QGVAR(6Rnd), + QGVAR(8Rnd), + QGVAR(PylonRack_1Rnd), + QGVAR(PylonMissile_1Rnd), + QGVAR(PylonRack_3Rnd), + QGVAR(PylonRack_4Rnd) + }; + }; +}; + diff --git a/addons/missile_vikhr/README.md b/addons/missile_vikhr/README.md new file mode 100644 index 00000000000..104d449fd9c --- /dev/null +++ b/addons/missile_vikhr/README.md @@ -0,0 +1,4 @@ +ace_missile_vikhr +=================== + +Adds Vikhr beam-riding ATGM diff --git a/addons/missile_vikhr/config.cpp b/addons/missile_vikhr/config.cpp new file mode 100644 index 00000000000..6b84b38bb70 --- /dev/null +++ b/addons/missile_vikhr/config.cpp @@ -0,0 +1,20 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common","ace_missileguidance"}; + author = ECSTRING(common,ACETeam); + authors[] = {"Dani (TCVM)"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + }; +}; + +#include "CfgAmmo.hpp" +#include "CfgMagazines.hpp" +#include "CfgWeapons.hpp" + diff --git a/addons/missile_vikhr/script_component.hpp b/addons/missile_vikhr/script_component.hpp new file mode 100644 index 00000000000..41f554e77f9 --- /dev/null +++ b/addons/missile_vikhr/script_component.hpp @@ -0,0 +1,18 @@ +#define COMPONENT missile_vikhr +#define COMPONENT_BEAUTIFIED Vikhr +#include "\z\ace\addons\main\script_mod.hpp" + +// #define DEBUG_MODE_FULL +// #define DISABLE_COMPILE_CACHE +// #define ENABLE_PERFORMANCE_COUNTERS + +#ifdef DEBUG_ENABLED_MISSILE_VIKHR + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_MISSILE_VIKHR + #define DEBUG_SETTINGS DEBUG_SETTINGS_MISSILE_VIKHR +#endif + +#include "\z\ace\addons\main\script_macros.hpp" + diff --git a/addons/missile_vikhr/stringtable.xml b/addons/missile_vikhr/stringtable.xml new file mode 100644 index 00000000000..6cf5cc5078e --- /dev/null +++ b/addons/missile_vikhr/stringtable.xml @@ -0,0 +1,40 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project name="ACE"> + <Package name="MISSILE_VIKHR"> + <Key ID="STR_ACE_MISSILE_VIKHR_9k121"> + <English>9k121 Vikhr [ACE]</English> + <Italian>9k121 Vikhr [ACE]</Italian> + <Japanese>9k121 ヴィーフリ [ACE]</Japanese> + </Key> + <Key ID="STR_ACE_MISSILE_VIKHR_1x"> + <English>1x 9k121 Vikhr [ACE]</English> + <Italian>1x 9k121 Vikhr [ACE]</Italian> + <Japanese>1x 9k121 ヴィーフリ [ACE]</Japanese> + </Key> + <Key ID="STR_ACE_MISSILE_VIKHR_2x"> + <English>2x 9k121 Vikhr [ACE]</English> + <Italian>2x 9k121 Vikhr [ACE]</Italian> + <Japanese>2x 9k121 ヴィーフリ [ACE]</Japanese> + </Key> + <Key ID="STR_ACE_MISSILE_VIKHR_3x"> + <English>3x 9k121 Vikhr [ACE]</English> + <Italian>3x 9k121 Vikhr [ACE]</Italian> + <Japanese>3x 9k121 ヴィーフリ [ACE]</Japanese> + </Key> + <Key ID="STR_ACE_MISSILE_VIKHR_4x"> + <English>4x 9k121 Vikhr [ACE]</English> + <Italian>4x 9k121 Vikhr [ACE]</Italian> + <Japanese>4x 9k121 ヴィーフリ [ACE]</Japanese> + </Key> + <Key ID="STR_ACE_MISSILE_VIKHR_6x"> + <English>6x 9k121 Vikhr [ACE]</English> + <Italian>6x 9k121 Vikhr [ACE]</Italian> + <Japanese>6x 9k121 ヴィーフリ [ACE]</Japanese> + </Key> + <Key ID="STR_ACE_MISSILE_VIKHR_8x"> + <English>8x 9k121 Vikhr [ACE]</English> + <Italian>8x 9k121 Vikhr [ACE]</Italian> + <Japanese>8x 9k121 ヴィーフリ [ACE]</Japanese> + </Key> + </Package> +</Project> diff --git a/addons/missileguidance/ACE_GuidanceConfig.hpp b/addons/missileguidance/ACE_GuidanceConfig.hpp index 3628c9eec04..131beee3398 100644 --- a/addons/missileguidance/ACE_GuidanceConfig.hpp +++ b/addons/missileguidance/ACE_GuidanceConfig.hpp @@ -6,6 +6,11 @@ class GVAR(AttackProfiles) { functionName = QFUNC(attackProfile_LIN); }; + // empty classes for backwards compat + class MID: LIN { + }; + class HI: LIN { + }; class DIR { name = ""; visualName = ""; @@ -13,21 +18,14 @@ class GVAR(AttackProfiles) { functionName = QFUNC(attackProfile_DIR); }; - class MID { - name = ""; - visualName = ""; - description = ""; - - functionName = QFUNC(attackProfile_MID); - }; - class HI { + class LOFT { name = ""; visualName = ""; description = ""; - functionName = QFUNC(attackProfile_HI); + functionName = QFUNC(attackProfile_LOFT); }; - class JAV_DIR { + class JAV_DIR { name = ""; visualName = ""; description = ""; @@ -82,12 +80,39 @@ class GVAR(SeekerTypes) { functionName = QFUNC(seekerType_SACLOS); onFired = QFUNC(SACLOS_onFired); }; - class ARH { + class MillimeterWaveRadar { name = ""; visualName = ""; description = ""; - functionName = QFUNC(seekerType_ARH); - onFired = QFUNC(ahr_onFired); + functionName = QFUNC(seekerType_MWR); + onFired = QFUNC(mwr_onFired); + }; +}; + +class GVAR(NavigationTypes) { + class Direct { + functionName = QFUNC(navigationType_direct); + onFired = ""; + }; + class Line { + functionName = QFUNC(navigationType_line); + onFired = QFUNC(line_onFired); + }; + class LineOfSight { + functionName = QFUNC(navigationType_lineOfSight); + onFired = QFUNC(proNav_onFired); + }; + class ProportionalNavigation { + functionName = QFUNC(navigationType_proNav); + onFired = QFUNC(proNav_onFired); + }; + class AugmentedProportionalNavigation { + functionName = QFUNC(navigationType_augmentedProNav); + onFired = QFUNC(proNav_onFired); + }; + class ZeroEffortMiss { + functionName = QFUNC(navigationType_zeroEffortMiss); + onFired = QFUNC(proNav_onFired); }; }; diff --git a/addons/missileguidance/CfgAmmo.hpp b/addons/missileguidance/CfgAmmo.hpp index a2b07b7fff1..44e35d40811 100644 --- a/addons/missileguidance/CfgAmmo.hpp +++ b/addons/missileguidance/CfgAmmo.hpp @@ -17,31 +17,8 @@ class CfgAmmo { EGVAR(rearm,caliber) = 70; - class ADDON { + class ADDON: GVAR(type_Dagr) { enabled = 1; - - minDeflection = 0.0005; // Minium flap deflection for guidance - maxDeflection = 0.0025; // Maximum flap deflection for guidance - incDeflection = 0.0005; // The incrmeent in which deflection adjusts. - - canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode - - // Guidance type for munitions - defaultSeekerType = "SALH"; - seekerTypes[] = { "SALH", "LIDAR", "SARH", "Optic", "Thermal", "GPS", "SACLOS", "MCLOS" }; - - defaultSeekerLockMode = "LOAL"; - seekerLockModes[] = { "LOAL", "LOBL" }; - - seekerAngle = 90; // Angle in front of the missile which can be searched - seekerAccuracy = 1; // seeker accuracy multiplier - - seekerMinRange = 1; - seekerMaxRange = 2500; // Range from the missile which the seeker can visually search - - // Attack profile type selection - defaultAttackProfile = "LIN"; - attackProfiles[] = { "LIN", "DIR", "MID", "HI" }; }; }; @@ -66,34 +43,8 @@ class CfgAmmo { initTime = 0.5; // Begin ACE guidance Configs - class ADDON { + class ADDON: GVAR(type_Javelin) { enabled = 1; - - minDeflection = 0.00005; // Minium flap deflection for guidance - maxDeflection = 0.025; // Maximum flap deflection for guidance - incDeflection = 0.00005; // The incrmeent in which deflection adjusts. - - canVanillaLock = 0; - - // Guidance type for munitions - defaultSeekerType = "Optic"; - seekerTypes[] = { "Optic" }; - - defaultSeekerLockMode = "LOBL"; - seekerLockModes[] = { "LOBL" }; - - seekerAngle = 180; // Angle in front of the missile which can be searched - seekerAccuracy = 1; // seeker accuracy multiplier - - seekerMinRange = 0; - seekerMaxRange = 2500; // Range from the missile which the seeker can visually search - - seekLastTargetPos = 1; // seek last target position [if seeker loses LOS of target, continue to last known pos] - - // Attack profile type selection - defaultAttackProfile = "JAV_TOP"; - attackProfiles[] = { "JAV_TOP", "JAV_DIR" }; - useModeForAttackProfile = 1; }; }; class ACE_Javelin_FGM148_static: ACE_Javelin_FGM148 { @@ -102,6 +53,8 @@ class CfgAmmo { effectsMissileInit = "RocketBackEffectsStaticRPG"; //Explicity add guidance config - class ADDON: ADDON {}; + class ADDON: ADDON { + enabled = 1; + }; }; }; diff --git a/addons/missileguidance/CfgMagazines.hpp b/addons/missileguidance/CfgMagazines.hpp index 74d75e8d4ae..c7ef48004ca 100644 --- a/addons/missileguidance/CfgMagazines.hpp +++ b/addons/missileguidance/CfgMagazines.hpp @@ -4,24 +4,40 @@ class CfgMagazines { class 6Rnd_ACE_Hydra70_DAGR: 12Rnd_PG_missiles { ammo = "ACE_Hydra70_DAGR"; count = 12; - displayName = "6 Round DAGR"; - displayNameShort = "6 Round DAGR"; - descriptionShort = "6 Round DAGR"; + displayName = CSTRING(Hydra70_DAGR_6x); weight = 36; }; class 12Rnd_ACE_Hydra70_DAGR: 6Rnd_ACE_Hydra70_DAGR { count = 12; - displayName = "16 Round DAGR"; - displayNameShort = "16 Round DAGR"; - descriptionShort = "16 Round DAGR"; + displayName = CSTRING(Hydra70_DAGR_12x); weight = 72; }; class 24Rnd_ACE_Hydra70_DAGR: 6Rnd_ACE_Hydra70_DAGR { count = 24; - displayName = "24 Round DAGR"; - displayNameShort = "24 Round DAGR"; - descriptionShort = "24 Round DAGR"; + displayName = CSTRING(Hydra70_DAGR_24x); weight = 72; }; + + class PylonRack_12Rnd_PG_missiles; + class PylonRack_6Rnd_ACE_DAGR: PylonRack_12Rnd_PG_missiles { + ammo = "ACE_Hydra70_DAGR"; + displayName = CSTRING(Hydra70_DAGR_6x); + count = 6; + pylonWeapon = QGVAR(dagr); + }; + + class PylonRack_12Rnd_ACE_DAGR: PylonRack_12Rnd_PG_missiles { + ammo = "ACE_Hydra70_DAGR"; + displayName = CSTRING(Hydra70_DAGR_12x); + count = 12; + pylonWeapon = QGVAR(dagr); + }; + + class PylonRack_24Rnd_ACE_DAGR: PylonRack_12Rnd_PG_missiles { + ammo = "ACE_Hydra70_DAGR"; + displayName = CSTRING(Hydra70_DAGR_24x); + count = 24; + pylonWeapon = QGVAR(dagr); + }; }; diff --git a/addons/missileguidance/CfgMissileTypesNato.hpp b/addons/missileguidance/CfgMissileTypesNato.hpp new file mode 100644 index 00000000000..87730b5ed0c --- /dev/null +++ b/addons/missileguidance/CfgMissileTypesNato.hpp @@ -0,0 +1,716 @@ +class GVAR(type_AMRAAM) { + enabled = 0; + + pitchRate = 30; // Minium flap deflection for guidance + yawRate = 30; // Maximum flap deflection for guidance + + canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "DopplerRadar"; + seekerTypes[] = { "DopplerRadar" }; + lockableTypes[] = {"Air"}; + + minimumSpeedFilter = 25; // filter out targets that have a closing velocity less than this + minimumTimeFilter = 0.0001; // filter out targets that are this close to the ground (speed of light) + maxTerrainCheck = 16000; // How far we should check for terrain + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "ZeroEffortMiss"; + navigationTypes[] = { "ZeroEffortMiss" }; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 50; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 2500; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "DIR"; + attackProfiles[] = {"DIR", "LOFT"}; + useModeForAttackProfile = 1; +}; + +class GVAR(type_ASRAAM) { + enabled = 0; + + pitchRate = 100; // Minium flap deflection for guidance + yawRate = 100; // Maximum flap deflection for guidance + + canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "IR"; + seekerTypes[] = { "IR" }; + + flareDistanceFilter = 50; + flareAngleFilter = 0.8; // can filter out flares that are >= flareAngleFilter to known target velocity + + defaultSeekerLockMode = "LOBL"; + seekerLockModes[] = { "LOBL" }; + + defaultNavigationType = "ZeroEffortMiss"; + navigationTypes[] = { "ZeroEffortMiss" }; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 120; // Angle from the shooter's view that can track the missile + seekerAccuracy = 0.98; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 8000; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "DIR"; + attackProfiles[] = {"DIR"}; +}; + +class GVAR(type_Dagr) { + enabled = 0; + + pitchRate = 40; // degrees per second + yawRate = 40; + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "SALH"; + seekerTypes[] = { "SALH" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "AugmentedProportionalNavigation"; + navigationTypes[] = { "AugmentedProportionalNavigation" }; + + seekerAngle = 90; // Angle in front of the missile which can be searched + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 1; + seekerMaxRange = 2500; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "LIN"; + attackProfiles[] = { "LIN", "DIR", "MID", "HI" }; +}; + +class GVAR(type_Dragon) { + enabled = 0; + + pitchRate = 0; + yawRate = 0; + + canVanillaLock = 0; + + // Guidance type for munitions + defaultSeekerType = "SACLOS"; + seekerTypes[] = { "SACLOS" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "LineOfSight"; + navigationTypes[] = { "LineOfSight" }; + + seekLastTargetPos = 0; + seekerAngle = 30; + seekerAccuracy = 1; + + seekerMinRange = 65; + seekerMaxRange = 1000; + + correctionDistance = 30; + missileLeadDistance = 0; + offsetFromCrosshair[] = { 0, 0, 0 }; + + serviceInterval = 0.33; // how many seconds between pops + serviceCharges = 32; // how many charges are in this missile + serviceChargeAcceleration = 6.5; + dragonSpeed = 100; // meters per second + + defaultAttackProfile = "DRAGON"; + attackProfiles[] = {"DRAGON"}; +}; + +class GVAR(type_ESSM) { + enabled = 0; + + pitchRate = 15; // Minium flap deflection for guidance + yawRate = 15; // Maximum flap deflection for guidance + + canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "DopplerRadar"; + seekerTypes[] = { "DopplerRadar" }; + lockableTypes[] = {"Air"}; + + minimumSpeedFilter = 20; // filter out targets that have a closing velocity less than this + minimumTimeFilter = 0.00001; // filter out targets that are this close to the ground (speed of light) + maxTerrainCheck = 16000; // How far we should check for terrain + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "ZeroEffortMiss"; + navigationTypes[] = { "ZeroEffortMiss" }; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 50; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 2500; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "DIR"; + attackProfiles[] = {"DIR"}; +}; + +class GVAR(type_Hellfire) { + enabled = 0; + + pitchRate = 30; // degrees per second + yawRate = 30; + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "SALH"; + seekerTypes[] = { "SALH" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "Direct"; + navigationTypes[] = { "Direct", "ZeroEffortMiss" }; + + seekLastTargetPos = 1; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 70; // Angle in front of the missile which can be searched + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 1; + seekerMaxRange = 8000; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "hellfire"; + attackProfiles[] = {"hellfire", "hellfire_hi", "hellfire_lo"}; + + class navigationStates { + class initial { + transitionCondition = QEFUNC(hellfire,midCourseTransition); + navigationType = "Direct"; + }; + class terminal { + transitionCondition = ""; + navigationType = "ZeroEffortMiss"; + }; + // transitions from initial -> termimal + states[] = {"initial", "terminal"}; + }; +}; + +class GVAR(type_Hot) { + enabled = 0; + + pitchRate = 45; // Minium flap deflection for guidance + yawRate = 45; // Maximum flap deflection for guidance + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + showTrail = 1; + + // Guidance type for munitions + defaultSeekerType = "SACLOS"; + seekerTypes[] = { "SACLOS" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "Line"; + navigationTypes[] = { "Line" }; + + lineGainP = 7; + lineGainD = 6; + + initialPitch = 2; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 30; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 4000; // Range from the missile which the seeker can visually search + + offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. + + // Attack profile type selection + defaultAttackProfile = "WIRE"; + attackProfiles[] = {"WIRE"}; +}; + +class GVAR(type_Javelin) { + enabled = 0; + + pitchRate = 120; // degrees per second + yawRate = 120; + stabilityCoefficient = 0.2; + bangBangGuidance = 0; + + canVanillaLock = 0; + + // Guidance type for munitions + defaultSeekerType = "Optic"; + seekerTypes[] = { "Optic" }; + + defaultSeekerLockMode = "LOBL"; + seekerLockModes[] = { "LOBL" }; + + defaultNavigationType = "Direct"; + navigationTypes[] = { "Direct", "ZeroEffortMiss" }; + + navigationGain = 3; + + seekerAngle = 180; // Angle in front of the missile which can be searched + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 0; + seekerMaxRange = 2500; // Range from the missile which the seeker can visually search + + seekLastTargetPos = 1; // seek last target position [if seeker loses LOS of target, continue to last known pos] + + // Attack profile type selection + defaultAttackProfile = "JAV_TOP"; + attackProfiles[] = { "JAV_TOP", "JAV_DIR" }; + useModeForAttackProfile = 1; + + class navigationStates { + class initial { + transitionCondition = QFUNC(javelin_midCourseTransition); + navigationType = "Direct"; + }; + class terminal { + transitionCondition = ""; + navigationType = "ZeroEffortMiss"; + }; + // transitions from initial -> termimal + states[] = {"initial", "terminal"}; + }; +}; + +class GVAR(type_Jdam) { + enabled = 0; + + pitchRate = 15; + yawRate = 20; + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "GPS"; + seekerTypes[] = { "GPS" }; + + defaultSeekerLockMode = "LOBL"; + seekerLockModes[] = { "LOBL" }; + + defaultNavigationType = "LINE"; + navigationTypes[] = { "LINE" }; + + lineGainP = 50; + lineGainD = 0; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 60; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 5; + seekerMaxRange = 4000; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "JDAM"; + attackProfiles[] = {"JDAM"}; +}; + +class GVAR(type_Maverick) { + enabled = 0; + + pitchRate = 15; + yawRate = 15; + + canVanillaLock = 1; + + defaultSeekerType = "Optic"; + seekerTypes[] = {"Optic"}; + + defaultSeekerLockMode = "LOBL"; + seekerLockModes[] = {"LOBL"}; + + defaultNavigationType = "AugmentedProportionalNavigation"; + navigationTypes[] = { "AugmentedProportionalNavigation" }; + + seekLastTargetPos = 1; + seekerAngle = 60; + seekerAccuracy = 1; + + seekerMinRange = 1; + seekerMaxRange = 14000; + + defaultAttackProfile = "maverick"; + attackProfiles[] = {"maverick"}; +}; + +class GVAR(type_Milan) { + enabled = 0; + + pitchRate = 60; // Minium flap deflection for guidance + yawRate = 60; // Maximum flap deflection for guidance + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + showTrail = 0; + + // Guidance type for munitions + defaultSeekerType = "SACLOS"; + seekerTypes[] = { "SACLOS" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "Line"; + navigationTypes[] = { "Line" }; + + lineGainP = 25; + lineGainD = 12; + + initialPitch = -0.4; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 5; // Angle from the shooter's view that can track the missile, implemented + seekerAccuracy = 1; // seeker accuracy multiplier, not implemented? + + seekerMinRange = 100; + seekerMaxRange = 2000; // Range from the missile which the seeker can visually search + + offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. + + // Attack profile type selection + defaultAttackProfile = "WIRE"; + attackProfiles[] = {"WIRE"}; +}; + +class GVAR(type_Nlaw) { + enabled = 0; + + pitchRate = 5; // Minium flap deflection for guidance + yawRate = 10; // Maximum flap deflection for guidance + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = QEGVAR(nlaw,seeker); + seekerTypes[] = {QEGVAR(nlaw,seeker)}; + + defaultSeekerLockMode = "LOBL"; + seekerLockModes[] = {"LOBL"}; + + defaultNavigationType = QEGVAR(nlaw,PLOS); + navigationTypes[] = { QEGVAR(nlaw,PLOS) }; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 45; // Angle in front of the missile which can be searched + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 0; + seekerMaxRange = 10; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = QEGVAR(nlaw,directAttack); + attackProfiles[] = {QEGVAR(nlaw,directAttack), QEGVAR(nlaw,overflyTopAttack)}; + useModeForAttackProfile = 1; + showHintOnCycle = 1; + + // Run once at fired event + onFired = QEFUNC(nlaw,onFired); +}; + +class GVAR(type_Patriot) { + enabled = 0; + + pitchRate = 30; // Minium flap deflection for guidance + yawRate = 30; // Maximum flap deflection for guidance + + canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "DopplerRadar"; + seekerTypes[] = { "DopplerRadar" }; + lockableTypes[] = {"Air"}; + + minimumSpeedFilter = 10; // filter out targets that have a closing velocity less than this + minimumTimeFilter = 0.00001; // filter out targets that are this close to the ground (speed of light) + maxTerrainCheck = 16000; // How far we should check for terrain + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "ZeroEffortMiss"; + navigationTypes[] = { "ZeroEffortMiss" }; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 50; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 2500; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "DIR"; + attackProfiles[] = {"DIR"}; +}; + +class GVAR(type_Paveway) { + enabled = 0; + + pitchRate = 5; + yawRate = 5; + + bangBangGuidance = 1; + stabilityCoefficient = 0.4; // how much this projectile likes to "weathervane" (keep direction toward velocity) + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "SALH"; + seekerTypes[] = { "SALH" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL" }; + + defaultNavigationType = "Direct"; + navigationTypes[] = { "Direct" }; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 60; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 5; + seekerMaxRange = 4000; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "DIR"; + attackProfiles[] = {"DIR"}; +}; + +class GVAR(type_RAM) { + enabled = 0; + + pitchRate = 50; // Minium flap deflection for guidance + yawRate = 50; // Maximum flap deflection for guidance + + canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "IR"; + seekerTypes[] = { "IR" }; + + flareDistanceFilter = 100; + flareAngleFilter = 0.5; // can filter out flares that are >= flareAngleFilter to known target velocity + + defaultSeekerLockMode = "LOBL"; + seekerLockModes[] = { "LOBL" }; + + defaultNavigationType = "ZeroEffortMiss"; + navigationTypes[] = { "ZeroEffortMiss" }; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 45; // Angle from the shooter's view that can track the missile + seekerAccuracy = 0.8; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 5000; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "DIR"; + attackProfiles[] = {"DIR"}; +}; + +class GVAR(type_RBS70) { + enabled = 0; + + pitchRate = 45; // Minium flap deflection for guidance + yawRate = 45; // Maximum flap deflection for guidance + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + showTrail = 1; + + // Guidance type for munitions + defaultSeekerType = "SACLOS"; + seekerTypes[] = { "SACLOS" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "Line"; + navigationTypes[] = { "Line" }; + + lineGainP = 20; + lineGainD = 16; + + initialPitch = 2; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 30; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 5000; // Range from the missile which the seeker can visually search + + correctionDistance = 30; // distance from center of crosshair where missile slows down + offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. + + // Attack profile type selection + defaultAttackProfile = "BEAM"; + attackProfiles[] = {"BEAM"}; +}; + +class GVAR(type_Redeye) { + enabled = 0; + + pitchRate = 27; // Minium flap deflection for guidance + yawRate = 27; // Maximum flap deflection for guidance + + canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "IR"; + seekerTypes[] = { "IR" }; + + flareDistanceFilter = 100; + flareAngleFilter = 2.0; // can filter out flares that are >= flareAngleFilter to known target velocity + + defaultSeekerLockMode = "LOBL"; + seekerLockModes[] = { "LOBL" }; + + defaultNavigationType = "ProportionalNavigation"; + navigationTypes[] = { "ProportionalNavigation" }; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 45; // Angle from the shooter's view that can track the missile + seekerAccuracy = 0.4; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 4500; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "DIR"; + attackProfiles[] = {"DIR"}; +}; + +class GVAR(type_Sidewinder) { + enabled = 0; + + pitchRate = 25; // Minium flap deflection for guidance + yawRate = 25; // Maximum flap deflection for guidance + + canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "IR"; + seekerTypes[] = { "IR" }; + + flareDistanceFilter = 100; + flareAngleFilter = 1.6; // can filter out flares that are >= flareAngleFilter to known target velocity + + defaultSeekerLockMode = "LOBL"; + seekerLockModes[] = { "LOBL" }; + + defaultNavigationType = "AugmentedProportionalNavigation"; + navigationTypes[] = { "AugmentedProportionalNavigation" }; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 45; // Angle from the shooter's view that can track the missile + seekerAccuracy = 0.8; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 5000; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "DIR"; + attackProfiles[] = {"DIR"}; +}; + +class GVAR(type_Stinger) { + enabled = 0; + + pitchRate = 42; // Minium flap deflection for guidance + yawRate = 42; // Maximum flap deflection for guidance + + canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "IR"; + seekerTypes[] = { "IR" }; + + flareDistanceFilter = 100; + flareAngleFilter = 1.3; // can filter out flares that are >= flareAngleFilter to known target velocity + + defaultSeekerLockMode = "LOBL"; + seekerLockModes[] = { "LOBL" }; + + defaultNavigationType = "AugmentedProportionalNavigation"; + navigationTypes[] = { "AugmentedProportionalNavigation" }; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 45; // Angle from the shooter's view that can track the missile + seekerAccuracy = 0.8; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 5000; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "DIR"; + attackProfiles[] = {"DIR"}; +}; + +class GVAR(type_TOW) { + enabled = 0; + + pitchRate = 45; // Minium flap deflection for guidance + yawRate = 45; // Maximum flap deflection for guidance + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + showTrail = 1; + + // Guidance type for munitions + defaultSeekerType = "SACLOS"; + seekerTypes[] = { "SACLOS" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "Line"; + navigationTypes[] = { "Line" }; + + lineGainP = 20; + lineGainD = 7; + + initialPitch = 2; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 30; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 65; + seekerMaxRange = 3750; // Range from the missile which the seeker can visually search + + correctionDistance = 30; // distance from center of crosshair where missile slows down + offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. + + // Attack profile type selection + defaultAttackProfile = "WIRE"; + attackProfiles[] = {"WIRE"}; +}; \ No newline at end of file diff --git a/addons/missileguidance/CfgMissileTypesWarsaw.hpp b/addons/missileguidance/CfgMissileTypesWarsaw.hpp new file mode 100644 index 00000000000..180d8a98954 --- /dev/null +++ b/addons/missileguidance/CfgMissileTypesWarsaw.hpp @@ -0,0 +1,901 @@ +class GVAR(type_Ataka) { + enabled = 0; + + pitchRate = 45; // Minium flap deflection for guidance + yawRate = 45; // Maximum flap deflection for guidance + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + showTrail = 1; + + // Guidance type for munitions + defaultSeekerType = "SACLOS"; + seekerTypes[] = { "SACLOS" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "Line"; + navigationTypes[] = { "Line" }; + + lineGainP = 16; + lineGainD = 10.44; + + initialPitch = 2; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 30; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 6000; // Range from the missile which the seeker can visually search + + offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. + + // Attack profile type selection + defaultAttackProfile = "BEAM"; + attackProfiles[] = {"BEAM"}; +}; + +class GVAR(type_Bastion) { + enabled = 0; + + pitchRate = 45; // Minium flap deflection for guidance + yawRate = 45; // Maximum flap deflection for guidance + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + showTrail = 1; + + // Guidance type for munitions + defaultSeekerType = "SACLOS"; + seekerTypes[] = { "SACLOS" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "Line"; + navigationTypes[] = { "Line" }; + + lineGainP = 16; + lineGainD = 10.44; + + initialPitch = 2; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 30; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 6000; // Range from the missile which the seeker can visually search + + offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. + + // Attack profile type selection + defaultAttackProfile = "BEAM"; + attackProfiles[] = {"BEAM"}; +}; + +class GVAR(type_Drakon) { + enabled = 0; + + pitchRate = 25; // Minium flap deflection for guidance + yawRate = 25; // Maximum flap deflection for guidance + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + showTrail = 1; + + // Guidance type for munitions + defaultSeekerType = "SACLOS"; + seekerTypes[] = { "SACLOS" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "Line"; + navigationTypes[] = { "Line" }; + + lineGainP = 16; + lineGainD = 9.5; + + initialPitch = 2; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 30; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 3300; // Range from the missile which the seeker can visually search + + correctionDistance = 30; // distance from center of crosshair where missile slows down + offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. + + // Attack profile type selection + defaultAttackProfile = "BEAM"; + attackProfiles[] = {"BEAM"}; +}; + +class GVAR(type_Fagot) { + enabled = 0; + + pitchRate = 45; // Minium flap deflection for guidance + yawRate = 45; // Maximum flap deflection for guidance + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + showTrail = 1; + + // Guidance type for munitions + defaultSeekerType = "SACLOS"; + seekerTypes[] = { "SACLOS" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "Line"; + navigationTypes[] = { "Line" }; + + lineGainP = 16; + lineGainD = 10.44; + + initialPitch = 2; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 30; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 2000; // Range from the missile which the seeker can visually search + + correctionDistance = 30; // distance from center of crosshair where missile slows down + offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. + + // Attack profile type selection + defaultAttackProfile = "BEAM"; + attackProfiles[] = {"BEAM"}; +}; + +class GVAR(type_Falanga) { + enabled = 0; + + pitchRate = 15; // Minium flap deflection for guidance + yawRate = 15; // Maximum flap deflection for guidance + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + showTrail = 1; + + // Guidance type for munitions + defaultSeekerType = "MCLOS"; + seekerTypes[] = { "MCLOS" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL" }; + + defaultNavigationType = "Line"; + navigationTypes[] = { "Line" }; + + lineGainP = 5; + lineGainD = 0; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 30; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 0; + seekerMaxRange = 2500; // Range from the missile which the seeker can visually search + + correctionDistance = 0; // distance from center of crosshair where missile slows down + offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. + + // Attack profile type selection + defaultAttackProfile = "WIRE"; + attackProfiles[] = {"WIRE"}; +}; + +class GVAR(type_Fleyta) { + enabled = 0; + + pitchRate = 15; // Minium flap deflection for guidance + yawRate = 15; // Maximum flap deflection for guidance + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + showTrail = 1; + + // Guidance type for munitions + defaultSeekerType = "MCLOS"; + seekerTypes[] = { "MCLOS" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL" }; + + defaultNavigationType = "Line"; + navigationTypes[] = { "Line" }; + + lineGainP = 5; + lineGainD = 0; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 30; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 0; + seekerMaxRange = 3000; // Range from the missile which the seeker can visually search + + correctionDistance = 0; // distance from center of crosshair where missile slows down + offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. + + // Attack profile type selection + defaultAttackProfile = "WIRE"; + attackProfiles[] = {"WIRE"}; +}; + +class GVAR(type_Igla) { + enabled = 0; + + pitchRate = 30; // Minium flap deflection for guidance + yawRate = 43; // Maximum flap deflection for guidance + + canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "IR"; + seekerTypes[] = { "IR" }; + + flareDistanceFilter = 100; + flareAngleFilter = 1.1; // can filter out flares that are >= flareAngleFilter to known target velocity + + defaultSeekerLockMode = "LOBL"; + seekerLockModes[] = { "LOBL" }; + + defaultNavigationType = "AugmentedProportionalNavigation"; + navigationTypes[] = { "AugmentedProportionalNavigation" }; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 45; // Angle from the shooter's view that can track the missile + seekerAccuracy = 0.76; // seeker accuracy multiplier + + seekerMinRange = 5; + seekerMaxRange = 5200; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "DIR"; + attackProfiles[] = {"DIR"}; +}; + +class GVAR(type_KAB) { + enabled = 0; + + pitchRate = 8; + yawRate = 8; + + bangBangGuidance = 1; + stabilityCoefficient = 0.4; // how much this projectile likes to "weathervane" (keep direction toward velocity) + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "SALH"; + seekerTypes[] = { "SALH" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL" }; + + defaultNavigationType = "Direct"; + navigationTypes[] = { "Direct" }; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 60; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 5; + seekerMaxRange = 4000; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "DIR"; + attackProfiles[] = {"DIR"}; +}; + +class GVAR(type_KH25) { + enabled = 0; + + pitchRate = 20; + yawRate = 20; + + canVanillaLock = 0; + + defaultSeekerType = "SALH"; + seekerTypes[] = {"SALH"}; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = {"LOAL"}; + + defaultNavigationType = "AugmentedProportionalNavigation"; + navigationTypes[] = { "AugmentedProportionalNavigation" }; + + seekLastTargetPos = 1; + seekerAngle = 40; + seekerAccuracy = 1; + + seekerMinRange = 1; + seekerMaxRange = 10000; + + defaultAttackProfile = "maverick"; + attackProfiles[] = {"maverick"}; +}; + +class GVAR(type_KH29) { + enabled = 0; + + pitchRate = 20; + yawRate = 20; + + canVanillaLock = 0; + + defaultSeekerType = "SALH"; + seekerTypes[] = {"SALH"}; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = {"LOAL"}; + + defaultNavigationType = "AugmentedProportionalNavigation"; + navigationTypes[] = { "AugmentedProportionalNavigation" }; + + seekLastTargetPos = 1; + seekerAngle = 40; + seekerAccuracy = 1; + + seekerMinRange = 1; + seekerMaxRange = 10000; + + defaultAttackProfile = "maverick"; + attackProfiles[] = {"maverick"}; +}; + +class GVAR(type_Kobra) { + enabled = 0; + + pitchRate = 45; // Minium flap deflection for guidance + yawRate = 45; // Maximum flap deflection for guidance + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + showTrail = 1; + + // Guidance type for munitions + defaultSeekerType = "SACLOS"; + seekerTypes[] = { "SACLOS" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "Line"; + navigationTypes[] = { "Line" }; + + lineGainP = 16; + lineGainD = 9.5; + + initialPitch = 2; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 30; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 5000; // Range from the missile which the seeker can visually search + + correctionDistance = 30; // distance from center of crosshair where missile slows down + offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. + + // Attack profile type selection + defaultAttackProfile = "BEAM"; + attackProfiles[] = {"BEAM"}; +}; + +class GVAR(type_Konkurs) { + enabled = 0; + + pitchRate = 45; // Minium flap deflection for guidance + yawRate = 45; // Maximum flap deflection for guidance + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + showTrail = 1; + + // Guidance type for munitions + defaultSeekerType = "SACLOS"; + seekerTypes[] = { "SACLOS" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "Line"; + navigationTypes[] = { "Line" }; + + lineGainP = 10; + lineGainD = 8.5; + + initialPitch = 2; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 30; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 4000; // Range from the missile which the seeker can visually search + + offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. + + // Attack profile type selection + defaultAttackProfile = "WIRE"; + attackProfiles[] = {"WIRE"}; +}; + +class GVAR(type_Kornet) { + enabled = 0; + + pitchRate = 45; // Minium flap deflection for guidance + yawRate = 45; // Maximum flap deflection for guidance + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + showTrail = 1; + + // Guidance type for munitions + defaultSeekerType = "SACLOS"; + seekerTypes[] = { "SACLOS" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "Line"; + navigationTypes[] = { "Line" }; + + lineGainP = 16; + lineGainD = 10.44; + + initialPitch = 2; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 30; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 5000; // Range from the missile which the seeker can visually search + + correctionDistance = 30; // distance from center of crosshair where missile slows down + offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. + + // Attack profile type selection + defaultAttackProfile = "BEAM"; + attackProfiles[] = {"BEAM"}; +}; + +class GVAR(type_Malyutka) { + enabled = 0; + + pitchRate = 15; // Minium flap deflection for guidance + yawRate = 15; // Maximum flap deflection for guidance + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + showTrail = 1; + + // Guidance type for munitions + defaultSeekerType = "MCLOS"; + seekerTypes[] = { "MCLOS" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL" }; + + defaultNavigationType = "Line"; + navigationTypes[] = { "Line" }; + + lineGainP = 5; + lineGainD = 0; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 30; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 0; + seekerMaxRange = 2500; // Range from the missile which the seeker can visually search + + correctionDistance = 0; // distance from center of crosshair where missile slows down + offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. + + // Attack profile type selection + defaultAttackProfile = "WIRE"; + attackProfiles[] = {"WIRE"}; +}; + +class GVAR(type_Metis) { + enabled = 0; + + pitchRate = 50; // Minium flap deflection for guidance + yawRate = 50; // Maximum flap deflection for guidance + initialPitch = 2; + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + showTrail = 1; + + // Guidance type for munitions + defaultSeekerType = "SACLOS"; + seekerTypes[] = { "SACLOS" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "Line"; + navigationTypes[] = { "Line" }; + + lineGainP = 16; + lineGainD = 10.44; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 15; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 80; + seekerMaxRange = 1000; // Range from the missile which the seeker can visually search + + correctionDistance = 3; // distance from center of crosshair where missile slows down + offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. + + // Attack profile type selection + defaultAttackProfile = "WIRE"; + attackProfiles[] = {"WIRE"}; +}; + +class GVAR(type_Molniya) { + enabled = 0; + + pitchRate = 45; // Minium flap deflection for guidance + yawRate = 45; // Maximum flap deflection for guidance + + canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "IR"; + seekerTypes[] = { "IR" }; + + flareDistanceFilter = 50; + flareAngleFilter = 0.8; // can filter out flares that are >= flareAngleFilter to known target velocity + + defaultSeekerLockMode = "LOBL"; + seekerLockModes[] = { "LOBL" }; + + defaultNavigationType = "AugmentedProportionalNavigation"; + navigationTypes[] = { "AugmentedProportionalNavigation" }; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 40; // Angle from the shooter's view that can track the missile + seekerAccuracy = 0.85; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 5000; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "DIR"; + attackProfiles[] = {"DIR"}; +}; + +class GVAR(type_R73) { + enabled = 0; + + pitchRate = 35; // Minium flap deflection for guidance + yawRate = 35; // Maximum flap deflection for guidance + + canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "IR"; + seekerTypes[] = { "IR" }; + + flareDistanceFilter = 50; + flareAngleFilter = 0.8; // can filter out flares that are >= flareAngleFilter to known target velocity + + defaultSeekerLockMode = "LOBL"; + seekerLockModes[] = { "LOBL" }; + + defaultNavigationType = "AugmentedProportionalNavigation"; + navigationTypes[] = { "AugmentedProportionalNavigation" }; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 40; // Angle from the shooter's view that can track the missile + seekerAccuracy = 0.85; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 5000; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "DIR"; + attackProfiles[] = {"DIR"}; +}; + +class GVAR(type_R74) { + enabled = 1; + + pitchRate = 50; // Minium flap deflection for guidance + yawRate = 50; // Maximum flap deflection for guidance + + canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "IR"; + seekerTypes[] = { "IR" }; + + flareDistanceFilter = 50; + flareAngleFilter = 0.8; // can filter out flares that are >= flareAngleFilter to known target velocity + + defaultSeekerLockMode = "LOBL"; + seekerLockModes[] = { "LOBL" }; + + defaultNavigationType = "AugmentedProportionalNavigation"; + navigationTypes[] = { "AugmentedProportionalNavigation" }; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 75; // Angle from the shooter's view that can track the missile + seekerAccuracy = 0.95; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 8000; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "DIR"; + attackProfiles[] = {"DIR"}; +}; + +class GVAR(type_R77) { + enabled = 0; + + pitchRate = 40; // Minium flap deflection for guidance + yawRate = 40; // Maximum flap deflection for guidance + + canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "DopplerRadar"; + seekerTypes[] = { "DopplerRadar" }; + lockableTypes[] = {"Air"}; + + minimumSpeedFilter = 15; // filter out targets that have a closing velocity less than this + minimumTimeFilter = 0.00005; // filter out targets that are this close to the ground (speed of light) + maxTerrainCheck = 16000; // How far we should check for terrain + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "ZeroEffortMiss"; + navigationTypes[] = { "ZeroEffortMiss" }; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 50; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 2500; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "DIR"; + attackProfiles[] = {"DIR", "LOFT"}; + useModeForAttackProfile = 1; +}; + +class GVAR(type_Refleks) { + enabled = 0; + + pitchRate = 45; // Minium flap deflection for guidance + yawRate = 45; // Maximum flap deflection for guidance + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + showTrail = 1; + + // Guidance type for munitions + defaultSeekerType = "SACLOS"; + seekerTypes[] = { "SACLOS" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "Line"; + navigationTypes[] = { "Line" }; + + lineGainP = 16; + lineGainD = 10.44; + + initialPitch = 2; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 30; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 5000; // Range from the missile which the seeker can visually search + + correctionDistance = 30; // distance from center of crosshair where missile slows down + offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. + + // Attack profile type selection + defaultAttackProfile = "BEAM"; + attackProfiles[] = {"BEAM"}; +}; + +class GVAR(type_S400) { + enabled = 0; + + pitchRate = 25; // Minium flap deflection for guidance + yawRate = 25; // Maximum flap deflection for guidance + + canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "DopplerRadar"; + seekerTypes[] = { "DopplerRadar" }; + lockableTypes[] = {"Air"}; + + minimumSpeedFilter = 5; // filter out targets that have a closing velocity less than this + minimumTimeFilter = 0.000001; // filter out targets that are this close to the ground (speed of light) + maxTerrainCheck = 16000; // How far we should check for terrain + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "ZeroEffortMiss"; + navigationTypes[] = { "ZeroEffortMiss" }; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 50; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 2500; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "DIR"; + attackProfiles[] = {"DIR"}; +}; + +class GVAR(type_Shturm) { + enabled = 0; + + pitchRate = 45; // Minium flap deflection for guidance + yawRate = 45; // Maximum flap deflection for guidance + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + showTrail = 1; + + // Guidance type for munitions + defaultSeekerType = "SACLOS"; + seekerTypes[] = { "SACLOS" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "Line"; + navigationTypes[] = { "Line" }; + + lineGainP = 16; + lineGainD = 10.44; + + initialPitch = 2; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 30; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 4000; // Range from the missile which the seeker can visually search + + offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. + + // Attack profile type selection + defaultAttackProfile = "BEAM"; + attackProfiles[] = {"BEAM"}; +}; + +class GVAR(type_Strela) { + enabled = 0; + + pitchRate = 30; // Minium flap deflection for guidance + yawRate = 30; // Maximum flap deflection for guidance + + canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "IR"; + seekerTypes[] = { "IR" }; + + flareDistanceFilter = 100; + flareAngleFilter = 1.6; // can filter out flares that are >= flareAngleFilter to known target velocity + + defaultSeekerLockMode = "LOBL"; + seekerLockModes[] = { "LOBL" }; + + defaultNavigationType = "ProportionalNavigation"; + navigationTypes[] = { "ProportionalNavigation" }; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 45; // Angle from the shooter's view that can track the missile + seekerAccuracy = 0.6; // seeker accuracy multiplier + + seekerMinRange = 10; + seekerMaxRange = 3700; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "DIR"; + attackProfiles[] = {"DIR"}; +}; + +class GVAR(type_Vikhr) { + enabled = 0; + showTrail = 1; + + pitchRate = 60; // Minium flap deflection for guidance + yawRate = 60; // Maximum flap deflection for guidance + + canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "SACLOS"; + seekerTypes[] = { "SACLOS" }; + + defaultSeekerLockMode = "LOBL"; + seekerLockModes[] = { "LOBL" }; + + defaultNavigationType = "Line"; + navigationTypes[] = { "Line" }; + + lineGainP = 20; + lineGainD = 16; + correctionDistance = 5; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 15; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 30; + seekerMaxRange = 12000; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "BEAM"; + attackProfiles[] = {"BEAM"}; +}; + +class GVAR(type_Vympel) { + enabled = 0; + + pitchRate = 35; // Minium flap deflection for guidance + yawRate = 35; // Maximum flap deflection for guidance + + canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "IR"; + seekerTypes[] = { "IR" }; + + flareDistanceFilter = 50; + flareAngleFilter = 0.8; // can filter out flares that are >= flareAngleFilter to known target velocity + + defaultSeekerLockMode = "LOBL"; + seekerLockModes[] = { "LOBL" }; + + defaultNavigationType = "AugmentedProportionalNavigation"; + navigationTypes[] = { "AugmentedProportionalNavigation" }; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 40; // Angle from the shooter's view that can track the missile + seekerAccuracy = 0.85; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 5000; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "DIR"; + attackProfiles[] = {"DIR"}; +}; \ No newline at end of file diff --git a/addons/missileguidance/CfgWeapons.hpp b/addons/missileguidance/CfgWeapons.hpp index b03628e7776..d88cf27b539 100644 --- a/addons/missileguidance/CfgWeapons.hpp +++ b/addons/missileguidance/CfgWeapons.hpp @@ -2,8 +2,13 @@ class CfgWeapons { class missiles_DAGR; class GVAR(dagr): missiles_DAGR { + EGVAR(laser,canSelect) = 1; // can ace_laser lock (allows switching laser code) + EGVAR(laser,showHud) = 1; // show attack profile / lock on hud + magazines[] = {"6Rnd_ACE_Hydra70_DAGR","12Rnd_ACE_Hydra70_DAGR","24Rnd_ACE_Hydra70_DAGR","PylonRack_6Rnd_ACE_DAGR","PylonRack_12Rnd_ACE_DAGR","PylonRack_24Rnd_ACE_DAGR"}; + + autoFire = 0; canLock = 0; - magazines[] = {"6Rnd_ACE_Hydra70_DAGR","12Rnd_ACE_Hydra70_DAGR","24Rnd_ACE_Hydra70_DAGR"}; + weaponLockSystem = 0; lockingTargetSound[] = {"",0,1}; lockedTargetSound[] = {"",0,1}; }; diff --git a/addons/missileguidance/XEH_PREP.hpp b/addons/missileguidance/XEH_PREP.hpp index 075f2f03c59..daff5b502b5 100644 --- a/addons/missileguidance/XEH_PREP.hpp +++ b/addons/missileguidance/XEH_PREP.hpp @@ -6,6 +6,8 @@ PREP(changeMissileDirection); PREP(checkSeekerAngle); PREP(checkLos); +PREP(dev_ProjectileCamera); + PREP(onFired); PREP(onIncomingMissile); @@ -16,28 +18,45 @@ PREP(doSeekerSearch); PREP(doHandoff); PREP(handleHandoff); +//re-enable after feature merge - PREP(shouldFilterRadarHit); + // Attack Profiles PREP(attackProfile_AIR); PREP(attackProfile_DIR); -PREP(attackProfile_HI); PREP(attackProfile_LIN); -PREP(attackProfile_MID); +PREP(attackProfile_LOFT); PREP(attackProfile_WIRE); PREP(attackProfile_BEAM); +//re-enable after feature merge - PREP(attackProfile_JDAM); // Javelin profiles PREP(attackProfile_JAV_DIR); PREP(attackProfile_JAV_TOP); +PREP(javelin_midCourseTransition); + +// Navigation Profiles +PREP(navigationType_zeroEffortMiss); +PREP(navigationType_augmentedProNav); +PREP(navigationType_proNav); +PREP(navigationType_lineOfSight); +PREP(navigationType_line); +PREP(navigationType_direct); // Seeker search functions PREP(seekerType_SALH); PREP(seekerType_Optic); PREP(seekerType_SACLOS); -PREP(seekerType_ARH); +//re-enable after feature merge - PREP(seekerType_Doppler); +PREP(seekerType_MWR); // Attack Profiles OnFired PREP(wire_onFired); // Seeker OnFired PREP(SACLOS_onFired); -PREP(ahr_onFired); +PREP(mwr_onFired); + +// Navigation OnFired +PREP(proNav_onFired); +PREP(line_onFired); + diff --git a/addons/missileguidance/XEH_postInit.sqf b/addons/missileguidance/XEH_postInit.sqf index eb0fb60abfa..e0fc98ba1ba 100644 --- a/addons/missileguidance/XEH_postInit.sqf +++ b/addons/missileguidance/XEH_postInit.sqf @@ -2,12 +2,10 @@ [QGVAR(handoff), LINKFUNC(handleHandoff)] call CBA_fnc_addEventHandler; -["ACE3 Weapons", QGVAR(cycleFireMode), localize LSTRING(CycleFireMode), -{ +["ACE3 Weapons", QGVAR(cycleFireMode), localize LSTRING(CycleFireMode), { [] call FUNC(cycleAttackProfileKeyDown); false -}, -{ +}, { false }, [15, [false, true, false]], false] call CBA_fnc_addKeybind; //Ctrl+Tab Key diff --git a/addons/missileguidance/XEH_preInit.sqf b/addons/missileguidance/XEH_preInit.sqf index 0798fed2e43..9b1a85e37c7 100644 --- a/addons/missileguidance/XEH_preInit.sqf +++ b/addons/missileguidance/XEH_preInit.sqf @@ -11,4 +11,15 @@ PREP_RECOMPILE_END; // As weapons take config changes, there is little point in being able to disable guidance if (isNil QGVAR(enabled)) then { GVAR(enabled) = 2; }; +GVAR(debug_enableMissileCamera) = false; +GVAR(debug_drawGuidanceInfo) = false; + +#ifdef DRAW_GUIDANCE_INFO +GVAR(debug_drawGuidanceInfo) = true; +#endif + +#ifdef ENABLE_PROJECTILE_CAMERA +GVAR(debug_enableMissileCamera) = true; +#endif + ADDON = true; diff --git a/addons/missileguidance/config.cpp b/addons/missileguidance/config.cpp index e98d99ebcbb..4e1f2e3e1f1 100644 --- a/addons/missileguidance/config.cpp +++ b/addons/missileguidance/config.cpp @@ -15,6 +15,8 @@ class CfgPatches { #include "ACE_GuidanceConfig.hpp" +#include "CfgMissileTypesNato.hpp" +#include "CfgMissileTypesWarsaw.hpp" #include "CfgEventhandlers.hpp" #include "CfgAmmo.hpp" #include "CfgMagazines.hpp" diff --git a/addons/missileguidance/dev/getAmmoProperties.sqf b/addons/missileguidance/dev/getAmmoProperties.sqf new file mode 100644 index 00000000000..9c416c228fd --- /dev/null +++ b/addons/missileguidance/dev/getAmmoProperties.sqf @@ -0,0 +1,26 @@ +#include "..\script_component.hpp" + +private _configs = configProperties [configFile >> "CfgAmmo", QUOTE((isClass _x) && { isClass (_x >> QUOTE(QUOTE(ADDON)))})]; + +private _seekerTypes = createHashMap; +private _navigationTypes = createHashMap; +private _attackProfiles = createHashMap; +{ + private _seekerType = getText (_x >> QUOTE(ADDON) >> "defaultSeekerType"); + private _navigationType = getText (_x >> QUOTE(ADDON) >> "defaultNavigationType"); + private _attackProfile = getText (_x >> QUOTE(ADDON) >> "defaultAttackProfile"); + + private _seekers = _seekerTypes getOrDefault [_seekerType, []]; + private _navigations = _navigationTypes getOrDefault [_navigationType, []]; + private _attacks = _attackProfiles getOrDefault [_attackProfile, []]; + + _seekers pushBack configName _x; + _navigations pushBack configName _x; + _attacks pushBack configName _x; + + _seekerTypes set [_seekerType, _seekers]; + _navigationTypes set [_navigationType, _navigations]; + _attackProfiles set [_attackProfile, _attacks]; +} forEach _configs; + +[_seekerTypes, _navigationTypes, _attackProfiles] diff --git a/addons/missileguidance/functions/fnc_SACLOS_onFired.sqf b/addons/missileguidance/functions/fnc_SACLOS_onFired.sqf index 299ec6f236c..f48b4a95713 100644 --- a/addons/missileguidance/functions/fnc_SACLOS_onFired.sqf +++ b/addons/missileguidance/functions/fnc_SACLOS_onFired.sqf @@ -32,4 +32,3 @@ _seekerStateParams set [2, _animationSourceGun]; _seekerStateParams set [3, _usePilotCamera || { (_shooter isKindOf "Plane") && hasPilotCamera _shooter }]; if ((_shooter isKindOf "Plane") && !hasPilotCamera _shooter) then { WARNING("SACLOS fired from planes without pilot camera unsupported!"); }; - diff --git a/addons/missileguidance/functions/fnc_attackProfile_BEAM.sqf b/addons/missileguidance/functions/fnc_attackProfile_BEAM.sqf index 5aaff9d7f8d..fd86b571045 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_BEAM.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_BEAM.sqf @@ -17,31 +17,26 @@ * Public: No */ params ["_seekerTargetPos", "_args", "_attackProfileStateParams"]; -_args params ["_firedEH"]; +_args params ["_firedEH", "", "", "", "", "_targetData"]; _firedEH params ["_shooter","","","","","","_projectile"]; -_attackProfileStateParams params["_maxCorrectableDistance", "_wireCut", "_randomVector", "_crosshairOffset", "_seekerMaxRangeSqr", "_seekerMinRangeSqr", "_wireCutSource", "_distanceAheadOfMissile"]; +_attackProfileStateParams params ["_maxCorrectableDistance", "_wireCut", "_lastInput", "_crosshairOffset", "_seekerMaxRangeSqr", "_seekerMinRangeSqr", "_wireCutSource", "_distanceAheadOfMissile"]; private _projectilePos = getPosASL _projectile; private _shooterPos = getPosASL _shooter; -private _shooterDir = vectorNormalized(_seekerTargetPos vectorDiff _shooterPos); private _distanceToProjectile = _shooterPos vectorDistanceSqr _projectilePos; -if (_distanceToProjectile > _seekerMaxRangeSqr || { _seekerTargetPos isEqualTo [0, 0, 0] } || { _distanceToProjectile < _seekerMinRangeSqr }) exitWith { - // return position 50m infront of projectile - _projectilePos vectorAdd (_projectile vectorModelToWorld [0, 50, 0]) +if ((_distanceToProjectile > _seekerMaxRangeSqr) || { _wireCut }) exitWith { + // wire snap, random direction + if !(_wireCut) then { + _attackProfileStateParams set [1, true]; + }; + _lastInput }; -private _relativeCorrection = _projectile vectorWorldToModel (_projectilePos vectorDiff _seekerTargetPos); -_relativeCorrection = _relativeCorrection vectorDiff _crosshairOffset; +private _final = _seekerTargetPos vectorAdd _crosshairOffset; +_attackProfileStateParams set [2, _final]; -private _magnitude = vectorMagnitude [_relativeCorrection select 0, 0, _relativeCorrection select 2]; -private _fovImpulse = 1 min (_magnitude / _maxCorrectableDistance); // the simulated impulse for the missile being close to the center of the crosshair +_targetData set [0, _projectilePos vectorFromTo _final]; -// Adjust the impulse due to near-zero values creating wobbly missiles? -private _correction = _fovImpulse; - - -_relativeCorrection = (vectorNormalized _relativeCorrection) vectorMultiply _correction; -private _returnPos = _projectilePos vectorDiff (_projectile vectorModelToWorld _relativeCorrection); -_returnPos vectorAdd (_shooterDir vectorMultiply _distanceAheadOfMissile) +_final diff --git a/addons/missileguidance/functions/fnc_attackProfile_DIR.sqf b/addons/missileguidance/functions/fnc_attackProfile_DIR.sqf index 80499a85da8..d2a2c0616c9 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_DIR.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_DIR.sqf @@ -1,8 +1,8 @@ #include "..\script_component.hpp" /* - * Author: jaynus / nou + * Author: tcvm * Attack profile: DIR - * TODO: falls back to Linear + * Returns target position with no modifications * * Arguments: * 0: Seeker Target PosASL <ARRAY> @@ -18,4 +18,5 @@ * Public: No */ -_this call FUNC(attackProfile_LIN); +params ["_seekerTargetPos"]; +_seekerTargetPos diff --git a/addons/missileguidance/functions/fnc_attackProfile_HI.sqf b/addons/missileguidance/functions/fnc_attackProfile_HI.sqf deleted file mode 100644 index 92413f59d07..00000000000 --- a/addons/missileguidance/functions/fnc_attackProfile_HI.sqf +++ /dev/null @@ -1,21 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: jaynus / nou - * Attack profile: HI - * TODO: falls back to Linear - * - * Arguments: - * 0: Seeker Target PosASL <ARRAY> - * 1: Guidance Arg Array <ARRAY> - * 2: Attack Profile State <ARRAY> - * - * Return Value: - * Missile Aim PosASL <ARRAY> - * - * Example: - * [[1,2,3], [], []] call ace_missileguidance_fnc_attackProfile_HI; - * - * Public: No - */ - -_this call FUNC(attackProfile_LIN); diff --git a/addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf b/addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf index b690ab2075e..64895a3e54a 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf @@ -22,6 +22,9 @@ #define STAGE_COAST 3 #define STAGE_TERMINAL 4 +#define CLIMB_ANGLE 12 +#define ATTACK_ANGLE 2 + params ["_seekerTargetPos", "_args", "_attackProfileStateParams"]; _args params ["_firedEH"]; _firedEH params ["_shooter","","","","","","_projectile"]; @@ -30,6 +33,7 @@ if (_seekerTargetPos isEqualTo [0,0,0]) exitWith {_seekerTargetPos}; if (_attackProfileStateParams isEqualTo []) then { _attackProfileStateParams set [0, STAGE_LAUNCH]; + _attackProfileStateParams set [1, 0]; }; private _shooterPos = getPosASL _shooter; @@ -44,23 +48,28 @@ TRACE_2("",_distanceToTarget,_distanceToShooter); // Add height depending on distance for compensate private _returnTargetPos = _seekerTargetPos; +private _attackDirection = _seekerTargetPos vectorDiff _projectilePos; +private _horizon = velocity _projectile; +_horizon set [2, 0]; +_horizon = vectorNormalized _horizon; +private _attackAngle = acos (_horizon vectorCos _attackDirection); + switch (_attackProfileStateParams select 0) do { case STAGE_LAUNCH: { TRACE_1("STAGE_LAUNCH",""); - if (_distanceToShooter < 10) then { - _returnTargetPos = _seekerTargetPos vectorAdd [0,0,_distanceToTarget*2]; + if (_distanceToShooter < 6) then { + _returnTargetPos = _seekerTargetPos vectorAdd [0,0,5]; } else { _attackProfileStateParams set [0, STAGE_CLIMB]; }; }; case STAGE_CLIMB: { TRACE_1("STAGE_CLIMB",""); - private _cruisAlt = 60 * (_distanceShooterToTarget/2000); - - if ( ((ASLToAGL _projectilePos) select 2) - ((ASLToAGL _seekerTargetPos) select 2) >= _cruisAlt) then { + if (_attackAngle >= ATTACK_ANGLE) then { _attackProfileStateParams set [0, STAGE_TERMINAL]; } else { - _returnTargetPos = _seekerTargetPos vectorAdd [0,0,_distanceToTarget*1.5]; + private _height = _distanceShooterToTarget * tan CLIMB_ANGLE; + _returnTargetPos = _seekerTargetPos vectorAdd [0,0,_height]; }; }; case STAGE_TERMINAL: { @@ -69,5 +78,7 @@ switch (_attackProfileStateParams select 0) do { }; }; +_attackProfileStateParams set [2, _returnTargetPos]; + TRACE_1("Adjusted target position",_returnTargetPos); _returnTargetPos; diff --git a/addons/missileguidance/functions/fnc_attackProfile_JAV_TOP.sqf b/addons/missileguidance/functions/fnc_attackProfile_JAV_TOP.sqf index f1f360e403a..a3ae233eba0 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_JAV_TOP.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_JAV_TOP.sqf @@ -22,6 +22,10 @@ #define STAGE_COAST 3 #define STAGE_TERMINAL 4 +#define CRUISE_ALT 160 +#define CLIMB_ANGLE 22 +#define ATTACK_ANGLE 12 + params ["_seekerTargetPos", "_args", "_attackProfileStateParams"]; _args params ["_firedEH"]; _firedEH params ["_shooter","","","","","","_projectile"]; @@ -30,6 +34,7 @@ if (_seekerTargetPos isEqualTo [0,0,0]) exitWith {_seekerTargetPos}; if (_attackProfileStateParams isEqualTo []) then { _attackProfileStateParams set [0, STAGE_LAUNCH]; + _attackProfileStateParams set [1, 0]; }; private _shooterPos = getPosASL _shooter; @@ -44,39 +49,44 @@ TRACE_2("",_distanceToTarget,_distanceToShooter); // Add height depending on distance for compensate private _returnTargetPos = _seekerTargetPos; +private _attackDirection = _seekerTargetPos vectorDiff _projectilePos; +private _horizon = velocity _projectile; +_horizon set [2, 0]; +_horizon = vectorNormalized _horizon; +private _attackAngle = acos (_horizon vectorCos _attackDirection); + switch( (_attackProfileStateParams select 0) ) do { case STAGE_LAUNCH: { TRACE_1("STAGE_LAUNCH",""); if (_distanceToShooter < 10) then { - _returnTargetPos = _seekerTargetPos vectorAdd [0,0,_distanceToTarget*2]; + _returnTargetPos = _seekerTargetPos vectorAdd [0,0,5]; } else { _attackProfileStateParams set [0, STAGE_CLIMB]; }; }; case STAGE_CLIMB: { TRACE_1("STAGE_CLIMB",""); - private _cruisAlt = 140; - if (_distanceShooterToTarget < 1250) then { - _cruisAlt = 140 * (_distanceShooterToTarget/1250); - TRACE_1("_cruisAlt",_cruisAlt); - }; - if ( ((ASLToAGL _projectilePos) select 2) - ((ASLToAGL _seekerTargetPos) select 2) >= _cruisAlt) then { - if (_cruisAlt < 140) then { - _attackProfileStateParams set [0, STAGE_TERMINAL]; - } else { + private _altitude = (ASLToAGL _projectilePos) select 2; + switch (true) do { + case (_altitude >= CRUISE_ALT): { _attackProfileStateParams set [0, STAGE_COAST]; }; - } else { - _returnTargetPos = _seekerTargetPos vectorAdd [0,0,_distanceToTarget*1.5]; - }; + case (_attackAngle >= ATTACK_ANGLE): { + _attackProfileStateParams set [0, STAGE_TERMINAL]; + }; + default { + private _height = _distanceShooterToTarget * tan CLIMB_ANGLE; + _returnTargetPos = _seekerTargetPos vectorAdd [0,0,_height]; + } + } }; case STAGE_COAST: { TRACE_1("STAGE_COAST",""); - TRACE_1("",((ASLToAGL _projectilePos) select 2) - (( ASLToAGL _seekerTargetPos) select 2)); - if (_distanceToTarget < ( ((ASLToAGL _projectilePos) select 2) - (( ASLToAGL _seekerTargetPos) select 2) ) * 2) then { + TRACE_1("",_attackAngle); + if (_attackAngle >= ATTACK_ANGLE) then { _attackProfileStateParams set [0, STAGE_TERMINAL]; } else { - _returnTargetPos = _seekerTargetPos vectorAdd [0,0,(_projectilePos select 2)]; + _returnTargetPos = _seekerTargetPos vectorAdd [0,0,(_projectilePos select 2) min CRUISE_ALT]; }; }; case STAGE_TERMINAL: { @@ -86,5 +96,7 @@ switch( (_attackProfileStateParams select 0) ) do { }; }; +_attackProfileStateParams set [2, _returnTargetPos]; + TRACE_1("Adjusted target position",_returnTargetPos); _returnTargetPos; diff --git a/addons/missileguidance/functions/fnc_attackProfile_LIN.sqf b/addons/missileguidance/functions/fnc_attackProfile_LIN.sqf index e346b16eb66..cc823b1e8c3 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_LIN.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_LIN.sqf @@ -18,8 +18,10 @@ */ params ["_seekerTargetPos", "_args"]; -_args params ["_firedEH"]; +_args params ["_firedEH", "_launchParams"]; _firedEH params ["_shooter","","","","","","_projectile"]; +_launchParams params ["","_targetLaunchParams"]; +_targetLaunchParams params ["", "", "_launchPos"]; if (_seekerTargetPos isEqualTo [0,0,0]) exitWith {_seekerTargetPos}; @@ -30,29 +32,31 @@ private _distanceToTarget = _projectilePos vectorDistance _seekerTargetPos; private _distanceToShooter = _projectilePos vectorDistance _shooterPos; private _distanceShooterToTarget = _shooterPos vectorDistance _seekerTargetPos; +private _ttgo = _distanceToTarget / (vectorMagnitude velocity _projectile); + TRACE_2("",_distanceToTarget,_distanceToShooter); // Add height depending on distance for compensate private _addHeight = [0,0,0]; -// Always climb an arc on initial launch if we are close to the round -if ((((ASLtoAGL _projectilePos) select 2) < 5) && {_distanceToShooter < 15}) then { - _addHeight = _addHeight vectorAdd [0,0,_distanceToTarget]; - TRACE_1("climb - near shooter",_addHeight); +private _2dDistance = (800 + (_projectilePos distance2D _launchPos)) / (_projectilePos distance2D _seekerTargetPos); + +if (_2dDistance <= 1) then { + _addHeight = [0, 0, (_projectilePos#2) + 8]; } else { - // If we are below the target, increase the climbing arc - if (((_projectilePos select 2) < (_seekerTargetPos select 2)) && {_distanceToTarget > 100}) then { - _addHeight = _addHeight vectorAdd [0,0, ((_seekerTargetPos select 2) - (_projectilePos select 2))]; - TRACE_1("climb - below target and far",_addHeight); + // Always climb an arc on initial launch if we are close to the round + if ((((ASLToAGL _projectilePos) select 2) < 5) && {_distanceToShooter < 15}) then { + _addHeight = _addHeight vectorAdd [0,0,_distanceToTarget]; + TRACE_1("climb - near shooter",_addHeight); + } else { + // If we are below the target, increase the climbing arc + if (((_projectilePos select 2) < (_seekerTargetPos select 2)) && {_distanceToTarget > 100}) then { + _addHeight = _addHeight vectorAdd [0,0, ((_seekerTargetPos select 2) - (_projectilePos select 2))]; + TRACE_1("climb - below target and far",_addHeight); + }; }; }; -// Projectile above target -if ((_projectilePos select 2) > (_seekerTargetPos select 2)) then { - TRACE_1("above - far",_addHeight); - _addHeight = _addHeight vectorAdd [0,0, _distanceToTarget / 50]; -}; - private _returnTargetPos = _seekerTargetPos vectorAdd _addHeight; TRACE_2("Adjusted target position",_returnTargetPos,_addHeight); diff --git a/addons/missileguidance/functions/fnc_attackProfile_LOFT.sqf b/addons/missileguidance/functions/fnc_attackProfile_LOFT.sqf new file mode 100644 index 00000000000..934ac04123a --- /dev/null +++ b/addons/missileguidance/functions/fnc_attackProfile_LOFT.sqf @@ -0,0 +1,53 @@ +#include "..\script_component.hpp" +/* + * Author: jaynus / nou + * Attack profile: AIR + * TODO: falls back to Linear + * + * Arguments: + * 0: Seeker Target PosASL <ARRAY> + * 1: Guidance Arg Array <ARRAY> + * 2: Seeker State <ARRAY> + * + * Return Value: + * Missile Aim PosASL <ARRAY> + * + * Example: + * [[1,2,3], [], []] call ace_missileguidance_fnc_attackProfile_AIR; + * + * Public: No + */ + +params ["_seekerTargetPos", "_args"]; +_args params ["_firedEH", "_launchParams", "_flightParams", "_seekerParams", "_stateParams"]; +_firedEH params ["_shooter","","","","_ammo","","_projectile"]; +_launchParams params ["_shooter","_targetLaunchParams","_seekerType","_attackProfile","_lockMode","_laserInfo","_navigationType"]; +_targetLaunchParams params ["_target", "_targetPos", "_launchPos", "_launchDir", "_launchTime"]; +_flightParams params ["_pitchRate", "_yawRate", "_isBangBangGuidance"]; +_stateParams params ["_lastRunTime", "_seekerStateParams", "_attackProfileStateParams", "_lastKnownPosState","_navigationParams"]; +_seekerParams params ["_seekerAngle", "_seekerAccuracy", "_seekerMaxRange", "_seekerMinRange"]; + +if (_seekerTargetPos isEqualTo [0, 0, 0]) exitWith { + _seekerTargetPos +}; + +private _projectilePos = getPosASLVisual _projectile; +private _distanceToTarget2d = _projectilePos distance2D _seekerTargetPos; + +private _closingRate = vectorMagnitude velocity _projectile; +private _timeToGo = (_projectilePos distance _seekerTargetPos) / _closingRate; + +// we could do stuff like desired attack angle, but I'm not going that far today +private _los = vectorNormalized (_seekerTargetPos vectorDiff _projectilePos); + +private _angleToTarget = acos ((vectorDir _projectile) vectorCos _los); +private _atMinRotationAngle = _angleToTarget >= (0.5 * _pitchRate * _timeToGo); + +private _returnTargetPos = _seekerTargetPos; + +if (!_atMinRotationAngle && _distanceToTarget2d >= 500 && _timeToGo >= 10) then { + // 10 degree pitch up + _returnTargetPos = _seekerTargetPos vectorAdd [0, 0, (_projectilePos distance _seekerTargetPos) * sin 10]; +}; + +_returnTargetPos diff --git a/addons/missileguidance/functions/fnc_attackProfile_MID.sqf b/addons/missileguidance/functions/fnc_attackProfile_MID.sqf deleted file mode 100644 index 2ca9eef77f3..00000000000 --- a/addons/missileguidance/functions/fnc_attackProfile_MID.sqf +++ /dev/null @@ -1,21 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: jaynus / nou - * Attack profile: MID - * TODO: falls back to Linear - * - * Arguments: - * 0: Seeker Target PosASL <ARRAY> - * 1: Guidance Arg Array <ARRAY> - * 2: Attack Profile State <ARRAY> - * - * Return Value: - * Missile Aim PosASL <ARRAY> - * - * Example: - * [[1,2,3], [], []] call ace_missileguidance_fnc_attackProfile_MID; - * - * Public: No - */ - -_this call FUNC(attackProfile_LIN); diff --git a/addons/missileguidance/functions/fnc_attackProfile_WIRE.sqf b/addons/missileguidance/functions/fnc_attackProfile_WIRE.sqf index 443fe1bb975..1733ad10153 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_WIRE.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_WIRE.sqf @@ -17,47 +17,27 @@ * Public: No */ params ["_seekerTargetPos", "_args", "_attackProfileStateParams"]; -_args params ["_firedEH"]; +_args params ["_firedEH", "", "", "", "", "_targetData"]; _firedEH params ["_shooter","","","","","","_projectile"]; -_attackProfileStateParams params["_maxCorrectableDistance", "_wireCut", "_randomVector", "_crosshairOffset", "_seekerMaxRangeSqr", "_seekerMinRangeSqr", "_wireCutSource", "_distanceAheadOfMissile"]; +_attackProfileStateParams params ["_maxCorrectableDistance", "_wireCut", "_lastInput", "_crosshairOffset", "_seekerMaxRangeSqr", "_seekerMinRangeSqr", "_wireCutSource", "_distanceAheadOfMissile"]; private _projectilePos = getPosASL _projectile; private _shooterPos = getPosASL _shooter; -private _shooterDir = vectorNormalized(_seekerTargetPos vectorDiff _shooterPos); private _distanceToProjectile = _shooterPos vectorDistanceSqr _projectilePos; if ((_distanceToProjectile > _seekerMaxRangeSqr) || { _wireCut }) exitWith { // wire snap, random direction - if (_randomVector isEqualTo [0, 0, 0]) then { - _randomVector = RANDOM_VECTOR_3D vectorMultiply 300; + if !(_wireCut) then { _attackProfileStateParams set [1, true]; - _attackProfileStateParams set [2, _randomVector]; - - playSound3D ["a3\sounds_f\air\sfx\SL_rope_break.wss", objNull, false, AGLtoASL (_shooter modelToWorld _wireCutSource), 5, 1, 150]; + playSound3D ["a3\sounds_f\air\sfx\SL_rope_break.wss", objNull, false, AGLToASL (_shooter modelToWorld _wireCutSource), 5, 1, 150]; }; - _projectilePos vectorAdd _randomVector -}; - -if (_seekerTargetPos isEqualTo [0, 0, 0] || { _distanceToProjectile < _seekerMinRangeSqr }) exitWith { - // cut wire if its caught on terrain - /*if (lineIntersectsSurfaces [getPosASL _shooter, _projectilePos, _shooter] isNotEqualTo []) then { - _attackProfileStateParams set [1, true]; - };*/ - // return position 50m infront of projectile - _projectilePos vectorAdd (_projectile vectorModelToWorld [0, 50, 0]) + _lastInput }; -private _relativeCorrection = _projectile vectorWorldToModel (_projectilePos vectorDiff _seekerTargetPos); -_relativeCorrection = _relativeCorrection vectorDiff _crosshairOffset; - -private _magnitude = vectorMagnitude [_relativeCorrection select 0, 0, _relativeCorrection select 2]; -private _fovImpulse = 1 min (_magnitude / _maxCorrectableDistance); // the simulated impulse for the missile being close to the center of the crosshair - -// Adjust the impulse due to near-zero values creating wobbly missiles? -private _correction = _fovImpulse; +private _final = _seekerTargetPos vectorAdd _crosshairOffset; +_attackProfileStateParams set [2, _final]; +_targetData set [0, _projectilePos vectorFromTo _final]; -_relativeCorrection = (vectorNormalized _relativeCorrection) vectorMultiply _correction; -private _returnPos = _projectilePos vectorDiff (_projectile vectorModelToWorld _relativeCorrection); -_returnPos vectorAdd (_shooterDir vectorMultiply _distanceAheadOfMissile) +_final diff --git a/addons/missileguidance/functions/fnc_changeMissileDirection.sqf b/addons/missileguidance/functions/fnc_changeMissileDirection.sqf index 21884c16938..77858401ba8 100644 --- a/addons/missileguidance/functions/fnc_changeMissileDirection.sqf +++ b/addons/missileguidance/functions/fnc_changeMissileDirection.sqf @@ -2,6 +2,7 @@ /* * Author: jaynus / nou * Change a projectile's direction, maintaing speed + * No longer used in guidancePFH, kept for backwards compatibility * * Arguments: * 0: Projectile <OBJECT> @@ -16,10 +17,9 @@ * Public: No */ -params ["_projectile", "_v"]; +params ["_projectile", "_pitch", "_yaw", "_roll"]; -private _l = sqrt ((_v select 0) ^ 2 + (_v select 1) ^ 2); -private _r = -(_v select 2) / _l; +private _dir = [sin _yaw * cos _pitch, cos _yaw * cos _pitch, sin _pitch]; +private _up = [[sin _roll, -sin _pitch, cos _roll * cos _pitch], -_yaw] call BIS_fnc_rotateVector2D; -_projectile setVectorDirAndUp [ _v, [(_v select 0) * _r,(_v select 1) * _r, _l] ]; -_projectile setVelocity (_v vectorMultiply (vectorMagnitude (velocity _projectile))); +_projectile setVectorDirAndUp [_dir, _up]; diff --git a/addons/missileguidance/functions/fnc_checkLos.sqf b/addons/missileguidance/functions/fnc_checkLos.sqf index 1fadc5510e8..152c7c24074 100644 --- a/addons/missileguidance/functions/fnc_checkLos.sqf +++ b/addons/missileguidance/functions/fnc_checkLos.sqf @@ -25,7 +25,7 @@ if (_checkVisibilityTest) exitWith { _visibility > 0.001 }; if ((isNil "_seeker") || {isNil "_target"}) exitWith { - ERROR_2("nil",_seeker,_target); + ERROR_2("nil [%1]->[%2]",_seeker,_target); false }; @@ -34,13 +34,12 @@ private _targetAimPos = aimPos _target; private _seekerPos = getPosASL _seeker; private _return = true; -if (!((terrainIntersectASL [_seekerPos, _targetPos]) && {terrainIntersectASL [_seekerPos, _targetAimPos]})) then { +if ((terrainIntersectASL [_seekerPos, _targetPos]) && {terrainIntersectASL [_seekerPos, _targetAimPos]}) then { + _return = false; +} else { if (lineIntersects [_seekerPos, _targetPos, _seeker, _target]) then { _return = false; }; -} else { - _return = false; }; _return - diff --git a/addons/missileguidance/functions/fnc_cycleAttackProfileKeyDown.sqf b/addons/missileguidance/functions/fnc_cycleAttackProfileKeyDown.sqf index 2263716724a..f8494e474c5 100644 --- a/addons/missileguidance/functions/fnc_cycleAttackProfileKeyDown.sqf +++ b/addons/missileguidance/functions/fnc_cycleAttackProfileKeyDown.sqf @@ -76,7 +76,7 @@ private _nextFireMode = _attackProfiles select _index; TRACE_4("",_currentFireMode,_nextFireMode,_index,_attackProfiles); -private _currentFireMode = if (_useModeForAttackProfile) then { +if (_useModeForAttackProfile) then { TRACE_2("setting fire mode",_weaponStateToken,_nextFireMode); { _x params ["_xIndex", "", "_xWeapon", "", "_xMode"]; diff --git a/addons/missileguidance/functions/fnc_dev_ProjectileCamera.sqf b/addons/missileguidance/functions/fnc_dev_ProjectileCamera.sqf new file mode 100644 index 00000000000..bf3a5af67c5 --- /dev/null +++ b/addons/missileguidance/functions/fnc_dev_ProjectileCamera.sqf @@ -0,0 +1,61 @@ +#include "..\script_component.hpp" +/* + * Author: tcvm + * tracks a projectile until it explodes + * + * Arguments: + * None + * + * Return Value: + * None + * + * Public: No + */ +params ["_projectile"]; + +private _camera = "camera" camCreate getPosATL _projectile; +_camera camPrepareFov 0.7; +_camera cameraEffect ["internal", "back"]; + +_camera camCommitPrepared 0; + +GVAR(debug_camera_close) = false; +private _displayEH = (findDisplay 46) displayAddEventHandler ["KeyDown", { + params ["_displayorcontrol", "_key", "_shift", "_ctrl", "_alt"]; + GVAR(debug_camera_close) = (_key == 1); + true +}]; + +[{ + params ["_args", "_pfh"]; + _args params ["_projectile", "_camera", "_projectilePos", "_displayEH"]; + if (!alive _projectile || GVAR(debug_camera_close)) exitWith { + private _delay = 1.5; + if (GVAR(debug_camera_close)) then { + _delay = 0; + }; + + (findDisplay 46) displayRemoveEventHandler ["KeyDown", _displayEH]; + + [{ + params ["_camera"]; + + _camera cameraEffect ["terminate", "back"]; + _camera camCommitPrepared 0; + camDestroy _camera; + }, [_camera], _delay] call CBA_fnc_waitAndExecute; + + _camera camPrepareTarget _projectilePos; + _camera camCommitPrepared 0; + + [_pfh] call CBA_fnc_removePerFrameHandler; + }; + + private _currentProjectilePos = getPosATLVisual _projectile; + + _camera camPrepareTarget _projectile; + _camera camPrepareRelPos [0, -5, 1]; + _camera camCommitPrepared 0; + + _args set [2, getPosATL _projectile]; +}, 0, [_projectile, _camera, getPosATL _projectile, _displayEH]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/missileguidance/functions/fnc_doAttackProfile.sqf b/addons/missileguidance/functions/fnc_doAttackProfile.sqf index cafbadf69c6..d6dde00f91b 100644 --- a/addons/missileguidance/functions/fnc_doAttackProfile.sqf +++ b/addons/missileguidance/functions/fnc_doAttackProfile.sqf @@ -22,18 +22,17 @@ _args params ["", "_launchParams"]; _launchParams params ["", "", "", "_attackProfileName"]; private _attackProfileFunction = getText (configFile >> QGVAR(AttackProfiles) >> _attackProfileName >> "functionName"); - private _attackProfilePos = _this call (missionNamespace getVariable _attackProfileFunction); if ((isNil "_attackProfilePos") || {_attackProfilePos isEqualTo [0,0,0]}) exitWith { - ERROR_1("attack profile returned bad pos",_attackProfilePos); + // ERROR_2("attack profile [%1] returned bad pos %2",_attackProfileName,_attackProfilePos); [0,0,0] }; -#ifdef DRAW_GUIDANCE_INFO -drawLine3D [(ASLtoAGL _attackProfilePos), (ASLtoAGL _seekerTargetPos), [0,1,1,1]]; -drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [0,0,1,1], ASLtoAGL _attackProfilePos, 0.5, 0.5, 0, _attackProfileName, 1, 0.025, "TahomaB"]; -#endif +if (GVAR(debug_drawGuidanceInfo)) then { + drawLine3D [(ASLToAGL _attackProfilePos), (ASLToAGL _seekerTargetPos), [0,1,1,1]]; + drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [0,0,1,1], ASLToAGL _attackProfilePos, 0.5, 0.5, 0, _attackProfileName, 1, 0.025, "TahomaB"]; +}; TRACE_2("return",_attackProfilePos,_attackProfileName); _attackProfilePos; diff --git a/addons/missileguidance/functions/fnc_doSeekerSearch.sqf b/addons/missileguidance/functions/fnc_doSeekerSearch.sqf index 6008725b4c0..fe915d1bb4f 100644 --- a/addons/missileguidance/functions/fnc_doSeekerSearch.sqf +++ b/addons/missileguidance/functions/fnc_doSeekerSearch.sqf @@ -30,9 +30,9 @@ if ((isNil "_seekerTargetPos") || {_seekerTargetPos isEqualTo [0,0,0]}) then { / if (_seekLastTargetPos && {_lastKnownPos isNotEqualTo [0,0,0]}) then { // if enabled for the ammo, use last known position if we have one stored TRACE_2("seeker returned bad pos - using last known",_seekLastTargetPos,_lastKnownPos); _seekerTargetPos = _lastKnownPos; - #ifdef DRAW_GUIDANCE_INFO - drawIcon3D ["\A3\ui_f\data\map\markers\military\unknown_CA.paa", [1,1,0,1], ASLtoAGL _lastKnownPos, 0.25, 0.25, 0, "LastKnownPos", 1, 0.02, "TahomaB"]; - #endif + if (GVAR(debug_drawGuidanceInfo)) then { + drawIcon3D ["\A3\ui_f\data\map\markers\military\unknown_CA.paa", [1,1,0,1], ASLToAGL _lastKnownPos, 0.25, 0.25, 0, "LastKnownPos", 1, 0.02, "TahomaB"]; + }; } else { TRACE_1("seeker returned no pos",_seekerTargetPos); _seekerTargetPos = [0,0,0]; @@ -44,9 +44,9 @@ if ((isNil "_seekerTargetPos") || {_seekerTargetPos isEqualTo [0,0,0]}) then { / }; }; -#ifdef DRAW_GUIDANCE_INFO -drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [0,1,0,1], ASLtoAGL _seekerTargetPos, 0.5, 0.5, 0, _seekerTypeName, 1, 0.025, "TahomaB"]; -#endif +if (GVAR(debug_drawGuidanceInfo)) then { + drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [0,1,0,1], ASLToAGL _seekerTargetPos, 0.5, 0.5, 0, _seekerTypeName, 1, 0.025, "TahomaB"]; +}; TRACE_2("return",_seekerTargetPos,_seekerTypeName); _seekerTargetPos; diff --git a/addons/missileguidance/functions/fnc_guidancePFH.sqf b/addons/missileguidance/functions/fnc_guidancePFH.sqf index 0620e9e3c03..82d3d57a35f 100644 --- a/addons/missileguidance/functions/fnc_guidancePFH.sqf +++ b/addons/missileguidance/functions/fnc_guidancePFH.sqf @@ -15,100 +15,192 @@ * * Public: No */ +#define TRAIL_COLOUR(multiplier) [1 * multiplier, 1 * multiplier, 0.3 * multiplier, 0.7 * multiplier] BEGIN_COUNTER(guidancePFH); -#define TIMESTEP_FACTOR 0.01 - params ["_args", "_pfID"]; -_args params ["_firedEH", "_launchParams", "_flightParams", "_seekerParams", "_stateParams"]; +_args params ["_firedEH", "_launchParams", "_flightParams", "_seekerParams", "_stateParams", "_targetData", "_navigationStateParams"]; _firedEH params ["_shooter","","","","_ammo","","_projectile"]; -_launchParams params ["","_targetLaunchParams"]; -_stateParams params ["_lastRunTime", "_seekerStateParams", "_attackProfileStateParams", "_lastKnownPosState"]; +_launchParams params ["","_targetLaunchParams","","","","","_navigationType"]; +_stateParams params ["_lastRunTime", "_seekerStateParams", "_attackProfileStateParams", "_lastKnownPosState", "_navigationParameters", "_guidanceParameters"]; +_navigationStateParams params ["_currentState", "_navigationStateData"]; +_flightParams params ["_pitchRate", "_yawRate", "_isBangBangGuidance", "_stabilityCoefficient", "_showTrail"]; if (!alive _projectile || isNull _projectile || isNull _shooter) exitWith { [_pfID] call CBA_fnc_removePerFrameHandler; END_COUNTER(guidancePFH); }; -private _runtimeDelta = diag_tickTime - _lastRunTime; -private _adjustTime = 1; - -if (accTime > 0) then { - _adjustTime = 1/accTime; - _adjustTime = _adjustTime * (_runtimeDelta / TIMESTEP_FACTOR); - TRACE_4("Adjust timing",1/accTime,_adjustTime,_runtimeDelta,(_runtimeDelta / TIMESTEP_FACTOR)); -} else { - _adjustTime = 0; +if (_showTrail) then { + drop ["\a3\data_f\kouleSvetlo", "", "Billboard", 100, 0.03, _projectile modelToWorld [0, 0, 0], + [0, 0, 0], 0, 1.25, 1, 0.05, [0.5], [TRAIL_COLOUR(1)], [0], 0, 0, "", "", "", 0, false, -1, [TRAIL_COLOUR(10000)]]; }; -private _minDeflection = ((_flightParams select 0) - ((_flightParams select 0) * _adjustTime)) max 0; -private _maxDeflection = (_flightParams select 1) * _adjustTime; -// private _incDeflection = _flightParams select 2; // todo - -private _projectilePos = getPosASL _projectile; +private _timestep = diag_deltaTime * accTime; // Run seeker function: -private _seekerTargetPos = [[0,0,0], _args, _seekerStateParams, _lastKnownPosState] call FUNC(doSeekerSearch); - +private _seekerTargetPos = [[0,0,0], _args, _seekerStateParams, _lastKnownPosState, _timestep] call FUNC(doSeekerSearch); // Run attack profile function: -private _profileAdjustedTargetPos = [_seekerTargetPos, _args, _attackProfileStateParams] call FUNC(doAttackProfile); +_seekerTargetPos = AGLToASL ASLToAGL _seekerTargetPos; +private _profileAdjustedTargetPos = [_seekerTargetPos, _args, _attackProfileStateParams, _timestep] call FUNC(doAttackProfile); + +private _projectilePos = getPosASLVisual _projectile; +_targetData set [1, _projectilePos vectorFromTo _profileAdjustedTargetPos]; // If we have no seeker target, then do not change anything // If there is no deflection on the missile, this cannot change and therefore is redundant. Avoid calculations for missiles without any deflection -if ((_minDeflection != 0 || {_maxDeflection != 0}) && {_profileAdjustedTargetPos isNotEqualTo [0,0,0]}) then { +if ((_pitchRate != 0 || {_yawRate != 0}) && {_profileAdjustedTargetPos isNotEqualTo [0,0,0]}) then { + private _navigationFunction = getText (configFile >> QGVAR(NavigationTypes) >> _navigationType >> "functionName"); + if (_navigationStateData isNotEqualTo []) then { + (_navigationStateData select _currentState) params ["_transitionCondition"]; + private _transition = ([_args, _timestep] call (missionNamespace getVariable [_transitionCondition, { false }])); + if (_transition) then { + _currentState = _currentState + 1; + _navigationStateParams set [0, _currentState]; + }; - private _targetVector = _projectilePos vectorFromTo _profileAdjustedTargetPos; - private _adjustVector = _targetVector vectorDiff (vectorDir _projectile); - _adjustVector params ["_adjustVectorX", "_adjustVectorY", "_adjustVectorZ"]; + _navigationType = (_navigationStateData select _currentState) select 1; + _navigationFunction = getText (configFile >> QGVAR(NavigationTypes) >> _navigationType >> "functionName"); - private _yaw = 0; - private _pitch = 0; - private _roll = 0; + _navigationParameters = (_navigationStateData select _currentState) select 2; + _stateParams set [4, _navigationParameters]; + }; + private _commandedAcceleration = [_args, _timestep, _seekerTargetPos, _profileAdjustedTargetPos, _targetData, _navigationParameters] call (missionNamespace getVariable _navigationFunction); + + if (isNil "_commandedAcceleration") exitWith { + systemChat format ["Error in %1 Missile Type %2 Seeker Pos %3", _navigationFunction, typeOf _projectile, _seekerTargetPos]; + ERROR_MSG_3("_commandedAcceleration is nil! Guidance cancelled [%1 %2 %3]",_navigationFunction,typeOf _projectile,_seekerTargetPos); + }; - if (_adjustVectorX < 0) then { - _yaw = - ( (_minDeflection max ((abs _adjustVectorX) min _maxDeflection) ) ); - } else { - if (_adjustVectorX > 0) then { - _yaw = ( (_minDeflection max (_adjustVectorX min _maxDeflection) ) ); - }; + if (GVAR(debug_drawGuidanceInfo)) then { + private _projectilePosAGL = ASLToAGL _projectilePos; + private _cmdAccelLocal = _projectile vectorWorldToModelVisual _commandedAcceleration; + drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,0,1], _projectilePosAGL vectorAdd [0, 0, 1], 0.75, 0.75, 0, format ["cmdPitch: %1 cmdYaw %2", _cmdAccelLocal#2, _cmdAccelLocal#0], 1, 0.025, "TahomaB"]; + drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,1,0,1], _projectilePosAGL vectorAdd [0, 0, 2], 0.75, 0.75, 0, _navigationType, 1, 0.025, "TahomaB"]; + drawLine3D [_projectilePosAGL, _projectilePosAGL vectorAdd _commandedAcceleration, [1, 0, 1, 1]]; }; - if (_adjustVectorY < 0) then { - _roll = - ( (_minDeflection max ((abs _adjustVectorY) min _maxDeflection) ) ); - } else { - if (_adjustVectorY > 0) then { - _roll = ( (_minDeflection max (_adjustVectorY min _maxDeflection) ) ); + + // activate missile servos and change direction + if (!isGamePaused && accTime > 0) then { + _guidanceParameters params ["_yaw", "_roll", "_pitch"]; + + _commandedAcceleration = _projectile vectorWorldToModelVisual _commandedAcceleration; + _commandedAcceleration params ["_yawChange", "", "_pitchChange"]; + + if (isNil "_yawChange") then { + _yawChange = 0; }; - }; - if (_adjustVectorZ < 0) then { - _pitch = - ( (_minDeflection max ((abs _adjustVectorZ) min _maxDeflection) ) ); - } else { - if (_adjustVectorZ > 0) then { - _pitch = ( (_minDeflection max (_adjustVectorZ min _maxDeflection) ) ); + if (isNil "_pitchChange") then { + _pitchChange = 0; }; - }; - private _finalAdjustVector = [_yaw, _roll, _pitch]; - TRACE_3("",_pitch,_yaw,_roll); - TRACE_3("",_targetVector,_adjustVector,_finalAdjustVector); + private _clampedPitch = (_pitchChange min _pitchRate) max -_pitchRate; + private _clampedYaw = (_yawChange min _yawRate) max -_yawRate; + + // controls are either on or off, no proportional + if (_isBangBangGuidance) then { + private _pitchSign = if (_clampedPitch == 0) then { + 0 + } else { + _clampedPitch / abs _clampedPitch + }; + private _yawSign = if (_clampedYaw == 0) then { + 0 + } else { + _clampedYaw / abs _clampedYaw + }; + _clampedPitch = _pitchSign * _pitchRate; + _clampedYaw = _yawSign * _yawRate; + }; + + TRACE_9("pitch/yaw/roll",_pitch,_yaw,_roll,_yawChange,_pitchChange,_pitchRate,_yawRate,_clampedPitch,_clampedYaw); + // directional stability + private _localVelocity = _projectile vectorWorldToModelVisual (velocity _projectile); + + private _velocityAngleYaw = (_localVelocity#0) atan2 (_localVelocity#1); + private _velocityAnglePitch = (_localVelocity#2) atan2 (_localVelocity#1); + + // bastardized version of direction stability https://en.wikipedia.org/wiki/Directional_stability#Steering_forces + private _forceYaw = _stabilityCoefficient * _velocityAngleYaw + _clampedYaw; + private _forcePitch = _stabilityCoefficient * _velocityAnglePitch + _clampedPitch; + + _pitch = _pitch + _forcePitch * _timestep; + _yaw = _yaw + _forceYaw * _timestep; - if (accTime > 0) then { - private _changeVector = (vectorDir _projectile) vectorAdd _finalAdjustVector; - TRACE_2("",_projectile,_changeVector); - [_projectile, _changeVector] call FUNC(changeMissileDirection); + TRACE_3("new pitch/yaw/roll",_pitch,_yaw,_roll); + + private _multiplyQuat = { + params ["_qLHS", "_qRHS"]; + _qLHS params ["_lhsX", "_lhsY", "_lhsZ", "_lhsW"]; + _qRHS params ["_rhsX", "_rhsY", "_rhsZ", "_rhsW"]; + + private _lhsImaginary = [_lhsX, _lhsY, _lhsZ]; + private _rhsImaginary = [_rhsX, _rhsY, _rhsZ]; + + private _scalar = _lhsW * _rhsW - (_lhsImaginary vectorDotProduct _rhsImaginary); + private _imginary = (_rhsImaginary vectorMultiply _lhsW) vectorAdd (_lhsImaginary vectorMultiply _rhsW) vectorAdd (_lhsImaginary vectorCrossProduct _rhsImaginary); + + _imginary + [_scalar] + }; + + private _multiplyVector = { + params ["_quaternion", "_vector"]; + + private _real = _quaternion#3; + private _imaginary = [ + _quaternion#0, + _quaternion#1, + _quaternion#2 + ]; + + private _vectorReturn = _vector vectorAdd (( + _imaginary vectorCrossProduct ( + (_imaginary vectorCrossProduct _vector) vectorAdd ( + _vector vectorMultiply _real + ) + ) + ) vectorMultiply 2); + + _vectorReturn + }; + + private _quaternion = [0, 0, 0, 1]; + + private _temp = [0, 0, sin (-_yaw / 2), cos (-_yaw / 2)]; + _quaternion = [_quaternion, _temp] call _multiplyQuat; + + _temp = [sin (_pitch / 2), 0, 0, cos (_pitch / 2)]; + _quaternion = [_quaternion, _temp] call _multiplyQuat; + + private _dir = [_quaternion, [0, 1, 0]] call _multiplyVector; + private _up = [_quaternion, [0, 0, 1]] call _multiplyVector; + + _projectile setVectorDirAndUp [_dir, _up]; + + _guidanceParameters set [0, _yaw]; + _guidanceParameters set [2, _pitch]; + + _stateParams set [5, _guidanceParameters]; }; + + _stateParams set [4, _navigationParameters]; + _args set [4, _stateParams]; }; -#ifdef DRAW_GUIDANCE_INFO -TRACE_3("",_projectilePos,_seekerTargetPos,_profileAdjustedTargetPos); -drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,0,1], ASLtoAGL _projectilePos, 0.75, 0.75, 0, _ammo, 1, 0.025, "TahomaB"]; +if (GVAR(debug_drawGuidanceInfo)) then { + TRACE_3("",_projectilePos,_seekerTargetPos,_profileAdjustedTargetPos); + drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,0,1], ASLToAGL _projectilePos, 0.75, 0.75, 0, _ammo, 1, 0.025, "TahomaB"]; -private _ps = "#particlesource" createVehicleLocal (ASLtoAGL _projectilePos); -_PS setParticleParams [["\A3\Data_f\cl_basic", 8, 3, 1], "", "Billboard", 1, 3.0141, [0, 0, 2], [0, 0, 0], 1, 1.275, 1, 0, [1, 1], [[1, 0, 0, 1], [1, 0, 0, 1], [1, 0, 0, 1]], [1], 1, 0, "", "", nil]; -_PS setDropInterval 3.0; -#endif + if (!isGamePaused && accTime > 0) then { + private _ps = "#particlesource" createVehicleLocal (ASLToAGL _projectilePos); + _PS setParticleParams [["\A3\Data_f\cl_basic", 8, 3, 1], "", "Billboard", 1, 3.0141, [0, 0, 0], [0, 0, 0], 1, 1.275, 1, 0, [1, 1], [[1, 0, 0, 1], [1, 0, 0, 1], [1, 0, 0, 1]], [1], 1, 0, "", "", nil]; + _PS setDropInterval 1.0; + }; + + drawLine3D [ASLToAGL _projectilePos, (ASLToAGL _projectilePos) vectorAdd velocity _projectile, [1, 1, 1, 1]]; +}; _stateParams set [0, diag_tickTime]; END_COUNTER(guidancePFH); - diff --git a/addons/missileguidance/functions/fnc_javelin_midCourseTransition.sqf b/addons/missileguidance/functions/fnc_javelin_midCourseTransition.sqf new file mode 100644 index 00000000000..58995dee31d --- /dev/null +++ b/addons/missileguidance/functions/fnc_javelin_midCourseTransition.sqf @@ -0,0 +1,48 @@ +#include "..\script_component.hpp" +/* + * Author: tcvm + * Condition to switch to next navigation profile + * + * Arguments: + * Guidance Arg Array <ARRAY> + * + * Return Value: + * None + * + * Example: + * [] call ace_missileguidance_fnc_javelin_midCourseTransition + * + * Public: No + */ +#define STAGE_LAUNCH 1 +#define STAGE_CLIMB 2 +#define STAGE_COAST 3 +#define STAGE_TERMINAL 4 + +#define REQUIRED_STABLE_TIME 0.2 +#define REQUIRED_ANGLE 1 + +params ["_args", "_timestep"]; +_args params ["_firedEH", "_launchParams", "_flightParams", "_seekerParams", "_stateParams", "_targetData", "_navigationStateData"]; +_firedEH params ["_shooter","","","","_ammo","","_projectile"]; +_launchParams params ["_shooter","_targetLaunchParams","_seekerType","_attackProfile","_lockMode","_laserInfo","_navigationType"]; +_targetLaunchParams params ["_target", "_targetPos", "_launchPos", "_launchDir", "_launchTime"]; +_flightParams params ["_pitchRate", "_yawRate", "_isBangBangGuidance"]; +_stateParams params ["_lastRunTime", "_seekerStateParams", "_attackProfileStateParams", "_lastKnownPosState","_navigationParams", "_guidanceParameters"]; +_seekerParams params ["_seekerAngle", "_seekerAccuracy", "_seekerMaxRange", "_seekerMinRange"]; +_targetData params ["_targetDirection", "_attackProfileDirection", "_targetRange", "_targetVelocity", "_targetAcceleration"]; + +_attackProfileStateParams params ["_state", "_stableTime", "_target"]; +private _projectileDirection = vectorNormalized velocity _projectile; +private _targetDistance = _target vectorDistance getPosASLVisual _projectile; +private _targetDirection = (getPosASLVisual _projectile) vectorFromTo _target; +private _angle = _projectileDirection vectorCos _targetDirection; +if (_angle > cos REQUIRED_ANGLE) then { + _stableTime = _stableTime + _timestep; +} else { + _stableTime = 0; +}; + +_attackProfileStateParams set [1, _stableTime]; +_state isEqualTo STAGE_TERMINAL && _stableTime > REQUIRED_STABLE_TIME + diff --git a/addons/missileguidance/functions/fnc_line_onFired.sqf b/addons/missileguidance/functions/fnc_line_onFired.sqf new file mode 100644 index 00000000000..6093dc27384 --- /dev/null +++ b/addons/missileguidance/functions/fnc_line_onFired.sqf @@ -0,0 +1,35 @@ +#include "..\script_component.hpp" +/* + * Author: tcvm + * Sets up line state arrays (called from missileGuidance's onFired). + * + * Arguments: + * Guidance Arg Array <ARRAY> + * + * Return Value: + * None + * + * Example: + * [] call ace_missileguidance_fnc_line_onFired + * + * Public: No + */ +params ["_firedEH", "", "", "", "_stateParams"]; +_firedEH params ["","","","","","","_projectile"]; + +private _ammoConfig = configOf _projectile; +private _p = getNumber (_ammoConfig >> QUOTE(ADDON) >> "lineGainP"); +private _d = getNumber (_ammoConfig >> QUOTE(ADDON) >> "lineGainD"); +private _correctionDistance = getNumber (_ammoConfig >> QUOTE(ADDON) >> "correctionDistance"); + +if (_correctionDistance == 0) then { + _correctionDistance = 1; +}; + +private _navigationParams = [ + _p, 0, _d, + 0, + 0, + _correctionDistance +]; +_navigationParams diff --git a/addons/missileguidance/functions/fnc_ahr_onFired.sqf b/addons/missileguidance/functions/fnc_mwr_onFired.sqf similarity index 92% rename from addons/missileguidance/functions/fnc_ahr_onFired.sqf rename to addons/missileguidance/functions/fnc_mwr_onFired.sqf index 0618c046ad4..845b81cda64 100644 --- a/addons/missileguidance/functions/fnc_ahr_onFired.sqf +++ b/addons/missileguidance/functions/fnc_mwr_onFired.sqf @@ -10,7 +10,7 @@ * None * * Example: - * [] call ace_missileguidance_fnc_ahr_onFired + * [] call ace_missileguidance_fnc_mwr_onFired * * Public: No */ @@ -38,6 +38,8 @@ private _activeRadarDistance = [_config >> "activeRadarEngageDistance", "NUMBER" private _projectileThrust = [_projectileConfig >> "thrust", "NUMBER", 0] call CBA_fnc_getConfigEntry; private _projectileThrustTime = [_projectileConfig >> "thrustTime", "NUMBER", 0] call CBA_fnc_getConfigEntry; +private _lockTypes = [_config >> "lockableTypes", "ARRAY", ["Air", "LandVehicle", "Ship"]] call CBA_fnc_getConfigEntry; + private _velocityAtImpact = _projectileThrust * _projectileThrustTime; private _timeToActive = 0; if (!isNil "_target" && _velocityAtImpact > 0) then { @@ -70,4 +72,4 @@ _seekerStateParams set [6, false]; _seekerStateParams set [7, [0, 0, 0]]; _seekerStateParams set [8, CBA_missionTime]; _seekerStateParams set [9, isNull _target]; - +_seekerStateParams set [10, _lockTypes]; diff --git a/addons/missileguidance/functions/fnc_navigationType_augmentedProNav.sqf b/addons/missileguidance/functions/fnc_navigationType_augmentedProNav.sqf new file mode 100644 index 00000000000..f8f1e6c0f42 --- /dev/null +++ b/addons/missileguidance/functions/fnc_navigationType_augmentedProNav.sqf @@ -0,0 +1,50 @@ +#include "..\script_component.hpp" +/* + * Author: tcvm + * Determine path for projectile to take in accordance to proportional navigation, takes target acceleration into account + * + * Arguments: + * Guidance Arg Array <ARRAY> + * + * Return Value: + * Commanded acceleration normal to LOS in world space <ARRAY> + * + * Example: + * [] call ace_missileguidance_fnc_navigationType_augmentedProNav + * + * Public: No + */ +params ["_args", "_timestep", "_seekerTargetPos", "_profileAdjustedTargetPos"]; +_args params ["_firedEH", "", "", "", "_stateParams", "_targetData"]; +_firedEH params ["","","","","","","_projectile"]; +_stateParams params ["", "", "", "","_navigationParams"]; +_navigationParams params ["_lastMissileFrame", "_navigationGain"]; +_lastMissileFrame params ["_lastLineOfSight"]; +_targetData params ["_targetDirection", "_attackProfileDirection", "", "_targetVelocity", "_targetAcceleration"]; + +// Proportional navigation implemented via "Fundamentals of proportional navigation" by Stephen Murtaugh and Harry Criel +private _closingVelocity = _targetVelocity vectorDiff velocity _projectile; + +private _targetAccelerationProjected = _attackProfileDirection vectorMultiply (_targetAcceleration vectorDotProduct _attackProfileDirection); +_targetAcceleration = _targetAcceleration vectorDiff _targetAccelerationProjected; + +private _losDelta = (vectorNormalized _attackProfileDirection) vectorDiff (vectorNormalized _lastLineOfSight); +private _losRate = if (_timestep == 0) then { + 0 +} else { + 1 * (vectorMagnitude _losDelta) / _timestep; +}; + +private _lateralAcceleration = _navigationGain * _losRate; +private _commandedAcceleration = _closingVelocity vectorMultiply _lateralAcceleration; +_commandedAcceleration = _commandedAcceleration vectorAdd (_losDelta vectorMultiply (0.5 * _navigationGain * vectorMagnitude _targetAcceleration)); + +// we need acceleration normal to our LOS +private _commandedAccelerationProjected = _attackProfileDirection vectorMultiply (_commandedAcceleration vectorDotProduct _attackProfileDirection); +_commandedAcceleration = _commandedAcceleration vectorDiff _commandedAccelerationProjected; + +if (accTime > 0) then { + _navigationParams set [0, [_seekerTargetPos, _targetVelocity, _attackProfileDirection]]; +}; + +_commandedAcceleration vectorMultiply _timestep diff --git a/addons/missileguidance/functions/fnc_navigationType_direct.sqf b/addons/missileguidance/functions/fnc_navigationType_direct.sqf new file mode 100644 index 00000000000..5681c85b9ae --- /dev/null +++ b/addons/missileguidance/functions/fnc_navigationType_direct.sqf @@ -0,0 +1,36 @@ +#include "..\script_component.hpp" +/* + * Author: tcvm + * Points directly toward attack profile positon + * + * Arguments: + * Guidance Arg Array <ARRAY> + * + * Return Value: + * Commanded acceleration normal to LOS in world space <ARRAY> + * + * Example: + * [] call ace_missileguidance_fnc_navigationType_direct + * + * Public: No + */ +params ["_args", "_timestep", "", "_profileAdjustedTargetPos"]; +_args params ["_firedEH", "", "_flightParams"]; +_flightParams params ["_pitchRate", "_yawRate"]; +_firedEH params ["","","","","","","_projectile"]; + +private _projectilePos = getPosASLVisual _projectile; + +private _targetDirection = _projectilePos vectorFromTo _profileAdjustedTargetPos; +private _projectileDirection = vectorNormalized velocity _projectile; + +private _deltaDirection = _targetDirection vectorDiff _projectileDirection; +_deltaDirection = _projectile vectorWorldToModelVisual _deltaDirection; +_deltaDirection = _deltaDirection vectorMultiply [_yawRate, 0, _pitchRate]; +_deltaDirection = _projectile vectorModelToWorldVisual _deltaDirection; + +private _iTimestep = 0; +if (_timestep != 0) then { + _iTimestep = 1 / _timestep; +}; +_deltaDirection vectorMultiply _iTimestep // return diff --git a/addons/missileguidance/functions/fnc_navigationType_line.sqf b/addons/missileguidance/functions/fnc_navigationType_line.sqf new file mode 100644 index 00000000000..c9a3870c58b --- /dev/null +++ b/addons/missileguidance/functions/fnc_navigationType_line.sqf @@ -0,0 +1,52 @@ +#include "..\script_component.hpp" +/* + * Author: tcvm + * Assumes targetDir is pointing toward line we want to stay on + * + * Arguments: + * Guidance Arg Array <ARRAY> + * + * Return Value: + * Commanded acceleration normal to LOS in world space <ARRAY> + * + * Example: + * [] call ace_missileguidance_fnc_navigationType_line + * + * Public: No + */ +params ["_args", "_timestep", "_seekerTargetPos", "_profileAdjustedTargetPos", "_targetData", "_navigationParams"]; +_args params ["", "", "_flightParams"]; +_targetData params ["", "_targetDir", "_distance"]; +_flightParams params ["_pitchRate", "_yawRate"]; + +_navigationParams params ["_proportionalGain", "", "_derivativeGain", "_lastErrorX", "_lastErrorY", "_correctionDistance"]; +private _relativeTargetDirection = [0, (velocityModelSpace _projectile) select 1, 0] vectorAdd (_projectile vectorWorldToModelVisual (_targetDir vectorMultiply _distance)); + +private _angleX = ((_relativeTargetDirection select 0) atan2 (_relativeTargetDirection select 1)); +private _angleY = ((_relativeTargetDirection select 2) atan2 (_relativeTargetDirection select 1)); + +private _pX = _proportionalGain * _angleX; +private _dX = 0; +if (_timestep > 0) then { + _dX = _derivativeGain * (_angleX - _lastErrorX) / _timestep; +}; + +private _pY = _proportionalGain * _angleY; +private _dY = 0; +if (_timestep > 0) then { + _dY = _derivativeGain * (_angleY - _lastErrorY) / _timestep; +}; + +private _accelerationX = _pX + _dX; +private _accelerationY = _pY + _dY; + +private _commandedAcceleration = [ + _accelerationX, + 0, + _accelerationY +]; + +_navigationParams set [3, _angleX]; +_navigationParams set [4, _angleY]; + +_projectile vectorModelToWorldVisual _commandedAcceleration; diff --git a/addons/missileguidance/functions/fnc_navigationType_lineOfSight.sqf b/addons/missileguidance/functions/fnc_navigationType_lineOfSight.sqf new file mode 100644 index 00000000000..5056d837228 --- /dev/null +++ b/addons/missileguidance/functions/fnc_navigationType_lineOfSight.sqf @@ -0,0 +1,48 @@ +#include "..\script_component.hpp" +/* + * Author: tcvm + * Accelerates toward LOS + * + * Arguments: + * Guidance Arg Array <ARRAY> + * + * Return Value: + * Commanded acceleration normal to LOS in world space <ARRAY> + * + * Example: + * [] call ace_missileguidance_fnc_navigationType_lineOfSight + * + * Public: No + */ +params ["_args", "_timestep", "_seekerTargetPos", "_profileAdjustedTargetPos"]; +_args params ["_firedEH", "", "", "", "_stateParams", "_targetData"]; +_firedEH params ["","","","","","","_projectile"]; +_stateParams params ["", "", "", "","_navigationParams"]; +_navigationParams params ["_onLaunch"]; +_onLaunch params ["_lastLineOfSight"]; +_targetData params ["_targetDirection", "_attackProfileDirection", "", "_targetVelocity", ""]; + +// Semi-proportional navigation implemented via "Fundamentals of proportional navigation" by Stephen Murtaugh and Harry Criel + +// the los rate is tiny, so we multiply by a constant of a power of ten to get more aggressive acceleration +// this is just due to how we measure our LOS delta, the vectors involved are _tiny_ +private _losDelta = _attackProfileDirection vectorDiff _lastLineOfSight; +private _losRate = if (_timestep == 0) then { + 0 +} else { + 10 * (vectorMagnitude _losDelta) / _timestep; +}; + +private _closingVelocity = _targetVelocity vectorDiff (velocity _projectile); + +private _commandedAcceleration = _closingVelocity vectorMultiply _losRate; + +// we need acceleration normal to our LOS +private _commandedAccelerationProjected = _attackProfileDirection vectorMultiply (_commandedAcceleration vectorDotProduct _attackProfileDirection); +_commandedAcceleration = _commandedAcceleration vectorDiff _commandedAccelerationProjected; + +if (accTime > 0) then { + _navigationParams set [0, [_attackProfileDirection]]; +}; + +_targetDirection diff --git a/addons/missileguidance/functions/fnc_navigationType_proNav.sqf b/addons/missileguidance/functions/fnc_navigationType_proNav.sqf new file mode 100644 index 00000000000..45052689b05 --- /dev/null +++ b/addons/missileguidance/functions/fnc_navigationType_proNav.sqf @@ -0,0 +1,46 @@ +#include "..\script_component.hpp" +/* + * Author: tcvm + * Determine path for projectile to take in accordance to proportional navigation + * + * Arguments: + * Guidance Arg Array <ARRAY> + * + * Return Value: + * Commanded acceleration normal to LOS in world space <ARRAY> + * + * Example: + * [] call ace_missileguidance_fnc_navigationType_proNav + * + * Public: No + */ +params ["_args", "_timestep", "_seekerTargetPos", "_profileAdjustedTargetPos"]; +_args params ["_firedEH", "", "", "", "_stateParams", "_targetData"]; +_firedEH params ["","","","","","","_projectile"]; +_stateParams params ["", "", "", "","_navigationParams"]; +_navigationParams params ["_lastMissileFrame", "_navigationGain"]; +_lastMissileFrame params ["_lastLineOfSight"]; +_targetData params ["_targetDirection", "_attackProfileDirection", "", "_targetVelocity", ""]; + +// Proportional navigation implemented via "Fundamentals of proportional navigation" by Stephen Murtaugh and Harry Criel +private _closingVelocity = _targetVelocity vectorDiff velocity _projectile; + +private _losDelta = (vectorNormalized _attackProfileDirection) vectorDiff (vectorNormalized _lastLineOfSight); +private _losRate = if (_timestep == 0) then { + 0 +} else { + 1 * (vectorMagnitude _losDelta) / _timestep; +}; + +private _lateralAcceleration = _navigationGain * _losRate; +private _commandedAcceleration = _closingVelocity vectorMultiply _lateralAcceleration; + +// we need acceleration normal to our LOS +private _commandedAccelerationProjected = _attackProfileDirection vectorMultiply (_commandedAcceleration vectorDotProduct _attackProfileDirection); +_commandedAcceleration = _commandedAcceleration vectorDiff _commandedAccelerationProjected; + +if (accTime > 0) then { + _navigationParams set [0, [_seekerTargetPos, _targetVelocity, _attackProfileDirection]]; +}; + +_commandedAcceleration vectorMultiply _timestep diff --git a/addons/missileguidance/functions/fnc_navigationType_zeroEffortMiss.sqf b/addons/missileguidance/functions/fnc_navigationType_zeroEffortMiss.sqf new file mode 100644 index 00000000000..293bede8bf2 --- /dev/null +++ b/addons/missileguidance/functions/fnc_navigationType_zeroEffortMiss.sqf @@ -0,0 +1,38 @@ +#include "..\script_component.hpp" +/* + * Author: tcvm + * Determine path for projectile to take in accordance to zero-effort miss pro-nav, takes target acceleration into account. Super deadly + * + * Arguments: + * Guidance Arg Array <ARRAY> + * + * Return Value: + * Commanded acceleration normal to LOS in world space <ARRAY> + * + * Example: + * [] call ace_missileguidance_fnc_navigationType_zeroEffortMiss + * + * Public: No + */ +params ["_args", "_timestep", "_seekerTargetPos", "_profileAdjustedTargetPos"]; +_args params ["_firedEH", "", "", "", "_stateParams", "_targetData"]; +_firedEH params ["","","","","","","_projectile"]; +_stateParams params ["", "", "", "","_navigationParams"]; +_navigationParams params ["", "_navigationGain"]; +_targetData params ["_targetDirection", "_attackProfileDirection", "_targetRange", "_targetVelocity", "_targetAcceleration"]; + +private _vectorToTarget = _attackProfileDirection vectorMultiply _targetRange; +private _closingVelocity = _targetVelocity vectorDiff velocity _projectile; +private _timeToGo = _targetRange / vectorMagnitude _closingVelocity; + +if (_timeToGo == 0) then { + _timeToGo = 0.001; +}; + +private _zeroEffortMiss = _vectorToTarget vectorAdd (_closingVelocity vectorMultiply _timeToGo); +private _zeroEffortMissProjectiled = _attackProfileDirection vectorMultiply (_zeroEffortMiss vectorDotProduct _attackProfileDirection); +private _zeroEffortMissNormal = _zeroEffortMiss vectorDiff _zeroEffortMissProjectiled; + +private _commandedAcceleration = _zeroEffortMissNormal vectorMultiply (_navigationGain / (_timeToGo * _timeToGo)); + +_commandedAcceleration diff --git a/addons/missileguidance/functions/fnc_onFired.sqf b/addons/missileguidance/functions/fnc_onFired.sqf index 1d63d120a9a..9cc91f300a9 100644 --- a/addons/missileguidance/functions/fnc_onFired.sqf +++ b/addons/missileguidance/functions/fnc_onFired.sqf @@ -19,9 +19,6 @@ params ["_shooter","_weapon","","_mode","_ammo","","_projectile"]; -// Bail on not missile -if !(_ammo isKindOf "MissileBase") exitWith {}; - // Bail if guidance is disabled for this ammo if ((getNumber (configFile >> "CfgAmmo" >> _ammo >> QUOTE(ADDON) >> "enabled")) != 1) exitWith {}; @@ -44,6 +41,7 @@ private _target = _shooter getVariable [QGVAR(target), nil]; private _targetPos = _shooter getVariable [QGVAR(targetPosition), nil]; private _seekerType = _shooter getVariable [QGVAR(seekerType), nil]; private _attackProfile = _shooter getVariable [QGVAR(attackProfile), nil]; +private _navigationType = _shooter getVariable [QGVAR(navigationType), nil]; if ((getNumber (configFile >> "CfgAmmo" >> _ammo >> QUOTE(ADDON) >> "useModeForAttackProfile")) == 1) then { _attackProfile = getText (configFile >> "CfgWeapons" >> _weapon >> _mode >> QGVAR(attackProfile)) }; @@ -52,7 +50,7 @@ private _lockMode = _shooter getVariable [QGVAR(lockMode), nil]; private _laserCode = _shooter getVariable [QEGVAR(laser,code), ACE_DEFAULT_LASER_CODE]; private _laserInfo = [_laserCode, ACE_DEFAULT_LASER_WAVELENGTH, ACE_DEFAULT_LASER_WAVELENGTH]; -TRACE_6("getVars",_target,_targetPos,_seekerType,_attackProfile,_lockMode,_laserCode); +TRACE_7("getVars",_target,_targetPos,_seekerType,_attackProfile,_lockMode,_laserCode,_navigationType); private _launchPos = getPosASL (vehicle _shooter); @@ -65,6 +63,14 @@ if (isNil "_attackProfile" || {!(_attackProfile in (getArray (_config >> "attack if (isNil "_lockMode" || {!(_lockMode in (getArray (_config >> "seekerLockModes")))}) then { _lockMode = getText (_config >> "defaultSeekerLockMode"); }; +if (isNil "_navigationType" || {!(_navigationType in (getArray (_config >> "navigationTypes")))}) then { + _navigationType = getText (_config >> "defaultNavigationType"); +}; + +if (isNil "_navigationType" || _navigationType isEqualTo "") then { + // most missiles use ProNav by default + _navigationType = "ProportionalNavigation"; +}; // If we didn't get a target, try to fall back on tab locking if (isNil "_target") then { @@ -76,7 +82,7 @@ if (isNil "_target") then { private _canUseLock = getNumber (_config >> "canVanillaLock"); // @TODO: Get vanilla target if (_canUseLock > 0 || difficulty < 1) then { - private _vanillaTarget = cursorTarget; + private _vanillaTarget = missileTarget _projectile; TRACE_1("Using Vanilla Locking",_vanillaTarget); if (!isNil "_vanillaTarget") then { @@ -85,6 +91,7 @@ if (isNil "_target") then { }; }; }; +_targetPos = getPosASLVisual _target; // Array for seek last target position private _seekLastTargetPos = (getNumber ( _config >> "seekLastTargetPos")) == 1; @@ -95,19 +102,66 @@ if (_seekLastTargetPos && {!isNil "_target"}) then { _lastKnownPosState set [1, [0,0,0]]; }; -TRACE_4("Beginning ACE guidance system",_target,_ammo,_seekerType,_attackProfile); +private _navigationParameters = [ + // set up in navigation type onFired function +]; + +// default config values to make sure there is backwards compat +private _pitchRate = 30; +private _yawRate = 30; +private _bangBang = false; +if (isNumber (_config >> "pitchRate")) then { + _pitchRate = getNumber ( _config >> "pitchRate" ); + _yawRate = getNumber ( _config >> "yawRate" ); + _bangBang = (1 == getNumber (_config >> "bangBangGuidance")); +}; + +// How much this projectile likes to stay toward current velocity +private _stabilityCoefficient = getNumber (_config >> "stabilityCoefficient"); + +// show a light trail in flight +private _showTrail = (1 == getNumber (_config >> "showTrail")); + +private _navigationStateSubclass = _config >> "navigationStates"; +private _states = getArray (_navigationStateSubclass >> "states"); + +private _navigationStateData = []; +private _initialState = ""; + +if (_states isNotEqualTo []) then { + _initialState = _states select 0; + { + private _stateClass = _navigationStateSubclass >> _x; + _navigationStateData pushBack [ + getText (_stateClass >> "transitionCondition"), + getText (_stateClass >> "navigationType"), + [] + ]; + } forEach _states; +}; + +private _initialRoll = getNumber (_config >> "initialRoll"); +private _initialYaw = getNumber (_config >> "initialYaw"); +private _initialPitch = getNumber (_config >> "initialPitch"); + +private _yawRollPitch = (vectorDir _projectile) call CBA_fnc_vect2Polar; + +TRACE_5("Beginning ACE guidance system",_target,_ammo,_seekerType,_attackProfile,_navigationType); private _args = [_this, [ _shooter, - [_target, _targetPos, _launchPos], + [_target, _targetPos, _launchPos, vectorDirVisual vehicle _shooter, CBA_missionTime], _seekerType, _attackProfile, _lockMode, - _laserInfo + _laserInfo, + _navigationType ], [ - getNumber ( _config >> "minDeflection" ), - getNumber ( _config >> "maxDeflection" ), - getNumber ( _config >> "incDeflection" ) + _pitchRate, + _yawRate, + _bangBang, + _stabilityCoefficient, + _showTrail ], [ getNumber ( _config >> "seekerAngle" ), @@ -115,37 +169,70 @@ private _args = [_this, getNumber ( _config >> "seekerMaxRange" ), getNumber ( _config >> "seekerMinRange" ) ], - [ diag_tickTime, [], [], _lastKnownPosState] + [ diag_tickTime, [], [], _lastKnownPosState, _navigationParameters, [_initialYaw + (_yawRollPitch select 1), _initialRoll, _initialPitch + (_yawRollPitch select 2)]], + [ + // target data from missile. Must be filled by seeker for navigation to work + [0, 0, 0], // direction to target + [0, 0, 0], // direction to attack profile + 0, // range to target + [0, 0, 0], // target velocity + [0, 0, 0] // target acceleration + ], + [0, _navigationStateData] ]; private _onFiredFunc = getText (configFile >> QGVAR(SeekerTypes) >> _seekerType >> "onFired"); -TRACE_1("",_onFiredFunc); +TRACE_1("seeker on fired",_onFiredFunc); if (_onFiredFunc != "") then { _args call (missionNamespace getVariable _onFiredFunc); }; _onFiredFunc = getText (configFile >> QGVAR(AttackProfiles) >> _attackProfile >> "onFired"); -TRACE_1("",_onFiredFunc); +TRACE_1("attack on fired",_onFiredFunc); if (_onFiredFunc != "") then { _args call (missionNamespace getVariable _onFiredFunc); }; +if (_states isEqualTo []) then { + _onFiredFunc = getText (configFile >> QGVAR(NavigationTypes) >> _navigationType >> "onFired"); + TRACE_1("navigation on fired",_onFiredFunc); + if (_onFiredFunc != "") then { + private _navState = (_args call (missionNamespace getVariable _onFiredFunc)); + (_args select 4) set [4, _navState]; + }; +} else { + { + _onFiredFunc = getText (configFile >> QGVAR(NavigationTypes) >> _x >> "onFired"); + TRACE_1("navigation on fired",_onFiredFunc); + if (_onFiredFunc != "") then { + private _navState = (_args call (missionNamespace getVariable _onFiredFunc)); + (_navigationStateData select _forEachIndex) set [2, _navState]; + }; + } forEach getArray (_config >> "navigationTypes"); +}; + // Run the "onFired" function passing the full guidance args array _onFiredFunc = getText (_config >> "onFired"); -TRACE_1("",_onFiredFunc); +TRACE_1("general on fired",_onFiredFunc); if (_onFiredFunc != "") then { _args call (missionNamespace getVariable _onFiredFunc); }; // Reverse: -// _args params ["_firedEH", "_launchParams", "_flightParams", "_seekerParams", "_stateParams"]; +// _args params ["_firedEH", "_launchParams", "_flightParams", "_seekerParams", "_stateParams", "_targetData", "_navigationStateData"]; // _firedEH params ["_shooter","","","","_ammo","","_projectile"]; -// _launchParams params ["_shooter","_targetLaunchParams","_seekerType","_attackProfile","_lockMode","_laserInfo"]; -// _targetLaunchParams params ["_target", "_targetPos", "_launchPos"]; -// _stateParams params ["_lastRunTime", "_seekerStateParams", "_attackProfileStateParams", "_lastKnownPosState"]; +// _launchParams params ["_shooter","_targetLaunchParams","_seekerType","_attackProfile","_lockMode","_laserInfo","_navigationType"]; +// _targetLaunchParams params ["_target", "_targetPos", "_launchPos", "_launchDir", "_launchTime"]; +// _flightParams params ["_pitchRate", "_yawRate", "_isBangBangGuidance"]; +// _stateParams params ["_lastRunTime", "_seekerStateParams", "_attackProfileStateParams", "_lastKnownPosState", "_navigationParams", "_guidanceParameters"]; // _seekerParams params ["_seekerAngle", "_seekerAccuracy", "_seekerMaxRange", "_seekerMinRange"]; +// _targetData params ["_targetDirection", "_attackProfileDirection", "_targetRange", "_targetVelocity", "_targetAcceleration"]; + +[LINKFUNC(guidancePFH),0, _args ] call CBA_fnc_addPerFrameHandler; -[LINKFUNC(guidancePFH), 0, _args ] call CBA_fnc_addPerFrameHandler; +if (GVAR(debug_enableMissileCamera)) then { + [_projectile] call FUNC(dev_ProjectileCamera); +}; /* Clears locking settings diff --git a/addons/missileguidance/functions/fnc_proNav_onFired.sqf b/addons/missileguidance/functions/fnc_proNav_onFired.sqf new file mode 100644 index 00000000000..c297d3ce59a --- /dev/null +++ b/addons/missileguidance/functions/fnc_proNav_onFired.sqf @@ -0,0 +1,36 @@ +#include "..\script_component.hpp" +/* + * Author: tcvm + * Sets up proportional navigation state arrays (called from missileGuidance's onFired). + * + * Arguments: + * Guidance Arg Array <ARRAY> + * + * Return Value: + * None + * + * Example: + * [] call ace_missileguidance_fnc_proNav_onFired + * + * Public: No + */ +params ["_firedEH", "", "", "", "_stateParams"]; +_firedEH params ["_shooter","","","","_ammo","","_projectile"]; +_launchParams params ["_shooter","_targetLaunchParams","_seekerType","_attackProfile","_lockMode","_laserInfo","_navigationType"]; +_targetLaunchParams params ["_target", "_targetPos", "_launchPos"]; +_stateParams params ["_lastRunTime", "_seekerStateParams", "_attackProfileStateParams", "_lastKnownPosState"]; +_seekerParams params ["_seekerAngle", "_seekerAccuracy", "_seekerMaxRange", "_seekerMinRange"]; + +private _ammoConfig = configOf _projectile; +private _navigationGain = getNumber (_ammoConfig >> QUOTE(ADDON) >> "navigationGain"); +if (_navigationGain == 0) then { + _navigationGain = 3; +}; + +private _navigationParams = [ + [ // Last Missile Frame + [0, 0, 0] // Last line of sight + ], + _navigationGain // navigation gain of missile. Set in the navigation onFired function +]; +_navigationParams diff --git a/addons/missileguidance/functions/fnc_seekerType_ARH.sqf b/addons/missileguidance/functions/fnc_seekerType_MWR.sqf similarity index 79% rename from addons/missileguidance/functions/fnc_seekerType_ARH.sqf rename to addons/missileguidance/functions/fnc_seekerType_MWR.sqf index 54e487a9a0b..1b7eef07ee7 100644 --- a/addons/missileguidance/functions/fnc_seekerType_ARH.sqf +++ b/addons/missileguidance/functions/fnc_seekerType_MWR.sqf @@ -11,16 +11,16 @@ * Seeker Pos <ARRAY> * * Example: - * [] call call ace_missileguidance_fnc_seekerType_ARH; + * [] call call ace_missileguidance_fnc_seekerType_MWR; * * Public: No */ -params ["", "_args", "_seekerStateParams"]; -_args params ["_firedEH", "_launchParams", "", "_seekerParams", "_stateParams"]; +params ["", "_args", "_seekerStateParams", "", "_timestep"]; +_args params ["_firedEH", "_launchParams", "", "_seekerParams", "_stateParams", "_targetData"]; _firedEH params ["_shooter","","","","","","_projectile"]; _launchParams params ["_target","","","",""]; _seekerParams params ["_seekerAngle", "", "_seekerMaxRange"]; -_seekerStateParams params ["_isActive", "_activeRadarEngageDistance", "_timeWhenActive", "_expectedTargetPos", "_lastTargetPollTime", "_shooterHasRadar", "_wasActive", "_lastKnownVelocity", "_lastTimeSeen", "_doesntHaveTarget"]; +_seekerStateParams params ["_isActive", "_activeRadarEngageDistance", "_timeWhenActive", "_expectedTargetPos", "_lastTargetPollTime", "_shooterHasRadar", "_wasActive", "_lastKnownVelocity", "_lastTimeSeen", "_doesntHaveTarget", "_lockTypes"]; if (_isActive || { CBA_missionTime >= _timeWhenActive }) then { if !(_isActive) then { @@ -60,8 +60,7 @@ if (_isActive || { CBA_missionTime >= _timeWhenActive }) then { _seekerBaseRadiusAdjusted = _seekerBaseRadiusAtGround; }; // Look in front of seeker for any targets - private _nearestObjects = nearestObjects [ASLtoAGL _searchPos, ["Air", "LandVehicle", "Ship"], _seekerBaseRadiusAdjusted, false]; - + private _nearestObjects = nearestObjects [ASLToAGL _searchPos, _lockTypes, _seekerBaseRadiusAdjusted, false]; _nearestObjects = _nearestObjects apply { // I check both Line of Sight versions to make sure that a single bush doesnt make the target lock dissapear but at the same time ensure that this can see through smoke. Should work 80% of the time if ([_projectile, getPosASL _x, _seekerAngle] call FUNC(checkSeekerAngle) && { ([_projectile, _x, true] call FUNC(checkLOS)) || { ([_projectile, _x, false] call FUNC(checkLOS)) } }) then { @@ -74,12 +73,13 @@ if (_isActive || { CBA_missionTime >= _timeWhenActive }) then { // Select closest object to the expected position to be the current radar target if (_nearestObjects isEqualTo []) exitWith { _projectile setMissileTarget objNull; + _seekerStateParams set [3, _searchPos]; _searchPos }; private _closestDistance = _seekerBaseRadiusAtGround; { - if ((_x distance2d _searchPos) < _closestDistance) then { - _closestDistance = _x distance2d _searchPos; + if ((_x distance2D _searchPos) < _closestDistance) then { + _closestDistance = _x distance2D _searchPos; _target = _x; }; } forEach _nearestObjects; @@ -89,9 +89,9 @@ if (_isActive || { CBA_missionTime >= _timeWhenActive }) then { _projectile setMissileTarget _target; } else { - #ifdef DRAW_GUIDANCE_INFO - _seekerTypeName = "AHR - EXT"; - #endif + if (GVAR(debug_drawGuidanceInfo)) then { + _seekerTypeName = "MWR - EXT"; + }; // External radar homing // if the target is in the remote targets for the side, whoever the donor is will "datalink" the target for the hellfire. private _remoteTargets = listRemoteTargets side _shooter; @@ -104,16 +104,30 @@ if (_isActive || { CBA_missionTime >= _timeWhenActive }) then { }; }; +if (GVAR(debug_drawGuidanceInfo)) then { + drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,0,1], ASLToAGL _expectedTargetPos, 0.75, 0.75, 0, "expected target pos", 1, 0.025, "TahomaB"]; +}; + if !(isNull _target) then { private _centerOfObject = getCenterOfMass _target; - private _targetAdjustedPos = _target modelToWorldWorld _centerOfObject; + private _targetAdjustedPos = _target modelToWorldVisualWorld _centerOfObject; _expectedTargetPos = _targetAdjustedPos; - _seekerStateParams set [3, _expectedTargetPos]; _seekerStateParams set [7, velocity _target]; _seekerStateParams set [8, CBA_missionTime]; _seekerStateParams set [9, false]; + + _targetData set [2, _projectile distance _target]; + _targetData set [3, velocity _target]; + + if (_timestep != 0) then { + private _acceleration = ((velocity _target) vectorDiff _lastKnownVelocity) vectorMultiply (1 / _timestep); + _targetData set [4, _acceleration]; + }; }; +_targetData set [0, (getPosASLVisual _projectile) vectorFromTo _expectedTargetPos]; + +_seekerStateParams set [3, _expectedTargetPos]; _launchParams set [0, _target]; _expectedTargetPos diff --git a/addons/missileguidance/functions/fnc_seekerType_Optic.sqf b/addons/missileguidance/functions/fnc_seekerType_Optic.sqf index bac01d05b4d..0507bc2c11d 100644 --- a/addons/missileguidance/functions/fnc_seekerType_Optic.sqf +++ b/addons/missileguidance/functions/fnc_seekerType_Optic.sqf @@ -17,7 +17,7 @@ */ params ["", "_args"]; -_args params ["_firedEH", "_launchParams", "", "_seekerParams", "_stateParams"]; +_args params ["_firedEH", "_launchParams", "", "_seekerParams", "_stateParams", "_targetData"]; _firedEH params ["","","","","","","_projectile"]; _launchParams params ["", "_targetParams"]; _targetParams params ["_target"]; @@ -25,7 +25,7 @@ _seekerParams params ["_seekerAngle", "", "_seekerMaxRange"]; if (isNil "_target") exitWith {[0,0,0]}; -private _foundTargetPos = aimPos _target; +private _foundTargetPos = _target modelToWorldVisualWorld getCenterOfMass _target; // @TODO: This is seeker LOS and angle checks for LOAL only; LOBL does not need visual private _angleOkay = [_projectile, _foundTargetPos, _seekerAngle] call FUNC(checkSeekerAngle); @@ -40,14 +40,11 @@ TRACE_2("",_angleOkay,_losOkay); if (!_angleOkay || !_losOkay) exitWith {[0,0,0]}; TRACE_2("",_target,_foundTargetPos); -// @TODO: Configurable lead for seekers -private _projectileSpeed = (vectorMagnitude velocity _projectile); private _distanceToTarget = (getPosASL _projectile) vectorDistance _foundTargetPos; -private _eta = _distanceToTarget / _projectileSpeed; -private _adjustDistance = (velocity _target) vectorMultiply _eta; -TRACE_3("leading target",_distanceToTarget,_eta,_adjustDistance); -_foundTargetPos = _foundTargetPos vectorAdd _adjustDistance; +_targetData set [0, (getPosASL _projectile) vectorFromTo _foundTargetPos]; +_targetData set [2, _distanceToTarget]; +_targetData set [3, velocity _target]; TRACE_2("return",_foundTargetPos,(aimPos _target) distance _foundTargetPos); _foundTargetPos; diff --git a/addons/missileguidance/functions/fnc_seekerType_SACLOS.sqf b/addons/missileguidance/functions/fnc_seekerType_SACLOS.sqf index da9549c3ae5..d9fd444043f 100644 --- a/addons/missileguidance/functions/fnc_seekerType_SACLOS.sqf +++ b/addons/missileguidance/functions/fnc_seekerType_SACLOS.sqf @@ -16,16 +16,19 @@ * Public: No */ params ["", "_args"]; -_args params ["_firedEH", "", "", "_seekerParams", "_stateParams"]; +_args params ["_firedEH", "", "", "_seekerParams", "_stateParams", "_targetData"]; _firedEH params ["_shooter","_weapon","","","","","_projectile"]; _seekerParams params ["_seekerAngle"]; _stateParams params ["", "_seekerStateParams"]; _seekerStateParams params ["_memoryPointGunnerOptics", "_animationSourceBody", "_animationSourceGun", "_usePilotCamera"]; -private _shooterPos = AGLToASL (_shooter modelToWorld(_shooter selectionPosition _memoryPointGunnerOptics)); +private _shooterPos = AGLToASL (_shooter modelToWorldVisual (_shooter selectionPosition _memoryPointGunnerOptics)); private _projPos = getPosASL _projectile; -private _lookDirection = if !(_shooter isKindOf "CAManBase" || {_shooter isKindOf "StaticWeapon"}) then { +private _lookDirection = if (_shooter isKindOf "CAManBase" || {_shooter isKindOf "StaticWeapon"}) then { + _shooterPos = eyePos _shooter; + _shooter weaponDirection _weapon +} else { private _finalLookDirection = if (_usePilotCamera) then { _shooterPos = _shooter modelToWorldVisualWorld getPilotCameraPosition _shooter; private _trackingTarget = getPilotCameraTarget _shooter; @@ -37,14 +40,12 @@ private _lookDirection = if !(_shooter isKindOf "CAManBase" || {_shooter isKindO _shooter vectorModelToWorldVisual getPilotCameraDirection _shooter; }; } else { - private _gBody = -deg(_shooter animationPhase _animationSourceBody); - private _gGun = deg(_shooter animationPhase _animationSourceGun); + // use animationSourcePhase + private _gBody = -deg(_shooter animationSourcePhase _animationSourceBody); + private _gGun = deg(_shooter animationSourcePhase _animationSourceGun); _shooter vectorModelToWorldVisual ([1, _gBody, _gGun] call CBA_fnc_polar2vect); }; _finalLookDirection -} else { - _shooterPos = eyePos _shooter; - _shooter weaponDirection _weapon }; private _distanceToProj = _shooterPos vectorDistance _projPos; @@ -58,5 +59,9 @@ if ((_testDotProduct < (cos _seekerAngle)) || {_testIntersections isNotEqualTo [ [0, 0, 0] }; -_shooterPos vectorAdd (_lookDirection vectorMultiply _distanceToProj); +private _returnPos = _shooterPos vectorAdd (_lookDirection vectorMultiply _distanceToProj); + +_targetData set [0, _projPos vectorFromTo _returnPos]; +_targetData set [2, _returnPos vectorDistance getPosASLVisual _projectile]; +_returnPos diff --git a/addons/missileguidance/functions/fnc_seekerType_SALH.sqf b/addons/missileguidance/functions/fnc_seekerType_SALH.sqf index a16c58ce5fa..8772d73178f 100644 --- a/addons/missileguidance/functions/fnc_seekerType_SALH.sqf +++ b/addons/missileguidance/functions/fnc_seekerType_SALH.sqf @@ -16,17 +16,58 @@ * * Public: No */ +#define MAX_AVERAGES 15 +#define MINIMUM_DISTANCE_UNTIL_NEW_POS 1 -params ["", "_args"]; -_args params ["_firedEH", "_launchParams", "", "_seekerParams"]; +params ["", "_args", "", "", "_timestep"]; +_args params ["_firedEH", "_launchParams", "", "_seekerParams", "", "_targetData"]; _firedEH params ["","","","","","","_projectile"]; _launchParams params ["","","","","","_laserParams"]; -_seekerParams params ["_seekerAngle", "", "_seekerMaxRange"]; +_seekerParams params ["_seekerAngle", "", "_seekerMaxRange", "", ["_lastPositions", []], ["_lastPositionIndex", 0], ["_lastPositionSum", [0, 0, 0]]]; _laserParams params ["_code", "_wavelengthMin", "_wavelengthMax"]; - private _laserResult = [(getPosASL _projectile), (velocity _projectile), _seekerAngle, _seekerMaxRange, [_wavelengthMin, _wavelengthMax], _code, _projectile] call EFUNC(laser,seekerFindLaserSpot); private _foundTargetPos = _laserResult select 0; TRACE_1("Search",_laserResult); -_foundTargetPos; +if (isNil "_foundTargetPos") exitWith { + [0, 0, 0] +}; + +// average out any error from laser jump +private _positionSum = [0, 0, 0]; +{ + _positionSum = _positionSum vectorAdd _x; +} forEach _lastPositions; + +if (_foundTargetPos isNotEqualTo [0, 0, 0]) then { + _lastPositions set [_lastPositionIndex % MAX_AVERAGES, _foundTargetPos]; + _seekerParams set [4, _lastPositions]; + _seekerParams set [5, _lastPositionIndex + 1]; +}; + +private _aproximateVelocity = [0, 0, 0]; +_positionSum = _positionSum vectorAdd _foundTargetPos; +if (MAX_AVERAGES == count _lastPositions) then { + _positionSum = _positionSum vectorMultiply (1 / (1 + count _lastPositions)); + + // if we are within a meter of the previous average, just use the previous average + if (_positionSum distanceSqr _lastPositionSum < MINIMUM_DISTANCE_UNTIL_NEW_POS * MINIMUM_DISTANCE_UNTIL_NEW_POS) then { + _positionSum = _lastPositionSum; + }; + + if (_timestep != 0) then { + _aproximateVelocity = (_positionSum vectorDiff _lastPositionSum) vectorMultiply (1 / _timestep); + }; +} else { + _positionSum = _positionSum vectorMultiply (1 / count _lastPositions); +}; + +_seekerParams set [6, _positionSum]; + +_targetData set [0, (getPosASL _projectile) vectorFromTo _positionSum]; +_targetData set [3, _aproximateVelocity]; + +TRACE_3("laser target found",_foundTargetPos,_positionSum,count _lastPositions); + +_positionSum diff --git a/addons/missileguidance/functions/fnc_wire_onFired.sqf b/addons/missileguidance/functions/fnc_wire_onFired.sqf index 0cfa90ff99e..870754c5091 100644 --- a/addons/missileguidance/functions/fnc_wire_onFired.sqf +++ b/addons/missileguidance/functions/fnc_wire_onFired.sqf @@ -45,4 +45,3 @@ _attackProfileStateParams set [4, _maxDistanceSqr]; // max distance squared used _attackProfileStateParams set [5, _minDistanceSqr]; _attackProfileStateParams set [6, _wireCutSource]; _attackProfileStateParams set [7, _distanceAheadOfMissile]; - diff --git a/addons/missileguidance/script_component.hpp b/addons/missileguidance/script_component.hpp index 2b43be42f3c..47f0e83e034 100644 --- a/addons/missileguidance/script_component.hpp +++ b/addons/missileguidance/script_component.hpp @@ -3,6 +3,7 @@ #include "\z\ace\addons\main\script_mod.hpp" // #define DRAW_GUIDANCE_INFO +// #define ENABLE_PROJECTILE_CAMERA // #define DEBUG_MODE_FULL // #define DISABLE_COMPILE_CACHE // #define ENABLE_PERFORMANCE_COUNTERS @@ -28,4 +29,3 @@ #define DEFAULT_LEAD_DISTANCE 5 #define ACTIVE_RADAR_POLL_FREQUENCY (1 / 7) #define ACTIVE_RADAR_MINIMUM_SCAN_AREA 30 - diff --git a/addons/missileguidance/stringtable.xml b/addons/missileguidance/stringtable.xml index aacdd472d69..f21d555cfbd 100644 --- a/addons/missileguidance/stringtable.xml +++ b/addons/missileguidance/stringtable.xml @@ -12,7 +12,7 @@ <Portuguese>Orientação avançada de Míssil</Portuguese> <Hungarian>Fejlett rakétairányító</Hungarian> <Russian>Продвинутое наведение ракет</Russian> - <Japanese>アドバンスドミサイル誘導</Japanese> + <Japanese>高度なミサイル誘導</Japanese> <Korean>고급 미사일 유도</Korean> <Chinesesimp>进阶导弹制导</Chinesesimp> <Chinese>進階飛彈制導</Chinese> @@ -29,7 +29,7 @@ <Hungarian>A fejlett rakétairányító (vagy AMG) többféle módosítást tartalmaz a rakéták célkövetéséhez és tüzeléséhez. Ez egy szükséges keresztrendszer a rakéta-alapú fegyverekhez.</Hungarian> <Portuguese>Orientação avançada de mísseis ou OAM, fornece vários aprimoramentos para travamento de mísseis e disparos. Também é um sistema requerido para disparar armas que utilizem mísseis.</Portuguese> <Czech>Pokočilé navádění raket (AMG) poskytuje několik vylepšení pro lepší zaměření a následnou střelbu. Je to prvek vyžadovaný u typu zbraní jako jsou rakety.</Czech> - <Japanese>アドバンスドミサイル誘導 (AMG) は、ミサイルの捕捉と発射に複数の機能強化を提供します。 これは、ミサイル兵器の種類に必要なフレームワークでもあります。</Japanese> + <Japanese>高度なミサイル誘導 (AMG) は、ミサイルの捕捉と発射に複数の機能強化を提供します。 これは、ミサイル兵器の種類に必要なフレームワークでもあります。</Japanese> <Korean>고급 미사일 유도 혹은 AMG는 표적 획득 및 발사를 위한 여러 기능을 제공합니다. 미사일 종류에 따라 체계가 필요합니다.</Korean> <Chinesesimp>进阶导弹制导增强了多种导弹锁定和射击的能力。此系统适用于所有导弹类型的武器。</Chinesesimp> <Chinese>進階飛彈制導增強了多種導彈鎖定和射擊的能力。此系統適用於所有飛彈類型的武器</Chinese> @@ -205,5 +205,29 @@ <Chinese>循環切換開火模式</Chinese> <Turkish>Ateşleme Modunu Değiştir</Turkish> </Key> + <Key ID="STR_ACE_MissileGuidance_Hydra70_DAGR_6x"> + <English>6x DAGR [ACE]</English> + <French>6x DAGR [ACE]</French> + <Russian>6x DAGR [ACE]</Russian> + <Japanese>6x DAGR [ACE]</Japanese> + <Korean>6x DAGR [ACE]</Korean> + <Italian>6x DAGR [ACE]</Italian> + </Key> + <Key ID="STR_ACE_MissileGuidance_Hydra70_DAGR_12x"> + <English>12x DAGR [ACE]</English> + <French>12x DAGR [ACE]</French> + <Russian>12x DAGR [ACE]</Russian> + <Japanese>12x DAGR [ACE]</Japanese> + <Korean>12x DAGR [ACE]</Korean> + <Italian>12x DAGR [ACE]</Italian> + </Key> + <Key ID="STR_ACE_MissileGuidance_Hydra70_DAGR_24x"> + <English>24x DAGR [ACE]</English> + <French>24x DAGR [ACE]</French> + <Russian>24x DAGR [ACE]</Russian> + <Japanese>24x DAGR [ACE]</Japanese> + <Korean>24x DAGR [ACE]</Korean> + <Italian>24x DAGR [ACE]</Italian> + </Key> </Package> </Project> diff --git a/addons/missionmodules/functions/fnc_moduleAmbianceSound.sqf b/addons/missionmodules/functions/fnc_moduleAmbianceSound.sqf index 88e2ba02d56..86a14a8c8d0 100644 --- a/addons/missionmodules/functions/fnc_moduleAmbianceSound.sqf +++ b/addons/missionmodules/functions/fnc_moduleAmbianceSound.sqf @@ -48,7 +48,7 @@ private _missionRoot = str missionConfigFile select [0, count str missionConfigF }; } else { if (isClass (configFile >> "CfgSounds" >> _x)) then { - _soundPath = (getArray(configFile >> "CfgSounds" >> _x >> "sound")) param [0, ""]; + private _soundPath = (getArray(configFile >> "CfgSounds" >> _x >> "sound")) param [0, ""]; if ((_soundPath select [0, 1]) == "\") then {_soundPath = _soundPath select [1];}; _ambianceSounds pushBack _soundPath; } else { @@ -85,9 +85,9 @@ TRACE_1("",_ambianceSounds); private _newPosASL = if (_followPlayers) then { // Select a target unit at random. private _targetUnit = selectRandom _allUnits; - AGLtoASL (_targetUnit getPos [_minimalDistance + random (_maximalDistance - _minimalDistance), random 360]); + AGLToASL (_targetUnit getPos [_minimalDistance + random (_maximalDistance - _minimalDistance), random 360]); } else { - AGLtoASL (_logic getPos [_minimalDistance + random (_maximalDistance - _minimalDistance), random 360]); + AGLToASL (_logic getPos [_minimalDistance + random (_maximalDistance - _minimalDistance), random 360]); }; TRACE_1("",_newPosASL); diff --git a/addons/mk6mortar/functions/fnc_handlePlayerVehicleChanged.sqf b/addons/mk6mortar/functions/fnc_handlePlayerVehicleChanged.sqf index d721b0e4ae8..c3dcc2cfe49 100644 --- a/addons/mk6mortar/functions/fnc_handlePlayerVehicleChanged.sqf +++ b/addons/mk6mortar/functions/fnc_handlePlayerVehicleChanged.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: PabstMirror - * Handles player getting into new vehicle. Loads PFEG for mortar display if it is a mortar. + * Handles player getting into new vehicle. Loads PFEG for mortar display if it is a mortar. * * Arguments: * 0: Player <OBJECT> @@ -11,7 +11,7 @@ * None * * Example: - * [bob, mortar] call ace_mk6mortar_fnc_handlePlayerVehicleChanged; + * [player, cursorObject] call ace_mk6mortar_fnc_handlePlayerVehicleChanged * * Public: No */ @@ -24,83 +24,78 @@ if !(_newVehicle isKindOf "Mortar_01_base_F") exitWith {}; private _tubeWeaponName = (weapons _newVehicle) select 0; private _fireModes = getArray (configFile >> "CfgWeapons" >> _tubeWeaponName >> "modes"); -//Restore last firemode: -private _lastFireMode = _newVehicle getVariable [QGVAR(lastFireMode), -1]; -if (_lastFireMode != -1) then { - _player action ["SwitchWeapon", _newVehicle, _player, _lastFireMode]; +// Restore last firemode +private _lastSavedWeaponsInfo = _newVehicle getVariable QGVAR(lastFireMode); + +if (!isNil "_lastSavedWeaponsInfo") then { + _newVehicle selectWeaponTurret [_lastSavedWeaponsInfo select 0, [0], _lastSavedWeaponsInfo select 1, _lastSavedWeaponsInfo select 2]; }; [{ - params ["_args", "_pfID"]; - _args params ["_mortarVeh", "_fireModes"]; + params ["_mortarVeh", "_pfhID"]; - if ((vehicle ACE_player) != _mortarVeh) then { - [_pfID] call CBA_fnc_removePerFrameHandler; - } else { + if ((vehicle ACE_player) != _mortarVeh) exitWith { + _pfhID call CBA_fnc_removePerFrameHandler; + }; - private _useMils = _mortarVeh getVariable [QGVAR(useMils), true]; + // Save firemode ('charge' from weaponstate) on vehicle + _mortarVeh setVariable [QGVAR(lastFireMode), (weaponState [_mortarVeh, [0]]) select [0, 3]]; - //Compute: 'charge' from weaponstate - private _currentFireMode = (weaponState [_mortarVeh, [0]]) select 2; - private _currentChargeMode = _fireModes find _currentFireMode; + if (shownArtilleryComputer && {!GVAR(allowComputerRangefinder)}) then { + // Don't like this solution, but it works + closeDialog 0; + [parseText "Computer Disabled"] call EFUNC(common,displayTextStructured); + }; - //Save firemode on vehicle: - _mortarVeh setVariable [QGVAR(lastFireMode), _currentChargeMode]; + private _display = uiNamespace getVariable ["ACE_Mk6_RscWeaponRangeArtillery", displayNull]; - if (shownArtilleryComputer && {!GVAR(allowComputerRangefinder)}) then { - //Don't like this solution, but it works - closeDialog 0; - [parseText "Computer Disabled"] call EFUNC(common,displayTextStructured); - }; + if (isNull _display) exitWith {}; // It may be null for the first frame - private _display = uiNamespace getVariable ["ACE_Mk6_RscWeaponRangeArtillery", displayNull]; - if (isNull _display) exitWith {}; //It may be null for the first frame + // Hud should hidden in 3rd person + private _notGunnerView = cameraView != "GUNNER"; + private _useMils = _mortarVeh getVariable [QGVAR(useMils), true]; - //Hud should hidden in 3rd person - private _notGunnerView = cameraView != "GUNNER"; + // Get aiming values from ace_artillerytables + // Note: it also handles displaying the "charge" level + private _realAzimuth = missionNamespace getVariable [QEGVAR(artillerytables,predictedAzimuth), -1]; + private _realElevation = missionNamespace getVariable [QEGVAR(artillerytables,predictedElevation), -1]; - // Get aiming values from ace_artillerytables - // Note: it also handles displaying the "charge" level - private _realAzimuth = missionNamespace getVariable [QEGVAR(artillerytables,predictedAzimuth), -1]; - private _realElevation = missionNamespace getVariable [QEGVAR(artillerytables,predictedElevation), -1]; - - //Update Heading Display: - if (_notGunnerView || (!GVAR(allowCompass))) then { - (_display displayCtrl 80156) ctrlSetText ""; + // Update Heading Display + if (_notGunnerView || !GVAR(allowCompass)) then { + (_display displayCtrl 80156) ctrlSetText ""; + } else { + if (_useMils) then { + (_display displayCtrl 80156) ctrlSetText str (((round (_realAzimuth * 6400 / 360)) + 6400) % 6400); } else { - if (_useMils) then { - (_display displayCtrl 80156) ctrlSetText str (((round (_realAzimuth * 6400 / 360)) + 6400) % 6400); - } else { - (_display displayCtrl 80156) ctrlSetText str ((round (_realAzimuth + 360)) % 360); - }; + (_display displayCtrl 80156) ctrlSetText str ((round (_realAzimuth + 360)) % 360); }; + }; - //Update CurrentElevation Display - if (_notGunnerView) then { - (_display displayCtrl 80175) ctrlSetText ""; + // Update CurrentElevation Display + if (_notGunnerView) then { + (_display displayCtrl 80175) ctrlSetText ""; + } else { + if (_useMils) then { + (_display displayCtrl 80175) ctrlSetText str ((round (_realElevation * 6400 / 360)) % 6400); } else { - if (_useMils) then { - (_display displayCtrl 80175) ctrlSetText str ((round (_realElevation * 6400 / 360)) % 6400); - } else { - (_display displayCtrl 80175) ctrlSetText str (((round (_realElevation * 100)) / 100) % 360); - }; + (_display displayCtrl 80175) ctrlSetText str (((round (_realElevation * 100)) / 100) % 360); }; + }; - //Update ElevationNeeded Display: - if (_notGunnerView || (!GVAR(allowComputerRangefinder))) then { - (_display displayCtrl 80176) ctrlSetText ""; + // Update ElevationNeeded Display + if (_notGunnerView || !GVAR(allowComputerRangefinder)) then { + (_display displayCtrl 80176) ctrlSetText ""; + } else { + private _elevDeg = parseNumber ctrlText (_display displayCtrl 176); + if (_elevDeg <= 0) then { // Bad data means "----" out of range + (_display displayCtrl 80176) ctrlSetText (ctrlText (_display displayCtrl 176)); } else { - private _elevDeg = parseNumber ctrlText (_display displayCtrl 176); - if (_elevDeg <= 0) then { //Bad data means "----" out of range - (_display displayCtrl 80176) ctrlSetText (ctrlText (_display displayCtrl 176)); + _elevDeg = _elevDeg + (_realElevation - (parseNumber ctrlText (_display displayCtrl 175))); + if (_useMils) then { + (_display displayCtrl 80176) ctrlSetText str round ((round (_elevDeg * 6400 / 360)) % 6400); } else { - _elevDeg = _elevDeg + (_realElevation - (parseNumber ctrlText (_display displayCtrl 175))); - if (_useMils) then { - (_display displayCtrl 80176) ctrlSetText str round ((round (_elevDeg * 6400 / 360)) % 6400); - } else { - (_display displayCtrl 80176) ctrlSetText str (((round (_elevDeg * 100)) / 100) % 360); - }; + (_display displayCtrl 80176) ctrlSetText str (((round (_elevDeg * 100)) / 100) % 360); }; }; }; -}, 0, [_newVehicle, _fireModes]] call CBA_fnc_addPerFrameHandler; +}, 0, _newVehicle] call CBA_fnc_addPerFrameHandler; diff --git a/addons/mk6mortar/initSettings.inc.sqf b/addons/mk6mortar/initSettings.inc.sqf index fc900295626..15047dee296 100644 --- a/addons/mk6mortar/initSettings.inc.sqf +++ b/addons/mk6mortar/initSettings.inc.sqf @@ -3,41 +3,41 @@ private _category = [format ["ACE %1", localize "str_a3_cfgmarkers_nato_art"], localize LSTRING(DisplayName)]; [ - QGVAR(airResistanceEnabled), "CHECKBOX", + QGVAR(airResistanceEnabled), + "CHECKBOX", [LSTRING(airResistanceEnabled_DisplayName), LSTRING(airResistanceEnabled_Description)], _category, false, // default value - true, // isGlobal + 1, // isGlobal {[QGVAR(airResistanceEnabled), _this] call EFUNC(common,cbaSettings_settingChanged)}, true // Needs mission restart ] call CBA_fnc_addSetting; [ - QGVAR(allowComputerRangefinder), "CHECKBOX", + QGVAR(allowComputerRangefinder), + "CHECKBOX", [LSTRING(allowComputerRangefinder_DisplayName), LSTRING(allowComputerRangefinder_Description)], _category, true, // default value - true, // isGlobal - {[QGVAR(allowComputerRangefinder), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true // Needs mission restart + 1 // isGlobal ] call CBA_fnc_addSetting; [ - QGVAR(allowCompass), "CHECKBOX", + QGVAR(allowCompass), + "CHECKBOX", [LSTRING(allowCompass_DisplayName), LSTRING(allowCompass_Description)], _category, true, // default value - true, // isGlobal - {[QGVAR(allowCompass), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true // Needs mission restart + 1 // isGlobal ] call CBA_fnc_addSetting; [ - QGVAR(useAmmoHandling), "CHECKBOX", + QGVAR(useAmmoHandling), + "CHECKBOX", [LSTRING(useAmmoHandling_DisplayName), LSTRING(useAmmoHandling_Description)], _category, false, // default value - true, // isGlobal + 1, // isGlobal {[QGVAR(useAmmoHandling), _this] call EFUNC(common,cbaSettings_settingChanged)}, true // Needs mission restart ] call CBA_fnc_addSetting; diff --git a/addons/mk6mortar/stringtable.xml b/addons/mk6mortar/stringtable.xml index c6f29a037d8..186cd926849 100644 --- a/addons/mk6mortar/stringtable.xml +++ b/addons/mk6mortar/stringtable.xml @@ -120,10 +120,10 @@ <Turkish>Hava Direnci</Turkish> </Key> <Key ID="STR_ACE_Mk6Mortar_airResistanceEnabled_Description"> - <English>For Player Shots, Model Air Resistance and Wind Effects</English> + <English>Simulates air resistance and wind effects for player shots.</English> <Polish>Modeluj opór powietrza oraz wpływ wiatru na tor lotu pocisku dla strzałów z moździerza Mk6 przez graczy</Polish> <Spanish>Para disparos del jugador, modelo de resistencia al aire y efectos de viento</Spanish> - <German>Für Spielerschüsse, Luftwiderstand und Windeffekte</German> + <German>Simuliert Luftwiderstand und Windeffekte für Spielerschüsse.</German> <Czech>Pro hráčovu střelbu, Model odporu vzduchu a povětrných podmínek</Czech> <Portuguese>Para disparos do jogador, modelo de resistência de ar e efeitos de vento</Portuguese> <French>Pour les tirs des joueurs, simule la résistance de l'air et les effets du vent.</French> @@ -233,19 +233,19 @@ <Czech>Používat ruční manipulaci s municí</Czech> </Key> <Key ID="STR_ACE_Mk6Mortar_useAmmoHandling_Description"> - <English>Removes mortar magazines, requiring individual rounds to be loaded by the gunner or loader. Does not affect AI mortars.</English> - <German>Enfernt das Magzin des Mörsers. Es ist nun erforderlich, die einzelnen Patronen manuell zu laden. Dies beeinflusst nicht die KI-Truppen.</German> - <Spanish>Elimina los cargadores del mortero, requiriendo al artillero o cargador la carga manual de cada rondas. No afecta morteros controlados por IA.</Spanish> - <Polish>Usuwa magazynki moździerza, wymagając ładowania pojedynczych pocisków przez strzelca lub ładowniczego. Nie dotyczy moździerzy AI.</Polish> - <French>Enlève les chargeurs de mortier, ce qui oblige le tireur ou le servant à charger les obus manuellement. N'affecte pas les mortiers IA.</French> - <Italian>Rimuove i caricatori di colpi dal mortaio. Un operatore dovrà caricare proiettili singoli prima di poter fare fuoco. Non viene applicato su operatori IA.</Italian> - <Portuguese>Elimina os carregadores do morteiro, requerendo que o atirador ou carregador utilize de forma individual a munição. Não afeta os morteiros controlados pela IA.</Portuguese> - <Russian>Удаляет артиллерийские магазины, требует загрузку отдельных снарядов стрелком или заряжающим. Не влияет на артиллерию ИИ.</Russian> - <Japanese>迫撃砲から弾倉を除去します。一発ずつ射手か装填手によって装填される必要があります。AIの迫撃砲には影響を与えません。</Japanese> - <Korean>박격포 탄창을 제거합니다, 사수나 장전수가 개별적으로 탄환을 넣어줘야 합니다. 인공지능은 영향을 받지 않습니다.</Korean> - <Chinesesimp>开启此功能时。迫击炮的弹药需由炮手与装填手共同合作来进行装填。此功能并不影响由 AI 射击的迫击炮</Chinesesimp> - <Chinese>開啟此功能時。迫擊砲的彈藥需由砲手與裝填手共同合作來進行裝填。此功能並不影響由AI射擊的迫擊砲</Chinese> - <Czech>Odstraní z minometu zásobník a vynucuje nabíjení po každém výstřelu buď mířičem nebo nabíječem. Tato možnost neovlivňuje AI posádky.</Czech> + <English>Removes mortar magazines, requiring individual rounds to be loaded by the gunner or loader.</English> + <German>Enfernt das Magzin des Mörsers. Es ist nun erforderlich, die einzelnen Patronen manuell zu laden.</German> + <Spanish>Elimina los cargadores del mortero, requiriendo al artillero o cargador la carga manual de cada rondas.</Spanish> + <Polish>Usuwa magazynki moździerza, wymagając ładowania pojedynczych pocisków przez strzelca lub ładowniczego.</Polish> + <French>Enlève les chargeurs de mortier, ce qui oblige le tireur ou le servant à charger les obus manuellement.</French> + <Italian>Rimuove i caricatori di colpi dal mortaio. Un operatore dovrà caricare proiettili singoli prima di poter fare fuoco.</Italian> + <Portuguese>Elimina os carregadores do morteiro, requerendo que o atirador ou carregador utilize de forma individual a munição.</Portuguese> + <Russian>Удаляет артиллерийские магазины, требует загрузку отдельных снарядов стрелком или заряжающим.</Russian> + <Japanese>迫撃砲から弾倉を除去します。一発ずつ射手か装填手によって装填される必要があります。</Japanese> + <Korean>박격포 탄창을 제거합니다, 사수나 장전수가 개별적으로 탄환을 넣어줘야 합니다.</Korean> + <Chinesesimp>开启此功能时。迫击炮的弹药需由炮手与装填手共同合作来进行装填</Chinesesimp> + <Chinese>開啟此功能時。迫擊砲的彈藥需由砲手與裝填手共同合作來進行裝填</Chinese> + <Czech>Odstraní z minometu zásobník a vynucuje nabíjení po každém výstřelu buď mířičem nebo nabíječem.</Czech> </Key> <Key ID="STR_ACE_Mk6Mortar_unloadMortar"> <English>Remove Round</English> diff --git a/addons/movement/functions/fnc_handleClimb.sqf b/addons/movement/functions/fnc_handleClimb.sqf index 1325f2f021e..a54007862e3 100644 --- a/addons/movement/functions/fnc_handleClimb.sqf +++ b/addons/movement/functions/fnc_handleClimb.sqf @@ -24,5 +24,5 @@ private _pos = _unit modelToWorldVisual (_unit selectionPosition "camera"); _pos = _pos vectorDiff (_unit selectionPosition "camera"); -_unit setPosASL (AGLtoASL _pos); -TRACE_2("",AGLtoASL _pos,getPosASL _unit); +_unit setPosASL (AGLToASL _pos); +TRACE_2("",AGLToASL _pos,getPosASL _unit); diff --git a/addons/nametags/functions/fnc_drawNameTagIcon.sqf b/addons/nametags/functions/fnc_drawNameTagIcon.sqf index efe0c6bf157..ea6f16ebc39 100644 --- a/addons/nametags/functions/fnc_drawNameTagIcon.sqf +++ b/addons/nametags/functions/fnc_drawNameTagIcon.sqf @@ -25,7 +25,7 @@ TRACE_1("drawName:",_this); params ["", "_target", "", "_heightOffset"]; -_fnc_parameters = { +private _fnc_parameters = { params ["_player", "_target", "_alpha", "_heightOffset", "_drawName", "_drawRank", "_drawSoundwave"]; //Set Icon: @@ -44,11 +44,11 @@ _fnc_parameters = { private _targetFaction = _target getVariable [QGVAR(faction), faction _target]; private _customRankIcons = GVAR(factionRanks) get _targetFaction; - if (!isNil "_customRankIcons") then { - _customRankIcons param [ALL_RANKS find rank _target, ""] // return - } else { + if (isNil "_customRankIcons") then { // default rank icons format ["\A3\Ui_f\data\GUI\Cfg\Ranks\%1_gs.paa", rank _target] // return + } else { + _customRankIcons param [ALL_RANKS find rank _target, ""] // return }; }; }; diff --git a/addons/nametags/functions/fnc_onDraw3d.sqf b/addons/nametags/functions/fnc_onDraw3d.sqf index f831a3209fc..75a24e528d8 100644 --- a/addons/nametags/functions/fnc_onDraw3d.sqf +++ b/addons/nametags/functions/fnc_onDraw3d.sqf @@ -37,17 +37,17 @@ if (GVAR(showPlayerNames) == 4) then { private _camPosAGL = positionCameraToWorld [0, 0, 0]; if !((_camPosAGL select 0) isEqualType 0) exitWith {}; // handle RHS / bugged vehicle slots -private _camPosASL = AGLtoASL _camPosAGL; +private _camPosASL = AGLToASL _camPosAGL; // Show nametag for the unit behind the cursor or its commander if (_enabledTagsCursor) then { private _target = cursorTarget; if !(_target isKindOf "CAManBase") then { // When cursorTarget is on a vehicle show the nametag for the commander. - if !(_target in allUnitsUAV) then { - _target = effectiveCommander _target; - } else { + if (_target in allUnitsUAV) then { _target = objNull; + } else { + _target = effectiveCommander _target; }; }; if (isNull _target) exitWith {}; @@ -78,6 +78,7 @@ if (_enabledTagsCursor) then { if (_enabledTagsNearby) then { // Find valid targets and cache them private _targets = [[], { + //IGNORE_PRIVATE_WARNING ["_camPosAGL", "_maxDistance"]; private _nearMen = _camPosAGL nearObjects ["CAManBase", _maxDistance + 7]; _nearMen = _nearMen select { _x != ACE_player && @@ -115,7 +116,7 @@ if (_enabledTagsNearby) then { private _screenPos = worldToScreen (_target modelToWorld (_target selectionPosition "head")); if (_screenPos isNotEqualTo []) then { // Distance from center / half of screen width - _centerOffsetFactor = 1 - ((_screenPos distance2D [0.5, 0.5]) / (safezoneW / 3)); + _centerOffsetFactor = 1 - ((_screenPos distance2D [0.5, 0.5]) / (safeZoneW / 3)); } else { _centerOffsetFactor = 0; }; diff --git a/addons/nametags/stringtable.xml b/addons/nametags/stringtable.xml index 9f410c6a75b..1aed143b18e 100644 --- a/addons/nametags/stringtable.xml +++ b/addons/nametags/stringtable.xml @@ -29,7 +29,7 @@ <Hungarian>Ez a modul lehetővé teszi a névcímkék beállításainak testreszabását.</Hungarian> <Russian>Этот модуль позволяет настроить опции и дистанцию отображения имен игроков.</Russian> <Italian>Questo modulo ti consente di personalizzare le impostazioni ed la distanza visibile delle Etichette Nomi</Italian> - <Japanese>このモジュールを使用すると、ネーム タグの設定と範囲を調整できます。</Japanese> + <Japanese>このモジュールを使用すると、ネーム タグの範囲と設定を調整できます。</Japanese> <Korean>이 모듈은 당신이 이름표의 범위를 임의로 수정할 수 있게 해줍니다.</Korean> <Chinesesimp>这个模块允许您设定名字和显示范围等设定</Chinesesimp> <Chinese>這個模塊允許您設定名稱和顯示範圍等設定</Chinese> diff --git a/addons/nightvision/RscTitles.hpp b/addons/nightvision/RscTitles.hpp index 1a4d030e015..f3b1d1870f6 100644 --- a/addons/nightvision/RscTitles.hpp +++ b/addons/nightvision/RscTitles.hpp @@ -28,13 +28,13 @@ class RscTitles { idc = 1002; text = "#(argb,8,8,3)color(0,0,0,1)"; x = "safeZoneXAbs"; - Y = "safezoneY"; - W = "(safezoneX - safeZoneXAbs) * ((getResolution select 4)/(16/3))"; + Y = "safeZoneY"; + W = "(safeZoneX - safeZoneXAbs) * ((getResolution select 4)/(16/3))"; H = "safeZoneH"; }; class trippleHeadRight: trippleHeadLeft { idc = 1003; - x = "safeZoneXAbs + safeZoneWAbs - (safezoneX - safeZoneXABS) * ((getResolution select 4)/(16/3))"; + x = "safeZoneXAbs + safeZoneWAbs - (safeZoneX - safeZoneXABS) * ((getResolution select 4)/(16/3))"; }; }; }; diff --git a/addons/nightvision/XEH_postInit.sqf b/addons/nightvision/XEH_postInit.sqf index 5a1aa19b82e..2933877771c 100644 --- a/addons/nightvision/XEH_postInit.sqf +++ b/addons/nightvision/XEH_postInit.sqf @@ -21,6 +21,9 @@ GVAR(ppeffectRadialBlur) = -1; GVAR(ppeffectColorCorrect) = -1; GVAR(ppeffectBlur) = -1; +if (isNil QGVAR(const_MaxBrightness)) then { GVAR(const_MaxBrightness) = 0; }; +if (isNil QGVAR(const_MinBrightness)) then { GVAR(const_MinBrightness) = -6; }; + GVAR(isUsingMagnification) = false; ["CBA_settingsInitialized", { diff --git a/addons/nightvision/functions/fnc_changeNVGBrightness.sqf b/addons/nightvision/functions/fnc_changeNVGBrightness.sqf index 1697fa907e8..d0b210fe295 100644 --- a/addons/nightvision/functions/fnc_changeNVGBrightness.sqf +++ b/addons/nightvision/functions/fnc_changeNVGBrightness.sqf @@ -23,7 +23,7 @@ private _effectsEnabled = GVAR(effectScaling) != 0; private _defaultBrightness = [-3, 0] select _effectsEnabled; private _brightness = _player getVariable [QGVAR(NVGBrightness), _defaultBrightness]; -_brightness = ((_brightness + _changeInBrightness) min 0) max -6; +_brightness = ((_brightness + _changeInBrightness) min GVAR(const_MaxBrightness)) max GVAR(const_MinBrightness); _player setVariable [QGVAR(NVGBrightness), _brightness, false]; // Display default setting as 0 diff --git a/addons/nightvision/functions/fnc_pfeh.sqf b/addons/nightvision/functions/fnc_pfeh.sqf index dbd101631cd..9d5f6e93bb8 100644 --- a/addons/nightvision/functions/fnc_pfeh.sqf +++ b/addons/nightvision/functions/fnc_pfeh.sqf @@ -163,7 +163,9 @@ if (CBA_missionTime < GVAR(nextEffectsUpdate)) then { }; _fogApply = linearConversion [0, 1, GVAR(priorFog) select 0, (GVAR(fogScaling) * _fogApply), 1]; // mix in old fog if present - GVAR(nvgFog) = [_fogApply, 0, 0]; + GVAR(nvgFog) = fogParams; + GVAR(nvgFog) set [0, _fogApply]; + 0 setFog GVAR(nvgFog) }; diff --git a/addons/nightvision/functions/fnc_refreshGoggleType.sqf b/addons/nightvision/functions/fnc_refreshGoggleType.sqf index ccfbd017b6f..2c7dedaa834 100644 --- a/addons/nightvision/functions/fnc_refreshGoggleType.sqf +++ b/addons/nightvision/functions/fnc_refreshGoggleType.sqf @@ -106,7 +106,7 @@ if (_borderImage == "") then { _borderImageCtrl ctrlSetFade ([.15, 0] select _eyeCups); #define BORDER_SIZE 3 - GVAR(defaultPositionBorder) = [safezoneX - (((BORDER_SIZE * 0.75) * safezoneH) - safezoneW) / 2, safezoneY - ((BORDER_SIZE - 1) / 2) * safezoneH, (BORDER_SIZE * 0.75) * safezoneH, BORDER_SIZE * safezoneH]; + GVAR(defaultPositionBorder) = [safeZoneX - (((BORDER_SIZE * 0.75) * safeZoneH) - safeZoneW) / 2, safeZoneY - ((BORDER_SIZE - 1) / 2) * safeZoneH, (BORDER_SIZE * 0.75) * safeZoneH, BORDER_SIZE * safeZoneH]; [_borderImageCtrl, GVAR(defaultPositionBorder), _scale] call FUNC(scaleCtrl); }; @@ -119,7 +119,7 @@ if (_hideHex) then { _hexCtrl ctrlSetText QPATHTOF(data\nvg_mask_hexes_thin.paa); #define HEX_SIZE 1.5 - GVAR(defaultPositionHex) = [safezoneX - (((HEX_SIZE * 0.75) * safezoneH) - safezoneW) / 2, safezoneY - ((HEX_SIZE - 1) / 2) * safezoneH, (HEX_SIZE * 0.75) * safezoneH, HEX_SIZE * safezoneH]; + GVAR(defaultPositionHex) = [safeZoneX - (((HEX_SIZE * 0.75) * safeZoneH) - safeZoneW) / 2, safeZoneY - ((HEX_SIZE - 1) / 2) * safeZoneH, (HEX_SIZE * 0.75) * safeZoneH, HEX_SIZE * safeZoneH]; [_hexCtrl, GVAR(defaultPositionHex), _scale] call FUNC(scaleCtrl); }; diff --git a/addons/nightvision/stringtable.xml b/addons/nightvision/stringtable.xml index 1c1cd61ba7a..1911681dd68 100644 --- a/addons/nightvision/stringtable.xml +++ b/addons/nightvision/stringtable.xml @@ -28,6 +28,7 @@ <Chinesesimp>夜视仪(一代,棕色)</Chinesesimp> <Korean>아투경 (1세대, 갈색)</Korean> <Spanish>Gafas de visión nocturna (Gen1, Marrón)</Spanish> + <Portuguese>Óculos de Visão Noturna (Gen1, Marrom)</Portuguese> </Key> <Key ID="STR_ACE_NightVision_NVG_Gen1_black"> <English>NV Goggles (Gen1, Black)</English> @@ -40,6 +41,7 @@ <Chinesesimp>夜视仪(一代,黑色)</Chinesesimp> <Korean>아투경 (1세대, 검정)</Korean> <Spanish>Gafas de visión nocturna (Gen1, Negro)</Spanish> + <Portuguese>Óculos de Visão Noturna (Gen1, Preto)</Portuguese> </Key> <Key ID="STR_ACE_NightVision_NVG_Gen1_green"> <English>NV Goggles (Gen1, Green)</English> @@ -52,6 +54,7 @@ <Chinesesimp>夜视仪(一代,绿色)</Chinesesimp> <Korean>아투경 (1세대, 녹색)</Korean> <Spanish>Gafas de visión nocturna (Gen1, Verde)</Spanish> + <Portuguese>Óculos de Visão Noturna (Gen1, Verde)</Portuguese> </Key> <Key ID="STR_ACE_NightVision_NVG_Gen2_brown"> <English>NV Goggles (Gen2, Brown)</English> @@ -64,6 +67,7 @@ <Chinesesimp>夜视仪(二代,棕色)</Chinesesimp> <Korean>아투경 (2세대, 갈색)</Korean> <Spanish>Gafas de visión nocturna (Gen2, Marrón)</Spanish> + <Portuguese>Óculos de Visão Noturna (Gen2, Marrom)</Portuguese> </Key> <Key ID="STR_ACE_NightVision_NVG_Gen2_black"> <English>NV Goggles (Gen2, Black)</English> @@ -76,6 +80,7 @@ <Chinesesimp>夜视仪(二代,黑色)</Chinesesimp> <Korean>아투경 (2세대, 검정)</Korean> <Spanish>Gafas de visión nocturna (Gen2, Negro)</Spanish> + <Portuguese>Óculos de Visão Noturna (Gen2, Preto)</Portuguese> </Key> <Key ID="STR_ACE_NightVision_NVG_Gen2_green"> <English>NV Goggles (Gen2, Green)</English> @@ -88,6 +93,7 @@ <Chinesesimp>夜视仪(二代,绿色)</Chinesesimp> <Korean>아투경 (2세대, 녹색)</Korean> <Spanish>Gafas de visión nocturna (Gen2, Verde)</Spanish> + <Portuguese>Óculos de Visão Noturna (Gen2, Verde)</Portuguese> </Key> <Key ID="STR_ACE_NightVision_NVG_Gen3"> <English>NV Goggles (Gen3)</English> @@ -96,7 +102,7 @@ <German>NS-Brille (3. Gen.)</German> <Italian>Visore Notturno (Gen3)</Italian> <Polish>Gogle noktowizyjne (Gen3)</Polish> - <Portuguese>Óculos de visão noturna (Gen3)</Portuguese> + <Portuguese>Óculos de Visão Noturna (Gen3)</Portuguese> <Russian>ПНВ (Gen3)</Russian> <Spanish>Gafas de visión nocturna (Gen3)</Spanish> <Hungarian>Éjjellátó szemüveg (3. Gen.)</Hungarian> @@ -113,7 +119,7 @@ <German>NS-Brille (3. Gen., braun)</German> <Italian>Visore Notturno (Gen3, Marrone)</Italian> <Polish>Gogle noktowizyjne (Gen3, Brązowe)</Polish> - <Portuguese>Óculos de visão noturna (Gen3, marrons)</Portuguese> + <Portuguese>Óculos de Visão Noturna (Gen3, Marrom)</Portuguese> <Russian>ПНВ (Gen3, Коричневый)</Russian> <Spanish>Gafas de visión nocturna (Gen3, Marrón)</Spanish> <Hungarian>Éjjellátó szemüveg (3. Gen., barna)</Hungarian> @@ -133,6 +139,7 @@ <French>JVN (Gen3, marron, WP)</French> <Russian>ПНВ (Gen3, Коричневый, БФ)</Russian> <Spanish>Gafas de visión nocturna (Gen3, Marrón, FB)</Spanish> + <Portuguese>Óculos de Visão Noturna (Gen3, Marrom, FB)</Portuguese> </Key> <Key ID="STR_ACE_NightVision_NVG_WP_desc"> <English>Night Vision Goggles, White Phosphor</English> @@ -144,6 +151,7 @@ <French>Jumelles Vision Nocturne, Phosphore blanc</French> <Russian>Очки ночного видения, белый фосфор</Russian> <Spanish>Gafas de Visión Nocturna, Fósforo Blanco</Spanish> + <Portuguese>Óculos de Visão Nortuna, Fósforo Branco</Portuguese> </Key> <Key ID="STR_ACE_NightVision_NVG_Gen3_green"> <English>NV Goggles (Gen3, Green)</English> @@ -152,7 +160,7 @@ <German>NS-Brille (3. Gen., grün)</German> <Italian>Visore Notturno (Gen3, Verde)</Italian> <Polish>Gogle noktowizyjne (Gen3, Zielone)</Polish> - <Portuguese>Óculos de visão noturna (Gen3, verdes)</Portuguese> + <Portuguese>Óculos de Visão Noturna (Gen3, verdes)</Portuguese> <Russian>ПНВ (Gen3, Зелёный)</Russian> <Spanish>Gafas de visión nocturna (Gen3, Verde)</Spanish> <Hungarian>Éjjellátó szemüveg (3. Gen., zöld)</Hungarian> @@ -172,6 +180,7 @@ <French>JVN (Gen3, vertes, WP)</French> <Russian>ПНВ (Gen3, Зелёный, БФ)</Russian> <Spanish>Gafas de visión nocturna (Gen3, Verde, FB)</Spanish> + <Portuguese>Óculos de Visão Noturna (Gen3, Verde, FB)</Portuguese> </Key> <Key ID="STR_ACE_NightVision_NVG_Gen3_black"> <English>NV Goggles (Gen3, Black)</English> @@ -180,7 +189,7 @@ <German>NS-Brille (3. Gen., schwarz)</German> <Italian>Visore Notturno (Gen3, Nero)</Italian> <Polish>Gogle noktowizyjne (Gen3, Czarne)</Polish> - <Portuguese>Óculos de visão noturna (Gen3, pretos)</Portuguese> + <Portuguese>Óculos de Visão Noturna (Gen3, Preto)</Portuguese> <Russian>ПНВ (Gen3, Чёрный)</Russian> <Spanish>Gafas de visión nocturna (Gen3, Negro)</Spanish> <Hungarian>Éjjellátó szemüveg (3. Gen., fekete)</Hungarian> @@ -200,6 +209,7 @@ <French>JVN (Gen3, noires, WP)</French> <Russian>ПНВ (Gen3, Чёрный, БФ)</Russian> <Spanish>Gafas de visión nocturna (Gen3, Negro, FB)</Spanish> + <Portuguese>Óculos de Visão Noturna (Gen3, Preto, FB)</Portuguese> </Key> <Key ID="STR_ACE_NightVision_NVG_Gen4_brown"> <English>NV Goggles (Gen4, Brown)</English> @@ -212,6 +222,7 @@ <Chinesesimp>夜视仪(四代,棕色)</Chinesesimp> <Korean>야투경 (4세대, 갈색)</Korean> <Spanish>Gafas de visión nocturna (Gen4, Marrón)</Spanish> + <Portuguese>Óculos de Visão Noturna (Gen4, Marrom)</Portuguese> </Key> <Key ID="STR_ACE_NightVision_NVG_Gen4_brown_WP"> <English>NV Goggles (Gen4, Brown, WP)</English> @@ -223,6 +234,7 @@ <French>JVN (Gen4, marron, WP)</French> <Russian>ПНВ (Gen4, Коричневый, БФ)</Russian> <Spanish>Gafas de visión nocturna (Gen4, Marrón, FB)</Spanish> + <Portuguese>Óculos de Visão Noturna (Gen4, Marrom, FB)</Portuguese> </Key> <Key ID="STR_ACE_NightVision_NVG_Gen4_black"> <English>NV Goggles (Gen4, Black)</English> @@ -235,6 +247,7 @@ <Chinesesimp>夜视仪(四代,黑色)</Chinesesimp> <Korean>야투경 (4세대, 검정)</Korean> <Spanish>Gafas de visión nocturna (Gen4, Negro)</Spanish> + <Portuguese>Óculos de Visão Noturna (Gen4, Preto)</Portuguese> </Key> <Key ID="STR_ACE_NightVision_NVG_Gen4_black_WP"> <English>NV Goggles (Gen4, Black, WP)</English> @@ -246,6 +259,7 @@ <French>JVN (Gen4, noires, WP)</French> <Russian>ПНВ (Gen4, Чёрный, БФ)</Russian> <Spanish>Gafas de visión nocturna (Gen4, Negro, FB)</Spanish> + <Portuguese>Óculos de Visão Noturna (Gen4, Preto, FB)</Portuguese> </Key> <Key ID="STR_ACE_NightVision_NVG_Gen4_green"> <English>NV Goggles (Gen4, Green)</English> @@ -258,6 +272,7 @@ <Chinesesimp>夜视仪(四代,绿色)</Chinesesimp> <Korean>야투경 (4세대, 녹색)</Korean> <Spanish>Gafas de visión nocturna (Gen4, Verde)</Spanish> + <Portuguese>Óculos de Visão Noturna (Gen4, Verde)</Portuguese> </Key> <Key ID="STR_ACE_NightVision_NVG_Gen4_green_WP"> <English>NV Goggles (Gen4, Green, WP)</English> @@ -269,6 +284,7 @@ <French>JVN (Gen4, vertes, WP)</French> <Russian>ПНВ (Gen4, Зелёный, БФ)</Russian> <Spanish>Gafas de visión nocturna (Gen4, Verde, FB)</Spanish> + <Portuguese>Óculos de Visão Noturna (Gen4, Verde, FB)</Portuguese> </Key> <Key ID="STR_ACE_NightVision_NVG_Wide_brown"> <English>NV Goggles (Wide, Brown)</English> @@ -281,6 +297,7 @@ <Chinesesimp>夜视仪(宽,棕色)</Chinesesimp> <Korean>야투경 (넓음, 갈색)</Korean> <Spanish>Gafas de visión nocturna (Panorámicas, Marrón)</Spanish> + <Portuguese>Óculos de Visão Noturna (Panorâmico, Marrom)</Portuguese> </Key> <Key ID="STR_ACE_NightVision_NVG_Wide_brown_WP"> <English>NV Goggles (Wide, Brown, WP)</English> @@ -292,6 +309,7 @@ <French>JVN (Large, marron, WP)</French> <Russian>ПНВ (Широкий, Коричневый, БФ)</Russian> <Spanish>Gafas de visión nocturna (Panorámicas, Marrón, FB)</Spanish> + <Portuguese>Óculos de Visão Noturna (Panorâmico, Marrom, FB)</Portuguese> </Key> <Key ID="STR_ACE_NightVision_NVG_Wide_black"> <English>NV Goggles (Wide, Black)</English> @@ -304,6 +322,7 @@ <Chinesesimp>夜视仪(宽,黑色)</Chinesesimp> <Korean>야투경 (넓음, 검정)</Korean> <Spanish>Gafas de visión nocturna (Panorámicas, Negro)</Spanish> + <Portuguese>Óculos de Visão Noturna (Panorâmico, Preto)</Portuguese> </Key> <Key ID="STR_ACE_NightVision_NVG_Wide_black_WP"> <English>NV Goggles (Wide, Black, WP)</English> @@ -315,6 +334,7 @@ <French>JVN (Large, noires, WP)</French> <Russian>ПНВ (Широкий, Чёрный, БФ)</Russian> <Spanish>Gafas de visión nocturna (Panorámicas, Negro, FB)</Spanish> + <Portuguese>Óculos de Visão Noturna (Panorâmico, Preto, FB)</Portuguese> </Key> <Key ID="STR_ACE_NightVision_NVG_Wide_green"> <English>NV Goggles (Wide, Green)</English> @@ -327,6 +347,7 @@ <Chinesesimp>夜视仪(宽,绿色)</Chinesesimp> <Korean>야투경 (넓음, 녹색)</Korean> <Spanish>Gafas de visión nocturna (Panorámicas, Verde)</Spanish> + <Portuguese>Óculos de Visão Noturna (Panorâmico, Verde)</Portuguese> </Key> <Key ID="STR_ACE_NightVision_NVG_Wide_green_WP"> <English>NV Goggles (Wide, Green, WP)</English> @@ -338,6 +359,7 @@ <French>JVN (Large, vertes, WP)</French> <Russian>ПНВ (Широкий, Зелёный, БФ)</Russian> <Spanish>Gafas de visión nocturna (Panorámicas, Verde, FB)</Spanish> + <Portuguese>Óculos de Visão Noturna (Panorâmico, Verde, FB)</Portuguese> </Key> <Key ID="STR_ACE_NightVision_NVGBrightness"> <English>Brightness: %1</English> @@ -365,7 +387,7 @@ <French>Augmenter la luminosité des JVN</French> <Russian>Увеличить яркость ПНВ</Russian> <Hungarian>Éjjellátó fényerejének növelése</Hungarian> - <Portuguese>Aumentar Luminosidade do EVN</Portuguese> + <Portuguese>Aumentar Luminosidade do OVN</Portuguese> <Italian>Aumenta la luminosità dell'NVG</Italian> <Japanese>暗視装置の明度を上げる</Japanese> <Korean>야투경 밝기 높이기</Korean> @@ -382,7 +404,7 @@ <French>Abaisser la luminosité des JVN</French> <Russian>Уменьшить яркость ПНВ</Russian> <Hungarian>Éjjellátó fényerejének csökkentése</Hungarian> - <Portuguese>Diminuir Luminosidade do EVN</Portuguese> + <Portuguese>Diminuir Luminosidade do OVN</Portuguese> <Italian>Riduci la luminosità dell'NVG</Italian> <Japanese>暗視装置の明度を下げる</Japanese> <Korean>야투경 밝기 줄이기</Korean> @@ -598,6 +620,7 @@ <French>Génération de jumelles de vision nocturne</French> <Russian>Генерация ночного видения</Russian> <Spanish>Generación de Visión Nocturna</Spanish> + <Portuguese>Geração de Visão Noturna</Portuguese> </Key> <Key ID="STR_ACE_NightVision_statGen"> <English>Gen %1</English> @@ -609,6 +632,7 @@ <French>Gen %1</French> <Russian>Генерация %1</Russian> <Spanish>Gen %1</Spanish> + <Portuguese>Gen %1</Portuguese> </Key> </Package> </Project> diff --git a/addons/nlaw/ACE_GuidanceConfig.hpp b/addons/nlaw/ACE_GuidanceConfig.hpp index e04753d6816..6003586fe86 100644 --- a/addons/nlaw/ACE_GuidanceConfig.hpp +++ b/addons/nlaw/ACE_GuidanceConfig.hpp @@ -12,3 +12,9 @@ class EGVAR(missileguidance,SeekerTypes) { functionName = QFUNC(seeker); }; }; +class EGVAR(missileguidance,NavigationTypes) { + class GVAR(PLOS) { + functionName = QFUNC(navigation); + onFired = QFUNC(navigation_onFired); + }; +}; diff --git a/addons/nlaw/CfgAmmo.hpp b/addons/nlaw/CfgAmmo.hpp index b579ebeb065..650fa148873 100644 --- a/addons/nlaw/CfgAmmo.hpp +++ b/addons/nlaw/CfgAmmo.hpp @@ -1,39 +1,11 @@ +class ace_missileguidance_type_Nlaw; class CfgAmmo { class M_NLAW_AT_F; class ACE_NLAW: M_NLAW_AT_F { hit = 400; // Default was 500 indirectHit = 20; // Default was 15 - class ace_missileguidance { + class ace_missileguidance: ace_missileguidance_type_Nlaw { enabled = 1; - - minDeflection = 0.0005; // Minium flap deflection for guidance - maxDeflection = 0.01; // Maximum flap deflection for guidance - incDeflection = 0.0005; // The incrmeent in which deflection adjusts. - - canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode - - // Guidance type for munitions - defaultSeekerType = QGVAR(seeker); - seekerTypes[] = {QGVAR(seeker)}; - - defaultSeekerLockMode = "LOBL"; - seekerLockModes[] = {"LOBL"}; - - seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] - seekerAngle = 45; // Angle in front of the missile which can be searched - seekerAccuracy = 1; // seeker accuracy multiplier - - seekerMinRange = 0; - seekerMaxRange = 10; // Range from the missile which the seeker can visually search - - // Attack profile type selection - defaultAttackProfile = QGVAR(directAttack); - attackProfiles[] = {QGVAR(directAttack), QGVAR(overflyTopAttack)}; - useModeForAttackProfile = 1; - showHintOnCycle = 1; - - // Run once at fired event - onFired = QFUNC(onFired); }; }; diff --git a/addons/nlaw/XEH_PREP.hpp b/addons/nlaw/XEH_PREP.hpp index aad1e57efb2..1cd8dbc3c59 100644 --- a/addons/nlaw/XEH_PREP.hpp +++ b/addons/nlaw/XEH_PREP.hpp @@ -4,3 +4,5 @@ PREP(attackProfile); PREP(keyDown); PREP(onFired); PREP(seeker); +PREP(navigation); +PREP(navigation_onFired); diff --git a/addons/nlaw/XEH_postInit.sqf b/addons/nlaw/XEH_postInit.sqf index 885e2d5e2f2..5e3f35572c8 100644 --- a/addons/nlaw/XEH_postInit.sqf +++ b/addons/nlaw/XEH_postInit.sqf @@ -22,24 +22,28 @@ GVAR(pitchChange) = 0; // Visual debuging, idealy used with a moving vehicle called "testTarget" #ifdef DRAW_NLAW_INFO +GVAR(debug_firedPrediction) = []; addMissionEventHandler ["Draw3d", { + // BLACK - On fired path prediction + { drawIcon3D _x; } forEach GVAR(debug_firedPrediction); + // GREEN - Draw an object called "testTarget"'s aim pos and 1 sec aimpos predicted by velocity if ((!isNil "testTarget") && {!isNull testTarget}) then { { - drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [0,1,0,1], ASLtoAGL ((aimPos testTarget) vectorAdd ((velocity testTarget) vectorMultiply _x)), 0.75, 0.75, 0, format ["%1", _x], 1, 0.025, "TahomaB"]; + drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [0,1,0,1], ASLToAGL ((aimPos testTarget) vectorAdd ((velocity testTarget) vectorMultiply _x)), 0.75, 0.75, 0, format ["%1", _x], 1, 0.025, "TahomaB"]; } forEach [0, 1, 2, 3]; }; // RED - If lock key is down, draw weapon dir and predicted path at various times if (GVAR(yawChange) != 0) then { { - private _viewASL = AGLtoASL positionCameraToWorld [0,0,0]; + private _viewASL = AGLToASL positionCameraToWorld [0,0,0]; private _viewDir = ACE_player weaponDirection (currentWeapon ACE_player); (_viewDir call CBA_fnc_vect2Polar) params ["", "_yaw", "_pitch"]; private _realYaw = _yaw + GVAR(yawChange) * _x; private _realPitch = _pitch + GVAR(pitchChange) * _x; private _returnTargetPos = _viewASL vectorAdd ([1000, _realYaw, _realPitch] call CBA_fnc_polar2vect); - drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,0,1], ASLtoAGL _returnTargetPos, 0.75, 0.75, 0, format ["%1", _x], 1, 0.025, "TahomaB"]; + drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,0,1], ASLToAGL _returnTargetPos, 0.75, 0.75, 0, format ["%1", _x], 1, 0.025, "TahomaB"]; } forEach [0, 1, 2, 3]; }; }]; diff --git a/addons/nlaw/functions/fnc_attackProfile.sqf b/addons/nlaw/functions/fnc_attackProfile.sqf index 9628974800c..8f06e26f9c4 100644 --- a/addons/nlaw/functions/fnc_attackProfile.sqf +++ b/addons/nlaw/functions/fnc_attackProfile.sqf @@ -18,14 +18,13 @@ */ params ["_seekerTargetPos", "_args", "_attackProfileStateParams"]; + +#ifdef DRAW_NLAW_INFO _args params ["_firedEH", "_launchParams"]; _launchParams params ["","_targetLaunchParams", "", "_attackProfile"]; _targetLaunchParams params ["", "", "_launchPos"]; _firedEH params ["","","","","","","_projectile"]; -// Use seeker (if terminal) -if (_seekerTargetPos isNotEqualTo [0,0,0]) exitWith {_seekerTargetPos}; - _attackProfileStateParams params ["_startTime", "_startLOS", "_yawChange", "_pitchChange"]; (_startLOS call CBA_fnc_vect2Polar) params ["", "_yaw", "_pitch"]; @@ -36,25 +35,16 @@ private _flightTime = CBA_missionTime - _startTime; private _realYaw = _yaw + _yawChange * _flightTime; private _realPitch = _pitch + _pitchChange * _flightTime; -private _returnTargetPos = _launchPos vectorAdd ([_distanceFromLaunch, _realYaw, _realPitch] call CBA_fnc_polar2vect); - -if (_attackProfile == QGVAR(overflyTopAttack)) then { // Add 2m height in OTA attack mode - _returnTargetPos = _returnTargetPos vectorAdd [0,0,2]; -}; - - -#ifdef DRAW_NLAW_INFO -drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,1,1], ASLtoAGL _launchPos, 0.75, 0.75, 0, "LAUNCH", 1, 0.025, "TahomaB"]; -drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [0,1,1,1], ASLtoAGL (_launchPos vectorAdd (_startLOS vectorMultiply (_distanceFromLaunch + 50))), 0.75, 0.75, 0, "Original LOS", 1, 0.025, "TahomaB"]; -drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,1,0,1], ASLtoAGL (_launchPos vectorAdd ([_distanceFromLaunch + 50, _realYaw, _realPitch] call CBA_fnc_polar2vect)), 0.75, 0.75, 0, format ["Predicted @%1sec",(floor(_flightTime * 10)/10)], 1, 0.025, "TahomaB"]; -drawLine3D [ASLtoAGL _launchPos, ASLtoAGL (_launchPos vectorAdd (_startLOS vectorMultiply (_distanceFromLaunch + 50))), [1,0,0,1]]; -drawLine3D [ASLtoAGL _launchPos, ASLtoAGL (_launchPos vectorAdd ([_distanceFromLaunch + 50, _realYaw, _realPitch] call CBA_fnc_polar2vect)), [1,1,0,1]]; +drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,1,1], ASLToAGL _launchPos, 0.75, 0.75, 0, "LAUNCH", 1, 0.025, "TahomaB"]; +drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [0,1,1,1], ASLToAGL (_launchPos vectorAdd (_startLOS vectorMultiply (_distanceFromLaunch + 50))), 0.75, 0.75, 0, "Original LOS", 1, 0.025, "TahomaB"]; +drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,1,0,1], ASLToAGL (_launchPos vectorAdd ([_distanceFromLaunch + 50, _realYaw, _realPitch] call CBA_fnc_polar2vect)), 0.75, 0.75, 0, format ["Predicted @%1sec",(floor(_flightTime * 10)/10)], 1, 0.025, "TahomaB"]; +drawLine3D [ASLToAGL _launchPos, ASLToAGL (_launchPos vectorAdd (_startLOS vectorMultiply (_distanceFromLaunch + 50))), [1,0,0,1]]; +drawLine3D [ASLToAGL _launchPos, ASLToAGL (_launchPos vectorAdd ([_distanceFromLaunch + 50, _realYaw, _realPitch] call CBA_fnc_polar2vect)), [1,1,0,1]]; private _test = lineIntersectsSurfaces [_launchPos, _launchPos vectorAdd (_startLOS vectorMultiply 3000), player, _projectile]; if ((count _test) > 0) then { - private _posAGL = ASLtoAGL ((_test select 0) select 0); + private _posAGL = ASLToAGL ((_test select 0) select 0); drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,0,1], _posAGL, 0.75, 0.75, 0, "Original Impact", 1, 0.025, "TahomaB"]; }; #endif -// TRACE_1("Adjusted target position",_returnTargetPos); -_returnTargetPos; +[0, 0, 1] diff --git a/addons/nlaw/functions/fnc_keyDown.sqf b/addons/nlaw/functions/fnc_keyDown.sqf index 5b75c721406..aee9739474b 100644 --- a/addons/nlaw/functions/fnc_keyDown.sqf +++ b/addons/nlaw/functions/fnc_keyDown.sqf @@ -74,7 +74,7 @@ playSound "ACE_Sound_Click"; _args set [1, _yaw]; _args set [2, _pitch]; - #ifdef DEBUG_MODE_FULL + #ifdef DRAW_NLAW_INFO hintSilent format ["Instantaneous\nYaw: %1\n Pitch: %2\nGVAR\nYaw: %3\nPitch: %4", _yawChange, _pitchChange, GVAR(yawChange), GVAR(pitchChange)]; #endif }, .25, [CBA_missionTime, _yaw, _pitch, true]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/nlaw/functions/fnc_navigation.sqf b/addons/nlaw/functions/fnc_navigation.sqf new file mode 100644 index 00000000000..7572b44d6f3 --- /dev/null +++ b/addons/nlaw/functions/fnc_navigation.sqf @@ -0,0 +1,78 @@ +#include "..\script_component.hpp" +/* + * Author: tcvm + * Attempts to hold angle as fed to by seeker. Does so with a simple proportional controller + * + * Arguments: + * Guidance Arg Array <ARRAY> + * + * Return Value: + * Commanded acceleration normal to LOS in world space <ARRAY> + * + * Example: + * [] call ace_missileguidance_fnc_navigationType_line + * + * Public: No + */ +// arbitrary constant +#define PROPORTIONALITY_CONSTANT 20 +params ["_args", "_timestep", "_seekerTargetPos", "_profileAdjustedTargetPos", "_targetData", "_navigationParams"]; +_args params ["_firedEH"]; +_firedEH params ["","","","","","","_projectile"]; + +_navigationParams params ["_yawChange", "_pitchChange", "_lastPitch", "_lastYaw", "_initialPitch", "_pitchUp", "_lastYawRateDifference"]; + +// for some reason we need to multiply this. I don't know why, but it just works +_pitchChange = _pitchChange * 1.5; +_yawChange = _yawChange * 1.5; + +((velocity _projectile) call CBA_fnc_vect2polar) params ["", "_currentYaw", "_currentPitch"]; + +private _pitchRate = if (_timestep == 0) then { + 0 +} else { + (_currentPitch - _lastPitch) / _timestep +}; +_navigationParams set [2, _currentPitch]; + +private _pitchModifier = if (_pitchChange == 0) then { + 1 +} else { + abs (_pitchRate / _pitchChange) +}; +private _desiredPitchChange = (_pitchChange - _pitchRate) * PROPORTIONALITY_CONSTANT * _pitchModifier; +_desiredPitchChange = _desiredPitchChange + _pitchUp * (_initialPitch - _currentPitch) * PROPORTIONALITY_CONSTANT * _pitchModifier; + +private _yawRate = if (_timestep == 0) then { + 0 +} else { + (_currentYaw - _lastYaw) / _timestep +}; +_navigationParams set [3, _currentYaw]; + +private _yawModifier = if (_yawChange == 0) then { + 1 +} else { + abs (_yawRate / _yawChange) +}; + +private _yawRateDifference = _yawChange - _yawRate; +private _yawChangeDerivative = if (_timestep == 0) then { + 0 +} else { + (_yawRateDifference - _lastYawRateDifference) / _timestep +}; +_navigationParams set [6, _yawRateDifference]; + +private _desiredYawChange = _yawRateDifference * PROPORTIONALITY_CONSTANT + _yawRateDifference * 2; + +#ifdef DRAW_NLAW_INFO +drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,1,1], ASLToAGL getPosASLVisual _projectile, 0.75, 0.75, 0, format ["dP [%1] dY: [%2]", _desiredPitchChange, _desiredYawChange], 1, 0.025, "TahomaB"]; +drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,1,1], [0, 0, 1] vectorAdd ASLToAGL getPosASLVisual _projectile, 0.75, 0.75, 0, format ["pitch proportional [%1] yaw proportional [%2]", _pitchModifier, _yawModifier], 1, 0.025, "TahomaB"]; +#endif + +TRACE_4("nlaw pitch/yaw info",_currentPitch,_lastPitch,_currentYaw,_lastYaw); +TRACE_6("nlaw navigation",_yawChange,_desiredYawChange,_pitchChange,_desiredPitchChange,_yawRate,_pitchRate); + +_projectile vectorModelToWorldVisual [_yawChange + _desiredYawChange, 0, _pitchChange + _desiredPitchChange] + diff --git a/addons/nlaw/functions/fnc_navigation_onFired.sqf b/addons/nlaw/functions/fnc_navigation_onFired.sqf new file mode 100644 index 00000000000..895d5ff78b3 --- /dev/null +++ b/addons/nlaw/functions/fnc_navigation_onFired.sqf @@ -0,0 +1,70 @@ +#include "..\script_component.hpp" +/* + * Author: PabstMirror + * Sets up missile guidance state arrays (called from missileGuidance's onFired). + * + * Arguments: + * Guidance Arg Array <ARRAY> + * + * Return Value: + * Navigation Parameters <ARRAY> + * + * Example: + * [] call ace_nlaw_fnc_onFired + * + * Public: No + */ + +params ["_firedEH", "_launchParams", "_flightParams", "_seekerParams", "_stateParams"]; +_firedEH params ["_shooter","","","","","","_projectile"]; +_launchParams params ["","_targetLaunchParams","","_attackProfile"]; +_targetLaunchParams params ["_target"]; +_stateParams params ["", "", "", "", "_navigationParams"]; + +// Reset _launchPos origin as projectile's height instead of player's foot +_targetLaunchParams set [2, getPosASL _projectile]; + +// Get state params: +TRACE_3("start of attack profile",_attackProfile,_shooter,vectorDir _projectile); + +private _firedLOS = _shooter weaponDirection (currentWeapon _shooter); +private _yawChange = 0; +private _pitchChange = 0; + +if (_shooter == ACE_player) then { + TRACE_2("isPlayer",GVAR(yawChange),GVAR(pitchChange)); + _yawChange = GVAR(yawChange); + _pitchChange = GVAR(pitchChange); + TRACE_1("los check",_firedLOS call CBA_fnc_vect2Polar); +} else { + if ((!isNil "_target") && {!isNull _target}) then { + _firedLOS = (getPosASL _projectile) vectorFromTo (aimPos _target); + (((eyePos _shooter) vectorFromTo (aimPos _target)) call CBA_fnc_vect2Polar) params ["", "_startYaw", "_startPitch"]; + // Add some random error to AI's velocity prediction: + private _random = random [(_shooter skillFinal "aimingAccuracy") min 0.9, 1, 2-((_shooter skillFinal "aimingAccuracy") min 0.9)]; + (((eyePos _shooter) vectorFromTo ((aimPos _target) vectorAdd ((velocity _target) vectorMultiply (_random)))) call CBA_fnc_vect2Polar) params ["", "_predictedYaw", "_predictedPitch"]; + _yawChange = ([_predictedYaw - _startYaw] call CBA_fnc_simplifyAngle180); + _pitchChange = ([_predictedPitch - _startPitch] call CBA_fnc_simplifyAngle180); + TRACE_1("AI",_target); + } else { + TRACE_1("AI - no target",_target); + }; +}; + +// Limit Max Deflection +//_yawChange = -10 max _yawChange min 10; +//_pitchChange = -10 max _pitchChange min 10; + +((velocity _projectile) call CBA_fnc_vect2polar) params ["", "_currentYaw", "_currentPitch"]; +((ACE_player weaponDirection (currentWeapon ACE_player)) call CBA_fnc_vect2Polar) params ["", "_yaw", "_pitch"]; + +TRACE_5("attackProfileStateParams",_firedLOS,_yawChange,_pitchChange,_currentPitch,_currentYaw); +_navigationParams set [0, _yawChange]; +_navigationParams set [1, _pitchChange]; +_navigationParams set [2, _currentPitch]; // last pitch +_navigationParams set [3, _currentYaw]; // last yaw +_navigationParams set [4, _pitch]; // initial pitch +_navigationParams set [5, 0]; // whether or not to zero out the pitch +_navigationParams set [6, 0]; +_navigationParams + diff --git a/addons/nlaw/functions/fnc_onFired.sqf b/addons/nlaw/functions/fnc_onFired.sqf index 11b38a1da03..cbaa2cfc0a4 100644 --- a/addons/nlaw/functions/fnc_onFired.sqf +++ b/addons/nlaw/functions/fnc_onFired.sqf @@ -19,7 +19,7 @@ params ["_firedEH", "_launchParams", "_flightParams", "_seekerParams", "_statePa _firedEH params ["_shooter","","","","","","_projectile"]; _launchParams params ["","_targetLaunchParams","","_attackProfile"]; _targetLaunchParams params ["_target"]; -_stateParams params ["", "", "_attackProfileStateParams"]; +_stateParams params ["", "_seekerStateParams", "_attackProfileStateParams"]; // Reset _launchPos origin as projectile's height instead of player's foot _targetLaunchParams set [2, getPosASL _projectile]; @@ -27,7 +27,7 @@ _targetLaunchParams set [2, getPosASL _projectile]; // Get state params: TRACE_3("start of attack profile",_attackProfile,_shooter,vectorDir _projectile); -private _firedLOS = _shooter weaponDirection (currentWeapon _shooter); +private _firedLOS = vectorDir _projectile; private _yawChange = 0; private _pitchChange = 0; @@ -36,6 +36,23 @@ if (_shooter == ACE_player) then { _yawChange = GVAR(yawChange); _pitchChange = GVAR(pitchChange); TRACE_1("los check",_firedLOS call CBA_fnc_vect2Polar); + + #ifdef DRAW_NLAW_INFO + systemChat format ["YAW [%1]", _yawChange]; + systemChat format ["PITCH [%1]", _pitchChange]; + GVAR(debug_firedPrediction) = []; + private _debugPos = getPosASL _projectile; + ((ACE_player weaponDirection (currentWeapon ACE_player)) call CBA_fnc_vect2Polar) params ["", "_debugYaw", "_debugPitch"]; + private _distance = 0; + for "_x" from 0 to 6 step 0.1 do { + private _debugAproxVel = linearConversion [0, 1, 5, 40, 170, true]; + _distance = _distance + _debugAproxVel * 0.1; + private _debugYaw = _debugYaw + _yawChange * _x; + private _debugPitch = _debugPitch + _pitchChange * _x; + private _debugPos = _debugPos vectorAdd ([_distance, _debugYaw, _debugPitch] call CBA_fnc_polar2vect); + GVAR(debug_firedPrediction) pushBack ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [0,0,0,1], ASLToAGL _debugPos, 0.5, 0.5, 0, format ["%1", _x], 1, 0.025, "TahomaB"]; + }; + #endif } else { if ((!isNil "_target") && {!isNull _target}) then { _firedLOS = (getPosASL _projectile) vectorFromTo (aimPos _target); @@ -55,6 +72,10 @@ if (_shooter == ACE_player) then { _yawChange = -10 max _yawChange min 10; _pitchChange = -10 max _pitchChange min 10; +_seekerStateParams set [2, _yawChange]; +_seekerStateParams set [3, _pitchChange]; +_seekerStateParams set [4, CBA_missionTime]; + TRACE_3("attackProfileStateParams",_firedLOS,_yawChange,_pitchChange); _attackProfileStateParams set [0, CBA_missionTime]; _attackProfileStateParams set [1, _firedLOS]; diff --git a/addons/nlaw/functions/fnc_seeker.sqf b/addons/nlaw/functions/fnc_seeker.sqf index e5de6d320ca..a77b7ecb3b6 100644 --- a/addons/nlaw/functions/fnc_seeker.sqf +++ b/addons/nlaw/functions/fnc_seeker.sqf @@ -16,14 +16,27 @@ * * Public: No */ +#define PITCH_UP_TIME 1 -params ["", "_args", "_seekerStateParams"]; +params ["", "_args", "_seekerStateParams", "", "", "_targetData"]; _args params ["_firedEH", "_launchParams", "", "_seekerParams", "_stateParams"]; _firedEH params ["","","","","","","_projectile"]; _launchParams params ["", "_targetLaunchParams", "", "_attackProfile"]; _targetLaunchParams params ["", "", "_launchPos"]; +_stateParams params ["", "", "", "", "_navigationParams"]; -if (_attackProfile == QGVAR(directAttack)) exitWith {[0,0,0]}; +if (_attackProfile == QGVAR(directAttack)) exitWith { + _navigationParams set [5, 1]; + [0,0,0] +}; + +_seekerStateParams params ["", "", "", "_originalPitchRate", "_startTime"]; +_navigationParams params ["", "_pitchRate"]; + +// pitch up for the first second of flight to begin an over-fly trajectory +private _pitchChange = linearConversion [0, PITCH_UP_TIME, CBA_missionTime - _startTime, 2, 0, true]; +_navigationParams set [1, _originalPitchRate + _pitchChange]; +_navigationParams set [5, ((CBA_missionTime - _startTime) min PITCH_UP_TIME) / PITCH_UP_TIME]; private _projPos = getPosASL _projectile; @@ -49,7 +62,7 @@ if ((_projPos distance _launchPos) >= 20) then { // This represents a position that the missile was at between the last frame and now private _virtualPos = _lastPos vectorAdd (_vectorDir vectorMultiply _stepSize); #ifdef DRAW_NLAW_INFO - drawLine3D [ASLtoAGL _virtualPos, ASLtoAGL (_virtualPos vectorAdd [0,0,-5]), [1,0,_stepSize/(_frameDistance max 0.1),1]]; + drawLine3D [ASLToAGL _virtualPos, ASLToAGL (_virtualPos vectorAdd [0,0,-5]), [1,0,_stepSize/(_frameDistance max 0.1),1]]; #endif // Limit scan to 5 meters directly down (shaped charge jet has a very limited range) @@ -58,7 +71,7 @@ if ((_projPos distance _launchPos) >= 20) then { (_res select 0) params ["_targetPos", "", "_target"]; if ((_target isKindOf "Tank") || {_target isKindOf "Car"} || {_target isKindOf "Air"}) exitWith { TRACE_3("Firing shaped charge down",_target,_targetPos distance _virtualPos,_frameDistance); - TRACE_2("",_target worldToModel (ASLtoAGL _virtualPos),boundingBoxReal _target); + TRACE_2("",_target worldToModel (ASLToAGL _virtualPos),boundingBoxReal _target); _virtualPos = _virtualPos vectorAdd (_vectorDir vectorMultiply 1.25); deleteVehicle _projectile; diff --git a/addons/noradio/stringtable.xml b/addons/noradio/stringtable.xml index d1cf51f0e6a..d41827ebfad 100644 --- a/addons/noradio/stringtable.xml +++ b/addons/noradio/stringtable.xml @@ -12,6 +12,7 @@ <Russian>Нет рации</Russian> <Spanish>No Radio</Spanish> <French>Pas de radio</French> + <Portuguese>Sem Rádio</Portuguese> </Key> <Key ID="STR_ACE_NoRadio_setting"> <English>Mute Player</English> diff --git a/addons/novehicleclanlogo/stringtable.xml b/addons/novehicleclanlogo/stringtable.xml index 96d463f582d..1e07c85ce8c 100644 --- a/addons/novehicleclanlogo/stringtable.xml +++ b/addons/novehicleclanlogo/stringtable.xml @@ -11,6 +11,7 @@ <German>Clan-Logo von Fahrzeugen entfernen</German> <Italian>Rimuovi Icone Clan dai veicoli</Italian> <French>Retirer les logos de clan des véhicules</French> + <Portuguese>Remover logo do clã de veículos</Portuguese> </Key> <Key ID="STR_ACE_Novehicleclanlogo_Enabled_Tooltip"> <English>Prevents clan logo from being displayed on vehicles controlled by players.</English> @@ -22,6 +23,7 @@ <German>Verhindert, dass das Clan-Logo auf von Spielern kontrollierten Fahrzeugen angezeigt wird.</German> <Italian>Impedisce la visualizzazione di icone clan sui veicoli controllati da giocatori.</Italian> <French>Empêche les logos de clan d'être affichés sur les véhicules contrôlés par des joueurs.</French> + <Portuguese>Previne o logo do clã de ser mostrado em veículos controlados por jogadores.</Portuguese> </Key> </Package> </Project> diff --git a/addons/optics/CfgEventHandlers.hpp b/addons/optics/CfgEventHandlers.hpp deleted file mode 100644 index f6503c2479b..00000000000 --- a/addons/optics/CfgEventHandlers.hpp +++ /dev/null @@ -1,17 +0,0 @@ -class Extended_PreStart_EventHandlers { - class ADDON { - init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); - }; -}; - -class Extended_PreInit_EventHandlers { - class ADDON { - init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); - }; -}; - -class Extended_PostInit_EventHandlers { - class ADDON { - init = QUOTE(call COMPILE_SCRIPT(XEH_postInit)); - }; -}; diff --git a/addons/optics/CfgOpticsEffect.hpp b/addons/optics/CfgOpticsEffect.hpp deleted file mode 100644 index 30c372fdac4..00000000000 --- a/addons/optics/CfgOpticsEffect.hpp +++ /dev/null @@ -1,7 +0,0 @@ -class CfgOpticsEffect { - class ACE_OpticsRadBlur1 { - type = "radialblur"; - params[] = {0.015, 0, 0.14, 0.2}; - priority = 950; - }; -}; diff --git a/addons/optics/CfgPreloadTextures.hpp b/addons/optics/CfgPreloadTextures.hpp index 1354f91e18e..b4bf27f76ff 100644 --- a/addons/optics/CfgPreloadTextures.hpp +++ b/addons/optics/CfgPreloadTextures.hpp @@ -1,49 +1,38 @@ -#define MACRO_PRELOAD \ - GVAR(BodyDay) = "*"; \ - GVAR(BodyNight) = "*"; \ - GVAR(ReticleDay) = "*"; \ - GVAR(ReticleNight) = "*" - class PreloadTextures { class CfgWeapons { class ACE_optic_Hamr_2D { - MACRO_PRELOAD; + PRELOAD; }; - class ACE_optic_Hamr_PIP { - MACRO_PRELOAD; + PRELOAD; }; class ACE_optic_Arco_2D { - MACRO_PRELOAD; + PRELOAD; }; - class ACE_optic_Arco_PIP { - MACRO_PRELOAD; + PRELOAD; }; class ACE_optic_MRCO_2D { - MACRO_PRELOAD; + PRELOAD; }; - class ACE_optic_MRCO_PIP { - MACRO_PRELOAD; + PRELOAD; }; class ACE_optic_SOS_2D { - MACRO_PRELOAD; + PRELOAD; }; - class ACE_optic_SOS_PIP { - MACRO_PRELOAD; + PRELOAD; }; class ACE_optic_LRPS_2D { - MACRO_PRELOAD; + PRELOAD; }; - class ACE_optic_LRPS_PIP { - MACRO_PRELOAD; + PRELOAD; }; }; }; diff --git a/addons/optics/CfgRscTitles.hpp b/addons/optics/CfgRscTitles.hpp deleted file mode 100644 index bb01281a22f..00000000000 --- a/addons/optics/CfgRscTitles.hpp +++ /dev/null @@ -1,204 +0,0 @@ -class RscOpticsValue; -class RscMapControl; -class RscText; - -class RscInGameUI { - class RscUnitInfo; - class RscWeaponZeroing: RscUnitInfo { - class CA_Zeroing; - }; - - class ACE_RscWeaponZeroing: RscWeaponZeroing { - controls[] = {"CA_Zeroing", "CA_FOVMode", "ACE_DrawReticleHelper", "ACE_ScriptedReticle"}; - - class CA_FOVMode: RscOpticsValue { // Idea by Taosenai. Apparently this can be used via isNil check to determine wheter the scope or the kolimator is used - idc = 154; - style = 2; - colorText[] = {0, 0, 0, 0}; - x = 0; - y = 0; - w = 0; - h = 0; - }; - - class ACE_DrawReticleHelper: RscMapControl { - onDraw = QUOTE([ctrlParent (_this select 0)] call DFUNC(onDrawScope)); - idc = -1; - w = 0; - h = 0; - }; - - class ACE_ScriptedReticle: RscText { - idc = 1713154; - style = 48; - size = 1; - sizeEx = 0; - text = QPATHTOF(reticles\ace_shortdot_reticle_1.paa); - w = 0; - h = 0; - }; - }; - - class ACE_RscWeapon_base: RscWeaponZeroing { - controls[] = {"CA_Zeroing", "CA_FOVMode", "ACE_DrawReticleHelper", "ReticleDay", "ReticleNight", "BodyNight", "BodyDay", "trippleHeadLeft", "trippleHeadRight"}; // Don't change this order - - class CA_FOVMode: RscOpticsValue { // Idea by Taosenai. Apparently this can be used via isNil check to determine wheter the scope or the kolimator is used - idc = 154; - style = 2; - colorText[] = {0, 0, 0, 0}; - x = 0; - y = 0; - w = 0; - h = 0; - }; - - class ACE_DrawReticleHelper: RscMapControl { - onDraw = QUOTE([ctrlParent (_this select 0)] call DFUNC(onDrawScope2D)); - idc = -1; - w = 0; - h = 0; - }; - - #define SIZEX 0.75/(getResolution select 5) - class ReticleDay: RscText { - idc = 1713001; - style = 48; - size = 0; - sizeEx = 1; - text = ""; - colorText[] = {1, 1, 1, 0}; - colorBackground[] = {0, 0, 0, 0}; - x = QUOTE(safezoneX + 0.5 * safezoneW - 0.5 * SIZEX); - y = QUOTE(safezoneY + 0.5 * safezoneH - 0.5 * SIZEX * (4 / 3)); - w = QUOTE(SIZEX); - h = QUOTE(SIZEX * (4 / 3)); - }; - - class ReticleNight: ReticleDay { - idc = 1713002; - text = ""; - }; - - #undef SIZEX - #define SIZEX 2*0.75/(getResolution select 5) - class BodyDay: ReticleDay { - idc = 1713005; - text = ""; - x = QUOTE(safezoneX + 0.5 * safezoneW - 0.5 * SIZEX); - y = QUOTE(safezoneY + 0.5 * safezoneH - 0.5 * SIZEX * (4 / 3)); - w = QUOTE(SIZEX); - h = QUOTE(SIZEX * (4 / 3)); - }; - - class BodyNight: BodyDay { - idc = 1713006; - text = ""; - }; - - // These are just black side panels to cover the areas that the optics p3d doesn't cover - // It will ONLY effect tripple head users as (safezoneX == safeZoneXAbs) for everyone else - // Reference PR #1156: - class trippleHeadLeft: RscText { - idc = 1713010; - x = "safeZoneXAbs"; - Y = "safezoneY"; - W = "(safezoneX - safeZoneXAbs) * ((getResolution select 4) / (16 / 3))"; - H = "safeZoneH"; - colorBackground[] = {0, 0, 0, 1}; - }; - class trippleHeadRight: trippleHeadLeft { - idc = 1713011; - x = "safeZoneXAbs + safeZoneWAbs - (safezoneX - safeZoneXABS) * ((getResolution select 4) / (16 / 3))"; - colorBackground[] = {0, 0, 0, 1}; - }; - }; - - class ACE_RscWeapon_Hamr: ACE_RscWeapon_base { - class ReticleDay: ReticleDay { - text = QPATHTOF(reticles\hamr-reticle65_ca.paa); - }; - - class ReticleNight: ReticleNight { - text = QPATHTOF(reticles\hamr-reticle65Illum_ca.paa); - }; - - class BodyDay: BodyDay { - text = QPATHTOF(reticles\hamr-body_ca.paa); - }; - - class BodyNight: BodyNight { - text = QPATHTOF(reticles\hamr-bodyNight_ca.paa); - }; - }; - - class ACE_RscWeapon_Arco: ACE_RscWeapon_base { - class ReticleDay: ReticleDay { - text = QPATHTOF(reticles\arco-reticle65_ca.paa); - }; - - class ReticleNight: ReticleNight { - text = QPATHTOF(reticles\arco-reticle65Illum_ca.paa); - }; - - class BodyDay: BodyDay { - text = QPATHTOF(reticles\arco-body_ca.paa); - }; - - class BodyNight: BodyNight { - text = QPATHTOF(reticles\arco-bodyNight_ca.paa); - }; - }; - - class ACE_RscWeapon_MRCO: ACE_RscWeapon_base { - class ReticleDay: ReticleDay { - text = QPATHTOF(reticles\mrco-reticle556_ca.paa); - }; - - class ReticleNight: ReticleNight { - text = QPATHTOF(reticles\mrco-reticle556Illum_ca.paa); - }; - - class BodyDay: BodyDay { - text = QPATHTOF(reticles\mrco-body_ca.paa); - }; - - class BodyNight: BodyNight { - text = QPATHTOF(reticles\mrco-bodyNight_ca.paa); - }; - }; - - class ACE_RscWeapon_SOS: ACE_RscWeapon_base { - class ReticleDay: ReticleDay { - text = QPATHTOF(reticles\sos-reticleMLR_ca.paa); - }; - - class ReticleNight: ReticleNight { - text = QPATHTOF(reticles\sos-reticleMLRIllum_ca.paa); - }; - - class BodyDay: BodyDay { - text = QPATHTOF(reticles\sos-body_ca.paa); - }; - - class BodyNight: BodyNight { - text = QPATHTOF(reticles\sos-bodyNight_ca.paa); - }; - }; -}; - -/* - -_ctrl = (D displayCtrl 1713006); - -_sizeX = 1.54 / (getResolution select 5); -_sizeY = _sizeX * safezoneW / safezoneH; - -_ctrl ctrlSetPosition [ - safezoneX + 0.5 * safezoneW - 0.5 * _sizeX, - safezoneY + 0.5 * safezoneH - 0.5 * _sizeY, - _sizeX, - _sizeY -]; -_ctrl ctrlCommit 0 - - */ diff --git a/addons/optics/CfgVehicles.hpp b/addons/optics/CfgVehicles.hpp index eda9a3d930c..41e2d8ab039 100644 --- a/addons/optics/CfgVehicles.hpp +++ b/addons/optics/CfgVehicles.hpp @@ -3,16 +3,10 @@ class CfgVehicles { class ACE_Box_Misc: Box_NATO_Support_F { class TransportItems { MACRO_ADDITEM(ACE_optic_Hamr_2D,2); - MACRO_ADDITEM(ACE_optic_Hamr_PIP,2); MACRO_ADDITEM(ACE_optic_Arco_2D,2); - MACRO_ADDITEM(ACE_optic_Arco_PIP,2); MACRO_ADDITEM(ACE_optic_MRCO_2D,2); - //MACRO_ADDITEM(ACE_optic_MRCO_PIP,2); MACRO_ADDITEM(ACE_optic_SOS_2D,2); - MACRO_ADDITEM(ACE_optic_SOS_PIP,2); MACRO_ADDITEM(ACE_optic_LRPS_2D,2); - MACRO_ADDITEM(ACE_optic_LRPS_PIP,2); - //MACRO_ADDITEM(ACE_optic_DMS,2); }; }; }; diff --git a/addons/optics/CfgWeapons.hpp b/addons/optics/CfgWeapons.hpp index 8088a5fcd36..90cccb32866 100644 --- a/addons/optics/CfgWeapons.hpp +++ b/addons/optics/CfgWeapons.hpp @@ -1,110 +1,62 @@ class CfgWeapons { class ItemCore; class InventoryOpticsItem_Base_F; - class Default; - - class Binocular: Default { - forceOptics = 0; // Allow using compass with Binocular - opticsZoomMin = 0.056889; // 5.25x power - opticsZoomMax = 0.056889; // 9 px/mil - modelOptics = "\z\ace\addons\optics\models\NWD_M22_5x"; // 7 degrees horizontal field of view - visionMode[] = {"Normal"}; // Can't use nvgs with binoculars any more than you can with scopes - // Fix AI using Binocs on short range - #18737 - // minRange = 300; // 300 = uses Rangefinder often (runs a few meters, stops, uses RF, repeats) - minRange = 500; //500 = seem almost never use it..? - minRangeProbab = 0.001; - midRange = 1000; - midRangeProbab = 0.01; - maxRange = 5000; - maxRangeProbab = 0.01; - }; - // zooming reticle scopes - class optic_DMS: ItemCore { + // HAMR + class optic_Hamr: ItemCore { class ItemInfo: InventoryOpticsItem_Base_F { class OpticsModes { - class Snip; - class Iron; + class Hamr2Scope; + class Hamr2Collimator; }; }; }; - /*class ACE_optic_DMS: optic_DMS { + class ACE_optic_Hamr_2D: optic_Hamr { author = ECSTRING(common,ACETeam); - _generalMacro = "ACE_optic_DMS"; - scope = 1; - displayName = "LOCALIZE ACE DMS"; - //descriptionShort = "$STR_A3_CFGWEAPONS_ACC_DMS1"; - weaponInfoType = "ACE_RscWeaponZeroing"; + scope = 2; + displayName = CSTRING(hamr); - class ItemInfo: ItemInfo { - modelOptics = QPATHTOF(models\ace_shortdot_optics.p3d); + class CBA_ScriptedOptic { + opticsPPEffects[] = {"CBA_OpticsRadBlur3"}; - class OpticsModes: OpticsModes { - class Snip: Snip { - opticsZoomMin = 0.05; - opticsZoomMax = 0.3; - opticsZoomInit = 0.3; - discretefov[] = {}; - modelOptics[] = {}; - }; + reticleTexture = QPATHTOF(reticles\hamr-reticle65_ca.paa); + reticleTextureNight = QPATHTOF(reticles\hamr-reticle65Illum_ca.paa); + reticleTextureSize = 6 / 25 * 4; // At 25x using https://github.com/CBATeam/CBA_A3/wiki/Scripted-Optics#debug-reticle, the best choice is 6 - class Iron: Iron {}; - }; - }; - };*/ + bodyTexture = QPATHTOF(reticles\hamr-body_ca.paa); + bodyTextureNight = QPATHTOF(reticles\hamr-bodyNight_ca.paa); + bodyTextureSize = 2.2; - // PIP scopes - class optic_Hamr: ItemCore { - class ItemInfo: InventoryOpticsItem_Base_F { - class OpticsModes { - class Hamr2Collimator; - class Hamr2Scope; - }; + hideMagnification = 1; }; - }; - - class ACE_optic_Hamr_2D: optic_Hamr { - GVAR(BodyDay) = QPATHTOF(reticles\hamr-body_ca.paa); - GVAR(BodyNight) = QPATHTOF(reticles\hamr-bodyNight_ca.paa); - GVAR(ReticleDay) = QPATHTOF(reticles\hamr-reticle65_ca.paa); - GVAR(ReticleNight) = QPATHTOF(reticles\hamr-reticle65Illum_ca.paa); - - author = ECSTRING(common,ACETeam); - _generalMacro = "ACE_optic_Hamr_2D"; - displayName = CSTRING(hamr); - weaponInfoType = "ACE_RscWeapon_Hamr"; + weaponInfoType = "CBA_ScriptedOptic"; class ItemInfo: ItemInfo { - modelOptics = QPATHTOF(models\ace_optics_reticle90.p3d); + modelOptics = "\x\cba\addons\optics\cba_optic_big_90.p3d"; class OpticsModes: OpticsModes { - class Hamr2Collimator: Hamr2Collimator {}; - class Hamr2Scope: Hamr2Scope { useModelOptics = 1; - opticsZoomInit = 0.0872664626; - opticsZoomMax = 0.0872664626; - opticsZoomMin = 0.0872664626; - opticsPPEffects[] = {"OpticsCHAbera5", "OpticsBlur5", "ACE_OpticsRadBlur1"}; - opticsDisablePeripherialVision = 0; - visionMode[] = {"Normal", "NVG"}; + opticsZoomInit = 0.25 / 4; + opticsZoomMax = 0.25 / 4; + opticsZoomMin = 0.25 / 4; }; + class Hamr2Collimator: Hamr2Collimator {}; }; }; }; - class ACE_optic_Hamr_PIP: ACE_optic_Hamr_2D { author = ECSTRING(common,ACETeam); - _generalMacro = "ACE_optic_Hamr_PIP"; - //scopeArsenal = 1; + scope = 1; displayName = CSTRING(hamr_pip); class ItemInfo: ItemInfo { - modelOptics = QPATHTOF(models\ace_optics_pip.p3d); + modelOptics = "\x\cba\addons\optics\cba_optic_big_pip.p3d"; }; }; + // ARCO class optic_Arco: ItemCore { class ItemInfo: InventoryOpticsItem_Base_F { class OpticsModes { @@ -115,95 +67,104 @@ class CfgWeapons { }; class ACE_optic_Arco_2D: optic_Arco { - GVAR(BodyDay) = QPATHTOF(reticles\arco-body_ca.paa); - GVAR(BodyNight) = QPATHTOF(reticles\arco-bodyNight_ca.paa); - GVAR(ReticleDay) = QPATHTOF(reticles\arco-reticle65_ca.paa); - GVAR(ReticleNight) = QPATHTOF(reticles\arco-reticle65Illum_ca.paa); - author = ECSTRING(common,ACETeam); - _generalMacro = "ACE_optic_Arco_2D"; + scope = 2; displayName = CSTRING(arco); - weaponInfoType = "ACE_RscWeapon_Arco"; + + class CBA_ScriptedOptic { + opticsPPEffects[] = {"CBA_OpticsRadBlur3"}; + + reticleTexture = QPATHTOF(reticles\arco-reticle65_ca.paa); + reticleTextureNight = QPATHTOF(reticles\arco-reticle65Illum_ca.paa); + reticleTextureSize = 6.4 / 25 * 4; // At 25x using https://github.com/CBATeam/CBA_A3/wiki/Scripted-Optics#debug-reticle, the best choice is 6.4 + + bodyTexture = QPATHTOF(reticles\arco-body_ca.paa); + bodyTextureNight = QPATHTOF(reticles\arco-bodyNight_ca.paa); + bodyTextureSize = 2.2; + + hideMagnification = 1; + }; + weaponInfoType = "CBA_ScriptedOptic"; class ItemInfo: ItemInfo { - modelOptics = QPATHTOF(models\ace_optics_reticle90.p3d); + modelOptics = "\x\cba\addons\optics\cba_optic_big_90.p3d"; class OpticsModes: OpticsModes { - class ARCO2collimator: ARCO2collimator {}; class ARCO2scope: ARCO2scope { useModelOptics = 1; - opticsZoomInit = 0.0872664626; - opticsZoomMax = 0.0872664626; - opticsZoomMin = 0.0872664626; - opticsPPEffects[] = {"OpticsCHAbera5", "OpticsBlur5", "ACE_OpticsRadBlur1"}; - opticsDisablePeripherialVision = 0; - visionMode[] = {"Normal"}; + opticsZoomInit = 0.25 / 4; + opticsZoomMax = 0.25 / 4; + opticsZoomMin = 0.25 / 4; }; + class ARCO2collimator: ARCO2collimator {}; }; }; }; - class ACE_optic_Arco_PIP: ACE_optic_Arco_2D { author = ECSTRING(common,ACETeam); - _generalMacro = "ACE_optic_Arco_PIP"; - //scopeArsenal = 1; + scope = 1; displayName = CSTRING(arco_pip); class ItemInfo: ItemInfo { - modelOptics = QPATHTOF(models\ace_optics_pip.p3d); + modelOptics = "\x\cba\addons\optics\cba_optic_big_pip.p3d"; }; }; + // MRCO class optic_MRCO: ItemCore { class ItemInfo: InventoryOpticsItem_Base_F { class OpticsModes { - class MRCOcq; class MRCOscope; + class MRCOcq; }; }; }; class ACE_optic_MRCO_2D: optic_MRCO { - GVAR(BodyDay) = QPATHTOF(reticles\mrco-body_ca.paa); - GVAR(BodyNight) = QPATHTOF(reticles\mrco-bodyNight_ca.paa); - GVAR(ReticleDay) = QPATHTOF(reticles\mrco-reticle556_ca.paa); - GVAR(ReticleNight) = QPATHTOF(reticles\mrco-reticle556Illum_ca.paa); - author = ECSTRING(common,ACETeam); - _generalMacro = "ACE_optic_MRCO_2D"; - displayName = CSTRING(valdada); - weaponInfoType = "ACE_RscWeapon_MRCO"; + scope = 2; + displayName = CSTRING(mrco); + + class CBA_ScriptedOptic { + opticsPPEffects[] = {"CBA_OpticsRadBlur3"}; + + reticleTexture = QPATHTOF(reticles\mrco-reticle556_ca.paa); + reticleTextureNight = QPATHTOF(reticles\mrco-reticle556Illum_ca.paa); + reticleTextureSize = 6.4 / 25 * 4; // At 25x using https://github.com/CBATeam/CBA_A3/wiki/Scripted-Optics#debug-reticle, the best choice is 6.4 + + bodyTexture = QPATHTOF(reticles\mrco-body_ca.paa); + bodyTextureNight = QPATHTOF(reticles\mrco-bodyNight_ca.paa); + bodyTextureSize = 2.2; + + hideMagnification = 1; + }; + weaponInfoType = "CBA_ScriptedOptic"; class ItemInfo: ItemInfo { - modelOptics = QPATHTOF(models\ace_optics_reticle90.p3d); + modelOptics = "\x\cba\addons\optics\cba_optic_big_90.p3d"; class OpticsModes: OpticsModes { - class MRCOcq: MRCOcq {}; class MRCOscope: MRCOscope { useModelOptics = 1; - opticsZoomInit = 0.0872664626; - opticsZoomMax = 0.0872664626; - opticsZoomMin = 0.0872664626; - opticsPPEffects[] = {"OpticsCHAbera5", "OpticsBlur5", "ACE_OpticsRadBlur1"}; - opticsDisablePeripherialVision = 0; - visionMode[] = {"Normal"}; + opticsZoomInit = 0.25 / 4; + opticsZoomMax = 0.25 / 4; + opticsZoomMin = 0.25 / 4; }; + class MRCOcq: MRCOcq {}; }; }; }; - class ACE_optic_MRCO_PIP: ACE_optic_MRCO_2D { author = ECSTRING(common,ACETeam); - _generalMacro = "ACE_optic_MRCO_PIP"; scope = 1; - //scopeArsenal = 1; - displayName = CSTRING(valdada_pip); + displayName = CSTRING(mrco_pip); class ItemInfo: ItemInfo { - modelOptics = QPATHTOF(models\ace_optics_pip.p3d); + modelOptics = "\x\cba\addons\optics\cba_optic_big_pip.p3d"; }; }; + // SOS class optic_SOS: ItemCore { class ItemInfo: InventoryOpticsItem_Base_F { class OpticsModes { @@ -214,49 +175,53 @@ class CfgWeapons { }; class ACE_optic_SOS_2D: optic_SOS { - GVAR(BodyDay) = QPATHTOF(reticles\sos-body_ca.paa); - GVAR(BodyNight) = QPATHTOF(reticles\sos-bodyNight_ca.paa); - GVAR(ReticleDay) = QPATHTOF(reticles\sos-reticleMLR_ca.paa); - GVAR(ReticleNight) = QPATHTOF(reticles\sos-reticleMLRIllum_ca.paa); - author = ECSTRING(common,ACETeam); - _generalMacro = "ACE_optic_SOS_2D"; + scope = 2; displayName = CSTRING(sos); - weaponInfoType = "ACE_RscWeapon_SOS"; + + class CBA_ScriptedOptic { + opticsPPEffects[] = {"CBA_OpticsRadBlur3"}; + + reticleTexture = QPATHTOF(reticles\sos-reticleMLR_ca.paa); + reticleTextureNight = QPATHTOF(reticles\sos-reticleMLRIllum_ca.paa); + reticleTextureSize = 0.76; // At 22x using https://github.com/CBATeam/CBA_A3/wiki/Scripted-Optics#debug-reticle, the best choice is 0.76 + + bodyTexture = QPATHTOF(reticles\sos-body_ca.paa); + bodyTextureNight = QPATHTOF(reticles\sos-bodyNight_ca.paa); + bodyTextureSize = 1.55; + }; + weaponInfoType = "CBA_ScriptedOptic"; class ItemInfo: ItemInfo { class OpticsModes: OpticsModes { class Snip: Snip { - modelOptics[] = {QPATHTOF(models\ace_optics_reticle90.p3d), QPATHTOF(models\ace_optics_reticle90.p3d)}; + opticsZoomMin = "5.5 call (uiNamespace getVariable 'cba_optics_fnc_setOpticMagnificationHelper')"; + opticsZoomMax = "2.75 call (uiNamespace getVariable 'cba_optics_fnc_setOpticMagnificationHelper')"; + opticsZoomInit = "2.75 call (uiNamespace getVariable 'cba_optics_fnc_setOpticMagnificationHelper')"; + discreteFov[] = {}; + modelOptics[] = {"\x\cba\addons\optics\cba_optic_big_90.p3d"}; useModelOptics = 1; - opticsZoomInit = 0.0116; - opticsZoomMax = 0.0464; - opticsZoomMin = 0.0116; - discreteFOV[] = {0.0464, 0.0116}; - opticsPPEffects[] = {"OpticsCHAbera1", "OpticsBlur1", "ACE_OpticsRadBlur1"}; - opticsDisablePeripherialVision = 0; }; class Iron: Iron {}; }; }; }; - class ACE_optic_SOS_PIP: ACE_optic_SOS_2D { author = ECSTRING(common,ACETeam); - _generalMacro = "ACE_optic_SOS_PIP"; - //scopeArsenal = 1; + scope = 1; displayName = CSTRING(sos_pip); class ItemInfo: ItemInfo { class OpticsModes: OpticsModes { class Snip: Snip { - modelOptics[] = {QPATHTOF(models\ace_optics_pip.p3d), QPATHTOF(models\ace_optics_pip.p3d)}; + modelOptics[] = {"\x\cba\addons\optics\cba_optic_big_pip.p3d"}; }; class Iron: Iron {}; }; }; }; + // LRPS class optic_LRPS: ItemCore { class ItemInfo: InventoryOpticsItem_Base_F { class OpticsModes { @@ -266,44 +231,64 @@ class CfgWeapons { }; class ACE_optic_LRPS_2D: optic_LRPS { - GVAR(BodyDay) = QPATHTOF(reticles\sos-body_ca.paa); - GVAR(BodyNight) = QPATHTOF(reticles\sos-bodyNight_ca.paa); - GVAR(ReticleDay) = QPATHTOF(reticles\sos-reticleMLR_ca.paa); - GVAR(ReticleNight) = QPATHTOF(reticles\sos-reticleMLRIllum_ca.paa); - author = ECSTRING(common,ACETeam); - _generalMacro = "ACE_optic_LRPS_2D"; + scope = 2; displayName = CSTRING(lrps); - weaponInfoType = "ACE_RscWeapon_SOS"; + + class CBA_ScriptedOptic { + opticsPPEffects[] = {"CBA_OpticsRadBlur3"}; + + reticleTexture = QPATHTOF(reticles\sos-reticleMLR_ca.paa); + reticleTextureNight = QPATHTOF(reticles\sos-reticleMLRIllum_ca.paa); + reticleTextureSize = 0.76; // At 22x using https://github.com/CBATeam/CBA_A3/wiki/Scripted-Optics#debug-reticle, the best choice is 0.76 + + bodyTexture = QPATHTOF(reticles\sos-body_ca.paa); + bodyTextureNight = QPATHTOF(reticles\sos-bodyNight_ca.paa); + bodyTextureSize = 1.55; + }; + weaponInfoType = "CBA_ScriptedOptic"; class ItemInfo: ItemInfo { class OpticsModes: OpticsModes { class Snip: Snip { - modelOptics[] = {QPATHTOF(models\ace_optics_reticle90.p3d), QPATHTOF(models\ace_optics_reticle90.p3d)}; + opticsZoomMin = "22 call (uiNamespace getVariable 'cba_optics_fnc_setOpticMagnificationHelper')"; + opticsZoomMax = "5.5 call (uiNamespace getVariable 'cba_optics_fnc_setOpticMagnificationHelper')"; + opticsZoomInit = "5.5 call (uiNamespace getVariable 'cba_optics_fnc_setOpticMagnificationHelper')"; + discreteFov[] = {}; + modelOptics[] = {"\x\cba\addons\optics\cba_optic_big_90.p3d"}; useModelOptics = 1; - opticsZoomInit = 0.0116; - opticsZoomMax = 0.0464; - opticsZoomMin = 0.0116; - discreteFOV[] = {}; - opticsPPEffects[] = {"OpticsCHAbera1", "OpticsBlur1", "ACE_OpticsRadBlur1"}; - opticsDisablePeripherialVision = 0; }; }; }; }; - class ACE_optic_LRPS_PIP: ACE_optic_LRPS_2D { author = ECSTRING(common,ACETeam); - _generalMacro = "ACE_optic_LRPS_PIP"; - //scopeArsenal = 1; + scope = 1; displayName = CSTRING(lrps_pip); class ItemInfo: ItemInfo { class OpticsModes: OpticsModes { class Snip: Snip { - modelOptics[] = {QPATHTOF(models\ace_optics_pip.p3d), QPATHTOF(models\ace_optics_pip.p3d)}; + modelOptics[] = {"\x\cba\addons\optics\cba_optic_big_pip.p3d"}; }; }; }; }; + + // Binocular + class Default; + class Binocular: Default { + opticsZoomInit = 0.056889; // 7x power IRL + opticsZoomMin = 0.056889; // but in order to make the stadiametric rangefinder useful, ~4.4x magnification has been set + opticsZoomMax = 0.056889; // 9 px/mil + modelOptics = "\z\ace\addons\optics\models\NWD_M22_5x"; // 7 degrees horizontal field of view (Steiner M22) + // Fix AI using Binocs on short range - #18737 + // minRange = 300; // 300 = uses Rangefinder often (runs a few meters, stops, uses RF, repeats) + minRange = 500; // 500 = seem almost never use it..? + minRangeProbab = 0.001; + midRange = 1000; + midRangeProbab = 0.01; + maxRange = 5000; + maxRangeProbab = 0.01; + }; }; diff --git a/addons/optics/XEH_PREP.hpp b/addons/optics/XEH_PREP.hpp deleted file mode 100644 index 8eb8eb1eb56..00000000000 --- a/addons/optics/XEH_PREP.hpp +++ /dev/null @@ -1,3 +0,0 @@ -PREP(handleFired); -PREP(onDrawScope); -PREP(onDrawScope2D); diff --git a/addons/optics/XEH_postInit.sqf b/addons/optics/XEH_postInit.sqf deleted file mode 100644 index 1641ee21746..00000000000 --- a/addons/optics/XEH_postInit.sqf +++ /dev/null @@ -1,31 +0,0 @@ -// by commy2 -#include "script_component.hpp" - -if (!hasInterface) exitWith {}; - -GVAR(camera) = objNull; - -// save control for fired EH -["ace_infoDisplayChanged", { - TRACE_1("ace_infoDisplayChanged",_this); - if (!isNull ((_this select 0) displayCtrl 1713001)) then { - uiNamespace setVariable [QGVAR(RscWeaponInfo2D), _this select 0]; - }; -}] call CBA_fnc_addEventHandler; - -// camera has to be re-created every time another camera is created. Otherwise r2t is either black or transparent.. -["featureCamera", { - params ["_player", "_featureCamera"]; - TRACE_1("featureCamera",_featureCamera); - if (_featureCamera isEqualTo "") then { - // Destroy the camera, and it will be re-created in the onDrawScope2d helper - if (!isNull GVAR(camera)) then { - GVAR(camera) cameraEffect ["TERMINATE", "BACK"]; - camDestroy GVAR(camera); - TRACE_1("destroying pip camera for restart",GVAR(camera)); - }; - }; -}] call CBA_fnc_addPlayerEventHandler; - -// Register fire event handler -["ace_firedPlayer", LINKFUNC(handleFired)] call CBA_fnc_addEventHandler; diff --git a/addons/optics/XEH_preInit.sqf b/addons/optics/XEH_preInit.sqf deleted file mode 100644 index b47cf6628db..00000000000 --- a/addons/optics/XEH_preInit.sqf +++ /dev/null @@ -1,9 +0,0 @@ -#include "script_component.hpp" - -ADDON = false; - -PREP_RECOMPILE_START; -#include "XEH_PREP.hpp" -PREP_RECOMPILE_END; - -ADDON = true; diff --git a/addons/optics/XEH_preStart.sqf b/addons/optics/XEH_preStart.sqf deleted file mode 100644 index 022888575ed..00000000000 --- a/addons/optics/XEH_preStart.sqf +++ /dev/null @@ -1,3 +0,0 @@ -#include "script_component.hpp" - -#include "XEH_PREP.hpp" diff --git a/addons/optics/config.cpp b/addons/optics/config.cpp index c1524320c73..8b61425c67b 100644 --- a/addons/optics/config.cpp +++ b/addons/optics/config.cpp @@ -10,12 +10,11 @@ class CfgPatches { "ACE_optic_Arco_2D", "ACE_optic_Arco_PIP", "ACE_optic_MRCO_2D", - //"ACE_optic_MRCO_PIP", + "ACE_optic_MRCO_PIP", "ACE_optic_SOS_2D", "ACE_optic_SOS_PIP", "ACE_optic_LRPS_2D", "ACE_optic_LRPS_PIP" - //"ACE_optic_DMS" }; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_common"}; @@ -26,12 +25,15 @@ class CfgPatches { }; }; -#include "CfgEventHandlers.hpp" - -#include "CfgOpticsEffect.hpp" -#include "CfgRscTitles.hpp" -#include "CfgVehicles.hpp" -#include "CfgWeapons.hpp" +#include "CfgPreloadTextures.hpp" #include "CfgJointRails.hpp" +#include "CfgWeapons.hpp" +#include "CfgVehicles.hpp" -#include "CfgPreloadTextures.hpp" +class CBA_PIPItems { + ACE_optic_Hamr_2D = "ACE_optic_Hamr_PIP"; + ACE_optic_Arco_2D = "ACE_optic_Arco_PIP"; + ACE_optic_MRCO_2D = "ACE_optic_MRCO_PIP"; + ACE_optic_SOS_2D = "ACE_optic_SOS_PIP"; + ACE_optic_LRPS_2D = "ACE_optic_LRPS_PIP"; +}; diff --git a/addons/optics/functions/fnc_handleFired.sqf b/addons/optics/functions/fnc_handleFired.sqf deleted file mode 100644 index f36f04d8817..00000000000 --- a/addons/optics/functions/fnc_handleFired.sqf +++ /dev/null @@ -1,104 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: Taosenai - * Adapted By: KoffeinFlummi, commy2 - * - * Animates the scope when firing. Called from the unified fired EH only for the local player. - * - * Arguments: - * None. Parameters inherited from EFUNC(common,firedEH) - * - * Return Value: - * None - * - * Example: - * call ace_optics_fnc_handleFired - * - * Public: No - */ - -// IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"]; -TRACE_10("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_vehicle,_gunner,_turret); - -disableSerialization; - -// Check if compatible scope is used -private _display = uiNamespace getVariable [QGVAR(RscWeaponInfo2D), displayNull]; - -if (isNull _display) exitWith {}; - -// Reduce the reticle movement as the player drops into lower, supported stances. -private _recoilCoef = switch (true) do { - case (isWeaponDeployed _unit): {0.1}; - case (isWeaponRested _unit): {0.4}; - default {1}; -}; - -// Constants which determine how the scope recoils - -private _recoilScope = _recoilCoef * linearConversion [0, 1, random 1, SCOPE_RECOIL_MIN, SCOPE_RECOIL_MAX, false]; - -private _reticleShiftX = _recoilCoef * linearConversion [0, 1, random 1, RETICLE_SHIFT_X_MIN, RETICLE_SHIFT_X_MAX, false]; -private _reticleShiftY = _recoilCoef * linearConversion [0, 1, random 1, RETICLE_SHIFT_Y_MIN, RETICLE_SHIFT_Y_MAX, false]; - -private _scopeShiftX = _recoilCoef * linearConversion [0, 1, random 1, SCOPE_SHIFT_X_MIN, SCOPE_SHIFT_X_MAX, false]; -private _scopeShiftY = _recoilCoef * linearConversion [0, 1, random 1, SCOPE_SHIFT_Y_MIN, SCOPE_SHIFT_Y_MAX, false]; - -// Create and commit recoil effect - -private _sizeX = (0.75 + _recoilScope) / (getResolution select 5); -private _sizeY = _sizeX * (4 / 3); - -private _positionReticle = [ - safezoneX + 0.5 * safezoneW - 0.5 * (_sizeX + _reticleShiftX), - safezoneY + 0.5 * safezoneH - 0.5 * (_sizeY + _reticleShiftY), - _sizeX, - _sizeY -]; - -(_display displayCtrl 1713001) ctrlSetPosition _positionReticle; -(_display displayCtrl 1713002) ctrlSetPosition _positionReticle; - -private _positionBody = [ - safezoneX + 0.5 * safezoneW - 0.5 * (2 * _sizeX + _scopeShiftX), - safezoneY + 0.5 * safezoneH - 0.5 * (2 * _sizeY + _scopeShiftY), - 2 * _sizeX, - 2 * _sizeY -]; - -(_display displayCtrl 1713005) ctrlSetPosition _positionBody; -(_display displayCtrl 1713006) ctrlSetPosition _positionBody; - -(_display displayCtrl 1713001) ctrlCommit 0; -(_display displayCtrl 1713002) ctrlCommit 0; -(_display displayCtrl 1713005) ctrlCommit 0; -(_display displayCtrl 1713006) ctrlCommit 0; - -// Bring them all back -_sizeX = 0.75 / (getResolution select 5); -_sizeY = _sizeX * (4 / 3); - -_positionReticle = [ - safezoneX + 0.5 * safezoneW - 0.5 * _sizeX, - safezoneY + 0.5 * safezoneH - 0.5 * _sizeY, - _sizeX, - _sizeY -]; - -(_display displayCtrl 1713001) ctrlSetPosition _positionReticle; -(_display displayCtrl 1713002) ctrlSetPosition _positionReticle; - -_positionBody = [ - safezoneX + 0.5 * safezoneW - 0.5 * 2 * _sizeX, - safezoneY + 0.5 * safezoneH - 0.5 * 2 * _sizeY, - 2 * _sizeX, - 2 * _sizeY -]; - -(_display displayCtrl 1713005) ctrlSetPosition _positionBody; -(_display displayCtrl 1713006) ctrlSetPosition _positionBody; - -(_display displayCtrl 1713001) ctrlCommit RECENTER_TIME; -(_display displayCtrl 1713002) ctrlCommit RECENTER_TIME; -(_display displayCtrl 1713005) ctrlCommit RECENTER_TIME; -(_display displayCtrl 1713006) ctrlCommit RECENTER_TIME; diff --git a/addons/optics/functions/fnc_onDrawScope.sqf b/addons/optics/functions/fnc_onDrawScope.sqf deleted file mode 100644 index 4b1b9e321df..00000000000 --- a/addons/optics/functions/fnc_onDrawScope.sqf +++ /dev/null @@ -1,39 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: commy2 - * - * - * Arguments: - * 0: Display <DISPLAY> - * - * Return Value: - * None - * - * Example: - * [DISPLAY] call ace_optics_fnc_onDrawScope - * - * Public: No - */ - -disableSerialization; - -params ["_display"]; - -private _control = _display displayCtrl 1713154; - -if (!ctrlShown (_display displayCtrl 154)) exitWith { - _control ctrlShow false; -}; - -private _sizeX = (call EFUNC(common,getZoom)) / 4; -private _sizeY = _sizeX * safezoneW / safezoneH; - -_control ctrlSetPosition [ - safezoneX + 0.5 * safezoneW - 0.5 * _sizeX, - safezoneY + 0.5 * safezoneH - 0.5 * _sizeY, - _sizeX, - _sizeY -]; - -_control ctrlCommit 0; -_control ctrlShow true; diff --git a/addons/optics/functions/fnc_onDrawScope2D.sqf b/addons/optics/functions/fnc_onDrawScope2D.sqf deleted file mode 100644 index c7fb19c9c13..00000000000 --- a/addons/optics/functions/fnc_onDrawScope2D.sqf +++ /dev/null @@ -1,103 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: commy2 - * Helper function for updating the 2d and 3d scope controls - * Called from a dummy map controls onDraw. - * - * Arguments: - * 0: Display (RscInGameUI for a weapon) <DISPLAY> - * - * Return Value: - * None - * - * Example: - * [ACE_RscWeapon_Arco's Display] call ace_optics_fnc_onDrawScope2D - * - * Public: No - */ - -disableSerialization; - -params ["_display"]; - -// @todo, all weapon types -private _optic = (primaryWeaponItems ACE_player) select 2; -private _isPIP = (getText (configFile >> "CfgWeapons" >> _optic >> "ItemInfo" >> "modelOptics")) == QPATHTOF(models\ace_optics_pip.p3d); - -if (_isPIP) then { - GVAR(pipLastFrame) = diag_frameno; - if (isNull GVAR(camera)) then { - if ((({_x != GVAR(camera)} count allMissionObjects "camera") > 0) || {!isNull curatorCamera}) exitWith { - TRACE_1("waiting for feature camera to end",GVAR(camera)); - }; - - // PiP technique by BadBenson - GVAR(camera) = "camera" camCreate positionCameraToWorld [0, 0, 0]; - GVAR(camera) camSetFov 0.7; - GVAR(camera) camSetTarget ACE_player; - GVAR(camera) camCommit 1; - - QGVAR(rendertarget0) setPiPEffect [0]; - GVAR(camera) cameraEffect ["INTERNAL", "BACK", QGVAR(rendertarget0)]; - - TRACE_2("created new pip camera",GVAR(camera),isNull GVAR(camera)); - - // Start a waitUntil to handle destruction after GVAR(pipLastFrame) is no longer updated - [{ - (abs (diag_frameno - GVAR(pipLastFrame))) > 1 - }, { - GVAR(camera) cameraEffect ["TERMINATE", "BACK"]; - camDestroy GVAR(camera); - TRACE_2("destroyed pip camera",GVAR(camera),isNull GVAR(camera)); - }, []] call CBA_fnc_waitUntilAndExecute; - }; -}; - -//If we are not zoomed into the actual scope (not collimator) -if (!ctrlShown (_display displayCtrl 154)) exitWith { - (_display displayCtrl 1713001) ctrlShow false; - (_display displayCtrl 1713002) ctrlShow false; - (_display displayCtrl 1713005) ctrlShow false; - (_display displayCtrl 1713006) ctrlShow false; - (_display displayCtrl 1713010) ctrlShow false; - (_display displayCtrl 1713011) ctrlShow false; -}; - -if (_isPIP) then { - GVAR(camera) setPosATL positionCameraToWorld [0, 0, 0.4]; - GVAR(camera) camPrepareTarget positionCameraToWorld [0, 0, 50]; - GVAR(camera) camCommitPrepared 0; - - // @todo, check if that needs to be done at all - if (cameraView == "GUNNER") then { - GVAR(camera) camsetFOV 0.7; - GVAR(camera) camcommit 0; - } else { - GVAR(camera) camsetFOV 0.01; - GVAR(camera) camcommit 0; - }; -}; - -// Calculate lighting -private _dayOpacity = call EFUNC(common,ambientBrightness); -private _nightOpacity = parseNumber (_dayOpacity == 1); - -// Apply lighting and make layers visible -(_display displayCtrl 1713001) ctrlSetTextColor [1, 1, 1, 1]; -(_display displayCtrl 1713002) ctrlSetTextColor [1, 1, 1, parseNumber (_dayOpacity < 0.5)]; -(_display displayCtrl 1713005) ctrlSetTextColor [1, 1, 1, _dayOpacity]; -(_display displayCtrl 1713006) ctrlSetTextColor [1, 1, 1, _nightOpacity]; - -/* -(_display displayCtrl 1713001) ctrlCommit 0; -(_display displayCtrl 1713002) ctrlCommit 0; -(_display displayCtrl 1713005) ctrlCommit 0; -(_display displayCtrl 1713006) ctrlCommit 0; - */ - -(_display displayCtrl 1713001) ctrlShow true; -(_display displayCtrl 1713002) ctrlShow true; -(_display displayCtrl 1713005) ctrlShow true; -(_display displayCtrl 1713006) ctrlShow true; -(_display displayCtrl 1713010) ctrlShow _isPIP; -(_display displayCtrl 1713011) ctrlShow _isPIP; diff --git a/addons/optics/models/ace_optics_empty.p3d b/addons/optics/models/ace_optics_empty.p3d deleted file mode 100644 index 89a29d7d8ce..00000000000 Binary files a/addons/optics/models/ace_optics_empty.p3d and /dev/null differ diff --git a/addons/optics/models/ace_optics_pip.p3d b/addons/optics/models/ace_optics_pip.p3d deleted file mode 100644 index 9ec67652942..00000000000 Binary files a/addons/optics/models/ace_optics_pip.p3d and /dev/null differ diff --git a/addons/optics/models/ace_optics_reticle100.p3d b/addons/optics/models/ace_optics_reticle100.p3d deleted file mode 100644 index b5f58cfd1c8..00000000000 Binary files a/addons/optics/models/ace_optics_reticle100.p3d and /dev/null differ diff --git a/addons/optics/models/ace_optics_reticle70.p3d b/addons/optics/models/ace_optics_reticle70.p3d deleted file mode 100644 index 5aa9e8613a8..00000000000 Binary files a/addons/optics/models/ace_optics_reticle70.p3d and /dev/null differ diff --git a/addons/optics/models/ace_optics_reticle80.p3d b/addons/optics/models/ace_optics_reticle80.p3d deleted file mode 100644 index 55cf2330321..00000000000 Binary files a/addons/optics/models/ace_optics_reticle80.p3d and /dev/null differ diff --git a/addons/optics/models/ace_optics_reticle90.p3d b/addons/optics/models/ace_optics_reticle90.p3d deleted file mode 100644 index 30dc511df99..00000000000 Binary files a/addons/optics/models/ace_optics_reticle90.p3d and /dev/null differ diff --git a/addons/optics/models/ace_shortdot_optics.p3d b/addons/optics/models/ace_shortdot_optics.p3d deleted file mode 100644 index 47b82be4b71..00000000000 Binary files a/addons/optics/models/ace_shortdot_optics.p3d and /dev/null differ diff --git a/addons/optics/reticles/ace_shortdot_reticle_1.paa b/addons/optics/reticles/ace_shortdot_reticle_1.paa deleted file mode 100644 index 6c3d23668ae..00000000000 Binary files a/addons/optics/reticles/ace_shortdot_reticle_1.paa and /dev/null differ diff --git a/addons/optics/reticles/ace_shortdot_reticle_2.paa b/addons/optics/reticles/ace_shortdot_reticle_2.paa deleted file mode 100644 index beb7a651c93..00000000000 Binary files a/addons/optics/reticles/ace_shortdot_reticle_2.paa and /dev/null differ diff --git a/addons/optics/reticles/black.rvmat b/addons/optics/reticles/black.rvmat deleted file mode 100644 index 431d76689f5..00000000000 --- a/addons/optics/reticles/black.rvmat +++ /dev/null @@ -1,8 +0,0 @@ -ambient[]={0,0,0,0.89999998}; -diffuse[]={0,0,0,0.89999998}; -forcedDiffuse[]={0,0,0,1}; -emmisive[]={0,0,0,1}; -specular[]={0,0,0,0}; -specularPower=1; -PixelShaderID="Normal"; -VertexShaderID="Basic"; diff --git a/addons/optics/reticles/em.rvmat b/addons/optics/reticles/em.rvmat deleted file mode 100644 index a491df4b9a7..00000000000 --- a/addons/optics/reticles/em.rvmat +++ /dev/null @@ -1,20 +0,0 @@ -ambient[]={1,1,1,1}; -diffuse[]={1,1,1,1}; -forcedDiffuse[]={0,0,0,0}; -emmisive[]={1,1,1,1}; -specular[]={1,0.99956858,1,1}; -specularPower=1; -PixelShaderID="Normal"; -VertexShaderID="Basic"; -class Stage1 -{ - texture="#(argb,8,8,3)color(0.5,0.5,0.5,0.5,DT)"; - uvSource="tex"; - class uvTransform - { - aside[]={1,0,0}; - up[]={0,1,0}; - dir[]={0,0,0}; - pos[]={0,0,0}; - }; -}; diff --git a/addons/optics/reticles/scopeblack-100_ca.paa b/addons/optics/reticles/scopeblack-100_ca.paa deleted file mode 100644 index d0232dc0ccd..00000000000 Binary files a/addons/optics/reticles/scopeblack-100_ca.paa and /dev/null differ diff --git a/addons/optics/reticles/scopeblack-70_ca.paa b/addons/optics/reticles/scopeblack-70_ca.paa deleted file mode 100644 index 62b06d7f844..00000000000 Binary files a/addons/optics/reticles/scopeblack-70_ca.paa and /dev/null differ diff --git a/addons/optics/reticles/scopeblack-80_ca.paa b/addons/optics/reticles/scopeblack-80_ca.paa deleted file mode 100644 index f74e3e41f1b..00000000000 Binary files a/addons/optics/reticles/scopeblack-80_ca.paa and /dev/null differ diff --git a/addons/optics/reticles/scopeblack-90_ca.paa b/addons/optics/reticles/scopeblack-90_ca.paa deleted file mode 100644 index 2240dcc5fe0..00000000000 Binary files a/addons/optics/reticles/scopeblack-90_ca.paa and /dev/null differ diff --git a/addons/optics/script_component.hpp b/addons/optics/script_component.hpp index 6cc168aea0c..e57cd984b0b 100644 --- a/addons/optics/script_component.hpp +++ b/addons/optics/script_component.hpp @@ -16,17 +16,10 @@ #include "\z\ace\addons\main\script_macros.hpp" -#define SCOPE_RECOIL_MIN 0.03 -#define SCOPE_RECOIL_MAX 0.032 - -#define SCOPE_SHIFT_X_MIN 0.04 -#define SCOPE_SHIFT_X_MAX 0.05 -#define SCOPE_SHIFT_Y_MIN -0.02 -#define SCOPE_SHIFT_Y_MAX -0.03 - -#define RETICLE_SHIFT_X_MIN 0.006 -#define RETICLE_SHIFT_X_MAX 0.011 -#define RETICLE_SHIFT_Y_MIN -0.009 -#define RETICLE_SHIFT_Y_MAX -0.014 - -#define RECENTER_TIME 0.09 +#define PRELOAD \ +class CBA_ScriptedOptic {\ + reticleTexture = "*";\ + reticleTextureNight = "*";\ + bodyTexture = "*";\ + bodyTextureNight = "*";\ +} diff --git a/addons/optics/stringtable.xml b/addons/optics/stringtable.xml index 85620ac37c7..5433f805092 100644 --- a/addons/optics/stringtable.xml +++ b/addons/optics/stringtable.xml @@ -69,7 +69,7 @@ <Chinese>先進步槍戰鬥光學瞄準鏡(擬真版)</Chinese> <Turkish>ARCO (PIP)</Turkish> </Key> - <Key ID="STR_ACE_Optics_valdada"> + <Key ID="STR_ACE_Optics_mrco"> <English>MRCO (2D)</English> <Czech>MRCO (2D)</Czech> <French>MRCO (2D)</French> @@ -86,7 +86,7 @@ <Chinese>多距離戰鬥瞄準鏡(2D)</Chinese> <Turkish>MRCO (2D)</Turkish> </Key> - <Key ID="STR_ACE_Optics_valdada_pip"> + <Key ID="STR_ACE_Optics_mrco_pip"> <English>MRCO (PIP)</English> <Czech>MRCO (PIP)</Czech> <French>MRCO (PIP)</French> diff --git a/addons/optionsmenu/config.cpp b/addons/optionsmenu/config.cpp index 811b1eecece..0d9977be7a5 100644 --- a/addons/optionsmenu/config.cpp +++ b/addons/optionsmenu/config.cpp @@ -29,13 +29,6 @@ class CfgAddons { #include "gui\mainMenu.hpp" #include "gui\pauseMenu.hpp" -class ACE_Extensions { - class ace_clipboard { - windows = 1; - client = 1; - }; -}; - class CfgCommands { allowedHTMLLoadURIs[] += { "https://ace3.acemod.org/version.html" diff --git a/addons/optionsmenu/functions/fnc_debugDumpToClipboard.sqf b/addons/optionsmenu/functions/fnc_debugDumpToClipboard.sqf index 07205dc1952..00d97d20082 100644 --- a/addons/optionsmenu/functions/fnc_debugDumpToClipboard.sqf +++ b/addons/optionsmenu/functions/fnc_debugDumpToClipboard.sqf @@ -19,8 +19,7 @@ private _outputText = { diag_log text (_this select 0); - "ace_clipboard" callExtension ((_this select 0) + " -"); + "ace" callExtension ["clipboard:append", [(_this select 0) + endl]]; }; private _text = format ["~~~~~~~~~ACE Debug~~~~~~~~~ @@ -76,8 +75,8 @@ _text = format [" { - _var = missionNamespace getVariable [_x, nil]; - if(!isnil "_var" && {_var isEqualType []} && {(count _var) > MIN_ARRAY_SIZE}) then { + private _var = missionNamespace getVariable [_x, nil]; + if(!isNil "_var" && {_var isEqualType []} && {(count _var) > MIN_ARRAY_SIZE}) then { _text = format ["%1 - ARRAY SIZE: %2", _x, (count _var)]; [_text] call _outputText; }; @@ -87,11 +86,11 @@ _text = format [" private _unit = _x; { private _var = _unit getVariable [_x, nil]; - if(!isnil "_var" && {_var isEqualType []} && {(count _var) > MIN_ARRAY_SIZE}) then { + if(!isNil "_var" && {_var isEqualType []} && {(count _var) > MIN_ARRAY_SIZE}) then { _text = format ["%1 on [%2] - ARRAY SIZE: %3", _x, _unit, (count _var)]; [_text] call _outputText; }; } forEach (allVariables _unit); } forEach allUnits; -"ace_clipboard" callExtension "--COMPLETE--"; +"ace" callExtension ["clipboard:complete", []]; diff --git a/addons/optionsmenu/gui/mainMenu.hpp b/addons/optionsmenu/gui/mainMenu.hpp index 0b26df7017a..9df21dbeb5f 100644 --- a/addons/optionsmenu/gui/mainMenu.hpp +++ b/addons/optionsmenu/gui/mainMenu.hpp @@ -22,7 +22,7 @@ class RscDisplayMain: RscStandardDisplay { class ACE_news_apex: InfoNews { idc = IDC_MAIN_INFO; - y = "safezoneY + safezoneH - (3 * 2 + 1) * (pixelH * pixelGrid * 2) - 4 * (4 * pixelH)"; + y = "safeZoneY + safeZoneH - (3 * 2 + 1) * (pixelH * pixelGrid * 2) - 4 * (4 * pixelH)"; class Controls: Controls { class Background: Background {}; diff --git a/addons/overheating/CfgWeapons.hpp b/addons/overheating/CfgWeapons.hpp index 9232fa32492..0b8087cc139 100644 --- a/addons/overheating/CfgWeapons.hpp +++ b/addons/overheating/CfgWeapons.hpp @@ -97,17 +97,19 @@ class CfgWeapons { GVAR(closedBolt) = 1; GVAR(jamTypesAllowed)[] = {"Fire", "Dud"}; }; + class ACE_ItemCore; class CBA_MiscItem_ItemInfo; - // Deprecated, 3.16.0 Arsenal supports showing magazines as misc items + // Deprecated, 3.16.0 Arsenal supports showing magazines as misc. items + // However, since base game doesn't support misc. items, it's still needed to filling inventories in the editor class ACE_SpareBarrel_Item: ACE_ItemCore { displayName = CSTRING(SpareBarrelName); author = ECSTRING(common,ACETeam); - scope = 1; + scope = 2; scopeArsenal = 0; - descriptionshort = CSTRING(SpareBarrelDescription); - picture = QUOTE(PATHTOF(UI\spare_barrel_ca.paa)); + descriptionShort = CSTRING(SpareBarrelDescription); + picture = QPATHTOF(UI\spare_barrel_ca.paa); class ItemInfo: CBA_MiscItem_ItemInfo { mass = 25; }; diff --git a/addons/overheating/XEH_postInit.sqf b/addons/overheating/XEH_postInit.sqf index a49030b1adb..223581adb2c 100644 --- a/addons/overheating/XEH_postInit.sqf +++ b/addons/overheating/XEH_postInit.sqf @@ -71,7 +71,7 @@ if (hasInterface) then { ["CAManBase", "Reloaded", { params ["_unit", "_weapon", "_muzzle"]; if (_muzzle == _weapon) then { - _unit setVariable [format [QGVAR(%1_ammoTemp), _weapon], 0]; + _unit setVariable [format [QGVAR(%1_ammoTemp), _weapon], ambientTemperature select 0]; }; }] call CBA_fnc_addClassEventHandler; }; @@ -103,6 +103,7 @@ if (hasInterface) then { LLSTRING(CoolWeaponWithWaterSource), QPATHTOEF(field_rations,ui\icon_water_tap.paa), { + //IGNORE_PRIVATE_WARNING ["_player", "_target"]; private _waterSource = _target getVariable [QEGVAR(field_rations,waterSource), objNull]; [_player, _waterSource] call FUNC(coolWeaponWithWaterSource); }, diff --git a/addons/overheating/functions/fnc_coolWeaponWithWaterSource.sqf b/addons/overheating/functions/fnc_coolWeaponWithWaterSource.sqf index 67f22a3cc08..18f8b0f31a3 100644 --- a/addons/overheating/functions/fnc_coolWeaponWithWaterSource.sqf +++ b/addons/overheating/functions/fnc_coolWeaponWithWaterSource.sqf @@ -37,7 +37,7 @@ private _fnc_onFinish = { ] call CBA_fnc_notify; }; - [_player, _player, currentWeapon _player] call ace_overheating_fnc_checkTemperature; + [_player, _player, currentWeapon _player] call FUNC(checkTemperature); GVAR(coolingWeaponWithWaterSource) = false; }; diff --git a/addons/overheating/functions/fnc_getConsumableChildren.sqf b/addons/overheating/functions/fnc_getConsumableChildren.sqf index 025e9a69397..fea6f897f07 100644 --- a/addons/overheating/functions/fnc_getConsumableChildren.sqf +++ b/addons/overheating/functions/fnc_getConsumableChildren.sqf @@ -19,6 +19,7 @@ params ["_unit"]; private _fnc_getActions = { TRACE_1("Creating overheating consumable item actions",_unit); + //IGNORE_PRIVATE_WARNING ["_unit"]; private _actions = []; private _cfgWeapons = configFile >> "CfgWeapons"; diff --git a/addons/overheating/functions/fnc_getWeaponData.sqf b/addons/overheating/functions/fnc_getWeaponData.sqf index 8edd86bb1aa..ec68cf67b9d 100644 --- a/addons/overheating/functions/fnc_getWeaponData.sqf +++ b/addons/overheating/functions/fnc_getWeaponData.sqf @@ -77,7 +77,7 @@ if (_muzzle == "this") then { _muzzle = _weapon; }; -private _reloadTime = getNumber (configfile >> "CfgWeapons" >> _weapon >> (_modes select 0) >> "reloadTime"); +private _reloadTime = getNumber (configFile >> "CfgWeapons" >> _weapon >> (_modes select 0) >> "reloadTime"); private _closedBolt = getNumber (configFile >> "CfgWeapons" >> _weapon >> QGVAR(closedBolt)); diff --git a/addons/overheating/functions/fnc_jamWeapon.sqf b/addons/overheating/functions/fnc_jamWeapon.sqf index 9a5b8b10491..afe6d15e975 100644 --- a/addons/overheating/functions/fnc_jamWeapon.sqf +++ b/addons/overheating/functions/fnc_jamWeapon.sqf @@ -80,9 +80,11 @@ if (_unit getVariable [QGVAR(JammingActionID), -1] == -1) then { private _condition = { private _unit = _this select 1; - [_unit] call CBA_fnc_canUseWeapon - && {currentMuzzle _unit in (_unit getVariable [QGVAR(jammedWeapons), []])} - && {!(currentMuzzle _unit in (_unit getVariable [QEGVAR(safemode,safedWeapons), []]))} + (weaponState _unit) params ["_currentWeapon", "_currentMuzzle"]; + + _unit call CBA_fnc_canUseWeapon + && {_currentMuzzle in (_unit getVariable [QGVAR(jammedWeapons), []])} + && {!(["ace_safemode"] call EFUNC(common,isModLoaded)) || {!([_unit, _currentWeapon, _currentMuzzle] call EFUNC(safemode,getWeaponSafety))}} }; private _statement = { diff --git a/addons/overheating/stringtable.xml b/addons/overheating/stringtable.xml index d5e8ad7ca87..0d3f0dd96eb 100644 --- a/addons/overheating/stringtable.xml +++ b/addons/overheating/stringtable.xml @@ -58,6 +58,7 @@ <Chinesesimp>过热系数</Chinesesimp> <Korean>과열 계수</Korean> <Spanish>Coeficiente de calentamiento</Spanish> + <Portuguese>Coeficiente de aquecimento</Portuguese> </Key> <Key ID="STR_ACE_Overheating_heatCoef_description"> <English>Coefficient for the amount of heat a weapon generates per shot.\nHigher value increases heat.</English> @@ -70,6 +71,7 @@ <Chinesesimp>武器每次射击产生的热量系数。\n数值越高,热量越高。</Chinesesimp> <Korean>매 발사마다 만들어지는 열에 계수를 적용합니다.\n높은 계수는 더 많은 열을 발생시킵니다.</Korean> <Spanish>Coeficiente para la cantidad de calor que genera un arma por disparo.\nValores más altos incrementan el calor</Spanish> + <Portuguese>Coeficiente da quantidade de calor que um armamento gera por disparo.\nValores mais altos potencializam o aquecimento.</Portuguese> </Key> <Key ID="STR_ACE_Overheating_coolingCoef_displayName"> <English>Cooling Coefficient</English> @@ -82,6 +84,7 @@ <Russian>Коэф. остывания</Russian> <Spanish>Coeficiente de enfriado</Spanish> <French>Coefficient de refroidissement</French> + <Portuguese>Coeficiente de resfriamento</Portuguese> </Key> <Key ID="STR_ACE_Overheating_coolingCoef_description"> <English>Coefficient for how quickly a weapon cools down.\nHigher value increases cooling speed.</English> @@ -94,6 +97,7 @@ <Russian>Коэффициент скорости остывания орудия.\nЧем больше значение, тем быстрее остывает.</Russian> <Spanish>Coeficiente para cómo de rápido se enfría un arma.\nValores más altos incrementan la velocidad de enfriamiento.</Spanish> <French>Coefficient de rapidité de refroidissement de l'arme.\nUne valeur élevée augmente la vitesse de refroidissement.</French> + <Portuguese>Coeficiente que determina o quão rápido a arma resfria.\nValores mais altos potencializam o resfriamento.</Portuguese> </Key> <Key ID="STR_ACE_Overheating_suppressorCoef_displayName"> <English>Suppressor Coefficient</English> @@ -106,6 +110,7 @@ <Russian>Коэф. глушителя</Russian> <Spanish>Coeficiente del silenciador</Spanish> <French>Coefficient de suppresion</French> + <Portuguese>Coeficiente de supressão</Portuguese> </Key> <Key ID="STR_ACE_Overheating_suppressorCoef_description"> <English>Coefficient for how much additional heat is added from having a suppressor attached.\nHigher value increases heat, 0 means no additional heat from the suppressor.</English> diff --git a/addons/overpressure/functions/fnc_firedEHBB.sqf b/addons/overpressure/functions/fnc_firedEHBB.sqf index 05a761bf068..59b51f28629 100644 --- a/addons/overpressure/functions/fnc_firedEHBB.sqf +++ b/addons/overpressure/functions/fnc_firedEHBB.sqf @@ -15,8 +15,8 @@ * Public: No */ -//IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"]; -TRACE_10("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_vehicle,_gunner,_turret); +//IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"]; +TRACE_8("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_gunner); // Retrieve backblast values private _bbValues = [_weapon, _ammo, _magazine] call FUNC(getOverPressureValues); @@ -28,11 +28,11 @@ TRACE_4("cache",_backblastAngle,_backblastRange,_backblastDamage,_offset); if (_backblastDamage <= 0) exitWith {}; -private _direction = [0, 0, 0] vectorDiff (vectorDir _projectile); -private _position = ((getPosASL _projectile) vectorAdd (_direction vectorMultiply _offset)); +private _direction = (vectorDir _projectile) vectorMultiply -1; +private _position = (getPosASL _projectile) vectorAdd (_direction vectorMultiply _offset); // Damage to others -private _affected = (ASLtoAGL _position) nearEntities ["CAManBase", _backblastRange]; +private _affected = (ASLToAGL _position) nearEntities ["CAManBase", _backblastRange]; // Let each client handle their own affected units ["ace_overpressure", [_unit, _position, _direction, _weapon, _magazine, _ammo], _affected] call CBA_fnc_targetEvent; diff --git a/addons/overpressure/functions/fnc_firedEHOP.sqf b/addons/overpressure/functions/fnc_firedEHOP.sqf index e011098b59e..eb51a055076 100644 --- a/addons/overpressure/functions/fnc_firedEHOP.sqf +++ b/addons/overpressure/functions/fnc_firedEHOP.sqf @@ -15,8 +15,8 @@ * Public: No */ -//IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"]; -TRACE_10("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_vehicle,_gunner,_turret); +//IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"]; +TRACE_8("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_gunner); // Retrieve overpressure values private _opValues = [_weapon, _ammo, _magazine] call FUNC(getOverPressureValues); @@ -33,7 +33,7 @@ private _position = getPosASL _projectile; private _direction = vectorDir _projectile; // Damage to others -private _affected = (ASLtoAGL _position) nearEntities ["CAManBase", _dangerZoneRange]; +private _affected = (ASLToAGL _position) nearEntities ["CAManBase", _dangerZoneRange]; // Let each client handle their own affected units ["ace_overpressure", [_unit, _position, _direction, _weapon, _magazine, _ammo], _affected] call CBA_fnc_targetEvent; diff --git a/addons/overpressure/functions/fnc_overpressureDamage.sqf b/addons/overpressure/functions/fnc_overpressureDamage.sqf index 12b7a820cab..f727413d4a5 100644 --- a/addons/overpressure/functions/fnc_overpressureDamage.sqf +++ b/addons/overpressure/functions/fnc_overpressureDamage.sqf @@ -73,4 +73,4 @@ TRACE_3("cache",_overpressureAngle,_overpressureRange,_overpressureDamage); #endif }; }; -} forEach ((ASLtoAGL _posASL) nearEntities ["CAManBase", _overpressureRange]); +} forEach ((ASLToAGL _posASL) nearEntities ["CAManBase", _overpressureRange]); diff --git a/addons/overpressure/stringtable.xml b/addons/overpressure/stringtable.xml index 2ce7615ad45..c8a0aa895d5 100644 --- a/addons/overpressure/stringtable.xml +++ b/addons/overpressure/stringtable.xml @@ -52,6 +52,7 @@ <Italian>Coefficiente distanza di svampata</Italian> <Japanese>後方噴射の距離係数</Japanese> <Korean>후폭풍 거리 계수</Korean> + <French>Multiplicateur de distance de réflexion</French> </Key> <Key ID="STR_ACE_Overpressure_backblastDistanceCoefficient_toolTip"> <English>Scales the backblast effect</English> @@ -60,6 +61,7 @@ <Italian>Scala l'effetto delle svampate dei lanciarazzi</Italian> <Japanese>無反動砲による後方噴射の影響範囲の大きさ</Japanese> <Korean>후폭풍 효과의 스케일을 조정합니다</Korean> + <French>Multiplicateur de distance de réflexion</French> </Key> <Key ID="STR_ACE_Overpressure_statBackblastRange"> <English>Backblast range</English> @@ -72,7 +74,7 @@ <Russian>Дальность реактивной струи</Russian> <Portuguese>Alcance do Sopro de Disparo</Portuguese> <Hungarian>Utóhatás távolsága</Hungarian> - <French>Portée du backblast</French> + <French>Portée du souffle</French> <Czech>Dosah zpětné tlakové vlny (backblast)</Czech> <Spanish>Alcance del cono de fuego</Spanish> <Korean>후폭풍 거리</Korean> @@ -88,7 +90,7 @@ <Russian>Угол реактивной струи</Russian> <Portuguese>Ângulo do Sopro de Disparo</Portuguese> <Hungarian>Utóhatás aránya</Hungarian> - <French>Angle du backblast</French> + <French>Angle du souffle</French> <Czech>Úhel zpětné tlakové vlny (backblast)</Czech> <Spanish>Ángulo del cono de fuego</Spanish> <Korean>후폭풍 각도</Korean> diff --git a/addons/parachute/RscTitles.hpp b/addons/parachute/RscTitles.hpp index 48cf11bee4d..388115a2a88 100644 --- a/addons/parachute/RscTitles.hpp +++ b/addons/parachute/RscTitles.hpp @@ -13,37 +13,37 @@ class RscTitles { class AltimeterImage: RscPicture { idc = 1200; text = QPATHTOF(UI\watch_altimeter.paa); - x = "0.118437 * safezoneW + safezoneX"; - y = "0.621 * safezoneH + safezoneY"; - w = "0.20625 * safezoneW"; - h = "0.341 * safezoneH"; + x = "0.118437 * safeZoneW + safeZoneX"; + y = "0.621 * safeZoneH + safeZoneY"; + w = "0.20625 * safeZoneW"; + h = "0.341 * safeZoneH"; }; class HeightText: RscText { idc = 1100; text = "----"; - x = "0.200937 * safezoneW + safezoneX"; - y = "0.764 * safezoneH + safezoneY"; - w = "0.04125 * safezoneW"; - h = "0.033 * safezoneH"; + x = "0.200937 * safeZoneW + safeZoneX"; + y = "0.764 * safeZoneH + safeZoneY"; + w = "0.04125 * safeZoneW"; + h = "0.033 * safeZoneH"; colorBackground[] = {0,0,0,0}; colorText[] = {0,0,0,1}; }; class DecendRate: RscText { idc = 1000; text = "--"; - x = "0.21125 * safezoneW + safezoneX"; - y = "0.742 * safezoneH + safezoneY"; - w = "0.020625 * safezoneW"; - h = "0.022 * safezoneH"; + x = "0.21125 * safeZoneW + safeZoneX"; + y = "0.742 * safeZoneH + safeZoneY"; + w = "0.020625 * safeZoneW"; + h = "0.022 * safeZoneH"; colorText[] = {0,0,0,1}; }; class TimeText: RscText { idc = 1001; text = "00:00:00"; - x = "0.202094 * safezoneW + safezoneX"; - y = "0.819 * safezoneH + safezoneY"; - w = "0.0380375 * safezoneW"; - h = "0.022 * safezoneH"; + x = "0.202094 * safeZoneW + safeZoneX"; + y = "0.819 * safeZoneH + safeZoneY"; + w = "0.0380375 * safeZoneW"; + h = "0.022 * safeZoneH"; colorText[] = {0,0,0,1}; }; }; diff --git a/addons/parachute/functions/fnc_cutParachute.sqf b/addons/parachute/functions/fnc_cutParachute.sqf index c66d9ff0504..604fb201076 100644 --- a/addons/parachute/functions/fnc_cutParachute.sqf +++ b/addons/parachute/functions/fnc_cutParachute.sqf @@ -18,6 +18,6 @@ params ["_unit", "_parachute"]; TRACE_2("cutParachute",_unit,_parachute); -playSound3d ["A3\Sounds_F\characters\parachute\parachute_landing.wss", _unit]; +playSound3D ["A3\Sounds_F\characters\parachute\parachute_landing.wss", _unit]; _unit action ["GetOut", _parachute]; deleteVehicle _parachute; diff --git a/addons/parachute/stringtable.xml b/addons/parachute/stringtable.xml index db48a6109cb..b13483dca5e 100644 --- a/addons/parachute/stringtable.xml +++ b/addons/parachute/stringtable.xml @@ -146,6 +146,7 @@ <Chinesesimp>开伞失败率</Chinesesimp> <Korean>낙하산 펼치기 실패 확률</Korean> <Spanish>Probabilidad de fallo de paracaidas</Spanish> + <Portuguese>Probabilidade de falha do paraquedas</Portuguese> </Key> </Package> </Project> diff --git a/addons/pylons/XEH_postInit.sqf b/addons/pylons/XEH_postInit.sqf index 3167c0a838a..e1bd05cb53c 100644 --- a/addons/pylons/XEH_postInit.sqf +++ b/addons/pylons/XEH_postInit.sqf @@ -2,6 +2,7 @@ GVAR(aircraftWithPylons) = []; +//IGNORE_PRIVATE_WARNING ["_player", "_target"]; GVAR(loadoutAction) = [ // create action QGVAR(loadoutAction), localize LSTRING(ConfigurePylons), @@ -36,7 +37,7 @@ GVAR(loadoutAction) = [ // create action [QGVAR(setPylonLoadOutEvent), { params ["_aircraft", "_pylonIndex", "_pylon", "_turret", "_weaponToRemove"]; TRACE_5("setPylonLoadOutEvent",_aircraft,_pylonIndex,_pylon,_turret,_weaponToRemove); - _aircraft setPylonLoadOut [_pylonIndex, _pylon, false, _turret]; + _aircraft setPylonLoadout [_pylonIndex, _pylon, false, _turret]; if (_weaponToRemove != "") then { { if (_aircraft turretLocal _x) then { diff --git a/addons/pylons/functions/fnc_showDialog.sqf b/addons/pylons/functions/fnc_showDialog.sqf index 9c0faab52d0..7df50c6b2aa 100644 --- a/addons/pylons/functions/fnc_showDialog.sqf +++ b/addons/pylons/functions/fnc_showDialog.sqf @@ -73,8 +73,8 @@ GVAR(comboBoxes) = []; _combo ctrlSetPosition [ (_picturePos select 0) + (_uiPos select 0), (_picturePos select 1) + (_uiPos select 1), - 0.1 * safezoneW, - 0.028 * safezoneH + 0.1 * safeZoneW, + 0.028 * safeZoneH ]; _combo ctrlCommit 0; @@ -113,10 +113,10 @@ GVAR(comboBoxes) = []; [_button, false, _turret] call FUNC(onButtonTurret); _button ctrlAddEventHandler ["ButtonClick", {[_this select 0, true, []] call FUNC(onButtonTurret)}]; _button ctrlSetPosition [ - (_picturePos select 0) + (_uiPos select 0) - (0.0165 * safezoneW), + (_picturePos select 0) + (_uiPos select 0) - (0.0165 * safeZoneW), (_picturePos select 1) + (_uiPos select 1), - 0.0165 * safezoneW, - 0.028 * safezoneH + 0.0165 * safeZoneW, + 0.028 * safeZoneH ]; _button ctrlCommit 0; }; diff --git a/addons/pylons/menu.hpp b/addons/pylons/menu.hpp index 143792e566e..3f238a9da1c 100644 --- a/addons/pylons/menu.hpp +++ b/addons/pylons/menu.hpp @@ -23,143 +23,143 @@ class GVAR(DialogLoadout) { class TextTitlebar: RscText { idc = ID_TEXT_TITLEBAR; text = CSTRING(AircraftLoadoutTitle); - x = "0.15835 * safezoneW + safezoneX"; - y = "0.262 * safezoneH + safezoneY"; - w = "0.68304 * safezoneW"; - h = "0.028 * safezoneH"; + x = "0.15835 * safeZoneW + safeZoneX"; + y = "0.262 * safeZoneH + safeZoneY"; + w = "0.68304 * safeZoneW"; + h = "0.028 * safeZoneH"; colorBackground[] = {"(profileNamespace getVariable ['GUI_BCG_RGB_R', 0.13])","(profileNamespace getVariable ['GUI_BCG_RGB_G', 0.54])","(profileNamespace getVariable ['GUI_BCG_RGB_B', 0.21])",1}; }; class BackgroundDialog: IGUIBack { idc = ID_BACKGROUND_DIALOG; - x = "0.15835 * safezoneW + safezoneX"; - y = "0.29 * safezoneH + safezoneY"; - w = "0.68304 * safezoneW"; - h = "0.448 * safezoneH"; + x = "0.15835 * safeZoneW + safeZoneX"; + y = "0.29 * safeZoneH + safeZoneY"; + w = "0.68304 * safeZoneW"; + h = "0.448 * safeZoneH"; colorBackground[] = {0,0,0,0.3}; }; class BackgroundPicture: IGUIBack { idc = ID_BACKGROUND_PICTURE; - x = "0.171616 * safezoneW + safezoneX"; - y = "0.318 * safezoneH + safezoneY"; - w = "0.440035 * safezoneW"; - h = "0.392 * safezoneH"; + x = "0.171616 * safeZoneW + safeZoneX"; + y = "0.318 * safeZoneH + safeZoneY"; + w = "0.440035 * safeZoneW"; + h = "0.392 * safeZoneH"; colorBackground[] = {0.3,0.3,0.3,1}; }; class PictureAircraft: RscPictureKeepAspect { idc = ID_PICTURE_AIRCRAFT; - x = "0.171616 * safezoneW + safezoneX"; - y = "0.318 * safezoneH + safezoneY"; - w = "0.440035 * safezoneW"; - h = "0.392 * safezoneH"; + x = "0.171616 * safeZoneW + safeZoneX"; + y = "0.318 * safeZoneH + safeZoneY"; + w = "0.440035 * safeZoneW"; + h = "0.392 * safeZoneH"; }; class CheckboxMirror: RscCheckBox { idc = ID_CHECKBOX_MIRROR; - x = "0.171616 * safezoneW + safezoneX"; - y = "0.318 * safezoneH + safezoneY"; - w = "0.0165 * safezoneW"; - h = "0.028 * safezoneH"; + x = "0.171616 * safeZoneW + safeZoneX"; + y = "0.318 * safeZoneH + safeZoneY"; + w = "0.0165 * safeZoneW"; + h = "0.028 * safeZoneH"; }; class TextMirror: RscText { idc = ID_TEXT_MIRROR; text = "$STR_3DEN_Object_Attribute_PylonsMirror_displayName"; tooltip="$STR_3DEN_Object_Attribute_PylonsMirror_tooltip"; - x = "0.188116 * safezoneW + safezoneX"; - y = "0.318 * safezoneH + safezoneY"; - w = "0.0656768 * safezoneW"; - h = "0.028 * safezoneH"; + x = "0.188116 * safeZoneW + safeZoneX"; + y = "0.318 * safeZoneH + safeZoneY"; + w = "0.0656768 * safeZoneW"; + h = "0.028 * safeZoneH"; colorBackground[] = {0,0,0,0.5}; }; class CheckboxFRIES: RscCheckBox { idc = ID_CHECKBOX_FRIES; - x = "0.171616 * safezoneW + safezoneX"; - y = "0.346 * safezoneH + safezoneY"; - w = "0.0165 * safezoneW"; - h = "0.028 * safezoneH"; + x = "0.171616 * safeZoneW + safeZoneX"; + y = "0.346 * safeZoneH + safeZoneY"; + w = "0.0165 * safeZoneW"; + h = "0.028 * safeZoneH"; }; class TextFRIES: RscText { idc = ID_TEXT_FRIES; text = "FRIES"; - x = "0.188116 * safezoneW + safezoneX"; - y = "0.346 * safezoneH + safezoneY"; - w = "0.0656768 * safezoneW"; - h = "0.028 * safezoneH"; + x = "0.188116 * safeZoneW + safeZoneX"; + y = "0.346 * safeZoneH + safeZoneY"; + w = "0.0656768 * safeZoneW"; + h = "0.028 * safeZoneH"; colorBackground[] = {0,0,0,0.5}; }; class TextListTitle: RscText { idc = ID_TEXT_LISTTITLE; - x = "0.624786 * safezoneW + safezoneX"; - y = "0.318 * safezoneH + safezoneY"; - w = "0.203437 * safezoneW"; - h = "0.028 * safezoneH"; + x = "0.624786 * safeZoneW + safeZoneX"; + y = "0.318 * safeZoneH + safeZoneY"; + w = "0.203437 * safeZoneW"; + h = "0.028 * safeZoneH"; colorBackground[] = {0,0,0,0.5}; }; class ListLoadouts: RscListBox { idc = ID_LIST_LOADOUTS; - x = "0.624786 * safezoneW + safezoneX"; - y = "0.346 * safezoneH + safezoneY"; - w = "0.203437 * safezoneW"; - h = "0.294 * safezoneH"; + x = "0.624786 * safeZoneW + safeZoneX"; + y = "0.346 * safeZoneH + safeZoneY"; + w = "0.203437 * safeZoneW"; + h = "0.294 * safeZoneH"; }; class EditLoadoutName: RscEdit { idc = ID_EDIT_LOADOUTNAME; - x = "0.624786 * safezoneW + safezoneX"; - y = "0.64 * safezoneH + safezoneY"; - w = "0.203437 * safezoneW"; - h = "0.028 * safezoneH"; + x = "0.624786 * safeZoneW + safeZoneX"; + y = "0.64 * safeZoneH + safeZoneY"; + w = "0.203437 * safeZoneW"; + h = "0.028 * safeZoneH"; colorBackground[] = {0,0,0,0.7}; }; class ButtonSave: RscButtonMenu { idc = ID_BUTTON_SAVE; action = QUOTE(call FUNC(onButtonSave)); text = "$STR_disp_int_save"; - x = "0.624786 * safezoneW + safezoneX"; - y = "0.682 * safezoneH + safezoneY"; - w = "0.0590625 * safezoneW"; - h = "0.028 * safezoneH"; + x = "0.624786 * safeZoneW + safeZoneX"; + y = "0.682 * safeZoneH + safeZoneY"; + w = "0.0590625 * safeZoneW"; + h = "0.028 * safeZoneH"; }; class ButtonLoad: RscButtonMenu { idc = ID_BUTTON_LOAD; action = QUOTE(call FUNC(onButtonLoad)); text = "$STR_disp_int_load"; - x = "0.69703 * safezoneW + safezoneX"; - y = "0.682 * safezoneH + safezoneY"; - w = "0.0590625 * safezoneW"; - h = "0.028 * safezoneH"; + x = "0.69703 * safeZoneW + safeZoneX"; + y = "0.682 * safeZoneH + safeZoneY"; + w = "0.0590625 * safeZoneW"; + h = "0.028 * safeZoneH"; }; class ButtonDelete: RscButtonMenu { idc = ID_BUTTON_DELETE; action = QUOTE(call FUNC(onButtonDelete)); text = "$STR_disp_delete"; - x = "0.769275 * safezoneW + safezoneX"; - y = "0.682 * safezoneH + safezoneY"; - w = "0.0590625 * safezoneW"; - h = "0.028 * safezoneH"; + x = "0.769275 * safeZoneW + safeZoneX"; + y = "0.682 * safeZoneH + safeZoneY"; + w = "0.0590625 * safeZoneW"; + h = "0.028 * safeZoneH"; }; class ButtonApply: RscButtonMenu { idc = ID_BUTTON_APPLY; action = QUOTE(call FUNC(onButtonApply)); text = "$STR_ui_debug_but_apply"; - x = "0.683895 * safezoneW + safezoneX"; - y = "0.738 * safezoneH + safezoneY"; - w = "0.0721875 * safezoneW"; - h = "0.028 * safezoneH"; + x = "0.683895 * safeZoneW + safeZoneX"; + y = "0.738 * safeZoneH + safeZoneY"; + w = "0.0721875 * safeZoneW"; + h = "0.028 * safeZoneH"; }; class ButtonClose: RscButtonMenu { idc = ID_BUTTON_CLOSE; text = "$STR_disp_cancel"; action = QUOTE(call FUNC(onButtonClose)); - x = "0.769275 * safezoneW + safezoneX"; - y = "0.738 * safezoneH + safezoneY"; - w = "0.0721875 * safezoneW"; - h = "0.028 * safezoneH"; + x = "0.769275 * safeZoneW + safeZoneX"; + y = "0.738 * safeZoneH + safeZoneY"; + w = "0.0721875 * safeZoneW"; + h = "0.028 * safeZoneH"; }; class TextBanner: RscText { idc = ID_TEXT_BANNER; text = CSTRING(BannerText); - x = "0.171616 * safezoneW + safezoneX"; - y = "0.738 * safezoneH + safezoneY"; - w = "0.440035 * safezoneW"; - h = "0.028 * safezoneH"; + x = "0.171616 * safeZoneW + safeZoneX"; + y = "0.738 * safeZoneH + safeZoneY"; + w = "0.440035 * safeZoneW"; + h = "0.028 * safeZoneH"; colorBackground[] = {0.5,0,0,0.5}; }; }; diff --git a/addons/quickmount/XEH_postInitClient.sqf b/addons/quickmount/XEH_postInitClient.sqf index 23c225f5839..30f655edd82 100644 --- a/addons/quickmount/XEH_postInitClient.sqf +++ b/addons/quickmount/XEH_postInitClient.sqf @@ -2,9 +2,8 @@ if (!hasInterface) exitWith {}; -["ACE3 Movement", QGVAR(mount), [localize LSTRING(KeybindName), localize LSTRING(KeybindDescription)], "", { +["ACE3 Movement", QGVAR(mount), [LLSTRING(KeybindName), LLSTRING(KeybindDescription)], "", { if (!dialog) then { [] call FUNC(getInNearest); }; - false }] call CBA_fnc_addKeybind; diff --git a/addons/quickmount/config.cpp b/addons/quickmount/config.cpp index d74d99c0503..846e5f05430 100644 --- a/addons/quickmount/config.cpp +++ b/addons/quickmount/config.cpp @@ -2,6 +2,7 @@ class CfgPatches { class ADDON { + name = COMPONENT_NAME; units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; diff --git a/addons/quickmount/functions/fnc_addFreeSeatsActions.sqf b/addons/quickmount/functions/fnc_addFreeSeatsActions.sqf index c1318e3f747..af698510648 100644 --- a/addons/quickmount/functions/fnc_addFreeSeatsActions.sqf +++ b/addons/quickmount/functions/fnc_addFreeSeatsActions.sqf @@ -34,14 +34,14 @@ [ARR_5( \ {!isNull objectParent (_this select 0)}, \ { \ - LOG_1("moved in after %1 frames",diag_frameno-GVAR(frame)); \ + LOG_1("moved in after %1 frames",diag_frameNo-GVAR(frame)); \ (_this select 0) enableSimulation true; \ }, \ [ARR_3(_player,_moveBackCode,_moveBackParams)], \ TAKEN_SEAT_TIMEOUT, \ { \ params [ARR_3("_player","_moveBackCode","_moveBackParams")]; \ - WARNING_1("failed move in after %1 frames",diag_frameno-GVAR(frame)); \ + WARNING_1("failed move in after %1 frames",diag_frameNo-GVAR(frame)); \ [ARR_2(_player,_moveBackParams)] call _moveBackCode; \ localize "str_mis_state_failed" call EFUNC(common,displayTextStructured); \ _player enableSimulation true; \ @@ -58,10 +58,11 @@ ) #define MOVE_IN_CODE(command) (_this select 0) command (_this select 1) +//IGNORE_PRIVATE_WARNING ["_player", "_target"]; private _fnc_move = { (_this select 2) params ["_moveInCode", "_moveInParams", "_currentTurret", "_moveBackCode", "_moveBackParams"]; - TRACE_6("fnc_move params",_moveInCode,_moveInParams,_currentTurret,_moveBackCode,_moveBackParams,call {GVAR(frame)=diag_frameno}); + TRACE_6("fnc_move params",_moveInCode,_moveInParams,_currentTurret,_moveBackCode,_moveBackParams,call {GVAR(frame)=diag_frameNo}); // workaround getting damage when moveOut while vehicle is moving // also this helps with arma bug when unit is stuck in wrong anim when move in turret with configured enabledByAnimationSource @@ -83,7 +84,7 @@ private _fnc_move = { {params ["_target", "_player", "_currentTurret"]; IS_MOVED_OUT}, { params ["", "_player", "", "_moveInCode", "_moveInParams", "_moveBackCode", "_moveBackParams"]; - LOG_2("moved out after %1 frames",diag_frameno-GVAR(frame),call {GVAR(frame)=diag_frameno; 0}); + LOG_2("moved out after %1 frames",diag_frameNo-GVAR(frame),call {GVAR(frame)=diag_frameNo; 0}); [_player, _moveInParams] call _moveInCode; WAIT_IN_OR_MOVE_BACK; }, @@ -202,15 +203,15 @@ private _cargoNumber = -1; if (_vehicle lockedTurret _turretPath) then {breakTo "crewLoop"}; if (_role == "gunner" && {unitIsUAV _vehicle}) then {breakTo "crewLoop"}; private _turretConfig = [_vehicleConfig, _turretPath] call CBA_fnc_getTurret; - if (!_isInVehicle) then { - _params = ["GetInTurret", _vehicle, _turretPath]; - _statement = {_player action (_this select 2)}; - } else { + if (_isInVehicle) then { private _gunnerCompartments = (_turretConfig >> "gunnerCompartments") call BIS_fnc_getCfgData; TO_COMPARTMENT_STRING(_gunnerCompartments); if (_compartment != _gunnerCompartments) then {breakTo "crewLoop"}; _params = [{MOVE_IN_CODE(moveInTurret)}, [_vehicle, _turretPath], _currentTurret, _moveBackCode, _moveBackParams]; _statement = _fnc_move; + } else { + _params = ["GetInTurret", _vehicle, _turretPath]; + _statement = {_player action (_this select 2)}; }; _name = getText (_turretConfig >> "gunnerName"); _icon = switch true do { diff --git a/addons/quickmount/functions/fnc_getInNearest.sqf b/addons/quickmount/functions/fnc_getInNearest.sqf index 5e6c21eb366..52bc8cd220f 100644 --- a/addons/quickmount/functions/fnc_getInNearest.sqf +++ b/addons/quickmount/functions/fnc_getInNearest.sqf @@ -1,131 +1,125 @@ #include "..\script_component.hpp" /* * Author: Kingsley - * Mount the player in the vehicle they are directly looking at based on their distance. + * Mounts the player in the vehicle they are directly looking at based on their distance. * * Arguments: - * 0: Target <OBJECT>(Optional) + * 0: Target <OBJECT> (default: objNull) * * Return Value: * None * * Example: - * [] call ace_quickmount_fnc_getInNearest; + * call ace_quickmount_fnc_getInNearest * * Public: No */ -if (!GVAR(enabled) || +if ( + !GVAR(enabled) || {isNull ACE_player} || - {vehicle ACE_player != ACE_player} || - {!alive ACE_player} || - {ACE_player getVariable ["ace_unconscious", false]} + {!isNull objectParent ACE_player} || + {!(ACE_player call EFUNC(common,isAwake))} ) exitWith {}; -params [["_interactionTarget", objNull, [objNull]]]; -TRACE_1("getInNearest",_interactionTarget); +params [["_target", objNull, [objNull]]]; +TRACE_1("getInNearest",_target); -private _start = ACE_player modelToWorldVisualWorld (ACE_player selectionPosition "pilot"); -private _end = (_start vectorAdd (getCameraViewDirection ACE_player vectorMultiply GVAR(distance))); -private _objects = lineIntersectsSurfaces [_start, _end, ACE_player]; -private _target = (_objects param [0, []]) param [2, objNull]; - -if ((isNull _target) && {alive _interactionTarget}) then { - _end = _start vectorAdd ((_start vectorFromTo (aimPos _interactionTarget)) vectorMultiply GVAR(distance)); - _objects = lineIntersectsSurfaces [_start, _end, ACE_player]; - TRACE_1("2nd ray attempt at interaction target aim pos",_objects); +// If target is not defined (e.g. keybind was used), search for valid target +if (isNull _target) then { + private _start = ACE_player modelToWorldVisualWorld (ACE_player selectionPosition "pilot"); + private _end = (_start vectorAdd (getCameraViewDirection ACE_player vectorMultiply GVAR(distance))); + private _objects = lineIntersectsSurfaces [_start, _end, ACE_player]; _target = (_objects param [0, []]) param [2, objNull]; }; -if (locked _target in [2,3] || {!simulationEnabled _target}) exitWith { - [localize LSTRING(VehicleLocked)] call EFUNC(common,displayTextStructured); - true +if (!alive _target) exitWith {}; + +if (locked _target >= 2 || {!simulationEnabled _target}) exitWith { + [LLSTRING(VehicleLocked)] call EFUNC(common,displayTextStructured); }; TRACE_2("",_target,typeOf _target); -if (!isNull _target && - {alive _target} && - {{_target isKindOf _x} count ["Air","LandVehicle","Ship","StaticMortar"] > 0} && - {([ACE_player, _target, ["isNotSwimming"]] call EFUNC(common,canInteractWith))} && - {speed _target <= GVAR(speed)} - ) then { +if ( + (speed _target > GVAR(speed)) || + {["Air", "LandVehicle", "Ship", "StaticMortar"] findIf {_target isKindOf _x} == -1} || + {!([ACE_player, _target, ["isNotSwimming"]] call EFUNC(common,canInteractWith))} +) exitWith {}; +private _seats = ["driver", "gunner", "commander", "cargo"]; +private _sortedSeats = [_seats select GVAR(priority)]; +_seats deleteAt GVAR(priority); +_sortedSeats append _seats; - if (GVAR(priority) > 3 || GVAR(priority) < 0) then { - GVAR(priority) = 0; - }; +private _fullCrew = fullCrew [_target, "", true]; - private _seats = ["Driver", "Gunner", "Commander", "Cargo"]; - private _sortedSeats = [_seats select GVAR(priority)]; - _seats deleteAt GVAR(priority); - _sortedSeats append _seats; +private _hasAction = false; +scopeName "SearchForSeat"; +{ + private _desiredRole = _x; - private _hasAction = false; - scopeName "SearchForSeat"; { - private _desiredRole = _x; - { - _x params ["_unit", "_role", "_cargoIndex", "_turretPath"]; - if ((isNull _unit) || {!alive _unit}) then { - private _effectiveRole = toLowerANSI _role; - - if ((_effectiveRole in ["driver", "gunner"]) && {unitIsUAV _target}) exitWith {}; // Ignoring UAV Driver/Gunner - if ((_effectiveRole == "driver") && {(getNumber (configOf _target >> "hasDriver")) == 0}) exitWith {}; // Ignoring Non Driver (static weapons) - - // Seats can be locked independently of the main vehicle - if ((_role == "driver") && {lockedDriver _target}) exitWith {TRACE_1("lockedDriver",_x);}; - if ((_cargoIndex >= 0) && {_target lockedCargo _cargoIndex}) exitWith {TRACE_1("lockedCargo",_x);}; - if ((_turretPath isNotEqualTo []) && {_target lockedTurret _turretPath}) exitWith {TRACE_1("lockedTurret",_x);}; - - if (_effectiveRole == "turret") then { - private _turretConfig = [_target, _turretPath] call CBA_fnc_getTurret; - if (getNumber (_turretConfig >> "isCopilot") == 1) exitWith { - _effectiveRole = "driver"; - }; - if ( - _cargoIndex >= 0 // FFV - || {"" isEqualTo getText (_turretConfig >> "gun")} // turret without weapon - ) exitWith { - _effectiveRole = "cargo"; - }; - _effectiveRole = "gunner"; // door gunners / 2nd turret + _x params ["_unit", "_role", "_cargoIndex", "_turretPath"]; + + if (!alive _unit) then { + private _effectiveRole = _role; + + if ((_effectiveRole in ["driver", "gunner"]) && {unitIsUAV _target}) exitWith {}; // Ignoring UAV Driver/Gunner + if ((_effectiveRole == "driver") && {(getNumber (configOf _target >> "hasDriver")) == 0}) exitWith {}; // Ignoring Non Driver (static weapons) + + // Seats can be locked independently of the main vehicle + if ((_effectiveRole == "driver") && {lockedDriver _target}) exitWith {TRACE_1("lockedDriver",_x);}; + if ((_cargoIndex >= 0) && {_target lockedCargo _cargoIndex}) exitWith {TRACE_1("lockedCargo",_x);}; + if ((_turretPath isNotEqualTo []) && {_target lockedTurret _turretPath}) exitWith {TRACE_1("lockedTurret",_x);}; + + if (_effectiveRole == "turret") then { + private _turretConfig = [_target, _turretPath] call CBA_fnc_getTurret; + + if (getNumber (_turretConfig >> "isCopilot") == 1) exitWith { + _effectiveRole = "driver"; }; - TRACE_2("",_effectiveRole,_x); - if (_effectiveRole != _desiredRole) exitWith {}; - if (_turretPath isNotEqualTo []) then { - // Using GetInTurret seems to solve problems with incorrect GetInEH params when gunner/commander - ACE_player action ["GetInTurret", _target, _turretPath]; - TRACE_3("Geting In Turret",_x,_role,_turretPath); - } else { - if (_cargoIndex > -1) then { - // GetInCargo expects the index of the seat in the "cargo" array from fullCrew - // See description: https://community.bistudio.com/wiki/fullCrew - private _cargoActionIndex = -1; - { - if ((_x select 2) == _cargoIndex) exitWith {_cargoActionIndex = _forEachIndex}; - } forEach (fullCrew [_target, "cargo", true]); - - ACE_player action ["GetInCargo", _target, _cargoActionIndex]; - TRACE_4("Geting In Cargo",_x,_role,_cargoActionIndex,_cargoIndex); - } else { - ACE_player action ["GetIn" + _role, _target]; - TRACE_2("Geting In",_x,_role); - }; + if ( + _cargoIndex >= 0 || // FFV + {getText (_turretConfig >> "gun") == ""} // Turret without weapon + ) exitWith { + _effectiveRole = "cargo"; }; - _hasAction = true; - breakTo "SearchForSeat"; + _effectiveRole = "gunner"; // Door gunners / 2nd turret }; - } forEach (fullCrew [_target, "", true]); - } forEach _sortedSeats; - if (!_hasAction) then { - TRACE_1("no empty seats",_hasAction); - [localize LSTRING(VehicleFull)] call EFUNC(common,displayTextStructured); - }; -}; + TRACE_2("",_effectiveRole,_x); + + if (_effectiveRole != _desiredRole) exitWith {}; + + if (_turretPath isNotEqualTo []) then { + // Using GetInTurret seems to solve problems with incorrect GetInEH params when gunner/commander + ACE_player action ["GetInTurret", _target, _turretPath]; + TRACE_3("Getting In Turret",_x,_role,_turretPath); + } else { + if (_cargoIndex > -1) then { + // GetInCargo expects the index of the seat in the "cargo" array from fullCrew + // See description: https://community.bistudio.com/wiki/fullCrew + private _cargoActionIndex = (fullCrew [_target, "cargo", true]) findIf {(_x select 2) == _cargoIndex}; -true + ACE_player action ["GetInCargo", _target, _cargoActionIndex]; + TRACE_4("Getting In Cargo",_x,_role,_cargoActionIndex,_cargoIndex); + } else { + ACE_player action ["GetIn" + _role, _target]; + TRACE_2("Getting In",_x,_role); + }; + }; + + _hasAction = true; + breakTo "SearchForSeat"; + }; + } forEach _fullCrew; +} forEach _sortedSeats; + +if (!_hasAction) then { + TRACE_1("no empty seats",_hasAction); + [LLSTRING(VehicleFull)] call EFUNC(common,displayTextStructured); +}; diff --git a/addons/rangecard/RscTitles.hpp b/addons/rangecard/RscTitles.hpp index 720f724be4d..6b8af599752 100644 --- a/addons/rangecard/RscTitles.hpp +++ b/addons/rangecard/RscTitles.hpp @@ -73,8 +73,8 @@ class ACE_RangeCard_Dialog { SizeEX=0.025; idc=-1; style=48; - x="safezoneX"; - y="safezoneY+0.181889"; + x="safeZoneX"; + y="safeZoneY+0.181889"; w="1.62727*3/4"; h="1.62727"; colorBackground[]={1,1,1,1}; @@ -84,67 +84,67 @@ class ACE_RangeCard_Dialog { class CAPTION_TEXT_1: RangeCard_RscText { idc=770000; style=ST_LEFT; - x="safezoneX+0.18"; - y="safezoneY+0.181889+0.0"; + x="safeZoneX+0.18"; + y="safeZoneY+0.181889+0.0"; w="0.56*1.62727*3/4"; text=".408 CheyTac - 410 gr Predator Projectiles"; }; class CAPTION_TEXT_2: CAPTION_TEXT_1 { idc=770001; SizeEx=0.022; - y="safezoneY+0.181889+0.03"; + y="safeZoneY+0.181889+0.03"; text="Drop Tables for B.P.: 1013.25mb; Corrected for MVV at Air/Ammo Temperatures -15-35 °C"; }; class CAPTION_TEXT_3: CAPTION_TEXT_2 { idc=770002; - y="safezoneY+0.181889+0.06"; + y="safeZoneY+0.181889+0.06"; text="CheyTac Intervention - 29'' 1:13'' twist (M-200)"; }; class ZERO_RANGE_TEXT: RangeCard_RscText { idc=77003; style=ST_LEFT; SizeEx=0.028; - x="safezoneX+0.885"; - y="safezoneY+0.181889+0.01"; + x="safeZoneX+0.885"; + y="safeZoneY+0.181889+0.01"; w="0.125*1.62727*3/4"; text="100m ZERO"; }; class BAROMETRIC_PRESSURE_TEXT: ZERO_RANGE_TEXT { idc=77004; colorText[]={1,0,0,0.8}; - y="safezoneY+0.181889+0.05"; + y="safeZoneY+0.181889+0.05"; text="B.P.: 1013.25mb"; }; class TARGET_RANGE_TEXT_1: RangeCard_RscText { idc=770010; colorText[]={1,1,1,1}; - x="safezoneX+0.185"; - y="safezoneY+0.181889+0.098"; + x="safeZoneX+0.185"; + y="safeZoneY+0.181889+0.098"; text="Target"; }; class TARGET_RANGE_TEXT_2: TARGET_RANGE_TEXT_1 { idc=770011; SizeEx=0.03; - y="safezoneY+0.181889+0.125"; + y="safeZoneY+0.181889+0.125"; text="Range"; }; class TARGET_RANGE_TEXT_3: TARGET_RANGE_TEXT_1 { idc=770012; - y="safezoneY+0.181889+0.152"; + y="safeZoneY+0.181889+0.152"; text="(m)"; }; class BULLET_DROP_TEXT_1: RangeCard_RscText { idc=770013; - x="safezoneX+0.25"; - y="safezoneY+0.181889+0.095"; + x="safeZoneX+0.25"; + y="safeZoneY+0.181889+0.095"; w="0.405*1.62727*3/4"; text="Bullet Drop (MRADs)"; }; class WIND_LEAD_CAPTION_LIST: RangeCard_RscListNBox { idc=770100; sizeEx=0.021; - x="safezoneX+0.728"; - y="safezoneY+0.181889+0.091"; + x="safeZoneX+0.728"; + y="safeZoneY+0.181889+0.091"; w="0.25*1.62727*3/4"; h="0.0909445"; columns[]={"0.03/2", "0.985/2"}; @@ -153,8 +153,8 @@ class ACE_RangeCard_Dialog { }; class TEMPERATURE_CAPTION_LIST_1: RangeCard_RscListNBox { idc=770200; - x="safezoneX+0.24"; - y="safezoneY+0.181889+0.125"; + x="safeZoneX+0.24"; + y="safeZoneY+0.181889+0.125"; w="0.405*1.62727*3/4"; h="0.0909445"; columns[]={"0/9", "1/9", "2/9", "3/9", "4/9", "5/9", "5.9/9", "6.9/9", "7.8/9"}; @@ -163,8 +163,8 @@ class ACE_RangeCard_Dialog { }; class TEMPERATURE_CAPTION_LIST_2: RangeCard_RscListNBox { idc=770300; - x="safezoneX+0.728"; - y="safezoneY+0.181889+0.15"; + x="safeZoneX+0.728"; + y="safeZoneY+0.181889+0.15"; w="0.25*1.62727*3/4"; h="0.0909445"; columns[]={"0/6", "0.9/6", "1.8/6", "2.9/6", "3.8/6", "4.8/6"}; @@ -173,8 +173,8 @@ class ACE_RangeCard_Dialog { }; class RANGE_CARD_DATA: RangeCard_RscListNBox { idc=770400; - x="safezoneX+0.182"; - y="safezoneY+0.181889+0.194"; + x="safeZoneX+0.182"; + y="safeZoneY+0.181889+0.194"; w="0.72*1.62727*3/4"; h="1.62727"; columns[]={"0/16", "1.2/16", "2.2/16", "3.2/16", "4.2/16", "5.1/16", "6.1/16", "7.1/16", "8.1/16", @@ -185,13 +185,13 @@ class ACE_RangeCard_Dialog { class FOOTNOTE_TEXT_1: CAPTION_TEXT_1 { idc=770020; SizeEx=0.022; - y="safezoneY+1.72431"; + y="safeZoneY+1.72431"; w="0.705*1.62727*3/4"; text="For best results keep ammunition at ambient air temperature. Tables calculated for the above listed barrel"; }; class FOOTNOTE_TEXT_2: FOOTNOTE_TEXT_1 { idc=770021; - y="safezoneY+1.72431+0.024"; + y="safeZoneY+1.72431+0.024"; text="and load with optic mounted 1.5'' above line of bore."; }; }; diff --git a/addons/rangecard/config.cpp b/addons/rangecard/config.cpp index f300fb1a308..56ebec629da 100644 --- a/addons/rangecard/config.cpp +++ b/addons/rangecard/config.cpp @@ -6,7 +6,7 @@ class CfgPatches { units[] = {"ACE_Item_RangeCard"}; weapons[] = {"ACE_RangeCard"}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"ACE_Advanced_Ballistics","ace_scopes"}; + requiredAddons[] = {"ace_advanced_ballistics", "ace_scopes"}; author = ECSTRING(common,ACETeam); authors[] = {"Ruthberg"}; url = ECSTRING(main,URL); diff --git a/addons/rangecard/functions/fnc_calculateRangeCard.sqf b/addons/rangecard/functions/fnc_calculateRangeCard.sqf index d2347b84944..c16b202539e 100644 --- a/addons/rangecard/functions/fnc_calculateRangeCard.sqf +++ b/addons/rangecard/functions/fnc_calculateRangeCard.sqf @@ -65,7 +65,7 @@ private _n = 0; private _range = 0; if (_useABConfig) then { - _bc = parseNumber(("ace_advanced_ballistics" callExtension format["atmosphericCorrection:%1:%2:%3:%4:%5", _bc, _temperature, _barometricPressure, _relativeHumidity, _atmosphereModel])); + _bc = parseNumber (("ace" callExtension ["ballistics:atmospheric_correction", [_bc, _temperature, _barometricPressure, _relativeHumidity, _atmosphereModel]]) select 0); }; private _airFrictionCoef = 1; @@ -83,8 +83,8 @@ _bulletPos set [1, 0]; _bulletPos set [2, -(_boreHeight / 100)]; _bulletVelocity set [0, 0]; -_bulletVelocity set [1, Cos(_scopeBaseAngle) * _muzzleVelocity]; -_bulletVelocity set [2, Sin(_scopeBaseAngle) * _muzzleVelocity]; +_bulletVelocity set [1, cos(_scopeBaseAngle) * _muzzleVelocity]; +_bulletVelocity set [2, sin(_scopeBaseAngle) * _muzzleVelocity]; while {_TOF < 6 && (_bulletPos select 1) < _targetRange} do { _bulletSpeed = vectorMagnitude _bulletVelocity; @@ -99,7 +99,7 @@ while {_TOF < 6 && (_bulletPos select 1) < _targetRange} do { _trueSpeed = vectorMagnitude _trueVelocity; if (_useABConfig) then { - private _drag = parseNumber(("ace_advanced_ballistics" callExtension format["retard:%1:%2:%3:%4", _dragModel, _bc, _trueSpeed, _temperature])); + private _drag = parseNumber (("ace" callExtension ["ballistics:retard", [_dragModel, _bc, _trueSpeed, _temperature]]) select 0); _bulletAccel = (vectorNormalized _trueVelocity) vectorMultiply (-1 * _drag); } else { _bulletAccel = _trueVelocity vectorMultiply (_trueSpeed * _airFriction * _airFrictionCoef); @@ -123,21 +123,21 @@ while {_TOF < 6 && (_bulletPos select 1) < _targetRange} do { _tz = (_lastBulletPos select 2) + (_range - (_lastBulletPos select 1)) * ((_bulletPos select 2) - (_lastBulletPos select 2)) / ((_bulletPos select 1) - (_lastBulletPos select 1)); _elevation = - atan(_tz / _range); _windage = - atan(_tx / _range); - _lead = (_targetSpeed * _TOF) / (Tan(MRAD_TO_DEG(1)) * _range); + _lead = (_targetSpeed * _TOF) / (tan(MRAD_TO_DEG(1)) * _range); }; - private _elevationString = Str(round(-DEG_TO_MRAD(_elevation) * 10) / 10); + private _elevationString = str(round(-DEG_TO_MRAD(_elevation) * 10) / 10); if (_elevationString == "0") then { _elevationString = "-0.0"; }; if (_elevationString find "." == -1) then { _elevationString = _elevationString + ".0"; }; - private _windageString = Str(round(DEG_TO_MRAD(_windage) * 10) / 10); + private _windageString = str(round(DEG_TO_MRAD(_windage) * 10) / 10); if (_windageString find "." == -1) then { _windageString = _windageString + ".0"; }; - private _leadString = Str(round(_lead * 10) / 10); + private _leadString = str(round(_lead * 10) / 10); if (_leadString find "." == -1) then { _leadString = _leadString + ".0"; }; diff --git a/addons/rangecard/functions/fnc_updateRangeCard.sqf b/addons/rangecard/functions/fnc_updateRangeCard.sqf index c2c86738444..76b679accf5 100644 --- a/addons/rangecard/functions/fnc_updateRangeCard.sqf +++ b/addons/rangecard/functions/fnc_updateRangeCard.sqf @@ -42,7 +42,7 @@ for "_row" from 0 to 49 do { _control ctrlSetTextColor [0, 0, 0, 1]; }; _control ctrlCommit 0; - _control ctrlSetText Str(100 + _row * 50); + _control ctrlSetText str(100 + _row * 50); GVAR(controls) pushBack _control; }; for "_column" from 0 to 8 do { @@ -161,11 +161,9 @@ if (_isABenabled) then { private _cacheEntry = missionNamespace getVariable format [QGVAR(%1_%2_%3_%4_%5_%6_%7), _zeroRange, _boreHeight, _ammoClass, _weaponClass, _isABenabled, _useBarrelLengthInfluence, _useAmmoTemperatureInfluence]; if (isNil "_cacheEntry") then { private _scopeBaseAngle = if (!_isABenabled) then { - private _zeroAngle = "ace_advanced_ballistics" callExtension format ["calcZero:%1:%2:%3:%4", _zeroRange, _muzzleVelocity, _airFriction, _boreHeight]; - (parseNumber _zeroAngle) + parseNumber (("ace" callExtension ["ballistics:zero_vanilla", [_zeroRange, _muzzleVelocity, _airFriction, _boreHeight]]) select 0) } else { - private _zeroAngle = "ace_advanced_ballistics" callExtension format ["calcZeroAB:%1:%2:%3:%4:%5:%6:%7:%8:%9", _zeroRange, _muzzleVelocity, _boreHeight, EGVAR(scopes,zeroReferenceTemperature), EGVAR(scopes,zeroReferenceBarometricPressure), EGVAR(scopes,zeroReferenceHumidity), _bc, _dragModel, _atmosphereModel]; - (parseNumber _zeroAngle) + parseNumber (("ace" callExtension ["ballistics:zero_advanced", [_zeroRange, _muzzleVelocity, _boreHeight, EGVAR(scopes,zeroReferenceTemperature), EGVAR(scopes,zeroReferenceBarometricPressure), EGVAR(scopes,zeroReferenceHumidity), _bc, _dragModel, _atmosphereModel]]) select 0) }; if (_useAmmoTemperatureInfluence) then { { diff --git a/addons/realisticnames/CfgMagazines.hpp b/addons/realisticnames/CfgMagazines.hpp index be7ce2b2a51..dc5beec603c 100644 --- a/addons/realisticnames/CfgMagazines.hpp +++ b/addons/realisticnames/CfgMagazines.hpp @@ -390,12 +390,6 @@ class CfgMagazines { class DemoCharge_Remote_Mag: SatchelCharge_Remote_Mag { displayName = CSTRING(DemoCharge_Name); }; - class ACE_SatchelCharge_Remote_Mag_Throwable: CA_Magazine { - displayName = CSTRING(SatchelChargeThrowable_Name); - }; - class ACE_DemoCharge_Remote_Mag_Throwable: ACE_SatchelCharge_Remote_Mag_Throwable { - displayName = CSTRING(DemoChargeThrowable_Name); - }; // hand grenades class HandGrenade: CA_Magazine { diff --git a/addons/realisticnames/CfgVehicles.hpp b/addons/realisticnames/CfgVehicles.hpp index 29ac412957f..ba95cf147d5 100644 --- a/addons/realisticnames/CfgVehicles.hpp +++ b/addons/realisticnames/CfgVehicles.hpp @@ -1,6 +1,5 @@ - class CfgVehicles { - // static weapons + // Static weapons class StaticMGWeapon; class HMG_01_base_F: StaticMGWeapon { displayName = CSTRING(HMG_01_Name); @@ -61,7 +60,7 @@ class CfgVehicles { displayName = CSTRING(MRAP_01_hmg_Name); }; - // punisher + // Punisher class MRAP_02_base_F; class O_MRAP_02_F: MRAP_02_base_F { displayName = CSTRING(MRAP_02_Name); @@ -86,7 +85,7 @@ class CfgVehicles { displayName = CSTRING(MRAP_02_gmg_Name); }; - // strider + // Strider class MRAP_03_base_F; class I_MRAP_03_F: MRAP_03_base_F { displayName = CSTRING(MRAP_03_Name); @@ -102,7 +101,7 @@ class CfgVehicles { displayName = CSTRING(MRAP_03_gmg_Name); }; - // merkava derivates + // Merkava derivates class MBT_01_base_F; class B_MBT_01_base_F: MBT_01_base_F {}; @@ -124,7 +123,7 @@ class CfgVehicles { class B_MBT_01_mlrs_base_F: MBT_01_mlrs_base_F {}; class B_MBT_01_mlrs_F: B_MBT_01_mlrs_base_F { - displayName = CSTRING(MBT_01_mlrs_Name); // Fictional name, (probably wrong) hebrew translation of storm. + displayName = CSTRING(MBT_01_mlrs_Name); // Fictional name, (probably wrong) hebrew translation of storm }; // T100 derivates @@ -142,20 +141,20 @@ class CfgVehicles { displayName = CSTRING(MBT_02_arty_Name); }; - // leopard sg + // Leopard 2 SG class I_MBT_03_base_F; class I_MBT_03_cannon_F: I_MBT_03_base_F { displayName = CSTRING(MBT_03_cannon_Name); }; - // tracked apcs + // Tracked apcs class B_APC_Tracked_01_base_F; class B_APC_Tracked_01_rcws_F: B_APC_Tracked_01_base_F { displayName = CSTRING(APC_Tracked_01_rcws_Name); }; class B_APC_Tracked_01_AA_F: B_APC_Tracked_01_base_F { - displayName = CSTRING(APC_Tracked_01_AA_Name); // Fictional name, (probably wrong) hebrew translation of cheetah. + displayName = CSTRING(APC_Tracked_01_AA_Name); // Fictional name, (probably wrong) hebrew translation of cheetah }; class B_APC_Tracked_01_CRV_F: B_APC_Tracked_01_base_F { @@ -176,7 +175,7 @@ class CfgVehicles { displayName = CSTRING(APC_tracked_03_cannon_Name); }; - // wheeled apcs + // Wheeled apcs class B_APC_Wheeled_01_base_F; class B_APC_Wheeled_01_cannon_F: B_APC_Wheeled_01_base_F { displayName = CSTRING(APC_Wheeled_01_cannon_Name); @@ -199,7 +198,7 @@ class CfgVehicles { displayName = CSTRING(APC_Wheeled_03_cannon_Name); }; - // trucks + // Trucks class Truck_01_base_F; class B_Truck_01_transport_F: Truck_01_base_F { displayName = CSTRING(Truck_01_transport_Name); @@ -317,7 +316,7 @@ class CfgVehicles { displayName = CSTRING(Truck_03_medical_Name); }; - // helicopters + // Helicopters class Heli_Attack_01_base_F; class B_Heli_Attack_01_F: Heli_Attack_01_base_F { displayName = CSTRING(Heli_Attack_01_Name); @@ -398,7 +397,7 @@ class CfgVehicles { displayName = CSTRING(Heli_Transport_02_Name); }; - // planes + // Planes class Plane_CAS_01_base_F; class B_Plane_CAS_01_F: Plane_CAS_01_base_F { displayName = CSTRING(Plane_CAS_01_Name); @@ -438,7 +437,7 @@ class CfgVehicles { displayName = CSTRING(Plane_Fighter_04_Name); }; - // uavs + // UAVs class UAV_02_base_F; class B_UAV_02_F: UAV_02_base_F { displayName = CSTRING(UAV_02_Name); @@ -472,104 +471,93 @@ class CfgVehicles { displayName = CSTRING(UAV_02_Name); }; - // pistols - class Pistol_Base_F; - class Weapon_hgun_P07_F: Pistol_Base_F { - displayName = CSTRING(hgun_P07_Name); - }; - - class Weapon_hgun_Rook40_F: Pistol_Base_F { - displayName = CSTRING(hgun_Rook40_Name); - }; - - class Weapon_hgun_ACPC2_F: Pistol_Base_F { - displayName = CSTRING(hgun_ACPC2_Name); - }; - - class Weapon_hgun_Pistol_heavy_01_F: Pistol_Base_F { - displayName = CSTRING(hgun_Pistol_heavy_01_Name); - }; - - class Weapon_hgun_Pistol_heavy_02_F: Pistol_Base_F { - displayName = CSTRING(hgun_Pistol_heavy_02_Name); - }; - - class Weapon_hgun_Pistol_Signal_F: Pistol_Base_F { - displayName = CSTRING(hgun_Pistol_Signal_Name); - }; - - // rocket launchers - class Launcher_Base_F; - class Weapon_launch_NLAW_F: Launcher_Base_F { - displayName = CSTRING(launch_NLAW_Name); - }; - - class Weapon_launch_RPG32_F: Launcher_Base_F { - displayName = CSTRING(launch_RPG32_Name); - }; - - /*class Weapon_launch_Titan_F: Launcher_Base_F { - displayName = CSTRING(launch_Titan_Name); - }; - - class Weapon_launch_Titan_short_F: Launcher_Base_F { - displayName = CSTRING(launch_Titan_short_Name); - }; - - class Weapon_launch_B_Titan_F: Launcher_Base_F { - displayName = CSTRING(launch_Titan_Name); - };*/ - //class Weapon_launch_I_Titan_F: Weapon_launch_B_Titan_F {}; - //class Weapon_launch_O_Titan_F: Weapon_launch_B_Titan_F {}; - - /*class Weapon_launch_launch_B_Titan_short_F: Launcher_Base_F { - displayName = CSTRING(launch_Titan_short_Name); - };*/ - //class Weapon_launch_I_Titan_short_F: Weapon_launch_launch_B_Titan_short_F {}; - //class Weapon_launch_O_Titan_short_F: Weapon_launch_launch_B_Titan_short_F {}; + #include "CfgVehiclesAttachments.hpp" - // rifles + // Assault rifles // MX class Weapon_Base_F; class Weapon_arifle_MX_F: Weapon_Base_F { displayName = CSTRING(arifle_MX_Name); }; + class Weapon_arifle_MX_Black_F: Weapon_Base_F { + displayName = CSTRING(arifle_MX_Black_Name); + }; + class Weapon_arifle_MX_khk_F: Weapon_Base_F { + displayName = CSTRING(arifle_MX_Khaki_Name); + }; class Weapon_arifle_MXC_F: Weapon_Base_F { displayName = CSTRING(arifle_MXC_Name); }; + class Weapon_arifle_MXC_Black_F: Weapon_Base_F { + displayName = CSTRING(arifle_MXC_Black_Name); + }; + class Weapon_arifle_MXC_khk_F: Weapon_Base_F { + displayName = CSTRING(arifle_MXC_Khaki_Name); + }; class Weapon_arifle_MX_GL_F: Weapon_Base_F { displayName = CSTRING(arifle_MX_GL_Name); }; + class Weapon_arifle_MX_GL_Black_F: Weapon_Base_F { + displayName = CSTRING(arifle_MX_GL_Black_Name); + }; + class Weapon_arifle_MX_GL_khk_F: Weapon_Base_F { + displayName = CSTRING(arifle_MX_GL_Khaki_Name); + }; class Weapon_arifle_MX_SW_F: Weapon_Base_F { displayName = CSTRING(arifle_MX_SW_Name); }; + class Weapon_arifle_MX_SW_Black_F: Weapon_Base_F { + displayName = CSTRING(arifle_MX_SW_Black_Name); + }; + class Weapon_arifle_MX_SW_khk_F: Weapon_Base_F { + displayName = CSTRING(arifle_MX_SW_Khaki_Name); + }; class Weapon_arifle_MXM_F: Weapon_Base_F { displayName = CSTRING(arifle_MXM_Name); }; + class Weapon_arifle_MXM_Black_F: Weapon_Base_F { + displayName = CSTRING(arifle_MXM_Black_Name); + }; + class Weapon_arifle_MXM_khk_F: Weapon_Base_F { + displayName = CSTRING(arifle_MXM_Khaki_Name); + }; // Katiba class Weapon_arifle_Katiba_F: Weapon_Base_F { displayName = CSTRING(arifle_Katiba_Name); }; - class Weapon_arifle_Katiba_C_F: Weapon_Base_F { displayName = CSTRING(arifle_Katiba_C_Name); }; - class Weapon_arifle_Katiba_GL_F: Weapon_Base_F { displayName = CSTRING(arifle_Katiba_GL_Name); }; + // SDAR + class Weapon_arifle_SDAR_F: Weapon_Base_F { + displayName = CSTRING(arifle_SDAR_Name); + }; + + // TAR-21 + class Weapon_arifle_TRG21_F: Weapon_Base_F { + displayName = CSTRING(arifle_TRG21_Name); + }; + class Weapon_arifle_TRG20_F: Weapon_Base_F { + displayName = CSTRING(arifle_TRG20_Name); + }; + class Weapon_arifle_TRG21_GL_F: Weapon_Base_F { + displayName = CSTRING(arifle_TRG21_GL_Name); + }; + // F2000 class Weapon_arifle_Mk20_F: Weapon_Base_F { displayName = CSTRING(arifle_Mk20_Name); }; - class Weapon_arifle_Mk20_plain_F: Weapon_Base_F { displayName = CSTRING(arifle_Mk20_plain_Name); }; @@ -577,7 +565,6 @@ class CfgVehicles { class Weapon_arifle_Mk20C_F: Weapon_Base_F { displayName = CSTRING(arifle_Mk20C_Name); }; - class Weapon_arifle_Mk20C_plain_F: Weapon_Base_F { displayName = CSTRING(arifle_Mk20C_plain_Name); }; @@ -585,46 +572,102 @@ class CfgVehicles { class Weapon_arifle_Mk20_GL_F: Weapon_Base_F { displayName = CSTRING(arifle_Mk20_GL_Name); }; - class Weapon_arifle_Mk20_GL_plain_F: Weapon_Base_F { displayName = CSTRING(arifle_Mk20_GL_plain_Name); }; - // TAR-21 - class Weapon_arifle_TRG21_F: Weapon_Base_F { - displayName = CSTRING(arifle_TRG21_Name); + // P90 (1.86) + class Weapon_SMG_03_TR_black: Weapon_Base_F { + displayName = CSTRING(PS90_TR_Black_Name); }; - - class Weapon_arifle_TRG20_F: Weapon_Base_F { - displayName = CSTRING(arifle_TRG20_Name); + class Weapon_SMG_03_TR_khaki: Weapon_Base_F { + displayName = CSTRING(PS90_TR_Khaki_Name); }; - - class Weapon_arifle_TRG21_GL_F: Weapon_Base_F { - displayName = CSTRING(arifle_TRG21_GL_Name); + class Weapon_SMG_03_TR_camo: Weapon_Base_F { + displayName = CSTRING(PS90_TR_Camo_Name); + }; + class Weapon_SMG_03_TR_hex: Weapon_Base_F { + displayName = CSTRING(PS90_TR_Hex_Name); + }; + class Weapon_SMG_03_black: Weapon_Base_F { + displayName = CSTRING(PS90_Black_Name); + }; + class Weapon_SMG_03_khaki: Weapon_Base_F { + displayName = CSTRING(PS90_Khaki_Name); + }; + class Weapon_SMG_03_camo: Weapon_Base_F { + displayName = CSTRING(PS90_Camo_Name); + }; + class Weapon_SMG_03_hex: Weapon_Base_F { + displayName = CSTRING(PS90_Hex_Name); + }; + class Weapon_SMG_03C_TR_black: Weapon_Base_F { + displayName = CSTRING(P90_TR_Black_Name); + }; + class Weapon_SMG_03C_TR_khaki: Weapon_Base_F { + displayName = CSTRING(P90_TR_Khaki_Name); + }; + class Weapon_SMG_03C_TR_camo: Weapon_Base_F { + displayName = CSTRING(P90_TR_Camo_Name); + }; + class Weapon_SMG_03C_TR_hex: Weapon_Base_F { + displayName = CSTRING(P90_TR_Hex_Name); + }; + class Weapon_SMG_03C_black: Weapon_Base_F { + displayName = CSTRING(P90_Black_Name); + }; + class Weapon_SMG_03C_khaki: Weapon_Base_F { + displayName = CSTRING(P90_Khaki_Name); + }; + class Weapon_SMG_03C_camo: Weapon_Base_F { + displayName = CSTRING(P90_Camo_Name); + }; + class Weapon_SMG_03C_hex: Weapon_Base_F { + displayName = CSTRING(P90_Hex_Name); }; - // sub machine guns + // Vector class Weapon_SMG_01_F: Weapon_Base_F { displayName = CSTRING(SMG_01_Name); }; + // Scorpion class Weapon_SMG_02_F: Weapon_Base_F { displayName = CSTRING(SMG_02_Name); }; - class Weapon_SMG_05_F: Weapon_Base_F { - displayName = CSTRING(SMG_05); - }; - + // CPW class Weapon_hgun_PDW2000_F: Weapon_Base_F { displayName = CSTRING(hgun_PDW2000_Name); }; - class Weapon_arifle_SDAR_F: Weapon_Base_F { - displayName = CSTRING(arifle_SDAR_Name); + // Pistols + class Pistol_Base_F; + class Weapon_hgun_P07_F: Pistol_Base_F { + displayName = CSTRING(hgun_P07_Name); + }; + + class Weapon_hgun_Rook40_F: Pistol_Base_F { + displayName = CSTRING(hgun_Rook40_Name); + }; + + class Weapon_hgun_ACPC2_F: Pistol_Base_F { + displayName = CSTRING(hgun_ACPC2_Name); + }; + + class Weapon_hgun_Pistol_heavy_01_F: Pistol_Base_F { + displayName = CSTRING(hgun_Pistol_heavy_01_Name); + }; + + class Weapon_hgun_Pistol_heavy_02_F: Pistol_Base_F { + displayName = CSTRING(hgun_Pistol_heavy_02_Name); + }; + + class Weapon_hgun_Pistol_Signal_F: Pistol_Base_F { + displayName = CSTRING(hgun_Pistol_Signal_Name); }; - // machine guns + // Machine guns class Weapon_LMG_Mk200_F: Weapon_Base_F { displayName = CSTRING(LMG_Mk200_Name); }; @@ -633,40 +676,73 @@ class CfgVehicles { displayName = CSTRING(LMG_Zafir_Name); }; - // sniper rifles + // Sniper rifles class Weapon_srifle_EBR_F: Weapon_Base_F { displayName = CSTRING(srifle_EBR_Name); }; + class Weapon_srifle_LRR_F: Weapon_Base_F { + displayName = CSTRING(srifle_LRR_Name); + }; + class Weapon_srifle_LRR_camo_F: Weapon_Base_F { + displayName = CSTRING(srifle_LRR_camo_Name); + }; + class Weapon_srifle_GM6_F: Weapon_Base_F { displayName = CSTRING(srifle_GM6_Name); }; - class Weapon_srifle_GM6_camo_F: Weapon_Base_F { displayName = CSTRING(srifle_GM6_camo_Name); }; - class Weapon_srifle_LRR_F: Weapon_Base_F { - displayName = CSTRING(srifle_LRR_Name); + class Weapon_srifle_DMR_01_F: Weapon_Base_F { + displayName = CSTRING(srifle_DMR_01_Name); }; - class Weapon_srifle_LRR_camo_F: Weapon_Base_F { - displayName = CSTRING(srifle_LRR_camo_Name); + // Rocket launchers + class Launcher_Base_F; + class Weapon_launch_RPG32_F: Launcher_Base_F { + displayName = CSTRING(launch_RPG32_Name); }; - class Weapon_srifle_DMR_01_F: Weapon_Base_F { - displayName = CSTRING(srifle_DMR_01_Name); + class Weapon_launch_NLAW_F: Launcher_Base_F { + displayName = CSTRING(launch_NLAW_Name); }; - // marksmen - /*class Weapon_srifle_DMR_02_F: Weapon_Base_F { - displayName = CSTRING(srifle_DMR_02); + /*class Weapon_launch_Titan_F: Launcher_Base_F { + displayName = CSTRING(launch_Titan_Name); + }; + + class Weapon_launch_Titan_short_F: Launcher_Base_F { + displayName = CSTRING(launch_Titan_short_Name); + }; + + class Weapon_launch_B_Titan_F: Launcher_Base_F { + displayName = CSTRING(launch_Titan_Name); + };*/ + //class Weapon_launch_I_Titan_F: Weapon_launch_B_Titan_F {}; + //class Weapon_launch_O_Titan_F: Weapon_launch_B_Titan_F {}; + + /*class Weapon_launch_launch_B_Titan_short_F: Launcher_Base_F { + displayName = CSTRING(launch_Titan_short_Name); + };*/ + //class Weapon_launch_I_Titan_short_F: Weapon_launch_launch_B_Titan_short_F {}; + //class Weapon_launch_O_Titan_short_F: Weapon_launch_launch_B_Titan_short_F {}; + + class Weapon_launch_O_Vorona_brown_F: Launcher_Base_F { + displayName = CSTRING(launch_Vorona_brown); + }; + class Weapon_launch_O_Vorona_green_F: Launcher_Base_F { + displayName = CSTRING(launch_Vorona_green); }; + // Marksmen marksman + class Weapon_srifle_DMR_02_F: Weapon_Base_F { + displayName = CSTRING(srifle_DMR_02); + }; class Weapon_srifle_DMR_02_camo_F: Weapon_Base_F { displayName = CSTRING(srifle_DMR_02_camo); }; - class Weapon_srifle_DMR_02_sniper_F: Weapon_Base_F { displayName = CSTRING(srifle_DMR_02_sniper); }; @@ -674,19 +750,15 @@ class CfgVehicles { class Weapon_srifle_DMR_03_F: Weapon_Base_F { displayName = CSTRING(srifle_DMR_03); }; - class Weapon_srifle_DMR_03_khaki_F: Weapon_Base_F { displayName = CSTRING(srifle_DMR_03_khaki); }; - class Weapon_srifle_DMR_03_tan_F: Weapon_Base_F { displayName = CSTRING(srifle_DMR_03_tan); }; - class Weapon_srifle_DMR_03_multicam_F: Weapon_Base_F { displayName = CSTRING(srifle_DMR_03_multicam); }; - class Weapon_srifle_DMR_03_woodland_F: Weapon_Base_F { displayName = CSTRING(srifle_DMR_03_woodland); }; @@ -694,7 +766,6 @@ class CfgVehicles { class Weapon_srifle_DMR_04_F: Weapon_Base_F { displayName = CSTRING(srifle_DMR_04); }; - class Weapon_srifle_DMR_04_Tan_F: Weapon_Base_F { displayName = CSTRING(srifle_DMR_04_Tan); }; @@ -702,11 +773,9 @@ class CfgVehicles { class Weapon_srifle_DMR_05_blk_F: Weapon_Base_F { displayName = CSTRING(srifle_DMR_05_blk); }; - class Weapon_srifle_DMR_05_hex_F: Weapon_Base_F { displayName = CSTRING(srifle_DMR_05_hex); }; - class Weapon_srifle_DMR_05_tan_f: Weapon_Base_F { displayName = CSTRING(srifle_DMR_05_tan); }; @@ -714,11 +783,11 @@ class CfgVehicles { class Weapon_srifle_DMR_06_camo_F: Weapon_Base_F { displayName = CSTRING(srifle_DMR_06_camo); }; - class Weapon_srifle_DMR_06_olive_F: Weapon_Base_F { displayName = CSTRING(srifle_DMR_06_olive); }; + // Marksmen MGs class Weapon_MMG_01_hex_F: Weapon_Base_F { displayName = CSTRING(MMG_01_hex); }; @@ -737,14 +806,58 @@ class CfgVehicles { class Weapon_MMG_02_sand_F: Weapon_Base_F { displayName = CSTRING(MMG_02_sand); - };*/ + }; - //attachments + // Tanks DLC - class Item_Base_F; + // Rooikat 120 (Rhino MGS) + class AFV_Wheeled_01_base_F; + class B_AFV_Wheeled_01_cannon_F: AFV_Wheeled_01_base_F { + displayName = CSTRING(afv_wheeled_01); + }; + class B_T_AFV_Wheeled_01_cannon_F: AFV_Wheeled_01_base_F { + displayName = CSTRING(afv_wheeled_01); + }; + class AFV_Wheeled_01_up_base_F; + class B_AFV_Wheeled_01_up_cannon_F: AFV_Wheeled_01_up_base_F { + displayName = CSTRING(afv_wheeled_01_up); + }; + class B_T_AFV_Wheeled_01_up_cannon_F: AFV_Wheeled_01_up_base_F { + displayName = CSTRING(afv_wheeled_01_up); + }; + + // T-14 Armata (T-140 Angara) + class MBT_04_cannon_base_F; + class O_MBT_04_cannon_F: MBT_04_cannon_base_F { + displayName = CSTRING(MBT_04_cannon); + }; + class O_T_MBT_04_cannon_F: MBT_04_cannon_base_F { + displayName = CSTRING(MBT_04_cannon); + }; + class MBT_04_command_base_F; // Keep "K" designation for command variant. + class O_MBT_04_command_F: MBT_04_command_base_F { + displayName = CSTRING(MBT_04_command); + }; + class O_T_MBT_04_command_F: MBT_04_command_base_F { + displayName = CSTRING(MBT_04_command); + }; - class Item_acc_flashlight: Item_Base_F { - displayName="UTG Defender 126"; + // Wiesel 2 (AWC 302 Nyx) + class LT_01_AA_base_F; + class I_LT_01_AA_F: LT_01_AA_base_F { + displayName = CSTRING(LT_01_AA); + }; + class LT_01_AT_base_F; + class I_LT_01_AT_F: LT_01_AT_base_F { + displayName = CSTRING(LT_01_AT); + }; + class LT_01_cannon_base_F; + class I_LT_01_cannon_F: LT_01_cannon_base_F { + displayName = CSTRING(LT_01_cannon); + }; + class LT_01_scout_base_F; + class I_LT_01_scout_F: LT_01_scout_base_F { + displayName = CSTRING(LT_01_scout); }; // APEX/Tanoa @@ -815,54 +928,266 @@ class CfgVehicles { displayName = CSTRING(lsv_02_at); }; - // Rooikat 120 (Rhino MGS) - class AFV_Wheeled_01_base_F; - class B_AFV_Wheeled_01_cannon_F: AFV_Wheeled_01_base_F { - displayName = CSTRING(afv_wheeled_01); + // Type 115 + class Weapon_arifle_ARX_blk_F: Weapon_Base_F { + displayName = CSTRING(arifle_arx_blk_Name); }; - class B_T_AFV_Wheeled_01_cannon_F: AFV_Wheeled_01_base_F { - displayName = CSTRING(afv_wheeled_01); + class Weapon_arifle_ARX_ghex_F: Weapon_Base_F { + displayName = CSTRING(arifle_arx_ghex_Name); }; - class AFV_Wheeled_01_up_base_F; - class B_AFV_Wheeled_01_up_cannon_F: AFV_Wheeled_01_up_base_F { - displayName = CSTRING(afv_wheeled_01_up); + class Weapon_arifle_ARX_hex_F: Weapon_Base_F { + displayName = CSTRING(arifle_arx_hex_Name); }; - class B_T_AFV_Wheeled_01_up_cannon_F: AFV_Wheeled_01_up_base_F { - displayName = CSTRING(afv_wheeled_01_up); + + // QBZ-95 and variants + class Weapon_arifle_CTAR_blk_F: Weapon_Base_F { + displayName = CSTRING(arifle_CTAR_blk); + }; + class Weapon_arifle_CTAR_ghex_F: Weapon_Base_F { + displayName = CSTRING(arifle_CTAR_ghex); + }; + class Weapon_arifle_CTAR_hex_F: Weapon_Base_F { + displayName = CSTRING(arifle_CTAR_hex); }; - // T-14 Armata (T-140 Angara) - class MBT_04_cannon_base_F; - class O_MBT_04_cannon_F: MBT_04_cannon_base_F { - displayName = CSTRING(MBT_04_cannon); + class Weapon_arifle_CTAR_GL_blk_F: Weapon_Base_F { + displayName = CSTRING(arifle_CTAR_GL_blk); }; - class O_T_MBT_04_cannon_F: MBT_04_cannon_base_F { - displayName = CSTRING(MBT_04_cannon); + class Weapon_arifle_CTAR_GL_ghex_F: Weapon_Base_F { + displayName = CSTRING(arifle_CTAR_GL_ghex); }; - class MBT_04_command_base_F; // Keep "K" designation for command variant. - class O_MBT_04_command_F: MBT_04_command_base_F { - displayName = CSTRING(MBT_04_command); + class Weapon_arifle_CTAR_GL_hex_F: Weapon_Base_F { + displayName = CSTRING(arifle_CTAR_GL_hex); }; - class O_T_MBT_04_command_F: MBT_04_command_base_F { - displayName = CSTRING(MBT_04_command); + + class Weapon_arifle_CTARS_blk_F: Weapon_Base_F { + displayName = CSTRING(arifle_CTARS_blk); + }; + class Weapon_arifle_CTARS_ghex_F: Weapon_Base_F { + displayName = CSTRING(arifle_CTARS_ghex); + }; + class Weapon_arifle_CTARS_hex_F: Weapon_Base_F { + displayName = CSTRING(arifle_CTARS_hex); }; - // Wiesel 2 (AWC 302 Nyx) - class LT_01_AA_base_F; - class I_LT_01_AA_F: LT_01_AA_base_F { - displayName = CSTRING(LT_01_AA); + // QBU-88 + class Weapon_srifle_DMR_07_blk_F: Weapon_Base_F { + displayName = CSTRING(srifle_DMR_07_blk); }; - class LT_01_AT_base_F; - class I_LT_01_AT_F: LT_01_AT_base_F { - displayName = CSTRING(LT_01_AT); + class Weapon_srifle_DMR_07_ghex_F: Weapon_Base_F { + displayName = CSTRING(srifle_DMR_07_ghex); }; - class LT_01_cannon_base_F; - class I_LT_01_cannon_F: LT_01_cannon_base_F { - displayName = CSTRING(LT_01_cannon); + class Weapon_srifle_DMR_07_hex_F: Weapon_Base_F { + displayName = CSTRING(srifle_DMR_07_hex); }; - class LT_01_scout_base_F; - class I_LT_01_scout_F: LT_01_scout_base_F { - displayName = CSTRING(LT_01_scout); + + // GM6 + class Weapon_srifle_GM6_ghex_F: Weapon_Base_F { + displayName = CSTRING(srifle_GM6_ghex); + }; + + // M249 + class Weapon_LMG_03_F: Weapon_Base_F { + displayName = CSTRING(LMG_03); + }; + + // Intervention + class Weapon_srifle_LRR_tna_F: Weapon_Base_F { + displayName = CSTRING(srifle_LRR_tna); + }; + + // MP5 + class Weapon_SMG_05_F: Weapon_Base_F { + displayName = CSTRING(SMG_05); + }; + + // HK416 and variants + class Weapon_arifle_SPAR_01_blk_F: Weapon_Base_F { + displayName = CSTRING(arifle_SPAR_01_blk); + }; + class Weapon_arifle_SPAR_01_khk_F: Weapon_Base_F { + displayName = CSTRING(arifle_SPAR_01_khk); + }; + class Weapon_arifle_SPAR_01_snd_F: Weapon_Base_F { + displayName = CSTRING(arifle_SPAR_01_snd); + }; + + class Weapon_arifle_SPAR_01_GL_blk_F: Weapon_Base_F { + displayName = CSTRING(arifle_SPAR_01_GL_blk); + }; + class Weapon_arifle_SPAR_01_GL_khk_F: Weapon_Base_F { + displayName = CSTRING(arifle_SPAR_01_GL_khk); + }; + class Weapon_arifle_SPAR_01_GL_snd_F: Weapon_Base_F { + displayName = CSTRING(arifle_SPAR_01_GL_snd); + }; + + class Weapon_arifle_SPAR_02_blk_F: Weapon_Base_F { + displayName = CSTRING(arifle_SPAR_02_blk); + }; + class Weapon_arifle_SPAR_02_khk_F: Weapon_Base_F { + displayName = CSTRING(arifle_SPAR_02_khk); + }; + class Weapon_arifle_SPAR_02_snd_F: Weapon_Base_F { + displayName = CSTRING(arifle_SPAR_02_snd); + }; + + class Weapon_arifle_SPAR_03_blk_F: Weapon_Base_F { + displayName = CSTRING(arifle_SPAR_03_blk); + }; + class Weapon_arifle_SPAR_03_khk_F: Weapon_Base_F { + displayName = CSTRING(arifle_SPAR_03_khk); + }; + class Weapon_arifle_SPAR_03_snd_F: Weapon_Base_F { + displayName = CSTRING(arifle_SPAR_03_snd); + }; + + // RPG-32 + class Weapon_launch_RPG32_ghex_F: Launcher_Base_F { + displayName = CSTRING(launch_RPG32_ghex); + }; + + // P99 + class Weapon_hgun_P07_khk_F: Pistol_Base_F { + displayName = CSTRING(hgun_P07_khk); + }; + class Weapon_hgun_P07_blk_F: Pistol_Base_F { + displayName = CSTRING(hgun_P07_blk); + }; + + // Makarov + class Weapon_hgun_Pistol_01_F: Pistol_Base_F { + displayName = CSTRING(hgun_Pistol_01); + }; + + // AKM + class Weapon_arifle_AKM_F: Weapon_Base_F { + displayName = CSTRING(arifle_AKM); + }; + + // AKSU + class Weapon_arifle_AKS_F: Weapon_Base_F { + displayName = CSTRING(arifle_AKS); }; + // Contact/Livonia + + // CZ 581 Shotgun + class Weapon_sgun_HunterShotgun_01_F: Weapon_Base_F { + displayName = CSTRING(sgun_huntershotgun_01_Name); + }; + class Weapon_sgun_HunterShotgun_01_sawedoff_F: Weapon_Base_F { + displayName = CSTRING(sgun_huntershotgun_sawedoff_01_Name); + }; + + // FNX-45 (Green) + class Weapon_hgun_Pistol_heavy_01_green_F: Pistol_Base_F { + displayName = CSTRING(hgun_Pistol_heavy_01_green_Name); + }; + + // RPG-32 (Green) + class Weapon_launch_RPG32_green_F: Launcher_Base_F { + displayName = CSTRING(launch_RPG32_green_Name); + }; + + // AK15 variants + class Weapon_arifle_AK12_F: Weapon_Base_F { + displayName = CSTRING(arifle_AK12); + }; + class Weapon_arifle_AK12_lush_F: Weapon_Base_F { + displayName = CSTRING(arifle_AK12_lush); + }; + class Weapon_arifle_AK12_arid_F: Weapon_Base_F { + displayName = CSTRING(arifle_AK12_arid); + }; + + class Weapon_arifle_AK12_GL_F: Weapon_Base_F { + displayName = CSTRING(arifle_AK12_GL); + }; + class Weapon_arifle_AK12_GL_lush_F: Weapon_Base_F { + displayName = CSTRING(arifle_AK12_GL_lush); + }; + class Weapon_arifle_AK12_GL_arid_F: Weapon_Base_F { + displayName = CSTRING(arifle_AK12_GL_arid); + }; + + class Weapon_arifle_AK12U_F: Weapon_Base_F { + displayName = CSTRING(arifle_AK12U); + }; + class Weapon_arifle_AK12U_lush_F: Weapon_Base_F { + displayName = CSTRING(arifle_AK12U_lush); + }; + class Weapon_arifle_AK12U_arid_F: Weapon_Base_F { + displayName = CSTRING(arifle_AK12U_arid); + }; + + class Weapon_arifle_RPK12_F: Weapon_Base_F { + displayName = CSTRING(arifle_RPK12); + }; + class Weapon_arifle_RPK12_lush_F: Weapon_Base_F { + displayName = CSTRING(arifle_RPK12_lush); + }; + class Weapon_arifle_RPK12_arid_F: Weapon_Base_F { + displayName = CSTRING(arifle_RPK12_arid); + }; + + // M14 (Classic) + class Weapon_srifle_DMR_06_hunter_F: Weapon_Base_F { + displayName = CSTRING(srifle_DMR_06_hunter); + }; + + // Stoner 99 LMG (Black) + class Weapon_LMG_Mk200_black_F: Weapon_Base_F { + displayName = CSTRING(LMG_Mk200_black); + }; + + // MSBS Grot variants + class Weapon_arifle_MSBS65_F: Weapon_Base_F { + displayName = CSTRING(arifle_MSBS65); + }; + class Weapon_arifle_MSBS65_black_F: Weapon_Base_F { + displayName = CSTRING(arifle_MSBS65_black); + }; + class Weapon_arifle_MSBS65_camo_F: Weapon_Base_F { + displayName = CSTRING(arifle_MSBS65_camo); + }; + class Weapon_arifle_MSBS65_sand_F: Weapon_Base_F { + displayName = CSTRING(arifle_MSBS65_sand); + }; + class Weapon_arifle_MSBS65_GL_F: Weapon_Base_F { + displayName = CSTRING(arifle_MSBS65_GL); + }; + class Weapon_arifle_MSBS65_GL_black_F: Weapon_Base_F { + displayName = CSTRING(arifle_MSBS65_GL_black); + }; + class Weapon_arifle_MSBS65_GL_camo_F: Weapon_Base_F { + displayName = CSTRING(arifle_MSBS65_GL_camo); + }; + class Weapon_arifle_MSBS65_GL_sand_F: Weapon_Base_F { + displayName = CSTRING(arifle_MSBS65_GL_sand); + }; + class Weapon_arifle_MSBS65_Mark_F: Weapon_Base_F { + displayName = CSTRING(arifle_MSBS65_Mark); + }; + class Weapon_arifle_MSBS65_Mark_black_F: Weapon_Base_F { + displayName = CSTRING(arifle_MSBS65_Mark_black); + }; + class Weapon_arifle_MSBS65_Mark_camo_F: Weapon_Base_F { + displayName = CSTRING(arifle_MSBS65_Mark_camo); + }; + class Weapon_arifle_MSBS65_Mark_sand_F: Weapon_Base_F { + displayName = CSTRING(arifle_MSBS65_Mark_sand); + }; + class Weapon_arifle_MSBS65_UBS_F: Weapon_Base_F { + displayName = CSTRING(arifle_MSBS65_UBS); + }; + class Weapon_arifle_MSBS65_UBS_black_F: Weapon_Base_F { + displayName = CSTRING(arifle_MSBS65_UBS_black); + }; + class Weapon_arifle_MSBS65_UBS_camo_F: Weapon_Base_F { + displayName = CSTRING(arifle_MSBS65_UBS_camo); + }; + class Weapon_arifle_MSBS65_UBS_sand_F: Weapon_Base_F { + displayName = CSTRING(arifle_MSBS65_UBS_sand); + }; }; diff --git a/addons/realisticnames/CfgVehiclesAttachments.hpp b/addons/realisticnames/CfgVehiclesAttachments.hpp new file mode 100644 index 00000000000..54e6206fe3a --- /dev/null +++ b/addons/realisticnames/CfgVehiclesAttachments.hpp @@ -0,0 +1,146 @@ +// Attachments +class Item_Base_F; +class Item_acc_flashlight: Item_Base_F { + displayName = CSTRING(flashlight_Name); +}; + +class Item_optic_MRD: Item_Base_F { + displayName = CSTRING(optic_mrd_Name); +}; +class Item_optic_MRD_black: Item_Base_F { + displayName = CSTRING(optic_mrd_black_Name); +}; + +class Item_optic_Hamr: Item_Base_F { + displayName = CSTRING(optic_hamr); +}; +class Item_optic_Hamr_khk_F: Item_Base_F { + displayName = CSTRING(optic_hamr_khk); +}; + +class Item_optic_Arco: Item_Base_F { + displayName = CSTRING(optic_arco); +}; +class Item_optic_Arco_blk_F: Item_Base_F { + displayName = CSTRING(optic_arco_blk); +}; +class Item_optic_Arco_ghex_F: Item_Base_F { + displayName = CSTRING(optic_arco_ghex); +}; +class Item_optic_Arco_lush_F: Item_Base_F { + displayName = CSTRING(optic_arco_lush); +}; +class Item_optic_Arco_arid_F: Item_Base_F { + displayName = CSTRING(optic_arco_arid); +}; +class Item_optic_Arco_AK_blk_F: Item_Base_F { + displayName = CSTRING(optic_arco_ak_blk); +}; +class Item_optic_Arco_AK_lush_F: Item_Base_F { + displayName = CSTRING(optic_arco_ak_lush); +}; +class Item_optic_Arco_AK_arid_F: Item_Base_F { + displayName = CSTRING(optic_arco_ak_arid); +}; + +class Item_optic_ERCO_blk_f: Item_Base_F { + displayName = CSTRING(optic_erco_blk); +}; +class Item_optic_ERCO_khk_f: Item_Base_F { + displayName = CSTRING(optic_erco_khk); +}; +class Item_optic_ERCO_snd_f: Item_Base_F { + displayName = CSTRING(optic_erco_snd); +}; + +class Item_optic_LRPS: Item_Base_F { + displayName = CSTRING(optic_lrps); +}; +class Item_optic_LRPS_ghex_F: Item_Base_F { + displayName = CSTRING(optic_lrps_ghex); +}; +class Item_optic_LRPS_tna_F: Item_Base_F { + displayName = CSTRING(optic_lrps_tna); +}; + +class Item_optic_AMS: Item_Base_F { + displayName = CSTRING(optic_ams); +}; +class Item_optic_AMS_khk: Item_Base_F { + displayName = CSTRING(optic_ams_khk); +}; +class Item_optic_AMS_snd: Item_Base_F { + displayName = CSTRING(optic_ams_snd); +}; + +class Item_optic_KHS_blk: Item_Base_F { + displayName = CSTRING(optic_khs_blk); +}; +class Item_optic_KHS_hex: Item_Base_F { + displayName = CSTRING(optic_khs_hex); +}; +class Item_optic_KHS_old: Item_Base_F { + displayName = CSTRING(optic_khs_old); +}; +class Item_optic_KHS_tan: Item_Base_F { + displayName = CSTRING(optic_khs_tan); +}; + +class Item_optic_DMS: Item_Base_F { + displayName = CSTRING(optic_dms); +}; +class Item_optic_DMS_ghex_F: Item_Base_F { + displayName = CSTRING(optic_dms_ghex); +}; +class Item_optic_DMS_weathered_F: Item_Base_F { + displayName = CSTRING(optic_dms_weathered); +}; +class Item_optic_DMS_weathered_Kir_F: Item_Base_F { + displayName = CSTRING(optic_dms_weathered_kir); +}; + +class Item_optic_holosight: Item_Base_F { + displayName = CSTRING(optic_holosight); +}; +class Item_optic_Holosight_blk_F: Item_Base_F { + displayName = CSTRING(optic_holosight_blk); +}; +class Item_optic_Holosight_khk_F: Item_Base_F { + displayName = CSTRING(optic_holosight_khk); +}; +class Item_optic_Holosight_lush_F: Item_Base_F { + displayName = CSTRING(optic_holosight_lush); +}; +class Item_optic_Holosight_arid_F: Item_Base_F { + displayName = CSTRING(optic_holosight_arid); +}; +class Item_optic_Holosight_smg: Item_Base_F { + displayName = CSTRING(optic_holosight_smg); +}; +class Item_optic_Holosight_smg_blk_F: Item_Base_F { + displayName = CSTRING(optic_holosight_smg_blk); +}; +class Item_optic_Holosight_smg_khk_F: Item_Base_F { + displayName = CSTRING(optic_holosight_smg_khk); +}; + +class Item_optic_MRCO: Item_Base_F { + displayName = CSTRING(optic_MRCO); +}; + +class Item_optic_Yorris: Item_Base_F { + displayName = CSTRING(optic_Yorris); +}; + +class Item_optic_ACO: Item_Base_F { + displayName = CSTRING(optic_ACO); +}; +class Item_optic_ACO_grn: Item_Base_F { + displayName = CSTRING(optic_ACO_grn); +}; +class Item_optic_ACO_smg: Item_Base_F { + displayName = CSTRING(optic_ACO_smg); +}; +class Item_optic_ACO_grn_smg: Item_Base_F { + displayName = CSTRING(optic_ACO_grn_smg); +}; diff --git a/addons/realisticnames/CfgWeapons.hpp b/addons/realisticnames/CfgWeapons.hpp index 5b0e33e98c9..c515cf08fc7 100644 --- a/addons/realisticnames/CfgWeapons.hpp +++ b/addons/realisticnames/CfgWeapons.hpp @@ -2,8 +2,9 @@ class Mode_SemiAuto; class Mode_FullAuto; class CfgWeapons { - #include "Attachments.hpp" - // assault rifles + #include "CfgWeaponsAttachments.hpp" + + // Assault rifles // MX class arifle_MX_Base_F; @@ -176,13 +177,13 @@ class CfgWeapons { displayName = CSTRING(SMG_02_Name); }; - // PDW 2000 + // CPW class pdw2000_base_F; class hgun_pdw2000_F: pdw2000_base_F { displayName = CSTRING(hgun_PDW2000_Name); }; - // pistols + // Pistols class Pistol_Base_F; class hgun_P07_F: Pistol_Base_F { displayName = CSTRING(hgun_P07_Name); @@ -208,7 +209,7 @@ class CfgWeapons { displayName = CSTRING(hgun_Pistol_Signal_Name); }; - // machine guns + // Machine guns class Rifle_Long_Base_F; class LMG_Mk200_F: Rifle_Long_Base_F { displayName = CSTRING(LMG_Mk200_Name); @@ -218,7 +219,7 @@ class CfgWeapons { displayName = CSTRING(LMG_Zafir_Name); }; - // sniper rifles + // Sniper rifles class EBR_base_F; class srifle_EBR_F: EBR_base_F { displayName = CSTRING(srifle_EBR_Name); @@ -245,7 +246,7 @@ class CfgWeapons { displayName = CSTRING(srifle_DMR_01_Name); }; - // launchers + // Launchers class Launcher_Base_F; class launch_RPG32_F: Launcher_Base_F { displayName = CSTRING(launch_RPG32_Name); @@ -270,42 +271,35 @@ class CfgWeapons { displayName = CSTRING(launch_Vorona_green); }; - // marksmen marksman + // Marksmen marksman class DMR_02_base_F: Rifle_Long_Base_F { displayName = CSTRING(DMR_02); //MAR-10 .338; }; - class srifle_DMR_02_F: DMR_02_base_F { displayName = CSTRING(srifle_DMR_02); //MAR-10 .338 (Black); }; - class srifle_DMR_02_camo_F: srifle_DMR_02_F { displayName = CSTRING(srifle_DMR_02_camo); //MAR-10 .338 (Camo); }; - class srifle_DMR_02_sniper_F: srifle_DMR_02_F { displayName = CSTRING(srifle_DMR_02_sniper); //MAR-10 .338 (Sand); }; + class DMR_03_base_F: Rifle_Long_Base_F { displayName = CSTRING(DMR_03); //Mk-I EMR 7.62 mm; }; - class srifle_DMR_03_F: DMR_03_base_F { displayName = CSTRING(srifle_DMR_03); //Mk-I EMR 7.62 mm (Black); }; - class srifle_DMR_03_khaki_F: srifle_DMR_03_F { displayName = CSTRING(srifle_DMR_03_khaki); //Mk-I EMR 7.62 mm (Khaki); }; - class srifle_DMR_03_tan_F: srifle_DMR_03_F { displayName = CSTRING(srifle_DMR_03_tan); //Mk-I EMR 7.62 mm (Sand); }; - class srifle_DMR_03_multicam_F: srifle_DMR_03_F { displayName = CSTRING(srifle_DMR_03_multicam); //Mk-I EMR 7.62 mm (Camo); }; - class srifle_DMR_03_woodland_F: srifle_DMR_03_F { displayName = CSTRING(srifle_DMR_03_woodland); //Mk-I EMR 7.62 mm (Woodland); }; @@ -313,11 +307,9 @@ class CfgWeapons { class DMR_04_base_F: Rifle_Long_Base_F { displayName = CSTRING(DMR_04); //ASP-1 Kir 12.7 mm; }; - class srifle_DMR_04_F: DMR_04_base_F { displayName = CSTRING(srifle_DMR_04); //ASP-1 Kir 12.7 mm (Black); }; - class srifle_DMR_04_Tan_F: srifle_DMR_04_F { displayName = CSTRING(srifle_DMR_04_Tan); //ASP-1 Kir 12.7 mm (Tan); }; @@ -325,31 +317,27 @@ class CfgWeapons { class DMR_05_base_F: Rifle_Long_Base_F { displayName = CSTRING(DMR_05); //Cyrus 9.3 mm; }; - class srifle_DMR_05_blk_F: DMR_05_base_F { displayName = CSTRING(srifle_DMR_05_blk); //Cyrus 9.3 mm (Black) }; - class srifle_DMR_05_hex_F: srifle_DMR_05_blk_F { displayName = CSTRING(srifle_DMR_05_hex); //Cyrus 9.3 mm (Hex); }; - class srifle_DMR_05_tan_f: srifle_DMR_05_blk_F { displayName = CSTRING(srifle_DMR_05_tan); //Cyrus 9.3 mm (Tan); }; + class DMR_06_base_F: Rifle_Long_Base_F { displayName = CSTRING(DMR_06); //Mk14 7.62 mm; }; - class srifle_DMR_06_camo_F: DMR_06_base_F { displayName = CSTRING(srifle_DMR_06_camo); //Mk14 7.62 mm (Camo) }; - class srifle_DMR_06_olive_F: srifle_DMR_06_camo_F { displayName = CSTRING(srifle_DMR_06_olive); //Mk14 7.62 mm (Olive); }; - // marksmen mgs + // Marksmen MGs class MMG_01_base_F: Rifle_Long_Base_F { displayName = CSTRING(MMG_01); //Navid 9.3 mm; }; @@ -377,15 +365,12 @@ class CfgWeapons { displayName = CSTRING(MMG_02_sand); //SPMG .338 (Sand); }; - // vehicle weapons + // Vehicle weapons - // gatlings + // Gatlings class CannonCore; class gatling_20mm: CannonCore { - //displayName = ""; - class manual: CannonCore { - //displayName = ""; - }; + class manual; }; class Twin_Cannon_20mm: gatling_20mm { displayName = "Plamen PL-20"; @@ -415,7 +400,7 @@ class CfgWeapons { }; }; - // missiles + // Missiles class RocketPods; class Missile_AA_04_Plane_CAS_01_F: RocketPods { displayName = "AIM-9 Sidewinder"; @@ -438,7 +423,7 @@ class CfgWeapons { displayName = CSTRING(missiles_vorona); }; - // rockets + // Rockets class Rocket_04_HE_Plane_CAS_01_F: RocketPods { displayName = "Hydra 70"; class Burst: RocketPods { @@ -469,7 +454,7 @@ class CfgWeapons { }; }; - // more missiles + // More missiles class missiles_DAR: RocketPods { displayName = "Hydra 70"; class Burst: RocketPods { @@ -492,17 +477,17 @@ class CfgWeapons { displayName = "AIM-120A AMRAAM"; }; - class missiles_SCALPEL: RocketPods { // according to zGuba, this is what it's based on + class missiles_SCALPEL: RocketPods { // According to zGuba, this is what it's based on displayName = "9K121 Vikhr"; }; - // bomb + // Bomb class Bomb_04_Plane_CAS_01_F; class Bomb_03_Plane_CAS_02_F: Bomb_04_Plane_CAS_01_F { displayName = "FAB-250M-54"; }; - // machine guns + // Machine guns class MGunCore; class M134_minigun: MGunCore { displayName = "2x M134 Minigun"; @@ -532,11 +517,6 @@ class CfgWeapons { }; }; - class HMG_127_APC: HMG_127 {}; - class ACE_HMG_127_KORD: HMG_127_APC { - displayName = "6P49 Kord"; - }; - class HMG_01: HMG_127 { displayName = "XM312"; }; @@ -551,7 +531,7 @@ class CfgWeapons { }; }; - // grenade launchers + // Grenade launchers class GMG_F; class GMG_20mm: GMG_F { displayName = "XM307"; @@ -567,7 +547,7 @@ class CfgWeapons { }; }; - // autocannons + // Autocannons class autocannon_35mm: CannonCore { displayName = "GDF-001"; class manual: CannonCore { @@ -575,7 +555,7 @@ class CfgWeapons { }; }; - // aa missiles + // AA missiles class missiles_titan: MissileLauncher { displayName = "Mini-Spike"; }; @@ -584,17 +564,17 @@ class CfgWeapons { displayName = "FIM-92F"; }; - // mortar + // Nortar class mortar_155mm_AMOS: CannonCore { displayName = "L/52"; }; - // artillery rockets + // Artillery rockets class rockets_230mm_GAT: RocketPods { displayName = "M269"; }; - // tank guns + // Tank guns class cannon_120mm: CannonCore { class player; displayName = "MG251"; @@ -605,10 +585,6 @@ class CfgWeapons { class player: player {}; }; - class ACE_cannon_120mm_GT12: cannon_120mm { - displayName = "GT12"; - }; - class cannon_105mm: CannonCore { displayName = "M68"; class player: Mode_SemiAuto { @@ -624,28 +600,12 @@ class CfgWeapons { displayName = "2A82-1M"; }; - // coax machine guns + // Coax machine guns class LMG_coax: LMG_RCWS { displayName = "PKT"; }; - class LMG_coax_ext: LMG_coax {}; - class ACE_LMG_coax_ext_MAG58: LMG_coax_ext { - displayName = "MAG 58M"; - }; - class ACE_LMG_coax_MAG58_mem3: LMG_coax { - displayName = "MAG 58M"; - }; - class ACE_LMG_coax_L94A1_mem3: LMG_coax { - displayName = "L94A1"; - }; - class ACE_LMG_coax_ext_MG3: LMG_coax_ext { - displayName = "Rheinmetall MG3"; - }; - class ACE_LMG_coax_DenelMG4: LMG_coax { - displayName = "Denel MG4"; - }; - // more autocannons + // More autocannons class autocannon_Base_F; class autocannon_40mm_CTWS: autocannon_Base_F { displayName = "Mk44 Bushmaster II"; @@ -694,20 +654,6 @@ class CfgWeapons { displayName = "2A42"; }; - class cannon_20mm: autocannon_Base_F { - class AP: autocannon_Base_F {}; - class HE: autocannon_Base_F {}; - }; - class ACE_cannon_20mm_Rh202: cannon_20mm { - displayName = "MK20 Rh 202"; - class AP: AP { - displayName = "MK20 Rh 202"; - }; - class HE: HE { - displayName = "MK20 Rh 202"; - }; - }; - // APEX/Tanoa // Type 115 diff --git a/addons/realisticnames/Attachments.hpp b/addons/realisticnames/CfgWeaponsAttachments.hpp similarity index 84% rename from addons/realisticnames/Attachments.hpp rename to addons/realisticnames/CfgWeaponsAttachments.hpp index a861bb4a043..c23559b7028 100644 --- a/addons/realisticnames/Attachments.hpp +++ b/addons/realisticnames/CfgWeaponsAttachments.hpp @@ -1,7 +1,5 @@ -//attachments - +// Attachments class ItemCore; - class acc_flashlight: ItemCore { displayName = CSTRING(flashlight_Name); }; @@ -19,12 +17,6 @@ class optic_Hamr: ItemCore { class optic_Hamr_khk_F: optic_Hamr { displayName = CSTRING(optic_hamr_khk); }; -class ACE_optic_Hamr_2D: optic_Hamr { - displayName = CSTRING(optic_hamr_2d); -}; -class ACE_optic_Hamr_PIP: ACE_optic_Hamr_2D { - displayName = CSTRING(optic_hamr_pip); -}; class optic_Arco: ItemCore { displayName = CSTRING(optic_arco); @@ -35,12 +27,6 @@ class optic_Arco_blk_F: optic_Arco { class optic_Arco_ghex_F: optic_Arco { displayName = CSTRING(optic_arco_ghex); }; -class ACE_optic_Arco_2D: optic_Arco { - displayName = CSTRING(optic_arco_2d); -}; -class ACE_optic_Arco_PIP: ACE_optic_Arco_2D { - displayName = CSTRING(optic_arco_pip); -}; class optic_Arco_lush_F: optic_Arco { displayName = CSTRING(optic_arco_lush); }; @@ -76,12 +62,6 @@ class optic_LRPS_ghex_F: optic_LRPS { class optic_LRPS_tna_F: optic_LRPS { displayName = CSTRING(optic_lrps_tna); }; -class ACE_optic_LRPS_2D: optic_LRPS { - displayName = CSTRING(optic_lrps_2d); -}; -class ACE_optic_LRPS_PIP: ACE_optic_LRPS_2D { - displayName = CSTRING(optic_lrps_pip); -}; class optic_AMS_base; class optic_AMS: optic_AMS_base { @@ -149,12 +129,6 @@ class optic_Holosight_smg_khk_F: optic_Holosight_smg { class optic_MRCO: ItemCore { displayName = CSTRING(optic_MRCO); }; -class ACE_optic_MRCO_2D: optic_MRCO { - displayName = CSTRING(optic_MRCO_2d); -}; -class ACE_optic_MRCO_PIP: ACE_optic_MRCO_2D { - displayName = CSTRING(optic_MRCO_pip); -}; class optic_Yorris: ItemCore { displayName = CSTRING(optic_Yorris); diff --git a/addons/realisticnames/compat_explosives/CfgMagazines.hpp b/addons/realisticnames/compat_explosives/CfgMagazines.hpp new file mode 100644 index 00000000000..41a19345dbe --- /dev/null +++ b/addons/realisticnames/compat_explosives/CfgMagazines.hpp @@ -0,0 +1,9 @@ +class CfgMagazines { + class CA_Magazine; + class ACE_SatchelCharge_Remote_Mag_Throwable: CA_Magazine { + displayName = CSTRING(SatchelChargeThrowable_Name); + }; + class ACE_DemoCharge_Remote_Mag_Throwable: ACE_SatchelCharge_Remote_Mag_Throwable { + displayName = CSTRING(DemoChargeThrowable_Name); + }; +}; diff --git a/addons/realisticnames/compat_explosives/CfgVehicles.hpp b/addons/realisticnames/compat_explosives/CfgVehicles.hpp new file mode 100644 index 00000000000..e22068161a8 --- /dev/null +++ b/addons/realisticnames/compat_explosives/CfgVehicles.hpp @@ -0,0 +1,29 @@ +class CfgVehicles { + class ACE_Explosives_Place; + class ACE_Explosives_Place_DemoCharge: ACE_Explosives_Place { + displayName = CSTRING(DemoCharge_Name); + }; + class ACE_Explosives_Place_APERSBoundingMine: ACE_Explosives_Place { + displayName = CSTRING(APERSBoundingMine_Name); + }; + class ACE_Explosives_Place_APERSMine: ACE_Explosives_Place { + displayName = CSTRING(APERSMine_Name); + }; + class ACE_Explosives_Place_APERSTripwireMine: ACE_Explosives_Place { + displayName = CSTRING(APERSTripwireMine_Name); + }; + class ACE_Explosives_Place_ATMine: ACE_Explosives_Place { + displayName = CSTRING(ATMine_Name); + }; + class ACE_Explosives_Place_Claymore: ACE_Explosives_Place { + displayName = CSTRING(Claymore_Name); + }; + class ACE_Explosives_Place_SatchelCharge: ACE_Explosives_Place { + displayName = CSTRING(SatchelCharge_Name); + }; + + // Orange DLC + class ACE_Explosives_Place_SLAM: ACE_Explosives_Place { + displayName = CSTRING(SLAM_Name); + }; +}; diff --git a/addons/realisticnames/compat_explosives/config.cpp b/addons/realisticnames/compat_explosives/config.cpp new file mode 100644 index 00000000000..208bc7e791f --- /dev/null +++ b/addons/realisticnames/compat_explosives/config.cpp @@ -0,0 +1,22 @@ +#include "script_component.hpp" + +class CfgPatches { + class SUBADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {QUOTE(ADDON), "ace_explosives"}; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + + // this prevents any patched class from requiring this addon + addonRootClass = "A3_Characters_F"; + }; +}; + +#include "CfgMagazines.hpp" +#include "CfgVehicles.hpp" diff --git a/addons/realisticnames/compat_explosives/script_component.hpp b/addons/realisticnames/compat_explosives/script_component.hpp new file mode 100644 index 00000000000..a697aad7f3b --- /dev/null +++ b/addons/realisticnames/compat_explosives/script_component.hpp @@ -0,0 +1,3 @@ +#define SUBCOMPONENT explosives +#define SUBCOMPONENT_BEAUTIFIED Explosives +#include "..\script_component.hpp" diff --git a/addons/realisticnames/compat_optics/CfgWeapons.hpp b/addons/realisticnames/compat_optics/CfgWeapons.hpp new file mode 100644 index 00000000000..6ffd6484b2c --- /dev/null +++ b/addons/realisticnames/compat_optics/CfgWeapons.hpp @@ -0,0 +1,33 @@ +class CfgWeapons { + class optic_Hamr; + class ACE_optic_Hamr_2D: optic_Hamr { + displayName = CSTRING(optic_hamr_2d); + }; + class ACE_optic_Hamr_PIP: ACE_optic_Hamr_2D { + displayName = CSTRING(optic_hamr_pip); + }; + + class optic_Arco; + class ACE_optic_Arco_2D: optic_Arco { + displayName = CSTRING(optic_arco_2d); + }; + class ACE_optic_Arco_PIP: ACE_optic_Arco_2D { + displayName = CSTRING(optic_arco_pip); + }; + + class optic_LRPS; + class ACE_optic_LRPS_2D: optic_LRPS { + displayName = CSTRING(optic_lrps_2d); + }; + class ACE_optic_LRPS_PIP: ACE_optic_LRPS_2D { + displayName = CSTRING(optic_lrps_pip); + }; + + class optic_MRCO; + class ACE_optic_MRCO_2D: optic_MRCO { + displayName = CSTRING(optic_MRCO_2d); + }; + class ACE_optic_MRCO_PIP: ACE_optic_MRCO_2D { + displayName = CSTRING(optic_MRCO_pip); + }; +}; diff --git a/addons/realisticnames/compat_optics/config.cpp b/addons/realisticnames/compat_optics/config.cpp new file mode 100644 index 00000000000..32d2795dd96 --- /dev/null +++ b/addons/realisticnames/compat_optics/config.cpp @@ -0,0 +1,21 @@ +#include "script_component.hpp" + +class CfgPatches { + class SUBADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {QUOTE(ADDON), "ace_optics"}; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + + // this prevents any patched class from requiring this addon + addonRootClass = "A3_Characters_F"; + }; +}; + +#include "CfgWeapons.hpp" diff --git a/addons/realisticnames/compat_optics/script_component.hpp b/addons/realisticnames/compat_optics/script_component.hpp new file mode 100644 index 00000000000..b90538fc4e2 --- /dev/null +++ b/addons/realisticnames/compat_optics/script_component.hpp @@ -0,0 +1,3 @@ +#define SUBCOMPONENT optics +#define SUBCOMPONENT_BEAUTIFIED Optics +#include "..\script_component.hpp" diff --git a/addons/realisticnames/compat_vehicles/CfgWeapons.hpp b/addons/realisticnames/compat_vehicles/CfgWeapons.hpp new file mode 100644 index 00000000000..c49ae26bcb4 --- /dev/null +++ b/addons/realisticnames/compat_vehicles/CfgWeapons.hpp @@ -0,0 +1,45 @@ +class CfgWeapons { + class HMG_127_APC; + class ACE_HMG_127_KORD: HMG_127_APC { + displayName = "6P49 Kord"; + }; + + class cannon_120mm; + class ACE_cannon_120mm_GT12: cannon_120mm { + displayName = "GT12"; + }; + + class LMG_coax_ext; + class ACE_LMG_coax_ext_MG3: LMG_coax_ext { + displayName = "Rheinmetall MG3"; + }; + class ACE_LMG_coax_ext_MAG58: LMG_coax_ext { + displayName = "MAG 58M"; + }; + + class LMG_coax; + class ACE_LMG_coax_MAG58_mem3: LMG_coax { + displayName = "MAG 58M"; + }; + class ACE_LMG_coax_L94A1_mem3: LMG_coax { + displayName = "L94A1"; + }; + class ACE_LMG_coax_DenelMG4: LMG_coax { + displayName = "Denel MG4"; + }; + + class autocannon_Base_F; + class cannon_20mm: autocannon_Base_F { + class AP: autocannon_Base_F {}; + class HE: autocannon_Base_F {}; + }; + class ACE_cannon_20mm_Rh202: cannon_20mm { + displayName = "MK20 Rh 202"; + class AP: AP { + displayName = "MK20 Rh 202"; + }; + class HE: HE { + displayName = "MK20 Rh 202"; + }; + }; +}; diff --git a/addons/realisticnames/compat_vehicles/config.cpp b/addons/realisticnames/compat_vehicles/config.cpp new file mode 100644 index 00000000000..846c92a0eec --- /dev/null +++ b/addons/realisticnames/compat_vehicles/config.cpp @@ -0,0 +1,21 @@ +#include "script_component.hpp" + +class CfgPatches { + class SUBADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {QUOTE(ADDON), "ace_vehicles"}; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + + // this prevents any patched class from requiring this addon + addonRootClass = "A3_Characters_F"; + }; +}; + +#include "CfgWeapons.hpp" diff --git a/addons/realisticnames/compat_vehicles/script_component.hpp b/addons/realisticnames/compat_vehicles/script_component.hpp new file mode 100644 index 00000000000..17370c415fd --- /dev/null +++ b/addons/realisticnames/compat_vehicles/script_component.hpp @@ -0,0 +1,3 @@ +#define SUBCOMPONENT vehicles +#define SUBCOMPONENT_BEAUTIFIED Vehicles +#include "..\script_component.hpp" diff --git a/addons/realisticnames/dev_dumpPylon.sqf b/addons/realisticnames/dev_dumpPylon.sqf index df0d7ea4a56..4bb10a84fb6 100644 --- a/addons/realisticnames/dev_dumpPylon.sqf +++ b/addons/realisticnames/dev_dumpPylon.sqf @@ -22,7 +22,7 @@ private _magazines = configProperties [configFile >> "CfgMagazines", "isClass _x diag_log text format ['class %1;', configName inheritsFrom _x]; diag_log text format ['class %1: %2 {', configName _x, configName inheritsFrom _x]; diag_log text format ['displayName = "%1"; [vanilla: %2 - %3]', _weaponName, _pylonMagName, _pylonWeapon]; - diag_log text format ['};', configName _x, configName inheritsFrom _x, _weaponName, _pylonMagName]; + diag_log text format ['};']; }; }; }; diff --git a/addons/realisticnames/stringtable.xml b/addons/realisticnames/stringtable.xml index af864f64df0..0a2b57f0ff1 100644 --- a/addons/realisticnames/stringtable.xml +++ b/addons/realisticnames/stringtable.xml @@ -30,7 +30,7 @@ <Hungarian>XM312A</Hungarian> <Italian>XM312A</Italian> <Japanese>XM312A</Japanese> - <Korean>XM312A 무인중기관총</Korean> + <Korean>XM312A 무인 중기관총</Korean> <Chinese>XM312A重機槍</Chinese> <Chinesesimp>XM312A</Chinesesimp> <Turkish>XM312A</Turkish> @@ -166,7 +166,7 @@ <Italian>YABHON-R3 (CAS)</Italian> <Portuguese>YABHON-R3 (CAS)</Portuguese> <Japanese>YABHON-R3 (CAS)</Japanese> - <Korean>YABHON-R3 무인기 (근접지원)</Korean> + <Korean>YABHON-R3 무인기 (근접항공지원)</Korean> <Chinese>"亞伯罕-R3型"空中無人載具 (近空支援)</Chinese> <Chinesesimp>"联合"-R3(近空支援)</Chinesesimp> <Turkish>YABHON-R3 (CAS)</Turkish> @@ -706,6 +706,7 @@ <Korean>카마즈 급수</Korean> <German>KamAS Wasser</German> <Italian>KamAZ Acqua</Italian> + <French>KamAZ Eau</French> </Key> <Key ID="STR_ACE_RealisticNames_Truck_02_MRL_Name"> <English>KamAZ MRL</English> @@ -854,7 +855,7 @@ <Hungarian>Otokar ARMA</Hungarian> <Italian>Otokar ARMA</Italian> <Japanese>オトカ アルマ</Japanese> - <Korean>오토카르 아르마 APC</Korean> + <Korean>오토카 아르마 APC</Korean> <Chinese>"奧托卡—阿爾默"裝甲運兵車</Chinese> <Chinesesimp>奥托卡尔 "阿玛"</Chinesesimp> <Turkish>Otokar ARMA</Turkish> @@ -1160,7 +1161,7 @@ <Hungarian>L-159 ALCA (Légitámogató)</Hungarian> <Italian>L-159 ALCA (CAS)</Italian> <Japanese>L-159 ALCA (CAS)</Japanese> - <Korean>L-159 ALCA (근접지원)</Korean> + <Korean>L-159 ALCA (근접항공지원)</Korean> <Chinese>L-159先進輕型戰鬥機 (近空支援)</Chinese> <Chinesesimp>L-159 ALCA(近空支援)</Chinesesimp> <Turkish>L-159 ALCA (CAS)</Turkish> @@ -1324,7 +1325,7 @@ <Czech>Demoliční nálož M183</Czech> <French>M183 Charge de démolition</French> <Russian>M183 комплектный подрывной заряд</Russian> - <Portuguese>M183 Sacola de Demolição</Portuguese> + <Portuguese>M183 Conjunto de Carga de Demolição</Portuguese> <Hungarian>M183 romboló töltet</Hungarian> <Italian>M183 Carica da Demolizioni</Italian> <Japanese>M183 梱包爆薬</Japanese> @@ -1345,6 +1346,7 @@ <German>M183 Geballte Sprengladung (Werfbar)</German> <Chinesesimp>M183 炸药包(可投掷)</Chinesesimp> <Korean>M183 폭파 장약 (투척)</Korean> + <Portuguese>M183 Carga de Demolição (Arremessável)</Portuguese> </Key> <Key ID="STR_ACE_RealisticNames_DemoCharge_Name"> <English>M112 Demolition Block</English> @@ -1375,6 +1377,7 @@ <German>M112 Sprengladung (Werfbar)</German> <Chinesesimp>M112 塑性炸药(可投掷)</Chinesesimp> <Korean>M112 폭파 장약 (투척)</Korean> + <Portuguese>M112 Carga de Demolição (Arremessável)</Portuguese> </Key> <Key ID="STR_ACE_RealisticNames_HandGrenade_Name"> <English>M67 Fragmentation Grenade</English> @@ -1672,6 +1675,7 @@ <Korean>CZ 581</Korean> <German>CZ 581</German> <Italian>CZ 581</Italian> + <French>CZ 581</French> </Key> <Key ID="STR_ACE_RealisticNames_sgun_huntershotgun_sawedoff_01_Name"> <English>CZ 581 (Sawed-Off)</English> @@ -1681,6 +1685,7 @@ <Korean>CZ 581 (소드오프)</Korean> <German>CZ 581 (Abgesägt)</German> <Italian>CZ 581 (Canne mozze)</Italian> + <French>CZ 581 (canon scié)</French> </Key> <Key ID="STR_ACE_RealisticNames_hgun_Pistol_heavy_01_green_Name"> <English>FNX-45 Tactical (Green)</English> @@ -2731,7 +2736,7 @@ <Key ID="STR_ACE_RealisticNames_srifle_DMR_04_Tan"> <English>ASP-1 Kir (Tan)</English> <Czech>ASP-1 Kir (Žlutohnědá)</Czech> - <French>ASP-1 Kir (Tan)</French> + <French>ASP-1 Kir (Marron)</French> <Spanish>ASP-1 Kir (Tan)</Spanish> <Russian>ASP-1 Kir (пустынный)</Russian> <German>ASP-1 Kir (Hellbraun)</German> @@ -3091,6 +3096,7 @@ <Korean>115식 보총 (검정)</Korean> <German>Type 115 (Schwarz)</German> <Italian>Type 115 (Nero)</Italian> + <French>Type 115 (Noir)</French> </Key> <Key ID="STR_ACE_RealisticNames_arifle_arx_ghex_Name"> <English>Type 115 (Green Hex)</English> @@ -3100,6 +3106,7 @@ <Korean>115식 보총 (초록육각)</Korean> <German>Type 115 (Hex Grün)</German> <Italian>Type 115 (Hex Verde)</Italian> + <French>Type 115 (Hew Vert)</French> </Key> <Key ID="STR_ACE_RealisticNames_arifle_arx_hex_Name"> <English>Type 115 (Hex)</English> @@ -3109,6 +3116,7 @@ <Korean>115식 보총 (육각)</Korean> <German>Type 115 (Hex)</German> <Italian>Type 115 (Hex)</Italian> + <French>Type 115 (Hex)</French> </Key> <Key ID="STR_ACE_RealisticNames_arifle_CTAR_blk"> <English>QBZ-95-1 (Black)</English> @@ -3902,6 +3910,7 @@ <Korean>UTG 디펜더 126</Korean> <German>UTG Defender 126</German> <Italian>UTG Defender 126</Italian> + <French>UTG Defender 126</French> </Key> <Key ID="STR_ACE_RealisticNames_optic_mrd_Name"> <English>EOTech MRDS</English> @@ -3911,6 +3920,7 @@ <Korean>이오텍 MRDS</Korean> <German>EOTech MRDS</German> <Italian>EOTech MRDS</Italian> + <French>EOTech MRDS</French> </Key> <Key ID="STR_ACE_RealisticNames_optic_mrd_black_Name"> <English>EOTech MRDS (Black)</English> @@ -3920,6 +3930,7 @@ <Korean>이오텍 MRDS (검정)</Korean> <German>EOTech MRDS (Schwarz)</German> <Italian>EOTech MRDS (Nero)</Italian> + <French>EOTech MRDS (Noir)</French> </Key> <Key ID="STR_ACE_RealisticNames_optic_hamr"> <English>Leupold Mark 4 HAMR</English> @@ -4076,6 +4087,7 @@ <Korean>엘칸 스펙터OS (초목)</Korean> <Russian>ELCAN SpecterOS (обильная растительность)</Russian> <Spanish>ELCAN SpecterOS (Exuberante)</Spanish> + <Portuguese>ELCAN SpecterOS (Exuberante)</Portuguese> </Key> <Key ID="STR_ACE_RealisticNames_optic_arco_arid"> <English>ELCAN SpecterOS (Arid)</English> @@ -4088,6 +4100,7 @@ <Korean>엘칸 스펙터OS (건조)</Korean> <Russian>ELCAN SpecterOS (сухая местность)</Russian> <Spanish>ELCAN SpecterOS (Árido)</Spanish> + <Portuguese>ELCAN SpecterOS (Árido)</Portuguese> </Key> <Key ID="STR_ACE_RealisticNames_optic_arco_ak_blk"> <English>ELCAN SpecterOS 7.62 (Black)</English> @@ -4100,6 +4113,7 @@ <Korean>엘칸 스펙터OS 7.62 (검정)</Korean> <Russian>ELCAN SpecterOS 7.62 (чёрный)</Russian> <Spanish>ELCAN SpecterOS 7.62 (Negro)</Spanish> + <Portuguese>ELCAN SpecterOS 7.62 (Preto)</Portuguese> </Key> <Key ID="STR_ACE_RealisticNames_optic_arco_ak_lush"> <English>ELCAN SpecterOS 7.62 (Lush)</English> @@ -4112,6 +4126,7 @@ <Korean>엘칸 스펙터OS 7.62 (초목)</Korean> <Russian>ELCAN SpecterOS 7.62 (обильная растительность)</Russian> <Spanish>ELCAN SpecterOS 7.62 (Exuberante)</Spanish> + <Portuguese>ELCAN SpecterOS 7.62 (Exuberante)</Portuguese> </Key> <Key ID="STR_ACE_RealisticNames_optic_arco_ak_arid"> <English>ELCAN SpecterOS 7.62 (Arid)</English> @@ -4124,6 +4139,7 @@ <Korean>엘칸 스펙터OS 7.62 (건조)</Korean> <Russian>ELCAN SpecterOS 7.62 (сухая местность)</Russian> <Spanish>ELCAN SpecterOS 7.62 (Árido)</Spanish> + <Portuguese>ELCAN SpecterOS 7.62 (Árido)</Portuguese> </Key> <Key ID="STR_ACE_RealisticNames_optic_erco_blk"> <English>SIG BRAVO4 / ROMEO3 (Black)</English> @@ -4408,6 +4424,7 @@ <Korean>버리스 XTR II (낡음)</Korean> <Russian>Burris XTR II (старый)</Russian> <Spanish>Burris XTR II (Viejo)</Spanish> + <Portuguese>Burris XTR II (Velho)</Portuguese> </Key> <Key ID="STR_ACE_RealisticNames_optic_dms_weathered_kir"> <English>Burris XTR II (ASP-1 Kir)</English> @@ -4420,6 +4437,7 @@ <Korean>버리스 XTR II (ASP-1 키르용)</Korean> <Russian>Burris XTR II (ASP-1 Kir)</Russian> <Spanish>Burris XTR II (ASP-1 Kir)</Spanish> + <Portuguese>Burris XTR II (ASP-1 Kir)</Portuguese> </Key> <Key ID="STR_ACE_RealisticNames_optic_holosight"> <English>EOTech XPS3 (Tan)</English> @@ -4480,6 +4498,7 @@ <Korean>이오텍 XPS3 (초목)</Korean> <Russian>EOTech XPS3 (обильная растительность)</Russian> <Spanish>EOTech XPS3 (Exuberante)</Spanish> + <Portuguese>EOTech XPS3 (Exuberante)</Portuguese> </Key> <Key ID="STR_ACE_RealisticNames_optic_holosight_arid"> <English>EOTech XPS3 (Arid)</English> @@ -4492,6 +4511,7 @@ <Korean>이오텍 XPS3 (건조)</Korean> <Russian>EOTech XPS3 (сухая местность)</Russian> <Spanish>EOTech XPS3 (Árido)</Spanish> + <Portuguese>EOTech XPS3 (Árido)</Portuguese> </Key> <Key ID="STR_ACE_RealisticNames_optic_holosight_smg"> <English>EOTech XPS3 SMG (Tan)</English> diff --git a/addons/realisticweights/config.cpp b/addons/realisticweights/config.cpp index 91c1ea00aa9..ebd919fc49b 100644 --- a/addons/realisticweights/config.cpp +++ b/addons/realisticweights/config.cpp @@ -2,6 +2,7 @@ class CfgPatches { class ADDON { + name = COMPONENT_NAME; units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; diff --git a/addons/realisticweights/script_component.hpp b/addons/realisticweights/script_component.hpp index fcdb3450689..bf7173a3e70 100644 --- a/addons/realisticweights/script_component.hpp +++ b/addons/realisticweights/script_component.hpp @@ -1,4 +1,5 @@ #define COMPONENT realisticweights +#define COMPONENT_BEAUTIFIED Realistic Weights #include "\z\ace\addons\main\script_mod.hpp" // #define DEBUG_MODE_FULL diff --git a/addons/rearm/functions/fnc_canRearm.sqf b/addons/rearm/functions/fnc_canRearm.sqf index 8d2b0b58e50..34bb3727536 100644 --- a/addons/rearm/functions/fnc_canRearm.sqf +++ b/addons/rearm/functions/fnc_canRearm.sqf @@ -22,7 +22,7 @@ if (!alive _vehicle) exitWith {false}; if (GVAR(level) == 0 || {isNull _unit} || {!(_unit isKindOf "CAManBase")} || {!local _unit} || {_vehicle distance _unit > REARM_ACTION_DISTANCE} || {_vehicle getVariable [QGVAR(disabled), false]}) exitWith {false}; private _dummy = _unit getVariable [QGVAR(dummy), objNull]; -if (isNull _dummy) exitwith {false}; +if (isNull _dummy) exitWith {false}; private _magazineClass = _dummy getVariable QGVAR(magazineClass); if (isNil "_magazineClass") exitWith {false}; diff --git a/addons/rearm/functions/fnc_dropAmmo.sqf b/addons/rearm/functions/fnc_dropAmmo.sqf index af4b74ee775..ba89c9cd917 100644 --- a/addons/rearm/functions/fnc_dropAmmo.sqf +++ b/addons/rearm/functions/fnc_dropAmmo.sqf @@ -38,8 +38,8 @@ if (_actionID != -1) then { _unit removeAction _actionID; _unit setVariable [QGVAR(ReleaseActionID), nil]; }; -[_unit, "forceWalk", "ACE_rearm", false] call EFUNC(common,statusEffect_set); -[_unit, "blockThrow", "ACE_rearm", false] call EFUNC(common,statusEffect_set); +[_unit, "forceWalk", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); +[_unit, "blockThrow", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); if (_unholster) then { REARM_UNHOLSTER_WEAPON diff --git a/addons/rearm/functions/fnc_grabAmmo.sqf b/addons/rearm/functions/fnc_grabAmmo.sqf index d3554853092..b7f87a69ba4 100644 --- a/addons/rearm/functions/fnc_grabAmmo.sqf +++ b/addons/rearm/functions/fnc_grabAmmo.sqf @@ -19,8 +19,8 @@ params ["_dummy", "_unit"]; REARM_HOLSTER_WEAPON; -[_unit, "forceWalk", "ACE_rearm", true] call EFUNC(common,statusEffect_set); -[_unit, "blockThrow", "ACE_rearm", true] call EFUNC(common,statusEffect_set); +[_unit, "forceWalk", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); +[_unit, "blockThrow", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); [ TIME_PROGRESSBAR(5), @@ -35,7 +35,7 @@ REARM_HOLSTER_WEAPON; _unit removeAction _actionID; }; _actionID = _unit addAction [ - format ["<t color='#FF0000'>%1</t>", localize ELSTRING(dragging,Drop)], + format ["<t color='#FF0000'>%1</t>", LELSTRING(common,Drop)], '(_this select 0) call FUNC(dropAmmo)', nil, 20, diff --git a/addons/rearm/functions/fnc_rearm.sqf b/addons/rearm/functions/fnc_rearm.sqf index 81f467a5ca8..52c00a54c0e 100644 --- a/addons/rearm/functions/fnc_rearm.sqf +++ b/addons/rearm/functions/fnc_rearm.sqf @@ -20,9 +20,9 @@ params ["_target", "_unit"]; TRACE_2("rearm",_target,_unit); private _attachedDummy = _unit getVariable [QGVAR(dummy), objNull]; -if (isNull _attachedDummy) exitwith {ERROR_1("attachedDummy null",_attachedDummy);}; +if (isNull _attachedDummy) exitWith {ERROR_1("attachedDummy null %1",_attachedDummy);}; private _magazineClass = _attachedDummy getVariable QGVAR(magazineClass); -if (isNil "_magazineClass") exitWith {ERROR_1("magazineClass nil",_attachedDummy);}; +if (isNil "_magazineClass") exitWith {ERROR_1("magazineClass nil %1",_attachedDummy);}; ([_magazineClass] call FUNC(getCaliber)) params ["_cal", "_idx"]; @@ -45,6 +45,7 @@ private _magazineDisplayName = _magazineClass call FUNC(getMagazineName); "", format [localize LSTRING(RearmAction), getText(configOf _target >> "displayName"), _magazineDisplayName], { + //IGNORE_PRIVATE_WARNING ["_player"]; param [0] params ["_target", "_unit"]; _player distance _target <= GVAR(distance); }, diff --git a/addons/rearm/functions/fnc_rearmSuccessLocal.sqf b/addons/rearm/functions/fnc_rearmSuccessLocal.sqf index f41dff6ea9c..ace43baf8f9 100644 --- a/addons/rearm/functions/fnc_rearmSuccessLocal.sqf +++ b/addons/rearm/functions/fnc_rearmSuccessLocal.sqf @@ -31,7 +31,7 @@ if (_pylon > 0) exitWith { // Fill magazine completely if (_turretPath isEqualTo [-1]) then {_turretPath = [];}; // Convert back to pylon turret format TRACE_3("",_pylon,_magazineClass,_rounds); - _vehicle setPylonLoadOut [_pylon, _magazineClass, true, _turretPath]; + _vehicle setPylonLoadout [_pylon, _magazineClass, true, _turretPath]; [QEGVAR(common,displayTextStructured), [[LSTRING(Hint_RearmedTriple), _rounds, getText(configFile >> "CfgMagazines" >> _magazineClass >> "displayName"), getText(configOf _vehicle >> "displayName")], 3, _unit], [_unit]] call CBA_fnc_targetEvent; @@ -41,7 +41,7 @@ if (_pylon > 0) exitWith { private _currentCount = _vehicle ammoOnPylon _pylon; private _newCount = ((_currentCount max 0) + _numRounds) min _rounds; TRACE_3("",_pylon,_magazineClass,_newCount); - _vehicle setPylonLoadOut [_pylon, _magazineClass, true, _turretPath]; + _vehicle setPylonLoadout [_pylon, _magazineClass, true, _turretPath]; _vehicle setAmmoOnPylon [_pylon, _newCount]; [QEGVAR(common,displayTextStructured), [[LSTRING(Hint_RearmedTriple), _numRounds, getText(configFile >> "CfgMagazines" >> _magazineClass >> "displayName"), diff --git a/addons/rearm/functions/fnc_storeAmmo.sqf b/addons/rearm/functions/fnc_storeAmmo.sqf index e9f57369f3d..1d08d289be4 100644 --- a/addons/rearm/functions/fnc_storeAmmo.sqf +++ b/addons/rearm/functions/fnc_storeAmmo.sqf @@ -19,7 +19,7 @@ params ["_truck", "_unit"]; private _attachedDummy = _unit getVariable [QGVAR(dummy), objNull]; -if (isNull _attachedDummy) exitwith {}; +if (isNull _attachedDummy) exitWith {}; private _magazineClass = _attachedDummy getVariable [QGVAR(magazineClass), "#noVar"]; diff --git a/addons/rearm/functions/fnc_takeSuccess.sqf b/addons/rearm/functions/fnc_takeSuccess.sqf index 717d549b86c..214713c80d6 100644 --- a/addons/rearm/functions/fnc_takeSuccess.sqf +++ b/addons/rearm/functions/fnc_takeSuccess.sqf @@ -36,13 +36,13 @@ if (_vehicle == _unit) exitWith { [_unit, _magazineClass, _rounds] call EFUNC(csw,reload_handleReturnAmmo); }; -[_unit, "forceWalk", "ACE_rearm", true] call EFUNC(common,statusEffect_set); -[_unit, "blockThrow", "ACE_rearm", true] call EFUNC(common,statusEffect_set); +[_unit, "forceWalk", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); +[_unit, "blockThrow", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); private _dummy = [_unit, _magazineClass] call FUNC(createDummy); [_dummy, _unit] call FUNC(pickUpAmmo); private _actionID = _unit addAction [ - format ["<t color='#FF0000'>%1</t>", localize ELSTRING(dragging,Drop)], + format ["<t color='#FF0000'>%1</t>", LELSTRING(common,Drop)], '(_this select 0) call FUNC(dropAmmo)', nil, 20, diff --git a/addons/rearm/script_component.hpp b/addons/rearm/script_component.hpp index 83d495bc38a..4bcff331d68 100644 --- a/addons/rearm/script_component.hpp +++ b/addons/rearm/script_component.hpp @@ -28,12 +28,14 @@ #define REARM_HOLSTER_WEAPON \ - _unit setVariable [QGVAR(selectedWeaponOnRearm), currentWeapon _unit]; \ + if (currentWeapon _unit != "") then { \ + _unit setVariable [QGVAR(selectedWeaponOnRearm), (weaponState _unit) select [0, 3]]; \ + }; \ TRACE_2("REARM_HOLSTER_WEAPON",_unit,currentWeapon _unit); \ _unit action ["SwitchWeapon", _unit, _unit, 299]; #define REARM_UNHOLSTER_WEAPON \ - _weaponSelect = _unit getVariable QGVAR(selectedWeaponOnRearm); \ + private _weaponSelect = _unit getVariable QGVAR(selectedWeaponOnRearm); \ if (!isNil "_weaponSelect") then { \ TRACE_2("REARM_UNHOLSTER_WEAPON",_unit,_weaponSelect); \ _unit selectWeapon _weaponSelect; \ diff --git a/addons/recoil/$PBOPREFIX$ b/addons/recoil/$PBOPREFIX$ index 1ab9ffa5e1f..efd38b75edf 100644 --- a/addons/recoil/$PBOPREFIX$ +++ b/addons/recoil/$PBOPREFIX$ @@ -1 +1 @@ -z\ace\addons\recoil \ No newline at end of file +z\ace\addons\recoil diff --git a/addons/recoil/CfgEventHandlers.hpp b/addons/recoil/CfgEventHandlers.hpp index 6c29240403a..f6503c2479b 100644 --- a/addons/recoil/CfgEventHandlers.hpp +++ b/addons/recoil/CfgEventHandlers.hpp @@ -1,4 +1,3 @@ - class Extended_PreStart_EventHandlers { class ADDON { init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); diff --git a/addons/recoil/CfgMoves.hpp b/addons/recoil/CfgMoves.hpp index 29bca9c81ab..aca9d93f3cd 100644 --- a/addons/recoil/CfgMoves.hpp +++ b/addons/recoil/CfgMoves.hpp @@ -1,4 +1,3 @@ - // Completely disable BI's camshake on fire. #define ACE_CAMSHAKEFIRE_BASE 0 #define ACE_CAMSHAKEFIRE_LESS 0 diff --git a/addons/recoil/CfgRecoils.hpp b/addons/recoil/CfgRecoils.hpp index c6482937ae2..b8d181e5664 100644 --- a/addons/recoil/CfgRecoils.hpp +++ b/addons/recoil/CfgRecoils.hpp @@ -1,4 +1,3 @@ - #define KICKBACK 1.4 #define MUZZLETEMP 1.2 @@ -15,28 +14,28 @@ class CfgRecoils { // doc: http://forums.bistudio.com/showthread.php?188999-Recoil-Overhaul-Feedback&s=dba8590ec07adb5ffa87f72d38dde6fc&p=2886744&viewfull=1#post2886744 // {horizontal axis position, vertical axis position, horizontal magnitude, vertical magnitude} muzzleOuter[] = { - QUOTE(0*MUZZLERIGHT_POS), - QUOTE(0.4*MUZZLECLIMB_POS), - QUOTE(0.5*MUZZLERIGHT_MAG), - QUOTE(0.6*MUZZLECLIMB_MAG) + 0*MUZZLERIGHT_POS, + 0.4*MUZZLECLIMB_POS, + 0.5*MUZZLERIGHT_MAG, + 0.6*MUZZLECLIMB_MAG }; // restricted area inside the outer ellipse where the recoil cannot end muzzleInner[] = {0,0.05,0.2,0.2}; // minimum and maximum interval for backward force kickBack[] = { - QUOTE(0.05*KICKBACK), - QUOTE(0.1*KICKBACK) + 0.05*KICKBACK, + 0.1*KICKBACK }; - permanent = QUOTE(0.1*MUZZLEPERM); - temporary = QUOTE(0.01*MUZZLETEMP); + permanent = 0.1*MUZZLEPERM; + temporary = 0.01*MUZZLETEMP; }; class recoil_default: Default { muzzleOuter[] = { - QUOTE(0.3*MUZZLERIGHT_POS), - QUOTE(1*MUZZLECLIMB_POS), - QUOTE(0.3*MUZZLERIGHT_MAG), - QUOTE(0.2*MUZZLECLIMB_MAG) + 0.3*MUZZLERIGHT_POS, + 1*MUZZLECLIMB_POS, + 0.3*MUZZLERIGHT_MAG, + 0.2*MUZZLECLIMB_MAG }; muzzleInner[] = {0, 0, @@ -44,528 +43,529 @@ class CfgRecoils { 0.1 }; kickBack[] = { - QUOTE(0.03*KICKBACK), - QUOTE(0.06*KICKBACK) + 0.03*KICKBACK, + 0.06*KICKBACK }; - permanent = QUOTE(0.1*MUZZLEPERM); - temporary = QUOTE(0.01*MUZZLETEMP); + permanent = 0.1*MUZZLEPERM; + temporary = 0.01*MUZZLETEMP; }; class recoil_mk20: recoil_default { muzzleOuter[] = { - QUOTE(0.2*MUZZLERIGHT_POS), - QUOTE(0.6*MUZZLECLIMB_POS), - QUOTE(0.2*MUZZLERIGHT_MAG), - QUOTE(0.2*MUZZLECLIMB_MAG) + 0.2*MUZZLERIGHT_POS, + 0.6*MUZZLECLIMB_POS, + 0.2*MUZZLERIGHT_MAG, + 0.2*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.01*KICKBACK), - QUOTE(0.03*KICKBACK) + 0.01*KICKBACK, + 0.03*KICKBACK }; - temporary = QUOTE(0.01*MUZZLETEMP); + temporary = 0.01*MUZZLETEMP; }; class recoil_mk20c: recoil_default { muzzleOuter[] = { - QUOTE(0.2*MUZZLERIGHT_POS), - QUOTE(0.8*MUZZLECLIMB_POS), - QUOTE(0.3*MUZZLERIGHT_MAG), - QUOTE(0.2*MUZZLECLIMB_MAG) + 0.2*MUZZLERIGHT_POS, + 0.8*MUZZLECLIMB_POS, + 0.3*MUZZLERIGHT_MAG, + 0.2*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.02*KICKBACK), - QUOTE(0.04*KICKBACK) + 0.02*KICKBACK, + 0.04*KICKBACK }; - temporary = QUOTE(0.015*MUZZLETEMP); + temporary = 0.015*MUZZLETEMP; }; class recoil_trg20: recoil_default { muzzleOuter[] = { - QUOTE(0.2*MUZZLERIGHT_POS), - QUOTE(1*MUZZLECLIMB_POS), - QUOTE(0.3*MUZZLERIGHT_MAG), - QUOTE(0.3*MUZZLECLIMB_MAG) + 0.2*MUZZLERIGHT_POS, + 1*MUZZLECLIMB_POS, + 0.3*MUZZLERIGHT_MAG, + 0.3*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.02*KICKBACK), - QUOTE(0.04*KICKBACK) + 0.02*KICKBACK, + 0.04*KICKBACK }; - temporary = QUOTE(0.015*MUZZLETEMP); + temporary = 0.015*MUZZLETEMP; }; class recoil_trg21: recoil_default { muzzleOuter[] = { - QUOTE(0.2*MUZZLERIGHT_POS), - QUOTE(0.8*MUZZLECLIMB_POS), - QUOTE(0.3*MUZZLERIGHT_MAG), - QUOTE(0.2*MUZZLECLIMB_MAG) + 0.2*MUZZLERIGHT_POS, + 0.8*MUZZLECLIMB_POS, + 0.3*MUZZLERIGHT_MAG, + 0.2*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.01*KICKBACK), - QUOTE(0.03*KICKBACK) + 0.01*KICKBACK, + 0.03*KICKBACK }; - temporary = QUOTE(0.01*MUZZLETEMP); + temporary = 0.01*MUZZLETEMP; }; class recoil_mx: recoil_default { muzzleOuter[] = { - QUOTE(0.3*MUZZLERIGHT_POS), - QUOTE(1*MUZZLECLIMB_POS), - QUOTE(0.4*MUZZLERIGHT_MAG), - QUOTE(0.3*MUZZLECLIMB_MAG) + 0.3*MUZZLERIGHT_POS, + 1*MUZZLECLIMB_POS, + 0.4*MUZZLERIGHT_MAG, + 0.3*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.02*KICKBACK), - QUOTE(0.04*KICKBACK) + 0.02*KICKBACK, + 0.04*KICKBACK }; - temporary = QUOTE(0.01*MUZZLETEMP); + temporary = 0.01*MUZZLETEMP; }; class recoil_mxc: recoil_default { muzzleOuter[] = { - QUOTE(0.3*MUZZLERIGHT_POS), - QUOTE(1.2*MUZZLECLIMB_POS), - QUOTE(0.4*MUZZLERIGHT_MAG), - QUOTE(0.3*MUZZLECLIMB_MAG) + 0.3*MUZZLERIGHT_POS, + 1.2*MUZZLECLIMB_POS, + 0.4*MUZZLERIGHT_MAG, + 0.3*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.03*KICKBACK), - QUOTE(0.06*KICKBACK) + 0.03*KICKBACK, + 0.06*KICKBACK }; - temporary = QUOTE(0.015*MUZZLETEMP); + temporary = 0.015*MUZZLETEMP; }; class recoil_sw: recoil_default { muzzleOuter[] = { - QUOTE(0.3*MUZZLERIGHT_POS), - QUOTE(0.8*MUZZLECLIMB_POS), - QUOTE(0.5*MUZZLERIGHT_MAG), - QUOTE(0.2*MUZZLECLIMB_MAG) + 0.3*MUZZLERIGHT_POS, + 0.8*MUZZLECLIMB_POS, + 0.5*MUZZLERIGHT_MAG, + 0.2*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.02*KICKBACK), - QUOTE(0.04*KICKBACK) + 0.02*KICKBACK, + 0.04*KICKBACK }; - temporary = QUOTE(0.01*MUZZLETEMP); //0.005*MUZZLETEMP; + temporary = 0.01*MUZZLETEMP; //0.005*MUZZLETEMP; }; class recoil_mxm: recoil_default { muzzleOuter[] = { - QUOTE(0.3*MUZZLERIGHT_POS), - QUOTE(0.8*MUZZLECLIMB_POS), - QUOTE(0.4*MUZZLERIGHT_MAG), - QUOTE(0.3*MUZZLECLIMB_MAG) + 0.3*MUZZLERIGHT_POS, + 0.8*MUZZLECLIMB_POS, + 0.4*MUZZLERIGHT_MAG, + 0.3*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.02*KICKBACK), - QUOTE(0.04*KICKBACK) + 0.02*KICKBACK, + 0.04*KICKBACK }; - temporary = QUOTE(0.01*MUZZLETEMP); + temporary = 0.01*MUZZLETEMP; }; class recoil_ktb: recoil_default { muzzleOuter[] = { - QUOTE(0.3*MUZZLERIGHT_POS), - QUOTE(1*MUZZLECLIMB_POS), - QUOTE(0.3*MUZZLERIGHT_MAG), - QUOTE(0.3*MUZZLECLIMB_MAG) + 0.3*MUZZLERIGHT_POS, + 1*MUZZLECLIMB_POS, + 0.3*MUZZLERIGHT_MAG, + 0.3*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.02*KICKBACK), - QUOTE(0.04*KICKBACK) + 0.02*KICKBACK, + 0.04*KICKBACK }; - temporary = QUOTE(0.01*MUZZLETEMP); + temporary = 0.01*MUZZLETEMP; }; class recoil_ktbc: recoil_default { muzzleOuter[] = { - QUOTE(0.3*MUZZLERIGHT_POS), - QUOTE(1.2*MUZZLECLIMB_POS), - QUOTE(0.3*MUZZLERIGHT_MAG), - QUOTE(0.3*MUZZLECLIMB_MAG) + 0.3*MUZZLERIGHT_POS, + 1.2*MUZZLECLIMB_POS, + 0.3*MUZZLERIGHT_MAG, + 0.3*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.03*KICKBACK), - QUOTE(0.06*KICKBACK) + 0.03*KICKBACK, + 0.06*KICKBACK }; - temporary = QUOTE(0.015*MUZZLETEMP); + temporary = 0.015*MUZZLETEMP; }; class recoil_smg_01: recoil_default { muzzleOuter[] = { - QUOTE(0.1*MUZZLERIGHT_POS), - QUOTE(0.8*MUZZLECLIMB_POS), - QUOTE(0.3*MUZZLERIGHT_MAG), - QUOTE(0.2*MUZZLECLIMB_MAG) + 0.1*MUZZLERIGHT_POS, + 0.8*MUZZLECLIMB_POS, + 0.3*MUZZLERIGHT_MAG, + 0.2*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.01*KICKBACK), - QUOTE(0.03*KICKBACK) + 0.01*KICKBACK, + 0.03*KICKBACK }; - temporary = QUOTE(0.015*MUZZLETEMP); + temporary = 0.015*MUZZLETEMP; }; class recoil_smg_02: recoil_default { muzzleOuter[] = { - QUOTE(0.1*MUZZLERIGHT_POS), - QUOTE(0.6*MUZZLECLIMB_POS), - QUOTE(0.2*MUZZLERIGHT_MAG), - QUOTE(0.2*MUZZLECLIMB_MAG) + 0.1*MUZZLERIGHT_POS, + 0.6*MUZZLECLIMB_POS, + 0.2*MUZZLERIGHT_MAG, + 0.2*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.01*KICKBACK), - QUOTE(0.02*KICKBACK) + 0.01*KICKBACK, + 0.02*KICKBACK }; - temporary = QUOTE(0.01*MUZZLETEMP); + temporary = 0.01*MUZZLETEMP; }; class recoil_pdw: recoil_default { muzzleOuter[] = { - QUOTE(0.2*MUZZLERIGHT_POS), - QUOTE(1*MUZZLECLIMB_POS), - QUOTE(0.3*MUZZLERIGHT_MAG), - QUOTE(0.3*MUZZLECLIMB_MAG) + 0.2*MUZZLERIGHT_POS, + 1*MUZZLECLIMB_POS, + 0.3*MUZZLERIGHT_MAG, + 0.3*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.02*KICKBACK), - QUOTE(0.04*KICKBACK) + 0.02*KICKBACK, + 0.04*KICKBACK }; - temporary = QUOTE(0.02*MUZZLETEMP); + temporary = 0.02*MUZZLETEMP; }; class recoil_sdar: recoil_default { muzzleOuter[] = { - QUOTE(0.2*MUZZLERIGHT_POS), - QUOTE(1*MUZZLECLIMB_POS), - QUOTE(0.3*MUZZLERIGHT_MAG), - QUOTE(0.3*MUZZLECLIMB_MAG) + 0.2*MUZZLERIGHT_POS, + 1*MUZZLECLIMB_POS, + 0.3*MUZZLERIGHT_MAG, + 0.3*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.02*KICKBACK), - QUOTE(0.04*KICKBACK) + 0.02*KICKBACK, + 0.04*KICKBACK }; - temporary = QUOTE(0.01*MUZZLETEMP); + temporary = 0.01*MUZZLETEMP; }; class recoil_pistol_p07: recoil_default { muzzleOuter[] = { - QUOTE(0.2*MUZZLERIGHT_POS), - QUOTE(1*MUZZLECLIMB_POS), - QUOTE(0.2*MUZZLERIGHT_MAG), - QUOTE(0.3*MUZZLECLIMB_MAG) + 0.2*MUZZLERIGHT_POS, + 1*MUZZLECLIMB_POS, + 0.2*MUZZLERIGHT_MAG, + 0.3*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.03*KICKBACK), - QUOTE(0.06*KICKBACK) + 0.03*KICKBACK, + 0.06*KICKBACK }; - temporary = QUOTE(0.03*MUZZLETEMP); + temporary = 0.03*MUZZLETEMP; }; class recoil_pistol_rook40: recoil_default { muzzleOuter[] = { - QUOTE(0.2*MUZZLERIGHT_POS), - QUOTE(1*MUZZLECLIMB_POS), - QUOTE(0.2*MUZZLERIGHT_MAG), - QUOTE(0.3*MUZZLECLIMB_MAG) + 0.2*MUZZLERIGHT_POS, + 1*MUZZLECLIMB_POS, + 0.2*MUZZLERIGHT_MAG, + 0.3*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.03*KICKBACK), - QUOTE(0.06*KICKBACK) + 0.03*KICKBACK, + 0.06*KICKBACK }; - temporary = QUOTE(0.02*MUZZLETEMP); + temporary = 0.02*MUZZLETEMP; }; class recoil_pistol_acpc2: recoil_default { muzzleOuter[] = { - QUOTE(0.2*MUZZLERIGHT_POS), - QUOTE(1.5*MUZZLECLIMB_POS), - QUOTE(0.2*MUZZLERIGHT_MAG), - QUOTE(0.3*MUZZLECLIMB_MAG) + 0.2*MUZZLERIGHT_POS, + 1.5*MUZZLECLIMB_POS, + 0.2*MUZZLERIGHT_MAG, + 0.3*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.04*KICKBACK), - QUOTE(0.08*KICKBACK) + 0.04*KICKBACK, + 0.08*KICKBACK }; - temporary = QUOTE(0.04*MUZZLETEMP); + temporary = 0.04*MUZZLETEMP; }; class recoil_pistol_4five: recoil_default { muzzleOuter[] = { - QUOTE(0.2*MUZZLERIGHT_POS), - QUOTE(1.5*MUZZLECLIMB_POS), - QUOTE(0.2*MUZZLERIGHT_MAG), - QUOTE(0.3*MUZZLECLIMB_MAG) + 0.2*MUZZLERIGHT_POS, + 1.5*MUZZLECLIMB_POS, + 0.2*MUZZLERIGHT_MAG, + 0.3*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.04*KICKBACK), - QUOTE(0.08*KICKBACK) + 0.04*KICKBACK, + 0.08*KICKBACK }; - temporary = QUOTE(0.06*MUZZLETEMP); + temporary = 0.06*MUZZLETEMP; }; class recoil_pistol_zubr: recoil_default { muzzleOuter[] = { - QUOTE(0.2*MUZZLERIGHT_POS), - QUOTE(1.5*MUZZLECLIMB_POS), - QUOTE(0.2*MUZZLERIGHT_MAG), - QUOTE(0.3*MUZZLECLIMB_MAG) + 0.2*MUZZLERIGHT_POS, + 1.5*MUZZLECLIMB_POS, + 0.2*MUZZLERIGHT_MAG, + 0.3*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.04*KICKBACK), - QUOTE(0.08*KICKBACK) + 0.04*KICKBACK, + 0.08*KICKBACK }; - temporary = QUOTE(0.08*MUZZLETEMP); + temporary = 0.08*MUZZLETEMP; }; class recoil_pistol_signal: recoil_default { muzzleOuter[] = { - QUOTE(0.2*MUZZLERIGHT_POS), - QUOTE(1.5*MUZZLECLIMB_POS), - QUOTE(0.2*MUZZLERIGHT_MAG), - QUOTE(0.3*MUZZLECLIMB_MAG) + 0.2*MUZZLERIGHT_POS, + 1.5*MUZZLECLIMB_POS, + 0.2*MUZZLERIGHT_MAG, + 0.3*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.02*KICKBACK), - QUOTE(0.04*KICKBACK) + 0.02*KICKBACK, + 0.04*KICKBACK }; - temporary = QUOTE(0.02*MUZZLETEMP); + temporary = 0.02*MUZZLETEMP; }; class recoil_rpg: recoil_default { muzzleOuter[] = { - QUOTE(2*MUZZLERIGHT_POS), - QUOTE(3*MUZZLECLIMB_POS), - QUOTE(1*MUZZLERIGHT_MAG), - QUOTE(0.5*MUZZLECLIMB_MAG) + 0.0*MUZZLERIGHT_POS, + 0.1*MUZZLECLIMB_POS, + 0.3*MUZZLERIGHT_MAG, + 0.5*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.08*KICKBACK), - QUOTE(0.1*KICKBACK) + 0.0*KICKBACK, + 0.08*KICKBACK }; - temporary = QUOTE(0.1*MUZZLETEMP); + permanent = 1.0*MUZZLEPERM; + temporary = 0.05*MUZZLETEMP; }; class recoil_nlaw: recoil_default { muzzleOuter[] = { - QUOTE(2*MUZZLERIGHT_POS), - QUOTE(3*MUZZLECLIMB_POS), - QUOTE(1*MUZZLERIGHT_MAG), - QUOTE(0.5*MUZZLECLIMB_MAG) + 2*MUZZLERIGHT_POS, + 3*MUZZLECLIMB_POS, + 1*MUZZLERIGHT_MAG, + 0.5*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.06*KICKBACK), - QUOTE(0.08*KICKBACK) + 0.06*KICKBACK, + 0.08*KICKBACK }; - temporary = QUOTE(0.08*MUZZLETEMP); + temporary = 0.08*MUZZLETEMP; }; class recoil_titan_long: recoil_default { muzzleOuter[] = { - QUOTE(2*MUZZLERIGHT_POS), - QUOTE(3*MUZZLECLIMB_POS), - QUOTE(1*MUZZLERIGHT_MAG), - QUOTE(0.5*MUZZLECLIMB_MAG) + 2*MUZZLERIGHT_POS, + 3*MUZZLECLIMB_POS, + 1*MUZZLERIGHT_MAG, + 0.5*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.1*KICKBACK), - QUOTE(0.12*KICKBACK) + 0.1*KICKBACK, + 0.12*KICKBACK }; - temporary = QUOTE(0.15*MUZZLETEMP); + temporary = 0.15*MUZZLETEMP; }; class recoil_titan_short: recoil_default { muzzleOuter[] = { - QUOTE(2*MUZZLERIGHT_POS), - QUOTE(3*MUZZLECLIMB_POS), - QUOTE(1*MUZZLERIGHT_MAG), - QUOTE(0.5*MUZZLECLIMB_MAG) + 2*MUZZLERIGHT_POS, + 3*MUZZLECLIMB_POS, + 1*MUZZLERIGHT_MAG, + 0.5*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.1*KICKBACK), - QUOTE(0.12*KICKBACK) + 0.1*KICKBACK, + 0.12*KICKBACK }; - temporary = QUOTE(0.12*MUZZLETEMP); + temporary = 0.12*MUZZLETEMP; }; class recoil_mk200: recoil_default { muzzleOuter[] = { - QUOTE(0.4*MUZZLERIGHT_POS), - QUOTE(0.6*MUZZLECLIMB_POS), - QUOTE(0.6*MUZZLERIGHT_MAG), - QUOTE(0.2*MUZZLECLIMB_MAG) + 0.4*MUZZLERIGHT_POS, + 0.6*MUZZLECLIMB_POS, + 0.6*MUZZLERIGHT_MAG, + 0.2*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.03*KICKBACK), - QUOTE(0.06*KICKBACK) + 0.03*KICKBACK, + 0.06*KICKBACK }; - temporary = QUOTE(0.01*MUZZLETEMP); //0.005*MUZZLETEMP; + temporary = 0.01*MUZZLETEMP; //0.005*MUZZLETEMP; }; class recoil_zafir: recoil_default { muzzleOuter[] = { - QUOTE(0.5*MUZZLERIGHT_POS), - QUOTE(1*MUZZLECLIMB_POS), - QUOTE(0.7*MUZZLERIGHT_MAG), - QUOTE(0.3*MUZZLECLIMB_MAG) + 0.5*MUZZLERIGHT_POS, + 1*MUZZLECLIMB_POS, + 0.7*MUZZLERIGHT_MAG, + 0.3*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.02*KICKBACK), - QUOTE(0.08*KICKBACK) + 0.02*KICKBACK, + 0.08*KICKBACK }; - temporary = QUOTE(0.01*MUZZLETEMP); //0.005*MUZZLETEMP; + temporary = 0.01*MUZZLETEMP; //0.005*MUZZLETEMP; }; class recoil_m320: recoil_default { muzzleOuter[] = { - QUOTE(1*MUZZLERIGHT_POS), - QUOTE(3*MUZZLECLIMB_POS), - QUOTE(0.5*MUZZLERIGHT_MAG), - QUOTE(0.6*MUZZLECLIMB_MAG) + 1*MUZZLERIGHT_POS, + 3*MUZZLECLIMB_POS, + 0.5*MUZZLERIGHT_MAG, + 0.6*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.08*KICKBACK), - QUOTE(0.1*KICKBACK) + 0.08*KICKBACK, + 0.1*KICKBACK }; - temporary = QUOTE(0.02*MUZZLETEMP); + temporary = 0.02*MUZZLETEMP; }; class recoil_gm6: recoil_default { muzzleOuter[] = { - QUOTE(1.4*MUZZLERIGHT_POS), - QUOTE(3.5*MUZZLECLIMB_POS), - QUOTE(0.7*MUZZLERIGHT_MAG), - QUOTE(0.8*MUZZLECLIMB_MAG) + 1.4*MUZZLERIGHT_POS, + 3.5*MUZZLECLIMB_POS, + 0.7*MUZZLERIGHT_MAG, + 0.8*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.1*KICKBACK), - QUOTE(0.12*KICKBACK) + 0.1*KICKBACK, + 0.12*KICKBACK }; - temporary = QUOTE(0.025*MUZZLETEMP); + temporary = 0.025*MUZZLETEMP; }; class recoil_ebr: recoil_default { muzzleOuter[] = { - QUOTE(0.4*MUZZLERIGHT_POS), - QUOTE(1.5*MUZZLECLIMB_POS), - QUOTE(0.6*MUZZLERIGHT_MAG), - QUOTE(0.4*MUZZLECLIMB_MAG) + 0.4*MUZZLERIGHT_POS, + 1.5*MUZZLECLIMB_POS, + 0.6*MUZZLERIGHT_MAG, + 0.4*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.04*KICKBACK), - QUOTE(0.07*KICKBACK) + 0.04*KICKBACK, + 0.07*KICKBACK }; - temporary = QUOTE(0.01*MUZZLETEMP); + temporary = 0.01*MUZZLETEMP; }; class recoil_dmr_01: recoil_default { muzzleOuter[] = { - QUOTE(0.5*MUZZLERIGHT_POS), - QUOTE(2*MUZZLECLIMB_POS), - QUOTE(0.5*MUZZLERIGHT_MAG), - QUOTE(0.5*MUZZLECLIMB_MAG) + 0.5*MUZZLERIGHT_POS, + 2*MUZZLECLIMB_POS, + 0.5*MUZZLERIGHT_MAG, + 0.5*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.03*KICKBACK), - QUOTE(0.08*KICKBACK) + 0.03*KICKBACK, + 0.08*KICKBACK }; - temporary = QUOTE(0.015*MUZZLETEMP); + temporary = 0.015*MUZZLETEMP; }; class recoil_dmr_02: recoil_default { muzzleOuter[] = { - QUOTE(0.5*MUZZLERIGHT_POS), - QUOTE(2.5*MUZZLECLIMB_POS), - QUOTE(0.6*MUZZLERIGHT_MAG), - QUOTE(0.5*MUZZLECLIMB_MAG) + 0.5*MUZZLERIGHT_POS, + 2.5*MUZZLECLIMB_POS, + 0.6*MUZZLERIGHT_MAG, + 0.5*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.06*KICKBACK), - QUOTE(0.08*KICKBACK) + 0.06*KICKBACK, + 0.08*KICKBACK }; - temporary = QUOTE(0.01*MUZZLETEMP); + temporary = 0.01*MUZZLETEMP; }; class recoil_dmr_03: recoil_default { muzzleOuter[] = { - QUOTE(0.3*MUZZLERIGHT_POS), - QUOTE(1.5*MUZZLECLIMB_POS), - QUOTE(0.5*MUZZLERIGHT_MAG), - QUOTE(0.4*MUZZLECLIMB_MAG) + 0.3*MUZZLERIGHT_POS, + 1.5*MUZZLECLIMB_POS, + 0.5*MUZZLERIGHT_MAG, + 0.4*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.03*KICKBACK), - QUOTE(0.06*KICKBACK) + 0.03*KICKBACK, + 0.06*KICKBACK }; - temporary = QUOTE(0.005*MUZZLETEMP); + temporary = 0.005*MUZZLETEMP; }; class recoil_dmr_04: recoil_default { muzzleOuter[] = { - QUOTE(0.4*MUZZLERIGHT_POS), - QUOTE(1.5*MUZZLECLIMB_POS), - QUOTE(0.5*MUZZLERIGHT_MAG), - QUOTE(0.4*MUZZLECLIMB_MAG) + 0.4*MUZZLERIGHT_POS, + 1.5*MUZZLECLIMB_POS, + 0.5*MUZZLERIGHT_MAG, + 0.4*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.02*KICKBACK), - QUOTE(0.04*KICKBACK) + 0.02*KICKBACK, + 0.04*KICKBACK }; - temporary = QUOTE(0.015*MUZZLETEMP); + temporary = 0.015*MUZZLETEMP; }; class recoil_dmr_05: recoil_default { muzzleOuter[] = { - QUOTE(0.5*MUZZLERIGHT_POS), - QUOTE(2.5*MUZZLECLIMB_POS), - QUOTE(0.8*MUZZLERIGHT_MAG), - QUOTE(0.6*MUZZLECLIMB_MAG) + 0.5*MUZZLERIGHT_POS, + 2.5*MUZZLECLIMB_POS, + 0.8*MUZZLERIGHT_MAG, + 0.6*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.08*KICKBACK), - QUOTE(0.1*KICKBACK) + 0.08*KICKBACK, + 0.1*KICKBACK }; - temporary = QUOTE(0.01*MUZZLETEMP); + temporary = 0.01*MUZZLETEMP; }; class recoil_dmr_06: recoil_default { muzzleOuter[] = { - QUOTE(0.5*MUZZLERIGHT_POS), - QUOTE(2*MUZZLECLIMB_POS), - QUOTE(0.7*MUZZLERIGHT_MAG), - QUOTE(0.5*MUZZLECLIMB_MAG) + 0.5*MUZZLERIGHT_POS, + 2*MUZZLECLIMB_POS, + 0.7*MUZZLERIGHT_MAG, + 0.5*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.05*KICKBACK), - QUOTE(0.1*KICKBACK) + 0.05*KICKBACK, + 0.1*KICKBACK }; - temporary = QUOTE(0.01*MUZZLETEMP); + temporary = 0.01*MUZZLETEMP; }; class recoil_mmg_01: recoil_default { muzzleOuter[] = { - QUOTE(0.6*MUZZLERIGHT_POS), - QUOTE(1.5*MUZZLECLIMB_POS), - QUOTE(0.8*MUZZLERIGHT_MAG), - QUOTE(0.3*MUZZLECLIMB_MAG) + 0.6*MUZZLERIGHT_POS, + 1.5*MUZZLECLIMB_POS, + 0.8*MUZZLERIGHT_MAG, + 0.3*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.02*KICKBACK), - QUOTE(0.08*KICKBACK) + 0.02*KICKBACK, + 0.08*KICKBACK }; - temporary = QUOTE(0.01*MUZZLETEMP); //0.005*MUZZLETEMP; + temporary = 0.01*MUZZLETEMP; //0.005*MUZZLETEMP; }; class recoil_mmg_02: recoil_default { muzzleOuter[] = { - QUOTE(0.5*MUZZLERIGHT_POS), - QUOTE(1.5*MUZZLECLIMB_POS), - QUOTE(0.6*MUZZLERIGHT_MAG), - QUOTE(0.4*MUZZLECLIMB_MAG) + 0.5*MUZZLERIGHT_POS, + 1.5*MUZZLECLIMB_POS, + 0.6*MUZZLERIGHT_MAG, + 0.4*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.04*KICKBACK), - QUOTE(0.08*KICKBACK) + 0.04*KICKBACK, + 0.08*KICKBACK }; - temporary = QUOTE(0.01*MUZZLETEMP); //0.005*MUZZLETEMP; + temporary = 0.01*MUZZLETEMP; //0.005*MUZZLETEMP; }; }; diff --git a/addons/recoil/XEH_PREP.hpp b/addons/recoil/XEH_PREP.hpp index 9e34c47492b..90c7c9cccf8 100644 --- a/addons/recoil/XEH_PREP.hpp +++ b/addons/recoil/XEH_PREP.hpp @@ -1,2 +1 @@ - PREP(camshake); diff --git a/addons/recoil/XEH_preInit.sqf b/addons/recoil/XEH_preInit.sqf index ffd1bfc414d..1566a79fd48 100644 --- a/addons/recoil/XEH_preInit.sqf +++ b/addons/recoil/XEH_preInit.sqf @@ -7,4 +7,6 @@ PREP_RECOMPILE_START; #include "XEH_PREP.hpp" PREP_RECOMPILE_END; +GVAR(recoilCache) = createHashMap; + ADDON = true; diff --git a/addons/recoil/functions/fnc_camshake.sqf b/addons/recoil/functions/fnc_camshake.sqf index d68da81db75..9c6e78608f8 100644 --- a/addons/recoil/functions/fnc_camshake.sqf +++ b/addons/recoil/functions/fnc_camshake.sqf @@ -1,17 +1,17 @@ #include "..\script_component.hpp" /* - * Author: Orginal by Ryan Schultz, edited by KoffeinFlummi, commy2 + * Author: Original by Ryan Schultz, edited by KoffeinFlummi, commy2 * Adds camera shake when firing. Called from the unified fired EH only for the local player. * From TMR: Small Arms * * Arguments: - * None. Parameters inherited from EFUNC(common,firedEH) + * Parameters inherited from EFUNC(common,firedEH) * * Return Value: * None * * Example: - * [player, (currentWeapon player), (currentMuzzle player)] call ace_recoil_fnc_camshake; + * [player, currentWeapon player, currentMuzzle player] call ace_recoil_fnc_camshake * * Public: No */ @@ -28,20 +28,19 @@ if (toLowerANSI _weapon in ["throw", "put"]) exitWith {}; private _powerMod = ([0, -0.1, -0.1, 0, -0.2] select (["STAND", "CROUCH", "PRONE", "UNDEFINED", ""] find stance _unit)) + ([0, -1, 0, -1] select (["INTERNAL", "EXTERNAL", "GUNNER", "GROUP"] find cameraView)); -// to get camshake read kickback -private _recoil = missionNamespace getVariable format [QGVAR(%1-%2), _weapon, _muzzle]; - -if (isNil "_recoil") then { +// Get camshake read kickback +private _recoil = GVAR(recoilCache) getOrDefaultCall [_weapon + _muzzle, { private _config = configFile >> "CfgWeapons" >> _weapon; - if (_muzzle == _weapon) then { - _recoil = getText (_config >> "recoil") + private _recoil = if (_muzzle == _weapon) then { + getText (_config >> "recoil") } else { - _recoil = getText (_config >> _muzzle >> "recoil") + getText (_config >> _muzzle >> "recoil") }; if (isClass (configFile >> "CfgRecoils" >> _recoil)) then { _recoil = getArray (configFile >> "CfgRecoils" >> _recoil >> "kickBack"); + if (count _recoil < 2) then { _recoil = [0, 0]; }; @@ -51,17 +50,20 @@ if (isNil "_recoil") then { TRACE_3("Caching Recoil config",_weapon,_muzzle,_recoil); - // parse numbers - _recoil set [0, call compile format ["%1", _recoil select 0]]; - _recoil set [1, call compile format ["%1", _recoil select 1]]; + // Ensure format is correct + _recoil resize [2, 0]; - missionNamespace setVariable [format [QGVAR(%1-%2), _weapon, _muzzle], _recoil]; -}; + // Parse numbers + _recoil apply { if (_x isEqualType 0) then { _x } else { call compile format ["%1", _x] } } // return +}, true]; private _powerCoef = RECOIL_COEF * linearConversion [0, 1, random 1, _recoil select 0, _recoil select 1, false]; if (isWeaponRested _unit) then {_powerMod = _powerMod - 0.07}; if (isWeaponDeployed _unit) then {_powerMod = _powerMod - 0.11}; +if (_weapon isEqualTo secondaryWeapon _unit) then { + _powerCoef = _powerCoef + 25.0; +}; private _camshake = [ _powerCoef * (BASE_POWER + _powerMod) max 0, diff --git a/addons/refuel/ACE_Refuel_Positions.hpp b/addons/refuel/ACE_Refuel_Positions.hpp index 78af5b6d48d..0db8667751f 100644 --- a/addons/refuel/ACE_Refuel_Positions.hpp +++ b/addons/refuel/ACE_Refuel_Positions.hpp @@ -57,22 +57,37 @@ class GVAR(positions) { {"Land_Benzina_schnell", {{592,7505,0},{804,1445,0},{3132,3129,0}}}, {"Land_fs_feed_F", {{1920,4960,0},{5052,4703,1},{9456,9277,0}}}, {"Land_FuelStation_01_pump_F", {{2378,6248,0},{7092,534,0}}}, - {"Land_Ind_FuelStation_Feed_EP1", {{4788,5525,0}}} + {"Land_Ind_FuelStation_Feed_EP1", {{3920,4105,0},{4788,5525,0}}} + }; + go_map_fjord[] = { /* Fjord */ + {"Land_fs_feed_F", {{26,14296,0},{121,14298,0},{7480,1812,0}}}, + {"Land_FuelStation_01_pump_F", {{66,14293,0}}}, + {"Land_FuelStation_Feed_F", {{37,14301,0}}} }; IslaPera[] = { /* Isla Pera */ {"Land_fs_feed_F", {{1855,2866,0}}}, {"Land_FuelStation_01_pump_malevil_F", {{3981,2065,0},{5306,8796,0},{9236,4287,0}}} }; + egl_laghisola[] = { /* Laghisola */ + {"Land_fs_feed_F", {{281,595,0},{1926,5751,0},{4904,6278,0}}}, + {"Land_FuelStation_01_pump_F", {{1347,8907,0},{6478,2391,0}}} + }; VTF_Lybor[] = { /* Lybor */ {"Land_FuelStation_03_pump_F", {{3879,3823,0}}}, {"Land_FuelStation_Feed_F", {{1831,2694,0},{2175,3323,0},{3304,2981,0},{4271,3024,0}}} }; + mehland[] = { /* Mehland */ + {"Land_fs_feed_F", {{13469,9984,0},{16773,16454,0},{17389,14420,0},{17785,10415,0},{19155,15564,0},{19373,13170,0}}}, + {"Land_FuelStation_01_pump_F", {{2122,15875,0},{2238,8505,0},{15134,19009,0},{17909,9856,1},{18595,8701,0},{18691,8629,1},{18947,15114,0}}}, + {"Land_FuelStation_03_pump_F", {{4136,13875,0},{6356,12183,0},{7677,10989,2},{8880,17775,0},{13881,19437,1}}} + }; rof_mok[] = { /* Mull of Kintyre, Scotland */ {"Land_A_FuelStation_Feed", {{12837,5124,1},{15271,17533,0},{19453,21896,0}}}, {"Land_fs_feed_F", {{7492,17369,0}}}, {"Land_Fuelstation", {{10284,18679,0}}}, {"Land_Ind_FuelStation_Feed_EP1", {{9762,16325,0}}} }; + FDF_Isle1_a[] = { /* Podagorsk */ {"Land_A_FuelStation_Feed", {{7980,10293,0},{8356,7555,0},{10930,6878,0},{11999,10476,0},{12692,6317,0}}}}; pulau[] = { /* Pulau */ {"Land_fs_feed_F", {{2368,3128,0},{4891,7168,0},{7358,7368,0}}}, {"Land_FuelStation_Feed_F", {{5994,5789,0}}} @@ -93,4 +108,9 @@ class GVAR(positions) { {"Land_FuelStation_01_pump_malevil_F", {{7072,3676,0}}}, {"Land_FuelStation_Feed_F", {{4678,3971,0},{6391,5174,0}}} }; + yulakia[] = { /* Yulakia v1.0beta6 */ + {"Land_fs_feed_F", {{10424,6328,0}}}, + {"Land_FuelStation_03_pump_F", {{5964,8016,0}}}, + {"Land_Fuelstation_army", {{410,10339,0},{1892,2501,0},{4157,9653,0},{9629,2467,0},{10018,4642,0},{10696,7289,0},{11325,8200,0},{11647,7639,0}}} + }; }; diff --git a/addons/refuel/CfgVehicles.hpp b/addons/refuel/CfgVehicles.hpp index 44575a141d7..dbbcaf04d1c 100644 --- a/addons/refuel/CfgVehicles.hpp +++ b/addons/refuel/CfgVehicles.hpp @@ -238,6 +238,20 @@ class CfgVehicles { // Patria = LAV GVAR(fuelCapacity) = 269; }; + class APC_Wheeled_02_base_F: Wheeled_APC_F { + class EGVAR(interaction,anims); + }; + class APC_Wheeled_02_base_v2_F: APC_Wheeled_02_base_F { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class showCanisters { + phase = 0; + positions[] = {{-1.188, -3.87, -0.769}, {1.638, -3.87, -0.769}}; + items[] = {"Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F"}; + name = CSTRING(TakeFuelCanister); + text = CSTRING(TakeFuelCanisterAction); + }; + }; + }; class Truck_F: Car_F { GVAR(fuelCapacity) = 400; @@ -308,12 +322,14 @@ class CfgVehicles { class MBT_01_base_F: Tank_F { // Merkava IV GVAR(fuelCapacity) = 1400; + class EGVAR(interaction,anims); }; class MBT_02_base_F: Tank_F { // T100 Black Eagle // Assuming T80 GVAR(fuelCapacity) = 1100; + class EGVAR(interaction,anims); }; class MBT_03_base_F: Tank_F { @@ -324,11 +340,37 @@ class CfgVehicles { class MBT_01_arty_base_F: MBT_01_base_F { // Assuming similar 2S3 GVAR(fuelCapacity) = 830; + + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class showCanisters { + phase = 0; + // Rotate interactions with turret rotation + positions[] = { + "[0, -2.5, 0] vectorAdd ([[1.6, -2.4, -0.3], [0, 0, 1], deg (_target animationPhase 'MainTurret')] call CBA_fnc_vectRotate3D)", + "[0, -2.5, 0] vectorAdd ([[1.8, 0.55, -0.7], [0, 0, 1], deg (_target animationPhase 'MainTurret')] call CBA_fnc_vectRotate3D)", + "[0, -2.5, 0] vectorAdd ([[-1.8, 0.55, -0.7], [0, 0, 1], deg (_target animationPhase 'MainTurret')] call CBA_fnc_vectRotate3D)" + }; + items[] = {"Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F"}; + name = CSTRING(TakeFuelCanister); + text = CSTRING(TakeFuelCanisterAction); + }; + }; }; class MBT_02_arty_base_F: MBT_02_base_F { // Assuming similar 2S3 GVAR(fuelCapacity) = 830; + + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class showCanisters { + phase = 0; + // Rotate interactions with turret rotation + positions[] = {"[0, -2.1, 0] vectorAdd ([[1.6, -2.65, -0.3], [0, 0, 1], deg (_target animationPhase 'MainTurret')] call CBA_fnc_vectRotate3D)"}; + items[] = {"Land_CanisterFuel_F"}; + name = CSTRING(TakeFuelCanister); + text = CSTRING(TakeFuelCanisterAction); + }; + }; }; class Heli_Light_02_base_F: Helicopter_Base_H { diff --git a/addons/refuel/XEH_postInit.sqf b/addons/refuel/XEH_postInit.sqf index d007266e5ff..4edd18de148 100644 --- a/addons/refuel/XEH_postInit.sqf +++ b/addons/refuel/XEH_postInit.sqf @@ -66,6 +66,7 @@ ["MouseButtonDown", LINKFUNC(onMouseButtonDown)] call CBA_fnc_addDisplayHandler; + //IGNORE_PRIVATE_WARNING ["_player", "_target"]; GVAR(mainAction) = [ QGVAR(Refuel), localize LSTRING(Refuel), diff --git a/addons/refuel/dev/exportTerrainRefuelPositions.sqf b/addons/refuel/dev/exportTerrainRefuelPositions.sqf index c7f9abfb2fd..e096af47b89 100644 --- a/addons/refuel/dev/exportTerrainRefuelPositions.sqf +++ b/addons/refuel/dev/exportTerrainRefuelPositions.sqf @@ -1,7 +1,14 @@ +#include "\z\ace\addons\refuel\script_component.hpp" + // call compileScript ["z\ace\addons\refuel\dev\exportTerrainRefuelPositions.sqf"] -// can be run in Eden Editor console +// copies to clipboard header and positions +// returns total found feed and position count, messages and output +// can run in Eden Editor console -#include "\z\ace\addons\refuel\script_component.hpp" +// use this command to move player to needed position: +// player setPos [15121,19011]; +// use this command to view fuel feeds around player position +// ["f", {count (getPos player nearObjects ["Land_fs_feed_F", 30])}] call ace_common_fnc_watchVariable; { if (!isArray (configFile >> QGVAR(positions) >> configName _x)) then { @@ -38,7 +45,7 @@ private _pos = []; _object = _x; _pos = ASLToAGL getPosASL _object; if (-1 < _positions findIf {60 > _x distance _pos && {20 < _x distance _pos}}) then { - _message = "INCREASE DISTANCE " + str _pos; + _message = "INCREASE SEARCH DISTANCE " + str _pos; }; if (-1 == _positions findIf {20 > _x distance _pos}) then { _positions pushBack (_pos apply {round _x}); @@ -66,10 +73,24 @@ if (_checkCount != _totalCount) then { _message = "WRONG COUNT " + str _checkCount; }; +private _cfgPositions = configFile >> QGVAR(positions) >> worldName; +if (isArray _cfgPositions) then { + private _currentPositionsPumps = []; + { + _x params ["_class", "_positions"]; + { + _currentPositionsPumps insert [-1, _x nearObjects [_class, 30], true]; + } forEach _positions; + } forEach getArray _cfgPositions; + if (_checkCount != count _currentPositionsPumps) then { + _message = "WRONG CURRENT " + str count _currentPositionsPumps; + }; +}; + // export text private _nl = toString [10]; private _multipleBasePumps = 1 < count _basePumps; -private _output = [format [" %1[] = { /* %2 */", worldName, getText (configfile >> "CfgWorlds" >> worldName >> "description")]]; +private _output = [format [" %1[] = { /* %2 */", worldName, getText (configFile >> "CfgWorlds" >> worldName >> "description")]]; { if (_forEachIndex > 0) then {_output pushBack ","}; _x params ["_class", "_positions"]; diff --git a/addons/refuel/functions/fnc_connectNozzleAction.sqf b/addons/refuel/functions/fnc_connectNozzleAction.sqf index 502e1dc3a41..1a022b6e768 100644 --- a/addons/refuel/functions/fnc_connectNozzleAction.sqf +++ b/addons/refuel/functions/fnc_connectNozzleAction.sqf @@ -62,7 +62,7 @@ if (_bestPosASL isEqualTo []) exitWith { //Move it out slightly, for visibility sake (better to look a little funny than be embedded//sunk in the hull and be useless) _bestPosASL = _bestPosASL vectorAdd ((_bestPosASL vectorFromTo _startingPosASL) vectorMultiply 0.05); -private _attachPosModel = _sink worldToModel (ASLtoAGL _bestPosASL); +private _attachPosModel = _sink worldToModel (ASLToAGL _bestPosASL); [ GVAR(progressDuration), diff --git a/addons/refuel/functions/fnc_handleDisconnect.sqf b/addons/refuel/functions/fnc_handleDisconnect.sqf index cf4b37cce9a..3aa1831a186 100644 --- a/addons/refuel/functions/fnc_handleDisconnect.sqf +++ b/addons/refuel/functions/fnc_handleDisconnect.sqf @@ -24,4 +24,4 @@ private _nozzle = _unit getVariable [QGVAR(nozzle), objNull]; if (isNull _nozzle) exitWith {}; [_unit, _nozzle] call FUNC(dropNozzle); -[_unit, "forceWalk", "ACE_refuel", false] call EFUNC(common,statusEffect_set); +[_unit, "forceWalk", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); diff --git a/addons/refuel/functions/fnc_makeJerryCan.sqf b/addons/refuel/functions/fnc_makeJerryCan.sqf index 31a91a30d7b..29b5dd98fcd 100644 --- a/addons/refuel/functions/fnc_makeJerryCan.sqf +++ b/addons/refuel/functions/fnc_makeJerryCan.sqf @@ -38,6 +38,8 @@ if (isServer) then { [QGVAR(jerryCanInitalized), [_target]] call CBA_fnc_globalevent; }; +//IGNORE_PRIVATE_WARNING ["_player", "_target"]; + // Main Action private _action = [QGVAR(Refuel), localize LSTRING(Refuel), diff --git a/addons/refuel/functions/fnc_returnNozzle.sqf b/addons/refuel/functions/fnc_returnNozzle.sqf index ea84f6a5180..eba836ed8a1 100644 --- a/addons/refuel/functions/fnc_returnNozzle.sqf +++ b/addons/refuel/functions/fnc_returnNozzle.sqf @@ -43,12 +43,12 @@ if (isNull _nozzle || {_source != _nozzle getVariable QGVAR(source)}) exitWith { deleteVehicle _helper; }; deleteVehicle _nozzle; - + // Restore ability to drag and carry this object _source setVariable [QEGVAR(dragging,canCarry), _source getVariable [QGVAR(canCarryLast), false], true]; _source setVariable [QEGVAR(dragging,canDrag), _source getVariable [QGVAR(canDragLast), false], true]; - [_source, "blockEngine", "ACE_Refuel", false] call EFUNC(common,statusEffect_set); + [_source, "blockEngine", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); }, "", localize LSTRING(ReturnAction), diff --git a/addons/refuel/functions/fnc_startNozzleInHandsPFH.sqf b/addons/refuel/functions/fnc_startNozzleInHandsPFH.sqf index 611fa85e909..da47bc3c725 100644 --- a/addons/refuel/functions/fnc_startNozzleInHandsPFH.sqf +++ b/addons/refuel/functions/fnc_startNozzleInHandsPFH.sqf @@ -23,8 +23,8 @@ #define END_PFH \ _unit setVariable [QGVAR(hint), nil]; \ call EFUNC(interaction,hideMouseHint); \ - [_unit, "forceWalk", "ACE_refuel", false] call EFUNC(common,statusEffect_set); \ - [_unit, "blockThrow", "ACE_refuel", false] call EFUNC(common,statusEffect_set); \ + [_unit, "forceWalk", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); \ + [_unit, "blockThrow", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); \ [_idPFH] call CBA_fnc_removePerFrameHandler; params ["_unit", "_nozzle"]; @@ -89,7 +89,7 @@ TRACE_2("start",_unit,_nozzle); }; private _hintLMB = ""; - private _hintRMB = localize ELSTRING(dragging,Drop); + private _hintRMB = LELSTRING(common,Drop); getCursorObjectParams params ["_cursorObject", "", "_distance"]; if (!isNull _cursorObject && {_distance < REFUEL_NOZZLE_ACTION_DISTANCE}) then { diff --git a/addons/refuel/functions/fnc_takeNozzle.sqf b/addons/refuel/functions/fnc_takeNozzle.sqf index cd8f8b4eb4e..51db8789e5d 100644 --- a/addons/refuel/functions/fnc_takeNozzle.sqf +++ b/addons/refuel/functions/fnc_takeNozzle.sqf @@ -80,7 +80,7 @@ params [ _nozzle setVariable [QGVAR(attachPos), _attachPos, true]; _nozzle setVariable [QGVAR(source), _source, true]; - [_source, "blockEngine", "ACE_Refuel", true] call EFUNC(common,statusEffect_set); + [_source, "blockEngine", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); _source setVariable [QGVAR(isConnected), true, true]; _source setVariable [QGVAR(ownedNozzle), _nozzle, true]; @@ -100,8 +100,8 @@ params [ _unit call EFUNC(common,fixLoweredRifleAnimation); _unit action ["SwitchWeapon", _unit, _unit, 299]; - [_unit, "forceWalk", "ACE_refuel", true] call EFUNC(common,statusEffect_set); - [_unit, "blockThrow", "ACE_refuel", true] call EFUNC(common,statusEffect_set); + [_unit, "forceWalk", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); + [_unit, "blockThrow", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); [_unit, _nozzle] call FUNC(startNozzleInHandsPFH); }, diff --git a/addons/reload/functions/fnc_canCheckAmmo.sqf b/addons/reload/functions/fnc_canCheckAmmo.sqf index 96b9f88d501..829e57e2569 100644 --- a/addons/reload/functions/fnc_canCheckAmmo.sqf +++ b/addons/reload/functions/fnc_canCheckAmmo.sqf @@ -4,23 +4,24 @@ * Check if a unit can check the ammo of the target. * * Arguments: - * 0: Unit equipped with the weapon <OBJECT> + * 0: Unit equipped with the weapon/CSW to check <OBJECT> + * 1: Unit checking ammo <OBJECT> * * Return Value: * Can check ammo <BOOL> * * Example: - * [cursorObject] call ace_reload_fnc_canCheckAmmo + * [cursorObject, player] call ace_reload_fnc_canCheckAmmo * * Public: No */ -params ["_target"]; +params ["_target", "_player"]; // Static weapons if (_target isKindOf "StaticWeapon") exitWith { // No check ammo action on destroyed static weapons - if (!alive _target) exitWith {false}; + if (!alive _target || {!([_player, _target] call EFUNC(interaction,canInteractWithVehicleCrew))}) exitWith {false}; if (currentMagazine _target != "") exitWith {true}; diff --git a/addons/reload/functions/fnc_checkAmmo.sqf b/addons/reload/functions/fnc_checkAmmo.sqf index f558d917699..8039c9527ca 100644 --- a/addons/reload/functions/fnc_checkAmmo.sqf +++ b/addons/reload/functions/fnc_checkAmmo.sqf @@ -23,7 +23,7 @@ if (_unit == _target) then { _target = vehicle _target; }; - [_unit, "Gear", 1] call EFUNC(common,doGesture); + [_unit, "reloadMagazine", 0] call EFUNC(common,doGesture); }; [FUNC(displayAmmo), _target, 1] call CBA_fnc_waitAndExecute; diff --git a/addons/reload/functions/fnc_displayAmmo.sqf b/addons/reload/functions/fnc_displayAmmo.sqf index 68e176587ad..7e38ee65f87 100644 --- a/addons/reload/functions/fnc_displayAmmo.sqf +++ b/addons/reload/functions/fnc_displayAmmo.sqf @@ -122,7 +122,7 @@ if (_isStaticWeapon) then { _loadedName = parseText format ["<t align='center' >%1</t>", _loadedName]; - private _text = composeText [_loadedName, linebreak, _ammoBarsStructuredText]; + private _text = composeText [_loadedName, lineBreak, _ammoBarsStructuredText]; [_text] call EFUNC(common,displayTextStructured); } else { if (_magazine != "") then { diff --git a/addons/reload/stringtable.xml b/addons/reload/stringtable.xml index 2f0c6c60c1f..ec860ff46a1 100644 --- a/addons/reload/stringtable.xml +++ b/addons/reload/stringtable.xml @@ -107,7 +107,7 @@ <German>Gurt anhängen</German> <Hungarian>Töltényheveder összekötése</Hungarian> <Italian>Combina nastro</Italian> - <Portuguese>Ligar cintos de munição</Portuguese> + <Portuguese>Conectar cintos de munição</Portuguese> <Japanese>ベルトを繋げる</Japanese> <Korean>탄띠 연결</Korean> <Chinesesimp>连接弹链</Chinesesimp> @@ -123,7 +123,7 @@ <German>Gurt anhängen...</German> <Hungarian>Töltényheveder összekötése folyamatban...</Hungarian> <Italian>Combinando nastro...</Italian> - <Portuguese>Ligando cintos...</Portuguese> + <Portuguese>Conectando cintos...</Portuguese> <Japanese>ベルトを繋げています・・・</Japanese> <Korean>탄띠 연결 중...</Korean> <Chinesesimp>正在连接弹链...</Chinesesimp> @@ -139,6 +139,7 @@ <Korean>탄띠가 연결되었습니다</Korean> <Russian>Ремень был пристегнут</Russian> <Spanish>Cinta enganchada</Spanish> + <Portuguese>Cinto conectado</Portuguese> </Key> <Key ID="STR_ACE_Reload_BeltNotLinked"> <English>Belt could not be linked</English> @@ -150,6 +151,7 @@ <Korean>탄띠를 연결할 수 없습니다</Korean> <Russian>Ремень не удалось пристегнуть</Russian> <Spanish>La cinta no ha podido ser enganchada</Spanish> + <Portuguese>Cinto não pôde ser conectado</Portuguese> </Key> </Package> </Project> diff --git a/addons/reloadlaunchers/stringtable.xml b/addons/reloadlaunchers/stringtable.xml index b55ccde1705..6324a97b552 100644 --- a/addons/reloadlaunchers/stringtable.xml +++ b/addons/reloadlaunchers/stringtable.xml @@ -11,6 +11,7 @@ <French>Affichage de notifications lors d'une rechargement par un ami</French> <Russian>Отображает уведомления о загрузке помощника</Russian> <Spanish>Mostrar notificaciones para recarga de compañero</Spanish> + <Portuguese>Mostrar notificações para Carregamento de Companheiro</Portuguese> </Key> <Key ID="STR_ACE_ReloadLaunchers_SettingDisplayStatusTextDesc"> <English>Displays notifications when an assistant loads a gunner's launcher.</English> @@ -22,6 +23,7 @@ <French>Affiche une notofication lorsqu'un assistant recharge l'arme du tireur.</French> <Russian>Отображает уведомления, когда помощник загружает пусковую установку стрелка.</Russian> <Spanish>Mostrar notificaciones cuando un asistente recarga el lanzador del tirador.</Spanish> + <Portuguese>Notifica quando um assistente carrega o lançador do atirador</Portuguese> </Key> <Key ID="STR_ACE_ReloadLaunchers_LoadLauncher"> <English>Load launcher</English> @@ -50,6 +52,7 @@ <Korean>%1이(가) 당신의 발사기를 장전했습니다.</Korean> <Russian>%1 загружает Вашу установку</Russian> <Spanish>%1 está cargando tu lanzador</Spanish> + <Portuguese>%1 está carregando seu lançador</Portuguese> </Key> <Key ID="STR_ACE_ReloadLaunchers_LoadingAborted"> <English>%1 stopped loading your launcher</English> @@ -61,6 +64,7 @@ <Korean>%1이(가) 당신의 발사기 장전을 멈췄습니다.</Korean> <Russian>%1 прекратил загружать Вашу установку</Russian> <Spanish>%1 paró de cargar tu lanzador</Spanish> + <Portuguese>%1 parou de carregar seu lançador</Portuguese> </Key> <Key ID="STR_ACE_ReloadLaunchers_LoadingLauncher"> <English>Loading launcher...</English> @@ -123,6 +127,7 @@ <Korean>발사기를 장전할 수 없습니다.</Korean> <Russian>Не удалось загрузить пусковую установку</Russian> <Spanish>El lanzador no ha podido ser cargado</Spanish> + <Portuguese>O lançador não pôde ser carregado</Portuguese> </Key> <Key ID="STR_ACE_ReloadLaunchers_featureDescription"> <English>Buddy Loading</English> @@ -134,6 +139,7 @@ <Japanese>バディローディング</Japanese> <Russian>Перезарядка помощником</Russian> <Spanish>Cargado de Compañero</Spanish> + <Portuguese>Carregamento de Companheiro</Portuguese> </Key> </Package> </Project> diff --git a/addons/repair/CfgVehicles.hpp b/addons/repair/CfgVehicles.hpp index ce74737b766..89d3cd83133 100644 --- a/addons/repair/CfgVehicles.hpp +++ b/addons/repair/CfgVehicles.hpp @@ -429,9 +429,34 @@ class CfgVehicles { GVAR(hitpointPositions)[] = {{"HitTurret", {0,-2,0}}}; }; + class Tank_F; + class APC_Tracked_02_base_F: Tank_F { + class EGVAR(interaction,anims) { + class showTracks { + phase = 0; + selections[] = {"vhc_tracks"}; + positions[] = {"private _pos = _target selectionPosition 'vhc_tracks'; _pos set [0, -(_pos select 0)]; _pos"}; // Mirror position to other side of vehicle + items[] = {"ACE_Track", "ACE_Track", "ACE_Track"}; + name = CSTRING(RemoveTrack); + text = CSTRING(RemovingTrack); + }; + }; + }; + class Car_F: Car { class HitPoints; }; + class Offroad_02_base_F: Car_F { + class EGVAR(interaction,anims) { + class hideSpareWheel { + positions[] = {"_target selectionPosition ['spare_wheel', 'ViewGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = CSTRING(RemoveWheel); + text = CSTRING(RemovingWheel); + }; + }; + }; + class Truck_F: Car_F { class HitPoints: HitPoints { class HitLBWheel; @@ -449,10 +474,45 @@ class CfgVehicles { }; }; + class Truck_01_viv_base_F; + class Truck_01_cargo_base_F: Truck_01_viv_base_F { + class EGVAR(interaction,anims) { + class Tyre1_hide { + positions[] = {"_target selectionPosition ['tyre1_hide', 'ViewGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = CSTRING(RemoveWheel); + text = CSTRING(RemovingWheel); + distance = 2.5; + }; + }; + }; + class Truck_01_flatbed_base_F: Truck_01_viv_base_F { + class EGVAR(interaction,anims) { + class Tyre1_hide { + positions[] = {"_target selectionPosition ['tyre1_hide', 'ViewGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = CSTRING(RemoveWheel); + text = CSTRING(RemovingWheel); + distance = 2.5; + }; + }; + }; + class Quadbike_01_base_F: Car_F { GVAR(hitpointPositions)[] = { {"HitEngine", {0, 0.5, -0.7}}, {"HitFuel", {0, 0, -0.5}} }; }; class Hatchback_01_base_F: Car_F { GVAR(hitpointPositions)[] = {{"HitBody", {0, 0.7, -0.5}}, {"HitFuel", {0, -1.75, -0.75}}}; }; + + class Van_02_base_F: Truck_F { + class EGVAR(interaction,anims) { + class spare_tyre_hide { + positions[] = {"_target selectionPosition ['spare_tyre', 'ViewGeometry', 'AveragePoint']"}; + items[] = {"ACE_Wheel"}; + name = CSTRING(RemoveWheel); + text = CSTRING(RemovingWheel); + }; + }; + }; }; diff --git a/addons/repair/XEH_postInit.sqf b/addons/repair/XEH_postInit.sqf index 2e9a9178ffd..012ddb9f09a 100644 --- a/addons/repair/XEH_postInit.sqf +++ b/addons/repair/XEH_postInit.sqf @@ -39,12 +39,27 @@ ["CAManBase", "InitPost", { params ["_unit"]; - if !(local _unit && {_unit getUnitTrait "engineer"}) exitWith {}; - _unit setUnitTrait ["engineer", false]; - if (_unit getVariable ["ACE_IsEngineer", -1] isEqualTo -1) then { - _unit setVariable ["ACE_IsEngineer", true, true]; + private _isEngineer = _unit getUnitTrait "engineer"; + if (isNil "_isEngineer" || {_isEngineer isNotEqualTo true}) exitWith {}; + TRACE_4("setUnitTrait 1",_unit,typeOf _unit,local _unit,ACE_player); + + if (local _unit) exitWith { + _unit setUnitTrait ["engineer", false]; + + if (_unit getVariable ["ACE_IsEngineer", -1] isEqualTo -1) then { + _unit setVariable ["ACE_IsEngineer", true, true]; + }; }; - TRACE_3("setUnitTrait",_unit,typeOf _unit,_unit getUnitTrait "engineer"); + + // Handle player locality delay, can be anywhere from instant to 10+ seconds (#10337) + if (_unit isNotEqualTo ACE_player) exitWith {}; + _unit addEventHandler ["Local", { + params ["_unit", "_isLocal"]; + if (!_isLocal) exitWith {}; + TRACE_3("setUnitTrait 2",_unit,typeOf _unit,_unit getUnitTrait "engineer"); + _unit setUnitTrait ["engineer", false]; + _unit removeEventHandler ["Local", _thisEventHandler]; + }]; }, true, [], true] call CBA_fnc_addClassEventHandler; diff --git a/addons/repair/functions/fnc_addRepairActions.sqf b/addons/repair/functions/fnc_addRepairActions.sqf index 16711d7b8a1..095df261aaa 100644 --- a/addons/repair/functions/fnc_addRepairActions.sqf +++ b/addons/repair/functions/fnc_addRepairActions.sqf @@ -66,11 +66,11 @@ private _turretPaths = ((fullCrew [_vehicle, "gunner", true]) + (fullCrew [_vehi TRACE_3("Adding Wheel Actions",_hitpoint,_forEachIndex,_selection); // An action to replace the wheel is required - _name = format ["Replace_%1_%2", _forEachIndex, _hitpoint]; - _text = localize LSTRING(ReplaceWheel); - _condition = {[_this select 1, _this select 0, _this select 2 select 0, "ReplaceWheel"] call DFUNC(canRepair)}; - _statement = {[_this select 1, _this select 0, _this select 2 select 0, "ReplaceWheel"] call DFUNC(repair)}; - _action = [_name, _text, _icon, _statement, _condition, {}, [_hitpoint], _position, 2] call EFUNC(interact_menu,createAction); + private _name = format ["Replace_%1_%2", _forEachIndex, _hitpoint]; + private _text = localize LSTRING(ReplaceWheel); + private _condition = {[_this select 1, _this select 0, _this select 2 select 0, "ReplaceWheel"] call DFUNC(canRepair)}; + private _statement = {[_this select 1, _this select 0, _this select 2 select 0, "ReplaceWheel"] call DFUNC(repair)}; + private _action = [_name, _text, _icon, _statement, _condition, {}, [_hitpoint], _position, 2] call EFUNC(interact_menu,createAction); [_type, 0, [], _action] call EFUNC(interact_menu,addActionToClass); // Create a wheel interaction @@ -118,6 +118,7 @@ private _turretPaths = ((fullCrew [_vehicle, "gunner", true]) + (fullCrew [_vehi }; // Find the action position + //IGNORE_PRIVATE_WARNING ["_target"]; private _position = compile format ["_target selectionPosition ['%1', 'HitPoints'];", _selection]; { _x params ["_hit", "_pos"]; diff --git a/addons/repair/functions/fnc_canRepair.sqf b/addons/repair/functions/fnc_canRepair.sqf index ff61450b12b..4a77383c288 100644 --- a/addons/repair/functions/fnc_canRepair.sqf +++ b/addons/repair/functions/fnc_canRepair.sqf @@ -21,7 +21,7 @@ params ["_caller", "_target", "_hitPoint", "_className"]; TRACE_4("params",_caller,_target,_hitPoint,_className); -private _config = (ConfigFile >> "ACE_Repair" >> "Actions" >> _className); +private _config = (configFile >> "ACE_Repair" >> "Actions" >> _className); if !(isClass _config) exitWith {false}; // or go for a default? // if(isEngineOn _target) exitWith {false}; // Ignore here so action shows, then exit and show warning when selected #3348 diff --git a/addons/repair/functions/fnc_doRepairTrack.sqf b/addons/repair/functions/fnc_doRepairTrack.sqf index 519a3f78d68..fcd71b59c9a 100644 --- a/addons/repair/functions/fnc_doRepairTrack.sqf +++ b/addons/repair/functions/fnc_doRepairTrack.sqf @@ -26,7 +26,7 @@ TRACE_4("params",_unit,_vehicle,_hitPoint,_claimedObjects); _claimedObjects params [["_track", objNull]]; if ((isNull _track) || {!([_unit, _track, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith))}) exitWith { - ERROR_1("Bad Track",_claimedObjects); + ERROR_1("Bad Track %1",_claimedObjects); }; // can't use a destroyed track diff --git a/addons/repair/functions/fnc_doReplaceTrack.sqf b/addons/repair/functions/fnc_doReplaceTrack.sqf index a512089c891..899532d96a8 100644 --- a/addons/repair/functions/fnc_doReplaceTrack.sqf +++ b/addons/repair/functions/fnc_doReplaceTrack.sqf @@ -26,7 +26,7 @@ TRACE_4("params",_unit,_vehicle,_hitPoint,_claimedObjects); _claimedObjects params [["_track", objNull]]; if ((isNull _track) || {!([_unit, _track, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith))}) exitWith { - ERROR_1("Bad Track",_claimedObjects); + ERROR_1("Bad Track %1",_claimedObjects); }; // get current hitpoint damage diff --git a/addons/repair/functions/fnc_doReplaceWheel.sqf b/addons/repair/functions/fnc_doReplaceWheel.sqf index 7ec617127cf..368fe049702 100644 --- a/addons/repair/functions/fnc_doReplaceWheel.sqf +++ b/addons/repair/functions/fnc_doReplaceWheel.sqf @@ -26,7 +26,7 @@ TRACE_4("params",_unit,_vehicle,_hitPoint,_claimedObjects); _claimedObjects params [["_wheel", objNull]]; if ((isNull _wheel) || {!([_unit, _wheel, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith))}) exitWith { - WARNING_1("Bad Claimed Wheel",_claimedObjects); + WARNING_1("Bad Claimed Wheel %1",_claimedObjects); }; // get current hitpoint damage diff --git a/addons/repair/functions/fnc_isInRepairFacility.sqf b/addons/repair/functions/fnc_isInRepairFacility.sqf index 51cc5424bbd..74d94c5e75a 100644 --- a/addons/repair/functions/fnc_isInRepairFacility.sqf +++ b/addons/repair/functions/fnc_isInRepairFacility.sqf @@ -33,6 +33,7 @@ private _checkObject = { }; private _fnc_check = { + //IGNORE_PRIVATE_WARNING ["_unit", "_checkObject", "_x"]; private _position = _unit modelToWorldVisual [0, 0, eyePos _unit select 2]; CHECK_OBJECTS(lineIntersectsWith [ARR_3(_position,_position vectorAdd [ARR_3(0,0,10)],_unit)]) || {CHECK_OBJECTS(_unit nearObjects 7.5)} diff --git a/addons/repair/functions/fnc_isNearRepairVehicle.sqf b/addons/repair/functions/fnc_isNearRepairVehicle.sqf index d319273e641..13b089bdd90 100644 --- a/addons/repair/functions/fnc_isNearRepairVehicle.sqf +++ b/addons/repair/functions/fnc_isNearRepairVehicle.sqf @@ -19,6 +19,7 @@ params ["_unit"]; TRACE_1("params",_unit); +//IGNORE_PRIVATE_WARNING ["_unit"]; private _fnc_check = { private _nearObjects = nearestObjects [_unit, ["Air", "LandVehicle", "Slingload_base_F"], 20]; diff --git a/addons/repair/functions/fnc_patchRemovedWheel.sqf b/addons/repair/functions/fnc_patchRemovedWheel.sqf index b0978013d55..1f1d8e32c68 100644 --- a/addons/repair/functions/fnc_patchRemovedWheel.sqf +++ b/addons/repair/functions/fnc_patchRemovedWheel.sqf @@ -23,7 +23,7 @@ params ["_unit", "_target"]; private _wheelDamage = (damage _target) - GVAR(patchWheelMaximumRepair); [ceil (_wheelDamage / 0.05) * GVAR(patchWheelTime), [_target], {}, {}, LLSTRING(PatchingWheel), { - params ["_args"]; + params ["_args", "_elapsedTime", "_totalTime"]; _args params ["_target"]; private _damage = damage _target; @@ -35,5 +35,4 @@ private _wheelDamage = (damage _target) - GVAR(patchWheelMaximumRepair); _target setDamage _damage; _damage > GVAR(patchWheelMaximumRepair) -}] call ace_common_fnc_progressBar; - +}] call EFUNC(common,progressBar); diff --git a/addons/repair/functions/fnc_repair.sqf b/addons/repair/functions/fnc_repair.sqf index 526b2d506b6..ae4038daf0a 100644 --- a/addons/repair/functions/fnc_repair.sqf +++ b/addons/repair/functions/fnc_repair.sqf @@ -21,7 +21,7 @@ params ["_caller", "_target", "_hitPoint", "_className"]; TRACE_4("params",_caller,_target,_hitPoint,_className); -private _config = (ConfigFile >> "ACE_Repair" >> "Actions" >> _className); +private _config = (configFile >> "ACE_Repair" >> "Actions" >> _className); if !(isClass _config) exitWith {false}; // or go for a default? private _engineerRequired = if (isNumber (_config >> "requiredEngineer")) then { @@ -149,10 +149,15 @@ if (_callbackProgress == "") then { // Player Animation private _callerAnim = [getText (_config >> "animationCaller"), getText (_config >> "animationCallerProne")] select (stance _caller == "PRONE"); private _loopAnim = (getNumber (_config >> "loopAnimation")) isEqualTo 1; -_caller setVariable [QGVAR(selectedWeaponOnrepair), currentWeapon _caller]; + +private _currentWeapon = currentWeapon _caller; + +if (_currentWeapon != "") then { + _caller setVariable [QGVAR(selectedWeaponOnrepair), (weaponState _caller) select [0, 3]]; +}; // Cannot use secondairy weapon for animation -if (currentWeapon _caller == secondaryWeapon _caller) then { +if (_currentWeapon == secondaryWeapon _caller) then { _caller selectWeapon (primaryWeapon _caller); }; diff --git a/addons/repair/functions/fnc_repair_failure.sqf b/addons/repair/functions/fnc_repair_failure.sqf index f9de2a8ae6e..0c7fcbf9af3 100644 --- a/addons/repair/functions/fnc_repair_failure.sqf +++ b/addons/repair/functions/fnc_repair_failure.sqf @@ -38,9 +38,11 @@ if (vehicle _caller == _caller && {!(_caller call EFUNC(common,isSwimming))}) th _caller setVariable [QGVAR(repairCurrentAnimCaller), nil]; _caller setVariable [QGVAR(repairPrevAnimCaller), nil]; -private _weaponSelect = (_caller getVariable [QGVAR(selectedWeaponOnrepair), ""]); -if (_weaponSelect != "") then { +private _weaponSelect = _caller getVariable QGVAR(selectedWeaponOnrepair); + +if (!isNil "_weaponSelect") then { _caller selectWeapon _weaponSelect; + _caller setVariable [QGVAR(selectedWeaponOnrepair), nil]; } else { _caller action ["SwitchWeapon", _caller, _caller, 299]; }; @@ -57,7 +59,7 @@ if (_weaponSelect != "") then { // Record specific callback -private _config = (ConfigFile >> "ACE_Repair" >> "Actions" >> _className); +private _config = (configFile >> "ACE_Repair" >> "Actions" >> _className); private _callback = getText (_config >> "callbackFailure"); if (isNil _callback) then { diff --git a/addons/repair/functions/fnc_repair_success.sqf b/addons/repair/functions/fnc_repair_success.sqf index 62480827791..94ffd819e31 100644 --- a/addons/repair/functions/fnc_repair_success.sqf +++ b/addons/repair/functions/fnc_repair_success.sqf @@ -38,9 +38,11 @@ if (vehicle _caller == _caller && {!(_caller call EFUNC(common,isSwimming))}) th _caller setVariable [QGVAR(repairCurrentAnimCaller), nil]; _caller setVariable [QGVAR(repairPrevAnimCaller), nil]; -private _weaponSelect = (_caller getVariable [QGVAR(selectedWeaponOnrepair), ""]); -if (_weaponSelect != "") then { +private _weaponSelect = _caller getVariable QGVAR(selectedWeaponOnrepair); + +if (!isNil "_weaponSelect") then { _caller selectWeapon _weaponSelect; + _caller setVariable [QGVAR(selectedWeaponOnrepair), nil]; } else { _caller action ["SwitchWeapon", _caller, _caller, 299]; }; @@ -52,7 +54,7 @@ if (_weaponSelect != "") then { } forEach _claimedObjects; // Record specific callback -private _config = (ConfigFile >> "ACE_Repair" >> "Actions" >> _className); +private _config = (configFile >> "ACE_Repair" >> "Actions" >> _className); private _callback = getText (_config >> "callbackSuccess"); if (isNil _callback) then { diff --git a/addons/repair/functions/fnc_useItems.sqf b/addons/repair/functions/fnc_useItems.sqf index edc18bcb16f..784c4a5da2a 100644 --- a/addons/repair/functions/fnc_useItems.sqf +++ b/addons/repair/functions/fnc_useItems.sqf @@ -25,14 +25,14 @@ private _itemsUsedBy = []; if (_x isEqualType []) then { { private _itemUsedInfo = [_unit, _x] call FUNC(useItem); - if (_itemUsedInfo select 0) exitWith { _itemsUsedBy pushback [(_itemUsedInfo select 1), _x]}; + if (_itemUsedInfo select 0) exitWith { _itemsUsedBy pushBack [(_itemUsedInfo select 1), _x]}; } forEach _x; }; // handle required item if (_x isEqualType "") then { private _itemUsedInfo = [_unit, _x] call FUNC(useItem); - if (_itemUsedInfo select 0) exitWith { _itemsUsedBy pushback [(_itemUsedInfo select 1), _x]}; + if (_itemUsedInfo select 0) exitWith { _itemsUsedBy pushBack [(_itemUsedInfo select 1), _x]}; }; } forEach _items; diff --git a/addons/repair/stringtable.xml b/addons/repair/stringtable.xml index 6f16e91e099..eae73fa671c 100644 --- a/addons/repair/stringtable.xml +++ b/addons/repair/stringtable.xml @@ -1009,7 +1009,7 @@ <Hungarian>Jobb középső kerék</Hungarian> <Russian>Правое среднее колесо</Russian> <Japanese>右中央輪</Japanese> - <Korean>오른족 가운데 바퀴</Korean> + <Korean>오른쪽 가운데 바퀴</Korean> <Chinesesimp>右中轮</Chinesesimp> <Chinese>右中輪</Chinese> </Key> diff --git a/addons/respawn/functions/fnc_handleKilled.sqf b/addons/respawn/functions/fnc_handleKilled.sqf index 1383561f2ce..eeca8f96e57 100644 --- a/addons/respawn/functions/fnc_handleKilled.sqf +++ b/addons/respawn/functions/fnc_handleKilled.sqf @@ -21,7 +21,7 @@ params ["_unit"]; // Saves the gear when the player! (and only him) is killed if (ACE_player == _unit && {GVAR(SavePreDeathGear)}) then { _unit setVariable [QGVAR(unitGear), [_unit] call CBA_fnc_getLoadout]; - _unit setVariable [QGVAR(activeWeaponAndMuzzle), [currentWeapon _unit, currentMuzzle _unit, currentWeaponMode _unit]]; + _unit setVariable [QGVAR(activeWeaponAndMuzzle), (weaponState _unit) select [0, 3]]; [QGVAR(saveGear), _unit] call CBA_fnc_localEvent; }; diff --git a/addons/respawn/functions/fnc_moveRallypoint.sqf b/addons/respawn/functions/fnc_moveRallypoint.sqf index 3c4d8b6441c..03c29624735 100644 --- a/addons/respawn/functions/fnc_moveRallypoint.sqf +++ b/addons/respawn/functions/fnc_moveRallypoint.sqf @@ -39,7 +39,7 @@ _position set [2, 0]; [localize LSTRING(Deploy)] call EFUNC(common,displayTextStructured); [{ - params ["_rallypoint", "_unit", "_position"]; + params ["_rallypoint", "_unit", "_position", "_side"]; _rallypoint setPosATL _position; _unit reveal _rallypoint; @@ -49,4 +49,4 @@ _position set [2, 0]; ["ace_rallypointMoved", [_rallypoint, _side, _position]] call CBA_fnc_globalEvent; [localize LSTRING(Deployed)] call EFUNC(common,displayTextStructured); -}, [_rallypoint, _unit, _position], 5] call CBA_fnc_waitAndExecute; +}, [_rallypoint, _unit, _position, _side], 5] call CBA_fnc_waitAndExecute; diff --git a/addons/respawn/functions/fnc_restoreGear.sqf b/addons/respawn/functions/fnc_restoreGear.sqf index afbc7def866..34c5918383f 100644 --- a/addons/respawn/functions/fnc_restoreGear.sqf +++ b/addons/respawn/functions/fnc_restoreGear.sqf @@ -5,7 +5,8 @@ * * Arguments: * 0: Unit <OBJECT> - * 1: All Gear based on return value of ACE_common_fnc_getAllGear <ARRAY> + * 1: All Gear based on return value of ace_common_fnc_getAllGear <ARRAY> + * 2: All weapon info needed for restoring previous weapon status <ARRAY> * * Return Value: * None @@ -19,36 +20,12 @@ params ["_unit", "_allGear", "_activeWeaponAndMuzzle"]; TRACE_3("restoreGear",_unit,count _allGear,_activeWeaponAndMuzzle); -// restore all gear +// Restore all gear if (!isNil "_allGear") then { [_unit, _allGear] call CBA_fnc_setLoadout; }; -// restore the last active weapon, muzzle and weaponMode +// Restore the last active weapon, muzzle and weapon mode if (!isNil "_activeWeaponAndMuzzle") then { - // @todo, replace this with CBA_fnc_selectWeapon after next CBA update - _activeWeaponAndMuzzle params ["_activeWeapon", "_activeMuzzle", "_activeWeaponMode"]; - - if ( - (_activeMuzzle != "") && - {_activeMuzzle != _activeWeapon} && - {_activeMuzzle in getArray (configFile >> "CfgWeapons" >> _activeWeapon >> "muzzles")} - ) then { - _unit selectWeapon _activeMuzzle; - } else { - if (_activeWeapon != "") then { - _unit selectWeapon _activeWeapon; - }; - }; - - if (currentWeapon _unit != "") then { - private _index = 0; - - while { - _index < 299 && {currentWeaponMode _unit != _activeWeaponMode} - } do { - _unit action ["SwitchWeapon", _unit, _unit, _index]; - _index = _index + 1; - }; - }; + _unit selectWeapon _activeWeaponAndMuzzle; }; diff --git a/addons/respawn/functions/fnc_updateRallypoint.sqf b/addons/respawn/functions/fnc_updateRallypoint.sqf index a0e14a4ed29..bedc887b3c2 100644 --- a/addons/respawn/functions/fnc_updateRallypoint.sqf +++ b/addons/respawn/functions/fnc_updateRallypoint.sqf @@ -18,7 +18,7 @@ */ params ["_rallypoint", "_side"]; -private _position = param [2, getpos _rallypoint]; +private _position = param [2, getPos _rallypoint]; if (!hasInterface) exitWith {}; diff --git a/addons/safemode/CfgEventHandlers.hpp b/addons/safemode/CfgEventHandlers.hpp index 6c29240403a..f6503c2479b 100644 --- a/addons/safemode/CfgEventHandlers.hpp +++ b/addons/safemode/CfgEventHandlers.hpp @@ -1,4 +1,3 @@ - class Extended_PreStart_EventHandlers { class ADDON { init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); diff --git a/addons/safemode/XEH_PREP.hpp b/addons/safemode/XEH_PREP.hpp index 2f23aa02c9e..499ae808670 100644 --- a/addons/safemode/XEH_PREP.hpp +++ b/addons/safemode/XEH_PREP.hpp @@ -1,6 +1,6 @@ - +PREP(getWeaponSafety); PREP(lockSafety); PREP(playChangeFiremodeSound); PREP(setSafeModeVisual); -PREP(unlockSafety); PREP(setWeaponSafety); +PREP(unlockSafety); diff --git a/addons/safemode/XEH_postInit.sqf b/addons/safemode/XEH_postInit.sqf index db922f9b35d..fa6649aa9f1 100644 --- a/addons/safemode/XEH_postInit.sqf +++ b/addons/safemode/XEH_postInit.sqf @@ -4,18 +4,42 @@ if (!hasInterface) exitWith {}; -["ACE3 Weapons", QGVAR(safeMode), localize LSTRING(SafeMode), { +["ACE3 Weapons", QGVAR(safeMode), LLSTRING(SafeMode), { // Conditions: canInteract if !([ACE_player, objNull, ["isNotEscorting", "isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; + + (weaponState ACE_player) params ["_currentWeapon", "_currentMuzzle"]; + // Conditions: specific - if !([ACE_player] call CBA_fnc_canUseWeapon && {currentWeapon ACE_player != binocular ACE_player} && {currentWeapon ACE_player != ""}) exitWith {false}; + if !(ACE_player call CBA_fnc_canUseWeapon && {_currentWeapon != ""} && {_currentWeapon != binocular ACE_player}) exitWith {false}; + + // Statement: Toggle weapon safety + [ACE_player, _currentWeapon, _currentMuzzle] call FUNC(lockSafety); - // Statement - [ACE_player, currentWeapon ACE_player, currentMuzzle ACE_player] call FUNC(lockSafety); true }, {false}, [DIK_GRAVE, [false, true, false]], false] call CBA_fnc_addKeybind; ["unit", { - private _weaponSafe = currentWeapon ACE_player in (ACE_player getVariable [QGVAR(safedWeapons), []]); - [!_weaponSafe] call FUNC(setSafeModeVisual); + (weaponState ACE_player) params ["_currentWeapon", "_currentMuzzle"]; + + private _weaponSafe = [ACE_player, _currentWeapon, _currentMuzzle] call FUNC(getWeaponSafety); + + // Player HUD + !_weaponSafe call FUNC(setSafeModeVisual); }] call CBA_fnc_addPlayerEventHandler; + +// Variables are transferred from corpse to new body and EH above triggers on respawn, which desyncs safeties +// Therefore, clear variables and remove mouse button input blocking upon respawn +[QUOTE(ADDON), "Respawn", { + params ["_unit"]; + + _unit setVariable [QGVAR(safedWeapons), nil]; + + private _ehID = _unit getVariable QGVAR(actionID); + + if (isNil "_ehID") exitWith {}; + + [_unit, "DefaultAction", _ehID] call EFUNC(common,removeActionEventHandler); + + _unit setVariable [QGVAR(actionID), nil]; +}] call EFUNC(common,addPlayerEH); diff --git a/addons/safemode/functions/fnc_getWeaponSafety.sqf b/addons/safemode/functions/fnc_getWeaponSafety.sqf new file mode 100644 index 00000000000..b171d974e4d --- /dev/null +++ b/addons/safemode/functions/fnc_getWeaponSafety.sqf @@ -0,0 +1,45 @@ +#include "..\script_component.hpp" +/* + * Author: johnb43 + * Getter for weapon safety state. + * + * Arguments: + * 0: Unit <OBJECT> + * 1: Weapon <STRING> + * 2: Muzzle <STRING> (default: current muzzle of weapon) + * + * Return Value: + * Safety status <BOOL> + * + * Example: + * [ACE_player, currentWeapon ACE_player] call ace_safemode_fnc_getWeaponSafety + * + * Public: Yes + */ + +params [ + ["_unit", objNull, [objNull]], + ["_weapon", "", [""]], + ["_muzzle", nil, [""]] +]; + +if (_weapon == "" || {!(_unit hasWeapon _weapon)}) exitWith {false}; + +// Check if weapon is a binocular +if ((_weapon call EFUNC(common,getItemType)) select 1 == "binocular") exitWith {false}; + +// Check for invalid muzzles +_muzzle = if (isNil "_muzzle") then { + // Get current weapon muzzle if not defined + (_unit weaponState _weapon) select 1 +} else { + // Get config case muzzle names + private _muzzles = _weapon call EFUNC(common,getWeaponMuzzles); + + _muzzles param [_muzzles findIf {_x == _muzzle}, ""] +}; + +// Weapon is not available +if (_muzzle == "") exitWith {false}; + +_muzzle in ((_unit getVariable [QGVAR(safedWeapons), createHashMap]) getOrDefault [_weapon, createHashMap]) // return diff --git a/addons/safemode/functions/fnc_lockSafety.sqf b/addons/safemode/functions/fnc_lockSafety.sqf index 6c617c18989..28adb42df91 100644 --- a/addons/safemode/functions/fnc_lockSafety.sqf +++ b/addons/safemode/functions/fnc_lockSafety.sqf @@ -1,13 +1,13 @@ #include "..\script_component.hpp" /* - * Author: commy2 - * Put weapon on safety, or take it off safety if safety is already put on. + * Author: commy2, johnb43 + * Puts weapon on safety, or take it off safety if safety is already put on. * * Arguments: * 0: Unit <OBJECT> * 1: Weapon <STRING> * 2: Muzzle <STRING> - * 3: Show hint <BOOL> + * 3: Show hint <BOOL> (default: true) * * Return Value: * None @@ -18,67 +18,74 @@ * Public: No */ -params ["_unit", "_weapon", "_muzzle", ["_hint", true, [true]]]; +params ["_unit", "_weapon", "_muzzle", ["_hint", true]]; -private _safedWeapons = _unit getVariable [QGVAR(safedWeapons), []]; +private _safedWeapons = _unit getVariable QGVAR(safedWeapons); -if (_weapon in _safedWeapons) exitWith { - _this call FUNC(unlockSafety); +if (isNil "_safedWeapons") then { + _safedWeapons = createHashMap; + + _unit setVariable [QGVAR(safedWeapons), _safedWeapons]; +}; + +// See if the current weapon has locked muzzles +private _safedWeaponMuzzles = _safedWeapons getOrDefault [_weapon, createHashMap, true]; + +// If muzzle is locked, unlock it (toggle) +if (_muzzle in _safedWeaponMuzzles) exitWith { + [_unit, _weapon, _muzzle, _hint] call FUNC(unlockSafety); }; -_safedWeapons pushBack _weapon; +private _firemode = (_unit weaponState _muzzle) select 2; -_unit setVariable [QGVAR(safedWeapons), _safedWeapons]; +// This syntax of selectWeapon doesn't mess with gun lights and lasers +_unit selectWeapon [_weapon, _muzzle, _firemode]; -if (_unit getVariable [QGVAR(actionID), -1] == -1) then { +// Store new muzzle & firemode +_safedWeaponMuzzles set [_muzzle, _firemode]; + +// Lock muzzle +if (isNil {_unit getVariable QGVAR(actionID)}) then { _unit setVariable [QGVAR(actionID), [ _unit, "DefaultAction", { + params ["", "_unit"]; + if ( - [_this select 1] call CBA_fnc_canUseWeapon - && { - if (currentMuzzle (_this select 1) in ((_this select 1) getVariable [QGVAR(safedWeapons), []])) then { - if (inputAction "nextWeapon" > 0) exitWith { - [_this select 1, currentWeapon (_this select 1), currentMuzzle (_this select 1)] call FUNC(unlockSafety); + _unit call CBA_fnc_canUseWeapon && { + (weaponState _unit) params ["_currentWeapon", "_currentMuzzle"]; + + // Block firing the muzzle in safe mode + if (_currentMuzzle in ((_unit getVariable [QGVAR(safedWeapons), createHashMap]) getOrDefault [_currentWeapon, createHashMap])) then { + if (inputAction "nextWeapon" > 0 || {inputAction "prevWeapon" > 0}) exitWith { + [_unit, _currentWeapon, _currentMuzzle] call FUNC(unlockSafety); + false }; + true - } else {false} + } else { + false + } } ) then { - // player hud - [false] call FUNC(setSafeModeVisual); + // Player HUD + false call FUNC(setSafeModeVisual); + true } else { - // player hud - [true] call FUNC(setSafeModeVisual); + // Player HUD + true call FUNC(setSafeModeVisual); + false }; }, {} ] call EFUNC(common,addActionEventHandler)]; }; -if (_muzzle isEqualType "") then { - private _laserEnabled = _unit isIRLaserOn _weapon || {_unit isFlashlightOn _weapon}; - - _unit selectWeapon _muzzle; - - if ( - _laserEnabled - && { - _muzzle == primaryWeapon _unit // prevent UGL switch - || {"" == primaryWeapon _unit} // Arma switches to primary weapon if exists - } - ) then { - {_unit action [_x, _unit]} forEach ["GunLightOn", "IRLaserOn"]; - }; -}; - -// play fire mode selector sound +// Play fire mode selector sound [_unit, _weapon, _muzzle] call FUNC(playChangeFiremodeSound); -// show info box unless disabled +// Show info box unless disabled if (_hint) then { - private _picture = getText (configFile >> "CfgWeapons" >> _weapon >> "picture"); - [localize LSTRING(PutOnSafety), _picture] call EFUNC(common,displayTextPicture); + [LLSTRING(PutOnSafety), getText (configFile >> "CfgWeapons" >> _weapon >> "picture")] call EFUNC(common,displayTextPicture); }; - diff --git a/addons/safemode/functions/fnc_playChangeFiremodeSound.sqf b/addons/safemode/functions/fnc_playChangeFiremodeSound.sqf index 257e5864f6b..1edc2363340 100644 --- a/addons/safemode/functions/fnc_playChangeFiremodeSound.sqf +++ b/addons/safemode/functions/fnc_playChangeFiremodeSound.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: commy2 - * Play weapon firemode change sound. + * Plays weapon firemode change sound. * * Arguments: * 0: Unit <OBJECT> @@ -21,21 +21,23 @@ params ["_unit", "_weapon"]; private _sound = getArray (configFile >> "CfgWeapons" >> _weapon >> "changeFiremodeSound"); if (_sound isEqualTo []) exitWith { - playSound "ACE_Sound_Click"; + playSoundUI ["ACE_Sound_Click"]; }; -// get position where to play the sound (position of the weapon) -private _position = _unit modelToWorldVisualWorld (_unit selectionPosition "RightHand"); - -_sound params ["_filename", ["_volume", 1], ["_soundPitch", 1], ["_distance", 0]]; +_sound params [["_filename", ""], ["_volume", 1], ["_soundPitch", 1], ["_distance", 0]]; if (_filename == "") exitWith { - playSound "ACE_Sound_Click"; + playSoundUI ["ACE_Sound_Click"]; }; -// add file extension .wss as default +// Add file extension .wss as default if !(toLowerANSI (_filename select [count _filename - 4]) in [".wav", ".ogg", ".wss"]) then { _filename = format ["%1.wss", _filename]; }; -playSound3D [_filename, objNull, false, _position, _volume, _soundPitch, _distance]; +// Get position where to play the sound (position of the weapon) +private _position = _unit modelToWorldVisualWorld (_unit selectionPosition "RightHand"); + +playSound3D [_filename, objNull, insideBuilding _unit >= 0.5, _position, _volume, _soundPitch, _distance]; + +nil // return diff --git a/addons/safemode/functions/fnc_setSafeModeVisual.sqf b/addons/safemode/functions/fnc_setSafeModeVisual.sqf index d62a542b9d7..12b7f864ef3 100644 --- a/addons/safemode/functions/fnc_setSafeModeVisual.sqf +++ b/addons/safemode/functions/fnc_setSafeModeVisual.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: commy2 - * Show firemode indicator, representing safety lock + * Shows firemode indicator, representing safety lock. * * Arguments: * 0: Show firemode <BOOL> @@ -10,7 +10,7 @@ * None * * Example: - * [true] call ace_safemode_fnc_setSafeModeVisual + * true call ace_safemode_fnc_setSafeModeVisual * * Public: No */ @@ -27,8 +27,8 @@ if (_show) then { private _config = configFile >> "RscInGameUI" >> "RscUnitInfoSoldier" >> "WeaponInfoControlsGroupLeft" >> "controls" >> "CA_ModeTexture"; _control ctrlSetPosition [getNumber (_config >> "x"), getNumber (_config >> "y"), getNumber (_config >> "w"), getNumber (_config >> "h")]; - _control ctrlCommit 0; } else { _control ctrlSetPosition [0, 0, 0, 0]; - _control ctrlCommit 0; }; + +_control ctrlCommit 0; diff --git a/addons/safemode/functions/fnc_setWeaponSafety.sqf b/addons/safemode/functions/fnc_setWeaponSafety.sqf index d80e1d8c38f..3db0033bf8f 100644 --- a/addons/safemode/functions/fnc_setWeaponSafety.sqf +++ b/addons/safemode/functions/fnc_setWeaponSafety.sqf @@ -1,13 +1,14 @@ #include "..\script_component.hpp" /* - * Author: Brostrom.A - * Safe or unsafe the given weapon based on weapon state; locked or unlocked. + * Author: Brostrom.A, johnb43 + * Lock or unlock the given weapon based on weapon state. * * Arguments: * 0: Unit <OBJECT> * 1: Weapon <STRING> * 2: State <BOOL> * 3: Show hint <BOOL> (default: true) + * 4: Muzzle <STRING> (default: current muzzle of weapon) * * Return Value: * None @@ -22,17 +23,31 @@ params [ ["_unit", objNull, [objNull]], ["_weapon", "", [""]], ["_state", true, [true]], - ["_hint", true, [true]] + ["_hint", true, [true]], + ["_muzzle", nil, [""]] ]; -if (_weapon == "") exitWith {}; +// Don't allow to set weapon safety if unit doesn't have one (but allow removing safety, in case unit doesn't have weapon anymore) +if (_weapon == "" || {_state && {!(_unit hasWeapon _weapon)}}) exitWith {}; -private _safedWeapons = _unit getVariable [QGVAR(safedWeapons), []]; +// Check if weapon is a binocular +if ((_weapon call EFUNC(common,getItemType)) select 1 == "binocular") exitWith {}; -_weapon = configName (configFile >> "CfgWeapons" >> _weapon); +// Check for invalid muzzles +_muzzle = if (isNil "_muzzle") then { + // Get current weapon muzzle if not defined + (_unit weaponState _weapon) select 1 +} else { + // Get config case muzzle names + private _muzzles = _weapon call EFUNC(common,getWeaponMuzzles); -private _muzzle = currentMuzzle _unit; - -if (_state isNotEqualTo (_weapon in _safedWeapons)) then { - [_unit, _weapon, _muzzle, _hint] call FUNC(lockSafety); + _muzzles param [_muzzles findIf {_x == _muzzle}, ""] }; + +// Weapon is not available +if (_muzzle == "") exitWith {}; + +// If the weapon is already in the desired state, don't do anything +if (_state == (_muzzle in ((_unit getVariable [QGVAR(safedWeapons), createHashMap]) getOrDefault [_weapon, createHashMap]))) exitWith {}; + +[_unit, _weapon, _muzzle, _hint] call FUNC(lockSafety); diff --git a/addons/safemode/functions/fnc_unlockSafety.sqf b/addons/safemode/functions/fnc_unlockSafety.sqf index 10372f1a2ef..97716025dc6 100644 --- a/addons/safemode/functions/fnc_unlockSafety.sqf +++ b/addons/safemode/functions/fnc_unlockSafety.sqf @@ -1,13 +1,13 @@ #include "..\script_component.hpp" /* - * Author: commy2 - * Take weapon of safety lock. + * Author: commy2, johnb43 + * Takes the weapon safety lock off. * * Arguments: * 0: Unit <OBJECT> * 1: Weapon <STRING> * 2: Muzzle <STRING> - * 3: Show hint <BOOL> + * 3: Show hint <BOOL> (default: true) * * Return Value: * None @@ -18,67 +18,37 @@ * Public: No */ -params ["_unit", "_weapon", "_muzzle", ["_hint", true, [true]]]; +params ["_unit", "_weapon", "_muzzle", ["_hint", true]]; -private _safedWeapons = _unit getVariable [QGVAR(safedWeapons), []]; -_safedWeapons deleteAt (_safedWeapons find _weapon); +private _safedWeaponMuzzles = (_unit getVariable QGVAR(safedWeapons)) get _weapon; +private _firemode = _safedWeaponMuzzles deleteAt _muzzle; -_unit setVariable [QGVAR(safedWeapons), _safedWeapons]; +// Remove action if all weapons have removed their safeties +if (_safedWeaponMuzzles isEqualTo createHashMap) then { + (_unit getVariable QGVAR(safedWeapons)) deleteAt _weapon; -// remove action if all weapons have put their safety on -if (_safedWeapons isEqualTo []) then { - [_unit, "DefaultAction", _unit getVariable [QGVAR(actionID), -1]] call EFUNC(common,removeActionEventHandler); - _unit setVariable [QGVAR(actionID), -1]; -}; - -private _laserEnabled = _unit isIRLaserOn _weapon || {_unit isFlashlightOn _weapon}; + private _ehID = _unit getVariable QGVAR(actionID); -_unit selectWeapon _muzzle; + if (!isNil "_ehID" && {(_unit getVariable QGVAR(safedWeapons)) isEqualTo createHashMap}) then { + [_unit, "DefaultAction", _ehID] call EFUNC(common,removeActionEventHandler); -if ( - _laserEnabled - && { - _muzzle == primaryWeapon _unit // prevent UGL switch - || {"" == primaryWeapon _unit} // Arma switches to primary weapon if exists - } -) then { - {_unit action [_x, _unit]} forEach ["GunLightOn", "IRLaserOn"]; + _unit setVariable [QGVAR(actionID), nil]; + }; }; -if (inputAction "nextWeapon" > 0) then { - // switch to the last mode to roll over to first after the default nextWeapon action - // get weapon modes - private _modes = []; - { - if (getNumber (configFile >> "CfgWeapons" >> _weapon >> _x >> "showToPlayer") == 1) then { - _modes pushBack _x; - }; - if (_x == "this") then { - _modes pushBack _weapon; - }; - } forEach getArray (configFile >> "CfgWeapons" >> _weapon >> "modes"); +// Let engine handle switching to next firemode/muzzle +if (inputAction "nextWeapon" == 0 && {inputAction "prevWeapon" == 0}) then { + // This syntax of selectWeapon doesn't mess with gun lights and lasers + _unit selectWeapon [_weapon, _muzzle, _firemode]; - // select last mode - private _mode = _modes select (count _modes - 1); - - // switch to last mode - private _index = 0; - while { - _index < 299 && {currentMuzzle _unit != _weapon || {currentWeaponMode _unit != _mode}} - } do { - _unit action ["SwitchWeapon", _unit, _unit, _index]; - _index = _index + 1; - }; -} else { - // play fire mode selector sound + // Play fire mode selector sound [_unit, _weapon, _muzzle] call FUNC(playChangeFiremodeSound); }; -// player hud -[true] call FUNC(setSafeModeVisual); +// Player HUD +true call FUNC(setSafeModeVisual); -// show info box unless disabled +// Show info box unless disabled if (_hint) then { - private _picture = getText (configFile >> "CfgWeapons" >> _weapon >> "picture"); - [localize LSTRING(TookOffSafety), _picture] call EFUNC(common,displayTextPicture); + [LLSTRING(TookOffSafety), getText (configFile >> "CfgWeapons" >> _weapon >> "picture")] call EFUNC(common,displayTextPicture); }; diff --git a/addons/sandbag/functions/fnc_deploy.sqf b/addons/sandbag/functions/fnc_deploy.sqf index 1ef84851128..31818907489 100644 --- a/addons/sandbag/functions/fnc_deploy.sqf +++ b/addons/sandbag/functions/fnc_deploy.sqf @@ -18,8 +18,8 @@ params ["_unit"]; // prevent the placing unit from running -[_unit, "forceWalk", "ACE_Sandbag", true] call EFUNC(common,statusEffect_set); -[_unit, "blockThrow", "ACE_Sandbag", true] call EFUNC(common,statusEffect_set); +[_unit, "forceWalk", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); +[_unit, "blockThrow", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); // create the sandbag private _sandBag = createVehicle ["ACE_SandbagObject_NoGeo", [0, 0, 0], [], 0, "NONE"]; diff --git a/addons/sandbag/functions/fnc_deployCancel.sqf b/addons/sandbag/functions/fnc_deployCancel.sqf index aa2c2419a39..bccae637e5e 100644 --- a/addons/sandbag/functions/fnc_deployCancel.sqf +++ b/addons/sandbag/functions/fnc_deployCancel.sqf @@ -21,8 +21,8 @@ params ["_unit", "_key"]; if (_key != 1 || {GVAR(deployPFH) == -1}) exitWith {}; // enable running again -[_unit, "forceWalk", "ACE_Sandbag", false] call EFUNC(common,statusEffect_set); -[_unit, "blockThrow", "ACE_Sandbag", false] call EFUNC(common,statusEffect_set); +[_unit, "forceWalk", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); +[_unit, "blockThrow", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); // delete placement dummy deleteVehicle GVAR(sandBag); diff --git a/addons/sandbag/functions/fnc_deployConfirm.sqf b/addons/sandbag/functions/fnc_deployConfirm.sqf index 20b821b3b53..ef2aafd97c7 100644 --- a/addons/sandbag/functions/fnc_deployConfirm.sqf +++ b/addons/sandbag/functions/fnc_deployConfirm.sqf @@ -18,8 +18,8 @@ params ["_unit"]; // enable running again -[_unit, "forceWalk", "ACE_Sandbag", false] call EFUNC(common,statusEffect_set); -[_unit, "blockThrow", "ACE_Sandbag", false] call EFUNC(common,statusEffect_set); +[_unit, "forceWalk", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); +[_unit, "blockThrow", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); // remove sandbag from inventory _unit removeItem "ACE_Sandbag_empty"; diff --git a/addons/sandbag/functions/fnc_pickup.sqf b/addons/sandbag/functions/fnc_pickup.sqf index 2bcc418f4ca..07a6285e685 100644 --- a/addons/sandbag/functions/fnc_pickup.sqf +++ b/addons/sandbag/functions/fnc_pickup.sqf @@ -29,7 +29,7 @@ _unit setVariable [QGVAR(isUsingSandbag), true]; if (isNull _sandbag) exitWith {}; - deletevehicle _sandbag; + deleteVehicle _sandbag; // Force physx update { diff --git a/addons/scopes/RscTitles.hpp b/addons/scopes/RscTitles.hpp index c108caaf4d8..5b3002599ea 100644 --- a/addons/scopes/RscTitles.hpp +++ b/addons/scopes/RscTitles.hpp @@ -26,10 +26,10 @@ class RscTitles { colorBackground[] = { 1, 1, 1, 1 }; shadow = 1; - x = "(0.5 - 0.4 / 2) * safezoneW + safezoneX"; - y = "0 * safezoneH + safezoneY"; - w = "0.4 * safezoneW"; - h = "0.3 * safezoneH"; + x = "(0.5 - 0.4 / 2) * safeZoneW + safeZoneX"; + y = "0 * safeZoneH + safeZoneY"; + w = "0.4 * safeZoneW"; + h = "0.3 * safeZoneH"; }; class ACE_Scopes_Zeroing_Vertical: RscText { idc = 12; @@ -43,10 +43,10 @@ class RscTitles { colorBackground[] = { 1, 0, 0, 0 }; shadow = 0; - x = "(0.5 - 0.4 / 2 + 0.45*0.4) * safezoneW + safezoneX"; - y = "(0 + 0.19*0.3) * safezoneH + safezoneY"; - w = "0.04 * safezoneW"; - h = "0.025 * safezoneH"; + x = "(0.5 - 0.4 / 2 + 0.45*0.4) * safeZoneW + safeZoneX"; + y = "(0 + 0.19*0.3) * safeZoneH + safeZoneY"; + w = "0.04 * safeZoneW"; + h = "0.025 * safeZoneH"; }; class ACE_Scopes_Zeroing_Horizontal: RscText { idc = 13; @@ -60,10 +60,10 @@ class RscTitles { colorBackground[] = { 1, 0, 0, 0 }; shadow = 0; - x = "(0.5 - 0.4 / 2 + 0.6*0.4) * safezoneW + safezoneX"; - y = "(0 + 0.47*0.3) * safezoneH + safezoneY"; - w = "0.019 * safezoneW"; - h = "0.025 * safezoneH"; + x = "(0.5 - 0.4 / 2 + 0.6*0.4) * safeZoneW + safeZoneX"; + y = "(0 + 0.47*0.3) * safeZoneH + safeZoneY"; + w = "0.019 * safeZoneW"; + h = "0.025 * safeZoneH"; }; }; }; diff --git a/addons/scopes/functions/fnc_applyScopeAdjustment.sqf b/addons/scopes/functions/fnc_applyScopeAdjustment.sqf index b813dde9ef8..d356343099d 100644 --- a/addons/scopes/functions/fnc_applyScopeAdjustment.sqf +++ b/addons/scopes/functions/fnc_applyScopeAdjustment.sqf @@ -43,6 +43,10 @@ if (cameraView == "GUNNER") then { _yaw = _yaw + _windageDifference; [_unit, _pitch, _bank, _yaw] call EFUNC(common,setPitchBankYaw); }; + + if (GVAR(inScopeAdjustment)) then { + [] call FUNC(showZeroing); + }; } else { [] call FUNC(showZeroing); }; diff --git a/addons/scopes/functions/fnc_calculateZeroAngleCorrection.sqf b/addons/scopes/functions/fnc_calculateZeroAngleCorrection.sqf index ab84db7cde1..670a119f839 100644 --- a/addons/scopes/functions/fnc_calculateZeroAngleCorrection.sqf +++ b/addons/scopes/functions/fnc_calculateZeroAngleCorrection.sqf @@ -36,25 +36,21 @@ if (_initSpeedCoef < 0) then { _initSpeed = _initSpeed * (-1 * _initSpeedCoef); }; -private _zeroAngle = "ace_advanced_ballistics" callExtension format ["replicateVanillaZero:%1:%2:%3", _oldZeroRange, _initSpeed, _airFriction]; -private _vanillaZero = parseNumber _zeroAngle; +private _vanillaZero = parseNumber (("ace" callExtension ["ballistics:replicate_vanilla_zero", [_oldZeroRange, _initSpeed, _airFriction]]) select 0); #ifdef DISABLE_DISPERSION _vanillaZero = 0; #endif -private _trueZero = if (!_advancedBallistics) then { - _zeroAngle = "ace_advanced_ballistics" callExtension format ["calcZero:%1:%2:%3:%4", _newZeroRange, _initSpeed, _airFriction, _boreHeight]; - (parseNumber _zeroAngle) -} else { +private _trueZero = if (_advancedBallistics) then { // Get Weapon and Ammo Configurations private _AmmoCacheEntry = uiNamespace getVariable format[QEGVAR(advanced_ballistics,%1), _ammo]; if (isNil "_AmmoCacheEntry") then { - _AmmoCacheEntry = _ammo call EFUNC(advanced_ballistics,readAmmoDataFromConfig); + _AmmoCacheEntry = _ammo call EFUNC(advanced_ballistics,readAmmoDataFromConfig); }; private _WeaponCacheEntry = uiNamespace getVariable format[QEGVAR(advanced_ballistics,%1), _weapon]; if (isNil "_WeaponCacheEntry") then { - _WeaponCacheEntry = _weapon call EFUNC(advanced_ballistics,readWeaponDataFromConfig); + _WeaponCacheEntry = _weapon call EFUNC(advanced_ballistics,readWeaponDataFromConfig); }; _AmmoCacheEntry params ["_airFriction", "_caliber", "_bulletLength", "_bulletMass", "_transonicStabilityCoef", "_dragModel", "_ballisticCoefficients", "_velocityBoundaries", "_atmosphereModel", "_ammoTempMuzzleVelocityShifts", "_muzzleVelocityTable", "_barrelLengthTable", "_muzzleVelocityVariationSD"]; @@ -70,8 +66,21 @@ private _trueZero = if (!_advancedBallistics) then { _initSpeed = _initSpeed + _ammoTemperatureVelocityShift; }; - _zeroAngle = "ace_advanced_ballistics" callExtension format ["calcZeroAB:%1:%2:%3:%4:%5:%6:%7:%8:%9", _newZeroRange, _initSpeed, _boreHeight, GVAR(zeroReferenceTemperature), GVAR(zeroReferenceBarometricPressure), GVAR(zeroReferenceHumidity), _ballisticCoefficients select 0, _dragModel, _atmosphereModel]; - (parseNumber _zeroAngle) + parseNumber ( + ("ace" callExtension ["ballistics:zero_advanced", [ + _newZeroRange, + _initSpeed, + _boreHeight, + GVAR(zeroReferenceTemperature), + GVAR(zeroReferenceBarometricPressure), + GVAR(zeroReferenceHumidity), + _ballisticCoefficients select 0, + _dragModel, + _atmosphereModel + ]]) select 0 + ) +} else { + parseNumber (("ace" callExtension ["ballistics:zero_vanilla", [_newZeroRange, _initSpeed, _airFriction, _boreHeight]]) select 0) }; private _zeroAngleCorrection = _trueZero - _vanillaZero; diff --git a/addons/scopes/functions/fnc_getOptics.sqf b/addons/scopes/functions/fnc_getOptics.sqf index d419d8d7f05..c52b032008c 100644 --- a/addons/scopes/functions/fnc_getOptics.sqf +++ b/addons/scopes/functions/fnc_getOptics.sqf @@ -19,14 +19,4 @@ params ["_unit"]; -private _optics = ["", "", ""]; - -if !(_unit isKindOf "CAManBase") exitWith {_optics}; - -{ - if (count _x >= 2) then { - _optics set [_forEachIndex, _x select 2]; - }; -} forEach [primaryWeaponItems _unit, secondaryWeaponItems _unit, handgunItems _unit]; - -_optics +[primaryWeaponItems _unit, secondaryWeaponItems _unit, handgunItems _unit] apply {_x select 2} // return diff --git a/addons/scopes/initSettings.inc.sqf b/addons/scopes/initSettings.inc.sqf index 40ed62cbcc2..e74bcb4c073 100644 --- a/addons/scopes/initSettings.inc.sqf +++ b/addons/scopes/initSettings.inc.sqf @@ -76,18 +76,26 @@ private _category = format ["ACE %1", localize LSTRING(DisplayName)]; true // Needs mission restart ] call CBA_fnc_addSetting; +[ + QGVAR(simplifiedZeroing), "CHECKBOX", + [LSTRING(simplifiedZeroing_displayName), LSTRING(simplifiedZeroing_description)], + _category, + false, + 1 +] call CBA_fnc_addSetting; + [ QGVAR(useLegacyUI), "CHECKBOX", [LSTRING(useLegacyUI_displayName), LSTRING(useLegacyUI_description)], _category, false, - 0 + 2 ] call CBA_fnc_addSetting; [ - QGVAR(simplifiedZeroing), "CHECKBOX", - [LSTRING(simplifiedZeroing_displayName), LSTRING(simplifiedZeroing_description)], + QGVAR(inScopeAdjustment), "CHECKBOX", + LSTRING(inScopeAdjustment_displayName), _category, false, - 1 + 0 ] call CBA_fnc_addSetting; diff --git a/addons/scopes/stringtable.xml b/addons/scopes/stringtable.xml index 9a47f657cc0..f04e5d767ef 100644 --- a/addons/scopes/stringtable.xml +++ b/addons/scopes/stringtable.xml @@ -21,7 +21,7 @@ <English>Enable ACE Scope adjustment</English> <German>Aktiviere das Nullen von Zielfernrohren</German> <Japanese>ACE スコープ調節を有効化</Japanese> - <Korean>ACE 조준경 영점조작 활성화</Korean> + <Korean>ACE 조준경 영점조절 활성화</Korean> <Polish>Włącz ustawienia celowników optycznych ACE</Polish> <French>Activer le réglage ACE des lunettes</French> <Italian>Abilita Regolazione Mirino ACE</Italian> @@ -337,7 +337,7 @@ <German>Repliziert das Vanilla-Zeroing-System für Zielfernrohre.</German> <Japanese>バニラ(ゲーム標準)のライフルスコープ用ゼロイン調整システムを再現します。</Japanese> <Italian>Replica il sistema di azzeramento vanilla per le ottiche.</Italian> - <Korean>라이플 스코프용 바닐라 영점조정 시스템을 복제합니다.</Korean> + <Korean>라이플 스코프용 바닐라 영점조절 시스템을 복제합니다.</Korean> <Chinese>使用原版的歸零系統來取代ACE複雜的歸零模擬。</Chinese> <Chinesesimp>使用原版的归零系统来取代 ACE 复杂的归零模拟。</Chinesesimp> <Polish>Replikuje system zerowania, dla celowników karabinowych, z domyślnej gry.</Polish> @@ -347,6 +347,14 @@ <Czech>Replikuje systém naměřování puškohledů ze základní hry.</Czech> <Spanish>Replica en los visores el sistema de homogeneizado de vanilla</Spanish> </Key> + <Key ID="STR_ACE_Scopes_inScopeAdjustment_displayName"> + <English>Show adjustment UI in scope</English> + <German>Zeige Absehenverstellungs-UI im Zielfernrohr</German> + <Italian>Mostra UI delle manopole nel mirino</Italian> + <Japanese>調整UIをスコープ内に表示</Japanese> + <Korean>스코프에 조절 UI 보이기</Korean> + <Russian>Показать интерфейс настройки в области видимости.</Russian> + </Key> <Key ID="STR_ACE_Scopes_AdjustUpMinor"> <English>Minor adjustment up</English> <German>Kleine Korrektur hoch</German> @@ -496,7 +504,7 @@ <German>Nullung zurücksetzen</German> <Japanese>ゼロイン調節を初期化</Japanese> <Italian>Resetta l'azzeramento</Italian> - <Korean>영점 조정 재설정</Korean> + <Korean>영점 조절 재설정</Korean> <Chinese>重設歸零</Chinese> <Chinesesimp>重设归零</Chinesesimp> <Polish>Zresetuj wyzerowanie</Polish> diff --git a/addons/sitting/functions/fnc_canSit.sqf b/addons/sitting/functions/fnc_canSit.sqf index 4328234bd90..609bcea6828 100644 --- a/addons/sitting/functions/fnc_canSit.sqf +++ b/addons/sitting/functions/fnc_canSit.sqf @@ -21,6 +21,7 @@ params ["_seat", "_player", ["_seatPos", 0]]; // Sitting enabled, not occupied and standing up (or not on a big slope) XGVAR(enable) && +{[_player, _seat] call EFUNC(common,canInteractWith)} && {isNil {_player getVariable QGVAR(sittingStatus)}} && { private _seatsClaimed = _seat getVariable [QGVAR(seatsClaimed), []]; diff --git a/addons/sitting/functions/fnc_sit.sqf b/addons/sitting/functions/fnc_sit.sqf index 033a1f4d2ca..d359083c44a 100644 --- a/addons/sitting/functions/fnc_sit.sqf +++ b/addons/sitting/functions/fnc_sit.sqf @@ -56,7 +56,7 @@ TRACE_2("Sit pos and dir",_sitPosition,_sitDirection); // Set direction and position _player setDir _sitDirection; //modelToWorld returns AGL -_player setPosASL (AGLtoASL (_seat modelToWorld _sitPosition)); +_player setPosASL (AGLToASL (_seat modelToWorld _sitPosition)); // Set variables, save seat object on player _player setVariable [QGVAR(sittingStatus), [_seat, _actionID, _seatPos]]; diff --git a/addons/smallarms/stringtable.xml b/addons/smallarms/stringtable.xml index 0b89a38b0d0..c31dad8f3eb 100644 --- a/addons/smallarms/stringtable.xml +++ b/addons/smallarms/stringtable.xml @@ -12,7 +12,7 @@ <German>17-Schuss-9mm-Magazin</German> <Czech>9 mm, 17ks zásobník</Czech> <Portuguese>Carregador 17Mun. 9 mm</Portuguese> - <Korean>9mm 17발 탄창</Korean> + <Korean>9mm 17발 들이 탄창</Korean> <Chinesesimp>9 mm 17发 弹匣</Chinesesimp> <Japanese>9mm 17Rnd マガジン</Japanese> <Turkish>9 mm 17 Merm. Şarjör</Turkish> @@ -29,7 +29,8 @@ <Turkish>.45 ACP 25 Merm. Şarjör</Turkish> <Japanese>.45 ACP 25Rnd マガジン</Japanese> <Chinesesimp>.45 ACP 25发 弹匣</Chinesesimp> - <Korean>.45 ACP 25발 탄창</Korean> + <Korean>.45구경 ACP 25발 들이 탄창</Korean> + <Portuguese>Carregador 25Mun. .45 ACP</Portuguese> </Key> <Key ID="STR_ACE_SmallArms_25Rnd_45_Tracer_Green_Name"> <English>.45 ACP 25Rnd Tracers (Green) Mag</English> @@ -43,7 +44,8 @@ <Turkish>.45 ACP 25 Merm. İzli (Yeşil) Şarjör</Turkish> <Japanese>.45 ACP 25Rnd トレーサー (緑) マガジン</Japanese> <Chinesesimp>.45 ACP 25发 弹匣(曳光,绿)</Chinesesimp> - <Korean>.45 ACP 25발 예광탄 (초록) 탄창</Korean> + <Korean>.45구경 ACP 25발 들이 탄창 (녹색 예광탄)</Korean> + <Portuguese>Carregador 25Mun. .45 ACP Traçante (Verde)</Portuguese> </Key> <Key ID="STR_ACE_SmallArms_25Rnd_45_Tracer_Red_Name"> <English>.45 ACP 25Rnd Tracers (Red) Mag</English> @@ -57,7 +59,8 @@ <Turkish>.45 ACP 25 Merm. İzli (Kırmızı) Şarjör</Turkish> <Japanese>.45 ACP 25Rnd トレーサー (赤) マガジン</Japanese> <Chinesesimp>.45 ACP 25发 弹匣(曳光,红)</Chinesesimp> - <Korean>.45 ACP 25발 예광탄 (빨강) 탄창</Korean> + <Korean>.45구경 ACP 25발 들이 탄창 (적색 예광탄)</Korean> + <Portuguese>Carregador 25Mun. .45 ACP Traçante (Vermelha)</Portuguese> </Key> <Key ID="STR_ACE_SmallArms_25Rnd_45_Tracer_Yellow_Name"> <English>.45 ACP 25Rnd Tracers (Yellow) Mag</English> @@ -71,7 +74,8 @@ <Turkish>.45 ACP 25 Merm. İzli (Sarı) Şarjör</Turkish> <Japanese>.45 ACP 25Rnd トレーサー (黄) マガジン</Japanese> <Chinesesimp>.45 ACP 25发 弹匣(曳光,黄)</Chinesesimp> - <Korean>.45 ACP 25발 예광탄 (노랑) 탄창</Korean> + <Korean>.45구경 ACP 25발 들이 탄창 (황색 예광탄)</Korean> + <Portuguese>Carregador 25Mun. .45 ACP Traçante (Amarela)</Portuguese> </Key> <Key ID="STR_ACE_SmallArms_8Rnd_45_Name"> <English>.45 ACP 8Rnd Mag</English> @@ -85,7 +89,8 @@ <Turkish>.45 ACP 8 Merm. Şarjör</Turkish> <Japanese>.45 ACP 8Rnd マガジン</Japanese> <Chinesesimp>.45 ACP 8发 弹匣</Chinesesimp> - <Korean>.45 ACP 8발 탄창</Korean> + <Korean>.45구경 ACP 8발 들이 탄창</Korean> + <Portuguese>Carregador 8Mun. .45 ACP</Portuguese> </Key> <Key ID="STR_ACE_SmallArms_15Rnd_45_Name"> <English>.45 ACP 15Rnd Mag</English> @@ -99,7 +104,8 @@ <Turkish>.45 ACP 15 Merm. Şarjör</Turkish> <Japanese>.45 ACP 15Rnd マガジン</Japanese> <Chinesesimp>.45 ACP 15发 弹匣</Chinesesimp> - <Korean>.45 ACP 15발 탄창</Korean> + <Korean>.45구경 ACP 15발 들이 탄창</Korean> + <Portuguese>Carregador 15Mun. .45 ACP</Portuguese> </Key> </Package> </Project> diff --git a/addons/spectator/functions/fnc_cam_setVisionMode.sqf b/addons/spectator/functions/fnc_cam_setVisionMode.sqf index 5bcf8710b6b..eaec12a86d3 100644 --- a/addons/spectator/functions/fnc_cam_setVisionMode.sqf +++ b/addons/spectator/functions/fnc_cam_setVisionMode.sqf @@ -29,10 +29,10 @@ if !(_newVision in _visions) then { if (GVAR(camMode) != MODE_FPS) then { // 0+ are all thermal vision types if (_newVision < 0) then { - false setCamUseTi 0; + false setCamUseTI 0; camUseNVG (_newVision >= VISION_NVG); } else { - true setCamUseTi _newVision; + true setCamUseTI _newVision; }; // Give user feedback that vision mode changed diff --git a/addons/spectator/functions/fnc_cam_tick.sqf b/addons/spectator/functions/fnc_cam_tick.sqf index 1e7e1b99137..11f257b7d5a 100644 --- a/addons/spectator/functions/fnc_cam_tick.sqf +++ b/addons/spectator/functions/fnc_cam_tick.sqf @@ -58,7 +58,9 @@ if (_cameraMode != MODE_FREE) then { _camTarget = GVAR(camFocus); // Focus get in / out of vehicle state -if !(isNull _camTarget) then { +if (isNull _camTarget) then { + GVAR(camTargetInVehicle) = false; +} else { private _targetInVeh = GVAR(camTargetInVehicle); if (GVAR(camHasTarget)) then { @@ -72,8 +74,6 @@ if !(isNull _camTarget) then { GVAR(camTargetInVehicle) = false; }; }; -} else { - GVAR(camTargetInVehicle) = false; }; // Camera lights diff --git a/addons/spectator/functions/fnc_handleFired.sqf b/addons/spectator/functions/fnc_handleFired.sqf index f8683af947e..9817452386e 100644 --- a/addons/spectator/functions/fnc_handleFired.sqf +++ b/addons/spectator/functions/fnc_handleFired.sqf @@ -27,7 +27,7 @@ params [ // Remove the EH when spectator is no longer active or unit is removed if (isNil QGVAR(entitiesToDraw) || {!(_unit in GVAR(entitiesToDraw))}) exitWith { - //USES_VARIABLES ["_thisEventHandler"] + //IGNORE_PRIVATE_WARNING ["_thisEventHandler"]; _unit removeEventHandler ["Fired", _thisEventHandler]; SETVAR(_unit,GVAR(firedEH),nil); }; diff --git a/addons/spectator/functions/fnc_setCameraAttributes.sqf b/addons/spectator/functions/fnc_setCameraAttributes.sqf index f33f23c09a4..48cc4fb0c58 100644 --- a/addons/spectator/functions/fnc_setCameraAttributes.sqf +++ b/addons/spectator/functions/fnc_setCameraAttributes.sqf @@ -88,7 +88,7 @@ if (!isNil QGVAR(camera)) then { // GVARs exits purely for pre-setting of these attributes if (!isNil "_position") then { - GVAR(camPos) = ATLtoASL _position; + GVAR(camPos) = ATLToASL _position; }; if (!isNil "_direction") then { diff --git a/addons/spectator/functions/fnc_ui_handleKeyDown.sqf b/addons/spectator/functions/fnc_ui_handleKeyDown.sqf index c26a06786d7..59dd418782a 100644 --- a/addons/spectator/functions/fnc_ui_handleKeyDown.sqf +++ b/addons/spectator/functions/fnc_ui_handleKeyDown.sqf @@ -108,13 +108,13 @@ if (_key == DIK_L) exitWith { { deleteVehicle _x; } forEach GVAR(camLights); GVAR(camLights) = []; } else { - private _cameraLight = "#lightpoint" createvehicleLocal getPosASL GVAR(camera); + private _cameraLight = "#lightpoint" createVehicleLocal getPosASL GVAR(camera); _cameraLight setLightBrightness 2; _cameraLight setLightAmbient [1,1,1]; _cameraLight setLightColor [0,0,0]; _cameraLight lightAttachObject [GVAR(camera), [0,0,0]]; - private _pointerLight = "#lightpoint" createvehicleLocal getPosASL GVAR(camera); + private _pointerLight = "#lightpoint" createVehicleLocal getPosASL GVAR(camera); _pointerLight setLightBrightness 1; _pointerLight setLightAmbient [1,1,1]; _pointerLight setLightColor [0,0,0]; diff --git a/addons/spectator/functions/fnc_ui_handleListClick.sqf b/addons/spectator/functions/fnc_ui_handleListClick.sqf index 600b7e711ce..f81a73f4fd1 100644 --- a/addons/spectator/functions/fnc_ui_handleListClick.sqf +++ b/addons/spectator/functions/fnc_ui_handleListClick.sqf @@ -33,7 +33,7 @@ if !(isNull _object) then { if (_dblClick) then { // Place camera within ~10m of the object and above ground level private _pos = getPosASLVisual _object; - GVAR(camera) setPosASL (AGLtoASL (_pos getPos [1 + random 10, random 360]) vectorAdd [0,0,2 + random 10]); + GVAR(camera) setPosASL (AGLToASL (_pos getPos [1 + random 10, random 360]) vectorAdd [0,0,2 + random 10]); // Reset the focus [objNull] call FUNC(setFocus); diff --git a/addons/spectator/functions/fnc_ui_updateHelp.sqf b/addons/spectator/functions/fnc_ui_updateHelp.sqf index 1ddbbacad91..4a226bf3613 100644 --- a/addons/spectator/functions/fnc_ui_updateHelp.sqf +++ b/addons/spectator/functions/fnc_ui_updateHelp.sqf @@ -31,7 +31,7 @@ private _controls = []; // When not in first person, camera rotation applies if (_cameraMode != MODE_FPS) then { - _controls pushback ["[RMB]", localize "STR_A3_Spectator_Helper_CameraRotation"]; + _controls pushBack ["[RMB]", localize "STR_A3_Spectator_Helper_CameraRotation"]; }; // When in free camera, focus/un-focus with LMB @@ -52,31 +52,31 @@ if (_hasTarget && {count _availableModes > 1}) then { }; if (_cameraMode == MODE_FREE) then { - _controls pushback [ + _controls pushBack [ format ["[%1/%2]", [DIK_W] call CBA_fnc_localizeKey, [DIK_S] call CBA_fnc_localizeKey], localize "STR_A3_Spectator_Helper_Movement" ]; - _controls pushback [ + _controls pushBack [ format ["[%1/%2]", [DIK_A] call CBA_fnc_localizeKey, [DIK_D] call CBA_fnc_localizeKey], localize "STR_A3_Spectator_Helper_Strafing" ]; - _controls pushback [ + _controls pushBack [ format ["[%1/%2]", [DIK_Q] call CBA_fnc_localizeKey, [DIK_Z] call CBA_fnc_localizeKey], localize "STR_A3_Spectator_Helper_Height" ]; } else { - _controls pushback [ + _controls pushBack [ format ["[%1]", toUpper ([DIK_RIGHT] call CBA_fnc_localizeKey)], localize LSTRING(nextUnit) ]; - _controls pushback [ + _controls pushBack [ format ["[%1]", toUpper ([DIK_LEFT] call CBA_fnc_localizeKey)], localize LSTRING(prevUnit) ]; }; if (_cameraMode != MODE_FPS) then { - _controls pushback [ + _controls pushBack [ format ["[%1]", ([DIK_N] call CBA_fnc_localizeKey)], localize LSTRING(nextVis) ]; @@ -128,7 +128,7 @@ lnbClear _help; // Set height based on number of rows private _newH = (GVAR(uiHelpH) / MAX_CONTROLS_HELP_ENTRIES) * count _controls; -private _newY = safezoneY + safezoneH - _newH; +private _newY = safeZoneY + safeZoneH - _newH; (ctrlPosition _help) params ["_newX","","_newW"]; diff --git a/addons/spectator/functions/fnc_ui_updateIconsToDraw.sqf b/addons/spectator/functions/fnc_ui_updateIconsToDraw.sqf index 6093467d639..e5a736a7754 100644 --- a/addons/spectator/functions/fnc_ui_updateIconsToDraw.sqf +++ b/addons/spectator/functions/fnc_ui_updateIconsToDraw.sqf @@ -89,7 +89,7 @@ private _camPos = AGLToASL positionCameraToWorld [0,0,0]; 0, _heightByDistance, 0, - groupID _group, + groupId _group, 2, _fontSizeByDistance, "PuristaMedium", diff --git a/addons/spectator/functions/fnc_ui_updateListEntities.sqf b/addons/spectator/functions/fnc_ui_updateListEntities.sqf index 000f9a4b226..969460329c9 100644 --- a/addons/spectator/functions/fnc_ui_updateListEntities.sqf +++ b/addons/spectator/functions/fnc_ui_updateListEntities.sqf @@ -54,7 +54,7 @@ private _entities = [true] call FUNC(getTargetEntities); // Cache the info of the group itself private _groupTexture = [_group] call FUNC(getGroupIcon); - private _groupInfo = [_group, str _group, _groupTexture, groupID _group]; + private _groupInfo = [_group, str _group, _groupTexture, groupId _group]; // Add the group to the correct side private _side = side _group; diff --git a/addons/spectator/script_component.hpp b/addons/spectator/script_component.hpp index b4e7c82ac88..c29c60bdefc 100644 --- a/addons/spectator/script_component.hpp +++ b/addons/spectator/script_component.hpp @@ -17,12 +17,12 @@ #include "\z\ace\addons\main\script_macros.hpp" // UI grid -#define SIZEX ((safezoneW / safezoneH) min 1.2) +#define SIZEX ((safeZoneW / safeZoneH) min 1.2) #define SIZEY (SIZEX / 1.2) #define W_PART(num) (num * (SIZEX / 40)) #define H_PART(num) (num * (SIZEY / 25)) -#define X_PART(num) (W_PART(num) + (safezoneX + (safezoneW - SIZEX)/2)) -#define Y_PART(num) (H_PART(num) + (safezoneY + (safezoneH - SIZEY)/2)) +#define X_PART(num) (W_PART(num) + (safeZoneX + (safeZoneW - SIZEX)/2)) +#define Y_PART(num) (H_PART(num) + (safeZoneY + (safeZoneH - SIZEY)/2)) // UI/Camera related values #define SPEED_SLOW 0.1 diff --git a/addons/spectator/ui.hpp b/addons/spectator/ui.hpp index f61e7749eea..d81887db760 100644 --- a/addons/spectator/ui.hpp +++ b/addons/spectator/ui.hpp @@ -82,7 +82,7 @@ class GVAR(display) { onMouseExit = QUOTE([true] call FUNC(ui_fadeList)); x = "safeZoneX"; - y = "safezoneY"; + y = "safeZoneY"; w = QUOTE(W_PART(13.5)); h = QUOTE(H_PART(1.5)); @@ -98,7 +98,7 @@ class GVAR(display) { class CameraTypesGroup: RscControlsGroupNoScrollbars { idc = IDC_CAM_TYPES; x = QUOTE(X_PART(15.5)); - y = QUOTE(safezoneY + safezoneH - H_PART(2.38)); + y = QUOTE(safeZoneY + safeZoneH - H_PART(2.38)); w = QUOTE(W_PART(8.6)); h = 2.6; class controls { @@ -245,8 +245,8 @@ class GVAR(display) { }; class HelpBackground: RscText { idc = IDC_HELP_BACK; - x = QUOTE(safezoneX + safezoneW - W_PART(12)); - y = QUOTE(safezoneY + safezoneH - H_PART(8)); + x = QUOTE(safeZoneX + safeZoneW - W_PART(12)); + y = QUOTE(safeZoneY + safeZoneH - H_PART(8)); w = QUOTE(W_PART(12)); h = QUOTE(H_PART(8)); colorBackground[] = {0,0,0,0.75}; @@ -256,8 +256,8 @@ class GVAR(display) { disableOverflow = 0; rowHeight = QUOTE(H_PART(1)); idc = IDC_HELP; - x = QUOTE(safezoneX + safezoneW - W_PART(12)); - y = QUOTE(safezoneY + safezoneH - H_PART(12)); + x = QUOTE(safeZoneX + safeZoneW - W_PART(12)); + y = QUOTE(safeZoneY + safeZoneH - H_PART(12)); w = QUOTE(W_PART(12)); h = QUOTE(H_PART(12)); }; diff --git a/addons/spottingscope/script_component.hpp b/addons/spottingscope/script_component.hpp index 6b2d95abbd5..cf7b8a835f7 100644 --- a/addons/spottingscope/script_component.hpp +++ b/addons/spottingscope/script_component.hpp @@ -16,8 +16,8 @@ #include "\z\ace\addons\main\script_macros.hpp" -#define POS_X_BASE(size) safezoneX + 0.5 * safezoneW - 0.5 * (size) / (getResolution select 5) -#define POS_Y_BASE(size) safezoneY + 0.5 * safezoneH - 0.5 * (size) / (getResolution select 5) * 4/3 +#define POS_X_BASE(size) safeZoneX + 0.5 * safeZoneW - 0.5 * (size) / (getResolution select 5) +#define POS_Y_BASE(size) safeZoneY + 0.5 * safeZoneH - 0.5 * (size) / (getResolution select 5) * 4/3 #define POS_W_BASE(size) (size) / (getResolution select 5) #define POS_H_BASE(size) (size) / (getResolution select 5) * 4/3 diff --git a/addons/switchunits/functions/fnc_initPlayer.sqf b/addons/switchunits/functions/fnc_initPlayer.sqf index ffc0f7ad630..ba9c3f77b30 100644 --- a/addons/switchunits/functions/fnc_initPlayer.sqf +++ b/addons/switchunits/functions/fnc_initPlayer.sqf @@ -36,7 +36,7 @@ if (vehicle _playerUnit == _playerUnit) then { removeAllContainers _playerUnit; _playerUnit linkItem "ItemMap"; - [_playerUnit, "forceWalk", "ACE_SwitchUnits", true] call EFUNC(common,statusEffect_set); + [_playerUnit, "forceWalk", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); [] call FUNC(addMapFunction); }; diff --git a/addons/tacticalladder/functions/fnc_cancelTLdeploy.sqf b/addons/tacticalladder/functions/fnc_cancelTLdeploy.sqf index 7c05cbbe63b..24013f02d74 100644 --- a/addons/tacticalladder/functions/fnc_cancelTLdeploy.sqf +++ b/addons/tacticalladder/functions/fnc_cancelTLdeploy.sqf @@ -23,8 +23,8 @@ params ["_unit", "_key"]; if (_key != 1 || {isNull GVAR(ladder)}) exitWith {}; // enable running again -[_unit, "forceWalk", "ACE_Ladder", false] call EFUNC(common,statusEffect_set); -[_unit, "blockThrow", "ACE_Ladder", false] call EFUNC(common,statusEffect_set); +[_unit, "forceWalk", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); +[_unit, "blockThrow", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); detach GVAR(ladder); diff --git a/addons/tacticalladder/functions/fnc_confirmTLdeploy.sqf b/addons/tacticalladder/functions/fnc_confirmTLdeploy.sqf index 9fe13e4e658..8211dc5f9d0 100644 --- a/addons/tacticalladder/functions/fnc_confirmTLdeploy.sqf +++ b/addons/tacticalladder/functions/fnc_confirmTLdeploy.sqf @@ -19,8 +19,8 @@ params ["_unit", "_ladder"]; // enable running again -[_unit, "forceWalk", "ACE_Ladder", false] call EFUNC(common,statusEffect_set); -[_unit, "blockThrow", "ACE_Ladder", false] call EFUNC(common,statusEffect_set); +[_unit, "forceWalk", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); +[_unit, "blockThrow", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); private _pos1 = getPosASL _ladder; private _pos2 = _ladder modelToWorldWorld (_ladder selectionPosition "check2"); diff --git a/addons/tacticalladder/functions/fnc_positionTL.sqf b/addons/tacticalladder/functions/fnc_positionTL.sqf index 6d6f78f1a34..e9168d75a1a 100644 --- a/addons/tacticalladder/functions/fnc_positionTL.sqf +++ b/addons/tacticalladder/functions/fnc_positionTL.sqf @@ -21,8 +21,8 @@ params ["_unit", "_ladder"]; // prevent the placing unit from running -[_unit, "forceWalk", "ACE_Ladder", true] call EFUNC(common,statusEffect_set); -[_unit, "blockThrow", "ACE_Ladder", true] call EFUNC(common,statusEffect_set); +[_unit, "forceWalk", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); +[_unit, "blockThrow", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); { _ladder animate [_x, 0]; diff --git a/addons/tacticalladder/stringtable.xml b/addons/tacticalladder/stringtable.xml index a7d33865f96..298c0e3c442 100644 --- a/addons/tacticalladder/stringtable.xml +++ b/addons/tacticalladder/stringtable.xml @@ -79,7 +79,7 @@ <French>+Ctrl incliner</French> <Italian>+Ctrl per inclinare</Italian> <Japanese>+Ctrl で傾ける</Japanese> - <Korean>+컨트롤 키 기울이기</Korean> + <Korean>+컨트롤 키로 기울이기</Korean> <Chinesesimp>+Ctrl 倾斜</Chinesesimp> <Chinese>+Ctrl 傾斜</Chinese> </Key> diff --git a/addons/tagging/functions/fnc_addTagActions.sqf b/addons/tagging/functions/fnc_addTagActions.sqf index 9c720e1f6c5..79603487408 100644 --- a/addons/tagging/functions/fnc_addTagActions.sqf +++ b/addons/tagging/functions/fnc_addTagActions.sqf @@ -19,6 +19,7 @@ params ["_unit"]; private _actions = []; { + //IGNORE_PRIVATE_WARNING ["_player", "_target"]; _actions pushBack [ [ format ["ACE_TagItem_%1", _x], diff --git a/addons/tagging/functions/fnc_checkTaggable.sqf b/addons/tagging/functions/fnc_checkTaggable.sqf index ef20062a32d..5f9d162694d 100644 --- a/addons/tagging/functions/fnc_checkTaggable.sqf +++ b/addons/tagging/functions/fnc_checkTaggable.sqf @@ -17,6 +17,7 @@ [_this, { params ["_unit"]; + //IGNORE_PRIVATE_WARNING ["_unit"]; // Exit if no required item in inventory if ([_unit, { diff --git a/addons/tagging/functions/fnc_compileTagAction.sqf b/addons/tagging/functions/fnc_compileTagAction.sqf index a49de10f47d..3b9e060c5c3 100644 --- a/addons/tagging/functions/fnc_compileTagAction.sqf +++ b/addons/tagging/functions/fnc_compileTagAction.sqf @@ -24,6 +24,7 @@ _actions pushBack ([ _displayName, _icon, { + //IGNORE_PRIVATE_WARNING ["_player", "_target"]; (_this select 2) params ["_class", "_textures", "_materials", "_tagModel"]; ( diff --git a/addons/tagging/functions/fnc_createTag.sqf b/addons/tagging/functions/fnc_createTag.sqf index 90923cc8034..134e37bcc0a 100644 --- a/addons/tagging/functions/fnc_createTag.sqf +++ b/addons/tagging/functions/fnc_createTag.sqf @@ -68,7 +68,7 @@ if (_object getVariable [QGVAR(testVar), false]) then { if (_selection == "" && _damage >= 1) then { { deleteVehicle _x; - } foreach (_object getVariable [QGVAR(attachedTags), []]); + } forEach (_object getVariable [QGVAR(attachedTags), []]); _object setVariable [QGVAR(attachedTags), []]; }; }]; diff --git a/addons/towing/config.cpp b/addons/towing/config.cpp index d4d1b5e8540..7c98be1756c 100644 --- a/addons/towing/config.cpp +++ b/addons/towing/config.cpp @@ -6,7 +6,7 @@ class CfgPatches { units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"ace_common", "ace_logistics_rope"}; + requiredAddons[] = {"ace_interaction", "ace_logistics_rope"}; author = ECSTRING(common,ACETeam); authors[] = {"tcvm"}; url = ECSTRING(main,URL); @@ -16,4 +16,3 @@ class CfgPatches { #include "CfgEventHandlers.hpp" #include "CfgVehicles.hpp" - diff --git a/addons/towing/functions/fnc_attachRopePFH.sqf b/addons/towing/functions/fnc_attachRopePFH.sqf index 37f626e0a92..31def8dcb83 100644 --- a/addons/towing/functions/fnc_attachRopePFH.sqf +++ b/addons/towing/functions/fnc_attachRopePFH.sqf @@ -21,7 +21,7 @@ private _viewDirection = getCameraViewDirection _unit; GVAR(attachHelper) setPosASL (_unit modelToWorldVisualWorld [0, 1, 1.5]); private _hintLMB = ""; -private _hintRMB = localize ELSTRING(dragging,Drop); +private _hintRMB = LELSTRING(common,Drop); private _startPos = eyePos _unit; private _endPos = _startPos vectorAdd (_viewDirection vectorMultiply TOW_ACTION_DISTANCE); diff --git a/addons/towing/functions/fnc_towStateMachinePFH.sqf b/addons/towing/functions/fnc_towStateMachinePFH.sqf index 7b295754fad..ad516f211b6 100644 --- a/addons/towing/functions/fnc_towStateMachinePFH.sqf +++ b/addons/towing/functions/fnc_towStateMachinePFH.sqf @@ -70,7 +70,7 @@ switch (_state) do { // can't use createVehicleLocal because rope can be non-local (like parent) and it must be attached to global vehicle GVAR(helper) = createVehicle [QGVAR(helper), [0, 0, 0], [], 0, "CAN_COLLIDE"]; GVAR(helper) attachTo [_unit, [0, 0, 0], "LeftHand", true]; - _rope = ropeCreate [_parent, _parent worldToModelVisual ASLtoAGL getPosASLVisual GVAR(attachHelper), GVAR(helper), [0, 0, 0], _length]; + _rope = ropeCreate [_parent, _parent worldToModelVisual ASLToAGL getPosASLVisual GVAR(attachHelper), GVAR(helper), [0, 0, 0], _length]; _args set [3, _rope]; }; @@ -95,7 +95,7 @@ switch (_state) do { case TOW_STATE_ATTACH: { TRACE_3("state attach",GVAR(attachHelper),_parent,_rope); private _child = GVAR(attachHelper) getVariable [QGVAR(object), objNull]; - private _relativeAttachPos = _child worldToModelVisual ASLtoAGL getPosASLVisual GVAR(attachHelper); + private _relativeAttachPos = _child worldToModelVisual ASLToAGL getPosASLVisual GVAR(attachHelper); TRACE_3("child&pos",_parent,_child,_relativeAttachPos); @@ -118,7 +118,7 @@ switch (_state) do { }; private _hookParent = createVehicle [QGVAR(hook), [0, 0, 0], [], 0, "CAN_COLLIDE"]; - _hookParent attachTo [_parent, _parent worldToModelVisual ASLtoAGL getPosASLVisual _rope]; + _hookParent attachTo [_parent, _parent worldToModelVisual ASLToAGL getPosASLVisual _rope]; private _hook = createVehicle [QGVAR(hook), [0, 0, 0], [], 0, "CAN_COLLIDE"]; _hook attachTo [_child, _relativeAttachPos]; diff --git a/addons/towing/stringtable.xml b/addons/towing/stringtable.xml index 949d36dd488..7549fb3c8a8 100644 --- a/addons/towing/stringtable.xml +++ b/addons/towing/stringtable.xml @@ -12,6 +12,7 @@ <Chinesesimp>牵引</Chinesesimp> <Korean>견인</Korean> <Spanish>Remolcado</Spanish> + <Portuguese>Rebocando</Portuguese> </Key> <Key ID="STR_ACE_Towing_attach"> <English>Attach Tow Rope</English> @@ -24,6 +25,7 @@ <Chinesesimp>系上牵引绳</Chinesesimp> <Korean>견인줄 부착</Korean> <Spanish>Sujetar cuerda de remolcado</Spanish> + <Portuguese>Fixar corda de reboque</Portuguese> </Key> <Key ID="STR_ACE_Towing_canceled"> <English>Attaching Cancelled</English> @@ -36,6 +38,7 @@ <Chinesesimp>取消系上绳索</Chinesesimp> <Korean>견인 취소됨</Korean> <Spanish>Sujección cancelada</Spanish> + <Portuguese>Reboque cancelado</Portuguese> </Key> <Key ID="STR_ACE_Towing_start3"> <English>Attach Tow Rope (3.2m)</English> @@ -48,6 +51,7 @@ <Chinesesimp>系上牵引绳(3.2米)</Chinesesimp> <Korean>견인줄 부착(3.2M)</Korean> <Spanish>Sujetar cuerda de remolcado (3.2m)</Spanish> + <Portuguese>Fixar corda de reboque (3,2m)</Portuguese> </Key> <Key ID="STR_ACE_Towing_start6"> <English>Attach Tow Rope (6.2m)</English> @@ -60,6 +64,7 @@ <Chinesesimp>系上牵引绳(6.2米)</Chinesesimp> <Korean>견인줄 부착(6.2M)</Korean> <Spanish>Sujetar cuerda de remolcado (6.2m)</Spanish> + <Portuguese>Fixar corda de reboque (6,2m)</Portuguese> </Key> <Key ID="STR_ACE_Towing_start12"> <English>Attach Tow Rope (12.2m)</English> @@ -72,6 +77,7 @@ <Chinesesimp>系上牵引绳(12.2米)</Chinesesimp> <Korean>견인줄 부착(12.2M)</Korean> <Spanish>Sujetar cuerda de remolcado (12.2m)</Spanish> + <Portuguese>Fixar corda de reboque (12,2m)</Portuguese> </Key> <Key ID="STR_ACE_Towing_start15"> <English>Attach Tow Rope (15.2m)</English> @@ -84,6 +90,7 @@ <Chinesesimp>系上牵引绳(15.2米)</Chinesesimp> <Korean>견인줄 부착(15.2M)</Korean> <Spanish>Sujetar cuerda de remolcado (15.2m)</Spanish> + <Portuguese>Fixar corda de reboque (15,2m)</Portuguese> </Key> <Key ID="STR_ACE_Towing_start18"> <English>Attach Tow Rope (18.3m)</English> @@ -96,6 +103,7 @@ <Chinesesimp>系上牵引绳(18.3米)</Chinesesimp> <Korean>견인줄 부착(18.2M)</Korean> <Spanish>Sujetar cuerda de remolcado (18.3m)</Spanish> + <Portuguese>Fixar corda de reboque (18,3m)</Portuguese> </Key> <Key ID="STR_ACE_Towing_start27"> <English>Attach Tow Rope (27.4m)</English> @@ -108,6 +116,7 @@ <Chinesesimp>系上牵引绳(27.4米)</Chinesesimp> <Korean>견인줄 부착(27.4M)</Korean> <Spanish>Sujetar cuerda de remolcado (27.4m)</Spanish> + <Portuguese>Fixar corda de reboque (27,4m)</Portuguese> </Key> <Key ID="STR_ACE_Towing_start36"> <English>Attach Tow Rope (36.6m)</English> @@ -120,6 +129,7 @@ <Chinesesimp>系上牵引绳(36.6米)</Chinesesimp> <Korean>견인줄 부착(36.6M)</Korean> <Spanish>Sujetar cuerda de remolcado (36.6m)</Spanish> + <Portuguese>Fixar corda de reboque (36,6m)</Portuguese> </Key> <Key ID="STR_ACE_Towing_detach"> <English>Detach Tow Rope</English> @@ -132,6 +142,7 @@ <Chinesesimp>解开牵引绳</Chinesesimp> <Korean>견인줄 분리</Korean> <Spanish>Desmontar cuerda de remolcado</Spanish> + <Portuguese>Soltar corda de reboque</Portuguese> </Key> <Key ID="STR_ACE_Towing_Setting_addRopeToVehicleInventory_DisplayName"> <English>Add Tow Rope to Vehicle Inventory</English> @@ -143,6 +154,7 @@ <Japanese>車両のインベントリに牽引ロープを追加する</Japanese> <German>Abschleppseil zum Fahrzeuginventar hinzufügen</German> <French>Ajouter une corde à l'inventaire des véhicules</French> + <Portuguese>Adicionar corda de reboque ao inventário do veículo</Portuguese> </Key> </Package> </Project> diff --git a/addons/trenches/CfgVehicles.hpp b/addons/trenches/CfgVehicles.hpp index bec66e2e641..554a75149b8 100644 --- a/addons/trenches/CfgVehicles.hpp +++ b/addons/trenches/CfgVehicles.hpp @@ -106,4 +106,44 @@ class CfgVehicles { MACRO_ADDITEM(ACE_EntrenchingTool,50); }; }; + + class Wheeled_APC_F; + class APC_Wheeled_02_base_F: Wheeled_APC_F { + class EGVAR(interaction,anims); + }; + class APC_Wheeled_02_base_v2_F: APC_Wheeled_02_base_F { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class showTools { + phase = 0; + positions[] = {{-1.108, -1.47, -0.769}}; + items[] = {"ACE_EntrenchingTool"}; + name = CSTRING(EntrenchingToolName); + text = CSTRING(EntrenchingToolName); + }; + }; + }; + class APC_Wheeled_03_base_F: Wheeled_APC_F { + class EGVAR(interaction,anims) { + class showTools { + phase = 0; + positions[] = {{-0.9, -3, -0.5}}; + items[] = {"ACE_EntrenchingTool"}; + name = CSTRING(EntrenchingToolName); + text = CSTRING(EntrenchingToolName); + }; + }; + }; + + class Tank_F; + class LT_01_base_F: Tank_F { + class EGVAR(interaction,anims) { + class showTools { + phase = 0; + positions[] = {{0.6, 0, -0.3}}; + items[] = {"ACE_EntrenchingTool"}; + name = CSTRING(EntrenchingToolName); + text = CSTRING(EntrenchingToolName); + }; + }; + }; }; diff --git a/addons/trenches/XEH_preInit.sqf b/addons/trenches/XEH_preInit.sqf index 94decd550af..c8c9a3451f9 100644 --- a/addons/trenches/XEH_preInit.sqf +++ b/addons/trenches/XEH_preInit.sqf @@ -8,6 +8,6 @@ PREP_RECOMPILE_END; #include "initSettings.inc.sqf" -GVAR(entrenchingTools) = call (uiNamespace getVariable QGVAR(entrenchingTools)); +GVAR(entrenchingTools) = keys (uiNamespace getVariable QGVAR(entrenchingTools)); ADDON = true; diff --git a/addons/trenches/XEH_preStart.sqf b/addons/trenches/XEH_preStart.sqf index c966b2c9b6d..05065910397 100644 --- a/addons/trenches/XEH_preStart.sqf +++ b/addons/trenches/XEH_preStart.sqf @@ -6,4 +6,4 @@ private _entrenchingTools = (QUOTE(getNumber (_x >> QQGVAR(entrenchingTool)) > 0 _entrenchingTools append (QUOTE(getNumber (_x >> QQGVAR(entrenchingTool)) > 0) configClasses (configFile >> "CfgVehicles") apply {configName _x}); TRACE_1("",_entrenchingTools); -uiNamespace setVariable [QGVAR(entrenchingTools), compileFinal str _entrenchingTools]; +uiNamespace setVariable [QGVAR(entrenchingTools), compileFinal (_entrenchingTools createHashMapFromArray [])]; diff --git a/addons/trenches/functions/fnc_continueDiggingTrench.sqf b/addons/trenches/functions/fnc_continueDiggingTrench.sqf index 78047c189e4..e3aadcfd51c 100644 --- a/addons/trenches/functions/fnc_continueDiggingTrench.sqf +++ b/addons/trenches/functions/fnc_continueDiggingTrench.sqf @@ -81,7 +81,7 @@ if(_actualProgress == 0) then { _cutterPos set [2, getTerrainHeightASL _cutterPos]; _trenchGrassCutter setPosASL _cutterPos; deleteVehicle _trenchGrassCutter; - } foreach getArray (configOf _trench >> QGVAR(grassCuttingPoints)); + } forEach getArray (configOf _trench >> QGVAR(grassCuttingPoints)); }; private _progressLeft = (_actualProgress * 10) + 1; diff --git a/addons/trenches/functions/fnc_hasEntrenchingTool.sqf b/addons/trenches/functions/fnc_hasEntrenchingTool.sqf index 5a1127d0072..1568801fdb8 100644 --- a/addons/trenches/functions/fnc_hasEntrenchingTool.sqf +++ b/addons/trenches/functions/fnc_hasEntrenchingTool.sqf @@ -23,4 +23,4 @@ private _uniqueItems = _unit call EFUNC(common,uniqueItems); _uniqueItems append weapons _unit; _uniqueItems pushBack backpack _unit; -GVAR(entrenchingTools) findIf {_x in _uniqueItems} != -1 // return +GVAR(entrenchingTools) findAny _uniqueItems != -1 // return diff --git a/addons/trenches/functions/fnc_placeCancel.sqf b/addons/trenches/functions/fnc_placeCancel.sqf index a06ecff4590..f3cd20c0beb 100644 --- a/addons/trenches/functions/fnc_placeCancel.sqf +++ b/addons/trenches/functions/fnc_placeCancel.sqf @@ -21,8 +21,8 @@ params ["_unit", "_key"]; if (_key != 1 || {GVAR(digPFH) == -1}) exitWith {}; // enable running again -[_unit, "forceWalk", "ACE_Trenches", false] call EFUNC(common,statusEffect_set); -[_unit, "blockThrow", "ACE_Trenches", false] call EFUNC(common,statusEffect_set); +[_unit, "forceWalk", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); +[_unit, "blockThrow", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); // delete placement dummy deleteVehicle GVAR(trench); diff --git a/addons/trenches/functions/fnc_placeConfirm.sqf b/addons/trenches/functions/fnc_placeConfirm.sqf index 03d4791e026..2cfdaf8891e 100644 --- a/addons/trenches/functions/fnc_placeConfirm.sqf +++ b/addons/trenches/functions/fnc_placeConfirm.sqf @@ -18,8 +18,8 @@ params ["_unit"]; // enable running again -[_unit, "forceWalk", "ACE_Trenches", false] call EFUNC(common,statusEffect_set); -[_unit, "blockThrow", "ACE_Trenches", false] call EFUNC(common,statusEffect_set); +[_unit, "forceWalk", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); +[_unit, "blockThrow", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); // remove dig pfh [GVAR(digPFH)] call CBA_fnc_removePerFrameHandler; @@ -64,7 +64,7 @@ for [{private _ix = -_dx/2},{_ix <= _dx/2},{_ix = _ix + _dx/3}] do { _pos set [2, getTerrainHeightASL _pos]; _pos2 = +_pos; _pos2 set [2, getTerrainHeightASL _pos + 1]; - drawLine3D [ASLtoAGL _pos, ASLtoAGL _pos2, [1,1,0,1]]; + drawLine3D [ASLToAGL _pos, ASLToAGL _pos2, [1,1,0,1]]; #endif }; }; diff --git a/addons/trenches/functions/fnc_placeTrench.sqf b/addons/trenches/functions/fnc_placeTrench.sqf index f49aef4a385..285fe278e94 100644 --- a/addons/trenches/functions/fnc_placeTrench.sqf +++ b/addons/trenches/functions/fnc_placeTrench.sqf @@ -27,8 +27,8 @@ GVAR(trenchPlacementData) = getArray (configFile >> "CfgVehicles" >> _trenchClas TRACE_1("",GVAR(trenchPlacementData)); // prevent the placing unit from running -[_unit, "forceWalk", "ACE_Trenches", true] call EFUNC(common,statusEffect_set); -[_unit, "blockThrow", "ACE_Trenches", true] call EFUNC(common,statusEffect_set); +[_unit, "forceWalk", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); +[_unit, "blockThrow", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); // create the trench private _trench = createVehicle [_noGeoModel, [0, 0, 0], [], 0, "NONE"]; @@ -77,7 +77,7 @@ GVAR(digPFH) = [{ _pos set [2, getTerrainHeightASL _pos]; _pos2 = +_pos; _pos2 set [2, getTerrainHeightASL _pos + 1]; - drawLine3D [ASLtoAGL _pos, ASLtoAGL _pos2, [1,1,0,1]]; + drawLine3D [ASLToAGL _pos, ASLToAGL _pos2, [1,1,0,1]]; #endif }; }; diff --git a/addons/trenches/stringtable.xml b/addons/trenches/stringtable.xml index 4b47ee6a144..5242603bc28 100644 --- a/addons/trenches/stringtable.xml +++ b/addons/trenches/stringtable.xml @@ -237,6 +237,7 @@ <Italian>Camuffa la trincea</Italian> <Japanese>塹壕を偽装</Japanese> <German>Graben tarnen</German> + <Portuguese>Camuflar trincheira</Portuguese> </Key> <Key ID="STR_ACE_Trenches_RemovingTrench"> <English>Removing Trench</English> @@ -265,6 +266,7 @@ <Italian>ACE Trincee</Italian> <Chinesesimp>ACE 战壕</Chinesesimp> <Korean>ACE 참호</Korean> + <Portuguese>ACE Trincheiras</Portuguese> </Key> <Key ID="STR_ACE_Trenches_SmallEnvelopeDigDuration_DisplayName"> <English>Small Trench Dig Duration</English> @@ -277,6 +279,7 @@ <Italian>Trincea piccola - Durata di scavo</Italian> <Chinesesimp>小型战壕挖掘时间</Chinesesimp> <Korean>소형참호 건설 시간</Korean> + <Portuguese>Duração de Escavamento de Trincheira Pequena</Portuguese> </Key> <Key ID="STR_ACE_Trenches_SmallEnvelopeDigDuration_Description"> <English>Time, in seconds, required to dig a small trench.</English> @@ -289,6 +292,7 @@ <Italian>Tempo in secondi per scavare una trincea piccola.</Italian> <Chinesesimp>挖一条小型战壕所需的时间(秒)。</Chinesesimp> <Korean>소형 참호를 팔 때 필요한 시간을 설정합니다. (초 단위)</Korean> + <Portuguese>Tempo, em segundos, necessário para cavar uma trincheira pequena.</Portuguese> </Key> <Key ID="STR_ACE_Trenches_SmallEnvelopeRemoveDuration_DisplayName"> <English>Small Trench Remove Duration</English> @@ -301,6 +305,7 @@ <Italian>Trincea piccola - Durata di rimozione</Italian> <Chinesesimp>小型战壕回填时间</Chinesesimp> <Korean>소형참호 제거 시간</Korean> + <Portuguese>Duração de Remoção de Trincheira Pequena</Portuguese> </Key> <Key ID="STR_ACE_Trenches_SmallEnvelopeRemoveDuration_Description"> <English>Time, in seconds, required to remove a small trench.</English> @@ -313,6 +318,7 @@ <Italian>Tempo in secondi per rimuovere una trincea piccola.</Italian> <Chinesesimp>回填一条小型战壕所需的时间(秒)。</Chinesesimp> <Korean>소형 참호를 제거할때 필요한 시간을 설정합니다. (초 단위)</Korean> + <Portuguese>Tempo, em segundos, necessário para remover uma trincheira pequena.</Portuguese> </Key> <Key ID="STR_ACE_Trenches_BigEnvelopeDigDuration_DisplayName"> <English>Big Trench Dig Duration</English> @@ -325,6 +331,7 @@ <Italian>Trincea grande - Durata di scavo</Italian> <Chinesesimp>大型战壕挖掘时间</Chinesesimp> <Korean>대형참호 건설 시간</Korean> + <Portuguese>Duração de Escavamento de Trincheira Grande</Portuguese> </Key> <Key ID="STR_ACE_Trenches_BigEnvelopeDigDuration_Description"> <English>Time, in seconds, required to dig a big trench.</English> @@ -337,6 +344,7 @@ <Italian>Tempo in secondi per scavare una trincea grande.</Italian> <Chinesesimp>挖一条大型战壕所需的时间(秒)。</Chinesesimp> <Korean>대형 참호를 팔때 필요한 시간을 설정합니다. (초 단위)</Korean> + <Portuguese>Tempo, em segundos, necessário para cavar uma trincheira grande.</Portuguese> </Key> <Key ID="STR_ACE_Trenches_BigEnvelopeRemoveDuration_DisplayName"> <English>Big Trench Remove Duration</English> @@ -349,6 +357,7 @@ <Italian>Trincea grande - Durata di rimozione</Italian> <Chinesesimp>大型战壕回填时间</Chinesesimp> <Korean>대형참호 제거 시간</Korean> + <Portuguese>Duração de Remoção de Trincheira Grande</Portuguese> </Key> <Key ID="STR_ACE_Trenches_BigEnvelopeRemoveDuration_Description"> <English>Time, in seconds, required to remove a big trench.</English> @@ -361,6 +370,7 @@ <Italian>Tempo in secondi per rimuovere una trincea grande.</Italian> <Chinesesimp>回填一条大型战壕所需的时间(秒)。</Chinesesimp> <Korean>대형 참호를 제거할때 필요한 시간을 설정합니다. (초 단위)</Korean> + <Portuguese>Tempo, em segundos, necessário para remover uma trincheira grande.</Portuguese> </Key> </Package> </Project> diff --git a/addons/ui/CfgInGameUI.hpp b/addons/ui/CfgInGameUI.hpp index 8f39984b03c..3e1f28ba204 100644 --- a/addons/ui/CfgInGameUI.hpp +++ b/addons/ui/CfgInGameUI.hpp @@ -1,5 +1,5 @@ class CfgInGameUI { class DefaultAction { - size = QUOTE(profileNamespace getVariable [ARR_2('GVAR(hideDefaultActionIcon)',(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8))]); + size = QUOTE(profileNamespace getVariable [ARR_2('GVAR(hideDefaultActionIcon)',(((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) * 0.8))]); }; }; diff --git a/addons/ui/XEH_clientInit.sqf b/addons/ui/XEH_clientInit.sqf index d9d3fa5717c..5bf28bc58d4 100644 --- a/addons/ui/XEH_clientInit.sqf +++ b/addons/ui/XEH_clientInit.sqf @@ -1,4 +1,5 @@ #include "script_component.hpp" +#include "\a3\ui_f\hpp\defineDIKCodes.inc" // Exit on Headless if (!hasInterface) exitWith {}; @@ -48,3 +49,24 @@ GVAR(elementsSet) = createHashMap; }] call CBA_fnc_addEventHandler; [QUOTE(ADDON), "AnimChanged", LINKFUNC(onAnimChanged), true] call EFUNC(common,addPlayerEH); + + +["ACE3 Common", QGVAR(hideHud), localize LSTRING(hideHud), { + GVAR(hideHud) = !(missionNamespace getVariable [QGVAR(hideHud), false]); + [QGVAR(hideHud), [GVAR(hideHud)]] call CBA_fnc_localEvent; + + private _mask = []; + if (GVAR(hideHud)) then { _mask resize [10, false] }; + [QGVAR(hideHud), _mask] call EFUNC(common,showHud); + + if (missionNamespace getVariable [QGVAR(hideHud_hideChat), true]) then { + showChat !GVAR(hideHud); + }; + + if (!isNil "diwako_dui_main_toggled_off") then { + diwako_dui_main_toggled_off = GVAR(hideHud); // ref https://github.com/diwako/diwako_dui/wiki/Hiding-DUI-for-cutscenes + }; + true +}, +{false}, +[DIK_F12, [false, true, false]], false] call CBA_fnc_addKeybind; // ctrl+f12 diff --git a/addons/ui/stringtable.xml b/addons/ui/stringtable.xml index 2578f58c6d0..c3308b36ab0 100644 --- a/addons/ui/stringtable.xml +++ b/addons/ui/stringtable.xml @@ -168,6 +168,7 @@ <Italian>Filigrana per versione in fase di sviluppo</Italian> <Chinesesimp>开发建设水印</Chinesesimp> <Korean>개발용 빌드 워터마크</Korean> + <Portuguese>Marca d'agua de versão de desenvolvimento</Portuguese> </Key> <Key ID="STR_ACE_UI_WeaponName"> <English>Weapon Name</English> @@ -680,6 +681,7 @@ <Chinesesimp>启用移动速度指示器</Chinesesimp> <Korean>이동 속도 표시기 활성화</Korean> <Spanish>Habilitar indicador de velocidad de movimiento</Spanish> + <Portuguese>Habilitar indicador de velocidade de movimento</Portuguese> </Key> <Key ID="STR_ACE_UI_EnableSpeedIndicator_Description"> <English>Enables movement speed indicator for player character.</English> @@ -692,6 +694,7 @@ <Chinesesimp>为玩家角色启用移动速度指示器。</Chinesesimp> <Korean>플레이어 캐릭터를 위한 이동속도 표시기를 활성화합니다.</Korean> <Spanish>Habilita el indicador de velocidad de movimiento para el personaje del jugador.</Spanish> + <Portuguese>Habilita o indicador de velocidade de movimento do personagem do jogador.</Portuguese> </Key> <Key ID="STR_ACE_UI_HideDefaultActionIcon"> <English>Hide Default Action Icon</English> @@ -704,6 +707,7 @@ <German>Standardaktionssymbol ausblenden</German> <French>Masquer l'icône d'action par défaut</French> <Italian>Nascondi Icona dell'Interazione Standard</Italian> + <Portuguese>Esconder ícone padrão de ação</Portuguese> </Key> <Key ID="STR_ACE_UI_HideDefaultActionIcon_Description"> <English>Hides the icon shown automatically when something is in front of the cursor. Requires a game restart.\nWarning: Does not remove the action itself! It is advisable to unbind 'Use default action' key to prevent unwanted interactions.</English> @@ -716,6 +720,15 @@ <German>Blendet das Symbol aus, das automatisch angezeigt wird, wenn sich etwas vor dem Cursor befindet. Erfordert einen Neustart des Spiels.\nWarnung: Die Aktion selbst wird nicht entfernt! Es empfiehlt sich, die Belegung der Taste 'Standardaktion verwenden' aufzuheben, um unerwünschte Interaktionen zu verhindern.</German> <French>Cache l'icône qui s'affiche automatiquement lorsque quelque chose est devant le curseur. Nécessite un redémarrage du jeu.\nAvertissement : l'action n'est pas supprimée ! Il est recommandé d'annuler l'affectation du bouton 'Utiliser l'action par défaut' afin d'éviter des interactions indésirables.</French> <Italian>Nasconde l'icona mostrata in automatico quando qualcosa è davanti al cursore. La modifica richiede un riavvio del gioco.\nAttenzione: Non rimuovere l'azione stessa! È consigliato rimuovere solo il tasto dall'assegnazione 'Usa Azione Standard' per impedire interazioni non volute.</Italian> + <Portuguese>Esconde o ícone mostrado automaticamente quando algo está a frente do cursor. É preciso reiniciar o jogo.\nAviso: Não remove a ação em si! É recomendado desvincular a tecla de "Usar ação padrão" para previnir interações indesejadas.</Portuguese> + </Key> + <Key ID="STR_ACE_UI_hideHud"> + <English>Hide all UI</English> + <Japanese>全てのUIを隠す</Japanese> + <French>Cacher toute l'interface utilisateur.</French> + <Russian>Скрыть весь интерфейс</Russian> + <Korean>모든 UI 숨기기</Korean> + <Italian>Nascondi tutta l'IU</Italian> </Key> </Package> </Project> diff --git a/addons/vector/RscInGameUI.hpp b/addons/vector/RscInGameUI.hpp index 7e2f7057650..b7a6f25022b 100644 --- a/addons/vector/RscInGameUI.hpp +++ b/addons/vector/RscInGameUI.hpp @@ -51,88 +51,88 @@ class RscInGameUI { class ACE_ScriptedDisplayControlsGroup: RscControlsGroupNoScrollbars { onLoad = "uiNamespace setVariable ['ACE_dlgVector', ctrlParent (_this select 0)];"; idc = 170; - x = "safezoneX"; - y = "safezoneY"; - w = "safezoneW"; - h = "safezoneH"; + x = "safeZoneX"; + y = "safeZoneY"; + w = "safeZoneW"; + h = "safeZoneH"; class controls { class Center: RscPicture { idc = IDC_CENTER; colorText[] = {1,0,0,0.5}; - x = "0.5 - (0.8 / 16 * safezoneW)/2 - safezoneX"; - y = "0.5 - (0.8 / 9 * safezoneH)/2 - safezoneY"; - w = "0.8 / 16 * safezoneW"; - h = "0.8 / 9 * safezoneH"; + x = "0.5 - (0.8 / 16 * safeZoneW)/2 - safeZoneX"; + y = "0.5 - (0.8 / 9 * safeZoneH)/2 - safeZoneY"; + w = "0.8 / 16 * safeZoneW"; + h = "0.8 / 9 * safeZoneH"; }; class Crosshair: Center { idc = IDC_CROSSHAIR; - x = "0.5 - (0.7 / 16 * safezoneW)/2 - safezoneX"; - y = "0.5 - (0.7 / 9 * safezoneH)/2 - safezoneY"; - w = "0.7 / 16 * safezoneW"; - h = "0.7 / 9 * safezoneH"; + x = "0.5 - (0.7 / 16 * safeZoneW)/2 - safeZoneX"; + y = "0.5 - (0.7 / 9 * safeZoneH)/2 - safeZoneY"; + w = "0.7 / 16 * safeZoneW"; + h = "0.7 / 9 * safeZoneH"; }; class Digit0: Center { idc = IDC_DIGIT_0; - x = "(0.54 + 0 * 0.02) * safezoneW"; - y = "0.54 * safezoneH"; - w = "0.5 / 16 * safezoneW"; - h = "0.5 / 9 * safezoneH"; + x = "(0.54 + 0 * 0.02) * safeZoneW"; + y = "0.54 * safeZoneH"; + w = "0.5 / 16 * safeZoneW"; + h = "0.5 / 9 * safeZoneH"; }; class Digit1: Digit0 { idc = IDC_DIGIT_1; - x = "(0.54 + 1 * 0.02) * safezoneW"; + x = "(0.54 + 1 * 0.02) * safeZoneW"; }; class Digit2: Digit0 { idc = IDC_DIGIT_2; - x = "(0.54 + 2 * 0.02) * safezoneW"; + x = "(0.54 + 2 * 0.02) * safeZoneW"; }; class Digit3: Digit0 { idc = IDC_DIGIT_3; - x = "(0.54 + 3 * 0.02) * safezoneW"; + x = "(0.54 + 3 * 0.02) * safeZoneW"; }; class Digit4: Digit0 { idc = IDC_DIGIT_4; - x = "(0.54 + 4 * 0.02) * safezoneW"; + x = "(0.54 + 4 * 0.02) * safeZoneW"; }; class Digit5: Digit0 { idc = IDC_DIGIT_5; - x = "(0.35 + 0 * 0.02) * safezoneW"; + x = "(0.35 + 0 * 0.02) * safeZoneW"; }; class Digit6: Digit0 { idc = IDC_DIGIT_6; - x = "(0.35 + 1 * 0.02) * safezoneW"; + x = "(0.35 + 1 * 0.02) * safeZoneW"; }; class Digit7: Digit0 { idc = IDC_DIGIT_7; - x = "(0.35 + 2 * 0.02) * safezoneW"; + x = "(0.35 + 2 * 0.02) * safeZoneW"; }; class Digit8: Digit0 { idc = IDC_DIGIT_8; - x = "(0.35 + 3 * 0.02) * safezoneW"; + x = "(0.35 + 3 * 0.02) * safeZoneW"; }; class Digit9: Digit0 { idc = IDC_DIGIT_9; - x = "(0.35 + 4 * 0.02) * safezoneW"; + x = "(0.35 + 4 * 0.02) * safeZoneW"; }; class DigitE1: Digit0 { idc = IDC_DIGIT_E1; - x = "(0.39 + 0 * 0.02) * safezoneW"; - y = "0.42 * safezoneH"; + x = "(0.39 + 0 * 0.02) * safeZoneW"; + y = "0.42 * safeZoneH"; }; class DigitE2: DigitE1 { idc = IDC_DIGIT_E2; - x = "(0.39 + 1 * 0.02) * safezoneW"; + x = "(0.39 + 1 * 0.02) * safeZoneW"; }; class DigitE3: DigitE1 { idc = IDC_DIGIT_E3; - x = "(0.39 + 2 * 0.02) * safezoneW"; + x = "(0.39 + 2 * 0.02) * safeZoneW"; }; class DigitE4: DigitE1 { idc = IDC_DIGIT_E4; - x = "(0.39 + 3 * 0.02) * safezoneW"; + x = "(0.39 + 3 * 0.02) * safeZoneW"; }; }; }; diff --git a/addons/vehicle_damage/CfgAmmo.hpp b/addons/vehicle_damage/CfgAmmo.hpp index 408c3e7b157..ad84fbc53cd 100644 --- a/addons/vehicle_damage/CfgAmmo.hpp +++ b/addons/vehicle_damage/CfgAmmo.hpp @@ -21,9 +21,6 @@ class CfgAmmo { class M_Vorona_HEAT; class M_SPG9_HEAT; class R_MRAAWS_HEAT_F; - class B_338_Ball; - - class ACE_G_40mm_HE; CREATE_INCENDIARY_AMMO(BulletBase, BulletCore, 0.1); CREATE_INCENDIARY_AMMO(ShellBase, ShellCore, 1.0); diff --git a/addons/vehicle_damage/CfgEventHandlers.hpp b/addons/vehicle_damage/CfgEventHandlers.hpp index 74ffec132ee..f6503c2479b 100644 --- a/addons/vehicle_damage/CfgEventHandlers.hpp +++ b/addons/vehicle_damage/CfgEventHandlers.hpp @@ -1,19 +1,17 @@ - class Extended_PreStart_EventHandlers { class ADDON { init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); }; }; -class Extended_PostInit_EventHandlers { +class Extended_PreInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_SCRIPT(XEH_postInit)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); }; }; -class Extended_PreInit_EventHandlers { +class Extended_PostInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); + init = QUOTE(call COMPILE_SCRIPT(XEH_postInit)); }; }; - diff --git a/addons/vehicle_damage/CfgVehicles.hpp b/addons/vehicle_damage/CfgVehicles.hpp index 9ea47711ea9..96a6e956e67 100644 --- a/addons/vehicle_damage/CfgVehicles.hpp +++ b/addons/vehicle_damage/CfgVehicles.hpp @@ -28,6 +28,7 @@ class CfgVehicles { GVAR(engineFireProb) = 0.5; GVAR(detonationDuringFireProb) = 0.2; GVAR(canHaveFireRing) = 0; + EGVAR(cookoff,canHaveFireJet) = 1; }; class Wheeled_APC_F: Car_F { GVAR(hullDetonationProb) = 0.2; @@ -38,6 +39,7 @@ class CfgVehicles { GVAR(engineFireProb) = 0.5; GVAR(detonationDuringFireProb) = 0.2; GVAR(canHaveFireRing) = 0; + EGVAR(cookoff,canHaveFireJet) = 1; }; class APC_Tracked_01_base_F: Tank_F {}; class B_APC_Tracked_01_base_F: APC_Tracked_01_base_F {}; @@ -288,4 +290,3 @@ class CfgVehicles { GVAR(canHaveFireRing) = 1; }; }; - diff --git a/addons/vehicle_damage/XEH_PREP.hpp b/addons/vehicle_damage/XEH_PREP.hpp index a7eb5198811..20075cbd4af 100644 --- a/addons/vehicle_damage/XEH_PREP.hpp +++ b/addons/vehicle_damage/XEH_PREP.hpp @@ -1,14 +1,13 @@ PREP(abandon); PREP(addEventHandler); +PREP(blowOffTurret); PREP(handleBail); -PREP(handleVehicleDamage); PREP(handleCookoff); -PREP(detonate); -PREP(processHit); -PREP(handleDetonation); PREP(handleDamage); -PREP(knockOut); -PREP(addDamage); PREP(handleDamageEjectIfDestroyed); -PREP(blowOffTurret); +PREP(handleDetonation); +PREP(handleVehicleDamage); +PREP(knockOut); PREP(medicalDamage); +PREP(processHit); +PREP(setDamage); diff --git a/addons/vehicle_damage/XEH_postInit.sqf b/addons/vehicle_damage/XEH_postInit.sqf index 9784d335eda..5e15599735e 100644 --- a/addons/vehicle_damage/XEH_postInit.sqf +++ b/addons/vehicle_damage/XEH_postInit.sqf @@ -1,53 +1,65 @@ #include "script_component.hpp" -["ace_settingsInitialized", { +// Init eject from destroyed vehicles +// See https://github.com/acemod/ACE3/pull/6330 +// Still valid for Arma 2.16 +{ + [_x, "Init", { + params ["_vehicle"]; + + if (!alive _vehicle) exitWith {}; + + TRACE_2("ejectIfDestroyed init",_vehicle,typeOf _vehicle); + + _vehicle addEventHandler ["HandleDamage", {call FUNC(handleDamageEjectIfDestroyed)}]; + }, true, [], true] call CBA_fnc_addClassEventHandler; +} forEach EJECT_IF_DESTROYED_VEHICLES; + +["CBA_settingsInitialized", { TRACE_1("settings init",GVAR(enabled)); - if (GVAR(enabled)) then { - [QGVAR(medicalDamage), LINKFUNC(medicalDamage)] call CBA_fnc_addEventHandler; - [QGVAR(bailOut), { - params ["_center", "_crewman", "_vehicle"]; - TRACE_3("bailOut",_center,_crewman,_vehicle); + if (!GVAR(enabled)) exitWith {}; - if (isPlayer _crewman) exitWith {}; - if (!alive _crewman || {!([_crewman] call EFUNC(common,isAwake))}) exitWith {}; + [QGVAR(medicalDamage), LINKFUNC(medicalDamage)] call CBA_fnc_addEventHandler; - unassignVehicle _crewman; - _crewman leaveVehicle _vehicle; - doGetOut _crewman; + if (isServer) then { + // To set source and instigator, setDamage must be executed on the server + [QGVAR(setDamage), {(_this select 0) setDamage (_this select 1)}] call CBA_fnc_addEventHandler; + }; - private _angle = floor (random 360); - private _dist = (30 + (random 10)); - private _escape = _center getPos [_dist, _angle]; + [QGVAR(bailOut), { + params ["_vehicle", "_unit"]; - _crewman doMove _escape; - _crewman setSpeedMode "FULL"; - }] call CBA_fnc_addEventHandler; + TRACE_2("bailOut",_vehicle,_unit); - ["Tank", "init", LINKFUNC(addEventHandler), true, [], true] call CBA_fnc_addClassEventHandler; - ["Wheeled_APC_F", "init", LINKFUNC(addEventHandler), true, [], true] call CBA_fnc_addClassEventHandler; + // Ignore players and the dead + if (_unit call EFUNC(common,isPlayer) || {!(_unit call EFUNC(common,isAwake))}) exitWith {}; - if (GVAR(enableCarDamage)) then { - ["Car", "init", LINKFUNC(addEventHandler), true, [], true] call CBA_fnc_addClassEventHandler; - }; + unassignVehicle _unit; + _unit leaveVehicle _vehicle; + doGetOut _unit; - // Blow off turret effect - // TODO: Add blowing-off-turret effect to vehicles that cook-off but aren't destroyed (no catastrophic explosion) - // The problem is that vehicles are repairable if they haven't been destroyed. So if the turret is gone and vehicle is repaired, how do we handle that? - ["Tank", "Killed", { - if (_this select 3 && random 1 < 0.15) then { - (_this select 0) call FUNC(blowOffTurret); - }; - }, true, [], true] call CBA_fnc_addClassEventHandler; - }; + private _angle = floor (random 360); + private _dist = 30 + (random 10); + private _escape = _vehicle getPos [_dist, _angle]; + + _unit doMove _escape; + _unit setSpeedMode "FULL"; + }] call CBA_fnc_addEventHandler; + + GVAR(vehicleClassesHitPointHash) = createHashMap; - // init eject from destroyed vehicle - { - [_x, "init", { - params ["_vehicle"]; - if (!alive _vehicle) exitWith {}; - TRACE_2("ejectIfDestroyed init",_vehicle,typeOf _vehicle); - _vehicle addEventHandler ["HandleDamage", {call FUNC(handleDamageEjectIfDestroyed)}]; - }, true, [], true] call CBA_fnc_addClassEventHandler; - } forEach EJECT_IF_DESTROYED_VEHICLES; + ["Tank", "Init", LINKFUNC(addEventHandler), true, [], true] call CBA_fnc_addClassEventHandler; + + // Wheeled_APC_F inherits from Car + [["Wheeled_Apc_F", "Car"] select GVAR(enableCarDamage), "Init", LINKFUNC(addEventHandler), true, [], true] call CBA_fnc_addClassEventHandler; + + // Blow off turret effect + // TODO: Add blowing-off-turret effect to vehicles that cook-off but aren't destroyed (no catastrophic explosion) + // The problem is that vehicles are repairable if they haven't been destroyed. So if the turret is gone and vehicle is repaired, how do we handle that? + ["Tank", "Killed", { + if (_this select 3 && random 1 < 0.15) then { + (_this select 0) call FUNC(blowOffTurret); + }; + }] call CBA_fnc_addClassEventHandler; }] call CBA_fnc_addEventHandler; diff --git a/addons/vehicle_damage/config.cpp b/addons/vehicle_damage/config.cpp index 6b4f7cf685d..24b2abda5ba 100644 --- a/addons/vehicle_damage/config.cpp +++ b/addons/vehicle_damage/config.cpp @@ -7,7 +7,7 @@ class CfgPatches { weapons[] = {}; requiredVersion = REQUIRED_VERSION; // ammo/vehicle config defines touch all of these - requiredAddons[] = { "ace_common", "ace_cookoff" }; + requiredAddons[] = {"ace_common", "ace_cookoff"}; author = ECSTRING(common,ACETeam); authors[] = {"tcvm"}; url = ECSTRING(main,URL); diff --git a/addons/vehicle_damage/functions/fnc_abandon.sqf b/addons/vehicle_damage/functions/fnc_abandon.sqf index 83b06a80df1..3539e21a976 100644 --- a/addons/vehicle_damage/functions/fnc_abandon.sqf +++ b/addons/vehicle_damage/functions/fnc_abandon.sqf @@ -4,29 +4,34 @@ * Forces the AI currently in a vehicle to bail out. * * Arguments: - * 0: The vehicle in which to bail out <OBJECT> + * 0: Vehicle <OBJECT> * * Return Value: * None * * Example: - * [tank2] call ace_vehicle_damage_fnc_abandon; + * cursorObject call ace_vehicle_damage_fnc_abandon * * Public: No */ params ["_vehicle"]; -TRACE_2("abandon",_vehicle,(crew _vehicle) select {alive _x}); -if (_vehicle getVariable [QGVAR(allowCrewInImmobile), false]) exitWith {}; // check for API +// Check for API +if (_vehicle getVariable [QGVAR(allowCrewInImmobile), false]) exitWith { + TRACE_1("API prevented crew from dismounting",_vehicle); +}; + +TRACE_1("abandon",_vehicle); [{ params ["_vehicle"]; + _vehicle allowCrewInImmobile false; - private _center = getPosASL _vehicle; - TRACE_2("bailing out crew after delay",_vehicle,_center); + TRACE_2("bailing out crew after delay",_vehicle,crew _vehicle); + { - [QGVAR(bailOut), [_center, _x, _vehicle], _x] call CBA_fnc_targetEvent; - } forEach crew _vehicle; -}, _this, random MAX_CREW_BAILOUT_TIME] call CBA_fnc_waitAndExecute; + [QGVAR(bailOut), [_vehicle, _x], _x] call CBA_fnc_targetEvent; + } forEach (crew _vehicle); +}, _vehicle, random MAX_CREW_BAILOUT_TIME] call CBA_fnc_waitAndExecute; diff --git a/addons/vehicle_damage/functions/fnc_addDamage.sqf b/addons/vehicle_damage/functions/fnc_addDamage.sqf deleted file mode 100644 index 35475bd36cb..00000000000 --- a/addons/vehicle_damage/functions/fnc_addDamage.sqf +++ /dev/null @@ -1,42 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: tcvm - * Sets vehicle damage based on HitIndex. Failing that it falls back to HitPoint name. - * - * Arguments: - * 0: The vehicle <OBJECT> - * 1: Hit Index <NUMBER> - * 2: Hit Point <STRING> - * 3: Damage <NUMBER> - * 4: Whether or not to cap the damage to maximum part damage <BOOL> (default: True) - * - * Return Value: - * None - * - * Example: - * [vehicle player, 234, "HitHull"] call ace_vehicle_damage_fnc_addDamage - * - * Public: No - */ - -params ["_vehicle", "_hitIndex", "_hitPoint", "_damage", ["_capDamageAtCurret", true]]; - -private _currentDamage = _vehicle getHitPointDamage _hitPoint; -if (_capDamageAtCurret && { _damage < _currentDamage }) exitWith { - TRACE_4("capping damage at current",_capDamageAtCurret,_damage,_currentDamage,_hitPoint); -}; - -TRACE_4("adding damage to vehicle",_vehicle,_hitIndex,_hitPoint,_damage); -if (_hitPoint isEqualTo "#structural") then { - _hitPoint = "hithull"; - _hitIndex = -1; -}; -if (_hitIndex >= 0) then { - _vehicle setHitIndex [_hitIndex, _damage, true]; -} else { - _vehicle setHitPointDamage [_hitPoint, _damage, true]; -}; - -if (_hitPoint == "hitengine" && {_damage > 0.9}) then { - [QEGVAR(cookoff,engineFireServer), _vehicle] call CBA_fnc_serverEvent; -}; diff --git a/addons/vehicle_damage/functions/fnc_addEventHandler.sqf b/addons/vehicle_damage/functions/fnc_addEventHandler.sqf index a7e59c75a19..3fdbf9ec20c 100644 --- a/addons/vehicle_damage/functions/fnc_addEventHandler.sqf +++ b/addons/vehicle_damage/functions/fnc_addEventHandler.sqf @@ -1,110 +1,137 @@ #include "..\script_component.hpp" /* - * Author: tcvm + * Author: tcvm, johnb43 * Adds the event handler to a vehicle. * * Arguments: - * 0: The vehicle in which to add the event handler to <OBJECT> + * 0: Vehicle <OBJECT> * * Return Value: * None * * Example: - * [tank2] call ace_vehicle_damage_fnc_addEventHandler; + * cursorObject call ace_vehicle_damage_fnc_addEventHandler * * Public: No */ -params["_vehicle"]; +params ["_vehicle"]; TRACE_2("addEventHandler",_vehicle,GVAR(enabled)); -if !(GVAR(enabled)) exitWith { +if (!GVAR(enabled)) exitWith { #ifdef DEBUG_MODE_FULL - [{ ["Warning: Vehicle Damage not enabled...", 2] call CBA_fnc_notify; }, [], 5] call CBA_fnc_waitAndExecute; + [CBA_fnc_notify, ["Warning: Vehicle Damage not enabled", 2], 5] call CBA_fnc_waitAndExecute; #endif }; -private _hitpointHash = [[], nil] call CBA_fnc_hashCreate; +if (!isNil {_vehicle getVariable QGVAR(handleDamage)}) exitWith {}; + +_vehicle allowCrewInImmobile true; + +// No clue why, but for some reason this needs to be exec'd next frame or else it isn't the last event handler in the system. +// Maybe its overridden somewhere else, but this makes sure it is the last one +[{ + params ["_vehicle"]; + + if (!isNil {_vehicle getVariable QGVAR(handleDamage)}) exitWith {}; + + TRACE_1("added eh",_vehicle); + + _vehicle setVariable [QGVAR(hitHash), createHashMap]; + _vehicle setVariable [QGVAR(handleDamage), _vehicle addEventHandler ["HandleDamage", {_this call FUNC(handleDamage)}]]; +}, _vehicle] call CBA_fnc_execNextFrame; + +private _typeOf = typeOf _vehicle; + +if (_typeOf in GVAR(vehicleClassesHitPointHash)) exitWith {}; + +private _hitPointHash = createHashMap; private _vehicleConfig = configOf _vehicle; -private _hitpointsConfig = _vehicleConfig >> "HitPoints"; -private _turretConfig = _vehicleConfig >> "Turrets"; -private _eraHitpoints = [_vehicleConfig >> QGVAR(eraHitpoints), "ARRAY", []] call CBA_fnc_getConfigEntry; -private _slatHitpoints = [_vehicleConfig >> QGVAR(slatHitpoints), "ARRAY", []] call CBA_fnc_getConfigEntry; +private _hitPointsConfig = _vehicleConfig >> "HitPoints"; // Add hitpoint names to config for quick lookup { - _x params ["_hitpoints", "_type"]; + _x params ["_hitPoints", "_hitArea"]; + { - [_hitpointHash, toLowerANSI _x, [_type, _hitpointsConfig >> _x, toLowerANSI _x]] call CBA_fnc_hashSet; - } forEach _hitpoints; + _hitPointHash set [toLowerANSI _x, [_hitArea, abs getNumber (_hitPointsConfig >> _x >> "minimalHit")]]; + } forEach _hitPoints; } forEach ALL_HITPOINTS; -_vehicle setVariable [QGVAR(hitpointHash), _hitpointHash]; - -// gun and turret hitpoints arent hardcoded anymore - dig through config to find correct names -private _iterateThroughConfig = { - params ["_vehicle", "_config", "_iterateThroughConfig", "_hitpointAliases"]; +// Gun and turret hitpoints aren't hardcoded anymore - dig through config to find correct names +private _fnc_iterateThroughConfig = { + params ["_config"]; TRACE_1("checking config",_config); + private _configName = toLowerANSI configName _config; - private _isGun = ([_config >> "isGun", "NUMBER", 0] call CBA_fnc_getConfigEntry) == 1; - private _isTurret = ([_config >> "isTurret", "NUMBER", 0] call CBA_fnc_getConfigEntry) == 1; + private _isGun = getNumber (_config >> "isGun") == 1; + private _isTurret = getNumber (_config >> "isTurret") == 1; private _isEra = _configName in _eraHitpoints; private _isSlat = _configName in _slatHitpoints; private _isMisc = false; - // prevent incompatibilites with old mods - if (_configName isEqualTo "hitturret") then { + // Prevent incompatibilites with old mods + if (_configName == "hitturret") then { _isTurret = true; }; - if (_configName isEqualTo "hitgun") then { + + if (_configName == "hitgun") then { _isGun = true; }; - private _hash = _vehicle getVariable QGVAR(hitpointHash); { - _x params ["_hitType", "_hitPoints"]; + _x params ["_hitArea", "_hitPoints"]; + if (_configName in _hitPoints) then { - [_hash, _configName, [_hitType, _config, _configName]] call CBA_fnc_hashSet; + _hitPointHash set [_configName, [_hitArea, abs getNumber (_config >> "minimalHit")]]; _isMisc = true; }; - } forEach _hitpointAliases; + } forEach _hitPointAliases; if (_isGun || _isTurret || _isEra || _isSlat || _isMisc) then { - TRACE_6("found gun/turret/era/slat/misc",_isGun,_isTurret,_isEra,_isSlat,_isMisc,_hash); if (_isGun) then { - [_hash, _configName, ["gun", _config, _configName]] call CBA_fnc_hashSet; + _hitPointHash set [_configName, ["gun", abs getNumber (_config >> "minimalHit")]]; }; if (_isTurret) then { - [_hash, _configName, ["turret", _config, _configName]] call CBA_fnc_hashSet; + _hitPointHash set [_configName, ["turret", abs getNumber (_config >> "minimalHit")]]; }; if (_isEra) then { - [_hash, _configName, ["era", _config, _configName]] call CBA_fnc_hashSet; + _hitPointHash set [_configName, ["era", abs getNumber (_config >> "minimalHit")]]; }; if (_isSlat) then { - [_hash, _configName, ["slat", _config, _configName]] call CBA_fnc_hashSet; + _hitPointHash set [_configName, ["slat", abs getNumber (_config >> "minimalHit")]]; }; - _vehicle setVariable [QGVAR(hitpointHash), _hash]; + + TRACE_6("found gun/turret/era/slat/misc",_isGun,_isTurret,_isEra,_isSlat,_isMisc,_hash); } else { { - [_vehicle, _x, _iterateThroughConfig, _hitpointAliases] call _iterateThroughConfig; + _x call _fnc_iterateThroughConfig; } forEach configProperties [_config, "isClass _x", true]; }; }; -private _hitpointAliases = [_vehicleConfig >> QGVAR(hitpointAlias), "ARRAY", []] call CBA_fnc_getConfigEntry; -TRACE_1("hitpoint alias",_hitpointAliases); -[_vehicle, _hitpointsConfig, _iterateThroughConfig, _hitpointAliases] call _iterateThroughConfig; -[_vehicle, _turretConfig, _iterateThroughConfig, _hitpointAliases] call _iterateThroughConfig; +private _turretConfig = _vehicleConfig >> "Turrets"; +private _eraHitpoints = (getArray (_vehicleConfig >> QGVAR(eraHitpoints))) apply {toLowerANSI _x}; +private _slatHitpoints = (getArray (_vehicleConfig >> QGVAR(slatHitpoints))) apply {toLowerANSI _x}; -_vehicle allowCrewInImmobile true; -private _eh = _vehicle getVariable [QGVAR(handleDamage), nil]; -if (isNil "_eh") then { - // no clue why, but for some reason this needs to exec'd next frame or else it isnt the last event handler in the system. - // Maybe its overridden somewhere else, but this makes sure it is the last one - [{ - params ["_vehicle"]; - TRACE_1("EH not added yet - added eh now",_vehicle); - private _hd = _vehicle addEventHandler ["HandleDamage", { _this call FUNC(handleDamage) }]; - _vehicle setVariable [QGVAR(handleDamage), _hd]; - }, [_vehicle]] call CBA_fnc_execNextFrame; +private _fnc_toLowerCase = { + _this apply { + if (_x isEqualType []) then { + _x call _fnc_toLowerCase + } else { + toLowerANSI _x + }; + }; }; + +// Convert areas to lower case +private _hitPointAliases = (getArray (_vehicleConfig >> QGVAR(hitpointAlias))) call _fnc_toLowerCase; + +TRACE_1("hitpoint alias",_hitPointAliases); + +_hitPointsConfig call _fnc_iterateThroughConfig; +_turretConfig call _fnc_iterateThroughConfig; + +GVAR(vehicleClassesHitPointHash) set [_typeOf, _hitPointHash]; + +nil diff --git a/addons/vehicle_damage/functions/fnc_blowOffTurret.sqf b/addons/vehicle_damage/functions/fnc_blowOffTurret.sqf index 818fe6f6ef8..9c9e5036da6 100644 --- a/addons/vehicle_damage/functions/fnc_blowOffTurret.sqf +++ b/addons/vehicle_damage/functions/fnc_blowOffTurret.sqf @@ -10,7 +10,7 @@ * None * * Example: - * (vehicle player) call ace_vehicle_damage_fnc_blowOffTurret + * cursorObject call ace_vehicle_damage_fnc_blowOffTurret * * Public: No */ @@ -19,6 +19,7 @@ // The sudden change in the model would cause nearby PhysX objects to get stuck [{ params ["_vehicle"]; + TRACE_1("blowOffTurret",_vehicle); (getArray (configOf _vehicle >> QGVAR(turret))) params [["_model", "", [""]], ["_offset", [0, 0, 0], [[]], 3]]; diff --git a/addons/vehicle_damage/functions/fnc_calculatePenetrationInfo.sqf b/addons/vehicle_damage/functions/fnc_calculatePenetrationInfo.sqf deleted file mode 100644 index 4e847c2d367..00000000000 --- a/addons/vehicle_damage/functions/fnc_calculatePenetrationInfo.sqf +++ /dev/null @@ -1,118 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: tcvm - * Calculates whether or not hit penetrated given armour or not. Only enabled with advanced penetration simulation turned on. - * - * Arguments: - * 0: Source of damage <OBJECT> - * 1: The vehicle <OBJECT> - * 2: Projectile that hit <OBJECT> - * 3: Hitpoint damaged <STRING> - * - * Return Value: - * None - * - * Example: - * [myVehicle, projectile, 5, 0.663] call ace_vehicle_damage_fnc_calculatePenetrationInfo; - * - * Public: No - */ - -params ["_source", "_vehicle", "_projectileData", "_hitpointConfig"]; -_projectileData params ["_projectileType", "_projectileConfig"]; -/* - http://www.longrods.ch/peneq.php - https://www.scribd.com/doc/267210898/57-mm-APFSDS-2-000-m#download - Perforation Calculation of APFSDS: - Tungsten/Depleted Uranium: Rods - P/Lw = a * (1 / tanh(b0 + b1 * (Lw/D))) * cos^m (theta) * sqrt (Pp / Pt) * e^((-(c0 + c1 * BHNT) * BHNT) / (Pp * Vt^2)) - - Steel Rods - P/Lw = a * (1 / tanh(b0 + b1 * (Lw/D))) * cos^m (theta) * sqrt (Pp / Pt) * e^((-c * BHNT^k * BHNP^n) / (Pp * Vt^2)) - - Penetration Calculation of Tungsten APFSDS (Used for all penetrators): - P/Lw = a * (1 / tanh(b0 + b1 * (Lw/D))) sqrt (Pp / Pt) * e^((-(c0 + c1 * BHNT) * BHNT) / (Pp * Vt^2)) - - where: - Penetrator: - D = Diameter of penetrator rod (always 22mm) - L = Total length of penetrator in millimeters (always 950mm) - Lw = Working length of rod in millimeters - Vt = impact velocity in Kilometers/Second - theta = NATO Obliquity angle of Penetration - Pp = Penetrator Density in kg/m^3 - BHNP = Brinell hardness number of penetrator - - Target: - Pt = target density in kg/m^3 (always 7840kg/m^3) - d = plate thickness in millimeters - BHNT = Brinell hardness number of target (always 350) - - Material Data: - Tungsten: - Pp = 19300 - BHNP = N/A - - a = 0.994 - c0 = 134.5 - c1 = -0.148 - - Depleted Uranium: - Pp = 18600 - BHNP = N/A - - a = 0.825 - c0 = 90.0 - c1 = -0.0849 - - Steel: - Pp = 7850 - BHNP = 500 - - a = 1.104 - c = 9874 - k = 0.3598 - n = -0.2342 - - Cofficients: - m = -0.224 - b0 = 0.283 - b1 = 0.0656 -*/ - -private _enabled = ([_hitpointConfig >> QGVAR(enabled), "NUMBER", 0] call CBA_fnc_getConfigEntry) == 1; -#define MATERIAL_ARRAY ([[0, 0, 0, 0, 0, 0], "steel", [7850, 500, 1.104, 9874, 0.3598, -0.2342], "tungsten", [19300, 0, 0.994, 134.5, -0.148], "depleted_uranium", [18600, 0, 0.825, 90, -0.0849]]) -private _rodMaterialStr = [_projectileConfig >> QGVAR(material), "STRING", "tungsten"] call CBA_fnc_getConfigEntry; -private _rodMaterialParams = MATERIAL_ARRAY select (1 + MATERIAL_ARRAY find toLowerANSI _rodMaterial); - -if !(_enabled) exitWith { [false, 0, 0, 0, 0] }; -if (_rodMaterialParams isEqualTo [0, 0, 0, 0, 0, 0]) exitWith { [] }; - -private _tanX = 2 * (0.283 * 0.0656 * (1)); -private _tanh = 1 / (((exp _tanX) - 1) / ((exp _tanX) + 1)); -private _cosm = (cos 0) ^ -0.224; -private _lw = 950; // technically this would be something else depending on armour slant but this is a good enough aproximation - -private _aproximateVelocity = 0; - -private _perf_pLw = 0; -private _pen_pLw = 0; -if (_rodMaterialStr isEqualTo "steel") then { - _rodMaterialParams params ["_Pp", "_BHNP", "_a", "_c", "_k", "_n"]; - private _exp = (-_c * 350^_k * _BHNP^_n) / (_Pp * _aproximateVelocity * _aproximateVelocity); - _pen_pLw = _a * _tanh * sqrt (_Pp / 7840) * exp _exp; - _perf_pLw = _pen_pLw * _cosm; -} else { - _rodMaterialParams params ["_Pp", "_BHNP", "_a", "_c0", "_c1"]; - private _exp = (-(_c0 + _c1 * 350) * 350) / (_Pp * _aproximateVelocity * _aproximateVelocity); - _pen_pLw = _a * _tanh * _cosm * sqrt (_Pp / 7840) * exp _exp; - _perf_pLw = _pen_pLw * _cosm; -}; - -private _perforationDistance = _lw * _perf_pLw; -private _penetrationDistance = _lw * _pen_pLw; -private _hitpointEffectiveArmour = [_hitpointConfig >> QGVAR(thickness), "NUMBER", 0] call CBA_fnc_getConfigEntry; -private _hitpointEffectiveSlope = [_hitpointConfig >> QGVAR(slope), "NUMBER", 0] call CBA_fnc_getConfigEntry; -_penetrationDistance = _penetrationDistance * cos (_hitpointEffectiveSlope); - -[_penetrationDistance > _hitpointEffectiveArmour, _penetrationDistance - _hitpointEffectiveArmour, _penetrationDistance, _perforationDistance, _hitpointEffectiveArmour] diff --git a/addons/vehicle_damage/functions/fnc_detonate.sqf b/addons/vehicle_damage/functions/fnc_detonate.sqf deleted file mode 100644 index 7f0dce28c93..00000000000 --- a/addons/vehicle_damage/functions/fnc_detonate.sqf +++ /dev/null @@ -1,27 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: tcvm - * Detonates vehicle ammo and heavily wounds all inside. - * - * Arguments: - * 0: The vehicle <OBJECT> - * 1: Person who caused detonation <OBJECT> (default: objNull) - * - * Return Value: - * None - * - * Example: - * [tank2] call ace_vehicle_damage_fnc_detonate; - * - * Public: No - */ - -params ["_vehicle", ["_injurer", objNull]]; - -if (((_vehicle call EFUNC(cookoff,getVehicleAmmo)) select 1) > 0) then { - { - [QGVAR(medicalDamage), [_x, _injurer, _injurer], _x] call CBA_fnc_targetEvent; - } forEach (crew _vehicle); -}; - -[QEGVAR(cookoff,detonateAmmunitionServer), [_vehicle, false, _injurer, _injurer]] call CBA_fnc_serverEvent; diff --git a/addons/vehicle_damage/functions/fnc_handleBail.sqf b/addons/vehicle_damage/functions/fnc_handleBail.sqf index 97aad2cd321..6c9f23c82bc 100644 --- a/addons/vehicle_damage/functions/fnc_handleBail.sqf +++ b/addons/vehicle_damage/functions/fnc_handleBail.sqf @@ -4,64 +4,66 @@ * Handles whether or not the crew should bail. * * Arguments: - * 0: The vehicle <OBJECT> - * 1: Can the vehicle move? <BOOL> - * 2: Can the vehicle shoot? <BOOL> + * 0: Vehicle <OBJECT> * * Return Value: * None * * Example: - * [tank1, false, true] call ace_vehicle_damage_fnc_handleBail + * cursorObject call ace_vehicle_damage_fnc_handleBail * * Public: No */ -params ["_vehicle", "_canMove", "_canShoot"]; -private _isCar = (_vehicle isKindOf "Car" && { !(_vehicle isKindOf "Wheeled_APC_F") }); +params ["_vehicle"]; +TRACE_1("handleBail",_vehicle); -if (_canMove) then { - _canMove = alive driver _vehicle; -}; +private _isCar = _vehicle isKindOf "Car" && {!(_vehicle isKindOf "Wheeled_APC_F")}; -if (_canShoot) then { - _canShoot = alive gunner _vehicle; -}; +// canFire command is broken, hence the variable +private _canMove = (_vehicle getVariable [QGVAR(canMove), true]) && {alive driver _vehicle}; +private _canShoot = (_vehicle getVariable [QGVAR(canShoot), true]) && {alive gunner _vehicle}; -_vehicle setVariable[QGVAR(canMove), _canMove]; -_vehicle setVariable[QGVAR(canShoot), _canShoot]; +_vehicle setVariable [QGVAR(canMove), _canMove]; +_vehicle setVariable [QGVAR(canShoot), _canShoot]; private _rand = random 1; if (_isCar) then { - if !(_canMove) then { - [_vehicle] spawn FUNC(abandon); - LOG_3("[%1] can't move and is bailing and is a car [%2 | %3]",_vehicle,_canMove,_isCar); + if (!_canMove) then { + _vehicle call FUNC(abandon); + + TRACE_3("car immobile - bailing",_vehicle,_canMove,_isCar); }; } else { - if (!_canMove && !_canShoot ) exitWith { // If you can't move and you can't shoot, you better GTFO - [_vehicle] spawn FUNC(abandon); - LOG_3("[%1] is a sitting duck and is bailing [%2 | %3]",_vehicle,_canMove,_canShoot); + // If you can't move and you can't shoot, you better GTFO + if (!_canMove && !_canShoot) exitWith { + _vehicle call FUNC(abandon); + + TRACE_3("immobile and can't shoot - bailing",_vehicle,_canMove,_canShoot); }; - if (!_canShoot && !_isCar) then { - if (BAILOUT_CHANCE_SHOOT > _rand) then { // 50% chance of bailing out if turret/gun is destroyed - [_vehicle] spawn FUNC(abandon); - LOG_4("[%1] Cannot shoot and is bailing with chance [%2] [%3 | %4]",_vehicle,_rand,_canMove,_canShoot); + if (!_canShoot) then { + // 50% chance of bailing out if turret/gun is disabled + if (BAILOUT_CHANCE_SHOOT > _rand) then { + _vehicle call FUNC(abandon); + + TRACE_4("can't shoot - bailing",_vehicle,_rand,_canMove,_canShoot); } else { _vehicle allowFleeing 1; - LOG_4("[%1] Cannot shoot and is fleeing with chance [%2] [%3 | %4]",_vehicle,_rand,_canMove,_canShoot); + + TRACE_4("fleeing",_vehicle,_rand,_canMove,_canShoot); }; }; - if !(_canMove) then { - if (BAILOUT_CHANCE_MOVE > _rand) then { // 80% Chance of bailing out if engine is destroyed - [_vehicle] spawn FUNC(abandon); - LOG_4("[%1] Cannot move and is bailing with chance [%2] [%3 | %4]",_vehicle,_rand,_canMove,_canShoot); + if (!_canMove) then { + // 80% Chance of bailing out if engine is disabled + if (BAILOUT_CHANCE_MOVE > _rand) then { + _vehicle call FUNC(abandon); + + TRACE_4("immobile - bailing",_vehicle,_rand,_canMove,_canShoot); } else { - LOG_4("[%1] Cannot move and is bunkering with chance [%2] [%3 | %4]",_vehicle,_rand,_canMove,_canShoot); + TRACE_4("immobile - bunkering",_vehicle,_rand,_canMove,_canShoot); }; }; }; - - diff --git a/addons/vehicle_damage/functions/fnc_handleCookoff.sqf b/addons/vehicle_damage/functions/fnc_handleCookoff.sqf index 3e7b83ebb61..4b84e9a76e9 100644 --- a/addons/vehicle_damage/functions/fnc_handleCookoff.sqf +++ b/addons/vehicle_damage/functions/fnc_handleCookoff.sqf @@ -1,59 +1,82 @@ #include "..\script_component.hpp" /* * Author: tcvm - * Checks hitpoint damage and determines if a vehicle should cookoff. + * Checks hitpoint damage and determines if a vehicle should cook off. * * Arguments: - * 0: The vehicle <OBJECT> + * 0: Vehicle <OBJECT> * 1: Chance of fire <NUMBER> * 2: Intensity of cookoff <NUMBER> - * 3: Person who instigated cookoff <OBJECT> (default: objNull) - * 4: Part of vehicle which got hit <STRING> (default: "") - * 5: Whether or not the vehicle can spawn ring-fire effect <BOOL> (default: false) - * 6: Can Jet <BOOL> (default: true) + * 3: Source of damage <OBJECT> + * 4: Person who caused damage <OBJECT> + * 5: Part of vehicle which got hit <STRING> (default: "") + * 6: Whether or not the vehicle can spawn ring-fire effect <BOOL> (default: false) + * 7: Whether or not the vehicle can spawn jet-fire effect <BOOL> (default: true) * * Return Value: - * If cooked off + * If vehicle started or already cooking off <BOOL> * * Example: - * [tank2, 0.1, 5] call ace_vehicle_damage_fnc_handleCookoff; + * [cursorObject, 0.1, 5, player, player] call ace_vehicle_damage_fnc_handleCookoff * * Public: No */ -params ["_vehicle", "_chanceOfFire", "_intensity", ["_injurer", objNull], ["_hitPart", ""], ["_canRing", false], ["_canJet", true]]; +params ["_vehicle", "_chanceOfFire", "_intensity", "_source", "_instigator", ["_hitPart", ""], ["_canRing", true], ["_canJet", true]]; +TRACE_8("handleCookoff",_vehicle,_chanceOfFire,_intensity,_source,_instigator,_hitPart,_canRing,_canJet); // Ignore if the vehicle is already cooking off -if (_vehicle getVariable [QEGVAR(cookoff,isCookingOff), false]) exitWith {true}; +if (_vehicle getVariable [QEGVAR(cookoff,isCookingOff), false]) exitWith { + TRACE_3("already cooking off",_vehicle,_chanceOfFire,_intensity); + + true // return +}; _chanceOfFire = _chanceOfFire * EGVAR(cookoff,probabilityCoef); -if (_chanceOfFire >= random 1) exitWith { - private _configOf = configOf _vehicle; - private _fireDetonateChance = [_configOf >> QGVAR(detonationDuringFireProb), "number", 0] call CBA_fnc_getConfigEntry; - if (_canRing) then { - _canRing = ([_configOf >> QGVAR(canHaveFireRing), "number", 0] call CBA_fnc_getConfigEntry) == 1; - }; +// Failure to cook off +if (_chanceOfFire == 0 || {_chanceOfFire < random 1}) exitWith { + TRACE_3("no cook-off",_vehicle,_chanceOfFire,_intensity); + + false // return +}; - if (_canJet) then { - _canJet = ([_configOf >> QEGVAR(cookoff,canHaveFireJet), "number", 1] call CBA_fnc_getConfigEntry) == 1; - }; +// Vehicle will cook off +private _configOf = configOf _vehicle; +private _fireDetonateChance = getNumber (_configOf >> QGVAR(detonationDuringFireProb)); - private _delayWithSmoke = _chanceOfFire < random 1; - private _detonateAfterCookoff = (_fireDetonateChance / 4) > random 1; +if (_canRing) then { + _canRing = getNumber (_configOf >> QGVAR(canHaveFireRing)) == 1; +}; + +if (_canJet) then { + _canJet = getNumber (_configOf >> QEGVAR(cookoff,canHaveFireJet)) == 1; +}; - private _source = ""; - if (_hitPart == "engine") then { - _source = ["hit_engine_point", "HitPoints"]; - }; +private _delaySmoke = _chanceOfFire < random 1; +private _detonateAfterCookoff = (_fireDetonateChance / 4) > random 1; - [QEGVAR(cookOff,cookOffServer), [_vehicle, _intensity, _injurer, _injurer, _delayWithSmoke, _fireDetonateChance, _detonateAfterCookoff, _source, _canRing, _canJet]] call CBA_fnc_serverEvent; - LOG_4("Cooking-off [%1] with a chance-of-fire [%2] - Delayed Smoke | Detonate after cookoff [%3 | %4]",_vehicle,_chanceOfFire,_delayWithSmoke,_detonateAfterCookoff); - [_vehicle] spawn FUNC(abandon); - LOG_1("[%1] is on fire is bailing",_vehicle); +private _sourceHitpoint = ""; - true +// Passed to the selectionPosition command in cookoff +if (_hitPart == "engine") then { + private _hitPoints = getAllHitPointsDamage _vehicle; + + if (_hitPoints isEqualTo []) exitWith {}; + + // Get hitpoint for engine + private _index = (_hitPoints select 0) findIf {_x == "hitengine"}; + + if (_index == -1) exitWith {}; + + // Get corresponding selection + _sourceHitpoint = [(_hitPoints select 1) select _index, "HitPoints", "AveragePoint"]; }; -LOG_2("[%1] No Cook-off - Chance of fire [%2]",_vehicle,_chanceOfFire); -false +[QEGVAR(cookOff,cookOffServer), [_vehicle, _intensity, _source, _instigator, _delaySmoke, _fireDetonateChance, _detonateAfterCookoff, _sourceHitpoint, _canRing, _canJet]] call CBA_fnc_serverEvent; +TRACE_4("cooking-off",_vehicle,_chanceOfFire,_delaySmoke,_detonateAfterCookoff); + +// Abandon vehicle +_vehicle call FUNC(abandon); + +true // return diff --git a/addons/vehicle_damage/functions/fnc_handleDamage.sqf b/addons/vehicle_damage/functions/fnc_handleDamage.sqf index 51bf1be97da..733d4f23214 100644 --- a/addons/vehicle_damage/functions/fnc_handleDamage.sqf +++ b/addons/vehicle_damage/functions/fnc_handleDamage.sqf @@ -4,91 +4,88 @@ * Called by "HandleDamage" event handler. Sets up hit array for this frame's damage. * * Arguments: - * 0: The vehicle <OBJECT> - * 1: Name of selection where unit was damaged <STRING> (unused) - * 2: Damage taken <NUMBER> - * 3: Source unit of damage <OBJECT> (unused) + * 0: Vehicle <OBJECT> + * 1: Selection <STRING> + * 2: New level of damage <NUMBER> + * 3: Source of damage <OBJECT> * 4: Projectile that caused damage <STRING> - * 5: Hit part index of hit point <NUMBER> - * 6: Instigator of damage <OBJECT> (unused) - * 7: Hit point config name <STRING> + * 5: Hit index <NUMBER> + * 6: Person who caused damage <OBJECT> + * 7: Hit point <STRING> * * Return Value: - * Current or maximum damage of part + * Current or maximum damage of part <NUMBER> * * Example: - * [myVehicle, projectile, 5, 0.663] call ace_vehicle_damage_fnc_handleDamage; + * [cursorObject, "hit_engine_point", 0.5, player, projectile, 1, player, "HitEngine"] call ace_vehicle_damage_fnc_handleDamage * * Public: No */ -params ["_vehicle", "_hitSelection", "_damage", "", "_projectile", "_hitIndex", "", "_hitPoint"]; -TRACE_6("HandleDamage event inputs",_vehicle,_hitSelection,_damage,_projectile,_hitIndex,_hitPoint); +params ["_vehicle", "_selection", "_newDamage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"]; +TRACE_8("handleDamage",_vehicle,_selection,_newDamage,_source,_projectile,_hitIndex,_instigator,_hitPoint); -private _returnHit = if (_hitSelection isNotEqualTo "") then { +if (!local _vehicle) exitWith {}; + +private _currentDamage = if (_selection != "") then { _vehicle getHitIndex _hitIndex } else { damage _vehicle }; if !(_projectile in ["ace_ammoExplosion", "ACE_ammoExplosionLarge"]) then { - if (local _vehicle) then { - // set up hit array so we can execute all damage next frame. Always in order of hit done. - private _hitHash = _vehicle getVariable [QGVAR(hitHash), nil]; - if (isNil "_hitHash") then { - _hitHash = [[], nil] call CBA_fnc_hashCreate; - }; - private _currentFrameArray = [_hitHash, diag_frameNo] call CBA_fnc_hashGet; - if (isNil "_currentFrameArray") then { - _currentFrameArray = []; - }; - // if a valid hit, process it - if !((_hitPoint find "#light") >= 0 || { _damage <= 0 }) then { - if (_currentFrameArray isEqualTo []) then { - [{ - params ["_vehicle", "_processingFrame"]; - private _frameHash = _vehicle getVariable [QGVAR(hitHash), nil]; - private _hitArray = [_frameHash, _processingFrame] call CBA_fnc_hashGet; - if (_hitArray isEqualTo []) exitWith {}; - - reverse _hitArray; - TRACE_3("processing data from old frame",diag_frameNo,_processingFrame,_hitArray); - { - _x params ["_vehicle", "_selection", "_damage", "_injurer", "_projectile", "_hitIndex", "", "_hitPoint"]; - - private _returnHit = if (_selection isNotEqualTo "") then { - _vehicle getHitIndex _hitIndex - } else { - damage _vehicle - }; - - private _newDamage = _damage - _returnHit; - if !([_vehicle, _hitPoint, _hitIndex, _injurer, _returnHit, _newDamage, _projectile, _selection] call FUNC(handleVehicleDamage)) exitWith { - LOG_2("cancelling rest of vehicle damage queue ( [%1] items left out of [%2] )",(count (_hitArray#1)) - _forEachIndex,count (_hitArray#1)) - }; - } forEach _hitArray; - - [_frameHash, _processingFrame] call CBA_fnc_hashRem; - - }, [_vehicle, diag_frameNo]] call CBA_fnc_execNextFrame; - }; - _currentFrameArray pushBack _this; - }; - - [_hitHash, diag_frameNo, _currentFrameArray] call CBA_fnc_hashSet; - _vehicle setVariable [QGVAR(hitHash), _hitHash]; + // If an invalid hit, don't process it + if (_newDamage <= 0 || {"#light" in _hitPoint}) exitWith {}; + + // Set up hit array so we can execute all damage next frame. Always in order of hit done. + private _hitHash = _vehicle getVariable QGVAR(hitHash); + private _currentFrameArray = _hitHash getOrDefault [diag_frameNo, [], true]; + + if (_currentFrameArray isEqualTo []) then { + [{ + params ["_vehicle", "_processingFrame"]; + + private _hitHash = _vehicle getVariable QGVAR(hitHash); + private _hitArray = _hitHash deleteAt _processingFrame; + + if (_hitArray isEqualTo []) exitWith {}; + + TRACE_3("processing data from old frame",diag_frameNo,_processingFrame,_hitArray); + + // Start from newest damage and work backwards + { + _x params ["_vehicle", "_selection", "_newDamage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"]; + + private _currentDamage = if (_selection != "") then { + _vehicle getHitIndex _hitIndex + } else { + damage _vehicle + }; + + private _addedDamage = _newDamage - _currentDamage; + + TRACE_1("handleDamage",_currentDamage); + + if !([_vehicle, _hitPoint, _hitIndex, _selection, _addedDamage, _projectile, _source, _instigator] call FUNC(handleVehicleDamage)) exitWith { + TRACE_2("cancelling rest of vehicle damage queue",(count (_hitArray#1)) - _forEachIndex,count (_hitArray#1)) + }; + } forEachReversed _hitArray; + }, [_vehicle, diag_frameNo]] call CBA_fnc_execNextFrame; }; + + _currentFrameArray pushBack _this; }; -// damage is never to be handled in-engine. Always handle out of engine with this event handler -// don't return 0 or else old parts will be reset in damage -private _criticalDamageIndex = (CRITICAL_HITPOINTS findIf { _x isEqualTo _hitPoint }) + 1; -if (_criticalDamageIndex > 0) then { - _returnHit = (_returnHit min (CRITICAL_HITPOINTS select _criticalDamageIndex)); +// Damage is never to be handled in-engine. Always handle out of engine with this event handler +// Don't return 0 or else old parts will be reset in damage +private _criticalDamageIndex = CRITICAL_HITPOINTS findIf {_x == _hitPoint}; + +if (_criticalDamageIndex != -1) then { + _currentDamage = _currentDamage min (CRITICAL_HITPOINTS_THRESHOLDS select _criticalDamageIndex); }; -if (_hitPoint isEqualTo "" && _hitIndex < 0) then { - _returnHit = _returnHit min 0.89; +if (_hitPoint == "" && {_hitIndex < 0}) then { + _currentDamage = _currentDamage min 0.89; }; -_returnHit +_currentDamage diff --git a/addons/vehicle_damage/functions/fnc_handleDamageEjectIfDestroyed.sqf b/addons/vehicle_damage/functions/fnc_handleDamageEjectIfDestroyed.sqf index fdf6f9c6d3a..8169e140e2c 100644 --- a/addons/vehicle_damage/functions/fnc_handleDamageEjectIfDestroyed.sqf +++ b/addons/vehicle_damage/functions/fnc_handleDamageEjectIfDestroyed.sqf @@ -20,7 +20,7 @@ params ["_vehicle", "", "", "", "_ammo"]; if (alive _vehicle) exitWith {}; -TRACE_2("ejectIfDestroyed HDEH",typeOf _vehicle,_this); +TRACE_2("handleDamageEjectIfDestroyed",typeOf _vehicle,_this); if (!IS_EXPLOSIVE_AMMO(_ammo)) then { { @@ -30,4 +30,5 @@ if (!IS_EXPLOSIVE_AMMO(_ammo)) then { } forEach crew _vehicle; }; +//IGNORE_PRIVATE_WARNING ["_thisEventHandler"]; _vehicle removeEventHandler ["HandleDamage", _thisEventHandler]; diff --git a/addons/vehicle_damage/functions/fnc_handleDetonation.sqf b/addons/vehicle_damage/functions/fnc_handleDetonation.sqf index 8f317323fa7..9fdaa3b0c27 100644 --- a/addons/vehicle_damage/functions/fnc_handleDetonation.sqf +++ b/addons/vehicle_damage/functions/fnc_handleDetonation.sqf @@ -1,37 +1,59 @@ #include "..\script_component.hpp" /* - * Author: tcvm - * Checks hitpoint damage and determines if a vehicle should cookoff. + * Author: tcvm, johnb43 + * Checks hitpoint damage and determines if a vehicle should detonate its ammo. * * Arguments: - * 0: The vehicle <OBJECT> + * 0: Vehicle <OBJECT> * 1: Chance of detonation <NUMBER> - * 2: Vehicle ammo array <ARRAY> - * 3: How much explosive ammo is inside vehicle <NUMBER> - * 4: How much non-explosive ammo inside vehicle <NUMBER> - * 5: Person who instigated damage <OBJECT> (default: objNull) + * 2: If the vehicle should be knocked out <BOOL> + * 3: If the crew should be injured <BOOL> + * 4: Source of damage <OBJECT> + * 5: Person who caused damage <OBJECT> * * Return Value: - * Detonated <BOOL> + * None * * Example: - * [tank2, 0.5] call ace_vehicle_damage_fnc_handleDetonation; + * [cursorObject, 0.5, true, player, player] call ace_vehicle_damage_fnc_handleDetonation * * Public: No */ -params ["_vehicle", "_chanceOfDetonate", "_vehicleAmmo", "_explosiveAmmoCount", "_nonExplosiveAmmoCount", ["_injurer", objNull]]; - -private _isKnockedOut = _explosiveAmmoCount > 0; +params ["_vehicle", "_chanceToDetonate", "_knockOut", "_injureCrew", "_source", "_instigator"]; // Ignore if the vehicle is already detonating ammo -if (_vehicle getVariable [QEGVAR(cookoff,isAmmoDetonating), false]) exitWith {_isKnockedOut}; +if (_vehicle getVariable [QEGVAR(cookoff,isAmmoDetonating), false]) exitWith { + TRACE_2("already detonating",_vehicle,_chanceToDetonate); + + if (_knockOut) then { + [_vehicle, _source, _instigator] call FUNC(knockOut); + }; + + _knockOut // return +}; + +// Failure to detonate +if (_chanceToDetonate == 0 || {_chanceToDetonate < random 1}) exitWith { + TRACE_2("no detonation",_vehicle,_chanceToDetonate); + + false // return +}; + +// Vehicle will be detonated +if (_injureCrew) then { + { + [QGVAR(medicalDamage), [_x, _source, _instigator], _x] call CBA_fnc_targetEvent; + } forEach (crew _vehicle); +}; + +TRACE_2("detonation",_vehicle,_chanceToDetonate); + +// Detonate the vehicle +[QEGVAR(cookoff,detonateAmmunitionServer), [_vehicle, false, _source, _instigator]] call CBA_fnc_serverEvent; -if (_chanceOfDetonate >= random 1) exitWith { - [_vehicle, _injurer, _vehicleAmmo] call FUNC(detonate); - LOG_2("Detonating [%1] with a chance-to-detonate [%2]",_vehicle,_chanceOfDetonate); - _isKnockedOut +if (_knockOut) then { + [_vehicle, _source, _instigator] call FUNC(knockOut); }; -LOG_2("[%1] No Detonation - Chance of detonation [%2]",_vehicle,_chanceOfDetonate); -false +_knockOut // return diff --git a/addons/vehicle_damage/functions/fnc_handleVehicleDamage.sqf b/addons/vehicle_damage/functions/fnc_handleVehicleDamage.sqf index 02033b83be7..b0540de484f 100644 --- a/addons/vehicle_damage/functions/fnc_handleVehicleDamage.sqf +++ b/addons/vehicle_damage/functions/fnc_handleVehicleDamage.sqf @@ -4,96 +4,101 @@ * Process vehicle hit. * * Arguments: - * 0: The vehicle <OBJECT> - * 1: The hitpoint which got hit <STRING> - * 2: The index of what got hit <NUMBER> - * 3: The damage that the new part took <NUMBER> - * 4: Person who hit vehicle <OBJECT> - * 5: Damage before hit <NUMBER> - * 6: Damage after hit <NUMBER> - * 7: Projectile <OBJECT> - * 8: Selection that got hit <STIRNG> + * 0: Vehicle <OBJECT> + * 1: Hit point <STRING> + * 2: Hit index <NUMBER> + * 3: Selection <STIRNG> + * 4: Added damage to part <NUMBER> + * 5: Projectile <OBJECT> + * 6: Source of damage <OBJECT> + * 7: Person who caused damage <OBJECT> * * Return Value: - * Whether or not to continue handling last frame's damage + * Whether or not to continue handling last frame's damage <BOOL> * * Example: - * [ace_vehicle_damage_fnc_handleVehicleDamage, tank1, "Hit_Engine", 12]] call CBA_fnc_execNextFrame + * [ace_vehicle_damage_fnc_handleVehicleDamage, [cursorObject, "HitEngine", 12, "hit_engine_point", 0.25, projectile, player, player]] call CBA_fnc_execNextFrame * * Public: No */ -params["_vehicle", "_hitPoint", "_hitIndex", "_injurer", "_oldDamage", "_newDamage", "_projectile", "_selection"]; -TRACE_6("handleVehicleDamage",_vehicle,_hitPoint,_hitIndex,_injurer,_oldDamage,_newDamage); -if !(alive _vehicle) exitWith { - private _eventHandler = _vehicle getVariable[QGVAR(handleDamage), nil]; - if !(isNil "_eventHandler") then { - _vehicle removeEventHandler ["HandleDamage", _eventHandler]; +params ["_vehicle", "_hitPoint", "_hitIndex", "_selection", "_addedDamage", "_projectile", "_source", "_instigator"]; +TRACE_8("handleVehicleDamage",_vehicle,_hitPoint,_hitIndex,_selection,_addedDamage,_projectile,_source,_instigator); + +if (!alive _vehicle) exitWith { + private _handleDamageEH = _vehicle getVariable [QGVAR(handleDamage), nil]; + + if (!isNil "_handleDamageEH") then { + _vehicle removeEventHandler ["HandleDamage", _handleDamageEH]; }; - LOG_1("Vehicle [%1] no longer alive",_vehicle); - true -}; -_hitPoint = toLowerANSI _hitPoint; -private _hitpointHash = _vehicle getVariable [QGVAR(hitpointHash), []]; -private _type = if (_hitpointHash isEqualTo []) then { - "exit" -} else { - ([_hitpointHash, _hitPoint] call CBA_fnc_hashGet) select 0 -}; + TRACE_1("vehicle no longer alive",_vehicle); -if (isNil "_type") then { - _type = "exit"; + false }; -// generic structural damage will be transfered into hull damage for simulation's sake +_hitPoint = toLowerANSI _hitPoint; +private _hitPointHash = GVAR(vehicleClassesHitPointHash) getOrDefault [typeOf _vehicle, createHashMap]; +private _type = (_hitPointHash getOrDefault [_hitPoint, []]) select 0; + +// Generic structural damage will be transfered into hull damage for simulation's sake private _structural = false; -if (_selection isEqualTo "") then { + +if (_selection == "") then { _type = "hull"; _hitPoint = "hithull"; _structural = true; + TRACE_1("structural damage",_selection); - _newDamage = abs _newDamage; + + _addedDamage = abs _addedDamage; }; -if (_type isEqualTo "exit") exitWith { LOG_1("No relevant hitpoints hit [%1]. Exiting",_hitPoint); true }; +if (isNil "_type") exitWith { + TRACE_1("no relevant hitpoints hit, exiting",_hitPoint); + + true +}; // Ignore multiple hits at the same time private _ignoreHit = false; private _ignoreBailCheck = false; private _multHit = _vehicle getVariable [QGVAR(hitTime), nil]; + if (isNil "_multHit") then { - _vehicle setVariable[QGVAR(hitTime), [CBA_missionTime, _injurer, [_hitPoint]]]; + _vehicle setVariable [QGVAR(hitTime), [CBA_missionTime, _source, [_hitPoint]]]; } else { private _hitPointInOldArray = _hitPoint in (_multHit select 2); - private _withinTime = (CBA_missionTime <= (_multHit select 0) + CONST_TIME) && { _injurer == (_multHit select 1) }; + private _withinTime = (CBA_missionTime <= (_multHit select 0) + CONST_TIME) && {_source == (_multHit select 1)}; + if (_hitPointInOldArray && _withinTime) then { _ignoreHit = true; } else { // If the hitpoint isnt in the old array then that means that the time expired and a new array should be generated - if !(_hitPointInOldArray) then { + if (_hitPointInOldArray) then { + _vehicle setVariable [QGVAR(hitTime), [CBA_missionTime, _source, [_hitPoint]]]; + } else { private _oldHitPoints = _multHit select 2; _oldHitPoints pushBack _hitPoint; - _vehicle setVariable [QGVAR(hitTime), [CBA_missionTime, _injurer, _oldHitPoints]]; + _vehicle setVariable [QGVAR(hitTime), [CBA_missionTime, _source, _oldHitPoints]]; + _ignoreBailCheck = true; - } else { - _vehicle setVariable [QGVAR(hitTime), [CBA_missionTime, _injurer, [_hitPoint]]]; }; }; }; + if (_ignoreHit && !_structural) exitWith { - LOG_3("Ignoring multiple hits done to vehicle [%1] by [%2] -- hitpoint [%3].",_vehicle,_injurer,_hitPoint); + TRACE_3("ignoring multiple hits done to vehicle",_vehicle,_source,_hitPoint); + true }; -LOG_3("Processing hit done to vehicle [%1] by [%2] at time [%3].",_vehicle,_injurer,CBA_missionTime); -if !([_vehicle, _projectile, _hitIndex, _newDamage, [_hitpointHash, _hitPoint] call CBA_fnc_hashGet, _injurer] call FUNC(processHit)) exitWith { false }; +TRACE_3("processing hit done to vehicle",_vehicle,_source,CBA_missionTime); -private _canMove = _vehicle getVariable[QGVAR(canMove), true]; -private _canShoot = _vehicle getVariable[QGVAR(canShoot), true]; +if !([_vehicle, _hitPoint, _hitIndex, _addedDamage, _projectile, _source, _instigator] call FUNC(processHit)) exitWith {false}; -if !(_ignoreBailCheck) then { - [_vehicle, _canMove, _canShoot] call FUNC(handleBail); +if (!_ignoreBailCheck) then { + _vehicle call FUNC(handleBail); }; true diff --git a/addons/vehicle_damage/functions/fnc_knockOut.sqf b/addons/vehicle_damage/functions/fnc_knockOut.sqf index 5c8d1697a6f..753255c99f9 100644 --- a/addons/vehicle_damage/functions/fnc_knockOut.sqf +++ b/addons/vehicle_damage/functions/fnc_knockOut.sqf @@ -1,37 +1,37 @@ #include "..\script_component.hpp" /* * Author: tcvm - * Knock out vehicle from battle. Destroy all internal hitpoints. + * Knock out a vehicle from battle by destroying all internal hitpoints. * * Arguments: - * 0: The vehicle <OBJECT> + * 0: Vehicle <OBJECT> + * 1: Source of damage <OBJECT> + * 2: Person who caused damage <OBJECT> * * Return Value: * None * * Example: - * [vehicle player] call ace_vehicle_damage_fnc_knockOut + * [cursorObject, player, player] call ace_vehicle_damage_fnc_knockOut * * Public: No */ -params ["_vehicle"]; -private _hash = _vehicle getVariable [QGVAR(hitpointHash), nil]; -if (isNil "_hash") exitWith {}; +params ["_vehicle", "_source", "_instigator"]; +TRACE_3("knockOut",_vehicle,_source,_instigator); -[_hash, { - private _hitpointAlias = _value#0; - if (_hitpointAlias isEqualTo "hull") then { - [_vehicle, -1, _key, 0.89] call FUNC(addDamage); +{ + private _hitArea = _y select 0; + + if (_hitArea == "hull") then { + [_vehicle, _x, -1, 0.89, _source, _instigator] call FUNC(setDamage); } else { - if (_hitpointAlias in ["fuel", "turret", "gun", "engine"]) then { - if ((0.3 > random 1) || { _hitpointAlias isEqualTo "engine" }) then { - [_vehicle, -1, _key, 1] call FUNC(addDamage); + if (_hitArea in ["fuel", "turret", "gun", "engine"]) then { + if ((0.3 > random 1) || {_hitArea == "engine"}) then { + [_vehicle, _x, -1, 1, _source, _instigator] call FUNC(setDamage); } else { - private _currentDamage = _vehicle getHitpointDamage _key; - [_vehicle, -1, _key, (_currentDamage + (0.3 max random 1)) min 1] call FUNC(addDamage); + [_vehicle, _x, -1, ((_vehicle getHitPointDamage _x) + (0.3 max random 1)) min 1, _source, _instigator] call FUNC(setDamage); }; }; }; -}] call CBA_fnc_hashEachPair; - +} forEach (GVAR(vehicleClassesHitPointHash) getOrDefault [typeOf _vehicle, createHashMap]); diff --git a/addons/vehicle_damage/functions/fnc_processHit.sqf b/addons/vehicle_damage/functions/fnc_processHit.sqf index 2402df7fc25..9c87c4b0374 100644 --- a/addons/vehicle_damage/functions/fnc_processHit.sqf +++ b/addons/vehicle_damage/functions/fnc_processHit.sqf @@ -1,133 +1,132 @@ #include "..\script_component.hpp" /* - * Author: tcvm + * Author: tcvm, johnb43 * Process hit by projectile against vehicle and apply appropiate damage to part. * * Arguments: - * 0: The vehicle <OBJECT> - * 1: Projectile that hit <OBJECT> - * 2: Hit index of potentially damaged part <NUMBER> - * 3: New damage done to part <NUMBER> - * 4: Information about hitpoint <ARRAY> - * 5: Person who caused damage <OBJECT> + * 0: Vehicle <OBJECT> + * 1: Hit point <STRING> + * 2: Hit index <NUMBER> + * 3: Added damage to part <NUMBER> + * 4: Projectile <OBJECT> + * 5: Source of damage <OBJECT> + * 6: Person who caused damage <OBJECT> * * Return Value: - * None + * Whether or not to continue handling last frame's damage <BOOL> * * Example: - * [myVehicle, projectile, 5, 0.663] call ace_vehicle_damage_fnc_processHit; + * [cursorObject, "HitEngine", 1, 0.25, projectile, player, player] call ace_vehicle_damage_fnc_processHit * * Public: No */ -params ["_vehicle", "_projectile", "_hitIndex", "_newDamage", "_hitpointData", "_injurer"]; -_hitpointData params ["_hitArea", "_hitpointConfig", "_hitpointName"]; +params ["_vehicle", "_hitPoint", "_hitIndex", "_addedDamage", "_projectile", "_source", "_instigator"]; +TRACE_7("processHit",_vehicle,_hitPoint,_hitIndex,_addedDamage,_projectile,_source,_instigator); -private _return = true; - -if (_newDamage < 0) then { - _newDamage = -_newDamage; -}; +_addedDamage = abs _addedDamage; private _currentPartDamage = _vehicle getHitIndex _hitIndex; -private _nextPartDamage = _currentPartDamage + _newDamage; +private _newPartDamage = _currentPartDamage + _addedDamage; + +// Damage is high enough for immediate destruction +if (_addedDamage >= 15) exitWith { + TRACE_2("immediate destruction - high damage",_addedDamage,_currentPartDamage); -// damage is high enough for immediate destruction -if (_newDamage >= 15) exitWith { - TRACE_2("immediate destruction - high damage",_newDamage,_currentPartDamage); - [_vehicle] call FUNC(knockOut); - [_vehicle, 1] call FUNC(handleDetonation); // Kill everyone inside for very insane damage { - [QGVAR(medicalDamage), [_x, _injurer, _injurer, true], _x] call CBA_fnc_targetEvent; + [QGVAR(medicalDamage), [_x, _source, _instigator, true], _x] call CBA_fnc_targetEvent; } forEach (crew _vehicle); - _vehicle setDamage 1; - _return = false; - _return + + // setDamage triggers "Killed" EH in cookoff, which starts ammo cook-off + [QGVAR(setDamage), [_vehicle, [1, true, _source, _instigator]]] call CBA_fnc_serverEvent; + + false }; private _projectileConfig = _projectile call CBA_fnc_getObjectConfig; -private _warheadTypeStr = getText (_projectileConfig >> "warheadName"); -private _incendiary = [_projectileConfig >> QGVAR(incendiary), "NUMBER", -1] call CBA_fnc_getConfigEntry; -private _warheadType = ["HE", "AP", "HEAT", "TandemHEAT"] find _warheadTypeStr; // numerical index for warhead type for quicker checks. Numbers defined in script_macros.hpp -if (_warheadType < 0) then { - _warheadType = WARHEAD_TYPE_NONE; -}; -if (_incendiary < 0) then { - _incendiary = [0.3, 0.1, 1, 1, 0] select _warheadType; -}; +private _warheadTypeStr = toLowerANSI getText (_projectileConfig >> "warheadName"); +private _warheadType = ["he", "ap", "heat", "tandemheat"] find _warheadTypeStr; // numerical index for warhead type for quicker checks. Numbers defined in script_macros.hpp -private _minDamage = [_hitpointConfig >> "minimalHit", "NUMBER", 0] call CBA_fnc_getConfigEntry; -if (_minDamage < 0) then { - _minDamage = -_minDamage; -}; +private _incendiary = [_projectileConfig >> QGVAR(incendiary), "NUMBER", [0.3, 0.1, 1, 1, 0] select _warheadType] call CBA_fnc_getConfigEntry; + +private _hitPointHash = GVAR(vehicleClassesHitPointHash) getOrDefault [typeOf _vehicle, createHashMap]; +(_hitPointHash getOrDefault [_hitPoint, []]) params ["_hitArea", "_minDamage"]; -private _ammoEffectiveness = 0; -private _projectileExplosive = [_projectileConfig >> "explosive", "NUMBER", 0] call CBA_fnc_getConfigEntry; -private _indirectHit = [_projectileConfig >> "indirectHit", "NUMBER", 0] call CBA_fnc_getConfigEntry; +private _projectileExplosive = getNumber (_projectileConfig >> "explosive"); +private _indirectHit = getNumber (_projectileConfig >> "indirectHit"); -if (_warheadType isEqualTo WARHEAD_TYPE_AP) then { - // change damage based on projectile speed (doesn't do this in vanilla ARMA believe it or not) - if !(isNull _injurer) then { - private _airFriction = [_projectileConfig >> "airFriction", "NUMBER", 0] call CBA_fnc_getConfigEntry; - private _distance = _injurer distance _vehicle; - _newDamage = (1 - _projectileExplosive) * _newDamage * exp(_airFriction * _distance); +if (_warheadType == WARHEAD_TYPE_AP) then { + // Change damage based on projectile speed (doesn't do this in vanilla Arma believe it or not) + if (!isNull _source) then { + private _airFriction = getNumber (_projectileConfig >> "airFriction"); + private _distance = _source distance _vehicle; + _addedDamage = (1 - _projectileExplosive) * _addedDamage * exp (_airFriction * _distance); }; }; private _penChance = 1; -if (_newDamage < _minDamage) then { - _penChance = _newDamage / _minDamage; - TRACE_5("minimum damage modifying hit",_newDamage,_penChance,abs _minDamage,_warheadTypeStr,_hitArea); + +// Added damage can't be 0, so don't need to worry about 0 division here +if (_addedDamage < _minDamage) then { + _penChance = _addedDamage / _minDamage; + + TRACE_5("minimum damage modifying hit",_addedDamage,_penChance,_minDamage,_warheadTypeStr,_hitArea); }; if (_penChance < random 1) exitWith { TRACE_1("didn't penetrate",_penChance); - _return + + true }; if (_minDamage == 0) then { _minDamage = 1; }; -if (_warheadType isEqualTo WARHEAD_TYPE_HE) then { +if (_warheadType == WARHEAD_TYPE_HE) then { private _modifiedIndirectHit = _indirectHit / 100; - if (_newDamage > _modifiedIndirectHit) then { - _newDamage = _newDamage / 2; + + if (_addedDamage > _modifiedIndirectHit) then { + _addedDamage = _addedDamage / 2; }; - _newDamage = (_newDamage * (_newDamage / _modifiedIndirectHit)) min _newDamage; + + _addedDamage = (_addedDamage * (_addedDamage / _modifiedIndirectHit)) min _addedDamage; }; -_ammoEffectiveness = if (_warheadType isEqualTo WARHEAD_TYPE_AP) then { - 0.15 max _newDamage +private _ammoEffectiveness = if (_warheadType == WARHEAD_TYPE_AP) then { + 0.15 max _addedDamage } else { - if (_warheadType isEqualTo WARHEAD_TYPE_HE) then { - (_newDamage / (_minDamage + (_indirectHit / 100)) * 0.2) + if (_warheadType == WARHEAD_TYPE_HE) then { + (_addedDamage / (_minDamage + (_indirectHit / 100)) * 0.2) } else { - ((_newDamage / _minDamage) * 0.4) min 1 + ((_addedDamage / _minDamage) * 0.4) min 1 }; }; -TRACE_4("ammo effectiveness",_ammoEffectiveness,_newDamage,_minDamage,_warheadTypeStr); + +TRACE_4("ammo effectiveness",_ammoEffectiveness,_addedDamage,_minDamage,_warheadTypeStr); _incendiary = _incendiary * _ammoEffectiveness; -private _isCar = (_vehicle isKindOf "Car" && { !(_vehicle isKindOf "Wheeled_APC_F") }); +private _isCar = _vehicle isKindOf "Car" && {!(_vehicle isKindOf "Wheeled_APC_F")}; + if (_isCar) then { - _ammoEffectiveness = (_ammoEffectiveness + (_ammoEffectiveness * 0.5)) min 1; + _ammoEffectiveness = (_ammoEffectiveness * 1.5) min 1; }; -private _currentVehicleAmmo = _vehicle call EFUNC(cookoff,getVehicleAmmo); +(_vehicle call EFUNC(cookoff,getVehicleAmmo)) params ["_magazines", "_totalAmmo"]; private _chanceOfDetonation = 0; private _explosiveAmmoCount = 0; -private _nonExplosiveAmmoCount = 0; -if ((_currentVehicleAmmo select 0) isNotEqualTo []) then { +if (_magazines isNotEqualTo []) then { private _magConfig = configFile >> "CfgMagazines"; private _ammoConfig = configFile >> "CfgAmmo"; private _countOfExplodableAmmo = 0; + { _x params ["_magazineClassname", "_currentAmmoCount"]; + private _initialAmmoCount = getNumber (_magConfig >> _magazineClassname >> "count"); _chanceOfDetonation = _chanceOfDetonation + (_currentAmmoCount / _initialAmmoCount); _countOfExplodableAmmo = _countOfExplodableAmmo + 1; @@ -135,215 +134,241 @@ if ((_currentVehicleAmmo select 0) isNotEqualTo []) then { private _ammoClassname = getText (_magConfig >> _magazineClassname >> "ammo"); private _explosive = getNumber (_ammoConfig >> _ammoClassname >> "explosive"); private _hit = getNumber (_ammoConfig >> _ammoClassname >> "hit"); - if (_explosive > 0.5 || _hit > 50) then { + + if (_explosive > 0.5 || {_hit > 50}) then { _explosiveAmmoCount = _explosiveAmmoCount + 1; - } else { - _nonExplosiveAmmoCount = _nonExplosiveAmmoCount + 1; }; - } forEach (_currentVehicleAmmo select 0); + } forEach _magazines; + if (_countOfExplodableAmmo != 0) then { _chanceOfDetonation = _chanceOfDetonation / _countOfExplodableAmmo; }; }; -private _chanceToDetonate = 0; -private _chanceOfFire = 0; -private _currentFuel = fuel _vehicle; -private _vehicleConfig = _vehicle call CBA_fnc_getObjectConfig; + +private _return = true; + switch (_hitArea) do { case "engine": { - _chanceToDetonate = ([_vehicleConfig >> QGVAR(engineDetonationProb), "NUMBER", 0] call CBA_fnc_getConfigEntry) * _incendiary * _currentFuel * _penChance; - _chanceOfFire = ([_vehicleConfig >> QGVAR(engineFireProb), "NUMBER", 0] call CBA_fnc_getConfigEntry) * _incendiary * _currentFuel * _penChance; + private _vehicleConfig = configOf _vehicle; + private _currentFuel = fuel _vehicle; + private _chanceToDetonate = getNumber (_vehicleConfig >> QGVAR(engineDetonationProb)) * _incendiary * _currentFuel * _penChance; - private _cookoffIntensity = 4 * _currentFuel; - TRACE_6("hit engine",_chanceToDetonate,_chanceOfFire,_incendiary,_chanceOfDetonation,_currentFuel,_cookoffIntensity); + TRACE_4("hit engine",_chanceToDetonate,_incendiary,_chanceOfDetonation,_currentFuel); - if (_isCar) then { - _chanceOfFire = 0; // no cookoff for cars - }; + // Knock out and detonate vehicle if necessary + if ([_vehicle, _chanceToDetonate, _explosiveAmmoCount > 0, _totalAmmo > 0, _source, _instigator] call FUNC(handleDetonation)) exitWith {}; - if ([_vehicle, _chanceToDetonate, _explosiveAmmoCount, _nonExplosiveAmmoCount, _injurer] call FUNC(handleDetonation)) exitWith { - [_vehicle] call FUNC(knockOut); - }; + // Cap damage at 0.9 to avoid hard coded blow up + _newPartDamage = 0.9 min _newPartDamage; - // cap damage at 0.9 to avoid hard coded blow up - _nextPartDamage = (0.9 min _nextPartDamage); + // Fatal engine/drive system damage (engine and tracks stop working at 0.9) + if (0.8 * _ammoEffectiveness > random 1) then { + _newPartDamage = 0.9; + }; - // fatal engine/drive system damage - if (_nextPartDamage == 0.9 || { 0.8 * _ammoEffectiveness > random 1 }) then { - [_vehicle, _hitIndex, _hitpointName, 0.9 * _penChance] call FUNC(addDamage); + if (_newPartDamage == 0.9) then { _vehicle setVariable [QGVAR(canMove), false]; - } else { - [_vehicle, _hitIndex, _hitpointName, _nextPartDamage * _penChance] call FUNC(addDamage); }; - [_vehicle, _chanceOfFire, _cookoffIntensity, _injurer, _hitArea, false] call FUNC(handleCookoff); + [_vehicle, _hitPoint, _hitIndex, _newPartDamage * _penChance, _source, _instigator] call FUNC(setDamage); + + // No cookoff for cars + if (_isCar) exitWith {}; + + private _chanceOfFire = getNumber (_vehicleConfig >> QGVAR(engineFireProb)) * _incendiary * _currentFuel * _penChance; + private _cookoffIntensity = 4 * _currentFuel; + + [_vehicle, _chanceOfFire, _cookoffIntensity, _source, _instigator, "engine", false, false] call FUNC(handleCookoff); }; case "hull": { - _chanceToDetonate = ([_vehicleConfig >> QGVAR(hullDetonationProb), "NUMBER", 0] call CBA_fnc_getConfigEntry) * _incendiary * ((_chanceOfDetonation + _currentFuel) / 2) * _penChance; - _chanceOfFire = ([_vehicleConfig >> QGVAR(hullFireProb), "NUMBER", 0] call CBA_fnc_getConfigEntry) * _incendiary * ((_chanceOfDetonation + _currentFuel) / 2) * _penChance; + private _vehicleConfig = configOf _vehicle; + private _currentFuel = fuel _vehicle; + private _chanceToDetonate = getNumber (_vehicleConfig >> QGVAR(hullDetonationProb)) * _incendiary * ((_chanceOfDetonation + _currentFuel) / 2) * _penChance; - private _cookoffIntensity = 1.5 + (_explosiveAmmoCount * _chanceOfFire); - TRACE_6("hit hull",_chanceToDetonate,_chanceOfFire,_incendiary,_chanceOfDetonation,_currentFuel,_cookoffIntensity); + TRACE_4("hit hull",_chanceToDetonate,_incendiary,_chanceOfDetonation,_currentFuel); - if (_isCar) then { - _chanceOfFire = 0; // no cookoff for cars + // Knock out and detonate vehicle if necessary + if ([_vehicle, _chanceToDetonate, _explosiveAmmoCount > 0, _totalAmmo > 0, _source, _instigator] call FUNC(handleDetonation)) exitWith { + [_vehicle, _hitPoint, _hitIndex, 0.89 * _penChance, _source, _instigator] call FUNC(setDamage); }; - if ([_vehicle, _chanceToDetonate, _explosiveAmmoCount, _nonExplosiveAmmoCount, _injurer] call FUNC(handleDetonation)) exitWith { - [_vehicle, _hitIndex, _hitpointName, 0.89 * _penChance] call FUNC(addDamage); - [_vehicle] call FUNC(knockOut); - }; - - private _hash = _vehicle getVariable [QGVAR(hitpointHash), []]; - private _hashKeys = [_hash] call CBA_fnc_hashKeys; - // 25% chance of jamming turret - 25% of mobility kill - 25% of both - 75% chance of critical hull damage private _rand = random 1; + TRACE_2("rolling hull damage",_ammoEffectiveness,_rand); + private _partKill = []; + if (_ammoEffectiveness > _rand) then { _rand = random 1; + TRACE_2("damaged hull part",_ammoEffectiveness,_rand); + switch (true) do { case (_rand < 0.25): { - [_vehicle, _hitIndex, _hitpointName, 0.89 * _penChance] call FUNC(addDamage); - // iterate through all keys and find appropriate turret - [_hash, { - if (_value#0 isEqualTo "turret") then { - _partKill pushBack _key; + [_vehicle, _hitPoint, _hitIndex, 0.89 * _penChance, _source, _instigator] call FUNC(setDamage); + + // Iterate through all keys and find appropriate turret + { + if ((_y select 0) == "turret") then { + _partKill pushBack _x; }; - }] call CBA_fnc_hashEachPair; + } forEach _hitPointHash; + _vehicle setVariable [QGVAR(canShoot), false]; }; case (_rand < 0.5): { - [_vehicle, _hitIndex, _hitpointName, 0.89 * _penChance] call FUNC(addDamage); - _partKill = _partKill + ENGINE_HITPOINTS#0; + [_vehicle, _hitPoint, _hitIndex, 0.89 * _penChance, _source, _instigator] call FUNC(setDamage); + + _partKill append (ENGINE_HITPOINTS select 0); + if !(_vehicle isKindOf "Wheeled_APC_F") then { - _partKill = _partKill + TRACK_HITPOINTS#0; + _partKill append (TRACK_HITPOINTS select 0); }; _vehicle setVariable [QGVAR(canMove), false]; }; case (_rand < 0.75): { - [_vehicle, _hitIndex, _hitpointName, 0.89 * _penChance] call FUNC(addDamage); - _partKill = _partKill + ENGINE_HITPOINTS#0; + [_vehicle, _hitPoint, _hitIndex, 0.89 * _penChance, _source, _instigator] call FUNC(setDamage); + + _partKill append (ENGINE_HITPOINTS select 0); + if !(_vehicle isKindOf "Wheeled_APC_F") then { - _partKill = _partKill + TRACK_HITPOINTS#0; + _partKill append (TRACK_HITPOINTS select 0); }; - // iterate through all keys and find appropriate turret - [_hash, { - if (_value#0 isEqualTo "turret") then { - _partKill pushBack _key; + // Iterate through all keys and find appropriate turret + { + if ((_y select 0) == "turret") then { + _partKill pushBack _x; }; - }] call CBA_fnc_hashEachPair; + } forEach _hitPointHash; _vehicle setVariable [QGVAR(canMove), false]; _vehicle setVariable [QGVAR(canShoot), false]; }; - default{}; }; }; { + [_vehicle, _x, -1, _penChance, _source, _instigator] call FUNC(setDamage); + TRACE_1("doing damage to hitpoint",_x); - [_vehicle, -1, _x, 1 * _penChance] call FUNC(addDamage); } forEach _partKill; - [_vehicle, _chanceOfFire, _cookoffIntensity, _injurer, "", true] call FUNC(handleCookoff); + // No cookoff for cars + if (_isCar) exitWith {}; + + private _chanceOfFire = getNumber (_vehicleConfig >> QGVAR(hullFireProb)) * _incendiary * ((_chanceOfDetonation + _currentFuel) / 2) * _penChance; + private _cookoffIntensity = 1.5 + (_explosiveAmmoCount * _chanceOfFire); + + [_vehicle, _chanceOfFire, _cookoffIntensity, _source, _instigator] call FUNC(handleCookoff); }; case "turret": { - _chanceToDetonate = ([_vehicleConfig >> QGVAR(turretDetonationProb), "NUMBER", 0] call CBA_fnc_getConfigEntry) * _incendiary * _chanceOfDetonation * _penChance; - _chanceOfFire = ([_vehicleConfig >> QGVAR(turretFireProb), "NUMBER", 0] call CBA_fnc_getConfigEntry) * _incendiary * _chanceOfDetonation * _penChance; + private _vehicleConfig = configOf _vehicle; + private _chanceToDetonate = getNumber (_vehicleConfig >> QGVAR(turretDetonationProb)) * _incendiary * _chanceOfDetonation * _penChance; - private _cookoffIntensity = _explosiveAmmoCount * _chanceOfFire; - TRACE_6("hit turret",_chanceToDetonate,_chanceOfFire,_incendiary,_chanceOfDetonation,_currentFuel,_cookoffIntensity); + TRACE_3("hit turret",_chanceToDetonate,_incendiary,_chanceOfDetonation); - if (_isCar) then { - _chanceOfFire = 0; // no cookoff for cars - }; - - if ([_vehicle, _chanceToDetonate, _explosiveAmmoCount, _nonExplosiveAmmoCount, _injurer] call FUNC(handleDetonation)) exitWith { - [_vehicle] call FUNC(knockOut); - }; + if ([_vehicle, _chanceToDetonate, _explosiveAmmoCount > 0, _totalAmmo > 0, _source, _instigator] call FUNC(handleDetonation)) exitWith {}; if (0.8 * _ammoEffectiveness > random 1) then { TRACE_1("damaged turret",_ammoEffectiveness * 0.8); - [_vehicle, _hitIndex, _hitpointName, 1 * _penChance] call FUNC(addDamage); + + [_vehicle, _hitPoint, _hitIndex, _penChance, _source, _instigator] call FUNC(setDamage); + _vehicle setVariable [QGVAR(canShoot), false]; }; - [_vehicle, _chanceOfFire, _cookoffIntensity, _injurer, "", true] call FUNC(handleCookoff); + // No cookoff for cars + if (_isCar) exitWith {}; + + private _chanceOfFire = getNumber (_vehicleConfig >> QGVAR(turretFireProb)) * _incendiary * _chanceOfDetonation * _penChance; + private _cookoffIntensity = _explosiveAmmoCount * _chanceOfFire; + + [_vehicle, _chanceOfFire, _cookoffIntensity, _source, _instigator] call FUNC(handleCookoff); }; case "gun": { - TRACE_5("hit gun",_chanceToDetonate,_chanceOfFire,_incendiary,_chanceOfDetonation,_currentFuel); + TRACE_2("hit gun",_addedDamage,_minDamage); + if (0.8 * _ammoEffectiveness > random 1) then { TRACE_1("damaged gun",_ammoEffectiveness * 0.8); - [_vehicle, _hitIndex, _hitpointName, 1 * _penChance] call FUNC(addDamage); + + [_vehicle, _hitPoint, _hitIndex, _penChance, _source, _instigator] call FUNC(setDamage); + _vehicle setVariable [QGVAR(canShoot), false]; }; }; case "track": { - private _damage = (0.1 max (0.1 * _newDamage / _minDamage)) min 1; - [_vehicle, _hitIndex, _hitpointName, (_currentPartDamage + _damage) * _penChance] call FUNC(addDamage); - TRACE_3("damaged track",_damage,_newDamage,_minDamage); + private _damage = (0.1 max (0.1 * _addedDamage / _minDamage)) min 1; + + [_vehicle, _hitPoint, _hitIndex, (_currentPartDamage + _damage) * _penChance] call FUNC(setDamage); + + TRACE_3("damaged track",_damage,_addedDamage,_minDamage); if ((_vehicle getHitIndex _hitIndex) >= 1) then { _vehicle setVariable [QGVAR(canMove), false]; }; }; case "wheel": { - [_vehicle, _hitIndex, _hitpointName, (_currentPartDamage + _newDamage) * _penChance] call FUNC(addDamage); - TRACE_1("damaged wheel",_newDamage); + [_vehicle, _hitPoint, _hitIndex, (_currentPartDamage + _addedDamage) * _penChance, _source, _instigator] call FUNC(setDamage); + + TRACE_1("damaged wheel",_addedDamage); }; case "fuel": { - _chanceOfFire = (_incendiary * _currentFuel * _penChance) / 2; - private _cookoffIntensity = _currentFuel * 5; - TRACE_2("damaged fuel",_chanceOfFire,_cookoffIntensity); + private _damage = (0.1 max (0.1 * _addedDamage / _minDamage)) min 1; + [_vehicle, _hitPoint, _hitIndex, (_currentPartDamage + _damage) * _penChance, _source, _instigator] call FUNC(setDamage); - if (_isCar) then { - _chanceOfFire = 0; // no cookoff for cars - }; + // No cookoff for cars + if (_isCar) exitWith {}; + + private _currentFuel = fuel _vehicle; + private _chanceOfFire = (_incendiary * _currentFuel * _penChance) / 2; + private _cookoffIntensity = _currentFuel * 5; - [_vehicle, _chanceOfFire, _cookoffIntensity, _injurer, "", false] call FUNC(handleCookoff); + TRACE_4("damaged fuel",_chanceOfFire,_incendiary,_cookoffIntensity,_currentFuel); - private _damage = (0.1 max (0.1 * _newDamage / _minDamage)) min 1; - [_vehicle, _hitIndex, _hitpointName, (_currentPartDamage + _damage) * _penChance] call FUNC(addDamage); + [_vehicle, _chanceOfFire, _cookoffIntensity, _source, _instigator, "", false, false] call FUNC(handleCookoff); }; case "slat": { TRACE_2("hit slat",_warheadType,_warheadTypeStr); - // incredibly small chance of AP destroying SLAT - if (_warheadType isEqualTo WARHEAD_TYPE_HEAT || { _warheadType isEqualTo WARHEAD_TYPE_TANDEM } || { _warheadType isEqualTo WARHEAD_TYPE_HE } || { 0.01 > random 1 }) then { + + // Incredibly small chance of AP destroying SLAT + if (_warheadType in [WARHEAD_TYPE_HE, WARHEAD_TYPE_AP, WARHEAD_TYPE_HEAT, WARHEAD_TYPE_TANDEM] || {0.01 > random 1}) then { private _currentDamage = _vehicle getHitIndex _hitIndex; + TRACE_3("damaged slat",_warheadType,_warheadTypeStr,_currentDamage); - if (_warheadType isEqualTo WARHEAD_TYPE_HEAT || { _warheadType isEqualTo WARHEAD_TYPE_TANDEM }) then { - [_vehicle, _hitIndex, _hitpointName, 1] call FUNC(addDamage); + if (_warheadType in [WARHEAD_TYPE_HEAT, WARHEAD_TYPE_TANDEM, WARHEAD_TYPE_AP]) then { + [_vehicle, _hitPoint, _hitIndex, 1, _source, _instigator] call FUNC(setDamage); } else { - [_vehicle, _hitIndex, _hitpointName, _currentDamage + (0.5 max random 1)] call FUNC(addDamage); + [_vehicle, _hitPoint, _hitIndex, _currentDamage + (0.5 max random 1), _source, _instigator] call FUNC(setDamage); }; - if (_currentDamage < 1 && _warheadType isEqualTo WARHEAD_TYPE_HEAT) then { + if (_currentDamage < 1 && {_warheadType == WARHEAD_TYPE_HEAT}) then { _return = false; }; }; }; case "era": { TRACE_2("hit era",_warheadType,_warheadTypeStr); - if (_warheadType isEqualTo WARHEAD_TYPE_HEAT || { _warheadType isEqualTo WARHEAD_TYPE_TANDEM } || { 0.05 > random 1 }) then { + + if (_warheadType in [WARHEAD_TYPE_AP, WARHEAD_TYPE_HEAT, WARHEAD_TYPE_TANDEM] || {0.05 > random 1}) then { private _currentDamage = _vehicle getHitIndex _hitIndex; + TRACE_3("damaged era",_warheadType,_warheadTypeStr,_currentDamage); - [_vehicle, _hitIndex, _hitpointName, 1] call FUNC(addDamage); - // dont process anymore damage if this is HEAT - shouldnt happen anyway but ARMA says it does so you know - if (_currentDamage < 1 && _warheadType isEqualTo WARHEAD_TYPE_HEAT) then { + [_vehicle, _hitPoint, _hitIndex, 1, _source, _instigator] call FUNC(setDamage); + + // Don't process anymore damage if this is HEAT - shouldn't happen anyway but Arma says it does so you know + if (_currentDamage < 1 && {_warheadType == WARHEAD_TYPE_HEAT}) then { _return = false; }; }; }; default { TRACE_1("hit unknown hitpoint??",_hitArea); - } + }; }; _return diff --git a/addons/vehicle_damage/functions/fnc_setDamage.sqf b/addons/vehicle_damage/functions/fnc_setDamage.sqf new file mode 100644 index 00000000000..8b75bff1f7a --- /dev/null +++ b/addons/vehicle_damage/functions/fnc_setDamage.sqf @@ -0,0 +1,45 @@ +#include "..\script_component.hpp" +/* + * Author: tcvm + * Sets vehicle damage based on HitIndex. Failing that it falls back to HitPoint name. + * + * Arguments: + * 0: Vehicle <OBJECT> + * 1: Hit point <STRING> + * 2: Hit index <NUMBER> + * 3: Damage <NUMBER> + * 4: Source of damage <OBJECT> + * 5: Person who caused damage <OBJECT> + * + * Return Value: + * None + * + * Example: + * [cursorObject, "HitEngine", 1, 0.25, player, player] call ace_vehicle_damage_fnc_setDamage + * + * Public: No + */ + +params ["_vehicle", "_hitPoint", "_hitIndex", "_damage", "_source", "_instigator"]; +TRACE_6("setDamage",_vehicle,_hitPoint,_hitIndex,_damage,_source,_instigator); + +private _currentDamage = _vehicle getHitPointDamage _hitPoint; + +if (_damage < _currentDamage) exitWith { + TRACE_3("capping damage at current",_damage,_currentDamage,_hitPoint); +}; + +if (_hitPoint == "#structural") then { + _hitPoint = "hithull"; + _hitIndex = -1; +}; + +if (_hitIndex >= 0) then { + _vehicle setHitIndex [_hitIndex, _damage, true, _source, _instigator]; +} else { + _vehicle setHitPointDamage [_hitPoint, _damage, true, _source, _instigator]; +}; + +if (_hitPoint == "HitEngine" && {_damage >= 0.9}) then { + [QEGVAR(cookoff,engineFireServer), _vehicle] call CBA_fnc_serverEvent; +}; diff --git a/addons/vehicle_damage/initSettings.inc.sqf b/addons/vehicle_damage/initSettings.inc.sqf index 0d3f324af2f..3a1bcf568ab 100644 --- a/addons/vehicle_damage/initSettings.inc.sqf +++ b/addons/vehicle_damage/initSettings.inc.sqf @@ -1,19 +1,21 @@ [ - QGVAR(enabled), "CHECKBOX", + QGVAR(enabled), + "CHECKBOX", [ELSTRING(common,Enabled), LSTRING(setting_description)], LSTRING(category_displayName), - false, // default value - true, // isGlobal + false, + 1, {[QGVAR(enabled), _this] call EFUNC(common,cbaSettings_settingChanged)}, true // Needs mission restart -] call CBA_settings_fnc_init; +] call CBA_fnc_addSetting; [ - QGVAR(enableCarDamage), "CHECKBOX", + QGVAR(enableCarDamage), + "CHECKBOX", [LSTRING(carDamage_setting_enable), LSTRING(carDamage_setting_description)], LSTRING(category_displayName), - false, // default value - true, // isGlobal + false, + 1, {[QGVAR(enableCarDamage), _this] call EFUNC(common,cbaSettings_settingChanged)}, true // Needs mission restart -] call CBA_settings_fnc_init; +] call CBA_fnc_addSetting; diff --git a/addons/vehicle_damage/script_macros.hpp b/addons/vehicle_damage/script_macros.hpp index 84f3120ac15..43bac7e2f80 100644 --- a/addons/vehicle_damage/script_macros.hpp +++ b/addons/vehicle_damage/script_macros.hpp @@ -7,21 +7,23 @@ #define IS_EXPLOSIVE_AMMO(ammo) (getNumber (ammo call CBA_fnc_getObjectConfig >> "explosive") > 0.5) #define ENGINE_HITPOINTS [["hitengine"], "engine"] -#define HULL_HITPOINTS [["hithull", "hitbody", "#structural"],"hull"] +#define HULL_HITPOINTS [["hithull", "hitbody", "#structural"], "hull"] #define TRACK_HITPOINTS [["hitltrack", "hitrtrack"], "track"] #define WHEEL_HITPOINTS [["hitlbwheel", "hitlmwheel", "hitlfwheel", "hitlf2wheel", "hitrbwheel", "hitrmwheel", "hitrlwheel", "hitrfwheel", "hitrf2wheel"], "wheel"] #define FUEL_HITPOINTS [["hitfuel"], "fuel"] #define ALL_HITPOINTS [ENGINE_HITPOINTS, HULL_HITPOINTS, TRACK_HITPOINTS, WHEEL_HITPOINTS, FUEL_HITPOINTS] -#define CRITICAL_HITPOINTS ["hithull", 0.89, "hitbody", 0.89, "#structural", 0.89, "hitengine", 0.9] +#define CRITICAL_HITPOINTS ["hithull", "hitbody", "#structural", "hitengine"] +#define CRITICAL_HITPOINTS_THRESHOLDS [0.89, 0.89, 0.89, 0.9] #define WARHEAD_TYPE_HE 0 #define WARHEAD_TYPE_AP 1 #define WARHEAD_TYPE_HEAT 2 #define WARHEAD_TYPE_TANDEM 3 -#define WARHEAD_TYPE_NONE 4 #define EJECT_IF_DESTROYED_VEHICLES ["Boat_Transport_02_base_F", "Rubber_duck_base_F"] - -#define CREATE_INCENDIARY_AMMO(ammo,base,inc) class ammo: base { GVAR(incendiary) = inc; } +#define CREATE_INCENDIARY_AMMO(ammo,base,inc)\ +class ammo: base {\ + GVAR(incendiary) = inc;\ +} diff --git a/addons/vehicle_damage/stringtable.xml b/addons/vehicle_damage/stringtable.xml index 4a8fdb42643..90203b6bf9e 100644 --- a/addons/vehicle_damage/stringtable.xml +++ b/addons/vehicle_damage/stringtable.xml @@ -3,7 +3,7 @@ <Package name="Vehicle_Damage"> <Key ID="STR_ACE_Vehicle_Damage_category_displayName"> <English>ACE Advanced Vehicle Damage</English> - <Japanese>ACE アドバンスドビークルダメージ</Japanese> + <Japanese>ACE 高度な乗り物ダメージ</Japanese> <French>ACE Dégâts de véhicule avancés</French> <German>ACE Erweiterter Fahrzeugsschaden</German> <Italian>ACE Danni Veicolo Avanzati</Italian> @@ -12,42 +12,43 @@ <Korean>ACE 고급 차량 피해</Korean> <Russian>ACE Продвинутое повреждение техники</Russian> <Spanish>ACE Daño avanzado de vehículos</Spanish> + <Portuguese>ACE Dano avançãdo de veículos</Portuguese> </Key> <Key ID="STR_ACE_Vehicle_Damage_setting_description"> - <English>Enable/Disable advanced vehicle damage</English> - <Japanese>アドバンスドビークルダメージを有効/無効にする</Japanese> + <English>Enable advanced vehicle damage</English> <French>Active les dégâts de véhicule avancés.</French> - <German>Aktiviert/Deaktiviert den Erweiterten Fahrzeugsschaden</German> + <German>Aktiviert den Erweiterten Fahrzeugsschaden</German> <Italian>Abilità danni avanzati ai veicoli</Italian> - <Polish>Włącz/Wyłącz zaawansowane uszkodzenia pojazdów</Polish> - <Chinesesimp>启用/禁用高级载具损坏</Chinesesimp> - <Korean>고급 차량 피해 활성화/비활성화</Korean> - <Russian>Включить/выключить продвинутое повреждение техники</Russian> - <Spanish>Habilitar/Deshabilitar el daño avanzado de vehículos</Spanish> - </Key> - <Key ID="STR_ACE_Vehicle_Damage_carDamage_setting_description"> - <English>Enable/Disable advanced car damage (Experimental)</English> - <Japanese>アドバンスド車ダメージを有効/無効にする (試験的)</Japanese> - <French>Active les dégâts avancés sur les voitures (expérimental).</French> - <German>Aktiviert/Deaktiviert den Erweiterten Fahrzeugsschaden (Experimentell)</German> - <Italian>Abilita danni avanzati ai veicoli (sperimentale)</Italian> - <Polish>Włącz/Wyłącz zaawansowane uszkodzenia w samochodach (eksperymentalne)</Polish> - <Chinesesimp>启用/禁用高级车辆损坏(实验性)</Chinesesimp> - <Korean>고급 차량 피해(실험용) 활성화/비활성화</Korean> - <Russian>Включить/выключить продвинутое повреждение машин (экспериментальное)</Russian> - <Spanish>Habilita/Deshabilita el daño avanzado de coche (Experimental)</Spanish> + <Polish>Włącz zaawansowane uszkodzenia pojazdów</Polish> + <Russian>Включить продвинутое повреждение техники</Russian> + <Spanish>Habilitar el daño avanzado de vehículos</Spanish> + <Portuguese>Ativar dano avançado de veículo</Portuguese> + <Japanese>乗り物(Vehicle)に対しての高度なダメージ計算を有効化します</Japanese> + <Korean>고급 차량 피해 활성화</Korean> </Key> <Key ID="STR_ACE_Vehicle_Damage_carDamage_setting_enable"> - <English>Enable/Disable advanced car damage</English> - <Japanese>アドバンスド車ダメージを有効/無効にする</Japanese> + <English>Enable advanced car damage</English> <French>Dégâts de voiture avancés</French> - <German>Aktiviert/Deaktiviert erweiterten Autoschaden</German> + <German>Aktiviert erweiterten Autoschaden</German> <Italian>Abilita danni avanzati alle macchine</Italian> - <Polish>Włącz/Wyłącz zaawansowane uszkodzenia w samochodach</Polish> - <Chinesesimp>启用/禁用高级车辆损坏</Chinesesimp> - <Korean>고급 차량 피해 활성화/비활성화</Korean> - <Russian>Продвинутое повреждение машин</Russian> - <Spanish>Habilitar/Deshabilitar daño avanzado de coche (Experimental)</Spanish> + <Polish>Włącz zaawansowane uszkodzenia w samochodach</Polish> + <Spanish>Habilitar daño avanzado de coche</Spanish> + <Portuguese>Habilitar dano avançado para carros</Portuguese> + <Japanese>高度な車ダメージを有効化</Japanese> + <Russian>Включить продвинутое повреждение автомобиля</Russian> + <Korean>고급 자동차 피해 활성화</Korean> + </Key> + <Key ID="STR_ACE_Vehicle_Damage_carDamage_setting_description"> + <English>Enable advanced car damage (Experimental)</English> + <French>Active les dégâts avancés sur les voitures (expérimental).</French> + <German>Aktiviert den Erweiterten Fahrzeugsschaden (Experimentell)</German> + <Italian>Abilita danni avanzati ai veicoli (sperimentale)</Italian> + <Polish>Włącz zaawansowane uszkodzenia w samochodach (eksperymentalne)</Polish> + <Russian>Включить продвинутое повреждение машин (экспериментальное)</Russian> + <Spanish>Habilitar daño avanzado de coche (Experimental)</Spanish> + <Portuguese>Habilitar dano avançado para carros (Experimental)</Portuguese> + <Japanese>車(Car)に対しての高度なダメージ計算を有効化します (試験的機能)</Japanese> + <Korean>고급 자동차 피해 활성화 (실험용)</Korean> </Key> <Key ID="STR_ACE_Vehicle_Damage_generic_turret_wreck"> <English>Wreck (Turret)</English> diff --git a/addons/vehiclelock/functions/fnc_hasKeyForVehicle.sqf b/addons/vehiclelock/functions/fnc_hasKeyForVehicle.sqf index c5f7e0e35a0..ec58a6fa2c5 100644 --- a/addons/vehiclelock/functions/fnc_hasKeyForVehicle.sqf +++ b/addons/vehiclelock/functions/fnc_hasKeyForVehicle.sqf @@ -34,4 +34,4 @@ if (_sideKeyName in _items) exitWith {true}; private _customKeys = _veh getVariable [QGVAR(customKeys), []]; private _magazines = magazinesDetail _unit; -(_customKeys findIf {_x in _magazines}) != -1 +_customKeys findAny _magazines != -1 diff --git a/addons/vehiclelock/stringtable.xml b/addons/vehiclelock/stringtable.xml index b247967fe17..7c501f74c54 100644 --- a/addons/vehiclelock/stringtable.xml +++ b/addons/vehiclelock/stringtable.xml @@ -80,7 +80,7 @@ <Italian>Scassinando il veicolo...</Italian> <Portuguese>Usando Mixa...</Portuguese> <Japanese>鍵をこじ開けています・・・</Japanese> - <Korean>문따는 중...</Korean> + <Korean>문 따는 중...</Korean> <Chinesesimp>正在开锁...</Chinesesimp> <Chinese>解鎖中...</Chinese> <Turkish>Maymuncuklanıyor...</Turkish> @@ -288,6 +288,7 @@ <German>Unklaren Sperrzustand entfernen</German> <Chinesesimp>移除不明确的上锁状态</Chinesesimp> <Korean>불분명한 잠금상태 제거</Korean> + <Portuguese>Remover estado de bloqueio ambíguo</Portuguese> </Key> <Key ID="STR_ACE_VehicleLock_VehicleStartingLockState_AsIs"> <English>As Is</English> diff --git a/addons/vehicles/CfgWeapons.hpp b/addons/vehicles/CfgWeapons.hpp index 2fbe4e52466..0c2eb0e4de4 100644 --- a/addons/vehicles/CfgWeapons.hpp +++ b/addons/vehicles/CfgWeapons.hpp @@ -13,8 +13,7 @@ class CfgWeapons { class ACE_LMG_coax_DenelMG4: LMG_coax {}; class LMG_Minigun: LMG_RCWS { - // Add the following: "2000Rnd_762x51_Belt_T_Green","2000Rnd_762x51_Belt_T_Red","2000Rnd_762x51_Belt_T_Yellow","5000Rnd_762x51_Belt","5000Rnd_762x51_Yellow_Belt" - magazines[] = {"PylonWeapon_2000Rnd_65x39_belt", "1000Rnd_65x39_Belt","1000Rnd_65x39_Belt_Green","1000Rnd_65x39_Belt_Tracer_Green","1000Rnd_65x39_Belt_Tracer_Red","1000Rnd_65x39_Belt_Tracer_Yellow","1000Rnd_65x39_Belt_Yellow","2000Rnd_65x39_Belt","2000Rnd_65x39_Belt_Green","2000Rnd_65x39_Belt_Tracer_Green","2000Rnd_65x39_Belt_Tracer_Green_Splash","2000Rnd_65x39_Belt_Tracer_Red","2000Rnd_65x39_Belt_Tracer_Yellow","2000Rnd_65x39_Belt_Tracer_Yellow_Splash","2000Rnd_65x39_Belt_Yellow","2000Rnd_762x51_Belt_T_Green","2000Rnd_762x51_Belt_T_Red","2000Rnd_762x51_Belt_T_Yellow","200Rnd_65x39_Belt","200Rnd_65x39_Belt_Tracer_Green","200Rnd_65x39_Belt_Tracer_Red","200Rnd_65x39_Belt_Tracer_Yellow","5000Rnd_762x51_Belt","5000Rnd_762x51_Yellow_Belt","500Rnd_65x39_Belt","500Rnd_65x39_Belt_Tracer_Red_Splash","500Rnd_65x39_Belt_Tracer_Green_Splash","500Rnd_65x39_Belt_Tracer_Yellow_Splash"}; + magazines[] += {"2000Rnd_762x51_Belt_T_Green","2000Rnd_762x51_Belt_T_Red","2000Rnd_762x51_Belt_T_Yellow","5000Rnd_762x51_Belt","5000Rnd_762x51_Yellow_Belt"}; }; class HMG_127: LMG_RCWS { diff --git a/addons/vehicles/stringtable.xml b/addons/vehicles/stringtable.xml index 741901d75c7..6148bcdd25e 100644 --- a/addons/vehicles/stringtable.xml +++ b/addons/vehicles/stringtable.xml @@ -29,6 +29,7 @@ <Russian>Круиз-контроль включён</Russian> <Spanish>Control de crucero encendido</Spanish> <French>Régulateur de vitesse activé</French> + <Portuguese>Controle de cruzeiro ativado</Portuguese> </Key> <Key ID="STR_ACE_Vehicles_Off"> <English>Speed Limiter off</English> @@ -58,6 +59,7 @@ <Russian>Круиз-контроль выключен</Russian> <Spanish>Control de crucero apagado</Spanish> <French>Régulateur de vitesse désactivé</French> + <Portuguese>Controle de cruzeiro desativado</Portuguese> </Key> <Key ID="STR_ACE_Vehicles_SpeedLimit"> <English>Speed Limit</English> diff --git a/addons/viewdistance/stringtable.xml b/addons/viewdistance/stringtable.xml index eb7ed948382..5012e905e2d 100644 --- a/addons/viewdistance/stringtable.xml +++ b/addons/viewdistance/stringtable.xml @@ -97,7 +97,7 @@ <Russian>Устанавливает предел дальности, насколько клиенты могут увеличить свою дальность видимости (до 10000)</Russian> <Italian>Imposta il limite massimo a cui i client possono alzare la propria distanza visiva (massimo 10000)</Italian> <Japanese>各クライアントが設定できる視界距離の上限 (最大 10000)</Japanese> - <Korean>클라이언트가 최대 얼마나 멀리 볼 수 있는지 제한을 둡니다 (10000 까지 가능)</Korean> + <Korean>클라이언트가 최대 얼마나 멀리 볼 수 있는지 제한을 둡니다 (10000까지 가능)</Korean> <Chinesesimp>设定客户端最高可显示的视距(最高至10000)</Chinesesimp> <Chinese>設定客戶端最高可顯示的視野距離 (最高至10000)</Chinese> <Turkish>Kişilerin görüş mesafelerini ne kadar yükseltebileceğine ilişkin sınırı belirler (En Fazla 10000)</Turkish> @@ -129,6 +129,7 @@ <Russian>Значение 0 будет использовать настройки видео по умолчанию</Russian> <Spanish>Establecer a 0 utiliza las opciones de video por defecto</Spanish> <French>La valeur 0 permet d'utiliser les paramètres vidéo par défaut</French> + <Portuguese>Estabelecer em 0 utilizará as configurações padrão de vídeo</Portuguese> </Key> <Key ID="STR_ACE_ViewDistance_onFoot_DisplayName"> <English>Client View Distance (On Foot)</English> diff --git a/addons/viewports/dev/debugPoints.sqf b/addons/viewports/dev/debugPoints.sqf index 53fe016b628..2ffc81f512a 100644 --- a/addons/viewports/dev/debugPoints.sqf +++ b/addons/viewports/dev/debugPoints.sqf @@ -22,8 +22,8 @@ #define IDD_3DEN 313 [] spawn { - INFO_2("Pre-Init [is3den %1][3den display: %2]",is3den,!isNull findDisplay IDD_3DEN); - if (!is3den) exitWith {}; + INFO_2("Pre-Init [is3den %1][3den display: %2]",is3DEN,!isNull findDisplay IDD_3DEN); + if (!is3DEN) exitWith {}; GVAR(3denIndex) = 0; GVAR(3denViewports) = []; @@ -99,7 +99,7 @@ private _pointASL = _intersections # 0 # 0; if (isNil "_pointASL") exitWith {}; _pointASL = _pointASL vectorAdd [0,0,0.09]; // Add a little bit up because it always sinks into the model - private _pointMS = _vehicle worldToModel ASLtoAGL _pointASL; + private _pointMS = _vehicle worldToModel ASLToAGL _pointASL; private _name = format ["view_%1",GVAR(3denIndex)]; // [_name, _type, _camLocation, _camAttach, _screenLocation, _maxDistance, _compartments, _roles] @@ -114,7 +114,7 @@ addMissionEventHandler ["Draw3D", { private _vehicle = vehicle player; private _viewports = _vehicle getVariable [QGVAR(viewports), []]; - if (is3den) then { + if (is3DEN) then { _vehicle = (get3DENSelected "object") param [0, objNull]; if (isNull _vehicle) exitWith {}; _viewports = [_vehicle] call FUNC(getViewports); @@ -127,7 +127,7 @@ addMissionEventHandler ["Draw3D", { drawIcon3D ["#(argb,8,8,3)color(1,1,1,1)", [1,1,0,1], _vehicle modelToWorldVisual [0,0,0], 0.1, 0.1, 0, "", 1, 0.02, "TahomaB"]; if (alive player) then { // not using ace_player so this works in 3den - drawIcon3D ["#(argb,8,8,3)color(1,1,1,1)", [0,1,0,1], aslToAGL eyepos player, 0.1, 0.1, 0, "eye", 1, 0.02, "TahomaB"]; + drawIcon3D ["#(argb,8,8,3)color(1,1,1,1)", [0,1,0,1], ASLToAGL eyePos player, 0.1, 0.1, 0, "eye", 1, 0.02, "TahomaB"]; drawIcon3D ["#(argb,8,8,3)color(1,1,1,1)", [0,1,0,1], player modelToWorldVisual (player selectionPosition "pilot"), 0.1, 0.1, 0, "pilot", 1, 0.02, "TahomaB"]; }; // { diff --git a/addons/viewports/functions/fnc_eachFrame.sqf b/addons/viewports/functions/fnc_eachFrame.sqf index 21f2f09dc8d..55971172945 100644 --- a/addons/viewports/functions/fnc_eachFrame.sqf +++ b/addons/viewports/functions/fnc_eachFrame.sqf @@ -39,12 +39,12 @@ if (cba_events_control) then { ([_player] call FUNC(getSeatInfo)) params ["_role", "", "", "_compartment"]; private _newIndexAngle = 45; // Controls the max angle - private _eyesPosASL = AGLtoASL (positionCameraToWorld [0, 0, 0]); - private _eyesDir = (AGLtoASL (positionCameraToWorld [0, 0, 1])) vectorDiff _eyesPosASL; + private _eyesPosASL = AGLToASL (positionCameraToWorld [0, 0, 0]); + private _eyesDir = (AGLToASL (positionCameraToWorld [0, 0, 1])) vectorDiff _eyesPosASL; { _x params ["", "", "_camLocation", "", "_screenLocation", "_maxDistance", "_compartments", "_roles"]; - private _viewASL = AGLtoASL (_vehicle modelToWorldVisual _screenLocation); + private _viewASL = AGLToASL (_vehicle modelToWorldVisual _screenLocation); private _viewDiff = _viewASL vectorDiff _eyesPosASL; private _viewAngle = acos (_viewDiff vectorCos _eyesDir); #ifdef DEBUG_MODE_FULL diff --git a/addons/viewports/functions/fnc_viewCreate.sqf b/addons/viewports/functions/fnc_viewCreate.sqf index 8b08da95756..7d9e45864b0 100644 --- a/addons/viewports/functions/fnc_viewCreate.sqf +++ b/addons/viewports/functions/fnc_viewCreate.sqf @@ -68,12 +68,12 @@ switch (true) do { private _ctrlRender = _display ctrlCreate ["RscPicture", -1]; _ctrlRender ctrlSetText _renderTexture; - _ctrlRender ctrlSetPosition [safezoneX + 0.5 * safezoneW - 0.5 * _viewWidth, safezoneY + 0.5 * safeZoneH - 0.5 * _viewHeight, _viewWidth, _viewHeight]; + _ctrlRender ctrlSetPosition [safeZoneX + 0.5 * safeZoneW - 0.5 * _viewWidth, safeZoneY + 0.5 * safeZoneH - 0.5 * _viewHeight, _viewWidth, _viewHeight]; _ctrlRender ctrlCommit 0; private _ctrlOverlay = _display ctrlCreate ["RscPicture", -1]; _ctrlOverlay ctrlSetText "\a3\weapons_f\reticle\data\optika_tv_ca.paa"; - _ctrlOverlay ctrlSetPosition [safezoneX + 0.5 * safezoneW - 0.5 * _viewWidth, safezoneY + 0.5 * safeZoneH - 0.5 * _viewHeight, _viewWidth, _viewHeight]; + _ctrlOverlay ctrlSetPosition [safeZoneX + 0.5 * safeZoneW - 0.5 * _viewWidth, safeZoneY + 0.5 * safeZoneH - 0.5 * _viewHeight, _viewWidth, _viewHeight]; _ctrlOverlay ctrlCommit 0; if (_usingGoggles) then { @@ -82,7 +82,7 @@ switch (true) do { private _ctrlNVG = _display ctrlCreate ["RscPicture", -1]; _ctrlNVG ctrlSetText "#(argb,8,8,3)color(1,1,0.6,0.9)"; - _ctrlNVG ctrlSetPosition [safezoneX + 0.5 * safezoneW - 0.5 * _viewWidth, safezoneY + 0.5 * safeZoneH - 0.5 * _viewHeight, _viewWidth, _viewHeight]; + _ctrlNVG ctrlSetPosition [safeZoneX + 0.5 * safeZoneW - 0.5 * _viewWidth, safeZoneY + 0.5 * safeZoneH - 0.5 * _viewHeight, _viewWidth, _viewHeight]; _ctrlNVG ctrlCommit 0; } else { _camEffect = [0]; // 2.08's currentVisionMode change could allow matching real turret's vision mode @@ -106,20 +106,20 @@ switch (true) do { private _ctrlRender = _display ctrlCreate ["RscPicture", -1]; _ctrlRender ctrlSetText _renderTexture; - _ctrlRender ctrlSetPosition [safezoneX + 0.5 * safezoneW - 0.5 * _viewWidth, safezoneY + 0.5 * safeZoneH - 0.5 * _viewHeight, _viewWidth, _viewHeight]; + _ctrlRender ctrlSetPosition [safeZoneX + 0.5 * safeZoneW - 0.5 * _viewWidth, safeZoneY + 0.5 * safeZoneH - 0.5 * _viewHeight, _viewWidth, _viewHeight]; _ctrlRender ctrlCommit 0; if (_usingGoggles) then { // Roughly try to color match ace_nvg, and make it semi-opaque private _ctrlNVG = _display ctrlCreate ["RscPicture", -1]; _ctrlNVG ctrlSetText "#(argb,8,8,3)color(0.25,0.2,0.05,0.75)"; - _ctrlNVG ctrlSetPosition [safezoneX + 0.5 * safezoneW - 0.5 * _viewWidth, safezoneY + 0.5 * safeZoneH - 0.5 * _viewHeight, _viewWidth, _viewHeight]; + _ctrlNVG ctrlSetPosition [safeZoneX + 0.5 * safeZoneW - 0.5 * _viewWidth, safeZoneY + 0.5 * safeZoneH - 0.5 * _viewHeight, _viewWidth, _viewHeight]; _ctrlNVG ctrlCommit 0; }; private _ctrlOverlay = _display ctrlCreate ["RscPicture", -1]; _ctrlOverlay ctrlSetText QPATHTOF(data\optic_window_ca.paa); - _ctrlOverlay ctrlSetPosition [safezoneX + 0.5 * safezoneW - 0.5 * _viewWidth, safezoneY + 0.5 * safeZoneH - 0.5 * _viewHeight, _viewWidth, _viewHeight]; + _ctrlOverlay ctrlSetPosition [safeZoneX + 0.5 * safeZoneW - 0.5 * _viewWidth, safeZoneY + 0.5 * safeZoneH - 0.5 * _viewHeight, _viewWidth, _viewHeight]; _ctrlOverlay ctrlCommit 0; }; }; diff --git a/addons/viewports/stringtable.xml b/addons/viewports/stringtable.xml index be78cdc9957..22f7d77813b 100644 --- a/addons/viewports/stringtable.xml +++ b/addons/viewports/stringtable.xml @@ -12,6 +12,7 @@ <Spanish>Periscopios</Spanish> <German>Sichtfenster</German> <French>Périscopes</French> + <Portuguese>Periscópios</Portuguese> </Key> <Key ID="STR_ACE_Viewports_setting_enabled_description"> <English>Allows crew to look through periscopes</English> @@ -24,6 +25,7 @@ <Spanish>Permite a la tripulación asomarse a través de los periscopios</Spanish> <German>Ermöglicht der Besatzung den Blick durch Periskope</German> <French>Permet à l'équipage de regarder à travers des périscopes.</French> + <Portuguese>Permite que a tripulação olhe através de periscópios</Portuguese> </Key> </Package> </Project> diff --git a/addons/viewrestriction/stringtable.xml b/addons/viewrestriction/stringtable.xml index fee4a9bf336..7356e6412f5 100644 --- a/addons/viewrestriction/stringtable.xml +++ b/addons/viewrestriction/stringtable.xml @@ -15,6 +15,7 @@ <Russian>Ограничение обзора</Russian> <Turkish>Görüntüyü Kısıtla</Turkish> <Spanish>Reestricción de Vista</Spanish> + <Portuguese>Restrição do Modo de Visão</Portuguese> </Key> <Key ID="STR_ACE_ViewRestriction_ModuleDescription"> <English>View restriction settings to limit the usage of 1st or 3rd person views globally or per vehicle type.</English> @@ -29,6 +30,7 @@ <Russian>Настройки ограничения обзора при виде от 1-го или 3-го лица. Общие для всех, или Выборочные, в зависимости от техники.</Russian> <Turkish>1. veya 3. kişi görünümlerinin kullanımını genel olarak veya araç türüne göre sınırlamak için kısıtlama ayarlarını görüntüleyin.</Turkish> <Spanish>Opciones de Reestricción de Vista para limitar el uso de 1º o 3º persona globalmente o según el tipo de vehículo.</Spanish> + <Portuguese>A restrição do modo de visão limita o uso de 1ª ou 3ª pessoa globalmente ou por tipo de veículo.</Portuguese> </Key> <Key ID="STR_ACE_ViewRestriction_Mode"> <English>Mode</English> @@ -44,6 +46,7 @@ <Russian>Режим установок</Russian> <Turkish>Mod</Turkish> <Spanish>Modo</Spanish> + <Portuguese>Modo</Portuguese> </Key> <Key ID="STR_ACE_ViewRestriction_ModeDesc"> <English>Sets global mode. Default: Disabled</English> @@ -59,6 +62,7 @@ <Russian>Общие установки для всех. По умолчанию: Отключено.</Russian> <Turkish>Global modu ayarlar. Varsayılan: Devre Dışı</Turkish> <Spanish>Establece el modo global. Defecto: Deshabilitado</Spanish> + <Portuguese>Define o modo global. Padrão: Desabilitado</Portuguese> </Key> <Key ID="STR_ACE_ViewRestriction_ModeSelectiveFoot"> <English>(Selective) Foot</English> @@ -74,6 +78,7 @@ <Russian>(Выборочные) Пешком</Russian> <Turkish>(Seçilebilir) Ayakta</Turkish> <Spanish>(Selectivo) Pie</Spanish> + <Portuguese>(Seletivo) A pé</Portuguese> </Key> <Key ID="STR_ACE_ViewRestriction_ModeSelectiveFootDesc"> <English>Selective mode on Foot. Default: Disabled (Requires Mode: Selective)</English> @@ -89,6 +94,7 @@ <Russian>Выборочные установки без техники. По умолчанию: Отключено (требуется режим: Выборочные)</Russian> <Turkish>Ayakta iken seçilen görüş modu. Varsayılan: Etkin Değil</Turkish> <Spanish>Modo selectivo a pie. Defecto: Deshabilitado (Requiere Modo: Selectivo)</Spanish> + <Portuguese>Modo seletivo a pé. Padrão: Desabilitado (Modo necessário: Seletivo)</Portuguese> </Key> <Key ID="STR_ACE_ViewRestriction_ModeSelectiveLand"> <English>(Selective) Land Vehicles</English> @@ -104,6 +110,7 @@ <Russian>(Выборочные) Наземная техника</Russian> <Turkish>(Seçilebilir) Kara Araçları</Turkish> <Spanish>(Selectivo) Vehículos de tierra</Spanish> + <Portuguese>(Seletivo) Veículos terrestres</Portuguese> </Key> <Key ID="STR_ACE_ViewRestriction_ModeSelectiveLandDesc"> <English>Selective mode in Land Vehicles. Default: Disabled (Requires Mode: Selective)</English> @@ -119,6 +126,7 @@ <Russian>Выборочные установки для наземной техники. По умолчанию: Отключено (требуется режим: Выборочные)</Russian> <Turkish>Kara araçlarında iken seçilen görüş modu. Varsayılan: Etkin Değil</Turkish> <Spanish>Modo selectivo en vehículos de tierra.Defecto: Deshabilitado (Requiere Modo: Selectivo)</Spanish> + <Portuguese>Modo seletivo em veículos terrestres. Padrão: Desabilitado (Modo necessário: Seletivo)</Portuguese> </Key> <Key ID="STR_ACE_ViewRestriction_ModeSelectiveAir"> <English>(Selective) Air Vehicles</English> @@ -134,6 +142,7 @@ <Russian>(Выборочные) Авиатехника</Russian> <Turkish>(Seçilebilir) Hava Araçları</Turkish> <Spanish>(Selectivo) Vehículos aéreos</Spanish> + <Portuguese>(Seletivo) Aeronaves</Portuguese> </Key> <Key ID="STR_ACE_ViewRestriction_ModeSelectiveAirDesc"> <English>Selective mode in Air Vehicles. Default: Disabled (Requires Mode: Selective)</English> @@ -149,6 +158,7 @@ <Russian>Выборочные установки для авиатехники. По умолчанию: Отключено (требуется режим: Выборочные)</Russian> <Turkish>Hava araçlarında iken seçilen görüş modu. Varsayılan: Etkin Değil</Turkish> <Spanish>Modo selectivo en vehículos aéreos. Defecto: Deshabilitado (Requiere Modo: Selectivo)</Spanish> + <Portuguese>Modo seletivo em aeronaves. Padrão: Desabilitado (Modo necessário: Seletivo)</Portuguese> </Key> <Key ID="STR_ACE_ViewRestriction_ModeSelectiveSea"> <English>(Selective) Sea Vehicles</English> @@ -164,6 +174,7 @@ <Russian>(Выборочные) Водный транспорт</Russian> <Turkish>(Seçilebilir) Deniz Araçları</Turkish> <Spanish>(Selectivo) Vehículos marítimos</Spanish> + <Portuguese>(Seletivo) Veículos aquáticos</Portuguese> </Key> <Key ID="STR_ACE_ViewRestriction_ModeSelectiveSeaDesc"> <English>Selective mode in Sea Vehicles. Default: Disabled (Requires Mode: Selective)</English> @@ -179,6 +190,7 @@ <Russian>Выборочные установки для водного транспорта. По умолчанию: Отключено (требуется режим: Выборочные)</Russian> <Turkish>Deniz araçlarında iken seçilen görüş modu. Varsayılan: Etkin Değil</Turkish> <Spanish>Modo selectivo en vehículos marítimos. Defecto: Deshabilitado (Requiere Modo: Selectivo)</Spanish> + <Portuguese>Modo seletivo em veículos aquáticos. Padrão: Desabilitado (Modo necessário: Seletivo)</Portuguese> </Key> <Key ID="STR_ACE_ViewRestriction_ModeSelectiveUAV"> <English>(Selective) UAVs</English> @@ -194,6 +206,7 @@ <Russian>(Выборочные) Беспиплотники</Russian> <Turkish>(Seçilebilir) IHA'lar</Turkish> <Spanish>(Selectivo) VANTs</Spanish> + <Portuguese>(Seletivo) VANTs</Portuguese> </Key> <Key ID="STR_ACE_ViewRestriction_ModeSelectiveUAVDesc"> <English>Selective mode in UAVs. Default: Disabled (Requires Mode: Selective)</English> @@ -209,6 +222,7 @@ <Russian>Выборочные установки для беспилотников. По умолчанию: Отключено (требуется режим: Выборочные)</Russian> <Turkish>IHA araçlarında iken seçilen görüş modu. Varsayılan: Etkin Değil</Turkish> <Spanish>Modo selectivo en VANTs. Defecto: Deshabilitado (Requiere Modo: Selectivo)</Spanish> + <Portuguese>Modo seletivo em VANTs. Padrão: Desabilitado (Modo necessário: Seletivo)</Portuguese> </Key> <Key ID="STR_ACE_ViewRestriction_Disabled"> <English>Disabled</English> @@ -224,6 +238,7 @@ <Russian>Отключено</Russian> <Turkish>Devre Dışı</Turkish> <Spanish>Deshabilitado</Spanish> + <Portuguese>Desabilitado</Portuguese> </Key> <Key ID="STR_ACE_ViewRestriction_FirstPerson"> <English>Forced 1st Person</English> @@ -238,6 +253,7 @@ <Russian>От 1-го лица (принудительно)</Russian> <Turkish>1. Kişi Görüşüne Zorla</Turkish> <Spanish>Forzada 1º persona</Spanish> + <Portuguese>Forçada 1ª pessoa</Portuguese> </Key> <Key ID="STR_ACE_ViewRestriction_ThirdPerson"> <English>Forced 3rd Person</English> @@ -252,6 +268,7 @@ <Russian>От 3-го лица (принудительно)</Russian> <Turkish>3. Kişi Görüşüne Zorla</Turkish> <Spanish>Forzada 3º persona</Spanish> + <Portuguese>Forçada 3ª pessoa</Portuguese> </Key> <Key ID="STR_ACE_ViewRestriction_Selective"> <English>Selective</English> @@ -267,6 +284,7 @@ <Russian>Выборочный</Russian> <Turkish>Seçilebilinir</Turkish> <Spanish>Selectivo</Spanish> + <Portuguese>Seletivo</Portuguese> </Key> <Key ID="STR_ACE_ViewRestriction_SettingPreserveViewName"> <English>Preserve view for vehicle types</English> @@ -281,6 +299,7 @@ <Korean>차량 타입에 따른 시야 정보 저장</Korean> <Spanish>Preservar vista para los tipos de vehículos</Spanish> <French>Conserver la vue pour les types de véhicules</French> + <Portuguese>Mantém o modo de visão por tipo de veículo</Portuguese> </Key> <Key ID="STR_ACE_ViewRestriction_SettingPreserveViewDesc"> <English>Switch view on vehicle change to last used in this vehicle type (Requires Mode: Disabled)</English> @@ -295,6 +314,7 @@ <Korean>해당 차량 타입에서 마지막으로 사용했던 시야로 설정하여 봅니다 (모드 - 사용 안함 필요)</Korean> <Spanish>Cambiar vista en el cambio de vehículo hacia la última usada en ese tipo de vehículo (Requiere Modo: Deshabilitado)</Spanish> <French>Lors d'un changement de véhicule, change la vue pour la dernière utilisée dans ce type de véhicule (Mod requis : désactivé).</French> + <Portuguese>Ao trocar de veículo, troca o modo de visão para aquele usado anteriormente no mesmo tipo de veículo (Modo necessário: Desabilitado)</Portuguese> </Key> </Package> </Project> diff --git a/addons/volume/XEH_postInitClient.sqf b/addons/volume/XEH_postInitClient.sqf index 896bb718f8d..ae774f2f51d 100644 --- a/addons/volume/XEH_postInitClient.sqf +++ b/addons/volume/XEH_postInitClient.sqf @@ -23,10 +23,10 @@ if (!hasInterface) exitWith {}; if (!XGVAR(lowerInVehicles)) exitWith {}; - if (!isNull objectParent _unit) then { - call FUNC(lowerVolume); - } else { + if (isNull objectParent _unit) then { call FUNC(restoreVolume); + } else { + call FUNC(lowerVolume); }; }] call CBA_fnc_addPlayerEventHandler; diff --git a/addons/volume/stringtable.xml b/addons/volume/stringtable.xml index feecb28b104..08aae728a1b 100644 --- a/addons/volume/stringtable.xml +++ b/addons/volume/stringtable.xml @@ -14,6 +14,7 @@ <Polish>Głosność</Polish> <Turkish>Ses</Turkish> <Spanish>Volumen</Spanish> + <Portuguese>Volume</Portuguese> </Key> <Key ID="STR_ACE_Volume_KeybindName"> <English>Toggle Volume</English> @@ -28,6 +29,7 @@ <Polish>Przełącz Głosność</Polish> <Turkish>Sesi Aç/Kapat</Turkish> <Spanish>Activar control de volumen</Spanish> + <Portuguese>Alternar volume</Portuguese> </Key> <Key ID="STR_ACE_Volume_KeybindDescription"> <English>Toggle volume reduction.</English> @@ -42,6 +44,7 @@ <Polish>Przełącz redukcje głosności</Polish> <Turkish>Ses azaltmayı aç / kapat.</Turkish> <Spanish>Activar reducción de volumen.</Spanish> + <Portuguese>Alternar redução de volume</Portuguese> </Key> <Key ID="STR_ACE_Volume_Lowered"> <English>Lowered volume</English> @@ -56,6 +59,7 @@ <Polish>Zmniejszona głosność</Polish> <Turkish>Azaltılmış ses</Turkish> <Spanish>Volumen reducido</Spanish> + <Portuguese>Volume reduzido</Portuguese> </Key> <Key ID="STR_ACE_Volume_Restored"> <English>Restored volume</English> @@ -69,6 +73,7 @@ <Russian>Громкость восстановлена</Russian> <Polish>Przywrócona głosność</Polish> <Spanish>Volumen restaurado</Spanish> + <Portuguese>Volume restaurado</Portuguese> </Key> <Key ID="STR_ACE_Volume_Reduction"> <English>Reduction</English> @@ -82,6 +87,7 @@ <Russian>Уменьшение</Russian> <Polish>Redukcja</Polish> <Spanish>Reducción</Spanish> + <Portuguese>Redução</Portuguese> </Key> <Key ID="STR_ACE_Volume_ReductionDescription"> <English>Reduce volume by this percentage.</English> @@ -95,6 +101,7 @@ <Russian>Уменьшает громкость</Russian> <Polish>Zmniejsz głosność o tyle procent</Polish> <Spanish>Reducir el volumen este porcentaje.</Spanish> + <Portuguese>Reduzir o volume por esta porcentagem.</Portuguese> </Key> <Key ID="STR_ACE_Volume_LowerInVehicles"> <English>Lower in vehicles</English> @@ -109,6 +116,7 @@ <Polish>Zmniejsz w pojazdach</Polish> <Turkish>Araçlarda Daha Düşük</Turkish> <Spanish>Reducir en vehículos</Spanish> + <Portuguese>Reduzir em veículos</Portuguese> </Key> <Key ID="STR_ACE_Volume_LowerInVehiclesDescription"> <English>Automatically lower volume when inside vehicles.</English> @@ -123,6 +131,7 @@ <Polish>Automatycznie zmniejsz głosność będąc w pojeździe</Polish> <Turkish>Araçlara binince sesi azalt.</Turkish> <Spanish>Reduce automáticamente el volumen dentro de vehículos.</Spanish> + <Portuguese>Reduz automaticamente o volume dentro de veículos.</Portuguese> </Key> <Key ID="STR_ACE_Volume_ShowNotification"> <English>Show notification</English> @@ -137,6 +146,7 @@ <Polish>Pokaż powiadomienie</Polish> <Turkish>Bildirim Göster</Turkish> <Spanish>Mostrar notificación</Spanish> + <Portuguese>Mostrar notificação</Portuguese> </Key> <Key ID="STR_ACE_Volume_ShowNotificationDescription"> <English>Show notification when lowering/restoring volume.</English> @@ -151,6 +161,7 @@ <Polish>Pokaż powiadomienie zmniejszając/odnawiając głosność</Polish> <Turkish>Ses azaltıldığın da bildirim göster.</Turkish> <Spanish>Mostrar notificación cuando se disminuye/restaura el volumen.</Spanish> + <Portuguese>Mostrar notificação quando o volume for reduzido/restaurado</Portuguese> </Key> <Key ID="STR_ACE_Volume_FadeDelay"> <English>Fade delay</English> @@ -164,6 +175,7 @@ <Russian>Задержка затухания</Russian> <Polish>Opoznienie wyciszenia</Polish> <Spanish>Retardo en disminución gradual</Spanish> + <Portuguese>Atraso de alteração gradual de volume</Portuguese> </Key> <Key ID="STR_ACE_Volume_FadeDelayDescription"> <English>Time it takes (in seconds) for the sound to fade in/out.</English> @@ -177,6 +189,7 @@ <Russian>Время (сек.) для затухания/восстановления звука.</Russian> <Polish>Ilość czasu (w sekundach) ile zajmuje wyciszenie/zgłośnienie dźwięku</Polish> <Spanish>Tiempo que tarda (en segundos) para que se active o desactive la disminuación gradual del volumen</Spanish> + <Portuguese>Tempo de atraso (em segundos) para que o volume do som sofra alteração gradual</Portuguese> </Key> <Key ID="STR_ACE_Volume_RemindIfLowered"> <English>Reminder if lowered</English> @@ -191,6 +204,7 @@ <Polish>Przypomnij o zmniejszonej głosności dźwięku</Polish> <Turkish>Eğer Düşükse Hatırlat</Turkish> <Spanish>Recordatorio s reducido</Spanish> + <Portuguese>Lembrete de redução sonora</Portuguese> </Key> <Key ID="STR_ACE_Volume_RemindIfLoweredDescription"> <English>Reminds you every minute if your volume is lowered.</English> @@ -205,6 +219,7 @@ <Polish>Przypomina co minuten o zmniejszonej głosności dźwięku</Polish> <Turkish>Eğer ses düşükse her dakika hatırlatır.</Turkish> <Spanish>Te recuerda cada minuto si el volumen está siendo reducido.</Spanish> + <Portuguese>Te notifica a cada minuto se o volume sonoro estiver reduzido.</Portuguese> </Key> <Key ID="STR_ACE_Volume_LoweredReminder"> <English>Volume still lowered</English> @@ -219,6 +234,7 @@ <Polish>Dźwięk jest nadal zmniejszony</Polish> <Turkish>Ses hala düşük</Turkish> <Spanish>Volumen todavía reducido</Spanish> + <Portuguese>Volume ainda está reduzido</Portuguese> </Key> </Package> </Project> diff --git a/addons/weaponselect/functions/fnc_playChangeFiremodeSound.sqf b/addons/weaponselect/functions/fnc_playChangeFiremodeSound.sqf index fc55b54b5f4..641787a394e 100644 --- a/addons/weaponselect/functions/fnc_playChangeFiremodeSound.sqf +++ b/addons/weaponselect/functions/fnc_playChangeFiremodeSound.sqf @@ -35,3 +35,5 @@ if !(toLowerANSI (_filename select [count _filename - 4]) in [".wav", ".ogg", ". }; playSound3D [_filename, objNull, false, _position, _volume, _soundPitch, _distance]; + +nil // return diff --git a/addons/weaponselect/functions/fnc_selectWeaponMode.sqf b/addons/weaponselect/functions/fnc_selectWeaponMode.sqf index f2810bb512c..3a63e1097fa 100644 --- a/addons/weaponselect/functions/fnc_selectWeaponMode.sqf +++ b/addons/weaponselect/functions/fnc_selectWeaponMode.sqf @@ -18,35 +18,23 @@ params ["_unit", "_weapon"]; -if (_weapon == "") exitWith {}; +if (_weapon == "" || {!(_unit hasWeapon _weapon)}) exitWith {}; + +private _currentWeaponMode = (_unit weaponState _weapon) select 2; +private _muzzle = (_weapon call EFUNC(common,getWeaponMuzzles)) select 0; if (currentWeapon _unit != _weapon) exitWith { - _unit selectWeapon _weapon; + _unit selectWeapon [_weapon, _muzzle, _currentWeaponMode]; }; -// unlock safety -if (_weapon in (_unit getVariable [QEGVAR(safemode,safedWeapons), []])) exitWith { - [_unit, _weapon, _weapon] call EFUNC(safemode,unlockSafety); +// Unlock safety +if ((["ace_safemode"] call EFUNC(common,isModLoaded)) && {[_unit, _weapon] call EFUNC(safemode,getWeaponSafety)}) exitWith { + [_unit, _weapon, false] call EFUNC(safemode,setWeaponSafety); }; -private _muzzles = [_weapon] call EFUNC(common,getWeaponMuzzles); -private _modes = [_weapon] call EFUNC(common,getWeaponModes); - -private _index = (_modes find currentWeaponMode _unit) + 1; - -if (_index > count _modes - 1) then {_index = 0}; +private _modes = _weapon call EFUNC(common,getWeaponModes); -private _muzzle = _muzzles select 0; -private _mode = _modes select _index; - -_index = 0; - -while { - _index < 299 && {currentMuzzle _unit != _muzzle || {currentWeaponMode _unit != _mode}} -} do { - _unit action ["SwitchWeapon", _unit, _unit, _index]; - _index = _index + 1; -}; +_unit selectWeapon [_weapon, _muzzle, _modes select (((_modes find _currentWeaponMode) + 1) % (count _modes))]; -// play fire mode selector sound +// Play fire mode selector sound [_unit, _weapon] call FUNC(playChangeFiremodeSound); diff --git a/addons/weaponselect/functions/fnc_selectWeaponMuzzle.sqf b/addons/weaponselect/functions/fnc_selectWeaponMuzzle.sqf index 9a27a515add..38822535734 100644 --- a/addons/weaponselect/functions/fnc_selectWeaponMuzzle.sqf +++ b/addons/weaponselect/functions/fnc_selectWeaponMuzzle.sqf @@ -18,32 +18,22 @@ params ["_unit", "_weapon"]; -if (_weapon == "") exitWith {}; +if (_weapon == "" || {!(_unit hasWeapon _weapon)}) exitWith {}; private _muzzles = _weapon call EFUNC(common,getWeaponMuzzles); -if (currentWeapon _unit != _weapon) exitWith { - if (count _muzzles > 1) then { +if (count _muzzles <= 1) exitWith {}; - // unlock safety - /*if (_weapon in (_unit getVariable [QEGVAR(safemode,safedWeapons), []])) exitWith { - [_unit, _weapon, _muzzles select 1] call EFUNC(safemode,unlockSafety); - };*/ +private _muzzle = (_unit weaponState _weapon) select 1; - _unit selectWeapon (_muzzles select 1); - }; +private _index = if (currentWeapon _unit == _weapon) then { + (((_muzzles find currentMuzzle _unit) + 1) % (count _muzzles)) max 1 +} else { + 1 }; -private _index = (_muzzles find currentMuzzle _unit) + 1; - -if (_index > count _muzzles - 1) then {_index = 1}; - private _muzzle = _muzzles select _index; -_index = 0; -while { - _index < 299 && {currentMuzzle _unit != _muzzle} -} do { - _unit action ["SwitchWeapon", _unit, _unit, _index]; - _index = _index + 1; -}; +_unit selectWeapon [_weapon, _muzzle, ([_weapon, _muzzle] call EFUNC(common,getWeaponModes)) select 0]; + +nil // return diff --git a/addons/weather/functions/fnc_updateTemperature.sqf b/addons/weather/functions/fnc_updateTemperature.sqf index 3036171145d..34338f9d79e 100644 --- a/addons/weather/functions/fnc_updateTemperature.sqf +++ b/addons/weather/functions/fnc_updateTemperature.sqf @@ -16,7 +16,7 @@ */ private _month = date select 1; -private _timeRatio = abs(daytime - 12) / 12; +private _timeRatio = abs(dayTime - 12) / 12; GVAR(currentTemperature) = (GVAR(TempDay) select (_month - 1)) * (1 - _timeRatio) + (GVAR(TempNight) select (_month - 1)) * _timeRatio; GVAR(currentTemperature) = GVAR(currentTemperature) + GVAR(temperatureShift) - GVAR(badWeatherShift) * GVAR(currentOvercast); diff --git a/addons/winddeflection/functions/fnc_updateTrajectoryPFH.sqf b/addons/winddeflection/functions/fnc_updateTrajectoryPFH.sqf index 4ebea1f507c..6f54dfbba10 100644 --- a/addons/winddeflection/functions/fnc_updateTrajectoryPFH.sqf +++ b/addons/winddeflection/functions/fnc_updateTrajectoryPFH.sqf @@ -25,7 +25,6 @@ _args set [0, CBA_missionTime]; private _isWind = (vectorMagnitude wind > 0); - private _deleted = false; { _x params ["_bullet", "_airFriction"]; @@ -33,8 +32,7 @@ private _bulletSpeedSqr = vectorMagnitudeSqr _bulletVelocity; if ((!alive _bullet) || {(_bullet isKindOf "BulletBase") && {_bulletSpeedSqr < 10000}}) then { - GVAR(trackedBullets) set [_forEachIndex, objNull]; - _deleted = true; + GVAR(trackedBullets) deleteAt _forEachIndex; } else { if (_isWind) then { private _trueVelocity = _bulletVelocity vectorDiff wind; @@ -50,11 +48,7 @@ }; _bullet setVelocity _bulletVelocity; }; - } forEach GVAR(trackedBullets); - - if (_deleted) then { - GVAR(trackedBullets) = GVAR(trackedBullets) - [objNull]; - }; + } forEachReversed GVAR(trackedBullets); // END_COUNTER(pfeh); }, GVAR(simulationInterval), [CBA_missionTime]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/xm157/functions/fnc_ballistics_calculator.sqf b/addons/xm157/functions/fnc_ballistics_calculator.sqf index a39b09a7059..46b09170e3b 100644 --- a/addons/xm157/functions/fnc_ballistics_calculator.sqf +++ b/addons/xm157/functions/fnc_ballistics_calculator.sqf @@ -41,14 +41,14 @@ private _barometricPressure = _altitude call EFUNC(weather,calculateBarometricPr private _bulletPos = [0,0,-(_boreHeight / 100)]; private _lastBulletPos = +_bulletPos; -private _bulletVelocity = [0,Cos(_scopeBaseAngle) * _muzzleVelocity,Sin(_scopeBaseAngle) * _muzzleVelocity]; +private _bulletVelocity = [0,cos(_scopeBaseAngle) * _muzzleVelocity,sin(_scopeBaseAngle) * _muzzleVelocity]; private _gravity = [-sin (_bank) * cos(_scopeBaseAngle + _inclinationAngle) * -GRAVITY, sin(_scopeBaseAngle + _inclinationAngle) * -GRAVITY, cos (_bank) * cos(_scopeBaseAngle + _inclinationAngle) * -GRAVITY]; private _useAB = missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]; if (_useAB) then { - _bc = parseNumber(("ace_advanced_ballistics" callExtension format["atmosphericCorrection:%1:%2:%3:%4:%5", _bc, _temperature, _barometricPressure, _relativeHumidity, _atmosphereModel])); + _bc = parseNumber (("ace" callExtension ["ballistics:atmospheric_correction", [_bc, _temperature, _barometricPressure, _relativeHumidity, _atmosphereModel]]) select 0); }; private _deltaT = 1 / 60; @@ -58,7 +58,7 @@ while {(_TOF < 5) && {(_bulletPos # 1) < _targetRange}} do { private _trueSpeed = vectorMagnitude _trueVelocity; private _bulletAccel = if (_useAB) then { - private _drag = parseNumber(("ace_advanced_ballistics" callExtension format["retard:%1:%2:%3:%4", _dragModel, _bc, _trueSpeed, _temperature])); + private _drag = parseNumber (("ace" callExtension ["ballistics:retard", [_dragModel, _bc, _trueSpeed, _temperature]]) select 0); (vectorNormalized _trueVelocity) vectorMultiply (-1 * _drag); } else { _trueVelocity vectorMultiply (_trueSpeed * _airFriction); diff --git a/addons/xm157/functions/fnc_ballistics_getData.sqf b/addons/xm157/functions/fnc_ballistics_getData.sqf index 828db8e4ae2..f366216e49a 100644 --- a/addons/xm157/functions/fnc_ballistics_getData.sqf +++ b/addons/xm157/functions/fnc_ballistics_getData.sqf @@ -56,8 +56,7 @@ if ((_weaponInfo isEqualTo []) && {_magazineClass != ""}) then { }; // Scope Base Angle - private _zeroAngle = "ace_advanced_ballistics" callExtension format ["calcZero:%1:%2:%3:%4", _zeroRange, _muzzleVelocity, _airFriction, _boreHeight]; - private _scopeBaseAngle = parseNumber _zeroAngle; + private _scopeBaseAngle = parseNumber (("ace" callExtension ["ballistics:zero_vanilla", [_zeroRange, _muzzleVelocity, _airFriction, _boreHeight]]) select 0); _weaponInfo = [_scopeBaseAngle,_boreHeight,_airFriction,_muzzleVelocity,_bc,_dragModel,_atmosphereModel,_barrelTwist,_twistDirection,_caliber,_bulletLength,_bulletMass]; GVAR(data) set [_key, _weaponInfo]; diff --git a/addons/xm157/functions/fnc_keyPress.sqf b/addons/xm157/functions/fnc_keyPress.sqf index 3a9dd53a269..684fdedefd2 100644 --- a/addons/xm157/functions/fnc_keyPress.sqf +++ b/addons/xm157/functions/fnc_keyPress.sqf @@ -23,7 +23,7 @@ if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) if !(ACE_player call CBA_fnc_canUseWeapon) exitWith { false }; if (currentMuzzle ACE_player != currentWeapon ACE_player) exitWith { false }; -private _display = uinamespace getVariable [QGVAR(display), displayNull]; +private _display = uiNamespace getVariable [QGVAR(display), displayNull]; if (isNull _display) exitWith { ERROR("keyPress-no display"); false }; if (_keyDown) then { playSound QGVAR(click); }; diff --git a/addons/xm157/functions/fnc_weaponInfo_onLoad.sqf b/addons/xm157/functions/fnc_weaponInfo_onLoad.sqf index dfefca30d43..e490c6e14d0 100644 --- a/addons/xm157/functions/fnc_weaponInfo_onLoad.sqf +++ b/addons/xm157/functions/fnc_weaponInfo_onLoad.sqf @@ -18,7 +18,7 @@ params ["_display"]; TRACE_1("weaponInfo_onLoad",_display); -uinamespace setVariable [QGVAR(display), _display]; +uiNamespace setVariable [QGVAR(display), _display]; [_display, true] call cba_optics_fnc_loadScriptedOptic; // pass thru to cba diff --git a/addons/yardage450/functions/fnc_acquireTarget.sqf b/addons/yardage450/functions/fnc_acquireTarget.sqf index d5aea3a800f..88f85f29cc3 100644 --- a/addons/yardage450/functions/fnc_acquireTarget.sqf +++ b/addons/yardage450/functions/fnc_acquireTarget.sqf @@ -45,7 +45,7 @@ GVAR(distanceIndex) = -1; private _range = (_min + _max) / 2; if (_range >= MIN_DISTANCE && _range <= MAX_DISTANCE) then { GVAR(targetAcquired) = true; - GVAR(targetRangeText) = Str(round(_range)); + GVAR(targetRangeText) = str(round(_range)); }; }; }; diff --git a/addons/zeus/functions/fnc_bi_moduleArsenal.sqf b/addons/zeus/functions/fnc_bi_moduleArsenal.sqf index 8dd5f269296..76f723b2dd3 100644 --- a/addons/zeus/functions/fnc_bi_moduleArsenal.sqf +++ b/addons/zeus/functions/fnc_bi_moduleArsenal.sqf @@ -21,15 +21,15 @@ params ["_logic", "", "_activated"]; if (_activated && local _logic) then { - _unit = _logic getvariable ["bis_fnc_curatorAttachObject_object",objnull]; + _unit = _logic getVariable ["bis_fnc_curatorAttachObject_object",objNull]; //--- Check if the unit is suitable _error = ""; switch true do { - case (isnull _unit): {_error = localize "str_a3_BIS_fnc_showCuratorFeedbackMessage_506";}; + case (isNull _unit): {_error = localize "str_a3_BIS_fnc_showCuratorFeedbackMessage_506";}; case !(alive _unit): {_error = localize "str_a3_BIS_fnc_moduleArsenal_errorDead";}; - case (isnull group _unit || !(side group _unit in [east,west,resistance,civilian])): {_error = localize "str_a3_BIS_fnc_moduleArsenal_errorBrain";}; - case (!isNull objectParent _unit || effectivecommander _unit != _unit): {_error = localize "str_a3_BIS_fnc_moduleArsenal_errorVehicle";}; + case (isNull group _unit || !(side group _unit in [east,west,resistance,civilian])): {_error = localize "str_a3_BIS_fnc_moduleArsenal_errorBrain";}; + case (!isNull objectParent _unit || effectiveCommander _unit != _unit): {_error = localize "str_a3_BIS_fnc_moduleArsenal_errorVehicle";}; }; if (_error == "") then { @@ -51,10 +51,10 @@ if (_activated && local _logic) then { } else { if !(isPlayer _unit) then { - ([] call bis_fnc_rscLayer) cuttext ["","black out",0.5]; + ([] call bis_fnc_rscLayer) cutText ["","black out",0.5]; ["#(argb,8,8,3)color(0,0,0,1)",false,nil,0,[0.5,0]] call bis_fnc_textTiles; ["Open",[true,nil,_unit]] call bis_fnc_arsenal; - ([] call bis_fnc_rscLayer) cuttext ["","plain"]; + ([] call bis_fnc_rscLayer) cutText ["","plain"]; } else { [objNull, localize "str_a3_BIS_fnc_moduleArsenal_errorDead"] call bis_fnc_showCuratorFeedbackMessage; diff --git a/addons/zeus/functions/fnc_bi_moduleCurator.sqf b/addons/zeus/functions/fnc_bi_moduleCurator.sqf index cdc4d35b648..a10807dbe70 100644 --- a/addons/zeus/functions/fnc_bi_moduleCurator.sqf +++ b/addons/zeus/functions/fnc_bi_moduleCurator.sqf @@ -24,33 +24,33 @@ params ["_logic", "_units", "_activated"]; if (_activated) then { // Terminate when not created on the server - if (!isServer && local _logic && isnull (getassignedcuratorunit _logic)) exitwith { - [format ["%1 is trying to create curator logic ModuleCurator_F",profilename],"bis_fnc_error",false] call bis_fnc_mp; - deletevehicle _logic; + if (!isServer && local _logic && isNull (getAssignedCuratorUnit _logic)) exitWith { + [format ["%1 is trying to create curator logic ModuleCurator_F",profileName],"bis_fnc_error",false] call bis_fnc_mp; + deleteVehicle _logic; }; // Get curator owner - _ownerVar = _logic getvariable ["owner",""]; - _ownerUID = parsenumber _ownerVar; - if (cheatsenabled) then { - _ownerVarArray = toarray _ownerVar; + _ownerVar = _logic getVariable ["owner",""]; + _ownerUID = parseNumber _ownerVar; + if (cheatsEnabled) then { + _ownerVarArray = toArray _ownerVar; _ownerVarArray resize 3; - if (tostring _ownerVarArray == "DEV") then {_ownerUID = 1;}; + if (toString _ownerVarArray == "DEV") then {_ownerUID = 1;}; }; - if (_ownerVar == "" && !ismultiplayer) then { + if (_ownerVar == "" && !isMultiplayer) then { ["Curator owner not defined, player used instead in singleplayer."] call bis_fnc_error; _ownerVar = player call bis_fnc_objectvar; }; - if (_ownerUID > 0 && !ismultiplayer) then { + if (_ownerUID > 0 && !isMultiplayer) then { _ownerVar = player call bis_fnc_objectvar; }; _isAdmin = _ownerVar == "#adminLogged" || _ownerVar == "#adminVoted"; // Wipe out the variable so clients can't access it - _logic setvariable ["owner",nil]; + _logic setVariable ["owner",nil]; // Server - if (isserver) then { + if (isServer) then { // Prepare admin variable _adminVar = ""; @@ -58,25 +58,25 @@ if (_activated) then { _letters = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]; _adminVar = "admin_"; for "_i" from 0 to 9 do {_adminVar = _adminVar + selectRandom _letters}; - _logic setvariable ["adminVar",_adminVar,true]; + _logic setVariable ["adminVar",_adminVar,true]; }; // Get allowed addons - _addonsType = _logic getvariable ["Addons",2]; + _addonsType = _logic getVariable ["Addons",2]; _addons = []; switch _addonsType do { // All (including unofficial ones) case 3: { - _cfgPatches = configfile >> "cfgpatches"; + _cfgPatches = configFile >> "cfgpatches"; for "_i" from 0 to (count _cfgPatches - 1) do { _class = _cfgPatches select _i; - if (isclass _class) then {_addons set [count _addons,configname _class];}; + if (isClass _class) then {_addons set [count _addons,configName _class];}; }; // Modified by ace_zeus - bis_fnc_activateaddons will error if time > 0 so only call if at start if (time <= 0) then { _addons call bis_fnc_activateaddons; }; - removeallcuratoraddons _logic; - _logic addcuratoraddons _addons; + removeAllCuratorAddons _logic; + _logic addCuratorAddons _addons; }; // All active @@ -86,74 +86,74 @@ if (_activated) then { case 1: { _addonsList = []; { - _addonsList = _addonsList + (unitaddons typeof _x); - } foreach (entities "all"); - removeallcuratoraddons _logic; - _logic addcuratoraddons _addonsList; + _addonsList = _addonsList + (unitAddons typeOf _x); + } forEach (entities "all"); + removeAllCuratorAddons _logic; + _logic addCuratorAddons _addonsList; }; // None case 0: { - removeallcuratoraddons _logic; + removeAllCuratorAddons _logic; }; }; // Handle ownership [_logic,_ownerVar,_ownerUID,_adminVar] spawn { - scriptname "BIS_fnc_moduleCurator: Owner"; + scriptName "BIS_fnc_moduleCurator: Owner"; params ["_logic", "_ownerVar", "_ownerUID", "_adminVar"]; if (_adminVar != "") then {_ownerVar = _adminVar;}; - _forced = _logic getvariable ["forced",0] > 0; - _name = _logic getvariable ["name",""]; + _forced = _logic getVariable ["forced",0] > 0; + _name = _logic getVariable ["name",""]; if (_name == "") then {_name = localize "STR_A3_curator";}; // Wait until mission starts waitUntil {time > 0}; // NOTE: DO NOT CHANGE TO CBA_missionTime, IT BREAKS THE MODULE // Refresh addon list, so it's broadcasted to clients - _addons = curatoraddons _logic; + _addons = curatorAddons _logic; removeAllCuratorAddons _logic; - _logic addcuratoraddons _addons; + _logic addCuratorAddons _addons; while {true} do { // Wait for player to become Zeus switch true do { case (_ownerUID > 0): { - waituntil { + waitUntil { sleep 0.01; - {getplayeruid _x == _ownerVar} count playableunits > 0 || isnull _logic + {getPlayerUID _x == _ownerVar} count playableUnits > 0 || isNull _logic }; }; default { - waituntil {isplayer (missionnamespace getvariable [_ownerVar,objnull]) || isnull _logic}; + waitUntil {isPlayer (missionNamespace getVariable [_ownerVar,objNull]) || isNull _logic}; }; }; - if (isnull _logic) exitwith {}; + if (isNull _logic) exitWith {}; // Assign - _player = objnull; + _player = objNull; switch true do { case (_ownerUID > 0): { { - if (getplayeruid _x == _ownerVar) exitwith {_player = _x;}; - } foreach playableunits; + if (getPlayerUID _x == _ownerVar) exitWith {_player = _x;}; + } forEach playableUnits; }; default { - _player = missionnamespace getvariable [_ownerVar,objnull]; + _player = missionNamespace getVariable [_ownerVar,objNull]; }; }; - waituntil {unassigncurator _logic; isnull (getassignedcuratorunit _logic) || isnull _logic}; - waituntil {_player assignCurator _logic; getassignedcuratorunit _logic == _player || isnull _logic}; - if (isnull _logic) exitwith {}; + waitUntil {unassignCurator _logic; isNull (getAssignedCuratorUnit _logic) || isNull _logic}; + waitUntil {_player assignCurator _logic; getAssignedCuratorUnit _logic == _player || isNull _logic}; + if (isNull _logic) exitWith {}; // Add radio channels { - _x radiochanneladd [_player]; - } foreach (_logic getvariable ["channels",[]]); + _x radioChannelAdd [_player]; + } forEach (_logic getVariable ["channels",[]]); // Added by ace_zeus to delay ascension message code private _msgCode = { @@ -162,10 +162,10 @@ if (_activated) then { // Sent notification to all assigned players if ((_logic getVariable ["showNotification",true]) && GVAR(zeusAscension)) then { { - if (isplayer _x) then { + if (isPlayer _x) then { [["CuratorAssign",[_name,name _player]],"bis_fnc_showNotification",_x] call bis_fnc_mp; }; - } forEach (curatoreditableobjects _logic); + } forEach (curatorEditableObjects _logic); }; }; @@ -184,25 +184,25 @@ if (_activated) then { // Wait for player to stop being Zeus switch true do { case (_ownerUID > 0): { - waituntil { + waitUntil { sleep 0.01; - {getplayeruid _x == _ownerVar} count playableunits == 0 || isnull _logic + {getPlayerUID _x == _ownerVar} count playableUnits == 0 || isNull _logic }; }; default { - waituntil {_player != missionnamespace getvariable [_ownerVar,objnull] || isnull _logic}; + waitUntil {_player != missionNamespace getVariable [_ownerVar,objNull] || isNull _logic}; }; }; - if (isnull _logic) exitwith {}; + if (isNull _logic) exitWith {}; // Add radio channels { - _x radiochannelremove [_player]; - } foreach (_logic getvariable ["channels",[]]); + _x radioChannelRemove [_player]; + } forEach (_logic getVariable ["channels",[]]); // Unassign - waituntil {unassigncurator _logic; isnull (getassignedcuratorunit _logic) || isnull _logic}; - if (isnull _logic) exitwith {}; + waitUntil {unassignCurator _logic; isNull (getAssignedCuratorUnit _logic) || isNull _logic}; + if (isNull _logic) exitWith {}; }; }; @@ -214,17 +214,17 @@ if (_activated) then { // Create bird _birdType = _logic getVariable ["birdType","eagle_f"]; if (_birdType != "") then { - _bird = createvehicle [_birdType,[100,100,100],[],0,"none"]; + _bird = createVehicle [_birdType,[100,100,100],[],0,"none"]; _logic setVariable ["bird",_bird,true]; }; // Locality changed - _logic addeventhandler [ - "local", + _logic addEventHandler [ + "Local", { _logic = _this select 0; - _bird = _logic getVariable ["bird",objnull]; - _bird setowner owner _logic; + _bird = _logic getVariable ["bird",objNull]; + _bird setOwner owner _logic; } ]; }; @@ -240,70 +240,70 @@ if (_activated) then { // Activated all future addons _addons = []; { - if (typeof _x == "ModuleCuratorAddAddons_F") then { - _paramAddons = call compile ("[" + (_x getvariable ["addons",""]) + "]"); + if (typeOf _x == "ModuleCuratorAddAddons_F") then { + _paramAddons = call compile ("[" + (_x getVariable ["addons",""]) + "]"); { if !(_x in _addons) then {_addons set [count _addons,_x];}; { if !(_x in _addons) then {_addons set [count _addons,_x];}; - } foreach (unitaddons _x); - } foreach _paramAddons; + } forEach (unitAddons _x); + } forEach _paramAddons; }; - } foreach (synchronizedobjects _logic); + } forEach (synchronizedObjects _logic); // Modified by ace_zeus - bis_fnc_activateaddons will error if time > 0 so only call if at start if (time <= 0) then { _addons call bis_fnc_activateaddons; }; }; // Player - if (hasinterface) then { - waituntil {local player}; + if (hasInterface) then { + waitUntil {local player}; _serverCommand = ["#kick", "#shutdown"] select (_ownerVar == "#adminLogged"); // Black effect until the interface is open - _forced = _logic getvariable ["forced",0] > 0; + _forced = _logic getVariable ["forced",0] > 0; if (_forced) then { _isCurator = switch true do { case (_ownerUID > 0): { - getplayeruid player == _ownerVar + getPlayerUID player == _ownerVar }; case (_isAdmin): { - isserver || servercommandavailable _serverCommand + isServer || serverCommandAvailable _serverCommand }; default { - player == missionnamespace getvariable [_ownerVar,objnull] + player == missionNamespace getVariable [_ownerVar,objNull] }; }; if (_isCurator) then { [true,true] spawn bis_fnc_forceCuratorInterface; - ("RscDisplayCurator" call bis_fnc_rscLayer) cuttext ["","black in",1e10]; + ("RscDisplayCurator" call bis_fnc_rscLayer) cutText ["","black in",1e10]; }; }; // Check if player is server admin if (_isAdmin) then { - _adminVar = _logic getvariable ["adminVar",""]; - _logic setvariable ["adminVar",nil]; - if (isserver) then { + _adminVar = _logic getVariable ["adminVar",""]; + _logic setVariable ["adminVar",nil]; + if (isServer) then { // Host - missionnamespace setvariable [_adminVar,player]; + missionNamespace setVariable [_adminVar,player]; } else { // Client [_logic,_adminVar,_serverCommand] spawn { - scriptname "BIS_fnc_moduleCurator: Admin check"; + scriptName "BIS_fnc_moduleCurator: Admin check"; _logic = _this select 0; _adminVar = _this select 1; _serverCommand = _this select 2; while {true} do { - waituntil {sleep 0.1; servercommandavailable _serverCommand}; - missionnamespace setvariable [_adminVar,player]; - publicvariable _adminVar; - _respawn = player addeventhandler ["respawn",format ["%1 = _this select 0; publicvariable '%1';",_adminVar]]; - - waituntil {sleep 0.1; !servercommandavailable _serverCommand}; - missionnamespace setvariable [_adminVar,objnull]; - publicvariable _adminVar; - player removeeventhandler ["respawn",_respawn]; + waitUntil {sleep 0.1; serverCommandAvailable _serverCommand}; + missionNamespace setVariable [_adminVar,player]; + publicVariable _adminVar; + _respawn = player addEventHandler ["Respawn",format ["%1 = _this select 0; publicvariable '%1';",_adminVar]]; + + waitUntil {sleep 0.1; !serverCommandAvailable _serverCommand}; + missionNamespace setVariable [_adminVar,objNull]; + publicVariable _adminVar; + player removeEventHandler ["Respawn",_respawn]; }; }; }; @@ -312,10 +312,10 @@ if (_activated) then { [_logic] spawn { _logic = _this select 0; sleep 1; - waituntil {alive player}; + waitUntil {alive player}; // Show warning when Zeus key is not assigned - if (count (actionkeys "curatorInterface") == 0) then { + if (count (actionKeys "curatorInterface") == 0) then { [ format [ localize "str_a3_cfgvehicles_modulecurator_f_keyNotAssigned", @@ -326,13 +326,13 @@ if (_activated) then { // Show hint about pinging for players if ( - isnil {profilenamespace getvariable "bis_fnc_curatorPinged_done"} + isNil {profileNamespace getVariable "bis_fnc_curatorPinged_done"} && {isTutHintsEnabled} && - {isnull getassignedcuratorlogic player} + {isNull getAssignedCuratorLogic player} && - {player in curatoreditableobjects _logic} + {player in curatorEditableObjects _logic} ) then { sleep 0.5; [["Curator","Ping"]] call bis_fnc_advHint; @@ -340,16 +340,16 @@ if (_activated) then { }; // Add local event handlers - _logic addeventhandler ["curatorFeedbackMessage",{_this call bis_fnc_showCuratorFeedbackMessage;}]; - _logic addeventhandler ["curatorPinged",{_this call bis_fnc_curatorPinged;}]; - _logic addeventhandler ["curatorObjectPlaced",{_this call bis_fnc_curatorObjectPlaced;}]; - _logic addeventhandler ["curatorObjectEdited",{_this call bis_fnc_curatorObjectEdited;}]; - _logic addeventhandler ["curatorWaypointPlaced",{_this call bis_fnc_curatorWaypointPlaced;}]; - - _logic addeventhandler ["curatorObjectDoubleClicked",{(_this select 1) call bis_fnc_showCuratorAttributes;}]; - _logic addeventhandler ["curatorGroupDoubleClicked",{(_this select 1) call bis_fnc_showCuratorAttributes;}]; - _logic addeventhandler ["curatorWaypointDoubleClicked",{(_this select 1) call bis_fnc_showCuratorAttributes;}]; - _logic addeventhandler ["curatorMarkerDoubleClicked",{(_this select 1) call bis_fnc_showCuratorAttributes;}]; + _logic addEventHandler ["CuratorFeedbackMessage",{_this call bis_fnc_showCuratorFeedbackMessage;}]; + _logic addEventHandler ["CuratorPinged",{_this call bis_fnc_curatorPinged;}]; + _logic addEventHandler ["CuratorObjectPlaced",{_this call bis_fnc_curatorObjectPlaced;}]; + _logic addEventHandler ["CuratorObjectEdited",{_this call bis_fnc_curatorObjectEdited;}]; + _logic addEventHandler ["CuratorWaypointPlaced",{_this call bis_fnc_curatorWaypointPlaced;}]; + + _logic addEventHandler ["CuratorObjectDoubleClicked",{(_this select 1) call bis_fnc_showCuratorAttributes;}]; + _logic addEventHandler ["CuratorGroupDoubleClicked",{(_this select 1) call bis_fnc_showCuratorAttributes;}]; + _logic addEventHandler ["CuratorWaypointDoubleClicked",{(_this select 1) call bis_fnc_showCuratorAttributes;}]; + _logic addEventHandler ["CuratorMarkerDoubleClicked",{(_this select 1) call bis_fnc_showCuratorAttributes;}]; player call bis_fnc_curatorRespawn; }; diff --git a/addons/zeus/functions/fnc_bi_moduleMine.sqf b/addons/zeus/functions/fnc_bi_moduleMine.sqf index 0bd8ba574ff..509efa0a1c5 100644 --- a/addons/zeus/functions/fnc_bi_moduleMine.sqf +++ b/addons/zeus/functions/fnc_bi_moduleMine.sqf @@ -21,18 +21,18 @@ params ["_logic", "_units", "_activated"]; if (_activated) then { - _explosive = gettext (configOf _logic >> "explosive"); + _explosive = getText (configOf _logic >> "explosive"); if (_explosive != "") then { - _explosive = createvehicle [_explosive,position _logic,[],0,"none"]; - _explosive attachto [_logic]; + _explosive = createVehicle [_explosive,position _logic,[],0,"none"]; + _explosive attachTo [_logic]; // Added by ace_zeus to control if mines are revealed if (GVAR(revealMines) > MINE_REVEAL_NONE) then { //--- Reveal the mine to curator's side { - _side = (getassignedcuratorunit _x) call bis_fnc_objectSide; - _side revealmine _explosive; - } forEach (objectcurators _logic); + _side = (getAssignedCuratorUnit _x) call bis_fnc_objectSide; + _side revealMine _explosive; + } forEach (objectCurators _logic); if (GVAR(revealMines) == MINE_REVEAL_FULL) then { //--- Mark minefields in the map @@ -43,8 +43,8 @@ if (_activated) then { //--- Show hint to curator who placed the object [[["Curator","PlaceMines"],nil,nil,nil,nil,nil,nil,true],"bis_fnc_advHint",_logic] call bis_fnc_mp; - waituntil {sleep 0.1; isnull _explosive || isnull _logic || !alive _logic}; - if (isnull _logic) then {deletevehicle _explosive;} else {_explosive setdamage 1;}; - deletevehicle _logic; + waitUntil {sleep 0.1; isNull _explosive || isNull _logic || !alive _logic}; + if (isNull _logic) then {deleteVehicle _explosive;} else {_explosive setDamage 1;}; + deleteVehicle _logic; }; }; diff --git a/addons/zeus/functions/fnc_bi_moduleProjectile.sqf b/addons/zeus/functions/fnc_bi_moduleProjectile.sqf index ba30a2eaf44..94771354ba4 100644 --- a/addons/zeus/functions/fnc_bi_moduleProjectile.sqf +++ b/addons/zeus/functions/fnc_bi_moduleProjectile.sqf @@ -23,26 +23,26 @@ _logic = _this select 0; _units = _this select 1; _activated = _this select 2; -if ({local _x} count (objectcurators _logic) > 0) then { +if ({local _x} count (objectCurators _logic) > 0) then { //--- Reveal the circle to curators - _logic hideobject false; - _logic setpos position _logic; + _logic hideObject false; + _logic setPos position _logic; }; -if !(isserver) exitwith {}; +if !(isServer) exitWith {}; if (_activated) then { - _ammo = _logic getvariable ["type",gettext (configOf _logic >> "ammo")]; + _ammo = _logic getVariable ["type",getText (configOf _logic >> "ammo")]; if (_ammo != "") then { - _cfgAmmo = configfile >> "cfgammo" >> _ammo; + _cfgAmmo = configFile >> "cfgammo" >> _ammo; //if !(isclass _cfgAmmo) exitwith {["CfgAmmo class '%1' not found.",_ammo] call bis_fnc_error;}; // It seems BI broke this part... // _dirVar = _fnc_scriptname + typeof _logic; // _logic setdir (missionnamespace getvariable [_dirVar,direction _logic]); //--- Restore custom direction - _pos = getposatl _logic; + _pos = getPosATL _logic; _posAmmo = +_pos; _posAmmo set [2,0]; _dir = direction _logic; - _simulation = toLowerANSI gettext (configfile >> "cfgammo" >> _ammo >> "simulation"); + _simulation = toLowerANSI getText (configFile >> "cfgammo" >> _ammo >> "simulation"); _altitude = 0; _velocity = []; _attach = false; @@ -58,7 +58,7 @@ if (_activated) then { _altitude = 1000; _velocity = [0,0,-100]; _radio = "SentGenIncoming"; - _sounds = if (getnumber (_cfgAmmo >> "hit") < 200) then {["mortar1","mortar2"]} else {["shell1","shell2","shell3","shell4"]}; + _sounds = if (getNumber (_cfgAmmo >> "hit") < 200) then {["mortar1","mortar2"]} else {["shell1","shell2","shell3","shell4"]}; _sound = selectRandom _sounds; _hint = ["Curator","PlaceOrdnance"]; _shakeStrength = 0.01; @@ -66,7 +66,7 @@ if (_activated) then { }; case "shotsubmunitions": { _posAmmo = [_posAmmo,500,_dir + 180] call bis_fnc_relpos; - _altitude = 1000 - ((getterrainheightasl _posAmmo) - (getterrainheightasl _pos)); + _altitude = 1000 - ((getTerrainHeightASL _posAmmo) - (getTerrainHeightASL _pos)); _posAmmo set [2,_altitude]; _velocity = [sin _dir * 68,cos _dir * 68,-100]; _radio = "SentGenIncoming"; @@ -102,22 +102,22 @@ if (_activated) then { }; }; }; - } foreach allPlayers; + } forEach allPlayers; }; }; - if (count _hint > 0 && {count objectcurators _logic > 0}) then { - [[_hint,nil,nil,nil,nil,nil,nil,true],"bis_fnc_advHint",objectcurators _logic] call bis_fnc_mp; + if (count _hint > 0 && {count objectCurators _logic > 0}) then { + [[_hint,nil,nil,nil,nil,nil,nil,true],"bis_fnc_advHint",objectCurators _logic] call bis_fnc_mp; }; if (count _velocity == 3) then { - _altitude = (_logic getvariable ["altitude",_altitude]) call BIS_fnc_parseNumberSafe; - _radio = _logic getvariable ["radio",_radio]; + _altitude = (_logic getVariable ["altitude",_altitude]) call BIS_fnc_parseNumberSafe; + _radio = _logic getVariable ["radio",_radio]; //--- Create projectile _posAmmo set [2,_altitude]; - _projectile = createvehicle [_ammo,_posAmmo,[],0,"none"]; - _projectile setpos _posAmmo; - _projectile setvelocity _velocity; - if (_attach) then {_projectile attachto [_logic,[0,0,_altitude]];}; + _projectile = createVehicle [_ammo,_posAmmo,[],0,"none"]; + _projectile setPos _posAmmo; + _projectile setVelocity _velocity; + if (_attach) then {_projectile attachTo [_logic,[0,0,_altitude]];}; // Added by ace_zeus for ace_frag compatibility if (!isNil QEFUNC(frag,addPfhRound)) then { @@ -128,7 +128,7 @@ if (_activated) then { if (_sound != "") then {[[_logic,_sound,"say3D"],"bis_fnc_sayMessage"] call bis_fnc_mp;}; //--- Create sound source - _soundSource = if (_soundSourceClass != "") then {createSoundSource [_soundSourceClass,_pos,[],0]} else {objnull}; + _soundSource = if (_soundSourceClass != "") then {createSoundSource [_soundSourceClass,_pos,[],0]} else {objNull}; // Added by ace_zeus to toggle ordnance radio message if (GVAR(radioOrdnance)) then { @@ -138,54 +138,54 @@ if (_activated) then { //--- Update if (_attach) then { - waituntil { - _soundSource setposatl getposatl _projectile; + waitUntil { + _soundSource setPosATL getPosATL _projectile; sleep 1; - isnull _projectile || isnull _logic + isNull _projectile || isNull _logic }; } else { - waituntil { - _soundSource setposatl getposatl _projectile; + waitUntil { + _soundSource setPosATL getPosATL _projectile; - if (getposatl _logic distance _pos > 0 || direction _logic != _dir) then { - _posNew = getposasl _logic; + if (getPosATL _logic distance _pos > 0 || direction _logic != _dir) then { + _posNew = getPosASL _logic; _dirDiff = direction _logic - _dir; - _posNew = [_posNew,[getposasl _projectile,_pos] call bis_fnc_distance2d,direction _logic + 180] call bis_fnc_relpos; - _posNew set [2,getposasl _projectile select 2]; - _projectile setvelocity ([velocity _projectile,-_dirDiff] call bis_fnc_rotatevector2d); - _projectile setposasl _posNew; - _pos = getposatl _logic; + _posNew = [_posNew,[getPosASL _projectile,_pos] call bis_fnc_distance2d,direction _logic + 180] call bis_fnc_relpos; + _posNew set [2,getPosASL _projectile select 2]; + _projectile setVelocity ([velocity _projectile,-_dirDiff] call bis_fnc_rotatevector2d); + _projectile setPosASL _posNew; + _pos = getPosATL _logic; _dir = direction _logic; //missionnamespace setvariable [_dirVar,_dir]; See L37 }; sleep 0.1; - isnull _projectile || isnull _logic + isNull _projectile || isNull _logic }; }; - deletevehicle _projectile; - deletevehicle _soundSource; - if (count objectcurators _logic > 0) then { + deleteVehicle _projectile; + deleteVehicle _soundSource; + if (count objectCurators _logic > 0) then { //--- Delete curator spawned logic if (_shakeStrength > 0) then { if (_simulation == "shotsubmunitions") then {sleep 0.5;}; [[_shakeStrength,0.7,[position _logic,_shakeRadius]],"bis_fnc_shakeCuratorCamera"] call bis_fnc_mp; }; - deletevehicle _logic; + deleteVehicle _logic; } else { //--- Repeat to achieve permanent effect - _repeat = _logic getvariable ["repeat",0] > 0; + _repeat = _logic getVariable ["repeat",0] > 0; if (_repeat) then { [_logic,_units,_activated] call bis_fnc_moduleprojectile; } else { - deletevehicle _logic; + deleteVehicle _logic; }; }; } else { - deletevehicle _logic; + deleteVehicle _logic; }; } else { - ["Cannot create projectile, 'ammo' config attribute is missing in %1",typeof _logic] call bis_fnc_error; + ["Cannot create projectile, 'ammo' config attribute is missing in %1",typeOf _logic] call bis_fnc_error; }; }; diff --git a/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf b/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf index 2aa438be532..dcc546ce3be 100644 --- a/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf +++ b/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf @@ -22,38 +22,38 @@ _logic = _this select 0; _units = _this select 1; _activated = _this select 2; -if (_activated && local _logic && !isnull curatorcamera) then { +if (_activated && local _logic && !isNull curatorCamera) then { //--- Terminate when remote control is already in progress - if !(isnull (missionnamespace getvariable ["bis_fnc_moduleRemoteControl_unit",objnull])) exitwith {}; + if !(isNull (missionNamespace getVariable ["bis_fnc_moduleRemoteControl_unit",objNull])) exitWith {}; //--- Get unit under cursor - _unit = objnull; - _mouseOver = missionnamespace getvariable ["bis_fnc_curatorObjectPlaced_mouseOver",[""]]; + _unit = objNull; + _mouseOver = missionNamespace getVariable ["bis_fnc_curatorObjectPlaced_mouseOver",[""]]; if ((_mouseOver select 0) == "OBJECT") then {_unit = _mouseOver select 1;}; - _unit = effectivecommander _unit; + _unit = effectiveCommander _unit; //--- Temp owner - private _tempOwner = _unit getvariable ["bis_fnc_moduleRemoteControl_owner", objnull]; + private _tempOwner = _unit getVariable ["bis_fnc_moduleRemoteControl_owner", objNull]; //--- Check if the unit is suitable _error = ""; if !(side group _unit in [east,west,resistance,civilian]) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorEmpty";}; - if (isplayer _unit) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorPlayer";}; + if (isPlayer _unit) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorPlayer";}; if !(alive _unit) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorDestroyed";}; - if (isnull _unit) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorNull";}; - if (!isnull _tempOwner && {_tempOwner in allPlayers}) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorControl";}; - if (isuavconnected vehicle _unit) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorControl";}; + if (isNull _unit) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorNull";}; + if (!isNull _tempOwner && {_tempOwner in allPlayers}) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorControl";}; + if (isUAVConnected vehicle _unit) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorControl";}; if (_error == "") then { _unit spawn { - scriptname "bis_fnc_moduleRemoteControl: Loop"; + scriptName "bis_fnc_moduleRemoteControl: Loop"; _unit = _this; _vehicle = vehicle _unit; - _vehicleRole = str assignedvehiclerole _unit; + _vehicleRole = str assignedVehicleRole _unit; bis_fnc_moduleRemoteControl_unit = _unit; - _unit setvariable ["bis_fnc_moduleRemoteControl_owner",player,true]; + _unit setVariable ["bis_fnc_moduleRemoteControl_owner",player,true]; // Added by ace_zeus to toggle remote control wind sound if (GVAR(remoteWind)) then { @@ -61,125 +61,125 @@ if (_activated && local _logic && !isnull curatorcamera) then { [format ["wind%1",ceil random 5],"bis_fnc_playsound"] call bis_fnc_mp; }; - _blur = ppeffectcreate ["RadialBlur",144]; - _blur ppeffectenable true; - _blur ppeffectadjust [0,0,0.3,0.3]; - _blur ppeffectcommit 0; - _blur ppeffectadjust [0.03,0.03,0.1,0.1]; - _blur ppeffectcommit 1; - - _cam = "camera" camcreate getposatl curatorcamera; - _cam cameraeffect ["internal","back"]; - _cam campreparetarget (screentoworld [0.5,0.5]); - _cam camcommitprepared 0; - _cam campreparetarget _unit; - _cam campreparefov 0.1; - _cam camcommitprepared 1; + _blur = ppEffectCreate ["RadialBlur",144]; + _blur ppEffectEnable true; + _blur ppEffectAdjust [0,0,0.3,0.3]; + _blur ppEffectCommit 0; + _blur ppEffectAdjust [0.03,0.03,0.1,0.1]; + _blur ppEffectCommit 1; + + _cam = "camera" camCreate getPosATL curatorCamera; + _cam cameraEffect ["internal","back"]; + _cam camPrepareTarget (screenToWorld [0.5,0.5]); + _cam camCommitPrepared 0; + _cam camPrepareTarget _unit; + _cam camPrepareFov 0.1; + _cam camCommitPrepared 1; sleep 0.75; - ("bis_fnc_moduleRemoteCurator" call bis_fnc_rscLayer) cuttext ["","black out",0.25]; + ("bis_fnc_moduleRemoteCurator" call bis_fnc_rscLayer) cutText ["","black out",0.25]; sleep 0.25; //--- Wait for interface to close - (finddisplay 312) closedisplay 2; - waituntil {isnull curatorcamera}; + (findDisplay 312) closeDisplay 2; + waitUntil {isNull curatorCamera}; //--- Switch - player remotecontrol _unit; - if (cameraon != _vehicle) then { - _vehicle switchcamera cameraview; + player remoteControl _unit; + if (cameraOn != _vehicle) then { + _vehicle switchCamera cameraView; }; - ppeffectdestroy _blur; - _cam cameraeffect ["terminate","back"]; - camdestroy _cam; + ppEffectDestroy _blur; + _cam cameraEffect ["terminate","back"]; + camDestroy _cam; - _color = ppeffectcreate ["colorCorrections",1896]; - _color ppeffectenable true; - _color ppeffectadjust [1,1,0,[0,0,0,1],[1,1,1,1],[0,0,0,0],[0.9,0.0,0,0,0,0.5,1]]; - _color ppeffectcommit 0; + _color = ppEffectCreate ["colorCorrections",1896]; + _color ppEffectEnable true; + _color ppEffectAdjust [1,1,0,[0,0,0,1],[1,1,1,1],[0,0,0,0],[0.9,0.0,0,0,0,0.5,1]]; + _color ppEffectCommit 0; - _curator = getassignedcuratorlogic player; + _curator = getAssignedCuratorLogic player; [_curator,"curatorObjectRemoteControlled",[_curator,player,_unit,true]] call bis_fnc_callScriptedEventHandler; [["Curator","RemoteControl"],nil,nil,nil,nil,nil,nil,true] call bis_fnc_advHint; sleep 0.3; - _color ppeffectadjust [1,1,0,[0,0,0,1],[1,1,1,1],[0,0,0,0],[0.9,0.85,0,0,0,0.5,1]]; - _color ppeffectcommit 0.3; - ("bis_fnc_moduleRemoteCurator" call bis_fnc_rscLayer) cuttext ["","black in",0.5]; + _color ppEffectAdjust [1,1,0,[0,0,0,1],[1,1,1,1],[0,0,0,0],[0.9,0.85,0,0,0,0.5,1]]; + _color ppEffectCommit 0.3; + ("bis_fnc_moduleRemoteCurator" call bis_fnc_rscLayer) cutText ["","black in",0.5]; //--- Back to player _vehicle = vehicle _unit; - _vehicleRole = str assignedvehiclerole _unit; + _vehicleRole = str assignedVehicleRole _unit; _rating = rating player; - waituntil { + waitUntil { //--- Refresh when vehicle or vehicle role changes - if ((vehicle _unit != _vehicle || str assignedvehiclerole _unit != _vehicleRole) && {alive _unit}) then { - player remotecontrol _unit; + if ((vehicle _unit != _vehicle || str assignedVehicleRole _unit != _vehicleRole) && {alive _unit}) then { + player remoteControl _unit; _vehicle = vehicle _unit; - _vehicleRole = str assignedvehiclerole _unit; + _vehicleRole = str assignedVehicleRole _unit; }; if (rating player < _rating) then { - player addrating (-rating player + _rating); + player addRating (-rating player + _rating); }; sleep 0.01; - !isnull curatorcamera + !isNull curatorCamera || - {cameraon == vehicle player} + {cameraOn == vehicle player} || {!alive _unit} //--- Also isnull check, objNull is not alive || {!alive player} || - {isnull getassignedcuratorlogic player} + {isNull getAssignedCuratorLogic player} }; - player addrating (-rating player + _rating); - objnull remotecontrol _unit; - _unit setvariable ["bis_fnc_moduleRemoteControl_owner",nil,true]; + player addRating (-rating player + _rating); + objNull remoteControl _unit; + _unit setVariable ["bis_fnc_moduleRemoteControl_owner",nil,true]; if (alive player) then { //--- Death screen if ( - isnull curatorcamera + isNull curatorCamera && - {cameraon != vehicle player} + {cameraOn != vehicle player} && - {!isnull _unit} + {!isNull _unit} && - {!isnull getassignedcuratorlogic player} + {!isNull getAssignedCuratorLogic player} //&& //{(_unit getvariable ["bis_fnc_moduleRemoteControl_owner",objnull] == player)} ) then { sleep 2; - ("bis_fnc_moduleRemoteCurator" call bis_fnc_rscLayer) cuttext ["","black out",1]; + ("bis_fnc_moduleRemoteCurator" call bis_fnc_rscLayer) cutText ["","black out",1]; sleep 1; }; - if !(isnull _unit) then { - _unitPos = getposatl _unit; + if !(isNull _unit) then { + _unitPos = getPosATL _unit; _camPos = [_unitPos,10,direction _unit + 180] call bis_fnc_relpos; - _camPos set [2,(_unitPos select 2) + (getterrainheightasl _unitPos) - (getterrainheightasl _camPos) + 10]; + _camPos set [2,(_unitPos select 2) + (getTerrainHeightASL _unitPos) - (getTerrainHeightASL _camPos) + 10]; //[_camPos,_unit] call bis_fnc_setcuratorcamera; - (getassignedcuratorlogic player) setvariable ["bis_fnc_modulecuratorsetcamera_params",[_camPos,_unit]]; + (getAssignedCuratorLogic player) setVariable ["bis_fnc_modulecuratorsetcamera_params",[_camPos,_unit]]; }; sleep 0.1; //--- Engine needs a delay in case controlled unit was deleted - ("bis_fnc_moduleRemoteCurator" call bis_fnc_rscLayer) cuttext ["","black in",1e10]; - opencuratorinterface; - ppeffectdestroy _color; + ("bis_fnc_moduleRemoteCurator" call bis_fnc_rscLayer) cutText ["","black in",1e10]; + openCuratorInterface; + ppEffectDestroy _color; - waituntil {!isnull curatorcamera}; + waitUntil {!isNull curatorCamera}; } else { - ppeffectdestroy _color; + ppEffectDestroy _color; }; - player switchcamera cameraview; + player switchCamera cameraView; bis_fnc_moduleRemoteControl_unit = nil; - ("bis_fnc_moduleRemoteCurator" call bis_fnc_rscLayer) cuttext ["","black in",1]; + ("bis_fnc_moduleRemoteCurator" call bis_fnc_rscLayer) cutText ["","black in",1]; [_curator,"curatorObjectRemoteControlled",[_curator,player,_unit,false]] call bis_fnc_callScriptedEventHandler; sleep 0.01; }; } else { - [objnull,_error] call bis_fnc_showCuratorFeedbackMessage; + [objNull,_error] call bis_fnc_showCuratorFeedbackMessage; }; - deletevehicle _logic; + deleteVehicle _logic; }; diff --git a/addons/zeus/functions/fnc_getModuleDestination.sqf b/addons/zeus/functions/fnc_getModuleDestination.sqf index 10d7acae9e0..763f9b48cac 100644 --- a/addons/zeus/functions/fnc_getModuleDestination.sqf +++ b/addons/zeus/functions/fnc_getModuleDestination.sqf @@ -109,7 +109,7 @@ GVAR(moduleDestination_mapDrawEH) = [((findDisplay 312) displayCtrl 50), "draw", private _mousePosAGL = screenToWorld getMousePosition; [_object, AGLToASL _mousePosAGL] call _drawCode; drawIcon3D [_icon, _color, _mousePosAGL, 1.5, 1.5, _angle, _text]; - drawLine3D [_mousePosAGL, ASLtoAGL (getPosASL _object), _color];; + drawLine3D [_mousePosAGL, ASLToAGL (getPosASL _object), _color];; } else { TRACE_4("cleaning up",_this select 1,GVAR(moduleDestination_displayEHMouse),GVAR(moduleDestination_displayEHKeyboard),GVAR(moduleDestination_mapDrawEH)); (_this select 1) call CBA_fnc_removePerFrameHandler; diff --git a/addons/zeus/functions/fnc_moduleCaptive.sqf b/addons/zeus/functions/fnc_moduleCaptive.sqf index ad359575e96..e16a701f055 100644 --- a/addons/zeus/functions/fnc_moduleCaptive.sqf +++ b/addons/zeus/functions/fnc_moduleCaptive.sqf @@ -29,7 +29,7 @@ if (isNil QEFUNC(captives,setHandcuffed)) then { if ((_mouseOver select 0) != "OBJECT") then { [LSTRING(NothingSelected)] call FUNC(showMessage); } else { - private _unit = effectivecommander (_mouseOver select 1); + private _unit = effectiveCommander (_mouseOver select 1); if !(_unit isKindOf "CAManBase") then { [LSTRING(OnlyInfantry)] call FUNC(showMessage); diff --git a/addons/zeus/functions/fnc_moduleCargoParadrop.sqf b/addons/zeus/functions/fnc_moduleCargoParadrop.sqf index 2aaffb37964..ed009832756 100644 --- a/addons/zeus/functions/fnc_moduleCargoParadrop.sqf +++ b/addons/zeus/functions/fnc_moduleCargoParadrop.sqf @@ -62,7 +62,7 @@ if ((_vehicle getVariable [QEGVAR(cargo,loaded), []]) isEqualTo []) exitWith { [_group] call CBA_fnc_clearWaypoints; - private _wp = _group addWaypoint [ASLtoAGL _mousePosASL, 0]; + private _wp = _group addWaypoint [ASLToAGL _mousePosASL, 0]; _wp setWaypointType "SCRIPTED"; _wp setWaypointScript QPATHTOF(functions\DOUBLES(fnc,moduleCargoParadropWaypoint).sqf); diff --git a/addons/zeus/functions/fnc_moduleCargoParadropWaypoint.sqf b/addons/zeus/functions/fnc_moduleCargoParadropWaypoint.sqf index 65706484999..cc6f9f0a012 100644 --- a/addons/zeus/functions/fnc_moduleCargoParadropWaypoint.sqf +++ b/addons/zeus/functions/fnc_moduleCargoParadropWaypoint.sqf @@ -22,8 +22,8 @@ TRACE_2("moduleCargoParadropWaypoint",_vehicleGroup,_wpPos); private _vehicle = vehicle leader _vehicleGroup; private _commander = driver _vehicle; private _cargo = _vehicle getVariable [QEGVAR(cargo,loaded), []]; -if !(_vehicle isKindOf "Air") exitWith {WARNING_1("not in a air vehicle",typeOf _vehicle); true}; -if (_cargo isEqualTo []) exitWith {WARNING_1("no cargo",_cargo); true}; +if !(_vehicle isKindOf "Air") exitWith {WARNING_1("not in a air vehicle %1",typeOf _vehicle); true}; +if (_cargo isEqualTo []) exitWith {WARNING_1("no cargo %1",_cargo); true}; private _previousSpeedMode = speedMode _vehicleGroup; private _nextMoveUpdate = -1; diff --git a/addons/zeus/functions/fnc_moduleSetMedic.sqf b/addons/zeus/functions/fnc_moduleSetMedic.sqf index d44dd56e593..2393de0ebfa 100644 --- a/addons/zeus/functions/fnc_moduleSetMedic.sqf +++ b/addons/zeus/functions/fnc_moduleSetMedic.sqf @@ -29,7 +29,7 @@ if !(GETEGVAR(medical,enabled,false)) then { if ((_mouseOver select 0) != "OBJECT") then { [LSTRING(NothingSelected)] call FUNC(showMessage); } else { - private _unit = effectivecommander (_mouseOver select 1); + private _unit = effectiveCommander (_mouseOver select 1); if !(_unit isKindOf "CAManBase") then { [LSTRING(OnlyInfantry)] call FUNC(showMessage); diff --git a/addons/zeus/functions/fnc_moduleSuicideBomber.sqf b/addons/zeus/functions/fnc_moduleSuicideBomber.sqf index 8425ff15485..6db261da534 100644 --- a/addons/zeus/functions/fnc_moduleSuicideBomber.sqf +++ b/addons/zeus/functions/fnc_moduleSuicideBomber.sqf @@ -30,8 +30,9 @@ #endif TRACE_1("params",_this); +params ["_unit", "", "", "", "_autoSeek"]; -if (isNull (_this select 0)) exitWith {}; +if (isNull _unit) exitWith {}; // Prevent another suicide bomber module being attached _unit setVariable [QGVAR(suicideBomber), true, true]; diff --git a/addons/zeus/functions/fnc_moduleSuppressiveFire.sqf b/addons/zeus/functions/fnc_moduleSuppressiveFire.sqf index a624b7dded6..2860f624f22 100644 --- a/addons/zeus/functions/fnc_moduleSuppressiveFire.sqf +++ b/addons/zeus/functions/fnc_moduleSuppressiveFire.sqf @@ -59,7 +59,7 @@ if ([_unit] call EFUNC(common,isPlayer)) exitWith { } forEach getArtilleryAmmo [_vehicle]; TRACE_1("getArtilleryAmmo",_artilleryMag); if (_artilleryMag == "") exitWith {_targetASL = [];}; - private _eta = _vehicle getArtilleryETA [ASLtoAGL _targetASL, _artilleryMag]; + private _eta = _vehicle getArtilleryETA [ASLToAGL _targetASL, _artilleryMag]; TRACE_1("getArtilleryETA",_eta); if (_eta < 0) exitWith { [ELSTRING(Interaction,NotInRange)] call FUNC(showMessage); diff --git a/addons/zeus/functions/fnc_moduleSuppressiveFireLocal.sqf b/addons/zeus/functions/fnc_moduleSuppressiveFireLocal.sqf index f09211b034b..39efec6d921 100644 --- a/addons/zeus/functions/fnc_moduleSuppressiveFireLocal.sqf +++ b/addons/zeus/functions/fnc_moduleSuppressiveFireLocal.sqf @@ -21,7 +21,7 @@ params ["_unit", "_targetASL", "_artilleryMag"]; TRACE_4("moduleSuppressiveFireLocal",_unit,local _unit,_targetASL,_artilleryMag); if (_artilleryMag != "") exitWith { - (vehicle _unit) doArtilleryFire [ASLtoAGL _targetASL, _artilleryMag, 4]; + (vehicle _unit) doArtilleryFire [ASLToAGL _targetASL, _artilleryMag, 4]; TRACE_3("doArtilleryFire",_unit,_targetASL,_artilleryMag); }; diff --git a/addons/zeus/functions/fnc_moduleSurrender.sqf b/addons/zeus/functions/fnc_moduleSurrender.sqf index 07517d7e710..b8071a8cd52 100644 --- a/addons/zeus/functions/fnc_moduleSurrender.sqf +++ b/addons/zeus/functions/fnc_moduleSurrender.sqf @@ -29,7 +29,7 @@ if (isNil QEFUNC(captives,setSurrendered)) then { if ((_mouseOver select 0) != "OBJECT") then { [LSTRING(NothingSelected)] call FUNC(showMessage); } else { - private _unit = effectivecommander (_mouseOver select 1); + private _unit = effectiveCommander (_mouseOver select 1); if !(_unit isKindOf "CAManBase") then { [LSTRING(OnlyInfantry)] call FUNC(showMessage); diff --git a/addons/zeus/functions/fnc_moduleUnconscious.sqf b/addons/zeus/functions/fnc_moduleUnconscious.sqf index 7eede3cdece..7ca0a824c2d 100644 --- a/addons/zeus/functions/fnc_moduleUnconscious.sqf +++ b/addons/zeus/functions/fnc_moduleUnconscious.sqf @@ -29,7 +29,7 @@ if (isNil QEFUNC(medical,setUnconscious)) then { if ((_mouseOver select 0) != "OBJECT") then { [LSTRING(NothingSelected)] call FUNC(showMessage); } else { - private _unit = effectivecommander (_mouseOver select 1); + private _unit = effectiveCommander (_mouseOver select 1); if !(_unit isKindOf "CAManBase") then { [LSTRING(OnlyInfantry)] call FUNC(showMessage); diff --git a/addons/zeus/functions/fnc_ui_globalSetSkill.sqf b/addons/zeus/functions/fnc_ui_globalSetSkill.sqf index 5a7c5fc5e03..1586ce2f460 100644 --- a/addons/zeus/functions/fnc_ui_globalSetSkill.sqf +++ b/addons/zeus/functions/fnc_ui_globalSetSkill.sqf @@ -47,7 +47,7 @@ private _fnc_sliderMove = { (_display displayCtrl 16189) cbSetChecked (GVAR(GlobalSkillAI) select 5); private _fnc_onUnload = { - private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objnull); + private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); if (isNull _logic) exitWith {}; deleteVehicle _logic; @@ -57,7 +57,7 @@ private _fnc_onConfirm = { params [["_ctrlButtonOK", controlNull, [controlNull]]]; TRACE_1("_fnc_onConfirm params",_this); - private _display = ctrlparent _ctrlButtonOK; + private _display = ctrlParent _ctrlButtonOK; if (isNull _display) exitWith {}; GVAR(GlobalSkillAI) = [ diff --git a/addons/zeus/functions/fnc_ui_groupSide.sqf b/addons/zeus/functions/fnc_ui_groupSide.sqf index 110e2e302da..9c243d5642a 100644 --- a/addons/zeus/functions/fnc_ui_groupSide.sqf +++ b/addons/zeus/functions/fnc_ui_groupSide.sqf @@ -105,7 +105,7 @@ private _fnc_onSelection = { } forEach IDCs; private _fnc_onUnload = { - private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objnull); + private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); if (isNull _logic) exitWith {}; if (_this select 1 == 2) then { @@ -116,10 +116,10 @@ private _fnc_onUnload = { private _fnc_onConfirm = { params ["_ctrlButtonOK"]; - private _display = ctrlparent _ctrlButtonOK; + private _display = ctrlParent _ctrlButtonOK; if (isNull _display) exitWith {}; - private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objnull); + private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); if (isNull _logic) exitWith {}; private _unit = effectiveCommander (attachedTo _logic); diff --git a/addons/zeus/functions/fnc_ui_setEngineer.sqf b/addons/zeus/functions/fnc_ui_setEngineer.sqf index 3f008403cc7..e19b04c04c0 100644 --- a/addons/zeus/functions/fnc_ui_setEngineer.sqf +++ b/addons/zeus/functions/fnc_ui_setEngineer.sqf @@ -64,7 +64,7 @@ private _fnc_onConfirm = { private _display = ctrlParent _ctrlButtonOK; if (isNull _display) exitWith {}; - private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objnull); + private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); if (isNull _logic) exitWith {}; private _value = lbCurSel (_display displayCtrl 86947); diff --git a/addons/zeus/functions/fnc_ui_spectator.sqf b/addons/zeus/functions/fnc_ui_spectator.sqf index fe9b4a36687..04d2a067630 100644 --- a/addons/zeus/functions/fnc_ui_spectator.sqf +++ b/addons/zeus/functions/fnc_ui_spectator.sqf @@ -164,7 +164,7 @@ private _fnc_onVisionSelection = { params ["_ctrl", "_state"]; private _display = ctrlParent _ctrl; - if (isNull _display) exitwith {}; + if (isNull _display) exitWith {}; // Convert to boolean since EH returns state as 0 or 1 private _state = [false, true] select _state; diff --git a/addons/zeus/functions/fnc_ui_suicideBomber.sqf b/addons/zeus/functions/fnc_ui_suicideBomber.sqf index 26184518710..ab74b398745 100644 --- a/addons/zeus/functions/fnc_ui_suicideBomber.sqf +++ b/addons/zeus/functions/fnc_ui_suicideBomber.sqf @@ -65,7 +65,7 @@ private _fnc_onSelection = { params [["_activeCtrl", controlNull, [controlNull]]]; private _display = ctrlParent _activeCtrl; - if (isNUll _display) exitWith {}; + if (isNull _display) exitWith {}; // Update button colours and scales { diff --git a/addons/zeus/functions/fnc_ui_teleportPlayers.sqf b/addons/zeus/functions/fnc_ui_teleportPlayers.sqf index b7aab411268..9d32d8cfc02 100644 --- a/addons/zeus/functions/fnc_ui_teleportPlayers.sqf +++ b/addons/zeus/functions/fnc_ui_teleportPlayers.sqf @@ -66,7 +66,7 @@ private _fnc_onKeyUp = { private _fnc_onUnload = { params ["_display"]; - private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objnull); + private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); if (isNull _logic) exitWith {}; // Store checkbox value for reopening @@ -76,10 +76,10 @@ private _fnc_onUnload = { private _fnc_onConfirm = { params [["_ctrlButtonOK", controlNull, [controlNull]]]; - private _display = ctrlparent _ctrlButtonOK; + private _display = ctrlParent _ctrlButtonOK; if (isNull _display) exitWith {}; - private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objnull); + private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); if (isNull _logic) exitWith {}; private _lb = _display displayCtrl 16189; diff --git a/addons/zeus/stringtable.xml b/addons/zeus/stringtable.xml index a6eaaac1589..7a285f2d6a8 100644 --- a/addons/zeus/stringtable.xml +++ b/addons/zeus/stringtable.xml @@ -2016,6 +2016,7 @@ <Korean>플레이어가 Esc 키로 관전자 인터페이스를 닫지 못하도록 강제로 관전자 인터페이스를 설정합니다.</Korean> <German>Erzwingt die Zuschauer-Ansicht und verhindert dass der Spieler sie mit der Esc-Taste schließen kann</German> <Italian>Forza l'interfaccia di spettatore, impedendo al giocatore di chiuderla con il tasto Esc</Italian> + <French>Force le mode spectateur en empêchant le joueur de la fermer avec la touche Echap.</French> </Key> <Key ID="STR_ACE_Zeus_ModuleSpectator_HidePlayer"> <English>Hide player</English> @@ -2024,6 +2025,7 @@ <Korean>플레이어 숨기기</Korean> <German>Spieler ausblenden</German> <Italian>Nascondi giocatore</Italian> + <French>Cacher le joueur</French> </Key> <Key ID="STR_ACE_Zeus_ModuleSpectator_HidePlayer_Tooltip"> <English>Hides the player by making them invisible, invulnerable, muted, and removing them from their group</English> @@ -2032,6 +2034,7 @@ <Korean>플레이어를 투명, 무적, 음소거화하고 그룹에서 제거하여 숨깁니다.</Korean> <German>Blendet den Spieler aus, macht ihn unsichtbar, unverwundbar, stumm und entfernt ihn von seiner Gruppe</German> <Italian>Nasconde il giocatore, rendendolo invisibile, invulnerabile, muto e lo rimuove dal proprio gruppo</Italian> + <French>Cache le joueur en le rendant invisible, invulnérable, muet et en le retirant de son groupe.</French> </Key> <Key ID="STR_ACE_Zeus_ModuleSpectator_SpectableSides_Tooltip"> <English>Sets the sides that are available to spectate</English> @@ -2040,6 +2043,7 @@ <Korean>관전 가능한 진영을 설정합니다.</Korean> <German>Bestimmt die Seiten denen man zuschauen kann</German> <Italian>Imposta le fazioni che lo spettatore può osservare</Italian> + <French>Définit les côtés disponibles pour le mode spectateur</French> </Key> <Key ID="STR_ACE_Zeus_ModuleSpectator_WhiteHot"> <English>White Hot</English> @@ -2048,6 +2052,7 @@ <Korean>백색 열원</Korean> <German>Weiß-Schwarz</German> <Italian>Bianco-caldo</Italian> + <French>Blanc-noir</French> </Key> <Key ID="STR_ACE_Zeus_ModuleSpectator_BlackHot"> <English>Black Hot</English> @@ -2056,6 +2061,7 @@ <Korean>흑색 열원</Korean> <German>Schwarz-Weiß</German> <Italian>Nero-caldo</Italian> + <French>Noir et blanc</French> </Key> <Key ID="STR_ACE_Zeus_ToggleAll"> <English>Toggle All</English> @@ -2064,6 +2070,7 @@ <Korean>전부 토글</Korean> <German>Alle wechseln</German> <Italian>Cambia tutti</Italian> + <French>Tout afficher</French> </Key> </Package> </Project> diff --git a/docs/Gemfile b/docs/Gemfile index 053c27dc351..486c7aac0fb 100644 --- a/docs/Gemfile +++ b/docs/Gemfile @@ -1,2 +1,4 @@ source 'https://rubygems.org' gem 'github-pages' +gem 'tzinfo-data' +gem 'webrick' diff --git a/docs/README_DE.md b/docs/README_DE.md index 160fb111b23..beb9467ab9e 100644 --- a/docs/README_DE.md +++ b/docs/README_DE.md @@ -48,7 +48,7 @@ Die Mod ist **modular aufgebaut**. Beinahe jede PBO kann entfernt werden, sodass - Tragen und Ziehen - Waffen und Fahrzeuge tragen die Namen ihrer Vorbilder aus der echten Welt - Ein Feuerleitsystem (FLS) für Hubschrauber und Panzer -- Viele Funktionen werden in C/C++ Erweiterungen berechnet +- Viele Funktionen werden in Rust Erweiterungen berechnet - Rückstrahlzonen- und Überdrucksimulation - Einwegwaffen - Realistische G-Kräfte diff --git a/docs/README_PL.md b/docs/README_PL.md index b1917f4080e..717ea01a0fe 100644 --- a/docs/README_PL.md +++ b/docs/README_PL.md @@ -43,7 +43,7 @@ Modyfikacja ta jest **budowana modułowo**, dzięki temu prawie każdy dostarczo - Przeciąganie i przenoszenie - Realistyczne nazwy pojazdów i broni - System kontroli ognia (SKO) dla pojazdów opancerzonych oraz śmigłowców -- Realistyczna balistyka/SKO obliczana w rozszerzeniach C/C++ +- Realistyczna balistyka/SKO obliczana w rozszerzeniach Rust - Symulacja strefy backblastu i podciśnienia - Jednorazowe wyrzutnie - Realistyczne siły G diff --git a/docs/_config.yml b/docs/_config.yml index ee7822969d6..08fdb51a642 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -8,9 +8,9 @@ ace: githubUrl: https://github.com/acemod/ACE3 version: major: 3 - minor: 17 - patch: 1 - build: 86 + minor: 18 + patch: 0 + build: 90 markdown: kramdown diff --git a/docs/_config_dev.yml b/docs/_config_dev.yml index 348e1aee441..3a57f2aad5f 100644 --- a/docs/_config_dev.yml +++ b/docs/_config_dev.yml @@ -8,9 +8,9 @@ ace: githubUrl: https://github.com/acemod/ACE3 version: major: 3 - minor: 17 - patch: 1 - build: 86 + minor: 18 + patch: 0 + build: 90 markdown: kramdown diff --git a/docs/tools/document_functions.py b/docs/tools/document_functions.py index dab567d2088..7ed20eade3a 100644 --- a/docs/tools/document_functions.py +++ b/docs/tools/document_functions.py @@ -339,6 +339,8 @@ def document_functions(addons_dir, components): return errors +def getFunctionPath(func): + return func.path.casefold() def crawl_dir(addons_dir, directory, debug=False, lint_private=False): components = {} @@ -360,7 +362,11 @@ def crawl_dir(addons_dir, directory, debug=False, lint_private=False): if function.is_public() and not debug: # Add functions to component key (initalise key if necessary) component = os.path.basename(os.path.dirname(root)) - components.setdefault(component, []).append(function) + + # Sort functions alphabetically + functions = components.setdefault(component, []) + functions.append(function) + functions.sort(key=getFunctionPath) function.feedback("Publicly documented") else: diff --git a/docs/wiki/class-names.md b/docs/wiki/class-names.md index 4a4f9b032f6..0dcf014da16 100644 --- a/docs/wiki/class-names.md +++ b/docs/wiki/class-names.md @@ -232,6 +232,7 @@ ACE_bodyBag | Bodybag | ACE_ItemCore | ACE_bodyBagObject | Bodybag (packed) | | ACE_epinephrine | Epinephrine auto injector | ACE_ItemCore | ACE_morphine | Morphine auto injector | ACE_ItemCore | +ACE_painkillers | Painkillers | ACE_ItemCore | ACE_packingBandage | Packing Bandage | ACE_ItemCore | ACE_personalAidKit | Personal Aid Kit | ACE_ItemCore | ACE_plasmaIV | Plasma IV (1000ml) | ACE_ItemCore | diff --git a/docs/wiki/development/ace3-config-entries.md b/docs/wiki/development/ace3-config-entries.md index 9e656ad48c9..8ff22438a10 100644 --- a/docs/wiki/development/ace3-config-entries.md +++ b/docs/wiki/development/ace3-config-entries.md @@ -13,29 +13,78 @@ Entries found in the `CfgVehicles.hpp` files ```cpp -ace_nightvision_grain -ace_nightvision_blur -ace_recoil_enablecamshake -ace_dragging_cancarry -ace_dragging_carryposition -ace_dragging_carrydirection -ace_dragging_candrag -ace_dragging_dragposition -ace_dragging_dragdirection +ace_artillerytables_showGunLaying +ace_cargo_canLoad +ace_cargo_hasCargo +ace_cargo_loadmasterTurrets +ace_cargo_noRename +ace_cargo_size +ace_cargo_space +ace_casings_model +ace_cookoff_canHaveFireJet +ace_cookoff_cookoffSelections +ace_dragging_canCarry +ace_dragging_canDrag +ace_dragging_carryPosition +ace_dragging_carryDirection +ace_dragging_dragPosition +ace_dragging_dragDirection ace_fastroping_enabled -ace_fastroping_friesType ace_fastroping_friesAttachmentPoint +ace_fastroping_friesType ace_fastroping_onCut ace_fastroping_onPrepare ace_fastroping_ropeOrigins -ace_gforcecoef -ace_offset -ace_hasReserveParachute -ace_reserveParachute +ace_fcs_distanceInterval +ace_fcs_enabled +ace_fcs_maxDistance +ace_fcs_minDistance +ace_hunterkiller +ace_intelitems_magazine +ace_interaction_canPush +ace_interaction_bodyLength +ace_interaction_bodyWidth +ace_interaction_replaceTerrainObject +ace_logitics_wirecutter_isFence +ace_medical_treatment_patientSeats +ace_minedetector_detectable +ace_parachute_failureDelay +ace_rearm_defaultSupply +ace_refuel_canReceive ace_refuel_flowRate ace_refuel_fuelCapacity ace_refuel_fuelCargo ace_refuel_hooks +ace_repair_hitpointPositions +ace_tagging_canTag +ace_trenches_diggingDuration +ace_trenches_grassCuttingPoints +ace_trenches_noGeoClass +ace_trenches_placementData +ace_trenches_removalDuration +ace_vehicle_damage_canHaveFireRing +ace_vehicle_damage_detonationDuringFireProb +ace_vehicle_damage_engineDetonationProb +ace_vehicle_damage_engineFireProb +ace_vehicle_damage_eraHitpoints +ace_vehicle_damage_hullDetonationProb +ace_vehicle_damage_hullFireProb +ace_vehicle_damage_slatHitpoints +ace_vehicle_damage_turretDetonationProb +ace_vehicle_damage_turretFireProb +ace_vehicles_engineStartDelay + +acex_field_rations_offset +acex_field_rations_waterSupply +acex_sitting_canSit +acex_sitting_interactPosition +acex_sitting_sitDirection +acex_sitting_sitPosition + +ACE_Attachable +ACE_GForceCoef +ace_hasReserveParachute +ace_reserveParachute ``` @@ -140,7 +189,6 @@ ace_isbelt ace_attachable ace_placeable ace_setupobject -ace_delaytime ace_triggers ace_magazines_forcemagazinemuzzlevelocity ``` diff --git a/docs/wiki/development/arma-3-issues.md b/docs/wiki/development/arma-3-issues.md index 506bfde2221..379fb7d5bbc 100644 --- a/docs/wiki/development/arma-3-issues.md +++ b/docs/wiki/development/arma-3-issues.md @@ -14,7 +14,6 @@ Keeping track of Arma 3 issues that need to be fixed. - [bux578: T79355: MineDetector equipable in Launcher slot](https://feedback.bistudio.com/T79355) - [bux578: T79534: Zeus / Curator Add Remote Controlled Event](https://feedback.bistudio.com/T79534) -- [bux578: T79827: Add script commands "addPrimaryWeaponMagazine" and "addSecondaryWeaponMagazine"](https://feedback.bistudio.com/T79827) - [bux578: T80358: Add/Alter script command to add perfectly configured weapons to cargo](https://feedback.bistudio.com/T80358) - [commy2: T79801: Unexpected behavior of += array in configs](https://feedback.bistudio.com/T79801) - [commy2: T81029: setVariable is not always JIP persistent](https://feedback.bistudio.com/T81029) @@ -23,11 +22,12 @@ Keeping track of Arma 3 issues that need to be fixed. - [Jaynus: T82046: Display event handler return values for mouse buttons should be respected](https://feedback.bistudio.com/T82046) - [Heisenberg: T82108: Switching between optic modes of a sniper scope (AMS, DMS, MOS) will result in a blurred vision](https://feedback.bistudio.com/T82108) - [BaerMitUmlaut: T120030: Particles do not render properly since 1.62](https://feedback.bistudio.com/T120030) -- [Killzone_Kid: T79689: magazineTurretAmmo and setMagazineTurretAmmo do not function as expected if there are multiple magazines of the same type](https://feedback.bistudio.com/T79689) -- [nekoarrow: T122981: setMagazineTurretAmmo locality issue](https://feedback.bistudio.com/T122981) **Resolved:** - <del>[Nou: T79119: Memory points rfemur, lfemur, and other leg memory points returned incorrectly with SQF command selectionPosition](https://feedback.bistudio.com/T79119)</del> - <del>[commy2: T81503: isLightOn doesn't recognize destroyed light bulbs for streetlamps](https://feedback.bistudio.com/T81503)</del> - <del>[commy2: T83771: splitString scripting command causes game crash](https://feedback.bistudio.com/T83771)</del> +- <del>[bux578: T79827: Add script commands "addPrimaryWeaponMagazine" and "addSecondaryWeaponMagazine"](https://feedback.bistudio.com/T79827)</del> +- <del>[Killzone_Kid: T79689: magazineTurretAmmo and setMagazineTurretAmmo do not function as expected if there are multiple magazines of the same type](https://feedback.bistudio.com/T79689)</del> +- <del>[nekoarrow: T122981: setMagazineTurretAmmo locality issue?](https://feedback.bistudio.com/T122981)</del> diff --git a/docs/wiki/development/dependencies.md b/docs/wiki/development/dependencies.md index b43371034c5..c6d0f87d63d 100644 --- a/docs/wiki/development/dependencies.md +++ b/docs/wiki/development/dependencies.md @@ -21,16 +21,18 @@ Because `ace_zeus` is being removed you must also remove any components that req ## 2. Dependencies -{% assign pages_by_title = site.pages | sort: "title" %} +{% assign pages_by_title = site.pages | sort_natural: "title" %} {% for page in pages_by_title %} {%- if page.group == 'feature' and page.component -%} - ### {{ page.title }} - - {% capture component %}{{ page.component }}{% endcapture %} - {% include dependencies_list.md component=component %} - - {%- if page.core_component -%} - _Note: This module is required by nearly all other modules. Do NOT remove it!_ - {% endif %} + {%- unless page.version.removed -%} + ### {{ page.title }} + + {% capture component %}{{ page.component }}{% endcapture %} + {% include dependencies_list.md component=component %} + + {%- if page.core_component -%} + _Note: This module is required by nearly all other modules. Do NOT remove it!_ + {% endif %} + {% endunless %} {% endif %} {% endfor %} diff --git a/docs/wiki/development/extension-guidelines.md b/docs/wiki/development/extension-guidelines.md index d7f4fe08a67..36178d86f54 100644 --- a/docs/wiki/development/extension-guidelines.md +++ b/docs/wiki/development/extension-guidelines.md @@ -7,87 +7,59 @@ parent: wiki order: 9 --- -## 1. Basics +## 1. Setup ### 1.1 Requirements -- A compiler (VS/GCC/Clang) - - If starting with Visual Studio, you need to make sure to use the Visual studio command prompt -- cmake 3.0 or later in your path +- [Rust](https://rustup.rs/) +- [cargo-make](https://crates.io/crates/cargo-make) +`cargo install --no-default-features --force cargo-make` -### 1.2 Cross-Platform Guidelines +### 1.2 Recomendations -### 1.3 C++ basic style and naming guide +- [VSCode](https://code.visualstudio.com/) +- [Rust Analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer) +- [CodeLLDB](https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb) -### 1.4 ace_common cpp library +### 1.3 Rust Resources ---- +- [Learn Rust](https://www.rust-lang.org/learn) -## 2 Building Extensions on Windows +--- -### 2.1 Compiling +## 2 Development -#### 2.1.1 Windows - Creating a Visual Studio Project -1. Open your compiling command prompt (which has cmake and your compiler) -2. From this directory, you need to use cmake to build the appropriate build files. Change the -G property appropriately. run cmake --help to get a list of the options. +### 2.1 Code Standards -``` -cd extensions\build -cmake .. -G "Visual Studio 15 2017 Win64" -``` +1. [Rust API Guidelines for naming](https://rust-lang.github.io/api-guidelines/naming.html) should be followed +2. All code should be formatted with `cargo fmt` +3. All code should be free from errors and warnings +4. Tests should be written where applicable -A Visual studio project file will now be generated in your build directory. +### 2.2 Local Development -#### 2.1.2 Windows - Visual Studio - Compile only (nmake) -1. Open your compiling command prompt (which has cmake and your compiler) -2. From this directory, you need to use cmake to build the appropriate build files. Change the -G property appropriately. run cmake --help to get a list of the options. - -``` -cd extensions\build -cmake .. -G "NMake Makefiles" -nmake -``` +Running `cargo make debug` will compile the project for x32 and x64 and move the built libraries to `ace.dll` and `ace_x64.dll`. -The extensions will not be built in its appropriate project folder, for example: +The library can be debugged with the following `.vscode/launch.json` file. Replace all sections in `{}` with the appropriate path. +```json +{ + "version": "0.2.0", + "configurations": [ + { + "type": "lldb", + "request": "launch", + "name": "Debug", + "program": "{Path to Arma}\\arma3_x64.exe", + "args": ["-mod=\"{Path to CBA};{Path to ACE development folder}\""], + "cwd": "{Path to Arma}" + } + ] +} ``` -extensions\ - build\ - fcs\ace_fcs.dll - somethingElse\ace_somethingElse.dll -``` - -### 2.2 Creating a new Extension - -#### 2.2.1 Arma Config - -ACE3 loads extensions defined in `ACE_Extensions` root config class and supports the following entries: -```cpp -// Platform -windows = 1; // Load on Windows -linux = 1; // Load on Linux +Use the `Run and Debug` tab in VSCode to launch Arma, or Press `F5`. -// Type -client = 1; // Load on Client -server = 1; // Load on Server -``` - -```cpp -class ACE_Extensions { - // Windows Client only extension - class tag_extension { - windows = 1; - client = 1; - }; - - // Any platform Server extension - class tag_extension2 { - windows = 1; - linux = 1; - server = 1; - }; -}; -``` +### 2.3 Release -Combining platform and client/server values is possible to get all combinations currently supported by the game and more. +Release versions can be built using `cargo make release`. diff --git a/docs/wiki/development/setting-up-the-development-environment.md b/docs/wiki/development/setting-up-the-development-environment.md index e2c94430395..822da19fa40 100644 --- a/docs/wiki/development/setting-up-the-development-environment.md +++ b/docs/wiki/development/setting-up-the-development-environment.md @@ -139,7 +139,7 @@ Different `make.py` command line options include: - `increment_patch` - increments _patch_ version number (ignored with `increment_minor` or `increment_major`) - `increment_minor` - increments _minor_ version number and resets _patch_ version number to `0` (ignored with `increment_major`) - `increment_major` - increments _major_ version number and resets _minor_ and _patch_ version numbers to `0` -- `force` - force rebuild all PBOs, even those already present in the `release` directory (combined with `compile` it will also rebuild all extensions) +- `force` - force rebuild all PBOs, even those already present in the `release` directory - `checkexternal` - check external references (incompatible only with `<component1> <component2>` and `force <component1> <component2>`) - `release` - create release packages/archives - `<component1> <component2>` - build only specified component(s) (incompatible with `release`) diff --git a/docs/wiki/feature/artillerytables.md b/docs/wiki/feature/artillerytables.md new file mode 100644 index 00000000000..4bdfb5c5d53 --- /dev/null +++ b/docs/wiki/feature/artillerytables.md @@ -0,0 +1,30 @@ +--- +layout: wiki +title: Artillery Tables +component: artillerytables +description: Adds universal rangetables for artillery. +group: feature +category: equipment +parent: wiki +mod: ace +version: + major: 3 + minor: 13 + patch: 0 +--- + +## 1. Overview + +### 1.1 Features +- Adds a rangetable to accurately take out your target without the artillery computer. +- Shows accurate elevation and azimuth. +- Optionally adds wind deflection and air friction for shells. +- Optionally disables artillery computers. + +## 2. Usage + +### 2.1 Opening a rangetable +- Enter a piece of artillery. +- Use Self Interact <kbd>Ctrl</kbd>+<kbd>⊞ Win</kbd> (ACE3 default). +- Select `Equipment`. +- Select the rangetable of the piece of artillery you are in. diff --git a/docs/wiki/feature/cargo.md b/docs/wiki/feature/cargo.md new file mode 100644 index 00000000000..304ba709445 --- /dev/null +++ b/docs/wiki/feature/cargo.md @@ -0,0 +1,41 @@ +--- +layout: wiki +title: Cargo +component: cargo +description: Adds the ability to transport cargo using vehicles. +group: feature +category: interaction +parent: wiki +mod: ace +version: + major: 3 + minor: 3 + patch: 0 +--- + +## 1. Overview +Adds the ability to load and unload cargo from vehicles. Unloading can happen via two methods: Regular unloading and deploying, where you can preplace the item before it's unloaded. + +## 2. Usage + +### 2.1 Loading an object +- Interact with the object to be loaded <kbd>⊞ win</kbd>. +- Select the `Load` option. +- Select which vehicle you want to load the object in. +- Wait for the progress bar to finish. To cancel loading, press <kbd>Escape</kbd>. + +### 2.2 Checking a vehicle's cargo +- Interact with the vehicle whose cargo is to b e checked <kbd>⊞ win</kbd>. +- Select the `Cargo` option. + +### 2.3 Unloading an object from a vehicle +- Open the vehicle's cargo menu (see "Checking a vehicle's cargo") +- Press `Unload`. +- Wait for the progress bar to finish. To cancel unloading, press <kbd>Escape</kbd>. + +### 2.4 Deploying an object from a vehicle +- Open the vehicle's cargo menu (see "Checking a vehicle's cargo") +- Press `Deploy`. +- Use the mouse to fine tune the placement of the object. +- When ready to place, press left click to start deploying the object. +- Wait for the progress bar to finish. To cancel deploying, press <kbd>Escape</kbd>. diff --git a/docs/wiki/feature/casings.md b/docs/wiki/feature/casings.md new file mode 100644 index 00000000000..8bcf24a6969 --- /dev/null +++ b/docs/wiki/feature/casings.md @@ -0,0 +1,17 @@ +--- +layout: wiki +title: Casings +component: casings +description: Adds infantry bullet casings on the ground when weapons are fired. +group: feature +category: realism +parent: wiki +mod: ace +version: + major: 3 + minor: 15 + patch: 0 +--- + +## 1. Overview +Spits out casings from infantry weapons when fired. diff --git a/docs/wiki/feature/cookoff.md b/docs/wiki/feature/cookoff.md new file mode 100644 index 00000000000..19a32893882 --- /dev/null +++ b/docs/wiki/feature/cookoff.md @@ -0,0 +1,22 @@ +--- +layout: wiki +title: Cook-off +component: cookoff +description: Adds cook-off effects to vehicles and ammunition boxes that have had their ammunition detonated or that have been destroyed. +group: feature +category: realism +parent: wiki +mod: ace +version: + major: 3 + minor: 7 + patch: 0 +--- + +## 1. Overview + +### 1.1 Features +- Adds engine fires when a vehicle's engine is damaged heavily. +- Optionally adds fire if a vehicle suffers ammunition detonations (requires `Vehicle Damage` to be enabled). +- Optionally adds ammunition detonation if a vehicle is destroyed. +- Optionally adds ammunition detonation if an ammunition box is destroyed or hit with explosive, incendiary or tracer ammunition. diff --git a/docs/wiki/feature/dogtags.md b/docs/wiki/feature/dogtags.md new file mode 100644 index 00000000000..9f1d27e371d --- /dev/null +++ b/docs/wiki/feature/dogtags.md @@ -0,0 +1,40 @@ +--- +layout: wiki +title: Dog Tags +component: dogtags +description: Adds dog tags to units. +group: feature +category: realism +parent: wiki +mod: ace +version: + major: 3 + minor: 7 + patch: 0 +--- + +## 1. Overview +Provides dog tags to units, which include name, social security number and blood type as information. + +## 2. Usage + +### 2.1 Checking a unit's dog tags +- Interact with the unconscious or dead unit whose dog tags are to be checked <kbd>⊞ win</kbd>. +- Select the `Dog Tag` option. +- Select the `Check` option. + +### 2.2 Taking a unit's dog tags +- Interact with the unconscious or dead unit whose dog tags are to be checked <kbd>⊞ win</kbd>. +- Select the `Dog Tag` option. +- Select the `Take` option. +- If the one of the two dog tags has already been taken, it will inform you and not give you the 2nd dog tag + +### 2.3 Checking what dog tags you have via self-interaction +- Use Self Interact <kbd>Ctrl</kbd>+<kbd>⊞ Win</kbd> (ACE3 default). +- Select the `Equipment` option. +- Select the `Check Dog Tag` option. + +### 2.4 Checking what dog tags you have via context menu +- Open your inventory and find the dog tag you want to inspect. +- Double click the item. +- Click `Check Dog Tag`. diff --git a/docs/wiki/feature/dragging.md b/docs/wiki/feature/dragging.md index 0d42240a238..aa462d2e64d 100644 --- a/docs/wiki/feature/dragging.md +++ b/docs/wiki/feature/dragging.md @@ -20,7 +20,9 @@ This adds the option to drag or carry units or objects. ## 2. Usage ### 2.1 Dragging / Carrying units and objects -- You can only drag or carry an unconscious unit. +- You can drag or carry dead or unconscious units. These units can't be in a ragdoll state. +- You can drag or carry units whose legs are broken. +- You can't carry if you have broken legs. - Interact with the unit or object <kbd>⊞ Win</kbd> (ACE3 default key bind `Interact Key`). - Select `Drag` or `Carry`. - To release, use the mouse wheel and select `Release` or use Self Interaction <kbd>Ctrl</kbd>+<kbd>⊞ Win</kbd> and select `Release`. diff --git a/docs/wiki/feature/field-rations.md b/docs/wiki/feature/field-rations.md new file mode 100644 index 00000000000..63daad99631 --- /dev/null +++ b/docs/wiki/feature/field-rations.md @@ -0,0 +1,30 @@ +--- +layout: wiki +title: Field Rations +component: field_rations +description: Adds a thirst and hunger system, along with food to replenish those. +group: feature +category: realism +parent: wiki +mod: acex +version: + major: 3 + minor: 4 + patch: 0 +--- + +## 1. Overview +Simulates hunger and thirst which need to be replenished. This system is affected by other modules, such as weather and medical, and can in turn affect fatigue. + +## 2. Usage + +### 2.1 Satiate hunger/Quench thirst via self-interaction +- Pick up a drink. +- Use Self Interact <kbd>Ctrl</kbd>+<kbd>⊞ Win</kbd> (ACE3 default). +- Select the `Survival` option. +- Choose an item to consume. + +### 2.2 Satiate hunger/Quench thirst via context menu +- Open your inventory and find the item you want to consume. +- Double click the item. +- Click `Eat/Drink`. diff --git a/docs/wiki/feature/fieldmanual.md b/docs/wiki/feature/fieldmanual.md new file mode 100644 index 00000000000..bf6af86fe24 --- /dev/null +++ b/docs/wiki/feature/fieldmanual.md @@ -0,0 +1,23 @@ +--- +layout: wiki +title: Field Manual +component: fieldmanual +description: Adds ACE3 content to the field manual. +group: feature +category: general +parent: wiki +mod: ace +version: + major: 3 + minor: 16 + patch: 0 +--- + +## 1. Overview +Provides information on items and mechanics that ACE3 adds. + +## 2. Usage + +### 2.1 Opening the field manual +- Press <kbd>Escape</kbd>. +- Press `Field Manual`. diff --git a/docs/wiki/feature/gestures.md b/docs/wiki/feature/gestures.md new file mode 100644 index 00000000000..30be084be38 --- /dev/null +++ b/docs/wiki/feature/gestures.md @@ -0,0 +1,32 @@ +--- +layout: wiki +title: Gestures +component: gestures +description: Adds gestures that can be used for communication. +group: feature +category: interaction +parent: wiki +mod: ace +version: + major: 3 + minor: 4 + patch: 0 +--- + +## 1. Overview +Adds the ability to use 14 gestures for communication. + +## 2. Usage + +### 2.1 Using gestures via self-interaction + +- Use Self Interact <kbd>Ctrl</kbd>+<kbd>⊞ Win</kbd> (ACE3 default). +- Select the `Gestures` option. + +### 2.2 Rebinding keybinds for gestures + +- Press <kbd>Escape</kbd>. +- Select `Options`. +- Select `Controls`. +- Select `Configure Addons`. +- Select `ACE Gestures`. diff --git a/docs/wiki/feature/gunbag.md b/docs/wiki/feature/gunbag.md new file mode 100644 index 00000000000..35e2dd5e59a --- /dev/null +++ b/docs/wiki/feature/gunbag.md @@ -0,0 +1,32 @@ +--- +layout: wiki +title: Gun Bag +component: gunbag +description: Adds a gun bag that can be used to store a weapon. +group: feature +category: equipment +parent: wiki +mod: ace +version: + major: 3 + minor: 6 + patch: 0 +--- + +## 1. Overview +Adds easy handling and storage of an additional weapon in a backpack. + +## 2. Usage + +### 2.1 Interacting with your gun bag via self-interaction +- Use Self Interact <kbd>Ctrl</kbd>+<kbd>⊞ Win</kbd> (ACE3 default). +- Select the `Equipment` option. +- Select the `Gunbag` option. + +### 2.2 Interacting with your gun bag via the ACE arsenal +- Open an ACE arsenal. +- Get yourself a gun bag if you don't have one already. +- Select the primary weapon or backpack tab to interact with weapon. + +### 2.3 Interacting with another unit's gun bag +- Interact with the unit <kbd>⊞ win</kbd>. diff --git a/docs/wiki/feature/index.md b/docs/wiki/feature/index.md index 41fd0fdeea6..1c7039dfd29 100644 --- a/docs/wiki/feature/index.md +++ b/docs/wiki/feature/index.md @@ -19,7 +19,7 @@ redirect_from: "/wiki/featurex" <h2>General</h2> <nav> <ul> - {% assign feature_list = site.pages | sort: "title" %} + {% assign feature_list = site.pages | sort_natural: "title" %} {% assign group = 'feature' %} {% assign category = 'general' %} {% include feature_list %} @@ -30,7 +30,7 @@ redirect_from: "/wiki/featurex" <h2>Interaction</h2> <nav> <ul> - {% assign feature_list = site.pages | sort: "title" %} + {% assign feature_list = site.pages | sort_natural: "title" %} {% assign group = 'feature' %} {% assign category = 'interaction' %} {% include feature_list %} @@ -41,7 +41,7 @@ redirect_from: "/wiki/featurex" <h2>Realism</h2> <nav> <ul> - {% assign feature_list = site.pages | sort: "title" %} + {% assign feature_list = site.pages | sort_natural: "title" %} {% assign group = 'feature' %} {% assign category = 'realism' %} {% include feature_list %} @@ -52,7 +52,7 @@ redirect_from: "/wiki/featurex" <h2>Equipment</h2> <nav> <ul> - {% assign feature_list = site.pages | sort: "title" %} + {% assign feature_list = site.pages | sort_natural: "title" %} {% assign group = 'feature' %} {% assign category = 'equipment' %} {% include feature_list %} diff --git a/docs/wiki/feature/killtracker.md b/docs/wiki/feature/killtracker.md new file mode 100644 index 00000000000..2782c1fa0fa --- /dev/null +++ b/docs/wiki/feature/killtracker.md @@ -0,0 +1,17 @@ +--- +layout: wiki +title: Kill Tracker +component: killtracker +description: Tracks deaths/kills and displays them at the mission end. +group: feature +category: general +parent: wiki +mod: acex +version: + major: 3 + minor: 1 + patch: 0 +--- + +## 1. Overview +Provides a method of tracking kills/deaths and displays them in the mission end screen. diff --git a/docs/wiki/feature/logistics-rope.md b/docs/wiki/feature/logistics-rope.md new file mode 100644 index 00000000000..b0e449a149b --- /dev/null +++ b/docs/wiki/feature/logistics-rope.md @@ -0,0 +1,22 @@ +--- +layout: wiki +title: Logistics - Rope +component: logistics_rope +description: Adds ropes. +group: feature +category: equipment +parent: wiki +mod: ace +version: + major: 3 + minor: 14 + patch: 0 +--- + +<div class="panel callout"> + <h5>Note:</h5> + <p>Ropes were moved from fastroping to logistics_rope in 3.14.0, but were introduced in 3.12.6!</p> +</div> + +## 1. Overview +Adds several rope items of different lengths that are required for fastroping and towing. diff --git a/docs/wiki/feature/maverick.md b/docs/wiki/feature/maverick.md new file mode 100644 index 00000000000..b19528a7c6c --- /dev/null +++ b/docs/wiki/feature/maverick.md @@ -0,0 +1,17 @@ +--- +layout: wiki +title: Maverick +component: maverick +description: Adds pylon magazines with laser-guided AGM-65 Maverick L and KH25ML. +group: feature +category: equipment +parent: wiki +mod: ace +version: + major: 3 + minor: 11 + patch: 0 +--- + +## 1. Overview +Adds pylon magazines with laser-guided AGM-65 Maverick L and KH25ML. diff --git a/docs/wiki/feature/medical-gui.md b/docs/wiki/feature/medical-gui.md new file mode 100644 index 00000000000..42cb916c7b6 --- /dev/null +++ b/docs/wiki/feature/medical-gui.md @@ -0,0 +1,22 @@ +--- +layout: wiki +title: Medical GUI +component: medical_gui +description: Adds the medical menu and interactions. +group: feature +category: realism +parent: wiki +mod: ace +version: + major: 3 + minor: 13 + patch: 0 +--- + +<div class="panel callout"> + <h5>Note:</h5> + <p>The medical menu was moved from medical_menu to medical_gui in 3.13.0, but was originally introduced in 3.3.0!</p> +</div> + +## 1. Overview +Adds the medical menu, which can be limited to vehicles / disabled by the mission maker. It also provides interactions, which can be used in conjunction or instead of the medical menu. diff --git a/docs/wiki/feature/medical_menu.md b/docs/wiki/feature/medical_menu.md deleted file mode 100644 index 14f3391aac6..00000000000 --- a/docs/wiki/feature/medical_menu.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -layout: wiki -title: Medical Menu -component: medical_menu -description: Adds the medical menu. -group: feature -category: realism -parent: wiki -mod: ace -version: - major: 3 - minor: 3 - patch: 0 ---- - -## 1. Overview -Adds the medical menu, this is entirely optional and can be limited to vehicles / disabled by the mission maker. diff --git a/docs/wiki/feature/metis.md b/docs/wiki/feature/metis.md new file mode 100644 index 00000000000..8683917fed4 --- /dev/null +++ b/docs/wiki/feature/metis.md @@ -0,0 +1,17 @@ +--- +layout: wiki +title: Metis +component: metis +description: Converts the vanilla "Vorona" Missile Guidance into ACE SACLOS Guidance. +group: feature +category: equipment +parent: wiki +mod: ace +version: + major: 3 + minor: 13 + patch: 0 +--- + +## 1. Overview +Converts the vanilla "Vorona" Missile Guidance into ACE SACLOS Guidance. diff --git a/docs/wiki/feature/minedetector.md b/docs/wiki/feature/minedetector.md new file mode 100644 index 00000000000..358a7799e3e --- /dev/null +++ b/docs/wiki/feature/minedetector.md @@ -0,0 +1,25 @@ +--- +layout: wiki +title: Mine Detector +component: minedetector +description: Adds 2 mine detectors, as well as a framework to implement your own. +group: feature +category: equipment +parent: wiki +mod: ace +version: + major: 3 + minor: 6 + patch: 0 +--- + +## 1. Overview +Provides a system for implementing mine detectors and adds 2 of its own (`VMH3`, `VMM3`). + +## 2. Usage + +### 2.1 Interacting with the mine detector +- Select your mine detector. +- Use Self Interact <kbd>Ctrl</kbd>+<kbd>⊞ Win</kbd> (ACE3 default). +- Select the `Equipment` option. +- Select the `Metal detector` option. diff --git a/docs/wiki/feature/mk6mortar.md b/docs/wiki/feature/mk6mortar.md index 33b5f68c7bf..bb405daa4f3 100644 --- a/docs/wiki/feature/mk6mortar.md +++ b/docs/wiki/feature/mk6mortar.md @@ -18,7 +18,6 @@ version: ### 1.1 Mk6 Mortar overhaul ACE3 adds wind deflection for shells as well as a rangetable to accurately take out your target without the artillery computer. If ammunition handling is enabled, rounds must be loaded manually. - ## 2. Usage ### 2.1 Switching charge @@ -32,7 +31,6 @@ ACE3 adds wind deflection for shells as well as a rangetable to accurately take ### 2.2 Getting your shells to land where you want. For this you need a `82mm Rangetable`, `Map Tools` and a `Vector 21` are also recommended. - - Get the distance and elevation difference between you and the target (you can use map tools). - Select the charge you want to use (0 = close / 1 = medium / 2 = far). - Open the `82mm Rangetable` diff --git a/docs/wiki/feature/quickmount.md b/docs/wiki/feature/quickmount.md new file mode 100644 index 00000000000..0683f12dad0 --- /dev/null +++ b/docs/wiki/feature/quickmount.md @@ -0,0 +1,27 @@ +--- +layout: wiki +title: Quick-mount +component: quickmount +description: Adds a keybind to quickly mount vehicles. +group: feature +category: interaction +parent: wiki +mod: ace +version: + major: 3 + minor: 10 + patch: 0 +--- + +## 1. Overview +Provides a method for quickly getting into vehicles, as well as vehicle seat interactions. + +## 2. Usage + +### 2.1 Quick-mount +- Assign keybind (unbound by default). +- Press keybind when looking at vehicle. + +### 2.1 Loading an object +- Interact with the object to be mount up in <kbd>⊞ win</kbd>. +- Select the `Get In` option. diff --git a/docs/wiki/feature/realisticweights.md b/docs/wiki/feature/realisticweights.md new file mode 100644 index 00000000000..933bbba8877 --- /dev/null +++ b/docs/wiki/feature/realisticweights.md @@ -0,0 +1,19 @@ +--- +layout: wiki +title: Realistic Weights +component: realisticweights +description: More realistic weapon weights. +group: feature +category: realism +parent: wiki +mod: ace +version: + major: 3 + minor: 7 + patch: 0 +--- + +## 1. Overview + +### 1.1 Real weights +Changes the weights of weapons to their respective real-world counterparts whenever possible. diff --git a/docs/wiki/feature/testmissions.md b/docs/wiki/feature/testmissions.md index 30202f03523..d0cf27ad66a 100644 --- a/docs/wiki/feature/testmissions.md +++ b/docs/wiki/feature/testmissions.md @@ -16,4 +16,4 @@ version: ## 1. Overview -Adds an ACE3 Test Missions +Adds ACE3 Test Missions. diff --git a/docs/wiki/feature/towing.md b/docs/wiki/feature/towing.md new file mode 100644 index 00000000000..029446e5a65 --- /dev/null +++ b/docs/wiki/feature/towing.md @@ -0,0 +1,33 @@ +--- +layout: wiki +title: Towing +component: towing +description: Adds the ability to tow vehicles. +group: feature +category: interaction +parent: wiki +mod: ace +version: + major: 3 + minor: 14 + patch: 0 +--- + +## 1. Overview +Adds the ability to tow vehicles. + +## 2. Usage + +It is recommended to not have anyone in the towed vehicle! + +### 2.1 Adding a tow rope between two vehicles +- Pick up a rope. +- Interact with the vehicle that is going to tow <kbd>⊞ win</kbd>. +- Select `Towing`. +- Select whichever rope you want. +- Place the first attachment point on the towing vehicle wherever you want. +- Place the second attachment point on the towed vehicle wherever you want. + +### 2.2 Removing a tow rope between two vehicles +- Interact with either vehicle <kbd>⊞ win</kbd>. +- Select `Towing`. diff --git a/docs/wiki/feature/trenches.md b/docs/wiki/feature/trenches.md new file mode 100644 index 00000000000..5664e852a54 --- /dev/null +++ b/docs/wiki/feature/trenches.md @@ -0,0 +1,42 @@ +--- +layout: wiki +title: Trenches +component: trenches +description: Provides players with the capability of digging trenches. +group: feature +category: interaction +parent: wiki +mod: ace +version: + major: 3 + minor: 5 + patch: 0 +--- + +## 1. Overview +Provides players with the capability of digging trenches. + +## 2. Usage + +You can see if any tool/backpack is defined as an entrenching tool by opening the ACE arsenal and looking at the stats box. + +### 2.1 Digging a trench +- Pick up an entrenching tool. +- Use Self Interact <kbd>Ctrl</kbd>+<kbd>⊞ Win</kbd> (ACE3 default). +- Select the `Equipment` option. +- Select which trench type you want to build. +- Use the mouse to place the trench how you want. +- When ready to place, press left click to start digging. +- Wait for the progress bar to finish. To stop digging, press <kbd>Escape</kbd>. + +### 2.2 Removing a trench +- Pick up an entrenching tool. +- Interact with the trench to remove <kbd>⊞ win</kbd>. +- Select the `Remove Trench` option. +- Wait for the progress bar to finish. To stop removing, press <kbd>Escape</kbd>. + +### 2.3 Continue digging a trench +- Pick up an entrenching tool. +- Interact with the trench to continue to dig <kbd>⊞ win</kbd>. +- Select the `Continue Digging Trench` option. +- Wait for the progress bar to finish. To stop digging, press <kbd>Escape</kbd>. diff --git a/docs/wiki/feature/vehicledamage.md b/docs/wiki/feature/vehicledamage.md index 12dd1d4a191..a457e663f46 100644 --- a/docs/wiki/feature/vehicledamage.md +++ b/docs/wiki/feature/vehicledamage.md @@ -19,7 +19,7 @@ Removes hit-point based damage on armoured vehicles. ### 1.1 Differences from vanilla -Vehicle damage is component based in this system. Rather than catastrophically exploding when an arbitrary amount of damage is recieved, the system calculates what warhead hit you, if it hit SLAT/ERA, and what components it hits. +Vehicle damage is component based in this system. Rather than catastrophically exploding when an arbitrary amount of damage is received, the system calculates what warhead hit you, if it hit SLAT/ERA, and what components it hits. When you are hit, a calculation takes place and determines which people inside the vehicle should get hurt. ### 1.2 How is damage calculated @@ -116,20 +116,3 @@ When hit, HEAT warheads will be defeated and no damage will be applied. If hit w - Can cook-off [N] - Can injure occupants [N] - -## 3. Addon Options - -### 3.1 Enable - -- Enables/Disables the vehicle damage simulation -- Default: On - -### 3.2 Enable/Disable Ammo Removal During Cook-Off - -- Enables/Disables whether or not vehicle ammo will be fully removed upon cooking-off -- Default: On - -### 3.3 Enable/Disable advanced car damage (Experimental) - -- Enable experimental car damage. System will apply vehicle damage simulation to "car" types (trucks, SUVs, Humvees, etc.). Not fully tested and could be immbalanced causing weird behaviours. -- Default: Off diff --git a/docs/wiki/feature/viewports.md b/docs/wiki/feature/viewports.md index b58a73bba37..97d1c849be5 100644 --- a/docs/wiki/feature/viewports.md +++ b/docs/wiki/feature/viewports.md @@ -1,6 +1,7 @@ --- layout: wiki title: Viewports +component: viewports description: Allows crew to look through periscopes. group: feature category: interaction diff --git a/docs/wiki/feature/viewrestrictions.md b/docs/wiki/feature/viewrestrictions.md new file mode 100644 index 00000000000..8ae141c6e01 --- /dev/null +++ b/docs/wiki/feature/viewrestrictions.md @@ -0,0 +1,17 @@ +--- +layout: wiki +title: View Restrictions +component: viewrestriction +description: Adds the ability to enforce certain view modes. +group: feature +category: realism +parent: wiki +mod: acex +version: + major: 3 + minor: 0 + patch: 0 +--- + +## 1. Overview +Restricts view modes according to the settings chosen. diff --git a/docs/wiki/feature/xm157.md b/docs/wiki/feature/xm157.md new file mode 100644 index 00000000000..473892a2fff --- /dev/null +++ b/docs/wiki/feature/xm157.md @@ -0,0 +1,27 @@ +--- +layout: wiki +title: XM157 +component: xm157 +description: Adds a framework for the XM157 scope. +group: feature +category: general +parent: wiki +mod: ace +version: + major: 3 + minor: 15 + patch: 1 +--- + +## 1. Overview +Adds a framework for the XM157 scope. Does NOT add the scope itself. + +## 2. Usage + +### 2.1 Ranging +- Press <kbd>Tab</kbd> for rangefinding. +- Use <kbd>PageUP</kbd> and <kbd>PageDOWN</kbd> to manually increase/decrease respectively. + +### 2.2 Menu navigation +- Use <kbd>Delete</kbd> and <kbd>End</kbd> to cycle through menus. +- Use <kbd>PageUP</kbd> and <kbd>PageDOWN</kbd> to increase/decrease values respectively. diff --git a/docs/wiki/framework/arsenal-framework.md b/docs/wiki/framework/arsenal-framework.md index 954bbc0a7e5..330e7fa99b1 100644 --- a/docs/wiki/framework/arsenal-framework.md +++ b/docs/wiki/framework/arsenal-framework.md @@ -214,7 +214,7 @@ class ace_arsenal_stats { showBar = 1; // 0 disabled; 1 enabled; showText = 1; // 0 disabled; 1 enabled; barStatement = "1"; // Statement evaluated to set the bar progress, needs to return a NUMBER. - textStatement = "test entry"; // statement evaluated to set the text entry, can return anything. + textStatement = "test entry"; // statement evaluated to set the text entry, can return anything. Arrays will have a linebreak added after each element. condition = "true"; // Condition for the stats to be displayed, default is true if not defined, needs to return a BOOL. tabs[] = { {0,1,2}, { } }; // Arrays of tabs, left array is left tabs, right array is right tabs. }; @@ -588,3 +588,12 @@ TAG_my_arsenal_essentials = ["arifle_AK12_F", "LMG_03_F"]; [ace_arsenal_currentBox, TAG_my_arsenal_essentials] call ace_arsenal_fnc_addVirtualItems }] call CBA_fnc_addEventHandler; ``` + +### 10.4 Saving loadouts to profile +A loadout can be saved to the player's profile using `ace_arsenal_fnc_saveLoadout`. + +```sqf +private _loadout = [ACE_player] call CBA_fnc_getLoadout; // or getUnitLoadout ACE_player +private _replaceExisting = true; // optional, default: false +["Current Loadout", _loadout, _replaceExisting] call ace_arsenal_fnc_saveLoadout; +``` diff --git a/docs/wiki/framework/attach-framework.md b/docs/wiki/framework/attach-framework.md index f118b3b9348..dd35b76939d 100644 --- a/docs/wiki/framework/attach-framework.md +++ b/docs/wiki/framework/attach-framework.md @@ -50,10 +50,11 @@ class CfgWeapons { ## 2. Event Handlers ### 2.1 Listenable Events -| Event Key | Parameters | Locality | Description | -|----------|---------|---------|---------| -|`ace_attach_attached` | [_attachedObject, _itemClassname, _temporary] | Local | Called after an item is attached to an object. `_temporary` flag means the item is being re-attached (after a unit is exiting a vehicle, for example) | -|`ace_attach_detaching` | [_attachedObject, _itemClassname, _temporary] | Local | Called just before an item is detached/removed from an object. `_temporary` flag means the item will be reattached later, see above. | + +| Event Key | Parameters | Locality | Type | Description | +|----------|---------|---------|---------|---------| +|`ace_attach_attached` | [_attachedObject, _itemClassname, _temporary] | Local | Listen | After an item was attached to a unit/vehicle. _temporary flag means a item is being re-attached after the player exits a vehicle | +|`ace_attach_detaching` | [_attachedObject, _itemName, _temporary] | Local | Listen | Just before an item gets detached/removed from a unit/vehicle. _temporary flag means its detached because the player unit entered a vehicle. | ### 2.2 Other events for attached objects Use [CBA Extended Event Handlers](https://github.com/CBATeam/CBA_A3/wiki/Extended-Event-Handlers-(new)). Note that objects attached to units will be deleted/created upon entering/exiting vehicles and should be handled accordingly. diff --git a/docs/wiki/framework/cargo-framework.md b/docs/wiki/framework/cargo-framework.md index a1d810ce9c4..2e3e695e688 100644 --- a/docs/wiki/framework/cargo-framework.md +++ b/docs/wiki/framework/cargo-framework.md @@ -114,7 +114,17 @@ Note that this function can be used to make objects loadable/unloadable (set to * [object, 3] call ace_cargo_fnc_setSize ``` -### 4.3 Adjusting cargo space of a vehicle +### 4.3 Setting Custom Load/Unload Time + +```sqf +object setVariable ["ace_cargo_delay", <TIME IN SECONDS>] +``` + +This will override the load/unload time calculation and instead set it to the value as specified. This value will _not_ be affected by any scaling coefficients, but will instead always take as long as the set delay. + +To disable, remove the variable with `object setVariable ["ace_cargo_delay", nil]` or set the delay to a negative value, e.g.: `object setVariable ["ace_cargo_delay", -1]`. + +### 4.4 Adjusting cargo space of a vehicle `ace_cargo_fnc_setSpace` Note that this function can be used to enable/disable a vehicle's cargo space (set to `0` to disable). @@ -134,7 +144,7 @@ Note that this function can be used to enable/disable a vehicle's cargo space (s * [vehicle, 20] call ace_cargo_fnc_setSpace ``` -### 4.4 Load cargo into vehicle +### 4.5 Load cargo into vehicle `ace_cargo_fnc_loadItem` (Also callable from CBA event `ace_loadCargo`) Note first argument can be a in-game object or a classname of an object type. @@ -155,7 +165,7 @@ Note first argument can be a in-game object or a classname of an object type. * [object, vehicle] call ace_cargo_fnc_loadItem ``` -### 4.5 Unload cargo from vehicle +### 4.6 Unload cargo from vehicle `ace_cargo_fnc_unloadItem` (Also callable from CBA event `ace_unloadCargo`) @@ -172,7 +182,7 @@ Note first argument can be a in-game object or a classname of an object type. * [object, vehicle] call ace_cargo_fnc_unloadItem ``` -### 4.6 Remove/ Delete cargo from vehicle (Added in ACE3 3.11.0) +### 4.7 Remove/ Delete cargo from vehicle (Added in ACE3 3.11.0) `ace_cargo_fnc_removeCargoItem` @@ -190,7 +200,7 @@ Note first argument can be a in-game object or a classname of an object type. * [crate_7, truck] call ace_cargo_fnc_removeCargoItem ``` -### 4.7 Disable cargo renaming via script +### 4.8 Disable cargo renaming via script ```sqf cargoBox setVariable ["ace_cargo_noRename", true, _disableGlobally] diff --git a/docs/wiki/framework/crew-served-weapons-framework.md b/docs/wiki/framework/crew-served-weapons-framework.md index 9b3ef28d4fb..0213e42a5e9 100644 --- a/docs/wiki/framework/crew-served-weapons-framework.md +++ b/docs/wiki/framework/crew-served-weapons-framework.md @@ -16,7 +16,7 @@ version: To convert a static weapon into a crew served weapon, you need to create the following: -- A proxy weapon +- A proxy weapon (optional) - A carryable weapon that can be mounted on a tripod - Carryable weapon magazines - The CSW config in the static weapon @@ -27,6 +27,8 @@ For the following examples, we are going to assume you are modifying your existi Because the magazine loading time is already handled by the ACE interaction, a proxy weapon with a very low loading time is used. It automatically replaces the default weapon of the turret when CSW is enabled. +A proxy weapon isn't required for a CSW to work. If a CSW uses the default weapons, the reload times will just be longer. + ```cpp class CfgWeapons { class prefix_hmg_weapon; @@ -39,6 +41,7 @@ class CfgWeapons { ### 1.2 Carryable Weapon Carried CSW weapons are technically rocket launchers. This allows the player to carry both a CSW weapon and a backpack with magazines for the CSW. +ACE 3.18.0 added support for primary weapons to be used as CSW weapons, but not tripods. ```cpp class CfgWeapons { @@ -135,7 +138,7 @@ class CfgVehicles { class prefix_hmg: StaticMGWeapon { class ACE_CSW { enabled = 1; // Enables ACE CSW for this weapon - proxyWeapon = "prefix_hmg_weapon_proxy"; // The proxy weapon created above + proxyWeapon = "prefix_hmg_weapon_proxy"; // The proxy weapon created above. This can also be a function name that returns a proxy weapon - passed [_vehicle, _turret, _currentWeapon, _needed, _emptyWeapon] magazineLocation = "_target selectionPosition 'magazine'"; // Ammo handling interaction point location disassembleWeapon = "prefix_hmg_carry"; // Carryable weapon created above disassembleTurret = "ace_csw_m3Tripod"; // Which static tripod will appear when weapon is disassembled diff --git a/docs/wiki/framework/disposables-framework.md b/docs/wiki/framework/disposables-framework.md index 78f609e3581..fcdcd5efdff 100644 --- a/docs/wiki/framework/disposables-framework.md +++ b/docs/wiki/framework/disposables-framework.md @@ -12,8 +12,10 @@ version: patch: 0 --- -Support for the ACE3 disposable framework will be dropped in 3.13.0! -Switch to the [CBA Disposable Framework](https://github.com/CBATeam/CBA_A3/wiki/Disposable-Launchers) +<div class="panel callout"> + <h5>Note:</h5> + <p>Deprecated and replaced with <a href="https://github.com/CBATeam/CBA_A3/wiki/Disposable-Launchers">CBA Disposable Framework</a> in 3.13.0!</p> +</div> Old weapon configs that are no longer supported: ```cpp diff --git a/docs/wiki/framework/dragging-framework.md b/docs/wiki/framework/dragging-framework.md index 43a7c98ba44..256d41570d4 100644 --- a/docs/wiki/framework/dragging-framework.md +++ b/docs/wiki/framework/dragging-framework.md @@ -35,11 +35,6 @@ class CfgVehicles { ## 2. Functions -<div class="panel callout"> - <h5>Note:</h5> - <p>The following functions are NOT public and are likely to change in the future!</p> -</div> - You will **not** be able to carry / drag objects that are too heavy, the mass is also affected by what is inside the object. To bypass this empty the object. You can change the weight limits by setting `ACE_maxWeightDrag` (default 800) and `ACE_maxWeightCarry` (default 600). ### 2.1 Enabling / disabling dragging @@ -53,6 +48,7 @@ You will **not** be able to carry / drag objects that are too heavy, the mass is | 2 | Position to offset the object from player | Array | Optional (default: `[0, 1.5, 0]`) | | 3 | Direction in degree to rotate the object | Number | Optional (default: `0`) | | 4 | Ignore weight limitation for dragging | Boolean | Optional (default: `false`) | +| 5 | Apply changes globally | Boolean | Optional (default: `false`) | | **R** | None | None | Return value | #### 2.1.1 Example 1 @@ -63,7 +59,7 @@ You will **not** be able to carry / drag objects that are too heavy, the mass is |----| --------- | ----------- | | 0 | `foo` | My object | | 1 | `true` | Dragging is enabled | -| 2 | `[0,2,0]` | 0 meters sideways, 2 meters forward, 0 |meters upwards +| 2 | `[0,2,0]` | 0 meters sideways, 2 meters forward, 0 meters upwards | | 3 | `45` | Rotated by 45° | #### 2.1.2 Example 2 @@ -89,6 +85,7 @@ You will **not** be able to carry / drag objects that are too heavy, the mass is | 2 | Position to offset the object from player | Array | Optional (default: `[0, 1, 1]`) | | 3 | Direction in degree to rotate the object | Number | Optional (default: `0`) | | 4 | Ignore weight limitation for carrying | Boolean | Optional (default: `false`) | +| 5 | Apply changes globally | Boolean | Optional (default: `false`) | | **R** | None | None | Return value | #### 2.2.1 Example @@ -101,3 +98,27 @@ You will **not** be able to carry / drag objects that are too heavy, the mass is | 1 | `true`| Carrying is enabled | | 2 | `[0,2,0]` | 0 meters sideways, 3 meters forward, 1 meter upwards | | 3 | `10` | Rotated by 10° | + +## 3. Corpse moving +Added in 3.18.0, ACE allows you to drag and carry corpses. + +### 3.1 Config Values + +```cpp +class CfgVehicles { + class MyUnit { + ace_dragging_cloneClass = "MyClone"; // Allows you to define what type of clone is used for moving the corpse (default: "ace_dragging_clone") + }; + + class ace_dragging_clone; + class MyClone: ace_dragging_clone {}; // Custom clones must inherit from ace_dragging_clone +}; +``` + +### 3.2 Enabling / disabling corpse moving + +By default, corpse moving is enabled. If you wish to disable it, you can set the variable below to `false`: + +```sqf +ace_dragging_canMoveDead = false; +``` diff --git a/docs/wiki/framework/events-framework.md b/docs/wiki/framework/events-framework.md index 5155cf75937..bcbbb6283ef 100644 --- a/docs/wiki/framework/events-framework.md +++ b/docs/wiki/framework/events-framework.md @@ -38,8 +38,8 @@ The vehicle events will also have the following local variables available `_gunn | Event Key | Parameters | Locality | Type | Description | |----------|---------|---------|---------|---------| |`ace_unconscious` | [_unit, _state(BOOL)] | Global | Listen | Unit's unconscious state changed | -|`ace_placedInBodyBag` | [_target, _bodyBag, _isGrave] | Global | Listen | Target placed into a bodybag Note: (Target will soon be deleted, target could be a bodybag) | -|`ace_placedInGrave` | [_target, _grave] | Global | Listen | Target placed into a grave, _grave will be objNull if `Create Grave Markers` is disabled Note: (Target will soon be deleted) | +|`ace_placedInBodyBag` | [_target, _bodyBag, _isGrave, _medic] | Global | Listen | Target placed into a bodybag Note: (Target will soon be deleted, target could be a bodybag) | +|`ace_placedInGrave` | [_target, _grave, _medic] | Global | Listen | Target placed into a grave, _grave will be objNull if `Create Grave Markers` is disabled Note: (Target will soon be deleted) | |`ace_treatmentStarted` | [_caller, _target, _selectionName, _className, _itemUser, _usedItem, _createLitter] | Local | Listen | Treatment action has started (local on the _caller) | |`ace_treatmentSucceded` | [_caller, _target, _selectionName, _className, _itemUser, _usedItem, _createLitter] | Local | Listen | Treatment action is completed (local on the _caller) | |`ace_treatmentFailed` | [_caller, _target, _selectionName, _className, _itemUser, _usedItem, _createLitter] | Local | Listen | Treatment action has been interrupted (local on the _caller) | @@ -112,7 +112,7 @@ MenuType: 0 = Interaction, 1 = Self Interaction ### 2.10 Cook Off (`ace_cookoff`) | Event Key | Parameters | Locality | Type | Description | -|----------|---------|---------|---------|---------|---------| +|----------|---------|---------|---------|---------| |`ace_cookoff_cookOff` | [_vehicle, _intensity, _instigator, _smokeDelayEnabled, _ammoDetonationChance, _detonateAfterCookoff, _fireSource, _canRing, _maxIntensity, _canJet] | Global | Listen | Vehicle cook-off has started | |`ace_cookoff_cookOffBox` | [_box, _source, _instigator, _delay] | Global | Listen | Ammo box cook-off has started | |`ace_cookoff_engineFire` | [_vehicle] | Global | Listen | Engine fire has started | @@ -167,6 +167,31 @@ MenuType: 0 = Interaction, 1 = Self Interaction | `ace_headless_groupTransferPre` | [_group, _HC (OBJECT), _previousOwner, _idHC] | Target | Listen | Called just before a group is transferred from any machine to a HC. Called where group currently is local and on the HC, where group is going to be local. | `ace_headless_groupTransferPost` | [_group, _HC (OBJECT), _previousOwner, _idHC, _transferredSuccessfully] | Target | Listen | Called just after a group is transferred from a machine to a HC. Called where group was local and on the HC, where group is now local. `_transferredSuccessfully` is passed so mods can actually check if the locality was properly transferred, as ownership transfer is not guaranteed. +### 2.18 Dragging (`ace_dragging`) + +| Event Key | Parameters | Locality | Type | Description | +|---------- |------------|----------|------|-------------| +| `ace_dragging_cloneCreated` | [_clone, _corpse] | Local | Listen | Called when a clone used for dragging/carrying corpses is created +| `ace_dragging_cloneDeleted` | [_clone, _corpse] | Local | Listen | Called when a clone used for dragging/carrying corpses is deleted +| `ace_dragging_setupCarry` | [_unit, _target] | Local | Listen | Called when the unit starts the carrying animation for the target +| `ace_dragging_startedCarry` | [_unit, _target] | Local | Listen | Called when the unit starts successfully carrying the target. This event is called after `ace_dragging_setupCarry`. +| `ace_dragging_stoppedCarry` | [_unit, _target, _loadCargo] | Local | Listen | Called when the unit stops carrying the target. `_loadCargo` says if the target is being loaded as cargo/person or not. +| `ace_dragging_setupDrag` | [_unit, _target] | Local | Listen | Called when the unit starts the dragging animation for the target +| `ace_dragging_startedDrag` | [_unit, _target] | Local | Listen | Called when the unit starts successfully dragging the target. This event is called after `ace_dragging_setupDrag`. +| `ace_dragging_stoppedDrag` | [_unit, _target] | Local | Listen | Called when the unit stops dragging the target + +### 2.19 HuntIR (`ace_huntir`) + +| Event Key | Parameters | Locality | Type | Description | +|---------- |------------|----------|------|-------------| +| `ace_huntir_monitorOpened` | [_unit] | Local | Listen | Called when the monitor is opened +| `ace_huntir_monitorClosed` | [_unit] | Local | Listen | Called when the monitor is closed (may be fired multiple times when the monitor is closed by ACE and not the user) +| `ace_huntir_monitorStarted` | [_unit] | Local | Listen | Called when the monitor is started +| `ace_huntir_monitorSearching` | [_unit] | Local | Listen | Called when the monitor is searching +| `ace_huntir_monitorConnecting` | [_unit] | Local | Listen | Called when the monitor is connecting +| `ace_huntir_monitorConnected` | [_unit, _huntir] | Local | Listen | Called when the monitor is connected +| `ace_huntir_monitorNoGDS` | [_unit] | Local | Listen | Called when the monitor found no GDS + ## 3. Usage Also Reference [CBA Events System](https://github.com/CBATeam/CBA_A3/wiki/Custom-Events-System){:target="_blank"} documentation. diff --git a/docs/wiki/framework/explosives-framework.md b/docs/wiki/framework/explosives-framework.md index 8abffa9448c..8a026e806ea 100644 --- a/docs/wiki/framework/explosives-framework.md +++ b/docs/wiki/framework/explosives-framework.md @@ -28,7 +28,6 @@ class CfgMagazines { ACE_Explosives_Placeable = 1; // Can be placed useAction = 0; // Disable the vanilla interaction ACE_Explosives_SetupObject = "banana_satchel_place"; // The object placed before the explosive is armed - ACE_Explosives_DelayTime = 1.5; // Seconds between trigger activation and explosion class ACE_Triggers { // Trigger configurations SupportedTriggers[] = {"Timer", "Command", "MK16_Transmitter", "DeadmanSwitch"}; // Triggers that can be used class Timer { @@ -52,7 +51,7 @@ class CfgAmmo { class SatchelCharge_Remote_Ammo: PipeBombBase { soundActivation[] = {"", 0, 0, 0}; // No sound on activation soundDeactivation[] = {"", 0, 0, 0}; // No sound on deactivation - triggerWhenDestroyed = 1; // (Optional) Explode when the object is shot and destroyed (after being placed) (0-disabled, 1-enabled). + triggerWhenDestroyed = 1; // (Optional) Explode when the object is shot and destroyed (after being placed) (0-disabled, 1-enabled). Required to be enabled prior to ACE 3.18.0. ACE_explodeOnDefuse = 0.02; // (Optional) Add a chance for the explosive to detonate after being disarmed (in percent) ACE_explosives_defuseObjectPosition[] = {-1.415, 0, 0.12}; // (Optional) The position relative to the model where the defuse helper object will be attached and thus the interaction point will be rendered ACE_explosives_size = 0; // (Optional) Setting to 1 will use a defusal action with a larger radius (useful for large mines or mines with a wide pressure plane trigger area) @@ -205,11 +204,12 @@ Jammer that blocks RF triggers: }] call ace_explosives_fnc_addDetonateHandler; ``` -#### 5.4 Disabling `setShotParents`. +#### 5.4 Enabling `setShotParents`. -ACE will set the owner/instigator of the explosive to the unit placing/detonating it. -This can be disabled by executing +ACE can set the owner/instigator of the explosive to the unit placing/detonating it. +By default, it will only set the instigator to prevent unrealistic AI behavior where it immediately knows the placer's exact location upon detonation. +Enabling this will also set the explosive owner, if required by custom Event Handlers or other scripts. ```sqf -ace_explosives_setShotParents = false; +ace_explosives_setShotParents = true; ``` diff --git a/docs/wiki/framework/fortify-framework.md b/docs/wiki/framework/fortify-framework.md index 9de0fab35b3..19cdf45e6b9 100644 --- a/docs/wiki/framework/fortify-framework.md +++ b/docs/wiki/framework/fortify-framework.md @@ -109,10 +109,22 @@ The Fortify budget can be updated for any side using the function. * [west, -250, false] call ace_fortify_fnc_updateBudget ``` +## 2. Config Values -## 2. Events +### 2.1 Enabling fortify tools on an item or backpack +```cpp +class CfgWeapons { // same config also works on backpacks (CfgVehicles) + class yourBaseClass; + class yourFortifyToolClass: yourBaseClass { + ace_fortify_fortifyTool = 1; + }; +}; +``` + + +## 3. Events -### 2.1 Listenable +### 3.1 Listenable | Event Name | Passed Parameter(s) | Locality | Description | | ---------- | ----------- | ------------------- | -------- | diff --git a/docs/wiki/framework/frag-framework.md b/docs/wiki/framework/frag-framework.md index d05f5068f69..2c453eb7497 100644 --- a/docs/wiki/framework/frag-framework.md +++ b/docs/wiki/framework/frag-framework.md @@ -14,7 +14,7 @@ version: ## 1. Overview -The fragmentation system in ACE3 is a significant improvement over the fragmentation system in ACE2. Previously the system relied on fuzzy math from the values of `indirectHit` and `indirectHitRange` in `CfgAmmo` to calculate roughly the velocity and range of fragmentation. This had some serious drawbacks, especially in the case of smaller explosives such as hand grenades and 40mm grenades where casualty production was lower than desired. +The fragmentation system in ACE3 is a significant improvement over the fragmentation system in ACE2. Previously the system relied on fuzzy math from the values of `indirectHit` and `indirectHitRange` in `CfgAmmo` to calculate roughly the velocity and range of fragmentation. This had some serious drawbacks, especially in the case of smaller explosives such as hand grenades and 40mm grenades where lethality was lower than desired. In ACE3 the system has moved away from what "feels" right to actual explosive engineering equations, primarily the [Gurney equations](http://en.wikipedia.org/wiki/Gurney_equations). This allows us to get close to the actual fragmentation velocities that would be produced by an explosive configuration similar to type of ammo we are simulating. @@ -26,7 +26,7 @@ The system for the end-developer is easy to use, and only requires minimal resea ```cpp class CfgAmmo { class MyGrenade { - ace_frag_enabled = 1; // Enable fragmentation (0-disabled, 1-enabled) + ace_frag_enabled = 1; // Deprecated ace_frag_metal = 210; // Amount of metal being fragmented (grams) - information below ace_frag_charge = 185; // Amount of explosive filler (grams) - information below ace_frag_gurney_c = 2843; // Gurney velocity constant for explosive type - information below @@ -38,27 +38,27 @@ class CfgAmmo { }; ``` -### 1.1 Metal amount +### 2.1 Metal amount `ace_frag_metal` -Amount of metal being fragmented (generally taken as the entire weight of the warhead, though in some cases you might want to only include the fragmentation jacket or body. +The amount of metal being fragmented. Generally taken as the entire weight of the warhead, though in some cases you might want to only include the fragmentation jacket or body. -Dimensionless value, as long as same unit as `ace_frag_charge` (for example `kg/kg` or `g/g` or `lbs/lbs`). +`ace_frag_charge` is the total mass of fragmenting metal given in grams. -### 1.2 Explosives filler amount +### 2.2 Explosives filler amount `ace_frag_charge` -Amount of explosive filler in the warhead. `ace_frag_metal` and `ace_frag_charge` are dimensionless values, as long as they are both in the same unit (for example kg/kg g/g lbs/lbs). +The mass of explosive filler in the warhead. This may include any detonation/ignition charges, but usually such charges are relatively small. -Dimensionless value, as long as same unit as `ace_frag_metal` (for example `kg/kg` or `g/g` or `lbs/lbs`). +`ace_frag_metal` is the total mass of explosive filler given in grams. -### 1.3 Gurney velocity constant +### 2.3 Gurney velocity constant `ace_frag_gurney_c` -Gurney constant for explosive force. You can find a list of common explosive types below. If you can not find it here, or want more accurate numbers, just google the type of explosive and Gurney constant and you can find substantial information. This is **not** the detonation velocity of the explosive, do not confuse them! +The Gurney constant for explosive force. You can find a list of common explosive types below. If you can not find it here, or want more accurate numbers, just google the type of explosive and Gurney constant and you can find substantial information. This is **not** the detonation velocity of the explosive, do not confuse them†! | Type | Speed | | --------------- | -------- | @@ -77,11 +77,13 @@ Gurney constant for explosive force. You can find a list of common explosive typ | TNT | 2440 m/s | | Tritonal | 2320 m/s | -### 1.4 Gurney shape factor +†A rule of thumb from literature is that the Gurney constant is given as 0.338 times the detonation velocity. + +### 2.4 Gurney shape factor `ace_frag_gurney_k` -Shape factor for the explosive configuration. You should choose it based on the general configuration of explosives/metal in the warhead. Most grenades for example are a sphere. Artillery and aircraft bombs are a cylinder. Mines generally a flat plate. Below is a list of the three common shapes and their factors. +The shape factor for the explosive configuration. You should choose it based on the general configuration of explosives/metal in the warhead. Most grenades for example are a sphere. Artillery and aircraft bombs are a cylinder. Mines generally a flat plate. Below is a list of the three common shapes and their factors. | Shape | Factor | | -------- | ------ | @@ -91,7 +93,7 @@ Shape factor for the explosive configuration. You should choose it based on the There are other configurations but these are the most common. If you are interested in others check out the wikipedia link given above. Most of these will not correctly function in ACE3 though due to additional variables for the equation. -### 1.5 Fragments type +### 2.5 Fragments type `ace_frag_classes[]` @@ -110,16 +112,16 @@ There are different types of fragmentation fragments to choose from, and they ca | ACE_frag_huge | | ACE_frag_huge_HD | -The tinier the piece of fragmentation the shorter the distance of travel. The `_HD` variants are all even higher drag versions. Grenades generally should use the `_HD` variants. Experimentation here is important. +Tinier fragments do less damage, and generally correlate to lower mass fragments. The `_HD` variants are all higher drag versions. Higher drag version are useful for fragments that are irregular or would not fly very far. Experimentation here is important. -### 1.6 Ignore fragmentation +### 2.6 Ignore fragmentation `ace_frag_skip` -Setting this to `1` will skip fragmentation for ammo of this type. This is useful for things that might cause high network load, such as FFAR rockets, or possibly even 40mm grenades from AGLs. Experimentation under network conditions is required. +When `1`, the ammunition type will not produce fragments. `ace_frag_skip` does not stop submunitions of the ammo type from producing fragments. `ace_frag_skip` may be helpful for ammunition types that might cause high network load or for explosives that do not produce fragments. Experimentation under network conditions may be required. `ace_frag_skip` takes a higher priority than `ace_frag_force`. -### 1.7 Force fragmentation +### 2.7 Force fragmentation `ace_frag_force` -Settings this to `1` will force the fragmentation system to use frag on this ammo, ignoring internal qualifications based on hit values. +When `1`, the ammunition type will fragment, ignoring internal hit value-based qualifications. `ace_frag_force` takes a lower priority than `ace_frag_skip`. diff --git a/docs/wiki/framework/goggles-framework.md b/docs/wiki/framework/goggles-framework.md index 07840ebf95a..e7201041d06 100644 --- a/docs/wiki/framework/goggles-framework.md +++ b/docs/wiki/framework/goggles-framework.md @@ -38,3 +38,4 @@ class CfgGlasses { | ---------- | ----------- | ------------------- | -------- | | `ace_glassesChanged` | Glasses Changed | `[_unit, _glassesClass]` | Local | | `ace_glassesCracked` | Glasses Cracked | `[_unit]` | Local | +| `ace_goggles_effect` | Applied Goggle Effect | `[_unit, "cause"]` | Local diff --git a/docs/wiki/framework/grenades-framework.md b/docs/wiki/framework/grenades-framework.md index 755773c1710..dcf1f60cd00 100644 --- a/docs/wiki/framework/grenades-framework.md +++ b/docs/wiki/framework/grenades-framework.md @@ -74,7 +74,7 @@ The average amount of time in seconds, after `explosionTime` has passed, between The amount of randomness in the fuse time. -### 2.1.5 ace_grenades_flashbangExplodeSound +#### 2.1.5 ace_grenades_flashbangExplodeSound The sounds that can be used when the flashbang detonates. It randomly selects an entry from this array (equal chances, there are no weights involved). If not defined, `[format ["A3\Sounds_F\arsenal\explosives\grenades\Explosion_HE_grenade_0%1.wss", floor (random 4) + 1], 5, 1.2, 400]` is used as a default instead (4 sounds total). @@ -108,7 +108,7 @@ class CfgAmmo { If set to zero or left undefined, the grenade is not treated as a flare. If it is set to 1, the grenade will be treated as a flare with the associated effects. -#### 2.3.1 ace_grenades_color +#### 2.3.2 ace_grenades_color Sets the color of the emitted light. The first 3 values of the array of the color, the last is the light intensity. diff --git a/docs/wiki/framework/huntIR-framework.md b/docs/wiki/framework/huntIR-framework.md index 2a31119e731..2fe98442be5 100644 --- a/docs/wiki/framework/huntIR-framework.md +++ b/docs/wiki/framework/huntIR-framework.md @@ -30,3 +30,15 @@ class CfgWeapons { }; }; ``` + +## 2. Player Animation + +Player animation when entering the HuntIR Monitor can be disabled by setting `ace_huntir_animatePlayer` to `false`. + +```sqf +// Disable player animation locally +missionNamespace setVariable ["ace_huntir_animatePlayer", false]; + +// Disable player animation for everyone +missionNamespace setVariable ["ace_huntir_animatePlayer", false, true]; +``` diff --git a/docs/wiki/framework/index.md b/docs/wiki/framework/index.md index eb2396a9b4e..6ddb5429b48 100644 --- a/docs/wiki/framework/index.md +++ b/docs/wiki/framework/index.md @@ -28,7 +28,7 @@ redirect_from: <div class="large-12 columns"> <nav> <ul class="columns"> - {% assign pages_list = site.pages | sort: "title" %} + {% assign pages_list = site.pages | sort_natural: "title" %} {% assign group = 'framework' %} {% include pages_list %} </ul> diff --git a/docs/wiki/framework/interactionMenu-framework.md b/docs/wiki/framework/interactionMenu-framework.md index fb66fb39182..56cde5fc2c3 100644 --- a/docs/wiki/framework/interactionMenu-framework.md +++ b/docs/wiki/framework/interactionMenu-framework.md @@ -27,6 +27,8 @@ The simplest action is just a condition and statement. The code to these are pas ## 2. Adding actions via config +### 2.1 Class interactions + Example: ```cpp @@ -59,6 +61,10 @@ class CfgVehicles { | `distance` | Number | External Base Actions Only, Max distance player can be from action point | | `position` | String (of code) | External Base Actions Only, Code to return a position in model cords (priority over `selection`) | | `selection` | String | External Base Actions Only, A memory point for `selectionPosition` | +| `doNotCheckLOS` | Number | (1=true) - Ignores blocked LOS to the interaction node even when beyond 1.2m | +| `showDisabled` | Number | Currently has no effect | +| `enableInside` | Number | Currently has no effect | +| `canCollapse` | Number | Currently has no effect | Actions can be inserted anywhere on the config tree, e.g. hearing's earplugs is a sub action of `ACE_Equipment`: @@ -72,6 +78,61 @@ class CAManBase: Man { }; ``` +Interaction exceptions are defined by several components: + +| Component | Exception | Description | +| ---------- | ----------- | ------------------- | +| `captives` | `"isNotEscorting"` | Can interact while escorting a captive | +| | `"isNotHandcuffed"` | Can interact while handcuffed | +| | `"isNotSurrendering"` | Can interact while surrendering | +| `common` | `"isNotDead"` | Can interact while dead | +| | `"notOnMap"` | Can interact while in Map | +| | `"isNotInside"` | Can interact while inside a vehicle | +| | `"isNotInZeus"` | Can interact while in the zeus interface | +| | `"isNotUnconscious"` | Can interact while unconscious | +| `dragging` | `"isNotDragging"` | Can interact while dragging | +| | `"isNotCarrying"` | Can interact while carrying | +| `interaction` | `"isNotSwimming"` | Can interact while swimming/diving | +| | `"isNotOnLadder"` | Can interact while climbing a ladder | +| `refuel` | `"isNotRefueling"` | Can interact while carrying refueling nozzle | +| `sitting` | `"isNotSitting"` | Can interact while sitting in a chair | + +### 2.2 Vehicle interactions based on animations + +Some classes (usually vehicles) might have `AnimationSources` defined, which can hide/show e.g. spare wheels, ammo boxes, tools, doors etc. ACE offers a framework to be able to interact with those animations, which would allow players to e.g. remove the spare wheel from the vehicle, by hiding the spare wheel and spawning in a wheel object. + +{% raw %} +```cpp +class Car_F; +class Offroad_01_base_F: Car_F { + class ace_interaction_anims { + class HideBackpacks { // Class name of the animation (has to be defined in 'AnimationSources' of the class, with scope > 0) + phase = 0; // The phase which is set after the action has successfully completed (default: 1) + // At least 1 selection or position must be defined, otherwise an error will be raised and the interaction not added + // Both selections[] and positions[] can be used at the same time + selections[] = {"vhc_bags"}; // Selections where to have the interaction appear, equivalent to "_target selectionPosition 'vhc_bags'" if put in positions[] (default: []) + positions[] = {{-1.15, -1.15, -0.2}, "_target selectionPosition ['vhc_bags', 'FireGeometry', 'AveragePoint']"}; // Positions where to have the interaction appear. It can either be model coordinates (in the array format) or a string containing code which returns model coordinates (default: []) + items[] = {"B_TacticalPack_blk", "ACE_Wheel", "ACE_EntrenchingTool"}; // Items to spawn in when the progress bar finishes successfully (default: []) + name = "$STR_a3_cfgvehicleclasses_backpacks0"; // Interaction name to display when interacting with the object (default: localised version of "Take it off") + icon = "\A3\ui_f\data\igui\cfg\actions\take_ca.paa"; // Interaction icon to display when interacting with the object (default: "\A3\ui_f\data\igui\cfg\actions\take_ca.paa") + text = "Removing backpacks..."; // Text to display in the progress bar (default: "") + duration = 10; // Sets the progress bar duration (default: 10 seconds) + distance = 2; // Sets at which distance the interactions can be accessed (default: 2) + enabled = 1; // Enables (1) or disables (0) the interaction (default: 1) + }; + }; +}; +``` +{% endraw %} + +Individual animations can have the items they spawn in changed dynamically using a variable. If you set the items to `[]`, it will disable the interaction from completing (the progress bar will play, but once it reaches the end, it will stop and fail): +```sqf +_target setVariable [format ["ace_interaction_animsItems_%1", _anim], ["B_TacticalPack_blk"], true]; + +// To disable the interaction from the example above +_target setVariable ["ace_interaction_animsItems_HideBackpacks", [], true]; +``` + ## 3. Adding actions via scripts Two steps, creating an action (array) and then adding it to either a class or object. @@ -110,6 +171,7 @@ Important: `ace_common_fnc_canInteractWith` is not automatically checked and nee * 2: Parent path of the new action <ARRAY> * 3: Action <ARRAY> * 4: Use Inheritance (Default: False) <BOOL><OPTIONAL> + * 5: Classes excluded from inheritance (children included) (Default: []) <ARRAY><OPTIONAL> */ ``` By default this function will not use inheritance, so actions will only be added to the specific class. @@ -169,6 +231,10 @@ Using `addActionToClass` inheritance: _action = ["CheckFuel", "Check Fuel", "", {hint format ["Fuel: %1", fuel _target]}, {true}] call ace_interact_menu_fnc_createAction; ["LandVehicle", 0, ["ACE_MainActions"], _action, true] call ace_interact_menu_fnc_addActionToClass; +// Same as above, but children of "MRAP_01_Base" will not have the action +_action = ["CheckFuel", "Check Fuel", "", {hint format ["Fuel: %1", fuel _target]}, {true}] call ace_interact_menu_fnc_createAction; +["LandVehicle", 0, ["ACE_MainActions"], _action, true, ["MRAP_01_Base"]] call ace_interact_menu_fnc_addActionToClass; + // Adds action to check external fuel levels on tanks. Will be a sub action of the previous action. _action = ["CheckExtTank","Check External Tank","",{hint format ["Ext Tank: %1", 5]},{true}] call ace_interact_menu_fnc_createAction; ["Tank_F", 0, ["ACE_MainActions", "CheckFuel"], _action, true] call ace_interact_menu_fnc_addActionToClass; diff --git a/docs/wiki/framework/javelin-framework.md b/docs/wiki/framework/javelin-framework.md index ba2a390f309..136066f4dbd 100644 --- a/docs/wiki/framework/javelin-framework.md +++ b/docs/wiki/framework/javelin-framework.md @@ -18,7 +18,7 @@ version: class CfgWeapons { class MyLauncher { ace_javelin_enabled = 1; // Enable Javelin-style locking (0-disabled, 1-enabled) - weaponInfoType = "ACE_RscOptics_javelin"; // Inteface + weaponInfoType = "ACE_RscOptics_javelin"; // Interface modelOptics = "\z\ace\addons\javelin\data\reticle_titan.p3d"; // Optics model canLock = 0; // Disable vanilla locking (0-disabled, 1-enabled) lockingTargetSound[] = {"", 0, 1}; // Locking sound diff --git a/docs/wiki/framework/magazine-repack-framework.md b/docs/wiki/framework/magazine-repack-framework.md new file mode 100644 index 00000000000..b14272227e2 --- /dev/null +++ b/docs/wiki/framework/magazine-repack-framework.md @@ -0,0 +1,26 @@ +--- +layout: wiki +title: Magazine Repack Framework +description: Explains how to disable repacking. +group: framework +order: 5 +parent: wiki +mod: ace +version: + major: 3 + minor: 18 + patch: 0 +--- + +## 1. Config Values + +### 1.1 Disable Magazine Repacking + +```cpp +class CfgMagazines { + class MyMagazine { + // Disables the ability to repack this magazine + ace_disableRepacking = 1; + }; +}; +``` diff --git a/docs/wiki/framework/medical-framework.md b/docs/wiki/framework/medical-framework.md index 00d9133b004..c0e94b5f9ee 100644 --- a/docs/wiki/framework/medical-framework.md +++ b/docs/wiki/framework/medical-framework.md @@ -241,3 +241,10 @@ The damage elements are sorted in descending order according to how much damage Some of ACE Medical's underlying behavior, primarily related to damage handling and the vitals loop, can be fine-tuned by editing `ace_medical_const_` variables, found in [script_macros_medical.hpp](https://github.com/acemod/ACE3/blob/master/addons/medical_engine/script_macros_medical.hpp). Modification of those values should be done by advanced users only. Values and variable names are subject to change without prior warning. Modifying values mid-mission may lead to undefined behavior. Expect minimal support. + +### 5.1 Disable seat locking for unconscious +ACE will lock the seat of an unconscious or dead unit to prevent automatic unloading. This can be disabled by setting: +```sqf +ace_medical_engine_disableSeatLocking = true; // disable on everything +ace_medical_engine_disableSeatLocking = ["ship"]; // disable just on boats +``` diff --git a/docs/wiki/framework/missile-guidance-framework.md b/docs/wiki/framework/missile-guidance-framework.md index ff6859d735c..4264f7a1d68 100644 --- a/docs/wiki/framework/missile-guidance-framework.md +++ b/docs/wiki/framework/missile-guidance-framework.md @@ -27,10 +27,10 @@ Finally, flight profiles and mechanics for realistic missile simulations are als ## 2. Components -The framework is broken up into 3 major components: Locking Types, Seeker Types and Attack Profiles. In combination, these components build out the entire process of launching, locking and going terminal flight against targets. +The framework is broken up into 3 major components: Navigation Types, Seeker Types and Attack Profiles. In combination, these components build out the entire process of launching, locking and going terminal flight against targets. -#### 2.1 Locking Types -Locking types provide the basic functionality of targeting which will be based to a seeker type, providing target acquisition for seekers. This provides the basic functionality for providing pre-determined targets for a seeker, or allowing the seeker to perform its own target acquisition and locking. Additionally, the seeker may reference back into the locking type in order to re-perform target acquisition. +#### 2.1 Navigation Types +Navigation types define how the missile flies to the designated target. ACE 3 implements the most common ones in use, Proportional Navigation, Augmented Proportional Navigation, and Zero-Effort Miss. These navigation types give an acceleration command to the missile who attempts to satisfy the command by adjusting its pitch and yaw to fly to the target. #### 2.2 Seeker Types Each seeker is generally assumed to be the logic for the seeker head unit within any given munition. Seekers within this framework provide the basic targeting functionality for the entire framework. The locking type will provide a generic target to the seeker, or the seeker may aquire a target on its own. The seeker then provides a target, either an object or a ASL position, which is then passed further into the framework. This target (or position) should be the actual current target position for the missiles flight. Seekers are required to perform all limitations and checks within their systems, although various limitations have been provided in this framework such as LOS FOV, laser guidance, etc. @@ -42,9 +42,9 @@ An attack profile adjusts the current target flight location to create the actua ## 3. How it all ties together -The system is executed in a linear series of calls to each step of the process, and feeding back the return from that step to the next step. Execution is conducted using Locking -> Seeker -> Profile, iteratively every frame of execution. Flight times are adjusted to `accTime` values and FPS lag, giving consistent flight. +The system is executed in a linear series of calls to each step of the process, and feeding back the return from that step to the next step. Execution is conducted using Seeker -> Profile -> Navigation, iteratively every frame of execution. Flight times are adjusted to `accTime` values and FPS lag, giving consistent flight. -On each step of execution, a target specification array `[targetObj, targetPos]` is passed to the locking type, which then will return a possible modified target array. Next, this modified data is passed to the seeker type - which then, in turn, returns a position vector to the current "seeked" target position (ASL). Last, this target position is passed to the attack profile, which then returns an "adjusted attack position" (ASL), which is the location the missile should *currently* be homing on for flight. +On each step of execution, the seeker finds and returns the position of its target (ASL) and, optionally, sets target data specifying the target's direction from the missile, range, velocity and acceleration (if able). Then, this data is passed to the attack profile, which then returns an "adjusted attack position" (ASL), which is the location the missile should *currently* be homing on for flight. Finally, the navigation system processes the seeker's data about the target and returns a "Commanded Acceleration" vector which the missile attempts to satisfy. In the simplest sense, the entire system provides the flight trajectory of the missile homing directly on the "adjusted attack position"; thus, an attack profile would ajust this position to direct the missile. For example, top down attacks return the adjusted attack position high above the target, until entering their terminal stages, which then changes the position to be directly on top of the target - thus "walking the missile" along its flight path and to the impact. @@ -60,28 +60,47 @@ class CfgAmmo { // Begin ACE guidance Configs class ace_missileguidance { - enabled = 1; // Enable missile guidance (0-disabled, 1-enabled) - - minDeflection = 0.00025; // Minimum flap deflection for guidance - maxDeflection = 0.001; // Maximum flap deflection for guidance - incDeflection = 0.0005; // The increment in which deflection adjusts - - canVanillaLock = 0; // Enable vanilla lock, only applicable to non-cadet modes, 'recruit' always uses vanilla locking (0-disabled, 1-enabled) - - defaultSeekerType = "SALH"; // Default seeker type - seekerTypes[] = {"SALH", "LIDAR", "SARH", "Optic", "Thermal", "GPS", "SACLOS", "MCLOS"}; // Seeker types available - - defaultSeekerLockMode = "LOAL"; // Default seeker lock mode - seekerLockModes[] = {"LOAL", "LOBL"}; // Seeker lock modes available - - seekerAngle = 90; // Angle in front of the missile which can be searched - seekerAccuracy = 1; // Seeker accuracy multiplier - - seekerMinRange = 1; // Minimum range from the missile which the seeker can visually search - seekerMaxRange = 2500; // Maximum from the missile which the seeker can visually search - - defaultAttackProfile = "LIN"; // Default attack profile - attackProfiles[] = {"LIN", "DIR", "MID", "HI"}; // Attack profiles available + enabled = 1; // Explicit enabling of the system + + pitchRate = 30; // How many degrees/second the missile can pitch + yawRate = 30; // How many degrees/second this missile can yaw + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "SALH"; // Default seeker type + seekerTypes[] = { "SALH", "LIDAR", "SARH", "Optic", "Thermal", "GPS", "SACLOS", "MCLOS" }; + + defaultSeekerLockMode = "LOAL"; // Default lock mode + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "Direct"; // Default navigation type + navigationTypes[] = { "Direct", "ZeroEffortMiss" }; // Navigation types this missile can use + + seekLastTargetPos = 1; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 70; // Angle in front of the missile which can be searched + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 1; // Minimum range from the missile which the seeker can visually search + seekerMaxRange = 8000; // Maximum range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "hellfire"; // Default attack profile + attackProfiles[] = {"hellfire", "hellfire_hi", "hellfire_lo"}; // Possible attack profiles + + // State machine defining what navigation type to use in this missiles phase + class navigationStates { + class initial { + transitionCondition = "my_fnc_navigationTransition"; // Condition needed to transition to next state + navigationType = "Direct"; // Navigation type to use in this state + }; + class terminal { + transitionCondition = ""; + navigationType = "ZeroEffortMiss"; + }; + // transitions from initial -> termimal + states[] = {"initial", "terminal"}; + }; }; ``` @@ -95,6 +114,7 @@ class ace_missileguidance_seekerTypes { description = ""; // Description functionName = "my_fnc_doSeekerType"; // Function that handles the seeker type + onFired = "my_fnc_onFired"; // Function that runs when the missile is fired using this seeker }; }; ``` @@ -109,13 +129,47 @@ class ace_missileguidance_attackProfiles { description = ""; // Description functionName = "my_fnc_doAttackProfile"; // Function that handles the attack profile + onFired = "my_fnc_onFired"; // Function that runs when missile is fired using this attack profile + }; +}; +``` + +### 4.4 Custom Navigation Type +```cpp +class ace_missileguidance_navigationTypes { + class MyNavigationProfile { + functionName = "my_fnc_navigation"; // Function to run for navigation + onFired = "my_fnc_onFired"; // Function to run when the missile is fired with this navigation type }; }; ``` -## 5. Events +## 5. Migrating From Old Missile Guidance + +There are a few changes existing missiles need to implement to work with the new framework. Although sensible defaults are used, they may not be sufficient for all users + +### 5.1 Turn Rate + +`minDeflection`, `maxDeflection`, and `incDeflection` are all deprecated. These values were never used before, and had no meaning. The new system one should use is through `pitchRate` and `yawRate`: these describe the missiles rotation in pitch and yaw in degrees/second + +### 5.2 Navigation + +Missiles before didn't have any navigation logic. The new framework utilizes a navigation autopilot to guide the missile. You must add `defaultNavigationType`, `navigationTypes` and `navigationGain` to your missiles. + +### 5.2.1 Available Navigation Types + +| Navigation Name | Description | Use Case | Caveats | +| ---------- | ----------- | ------------------- | ------- | +| `Direct` | Adjusts missile direction so it is always pointing at the target | If you have a static target that doesn't need movement prediction | N/A | +| `Line` | Attempts to drive missile so the direction to the target is zero | Any missile which needs to follow a line | Can only be used with some seekers | +| `LineOfSight` | Accelerations missile to null-out the line-of-sight rate of change to try and intercept target | Old missiles which have a low-hit rate that predict target motion | N/A | +| `ProportionalNavigation` | Adjusts missile to enter collision course with target | Missiles which intercept by predicting target motion | N/A | +| `AugmentedProportionalNavigation` | Adjusts missile to enter collision course with target while taking into account target acceleration to reduce energy loss | Missiles which intercept by predicting target motion | N/A | +| `ZeroEffortMiss` | Adjusts missile to enter collision course with target with minimal energy loss | Missiles which intercept by predicting target motion | N/A | + +## 6. Events -### 5.1 Listenable +### 6.1 Listenable | Event Name | Description | Passed Parameter(s) | Locality | | ---------- | ----------- | ------------------- | -------- | diff --git a/docs/wiki/framework/nightvision-framework.md b/docs/wiki/framework/nightvision-framework.md index 5f91421b8d2..939398ee280 100644 --- a/docs/wiki/framework/nightvision-framework.md +++ b/docs/wiki/framework/nightvision-framework.md @@ -43,3 +43,10 @@ Additional color presets ```cpp ace_nightvision_colorPreset[] = {0.0, {0.0, 0.0, 0.0, 0.0}, {1.1, 0.8, 1.9, 0.9}, {1, 1, 6, 0.0}}; // White Phosphor Preset ``` + +## 3. Brightness Limits + +```cpp +ace_nightvision_const_maxBrightness = 0; // Defaults, change at your leisure +ace_nightvision_const_minBrightness = -6; +``` diff --git a/docs/wiki/framework/safemode-framework.md b/docs/wiki/framework/safemode-framework.md new file mode 100644 index 00000000000..540254fdfa1 --- /dev/null +++ b/docs/wiki/framework/safemode-framework.md @@ -0,0 +1,58 @@ +--- +layout: wiki +title: Safemode Framework +description: Explains how to use the weapon safety API. +group: framework +order: 5 +parent: wiki +mod: ace +version: + major: 3 + minor: 0 + patch: 0 +--- + +## 1. Scripting + +### 1.1 Setting weapon safety status + +`ace_safemode_fnc_setWeaponSafety` +If you want the state of the currently selected muzzle, either pass the muzzle by name or leave it blank (= `nil`). +If the unit doesn't have a weapon, its safety can't be locked, but it can be unlocked. + +```sqf + * Lock or unlock the given weapon based on weapon state. + * + * Arguments: + * 0: Unit <OBJECT> + * 1: Weapon <STRING> + * 2: State <BOOL> + * 3: Show hint <BOOL> (default: true) + * 4: Muzzle <STRING> (default: current muzzle of weapon) + * + * Return Value: + * None + * + * Example: + * [ACE_player, currentWeapon ACE_player, true] call ace_safemode_fnc_setWeaponSafety +``` + +### 1.2 Getting weapon safety status + +`ace_safemode_fnc_getWeaponSafety` +If you want the state of the currently selected muzzle, either pass the muzzle by name or leave it blank (= `nil`). + +```sqf + * Getter for weapon safety state. + * + * Arguments: + * 0: Unit <OBJECT> + * 1: Weapon <STRING> + * 2: Muzzle <STRING> (default: current muzzle of weapon) + * + * Return Value: + * Safety status <BOOL> + * + * Example: + * [ACE_player, currentWeapon ACE_player] call ace_safemode_fnc_getWeaponSafety +``` diff --git a/docs/wiki/framework/ui-framework.md b/docs/wiki/framework/ui-framework.md index 3b6ec089514..095025ffe0b 100644 --- a/docs/wiki/framework/ui-framework.md +++ b/docs/wiki/framework/ui-framework.md @@ -71,3 +71,12 @@ Adding new elements through scripting is currently not possible. | 1 | `true` | Set element, preventing others to change it (except config, which always has priority) | | 2 | `"ammoCount"` | Element name to modify | | 3 | `false` | Hide the element | + +### 2.2 Hide UI Keybind + +There is a keybind that will hide most UI elements (<kbd>Ctrl</kbd>-<kbd>F12</kbd> by default). +It triggers an event that is listenable allowing other mods to hide their displays. + +| Event Key | Parameters | Locality | Type | Description | +|---------- |------------|----------|------|-------------| +| `ace_ui_hideHud` | `[_set]` | Local | Listen | _set=true means things should be hidden \ No newline at end of file diff --git a/docs/wiki/framework/vehicledamage-framework.md b/docs/wiki/framework/vehicledamage-framework.md index 04137e9c737..afda3f82f79 100644 --- a/docs/wiki/framework/vehicledamage-framework.md +++ b/docs/wiki/framework/vehicledamage-framework.md @@ -73,7 +73,7 @@ Default: 0 Whether or not this vehicle can spawn a `jet` effect (Boolean value: 0 or 1) -Default: 0 +Default: 1 #### 1.1.10 `ace_vehicle_damage_slatHitpoints` @@ -89,9 +89,9 @@ Default: {} #### 1.1.12 `ace_vehicle_damage_turret` -String for turret classname to spawn when catastrophically destroyed. Turret will pop-off and this is the class spawned +String for turret classname to spawn when catastrophically destroyed, followed by offset the object should spawn with. Turret will pop-off and this is the class spawned -Default: "" +Default: {} ### 1.2 Defined Hitpoints diff --git a/docs/wiki/functions/index.md b/docs/wiki/functions/index.md index 8bd725e3efa..beb8b4eec6a 100644 --- a/docs/wiki/functions/index.md +++ b/docs/wiki/functions/index.md @@ -23,7 +23,7 @@ parent: wiki <div class="large-12 columns"> <nav> <ul class="columns"> - {% assign pages_list = site.pages | sort: "title" %} + {% assign pages_list = site.pages | sort_natural: "title" %} {% assign group = 'functions' %} {% include pages_list %} </ul> diff --git a/extension/Cargo.lock b/extension/Cargo.lock new file mode 100644 index 00000000000..f729fde7f66 --- /dev/null +++ b/extension/Cargo.lock @@ -0,0 +1,122 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "arma-rs" +version = "1.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d8855a5dce884e6b98caa2aaeeabeb350dd05d94908054998b0a8191ecf6ab2" +dependencies = [ + "arma-rs-proc", + "crossbeam-queue", + "libc", + "link_args", + "log", +] + +[[package]] +name = "arma-rs-proc" +version = "1.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c177e120733d13a150d2f6bedf3f5012bb19b720e430db9e8ace7ecc1609eb8" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "crossbeam-queue" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cd42583b04998a5363558e5f9291ee5a5ff6b49944332103f251e7479a82aa7" +dependencies = [ + "cfg-if", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51887d4adc7b564537b15adcfb307936f8075dfcd5f00dde9a9f1d29383682bc" +dependencies = [ + "cfg-if", + "once_cell", +] + +[[package]] +name = "extension" +version = "0.1.0" +dependencies = [ + "arma-rs", +] + +[[package]] +name = "libc" +version = "0.2.132" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8371e4e5341c3a96db127eb2465ac681ced4c433e01dd0e938adbef26ba93ba5" + +[[package]] +name = "link_args" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c7721e472624c9aaad27a5eb6b7c9c6045c7a396f2efb6dabaec1b640d5e89b" + +[[package]] +name = "log" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "once_cell" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "074864da206b4973b84eb91683020dbefd6a8c3f0f38e054d93954e891935e4e" + +[[package]] +name = "proc-macro2" +version = "1.0.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a2ca2c61bc9f3d74d2886294ab7b9853abd9c1ad903a3ac7815c58989bb7bab" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "syn" +version = "1.0.99" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58dbef6ec655055e20b86b15a8cc6d439cca19b667537ac6a1369572d151ab13" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4f5b37a154999a8f3f98cc23a628d850e154479cd94decf3414696e12e31aaf" diff --git a/extension/Cargo.toml b/extension/Cargo.toml new file mode 100644 index 00000000000..a50d1e16bc7 --- /dev/null +++ b/extension/Cargo.toml @@ -0,0 +1,23 @@ +[package] +name = "ace" +version = "0.1.0" +edition = "2021" + +[lib] +name = "ace" +crate-type = ["cdylib"] + +[dependencies] +arma-rs = { version = "1.11.10", default-features = false, features = ["extension", "uuid"]} +uuid = { version = "1.10.0", features = ["v4"] } +rand = "0.8.5" +rand_chacha = "0.3.1" + +# Artillery +rayon = "1.10.0" + +# Clipboard +arboard = { version = "3.4.0" } + +[build-dependencies] +git2 = "0.19.0" diff --git a/extension/Makefile.toml b/extension/Makefile.toml new file mode 100644 index 00000000000..3002e34dccf --- /dev/null +++ b/extension/Makefile.toml @@ -0,0 +1,59 @@ +[tasks.install_x32] +command = "rustup" +args = ["toolchain", "install", "stable-i686-pc-windows-msvc"] + +[tasks.build_x64_debug] +install_crate = false +command = "cargo" +args = ["+stable-x86_64-pc-windows-msvc", "build"] + +[tasks.build_x64_release] +install_crate = false +command = "cargo" +args = ["+stable-x86_64-pc-windows-msvc", "build", "--release"] + +[tasks.build_x32_debug] +install_crate = false +command = "cargo" +args = ["+stable-i686-pc-windows-msvc", "build", "--target", "i686-pc-windows-msvc"] +dependencies = ["install_x32"] + +[tasks.build_x32_release] +install_crate = false +command = "cargo" +args = ["+stable-i686-pc-windows-msvc", "build", "--release", "--target", "i686-pc-windows-msvc"] +dependencies = ["install_x32"] + +[tasks.move_x64_debug] +script_runner = "@shell" +script = ''' +cp ../target/debug/ace.dll ../ace_x64.dll +''' +dependencies = ["build_x64_debug"] + +[tasks.move_x64_release] +script_runner = "@shell" +script = ''' +cp ../target/release/ace.dll ../ace_x64.dll +''' +dependencies = ["build_x64_release"] + +[tasks.move_x32_debug] +script_runner = "@shell" +script = ''' +cp ../target/i686-pc-windows-msvc/debug/ace.dll ../ace.dll +''' +dependencies = ["build_x32_debug"] + +[tasks.move_x32_release] +script_runner = "@shell" +script = ''' +cp ../target/i686-pc-windows-msvc/release/ace.dll ../ace.dll +''' +dependencies = ["build_x32_release"] + +[tasks.debug] +dependencies = ["move_x32_debug", "move_x64_debug"] + +[tasks.release] +dependencies = ["move_x32_release", "move_x64_release"] diff --git a/extension/build.rs b/extension/build.rs new file mode 100644 index 00000000000..ff34330567b --- /dev/null +++ b/extension/build.rs @@ -0,0 +1,13 @@ +fn main() { + if let Ok(repo) = git2::Repository::open("../") { + let head = repo + .head() + .expect("Get HEAD") + .target() + .expect("Get HEAD target"); + let commit = repo.find_commit(head).expect("Find commit"); + println!("cargo:rustc-env=GIT_HASH={}", commit.id()); + } else { + println!("cargo:rustc-env=GIT_HASH=GIT_REPO_FAILURE"); + } +} diff --git a/extension/src/artillery/mod.rs b/extension/src/artillery/mod.rs new file mode 100644 index 00000000000..7718192fcb1 --- /dev/null +++ b/extension/src/artillery/mod.rs @@ -0,0 +1,466 @@ +use std::f64::consts::{FRAC_PI_2, FRAC_PI_4, PI}; + +use arma_rs::{Context, Group}; +use rayon::prelude::*; + +use crate::common::{Height, MuzzleVelocity, Temperature, GRAVITY}; + +mod simulate; + +pub fn group() -> Group { + Group::new() + .command("calculate_table", command_calculate_table) + .command("simulate_shot", simulate::shot) + .command("find_max_angle", find_max_angle) + .command("simulate_find_solution", simulate::find_solution) + .command("get_solution", command_get_solution) +} + +fn command_calculate_table( + ctx: Context, + muzzle_velocity: MuzzleVelocity, + air_friction: f64, + min_elev: f64, + max_elev: f64, + high_arc: bool, +) -> (f64, u32) { + let mut min_elev = ((PI / 180.0) * min_elev).max(2.0 * (PI / 180.0)); // cap min to 2 degrees (negative elev might get messy) + let mut max_elev = ((PI / 180.0) * max_elev).min(88.0 * (PI / 180.0)); // cap max to 88 degrees (mk6) + let (best_angle, best_distance) = find_max_angle(muzzle_velocity, air_friction); + if high_arc { + min_elev = min_elev.max(best_angle); + } else { + max_elev = max_elev.min(best_angle); + } + let loop_start = if best_distance < 4000.0 { 50 } else { 100 }; + let loop_inc = if best_distance < 5000.0 { 50 } else { 100 }; // simplify when range gets high + let loop_max_range = best_distance.min(30000.0) as u32; // with no air resistance, max range could go higher than 60km + + let ranges = (loop_start..loop_max_range).step_by(loop_inc); + let ranges_size = ranges.len(); + + std::thread::spawn(move || { + if max_elev > min_elev { + ranges + .collect::<Vec<u32>>() + .into_par_iter() + .enumerate() + .for_each(|(idx, range)| { + if let Err(e) = ctx.callback_data( + "ace:artillery", + "calculate_table", + ( + idx as u32, + calc_range_table_line( + f64::from(range), + muzzle_velocity, + air_friction, + high_arc, + min_elev, + max_elev, + ), + ), + ) { + eprintln!("calculate table error: {e:?}"); + } + }); + } + }); + (best_distance, ranges_size as u32) +} + +#[allow(clippy::too_many_arguments)] +fn command_get_solution( + range_to_hit: f64, + height_of_target: Height, + muzzle_velocity: MuzzleVelocity, + air_friction: f64, + high_arc: bool, + cross_wind: f64, + tail_wind: f64, + temperature: Temperature, + air_density: f64, +) -> (f64, f64, f64) { + let (distance, elevation, _) = simulate::find_solution( + range_to_hit, + height_of_target, + muzzle_velocity, + air_friction, + high_arc, + 0.0, + FRAC_PI_2, + temperature, + air_density, + ); + if distance == -1.0 { + return (-1.0, -1.0, -1.0); + } + let (mut x_sim, mut y_sim, mut tof) = simulate::shot( + elevation, + height_of_target, + muzzle_velocity, + air_friction, + cross_wind, + tail_wind, + temperature, + air_density, + ); + let mut y_offset = range_to_hit - y_sim; + let mut y_correction = -y_offset; + while (distance + y_offset) - range_to_hit > 1.0 { + let (_, elevation, _) = simulate::find_solution( + range_to_hit + y_correction, + height_of_target, + muzzle_velocity, + air_friction, + high_arc, + 0.0, + FRAC_PI_2, + temperature, + air_density, + ); + (x_sim, y_sim, tof) = simulate::shot( + elevation, + height_of_target, + muzzle_velocity, + air_friction, + cross_wind, + tail_wind, + temperature, + air_density, + ); + y_offset = range_to_hit - y_sim; + y_correction -= y_offset; + } + let angle_correction = (x_sim / y_sim).atan(); + (elevation, tof, angle_correction) +} + +fn find_max_angle(muzzle_velocity: MuzzleVelocity, air_friction: f64) -> (f64, f64) { + if air_friction == 0.0 { + return (FRAC_PI_4, *muzzle_velocity * *muzzle_velocity / GRAVITY); + } + + let mut best_angle = FRAC_PI_4; + let mut best_distance = -1.0; + let mut test_angle = FRAC_PI_4; + loop { + let (_, result_distance, _) = simulate::shot( + test_angle, + Height::new(0.0), + muzzle_velocity, + air_friction, + 0.0, + 0.0, + Temperature::new_15c(), + 1.0, + ); + if result_distance > best_distance { + best_angle = test_angle; + best_distance = result_distance; + } + + test_angle -= FRAC_PI_4 / 100.0; + if test_angle <= 0.0 { + break; + } + } + (best_angle, best_distance) +} + +fn calc_range_table_line( + range_to_hit: f64, + muzzle_velocity: MuzzleVelocity, + air_friction: f64, + high_arc: bool, + min_elev: f64, + max_elev: f64, +) -> Option<Vec<String>> { + let (actual_distance, line_elevation, line_tof) = simulate::find_solution( + range_to_hit, + Height::new(0.0), + muzzle_velocity, + air_friction, + high_arc, + min_elev, + max_elev, + Temperature::new_15c(), + 1.0, + ); + if line_tof < 0.0 { + return None; + } + let (_, line_height_elevation, line_height_tof) = simulate::find_solution( + range_to_hit, + Height::new(-100.0), + muzzle_velocity, + air_friction, + high_arc, + min_elev, + max_elev, + Temperature::new_15c(), + 1.0, + ); + + let (dr_elev_adjust, dr_tof_adjust) = if line_height_elevation > 0.0 { + ( + format!( + "{:.1}", + (line_height_elevation - line_elevation) * 3200.0 / PI + ), + format!("{:.1}", line_height_tof - line_tof), + ) + } else { + (String::from("-"), String::from("-")) + }; + + let ( + crosswind_offset, + headwind_offset, + tailwind_offset, + temp_dec_offset, + temp_inc_offset, + air_density_dec_offset, + air_density_inc_offset, + ) = if air_friction == 0.0 { + ( + String::from("-"), + String::from("-"), + String::from("-"), + String::from("-"), + String::from("-"), + String::from("-"), + String::from("-"), + ) + } else { + ( + { + let (x_offset, _, _) = simulate::shot( + line_elevation, + Height::new(0.0), + muzzle_velocity, + air_friction, + 10.0, + 0.0, + Temperature::new_15c(), + 1.0, + ); + format!( + "{:0width$.1}", + x_offset.atan2(actual_distance) / 10.0 * 3200.0 / PI, + width = 1 + ) + }, + { + let (_, y_offset, _) = simulate::shot( + line_elevation, + Height::new(0.0), + muzzle_velocity, + air_friction, + 0.0, + -10.0, + Temperature::new_15c(), + 1.0, + ); + let headwind_offset = (actual_distance - y_offset) / 10.0; + format!( + "{:0width$.precision$}", + headwind_offset, + width = 1, + precision = if headwind_offset.abs() > 9.949 { 0 } else { 1 } + ) + }, + { + let (_, y_offset, _) = simulate::shot( + line_elevation, + Height::new(0.0), + muzzle_velocity, + air_friction, + 0.0, + 10.0, + Temperature::new_15c(), + 1.0, + ); + let tailwind_offset = (actual_distance - y_offset) / 10.0; + format!( + "{:0width$.precision$}", + tailwind_offset, + width = 1, + precision = if tailwind_offset.abs() > 9.949 { 0 } else { 1 } + ) + }, + { + let (_, y_offset, _) = simulate::shot( + line_elevation, + Height::new(0.0), + muzzle_velocity, + air_friction, + 0.0, + 0.0, + Temperature::new_celsius(5.0), + 1.0, + ); + let temp_dec_offset = (actual_distance - y_offset) / 10.0; + format!( + "{:0width$.precision$}", + temp_dec_offset, + width = 1, + precision = if temp_dec_offset.abs() > 9.949 { 0 } else { 1 } + ) + }, + { + let (_, y_offset, _) = simulate::shot( + line_elevation, + Height::new(0.0), + muzzle_velocity, + air_friction, + 0.0, + 0.0, + Temperature::new_celsius(25.0), + 1.0, + ); + let temp_inc_offset = (actual_distance - y_offset) / 10.0; + format!( + "{:0width$.precision$}", + temp_inc_offset, + width = 1, + precision = if temp_inc_offset.abs() > 9.949 { 0 } else { 1 } + ) + }, + { + let (_, y_offset, _) = simulate::shot( + line_elevation, + Height::new(0.0), + muzzle_velocity, + air_friction, + 0.0, + 0.0, + Temperature::new_15c(), + 0.9, + ); + let air_density_dec_offset = (actual_distance - y_offset) / 10.0; + format!( + "{:0width$.precision$}", + air_density_dec_offset, + width = 1, + precision = if air_density_dec_offset.abs() > 9.949 { + 0 + } else { + 1 + } + ) + }, + { + let (_, y_offset, _) = simulate::shot( + line_elevation, + Height::new(0.0), + muzzle_velocity, + air_friction, + 0.0, + 0.0, + Temperature::new_15c(), + 1.1, + ); + let air_density_inc_offset = (actual_distance - y_offset) / 10.0; + format!( + "{:0width$.precision$}", + air_density_inc_offset, + width = 1, + precision = if air_density_inc_offset.abs() > 9.949 { + 0 + } else { + 1 + } + ) + }, + ) + }; + + Some(vec![ + format!("{:.0}", range_to_hit), + format!("{:.0}", line_elevation * 3200.0 / PI), + dr_elev_adjust, + dr_tof_adjust, + format!( + "{:.precision$}", + line_tof, + precision = if line_tof < 99.945 { 1 } else { 0 } + ), + crosswind_offset, + headwind_offset, + tailwind_offset, + temp_dec_offset, + temp_inc_offset, + air_density_dec_offset, + air_density_inc_offset, + ]) +} + +#[cfg(test)] +mod tests { + use std::{ + sync::atomic::{AtomicI8, Ordering}, + time::Duration, + }; + + use arma_rs::{Extension, FromArma, Result, Value}; + + use crate::{artillery::command_calculate_table, common::MuzzleVelocity}; + + use super::find_max_angle; + + #[test] + fn test_find_max_angle() { + let (best_angle, best_distance) = find_max_angle(MuzzleVelocity::new(400.0), -0.00005); + assert!((best_angle - 0.730_420_291_959_627_2).abs() < f64::EPSILON); // old ace: 0.722566 + assert!((best_distance - 10_393.560_433_295_957).abs() < f64::EPSILON); // old ace: 10391.8 + } + + #[test] + fn range_table_line() { + let extension = Extension::build() + .command("calc", command_calculate_table) + .finish() + .testing(); + let (output, code) = extension.call( + "calc", + Some(vec![ + 400.0.to_string(), + (-0.00005).to_string(), + (-5.0).to_string(), + 80.0.to_string(), + true.to_string(), + ]), + ); + println!("{output:?}"); + let (best, lines): (f64, i8) = FromArma::from_arma(output).unwrap(); + assert!((best - 10_393.560_433_295_957).abs() < f64::EPSILON); + assert_eq!(lines, 103); + let recv: AtomicI8 = AtomicI8::new(0); + assert_eq!(code, 0); + let result = extension.callback_handler( + |name, func, data| { + recv.fetch_add(1, Ordering::SeqCst); + if name == "ace:artillery" && func == "calculate_table" { + if let Some(Value::Array(data)) = data { + if let Value::Array(line) = &data[1] { + if line[0] == Value::String(String::from("3500")) { + println!("data: {line:?}"); + } + } + } + if recv.load(Ordering::SeqCst) == lines { + Result::Ok(()) + } else { + Result::Continue + } + } else { + Result::Err(String::from("unexpected callback")) + } + }, + Duration::from_secs(10), + ); + println!("result: {result:?}"); + assert!(result.is_ok()); + } +} diff --git a/extension/src/artillery/simulate.rs b/extension/src/artillery/simulate.rs new file mode 100644 index 00000000000..2201d4d2ec9 --- /dev/null +++ b/extension/src/artillery/simulate.rs @@ -0,0 +1,174 @@ +use crate::common::{Height, MuzzleVelocity, Temperature, Vector3, GRAVITY, GRAVITY_ACCEL}; + +const TIME_STEP: f64 = 1.0 / 60.0; + +#[allow(clippy::too_many_arguments)] +pub fn shot( + fire_angle_rad: f64, + height_of_target: Height, + muzzle_velocity: MuzzleVelocity, + air_friction: f64, + cross_wind: f64, + tail_wind: f64, + temperature: Temperature, + air_density: f64, +) -> (f64, f64, f64) { + let k_coefficient = -1.0 * air_density * air_friction; + let powder_effects = if air_friction == 0.0 { + 1.0 + } else { + (temperature.as_kelvin() / 288.13 - 1.0) / 40.0 + 1.0 + }; + + let mut current_time = 0.0; + let mut current_position = Vector3::default(); + let mut last_position = Vector3::default(); + let mut current_velocity = Vector3::new( + 0.0, + powder_effects * *muzzle_velocity * fire_angle_rad.cos(), + powder_effects * *muzzle_velocity * fire_angle_rad.sin(), + ); + let wind = Vector3::new(cross_wind, tail_wind, 0.0); + + while current_velocity.z() > 0.0 || current_position.z() > *height_of_target { + last_position = current_position; + let apparent_wind = wind - current_velocity; + let change_in_velocity = + GRAVITY_ACCEL + apparent_wind * (k_coefficient * apparent_wind.magnitude()); + current_velocity += change_in_velocity * TIME_STEP; + current_position += current_velocity * TIME_STEP; + current_time += TIME_STEP; + } + + let last_current_ratio = + (*height_of_target - current_position.z()) / (last_position.z() - current_position.z()); + let final_pos = last_position.lerp(¤t_position, last_current_ratio); + + (final_pos.x(), final_pos.y(), current_time) +} + +#[allow(unused_assignments, clippy::too_many_arguments)] +pub fn find_solution( + range_to_hit: f64, + height_to_hit: Height, + muzzle_velocity: MuzzleVelocity, + air_friction: f64, + high_arc: bool, + min_elev: f64, + max_elev: f64, + temperature: Temperature, + air_density: f64, +) -> (f64, f64, f64) { + if air_friction == 0.0 { + let radicand = GRAVITY.mul_add( + -GRAVITY.mul_add( + range_to_hit.powi(2), + 2.0 * *height_to_hit * muzzle_velocity.powi(2), + ), + muzzle_velocity.powi(4), + ); + if range_to_hit == 0.0 || radicand < 0.0 { + return (-1.0, -1.0, -1.0); + } + let radicand = radicand.sqrt(); + let mut angle_root = + (muzzle_velocity.mul_add(*muzzle_velocity, radicand) / (GRAVITY * range_to_hit)).atan(); + if angle_root > max_elev || angle_root < min_elev { + angle_root = (muzzle_velocity.mul_add(*muzzle_velocity, -radicand) + / (GRAVITY * range_to_hit)) + .atan(); + } + if angle_root > max_elev || angle_root < min_elev { + return (-1.0, -1.0, -1.0); + } + let tof = range_to_hit / (*muzzle_velocity * angle_root.cos()); + return (range_to_hit, angle_root, tof); + } + + let mut number_of_attempts = 50; + let mut result_distance = -1.0; + let mut result_time = -1.0; + let mut search_min = min_elev; + let mut search_max = max_elev; + let mut current_error = 9999.0; + let mut current_elevation = -1.0; + loop { + number_of_attempts -= 1; + current_elevation = (search_min + search_max) / 2.0; + let (_, shot_distance, shot_time) = shot( + current_elevation, + height_to_hit, + muzzle_velocity, + air_friction, + 0.0, + 0.0, + temperature, + air_density, + ); + result_distance = shot_distance; + result_time = shot_time; + if !result_distance.is_nan() { + current_error = range_to_hit - result_distance; + } + if (current_error > 0.0) ^ !high_arc { + search_max = current_elevation; + } else { + search_min = current_elevation; + } + if number_of_attempts == 0 { + break; + } + if (search_max - search_min) <= 0.000_025 { + break; + } + } + if current_error.abs() > (range_to_hit * 0.001 * (if high_arc { 1.0 } else { 2.0 })) { + return (-1.0, -1.0, -1.0); + } + + (result_distance, current_elevation, result_time) +} + +#[cfg(test)] +mod tests { + use std::f64::consts::FRAC_PI_4; + + use crate::common::{Height, MuzzleVelocity, Temperature}; + + use super::shot; + + #[test] + fn test_shot() { + let (x, y, result_time) = shot( + FRAC_PI_4, + Height::new(0.0), + MuzzleVelocity::new(400.0), + -0.00005, + 0.0, + 0.0, + Temperature::new_15c(), + 1.0, + ); + assert!(x < f64::EPSILON); + assert!((y - 10_331.039_038_212_19).abs() < f64::EPSILON); // old ace: 10330.2 + assert!((result_time - 50.316_666_666_665_09).abs() < f64::EPSILON); // old ace: 50.3167 + } + + #[test] + fn find_solution() { + let (result_distance, current_elevation, result_time) = super::find_solution( + 1000.0, + Height::new(0.0), + MuzzleVelocity::new(400.0), + -0.00005, + true, + -5.0, + 80.0, + Temperature::new_15c(), + 1.0, + ); + assert!((result_distance - 999.628_737_358_452_9).abs() < f64::EPSILON); // old ace: 999.773 + assert!((current_elevation - 1.522_375_345_230_102_5).abs() < f64::EPSILON); // old ace: 1.52238 + assert!((result_time - 69.699_999_999_997_33).abs() < f64::EPSILON); // old ace: 69.7 + } +} diff --git a/extension/src/ballistics/atmosphere.rs b/extension/src/ballistics/atmosphere.rs new file mode 100644 index 00000000000..9781d6e5669 --- /dev/null +++ b/extension/src/ballistics/atmosphere.rs @@ -0,0 +1,138 @@ +use arma_rs::{FromArma, FromArmaError}; + +use super::map::Map; +use crate::common::Temperature; + +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum AtmosphereModel { + Icao, + Asm, +} + +impl FromArma for AtmosphereModel { + fn from_arma(s: String) -> Result<Self, FromArmaError> { + let s = s.trim_matches('"'); + match s.to_lowercase().as_str() { + "icao" => Ok(Self::Icao), + "asm" => Ok(Self::Asm), + _ => Err(FromArmaError::InvalidValue("unexpected model".into())), + } + } +} + +const ROUGHNESS_LENGTHS: [f64; 10] = [0.0002, 0.0005, 0.0024, 0.03, 0.055, 0.1, 0.2, 0.4, 0.8, 1.6]; +pub fn calculate_roughness_length(map: &Map, x: f64, y: f64) -> f64 { + let grid_x = (x / 50.0).floor() as i64; + let grid_y = (y / 50.0).floor() as i64; + let grid_cell = (grid_x * map.grids() as i64) + grid_y; + + if grid_cell >= 0 { + let grid_cell = grid_cell as usize; + if grid_cell < map.heights().len() && grid_cell < map.building_nums().len() { + let near_building_num = map.building_num(grid_cell); + let surface_is_water = map.surface_is_water(grid_cell); + + if near_building_num == 0 && surface_is_water { + return 0.0005; + } + + if near_building_num >= 10 { + return 1.6; + } + + return ROUGHNESS_LENGTHS[2 + std::cmp::min(near_building_num as usize, 6)]; + } + } + + 0.0024 +} + +const DRY_AIR_MOLAR_MASS: f64 = 0.028_964; +const WATOR_VAPOR_MOLAR_MASS: f64 = 0.018_016; +const UNIVERSAL_GAS_CONSTANT: f64 = 8.314_32; +const SPECIFIC_GAST_CONSTANT_DRY_AIR: f64 = UNIVERSAL_GAS_CONSTANT / DRY_AIR_MOLAR_MASS; +pub fn calculate_air_density( + temperature: Temperature, + pressure: f64, + relative_humidity: f64, +) -> f64 { + let pressure = pressure * 100.0; + if relative_humidity > 0.0 { + // 610.78 gives pressure in Pa - https://en.wikipedia.org/wiki/Density_of_air + let p_sat = 610.78 + * 10_f64.powf((7.5 * temperature.as_celsius()) / (temperature.as_celsius() + 237.3)); + let vapor_pressure = relative_humidity * p_sat; + let partial_pressure = pressure - vapor_pressure; + + partial_pressure.mul_add(DRY_AIR_MOLAR_MASS, vapor_pressure * WATOR_VAPOR_MOLAR_MASS) + / (UNIVERSAL_GAS_CONSTANT * temperature.as_kelvin()) + } else { + pressure / (SPECIFIC_GAST_CONSTANT_DRY_AIR * temperature.as_kelvin()) + } +} + +const STD_AIR_DENSITY_ICAO: f64 = 1.22498; +const STD_AIR_DENSITY_ASM: f64 = 1.20886; +pub fn calculate_atmospheric_correction( + ballistic_coefficient: f64, + temperature: Temperature, + pressure: f64, + relative_humidity: f64, + atmosphere_model: AtmosphereModel, +) -> f64 { + let air_density = calculate_air_density(temperature, pressure, relative_humidity); + match atmosphere_model { + AtmosphereModel::Icao => (STD_AIR_DENSITY_ICAO / air_density) * ballistic_coefficient, + AtmosphereModel::Asm => (STD_AIR_DENSITY_ASM / air_density) * ballistic_coefficient, + } +} + +pub fn speed_of_sound(temperature: Temperature) -> f64 { + 331.3 * (1.0 + temperature.as_celsius() / 273.15).sqrt() +} + +#[cfg(test)] +mod tests { + use crate::common::Temperature; + + #[test] + fn atmospheric_correction() { + assert!( + (super::calculate_atmospheric_correction( + 0.583, + Temperature::new_15c(), + 1005.0, + 0.0, + crate::ballistics::AtmosphereModel::Icao + ) - 0.587_784_746_752_856_4) + .abs() + < f64::EPSILON // previous ace: 0.580047 + ); + assert!( + (super::calculate_atmospheric_correction( + 0.263, + Temperature::new_celsius(25.3642), + 1009.61, + 0.603173, + crate::ballistics::AtmosphereModel::Icao + ) - 0.275_454_853_636_429_13) + .abs() + < f64::EPSILON // previous ace: 0.275444 + ); + } + + #[test] + fn speed_of_sound() { + assert!( + (super::speed_of_sound(Temperature::new_celsius(-15.0)) - 322.074_912_997_965_27).abs() + < f64::EPSILON + ); + assert!( + (super::speed_of_sound(Temperature::new_celsius(0.0)) - 331.3).abs() < f64::EPSILON + ); + assert!( + (super::speed_of_sound(Temperature::new_15c()) - 340.275_080_511_860_5).abs() + < f64::EPSILON + ); + } +} diff --git a/extension/src/ballistics/bullet/mod.rs b/extension/src/ballistics/bullet/mod.rs new file mode 100644 index 00000000000..721b7338337 --- /dev/null +++ b/extension/src/ballistics/bullet/mod.rs @@ -0,0 +1,131 @@ +use std::collections::HashMap; + +use arma_rs::Group; +use uuid::Uuid; + +use super::{ + atmosphere::AtmosphereModel, + drag::DragFunction, + map::{CURRENT_MAP, MAPS}, +}; +use crate::common::{Temperature, Vector3}; + +mod model; +pub use model::Bullet; + +pub fn group() -> Group { + Group::new() + .command("new", new) + .command("simulate", simulate) + .command("delete", delete) +} + +static mut BULLET_LIST: Option<HashMap<String, Bullet>> = None; + +#[allow(clippy::too_many_arguments)] +/// Create a new bullet and return its UUID. +fn new( + ammo_count: u64, + air_friction: f64, + ballistic_coefficients: Vec<f64>, + velocity_boundaries: Vec<f64>, + atmosphere_model: AtmosphereModel, + drag_function: DragFunction, + stability_factor: f64, + twist_direction: f64, + transonic_stability_coefficient: f64, + bullet_velocity: Vector3, + latitude: f64, + temperature: Temperature, + altitude: f64, + humidity: f64, + overcast: f64, + start_time: f64, +) -> Uuid { + let id = Uuid::new_v4(); + let bullet = Bullet { + air_friction, + ballistic_coefficients, + velocity_boundaries, + atmosphere_model, + drag_function, + stability_factor, + twist_direction, + transonic_stability_coefficient, + bullet_velocity_last_frame: bullet_velocity, + latitude: latitude / 180.0 * std::f64::consts::PI, + temperature, + altitude, + humidity, + overcast, + start_time, + last_frame: start_time, + rng: rand::SeedableRng::seed_from_u64({ + let k1 = (start_time / 2.0).round(); + let k2 = ammo_count as f64; + (0.5 * (k1 + k2)).mul_add(k1 + k2 + 1.0, k2) as u64 + }), + }; + // Safety: this is all single threaded, so no need to lock + unsafe { + if BULLET_LIST.is_none() { + BULLET_LIST = Some(HashMap::new()); + } + BULLET_LIST.as_mut().unwrap().insert(id.to_string(), bullet); + } + id +} + +/// Simulate a bullet for a given time. Returns the velocity +fn simulate( + id: String, + bullet_velocity: Vector3, + bullet_position: Vector3, + wind: Vector3, + altitude: f64, + time: f64, +) -> Result<Vector3, String> { + // Safety: this is all single threaded, so no need to lock + unsafe { + MAPS.as_ref().map_or_else( + || Err("No map loaded".to_string()), + |map| { + let bullet = { + if BULLET_LIST.is_none() { + BULLET_LIST = Some(HashMap::new()); + } + BULLET_LIST + .as_mut() + .unwrap() + .get_mut(&id) + .ok_or_else(|| "Bullet not found".to_string())? + }; + Ok(bullet.simulate( + map.get( + CURRENT_MAP + .as_ref() + .ok_or_else(|| "No current map".to_string())?, + ) + .ok_or_else(|| "Current map not loaded".to_string())?, + bullet_velocity, + bullet_position, + wind, + altitude, + time, + )) + }, + ) + } +} + +/// Delete a bullet +/// Returns true if the bullet was found and deleted +fn delete(id: String) -> bool { + // Safety: this is all single threaded, so no need to lock + unsafe { + if BULLET_LIST.is_none() { + BULLET_LIST = Some(HashMap::new()); + } + BULLET_LIST.as_mut().unwrap().remove(&id).is_some() + } +} diff --git a/extension/src/ballistics/bullet/model.rs b/extension/src/ballistics/bullet/model.rs new file mode 100644 index 00000000000..e08a6e6ecf3 --- /dev/null +++ b/extension/src/ballistics/bullet/model.rs @@ -0,0 +1,214 @@ +use std::f64::consts::PI; + +use rand::{distributions::Uniform, prelude::Distribution}; +use rand_chacha::ChaCha8Rng; + +use crate::{ + ballistics::{ + atmosphere::{ + calculate_air_density, calculate_atmospheric_correction, calculate_roughness_length, + speed_of_sound, AtmosphereModel, + }, + drag::{calculate_retard, DragFunction}, + map::Map, + }, + common::{Temperature, Vector3, GRAVITY_ACCEL}, +}; + +const STD_AIR_DENSITY_ICAO: f64 = 1.22498; + +pub struct Bullet { + pub air_friction: f64, + pub ballistic_coefficients: Vec<f64>, + pub velocity_boundaries: Vec<f64>, + pub atmosphere_model: AtmosphereModel, + pub drag_function: DragFunction, + pub stability_factor: f64, + pub twist_direction: f64, + pub transonic_stability_coefficient: f64, + pub bullet_velocity_last_frame: Vector3, + pub latitude: f64, + pub temperature: Temperature, + pub altitude: f64, + pub humidity: f64, + pub overcast: f64, + pub start_time: f64, + pub last_frame: f64, + pub rng: ChaCha8Rng, +} + +#[allow(clippy::too_many_lines)] +impl Bullet { + pub fn simulate( + &mut self, + map: &Map, + bullet_velocity_current_frame: Vector3, + bullet_position: Vector3, + mut wind: Vector3, + height_atl: f64, + tick_time: f64, + ) -> Vector3 { + const EARTH_ANGULAR_SPEED: f64 = 0.000_072_92; + let mut tof = tick_time - self.start_time; + let delta_time = tick_time - self.last_frame; + + let temperature = Temperature::new_celsius( + 0.0065f64.mul_add(-bullet_position.z(), self.temperature.as_celsius()), + ); + let pressure = 10.0f64.mul_add(-self.overcast, 1013.25) + * (1.0 + - (0.0065 * (self.altitude + bullet_position.z())) + / 0.0065f64.mul_add(self.altitude, temperature.as_kelvin())) + .powf(5.255_754_495); + + self.last_frame = tick_time; + + if wind.magnitude() > 0.1 { + let mut wind_attenuation = 1.0; + let wind_source_terrain = bullet_position - wind.normalize() * 100.0; + + let grid_x = (wind_source_terrain.x() / 50.0).floor() as i64; + let grid_y = (wind_source_terrain.y() / 50.0).floor() as i64; + let grid_cell = grid_x * map.grids() as i64 + grid_y; + + if grid_cell >= 0 { + let grid_cell = grid_cell as usize; + if grid_cell < map.heights().len() && grid_cell < map.building_nums().len() { + let grid_height = map.height(grid_cell) as f64; + if grid_height > bullet_position.z() { + let angle = ((grid_height - bullet_position.z()) / 100.0).atan(); + wind_attenuation *= angle.cos().abs().powi(2); + } + } + } + + if height_atl > 0.0 && height_atl < 20.0 { + let wind_source_obstacles = bullet_position - wind.normalize() * 25.0; + let roughness_length = calculate_roughness_length( + map, + wind_source_obstacles.x(), + wind_source_obstacles.y(), + ); + wind_attenuation *= + 0.0f64.max((height_atl / roughness_length).log(20.0 / roughness_length)); + } + + wind *= wind_attenuation; + } + + let mut velocity_offset = Vector3::default(); + + { + let mut bullet_velocity = self.bullet_velocity_last_frame; + let mut time = 0.0; + while time < delta_time { + let dt = (delta_time - time).min(0.005); + let drag_ref = -self.air_friction * bullet_velocity.magnitude_squared(); + let accel_ref = bullet_velocity.normalize() * drag_ref; + + velocity_offset += accel_ref * dt; + bullet_velocity -= accel_ref * dt; + bullet_velocity += GRAVITY_ACCEL * dt; + + time += dt; + } + } + + let mut bullet_velocity = self.bullet_velocity_last_frame; + let mut time = 0.0; + tof -= delta_time; + + while time < delta_time { + let dt = (delta_time - time).min(0.005 * 2.0); + + let mut true_velocity = bullet_velocity - wind; + + let sound_speed = speed_of_sound(temperature); + if self.transonic_stability_coefficient < 1.0 + && true_velocity.magnitude() < 1.2 * sound_speed + && true_velocity.magnitude() > sound_speed + { + let distribution = Uniform::from(-10.0..10.0); + let offset = Vector3::new( + distribution.sample(&mut self.rng), + distribution.sample(&mut self.rng), + distribution.sample(&mut self.rng), + ); + let coef = 1.0 - self.transonic_stability_coefficient; + let true_speed = true_velocity.magnitude(); + true_velocity += offset * coef; + true_velocity = true_velocity.normalize() * true_speed; + } + + let drag = if self.ballistic_coefficients.len() == self.velocity_boundaries.len() + 1 { + let mut ballistic_coefficient = self.ballistic_coefficients[0]; + for (i, boundry) in self.velocity_boundaries.iter().enumerate().rev() { + if true_velocity.magnitude() < *boundry { + ballistic_coefficient = self.ballistic_coefficients[i + 1]; + break; + } + } + + ballistic_coefficient = calculate_atmospheric_correction( + ballistic_coefficient, + temperature, + pressure, + self.humidity, + self.atmosphere_model, + ); + + calculate_retard( + self.drag_function, + ballistic_coefficient, + true_velocity.magnitude(), + speed_of_sound(temperature), + ) + } else { + let air_density = calculate_air_density(temperature, pressure, self.humidity); + let air_friction = self.air_friction * air_density / STD_AIR_DENSITY_ICAO; + + -air_friction * true_velocity.magnitude_squared() + }; + + let accel = true_velocity.normalize() * drag; + + velocity_offset -= accel * dt; + bullet_velocity -= accel * dt; + + if tof > 0.0 { + let bullet_dir = bullet_velocity.x().atan2(bullet_velocity.y()); + let drift_accel = self.twist_direction + * (0.048_225_1 * (self.stability_factor + 1.2)) + / tof.powf(0.17); + let drift_velocity = 0.058_102_5 * (self.stability_factor + 1.2) * tof.powf(0.83); + let drag_correction = (drift_velocity / true_velocity.magnitude()) * drag; + let magnitude = (drift_accel + drag_correction) * dt; + let offset = Vector3::new( + (bullet_dir + PI / 2.0).sin() * magnitude, + (bullet_dir + PI / 2.0).cos() * magnitude, + 0.0, + ); + velocity_offset += offset; + bullet_velocity += offset; + } + + let lat = self.latitude; + let accel = Vector3::new( + 2.0 * EARTH_ANGULAR_SPEED + * bullet_velocity + .y() + .mul_add(lat.sin(), -bullet_velocity.z() * lat.cos()), + 2.0 * EARTH_ANGULAR_SPEED * -(bullet_velocity.x() * lat.sin()), + 2.0 * EARTH_ANGULAR_SPEED * (bullet_velocity.x() * lat.cos()), + ); + + velocity_offset += accel * dt; + bullet_velocity += accel * dt + GRAVITY_ACCEL * dt; + + tof += dt; + time += dt; + } + self.bullet_velocity_last_frame = bullet_velocity_current_frame + velocity_offset; + velocity_offset + } +} diff --git a/extension/src/ballistics/drag.rs b/extension/src/ballistics/drag.rs new file mode 100644 index 00000000000..42401f075d1 --- /dev/null +++ b/extension/src/ballistics/drag.rs @@ -0,0 +1,199 @@ +#![allow(clippy::approx_constant)] + +use arma_rs::{FromArma, FromArmaError}; + +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum DragFunction { + G1, + G2, + G5, + G6, + G7, + G8, +} + +impl FromArma for DragFunction { + fn from_arma(s: String) -> Result<Self, FromArmaError> { + match s.as_str() { + "1" => Ok(Self::G1), + "2" => Ok(Self::G2), + "5" => Ok(Self::G5), + "6" => Ok(Self::G6), + "7" => Ok(Self::G7), + "8" => Ok(Self::G8), + _ => Err(FromArmaError::InvalidValue(format!( + "Unknown drag function: {s}" + ))), + } + } +} + +impl DragFunction { + #[must_use] + pub fn drag_coefficients(&self) -> Vec<f64> { + match self { + Self::G1 => vec![ + 0.2629, 0.2558, 0.2487, 0.2413, 0.2344, 0.2278, 0.2214, 0.2155, 0.2104, 0.2061, + 0.2032, 0.2020, 0.2034, 0.2165, 0.2230, 0.2313, 0.2417, 0.2546, 0.2706, 0.2901, + 0.3136, 0.3415, 0.3734, 0.4084, 0.4448, 0.4805, 0.5136, 0.5427, 0.5677, 0.5883, + 0.6053, 0.6191, 0.6393, 0.6518, 0.6589, 0.6621, 0.6625, 0.6607, 0.6573, 0.6528, + 0.6474, 0.6413, 0.6347, 0.6280, 0.6210, 0.6141, 0.6072, 0.6003, 0.5934, 0.5867, + 0.5804, 0.5743, 0.5685, 0.5630, 0.5577, 0.5527, 0.5481, 0.5438, 0.5397, 0.5325, + 0.5264, 0.5211, 0.5168, 0.5133, 0.5105, 0.5084, 0.5067, 0.5054, 0.5040, 0.5030, + 0.5022, 0.5016, 0.5010, 0.5006, 0.4998, 0.4995, 0.4992, 0.4990, 0.4988, + ], + Self::G2 => vec![ + 0.2303, 0.2298, 0.2287, 0.2271, 0.2251, 0.2227, 0.2196, 0.2156, 0.2107, 0.2048, + 0.1980, 0.1905, 0.1828, 0.1758, 0.1702, 0.1669, 0.1664, 0.1667, 0.1682, 0.1711, + 0.1761, 0.1831, 0.2004, 0.2589, 0.3492, 0.3983, 0.4075, 0.4103, 0.4114, 0.4106, + 0.4089, 0.4068, 0.4046, 0.4021, 0.3966, 0.3904, 0.3835, 0.3759, 0.3678, 0.3594, + 0.3512, 0.3432, 0.3356, 0.3282, 0.3213, 0.3149, 0.3089, 0.3033, 0.2982, 0.2933, + 0.2889, 0.2846, 0.2806, 0.2768, 0.2731, 0.2696, 0.2663, 0.2632, 0.2602, 0.2572, + 0.2543, 0.2515, 0.2487, 0.2460, 0.2433, 0.2408, 0.2382, 0.2357, 0.2333, 0.2309, + 0.2262, 0.2217, 0.2173, 0.2132, 0.2091, 0.2052, 0.2014, 0.1978, 0.1944, 0.1912, + 0.1851, 0.1794, 0.1741, 0.1693, 0.1648, + ], + Self::G5 => vec![ + 0.1710, 0.1719, 0.1727, 0.1732, 0.1734, 0.1730, 0.1718, 0.1696, 0.1668, 0.1637, + 0.1603, 0.1566, 0.1529, 0.1497, 0.1473, 0.1463, 0.1489, 0.1583, 0.1672, 0.1815, + 0.2051, 0.2413, 0.2884, 0.3379, 0.3785, 0.4032, 0.4147, 0.4201, 0.4278, 0.4338, + 0.4373, 0.4392, 0.4403, 0.4406, 0.4401, 0.4386, 0.4362, 0.4328, 0.4286, 0.4237, + 0.4182, 0.4121, 0.4057, 0.3991, 0.3926, 0.3861, 0.3800, 0.3741, 0.3684, 0.3630, + 0.3578, 0.3529, 0.3481, 0.3435, 0.3391, 0.3349, 0.3269, 0.3194, 0.3125, 0.3060, + 0.2999, 0.2942, 0.2889, 0.2838, 0.2790, 0.2745, 0.2703, 0.2662, 0.2624, 0.2588, + 0.2553, 0.2488, 0.2429, 0.2376, 0.2326, 0.2280, + ], + Self::G6 => vec![ + 0.2617, 0.2553, 0.2491, 0.2432, 0.2376, 0.2324, 0.2278, 0.2238, 0.2205, 0.2177, + 0.2155, 0.2138, 0.2126, 0.2121, 0.2122, 0.2132, 0.2154, 0.2194, 0.2229, 0.2297, + 0.2449, 0.2732, 0.3141, 0.3597, 0.3994, 0.4261, 0.4402, 0.4465, 0.4490, 0.4497, + 0.4494, 0.4482, 0.4464, 0.4441, 0.4390, 0.4336, 0.4279, 0.4221, 0.4162, 0.4102, + 0.4042, 0.3981, 0.3919, 0.3855, 0.3788, 0.3721, 0.3652, 0.3583, 0.3515, 0.3447, + 0.3381, 0.3314, 0.3249, 0.3185, 0.3122, 0.3060, 0.3000, 0.2941, 0.2883, 0.2772, + 0.2668, 0.2574, 0.2487, 0.2407, 0.2333, 0.2265, 0.2202, 0.2144, 0.2089, 0.2039, + 0.1991, 0.1947, 0.1905, 0.1866, 0.1794, 0.1730, 0.1673, 0.1621, 0.1574, + ], + Self::G7 => vec![ + 0.1198, 0.1197, 0.1196, 0.1194, 0.1193, 0.1194, 0.1194, 0.1194, 0.1193, 0.1193, + 0.1194, 0.1193, 0.1194, 0.1197, 0.1202, 0.1207, 0.1215, 0.1226, 0.1242, 0.1266, + 0.1306, 0.1368, 0.1464, 0.1660, 0.2054, 0.2993, 0.3803, 0.4015, 0.4043, 0.4034, + 0.4014, 0.3987, 0.3955, 0.3884, 0.3810, 0.3732, 0.3657, 0.3580, 0.3440, 0.3376, + 0.3315, 0.3260, 0.3209, 0.3160, 0.3117, 0.3078, 0.3042, 0.3010, 0.2980, 0.2951, + 0.2922, 0.2892, 0.2864, 0.2835, 0.2807, 0.2779, 0.2752, 0.2725, 0.2697, 0.2670, + 0.2643, 0.2615, 0.2588, 0.2561, 0.2533, 0.2506, 0.2479, 0.2451, 0.2424, 0.2368, + 0.2313, 0.2258, 0.2205, 0.2154, 0.2106, 0.2060, 0.2017, 0.1975, 0.1935, 0.1861, + 0.1793, 0.1730, 0.1672, 0.1618, + ], + Self::G8 => vec![ + 0.2105, 0.2105, 0.2104, 0.2104, 0.2103, 0.2103, 0.2103, 0.2103, 0.2103, 0.2102, + 0.2102, 0.2102, 0.2102, 0.2102, 0.2103, 0.2103, 0.2104, 0.2104, 0.2105, 0.2106, + 0.2109, 0.2183, 0.2571, 0.3358, 0.4068, 0.4378, 0.4476, 0.4493, 0.4477, 0.4450, + 0.4419, 0.4353, 0.4283, 0.4208, 0.4133, 0.4059, 0.3986, 0.3915, 0.3845, 0.3777, + 0.3710, 0.3645, 0.3581, 0.3519, 0.3458, 0.3400, 0.3343, 0.3288, 0.3234, 0.3182, + 0.3131, 0.3081, 0.3032, 0.2983, 0.2937, 0.2891, 0.2845, 0.2802, 0.2720, 0.2642, + 0.2569, 0.2499, 0.2432, 0.2368, 0.2308, 0.2251, 0.2197, 0.2147, 0.2101, 0.2058, + 0.2019, 0.1983, 0.1950, 0.1890, 0.1837, 0.1791, 0.1750, 0.1713, + ], + } + } + + #[must_use] + fn mach_numbers(self) -> Vec<f64> { + match self { + Self::G1 => vec![ + 0.00, 0.05, 0.10, 0.15, 0.20, 0.25, 0.30, 0.35, 0.40, 0.45, 0.50, 0.55, 0.60, 0.70, + 0.725, 0.75, 0.775, 0.80, 0.825, 0.85, 0.875, 0.90, 0.925, 0.95, 0.975, 1.0, 1.025, + 1.05, 1.075, 1.10, 1.125, 1.15, 1.20, 1.25, 1.30, 1.35, 1.40, 1.45, 1.50, 1.55, + 1.60, 1.65, 1.70, 1.75, 1.80, 1.85, 1.90, 1.95, 2.00, 2.05, 2.10, 2.15, 2.20, 2.25, + 2.30, 2.35, 2.40, 2.45, 2.50, 2.60, 2.70, 2.80, 2.90, 3.00, 3.10, 3.20, 3.30, 3.40, + 3.50, 3.60, 3.70, 3.80, 3.90, 4.00, 4.20, 4.40, 4.60, 4.80, 5.00, + ], + Self::G2 => vec![ + 0.00, 0.05, 0.10, 0.15, 0.20, 0.25, 0.30, 0.35, 0.40, 0.45, 0.50, 0.55, 0.60, 0.65, + 0.70, 0.75, 0.775, 0.80, 0.825, 0.85, 0.875, 0.90, 0.925, 0.95, 0.975, 1.0, 1.025, + 1.05, 1.075, 1.10, 1.125, 1.15, 1.175, 1.20, 1.25, 1.30, 1.35, 1.40, 1.45, 1.50, + 1.55, 1.60, 1.65, 1.70, 1.75, 1.80, 1.85, 1.90, 1.95, 2.00, 2.05, 2.10, 2.15, 2.20, + 2.25, 2.30, 2.35, 2.40, 2.45, 2.50, 2.55, 2.60, 2.65, 2.70, 2.75, 2.80, 2.85, 2.90, + 2.95, 3.00, 3.10, 3.20, 3.30, 3.40, 3.50, 3.60, 3.70, 3.80, 3.90, 4.00, 4.20, 4.40, + 4.60, 4.80, 5.00, + ], + Self::G5 => vec![ + 0.00, 0.05, 0.10, 0.15, 0.20, 0.25, 0.30, 0.35, 0.40, 0.45, 0.50, 0.55, 0.60, 0.65, + 0.70, 0.75, 0.80, 0.85, 0.875, 0.90, 0.925, 0.95, 0.975, 1.0, 1.025, 1.05, 1.075, + 1.10, 1.15, 1.20, 1.25, 1.30, 1.35, 1.40, 1.45, 1.50, 1.55, 1.60, 1.65, 1.70, 1.75, + 1.80, 1.85, 1.90, 1.95, 2.00, 2.05, 2.10, 2.15, 2.20, 2.25, 2.30, 2.35, 2.40, 2.45, + 2.50, 2.60, 2.70, 2.80, 2.90, 3.00, 3.10, 3.20, 3.30, 3.40, 3.50, 3.60, 3.70, 3.80, + 3.90, 4.00, 4.20, 4.40, 4.60, 4.80, 5.00, + ], + Self::G6 => vec![ + 0.00, 0.05, 0.10, 0.15, 0.20, 0.25, 0.30, 0.35, 0.40, 0.45, 0.50, 0.55, 0.60, 0.65, + 0.70, 0.75, 0.80, 0.85, 0.875, 0.90, 0.925, 0.95, 0.975, 1.0, 1.025, 1.05, 1.075, + 1.10, 1.125, 1.15, 1.175, 1.20, 1.225, 1.25, 1.30, 1.35, 1.40, 1.45, 1.50, 1.55, + 1.60, 1.65, 1.70, 1.75, 1.80, 1.85, 1.90, 1.95, 2.00, 2.05, 2.10, 2.15, 2.20, 2.25, + 2.30, 2.35, 2.40, 2.45, 2.50, 2.60, 2.70, 2.80, 2.90, 3.00, 3.10, 3.20, 3.30, 3.40, + 3.50, 3.60, 3.70, 3.80, 3.90, 4.00, 4.20, 4.40, 4.60, 4.80, 5.00, + ], + Self::G7 => vec![ + 0.0, 0.05, 0.10, 0.15, 0.20, 0.25, 0.30, 0.35, 0.40, 0.45, 0.50, 0.55, 0.60, 0.65, + 0.70, 0.725, 0.75, 0.775, 0.80, 0.825, 0.85, 0.875, 0.90, 0.925, 0.95, 0.975, 1.0, + 1.025, 1.05, 1.075, 1.10, 1.125, 1.15, 1.20, 1.25, 1.30, 1.35, 1.40, 1.50, 1.55, + 1.60, 1.65, 1.70, 1.75, 1.80, 1.85, 1.90, 1.95, 2.00, 2.05, 2.10, 2.15, 2.20, 2.25, + 2.30, 2.35, 2.40, 2.45, 2.50, 2.55, 2.60, 2.65, 2.70, 2.75, 2.80, 2.85, 2.90, 2.95, + 3.00, 3.10, 3.20, 3.30, 3.40, 3.50, 3.60, 3.70, 3.80, 3.90, 4.00, 4.20, 4.40, 4.60, + 4.80, 5.00, + ], + Self::G8 => vec![ + 0.00, 0.05, 0.10, 0.15, 0.20, 0.25, 0.30, 0.35, 0.40, 0.45, 0.50, 0.55, 0.60, 0.65, + 0.70, 0.75, 0.80, 0.825, 0.85, 0.875, 0.90, 0.925, 0.95, 0.975, 1.0, 1.025, 1.05, + 1.075, 1.10, 1.125, 1.15, 1.20, 1.25, 1.30, 1.35, 1.40, 1.45, 1.50, 1.55, 1.60, + 1.65, 1.70, 1.75, 1.80, 1.85, 1.90, 1.95, 2.00, 2.05, 2.10, 2.15, 2.20, 2.25, 2.30, + 2.35, 2.40, 2.45, 2.50, 2.60, 2.70, 2.80, 2.90, 3.00, 3.10, 3.20, 3.30, 3.40, 3.50, + 3.60, 3.70, 3.80, 3.90, 4.00, 4.20, 4.40, 4.60, 4.80, 5.00, + ], + } + } +} + +const BC_CONVERSION_FACTOR: f64 = 0.000_684_18; +pub fn calculate_retard( + drag_function: DragFunction, + ballistic_coefficient: f64, + velocity: f64, + mach: f64, +) -> f64 { + let m = velocity / mach; + for (i, mach_number) in drag_function.mach_numbers().iter().enumerate() { + if *mach_number >= m { + let previous = std::cmp::max(0, i - 1); + let previous_drag_coefficient = drag_function.drag_coefficients()[previous]; + let previous_mach_number = drag_function.mach_numbers()[previous]; + let cd = previous_drag_coefficient + + (drag_function.drag_coefficients()[i] - previous_drag_coefficient) + * (m - previous_mach_number) + / (drag_function.mach_numbers()[i] - previous_mach_number); + return BC_CONVERSION_FACTOR * (cd / ballistic_coefficient) * velocity.powi(2); + } + } + 0.0 +} + +#[cfg(test)] +mod tests { + use crate::ballistics::{atmosphere::speed_of_sound, Temperature}; + + use super::DragFunction; + + #[test] + fn retard() { + assert!( + (super::calculate_retard( + DragFunction::G1, + 0.583, + 89.0, + speed_of_sound(Temperature::new_15c()) + ) - 2.103_812_727_313_926) + .abs() + < f64::EPSILON // old ace: 2.10381 + ); + } +} diff --git a/extension/src/ballistics/map/mod.rs b/extension/src/ballistics/map/mod.rs new file mode 100644 index 00000000000..ba5922bb942 --- /dev/null +++ b/extension/src/ballistics/map/mod.rs @@ -0,0 +1,56 @@ +use std::collections::HashMap; + +use arma_rs::Group; + +mod model; +pub use model::Map; + +pub fn group() -> Group { + Group::new().command("init", init).command("set", set) +} + +pub static mut MAPS: Option<HashMap<String, Map>> = None; +pub static mut CURRENT_MAP: Option<String> = None; + +/// Initializes a new map, and sets it as the current map +/// +/// Safety: Arma will only call this from its main thread +fn init(name: String, size: u32) -> bool { + unsafe { + if MAPS.is_none() { + MAPS = Some(HashMap::new()); + } + CURRENT_MAP = Some(name.clone()); + if MAPS.as_ref().unwrap().contains_key(&name) { + return true; + } + MAPS.as_mut() + .unwrap() + .insert(name, Map::new(size, (size / 50) + 1)); + } + false +} + +/// Sets the height, number of objects, and surface type of a grid square +/// +/// Safety: Arma will only call this from its main thread +fn set(grid: u64, height: i64, num_objects: i64, surface_is_water: bool) -> Result<(), String> { + unsafe { + MAPS.as_mut() + .ok_or_else(|| "Map array not initialized".to_string())? + .get_mut( + CURRENT_MAP + .as_ref() + .ok_or_else(|| "No current map".to_string())?, + ) + .map_or_else( + || Err(format!("no map: {}", CURRENT_MAP.as_ref().unwrap())), + |map| { + map.set_height(grid as usize, height); + map.set_building_num(grid as usize, num_objects); + map.set_surface_is_water(grid as usize, surface_is_water); + Ok(()) + }, + ) + } +} diff --git a/extension/src/ballistics/map/model.rs b/extension/src/ballistics/map/model.rs new file mode 100644 index 00000000000..883076b8d2e --- /dev/null +++ b/extension/src/ballistics/map/model.rs @@ -0,0 +1,70 @@ +#[derive(Debug)] +#[allow(dead_code)] +pub struct Map { + heights: Vec<i64>, + building_nums: Vec<i64>, + surface_is_water: Vec<bool>, + size: u32, // unused + grids: u32, +} + +impl Map { + #[must_use] + pub fn new(size: u32, grids: u32) -> Self { + Self { + heights: vec![0; (size * grids) as usize], + building_nums: vec![0; (size * grids) as usize], + surface_is_water: vec![false; (size * grids) as usize], + size, + grids, + } + } + + #[must_use] + pub const fn heights(&self) -> &Vec<i64> { + &self.heights + } + + #[must_use] + pub fn height(&self, cell: usize) -> i64 { + self.heights[cell] + } + + pub fn set_height(&mut self, cell: usize, height: i64) { + self.heights[cell] = height; + } + + #[must_use] + pub const fn building_nums(&self) -> &Vec<i64> { + &self.building_nums + } + + #[must_use] + pub fn building_num(&self, index: usize) -> i64 { + self.building_nums[index] + } + + pub fn set_building_num(&mut self, index: usize, num: i64) { + self.building_nums[index] = num; + } + + #[must_use] + pub fn surface_is_water(&self, index: usize) -> bool { + self.surface_is_water[index] + } + + pub fn set_surface_is_water(&mut self, index: usize, is_water: bool) { + self.surface_is_water[index] = is_water; + } + + #[allow(dead_code)] + #[must_use] + pub const fn size(&self) -> u32 { + self.size + } + + #[must_use] + pub const fn grids(&self) -> u32 { + self.grids + } +} diff --git a/extension/src/ballistics/mod.rs b/extension/src/ballistics/mod.rs new file mode 100644 index 00000000000..d1e1ac7ce80 --- /dev/null +++ b/extension/src/ballistics/mod.rs @@ -0,0 +1,156 @@ +use arma_rs::Group; + +use crate::common::{MuzzleVelocity, Temperature}; + +mod atmosphere; +mod bullet; +mod drag; +mod map; +mod zero; + +use self::{ + atmosphere::{calculate_atmospheric_correction, speed_of_sound}, + drag::calculate_retard, +}; + +pub use self::{atmosphere::AtmosphereModel, drag::DragFunction}; + +#[derive(Debug)] +pub enum BallisticModel { + /// Air friction + Vanilla(f64), + Advanced(AdvancedBallistics), +} + +#[derive(Debug)] +pub struct AdvancedBallistics { + temperature: Temperature, + pressure: f64, + relative_humidity: f64, + ballistic_coefficient: f64, + drag_function: DragFunction, + atmosphere_model: AtmosphereModel, +} + +impl AdvancedBallistics { + #[must_use] + pub const fn temperature(&self) -> Temperature { + self.temperature + } + + #[must_use] + pub const fn pressure(&self) -> f64 { + self.pressure + } + + #[must_use] + pub const fn relative_humidity(&self) -> f64 { + self.relative_humidity + } + + #[must_use] + pub const fn ballistic_coefficient(&self) -> f64 { + self.ballistic_coefficient + } + + #[must_use] + pub const fn drag_function(&self) -> DragFunction { + self.drag_function + } + + #[must_use] + pub const fn atmosphere_model(&self) -> AtmosphereModel { + self.atmosphere_model + } +} + +#[must_use] +pub fn group() -> Group { + Group::new() + .command("retard", retard) + .command("atmospheric_correction", atmospheric_correction) + .command("replicate_vanilla_zero", replicate_vanilla_zero) + .command("zero_vanilla", zero_vanilla) + .command("zero_advanced", zero_advanced) + .group("bullet", bullet::group()) + .group("map", map::group()) +} + +fn retard( + drag_function: DragFunction, + ballistic_coefficient: f64, + velocity: f64, + temperature: Temperature, +) -> f64 { + calculate_retard( + drag_function, + ballistic_coefficient, + velocity, + speed_of_sound(temperature), + ) +} + +fn atmospheric_correction( + ballistic_coefficient: f64, + temperature: Temperature, + pressure: f64, + relative_humidity: f64, + atmosphere_model: AtmosphereModel, +) -> f64 { + calculate_atmospheric_correction( + ballistic_coefficient, + temperature, + pressure, + relative_humidity, + atmosphere_model, + ) +} + +fn replicate_vanilla_zero( + zero_range: f64, + muzzle_velocity: MuzzleVelocity, + air_friction: f64, +) -> f64 { + zero::replicate_vanilla(zero_range, muzzle_velocity, air_friction) +} + +fn zero_vanilla( + zero_range: f64, + muzzle_velocity: MuzzleVelocity, + air_friction: f64, + bore_height: f64, +) -> f64 { + zero::calculate( + zero_range, + muzzle_velocity, + bore_height, + BallisticModel::Vanilla(air_friction), + ) +} + +#[allow(clippy::too_many_arguments)] +fn zero_advanced( + zero_range: f64, + muzzle_velocity: MuzzleVelocity, + bore_height: f64, + temperature: Temperature, + pressure: f64, + relative_humidity: f64, + ballistic_coefficient: f64, + drag_function: DragFunction, + atmosphere_model: AtmosphereModel, +) -> f64 { + zero::calculate( + zero_range, + muzzle_velocity, + bore_height, + BallisticModel::Advanced(AdvancedBallistics { + temperature, + pressure, + relative_humidity, + ballistic_coefficient, + drag_function, + atmosphere_model, + }), + ) +} diff --git a/extension/src/ballistics/zero.rs b/extension/src/ballistics/zero.rs new file mode 100644 index 00000000000..29b4ab7f18b --- /dev/null +++ b/extension/src/ballistics/zero.rs @@ -0,0 +1,160 @@ +use crate::common::{MuzzleVelocity, Vector3, GRAVITY}; + +use super::{drag::calculate_retard, BallisticModel}; + +pub fn replicate_vanilla( + zero_range: f64, + muzzle_velocity: MuzzleVelocity, + air_friction: f64, +) -> f64 { + let max_delta_time = 0.05; + let mut time = 0.0; + let mut current_shot_position = Vector3::default(); + let mut current_shot_velocity = Vector3::new(*muzzle_velocity, 0.0, 0.0); + + while time < 8.0 { + let dist_left = zero_range - current_shot_position.x(); + let traveled = current_shot_velocity.x() * max_delta_time; + if dist_left < traveled { + let delta_time = dist_left / current_shot_velocity.x(); + current_shot_velocity -= Vector3::new(0.0, GRAVITY * delta_time, 0.0); + current_shot_position += current_shot_velocity * delta_time; + break; + } + let delta_time = max_delta_time; + current_shot_position += current_shot_velocity * delta_time; + time += delta_time; + current_shot_velocity += + current_shot_velocity * (current_shot_velocity.magnitude() * air_friction * delta_time); + current_shot_velocity -= Vector3::new(0.0, GRAVITY * delta_time, 0.0); + } + (-(current_shot_position.y() / zero_range).atan()).to_degrees() +} + +const SPEED_OF_SOUND_AT_15C: f64 = 340.275; + +pub fn calculate( + zero_range: f64, + muzzle_velocity: MuzzleVelocity, + bore_height: f64, + ballistic_model: BallisticModel, +) -> f64 { + let mut zero_angle = 0.0f64; + let delta_time = 1.0 / 100.0f64.max(zero_range); + + for _ in 0..10 { + let mut lx = 0.0; + let mut ly = 0.0; + + let mut px = 0.0; + let mut py = -bore_height / 100.0; + + let gx = zero_angle.sin() * -GRAVITY; + let gy = zero_angle.cos() * -GRAVITY; + + let mut vx = zero_angle.cos() * *muzzle_velocity; + let mut vy = zero_angle.sin() * *muzzle_velocity; + + let mut tof = 0.0; + + while tof < 8.0 && px < zero_range { + lx = px; + ly = py; + + let v = vx.hypot(vy); + + let (ax, ay) = match &ballistic_model { + BallisticModel::Vanilla(air_friction) => { + ((vx * v * air_friction) + gx, (vy * v * air_friction) + gy) + } + BallisticModel::Advanced(advanced) => { + let retard = calculate_retard( + advanced.drag_function(), + super::atmosphere::calculate_atmospheric_correction( + advanced.ballistic_coefficient(), + advanced.temperature(), + advanced.pressure(), + advanced.relative_humidity(), + advanced.atmosphere_model(), + ), + v, + SPEED_OF_SOUND_AT_15C, + ); + ((vx / v).mul_add(-retard, gx), (vy / v).mul_add(-retard, gy)) + } + }; + + px += vx * delta_time * 0.5; + py += vy * delta_time * 0.5; + vx += ax * delta_time; + vy += ay * delta_time; + px += vx * delta_time * 0.5; + py += vy * delta_time * 0.5; + + tof += delta_time; + } + let y = ly + (zero_range - lx) * (py - ly) / (px - lx); + let offset = -(y / zero_range).atan(); + zero_angle += offset; + + if offset.abs() < 0.00001 { + break; + } + } + zero_angle.to_degrees() +} + +#[cfg(test)] +mod tests { + use crate::{ + ballistics::{ + AdvancedBallistics, AtmosphereModel, BallisticModel, DragFunction, Temperature, + }, + common::MuzzleVelocity, + }; + + #[test] + fn replicate_vanilla_zero() { + assert!( + (super::replicate_vanilla(200.0, MuzzleVelocity::new(89.0), 0.3) + - 0.164_673_237_568_344_37) + .abs() + < f64::EPSILON // old ace: 0.164672 + ); + } + + #[test] + fn calc_zero_vanilla() { + assert!( + (super::calculate( + 200.0, + MuzzleVelocity::new(89.0), + 1.5, + BallisticModel::Vanilla(0.3) + ) - 0.132_818_571_102_032_27) + .abs() + < f64::EPSILON // old ace: 0.132818 + ); + } + + #[test] + fn calc_zero_advanced() { + assert!( + (super::calculate( + 200.0, + MuzzleVelocity::new(89.0), + 1.5, + BallisticModel::Advanced(AdvancedBallistics { + ballistic_coefficient: 0.583, + temperature: Temperature::new_15c(), + pressure: 1005.0, + relative_humidity: 0.0, + atmosphere_model: AtmosphereModel::Icao, + drag_function: DragFunction::G1, + }) + ) - 7.509_855_403_805_35) + .abs() + < f64::EPSILON // old ace: 7.51363 + ); + } +} diff --git a/extension/src/break_line.rs b/extension/src/break_line.rs new file mode 100644 index 00000000000..f659249f78b --- /dev/null +++ b/extension/src/break_line.rs @@ -0,0 +1,32 @@ +pub fn break_line(line: String) -> String { + let mut out = Vec::with_capacity(line.len() / 14); + let words: Vec<&str> = line.split(' ').collect(); + let mut buffer = String::new(); + for word in words { + if buffer.len() + word.len() > 14 { + out.push(buffer.trim_end().to_string()); + buffer = String::new(); + } + buffer.push_str(word); + buffer.push(' '); + } + if !buffer.is_empty() { + out.push(buffer.trim_end().to_string()); + } + out.join("<br/>") +} + +#[cfg(test)] +mod tests { + #[test] + fn break_line() { + assert_eq!( + super::break_line("The advanced combat environment mod is now rusty".to_string()), + "The advanced<br/>combat<br/>environment<br/>mod is now<br/>rusty" + ); + assert_eq!( + super::break_line("test hello can you hear me? I'm the arma man".to_string()), + "test hello can<br/>you hear me?<br/>I'm the arma<br/>man" + ); + } +} diff --git a/extension/src/clipboard.rs b/extension/src/clipboard.rs new file mode 100644 index 00000000000..f04757fe812 --- /dev/null +++ b/extension/src/clipboard.rs @@ -0,0 +1,54 @@ +use arboard::Clipboard; +use arma_rs::{loadout::Loadout, FromArma, Group}; + +pub fn group() -> Group { + Group::new() + .command("clear", clear) + .command("append", append) + .command("complete", complete) + .command("loadout", loadout) +} + +static mut BUFFER: String = String::new(); + +pub fn clear() { + // Safety: this is all single threaded, so no need to lock + unsafe { + BUFFER.clear(); + } +} + +pub fn append(text: String) { + // Safety: this is all single threaded, so no need to lock + unsafe { + BUFFER.push_str(&text); + } +} + +pub fn complete() -> Result<(), String> { + let mut clipboard = Clipboard::new().map_err(|e| e.to_string())?; + // Safety: this is all single threaded, so no need to lock + unsafe { + clipboard + .set_text(BUFFER.clone()) + .map_err(|e| e.to_string())?; + BUFFER = String::new(); + } + Ok(()) +} + +pub fn loadout() -> Option<String> { + let mut clipboard = match Clipboard::new().map_err(|e| e.to_string()) { + Ok(clipboard) => clipboard, + Err(e) => { + eprintln!("Clipboard error: {}", e); + return None; + } + }; + let content = clipboard.get_text().ok()?; + match Loadout::from_arma(content.clone()) { + Ok(_) => return Some(content), + Err(e) => eprintln!("Loadout parsing error: {}", e), + } + None +} diff --git a/extension/src/common/mod.rs b/extension/src/common/mod.rs new file mode 100644 index 00000000000..6962662066d --- /dev/null +++ b/extension/src/common/mod.rs @@ -0,0 +1,5 @@ +mod types; +pub use types::*; + +pub const GRAVITY: f64 = 9.80665; +pub const GRAVITY_ACCEL: Vector3 = Vector3::new(0.0, 0.0, -GRAVITY); diff --git a/extension/src/common/types/height.rs b/extension/src/common/types/height.rs new file mode 100644 index 00000000000..454c4b82463 --- /dev/null +++ b/extension/src/common/types/height.rs @@ -0,0 +1,35 @@ +use std::ops::Deref; + +use arma_rs::{FromArma, FromArmaError}; + +#[derive(Debug, Clone, Copy)] +/// Height in meters +pub struct Height(f64); + +impl Height { + pub fn new(height: f64) -> Self { + Self(height) + } +} + +impl FromArma for Height { + fn from_arma(value: String) -> Result<Self, FromArmaError> { + Ok(Self(value.parse::<f64>().map_err(|_| { + FromArmaError::InvalidValue("Invalid height".into()) + })?)) + } +} + +impl AsRef<f64> for Height { + fn as_ref(&self) -> &f64 { + &self.0 + } +} + +impl Deref for Height { + type Target = f64; + + fn deref(&self) -> &Self::Target { + &self.0 + } +} diff --git a/extension/src/common/types/mod.rs b/extension/src/common/types/mod.rs new file mode 100644 index 00000000000..6bbea572423 --- /dev/null +++ b/extension/src/common/types/mod.rs @@ -0,0 +1,11 @@ +mod height; +pub use height::Height; + +mod muzzle_velocity; +pub use muzzle_velocity::MuzzleVelocity; + +mod temperature; +pub use temperature::Temperature; + +mod vector3; +pub use vector3::Vector3; diff --git a/extension/src/common/types/muzzle_velocity.rs b/extension/src/common/types/muzzle_velocity.rs new file mode 100644 index 00000000000..b2c8121772a --- /dev/null +++ b/extension/src/common/types/muzzle_velocity.rs @@ -0,0 +1,36 @@ +use std::ops::Deref; + +use arma_rs::{FromArma, FromArmaError}; + +#[derive(Debug, Clone, Copy)] +/// Muzzle velocity in m/s +pub struct MuzzleVelocity(f64); + +impl MuzzleVelocity { + #[allow(dead_code)] // Only used in tests + pub fn new(muzzle_velocity: f64) -> Self { + Self(muzzle_velocity) + } +} + +impl FromArma for MuzzleVelocity { + fn from_arma(value: String) -> Result<Self, FromArmaError> { + Ok(Self(value.parse::<f64>().map_err(|_| { + FromArmaError::InvalidValue("Invalid muzzle velocity".into()) + })?)) + } +} + +impl AsRef<f64> for MuzzleVelocity { + fn as_ref(&self) -> &f64 { + &self.0 + } +} + +impl Deref for MuzzleVelocity { + type Target = f64; + + fn deref(&self) -> &Self::Target { + &self.0 + } +} diff --git a/extension/src/common/types/temperature.rs b/extension/src/common/types/temperature.rs new file mode 100644 index 00000000000..22efbb0c149 --- /dev/null +++ b/extension/src/common/types/temperature.rs @@ -0,0 +1,71 @@ +use arma_rs::{FromArma, FromArmaError}; + +#[derive(Debug, Clone, Copy, PartialEq)] +pub struct Temperature(f64); + +impl Temperature { + pub fn new_celsius(value: f64) -> Self { + Self(value + 273.15) + } + + pub const fn new_15c() -> Self { + Self::new_kelvin(288.15) + } + + pub const fn new_kelvin(value: f64) -> Self { + Self(value) + } + + pub fn new_fahrenheit(value: f64) -> Self { + Self((value - 32.0) * 5.0 / 9.0 + 273.15) + } + + pub fn as_celsius(self) -> f64 { + self.0 - 273.15 + } + + pub const fn as_kelvin(self) -> f64 { + self.0 + } + + #[allow(dead_code)] + pub fn as_fahrenheit(self) -> f64 { + (self.0 - 273.15) * 9.0 / 5.0 + 32.0 + } +} + +impl FromArma for Temperature { + fn from_arma(s: String) -> Result<Self, FromArmaError> { + if s.is_empty() { + return Err(FromArmaError::InvalidValue( + "unexpected empty string".into(), + )); + } + match s.chars().next().unwrap() { + 'c' => { + let temp = s[1..] + .parse::<f64>() + .map_err(|e| FromArmaError::InvalidValue(format!("{e}")))?; + Ok(Self::new_celsius(temp)) + } + 'f' => { + let temp = s[1..] + .parse::<f64>() + .map_err(|e| FromArmaError::InvalidValue(format!("{e}")))?; + Ok(Self::new_fahrenheit(temp)) + } + 'k' => { + let temp = s[1..] + .parse::<f64>() + .map_err(|e| FromArmaError::InvalidValue(format!("{e}")))?; + Ok(Self::new_kelvin(temp)) + } + _ => { + let temp = s + .parse::<f64>() + .map_err(|e| FromArmaError::InvalidValue(format!("{e}")))?; + Ok(Self::new_celsius(temp)) + } + } + } +} diff --git a/extension/src/common/types/vector3.rs b/extension/src/common/types/vector3.rs new file mode 100644 index 00000000000..91049117b62 --- /dev/null +++ b/extension/src/common/types/vector3.rs @@ -0,0 +1,173 @@ +use arma_rs::{FromArma, FromArmaError, IntoArma}; + +#[derive(Debug, Clone, Copy, PartialEq, Default)] +pub struct Vector3 { + x: f64, + y: f64, + z: f64, +} + +impl Vector3 { + pub const fn new(x: f64, y: f64, z: f64) -> Self { + Self { x, y, z } + } + + pub const fn x(&self) -> f64 { + self.x + } + + pub const fn y(&self) -> f64 { + self.y + } + + pub const fn z(&self) -> f64 { + self.z + } + + pub fn magnitude(&self) -> f64 { + self.magnitude_squared().sqrt() + } + + pub fn magnitude_squared(&self) -> f64 { + self.x + .mul_add(self.x, self.y.mul_add(self.y, self.z * self.z)) + } + + pub fn normalize(&self) -> Self { + let magnitude = self.magnitude(); + Self { + x: self.x / magnitude, + y: self.y / magnitude, + z: self.z / magnitude, + } + } + + pub fn lerp(&self, other: &Self, t: f64) -> Self { + Self { + x: (other.x - self.x).mul_add(t, self.x), + y: (other.y - self.y).mul_add(t, self.y), + z: (other.z - self.z).mul_add(t, self.z), + } + } +} + +impl FromArma for Vector3 { + fn from_arma(s: String) -> Result<Self, FromArmaError> { + let data = <[f64; 3]>::from_arma(s)?; + Ok(Self { + x: data[0], + y: data[1], + z: data[2], + }) + } +} + +impl IntoArma for Vector3 { + fn to_arma(&self) -> arma_rs::Value { + arma_rs::Value::Array(vec![ + arma_rs::Value::Number(self.x), + arma_rs::Value::Number(self.y), + arma_rs::Value::Number(self.z), + ]) + } +} + +impl std::ops::Add for Vector3 { + type Output = Self; + + fn add(self, other: Self) -> Self { + Self { + x: self.x + other.x, + y: self.y + other.y, + z: self.z + other.z, + } + } +} + +impl std::ops::AddAssign for Vector3 { + fn add_assign(&mut self, other: Self) { + self.x += other.x; + self.y += other.y; + self.z += other.z; + } +} + +impl std::ops::Sub for Vector3 { + type Output = Self; + + fn sub(self, other: Self) -> Self { + Self { + x: self.x - other.x, + y: self.y - other.y, + z: self.z - other.z, + } + } +} + +impl std::ops::SubAssign for Vector3 { + fn sub_assign(&mut self, other: Self) { + self.x -= other.x; + self.y -= other.y; + self.z -= other.z; + } +} + +impl std::ops::Mul for Vector3 { + type Output = Self; + + fn mul(self, other: Self) -> Self { + Self { + x: self.x * other.x, + y: self.y * other.y, + z: self.z * other.z, + } + } +} + +impl std::ops::Mul<f64> for Vector3 { + type Output = Self; + + fn mul(self, other: f64) -> Self { + Self { + x: self.x * other, + y: self.y * other, + z: self.z * other, + } + } +} + +impl std::ops::MulAssign for Vector3 { + fn mul_assign(&mut self, other: Self) { + self.x *= other.x; + self.y *= other.y; + self.z *= other.z; + } +} + +impl std::ops::MulAssign<f64> for Vector3 { + fn mul_assign(&mut self, other: f64) { + self.x *= other; + self.y *= other; + self.z *= other; + } +} + +impl std::ops::Div for Vector3 { + type Output = Self; + + fn div(self, other: Self) -> Self { + Self { + x: self.x / other.x, + y: self.y / other.y, + z: self.z / other.z, + } + } +} + +impl std::ops::DivAssign for Vector3 { + fn div_assign(&mut self, other: Self) { + self.x /= other.x; + self.y /= other.y; + self.z /= other.z; + } +} diff --git a/extension/src/fcs.rs b/extension/src/fcs.rs new file mode 100644 index 00000000000..ce769c7b74c --- /dev/null +++ b/extension/src/fcs.rs @@ -0,0 +1,79 @@ +use crate::common::GRAVITY; + +const SIMULATION_STEP: f64 = 0.05; +const MAX_ITERATIONS: u16 = 600; +const MAX_ELEVATION: f64 = 20.0; +const PRECISION: f64 = 0.1; + +fn trace_bullet( + init_speed: f64, + air_friction: f64, + angle: f64, + angle_target: f64, + distance: f64, +) -> f64 { + let mut vel_x = angle.to_radians().cos() * init_speed; + let mut vel_y = angle.to_radians().sin() * init_speed; + let pos_target_x = angle_target.to_radians().cos() * distance; + let pos_target_y = angle_target.to_radians().sin() * distance; + let mut pos_x = 0.0; + let mut pos_y = 0.0; + let mut last_pos_x = 0.0; + let mut last_pos_y = 0.0; + + for _ in 0..MAX_ITERATIONS { + last_pos_x = pos_x; + last_pos_y = pos_y; + let vel_mag = vel_x.hypot(vel_y); + pos_x += vel_x * SIMULATION_STEP * 0.5; + pos_y += vel_y * SIMULATION_STEP * 0.5; + vel_x += SIMULATION_STEP * (vel_x * vel_mag * air_friction); + vel_y += SIMULATION_STEP * (vel_y * vel_mag).mul_add(air_friction, -GRAVITY); + pos_x += vel_x * SIMULATION_STEP * 0.5; + pos_y += vel_y * SIMULATION_STEP * 0.5; + if pos_x >= pos_target_x { + break; + } + } + + let coef = (pos_target_x - last_pos_x) / (pos_x - last_pos_x); + (pos_y - last_pos_y).mul_add(coef, last_pos_y) - pos_target_y +} + +pub fn get_solution(init_speed: f64, air_friction: f64, angle_target: f64, distance: f64) -> f64 { + if trace_bullet( + init_speed, + air_friction, + MAX_ELEVATION, + angle_target, + distance, + ) < 0.0 + { + return MAX_ELEVATION - angle_target; + } + + let mut a1 = angle_target; + let mut a2 = MAX_ELEVATION; + let mut f1 = trace_bullet(init_speed, air_friction, a1, angle_target, distance); + if f1.abs() <= PRECISION { + return 0.0; + } + while f1.abs() > PRECISION { + let f2 = trace_bullet(init_speed, air_friction, a2, angle_target, distance); + let tmp = a2 - f2 * (a2 - a1) / (f2 - f1); + a1 = a2; + a2 = tmp; + f1 = f2; + } + a2 - angle_target +} + +#[cfg(test)] +mod tests { + use super::get_solution; + + #[test] + fn test_get_solution() { + assert!((get_solution(400.0, 0.0, 28.0, 950.0) - -8.0).abs() < f64::EPSILON); + } +} diff --git a/extension/src/lib.rs b/extension/src/lib.rs new file mode 100644 index 00000000000..7d7565fb3e1 --- /dev/null +++ b/extension/src/lib.rs @@ -0,0 +1,26 @@ +#![deny(clippy::all)] +#![deny(missing_debug_implementations)] + +//! ACE3 Extension for quick maths and OS APIs + +use arma_rs::{arma, Extension}; + +mod artillery; +mod ballistics; +mod break_line; +mod clipboard; +mod common; +mod fcs; + +#[arma] +fn init() -> Extension { + Extension::build() + .version(env!("GIT_HASH").to_string()) + .group("artillery", artillery::group()) + .group("ballistics", ballistics::group()) + .group("clipboard", clipboard::group()) + .command("break_line", break_line::break_line) + .command("fcs", fcs::get_solution) + .command("version", || env!("GIT_HASH")) + .finish() +} diff --git a/extensions/.clang-format b/extensions/.clang-format deleted file mode 100644 index 89eb4f46862..00000000000 --- a/extensions/.clang-format +++ /dev/null @@ -1,9 +0,0 @@ -BasedOnStyle: Google -IndentWidth: 4 -ColumnLimit: 160 -DerivePointerAlignment: false -PointerAlignment: Left -NamespaceIndentation: All -IncludeBlocks: Merge - -AllowShortBlocksOnASingleLine: true diff --git a/extensions/CMakeLists.txt b/extensions/CMakeLists.txt deleted file mode 100644 index 8a70cd0653e..00000000000 --- a/extensions/CMakeLists.txt +++ /dev/null @@ -1,166 +0,0 @@ -cmake_minimum_required (VERSION 3.14) -project (ACE) - -set_property(GLOBAL PROPERTY USE_FOLDERS ON) - -if(WIN32) -add_definitions(/DWINVER=0x0600 /D_WIN32_WINNT=0x0600) -endif() - -if (NOT CMAKE_BUILD_TYPE AND CMAKE_COMPILER_IS_GNUCXX) - message(STATUS "No build type selected, default to Debug") - set(CMAKE_BUILD_TYPE "Debug") -endif() - -option(DEVEL "DEVEL" OFF) -option(USE_BULLET "USE_BULLET" OFF) -option(USE_DIRECTX "USE_DIRECTX" OFF) -option(USE_64BIT_BUILD "USE_64BIT_BUILD" OFF) -option(USE_STATIC_LINKING "USE_STATIC_LINKING" ON) - -if(CMAKE_GENERATOR_PLATFORM MATCHES "x64") - set(USE_64BIT_BUILD ON) -endif() - -if(CMAKE_COMPILER_IS_GNUCXX) - SET(CMAKE_CXX_FLAGS "-std=c++11 -pedantic -pedantic-errors -march=i686 -m32 -O2 -s -fPIC -fpermissive") - set(CMAKE_FIND_LIBRARY_SUFFIXES ".a") - set(CMAKE_SHARED_LINKER_FLAGS "-static-libgcc -static-libstdc++") -elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - message(ERROR "SUPPORT NOT COMPLETE") -elseif (CMAKE_CXX_COMPILER_ID MATCHES "MSVC") - add_definitions(-D_CRT_SECURE_NO_WARNINGS) # Disable MSVC *_s function warnings - - if(USE_64BIT_BUILD) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4 /Qpar-report:2") # Default SSE2 - else() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4 /arch:SSE2 /Qpar-report:2") - endif() - - set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} /D _DEBUG /MTd /Zi /Ob0 /Od /RTC1") - set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS} /MT /O1 /Ob1 /D NDEBUG") - set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} /MT /O2 /Ob2 /D NDEBUG") - set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS} /MT /Zi /O2 /Ob1 /D NDEBUG") -endif() - -include_directories("common") - -if(USE_BULLET) - # Dependencies - # - set(BACKUP_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}) - set(BACKUP_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}) - set(BACKUP_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) - - add_definitions(-DUSE_DIRECTX) - add_subdirectory(lib/bullet3) - - set_target_properties(App_BasicExample PROPERTIES FOLDER Bullet3) - set_target_properties(App_HelloWorld PROPERTIES FOLDER Bullet3) - set_target_properties(App_ExampleBrowser PROPERTIES FOLDER Bullet3) - set_target_properties(Bullet2FileLoader PROPERTIES FOLDER Bullet3) - set_target_properties(Bullet3Collision PROPERTIES FOLDER Bullet3) - set_target_properties(Bullet3Dynamics PROPERTIES FOLDER Bullet3) - set_target_properties(Bullet3Geometry PROPERTIES FOLDER Bullet3) - set_target_properties(Bullet3Common PROPERTIES FOLDER Bullet3) - set_target_properties(Bullet3OpenCL_clew PROPERTIES FOLDER Bullet3) - set_target_properties(BulletCollision PROPERTIES FOLDER Bullet3) - set_target_properties(BulletDynamics PROPERTIES FOLDER Bullet3) - set_target_properties(BulletFileLoader PROPERTIES FOLDER Bullet3) - set_target_properties(BulletSoftBody PROPERTIES FOLDER Bullet3) - - set_target_properties(BulletWorldImporter PROPERTIES FOLDER Bullet3) - set_target_properties(BulletXmlWorldImporter PROPERTIES FOLDER Bullet3) - set_target_properties(ConvexDecomposition PROPERTIES FOLDER Bullet3) - set_target_properties(GIMPACTUtils PROPERTIES FOLDER Bullet3) - set_target_properties(gtest PROPERTIES FOLDER Bullet3) - set_target_properties(gwen PROPERTIES FOLDER Bullet3) - set_target_properties(HACD PROPERTIES FOLDER Bullet3) - set_target_properties(OpenGLWindow PROPERTIES FOLDER Bullet3) - set_target_properties(LinearMath PROPERTIES FOLDER Bullet3) - - set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${BACKUP_ARCHIVE_OUTPUT_DIRECTORY}) - set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${BACKUP_LIBRARY_OUTPUT_DIRECTORY}) - set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${BACKUP_RUNTIME_OUTPUT_DIRECTORY}) - - include_directories(BEFORE "lib/bullet3/src") -endif() -if(USE_DIRECTX) - add_definitions(-DUSE_DIRECTX) - set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH}) - find_package (DirectX) - link_directories (BEFORE ${DirectX_D3DX11_LIBRARY}) - include_directories (BEFORE ${DirectX_D3DX11_INCLUDE_DIR} ) -endif() -if(DEVEL) - add_definitions(-DDEVEL) -endif() - - -string(TIMESTAMP ACE_BUILDSTAMP "%Y-%m-%dT%H:%M:%SZ") -# Get current version from addon -file(READ "../addons/main/script_version.hpp" script_version) -string(REGEX MATCH "#define MAJOR ([0-9]*)" "x" outputX ${script_version}) -set(ACE_VERSION_MAJOR ${CMAKE_MATCH_1}) -string(REGEX MATCH "#define MINOR ([0-9]*)" "x" outputX ${script_version}) -set(ACE_VERSION_MINOR ${CMAKE_MATCH_1}) -string(REGEX MATCH "#define PATCHLVL ([0-9]*)" outputX ${script_version}) -set(ACE_VERSION_REVISION ${CMAKE_MATCH_1}) -EXECUTE_PROCESS(COMMAND git rev-parse --verify HEAD - OUTPUT_VARIABLE T_ACE_VERSION_BUILD - OUTPUT_STRIP_TRAILING_WHITESPACE -) -string(SUBSTRING ${T_ACE_VERSION_BUILD} 0 7 ACE_VERSION_BUILD ) - -message("Setting ACE Version: " ${ACE_VERSION_MAJOR}.${ACE_VERSION_MINOR}.${ACE_VERSION_REVISION}-${ACE_VERSION_BUILD}) - -configure_file( - "${CMAKE_CURRENT_SOURCE_DIR}/common/ace_version.hpp.in" - "${CMAKE_CURRENT_BINARY_DIR}/common/ace_version.hpp" - @ONLY) - -if(MSVC) - configure_file( - "${CMAKE_CURRENT_SOURCE_DIR}/common/ace_version_win32.rc.in" - "${CMAKE_CURRENT_BINARY_DIR}/common/ace_version_win32.rc" - @ONLY) - set(GLOBAL_RC ${CMAKE_CURRENT_BINARY_DIR}/common/ace_version_win32.rc) -endif() - -include_directories(${CMAKE_CURRENT_BINARY_DIR}/common) -set(GLOBAL_SOURCES ${GLOBAL_RC}) - - -# Add extensions to build here -add_subdirectory(common) - -# Extensions - -add_subdirectory(fcs) -add_subdirectory(break_line) -add_subdirectory(clipboard) -add_subdirectory(advanced_ballistics) -#add_subdirectory(medical) # After medical re-write this extension is no longer used -add_subdirectory(artillerytables) - -# Test Extension for dynamically loading/unloading built extensions; does not build in release -if (DEVEL) - add_subdirectory(dynload) - add_subdirectory(tests) - if(USE_DIRECTX) - add_subdirectory(lib/directxtk) - endif() -endif() - - -# GTest -option(ENABLE_GTEST "ENABLE_GTEST" ON) -if (ENABLE_GTEST) - include(FetchContent) - FetchContent_Declare(googletest GIT_REPOSITORY https://github.com/google/googletest.git GIT_TAG main) - # For Windows: Prevent overriding the parent project's compiler/linker settings - set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) - FetchContent_MakeAvailable(googletest) -endif() - -message("Build Type: ${CMAKE_BUILD_TYPE}") diff --git a/extensions/advanced_ballistics/AdvancedBallistics.cpp b/extensions/advanced_ballistics/AdvancedBallistics.cpp deleted file mode 100644 index bc6b374da64..00000000000 --- a/extensions/advanced_ballistics/AdvancedBallistics.cpp +++ /dev/null @@ -1,711 +0,0 @@ -#include "shared.hpp" - -#include <stdlib.h> -#include <string> -#include <vector> -#include <unordered_map> -#include <random> -#include <cmath> -#include <sstream> - -#include "vector.hpp" - -#define DELTA_T 0.005 -#define GRAVITY 9.8066f -#define DEGREES(X) (X * 180 / M_PI) -#define ABSOLUTE_ZERO_IN_CELSIUS -273.15f -#define KELVIN(t) (t - ABSOLUTE_ZERO_IN_CELSIUS) -#define CELSIUS(t) (t + ABSOLUTE_ZERO_IN_CELSIUS) -#define EARTH_ANGULAR_SPEED 0.00007292f -#define UNIVERSAL_GAS_CONSTANT 8.314f -#define WATER_VAPOR_MOLAR_MASS 0.018016f -#define DRY_AIR_MOLAR_MASS 0.028964f -#define SPECIFIC_GAS_CONSTANT_DRY_AIR 287.058f -#define STD_AIR_DENSITY_ICAO 1.22498f -#define STD_AIR_DENSITY_ASM 1.20885f -#define BC_CONVERSION_FACTOR 0.00068418f -#define SPEED_OF_SOUND(t) (331.3 * std::sqrt(1 + t / 273.15f)) -#define SPEED_OF_SOUND_AT_15C 340.275 - -struct Bullet { - double airFriction; - double caliber; - double bulletLength; - double bulletMass; - std::vector<double> ballisticCoefficients; - std::vector<double> velocityBoundaries; - char* atmosphereModel; - int dragModel; - std::vector<double> muzzleVelocities; - std::vector<double> barrelLengths; - double stabilityFactor; - double twistDirection; - double transonicStabilityCoef; - ace::vector3<double> bulletVelocityPreviousFrame; - ace::vector3<double> origin; - double latitude; - double temperature; - double altitude; - double humidity; - double overcast; - double startTime; - double lastFrame; - unsigned randSeed; - std::default_random_engine randGenerator; -}; - -struct Map { - std::vector<int> gridHeights; - std::vector<int> gridBuildingNums; - std::vector<int> gridSurfaceIsWater; - int mapSize; - int mapGrids; -}; - -std::vector<Bullet> bulletDatabase; -std::unordered_map<std::string, Map> mapDatabase; -std::string worldName = ""; -Map* map = &mapDatabase[""]; - -double calculateRoughnessLength(double posX, double posY) { - // Source: http://es.ucsc.edu/~jnoble/wind/extrap/index.html - double roughness_lengths[10] = {0.0002, 0.0005, 0.0024, 0.03, 0.055, 0.1, 0.2, 0.4, 0.8, 1.6}; - - int gridX = (int)floor(posX / 50); - int gridY = (int)floor(posY / 50); - int gridCell = gridX * map->mapGrids + gridY; - - if (gridCell >= 0 && (std::size_t)gridCell < map->gridHeights.size() && (std::size_t)gridCell < map->gridBuildingNums.size()) { - int nearBuildings = map->gridBuildingNums[gridCell]; - int surfaceIsWater = map->gridSurfaceIsWater[gridCell]; - - if (nearBuildings == 0 && surfaceIsWater == 1) { - return 0.0005; - } - - if (nearBuildings >= 10) { - return 1.6; - } - - return roughness_lengths[2 + std::min(nearBuildings, 6)]; - } - - return 0.0024; -} - -double calculateAirDensity(double temperature, double pressure, double relativeHumidity) { - pressure = pressure * 100; - - if (relativeHumidity > 0) { - // 610.78 gives pressure in Pa - https://en.wikipedia.org/wiki/Density_of_air - double _pSat = 610.78 * pow(10, ((7.5 * temperature) / (temperature + 237.3))); - double vaporPressure = relativeHumidity * _pSat; - double partialPressure = pressure - vaporPressure; - - return (partialPressure * DRY_AIR_MOLAR_MASS + vaporPressure * WATER_VAPOR_MOLAR_MASS) / (UNIVERSAL_GAS_CONSTANT * KELVIN(temperature)); - } else { - return pressure / (SPECIFIC_GAS_CONSTANT_DRY_AIR * KELVIN(temperature)); - } -} - -double calculateAtmosphericCorrection(double ballisticCoefficient, double temperature, double pressure, double relativeHumidity, const char *atmosphereModel) { - double airDensity = calculateAirDensity(temperature, pressure, relativeHumidity); - - if (!strcmp(atmosphereModel, "ICAO")) { - return (STD_AIR_DENSITY_ICAO / airDensity) * ballisticCoefficient; - } else { - return (STD_AIR_DENSITY_ASM / airDensity) * ballisticCoefficient; - } -} - -// Drag Functions from: http://www.jbmballistics.com/ballistics/downloads/text/ -const std::vector<double> dragCoefficientsG1 = { 0.2629, 0.2558, 0.2487, 0.2413, 0.2344, 0.2278, 0.2214, 0.2155, 0.2104, 0.2061, 0.2032, 0.2020, 0.2034, 0.2165, 0.2230, 0.2313, 0.2417, 0.2546, 0.2706, 0.2901, 0.3136, 0.3415, 0.3734, 0.4084, 0.4448, 0.4805, 0.5136, 0.5427, 0.5677, 0.5883, 0.6053, 0.6191, 0.6393, 0.6518, 0.6589, 0.6621, 0.6625, 0.6607, 0.6573, 0.6528, 0.6474, 0.6413, 0.6347, 0.6280, 0.6210, 0.6141, 0.6072, 0.6003, 0.5934, 0.5867, 0.5804, 0.5743, 0.5685, 0.5630, 0.5577, 0.5527, 0.5481, 0.5438, 0.5397, 0.5325, 0.5264, 0.5211, 0.5168, 0.5133, 0.5105, 0.5084, 0.5067, 0.5054, 0.5040, 0.5030, 0.5022, 0.5016, 0.5010, 0.5006, 0.4998, 0.4995, 0.4992, 0.4990, 0.4988 }; -const std::vector<double> machNumbersG1 = { 0.00, 0.05, 0.10, 0.15, 0.20, 0.25, 0.30, 0.35, 0.40, 0.45, 0.50, 0.55, 0.60, 0.70, 0.725, 0.75, 0.775, 0.80, 0.825, 0.85, 0.875, 0.90, 0.925, 0.95, 0.975, 1.0, 1.025, 1.05, 1.075, 1.10, 1.125, 1.15, 1.20, 1.25, 1.30, 1.35, 1.40, 1.45, 1.50, 1.55, 1.60, 1.65, 1.70, 1.75, 1.80, 1.85, 1.90, 1.95, 2.00, 2.05, 2.10, 2.15, 2.20, 2.25, 2.30, 2.35, 2.40, 2.45, 2.50, 2.60, 2.70, 2.80, 2.90, 3.00, 3.10, 3.20, 3.30, 3.40, 3.50, 3.60, 3.70, 3.80, 3.90, 4.00, 4.20, 4.40, 4.60, 4.80, 5.00 }; -const std::vector<double> dragCoefficientsG2 = { 0.2303, 0.2298, 0.2287, 0.2271, 0.2251, 0.2227, 0.2196, 0.2156, 0.2107, 0.2048, 0.1980, 0.1905, 0.1828, 0.1758, 0.1702, 0.1669, 0.1664, 0.1667, 0.1682, 0.1711, 0.1761, 0.1831, 0.2004, 0.2589, 0.3492, 0.3983, 0.4075, 0.4103, 0.4114, 0.4106, 0.4089, 0.4068, 0.4046, 0.4021, 0.3966, 0.3904, 0.3835, 0.3759, 0.3678, 0.3594, 0.3512, 0.3432, 0.3356, 0.3282, 0.3213, 0.3149, 0.3089, 0.3033, 0.2982, 0.2933, 0.2889, 0.2846, 0.2806, 0.2768, 0.2731, 0.2696, 0.2663, 0.2632, 0.2602, 0.2572, 0.2543, 0.2515, 0.2487, 0.2460, 0.2433, 0.2408, 0.2382, 0.2357, 0.2333, 0.2309, 0.2262, 0.2217, 0.2173, 0.2132, 0.2091, 0.2052, 0.2014, 0.1978, 0.1944, 0.1912, 0.1851, 0.1794, 0.1741, 0.1693, 0.1648 }; -const std::vector<double> machNumbersG2 = { 0.00, 0.05, 0.10, 0.15, 0.20, 0.25, 0.30, 0.35, 0.40, 0.45, 0.50, 0.55, 0.60, 0.65, 0.70, 0.75, 0.775, 0.80, 0.825, 0.85, 0.875, 0.90, 0.925, 0.95, 0.975, 1.0, 1.025, 1.05, 1.075, 1.10, 1.125, 1.15, 1.175, 1.20, 1.25, 1.30, 1.35, 1.40, 1.45, 1.50, 1.55, 1.60, 1.65, 1.70, 1.75, 1.80, 1.85, 1.90, 1.95, 2.00, 2.05, 2.10, 2.15, 2.20, 2.25, 2.30, 2.35, 2.40, 2.45, 2.50, 2.55, 2.60, 2.65, 2.70, 2.75, 2.80, 2.85, 2.90, 2.95, 3.00, 3.10, 3.20, 3.30, 3.40, 3.50, 3.60, 3.70, 3.80, 3.90, 4.00, 4.20, 4.40, 4.60, 4.80, 5.00 }; -const std::vector<double> dragCoefficientsG5 = { 0.1710, 0.1719, 0.1727, 0.1732, 0.1734, 0.1730, 0.1718, 0.1696, 0.1668, 0.1637, 0.1603, 0.1566, 0.1529, 0.1497, 0.1473, 0.1463, 0.1489, 0.1583, 0.1672, 0.1815, 0.2051, 0.2413, 0.2884, 0.3379, 0.3785, 0.4032, 0.4147, 0.4201, 0.4278, 0.4338, 0.4373, 0.4392, 0.4403, 0.4406, 0.4401, 0.4386, 0.4362, 0.4328, 0.4286, 0.4237, 0.4182, 0.4121, 0.4057, 0.3991, 0.3926, 0.3861, 0.3800, 0.3741, 0.3684, 0.3630, 0.3578, 0.3529, 0.3481, 0.3435, 0.3391, 0.3349, 0.3269, 0.3194, 0.3125, 0.3060, 0.2999, 0.2942, 0.2889, 0.2838, 0.2790, 0.2745, 0.2703, 0.2662, 0.2624, 0.2588, 0.2553, 0.2488, 0.2429, 0.2376, 0.2326, 0.2280 }; -const std::vector<double> machNumbersG5 = { 0.00, 0.05, 0.10, 0.15, 0.20, 0.25, 0.30, 0.35, 0.40, 0.45, 0.50, 0.55, 0.60, 0.65, 0.70, 0.75, 0.80, 0.85, 0.875, 0.90, 0.925, 0.95, 0.975, 1.0, 1.025, 1.05, 1.075, 1.10, 1.15, 1.20, 1.25, 1.30, 1.35, 1.40, 1.45, 1.50, 1.55, 1.60, 1.65, 1.70, 1.75, 1.80, 1.85, 1.90, 1.95, 2.00, 2.05, 2.10, 2.15, 2.20, 2.25, 2.30, 2.35, 2.40, 2.45, 2.50, 2.60, 2.70, 2.80, 2.90, 3.00, 3.10, 3.20, 3.30, 3.40, 3.50, 3.60, 3.70, 3.80, 3.90, 4.00, 4.20, 4.40, 4.60, 4.80, 5.00 }; -const std::vector<double> dragCoefficientsG6 = { 0.2617, 0.2553, 0.2491, 0.2432, 0.2376, 0.2324, 0.2278, 0.2238, 0.2205, 0.2177, 0.2155, 0.2138, 0.2126, 0.2121, 0.2122, 0.2132, 0.2154, 0.2194, 0.2229, 0.2297, 0.2449, 0.2732, 0.3141, 0.3597, 0.3994, 0.4261, 0.4402, 0.4465, 0.4490, 0.4497, 0.4494, 0.4482, 0.4464, 0.4441, 0.4390, 0.4336, 0.4279, 0.4221, 0.4162, 0.4102, 0.4042, 0.3981, 0.3919, 0.3855, 0.3788, 0.3721, 0.3652, 0.3583, 0.3515, 0.3447, 0.3381, 0.3314, 0.3249, 0.3185, 0.3122, 0.3060, 0.3000, 0.2941, 0.2883, 0.2772, 0.2668, 0.2574, 0.2487, 0.2407, 0.2333, 0.2265, 0.2202, 0.2144, 0.2089, 0.2039, 0.1991, 0.1947, 0.1905, 0.1866, 0.1794, 0.1730, 0.1673, 0.1621, 0.1574 }; -const std::vector<double> machNumbersG6 = { 0.00, 0.05, 0.10, 0.15, 0.20, 0.25, 0.30, 0.35, 0.40, 0.45, 0.50, 0.55, 0.60, 0.65, 0.70, 0.75, 0.80, 0.85, 0.875, 0.90, 0.925, 0.95, 0.975, 1.0, 1.025, 1.05, 1.075, 1.10, 1.125, 1.15, 1.175, 1.20, 1.225, 1.25, 1.30, 1.35, 1.40, 1.45, 1.50, 1.55, 1.60, 1.65, 1.70, 1.75, 1.80, 1.85, 1.90, 1.95, 2.00, 2.05, 2.10, 2.15, 2.20, 2.25, 2.30, 2.35, 2.40, 2.45, 2.50, 2.60, 2.70, 2.80, 2.90, 3.00, 3.10, 3.20, 3.30, 3.40, 3.50, 3.60, 3.70, 3.80, 3.90, 4.00, 4.20, 4.40, 4.60, 4.80, 5.00 }; -const std::vector<double> dragCoefficientsG7 = { 0.1198, 0.1197, 0.1196, 0.1194, 0.1193, 0.1194, 0.1194, 0.1194, 0.1193, 0.1193, 0.1194, 0.1193, 0.1194, 0.1197, 0.1202, 0.1207, 0.1215, 0.1226, 0.1242, 0.1266, 0.1306, 0.1368, 0.1464, 0.1660, 0.2054, 0.2993, 0.3803, 0.4015, 0.4043, 0.4034, 0.4014, 0.3987, 0.3955, 0.3884, 0.3810, 0.3732, 0.3657, 0.3580, 0.3440, 0.3376, 0.3315, 0.3260, 0.3209, 0.3160, 0.3117, 0.3078, 0.3042, 0.3010, 0.2980, 0.2951, 0.2922, 0.2892, 0.2864, 0.2835, 0.2807, 0.2779, 0.2752, 0.2725, 0.2697, 0.2670, 0.2643, 0.2615, 0.2588, 0.2561, 0.2533, 0.2506, 0.2479, 0.2451, 0.2424, 0.2368, 0.2313, 0.2258, 0.2205, 0.2154, 0.2106, 0.2060, 0.2017, 0.1975, 0.1935, 0.1861, 0.1793, 0.1730, 0.1672, 0.1618 }; -const std::vector<double> machNumbersG7 = { 0.0, 0.05, 0.10, 0.15, 0.20, 0.25, 0.30, 0.35, 0.40, 0.45, 0.50, 0.55, 0.60, 0.65, 0.70, 0.725, 0.75, 0.775, 0.80, 0.825, 0.85, 0.875, 0.90, 0.925, 0.95, 0.975, 1.0, 1.025, 1.05, 1.075, 1.10, 1.125, 1.15, 1.20, 1.25, 1.30, 1.35, 1.40, 1.50, 1.55, 1.60, 1.65, 1.70, 1.75, 1.80, 1.85, 1.90, 1.95, 2.00, 2.05, 2.10, 2.15, 2.20, 2.25, 2.30, 2.35, 2.40, 2.45, 2.50, 2.55, 2.60, 2.65, 2.70, 2.75, 2.80, 2.85, 2.90, 2.95, 3.00, 3.10, 3.20, 3.30, 3.40, 3.50, 3.60, 3.70, 3.80, 3.90, 4.00, 4.20, 4.40, 4.60, 4.80, 5.00 }; -const std::vector<double> dragCoefficientsG8 = { 0.2105, 0.2105, 0.2104, 0.2104, 0.2103, 0.2103, 0.2103, 0.2103, 0.2103, 0.2102, 0.2102, 0.2102, 0.2102, 0.2102, 0.2103, 0.2103, 0.2104, 0.2104, 0.2105, 0.2106, 0.2109, 0.2183, 0.2571, 0.3358, 0.4068, 0.4378, 0.4476, 0.4493, 0.4477, 0.4450, 0.4419, 0.4353, 0.4283, 0.4208, 0.4133, 0.4059, 0.3986, 0.3915, 0.3845, 0.3777, 0.3710, 0.3645, 0.3581, 0.3519, 0.3458, 0.3400, 0.3343, 0.3288, 0.3234, 0.3182, 0.3131, 0.3081, 0.3032, 0.2983, 0.2937, 0.2891, 0.2845, 0.2802, 0.2720, 0.2642, 0.2569, 0.2499, 0.2432, 0.2368, 0.2308, 0.2251, 0.2197, 0.2147, 0.2101, 0.2058, 0.2019, 0.1983, 0.1950, 0.1890, 0.1837, 0.1791, 0.1750, 0.1713 }; -const std::vector<double> machNumbersG8 = { 0.00, 0.05, 0.10, 0.15, 0.20, 0.25, 0.30, 0.35, 0.40, 0.45, 0.50, 0.55, 0.60, 0.65, 0.70, 0.75, 0.80, 0.825, 0.85, 0.875, 0.90, 0.925, 0.95, 0.975, 1.0, 1.025, 1.05, 1.075, 1.10, 1.125, 1.15, 1.20, 1.25, 1.30, 1.35, 1.40, 1.45, 1.50, 1.55, 1.60, 1.65, 1.70, 1.75, 1.80, 1.85, 1.90, 1.95, 2.00, 2.05, 2.10, 2.15, 2.20, 2.25, 2.30, 2.35, 2.40, 2.45, 2.50, 2.60, 2.70, 2.80, 2.90, 3.00, 3.10, 3.20, 3.30, 3.40, 3.50, 3.60, 3.70, 3.80, 3.90, 4.00, 4.20, 4.40, 4.60, 4.80, 5.00 }; - -const std::vector<std::vector<double>> dragCoefficients = { {}, dragCoefficientsG1, dragCoefficientsG2, {}, {}, dragCoefficientsG5, dragCoefficientsG6, dragCoefficientsG7, dragCoefficientsG8, {} }; -const std::vector<std::vector<double>> machNumbers = { {}, machNumbersG1, machNumbersG2, {},{}, machNumbersG5, machNumbersG6, machNumbersG7, machNumbersG8,{} }; - -double calculateRetard(int DragFunction, double DragCoefficient, double Velocity, double Mach) { - int idx = std::max(0, std::min(DragFunction, 9)); - double m = Velocity / Mach; - - for (int i = 0; i < (int)machNumbers[idx].size(); i++) { - if (machNumbers[idx][i] >= m) { - int previousIdx = std::max(0, i - 1); - double previousDragCoefficient = dragCoefficients[idx][previousIdx]; - double previousMachNumber = machNumbers[idx][previousIdx]; - double cd = previousDragCoefficient + (dragCoefficients[idx][i] - previousDragCoefficient) * (m - previousMachNumber) / (machNumbers[idx][i] - previousMachNumber); - return BC_CONVERSION_FACTOR * (cd / DragCoefficient) * std::pow(Velocity, 2); - } - } - - return 0.0; -} - -float replicateVanillaZero(float zeroRange, float muzzleVelocity, float airFriction) { - const float maxDeltaT = 0.05f; - float time = 0.0f; - ace::vector3<float> curShotPos = { 0, 0, 0 }; - ace::vector3<float> speed = { muzzleVelocity, 0, 0 }; - - while (time < 8.0f) { - float distLeft = zeroRange - curShotPos.x(); - float traveled = speed.x() * maxDeltaT; - if (distLeft < traveled) { - float deltaT = distLeft / speed.x(); - speed -= { 0, GRAVITY * deltaT, 0 }; - curShotPos += speed * deltaT; - time += deltaT; - break; - } else { - float deltaT = maxDeltaT; - curShotPos += speed * deltaT; - time += deltaT; - speed += speed * (speed.magnitude() * airFriction * deltaT); - speed -= { 0, GRAVITY * deltaT, 0 }; - } - } - return -std::atan(curShotPos.y() / zeroRange); -} - -double calculateVanillaZero(double zeroRange, double muzzleVelocity, double airFriction, double boreHeight) { - double zeroAngle = 0.0f; - double deltaT = 1.0 / std::max(100.0, zeroRange); - - for (int i = 0; i < 10; i++) { - double lx = 0.0f; - double ly = 0.0f; - - double px = 0.0f; - double py = -boreHeight / 100.0f; - - double gx = std::sin(zeroAngle) * -GRAVITY; - double gy = std::cos(zeroAngle) * -GRAVITY; - - double vx = std::cos(zeroAngle) * muzzleVelocity; - double vy = std::sin(zeroAngle) * muzzleVelocity; - - double tof = 0.0f; - double v = 0.0f; - - while (tof < 8.0f && px < zeroRange) { - lx = px; - ly = py; - - v = std::sqrt(vx*vx + vy*vy); - - double ax = vx * v * airFriction; - double ay = vy * v * airFriction; - ax += gx; - ay += gy; - - px += vx * deltaT * 0.5; - py += vy * deltaT * 0.5; - vx += ax * deltaT; - vy += ay * deltaT; - px += vx * deltaT * 0.5; - py += vy * deltaT * 0.5; - - tof += deltaT; - } - - double y = ly + (zeroRange - lx) * (py - ly) / (px - lx); - double offset = -std::atan(y / zeroRange); - zeroAngle += offset; - - if (std::abs(offset) < 0.00001f) { - break; - } - } - - return zeroAngle; -} - -double calculateAdvancedZero(double zeroRange, double muzzleVelocity, double boreHeight, double temperature, double pressure, double humidity, double ballisticCoefficient, int dragModel, char* atmosphereModel) { - double zeroAngle = 0.0f; - double deltaT = 1.0 / std::max(100.0, zeroRange); - - ballisticCoefficient = calculateAtmosphericCorrection(ballisticCoefficient, temperature, pressure, humidity, atmosphereModel); - - for (int i = 0; i < 10; i++) { - double lx = 0.0f; - double ly = 0.0f; - - double px = 0.0f; - double py = -boreHeight / 100.0f; - - double gx = std::sin(zeroAngle) * -GRAVITY; - double gy = std::cos(zeroAngle) * -GRAVITY; - - double vx = std::cos(zeroAngle) * muzzleVelocity; - double vy = std::sin(zeroAngle) * muzzleVelocity; - - double tof = 0.0f; - double v = 0.0f; - - while (tof < 8.0f && px < zeroRange) { - lx = px; - ly = py; - - v = std::sqrt(vx*vx + vy*vy); - - double retard = calculateRetard(dragModel, ballisticCoefficient, v, SPEED_OF_SOUND_AT_15C); - double ax = vx / v * -retard; - double ay = vy / v * -retard; - ax += gx; - ay += gy; - - px += vx * deltaT * 0.5; - py += vy * deltaT * 0.5; - vx += ax * deltaT; - vy += ay * deltaT; - px += vx * deltaT * 0.5; - py += vy * deltaT * 0.5; - - tof += deltaT; - } - - double y = ly + (zeroRange - lx) * (py - ly) / (px - lx); - double offset = -std::atan(y / zeroRange); - zeroAngle += offset; - - if (std::abs(offset) < 0.00001f) { - break; - } - } - - return zeroAngle; -} - -extern "C" -{ - EXPORT void __stdcall RVExtensionVersion(char *output, int outputSize); - EXPORT void __stdcall RVExtension(char *output, int outputSize, const char *function); -} - -void __stdcall RVExtensionVersion(char *output, int outputSize) -{ - strncpy(output, ACE_FULL_VERSION_STR, outputSize - 1); -} - -void __stdcall RVExtension(char *output, int outputSize, const char *function) -{ - ZERO_OUTPUT(); - std::stringstream outputStr; - if (!strcmp(function, "version")) { - strncpy(output, ACE_FULL_VERSION_STR, outputSize - 1); - EXTENSION_RETURN(); - } - - char* input = _strdup(function); - char* token = NULL; - char* next_token = NULL; - char* mode = strtok_s(input, ":", &next_token); - - if (!strcmp(mode, "retard")) { - double ballisticCoefficient = 1.0; - int dragModel = 1; - double velocity = 0.0; - double temperature = 15.0; - double retard = 0.0; - - dragModel = strtol(strtok_s(NULL, ":", &next_token), NULL, 10); - ballisticCoefficient = strtod(strtok_s(NULL, ":", &next_token), NULL); - velocity = strtod(strtok_s(NULL, ":", &next_token), NULL); - temperature = strtod(strtok_s(NULL, ":", &next_token), NULL); - - retard = calculateRetard(dragModel, ballisticCoefficient, velocity, SPEED_OF_SOUND(temperature)); - // int n = sprintf(output, "%f", retard); - - outputStr << retard; - strncpy(output, outputStr.str().c_str(), outputSize - 1); - - EXTENSION_RETURN(); - } else if (!strcmp(mode, "atmosphericCorrection")) { - double ballisticCoefficient = 1.0; - double temperature = 15.0; - double pressure = 1013.25; - double humidity = 0.0; - char* atmosphereModel; - - ballisticCoefficient = strtod(strtok_s(NULL, ":", &next_token), NULL); - temperature = strtod(strtok_s(NULL, ":", &next_token), NULL); - pressure = strtod(strtok_s(NULL, ":", &next_token), NULL); - humidity = strtod(strtok_s(NULL, ":", &next_token), NULL); - atmosphereModel = strtok_s(NULL, ":", &next_token); - - ballisticCoefficient = calculateAtmosphericCorrection(ballisticCoefficient, temperature, pressure, humidity, atmosphereModel); - //int n = sprintf(output, "%f", ballisticCoefficient); - outputStr << ballisticCoefficient; - strncpy(output, outputStr.str().c_str(), outputSize - 1); - EXTENSION_RETURN(); - } else if (!strcmp(mode, "new")) { - unsigned int index = 0; - unsigned int ammoCount = 0; - double airFriction = 0.0; - char* ballisticCoefficientArray; - char* ballisticCoefficient; - std::vector<double> ballisticCoefficients; - char* velocityBoundaryArray; - char* velocityBoundary; - std::vector<double> velocityBoundaries; - char* atmosphereModel; - int dragModel = 1; - double stabilityFactor = 1.5; - int twistDirection = 1; - double transonicStabilityCoef = 1; - char* bulletVelocityArray; - char* bulletVelocityEntry; - std::vector<double> bulletVelocity; - char* originArray; - char* originEntry; - std::vector<double> origin; - double latitude = 0.0; - double temperature = 0.0; - double altitude = 0.0; - double humidity = 0.0; - double overcast = 0.0; - double tickTime = 0.0; - - index = strtol(strtok_s(NULL, ":", &next_token), NULL, 10); - ammoCount = strtol(strtok_s(NULL, ":", &next_token), NULL, 10); - airFriction = strtod(strtok_s(NULL, ":", &next_token), NULL); - ballisticCoefficientArray = strtok_s(NULL, ":", &next_token); - ballisticCoefficientArray++; - ballisticCoefficientArray[strlen(ballisticCoefficientArray) - 1] = 0; - ballisticCoefficient = strtok_s(ballisticCoefficientArray, ",", &token); - while (ballisticCoefficient != NULL) { - ballisticCoefficients.push_back(strtod(ballisticCoefficient, NULL)); - ballisticCoefficient = strtok_s(NULL, ",", &token); - } - velocityBoundaryArray = strtok_s(NULL, ":", &next_token); - velocityBoundaryArray++; - velocityBoundaryArray[strlen(velocityBoundaryArray) - 1] = 0; - velocityBoundary = strtok_s(velocityBoundaryArray, ",", &token); - while (velocityBoundary != NULL) { - velocityBoundaries.push_back(strtod(velocityBoundary, NULL)); - velocityBoundary = strtok_s(NULL, ",", &token); - } - atmosphereModel = strtok_s(NULL, ":", &next_token); - dragModel = strtol(strtok_s(NULL, ":", &next_token), NULL, 10); - stabilityFactor = strtod(strtok_s(NULL, ":", &next_token), NULL); - twistDirection = strtol(strtok_s(NULL, ":", &next_token), NULL, 10); - transonicStabilityCoef = strtod(strtok_s(NULL, ":", &next_token), NULL); - originArray = strtok_s(NULL, ":", &next_token); - originArray++; - originArray[strlen(originArray) - 1] = 0; - originEntry = strtok_s(originArray, ",", &token); - while (originEntry != NULL) { - origin.push_back(strtod(originEntry, NULL)); - originEntry = strtok_s(NULL, ",", &token); - } - bulletVelocityArray = strtok_s(NULL, ":", &next_token); - bulletVelocityArray++; - bulletVelocityArray[strlen(bulletVelocityArray) - 1] = 0; - bulletVelocityEntry = strtok_s(bulletVelocityArray, ",", &token); - while (bulletVelocityEntry != NULL) { - bulletVelocity.push_back(strtod(bulletVelocityEntry, NULL)); - bulletVelocityEntry = strtok_s(NULL, ",", &token); - } - latitude = strtod(strtok_s(NULL, ":", &next_token), NULL); - temperature = strtod(strtok_s(NULL, ":", &next_token), NULL); - altitude = strtod(strtok_s(NULL, ":", &next_token), NULL); - humidity = strtod(strtok_s(NULL, ":", &next_token), NULL); - overcast = strtod(strtok_s(NULL, ":", &next_token), NULL); - tickTime = strtod(strtok_s(NULL, ":", &next_token), NULL); - - while (index >= bulletDatabase.size()) { - Bullet bullet; - bulletDatabase.push_back(bullet); - } - - bulletDatabase[index].airFriction = airFriction; - bulletDatabase[index].ballisticCoefficients = ballisticCoefficients; - bulletDatabase[index].velocityBoundaries = velocityBoundaries; - bulletDatabase[index].atmosphereModel = atmosphereModel; - bulletDatabase[index].dragModel = dragModel; - bulletDatabase[index].stabilityFactor = stabilityFactor; - bulletDatabase[index].twistDirection = twistDirection; - bulletDatabase[index].transonicStabilityCoef = transonicStabilityCoef; - bulletDatabase[index].bulletVelocityPreviousFrame = { bulletVelocity[0], bulletVelocity[1], bulletVelocity[2] }; - bulletDatabase[index].origin = { origin[0], origin[1], origin[2] }; - bulletDatabase[index].latitude = latitude / 180 * M_PI; - bulletDatabase[index].temperature = temperature; - bulletDatabase[index].altitude = altitude; - bulletDatabase[index].humidity = humidity; - bulletDatabase[index].overcast = overcast; - bulletDatabase[index].startTime = tickTime; - bulletDatabase[index].lastFrame = tickTime; - if (transonicStabilityCoef < 1) { - unsigned int k1 = (unsigned)round(tickTime / 2); - unsigned int k2 = ammoCount; - bulletDatabase[index].randSeed = (unsigned int)(0.5 * (k1 + k2) * (k1 + k2 + 1) + k2); - bulletDatabase[index].randGenerator.seed(bulletDatabase[index].randSeed); - } - - strncpy(output, "", outputSize - 1); - EXTENSION_RETURN(); - } else if (!strcmp(mode, "simulate")) { - // simulate:0:[-0.109985,542.529,-3.98301]:[3751.57,5332.23,214.252]:[0.598153,2.38829,0]:28.6:0:0.481542:0:215.16 - unsigned int index = 0; - char* velocityArray; - double velocity[3] = { 0.0, 0.0, 0.0 }; - char* positionArray; - double position[3] = { 0.0, 0.0, 0.0 }; - char* windArray; - double wind[3]; - double heightAGL = 0.0; - double tickTime = 0.0; - - index = strtol(strtok_s(NULL, ":", &next_token), NULL, 10); - velocityArray = strtok_s(NULL, ":", &next_token); - velocityArray++; - velocityArray[strlen(velocityArray) - 1] = 0; - velocity[0] = strtod(strtok_s(velocityArray, ",", &token), NULL); - velocity[1] = strtod(strtok_s(NULL, ",", &token), NULL); - velocity[2] = strtod(strtok_s(NULL, ",", &token), NULL); - positionArray = strtok_s(NULL, ":", &next_token); - positionArray++; - positionArray[strlen(positionArray) - 1] = 0; - position[0] = strtod(strtok_s(positionArray, ",", &token), NULL); - position[1] = strtod(strtok_s(NULL, ",", &token), NULL); - position[2] = strtod(strtok_s(NULL, ",", &token), NULL); - windArray = strtok_s(NULL, ":", &next_token); - windArray++; - windArray[strlen(windArray) - 1] = 0; - wind[0] = strtod(strtok_s(windArray, ",", &token), NULL); - wind[1] = strtod(strtok_s(NULL, ",", &token), NULL); - wind[2] = strtod(strtok_s(NULL, ",", &token), NULL); - heightAGL = strtod(strtok_s(NULL, ":", &next_token), NULL); - tickTime = strtod(strtok_s(NULL, ":", &next_token), NULL); - - ace::vector3<double> bulletVelocityCurrentFrame = { velocity[0], velocity[1], velocity[2] }; - ace::vector3<double> bulletPosition = { position[0], position[1], position[2] }; - ace::vector3<double> windVelocity = { wind[0], wind[1], wind[2] }; - ace::vector3<double> gravityAccel = { 0, 0, -GRAVITY }; - double ballisticCoefficient = 1.0; - double dragRef = 0.0; - double drag = 0.0; - double TOF = tickTime - bulletDatabase[index].startTime; - double deltaT = tickTime - bulletDatabase[index].lastFrame; - ace::vector3<double> trueVelocity; - double temperature = bulletDatabase[index].temperature - 0.0065 * bulletPosition.z(); - double pressure = (1013.25 - 10 * bulletDatabase[index].overcast) * pow(1 - (0.0065 * (bulletDatabase[index].altitude + bulletPosition.z())) / (KELVIN(temperature) + 0.0065 * bulletDatabase[index].altitude), 5.255754495); - ace::vector3<double> velocityOffset; - - bulletDatabase[index].lastFrame = tickTime; - - if (windVelocity.magnitude() > 0.1) { - double windAttenuation = 1.0; - ace::vector3<double> windSourceTerrain; - - windSourceTerrain = bulletPosition - windVelocity.normalize() * 100; - - int gridX = (int)floor(windSourceTerrain.x() / 50); - int gridY = (int)floor(windSourceTerrain.y() / 50); - int gridCell = gridX * map->mapGrids + gridY; - - if (gridCell >= 0 && (std::size_t)gridCell < map->gridHeights.size() && (std::size_t)gridCell < map->gridBuildingNums.size()) { - double gridHeight = map->gridHeights[gridCell]; - - if (gridHeight > bulletPosition.z()) { - double angle = atan((gridHeight - bulletPosition.z()) / 100); - windAttenuation *= pow(abs(cos(angle)), 2); - } - } - - if (heightAGL > 0 && heightAGL < 20) { - ace::vector3<double> windSourceObstacles; - - windSourceObstacles = bulletPosition - windVelocity.normalize() * 25; - - double roughnessLength = calculateRoughnessLength(windSourceObstacles.x(), windSourceObstacles.y()); - windAttenuation *= std::max(0.0, log(heightAGL / roughnessLength) / log(20 / roughnessLength)); - } - - windVelocity = windVelocity * windAttenuation; - } - - ace::vector3<double> bulletVelocity = bulletDatabase[index].bulletVelocityPreviousFrame; - double time = 0.0; - - while (time < deltaT) { - double dt = std::min(deltaT - time, DELTA_T); - - dragRef = -bulletDatabase[index].airFriction * bulletVelocity.magnitude_squared(); - - ace::vector3<double> accelRef = bulletVelocity.normalize() * dragRef; - - velocityOffset += accelRef * dt; - bulletVelocity -= accelRef * dt; - bulletVelocity += gravityAccel * dt; - - time += dt; - } - - bulletVelocity = bulletDatabase[index].bulletVelocityPreviousFrame; - time = 0.0; - TOF -= deltaT; - - while (time < deltaT) { - double dt = std::min(deltaT - time, DELTA_T * 2); - - trueVelocity = bulletVelocity - windVelocity; - - if (bulletDatabase[index].transonicStabilityCoef < 1.0f && trueVelocity.magnitude() < 1.2 * SPEED_OF_SOUND(temperature) && trueVelocity.magnitude() > SPEED_OF_SOUND(temperature)) { - std::uniform_real_distribution<double> distribution(-10.0, 10.0); - ace::vector3<double> offset(distribution(bulletDatabase[index].randGenerator), distribution(bulletDatabase[index].randGenerator), distribution(bulletDatabase[index].randGenerator)); - double coef = 1.0f - bulletDatabase[index].transonicStabilityCoef; - - double trueSpeed = trueVelocity.magnitude(); - trueVelocity += offset * coef; - trueVelocity = trueVelocity.normalize() * trueSpeed; - }; - - if (bulletDatabase[index].ballisticCoefficients.size() == bulletDatabase[index].velocityBoundaries.size() + 1) { - ballisticCoefficient = bulletDatabase[index].ballisticCoefficients[0]; - for (int i = (int)bulletDatabase[index].velocityBoundaries.size() - 1; i >= 0; i = i - 1) { - if (trueVelocity.magnitude() < bulletDatabase[index].velocityBoundaries[i]) { - ballisticCoefficient = bulletDatabase[index].ballisticCoefficients[i + 1]; - break; - } - } - - ballisticCoefficient = calculateAtmosphericCorrection(ballisticCoefficient, temperature, pressure, bulletDatabase[index].humidity, bulletDatabase[index].atmosphereModel); - - drag = calculateRetard(bulletDatabase[index].dragModel, ballisticCoefficient, trueVelocity.magnitude(), SPEED_OF_SOUND(temperature)); - } else { - double airDensity = calculateAirDensity(temperature, pressure, bulletDatabase[index].humidity); - double airFriction = bulletDatabase[index].airFriction * airDensity / STD_AIR_DENSITY_ICAO; - - drag = -airFriction * trueVelocity.magnitude_squared(); - } - - ace::vector3<double> accel = trueVelocity.normalize() * drag; - - velocityOffset -= accel * dt; - bulletVelocity -= accel * dt; - - if (TOF > 0) { - double bulletDir = atan2(bulletVelocity.x(), bulletVelocity.y()); - double driftAccel = bulletDatabase[index].twistDirection * (0.0482251 * (bulletDatabase[index].stabilityFactor + 1.2)) / pow(TOF, 0.17); - double driftVelocity = 0.0581025 *(bulletDatabase[index].stabilityFactor + 1.2) * pow(TOF, 0.83); - double dragCorrection = (driftVelocity / trueVelocity.magnitude()) * drag; - double magnitude = (driftAccel + dragCorrection) * dt; - ace::vector3<double> offset(sin(bulletDir + M_PI / 2) * magnitude, cos(bulletDir + M_PI / 2) * magnitude, 0); - velocityOffset += offset; - bulletVelocity += offset; - } - - double lat = bulletDatabase[index].latitude; - accel.x(2 * EARTH_ANGULAR_SPEED * +(bulletVelocity.y() * sin(lat) - bulletVelocity.z() * cos(lat))); - accel.y(2 * EARTH_ANGULAR_SPEED * -(bulletVelocity.x() * sin(lat))); - accel.z(2 * EARTH_ANGULAR_SPEED * +(bulletVelocity.x() * cos(lat))); - - velocityOffset += accel * dt; - bulletVelocity += accel * dt + gravityAccel * dt; - - TOF += dt; - time += dt; - } - - bulletDatabase[index].bulletVelocityPreviousFrame = bulletVelocityCurrentFrame + velocityOffset; - - outputStr << "[" << velocityOffset.x() << "," << velocityOffset.y() << "," << velocityOffset.z() << "]"; - strncpy(output, outputStr.str().c_str(), outputSize - 1); - EXTENSION_RETURN(); - } else if (!strcmp(mode, "set")) { - int height = 0; - int numObjects = 0; - int surfaceIsWater = 0; - - height = strtol(strtok_s(NULL, ":", &next_token), NULL, 10); - numObjects = strtol(strtok_s(NULL, ":", &next_token), NULL, 10); - surfaceIsWater = strtol(strtok_s(NULL, ":", &next_token), NULL, 10); - - map->gridHeights.push_back(height); - map->gridBuildingNums.push_back(numObjects); - map->gridSurfaceIsWater.push_back(surfaceIsWater); - - strncpy(output, outputStr.str().c_str(), outputSize - 1); - EXTENSION_RETURN(); - } else if (!strcmp(mode, "init")) { - int mapSize = 0; - int mapGrids = 0; - unsigned int gridCells = 0; - - worldName = strtok_s(NULL, ":", &next_token); - mapSize = strtol(strtok_s(NULL, ":", &next_token), NULL, 10); - - mapGrids = (int)ceil((double)mapSize / 50.0) + 1; - gridCells = mapGrids * mapGrids; - - map = &mapDatabase[worldName]; - if (map->gridHeights.size() == gridCells) { - outputStr << "Terrain already initialized"; - strncpy(output, outputStr.str().c_str(), outputSize - 1); - EXTENSION_RETURN(); - } - - map->mapSize = mapSize; - map->mapGrids = mapGrids; - map->gridHeights.clear(); - map->gridBuildingNums.clear(); - map->gridSurfaceIsWater.clear(); - map->gridHeights.reserve(gridCells); - map->gridBuildingNums.reserve(gridCells); - map->gridSurfaceIsWater.reserve(gridCells); - - strncpy(output, outputStr.str().c_str(), outputSize - 1); - EXTENSION_RETURN(); - } else if (!strcmp(mode, "replicateVanillaZero")) { - float zeroRange = strtof(strtok_s(NULL, ":", &next_token), NULL); - float initSpeed = strtof(strtok_s(NULL, ":", &next_token), NULL); - float airFriction = strtof(strtok_s(NULL, ":", &next_token), NULL); - - float zeroAngle = replicateVanillaZero(zeroRange, initSpeed, airFriction); - - outputStr << DEGREES(zeroAngle); - strncpy(output, outputStr.str().c_str(), outputSize - 1); - EXTENSION_RETURN(); - } else if (!strcmp(mode, "calcZero")) { - double zeroRange = strtod(strtok_s(NULL, ":", &next_token), NULL); - double initSpeed = strtod(strtok_s(NULL, ":", &next_token), NULL); - double airFriction = strtod(strtok_s(NULL, ":", &next_token), NULL); - double boreHeight = strtod(strtok_s(NULL, ":", &next_token), NULL); - - double zeroAngle = calculateVanillaZero(zeroRange, initSpeed, airFriction, boreHeight); - - outputStr << DEGREES(zeroAngle); - strncpy(output, outputStr.str().c_str(), outputSize - 1); - EXTENSION_RETURN(); - } else if (!strcmp(mode, "calcZeroAB")) { - double zeroRange = strtod(strtok_s(NULL, ":", &next_token), NULL); - double muzzleVelocity = strtod(strtok_s(NULL, ":", &next_token), NULL); - double boreHeight = strtod(strtok_s(NULL, ":", &next_token), NULL); - double temperature = strtod(strtok_s(NULL, ":", &next_token), NULL); - double pressure = strtod(strtok_s(NULL, ":", &next_token), NULL); - double humidity = strtod(strtok_s(NULL, ":", &next_token), NULL); - double ballisticCoefficient = strtod(strtok_s(NULL, ":", &next_token), NULL); - int dragModel = strtol(strtok_s(NULL, ":", &next_token), NULL, 10); - char* atmosphereModel = strtok_s(NULL, ":", &next_token); - - double zeroAngle = calculateAdvancedZero(zeroRange, muzzleVelocity, boreHeight, temperature, pressure, humidity, ballisticCoefficient, dragModel, atmosphereModel); - - outputStr << DEGREES(zeroAngle); - strncpy(output, outputStr.str().c_str(), outputSize - 1); - EXTENSION_RETURN(); - } - strncpy(output, outputStr.str().c_str(), outputSize - 1); - EXTENSION_RETURN(); -} diff --git a/extensions/advanced_ballistics/CMakeLists.txt b/extensions/advanced_ballistics/CMakeLists.txt deleted file mode 100644 index 9319d0bbd78..00000000000 --- a/extensions/advanced_ballistics/CMakeLists.txt +++ /dev/null @@ -1,22 +0,0 @@ -set(ACE_EXTENSION_NAME "ace_advanced_ballistics") - -file(GLOB SOURCES *.h *.hpp *.c *.cpp) -add_library( ${ACE_EXTENSION_NAME} SHARED ${SOURCES} ${GLOBAL_SOURCES}) -target_link_libraries(${ACE_EXTENSION_NAME} ace_common) -set_target_properties(${ACE_EXTENSION_NAME} PROPERTIES PREFIX "") -set_target_properties(${ACE_EXTENSION_NAME} PROPERTIES FOLDER Extensions) - -if(CMAKE_COMPILER_IS_GNUCXX) - set_target_properties(${ACE_EXTENSION_NAME} PROPERTIES LINK_SEARCH_START_STATIC 1) - set_target_properties(${ACE_EXTENSION_NAME} PROPERTIES LINK_SEARCH_END_STATIC 1) -endif() - -# Copy and rename DLL to root -if(USE_64BIT_BUILD) - set(FINAL_DLL_NAME ${ACE_EXTENSION_NAME}_x64.dll) -else() - set(FINAL_DLL_NAME ${ACE_EXTENSION_NAME}.dll) -endif() -add_custom_command(TARGET ${ACE_EXTENSION_NAME} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${ACE_EXTENSION_NAME}> ${PROJECT_SOURCE_DIR}/../${FINAL_DLL_NAME} -) diff --git a/extensions/artillerytables/CMakeLists.txt b/extensions/artillerytables/CMakeLists.txt deleted file mode 100644 index bd897c51035..00000000000 --- a/extensions/artillerytables/CMakeLists.txt +++ /dev/null @@ -1,33 +0,0 @@ -set(ACE_EXTENSION_NAME "ace_artillerytables") - -file(GLOB SOURCES *.h *.hpp *.c *.cpp) -add_library( ${ACE_EXTENSION_NAME} SHARED ${SOURCES} ${GLOBAL_SOURCES}) -target_link_libraries(${ACE_EXTENSION_NAME} ace_common) -set_target_properties(${ACE_EXTENSION_NAME} PROPERTIES PREFIX "") -set_target_properties(${ACE_EXTENSION_NAME} PROPERTIES FOLDER Extensions) - -if(CMAKE_COMPILER_IS_GNUCXX) - set_target_properties(${ACE_EXTENSION_NAME} PROPERTIES LINK_SEARCH_START_STATIC 1) - set_target_properties(${ACE_EXTENSION_NAME} PROPERTIES LINK_SEARCH_END_STATIC 1) -endif() - -# Copy and rename DLL to root -if(USE_64BIT_BUILD) - set(FINAL_DLL_NAME ${ACE_EXTENSION_NAME}_x64.dll) -else() - set(FINAL_DLL_NAME ${ACE_EXTENSION_NAME}.dll) -endif() -add_custom_command(TARGET ${ACE_EXTENSION_NAME} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${ACE_EXTENSION_NAME}> ${PROJECT_SOURCE_DIR}/../${FINAL_DLL_NAME} -) - -if (TARGET gtest_main) # Add Tests - enable_testing() - set(ACE_TEST_NAME ${ACE_EXTENSION_NAME}_test) - add_executable(${ACE_TEST_NAME} tests/tester.cpp ${SOURCES}) - target_link_libraries(${ACE_TEST_NAME} ace_common) - target_link_libraries(${ACE_TEST_NAME} ${ACE_EXTENSION_NAME}) - target_link_libraries(${ACE_TEST_NAME} gtest_main) - add_test(${ACE_TEST_NAME} ${ACE_TEST_NAME}) - set_target_properties(${ACE_TEST_NAME} PROPERTIES FOLDER Tests) -endif() diff --git a/extensions/artillerytables/artillerytables.cpp b/extensions/artillerytables/artillerytables.cpp deleted file mode 100644 index 9479e39f44c..00000000000 --- a/extensions/artillerytables/artillerytables.cpp +++ /dev/null @@ -1,283 +0,0 @@ -/* - * artillerytables.hpp - * Author: PabstMirror - */ - -#include <iomanip> -#include <future> -#include <sstream> - -#include "artillerytables.hpp" - - -// Constants -static const double timeStep = 1.0 / 60; -static const double rangeSearchErrorMax = 0.001; // ratio * distance -static const double rangeSearchAngleConvergance = 0.000025; -static const double gravityABS = 9.8066; -static const ace::vector3<double> gravityAccl(0, 0, -1 * gravityABS); - -// Globals: -std::vector<std::future<std::string>> fWorkers; -unsigned int getLineIndex = 0; - -std::tuple<double, double, double> simulateShot(const double _fireAngleRad, const double _muzzleVelocity, const double _heightOfTarget, const double _crossWind, const double _tailWind, const double _temperature, const double _airDensity, double _airFriction) { - // returns: dist traveled to the side (crosswind), dist traveled foward (headwind), time of flight - // note: if shot never reaches height of target, then results are undefined (use negative) - const double kCoefficient = -1.0 * _airDensity * _airFriction; - const double powderEffects = (_airFriction) ? ((_temperature + 273.13) / 288.13 - 1) / 40 + 1 : 1.0; - - double currentTime = 0; - ace::vector3<double> currentPosition(0, 0, 0); - ace::vector3<double> lastPosition(currentPosition); - ace::vector3<double> currentVelocity(0, powderEffects * _muzzleVelocity * cos(_fireAngleRad), powderEffects * _muzzleVelocity * sin(_fireAngleRad)); - const ace::vector3<double> wind(_crossWind, _tailWind, 0); - - while ((currentVelocity.z() > 0) || (currentPosition.z() >= _heightOfTarget)) { - lastPosition = currentPosition; - ace::vector3<double> apparentWind = wind - currentVelocity; - ace::vector3<double> changeInVelocity = gravityAccl + apparentWind * (kCoefficient * apparentWind.magnitude()); - currentVelocity += changeInVelocity * timeStep; - currentPosition += currentVelocity * timeStep; - currentTime += timeStep; - } - - const double lastCurrentRatio((_heightOfTarget - currentPosition.z()) / (lastPosition.z() - currentPosition.z())); - ace::vector3<double> finalPos = lastPosition.lerp(currentPosition, lastCurrentRatio); - - return { finalPos.x(), finalPos.y(), currentTime }; -} - -std::tuple<double, double> findMaxAngle(const double _muzzleVelocity, const double _airFriction) { - // retrns: angle that goes the furthest, max distance traveled - if (_airFriction == 0) { - return { M_PI_4, _muzzleVelocity * _muzzleVelocity / gravityABS }; - } - // With air resitsnce, max distance angle won't be 45 degrees - double bestAngle = M_PI_4; - double bestDistance = -1; - double testResultDist; - for (double testAngle = M_PI_4; testAngle > 0; testAngle -= (M_PI_4 / 100.0)) { - std::tie(std::ignore, testResultDist, std::ignore) = simulateShot(testAngle, _muzzleVelocity, 0, 0, 0, 15, 1, _airFriction); - if (testResultDist > bestDistance) { - bestAngle = testAngle; - bestDistance = testResultDist; - } - } - return { bestAngle, bestDistance }; -} - -std::tuple<double, double, double> simulateFindSolution(const double _rangeToHit, const double _heightToHit, const double _muzzleVelocity, const double _airFriction, const double _minElev, const double _maxElev, const bool _highArc) { - // returns: actual distance traveled, elevation, time of flight - double searchMin = _minElev; - double searchMax = _maxElev; - - if (!_airFriction) { - // can do trivial ballistics physics to get angle, could compute tof as well, but run through sim once to ensure consistancy (uses positive value of g) - double radicand = pow(_muzzleVelocity, 4) - gravityABS * (gravityABS * pow(_rangeToHit, 2) + 2 * _heightToHit * pow(_muzzleVelocity, 2)); - if ((!_rangeToHit) || (radicand < 0)) { // radican't - return { -1, -1, -1 }; - } - radicand = sqrt(radicand); - double angleRoot = atan((pow(_muzzleVelocity, 2) + radicand) / (gravityABS * _rangeToHit)); - if ((angleRoot > _maxElev) || (angleRoot < _minElev)) { - angleRoot = atan((pow(_muzzleVelocity, 2) - radicand) / (gravityABS * _rangeToHit)); - } - if ((angleRoot > _maxElev) || (angleRoot < _minElev)) { - return { -1, -1, -1 }; - }; - const double tof = _rangeToHit / (_muzzleVelocity * cos(angleRoot)); - return { _rangeToHit, angleRoot, tof }; - } - - - int numberOfAttempts = 0; - double resultDistance = -1; - double resultTime = -1; - double currentError = 9999; - double currentElevation = -1; - do { - if (numberOfAttempts++ > 50) break; // for safetey, min/max should converge long before - currentElevation = (searchMin + searchMax) / 2.0; - std::tie(std::ignore, resultDistance, resultTime) = simulateShot(currentElevation, _muzzleVelocity, _heightToHit, 0, 0, 15, 1, _airFriction); - currentError = _rangeToHit - resultDistance; - // printf("elev %f [%f, %f]range%f\n goes %f [%f]\n", currentElevation, searchMin, searchMax, (searchMax - searchMin), resultDistance, currentError); - if ((currentError > 0) ^ (!_highArc)) { - searchMax = currentElevation; - } else { - searchMin = currentElevation; - } - } while ((searchMax - searchMin) > rangeSearchAngleConvergance); - - // printf("[%f, %f] Actuall [%f] err [%f of %f]\n", _rangeToHit, _heightToHit, resultDistance, currentError, (_rangeToHit * rangeSearchErrorMax * (_highArc ? 1.0 : 2.0))); - // On some low angle shots, it will really struggle to converge because of precision issues - if ((abs(currentError) > (_rangeToHit * rangeSearchErrorMax * (_highArc ? 1.0 : 2.0)))) { - return { -1, -1, -1 }; - } - return { resultDistance, currentElevation, resultTime }; -} - -void writeNumber(std::stringstream & ss, double _num, const int _widthInt, const int _widthDec) { - if ((_num < 0) && (_num > -0.05)) { // hard coded fix -0.0 rounding errors - _num = 0; - } - if (_widthInt > 1) { - ss << std::setfill('0'); - } - ss << std::fixed << std::setw(_widthInt) << std::setprecision(_widthDec) << _num; -} - -std::string simulateCalcRangeTableLine(const double _rangeToHit, const double _muzzleVelocity, const double _airFriction, const double _minElev, const double _maxElev, const bool _highArc) { - double actualDistance, lineElevation, lineTimeOfFlight; - std::tie(actualDistance, lineElevation, lineTimeOfFlight) = simulateFindSolution(_rangeToHit, 0, _muzzleVelocity, _airFriction, _minElev, _maxElev, _highArc); - if (lineTimeOfFlight < 0) { - return ""; - } - double actualDistanceHeight, lineHeightElevation, lineHeightTimeOfFlight; - std::tie(actualDistanceHeight, lineHeightElevation, lineHeightTimeOfFlight) = simulateFindSolution(_rangeToHit, -100, _muzzleVelocity, _airFriction, _minElev, _maxElev, _highArc); - - - std::stringstream returnSS; - - returnSS << "[\""; - writeNumber(returnSS, _rangeToHit, 0, 0); - returnSS << "\",\""; - writeNumber(returnSS, lineElevation * 3200.0 / M_PI, 0, 0); - returnSS << "\",\""; - - if (lineHeightElevation > 0) { - const double drElevAdjust = lineHeightElevation - lineElevation; - const double drTofAdjust = lineHeightTimeOfFlight - lineTimeOfFlight; - writeNumber(returnSS, drElevAdjust * 3200.0 / M_PI, 0, 0); - returnSS << "\",\""; - writeNumber(returnSS, drTofAdjust, 0, 1); - } else { - // low angle shots won't be able to adjust down further - returnSS << "-\",\"-"; - } - returnSS << "\",\""; - writeNumber(returnSS, lineTimeOfFlight, 0, ((lineTimeOfFlight < 99.945) ? 1 : 0)); // round TOF when high - returnSS << "\",\""; - - if (_airFriction) { - // Calc corrections: - double xOffset, yOffset; - // Crosswind - std::tie(xOffset, std::ignore, std::ignore) = simulateShot(lineElevation, _muzzleVelocity, 0, 10, 0, 15, 1, _airFriction); - const double crosswindOffsetRad = atan2(xOffset, actualDistance) / 10; - // Headwind - std::tie(std::ignore, yOffset, std::ignore) = simulateShot(lineElevation, _muzzleVelocity, 0, 0, -10, 15, 1, _airFriction); - const double headwindOffset = (actualDistance - yOffset) / 10; - // Tailwind - std::tie(std::ignore, yOffset, std::ignore) = simulateShot(lineElevation, _muzzleVelocity, 0, 0, 10, 15, 1, _airFriction); - const double tailwindOffset = (actualDistance - yOffset) / 10; - // Air Temp Dec - std::tie(std::ignore, yOffset, std::ignore) = simulateShot(lineElevation, _muzzleVelocity, 0, 0, 0, 5, 1, _airFriction); - const double tempDecOffset = (actualDistance - yOffset) / 10; - // Air Temp Inc - std::tie(std::ignore, yOffset, std::ignore) = simulateShot(lineElevation, _muzzleVelocity, 0, 0, 0, 25, 1, _airFriction); - const double tempIncOffset = (actualDistance - yOffset) / 10; - // Air Density Dec - std::tie(std::ignore, yOffset, std::ignore) = simulateShot(lineElevation, _muzzleVelocity, 0, 0, 0, 15, 0.9, _airFriction); - const double airDensityDecOffset = (actualDistance - yOffset) / 10; - // Air Density Inc - std::tie(std::ignore, yOffset, std::ignore) = simulateShot(lineElevation, _muzzleVelocity, 0, 0, 0, 15, 1.1, _airFriction); - const double airDensityIncOffset = (actualDistance - yOffset) / 10; - - writeNumber(returnSS, crosswindOffsetRad * 3200.0 / M_PI, 1, 1); - returnSS << "\",\""; - writeNumber(returnSS, headwindOffset, 1, (abs(headwindOffset) > 9.949) ? 0 : 1); - returnSS << "\",\""; - writeNumber(returnSS, tailwindOffset, 1, (abs(tailwindOffset) > 9.949) ? 0 : 1); - returnSS << "\",\""; - writeNumber(returnSS, tempDecOffset, 1, (abs(tempDecOffset) > 9.949) ? 0 : 1); - returnSS << "\",\""; - writeNumber(returnSS, tempIncOffset, 1, (abs(tempIncOffset) > 9.949) ? 0 : 1); - returnSS << "\",\""; - writeNumber(returnSS, airDensityDecOffset, 1, (abs(airDensityDecOffset) > 9.949) ? 0 : 1); - returnSS << "\",\""; - writeNumber(returnSS, airDensityIncOffset, 1, (abs(airDensityIncOffset) > 9.949) ? 0 : 1); - returnSS << "\"]"; - } else { - returnSS << "-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\"]"; // 7 dashes - } - return (returnSS.str()); -} - -void __stdcall RVExtensionVersion(char* output, int outputSize) { - strncpy(output, ACE_FULL_VERSION_STR, outputSize - 1); -} -void __stdcall RVExtension(char* output, int outputSize, const char* function) { - if (!strcmp(function, "version")) { - RVExtensionVersion(output, outputSize); - return; - } - strncpy(output, "error - use args version of callExtension", outputSize - 1); -} -int __stdcall RVExtensionArgs(char* output, int outputSize, const char* function, const char** args, int argsCnt) { - if (!strcmp(function, "version")) { - RVExtensionVersion(output, outputSize); - return 0; - } - - if (!strcmp(function, "start")) { - if (argsCnt != 5) { return -2; } // Error: not enough args - const double muzzleVelocity = strtod(args[0], NULL); - const double airFriction = strtod(args[1], NULL); - double minElev = (M_PI / 180.0) * strtod(args[2], NULL); - double maxElev = (M_PI / 180.0) * strtod(args[3], NULL); - const bool highArc = !strcmp(args[4], "true"); - - // Reset workers: - fWorkers.clear(); - getLineIndex = 0; - - double bestAngle, bestDistance; - std::tie(bestAngle, bestDistance) = findMaxAngle(muzzleVelocity, airFriction); - - minElev = std::max(minElev, 2 * (M_PI / 180.0)); // cap min to 2 degrees (negative elev might get messy) - maxElev = std::min(maxElev, 88 * (M_PI / 180.0)); // cap max to 88 degrees (mk6) - if (highArc) { - minElev = std::max(minElev, bestAngle); - } else { - maxElev = std::min(maxElev, bestAngle); - } - const double loopStart = (bestDistance < 4000) ? 50 : 100; - const double loopInc = (bestDistance < 5000) ? 50 : 100; // simplify when range gets high - const double loopMaxRange = std::min(bestDistance, 30000.0); // with no air resistance, max range could go higher than 60km - - if (maxElev > minElev) { // don't bother if we can't hit anything (e.g. mortar in low mode) - for (double range = loopStart; range < loopMaxRange; range += loopInc) { - fWorkers.emplace_back(std::async(&simulateCalcRangeTableLine, range, muzzleVelocity, airFriction, minElev, maxElev, highArc)); - } - } - - std::stringstream outputStr; // debug max distance and thead count - outputStr << "[" << bestDistance << "," << fWorkers.size() << "]"; - strncpy(output, outputStr.str().c_str(), outputSize - 1); - return 0; - } - - if (!strcmp(function, "getline")) { - // 1 = data on line, 2 - data not ready, 3 - done - std::string result = ""; - std::future_status workerStatus; - - while (result.empty()) { - if (getLineIndex >= fWorkers.size()) { - return 3; - } - workerStatus = fWorkers[getLineIndex].wait_for(std::chrono::seconds(0)); - if (workerStatus != std::future_status::ready) { - return 2; - } - result = fWorkers[getLineIndex].get(); - getLineIndex++; - } - strncpy(output, result.c_str(), outputSize - 1); - return 1; - } - - strncpy(output, "error - invalid function", outputSize - 1); - return RETURN_INVALID_FUNCTION; // Error: function not valid -} diff --git a/extensions/artillerytables/artillerytables.hpp b/extensions/artillerytables/artillerytables.hpp deleted file mode 100644 index bd7c7d35a2a..00000000000 --- a/extensions/artillerytables/artillerytables.hpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - * artillerytables.hpp - * Author: PabstMirror - */ - -// ace libs: -#include "vector.hpp" -#include "shared.hpp" -#define RETURN_INVALID_FUNCTION -1001 -#define RETURN_WRONG_ARG_COUNT -1002 - -extern "C" { - EXPORT void __stdcall RVExtension(char* output, int outputSize, const char* function); - EXPORT int __stdcall RVExtensionArgs(char* output, int outputSize, const char* function, const char** argv, int argc); - EXPORT void __stdcall RVExtensionVersion(char* output, int outputSize); -} - -std::tuple<double, double, double> simulateShot(const double _fireAngleRad, const double _muzzleVelocity, const double _heightOfTarget, const double _crossWind, const double _tailWind, const double _temperature, const double _airDensity, double _airFriction); -std::tuple<double, double> findMaxAngle(const double _muzzleVelocity, const double _airFriction); -std::tuple<double, double, double> simulateFindSolution(const double _rangeToHit, const double _heightToHit, const double _muzzleVelocity, const double _airFriction, const double _minElev, const double _maxElev, const bool _highArc); -void writeNumber(std::stringstream & ss, double _num, const int _widthInt, const int _widthDec); -std::string simulateCalcRangeTableLine(const double _rangeToHit, const double _muzzleVelocity, const double _airFriction, const double _minElev, const double _maxElev, const bool _highArc); diff --git a/extensions/artillerytables/tests/tester.cpp b/extensions/artillerytables/tests/tester.cpp deleted file mode 100644 index 2dfabe4566e..00000000000 --- a/extensions/artillerytables/tests/tester.cpp +++ /dev/null @@ -1,100 +0,0 @@ -#include <iostream> -#include <chrono> -#include "gtest/gtest.h" -#include "../artillerytables.hpp" - - -extern "C" { - __declspec(dllexport) void __stdcall RVExtension(char* output, int outputSize, const char* function); - __declspec(dllexport) int __stdcall RVExtensionArgs(char* output, int outputSize, const char* function, const char** argv, int argc); - __declspec(dllexport) void __stdcall RVExtensionVersion(char* output, int outputSize); -} - -namespace test_ace_artillerytables { - TEST(Extension, VersionOld) { - char output[256]; - char function[] = "version"; - RVExtension(output, 256, function); - std::cout << "VersionOld: " << output << "\n"; - ASSERT_STREQ(output, ACE_FULL_VERSION_STR); - } - TEST(Extension, VersionRVExtensionVersion) { - char output[256]; - RVExtensionVersion(output, 256); - std::cout << "VersionExtension: " << output << "\n"; - ASSERT_STREQ(output, ACE_FULL_VERSION_STR); - } - TEST(Extension, VersionArray) { - char output[256]; - char function[] = "version"; - int extReturn = RVExtensionArgs(output, 256, function, NULL, 0); - std::cout << "VersionNew: " << output << "\n"; - ASSERT_EQ(extReturn, 0); - ASSERT_STREQ(output, ACE_FULL_VERSION_STR); - } - TEST(Extension, InvalidFuncOld) { - char output[256]; - char function[] = "blah"; - RVExtension(output, 256, function); - ASSERT_STREQ(output, "error - use args version of callExtension"); - } - TEST(Extension, InvalidFuncArray) { - char output[256]; - char function[] = "blah"; - int extReturn = RVExtensionArgs(output, 256, function, nullptr, 0); - std::cout << "InvalidFunc: " << output << "\n"; - ASSERT_EQ(extReturn, RETURN_INVALID_FUNCTION); - ASSERT_STREQ(output, "error - invalid function"); - } - - - TEST(Extension, TestRun) { - // very basic test that it runs the correct number of lines - char output[256]; - - // Start: - char function1[] = "start"; - const char* args1[] = { "400", "-0.00005", "-5", "80", "true" }; - auto t1 = std::chrono::high_resolution_clock::now(); - int ret1 = RVExtensionArgs(output, 256, function1, args1, 5); - auto t2 = std::chrono::high_resolution_clock::now(); - std::printf("ret: %d - %s\n", ret1, output); - std::printf("func %s: %1.1f ms\n", function1, std::chrono::duration<double, std::milli>(t2 - t1).count()); - ASSERT_STREQ(output, "[10391.8,103]"); - ASSERT_EQ(ret1, 0); - - int lines = 0; - auto t3 = std::chrono::high_resolution_clock::now(); - char function2[] = "getline"; - int ret2 = 0; - while (ret2 != 3) { // dumb spin - ret2 = RVExtensionArgs(output, 256, function2, NULL, 0); - if (ret2 == 1) { - lines++; - // std::printf("ret: %d - %s\n", ret2, output); - } - } - auto t4 = std::chrono::high_resolution_clock::now(); - std::printf("func %s: %1.1f ms with %d lines\n", function2, std::chrono::duration<double, std::milli>(t3 - t2).count(), lines); - - std::printf("callExtensions finished in %1.1f ms\n", std::chrono::duration<double, std::milli>(t4 - t1).count()); - - ASSERT_EQ(lines, 69); - } -} - - -int main(int argc, char** argv) { - // Misc Testing code - // Determine realistic air firiction values - //double mv = 241; - //std::printf(" %f m/s\n", mv); - //double range; - //for (double ar = 0; ar > -0.00015; ar -= 0.00001) { - // std::tie(std::ignore, range) = findMaxAngle(mv, ar); - // printf("[%f] = %f\n", ar, range); - //} - ::testing::InitGoogleTest(&argc, argv); - std::cout << "Starting tests!\n"; - return RUN_ALL_TESTS(); -} diff --git a/extensions/break_line/CMakeLists.txt b/extensions/break_line/CMakeLists.txt deleted file mode 100644 index 320df7a1033..00000000000 --- a/extensions/break_line/CMakeLists.txt +++ /dev/null @@ -1,22 +0,0 @@ -set(ACE_EXTENSION_NAME "ace_break_line") - -file(GLOB SOURCES *.h *.hpp *.c *.cpp) -add_library( ${ACE_EXTENSION_NAME} SHARED ${SOURCES} ${GLOBAL_SOURCES}) -target_link_libraries(${ACE_EXTENSION_NAME} ace_common) -set_target_properties(${ACE_EXTENSION_NAME} PROPERTIES PREFIX "") -set_target_properties(${ACE_EXTENSION_NAME} PROPERTIES FOLDER Extensions) - -if(CMAKE_COMPILER_IS_GNUCXX) - set_target_properties(${ACE_EXTENSION_NAME} PROPERTIES LINK_SEARCH_START_STATIC 1) - set_target_properties(${ACE_EXTENSION_NAME} PROPERTIES LINK_SEARCH_END_STATIC 1) -endif() - -# Copy and rename DLL to root -if(USE_64BIT_BUILD) - set(FINAL_DLL_NAME ${ACE_EXTENSION_NAME}_x64.dll) -else() - set(FINAL_DLL_NAME ${ACE_EXTENSION_NAME}.dll) -endif() -add_custom_command(TARGET ${ACE_EXTENSION_NAME} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${ACE_EXTENSION_NAME}> ${PROJECT_SOURCE_DIR}/../${FINAL_DLL_NAME} -) diff --git a/extensions/break_line/ace_break_line.cpp b/extensions/break_line/ace_break_line.cpp deleted file mode 100644 index 3c169e6a883..00000000000 --- a/extensions/break_line/ace_break_line.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/* - * ace_break_line.cpp - * - * Takes a string and insert as many line breaks as needed so it fits a given width - * - * Takes: - * Localized string as string - * Example: "Check weapon temperature" - * - * Returns: - * String with line breaks - */ - -#include "shared.hpp" - -#include <stdlib.h> -#include <sstream> -#include <vector> -#include <string> - -#define MAXCHARACTERS 14 - -extern "C" { - EXPORT void __stdcall RVExtension(char *output, int outputSize, const char *function); - EXPORT void __stdcall RVExtensionVersion(char *output, int outputSize) { - strncpy(output, ACE_FULL_VERSION_STR, outputSize - 1); - } -} - -std::vector<std::string> splitString(const std::string & input) { - std::istringstream ss(input); - std::string token; - - std::vector<std::string> output; - while (std::getline(ss, token, ' ')) { - output.push_back(token); - } - - return output; -} - -std::string addLineBreaks(const std::vector<std::string> &words) { - std::stringstream sstream; - size_t numChar = 0; - size_t i = 0; - - while (i < words.size()) { - if (numChar == 0) { - sstream << words[i]; - numChar += words[i].size(); - i++; - } else { - if (numChar + 1 + words[i].size() > MAXCHARACTERS) { - sstream << "<br/>"; - numChar = 0; - } else { - sstream << " " << words[i]; - numChar += 1 + words[i].size(); - i++; - } - } - } - - return sstream.str(); -} - -void __stdcall RVExtension(char *output, int outputSize, const char *function) { - ZERO_OUTPUT(); - if (!strcmp(function, "version")) { - strncpy(output, ACE_FULL_VERSION_STR, outputSize - 1); - } else { - strncpy(output, addLineBreaks(splitString(function)).c_str(), outputSize - 1); - } - EXTENSION_RETURN(); -} diff --git a/extensions/clipboard/CMakeLists.txt b/extensions/clipboard/CMakeLists.txt deleted file mode 100644 index 6c5668bcdd2..00000000000 --- a/extensions/clipboard/CMakeLists.txt +++ /dev/null @@ -1,22 +0,0 @@ -set(ACE_EXTENSION_NAME "ace_clipboard") - -file(GLOB SOURCES *.h *.hpp *.c *.cpp) -add_library( ${ACE_EXTENSION_NAME} SHARED ${SOURCES} ${GLOBAL_SOURCES}) -target_link_libraries(${ACE_EXTENSION_NAME} ace_common) -set_target_properties(${ACE_EXTENSION_NAME} PROPERTIES PREFIX "") -set_target_properties(${ACE_EXTENSION_NAME} PROPERTIES FOLDER Extensions) - -if(CMAKE_COMPILER_IS_GNUCXX) - set_target_properties(${ACE_EXTENSION_NAME} PROPERTIES LINK_SEARCH_START_STATIC 1) - set_target_properties(${ACE_EXTENSION_NAME} PROPERTIES LINK_SEARCH_END_STATIC 1) -endif() - -# Copy and rename DLL to root -if(USE_64BIT_BUILD) - set(FINAL_DLL_NAME ${ACE_EXTENSION_NAME}_x64.dll) -else() - set(FINAL_DLL_NAME ${ACE_EXTENSION_NAME}.dll) -endif() -add_custom_command(TARGET ${ACE_EXTENSION_NAME} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${ACE_EXTENSION_NAME}> ${PROJECT_SOURCE_DIR}/../${FINAL_DLL_NAME} -) diff --git a/extensions/clipboard/ace_clipboard.cpp b/extensions/clipboard/ace_clipboard.cpp deleted file mode 100644 index d463a4634e0..00000000000 --- a/extensions/clipboard/ace_clipboard.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/* - * ace_clipboard.cpp - * - * Takes a string and copies it to the clipboard; bypasses arma 8k clippy limit. Windows only. - * - * Takes: - * Localized string as string - * - * Returns: - * None - */ - -#include "shared.hpp" - -#include <stdlib.h> -#include <vector> -#include <string> - -extern "C" { - EXPORT void __stdcall RVExtension(char *output, int outputSize, const char *function); - EXPORT void __stdcall RVExtensionVersion(char *output, int outputSize) { - strncpy(output, ACE_FULL_VERSION_STR, outputSize - 1); - } -} - -std::string gClipboardData; - -void __stdcall RVExtension(char *output, int outputSize, const char *function) { - std::string cur_input(function); - std::string result; - - ZERO_OUTPUT(); - - if (cur_input.length() < 1) { - EXTENSION_RETURN(); - } - - if (!strcmp(function, "version")) { - std::strncpy(output, ACE_FULL_VERSION_STR, outputSize - 1); - EXTENSION_RETURN(); - } - - #ifdef _WIN32 - - if (!strcmp(function, "--COMPLETE--")) { - if (OpenClipboard(NULL) == 0) { - result = "OpenClipboard() failed, GetLastError=" + GetLastError(); - } else { - if (EmptyClipboard() == 0) { - result = "EmptyClipboard() failed, GetLastError=" + GetLastError(); - } else { - // GPTR = GMEM_FIXED + GMEM_ZEROINIT, returns a ptr, no need for GlobalLock/GlobalUnlock - char *pClipboardData = (char *)GlobalAlloc(GPTR, gClipboardData.length()); - - if (pClipboardData == NULL) { - result = "GlobalAlloc() failed, GetLastError=" + GetLastError(); - EXTENSION_RETURN(); - } - strncpy(pClipboardData, gClipboardData.c_str(), gClipboardData.length()); - - // if success, system owns the memory, if fail, free it from the heap - if (SetClipboardData(CF_TEXT, pClipboardData) == NULL) { - result = "SetClipboardData() failed, GetLastError=" + GetLastError(); - GlobalFree(pClipboardData); - } else { - if (CloseClipboard() == 0) { - result = "CloseClipboard() failed, GetLastError=" + GetLastError(); - } - } - } - } - gClipboardData = ""; - } else { - gClipboardData = gClipboardData + cur_input; - } - - if (result.length() > 1) { - strncpy(output, result.c_str(), outputSize - 1); - } - - #endif - - EXTENSION_RETURN(); -} diff --git a/extensions/cmake/FindDirectX.cmake b/extensions/cmake/FindDirectX.cmake deleted file mode 100644 index b413b0b294c..00000000000 --- a/extensions/cmake/FindDirectX.cmake +++ /dev/null @@ -1,215 +0,0 @@ -# - try to find DirectX include directories and libraries -# -# Once done this will define: -# -# DirectX_XYZ_FOUND - system has the XYZ API -# DirectX_XYZ_INCLUDE_FOUND - system has the include for the XYZ API -# DirectX_XYZ_INCLUDE_DIR - include directory for the XYZ API -# DirectX_XYZ_LIBRARY - path/name for the XYZ library -# -# Where XYZ can be any of: -# -# DDRAW -# D3D -# D3DX -# D3D8 -# D3DX8 -# D3D9 -# D3DX9 -# D3D10 -# D3D10_1 -# D3DX10 -# D3D11 -# D3D11_1 -# D3D11_2 -# D3DX11 -# D2D1 -# - - -include (CheckIncludeFileCXX) -include (FindPackageMessage) - - -if (WIN32) - - if (CMAKE_SIZEOF_VOID_P EQUAL 8) - set (DirectX_ARCHITECTURE x64) - else () - set (DirectX_ARCHITECTURE x86) - endif () - - # Can't use "$ENV{ProgramFiles(x86)}" to avoid violating CMP0053. See - # http://public.kitware.com/pipermail/cmake-developers/2014-October/023190.html - set (ProgramFiles_x86 "ProgramFiles(x86)") - if ("$ENV{${ProgramFiles_x86}}") - set (ProgramFiles "$ENV{${ProgramFiles_x86}}") - else () - set (ProgramFiles "$ENV{ProgramFiles}") - endif () - - find_path (DirectX_ROOT_DIR - Include/d3d9.h - PATHS - "$ENV{DXSDK_DIR}" - "${ProgramFiles}/Microsoft DirectX SDK (June 2010)" - "${ProgramFiles}/Microsoft DirectX SDK (February 2010)" - "${ProgramFiles}/Microsoft DirectX SDK (March 2009)" - "${ProgramFiles}/Microsoft DirectX SDK (August 2008)" - "${ProgramFiles}/Microsoft DirectX SDK (June 2008)" - "${ProgramFiles}/Microsoft DirectX SDK (March 2008)" - "${ProgramFiles}/Microsoft DirectX SDK (November 2007)" - "${ProgramFiles}/Microsoft DirectX SDK (August 2007)" - "${ProgramFiles}/Microsoft DirectX SDK" - DOC "DirectX SDK root directory" - ) - if (DirectX_ROOT_DIR) - set (DirectX_INC_SEARCH_PATH "${DirectX_ROOT_DIR}/Include") - set (DirectX_LIB_SEARCH_PATH "${DirectX_ROOT_DIR}/Lib/${DirectX_ARCHITECTURE}") - set (DirectX_BIN_SEARCH_PATH "${DirectX_ROOT_DIR}/Utilities/bin/x86") - endif () - - # With VS 2011 and Windows 8 SDK, the DirectX SDK is included as part of - # the Windows SDK. - # - # See also: - # - http://msdn.microsoft.com/en-us/library/windows/desktop/ee663275.aspx - if (DEFINED MSVC_VERSION AND NOT ${MSVC_VERSION} LESS 1700) - set (USE_WINSDK_HEADERS TRUE) - endif () - - # Find a header in the DirectX SDK - macro (find_dxsdk_header var_name header) - set (include_dir_var "DirectX_${var_name}_INCLUDE_DIR") - set (include_found_var "DirectX_${var_name}_INCLUDE_FOUND") - find_path (${include_dir_var} ${header} - HINTS ${DirectX_INC_SEARCH_PATH} - DOC "The directory where ${header} resides" - CMAKE_FIND_ROOT_PATH_BOTH - ) - if (${include_dir_var}) - set (${include_found_var} TRUE) - find_package_message (${var_name}_INC "Found ${header} header: ${${include_dir_var}}/${header}" "[${${include_dir_var}}]") - endif () - mark_as_advanced (${include_found_var}) - endmacro () - - # Find a library in the DirectX SDK - macro (find_dxsdk_library var_name library) - # DirectX SDK - set (library_var "DirectX_${var_name}_LIBRARY") - find_library (${library_var} ${library} - HINTS ${DirectX_LIB_SEARCH_PATH} - DOC "The directory where ${library} resides" - CMAKE_FIND_ROOT_PATH_BOTH - ) - if (${library_var}) - find_package_message (${var_name}_LIB "Found ${library} library: ${${library_var}}" "[${${library_var}}]") - endif () - mark_as_advanced (${library_var}) - endmacro () - - # Find a header in the Windows SDK - macro (find_winsdk_header var_name header) - if (USE_WINSDK_HEADERS) - # Windows SDK - set (include_dir_var "DirectX_${var_name}_INCLUDE_DIR") - set (include_found_var "DirectX_${var_name}_INCLUDE_FOUND") - check_include_file_cxx (${header} ${include_found_var}) - set (${include_dir_var}) - mark_as_advanced (${include_found_var}) - else () - find_dxsdk_header (${var_name} ${header}) - endif () - endmacro () - - # Find a library in the Windows SDK - macro (find_winsdk_library var_name library) - if (USE_WINSDK_HEADERS) - # XXX: We currently just assume the library exists - set (library_var "DirectX_${var_name}_LIBRARY") - set (${library_var} ${library}) - mark_as_advanced (${library_var}) - else () - find_dxsdk_library (${var_name} ${library}) - endif () - endmacro () - - # Combine header and library variables into an API found variable - macro (find_combined var_name inc_var_name lib_var_name) - if (DirectX_${inc_var_name}_INCLUDE_FOUND AND DirectX_${lib_var_name}_LIBRARY) - set (DirectX_${var_name}_FOUND 1) - find_package_message (${var_name} "Found ${var_name} API" "[${DirectX_${lib_var_name}_LIBRARY}][${DirectX_${inc_var_name}_INCLUDE_DIR}]") - endif () - endmacro () - - find_winsdk_header (DDRAW ddraw.h) - find_winsdk_library (DDRAW ddraw) - find_combined (DDRAW DDRAW DDRAW) - - if (CMAKE_GENERATOR_TOOLSET MATCHES "_xp$") - # Windows 7 SDKs, used by XP toolset, do not include d3d.h - find_dxsdk_header (D3D d3d.h) - else () - find_winsdk_header (D3D d3d.h) - endif () - find_combined (D3D D3D DDRAW) - - find_dxsdk_header (D3DX d3dx.h) - find_combined (D3DX D3DX D3DX) - - find_dxsdk_header (D3D8 d3d8.h) - find_dxsdk_library (D3D8 d3d8) - find_combined (D3D8 D3D8 D3D8) - - find_dxsdk_header (D3DX8 d3dx8.h) - find_dxsdk_library (D3DX8 d3dx8) - find_combined (D3DX8 D3DX8 D3DX8) - - find_winsdk_header (D3D9 d3d9.h) - find_winsdk_library (D3D9 d3d9) - find_combined (D3D9 D3D9 D3D9) - - find_dxsdk_header (D3DX9 d3dx9.h) - find_dxsdk_library (D3DX9 d3dx9) - find_combined (D3DX9 D3DX9 D3DX9) - - find_winsdk_header (DXGI dxgi.h) - find_winsdk_header (DXGI1_2 dxgi1_2.h) - find_winsdk_header (DXGI1_3 dxgi1_3.h) - find_winsdk_library (DXGI dxgi) - - find_winsdk_header (D3D10 d3d10.h) - find_winsdk_library (D3D10 d3d10) - find_combined (D3D10 D3D10 D3D10) - - find_winsdk_header (D3D10_1 d3d10_1.h) - find_winsdk_library (D3D10_1 d3d10_1) - find_combined (D3D10_1 D3D10_1 D3D10_1) - - find_dxsdk_header (D3DX10 d3dx10.h) - find_dxsdk_library (D3DX10 d3dx10) - find_combined (D3DX10 D3DX10 D3DX10) - - find_winsdk_header (D3D11 d3d11.h) - find_winsdk_library (D3D11 d3d11) - find_combined (D3D11 D3D11 D3D11) - find_winsdk_header (D3D11_1 d3d11_1.h) - find_combined (D3D11_1 D3D11_1 D3D11) - find_winsdk_header (D3D11_2 d3d11_2.h) - find_combined (D3D11_2 D3D11_2 D3D11) - - find_dxsdk_header (D3DX11 d3dx11.h) - find_dxsdk_library (D3DX11 d3dx11) - find_combined (D3DX11 D3DX11 D3DX11) - - find_winsdk_header (D2D1 d2d1.h) - find_winsdk_library (D2D1 d2d1) - find_combined (D2D1 D2D1 D2D1) - - find_program (DirectX_FXC_EXECUTABLE fxc - HINTS ${DirectX_BIN_SEARCH_PATH} - DOC "Path to fxc.exe executable." - ) - -endif () \ No newline at end of file diff --git a/extensions/common/CMakeLists.txt b/extensions/common/CMakeLists.txt deleted file mode 100644 index 92abaa8f6bb..00000000000 --- a/extensions/common/CMakeLists.txt +++ /dev/null @@ -1,18 +0,0 @@ -file(GLOB_RECURSE ACE_COMMON_SOURCES *.h *.hpp *.c *.cpp) - - -file(GLOB ACE_BASE_COMMON_SOURCES *.h *.hpp *.c *.cpp) -#file(GLOB ACE_P3D_SOURCES p3d/*.h p3d/*.hpp p3d/*.c p3d/*.cpp) -#file(GLOB ACE_PBO_SOURCES pbo/*.h pbo/*.hpp pbo/*.c pbo/*.cpp) -#file(GLOB ACE_SIMULATION_SOURCES simulation/*.h simulation/*.hpp simulation/*.c simulation/*.cpp) -#file(GLOB ACE_DIRECTX_SOURCES directx/*.h directx/*.hpp directx/*.c directx/*.cpp) -#file(GLOB ACE_GLM_SOURCES glm/*.h glm/*.hpp glm/*.c glm/*.cpp) - -SOURCE_GROUP("common" FILES ${ACE_BASE_COMMON_SOURCES}) -#SOURCE_GROUP("p3d" FILES ${ACE_P3D_SOURCES}) -#SOURCE_GROUP("pbo" FILES ${ACE_PBO_SOURCES}) -#SOURCE_GROUP("simulation" FILES ${ACE_SIMULATION_SOURCES}) -#SOURCE_GROUP("directx" FILES ${ACE_DIRECTX_SOURCES}) -#SOURCE_GROUP("glm" FILES ${ACE_GLM_SOURCES}) - -add_library(ace_common STATIC ${ACE_GLM_SOURCES} ${ACE_BASE_COMMON_SOURCES} ${ACE_P3D_SOURCES} ${ACE_PBO_SOURCES} ${ACE_SIMULATION_SOURCES} ${ACE_DIRECTX_SOURCES}) diff --git a/extensions/common/ace_common.cpp b/extensions/common/ace_common.cpp deleted file mode 100644 index 2f887450f24..00000000000 --- a/extensions/common/ace_common.cpp +++ /dev/null @@ -1,4 +0,0 @@ - -int test(int var) { - return var; -} \ No newline at end of file diff --git a/extensions/common/ace_common.h b/extensions/common/ace_common.h deleted file mode 100644 index 8da16d779a1..00000000000 --- a/extensions/common/ace_common.h +++ /dev/null @@ -1,4 +0,0 @@ -#pragma once - -#include "targetver.h" -#include "ace_version.hpp" diff --git a/extensions/common/ace_version.hpp.in b/extensions/common/ace_version.hpp.in deleted file mode 100644 index 48ff6e75c19..00000000000 --- a/extensions/common/ace_version.hpp.in +++ /dev/null @@ -1,4 +0,0 @@ -#pragma once - -#define ACE_VERSION_STR "@ACE_VERSION_MAJOR@.@ACE_VERSION_MINOR@.@ACE_VERSION_REVISION@" -#define ACE_FULL_VERSION_STR "@ACE_VERSION_MAJOR@.@ACE_VERSION_MINOR@.@ACE_VERSION_REVISION@-@ACE_VERSION_BUILD@" \ No newline at end of file diff --git a/extensions/common/ace_version_win32.rc.in b/extensions/common/ace_version_win32.rc.in deleted file mode 100644 index 5bba006f9a3..00000000000 --- a/extensions/common/ace_version_win32.rc.in +++ /dev/null @@ -1,47 +0,0 @@ -#ifdef _WIN32 - - #include <windows.h> - - #ifndef DEBUG - #define VER_DEBUG 0 - #else - #define VER_DEBUG VS_FF_DEBUG - #endif - - VS_VERSION_INFO VERSIONINFO - FILEVERSION @ACE_VERSION_MAJOR@, @ACE_VERSION_MINOR@, @ACE_VERSION_REVISION@ - PRODUCTVERSION @ACE_VERSION_MAJOR@, @ACE_VERSION_MINOR@, @ACE_VERSION_REVISION@ - FILEFLAGSMASK VS_FFI_FILEFLAGSMASK - FILEFLAGS (VS_FF_PRIVATEBUILD|VS_FF_PRERELEASE|VER_DEBUG) - FILEOS VOS__WINDOWS32 - FILETYPE VFT_DLL - FILESUBTYPE VFT2_UNKNOWN - BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904E4" - BEGIN - VALUE "CompanyName", "ACE3 Team" - VALUE "FileDescription", "@ACE_VERSION_MAJOR@.@ACE_VERSION_MINOR@.@ACE_VERSION_REVISION@-@ACE_VERSION_BUILD@" - VALUE "FileVersion", "@ACE_VERSION_MAJOR@.@ACE_VERSION_MINOR@.@ACE_VERSION_REVISION@-@ACE_VERSION_BUILD@" - VALUE "ProductName", "ACE3" - VALUE "ProductVersion", "@ACE_VERSION_MAJOR@.@ACE_VERSION_MINOR@.@ACE_VERSION_REVISION@-@ACE_VERSION_BUILD@" - VALUE "Build Date", "@ACE_BUILDSTAMP@" - END - END - - BLOCK "VarFileInfo" - BEGIN - /* The following line should only be modified for localized versions. */ - /* It consists of any number of WORD,WORD pairs, with each pair */ - /* describing a language,codepage combination supported by the file. */ - /* */ - /* For example, a file might have values "0x409,1252" indicating that it */ - /* supports English language (0x409) in the Windows ANSI codepage (1252). */ - - VALUE "Translation", 0x409, 1252 - - END - END - -#endif \ No newline at end of file diff --git a/extensions/common/arguments.hpp b/extensions/common/arguments.hpp deleted file mode 100644 index 7869cc2998e..00000000000 --- a/extensions/common/arguments.hpp +++ /dev/null @@ -1,90 +0,0 @@ -#pragma once - -#include "shared.hpp" -#include "vector.hpp" - -#include <vector> -#include <string> - -namespace ace { - class argument_accessor { - public: - argument_accessor(const uint32_t index, const std::vector<std::string> & ar) : _index(index), _args(ar) { } - - const std::string & as_string() const { return _args[_index]; } - operator const std::string &() const { return as_string(); } - - float as_float() const { return atof(_args[_index].c_str()); } - operator float() const { return as_float(); } - - int as_int() const { return atoi(_args[_index].c_str()); } - operator int() const { return as_int(); } - - int as_uint32() const { return (uint32_t)atoi(_args[_index].c_str()); } - operator uint32_t() const { return as_uint32(); } - - ace::vector3<float> as_vector() const { - std::vector<std::string> t = ace::split(_args[_index], ';'); - return ace::vector3<float>(atof(t[0].c_str()), - atof(t[1].c_str()), - atof(t[2].c_str())); - } - operator ace::vector3<float>() const { return as_vector(); } - - protected: - const uint32_t _index; - const std::vector<std::string> & _args; - }; - - class arguments { - public: - arguments(const std::string & str) : _original(str) { - _args = ace::split(str, ','); - for (int i = 0; i < _args.size(); i++) { - _args[i] = trim(_args[i]); - } - } - - size_t size() const { return _args.size(); } - - const argument_accessor operator[] (int index) const { return argument_accessor(index, _args); } - - const std::string & as_string(uint32_t _index) const { return _args[_index]; } - float as_float(uint32_t _index) const { return atof(_args[_index].c_str()); } - int as_int(uint32_t _index) const { return atoi(_args[_index].c_str()); } - int as_uint32(uint32_t _index) const { return (uint32_t)atoi(_args[_index].c_str()); } - ace::vector3<float> as_vector(uint32_t _index) const { - std::vector<std::string> t = ace::split(_args[_index], ';'); - return ace::vector3<float>(atof(t[0].c_str()), - atof(t[1].c_str()), - atof(t[2].c_str())); - } - - const std::string & get() const { - return _original; - } - - std::string create(const std::string & command) const { - std::stringstream ss; - ss << command << ":"; - - for (auto & v : _args) { - ss << v << ","; - } - - // Remove the trailing , - std::string result = ss.str(); - result.erase(result.length()); - - return result; - } - static std::string create(const std::string & command, const arguments & args) { - return args.create(command); - } - - - protected: - std::vector<std::string> _args; - const std::string _original; - }; -} \ No newline at end of file diff --git a/extensions/common/directx/d3d_display.cpp b/extensions/common/directx/d3d_display.cpp deleted file mode 100644 index b434264b69a..00000000000 --- a/extensions/common/directx/d3d_display.cpp +++ /dev/null @@ -1,440 +0,0 @@ -#ifdef USE_DIRECTX - -#include "shared.hpp" -#include "d3d_display.hpp" - -#include <TlHelp32.h> - -#include <thread> - -using namespace DirectX; - -namespace ace { - namespace debug { - - DWORD GetMainThreadId() { - const std::shared_ptr<void> hThreadSnapshot( - CreateToolhelp32Snapshot(TH32CS_SNAPTHREAD, 0), CloseHandle); - if (hThreadSnapshot.get() == INVALID_HANDLE_VALUE) { - throw std::runtime_error("GetMainThreadId failed"); - } - THREADENTRY32 tEntry; - tEntry.dwSize = sizeof(THREADENTRY32); - DWORD result = 0; - DWORD currentPID = GetCurrentProcessId(); - for (BOOL success = Thread32First(hThreadSnapshot.get(), &tEntry); - !result && success && GetLastError() != ERROR_NO_MORE_FILES; - success = Thread32Next(hThreadSnapshot.get(), &tEntry)) - { - if (tEntry.th32OwnerProcessID == currentPID) { - result = tEntry.th32ThreadID; - } - } - return result; - } - - d3d_display::d3d_display() : _fullscreen(false) {} - d3d_display::~d3d_display() {} - - bool d3d_display::render_thread(uint32_t w, uint32_t h, bool f) { - _render_thread = std::make_unique<d3d_display_worker>(this, d3d_display_worker_args(w, h, f) ); - return true; - } - - void d3d_display::render_worker(d3d_display_worker_args args) { - { - create(args.width, args.height, args.fullscreen); - init(); - } - run(); - } - - bool d3d_display::run() { - MSG msg = { 0 }; - - while (WM_QUIT != msg.message) { - if (PeekMessage(&msg, nullptr, 0, 0, PM_REMOVE)) { - TranslateMessage(&msg); - DispatchMessage(&msg); - } else { - render(); - } - } - - return true; - } - - bool d3d_display::init() { - - std::lock_guard<std::mutex> _lock(_render_lock); - - HRESULT hr = S_OK; - RECT rc; - - GetClientRect(_hWnd, &rc); - UINT width = rc.right - rc.left; - UINT height = rc.bottom - rc.top; - UINT createDeviceFlags = 0; -#ifdef _DEBUG - createDeviceFlags |= D3D11_CREATE_DEVICE_DEBUG; -#endif - - D3D_DRIVER_TYPE driverTypes[] = - { - D3D_DRIVER_TYPE_HARDWARE, - D3D_DRIVER_TYPE_WARP, - D3D_DRIVER_TYPE_REFERENCE, - }; - UINT numDriverTypes = ARRAYSIZE(driverTypes); - - D3D_FEATURE_LEVEL featureLevels[] = - { - D3D_FEATURE_LEVEL_11_0, - D3D_FEATURE_LEVEL_10_1, - D3D_FEATURE_LEVEL_10_0, - }; - UINT numFeatureLevels = ARRAYSIZE(featureLevels); - - DXGI_SWAP_CHAIN_DESC sd; - ZeroMemory(&sd, sizeof(sd)); - sd.BufferCount = 1; - sd.BufferDesc.Width = width; - sd.BufferDesc.Height = height; - sd.BufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; - sd.BufferDesc.RefreshRate.Numerator = 60; - sd.BufferDesc.RefreshRate.Denominator = 1; - sd.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT; - sd.OutputWindow = _hWnd; - sd.SampleDesc.Count = 1; - sd.SampleDesc.Quality = 0; - sd.Windowed = _fullscreen ? FALSE : TRUE; - - for (UINT driverTypeIndex = 0; driverTypeIndex < numDriverTypes; driverTypeIndex++) - { - _driverType = driverTypes[driverTypeIndex]; - hr = D3D11CreateDeviceAndSwapChain(nullptr, _driverType, nullptr, createDeviceFlags, featureLevels, numFeatureLevels, - D3D11_SDK_VERSION, &sd, &_pSwapChain, &_pd3dDevice, &_featureLevel, &_pImmediateContext); - if (SUCCEEDED(hr)) - break; - } - if (FAILED(hr)) - return false; - - // Create a render target view - ID3D11Texture2D* pBackBuffer = nullptr; - hr = _pSwapChain->GetBuffer(0, __uuidof(ID3D11Texture2D), (LPVOID*)&pBackBuffer); - if (FAILED(hr)) - return false; - - hr = _pd3dDevice->CreateRenderTargetView(pBackBuffer, nullptr, &_pRenderTargetView); - pBackBuffer->Release(); - if (FAILED(hr)) - return false; - - // Create depth stencil texture - D3D11_TEXTURE2D_DESC descDepth; - ZeroMemory(&descDepth, sizeof(descDepth)); - descDepth.Width = width; - descDepth.Height = height; - descDepth.MipLevels = 1; - descDepth.ArraySize = 1; - descDepth.Format = DXGI_FORMAT_D24_UNORM_S8_UINT; - descDepth.SampleDesc.Count = 1; - descDepth.SampleDesc.Quality = 0; - descDepth.Usage = D3D11_USAGE_DEFAULT; - descDepth.BindFlags = D3D11_BIND_DEPTH_STENCIL; - descDepth.CPUAccessFlags = 0; - descDepth.MiscFlags = 0; - hr = _pd3dDevice->CreateTexture2D(&descDepth, nullptr, &_pDepthStencil); - if (FAILED(hr)) - return false; - - // Create the depth stencil view - D3D11_DEPTH_STENCIL_VIEW_DESC descDSV; - ZeroMemory(&descDSV, sizeof(descDSV)); - descDSV.Format = descDepth.Format; - descDSV.ViewDimension = D3D11_DSV_DIMENSION_TEXTURE2D; - descDSV.Texture2D.MipSlice = 0; - hr = _pd3dDevice->CreateDepthStencilView(_pDepthStencil, &descDSV, &_pDepthStencilView); - if (FAILED(hr)) - return false; - - _pImmediateContext->OMSetRenderTargets(1, &_pRenderTargetView, _pDepthStencilView); - - // Setup the viewport - D3D11_VIEWPORT vp; - vp.Width = (FLOAT)width; - vp.Height = (FLOAT)height; - vp.MinDepth = 0.0f; - vp.MaxDepth = 1.0f; - vp.TopLeftX = 0; - vp.TopLeftY = 0; - _pImmediateContext->RSSetViewports(1, &vp); - - XMStoreFloat4x4(&_World, XMMatrixIdentity()); - XMStoreFloat4x4(&_View, XMMatrixLookAtLH(XMLoadFloat4(&_camera.camPosition), XMLoadFloat4(&_camera.camTarget), XMLoadFloat4(&_camera.camUp))); - XMStoreFloat4x4(&_Projection, XMMatrixPerspectiveFovLH(XM_PIDIV4, width / (FLOAT)height, 0.01f, 100.0f)); - - init_input(); - - return true; - } - - bool d3d_display::init_input() { - RAWINPUTDEVICE Rid[2]; - - Rid[0].usUsagePage = 0x01; // magic numbers - Rid[0].usUsage = 0x02; // magically means mouse - Rid[0].dwFlags = 0; // (use this if you DO NOT WANT to capture mouse) - //Rid[0].dwFlags = RIDEV_CAPTUREMOUSE | RIDEV_NOLEGACY ; // (use this to CAPTURE MOUSE) - Rid[0].hwndTarget = _hWnd; - - Rid[1].usUsagePage = 0x01; // magic numbers - Rid[1].usUsage = 0x06; // magically means keyboard - Rid[1].dwFlags = 0; // use RIDEV_NOHOTKEYS for no winkey - Rid[1].hwndTarget = _hWnd; - - if (!RegisterRawInputDevices(Rid, 2, sizeof(Rid[0]))) { - LOG(ERROR) << "Could not register raw input devices. "; - exit(1); - } - return true; - } - - bool d3d_display::create(uint32_t width = 1024, uint32_t height = 768, bool fullscreen = false) { - std::lock_guard<std::mutex> _lock(_render_lock); - - _fullscreen = fullscreen; - - WNDCLASSEXW wcex; - wcex.cbSize = sizeof(WNDCLASSEXW); - wcex.style = CS_HREDRAW | CS_VREDRAW; - wcex.lpfnWndProc = (WNDPROC)&ace::debug::d3d_display::wndproc; - wcex.cbClsExtra = 0; - wcex.cbWndExtra = 0; - wcex.hInstance = (HINSTANCE)GetCurrentProcess(); - //wcex.hIcon = LoadIcon(hInstance, (LPCTSTR)IDI_SAMPLE1); - //wcex.hCursor = LoadCursor(nullptr, IDC_ARROW); - wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1); - wcex.lpszMenuName = nullptr; - wcex.lpszClassName = L"ACE3BaseDisplayClass"; - //wcex.hIconSm = LoadIcon(wcex.hInstance, (LPCTSTR)IDI_SAMPLE1); - if (!RegisterClassExW(&wcex)) { - return false; - } - - // Create window - _hInst = (HINSTANCE)GetCurrentProcess(); - RECT rc = { 0, 0, width, height }; - AdjustWindowRect(&rc, WS_OVERLAPPEDWINDOW, FALSE); - _hWnd = CreateWindowW(L"ACE3BaseDisplayClass", L"ACE3 D3D Render", WS_OVERLAPPEDWINDOW, - CW_USEDEFAULT, CW_USEDEFAULT, rc.right - rc.left, rc.bottom - rc.top, nullptr, nullptr, _hInst, - nullptr); - - if (!_hWnd) { - return false; - } - - // Attach our input to the master input - //AttachThreadInput(GetCurrentThreadId(), GetMainThraedId()); - - SetWindowLongPtr(_hWnd, GWLP_USERDATA, (LONG)this); - - ShowWindow(_hWnd, 5); - - return true; - } - - bool d3d_display::destroy() { - if (_pImmediateContext) _pImmediateContext->ClearState(); - - if (_pBatchInputLayout) _pBatchInputLayout->Release(); - - if (_pTextureRV1) _pTextureRV1->Release(); - if (_pTextureRV2) _pTextureRV2->Release(); - - if (_pDepthStencilView) _pDepthStencilView->Release(); - if (_pDepthStencil) _pDepthStencil->Release(); - if (_pRenderTargetView) _pRenderTargetView->Release(); - if (_pSwapChain) _pSwapChain->Release(); - if (_pImmediateContext) _pImmediateContext->Release(); - if (_pd3dDevice) _pd3dDevice->Release(); - - return true; - } - - bool d3d_display::render() { - // Update our time - static float t = 0.0f; - static float dt = 0.f; - if (_driverType == D3D_DRIVER_TYPE_REFERENCE) { - t += (float)XM_PI * 0.0125f; - } else { - static uint64_t dwTimeStart = 0; - static uint64_t dwTimeLast = 0; - uint64_t dwTimeCur = GetTickCount64(); - if (dwTimeStart == 0) - dwTimeStart = dwTimeCur; - t = (dwTimeCur - dwTimeStart) / 1000.0f; - dt = (dwTimeCur - dwTimeLast) / 1000.0f; - dwTimeLast = dwTimeCur; - } - - { - std::lock_guard<std::mutex> _lock(_render_lock); - - _pImmediateContext->ClearRenderTargetView(_pRenderTargetView, Colors::MidnightBlue); - _pImmediateContext->ClearDepthStencilView(_pDepthStencilView, D3D11_CLEAR_DEPTH, 1.0f, 0); - - update_camera(); - step(); - - _pSwapChain->Present(0, 0); - } - - return true; - } - - bool d3d_display::step() { - return true; - } - - void d3d_display::_move_camera(ace::vector3<float> direction) { - - } - void d3d_display::_rotate_camera(ace::vector3<float> direction) { - - } - void d3d_display::update_camera() { - XMVECTOR DefaultForward, DefaultRight, camPosition; - - DefaultForward = XMLoadFloat4(&_camera.DefaultForward); - DefaultRight = XMLoadFloat4(&_camera.DefaultRight); - camPosition = XMLoadFloat4(&_camera.camPosition); - - XMMATRIX camRotationMatrix = XMMatrixRotationRollPitchYaw(_camera.camPitch, _camera.camYaw, 0); - XMVECTOR camTarget = XMVector3TransformCoord(DefaultForward, camRotationMatrix); - camTarget = XMVector3Normalize(camTarget); - - XMVECTOR camRight = XMVector3TransformCoord(DefaultRight, camRotationMatrix); - XMVECTOR camForward = XMVector3TransformCoord(DefaultForward, camRotationMatrix); - XMVECTOR camUp = XMVector3Cross(camForward, camRight); - - camPosition += _camera.moveLeftRight * camRight; - camPosition += _camera.moveBackForward * camForward; - XMStoreFloat4(&_camera.camPosition, camPosition); - - _camera.moveLeftRight = 0.0f; - _camera.moveBackForward = 0.0f; - - camTarget = camPosition + camTarget; - - XMStoreFloat4x4(&_View, XMMatrixLookAtLH(camPosition, camTarget, camUp)); - } - - LRESULT CALLBACK d3d_display::_wndproc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { - PAINTSTRUCT ps; - HDC hdc; - - switch (message) { - case WM_INPUT: { - UINT dwSize; - if (GetActiveWindow() != _hWnd) { - return DefWindowProc(hWnd, message, wParam, lParam); - } - GetRawInputData((HRAWINPUT)lParam, RID_INPUT, NULL, &dwSize, - sizeof(RAWINPUTHEADER)); - LPBYTE lpb = new BYTE[dwSize]; - if (lpb == NULL) { - return 0; - } - - int readSize = GetRawInputData((HRAWINPUT)lParam, RID_INPUT, lpb, &dwSize, sizeof(RAWINPUTHEADER)); - - if (readSize != dwSize) - break; - - RAWINPUT* raw = (RAWINPUT*)lpb; - - float speed = 0.5f; - - if (raw->header.dwType == RIM_TYPEKEYBOARD) { - switch (raw->data.keyboard.VKey) { - case VK_SPACE: { - XMStoreFloat4(&_camera.camPosition, XMVectorSet(0, 0, 0, 0)); - break; - } - // Camera Movement - case 0x57: case VK_NUMPAD8: - case VK_UP: { - _camera.moveBackForward += speed; - break; - } - case 0x53: case VK_NUMPAD2: - case VK_DOWN: { - _camera.moveBackForward -= speed; - break; - } - case 0x41: case VK_NUMPAD4: - case VK_LEFT: { - _camera.moveLeftRight -= speed; - break; - } - case 0x44: case VK_NUMPAD6: - case VK_RIGHT: { - _camera.moveLeftRight += speed; - break; - } - // Numpad Movement - case VK_NUMPAD5: { - XMStoreFloat4(&_camera.camPosition, XMVectorSet(0, 0, 0, 0)); - break; - } - } - } - else if (raw->header.dwType == RIM_TYPEMOUSE) { - RAWMOUSE mouseCurrState = raw->data.mouse; - - if ((mouseCurrState.lLastX != _last_mouse_state.lLastY) || (mouseCurrState.lLastX != _last_mouse_state.lLastY)) - { - _camera.camYaw += mouseCurrState.lLastX * 0.005f; - _camera.camPitch += mouseCurrState.lLastY * 0.005f; - _last_mouse_state = mouseCurrState; - } - - } - - delete[] lpb; - return 0; - } - - case WM_PAINT: - hdc = BeginPaint(hWnd, &ps); - EndPaint(hWnd, &ps); - break; - - case WM_DESTROY: - PostQuitMessage(0); - - break; - default: - return DefWindowProc(hWnd, message, wParam, lParam); - } - - return 0; - } - LRESULT CALLBACK d3d_display::wndproc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { - LONG data; - data = GetWindowLongPtr(hWnd, GWLP_USERDATA); - if (data) { - return ((d3d_display*)data)->_wndproc(hWnd, message, wParam, lParam); - } else { - return DefWindowProc(hWnd, message, wParam, lParam); - } - } - }; - - -}; - -#endif \ No newline at end of file diff --git a/extensions/common/directx/d3d_display.hpp b/extensions/common/directx/d3d_display.hpp deleted file mode 100644 index c17eedf8ccc..00000000000 --- a/extensions/common/directx/d3d_display.hpp +++ /dev/null @@ -1,130 +0,0 @@ -#pragma once - -#ifdef USE_DIRECTX - -#include <windows.h> -#include <d3d11_1.h> -#include <directxcolors.h> -#include <DirectXMath.h> - -#include <thread> -#include <memory> -#include <mutex> - -#include "singleton.hpp" -#include "vector.hpp" - -#define IDI_ACE_DEBUG 666 - -namespace ace { - namespace debug { - - __declspec(align(16)) - struct camera_movement { - camera_movement() { - XMStoreFloat4(&DefaultForward, DirectX::XMVectorSet(0.0f, 0.0f, 1.0f, 0.0f)); - XMStoreFloat4(&DefaultRight, DirectX::XMVectorSet(1.0f, 0.0f, 0.0f, 0.0f)); - XMStoreFloat4(&camForward, DirectX::XMVectorSet(0.0f, 0.0f, 1.0f, 0.0f)); - XMStoreFloat4(&camRight, DirectX::XMVectorSet(1.0f, 0.0f, 0.0f, 0.0f)); - - camYaw = 0.0f; - camPitch = 0.0f; - - moveLeftRight = 0.0f; - moveBackForward = 0.0f; - - XMStoreFloat4(&camPosition, DirectX::XMVectorSet(0.0f, 12.0f, 6.0f, 0.0f)); - XMStoreFloat4(&camTarget, DirectX::XMVectorSet(0.0f, 0.0f, 0.0f, 0.0f)); - XMStoreFloat4(&camUp, DirectX::XMVectorSet(0.0f, 1.0f, 0.0f, 0.0f)); - } - - DirectX::XMFLOAT4 DefaultForward; - DirectX::XMFLOAT4 DefaultRight; - DirectX::XMFLOAT4 camForward; - DirectX::XMFLOAT4 camRight; - - DirectX::XMFLOAT4X4 camRotationMatrix; - DirectX::XMFLOAT4X4 groundWorld; - - float moveLeftRight; - float moveBackForward; - - float camYaw; - float camPitch; - - DirectX::XMFLOAT4 camPosition; - DirectX::XMFLOAT4 camTarget; - DirectX::XMFLOAT4 camUp; - }; - - struct d3d_display_worker; - struct d3d_display_worker_args; - __declspec(align(16)) - class d3d_display { - public: - d3d_display(); - ~d3d_display(); - - virtual bool run(); - virtual bool render(); - virtual bool render_thread(uint32_t, uint32_t, bool); - - virtual void update_camera(); - virtual bool step(); - - virtual bool create(uint32_t, uint32_t, bool); - virtual bool init(); - virtual bool init_input(); - - virtual bool destroy(); - - void render_worker(d3d_display_worker_args); - - static LRESULT CALLBACK wndproc(HWND, UINT, WPARAM, LPARAM); - LRESULT CALLBACK _wndproc(HWND, UINT, WPARAM, LPARAM); - protected: - void _move_camera(ace::vector3<float>); - void _rotate_camera(ace::vector3<float>); - - std::unique_ptr<d3d_display_worker> _render_thread; - std::mutex _render_lock; - - bool _fullscreen; - HINSTANCE _hInst = nullptr; - HWND _hWnd = nullptr; - D3D_DRIVER_TYPE _driverType = D3D_DRIVER_TYPE_NULL; - D3D_FEATURE_LEVEL _featureLevel = D3D_FEATURE_LEVEL_11_0; - ID3D11Device* _pd3dDevice = nullptr; - ID3D11DeviceContext* _pImmediateContext = nullptr; - IDXGISwapChain* _pSwapChain = nullptr; - ID3D11RenderTargetView* _pRenderTargetView = nullptr; - ID3D11Texture2D* _pDepthStencil = nullptr; - ID3D11DepthStencilView* _pDepthStencilView = nullptr; - - ID3D11ShaderResourceView* _pTextureRV1 = nullptr; - ID3D11ShaderResourceView* _pTextureRV2 = nullptr; - ID3D11InputLayout* _pBatchInputLayout = nullptr; - - DirectX::XMFLOAT4X4 _World; - DirectX::XMFLOAT4X4 _View; - DirectX::XMFLOAT4X4 _Projection; - - RAWMOUSE _last_mouse_state; - camera_movement _camera; - - }; - struct d3d_display_worker_args { - d3d_display_worker_args(uint32_t w, uint32_t h, bool f) : width(w), height(h), fullscreen(f) {} - uint32_t width; - uint32_t height; - bool fullscreen; - }; - struct d3d_display_worker { - d3d_display_worker(d3d_display * obj, d3d_display_worker_args args) : thread(&ace::debug::d3d_display::render_worker, obj, args) {} - ~d3d_display_worker() { thread.join(); } - std::thread thread; - }; - }; -}; - -#endif \ No newline at end of file diff --git a/extensions/common/dispatch.hpp b/extensions/common/dispatch.hpp deleted file mode 100644 index 5292336b850..00000000000 --- a/extensions/common/dispatch.hpp +++ /dev/null @@ -1,153 +0,0 @@ -#pragma once - -#include <thread> -#include <mutex> -#include <atomic> -#include <queue> - -#include "shared.hpp" -#include "arguments.hpp" -#include "singleton.hpp" - -namespace ace { - class dispatcher { - public: - dispatcher() : _ready(true) {} - - virtual bool call(const std::string & name_, const arguments & args_, std::string & result_) { - if (_methods.find(name_) == _methods.end()) { - // @TODO: Exceptions - return false; - } - return _methods[name_](args_, result_); - } - - bool add(const std::string & name_, std::function<bool(const arguments &, std::string &)> func_) { - if (_methods.find(name_) != _methods.end()) { - // @TODO: Exceptions - return false; - } - _methods[name_] = func_; - - return true; - } - - bool ready() const { return _ready; } - void ready(bool r) { _ready.exchange(r); } - protected: - std::unordered_map < std::string, std::function<bool(const arguments &, std::string &)> > _methods; - std::atomic_bool _ready; - }; - class dispatch : public dispatcher, public singleton<dispatch> { }; - - struct dispatch_message { - dispatch_message(const std::string & command_, const arguments & args_, const uint64_t id_) : command(command_), args(args_), id(id_) {} - std::string command; - arguments args; - uint64_t id; - }; - struct dispatch_result { - dispatch_result() {} - dispatch_result(const std::string &res, const uint64_t id_) : message(res), id(id_) {} - std::string message; - uint64_t id; - }; - - class threaded_dispatcher : public dispatcher { - public: - threaded_dispatcher() : _stop(false), _worker(&ace::threaded_dispatcher::monitor, this) { - - } - ~threaded_dispatcher() {} - - bool call(const std::string & name_, const arguments & args_, std::string & result_, bool threaded) { - if (_methods.find(name_) == _methods.end()) { - // @TODO: Exceptions - return false; - } - if (threaded) { - std::lock_guard<std::mutex> lock(_messages_lock); - _messages.push(dispatch_message(name_, args_, _message_id)); - - // @TODO: We should provide an interface for this serialization. - std::stringstream ss; - ss << "[\"result_id\", \"" << _message_id << "\" ]"; - result_ = ss.str(); - - _message_id = _message_id + 1; - } else { -#ifdef _DEBUG - if (name_ != "fetch_result") { - LOG(TRACE) << "dispatch[immediate]:\t[" << name_ << "] { " << args_.get() << " }"; - } -#endif - return dispatcher::call(name_, args_, result_); - } - - return true; - } - bool call(const std::string & name_, const arguments & args_, std::string & result_) override { - return call(name_, args_, result_, false); - } - - void push_result(const dispatch_result & result) { - { - std::lock_guard<std::mutex> lock(_results_lock); - _results.push(result); - } - } - void push_result(const std::string & result) { - push_result(dispatch_result(result, -1)); - } - void stop() { - std::lock_guard<std::mutex> lock(_messages_lock); - _stop = true; - } - protected: - void monitor() { - _ready = false; - while (!_stop) { - { - std::lock_guard<std::mutex> lock(_messages_lock); - while (!_messages.empty()) { - if (_ready) { - dispatch_result result; - dispatch_message _message = std::move(_messages.front()); - _messages.pop(); - - result.id = _message.id; - result.message.resize(4096); -#ifdef _DEBUG - if (_message.command != "fetch_result") { - LOG(TRACE) << "dispatch[threaded]:\t[" << _message.command << "]"; - if (_message.args.size() > 0) { - // LOG(TRACE) << "\t{ " << _messages.front().args.get() << " }"; - } - } -#endif - dispatcher::call(_message.command, _message.args, result.message); - { - std::lock_guard<std::mutex> lock(_results_lock); - _results.push(result); - } - - - } - } - } - sleep(5); - } - } - std::atomic_bool _stop; - std::queue<dispatch_result> _results; - std::mutex _results_lock; - - std::queue<dispatch_message> _messages; - std::mutex _messages_lock; - - std::thread _worker; - - uint64_t _message_id; - }; - class threaded_dispatch : public threaded_dispatcher, public singleton<dispatch> { }; -}; \ No newline at end of file diff --git a/extensions/common/glm/CMakeLists.txt b/extensions/common/glm/CMakeLists.txt deleted file mode 100644 index aaeae6269e1..00000000000 --- a/extensions/common/glm/CMakeLists.txt +++ /dev/null @@ -1,43 +0,0 @@ -set(NAME glm_dummy) - -file(GLOB ROOT_SOURCE *.cpp) -file(GLOB ROOT_INLINE *.inl) -file(GLOB ROOT_HEADER *.hpp) -file(GLOB ROOT_TEXT ../*.txt) -file(GLOB ROOT_NAT ../util/glm.natvis) - -file(GLOB_RECURSE CORE_SOURCE ./detail/*.cpp) -file(GLOB_RECURSE CORE_INLINE ./detail/*.inl) -file(GLOB_RECURSE CORE_HEADER ./detail/*.hpp) - -file(GLOB_RECURSE GTC_SOURCE ./gtc/*.cpp) -file(GLOB_RECURSE GTC_INLINE ./gtc/*.inl) -file(GLOB_RECURSE GTC_HEADER ./gtc/*.hpp) - -file(GLOB_RECURSE GTX_SOURCE ./gtx/*.cpp) -file(GLOB_RECURSE GTX_INLINE ./gtx/*.inl) -file(GLOB_RECURSE GTX_HEADER ./gtx/*.hpp) - -source_group("Text Files" FILES ${ROOT_TEXT}) -source_group("Core Files" FILES ${CORE_SOURCE}) -source_group("Core Files" FILES ${CORE_INLINE}) -source_group("Core Files" FILES ${CORE_HEADER}) -source_group("GTC Files" FILES ${GTC_SOURCE}) -source_group("GTC Files" FILES ${GTC_INLINE}) -source_group("GTC Files" FILES ${GTC_HEADER}) -source_group("GTX Files" FILES ${GTX_SOURCE}) -source_group("GTX Files" FILES ${GTX_INLINE}) -source_group("GTX Files" FILES ${GTX_HEADER}) - -include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..) - -if(GLM_TEST_ENABLE) - add_executable(${NAME} ${ROOT_TEXT} ${ROOT_NAT} - ${ROOT_SOURCE} ${ROOT_INLINE} ${ROOT_HEADER} - ${CORE_SOURCE} ${CORE_INLINE} ${CORE_HEADER} - ${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER} - ${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER}) -endif(GLM_TEST_ENABLE) - -#add_library(glm STATIC glm.cpp) -#add_library(glm_shared SHARED glm.cpp) diff --git a/extensions/common/glm/common.hpp b/extensions/common/glm/common.hpp deleted file mode 100644 index 9ee54256433..00000000000 --- a/extensions/common/glm/common.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/common.hpp -/// @date 2013-12-24 / 2013-12-24 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "detail/func_common.hpp" diff --git a/extensions/common/glm/detail/_features.hpp b/extensions/common/glm/detail/_features.hpp deleted file mode 100644 index 1e6089d2317..00000000000 --- a/extensions/common/glm/detail/_features.hpp +++ /dev/null @@ -1,428 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/_features.hpp -/// @date 2013-02-20 / 2013-02-20 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// #define GLM_CXX98_EXCEPTIONS -// #define GLM_CXX98_RTTI - -// #define GLM_CXX11_RVALUE_REFERENCES -// Rvalue references - GCC 4.3 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2118.html - -// GLM_CXX11_TRAILING_RETURN -// Rvalue references for *this - GCC not supported -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2439.htm - -// GLM_CXX11_NONSTATIC_MEMBER_INIT -// Initialization of class objects by rvalues - GCC any -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1610.html - -// GLM_CXX11_NONSTATIC_MEMBER_INIT -// Non-static data member initializers - GCC 4.7 -// http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2008/n2756.htm - -// #define GLM_CXX11_VARIADIC_TEMPLATE -// Variadic templates - GCC 4.3 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2242.pdf - -// -// Extending variadic template template parameters - GCC 4.4 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2555.pdf - -// #define GLM_CXX11_GENERALIZED_INITIALIZERS -// Initializer lists - GCC 4.4 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2672.htm - -// #define GLM_CXX11_STATIC_ASSERT -// Static assertions - GCC 4.3 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1720.html - -// #define GLM_CXX11_AUTO_TYPE -// auto-typed variables - GCC 4.4 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1984.pdf - -// #define GLM_CXX11_AUTO_TYPE -// Multi-declarator auto - GCC 4.4 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1737.pdf - -// #define GLM_CXX11_AUTO_TYPE -// Removal of auto as a storage-class specifier - GCC 4.4 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2546.htm - -// #define GLM_CXX11_AUTO_TYPE -// New function declarator syntax - GCC 4.4 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2541.htm - -// #define GLM_CXX11_LAMBDAS -// New wording for C++0x lambdas - GCC 4.5 -// http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2927.pdf - -// #define GLM_CXX11_DECLTYPE -// Declared type of an expression - GCC 4.3 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2343.pdf - -// -// Right angle brackets - GCC 4.3 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1757.html - -// -// Default template arguments for function templates DR226 GCC 4.3 -// http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#226 - -// -// Solving the SFINAE problem for expressions DR339 GCC 4.4 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2634.html - -// #define GLM_CXX11_ALIAS_TEMPLATE -// Template aliases N2258 GCC 4.7 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf - -// -// Extern templates N1987 Yes -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1987.htm - -// #define GLM_CXX11_NULLPTR -// Null pointer constant N2431 GCC 4.6 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf - -// #define GLM_CXX11_STRONG_ENUMS -// Strongly-typed enums N2347 GCC 4.4 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2347.pdf - -// -// Forward declarations for enums N2764 GCC 4.6 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2764.pdf - -// -// Generalized attributes N2761 GCC 4.8 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2761.pdf - -// -// Generalized constant expressions N2235 GCC 4.6 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2235.pdf - -// -// Alignment support N2341 GCC 4.8 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2341.pdf - -// #define GLM_CXX11_DELEGATING_CONSTRUCTORS -// Delegating constructors N1986 GCC 4.7 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1986.pdf - -// -// Inheriting constructors N2540 GCC 4.8 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2540.htm - -// #define GLM_CXX11_EXPLICIT_CONVERSIONS -// Explicit conversion operators N2437 GCC 4.5 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2437.pdf - -// -// New character types N2249 GCC 4.4 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2249.html - -// -// Unicode string literals N2442 GCC 4.5 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm - -// -// Raw string literals N2442 GCC 4.5 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm - -// -// Universal character name literals N2170 GCC 4.5 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2170.html - -// #define GLM_CXX11_USER_LITERALS -// User-defined literals N2765 GCC 4.7 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2765.pdf - -// -// Standard Layout Types N2342 GCC 4.5 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2342.htm - -// #define GLM_CXX11_DEFAULTED_FUNCTIONS -// #define GLM_CXX11_DELETED_FUNCTIONS -// Defaulted and deleted functions N2346 GCC 4.4 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2346.htm - -// -// Extended friend declarations N1791 GCC 4.7 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1791.pdf - -// -// Extending sizeof N2253 GCC 4.4 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2253.html - -// #define GLM_CXX11_INLINE_NAMESPACES -// Inline namespaces N2535 GCC 4.4 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2535.htm - -// #define GLM_CXX11_UNRESTRICTED_UNIONS -// Unrestricted unions N2544 GCC 4.6 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2544.pdf - -// #define GLM_CXX11_LOCAL_TYPE_TEMPLATE_ARGS -// Local and unnamed types as template arguments N2657 GCC 4.5 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2657.htm - -// #define GLM_CXX11_RANGE_FOR -// Range-based for N2930 GCC 4.6 -// http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2930.html - -// #define GLM_CXX11_OVERRIDE_CONTROL -// Explicit virtual overrides N2928 N3206 N3272 GCC 4.7 -// http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2928.htm -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3206.htm -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3272.htm - -// -// Minimal support for garbage collection and reachability-based leak detection N2670 No -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2670.htm - -// #define GLM_CXX11_NOEXCEPT -// Allowing move constructors to throw [noexcept] N3050 GCC 4.6 (core language only) -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3050.html - -// -// Defining move special member functions N3053 GCC 4.6 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3053.html - -// -// Sequence points N2239 Yes -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2239.html - -// -// Atomic operations N2427 GCC 4.4 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2239.html - -// -// Strong Compare and Exchange N2748 GCC 4.5 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2427.html - -// -// Bidirectional Fences N2752 GCC 4.8 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2752.htm - -// -// Memory model N2429 GCC 4.8 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2429.htm - -// -// Data-dependency ordering: atomics and memory model N2664 GCC 4.4 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2664.htm - -// -// Propagating exceptions N2179 GCC 4.4 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html - -// -// Abandoning a process and at_quick_exit N2440 GCC 4.8 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2440.htm - -// -// Allow atomics use in signal handlers N2547 Yes -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2547.htm - -// -// Thread-local storage N2659 GCC 4.8 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2659.htm - -// -// Dynamic initialization and destruction with concurrency N2660 GCC 4.3 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2660.htm - -// -// __func__ predefined identifier N2340 GCC 4.3 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2340.htm - -// -// C99 preprocessor N1653 GCC 4.3 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1653.htm - -// -// long long N1811 GCC 4.3 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1811.pdf - -// -// Extended integral types N1988 Yes -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1988.pdf - -#if(GLM_COMPILER & GLM_COMPILER_GCC) - -# if(GLM_COMPILER >= GLM_COMPILER_GCC43) -# define GLM_CXX11_STATIC_ASSERT -# endif - -#elif(GLM_COMPILER & (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM)) -# if(__has_feature(cxx_exceptions)) -# define GLM_CXX98_EXCEPTIONS -# endif - -# if(__has_feature(cxx_rtti)) -# define GLM_CXX98_RTTI -# endif - -# if(__has_feature(cxx_access_control_sfinae)) -# define GLM_CXX11_ACCESS_CONTROL_SFINAE -# endif - -# if(__has_feature(cxx_alias_templates)) -# define GLM_CXX11_ALIAS_TEMPLATE -# endif - -# if(__has_feature(cxx_alignas)) -# define GLM_CXX11_ALIGNAS -# endif - -# if(__has_feature(cxx_attributes)) -# define GLM_CXX11_ATTRIBUTES -# endif - -# if(__has_feature(cxx_constexpr)) -# define GLM_CXX11_CONSTEXPR -# endif - -# if(__has_feature(cxx_decltype)) -# define GLM_CXX11_DECLTYPE -# endif - -# if(__has_feature(cxx_default_function_template_args)) -# define GLM_CXX11_DEFAULT_FUNCTION_TEMPLATE_ARGS -# endif - -# if(__has_feature(cxx_defaulted_functions)) -# define GLM_CXX11_DEFAULTED_FUNCTIONS -# endif - -# if(__has_feature(cxx_delegating_constructors)) -# define GLM_CXX11_DELEGATING_CONSTRUCTORS -# endif - -# if(__has_feature(cxx_deleted_functions)) -# define GLM_CXX11_DELETED_FUNCTIONS -# endif - -# if(__has_feature(cxx_explicit_conversions)) -# define GLM_CXX11_EXPLICIT_CONVERSIONS -# endif - -# if(__has_feature(cxx_generalized_initializers)) -# define GLM_CXX11_GENERALIZED_INITIALIZERS -# endif - -# if(__has_feature(cxx_implicit_moves)) -# define GLM_CXX11_IMPLICIT_MOVES -# endif - -# if(__has_feature(cxx_inheriting_constructors)) -# define GLM_CXX11_INHERITING_CONSTRUCTORS -# endif - -# if(__has_feature(cxx_inline_namespaces)) -# define GLM_CXX11_INLINE_NAMESPACES -# endif - -# if(__has_feature(cxx_lambdas)) -# define GLM_CXX11_LAMBDAS -# endif - -# if(__has_feature(cxx_local_type_template_args)) -# define GLM_CXX11_LOCAL_TYPE_TEMPLATE_ARGS -# endif - -# if(__has_feature(cxx_noexcept)) -# define GLM_CXX11_NOEXCEPT -# endif - -# if(__has_feature(cxx_nonstatic_member_init)) -# define GLM_CXX11_NONSTATIC_MEMBER_INIT -# endif - -# if(__has_feature(cxx_nullptr)) -# define GLM_CXX11_NULLPTR -# endif - -# if(__has_feature(cxx_override_control)) -# define GLM_CXX11_OVERRIDE_CONTROL -# endif - -# if(__has_feature(cxx_reference_qualified_functions)) -# define GLM_CXX11_REFERENCE_QUALIFIED_FUNCTIONS -# endif - -# if(__has_feature(cxx_range_for)) -# define GLM_CXX11_RANGE_FOR -# endif - -# if(__has_feature(cxx_raw_string_literals)) -# define GLM_CXX11_RAW_STRING_LITERALS -# endif - -# if(__has_feature(cxx_rvalue_references)) -# define GLM_CXX11_RVALUE_REFERENCES -# endif - -# if(__has_feature(cxx_static_assert)) -# define GLM_CXX11_STATIC_ASSERT -# endif - -# if(__has_feature(cxx_auto_type)) -# define GLM_CXX11_AUTO_TYPE -# endif - -# if(__has_feature(cxx_strong_enums)) -# define GLM_CXX11_STRONG_ENUMS -# endif - -# if(__has_feature(cxx_trailing_return)) -# define GLM_CXX11_TRAILING_RETURN -# endif - -# if(__has_feature(cxx_unicode_literals)) -# define GLM_CXX11_UNICODE_LITERALS -# endif - -# if(__has_feature(cxx_unrestricted_unions)) -# define GLM_CXX11_UNRESTRICTED_UNIONS -# endif - -# if(__has_feature(cxx_user_literals)) -# define GLM_CXX11_USER_LITERALS -# endif - -# if(__has_feature(cxx_variadic_templates)) -# define GLM_CXX11_VARIADIC_TEMPLATES -# endif - -#endif//(GLM_COMPILER & (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM)) diff --git a/extensions/common/glm/detail/_fixes.hpp b/extensions/common/glm/detail/_fixes.hpp deleted file mode 100644 index ba7a34f0ec4..00000000000 --- a/extensions/common/glm/detail/_fixes.hpp +++ /dev/null @@ -1,59 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/_fixes.hpp -/// @date 2011-02-21 / 2011-11-22 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#include <cmath> - -//! Workaround for compatibility with other libraries -#ifdef max -#undef max -#endif - -//! Workaround for compatibility with other libraries -#ifdef min -#undef min -#endif - -//! Workaround for Android -#ifdef isnan -#undef isnan -#endif - -//! Workaround for Android -#ifdef isinf -#undef isinf -#endif - -//! Workaround for Chrone Native Client -#ifdef log2 -#undef log2 -#endif - diff --git a/extensions/common/glm/detail/_noise.hpp b/extensions/common/glm/detail/_noise.hpp deleted file mode 100644 index a51ac5ca33f..00000000000 --- a/extensions/common/glm/detail/_noise.hpp +++ /dev/null @@ -1,136 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/_noise.hpp -/// @date 2013-12-24 / 2013-12-24 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "../vec2.hpp" -#include "../vec3.hpp" -#include "../vec4.hpp" -#include "../common.hpp" - -namespace glm{ -namespace detail -{ - template <typename T> - GLM_FUNC_QUALIFIER T mod289(T const & x) - { - return x - floor(x * static_cast<T>(1.0) / static_cast<T>(289.0)) * static_cast<T>(289.0); - } - - template <typename T> - GLM_FUNC_QUALIFIER T permute(T const & x) - { - return mod289(((x * static_cast<T>(34)) + static_cast<T>(1)) * x); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> permute(tvec2<T, P> const & x) - { - return mod289(((x * static_cast<T>(34)) + static_cast<T>(1)) * x); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> permute(tvec3<T, P> const & x) - { - return mod289(((x * static_cast<T>(34)) + static_cast<T>(1)) * x); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> permute(tvec4<T, P> const & x) - { - return mod289(((x * static_cast<T>(34)) + static_cast<T>(1)) * x); - } -/* - template <typename T, precision P, template<typename> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> permute(vecType<T, P> const & x) - { - return mod289(((x * T(34)) + T(1)) * x); - } -*/ - template <typename T> - GLM_FUNC_QUALIFIER T taylorInvSqrt(T const & r) - { - return T(1.79284291400159) - T(0.85373472095314) * r; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> taylorInvSqrt(tvec2<T, P> const & r) - { - return T(1.79284291400159) - T(0.85373472095314) * r; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> taylorInvSqrt(tvec3<T, P> const & r) - { - return T(1.79284291400159) - T(0.85373472095314) * r; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> taylorInvSqrt(tvec4<T, P> const & r) - { - return T(1.79284291400159) - T(0.85373472095314) * r; - } -/* - template <typename T, precision P, template<typename> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> taylorInvSqrt(vecType<T, P> const & r) - { - return T(1.79284291400159) - T(0.85373472095314) * r; - } -*/ - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> fade(tvec2<T, P> const & t) - { - return (t * t * t) * (t * (t * T(6) - T(15)) + T(10)); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> fade(tvec3<T, P> const & t) - { - return (t * t * t) * (t * (t * T(6) - T(15)) + T(10)); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> fade(tvec4<T, P> const & t) - { - return (t * t * t) * (t * (t * T(6) - T(15)) + T(10)); - } -/* - template <typename T, precision P, template <typename> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> fade(vecType<T, P> const & t) - { - return (t * t * t) * (t * (t * T(6) - T(15)) + T(10)); - } -*/ -}//namespace detail -}//namespace glm - diff --git a/extensions/common/glm/detail/_swizzle.hpp b/extensions/common/glm/detail/_swizzle.hpp deleted file mode 100644 index 43ca2c61549..00000000000 --- a/extensions/common/glm/detail/_swizzle.hpp +++ /dev/null @@ -1,833 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/_swizzle.hpp -/// @date 2006-04-20 / 2011-02-16 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -namespace glm{ -namespace detail -{ - // Internal class for implementing swizzle operators - template <typename T, int N> - struct _swizzle_base0 - { - typedef T value_type; - - protected: - GLM_FUNC_QUALIFIER value_type& elem (size_t i) { return (reinterpret_cast<value_type*>(_buffer))[i]; } - GLM_FUNC_QUALIFIER const value_type& elem (size_t i) const { return (reinterpret_cast<const value_type*>(_buffer))[i]; } - - // Use an opaque buffer to *ensure* the compiler doesn't call a constructor. - // The size 1 buffer is assumed to aligned to the actual members so that the - // elem() - char _buffer[1]; - }; - - template <typename T, precision P, typename V, int E0, int E1, int E2, int E3, int N> - struct _swizzle_base1 : public _swizzle_base0<T, N> - { - }; - - template <typename T, precision P, typename V, int E0, int E1> - struct _swizzle_base1<T, P, V,E0,E1,-1,-2,2> : public _swizzle_base0<T, 2> - { - GLM_FUNC_QUALIFIER V operator ()() const { return V(this->elem(E0), this->elem(E1)); } - }; - - template <typename T, precision P, typename V, int E0, int E1, int E2> - struct _swizzle_base1<T, P, V,E0,E1,E2,-1,3> : public _swizzle_base0<T, 3> - { - GLM_FUNC_QUALIFIER V operator ()() const { return V(this->elem(E0), this->elem(E1), this->elem(E2)); } - }; - - template <typename T, precision P, typename V, int E0, int E1, int E2, int E3> - struct _swizzle_base1<T, P, V,E0,E1,E2,E3,4> : public _swizzle_base0<T, 4> - { - GLM_FUNC_QUALIFIER V operator ()() const { return V(this->elem(E0), this->elem(E1), this->elem(E2), this->elem(E3)); } - }; - - // Internal class for implementing swizzle operators - /* - Template parameters: - - ValueType = type of scalar values (e.g. float, double) - VecType = class the swizzle is applies to (e.g. tvec3<float>) - N = number of components in the vector (e.g. 3) - E0...3 = what index the n-th element of this swizzle refers to in the unswizzled vec - - DUPLICATE_ELEMENTS = 1 if there is a repeated element, 0 otherwise (used to specialize swizzles - containing duplicate elements so that they cannot be used as r-values). - */ - template <typename ValueType, precision P, typename VecType, int N, int E0, int E1, int E2, int E3, int DUPLICATE_ELEMENTS> - struct _swizzle_base2 : public _swizzle_base1<ValueType, P, VecType,E0,E1,E2,E3,N> - { - typedef VecType vec_type; - typedef ValueType value_type; - - GLM_FUNC_QUALIFIER _swizzle_base2& operator= (const ValueType& t) - { - for (int i = 0; i < N; ++i) - (*this)[i] = t; - return *this; - } - - GLM_FUNC_QUALIFIER _swizzle_base2& operator= (const VecType& that) - { - struct op { - GLM_FUNC_QUALIFIER void operator() (value_type& e, value_type& t) { e = t; } - }; - _apply_op(that, op()); - return *this; - } - - GLM_FUNC_QUALIFIER void operator -= (const VecType& that) - { - struct op { - GLM_FUNC_QUALIFIER void operator() (value_type& e, value_type& t) { e -= t; } - }; - _apply_op(that, op()); - } - - GLM_FUNC_QUALIFIER void operator += (const VecType& that) - { - struct op { - GLM_FUNC_QUALIFIER void operator() (value_type& e, value_type& t) { e += t; } - }; - _apply_op(that, op()); - } - - GLM_FUNC_QUALIFIER void operator *= (const VecType& that) - { - struct op { - GLM_FUNC_QUALIFIER void operator() (value_type& e, value_type& t) { e *= t; } - }; - _apply_op(that, op()); - } - - GLM_FUNC_QUALIFIER void operator /= (const VecType& that) - { - struct op { - GLM_FUNC_QUALIFIER void operator() (value_type& e, value_type& t) { e /= t; } - }; - _apply_op(that, op()); - } - - GLM_FUNC_QUALIFIER value_type& operator[] (size_t i) - { - const int offset_dst[4] = { E0, E1, E2, E3 }; - return this->elem(offset_dst[i]); - } - GLM_FUNC_QUALIFIER value_type operator[] (size_t i) const - { - const int offset_dst[4] = { E0, E1, E2, E3 }; - return this->elem(offset_dst[i]); - } - - protected: - template <typename T> - GLM_FUNC_QUALIFIER void _apply_op(const VecType& that, T op) - { - // Make a copy of the data in this == &that. - // The copier should optimize out the copy in cases where the function is - // properly inlined and the copy is not necessary. - ValueType t[N]; - for (int i = 0; i < N; ++i) - t[i] = that[i]; - for (int i = 0; i < N; ++i) - op( (*this)[i], t[i] ); - } - }; - - // Specialization for swizzles containing duplicate elements. These cannot be modified. - template <typename ValueType, precision P, typename VecType, int N, int E0, int E1, int E2, int E3> - struct _swizzle_base2<ValueType, P, VecType,N,E0,E1,E2,E3,1> : public _swizzle_base1<ValueType, P, VecType,E0,E1,E2,E3,N> - { - typedef VecType vec_type; - typedef ValueType value_type; - - struct Stub {}; - GLM_FUNC_QUALIFIER _swizzle_base2& operator= (Stub const &) { return *this; } - - GLM_FUNC_QUALIFIER value_type operator[] (size_t i) const - { - const int offset_dst[4] = { E0, E1, E2, E3 }; - return this->elem(offset_dst[i]); - } - }; - - template <int N,typename ValueType, precision P, typename VecType, int E0,int E1,int E2,int E3> - struct _swizzle : public _swizzle_base2<ValueType, P, VecType, N, E0, E1, E2, E3, (E0==E1||E0==E2||E0==E3||E1==E2||E1==E3||E2==E3)> - { - typedef _swizzle_base2<ValueType, P, VecType,N,E0,E1,E2,E3,(E0==E1||E0==E2||E0==E3||E1==E2||E1==E3||E2==E3)> base_type; - - using base_type::operator=; - - GLM_FUNC_QUALIFIER operator VecType () const { return (*this)(); } - }; - -// -// To prevent the C++ syntax from getting entirely overwhelming, define some alias macros -// -#define _GLM_SWIZZLE_TEMPLATE1 template <int N, typename T, precision P, typename V, int E0, int E1, int E2, int E3> -#define _GLM_SWIZZLE_TEMPLATE2 template <int N, typename T, precision P, typename V, int E0, int E1, int E2, int E3, int F0, int F1, int F2, int F3> -#define _GLM_SWIZZLE_TYPE1 _swizzle<N, T, P, V, E0, E1, E2, E3> -#define _GLM_SWIZZLE_TYPE2 _swizzle<N, T, P, V, F0, F1, F2, F3> - -// -// Wrapper for a binary operator (e.g. u.yy + v.zy) -// -#define _GLM_SWIZZLE_VECTOR_BINARY_OPERATOR_IMPLEMENTATION(OPERAND) \ - _GLM_SWIZZLE_TEMPLATE2 \ - GLM_FUNC_QUALIFIER V operator OPERAND ( const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE2& b) \ - { \ - return a() OPERAND b(); \ - } \ - _GLM_SWIZZLE_TEMPLATE1 \ - GLM_FUNC_QUALIFIER V operator OPERAND ( const _GLM_SWIZZLE_TYPE1& a, const V& b) \ - { \ - return a() OPERAND b; \ - } \ - _GLM_SWIZZLE_TEMPLATE1 \ - GLM_FUNC_QUALIFIER V operator OPERAND ( const V& a, const _GLM_SWIZZLE_TYPE1& b) \ - { \ - return a OPERAND b(); \ - } - -// -// Wrapper for a operand between a swizzle and a binary (e.g. 1.0f - u.xyz) -// -#define _GLM_SWIZZLE_SCALAR_BINARY_OPERATOR_IMPLEMENTATION(OPERAND) \ - _GLM_SWIZZLE_TEMPLATE1 \ - GLM_FUNC_QUALIFIER V operator OPERAND ( const _GLM_SWIZZLE_TYPE1& a, const T& b) \ - { \ - return a() OPERAND b; \ - } \ - _GLM_SWIZZLE_TEMPLATE1 \ - GLM_FUNC_QUALIFIER V operator OPERAND ( const T& a, const _GLM_SWIZZLE_TYPE1& b) \ - { \ - return a OPERAND b(); \ - } - -// -// Macro for wrapping a function taking one argument (e.g. abs()) -// -#define _GLM_SWIZZLE_FUNCTION_1_ARGS(RETURN_TYPE,FUNCTION) \ - _GLM_SWIZZLE_TEMPLATE1 \ - GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a) \ - { \ - return FUNCTION(a()); \ - } - -// -// Macro for wrapping a function taking two vector arguments (e.g. dot()). -// -#define _GLM_SWIZZLE_FUNCTION_2_ARGS(RETURN_TYPE,FUNCTION) \ - _GLM_SWIZZLE_TEMPLATE2 \ - GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE2& b) \ - { \ - return FUNCTION(a(), b()); \ - } \ - _GLM_SWIZZLE_TEMPLATE1 \ - GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE1& b) \ - { \ - return FUNCTION(a(), b()); \ - } \ - _GLM_SWIZZLE_TEMPLATE1 \ - GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const typename V& b) \ - { \ - return FUNCTION(a(), b); \ - } \ - _GLM_SWIZZLE_TEMPLATE1 \ - GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const V& a, const _GLM_SWIZZLE_TYPE1& b) \ - { \ - return FUNCTION(a, b()); \ - } - -// -// Macro for wrapping a function take 2 vec arguments followed by a scalar (e.g. mix()). -// -#define _GLM_SWIZZLE_FUNCTION_2_ARGS_SCALAR(RETURN_TYPE,FUNCTION) \ - _GLM_SWIZZLE_TEMPLATE2 \ - GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE2& b, const T& c) \ - { \ - return FUNCTION(a(), b(), c); \ - } \ - _GLM_SWIZZLE_TEMPLATE1 \ - GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE1& b, const T& c) \ - { \ - return FUNCTION(a(), b(), c); \ - } \ - _GLM_SWIZZLE_TEMPLATE1 \ - GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const typename S0::vec_type& b, const T& c)\ - { \ - return FUNCTION(a(), b, c); \ - } \ - _GLM_SWIZZLE_TEMPLATE1 \ - GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const typename V& a, const _GLM_SWIZZLE_TYPE1& b, const T& c) \ - { \ - return FUNCTION(a, b(), c); \ - } - -}//namespace detail -}//namespace glm - -namespace glm -{ - namespace detail - { - _GLM_SWIZZLE_SCALAR_BINARY_OPERATOR_IMPLEMENTATION(-) - _GLM_SWIZZLE_SCALAR_BINARY_OPERATOR_IMPLEMENTATION(*) - _GLM_SWIZZLE_VECTOR_BINARY_OPERATOR_IMPLEMENTATION(+) - _GLM_SWIZZLE_VECTOR_BINARY_OPERATOR_IMPLEMENTATION(-) - _GLM_SWIZZLE_VECTOR_BINARY_OPERATOR_IMPLEMENTATION(*) - _GLM_SWIZZLE_VECTOR_BINARY_OPERATOR_IMPLEMENTATION(/) - } - - // - // Swizzles are distinct types from the unswizzled type. The below macros will - // provide template specializations for the swizzle types for the given functions - // so that the compiler does not have any ambiguity to choosing how to handle - // the function. - // - // The alternative is to use the operator()() when calling the function in order - // to explicitly convert the swizzled type to the unswizzled type. - // - - //_GLM_SWIZZLE_FUNCTION_1_ARGS(vec_type, abs); - //_GLM_SWIZZLE_FUNCTION_1_ARGS(vec_type, acos); - //_GLM_SWIZZLE_FUNCTION_1_ARGS(vec_type, acosh); - //_GLM_SWIZZLE_FUNCTION_1_ARGS(vec_type, all); - //_GLM_SWIZZLE_FUNCTION_1_ARGS(vec_type, any); - - //_GLM_SWIZZLE_FUNCTION_2_ARGS(value_type, dot); - //_GLM_SWIZZLE_FUNCTION_2_ARGS(vec_type, cross); - //_GLM_SWIZZLE_FUNCTION_2_ARGS(vec_type, step); - //_GLM_SWIZZLE_FUNCTION_2_ARGS_SCALAR(vec_type, mix); -} - -#define _GLM_SWIZZLE2_2_MEMBERS(T, P, V, E0,E1) \ - struct { detail::_swizzle<2, T, P, V<T, P>, 0,0,-1,-2> E0 ## E0; }; \ - struct { detail::_swizzle<2, T, P, V<T, P>, 0,1,-1,-2> E0 ## E1; }; \ - struct { detail::_swizzle<2, T, P, V<T, P>, 1,0,-1,-2> E1 ## E0; }; \ - struct { detail::_swizzle<2, T, P, V<T, P>, 1,1,-1,-2> E1 ## E1; }; - -#define _GLM_SWIZZLE2_3_MEMBERS(T, P, V, E0,E1) \ - struct { detail::_swizzle<3,T, P, V<T, P>, 0,0,0,-1> E0 ## E0 ## E0; }; \ - struct { detail::_swizzle<3,T, P, V<T, P>, 0,0,1,-1> E0 ## E0 ## E1; }; \ - struct { detail::_swizzle<3,T, P, V<T, P>, 0,1,0,-1> E0 ## E1 ## E0; }; \ - struct { detail::_swizzle<3,T, P, V<T, P>, 0,1,1,-1> E0 ## E1 ## E1; }; \ - struct { detail::_swizzle<3,T, P, V<T, P>, 1,0,0,-1> E1 ## E0 ## E0; }; \ - struct { detail::_swizzle<3,T, P, V<T, P>, 1,0,1,-1> E1 ## E0 ## E1; }; \ - struct { detail::_swizzle<3,T, P, V<T, P>, 1,1,0,-1> E1 ## E1 ## E0; }; \ - struct { detail::_swizzle<3,T, P, V<T, P>, 1,1,1,-1> E1 ## E1 ## E1; }; - -#define _GLM_SWIZZLE2_4_MEMBERS(T, P, V, E0,E1) \ - struct { detail::_swizzle<4,T, P, V<T, P>, 0,0,0,0> E0 ## E0 ## E0 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 0,0,0,1> E0 ## E0 ## E0 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 0,0,1,0> E0 ## E0 ## E1 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 0,0,1,1> E0 ## E0 ## E1 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 0,1,0,0> E0 ## E1 ## E0 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 0,1,0,1> E0 ## E1 ## E0 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 0,1,1,0> E0 ## E1 ## E1 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 0,1,1,1> E0 ## E1 ## E1 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 1,0,0,0> E1 ## E0 ## E0 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 1,0,0,1> E1 ## E0 ## E0 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 1,0,1,0> E1 ## E0 ## E1 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 1,0,1,1> E1 ## E0 ## E1 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 1,1,0,0> E1 ## E1 ## E0 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 1,1,0,1> E1 ## E1 ## E0 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 1,1,1,0> E1 ## E1 ## E1 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 1,1,1,1> E1 ## E1 ## E1 ## E1; }; - -#define _GLM_SWIZZLE3_2_MEMBERS(T, P, V, E0,E1,E2) \ - struct { detail::_swizzle<2,T, P, V<T, P>, 0,0,-1,-2> E0 ## E0; }; \ - struct { detail::_swizzle<2,T, P, V<T, P>, 0,1,-1,-2> E0 ## E1; }; \ - struct { detail::_swizzle<2,T, P, V<T, P>, 0,2,-1,-2> E0 ## E2; }; \ - struct { detail::_swizzle<2,T, P, V<T, P>, 1,0,-1,-2> E1 ## E0; }; \ - struct { detail::_swizzle<2,T, P, V<T, P>, 1,1,-1,-2> E1 ## E1; }; \ - struct { detail::_swizzle<2,T, P, V<T, P>, 1,2,-1,-2> E1 ## E2; }; \ - struct { detail::_swizzle<2,T, P, V<T, P>, 2,0,-1,-2> E2 ## E0; }; \ - struct { detail::_swizzle<2,T, P, V<T, P>, 2,1,-1,-2> E2 ## E1; }; \ - struct { detail::_swizzle<2,T, P, V<T, P>, 2,2,-1,-2> E2 ## E2; }; - -#define _GLM_SWIZZLE3_3_MEMBERS(T, P, V ,E0,E1,E2) \ - struct { detail::_swizzle<3,T,P, V<T, P>, 0,0,0,-1> E0 ## E0 ## E0; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 0,0,1,-1> E0 ## E0 ## E1; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 0,0,2,-1> E0 ## E0 ## E2; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 0,1,0,-1> E0 ## E1 ## E0; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 0,1,1,-1> E0 ## E1 ## E1; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 0,1,2,-1> E0 ## E1 ## E2; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 0,2,0,-1> E0 ## E2 ## E0; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 0,2,1,-1> E0 ## E2 ## E1; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 0,2,2,-1> E0 ## E2 ## E2; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 1,0,0,-1> E1 ## E0 ## E0; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 1,0,1,-1> E1 ## E0 ## E1; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 1,0,2,-1> E1 ## E0 ## E2; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 1,1,0,-1> E1 ## E1 ## E0; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 1,1,1,-1> E1 ## E1 ## E1; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 1,1,2,-1> E1 ## E1 ## E2; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 1,2,0,-1> E1 ## E2 ## E0; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 1,2,1,-1> E1 ## E2 ## E1; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 1,2,2,-1> E1 ## E2 ## E2; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 2,0,0,-1> E2 ## E0 ## E0; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 2,0,1,-1> E2 ## E0 ## E1; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 2,0,2,-1> E2 ## E0 ## E2; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 2,1,0,-1> E2 ## E1 ## E0; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 2,1,1,-1> E2 ## E1 ## E1; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 2,1,2,-1> E2 ## E1 ## E2; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 2,2,0,-1> E2 ## E2 ## E0; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 2,2,1,-1> E2 ## E2 ## E1; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 2,2,2,-1> E2 ## E2 ## E2; }; - -#define _GLM_SWIZZLE3_4_MEMBERS(T, P, V, E0,E1,E2) \ - struct { detail::_swizzle<4,T, P, V<T, P>, 0,0,0,0> E0 ## E0 ## E0 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 0,0,0,1> E0 ## E0 ## E0 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 0,0,0,2> E0 ## E0 ## E0 ## E2; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 0,0,1,0> E0 ## E0 ## E1 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 0,0,1,1> E0 ## E0 ## E1 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 0,0,1,2> E0 ## E0 ## E1 ## E2; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 0,0,2,0> E0 ## E0 ## E2 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 0,0,2,1> E0 ## E0 ## E2 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 0,0,2,2> E0 ## E0 ## E2 ## E2; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 0,1,0,0> E0 ## E1 ## E0 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 0,1,0,1> E0 ## E1 ## E0 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 0,1,0,2> E0 ## E1 ## E0 ## E2; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 0,1,1,0> E0 ## E1 ## E1 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 0,1,1,1> E0 ## E1 ## E1 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 0,1,1,2> E0 ## E1 ## E1 ## E2; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 0,1,2,0> E0 ## E1 ## E2 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 0,1,2,1> E0 ## E1 ## E2 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 0,1,2,2> E0 ## E1 ## E2 ## E2; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 0,2,0,0> E0 ## E2 ## E0 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 0,2,0,1> E0 ## E2 ## E0 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 0,2,0,2> E0 ## E2 ## E0 ## E2; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 0,2,1,0> E0 ## E2 ## E1 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 0,2,1,1> E0 ## E2 ## E1 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 0,2,1,2> E0 ## E2 ## E1 ## E2; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 0,2,2,0> E0 ## E2 ## E2 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 0,2,2,1> E0 ## E2 ## E2 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 0,2,2,2> E0 ## E2 ## E2 ## E2; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 1,0,0,0> E1 ## E0 ## E0 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 1,0,0,1> E1 ## E0 ## E0 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 1,0,0,2> E1 ## E0 ## E0 ## E2; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 1,0,1,0> E1 ## E0 ## E1 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 1,0,1,1> E1 ## E0 ## E1 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 1,0,1,2> E1 ## E0 ## E1 ## E2; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 1,0,2,0> E1 ## E0 ## E2 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 1,0,2,1> E1 ## E0 ## E2 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 1,0,2,2> E1 ## E0 ## E2 ## E2; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 1,1,0,0> E1 ## E1 ## E0 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 1,1,0,1> E1 ## E1 ## E0 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 1,1,0,2> E1 ## E1 ## E0 ## E2; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 1,1,1,0> E1 ## E1 ## E1 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 1,1,1,1> E1 ## E1 ## E1 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 1,1,1,2> E1 ## E1 ## E1 ## E2; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 1,1,2,0> E1 ## E1 ## E2 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 1,1,2,1> E1 ## E1 ## E2 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 1,1,2,2> E1 ## E1 ## E2 ## E2; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 1,2,0,0> E1 ## E2 ## E0 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 1,2,0,1> E1 ## E2 ## E0 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 1,2,0,2> E1 ## E2 ## E0 ## E2; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 1,2,1,0> E1 ## E2 ## E1 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 1,2,1,1> E1 ## E2 ## E1 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 1,2,1,2> E1 ## E2 ## E1 ## E2; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 1,2,2,0> E1 ## E2 ## E2 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 1,2,2,1> E1 ## E2 ## E2 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 1,2,2,2> E1 ## E2 ## E2 ## E2; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 2,0,0,0> E2 ## E0 ## E0 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 2,0,0,1> E2 ## E0 ## E0 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 2,0,0,2> E2 ## E0 ## E0 ## E2; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 2,0,1,0> E2 ## E0 ## E1 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 2,0,1,1> E2 ## E0 ## E1 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 2,0,1,2> E2 ## E0 ## E1 ## E2; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 2,0,2,0> E2 ## E0 ## E2 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 2,0,2,1> E2 ## E0 ## E2 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 2,0,2,2> E2 ## E0 ## E2 ## E2; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 2,1,0,0> E2 ## E1 ## E0 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 2,1,0,1> E2 ## E1 ## E0 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 2,1,0,2> E2 ## E1 ## E0 ## E2; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 2,1,1,0> E2 ## E1 ## E1 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 2,1,1,1> E2 ## E1 ## E1 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 2,1,1,2> E2 ## E1 ## E1 ## E2; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 2,1,2,0> E2 ## E1 ## E2 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 2,1,2,1> E2 ## E1 ## E2 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 2,1,2,2> E2 ## E1 ## E2 ## E2; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 2,2,0,0> E2 ## E2 ## E0 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 2,2,0,1> E2 ## E2 ## E0 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 2,2,0,2> E2 ## E2 ## E0 ## E2; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 2,2,1,0> E2 ## E2 ## E1 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 2,2,1,1> E2 ## E2 ## E1 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 2,2,1,2> E2 ## E2 ## E1 ## E2; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 2,2,2,0> E2 ## E2 ## E2 ## E0; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 2,2,2,1> E2 ## E2 ## E2 ## E1; }; \ - struct { detail::_swizzle<4,T, P, V<T, P>, 2,2,2,2> E2 ## E2 ## E2 ## E2; }; - -#define _GLM_SWIZZLE4_2_MEMBERS(T, P, V, E0,E1,E2,E3) \ - struct { detail::_swizzle<2,T, P, V<T, P>, 0,0,-1,-2> E0 ## E0; }; \ - struct { detail::_swizzle<2,T, P, V<T, P>, 0,1,-1,-2> E0 ## E1; }; \ - struct { detail::_swizzle<2,T, P, V<T, P>, 0,2,-1,-2> E0 ## E2; }; \ - struct { detail::_swizzle<2,T, P, V<T, P>, 0,3,-1,-2> E0 ## E3; }; \ - struct { detail::_swizzle<2,T, P, V<T, P>, 1,0,-1,-2> E1 ## E0; }; \ - struct { detail::_swizzle<2,T, P, V<T, P>, 1,1,-1,-2> E1 ## E1; }; \ - struct { detail::_swizzle<2,T, P, V<T, P>, 1,2,-1,-2> E1 ## E2; }; \ - struct { detail::_swizzle<2,T, P, V<T, P>, 1,3,-1,-2> E1 ## E3; }; \ - struct { detail::_swizzle<2,T, P, V<T, P>, 2,0,-1,-2> E2 ## E0; }; \ - struct { detail::_swizzle<2,T, P, V<T, P>, 2,1,-1,-2> E2 ## E1; }; \ - struct { detail::_swizzle<2,T, P, V<T, P>, 2,2,-1,-2> E2 ## E2; }; \ - struct { detail::_swizzle<2,T, P, V<T, P>, 2,3,-1,-2> E2 ## E3; }; \ - struct { detail::_swizzle<2,T, P, V<T, P>, 3,0,-1,-2> E3 ## E0; }; \ - struct { detail::_swizzle<2,T, P, V<T, P>, 3,1,-1,-2> E3 ## E1; }; \ - struct { detail::_swizzle<2,T, P, V<T, P>, 3,2,-1,-2> E3 ## E2; }; \ - struct { detail::_swizzle<2,T, P, V<T, P>, 3,3,-1,-2> E3 ## E3; }; - -#define _GLM_SWIZZLE4_3_MEMBERS(T,P, V, E0,E1,E2,E3) \ - struct { detail::_swizzle<3,T,P, V<T, P>, 0,0,0,-1> E0 ## E0 ## E0; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 0,0,1,-1> E0 ## E0 ## E1; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 0,0,2,-1> E0 ## E0 ## E2; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 0,0,3,-1> E0 ## E0 ## E3; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 0,1,0,-1> E0 ## E1 ## E0; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 0,1,1,-1> E0 ## E1 ## E1; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 0,1,2,-1> E0 ## E1 ## E2; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 0,1,3,-1> E0 ## E1 ## E3; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 0,2,0,-1> E0 ## E2 ## E0; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 0,2,1,-1> E0 ## E2 ## E1; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 0,2,2,-1> E0 ## E2 ## E2; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 0,2,3,-1> E0 ## E2 ## E3; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 0,3,0,-1> E0 ## E3 ## E0; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 0,3,1,-1> E0 ## E3 ## E1; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 0,3,2,-1> E0 ## E3 ## E2; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 0,3,3,-1> E0 ## E3 ## E3; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 1,0,0,-1> E1 ## E0 ## E0; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 1,0,1,-1> E1 ## E0 ## E1; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 1,0,2,-1> E1 ## E0 ## E2; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 1,0,3,-1> E1 ## E0 ## E3; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 1,1,0,-1> E1 ## E1 ## E0; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 1,1,1,-1> E1 ## E1 ## E1; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 1,1,2,-1> E1 ## E1 ## E2; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 1,1,3,-1> E1 ## E1 ## E3; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 1,2,0,-1> E1 ## E2 ## E0; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 1,2,1,-1> E1 ## E2 ## E1; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 1,2,2,-1> E1 ## E2 ## E2; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 1,2,3,-1> E1 ## E2 ## E3; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 1,3,0,-1> E1 ## E3 ## E0; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 1,3,1,-1> E1 ## E3 ## E1; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 1,3,2,-1> E1 ## E3 ## E2; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 1,3,3,-1> E1 ## E3 ## E3; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 2,0,0,-1> E2 ## E0 ## E0; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 2,0,1,-1> E2 ## E0 ## E1; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 2,0,2,-1> E2 ## E0 ## E2; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 2,0,3,-1> E2 ## E0 ## E3; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 2,1,0,-1> E2 ## E1 ## E0; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 2,1,1,-1> E2 ## E1 ## E1; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 2,1,2,-1> E2 ## E1 ## E2; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 2,1,3,-1> E2 ## E1 ## E3; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 2,2,0,-1> E2 ## E2 ## E0; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 2,2,1,-1> E2 ## E2 ## E1; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 2,2,2,-1> E2 ## E2 ## E2; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 2,2,3,-1> E2 ## E2 ## E3; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 2,3,0,-1> E2 ## E3 ## E0; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 2,3,1,-1> E2 ## E3 ## E1; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 2,3,2,-1> E2 ## E3 ## E2; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 2,3,3,-1> E2 ## E3 ## E3; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 3,0,0,-1> E3 ## E0 ## E0; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 3,0,1,-1> E3 ## E0 ## E1; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 3,0,2,-1> E3 ## E0 ## E2; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 3,0,3,-1> E3 ## E0 ## E3; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 3,1,0,-1> E3 ## E1 ## E0; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 3,1,1,-1> E3 ## E1 ## E1; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 3,1,2,-1> E3 ## E1 ## E2; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 3,1,3,-1> E3 ## E1 ## E3; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 3,2,0,-1> E3 ## E2 ## E0; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 3,2,1,-1> E3 ## E2 ## E1; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 3,2,2,-1> E3 ## E2 ## E2; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 3,2,3,-1> E3 ## E2 ## E3; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 3,3,0,-1> E3 ## E3 ## E0; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 3,3,1,-1> E3 ## E3 ## E1; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 3,3,2,-1> E3 ## E3 ## E2; }; \ - struct { detail::_swizzle<3,T,P, V<T, P>, 3,3,3,-1> E3 ## E3 ## E3; }; - -#define _GLM_SWIZZLE4_4_MEMBERS(T, P, V, E0,E1,E2,E3) \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,0,0,0> E0 ## E0 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,0,0,1> E0 ## E0 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,0,0,2> E0 ## E0 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,0,0,3> E0 ## E0 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,0,1,0> E0 ## E0 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,0,1,1> E0 ## E0 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,0,1,2> E0 ## E0 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,0,1,3> E0 ## E0 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,0,2,0> E0 ## E0 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,0,2,1> E0 ## E0 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,0,2,2> E0 ## E0 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,0,2,3> E0 ## E0 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,0,3,0> E0 ## E0 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,0,3,1> E0 ## E0 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,0,3,2> E0 ## E0 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,0,3,3> E0 ## E0 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,1,0,0> E0 ## E1 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,1,0,1> E0 ## E1 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,1,0,2> E0 ## E1 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,1,0,3> E0 ## E1 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,1,1,0> E0 ## E1 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,1,1,1> E0 ## E1 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,1,1,2> E0 ## E1 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,1,1,3> E0 ## E1 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,1,2,0> E0 ## E1 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,1,2,1> E0 ## E1 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,1,2,2> E0 ## E1 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,1,2,3> E0 ## E1 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,1,3,0> E0 ## E1 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,1,3,1> E0 ## E1 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,1,3,2> E0 ## E1 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,1,3,3> E0 ## E1 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,2,0,0> E0 ## E2 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,2,0,1> E0 ## E2 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,2,0,2> E0 ## E2 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,2,0,3> E0 ## E2 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,2,1,0> E0 ## E2 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,2,1,1> E0 ## E2 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,2,1,2> E0 ## E2 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,2,1,3> E0 ## E2 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,2,2,0> E0 ## E2 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,2,2,1> E0 ## E2 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,2,2,2> E0 ## E2 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,2,2,3> E0 ## E2 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,2,3,0> E0 ## E2 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,2,3,1> E0 ## E2 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,2,3,2> E0 ## E2 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,2,3,3> E0 ## E2 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,3,0,0> E0 ## E3 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,3,0,1> E0 ## E3 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,3,0,2> E0 ## E3 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,3,0,3> E0 ## E3 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,3,1,0> E0 ## E3 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,3,1,1> E0 ## E3 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,3,1,2> E0 ## E3 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,3,1,3> E0 ## E3 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,3,2,0> E0 ## E3 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,3,2,1> E0 ## E3 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,3,2,2> E0 ## E3 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,3,2,3> E0 ## E3 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,3,3,0> E0 ## E3 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,3,3,1> E0 ## E3 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,3,3,2> E0 ## E3 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 0,3,3,3> E0 ## E3 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,0,0,0> E1 ## E0 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,0,0,1> E1 ## E0 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,0,0,2> E1 ## E0 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,0,0,3> E1 ## E0 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,0,1,0> E1 ## E0 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,0,1,1> E1 ## E0 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,0,1,2> E1 ## E0 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,0,1,3> E1 ## E0 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,0,2,0> E1 ## E0 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,0,2,1> E1 ## E0 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,0,2,2> E1 ## E0 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,0,2,3> E1 ## E0 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,0,3,0> E1 ## E0 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,0,3,1> E1 ## E0 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,0,3,2> E1 ## E0 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,0,3,3> E1 ## E0 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,1,0,0> E1 ## E1 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,1,0,1> E1 ## E1 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,1,0,2> E1 ## E1 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,1,0,3> E1 ## E1 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,1,1,0> E1 ## E1 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,1,1,1> E1 ## E1 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,1,1,2> E1 ## E1 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,1,1,3> E1 ## E1 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,1,2,0> E1 ## E1 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,1,2,1> E1 ## E1 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,1,2,2> E1 ## E1 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,1,2,3> E1 ## E1 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,1,3,0> E1 ## E1 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,1,3,1> E1 ## E1 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,1,3,2> E1 ## E1 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,1,3,3> E1 ## E1 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,2,0,0> E1 ## E2 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,2,0,1> E1 ## E2 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,2,0,2> E1 ## E2 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,2,0,3> E1 ## E2 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,2,1,0> E1 ## E2 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,2,1,1> E1 ## E2 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,2,1,2> E1 ## E2 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,2,1,3> E1 ## E2 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,2,2,0> E1 ## E2 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,2,2,1> E1 ## E2 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,2,2,2> E1 ## E2 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,2,2,3> E1 ## E2 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,2,3,0> E1 ## E2 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,2,3,1> E1 ## E2 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,2,3,2> E1 ## E2 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,2,3,3> E1 ## E2 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,3,0,0> E1 ## E3 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,3,0,1> E1 ## E3 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,3,0,2> E1 ## E3 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,3,0,3> E1 ## E3 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,3,1,0> E1 ## E3 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,3,1,1> E1 ## E3 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,3,1,2> E1 ## E3 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,3,1,3> E1 ## E3 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,3,2,0> E1 ## E3 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,3,2,1> E1 ## E3 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,3,2,2> E1 ## E3 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,3,2,3> E1 ## E3 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,3,3,0> E1 ## E3 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,3,3,1> E1 ## E3 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,3,3,2> E1 ## E3 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 1,3,3,3> E1 ## E3 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,0,0,0> E2 ## E0 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,0,0,1> E2 ## E0 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,0,0,2> E2 ## E0 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,0,0,3> E2 ## E0 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,0,1,0> E2 ## E0 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,0,1,1> E2 ## E0 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,0,1,2> E2 ## E0 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,0,1,3> E2 ## E0 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,0,2,0> E2 ## E0 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,0,2,1> E2 ## E0 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,0,2,2> E2 ## E0 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,0,2,3> E2 ## E0 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,0,3,0> E2 ## E0 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,0,3,1> E2 ## E0 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,0,3,2> E2 ## E0 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,0,3,3> E2 ## E0 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,1,0,0> E2 ## E1 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,1,0,1> E2 ## E1 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,1,0,2> E2 ## E1 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,1,0,3> E2 ## E1 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,1,1,0> E2 ## E1 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,1,1,1> E2 ## E1 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,1,1,2> E2 ## E1 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,1,1,3> E2 ## E1 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,1,2,0> E2 ## E1 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,1,2,1> E2 ## E1 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,1,2,2> E2 ## E1 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,1,2,3> E2 ## E1 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,1,3,0> E2 ## E1 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,1,3,1> E2 ## E1 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,1,3,2> E2 ## E1 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,1,3,3> E2 ## E1 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,2,0,0> E2 ## E2 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,2,0,1> E2 ## E2 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,2,0,2> E2 ## E2 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,2,0,3> E2 ## E2 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,2,1,0> E2 ## E2 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,2,1,1> E2 ## E2 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,2,1,2> E2 ## E2 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,2,1,3> E2 ## E2 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,2,2,0> E2 ## E2 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,2,2,1> E2 ## E2 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,2,2,2> E2 ## E2 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,2,2,3> E2 ## E2 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,2,3,0> E2 ## E2 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,2,3,1> E2 ## E2 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,2,3,2> E2 ## E2 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,2,3,3> E2 ## E2 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,3,0,0> E2 ## E3 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,3,0,1> E2 ## E3 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,3,0,2> E2 ## E3 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,3,0,3> E2 ## E3 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,3,1,0> E2 ## E3 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,3,1,1> E2 ## E3 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,3,1,2> E2 ## E3 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,3,1,3> E2 ## E3 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,3,2,0> E2 ## E3 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,3,2,1> E2 ## E3 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,3,2,2> E2 ## E3 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,3,2,3> E2 ## E3 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,3,3,0> E2 ## E3 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,3,3,1> E2 ## E3 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,3,3,2> E2 ## E3 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 2,3,3,3> E2 ## E3 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,0,0,0> E3 ## E0 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,0,0,1> E3 ## E0 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,0,0,2> E3 ## E0 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,0,0,3> E3 ## E0 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,0,1,0> E3 ## E0 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,0,1,1> E3 ## E0 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,0,1,2> E3 ## E0 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,0,1,3> E3 ## E0 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,0,2,0> E3 ## E0 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,0,2,1> E3 ## E0 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,0,2,2> E3 ## E0 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,0,2,3> E3 ## E0 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,0,3,0> E3 ## E0 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,0,3,1> E3 ## E0 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,0,3,2> E3 ## E0 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,0,3,3> E3 ## E0 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,1,0,0> E3 ## E1 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,1,0,1> E3 ## E1 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,1,0,2> E3 ## E1 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,1,0,3> E3 ## E1 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,1,1,0> E3 ## E1 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,1,1,1> E3 ## E1 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,1,1,2> E3 ## E1 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,1,1,3> E3 ## E1 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,1,2,0> E3 ## E1 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,1,2,1> E3 ## E1 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,1,2,2> E3 ## E1 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,1,2,3> E3 ## E1 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,1,3,0> E3 ## E1 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,1,3,1> E3 ## E1 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,1,3,2> E3 ## E1 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,1,3,3> E3 ## E1 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,2,0,0> E3 ## E2 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,2,0,1> E3 ## E2 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,2,0,2> E3 ## E2 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,2,0,3> E3 ## E2 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,2,1,0> E3 ## E2 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,2,1,1> E3 ## E2 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,2,1,2> E3 ## E2 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,2,1,3> E3 ## E2 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,2,2,0> E3 ## E2 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,2,2,1> E3 ## E2 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,2,2,2> E3 ## E2 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,2,2,3> E3 ## E2 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,2,3,0> E3 ## E2 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,2,3,1> E3 ## E2 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,2,3,2> E3 ## E2 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,2,3,3> E3 ## E2 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,3,0,0> E3 ## E3 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,3,0,1> E3 ## E3 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,3,0,2> E3 ## E3 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,3,0,3> E3 ## E3 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,3,1,0> E3 ## E3 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,3,1,1> E3 ## E3 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,3,1,2> E3 ## E3 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,3,1,3> E3 ## E3 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,3,2,0> E3 ## E3 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,3,2,1> E3 ## E3 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,3,2,2> E3 ## E3 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,3,2,3> E3 ## E3 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,3,3,0> E3 ## E3 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,3,3,1> E3 ## E3 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,3,3,2> E3 ## E3 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, P, V<T, P>, 3,3,3,3> E3 ## E3 ## E3 ## E3; }; diff --git a/extensions/common/glm/detail/_swizzle_func.hpp b/extensions/common/glm/detail/_swizzle_func.hpp deleted file mode 100644 index 5601d910fe0..00000000000 --- a/extensions/common/glm/detail/_swizzle_func.hpp +++ /dev/null @@ -1,725 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/_swizzle_func.hpp -/// @date 2011-10-16 / 2011-10-16 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#define GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, CONST, A, B) \ - SWIZZLED_TYPE<TMPL_TYPE, PRECISION> A ## B() CONST \ - { \ - return SWIZZLED_TYPE<TMPL_TYPE, PRECISION>(this->A, this->B); \ - } - -#define GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, CONST, A, B, C) \ - SWIZZLED_TYPE<TMPL_TYPE, PRECISION> A ## B ## C() CONST \ - { \ - return SWIZZLED_TYPE<TMPL_TYPE, PRECISION>(this->A, this->B, this->C); \ - } - -#define GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, CONST, A, B, C, D) \ - SWIZZLED_TYPE<TMPL_TYPE, PRECISION> A ## B ## C ## D() CONST \ - { \ - return SWIZZLED_TYPE<TMPL_TYPE, PRECISION>(this->A, this->B, this->C, this->D); \ - } - -#define GLM_SWIZZLE_GEN_VEC2_ENTRY_DEF(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, CONST, A, B) \ - template <typename TMPL_TYPE> \ - SWIZZLED_TYPE<TMPL_TYPE> CLASS_TYPE<TMPL_TYPE, PRECISION>::A ## B() CONST \ - { \ - return SWIZZLED_TYPE<TMPL_TYPE, PRECISION>(this->A, this->B); \ - } - -#define GLM_SWIZZLE_GEN_VEC3_ENTRY_DEF(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, CONST, A, B, C) \ - template <typename TMPL_TYPE> \ - SWIZZLED_TYPE<TMPL_TYPE> CLASS_TYPE<TMPL_TYPE, PRECISION>::A ## B ## C() CONST \ - { \ - return SWIZZLED_TYPE<TMPL_TYPE, PRECISION>(this->A, this->B, this->C); \ - } - -#define GLM_SWIZZLE_GEN_VEC4_ENTRY_DEF(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, CONST, A, B, C, D) \ - template <typename TMPL_TYPE> \ - SWIZZLED_TYPE<TMPL_TYPE> CLASS_TYPE<TMPL_TYPE, PRECISION>::A ## B ## C ## D() CONST \ - { \ - return SWIZZLED_TYPE<TMPL_TYPE, PRECISION>(this->A, this->B, this->C, this->D); \ - } - -#define GLM_MUTABLE - -#define GLM_SWIZZLE_GEN_REF2_FROM_VEC2_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, A, B) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, B, A) - -#define GLM_SWIZZLE_GEN_REF_FROM_VEC2(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE) \ - GLM_SWIZZLE_GEN_REF2_FROM_VEC2_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, x, y) \ - GLM_SWIZZLE_GEN_REF2_FROM_VEC2_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, r, g) \ - GLM_SWIZZLE_GEN_REF2_FROM_VEC2_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, s, t) - -//GLM_SWIZZLE_GEN_REF_FROM_VEC2(valType, detail::vec2, detail::ref2) - -#define GLM_SWIZZLE_GEN_REF2_FROM_VEC3_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, A, B) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, A, C) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, B, A) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, B, C) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, C, A) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, C, B) - -#define GLM_SWIZZLE_GEN_REF3_FROM_VEC3_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, A, B, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, A, C, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, B, A, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, B, C, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, C, A, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, C, B, A) - -#define GLM_SWIZZLE_GEN_REF_FROM_VEC3_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, A, B, C) \ - GLM_SWIZZLE_GEN_REF3_FROM_VEC3_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC3_TYPE, A, B, C) \ - GLM_SWIZZLE_GEN_REF2_FROM_VEC3_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, A, B, C) - -#define GLM_SWIZZLE_GEN_REF_FROM_VEC3(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE) \ - GLM_SWIZZLE_GEN_REF_FROM_VEC3_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, x, y, z) \ - GLM_SWIZZLE_GEN_REF_FROM_VEC3_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, r, g, b) \ - GLM_SWIZZLE_GEN_REF_FROM_VEC3_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, s, t, p) - -//GLM_SWIZZLE_GEN_REF_FROM_VEC3(valType, detail::vec3, detail::ref2, detail::ref3) - -#define GLM_SWIZZLE_GEN_REF2_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C, D) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, A, B) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, A, C) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, A, D) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, B, A) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, B, C) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, B, D) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, C, A) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, C, B) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, C, D) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, D, A) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, D, B) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, D, C) - -#define GLM_SWIZZLE_GEN_REF3_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C, D) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, B, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, B, D) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, C, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, C, D) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, D, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, D, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, A, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, A, D) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, C, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, C, D) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, D, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, D, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, A, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, A, D) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, B, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, B, D) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, D, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, D, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, A, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, A, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, B, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, B, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, C, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, C, B) - -#define GLM_SWIZZLE_GEN_REF4_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, C, B, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, C, D, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, D, B, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, D, C, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, B, D, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, B, C, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, C, A, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, C, D, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, D, A, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, D, C, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, A, D, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, A, C, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, B, A, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, B, D, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, D, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, D, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, A, D, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, A, B, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, C, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, C, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, A, B, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, A, C, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, B, A, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, B, C, A) - -#define GLM_SWIZZLE_GEN_REF_FROM_VEC4_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, A, B, C, D) \ - GLM_SWIZZLE_GEN_REF2_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, A, B, C, D) \ - GLM_SWIZZLE_GEN_REF3_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC3_TYPE, A, B, C, D) \ - GLM_SWIZZLE_GEN_REF4_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC4_TYPE, A, B, C, D) - -#define GLM_SWIZZLE_GEN_REF_FROM_VEC4(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE) \ - GLM_SWIZZLE_GEN_REF_FROM_VEC4_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, x, y, z, w) \ - GLM_SWIZZLE_GEN_REF_FROM_VEC4_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, r, g, b, a) \ - GLM_SWIZZLE_GEN_REF_FROM_VEC4_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, s, t, p, q) - -//GLM_SWIZZLE_GEN_REF_FROM_VEC4(valType, detail::vec4, detail::ref2, detail::ref3, detail::ref4) - -#define GLM_SWIZZLE_GEN_VEC2_FROM_VEC2_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B) - -#define GLM_SWIZZLE_GEN_VEC3_FROM_VEC2_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B) - -#define GLM_SWIZZLE_GEN_VEC4_FROM_VEC2_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B, B) - -#define GLM_SWIZZLE_GEN_VEC_FROM_VEC2_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, A, B) \ - GLM_SWIZZLE_GEN_VEC2_FROM_VEC2_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, A, B) \ - GLM_SWIZZLE_GEN_VEC3_FROM_VEC2_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC3_TYPE, A, B) \ - GLM_SWIZZLE_GEN_VEC4_FROM_VEC2_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC4_TYPE, A, B) - -#define GLM_SWIZZLE_GEN_VEC_FROM_VEC2(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE) \ - GLM_SWIZZLE_GEN_VEC_FROM_VEC2_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, x, y) \ - GLM_SWIZZLE_GEN_VEC_FROM_VEC2_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, r, g) \ - GLM_SWIZZLE_GEN_VEC_FROM_VEC2_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, s, t) - -//GLM_SWIZZLE_GEN_VEC_FROM_VEC2(valType, detail::vec2, detail::vec2, detail::vec3, detail::vec4) - -#define GLM_SWIZZLE_GEN_VEC2_FROM_VEC3_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C) - -#define GLM_SWIZZLE_GEN_VEC3_FROM_VEC3_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, C) - -#define GLM_SWIZZLE_GEN_VEC4_FROM_VEC3_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, C, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, C, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, C, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, C, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, C, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, C, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, A, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, A, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, B, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, B, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, C, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, C, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, C, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, C, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, C, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, C, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, C, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, C, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, C, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, A, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, A, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, B, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, B, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, C, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, C, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, C, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, A, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, A, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, B, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, B, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, C, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, C, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, C, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, A, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, A, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, B, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, B, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, C, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, C, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, C, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, A, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, A, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, B, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, B, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, C, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, C, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, C, C) - -#define GLM_SWIZZLE_GEN_VEC_FROM_VEC3_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, A, B, C) \ - GLM_SWIZZLE_GEN_VEC2_FROM_VEC3_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, A, B, C) \ - GLM_SWIZZLE_GEN_VEC3_FROM_VEC3_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC3_TYPE, A, B, C) \ - GLM_SWIZZLE_GEN_VEC4_FROM_VEC3_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC4_TYPE, A, B, C) - -#define GLM_SWIZZLE_GEN_VEC_FROM_VEC3(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE) \ - GLM_SWIZZLE_GEN_VEC_FROM_VEC3_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, x, y, z) \ - GLM_SWIZZLE_GEN_VEC_FROM_VEC3_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, r, g, b) \ - GLM_SWIZZLE_GEN_VEC_FROM_VEC3_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, s, t, p) - -//GLM_SWIZZLE_GEN_VEC_FROM_VEC3(valType, detail::vec3, detail::vec2, detail::vec3, detail::vec4) - -#define GLM_SWIZZLE_GEN_VEC2_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C, D) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D) - -#define GLM_SWIZZLE_GEN_VEC3_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C, D) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, D) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, D) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, D) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, D) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, D) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, D) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, D) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, D) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, D) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, D) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, D) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, D) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, D) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, D) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, D) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, D) - -#define GLM_SWIZZLE_GEN_VEC4_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, C, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, C, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, C, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, C, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, D, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, D, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, D, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, D, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, C, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, C, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, C, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, C, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, D, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, D, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, D, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, D, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, A, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, A, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, A, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, B, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, B, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, B, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, C, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, C, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, C, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, C, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, D, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, D, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, D, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, D, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, A, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, A, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, A, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, B, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, B, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, B, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, C, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, C, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, C, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, C, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, D, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, D, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, D, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, D, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, C, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, C, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, C, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, C, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, D, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, D, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, D, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, D, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, C, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, C, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, C, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, C, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, D, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, D, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, D, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, D, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, A, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, A, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, A, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, B, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, B, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, B, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, C, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, C, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, C, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, C, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, D, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, D, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, D, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, D, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, A, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, A, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, A, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, B, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, B, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, B, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, C, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, C, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, C, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, C, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, D, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, D, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, D, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, D, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, A, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, A, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, A, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, B, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, B, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, B, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, C, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, C, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, C, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, C, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, D, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, D, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, D, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, D, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, A, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, A, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, A, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, B, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, B, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, B, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, C, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, C, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, C, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, C, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, D, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, D, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, D, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, D, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, A, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, A, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, A, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, B, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, B, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, B, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, C, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, C, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, C, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, C, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, D, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, D, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, D, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, D, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, A, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, A, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, A, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, B, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, B, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, B, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, C, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, C, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, C, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, C, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, D, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, D, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, D, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, D, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, A, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, A, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, A, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, B, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, B, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, B, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, C, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, C, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, C, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, C, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, D, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, D, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, D, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, D, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, A, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, A, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, A, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, B, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, B, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, B, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, C, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, C, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, C, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, C, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, D, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, D, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, D, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, D, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, A, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, A, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, A, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, B, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, B, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, B, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, C, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, C, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, C, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, C, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, D, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, D, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, D, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, D, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, A, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, A, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, A, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, B, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, B, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, B, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, C, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, C, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, C, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, C, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, D, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, D, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, D, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, D, D) - -#define GLM_SWIZZLE_GEN_VEC_FROM_VEC4_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, A, B, C, D) \ - GLM_SWIZZLE_GEN_VEC2_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, A, B, C, D) \ - GLM_SWIZZLE_GEN_VEC3_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC3_TYPE, A, B, C, D) \ - GLM_SWIZZLE_GEN_VEC4_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC4_TYPE, A, B, C, D) - -#define GLM_SWIZZLE_GEN_VEC_FROM_VEC4(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE) \ - GLM_SWIZZLE_GEN_VEC_FROM_VEC4_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, x, y, z, w) \ - GLM_SWIZZLE_GEN_VEC_FROM_VEC4_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, r, g, b, a) \ - GLM_SWIZZLE_GEN_VEC_FROM_VEC4_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, s, t, p, q) - -//GLM_SWIZZLE_GEN_VEC_FROM_VEC4(valType, detail::vec4, detail::vec2, detail::vec3, detail::vec4) diff --git a/extensions/common/glm/detail/_vectorize.hpp b/extensions/common/glm/detail/_vectorize.hpp deleted file mode 100644 index 3a8a4666891..00000000000 --- a/extensions/common/glm/detail/_vectorize.hpp +++ /dev/null @@ -1,160 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/_vectorize.hpp -/// @date 2011-10-14 / 2011-10-14 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "type_vec1.hpp" -#include "type_vec2.hpp" -#include "type_vec3.hpp" -#include "type_vec4.hpp" - -namespace glm{ -namespace detail -{ - template <typename R, typename T, precision P, template <typename, precision> class vecType> - struct functor1{}; - - template <typename R, typename T, precision P> - struct functor1<R, T, P, tvec1> - { - GLM_FUNC_QUALIFIER static tvec1<R, P> call(R (*Func) (T x), tvec1<T, P> const & v) - { - return tvec1<R, P>(Func(v.x)); - } - }; - - template <typename R, typename T, precision P> - struct functor1<R, T, P, tvec2> - { - GLM_FUNC_QUALIFIER static tvec2<R, P> call(R (*Func) (T x), tvec2<T, P> const & v) - { - return tvec2<R, P>(Func(v.x), Func(v.y)); - } - }; - - template <typename R, typename T, precision P> - struct functor1<R, T, P, tvec3> - { - GLM_FUNC_QUALIFIER static tvec3<R, P> call(R (*Func) (T x), tvec3<T, P> const & v) - { - return tvec3<R, P>(Func(v.x), Func(v.y), Func(v.z)); - } - }; - - template <typename R, typename T, precision P> - struct functor1<R, T, P, tvec4> - { - GLM_FUNC_QUALIFIER static tvec4<R, P> call(R (*Func) (T x), tvec4<T, P> const & v) - { - return tvec4<R, P>(Func(v.x), Func(v.y), Func(v.z), Func(v.w)); - } - }; - - template <typename T, precision P, template <typename, precision> class vecType> - struct functor2{}; - - template <typename T, precision P> - struct functor2<T, P, tvec1> - { - GLM_FUNC_QUALIFIER static tvec1<T, P> call(T (*Func) (T x, T y), tvec1<T, P> const & a, tvec1<T, P> const & b) - { - return tvec1<T, P>(Func(a.x, b.x)); - } - }; - - template <typename T, precision P> - struct functor2<T, P, tvec2> - { - GLM_FUNC_QUALIFIER static tvec2<T, P> call(T (*Func) (T x, T y), tvec2<T, P> const & a, tvec2<T, P> const & b) - { - return tvec2<T, P>(Func(a.x, b.x), Func(a.y, b.y)); - } - }; - - template <typename T, precision P> - struct functor2<T, P, tvec3> - { - GLM_FUNC_QUALIFIER static tvec3<T, P> call(T (*Func) (T x, T y), tvec3<T, P> const & a, tvec3<T, P> const & b) - { - return tvec3<T, P>(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z)); - } - }; - - template <typename T, precision P> - struct functor2<T, P, tvec4> - { - GLM_FUNC_QUALIFIER static tvec4<T, P> call(T (*Func) (T x, T y), tvec4<T, P> const & a, tvec4<T, P> const & b) - { - return tvec4<T, P>(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z), Func(a.w, b.w)); - } - }; - - template <typename T, precision P, template <typename, precision> class vecType> - struct functor2_vec_sca{}; - - template <typename T, precision P> - struct functor2_vec_sca<T, P, tvec1> - { - GLM_FUNC_QUALIFIER static tvec1<T, P> call(T (*Func) (T x, T y), tvec1<T, P> const & a, T b) - { - return tvec1<T, P>(Func(a.x, b)); - } - }; - - template <typename T, precision P> - struct functor2_vec_sca<T, P, tvec2> - { - GLM_FUNC_QUALIFIER static tvec2<T, P> call(T (*Func) (T x, T y), tvec2<T, P> const & a, T b) - { - return tvec2<T, P>(Func(a.x, b), Func(a.y, b)); - } - }; - - template <typename T, precision P> - struct functor2_vec_sca<T, P, tvec3> - { - GLM_FUNC_QUALIFIER static tvec3<T, P> call(T (*Func) (T x, T y), tvec3<T, P> const & a, T b) - { - return tvec3<T, P>(Func(a.x, b), Func(a.y, b), Func(a.z, b)); - } - }; - - template <typename T, precision P> - struct functor2_vec_sca<T, P, tvec4> - { - GLM_FUNC_QUALIFIER static tvec4<T, P> call(T (*Func) (T x, T y), tvec4<T, P> const & a, T b) - { - return tvec4<T, P>(Func(a.x, b), Func(a.y, b), Func(a.z, b), Func(a.w, b)); - } - }; -}//namespace detail -}//namespace glm diff --git a/extensions/common/glm/detail/dummy.cpp b/extensions/common/glm/detail/dummy.cpp deleted file mode 100644 index a64ce33075b..00000000000 --- a/extensions/common/glm/detail/dummy.cpp +++ /dev/null @@ -1,232 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/core/dummy.cpp -/// @date 2011-01-19 / 2011-06-15 -/// @author Christophe Riccio -/// -/// GLM is a header only library. There is nothing to compile. -/// dummy.cpp exist only a wordaround for CMake file. -/////////////////////////////////////////////////////////////////////////////////// - -#define GLM_MESSAGES -#include <glm/glm.hpp> -#include <glm/ext.hpp> -#include <limits> - -struct material -{ - glm::vec4 emission; // Ecm - glm::vec4 ambient; // Acm - glm::vec4 diffuse; // Dcm - glm::vec4 specular; // Scm - float shininess; // Srm -}; - -struct light -{ - glm::vec4 ambient; // Acli - glm::vec4 diffuse; // Dcli - glm::vec4 specular; // Scli - glm::vec4 position; // Ppli - glm::vec4 halfVector; // Derived: Hi - glm::vec3 spotDirection; // Sdli - float spotExponent; // Srli - float spotCutoff; // Crli - // (range: [0.0,90.0], 180.0) - float spotCosCutoff; // Derived: cos(Crli) - // (range: [1.0,0.0],-1.0) - float constantAttenuation; // K0 - float linearAttenuation; // K1 - float quadraticAttenuation;// K2 -}; - - -// Sample 1 -#include <glm/vec3.hpp>// glm::vec3 -#include <glm/geometric.hpp>// glm::cross, glm::normalize - -glm::vec3 computeNormal -( - glm::vec3 const & a, - glm::vec3 const & b, - glm::vec3 const & c -) -{ - return glm::normalize(glm::cross(c - a, b - a)); -} - -typedef unsigned int GLuint; -#define GL_FALSE 0 -void glUniformMatrix4fv(GLuint, int, int, float*){} - -// Sample 2 -#include <glm/vec3.hpp> // glm::vec3 -#include <glm/vec4.hpp> // glm::vec4, glm::ivec4 -#include <glm/mat4x4.hpp> // glm::mat4 -#include <glm/gtc/matrix_transform.hpp> // glm::translate, glm::rotate, glm::scale, glm::perspective -#include <glm/gtc/type_ptr.hpp> // glm::value_ptr -void func(GLuint LocationMVP, float Translate, glm::vec2 const & Rotate) -{ - glm::mat4 Projection = glm::perspective(45.0f, 4.0f / 3.0f, 0.1f, 100.f); - glm::mat4 ViewTranslate = glm::translate(glm::mat4(1.0f), glm::vec3(0.0f, 0.0f, -Translate)); - glm::mat4 ViewRotateX = glm::rotate(ViewTranslate, Rotate.y, glm::vec3(-1.0f, 0.0f, 0.0f)); - glm::mat4 View = glm::rotate(ViewRotateX, Rotate.x, glm::vec3(0.0f, 1.0f, 0.0f)); - glm::mat4 Model = glm::scale(glm::mat4(1.0f), glm::vec3(0.5f)); - glm::mat4 MVP = Projection * View * Model; - glUniformMatrix4fv(LocationMVP, 1, GL_FALSE, glm::value_ptr(MVP)); -} - -// Sample 3 -#include <glm/vec2.hpp>// glm::vec2 -#include <glm/packing.hpp>// glm::packUnorm2x16 -#include <glm/integer.hpp>// glm::uint -#include <glm/gtc/type_precision.hpp>// glm::i8vec2, glm::i32vec2 -std::size_t const VertexCount = 4; -// Float quad geometry -std::size_t const PositionSizeF32 = VertexCount * sizeof(glm::vec2); -glm::vec2 const PositionDataF32[VertexCount] = -{ - glm::vec2(-1.0f,-1.0f), - glm::vec2( 1.0f,-1.0f), - glm::vec2( 1.0f, 1.0f), - glm::vec2(-1.0f, 1.0f) - }; -// Half-float quad geometry -std::size_t const PositionSizeF16 = VertexCount * sizeof(glm::uint); -glm::uint const PositionDataF16[VertexCount] = -{ - glm::uint(glm::packUnorm2x16(glm::vec2(-1.0f, -1.0f))), - glm::uint(glm::packUnorm2x16(glm::vec2( 1.0f, -1.0f))), - glm::uint(glm::packUnorm2x16(glm::vec2( 1.0f, 1.0f))), - glm::uint(glm::packUnorm2x16(glm::vec2(-1.0f, 1.0f))) -}; -// 8 bits signed integer quad geometry -std::size_t const PositionSizeI8 = VertexCount * sizeof(glm::i8vec2); -glm::i8vec2 const PositionDataI8[VertexCount] = -{ - glm::i8vec2(-1,-1), - glm::i8vec2( 1,-1), - glm::i8vec2( 1, 1), - glm::i8vec2(-1, 1) -}; -// 32 bits signed integer quad geometry -std::size_t const PositionSizeI32 = VertexCount * sizeof(glm::i32vec2); -glm::i32vec2 const PositionDataI32[VertexCount] = -{ - glm::i32vec2 (-1,-1), - glm::i32vec2 ( 1,-1), - glm::i32vec2 ( 1, 1), - glm::i32vec2 (-1, 1) -}; - -struct intersection -{ - glm::vec4 position; - glm::vec3 normal; -}; - -/* -// Sample 4 -#include <glm/vec3.hpp>// glm::vec3 -#include <glm/geometric.hpp>// glm::normalize, glm::dot, glm::reflect -#include <glm/exponential.hpp>// glm::pow -#include <glm/gtc/random.hpp>// glm::vecRand3 -glm::vec3 lighting -( - intersection const & Intersection, - material const & Material, - light const & Light, - glm::vec3 const & View -) -{ - glm::vec3 Color(0.0f); - glm::vec3 LightVertor(glm::normalize( - Light.position - Intersection.position + - glm::vecRand3(0.0f, Light.inaccuracy)); - - if(!shadow(Intersection.position, Light.position, LightVertor)) - { - float Diffuse = glm::dot(Intersection.normal, LightVector); - if(Diffuse <= 0.0f) - return Color; - if(Material.isDiffuse()) - Color += Light.color() * Material.diffuse * Diffuse; - if(Material.isSpecular()) - { - glm::vec3 Reflect(glm::reflect( - glm::normalize(-LightVector), - glm::normalize(Intersection.normal))); - float Dot = glm::dot(Reflect, View); - float Base = Dot > 0.0f ? Dot : 0.0f; - float Specular = glm::pow(Base, Material.exponent); - Color += Material.specular * Specular; - } - } - return Color; -} -*/ - - -template <typename T, glm::precision P, template<typename, glm::precision> class vecType> -T normalizeDotA(vecType<T, P> const & x, vecType<T, P> const & y) -{ - return glm::dot(x, y) * glm::inversesqrt(glm::dot(x, x) * glm::dot(y, y)); -} - -#define GLM_TEMPLATE_GENTYPE typename T, glm::precision P, template<typename, glm::precision> class - -template <GLM_TEMPLATE_GENTYPE vecType> -T normalizeDotB(vecType<T, P> const & x, vecType<T, P> const & y) -{ - return glm::dot(x, y) * glm::inversesqrt(glm::dot(x, x) * glm::dot(y, y)); -} - -template <typename vecType> -typename vecType::value_type normalizeDotC(vecType const & a, vecType const & b) -{ - return glm::dot(a, b) * glm::inversesqrt(glm::dot(a, a) * glm::dot(b, b)); -} - -int main() -{ - glm::vec1 o(1); - glm::vec2 a(1); - glm::vec3 b(1); - glm::vec4 c(1); - - glm::quat q; - glm::dualquat p; - - glm::mat4 m(1); - - float a0 = normalizeDotA(a, a); - float b0 = normalizeDotB(b, b); - float c0 = normalizeDotC(c, c); - - return 0; -} diff --git a/extensions/common/glm/detail/func_common.hpp b/extensions/common/glm/detail/func_common.hpp deleted file mode 100644 index a9d01bd0428..00000000000 --- a/extensions/common/glm/detail/func_common.hpp +++ /dev/null @@ -1,456 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/func_common.hpp -/// @date 2008-03-08 / 2010-01-26 -/// @author Christophe Riccio -/// -/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> -/// -/// @defgroup core_func_common Common functions -/// @ingroup core -/// -/// These all operate component-wise. The description is per component. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "setup.hpp" -#include "precision.hpp" -#include "type_int.hpp" -#include "_fixes.hpp" - -namespace glm -{ - /// @addtogroup core_func_common - /// @{ - - /// Returns x if x >= 0; otherwise, it returns -x. - /// - /// @tparam genType floating-point or signed integer; scalar or vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/abs.xml">GLSL abs man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> - template <typename genType> - GLM_FUNC_DECL genType abs(genType x); - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> abs(vecType<T, P> const & x); - - /// Returns 1.0 if x > 0, 0.0 if x == 0, or -1.0 if x < 0. - /// - /// @tparam genType Floating-point or signed integer; scalar or vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/sign.xml">GLSL sign man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> sign(vecType<T, P> const & x); - - /// Returns a value equal to the nearest integer that is less then or equal to x. - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floor.xml">GLSL floor man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> floor(vecType<T, P> const & x); - - /// Returns a value equal to the nearest integer to x - /// whose absolute value is not larger than the absolute value of x. - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/trunc.xml">GLSL trunc man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> trunc(vecType<T, P> const & x); - - /// Returns a value equal to the nearest integer to x. - /// The fraction 0.5 will round in a direction chosen by the - /// implementation, presumably the direction that is fastest. - /// This includes the possibility that round(x) returns the - /// same value as roundEven(x) for all values of x. - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/round.xml">GLSL round man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> round(vecType<T, P> const & x); - - /// Returns a value equal to the nearest integer to x. - /// A fractional part of 0.5 will round toward the nearest even - /// integer. (Both 3.5 and 4.5 for x will return 4.0.) - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/roundEven.xml">GLSL roundEven man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> - /// @see <a href="http://developer.amd.com/documentation/articles/pages/New-Round-to-Even-Technique.aspx">New round to even technique</a> - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> roundEven(vecType<T, P> const & x); - - /// Returns a value equal to the nearest integer - /// that is greater than or equal to x. - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/ceil.xml">GLSL ceil man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> ceil(vecType<T, P> const & x); - - /// Return x - floor(x). - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/fract.xml">GLSL fract man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> - template <typename genType> - GLM_FUNC_DECL genType fract(genType x); - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> fract(vecType<T, P> const & x); - - /// Modulus. Returns x - y * floor(x / y) - /// for each component in x using the floating point value y. - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/mod.xml">GLSL mod man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> - template <typename genType> - GLM_FUNC_DECL genType mod(genType x, genType y); - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> mod(vecType<T, P> const & x, T y); - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> mod(vecType<T, P> const & x, vecType<T, P> const & y); - - /// Returns the fractional part of x and sets i to the integer - /// part (as a whole number floating point value). Both the - /// return value and the output parameter will have the same - /// sign as x. - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/modf.xml">GLSL modf man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> - template <typename genType> - GLM_FUNC_DECL genType modf(genType x, genType & i); - - /// Returns y if y < x; otherwise, it returns x. - /// - /// @tparam genType Floating-point or integer; scalar or vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/min.xml">GLSL min man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> - template <typename genType> - GLM_FUNC_DECL genType min(genType x, genType y); - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> min(vecType<T, P> const & x, T y); - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> min(vecType<T, P> const & x, vecType<T, P> const & y); - - /// Returns y if x < y; otherwise, it returns x. - /// - /// @tparam genType Floating-point or integer; scalar or vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/max.xml">GLSL max man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> - template <typename genType> - GLM_FUNC_DECL genType max(genType x, genType y); - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> max(vecType<T, P> const & x, T y); - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> max(vecType<T, P> const & x, vecType<T, P> const & y); - - /// Returns min(max(x, minVal), maxVal) for each component in x - /// using the floating-point values minVal and maxVal. - /// - /// @tparam genType Floating-point or integer; scalar or vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/clamp.xml">GLSL clamp man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> - template <typename genType> - GLM_FUNC_DECL genType clamp(genType x, genType minVal, genType maxVal); - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> clamp(vecType<T, P> const & x, T minVal, T maxVal); - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> clamp(vecType<T, P> const & x, vecType<T, P> const & minVal, vecType<T, P> const & maxVal); - - /// If genTypeU is a floating scalar or vector: - /// Returns x * (1.0 - a) + y * a, i.e., the linear blend of - /// x and y using the floating-point value a. - /// The value for a is not restricted to the range [0, 1]. - /// - /// If genTypeU is a boolean scalar or vector: - /// Selects which vector each returned component comes - /// from. For a component of <a> that is false, the - /// corresponding component of x is returned. For a - /// component of a that is true, the corresponding - /// component of y is returned. Components of x and y that - /// are not selected are allowed to be invalid floating point - /// values and will have no effect on the results. Thus, this - /// provides different functionality than - /// genType mix(genType x, genType y, genType(a)) - /// where a is a Boolean vector. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/mix.xml">GLSL mix man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> - /// - /// @param[in] x Value to interpolate. - /// @param[in] y Value to interpolate. - /// @param[in] a Interpolant. - /// - /// @tparam genTypeT Floating point scalar or vector. - /// @tparam genTypeU Floating point or boolean scalar or vector. It can't be a vector if it is the length of genTypeT. - /// - /// @code - /// #include <glm/glm.hpp> - /// ... - /// float a; - /// bool b; - /// glm::dvec3 e; - /// glm::dvec3 f; - /// glm::vec4 g; - /// glm::vec4 h; - /// ... - /// glm::vec4 r = glm::mix(g, h, a); // Interpolate with a floating-point scalar two vectors. - /// glm::vec4 s = glm::mix(g, h, b); // Teturns g or h; - /// glm::dvec3 t = glm::mix(e, f, a); // Types of the third parameter is not required to match with the first and the second. - /// glm::vec4 u = glm::mix(g, h, r); // Interpolations can be perform per component with a vector for the last parameter. - /// @endcode - template <typename T, typename U, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> mix(vecType<T, P> const & x, vecType<T, P> const & y, vecType<U, P> const & a); - - template <typename T, typename U, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> mix(vecType<T, P> const & x, vecType<T, P> const & y, U a); - - template <typename genTypeT, typename genTypeU> - GLM_FUNC_DECL genTypeT mix(genTypeT x, genTypeT y, genTypeU a); - - /// Returns 0.0 if x < edge, otherwise it returns 1.0 for each component of a genType. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/step.xml">GLSL step man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> - template <typename genType> - GLM_FUNC_DECL genType step(genType edge, genType x); - - /// Returns 0.0 if x < edge, otherwise it returns 1.0. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/step.xml">GLSL step man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> - template <template <typename, precision> class vecType, typename T, precision P> - GLM_FUNC_DECL vecType<T, P> step(T edge, vecType<T, P> const & x); - - /// Returns 0.0 if x < edge, otherwise it returns 1.0. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/step.xml">GLSL step man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> - template <template <typename, precision> class vecType, typename T, precision P> - GLM_FUNC_DECL vecType<T, P> step(vecType<T, P> const & edge, vecType<T, P> const & x); - - /// Returns 0.0 if x <= edge0 and 1.0 if x >= edge1 and - /// performs smooth Hermite interpolation between 0 and 1 - /// when edge0 < x < edge1. This is useful in cases where - /// you would want a threshold function with a smooth - /// transition. This is equivalent to: - /// genType t; - /// t = clamp ((x - edge0) / (edge1 - edge0), 0, 1); - /// return t * t * (3 - 2 * t); - /// Results are undefined if edge0 >= edge1. - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/smoothstep.xml">GLSL smoothstep man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> - template <typename genType> - GLM_FUNC_DECL genType smoothstep(genType edge0, genType edge1, genType x); - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> smoothstep(T edge0, T edge1, vecType<T, P> const & x); - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> smoothstep(vecType<T, P> const & edge0, vecType<T, P> const & edge1, vecType<T, P> const & x); - - /// Returns true if x holds a NaN (not a number) - /// representation in the underlying implementation's set of - /// floating point representations. Returns false otherwise, - /// including for implementations with no NaN - /// representations. - /// - /// /!\ When using compiler fast math, this function may fail. - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/isnan.xml">GLSL isnan man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<bool, P> isnan(vecType<T, P> const & x); - - /// Returns true if x holds a positive infinity or negative - /// infinity representation in the underlying implementation's - /// set of floating point representations. Returns false - /// otherwise, including for implementations with no infinity - /// representations. - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/isinf.xml">GLSL isinf man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<bool, P> isinf(vecType<T, P> const & x); - - /// Returns a signed integer value representing - /// the encoding of a floating-point value. The floating-point - /// value's bit-level representation is preserved. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floatBitsToInt.xml">GLSL floatBitsToInt man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> - GLM_FUNC_DECL int floatBitsToInt(float const & v); - - /// Returns a signed integer value representing - /// the encoding of a floating-point value. The floatingpoint - /// value's bit-level representation is preserved. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floatBitsToInt.xml">GLSL floatBitsToInt man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> - template <template <typename, precision> class vecType, precision P> - GLM_FUNC_DECL vecType<int, P> floatBitsToInt(vecType<float, P> const & v); - - /// Returns a unsigned integer value representing - /// the encoding of a floating-point value. The floatingpoint - /// value's bit-level representation is preserved. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floatBitsToUint.xml">GLSL floatBitsToUint man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> - GLM_FUNC_DECL uint floatBitsToUint(float const & v); - - /// Returns a unsigned integer value representing - /// the encoding of a floating-point value. The floatingpoint - /// value's bit-level representation is preserved. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floatBitsToUint.xml">GLSL floatBitsToUint man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> - template <template <typename, precision> class vecType, precision P> - GLM_FUNC_DECL vecType<uint, P> floatBitsToUint(vecType<float, P> const & v); - - /// Returns a floating-point value corresponding to a signed - /// integer encoding of a floating-point value. - /// If an inf or NaN is passed in, it will not signal, and the - /// resulting floating point value is unspecified. Otherwise, - /// the bit-level representation is preserved. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/intBitsToFloat.xml">GLSL intBitsToFloat man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> - GLM_FUNC_DECL float intBitsToFloat(int const & v); - - /// Returns a floating-point value corresponding to a signed - /// integer encoding of a floating-point value. - /// If an inf or NaN is passed in, it will not signal, and the - /// resulting floating point value is unspecified. Otherwise, - /// the bit-level representation is preserved. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/intBitsToFloat.xml">GLSL intBitsToFloat man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> - template <template <typename, precision> class vecType, precision P> - GLM_FUNC_DECL vecType<float, P> intBitsToFloat(vecType<int, P> const & v); - - /// Returns a floating-point value corresponding to a - /// unsigned integer encoding of a floating-point value. - /// If an inf or NaN is passed in, it will not signal, and the - /// resulting floating point value is unspecified. Otherwise, - /// the bit-level representation is preserved. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/uintBitsToFloat.xml">GLSL uintBitsToFloat man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> - GLM_FUNC_DECL float uintBitsToFloat(uint const & v); - - /// Returns a floating-point value corresponding to a - /// unsigned integer encoding of a floating-point value. - /// If an inf or NaN is passed in, it will not signal, and the - /// resulting floating point value is unspecified. Otherwise, - /// the bit-level representation is preserved. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/uintBitsToFloat.xml">GLSL uintBitsToFloat man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> - template <template <typename, precision> class vecType, precision P> - GLM_FUNC_DECL vecType<float, P> uintBitsToFloat(vecType<uint, P> const & v); - - /// Computes and returns a * b + c. - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/fma.xml">GLSL fma man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> - template <typename genType> - GLM_FUNC_DECL genType fma(genType const & a, genType const & b, genType const & c); - - /// Splits x into a floating-point significand in the range - /// [0.5, 1.0) and an integral exponent of two, such that: - /// x = significand * exp(2, exponent) - /// - /// The significand is returned by the function and the - /// exponent is returned in the parameter exp. For a - /// floating-point value of zero, the significant and exponent - /// are both zero. For a floating-point value that is an - /// infinity or is not a number, the results are undefined. - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/frexp.xml">GLSL frexp man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> - template <typename genType, typename genIType> - GLM_FUNC_DECL genType frexp(genType const & x, genIType & exp); - - /// Builds a floating-point number from x and the - /// corresponding integral exponent of two in exp, returning: - /// significand * exp(2, exponent) - /// - /// If this product is too large to be represented in the - /// floating-point type, the result is undefined. - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/ldexp.xml">GLSL ldexp man page</a>; - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> - template <typename genType, typename genIType> - GLM_FUNC_DECL genType ldexp(genType const & x, genIType const & exp); - - /// @} -}//namespace glm - -#include "func_common.inl" - diff --git a/extensions/common/glm/detail/func_common.inl b/extensions/common/glm/detail/func_common.inl deleted file mode 100644 index 83252de4071..00000000000 --- a/extensions/common/glm/detail/func_common.inl +++ /dev/null @@ -1,758 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/func_common.inl -/// @date 2008-08-03 / 2011-06-15 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#include "func_vector_relational.hpp" -#include "type_vec2.hpp" -#include "type_vec3.hpp" -#include "type_vec4.hpp" -#include "_vectorize.hpp" -#include <limits> - -namespace glm{ -namespace detail -{ - template <typename genFIType, bool /*signed*/> - struct compute_abs - {}; - - template <typename genFIType> - struct compute_abs<genFIType, true> - { - GLM_FUNC_QUALIFIER static genFIType call(genFIType x) - { - GLM_STATIC_ASSERT( - std::numeric_limits<genFIType>::is_iec559 || std::numeric_limits<genFIType>::is_signed, - "'abs' only accept floating-point and integer scalar or vector inputs"); - - return x >= genFIType(0) ? x : -x; - // TODO, perf comp with: *(((int *) &x) + 1) &= 0x7fffffff; - } - }; - - template <typename genFIType> - struct compute_abs<genFIType, false> - { - GLM_FUNC_QUALIFIER static genFIType call(genFIType x) - { - GLM_STATIC_ASSERT( - !std::numeric_limits<genFIType>::is_signed && std::numeric_limits<genFIType>::is_integer, - "'abs' only accept floating-point and integer scalar or vector inputs"); - return x; - } - }; - - template <typename T, typename U, precision P, template <class, precision> class vecType> - struct compute_mix_vector - { - GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x, vecType<T, P> const & y, vecType<U, P> const & a) - { - GLM_STATIC_ASSERT(std::numeric_limits<U>::is_iec559, "'mix' only accept floating-point inputs for the interpolator a"); - - return vecType<T, P>(vecType<U, P>(x) + a * vecType<U, P>(y - x)); - } - }; - - template <typename T, precision P, template <class, precision> class vecType> - struct compute_mix_vector<T, bool, P, vecType> - { - GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x, vecType<T, P> const & y, vecType<bool, P> const & a) - { - vecType<T, P> Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(x); ++i) - Result[i] = a[i] ? y[i] : x[i]; - return Result; - } - }; - - template <typename T, typename U, precision P, template <class, precision> class vecType> - struct compute_mix_scalar - { - GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x, vecType<T, P> const & y, U const & a) - { - GLM_STATIC_ASSERT(std::numeric_limits<U>::is_iec559, "'mix' only accept floating-point inputs for the interpolator a"); - - return vecType<T, P>(vecType<U, P>(x) + a * vecType<U, P>(y - x)); - } - }; - - template <typename T, precision P, template <class, precision> class vecType> - struct compute_mix_scalar<T, bool, P, vecType> - { - GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x, vecType<T, P> const & y, bool const & a) - { - return a ? y : x; - } - }; - - template <typename T, typename U> - struct compute_mix - { - GLM_FUNC_QUALIFIER static T call(T const & x, T const & y, U const & a) - { - GLM_STATIC_ASSERT(std::numeric_limits<U>::is_iec559, "'mix' only accept floating-point inputs for the interpolator a"); - - return static_cast<T>(static_cast<U>(x) + a * static_cast<U>(y - x)); - } - }; - - template <typename T> - struct compute_mix<T, bool> - { - GLM_FUNC_QUALIFIER static T call(T const & x, T const & y, bool const & a) - { - return a ? y : x; - } - }; - - template <typename T, precision P, template <class, precision> class vecType, bool isFloat = true, bool isSigned = true> - struct compute_sign - { - GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x) - { - return vecType<T, P>(glm::lessThan(vecType<T, P>(0), x)) - vecType<T, P>(glm::lessThan(x, vecType<T, P>(0))); - } - }; - - template <typename T, precision P, template <class, precision> class vecType> - struct compute_sign<T, P, vecType, false, false> - { - GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x) - { - return vecType<T, P>(glm::greaterThan(x , vecType<T, P>(0))); - } - }; - - template <typename T, precision P, template <class, precision> class vecType> - struct compute_sign<T, P, vecType, false, true> - { - GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x) - { - T const Shift(static_cast<T>(sizeof(T) * 8 - 1)); - vecType<T, P> const y(vecType<typename make_unsigned<T>::type, P>(-x) >> typename make_unsigned<T>::type(Shift)); - - return (x >> Shift) | y; - } - }; - - template <typename T, precision P, template <class, precision> class vecType, typename genType, bool isFloat = true> - struct compute_mod - { - GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & a, genType const & b) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'mod' only accept floating-point inputs. Include <glm/gtc/integer.hpp> for integer inputs."); - return a - b * floor(a / b); - } - }; -}//namespace detail - - // abs - template <> - GLM_FUNC_QUALIFIER int32 abs(int32 x) - { - int32 const y = x >> 31; - return (x ^ y) - y; - } - - template <typename genFIType> - GLM_FUNC_QUALIFIER genFIType abs(genFIType x) - { - return detail::compute_abs<genFIType, std::numeric_limits<genFIType>::is_signed>::call(x); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> abs(vecType<T, P> const & x) - { - return detail::functor1<T, T, P, vecType>::call(abs, x); - } - - // sign - // fast and works for any type - template <typename genFIType> - GLM_FUNC_QUALIFIER genFIType sign(genFIType x) - { - GLM_STATIC_ASSERT( - std::numeric_limits<genFIType>::is_iec559 || (std::numeric_limits<genFIType>::is_signed && std::numeric_limits<genFIType>::is_integer), - "'sign' only accept signed inputs"); - - return detail::compute_sign<genFIType, defaultp, tvec1, std::numeric_limits<genFIType>::is_iec559>::call(tvec1<genFIType>(x)).x; - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> sign(vecType<T, P> const & x) - { - GLM_STATIC_ASSERT( - std::numeric_limits<T>::is_iec559 || (std::numeric_limits<T>::is_signed && std::numeric_limits<T>::is_integer), - "'sign' only accept signed inputs"); - - return detail::compute_sign<T, P, vecType, std::numeric_limits<T>::is_iec559>::call(x); - } - - // floor - using ::std::floor; - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> floor(vecType<T, P> const & x) - { - return detail::functor1<T, T, P, vecType>::call(floor, x); - } - - // trunc -# if GLM_HAS_CXX11_STL - using ::std::trunc; -# else - template <typename genType> - GLM_FUNC_QUALIFIER genType trunc(genType x) - { - GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'trunc' only accept floating-point inputs"); - - return x < static_cast<genType>(0) ? -floor(-x) : floor(x); - } -# endif - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> trunc(vecType<T, P> const & x) - { - return detail::functor1<T, T, P, vecType>::call(trunc, x); - } - - // round -# if GLM_HAS_CXX11_STL - using ::std::round; -# else - template <typename genType> - GLM_FUNC_QUALIFIER genType round(genType x) - { - GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'round' only accept floating-point inputs"); - - return x < static_cast<genType>(0) ? static_cast<genType>(int(x - static_cast<genType>(0.5))) : static_cast<genType>(int(x + static_cast<genType>(0.5))); - } -# endif - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> round(vecType<T, P> const & x) - { - return detail::functor1<T, T, P, vecType>::call(round, x); - } - -/* - // roundEven - template <typename genType> - GLM_FUNC_QUALIFIER genType roundEven(genType const& x) - { - GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'roundEven' only accept floating-point inputs"); - - return genType(int(x + genType(int(x) % 2))); - } -*/ - - // roundEven - template <typename genType> - GLM_FUNC_QUALIFIER genType roundEven(genType x) - { - GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'roundEven' only accept floating-point inputs"); - - int Integer = static_cast<int>(x); - genType IntegerPart = static_cast<genType>(Integer); - genType FractionalPart = fract(x); - - if(FractionalPart > static_cast<genType>(0.5) || FractionalPart < static_cast<genType>(0.5)) - { - return round(x); - } - else if((Integer % 2) == 0) - { - return IntegerPart; - } - else if(x <= static_cast<genType>(0)) // Work around... - { - return IntegerPart - static_cast<genType>(1); - } - else - { - return IntegerPart + static_cast<genType>(1); - } - //else // Bug on MinGW 4.5.2 - //{ - // return mix(IntegerPart + genType(-1), IntegerPart + genType(1), x <= genType(0)); - //} - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> roundEven(vecType<T, P> const & x) - { - return detail::functor1<T, T, P, vecType>::call(roundEven, x); - } - - // ceil - using ::std::ceil; - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> ceil(vecType<T, P> const & x) - { - return detail::functor1<T, T, P, vecType>::call(ceil, x); - } - - // fract - template <typename genType> - GLM_FUNC_QUALIFIER genType fract(genType x) - { - GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'fract' only accept floating-point inputs"); - - return fract(tvec1<genType>(x)).x; - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> fract(vecType<T, P> const & x) - { - return x - floor(x); - } - - // mod - template <typename genType> - GLM_FUNC_QUALIFIER genType mod(genType x, genType y) - { - return mod(tvec1<genType>(x), y).x; - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> mod(vecType<T, P> const & x, T y) - { - return detail::compute_mod<T, P, vecType, T, std::numeric_limits<T>::is_iec559>::call(x, y); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> mod(vecType<T, P> const & x, vecType<T, P> const & y) - { - return detail::compute_mod<T, P, vecType, vecType<T, P>, std::numeric_limits<T>::is_iec559>::call(x, y); - } - - // modf - template <typename genType> - GLM_FUNC_QUALIFIER genType modf(genType x, genType & i) - { - GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'modf' only accept floating-point inputs"); - - return std::modf(x, &i); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec1<T, P> modf(tvec1<T, P> const & x, tvec1<T, P> & i) - { - return tvec1<T, P>( - modf(x.x, i.x)); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> modf(tvec2<T, P> const & x, tvec2<T, P> & i) - { - return tvec2<T, P>( - modf(x.x, i.x), - modf(x.y, i.y)); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> modf(tvec3<T, P> const & x, tvec3<T, P> & i) - { - return tvec3<T, P>( - modf(x.x, i.x), - modf(x.y, i.y), - modf(x.z, i.z)); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> modf(tvec4<T, P> const & x, tvec4<T, P> & i) - { - return tvec4<T, P>( - modf(x.x, i.x), - modf(x.y, i.y), - modf(x.z, i.z), - modf(x.w, i.w)); - } - - //// Only valid if (INT_MIN <= x-y <= INT_MAX) - //// min(x,y) - //r = y + ((x - y) & ((x - y) >> (sizeof(int) * - //CHAR_BIT - 1))); - //// max(x,y) - //r = x - ((x - y) & ((x - y) >> (sizeof(int) * - //CHAR_BIT - 1))); - - // min - template <typename genType> - GLM_FUNC_QUALIFIER genType min(genType x, genType y) - { - GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || std::numeric_limits<genType>::is_integer, "'min' only accept floating-point or integer inputs"); - - return x < y ? x : y; - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> min(vecType<T, P> const & a, T b) - { - return detail::functor2_vec_sca<T, P, vecType>::call(min, a, b); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> min(vecType<T, P> const & a, vecType<T, P> const & b) - { - return detail::functor2<T, P, vecType>::call(min, a, b); - } - - // max - template <typename genType> - GLM_FUNC_QUALIFIER genType max(genType x, genType y) - { - GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || std::numeric_limits<genType>::is_integer, "'max' only accept floating-point or integer inputs"); - - return x > y ? x : y; - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> max(vecType<T, P> const & a, T b) - { - return detail::functor2_vec_sca<T, P, vecType>::call(max, a, b); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> max(vecType<T, P> const & a, vecType<T, P> const & b) - { - return detail::functor2<T, P, vecType>::call(max, a, b); - } - - // clamp - template <typename genType> - GLM_FUNC_QUALIFIER genType clamp(genType x, genType minVal, genType maxVal) - { - GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || std::numeric_limits<genType>::is_integer, "'clamp' only accept floating-point or integer inputs"); - - return min(max(x, minVal), maxVal); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> clamp(vecType<T, P> const & x, T minVal, T maxVal) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || std::numeric_limits<T>::is_integer, "'clamp' only accept floating-point or integer inputs"); - - return min(max(x, minVal), maxVal); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> clamp(vecType<T, P> const & x, vecType<T, P> const & minVal, vecType<T, P> const & maxVal) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || std::numeric_limits<T>::is_integer, "'clamp' only accept floating-point or integer inputs"); - - return min(max(x, minVal), maxVal); - } - - template <typename genTypeT, typename genTypeU> - GLM_FUNC_QUALIFIER genTypeT mix(genTypeT x, genTypeT y, genTypeU a) - { - return detail::compute_mix<genTypeT, genTypeU>::call(x, y, a); - } - - template <typename T, typename U, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> mix(vecType<T, P> const & x, vecType<T, P> const & y, U a) - { - return detail::compute_mix_scalar<T, U, P, vecType>::call(x, y, a); - } - - template <typename T, typename U, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> mix(vecType<T, P> const & x, vecType<T, P> const & y, vecType<U, P> const & a) - { - return detail::compute_mix_vector<T, U, P, vecType>::call(x, y, a); - } - - // step - template <typename genType> - GLM_FUNC_QUALIFIER genType step(genType edge, genType x) - { - return mix(static_cast<genType>(1), static_cast<genType>(0), glm::lessThan(x, edge)); - } - - template <template <typename, precision> class vecType, typename T, precision P> - GLM_FUNC_QUALIFIER vecType<T, P> step(T edge, vecType<T, P> const & x) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'step' only accept floating-point inputs"); - - return mix(vecType<T, P>(1), vecType<T, P>(0), glm::lessThan(x, vecType<T, P>(edge))); - } - - template <template <typename, precision> class vecType, typename T, precision P> - GLM_FUNC_QUALIFIER vecType<T, P> step(vecType<T, P> const & edge, vecType<T, P> const & x) - { - return mix(vecType<T, P>(1), vecType<T, P>(0), glm::lessThan(x, edge)); - } - - // smoothstep - template <typename genType> - GLM_FUNC_QUALIFIER genType smoothstep(genType edge0, genType edge1, genType x) - { - GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'smoothstep' only accept floating-point inputs"); - - genType const tmp(clamp((x - edge0) / (edge1 - edge0), genType(0), genType(1))); - return tmp * tmp * (genType(3) - genType(2) * tmp); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> smoothstep(T edge0, T edge1, vecType<T, P> const & x) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'smoothstep' only accept floating-point inputs"); - - vecType<T, P> const tmp(clamp((x - edge0) / (edge1 - edge0), static_cast<T>(0), static_cast<T>(1))); - return tmp * tmp * (static_cast<T>(3) - static_cast<T>(2) * tmp); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> smoothstep(vecType<T, P> const & edge0, vecType<T, P> const & edge1, vecType<T, P> const & x) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'smoothstep' only accept floating-point inputs"); - - vecType<T, P> const tmp(clamp((x - edge0) / (edge1 - edge0), static_cast<T>(0), static_cast<T>(1))); - return tmp * tmp * (static_cast<T>(3) - static_cast<T>(2) * tmp); - } - -# if GLM_HAS_CXX11_STL - using std::isnan; -# else - template <typename genType> - GLM_FUNC_QUALIFIER bool isnan(genType x) - { - GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'isnan' only accept floating-point inputs"); - -# if GLM_HAS_CXX11_STL - return std::isnan(x); -# elif GLM_COMPILER & (GLM_COMPILER_VC | GLM_COMPILER_INTEL) - return _isnan(x) != 0; -# elif GLM_COMPILER & (GLM_COMPILER_GCC | (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM)) -# if GLM_PLATFORM & GLM_PLATFORM_ANDROID && __cplusplus < 201103L - return _isnan(x) != 0; -# else - return std::isnan(x); -# endif -# elif GLM_COMPILER & GLM_COMPILER_CUDA - return isnan(x) != 0; -# else - return std::isnan(x); -# endif - } -# endif - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<bool, P> isnan(vecType<T, P> const & x) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'isnan' only accept floating-point inputs"); - - return detail::functor1<bool, T, P, vecType>::call(isnan, x); - } - -# if GLM_HAS_CXX11_STL - using std::isinf; -# else - template <typename genType> - GLM_FUNC_QUALIFIER bool isinf(genType x) - { - GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'isinf' only accept floating-point inputs"); - -# if GLM_HAS_CXX11_STL - return std::isinf(x); -# elif GLM_COMPILER & (GLM_COMPILER_INTEL | GLM_COMPILER_VC) - return _fpclass(x) == _FPCLASS_NINF || _fpclass(x) == _FPCLASS_PINF; -# elif GLM_COMPILER & (GLM_COMPILER_GCC | (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM)) -# if(GLM_PLATFORM & GLM_PLATFORM_ANDROID && __cplusplus < 201103L) - return _isinf(x) != 0; -# else - return std::isinf(x); -# endif -# elif GLM_COMPILER & GLM_COMPILER_CUDA - // http://developer.download.nvidia.com/compute/cuda/4_2/rel/toolkit/docs/online/group__CUDA__MATH__DOUBLE_g13431dd2b40b51f9139cbb7f50c18fab.html#g13431dd2b40b51f9139cbb7f50c18fab - return isinf(double(x)) != 0; -# else - return std::isinf(x); -# endif - } -# endif - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<bool, P> isinf(vecType<T, P> const & x) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'isnan' only accept floating-point inputs"); - - return detail::functor1<bool, T, P, vecType>::call(isinf, x); - } - - GLM_FUNC_QUALIFIER int floatBitsToInt(float const & v) - { - return reinterpret_cast<int&>(const_cast<float&>(v)); - } - - template <template <typename, precision> class vecType, precision P> - GLM_FUNC_QUALIFIER vecType<int, P> floatBitsToInt(vecType<float, P> const & v) - { - return reinterpret_cast<vecType<int, P>&>(const_cast<vecType<float, P>&>(v)); - } - - GLM_FUNC_QUALIFIER uint floatBitsToUint(float const & v) - { - return reinterpret_cast<uint&>(const_cast<float&>(v)); - } - - template <template <typename, precision> class vecType, precision P> - GLM_FUNC_QUALIFIER vecType<uint, P> floatBitsToUint(vecType<float, P> const & v) - { - return reinterpret_cast<vecType<uint, P>&>(const_cast<vecType<float, P>&>(v)); - } - - GLM_FUNC_QUALIFIER float intBitsToFloat(int const & v) - { - return reinterpret_cast<float&>(const_cast<int&>(v)); - } - - template <template <typename, precision> class vecType, precision P> - GLM_FUNC_QUALIFIER vecType<float, P> intBitsToFloat(vecType<int, P> const & v) - { - return reinterpret_cast<vecType<float, P>&>(const_cast<vecType<int, P>&>(v)); - } - - GLM_FUNC_QUALIFIER float uintBitsToFloat(uint const & v) - { - return reinterpret_cast<float&>(const_cast<uint&>(v)); - } - - template <template <typename, precision> class vecType, precision P> - GLM_FUNC_QUALIFIER vecType<float, P> uintBitsToFloat(vecType<uint, P> const & v) - { - return reinterpret_cast<vecType<float, P>&>(const_cast<vecType<uint, P>&>(v)); - } - - template <typename genType> - GLM_FUNC_QUALIFIER genType fma(genType const & a, genType const & b, genType const & c) - { - return a * b + c; - } - - template <typename genType> - GLM_FUNC_QUALIFIER genType frexp(genType x, int & exp) - { - GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'frexp' only accept floating-point inputs"); - - return std::frexp(x, exp); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec1<T, P> frexp(tvec1<T, P> const & x, tvec1<int, P> & exp) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'frexp' only accept floating-point inputs"); - - return tvec1<T, P>(std::frexp(x.x, exp.x)); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> frexp(tvec2<T, P> const & x, tvec2<int, P> & exp) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'frexp' only accept floating-point inputs"); - - return tvec2<T, P>( - frexp(x.x, exp.x), - frexp(x.y, exp.y)); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> frexp(tvec3<T, P> const & x, tvec3<int, P> & exp) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'frexp' only accept floating-point inputs"); - - return tvec3<T, P>( - frexp(x.x, exp.x), - frexp(x.y, exp.y), - frexp(x.z, exp.z)); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> frexp(tvec4<T, P> const & x, tvec4<int, P> & exp) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'frexp' only accept floating-point inputs"); - - return tvec4<T, P>( - frexp(x.x, exp.x), - frexp(x.y, exp.y), - frexp(x.z, exp.z), - frexp(x.w, exp.w)); - } - - template <typename genType, precision P> - GLM_FUNC_QUALIFIER genType ldexp(genType const & x, int const & exp) - { - GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'ldexp' only accept floating-point inputs"); - - return std::ldexp(x, exp); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec1<T, P> ldexp(tvec1<T, P> const & x, tvec1<int, P> const & exp) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'ldexp' only accept floating-point inputs"); - - return tvec1<T, P>( - ldexp(x.x, exp.x)); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> ldexp(tvec2<T, P> const & x, tvec2<int, P> const & exp) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'ldexp' only accept floating-point inputs"); - - return tvec2<T, P>( - ldexp(x.x, exp.x), - ldexp(x.y, exp.y)); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> ldexp(tvec3<T, P> const & x, tvec3<int, P> const & exp) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'ldexp' only accept floating-point inputs"); - - return tvec3<T, P>( - ldexp(x.x, exp.x), - ldexp(x.y, exp.y), - ldexp(x.z, exp.z)); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> ldexp(tvec4<T, P> const & x, tvec4<int, P> const & exp) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'ldexp' only accept floating-point inputs"); - - return tvec4<T, P>( - ldexp(x.x, exp.x), - ldexp(x.y, exp.y), - ldexp(x.z, exp.z), - ldexp(x.w, exp.w)); - } -}//namespace glm diff --git a/extensions/common/glm/detail/func_exponential.hpp b/extensions/common/glm/detail/func_exponential.hpp deleted file mode 100644 index 12558f12593..00000000000 --- a/extensions/common/glm/detail/func_exponential.hpp +++ /dev/null @@ -1,132 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/func_exponential.hpp -/// @date 2008-08-08 / 2011-06-14 -/// @author Christophe Riccio -/// -/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a> -/// -/// @defgroup core_func_exponential Exponential functions -/// @ingroup core -/// -/// These all operate component-wise. The description is per component. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "type_vec1.hpp" -#include "type_vec2.hpp" -#include "type_vec3.hpp" -#include "type_vec4.hpp" -#include <cmath> - -namespace glm -{ - /// @addtogroup core_func_exponential - /// @{ - - /// Returns 'base' raised to the power 'exponent'. - /// - /// @param base Floating point value. pow function is defined for input values of 'base' defined in the range (inf-, inf+) in the limit of the type precision. - /// @param exponent Floating point value representing the 'exponent'. - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/pow.xml">GLSL pow man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a> - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> pow(vecType<T, P> const & base, vecType<T, P> const & exponent); - - /// Returns the natural exponentiation of x, i.e., e^x. - /// - /// @param v exp function is defined for input values of v defined in the range (inf-, inf+) in the limit of the type precision. - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/exp.xml">GLSL exp man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a> - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> exp(vecType<T, P> const & v); - - /// Returns the natural logarithm of v, i.e., - /// returns the value y which satisfies the equation x = e^y. - /// Results are undefined if v <= 0. - /// - /// @param v log function is defined for input values of v defined in the range (0, inf+) in the limit of the type precision. - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/log.xml">GLSL log man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a> - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> log(vecType<T, P> const & v); - - /// Returns 2 raised to the v power. - /// - /// @param v exp2 function is defined for input values of v defined in the range (inf-, inf+) in the limit of the type precision. - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/exp2.xml">GLSL exp2 man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a> - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> exp2(vecType<T, P> const & v); - - /// Returns the base 2 log of x, i.e., returns the value y, - /// which satisfies the equation x = 2 ^ y. - /// - /// @param v log2 function is defined for input values of v defined in the range (0, inf+) in the limit of the type precision. - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/log2.xml">GLSL log2 man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a> - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> log2(vecType<T, P> const & v); - - /// Returns the positive square root of v. - /// - /// @param v sqrt function is defined for input values of v defined in the range [0, inf+) in the limit of the type precision. - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/sqrt.xml">GLSL sqrt man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a> - //template <typename genType> - //GLM_FUNC_DECL genType sqrt(genType const & x); - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> sqrt(vecType<T, P> const & v); - - /// Returns the reciprocal of the positive square root of v. - /// - /// @param v inversesqrt function is defined for input values of v defined in the range [0, inf+) in the limit of the type precision. - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/inversesqrt.xml">GLSL inversesqrt man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a> - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> inversesqrt(vecType<T, P> const & v); - - /// @} -}//namespace glm - -#include "func_exponential.inl" diff --git a/extensions/common/glm/detail/func_exponential.inl b/extensions/common/glm/detail/func_exponential.inl deleted file mode 100644 index d5583922538..00000000000 --- a/extensions/common/glm/detail/func_exponential.inl +++ /dev/null @@ -1,161 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/func_exponential.inl -/// @date 2008-08-03 / 2011-06-15 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#include "func_vector_relational.hpp" -#include "_vectorize.hpp" -#include <limits> -#include <cmath> -#include <cassert> - -namespace glm{ -namespace detail -{ -# if GLM_HAS_CXX11_STL - using std::log2; -# else - template <typename genType> - genType log2(genType Value) - { - return std::log(Value) * static_cast<genType>(1.4426950408889634073599246810019); - } -# endif - - template <typename T, precision P, template <class, precision> class vecType, bool isFloat = true> - struct compute_log2 - { - GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & vec) - { - return detail::functor1<T, T, P, vecType>::call(log2, vec); - } - }; - - template <template <class, precision> class vecType, typename T, precision P> - struct compute_inversesqrt - { - GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x) - { - return static_cast<T>(1) / sqrt(x); - } - }; - - template <template <class, precision> class vecType> - struct compute_inversesqrt<vecType, float, lowp> - { - GLM_FUNC_QUALIFIER static vecType<float, lowp> call(vecType<float, lowp> const & x) - { - vecType<float, lowp> tmp(x); - vecType<float, lowp> xhalf(tmp * 0.5f); - vecType<uint, lowp>* p = reinterpret_cast<vecType<uint, lowp>*>(const_cast<vecType<float, lowp>*>(&x)); - vecType<uint, lowp> i = vecType<uint, lowp>(0x5f375a86) - (*p >> vecType<uint, lowp>(1)); - vecType<float, lowp>* ptmp = reinterpret_cast<vecType<float, lowp>*>(&i); - tmp = *ptmp; - tmp = tmp * (1.5f - xhalf * tmp * tmp); - return tmp; - } - }; -}//namespace detail - - // pow - using std::pow; - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> pow(vecType<T, P> const & base, vecType<T, P> const & exponent) - { - return detail::functor2<T, P, vecType>::call(pow, base, exponent); - } - - // exp - using std::exp; - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> exp(vecType<T, P> const & x) - { - return detail::functor1<T, T, P, vecType>::call(exp, x); - } - - // log - using std::log; - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> log(vecType<T, P> const & x) - { - return detail::functor1<T, T, P, vecType>::call(log, x); - } - - //exp2, ln2 = 0.69314718055994530941723212145818f - template <typename genType> - GLM_FUNC_QUALIFIER genType exp2(genType x) - { - GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'exp2' only accept floating-point inputs"); - - return std::exp(static_cast<genType>(0.69314718055994530941723212145818) * x); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> exp2(vecType<T, P> const & x) - { - return detail::functor1<T, T, P, vecType>::call(exp2, x); - } - - // log2, ln2 = 0.69314718055994530941723212145818f - template <typename genType> - GLM_FUNC_QUALIFIER genType log2(genType x) - { - return log2(tvec1<genType>(x)).x; - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> log2(vecType<T, P> const & x) - { - return detail::compute_log2<T, P, vecType, std::numeric_limits<T>::is_iec559>::call(x); - } - - // sqrt - using std::sqrt; - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> sqrt(vecType<T, P> const & x) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'sqrt' only accept floating-point inputs"); - return detail::functor1<T, T, P, vecType>::call(sqrt, x); - } - - // inversesqrt - template <typename genType> - GLM_FUNC_QUALIFIER genType inversesqrt(genType x) - { - return static_cast<genType>(1) / sqrt(x); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> inversesqrt(vecType<T, P> const & x) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'inversesqrt' only accept floating-point inputs"); - return detail::compute_inversesqrt<vecType, T, P>::call(x); - } -}//namespace glm diff --git a/extensions/common/glm/detail/func_geometric.hpp b/extensions/common/glm/detail/func_geometric.hpp deleted file mode 100644 index 35549db2f3f..00000000000 --- a/extensions/common/glm/detail/func_geometric.hpp +++ /dev/null @@ -1,142 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/func_geometric.hpp -/// @date 2008-08-03 / 2011-06-14 -/// @author Christophe Riccio -/// -/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a> -/// -/// @defgroup core_func_geometric Geometric functions -/// @ingroup core -/// -/// These operate on vectors as vectors, not component-wise. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "type_vec3.hpp" - -namespace glm -{ - /// @addtogroup core_func_geometric - /// @{ - - /// Returns the length of x, i.e., sqrt(x * x). - /// - /// @tparam genType Floating-point vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/length.xml">GLSL length man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a> - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL T length( - vecType<T, P> const & x); - - /// Returns the distance betwwen p0 and p1, i.e., length(p0 - p1). - /// - /// @tparam genType Floating-point vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/distance.xml">GLSL distance man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a> - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL T distance( - vecType<T, P> const & p0, - vecType<T, P> const & p1); - - /// Returns the dot product of x and y, i.e., result = x * y. - /// - /// @tparam genType Floating-point vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/dot.xml">GLSL dot man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a> - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL T dot( - vecType<T, P> const & x, - vecType<T, P> const & y); - - /// Returns the cross product of x and y. - /// - /// @tparam valType Floating-point scalar types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/cross.xml">GLSL cross man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a> - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> cross( - tvec3<T, P> const & x, - tvec3<T, P> const & y); - - /// Returns a vector in the same direction as x but with length of 1. - /// According to issue 10 GLSL 1.10 specification, if length(x) == 0 then result is undefined and generate an error. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/normalize.xml">GLSL normalize man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a> - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> normalize( - vecType<T, P> const & x); - - /// If dot(Nref, I) < 0.0, return N, otherwise, return -N. - /// - /// @tparam genType Floating-point vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/faceforward.xml">GLSL faceforward man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a> - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> faceforward( - vecType<T, P> const & N, - vecType<T, P> const & I, - vecType<T, P> const & Nref); - - /// For the incident vector I and surface orientation N, - /// returns the reflection direction : result = I - 2.0 * dot(N, I) * N. - /// - /// @tparam genType Floating-point vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/reflect.xml">GLSL reflect man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a> - template <typename genType> - GLM_FUNC_DECL genType reflect( - genType const & I, - genType const & N); - - /// For the incident vector I and surface normal N, - /// and the ratio of indices of refraction eta, - /// return the refraction vector. - /// - /// @tparam genType Floating-point vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/refract.xml">GLSL refract man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a> - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> refract( - vecType<T, P> const & I, - vecType<T, P> const & N, - T eta); - - /// @} -}//namespace glm - -#include "func_geometric.inl" diff --git a/extensions/common/glm/detail/func_geometric.inl b/extensions/common/glm/detail/func_geometric.inl deleted file mode 100644 index 0673718b14b..00000000000 --- a/extensions/common/glm/detail/func_geometric.inl +++ /dev/null @@ -1,201 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/func_geometric.inl -/// @date 2008-08-03 / 2011-06-15 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#include "func_exponential.hpp" -#include "func_common.hpp" -#include "type_vec2.hpp" -#include "type_vec4.hpp" -#include "type_float.hpp" - -namespace glm{ -namespace detail -{ - template <template <class, precision> class vecType, typename T, precision P> - struct compute_dot{}; - - template <typename T, precision P> - struct compute_dot<tvec1, T, P> - { - GLM_FUNC_QUALIFIER static T call(tvec1<T, P> const & a, tvec1<T, P> const & b) - { - return a.x * b.x; - } - }; - - template <typename T, precision P> - struct compute_dot<tvec2, T, P> - { - GLM_FUNC_QUALIFIER static T call(tvec2<T, P> const & x, tvec2<T, P> const & y) - { - tvec2<T, P> tmp(x * y); - return tmp.x + tmp.y; - } - }; - - template <typename T, precision P> - struct compute_dot<tvec3, T, P> - { - GLM_FUNC_QUALIFIER static T call(tvec3<T, P> const & x, tvec3<T, P> const & y) - { - tvec3<T, P> tmp(x * y); - return tmp.x + tmp.y + tmp.z; - } - }; - - template <typename T, precision P> - struct compute_dot<tvec4, T, P> - { - GLM_FUNC_QUALIFIER static T call(tvec4<T, P> const & x, tvec4<T, P> const & y) - { - tvec4<T, P> tmp(x * y); - return (tmp.x + tmp.y) + (tmp.z + tmp.w); - } - }; -}//namespace detail - - // length - template <typename genType> - GLM_FUNC_QUALIFIER genType length(genType x) - { - GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'length' only accept floating-point inputs"); - - return abs(x); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER T length(vecType<T, P> const & v) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'length' only accept floating-point inputs"); - - return sqrt(dot(v, v)); - } - - // distance - template <typename genType> - GLM_FUNC_QUALIFIER genType distance(genType const & p0, genType const & p1) - { - GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'distance' only accept floating-point inputs"); - - return length(p1 - p0); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER T distance(vecType<T, P> const & p0, vecType<T, P> const & p1) - { - return length(p1 - p0); - } - - // dot - template <typename T> - GLM_FUNC_QUALIFIER T dot(T x, T y) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'dot' only accept floating-point inputs"); - return x * y; - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER T dot(vecType<T, P> const & x, vecType<T, P> const & y) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'dot' only accept floating-point inputs"); - return detail::compute_dot<vecType, T, P>::call(x, y); - } - - // cross - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> cross(tvec3<T, P> const & x, tvec3<T, P> const & y) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'cross' only accept floating-point inputs"); - - return tvec3<T, P>( - x.y * y.z - y.y * x.z, - x.z * y.x - y.z * x.x, - x.x * y.y - y.x * x.y); - } - - // normalize - template <typename genType> - GLM_FUNC_QUALIFIER genType normalize(genType const & x) - { - GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'normalize' only accept floating-point inputs"); - - return x < genType(0) ? genType(-1) : genType(1); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> normalize(vecType<T, P> const & x) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'normalize' only accept floating-point inputs"); - - return x * inversesqrt(dot(x, x)); - } - - // faceforward - template <typename genType> - GLM_FUNC_QUALIFIER genType faceforward(genType const & N, genType const & I, genType const & Nref) - { - return dot(Nref, I) < static_cast<genType>(0) ? N : -N; - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> faceforward(vecType<T, P> const & N, vecType<T, P> const & I, vecType<T, P> const & Nref) - { - return dot(Nref, I) < static_cast<T>(0) ? N : -N; - } - - // reflect - template <typename genType> - GLM_FUNC_QUALIFIER genType reflect(genType const & I, genType const & N) - { - return I - N * dot(N, I) * static_cast<genType>(2); - } - - // refract - template <typename genType> - GLM_FUNC_QUALIFIER genType refract(genType const & I, genType const & N, genType const & eta) - { - GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'refract' only accept floating-point inputs"); - - genType const dotValue(dot(N, I)); - genType const k(static_cast<genType>(1) - eta * eta * (static_cast<genType>(1) - dotValue * dotValue)); - return (eta * I - (eta * dotValue + sqrt(k)) * N) * static_cast<genType>(k >= static_cast<genType>(0)); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> refract(vecType<T, P> const & I, vecType<T, P> const & N, T eta) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'refract' only accept floating-point inputs"); - - T const dotValue(dot(N, I)); - T const k(static_cast<T>(1) - eta * eta * (static_cast<T>(1) - dotValue * dotValue)); - return (eta * I - (eta * dotValue + std::sqrt(k)) * N) * static_cast<T>(k >= static_cast<T>(0)); - } -}//namespace glm diff --git a/extensions/common/glm/detail/func_integer.hpp b/extensions/common/glm/detail/func_integer.hpp deleted file mode 100644 index 4d0235efc28..00000000000 --- a/extensions/common/glm/detail/func_integer.hpp +++ /dev/null @@ -1,232 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/func_integer.hpp -/// @date 2010-03-17 / 2011-06-18 -/// @author Christophe Riccio -/// -/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a> -/// -/// @defgroup core_func_integer Integer functions -/// @ingroup core -/// -/// These all operate component-wise. The description is per component. -/// The notation [a, b] means the set of bits from bit-number a through bit-number -/// b, inclusive. The lowest-order bit is bit 0. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "setup.hpp" -#include "precision.hpp" -#include "func_common.hpp" -#include "func_vector_relational.hpp" - -namespace glm -{ - /// @addtogroup core_func_integer - /// @{ - - /// Adds 32-bit unsigned integer x and y, returning the sum - /// modulo pow(2, 32). The value carry is set to 0 if the sum was - /// less than pow(2, 32), or to 1 otherwise. - /// - /// @tparam genUType Unsigned integer scalar or vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/uaddCarry.xml">GLSL uaddCarry man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a> - template <precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<uint, P> uaddCarry( - vecType<uint, P> const & x, - vecType<uint, P> const & y, - vecType<uint, P> & carry); - - /// Subtracts the 32-bit unsigned integer y from x, returning - /// the difference if non-negative, or pow(2, 32) plus the difference - /// otherwise. The value borrow is set to 0 if x >= y, or to 1 otherwise. - /// - /// @tparam genUType Unsigned integer scalar or vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/usubBorrow.xml">GLSL usubBorrow man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a> - template <precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<uint, P> usubBorrow( - vecType<uint, P> const & x, - vecType<uint, P> const & y, - vecType<uint, P> & borrow); - - /// Multiplies 32-bit integers x and y, producing a 64-bit - /// result. The 32 least-significant bits are returned in lsb. - /// The 32 most-significant bits are returned in msb. - /// - /// @tparam genUType Unsigned integer scalar or vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/umulExtended.xml">GLSL umulExtended man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a> - template <precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL void umulExtended( - vecType<uint, P> const & x, - vecType<uint, P> const & y, - vecType<uint, P> & msb, - vecType<uint, P> & lsb); - - /// Multiplies 32-bit integers x and y, producing a 64-bit - /// result. The 32 least-significant bits are returned in lsb. - /// The 32 most-significant bits are returned in msb. - /// - /// @tparam genIType Signed integer scalar or vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/imulExtended.xml">GLSL imulExtended man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a> - template <precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL void imulExtended( - vecType<int, P> const & x, - vecType<int, P> const & y, - vecType<int, P> & msb, - vecType<int, P> & lsb); - - /// Extracts bits [offset, offset + bits - 1] from value, - /// returning them in the least significant bits of the result. - /// For unsigned data types, the most significant bits of the - /// result will be set to zero. For signed data types, the - /// most significant bits will be set to the value of bit offset + base - 1. - /// - /// If bits is zero, the result will be zero. The result will be - /// undefined if offset or bits is negative, or if the sum of - /// offset and bits is greater than the number of bits used - /// to store the operand. - /// - /// @tparam T Signed or unsigned integer scalar or vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitfieldExtract.xml">GLSL bitfieldExtract man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a> - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> bitfieldExtract( - vecType<T, P> const & Value, - int Offset, - int Bits); - - /// Returns the insertion the bits least-significant bits of insert into base. - /// - /// The result will have bits [offset, offset + bits - 1] taken - /// from bits [0, bits - 1] of insert, and all other bits taken - /// directly from the corresponding bits of base. If bits is - /// zero, the result will simply be base. The result will be - /// undefined if offset or bits is negative, or if the sum of - /// offset and bits is greater than the number of bits used to - /// store the operand. - /// - /// @tparam T Signed or unsigned integer scalar or vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitfieldInsert.xml">GLSL bitfieldInsert man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a> - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> bitfieldInsert( - vecType<T, P> const & Base, - vecType<T, P> const & Insert, - int Offset, - int Bits); - - /// Returns the reversal of the bits of value. - /// The bit numbered n of the result will be taken from bit (bits - 1) - n of value, - /// where bits is the total number of bits used to represent value. - /// - /// @tparam T Signed or unsigned integer scalar or vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitfieldReverse.xml">GLSL bitfieldReverse man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a> - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> bitfieldReverse(vecType<T, P> const & v); - - /// Returns the number of bits set to 1 in the binary representation of value. - /// - /// @tparam T Signed or unsigned integer scalar or vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitCount.xml">GLSL bitCount man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a> - template <typename genType> - GLM_FUNC_DECL int bitCount(genType v); - - /// Returns the number of bits set to 1 in the binary representation of value. - /// - /// @tparam T Signed or unsigned integer scalar or vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitCount.xml">GLSL bitCount man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a> - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<int, P> bitCount(vecType<T, P> const & v); - - /// Returns the bit number of the least significant bit set to - /// 1 in the binary representation of value. - /// If value is zero, -1 will be returned. - /// - /// @tparam T Signed or unsigned integer scalar types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/findLSB.xml">GLSL findLSB man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a> - template <typename genIUType> - GLM_FUNC_DECL int findLSB(genIUType x); - - /// Returns the bit number of the least significant bit set to - /// 1 in the binary representation of value. - /// If value is zero, -1 will be returned. - /// - /// @tparam T Signed or unsigned integer scalar types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/findLSB.xml">GLSL findLSB man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a> - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<int, P> findLSB(vecType<T, P> const & v); - - /// Returns the bit number of the most significant bit in the binary representation of value. - /// For positive integers, the result will be the bit number of the most significant bit set to 1. - /// For negative integers, the result will be the bit number of the most significant - /// bit set to 0. For a value of zero or negative one, -1 will be returned. - /// - /// @tparam T Signed or unsigned integer scalar types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/findMSB.xml">GLSL findMSB man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a> - template <typename genIUType> - GLM_FUNC_DECL int findMSB(genIUType x); - - /// Returns the bit number of the most significant bit in the binary representation of value. - /// For positive integers, the result will be the bit number of the most significant bit set to 1. - /// For negative integers, the result will be the bit number of the most significant - /// bit set to 0. For a value of zero or negative one, -1 will be returned. - /// - /// @tparam T Signed or unsigned integer scalar types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/findMSB.xml">GLSL findMSB man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a> - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<int, P> findMSB(vecType<T, P> const & v); - - /// @} -}//namespace glm - -#include "func_integer.inl" diff --git a/extensions/common/glm/detail/func_integer.inl b/extensions/common/glm/detail/func_integer.inl deleted file mode 100644 index 31eddf9bc55..00000000000 --- a/extensions/common/glm/detail/func_integer.inl +++ /dev/null @@ -1,393 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/func_integer.inl -/// @date 2010-03-17 / 2011-06-15 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#include "type_vec2.hpp" -#include "type_vec3.hpp" -#include "type_vec4.hpp" -#include "type_int.hpp" -#include "_vectorize.hpp" -#if(GLM_ARCH != GLM_ARCH_PURE) -#if(GLM_COMPILER & GLM_COMPILER_VC) -# include <intrin.h> -# pragma intrinsic(_BitScanReverse) -#endif//(GLM_COMPILER & GLM_COMPILER_VC) -#endif//(GLM_ARCH != GLM_ARCH_PURE) -#include <limits> - -namespace glm{ -namespace detail -{ - template <typename T> - GLM_FUNC_QUALIFIER T mask(T Bits) - { - return Bits >= sizeof(T) * 8 ? ~static_cast<T>(0) : (static_cast<T>(1) << Bits) - static_cast<T>(1); - } - - template <bool EXEC = false> - struct compute_bitfieldReverseStep - { - template <typename T, glm::precision P, template <class, glm::precision> class vecType> - GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & v, T, T) - { - return v; - } - }; - - template <> - struct compute_bitfieldReverseStep<true> - { - template <typename T, glm::precision P, template <class, glm::precision> class vecType> - GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & v, T Mask, T Shift) - { - return (v & Mask) << Shift | (v & (~Mask)) >> Shift; - } - }; - - template <bool EXEC = false> - struct compute_bitfieldBitCountStep - { - template <typename T, glm::precision P, template <class, glm::precision> class vecType> - GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & v, T, T) - { - return v; - } - }; - - template <> - struct compute_bitfieldBitCountStep<true> - { - template <typename T, glm::precision P, template <class, glm::precision> class vecType> - GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & v, T Mask, T Shift) - { - return (v & Mask) + ((v >> Shift) & Mask); - } - }; - - template <typename genIUType, size_t Bits> - struct compute_findLSB - { - GLM_FUNC_QUALIFIER static int call(genIUType Value) - { - if(Value == 0) - return -1; - - return glm::bitCount(~Value & (Value - static_cast<genIUType>(1))); - } - }; - -# if GLM_HAS_BITSCAN_WINDOWS - template <typename genIUType> - struct compute_findLSB<genIUType, 32> - { - GLM_FUNC_QUALIFIER static int call(genIUType Value) - { - unsigned long Result(0); - unsigned char IsNotNull = _BitScanForward(&Result, *reinterpret_cast<unsigned long*>(&Value)); - return IsNotNull ? int(Result) : -1; - } - }; - -# if !((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_MODEL == GLM_MODEL_32)) - template <typename genIUType> - struct compute_findLSB<genIUType, 64> - { - GLM_FUNC_QUALIFIER static int call(genIUType Value) - { - unsigned long Result(0); - unsigned char IsNotNull = _BitScanForward64(&Result, *reinterpret_cast<unsigned __int64*>(&Value)); - return IsNotNull ? int(Result) : -1; - } - }; -# endif -# endif//GLM_HAS_BITSCAN_WINDOWS - - template <typename T, glm::precision P, template <class, glm::precision> class vecType, bool EXEC = true> - struct compute_findMSB_step_vec - { - GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x, T Shift) - { - return x | (x >> Shift); - } - }; - - template <typename T, glm::precision P, template <typename, glm::precision> class vecType> - struct compute_findMSB_step_vec<T, P, vecType, false> - { - GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x, T) - { - return x; - } - }; - - template <typename T, glm::precision P, template <typename, glm::precision> class vecType, int> - struct compute_findMSB_vec - { - GLM_FUNC_QUALIFIER static vecType<int, P> call(vecType<T, P> const & vec) - { - vecType<T, P> x(vec); - x = compute_findMSB_step_vec<T, P, vecType, sizeof(T) * 8 >= 8>::call(x, static_cast<T>( 1)); - x = compute_findMSB_step_vec<T, P, vecType, sizeof(T) * 8 >= 8>::call(x, static_cast<T>( 2)); - x = compute_findMSB_step_vec<T, P, vecType, sizeof(T) * 8 >= 8>::call(x, static_cast<T>( 4)); - x = compute_findMSB_step_vec<T, P, vecType, sizeof(T) * 8 >= 16>::call(x, static_cast<T>( 8)); - x = compute_findMSB_step_vec<T, P, vecType, sizeof(T) * 8 >= 32>::call(x, static_cast<T>(16)); - x = compute_findMSB_step_vec<T, P, vecType, sizeof(T) * 8 >= 64>::call(x, static_cast<T>(32)); - return vecType<int, P>(sizeof(T) * 8 - 1) - glm::bitCount(~x); - } - }; - -# if GLM_HAS_BITSCAN_WINDOWS - template <typename genIUType> - GLM_FUNC_QUALIFIER int compute_findMSB_32(genIUType Value) - { - unsigned long Result(0); - unsigned char IsNotNull = _BitScanReverse(&Result, *reinterpret_cast<unsigned long*>(&Value)); - return IsNotNull ? int(Result) : -1; - } - - template <typename T, glm::precision P, template <class, glm::precision> class vecType> - struct compute_findMSB_vec<T, P, vecType, 32> - { - GLM_FUNC_QUALIFIER static vecType<int, P> call(vecType<T, P> const & x) - { - return detail::functor1<int, T, P, vecType>::call(compute_findMSB_32, x); - } - }; - -# if !((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_MODEL == GLM_MODEL_32)) - template <typename genIUType> - GLM_FUNC_QUALIFIER int compute_findMSB_64(genIUType Value) - { - unsigned long Result(0); - unsigned char IsNotNull = _BitScanReverse64(&Result, *reinterpret_cast<unsigned __int64*>(&Value)); - return IsNotNull ? int(Result) : -1; - } - - template <typename T, glm::precision P, template <class, glm::precision> class vecType> - struct compute_findMSB_vec<T, P, vecType, 64> - { - GLM_FUNC_QUALIFIER static vecType<int, P> call(vecType<T, P> const & x) - { - return detail::functor1<int, T, P, vecType>::call(compute_findMSB_64, x); - } - }; -# endif -# endif//GLM_HAS_BITSCAN_WINDOWS -}//namespace detail - - // uaddCarry - GLM_FUNC_QUALIFIER uint uaddCarry(uint const & x, uint const & y, uint & Carry) - { - uint64 const Value64(static_cast<uint64>(x) + static_cast<uint64>(y)); - uint64 const Max32((static_cast<uint64>(1) << static_cast<uint64>(32)) - static_cast<uint64>(1)); - Carry = Value64 > Max32 ? 1 : 0; - return static_cast<uint32>(Value64 % (Max32 + static_cast<uint64>(1))); - } - - template <precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<uint, P> uaddCarry(vecType<uint, P> const & x, vecType<uint, P> const & y, vecType<uint, P> & Carry) - { - vecType<uint64, P> Value64(vecType<uint64, P>(x) + vecType<uint64, P>(y)); - vecType<uint64, P> Max32((static_cast<uint64>(1) << static_cast<uint64>(32)) - static_cast<uint64>(1)); - Carry = mix(vecType<uint32, P>(0), vecType<uint32, P>(1), greaterThan(Value64, Max32)); - return vecType<uint32,P>(Value64 % (Max32 + static_cast<uint64>(1))); - } - - // usubBorrow - GLM_FUNC_QUALIFIER uint usubBorrow(uint const & x, uint const & y, uint & Borrow) - { - GLM_STATIC_ASSERT(sizeof(uint) == sizeof(uint32), "uint and uint32 size mismatch"); - - Borrow = x >= y ? static_cast<uint32>(0) : static_cast<uint32>(1); - if(y >= x) - return y - x; - else - return static_cast<uint32>((static_cast<int64>(1) << static_cast<int64>(32)) + (static_cast<int64>(y) - static_cast<int64>(x))); - } - - template <precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<uint, P> usubBorrow(vecType<uint, P> const & x, vecType<uint, P> const & y, vecType<uint, P> & Borrow) - { - Borrow = mix(vecType<uint, P>(1), vecType<uint, P>(0), greaterThanEqual(x, y)); - vecType<uint, P> const YgeX(y - x); - vecType<uint, P> const XgeY(vecType<uint32, P>((static_cast<int64>(1) << static_cast<int64>(32)) + (vecType<int64, P>(y) - vecType<int64, P>(x)))); - return mix(XgeY, YgeX, greaterThanEqual(y, x)); - } - - // umulExtended - GLM_FUNC_QUALIFIER void umulExtended(uint const & x, uint const & y, uint & msb, uint & lsb) - { - GLM_STATIC_ASSERT(sizeof(uint) == sizeof(uint32), "uint and uint32 size mismatch"); - - uint64 Value64 = static_cast<uint64>(x) * static_cast<uint64>(y); - uint32* PointerMSB = (reinterpret_cast<uint32*>(&Value64) + 1); - msb = *PointerMSB; - uint32* PointerLSB = (reinterpret_cast<uint32*>(&Value64) + 0); - lsb = *PointerLSB; - } - - template <precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER void umulExtended(vecType<uint, P> const & x, vecType<uint, P> const & y, vecType<uint, P> & msb, vecType<uint, P> & lsb) - { - GLM_STATIC_ASSERT(sizeof(uint) == sizeof(uint32), "uint and uint32 size mismatch"); - - vecType<uint64, P> Value64(vecType<uint64, P>(x) * vecType<uint64, P>(y)); - msb = vecType<uint32, P>(Value64 >> static_cast<uint64>(32)); - lsb = vecType<uint32, P>(Value64); - } - - // imulExtended - GLM_FUNC_QUALIFIER void imulExtended(int x, int y, int & msb, int & lsb) - { - GLM_STATIC_ASSERT(sizeof(int) == sizeof(int32), "int and int32 size mismatch"); - - int64 Value64 = static_cast<int64>(x) * static_cast<int64>(y); - int32* PointerMSB = (reinterpret_cast<int32*>(&Value64) + 1); - msb = *PointerMSB; - int32* PointerLSB = (reinterpret_cast<int32*>(&Value64)); - lsb = *PointerLSB; - } - - template <precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER void imulExtended(vecType<int, P> const & x, vecType<int, P> const & y, vecType<int, P> & msb, vecType<int, P> & lsb) - { - GLM_STATIC_ASSERT(sizeof(int) == sizeof(int32), "int and int32 size mismatch"); - - vecType<int64, P> Value64(vecType<int64, P>(x) * vecType<int64, P>(y)); - lsb = vecType<int32, P>(Value64 & static_cast<int64>(0xFFFFFFFF)); - msb = vecType<int32, P>((Value64 >> static_cast<int64>(32)) & static_cast<int64>(0xFFFFFFFF)); - } - - // bitfieldExtract - template <typename genIUType> - GLM_FUNC_QUALIFIER genIUType bitfieldExtract(genIUType Value, int Offset, int Bits) - { - return bitfieldExtract(tvec1<genIUType>(Value), Offset, Bits).x; - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> bitfieldExtract(vecType<T, P> const & Value, int Offset, int Bits) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'bitfieldExtract' only accept integer inputs"); - - return (Value >> static_cast<T>(Offset)) & static_cast<T>(detail::mask(Bits)); - } - - // bitfieldInsert - template <typename genIUType> - GLM_FUNC_QUALIFIER genIUType bitfieldInsert(genIUType const & Base, genIUType const & Insert, int Offset, int Bits) - { - return bitfieldInsert(tvec1<genIUType>(Base), tvec1<genIUType>(Insert), Offset, Bits).x; - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> bitfieldInsert(vecType<T, P> const & Base, vecType<T, P> const & Insert, int Offset, int Bits) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'bitfieldInsert' only accept integer values"); - - T const Mask = static_cast<T>(detail::mask(Bits) << Offset); - return (Base & ~Mask) | (Insert & Mask); - } - - // bitfieldReverse - template <typename genType> - GLM_FUNC_QUALIFIER genType bitfieldReverse(genType x) - { - return bitfieldReverse(glm::tvec1<genType, glm::defaultp>(x)).x; - } - - template <typename T, glm::precision P, template <typename, glm::precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> bitfieldReverse(vecType<T, P> const & v) - { - vecType<T, P> x(v); - x = detail::compute_bitfieldReverseStep<sizeof(T) * 8 >= 2>::call(x, T(0x5555555555555555ull), static_cast<T>( 1)); - x = detail::compute_bitfieldReverseStep<sizeof(T) * 8 >= 4>::call(x, T(0x3333333333333333ull), static_cast<T>( 2)); - x = detail::compute_bitfieldReverseStep<sizeof(T) * 8 >= 8>::call(x, T(0x0F0F0F0F0F0F0F0Full), static_cast<T>( 4)); - x = detail::compute_bitfieldReverseStep<sizeof(T) * 8 >= 16>::call(x, T(0x00FF00FF00FF00FFull), static_cast<T>( 8)); - x = detail::compute_bitfieldReverseStep<sizeof(T) * 8 >= 32>::call(x, T(0x0000FFFF0000FFFFull), static_cast<T>(16)); - x = detail::compute_bitfieldReverseStep<sizeof(T) * 8 >= 64>::call(x, T(0x00000000FFFFFFFFull), static_cast<T>(32)); - return x; - } - - // bitCount - template <typename genType> - GLM_FUNC_QUALIFIER int bitCount(genType x) - { - return bitCount(glm::tvec1<genType, glm::defaultp>(x)).x; - } - - template <typename T, glm::precision P, template <typename, glm::precision> class vecType> - GLM_FUNC_QUALIFIER vecType<int, P> bitCount(vecType<T, P> const & v) - { - vecType<typename detail::make_unsigned<T>::type, P> x(*reinterpret_cast<vecType<typename detail::make_unsigned<T>::type, P> const *>(&v)); - x = detail::compute_bitfieldBitCountStep<sizeof(T) * 8 >= 2>::call(x, typename detail::make_unsigned<T>::type(0x5555555555555555ull), typename detail::make_unsigned<T>::type( 1)); - x = detail::compute_bitfieldBitCountStep<sizeof(T) * 8 >= 4>::call(x, typename detail::make_unsigned<T>::type(0x3333333333333333ull), typename detail::make_unsigned<T>::type( 2)); - x = detail::compute_bitfieldBitCountStep<sizeof(T) * 8 >= 8>::call(x, typename detail::make_unsigned<T>::type(0x0F0F0F0F0F0F0F0Full), typename detail::make_unsigned<T>::type( 4)); - x = detail::compute_bitfieldBitCountStep<sizeof(T) * 8 >= 16>::call(x, typename detail::make_unsigned<T>::type(0x00FF00FF00FF00FFull), typename detail::make_unsigned<T>::type( 8)); - x = detail::compute_bitfieldBitCountStep<sizeof(T) * 8 >= 32>::call(x, typename detail::make_unsigned<T>::type(0x0000FFFF0000FFFFull), typename detail::make_unsigned<T>::type(16)); - x = detail::compute_bitfieldBitCountStep<sizeof(T) * 8 >= 64>::call(x, typename detail::make_unsigned<T>::type(0x00000000FFFFFFFFull), typename detail::make_unsigned<T>::type(32)); - return vecType<int, P>(x); - } - - // findLSB - template <typename genIUType> - GLM_FUNC_QUALIFIER int findLSB(genIUType Value) - { - GLM_STATIC_ASSERT(std::numeric_limits<genIUType>::is_integer, "'findLSB' only accept integer values"); - - return detail::compute_findLSB<genIUType, sizeof(genIUType) * 8>::call(Value); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<int, P> findLSB(vecType<T, P> const & x) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'findLSB' only accept integer values"); - - return detail::functor1<int, T, P, vecType>::call(findLSB, x); - } - - // findMSB - template <typename genIUType> - GLM_FUNC_QUALIFIER int findMSB(genIUType x) - { - GLM_STATIC_ASSERT(std::numeric_limits<genIUType>::is_integer, "'findMSB' only accept integer values"); - - return findMSB(tvec1<genIUType>(x)).x; - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<int, P> findMSB(vecType<T, P> const & x) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'findMSB' only accept integer values"); - - return detail::compute_findMSB_vec<T, P, vecType, sizeof(T) * 8>::call(x); - } -}//namespace glm diff --git a/extensions/common/glm/detail/func_matrix.hpp b/extensions/common/glm/detail/func_matrix.hpp deleted file mode 100644 index 252e662ee3f..00000000000 --- a/extensions/common/glm/detail/func_matrix.hpp +++ /dev/null @@ -1,178 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/func_matrix.hpp -/// @date 2008-08-03 / 2011-06-15 -/// @author Christophe Riccio -/// -/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a> -/// -/// @defgroup core_func_matrix Matrix functions -/// @ingroup core -/// -/// For each of the following built-in matrix functions, there is both a -/// single-precision floating point version, where all arguments and return values -/// are single precision, and a double-precision floating version, where all -/// arguments and return values are double precision. Only the single-precision -/// floating point version is shown. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependencies -#include "../detail/precision.hpp" -#include "../detail/setup.hpp" -#include "../detail/type_mat.hpp" -#include "../vec2.hpp" -#include "../vec3.hpp" -#include "../vec4.hpp" -#include "../mat2x2.hpp" -#include "../mat2x3.hpp" -#include "../mat2x4.hpp" -#include "../mat3x2.hpp" -#include "../mat3x3.hpp" -#include "../mat3x4.hpp" -#include "../mat4x2.hpp" -#include "../mat4x3.hpp" -#include "../mat4x4.hpp" - -namespace glm{ -namespace detail -{ - template <typename T, precision P> - struct outerProduct_trait<T, P, tvec2, tvec2> - { - typedef tmat2x2<T, P> type; - }; - - template <typename T, precision P> - struct outerProduct_trait<T, P, tvec2, tvec3> - { - typedef tmat2x3<T, P> type; - }; - - template <typename T, precision P> - struct outerProduct_trait<T, P, tvec2, tvec4> - { - typedef tmat2x4<T, P> type; - }; - - template <typename T, precision P> - struct outerProduct_trait<T, P, tvec3, tvec2> - { - typedef tmat3x2<T, P> type; - }; - - template <typename T, precision P> - struct outerProduct_trait<T, P, tvec3, tvec3> - { - typedef tmat3x3<T, P> type; - }; - - template <typename T, precision P> - struct outerProduct_trait<T, P, tvec3, tvec4> - { - typedef tmat3x4<T, P> type; - }; - - template <typename T, precision P> - struct outerProduct_trait<T, P, tvec4, tvec2> - { - typedef tmat4x2<T, P> type; - }; - - template <typename T, precision P> - struct outerProduct_trait<T, P, tvec4, tvec3> - { - typedef tmat4x3<T, P> type; - }; - - template <typename T, precision P> - struct outerProduct_trait<T, P, tvec4, tvec4> - { - typedef tmat4x4<T, P> type; - }; - -}//namespace detail - - /// @addtogroup core_func_matrix - /// @{ - - /// Multiply matrix x by matrix y component-wise, i.e., - /// result[i][j] is the scalar product of x[i][j] and y[i][j]. - /// - /// @tparam matType Floating-point matrix types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/matrixCompMult.xml">GLSL matrixCompMult man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a> - template <typename T, precision P, template <typename, precision> class matType> - GLM_FUNC_DECL matType<T, P> matrixCompMult(matType<T, P> const & x, matType<T, P> const & y); - - /// Treats the first parameter c as a column vector - /// and the second parameter r as a row vector - /// and does a linear algebraic matrix multiply c * r. - /// - /// @tparam matType Floating-point matrix types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/outerProduct.xml">GLSL outerProduct man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a> - template <typename T, precision P, template <typename, precision> class vecTypeA, template <typename, precision> class vecTypeB> - GLM_FUNC_DECL typename detail::outerProduct_trait<T, P, vecTypeA, vecTypeB>::type outerProduct(vecTypeA<T, P> const & c, vecTypeB<T, P> const & r); - - /// Returns the transposed matrix of x - /// - /// @tparam matType Floating-point matrix types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/transpose.xml">GLSL transpose man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a> -# if((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2012)) - template <typename T, precision P, template <typename, precision> class matType> - GLM_FUNC_DECL typename matType<T, P>::transpose_type transpose(matType<T, P> const & x); -# endif - - /// Return the determinant of a squared matrix. - /// - /// @tparam valType Floating-point scalar types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/determinant.xml">GLSL determinant man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a> - template <typename T, precision P, template <typename, precision> class matType> - GLM_FUNC_DECL T determinant(matType<T, P> const & m); - - /// Return the inverse of a squared matrix. - /// - /// @tparam valType Floating-point scalar types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/inverse.xml">GLSL inverse man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a> - template <typename T, precision P, template <typename, precision> class matType> - GLM_FUNC_DECL matType<T, P> inverse(matType<T, P> const & m); - - /// @} -}//namespace glm - -#include "func_matrix.inl" diff --git a/extensions/common/glm/detail/func_matrix.inl b/extensions/common/glm/detail/func_matrix.inl deleted file mode 100644 index 1ebed1fb0c0..00000000000 --- a/extensions/common/glm/detail/func_matrix.inl +++ /dev/null @@ -1,310 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/func_matrix.inl -/// @date 2008-03-08 / 2011-06-15 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#include "../geometric.hpp" -#include <limits> - -namespace glm{ -namespace detail -{ - template <template <class, precision> class matType, typename T, precision P> - struct compute_transpose{}; - - template <typename T, precision P> - struct compute_transpose<tmat2x2, T, P> - { - GLM_FUNC_QUALIFIER static tmat2x2<T, P> call(tmat2x2<T, P> const & m) - { - tmat2x2<T, P> result(uninitialize); - result[0][0] = m[0][0]; - result[0][1] = m[1][0]; - result[1][0] = m[0][1]; - result[1][1] = m[1][1]; - return result; - } - }; - - template <typename T, precision P> - struct compute_transpose<tmat2x3, T, P> - { - GLM_FUNC_QUALIFIER static tmat3x2<T, P> call(tmat2x3<T, P> const & m) - { - tmat3x2<T, P> result(uninitialize); - result[0][0] = m[0][0]; - result[0][1] = m[1][0]; - result[1][0] = m[0][1]; - result[1][1] = m[1][1]; - result[2][0] = m[0][2]; - result[2][1] = m[1][2]; - return result; - } - }; - - template <typename T, precision P> - struct compute_transpose<tmat2x4, T, P> - { - GLM_FUNC_QUALIFIER static tmat4x2<T, P> call(tmat2x4<T, P> const & m) - { - tmat4x2<T, P> result(uninitialize); - result[0][0] = m[0][0]; - result[0][1] = m[1][0]; - result[1][0] = m[0][1]; - result[1][1] = m[1][1]; - result[2][0] = m[0][2]; - result[2][1] = m[1][2]; - result[3][0] = m[0][3]; - result[3][1] = m[1][3]; - return result; - } - }; - - template <typename T, precision P> - struct compute_transpose<tmat3x2, T, P> - { - GLM_FUNC_QUALIFIER static tmat2x3<T, P> call(tmat3x2<T, P> const & m) - { - tmat2x3<T, P> result(uninitialize); - result[0][0] = m[0][0]; - result[0][1] = m[1][0]; - result[0][2] = m[2][0]; - result[1][0] = m[0][1]; - result[1][1] = m[1][1]; - result[1][2] = m[2][1]; - return result; - } - }; - - template <typename T, precision P> - struct compute_transpose<tmat3x3, T, P> - { - GLM_FUNC_QUALIFIER static tmat3x3<T, P> call(tmat3x3<T, P> const & m) - { - tmat3x3<T, P> result(uninitialize); - result[0][0] = m[0][0]; - result[0][1] = m[1][0]; - result[0][2] = m[2][0]; - - result[1][0] = m[0][1]; - result[1][1] = m[1][1]; - result[1][2] = m[2][1]; - - result[2][0] = m[0][2]; - result[2][1] = m[1][2]; - result[2][2] = m[2][2]; - return result; - } - }; - - template <typename T, precision P> - struct compute_transpose<tmat3x4, T, P> - { - GLM_FUNC_QUALIFIER static tmat4x3<T, P> call(tmat3x4<T, P> const & m) - { - tmat4x3<T, P> result(uninitialize); - result[0][0] = m[0][0]; - result[0][1] = m[1][0]; - result[0][2] = m[2][0]; - result[1][0] = m[0][1]; - result[1][1] = m[1][1]; - result[1][2] = m[2][1]; - result[2][0] = m[0][2]; - result[2][1] = m[1][2]; - result[2][2] = m[2][2]; - result[3][0] = m[0][3]; - result[3][1] = m[1][3]; - result[3][2] = m[2][3]; - return result; - } - }; - - template <typename T, precision P> - struct compute_transpose<tmat4x2, T, P> - { - GLM_FUNC_QUALIFIER static tmat2x4<T, P> call(tmat4x2<T, P> const & m) - { - tmat2x4<T, P> result(uninitialize); - result[0][0] = m[0][0]; - result[0][1] = m[1][0]; - result[0][2] = m[2][0]; - result[0][3] = m[3][0]; - result[1][0] = m[0][1]; - result[1][1] = m[1][1]; - result[1][2] = m[2][1]; - result[1][3] = m[3][1]; - return result; - } - }; - - template <typename T, precision P> - struct compute_transpose<tmat4x3, T, P> - { - GLM_FUNC_QUALIFIER static tmat3x4<T, P> call(tmat4x3<T, P> const & m) - { - tmat3x4<T, P> result(uninitialize); - result[0][0] = m[0][0]; - result[0][1] = m[1][0]; - result[0][2] = m[2][0]; - result[0][3] = m[3][0]; - result[1][0] = m[0][1]; - result[1][1] = m[1][1]; - result[1][2] = m[2][1]; - result[1][3] = m[3][1]; - result[2][0] = m[0][2]; - result[2][1] = m[1][2]; - result[2][2] = m[2][2]; - result[2][3] = m[3][2]; - return result; - } - }; - - template <typename T, precision P> - struct compute_transpose<tmat4x4, T, P> - { - GLM_FUNC_QUALIFIER static tmat4x4<T, P> call(tmat4x4<T, P> const & m) - { - tmat4x4<T, P> result(uninitialize); - result[0][0] = m[0][0]; - result[0][1] = m[1][0]; - result[0][2] = m[2][0]; - result[0][3] = m[3][0]; - - result[1][0] = m[0][1]; - result[1][1] = m[1][1]; - result[1][2] = m[2][1]; - result[1][3] = m[3][1]; - - result[2][0] = m[0][2]; - result[2][1] = m[1][2]; - result[2][2] = m[2][2]; - result[2][3] = m[3][2]; - - result[3][0] = m[0][3]; - result[3][1] = m[1][3]; - result[3][2] = m[2][3]; - result[3][3] = m[3][3]; - return result; - } - }; - - template <template <class, precision> class matType, typename T, precision P> - struct compute_determinant{}; - - template <typename T, precision P> - struct compute_determinant<tmat2x2, T, P> - { - GLM_FUNC_QUALIFIER static T call(tmat2x2<T, P> const & m) - { - return m[0][0] * m[1][1] - m[1][0] * m[0][1]; - } - }; - - template <typename T, precision P> - struct compute_determinant<tmat3x3, T, P> - { - GLM_FUNC_QUALIFIER static T call(tmat3x3<T, P> const & m) - { - return - + m[0][0] * (m[1][1] * m[2][2] - m[2][1] * m[1][2]) - - m[1][0] * (m[0][1] * m[2][2] - m[2][1] * m[0][2]) - + m[2][0] * (m[0][1] * m[1][2] - m[1][1] * m[0][2]); - } - }; - - template <typename T, precision P> - struct compute_determinant<tmat4x4, T, P> - { - GLM_FUNC_QUALIFIER static T call(tmat4x4<T, P> const & m) - { - T SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; - T SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; - T SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; - T SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; - T SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; - T SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; - - tvec4<T, P> DetCof( - + (m[1][1] * SubFactor00 - m[1][2] * SubFactor01 + m[1][3] * SubFactor02), - - (m[1][0] * SubFactor00 - m[1][2] * SubFactor03 + m[1][3] * SubFactor04), - + (m[1][0] * SubFactor01 - m[1][1] * SubFactor03 + m[1][3] * SubFactor05), - - (m[1][0] * SubFactor02 - m[1][1] * SubFactor04 + m[1][2] * SubFactor05)); - - return - m[0][0] * DetCof[0] + m[0][1] * DetCof[1] + - m[0][2] * DetCof[2] + m[0][3] * DetCof[3]; - } - }; -}//namespace detail - - template <typename T, precision P, template <typename, precision> class matType> - GLM_FUNC_QUALIFIER matType<T, P> matrixCompMult(matType<T, P> const & x, matType<T, P> const & y) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'matrixCompMult' only accept floating-point inputs"); - - matType<T, P> result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(result); ++i) - result[i] = x[i] * y[i]; - return result; - } - - template<typename T, precision P, template <typename, precision> class vecTypeA, template <typename, precision> class vecTypeB> - GLM_FUNC_QUALIFIER typename detail::outerProduct_trait<T, P, vecTypeA, vecTypeB>::type outerProduct(vecTypeA<T, P> const & c, vecTypeB<T, P> const & r) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'outerProduct' only accept floating-point inputs"); - - typename detail::outerProduct_trait<T, P, vecTypeA, vecTypeB>::type m(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(m); ++i) - m[i] = c * r[i]; - return m; - } - - template <typename T, precision P, template <typename, precision> class matType> - GLM_FUNC_QUALIFIER typename matType<T, P>::transpose_type transpose(matType<T, P> const & m) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'transpose' only accept floating-point inputs"); - return detail::compute_transpose<matType, T, P>::call(m); - } - - template <typename T, precision P, template <typename, precision> class matType> - GLM_FUNC_QUALIFIER T determinant(matType<T, P> const & m) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'determinant' only accept floating-point inputs"); - return detail::compute_determinant<matType, T, P>::call(m); - } - - template <typename T, precision P, template <typename, precision> class matType> - GLM_FUNC_QUALIFIER matType<T, P> inverse(matType<T, P> const & m) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'inverse' only accept floating-point inputs"); - return detail::compute_inverse(m); - } - -}//namespace glm diff --git a/extensions/common/glm/detail/func_noise.hpp b/extensions/common/glm/detail/func_noise.hpp deleted file mode 100644 index 15e9cc77890..00000000000 --- a/extensions/common/glm/detail/func_noise.hpp +++ /dev/null @@ -1,93 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/func_noise.hpp -/// @date 2008-08-01 / 2011-06-18 -/// @author Christophe Riccio -/// -/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.13 Noise Functions</a> -/// -/// @defgroup core_func_noise Noise functions -/// @ingroup core -/// -/// Noise functions are stochastic functions that can be used to increase visual -/// complexity. Values returned by the following noise functions give the -/// appearance of randomness, but are not truly random. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "type_vec1.hpp" -#include "type_vec2.hpp" -#include "type_vec3.hpp" -#include "setup.hpp" - -namespace glm -{ - /// @addtogroup core_func_noise - /// @{ - - /// Returns a 1D noise value based on the input value x. - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/noise1.xml">GLSL noise1 man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.13 Noise Functions</a> - template <typename genType> - GLM_FUNC_DECL typename genType::value_type noise1(genType const & x); - - /// Returns a 2D noise value based on the input value x. - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/noise2.xml">GLSL noise2 man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.13 Noise Functions</a> - template <typename genType> - GLM_FUNC_DECL tvec2<typename genType::value_type, defaultp> noise2(genType const & x); - - /// Returns a 3D noise value based on the input value x. - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/noise3.xml">GLSL noise3 man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.13 Noise Functions</a> - template <typename genType> - GLM_FUNC_DECL tvec3<typename genType::value_type, defaultp> noise3(genType const & x); - - /// Returns a 4D noise value based on the input value x. - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/noise4.xml">GLSL noise4 man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.13 Noise Functions</a> - template <typename genType> - GLM_FUNC_DECL tvec4<typename genType::value_type, defaultp> noise4(genType const & x); - - /// @} -}//namespace glm - -#include "func_noise.inl" diff --git a/extensions/common/glm/detail/func_noise.inl b/extensions/common/glm/detail/func_noise.inl deleted file mode 100644 index 10901e6938d..00000000000 --- a/extensions/common/glm/detail/func_noise.inl +++ /dev/null @@ -1,388 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/func_noise.inl -/// @date 2008-08-01 / 2011-09-27 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#include "../detail/_noise.hpp" -#include "./func_common.hpp" - -namespace glm{ -namespace detail -{ - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> grad4(T const & j, tvec4<T, P> const & ip) - { - tvec3<T, P> pXYZ = floor(fract(tvec3<T, P>(j) * tvec3<T, P>(ip)) * T(7)) * ip[2] - T(1); - T pW = static_cast<T>(1.5) - dot(abs(pXYZ), tvec3<T, P>(1)); - tvec4<T, P> s = tvec4<T, P>(lessThan(tvec4<T, P>(pXYZ, pW), tvec4<T, P>(0.0))); - pXYZ = pXYZ + (tvec3<T, P>(s) * T(2) - T(1)) * s.w; - return tvec4<T, P>(pXYZ, pW); - } -}//namespace detail - - template <typename T> - GLM_FUNC_QUALIFIER T noise1(T const & x) - { - return noise1(tvec2<T, defaultp>(x, T(0))); - } - - template <typename T> - GLM_FUNC_QUALIFIER tvec2<T, defaultp> noise2(T const & x) - { - return tvec2<T, defaultp>( - noise1(x + T(0.0)), - noise1(x + T(1.0))); - } - - template <typename T> - GLM_FUNC_QUALIFIER tvec3<T, defaultp> noise3(T const & x) - { - return tvec3<T, defaultp>( - noise1(x - T(1.0)), - noise1(x + T(0.0)), - noise1(x + T(1.0))); - } - - template <typename T> - GLM_FUNC_QUALIFIER tvec4<T, defaultp> noise4(T const & x) - { - return tvec4<T, defaultp>( - noise1(x - T(1.0)), - noise1(x + T(0.0)), - noise1(x + T(1.0)), - noise1(x + T(2.0))); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER T noise1(tvec2<T, P> const & v) - { - tvec4<T, P> const C = tvec4<T, P>( - T( 0.211324865405187), // (3.0 - sqrt(3.0)) / 6.0 - T( 0.366025403784439), // 0.5 * (sqrt(3.0) - 1.0) - T(-0.577350269189626), // -1.0 + 2.0 * C.x - T( 0.024390243902439)); // 1.0 / 41.0 - - // First corner - tvec2<T, P> i = floor(v + dot(v, tvec2<T, P>(C[1]))); - tvec2<T, P> x0 = v - i + dot(i, tvec2<T, P>(C[0])); - - // Other corners - //i1.x = step( x0.y, x0.x ); // x0.x > x0.y ? 1.0 : 0.0 - //i1.y = 1.0 - i1.x; - tvec2<T, P> i1 = (x0.x > x0.y) ? tvec2<T, P>(1, 0) : tvec2<T, P>(0, 1); - - // x0 = x0 - 0.0 + 0.0 * C.xx ; - // x1 = x0 - i1 + 1.0 * C.xx ; - // x2 = x0 - 1.0 + 2.0 * C.xx ; - tvec4<T, P> x12 = tvec4<T, P>(x0.x, x0.y, x0.x, x0.y) + tvec4<T, P>(C.x, C.x, C.z, C.z); - x12 = tvec4<T, P>(tvec2<T, P>(x12) - i1, x12.z, x12.w); - - // Permutations - i = mod(i, T(289)); // Avoid truncation effects in permutation - tvec3<T, P> p = detail::permute( - detail::permute(i.y + tvec3<T, P>(T(0), i1.y, T(1))) + i.x + tvec3<T, P>(T(0), i1.x, T(1))); - - tvec3<T, P> m = max(T(0.5) - tvec3<T, P>( - dot(x0, x0), - dot(tvec2<T, P>(x12.x, x12.y), tvec2<T, P>(x12.x, x12.y)), - dot(tvec2<T, P>(x12.z, x12.w), tvec2<T, P>(x12.z, x12.w))), T(0)); - - m = m * m; - m = m * m; - - // Gradients: 41 points uniformly over a line, mapped onto a diamond. - // The ring size 17*17 = 289 is close to a multiple of 41 (41*7 = 287) - - tvec3<T, P> x = static_cast<T>(2) * fract(p * C.w) - T(1); - tvec3<T, P> h = abs(x) - T(0.5); - tvec3<T, P> ox = floor(x + T(0.5)); - tvec3<T, P> a0 = x - ox; - - // Normalise gradients implicitly by scaling m - // Inlined for speed: m *= taylorInvSqrt( a0*a0 + h*h ); - m *= static_cast<T>(1.79284291400159) - T(0.85373472095314) * (a0 * a0 + h * h); - - // Compute final noise value at P - tvec3<T, P> g; - g.x = a0.x * x0.x + h.x * x0.y; - //g.yz = a0.yz * x12.xz + h.yz * x12.yw; - g.y = a0.y * x12.x + h.y * x12.y; - g.z = a0.z * x12.z + h.z * x12.w; - return T(130) * dot(m, g); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER T noise1(tvec3<T, P> const & v) - { - tvec2<T, P> const C(1.0 / 6.0, 1.0 / 3.0); - tvec4<T, P> const D(0.0, 0.5, 1.0, 2.0); - - // First corner - tvec3<T, P> i(floor(v + dot(v, tvec3<T, P>(C.y)))); - tvec3<T, P> x0(v - i + dot(i, tvec3<T, P>(C.x))); - - // Other corners - tvec3<T, P> g(step(tvec3<T, P>(x0.y, x0.z, x0.x), x0)); - tvec3<T, P> l(T(1) - g); - tvec3<T, P> i1(min(g, tvec3<T, P>(l.z, l.x, l.y))); - tvec3<T, P> i2(max(g, tvec3<T, P>(l.z, l.x, l.y))); - - // x0 = x0 - 0.0 + 0.0 * C.xxx; - // x1 = x0 - i1 + 1.0 * C.xxx; - // x2 = x0 - i2 + 2.0 * C.xxx; - // x3 = x0 - 1.0 + 3.0 * C.xxx; - tvec3<T, P> x1(x0 - i1 + C.x); - tvec3<T, P> x2(x0 - i2 + C.y); // 2.0*C.x = 1/3 = C.y - tvec3<T, P> x3(x0 - D.y); // -1.0+3.0*C.x = -0.5 = -D.y - - // Permutations - i = mod289(i); - tvec4<T, P> p(detail::permute(detail::permute(detail::permute( - i.z + tvec4<T, P>(T(0), i1.z, i2.z, T(1))) + - i.y + tvec4<T, P>(T(0), i1.y, i2.y, T(1))) + - i.x + tvec4<T, P>(T(0), i1.x, i2.x, T(1)))); - - // Gradients: 7x7 points over a square, mapped onto an octahedron. - // The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294) - T n_ = static_cast<T>(0.142857142857); // 1.0/7.0 - tvec3<T, P> ns(n_ * tvec3<T, P>(D.w, D.y, D.z) - tvec3<T, P>(D.x, D.z, D.x)); - - tvec4<T, P> j(p - T(49) * floor(p * ns.z * ns.z)); // mod(p,7*7) - - tvec4<T, P> x_(floor(j * ns.z)); - tvec4<T, P> y_(floor(j - T(7) * x_)); // mod(j,N) - - tvec4<T, P> x(x_ * ns.x + ns.y); - tvec4<T, P> y(y_ * ns.x + ns.y); - tvec4<T, P> h(T(1) - abs(x) - abs(y)); - - tvec4<T, P> b0(x.x, x.y, y.x, y.y); - tvec4<T, P> b1(x.z, x.w, y.z, y.w); - - // vec4 s0 = vec4(lessThan(b0,0.0))*2.0 - 1.0; - // vec4 s1 = vec4(lessThan(b1,0.0))*2.0 - 1.0; - tvec4<T, P> s0(floor(b0) * T(2) + T(1)); - tvec4<T, P> s1(floor(b1) * T(2) + T(1)); - tvec4<T, P> sh(-step(h, tvec4<T, P>(0.0))); - - tvec4<T, P> a0 = tvec4<T, P>(b0.x, b0.z, b0.y, b0.w) + tvec4<T, P>(s0.x, s0.z, s0.y, s0.w) * tvec4<T, P>(sh.x, sh.x, sh.y, sh.y); - tvec4<T, P> a1 = tvec4<T, P>(b1.x, b1.z, b1.y, b1.w) + tvec4<T, P>(s1.x, s1.z, s1.y, s1.w) * tvec4<T, P>(sh.z, sh.z, sh.w, sh.w); - - tvec3<T, P> p0(a0.x, a0.y, h.x); - tvec3<T, P> p1(a0.z, a0.w, h.y); - tvec3<T, P> p2(a1.x, a1.y, h.z); - tvec3<T, P> p3(a1.z, a1.w, h.w); - - // Normalise gradients - tvec4<T, P> norm = taylorInvSqrt(tvec4<T, P>(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3))); - p0 *= norm.x; - p1 *= norm.y; - p2 *= norm.z; - p3 *= norm.w; - - // Mix final noise value - tvec4<T, P> m = max(T(0.6) - tvec4<T, P>(dot(x0, x0), dot(x1, x1), dot(x2, x2), dot(x3, x3)), T(0)); - m = m * m; - return T(42) * dot(m * m, tvec4<T, P>(dot(p0, x0), dot(p1, x1), dot(p2, x2), dot(p3, x3))); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER T noise1(tvec4<T, P> const & v) - { - tvec4<T, P> const C( - 0.138196601125011, // (5 - sqrt(5))/20 G4 - 0.276393202250021, // 2 * G4 - 0.414589803375032, // 3 * G4 - -0.447213595499958); // -1 + 4 * G4 - - // (sqrt(5) - 1)/4 = F4, used once below - T const F4 = static_cast<T>(0.309016994374947451); - - // First corner - tvec4<T, P> i = floor(v + dot(v, tvec4<T, P>(F4))); - tvec4<T, P> x0 = v - i + dot(i, tvec4<T, P>(C.x)); - - // Other corners - - // Rank sorting originally contributed by Bill Licea-Kane, AMD (formerly ATI) - tvec4<T, P> i0; - tvec3<T, P> isX = step(tvec3<T, P>(x0.y, x0.z, x0.w), tvec3<T, P>(x0.x)); - tvec3<T, P> isYZ = step(tvec3<T, P>(x0.z, x0.w, x0.w), tvec3<T, P>(x0.y, x0.y, x0.z)); - - // i0.x = dot(isX, vec3(1.0)); - //i0.x = isX.x + isX.y + isX.z; - //i0.yzw = static_cast<T>(1) - isX; - i0 = tvec4<T, P>(isX.x + isX.y + isX.z, T(1) - isX); - - // i0.y += dot(isYZ.xy, vec2(1.0)); - i0.y += isYZ.x + isYZ.y; - - //i0.zw += 1.0 - tvec2<T, P>(isYZ.x, isYZ.y); - i0.z += static_cast<T>(1) - isYZ.x; - i0.w += static_cast<T>(1) - isYZ.y; - i0.z += isYZ.z; - i0.w += static_cast<T>(1) - isYZ.z; - - // i0 now contains the unique values 0,1,2,3 in each channel - tvec4<T, P> i3 = clamp(i0, T(0), T(1)); - tvec4<T, P> i2 = clamp(i0 - T(1), T(0), T(1)); - tvec4<T, P> i1 = clamp(i0 - T(2), T(0), T(1)); - - // x0 = x0 - 0.0 + 0.0 * C.xxxx - // x1 = x0 - i1 + 0.0 * C.xxxx - // x2 = x0 - i2 + 0.0 * C.xxxx - // x3 = x0 - i3 + 0.0 * C.xxxx - // x4 = x0 - 1.0 + 4.0 * C.xxxx - tvec4<T, P> x1 = x0 - i1 + C.x; - tvec4<T, P> x2 = x0 - i2 + C.y; - tvec4<T, P> x3 = x0 - i3 + C.z; - tvec4<T, P> x4 = x0 + C.w; - - // Permutations - i = mod(i, T(289)); - T j0 = detail::permute(detail::permute(detail::permute(detail::permute(i.w) + i.z) + i.y) + i.x); - tvec4<T, P> j1 = detail::permute(detail::permute(detail::permute(detail::permute( - i.w + tvec4<T, P>(i1.w, i2.w, i3.w, T(1))) + - i.z + tvec4<T, P>(i1.z, i2.z, i3.z, T(1))) + - i.y + tvec4<T, P>(i1.y, i2.y, i3.y, T(1))) + - i.x + tvec4<T, P>(i1.x, i2.x, i3.x, T(1))); - - // Gradients: 7x7x6 points over a cube, mapped onto a 4-cross polytope - // 7*7*6 = 294, which is close to the ring size 17*17 = 289. - tvec4<T, P> ip = tvec4<T, P>(T(1) / T(294), T(1) / T(49), T(1) / T(7), T(0)); - - tvec4<T, P> p0 = detail::grad4(j0, ip); - tvec4<T, P> p1 = detail::grad4(j1.x, ip); - tvec4<T, P> p2 = detail::grad4(j1.y, ip); - tvec4<T, P> p3 = detail::grad4(j1.z, ip); - tvec4<T, P> p4 = detail::grad4(j1.w, ip); - - // Normalise gradients - tvec4<T, P> norm = detail::taylorInvSqrt(tvec4<T, P>(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3))); - p0 *= norm.x; - p1 *= norm.y; - p2 *= norm.z; - p3 *= norm.w; - p4 *= taylorInvSqrt(dot(p4, p4)); - - // Mix contributions from the five corners - tvec3<T, P> m0 = max(T(0.6) - tvec3<T, P>(dot(x0, x0), dot(x1, x1), dot(x2, x2)), T(0)); - tvec2<T, P> m1 = max(T(0.6) - tvec2<T, P>(dot(x3, x3), dot(x4, x4) ), T(0)); - m0 = m0 * m0; - m1 = m1 * m1; - - return T(49) * ( - dot(m0 * m0, tvec3<T, P>(dot(p0, x0), dot(p1, x1), dot(p2, x2))) + - dot(m1 * m1, tvec2<T, P>(dot(p3, x3), dot(p4, x4)))); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> noise2(tvec2<T, P> const & x) - { - return tvec2<T, P>( - noise1(x + tvec2<T, P>(0.0)), - noise1(tvec2<T, P>(0.0) - x)); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> noise2(tvec3<T, P> const & x) - { - return tvec2<T, P>( - noise1(x + tvec3<T, P>(0.0)), - noise1(tvec3<T, P>(0.0) - x)); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> noise2(tvec4<T, P> const & x) - { - return tvec2<T, P>( - noise1(x + tvec4<T, P>(0)), - noise1(tvec4<T, P>(0) - x)); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> noise3(tvec2<T, P> const & x) - { - return tvec3<T, P>( - noise1(x - tvec2<T, P>(1.0)), - noise1(x + tvec2<T, P>(0.0)), - noise1(x + tvec2<T, P>(1.0))); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> noise3(tvec3<T, P> const & x) - { - return tvec3<T, P>( - noise1(x - tvec3<T, P>(1.0)), - noise1(x + tvec3<T, P>(0.0)), - noise1(x + tvec3<T, P>(1.0))); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> noise3(tvec4<T, P> const & x) - { - return tvec3<T, P>( - noise1(x - tvec4<T, P>(1)), - noise1(x + tvec4<T, P>(0)), - noise1(x + tvec4<T, P>(1))); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> noise4(tvec2<T, P> const & x) - { - return tvec4<T, P>( - noise1(x - tvec2<T, P>(1)), - noise1(x + tvec2<T, P>(0)), - noise1(x + tvec2<T, P>(1)), - noise1(x + tvec2<T, P>(2))); - } - - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> noise4(tvec3<T, P> const & x) - { - return tvec4<T, P>( - noise1(x - tvec3<T, P>(1)), - noise1(x + tvec3<T, P>(0)), - noise1(x + tvec3<T, P>(1)), - noise1(x + tvec3<T, P>(2))); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> noise4(tvec4<T, P> const & x) - { - return tvec4<T, P>( - noise1(x - tvec4<T, P>(1)), - noise1(x + tvec4<T, P>(0)), - noise1(x + tvec4<T, P>(1)), - noise1(x + tvec4<T, P>(2))); - } - -}//namespace glm diff --git a/extensions/common/glm/detail/func_packing.hpp b/extensions/common/glm/detail/func_packing.hpp deleted file mode 100644 index 0e794241e7f..00000000000 --- a/extensions/common/glm/detail/func_packing.hpp +++ /dev/null @@ -1,197 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/func_packing.hpp -/// @date 2010-03-17 / 2011-06-15 -/// @author Christophe Riccio -/// -/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> -/// @see gtc_packing -/// -/// @defgroup core_func_packing Floating-Point Pack and Unpack Functions -/// @ingroup core -/// -/// These functions do not operate component-wise, rather as described in each case. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "type_vec2.hpp" -#include "type_vec4.hpp" - -namespace glm -{ - /// @addtogroup core_func_packing - /// @{ - - /// First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values. - /// Then, the results are packed into the returned 32-bit unsigned integer. - /// - /// The conversion for component c of v to fixed point is done as follows: - /// packUnorm2x16: round(clamp(c, 0, +1) * 65535.0) - /// - /// The first component of the vector will be written to the least significant bits of the output; - /// the last component will be written to the most significant bits. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packUnorm2x16.xml">GLSL packUnorm2x16 man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> - GLM_FUNC_DECL uint packUnorm2x16(vec2 const & v); - - /// First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values. - /// Then, the results are packed into the returned 32-bit unsigned integer. - /// - /// The conversion for component c of v to fixed point is done as follows: - /// packSnorm2x16: round(clamp(v, -1, +1) * 32767.0) - /// - /// The first component of the vector will be written to the least significant bits of the output; - /// the last component will be written to the most significant bits. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packSnorm2x16.xml">GLSL packSnorm2x16 man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> - GLM_FUNC_DECL uint packSnorm2x16(vec2 const & v); - - /// First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values. - /// Then, the results are packed into the returned 32-bit unsigned integer. - /// - /// The conversion for component c of v to fixed point is done as follows: - /// packUnorm4x8: round(clamp(c, 0, +1) * 255.0) - /// - /// The first component of the vector will be written to the least significant bits of the output; - /// the last component will be written to the most significant bits. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packUnorm4x8.xml">GLSL packUnorm4x8 man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> - GLM_FUNC_DECL uint packUnorm4x8(vec4 const & v); - - /// First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values. - /// Then, the results are packed into the returned 32-bit unsigned integer. - /// - /// The conversion for component c of v to fixed point is done as follows: - /// packSnorm4x8: round(clamp(c, -1, +1) * 127.0) - /// - /// The first component of the vector will be written to the least significant bits of the output; - /// the last component will be written to the most significant bits. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packSnorm4x8.xml">GLSL packSnorm4x8 man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> - GLM_FUNC_DECL uint packSnorm4x8(vec4 const & v); - - /// First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers. - /// Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector. - /// - /// The conversion for unpacked fixed-point value f to floating point is done as follows: - /// unpackUnorm2x16: f / 65535.0 - /// - /// The first component of the returned vector will be extracted from the least significant bits of the input; - /// the last component will be extracted from the most significant bits. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackUnorm2x16.xml">GLSL unpackUnorm2x16 man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> - GLM_FUNC_DECL vec2 unpackUnorm2x16(uint p); - - /// First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers. - /// Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector. - /// - /// The conversion for unpacked fixed-point value f to floating point is done as follows: - /// unpackSnorm2x16: clamp(f / 32767.0, -1, +1) - /// - /// The first component of the returned vector will be extracted from the least significant bits of the input; - /// the last component will be extracted from the most significant bits. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackSnorm2x16.xml">GLSL unpackSnorm2x16 man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> - GLM_FUNC_DECL vec2 unpackSnorm2x16(uint p); - - /// First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers. - /// Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector. - /// - /// The conversion for unpacked fixed-point value f to floating point is done as follows: - /// unpackUnorm4x8: f / 255.0 - /// - /// The first component of the returned vector will be extracted from the least significant bits of the input; - /// the last component will be extracted from the most significant bits. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackUnorm4x8.xml">GLSL unpackUnorm4x8 man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> - GLM_FUNC_DECL vec4 unpackUnorm4x8(uint p); - - /// First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers. - /// Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector. - /// - /// The conversion for unpacked fixed-point value f to floating point is done as follows: - /// unpackSnorm4x8: clamp(f / 127.0, -1, +1) - /// - /// The first component of the returned vector will be extracted from the least significant bits of the input; - /// the last component will be extracted from the most significant bits. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackSnorm4x8.xml">GLSL unpackSnorm4x8 man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> - GLM_FUNC_DECL vec4 unpackSnorm4x8(uint p); - - /// Returns a double-precision value obtained by packing the components of v into a 64-bit value. - /// If an IEEE 754 Inf or NaN is created, it will not signal, and the resulting floating point value is unspecified. - /// Otherwise, the bit- level representation of v is preserved. - /// The first vector component specifies the 32 least significant bits; - /// the second component specifies the 32 most significant bits. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packDouble2x32.xml">GLSL packDouble2x32 man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> - GLM_FUNC_DECL double packDouble2x32(uvec2 const & v); - - /// Returns a two-component unsigned integer vector representation of v. - /// The bit-level representation of v is preserved. - /// The first component of the vector contains the 32 least significant bits of the double; - /// the second component consists the 32 most significant bits. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackDouble2x32.xml">GLSL unpackDouble2x32 man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> - GLM_FUNC_DECL uvec2 unpackDouble2x32(double v); - - /// Returns an unsigned integer obtained by converting the components of a two-component floating-point vector - /// to the 16-bit floating-point representation found in the OpenGL Specification, - /// and then packing these two 16- bit integers into a 32-bit unsigned integer. - /// The first vector component specifies the 16 least-significant bits of the result; - /// the second component specifies the 16 most-significant bits. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packHalf2x16.xml">GLSL packHalf2x16 man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> - GLM_FUNC_DECL uint packHalf2x16(vec2 const & v); - - /// Returns a two-component floating-point vector with components obtained by unpacking a 32-bit unsigned integer into a pair of 16-bit values, - /// interpreting those values as 16-bit floating-point numbers according to the OpenGL Specification, - /// and converting them to 32-bit floating-point values. - /// The first component of the vector is obtained from the 16 least-significant bits of v; - /// the second component is obtained from the 16 most-significant bits of v. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackHalf2x16.xml">GLSL unpackHalf2x16 man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> - GLM_FUNC_DECL vec2 unpackHalf2x16(uint v); - - /// @} -}//namespace glm - -#include "func_packing.inl" diff --git a/extensions/common/glm/detail/func_packing.inl b/extensions/common/glm/detail/func_packing.inl deleted file mode 100644 index 3132a279c42..00000000000 --- a/extensions/common/glm/detail/func_packing.inl +++ /dev/null @@ -1,119 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/func_packing.inl -/// @date 2010-03-17 / 2011-06-15 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#include "func_common.hpp" -#include "type_half.hpp" -#include "../fwd.hpp" - -namespace glm -{ - GLM_FUNC_QUALIFIER uint packUnorm2x16(vec2 const & v) - { - u16vec2 const Topack(round(clamp(v, 0.0f, 1.0f) * 65535.0f)); - return reinterpret_cast<uint const &>(Topack); - } - - GLM_FUNC_QUALIFIER vec2 unpackUnorm2x16(uint p) - { - vec2 Unpack(reinterpret_cast<u16vec2 const &>(p)); - return Unpack * float(1.5259021896696421759365224689097e-5); // 1.0 / 65535.0 - } - - GLM_FUNC_QUALIFIER uint packSnorm2x16(vec2 const & v) - { - i16vec2 const Topack(round(clamp(v ,-1.0f, 1.0f) * 32767.0f)); - return reinterpret_cast<uint const &>(Topack); - } - - GLM_FUNC_QUALIFIER vec2 unpackSnorm2x16(uint p) - { - vec2 const Unpack(reinterpret_cast<i16vec2 const &>(p)); - return clamp( - Unpack * 3.0518509475997192297128208258309e-5f, //1.0f / 32767.0f, - -1.0f, 1.0f); - } - - GLM_FUNC_QUALIFIER uint packUnorm4x8(vec4 const & v) - { - u8vec4 const Topack(round(clamp(v, 0.0f, 1.0f) * 255.0f)); - return reinterpret_cast<uint const &>(Topack); - } - - GLM_FUNC_QUALIFIER vec4 unpackUnorm4x8(uint p) - { - vec4 const Unpack(reinterpret_cast<u8vec4 const&>(p)); - return Unpack * float(0.0039215686274509803921568627451); // 1 / 255 - } - - GLM_FUNC_QUALIFIER uint packSnorm4x8(vec4 const & v) - { - i8vec4 const Topack(round(clamp(v ,-1.0f, 1.0f) * 127.0f)); - return reinterpret_cast<uint const &>(Topack); - } - - GLM_FUNC_QUALIFIER glm::vec4 unpackSnorm4x8(uint p) - { - vec4 const Unpack(reinterpret_cast<i8vec4 const &>(p)); - return clamp( - Unpack * 0.0078740157480315f, // 1.0f / 127.0f - -1.0f, 1.0f); - } - - GLM_FUNC_QUALIFIER double packDouble2x32(uvec2 const & v) - { - return reinterpret_cast<double const &>(v); - } - - GLM_FUNC_QUALIFIER uvec2 unpackDouble2x32(double v) - { - return reinterpret_cast<uvec2 const &>(v); - } - - GLM_FUNC_QUALIFIER uint packHalf2x16(vec2 const & v) - { - i16vec2 const Unpack( - detail::toFloat16(v.x), - detail::toFloat16(v.y)); - - return reinterpret_cast<uint const &>(Unpack); - } - - GLM_FUNC_QUALIFIER vec2 unpackHalf2x16(uint v) - { - i16vec2 const Unpack(reinterpret_cast<i16vec2 const &>(v)); - - return vec2( - detail::toFloat32(Unpack.x), - detail::toFloat32(Unpack.y)); - } -}//namespace glm - diff --git a/extensions/common/glm/detail/func_trigonometric.hpp b/extensions/common/glm/detail/func_trigonometric.hpp deleted file mode 100644 index e13021a677e..00000000000 --- a/extensions/common/glm/detail/func_trigonometric.hpp +++ /dev/null @@ -1,205 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/func_trigonometric.hpp -/// @date 2008-08-01 / 2011-06-15 -/// @author Christophe Riccio -/// -/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a> -/// -/// @defgroup core_func_trigonometric Angle and Trigonometry Functions -/// @ingroup core -/// -/// Function parameters specified as angle are assumed to be in units of radians. -/// In no case will any of these functions result in a divide by zero error. If -/// the divisor of a ratio is 0, then results will be undefined. -/// -/// These all operate component-wise. The description is per component. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "setup.hpp" -#include "precision.hpp" - -namespace glm -{ - /// @addtogroup core_func_trigonometric - /// @{ - - /// Converts degrees to radians and returns the result. - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/radians.xml">GLSL radians man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a> - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> radians(vecType<T, P> const & degrees); - - /// Converts radians to degrees and returns the result. - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/degrees.xml">GLSL degrees man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a> - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> degrees(vecType<T, P> const & radians); - - /// The standard trigonometric sine function. - /// The values returned by this function will range from [-1, 1]. - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/sin.xml">GLSL sin man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a> - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> sin(vecType<T, P> const & angle); - - /// The standard trigonometric cosine function. - /// The values returned by this function will range from [-1, 1]. - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/cos.xml">GLSL cos man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a> - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> cos(vecType<T, P> const & angle); - - /// The standard trigonometric tangent function. - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/tan.xml">GLSL tan man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a> - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> tan(vecType<T, P> const & angle); - - /// Arc sine. Returns an angle whose sine is x. - /// The range of values returned by this function is [-PI/2, PI/2]. - /// Results are undefined if |x| > 1. - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/asin.xml">GLSL asin man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a> - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> asin(vecType<T, P> const & x); - - /// Arc cosine. Returns an angle whose sine is x. - /// The range of values returned by this function is [0, PI]. - /// Results are undefined if |x| > 1. - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/acos.xml">GLSL acos man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a> - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> acos(vecType<T, P> const & x); - - /// Arc tangent. Returns an angle whose tangent is y/x. - /// The signs of x and y are used to determine what - /// quadrant the angle is in. The range of values returned - /// by this function is [-PI, PI]. Results are undefined - /// if x and y are both 0. - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/atan.xml">GLSL atan man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a> - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> atan(vecType<T, P> const & y, vecType<T, P> const & x); - - /// Arc tangent. Returns an angle whose tangent is y_over_x. - /// The range of values returned by this function is [-PI/2, PI/2]. - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/atan.xml">GLSL atan man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a> - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> atan(vecType<T, P> const & y_over_x); - - /// Returns the hyperbolic sine function, (exp(x) - exp(-x)) / 2 - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/sinh.xml">GLSL sinh man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a> - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> sinh(vecType<T, P> const & angle); - - /// Returns the hyperbolic cosine function, (exp(x) + exp(-x)) / 2 - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/cosh.xml">GLSL cosh man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a> - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> cosh(vecType<T, P> const & angle); - - /// Returns the hyperbolic tangent function, sinh(angle) / cosh(angle) - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/tanh.xml">GLSL tanh man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a> - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> tanh(vecType<T, P> const & angle); - - /// Arc hyperbolic sine; returns the inverse of sinh. - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/asinh.xml">GLSL asinh man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a> - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> asinh(vecType<T, P> const & x); - - /// Arc hyperbolic cosine; returns the non-negative inverse - /// of cosh. Results are undefined if x < 1. - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/acosh.xml">GLSL acosh man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a> - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> acosh(vecType<T, P> const & x); - - /// Arc hyperbolic tangent; returns the inverse of tanh. - /// Results are undefined if abs(x) >= 1. - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/atanh.xml">GLSL atanh man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a> - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> atanh(vecType<T, P> const & x); - - /// @} -}//namespace glm - -#include "func_trigonometric.inl" diff --git a/extensions/common/glm/detail/func_trigonometric.inl b/extensions/common/glm/detail/func_trigonometric.inl deleted file mode 100644 index a7105250833..00000000000 --- a/extensions/common/glm/detail/func_trigonometric.inl +++ /dev/null @@ -1,224 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/func_trigonometric.inl -/// @date 2008-08-03 / 2011-06-15 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#include "_vectorize.hpp" -#include <cmath> -#include <limits> - -namespace glm -{ - // radians - template <typename genType> - GLM_FUNC_QUALIFIER genType radians(genType degrees) - { - GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'radians' only accept floating-point input"); - - return degrees * static_cast<genType>(0.01745329251994329576923690768489); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> radians(vecType<T, P> const & v) - { - return detail::functor1<T, T, P, vecType>::call(radians, v); - } - - // degrees - template <typename genType> - GLM_FUNC_QUALIFIER genType degrees(genType radians) - { - GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'degrees' only accept floating-point input"); - - return radians * static_cast<genType>(57.295779513082320876798154814105); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> degrees(vecType<T, P> const & v) - { - return detail::functor1<T, T, P, vecType>::call(degrees, v); - } - - // sin - using ::std::sin; - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> sin(vecType<T, P> const & v) - { - return detail::functor1<T, T, P, vecType>::call(sin, v); - } - - // cos - using std::cos; - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> cos(vecType<T, P> const & v) - { - return detail::functor1<T, T, P, vecType>::call(cos, v); - } - - // tan - using std::tan; - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> tan(vecType<T, P> const & v) - { - return detail::functor1<T, T, P, vecType>::call(tan, v); - } - - // asin - using std::asin; - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> asin(vecType<T, P> const & v) - { - return detail::functor1<T, T, P, vecType>::call(asin, v); - } - - // acos - using std::acos; - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> acos(vecType<T, P> const & v) - { - return detail::functor1<T, T, P, vecType>::call(acos, v); - } - - // atan - template <typename genType> - GLM_FUNC_QUALIFIER genType atan(genType const & y, genType const & x) - { - GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'atan' only accept floating-point input"); - - return ::std::atan2(y, x); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> atan(vecType<T, P> const & a, vecType<T, P> const & b) - { - return detail::functor2<T, P, vecType>::call(atan2, a, b); - } - - using std::atan; - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> atan(vecType<T, P> const & v) - { - return detail::functor1<T, T, P, vecType>::call(atan, v); - } - - // sinh - using std::sinh; - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> sinh(vecType<T, P> const & v) - { - return detail::functor1<T, T, P, vecType>::call(sinh, v); - } - - // cosh - using std::cosh; - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> cosh(vecType<T, P> const & v) - { - return detail::functor1<T, T, P, vecType>::call(cosh, v); - } - - // tanh - using std::tanh; - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> tanh(vecType<T, P> const & v) - { - return detail::functor1<T, T, P, vecType>::call(tanh, v); - } - - // asinh -# if GLM_HAS_CXX11_STL - using std::asinh; -# else - template <typename genType> - GLM_FUNC_QUALIFIER genType asinh(genType const & x) - { - GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'asinh' only accept floating-point input"); - - return (x < static_cast<genType>(0) ? static_cast<genType>(-1) : (x > static_cast<genType>(0) ? static_cast<genType>(1) : static_cast<genType>(0))) * log(abs(x) + sqrt(static_cast<genType>(1) + x * x)); - } -# endif - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> asinh(vecType<T, P> const & v) - { - return detail::functor1<T, T, P, vecType>::call(asinh, v); - } - - // acosh -# if GLM_HAS_CXX11_STL - using std::acosh; -# else - template <typename genType> - GLM_FUNC_QUALIFIER genType acosh(genType const & x) - { - GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'acosh' only accept floating-point input"); - - if(x < static_cast<genType>(1)) - return static_cast<genType>(0); - return log(x + sqrt(x * x - static_cast<genType>(1))); - } -# endif - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> acosh(vecType<T, P> const & v) - { - return detail::functor1<T, T, P, vecType>::call(acosh, v); - } - - // atanh -# if GLM_HAS_CXX11_STL - using std::atanh; -# else - template <typename genType> - GLM_FUNC_QUALIFIER genType atanh(genType const & x) - { - GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'atanh' only accept floating-point input"); - - if(abs(x) >= static_cast<genType>(1)) - return 0; - return static_cast<genType>(0.5) * log((static_cast<genType>(1) + x) / (static_cast<genType>(1) - x)); - } -# endif - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> atanh(vecType<T, P> const & v) - { - return detail::functor1<T, T, P, vecType>::call(atanh, v); - } -}//namespace glm diff --git a/extensions/common/glm/detail/func_vector_relational.hpp b/extensions/common/glm/detail/func_vector_relational.hpp deleted file mode 100644 index 65fbcd1e0d9..00000000000 --- a/extensions/common/glm/detail/func_vector_relational.hpp +++ /dev/null @@ -1,140 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/func_vector_relational.hpp -/// @date 2008-08-03 / 2011-06-15 -/// @author Christophe Riccio -/// -/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a> -/// -/// @defgroup core_func_vector_relational Vector Relational Functions -/// @ingroup core -/// -/// Relational and equality operators (<, <=, >, >=, ==, !=) are defined to -/// operate on scalars and produce scalar Boolean results. For vector results, -/// use the following built-in functions. -/// -/// In all cases, the sizes of all the input and return vectors for any particular -/// call must match. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "precision.hpp" -#include "setup.hpp" - -namespace glm -{ - /// @addtogroup core_func_vector_relational - /// @{ - - /// Returns the component-wise comparison result of x < y. - /// - /// @tparam vecType Floating-point or integer vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/lessThan.xml">GLSL lessThan man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a> - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<bool, P> lessThan(vecType<T, P> const & x, vecType<T, P> const & y); - - /// Returns the component-wise comparison of result x <= y. - /// - /// @tparam vecType Floating-point or integer vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/lessThanEqual.xml">GLSL lessThanEqual man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a> - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<bool, P> lessThanEqual(vecType<T, P> const & x, vecType<T, P> const & y); - - /// Returns the component-wise comparison of result x > y. - /// - /// @tparam vecType Floating-point or integer vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/greaterThan.xml">GLSL greaterThan man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a> - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<bool, P> greaterThan(vecType<T, P> const & x, vecType<T, P> const & y); - - /// Returns the component-wise comparison of result x >= y. - /// - /// @tparam vecType Floating-point or integer vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/greaterThanEqual.xml">GLSL greaterThanEqual man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a> - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<bool, P> greaterThanEqual(vecType<T, P> const & x, vecType<T, P> const & y); - - /// Returns the component-wise comparison of result x == y. - /// - /// @tparam vecType Floating-point, integer or boolean vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/equal.xml">GLSL equal man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a> - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<bool, P> equal(vecType<T, P> const & x, vecType<T, P> const & y); - - /// Returns the component-wise comparison of result x != y. - /// - /// @tparam vecType Floating-point, integer or boolean vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/notEqual.xml">GLSL notEqual man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a> - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<bool, P> notEqual(vecType<T, P> const & x, vecType<T, P> const & y); - - /// Returns true if any component of x is true. - /// - /// @tparam vecType Boolean vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/any.xml">GLSL any man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a> - template <precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL bool any(vecType<bool, P> const & v); - - /// Returns true if all components of x are true. - /// - /// @tparam vecType Boolean vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/all.xml">GLSL all man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a> - template <precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL bool all(vecType<bool, P> const & v); - - /// Returns the component-wise logical complement of x. - /// /!\ Because of language incompatibilities between C++ and GLSL, GLM defines the function not but not_ instead. - /// - /// @tparam vecType Boolean vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/not.xml">GLSL not man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a> - template <precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<bool, P> not_(vecType<bool, P> const & v); - - /// @} -}//namespace glm - -#include "func_vector_relational.inl" diff --git a/extensions/common/glm/detail/func_vector_relational.inl b/extensions/common/glm/detail/func_vector_relational.inl deleted file mode 100644 index 72106d6edba..00000000000 --- a/extensions/common/glm/detail/func_vector_relational.inl +++ /dev/null @@ -1,131 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/func_vector_relational.inl -/// @date 2008-08-03 / 2011-09-09 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#include <limits> - -namespace glm -{ - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<bool, P> lessThan(vecType<T, P> const & x, vecType<T, P> const & y) - { - assert(detail::component_count(x) == detail::component_count(y)); - - vecType<bool, P> Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(x); ++i) - Result[i] = x[i] < y[i]; - - return Result; - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<bool, P> lessThanEqual(vecType<T, P> const & x, vecType<T, P> const & y) - { - assert(detail::component_count(x) == detail::component_count(y)); - - vecType<bool, P> Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(x); ++i) - Result[i] = x[i] <= y[i]; - return Result; - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<bool, P> greaterThan(vecType<T, P> const & x, vecType<T, P> const & y) - { - assert(detail::component_count(x) == detail::component_count(y)); - - vecType<bool, P> Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(x); ++i) - Result[i] = x[i] > y[i]; - return Result; - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<bool, P> greaterThanEqual(vecType<T, P> const & x, vecType<T, P> const & y) - { - assert(detail::component_count(x) == detail::component_count(y)); - - vecType<bool, P> Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(x); ++i) - Result[i] = x[i] >= y[i]; - return Result; - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<bool, P> equal(vecType<T, P> const & x, vecType<T, P> const & y) - { - assert(detail::component_count(x) == detail::component_count(y)); - - vecType<bool, P> Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(x); ++i) - Result[i] = x[i] == y[i]; - return Result; - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<bool, P> notEqual(vecType<T, P> const & x, vecType<T, P> const & y) - { - assert(detail::component_count(x) == detail::component_count(y)); - - vecType<bool, P> Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(x); ++i) - Result[i] = x[i] != y[i]; - return Result; - } - - template <precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER bool any(vecType<bool, P> const & v) - { - bool Result = false; - for(detail::component_count_t i = 0; i < detail::component_count(v); ++i) - Result = Result || v[i]; - return Result; - } - - template <precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER bool all(vecType<bool, P> const & v) - { - bool Result = true; - for(detail::component_count_t i = 0; i < detail::component_count(v); ++i) - Result = Result && v[i]; - return Result; - } - - template <precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<bool, P> not_(vecType<bool, P> const & v) - { - vecType<bool, P> Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(v); ++i) - Result[i] = !v[i]; - return Result; - } -}//namespace glm - diff --git a/extensions/common/glm/detail/glm.cpp b/extensions/common/glm/detail/glm.cpp deleted file mode 100644 index 76ef58784d9..00000000000 --- a/extensions/common/glm/detail/glm.cpp +++ /dev/null @@ -1,286 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/glm.cpp -/// @date 2013-04-22 / 2013-04-22 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#include <glm/glm.hpp> -#include <glm/gtc/quaternion.hpp> -#include <glm/gtx/dual_quaternion.hpp> - -namespace glm -{ -// tvec1 type explicit instantiation -template struct tvec1<uint8, lowp>; -template struct tvec1<uint16, lowp>; -template struct tvec1<uint32, lowp>; -template struct tvec1<uint64, lowp>; -template struct tvec1<int8, lowp>; -template struct tvec1<int16, lowp>; -template struct tvec1<int32, lowp>; -template struct tvec1<int64, lowp>; -template struct tvec1<float32, lowp>; -template struct tvec1<float64, lowp>; - -template struct tvec1<uint8, mediump>; -template struct tvec1<uint16, mediump>; -template struct tvec1<uint32, mediump>; -template struct tvec1<uint64, mediump>; -template struct tvec1<int8, mediump>; -template struct tvec1<int16, mediump>; -template struct tvec1<int32, mediump>; -template struct tvec1<int64, mediump>; -template struct tvec1<float32, mediump>; -template struct tvec1<float64, mediump>; - -template struct tvec1<uint8, highp>; -template struct tvec1<uint16, highp>; -template struct tvec1<uint32, highp>; -template struct tvec1<uint64, highp>; -template struct tvec1<int8, highp>; -template struct tvec1<int16, highp>; -template struct tvec1<int32, highp>; -template struct tvec1<int64, highp>; -template struct tvec1<float32, highp>; -template struct tvec1<float64, highp>; - -// tvec2 type explicit instantiation -template struct tvec2<uint8, lowp>; -template struct tvec2<uint16, lowp>; -template struct tvec2<uint32, lowp>; -template struct tvec2<uint64, lowp>; -template struct tvec2<int8, lowp>; -template struct tvec2<int16, lowp>; -template struct tvec2<int32, lowp>; -template struct tvec2<int64, lowp>; -template struct tvec2<float32, lowp>; -template struct tvec2<float64, lowp>; - -template struct tvec2<uint8, mediump>; -template struct tvec2<uint16, mediump>; -template struct tvec2<uint32, mediump>; -template struct tvec2<uint64, mediump>; -template struct tvec2<int8, mediump>; -template struct tvec2<int16, mediump>; -template struct tvec2<int32, mediump>; -template struct tvec2<int64, mediump>; -template struct tvec2<float32, mediump>; -template struct tvec2<float64, mediump>; - -template struct tvec2<uint8, highp>; -template struct tvec2<uint16, highp>; -template struct tvec2<uint32, highp>; -template struct tvec2<uint64, highp>; -template struct tvec2<int8, highp>; -template struct tvec2<int16, highp>; -template struct tvec2<int32, highp>; -template struct tvec2<int64, highp>; -template struct tvec2<float32, highp>; -template struct tvec2<float64, highp>; - -// tvec3 type explicit instantiation -template struct tvec3<uint8, lowp>; -template struct tvec3<uint16, lowp>; -template struct tvec3<uint32, lowp>; -template struct tvec3<uint64, lowp>; -template struct tvec3<int8, lowp>; -template struct tvec3<int16, lowp>; -template struct tvec3<int32, lowp>; -template struct tvec3<int64, lowp>; -template struct tvec3<float32, lowp>; -template struct tvec3<float64, lowp>; - -template struct tvec3<uint8, mediump>; -template struct tvec3<uint16, mediump>; -template struct tvec3<uint32, mediump>; -template struct tvec3<uint64, mediump>; -template struct tvec3<int8, mediump>; -template struct tvec3<int16, mediump>; -template struct tvec3<int32, mediump>; -template struct tvec3<int64, mediump>; -template struct tvec3<float32, mediump>; -template struct tvec3<float64, mediump>; - -template struct tvec3<uint8, highp>; -template struct tvec3<uint16, highp>; -template struct tvec3<uint32, highp>; -template struct tvec3<uint64, highp>; -template struct tvec3<int8, highp>; -template struct tvec3<int16, highp>; -template struct tvec3<int32, highp>; -template struct tvec3<int64, highp>; -template struct tvec3<float32, highp>; -template struct tvec3<float64, highp>; - -// tvec4 type explicit instantiation -template struct tvec4<uint8, lowp>; -template struct tvec4<uint16, lowp>; -template struct tvec4<uint32, lowp>; -template struct tvec4<uint64, lowp>; -template struct tvec4<int8, lowp>; -template struct tvec4<int16, lowp>; -template struct tvec4<int32, lowp>; -template struct tvec4<int64, lowp>; -template struct tvec4<float32, lowp>; -template struct tvec4<float64, lowp>; - -template struct tvec4<uint8, mediump>; -template struct tvec4<uint16, mediump>; -template struct tvec4<uint32, mediump>; -template struct tvec4<uint64, mediump>; -template struct tvec4<int8, mediump>; -template struct tvec4<int16, mediump>; -template struct tvec4<int32, mediump>; -template struct tvec4<int64, mediump>; -template struct tvec4<float32, mediump>; -template struct tvec4<float64, mediump>; - -template struct tvec4<uint8, highp>; -template struct tvec4<uint16, highp>; -template struct tvec4<uint32, highp>; -template struct tvec4<uint64, highp>; -template struct tvec4<int8, highp>; -template struct tvec4<int16, highp>; -template struct tvec4<int32, highp>; -template struct tvec4<int64, highp>; -template struct tvec4<float32, highp>; -template struct tvec4<float64, highp>; - -// tmat2x2 type explicit instantiation -template struct tmat2x2<float32, lowp>; -template struct tmat2x2<float64, lowp>; - -template struct tmat2x2<float32, mediump>; -template struct tmat2x2<float64, mediump>; - -template struct tmat2x2<float32, highp>; -template struct tmat2x2<float64, highp>; - -// tmat2x3 type explicit instantiation -template struct tmat2x3<float32, lowp>; -template struct tmat2x3<float64, lowp>; - -template struct tmat2x3<float32, mediump>; -template struct tmat2x3<float64, mediump>; - -template struct tmat2x3<float32, highp>; -template struct tmat2x3<float64, highp>; - -// tmat2x4 type explicit instantiation -template struct tmat2x4<float32, lowp>; -template struct tmat2x4<float64, lowp>; - -template struct tmat2x4<float32, mediump>; -template struct tmat2x4<float64, mediump>; - -template struct tmat2x4<float32, highp>; -template struct tmat2x4<float64, highp>; - -// tmat3x2 type explicit instantiation -template struct tmat3x2<float32, lowp>; -template struct tmat3x2<float64, lowp>; - -template struct tmat3x2<float32, mediump>; -template struct tmat3x2<float64, mediump>; - -template struct tmat3x2<float32, highp>; -template struct tmat3x2<float64, highp>; - -// tmat3x3 type explicit instantiation -template struct tmat3x3<float32, lowp>; -template struct tmat3x3<float64, lowp>; - -template struct tmat3x3<float32, mediump>; -template struct tmat3x3<float64, mediump>; - -template struct tmat3x3<float32, highp>; -template struct tmat3x3<float64, highp>; - -// tmat3x4 type explicit instantiation -template struct tmat3x4<float32, lowp>; -template struct tmat3x4<float64, lowp>; - -template struct tmat3x4<float32, mediump>; -template struct tmat3x4<float64, mediump>; - -template struct tmat3x4<float32, highp>; -template struct tmat3x4<float64, highp>; - -// tmat4x2 type explicit instantiation -template struct tmat4x2<float32, lowp>; -template struct tmat4x2<float64, lowp>; - -template struct tmat4x2<float32, mediump>; -template struct tmat4x2<float64, mediump>; - -template struct tmat4x2<float32, highp>; -template struct tmat4x2<float64, highp>; - -// tmat4x3 type explicit instantiation -template struct tmat4x3<float32, lowp>; -template struct tmat4x3<float64, lowp>; - -template struct tmat4x3<float32, mediump>; -template struct tmat4x3<float64, mediump>; - -template struct tmat4x3<float32, highp>; -template struct tmat4x3<float64, highp>; - -// tmat4x4 type explicit instantiation -template struct tmat4x4<float32, lowp>; -template struct tmat4x4<float64, lowp>; - -template struct tmat4x4<float32, mediump>; -template struct tmat4x4<float64, mediump>; - -template struct tmat4x4<float32, highp>; -template struct tmat4x4<float64, highp>; - -// tquat type explicit instantiation -template struct tquat<float32, lowp>; -template struct tquat<float64, lowp>; - -template struct tquat<float32, mediump>; -template struct tquat<float64, mediump>; - -template struct tquat<float32, highp>; -template struct tquat<float64, highp>; - -//tdualquat type explicit instantiation -template struct tdualquat<float32, lowp>; -template struct tdualquat<float64, lowp>; - -template struct tdualquat<float32, mediump>; -template struct tdualquat<float64, mediump>; - -template struct tdualquat<float32, highp>; -template struct tdualquat<float64, highp>; - -}//namespace glm - diff --git a/extensions/common/glm/detail/intrinsic_common.hpp b/extensions/common/glm/detail/intrinsic_common.hpp deleted file mode 100644 index 0ec941de748..00000000000 --- a/extensions/common/glm/detail/intrinsic_common.hpp +++ /dev/null @@ -1,87 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/intrinsic_common.hpp -/// @date 2009-05-11 / 2011-06-15 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "setup.hpp" - -#if(!(GLM_ARCH & GLM_ARCH_SSE2)) -# error "SSE2 instructions not supported or enabled" -#else - -namespace glm{ -namespace detail -{ - __m128 sse_abs_ps(__m128 x); - - __m128 sse_sgn_ps(__m128 x); - - //floor - __m128 sse_flr_ps(__m128 v); - - //trunc - __m128 sse_trc_ps(__m128 v); - - //round - __m128 sse_nd_ps(__m128 v); - - //roundEven - __m128 sse_rde_ps(__m128 v); - - __m128 sse_rnd_ps(__m128 x); - - __m128 sse_ceil_ps(__m128 v); - - __m128 sse_frc_ps(__m128 x); - - __m128 sse_mod_ps(__m128 x, __m128 y); - - __m128 sse_modf_ps(__m128 x, __m128i & i); - - //GLM_FUNC_QUALIFIER __m128 sse_min_ps(__m128 x, __m128 y) - - //GLM_FUNC_QUALIFIER __m128 sse_max_ps(__m128 x, __m128 y) - - __m128 sse_clp_ps(__m128 v, __m128 minVal, __m128 maxVal); - - __m128 sse_mix_ps(__m128 v1, __m128 v2, __m128 a); - - __m128 sse_stp_ps(__m128 edge, __m128 x); - - __m128 sse_ssp_ps(__m128 edge0, __m128 edge1, __m128 x); - - __m128 sse_nan_ps(__m128 x); - - __m128 sse_inf_ps(__m128 x); - -}//namespace detail -}//namespace glm - -#include "intrinsic_common.inl" - -#endif//GLM_ARCH diff --git a/extensions/common/glm/detail/intrinsic_common.inl b/extensions/common/glm/detail/intrinsic_common.inl deleted file mode 100644 index bd9774bb148..00000000000 --- a/extensions/common/glm/detail/intrinsic_common.inl +++ /dev/null @@ -1,313 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/intrinsic_common.inl -/// @date 2009-05-08 / 2011-06-15 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -namespace glm{ -namespace detail{ - -#if(GLM_COMPILER & GLM_COMPILER_VC) -#pragma warning(push) -#pragma warning(disable : 4510 4512 4610) -#endif - - union ieee754_QNAN - { - const float f; - struct i - { - const unsigned int mantissa:23, exp:8, sign:1; - }; - - ieee754_QNAN() : f(0.0)/*, mantissa(0x7FFFFF), exp(0xFF), sign(0x0)*/ {} - }; - -#if(GLM_COMPILER & GLM_COMPILER_VC) -#pragma warning(pop) -#endif - - static const __m128 GLM_VAR_USED zero = _mm_setzero_ps(); - static const __m128 GLM_VAR_USED one = _mm_set_ps1(1.0f); - static const __m128 GLM_VAR_USED minus_one = _mm_set_ps1(-1.0f); - static const __m128 GLM_VAR_USED two = _mm_set_ps1(2.0f); - static const __m128 GLM_VAR_USED three = _mm_set_ps1(3.0f); - static const __m128 GLM_VAR_USED pi = _mm_set_ps1(3.1415926535897932384626433832795f); - static const __m128 GLM_VAR_USED hundred_eighty = _mm_set_ps1(180.f); - static const __m128 GLM_VAR_USED pi_over_hundred_eighty = _mm_set_ps1(0.017453292519943295769236907684886f); - static const __m128 GLM_VAR_USED hundred_eighty_over_pi = _mm_set_ps1(57.295779513082320876798154814105f); - - static const ieee754_QNAN absMask; - static const __m128 GLM_VAR_USED abs4Mask = _mm_set_ps1(absMask.f); - - static const __m128 GLM_VAR_USED _epi32_sign_mask = _mm_castsi128_ps(_mm_set1_epi32(static_cast<int>(0x80000000))); - //static const __m128 GLM_VAR_USED _epi32_inv_sign_mask = _mm_castsi128_ps(_mm_set1_epi32(0x7FFFFFFF)); - //static const __m128 GLM_VAR_USED _epi32_mant_mask = _mm_castsi128_ps(_mm_set1_epi32(0x7F800000)); - //static const __m128 GLM_VAR_USED _epi32_inv_mant_mask = _mm_castsi128_ps(_mm_set1_epi32(0x807FFFFF)); - //static const __m128 GLM_VAR_USED _epi32_min_norm_pos = _mm_castsi128_ps(_mm_set1_epi32(0x00800000)); - static const __m128 GLM_VAR_USED _epi32_0 = _mm_set_ps1(0); - static const __m128 GLM_VAR_USED _epi32_1 = _mm_set_ps1(1); - static const __m128 GLM_VAR_USED _epi32_2 = _mm_set_ps1(2); - static const __m128 GLM_VAR_USED _epi32_3 = _mm_set_ps1(3); - static const __m128 GLM_VAR_USED _epi32_4 = _mm_set_ps1(4); - static const __m128 GLM_VAR_USED _epi32_5 = _mm_set_ps1(5); - static const __m128 GLM_VAR_USED _epi32_6 = _mm_set_ps1(6); - static const __m128 GLM_VAR_USED _epi32_7 = _mm_set_ps1(7); - static const __m128 GLM_VAR_USED _epi32_8 = _mm_set_ps1(8); - static const __m128 GLM_VAR_USED _epi32_9 = _mm_set_ps1(9); - static const __m128 GLM_VAR_USED _epi32_127 = _mm_set_ps1(127); - //static const __m128 GLM_VAR_USED _epi32_ninf = _mm_castsi128_ps(_mm_set1_epi32(0xFF800000)); - //static const __m128 GLM_VAR_USED _epi32_pinf = _mm_castsi128_ps(_mm_set1_epi32(0x7F800000)); - - static const __m128 GLM_VAR_USED _ps_1_3 = _mm_set_ps1(0.33333333333333333333333333333333f); - static const __m128 GLM_VAR_USED _ps_0p5 = _mm_set_ps1(0.5f); - static const __m128 GLM_VAR_USED _ps_1 = _mm_set_ps1(1.0f); - static const __m128 GLM_VAR_USED _ps_m1 = _mm_set_ps1(-1.0f); - static const __m128 GLM_VAR_USED _ps_2 = _mm_set_ps1(2.0f); - static const __m128 GLM_VAR_USED _ps_3 = _mm_set_ps1(3.0f); - static const __m128 GLM_VAR_USED _ps_127 = _mm_set_ps1(127.0f); - static const __m128 GLM_VAR_USED _ps_255 = _mm_set_ps1(255.0f); - static const __m128 GLM_VAR_USED _ps_2pow23 = _mm_set_ps1(8388608.0f); - - static const __m128 GLM_VAR_USED _ps_1_0_0_0 = _mm_set_ps(1.0f, 0.0f, 0.0f, 0.0f); - static const __m128 GLM_VAR_USED _ps_0_1_0_0 = _mm_set_ps(0.0f, 1.0f, 0.0f, 0.0f); - static const __m128 GLM_VAR_USED _ps_0_0_1_0 = _mm_set_ps(0.0f, 0.0f, 1.0f, 0.0f); - static const __m128 GLM_VAR_USED _ps_0_0_0_1 = _mm_set_ps(0.0f, 0.0f, 0.0f, 1.0f); - - static const __m128 GLM_VAR_USED _ps_pi = _mm_set_ps1(3.1415926535897932384626433832795f); - static const __m128 GLM_VAR_USED _ps_pi2 = _mm_set_ps1(6.283185307179586476925286766560f); - static const __m128 GLM_VAR_USED _ps_2_pi = _mm_set_ps1(0.63661977236758134307553505349006f); - static const __m128 GLM_VAR_USED _ps_pi_2 = _mm_set_ps1(1.5707963267948966192313216916398f); - static const __m128 GLM_VAR_USED _ps_4_pi = _mm_set_ps1(1.2732395447351626861510701069801f); - static const __m128 GLM_VAR_USED _ps_pi_4 = _mm_set_ps1(0.78539816339744830961566084581988f); - - static const __m128 GLM_VAR_USED _ps_sincos_p0 = _mm_set_ps1(0.15707963267948963959e1f); - static const __m128 GLM_VAR_USED _ps_sincos_p1 = _mm_set_ps1(-0.64596409750621907082e0f); - static const __m128 GLM_VAR_USED _ps_sincos_p2 = _mm_set_ps1(0.7969262624561800806e-1f); - static const __m128 GLM_VAR_USED _ps_sincos_p3 = _mm_set_ps1(-0.468175413106023168e-2f); - static const __m128 GLM_VAR_USED _ps_tan_p0 = _mm_set_ps1(-1.79565251976484877988e7f); - static const __m128 GLM_VAR_USED _ps_tan_p1 = _mm_set_ps1(1.15351664838587416140e6f); - static const __m128 GLM_VAR_USED _ps_tan_p2 = _mm_set_ps1(-1.30936939181383777646e4f); - static const __m128 GLM_VAR_USED _ps_tan_q0 = _mm_set_ps1(-5.38695755929454629881e7f); - static const __m128 GLM_VAR_USED _ps_tan_q1 = _mm_set_ps1(2.50083801823357915839e7f); - static const __m128 GLM_VAR_USED _ps_tan_q2 = _mm_set_ps1(-1.32089234440210967447e6f); - static const __m128 GLM_VAR_USED _ps_tan_q3 = _mm_set_ps1(1.36812963470692954678e4f); - static const __m128 GLM_VAR_USED _ps_tan_poleval = _mm_set_ps1(3.68935e19f); - static const __m128 GLM_VAR_USED _ps_atan_t0 = _mm_set_ps1(-0.91646118527267623468e-1f); - static const __m128 GLM_VAR_USED _ps_atan_t1 = _mm_set_ps1(-0.13956945682312098640e1f); - static const __m128 GLM_VAR_USED _ps_atan_t2 = _mm_set_ps1(-0.94393926122725531747e2f); - static const __m128 GLM_VAR_USED _ps_atan_t3 = _mm_set_ps1(0.12888383034157279340e2f); - static const __m128 GLM_VAR_USED _ps_atan_s0 = _mm_set_ps1(0.12797564625607904396e1f); - static const __m128 GLM_VAR_USED _ps_atan_s1 = _mm_set_ps1(0.21972168858277355914e1f); - static const __m128 GLM_VAR_USED _ps_atan_s2 = _mm_set_ps1(0.68193064729268275701e1f); - static const __m128 GLM_VAR_USED _ps_atan_s3 = _mm_set_ps1(0.28205206687035841409e2f); - - static const __m128 GLM_VAR_USED _ps_exp_hi = _mm_set_ps1(88.3762626647949f); - static const __m128 GLM_VAR_USED _ps_exp_lo = _mm_set_ps1(-88.3762626647949f); - static const __m128 GLM_VAR_USED _ps_exp_rln2 = _mm_set_ps1(1.4426950408889634073599f); - static const __m128 GLM_VAR_USED _ps_exp_p0 = _mm_set_ps1(1.26177193074810590878e-4f); - static const __m128 GLM_VAR_USED _ps_exp_p1 = _mm_set_ps1(3.02994407707441961300e-2f); - static const __m128 GLM_VAR_USED _ps_exp_q0 = _mm_set_ps1(3.00198505138664455042e-6f); - static const __m128 GLM_VAR_USED _ps_exp_q1 = _mm_set_ps1(2.52448340349684104192e-3f); - static const __m128 GLM_VAR_USED _ps_exp_q2 = _mm_set_ps1(2.27265548208155028766e-1f); - static const __m128 GLM_VAR_USED _ps_exp_q3 = _mm_set_ps1(2.00000000000000000009e0f); - static const __m128 GLM_VAR_USED _ps_exp_c1 = _mm_set_ps1(6.93145751953125e-1f); - static const __m128 GLM_VAR_USED _ps_exp_c2 = _mm_set_ps1(1.42860682030941723212e-6f); - static const __m128 GLM_VAR_USED _ps_exp2_hi = _mm_set_ps1(127.4999961853f); - static const __m128 GLM_VAR_USED _ps_exp2_lo = _mm_set_ps1(-127.4999961853f); - static const __m128 GLM_VAR_USED _ps_exp2_p0 = _mm_set_ps1(2.30933477057345225087e-2f); - static const __m128 GLM_VAR_USED _ps_exp2_p1 = _mm_set_ps1(2.02020656693165307700e1f); - static const __m128 GLM_VAR_USED _ps_exp2_p2 = _mm_set_ps1(1.51390680115615096133e3f); - static const __m128 GLM_VAR_USED _ps_exp2_q0 = _mm_set_ps1(2.33184211722314911771e2f); - static const __m128 GLM_VAR_USED _ps_exp2_q1 = _mm_set_ps1(4.36821166879210612817e3f); - static const __m128 GLM_VAR_USED _ps_log_p0 = _mm_set_ps1(-7.89580278884799154124e-1f); - static const __m128 GLM_VAR_USED _ps_log_p1 = _mm_set_ps1(1.63866645699558079767e1f); - static const __m128 GLM_VAR_USED _ps_log_p2 = _mm_set_ps1(-6.41409952958715622951e1f); - static const __m128 GLM_VAR_USED _ps_log_q0 = _mm_set_ps1(-3.56722798256324312549e1f); - static const __m128 GLM_VAR_USED _ps_log_q1 = _mm_set_ps1(3.12093766372244180303e2f); - static const __m128 GLM_VAR_USED _ps_log_q2 = _mm_set_ps1(-7.69691943550460008604e2f); - static const __m128 GLM_VAR_USED _ps_log_c0 = _mm_set_ps1(0.693147180559945f); - static const __m128 GLM_VAR_USED _ps_log2_c0 = _mm_set_ps1(1.44269504088896340735992f); - -GLM_FUNC_QUALIFIER __m128 sse_abs_ps(__m128 x) -{ - return _mm_and_ps(glm::detail::abs4Mask, x); -} - -GLM_FUNC_QUALIFIER __m128 sse_sgn_ps(__m128 x) -{ - __m128 Neg = _mm_set1_ps(-1.0f); - __m128 Pos = _mm_set1_ps(1.0f); - - __m128 Cmp0 = _mm_cmplt_ps(x, zero); - __m128 Cmp1 = _mm_cmpgt_ps(x, zero); - - __m128 And0 = _mm_and_ps(Cmp0, Neg); - __m128 And1 = _mm_and_ps(Cmp1, Pos); - - return _mm_or_ps(And0, And1); -} - -//floor -GLM_FUNC_QUALIFIER __m128 sse_flr_ps(__m128 x) -{ - __m128 rnd0 = sse_rnd_ps(x); - __m128 cmp0 = _mm_cmplt_ps(x, rnd0); - __m128 and0 = _mm_and_ps(cmp0, glm::detail::_ps_1); - __m128 sub0 = _mm_sub_ps(rnd0, and0); - return sub0; -} - -//trunc -/* -GLM_FUNC_QUALIFIER __m128 _mm_trc_ps(__m128 v) -{ - return __m128(); -} -*/ -//round -GLM_FUNC_QUALIFIER __m128 sse_rnd_ps(__m128 x) -{ - __m128 and0 = _mm_and_ps(glm::detail::_epi32_sign_mask, x); - __m128 or0 = _mm_or_ps(and0, glm::detail::_ps_2pow23); - __m128 add0 = _mm_add_ps(x, or0); - __m128 sub0 = _mm_sub_ps(add0, or0); - return sub0; -} - -//roundEven -GLM_FUNC_QUALIFIER __m128 sse_rde_ps(__m128 x) -{ - __m128 and0 = _mm_and_ps(glm::detail::_epi32_sign_mask, x); - __m128 or0 = _mm_or_ps(and0, glm::detail::_ps_2pow23); - __m128 add0 = _mm_add_ps(x, or0); - __m128 sub0 = _mm_sub_ps(add0, or0); - return sub0; -} - -GLM_FUNC_QUALIFIER __m128 sse_ceil_ps(__m128 x) -{ - __m128 rnd0 = sse_rnd_ps(x); - __m128 cmp0 = _mm_cmpgt_ps(x, rnd0); - __m128 and0 = _mm_and_ps(cmp0, glm::detail::_ps_1); - __m128 add0 = _mm_add_ps(rnd0, and0); - return add0; -} - -GLM_FUNC_QUALIFIER __m128 sse_frc_ps(__m128 x) -{ - __m128 flr0 = sse_flr_ps(x); - __m128 sub0 = _mm_sub_ps(x, flr0); - return sub0; -} - -GLM_FUNC_QUALIFIER __m128 sse_mod_ps(__m128 x, __m128 y) -{ - __m128 div0 = _mm_div_ps(x, y); - __m128 flr0 = sse_flr_ps(div0); - __m128 mul0 = _mm_mul_ps(y, flr0); - __m128 sub0 = _mm_sub_ps(x, mul0); - return sub0; -} - -/// TODO -/* -GLM_FUNC_QUALIFIER __m128 sse_modf_ps(__m128 x, __m128i & i) -{ - __m128 empty; - return empty; -} -*/ - -//GLM_FUNC_QUALIFIER __m128 _mm_min_ps(__m128 x, __m128 y) - -//GLM_FUNC_QUALIFIER __m128 _mm_max_ps(__m128 x, __m128 y) - -GLM_FUNC_QUALIFIER __m128 sse_clp_ps(__m128 v, __m128 minVal, __m128 maxVal) -{ - __m128 min0 = _mm_min_ps(v, maxVal); - __m128 max0 = _mm_max_ps(min0, minVal); - return max0; -} - -GLM_FUNC_QUALIFIER __m128 sse_mix_ps(__m128 v1, __m128 v2, __m128 a) -{ - __m128 sub0 = _mm_sub_ps(glm::detail::one, a); - __m128 mul0 = _mm_mul_ps(v1, sub0); - __m128 mul1 = _mm_mul_ps(v2, a); - __m128 add0 = _mm_add_ps(mul0, mul1); - return add0; -} - -GLM_FUNC_QUALIFIER __m128 sse_stp_ps(__m128 edge, __m128 x) -{ - __m128 cmp = _mm_cmple_ps(x, edge); - if(_mm_movemask_ps(cmp) == 0) - return glm::detail::one; - else - return glm::detail::zero; -} - -GLM_FUNC_QUALIFIER __m128 sse_ssp_ps(__m128 edge0, __m128 edge1, __m128 x) -{ - __m128 sub0 = _mm_sub_ps(x, edge0); - __m128 sub1 = _mm_sub_ps(edge1, edge0); - __m128 div0 = _mm_sub_ps(sub0, sub1); - __m128 clp0 = sse_clp_ps(div0, glm::detail::zero, glm::detail::one); - __m128 mul0 = _mm_mul_ps(glm::detail::two, clp0); - __m128 sub2 = _mm_sub_ps(glm::detail::three, mul0); - __m128 mul1 = _mm_mul_ps(clp0, clp0); - __m128 mul2 = _mm_mul_ps(mul1, sub2); - return mul2; -} - -/// \todo -//GLM_FUNC_QUALIFIER __m128 sse_nan_ps(__m128 x) -//{ -// __m128 empty; -// return empty; -//} - -/// \todo -//GLM_FUNC_QUALIFIER __m128 sse_inf_ps(__m128 x) -//{ -// __m128 empty; -// return empty; -//} - -// SSE scalar reciprocal sqrt using rsqrt op, plus one Newton-Rhaphson iteration -// By Elan Ruskin, http://assemblyrequired.crashworks.org/ -GLM_FUNC_QUALIFIER __m128 sse_sqrt_wip_ss(__m128 const & x) -{ - __m128 const recip = _mm_rsqrt_ss(x); // "estimate" opcode - __m128 const half = _mm_set_ps1(0.5f); - __m128 const halfrecip = _mm_mul_ss(half, recip); - __m128 const threeminus_xrr = _mm_sub_ss(three, _mm_mul_ss(x, _mm_mul_ss (recip, recip))); - return _mm_mul_ss(halfrecip, threeminus_xrr); -} - -}//namespace detail -}//namespace glms - diff --git a/extensions/common/glm/detail/intrinsic_exponential.hpp b/extensions/common/glm/detail/intrinsic_exponential.hpp deleted file mode 100644 index 63ab37e70f4..00000000000 --- a/extensions/common/glm/detail/intrinsic_exponential.hpp +++ /dev/null @@ -1,77 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/intrinsic_exponential.hpp -/// @date 2009-05-11 / 2011-06-15 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "setup.hpp" - -#if(!(GLM_ARCH & GLM_ARCH_SSE2)) -# error "SSE2 instructions not supported or enabled" -#else - -namespace glm{ -namespace detail -{ -/* -GLM_FUNC_QUALIFIER __m128 sse_rsqrt_nr_ss(__m128 const x) -{ - __m128 recip = _mm_rsqrt_ss( x ); // "estimate" opcode - const static __m128 three = { 3, 3, 3, 3 }; // aligned consts for fast load - const static __m128 half = { 0.5,0.5,0.5,0.5 }; - __m128 halfrecip = _mm_mul_ss( half, recip ); - __m128 threeminus_xrr = _mm_sub_ss( three, _mm_mul_ss( x, _mm_mul_ss ( recip, recip ) ) ); - return _mm_mul_ss( halfrecip, threeminus_xrr ); -} - -GLM_FUNC_QUALIFIER __m128 sse_normalize_fast_ps( float * RESTRICT vOut, float * RESTRICT vIn ) -{ - __m128 x = _mm_load_ss(&vIn[0]); - __m128 y = _mm_load_ss(&vIn[1]); - __m128 z = _mm_load_ss(&vIn[2]); - - const __m128 l = // compute x*x + y*y + z*z - _mm_add_ss( - _mm_add_ss( _mm_mul_ss(x,x), - _mm_mul_ss(y,y) - ), - _mm_mul_ss( z, z ) - ); - - - const __m128 rsqt = _mm_rsqrt_nr_ss( l ); - _mm_store_ss( &vOut[0] , _mm_mul_ss( rsqt, x ) ); - _mm_store_ss( &vOut[1] , _mm_mul_ss( rsqt, y ) ); - _mm_store_ss( &vOut[2] , _mm_mul_ss( rsqt, z ) ); - - return _mm_mul_ss( l , rsqt ); -} -*/ -}//namespace detail -}//namespace glm - -#endif//GLM_ARCH diff --git a/extensions/common/glm/detail/intrinsic_exponential.inl b/extensions/common/glm/detail/intrinsic_exponential.inl deleted file mode 100644 index 9dba23cd6cf..00000000000 --- a/extensions/common/glm/detail/intrinsic_exponential.inl +++ /dev/null @@ -1,27 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/intrinsic_exponential.inl -/// @date 2011-06-15 / 2011-06-15 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// diff --git a/extensions/common/glm/detail/intrinsic_geometric.hpp b/extensions/common/glm/detail/intrinsic_geometric.hpp deleted file mode 100644 index fa455cc1586..00000000000 --- a/extensions/common/glm/detail/intrinsic_geometric.hpp +++ /dev/null @@ -1,74 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/intrinsic_geometric.hpp -/// @date 2009-05-08 / 2011-06-15 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "setup.hpp" - -#if(!(GLM_ARCH & GLM_ARCH_SSE2)) -# error "SSE2 instructions not supported or enabled" -#else - -#include "intrinsic_common.hpp" - -namespace glm{ -namespace detail -{ - //length - __m128 sse_len_ps(__m128 x); - - //distance - __m128 sse_dst_ps(__m128 p0, __m128 p1); - - //dot - __m128 sse_dot_ps(__m128 v1, __m128 v2); - - // SSE1 - __m128 sse_dot_ss(__m128 v1, __m128 v2); - - //cross - __m128 sse_xpd_ps(__m128 v1, __m128 v2); - - //normalize - __m128 sse_nrm_ps(__m128 v); - - //faceforward - __m128 sse_ffd_ps(__m128 N, __m128 I, __m128 Nref); - - //reflect - __m128 sse_rfe_ps(__m128 I, __m128 N); - - //refract - __m128 sse_rfa_ps(__m128 I, __m128 N, __m128 eta); - -}//namespace detail -}//namespace glm - -#include "intrinsic_geometric.inl" - -#endif//GLM_ARCH diff --git a/extensions/common/glm/detail/intrinsic_geometric.inl b/extensions/common/glm/detail/intrinsic_geometric.inl deleted file mode 100644 index 3a3e4b0868d..00000000000 --- a/extensions/common/glm/detail/intrinsic_geometric.inl +++ /dev/null @@ -1,147 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/intrinsic_geometric.inl -/// @date 2009-05-08 / 2011-06-15 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -namespace glm{ -namespace detail{ - -//length -GLM_FUNC_QUALIFIER __m128 sse_len_ps(__m128 x) -{ - __m128 dot0 = sse_dot_ps(x, x); - __m128 sqt0 = _mm_sqrt_ps(dot0); - return sqt0; -} - -//distance -GLM_FUNC_QUALIFIER __m128 sse_dst_ps(__m128 p0, __m128 p1) -{ - __m128 sub0 = _mm_sub_ps(p0, p1); - __m128 len0 = sse_len_ps(sub0); - return len0; -} - -//dot -GLM_FUNC_QUALIFIER __m128 sse_dot_ps(__m128 v1, __m128 v2) -{ - -# if(GLM_ARCH & GLM_ARCH_AVX) - return _mm_dp_ps(v1, v2, 0xff); -# else - __m128 mul0 = _mm_mul_ps(v1, v2); - __m128 swp0 = _mm_shuffle_ps(mul0, mul0, _MM_SHUFFLE(2, 3, 0, 1)); - __m128 add0 = _mm_add_ps(mul0, swp0); - __m128 swp1 = _mm_shuffle_ps(add0, add0, _MM_SHUFFLE(0, 1, 2, 3)); - __m128 add1 = _mm_add_ps(add0, swp1); - return add1; -# endif -} - -// SSE1 -GLM_FUNC_QUALIFIER __m128 sse_dot_ss(__m128 v1, __m128 v2) -{ - __m128 mul0 = _mm_mul_ps(v1, v2); - __m128 mov0 = _mm_movehl_ps(mul0, mul0); - __m128 add0 = _mm_add_ps(mov0, mul0); - __m128 swp1 = _mm_shuffle_ps(add0, add0, 1); - __m128 add1 = _mm_add_ss(add0, swp1); - return add1; -} - -//cross -GLM_FUNC_QUALIFIER __m128 sse_xpd_ps(__m128 v1, __m128 v2) -{ - __m128 swp0 = _mm_shuffle_ps(v1, v1, _MM_SHUFFLE(3, 0, 2, 1)); - __m128 swp1 = _mm_shuffle_ps(v1, v1, _MM_SHUFFLE(3, 1, 0, 2)); - __m128 swp2 = _mm_shuffle_ps(v2, v2, _MM_SHUFFLE(3, 0, 2, 1)); - __m128 swp3 = _mm_shuffle_ps(v2, v2, _MM_SHUFFLE(3, 1, 0, 2)); - __m128 mul0 = _mm_mul_ps(swp0, swp3); - __m128 mul1 = _mm_mul_ps(swp1, swp2); - __m128 sub0 = _mm_sub_ps(mul0, mul1); - return sub0; -} - -//normalize -GLM_FUNC_QUALIFIER __m128 sse_nrm_ps(__m128 v) -{ - __m128 dot0 = sse_dot_ps(v, v); - __m128 isr0 = _mm_rsqrt_ps(dot0); - __m128 mul0 = _mm_mul_ps(v, isr0); - return mul0; -} - -//faceforward -GLM_FUNC_QUALIFIER __m128 sse_ffd_ps(__m128 N, __m128 I, __m128 Nref) -{ - //__m128 dot0 = _mm_dot_ps(v, v); - //__m128 neg0 = _mm_neg_ps(N); - //__m128 sgn0 = _mm_sgn_ps(dot0); - //__m128 mix0 = _mm_mix_ps(N, neg0, sgn0); - //return mix0; - - __m128 dot0 = sse_dot_ps(Nref, I); - __m128 sgn0 = sse_sgn_ps(dot0); - __m128 mul0 = _mm_mul_ps(sgn0, glm::detail::minus_one); - __m128 mul1 = _mm_mul_ps(N, mul0); - return mul1; -} - -//reflect -GLM_FUNC_QUALIFIER __m128 sse_rfe_ps(__m128 I, __m128 N) -{ - __m128 dot0 = sse_dot_ps(N, I); - __m128 mul0 = _mm_mul_ps(N, dot0); - __m128 mul1 = _mm_mul_ps(mul0, glm::detail::two); - __m128 sub0 = _mm_sub_ps(I, mul1); - return sub0; -} - -//refract -GLM_FUNC_QUALIFIER __m128 sse_rfa_ps(__m128 I, __m128 N, __m128 eta) -{ - __m128 dot0 = sse_dot_ps(N, I); - __m128 mul0 = _mm_mul_ps(eta, eta); - __m128 mul1 = _mm_mul_ps(dot0, dot0); - __m128 sub0 = _mm_sub_ps(glm::detail::one, mul0); - __m128 sub1 = _mm_sub_ps(glm::detail::one, mul1); - __m128 mul2 = _mm_mul_ps(sub0, sub1); - - if(_mm_movemask_ps(_mm_cmplt_ss(mul2, glm::detail::zero)) == 0) - return glm::detail::zero; - - __m128 sqt0 = _mm_sqrt_ps(mul2); - __m128 mul3 = _mm_mul_ps(eta, dot0); - __m128 add0 = _mm_add_ps(mul3, sqt0); - __m128 mul4 = _mm_mul_ps(add0, N); - __m128 mul5 = _mm_mul_ps(eta, I); - __m128 sub2 = _mm_sub_ps(mul5, mul4); - - return sub2; -} - -}//namespace detail -}//namespace glm diff --git a/extensions/common/glm/detail/intrinsic_integer.hpp b/extensions/common/glm/detail/intrinsic_integer.hpp deleted file mode 100644 index 086193b8cc9..00000000000 --- a/extensions/common/glm/detail/intrinsic_integer.hpp +++ /dev/null @@ -1,48 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/intrinsic_integer.hpp -/// @date 2009-05-11 / 2011-06-15 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "glm/glm.hpp" - -#if(!(GLM_ARCH & GLM_ARCH_SSE2)) -# error "SSE2 instructions not supported or enabled" -#else - -namespace glm{ -namespace detail -{ - __m128i _mm_bit_interleave_si128(__m128i x); - __m128i _mm_bit_interleave_si128(__m128i x, __m128i y); - -}//namespace detail -}//namespace glm - -#include "intrinsic_integer.inl" - -#endif//GLM_ARCH diff --git a/extensions/common/glm/detail/intrinsic_integer.inl b/extensions/common/glm/detail/intrinsic_integer.inl deleted file mode 100644 index 90426e349a1..00000000000 --- a/extensions/common/glm/detail/intrinsic_integer.inl +++ /dev/null @@ -1,139 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/intrinsic_integer.inl -/// @date 2009-05-08 / 2011-06-15 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -namespace glm{ -namespace detail -{ - inline __m128i _mm_bit_interleave_si128(__m128i x) - { - __m128i const Mask4 = _mm_set1_epi32(0x0000FFFF); - __m128i const Mask3 = _mm_set1_epi32(0x00FF00FF); - __m128i const Mask2 = _mm_set1_epi32(0x0F0F0F0F); - __m128i const Mask1 = _mm_set1_epi32(0x33333333); - __m128i const Mask0 = _mm_set1_epi32(0x55555555); - - __m128i Reg1; - __m128i Reg2; - - // REG1 = x; - // REG2 = y; - //Reg1 = _mm_unpacklo_epi64(x, y); - Reg1 = x; - - //REG1 = ((REG1 << 16) | REG1) & glm::uint64(0x0000FFFF0000FFFF); - //REG2 = ((REG2 << 16) | REG2) & glm::uint64(0x0000FFFF0000FFFF); - Reg2 = _mm_slli_si128(Reg1, 2); - Reg1 = _mm_or_si128(Reg2, Reg1); - Reg1 = _mm_and_si128(Reg1, Mask4); - - //REG1 = ((REG1 << 8) | REG1) & glm::uint64(0x00FF00FF00FF00FF); - //REG2 = ((REG2 << 8) | REG2) & glm::uint64(0x00FF00FF00FF00FF); - Reg2 = _mm_slli_si128(Reg1, 1); - Reg1 = _mm_or_si128(Reg2, Reg1); - Reg1 = _mm_and_si128(Reg1, Mask3); - - //REG1 = ((REG1 << 4) | REG1) & glm::uint64(0x0F0F0F0F0F0F0F0F); - //REG2 = ((REG2 << 4) | REG2) & glm::uint64(0x0F0F0F0F0F0F0F0F); - Reg2 = _mm_slli_epi32(Reg1, 4); - Reg1 = _mm_or_si128(Reg2, Reg1); - Reg1 = _mm_and_si128(Reg1, Mask2); - - //REG1 = ((REG1 << 2) | REG1) & glm::uint64(0x3333333333333333); - //REG2 = ((REG2 << 2) | REG2) & glm::uint64(0x3333333333333333); - Reg2 = _mm_slli_epi32(Reg1, 2); - Reg1 = _mm_or_si128(Reg2, Reg1); - Reg1 = _mm_and_si128(Reg1, Mask1); - - //REG1 = ((REG1 << 1) | REG1) & glm::uint64(0x5555555555555555); - //REG2 = ((REG2 << 1) | REG2) & glm::uint64(0x5555555555555555); - Reg2 = _mm_slli_epi32(Reg1, 1); - Reg1 = _mm_or_si128(Reg2, Reg1); - Reg1 = _mm_and_si128(Reg1, Mask0); - - //return REG1 | (REG2 << 1); - Reg2 = _mm_slli_epi32(Reg1, 1); - Reg2 = _mm_srli_si128(Reg2, 8); - Reg1 = _mm_or_si128(Reg1, Reg2); - - return Reg1; - } - - inline __m128i _mm_bit_interleave_si128(__m128i x, __m128i y) - { - __m128i const Mask4 = _mm_set1_epi32(0x0000FFFF); - __m128i const Mask3 = _mm_set1_epi32(0x00FF00FF); - __m128i const Mask2 = _mm_set1_epi32(0x0F0F0F0F); - __m128i const Mask1 = _mm_set1_epi32(0x33333333); - __m128i const Mask0 = _mm_set1_epi32(0x55555555); - - __m128i Reg1; - __m128i Reg2; - - // REG1 = x; - // REG2 = y; - Reg1 = _mm_unpacklo_epi64(x, y); - - //REG1 = ((REG1 << 16) | REG1) & glm::uint64(0x0000FFFF0000FFFF); - //REG2 = ((REG2 << 16) | REG2) & glm::uint64(0x0000FFFF0000FFFF); - Reg2 = _mm_slli_si128(Reg1, 2); - Reg1 = _mm_or_si128(Reg2, Reg1); - Reg1 = _mm_and_si128(Reg1, Mask4); - - //REG1 = ((REG1 << 8) | REG1) & glm::uint64(0x00FF00FF00FF00FF); - //REG2 = ((REG2 << 8) | REG2) & glm::uint64(0x00FF00FF00FF00FF); - Reg2 = _mm_slli_si128(Reg1, 1); - Reg1 = _mm_or_si128(Reg2, Reg1); - Reg1 = _mm_and_si128(Reg1, Mask3); - - //REG1 = ((REG1 << 4) | REG1) & glm::uint64(0x0F0F0F0F0F0F0F0F); - //REG2 = ((REG2 << 4) | REG2) & glm::uint64(0x0F0F0F0F0F0F0F0F); - Reg2 = _mm_slli_epi32(Reg1, 4); - Reg1 = _mm_or_si128(Reg2, Reg1); - Reg1 = _mm_and_si128(Reg1, Mask2); - - //REG1 = ((REG1 << 2) | REG1) & glm::uint64(0x3333333333333333); - //REG2 = ((REG2 << 2) | REG2) & glm::uint64(0x3333333333333333); - Reg2 = _mm_slli_epi32(Reg1, 2); - Reg1 = _mm_or_si128(Reg2, Reg1); - Reg1 = _mm_and_si128(Reg1, Mask1); - - //REG1 = ((REG1 << 1) | REG1) & glm::uint64(0x5555555555555555); - //REG2 = ((REG2 << 1) | REG2) & glm::uint64(0x5555555555555555); - Reg2 = _mm_slli_epi32(Reg1, 1); - Reg1 = _mm_or_si128(Reg2, Reg1); - Reg1 = _mm_and_si128(Reg1, Mask0); - - //return REG1 | (REG2 << 1); - Reg2 = _mm_slli_epi32(Reg1, 1); - Reg2 = _mm_srli_si128(Reg2, 8); - Reg1 = _mm_or_si128(Reg1, Reg2); - - return Reg1; - } -}//namespace detail -}//namespace glms diff --git a/extensions/common/glm/detail/intrinsic_matrix.hpp b/extensions/common/glm/detail/intrinsic_matrix.hpp deleted file mode 100644 index ad01c9f4028..00000000000 --- a/extensions/common/glm/detail/intrinsic_matrix.hpp +++ /dev/null @@ -1,67 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/intrinsic_common.hpp -/// @date 2009-06-05 / 2011-06-15 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "setup.hpp" - -#if(!(GLM_ARCH & GLM_ARCH_SSE2)) -# error "SSE2 instructions not supported or enabled" -#else - -#include "intrinsic_geometric.hpp" - -namespace glm{ -namespace detail -{ - void sse_add_ps(__m128 in1[4], __m128 in2[4], __m128 out[4]); - - void sse_sub_ps(__m128 in1[4], __m128 in2[4], __m128 out[4]); - - __m128 sse_mul_ps(__m128 m[4], __m128 v); - - __m128 sse_mul_ps(__m128 v, __m128 m[4]); - - void sse_mul_ps(__m128 const in1[4], __m128 const in2[4], __m128 out[4]); - - void sse_transpose_ps(__m128 const in[4], __m128 out[4]); - - void sse_inverse_ps(__m128 const in[4], __m128 out[4]); - - void sse_rotate_ps(__m128 const in[4], float Angle, float const v[3], __m128 out[4]); - - __m128 sse_det_ps(__m128 const m[4]); - - __m128 sse_slow_det_ps(__m128 const m[4]); - -}//namespace detail -}//namespace glm - -#include "intrinsic_matrix.inl" - -#endif//GLM_ARCH diff --git a/extensions/common/glm/detail/intrinsic_matrix.inl b/extensions/common/glm/detail/intrinsic_matrix.inl deleted file mode 100644 index 380ffe4aeec..00000000000 --- a/extensions/common/glm/detail/intrinsic_matrix.inl +++ /dev/null @@ -1,1070 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/intrinsic_common.inl -/// @date 2009-06-05 / 2011-06-15 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -namespace glm{ -namespace detail{ - -static const __m128 GLM_VAR_USED _m128_rad_ps = _mm_set_ps1(3.141592653589793238462643383279f / 180.f); -static const __m128 GLM_VAR_USED _m128_deg_ps = _mm_set_ps1(180.f / 3.141592653589793238462643383279f); - -template <typename matType> -GLM_FUNC_QUALIFIER matType sse_comp_mul_ps -( - __m128 const in1[4], - __m128 const in2[4], - __m128 out[4] -) -{ - out[0] = _mm_mul_ps(in1[0], in2[0]); - out[1] = _mm_mul_ps(in1[1], in2[1]); - out[2] = _mm_mul_ps(in1[2], in2[2]); - out[3] = _mm_mul_ps(in1[3], in2[3]); -} - -GLM_FUNC_QUALIFIER void sse_add_ps(__m128 const in1[4], __m128 const in2[4], __m128 out[4]) -{ - { - out[0] = _mm_add_ps(in1[0], in2[0]); - out[1] = _mm_add_ps(in1[1], in2[1]); - out[2] = _mm_add_ps(in1[2], in2[2]); - out[3] = _mm_add_ps(in1[3], in2[3]); - } -} - -GLM_FUNC_QUALIFIER void sse_sub_ps(__m128 const in1[4], __m128 const in2[4], __m128 out[4]) -{ - { - out[0] = _mm_sub_ps(in1[0], in2[0]); - out[1] = _mm_sub_ps(in1[1], in2[1]); - out[2] = _mm_sub_ps(in1[2], in2[2]); - out[3] = _mm_sub_ps(in1[3], in2[3]); - } -} - -GLM_FUNC_QUALIFIER __m128 sse_mul_ps(__m128 const m[4], __m128 v) -{ - __m128 v0 = _mm_shuffle_ps(v, v, _MM_SHUFFLE(0, 0, 0, 0)); - __m128 v1 = _mm_shuffle_ps(v, v, _MM_SHUFFLE(1, 1, 1, 1)); - __m128 v2 = _mm_shuffle_ps(v, v, _MM_SHUFFLE(2, 2, 2, 2)); - __m128 v3 = _mm_shuffle_ps(v, v, _MM_SHUFFLE(3, 3, 3, 3)); - - __m128 m0 = _mm_mul_ps(m[0], v0); - __m128 m1 = _mm_mul_ps(m[1], v1); - __m128 m2 = _mm_mul_ps(m[2], v2); - __m128 m3 = _mm_mul_ps(m[3], v3); - - __m128 a0 = _mm_add_ps(m0, m1); - __m128 a1 = _mm_add_ps(m2, m3); - __m128 a2 = _mm_add_ps(a0, a1); - - return a2; -} - -GLM_FUNC_QUALIFIER __m128 sse_mul_ps(__m128 v, __m128 const m[4]) -{ - __m128 i0 = m[0]; - __m128 i1 = m[1]; - __m128 i2 = m[2]; - __m128 i3 = m[3]; - - __m128 m0 = _mm_mul_ps(v, i0); - __m128 m1 = _mm_mul_ps(v, i1); - __m128 m2 = _mm_mul_ps(v, i2); - __m128 m3 = _mm_mul_ps(v, i3); - - __m128 u0 = _mm_unpacklo_ps(m0, m1); - __m128 u1 = _mm_unpackhi_ps(m0, m1); - __m128 a0 = _mm_add_ps(u0, u1); - - __m128 u2 = _mm_unpacklo_ps(m2, m3); - __m128 u3 = _mm_unpackhi_ps(m2, m3); - __m128 a1 = _mm_add_ps(u2, u3); - - __m128 f0 = _mm_movelh_ps(a0, a1); - __m128 f1 = _mm_movehl_ps(a1, a0); - __m128 f2 = _mm_add_ps(f0, f1); - - return f2; -} - -GLM_FUNC_QUALIFIER void sse_mul_ps(__m128 const in1[4], __m128 const in2[4], __m128 out[4]) -{ - { - __m128 e0 = _mm_shuffle_ps(in2[0], in2[0], _MM_SHUFFLE(0, 0, 0, 0)); - __m128 e1 = _mm_shuffle_ps(in2[0], in2[0], _MM_SHUFFLE(1, 1, 1, 1)); - __m128 e2 = _mm_shuffle_ps(in2[0], in2[0], _MM_SHUFFLE(2, 2, 2, 2)); - __m128 e3 = _mm_shuffle_ps(in2[0], in2[0], _MM_SHUFFLE(3, 3, 3, 3)); - - __m128 m0 = _mm_mul_ps(in1[0], e0); - __m128 m1 = _mm_mul_ps(in1[1], e1); - __m128 m2 = _mm_mul_ps(in1[2], e2); - __m128 m3 = _mm_mul_ps(in1[3], e3); - - __m128 a0 = _mm_add_ps(m0, m1); - __m128 a1 = _mm_add_ps(m2, m3); - __m128 a2 = _mm_add_ps(a0, a1); - - out[0] = a2; - } - - { - __m128 e0 = _mm_shuffle_ps(in2[1], in2[1], _MM_SHUFFLE(0, 0, 0, 0)); - __m128 e1 = _mm_shuffle_ps(in2[1], in2[1], _MM_SHUFFLE(1, 1, 1, 1)); - __m128 e2 = _mm_shuffle_ps(in2[1], in2[1], _MM_SHUFFLE(2, 2, 2, 2)); - __m128 e3 = _mm_shuffle_ps(in2[1], in2[1], _MM_SHUFFLE(3, 3, 3, 3)); - - __m128 m0 = _mm_mul_ps(in1[0], e0); - __m128 m1 = _mm_mul_ps(in1[1], e1); - __m128 m2 = _mm_mul_ps(in1[2], e2); - __m128 m3 = _mm_mul_ps(in1[3], e3); - - __m128 a0 = _mm_add_ps(m0, m1); - __m128 a1 = _mm_add_ps(m2, m3); - __m128 a2 = _mm_add_ps(a0, a1); - - out[1] = a2; - } - - { - __m128 e0 = _mm_shuffle_ps(in2[2], in2[2], _MM_SHUFFLE(0, 0, 0, 0)); - __m128 e1 = _mm_shuffle_ps(in2[2], in2[2], _MM_SHUFFLE(1, 1, 1, 1)); - __m128 e2 = _mm_shuffle_ps(in2[2], in2[2], _MM_SHUFFLE(2, 2, 2, 2)); - __m128 e3 = _mm_shuffle_ps(in2[2], in2[2], _MM_SHUFFLE(3, 3, 3, 3)); - - __m128 m0 = _mm_mul_ps(in1[0], e0); - __m128 m1 = _mm_mul_ps(in1[1], e1); - __m128 m2 = _mm_mul_ps(in1[2], e2); - __m128 m3 = _mm_mul_ps(in1[3], e3); - - __m128 a0 = _mm_add_ps(m0, m1); - __m128 a1 = _mm_add_ps(m2, m3); - __m128 a2 = _mm_add_ps(a0, a1); - - out[2] = a2; - } - - { - //(__m128&)_mm_shuffle_epi32(__m128i&)in2[0], _MM_SHUFFLE(3, 3, 3, 3)) - __m128 e0 = _mm_shuffle_ps(in2[3], in2[3], _MM_SHUFFLE(0, 0, 0, 0)); - __m128 e1 = _mm_shuffle_ps(in2[3], in2[3], _MM_SHUFFLE(1, 1, 1, 1)); - __m128 e2 = _mm_shuffle_ps(in2[3], in2[3], _MM_SHUFFLE(2, 2, 2, 2)); - __m128 e3 = _mm_shuffle_ps(in2[3], in2[3], _MM_SHUFFLE(3, 3, 3, 3)); - - __m128 m0 = _mm_mul_ps(in1[0], e0); - __m128 m1 = _mm_mul_ps(in1[1], e1); - __m128 m2 = _mm_mul_ps(in1[2], e2); - __m128 m3 = _mm_mul_ps(in1[3], e3); - - __m128 a0 = _mm_add_ps(m0, m1); - __m128 a1 = _mm_add_ps(m2, m3); - __m128 a2 = _mm_add_ps(a0, a1); - - out[3] = a2; - } -} - -GLM_FUNC_QUALIFIER void sse_transpose_ps(__m128 const in[4], __m128 out[4]) -{ - __m128 tmp0 = _mm_shuffle_ps(in[0], in[1], 0x44); - __m128 tmp2 = _mm_shuffle_ps(in[0], in[1], 0xEE); - __m128 tmp1 = _mm_shuffle_ps(in[2], in[3], 0x44); - __m128 tmp3 = _mm_shuffle_ps(in[2], in[3], 0xEE); - - out[0] = _mm_shuffle_ps(tmp0, tmp1, 0x88); - out[1] = _mm_shuffle_ps(tmp0, tmp1, 0xDD); - out[2] = _mm_shuffle_ps(tmp2, tmp3, 0x88); - out[3] = _mm_shuffle_ps(tmp2, tmp3, 0xDD); -} - -GLM_FUNC_QUALIFIER __m128 sse_slow_det_ps(__m128 const in[4]) -{ - __m128 Fac0; - { - // valType SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; - // valType SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; - // valType SubFactor06 = m[1][2] * m[3][3] - m[3][2] * m[1][3]; - // valType SubFactor13 = m[1][2] * m[2][3] - m[2][2] * m[1][3]; - - __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(3, 3, 3, 3)); - __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(2, 2, 2, 2)); - - __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(2, 2, 2, 2)); - __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(3, 3, 3, 3)); - - __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); - __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); - Fac0 = _mm_sub_ps(Mul00, Mul01); - } - - __m128 Fac1; - { - // valType SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; - // valType SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; - // valType SubFactor07 = m[1][1] * m[3][3] - m[3][1] * m[1][3]; - // valType SubFactor14 = m[1][1] * m[2][3] - m[2][1] * m[1][3]; - - __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(3, 3, 3, 3)); - __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(1, 1, 1, 1)); - - __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(1, 1, 1, 1)); - __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(3, 3, 3, 3)); - - __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); - __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); - Fac1 = _mm_sub_ps(Mul00, Mul01); - } - - - __m128 Fac2; - { - // valType SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; - // valType SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; - // valType SubFactor08 = m[1][1] * m[3][2] - m[3][1] * m[1][2]; - // valType SubFactor15 = m[1][1] * m[2][2] - m[2][1] * m[1][2]; - - __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(2, 2, 2, 2)); - __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(1, 1, 1, 1)); - - __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(1, 1, 1, 1)); - __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(2, 2, 2, 2)); - - __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); - __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); - Fac2 = _mm_sub_ps(Mul00, Mul01); - } - - __m128 Fac3; - { - // valType SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; - // valType SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; - // valType SubFactor09 = m[1][0] * m[3][3] - m[3][0] * m[1][3]; - // valType SubFactor16 = m[1][0] * m[2][3] - m[2][0] * m[1][3]; - - __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(3, 3, 3, 3)); - __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(0, 0, 0, 0)); - - __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(0, 0, 0, 0)); - __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(3, 3, 3, 3)); - - __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); - __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); - Fac3 = _mm_sub_ps(Mul00, Mul01); - } - - __m128 Fac4; - { - // valType SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; - // valType SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; - // valType SubFactor10 = m[1][0] * m[3][2] - m[3][0] * m[1][2]; - // valType SubFactor17 = m[1][0] * m[2][2] - m[2][0] * m[1][2]; - - __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(2, 2, 2, 2)); - __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(0, 0, 0, 0)); - - __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(0, 0, 0, 0)); - __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(2, 2, 2, 2)); - - __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); - __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); - Fac4 = _mm_sub_ps(Mul00, Mul01); - } - - __m128 Fac5; - { - // valType SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; - // valType SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; - // valType SubFactor12 = m[1][0] * m[3][1] - m[3][0] * m[1][1]; - // valType SubFactor18 = m[1][0] * m[2][1] - m[2][0] * m[1][1]; - - __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(1, 1, 1, 1)); - __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(0, 0, 0, 0)); - - __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(0, 0, 0, 0)); - __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(1, 1, 1, 1)); - - __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); - __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); - Fac5 = _mm_sub_ps(Mul00, Mul01); - } - - __m128 SignA = _mm_set_ps( 1.0f,-1.0f, 1.0f,-1.0f); - __m128 SignB = _mm_set_ps(-1.0f, 1.0f,-1.0f, 1.0f); - - // m[1][0] - // m[0][0] - // m[0][0] - // m[0][0] - __m128 Temp0 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(0, 0, 0, 0)); - __m128 Vec0 = _mm_shuffle_ps(Temp0, Temp0, _MM_SHUFFLE(2, 2, 2, 0)); - - // m[1][1] - // m[0][1] - // m[0][1] - // m[0][1] - __m128 Temp1 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(1, 1, 1, 1)); - __m128 Vec1 = _mm_shuffle_ps(Temp1, Temp1, _MM_SHUFFLE(2, 2, 2, 0)); - - // m[1][2] - // m[0][2] - // m[0][2] - // m[0][2] - __m128 Temp2 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(2, 2, 2, 2)); - __m128 Vec2 = _mm_shuffle_ps(Temp2, Temp2, _MM_SHUFFLE(2, 2, 2, 0)); - - // m[1][3] - // m[0][3] - // m[0][3] - // m[0][3] - __m128 Temp3 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(3, 3, 3, 3)); - __m128 Vec3 = _mm_shuffle_ps(Temp3, Temp3, _MM_SHUFFLE(2, 2, 2, 0)); - - // col0 - // + (Vec1[0] * Fac0[0] - Vec2[0] * Fac1[0] + Vec3[0] * Fac2[0]), - // - (Vec1[1] * Fac0[1] - Vec2[1] * Fac1[1] + Vec3[1] * Fac2[1]), - // + (Vec1[2] * Fac0[2] - Vec2[2] * Fac1[2] + Vec3[2] * Fac2[2]), - // - (Vec1[3] * Fac0[3] - Vec2[3] * Fac1[3] + Vec3[3] * Fac2[3]), - __m128 Mul00 = _mm_mul_ps(Vec1, Fac0); - __m128 Mul01 = _mm_mul_ps(Vec2, Fac1); - __m128 Mul02 = _mm_mul_ps(Vec3, Fac2); - __m128 Sub00 = _mm_sub_ps(Mul00, Mul01); - __m128 Add00 = _mm_add_ps(Sub00, Mul02); - __m128 Inv0 = _mm_mul_ps(SignB, Add00); - - // col1 - // - (Vec0[0] * Fac0[0] - Vec2[0] * Fac3[0] + Vec3[0] * Fac4[0]), - // + (Vec0[0] * Fac0[1] - Vec2[1] * Fac3[1] + Vec3[1] * Fac4[1]), - // - (Vec0[0] * Fac0[2] - Vec2[2] * Fac3[2] + Vec3[2] * Fac4[2]), - // + (Vec0[0] * Fac0[3] - Vec2[3] * Fac3[3] + Vec3[3] * Fac4[3]), - __m128 Mul03 = _mm_mul_ps(Vec0, Fac0); - __m128 Mul04 = _mm_mul_ps(Vec2, Fac3); - __m128 Mul05 = _mm_mul_ps(Vec3, Fac4); - __m128 Sub01 = _mm_sub_ps(Mul03, Mul04); - __m128 Add01 = _mm_add_ps(Sub01, Mul05); - __m128 Inv1 = _mm_mul_ps(SignA, Add01); - - // col2 - // + (Vec0[0] * Fac1[0] - Vec1[0] * Fac3[0] + Vec3[0] * Fac5[0]), - // - (Vec0[0] * Fac1[1] - Vec1[1] * Fac3[1] + Vec3[1] * Fac5[1]), - // + (Vec0[0] * Fac1[2] - Vec1[2] * Fac3[2] + Vec3[2] * Fac5[2]), - // - (Vec0[0] * Fac1[3] - Vec1[3] * Fac3[3] + Vec3[3] * Fac5[3]), - __m128 Mul06 = _mm_mul_ps(Vec0, Fac1); - __m128 Mul07 = _mm_mul_ps(Vec1, Fac3); - __m128 Mul08 = _mm_mul_ps(Vec3, Fac5); - __m128 Sub02 = _mm_sub_ps(Mul06, Mul07); - __m128 Add02 = _mm_add_ps(Sub02, Mul08); - __m128 Inv2 = _mm_mul_ps(SignB, Add02); - - // col3 - // - (Vec1[0] * Fac2[0] - Vec1[0] * Fac4[0] + Vec2[0] * Fac5[0]), - // + (Vec1[0] * Fac2[1] - Vec1[1] * Fac4[1] + Vec2[1] * Fac5[1]), - // - (Vec1[0] * Fac2[2] - Vec1[2] * Fac4[2] + Vec2[2] * Fac5[2]), - // + (Vec1[0] * Fac2[3] - Vec1[3] * Fac4[3] + Vec2[3] * Fac5[3])); - __m128 Mul09 = _mm_mul_ps(Vec0, Fac2); - __m128 Mul10 = _mm_mul_ps(Vec1, Fac4); - __m128 Mul11 = _mm_mul_ps(Vec2, Fac5); - __m128 Sub03 = _mm_sub_ps(Mul09, Mul10); - __m128 Add03 = _mm_add_ps(Sub03, Mul11); - __m128 Inv3 = _mm_mul_ps(SignA, Add03); - - __m128 Row0 = _mm_shuffle_ps(Inv0, Inv1, _MM_SHUFFLE(0, 0, 0, 0)); - __m128 Row1 = _mm_shuffle_ps(Inv2, Inv3, _MM_SHUFFLE(0, 0, 0, 0)); - __m128 Row2 = _mm_shuffle_ps(Row0, Row1, _MM_SHUFFLE(2, 0, 2, 0)); - - // valType Determinant = m[0][0] * Inverse[0][0] - // + m[0][1] * Inverse[1][0] - // + m[0][2] * Inverse[2][0] - // + m[0][3] * Inverse[3][0]; - __m128 Det0 = sse_dot_ps(in[0], Row2); - return Det0; -} - -GLM_FUNC_QUALIFIER __m128 sse_detd_ps -( - __m128 const m[4] -) -{ - // _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128( - - //T SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; - //T SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; - //T SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; - //T SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; - //T SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; - //T SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; - - // First 2 columns - __m128 Swp2A = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(m[2]), _MM_SHUFFLE(0, 1, 1, 2))); - __m128 Swp3A = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(m[3]), _MM_SHUFFLE(3, 2, 3, 3))); - __m128 MulA = _mm_mul_ps(Swp2A, Swp3A); - - // Second 2 columns - __m128 Swp2B = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(m[2]), _MM_SHUFFLE(3, 2, 3, 3))); - __m128 Swp3B = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(m[3]), _MM_SHUFFLE(0, 1, 1, 2))); - __m128 MulB = _mm_mul_ps(Swp2B, Swp3B); - - // Columns subtraction - __m128 SubE = _mm_sub_ps(MulA, MulB); - - // Last 2 rows - __m128 Swp2C = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(m[2]), _MM_SHUFFLE(0, 0, 1, 2))); - __m128 Swp3C = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(m[3]), _MM_SHUFFLE(1, 2, 0, 0))); - __m128 MulC = _mm_mul_ps(Swp2C, Swp3C); - __m128 SubF = _mm_sub_ps(_mm_movehl_ps(MulC, MulC), MulC); - - //tvec4<T, P> DetCof( - // + (m[1][1] * SubFactor00 - m[1][2] * SubFactor01 + m[1][3] * SubFactor02), - // - (m[1][0] * SubFactor00 - m[1][2] * SubFactor03 + m[1][3] * SubFactor04), - // + (m[1][0] * SubFactor01 - m[1][1] * SubFactor03 + m[1][3] * SubFactor05), - // - (m[1][0] * SubFactor02 - m[1][1] * SubFactor04 + m[1][2] * SubFactor05)); - - __m128 SubFacA = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(SubE), _MM_SHUFFLE(2, 1, 0, 0))); - __m128 SwpFacA = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(m[1]), _MM_SHUFFLE(0, 0, 0, 1))); - __m128 MulFacA = _mm_mul_ps(SwpFacA, SubFacA); - - __m128 SubTmpB = _mm_shuffle_ps(SubE, SubF, _MM_SHUFFLE(0, 0, 3, 1)); - __m128 SubFacB = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(SubTmpB), _MM_SHUFFLE(3, 1, 1, 0)));//SubF[0], SubE[3], SubE[3], SubE[1]; - __m128 SwpFacB = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(m[1]), _MM_SHUFFLE(1, 1, 2, 2))); - __m128 MulFacB = _mm_mul_ps(SwpFacB, SubFacB); - - __m128 SubRes = _mm_sub_ps(MulFacA, MulFacB); - - __m128 SubTmpC = _mm_shuffle_ps(SubE, SubF, _MM_SHUFFLE(1, 0, 2, 2)); - __m128 SubFacC = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(SubTmpC), _MM_SHUFFLE(3, 3, 2, 0))); - __m128 SwpFacC = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(m[1]), _MM_SHUFFLE(2, 3, 3, 3))); - __m128 MulFacC = _mm_mul_ps(SwpFacC, SubFacC); - - __m128 AddRes = _mm_add_ps(SubRes, MulFacC); - __m128 DetCof = _mm_mul_ps(AddRes, _mm_setr_ps( 1.0f,-1.0f, 1.0f,-1.0f)); - - //return m[0][0] * DetCof[0] - // + m[0][1] * DetCof[1] - // + m[0][2] * DetCof[2] - // + m[0][3] * DetCof[3]; - - return sse_dot_ps(m[0], DetCof); -} - -GLM_FUNC_QUALIFIER __m128 sse_det_ps -( - __m128 const m[4] -) -{ - // _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(add) - - //T SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; - //T SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; - //T SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; - //T SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; - //T SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; - //T SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; - - // First 2 columns - __m128 Swp2A = _mm_shuffle_ps(m[2], m[2], _MM_SHUFFLE(0, 1, 1, 2)); - __m128 Swp3A = _mm_shuffle_ps(m[3], m[3], _MM_SHUFFLE(3, 2, 3, 3)); - __m128 MulA = _mm_mul_ps(Swp2A, Swp3A); - - // Second 2 columns - __m128 Swp2B = _mm_shuffle_ps(m[2], m[2], _MM_SHUFFLE(3, 2, 3, 3)); - __m128 Swp3B = _mm_shuffle_ps(m[3], m[3], _MM_SHUFFLE(0, 1, 1, 2)); - __m128 MulB = _mm_mul_ps(Swp2B, Swp3B); - - // Columns subtraction - __m128 SubE = _mm_sub_ps(MulA, MulB); - - // Last 2 rows - __m128 Swp2C = _mm_shuffle_ps(m[2], m[2], _MM_SHUFFLE(0, 0, 1, 2)); - __m128 Swp3C = _mm_shuffle_ps(m[3], m[3], _MM_SHUFFLE(1, 2, 0, 0)); - __m128 MulC = _mm_mul_ps(Swp2C, Swp3C); - __m128 SubF = _mm_sub_ps(_mm_movehl_ps(MulC, MulC), MulC); - - //tvec4<T, P> DetCof( - // + (m[1][1] * SubFactor00 - m[1][2] * SubFactor01 + m[1][3] * SubFactor02), - // - (m[1][0] * SubFactor00 - m[1][2] * SubFactor03 + m[1][3] * SubFactor04), - // + (m[1][0] * SubFactor01 - m[1][1] * SubFactor03 + m[1][3] * SubFactor05), - // - (m[1][0] * SubFactor02 - m[1][1] * SubFactor04 + m[1][2] * SubFactor05)); - - __m128 SubFacA = _mm_shuffle_ps(SubE, SubE, _MM_SHUFFLE(2, 1, 0, 0)); - __m128 SwpFacA = _mm_shuffle_ps(m[1], m[1], _MM_SHUFFLE(0, 0, 0, 1)); - __m128 MulFacA = _mm_mul_ps(SwpFacA, SubFacA); - - __m128 SubTmpB = _mm_shuffle_ps(SubE, SubF, _MM_SHUFFLE(0, 0, 3, 1)); - __m128 SubFacB = _mm_shuffle_ps(SubTmpB, SubTmpB, _MM_SHUFFLE(3, 1, 1, 0));//SubF[0], SubE[3], SubE[3], SubE[1]; - __m128 SwpFacB = _mm_shuffle_ps(m[1], m[1], _MM_SHUFFLE(1, 1, 2, 2)); - __m128 MulFacB = _mm_mul_ps(SwpFacB, SubFacB); - - __m128 SubRes = _mm_sub_ps(MulFacA, MulFacB); - - __m128 SubTmpC = _mm_shuffle_ps(SubE, SubF, _MM_SHUFFLE(1, 0, 2, 2)); - __m128 SubFacC = _mm_shuffle_ps(SubTmpC, SubTmpC, _MM_SHUFFLE(3, 3, 2, 0)); - __m128 SwpFacC = _mm_shuffle_ps(m[1], m[1], _MM_SHUFFLE(2, 3, 3, 3)); - __m128 MulFacC = _mm_mul_ps(SwpFacC, SubFacC); - - __m128 AddRes = _mm_add_ps(SubRes, MulFacC); - __m128 DetCof = _mm_mul_ps(AddRes, _mm_setr_ps( 1.0f,-1.0f, 1.0f,-1.0f)); - - //return m[0][0] * DetCof[0] - // + m[0][1] * DetCof[1] - // + m[0][2] * DetCof[2] - // + m[0][3] * DetCof[3]; - - return sse_dot_ps(m[0], DetCof); -} - -GLM_FUNC_QUALIFIER void sse_inverse_ps(__m128 const in[4], __m128 out[4]) -{ - __m128 Fac0; - { - // valType SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; - // valType SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; - // valType SubFactor06 = m[1][2] * m[3][3] - m[3][2] * m[1][3]; - // valType SubFactor13 = m[1][2] * m[2][3] - m[2][2] * m[1][3]; - - __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(3, 3, 3, 3)); - __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(2, 2, 2, 2)); - - __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(2, 2, 2, 2)); - __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(3, 3, 3, 3)); - - __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); - __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); - Fac0 = _mm_sub_ps(Mul00, Mul01); - } - - __m128 Fac1; - { - // valType SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; - // valType SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; - // valType SubFactor07 = m[1][1] * m[3][3] - m[3][1] * m[1][3]; - // valType SubFactor14 = m[1][1] * m[2][3] - m[2][1] * m[1][3]; - - __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(3, 3, 3, 3)); - __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(1, 1, 1, 1)); - - __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(1, 1, 1, 1)); - __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(3, 3, 3, 3)); - - __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); - __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); - Fac1 = _mm_sub_ps(Mul00, Mul01); - } - - - __m128 Fac2; - { - // valType SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; - // valType SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; - // valType SubFactor08 = m[1][1] * m[3][2] - m[3][1] * m[1][2]; - // valType SubFactor15 = m[1][1] * m[2][2] - m[2][1] * m[1][2]; - - __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(2, 2, 2, 2)); - __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(1, 1, 1, 1)); - - __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(1, 1, 1, 1)); - __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(2, 2, 2, 2)); - - __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); - __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); - Fac2 = _mm_sub_ps(Mul00, Mul01); - } - - __m128 Fac3; - { - // valType SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; - // valType SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; - // valType SubFactor09 = m[1][0] * m[3][3] - m[3][0] * m[1][3]; - // valType SubFactor16 = m[1][0] * m[2][3] - m[2][0] * m[1][3]; - - __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(3, 3, 3, 3)); - __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(0, 0, 0, 0)); - - __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(0, 0, 0, 0)); - __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(3, 3, 3, 3)); - - __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); - __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); - Fac3 = _mm_sub_ps(Mul00, Mul01); - } - - __m128 Fac4; - { - // valType SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; - // valType SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; - // valType SubFactor10 = m[1][0] * m[3][2] - m[3][0] * m[1][2]; - // valType SubFactor17 = m[1][0] * m[2][2] - m[2][0] * m[1][2]; - - __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(2, 2, 2, 2)); - __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(0, 0, 0, 0)); - - __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(0, 0, 0, 0)); - __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(2, 2, 2, 2)); - - __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); - __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); - Fac4 = _mm_sub_ps(Mul00, Mul01); - } - - __m128 Fac5; - { - // valType SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; - // valType SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; - // valType SubFactor12 = m[1][0] * m[3][1] - m[3][0] * m[1][1]; - // valType SubFactor18 = m[1][0] * m[2][1] - m[2][0] * m[1][1]; - - __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(1, 1, 1, 1)); - __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(0, 0, 0, 0)); - - __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(0, 0, 0, 0)); - __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(1, 1, 1, 1)); - - __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); - __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); - Fac5 = _mm_sub_ps(Mul00, Mul01); - } - - __m128 SignA = _mm_set_ps( 1.0f,-1.0f, 1.0f,-1.0f); - __m128 SignB = _mm_set_ps(-1.0f, 1.0f,-1.0f, 1.0f); - - // m[1][0] - // m[0][0] - // m[0][0] - // m[0][0] - __m128 Temp0 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(0, 0, 0, 0)); - __m128 Vec0 = _mm_shuffle_ps(Temp0, Temp0, _MM_SHUFFLE(2, 2, 2, 0)); - - // m[1][1] - // m[0][1] - // m[0][1] - // m[0][1] - __m128 Temp1 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(1, 1, 1, 1)); - __m128 Vec1 = _mm_shuffle_ps(Temp1, Temp1, _MM_SHUFFLE(2, 2, 2, 0)); - - // m[1][2] - // m[0][2] - // m[0][2] - // m[0][2] - __m128 Temp2 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(2, 2, 2, 2)); - __m128 Vec2 = _mm_shuffle_ps(Temp2, Temp2, _MM_SHUFFLE(2, 2, 2, 0)); - - // m[1][3] - // m[0][3] - // m[0][3] - // m[0][3] - __m128 Temp3 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(3, 3, 3, 3)); - __m128 Vec3 = _mm_shuffle_ps(Temp3, Temp3, _MM_SHUFFLE(2, 2, 2, 0)); - - // col0 - // + (Vec1[0] * Fac0[0] - Vec2[0] * Fac1[0] + Vec3[0] * Fac2[0]), - // - (Vec1[1] * Fac0[1] - Vec2[1] * Fac1[1] + Vec3[1] * Fac2[1]), - // + (Vec1[2] * Fac0[2] - Vec2[2] * Fac1[2] + Vec3[2] * Fac2[2]), - // - (Vec1[3] * Fac0[3] - Vec2[3] * Fac1[3] + Vec3[3] * Fac2[3]), - __m128 Mul00 = _mm_mul_ps(Vec1, Fac0); - __m128 Mul01 = _mm_mul_ps(Vec2, Fac1); - __m128 Mul02 = _mm_mul_ps(Vec3, Fac2); - __m128 Sub00 = _mm_sub_ps(Mul00, Mul01); - __m128 Add00 = _mm_add_ps(Sub00, Mul02); - __m128 Inv0 = _mm_mul_ps(SignB, Add00); - - // col1 - // - (Vec0[0] * Fac0[0] - Vec2[0] * Fac3[0] + Vec3[0] * Fac4[0]), - // + (Vec0[0] * Fac0[1] - Vec2[1] * Fac3[1] + Vec3[1] * Fac4[1]), - // - (Vec0[0] * Fac0[2] - Vec2[2] * Fac3[2] + Vec3[2] * Fac4[2]), - // + (Vec0[0] * Fac0[3] - Vec2[3] * Fac3[3] + Vec3[3] * Fac4[3]), - __m128 Mul03 = _mm_mul_ps(Vec0, Fac0); - __m128 Mul04 = _mm_mul_ps(Vec2, Fac3); - __m128 Mul05 = _mm_mul_ps(Vec3, Fac4); - __m128 Sub01 = _mm_sub_ps(Mul03, Mul04); - __m128 Add01 = _mm_add_ps(Sub01, Mul05); - __m128 Inv1 = _mm_mul_ps(SignA, Add01); - - // col2 - // + (Vec0[0] * Fac1[0] - Vec1[0] * Fac3[0] + Vec3[0] * Fac5[0]), - // - (Vec0[0] * Fac1[1] - Vec1[1] * Fac3[1] + Vec3[1] * Fac5[1]), - // + (Vec0[0] * Fac1[2] - Vec1[2] * Fac3[2] + Vec3[2] * Fac5[2]), - // - (Vec0[0] * Fac1[3] - Vec1[3] * Fac3[3] + Vec3[3] * Fac5[3]), - __m128 Mul06 = _mm_mul_ps(Vec0, Fac1); - __m128 Mul07 = _mm_mul_ps(Vec1, Fac3); - __m128 Mul08 = _mm_mul_ps(Vec3, Fac5); - __m128 Sub02 = _mm_sub_ps(Mul06, Mul07); - __m128 Add02 = _mm_add_ps(Sub02, Mul08); - __m128 Inv2 = _mm_mul_ps(SignB, Add02); - - // col3 - // - (Vec1[0] * Fac2[0] - Vec1[0] * Fac4[0] + Vec2[0] * Fac5[0]), - // + (Vec1[0] * Fac2[1] - Vec1[1] * Fac4[1] + Vec2[1] * Fac5[1]), - // - (Vec1[0] * Fac2[2] - Vec1[2] * Fac4[2] + Vec2[2] * Fac5[2]), - // + (Vec1[0] * Fac2[3] - Vec1[3] * Fac4[3] + Vec2[3] * Fac5[3])); - __m128 Mul09 = _mm_mul_ps(Vec0, Fac2); - __m128 Mul10 = _mm_mul_ps(Vec1, Fac4); - __m128 Mul11 = _mm_mul_ps(Vec2, Fac5); - __m128 Sub03 = _mm_sub_ps(Mul09, Mul10); - __m128 Add03 = _mm_add_ps(Sub03, Mul11); - __m128 Inv3 = _mm_mul_ps(SignA, Add03); - - __m128 Row0 = _mm_shuffle_ps(Inv0, Inv1, _MM_SHUFFLE(0, 0, 0, 0)); - __m128 Row1 = _mm_shuffle_ps(Inv2, Inv3, _MM_SHUFFLE(0, 0, 0, 0)); - __m128 Row2 = _mm_shuffle_ps(Row0, Row1, _MM_SHUFFLE(2, 0, 2, 0)); - - // valType Determinant = m[0][0] * Inverse[0][0] - // + m[0][1] * Inverse[1][0] - // + m[0][2] * Inverse[2][0] - // + m[0][3] * Inverse[3][0]; - __m128 Det0 = sse_dot_ps(in[0], Row2); - __m128 Rcp0 = _mm_div_ps(one, Det0); - //__m128 Rcp0 = _mm_rcp_ps(Det0); - - // Inverse /= Determinant; - out[0] = _mm_mul_ps(Inv0, Rcp0); - out[1] = _mm_mul_ps(Inv1, Rcp0); - out[2] = _mm_mul_ps(Inv2, Rcp0); - out[3] = _mm_mul_ps(Inv3, Rcp0); -} - -GLM_FUNC_QUALIFIER void sse_inverse_fast_ps(__m128 const in[4], __m128 out[4]) -{ - __m128 Fac0; - { - // valType SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; - // valType SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; - // valType SubFactor06 = m[1][2] * m[3][3] - m[3][2] * m[1][3]; - // valType SubFactor13 = m[1][2] * m[2][3] - m[2][2] * m[1][3]; - - __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(3, 3, 3, 3)); - __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(2, 2, 2, 2)); - - __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(2, 2, 2, 2)); - __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(3, 3, 3, 3)); - - __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); - __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); - Fac0 = _mm_sub_ps(Mul00, Mul01); - } - - __m128 Fac1; - { - // valType SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; - // valType SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; - // valType SubFactor07 = m[1][1] * m[3][3] - m[3][1] * m[1][3]; - // valType SubFactor14 = m[1][1] * m[2][3] - m[2][1] * m[1][3]; - - __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(3, 3, 3, 3)); - __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(1, 1, 1, 1)); - - __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(1, 1, 1, 1)); - __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(3, 3, 3, 3)); - - __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); - __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); - Fac1 = _mm_sub_ps(Mul00, Mul01); - } - - - __m128 Fac2; - { - // valType SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; - // valType SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; - // valType SubFactor08 = m[1][1] * m[3][2] - m[3][1] * m[1][2]; - // valType SubFactor15 = m[1][1] * m[2][2] - m[2][1] * m[1][2]; - - __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(2, 2, 2, 2)); - __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(1, 1, 1, 1)); - - __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(1, 1, 1, 1)); - __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(2, 2, 2, 2)); - - __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); - __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); - Fac2 = _mm_sub_ps(Mul00, Mul01); - } - - __m128 Fac3; - { - // valType SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; - // valType SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; - // valType SubFactor09 = m[1][0] * m[3][3] - m[3][0] * m[1][3]; - // valType SubFactor16 = m[1][0] * m[2][3] - m[2][0] * m[1][3]; - - __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(3, 3, 3, 3)); - __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(0, 0, 0, 0)); - - __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(0, 0, 0, 0)); - __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(3, 3, 3, 3)); - - __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); - __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); - Fac3 = _mm_sub_ps(Mul00, Mul01); - } - - __m128 Fac4; - { - // valType SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; - // valType SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; - // valType SubFactor10 = m[1][0] * m[3][2] - m[3][0] * m[1][2]; - // valType SubFactor17 = m[1][0] * m[2][2] - m[2][0] * m[1][2]; - - __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(2, 2, 2, 2)); - __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(0, 0, 0, 0)); - - __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(0, 0, 0, 0)); - __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(2, 2, 2, 2)); - - __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); - __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); - Fac4 = _mm_sub_ps(Mul00, Mul01); - } - - __m128 Fac5; - { - // valType SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; - // valType SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; - // valType SubFactor12 = m[1][0] * m[3][1] - m[3][0] * m[1][1]; - // valType SubFactor18 = m[1][0] * m[2][1] - m[2][0] * m[1][1]; - - __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(1, 1, 1, 1)); - __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(0, 0, 0, 0)); - - __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(0, 0, 0, 0)); - __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(1, 1, 1, 1)); - - __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); - __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); - Fac5 = _mm_sub_ps(Mul00, Mul01); - } - - __m128 SignA = _mm_set_ps( 1.0f,-1.0f, 1.0f,-1.0f); - __m128 SignB = _mm_set_ps(-1.0f, 1.0f,-1.0f, 1.0f); - - // m[1][0] - // m[0][0] - // m[0][0] - // m[0][0] - __m128 Temp0 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(0, 0, 0, 0)); - __m128 Vec0 = _mm_shuffle_ps(Temp0, Temp0, _MM_SHUFFLE(2, 2, 2, 0)); - - // m[1][1] - // m[0][1] - // m[0][1] - // m[0][1] - __m128 Temp1 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(1, 1, 1, 1)); - __m128 Vec1 = _mm_shuffle_ps(Temp1, Temp1, _MM_SHUFFLE(2, 2, 2, 0)); - - // m[1][2] - // m[0][2] - // m[0][2] - // m[0][2] - __m128 Temp2 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(2, 2, 2, 2)); - __m128 Vec2 = _mm_shuffle_ps(Temp2, Temp2, _MM_SHUFFLE(2, 2, 2, 0)); - - // m[1][3] - // m[0][3] - // m[0][3] - // m[0][3] - __m128 Temp3 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(3, 3, 3, 3)); - __m128 Vec3 = _mm_shuffle_ps(Temp3, Temp3, _MM_SHUFFLE(2, 2, 2, 0)); - - // col0 - // + (Vec1[0] * Fac0[0] - Vec2[0] * Fac1[0] + Vec3[0] * Fac2[0]), - // - (Vec1[1] * Fac0[1] - Vec2[1] * Fac1[1] + Vec3[1] * Fac2[1]), - // + (Vec1[2] * Fac0[2] - Vec2[2] * Fac1[2] + Vec3[2] * Fac2[2]), - // - (Vec1[3] * Fac0[3] - Vec2[3] * Fac1[3] + Vec3[3] * Fac2[3]), - __m128 Mul00 = _mm_mul_ps(Vec1, Fac0); - __m128 Mul01 = _mm_mul_ps(Vec2, Fac1); - __m128 Mul02 = _mm_mul_ps(Vec3, Fac2); - __m128 Sub00 = _mm_sub_ps(Mul00, Mul01); - __m128 Add00 = _mm_add_ps(Sub00, Mul02); - __m128 Inv0 = _mm_mul_ps(SignB, Add00); - - // col1 - // - (Vec0[0] * Fac0[0] - Vec2[0] * Fac3[0] + Vec3[0] * Fac4[0]), - // + (Vec0[0] * Fac0[1] - Vec2[1] * Fac3[1] + Vec3[1] * Fac4[1]), - // - (Vec0[0] * Fac0[2] - Vec2[2] * Fac3[2] + Vec3[2] * Fac4[2]), - // + (Vec0[0] * Fac0[3] - Vec2[3] * Fac3[3] + Vec3[3] * Fac4[3]), - __m128 Mul03 = _mm_mul_ps(Vec0, Fac0); - __m128 Mul04 = _mm_mul_ps(Vec2, Fac3); - __m128 Mul05 = _mm_mul_ps(Vec3, Fac4); - __m128 Sub01 = _mm_sub_ps(Mul03, Mul04); - __m128 Add01 = _mm_add_ps(Sub01, Mul05); - __m128 Inv1 = _mm_mul_ps(SignA, Add01); - - // col2 - // + (Vec0[0] * Fac1[0] - Vec1[0] * Fac3[0] + Vec3[0] * Fac5[0]), - // - (Vec0[0] * Fac1[1] - Vec1[1] * Fac3[1] + Vec3[1] * Fac5[1]), - // + (Vec0[0] * Fac1[2] - Vec1[2] * Fac3[2] + Vec3[2] * Fac5[2]), - // - (Vec0[0] * Fac1[3] - Vec1[3] * Fac3[3] + Vec3[3] * Fac5[3]), - __m128 Mul06 = _mm_mul_ps(Vec0, Fac1); - __m128 Mul07 = _mm_mul_ps(Vec1, Fac3); - __m128 Mul08 = _mm_mul_ps(Vec3, Fac5); - __m128 Sub02 = _mm_sub_ps(Mul06, Mul07); - __m128 Add02 = _mm_add_ps(Sub02, Mul08); - __m128 Inv2 = _mm_mul_ps(SignB, Add02); - - // col3 - // - (Vec1[0] * Fac2[0] - Vec1[0] * Fac4[0] + Vec2[0] * Fac5[0]), - // + (Vec1[0] * Fac2[1] - Vec1[1] * Fac4[1] + Vec2[1] * Fac5[1]), - // - (Vec1[0] * Fac2[2] - Vec1[2] * Fac4[2] + Vec2[2] * Fac5[2]), - // + (Vec1[0] * Fac2[3] - Vec1[3] * Fac4[3] + Vec2[3] * Fac5[3])); - __m128 Mul09 = _mm_mul_ps(Vec0, Fac2); - __m128 Mul10 = _mm_mul_ps(Vec1, Fac4); - __m128 Mul11 = _mm_mul_ps(Vec2, Fac5); - __m128 Sub03 = _mm_sub_ps(Mul09, Mul10); - __m128 Add03 = _mm_add_ps(Sub03, Mul11); - __m128 Inv3 = _mm_mul_ps(SignA, Add03); - - __m128 Row0 = _mm_shuffle_ps(Inv0, Inv1, _MM_SHUFFLE(0, 0, 0, 0)); - __m128 Row1 = _mm_shuffle_ps(Inv2, Inv3, _MM_SHUFFLE(0, 0, 0, 0)); - __m128 Row2 = _mm_shuffle_ps(Row0, Row1, _MM_SHUFFLE(2, 0, 2, 0)); - - // valType Determinant = m[0][0] * Inverse[0][0] - // + m[0][1] * Inverse[1][0] - // + m[0][2] * Inverse[2][0] - // + m[0][3] * Inverse[3][0]; - __m128 Det0 = sse_dot_ps(in[0], Row2); - __m128 Rcp0 = _mm_rcp_ps(Det0); - //__m128 Rcp0 = _mm_div_ps(one, Det0); - // Inverse /= Determinant; - out[0] = _mm_mul_ps(Inv0, Rcp0); - out[1] = _mm_mul_ps(Inv1, Rcp0); - out[2] = _mm_mul_ps(Inv2, Rcp0); - out[3] = _mm_mul_ps(Inv3, Rcp0); -} -/* -GLM_FUNC_QUALIFIER void sse_rotate_ps(__m128 const in[4], float Angle, float const v[3], __m128 out[4]) -{ - float a = glm::radians(Angle); - float c = cos(a); - float s = sin(a); - - glm::vec4 AxisA(v[0], v[1], v[2], float(0)); - __m128 AxisB = _mm_set_ps(AxisA.w, AxisA.z, AxisA.y, AxisA.x); - __m128 AxisC = detail::sse_nrm_ps(AxisB); - - __m128 Cos0 = _mm_set_ss(c); - __m128 CosA = _mm_shuffle_ps(Cos0, Cos0, _MM_SHUFFLE(0, 0, 0, 0)); - __m128 Sin0 = _mm_set_ss(s); - __m128 SinA = _mm_shuffle_ps(Sin0, Sin0, _MM_SHUFFLE(0, 0, 0, 0)); - - // tvec3<T, P> temp = (valType(1) - c) * axis; - __m128 Temp0 = _mm_sub_ps(one, CosA); - __m128 Temp1 = _mm_mul_ps(Temp0, AxisC); - - //Rotate[0][0] = c + temp[0] * axis[0]; - //Rotate[0][1] = 0 + temp[0] * axis[1] + s * axis[2]; - //Rotate[0][2] = 0 + temp[0] * axis[2] - s * axis[1]; - __m128 Axis0 = _mm_shuffle_ps(AxisC, AxisC, _MM_SHUFFLE(0, 0, 0, 0)); - __m128 TmpA0 = _mm_mul_ps(Axis0, AxisC); - __m128 CosA0 = _mm_shuffle_ps(Cos0, Cos0, _MM_SHUFFLE(1, 1, 1, 0)); - __m128 TmpA1 = _mm_add_ps(CosA0, TmpA0); - __m128 SinA0 = SinA;//_mm_set_ps(0.0f, s, -s, 0.0f); - __m128 TmpA2 = _mm_shuffle_ps(AxisC, AxisC, _MM_SHUFFLE(3, 1, 2, 3)); - __m128 TmpA3 = _mm_mul_ps(SinA0, TmpA2); - __m128 TmpA4 = _mm_add_ps(TmpA1, TmpA3); - - //Rotate[1][0] = 0 + temp[1] * axis[0] - s * axis[2]; - //Rotate[1][1] = c + temp[1] * axis[1]; - //Rotate[1][2] = 0 + temp[1] * axis[2] + s * axis[0]; - __m128 Axis1 = _mm_shuffle_ps(AxisC, AxisC, _MM_SHUFFLE(1, 1, 1, 1)); - __m128 TmpB0 = _mm_mul_ps(Axis1, AxisC); - __m128 CosA1 = _mm_shuffle_ps(Cos0, Cos0, _MM_SHUFFLE(1, 1, 0, 1)); - __m128 TmpB1 = _mm_add_ps(CosA1, TmpB0); - __m128 SinB0 = SinA;//_mm_set_ps(-s, 0.0f, s, 0.0f); - __m128 TmpB2 = _mm_shuffle_ps(AxisC, AxisC, _MM_SHUFFLE(3, 0, 3, 2)); - __m128 TmpB3 = _mm_mul_ps(SinA0, TmpB2); - __m128 TmpB4 = _mm_add_ps(TmpB1, TmpB3); - - //Rotate[2][0] = 0 + temp[2] * axis[0] + s * axis[1]; - //Rotate[2][1] = 0 + temp[2] * axis[1] - s * axis[0]; - //Rotate[2][2] = c + temp[2] * axis[2]; - __m128 Axis2 = _mm_shuffle_ps(AxisC, AxisC, _MM_SHUFFLE(2, 2, 2, 2)); - __m128 TmpC0 = _mm_mul_ps(Axis2, AxisC); - __m128 CosA2 = _mm_shuffle_ps(Cos0, Cos0, _MM_SHUFFLE(1, 0, 1, 1)); - __m128 TmpC1 = _mm_add_ps(CosA2, TmpC0); - __m128 SinC0 = SinA;//_mm_set_ps(s, -s, 0.0f, 0.0f); - __m128 TmpC2 = _mm_shuffle_ps(AxisC, AxisC, _MM_SHUFFLE(3, 3, 0, 1)); - __m128 TmpC3 = _mm_mul_ps(SinA0, TmpC2); - __m128 TmpC4 = _mm_add_ps(TmpC1, TmpC3); - - __m128 Result[4]; - Result[0] = TmpA4; - Result[1] = TmpB4; - Result[2] = TmpC4; - Result[3] = _mm_set_ps(1, 0, 0, 0); - - //tmat4x4<valType> Result(uninitialize); - //Result[0] = m[0] * Rotate[0][0] + m[1] * Rotate[0][1] + m[2] * Rotate[0][2]; - //Result[1] = m[0] * Rotate[1][0] + m[1] * Rotate[1][1] + m[2] * Rotate[1][2]; - //Result[2] = m[0] * Rotate[2][0] + m[1] * Rotate[2][1] + m[2] * Rotate[2][2]; - //Result[3] = m[3]; - //return Result; - sse_mul_ps(in, Result, out); -} -*/ -GLM_FUNC_QUALIFIER void sse_outer_ps(__m128 const & c, __m128 const & r, __m128 out[4]) -{ - out[0] = _mm_mul_ps(c, _mm_shuffle_ps(r, r, _MM_SHUFFLE(0, 0, 0, 0))); - out[1] = _mm_mul_ps(c, _mm_shuffle_ps(r, r, _MM_SHUFFLE(1, 1, 1, 1))); - out[2] = _mm_mul_ps(c, _mm_shuffle_ps(r, r, _MM_SHUFFLE(2, 2, 2, 2))); - out[3] = _mm_mul_ps(c, _mm_shuffle_ps(r, r, _MM_SHUFFLE(3, 3, 3, 3))); -} - -}//namespace detail -}//namespace glm diff --git a/extensions/common/glm/detail/intrinsic_trigonometric.hpp b/extensions/common/glm/detail/intrinsic_trigonometric.hpp deleted file mode 100644 index 73d34b6c6d3..00000000000 --- a/extensions/common/glm/detail/intrinsic_trigonometric.hpp +++ /dev/null @@ -1,46 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/intrinsic_trigonometric.hpp -/// @date 2009-06-09 / 2011-06-15 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "setup.hpp" - -#if(!(GLM_ARCH & GLM_ARCH_SSE2)) -# error "SSE2 instructions not supported or enabled" -#else - -namespace glm{ -namespace detail -{ - -}//namespace detail -}//namespace glm - -#include "intrinsic_trigonometric.inl" - -#endif//GLM_ARCH diff --git a/extensions/common/glm/detail/intrinsic_trigonometric.inl b/extensions/common/glm/detail/intrinsic_trigonometric.inl deleted file mode 100644 index 5941ca31174..00000000000 --- a/extensions/common/glm/detail/intrinsic_trigonometric.inl +++ /dev/null @@ -1,27 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/intrinsic_trigonometric.inl -/// @date 2011-06-15 / 2011-06-15 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// diff --git a/extensions/common/glm/detail/intrinsic_vector_relational.hpp b/extensions/common/glm/detail/intrinsic_vector_relational.hpp deleted file mode 100644 index 37ee72e9e46..00000000000 --- a/extensions/common/glm/detail/intrinsic_vector_relational.hpp +++ /dev/null @@ -1,46 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/intrinsic_vector_relational.hpp -/// @date 2009-06-09 / 2011-06-15 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "setup.hpp" - -#if(!(GLM_ARCH & GLM_ARCH_SSE2)) -# error "SSE2 instructions not supported or enabled" -#else - -namespace glm{ -namespace detail -{ - -}//namespace detail -}//namespace glm - -#include "intrinsic_vector_relational.inl" - -#endif//GLM_ARCH diff --git a/extensions/common/glm/detail/intrinsic_vector_relational.inl b/extensions/common/glm/detail/intrinsic_vector_relational.inl deleted file mode 100644 index e7445edc8dc..00000000000 --- a/extensions/common/glm/detail/intrinsic_vector_relational.inl +++ /dev/null @@ -1,366 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/intrinsic_vector_relational.inl -/// @date 2009-06-09 / 2011-06-15 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// -// -//// lessThan -//template <typename valType> -//GLM_FUNC_QUALIFIER typename tvec2<T, P>::bool_type lessThan -//( -// tvec2<T, P> const & x, -// tvec2<T, P> const & y -//) -//{ -// GLM_STATIC_ASSERT( -// detail::type<valType>::is_float || -// detail::type<valType>::is_int || -// detail::type<valType>::is_uint); -// -// return typename tvec2<bool>::bool_type(x.x < y.x, x.y < y.y); -//} -// -//template <typename valType> -//GLM_FUNC_QUALIFIER typename tvec3<T, P>::bool_type lessThan -//( -// tvec3<T, P> const & x, -// tvec3<T, P> const & y -//) -//{ -// GLM_STATIC_ASSERT( -// detail::type<valType>::is_float || -// detail::type<valType>::is_int || -// detail::type<valType>::is_uint); -// -// return typename tvec3<bool>::bool_type(x.x < y.x, x.y < y.y, x.z < y.z); -//} -// -//template <typename valType> -//GLM_FUNC_QUALIFIER typename tvec4<T, P>::bool_type lessThan -//( -// tvec4<T, P> const & x, -// tvec4<T, P> const & y -//) -//{ -// GLM_STATIC_ASSERT( -// detail::type<valType>::is_float || -// detail::type<valType>::is_int || -// detail::type<valType>::is_uint); -// -// return typename tvec4<bool>::bool_type(x.x < y.x, x.y < y.y, x.z < y.z, x.w < y.w); -//} -// -//// lessThanEqual -//template <typename valType> -//GLM_FUNC_QUALIFIER typename tvec2<T, P>::bool_type lessThanEqual -//( -// tvec2<T, P> const & x, -// tvec2<T, P> const & y -//) -//{ -// GLM_STATIC_ASSERT( -// detail::type<valType>::is_float || -// detail::type<valType>::is_int || -// detail::type<valType>::is_uint); -// -// return typename tvec2<bool>::bool_type(x.x <= y.x, x.y <= y.y); -//} -// -//template <typename valType> -//GLM_FUNC_QUALIFIER typename tvec3<T, P>::bool_type lessThanEqual -//( -// tvec3<T, P> const & x, -// tvec3<T, P> const & y -//) -//{ -// GLM_STATIC_ASSERT( -// detail::type<valType>::is_float || -// detail::type<valType>::is_int || -// detail::type<valType>::is_uint); -// -// return typename tvec3<bool>::bool_type(x.x <= y.x, x.y <= y.y, x.z <= y.z); -//} -// -//template <typename valType> -//GLM_FUNC_QUALIFIER typename tvec4<T, P>::bool_type lessThanEqual -//( -// tvec4<T, P> const & x, -// tvec4<T, P> const & y -//) -//{ -// GLM_STATIC_ASSERT( -// detail::type<valType>::is_float || -// detail::type<valType>::is_int || -// detail::type<valType>::is_uint); -// -// return typename tvec4<bool>::bool_type(x.x <= y.x, x.y <= y.y, x.z <= y.z, x.w <= y.w); -//} -// -//// greaterThan -//template <typename valType> -//GLM_FUNC_QUALIFIER typename tvec2<T, P>::bool_type greaterThan -//( -// tvec2<T, P> const & x, -// tvec2<T, P> const & y -//) -//{ -// GLM_STATIC_ASSERT( -// detail::type<valType>::is_float || -// detail::type<valType>::is_int || -// detail::type<valType>::is_uint); -// -// return typename tvec2<bool>::bool_type(x.x > y.x, x.y > y.y); -//} -// -//template <typename valType> -//GLM_FUNC_QUALIFIER typename tvec3<T, P>::bool_type greaterThan -//( -// tvec3<T, P> const & x, -// tvec3<T, P> const & y -//) -//{ -// GLM_STATIC_ASSERT( -// detail::type<valType>::is_float || -// detail::type<valType>::is_int || -// detail::type<valType>::is_uint); -// -// return typename tvec3<bool>::bool_type(x.x > y.x, x.y > y.y, x.z > y.z); -//} -// -//template <typename valType> -//GLM_FUNC_QUALIFIER typename tvec4<T, P>::bool_type greaterThan -//( -// tvec4<T, P> const & x, -// tvec4<T, P> const & y -//) -//{ -// GLM_STATIC_ASSERT( -// detail::type<valType>::is_float || -// detail::type<valType>::is_int || -// detail::type<valType>::is_uint); -// -// return typename tvec4<bool>::bool_type(x.x > y.x, x.y > y.y, x.z > y.z, x.w > y.w); -//} -// -//// greaterThanEqual -//template <typename valType> -//GLM_FUNC_QUALIFIER typename tvec2<T, P>::bool_type greaterThanEqual -//( -// tvec2<T, P> const & x, -// tvec2<T, P> const & y -//) -//{ -// GLM_STATIC_ASSERT( -// detail::type<valType>::is_float || -// detail::type<valType>::is_int || -// detail::type<valType>::is_uint); -// -// return typename tvec2<bool>::bool_type(x.x >= y.x, x.y >= y.y); -//} -// -//template <typename valType> -//GLM_FUNC_QUALIFIER typename tvec3<T, P>::bool_type greaterThanEqual -//( -// tvec3<T, P> const & x, -// tvec3<T, P> const & y -//) -//{ -// GLM_STATIC_ASSERT( -// detail::type<valType>::is_float || -// detail::type<valType>::is_int || -// detail::type<valType>::is_uint); -// -// return typename tvec3<bool>::bool_type(x.x >= y.x, x.y >= y.y, x.z >= y.z); -//} -// -//template <typename valType> -//GLM_FUNC_QUALIFIER typename tvec4<T, P>::bool_type greaterThanEqual -//( -// tvec4<T, P> const & x, -// tvec4<T, P> const & y -//) -//{ -// GLM_STATIC_ASSERT( -// detail::type<valType>::is_float || -// detail::type<valType>::is_int || -// detail::type<valType>::is_uint); -// -// return typename tvec4<bool>::bool_type(x.x >= y.x, x.y >= y.y, x.z >= y.z, x.w >= y.w); -//} -// -//// equal -//template <typename valType> -//GLM_FUNC_QUALIFIER typename tvec2<T, P>::bool_type equal -//( -// tvec2<T, P> const & x, -// tvec2<T, P> const & y -//) -//{ -// GLM_STATIC_ASSERT( -// detail::type<valType>::is_float || -// detail::type<valType>::is_int || -// detail::type<valType>::is_uint || -// detail::type<valType>::is_bool); -// -// return typename tvec2<T, P>::bool_type(x.x == y.x, x.y == y.y); -//} -// -//template <typename valType> -//GLM_FUNC_QUALIFIER typename tvec3<T, P>::bool_type equal -//( -// tvec3<T, P> const & x, -// tvec3<T, P> const & y -//) -//{ -// GLM_STATIC_ASSERT( -// detail::type<valType>::is_float || -// detail::type<valType>::is_int || -// detail::type<valType>::is_uint || -// detail::type<valType>::is_bool); -// -// return typename tvec3<T, P>::bool_type(x.x == y.x, x.y == y.y, x.z == y.z); -//} -// -//template <typename valType> -//GLM_FUNC_QUALIFIER typename tvec4<T, P>::bool_type equal -//( -// tvec4<T, P> const & x, -// tvec4<T, P> const & y -//) -//{ -// GLM_STATIC_ASSERT( -// detail::type<valType>::is_float || -// detail::type<valType>::is_int || -// detail::type<valType>::is_uint || -// detail::type<valType>::is_bool); -// -// return typename tvec4<T, P>::bool_type(x.x == y.x, x.y == y.y, x.z == y.z, x.w == y.w); -//} -// -//// notEqual -//template <typename valType> -//GLM_FUNC_QUALIFIER typename tvec2<T, P>::bool_type notEqual -//( -// tvec2<T, P> const & x, -// tvec2<T, P> const & y -//) -//{ -// GLM_STATIC_ASSERT( -// detail::type<valType>::is_float || -// detail::type<valType>::is_int || -// detail::type<valType>::is_uint || -// detail::type<valType>::is_bool); -// -// return typename tvec2<T, P>::bool_type(x.x != y.x, x.y != y.y); -//} -// -//template <typename valType> -//GLM_FUNC_QUALIFIER typename tvec3<T, P>::bool_type notEqual -//( -// tvec3<T, P> const & x, -// tvec3<T, P> const & y -//) -//{ -// GLM_STATIC_ASSERT( -// detail::type<valType>::is_float || -// detail::type<valType>::is_int || -// detail::type<valType>::is_uint || -// detail::type<valType>::is_bool); -// -// return typename tvec3<T, P>::bool_type(x.x != y.x, x.y != y.y, x.z != y.z); -//} -// -//template <typename valType> -//GLM_FUNC_QUALIFIER typename tvec4<T, P>::bool_type notEqual -//( -// tvec4<T, P> const & x, -// tvec4<T, P> const & y -//) -//{ -// GLM_STATIC_ASSERT( -// detail::type<valType>::is_float || -// detail::type<valType>::is_int || -// detail::type<valType>::is_uint || -// detail::type<valType>::is_bool); -// -// return typename tvec4<T, P>::bool_type(x.x != y.x, x.y != y.y, x.z != y.z, x.w != y.w); -//} -// -//// any -//GLM_FUNC_QUALIFIER bool any(tvec2<bool> const & x) -//{ -// return x.x || x.y; -//} -// -//GLM_FUNC_QUALIFIER bool any(tvec3<bool> const & x) -//{ -// return x.x || x.y || x.z; -//} -// -//GLM_FUNC_QUALIFIER bool any(tvec4<bool> const & x) -//{ -// return x.x || x.y || x.z || x.w; -//} -// -//// all -//GLM_FUNC_QUALIFIER bool all(const tvec2<bool>& x) -//{ -// return x.x && x.y; -//} -// -//GLM_FUNC_QUALIFIER bool all(const tvec3<bool>& x) -//{ -// return x.x && x.y && x.z; -//} -// -//GLM_FUNC_QUALIFIER bool all(const tvec4<bool>& x) -//{ -// return x.x && x.y && x.z && x.w; -//} -// -//// not -//GLM_FUNC_QUALIFIER tvec2<bool>::bool_type not_ -//( -// tvec2<bool> const & v -//) -//{ -// return tvec2<bool>::bool_type(!v.x, !v.y); -//} -// -//GLM_FUNC_QUALIFIER tvec3<bool>::bool_type not_ -//( -// tvec3<bool> const & v -//) -//{ -// return tvec3<bool>::bool_type(!v.x, !v.y, !v.z); -//} -// -//GLM_FUNC_QUALIFIER tvec4<bool>::bool_type not_ -//( -// tvec4<bool> const & v -//) -//{ -// return tvec4<bool>::bool_type(!v.x, !v.y, !v.z, !v.w); -//} \ No newline at end of file diff --git a/extensions/common/glm/detail/precision.hpp b/extensions/common/glm/detail/precision.hpp deleted file mode 100644 index 4b9e3f4e3d2..00000000000 --- a/extensions/common/glm/detail/precision.hpp +++ /dev/null @@ -1,44 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/precision.hpp -/// @date 2013-04-01 / 2013-04-01 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -namespace glm -{ - enum precision - { - highp, - mediump, - lowp, - defaultp = highp - }; -}//namespace glm diff --git a/extensions/common/glm/detail/setup.hpp b/extensions/common/glm/detail/setup.hpp deleted file mode 100644 index da993bf41e7..00000000000 --- a/extensions/common/glm/detail/setup.hpp +++ /dev/null @@ -1,962 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/setup.hpp -/// @date 2006-11-13 / 2014-10-05 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include <cassert> -#include <cstddef> - -/////////////////////////////////////////////////////////////////////////////////// -// Version - -#define GLM_VERSION 96 -#define GLM_VERSION_MAJOR 0 -#define GLM_VERSION_MINOR 9 -#define GLM_VERSION_PATCH 6 -#define GLM_VERSION_REVISION 3 - -#if(defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_VERSION_DISPLAYED)) -# define GLM_MESSAGE_VERSION_DISPLAYED -# pragma message ("GLM: version 0.9.6.3") -#endif//GLM_MESSAGE - -/////////////////////////////////////////////////////////////////////////////////// -// Platform - -#define GLM_PLATFORM_UNKNOWN 0x00000000 -#define GLM_PLATFORM_WINDOWS 0x00010000 -#define GLM_PLATFORM_LINUX 0x00020000 -#define GLM_PLATFORM_APPLE 0x00040000 -//#define GLM_PLATFORM_IOS 0x00080000 -#define GLM_PLATFORM_ANDROID 0x00100000 -#define GLM_PLATFORM_CHROME_NACL 0x00200000 -#define GLM_PLATFORM_UNIX 0x00400000 -#define GLM_PLATFORM_QNXNTO 0x00800000 -#define GLM_PLATFORM_WINCE 0x01000000 - -#ifdef GLM_FORCE_PLATFORM_UNKNOWN -# define GLM_PLATFORM GLM_PLATFORM_UNKNOWN -#elif defined(__QNXNTO__) -# define GLM_PLATFORM GLM_PLATFORM_QNXNTO -#elif defined(__APPLE__) -# define GLM_PLATFORM GLM_PLATFORM_APPLE -#elif defined(WINCE) -# define GLM_PLATFORM GLM_PLATFORM_WINCE -#elif defined(_WIN32) -# define GLM_PLATFORM GLM_PLATFORM_WINDOWS -#elif defined(__native_client__) -# define GLM_PLATFORM GLM_PLATFORM_CHROME_NACL -#elif defined(__ANDROID__) -# define GLM_PLATFORM GLM_PLATFORM_ANDROID -#elif defined(__linux) -# define GLM_PLATFORM GLM_PLATFORM_LINUX -#elif defined(__unix) -# define GLM_PLATFORM GLM_PLATFORM_UNIX -#else -# define GLM_PLATFORM GLM_PLATFORM_UNKNOWN -#endif// - -// Report platform detection -#if(defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_PLATFORM_DISPLAYED)) -# define GLM_MESSAGE_PLATFORM_DISPLAYED -# if(GLM_PLATFORM & GLM_PLATFORM_QNXNTO) -# pragma message("GLM: QNX platform detected") -//# elif(GLM_PLATFORM & GLM_PLATFORM_IOS) -//# pragma message("GLM: iOS platform detected") -# elif(GLM_PLATFORM & GLM_PLATFORM_APPLE) -# pragma message("GLM: Apple platform detected") -# elif(GLM_PLATFORM & GLM_PLATFORM_WINCE) -# pragma message("GLM: WinCE platform detected") -# elif(GLM_PLATFORM & GLM_PLATFORM_WINDOWS) -# pragma message("GLM: Windows platform detected") -# elif(GLM_PLATFORM & GLM_PLATFORM_CHROME_NACL) -# pragma message("GLM: Native Client detected") -# elif(GLM_PLATFORM & GLM_PLATFORM_ANDROID) -# pragma message("GLM: Android platform detected") -# elif(GLM_PLATFORM & GLM_PLATFORM_LINUX) -# pragma message("GLM: Linux platform detected") -# elif(GLM_PLATFORM & GLM_PLATFORM_UNIX) -# pragma message("GLM: UNIX platform detected") -# elif(GLM_PLATFORM & GLM_PLATFORM_UNKNOWN) -# pragma message("GLM: platform unknown") -# else -# pragma message("GLM: platform not detected") -# endif -#endif//GLM_MESSAGE - -/////////////////////////////////////////////////////////////////////////////////// -// Compiler - -// User defines: GLM_FORCE_COMPILER_UNKNOWN -// TODO ? __llvm__ - -#define GLM_COMPILER_UNKNOWN 0x00000000 - -// Intel -#define GLM_COMPILER_INTEL 0x00100000 -#define GLM_COMPILER_INTEL12 0x00100010 -#define GLM_COMPILER_INTEL12_1 0x00100020 -#define GLM_COMPILER_INTEL13 0x00100030 -#define GLM_COMPILER_INTEL14 0x00100040 -#define GLM_COMPILER_INTEL15 0x00100050 - -// Visual C++ defines -#define GLM_COMPILER_VC 0x01000000 -#define GLM_COMPILER_VC2010 0x01000090 -#define GLM_COMPILER_VC2012 0x010000A0 -#define GLM_COMPILER_VC2013 0x010000B0 -#define GLM_COMPILER_VC2015 0x010000C0 - -// GCC defines -#define GLM_COMPILER_GCC 0x02000000 -#define GLM_COMPILER_GCC44 0x020000B0 -#define GLM_COMPILER_GCC45 0x020000C0 -#define GLM_COMPILER_GCC46 0x020000D0 -#define GLM_COMPILER_GCC47 0x020000E0 -#define GLM_COMPILER_GCC48 0x020000F0 -#define GLM_COMPILER_GCC49 0x02000100 -#define GLM_COMPILER_GCC50 0x02000200 - -// CUDA -#define GLM_COMPILER_CUDA 0x10000000 -#define GLM_COMPILER_CUDA40 0x10000040 -#define GLM_COMPILER_CUDA41 0x10000050 -#define GLM_COMPILER_CUDA42 0x10000060 -#define GLM_COMPILER_CUDA50 0x10000070 -#define GLM_COMPILER_CUDA60 0x10000080 -#define GLM_COMPILER_CUDA65 0x10000090 - -// LLVM -#define GLM_COMPILER_LLVM 0x20000000 -#define GLM_COMPILER_LLVM32 0x20000030 -#define GLM_COMPILER_LLVM33 0x20000040 -#define GLM_COMPILER_LLVM34 0x20000050 -#define GLM_COMPILER_LLVM35 0x20000060 - -// Apple Clang -#define GLM_COMPILER_APPLE_CLANG 0x40000000 -#define GLM_COMPILER_APPLE_CLANG40 0x40000010 -#define GLM_COMPILER_APPLE_CLANG41 0x40000020 -#define GLM_COMPILER_APPLE_CLANG42 0x40000030 -#define GLM_COMPILER_APPLE_CLANG50 0x40000040 -#define GLM_COMPILER_APPLE_CLANG51 0x40000050 -#define GLM_COMPILER_APPLE_CLANG60 0x40000060 - -// Build model -#define GLM_MODEL_32 0x00000010 -#define GLM_MODEL_64 0x00000020 - -// Force generic C++ compiler -#ifdef GLM_FORCE_COMPILER_UNKNOWN -# define GLM_COMPILER GLM_COMPILER_UNKNOWN - -#elif defined(__INTEL_COMPILER) -# if __INTEL_COMPILER == 1200 -# define GLM_COMPILER GLM_COMPILER_INTEL12 -# elif __INTEL_COMPILER == 1210 -# define GLM_COMPILER GLM_COMPILER_INTEL12_1 -# elif __INTEL_COMPILER == 1300 -# define GLM_COMPILER GLM_COMPILER_INTEL13 -# elif __INTEL_COMPILER == 1400 -# define GLM_COMPILER GLM_COMPILER_INTEL14 -# elif __INTEL_COMPILER >= 1500 -# define GLM_COMPILER GLM_COMPILER_INTEL15 -# else -# define GLM_COMPILER GLM_COMPILER_INTEL -# endif - -// CUDA -#elif defined(__CUDACC__) -# if !defined(CUDA_VERSION) && !defined(GLM_FORCE_CUDA) -# include <cuda.h> // make sure version is defined since nvcc does not define it itself! -# endif -# if CUDA_VERSION < 3000 -# error "GLM requires CUDA 3.0 or higher" -# else -# define GLM_COMPILER GLM_COMPILER_CUDA -# endif - -// Visual C++ -#elif defined(_MSC_VER) -# if _MSC_VER < 1600 -# error "GLM requires Visual C++ 2010 or higher" -# elif _MSC_VER == 1600 -# define GLM_COMPILER GLM_COMPILER_VC2010 -# elif _MSC_VER == 1700 -# define GLM_COMPILER GLM_COMPILER_VC2012 -# elif _MSC_VER == 1800 -# define GLM_COMPILER GLM_COMPILER_VC2013 -# elif _MSC_VER >= 1900 -# define GLM_COMPILER GLM_COMPILER_VC2015 -# else//_MSC_VER -# define GLM_COMPILER GLM_COMPILER_VC -# endif//_MSC_VER - -// Clang -#elif defined(__clang__) -# if GLM_PLATFORM & GLM_PLATFORM_APPLE -# if __clang_major__ == 4 && __clang_minor__ == 0 -# define GLM_COMPILER GLM_COMPILER_APPLE_CLANG40 -# elif __clang_major__ == 4 && __clang_minor__ == 1 -# define GLM_COMPILER GLM_COMPILER_APPLE_CLANG41 -# elif __clang_major__ == 4 && __clang_minor__ == 2 -# define GLM_COMPILER GLM_COMPILER_APPLE_CLANG42 -# elif __clang_major__ == 5 && __clang_minor__ == 0 -# define GLM_COMPILER GLM_COMPILER_APPLE_CLANG50 -# elif __clang_major__ == 5 && __clang_minor__ == 1 -# define GLM_COMPILER GLM_COMPILER_APPLE_CLANG51 -# elif __clang_major__ >= 6 -# define GLM_COMPILER GLM_COMPILER_APPLE_CLANG60 -# endif -# else -# if __clang_major__ == 3 && __clang_minor__ == 0 -# define GLM_COMPILER GLM_COMPILER_LLVM30 -# elif __clang_major__ == 3 && __clang_minor__ == 1 -# define GLM_COMPILER GLM_COMPILER_LLVM31 -# elif __clang_major__ == 3 && __clang_minor__ == 2 -# define GLM_COMPILER GLM_COMPILER_LLVM32 -# elif __clang_major__ == 3 && __clang_minor__ == 3 -# define GLM_COMPILER GLM_COMPILER_LLVM33 -# elif __clang_major__ == 3 && __clang_minor__ == 4 -# define GLM_COMPILER GLM_COMPILER_LLVM34 -# elif __clang_major__ == 3 && __clang_minor__ == 5 -# define GLM_COMPILER GLM_COMPILER_LLVM35 -# else -# define GLM_COMPILER GLM_COMPILER_LLVM35 -# endif -# endif - -// G++ -#elif defined(__GNUC__) || defined(__MINGW32__) -# if (__GNUC__ == 4) && (__GNUC_MINOR__ == 2) -# define GLM_COMPILER (GLM_COMPILER_GCC42) -# elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 3) -# define GLM_COMPILER (GLM_COMPILER_GCC43) -# elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 4) -# define GLM_COMPILER (GLM_COMPILER_GCC44) -# elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 5) -# define GLM_COMPILER (GLM_COMPILER_GCC45) -# elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 6) -# define GLM_COMPILER (GLM_COMPILER_GCC46) -# elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 7) -# define GLM_COMPILER (GLM_COMPILER_GCC47) -# elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 8) -# define GLM_COMPILER (GLM_COMPILER_GCC48) -# elif (__GNUC__ == 4) && (__GNUC_MINOR__ >= 9) -# define GLM_COMPILER (GLM_COMPILER_GCC49) -# elif (__GNUC__ > 4 ) -# define GLM_COMPILER (GLM_COMPILER_GCC50) -# else -# define GLM_COMPILER (GLM_COMPILER_GCC) -# endif - -#else -# define GLM_COMPILER GLM_COMPILER_UNKNOWN -#endif - -#ifndef GLM_COMPILER -#error "GLM_COMPILER undefined, your compiler may not be supported by GLM. Add #define GLM_COMPILER 0 to ignore this message." -#endif//GLM_COMPILER - -// Report compiler detection -#if defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_COMPILER_DISPLAYED) -# define GLM_MESSAGE_COMPILER_DISPLAYED -# if GLM_COMPILER & GLM_COMPILER_CUDA -# pragma message("GLM: CUDA compiler detected") -# elif GLM_COMPILER & GLM_COMPILER_VC -# pragma message("GLM: Visual C++ compiler detected") -# elif GLM_COMPILER & GLM_COMPILER_APPLE_CLANG -# pragma message("GLM: Clang compiler detected") -# elif GLM_COMPILER & GLM_COMPILER_LLVM -# pragma message("GLM: LLVM compiler detected") -# elif GLM_COMPILER & GLM_COMPILER_INTEL -# pragma message("GLM: Intel Compiler detected") -# elif GLM_COMPILER & GLM_COMPILER_GCC -# pragma message("GLM: GCC compiler detected") -# else -# pragma message("GLM: Compiler not detected") -# endif -#endif//GLM_MESSAGE - -/////////////////////////////////////////////////////////////////////////////////// -// Build model - -#if defined(__arch64__) || defined(__LP64__) || defined(_M_X64) || defined(__ppc64__) || defined(__x86_64__) -# define GLM_MODEL GLM_MODEL_64 -#elif defined(__i386__) || defined(__ppc__) -# define GLM_MODEL GLM_MODEL_32 -#else -# define GLM_MODEL GLM_MODEL_32 -#endif// - -#if !defined(GLM_MODEL) && GLM_COMPILER != 0 -# error "GLM_MODEL undefined, your compiler may not be supported by GLM. Add #define GLM_MODEL 0 to ignore this message." -#endif//GLM_MODEL - -#if defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_MODEL_DISPLAYED) -# define GLM_MESSAGE_MODEL_DISPLAYED -# if(GLM_MODEL == GLM_MODEL_64) -# pragma message("GLM: 64 bits model") -# elif(GLM_MODEL == GLM_MODEL_32) -# pragma message("GLM: 32 bits model") -# endif//GLM_MODEL -#endif//GLM_MESSAGE - -/////////////////////////////////////////////////////////////////////////////////// -// C++ Version - -// User defines: GLM_FORCE_CXX98, GLM_FORCE_CXX03, GLM_FORCE_CXX11, GLM_FORCE_CXX14 - -#define GLM_LANG_CXX98_FLAG (1 << 1) -#define GLM_LANG_CXX03_FLAG (1 << 2) -#define GLM_LANG_CXX0X_FLAG (1 << 3) -#define GLM_LANG_CXX11_FLAG (1 << 4) -#define GLM_LANG_CXX1Y_FLAG (1 << 5) -#define GLM_LANG_CXX14_FLAG (1 << 6) -#define GLM_LANG_CXX1Z_FLAG (1 << 7) -#define GLM_LANG_CXXMS_FLAG (1 << 8) -#define GLM_LANG_CXXGNU_FLAG (1 << 9) - -#define GLM_LANG_CXX98 GLM_LANG_CXX98_FLAG -#define GLM_LANG_CXX03 (GLM_LANG_CXX98 | GLM_LANG_CXX03_FLAG) -#define GLM_LANG_CXX0X (GLM_LANG_CXX03 | GLM_LANG_CXX0X_FLAG) -#define GLM_LANG_CXX11 (GLM_LANG_CXX0X | GLM_LANG_CXX11_FLAG) -#define GLM_LANG_CXX1Y (GLM_LANG_CXX11 | GLM_LANG_CXX1Y_FLAG) -#define GLM_LANG_CXX14 (GLM_LANG_CXX1Y | GLM_LANG_CXX14_FLAG) -#define GLM_LANG_CXX1Z (GLM_LANG_CXX14 | GLM_LANG_CXX1Z_FLAG) -#define GLM_LANG_CXXMS GLM_LANG_CXXMS_FLAG -#define GLM_LANG_CXXGNU GLM_LANG_CXXGNU_FLAG - -#if defined(GLM_FORCE_CXX14) -# undef GLM_FORCE_CXX11 -# undef GLM_FORCE_CXX03 -# undef GLM_FORCE_CXX98 -# define GLM_LANG GLM_LANG_CXX14 -#elif defined(GLM_FORCE_CXX11) -# undef GLM_FORCE_CXX03 -# undef GLM_FORCE_CXX98 -# define GLM_LANG GLM_LANG_CXX11 -#elif defined(GLM_FORCE_CXX03) -# undef GLM_FORCE_CXX98 -# define GLM_LANG GLM_LANG_CXX03 -#elif defined(GLM_FORCE_CXX98) -# define GLM_LANG GLM_LANG_CXX98 -#else -# if GLM_COMPILER & (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM) -# if __cplusplus >= 201402L // GLM_COMPILER_LLVM34 + -std=c++14 -# define GLM_LANG GLM_LANG_CXX14 -# elif __has_feature(cxx_decltype_auto) && __has_feature(cxx_aggregate_nsdmi) // GLM_COMPILER_LLVM33 + -std=c++1y -# define GLM_LANG GLM_LANG_CXX1Y -# elif __cplusplus >= 201103L // GLM_COMPILER_LLVM33 + -std=c++11 -# define GLM_LANG GLM_LANG_CXX11 -# elif __has_feature(cxx_static_assert) // GLM_COMPILER_LLVM29 + -std=c++11 -# define GLM_LANG GLM_LANG_CXX0X -# elif __cplusplus >= 199711L -# define GLM_LANG GLM_LANG_CXX98 -# else -# define GLM_LANG GLM_LANG_CXX -# endif -# elif GLM_COMPILER & GLM_COMPILER_GCC -# if __cplusplus >= 201402L -# define GLM_LANG GLM_LANG_CXX14 -# elif __cplusplus >= 201103L -# define GLM_LANG GLM_LANG_CXX11 -# elif defined(__GXX_EXPERIMENTAL_CXX0X__) -# define GLM_LANG GLM_LANG_CXX0X -# else -# define GLM_LANG GLM_LANG_CXX98 -# endif -# elif GLM_COMPILER & GLM_COMPILER_VC -# ifdef _MSC_EXTENSIONS -# if __cplusplus >= 201402L -# define GLM_LANG (GLM_LANG_CXX14 | GLM_LANG_CXXMS_FLAG) -//# elif GLM_COMPILER >= GLM_COMPILER_VC2015 -//# define GLM_LANG (GLM_LANG_CXX1Y | GLM_LANG_CXXMS_FLAG) -# elif __cplusplus >= 201103L -# define GLM_LANG (GLM_LANG_CXX11 | GLM_LANG_CXXMS_FLAG) -# elif GLM_COMPILER >= GLM_COMPILER_VC2010 -# define GLM_LANG (GLM_LANG_CXX0X | GLM_LANG_CXXMS_FLAG) -# elif __cplusplus >= 199711L -# define GLM_LANG (GLM_LANG_CXX98 | GLM_LANG_CXXMS_FLAG) -# else -# define GLM_LANG (GLM_LANG_CXX | GLM_LANG_CXXMS_FLAG) -# endif -# else -# if __cplusplus >= 201402L -# define GLM_LANG GLM_LANG_CXX14 -//# elif GLM_COMPILER >= GLM_COMPILER_VC2015 -//# define GLM_LANG GLM_LANG_CXX1Y -# elif __cplusplus >= 201103L -# define GLM_LANG GLM_LANG_CXX11 -# elif GLM_COMPILER >= GLM_COMPILER_VC2010 -# define GLM_LANG GLM_LANG_CXX0X -# elif __cplusplus >= 199711L -# define GLM_LANG GLM_LANG_CXX98 -# else -# define GLM_LANG GLM_LANG_CXX -# endif -# endif -# elif GLM_COMPILER & GLM_COMPILER_INTEL -# ifdef _MSC_EXTENSIONS -# if __cplusplus >= 201402L -# define GLM_LANG (GLM_LANG_CXX14 | GLM_LANG_CXXMS_FLAG) -# elif __cplusplus >= 201103L -# define GLM_LANG (GLM_LANG_CXX11 | GLM_LANG_CXXMS_FLAG) -# elif GLM_COMPILER >= GLM_COMPILER_INTEL13 -# define GLM_LANG (GLM_LANG_CXX0X | GLM_LANG_CXXMS_FLAG) -# elif __cplusplus >= 199711L -# define GLM_LANG (GLM_LANG_CXX98 | GLM_LANG_CXXMS_FLAG) -# else -# define GLM_LANG (GLM_LANG_CXX | GLM_LANG_CXXMS_FLAG) -# endif -# else -# if __cplusplus >= 201402L -# define GLM_LANG (GLM_LANG_CXX14 | GLM_LANG_CXXMS_FLAG) -# elif __cplusplus >= 201103L -# define GLM_LANG (GLM_LANG_CXX11 | GLM_LANG_CXXMS_FLAG) -# elif GLM_COMPILER >= GLM_COMPILER_INTEL13 -# define GLM_LANG (GLM_LANG_CXX0X | GLM_LANG_CXXMS_FLAG) -# elif __cplusplus >= 199711L -# define GLM_LANG (GLM_LANG_CXX98 | GLM_LANG_CXXMS_FLAG) -# else -# define GLM_LANG (GLM_LANG_CXX | GLM_LANG_CXXMS_FLAG) -# endif -# endif -# else // Unkown compiler -# if __cplusplus >= 201402L -# define GLM_LANG GLM_LANG_CXX14 -# elif __cplusplus >= 201103L -# define GLM_LANG GLM_LANG_CXX11 -# elif __cplusplus >= 199711L -# define GLM_LANG GLM_LANG_CXX98 -# else -# define GLM_LANG GLM_LANG_CXX // Good luck with that! -# endif -# ifndef GLM_FORCE_PURE -# define GLM_FORCE_PURE -# endif -# endif -#endif - -#if defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_LANG_DISPLAYED) -# define GLM_MESSAGE_LANG_DISPLAYED - -# if GLM_LANG & GLM_LANG_CXX1Z_FLAG -# pragma message("GLM: C++1z") -# elif GLM_LANG & GLM_LANG_CXX14_FLAG -# pragma message("GLM: C++14") -# elif GLM_LANG & GLM_LANG_CXX1Y_FLAG -# pragma message("GLM: C++1y") -# elif GLM_LANG & GLM_LANG_CXX11_FLAG -# pragma message("GLM: C++11") -# elif GLM_LANG & GLM_LANG_CXX0X_FLAG -# pragma message("GLM: C++0x") -# elif GLM_LANG & GLM_LANG_CXX03_FLAG -# pragma message("GLM: C++03") -# elif GLM_LANG & GLM_LANG_CXX98_FLAG -# pragma message("GLM: C++98") -# else -# pragma message("GLM: C++ language undetected") -# endif//GLM_LANG - -# if GLM_LANG & (GLM_LANG_CXXGNU_FLAG | GLM_LANG_CXXMS_FLAG) -# pragma message("GLM: Language extensions enabled") -# endif//GLM_LANG -#endif//GLM_MESSAGE - -/////////////////////////////////////////////////////////////////////////////////// -// Has of C++ features - -// http://clang.llvm.org/cxx_status.html -// http://gcc.gnu.org/projects/cxx0x.html -// http://msdn.microsoft.com/en-us/library/vstudio/hh567368(v=vs.120).aspx - -#if GLM_PLATFORM == GLM_PLATFORM_ANDROID -# define GLM_HAS_CXX11_STL 0 -#elif GLM_COMPILER & (GLM_COMPILER_LLVM | GLM_COMPILER_APPLE_CLANG) -# define GLM_HAS_CXX11_STL __has_include(<__config>) -#else -# define GLM_HAS_CXX11_STL ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && \ - ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC48)) || \ - ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2013))) -#endif - -// N1720 -#if GLM_COMPILER & (GLM_COMPILER_LLVM | GLM_COMPILER_APPLE_CLANG) -# define GLM_HAS_STATIC_ASSERT __has_feature(cxx_static_assert) -#elif GLM_LANG & GLM_LANG_CXX11_FLAG -# define GLM_HAS_STATIC_ASSERT 1 -#else -# define GLM_HAS_STATIC_ASSERT (GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ - ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC43)) || \ - ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2010))) -#endif - -// N1988 -#if GLM_LANG & GLM_LANG_CXX11_FLAG -# define GLM_HAS_EXTENDED_INTEGER_TYPE 1 -#else -# define GLM_HAS_EXTENDED_INTEGER_TYPE (\ - ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2012)) || \ - ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC43)) || \ - ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_LLVM) && (GLM_COMPILER >= GLM_COMPILER_LLVM30)) || \ - ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_APPLE_CLANG) && (GLM_COMPILER >= GLM_COMPILER_APPLE_CLANG40))) -#endif - -// N2235 -#if GLM_COMPILER & (GLM_COMPILER_LLVM | GLM_COMPILER_APPLE_CLANG) -# define GLM_HAS_CONSTEXPR __has_feature(cxx_constexpr) -# define GLM_HAS_CONSTEXPR_PARTIAL GLM_HAS_CONSTEXPR -#elif GLM_LANG & GLM_LANG_CXX11_FLAG -# define GLM_HAS_CONSTEXPR 1 -# define GLM_HAS_CONSTEXPR_PARTIAL GLM_HAS_CONSTEXPR -#else -# define GLM_HAS_CONSTEXPR (GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ - ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC46))) -# define GLM_HAS_CONSTEXPR_PARTIAL GLM_HAS_CONSTEXPR || ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2015)) -#endif - -// N2672 -#if GLM_COMPILER & (GLM_COMPILER_LLVM | GLM_COMPILER_APPLE_CLANG) -# define GLM_HAS_INITIALIZER_LISTS __has_feature(cxx_generalized_initializers) -#elif GLM_LANG & GLM_LANG_CXX11_FLAG -# define GLM_HAS_INITIALIZER_LISTS 1 -#else -# define GLM_HAS_INITIALIZER_LISTS (GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ - ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC44)) || \ - ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2013))) -#endif - -// N2544 Unrestricted unions -#if GLM_COMPILER & (GLM_COMPILER_LLVM | GLM_COMPILER_APPLE_CLANG) -# define GLM_HAS_UNRESTRICTED_UNIONS __has_feature(cxx_unrestricted_unions) -#elif GLM_LANG & (GLM_LANG_CXX11_FLAG | GLM_LANG_CXXMS_FLAG) -# define GLM_HAS_UNRESTRICTED_UNIONS 1 -#else -# define GLM_HAS_UNRESTRICTED_UNIONS (GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ - ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC46))) -#endif - -// N2346 -#if GLM_COMPILER & (GLM_COMPILER_LLVM | GLM_COMPILER_APPLE_CLANG) -# define GLM_HAS_DEFAULTED_FUNCTIONS __has_feature(cxx_defaulted_functions) -#elif GLM_LANG & GLM_LANG_CXX11_FLAG -# define GLM_HAS_DEFAULTED_FUNCTIONS 1 -#else -# define GLM_HAS_DEFAULTED_FUNCTIONS (GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ - ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC44)) || \ - ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2013))) -#endif - -// N2118 -#if GLM_COMPILER & (GLM_COMPILER_LLVM | GLM_COMPILER_APPLE_CLANG) -# define GLM_HAS_RVALUE_REFERENCES __has_feature(cxx_rvalue_references) -#elif GLM_LANG & GLM_LANG_CXX11_FLAG -# define GLM_HAS_RVALUE_REFERENCES 1 -#else -# define GLM_HAS_RVALUE_REFERENCES (GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ - ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC43)) || \ - ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2012))) -#endif - -// N2437 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2437.pdf -#if GLM_COMPILER & (GLM_COMPILER_LLVM | GLM_COMPILER_APPLE_CLANG) -# define GLM_HAS_EXPLICIT_CONVERSION_OPERATORS __has_feature(cxx_explicit_conversions) -#elif GLM_LANG & GLM_LANG_CXX11_FLAG -# define GLM_HAS_EXPLICIT_CONVERSION_OPERATORS 1 -#else -# define GLM_HAS_EXPLICIT_CONVERSION_OPERATORS (GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ - ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC45)) || \ - ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL14)) || \ - ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2013))) -#endif - -// N2258 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf -#if GLM_COMPILER & (GLM_COMPILER_LLVM | GLM_COMPILER_APPLE_CLANG) -# define GLM_HAS_TEMPLATE_ALIASES __has_feature(cxx_alias_templates) -#elif GLM_LANG & GLM_LANG_CXX11_FLAG -# define GLM_HAS_TEMPLATE_ALIASES 1 -#else -# define GLM_HAS_TEMPLATE_ALIASES (GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ - ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL12_1)) || \ - ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC47)) || \ - ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2013))) -#endif - -// N2930 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2930.html -#if GLM_COMPILER & (GLM_COMPILER_LLVM | GLM_COMPILER_APPLE_CLANG) -# define GLM_HAS_RANGE_FOR __has_feature(cxx_range_for) -#elif GLM_LANG & GLM_LANG_CXX11_FLAG -# define GLM_HAS_RANGE_FOR 1 -#else -# define GLM_HAS_RANGE_FOR (GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ - ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC46)) || \ - ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL13)) || \ - ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2012))) -#endif - -// -#if GLM_LANG & GLM_LANG_CXX11_FLAG -# define GLM_HAS_ASSIGNABLE 1 -#else -# define GLM_HAS_ASSIGNABLE (GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ - ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC49))) -#endif - -// -#define GLM_HAS_TRIVIAL_QUERIES 0//( \ - //((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2013))) - -// -#if GLM_LANG & GLM_LANG_CXX11_FLAG -# define GLM_HAS_MAKE_SIGNED 1 -#else -# define GLM_HAS_MAKE_SIGNED (GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ - ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2013))) -#endif - -// -#if GLM_ARCH == GLM_ARCH_PURE -# define GLM_HAS_BITSCAN_WINDOWS 0 -#else -# define GLM_HAS_BITSCAN_WINDOWS (GLM_PLATFORM & GLM_PLATFORM_WINDOWS) && (\ - (GLM_COMPILER & (GLM_COMPILER_VC | GLM_COMPILER_LLVM | GLM_COMPILER_INTEL)) -#endif - -// OpenMP -#ifdef _OPENMP -# if GLM_COMPILER & GLM_COMPILER_GCC -# if GLM_COMPILER >= GLM_COMPILER_GCC47 -# define GLM_HAS_OPENMP 31 -# elif GLM_COMPILER >= GLM_COMPILER_GCC44 -# define GLM_HAS_OPENMP 30 -# elif GLM_COMPILER >= GLM_COMPILER_GCC42 -# define GLM_HAS_OPENMP 25 -# endif -# endif// GLM_COMPILER & GLM_COMPILER_GCC - -# if GLM_COMPILER & GLM_COMPILER_VC -# if GLM_COMPILER >= GLM_COMPILER_VC2010 -# define GLM_HAS_OPENMP 20 -# endif -# endif// GLM_COMPILER & GLM_COMPILER_VC -#endif - -// Not standard -#define GLM_HAS_ANONYMOUS_UNION (GLM_LANG & GLM_LANG_CXXMS_FLAG) - -/////////////////////////////////////////////////////////////////////////////////// -// Platform - -// User defines: GLM_FORCE_PURE GLM_FORCE_SSE2 GLM_FORCE_SSE3 GLM_FORCE_AVX GLM_FORCE_AVX2 - -#define GLM_ARCH_PURE 0x0000 -#define GLM_ARCH_ARM 0x0001 -#define GLM_ARCH_X86 0x0002 -#define GLM_ARCH_SSE2 0x0004 -#define GLM_ARCH_SSE3 0x0008 -#define GLM_ARCH_SSE4 0x0010 -#define GLM_ARCH_AVX 0x0020 -#define GLM_ARCH_AVX2 0x0040 - -#if defined(GLM_FORCE_PURE) -# define GLM_ARCH GLM_ARCH_PURE -#elif defined(GLM_FORCE_AVX2) -# define GLM_ARCH (GLM_ARCH_AVX2 | GLM_ARCH_AVX | GLM_ARCH_SSE4 | GLM_ARCH_SSE3 | GLM_ARCH_SSE2) -#elif defined(GLM_FORCE_AVX) -# define GLM_ARCH (GLM_ARCH_AVX | GLM_ARCH_SSE4 | GLM_ARCH_SSE3 | GLM_ARCH_SSE2) -#elif defined(GLM_FORCE_SSE4) -# define GLM_ARCH (GLM_ARCH_SSE4 | GLM_ARCH_SSE3 | GLM_ARCH_SSE2) -#elif defined(GLM_FORCE_SSE3) -# define GLM_ARCH (GLM_ARCH_SSE3 | GLM_ARCH_SSE2) -#elif defined(GLM_FORCE_SSE2) -# define GLM_ARCH (GLM_ARCH_SSE2) -#elif (GLM_COMPILER & (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM | GLM_COMPILER_GCC)) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_LINUX)) -# if(__AVX2__) -# define GLM_ARCH (GLM_ARCH_AVX2 | GLM_ARCH_AVX | GLM_ARCH_SSE3 | GLM_ARCH_SSE2) -# elif(__AVX__) -# define GLM_ARCH (GLM_ARCH_AVX | GLM_ARCH_SSE3 | GLM_ARCH_SSE2) -# elif(__SSE3__) -# define GLM_ARCH (GLM_ARCH_SSE3 | GLM_ARCH_SSE2) -# elif(__SSE2__) -# define GLM_ARCH (GLM_ARCH_SSE2) -# else -# define GLM_ARCH GLM_ARCH_PURE -# endif -#elif (GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS)) -# if defined(_M_ARM_FP) -# define GLM_ARCH (GLM_ARCH_ARM) -# elif defined(__AVX2__) -# define GLM_ARCH (GLM_ARCH_AVX2 | GLM_ARCH_AVX | GLM_ARCH_SSE4 | GLM_ARCH_SSE3 | GLM_ARCH_SSE2) -# elif defined(__AVX__) -# define GLM_ARCH (GLM_ARCH_AVX | GLM_ARCH_SSE4 | GLM_ARCH_SSE3 | GLM_ARCH_SSE2) -# elif _M_IX86_FP == 2 -# define GLM_ARCH (GLM_ARCH_SSE2) -# else -# define GLM_ARCH (GLM_ARCH_PURE) -# endif -#elif (GLM_COMPILER & GLM_COMPILER_GCC) && (defined(__i386__) || defined(__x86_64__)) -# if defined(__AVX2__) -# define GLM_ARCH (GLM_ARCH_AVX2 | GLM_ARCH_AVX | GLM_ARCH_SSE4 | GLM_ARCH_SSE3 | GLM_ARCH_SSE2) -# elif defined(__AVX__) -# define GLM_ARCH (GLM_ARCH_AVX | GLM_ARCH_SSE4 | GLM_ARCH_SSE3 | GLM_ARCH_SSE2) -# elif defined(__SSE4_1__ ) -# define GLM_ARCH (GLM_ARCH_SSE4 | GLM_ARCH_SSE3 | GLM_ARCH_SSE2) -# elif defined(__SSE3__) -# define GLM_ARCH (GLM_ARCH_SSE3 | GLM_ARCH_SSE2) -# elif defined(__SSE2__) -# define GLM_ARCH (GLM_ARCH_SSE2) -# else -# define GLM_ARCH (GLM_ARCH_PURE) -# endif -#else -# define GLM_ARCH GLM_ARCH_PURE -#endif - -// With MinGW-W64, including intrinsic headers before intrin.h will produce some errors. The problem is -// that windows.h (and maybe other headers) will silently include intrin.h, which of course causes problems. -// To fix, we just explicitly include intrin.h here. -#if defined(__MINGW64__) && (GLM_ARCH != GLM_ARCH_PURE) -# include <intrin.h> -#endif - -#if GLM_ARCH & GLM_ARCH_AVX2 -# include <immintrin.h> -#endif//GLM_ARCH -#if GLM_ARCH & GLM_ARCH_AVX -# include <immintrin.h> -#endif//GLM_ARCH -#if GLM_ARCH & GLM_ARCH_SSE4 -# include <smmintrin.h> -#endif//GLM_ARCH -#if GLM_ARCH & GLM_ARCH_SSE3 -# include <pmmintrin.h> -#endif//GLM_ARCH -#if GLM_ARCH & GLM_ARCH_SSE2 -# include <emmintrin.h> -# if(GLM_COMPILER == GLM_COMPILER_VC2005) // VC2005 is missing some intrinsics, workaround - inline float _mm_cvtss_f32(__m128 A) { return A.m128_f32[0]; } - inline __m128 _mm_castpd_ps(__m128d PD) { union { __m128 ps; __m128d pd; } c; c.pd = PD; return c.ps; } - inline __m128d _mm_castps_pd(__m128 PS) { union { __m128 ps; __m128d pd; } c; c.ps = PS; return c.pd; } - inline __m128i _mm_castps_si128(__m128 PS) { union { __m128 ps; __m128i pi; } c; c.ps = PS; return c.pi; } - inline __m128 _mm_castsi128_ps(__m128i PI) { union { __m128 ps; __m128i pi; } c; c.pi = PI; return c.ps; } -# endif -#endif//GLM_ARCH - -#if defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_ARCH_DISPLAYED) -# define GLM_MESSAGE_ARCH_DISPLAYED -# if(GLM_ARCH == GLM_ARCH_PURE) -# pragma message("GLM: Platform independent code") -# elif(GLM_ARCH & GLM_ARCH_ARM) -# pragma message("GLM: ARM instruction set") -# elif(GLM_ARCH & GLM_ARCH_AVX2) -# pragma message("GLM: AVX2 instruction set") -# elif(GLM_ARCH & GLM_ARCH_AVX) -# pragma message("GLM: AVX instruction set") -# elif(GLM_ARCH & GLM_ARCH_SSE3) -# pragma message("GLM: SSE3 instruction set") -# elif(GLM_ARCH & GLM_ARCH_SSE2) -# pragma message("GLM: SSE2 instruction set") -# endif//GLM_ARCH -#endif//GLM_MESSAGE - -/////////////////////////////////////////////////////////////////////////////////// -// Static assert - -#if GLM_HAS_STATIC_ASSERT -# define GLM_STATIC_ASSERT(x, message) static_assert(x, message) -#elif defined(BOOST_STATIC_ASSERT) -# define GLM_STATIC_ASSERT(x, message) BOOST_STATIC_ASSERT(x) -#elif GLM_COMPILER & GLM_COMPILER_VC -# define GLM_STATIC_ASSERT(x, message) typedef char __CASSERT__##__LINE__[(x) ? 1 : -1] -#else -# define GLM_STATIC_ASSERT(x, message) -# define GLM_STATIC_ASSERT_NULL -#endif//GLM_LANG - -/////////////////////////////////////////////////////////////////////////////////// -// Qualifiers - -#if GLM_COMPILER & GLM_COMPILER_CUDA -# define GLM_CUDA_FUNC_DEF __device__ __host__ -# define GLM_CUDA_FUNC_DECL __device__ __host__ -#else -# define GLM_CUDA_FUNC_DEF -# define GLM_CUDA_FUNC_DECL -#endif - -#if GLM_COMPILER & GLM_COMPILER_GCC -# define GLM_VAR_USED __attribute__ ((unused)) -#else -# define GLM_VAR_USED -#endif - -#if defined(GLM_FORCE_INLINE) -# if GLM_COMPILER & GLM_COMPILER_VC -# define GLM_INLINE __forceinline -# define GLM_NEVER_INLINE __declspec((noinline)) -# elif GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM) -# define GLM_INLINE inline __attribute__((__always_inline__)) -# define GLM_NEVER_INLINE __attribute__((__noinline__)) -# else -# define GLM_INLINE inline -# define GLM_NEVER_INLINE -# endif//GLM_COMPILER -#else -# define GLM_INLINE inline -# define GLM_NEVER_INLINE -#endif//defined(GLM_FORCE_INLINE) - -#define GLM_FUNC_DECL GLM_CUDA_FUNC_DECL -#define GLM_FUNC_QUALIFIER GLM_CUDA_FUNC_DEF GLM_INLINE - -/////////////////////////////////////////////////////////////////////////////////// -// Swizzle operators - -// User defines: GLM_SWIZZLE - -#if defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_SWIZZLE_DISPLAYED) -# define GLM_MESSAGE_SWIZZLE_DISPLAYED -# if defined(GLM_SWIZZLE) -# pragma message("GLM: Swizzling operators enabled") -# else -# pragma message("GLM: Swizzling operators disabled, #define GLM_SWIZZLE to enable swizzle operators") -# endif -#endif//GLM_MESSAGE - -/////////////////////////////////////////////////////////////////////////////////// -// Qualifiers - -#if (GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS)) -# define GLM_DEPRECATED __declspec(deprecated) -# define GLM_ALIGN(x) __declspec(align(x)) -# define GLM_ALIGNED_STRUCT(x) struct __declspec(align(x)) -# define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef __declspec(align(alignment)) type name -# define GLM_RESTRICT __declspec(restrict) -# define GLM_RESTRICT_VAR __restrict -#elif GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM | GLM_COMPILER_CUDA | GLM_COMPILER_INTEL) -# define GLM_DEPRECATED __attribute__((__deprecated__)) -# define GLM_ALIGN(x) __attribute__((aligned(x))) -# define GLM_ALIGNED_STRUCT(x) struct __attribute__((aligned(x))) -# define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef type name __attribute__((aligned(alignment))) -# define GLM_RESTRICT __restrict__ -# define GLM_RESTRICT_VAR __restrict__ -#else -# define GLM_DEPRECATED -# define GLM_ALIGN -# define GLM_ALIGNED_STRUCT(x) struct -# define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef type name -# define GLM_RESTRICT -# define GLM_RESTRICT_VAR -#endif//GLM_COMPILER - -#if GLM_HAS_CONSTEXPR -# define GLM_CONSTEXPR constexpr -#else -# define GLM_CONSTEXPR -#endif - -/////////////////////////////////////////////////////////////////////////////////// -// Length type - -// User defines: GLM_FORCE_SIZE_T_LENGTH GLM_FORCE_SIZE_FUNC - -namespace glm -{ - using std::size_t; -# if defined(GLM_FORCE_SIZE_T_LENGTH) || defined(GLM_FORCE_SIZE_FUNC) - typedef size_t length_t; -# else - typedef int length_t; -# endif - -namespace detail -{ -# ifdef GLM_FORCE_SIZE_FUNC - typedef size_t component_count_t; -# else - typedef length_t component_count_t; -# endif - - template <typename genType> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR component_count_t component_count(genType const & m) - { -# ifdef GLM_FORCE_SIZE_FUNC - return m.size(); -# else - return m.length(); -# endif - } -}//namespace detail -}//namespace glm - -#if defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_FORCE_SIZE_T_LENGTH) -# define GLM_MESSAGE_FORCE_SIZE_T_LENGTH -# if defined GLM_FORCE_SIZE_FUNC -# pragma message("GLM: .length() is replaced by .size() and returns a std::size_t") -# elif defined GLM_FORCE_SIZE_T_LENGTH -# pragma message("GLM: .length() returns glm::length_t, a typedef of std::size_t") -# else -# pragma message("GLM: .length() returns glm::length_t, a typedef of int following the GLSL specification") -# endif -#endif//GLM_MESSAGE - -/////////////////////////////////////////////////////////////////////////////////// -// countof - -#ifndef __has_feature -# define __has_feature(x) 0 // Compatibility with non-clang compilers. -#endif - -#if GLM_HAS_CONSTEXPR_PARTIAL - namespace glm - { - template <typename T, std::size_t N> - constexpr std::size_t countof(T const (&)[N]) - { - return N; - } - }//namespace glm -# define GLM_COUNTOF(arr) glm::countof(arr) -#elif _MSC_VER -# define GLM_COUNTOF(arr) _countof(arr) -#else -# define GLM_COUNTOF(arr) sizeof(arr) / sizeof(arr[0]) -#endif - -/////////////////////////////////////////////////////////////////////////////////// -// Uninitialize constructors - -namespace glm -{ - enum ctor{uninitialize}; -}//namespace glm diff --git a/extensions/common/glm/detail/type_float.hpp b/extensions/common/glm/detail/type_float.hpp deleted file mode 100644 index 5a1982d204a..00000000000 --- a/extensions/common/glm/detail/type_float.hpp +++ /dev/null @@ -1,96 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/type_float.hpp -/// @date 2008-08-22 / 2011-06-15 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "setup.hpp" - -namespace glm{ -namespace detail -{ - typedef float float32; - typedef double float64; -}//namespace detail - - typedef float lowp_float_t; - typedef float mediump_float_t; - typedef double highp_float_t; - - /// @addtogroup core_precision - /// @{ - - /// Low precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.4 Floats</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef lowp_float_t lowp_float; - - /// Medium precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.4 Floats</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef mediump_float_t mediump_float; - - /// High precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.4 Floats</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef highp_float_t highp_float; - -#if(!defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT)) - typedef mediump_float float_t; -#elif(defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT)) - typedef highp_float float_t; -#elif(!defined(GLM_PRECISION_HIGHP_FLOAT) && defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT)) - typedef mediump_float float_t; -#elif(!defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && defined(GLM_PRECISION_LOWP_FLOAT)) - typedef lowp_float float_t; -#else -# error "GLM error: multiple default precision requested for floating-point types" -#endif - - typedef float float32; - typedef double float64; - -//////////////////// -// check type sizes -#ifndef GLM_STATIC_ASSERT_NULL - GLM_STATIC_ASSERT(sizeof(glm::float32) == 4, "float32 size isn't 4 bytes on this platform"); - GLM_STATIC_ASSERT(sizeof(glm::float64) == 8, "float64 size isn't 8 bytes on this platform"); -#endif//GLM_STATIC_ASSERT_NULL - - /// @} - -}//namespace glm diff --git a/extensions/common/glm/detail/type_gentype.hpp b/extensions/common/glm/detail/type_gentype.hpp deleted file mode 100644 index 0de2678c7ac..00000000000 --- a/extensions/common/glm/detail/type_gentype.hpp +++ /dev/null @@ -1,224 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/type_gentype.hpp -/// @date 2008-10-05 / 2011-06-15 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -namespace glm -{ - enum profile - { - nice, - fast, - simd - }; - - typedef std::size_t sizeType; - -namespace detail -{ - template - < - typename VALTYPE, - template <typename> class TYPE - > - struct genType - { - public: - enum ctor{null}; - - typedef VALTYPE value_type; - typedef VALTYPE & value_reference; - typedef VALTYPE * value_pointer; - typedef VALTYPE const * value_const_pointer; - typedef TYPE<bool> bool_type; - - typedef sizeType size_type; - static bool is_vector(); - static bool is_matrix(); - - typedef TYPE<VALTYPE> type; - typedef TYPE<VALTYPE> * pointer; - typedef TYPE<VALTYPE> const * const_pointer; - typedef TYPE<VALTYPE> const * const const_pointer_const; - typedef TYPE<VALTYPE> * const pointer_const; - typedef TYPE<VALTYPE> & reference; - typedef TYPE<VALTYPE> const & const_reference; - typedef TYPE<VALTYPE> const & param_type; - - ////////////////////////////////////// - // Address (Implementation details) - - value_const_pointer value_address() const{return value_pointer(this);} - value_pointer value_address(){return value_pointer(this);} - - //protected: - // enum kind - // { - // GEN_TYPE, - // VEC_TYPE, - // MAT_TYPE - // }; - - // typedef typename TYPE::kind kind; - }; - - template - < - typename VALTYPE, - template <typename> class TYPE - > - bool genType<VALTYPE, TYPE>::is_vector() - { - return true; - } -/* - template <typename valTypeT, unsigned int colT, unsigned int rowT, profile proT = nice> - class base - { - public: - ////////////////////////////////////// - // Traits - - typedef sizeType size_type; - typedef valTypeT value_type; - - typedef base<value_type, colT, rowT> class_type; - - typedef base<bool, colT, rowT> bool_type; - typedef base<value_type, rowT, 1> col_type; - typedef base<value_type, colT, 1> row_type; - typedef base<value_type, rowT, colT> transpose_type; - - static size_type col_size(); - static size_type row_size(); - static size_type value_size(); - static bool is_scalar(); - static bool is_vector(); - static bool is_matrix(); - - private: - // Data - col_type value[colT]; - - public: - ////////////////////////////////////// - // Constructors - base(); - base(class_type const & m); - - explicit base(T const & x); - explicit base(value_type const * const x); - explicit base(col_type const * const x); - - ////////////////////////////////////// - // Conversions - template <typename vU, uint cU, uint rU, profile pU> - explicit base(base<vU, cU, rU, pU> const & m); - - ////////////////////////////////////// - // Accesses - col_type& operator[](size_type i); - col_type const & operator[](size_type i) const; - - ////////////////////////////////////// - // Unary updatable operators - class_type& operator= (class_type const & x); - class_type& operator+= (T const & x); - class_type& operator+= (class_type const & x); - class_type& operator-= (T const & x); - class_type& operator-= (class_type const & x); - class_type& operator*= (T const & x); - class_type& operator*= (class_type const & x); - class_type& operator/= (T const & x); - class_type& operator/= (class_type const & x); - class_type& operator++ (); - class_type& operator-- (); - }; -*/ - - //template <typename T> - //struct traits - //{ - // static const bool is_signed = false; - // static const bool is_float = false; - // static const bool is_vector = false; - // static const bool is_matrix = false; - // static const bool is_genType = false; - // static const bool is_genIType = false; - // static const bool is_genUType = false; - //}; - - //template <> - //struct traits<half> - //{ - // static const bool is_float = true; - // static const bool is_genType = true; - //}; - - //template <> - //struct traits<float> - //{ - // static const bool is_float = true; - // static const bool is_genType = true; - //}; - - //template <> - //struct traits<double> - //{ - // static const bool is_float = true; - // static const bool is_genType = true; - //}; - - //template <typename genType> - //struct desc - //{ - // typedef genType type; - // typedef genType * pointer; - // typedef genType const* const_pointer; - // typedef genType const *const const_pointer_const; - // typedef genType *const pointer_const; - // typedef genType & reference; - // typedef genType const& const_reference; - // typedef genType const& param_type; - - // typedef typename genType::value_type value_type; - // typedef typename genType::size_type size_type; - // static const typename size_type value_size; - //}; - - //template <typename genType> - //const typename desc<genType>::size_type desc<genType>::value_size = genType::value_size(); - -}//namespace detail -}//namespace glm - -//#include "type_gentype.inl" diff --git a/extensions/common/glm/detail/type_gentype.inl b/extensions/common/glm/detail/type_gentype.inl deleted file mode 100644 index e46e7743211..00000000000 --- a/extensions/common/glm/detail/type_gentype.inl +++ /dev/null @@ -1,370 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/type_gentype.inl -/// @date 2008-10-05 / 2011-06-15 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -namespace glm{ -namespace detail{ - -///////////////////////////////// -// Static functions - -template <typename vT, uint cT, uint rT, profile pT> -typename base<vT, cT, rT, pT>::size_type base<vT, cT, rT, pT>::col_size() -{ - return cT; -} - -template <typename vT, uint cT, uint rT, profile pT> -typename base<vT, cT, rT, pT>::size_type base<vT, cT, rT, pT>::row_size() -{ - return rT; -} - -template <typename vT, uint cT, uint rT, profile pT> -typename base<vT, cT, rT, pT>::size_type base<vT, cT, rT, pT>::value_size() -{ - return rT * cT; -} - -template <typename vT, uint cT, uint rT, profile pT> -bool base<vT, cT, rT, pT>::is_scalar() -{ - return rT == 1 && cT == 1; -} - -template <typename vT, uint cT, uint rT, profile pT> -bool base<vT, cT, rT, pT>::is_vector() -{ - return rT == 1; -} - -template <typename vT, uint cT, uint rT, profile pT> -bool base<vT, cT, rT, pT>::is_matrix() -{ - return rT != 1; -} - -///////////////////////////////// -// Constructor - -template <typename vT, uint cT, uint rT, profile pT> -base<vT, cT, rT, pT>::base() -{ - memset(&this->value, 0, cT * rT * sizeof(vT)); -} - -template <typename vT, uint cT, uint rT, profile pT> -base<vT, cT, rT, pT>::base -( - typename base<vT, cT, rT, pT>::class_type const & m -) -{ - for - ( - typename genType<vT, cT, rT, pT>::size_type i = typename base<vT, cT, rT, pT>::size_type(0); - i < base<vT, cT, rT, pT>::col_size(); - ++i - ) - { - this->value[i] = m[i]; - } -} - -template <typename vT, uint cT, uint rT, profile pT> -base<vT, cT, rT, pT>::base -( - typename base<vT, cT, rT, pT>::T const & x -) -{ - if(rT == 1) // vector - { - for - ( - typename base<vT, cT, rT, pT>::size_type i = typename base<vT, cT, rT, pT>::size_type(0); - i < base<vT, cT, rT, pT>::col_size(); - ++i - ) - { - this->value[i][rT] = x; - } - } - else // matrix - { - memset(&this->value, 0, cT * rT * sizeof(vT)); - - typename base<vT, cT, rT, pT>::size_type stop = cT < rT ? cT : rT; - - for - ( - typename base<vT, cT, rT, pT>::size_type i = typename base<vT, cT, rT, pT>::size_type(0); - i < stop; - ++i - ) - { - this->value[i][i] = x; - } - } -} - -template <typename vT, uint cT, uint rT, profile pT> -base<vT, cT, rT, pT>::base -( - typename base<vT, cT, rT, pT>::value_type const * const x -) -{ - memcpy(&this->value, &x.value, cT * rT * sizeof(vT)); -} - -template <typename vT, uint cT, uint rT, profile pT> -base<vT, cT, rT, pT>::base -( - typename base<vT, cT, rT, pT>::col_type const * const x -) -{ - for - ( - typename base<vT, cT, rT, pT>::size_type i = typename base<vT, cT, rT, pT>::size_type(0); - i < base<vT, cT, rT, pT>::col_size(); - ++i - ) - { - this->value[i] = x[i]; - } -} - -template <typename vT, uint cT, uint rT, profile pT> -template <typename vU, uint cU, uint rU, profile pU> -base<vT, cT, rT, pT>::base -( - base<vU, cU, rU, pU> const & m -) -{ - for - ( - typename base<vT, cT, rT, pT>::size_type i = typename base<vT, cT, rT, pT>::size_type(0); - i < base<vT, cT, rT, pT>::col_size(); - ++i - ) - { - this->value[i] = base<vT, cT, rT, pT>(m[i]); - } -} - -////////////////////////////////////// -// Accesses - -template <typename vT, uint cT, uint rT, profile pT> -typename base<vT, cT, rT, pT>::col_type& base<vT, cT, rT, pT>::operator[] -( - typename base<vT, cT, rT, pT>::size_type i -) -{ - return this->value[i]; -} - -template <typename vT, uint cT, uint rT, profile pT> -typename base<vT, cT, rT, pT>::col_type const & base<vT, cT, rT, pT>::operator[] -( - typename base<vT, cT, rT, pT>::size_type i -) const -{ - return this->value[i]; -} - -////////////////////////////////////// -// Unary updatable operators - -template <typename vT, uint cT, uint rT, profile pT> -typename base<vT, cT, rT, pT>::class_type& base<vT, cT, rT, pT>::operator= -( - typename base<vT, cT, rT, pT>::class_type const & x -) -{ - memcpy(&this->value, &x.value, cT * rT * sizeof(vT)); - return *this; -} - -template <typename vT, uint cT, uint rT, profile pT> -typename base<vT, cT, rT, pT>::class_type& base<vT, cT, rT, pT>::operator+= -( - typename base<vT, cT, rT, pT>::T const & x -) -{ - typename base<vT, cT, rT, pT>::size_type stop_col = x.col_size(); - typename base<vT, cT, rT, pT>::size_type stop_row = x.row_size(); - - for(typename base<vT, cT, rT, pT>::size_type j = 0; j < stop_col; ++j) - for(typename base<vT, cT, rT, pT>::size_type i = 0; i < stop_row; ++i) - this->value[j][i] += x; - - return *this; -} - -template <typename vT, uint cT, uint rT, profile pT> -typename base<vT, cT, rT, pT>::class_type& base<vT, cT, rT, pT>::operator+= -( - typename base<vT, cT, rT, pT>::class_type const & x -) -{ - typename base<vT, cT, rT, pT>::size_type stop_col = x.col_size(); - typename base<vT, cT, rT, pT>::size_type stop_row = x.row_size(); - - for(typename base<vT, cT, rT, pT>::size_type j = 0; j < stop_col; ++j) - for(typename base<vT, cT, rT, pT>::size_type i = 0; i < stop_row; ++i) - this->value[j][i] += x[j][i]; - - return *this; -} - -template <typename vT, uint cT, uint rT, profile pT> -typename base<vT, cT, rT, pT>::class_type& base<vT, cT, rT, pT>::operator-= -( - typename base<vT, cT, rT, pT>::T const & x -) -{ - typename base<vT, cT, rT, pT>::size_type stop_col = x.col_size(); - typename base<vT, cT, rT, pT>::size_type stop_row = x.row_size(); - - for(typename base<vT, cT, rT, pT>::size_type j = 0; j < stop_col; ++j) - for(typename base<vT, cT, rT, pT>::size_type i = 0; i < stop_row; ++i) - this->value[j][i] -= x; - - return *this; -} - -template <typename vT, uint cT, uint rT, profile pT> -typename base<vT, cT, rT, pT>::class_type& base<vT, cT, rT, pT>::operator-= -( - typename base<vT, cT, rT, pT>::class_type const & x -) -{ - typename base<vT, cT, rT, pT>::size_type stop_col = x.col_size(); - typename base<vT, cT, rT, pT>::size_type stop_row = x.row_size(); - - for(typename base<vT, cT, rT, pT>::size_type j = 0; j < stop_col; ++j) - for(typename base<vT, cT, rT, pT>::size_type i = 0; i < stop_row; ++i) - this->value[j][i] -= x[j][i]; - - return *this; -} - -template <typename vT, uint cT, uint rT, profile pT> -typename base<vT, cT, rT, pT>::class_type& base<vT, cT, rT, pT>::operator*= -( - typename base<vT, cT, rT, pT>::T const & x -) -{ - typename base<vT, cT, rT, pT>::size_type stop_col = x.col_size(); - typename base<vT, cT, rT, pT>::size_type stop_row = x.row_size(); - - for(typename base<vT, cT, rT, pT>::size_type j = 0; j < stop_col; ++j) - for(typename base<vT, cT, rT, pT>::size_type i = 0; i < stop_row; ++i) - this->value[j][i] *= x; - - return *this; -} - -template <typename vT, uint cT, uint rT, profile pT> -typename base<vT, cT, rT, pT>::class_type& base<vT, cT, rT, pT>::operator*= -( - typename base<vT, cT, rT, pT>::class_type const & x -) -{ - typename base<vT, cT, rT, pT>::size_type stop_col = x.col_size(); - typename base<vT, cT, rT, pT>::size_type stop_row = x.row_size(); - - for(typename base<vT, cT, rT, pT>::size_type j = 0; j < stop_col; ++j) - for(typename base<vT, cT, rT, pT>::size_type i = 0; i < stop_row; ++i) - this->value[j][i] *= x[j][i]; - - return *this; -} - -template <typename vT, uint cT, uint rT, profile pT> -typename base<vT, cT, rT, pT>::class_type& base<vT, cT, rT, pT>::operator/= -( - typename base<vT, cT, rT, pT>::T const & x -) -{ - typename base<vT, cT, rT, pT>::size_type stop_col = x.col_size(); - typename base<vT, cT, rT, pT>::size_type stop_row = x.row_size(); - - for(typename base<vT, cT, rT, pT>::size_type j = 0; j < stop_col; ++j) - for(typename base<vT, cT, rT, pT>::size_type i = 0; i < stop_row; ++i) - this->value[j][i] /= x; - - return *this; -} - -template <typename vT, uint cT, uint rT, profile pT> -typename base<vT, cT, rT, pT>::class_type& base<vT, cT, rT, pT>::operator/= -( - typename base<vT, cT, rT, pT>::class_type const & x -) -{ - typename base<vT, cT, rT, pT>::size_type stop_col = x.col_size(); - typename base<vT, cT, rT, pT>::size_type stop_row = x.row_size(); - - for(typename base<vT, cT, rT, pT>::size_type j = 0; j < stop_col; ++j) - for(typename base<vT, cT, rT, pT>::size_type i = 0; i < stop_row; ++i) - this->value[j][i] /= x[j][i]; - - return *this; -} - -template <typename vT, uint cT, uint rT, profile pT> -typename base<vT, cT, rT, pT>::class_type& base<vT, cT, rT, pT>::operator++ () -{ - typename base<vT, cT, rT, pT>::size_type stop_col = col_size(); - typename base<vT, cT, rT, pT>::size_type stop_row = row_size(); - - for(typename base<vT, cT, rT, pT>::size_type j = 0; j < stop_col; ++j) - for(typename base<vT, cT, rT, pT>::size_type i = 0; i < stop_row; ++i) - ++this->value[j][i]; - - return *this; -} - -template <typename vT, uint cT, uint rT, profile pT> -typename base<vT, cT, rT, pT>::class_type& base<vT, cT, rT, pT>::operator-- () -{ - typename base<vT, cT, rT, pT>::size_type stop_col = col_size(); - typename base<vT, cT, rT, pT>::size_type stop_row = row_size(); - - for(typename base<vT, cT, rT, pT>::size_type j = 0; j < stop_col; ++j) - for(typename base<vT, cT, rT, pT>::size_type i = 0; i < stop_row; ++i) - --this->value[j][i]; - - return *this; -} - -} //namespace detail -} //namespace glm diff --git a/extensions/common/glm/detail/type_half.hpp b/extensions/common/glm/detail/type_half.hpp deleted file mode 100644 index d050beb03d2..00000000000 --- a/extensions/common/glm/detail/type_half.hpp +++ /dev/null @@ -1,48 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/type_half.hpp -/// @date 2008-08-17 / 2011-09-20 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "setup.hpp" - -namespace glm{ -namespace detail -{ - typedef short hdata; - - GLM_FUNC_DECL float toFloat32(hdata value); - GLM_FUNC_DECL hdata toFloat16(float const & value); - -}//namespace detail -}//namespace glm - -#include "type_half.inl" diff --git a/extensions/common/glm/detail/type_half.inl b/extensions/common/glm/detail/type_half.inl deleted file mode 100644 index ff8740c8236..00000000000 --- a/extensions/common/glm/detail/type_half.inl +++ /dev/null @@ -1,277 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// -/// This half implementation is based on OpenEXR which is Copyright (c) 2002, -/// Industrial Light & Magic, a division of Lucas Digital Ltd. LLC -/// -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/type_half.inl -/// @date 2008-08-17 / 2011-06-15 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -namespace glm{ -namespace detail -{ - GLM_FUNC_QUALIFIER float overflow() - { - volatile float f = 1e10; - - for(int i = 0; i < 10; ++i) - f *= f; // this will overflow before the for loop terminates - return f; - } - - union uif32 - { - GLM_FUNC_QUALIFIER uif32() : - i(0) - {} - - GLM_FUNC_QUALIFIER uif32(float f) : - f(f) - {} - - GLM_FUNC_QUALIFIER uif32(uint32 i) : - i(i) - {} - - float f; - uint32 i; - }; - - GLM_FUNC_QUALIFIER float toFloat32(hdata value) - { - int s = (value >> 15) & 0x00000001; - int e = (value >> 10) & 0x0000001f; - int m = value & 0x000003ff; - - if(e == 0) - { - if(m == 0) - { - // - // Plus or minus zero - // - - detail::uif32 result; - result.i = (unsigned int)(s << 31); - return result.f; - } - else - { - // - // Denormalized number -- renormalize it - // - - while(!(m & 0x00000400)) - { - m <<= 1; - e -= 1; - } - - e += 1; - m &= ~0x00000400; - } - } - else if(e == 31) - { - if(m == 0) - { - // - // Positive or negative infinity - // - - uif32 result; - result.i = (unsigned int)((s << 31) | 0x7f800000); - return result.f; - } - else - { - // - // Nan -- preserve sign and significand bits - // - - uif32 result; - result.i = (unsigned int)((s << 31) | 0x7f800000 | (m << 13)); - return result.f; - } - } - - // - // Normalized number - // - - e = e + (127 - 15); - m = m << 13; - - // - // Assemble s, e and m. - // - - uif32 Result; - Result.i = (unsigned int)((s << 31) | (e << 23) | m); - return Result.f; - } - - GLM_FUNC_QUALIFIER hdata toFloat16(float const & f) - { - uif32 Entry; - Entry.f = f; - int i = (int)Entry.i; - - // - // Our floating point number, f, is represented by the bit - // pattern in integer i. Disassemble that bit pattern into - // the sign, s, the exponent, e, and the significand, m. - // Shift s into the position where it will go in in the - // resulting half number. - // Adjust e, accounting for the different exponent bias - // of float and half (127 versus 15). - // - - int s = (i >> 16) & 0x00008000; - int e = ((i >> 23) & 0x000000ff) - (127 - 15); - int m = i & 0x007fffff; - - // - // Now reassemble s, e and m into a half: - // - - if(e <= 0) - { - if(e < -10) - { - // - // E is less than -10. The absolute value of f is - // less than half_MIN (f may be a small normalized - // float, a denormalized float or a zero). - // - // We convert f to a half zero. - // - - return hdata(s); - } - - // - // E is between -10 and 0. F is a normalized float, - // whose magnitude is less than __half_NRM_MIN. - // - // We convert f to a denormalized half. - // - - m = (m | 0x00800000) >> (1 - e); - - // - // Round to nearest, round "0.5" up. - // - // Rounding may cause the significand to overflow and make - // our number normalized. Because of the way a half's bits - // are laid out, we don't have to treat this case separately; - // the code below will handle it correctly. - // - - if(m & 0x00001000) - m += 0x00002000; - - // - // Assemble the half from s, e (zero) and m. - // - - return hdata(s | (m >> 13)); - } - else if(e == 0xff - (127 - 15)) - { - if(m == 0) - { - // - // F is an infinity; convert f to a half - // infinity with the same sign as f. - // - - return hdata(s | 0x7c00); - } - else - { - // - // F is a NAN; we produce a half NAN that preserves - // the sign bit and the 10 leftmost bits of the - // significand of f, with one exception: If the 10 - // leftmost bits are all zero, the NAN would turn - // into an infinity, so we have to set at least one - // bit in the significand. - // - - m >>= 13; - - return hdata(s | 0x7c00 | m | (m == 0)); - } - } - else - { - // - // E is greater than zero. F is a normalized float. - // We try to convert f to a normalized half. - // - - // - // Round to nearest, round "0.5" up - // - - if(m & 0x00001000) - { - m += 0x00002000; - - if(m & 0x00800000) - { - m = 0; // overflow in significand, - e += 1; // adjust exponent - } - } - - // - // Handle exponent overflow - // - - if (e > 30) - { - overflow(); // Cause a hardware floating point overflow; - - return hdata(s | 0x7c00); - // if this returns, the half becomes an - } // infinity with the same sign as f. - - // - // Assemble the half from s, e and m. - // - - return hdata(s | (e << 10) | (m >> 13)); - } - } - -}//namespace detail -}//namespace glm diff --git a/extensions/common/glm/detail/type_int.hpp b/extensions/common/glm/detail/type_int.hpp deleted file mode 100644 index d44e720561f..00000000000 --- a/extensions/common/glm/detail/type_int.hpp +++ /dev/null @@ -1,326 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/type_int.hpp -/// @date 2008-08-22 / 2013-03-30 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "setup.hpp" -#if GLM_HAS_MAKE_SIGNED -# include <type_traits> -#endif - -#if GLM_HAS_EXTENDED_INTEGER_TYPE -# include <cstdint> -#endif - -namespace glm{ -namespace detail -{ -# if GLM_HAS_EXTENDED_INTEGER_TYPE - typedef std::int8_t int8; - typedef std::int16_t int16; - typedef std::int32_t int32; - typedef std::int64_t int64; - - typedef std::uint8_t uint8; - typedef std::uint16_t uint16; - typedef std::uint32_t uint32; - typedef std::uint64_t uint64; -# else -# if(defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) // C99 detected, 64 bit types available - typedef int64_t sint64; - typedef uint64_t uint64; -# elif GLM_COMPILER & GLM_COMPILER_VC - typedef signed __int64 sint64; - typedef unsigned __int64 uint64; -# elif GLM_COMPILER & GLM_COMPILER_GCC - __extension__ typedef signed long long sint64; - __extension__ typedef unsigned long long uint64; -# else//unknown compiler - typedef signed long long sint64; - typedef unsigned long long uint64; -# endif//GLM_COMPILER - - typedef signed char int8; - typedef signed short int16; - typedef signed int int32; - typedef sint64 int64; - - typedef unsigned char uint8; - typedef unsigned short uint16; - typedef unsigned int uint32; - typedef uint64 uint64; -#endif// - - typedef signed int lowp_int_t; - typedef signed int mediump_int_t; - typedef signed int highp_int_t; - - typedef unsigned int lowp_uint_t; - typedef unsigned int mediump_uint_t; - typedef unsigned int highp_uint_t; - -# if GLM_HAS_MAKE_SIGNED - using std::make_signed; - using std::make_unsigned; - -# else//GLM_HAS_MAKE_SIGNED - template <typename genType> - struct make_signed - {}; - - template <> - struct make_signed<char> - { - typedef char type; - }; - - template <> - struct make_signed<short> - { - typedef short type; - }; - - template <> - struct make_signed<int> - { - typedef int type; - }; - - template <> - struct make_signed<long> - { - typedef long type; - }; - - template <> - struct make_signed<long long> - { - typedef long long type; - }; - - template <> - struct make_signed<unsigned char> - { - typedef char type; - }; - - template <> - struct make_signed<unsigned short> - { - typedef short type; - }; - - template <> - struct make_signed<unsigned int> - { - typedef int type; - }; - - template <> - struct make_signed<unsigned long> - { - typedef long type; - }; - - template <> - struct make_signed<unsigned long long> - { - typedef long long type; - }; - - template <typename genType> - struct make_unsigned - {}; - - template <> - struct make_unsigned<char> - { - typedef unsigned char type; - }; - - template <> - struct make_unsigned<short> - { - typedef unsigned short type; - }; - - template <> - struct make_unsigned<int> - { - typedef unsigned int type; - }; - - template <> - struct make_unsigned<long> - { - typedef unsigned long type; - }; - - template <> - struct make_unsigned<long long> - { - typedef unsigned long long type; - }; - - template <> - struct make_unsigned<unsigned char> - { - typedef unsigned char type; - }; - - template <> - struct make_unsigned<unsigned short> - { - typedef unsigned short type; - }; - - template <> - struct make_unsigned<unsigned int> - { - typedef unsigned int type; - }; - - template <> - struct make_unsigned<unsigned long> - { - typedef unsigned long type; - }; - - template <> - struct make_unsigned<unsigned long long> - { - typedef unsigned long long type; - }; -# endif//GLM_HAS_MAKE_SIGNED -}//namespace detail - - typedef detail::int8 int8; - typedef detail::int16 int16; - typedef detail::int32 int32; - typedef detail::int64 int64; - - typedef detail::uint8 uint8; - typedef detail::uint16 uint16; - typedef detail::uint32 uint32; - typedef detail::uint64 uint64; - - /// @addtogroup core_precision - /// @{ - - /// Low precision signed integer. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.3 Integers</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef detail::lowp_int_t lowp_int; - - /// Medium precision signed integer. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.3 Integers</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef detail::mediump_int_t mediump_int; - - /// High precision signed integer. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.3 Integers</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef detail::highp_int_t highp_int; - - /// Low precision unsigned integer. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.3 Integers</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef detail::lowp_uint_t lowp_uint; - - /// Medium precision unsigned integer. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.3 Integers</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef detail::mediump_uint_t mediump_uint; - - /// High precision unsigned integer. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.3 Integers</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef detail::highp_uint_t highp_uint; - -#if(!defined(GLM_PRECISION_HIGHP_INT) && !defined(GLM_PRECISION_MEDIUMP_INT) && !defined(GLM_PRECISION_LOWP_INT)) - typedef mediump_int int_t; -#elif(defined(GLM_PRECISION_HIGHP_INT) && !defined(GLM_PRECISION_MEDIUMP_INT) && !defined(GLM_PRECISION_LOWP_INT)) - typedef highp_int int_t; -#elif(!defined(GLM_PRECISION_HIGHP_INT) && defined(GLM_PRECISION_MEDIUMP_INT) && !defined(GLM_PRECISION_LOWP_INT)) - typedef mediump_int int_t; -#elif(!defined(GLM_PRECISION_HIGHP_INT) && !defined(GLM_PRECISION_MEDIUMP_INT) && defined(GLM_PRECISION_LOWP_INT)) - typedef lowp_int int_t; -#else -# error "GLM error: multiple default precision requested for signed interger types" -#endif - -#if(!defined(GLM_PRECISION_HIGHP_UINT) && !defined(GLM_PRECISION_MEDIUMP_UINT) && !defined(GLM_PRECISION_LOWP_UINT)) - typedef mediump_uint uint_t; -#elif(defined(GLM_PRECISION_HIGHP_UINT) && !defined(GLM_PRECISION_MEDIUMP_UINT) && !defined(GLM_PRECISION_LOWP_UINT)) - typedef highp_uint uint_t; -#elif(!defined(GLM_PRECISION_HIGHP_UINT) && defined(GLM_PRECISION_MEDIUMP_UINT) && !defined(GLM_PRECISION_LOWP_UINT)) - typedef mediump_uint uint_t; -#elif(!defined(GLM_PRECISION_HIGHP_UINT) && !defined(GLM_PRECISION_MEDIUMP_UINT) && defined(GLM_PRECISION_LOWP_UINT)) - typedef lowp_uint uint_t; -#else -# error "GLM error: multiple default precision requested for unsigned interger types" -#endif - - /// Unsigned integer type. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.3 Integers</a> - typedef unsigned int uint; - - /// @} - -//////////////////// -// check type sizes -#ifndef GLM_STATIC_ASSERT_NULL - GLM_STATIC_ASSERT(sizeof(glm::int8) == 1, "int8 size isn't 1 byte on this platform"); - GLM_STATIC_ASSERT(sizeof(glm::int16) == 2, "int16 size isn't 2 bytes on this platform"); - GLM_STATIC_ASSERT(sizeof(glm::int32) == 4, "int32 size isn't 4 bytes on this platform"); - GLM_STATIC_ASSERT(sizeof(glm::int64) == 8, "int64 size isn't 8 bytes on this platform"); - - GLM_STATIC_ASSERT(sizeof(glm::uint8) == 1, "uint8 size isn't 1 byte on this platform"); - GLM_STATIC_ASSERT(sizeof(glm::uint16) == 2, "uint16 size isn't 2 bytes on this platform"); - GLM_STATIC_ASSERT(sizeof(glm::uint32) == 4, "uint32 size isn't 4 bytes on this platform"); - GLM_STATIC_ASSERT(sizeof(glm::uint64) == 8, "uint64 size isn't 8 bytes on this platform"); -#endif//GLM_STATIC_ASSERT_NULL - -}//namespace glm diff --git a/extensions/common/glm/detail/type_mat.hpp b/extensions/common/glm/detail/type_mat.hpp deleted file mode 100644 index 247e03ed07f..00000000000 --- a/extensions/common/glm/detail/type_mat.hpp +++ /dev/null @@ -1,793 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/type_mat.hpp -/// @date 2010-01-26 / 2011-06-15 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "precision.hpp" - -namespace glm{ -namespace detail -{ - template <typename T, precision P, template <class, precision> class colType, template <class, precision> class rowType> - struct outerProduct_trait{}; -}//namespace detail - - template <typename T, precision P> struct tvec2; - template <typename T, precision P> struct tvec3; - template <typename T, precision P> struct tvec4; - template <typename T, precision P> struct tmat2x2; - template <typename T, precision P> struct tmat2x3; - template <typename T, precision P> struct tmat2x4; - template <typename T, precision P> struct tmat3x2; - template <typename T, precision P> struct tmat3x3; - template <typename T, precision P> struct tmat3x4; - template <typename T, precision P> struct tmat4x2; - template <typename T, precision P> struct tmat4x3; - template <typename T, precision P> struct tmat4x4; - - /// @addtogroup core_precision - /// @{ - - /// 2 columns of 2 components matrix of low precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat2x2<float, lowp> lowp_mat2; - - /// 2 columns of 2 components matrix of medium precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat2x2<float, mediump> mediump_mat2; - - /// 2 columns of 2 components matrix of high precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat2x2<float, highp> highp_mat2; - - /// 2 columns of 2 components matrix of low precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat2x2<float, lowp> lowp_mat2x2; - - /// 2 columns of 2 components matrix of medium precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat2x2<float, mediump> mediump_mat2x2; - - /// 2 columns of 2 components matrix of high precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat2x2<float, highp> highp_mat2x2; - - /// @} - - /// @addtogroup core_precision - /// @{ - - /// 2 columns of 3 components matrix of low precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat2x3<float, lowp> lowp_mat2x3; - - /// 2 columns of 3 components matrix of medium precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat2x3<float, mediump> mediump_mat2x3; - - /// 2 columns of 3 components matrix of high precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat2x3<float, highp> highp_mat2x3; - - /// @} - - /// @addtogroup core_precision - /// @{ - - /// 2 columns of 4 components matrix of low precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat2x4<float, lowp> lowp_mat2x4; - - /// 2 columns of 4 components matrix of medium precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat2x4<float, mediump> mediump_mat2x4; - - /// 2 columns of 4 components matrix of high precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat2x4<float, highp> highp_mat2x4; - - /// @} - - /// @addtogroup core_precision - /// @{ - - /// 3 columns of 2 components matrix of low precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat3x2<float, lowp> lowp_mat3x2; - - /// 3 columns of 2 components matrix of medium precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat3x2<float, mediump> mediump_mat3x2; - - /// 3 columns of 2 components matrix of high precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat3x2<float, highp> highp_mat3x2; - - /// @} - - /// @addtogroup core_precision - /// @{ - - /// 3 columns of 3 components matrix of low precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat3x3<float, lowp> lowp_mat3; - - /// 3 columns of 3 components matrix of medium precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat3x3<float, mediump> mediump_mat3; - - /// 3 columns of 3 components matrix of high precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat3x3<float, highp> highp_mat3; - - /// 3 columns of 3 components matrix of low precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat3x3<float, lowp> lowp_mat3x3; - - /// 3 columns of 3 components matrix of medium precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat3x3<float, mediump> mediump_mat3x3; - - /// 3 columns of 3 components matrix of high precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat3x3<float, highp> highp_mat3x3; - - /// @} - - /// @addtogroup core_precision - /// @{ - - /// 3 columns of 4 components matrix of low precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat3x4<float, lowp> lowp_mat3x4; - - /// 3 columns of 4 components matrix of medium precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat3x4<float, mediump> mediump_mat3x4; - - /// 3 columns of 4 components matrix of high precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat3x4<float, highp> highp_mat3x4; - - /// @} - - /// @addtogroup core_precision - /// @{ - - /// 4 columns of 2 components matrix of low precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat4x2<float, lowp> lowp_mat4x2; - - /// 4 columns of 2 components matrix of medium precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat4x2<float, mediump> mediump_mat4x2; - - /// 4 columns of 2 components matrix of high precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat4x2<float, highp> highp_mat4x2; - - /// @} - - /// @addtogroup core_precision - /// @{ - - /// 4 columns of 3 components matrix of low precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat4x3<float, lowp> lowp_mat4x3; - - /// 4 columns of 3 components matrix of medium precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat4x3<float, mediump> mediump_mat4x3; - - /// 4 columns of 3 components matrix of high precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat4x3<float, highp> highp_mat4x3; - - /// @} - - - /// @addtogroup core_precision - /// @{ - - /// 4 columns of 4 components matrix of low precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat4x4<float, lowp> lowp_mat4; - - /// 4 columns of 4 components matrix of medium precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat4x4<float, mediump> mediump_mat4; - - /// 4 columns of 4 components matrix of high precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat4x4<float, highp> highp_mat4; - - /// 4 columns of 4 components matrix of low precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat4x4<float, lowp> lowp_mat4x4; - - /// 4 columns of 4 components matrix of medium precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat4x4<float, mediump> mediump_mat4x4; - - /// 4 columns of 4 components matrix of high precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat4x4<float, highp> highp_mat4x4; - - /// @} - - /// @addtogroup core_types - /// @{ - - ////////////////////////// - // Float definition - -#if(defined(GLM_PRECISION_LOWP_FLOAT)) - typedef lowp_mat2x2 mat2x2; - typedef lowp_mat2x3 mat2x3; - typedef lowp_mat2x4 mat2x4; - typedef lowp_mat3x2 mat3x2; - typedef lowp_mat3x3 mat3x3; - typedef lowp_mat3x4 mat3x4; - typedef lowp_mat4x2 mat4x2; - typedef lowp_mat4x3 mat4x3; - typedef lowp_mat4x4 mat4x4; -#elif(defined(GLM_PRECISION_MEDIUMP_FLOAT)) - typedef mediump_mat2x2 mat2x2; - typedef mediump_mat2x3 mat2x3; - typedef mediump_mat2x4 mat2x4; - typedef mediump_mat3x2 mat3x2; - typedef mediump_mat3x3 mat3x3; - typedef mediump_mat3x4 mat3x4; - typedef mediump_mat4x2 mat4x2; - typedef mediump_mat4x3 mat4x3; - typedef mediump_mat4x4 mat4x4; -#else - //! 2 columns of 2 components matrix of floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - typedef highp_mat2x2 mat2x2; - - //! 2 columns of 3 components matrix of floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - typedef highp_mat2x3 mat2x3; - - //! 2 columns of 4 components matrix of floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - typedef highp_mat2x4 mat2x4; - - //! 3 columns of 2 components matrix of floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - typedef highp_mat3x2 mat3x2; - - //! 3 columns of 3 components matrix of floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - typedef highp_mat3x3 mat3x3; - - //! 3 columns of 4 components matrix of floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - typedef highp_mat3x4 mat3x4; - - //! 4 columns of 2 components matrix of floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - typedef highp_mat4x2 mat4x2; - - //! 4 columns of 3 components matrix of floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - typedef highp_mat4x3 mat4x3; - - //! 4 columns of 4 components matrix of floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - typedef highp_mat4x4 mat4x4; - -#endif//GLM_PRECISION - - //! 2 columns of 2 components matrix of floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - typedef mat2x2 mat2; - - //! 3 columns of 3 components matrix of floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - typedef mat3x3 mat3; - - //! 4 columns of 4 components matrix of floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - typedef mat4x4 mat4; - - ////////////////////////// - // Double definition - - /// @addtogroup core_precision - /// @{ - - /// 2 columns of 2 components matrix of low precision floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat2x2<double, lowp> lowp_dmat2; - - /// 2 columns of 2 components matrix of medium precision floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat2x2<double, mediump> mediump_dmat2; - - /// 2 columns of 2 components matrix of high precision floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat2x2<double, highp> highp_dmat2; - - /// 2 columns of 2 components matrix of low precision floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat2x2<double, lowp> lowp_dmat2x2; - - /// 2 columns of 2 components matrix of medium precision floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat2x2<double, mediump> mediump_dmat2x2; - - /// 2 columns of 2 components matrix of high precision floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat2x2<double, highp> highp_dmat2x2; - - /// @} - - /// @addtogroup core_precision - /// @{ - - /// 2 columns of 3 components matrix of low precision floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat2x3<double, lowp> lowp_dmat2x3; - - /// 2 columns of 3 components matrix of medium precision floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat2x3<double, mediump> mediump_dmat2x3; - - /// 2 columns of 3 components matrix of high precision floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat2x3<double, highp> highp_dmat2x3; - - /// @} - - /// @addtogroup core_precision - /// @{ - - /// 2 columns of 4 components matrix of low precision floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat2x4<double, lowp> lowp_dmat2x4; - - /// 2 columns of 4 components matrix of medium precision floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat2x4<double, mediump> mediump_dmat2x4; - - /// 2 columns of 4 components matrix of high precision floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat2x4<double, highp> highp_dmat2x4; - - /// @} - - /// @addtogroup core_precision - /// @{ - - /// 3 columns of 2 components matrix of low precision floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat3x2<double, lowp> lowp_dmat3x2; - - /// 3 columns of 2 components matrix of medium precision floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat3x2<double, mediump> mediump_dmat3x2; - - /// 3 columns of 2 components matrix of high precision floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat3x2<double, highp> highp_dmat3x2; - - /// @} - - /// @addtogroup core_precision - /// @{ - - /// 3 columns of 3 components matrix of low precision floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat3x3<float, lowp> lowp_dmat3; - - /// 3 columns of 3 components matrix of medium precision floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat3x3<double, mediump> mediump_dmat3; - - /// 3 columns of 3 components matrix of high precision floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat3x3<double, highp> highp_dmat3; - - /// 3 columns of 3 components matrix of low precision floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat3x3<double, lowp> lowp_dmat3x3; - - /// 3 columns of 3 components matrix of medium precision floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat3x3<double, mediump> mediump_dmat3x3; - - /// 3 columns of 3 components matrix of high precision floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat3x3<double, highp> highp_dmat3x3; - - /// @} - - /// @addtogroup core_precision - /// @{ - - /// 3 columns of 4 components matrix of low precision floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat3x4<double, lowp> lowp_dmat3x4; - - /// 3 columns of 4 components matrix of medium precision floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat3x4<double, mediump> mediump_dmat3x4; - - /// 3 columns of 4 components matrix of high precision floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat3x4<double, highp> highp_dmat3x4; - - /// @} - - /// @addtogroup core_precision - /// @{ - - /// 4 columns of 2 components matrix of low precision floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat4x2<double, lowp> lowp_dmat4x2; - - /// 4 columns of 2 components matrix of medium precision floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat4x2<double, mediump> mediump_dmat4x2; - - /// 4 columns of 2 components matrix of high precision floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat4x2<double, highp> highp_dmat4x2; - - /// @} - - /// @addtogroup core_precision - /// @{ - - /// 4 columns of 3 components matrix of low precision floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat4x3<double, lowp> lowp_dmat4x3; - - /// 4 columns of 3 components matrix of medium precision floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat4x3<double, mediump> mediump_dmat4x3; - - /// 4 columns of 3 components matrix of high precision floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat4x3<double, highp> highp_dmat4x3; - - /// @} - - /// @addtogroup core_precision - /// @{ - - /// 4 columns of 4 components matrix of low precision floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat4x4<double, lowp> lowp_dmat4; - - /// 4 columns of 4 components matrix of medium precision floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat4x4<double, mediump> mediump_dmat4; - - /// 4 columns of 4 components matrix of high precision floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat4x4<double, highp> highp_dmat4; - - /// 4 columns of 4 components matrix of low precision floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat4x4<double, lowp> lowp_dmat4x4; - - /// 4 columns of 4 components matrix of medium precision floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat4x4<double, mediump> mediump_dmat4x4; - - /// 4 columns of 4 components matrix of high precision floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat4x4<double, highp> highp_dmat4x4; - - /// @} - -#if(defined(GLM_PRECISION_LOWP_DOUBLE)) - typedef lowp_dmat2x2 dmat2x2; - typedef lowp_dmat2x3 dmat2x3; - typedef lowp_dmat2x4 dmat2x4; - typedef lowp_dmat3x2 dmat3x2; - typedef lowp_dmat3x3 dmat3x3; - typedef lowp_dmat3x4 dmat3x4; - typedef lowp_dmat4x2 dmat4x2; - typedef lowp_dmat4x3 dmat4x3; - typedef lowp_dmat4x4 dmat4x4; -#elif(defined(GLM_PRECISION_MEDIUMP_DOUBLE)) - typedef mediump_dmat2x2 dmat2x2; - typedef mediump_dmat2x3 dmat2x3; - typedef mediump_dmat2x4 dmat2x4; - typedef mediump_dmat3x2 dmat3x2; - typedef mediump_dmat3x3 dmat3x3; - typedef mediump_dmat3x4 dmat3x4; - typedef mediump_dmat4x2 dmat4x2; - typedef mediump_dmat4x3 dmat4x3; - typedef mediump_dmat4x4 dmat4x4; -#else //defined(GLM_PRECISION_HIGHP_DOUBLE) - - //! 2 * 2 matrix of double-precision floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - typedef highp_dmat2x2 dmat2; - - //! 3 * 3 matrix of double-precision floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - typedef highp_dmat3x3 dmat3; - - //! 4 * 4 matrix of double-precision floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - typedef highp_dmat4x4 dmat4; - - //! 2 * 2 matrix of double-precision floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - typedef highp_dmat2x2 dmat2x2; - - //! 2 * 3 matrix of double-precision floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - typedef highp_dmat2x3 dmat2x3; - - //! 2 * 4 matrix of double-precision floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - typedef highp_dmat2x4 dmat2x4; - - //! 3 * 2 matrix of double-precision floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - typedef highp_dmat3x2 dmat3x2; - - /// 3 * 3 matrix of double-precision floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - typedef highp_dmat3x3 dmat3x3; - - /// 3 * 4 matrix of double-precision floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - typedef highp_dmat3x4 dmat3x4; - - /// 4 * 2 matrix of double-precision floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - typedef highp_dmat4x2 dmat4x2; - - /// 4 * 3 matrix of double-precision floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - typedef highp_dmat4x3 dmat4x3; - - /// 4 * 4 matrix of double-precision floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - typedef highp_dmat4x4 dmat4x4; - -#endif//GLM_PRECISION - - /// @} -}//namespace glm diff --git a/extensions/common/glm/detail/type_mat.inl b/extensions/common/glm/detail/type_mat.inl deleted file mode 100644 index d6f43abc6d5..00000000000 --- a/extensions/common/glm/detail/type_mat.inl +++ /dev/null @@ -1,32 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/type_mat.inl -/// @date 2011-06-15 / 2011-06-15 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - diff --git a/extensions/common/glm/detail/type_mat2x2.hpp b/extensions/common/glm/detail/type_mat2x2.hpp deleted file mode 100644 index 45594bb3508..00000000000 --- a/extensions/common/glm/detail/type_mat2x2.hpp +++ /dev/null @@ -1,223 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/type_mat2x2.hpp -/// @date 2005-01-27 / 2011-06-15 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "../fwd.hpp" -#include "type_vec2.hpp" -#include "type_mat.hpp" -#include <limits> -#include <cstddef> - -namespace glm -{ - template <typename T, precision P = defaultp> - struct tmat2x2 - { - typedef tvec2<T, P> col_type; - typedef tvec2<T, P> row_type; - typedef tmat2x2<T, P> type; - typedef tmat2x2<T, P> transpose_type; - typedef T value_type; - - template <typename U, precision Q> - friend tvec2<U, Q> operator/(tmat2x2<U, Q> const & m, tvec2<U, Q> const & v); - template <typename U, precision Q> - friend tvec2<U, Q> operator/(tvec2<U, Q> const & v, tmat2x2<U, Q> const & m); - - private: - /// @cond DETAIL - col_type value[2]; - /// @endcond - - public: - ////////////////////////////////////// - // Constructors - GLM_FUNC_DECL tmat2x2(); - GLM_FUNC_DECL tmat2x2(tmat2x2<T, P> const & m); - template <precision Q> - GLM_FUNC_DECL tmat2x2(tmat2x2<T, Q> const & m); - - GLM_FUNC_DECL explicit tmat2x2(ctor); - GLM_FUNC_DECL explicit tmat2x2(T const & x); - GLM_FUNC_DECL tmat2x2( - T const & x1, T const & y1, - T const & x2, T const & y2); - GLM_FUNC_DECL tmat2x2( - col_type const & v1, - col_type const & v2); - - ////////////////////////////////////// - // Conversions - template <typename U, typename V, typename M, typename N> - GLM_FUNC_DECL tmat2x2( - U const & x1, V const & y1, - M const & x2, N const & y2); - - template <typename U, typename V> - GLM_FUNC_DECL tmat2x2( - tvec2<U, P> const & v1, - tvec2<V, P> const & v2); - - ////////////////////////////////////// - // Matrix conversions - -# ifdef GLM_FORCE_EXPLICIT_CTOR - template <typename U, precision Q> - GLM_FUNC_DECL explicit tmat2x2(tmat2x2<U, Q> const & m); -# else - template <typename U, precision Q> - GLM_FUNC_DECL tmat2x2(tmat2x2<U, Q> const & m); -# endif - - GLM_FUNC_DECL explicit tmat2x2(tmat3x3<T, P> const & x); - GLM_FUNC_DECL explicit tmat2x2(tmat4x4<T, P> const & x); - GLM_FUNC_DECL explicit tmat2x2(tmat2x3<T, P> const & x); - GLM_FUNC_DECL explicit tmat2x2(tmat3x2<T, P> const & x); - GLM_FUNC_DECL explicit tmat2x2(tmat2x4<T, P> const & x); - GLM_FUNC_DECL explicit tmat2x2(tmat4x2<T, P> const & x); - GLM_FUNC_DECL explicit tmat2x2(tmat3x4<T, P> const & x); - GLM_FUNC_DECL explicit tmat2x2(tmat4x3<T, P> const & x); - - ////////////////////////////////////// - // Accesses - -# ifdef GLM_FORCE_SIZE_FUNC - typedef size_t size_type; - GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const; - - GLM_FUNC_DECL col_type & operator[](size_type i); - GLM_FUNC_DECL col_type const & operator[](size_type i) const; -# else - typedef length_t length_type; - GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const; - - GLM_FUNC_DECL col_type & operator[](length_type i); - GLM_FUNC_DECL col_type const & operator[](length_type i) const; -# endif//GLM_FORCE_SIZE_FUNC - - ////////////////////////////////////// - // Unary arithmetic operators - - GLM_FUNC_DECL tmat2x2<T, P> & operator=(tmat2x2<T, P> const & v); - - template <typename U> - GLM_FUNC_DECL tmat2x2<T, P> & operator=(tmat2x2<U, P> const & m); - template <typename U> - GLM_FUNC_DECL tmat2x2<T, P> & operator+=(U s); - template <typename U> - GLM_FUNC_DECL tmat2x2<T, P> & operator+=(tmat2x2<U, P> const & m); - template <typename U> - GLM_FUNC_DECL tmat2x2<T, P> & operator-=(U s); - template <typename U> - GLM_FUNC_DECL tmat2x2<T, P> & operator-=(tmat2x2<U, P> const & m); - template <typename U> - GLM_FUNC_DECL tmat2x2<T, P> & operator*=(U s); - template <typename U> - GLM_FUNC_DECL tmat2x2<T, P> & operator*=(tmat2x2<U, P> const & m); - template <typename U> - GLM_FUNC_DECL tmat2x2<T, P> & operator/=(U s); - template <typename U> - GLM_FUNC_DECL tmat2x2<T, P> & operator/=(tmat2x2<U, P> const & m); - - ////////////////////////////////////// - // Increment and decrement operators - - GLM_FUNC_DECL tmat2x2<T, P> & operator++ (); - GLM_FUNC_DECL tmat2x2<T, P> & operator-- (); - GLM_FUNC_DECL tmat2x2<T, P> operator++(int); - GLM_FUNC_DECL tmat2x2<T, P> operator--(int); - }; - - // Binary operators - template <typename T, precision P> - GLM_FUNC_DECL tmat2x2<T, P> operator+(tmat2x2<T, P> const & m, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tmat2x2<T, P> operator+(T const & s, tmat2x2<T, P> const & m); - - template <typename T, precision P> - GLM_FUNC_DECL tmat2x2<T, P> operator+(tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m2); - - template <typename T, precision P> - GLM_FUNC_DECL tmat2x2<T, P> operator-(tmat2x2<T, P> const & m, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tmat2x2<T, P> operator-(T const & s, tmat2x2<T, P> const & m); - - template <typename T, precision P> - GLM_FUNC_DECL tmat2x2<T, P> operator-(tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m2); - - template <typename T, precision P> - GLM_FUNC_DECL tmat2x2<T, P> operator*(tmat2x2<T, P> const & m, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tmat2x2<T, P> operator*(T const & s, tmat2x2<T, P> const & m); - - template <typename T, precision P> - GLM_FUNC_DECL typename tmat2x2<T, P>::col_type operator*(tmat2x2<T, P> const & m, typename tmat2x2<T, P>::row_type const & v); - - template <typename T, precision P> - GLM_FUNC_DECL typename tmat2x2<T, P>::row_type operator*(typename tmat2x2<T, P>::col_type const & v, tmat2x2<T, P> const & m); - - template <typename T, precision P> - GLM_FUNC_DECL tmat2x2<T, P> operator*(tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m2); - - template <typename T, precision P> - GLM_FUNC_DECL tmat3x2<T, P> operator*(tmat2x2<T, P> const & m1, tmat3x2<T, P> const & m2); - - template <typename T, precision P> - GLM_FUNC_DECL tmat4x2<T, P> operator*(tmat2x2<T, P> const & m1, tmat4x2<T, P> const & m2); - - template <typename T, precision P> - GLM_FUNC_DECL tmat2x2<T, P> operator/(tmat2x2<T, P> const & m, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tmat2x2<T, P> operator/(T const & s, tmat2x2<T, P> const & m); - - template <typename T, precision P> - GLM_FUNC_DECL typename tmat2x2<T, P>::col_type operator/(tmat2x2<T, P> const & m, typename tmat2x2<T, P>::row_type const & v); - - template <typename T, precision P> - GLM_FUNC_DECL typename tmat2x2<T, P>::row_type operator/(typename tmat2x2<T, P>::col_type const & v, tmat2x2<T, P> const & m); - - template <typename T, precision P> - GLM_FUNC_DECL tmat2x2<T, P> operator/(tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m2); - - // Unary constant operators - template <typename T, precision P> - GLM_FUNC_DECL tmat2x2<T, P> const operator-(tmat2x2<T, P> const & m); -} //namespace glm - -#ifndef GLM_EXTERNAL_TEMPLATE -#include "type_mat2x2.inl" -#endif diff --git a/extensions/common/glm/detail/type_mat2x2.inl b/extensions/common/glm/detail/type_mat2x2.inl deleted file mode 100644 index 779cc091a2d..00000000000 --- a/extensions/common/glm/detail/type_mat2x2.inl +++ /dev/null @@ -1,548 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/type_mat2x2.inl -/// @date 2005-01-16 / 2011-06-15 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -namespace glm{ -namespace detail -{ - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x2<T, P> compute_inverse(tmat2x2<T, P> const & m) - { - T OneOverDeterminant = static_cast<T>(1) / ( - + m[0][0] * m[1][1] - - m[1][0] * m[0][1]); - - tmat2x2<T, P> Inverse( - + m[1][1] * OneOverDeterminant, - - m[0][1] * OneOverDeterminant, - - m[1][0] * OneOverDeterminant, - + m[0][0] * OneOverDeterminant); - - return Inverse; - } -}//namespace detail - - ////////////////////////////////////////////////////////////// - // Constructors - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2() - { -# ifndef GLM_FORCE_NO_CTOR_INIT - this->value[0] = col_type(1, 0); - this->value[1] = col_type(0, 1); -# endif - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat2x2<T, P> const & m) - { - this->value[0] = m.value[0]; - this->value[1] = m.value[1]; - } - - template <typename T, precision P> - template <precision Q> - GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat2x2<T, Q> const & m) - { - this->value[0] = m.value[0]; - this->value[1] = m.value[1]; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(ctor) - {} - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(T const & s) - { - this->value[0] = col_type(s, 0); - this->value[1] = col_type(0, s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2 - ( - T const & x0, T const & y0, - T const & x1, T const & y1 - ) - { - this->value[0] = col_type(x0, y0); - this->value[1] = col_type(x1, y1); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(col_type const & v0, col_type const & v1) - { - this->value[0] = v0; - this->value[1] = v1; - } - - ////////////////////////////////////// - // Conversion constructors - template <typename T, precision P> - template <typename X1, typename Y1, typename X2, typename Y2> - GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2 - ( - X1 const & x1, Y1 const & y1, - X2 const & x2, Y2 const & y2 - ) - { - this->value[0] = col_type(static_cast<T>(x1), value_type(y1)); - this->value[1] = col_type(static_cast<T>(x2), value_type(y2)); - } - - template <typename T, precision P> - template <typename V1, typename V2> - GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tvec2<V1, P> const & v1, tvec2<V2, P> const & v2) - { - this->value[0] = col_type(v1); - this->value[1] = col_type(v2); - } - - ////////////////////////////////////////////////////////////// - // mat2x2 matrix conversions - - template <typename T, precision P> - template <typename U, precision Q> - GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat2x2<U, Q> const & m) - { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat3x3<T, P> const & m) - { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat4x4<T, P> const & m) - { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat2x3<T, P> const & m) - { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat3x2<T, P> const & m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat2x4<T, P> const & m) - { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat4x2<T, P> const & m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat3x4<T, P> const & m) - { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat4x3<T, P> const & m) - { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - } - - ////////////////////////////////////// - // Accesses - -# ifdef GLM_FORCE_SIZE_FUNC - template <typename T, precision P> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat2x2<T, P>::size_type tmat2x2<T, P>::size() const - { - return 2; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tmat2x2<T, P>::col_type & tmat2x2<T, P>::operator[](typename tmat2x2<T, P>::size_type i) - { - assert(i < this->size()); - return this->value[i]; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tmat2x2<T, P>::col_type const & tmat2x2<T, P>::operator[](typename tmat2x2<T, P>::size_type i) const - { - assert(i < this->size()); - return this->value[i]; - } -# else - template <typename T, precision P> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat2x2<T, P>::length_type tmat2x2<T, P>::length() const - { - return 2; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tmat2x2<T, P>::col_type & tmat2x2<T, P>::operator[](typename tmat2x2<T, P>::length_type i) - { - assert(i < this->length()); - return this->value[i]; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tmat2x2<T, P>::col_type const & tmat2x2<T, P>::operator[](typename tmat2x2<T, P>::length_type i) const - { - assert(i < this->length()); - return this->value[i]; - } -# endif//GLM_FORCE_SIZE_FUNC - - ////////////////////////////////////////////////////////////// - // Unary updatable operators - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator=(tmat2x2<T, P> const & m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator=(tmat2x2<U, P> const & m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator+=(U s) - { - this->value[0] += s; - this->value[1] += s; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator+=(tmat2x2<U, P> const & m) - { - this->value[0] += m[0]; - this->value[1] += m[1]; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator-=(U s) - { - this->value[0] -= s; - this->value[1] -= s; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator-=(tmat2x2<U, P> const & m) - { - this->value[0] -= m[0]; - this->value[1] -= m[1]; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator*=(U s) - { - this->value[0] *= s; - this->value[1] *= s; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator*=(tmat2x2<U, P> const & m) - { - return (*this = *this * m); - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator/=(U s) - { - this->value[0] /= s; - this->value[1] /= s; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator/=(tmat2x2<U, P> const & m) - { - return (*this = *this * detail::compute_inverse<T, P>(m)); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator++() - { - ++this->value[0]; - ++this->value[1]; - return *this; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator--() - { - --this->value[0]; - --this->value[1]; - return *this; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x2<T, P> tmat2x2<T, P>::operator++(int) - { - tmat2x2<T, P> Result(*this); - ++*this; - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x2<T, P> tmat2x2<T, P>::operator--(int) - { - tmat2x2<T, P> Result(*this); - --*this; - return Result; - } - - ////////////////////////////////////////////////////////////// - // Binary operators - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x2<T, P> operator+(tmat2x2<T, P> const & m, T const & s) - { - return tmat2x2<T, P>( - m[0] + s, - m[1] + s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x2<T, P> operator+(T const & s, tmat2x2<T, P> const & m) - { - return tmat2x2<T, P>( - m[0] + s, - m[1] + s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x2<T, P> operator+(tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m2) - { - return tmat2x2<T, P>( - m1[0] + m2[0], - m1[1] + m2[1]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x2<T, P> operator-(tmat2x2<T, P> const & m, T const & s) - { - return tmat2x2<T, P>( - m[0] - s, - m[1] - s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x2<T, P> operator-(T const & s, tmat2x2<T, P> const & m) - { - return tmat2x2<T, P>( - s - m[0], - s - m[1]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x2<T, P> operator-(tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m2) - { - return tmat2x2<T, P>( - m1[0] - m2[0], - m1[1] - m2[1]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x2<T, P> operator*(tmat2x2<T, P> const & m, T const & s) - { - return tmat2x2<T, P>( - m[0] * s, - m[1] * s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x2<T, P> operator*(T const & s, tmat2x2<T, P> const & m) - { - return tmat2x2<T, P>( - m[0] * s, - m[1] * s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tmat2x2<T, P>::col_type operator* - ( - tmat2x2<T, P> const & m, - typename tmat2x2<T, P>::row_type const & v - ) - { - return tvec2<T, P>( - m[0][0] * v.x + m[1][0] * v.y, - m[0][1] * v.x + m[1][1] * v.y); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tmat2x2<T, P>::row_type operator* - ( - typename tmat2x2<T, P>::col_type const & v, - tmat2x2<T, P> const & m - ) - { - return tvec2<T, P>( - v.x * m[0][0] + v.y * m[0][1], - v.x * m[1][0] + v.y * m[1][1]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x2<T, P> operator*(tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m2) - { - return tmat2x2<T, P>( - m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1], - m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1], - m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1], - m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x2<T, P> operator*(tmat2x2<T, P> const & m1, tmat3x2<T, P> const & m2) - { - return tmat3x2<T, P>( - m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1], - m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1], - m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1], - m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1], - m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1], - m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x2<T, P> operator*(tmat2x2<T, P> const & m1, tmat4x2<T, P> const & m2) - { - return tmat4x2<T, P>( - m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1], - m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1], - m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1], - m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1], - m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1], - m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1], - m1[0][0] * m2[3][0] + m1[1][0] * m2[3][1], - m1[0][1] * m2[3][0] + m1[1][1] * m2[3][1]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x2<T, P> operator/(tmat2x2<T, P> const & m, T const & s) - { - return tmat2x2<T, P>( - m[0] / s, - m[1] / s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x2<T, P> operator/(T const & s, tmat2x2<T, P> const & m) - { - return tmat2x2<T, P>( - s / m[0], - s / m[1]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tmat2x2<T, P>::col_type operator/(tmat2x2<T, P> const & m, typename tmat2x2<T, P>::row_type const & v) - { - return detail::compute_inverse<T, P>(m) * v; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tmat2x2<T, P>::row_type operator/(typename tmat2x2<T, P>::col_type const & v, tmat2x2<T, P> const & m) - { - return v * detail::compute_inverse<T, P>(m); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x2<T, P> operator/(tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m2) - { - tmat2x2<T, P> m1_copy(m1); - return m1_copy /= m2; - } - - // Unary constant operators - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x2<T, P> const operator-(tmat2x2<T, P> const & m) - { - return tmat2x2<T, P>( - -m[0], - -m[1]); - } - - ////////////////////////////////////// - // Boolean operators - - template <typename T, precision P> - GLM_FUNC_QUALIFIER bool operator==(tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m2) - { - return (m1[0] == m2[0]) && (m1[1] == m2[1]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER bool operator!=(tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m2) - { - return (m1[0] != m2[0]) || (m1[1] != m2[1]); - } -} //namespace glm diff --git a/extensions/common/glm/detail/type_mat2x3.hpp b/extensions/common/glm/detail/type_mat2x3.hpp deleted file mode 100644 index 352cabc30a5..00000000000 --- a/extensions/common/glm/detail/type_mat2x3.hpp +++ /dev/null @@ -1,201 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/type_mat2x3.hpp -/// @date 2006-10-01 / 2011-06-15 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "../fwd.hpp" -#include "type_vec2.hpp" -#include "type_vec3.hpp" -#include "type_mat.hpp" -#include <limits> -#include <cstddef> - -namespace glm -{ - template <typename T, precision P = defaultp> - struct tmat2x3 - { - typedef tvec3<T, P> col_type; - typedef tvec2<T, P> row_type; - typedef tmat2x3<T, P> type; - typedef tmat3x2<T, P> transpose_type; - typedef T value_type; - - private: - /// @cond DETAIL - col_type value[2]; - /// @endcond - - public: - // Constructors - GLM_FUNC_DECL tmat2x3(); - GLM_FUNC_DECL tmat2x3(tmat2x3<T, P> const & m); - template <precision Q> - GLM_FUNC_DECL tmat2x3(tmat2x3<T, Q> const & m); - - GLM_FUNC_DECL explicit tmat2x3(ctor); - GLM_FUNC_DECL explicit tmat2x3(T const & s); - GLM_FUNC_DECL tmat2x3( - T const & x0, T const & y0, T const & z0, - T const & x1, T const & y1, T const & z1); - GLM_FUNC_DECL tmat2x3( - col_type const & v0, - col_type const & v1); - - ////////////////////////////////////// - // Conversions - - template <typename X1, typename Y1, typename Z1, typename X2, typename Y2, typename Z2> - GLM_FUNC_DECL tmat2x3( - X1 const & x1, Y1 const & y1, Z1 const & z1, - X2 const & x2, Y2 const & y2, Z2 const & z2); - - template <typename U, typename V> - GLM_FUNC_DECL tmat2x3( - tvec3<U, P> const & v1, - tvec3<V, P> const & v2); - - ////////////////////////////////////// - // Matrix conversion - -# ifdef GLM_FORCE_EXPLICIT_CTOR - template <typename U, precision Q> - GLM_FUNC_DECL explicit tmat2x3(tmat2x3<U, Q> const & m); -# else - template <typename U, precision Q> - GLM_FUNC_DECL tmat2x3(tmat2x3<U, Q> const & m); -# endif - - GLM_FUNC_DECL explicit tmat2x3(tmat2x2<T, P> const & x); - GLM_FUNC_DECL explicit tmat2x3(tmat3x3<T, P> const & x); - GLM_FUNC_DECL explicit tmat2x3(tmat4x4<T, P> const & x); - GLM_FUNC_DECL explicit tmat2x3(tmat2x4<T, P> const & x); - GLM_FUNC_DECL explicit tmat2x3(tmat3x2<T, P> const & x); - GLM_FUNC_DECL explicit tmat2x3(tmat3x4<T, P> const & x); - GLM_FUNC_DECL explicit tmat2x3(tmat4x2<T, P> const & x); - GLM_FUNC_DECL explicit tmat2x3(tmat4x3<T, P> const & x); - - ////////////////////////////////////// - // Accesses - -# ifdef GLM_FORCE_SIZE_FUNC - typedef size_t size_type; - GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const; - - GLM_FUNC_DECL col_type & operator[](size_type i); - GLM_FUNC_DECL col_type const & operator[](size_type i) const; -# else - typedef length_t length_type; - GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const; - - GLM_FUNC_DECL col_type & operator[](length_type i); - GLM_FUNC_DECL col_type const & operator[](length_type i) const; -# endif//GLM_FORCE_SIZE_FUNC - - ////////////////////////////////////// - // Unary arithmetic operators - - GLM_FUNC_DECL tmat2x3<T, P> & operator=(tmat2x3<T, P> const & m); - - template <typename U> - GLM_FUNC_DECL tmat2x3<T, P> & operator=(tmat2x3<U, P> const & m); - template <typename U> - GLM_FUNC_DECL tmat2x3<T, P> & operator+=(U s); - template <typename U> - GLM_FUNC_DECL tmat2x3<T, P> & operator+=(tmat2x3<U, P> const & m); - template <typename U> - GLM_FUNC_DECL tmat2x3<T, P> & operator-=(U s); - template <typename U> - GLM_FUNC_DECL tmat2x3<T, P> & operator-=(tmat2x3<U, P> const & m); - template <typename U> - GLM_FUNC_DECL tmat2x3<T, P> & operator*=(U s); - template <typename U> - GLM_FUNC_DECL tmat2x3<T, P> & operator/=(U s); - - ////////////////////////////////////// - // Increment and decrement operators - - GLM_FUNC_DECL tmat2x3<T, P> & operator++ (); - GLM_FUNC_DECL tmat2x3<T, P> & operator-- (); - GLM_FUNC_DECL tmat2x3<T, P> operator++(int); - GLM_FUNC_DECL tmat2x3<T, P> operator--(int); - }; - - // Binary operators - - template <typename T, precision P> - GLM_FUNC_DECL tmat2x3<T, P> operator+(tmat2x3<T, P> const & m, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tmat2x3<T, P> operator+(tmat2x3<T, P> const & m1, tmat2x3<T, P> const & m2); - - template <typename T, precision P> - GLM_FUNC_DECL tmat2x3<T, P> operator-(tmat2x3<T, P> const & m, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tmat2x3<T, P> operator-(tmat2x3<T, P> const & m1, tmat2x3<T, P> const & m2); - - template <typename T, precision P> - GLM_FUNC_DECL tmat2x3<T, P> operator*(tmat2x3<T, P> const & m, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tmat2x3<T, P> operator*(T const & s, tmat2x3<T, P> const & m); - - template <typename T, precision P> - GLM_FUNC_DECL typename tmat2x3<T, P>::col_type operator*(tmat2x3<T, P> const & m, typename tmat2x3<T, P>::row_type const & v); - - template <typename T, precision P> - GLM_FUNC_DECL typename tmat2x3<T, P>::row_type operator*(typename tmat2x3<T, P>::col_type const & v, tmat2x3<T, P> const & m); - - template <typename T, precision P> - GLM_FUNC_DECL tmat2x3<T, P> operator*(tmat2x3<T, P> const & m1, tmat2x2<T, P> const & m2); - - template <typename T, precision P> - GLM_FUNC_DECL tmat3x3<T, P> operator*(tmat2x3<T, P> const & m1, tmat3x2<T, P> const & m2); - - template <typename T, precision P> - GLM_FUNC_DECL tmat4x3<T, P> operator*(tmat2x3<T, P> const & m1, tmat4x2<T, P> const & m2); - - template <typename T, precision P> - GLM_FUNC_DECL tmat2x3<T, P> operator/(tmat2x3<T, P> const & m, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tmat2x3<T, P> operator/(T const & s, tmat2x3<T, P> const & m); - - // Unary constant operators - template <typename T, precision P> - GLM_FUNC_DECL tmat2x3<T, P> const operator-(tmat2x3<T, P> const & m); -}//namespace glm - -#ifndef GLM_EXTERNAL_TEMPLATE -#include "type_mat2x3.inl" -#endif diff --git a/extensions/common/glm/detail/type_mat2x3.inl b/extensions/common/glm/detail/type_mat2x3.inl deleted file mode 100644 index 32c30fdd916..00000000000 --- a/extensions/common/glm/detail/type_mat2x3.inl +++ /dev/null @@ -1,506 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/type_mat2x3.inl -/// @date 2006-08-05 / 2011-06-15 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - ////////////////////////////////////////////////////////////// - // Constructors - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3() - { -# ifndef GLM_FORCE_NO_CTOR_INIT - this->value[0] = col_type(1, 0, 0); - this->value[1] = col_type(0, 1, 0); -# endif - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat2x3<T, P> const & m) - { - this->value[0] = m.value[0]; - this->value[1] = m.value[1]; - } - - template <typename T, precision P> - template <precision Q> - GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat2x3<T, Q> const & m) - { - this->value[0] = m.value[0]; - this->value[1] = m.value[1]; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(ctor) - {} - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(T const & s) - { - this->value[0] = col_type(s, 0, 0); - this->value[1] = col_type(0, s, 0); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3 - ( - T const & x0, T const & y0, T const & z0, - T const & x1, T const & y1, T const & z1 - ) - { - this->value[0] = col_type(x0, y0, z0); - this->value[1] = col_type(x1, y1, z1); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(col_type const & v0, col_type const & v1) - { - this->value[0] = v0; - this->value[1] = v1; - } - - ////////////////////////////////////// - // Conversion constructors - template <typename T, precision P> - template < - typename X1, typename Y1, typename Z1, - typename X2, typename Y2, typename Z2> - GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3 - ( - X1 const & x1, Y1 const & y1, Z1 const & z1, - X2 const & x2, Y2 const & y2, Z2 const & z2 - ) - { - this->value[0] = col_type(static_cast<T>(x1), value_type(y1), value_type(z1)); - this->value[1] = col_type(static_cast<T>(x2), value_type(y2), value_type(z2)); - } - - template <typename T, precision P> - template <typename V1, typename V2> - GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tvec3<V1, P> const & v1, tvec3<V2, P> const & v2) - { - this->value[0] = col_type(v1); - this->value[1] = col_type(v2); - } - - ////////////////////////////////////// - // Matrix conversions - - template <typename T, precision P> - template <typename U, precision Q> - GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat2x3<U, Q> const & m) - { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat2x2<T, P> const & m) - { - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat3x3<T, P> const & m) - { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat4x4<T, P> const & m) - { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat2x4<T, P> const & m) - { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat3x2<T, P> const & m) - { - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat3x4<T, P> const & m) - { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat4x2<T, P> const & m) - { - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat4x3<T, P> const & m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - } - - ////////////////////////////////////// - // Accesses - -# ifdef GLM_FORCE_SIZE_FUNC - template <typename T, precision P> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat2x3<T, P>::size_type tmat2x3<T, P>::size() const - { - return 2; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tmat2x3<T, P>::col_type & tmat2x3<T, P>::operator[](typename tmat2x3<T, P>::size_type i) - { - assert(i < this->size()); - return this->value[i]; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tmat2x3<T, P>::col_type const & tmat2x3<T, P>::operator[](typename tmat2x3<T, P>::size_type i) const - { - assert(i < this->size()); - return this->value[i]; - } -# else - template <typename T, precision P> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat2x3<T, P>::length_type tmat2x3<T, P>::length() const - { - return 2; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tmat2x3<T, P>::col_type & tmat2x3<T, P>::operator[](typename tmat2x3<T, P>::length_type i) - { - assert(i < this->length()); - return this->value[i]; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tmat2x3<T, P>::col_type const & tmat2x3<T, P>::operator[](typename tmat2x3<T, P>::length_type i) const - { - assert(i < this->length()); - return this->value[i]; - } -# endif//GLM_FORCE_SIZE_FUNC - - ////////////////////////////////////////////////////////////// - // Unary updatable operators - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x3<T, P>& tmat2x3<T, P>::operator=(tmat2x3<T, P> const & m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat2x3<T, P>& tmat2x3<T, P>::operator=(tmat2x3<U, P> const & m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat2x3<T, P> & tmat2x3<T, P>::operator+=(U s) - { - this->value[0] += s; - this->value[1] += s; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat2x3<T, P>& tmat2x3<T, P>::operator+=(tmat2x3<U, P> const & m) - { - this->value[0] += m[0]; - this->value[1] += m[1]; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat2x3<T, P>& tmat2x3<T, P>::operator-=(U s) - { - this->value[0] -= s; - this->value[1] -= s; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat2x3<T, P>& tmat2x3<T, P>::operator-=(tmat2x3<U, P> const & m) - { - this->value[0] -= m[0]; - this->value[1] -= m[1]; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat2x3<T, P>& tmat2x3<T, P>::operator*=(U s) - { - this->value[0] *= s; - this->value[1] *= s; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat2x3<T, P> & tmat2x3<T, P>::operator/=(U s) - { - this->value[0] /= s; - this->value[1] /= s; - return *this; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x3<T, P> & tmat2x3<T, P>::operator++() - { - ++this->value[0]; - ++this->value[1]; - return *this; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x3<T, P> & tmat2x3<T, P>::operator--() - { - --this->value[0]; - --this->value[1]; - return *this; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x3<T, P> tmat2x3<T, P>::operator++(int) - { - tmat2x3<T, P> Result(*this); - ++*this; - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x3<T, P> tmat2x3<T, P>::operator--(int) - { - tmat2x3<T, P> Result(*this); - --*this; - return Result; - } - - ////////////////////////////////////////////////////////////// - // Binary operators - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x3<T, P> operator+(tmat2x3<T, P> const & m, T const & s) - { - return tmat2x3<T, P>( - m[0] + s, - m[1] + s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x3<T, P> operator+(tmat2x3<T, P> const & m1, tmat2x3<T, P> const & m2) - { - return tmat2x3<T, P>( - m1[0] + m2[0], - m1[1] + m2[1]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x3<T, P> operator-(tmat2x3<T, P> const & m, T const & s) - { - return tmat2x3<T, P>( - m[0] - s, - m[1] - s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x3<T, P> operator-(tmat2x3<T, P> const & m1, tmat2x3<T, P> const & m2) - { - return tmat2x3<T, P>( - m1[0] - m2[0], - m1[1] - m2[1]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x3<T, P> operator*(tmat2x3<T, P> const & m, T const & s) - { - return tmat2x3<T, P>( - m[0] * s, - m[1] * s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x3<T, P> operator*(T const & s, tmat2x3<T, P> const & m) - { - return tmat2x3<T, P>( - m[0] * s, - m[1] * s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tmat2x3<T, P>::col_type operator* - ( - tmat2x3<T, P> const & m, - typename tmat2x3<T, P>::row_type const & v) - { - return typename tmat2x3<T, P>::col_type( - m[0][0] * v.x + m[1][0] * v.y, - m[0][1] * v.x + m[1][1] * v.y, - m[0][2] * v.x + m[1][2] * v.y); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tmat2x3<T, P>::row_type operator* - ( - typename tmat2x3<T, P>::col_type const & v, - tmat2x3<T, P> const & m) - { - return typename tmat2x3<T, P>::row_type( - v.x * m[0][0] + v.y * m[0][1] + v.z * m[0][2], - v.x * m[1][0] + v.y * m[1][1] + v.z * m[1][2]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x3<T, P> operator*(tmat2x3<T, P> const & m1, tmat2x2<T, P> const & m2) - { - return tmat2x3<T, P>( - m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1], - m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1], - m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1], - m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1], - m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1], - m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x3<T, P> operator*(tmat2x3<T, P> const & m1, tmat3x2<T, P> const & m2) - { - T SrcA00 = m1[0][0]; - T SrcA01 = m1[0][1]; - T SrcA02 = m1[0][2]; - T SrcA10 = m1[1][0]; - T SrcA11 = m1[1][1]; - T SrcA12 = m1[1][2]; - - T SrcB00 = m2[0][0]; - T SrcB01 = m2[0][1]; - T SrcB10 = m2[1][0]; - T SrcB11 = m2[1][1]; - T SrcB20 = m2[2][0]; - T SrcB21 = m2[2][1]; - - tmat3x3<T, P> Result(uninitialize); - Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01; - Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01; - Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01; - Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11; - Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11; - Result[1][2] = SrcA02 * SrcB10 + SrcA12 * SrcB11; - Result[2][0] = SrcA00 * SrcB20 + SrcA10 * SrcB21; - Result[2][1] = SrcA01 * SrcB20 + SrcA11 * SrcB21; - Result[2][2] = SrcA02 * SrcB20 + SrcA12 * SrcB21; - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x3<T, P> operator*(tmat2x3<T, P> const & m1, tmat4x2<T, P> const & m2) - { - return tmat4x3<T, P>( - m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1], - m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1], - m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1], - m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1], - m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1], - m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1], - m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1], - m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1], - m1[0][2] * m2[2][0] + m1[1][2] * m2[2][1], - m1[0][0] * m2[3][0] + m1[1][0] * m2[3][1], - m1[0][1] * m2[3][0] + m1[1][1] * m2[3][1], - m1[0][2] * m2[3][0] + m1[1][2] * m2[3][1]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x3<T, P> operator/(tmat2x3<T, P> const & m, T const & s) - { - return tmat2x3<T, P>( - m[0] / s, - m[1] / s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x3<T, P> operator/(T const & s, tmat2x3<T, P> const & m) - { - return tmat2x3<T, P>( - s / m[0], - s / m[1]); - } - - // Unary constant operators - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x3<T, P> const operator-(tmat2x3<T, P> const & m) - { - return tmat2x3<T, P>( - -m[0], - -m[1]); - } - - ////////////////////////////////////// - // Boolean operators - - template <typename T, precision P> - GLM_FUNC_QUALIFIER bool operator==(tmat2x3<T, P> const & m1, tmat2x3<T, P> const & m2) - { - return (m1[0] == m2[0]) && (m1[1] == m2[1]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER bool operator!=(tmat2x3<T, P> const & m1, tmat2x3<T, P> const & m2) - { - return (m1[0] != m2[0]) || (m1[1] != m2[1]); - } -} //namespace glm diff --git a/extensions/common/glm/detail/type_mat2x4.hpp b/extensions/common/glm/detail/type_mat2x4.hpp deleted file mode 100644 index 2b2389e42af..00000000000 --- a/extensions/common/glm/detail/type_mat2x4.hpp +++ /dev/null @@ -1,202 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/type_mat2x4.hpp -/// @date 2006-08-05 / 2011-06-15 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "../fwd.hpp" -#include "type_vec2.hpp" -#include "type_vec4.hpp" -#include "type_mat.hpp" -#include <limits> -#include <cstddef> - -namespace glm -{ - template <typename T, precision P = defaultp> - struct tmat2x4 - { - typedef tvec4<T, P> col_type; - typedef tvec2<T, P> row_type; - typedef tmat2x4<T, P> type; - typedef tmat4x2<T, P> transpose_type; - typedef T value_type; - - private: - /// @cond DETAIL - col_type value[2]; - /// @endcond - - public: - // Constructors - GLM_FUNC_DECL tmat2x4(); - GLM_FUNC_DECL tmat2x4(tmat2x4<T, P> const & m); - template <precision Q> - GLM_FUNC_DECL tmat2x4(tmat2x4<T, Q> const & m); - - GLM_FUNC_DECL explicit tmat2x4(ctor); - GLM_FUNC_DECL explicit tmat2x4(T const & s); - GLM_FUNC_DECL tmat2x4( - T const & x0, T const & y0, T const & z0, T const & w0, - T const & x1, T const & y1, T const & z1, T const & w1); - GLM_FUNC_DECL tmat2x4( - col_type const & v0, - col_type const & v1); - - ////////////////////////////////////// - // Conversions - template < - typename X1, typename Y1, typename Z1, typename W1, - typename X2, typename Y2, typename Z2, typename W2> - GLM_FUNC_DECL tmat2x4( - X1 const & x1, Y1 const & y1, Z1 const & z1, W1 const & w1, - X2 const & x2, Y2 const & y2, Z2 const & z2, W2 const & w2); - - template <typename U, typename V> - GLM_FUNC_DECL tmat2x4( - tvec4<U, P> const & v1, - tvec4<V, P> const & v2); - - ////////////////////////////////////// - // Matrix conversions - -# ifdef GLM_FORCE_EXPLICIT_CTOR - template <typename U, precision Q> - GLM_FUNC_DECL explicit tmat2x4(tmat2x4<U, Q> const & m); -# else - template <typename U, precision Q> - GLM_FUNC_DECL tmat2x4(tmat2x4<U, Q> const & m); -# endif - - GLM_FUNC_DECL explicit tmat2x4(tmat2x2<T, P> const & x); - GLM_FUNC_DECL explicit tmat2x4(tmat3x3<T, P> const & x); - GLM_FUNC_DECL explicit tmat2x4(tmat4x4<T, P> const & x); - GLM_FUNC_DECL explicit tmat2x4(tmat2x3<T, P> const & x); - GLM_FUNC_DECL explicit tmat2x4(tmat3x2<T, P> const & x); - GLM_FUNC_DECL explicit tmat2x4(tmat3x4<T, P> const & x); - GLM_FUNC_DECL explicit tmat2x4(tmat4x2<T, P> const & x); - GLM_FUNC_DECL explicit tmat2x4(tmat4x3<T, P> const & x); - - ////////////////////////////////////// - // Accesses - -# ifdef GLM_FORCE_SIZE_FUNC - typedef size_t size_type; - GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const; - - GLM_FUNC_DECL col_type & operator[](size_type i); - GLM_FUNC_DECL col_type const & operator[](size_type i) const; -# else - typedef length_t length_type; - GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const; - - GLM_FUNC_DECL col_type & operator[](length_type i); - GLM_FUNC_DECL col_type const & operator[](length_type i) const; -# endif//GLM_FORCE_SIZE_FUNC - - ////////////////////////////////////// - // Unary arithmetic operators - - GLM_FUNC_DECL tmat2x4<T, P> & operator=(tmat2x4<T, P> const & m); - - template <typename U> - GLM_FUNC_DECL tmat2x4<T, P> & operator=(tmat2x4<U, P> const & m); - template <typename U> - GLM_FUNC_DECL tmat2x4<T, P> & operator+=(U s); - template <typename U> - GLM_FUNC_DECL tmat2x4<T, P> & operator+=(tmat2x4<U, P> const & m); - template <typename U> - GLM_FUNC_DECL tmat2x4<T, P> & operator-=(U s); - template <typename U> - GLM_FUNC_DECL tmat2x4<T, P> & operator-=(tmat2x4<U, P> const & m); - template <typename U> - GLM_FUNC_DECL tmat2x4<T, P> & operator*=(U s); - template <typename U> - GLM_FUNC_DECL tmat2x4<T, P> & operator/=(U s); - - ////////////////////////////////////// - // Increment and decrement operators - - GLM_FUNC_DECL tmat2x4<T, P> & operator++ (); - GLM_FUNC_DECL tmat2x4<T, P> & operator-- (); - GLM_FUNC_DECL tmat2x4<T, P> operator++(int); - GLM_FUNC_DECL tmat2x4<T, P> operator--(int); - }; - - // Binary operators - - template <typename T, precision P> - GLM_FUNC_DECL tmat2x4<T, P> operator+(tmat2x4<T, P> const & m, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tmat2x4<T, P> operator+(tmat2x4<T, P> const & m1, tmat2x4<T, P> const & m2); - - template <typename T, precision P> - GLM_FUNC_DECL tmat2x4<T, P> operator-(tmat2x4<T, P> const & m, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tmat2x4<T, P> operator-(tmat2x4<T, P> const & m1, tmat2x4<T, P> const & m2); - - template <typename T, precision P> - GLM_FUNC_DECL tmat2x4<T, P> operator*(tmat2x4<T, P> const & m, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tmat2x4<T, P> operator*(T const & s, tmat2x4<T, P> const & m); - - template <typename T, precision P> - GLM_FUNC_DECL typename tmat2x4<T, P>::col_type operator*(tmat2x4<T, P> const & m, typename tmat2x4<T, P>::row_type const & v); - - template <typename T, precision P> - GLM_FUNC_DECL typename tmat2x4<T, P>::row_type operator*(typename tmat2x4<T, P>::col_type const & v, tmat2x4<T, P> const & m); - - template <typename T, precision P> - GLM_FUNC_DECL tmat4x4<T, P> operator*(tmat2x4<T, P> const & m1, tmat4x2<T, P> const & m2); - - template <typename T, precision P> - GLM_FUNC_DECL tmat2x4<T, P> operator*(tmat2x4<T, P> const & m1, tmat2x2<T, P> const & m2); - - template <typename T, precision P> - GLM_FUNC_DECL tmat3x4<T, P> operator*(tmat2x4<T, P> const & m1, tmat3x2<T, P> const & m2); - - template <typename T, precision P> - GLM_FUNC_DECL tmat2x4<T, P> operator/(tmat2x4<T, P> const & m, T s); - - template <typename T, precision P> - GLM_FUNC_DECL tmat2x4<T, P> operator/(T s, tmat2x4<T, P> const & m); - - // Unary constant operators - template <typename T, precision P> - GLM_FUNC_DECL tmat2x4<T, P> const operator-(tmat2x4<T, P> const & m); -}//namespace glm - -#ifndef GLM_EXTERNAL_TEMPLATE -#include "type_mat2x4.inl" -#endif diff --git a/extensions/common/glm/detail/type_mat2x4.inl b/extensions/common/glm/detail/type_mat2x4.inl deleted file mode 100644 index fcf5d315a52..00000000000 --- a/extensions/common/glm/detail/type_mat2x4.inl +++ /dev/null @@ -1,515 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/type_mat2x4.inl -/// @date 2006-08-05 / 2011-06-15 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - ////////////////////////////////////////////////////////////// - // Constructors - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4() - { -# ifndef GLM_FORCE_NO_CTOR_INIT - this->value[0] = col_type(1, 0, 0, 0); - this->value[1] = col_type(0, 1, 0, 0); -# endif - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(tmat2x4<T, P> const & m) - { - this->value[0] = m.value[0]; - this->value[1] = m.value[1]; - } - - template <typename T, precision P> - template <precision Q> - GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(tmat2x4<T, Q> const & m) - { - this->value[0] = m.value[0]; - this->value[1] = m.value[1]; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(ctor) - {} - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(T const & s) - { - value_type const Zero(0); - this->value[0] = col_type(s, Zero, Zero, Zero); - this->value[1] = col_type(Zero, s, Zero, Zero); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4 - ( - T const & x0, T const & y0, T const & z0, T const & w0, - T const & x1, T const & y1, T const & z1, T const & w1 - ) - { - this->value[0] = col_type(x0, y0, z0, w0); - this->value[1] = col_type(x1, y1, z1, w1); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(col_type const & v0, col_type const & v1) - { - this->value[0] = v0; - this->value[1] = v1; - } - - ////////////////////////////////////// - // Conversion constructors - template <typename T, precision P> - template < - typename X1, typename Y1, typename Z1, typename W1, - typename X2, typename Y2, typename Z2, typename W2> - GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4 - ( - X1 const & x1, Y1 const & y1, Z1 const & z1, W1 const & w1, - X2 const & x2, Y2 const & y2, Z2 const & z2, W2 const & w2 - ) - { - this->value[0] = col_type(static_cast<T>(x1), value_type(y1), value_type(z1), value_type(w1)); - this->value[1] = col_type(static_cast<T>(x2), value_type(y2), value_type(z2), value_type(w2)); - } - - template <typename T, precision P> - template <typename V1, typename V2> - GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(tvec4<V1, P> const & v1, tvec4<V2, P> const & v2) - { - this->value[0] = col_type(v1); - this->value[1] = col_type(v2); - } - - ////////////////////////////////////// - // Matrix conversions - - template <typename T, precision P> - template <typename U, precision Q> - GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(tmat2x4<U, Q> const & m) - { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(tmat2x2<T, P> const & m) - { - this->value[0] = col_type(m[0], 0, 0); - this->value[1] = col_type(m[1], 0, 0); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(tmat3x3<T, P> const & m) - { - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(tmat4x4<T, P> const & m) - { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(tmat2x3<T, P> const & m) - { - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(tmat3x2<T, P> const & m) - { - this->value[0] = col_type(m[0], 0, 0); - this->value[1] = col_type(m[1], 0, 0); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(tmat3x4<T, P> const & m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(tmat4x2<T, P> const & m) - { - this->value[0] = col_type(m[0], 0, 0); - this->value[1] = col_type(m[1], 0, 0); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(tmat4x3<T, P> const & m) - { - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); - } - - ////////////////////////////////////// - // Accesses - -# ifdef GLM_FORCE_SIZE_FUNC - template <typename T, precision P> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat2x4<T, P>::size_type tmat2x4<T, P>::size() const - { - return 2; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tmat2x4<T, P>::col_type & tmat2x4<T, P>::operator[](typename tmat2x4<T, P>::size_type i) - { - assert(i < this->size()); - return this->value[i]; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tmat2x4<T, P>::col_type const & tmat2x4<T, P>::operator[](typename tmat2x4<T, P>::size_type i) const - { - assert(i < this->size()); - return this->value[i]; - } -# else - template <typename T, precision P> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat2x4<T, P>::length_type tmat2x4<T, P>::length() const - { - return 2; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tmat2x4<T, P>::col_type & tmat2x4<T, P>::operator[](typename tmat2x4<T, P>::length_type i) - { - assert(i < this->length()); - return this->value[i]; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tmat2x4<T, P>::col_type const & tmat2x4<T, P>::operator[](typename tmat2x4<T, P>::length_type i) const - { - assert(i < this->length()); - return this->value[i]; - } -# endif//GLM_FORCE_SIZE_FUNC - - ////////////////////////////////////////////////////////////// - // Unary updatable operators - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x4<T, P>& tmat2x4<T, P>::operator=(tmat2x4<T, P> const & m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat2x4<T, P>& tmat2x4<T, P>::operator=(tmat2x4<U, P> const & m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat2x4<T, P>& tmat2x4<T, P>::operator+=(U s) - { - this->value[0] += s; - this->value[1] += s; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat2x4<T, P>& tmat2x4<T, P>::operator+=(tmat2x4<U, P> const & m) - { - this->value[0] += m[0]; - this->value[1] += m[1]; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat2x4<T, P>& tmat2x4<T, P>::operator-=(U s) - { - this->value[0] -= s; - this->value[1] -= s; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat2x4<T, P>& tmat2x4<T, P>::operator-=(tmat2x4<U, P> const & m) - { - this->value[0] -= m[0]; - this->value[1] -= m[1]; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat2x4<T, P>& tmat2x4<T, P>::operator*=(U s) - { - this->value[0] *= s; - this->value[1] *= s; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat2x4<T, P> & tmat2x4<T, P>::operator/=(U s) - { - this->value[0] /= s; - this->value[1] /= s; - return *this; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x4<T, P>& tmat2x4<T, P>::operator++() - { - ++this->value[0]; - ++this->value[1]; - return *this; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x4<T, P>& tmat2x4<T, P>::operator--() - { - --this->value[0]; - --this->value[1]; - return *this; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x4<T, P> tmat2x4<T, P>::operator++(int) - { - tmat2x4<T, P> Result(*this); - ++*this; - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x4<T, P> tmat2x4<T, P>::operator--(int) - { - tmat2x4<T, P> Result(*this); - --*this; - return Result; - } - - ////////////////////////////////////////////////////////////// - // Binary operators - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x4<T, P> operator+(tmat2x4<T, P> const & m, T const & s) - { - return tmat2x4<T, P>( - m[0] + s, - m[1] + s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x4<T, P> operator+(tmat2x4<T, P> const & m1, tmat2x4<T, P> const & m2) - { - return tmat2x4<T, P>( - m1[0] + m2[0], - m1[1] + m2[1]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x4<T, P> operator-(tmat2x4<T, P> const & m, T const & s) - { - return tmat2x4<T, P>( - m[0] - s, - m[1] - s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x4<T, P> operator-(tmat2x4<T, P> const & m1, tmat2x4<T, P> const & m2) - { - return tmat2x4<T, P>( - m1[0] - m2[0], - m1[1] - m2[1]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x4<T, P> operator*(tmat2x4<T, P> const & m, T const & s) - { - return tmat2x4<T, P>( - m[0] * s, - m[1] * s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x4<T, P> operator*(T const & s, tmat2x4<T, P> const & m) - { - return tmat2x4<T, P>( - m[0] * s, - m[1] * s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tmat2x4<T, P>::col_type operator*(tmat2x4<T, P> const & m, typename tmat2x4<T, P>::row_type const & v) - { - return typename tmat2x4<T, P>::col_type( - m[0][0] * v.x + m[1][0] * v.y, - m[0][1] * v.x + m[1][1] * v.y, - m[0][2] * v.x + m[1][2] * v.y, - m[0][3] * v.x + m[1][3] * v.y); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tmat2x4<T, P>::row_type operator*(typename tmat2x4<T, P>::col_type const & v, tmat2x4<T, P> const & m) - { - return typename tmat2x4<T, P>::row_type( - v.x * m[0][0] + v.y * m[0][1] + v.z * m[0][2] + v.w * m[0][3], - v.x * m[1][0] + v.y * m[1][1] + v.z * m[1][2] + v.w * m[1][3]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P> operator*(tmat2x4<T, P> const & m1, tmat4x2<T, P> const & m2) - { - T SrcA00 = m1[0][0]; - T SrcA01 = m1[0][1]; - T SrcA02 = m1[0][2]; - T SrcA03 = m1[0][3]; - T SrcA10 = m1[1][0]; - T SrcA11 = m1[1][1]; - T SrcA12 = m1[1][2]; - T SrcA13 = m1[1][3]; - - T SrcB00 = m2[0][0]; - T SrcB01 = m2[0][1]; - T SrcB10 = m2[1][0]; - T SrcB11 = m2[1][1]; - T SrcB20 = m2[2][0]; - T SrcB21 = m2[2][1]; - T SrcB30 = m2[3][0]; - T SrcB31 = m2[3][1]; - - tmat4x4<T, P> Result(uninitialize); - Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01; - Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01; - Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01; - Result[0][3] = SrcA03 * SrcB00 + SrcA13 * SrcB01; - Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11; - Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11; - Result[1][2] = SrcA02 * SrcB10 + SrcA12 * SrcB11; - Result[1][3] = SrcA03 * SrcB10 + SrcA13 * SrcB11; - Result[2][0] = SrcA00 * SrcB20 + SrcA10 * SrcB21; - Result[2][1] = SrcA01 * SrcB20 + SrcA11 * SrcB21; - Result[2][2] = SrcA02 * SrcB20 + SrcA12 * SrcB21; - Result[2][3] = SrcA03 * SrcB20 + SrcA13 * SrcB21; - Result[3][0] = SrcA00 * SrcB30 + SrcA10 * SrcB31; - Result[3][1] = SrcA01 * SrcB30 + SrcA11 * SrcB31; - Result[3][2] = SrcA02 * SrcB30 + SrcA12 * SrcB31; - Result[3][3] = SrcA03 * SrcB30 + SrcA13 * SrcB31; - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x4<T, P> operator*(tmat2x4<T, P> const & m1, tmat2x2<T, P> const & m2) - { - return tmat2x4<T, P>( - m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1], - m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1], - m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1], - m1[0][3] * m2[0][0] + m1[1][3] * m2[0][1], - m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1], - m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1], - m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1], - m1[0][3] * m2[1][0] + m1[1][3] * m2[1][1]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x4<T, P> operator*(tmat2x4<T, P> const & m1, tmat3x2<T, P> const & m2) - { - return tmat3x4<T, P>( - m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1], - m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1], - m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1], - m1[0][3] * m2[0][0] + m1[1][3] * m2[0][1], - m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1], - m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1], - m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1], - m1[0][3] * m2[1][0] + m1[1][3] * m2[1][1], - m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1], - m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1], - m1[0][2] * m2[2][0] + m1[1][2] * m2[2][1], - m1[0][3] * m2[2][0] + m1[1][3] * m2[2][1]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x4<T, P> operator/(tmat2x4<T, P> const & m, T s) - { - return tmat2x4<T, P>( - m[0] / s, - m[1] / s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x4<T, P> operator/(T s, tmat2x4<T, P> const & m) - { - return tmat2x4<T, P>( - s / m[0], - s / m[1]); - } - - // Unary constant operators - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x4<T, P> const operator-(tmat2x4<T, P> const & m) - { - return tmat2x4<T, P>( - -m[0], - -m[1]); - } - - ////////////////////////////////////// - // Boolean operators - - template <typename T, precision P> - GLM_FUNC_QUALIFIER bool operator==(tmat2x4<T, P> const & m1, tmat2x4<T, P> const & m2) - { - return (m1[0] == m2[0]) && (m1[1] == m2[1]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER bool operator!=(tmat2x4<T, P> const & m1, tmat2x4<T, P> const & m2) - { - return (m1[0] != m2[0]) || (m1[1] != m2[1]); - } -} //namespace glm diff --git a/extensions/common/glm/detail/type_mat3x2.hpp b/extensions/common/glm/detail/type_mat3x2.hpp deleted file mode 100644 index 2cc5a3c3b9a..00000000000 --- a/extensions/common/glm/detail/type_mat3x2.hpp +++ /dev/null @@ -1,207 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/type_mat3x2.hpp -/// @date 2006-08-05 / 2011-06-15 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "../fwd.hpp" -#include "type_vec2.hpp" -#include "type_vec3.hpp" -#include "type_mat.hpp" -#include <limits> -#include <cstddef> - -namespace glm -{ - template <typename T, precision P = defaultp> - struct tmat3x2 - { - typedef tvec2<T, P> col_type; - typedef tvec3<T, P> row_type; - typedef tmat3x2<T, P> type; - typedef tmat2x3<T, P> transpose_type; - typedef T value_type; - - private: - /// @cond DETAIL - col_type value[3]; - /// @endcond - - public: - // Constructors - GLM_FUNC_DECL tmat3x2(); - GLM_FUNC_DECL tmat3x2(tmat3x2<T, P> const & m); - template <precision Q> - GLM_FUNC_DECL tmat3x2(tmat3x2<T, Q> const & m); - - GLM_FUNC_DECL explicit tmat3x2(ctor); - GLM_FUNC_DECL explicit tmat3x2(T const & s); - GLM_FUNC_DECL tmat3x2( - T const & x0, T const & y0, - T const & x1, T const & y1, - T const & x2, T const & y2); - GLM_FUNC_DECL tmat3x2( - col_type const & v0, - col_type const & v1, - col_type const & v2); - - ////////////////////////////////////// - // Conversions - - template< - typename X1, typename Y1, - typename X2, typename Y2, - typename X3, typename Y3> - GLM_FUNC_DECL tmat3x2( - X1 const & x1, Y1 const & y1, - X2 const & x2, Y2 const & y2, - X3 const & x3, Y3 const & y3); - - template <typename V1, typename V2, typename V3> - GLM_FUNC_DECL tmat3x2( - tvec2<V1, P> const & v1, - tvec2<V2, P> const & v2, - tvec2<V3, P> const & v3); - - ////////////////////////////////////// - // Matrix conversions - -# ifdef GLM_FORCE_EXPLICIT_CTOR - template <typename U, precision Q> - GLM_FUNC_DECL explicit tmat3x2(tmat3x2<U, Q> const & m); -# else - template <typename U, precision Q> - GLM_FUNC_DECL tmat3x2(tmat3x2<U, Q> const & m); -# endif - - GLM_FUNC_DECL explicit tmat3x2(tmat2x2<T, P> const & x); - GLM_FUNC_DECL explicit tmat3x2(tmat3x3<T, P> const & x); - GLM_FUNC_DECL explicit tmat3x2(tmat4x4<T, P> const & x); - GLM_FUNC_DECL explicit tmat3x2(tmat2x3<T, P> const & x); - GLM_FUNC_DECL explicit tmat3x2(tmat2x4<T, P> const & x); - GLM_FUNC_DECL explicit tmat3x2(tmat3x4<T, P> const & x); - GLM_FUNC_DECL explicit tmat3x2(tmat4x2<T, P> const & x); - GLM_FUNC_DECL explicit tmat3x2(tmat4x3<T, P> const & x); - - ////////////////////////////////////// - // Accesses - -# ifdef GLM_FORCE_SIZE_FUNC - typedef size_t size_type; - GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const; - - GLM_FUNC_DECL col_type & operator[](size_type i); - GLM_FUNC_DECL col_type const & operator[](size_type i) const; -# else - typedef length_t length_type; - GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const; - - GLM_FUNC_DECL col_type & operator[](length_type i); - GLM_FUNC_DECL col_type const & operator[](length_type i) const; -# endif//GLM_FORCE_SIZE_FUNC - - ////////////////////////////////////// - // Unary arithmetic operators - - GLM_FUNC_DECL tmat3x2<T, P> & operator=(tmat3x2<T, P> const & m); - - template <typename U> - GLM_FUNC_DECL tmat3x2<T, P> & operator=(tmat3x2<U, P> const & m); - template <typename U> - GLM_FUNC_DECL tmat3x2<T, P> & operator+=(U s); - template <typename U> - GLM_FUNC_DECL tmat3x2<T, P> & operator+=(tmat3x2<U, P> const & m); - template <typename U> - GLM_FUNC_DECL tmat3x2<T, P> & operator-=(U s); - template <typename U> - GLM_FUNC_DECL tmat3x2<T, P> & operator-=(tmat3x2<U, P> const & m); - template <typename U> - GLM_FUNC_DECL tmat3x2<T, P> & operator*=(U s); - template <typename U> - GLM_FUNC_DECL tmat3x2<T, P> & operator/=(U s); - - ////////////////////////////////////// - // Increment and decrement operators - - GLM_FUNC_DECL tmat3x2<T, P> & operator++ (); - GLM_FUNC_DECL tmat3x2<T, P> & operator-- (); - GLM_FUNC_DECL tmat3x2<T, P> operator++(int); - GLM_FUNC_DECL tmat3x2<T, P> operator--(int); - }; - - // Binary operators - template <typename T, precision P> - GLM_FUNC_DECL tmat3x2<T, P> operator+(tmat3x2<T, P> const & m, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tmat3x2<T, P> operator+(tmat3x2<T, P> const & m1, tmat3x2<T, P> const & m2); - - template <typename T, precision P> - GLM_FUNC_DECL tmat3x2<T, P> operator-(tmat3x2<T, P> const & m, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tmat3x2<T, P> operator-(tmat3x2<T, P> const & m1, tmat3x2<T, P> const & m2); - - template <typename T, precision P> - GLM_FUNC_DECL tmat3x2<T, P> operator*(tmat3x2<T, P> const & m, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tmat3x2<T, P> operator*(T const & s, tmat3x2<T, P> const & m); - - template <typename T, precision P> - GLM_FUNC_DECL typename tmat3x2<T, P>::col_type operator*(tmat3x2<T, P> const & m, typename tmat3x2<T, P>::row_type const & v); - - template <typename T, precision P> - GLM_FUNC_DECL typename tmat3x2<T, P>::row_type operator*(typename tmat3x2<T, P>::col_type const & v, tmat3x2<T, P> const & m); - - template <typename T, precision P> - GLM_FUNC_DECL tmat2x2<T, P> operator*(tmat3x2<T, P> const & m1, tmat2x3<T, P> const & m2); - - template <typename T, precision P> - GLM_FUNC_DECL tmat3x2<T, P> operator*(tmat3x2<T, P> const & m1, tmat3x3<T, P> const & m2); - - template <typename T, precision P> - GLM_FUNC_DECL tmat4x2<T, P> operator*(tmat3x2<T, P> const & m1, tmat4x3<T, P> const & m2); - - template <typename T, precision P> - GLM_FUNC_DECL tmat3x2<T, P> operator/(tmat3x2<T, P> const & m, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tmat3x2<T, P> operator/(T const & s, tmat3x2<T, P> const & m); - - // Unary constant operators - template <typename T, precision P> - GLM_FUNC_DECL tmat3x2<T, P> const operator-(tmat3x2<T, P> const & m); -}//namespace glm - -#ifndef GLM_EXTERNAL_TEMPLATE -#include "type_mat3x2.inl" -#endif diff --git a/extensions/common/glm/detail/type_mat3x2.inl b/extensions/common/glm/detail/type_mat3x2.inl deleted file mode 100644 index d42a9aec57b..00000000000 --- a/extensions/common/glm/detail/type_mat3x2.inl +++ /dev/null @@ -1,540 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/type_mat3x2.inl -/// @date 2006-08-05 / 2011-06-15 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - ////////////////////////////////////////////////////////////// - // Constructors - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2() - { -# ifndef GLM_FORCE_NO_CTOR_INIT - this->value[0] = col_type(1, 0); - this->value[1] = col_type(0, 1); - this->value[2] = col_type(0, 0); -# endif - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(tmat3x2<T, P> const & m) - { - this->value[0] = m.value[0]; - this->value[1] = m.value[1]; - this->value[2] = m.value[2]; - } - - template <typename T, precision P> - template <precision Q> - GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(tmat3x2<T, Q> const & m) - { - this->value[0] = m.value[0]; - this->value[1] = m.value[1]; - this->value[2] = m.value[2]; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(ctor) - {} - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(T const & s) - { - this->value[0] = col_type(s, 0); - this->value[1] = col_type(0, s); - this->value[2] = col_type(0, 0); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2 - ( - T const & x0, T const & y0, - T const & x1, T const & y1, - T const & x2, T const & y2 - ) - { - this->value[0] = col_type(x0, y0); - this->value[1] = col_type(x1, y1); - this->value[2] = col_type(x2, y2); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2 - ( - col_type const & v0, - col_type const & v1, - col_type const & v2 - ) - { - this->value[0] = v0; - this->value[1] = v1; - this->value[2] = v2; - } - - ////////////////////////////////////// - // Conversion constructors - template <typename T, precision P> - template < - typename X1, typename Y1, - typename X2, typename Y2, - typename X3, typename Y3> - GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2 - ( - X1 const & x1, Y1 const & y1, - X2 const & x2, Y2 const & y2, - X3 const & x3, Y3 const & y3 - ) - { - this->value[0] = col_type(static_cast<T>(x1), value_type(y1)); - this->value[1] = col_type(static_cast<T>(x2), value_type(y2)); - this->value[2] = col_type(static_cast<T>(x3), value_type(y3)); - } - - template <typename T, precision P> - template <typename V1, typename V2, typename V3> - GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2 - ( - tvec2<V1, P> const & v1, - tvec2<V2, P> const & v2, - tvec2<V3, P> const & v3 - ) - { - this->value[0] = col_type(v1); - this->value[1] = col_type(v2); - this->value[2] = col_type(v3); - } - - ////////////////////////////////////////////////////////////// - // mat3x2 matrix conversions - - template <typename T, precision P> - template <typename U, precision Q> - GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(tmat3x2<U, Q> const & m) - { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(tmat2x2<T, P> const & m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = col_type(0); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(tmat3x3<T, P> const & m) - { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(tmat4x4<T, P> const & m) - { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(tmat2x3<T, P> const & m) - { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(T(0)); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(tmat2x4<T, P> const & m) - { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(T(0)); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(tmat3x4<T, P> const & m) - { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(tmat4x2<T, P> const & m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(tmat4x3<T, P> const & m) - { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); - } - - ////////////////////////////////////// - // Accesses - -# ifdef GLM_FORCE_SIZE_FUNC - template <typename T, precision P> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat3x2<T, P>::size_type tmat3x2<T, P>::size() const - { - return 3; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tmat3x2<T, P>::col_type & tmat3x2<T, P>::operator[](typename tmat3x2<T, P>::size_type i) - { - assert(i < this->size()); - return this->value[i]; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tmat3x2<T, P>::col_type const & tmat3x2<T, P>::operator[](typename tmat3x2<T, P>::size_type i) const - { - assert(i < this->size()); - return this->value[i]; - } -# else - template <typename T, precision P> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat3x2<T, P>::length_type tmat3x2<T, P>::length() const - { - return 3; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tmat3x2<T, P>::col_type & tmat3x2<T, P>::operator[](typename tmat3x2<T, P>::length_type i) - { - assert(i < this->length()); - return this->value[i]; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tmat3x2<T, P>::col_type const & tmat3x2<T, P>::operator[](typename tmat3x2<T, P>::length_type i) const - { - assert(i < this->length()); - return this->value[i]; - } -# endif//GLM_FORCE_SIZE_FUNC - - ////////////////////////////////////////////////////////////// - // Unary updatable operators - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x2<T, P>& tmat3x2<T, P>::operator=(tmat3x2<T, P> const & m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat3x2<T, P>& tmat3x2<T, P>::operator=(tmat3x2<U, P> const & m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat3x2<T, P>& tmat3x2<T, P>::operator+=(U s) - { - this->value[0] += s; - this->value[1] += s; - this->value[2] += s; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat3x2<T, P>& tmat3x2<T, P>::operator+=(tmat3x2<U, P> const & m) - { - this->value[0] += m[0]; - this->value[1] += m[1]; - this->value[2] += m[2]; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat3x2<T, P>& tmat3x2<T, P>::operator-=(U s) - { - this->value[0] -= s; - this->value[1] -= s; - this->value[2] -= s; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat3x2<T, P>& tmat3x2<T, P>::operator-=(tmat3x2<U, P> const & m) - { - this->value[0] -= m[0]; - this->value[1] -= m[1]; - this->value[2] -= m[2]; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat3x2<T, P>& tmat3x2<T, P>::operator*=(U s) - { - this->value[0] *= s; - this->value[1] *= s; - this->value[2] *= s; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat3x2<T, P> & tmat3x2<T, P>::operator/=(U s) - { - this->value[0] /= s; - this->value[1] /= s; - this->value[2] /= s; - return *this; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x2<T, P>& tmat3x2<T, P>::operator++() - { - ++this->value[0]; - ++this->value[1]; - ++this->value[2]; - return *this; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x2<T, P>& tmat3x2<T, P>::operator--() - { - --this->value[0]; - --this->value[1]; - --this->value[2]; - return *this; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x2<T, P> tmat3x2<T, P>::operator++(int) - { - tmat3x2<T, P> Result(*this); - ++*this; - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x2<T, P> tmat3x2<T, P>::operator--(int) - { - tmat3x2<T, P> Result(*this); - --*this; - return Result; - } - - ////////////////////////////////////////////////////////////// - // Binary operators - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x2<T, P> operator+(tmat3x2<T, P> const & m, T const & s) - { - return tmat3x2<T, P>( - m[0] + s, - m[1] + s, - m[2] + s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x2<T, P> operator+(tmat3x2<T, P> const & m1, tmat3x2<T, P> const & m2) - { - return tmat3x2<T, P>( - m1[0] + m2[0], - m1[1] + m2[1], - m1[2] + m2[2]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x2<T, P> operator-(tmat3x2<T, P> const & m, T const & s) - { - return tmat3x2<T, P>( - m[0] - s, - m[1] - s, - m[2] - s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x2<T, P> operator-(tmat3x2<T, P> const & m1, tmat3x2<T, P> const & m2) - { - return tmat3x2<T, P>( - m1[0] - m2[0], - m1[1] - m2[1], - m1[2] - m2[2]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x2<T, P> operator*(tmat3x2<T, P> const & m, T const & s) - { - return tmat3x2<T, P>( - m[0] * s, - m[1] * s, - m[2] * s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x2<T, P> operator*(T const & s, tmat3x2<T, P> const & m) - { - return tmat3x2<T, P>( - m[0] * s, - m[1] * s, - m[2] * s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tmat3x2<T, P>::col_type operator*(tmat3x2<T, P> const & m, typename tmat3x2<T, P>::row_type const & v) - { - return typename tmat3x2<T, P>::col_type( - m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z, - m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tmat3x2<T, P>::row_type operator*(typename tmat3x2<T, P>::col_type const & v, tmat3x2<T, P> const & m) - { - return typename tmat3x2<T, P>::row_type( - v.x * m[0][0] + v.y * m[0][1], - v.x * m[1][0] + v.y * m[1][1], - v.x * m[2][0] + v.y * m[2][1]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x2<T, P> operator*(tmat3x2<T, P> const & m1, tmat2x3<T, P> const & m2) - { - const T SrcA00 = m1[0][0]; - const T SrcA01 = m1[0][1]; - const T SrcA10 = m1[1][0]; - const T SrcA11 = m1[1][1]; - const T SrcA20 = m1[2][0]; - const T SrcA21 = m1[2][1]; - - const T SrcB00 = m2[0][0]; - const T SrcB01 = m2[0][1]; - const T SrcB02 = m2[0][2]; - const T SrcB10 = m2[1][0]; - const T SrcB11 = m2[1][1]; - const T SrcB12 = m2[1][2]; - - tmat2x2<T, P> Result(uninitialize); - Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02; - Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02; - Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12; - Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12; - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x2<T, P> operator*(tmat3x2<T, P> const & m1, tmat3x3<T, P> const & m2) - { - return tmat3x2<T, P>( - m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2], - m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2], - m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2], - m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2], - m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1] + m1[2][0] * m2[2][2], - m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1] + m1[2][1] * m2[2][2]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x2<T, P> operator*(tmat3x2<T, P> const & m1, tmat4x3<T, P> const & m2) - { - return tmat4x2<T, P>( - m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2], - m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2], - m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2], - m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2], - m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1] + m1[2][0] * m2[2][2], - m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1] + m1[2][1] * m2[2][2], - m1[0][0] * m2[3][0] + m1[1][0] * m2[3][1] + m1[2][0] * m2[3][2], - m1[0][1] * m2[3][0] + m1[1][1] * m2[3][1] + m1[2][1] * m2[3][2]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x2<T, P> operator/(tmat3x2<T, P> const & m, T const & s) - { - return tmat3x2<T, P>( - m[0] / s, - m[1] / s, - m[2] / s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x2<T, P> operator/(T const & s, tmat3x2<T, P> const & m) - { - return tmat3x2<T, P>( - s / m[0], - s / m[1], - s / m[2]); - } - - // Unary constant operators - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x2<T, P> const operator-(tmat3x2<T, P> const & m) - { - return tmat3x2<T, P>( - -m[0], - -m[1], - -m[2]); - } - - ////////////////////////////////////// - // Boolean operators - - template <typename T, precision P> - GLM_FUNC_QUALIFIER bool operator==(tmat3x2<T, P> const & m1, tmat3x2<T, P> const & m2) - { - return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER bool operator!=(tmat3x2<T, P> const & m1, tmat3x2<T, P> const & m2) - { - return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]); - } -} //namespace glm diff --git a/extensions/common/glm/detail/type_mat3x3.hpp b/extensions/common/glm/detail/type_mat3x3.hpp deleted file mode 100644 index beccfa8b407..00000000000 --- a/extensions/common/glm/detail/type_mat3x3.hpp +++ /dev/null @@ -1,230 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/type_mat3x3.hpp -/// @date 2005-01-27 / 2011-06-15 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "../fwd.hpp" -#include "type_vec3.hpp" -#include "type_mat.hpp" -#include <limits> -#include <cstddef> - -namespace glm -{ - template <typename T, precision P = defaultp> - struct tmat3x3 - { - typedef tvec3<T, P> col_type; - typedef tvec3<T, P> row_type; - typedef tmat3x3<T, P> type; - typedef tmat3x3<T, P> transpose_type; - typedef T value_type; - - template <typename U, precision Q> - friend tvec3<U, Q> operator/(tmat3x3<U, Q> const & m, tvec3<U, Q> const & v); - template <typename U, precision Q> - friend tvec3<U, Q> operator/(tvec3<U, Q> const & v, tmat3x3<U, Q> const & m); - - private: - /// @cond DETAIL - col_type value[3]; - /// @endcond - - public: - // Constructors - GLM_FUNC_DECL tmat3x3(); - GLM_FUNC_DECL tmat3x3(tmat3x3<T, P> const & m); - template <precision Q> - GLM_FUNC_DECL tmat3x3(tmat3x3<T, Q> const & m); - - GLM_FUNC_DECL explicit tmat3x3(ctor); - GLM_FUNC_DECL explicit tmat3x3(T const & s); - GLM_FUNC_DECL tmat3x3( - T const & x0, T const & y0, T const & z0, - T const & x1, T const & y1, T const & z1, - T const & x2, T const & y2, T const & z2); - GLM_FUNC_DECL tmat3x3( - col_type const & v0, - col_type const & v1, - col_type const & v2); - - ////////////////////////////////////// - // Conversions - - template< - typename X1, typename Y1, typename Z1, - typename X2, typename Y2, typename Z2, - typename X3, typename Y3, typename Z3> - GLM_FUNC_DECL tmat3x3( - X1 const & x1, Y1 const & y1, Z1 const & z1, - X2 const & x2, Y2 const & y2, Z2 const & z2, - X3 const & x3, Y3 const & y3, Z3 const & z3); - - template <typename V1, typename V2, typename V3> - GLM_FUNC_DECL tmat3x3( - tvec3<V1, P> const & v1, - tvec3<V2, P> const & v2, - tvec3<V3, P> const & v3); - - ////////////////////////////////////// - // Matrix conversions - -# ifdef GLM_FORCE_EXPLICIT_CTOR - template <typename U, precision Q> - GLM_FUNC_DECL explicit tmat3x3(tmat3x3<U, Q> const & m); -# else - template <typename U, precision Q> - GLM_FUNC_DECL tmat3x3(tmat3x3<U, Q> const & m); -# endif - - GLM_FUNC_DECL explicit tmat3x3(tmat2x2<T, P> const & x); - GLM_FUNC_DECL explicit tmat3x3(tmat4x4<T, P> const & x); - GLM_FUNC_DECL explicit tmat3x3(tmat2x3<T, P> const & x); - GLM_FUNC_DECL explicit tmat3x3(tmat3x2<T, P> const & x); - GLM_FUNC_DECL explicit tmat3x3(tmat2x4<T, P> const & x); - GLM_FUNC_DECL explicit tmat3x3(tmat4x2<T, P> const & x); - GLM_FUNC_DECL explicit tmat3x3(tmat3x4<T, P> const & x); - GLM_FUNC_DECL explicit tmat3x3(tmat4x3<T, P> const & x); - - ////////////////////////////////////// - // Accesses - -# ifdef GLM_FORCE_SIZE_FUNC - typedef size_t size_type; - GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const; - - GLM_FUNC_DECL col_type & operator[](size_type i); - GLM_FUNC_DECL col_type const & operator[](size_type i) const; -# else - typedef length_t length_type; - GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const; - - GLM_FUNC_DECL col_type & operator[](length_type i); - GLM_FUNC_DECL col_type const & operator[](length_type i) const; -# endif//GLM_FORCE_SIZE_FUNC - - ////////////////////////////////////// - // Unary arithmetic operators - - GLM_FUNC_DECL tmat3x3<T, P> & operator=(tmat3x3<T, P> const & m); - - template <typename U> - GLM_FUNC_DECL tmat3x3<T, P> & operator=(tmat3x3<U, P> const & m); - template <typename U> - GLM_FUNC_DECL tmat3x3<T, P> & operator+=(U s); - template <typename U> - GLM_FUNC_DECL tmat3x3<T, P> & operator+=(tmat3x3<U, P> const & m); - template <typename U> - GLM_FUNC_DECL tmat3x3<T, P> & operator-=(U s); - template <typename U> - GLM_FUNC_DECL tmat3x3<T, P> & operator-=(tmat3x3<U, P> const & m); - template <typename U> - GLM_FUNC_DECL tmat3x3<T, P> & operator*=(U s); - template <typename U> - GLM_FUNC_DECL tmat3x3<T, P> & operator*=(tmat3x3<U, P> const & m); - template <typename U> - GLM_FUNC_DECL tmat3x3<T, P> & operator/=(U s); - template <typename U> - GLM_FUNC_DECL tmat3x3<T, P> & operator/=(tmat3x3<U, P> const & m); - - ////////////////////////////////////// - // Increment and decrement operators - - GLM_FUNC_DECL tmat3x3<T, P> & operator++(); - GLM_FUNC_DECL tmat3x3<T, P> & operator--(); - GLM_FUNC_DECL tmat3x3<T, P> operator++(int); - GLM_FUNC_DECL tmat3x3<T, P> operator--(int); - }; - - // Binary operators - template <typename T, precision P> - GLM_FUNC_DECL tmat3x3<T, P> operator+(tmat3x3<T, P> const & m, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tmat3x3<T, P> operator+(T const & s, tmat3x3<T, P> const & m); - - template <typename T, precision P> - GLM_FUNC_DECL tmat3x3<T, P> operator+(tmat3x3<T, P> const & m1, tmat3x3<T, P> const & m2); - - template <typename T, precision P> - GLM_FUNC_DECL tmat3x3<T, P> operator-(tmat3x3<T, P> const & m, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tmat3x3<T, P> operator-(T const & s, tmat3x3<T, P> const & m); - - template <typename T, precision P> - GLM_FUNC_DECL tmat3x3<T, P> operator-(tmat3x3<T, P> const & m1, tmat3x3<T, P> const & m2); - - template <typename T, precision P> - GLM_FUNC_DECL tmat3x3<T, P> operator*(tmat3x3<T, P> const & m, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tmat3x3<T, P> operator*(T const & s, tmat3x3<T, P> const & m); - - template <typename T, precision P> - GLM_FUNC_DECL typename tmat3x3<T, P>::col_type operator*(tmat3x3<T, P> const & m, typename tmat3x3<T, P>::row_type const & v); - - template <typename T, precision P> - GLM_FUNC_DECL typename tmat3x3<T, P>::row_type operator*(typename tmat3x3<T, P>::col_type const & v, tmat3x3<T, P> const & m); - - template <typename T, precision P> - GLM_FUNC_DECL tmat3x3<T, P> operator*(tmat3x3<T, P> const & m1, tmat3x3<T, P> const & m2); - - template <typename T, precision P> - GLM_FUNC_DECL tmat2x3<T, P> operator*(tmat3x3<T, P> const & m1, tmat2x3<T, P> const & m2); - - template <typename T, precision P> - GLM_FUNC_DECL tmat4x3<T, P> operator*(tmat3x3<T, P> const & m1, tmat4x3<T, P> const & m2); - - template <typename T, precision P> - GLM_FUNC_DECL tmat3x3<T, P> operator/(tmat3x3<T, P> const & m, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tmat3x3<T, P> operator/(T const & s, tmat3x3<T, P> const & m); - - template <typename T, precision P> - GLM_FUNC_DECL typename tmat3x3<T, P>::col_type operator/(tmat3x3<T, P> const & m, typename tmat3x3<T, P>::row_type const & v); - - template <typename T, precision P> - GLM_FUNC_DECL typename tmat3x3<T, P>::row_type operator/(typename tmat3x3<T, P>::col_type const & v, tmat3x3<T, P> const & m); - - template <typename T, precision P> - GLM_FUNC_DECL tmat3x3<T, P> operator/(tmat3x3<T, P> const & m1, tmat3x3<T, P> const & m2); - - // Unary constant operators - template <typename T, precision P> - GLM_FUNC_DECL tmat3x3<T, P> const operator-(tmat3x3<T, P> const & m); -}//namespace glm - -#ifndef GLM_EXTERNAL_TEMPLATE -#include "type_mat3x3.inl" -#endif diff --git a/extensions/common/glm/detail/type_mat3x3.inl b/extensions/common/glm/detail/type_mat3x3.inl deleted file mode 100644 index ad933d36d07..00000000000 --- a/extensions/common/glm/detail/type_mat3x3.inl +++ /dev/null @@ -1,631 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/type_mat3x3.inl -/// @date 2005-01-27 / 2011-06-15 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -namespace glm{ -namespace detail -{ - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x3<T, P> compute_inverse(tmat3x3<T, P> const & m) - { - T OneOverDeterminant = static_cast<T>(1) / ( - + m[0][0] * (m[1][1] * m[2][2] - m[2][1] * m[1][2]) - - m[1][0] * (m[0][1] * m[2][2] - m[2][1] * m[0][2]) - + m[2][0] * (m[0][1] * m[1][2] - m[1][1] * m[0][2])); - - tmat3x3<T, P> Inverse(uninitialize); - Inverse[0][0] = + (m[1][1] * m[2][2] - m[2][1] * m[1][2]) * OneOverDeterminant; - Inverse[1][0] = - (m[1][0] * m[2][2] - m[2][0] * m[1][2]) * OneOverDeterminant; - Inverse[2][0] = + (m[1][0] * m[2][1] - m[2][0] * m[1][1]) * OneOverDeterminant; - Inverse[0][1] = - (m[0][1] * m[2][2] - m[2][1] * m[0][2]) * OneOverDeterminant; - Inverse[1][1] = + (m[0][0] * m[2][2] - m[2][0] * m[0][2]) * OneOverDeterminant; - Inverse[2][1] = - (m[0][0] * m[2][1] - m[2][0] * m[0][1]) * OneOverDeterminant; - Inverse[0][2] = + (m[0][1] * m[1][2] - m[1][1] * m[0][2]) * OneOverDeterminant; - Inverse[1][2] = - (m[0][0] * m[1][2] - m[1][0] * m[0][2]) * OneOverDeterminant; - Inverse[2][2] = + (m[0][0] * m[1][1] - m[1][0] * m[0][1]) * OneOverDeterminant; - - return Inverse; - } -}//namespace detail - - ////////////////////////////////////////////////////////////// - // Constructors - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3() - { -# ifndef GLM_FORCE_NO_CTOR_INIT - this->value[0] = col_type(1, 0, 0); - this->value[1] = col_type(0, 1, 0); - this->value[2] = col_type(0, 0, 1); -# endif - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(ctor) - {} - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(tmat3x3<T, P> const & m) - { - this->value[0] = m.value[0]; - this->value[1] = m.value[1]; - this->value[2] = m.value[2]; - } - - template <typename T, precision P> - template <precision Q> - GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(tmat3x3<T, Q> const & m) - { - this->value[0] = m.value[0]; - this->value[1] = m.value[1]; - this->value[2] = m.value[2]; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(T const & s) - { - this->value[0] = col_type(s, 0, 0); - this->value[1] = col_type(0, s, 0); - this->value[2] = col_type(0, 0, s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3 - ( - T const & x0, T const & y0, T const & z0, - T const & x1, T const & y1, T const & z1, - T const & x2, T const & y2, T const & z2 - ) - { - this->value[0] = col_type(x0, y0, z0); - this->value[1] = col_type(x1, y1, z1); - this->value[2] = col_type(x2, y2, z2); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3 - ( - col_type const & v0, - col_type const & v1, - col_type const & v2 - ) - { - this->value[0] = v0; - this->value[1] = v1; - this->value[2] = v2; - } - - ////////////////////////////////////// - // Conversion constructors - template <typename T, precision P> - template < - typename X1, typename Y1, typename Z1, - typename X2, typename Y2, typename Z2, - typename X3, typename Y3, typename Z3> - GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3 - ( - X1 const & x1, Y1 const & y1, Z1 const & z1, - X2 const & x2, Y2 const & y2, Z2 const & z2, - X3 const & x3, Y3 const & y3, Z3 const & z3 - ) - { - this->value[0] = col_type(static_cast<T>(x1), value_type(y1), value_type(z1)); - this->value[1] = col_type(static_cast<T>(x2), value_type(y2), value_type(z2)); - this->value[2] = col_type(static_cast<T>(x3), value_type(y3), value_type(z3)); - } - - template <typename T, precision P> - template <typename V1, typename V2, typename V3> - GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3 - ( - tvec3<V1, P> const & v1, - tvec3<V2, P> const & v2, - tvec3<V3, P> const & v3 - ) - { - this->value[0] = col_type(v1); - this->value[1] = col_type(v2); - this->value[2] = col_type(v3); - } - - ////////////////////////////////////////////////////////////// - // Conversions - - template <typename T, precision P> - template <typename U, precision Q> - GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(tmat3x3<U, Q> const & m) - { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(tmat2x2<T, P> const & m) - { - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); - this->value[2] = col_type(0, 0, 1); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(tmat4x4<T, P> const & m) - { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(tmat2x3<T, P> const & m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = col_type(0, 0, 1); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(tmat3x2<T, P> const & m) - { - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); - this->value[2] = col_type(m[2], 1); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(tmat2x4<T, P> const & m) - { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(0, 0, 1); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(tmat4x2<T, P> const & m) - { - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); - this->value[2] = col_type(m[2], 1); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(tmat3x4<T, P> const & m) - { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(tmat4x3<T, P> const & m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - } - - ////////////////////////////////////// - // Accesses - -# ifdef GLM_FORCE_SIZE_FUNC - template <typename T, precision P> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat3x3<T, P>::size_type tmat3x3<T, P>::size() const - { - return 3; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tmat3x3<T, P>::col_type & tmat3x3<T, P>::operator[](typename tmat3x3<T, P>::size_type i) - { - assert(i < this->size()); - return this->value[i]; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tmat3x3<T, P>::col_type const & tmat3x3<T, P>::operator[](typename tmat3x3<T, P>::size_type i) const - { - assert(i < this->size()); - return this->value[i]; - } -# else - template <typename T, precision P> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat3x3<T, P>::length_type tmat3x3<T, P>::length() const - { - return 3; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tmat3x3<T, P>::col_type & tmat3x3<T, P>::operator[](typename tmat3x3<T, P>::length_type i) - { - assert(i < this->length()); - return this->value[i]; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tmat3x3<T, P>::col_type const & tmat3x3<T, P>::operator[](typename tmat3x3<T, P>::length_type i) const - { - assert(i < this->length()); - return this->value[i]; - } -# endif//GLM_FORCE_SIZE_FUNC - - ////////////////////////////////////////////////////////////// - // Operators - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator=(tmat3x3<T, P> const & m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator=(tmat3x3<U, P> const & m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator+=(U s) - { - this->value[0] += s; - this->value[1] += s; - this->value[2] += s; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator+=(tmat3x3<U, P> const & m) - { - this->value[0] += m[0]; - this->value[1] += m[1]; - this->value[2] += m[2]; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator-=(U s) - { - this->value[0] -= s; - this->value[1] -= s; - this->value[2] -= s; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator-=(tmat3x3<U, P> const & m) - { - this->value[0] -= m[0]; - this->value[1] -= m[1]; - this->value[2] -= m[2]; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator*=(U s) - { - this->value[0] *= s; - this->value[1] *= s; - this->value[2] *= s; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator*=(tmat3x3<U, P> const & m) - { - return (*this = *this * m); - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator/=(U s) - { - this->value[0] /= s; - this->value[1] /= s; - this->value[2] /= s; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator/=(tmat3x3<U, P> const & m) - { - return (*this = *this * detail::compute_inverse<T, P>(m)); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator++() - { - ++this->value[0]; - ++this->value[1]; - ++this->value[2]; - return *this; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator--() - { - --this->value[0]; - --this->value[1]; - --this->value[2]; - return *this; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x3<T, P> tmat3x3<T, P>::operator++(int) - { - tmat3x3<T, P> Result(*this); - ++*this; - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x3<T, P> tmat3x3<T, P>::operator--(int) - { - tmat3x3<T, P> Result(*this); - --*this; - return Result; - } - - ////////////////////////////////////////////////////////////// - // Binary operators - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x3<T, P> operator+(tmat3x3<T, P> const & m, T const & s) - { - return tmat3x3<T, P>( - m[0] + s, - m[1] + s, - m[2] + s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x3<T, P> operator+(T const & s, tmat3x3<T, P> const & m) - { - return tmat3x3<T, P>( - m[0] + s, - m[1] + s, - m[2] + s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x3<T, P> operator+(tmat3x3<T, P> const & m1, tmat3x3<T, P> const & m2) - { - return tmat3x3<T, P>( - m1[0] + m2[0], - m1[1] + m2[1], - m1[2] + m2[2]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x3<T, P> operator-(tmat3x3<T, P> const & m, T const & s) - { - return tmat3x3<T, P>( - m[0] - s, - m[1] - s, - m[2] - s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x3<T, P> operator-(T const & s, tmat3x3<T, P> const & m) - { - return tmat3x3<T, P>( - s - m[0], - s - m[1], - s - m[2]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x3<T, P> operator-(tmat3x3<T, P> const & m1, tmat3x3<T, P> const & m2) - { - return tmat3x3<T, P>( - m1[0] - m2[0], - m1[1] - m2[1], - m1[2] - m2[2]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x3<T, P> operator*(tmat3x3<T, P> const & m, T const & s) - { - return tmat3x3<T, P>( - m[0] * s, - m[1] * s, - m[2] * s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x3<T, P> operator*(T const & s, tmat3x3<T, P> const & m) - { - return tmat3x3<T, P>( - m[0] * s, - m[1] * s, - m[2] * s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tmat3x3<T, P>::col_type operator*(tmat3x3<T, P> const & m, typename tmat3x3<T, P>::row_type const & v) - { - return typename tmat3x3<T, P>::col_type( - m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z, - m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z, - m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tmat3x3<T, P>::row_type operator*(typename tmat3x3<T, P>::col_type const & v, tmat3x3<T, P> const & m) - { - return typename tmat3x3<T, P>::row_type( - m[0][0] * v.x + m[0][1] * v.y + m[0][2] * v.z, - m[1][0] * v.x + m[1][1] * v.y + m[1][2] * v.z, - m[2][0] * v.x + m[2][1] * v.y + m[2][2] * v.z); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x3<T, P> operator*(tmat3x3<T, P> const & m1, tmat3x3<T, P> const & m2) - { - T const SrcA00 = m1[0][0]; - T const SrcA01 = m1[0][1]; - T const SrcA02 = m1[0][2]; - T const SrcA10 = m1[1][0]; - T const SrcA11 = m1[1][1]; - T const SrcA12 = m1[1][2]; - T const SrcA20 = m1[2][0]; - T const SrcA21 = m1[2][1]; - T const SrcA22 = m1[2][2]; - - T const SrcB00 = m2[0][0]; - T const SrcB01 = m2[0][1]; - T const SrcB02 = m2[0][2]; - T const SrcB10 = m2[1][0]; - T const SrcB11 = m2[1][1]; - T const SrcB12 = m2[1][2]; - T const SrcB20 = m2[2][0]; - T const SrcB21 = m2[2][1]; - T const SrcB22 = m2[2][2]; - - tmat3x3<T, P> Result(uninitialize); - Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02; - Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02; - Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01 + SrcA22 * SrcB02; - Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12; - Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12; - Result[1][2] = SrcA02 * SrcB10 + SrcA12 * SrcB11 + SrcA22 * SrcB12; - Result[2][0] = SrcA00 * SrcB20 + SrcA10 * SrcB21 + SrcA20 * SrcB22; - Result[2][1] = SrcA01 * SrcB20 + SrcA11 * SrcB21 + SrcA21 * SrcB22; - Result[2][2] = SrcA02 * SrcB20 + SrcA12 * SrcB21 + SrcA22 * SrcB22; - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x3<T, P> operator*(tmat3x3<T, P> const & m1, tmat2x3<T, P> const & m2) - { - return tmat2x3<T, P>( - m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2], - m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2], - m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2], - m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2], - m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2], - m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1] + m1[2][2] * m2[1][2]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x3<T, P> operator*(tmat3x3<T, P> const & m1, tmat4x3<T, P> const & m2) - { - return tmat4x3<T, P>( - m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2], - m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2], - m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2], - m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2], - m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2], - m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1] + m1[2][2] * m2[1][2], - m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1] + m1[2][0] * m2[2][2], - m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1] + m1[2][1] * m2[2][2], - m1[0][2] * m2[2][0] + m1[1][2] * m2[2][1] + m1[2][2] * m2[2][2], - m1[0][0] * m2[3][0] + m1[1][0] * m2[3][1] + m1[2][0] * m2[3][2], - m1[0][1] * m2[3][0] + m1[1][1] * m2[3][1] + m1[2][1] * m2[3][2], - m1[0][2] * m2[3][0] + m1[1][2] * m2[3][1] + m1[2][2] * m2[3][2]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x3<T, P> operator/(tmat3x3<T, P> const & m, T const & s) - { - return tmat3x3<T, P>( - m[0] / s, - m[1] / s, - m[2] / s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x3<T, P> operator/(T const & s, tmat3x3<T, P> const & m) - { - return tmat3x3<T, P>( - s / m[0], - s / m[1], - s / m[2]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tmat3x3<T, P>::col_type operator/(tmat3x3<T, P> const & m, typename tmat3x3<T, P>::row_type const & v) - { - return detail::compute_inverse<T, P>(m) * v; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tmat3x3<T, P>::row_type operator/(typename tmat3x3<T, P>::col_type const & v, tmat3x3<T, P> const & m) - { - return v * detail::compute_inverse<T, P>(m); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x3<T, P> operator/(tmat3x3<T, P> const & m1, tmat3x3<T, P> const & m2) - { - tmat3x3<T, P> m1_copy(m1); - return m1_copy /= m2; - } - - // Unary constant operators - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x3<T, P> const operator-(tmat3x3<T, P> const & m) - { - return tmat3x3<T, P>( - -m[0], - -m[1], - -m[2]); - } - - ////////////////////////////////////// - // Boolean operators - - template <typename T, precision P> - GLM_FUNC_QUALIFIER bool operator==(tmat3x3<T, P> const & m1, tmat3x3<T, P> const & m2) - { - return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER bool operator!=(tmat3x3<T, P> const & m1, tmat3x3<T, P> const & m2) - { - return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]); - } -} //namespace glm diff --git a/extensions/common/glm/detail/type_mat3x4.hpp b/extensions/common/glm/detail/type_mat3x4.hpp deleted file mode 100644 index 02de91b5e29..00000000000 --- a/extensions/common/glm/detail/type_mat3x4.hpp +++ /dev/null @@ -1,206 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/type_mat3x4.hpp -/// @date 2006-08-05 / 2011-06-15 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "../fwd.hpp" -#include "type_vec3.hpp" -#include "type_vec4.hpp" -#include "type_mat.hpp" -#include <limits> -#include <cstddef> - -namespace glm -{ - template <typename T, precision P = defaultp> - struct tmat3x4 - { - typedef tvec4<T, P> col_type; - typedef tvec3<T, P> row_type; - typedef tmat3x4<T, P> type; - typedef tmat4x3<T, P> transpose_type; - typedef T value_type; - - private: - /// @cond DETAIL - col_type value[3]; - /// @endcond - - public: - // Constructors - GLM_FUNC_DECL tmat3x4(); - GLM_FUNC_DECL tmat3x4(tmat3x4<T, P> const & m); - template <precision Q> - GLM_FUNC_DECL tmat3x4(tmat3x4<T, Q> const & m); - - GLM_FUNC_DECL explicit tmat3x4(ctor); - GLM_FUNC_DECL explicit tmat3x4(T const & s); - GLM_FUNC_DECL tmat3x4( - T const & x0, T const & y0, T const & z0, T const & w0, - T const & x1, T const & y1, T const & z1, T const & w1, - T const & x2, T const & y2, T const & z2, T const & w2); - GLM_FUNC_DECL tmat3x4( - col_type const & v0, - col_type const & v1, - col_type const & v2); - - ////////////////////////////////////// - // Conversions - template< - typename X1, typename Y1, typename Z1, typename W1, - typename X2, typename Y2, typename Z2, typename W2, - typename X3, typename Y3, typename Z3, typename W3> - GLM_FUNC_DECL tmat3x4( - X1 const & x1, Y1 const & y1, Z1 const & z1, W1 const & w1, - X2 const & x2, Y2 const & y2, Z2 const & z2, W2 const & w2, - X3 const & x3, Y3 const & y3, Z3 const & z3, W3 const & w3); - - template <typename V1, typename V2, typename V3> - GLM_FUNC_DECL tmat3x4( - tvec4<V1, P> const & v1, - tvec4<V2, P> const & v2, - tvec4<V3, P> const & v3); - - ////////////////////////////////////// - // Matrix conversion - -# ifdef GLM_FORCE_EXPLICIT_CTOR - template <typename U, precision Q> - GLM_FUNC_DECL explicit tmat3x4(tmat3x4<U, Q> const & m); -# else - template <typename U, precision Q> - GLM_FUNC_DECL tmat3x4(tmat3x4<U, Q> const & m); -# endif - - GLM_FUNC_DECL explicit tmat3x4(tmat2x2<T, P> const & x); - GLM_FUNC_DECL explicit tmat3x4(tmat3x3<T, P> const & x); - GLM_FUNC_DECL explicit tmat3x4(tmat4x4<T, P> const & x); - GLM_FUNC_DECL explicit tmat3x4(tmat2x3<T, P> const & x); - GLM_FUNC_DECL explicit tmat3x4(tmat3x2<T, P> const & x); - GLM_FUNC_DECL explicit tmat3x4(tmat2x4<T, P> const & x); - GLM_FUNC_DECL explicit tmat3x4(tmat4x2<T, P> const & x); - GLM_FUNC_DECL explicit tmat3x4(tmat4x3<T, P> const & x); - - ////////////////////////////////////// - // Accesses - -# ifdef GLM_FORCE_SIZE_FUNC - typedef size_t size_type; - GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const; - - GLM_FUNC_DECL col_type & operator[](size_type i); - GLM_FUNC_DECL col_type const & operator[](size_type i) const; -# else - typedef length_t length_type; - GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const; - - GLM_FUNC_DECL col_type & operator[](length_type i); - GLM_FUNC_DECL col_type const & operator[](length_type i) const; -# endif//GLM_FORCE_SIZE_FUNC - - ////////////////////////////////////// - // Unary arithmetic operators - - GLM_FUNC_DECL tmat3x4<T, P> & operator=(tmat3x4<T, P> const & m); - - template <typename U> - GLM_FUNC_DECL tmat3x4<T, P> & operator=(tmat3x4<U, P> const & m); - template <typename U> - GLM_FUNC_DECL tmat3x4<T, P> & operator+=(U s); - template <typename U> - GLM_FUNC_DECL tmat3x4<T, P> & operator+=(tmat3x4<U, P> const & m); - template <typename U> - GLM_FUNC_DECL tmat3x4<T, P> & operator-=(U s); - template <typename U> - GLM_FUNC_DECL tmat3x4<T, P> & operator-=(tmat3x4<U, P> const & m); - template <typename U> - GLM_FUNC_DECL tmat3x4<T, P> & operator*=(U s); - template <typename U> - GLM_FUNC_DECL tmat3x4<T, P> & operator/=(U s); - - ////////////////////////////////////// - // Increment and decrement operators - - GLM_FUNC_DECL tmat3x4<T, P> & operator++(); - GLM_FUNC_DECL tmat3x4<T, P> & operator--(); - GLM_FUNC_DECL tmat3x4<T, P> operator++(int); - GLM_FUNC_DECL tmat3x4<T, P> operator--(int); - }; - - // Binary operators - template <typename T, precision P> - GLM_FUNC_DECL tmat3x4<T, P> operator+(tmat3x4<T, P> const & m, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tmat3x4<T, P> operator+(tmat3x4<T, P> const & m1, tmat3x4<T, P> const & m2); - - template <typename T, precision P> - GLM_FUNC_DECL tmat3x4<T, P> operator-(tmat3x4<T, P> const & m, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tmat3x4<T, P> operator-(tmat3x4<T, P> const & m1, tmat3x4<T, P> const & m2); - - template <typename T, precision P> - GLM_FUNC_DECL tmat3x4<T, P> operator*(tmat3x4<T, P> const & m, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tmat3x4<T, P> operator*(T const & s, tmat3x4<T, P> const & m); - - template <typename T, precision P> - GLM_FUNC_DECL typename tmat3x4<T, P>::col_type operator*(tmat3x4<T, P> const & m, typename tmat3x4<T, P>::row_type const & v); - - template <typename T, precision P> - GLM_FUNC_DECL typename tmat3x4<T, P>::row_type operator*(typename tmat3x4<T, P>::col_type const & v, tmat3x4<T, P> const & m); - - template <typename T, precision P> - GLM_FUNC_DECL tmat4x4<T, P> operator*(tmat3x4<T, P> const & m1, tmat4x3<T, P> const & m2); - - template <typename T, precision P> - GLM_FUNC_DECL tmat2x4<T, P> operator*(tmat3x4<T, P> const & m1, tmat2x3<T, P> const & m2); - - template <typename T, precision P> - GLM_FUNC_DECL tmat3x4<T, P> operator*(tmat3x4<T, P> const & m1, tmat3x3<T, P> const & m2); - - template <typename T, precision P> - GLM_FUNC_DECL tmat3x4<T, P> operator/(tmat3x4<T, P> const & m, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tmat3x4<T, P> operator/(T const & s, tmat3x4<T, P> const & m); - - // Unary constant operators - template <typename T, precision P> - GLM_FUNC_DECL tmat3x4<T, P> const operator-(tmat3x4<T, P> const & m); -}//namespace glm - -#ifndef GLM_EXTERNAL_TEMPLATE -#include "type_mat3x4.inl" -#endif diff --git a/extensions/common/glm/detail/type_mat3x4.inl b/extensions/common/glm/detail/type_mat3x4.inl deleted file mode 100644 index 03e0c2cf8da..00000000000 --- a/extensions/common/glm/detail/type_mat3x4.inl +++ /dev/null @@ -1,579 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/type_mat3x4.inl -/// @date 2006-08-05 / 2011-06-15 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - ////////////////////////////////////////////////////////////// - // Constructors - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4() - { -# ifndef GLM_FORCE_NO_CTOR_INIT - this->value[0] = col_type(1, 0, 0, 0); - this->value[1] = col_type(0, 1, 0, 0); - this->value[2] = col_type(0, 0, 1, 0); -# endif - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(tmat3x4<T, P> const & m) - { - this->value[0] = m.value[0]; - this->value[1] = m.value[1]; - this->value[2] = m.value[2]; - } - - template <typename T, precision P> - template <precision Q> - GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(tmat3x4<T, Q> const & m) - { - this->value[0] = m.value[0]; - this->value[1] = m.value[1]; - this->value[2] = m.value[2]; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(ctor) - {} - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(T const & s) - { - value_type const Zero(0); - this->value[0] = col_type(s, Zero, Zero, Zero); - this->value[1] = col_type(Zero, s, Zero, Zero); - this->value[2] = col_type(Zero, Zero, s, Zero); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4 - ( - T const & x0, T const & y0, T const & z0, T const & w0, - T const & x1, T const & y1, T const & z1, T const & w1, - T const & x2, T const & y2, T const & z2, T const & w2 - ) - { - this->value[0] = col_type(x0, y0, z0, w0); - this->value[1] = col_type(x1, y1, z1, w1); - this->value[2] = col_type(x2, y2, z2, w2); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4 - ( - col_type const & v0, - col_type const & v1, - col_type const & v2 - ) - { - this->value[0] = v0; - this->value[1] = v1; - this->value[2] = v2; - } - - ////////////////////////////////////// - // Conversion constructors - template <typename T, precision P> - template < - typename X1, typename Y1, typename Z1, typename W1, - typename X2, typename Y2, typename Z2, typename W2, - typename X3, typename Y3, typename Z3, typename W3> - GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4 - ( - X1 const & x1, Y1 const & y1, Z1 const & z1, W1 const & w1, - X2 const & x2, Y2 const & y2, Z2 const & z2, W2 const & w2, - X3 const & x3, Y3 const & y3, Z3 const & z3, W3 const & w3 - ) - { - this->value[0] = col_type(static_cast<T>(x1), value_type(y1), value_type(z1), value_type(w1)); - this->value[1] = col_type(static_cast<T>(x2), value_type(y2), value_type(z2), value_type(w2)); - this->value[2] = col_type(static_cast<T>(x3), value_type(y3), value_type(z3), value_type(w3)); - } - - template <typename T, precision P> - template <typename V1, typename V2, typename V3> - GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4 - ( - tvec4<V1, P> const & v1, - tvec4<V2, P> const & v2, - tvec4<V3, P> const & v3 - ) - { - this->value[0] = col_type(v1); - this->value[1] = col_type(v2); - this->value[2] = col_type(v3); - } - - // Conversion - template <typename T, precision P> - template <typename U, precision Q> - GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(tmat3x4<U, Q> const & m) - { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(tmat2x2<T, P> const & m) - { - this->value[0] = col_type(m[0], 0, 0); - this->value[1] = col_type(m[1], 0, 0); - this->value[2] = col_type(0, 0, 1, 0); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(tmat3x3<T, P> const & m) - { - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); - this->value[2] = col_type(m[2], 0); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(tmat4x4<T, P> const & m) - { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(tmat2x3<T, P> const & m) - { - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); - this->value[2] = col_type(0, 0, 1, 0); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(tmat3x2<T, P> const & m) - { - this->value[0] = col_type(m[0], 0, 0); - this->value[1] = col_type(m[1], 0, 0); - this->value[2] = col_type(m[2], 0, 1); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(tmat2x4<T, P> const & m) - { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(0, 0, 1, 0); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(tmat4x2<T, P> const & m) - { - this->value[0] = col_type(m[0], 0, 0); - this->value[1] = col_type(m[1], 0, 0); - this->value[2] = col_type(m[2], 1, 0); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(tmat4x3<T, P> const & m) - { - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); - this->value[2] = col_type(m[2], 0); - } - - ////////////////////////////////////// - // Accesses - -# ifdef GLM_FORCE_SIZE_FUNC - template <typename T, precision P> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat3x4<T, P>::size_type tmat3x4<T, P>::size() const - { - return 3; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tmat3x4<T, P>::col_type & tmat3x4<T, P>::operator[](typename tmat3x4<T, P>::size_type i) - { - assert(i < this->size()); - return this->value[i]; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tmat3x4<T, P>::col_type const & tmat3x4<T, P>::operator[](typename tmat3x4<T, P>::size_type i) const - { - assert(i < this->size()); - return this->value[i]; - } -# else - template <typename T, precision P> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat3x4<T, P>::length_type tmat3x4<T, P>::length() const - { - return 3; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tmat3x4<T, P>::col_type & tmat3x4<T, P>::operator[](typename tmat3x4<T, P>::length_type i) - { - assert(i < this->length()); - return this->value[i]; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tmat3x4<T, P>::col_type const & tmat3x4<T, P>::operator[](typename tmat3x4<T, P>::length_type i) const - { - assert(i < this->length()); - return this->value[i]; - } -# endif//GLM_FORCE_SIZE_FUNC - - ////////////////////////////////////////////////////////////// - // Unary updatable operators - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x4<T, P>& tmat3x4<T, P>::operator=(tmat3x4<T, P> const & m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat3x4<T, P>& tmat3x4<T, P>::operator=(tmat3x4<U, P> const & m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat3x4<T, P>& tmat3x4<T, P>::operator+=(U s) - { - this->value[0] += s; - this->value[1] += s; - this->value[2] += s; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat3x4<T, P>& tmat3x4<T, P>::operator+=(tmat3x4<U, P> const & m) - { - this->value[0] += m[0]; - this->value[1] += m[1]; - this->value[2] += m[2]; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat3x4<T, P>& tmat3x4<T, P>::operator-=(U s) - { - this->value[0] -= s; - this->value[1] -= s; - this->value[2] -= s; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat3x4<T, P>& tmat3x4<T, P>::operator-=(tmat3x4<U, P> const & m) - { - this->value[0] -= m[0]; - this->value[1] -= m[1]; - this->value[2] -= m[2]; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat3x4<T, P>& tmat3x4<T, P>::operator*=(U s) - { - this->value[0] *= s; - this->value[1] *= s; - this->value[2] *= s; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat3x4<T, P> & tmat3x4<T, P>::operator/=(U s) - { - this->value[0] /= s; - this->value[1] /= s; - this->value[2] /= s; - return *this; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x4<T, P>& tmat3x4<T, P>::operator++() - { - ++this->value[0]; - ++this->value[1]; - ++this->value[2]; - return *this; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x4<T, P>& tmat3x4<T, P>::operator--() - { - --this->value[0]; - --this->value[1]; - --this->value[2]; - return *this; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x4<T, P> tmat3x4<T, P>::operator++(int) - { - tmat3x4<T, P> Result(*this); - ++*this; - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x4<T, P> tmat3x4<T, P>::operator--(int) - { - tmat3x4<T, P> Result(*this); - --*this; - return Result; - } - - ////////////////////////////////////////////////////////////// - // Binary operators - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x4<T, P> operator+(tmat3x4<T, P> const & m, T const & s) - { - return tmat3x4<T, P>( - m[0] + s, - m[1] + s, - m[2] + s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x4<T, P> operator+(tmat3x4<T, P> const & m1, tmat3x4<T, P> const & m2) - { - return tmat3x4<T, P>( - m1[0] + m2[0], - m1[1] + m2[1], - m1[2] + m2[2]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x4<T, P> operator-(tmat3x4<T, P> const & m, T const & s) - { - return tmat3x4<T, P>( - m[0] - s, - m[1] - s, - m[2] - s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x4<T, P> operator-(tmat3x4<T, P> const & m1, tmat3x4<T, P> const & m2) - { - return tmat3x4<T, P>( - m1[0] - m2[0], - m1[1] - m2[1], - m1[2] - m2[2]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x4<T, P> operator*(tmat3x4<T, P> const & m, T const & s) - { - return tmat3x4<T, P>( - m[0] * s, - m[1] * s, - m[2] * s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x4<T, P> operator*(T const & s, tmat3x4<T, P> const & m) - { - return tmat3x4<T, P>( - m[0] * s, - m[1] * s, - m[2] * s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tmat3x4<T, P>::col_type operator* - ( - tmat3x4<T, P> const & m, - typename tmat3x4<T, P>::row_type const & v - ) - { - return typename tmat3x4<T, P>::col_type( - m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z, - m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z, - m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z, - m[0][3] * v.x + m[1][3] * v.y + m[2][3] * v.z); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tmat3x4<T, P>::row_type operator* - ( - typename tmat3x4<T, P>::col_type const & v, - tmat3x4<T, P> const & m - ) - { - return typename tmat3x4<T, P>::row_type( - v.x * m[0][0] + v.y * m[0][1] + v.z * m[0][2] + v.w * m[0][3], - v.x * m[1][0] + v.y * m[1][1] + v.z * m[1][2] + v.w * m[1][3], - v.x * m[2][0] + v.y * m[2][1] + v.z * m[2][2] + v.w * m[2][3]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P> operator*(tmat3x4<T, P> const & m1, tmat4x3<T, P> const & m2) - { - const T SrcA00 = m1[0][0]; - const T SrcA01 = m1[0][1]; - const T SrcA02 = m1[0][2]; - const T SrcA03 = m1[0][3]; - const T SrcA10 = m1[1][0]; - const T SrcA11 = m1[1][1]; - const T SrcA12 = m1[1][2]; - const T SrcA13 = m1[1][3]; - const T SrcA20 = m1[2][0]; - const T SrcA21 = m1[2][1]; - const T SrcA22 = m1[2][2]; - const T SrcA23 = m1[2][3]; - - const T SrcB00 = m2[0][0]; - const T SrcB01 = m2[0][1]; - const T SrcB02 = m2[0][2]; - const T SrcB10 = m2[1][0]; - const T SrcB11 = m2[1][1]; - const T SrcB12 = m2[1][2]; - const T SrcB20 = m2[2][0]; - const T SrcB21 = m2[2][1]; - const T SrcB22 = m2[2][2]; - const T SrcB30 = m2[3][0]; - const T SrcB31 = m2[3][1]; - const T SrcB32 = m2[3][2]; - - tmat4x4<T, P> Result(uninitialize); - Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02; - Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02; - Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01 + SrcA22 * SrcB02; - Result[0][3] = SrcA03 * SrcB00 + SrcA13 * SrcB01 + SrcA23 * SrcB02; - Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12; - Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12; - Result[1][2] = SrcA02 * SrcB10 + SrcA12 * SrcB11 + SrcA22 * SrcB12; - Result[1][3] = SrcA03 * SrcB10 + SrcA13 * SrcB11 + SrcA23 * SrcB12; - Result[2][0] = SrcA00 * SrcB20 + SrcA10 * SrcB21 + SrcA20 * SrcB22; - Result[2][1] = SrcA01 * SrcB20 + SrcA11 * SrcB21 + SrcA21 * SrcB22; - Result[2][2] = SrcA02 * SrcB20 + SrcA12 * SrcB21 + SrcA22 * SrcB22; - Result[2][3] = SrcA03 * SrcB20 + SrcA13 * SrcB21 + SrcA23 * SrcB22; - Result[3][0] = SrcA00 * SrcB30 + SrcA10 * SrcB31 + SrcA20 * SrcB32; - Result[3][1] = SrcA01 * SrcB30 + SrcA11 * SrcB31 + SrcA21 * SrcB32; - Result[3][2] = SrcA02 * SrcB30 + SrcA12 * SrcB31 + SrcA22 * SrcB32; - Result[3][3] = SrcA03 * SrcB30 + SrcA13 * SrcB31 + SrcA23 * SrcB32; - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x4<T, P> operator*(tmat3x4<T, P> const & m1, tmat2x3<T, P> const & m2) - { - return tmat2x4<T, P>( - m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2], - m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2], - m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2], - m1[0][3] * m2[0][0] + m1[1][3] * m2[0][1] + m1[2][3] * m2[0][2], - m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2], - m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2], - m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1] + m1[2][2] * m2[1][2], - m1[0][3] * m2[1][0] + m1[1][3] * m2[1][1] + m1[2][3] * m2[1][2]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x4<T, P> operator*(tmat3x4<T, P> const & m1, tmat3x3<T, P> const & m2) - { - return tmat3x4<T, P>( - m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2], - m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2], - m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2], - m1[0][3] * m2[0][0] + m1[1][3] * m2[0][1] + m1[2][3] * m2[0][2], - m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2], - m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2], - m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1] + m1[2][2] * m2[1][2], - m1[0][3] * m2[1][0] + m1[1][3] * m2[1][1] + m1[2][3] * m2[1][2], - m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1] + m1[2][0] * m2[2][2], - m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1] + m1[2][1] * m2[2][2], - m1[0][2] * m2[2][0] + m1[1][2] * m2[2][1] + m1[2][2] * m2[2][2], - m1[0][3] * m2[2][0] + m1[1][3] * m2[2][1] + m1[2][3] * m2[2][2]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x4<T, P> operator/(tmat3x4<T, P> const & m, T const & s) - { - return tmat3x4<T, P>( - m[0] / s, - m[1] / s, - m[2] / s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x4<T, P> operator/(T const & s, tmat3x4<T, P> const & m) - { - return tmat3x4<T, P>( - s / m[0], - s / m[1], - s / m[2]); - } - - // Unary constant operators - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x4<T, P> const operator-(tmat3x4<T, P> const & m) - { - return tmat3x4<T, P>( - -m[0], - -m[1], - -m[2]); - } - - ////////////////////////////////////// - // Boolean operators - - template <typename T, precision P> - GLM_FUNC_QUALIFIER bool operator==(tmat3x4<T, P> const & m1, tmat3x4<T, P> const & m2) - { - return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER bool operator!=(tmat3x4<T, P> const & m1, tmat3x4<T, P> const & m2) - { - return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]); - } -} //namespace glm diff --git a/extensions/common/glm/detail/type_mat4x2.hpp b/extensions/common/glm/detail/type_mat4x2.hpp deleted file mode 100644 index 54beb41dcc5..00000000000 --- a/extensions/common/glm/detail/type_mat4x2.hpp +++ /dev/null @@ -1,212 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/type_mat4x2.hpp -/// @date 2006-10-01 / 2011-06-15 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "../fwd.hpp" -#include "type_vec2.hpp" -#include "type_vec4.hpp" -#include "type_mat.hpp" -#include <limits> -#include <cstddef> - -namespace glm -{ - template <typename T, precision P = defaultp> - struct tmat4x2 - { - typedef tvec2<T, P> col_type; - typedef tvec4<T, P> row_type; - typedef tmat4x2<T, P> type; - typedef tmat2x4<T, P> transpose_type; - typedef T value_type; - - private: - /// @cond DETAIL - col_type value[4]; - /// @endcond - - public: - // Constructors - GLM_FUNC_DECL tmat4x2(); - GLM_FUNC_DECL tmat4x2(tmat4x2<T, P> const & m); - template <precision Q> - GLM_FUNC_DECL tmat4x2(tmat4x2<T, Q> const & m); - - GLM_FUNC_DECL explicit tmat4x2(ctor); - GLM_FUNC_DECL explicit tmat4x2(T const & x); - GLM_FUNC_DECL tmat4x2( - T const & x0, T const & y0, - T const & x1, T const & y1, - T const & x2, T const & y2, - T const & x3, T const & y3); - GLM_FUNC_DECL tmat4x2( - col_type const & v0, - col_type const & v1, - col_type const & v2, - col_type const & v3); - - ////////////////////////////////////// - // Conversions - - template < - typename X1, typename Y1, - typename X2, typename Y2, - typename X3, typename Y3, - typename X4, typename Y4> - GLM_FUNC_DECL tmat4x2( - X1 const & x1, Y1 const & y1, - X2 const & x2, Y2 const & y2, - X3 const & x3, Y3 const & y3, - X4 const & x4, Y4 const & y4); - - template <typename V1, typename V2, typename V3, typename V4> - GLM_FUNC_DECL tmat4x2( - tvec2<V1, P> const & v1, - tvec2<V2, P> const & v2, - tvec2<V3, P> const & v3, - tvec2<V4, P> const & v4); - - ////////////////////////////////////// - // Matrix conversions - -# ifdef GLM_FORCE_EXPLICIT_CTOR - template <typename U, precision Q> - GLM_FUNC_DECL explicit tmat4x2(tmat4x2<U, Q> const & m); -# else - template <typename U, precision Q> - GLM_FUNC_DECL tmat4x2(tmat4x2<U, Q> const & m); -# endif - - GLM_FUNC_DECL explicit tmat4x2(tmat2x2<T, P> const & x); - GLM_FUNC_DECL explicit tmat4x2(tmat3x3<T, P> const & x); - GLM_FUNC_DECL explicit tmat4x2(tmat4x4<T, P> const & x); - GLM_FUNC_DECL explicit tmat4x2(tmat2x3<T, P> const & x); - GLM_FUNC_DECL explicit tmat4x2(tmat3x2<T, P> const & x); - GLM_FUNC_DECL explicit tmat4x2(tmat2x4<T, P> const & x); - GLM_FUNC_DECL explicit tmat4x2(tmat4x3<T, P> const & x); - GLM_FUNC_DECL explicit tmat4x2(tmat3x4<T, P> const & x); - - ////////////////////////////////////// - // Accesses - -# ifdef GLM_FORCE_SIZE_FUNC - typedef size_t size_type; - GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const; - - GLM_FUNC_DECL col_type & operator[](size_type i); - GLM_FUNC_DECL col_type const & operator[](size_type i) const; -# else - typedef length_t length_type; - GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const; - - GLM_FUNC_DECL col_type & operator[](length_type i); - GLM_FUNC_DECL col_type const & operator[](length_type i) const; -# endif//GLM_FORCE_SIZE_FUNC - - ////////////////////////////////////// - // Unary arithmetic operators - - GLM_FUNC_DECL tmat4x2<T, P> & operator=(tmat4x2<T, P> const & m); - - template <typename U> - GLM_FUNC_DECL tmat4x2<T, P> & operator=(tmat4x2<U, P> const & m); - template <typename U> - GLM_FUNC_DECL tmat4x2<T, P> & operator+=(U s); - template <typename U> - GLM_FUNC_DECL tmat4x2<T, P> & operator+=(tmat4x2<U, P> const & m); - template <typename U> - GLM_FUNC_DECL tmat4x2<T, P> & operator-=(U s); - template <typename U> - GLM_FUNC_DECL tmat4x2<T, P> & operator-=(tmat4x2<U, P> const & m); - template <typename U> - GLM_FUNC_DECL tmat4x2<T, P> & operator*=(U s); - template <typename U> - GLM_FUNC_DECL tmat4x2<T, P> & operator/=(U s); - - ////////////////////////////////////// - // Increment and decrement operators - - GLM_FUNC_DECL tmat4x2<T, P> & operator++ (); - GLM_FUNC_DECL tmat4x2<T, P> & operator-- (); - GLM_FUNC_DECL tmat4x2<T, P> operator++(int); - GLM_FUNC_DECL tmat4x2<T, P> operator--(int); - }; - - // Binary operators - template <typename T, precision P> - GLM_FUNC_DECL tmat4x2<T, P> operator+(tmat4x2<T, P> const & m, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tmat4x2<T, P> operator+(tmat4x2<T, P> const & m1, tmat4x2<T, P> const & m2); - - template <typename T, precision P> - GLM_FUNC_DECL tmat4x2<T, P> operator-(tmat4x2<T, P> const & m, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tmat4x2<T, P> operator-(tmat4x2<T, P> const & m1, tmat4x2<T, P> const & m2); - - template <typename T, precision P> - GLM_FUNC_DECL tmat4x2<T, P> operator*(tmat4x2<T, P> const & m, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tmat4x2<T, P> operator*(T const & s, tmat4x2<T, P> const & m); - - template <typename T, precision P> - GLM_FUNC_DECL typename tmat4x2<T, P>::col_type operator*(tmat4x2<T, P> const & m, typename tmat4x2<T, P>::row_type const & v); - - template <typename T, precision P> - GLM_FUNC_DECL typename tmat4x2<T, P>::row_type operator*(typename tmat4x2<T, P>::col_type const & v, tmat4x2<T, P> const & m); - - template <typename T, precision P> - GLM_FUNC_DECL tmat3x2<T, P> operator*(tmat4x2<T, P> const & m1, tmat3x4<T, P> const & m2); - - template <typename T, precision P> - GLM_FUNC_DECL tmat4x2<T, P> operator*(tmat4x2<T, P> const & m1, tmat4x4<T, P> const & m2); - - template <typename T, precision P> - GLM_FUNC_DECL tmat2x3<T, P> operator*(tmat4x3<T, P> const & m1, tmat2x4<T, P> const & m2); - - template <typename T, precision P> - GLM_FUNC_DECL tmat4x2<T, P> operator/(tmat4x2<T, P> const & m, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tmat4x2<T, P> operator/(T const & s, tmat4x2<T, P> const & m); - - // Unary constant operators - template <typename T, precision P> - GLM_FUNC_DECL tmat4x2<T, P> const operator-(tmat4x2<T, P> const & m); -}//namespace glm - -#ifndef GLM_EXTERNAL_TEMPLATE -#include "type_mat4x2.inl" -#endif diff --git a/extensions/common/glm/detail/type_mat4x2.inl b/extensions/common/glm/detail/type_mat4x2.inl deleted file mode 100644 index dac9ff06624..00000000000 --- a/extensions/common/glm/detail/type_mat4x2.inl +++ /dev/null @@ -1,587 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/type_mat4x2.inl -/// @date 2006-10-01 / 2011-06-15 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - ////////////////////////////////////////////////////////////// - // Constructors - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2() - { -# ifndef GLM_FORCE_NO_CTOR_INIT - this->value[0] = col_type(1, 0); - this->value[1] = col_type(0, 1); - this->value[2] = col_type(0, 0); - this->value[3] = col_type(0, 0); -# endif - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat4x2<T, P> const & m) - { - this->value[0] = m.value[0]; - this->value[1] = m.value[1]; - this->value[2] = m.value[2]; - this->value[3] = m.value[3]; - } - - template <typename T, precision P> - template <precision Q> - GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat4x2<T, Q> const & m) - { - this->value[0] = m.value[0]; - this->value[1] = m.value[1]; - this->value[2] = m.value[2]; - this->value[3] = m.value[3]; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(ctor) - {} - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(T const & s) - { - value_type const Zero(0); - this->value[0] = col_type(s, Zero); - this->value[1] = col_type(Zero, s); - this->value[2] = col_type(Zero, Zero); - this->value[3] = col_type(Zero, Zero); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2 - ( - T const & x0, T const & y0, - T const & x1, T const & y1, - T const & x2, T const & y2, - T const & x3, T const & y3 - ) - { - this->value[0] = col_type(x0, y0); - this->value[1] = col_type(x1, y1); - this->value[2] = col_type(x2, y2); - this->value[3] = col_type(x3, y3); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2 - ( - col_type const & v0, - col_type const & v1, - col_type const & v2, - col_type const & v3 - ) - { - this->value[0] = v0; - this->value[1] = v1; - this->value[2] = v2; - this->value[3] = v3; - } - - ////////////////////////////////////// - // Conversion constructors - - template <typename T, precision P> - template < - typename X1, typename Y1, - typename X2, typename Y2, - typename X3, typename Y3, - typename X4, typename Y4> - GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2 - ( - X1 const & x1, Y1 const & y1, - X2 const & x2, Y2 const & y2, - X3 const & x3, Y3 const & y3, - X4 const & x4, Y4 const & y4 - ) - { - this->value[0] = col_type(static_cast<T>(x1), value_type(y1)); - this->value[1] = col_type(static_cast<T>(x2), value_type(y2)); - this->value[2] = col_type(static_cast<T>(x3), value_type(y3)); - this->value[3] = col_type(static_cast<T>(x4), value_type(y4)); - } - - template <typename T, precision P> - template <typename V1, typename V2, typename V3, typename V4> - GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2 - ( - tvec2<V1, P> const & v1, - tvec2<V2, P> const & v2, - tvec2<V3, P> const & v3, - tvec2<V4, P> const & v4 - ) - { - this->value[0] = col_type(v1); - this->value[1] = col_type(v2); - this->value[2] = col_type(v3); - this->value[3] = col_type(v4); - } - - ////////////////////////////////////// - // Conversion - template <typename T, precision P> - template <typename U, precision Q> - GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat4x2<U, Q> const & m) - { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); - this->value[3] = col_type(m[3]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat2x2<T, P> const & m) - { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(0); - this->value[3] = col_type(0); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat3x3<T, P> const & m) - { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); - this->value[3] = col_type(0); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat4x4<T, P> const & m) - { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); - this->value[3] = col_type(m[3]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat2x3<T, P> const & m) - { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(0); - this->value[3] = col_type(0); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat3x2<T, P> const & m) - { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); - this->value[3] = col_type(0); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat2x4<T, P> const & m) - { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(0); - this->value[3] = col_type(0); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat4x3<T, P> const & m) - { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); - this->value[3] = col_type(m[3]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat3x4<T, P> const & m) - { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); - this->value[3] = col_type(0); - } - - ////////////////////////////////////// - // Accesses - -# ifdef GLM_FORCE_SIZE_FUNC - template <typename T, precision P> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat4x2<T, P>::size_type tmat4x2<T, P>::size() const - { - return 4; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tmat4x2<T, P>::col_type & tmat4x2<T, P>::operator[](typename tmat4x2<T, P>::size_type i) - { - assert(i < this->size()); - return this->value[i]; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tmat4x2<T, P>::col_type const & tmat4x2<T, P>::operator[](typename tmat4x2<T, P>::size_type i) const - { - assert(i < this->size()); - return this->value[i]; - } -# else - template <typename T, precision P> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat4x2<T, P>::length_type tmat4x2<T, P>::length() const - { - return 4; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tmat4x2<T, P>::col_type & tmat4x2<T, P>::operator[](typename tmat4x2<T, P>::length_type i) - { - assert(i < this->length()); - return this->value[i]; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tmat4x2<T, P>::col_type const & tmat4x2<T, P>::operator[](typename tmat4x2<T, P>::length_type i) const - { - assert(i < this->length()); - return this->value[i]; - } -# endif//GLM_FORCE_SIZE_FUNC - - ////////////////////////////////////////////////////////////// - // Unary updatable operators - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x2<T, P>& tmat4x2<T, P>::operator=(tmat4x2<T, P> const & m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - this->value[3] = m[3]; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat4x2<T, P>& tmat4x2<T, P>::operator=(tmat4x2<U, P> const & m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - this->value[3] = m[3]; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat4x2<T, P> & tmat4x2<T, P>::operator+=(U s) - { - this->value[0] += s; - this->value[1] += s; - this->value[2] += s; - this->value[3] += s; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat4x2<T, P> & tmat4x2<T, P>::operator+=(tmat4x2<U, P> const & m) - { - this->value[0] += m[0]; - this->value[1] += m[1]; - this->value[2] += m[2]; - this->value[3] += m[3]; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat4x2<T, P> & tmat4x2<T, P>::operator-=(U s) - { - this->value[0] -= s; - this->value[1] -= s; - this->value[2] -= s; - this->value[3] -= s; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat4x2<T, P> & tmat4x2<T, P>::operator-=(tmat4x2<U, P> const & m) - { - this->value[0] -= m[0]; - this->value[1] -= m[1]; - this->value[2] -= m[2]; - this->value[3] -= m[3]; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat4x2<T, P> & tmat4x2<T, P>::operator*=(U s) - { - this->value[0] *= s; - this->value[1] *= s; - this->value[2] *= s; - this->value[3] *= s; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat4x2<T, P> & tmat4x2<T, P>::operator/=(U s) - { - this->value[0] /= s; - this->value[1] /= s; - this->value[2] /= s; - this->value[3] /= s; - return *this; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x2<T, P> & tmat4x2<T, P>::operator++() - { - ++this->value[0]; - ++this->value[1]; - ++this->value[2]; - ++this->value[3]; - return *this; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x2<T, P> & tmat4x2<T, P>::operator--() - { - --this->value[0]; - --this->value[1]; - --this->value[2]; - --this->value[3]; - return *this; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x2<T, P> tmat4x2<T, P>::operator++(int) - { - tmat4x2<T, P> Result(*this); - ++*this; - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x2<T, P> tmat4x2<T, P>::operator--(int) - { - tmat4x2<T, P> Result(*this); - --*this; - return Result; - } - - ////////////////////////////////////////////////////////////// - // Binary operators - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x2<T, P> operator+(tmat4x2<T, P> const & m, T const & s) - { - return tmat4x2<T, P>( - m[0] + s, - m[1] + s, - m[2] + s, - m[3] + s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x2<T, P> operator+(tmat4x2<T, P> const & m1, tmat4x2<T, P> const & m2) - { - return tmat4x2<T, P>( - m1[0] + m2[0], - m1[1] + m2[1], - m1[2] + m2[2], - m1[3] + m2[3]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x2<T, P> operator-(tmat4x2<T, P> const & m, T const & s) - { - return tmat4x2<T, P>( - m[0] - s, - m[1] - s, - m[2] - s, - m[3] - s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x2<T, P> operator-(tmat4x2<T, P> const & m1, tmat4x2<T, P> const & m2) - { - return tmat4x2<T, P>( - m1[0] - m2[0], - m1[1] - m2[1], - m1[2] - m2[2], - m1[3] - m2[3]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x2<T, P> operator*(tmat4x2<T, P> const & m, T const & s) - { - return tmat4x2<T, P>( - m[0] * s, - m[1] * s, - m[2] * s, - m[3] * s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x2<T, P> operator*(T const & s, tmat4x2<T, P> const & m) - { - return tmat4x2<T, P>( - m[0] * s, - m[1] * s, - m[2] * s, - m[3] * s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tmat4x2<T, P>::col_type operator*(tmat4x2<T, P> const & m, typename tmat4x2<T, P>::row_type const & v) - { - return typename tmat4x2<T, P>::col_type( - m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * v.w, - m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z + m[3][1] * v.w); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tmat4x2<T, P>::row_type operator*(typename tmat4x2<T, P>::col_type const & v, tmat4x2<T, P> const & m) - { - return typename tmat4x2<T, P>::row_type( - v.x * m[0][0] + v.y * m[0][1], - v.x * m[1][0] + v.y * m[1][1], - v.x * m[2][0] + v.y * m[2][1], - v.x * m[3][0] + v.y * m[3][1]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x2<T, P> operator*(tmat4x2<T, P> const & m1, tmat2x4<T, P> const & m2) - { - T const SrcA00 = m1[0][0]; - T const SrcA01 = m1[0][1]; - T const SrcA10 = m1[1][0]; - T const SrcA11 = m1[1][1]; - T const SrcA20 = m1[2][0]; - T const SrcA21 = m1[2][1]; - T const SrcA30 = m1[3][0]; - T const SrcA31 = m1[3][1]; - - T const SrcB00 = m2[0][0]; - T const SrcB01 = m2[0][1]; - T const SrcB02 = m2[0][2]; - T const SrcB03 = m2[0][3]; - T const SrcB10 = m2[1][0]; - T const SrcB11 = m2[1][1]; - T const SrcB12 = m2[1][2]; - T const SrcB13 = m2[1][3]; - - tmat2x2<T, P> Result(uninitialize); - Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02 + SrcA30 * SrcB03; - Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02 + SrcA31 * SrcB03; - Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12 + SrcA30 * SrcB13; - Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12 + SrcA31 * SrcB13; - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x2<T, P> operator*(tmat4x2<T, P> const & m1, tmat3x4<T, P> const & m2) - { - return tmat3x2<T, P>( - m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3], - m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2] + m1[3][1] * m2[0][3], - m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2] + m1[3][0] * m2[1][3], - m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2] + m1[3][1] * m2[1][3], - m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1] + m1[2][0] * m2[2][2] + m1[3][0] * m2[2][3], - m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1] + m1[2][1] * m2[2][2] + m1[3][1] * m2[2][3]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x2<T, P> operator*(tmat4x2<T, P> const & m1, tmat4x4<T, P> const & m2) - { - return tmat4x2<T, P>( - m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3], - m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2] + m1[3][1] * m2[0][3], - m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2] + m1[3][0] * m2[1][3], - m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2] + m1[3][1] * m2[1][3], - m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1] + m1[2][0] * m2[2][2] + m1[3][0] * m2[2][3], - m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1] + m1[2][1] * m2[2][2] + m1[3][1] * m2[2][3], - m1[0][0] * m2[3][0] + m1[1][0] * m2[3][1] + m1[2][0] * m2[3][2] + m1[3][0] * m2[3][3], - m1[0][1] * m2[3][0] + m1[1][1] * m2[3][1] + m1[2][1] * m2[3][2] + m1[3][1] * m2[3][3]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x2<T, P> operator/(tmat4x2<T, P> const & m, T const & s) - { - return tmat4x2<T, P>( - m[0] / s, - m[1] / s, - m[2] / s, - m[3] / s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x2<T, P> operator/(T const & s, tmat4x2<T, P> const & m) - { - return tmat4x2<T, P>( - s / m[0], - s / m[1], - s / m[2], - s / m[3]); - } - - // Unary constant operators - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x2<T, P> const operator-(tmat4x2<T, P> const & m) - { - return tmat4x2<T, P>( - -m[0], - -m[1], - -m[2], - -m[3]); - } - - ////////////////////////////////////// - // Boolean operators - - template <typename T, precision P> - GLM_FUNC_QUALIFIER bool operator==(tmat4x2<T, P> const & m1, tmat4x2<T, P> const & m2) - { - return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]) && (m1[3] == m2[3]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER bool operator!=(tmat4x2<T, P> const & m1, tmat4x2<T, P> const & m2) - { - return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]) || (m1[3] != m2[3]); - } -} //namespace glm diff --git a/extensions/common/glm/detail/type_mat4x3.hpp b/extensions/common/glm/detail/type_mat4x3.hpp deleted file mode 100644 index d9abe2a5ad2..00000000000 --- a/extensions/common/glm/detail/type_mat4x3.hpp +++ /dev/null @@ -1,211 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/type_mat4x3.hpp -/// @date 2006-08-04 / 2011-06-15 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "../fwd.hpp" -#include "type_vec3.hpp" -#include "type_vec4.hpp" -#include "type_mat.hpp" -#include <limits> -#include <cstddef> - -namespace glm -{ - template <typename T, precision P = defaultp> - struct tmat4x3 - { - typedef tvec3<T, P> col_type; - typedef tvec4<T, P> row_type; - typedef tmat4x3<T, P> type; - typedef tmat3x4<T, P> transpose_type; - typedef T value_type; - - private: - // Data - col_type value[4]; - - public: - // Constructors - GLM_FUNC_DECL tmat4x3(); - GLM_FUNC_DECL tmat4x3(tmat4x3<T, P> const & m); - template <precision Q> - GLM_FUNC_DECL tmat4x3(tmat4x3<T, Q> const & m); - - GLM_FUNC_DECL explicit tmat4x3(ctor); - GLM_FUNC_DECL explicit tmat4x3(T const & x); - GLM_FUNC_DECL tmat4x3( - T const & x0, T const & y0, T const & z0, - T const & x1, T const & y1, T const & z1, - T const & x2, T const & y2, T const & z2, - T const & x3, T const & y3, T const & z3); - GLM_FUNC_DECL tmat4x3( - col_type const & v0, - col_type const & v1, - col_type const & v2, - col_type const & v3); - - ////////////////////////////////////// - // Conversions - - template < - typename X1, typename Y1, typename Z1, - typename X2, typename Y2, typename Z2, - typename X3, typename Y3, typename Z3, - typename X4, typename Y4, typename Z4> - GLM_FUNC_DECL tmat4x3( - X1 const & x1, Y1 const & y1, Z1 const & z1, - X2 const & x2, Y2 const & y2, Z2 const & z2, - X3 const & x3, Y3 const & y3, Z3 const & z3, - X4 const & x4, Y4 const & y4, Z4 const & z4); - - template <typename V1, typename V2, typename V3, typename V4> - GLM_FUNC_DECL tmat4x3( - tvec3<V1, P> const & v1, - tvec3<V2, P> const & v2, - tvec3<V3, P> const & v3, - tvec3<V4, P> const & v4); - - ////////////////////////////////////// - // Matrix conversions - -# ifdef GLM_FORCE_EXPLICIT_CTOR - template <typename U, precision Q> - GLM_FUNC_DECL explicit tmat4x3(tmat4x3<U, Q> const & m); -# else - template <typename U, precision Q> - GLM_FUNC_DECL tmat4x3(tmat4x3<U, Q> const & m); -# endif - - GLM_FUNC_DECL explicit tmat4x3(tmat2x2<T, P> const & x); - GLM_FUNC_DECL explicit tmat4x3(tmat3x3<T, P> const & x); - GLM_FUNC_DECL explicit tmat4x3(tmat4x4<T, P> const & x); - GLM_FUNC_DECL explicit tmat4x3(tmat2x3<T, P> const & x); - GLM_FUNC_DECL explicit tmat4x3(tmat3x2<T, P> const & x); - GLM_FUNC_DECL explicit tmat4x3(tmat2x4<T, P> const & x); - GLM_FUNC_DECL explicit tmat4x3(tmat4x2<T, P> const & x); - GLM_FUNC_DECL explicit tmat4x3(tmat3x4<T, P> const & x); - - ////////////////////////////////////// - // Accesses - -# ifdef GLM_FORCE_SIZE_FUNC - typedef size_t size_type; - GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const; - - GLM_FUNC_DECL col_type & operator[](size_type i); - GLM_FUNC_DECL col_type const & operator[](size_type i) const; -# else - typedef length_t length_type; - GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const; - - GLM_FUNC_DECL col_type & operator[](length_type i); - GLM_FUNC_DECL col_type const & operator[](length_type i) const; -# endif//GLM_FORCE_SIZE_FUNC - - ////////////////////////////////////// - // Unary arithmetic operators - - GLM_FUNC_DECL tmat4x3<T, P> & operator=(tmat4x3<T, P> const & m); - - template <typename U> - GLM_FUNC_DECL tmat4x3<T, P> & operator=(tmat4x3<U, P> const & m); - template <typename U> - GLM_FUNC_DECL tmat4x3<T, P> & operator+=(U s); - template <typename U> - GLM_FUNC_DECL tmat4x3<T, P> & operator+=(tmat4x3<U, P> const & m); - template <typename U> - GLM_FUNC_DECL tmat4x3<T, P> & operator-=(U s); - template <typename U> - GLM_FUNC_DECL tmat4x3<T, P> & operator-=(tmat4x3<U, P> const & m); - template <typename U> - GLM_FUNC_DECL tmat4x3<T, P> & operator*=(U s); - template <typename U> - GLM_FUNC_DECL tmat4x3<T, P> & operator/=(U s); - - ////////////////////////////////////// - // Increment and decrement operators - - GLM_FUNC_DECL tmat4x3<T, P> & operator++(); - GLM_FUNC_DECL tmat4x3<T, P> & operator--(); - GLM_FUNC_DECL tmat4x3<T, P> operator++(int); - GLM_FUNC_DECL tmat4x3<T, P> operator--(int); - }; - - // Binary operators - template <typename T, precision P> - GLM_FUNC_DECL tmat4x3<T, P> operator+(tmat4x3<T, P> const & m, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tmat4x3<T, P> operator+(tmat4x3<T, P> const & m1, tmat4x3<T, P> const & m2); - - template <typename T, precision P> - GLM_FUNC_DECL tmat4x3<T, P> operator-(tmat4x3<T, P> const & m, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tmat4x3<T, P> operator-(tmat4x3<T, P> const & m1, tmat4x3<T, P> const & m2); - - template <typename T, precision P> - GLM_FUNC_DECL tmat4x3<T, P> operator*(tmat4x3<T, P> const & m, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tmat4x3<T, P> operator*(T const & s, tmat4x3<T, P> const & m); - - template <typename T, precision P> - GLM_FUNC_DECL typename tmat4x3<T, P>::col_type operator*(tmat4x3<T, P> const & m, typename tmat4x3<T, P>::row_type const & v); - - template <typename T, precision P> - GLM_FUNC_DECL typename tmat4x3<T, P>::row_type operator*(typename tmat4x3<T, P>::col_type const & v, tmat4x3<T, P> const & m); - - template <typename T, precision P> - GLM_FUNC_DECL tmat2x3<T, P> operator*(tmat4x3<T, P> const & m1, tmat2x4<T, P> const & m2); - - template <typename T, precision P> - GLM_FUNC_DECL tmat3x3<T, P> operator*(tmat4x3<T, P> const & m1, tmat3x4<T, P> const & m2); - - template <typename T, precision P> - GLM_FUNC_DECL tmat4x3<T, P> operator*(tmat4x3<T, P> const & m1, tmat4x4<T, P> const & m2); - - template <typename T, precision P> - GLM_FUNC_DECL tmat4x3<T, P> operator/(tmat4x3<T, P> const & m, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tmat4x3<T, P> operator/(T const & s, tmat4x3<T, P> const & m); - - // Unary constant operators - template <typename T, precision P> - GLM_FUNC_DECL tmat4x3<T, P> const operator-(tmat4x3<T, P> const & m); -}//namespace glm - -#ifndef GLM_EXTERNAL_TEMPLATE -#include "type_mat4x3.inl" -#endif //GLM_EXTERNAL_TEMPLATE diff --git a/extensions/common/glm/detail/type_mat4x3.inl b/extensions/common/glm/detail/type_mat4x3.inl deleted file mode 100644 index d5c62c8acb2..00000000000 --- a/extensions/common/glm/detail/type_mat4x3.inl +++ /dev/null @@ -1,631 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/type_mat4x3.inl -/// @date 2006-04-17 / 2011-06-15 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - ////////////////////////////////////////////////////////////// - // Constructors - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3() - { -# ifndef GLM_FORCE_NO_CTOR_INIT - this->value[0] = col_type(1, 0, 0); - this->value[1] = col_type(0, 1, 0); - this->value[2] = col_type(0, 0, 1); - this->value[3] = col_type(0, 0, 0); -# endif - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(tmat4x3<T, P> const & m) - { - this->value[0] = m.value[0]; - this->value[1] = m.value[1]; - this->value[2] = m.value[2]; - this->value[3] = m.value[3]; - } - - template <typename T, precision P> - template <precision Q> - GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(tmat4x3<T, Q> const & m) - { - this->value[0] = m.value[0]; - this->value[1] = m.value[1]; - this->value[2] = m.value[2]; - this->value[3] = m.value[3]; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(ctor) - {} - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(T const & s) - { - this->value[0] = col_type(s, 0, 0); - this->value[1] = col_type(0, s, 0); - this->value[2] = col_type(0, 0, s); - this->value[3] = col_type(0, 0, 0); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3 - ( - T const & x0, T const & y0, T const & z0, - T const & x1, T const & y1, T const & z1, - T const & x2, T const & y2, T const & z2, - T const & x3, T const & y3, T const & z3 - ) - { - this->value[0] = col_type(x0, y0, z0); - this->value[1] = col_type(x1, y1, z1); - this->value[2] = col_type(x2, y2, z2); - this->value[3] = col_type(x3, y3, z3); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3 - ( - col_type const & v0, - col_type const & v1, - col_type const & v2, - col_type const & v3 - ) - { - this->value[0] = v0; - this->value[1] = v1; - this->value[2] = v2; - this->value[3] = v3; - } - - ////////////////////////////////////// - // Conversion constructors - - template <typename T, precision P> - template < - typename X1, typename Y1, typename Z1, - typename X2, typename Y2, typename Z2, - typename X3, typename Y3, typename Z3, - typename X4, typename Y4, typename Z4> - GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3 - ( - X1 const & x1, Y1 const & y1, Z1 const & z1, - X2 const & x2, Y2 const & y2, Z2 const & z2, - X3 const & x3, Y3 const & y3, Z3 const & z3, - X4 const & x4, Y4 const & y4, Z4 const & z4 - ) - { - this->value[0] = col_type(static_cast<T>(x1), value_type(y1), value_type(z1)); - this->value[1] = col_type(static_cast<T>(x2), value_type(y2), value_type(z2)); - this->value[2] = col_type(static_cast<T>(x3), value_type(y3), value_type(z3)); - this->value[3] = col_type(static_cast<T>(x4), value_type(y4), value_type(z4)); - } - - template <typename T, precision P> - template <typename V1, typename V2, typename V3, typename V4> - GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3 - ( - tvec3<V1, P> const & v1, - tvec3<V2, P> const & v2, - tvec3<V3, P> const & v3, - tvec3<V4, P> const & v4 - ) - { - this->value[0] = col_type(v1); - this->value[1] = col_type(v2); - this->value[2] = col_type(v3); - this->value[3] = col_type(v4); - } - - ////////////////////////////////////////////////////////////// - // Matrix conversions - - template <typename T, precision P> - template <typename U, precision Q> - GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(tmat4x3<U, Q> const & m) - { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); - this->value[3] = col_type(m[3]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(tmat2x2<T, P> const & m) - { - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); - this->value[2] = col_type(m[2], 1); - this->value[3] = col_type(0); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(tmat3x3<T, P> const & m) - { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); - this->value[3] = col_type(0); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(tmat4x4<T, P> const & m) - { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); - this->value[3] = col_type(m[3]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(tmat2x3<T, P> const & m) - { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(0, 0, 1); - this->value[3] = col_type(0); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(tmat3x2<T, P> const & m) - { - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); - this->value[2] = col_type(m[2], 1); - this->value[3] = col_type(0); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(tmat2x4<T, P> const & m) - { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(0, 0, 1); - this->value[3] = col_type(0); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(tmat4x2<T, P> const & m) - { - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); - this->value[2] = col_type(m[2], 1); - this->value[3] = col_type(m[3], 0); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(tmat3x4<T, P> const & m) - { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); - this->value[3] = col_type(0); - } - - ////////////////////////////////////// - // Accesses - -# ifdef GLM_FORCE_SIZE_FUNC - template <typename T, precision P> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat4x3<T, P>::size_type tmat4x3<T, P>::size() const - { - return 4; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tmat4x3<T, P>::col_type & tmat4x3<T, P>::operator[](typename tmat4x3<T, P>::size_type i) - { - assert(i < this->size()); - return this->value[i]; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tmat4x3<T, P>::col_type const & tmat4x3<T, P>::operator[](typename tmat4x3<T, P>::size_type i) const - { - assert(i < this->size()); - return this->value[i]; - } -# else - template <typename T, precision P> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat4x3<T, P>::length_type tmat4x3<T, P>::length() const - { - return 4; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tmat4x3<T, P>::col_type & tmat4x3<T, P>::operator[](typename tmat4x3<T, P>::length_type i) - { - assert(i < this->length()); - return this->value[i]; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tmat4x3<T, P>::col_type const & tmat4x3<T, P>::operator[](typename tmat4x3<T, P>::length_type i) const - { - assert(i < this->length()); - return this->value[i]; - } -# endif//GLM_FORCE_SIZE_FUNC - - ////////////////////////////////////////////////////////////// - // Unary updatable operators - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x3<T, P>& tmat4x3<T, P>::operator=(tmat4x3<T, P> const & m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - this->value[3] = m[3]; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat4x3<T, P>& tmat4x3<T, P>::operator=(tmat4x3<U, P> const & m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - this->value[3] = m[3]; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat4x3<T, P> & tmat4x3<T, P>::operator+=(U s) - { - this->value[0] += s; - this->value[1] += s; - this->value[2] += s; - this->value[3] += s; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat4x3<T, P> & tmat4x3<T, P>::operator+=(tmat4x3<U, P> const & m) - { - this->value[0] += m[0]; - this->value[1] += m[1]; - this->value[2] += m[2]; - this->value[3] += m[3]; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat4x3<T, P> & tmat4x3<T, P>::operator-=(U s) - { - this->value[0] -= s; - this->value[1] -= s; - this->value[2] -= s; - this->value[3] -= s; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat4x3<T, P> & tmat4x3<T, P>::operator-=(tmat4x3<U, P> const & m) - { - this->value[0] -= m[0]; - this->value[1] -= m[1]; - this->value[2] -= m[2]; - this->value[3] -= m[3]; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat4x3<T, P> & tmat4x3<T, P>::operator*=(U s) - { - this->value[0] *= s; - this->value[1] *= s; - this->value[2] *= s; - this->value[3] *= s; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat4x3<T, P> & tmat4x3<T, P>::operator/=(U s) - { - this->value[0] /= s; - this->value[1] /= s; - this->value[2] /= s; - this->value[3] /= s; - return *this; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x3<T, P> & tmat4x3<T, P>::operator++() - { - ++this->value[0]; - ++this->value[1]; - ++this->value[2]; - ++this->value[3]; - return *this; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x3<T, P> & tmat4x3<T, P>::operator--() - { - --this->value[0]; - --this->value[1]; - --this->value[2]; - --this->value[3]; - return *this; - } - - ////////////////////////////////////////////////////////////// - // Binary operators - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x3<T, P> operator+(tmat4x3<T, P> const & m, T const & s) - { - return tmat4x3<T, P>( - m[0] + s, - m[1] + s, - m[2] + s, - m[3] + s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x3<T, P> operator+(tmat4x3<T, P> const & m1, tmat4x3<T, P> const & m2) - { - return tmat4x3<T, P>( - m1[0] + m2[0], - m1[1] + m2[1], - m1[2] + m2[2], - m1[3] + m2[3]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x3<T, P> operator-(tmat4x3<T, P> const & m, T const & s) - { - return tmat4x3<T, P>( - m[0] - s, - m[1] - s, - m[2] - s, - m[3] - s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x3<T, P> operator-(tmat4x3<T, P> const & m1, tmat4x3<T, P> const & m2) - { - return tmat4x3<T, P>( - m1[0] - m2[0], - m1[1] - m2[1], - m1[2] - m2[2], - m1[3] - m2[3]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x3<T, P> operator*(tmat4x3<T, P> const & m, T const & s) - { - return tmat4x3<T, P>( - m[0] * s, - m[1] * s, - m[2] * s, - m[3] * s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x3<T, P> operator*(T const & s, tmat4x3<T, P> const & m) - { - return tmat4x3<T, P>( - m[0] * s, - m[1] * s, - m[2] * s, - m[3] * s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tmat4x3<T, P>::col_type operator* - ( - tmat4x3<T, P> const & m, - typename tmat4x3<T, P>::row_type const & v) - { - return typename tmat4x3<T, P>::col_type( - m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * v.w, - m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z + m[3][1] * v.w, - m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z + m[3][2] * v.w); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tmat4x3<T, P>::row_type operator* - ( - typename tmat4x3<T, P>::col_type const & v, - tmat4x3<T, P> const & m) - { - return typename tmat4x3<T, P>::row_type( - v.x * m[0][0] + v.y * m[0][1] + v.z * m[0][2], - v.x * m[1][0] + v.y * m[1][1] + v.z * m[1][2], - v.x * m[2][0] + v.y * m[2][1] + v.z * m[2][2], - v.x * m[3][0] + v.y * m[3][1] + v.z * m[3][2]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x3<T, P> operator*(tmat4x3<T, P> const & m1, tmat2x4<T, P> const & m2) - { - return tmat2x3<T, P>( - m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3], - m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2] + m1[3][1] * m2[0][3], - m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2] + m1[3][2] * m2[0][3], - m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2] + m1[3][0] * m2[1][3], - m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2] + m1[3][1] * m2[1][3], - m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1] + m1[2][2] * m2[1][2] + m1[3][2] * m2[1][3]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x3<T, P> operator*(tmat4x3<T, P> const & m1, tmat3x4<T, P> const & m2) - { - T const SrcA00 = m1[0][0]; - T const SrcA01 = m1[0][1]; - T const SrcA02 = m1[0][2]; - T const SrcA10 = m1[1][0]; - T const SrcA11 = m1[1][1]; - T const SrcA12 = m1[1][2]; - T const SrcA20 = m1[2][0]; - T const SrcA21 = m1[2][1]; - T const SrcA22 = m1[2][2]; - T const SrcA30 = m1[3][0]; - T const SrcA31 = m1[3][1]; - T const SrcA32 = m1[3][2]; - - T const SrcB00 = m2[0][0]; - T const SrcB01 = m2[0][1]; - T const SrcB02 = m2[0][2]; - T const SrcB03 = m2[0][3]; - T const SrcB10 = m2[1][0]; - T const SrcB11 = m2[1][1]; - T const SrcB12 = m2[1][2]; - T const SrcB13 = m2[1][3]; - T const SrcB20 = m2[2][0]; - T const SrcB21 = m2[2][1]; - T const SrcB22 = m2[2][2]; - T const SrcB23 = m2[2][3]; - - tmat3x3<T, P> Result(uninitialize); - Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02 + SrcA30 * SrcB03; - Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02 + SrcA31 * SrcB03; - Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01 + SrcA22 * SrcB02 + SrcA32 * SrcB03; - Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12 + SrcA30 * SrcB13; - Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12 + SrcA31 * SrcB13; - Result[1][2] = SrcA02 * SrcB10 + SrcA12 * SrcB11 + SrcA22 * SrcB12 + SrcA32 * SrcB13; - Result[2][0] = SrcA00 * SrcB20 + SrcA10 * SrcB21 + SrcA20 * SrcB22 + SrcA30 * SrcB23; - Result[2][1] = SrcA01 * SrcB20 + SrcA11 * SrcB21 + SrcA21 * SrcB22 + SrcA31 * SrcB23; - Result[2][2] = SrcA02 * SrcB20 + SrcA12 * SrcB21 + SrcA22 * SrcB22 + SrcA32 * SrcB23; - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x3<T, P> operator*(tmat4x3<T, P> const & m1, tmat4x4<T, P> const & m2) - { - return tmat4x3<T, P>( - m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3], - m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2] + m1[3][1] * m2[0][3], - m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2] + m1[3][2] * m2[0][3], - m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2] + m1[3][0] * m2[1][3], - m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2] + m1[3][1] * m2[1][3], - m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1] + m1[2][2] * m2[1][2] + m1[3][2] * m2[1][3], - m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1] + m1[2][0] * m2[2][2] + m1[3][0] * m2[2][3], - m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1] + m1[2][1] * m2[2][2] + m1[3][1] * m2[2][3], - m1[0][2] * m2[2][0] + m1[1][2] * m2[2][1] + m1[2][2] * m2[2][2] + m1[3][2] * m2[2][3], - m1[0][0] * m2[3][0] + m1[1][0] * m2[3][1] + m1[2][0] * m2[3][2] + m1[3][0] * m2[3][3], - m1[0][1] * m2[3][0] + m1[1][1] * m2[3][1] + m1[2][1] * m2[3][2] + m1[3][1] * m2[3][3], - m1[0][2] * m2[3][0] + m1[1][2] * m2[3][1] + m1[2][2] * m2[3][2] + m1[3][2] * m2[3][3]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x3<T, P> operator/(tmat4x3<T, P> const & m, T const & s) - { - return tmat4x3<T, P>( - m[0] / s, - m[1] / s, - m[2] / s, - m[3] / s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x3<T, P> operator/(T const & s, tmat4x3<T, P> const & m) - { - return tmat4x3<T, P>( - s / m[0], - s / m[1], - s / m[2], - s / m[3]); - } - - // Unary constant operators - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x3<T, P> const operator-(tmat4x3<T, P> const & m) - { - return tmat4x3<T, P>( - -m[0], - -m[1], - -m[2], - -m[3]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x3<T, P> const operator++(tmat4x3<T, P> const & m, int) - { - return tmat4x3<T, P>( - m[0] + T(1), - m[1] + T(1), - m[2] + T(1), - m[3] + T(1)); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x3<T, P> const operator--(tmat4x3<T, P> const & m, int) - { - return tmat4x3<T, P>( - m[0] - T(1), - m[1] - T(1), - m[2] - T(1), - m[3] - T(1)); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x3<T, P> tmat4x3<T, P>::operator++(int) - { - tmat4x3<T, P> Result(*this); - ++*this; - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x3<T, P> tmat4x3<T, P>::operator--(int) - { - tmat4x3<T, P> Result(*this); - --*this; - return Result; - } - - ////////////////////////////////////// - // Boolean operators - - template <typename T, precision P> - GLM_FUNC_QUALIFIER bool operator==(tmat4x3<T, P> const & m1, tmat4x3<T, P> const & m2) - { - return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]) && (m1[3] == m2[3]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER bool operator!=(tmat4x3<T, P> const & m1, tmat4x3<T, P> const & m2) - { - return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]) || (m1[3] != m2[3]); - } -} //namespace glm diff --git a/extensions/common/glm/detail/type_mat4x4.hpp b/extensions/common/glm/detail/type_mat4x4.hpp deleted file mode 100644 index 5cab33289a9..00000000000 --- a/extensions/common/glm/detail/type_mat4x4.hpp +++ /dev/null @@ -1,235 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/type_mat4x4.hpp -/// @date 2005-01-27 / 2011-06-15 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "../fwd.hpp" -#include "type_vec4.hpp" -#include "type_mat.hpp" -#include <limits> -#include <cstddef> - -namespace glm -{ - template <typename T, precision P = defaultp> - struct tmat4x4 - { - typedef tvec4<T, P> col_type; - typedef tvec4<T, P> row_type; - typedef tmat4x4<T, P> type; - typedef tmat4x4<T, P> transpose_type; - typedef T value_type; - - template <typename U, precision Q> - friend tvec4<U, Q> operator/(tmat4x4<U, Q> const & m, tvec4<U, Q> const & v); - template <typename U, precision Q> - friend tvec4<U, Q> operator/(tvec4<U, Q> const & v, tmat4x4<U, Q> const & m); - - private: - /// @cond DETAIL - col_type value[4]; - /// @endcond - - public: - // Constructors - GLM_FUNC_DECL tmat4x4(); - GLM_FUNC_DECL tmat4x4(tmat4x4<T, P> const & m); - template <precision Q> - GLM_FUNC_DECL tmat4x4(tmat4x4<T, Q> const & m); - - GLM_FUNC_DECL explicit tmat4x4(ctor); - GLM_FUNC_DECL explicit tmat4x4(T const & x); - GLM_FUNC_DECL tmat4x4( - T const & x0, T const & y0, T const & z0, T const & w0, - T const & x1, T const & y1, T const & z1, T const & w1, - T const & x2, T const & y2, T const & z2, T const & w2, - T const & x3, T const & y3, T const & z3, T const & w3); - GLM_FUNC_DECL tmat4x4( - col_type const & v0, - col_type const & v1, - col_type const & v2, - col_type const & v3); - - ////////////////////////////////////// - // Conversions - - template < - typename X1, typename Y1, typename Z1, typename W1, - typename X2, typename Y2, typename Z2, typename W2, - typename X3, typename Y3, typename Z3, typename W3, - typename X4, typename Y4, typename Z4, typename W4> - GLM_FUNC_DECL tmat4x4( - X1 const & x1, Y1 const & y1, Z1 const & z1, W1 const & w1, - X2 const & x2, Y2 const & y2, Z2 const & z2, W2 const & w2, - X3 const & x3, Y3 const & y3, Z3 const & z3, W3 const & w3, - X4 const & x4, Y4 const & y4, Z4 const & z4, W4 const & w4); - - template <typename V1, typename V2, typename V3, typename V4> - GLM_FUNC_DECL tmat4x4( - tvec4<V1, P> const & v1, - tvec4<V2, P> const & v2, - tvec4<V3, P> const & v3, - tvec4<V4, P> const & v4); - - ////////////////////////////////////// - // Matrix conversions - -# ifdef GLM_FORCE_EXPLICIT_CTOR - template <typename U, precision Q> - GLM_FUNC_DECL explicit tmat4x4(tmat4x4<U, Q> const & m); -# else - template <typename U, precision Q> - GLM_FUNC_DECL tmat4x4(tmat4x4<U, Q> const & m); -# endif - - GLM_FUNC_DECL explicit tmat4x4(tmat2x2<T, P> const & x); - GLM_FUNC_DECL explicit tmat4x4(tmat3x3<T, P> const & x); - GLM_FUNC_DECL explicit tmat4x4(tmat2x3<T, P> const & x); - GLM_FUNC_DECL explicit tmat4x4(tmat3x2<T, P> const & x); - GLM_FUNC_DECL explicit tmat4x4(tmat2x4<T, P> const & x); - GLM_FUNC_DECL explicit tmat4x4(tmat4x2<T, P> const & x); - GLM_FUNC_DECL explicit tmat4x4(tmat3x4<T, P> const & x); - GLM_FUNC_DECL explicit tmat4x4(tmat4x3<T, P> const & x); - - ////////////////////////////////////// - // Accesses - -# ifdef GLM_FORCE_SIZE_FUNC - typedef size_t size_type; - GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const; - - GLM_FUNC_DECL col_type & operator[](size_type i); - GLM_FUNC_DECL col_type const & operator[](size_type i) const; -# else - typedef length_t length_type; - GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const; - - GLM_FUNC_DECL col_type & operator[](length_type i); - GLM_FUNC_DECL col_type const & operator[](length_type i) const; -# endif//GLM_FORCE_SIZE_FUNC - - ////////////////////////////////////// - // Unary arithmetic operators - - GLM_FUNC_DECL tmat4x4<T, P> & operator=(tmat4x4<T, P> const & m); - - template <typename U> - GLM_FUNC_DECL tmat4x4<T, P> & operator=(tmat4x4<U, P> const & m); - template <typename U> - GLM_FUNC_DECL tmat4x4<T, P> & operator+=(U s); - template <typename U> - GLM_FUNC_DECL tmat4x4<T, P> & operator+=(tmat4x4<U, P> const & m); - template <typename U> - GLM_FUNC_DECL tmat4x4<T, P> & operator-=(U s); - template <typename U> - GLM_FUNC_DECL tmat4x4<T, P> & operator-=(tmat4x4<U, P> const & m); - template <typename U> - GLM_FUNC_DECL tmat4x4<T, P> & operator*=(U s); - template <typename U> - GLM_FUNC_DECL tmat4x4<T, P> & operator*=(tmat4x4<U, P> const & m); - template <typename U> - GLM_FUNC_DECL tmat4x4<T, P> & operator/=(U s); - template <typename U> - GLM_FUNC_DECL tmat4x4<T, P> & operator/=(tmat4x4<U, P> const & m); - - ////////////////////////////////////// - // Increment and decrement operators - - GLM_FUNC_DECL tmat4x4<T, P> & operator++(); - GLM_FUNC_DECL tmat4x4<T, P> & operator--(); - GLM_FUNC_DECL tmat4x4<T, P> operator++(int); - GLM_FUNC_DECL tmat4x4<T, P> operator--(int); - }; - - // Binary operators - template <typename T, precision P> - GLM_FUNC_DECL tmat4x4<T, P> operator+(tmat4x4<T, P> const & m, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tmat4x4<T, P> operator+(T const & s, tmat4x4<T, P> const & m); - - template <typename T, precision P> - GLM_FUNC_DECL tmat4x4<T, P> operator+(tmat4x4<T, P> const & m1, tmat4x4<T, P> const & m2); - - template <typename T, precision P> - GLM_FUNC_DECL tmat4x4<T, P> operator-(tmat4x4<T, P> const & m, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tmat4x4<T, P> operator-(T const & s, tmat4x4<T, P> const & m); - - template <typename T, precision P> - GLM_FUNC_DECL tmat4x4<T, P> operator-(tmat4x4<T, P> const & m1, tmat4x4<T, P> const & m2); - - template <typename T, precision P> - GLM_FUNC_DECL tmat4x4<T, P> operator*(tmat4x4<T, P> const & m, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tmat4x4<T, P> operator*(T const & s, tmat4x4<T, P> const & m); - - template <typename T, precision P> - GLM_FUNC_DECL typename tmat4x4<T, P>::col_type operator*(tmat4x4<T, P> const & m, typename tmat4x4<T, P>::row_type const & v); - - template <typename T, precision P> - GLM_FUNC_DECL typename tmat4x4<T, P>::row_type operator*(typename tmat4x4<T, P>::col_type const & v, tmat4x4<T, P> const & m); - - template <typename T, precision P> - GLM_FUNC_DECL tmat2x4<T, P> operator*(tmat4x4<T, P> const & m1, tmat2x4<T, P> const & m2); - - template <typename T, precision P> - GLM_FUNC_DECL tmat3x4<T, P> operator*(tmat4x4<T, P> const & m1, tmat3x4<T, P> const & m2); - - template <typename T, precision P> - GLM_FUNC_DECL tmat4x4<T, P> operator*(tmat4x4<T, P> const & m1, tmat4x4<T, P> const & m2); - - template <typename T, precision P> - GLM_FUNC_DECL tmat4x4<T, P> operator/(tmat4x4<T, P> const & m, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tmat4x4<T, P> operator/(T const & s, tmat4x4<T, P> const & m); - - template <typename T, precision P> - GLM_FUNC_DECL typename tmat4x4<T, P>::col_type operator/(tmat4x4<T, P> const & m, typename tmat4x4<T, P>::row_type const & v); - - template <typename T, precision P> - GLM_FUNC_DECL typename tmat4x4<T, P>::row_type operator/(typename tmat4x4<T, P>::col_type & v, tmat4x4<T, P> const & m); - - template <typename T, precision P> - GLM_FUNC_DECL tmat4x4<T, P> operator/(tmat4x4<T, P> const & m1, tmat4x4<T, P> const & m2); - - // Unary constant operators - template <typename T, precision P> - GLM_FUNC_DECL tmat4x4<T, P> const operator-(tmat4x4<T, P> const & m); -}//namespace glm - -#ifndef GLM_EXTERNAL_TEMPLATE -#include "type_mat4x4.inl" -#endif//GLM_EXTERNAL_TEMPLATE diff --git a/extensions/common/glm/detail/type_mat4x4.inl b/extensions/common/glm/detail/type_mat4x4.inl deleted file mode 100644 index 103be5b659e..00000000000 --- a/extensions/common/glm/detail/type_mat4x4.inl +++ /dev/null @@ -1,790 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/type_mat4x4.inl -/// @date 2005-01-27 / 2011-06-15 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -namespace glm{ -namespace detail -{ - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P> compute_inverse(tmat4x4<T, P> const & m) - { - T Coef00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; - T Coef02 = m[1][2] * m[3][3] - m[3][2] * m[1][3]; - T Coef03 = m[1][2] * m[2][3] - m[2][2] * m[1][3]; - - T Coef04 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; - T Coef06 = m[1][1] * m[3][3] - m[3][1] * m[1][3]; - T Coef07 = m[1][1] * m[2][3] - m[2][1] * m[1][3]; - - T Coef08 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; - T Coef10 = m[1][1] * m[3][2] - m[3][1] * m[1][2]; - T Coef11 = m[1][1] * m[2][2] - m[2][1] * m[1][2]; - - T Coef12 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; - T Coef14 = m[1][0] * m[3][3] - m[3][0] * m[1][3]; - T Coef15 = m[1][0] * m[2][3] - m[2][0] * m[1][3]; - - T Coef16 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; - T Coef18 = m[1][0] * m[3][2] - m[3][0] * m[1][2]; - T Coef19 = m[1][0] * m[2][2] - m[2][0] * m[1][2]; - - T Coef20 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; - T Coef22 = m[1][0] * m[3][1] - m[3][0] * m[1][1]; - T Coef23 = m[1][0] * m[2][1] - m[2][0] * m[1][1]; - - tvec4<T, P> Fac0(Coef00, Coef00, Coef02, Coef03); - tvec4<T, P> Fac1(Coef04, Coef04, Coef06, Coef07); - tvec4<T, P> Fac2(Coef08, Coef08, Coef10, Coef11); - tvec4<T, P> Fac3(Coef12, Coef12, Coef14, Coef15); - tvec4<T, P> Fac4(Coef16, Coef16, Coef18, Coef19); - tvec4<T, P> Fac5(Coef20, Coef20, Coef22, Coef23); - - tvec4<T, P> Vec0(m[1][0], m[0][0], m[0][0], m[0][0]); - tvec4<T, P> Vec1(m[1][1], m[0][1], m[0][1], m[0][1]); - tvec4<T, P> Vec2(m[1][2], m[0][2], m[0][2], m[0][2]); - tvec4<T, P> Vec3(m[1][3], m[0][3], m[0][3], m[0][3]); - - tvec4<T, P> Inv0(Vec1 * Fac0 - Vec2 * Fac1 + Vec3 * Fac2); - tvec4<T, P> Inv1(Vec0 * Fac0 - Vec2 * Fac3 + Vec3 * Fac4); - tvec4<T, P> Inv2(Vec0 * Fac1 - Vec1 * Fac3 + Vec3 * Fac5); - tvec4<T, P> Inv3(Vec0 * Fac2 - Vec1 * Fac4 + Vec2 * Fac5); - - tvec4<T, P> SignA(+1, -1, +1, -1); - tvec4<T, P> SignB(-1, +1, -1, +1); - tmat4x4<T, P> Inverse(Inv0 * SignA, Inv1 * SignB, Inv2 * SignA, Inv3 * SignB); - - tvec4<T, P> Row0(Inverse[0][0], Inverse[1][0], Inverse[2][0], Inverse[3][0]); - - tvec4<T, P> Dot0(m[0] * Row0); - T Dot1 = (Dot0.x + Dot0.y) + (Dot0.z + Dot0.w); - - T OneOverDeterminant = static_cast<T>(1) / Dot1; - - return Inverse * OneOverDeterminant; - } -}//namespace detail - - ////////////////////////////////////////////////////////////// - // Constructors - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4() - { -# ifndef GLM_FORCE_NO_CTOR_INIT - this->value[0] = col_type(1, 0, 0, 0); - this->value[1] = col_type(0, 1, 0, 0); - this->value[2] = col_type(0, 0, 1, 0); - this->value[3] = col_type(0, 0, 0, 1); -# endif - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4(tmat4x4<T, P> const & m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - this->value[3] = m[3]; - } - - template <typename T, precision P> - template <precision Q> - GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4(tmat4x4<T, Q> const & m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - this->value[3] = m[3]; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4(ctor) - {} - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4(T const & s) - { - this->value[0] = col_type(s, 0, 0, 0); - this->value[1] = col_type(0, s, 0, 0); - this->value[2] = col_type(0, 0, s, 0); - this->value[3] = col_type(0, 0, 0, s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4 - ( - T const & x0, T const & y0, T const & z0, T const & w0, - T const & x1, T const & y1, T const & z1, T const & w1, - T const & x2, T const & y2, T const & z2, T const & w2, - T const & x3, T const & y3, T const & z3, T const & w3 - ) - { - this->value[0] = col_type(x0, y0, z0, w0); - this->value[1] = col_type(x1, y1, z1, w1); - this->value[2] = col_type(x2, y2, z2, w2); - this->value[3] = col_type(x3, y3, z3, w3); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4 - ( - col_type const & v0, - col_type const & v1, - col_type const & v2, - col_type const & v3 - ) - { - this->value[0] = v0; - this->value[1] = v1; - this->value[2] = v2; - this->value[3] = v3; - } - - template <typename T, precision P> - template <typename U, precision Q> - GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4 - ( - tmat4x4<U, Q> const & m - ) - { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); - this->value[3] = col_type(m[3]); - } - - ////////////////////////////////////// - // Conversion constructors - template <typename T, precision P> - template < - typename X1, typename Y1, typename Z1, typename W1, - typename X2, typename Y2, typename Z2, typename W2, - typename X3, typename Y3, typename Z3, typename W3, - typename X4, typename Y4, typename Z4, typename W4> - GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4 - ( - X1 const & x1, Y1 const & y1, Z1 const & z1, W1 const & w1, - X2 const & x2, Y2 const & y2, Z2 const & z2, W2 const & w2, - X3 const & x3, Y3 const & y3, Z3 const & z3, W3 const & w3, - X4 const & x4, Y4 const & y4, Z4 const & z4, W4 const & w4 - ) - { - GLM_STATIC_ASSERT(std::numeric_limits<X1>::is_iec559 || std::numeric_limits<X1>::is_integer, "*mat4x4 constructor only takes float and integer types, 1st parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits<Y1>::is_iec559 || std::numeric_limits<Y1>::is_integer, "*mat4x4 constructor only takes float and integer types, 2nd parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits<Z1>::is_iec559 || std::numeric_limits<Z1>::is_integer, "*mat4x4 constructor only takes float and integer types, 3rd parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits<W1>::is_iec559 || std::numeric_limits<W1>::is_integer, "*mat4x4 constructor only takes float and integer types, 4th parameter type invalid."); - - GLM_STATIC_ASSERT(std::numeric_limits<X2>::is_iec559 || std::numeric_limits<X2>::is_integer, "*mat4x4 constructor only takes float and integer types, 5th parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits<Y2>::is_iec559 || std::numeric_limits<Y2>::is_integer, "*mat4x4 constructor only takes float and integer types, 6th parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits<Z2>::is_iec559 || std::numeric_limits<Z2>::is_integer, "*mat4x4 constructor only takes float and integer types, 7th parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits<W2>::is_iec559 || std::numeric_limits<W2>::is_integer, "*mat4x4 constructor only takes float and integer types, 8th parameter type invalid."); - - GLM_STATIC_ASSERT(std::numeric_limits<X3>::is_iec559 || std::numeric_limits<X3>::is_integer, "*mat4x4 constructor only takes float and integer types, 9th parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits<Y3>::is_iec559 || std::numeric_limits<Y3>::is_integer, "*mat4x4 constructor only takes float and integer types, 10th parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits<Z3>::is_iec559 || std::numeric_limits<Z3>::is_integer, "*mat4x4 constructor only takes float and integer types, 11th parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits<W3>::is_iec559 || std::numeric_limits<W3>::is_integer, "*mat4x4 constructor only takes float and integer types, 12th parameter type invalid."); - - GLM_STATIC_ASSERT(std::numeric_limits<X4>::is_iec559 || std::numeric_limits<X4>::is_integer, "*mat4x4 constructor only takes float and integer types, 13th parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits<Y4>::is_iec559 || std::numeric_limits<Y4>::is_integer, "*mat4x4 constructor only takes float and integer types, 14th parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits<Z4>::is_iec559 || std::numeric_limits<Z4>::is_integer, "*mat4x4 constructor only takes float and integer types, 15th parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits<W4>::is_iec559 || std::numeric_limits<W4>::is_integer, "*mat4x4 constructor only takes float and integer types, 16th parameter type invalid."); - - this->value[0] = col_type(static_cast<T>(x1), value_type(y1), value_type(z1), value_type(w1)); - this->value[1] = col_type(static_cast<T>(x2), value_type(y2), value_type(z2), value_type(w2)); - this->value[2] = col_type(static_cast<T>(x3), value_type(y3), value_type(z3), value_type(w3)); - this->value[3] = col_type(static_cast<T>(x4), value_type(y4), value_type(z4), value_type(w4)); - } - - template <typename T, precision P> - template <typename V1, typename V2, typename V3, typename V4> - GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4 - ( - tvec4<V1, P> const & v1, - tvec4<V2, P> const & v2, - tvec4<V3, P> const & v3, - tvec4<V4, P> const & v4 - ) - { - GLM_STATIC_ASSERT(std::numeric_limits<V1>::is_iec559 || std::numeric_limits<V1>::is_integer, "*mat4x4 constructor only takes float and integer types, 1st parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits<V2>::is_iec559 || std::numeric_limits<V2>::is_integer, "*mat4x4 constructor only takes float and integer types, 2nd parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits<V3>::is_iec559 || std::numeric_limits<V3>::is_integer, "*mat4x4 constructor only takes float and integer types, 3rd parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits<V4>::is_iec559 || std::numeric_limits<V4>::is_integer, "*mat4x4 constructor only takes float and integer types, 4th parameter type invalid."); - - this->value[0] = col_type(v1); - this->value[1] = col_type(v2); - this->value[2] = col_type(v3); - this->value[3] = col_type(v4); - } - - ////////////////////////////////////// - // Matrix convertion constructors - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4(tmat2x2<T, P> const & m) - { - this->value[0] = col_type(m[0], 0, 0); - this->value[1] = col_type(m[1], 0, 0); - this->value[2] = col_type(0); - this->value[3] = col_type(0, 0, 0, 1); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4(tmat3x3<T, P> const & m) - { - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); - this->value[2] = col_type(m[2], 0); - this->value[3] = col_type(0, 0, 0, 1); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4(tmat2x3<T, P> const & m) - { - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); - this->value[2] = col_type(0); - this->value[3] = col_type(0, 0, 0, 1); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4(tmat3x2<T, P> const & m) - { - this->value[0] = col_type(m[0], 0, 0); - this->value[1] = col_type(m[1], 0, 0); - this->value[2] = col_type(m[2], 0, 0); - this->value[3] = col_type(0, 0, 0, 1); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4(tmat2x4<T, P> const & m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = col_type(0); - this->value[3] = col_type(0, 0, 0, 1); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4(tmat4x2<T, P> const & m) - { - this->value[0] = col_type(m[0], 0, 0); - this->value[1] = col_type(m[1], 0, 0); - this->value[2] = col_type(0); - this->value[3] = col_type(0, 0, 0, 1); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4(tmat3x4<T, P> const & m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - this->value[3] = col_type(0, 0, 0, 1); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4(tmat4x3<T, P> const & m) - { - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); - this->value[2] = col_type(m[2], 0); - this->value[3] = col_type(m[3], 1); - } - - ////////////////////////////////////// - // Accesses - -# ifdef GLM_FORCE_SIZE_FUNC - template <typename T, precision P> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat4x4<T, P>::size_type tmat4x4<T, P>::size() const - { - return 4; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tmat4x4<T, P>::col_type & tmat4x4<T, P>::operator[](typename tmat4x4<T, P>::size_type i) - { - assert(i < this->size()); - return this->value[i]; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tmat4x4<T, P>::col_type const & tmat4x4<T, P>::operator[](typename tmat4x4<T, P>::size_type i) const - { - assert(i < this->size()); - return this->value[i]; - } -# else - template <typename T, precision P> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat4x4<T, P>::length_type tmat4x4<T, P>::length() const - { - return 4; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tmat4x4<T, P>::col_type & tmat4x4<T, P>::operator[](typename tmat4x4<T, P>::length_type i) - { - assert(i < this->length()); - return this->value[i]; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tmat4x4<T, P>::col_type const & tmat4x4<T, P>::operator[](typename tmat4x4<T, P>::length_type i) const - { - assert(i < this->length()); - return this->value[i]; - } -# endif//GLM_FORCE_SIZE_FUNC - - ////////////////////////////////////////////////////////////// - // Operators - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P>& tmat4x4<T, P>::operator=(tmat4x4<T, P> const & m) - { - //memcpy could be faster - //memcpy(&this->value, &m.value, 16 * sizeof(valType)); - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - this->value[3] = m[3]; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat4x4<T, P>& tmat4x4<T, P>::operator=(tmat4x4<U, P> const & m) - { - //memcpy could be faster - //memcpy(&this->value, &m.value, 16 * sizeof(valType)); - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - this->value[3] = m[3]; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat4x4<T, P>& tmat4x4<T, P>::operator+=(U s) - { - this->value[0] += s; - this->value[1] += s; - this->value[2] += s; - this->value[3] += s; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat4x4<T, P>& tmat4x4<T, P>::operator+=(tmat4x4<U, P> const & m) - { - this->value[0] += m[0]; - this->value[1] += m[1]; - this->value[2] += m[2]; - this->value[3] += m[3]; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat4x4<T, P> & tmat4x4<T, P>::operator-=(U s) - { - this->value[0] -= s; - this->value[1] -= s; - this->value[2] -= s; - this->value[3] -= s; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat4x4<T, P> & tmat4x4<T, P>::operator-=(tmat4x4<U, P> const & m) - { - this->value[0] -= m[0]; - this->value[1] -= m[1]; - this->value[2] -= m[2]; - this->value[3] -= m[3]; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat4x4<T, P> & tmat4x4<T, P>::operator*=(U s) - { - this->value[0] *= s; - this->value[1] *= s; - this->value[2] *= s; - this->value[3] *= s; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat4x4<T, P> & tmat4x4<T, P>::operator*=(tmat4x4<U, P> const & m) - { - return (*this = *this * m); - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat4x4<T, P> & tmat4x4<T, P>::operator/=(U s) - { - this->value[0] /= s; - this->value[1] /= s; - this->value[2] /= s; - this->value[3] /= s; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tmat4x4<T, P> & tmat4x4<T, P>::operator/=(tmat4x4<U, P> const & m) - { - return (*this = *this * detail::compute_inverse<T, P>(m)); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P> & tmat4x4<T, P>::operator++() - { - ++this->value[0]; - ++this->value[1]; - ++this->value[2]; - ++this->value[3]; - return *this; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P> & tmat4x4<T, P>::operator--() - { - --this->value[0]; - --this->value[1]; - --this->value[2]; - --this->value[3]; - return *this; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P> tmat4x4<T, P>::operator++(int) - { - tmat4x4<T, P> Result(*this); - ++*this; - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P> tmat4x4<T, P>::operator--(int) - { - tmat4x4<T, P> Result(*this); - --*this; - return Result; - } - - // Binary operators - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P> operator+(tmat4x4<T, P> const & m, T const & s) - { - return tmat4x4<T, P>( - m[0] + s, - m[1] + s, - m[2] + s, - m[3] + s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P> operator+(T const & s, tmat4x4<T, P> const & m) - { - return tmat4x4<T, P>( - m[0] + s, - m[1] + s, - m[2] + s, - m[3] + s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P> operator+(tmat4x4<T, P> const & m1, tmat4x4<T, P> const & m2) - { - return tmat4x4<T, P>( - m1[0] + m2[0], - m1[1] + m2[1], - m1[2] + m2[2], - m1[3] + m2[3]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P> operator-(tmat4x4<T, P> const & m, T const & s) - { - return tmat4x4<T, P>( - m[0] - s, - m[1] - s, - m[2] - s, - m[3] - s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P> operator-(T const & s, tmat4x4<T, P> const & m) - { - return tmat4x4<T, P>( - s - m[0], - s - m[1], - s - m[2], - s - m[3]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P> operator-(tmat4x4<T, P> const & m1, tmat4x4<T, P> const & m2) - { - return tmat4x4<T, P>( - m1[0] - m2[0], - m1[1] - m2[1], - m1[2] - m2[2], - m1[3] - m2[3]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P> operator*(tmat4x4<T, P> const & m, T const & s) - { - return tmat4x4<T, P>( - m[0] * s, - m[1] * s, - m[2] * s, - m[3] * s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P> operator*(T const & s, tmat4x4<T, P> const & m) - { - return tmat4x4<T, P>( - m[0] * s, - m[1] * s, - m[2] * s, - m[3] * s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tmat4x4<T, P>::col_type operator* - ( - tmat4x4<T, P> const & m, - typename tmat4x4<T, P>::row_type const & v - ) - { -/* - __m128 v0 = _mm_shuffle_ps(v.data, v.data, _MM_SHUFFLE(0, 0, 0, 0)); - __m128 v1 = _mm_shuffle_ps(v.data, v.data, _MM_SHUFFLE(1, 1, 1, 1)); - __m128 v2 = _mm_shuffle_ps(v.data, v.data, _MM_SHUFFLE(2, 2, 2, 2)); - __m128 v3 = _mm_shuffle_ps(v.data, v.data, _MM_SHUFFLE(3, 3, 3, 3)); - - __m128 m0 = _mm_mul_ps(m[0].data, v0); - __m128 m1 = _mm_mul_ps(m[1].data, v1); - __m128 a0 = _mm_add_ps(m0, m1); - - __m128 m2 = _mm_mul_ps(m[2].data, v2); - __m128 m3 = _mm_mul_ps(m[3].data, v3); - __m128 a1 = _mm_add_ps(m2, m3); - - __m128 a2 = _mm_add_ps(a0, a1); - - return typename tmat4x4<T, P>::col_type(a2); -*/ - - typename tmat4x4<T, P>::col_type const Mov0(v[0]); - typename tmat4x4<T, P>::col_type const Mov1(v[1]); - typename tmat4x4<T, P>::col_type const Mul0 = m[0] * Mov0; - typename tmat4x4<T, P>::col_type const Mul1 = m[1] * Mov1; - typename tmat4x4<T, P>::col_type const Add0 = Mul0 + Mul1; - typename tmat4x4<T, P>::col_type const Mov2(v[2]); - typename tmat4x4<T, P>::col_type const Mov3(v[3]); - typename tmat4x4<T, P>::col_type const Mul2 = m[2] * Mov2; - typename tmat4x4<T, P>::col_type const Mul3 = m[3] * Mov3; - typename tmat4x4<T, P>::col_type const Add1 = Mul2 + Mul3; - typename tmat4x4<T, P>::col_type const Add2 = Add0 + Add1; - return Add2; - -/* - return typename tmat4x4<T, P>::col_type( - m[0][0] * v[0] + m[1][0] * v[1] + m[2][0] * v[2] + m[3][0] * v[3], - m[0][1] * v[0] + m[1][1] * v[1] + m[2][1] * v[2] + m[3][1] * v[3], - m[0][2] * v[0] + m[1][2] * v[1] + m[2][2] * v[2] + m[3][2] * v[3], - m[0][3] * v[0] + m[1][3] * v[1] + m[2][3] * v[2] + m[3][3] * v[3]); -*/ - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tmat4x4<T, P>::row_type operator* - ( - typename tmat4x4<T, P>::col_type const & v, - tmat4x4<T, P> const & m - ) - { - return typename tmat4x4<T, P>::row_type( - m[0][0] * v[0] + m[0][1] * v[1] + m[0][2] * v[2] + m[0][3] * v[3], - m[1][0] * v[0] + m[1][1] * v[1] + m[1][2] * v[2] + m[1][3] * v[3], - m[2][0] * v[0] + m[2][1] * v[1] + m[2][2] * v[2] + m[2][3] * v[3], - m[3][0] * v[0] + m[3][1] * v[1] + m[3][2] * v[2] + m[3][3] * v[3]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x4<T, P> operator*(tmat4x4<T, P> const & m1, tmat2x4<T, P> const & m2) - { - return tmat2x4<T, P>( - m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3], - m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2] + m1[3][1] * m2[0][3], - m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2] + m1[3][2] * m2[0][3], - m1[0][3] * m2[0][0] + m1[1][3] * m2[0][1] + m1[2][3] * m2[0][2] + m1[3][3] * m2[0][3], - m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2] + m1[3][0] * m2[1][3], - m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2] + m1[3][1] * m2[1][3], - m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1] + m1[2][2] * m2[1][2] + m1[3][2] * m2[1][3], - m1[0][3] * m2[1][0] + m1[1][3] * m2[1][1] + m1[2][3] * m2[1][2] + m1[3][3] * m2[1][3]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x4<T, P> operator*(tmat4x4<T, P> const & m1, tmat3x4<T, P> const & m2) - { - return tmat3x4<T, P>( - m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3], - m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2] + m1[3][1] * m2[0][3], - m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2] + m1[3][2] * m2[0][3], - m1[0][3] * m2[0][0] + m1[1][3] * m2[0][1] + m1[2][3] * m2[0][2] + m1[3][3] * m2[0][3], - m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2] + m1[3][0] * m2[1][3], - m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2] + m1[3][1] * m2[1][3], - m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1] + m1[2][2] * m2[1][2] + m1[3][2] * m2[1][3], - m1[0][3] * m2[1][0] + m1[1][3] * m2[1][1] + m1[2][3] * m2[1][2] + m1[3][3] * m2[1][3], - m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1] + m1[2][0] * m2[2][2] + m1[3][0] * m2[2][3], - m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1] + m1[2][1] * m2[2][2] + m1[3][1] * m2[2][3], - m1[0][2] * m2[2][0] + m1[1][2] * m2[2][1] + m1[2][2] * m2[2][2] + m1[3][2] * m2[2][3], - m1[0][3] * m2[2][0] + m1[1][3] * m2[2][1] + m1[2][3] * m2[2][2] + m1[3][3] * m2[2][3]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P> operator*(tmat4x4<T, P> const & m1, tmat4x4<T, P> const & m2) - { - typename tmat4x4<T, P>::col_type const SrcA0 = m1[0]; - typename tmat4x4<T, P>::col_type const SrcA1 = m1[1]; - typename tmat4x4<T, P>::col_type const SrcA2 = m1[2]; - typename tmat4x4<T, P>::col_type const SrcA3 = m1[3]; - - typename tmat4x4<T, P>::col_type const SrcB0 = m2[0]; - typename tmat4x4<T, P>::col_type const SrcB1 = m2[1]; - typename tmat4x4<T, P>::col_type const SrcB2 = m2[2]; - typename tmat4x4<T, P>::col_type const SrcB3 = m2[3]; - - tmat4x4<T, P> Result(uninitialize); - Result[0] = SrcA0 * SrcB0[0] + SrcA1 * SrcB0[1] + SrcA2 * SrcB0[2] + SrcA3 * SrcB0[3]; - Result[1] = SrcA0 * SrcB1[0] + SrcA1 * SrcB1[1] + SrcA2 * SrcB1[2] + SrcA3 * SrcB1[3]; - Result[2] = SrcA0 * SrcB2[0] + SrcA1 * SrcB2[1] + SrcA2 * SrcB2[2] + SrcA3 * SrcB2[3]; - Result[3] = SrcA0 * SrcB3[0] + SrcA1 * SrcB3[1] + SrcA2 * SrcB3[2] + SrcA3 * SrcB3[3]; - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P> operator/(tmat4x4<T, P> const & m, T const & s) - { - return tmat4x4<T, P>( - m[0] / s, - m[1] / s, - m[2] / s, - m[3] / s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P> operator/(T const & s, tmat4x4<T, P> const & m) - { - return tmat4x4<T, P>( - s / m[0], - s / m[1], - s / m[2], - s / m[3]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tmat4x4<T, P>::col_type operator/(tmat4x4<T, P> const & m, typename tmat4x4<T, P>::row_type const & v) - { - return detail::compute_inverse<T, P>(m) * v; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tmat4x4<T, P>::row_type operator/(typename tmat4x4<T, P>::col_type const & v, tmat4x4<T, P> const & m) - { - return v * detail::compute_inverse<T, P>(m); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P> operator/(tmat4x4<T, P> const & m1, tmat4x4<T, P> const & m2) - { - tmat4x4<T, P> m1_copy(m1); - return m1_copy /= m2; - } - - // Unary constant operators - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P> const operator-(tmat4x4<T, P> const & m) - { - return tmat4x4<T, P>( - -m[0], - -m[1], - -m[2], - -m[3]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P> const operator++(tmat4x4<T, P> const & m, int) - { - return tmat4x4<T, P>( - m[0] + static_cast<T>(1), - m[1] + static_cast<T>(1), - m[2] + static_cast<T>(1), - m[3] + static_cast<T>(1)); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P> const operator--(tmat4x4<T, P> const & m, int) - { - return tmat4x4<T, P>( - m[0] - static_cast<T>(1), - m[1] - static_cast<T>(1), - m[2] - static_cast<T>(1), - m[3] - static_cast<T>(1)); - } - - ////////////////////////////////////// - // Boolean operators - - template <typename T, precision P> - GLM_FUNC_QUALIFIER bool operator==(tmat4x4<T, P> const & m1, tmat4x4<T, P> const & m2) - { - return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]) && (m1[3] == m2[3]); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER bool operator!=(tmat4x4<T, P> const & m1, tmat4x4<T, P> const & m2) - { - return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]) || (m1[3] != m2[3]); - } -}//namespace glm diff --git a/extensions/common/glm/detail/type_vec.hpp b/extensions/common/glm/detail/type_vec.hpp deleted file mode 100644 index 5cbb589ec37..00000000000 --- a/extensions/common/glm/detail/type_vec.hpp +++ /dev/null @@ -1,518 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/type_vec.hpp -/// @date 2010-01-26 / 2014-10-05 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "precision.hpp" -#include "type_int.hpp" - -namespace glm -{ - template <typename T, precision P> struct tvec1; - template <typename T, precision P> struct tvec2; - template <typename T, precision P> struct tvec3; - template <typename T, precision P> struct tvec4; - - typedef tvec1<float, highp> highp_vec1_t; - typedef tvec1<float, mediump> mediump_vec1_t; - typedef tvec1<float, lowp> lowp_vec1_t; - typedef tvec1<double, highp> highp_dvec1_t; - typedef tvec1<double, mediump> mediump_dvec1_t; - typedef tvec1<double, lowp> lowp_dvec1_t; - typedef tvec1<int, highp> highp_ivec1_t; - typedef tvec1<int, mediump> mediump_ivec1_t; - typedef tvec1<int, lowp> lowp_ivec1_t; - typedef tvec1<uint, highp> highp_uvec1_t; - typedef tvec1<uint, mediump> mediump_uvec1_t; - typedef tvec1<uint, lowp> lowp_uvec1_t; - typedef tvec1<bool, highp> highp_bvec1_t; - typedef tvec1<bool, mediump> mediump_bvec1_t; - typedef tvec1<bool, lowp> lowp_bvec1_t; - - /// @addtogroup core_precision - /// @{ - - /// 2 components vector of high single-precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tvec2<float, highp> highp_vec2; - - /// 2 components vector of medium single-precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tvec2<float, mediump> mediump_vec2; - - /// 2 components vector of low single-precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tvec2<float, lowp> lowp_vec2; - - /// 2 components vector of high double-precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tvec2<double, highp> highp_dvec2; - - /// 2 components vector of medium double-precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tvec2<double, mediump> mediump_dvec2; - - /// 2 components vector of low double-precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tvec2<double, lowp> lowp_dvec2; - - /// 2 components vector of high precision signed integer numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tvec2<int, highp> highp_ivec2; - - /// 2 components vector of medium precision signed integer numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tvec2<int, mediump> mediump_ivec2; - - /// 2 components vector of low precision signed integer numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tvec2<int, lowp> lowp_ivec2; - - /// 2 components vector of high precision unsigned integer numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tvec2<uint, highp> highp_uvec2; - - /// 2 components vector of medium precision unsigned integer numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tvec2<uint, mediump> mediump_uvec2; - - /// 2 components vector of low precision unsigned integer numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tvec2<uint, lowp> lowp_uvec2; - - /// 2 components vector of high precision bool numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tvec2<bool, highp> highp_bvec2; - - /// 2 components vector of medium precision bool numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tvec2<bool, mediump> mediump_bvec2; - - /// 2 components vector of low precision bool numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tvec2<bool, lowp> lowp_bvec2; - - /// @} - - - /// @addtogroup core_precision - /// @{ - - /// 3 components vector of high single-precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tvec3<float, highp> highp_vec3; - - /// 3 components vector of medium single-precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tvec3<float, mediump> mediump_vec3; - - /// 3 components vector of low single-precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tvec3<float, lowp> lowp_vec3; - - /// 3 components vector of high double-precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tvec3<double, highp> highp_dvec3; - - /// 3 components vector of medium double-precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tvec3<double, mediump> mediump_dvec3; - - /// 3 components vector of low double-precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tvec3<double, lowp> lowp_dvec3; - - /// 3 components vector of high precision signed integer numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tvec3<int, highp> highp_ivec3; - - /// 3 components vector of medium precision signed integer numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tvec3<int, mediump> mediump_ivec3; - - /// 3 components vector of low precision signed integer numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tvec3<int, lowp> lowp_ivec3; - - /// 3 components vector of high precision unsigned integer numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tvec3<uint, highp> highp_uvec3; - - /// 3 components vector of medium precision unsigned integer numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tvec3<uint, mediump> mediump_uvec3; - - /// 3 components vector of low precision unsigned integer numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tvec3<uint, lowp> lowp_uvec3; - - /// 3 components vector of high precision bool numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tvec3<bool, highp> highp_bvec3; - - /// 3 components vector of medium precision bool numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tvec3<bool, mediump> mediump_bvec3; - - /// 3 components vector of low precision bool numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tvec3<bool, lowp> lowp_bvec3; - - /// @} - - /// @addtogroup core_precision - /// @{ - - /// 4 components vector of high single-precision floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tvec4<float, highp> highp_vec4; - - /// 4 components vector of medium single-precision floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tvec4<float, mediump> mediump_vec4; - - /// 4 components vector of low single-precision floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tvec4<float, lowp> lowp_vec4; - - /// 4 components vector of high double-precision floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tvec4<double, highp> highp_dvec4; - - /// 4 components vector of medium double-precision floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tvec4<double, mediump> mediump_dvec4; - - /// 4 components vector of low double-precision floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tvec4<double, lowp> lowp_dvec4; - - /// 4 components vector of high precision signed integer numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tvec4<int, highp> highp_ivec4; - - /// 4 components vector of medium precision signed integer numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tvec4<int, mediump> mediump_ivec4; - - /// 4 components vector of low precision signed integer numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tvec4<int, lowp> lowp_ivec4; - - /// 4 components vector of high precision unsigned integer numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tvec4<uint, highp> highp_uvec4; - - /// 4 components vector of medium precision unsigned integer numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tvec4<uint, mediump> mediump_uvec4; - - /// 4 components vector of low precision unsigned integer numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tvec4<uint, lowp> lowp_uvec4; - - /// 4 components vector of high precision bool numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tvec4<bool, highp> highp_bvec4; - - /// 4 components vector of medium precision bool numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tvec4<bool, mediump> mediump_bvec4; - - /// 4 components vector of low precision bool numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tvec4<bool, lowp> lowp_bvec4; - - /// @} - - /// @addtogroup core_types - /// @{ - - ////////////////////////// - // Default float definition - -#if(defined(GLM_PRECISION_LOWP_FLOAT)) - typedef lowp_vec2 vec2; - typedef lowp_vec3 vec3; - typedef lowp_vec4 vec4; -#elif(defined(GLM_PRECISION_MEDIUMP_FLOAT)) - typedef mediump_vec2 vec2; - typedef mediump_vec3 vec3; - typedef mediump_vec4 vec4; -#else //defined(GLM_PRECISION_HIGHP_FLOAT) - /// 2 components vector of floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> - typedef highp_vec2 vec2; - - //! 3 components vector of floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> - typedef highp_vec3 vec3; - - //! 4 components vector of floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> - typedef highp_vec4 vec4; -#endif//GLM_PRECISION - - ////////////////////////// - // Default double definition - -#if(defined(GLM_PRECISION_LOWP_DOUBLE)) - typedef lowp_dvec2 dvec2; - typedef lowp_dvec3 dvec3; - typedef lowp_dvec4 dvec4; -#elif(defined(GLM_PRECISION_MEDIUMP_DOUBLE)) - typedef mediump_dvec2 dvec2; - typedef mediump_dvec3 dvec3; - typedef mediump_dvec4 dvec4; -#else //defined(GLM_PRECISION_HIGHP_DOUBLE) - /// 2 components vector of double-precision floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> - typedef highp_dvec2 dvec2; - - //! 3 components vector of double-precision floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> - typedef highp_dvec3 dvec3; - - //! 4 components vector of double-precision floating-point numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> - typedef highp_dvec4 dvec4; -#endif//GLM_PRECISION - - ////////////////////////// - // Signed integer definition - -#if(defined(GLM_PRECISION_LOWP_INT)) - typedef lowp_ivec2 ivec2; - typedef lowp_ivec3 ivec3; - typedef lowp_ivec4 ivec4; -#elif(defined(GLM_PRECISION_MEDIUMP_INT)) - typedef mediump_ivec2 ivec2; - typedef mediump_ivec3 ivec3; - typedef mediump_ivec4 ivec4; -#else //defined(GLM_PRECISION_HIGHP_INT) - //! 2 components vector of signed integer numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> - typedef highp_ivec2 ivec2; - - //! 3 components vector of signed integer numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> - typedef highp_ivec3 ivec3; - - //! 4 components vector of signed integer numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> - typedef highp_ivec4 ivec4; -#endif//GLM_PRECISION - - ////////////////////////// - // Unsigned integer definition - -#if(defined(GLM_PRECISION_LOWP_UINT)) - typedef lowp_uvec2 uvec2; - typedef lowp_uvec3 uvec3; - typedef lowp_uvec4 uvec4; -#elif(defined(GLM_PRECISION_MEDIUMP_UINT)) - typedef mediump_uvec2 uvec2; - typedef mediump_uvec3 uvec3; - typedef mediump_uvec4 uvec4; -#else //defined(GLM_PRECISION_HIGHP_UINT) - /// 2 components vector of unsigned integer numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> - typedef highp_uvec2 uvec2; - - /// 3 components vector of unsigned integer numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> - typedef highp_uvec3 uvec3; - - /// 4 components vector of unsigned integer numbers. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> - typedef highp_uvec4 uvec4; -#endif//GLM_PRECISION - - ////////////////////////// - // Boolean definition - -#if(defined(GLM_PRECISION_LOWP_BOOL)) - typedef lowp_bvec2 bvec2; - typedef lowp_bvec3 bvec3; - typedef lowp_bvec4 bvec4; -#elif(defined(GLM_PRECISION_MEDIUMP_BOOL)) - typedef mediump_bvec2 bvec2; - typedef mediump_bvec3 bvec3; - typedef mediump_bvec4 bvec4; -#else //defined(GLM_PRECISION_HIGHP_BOOL) - //! 2 components vector of boolean. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> - typedef highp_bvec2 bvec2; - - //! 3 components vector of boolean. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> - typedef highp_bvec3 bvec3; - - //! 4 components vector of boolean. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> - typedef highp_bvec4 bvec4; -#endif//GLM_PRECISION - - /// @} -}//namespace glm diff --git a/extensions/common/glm/detail/type_vec.inl b/extensions/common/glm/detail/type_vec.inl deleted file mode 100644 index 20219806534..00000000000 --- a/extensions/common/glm/detail/type_vec.inl +++ /dev/null @@ -1,31 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/type_vec.inl -/// @date 2011-06-15 / 2011-06-15 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// diff --git a/extensions/common/glm/detail/type_vec1.hpp b/extensions/common/glm/detail/type_vec1.hpp deleted file mode 100644 index e2b1dc689ad..00000000000 --- a/extensions/common/glm/detail/type_vec1.hpp +++ /dev/null @@ -1,322 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/type_vec1.hpp -/// @date 2008-08-25 / 2011-06-15 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "../fwd.hpp" -#include "type_vec.hpp" -#ifdef GLM_SWIZZLE -# if GLM_HAS_ANONYMOUS_UNION -# include "_swizzle.hpp" -# else -# include "_swizzle_func.hpp" -# endif -#endif //GLM_SWIZZLE -#include <cstddef> - -namespace glm -{ - template <typename T, precision P = defaultp> - struct tvec1 - { - ////////////////////////////////////// - // Implementation detail - - typedef tvec1<T, P> type; - typedef tvec1<bool, P> bool_type; - typedef T value_type; - - ////////////////////////////////////// - // Data - -# if GLM_HAS_ANONYMOUS_UNION - union - { - T x; - T r; - T s; -/* -# ifdef GLM_SWIZZLE - _GLM_SWIZZLE1_2_MEMBERS(T, P, tvec2, x) - _GLM_SWIZZLE1_2_MEMBERS(T, P, tvec2, r) - _GLM_SWIZZLE1_2_MEMBERS(T, P, tvec2, s) - _GLM_SWIZZLE1_3_MEMBERS(T, P, tvec3, x) - _GLM_SWIZZLE1_3_MEMBERS(T, P, tvec3, r) - _GLM_SWIZZLE1_3_MEMBERS(T, P, tvec3, s) - _GLM_SWIZZLE1_4_MEMBERS(T, P, tvec4, x) - _GLM_SWIZZLE1_4_MEMBERS(T, P, tvec4, r) - _GLM_SWIZZLE1_4_MEMBERS(T, P, tvec4, s) -# endif//GLM_SWIZZLE*/ - }; -# else - union {T x, r, s;}; -/* -# ifdef GLM_SWIZZLE - GLM_SWIZZLE_GEN_VEC_FROM_VEC1(T, P, tvec2, tvec2, tvec3, tvec4) -# endif//GLM_SWIZZLE*/ -# endif - - ////////////////////////////////////// - // Accesses - -# ifdef GLM_FORCE_SIZE_FUNC - /// Return the count of components of the vector - typedef size_t size_type; - GLM_FUNC_DECL GLM_CONSTEXPR size_type size() const; - - GLM_FUNC_DECL T & operator[](size_type i); - GLM_FUNC_DECL T const & operator[](size_type i) const; -# else - /// Return the count of components of the vector - typedef length_t length_type; - GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const; - - GLM_FUNC_DECL T & operator[](length_type i); - GLM_FUNC_DECL T const & operator[](length_type i) const; -# endif//GLM_FORCE_SIZE_FUNC - - ////////////////////////////////////// - // Implicit basic constructors - - GLM_FUNC_DECL tvec1(); - GLM_FUNC_DECL tvec1(tvec1<T, P> const & v); - template <precision Q> - GLM_FUNC_DECL tvec1(tvec1<T, Q> const & v); - - ////////////////////////////////////// - // Explicit basic constructors - - GLM_FUNC_DECL explicit tvec1(ctor); - GLM_FUNC_DECL explicit tvec1(T const & s); - - ////////////////////////////////////// - // Conversion vector constructors - - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template <typename U, precision Q> - GLM_FUNC_DECL explicit tvec1(tvec2<U, Q> const & v); - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template <typename U, precision Q> - GLM_FUNC_DECL explicit tvec1(tvec3<U, Q> const & v); - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template <typename U, precision Q> - GLM_FUNC_DECL explicit tvec1(tvec4<U, Q> const & v); - -# ifdef GLM_FORCE_EXPLICIT_CTOR - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template <typename U, precision Q> - GLM_FUNC_DECL explicit tvec1(tvec1<U, Q> const & v); -# else - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template <typename U, precision Q> - GLM_FUNC_DECL tvec1(tvec1<U, Q> const & v); -# endif - - ////////////////////////////////////// - // Swizzle constructors - -# if(GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE)) - template <int E0> - GLM_FUNC_DECL tvec1(detail::_swizzle<1, T, P, tvec1<T, P>, E0, -1,-2,-3> const & that) - { - *this = that(); - } -# endif//(GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE)) - - ////////////////////////////////////// - // Unary arithmetic operators - - GLM_FUNC_DECL tvec1<T, P> & operator=(tvec1<T, P> const & v); - - template <typename U> - GLM_FUNC_DECL tvec1<T, P> & operator=(tvec1<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec1<T, P> & operator+=(U const & s); - template <typename U> - GLM_FUNC_DECL tvec1<T, P> & operator+=(tvec1<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec1<T, P> & operator-=(U const & s); - template <typename U> - GLM_FUNC_DECL tvec1<T, P> & operator-=(tvec1<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec1<T, P> & operator*=(U const & s); - template <typename U> - GLM_FUNC_DECL tvec1<T, P> & operator*=(tvec1<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec1<T, P> & operator/=(U const & s); - template <typename U> - GLM_FUNC_DECL tvec1<T, P> & operator/=(tvec1<U, P> const & v); - - ////////////////////////////////////// - // Increment and decrement operators - - GLM_FUNC_DECL tvec1<T, P> & operator++(); - GLM_FUNC_DECL tvec1<T, P> & operator--(); - GLM_FUNC_DECL tvec1<T, P> operator++(int); - GLM_FUNC_DECL tvec1<T, P> operator--(int); - - ////////////////////////////////////// - // Unary bit operators - - template <typename U> - GLM_FUNC_DECL tvec1<T, P> & operator%=(U const & s); - template <typename U> - GLM_FUNC_DECL tvec1<T, P> & operator%=(tvec1<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec1<T, P> & operator&=(U const & s); - template <typename U> - GLM_FUNC_DECL tvec1<T, P> & operator&=(tvec1<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec1<T, P> & operator|=(U const & s); - template <typename U> - GLM_FUNC_DECL tvec1<T, P> & operator|=(tvec1<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec1<T, P> & operator^=(U const & s); - template <typename U> - GLM_FUNC_DECL tvec1<T, P> & operator^=(tvec1<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec1<T, P> & operator<<=(U const & s); - template <typename U> - GLM_FUNC_DECL tvec1<T, P> & operator<<=(tvec1<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec1<T, P> & operator>>=(U const & s); - template <typename U> - GLM_FUNC_DECL tvec1<T, P> & operator>>=(tvec1<U, P> const & v); - }; - - - template <typename T, precision P> - GLM_FUNC_DECL tvec1<T, P> operator+(tvec1<T, P> const & v, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tvec1<T, P> operator+(T const & s, tvec1<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec1<T, P> operator+(tvec1<T, P> const & v1, tvec1<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec1<T, P> operator-(tvec1<T, P> const & v, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tvec1<T, P> operator-(T const & s, tvec1<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec1<T, P> operator- (tvec1<T, P> const & v1, tvec1<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec1<T, P> operator*(tvec1<T, P> const & v, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tvec1<T, P> operator*(T const & s, tvec1<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec1<T, P> operator*(tvec1<T, P> const & v1, tvec1<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec1<T, P> operator/(tvec1<T, P> const & v, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tvec1<T, P> operator/(T const & s, tvec1<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec1<T, P> operator/(tvec1<T, P> const & v1, tvec1<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec1<T, P> operator-(tvec1<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL bool operator==(tvec1<T, P> const & v1, tvec1<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL bool operator!=(tvec1<T, P> const & v1, tvec1<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec1<T, P> operator%(tvec1<T, P> const & v, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tvec1<T, P> operator%(T const & s, tvec1<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec1<T, P> operator%(tvec1<T, P> const & v1, tvec1<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec1<T, P> operator&(tvec1<T, P> const & v, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tvec1<T, P> operator&(T const & s, tvec1<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec1<T, P> operator&(tvec1<T, P> const & v1, tvec1<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec1<T, P> operator|(tvec1<T, P> const & v, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tvec1<T, P> operator|(T const & s, tvec1<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec1<T, P> operator|(tvec1<T, P> const & v1, tvec1<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec1<T, P> operator^(tvec1<T, P> const & v, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tvec1<T, P> operator^(T const & s, tvec1<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec1<T, P> operator^(tvec1<T, P> const & v1, tvec1<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec1<T, P> operator<<(tvec1<T, P> const & v, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tvec1<T, P> operator<<(T const & s, tvec1<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec1<T, P> operator<<(tvec1<T, P> const & v1, tvec1<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec1<T, P> operator>>(tvec1<T, P> const & v, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tvec1<T, P> operator>>(T const & s, tvec1<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec1<T, P> operator>>(tvec1<T, P> const & v1, tvec1<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec1<T, P> operator~(tvec1<T, P> const & v); -}//namespace glm - -#ifndef GLM_EXTERNAL_TEMPLATE -#include "type_vec1.inl" -#endif//GLM_EXTERNAL_TEMPLATE diff --git a/extensions/common/glm/detail/type_vec1.inl b/extensions/common/glm/detail/type_vec1.inl deleted file mode 100644 index bd756cd416b..00000000000 --- a/extensions/common/glm/detail/type_vec1.inl +++ /dev/null @@ -1,616 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/type_vec1.inl -/// @date 2008-08-25 / 2011-06-15 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - ////////////////////////////////////// - // Implicit basic constructors - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec1<T, P>::tvec1() -# ifndef GLM_FORCE_NO_CTOR_INIT - : x(0) -# endif - {} - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec1<T, P>::tvec1(tvec1<T, P> const & v) - : x(v.x) - {} - - template <typename T, precision P> - template <precision Q> - GLM_FUNC_QUALIFIER tvec1<T, P>::tvec1(tvec1<T, Q> const & v) - : x(v.x) - {} - - ////////////////////////////////////// - // Explicit basic constructors - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec1<T, P>::tvec1(ctor) - {} - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec1<T, P>::tvec1(T const & s) - : x(s) - {} - - ////////////////////////////////////// - // Conversion vector constructors - - template <typename T, precision P> - template <typename U, precision Q> - GLM_FUNC_QUALIFIER tvec1<T, P>::tvec1(tvec1<U, Q> const & v) - : x(static_cast<T>(v.x)) - {} - - template <typename T, precision P> - template <typename U, precision Q> - GLM_FUNC_QUALIFIER tvec1<T, P>::tvec1(tvec2<U, Q> const & v) - : x(static_cast<T>(v.x)) - {} - - template <typename T, precision P> - template <typename U, precision Q> - GLM_FUNC_QUALIFIER tvec1<T, P>::tvec1(tvec3<U, Q> const & v) - : x(static_cast<T>(v.x)) - {} - - template <typename T, precision P> - template <typename U, precision Q> - GLM_FUNC_QUALIFIER tvec1<T, P>::tvec1(tvec4<U, Q> const & v) - : x(static_cast<T>(v.x)) - {} - - ////////////////////////////////////// - // Component accesses - -# ifdef GLM_FORCE_SIZE_FUNC - template <typename T, precision P> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tvec1<T, P>::size_type tvec1<T, P>::size() const - { - return 1; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER T & tvec1<T, P>::operator[](typename tvec1<T, P>::size_type i) - { - assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this)); - return (&x)[i]; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER T const & tvec1<T, P>::operator[](typename tvec1<T, P>::size_type i) const - { - assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this)); - return (&x)[i]; - } -# else - template <typename T, precision P> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tvec1<T, P>::length_type tvec1<T, P>::length() const - { - return 1; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER T & tvec1<T, P>::operator[](typename tvec1<T, P>::length_type i) - { - assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this)); - return (&x)[i]; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER T const & tvec1<T, P>::operator[](typename tvec1<T, P>::length_type i) const - { - assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this)); - return (&x)[i]; - } -# endif//GLM_FORCE_SIZE_FUNC - - ////////////////////////////////////// - // Unary arithmetic operators - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator=(tvec1<T, P> const & v) - { - this->x = v.x; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator=(tvec1<U, P> const & v) - { - this->x = static_cast<T>(v.x); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator+=(U const & s) - { - this->x += static_cast<T>(s); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator+=(tvec1<U, P> const & v) - { - this->x += static_cast<T>(v.x); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator-=(U const & s) - { - this->x -= static_cast<T>(s); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator-=(tvec1<U, P> const & v) - { - this->x -= static_cast<T>(v.x); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator*=(U const & s) - { - this->x *= static_cast<T>(s); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator*=(tvec1<U, P> const & v) - { - this->x *= static_cast<T>(v.x); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator/=(U const & s) - { - this->x /= static_cast<T>(s); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator/=(tvec1<U, P> const & v) - { - this->x /= static_cast<T>(v.x); - return *this; - } - - ////////////////////////////////////// - // Increment and decrement operators - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator++() - { - ++this->x; - return *this; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator--() - { - --this->x; - return *this; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec1<T, P> tvec1<T, P>::operator++(int) - { - tvec1<T, P> Result(*this); - ++*this; - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec1<T, P> tvec1<T, P>::operator--(int) - { - tvec1<T, P> Result(*this); - --*this; - return Result; - } - - ////////////////////////////////////// - // Boolean operators - - template <typename T, precision P> - GLM_FUNC_QUALIFIER bool operator==(tvec1<T, P> const & v1, tvec1<T, P> const & v2) - { - return (v1.x == v2.x); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER bool operator!=(tvec1<T, P> const & v1, tvec1<T, P> const & v2) - { - return (v1.x != v2.x); - } - - ////////////////////////////////////// - // Unary bit operators - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator%=(U const & s) - { - this->x %= static_cast<T>(s); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator%=(tvec1<U, P> const & v) - { - this->x %= static_cast<T>(v.x); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator&=(U const & s) - { - this->x &= static_cast<T>(s); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator&=(tvec1<U, P> const & v) - { - this->x &= static_cast<T>(v.x); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator|=(U const & s) - { - this->x |= static_cast<T>(s); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator|=(tvec1<U, P> const & v) - { - this->x |= U(v.x); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator^=(U const & s) - { - this->x ^= static_cast<T>(s); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator^=(tvec1<U, P> const & v) - { - this->x ^= static_cast<T>(v.x); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator<<=(U const & s) - { - this->x <<= static_cast<T>(s); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator<<=(tvec1<U, P> const & v) - { - this->x <<= static_cast<T>(v.x); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator>>=(U const & s) - { - this->x >>= static_cast<T>(s); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator>>=(tvec1<U, P> const & v) - { - this->x >>= static_cast<T>(v.x); - return *this; - } - - ////////////////////////////////////// - // Binary arithmetic operators - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec1<T, P> operator+(tvec1<T, P> const & v, T const & s) - { - return tvec1<T, P>( - v.x + s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec1<T, P> operator+(T const & s, tvec1<T, P> const & v) - { - return tvec1<T, P>( - s + v.x); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec1<T, P> operator+(tvec1<T, P> const & v1, tvec1<T, P> const & v2) - { - return tvec1<T, P>( - v1.x + v2.x); - } - - //operator- - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec1<T, P> operator-(tvec1<T, P> const & v, T const & s) - { - return tvec1<T, P>( - v.x - s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec1<T, P> operator-(T const & s, tvec1<T, P> const & v) - { - return tvec1<T, P>( - s - v.x); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec1<T, P> operator-(tvec1<T, P> const & v1, tvec1<T, P> const & v2) - { - return tvec1<T, P>( - v1.x - v2.x); - } - - //operator* - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec1<T, P> operator*(tvec1<T, P> const & v, T const & s) - { - return tvec1<T, P>( - v.x * s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec1<T, P> operator*(T const & s, tvec1<T, P> const & v) - { - return tvec1<T, P>( - s * v.x); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec1<T, P> operator*(tvec1<T, P> const & v1, tvec1<T, P> const & v2) - { - return tvec1<T, P>( - v1.x * v2.x); - } - - //operator/ - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec1<T, P> operator/(tvec1<T, P> const & v, T const & s) - { - return tvec1<T, P>( - v.x / s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec1<T, P> operator/(T const & s, tvec1<T, P> const & v) - { - return tvec1<T, P>( - s / v.x); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec1<T, P> operator/(tvec1<T, P> const & v1, tvec1<T, P> const & v2) - { - return tvec1<T, P>( - v1.x / v2.x); - } - - // Unary constant operators - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec1<T, P> operator-(tvec1<T, P> const & v) - { - return tvec1<T, P>( - -v.x); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec1<T, P> operator++(tvec1<T, P> const & v, int) - { - return tvec1<T, P>( - v.x + T(1)); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec1<T, P> operator--(tvec1<T, P> const & v, int) - { - return tvec1<T, P>( - v.x - T(1)); - } - - ////////////////////////////////////// - // Binary bit operators - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec1<T, P> operator%(tvec1<T, P> const & v, T const & s) - { - return tvec1<T, P>( - v.x % s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec1<T, P> operator%(T const & s, tvec1<T, P> const & v) - { - return tvec1<T, P>( - s % v.x); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec1<T, P> operator%(tvec1<T, P> const & v1, tvec1<T, P> const & v2) - { - return tvec1<T, P>( - v1.x % v2.x); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec1<T, P> operator&(tvec1<T, P> const & v, T const & s) - { - return tvec1<T, P>( - v.x & s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec1<T, P> operator&(T const & s, tvec1<T, P> const & v) - { - return tvec1<T, P>( - s & v.x); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec1<T, P> operator&(tvec1<T, P> const & v1, tvec1<T, P> const & v2) - { - return tvec1<T, P>( - v1.x & v2.x); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec1<T, P> operator|(tvec1<T, P> const & v, T const & s) - { - return tvec1<T, P>( - v.x | s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec1<T, P> operator|(T const & s, tvec1<T, P> const & v) - { - return tvec1<T, P>( - s | v.x); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec1<T, P> operator|(tvec1<T, P> const & v1, tvec1<T, P> const & v2) - { - return tvec1<T, P>( - v1.x | v2.x); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec1<T, P> operator^(tvec1<T, P> const & v, T const & s) - { - return tvec1<T, P>( - v.x ^ s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec1<T, P> operator^(T const & s, tvec1<T, P> const & v) - { - return tvec1<T, P>( - s ^ v.x); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec1<T, P> operator^(tvec1<T, P> const & v1, tvec1<T, P> const & v2) - { - return tvec1<T, P>( - v1.x ^ v2.x); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec1<T, P> operator<<(tvec1<T, P> const & v, T const & s) - { - return tvec1<T, P>( - v.x << s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec1<T, P> operator<<(T const & s, tvec1<T, P> const & v) - { - return tvec1<T, P>( - s << v.x); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec1<T, P> operator<<(tvec1<T, P> const & v1, tvec1<T, P> const & v2) - { - return tvec1<T, P>( - v1.x << v2.x); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec1<T, P> operator>>(tvec1<T, P> const & v, T const & s) - { - return tvec1<T, P>( - v.x >> s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec1<T, P> operator>>(T const & s, tvec1<T, P> const & v) - { - return tvec1<T, P>( - s >> v.x); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec1<T, P> operator>>(tvec1<T, P> const & v1, tvec1<T, P> const & v2) - { - return tvec1<T, P>( - v1.x >> v2.x); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec1<T, P> operator~(tvec1<T, P> const & v) - { - return tvec1<T, P>( - ~v.x); - } -}//namespace glm diff --git a/extensions/common/glm/detail/type_vec2.hpp b/extensions/common/glm/detail/type_vec2.hpp deleted file mode 100644 index 5aa8ab46b37..00000000000 --- a/extensions/common/glm/detail/type_vec2.hpp +++ /dev/null @@ -1,403 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/type_vec2.hpp -/// @date 2008-08-18 / 2013-08-27 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -//#include "../fwd.hpp" -#include "type_vec.hpp" -#ifdef GLM_SWIZZLE -# if GLM_HAS_ANONYMOUS_UNION -# include "_swizzle.hpp" -# else -# include "_swizzle_func.hpp" -# endif -#endif //GLM_SWIZZLE -#include <cstddef> - -namespace glm -{ - template <typename T, precision P = defaultp> - struct tvec2 - { - ////////////////////////////////////// - // Implementation detail - - typedef tvec2<T, P> type; - typedef tvec2<bool, P> bool_type; - typedef T value_type; - - ////////////////////////////////////// - // Data - -# if GLM_HAS_ANONYMOUS_UNION - union - { - struct{ T x, y; }; - struct{ T r, g; }; - struct{ T s, t; }; - -# ifdef GLM_SWIZZLE - _GLM_SWIZZLE2_2_MEMBERS(T, P, tvec2, x, y) - _GLM_SWIZZLE2_2_MEMBERS(T, P, tvec2, r, g) - _GLM_SWIZZLE2_2_MEMBERS(T, P, tvec2, s, t) - _GLM_SWIZZLE2_3_MEMBERS(T, P, tvec3, x, y) - _GLM_SWIZZLE2_3_MEMBERS(T, P, tvec3, r, g) - _GLM_SWIZZLE2_3_MEMBERS(T, P, tvec3, s, t) - _GLM_SWIZZLE2_4_MEMBERS(T, P, tvec4, x, y) - _GLM_SWIZZLE2_4_MEMBERS(T, P, tvec4, r, g) - _GLM_SWIZZLE2_4_MEMBERS(T, P, tvec4, s, t) -# endif//GLM_SWIZZLE - }; -# else - union {T x, r, s;}; - union {T y, g, t;}; - -# ifdef GLM_SWIZZLE - GLM_SWIZZLE_GEN_VEC_FROM_VEC2(T, P, tvec2, tvec2, tvec3, tvec4) -# endif//GLM_SWIZZLE -# endif - - ////////////////////////////////////// - // Component accesses - -# ifdef GLM_FORCE_SIZE_FUNC - /// Return the count of components of the vector - typedef size_t size_type; - GLM_FUNC_DECL GLM_CONSTEXPR size_type size() const; - - GLM_FUNC_DECL T & operator[](size_type i); - GLM_FUNC_DECL T const & operator[](size_type i) const; -# else - /// Return the count of components of the vector - typedef length_t length_type; - GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const; - - GLM_FUNC_DECL T & operator[](length_type i); - GLM_FUNC_DECL T const & operator[](length_type i) const; -# endif//GLM_FORCE_SIZE_FUNC - - ////////////////////////////////////// - // Implicit basic constructors - - GLM_FUNC_DECL tvec2(); - GLM_FUNC_DECL tvec2(tvec2<T, P> const & v); - template <precision Q> - GLM_FUNC_DECL tvec2(tvec2<T, Q> const & v); - - ////////////////////////////////////// - // Explicit basic constructors - - GLM_FUNC_DECL explicit tvec2(ctor); - GLM_FUNC_DECL explicit tvec2(T const & s); - GLM_FUNC_DECL tvec2(T const & s1, T const & s2); - - ////////////////////////////////////// - // Conversion constructors - - /// Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template <typename A, typename B> - GLM_FUNC_DECL tvec2(A const & x, B const & y); - template <typename A, typename B> - GLM_FUNC_DECL tvec2(tvec1<A, P> const & v1, tvec1<B, P> const & v2); - - ////////////////////////////////////// - // Conversion vector constructors - - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template <typename U, precision Q> - GLM_FUNC_DECL explicit tvec2(tvec3<U, Q> const & v); - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template <typename U, precision Q> - GLM_FUNC_DECL explicit tvec2(tvec4<U, Q> const & v); - -# ifdef GLM_FORCE_EXPLICIT_CTOR - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template <typename U, precision Q> - GLM_FUNC_DECL explicit tvec2(tvec2<U, Q> const & v); -# else - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template <typename U, precision Q> - GLM_FUNC_DECL tvec2(tvec2<U, Q> const & v); -# endif - - ////////////////////////////////////// - // Swizzle constructors - -# if GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE) - template <int E0, int E1> - GLM_FUNC_DECL tvec2(detail::_swizzle<2, T, P, tvec2<T, P>, E0, E1,-1,-2> const & that) - { - *this = that(); - } -# endif// GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE) - - ////////////////////////////////////// - // Unary arithmetic operators - - GLM_FUNC_DECL tvec2<T, P>& operator=(tvec2<T, P> const & v); - - template <typename U> - GLM_FUNC_DECL tvec2<T, P>& operator=(tvec2<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec2<T, P>& operator+=(U s); - template <typename U> - GLM_FUNC_DECL tvec2<T, P>& operator+=(tvec1<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec2<T, P>& operator+=(tvec2<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec2<T, P>& operator-=(U s); - template <typename U> - GLM_FUNC_DECL tvec2<T, P>& operator-=(tvec1<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec2<T, P>& operator-=(tvec2<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec2<T, P>& operator*=(U s); - template <typename U> - GLM_FUNC_DECL tvec2<T, P>& operator*=(tvec1<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec2<T, P>& operator*=(tvec2<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec2<T, P>& operator/=(U s); - template <typename U> - GLM_FUNC_DECL tvec2<T, P>& operator/=(tvec1<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec2<T, P>& operator/=(tvec2<U, P> const & v); - - ////////////////////////////////////// - // Increment and decrement operators - - GLM_FUNC_DECL tvec2<T, P> & operator++(); - GLM_FUNC_DECL tvec2<T, P> & operator--(); - GLM_FUNC_DECL tvec2<T, P> operator++(int); - GLM_FUNC_DECL tvec2<T, P> operator--(int); - - ////////////////////////////////////// - // Unary bit operators - - template <typename U> - GLM_FUNC_DECL tvec2<T, P> & operator%=(U s); - template <typename U> - GLM_FUNC_DECL tvec2<T, P> & operator%=(tvec1<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec2<T, P> & operator%=(tvec2<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec2<T, P> & operator&=(U s); - template <typename U> - GLM_FUNC_DECL tvec2<T, P> & operator&=(tvec1<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec2<T, P> & operator&=(tvec2<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec2<T, P> & operator|=(U s); - template <typename U> - GLM_FUNC_DECL tvec2<T, P> & operator|=(tvec1<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec2<T, P> & operator|=(tvec2<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec2<T, P> & operator^=(U s); - template <typename U> - GLM_FUNC_DECL tvec2<T, P> & operator^=(tvec1<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec2<T, P> & operator^=(tvec2<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec2<T, P> & operator<<=(U s); - template <typename U> - GLM_FUNC_DECL tvec2<T, P> & operator<<=(tvec1<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec2<T, P> & operator<<=(tvec2<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec2<T, P> & operator>>=(U s); - template <typename U> - GLM_FUNC_DECL tvec2<T, P> & operator>>=(tvec1<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec2<T, P> & operator>>=(tvec2<U, P> const & v); - }; - - template <typename T, precision P> - GLM_FUNC_DECL tvec2<T, P> operator+(tvec2<T, P> const & v, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tvec2<T, P> operator+(tvec2<T, P> const & v1, tvec1<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec2<T, P> operator+(T const & s, tvec2<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec2<T, P> operator+(tvec1<T, P> const & v1, tvec2<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec2<T, P> operator+(tvec2<T, P> const & v1, tvec2<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec2<T, P> operator-(tvec2<T, P> const & v, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tvec2<T, P> operator-(tvec2<T, P> const & v1, tvec1<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec2<T, P> operator-(T const & s, tvec2<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec2<T, P> operator-(tvec1<T, P> const & v1, tvec2<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec2<T, P> operator-(tvec2<T, P> const & v1, tvec2<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec2<T, P> operator*(tvec2<T, P> const & v, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tvec2<T, P> operator*(tvec2<T, P> const & v1, tvec1<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec2<T, P> operator*(T const & s, tvec2<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec2<T, P> operator*(tvec1<T, P> const & v1, tvec2<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec2<T, P> operator*(tvec2<T, P> const & v1, tvec2<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec2<T, P> operator/(tvec2<T, P> const & v, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tvec2<T, P> operator/(tvec2<T, P> const & v1, tvec1<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec2<T, P> operator/(T const & s, tvec2<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec2<T, P> operator/(tvec1<T, P> const & v1, tvec2<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec2<T, P> operator/(tvec2<T, P> const & v1, tvec2<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec2<T, P> operator-(tvec2<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec2<T, P> operator%(tvec2<T, P> const & v, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tvec2<T, P> operator%(tvec2<T, P> const & v1, tvec1<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec2<T, P> operator%(T const & s, tvec2<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec2<T, P> operator%(tvec1<T, P> const & v1, tvec2<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec2<T, P> operator%(tvec2<T, P> const & v1, tvec2<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec2<T, P> operator&(tvec2<T, P> const & v, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tvec2<T, P> operator&(tvec2<T, P> const & v1, tvec1<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec2<T, P> operator&(T const & s, tvec2<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec2<T, P> operator&(tvec1<T, P> const & v1, tvec2<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec2<T, P> operator&(tvec2<T, P> const & v1, tvec2<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec2<T, P> operator|(tvec2<T, P> const & v, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tvec2<T, P> operator|(tvec2<T, P> const & v1, tvec1<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec2<T, P> operator|(T const & s, tvec2<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec2<T, P> operator|(tvec1<T, P> const & v1, tvec2<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec2<T, P> operator|(tvec2<T, P> const & v1, tvec2<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec2<T, P> operator^(tvec2<T, P> const & v, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tvec2<T, P> operator^(tvec2<T, P> const & v1, tvec1<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec2<T, P> operator^(T const & s, tvec2<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec2<T, P> operator^(tvec1<T, P> const & v1, tvec2<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec2<T, P> operator^(tvec2<T, P> const & v1, tvec2<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec2<T, P> operator<<(tvec2<T, P> const & v, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tvec2<T, P> operator<<(tvec2<T, P> const & v1, tvec1<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec2<T, P> operator<<(T const & s, tvec2<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec2<T, P> operator<<(tvec1<T, P> const & v1, tvec2<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec2<T, P> operator<<(tvec2<T, P> const & v1, tvec2<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec2<T, P> operator>>(tvec2<T, P> const & v, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tvec2<T, P> operator>>(tvec2<T, P> const & v1, tvec1<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec2<T, P> operator>>(T const & s, tvec2<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec2<T, P> operator>>(tvec1<T, P> const & v1, tvec2<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec2<T, P> operator>>(tvec2<T, P> const & v1, tvec2<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec2<T, P> operator~(tvec2<T, P> const & v); -}//namespace glm - -#ifndef GLM_EXTERNAL_TEMPLATE -#include "type_vec2.inl" -#endif//GLM_EXTERNAL_TEMPLATE diff --git a/extensions/common/glm/detail/type_vec2.inl b/extensions/common/glm/detail/type_vec2.inl deleted file mode 100644 index 4db29479ec8..00000000000 --- a/extensions/common/glm/detail/type_vec2.inl +++ /dev/null @@ -1,909 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/core/type_tvec2.inl -/// @date 2008-08-18 / 2011-06-15 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ -#ifdef GLM_FORCE_SIZE_FUNC - template <typename T, precision P> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR size_t tvec2<T, P>::size() const - { - return 2; - } -#else - template <typename T, precision P> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR length_t tvec2<T, P>::length() const - { - return 2; - } -#endif - - ////////////////////////////////////// - // Accesses - - template <typename T, precision P> - GLM_FUNC_QUALIFIER T & tvec2<T, P>::operator[](length_t i) - { - assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this)); - return (&x)[i]; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER T const & tvec2<T, P>::operator[](length_t i) const - { - assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this)); - return (&x)[i]; - } - - ////////////////////////////////////// - // Implicit basic constructors - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2() -# ifndef GLM_FORCE_NO_CTOR_INIT - : x(0), y(0) -# endif - {} - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2(tvec2<T, P> const & v) - : x(v.x), y(v.y) - {} - - template <typename T, precision P> - template <precision Q> - GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2(tvec2<T, Q> const & v) - : x(v.x), y(v.y) - {} - - ////////////////////////////////////// - // Explicit basic constructors - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2(ctor) - {} - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2(T const & s) - : x(s), y(s) - {} - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2(T const & s1, T const & s2) - : x(s1), y(s2) - {} - - ////////////////////////////////////// - // Conversion scalar constructors - - template <typename T, precision P> - template <typename A, typename B> - GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2(A const & a, B const & b) - : x(static_cast<T>(a)) - , y(static_cast<T>(b)) - {} - - template <typename T, precision P> - template <typename A, typename B> - GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2(tvec1<A, P> const & a, tvec1<B, P> const & b) - : x(static_cast<T>(a.x)) - , y(static_cast<T>(b.x)) - {} - - ////////////////////////////////////// - // Conversion vector constructors - - template <typename T, precision P> - template <typename U, precision Q> - GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2(tvec2<U, Q> const & v) - : x(static_cast<T>(v.x)) - , y(static_cast<T>(v.y)) - {} - - template <typename T, precision P> - template <typename U, precision Q> - GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2(tvec3<U, Q> const & v) - : x(static_cast<T>(v.x)) - , y(static_cast<T>(v.y)) - {} - - template <typename T, precision P> - template <typename U, precision Q> - GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2(tvec4<U, Q> const & v) - : x(static_cast<T>(v.x)) - , y(static_cast<T>(v.y)) - {} - - ////////////////////////////////////// - // Unary arithmetic operators - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator=(tvec2<T, P> const & v) - { - this->x = v.x; - this->y = v.y; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator=(tvec2<U, P> const & v) - { - this->x = static_cast<T>(v.x); - this->y = static_cast<T>(v.y); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator+=(U s) - { - this->x += static_cast<T>(s); - this->y += static_cast<T>(s); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator+=(tvec1<U, P> const & v) - { - this->x += static_cast<T>(v.x); - this->y += static_cast<T>(v.x); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator+=(tvec2<U, P> const & v) - { - this->x += static_cast<T>(v.x); - this->y += static_cast<T>(v.y); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator-=(U s) - { - this->x -= static_cast<T>(s); - this->y -= static_cast<T>(s); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator-=(tvec1<U, P> const & v) - { - this->x -= static_cast<T>(v.x); - this->y -= static_cast<T>(v.x); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator-=(tvec2<U, P> const & v) - { - this->x -= static_cast<T>(v.x); - this->y -= static_cast<T>(v.y); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator*=(U s) - { - this->x *= static_cast<T>(s); - this->y *= static_cast<T>(s); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator*=(tvec1<U, P> const & v) - { - this->x *= static_cast<T>(v.x); - this->y *= static_cast<T>(v.x); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator*=(tvec2<U, P> const & v) - { - this->x *= static_cast<T>(v.x); - this->y *= static_cast<T>(v.y); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator/=(U s) - { - this->x /= static_cast<T>(s); - this->y /= static_cast<T>(s); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator/=(tvec1<U, P> const & v) - { - this->x /= static_cast<T>(v.x); - this->y /= static_cast<T>(v.x); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator/=(tvec2<U, P> const & v) - { - this->x /= static_cast<T>(v.x); - this->y /= static_cast<T>(v.y); - return *this; - } - - ////////////////////////////////////// - // Increment and decrement operators - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator++() - { - ++this->x; - ++this->y; - return *this; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator--() - { - --this->x; - --this->y; - return *this; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> tvec2<T, P>::operator++(int) - { - tvec2<T, P> Result(*this); - ++*this; - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> tvec2<T, P>::operator--(int) - { - tvec2<T, P> Result(*this); - --*this; - return Result; - } - - ////////////////////////////////////// - // Boolean operators - - template <typename T, precision P> - GLM_FUNC_QUALIFIER bool operator==(tvec2<T, P> const & v1, tvec2<T, P> const & v2) - { - return (v1.x == v2.x) && (v1.y == v2.y); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER bool operator!=(tvec2<T, P> const & v1, tvec2<T, P> const & v2) - { - return (v1.x != v2.x) || (v1.y != v2.y); - } - - ////////////////////////////////////// - // Unary bit operators - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator%=(U s) - { - this->x %= static_cast<T>(s); - this->y %= static_cast<T>(s); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator%=(tvec1<U, P> const & v) - { - this->x %= static_cast<T>(v.x); - this->y %= static_cast<T>(v.x); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator%=(tvec2<U, P> const & v) - { - this->x %= static_cast<T>(v.x); - this->y %= static_cast<T>(v.y); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator&=(U s) - { - this->x &= static_cast<T>(s); - this->y &= static_cast<T>(s); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator&=(tvec1<U, P> const & v) - { - this->x &= static_cast<T>(v.x); - this->y &= static_cast<T>(v.x); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator&=(tvec2<U, P> const & v) - { - this->x &= static_cast<T>(v.x); - this->y &= static_cast<T>(v.y); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator|=(U s) - { - this->x |= static_cast<T>(s); - this->y |= static_cast<T>(s); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator|=(tvec1<U, P> const & v) - { - this->x |= static_cast<T>(v.x); - this->y |= static_cast<T>(v.x); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator|=(tvec2<U, P> const & v) - { - this->x |= static_cast<T>(v.x); - this->y |= static_cast<T>(v.y); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator^=(U s) - { - this->x ^= static_cast<T>(s); - this->y ^= static_cast<T>(s); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator^=(tvec1<U, P> const & v) - { - this->x ^= static_cast<T>(v.x); - this->y ^= static_cast<T>(v.x); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator^=(tvec2<U, P> const & v) - { - this->x ^= static_cast<T>(v.x); - this->y ^= static_cast<T>(v.y); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator<<=(U s) - { - this->x <<= static_cast<T>(s); - this->y <<= static_cast<T>(s); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator<<=(tvec1<U, P> const & v) - { - this->x <<= static_cast<T>(v.x); - this->y <<= static_cast<T>(v.x); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator<<=(tvec2<U, P> const & v) - { - this->x <<= static_cast<T>(v.x); - this->y <<= static_cast<T>(v.y); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator>>=(U s) - { - this->x >>= static_cast<T>(s); - this->y >>= static_cast<T>(s); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator>>=(tvec1<U, P> const & v) - { - this->x >>= static_cast<T>(v.x); - this->y >>= static_cast<T>(v.x); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator>>=(tvec2<U, P> const & v) - { - this->x >>= static_cast<T>(v.x); - this->y >>= static_cast<T>(v.y); - return *this; - } - - ////////////////////////////////////// - // Binary arithmetic operators - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> operator+(tvec2<T, P> const & v, T const & s) - { - return tvec2<T, P>( - v.x + s, - v.y + s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> operator+(tvec2<T, P> const & v1, tvec1<T, P> const & v2) - { - return tvec2<T, P>( - v1.x + v2.x, - v1.y + v2.x); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> operator+(T const & s, tvec2<T, P> const & v) - { - return tvec2<T, P>( - s + v.x, - s + v.y); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> operator+(tvec1<T, P> const & v1, tvec2<T, P> const & v2) - { - return tvec2<T, P>( - v1.x + v2.x, - v1.x + v2.y); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> operator+(tvec2<T, P> const & v1, tvec2<T, P> const & v2) - { - return tvec2<T, P>( - v1.x + v2.x, - v1.y + v2.y); - } - - //operator- - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> operator-(tvec2<T, P> const & v, T const & s) - { - return tvec2<T, P>( - v.x - s, - v.y - s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> operator-(tvec2<T, P> const & v1, tvec1<T, P> const & v2) - { - return tvec2<T, P>( - v1.x - v2.x, - v1.y - v2.x); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> operator-(T const & s, tvec2<T, P> const & v) - { - return tvec2<T, P>( - s - v.x, - s - v.y); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> operator-(tvec1<T, P> const & v1, tvec2<T, P> const & v2) - { - return tvec2<T, P>( - v1.x - v2.x, - v1.x - v2.y); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> operator-(tvec2<T, P> const & v1, tvec2<T, P> const & v2) - { - return tvec2<T, P>( - v1.x - v2.x, - v1.y - v2.y); - } - - //operator* - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> operator*(tvec2<T, P> const & v1, T const & v2) - { - return tvec2<T, P>( - v1.x * v2, - v1.y * v2); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> operator*(tvec2<T, P> const & v1, tvec1<T, P> const & v2) - { - return tvec2<T, P>( - v1.x * v2.x, - v1.y * v2.x); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> operator*(T const & s, tvec2<T, P> const & v) - { - return tvec2<T, P>( - s * v.x, - s * v.y); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> operator*(tvec1<T, P> const & v1, tvec2<T, P> const & v2) - { - return tvec2<T, P>( - v1.x * v2.x, - v1.x * v2.y); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> operator*(tvec2<T, P> const & v1, tvec2<T, P> const & v2) - { - return tvec2<T, P>( - v1.x * v2.x, - v1.y * v2.y); - } - - //operator/ - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> operator/(tvec2<T, P> const & v, T const & s) - { - return tvec2<T, P>( - v.x / s, - v.y / s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> operator/(tvec2<T, P> const & v1, tvec1<T, P> const & v2) - { - return tvec2<T, P>( - v1.x / v2.x, - v1.y / v2.x); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> operator/(T const & s, tvec2<T, P> const & v) - { - return tvec2<T, P>( - s / v.x, - s / v.y); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> operator/(tvec1<T, P> const & v1, tvec2<T, P> const & v2) - { - return tvec2<T, P>( - v1.x / v2.x, - v1.x / v2.y); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> operator/(tvec2<T, P> const & v1, tvec2<T, P> const & v2) - { - return tvec2<T, P>( - v1.x / v2.x, - v1.y / v2.y); - } - - // Unary constant operators - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> operator-(tvec2<T, P> const & v) - { - return tvec2<T, P>( - -v.x, - -v.y); - } - - ////////////////////////////////////// - // Binary bit operators - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> operator%(tvec2<T, P> const & v, T const & s) - { - return tvec2<T, P>( - v.x % s, - v.y % s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> operator%(tvec2<T, P> const & v1, tvec1<T, P> const & v2) - { - return tvec2<T, P>( - v1.x % v2.x, - v1.y % v2.x); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> operator%(T const & s, tvec2<T, P> const & v) - { - return tvec2<T, P>( - s % v.x, - s % v.y); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> operator%(tvec1<T, P> const & v1, tvec2<T, P> const & v2) - { - return tvec2<T, P>( - v1.x % v2.x, - v1.x % v2.y); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> operator%(tvec2<T, P> const & v1, tvec2<T, P> const & v2) - { - return tvec2<T, P>( - v1.x % v2.x, - v1.y % v2.y); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> operator&(tvec2<T, P> const & v, T const & s) - { - return tvec2<T, P>( - v.x & s, - v.y & s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> operator&(tvec2<T, P> const & v1, tvec1<T, P> const & v2) - { - return tvec2<T, P>( - v1.x & v2.x, - v1.y & v2.x); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> operator&(T const & s, tvec2<T, P> const & v) - { - return tvec2<T, P>( - s & v.x, - s & v.y); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> operator&(tvec1<T, P> const & v1, tvec2<T, P> const & v2) - { - return tvec2<T, P>( - v1.x & v2.x, - v1.x & v2.y); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> operator&(tvec2<T, P> const & v1, tvec2<T, P> const & v2) - { - return tvec2<T, P>( - v1.x & v2.x, - v1.y & v2.y); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> operator|(tvec2<T, P> const & v, T const & s) - { - return tvec2<T, P>( - v.x | s, - v.y | s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> operator|(tvec2<T, P> const & v1, tvec1<T, P> const & v2) - { - return tvec2<T, P>( - v1.x | v2.x, - v1.y | v2.x); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> operator|(T const & s, tvec2<T, P> const & v) - { - return tvec2<T, P>( - s | v.x, - s | v.y); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> operator|(tvec1<T, P> const & v1, tvec2<T, P> const & v2) - { - return tvec2<T, P>( - v1.x | v2.x, - v1.x | v2.y); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> operator|(tvec2<T, P> const & v1, tvec2<T, P> const & v2) - { - return tvec2<T, P>( - v1.x | v2.x, - v1.y | v2.y); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> operator^(tvec2<T, P> const & v, T const & s) - { - return tvec2<T, P>( - v.x ^ s, - v.y ^ s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> operator^(tvec2<T, P> const & v1, tvec1<T, P> const & v2) - { - return tvec2<T, P>( - v1.x ^ v2.x, - v1.y ^ v2.x); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> operator^(T const & s, tvec2<T, P> const & v) - { - return tvec2<T, P>( - s ^ v.x, - s ^ v.y); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> operator^(tvec1<T, P> const & v1, tvec2<T, P> const & v2) - { - return tvec2<T, P>( - v1.x ^ v2.x, - v1.x ^ v2.y); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> operator^(tvec2<T, P> const & v1, tvec2<T, P> const & v2) - { - return tvec2<T, P>( - v1.x ^ v2.x, - v1.y ^ v2.y); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> operator<<(tvec2<T, P> const & v, T const & s) - { - return tvec2<T, P>( - v.x << s, - v.y << s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> operator<<(tvec2<T, P> const & v1, tvec1<T, P> const & v2) - { - return tvec2<T, P>( - v1.x << v2.x, - v1.y << v2.x); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> operator<<(T const & s, tvec2<T, P> const & v) - { - return tvec2<T, P>( - s << v.x, - s << v.y); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> operator<<(tvec1<T, P> const & v1, tvec2<T, P> const & v2) - { - return tvec2<T, P>( - v1.x << v2.x, - v1.x << v2.y); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> operator<<(tvec2<T, P> const & v1, tvec2<T, P> const & v2) - { - return tvec2<T, P>( - v1.x << v2.x, - v1.y << v2.y); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> operator>>(tvec2<T, P> const & v, T const & s) - { - return tvec2<T, P>( - v.x >> s, - v.y >> s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> operator>>(tvec2<T, P> const & v1, tvec1<T, P> const & v2) - { - return tvec2<T, P>( - v1.x >> v2.x, - v1.y >> v2.x); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> operator>>(T const & s, tvec2<T, P> const & v) - { - return tvec2<T, P>( - s >> v.x, - s >> v.y); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> operator>>(tvec1<T, P> const & v1, tvec2<T, P> const & v2) - { - return tvec2<T, P>( - v1.x >> v2.x, - v1.x >> v2.y); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> operator>>(tvec2<T, P> const & v1, tvec2<T, P> const & v2) - { - return tvec2<T, P>( - v1.x >> v2.x, - v1.y >> v2.y); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> operator~(tvec2<T, P> const & v) - { - return tvec2<T, P>( - ~v.x, - ~v.y); - } -}//namespace glm diff --git a/extensions/common/glm/detail/type_vec3.hpp b/extensions/common/glm/detail/type_vec3.hpp deleted file mode 100644 index 61d42757896..00000000000 --- a/extensions/common/glm/detail/type_vec3.hpp +++ /dev/null @@ -1,425 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/type_vec3.hpp -/// @date 2008-08-22 / 2011-06-15 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -//#include "../fwd.hpp" -#include "type_vec.hpp" -#ifdef GLM_SWIZZLE -# if GLM_HAS_ANONYMOUS_UNION -# include "_swizzle.hpp" -# else -# include "_swizzle_func.hpp" -# endif -#endif //GLM_SWIZZLE -#include <cstddef> - -namespace glm -{ - template <typename T, precision P = defaultp> - struct tvec3 - { - ////////////////////////////////////// - // Implementation detail - - typedef tvec3<T, P> type; - typedef tvec3<bool, P> bool_type; - typedef T value_type; - - ////////////////////////////////////// - // Data - -# if GLM_HAS_ANONYMOUS_UNION - union - { - struct{ T x, y, z; }; - struct{ T r, g, b; }; - struct{ T s, t, p; }; - -# ifdef GLM_SWIZZLE - _GLM_SWIZZLE3_2_MEMBERS(T, P, tvec2, x, y, z) - _GLM_SWIZZLE3_2_MEMBERS(T, P, tvec2, r, g, b) - _GLM_SWIZZLE3_2_MEMBERS(T, P, tvec2, s, t, p) - _GLM_SWIZZLE3_3_MEMBERS(T, P, tvec3, x, y, z) - _GLM_SWIZZLE3_3_MEMBERS(T, P, tvec3, r, g, b) - _GLM_SWIZZLE3_3_MEMBERS(T, P, tvec3, s, t, p) - _GLM_SWIZZLE3_4_MEMBERS(T, P, tvec4, x, y, z) - _GLM_SWIZZLE3_4_MEMBERS(T, P, tvec4, r, g, b) - _GLM_SWIZZLE3_4_MEMBERS(T, P, tvec4, s, t, p) -# endif//GLM_SWIZZLE - }; -# else - union { T x, r, s; }; - union { T y, g, t; }; - union { T z, b, p; }; - -# ifdef GLM_SWIZZLE - GLM_SWIZZLE_GEN_VEC_FROM_VEC3(T, P, tvec3, tvec2, tvec3, tvec4) -# endif//GLM_SWIZZLE -# endif//GLM_LANG - - ////////////////////////////////////// - // Component accesses - -# ifdef GLM_FORCE_SIZE_FUNC - /// Return the count of components of the vector - typedef size_t size_type; - GLM_FUNC_DECL GLM_CONSTEXPR size_type size() const; - - GLM_FUNC_DECL T & operator[](size_type i); - GLM_FUNC_DECL T const & operator[](size_type i) const; -# else - /// Return the count of components of the vector - typedef length_t length_type; - GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const; - - GLM_FUNC_DECL T & operator[](length_type i); - GLM_FUNC_DECL T const & operator[](length_type i) const; -# endif//GLM_FORCE_SIZE_FUNC - - ////////////////////////////////////// - // Implicit basic constructors - - GLM_FUNC_DECL tvec3(); - GLM_FUNC_DECL tvec3(tvec3<T, P> const & v); - template <precision Q> - GLM_FUNC_DECL tvec3(tvec3<T, Q> const & v); - - ////////////////////////////////////// - // Explicit basic constructors - - GLM_FUNC_DECL explicit tvec3(ctor); - GLM_FUNC_DECL explicit tvec3(T const & s); - GLM_FUNC_DECL tvec3(T const & a, T const & b, T const & c); - - ////////////////////////////////////// - // Conversion scalar constructors - - /// Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template <typename A, typename B, typename C> - GLM_FUNC_DECL tvec3(A const & a, B const & b, C const & c); - template <typename A, typename B, typename C> - GLM_FUNC_DECL tvec3(tvec1<A, P> const & a, tvec1<B, P> const & b, tvec1<C, P> const & c); - - ////////////////////////////////////// - // Conversion vector constructors - - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template <typename A, typename B, precision Q> - GLM_FUNC_DECL explicit tvec3(tvec2<A, Q> const & a, B const & b); - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template <typename A, typename B, precision Q> - GLM_FUNC_DECL explicit tvec3(tvec2<A, Q> const & a, tvec1<B, Q> const & b); - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template <typename A, typename B, precision Q> - GLM_FUNC_DECL explicit tvec3(A const & a, tvec2<B, Q> const & b); - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template <typename A, typename B, precision Q> - GLM_FUNC_DECL explicit tvec3(tvec1<A, Q> const & a, tvec2<B, Q> const & b); - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template <typename U, precision Q> - GLM_FUNC_DECL explicit tvec3(tvec4<U, Q> const & v); - -# ifdef GLM_FORCE_EXPLICIT_CTOR - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template <typename U, precision Q> - GLM_FUNC_DECL explicit tvec3(tvec3<U, Q> const & v); -# else - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template <typename U, precision Q> - GLM_FUNC_DECL tvec3(tvec3<U, Q> const & v); -# endif - - ////////////////////////////////////// - // Swizzle constructors - -# if GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE) - template <int E0, int E1, int E2> - GLM_FUNC_DECL tvec3(detail::_swizzle<3, T, P, tvec3<T, P>, E0, E1, E2, -1> const & that) - { - *this = that(); - } - - template <int E0, int E1> - GLM_FUNC_DECL tvec3(detail::_swizzle<2, T, P, tvec2<T, P>, E0, E1, -1, -2> const & v, T const & s) - { - *this = tvec3<T, P>(v(), s); - } - - template <int E0, int E1> - GLM_FUNC_DECL tvec3(T const & s, detail::_swizzle<2, T, P, tvec2<T, P>, E0, E1, -1, -2> const & v) - { - *this = tvec3<T, P>(s, v()); - } -# endif// GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE) - - ////////////////////////////////////// - // Unary arithmetic operators - - GLM_FUNC_DECL tvec3<T, P> & operator=(tvec3<T, P> const & v); - - template <typename U> - GLM_FUNC_DECL tvec3<T, P> & operator=(tvec3<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec3<T, P> & operator+=(U s); - template <typename U> - GLM_FUNC_DECL tvec3<T, P> & operator+=(tvec1<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec3<T, P> & operator+=(tvec3<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec3<T, P> & operator-=(U s); - template <typename U> - GLM_FUNC_DECL tvec3<T, P> & operator-=(tvec1<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec3<T, P> & operator-=(tvec3<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec3<T, P> & operator*=(U s); - template <typename U> - GLM_FUNC_DECL tvec3<T, P> & operator*=(tvec1<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec3<T, P> & operator*=(tvec3<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec3<T, P> & operator/=(U s); - template <typename U> - GLM_FUNC_DECL tvec3<T, P> & operator/=(tvec1<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec3<T, P> & operator/=(tvec3<U, P> const & v); - - ////////////////////////////////////// - // Increment and decrement operators - - GLM_FUNC_DECL tvec3<T, P> & operator++(); - GLM_FUNC_DECL tvec3<T, P> & operator--(); - GLM_FUNC_DECL tvec3<T, P> operator++(int); - GLM_FUNC_DECL tvec3<T, P> operator--(int); - - ////////////////////////////////////// - // Unary bit operators - - template <typename U> - GLM_FUNC_DECL tvec3<T, P> & operator%=(U s); - template <typename U> - GLM_FUNC_DECL tvec3<T, P> & operator%=(tvec1<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec3<T, P> & operator%=(tvec3<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec3<T, P> & operator&=(U s); - template <typename U> - GLM_FUNC_DECL tvec3<T, P> & operator&=(tvec1<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec3<T, P> & operator&=(tvec3<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec3<T, P> & operator|=(U s); - template <typename U> - GLM_FUNC_DECL tvec3<T, P> & operator|=(tvec1<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec3<T, P> & operator|=(tvec3<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec3<T, P> & operator^=(U s); - template <typename U> - GLM_FUNC_DECL tvec3<T, P> & operator^=(tvec1<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec3<T, P> & operator^=(tvec3<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec3<T, P> & operator<<=(U s); - template <typename U> - GLM_FUNC_DECL tvec3<T, P> & operator<<=(tvec1<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec3<T, P> & operator<<=(tvec3<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec3<T, P> & operator>>=(U s); - template <typename U> - GLM_FUNC_DECL tvec3<T, P> & operator>>=(tvec1<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec3<T, P> & operator>>=(tvec3<U, P> const & v); - }; - - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> operator+(tvec3<T, P> const & v, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> operator+(tvec3<T, P> const & v, tvec1<T, P> const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> operator+(T const & s, tvec3<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> operator+(tvec1<T, P> const & s, tvec3<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> operator+(tvec3<T, P> const & v1, tvec3<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> operator-(tvec3<T, P> const & v, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> operator-(tvec3<T, P> const & v, tvec1<T, P> const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> operator-(T const & s, tvec3<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> operator-(tvec1<T, P> const & s, tvec3<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> operator-(tvec3<T, P> const & v1, tvec3<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> operator*(tvec3<T, P> const & v, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> operator*(tvec3<T, P> const & v, tvec1<T, P> const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> operator*(T const & s, tvec3<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> operator*(tvec1<T, P> const & s, tvec3<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> operator*(tvec3<T, P> const & v1, tvec3<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> operator/(tvec3<T, P> const & v, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> operator/(tvec3<T, P> const & v, tvec1<T, P> const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> operator/(T const & s, tvec3<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> operator/(tvec1<T, P> const & s, tvec3<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> operator/(tvec3<T, P> const & v1, tvec3<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> operator-(tvec3<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> operator%(tvec3<T, P> const & v, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> operator%(tvec3<T, P> const & v, tvec1<T, P> const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> operator%(T const & s, tvec3<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> operator%(tvec1<T, P> const & s, tvec3<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> operator%(tvec3<T, P> const & v1, tvec3<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> operator&(tvec3<T, P> const & v, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> operator&(tvec3<T, P> const & v, tvec1<T, P> const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> operator&(T const & s, tvec3<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> operator&(tvec1<T, P> const & s, tvec3<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> operator&(tvec3<T, P> const & v1, tvec3<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> operator|(tvec3<T, P> const & v, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> operator|(tvec3<T, P> const & v, tvec1<T, P> const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> operator|(T const & s, tvec3<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> operator|(tvec1<T, P> const & s, tvec3<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> operator|(tvec3<T, P> const & v1, tvec3<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> operator^(tvec3<T, P> const & v, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> operator^(tvec3<T, P> const & v, tvec1<T, P> const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> operator^(T const & s, tvec3<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> operator^(tvec1<T, P> const & s, tvec3<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> operator^(tvec3<T, P> const & v1, tvec3<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> operator<<(tvec3<T, P> const & v, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> operator<<(tvec3<T, P> const & v, tvec1<T, P> const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> operator<<(T const & s, tvec3<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> operator<<(tvec1<T, P> const & s, tvec3<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> operator<<(tvec3<T, P> const & v1, tvec3<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> operator>>(tvec3<T, P> const & v, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> operator>>(tvec3<T, P> const & v, tvec1<T, P> const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> operator>>(T const & s, tvec3<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> operator>>(tvec1<T, P> const & s, tvec3<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> operator>>(tvec3<T, P> const & v1, tvec3<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> operator~(tvec3<T, P> const & v); -}//namespace glm - -#ifndef GLM_EXTERNAL_TEMPLATE -#include "type_vec3.inl" -#endif//GLM_EXTERNAL_TEMPLATE diff --git a/extensions/common/glm/detail/type_vec3.inl b/extensions/common/glm/detail/type_vec3.inl deleted file mode 100644 index b2088d8b744..00000000000 --- a/extensions/common/glm/detail/type_vec3.inl +++ /dev/null @@ -1,1042 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/type_tvec3.inl -/// @date 2008-08-22 / 2011-06-15 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - ////////////////////////////////////// - // Implicit basic constructors - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3() -# ifndef GLM_FORCE_NO_CTOR_INIT - : x(0), y(0), z(0) -# endif - {} - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3(tvec3<T, P> const & v) - : x(v.x), y(v.y), z(v.z) - {} - - template <typename T, precision P> - template <precision Q> - GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3(tvec3<T, Q> const & v) - : x(v.x), y(v.y), z(v.z) - {} - - ////////////////////////////////////// - // Explicit basic constructors - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3(ctor) - {} - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3(T const & s) - : x(s), y(s), z(s) - {} - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3(T const & a, T const & b, T const & c) - : x(a), y(b), z(c) - {} - - ////////////////////////////////////// - // Conversion scalar constructors - - template <typename T, precision P> - template <typename A, typename B, typename C> - GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3(A const & a, B const & b, C const & c) : - x(static_cast<T>(a)), - y(static_cast<T>(b)), - z(static_cast<T>(c)) - {} - - template <typename T, precision P> - template <typename A, typename B, typename C> - GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3(tvec1<A, P> const & a, tvec1<B, P> const & b, tvec1<C, P> const & c) : - x(static_cast<T>(a)), - y(static_cast<T>(b)), - z(static_cast<T>(c)) - {} - - ////////////////////////////////////// - // Conversion vector constructors - - template <typename T, precision P> - template <typename A, typename B, precision Q> - GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3(tvec2<A, Q> const & a, B const & b) : - x(static_cast<T>(a.x)), - y(static_cast<T>(a.y)), - z(static_cast<T>(b)) - {} - - template <typename T, precision P> - template <typename A, typename B, precision Q> - GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3(tvec2<A, Q> const & a, tvec1<B, Q> const & b) : - x(static_cast<T>(a.x)), - y(static_cast<T>(a.y)), - z(static_cast<T>(b.x)) - {} - - template <typename T, precision P> - template <typename A, typename B, precision Q> - GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3(A const & a, tvec2<B, Q> const & b) : - x(static_cast<T>(a)), - y(static_cast<T>(b.x)), - z(static_cast<T>(b.y)) - {} - - template <typename T, precision P> - template <typename A, typename B, precision Q> - GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3(tvec1<A, Q> const & a, tvec2<B, Q> const & b) : - x(static_cast<T>(a.x)), - y(static_cast<T>(b.x)), - z(static_cast<T>(b.y)) - {} - - template <typename T, precision P> - template <typename U, precision Q> - GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3(tvec3<U, Q> const & v) : - x(static_cast<T>(v.x)), - y(static_cast<T>(v.y)), - z(static_cast<T>(v.z)) - {} - - template <typename T, precision P> - template <typename U, precision Q> - GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3(tvec4<U, Q> const & v) : - x(static_cast<T>(v.x)), - y(static_cast<T>(v.y)), - z(static_cast<T>(v.z)) - {} - - ////////////////////////////////////// - // Component accesses - -# ifdef GLM_FORCE_SIZE_FUNC - template <typename T, precision P> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tvec3<T, P>::size_type tvec3<T, P>::size() const - { - return 3; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER T & tvec3<T, P>::operator[](typename tvec3<T, P>::size_type i) - { - assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this)); - return (&x)[i]; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER T const & tvec3<T, P>::operator[](typename tvec3<T, P>::size_type i) const - { - assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this)); - return (&x)[i]; - } -# else - template <typename T, precision P> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tvec3<T, P>::length_type tvec3<T, P>::length() const - { - return 3; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER T & tvec3<T, P>::operator[](typename tvec3<T, P>::length_type i) - { - assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this)); - return (&x)[i]; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER T const & tvec3<T, P>::operator[](typename tvec3<T, P>::length_type i) const - { - assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this)); - return (&x)[i]; - } -# endif//GLM_FORCE_SIZE_FUNC - - ////////////////////////////////////// - // Unary arithmetic operators - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P>& tvec3<T, P>::operator=(tvec3<T, P> const & v) - { - this->x = v.x; - this->y = v.y; - this->z = v.z; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec3<T, P>& tvec3<T, P>::operator=(tvec3<U, P> const & v) - { - this->x = static_cast<T>(v.x); - this->y = static_cast<T>(v.y); - this->z = static_cast<T>(v.z); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator+=(U s) - { - this->x += static_cast<T>(s); - this->y += static_cast<T>(s); - this->z += static_cast<T>(s); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator+=(tvec1<U, P> const & v) - { - this->x += static_cast<T>(v.x); - this->y += static_cast<T>(v.x); - this->z += static_cast<T>(v.x); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator+=(tvec3<U, P> const & v) - { - this->x += static_cast<T>(v.x); - this->y += static_cast<T>(v.y); - this->z += static_cast<T>(v.z); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator-=(U s) - { - this->x -= static_cast<T>(s); - this->y -= static_cast<T>(s); - this->z -= static_cast<T>(s); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator-=(tvec1<U, P> const & v) - { - this->x -= static_cast<T>(v.x); - this->y -= static_cast<T>(v.x); - this->z -= static_cast<T>(v.x); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator-=(tvec3<U, P> const & v) - { - this->x -= static_cast<T>(v.x); - this->y -= static_cast<T>(v.y); - this->z -= static_cast<T>(v.z); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator*=(U s) - { - this->x *= static_cast<T>(s); - this->y *= static_cast<T>(s); - this->z *= static_cast<T>(s); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator*=(tvec1<U, P> const & v) - { - this->x *= static_cast<T>(v.x); - this->y *= static_cast<T>(v.x); - this->z *= static_cast<T>(v.x); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator*=(tvec3<U, P> const & v) - { - this->x *= static_cast<T>(v.x); - this->y *= static_cast<T>(v.y); - this->z *= static_cast<T>(v.z); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator/=(U s) - { - this->x /= static_cast<T>(s); - this->y /= static_cast<T>(s); - this->z /= static_cast<T>(s); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator/=(tvec1<U, P> const & v) - { - this->x /= static_cast<T>(v.x); - this->y /= static_cast<T>(v.x); - this->z /= static_cast<T>(v.x); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator/=(tvec3<U, P> const & v) - { - this->x /= static_cast<T>(v.x); - this->y /= static_cast<T>(v.y); - this->z /= static_cast<T>(v.z); - return *this; - } - - ////////////////////////////////////// - // Increment and decrement operators - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator++() - { - ++this->x; - ++this->y; - ++this->z; - return *this; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator--() - { - --this->x; - --this->y; - --this->z; - return *this; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> tvec3<T, P>::operator++(int) - { - tvec3<T, P> Result(*this); - ++*this; - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> tvec3<T, P>::operator--(int) - { - tvec3<T, P> Result(*this); - --*this; - return Result; - } - - ////////////////////////////////////// - // Unary bit operators - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator%=(U s) - { - this->x %= s; - this->y %= s; - this->z %= s; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator%=(tvec1<U, P> const & v) - { - this->x %= v.x; - this->y %= v.x; - this->z %= v.x; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator%=(tvec3<U, P> const & v) - { - this->x %= v.x; - this->y %= v.y; - this->z %= v.z; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator&=(U s) - { - this->x &= s; - this->y &= s; - this->z &= s; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator&=(tvec1<U, P> const & v) - { - this->x &= v.x; - this->y &= v.x; - this->z &= v.x; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator&=(tvec3<U, P> const & v) - { - this->x &= v.x; - this->y &= v.y; - this->z &= v.z; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator|=(U s) - { - this->x |= s; - this->y |= s; - this->z |= s; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator|=(tvec1<U, P> const & v) - { - this->x |= v.x; - this->y |= v.x; - this->z |= v.x; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator|=(tvec3<U, P> const & v) - { - this->x |= v.x; - this->y |= v.y; - this->z |= v.z; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator^=(U s) - { - this->x ^= s; - this->y ^= s; - this->z ^= s; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator^=(tvec1<U, P> const & v) - { - this->x ^= v.x; - this->y ^= v.x; - this->z ^= v.x; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator^=(tvec3<U, P> const & v) - { - this->x ^= v.x; - this->y ^= v.y; - this->z ^= v.z; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator<<=(U s) - { - this->x <<= s; - this->y <<= s; - this->z <<= s; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator<<=(tvec1<U, P> const & v) - { - this->x <<= static_cast<T>(v.x); - this->y <<= static_cast<T>(v.x); - this->z <<= static_cast<T>(v.x); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator<<=(tvec3<U, P> const & v) - { - this->x <<= static_cast<T>(v.x); - this->y <<= static_cast<T>(v.y); - this->z <<= static_cast<T>(v.z); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator>>=(U s) - { - this->x >>= static_cast<T>(s); - this->y >>= static_cast<T>(s); - this->z >>= static_cast<T>(s); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator>>=(tvec1<U, P> const & v) - { - this->x >>= static_cast<T>(v.x); - this->y >>= static_cast<T>(v.x); - this->z >>= static_cast<T>(v.x); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator>>=(tvec3<U, P> const & v) - { - this->x >>= static_cast<T>(v.x); - this->y >>= static_cast<T>(v.y); - this->z >>= static_cast<T>(v.z); - return *this; - } - - ////////////////////////////////////// - // Boolean operators - - template <typename T, precision P> - GLM_FUNC_QUALIFIER bool operator==(tvec3<T, P> const & v1, tvec3<T, P> const & v2) - { - return (v1.x == v2.x) && (v1.y == v2.y) && (v1.z == v2.z); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER bool operator!=(tvec3<T, P> const & v1, tvec3<T, P> const & v2) - { - return (v1.x != v2.x) || (v1.y != v2.y) || (v1.z != v2.z); - } - - ////////////////////////////////////// - // Binary arithmetic operators - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> operator+(tvec3<T, P> const & v, T const & s) - { - return tvec3<T, P>( - v.x + s, - v.y + s, - v.z + s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> operator+(tvec3<T, P> const & v, tvec1<T, P> const & s) - { - return tvec3<T, P>( - v.x + s.x, - v.y + s.x, - v.z + s.x); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> operator+(T const & s, tvec3<T, P> const & v) - { - return tvec3<T, P>( - s + v.x, - s + v.y, - s + v.z); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> operator+(tvec1<T, P> const & s, tvec3<T, P> const & v) - { - return tvec3<T, P>( - s.x + v.x, - s.x + v.y, - s.x + v.z); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> operator+(tvec3<T, P> const & v1, tvec3<T, P> const & v2) - { - return tvec3<T, P>( - v1.x + v2.x, - v1.y + v2.y, - v1.z + v2.z); - } - - //operator- - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> operator-(tvec3<T, P> const & v, T const & s) - { - return tvec3<T, P>( - v.x - s, - v.y - s, - v.z - s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> operator-(tvec3<T, P> const & v, tvec1<T, P> const & s) - { - return tvec3<T, P>( - v.x - s.x, - v.y - s.x, - v.z - s.x); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> operator-(T const & s, tvec3<T, P> const & v) - { - return tvec3<T, P>( - s - v.x, - s - v.y, - s - v.z); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> operator-(tvec1<T, P> const & s, tvec3<T, P> const & v) - { - return tvec3<T, P>( - s.x - v.x, - s.x - v.y, - s.x - v.z); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> operator-(tvec3<T, P> const & v1, tvec3<T, P> const & v2) - { - return tvec3<T, P>( - v1.x - v2.x, - v1.y - v2.y, - v1.z - v2.z); - } - - //operator* - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> operator*(tvec3<T, P> const & v, T const & s) - { - return tvec3<T, P>( - v.x * s, - v.y * s, - v.z * s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> operator*(tvec3<T, P> const & v, tvec1<T, P> const & s) - { - return tvec3<T, P>( - v.x * s.x, - v.y * s.x, - v.z * s.x); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> operator*(T const & s, tvec3<T, P> const & v) - { - return tvec3<T, P>( - s * v.x, - s * v.y, - s * v.z); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> operator*(tvec1<T, P> const & s, tvec3<T, P> const & v) - { - return tvec3<T, P>( - s.x * v.x, - s.x * v.y, - s.x * v.z); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> operator*(tvec3<T, P> const & v1, tvec3<T, P> const & v2) - { - return tvec3<T, P>( - v1.x * v2.x, - v1.y * v2.y, - v1.z * v2.z); - } - - //operator/ - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> operator/(tvec3<T, P> const & v, T const & s) - { - return tvec3<T, P>( - v.x / s, - v.y / s, - v.z / s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> operator/(tvec3<T, P> const & v, tvec1<T, P> const & s) - { - return tvec3<T, P>( - v.x / s.x, - v.y / s.x, - v.z / s.x); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> operator/(T const & s, tvec3<T, P> const & v) - { - return tvec3<T, P>( - s / v.x, - s / v.y, - s / v.z); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> operator/(tvec1<T, P> const & s, tvec3<T, P> const & v) - { - return tvec3<T, P>( - s.x / v.x, - s.x / v.y, - s.x / v.z); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> operator/(tvec3<T, P> const & v1, tvec3<T, P> const & v2) - { - return tvec3<T, P>( - v1.x / v2.x, - v1.y / v2.y, - v1.z / v2.z); - } - - // Unary constant operators - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> operator-(tvec3<T, P> const & v) - { - return tvec3<T, P>( - -v.x, - -v.y, - -v.z); - } - - ////////////////////////////////////// - // Binary bit operators - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> operator%(tvec3<T, P> const & v, T const & s) - { - return tvec3<T, P>( - v.x % s, - v.y % s, - v.z % s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> operator%(tvec3<T, P> const & v, tvec1<T, P> const & s) - { - return tvec3<T, P>( - v.x % s.x, - v.y % s.x, - v.z % s.x); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> operator%(T const & s, tvec3<T, P> const & v) - { - return tvec3<T, P>( - s % v.x, - s % v.y, - s % v.z); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> operator%(tvec1<T, P> const & s, tvec3<T, P> const & v) - { - return tvec3<T, P>( - s.x % v.x, - s.x % v.y, - s.x % v.z); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> operator%(tvec3<T, P> const & v1, tvec3<T, P> const & v2) - { - return tvec3<T, P>( - v1.x % v2.x, - v1.y % v2.y, - v1.z % v2.z); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> operator&(tvec3<T, P> const & v, T const & s) - { - return tvec3<T, P>( - v.x & s, - v.y & s, - v.z & s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> operator&(tvec3<T, P> const & v, tvec1<T, P> const & s) - { - return tvec3<T, P>( - v.x & s.x, - v.y & s.x, - v.z & s.x); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> operator&(T const & s, tvec3<T, P> const & v) - { - return tvec3<T, P>( - s & v.x, - s & v.y, - s & v.z); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> operator&(tvec1<T, P> const & s, tvec3<T, P> const & v) - { - return tvec3<T, P>( - s.x & v.x, - s.x & v.y, - s.x & v.z); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> operator&(tvec3<T, P> const & v1, tvec3<T, P> const & v2) - { - return tvec3<T, P>( - v1.x & v2.x, - v1.y & v2.y, - v1.z & v2.z); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> operator|(tvec3<T, P> const & v, T const & s) - { - return tvec3<T, P>( - v.x | s, - v.y | s, - v.z | s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> operator|(tvec3<T, P> const & v, tvec1<T, P> const & s) - { - return tvec3<T, P>( - v.x | s.x, - v.y | s.x, - v.z | s.x); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> operator|(T const & s, tvec3<T, P> const & v) - { - return tvec3<T, P>( - s | v.x, - s | v.y, - s | v.z); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> operator|(tvec1<T, P> const & s, tvec3<T, P> const & v) - { - return tvec3<T, P>( - s.x | v.x, - s.x | v.y, - s.x | v.z); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> operator|(tvec3<T, P> const & v1, tvec3<T, P> const & v2) - { - return tvec3<T, P>( - v1.x | v2.x, - v1.y | v2.y, - v1.z | v2.z); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> operator^(tvec3<T, P> const & v, T const & s) - { - return tvec3<T, P>( - v.x ^ s, - v.y ^ s, - v.z ^ s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> operator^(tvec3<T, P> const & v, tvec1<T, P> const & s) - { - return tvec3<T, P>( - v.x ^ s.x, - v.y ^ s.x, - v.z ^ s.x); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> operator^(T const & s, tvec3<T, P> const & v) - { - return tvec3<T, P>( - s ^ v.x, - s ^ v.y, - s ^ v.z); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> operator^(tvec1<T, P> const & s, tvec3<T, P> const & v) - { - return tvec3<T, P>( - s.x ^ v.x, - s.x ^ v.y, - s.x ^ v.z); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> operator^(tvec3<T, P> const & v1, tvec3<T, P> const & v2) - { - return tvec3<T, P>( - v1.x ^ v2.x, - v1.y ^ v2.y, - v1.z ^ v2.z); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> operator<<(tvec3<T, P> const & v, T const & s) - { - return tvec3<T, P>( - v.x << s, - v.y << s, - v.z << s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> operator<<(tvec3<T, P> const & v, tvec1<T, P> const & s) - { - return tvec3<T, P>( - v.x << s.x, - v.y << s.x, - v.z << s.x); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> operator<<(T const & s, tvec3<T, P> const & v) - { - return tvec3<T, P>( - s << v.x, - s << v.y, - s << v.z); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> operator<<(tvec1<T, P> const & s, tvec3<T, P> const & v) - { - return tvec3<T, P>( - s.x << v.x, - s.x << v.y, - s.x << v.z); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> operator<<(tvec3<T, P> const & v1, tvec3<T, P> const & v2) - { - return tvec3<T, P>( - v1.x << v2.x, - v1.y << v2.y, - v1.z << v2.z); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> operator>>(tvec3<T, P> const & v, T const & s) - { - return tvec3<T, P>( - v.x >> s, - v.y >> s, - v.z >> s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> operator>>(tvec3<T, P> const & v, tvec1<T, P> const & s) - { - return tvec3<T, P>( - v.x >> s.x, - v.y >> s.x, - v.z >> s.x); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> operator>>(T const & s, tvec3<T, P> const & v) - { - return tvec3<T, P>( - s >> v.x, - s >> v.y, - s >> v.z); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> operator>>(tvec1<T, P> const & s, tvec3<T, P> const & v) - { - return tvec3<T, P>( - s.x >> v.x, - s.x >> v.y, - s.x >> v.z); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> operator>>(tvec3<T, P> const & v1, tvec3<T, P> const & v2) - { - return tvec3<T, P>( - v1.x >> v2.x, - v1.y >> v2.y, - v1.z >> v2.z); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> operator~(tvec3<T, P> const & v) - { - return tvec3<T, P>( - ~v.x, - ~v.y, - ~v.z); - } -}//namespace glm diff --git a/extensions/common/glm/detail/type_vec4.hpp b/extensions/common/glm/detail/type_vec4.hpp deleted file mode 100644 index a06243d898e..00000000000 --- a/extensions/common/glm/detail/type_vec4.hpp +++ /dev/null @@ -1,531 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/type_vec4.hpp -/// @date 2008-08-22 / 2011-06-15 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -//#include "../fwd.hpp" -#include "setup.hpp" -#include "type_vec.hpp" -#ifdef GLM_SWIZZLE -# if GLM_HAS_ANONYMOUS_UNION -# include "_swizzle.hpp" -# else -# include "_swizzle_func.hpp" -# endif -#endif //GLM_SWIZZLE -#include <cstddef> - -namespace glm{ -namespace detail -{ - template <typename T> - struct simd - { - typedef T type[4]; - }; - -# define GLM_NOT_BUGGY_VC32BITS !(GLM_MODEL == GLM_MODEL_32 && GLM_COMPILER & GLM_COMPILER_VC && GLM_COMPILER < GLM_COMPILER_VC2013) - -# if GLM_ARCH & GLM_ARCH_SSE2 && GLM_NOT_BUGGY_VC32BITS - template <> - struct simd<float> - { - typedef __m128 type; - }; - - template <> - struct simd<int> - { - typedef __m128i type; - }; - - template <> - struct simd<unsigned int> - { - typedef __m128i type; - }; -# endif - -# if GLM_ARCH & GLM_ARCH_AVX && GLM_NOT_BUGGY_VC32BITS - template <> - struct simd<double> - { - typedef __m256d type; - }; -# endif - -# if GLM_ARCH & GLM_ARCH_AVX2 && GLM_NOT_BUGGY_VC32BITS - template <> - struct simd<int64> - { - typedef __m256i type; - }; - - template <> - struct simd<uint64> - { - typedef __m256i type; - }; -# endif - -}//namespace detail - - template <typename T, precision P = defaultp> - struct tvec4 - { - ////////////////////////////////////// - // Implementation detail - - typedef tvec4<T, P> type; - typedef tvec4<bool, P> bool_type; - typedef T value_type; - - ////////////////////////////////////// - // Data - -# if GLM_HAS_ANONYMOUS_UNION - union - { - struct { T x, y, z, w;}; - struct { T r, g, b, a; }; - struct { T s, t, p, q; }; - - typename detail::simd<T>::type data; - -# ifdef GLM_SWIZZLE - _GLM_SWIZZLE4_2_MEMBERS(T, P, tvec2, x, y, z, w) - _GLM_SWIZZLE4_2_MEMBERS(T, P, tvec2, r, g, b, a) - _GLM_SWIZZLE4_2_MEMBERS(T, P, tvec2, s, t, p, q) - _GLM_SWIZZLE4_3_MEMBERS(T, P, tvec3, x, y, z, w) - _GLM_SWIZZLE4_3_MEMBERS(T, P, tvec3, r, g, b, a) - _GLM_SWIZZLE4_3_MEMBERS(T, P, tvec3, s, t, p, q) - _GLM_SWIZZLE4_4_MEMBERS(T, P, tvec4, x, y, z, w) - _GLM_SWIZZLE4_4_MEMBERS(T, P, tvec4, r, g, b, a) - _GLM_SWIZZLE4_4_MEMBERS(T, P, tvec4, s, t, p, q) -# endif//GLM_SWIZZLE - }; -# else - union { T x, r, s; }; - union { T y, g, t; }; - union { T z, b, p; }; - union { T w, a, q; }; - -# ifdef GLM_SWIZZLE - GLM_SWIZZLE_GEN_VEC_FROM_VEC4(T, P, tvec4, tvec2, tvec3, tvec4) -# endif//GLM_SWIZZLE -# endif//GLM_LANG - - ////////////////////////////////////// - // Component accesses - -# ifdef GLM_FORCE_SIZE_FUNC - /// Return the count of components of the vector - typedef size_t size_type; - GLM_FUNC_DECL GLM_CONSTEXPR size_type size() const; - - GLM_FUNC_DECL T & operator[](size_type i); - GLM_FUNC_DECL T const & operator[](size_type i) const; -# else - /// Return the count of components of the vector - typedef length_t length_type; - GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const; - - GLM_FUNC_DECL T & operator[](length_type i); - GLM_FUNC_DECL T const & operator[](length_type i) const; -# endif//GLM_FORCE_SIZE_FUNC - - ////////////////////////////////////// - // Implicit basic constructors - - GLM_FUNC_DECL tvec4(); - GLM_FUNC_DECL tvec4(tvec4<T, P> const & v); - template <precision Q> - GLM_FUNC_DECL tvec4(tvec4<T, Q> const & v); - - ////////////////////////////////////// - // Explicit basic constructors - - GLM_FUNC_DECL explicit tvec4(ctor); - GLM_FUNC_DECL explicit tvec4(T s); - GLM_FUNC_DECL tvec4(T a, T b, T c, T d); - GLM_FUNC_DECL ~tvec4(){} - - ////////////////////////////////////// - // Conversion scalar constructors - - /// Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template <typename A, typename B, typename C, typename D> - GLM_FUNC_DECL tvec4(A a, B b, C c, D d); - template <typename A, typename B, typename C, typename D> - GLM_FUNC_DECL tvec4(tvec1<A, P> const & a, tvec1<B, P> const & b, tvec1<C, P> const & c, tvec1<D, P> const & d); - - ////////////////////////////////////// - // Conversion vector constructors - - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template <typename A, typename B, typename C, precision Q> - GLM_FUNC_DECL explicit tvec4(tvec2<A, Q> const & a, B b, C c); - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template <typename A, typename B, typename C, precision Q> - GLM_FUNC_DECL explicit tvec4(tvec2<A, Q> const & a, tvec1<B, Q> const & b, tvec1<C, Q> const & c); - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template <typename A, typename B, typename C, precision Q> - GLM_FUNC_DECL explicit tvec4(A a, tvec2<B, Q> const & b, C c); - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template <typename A, typename B, typename C, precision Q> - GLM_FUNC_DECL explicit tvec4(tvec1<A, Q> const & a, tvec2<B, Q> const & b, tvec1<C, Q> const & c); - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template <typename A, typename B, typename C, precision Q> - GLM_FUNC_DECL explicit tvec4(A a, B b, tvec2<C, Q> const & c); - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template <typename A, typename B, typename C, precision Q> - GLM_FUNC_DECL explicit tvec4(tvec1<A, Q> const & a, tvec1<B, Q> const & b, tvec2<C, Q> const & c); - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template <typename A, typename B, precision Q> - GLM_FUNC_DECL explicit tvec4(tvec3<A, Q> const & a, B b); - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template <typename A, typename B, precision Q> - GLM_FUNC_DECL explicit tvec4(tvec3<A, Q> const & a, tvec1<B, Q> const & b); - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template <typename A, typename B, precision Q> - GLM_FUNC_DECL explicit tvec4(A a, tvec3<B, Q> const & b); - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template <typename A, typename B, precision Q> - GLM_FUNC_DECL explicit tvec4(tvec1<A, Q> const & a, tvec3<B, Q> const & b); - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template <typename A, typename B, precision Q> - GLM_FUNC_DECL explicit tvec4(tvec2<A, Q> const & a, tvec2<B, Q> const & b); - -# ifdef GLM_FORCE_EXPLICIT_CTOR - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template <typename U, precision Q> - GLM_FUNC_DECL explicit tvec4(tvec4<U, Q> const & v); -# else - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template <typename U, precision Q> - GLM_FUNC_DECL tvec4(tvec4<U, Q> const & v); -# endif - - ////////////////////////////////////// - // Swizzle constructors - -# if GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE) - template <int E0, int E1, int E2, int E3> - GLM_FUNC_DECL tvec4(detail::_swizzle<4, T, P, tvec4<T, P>, E0, E1, E2, E3> const & that) - { - *this = that(); - } - - template <int E0, int E1, int F0, int F1> - GLM_FUNC_DECL tvec4(detail::_swizzle<2, T, P, tvec2<T, P>, E0, E1, -1, -2> const & v, detail::_swizzle<2, T, P, tvec2<T, P>, F0, F1, -1, -2> const & u) - { - *this = tvec4<T, P>(v(), u()); - } - - template <int E0, int E1> - GLM_FUNC_DECL tvec4(T const & x, T const & y, detail::_swizzle<2, T, P, tvec2<T, P>, E0, E1, -1, -2> const & v) - { - *this = tvec4<T, P>(x, y, v()); - } - - template <int E0, int E1> - GLM_FUNC_DECL tvec4(T const & x, detail::_swizzle<2, T, P, tvec2<T, P>, E0, E1, -1, -2> const & v, T const & w) - { - *this = tvec4<T, P>(x, v(), w); - } - - template <int E0, int E1> - GLM_FUNC_DECL tvec4(detail::_swizzle<2, T, P, tvec2<T, P>, E0, E1, -1, -2> const & v, T const & z, T const & w) - { - *this = tvec4<T, P>(v(), z, w); - } - - template <int E0, int E1, int E2> - GLM_FUNC_DECL tvec4(detail::_swizzle<3, T, P, tvec3<T, P>, E0, E1, E2, -1> const & v, T const & w) - { - *this = tvec4<T, P>(v(), w); - } - - template <int E0, int E1, int E2> - GLM_FUNC_DECL tvec4(T const & x, detail::_swizzle<3, T, P, tvec3<T, P>, E0, E1, E2, -1> const & v) - { - *this = tvec4<T, P>(x, v()); - } -# endif// GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE) - - ////////////////////////////////////// - // Unary arithmetic operators - - GLM_FUNC_DECL tvec4<T, P> & operator=(tvec4<T, P> const & v); - - template <typename U> - GLM_FUNC_DECL tvec4<T, P> & operator=(tvec4<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec4<T, P> & operator+=(U scalar); - template <typename U> - GLM_FUNC_DECL tvec4<T, P> & operator+=(tvec1<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec4<T, P> & operator+=(tvec4<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec4<T, P> & operator-=(U scalar); - template <typename U> - GLM_FUNC_DECL tvec4<T, P> & operator-=(tvec1<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec4<T, P> & operator-=(tvec4<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec4<T, P> & operator*=(U scalar); - template <typename U> - GLM_FUNC_DECL tvec4<T, P> & operator*=(tvec1<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec4<T, P> & operator*=(tvec4<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec4<T, P> & operator/=(U scalar); - template <typename U> - GLM_FUNC_DECL tvec4<T, P> & operator/=(tvec1<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec4<T, P> & operator/=(tvec4<U, P> const & v); - - ////////////////////////////////////// - // Increment and decrement operators - - GLM_FUNC_DECL tvec4<T, P> & operator++(); - GLM_FUNC_DECL tvec4<T, P> & operator--(); - GLM_FUNC_DECL tvec4<T, P> operator++(int); - GLM_FUNC_DECL tvec4<T, P> operator--(int); - - ////////////////////////////////////// - // Unary bit operators - - template <typename U> - GLM_FUNC_DECL tvec4<T, P> & operator%=(U scalar); - template <typename U> - GLM_FUNC_DECL tvec4<T, P> & operator%=(tvec1<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec4<T, P> & operator%=(tvec4<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec4<T, P> & operator&=(U scalar); - template <typename U> - GLM_FUNC_DECL tvec4<T, P> & operator&=(tvec1<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec4<T, P> & operator&=(tvec4<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec4<T, P> & operator|=(U scalar); - template <typename U> - GLM_FUNC_DECL tvec4<T, P> & operator|=(tvec1<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec4<T, P> & operator|=(tvec4<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec4<T, P> & operator^=(U scalar); - template <typename U> - GLM_FUNC_DECL tvec4<T, P> & operator^=(tvec1<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec4<T, P> & operator^=(tvec4<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec4<T, P> & operator<<=(U scalar); - template <typename U> - GLM_FUNC_DECL tvec4<T, P> & operator<<=(tvec1<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec4<T, P> & operator<<=(tvec4<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec4<T, P> & operator>>=(U scalar); - template <typename U> - GLM_FUNC_DECL tvec4<T, P> & operator>>=(tvec1<U, P> const & v); - template <typename U> - GLM_FUNC_DECL tvec4<T, P> & operator>>=(tvec4<U, P> const & v); - }; - - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> operator+(tvec4<T, P> const & v, T scalar); - - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> operator+(tvec4<T, P> const & v, tvec1<T, P> const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> operator+(T scalar, tvec4<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> operator+(tvec1<T, P> const & s, tvec4<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> operator+(tvec4<T, P> const & v1, tvec4<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> operator-(tvec4<T, P> const & v, T scalar); - - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> operator-(tvec4<T, P> const & v, tvec1<T, P> const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> operator-(T scalar, tvec4<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> operator-(tvec1<T, P> const & s, tvec4<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> operator-(tvec4<T, P> const & v1, tvec4<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> operator*(tvec4<T, P> const & v, T scalar); - - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> operator*(tvec4<T, P> const & v, tvec1<T, P> const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> operator*(T scalar, tvec4<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> operator*(tvec1<T, P> const & s, tvec4<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> operator*(tvec4<T, P> const & v1, tvec4<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> operator/(tvec4<T, P> const & v, T scalar); - - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> operator/(tvec4<T, P> const & v, tvec1<T, P> const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> operator/(T scalar, tvec4<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> operator/(tvec1<T, P> const & s, tvec4<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> operator/(tvec4<T, P> const & v1, tvec4<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> operator-(tvec4<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL bool operator==(tvec4<T, P> const & v1, tvec4<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL bool operator!=(tvec4<T, P> const & v1, tvec4<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> operator%(tvec4<T, P> const & v, T scalar); - - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> operator%(tvec4<T, P> const & v, tvec1<T, P> const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> operator%(T scalar, tvec4<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> operator%(tvec1<T, P> const & s, tvec4<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> operator%(tvec4<T, P> const & v1, tvec4<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> operator&(tvec4<T, P> const & v, T scalar); - - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> operator&(tvec4<T, P> const & v, tvec1<T, P> const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> operator&(T scalar, tvec4<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> operator&(tvec1<T, P> const & s, tvec4<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> operator&(tvec4<T, P> const & v1, tvec4<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> operator|(tvec4<T, P> const & v, T scalar); - - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> operator|(tvec4<T, P> const & v, tvec1<T, P> const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> operator|(T scalar, tvec4<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> operator|(tvec1<T, P> const & s, tvec4<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> operator|(tvec4<T, P> const & v1, tvec4<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> operator^(tvec4<T, P> const & v, T scalar); - - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> operator^(tvec4<T, P> const & v, tvec1<T, P> const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> operator^(T scalar, tvec4<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> operator^(tvec1<T, P> const & s, tvec4<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> operator^(tvec4<T, P> const & v1, tvec4<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> operator<<(tvec4<T, P> const & v, T scalar); - - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> operator<<(tvec4<T, P> const & v, tvec1<T, P> const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> operator<<(T scalar, tvec4<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> operator<<(tvec1<T, P> const & s, tvec4<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> operator<<(tvec4<T, P> const & v1, tvec4<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> operator>>(tvec4<T, P> const & v, T scalar); - - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> operator>>(tvec4<T, P> const & v, tvec1<T, P> const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> operator>>(T scalar, tvec4<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> operator>>(tvec1<T, P> const & s, tvec4<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> operator>>(tvec4<T, P> const & v1, tvec4<T, P> const & v2); - - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> operator~(tvec4<T, P> const & v); -}//namespace glm - -#ifndef GLM_EXTERNAL_TEMPLATE -#include "type_vec4.inl" -#endif//GLM_EXTERNAL_TEMPLATE diff --git a/extensions/common/glm/detail/type_vec4.inl b/extensions/common/glm/detail/type_vec4.inl deleted file mode 100644 index fbdf51fc5f3..00000000000 --- a/extensions/common/glm/detail/type_vec4.inl +++ /dev/null @@ -1,1124 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/type_tvec4.inl -/// @date 2008-08-23 / 2011-06-15 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - ////////////////////////////////////// - // Implicit basic constructors - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4() -# ifndef GLM_FORCE_NO_CTOR_INIT - : x(0), y(0), z(0), w(0) -# endif - {} - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4(tvec4<T, P> const & v) - : x(v.x), y(v.y), z(v.z), w(v.w) - {} - - template <typename T, precision P> - template <precision Q> - GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4(tvec4<T, Q> const & v) - : x(v.x), y(v.y), z(v.z), w(v.w) - {} - - ////////////////////////////////////// - // Explicit basic constructors - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4(ctor) - {} - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4(T s) - : x(s), y(s), z(s), w(s) - {} - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4(T a, T b, T c, T d) - : x(a), y(b), z(c), w(d) - {} - - ////////////////////////////////////// - // Conversion scalar constructors - - template <typename T, precision P> - template <typename A, typename B, typename C, typename D> - GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4(A a, B b, C c, D d) : - x(static_cast<T>(a)), - y(static_cast<T>(b)), - z(static_cast<T>(c)), - w(static_cast<T>(d)) - {} - - template <typename T, precision P> - template <typename A, typename B, typename C, typename D> - GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4(tvec1<A, P> const & a, tvec1<B, P> const & b, tvec1<C, P> const & c, tvec1<D, P> const & d) : - x(static_cast<T>(a.x)), - y(static_cast<T>(b.x)), - z(static_cast<T>(c.x)), - w(static_cast<T>(d.x)) - {} - - ////////////////////////////////////// - // Conversion vector constructors - - template <typename T, precision P> - template <typename A, typename B, typename C, precision Q> - GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4(tvec2<A, Q> const & a, B b, C c) : - x(static_cast<T>(a.x)), - y(static_cast<T>(a.y)), - z(static_cast<T>(b)), - w(static_cast<T>(c)) - {} - - template <typename T, precision P> - template <typename A, typename B, typename C, precision Q> - GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4(tvec2<A, Q> const & a, tvec1<B, Q> const & b, tvec1<C, Q> const & c) : - x(static_cast<T>(a.x)), - y(static_cast<T>(a.y)), - z(static_cast<T>(b.x)), - w(static_cast<T>(c.x)) - {} - - template <typename T, precision P> - template <typename A, typename B, typename C, precision Q> - GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4(A s1, tvec2<B, Q> const & v, C s2) : - x(static_cast<T>(s1)), - y(static_cast<T>(v.x)), - z(static_cast<T>(v.y)), - w(static_cast<T>(s2)) - {} - - template <typename T, precision P> - template <typename A, typename B, typename C, precision Q> - GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4(tvec1<A, Q> const & a, tvec2<B, Q> const & b, tvec1<C, Q> const & c) : - x(static_cast<T>(a.x)), - y(static_cast<T>(b.x)), - z(static_cast<T>(b.y)), - w(static_cast<T>(c.x)) - {} - - template <typename T, precision P> - template <typename A, typename B, typename C, precision Q> - GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4(A s1, B s2, tvec2<C, Q> const & v) : - x(static_cast<T>(s1)), - y(static_cast<T>(s2)), - z(static_cast<T>(v.x)), - w(static_cast<T>(v.y)) - {} - - template <typename T, precision P> - template <typename A, typename B, typename C, precision Q> - GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4(tvec1<A, Q> const & a, tvec1<B, Q> const & b, tvec2<C, Q> const & c) : - x(static_cast<T>(a.x)), - y(static_cast<T>(b.x)), - z(static_cast<T>(c.x)), - w(static_cast<T>(c.y)) - {} - - template <typename T, precision P> - template <typename A, typename B, precision Q> - GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4(tvec3<A, Q> const & a, B b) : - x(static_cast<T>(a.x)), - y(static_cast<T>(a.y)), - z(static_cast<T>(a.z)), - w(static_cast<T>(b)) - {} - - template <typename T, precision P> - template <typename A, typename B, precision Q> - GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4(tvec3<A, Q> const & a, tvec1<B, Q> const & b) : - x(static_cast<T>(a.x)), - y(static_cast<T>(a.y)), - z(static_cast<T>(a.z)), - w(static_cast<T>(b.x)) - {} - - template <typename T, precision P> - template <typename A, typename B, precision Q> - GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4(A a, tvec3<B, Q> const & b) : - x(static_cast<T>(a)), - y(static_cast<T>(b.x)), - z(static_cast<T>(b.y)), - w(static_cast<T>(b.z)) - {} - - template <typename T, precision P> - template <typename A, typename B, precision Q> - GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4(tvec1<A, Q> const & a, tvec3<B, Q> const & b) : - x(static_cast<T>(a.x)), - y(static_cast<T>(b.x)), - z(static_cast<T>(b.y)), - w(static_cast<T>(b.z)) - {} - - template <typename T, precision P> - template <typename A, typename B, precision Q> - GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4(tvec2<A, Q> const & a, tvec2<B, Q> const & b) : - x(static_cast<T>(a.x)), - y(static_cast<T>(a.y)), - z(static_cast<T>(b.x)), - w(static_cast<T>(b.y)) - {} - - template <typename T, precision P> - template <typename U, precision Q> - GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4(tvec4<U, Q> const & v) : - x(static_cast<T>(v.x)), - y(static_cast<T>(v.y)), - z(static_cast<T>(v.z)), - w(static_cast<T>(v.w)) - {} - - ////////////////////////////////////// - // Component accesses - -# ifdef GLM_FORCE_SIZE_FUNC - template <typename T, precision P> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tvec4<T, P>::size_type tvec4<T, P>::size() const - { - return 4; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER T & tvec4<T, P>::operator[](typename tvec4<T, P>::size_type i) - { - assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this)); - return (&x)[i]; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER T const & tvec4<T, P>::operator[](typename tvec4<T, P>::size_type i) const - { - assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this)); - return (&x)[i]; - } -# else - template <typename T, precision P> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tvec4<T, P>::length_type tvec4<T, P>::length() const - { - return 4; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER T & tvec4<T, P>::operator[](typename tvec4<T, P>::length_type i) - { - assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this)); - return (&x)[i]; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER T const & tvec4<T, P>::operator[](typename tvec4<T, P>::length_type i) const - { - assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this)); - return (&x)[i]; - } -# endif//GLM_FORCE_SIZE_FUNC - - ////////////////////////////////////// - // Unary arithmetic operators - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator=(tvec4<T, P> const & v) - { - this->x = v.x; - this->y = v.y; - this->z = v.z; - this->w = v.w; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator=(tvec4<U, P> const & v) - { - this->x = static_cast<T>(v.x); - this->y = static_cast<T>(v.y); - this->z = static_cast<T>(v.z); - this->w = static_cast<T>(v.w); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator+=(U scalar) - { - this->x += static_cast<T>(scalar); - this->y += static_cast<T>(scalar); - this->z += static_cast<T>(scalar); - this->w += static_cast<T>(scalar); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator+=(tvec1<U, P> const & v) - { - T const scalar = static_cast<T>(v.x); - this->x += scalar; - this->y += scalar; - this->z += scalar; - this->w += scalar; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator+=(tvec4<U, P> const & v) - { - this->x += static_cast<T>(v.x); - this->y += static_cast<T>(v.y); - this->z += static_cast<T>(v.z); - this->w += static_cast<T>(v.w); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator-=(U scalar) - { - this->x -= static_cast<T>(scalar); - this->y -= static_cast<T>(scalar); - this->z -= static_cast<T>(scalar); - this->w -= static_cast<T>(scalar); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator-=(tvec1<U, P> const & v) - { - T const scalar = static_cast<T>(v.x); - this->x -= scalar; - this->y -= scalar; - this->z -= scalar; - this->w -= scalar; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator-=(tvec4<U, P> const & v) - { - this->x -= static_cast<T>(v.x); - this->y -= static_cast<T>(v.y); - this->z -= static_cast<T>(v.z); - this->w -= static_cast<T>(v.w); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator*=(U s) - { - this->x *= static_cast<T>(s); - this->y *= static_cast<T>(s); - this->z *= static_cast<T>(s); - this->w *= static_cast<T>(s); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator*=(tvec1<U, P> const & v) - { - this->x *= static_cast<T>(v.x); - this->y *= static_cast<T>(v.x); - this->z *= static_cast<T>(v.x); - this->w *= static_cast<T>(v.x); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator*=(tvec4<U, P> const & v) - { - this->x *= static_cast<T>(v.x); - this->y *= static_cast<T>(v.y); - this->z *= static_cast<T>(v.z); - this->w *= static_cast<T>(v.w); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator/=(U s) - { - this->x /= static_cast<T>(s); - this->y /= static_cast<T>(s); - this->z /= static_cast<T>(s); - this->w /= static_cast<T>(s); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator/=(tvec1<U, P> const & v) - { - this->x /= static_cast<T>(v.x); - this->y /= static_cast<T>(v.x); - this->z /= static_cast<T>(v.x); - this->w /= static_cast<T>(v.x); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator/=(tvec4<U, P> const & v) - { - this->x /= static_cast<T>(v.x); - this->y /= static_cast<T>(v.y); - this->z /= static_cast<T>(v.z); - this->w /= static_cast<T>(v.w); - return *this; - } - - ////////////////////////////////////// - // Increment and decrement operators - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator++() - { - ++this->x; - ++this->y; - ++this->z; - ++this->w; - return *this; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator--() - { - --this->x; - --this->y; - --this->z; - --this->w; - return *this; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> tvec4<T, P>::operator++(int) - { - tvec4<T, P> Result(*this); - ++*this; - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> tvec4<T, P>::operator--(int) - { - tvec4<T, P> Result(*this); - --*this; - return Result; - } - - ////////////////////////////////////// - // Unary bit operators - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator%=(U scalar) - { - this->x %= static_cast<T>(scalar); - this->y %= static_cast<T>(scalar); - this->z %= static_cast<T>(scalar); - this->w %= static_cast<T>(scalar); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator%=(tvec1<U, P> const & v) - { - this->x %= static_cast<T>(v.x); - this->y %= static_cast<T>(v.x); - this->z %= static_cast<T>(v.x); - this->w %= static_cast<T>(v.x); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator%=(tvec4<U, P> const & v) - { - this->x %= static_cast<T>(v.x); - this->y %= static_cast<T>(v.y); - this->z %= static_cast<T>(v.z); - this->w %= static_cast<T>(v.w); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator&=(U scalar) - { - this->x &= static_cast<T>(scalar); - this->y &= static_cast<T>(scalar); - this->z &= static_cast<T>(scalar); - this->w &= static_cast<T>(scalar); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator&=(tvec1<U, P> const & v) - { - this->x &= static_cast<T>(v.x); - this->y &= static_cast<T>(v.x); - this->z &= static_cast<T>(v.x); - this->w &= static_cast<T>(v.x); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator&=(tvec4<U, P> const & v) - { - this->x &= static_cast<T>(v.x); - this->y &= static_cast<T>(v.y); - this->z &= static_cast<T>(v.z); - this->w &= static_cast<T>(v.w); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator|=(U scalar) - { - this->x |= static_cast<T>(scalar); - this->y |= static_cast<T>(scalar); - this->z |= static_cast<T>(scalar); - this->w |= static_cast<T>(scalar); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator|=(tvec1<U, P> const & v) - { - this->x |= static_cast<T>(v.x); - this->y |= static_cast<T>(v.x); - this->z |= static_cast<T>(v.x); - this->w |= static_cast<T>(v.x); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator|=(tvec4<U, P> const & v) - { - this->x |= static_cast<T>(v.x); - this->y |= static_cast<T>(v.y); - this->z |= static_cast<T>(v.z); - this->w |= static_cast<T>(v.w); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator^=(U scalar) - { - this->x ^= static_cast<T>(scalar); - this->y ^= static_cast<T>(scalar); - this->z ^= static_cast<T>(scalar); - this->w ^= static_cast<T>(scalar); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator^=(tvec1<U, P> const & v) - { - this->x ^= static_cast<T>(v.x); - this->y ^= static_cast<T>(v.x); - this->z ^= static_cast<T>(v.x); - this->w ^= static_cast<T>(v.x); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator^=(tvec4<U, P> const & v) - { - this->x ^= static_cast<T>(v.x); - this->y ^= static_cast<T>(v.y); - this->z ^= static_cast<T>(v.z); - this->w ^= static_cast<T>(v.w); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator<<=(U scalar) - { - this->x <<= static_cast<T>(scalar); - this->y <<= static_cast<T>(scalar); - this->z <<= static_cast<T>(scalar); - this->w <<= static_cast<T>(scalar); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator<<=(tvec1<U, P> const & v) - { - this->x <<= static_cast<T>(v.x); - this->y <<= static_cast<T>(v.x); - this->z <<= static_cast<T>(v.x); - this->w <<= static_cast<T>(v.x); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator<<=(tvec4<U, P> const & v) - { - this->x <<= static_cast<T>(v.x); - this->y <<= static_cast<T>(v.y); - this->z <<= static_cast<T>(v.z); - this->w <<= static_cast<T>(v.w); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator>>=(U scalar) - { - this->x >>= static_cast<T>(scalar); - this->y >>= static_cast<T>(scalar); - this->z >>= static_cast<T>(scalar); - this->w >>= static_cast<T>(scalar); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator>>=(tvec1<U, P> const & v) - { - this->x >>= static_cast<T>(v.x); - this->y >>= static_cast<T>(v.y); - this->z >>= static_cast<T>(v.z); - this->w >>= static_cast<T>(v.w); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator>>=(tvec4<U, P> const & v) - { - this->x >>= static_cast<T>(v.x); - this->y >>= static_cast<T>(v.y); - this->z >>= static_cast<T>(v.z); - this->w >>= static_cast<T>(v.w); - return *this; - } - - ////////////////////////////////////// - // Boolean operators - - template <typename T, precision P> - GLM_FUNC_QUALIFIER bool operator==(tvec4<T, P> const & v1, tvec4<T, P> const & v2) - { - return (v1.x == v2.x) && (v1.y == v2.y) && (v1.z == v2.z) && (v1.w == v2.w); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER bool operator!=(tvec4<T, P> const & v1, tvec4<T, P> const & v2) - { - return (v1.x != v2.x) || (v1.y != v2.y) || (v1.z != v2.z) || (v1.w != v2.w); - } - - ////////////////////////////////////// - // Binary arithmetic operators - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> operator+(tvec4<T, P> const & v, T scalar) - { - return tvec4<T, P>( - v.x + scalar, - v.y + scalar, - v.z + scalar, - v.w + scalar); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> operator+(T scalar, tvec4<T, P> const & v) - { - return tvec4<T, P>( - scalar + v.x, - scalar + v.y, - scalar + v.z, - scalar + v.w); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> operator+(tvec4<T, P> const & v1, tvec4<T, P> const & v2) - { - return tvec4<T, P>( - v1.x + v2.x, - v1.y + v2.y, - v1.z + v2.z, - v1.w + v2.w); - } - - //operator- - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> operator-(tvec4<T, P> const & v, T scalar) - { - return tvec4<T, P>( - v.x - scalar, - v.y - scalar, - v.z - scalar, - v.w - scalar); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> operator-(T scalar, tvec4<T, P> const & v) - { - return tvec4<T, P>( - scalar - v.x, - scalar - v.y, - scalar - v.z, - scalar - v.w); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> operator-(tvec4<T, P> const & v1, tvec4<T, P> const & v2) - { - return tvec4<T, P>( - v1.x - v2.x, - v1.y - v2.y, - v1.z - v2.z, - v1.w - v2.w); - } - - //operator* - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> operator*(tvec4<T, P> const & v, T scalar) - { - return tvec4<T, P>( - v.x * scalar, - v.y * scalar, - v.z * scalar, - v.w * scalar); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> operator*(T scalar, tvec4<T, P> const & v) - { - return tvec4<T, P>( - scalar * v.x, - scalar * v.y, - scalar * v.z, - scalar * v.w); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> operator*(tvec4<T, P> const & v1, tvec4<T, P> const & v2) - { - return tvec4<T, P>( - v1.x * v2.x, - v1.y * v2.y, - v1.z * v2.z, - v1.w * v2.w); - } - - //operator/ - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> operator/(tvec4<T, P> const & v, T scalar) - { - return tvec4<T, P>( - v.x / scalar, - v.y / scalar, - v.z / scalar, - v.w / scalar); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> operator/(T scalar, tvec4<T, P> const & v) - { - return tvec4<T, P>( - scalar / v.x, - scalar / v.y, - scalar / v.z, - scalar / v.w); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> operator/(tvec4<T, P> const & v1, tvec4<T, P> const & v2) - { - return tvec4<T, P>( - v1.x / v2.x, - v1.y / v2.y, - v1.z / v2.z, - v1.w / v2.w); - } - - // Unary constant operators - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> operator-(tvec4<T, P> const & v) - { - return tvec4<T, P>( - -v.x, - -v.y, - -v.z, - -v.w); - } - - ////////////////////////////////////// - // Binary bit operators - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> operator%(tvec4<T, P> const & v, T s) - { - return tvec4<T, P>( - v.x % s, - v.y % s, - v.z % s, - v.w % s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> operator%(tvec4<T, P> const & v, tvec1<T, P> const & s) - { - return tvec4<T, P>( - v.x % s.x, - v.y % s.x, - v.z % s.x, - v.w % s.x); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> operator%(T s, tvec4<T, P> const & v) - { - return tvec4<T, P>( - s % v.x, - s % v.y, - s % v.z, - s % v.w); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> operator%(tvec1<T, P> const & s, tvec4<T, P> const & v) - { - return tvec4<T, P>( - s.x % v.x, - s.x % v.y, - s.x % v.z, - s.x % v.w); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> operator%(tvec4<T, P> const & v1, tvec4<T, P> const & v2) - { - return tvec4<T, P>( - v1.x % v2.x, - v1.y % v2.y, - v1.z % v2.z, - v1.w % v2.w); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> operator&(tvec4<T, P> const & v, T s) - { - return tvec4<T, P>( - v.x & s, - v.y & s, - v.z & s, - v.w & s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> operator&(tvec4<T, P> const & v, tvec1<T, P> const & s) - { - return tvec4<T, P>( - v.x & s.x, - v.y & s.x, - v.z & s.x, - v.w & s.x); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> operator&(T s, tvec4<T, P> const & v) - { - return tvec4<T, P>( - s & v.x, - s & v.y, - s & v.z, - s & v.w); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> operator&(tvec1<T, P> const & s, tvec4<T, P> const & v) - { - return tvec4<T, P>( - s.x & v.x, - s.x & v.y, - s.x & v.z, - s.x & v.w); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> operator&(tvec4<T, P> const & v1, tvec4<T, P> const & v2) - { - return tvec4<T, P>( - v1.x & v2.x, - v1.y & v2.y, - v1.z & v2.z, - v1.w & v2.w); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> operator|(tvec4<T, P> const & v, T s) - { - return tvec4<T, P>( - v.x | s, - v.y | s, - v.z | s, - v.w | s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> operator|(tvec4<T, P> const & v, tvec1<T, P> const & s) - { - return tvec4<T, P>( - v.x | s.x, - v.y | s.x, - v.z | s.x, - v.w | s.x); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> operator|(T s, tvec4<T, P> const & v) - { - return tvec4<T, P>( - s | v.x, - s | v.y, - s | v.z, - s | v.w); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> operator|(tvec1<T, P> const & s, tvec4<T, P> const & v) - { - return tvec4<T, P>( - s.x | v.x, - s.x | v.y, - s.x | v.z, - s.x | v.w); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> operator|(tvec4<T, P> const & v1, tvec4<T, P> const & v2) - { - return tvec4<T, P>( - v1.x | v2.x, - v1.y | v2.y, - v1.z | v2.z, - v1.w | v2.w); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> operator^(tvec4<T, P> const & v, T s) - { - return tvec4<T, P>( - v.x ^ s, - v.y ^ s, - v.z ^ s, - v.w ^ s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> operator^(tvec4<T, P> const & v, tvec1<T, P> const & s) - { - return tvec4<T, P>( - v.x ^ s.x, - v.y ^ s.x, - v.z ^ s.x, - v.w ^ s.x); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> operator^(T scalar, tvec4<T, P> const & v) - { - return tvec4<T, P>( - scalar ^ v.x, - scalar ^ v.y, - scalar ^ v.z, - scalar ^ v.w); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> operator^(tvec1<T, P> const & s, tvec4<T, P> const & v) - { - return tvec4<T, P>( - s.x ^ v.x, - s.x ^ v.y, - s.x ^ v.z, - s.x ^ v.w); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> operator^(tvec4<T, P> const & v1, tvec4<T, P> const & v2) - { - return tvec4<T, P>( - v1.x ^ v2.x, - v1.y ^ v2.y, - v1.z ^ v2.z, - v1.w ^ v2.w); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> operator<<(tvec4<T, P> const & v, T scalar) - { - return tvec4<T, P>( - v.x << scalar, - v.y << scalar, - v.z << scalar, - v.w << scalar); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> operator<<(tvec4<T, P> const & v, tvec1<T, P> const & s) - { - return tvec4<T, P>( - v.x << s.x, - v.y << s.x, - v.z << s.x, - v.w << s.x); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> operator<<(T scalar, tvec4<T, P> const & v) - { - return tvec4<T, P>( - scalar << v.x, - scalar << v.y, - scalar << v.z, - scalar << v.w); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> operator<<(tvec1<T, P> const & s, tvec4<T, P> const & v) - { - return tvec4<T, P>( - s.x << v.x, - s.x << v.y, - s.x << v.z, - s.x << v.w); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> operator<<(tvec4<T, P> const & v1, tvec4<T, P> const & v2) - { - return tvec4<T, P>( - v1.x << v2.x, - v1.y << v2.y, - v1.z << v2.z, - v1.w << v2.w); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> operator>>(tvec4<T, P> const & v, T scalar) - { - return tvec4<T, P>( - v.x >> scalar, - v.y >> scalar, - v.z >> scalar, - v.w >> scalar); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> operator>>(tvec4<T, P> const & v, tvec1<T, P> const & s) - { - return tvec4<T, P>( - v.x >> s.x, - v.y >> s.x, - v.z >> s.x, - v.w >> s.x); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> operator>>(T scalar, tvec4<T, P> const & v) - { - return tvec4<T, P>( - scalar >> v.x, - scalar >> v.y, - scalar >> v.z, - scalar >> v.w); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> operator>>(tvec1<T, P> const & s, tvec4<T, P> const & v) - { - return tvec4<T, P>( - s.x >> v.x, - s.x >> v.y, - s.x >> v.z, - s.x >> v.w); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> operator>>(tvec4<T, P> const & v1, tvec4<T, P> const & v2) - { - return tvec4<T, P>( - v1.x >> v2.x, - v1.y >> v2.y, - v1.z >> v2.z, - v1.w >> v2.w); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> operator~(tvec4<T, P> const & v) - { - return tvec4<T, P>( - ~v.x, - ~v.y, - ~v.z, - ~v.w); - } -}//namespace glm - -#if GLM_HAS_ANONYMOUS_UNION && GLM_NOT_BUGGY_VC32BITS -#if GLM_ARCH & GLM_ARCH_SSE2 -# include "type_vec4_sse2.inl" -#endif -#if GLM_ARCH & GLM_ARCH_AVX -# include "type_vec4_avx.inl" -#endif -#if GLM_ARCH & GLM_ARCH_AVX2 -# include "type_vec4_avx2.inl" -#endif -#endif// diff --git a/extensions/common/glm/detail/type_vec4_avx.inl b/extensions/common/glm/detail/type_vec4_avx.inl deleted file mode 100644 index f2a44398a23..00000000000 --- a/extensions/common/glm/detail/type_vec4_avx.inl +++ /dev/null @@ -1,41 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/type_tvec4_avx.inl -/// @date 2014-12-01 / 2014-12-01 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -namespace glm{ -namespace detail -{ - -}//namespace detail - - - -}//namespace glm diff --git a/extensions/common/glm/detail/type_vec4_avx2.inl b/extensions/common/glm/detail/type_vec4_avx2.inl deleted file mode 100644 index fda75e516c2..00000000000 --- a/extensions/common/glm/detail/type_vec4_avx2.inl +++ /dev/null @@ -1,41 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/type_tvec4_avx2.inl -/// @date 2014-12-01 / 2014-12-01 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -namespace glm{ -namespace detail -{ - -}//namespace detail - - - -}//namespace glm diff --git a/extensions/common/glm/detail/type_vec4_sse2.inl b/extensions/common/glm/detail/type_vec4_sse2.inl deleted file mode 100644 index 002446f2931..00000000000 --- a/extensions/common/glm/detail/type_vec4_sse2.inl +++ /dev/null @@ -1,120 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/type_tvec4_sse2.inl -/// @date 2014-12-01 / 2014-12-01 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -namespace glm{ -namespace detail -{ - -}//namespace detail - - template <> - GLM_FUNC_QUALIFIER tvec4<float, lowp>::tvec4() -# ifndef GLM_FORCE_NO_CTOR_INIT - : data(_mm_setzero_ps()) -# endif - {} - - template <> - GLM_FUNC_QUALIFIER tvec4<float, mediump>::tvec4() -# ifndef GLM_FORCE_NO_CTOR_INIT - : data(_mm_setzero_ps()) -# endif - {} - - template <> - GLM_FUNC_QUALIFIER tvec4<float, lowp>::tvec4(float s) : - data(_mm_set1_ps(s)) - {} - - template <> - GLM_FUNC_QUALIFIER tvec4<float, mediump>::tvec4(float s) : - data(_mm_set1_ps(s)) - {} - - template <> - GLM_FUNC_QUALIFIER tvec4<float, lowp>::tvec4(float a, float b, float c, float d) : - data(_mm_set_ps(d, c, b, a)) - {} - - template <> - GLM_FUNC_QUALIFIER tvec4<float, mediump>::tvec4(float a, float b, float c, float d) : - data(_mm_set_ps(d, c, b, a)) - {} - - template <> - template <typename U> - GLM_FUNC_QUALIFIER tvec4<float, lowp> & tvec4<float, lowp>::operator+=(U scalar) - { - this->data = _mm_add_ps(this->data, _mm_set_ps1(static_cast<float>(scalar))); - return *this; - } - - template <> - template <> - GLM_FUNC_QUALIFIER tvec4<float, lowp> & tvec4<float, lowp>::operator+=<float>(float scalar) - { - this->data = _mm_add_ps(this->data, _mm_set_ps1(scalar)); - return *this; - } - - template <> - template <typename U> - GLM_FUNC_QUALIFIER tvec4<float, mediump> & tvec4<float, mediump>::operator+=(U scalar) - { - this->data = _mm_add_ps(this->data, _mm_set_ps1(static_cast<float>(scalar))); - return *this; - } - - template <> - template <> - GLM_FUNC_QUALIFIER tvec4<float, mediump> & tvec4<float, mediump>::operator+=<float>(float scalar) - { - this->data = _mm_add_ps(this->data, _mm_set_ps1(scalar)); - return *this; - } - - template <> - template <typename U> - GLM_FUNC_QUALIFIER tvec4<float, lowp> & tvec4<float, lowp>::operator+=(tvec1<U, lowp> const & v) - { - this->data = _mm_add_ps(this->data, _mm_set_ps1(static_cast<float>(v.x))); - return *this; - } - - template <> - template <typename U> - GLM_FUNC_QUALIFIER tvec4<float, mediump> & tvec4<float, mediump>::operator+=(tvec1<U, mediump> const & v) - { - this->data = _mm_add_ps(this->data, _mm_set_ps1(static_cast<float>(v.x))); - return *this; - } -}//namespace glm diff --git a/extensions/common/glm/exponential.hpp b/extensions/common/glm/exponential.hpp deleted file mode 100644 index df48f65c5e1..00000000000 --- a/extensions/common/glm/exponential.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/exponential.hpp -/// @date 2013-12-24 / 2013-12-24 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "detail/func_exponential.hpp" diff --git a/extensions/common/glm/ext.hpp b/extensions/common/glm/ext.hpp deleted file mode 100644 index 93933fc1a50..00000000000 --- a/extensions/common/glm/ext.hpp +++ /dev/null @@ -1,143 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @file glm/glm.hpp -/// @date 2009-05-01 / 2011-05-16 -/// @author Christophe Riccio -/// -/// @ref core (Dependence) -/// -/// @defgroup gtc GTC Extensions (Stable) -/// -/// @brief Functions and types that the GLSL specification doesn't define, but useful to have for a C++ program. -/// -/// GTC extensions aim to be stable. -/// -/// Even if it's highly unrecommended, it's possible to include all the extensions at once by -/// including <glm/ext.hpp>. Otherwise, each extension needs to be included a specific file. -/// -/// @defgroup gtx GTX Extensions (Experimental) -/// -/// @brief Functions and types that the GLSL specification doesn't define, but -/// useful to have for a C++ program. -/// -/// Experimental extensions are useful functions and types, but the development of -/// their API and functionality is not necessarily stable. They can change -/// substantially between versions. Backwards compatibility is not much of an issue -/// for them. -/// -/// Even if it's highly unrecommended, it's possible to include all the extensions -/// at once by including <glm/ext.hpp>. Otherwise, each extension needs to be -/// included a specific file. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#if(defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_EXT_INCLUDED_DISPLAYED)) -# define GLM_MESSAGE_EXT_INCLUDED_DISPLAYED -# pragma message("GLM: All extensions included (not recommanded)") -#endif//GLM_MESSAGES - -#include "./gtc/bitfield.hpp" -#include "./gtc/constants.hpp" -#include "./gtc/epsilon.hpp" -#include "./gtc/integer.hpp" -#include "./gtc/matrix_access.hpp" -#include "./gtc/matrix_integer.hpp" -#include "./gtc/matrix_inverse.hpp" -#include "./gtc/matrix_transform.hpp" -#include "./gtc/noise.hpp" -#include "./gtc/packing.hpp" -#include "./gtc/quaternion.hpp" -#include "./gtc/random.hpp" -#include "./gtc/reciprocal.hpp" -#include "./gtc/round.hpp" -#include "./gtc/type_precision.hpp" -#include "./gtc/type_ptr.hpp" -#include "./gtc/ulp.hpp" -#include "./gtc/vec1.hpp" - -#include "./gtx/associated_min_max.hpp" -#include "./gtx/bit.hpp" -#include "./gtx/closest_point.hpp" -#include "./gtx/color_space.hpp" -#include "./gtx/color_space_YCoCg.hpp" -#include "./gtx/compatibility.hpp" -#include "./gtx/component_wise.hpp" -#include "./gtx/dual_quaternion.hpp" -#include "./gtx/euler_angles.hpp" -#include "./gtx/extend.hpp" -#include "./gtx/extented_min_max.hpp" -#include "./gtx/fast_exponential.hpp" -#include "./gtx/fast_square_root.hpp" -#include "./gtx/fast_trigonometry.hpp" -#include "./gtx/gradient_paint.hpp" -#include "./gtx/handed_coordinate_space.hpp" -#include "./gtx/integer.hpp" -#include "./gtx/intersect.hpp" -#include "./gtx/log_base.hpp" -#include "./gtx/matrix_cross_product.hpp" -#include "./gtx/matrix_interpolation.hpp" -#include "./gtx/matrix_major_storage.hpp" -#include "./gtx/matrix_operation.hpp" -#include "./gtx/matrix_query.hpp" -#include "./gtx/mixed_product.hpp" -#include "./gtx/norm.hpp" -#include "./gtx/normal.hpp" -#include "./gtx/normalize_dot.hpp" -#include "./gtx/number_precision.hpp" -#include "./gtx/optimum_pow.hpp" -#include "./gtx/orthonormalize.hpp" -#include "./gtx/perpendicular.hpp" -#include "./gtx/polar_coordinates.hpp" -#include "./gtx/projection.hpp" -#include "./gtx/quaternion.hpp" -#include "./gtx/raw_data.hpp" -#include "./gtx/rotate_vector.hpp" -#include "./gtx/spline.hpp" -#include "./gtx/std_based_type.hpp" -#if !(GLM_COMPILER & GLM_COMPILER_CUDA) -# include "./gtx/string_cast.hpp" -#endif -#include "./gtx/transform.hpp" -#include "./gtx/transform2.hpp" -#include "./gtx/type_aligned.hpp" -#include "./gtx/vector_angle.hpp" -#include "./gtx/vector_query.hpp" -#include "./gtx/wrap.hpp" - -#if GLM_HAS_TEMPLATE_ALIASES -# include "./gtx/scalar_multiplication.hpp" -#endif - -#if GLM_HAS_RANGE_FOR -# include "./gtx/range.hpp" -#endif - -#if GLM_ARCH & GLM_ARCH_SSE2 -# include "./gtx/simd_vec4.hpp" -# include "./gtx/simd_mat4.hpp" -#endif diff --git a/extensions/common/glm/fwd.hpp b/extensions/common/glm/fwd.hpp deleted file mode 100644 index f7d57b19834..00000000000 --- a/extensions/common/glm/fwd.hpp +++ /dev/null @@ -1,2601 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/fwd.hpp -/// @date 2013-03-30 / 2013-03-31 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "detail/type_int.hpp" -#include "detail/type_float.hpp" -#include "detail/type_vec.hpp" -#include "detail/type_mat.hpp" - -////////////////////// -// GLM_GTC_quaternion -namespace glm -{ - template <typename T, precision P> struct tquat; - - /// Quaternion of low single-precision floating-point numbers. - /// - /// @see gtc_quaternion - typedef tquat<float, lowp> lowp_quat; - - /// Quaternion of medium single-precision floating-point numbers. - /// - /// @see gtc_quaternion - typedef tquat<float, mediump> mediump_quat; - - /// Quaternion of high single-precision floating-point numbers. - /// - /// @see gtc_quaternion - typedef tquat<float, highp> highp_quat; - -#if(defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT)) - typedef highp_quat quat; -#elif(!defined(GLM_PRECISION_HIGHP_FLOAT) && defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT)) - typedef mediump_quat quat; -#elif(!defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && defined(GLM_PRECISION_LOWP_FLOAT)) - typedef lowp_quat quat; -#elif(!defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT)) - /// Quaternion of default single-precision floating-point numbers. - typedef highp_quat quat; -#endif - - /// Quaternion of low single-precision floating-point numbers. - /// - /// @see gtc_quaternion - typedef lowp_quat lowp_fquat; - - /// Quaternion of medium single-precision floating-point numbers. - /// - /// @see gtc_quaternion - typedef mediump_quat mediump_fquat; - - /// Quaternion of high single-precision floating-point numbers. - /// - /// @see gtc_quaternion - typedef highp_quat highp_fquat; - - /// Quaternion of default single-precision floating-point numbers. - /// - /// @see gtc_quaternion - typedef quat fquat; - - - /// Quaternion of low double-precision floating-point numbers. - /// - /// @see gtc_quaternion - typedef tquat<double, lowp> lowp_dquat; - - /// Quaternion of medium double-precision floating-point numbers. - /// - /// @see gtc_quaternion - typedef tquat<double, mediump> mediump_dquat; - - /// Quaternion of high double-precision floating-point numbers. - /// - /// @see gtc_quaternion - typedef tquat<double, highp> highp_dquat; - -#if(defined(GLM_PRECISION_HIGHP_DOUBLE) && !defined(GLM_PRECISION_MEDIUMP_DOUBLE) && !defined(GLM_PRECISION_LOWP_DOUBLE)) - typedef highp_dquat dquat; -#elif(!defined(GLM_PRECISION_HIGHP_DOUBLE) && defined(GLM_PRECISION_MEDIUMP_DOUBLE) && !defined(GLM_PRECISION_LOWP_DOUBLE)) - typedef mediump_dquat dquat; -#elif(!defined(GLM_PRECISION_HIGHP_DOUBLE) && !defined(GLM_PRECISION_MEDIUMP_DOUBLE) && defined(GLM_PRECISION_LOWP_DOUBLE)) - typedef lowp_dquat dquat; -#elif(!defined(GLM_PRECISION_HIGHP_DOUBLE) && !defined(GLM_PRECISION_MEDIUMP_DOUBLE) && !defined(GLM_PRECISION_LOWP_DOUBLE)) - /// Quaternion of default double-precision floating-point numbers. - /// - /// @see gtc_quaternion - typedef highp_dquat dquat; -#endif - -}//namespace glm - -////////////////////// -// GLM_GTC_precision -namespace glm -{ - /// @addtogroup gtc_type_precision - /// @{ - - /// Low precision 8 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int8 lowp_int8; - - /// Low precision 16 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int16 lowp_int16; - - /// Low precision 32 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int32 lowp_int32; - - /// Low precision 64 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int64 lowp_int64; - - /// Low precision 8 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int8 lowp_int8_t; - - /// Low precision 16 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int16 lowp_int16_t; - - /// Low precision 32 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int32 lowp_int32_t; - - /// Low precision 64 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int64 lowp_int64_t; - - /// Low precision 8 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int8 lowp_i8; - - /// Low precision 16 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int16 lowp_i16; - - /// Low precision 32 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int32 lowp_i32; - - /// Low precision 64 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int64 lowp_i64; - - /// Medium precision 8 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int8 mediump_int8; - - /// Medium precision 16 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int16 mediump_int16; - - /// Medium precision 32 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int32 mediump_int32; - - /// Medium precision 64 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int64 mediump_int64; - - /// Medium precision 8 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int8 mediump_int8_t; - - /// Medium precision 16 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int16 mediump_int16_t; - - /// Medium precision 32 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int32 mediump_int32_t; - - /// Medium precision 64 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int64 mediump_int64_t; - - /// Medium precision 8 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int8 mediump_i8; - - /// Medium precision 16 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int16 mediump_i16; - - /// Medium precision 32 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int32 mediump_i32; - - /// Medium precision 64 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int64 mediump_i64; - - /// High precision 8 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int8 highp_int8; - - /// High precision 16 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int16 highp_int16; - - /// High precision 32 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int32 highp_int32; - - /// High precision 64 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int64 highp_int64; - - /// High precision 8 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int8 highp_int8_t; - - /// High precision 16 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int16 highp_int16_t; - - /// 32 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int32 highp_int32_t; - - /// High precision 64 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int64 highp_int64_t; - - /// High precision 8 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int8 highp_i8; - - /// High precision 16 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int16 highp_i16; - - /// High precision 32 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int32 highp_i32; - - /// High precision 64 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int64 highp_i64; - - - /// 8 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int8 int8; - - /// 16 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int16 int16; - - /// 32 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int32 int32; - - /// 64 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int64 int64; - - -#if GLM_HAS_EXTENDED_INTEGER_TYPE - using std::int8_t; - using std::int16_t; - using std::int32_t; - using std::int64_t; -#else - /// 8 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int8 int8_t; - - /// 16 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int16 int16_t; - - /// 32 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int32 int32_t; - - /// 64 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int64 int64_t; -#endif - - /// 8 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int8 i8; - - /// 16 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int16 i16; - - /// 32 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int32 i32; - - /// 64 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int64 i64; - - - - /// Low precision 8 bit signed integer scalar type. - /// @see gtc_type_precision - typedef tvec1<i8, lowp> lowp_i8vec1; - - /// Low precision 8 bit signed integer vector of 2 components type. - /// @see gtc_type_precision - typedef tvec2<i8, lowp> lowp_i8vec2; - - /// Low precision 8 bit signed integer vector of 3 components type. - /// @see gtc_type_precision - typedef tvec3<i8, lowp> lowp_i8vec3; - - /// Low precision 8 bit signed integer vector of 4 components type. - /// @see gtc_type_precision - typedef tvec4<i8, lowp> lowp_i8vec4; - - - /// Medium precision 8 bit signed integer scalar type. - /// @see gtc_type_precision - typedef tvec1<i8, mediump> mediump_i8vec1; - - /// Medium precision 8 bit signed integer vector of 2 components type. - /// @see gtc_type_precision - typedef tvec2<i8, mediump> mediump_i8vec2; - - /// Medium precision 8 bit signed integer vector of 3 components type. - /// @see gtc_type_precision - typedef tvec3<i8, mediump> mediump_i8vec3; - - /// Medium precision 8 bit signed integer vector of 4 components type. - /// @see gtc_type_precision - typedef tvec4<i8, mediump> mediump_i8vec4; - - - /// High precision 8 bit signed integer scalar type. - /// @see gtc_type_precision - typedef tvec1<i8, highp> highp_i8vec1; - - /// High precision 8 bit signed integer vector of 2 components type. - /// @see gtc_type_precision - typedef tvec2<i8, highp> highp_i8vec2; - - /// High precision 8 bit signed integer vector of 3 components type. - /// @see gtc_type_precision - typedef tvec3<i8, highp> highp_i8vec3; - - /// High precision 8 bit signed integer vector of 4 components type. - /// @see gtc_type_precision - typedef tvec4<i8, highp> highp_i8vec4; - -#if(defined(GLM_PRECISION_LOWP_INT)) - typedef lowp_i8vec1 i8vec1; - typedef lowp_i8vec2 i8vec2; - typedef lowp_i8vec3 i8vec3; - typedef lowp_i8vec4 i8vec4; -#elif(defined(GLM_PRECISION_MEDIUMP_INT)) - typedef mediump_i8vec1 i8vec1; - typedef mediump_i8vec2 i8vec2; - typedef mediump_i8vec3 i8vec3; - typedef mediump_i8vec4 i8vec4; -#else - /// Default precision 8 bit signed integer scalar type. - /// @see gtc_type_precision - typedef highp_i8vec1 i8vec1; - - /// Default precision 8 bit signed integer vector of 2 components type. - /// @see gtc_type_precision - typedef highp_i8vec2 i8vec2; - - /// Default precision 8 bit signed integer vector of 3 components type. - /// @see gtc_type_precision - typedef highp_i8vec3 i8vec3; - - /// Default precision 8 bit signed integer vector of 4 components type. - /// @see gtc_type_precision - typedef highp_i8vec4 i8vec4; -#endif - - - /// Low precision 16 bit signed integer scalar type. - /// @see gtc_type_precision - typedef tvec1<i16, lowp> lowp_i16vec1; - - /// Low precision 16 bit signed integer vector of 2 components type. - /// @see gtc_type_precision - typedef tvec2<i16, lowp> lowp_i16vec2; - - /// Low precision 16 bit signed integer vector of 3 components type. - /// @see gtc_type_precision - typedef tvec3<i16, lowp> lowp_i16vec3; - - /// Low precision 16 bit signed integer vector of 4 components type. - /// @see gtc_type_precision - typedef tvec4<i16, lowp> lowp_i16vec4; - - - /// Medium precision 16 bit signed integer scalar type. - /// @see gtc_type_precision - typedef tvec1<i16, mediump> mediump_i16vec1; - - /// Medium precision 16 bit signed integer vector of 2 components type. - /// @see gtc_type_precision - typedef tvec2<i16, mediump> mediump_i16vec2; - - /// Medium precision 16 bit signed integer vector of 3 components type. - /// @see gtc_type_precision - typedef tvec3<i16, mediump> mediump_i16vec3; - - /// Medium precision 16 bit signed integer vector of 4 components type. - /// @see gtc_type_precision - typedef tvec4<i16, mediump> mediump_i16vec4; - - - /// High precision 16 bit signed integer scalar type. - /// @see gtc_type_precision - typedef tvec1<i16, highp> highp_i16vec1; - - /// High precision 16 bit signed integer vector of 2 components type. - /// @see gtc_type_precision - typedef tvec2<i16, highp> highp_i16vec2; - - /// High precision 16 bit signed integer vector of 3 components type. - /// @see gtc_type_precision - typedef tvec3<i16, highp> highp_i16vec3; - - /// High precision 16 bit signed integer vector of 4 components type. - /// @see gtc_type_precision - typedef tvec4<i16, highp> highp_i16vec4; - - -#if(defined(GLM_PRECISION_LOWP_INT)) - typedef lowp_i16vec1 i16vec1; - typedef lowp_i16vec2 i16vec2; - typedef lowp_i16vec3 i16vec3; - typedef lowp_i16vec4 i16vec4; -#elif(defined(GLM_PRECISION_MEDIUMP_INT)) - typedef mediump_i16vec1 i16vec1; - typedef mediump_i16vec2 i16vec2; - typedef mediump_i16vec3 i16vec3; - typedef mediump_i16vec4 i16vec4; -#else - /// Default precision 16 bit signed integer scalar type. - /// @see gtc_type_precision - typedef highp_i16vec1 i16vec1; - - /// Default precision 16 bit signed integer vector of 2 components type. - /// @see gtc_type_precision - typedef highp_i16vec2 i16vec2; - - /// Default precision 16 bit signed integer vector of 3 components type. - /// @see gtc_type_precision - typedef highp_i16vec3 i16vec3; - - /// Default precision 16 bit signed integer vector of 4 components type. - /// @see gtc_type_precision - typedef highp_i16vec4 i16vec4; -#endif - - - /// Low precision 32 bit signed integer scalar type. - /// @see gtc_type_precision - typedef tvec1<i32, lowp> lowp_i32vec1; - - /// Low precision 32 bit signed integer vector of 2 components type. - /// @see gtc_type_precision - typedef tvec2<i32, lowp> lowp_i32vec2; - - /// Low precision 32 bit signed integer vector of 3 components type. - /// @see gtc_type_precision - typedef tvec3<i32, lowp> lowp_i32vec3; - - /// Low precision 32 bit signed integer vector of 4 components type. - /// @see gtc_type_precision - typedef tvec4<i32, lowp> lowp_i32vec4; - - - /// Medium precision 32 bit signed integer scalar type. - /// @see gtc_type_precision - typedef tvec1<i32, mediump> mediump_i32vec1; - - /// Medium precision 32 bit signed integer vector of 2 components type. - /// @see gtc_type_precision - typedef tvec2<i32, mediump> mediump_i32vec2; - - /// Medium precision 32 bit signed integer vector of 3 components type. - /// @see gtc_type_precision - typedef tvec3<i32, mediump> mediump_i32vec3; - - /// Medium precision 32 bit signed integer vector of 4 components type. - /// @see gtc_type_precision - typedef tvec4<i32, mediump> mediump_i32vec4; - - - /// High precision 32 bit signed integer scalar type. - /// @see gtc_type_precision - typedef tvec1<i32, highp> highp_i32vec1; - - /// High precision 32 bit signed integer vector of 2 components type. - /// @see gtc_type_precision - typedef tvec2<i32, highp> highp_i32vec2; - - /// High precision 32 bit signed integer vector of 3 components type. - /// @see gtc_type_precision - typedef tvec3<i32, highp> highp_i32vec3; - - /// High precision 32 bit signed integer vector of 4 components type. - /// @see gtc_type_precision - typedef tvec4<i32, highp> highp_i32vec4; - -#if(defined(GLM_PRECISION_LOWP_INT)) - typedef lowp_i32vec1 i32vec1; - typedef lowp_i32vec2 i32vec2; - typedef lowp_i32vec3 i32vec3; - typedef lowp_i32vec4 i32vec4; -#elif(defined(GLM_PRECISION_MEDIUMP_INT)) - typedef mediump_i32vec1 i32vec1; - typedef mediump_i32vec2 i32vec2; - typedef mediump_i32vec3 i32vec3; - typedef mediump_i32vec4 i32vec4; -#else - /// Default precision 32 bit signed integer scalar type. - /// @see gtc_type_precision - typedef highp_i32vec1 i32vec1; - - /// Default precision 32 bit signed integer vector of 2 components type. - /// @see gtc_type_precision - typedef highp_i32vec2 i32vec2; - - /// Default precision 32 bit signed integer vector of 3 components type. - /// @see gtc_type_precision - typedef highp_i32vec3 i32vec3; - - /// Default precision 32 bit signed integer vector of 4 components type. - /// @see gtc_type_precision - typedef highp_i32vec4 i32vec4; -#endif - - - /// Low precision 32 bit signed integer scalar type. - /// @see gtc_type_precision - typedef tvec1<i32, lowp> lowp_i32vec1; - - /// Low precision 32 bit signed integer vector of 2 components type. - /// @see gtc_type_precision - typedef tvec2<i32, lowp> lowp_i32vec2; - - /// Low precision 32 bit signed integer vector of 3 components type. - /// @see gtc_type_precision - typedef tvec3<i32, lowp> lowp_i32vec3; - - /// Low precision 32 bit signed integer vector of 4 components type. - /// @see gtc_type_precision - typedef tvec4<i32, lowp> lowp_i32vec4; - - - /// Medium precision 32 bit signed integer scalar type. - /// @see gtc_type_precision - typedef tvec1<i32, mediump> mediump_i32vec1; - - /// Medium precision 32 bit signed integer vector of 2 components type. - /// @see gtc_type_precision - typedef tvec2<i32, mediump> mediump_i32vec2; - - /// Medium precision 32 bit signed integer vector of 3 components type. - /// @see gtc_type_precision - typedef tvec3<i32, mediump> mediump_i32vec3; - - /// Medium precision 32 bit signed integer vector of 4 components type. - /// @see gtc_type_precision - typedef tvec4<i32, mediump> mediump_i32vec4; - - - /// High precision 32 bit signed integer scalar type. - /// @see gtc_type_precision - typedef tvec1<i32, highp> highp_i32vec1; - - /// High precision 32 bit signed integer vector of 2 components type. - /// @see gtc_type_precision - typedef tvec2<i32, highp> highp_i32vec2; - - /// High precision 32 bit signed integer vector of 3 components type. - /// @see gtc_type_precision - typedef tvec3<i32, highp> highp_i32vec3; - - /// High precision 32 bit signed integer vector of 4 components type. - /// @see gtc_type_precision - typedef tvec4<i32, highp> highp_i32vec4; - -#if(defined(GLM_PRECISION_LOWP_INT)) - typedef lowp_i32vec1 i32vec1; - typedef lowp_i32vec2 i32vec2; - typedef lowp_i32vec3 i32vec3; - typedef lowp_i32vec4 i32vec4; -#elif(defined(GLM_PRECISION_MEDIUMP_INT)) - typedef mediump_i32vec1 i32vec1; - typedef mediump_i32vec2 i32vec2; - typedef mediump_i32vec3 i32vec3; - typedef mediump_i32vec4 i32vec4; -#else - /// Default precision 32 bit signed integer scalar type. - /// @see gtc_type_precision - typedef highp_i32vec1 i32vec1; - - /// Default precision 32 bit signed integer vector of 2 components type. - /// @see gtc_type_precision - typedef highp_i32vec2 i32vec2; - - /// Default precision 32 bit signed integer vector of 3 components type. - /// @see gtc_type_precision - typedef highp_i32vec3 i32vec3; - - /// Default precision 32 bit signed integer vector of 4 components type. - /// @see gtc_type_precision - typedef highp_i32vec4 i32vec4; -#endif - - - - /// Low precision 64 bit signed integer scalar type. - /// @see gtc_type_precision - typedef tvec1<i64, lowp> lowp_i64vec1; - - /// Low precision 64 bit signed integer vector of 2 components type. - /// @see gtc_type_precision - typedef tvec2<i64, lowp> lowp_i64vec2; - - /// Low precision 64 bit signed integer vector of 3 components type. - /// @see gtc_type_precision - typedef tvec3<i64, lowp> lowp_i64vec3; - - /// Low precision 64 bit signed integer vector of 4 components type. - /// @see gtc_type_precision - typedef tvec4<i64, lowp> lowp_i64vec4; - - - /// Medium precision 64 bit signed integer scalar type. - /// @see gtc_type_precision - typedef tvec1<i64, mediump> mediump_i64vec1; - - /// Medium precision 64 bit signed integer vector of 2 components type. - /// @see gtc_type_precision - typedef tvec2<i64, mediump> mediump_i64vec2; - - /// Medium precision 64 bit signed integer vector of 3 components type. - /// @see gtc_type_precision - typedef tvec3<i64, mediump> mediump_i64vec3; - - /// Medium precision 64 bit signed integer vector of 4 components type. - /// @see gtc_type_precision - typedef tvec4<i64, mediump> mediump_i64vec4; - - - /// High precision 64 bit signed integer scalar type. - /// @see gtc_type_precision - typedef tvec1<i64, highp> highp_i64vec1; - - /// High precision 64 bit signed integer vector of 2 components type. - /// @see gtc_type_precision - typedef tvec2<i64, highp> highp_i64vec2; - - /// High precision 64 bit signed integer vector of 3 components type. - /// @see gtc_type_precision - typedef tvec3<i64, highp> highp_i64vec3; - - /// High precision 64 bit signed integer vector of 4 components type. - /// @see gtc_type_precision - typedef tvec4<i64, highp> highp_i64vec4; - -#if(defined(GLM_PRECISION_LOWP_INT)) - typedef lowp_i64vec1 i64vec1; - typedef lowp_i64vec2 i64vec2; - typedef lowp_i64vec3 i64vec3; - typedef lowp_i64vec4 i64vec4; -#elif(defined(GLM_PRECISION_MEDIUMP_INT)) - typedef mediump_i64vec1 i64vec1; - typedef mediump_i64vec2 i64vec2; - typedef mediump_i64vec3 i64vec3; - typedef mediump_i64vec4 i64vec4; -#else - /// Default precision 64 bit signed integer scalar type. - /// @see gtc_type_precision - typedef highp_i64vec1 i64vec1; - - /// Default precision 64 bit signed integer vector of 2 components type. - /// @see gtc_type_precision - typedef highp_i64vec2 i64vec2; - - /// Default precision 64 bit signed integer vector of 3 components type. - /// @see gtc_type_precision - typedef highp_i64vec3 i64vec3; - - /// Default precision 64 bit signed integer vector of 4 components type. - /// @see gtc_type_precision - typedef highp_i64vec4 i64vec4; -#endif - - - ///////////////////////////// - // Unsigned int vector types - - /// Low precision 8 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint8 lowp_uint8; - - /// Low precision 16 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint16 lowp_uint16; - - /// Low precision 32 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint32 lowp_uint32; - - /// Low precision 64 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint64 lowp_uint64; - - - /// Low precision 8 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint8 lowp_uint8_t; - - /// Low precision 16 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint16 lowp_uint16_t; - - /// Low precision 32 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint32 lowp_uint32_t; - - /// Low precision 64 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint64 lowp_uint64_t; - - - /// Low precision 8 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint8 lowp_u8; - - /// Low precision 16 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint16 lowp_u16; - - /// Low precision 32 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint32 lowp_u32; - - /// Low precision 64 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint64 lowp_u64; - - - - /// Medium precision 8 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint8 mediump_uint8; - - /// Medium precision 16 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint16 mediump_uint16; - - /// Medium precision 32 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint32 mediump_uint32; - - /// Medium precision 64 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint64 mediump_uint64; - - /// Medium precision 8 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint8 mediump_uint8_t; - - /// Medium precision 16 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint16 mediump_uint16_t; - - /// Medium precision 32 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint32 mediump_uint32_t; - - /// Medium precision 64 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint64 mediump_uint64_t; - - /// Medium precision 8 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint8 mediump_u8; - - /// Medium precision 16 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint16 mediump_u16; - - /// Medium precision 32 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint32 mediump_u32; - - /// Medium precision 64 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint64 mediump_u64; - - - - /// Medium precision 8 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint8 highp_uint8; - - /// Medium precision 16 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint16 highp_uint16; - - /// Medium precision 32 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint32 highp_uint32; - - /// Medium precision 64 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint64 highp_uint64; - - /// Medium precision 8 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint8 highp_uint8_t; - - /// Medium precision 16 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint16 highp_uint16_t; - - /// Medium precision 32 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint32 highp_uint32_t; - - /// Medium precision 64 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint64 highp_uint64_t; - - /// Medium precision 8 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint8 highp_u8; - - /// Medium precision 16 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint16 highp_u16; - - /// Medium precision 32 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint32 highp_u32; - - /// Medium precision 64 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint64 highp_u64; - - - - /// 8 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint8 uint8; - - /// 16 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint16 uint16; - - /// 32 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint32 uint32; - - /// 64 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint64 uint64; - -#if GLM_HAS_EXTENDED_INTEGER_TYPE - using std::uint8_t; - using std::uint16_t; - using std::uint32_t; - using std::uint64_t; -#else - /// 8 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint8 uint8_t; - - /// 16 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint16 uint16_t; - - /// 32 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint32 uint32_t; - - /// 64 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint64 uint64_t; -#endif - - /// 8 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint8 u8; - - /// 16 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint16 u16; - - /// 32 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint32 u32; - - /// 64 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint64 u64; - - - - /// Low precision 8 bit unsigned integer scalar type. - /// @see gtc_type_precision - typedef tvec1<u8, lowp> lowp_u8vec1; - - /// Low precision 8 bit unsigned integer vector of 2 components type. - /// @see gtc_type_precision - typedef tvec2<u8, lowp> lowp_u8vec2; - - /// Low precision 8 bit unsigned integer vector of 3 components type. - /// @see gtc_type_precision - typedef tvec3<u8, lowp> lowp_u8vec3; - - /// Low precision 8 bit unsigned integer vector of 4 components type. - /// @see gtc_type_precision - typedef tvec4<u8, lowp> lowp_u8vec4; - - - /// Medium precision 8 bit unsigned integer scalar type. - /// @see gtc_type_precision - typedef tvec1<u8, mediump> mediump_u8vec1; - - /// Medium precision 8 bit unsigned integer vector of 2 components type. - /// @see gtc_type_precision - typedef tvec2<u8, mediump> mediump_u8vec2; - - /// Medium precision 8 bit unsigned integer vector of 3 components type. - /// @see gtc_type_precision - typedef tvec3<u8, mediump> mediump_u8vec3; - - /// Medium precision 8 bit unsigned integer vector of 4 components type. - /// @see gtc_type_precision - typedef tvec4<u8, mediump> mediump_u8vec4; - - - /// High precision 8 bit unsigned integer scalar type. - /// @see gtc_type_precision - typedef tvec1<u8, highp> highp_u8vec1; - - /// High precision 8 bit unsigned integer vector of 2 components type. - /// @see gtc_type_precision - typedef tvec2<u8, highp> highp_u8vec2; - - /// High precision 8 bit unsigned integer vector of 3 components type. - /// @see gtc_type_precision - typedef tvec3<u8, highp> highp_u8vec3; - - /// High precision 8 bit unsigned integer vector of 4 components type. - /// @see gtc_type_precision - typedef tvec4<u8, highp> highp_u8vec4; - -#if(defined(GLM_PRECISION_LOWP_INT)) - typedef lowp_u8vec1 u8vec1; - typedef lowp_u8vec2 u8vec2; - typedef lowp_u8vec3 u8vec3; - typedef lowp_u8vec4 u8vec4; -#elif(defined(GLM_PRECISION_MEDIUMP_INT)) - typedef mediump_u8vec1 u8vec1; - typedef mediump_u8vec2 u8vec2; - typedef mediump_u8vec3 u8vec3; - typedef mediump_u8vec4 u8vec4; -#else - /// Default precision 8 bit unsigned integer scalar type. - /// @see gtc_type_precision - typedef highp_u8vec1 u8vec1; - - /// Default precision 8 bit unsigned integer vector of 2 components type. - /// @see gtc_type_precision - typedef highp_u8vec2 u8vec2; - - /// Default precision 8 bit unsigned integer vector of 3 components type. - /// @see gtc_type_precision - typedef highp_u8vec3 u8vec3; - - /// Default precision 8 bit unsigned integer vector of 4 components type. - /// @see gtc_type_precision - typedef highp_u8vec4 u8vec4; -#endif - - - /// Low precision 16 bit unsigned integer scalar type. - /// @see gtc_type_precision - typedef tvec1<u16, lowp> lowp_u16vec1; - - /// Low precision 16 bit unsigned integer vector of 2 components type. - /// @see gtc_type_precision - typedef tvec2<u16, lowp> lowp_u16vec2; - - /// Low precision 16 bit unsigned integer vector of 3 components type. - /// @see gtc_type_precision - typedef tvec3<u16, lowp> lowp_u16vec3; - - /// Low precision 16 bit unsigned integer vector of 4 components type. - /// @see gtc_type_precision - typedef tvec4<u16, lowp> lowp_u16vec4; - - - /// Medium precision 16 bit unsigned integer scalar type. - /// @see gtc_type_precision - typedef tvec1<u16, mediump> mediump_u16vec1; - - /// Medium precision 16 bit unsigned integer vector of 2 components type. - /// @see gtc_type_precision - typedef tvec2<u16, mediump> mediump_u16vec2; - - /// Medium precision 16 bit unsigned integer vector of 3 components type. - /// @see gtc_type_precision - typedef tvec3<u16, mediump> mediump_u16vec3; - - /// Medium precision 16 bit unsigned integer vector of 4 components type. - /// @see gtc_type_precision - typedef tvec4<u16, mediump> mediump_u16vec4; - - - /// High precision 16 bit unsigned integer scalar type. - /// @see gtc_type_precision - typedef tvec1<u16, highp> highp_u16vec1; - - /// High precision 16 bit unsigned integer vector of 2 components type. - /// @see gtc_type_precision - typedef tvec2<u16, highp> highp_u16vec2; - - /// High precision 16 bit unsigned integer vector of 3 components type. - /// @see gtc_type_precision - typedef tvec3<u16, highp> highp_u16vec3; - - /// High precision 16 bit unsigned integer vector of 4 components type. - /// @see gtc_type_precision - typedef tvec4<u16, highp> highp_u16vec4; - - -#if(defined(GLM_PRECISION_LOWP_INT)) - typedef lowp_u16vec1 u16vec1; - typedef lowp_u16vec2 u16vec2; - typedef lowp_u16vec3 u16vec3; - typedef lowp_u16vec4 u16vec4; -#elif(defined(GLM_PRECISION_MEDIUMP_INT)) - typedef mediump_u16vec1 u16vec1; - typedef mediump_u16vec2 u16vec2; - typedef mediump_u16vec3 u16vec3; - typedef mediump_u16vec4 u16vec4; -#else - /// Default precision 16 bit unsigned integer scalar type. - /// @see gtc_type_precision - typedef highp_u16vec1 u16vec1; - - /// Default precision 16 bit unsigned integer vector of 2 components type. - /// @see gtc_type_precision - typedef highp_u16vec2 u16vec2; - - /// Default precision 16 bit unsigned integer vector of 3 components type. - /// @see gtc_type_precision - typedef highp_u16vec3 u16vec3; - - /// Default precision 16 bit unsigned integer vector of 4 components type. - /// @see gtc_type_precision - typedef highp_u16vec4 u16vec4; -#endif - - - /// Low precision 32 bit unsigned integer scalar type. - /// @see gtc_type_precision - typedef tvec1<u32, lowp> lowp_u32vec1; - - /// Low precision 32 bit unsigned integer vector of 2 components type. - /// @see gtc_type_precision - typedef tvec2<u32, lowp> lowp_u32vec2; - - /// Low precision 32 bit unsigned integer vector of 3 components type. - /// @see gtc_type_precision - typedef tvec3<u32, lowp> lowp_u32vec3; - - /// Low precision 32 bit unsigned integer vector of 4 components type. - /// @see gtc_type_precision - typedef tvec4<u32, lowp> lowp_u32vec4; - - - /// Medium precision 32 bit unsigned integer scalar type. - /// @see gtc_type_precision - typedef tvec1<u32, mediump> mediump_u32vec1; - - /// Medium precision 32 bit unsigned integer vector of 2 components type. - /// @see gtc_type_precision - typedef tvec2<u32, mediump> mediump_u32vec2; - - /// Medium precision 32 bit unsigned integer vector of 3 components type. - /// @see gtc_type_precision - typedef tvec3<u32, mediump> mediump_u32vec3; - - /// Medium precision 32 bit unsigned integer vector of 4 components type. - /// @see gtc_type_precision - typedef tvec4<u32, mediump> mediump_u32vec4; - - - /// High precision 32 bit unsigned integer scalar type. - /// @see gtc_type_precision - typedef tvec1<u32, highp> highp_u32vec1; - - /// High precision 32 bit unsigned integer vector of 2 components type. - /// @see gtc_type_precision - typedef tvec2<u32, highp> highp_u32vec2; - - /// High precision 32 bit unsigned integer vector of 3 components type. - /// @see gtc_type_precision - typedef tvec3<u32, highp> highp_u32vec3; - - /// High precision 32 bit unsigned integer vector of 4 components type. - /// @see gtc_type_precision - typedef tvec4<u32, highp> highp_u32vec4; - -#if(defined(GLM_PRECISION_LOWP_INT)) - typedef lowp_u32vec1 u32vec1; - typedef lowp_u32vec2 u32vec2; - typedef lowp_u32vec3 u32vec3; - typedef lowp_u32vec4 u32vec4; -#elif(defined(GLM_PRECISION_MEDIUMP_INT)) - typedef mediump_u32vec1 u32vec1; - typedef mediump_u32vec2 u32vec2; - typedef mediump_u32vec3 u32vec3; - typedef mediump_u32vec4 u32vec4; -#else - /// Default precision 32 bit unsigned integer scalar type. - /// @see gtc_type_precision - typedef highp_u32vec1 u32vec1; - - /// Default precision 32 bit unsigned integer vector of 2 components type. - /// @see gtc_type_precision - typedef highp_u32vec2 u32vec2; - - /// Default precision 32 bit unsigned integer vector of 3 components type. - /// @see gtc_type_precision - typedef highp_u32vec3 u32vec3; - - /// Default precision 32 bit unsigned integer vector of 4 components type. - /// @see gtc_type_precision - typedef highp_u32vec4 u32vec4; -#endif - - - /// Low precision 32 bit unsigned integer scalar type. - /// @see gtc_type_precision - typedef tvec1<u32, lowp> lowp_u32vec1; - - /// Low precision 32 bit unsigned integer vector of 2 components type. - /// @see gtc_type_precision - typedef tvec2<u32, lowp> lowp_u32vec2; - - /// Low precision 32 bit unsigned integer vector of 3 components type. - /// @see gtc_type_precision - typedef tvec3<u32, lowp> lowp_u32vec3; - - /// Low precision 32 bit unsigned integer vector of 4 components type. - /// @see gtc_type_precision - typedef tvec4<u32, lowp> lowp_u32vec4; - - - /// Medium precision 32 bit unsigned integer scalar type. - /// @see gtc_type_precision - typedef tvec1<u32, mediump> mediump_u32vec1; - - /// Medium precision 32 bit unsigned integer vector of 2 components type. - /// @see gtc_type_precision - typedef tvec2<u32, mediump> mediump_u32vec2; - - /// Medium precision 32 bit unsigned integer vector of 3 components type. - /// @see gtc_type_precision - typedef tvec3<u32, mediump> mediump_u32vec3; - - /// Medium precision 32 bit unsigned integer vector of 4 components type. - /// @see gtc_type_precision - typedef tvec4<u32, mediump> mediump_u32vec4; - - - /// High precision 32 bit unsigned integer scalar type. - /// @see gtc_type_precision - typedef tvec1<u32, highp> highp_u32vec1; - - /// High precision 32 bit unsigned integer vector of 2 components type. - /// @see gtc_type_precision - typedef tvec2<u32, highp> highp_u32vec2; - - /// High precision 32 bit unsigned integer vector of 3 components type. - /// @see gtc_type_precision - typedef tvec3<u32, highp> highp_u32vec3; - - /// High precision 32 bit unsigned integer vector of 4 components type. - /// @see gtc_type_precision - typedef tvec4<u32, highp> highp_u32vec4; - -#if(defined(GLM_PRECISION_LOWP_INT)) - typedef lowp_u32vec1 u32vec1; - typedef lowp_u32vec2 u32vec2; - typedef lowp_u32vec3 u32vec3; - typedef lowp_u32vec4 u32vec4; -#elif(defined(GLM_PRECISION_MEDIUMP_INT)) - typedef mediump_u32vec1 u32vec1; - typedef mediump_u32vec2 u32vec2; - typedef mediump_u32vec3 u32vec3; - typedef mediump_u32vec4 u32vec4; -#else - /// Default precision 32 bit unsigned integer scalar type. - /// @see gtc_type_precision - typedef highp_u32vec1 u32vec1; - - /// Default precision 32 bit unsigned integer vector of 2 components type. - /// @see gtc_type_precision - typedef highp_u32vec2 u32vec2; - - /// Default precision 32 bit unsigned integer vector of 3 components type. - /// @see gtc_type_precision - typedef highp_u32vec3 u32vec3; - - /// Default precision 32 bit unsigned integer vector of 4 components type. - /// @see gtc_type_precision - typedef highp_u32vec4 u32vec4; -#endif - - - - /// Low precision 64 bit unsigned integer scalar type. - /// @see gtc_type_precision - typedef tvec1<u64, lowp> lowp_u64vec1; - - /// Low precision 64 bit unsigned integer vector of 2 components type. - /// @see gtc_type_precision - typedef tvec2<u64, lowp> lowp_u64vec2; - - /// Low precision 64 bit unsigned integer vector of 3 components type. - /// @see gtc_type_precision - typedef tvec3<u64, lowp> lowp_u64vec3; - - /// Low precision 64 bit unsigned integer vector of 4 components type. - /// @see gtc_type_precision - typedef tvec4<u64, lowp> lowp_u64vec4; - - - /// Medium precision 64 bit unsigned integer scalar type. - /// @see gtc_type_precision - typedef tvec1<u64, mediump> mediump_u64vec1; - - /// Medium precision 64 bit unsigned integer vector of 2 components type. - /// @see gtc_type_precision - typedef tvec2<u64, mediump> mediump_u64vec2; - - /// Medium precision 64 bit unsigned integer vector of 3 components type. - /// @see gtc_type_precision - typedef tvec3<u64, mediump> mediump_u64vec3; - - /// Medium precision 64 bit unsigned integer vector of 4 components type. - /// @see gtc_type_precision - typedef tvec4<u64, mediump> mediump_u64vec4; - - - /// High precision 64 bit unsigned integer scalar type. - /// @see gtc_type_precision - typedef tvec1<u64, highp> highp_u64vec1; - - /// High precision 64 bit unsigned integer vector of 2 components type. - /// @see gtc_type_precision - typedef tvec2<u64, highp> highp_u64vec2; - - /// High precision 64 bit unsigned integer vector of 3 components type. - /// @see gtc_type_precision - typedef tvec3<u64, highp> highp_u64vec3; - - /// High precision 64 bit unsigned integer vector of 4 components type. - /// @see gtc_type_precision - typedef tvec4<u64, highp> highp_u64vec4; - -#if(defined(GLM_PRECISION_LOWP_UINT)) - typedef lowp_u64vec1 u64vec1; - typedef lowp_u64vec2 u64vec2; - typedef lowp_u64vec3 u64vec3; - typedef lowp_u64vec4 u64vec4; -#elif(defined(GLM_PRECISION_MEDIUMP_UINT)) - typedef mediump_u64vec1 u64vec1; - typedef mediump_u64vec2 u64vec2; - typedef mediump_u64vec3 u64vec3; - typedef mediump_u64vec4 u64vec4; -#else - /// Default precision 64 bit unsigned integer scalar type. - /// @see gtc_type_precision - typedef highp_u64vec1 u64vec1; - - /// Default precision 64 bit unsigned integer vector of 2 components type. - /// @see gtc_type_precision - typedef highp_u64vec2 u64vec2; - - /// Default precision 64 bit unsigned integer vector of 3 components type. - /// @see gtc_type_precision - typedef highp_u64vec3 u64vec3; - - /// Default precision 64 bit unsigned integer vector of 4 components type. - /// @see gtc_type_precision - typedef highp_u64vec4 u64vec4; -#endif - - - ////////////////////// - // Float vector types - - /// Low 32 bit single-precision floating-point scalar. - /// @see gtc_type_precision - typedef detail::float32 lowp_float32; - - /// Low 64 bit double-precision floating-point scalar. - /// @see gtc_type_precision - typedef detail::float64 lowp_float64; - - /// Low 32 bit single-precision floating-point scalar. - /// @see gtc_type_precision - typedef detail::float32 lowp_float32_t; - - /// Low 64 bit double-precision floating-point scalar. - /// @see gtc_type_precision - typedef detail::float64 lowp_float64_t; - - /// Low 32 bit single-precision floating-point scalar. - /// @see gtc_type_precision - typedef float32 lowp_f32; - - /// Low 64 bit double-precision floating-point scalar. - /// @see gtc_type_precision - typedef float64 lowp_f64; - - /// Low 32 bit single-precision floating-point scalar. - /// @see gtc_type_precision - typedef detail::float32 lowp_float32; - - /// Low 64 bit double-precision floating-point scalar. - /// @see gtc_type_precision - typedef detail::float64 lowp_float64; - - /// Low 32 bit single-precision floating-point scalar. - /// @see gtc_type_precision - typedef detail::float32 lowp_float32_t; - - /// Low 64 bit double-precision floating-point scalar. - /// @see gtc_type_precision - typedef detail::float64 lowp_float64_t; - - /// Low 32 bit single-precision floating-point scalar. - /// @see gtc_type_precision - typedef float32 lowp_f32; - - /// Low 64 bit double-precision floating-point scalar. - /// @see gtc_type_precision - typedef float64 lowp_f64; - - - /// Low 32 bit single-precision floating-point scalar. - /// @see gtc_type_precision - typedef detail::float32 lowp_float32; - - /// Low 64 bit double-precision floating-point scalar. - /// @see gtc_type_precision - typedef detail::float64 lowp_float64; - - /// Low 32 bit single-precision floating-point scalar. - /// @see gtc_type_precision - typedef detail::float32 lowp_float32_t; - - /// Low 64 bit double-precision floating-point scalar. - /// @see gtc_type_precision - typedef detail::float64 lowp_float64_t; - - /// Low 32 bit single-precision floating-point scalar. - /// @see gtc_type_precision - typedef float32 lowp_f32; - - /// Low 64 bit double-precision floating-point scalar. - /// @see gtc_type_precision - typedef float64 lowp_f64; - - - /// Medium 32 bit single-precision floating-point scalar. - /// @see gtc_type_precision - typedef detail::float32 mediump_float32; - - /// Medium 64 bit double-precision floating-point scalar. - /// @see gtc_type_precision - typedef detail::float64 mediump_float64; - - /// Medium 32 bit single-precision floating-point scalar. - /// @see gtc_type_precision - typedef detail::float32 mediump_float32_t; - - /// Medium 64 bit double-precision floating-point scalar. - /// @see gtc_type_precision - typedef detail::float64 mediump_float64_t; - - /// Medium 32 bit single-precision floating-point scalar. - /// @see gtc_type_precision - typedef float32 mediump_f32; - - /// Medium 64 bit double-precision floating-point scalar. - /// @see gtc_type_precision - typedef float64 mediump_f64; - - - /// High 32 bit single-precision floating-point scalar. - /// @see gtc_type_precision - typedef detail::float32 highp_float32; - - /// High 64 bit double-precision floating-point scalar. - /// @see gtc_type_precision - typedef detail::float64 highp_float64; - - /// High 32 bit single-precision floating-point scalar. - /// @see gtc_type_precision - typedef detail::float32 highp_float32_t; - - /// High 64 bit double-precision floating-point scalar. - /// @see gtc_type_precision - typedef detail::float64 highp_float64_t; - - /// High 32 bit single-precision floating-point scalar. - /// @see gtc_type_precision - typedef float32 highp_f32; - - /// High 64 bit double-precision floating-point scalar. - /// @see gtc_type_precision - typedef float64 highp_f64; - - -#if(defined(GLM_PRECISION_LOWP_FLOAT)) - /// Default 32 bit single-precision floating-point scalar. - /// @see gtc_type_precision - typedef lowp_float32 float32; - - /// Default 64 bit double-precision floating-point scalar. - /// @see gtc_type_precision - typedef lowp_float64 float64; - - /// Default 32 bit single-precision floating-point scalar. - /// @see gtc_type_precision - typedef lowp_float32_t float32_t; - - /// Default 64 bit double-precision floating-point scalar. - /// @see gtc_type_precision - typedef lowp_float64_t float64_t; - - /// Default 32 bit single-precision floating-point scalar. - /// @see gtc_type_precision - typedef lowp_f32 f32; - - /// Default 64 bit double-precision floating-point scalar. - /// @see gtc_type_precision - typedef lowp_f64 f64; - -#elif(defined(GLM_PRECISION_MEDIUMP_FLOAT)) - - /// Default 32 bit single-precision floating-point scalar. - /// @see gtc_type_precision - typedef mediump_float32 float32; - - /// Default 64 bit double-precision floating-point scalar. - /// @see gtc_type_precision - typedef mediump_float64 float64; - - /// Default 32 bit single-precision floating-point scalar. - /// @see gtc_type_precision - typedef mediump_float32 float32_t; - - /// Default 64 bit double-precision floating-point scalar. - /// @see gtc_type_precision - typedef mediump_float64 float64_t; - - /// Default 32 bit single-precision floating-point scalar. - /// @see gtc_type_precision - typedef mediump_float32 f32; - - /// Default 64 bit double-precision floating-point scalar. - /// @see gtc_type_precision - typedef mediump_float64 f64; - -#else//(defined(GLM_PRECISION_HIGHP_FLOAT)) - - /// Default 32 bit single-precision floating-point scalar. - /// @see gtc_type_precision - typedef highp_float32 float32; - - /// Default 64 bit double-precision floating-point scalar. - /// @see gtc_type_precision - typedef highp_float64 float64; - - /// Default 32 bit single-precision floating-point scalar. - /// @see gtc_type_precision - typedef highp_float32_t float32_t; - - /// Default 64 bit double-precision floating-point scalar. - /// @see gtc_type_precision - typedef highp_float64_t float64_t; - - /// Default 32 bit single-precision floating-point scalar. - /// @see gtc_type_precision - typedef highp_float32_t f32; - - /// Default 64 bit double-precision floating-point scalar. - /// @see gtc_type_precision - typedef highp_float64_t f64; -#endif - - - /// Low single-precision floating-point vector of 1 component. - /// @see gtc_type_precision - typedef tvec1<float, lowp> lowp_vec1; - - /// Low single-precision floating-point vector of 2 components. - /// @see gtc_type_precision - typedef tvec2<float, lowp> lowp_vec2; - - /// Low single-precision floating-point vector of 3 components. - /// @see gtc_type_precision - typedef tvec3<float, lowp> lowp_vec3; - - /// Low single-precision floating-point vector of 4 components. - /// @see gtc_type_precision - typedef tvec4<float, lowp> lowp_vec4; - - /// Low single-precision floating-point vector of 1 component. - /// @see gtc_type_precision - typedef tvec1<float, lowp> lowp_fvec1; - - /// Low single-precision floating-point vector of 2 components. - /// @see gtc_type_precision - typedef tvec2<float, lowp> lowp_fvec2; - - /// Low single-precision floating-point vector of 3 components. - /// @see gtc_type_precision - typedef tvec3<float, lowp> lowp_fvec3; - - /// Low single-precision floating-point vector of 4 components. - /// @see gtc_type_precision - typedef tvec4<float, lowp> lowp_fvec4; - - - /// Medium single-precision floating-point vector of 1 component. - /// @see gtc_type_precision - typedef tvec1<float, mediump> mediump_vec1; - - /// Medium Single-precision floating-point vector of 2 components. - /// @see gtc_type_precision - typedef tvec2<float, mediump> mediump_vec2; - - /// Medium Single-precision floating-point vector of 3 components. - /// @see gtc_type_precision - typedef tvec3<float, mediump> mediump_vec3; - - /// Medium Single-precision floating-point vector of 4 components. - /// @see gtc_type_precision - typedef tvec4<float, mediump> mediump_vec4; - - /// Medium single-precision floating-point vector of 1 component. - /// @see gtc_type_precision - typedef tvec1<float, mediump> mediump_fvec1; - - /// Medium Single-precision floating-point vector of 2 components. - /// @see gtc_type_precision - typedef tvec2<float, mediump> mediump_fvec2; - - /// Medium Single-precision floating-point vector of 3 components. - /// @see gtc_type_precision - typedef tvec3<float, mediump> mediump_fvec3; - - /// Medium Single-precision floating-point vector of 4 components. - /// @see gtc_type_precision - typedef tvec4<float, mediump> mediump_fvec4; - - - /// High single-precision floating-point vector of 1 component. - /// @see gtc_type_precision - typedef tvec1<float, highp> highp_vec1; - - /// High Single-precision floating-point vector of 2 components. - /// @see gtc_type_precision - typedef tvec2<float, highp> highp_vec2; - - /// High Single-precision floating-point vector of 3 components. - /// @see gtc_type_precision - typedef tvec3<float, highp> highp_vec3; - - /// High Single-precision floating-point vector of 4 components. - /// @see gtc_type_precision - typedef tvec4<float, highp> highp_vec4; - - /// High single-precision floating-point vector of 1 component. - /// @see gtc_type_precision - typedef tvec1<float, highp> highp_fvec1; - - /// High Single-precision floating-point vector of 2 components. - /// @see gtc_type_precision - typedef tvec2<float, highp> highp_fvec2; - - /// High Single-precision floating-point vector of 3 components. - /// @see gtc_type_precision - typedef tvec3<float, highp> highp_fvec3; - - /// High Single-precision floating-point vector of 4 components. - /// @see gtc_type_precision - typedef tvec4<float, highp> highp_fvec4; - - - /// Low single-precision floating-point vector of 1 component. - /// @see gtc_type_precision - typedef tvec1<f32, lowp> lowp_f32vec1; - - /// Low single-precision floating-point vector of 2 components. - /// @see gtc_type_precision - typedef tvec2<f32, lowp> lowp_f32vec2; - - /// Low single-precision floating-point vector of 3 components. - /// @see gtc_type_precision - typedef tvec3<f32, lowp> lowp_f32vec3; - - /// Low single-precision floating-point vector of 4 components. - /// @see gtc_type_precision - typedef tvec4<f32, lowp> lowp_f32vec4; - - /// Medium single-precision floating-point vector of 1 component. - /// @see gtc_type_precision - typedef tvec1<f32, mediump> mediump_f32vec1; - - /// Medium single-precision floating-point vector of 2 components. - /// @see gtc_type_precision - typedef tvec2<f32, mediump> mediump_f32vec2; - - /// Medium single-precision floating-point vector of 3 components. - /// @see gtc_type_precision - typedef tvec3<f32, mediump> mediump_f32vec3; - - /// Medium single-precision floating-point vector of 4 components. - /// @see gtc_type_precision - typedef tvec4<f32, mediump> mediump_f32vec4; - - /// High single-precision floating-point vector of 1 component. - /// @see gtc_type_precision - typedef tvec1<f32, highp> highp_f32vec1; - - /// High single-precision floating-point vector of 2 components. - /// @see gtc_type_precision - typedef tvec2<f32, highp> highp_f32vec2; - - /// High single-precision floating-point vector of 3 components. - /// @see gtc_type_precision - typedef tvec3<f32, highp> highp_f32vec3; - - /// High single-precision floating-point vector of 4 components. - /// @see gtc_type_precision - typedef tvec4<f32, highp> highp_f32vec4; - - - /// Low double-precision floating-point vector of 1 component. - /// @see gtc_type_precision - typedef tvec1<f64, lowp> lowp_f64vec1; - - /// Low double-precision floating-point vector of 2 components. - /// @see gtc_type_precision - typedef tvec2<f64, lowp> lowp_f64vec2; - - /// Low double-precision floating-point vector of 3 components. - /// @see gtc_type_precision - typedef tvec3<f64, lowp> lowp_f64vec3; - - /// Low double-precision floating-point vector of 4 components. - /// @see gtc_type_precision - typedef tvec4<f64, lowp> lowp_f64vec4; - - /// Medium double-precision floating-point vector of 1 component. - /// @see gtc_type_precision - typedef tvec1<f64, mediump> mediump_f64vec1; - - /// Medium double-precision floating-point vector of 2 components. - /// @see gtc_type_precision - typedef tvec2<f64, mediump> mediump_f64vec2; - - /// Medium double-precision floating-point vector of 3 components. - /// @see gtc_type_precision - typedef tvec3<f64, mediump> mediump_f64vec3; - - /// Medium double-precision floating-point vector of 4 components. - /// @see gtc_type_precision - typedef tvec4<f64, mediump> mediump_f64vec4; - - /// High double-precision floating-point vector of 1 component. - /// @see gtc_type_precision - typedef tvec1<f64, highp> highp_f64vec1; - - /// High double-precision floating-point vector of 2 components. - /// @see gtc_type_precision - typedef tvec2<f64, highp> highp_f64vec2; - - /// High double-precision floating-point vector of 3 components. - /// @see gtc_type_precision - typedef tvec3<f64, highp> highp_f64vec3; - - /// High double-precision floating-point vector of 4 components. - /// @see gtc_type_precision - typedef tvec4<f64, highp> highp_f64vec4; - - - ////////////////////// - // Float matrix types - - /// Low single-precision floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef lowp_f32 lowp_fmat1x1; - - /// Low single-precision floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef tmat2x2<f32, lowp> lowp_fmat2x2; - - /// Low single-precision floating-point 2x3 matrix. - /// @see gtc_type_precision - typedef tmat2x3<f32, lowp> lowp_fmat2x3; - - /// Low single-precision floating-point 2x4 matrix. - /// @see gtc_type_precision - typedef tmat2x4<f32, lowp> lowp_fmat2x4; - - /// Low single-precision floating-point 3x2 matrix. - /// @see gtc_type_precision - typedef tmat3x2<f32, lowp> lowp_fmat3x2; - - /// Low single-precision floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef tmat3x3<f32, lowp> lowp_fmat3x3; - - /// Low single-precision floating-point 3x4 matrix. - /// @see gtc_type_precision - typedef tmat3x4<f32, lowp> lowp_fmat3x4; - - /// Low single-precision floating-point 4x2 matrix. - /// @see gtc_type_precision - typedef tmat4x2<f32, lowp> lowp_fmat4x2; - - /// Low single-precision floating-point 4x3 matrix. - /// @see gtc_type_precision - typedef tmat4x3<f32, lowp> lowp_fmat4x3; - - /// Low single-precision floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef tmat4x4<f32, lowp> lowp_fmat4x4; - - /// Low single-precision floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef lowp_fmat1x1 lowp_fmat1; - - /// Low single-precision floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef lowp_fmat2x2 lowp_fmat2; - - /// Low single-precision floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef lowp_fmat3x3 lowp_fmat3; - - /// Low single-precision floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef lowp_fmat4x4 lowp_fmat4; - - - /// Medium single-precision floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef mediump_f32 mediump_fmat1x1; - - /// Medium single-precision floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef tmat2x2<f32, mediump> mediump_fmat2x2; - - /// Medium single-precision floating-point 2x3 matrix. - /// @see gtc_type_precision - typedef tmat2x3<f32, mediump> mediump_fmat2x3; - - /// Medium single-precision floating-point 2x4 matrix. - /// @see gtc_type_precision - typedef tmat2x4<f32, mediump> mediump_fmat2x4; - - /// Medium single-precision floating-point 3x2 matrix. - /// @see gtc_type_precision - typedef tmat3x2<f32, mediump> mediump_fmat3x2; - - /// Medium single-precision floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef tmat3x3<f32, mediump> mediump_fmat3x3; - - /// Medium single-precision floating-point 3x4 matrix. - /// @see gtc_type_precision - typedef tmat3x4<f32, mediump> mediump_fmat3x4; - - /// Medium single-precision floating-point 4x2 matrix. - /// @see gtc_type_precision - typedef tmat4x2<f32, mediump> mediump_fmat4x2; - - /// Medium single-precision floating-point 4x3 matrix. - /// @see gtc_type_precision - typedef tmat4x3<f32, mediump> mediump_fmat4x3; - - /// Medium single-precision floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef tmat4x4<f32, mediump> mediump_fmat4x4; - - /// Medium single-precision floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef mediump_fmat1x1 mediump_fmat1; - - /// Medium single-precision floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef mediump_fmat2x2 mediump_fmat2; - - /// Medium single-precision floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef mediump_fmat3x3 mediump_fmat3; - - /// Medium single-precision floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef mediump_fmat4x4 mediump_fmat4; - - - /// High single-precision floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef highp_f32 highp_fmat1x1; - - /// High single-precision floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef tmat2x2<f32, highp> highp_fmat2x2; - - /// High single-precision floating-point 2x3 matrix. - /// @see gtc_type_precision - typedef tmat2x3<f32, highp> highp_fmat2x3; - - /// High single-precision floating-point 2x4 matrix. - /// @see gtc_type_precision - typedef tmat2x4<f32, highp> highp_fmat2x4; - - /// High single-precision floating-point 3x2 matrix. - /// @see gtc_type_precision - typedef tmat3x2<f32, highp> highp_fmat3x2; - - /// High single-precision floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef tmat3x3<f32, highp> highp_fmat3x3; - - /// High single-precision floating-point 3x4 matrix. - /// @see gtc_type_precision - typedef tmat3x4<f32, highp> highp_fmat3x4; - - /// High single-precision floating-point 4x2 matrix. - /// @see gtc_type_precision - typedef tmat4x2<f32, highp> highp_fmat4x2; - - /// High single-precision floating-point 4x3 matrix. - /// @see gtc_type_precision - typedef tmat4x3<f32, highp> highp_fmat4x3; - - /// High single-precision floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef tmat4x4<f32, highp> highp_fmat4x4; - - /// High single-precision floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef highp_fmat1x1 highp_fmat1; - - /// High single-precision floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef highp_fmat2x2 highp_fmat2; - - /// High single-precision floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef highp_fmat3x3 highp_fmat3; - - /// High single-precision floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef highp_fmat4x4 highp_fmat4; - - - /// Low single-precision floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef f32 lowp_f32mat1x1; - - /// Low single-precision floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef tmat2x2<f32, lowp> lowp_f32mat2x2; - - /// Low single-precision floating-point 2x3 matrix. - /// @see gtc_type_precision - typedef tmat2x3<f32, lowp> lowp_f32mat2x3; - - /// Low single-precision floating-point 2x4 matrix. - /// @see gtc_type_precision - typedef tmat2x4<f32, lowp> lowp_f32mat2x4; - - /// Low single-precision floating-point 3x2 matrix. - /// @see gtc_type_precision - typedef tmat3x2<f32, lowp> lowp_f32mat3x2; - - /// Low single-precision floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef tmat3x3<f32, lowp> lowp_f32mat3x3; - - /// Low single-precision floating-point 3x4 matrix. - /// @see gtc_type_precision - typedef tmat3x4<f32, lowp> lowp_f32mat3x4; - - /// Low single-precision floating-point 4x2 matrix. - /// @see gtc_type_precision - typedef tmat4x2<f32, lowp> lowp_f32mat4x2; - - /// Low single-precision floating-point 4x3 matrix. - /// @see gtc_type_precision - typedef tmat4x3<f32, lowp> lowp_f32mat4x3; - - /// Low single-precision floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef tmat4x4<f32, lowp> lowp_f32mat4x4; - - /// Low single-precision floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef detail::tmat1x1<f32, lowp> lowp_f32mat1; - - /// Low single-precision floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef lowp_f32mat2x2 lowp_f32mat2; - - /// Low single-precision floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef lowp_f32mat3x3 lowp_f32mat3; - - /// Low single-precision floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef lowp_f32mat4x4 lowp_f32mat4; - - - /// High single-precision floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef f32 mediump_f32mat1x1; - - /// Low single-precision floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef tmat2x2<f32, mediump> mediump_f32mat2x2; - - /// Medium single-precision floating-point 2x3 matrix. - /// @see gtc_type_precision - typedef tmat2x3<f32, mediump> mediump_f32mat2x3; - - /// Medium single-precision floating-point 2x4 matrix. - /// @see gtc_type_precision - typedef tmat2x4<f32, mediump> mediump_f32mat2x4; - - /// Medium single-precision floating-point 3x2 matrix. - /// @see gtc_type_precision - typedef tmat3x2<f32, mediump> mediump_f32mat3x2; - - /// Medium single-precision floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef tmat3x3<f32, mediump> mediump_f32mat3x3; - - /// Medium single-precision floating-point 3x4 matrix. - /// @see gtc_type_precision - typedef tmat3x4<f32, mediump> mediump_f32mat3x4; - - /// Medium single-precision floating-point 4x2 matrix. - /// @see gtc_type_precision - typedef tmat4x2<f32, mediump> mediump_f32mat4x2; - - /// Medium single-precision floating-point 4x3 matrix. - /// @see gtc_type_precision - typedef tmat4x3<f32, mediump> mediump_f32mat4x3; - - /// Medium single-precision floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef tmat4x4<f32, mediump> mediump_f32mat4x4; - - /// Medium single-precision floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef detail::tmat1x1<f32, mediump> f32mat1; - - /// Medium single-precision floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef mediump_f32mat2x2 mediump_f32mat2; - - /// Medium single-precision floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef mediump_f32mat3x3 mediump_f32mat3; - - /// Medium single-precision floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef mediump_f32mat4x4 mediump_f32mat4; - - - /// High single-precision floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef f32 highp_f32mat1x1; - - /// High single-precision floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef tmat2x2<f32, highp> highp_f32mat2x2; - - /// High single-precision floating-point 2x3 matrix. - /// @see gtc_type_precision - typedef tmat2x3<f32, highp> highp_f32mat2x3; - - /// High single-precision floating-point 2x4 matrix. - /// @see gtc_type_precision - typedef tmat2x4<f32, highp> highp_f32mat2x4; - - /// High single-precision floating-point 3x2 matrix. - /// @see gtc_type_precision - typedef tmat3x2<f32, highp> highp_f32mat3x2; - - /// High single-precision floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef tmat3x3<f32, highp> highp_f32mat3x3; - - /// High single-precision floating-point 3x4 matrix. - /// @see gtc_type_precision - typedef tmat3x4<f32, highp> highp_f32mat3x4; - - /// High single-precision floating-point 4x2 matrix. - /// @see gtc_type_precision - typedef tmat4x2<f32, highp> highp_f32mat4x2; - - /// High single-precision floating-point 4x3 matrix. - /// @see gtc_type_precision - typedef tmat4x3<f32, highp> highp_f32mat4x3; - - /// High single-precision floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef tmat4x4<f32, highp> highp_f32mat4x4; - - /// High single-precision floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef detail::tmat1x1<f32, highp> f32mat1; - - /// High single-precision floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef highp_f32mat2x2 highp_f32mat2; - - /// High single-precision floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef highp_f32mat3x3 highp_f32mat3; - - /// High single-precision floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef highp_f32mat4x4 highp_f32mat4; - - - /// Low double-precision floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef f64 lowp_f64mat1x1; - - /// Low double-precision floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef tmat2x2<f64, lowp> lowp_f64mat2x2; - - /// Low double-precision floating-point 2x3 matrix. - /// @see gtc_type_precision - typedef tmat2x3<f64, lowp> lowp_f64mat2x3; - - /// Low double-precision floating-point 2x4 matrix. - /// @see gtc_type_precision - typedef tmat2x4<f64, lowp> lowp_f64mat2x4; - - /// Low double-precision floating-point 3x2 matrix. - /// @see gtc_type_precision - typedef tmat3x2<f64, lowp> lowp_f64mat3x2; - - /// Low double-precision floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef tmat3x3<f64, lowp> lowp_f64mat3x3; - - /// Low double-precision floating-point 3x4 matrix. - /// @see gtc_type_precision - typedef tmat3x4<f64, lowp> lowp_f64mat3x4; - - /// Low double-precision floating-point 4x2 matrix. - /// @see gtc_type_precision - typedef tmat4x2<f64, lowp> lowp_f64mat4x2; - - /// Low double-precision floating-point 4x3 matrix. - /// @see gtc_type_precision - typedef tmat4x3<f64, lowp> lowp_f64mat4x3; - - /// Low double-precision floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef tmat4x4<f64, lowp> lowp_f64mat4x4; - - /// Low double-precision floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef lowp_f64mat1x1 lowp_f64mat1; - - /// Low double-precision floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef lowp_f64mat2x2 lowp_f64mat2; - - /// Low double-precision floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef lowp_f64mat3x3 lowp_f64mat3; - - /// Low double-precision floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef lowp_f64mat4x4 lowp_f64mat4; - - - /// Medium double-precision floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef f64 Highp_f64mat1x1; - - /// Medium double-precision floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef tmat2x2<f64, mediump> mediump_f64mat2x2; - - /// Medium double-precision floating-point 2x3 matrix. - /// @see gtc_type_precision - typedef tmat2x3<f64, mediump> mediump_f64mat2x3; - - /// Medium double-precision floating-point 2x4 matrix. - /// @see gtc_type_precision - typedef tmat2x4<f64, mediump> mediump_f64mat2x4; - - /// Medium double-precision floating-point 3x2 matrix. - /// @see gtc_type_precision - typedef tmat3x2<f64, mediump> mediump_f64mat3x2; - - /// Medium double-precision floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef tmat3x3<f64, mediump> mediump_f64mat3x3; - - /// Medium double-precision floating-point 3x4 matrix. - /// @see gtc_type_precision - typedef tmat3x4<f64, mediump> mediump_f64mat3x4; - - /// Medium double-precision floating-point 4x2 matrix. - /// @see gtc_type_precision - typedef tmat4x2<f64, mediump> mediump_f64mat4x2; - - /// Medium double-precision floating-point 4x3 matrix. - /// @see gtc_type_precision - typedef tmat4x3<f64, mediump> mediump_f64mat4x3; - - /// Medium double-precision floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef tmat4x4<f64, mediump> mediump_f64mat4x4; - - /// Medium double-precision floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef mediump_f64mat1x1 mediump_f64mat1; - - /// Medium double-precision floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef mediump_f64mat2x2 mediump_f64mat2; - - /// Medium double-precision floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef mediump_f64mat3x3 mediump_f64mat3; - - /// Medium double-precision floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef mediump_f64mat4x4 mediump_f64mat4; - - /// High double-precision floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef f64 highp_f64mat1x1; - - /// High double-precision floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef tmat2x2<f64, highp> highp_f64mat2x2; - - /// High double-precision floating-point 2x3 matrix. - /// @see gtc_type_precision - typedef tmat2x3<f64, highp> highp_f64mat2x3; - - /// High double-precision floating-point 2x4 matrix. - /// @see gtc_type_precision - typedef tmat2x4<f64, highp> highp_f64mat2x4; - - /// High double-precision floating-point 3x2 matrix. - /// @see gtc_type_precision - typedef tmat3x2<f64, highp> highp_f64mat3x2; - - /// High double-precision floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef tmat3x3<f64, highp> highp_f64mat3x3; - - /// High double-precision floating-point 3x4 matrix. - /// @see gtc_type_precision - typedef tmat3x4<f64, highp> highp_f64mat3x4; - - /// High double-precision floating-point 4x2 matrix. - /// @see gtc_type_precision - typedef tmat4x2<f64, highp> highp_f64mat4x2; - - /// High double-precision floating-point 4x3 matrix. - /// @see gtc_type_precision - typedef tmat4x3<f64, highp> highp_f64mat4x3; - - /// High double-precision floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef tmat4x4<f64, highp> highp_f64mat4x4; - - /// High double-precision floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef highp_f64mat1x1 highp_f64mat1; - - /// High double-precision floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef highp_f64mat2x2 highp_f64mat2; - - /// High double-precision floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef highp_f64mat3x3 highp_f64mat3; - - /// High double-precision floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef highp_f64mat4x4 highp_f64mat4; - - ////////////////////////// - // Quaternion types - - /// Low single-precision floating-point quaternion. - /// @see gtc_type_precision - typedef tquat<f32, lowp> lowp_f32quat; - - /// Low double-precision floating-point quaternion. - /// @see gtc_type_precision - typedef tquat<f64, lowp> lowp_f64quat; - - /// Medium single-precision floating-point quaternion. - /// @see gtc_type_precision - typedef tquat<f32, mediump> mediump_f32quat; - - /// Medium double-precision floating-point quaternion. - /// @see gtc_type_precision - typedef tquat<f64, mediump> mediump_f64quat; - - /// High single-precision floating-point quaternion. - /// @see gtc_type_precision - typedef tquat<f32, highp> highp_f32quat; - - /// High double-precision floating-point quaternion. - /// @see gtc_type_precision - typedef tquat<f64, highp> highp_f64quat; - - -#if(defined(GLM_PRECISION_LOWP_FLOAT)) - typedef lowp_f32vec1 fvec1; - typedef lowp_f32vec2 fvec2; - typedef lowp_f32vec3 fvec3; - typedef lowp_f32vec4 fvec4; - typedef lowp_f32mat2 fmat2; - typedef lowp_f32mat3 fmat3; - typedef lowp_f32mat4 fmat4; - typedef lowp_f32mat2x2 fmat2x2; - typedef lowp_f32mat3x2 fmat3x2; - typedef lowp_f32mat4x2 fmat4x2; - typedef lowp_f32mat2x3 fmat2x3; - typedef lowp_f32mat3x3 fmat3x3; - typedef lowp_f32mat4x3 fmat4x3; - typedef lowp_f32mat2x4 fmat2x4; - typedef lowp_f32mat3x4 fmat3x4; - typedef lowp_f32mat4x4 fmat4x4; - typedef lowp_f32quat fquat; - - typedef lowp_f32vec1 f32vec1; - typedef lowp_f32vec2 f32vec2; - typedef lowp_f32vec3 f32vec3; - typedef lowp_f32vec4 f32vec4; - typedef lowp_f32mat2 f32mat2; - typedef lowp_f32mat3 f32mat3; - typedef lowp_f32mat4 f32mat4; - typedef lowp_f32mat2x2 f32mat2x2; - typedef lowp_f32mat3x2 f32mat3x2; - typedef lowp_f32mat4x2 f32mat4x2; - typedef lowp_f32mat2x3 f32mat2x3; - typedef lowp_f32mat3x3 f32mat3x3; - typedef lowp_f32mat4x3 f32mat4x3; - typedef lowp_f32mat2x4 f32mat2x4; - typedef lowp_f32mat3x4 f32mat3x4; - typedef lowp_f32mat4x4 f32mat4x4; - typedef lowp_f32quat f32quat; -#elif(defined(GLM_PRECISION_MEDIUMP_FLOAT)) - typedef mediump_f32vec1 fvec1; - typedef mediump_f32vec2 fvec2; - typedef mediump_f32vec3 fvec3; - typedef mediump_f32vec4 fvec4; - typedef mediump_f32mat2 fmat2; - typedef mediump_f32mat3 fmat3; - typedef mediump_f32mat4 fmat4; - typedef mediump_f32mat2x2 fmat2x2; - typedef mediump_f32mat3x2 fmat3x2; - typedef mediump_f32mat4x2 fmat4x2; - typedef mediump_f32mat2x3 fmat2x3; - typedef mediump_f32mat3x3 fmat3x3; - typedef mediump_f32mat4x3 fmat4x3; - typedef mediump_f32mat2x4 fmat2x4; - typedef mediump_f32mat3x4 fmat3x4; - typedef mediump_f32mat4x4 fmat4x4; - typedef mediump_f32quat fquat; - - typedef mediump_f32vec1 f32vec1; - typedef mediump_f32vec2 f32vec2; - typedef mediump_f32vec3 f32vec3; - typedef mediump_f32vec4 f32vec4; - typedef mediump_f32mat2 f32mat2; - typedef mediump_f32mat3 f32mat3; - typedef mediump_f32mat4 f32mat4; - typedef mediump_f32mat2x2 f32mat2x2; - typedef mediump_f32mat3x2 f32mat3x2; - typedef mediump_f32mat4x2 f32mat4x2; - typedef mediump_f32mat2x3 f32mat2x3; - typedef mediump_f32mat3x3 f32mat3x3; - typedef mediump_f32mat4x3 f32mat4x3; - typedef mediump_f32mat2x4 f32mat2x4; - typedef mediump_f32mat3x4 f32mat3x4; - typedef mediump_f32mat4x4 f32mat4x4; - typedef mediump_f32quat f32quat; -#else//if(defined(GLM_PRECISION_HIGHP_FLOAT)) - /// Default single-precision floating-point vector of 1 components. - /// @see gtc_type_precision - typedef highp_f32vec1 fvec1; - - /// Default single-precision floating-point vector of 2 components. - /// @see gtc_type_precision - typedef highp_f32vec2 fvec2; - - /// Default single-precision floating-point vector of 3 components. - /// @see gtc_type_precision - typedef highp_f32vec3 fvec3; - - /// Default single-precision floating-point vector of 4 components. - /// @see gtc_type_precision - typedef highp_f32vec4 fvec4; - - /// Default single-precision floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef highp_f32mat2x2 fmat2x2; - - /// Default single-precision floating-point 2x3 matrix. - /// @see gtc_type_precision - typedef highp_f32mat2x3 fmat2x3; - - /// Default single-precision floating-point 2x4 matrix. - /// @see gtc_type_precision - typedef highp_f32mat2x4 fmat2x4; - - /// Default single-precision floating-point 3x2 matrix. - /// @see gtc_type_precision - typedef highp_f32mat3x2 fmat3x2; - - /// Default single-precision floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef highp_f32mat3x3 fmat3x3; - - /// Default single-precision floating-point 3x4 matrix. - /// @see gtc_type_precision - typedef highp_f32mat3x4 fmat3x4; - - /// Default single-precision floating-point 4x2 matrix. - /// @see gtc_type_precision - typedef highp_f32mat4x2 fmat4x2; - - /// Default single-precision floating-point 4x3 matrix. - /// @see gtc_type_precision - typedef highp_f32mat4x3 fmat4x3; - - /// Default single-precision floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef highp_f32mat4x4 fmat4x4; - - /// Default single-precision floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef fmat2x2 fmat2; - - /// Default single-precision floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef fmat3x3 fmat3; - - /// Default single-precision floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef fmat4x4 fmat4; - - /// Default single-precision floating-point quaternion. - /// @see gtc_type_precision - typedef highp_fquat fquat; - - - - /// Default single-precision floating-point vector of 1 components. - /// @see gtc_type_precision - typedef highp_f32vec1 f32vec1; - - /// Default single-precision floating-point vector of 2 components. - /// @see gtc_type_precision - typedef highp_f32vec2 f32vec2; - - /// Default single-precision floating-point vector of 3 components. - /// @see gtc_type_precision - typedef highp_f32vec3 f32vec3; - - /// Default single-precision floating-point vector of 4 components. - /// @see gtc_type_precision - typedef highp_f32vec4 f32vec4; - - /// Default single-precision floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef highp_f32mat2x2 f32mat2x2; - - /// Default single-precision floating-point 2x3 matrix. - /// @see gtc_type_precision - typedef highp_f32mat2x3 f32mat2x3; - - /// Default single-precision floating-point 2x4 matrix. - /// @see gtc_type_precision - typedef highp_f32mat2x4 f32mat2x4; - - /// Default single-precision floating-point 3x2 matrix. - /// @see gtc_type_precision - typedef highp_f32mat3x2 f32mat3x2; - - /// Default single-precision floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef highp_f32mat3x3 f32mat3x3; - - /// Default single-precision floating-point 3x4 matrix. - /// @see gtc_type_precision - typedef highp_f32mat3x4 f32mat3x4; - - /// Default single-precision floating-point 4x2 matrix. - /// @see gtc_type_precision - typedef highp_f32mat4x2 f32mat4x2; - - /// Default single-precision floating-point 4x3 matrix. - /// @see gtc_type_precision - typedef highp_f32mat4x3 f32mat4x3; - - /// Default single-precision floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef highp_f32mat4x4 f32mat4x4; - - /// Default single-precision floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef f32mat2x2 f32mat2; - - /// Default single-precision floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef f32mat3x3 f32mat3; - - /// Default single-precision floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef f32mat4x4 f32mat4; - - /// Default single-precision floating-point quaternion. - /// @see gtc_type_precision - typedef highp_f32quat f32quat; -#endif - -#if(defined(GLM_PRECISION_LOWP_DOUBLE)) - typedef lowp_f64vec1 f64vec1; - typedef lowp_f64vec2 f64vec2; - typedef lowp_f64vec3 f64vec3; - typedef lowp_f64vec4 f64vec4; - typedef lowp_f64mat2 f64mat2; - typedef lowp_f64mat3 f64mat3; - typedef lowp_f64mat4 f64mat4; - typedef lowp_f64mat2x2 f64mat2x2; - typedef lowp_f64mat3x2 f64mat3x2; - typedef lowp_f64mat4x2 f64mat4x2; - typedef lowp_f64mat2x3 f64mat2x3; - typedef lowp_f64mat3x3 f64mat3x3; - typedef lowp_f64mat4x3 f64mat4x3; - typedef lowp_f64mat2x4 f64mat2x4; - typedef lowp_f64mat3x4 f64mat3x4; - typedef lowp_f64mat4x4 f64mat4x4; - typedef lowp_f64quat f64quat; -#elif(defined(GLM_PRECISION_MEDIUMP_DOUBLE)) - typedef mediump_f64vec1 f64vec1; - typedef mediump_f64vec2 f64vec2; - typedef mediump_f64vec3 f64vec3; - typedef mediump_f64vec4 f64vec4; - typedef mediump_f64mat2 f64mat2; - typedef mediump_f64mat3 f64mat3; - typedef mediump_f64mat4 f64mat4; - typedef mediump_f64mat2x2 f64mat2x2; - typedef mediump_f64mat3x2 f64mat3x2; - typedef mediump_f64mat4x2 f64mat4x2; - typedef mediump_f64mat2x3 f64mat2x3; - typedef mediump_f64mat3x3 f64mat3x3; - typedef mediump_f64mat4x3 f64mat4x3; - typedef mediump_f64mat2x4 f64mat2x4; - typedef mediump_f64mat3x4 f64mat3x4; - typedef mediump_f64mat4x4 f64mat4x4; - typedef mediump_f64quat f64quat; -#else - /// Default double-precision floating-point vector of 1 components. - /// @see gtc_type_precision - typedef highp_f64vec1 f64vec1; - - /// Default double-precision floating-point vector of 2 components. - /// @see gtc_type_precision - typedef highp_f64vec2 f64vec2; - - /// Default double-precision floating-point vector of 3 components. - /// @see gtc_type_precision - typedef highp_f64vec3 f64vec3; - - /// Default double-precision floating-point vector of 4 components. - /// @see gtc_type_precision - typedef highp_f64vec4 f64vec4; - - /// Default double-precision floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef highp_f64mat2x2 f64mat2x2; - - /// Default double-precision floating-point 2x3 matrix. - /// @see gtc_type_precision - typedef highp_f64mat2x3 f64mat2x3; - - /// Default double-precision floating-point 2x4 matrix. - /// @see gtc_type_precision - typedef highp_f64mat2x4 f64mat2x4; - - /// Default double-precision floating-point 3x2 matrix. - /// @see gtc_type_precision - typedef highp_f64mat3x2 f64mat3x2; - - /// Default double-precision floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef highp_f64mat3x3 f64mat3x3; - - /// Default double-precision floating-point 3x4 matrix. - /// @see gtc_type_precision - typedef highp_f64mat3x4 f64mat3x4; - - /// Default double-precision floating-point 4x2 matrix. - /// @see gtc_type_precision - typedef highp_f64mat4x2 f64mat4x2; - - /// Default double-precision floating-point 4x3 matrix. - /// @see gtc_type_precision - typedef highp_f64mat4x3 f64mat4x3; - - /// Default double-precision floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef highp_f64mat4x4 f64mat4x4; - - /// Default double-precision floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef f64mat2x2 f64mat2; - - /// Default double-precision floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef f64mat3x3 f64mat3; - - /// Default double-precision floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef f64mat4x4 f64mat4; - - /// Default double-precision floating-point quaternion. - /// @see gtc_type_precision - typedef highp_f64quat f64quat; -#endif -}//namespace glm diff --git a/extensions/common/glm/geometric.hpp b/extensions/common/glm/geometric.hpp deleted file mode 100644 index afe50a0b93f..00000000000 --- a/extensions/common/glm/geometric.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/geometric.hpp -/// @date 2013-12-24 / 2013-12-24 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "detail/func_geometric.hpp" diff --git a/extensions/common/glm/glm.hpp b/extensions/common/glm/glm.hpp deleted file mode 100644 index bdb257b5110..00000000000 --- a/extensions/common/glm/glm.hpp +++ /dev/null @@ -1,117 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/glm.hpp -/// @date 2005-01-14 / 2011-10-24 -/// @author Christophe Riccio -/// -/// @defgroup core GLM Core -/// -/// @brief The core of GLM, which implements exactly and only the GLSL specification to the degree possible. -/// -/// The GLM core consists of @ref core_types "C++ types that mirror GLSL types" and -/// C++ functions that mirror the GLSL functions. It also includes -/// @ref core_precision "a set of precision-based types" that can be used in the appropriate -/// functions. The C++ types are all based on a basic set of @ref core_template "template types". -/// -/// The best documentation for GLM Core is the current GLSL specification, -/// <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.clean.pdf">version 4.2 -/// (pdf file)</a>. -/// -/// GLM core functionnalities require <glm/glm.hpp> to be included to be used. -/// -/// @defgroup core_types Types -/// -/// @brief The standard types defined by the specification. -/// -/// These types are all typedefs of more generalized, template types. To see the definiton -/// of these template types, go to @ref core_template. -/// -/// @ingroup core -/// -/// @defgroup core_precision Precision types -/// -/// @brief Non-GLSL types that are used to define precision-based types. -/// -/// The GLSL language allows the user to define the precision of a particular variable. -/// In OpenGL's GLSL, these precision qualifiers have no effect; they are there for compatibility -/// with OpenGL ES's precision qualifiers, where they @em do have an effect. -/// -/// C++ has no language equivalent to precision qualifiers. So GLM provides the next-best thing: -/// a number of typedefs of the @ref core_template that use a particular precision. -/// -/// None of these types make any guarantees about the actual precision used. -/// -/// @ingroup core -/// -/// @defgroup core_template Template types -/// -/// @brief The generic template types used as the basis for the core types. -/// -/// These types are all templates used to define the actual @ref core_types. -/// These templetes are implementation details of GLM types and should not be used explicitly. -/// -/// @ingroup core -/////////////////////////////////////////////////////////////////////////////////// - -#include "detail/_fixes.hpp" - -#pragma once - -#include <cmath> -#include <climits> -#include <cfloat> -#include <limits> -#include <cassert> -#include "fwd.hpp" - -#if(defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_CORE_INCLUDED_DISPLAYED)) -# define GLM_MESSAGE_CORE_INCLUDED_DISPLAYED -# pragma message("GLM: Core library included") -#endif//GLM_MESSAGE - -#include "vec2.hpp" -#include "vec3.hpp" -#include "vec4.hpp" -#include "mat2x2.hpp" -#include "mat2x3.hpp" -#include "mat2x4.hpp" -#include "mat3x2.hpp" -#include "mat3x3.hpp" -#include "mat3x4.hpp" -#include "mat4x2.hpp" -#include "mat4x3.hpp" -#include "mat4x4.hpp" - -#include "trigonometric.hpp" -#include "exponential.hpp" -#include "common.hpp" -#include "packing.hpp" -#include "geometric.hpp" -#include "matrix.hpp" -#include "vector_relational.hpp" -#include "integer.hpp" diff --git a/extensions/common/glm/gtc/bitfield.hpp b/extensions/common/glm/gtc/bitfield.hpp deleted file mode 100644 index 708d1935a9e..00000000000 --- a/extensions/common/glm/gtc/bitfield.hpp +++ /dev/null @@ -1,236 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtc_bitfield -/// @file glm/gtc/bitfield.hpp -/// @date 2014-10-25 / 2014-10-25 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// @see gtc_bitfield (dependence) -/// -/// @defgroup gtc_bitfield GLM_GTC_bitfield -/// @ingroup gtc -/// -/// @brief Allow to perform bit operations on integer values -/// -/// <glm/gtc/bitfield.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependencies -#include "../detail/setup.hpp" -#include "../detail/precision.hpp" -#include "../detail/type_int.hpp" -#include "../detail/_vectorize.hpp" -#include <limits> - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTC_bitfield extension included") -#endif - -namespace glm -{ - /// @addtogroup gtc_bitfield - /// @{ - - /// Build a mask of 'count' bits - /// - /// @see gtc_bitfield - template <typename genIUType> - GLM_FUNC_DECL genIUType mask(genIUType Bits); - - /// Build a mask of 'count' bits - /// - /// @see gtc_bitfield - template <typename T, precision P, template <typename, precision> class vecIUType> - GLM_FUNC_DECL vecIUType<T, P> mask(vecIUType<T, P> const & v); - - /// Rotate all bits to the right. All the bits dropped in the right side are inserted back on the left side. - /// - /// @see gtc_bitfield - template <typename genIUType> - GLM_FUNC_DECL genIUType bitfieldRotateRight(genIUType In, int Shift); - - /// Rotate all bits to the right. All the bits dropped in the right side are inserted back on the left side. - /// - /// @see gtc_bitfield - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> bitfieldRotateRight(vecType<T, P> const & In, int Shift); - - /// Rotate all bits to the left. All the bits dropped in the left side are inserted back on the right side. - /// - /// @see gtc_bitfield - template <typename genIUType> - GLM_FUNC_DECL genIUType bitfieldRotateLeft(genIUType In, int Shift); - - /// Rotate all bits to the left. All the bits dropped in the left side are inserted back on the right side. - /// - /// @see gtc_bitfield - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> bitfieldRotateLeft(vecType<T, P> const & In, int Shift); - - /// Set to 1 a range of bits. - /// - /// @see gtc_bitfield - template <typename genIUType> - GLM_FUNC_DECL genIUType bitfieldFillOne(genIUType Value, int FirstBit, int BitCount); - - /// Set to 1 a range of bits. - /// - /// @see gtc_bitfield - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> bitfieldFillOne(vecType<T, P> const & Value, int FirstBit, int BitCount); - - /// Set to 0 a range of bits. - /// - /// @see gtc_bitfield - template <typename genIUType> - GLM_FUNC_DECL genIUType bitfieldFillZero(genIUType Value, int FirstBit, int BitCount); - - /// Set to 0 a range of bits. - /// - /// @see gtc_bitfield - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> bitfieldFillZero(vecType<T, P> const & Value, int FirstBit, int BitCount); - - /// Interleaves the bits of x and y. - /// The first bit is the first bit of x followed by the first bit of y. - /// The other bits are interleaved following the previous sequence. - /// - /// @see gtc_bitfield - GLM_FUNC_DECL int16 bitfieldInterleave(int8 x, int8 y); - - /// Interleaves the bits of x and y. - /// The first bit is the first bit of x followed by the first bit of y. - /// The other bits are interleaved following the previous sequence. - /// - /// @see gtc_bitfield - GLM_FUNC_DECL uint16 bitfieldInterleave(uint8 x, uint8 y); - - /// Interleaves the bits of x and y. - /// The first bit is the first bit of x followed by the first bit of y. - /// The other bits are interleaved following the previous sequence. - /// - /// @see gtc_bitfield - GLM_FUNC_DECL int32 bitfieldInterleave(int16 x, int16 y); - - /// Interleaves the bits of x and y. - /// The first bit is the first bit of x followed by the first bit of y. - /// The other bits are interleaved following the previous sequence. - /// - /// @see gtc_bitfield - GLM_FUNC_DECL uint32 bitfieldInterleave(uint16 x, uint16 y); - - /// Interleaves the bits of x and y. - /// The first bit is the first bit of x followed by the first bit of y. - /// The other bits are interleaved following the previous sequence. - /// - /// @see gtc_bitfield - GLM_FUNC_DECL int64 bitfieldInterleave(int32 x, int32 y); - - /// Interleaves the bits of x and y. - /// The first bit is the first bit of x followed by the first bit of y. - /// The other bits are interleaved following the previous sequence. - /// - /// @see gtc_bitfield - GLM_FUNC_DECL uint64 bitfieldInterleave(uint32 x, uint32 y); - - /// Interleaves the bits of x, y and z. - /// The first bit is the first bit of x followed by the first bit of y and the first bit of z. - /// The other bits are interleaved following the previous sequence. - /// - /// @see gtc_bitfield - GLM_FUNC_DECL int32 bitfieldInterleave(int8 x, int8 y, int8 z); - - /// Interleaves the bits of x, y and z. - /// The first bit is the first bit of x followed by the first bit of y and the first bit of z. - /// The other bits are interleaved following the previous sequence. - /// - /// @see gtc_bitfield - GLM_FUNC_DECL uint32 bitfieldInterleave(uint8 x, uint8 y, uint8 z); - - /// Interleaves the bits of x, y and z. - /// The first bit is the first bit of x followed by the first bit of y and the first bit of z. - /// The other bits are interleaved following the previous sequence. - /// - /// @see gtc_bitfield - GLM_FUNC_DECL int64 bitfieldInterleave(int16 x, int16 y, int16 z); - - /// Interleaves the bits of x, y and z. - /// The first bit is the first bit of x followed by the first bit of y and the first bit of z. - /// The other bits are interleaved following the previous sequence. - /// - /// @see gtc_bitfield - GLM_FUNC_DECL uint64 bitfieldInterleave(uint16 x, uint16 y, uint16 z); - - /// Interleaves the bits of x, y and z. - /// The first bit is the first bit of x followed by the first bit of y and the first bit of z. - /// The other bits are interleaved following the previous sequence. - /// - /// @see gtc_bitfield - GLM_FUNC_DECL int64 bitfieldInterleave(int32 x, int32 y, int32 z); - - /// Interleaves the bits of x, y and z. - /// The first bit is the first bit of x followed by the first bit of y and the first bit of z. - /// The other bits are interleaved following the previous sequence. - /// - /// @see gtc_bitfield - GLM_FUNC_DECL uint64 bitfieldInterleave(uint32 x, uint32 y, uint32 z); - - /// Interleaves the bits of x, y, z and w. - /// The first bit is the first bit of x followed by the first bit of y, the first bit of z and finally the first bit of w. - /// The other bits are interleaved following the previous sequence. - /// - /// @see gtc_bitfield - GLM_FUNC_DECL int32 bitfieldInterleave(int8 x, int8 y, int8 z, int8 w); - - /// Interleaves the bits of x, y, z and w. - /// The first bit is the first bit of x followed by the first bit of y, the first bit of z and finally the first bit of w. - /// The other bits are interleaved following the previous sequence. - /// - /// @see gtc_bitfield - GLM_FUNC_DECL uint32 bitfieldInterleave(uint8 x, uint8 y, uint8 z, uint8 w); - - /// Interleaves the bits of x, y, z and w. - /// The first bit is the first bit of x followed by the first bit of y, the first bit of z and finally the first bit of w. - /// The other bits are interleaved following the previous sequence. - /// - /// @see gtc_bitfield - GLM_FUNC_DECL int64 bitfieldInterleave(int16 x, int16 y, int16 z, int16 w); - - /// Interleaves the bits of x, y, z and w. - /// The first bit is the first bit of x followed by the first bit of y, the first bit of z and finally the first bit of w. - /// The other bits are interleaved following the previous sequence. - /// - /// @see gtc_bitfield - GLM_FUNC_DECL uint64 bitfieldInterleave(uint16 x, uint16 y, uint16 z, uint16 w); - - /// @} -} //namespace glm - -#include "bitfield.inl" diff --git a/extensions/common/glm/gtc/bitfield.inl b/extensions/common/glm/gtc/bitfield.inl deleted file mode 100644 index 1170262714b..00000000000 --- a/extensions/common/glm/gtc/bitfield.inl +++ /dev/null @@ -1,542 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtc_bitfield -/// @file glm/gtc/bitfield.inl -/// @date 2011-10-14 / 2012-01-25 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -namespace glm{ -namespace detail -{ - template <typename PARAM, typename RET> - GLM_FUNC_DECL RET bitfieldInterleave(PARAM x, PARAM y); - - template <typename PARAM, typename RET> - GLM_FUNC_DECL RET bitfieldInterleave(PARAM x, PARAM y, PARAM z); - - template <typename PARAM, typename RET> - GLM_FUNC_DECL RET bitfieldInterleave(PARAM x, PARAM y, PARAM z, PARAM w); - - template <> - GLM_FUNC_QUALIFIER glm::uint16 bitfieldInterleave(glm::uint8 x, glm::uint8 y) - { - glm::uint16 REG1(x); - glm::uint16 REG2(y); - - REG1 = ((REG1 << 4) | REG1) & glm::uint16(0x0F0F); - REG2 = ((REG2 << 4) | REG2) & glm::uint16(0x0F0F); - - REG1 = ((REG1 << 2) | REG1) & glm::uint16(0x3333); - REG2 = ((REG2 << 2) | REG2) & glm::uint16(0x3333); - - REG1 = ((REG1 << 1) | REG1) & glm::uint16(0x5555); - REG2 = ((REG2 << 1) | REG2) & glm::uint16(0x5555); - - return REG1 | (REG2 << 1); - } - - template <> - GLM_FUNC_QUALIFIER glm::uint32 bitfieldInterleave(glm::uint16 x, glm::uint16 y) - { - glm::uint32 REG1(x); - glm::uint32 REG2(y); - - REG1 = ((REG1 << 8) | REG1) & glm::uint32(0x00FF00FF); - REG2 = ((REG2 << 8) | REG2) & glm::uint32(0x00FF00FF); - - REG1 = ((REG1 << 4) | REG1) & glm::uint32(0x0F0F0F0F); - REG2 = ((REG2 << 4) | REG2) & glm::uint32(0x0F0F0F0F); - - REG1 = ((REG1 << 2) | REG1) & glm::uint32(0x33333333); - REG2 = ((REG2 << 2) | REG2) & glm::uint32(0x33333333); - - REG1 = ((REG1 << 1) | REG1) & glm::uint32(0x55555555); - REG2 = ((REG2 << 1) | REG2) & glm::uint32(0x55555555); - - return REG1 | (REG2 << 1); - } - - template <> - GLM_FUNC_QUALIFIER glm::uint64 bitfieldInterleave(glm::uint32 x, glm::uint32 y) - { - glm::uint64 REG1(x); - glm::uint64 REG2(y); - - REG1 = ((REG1 << 16) | REG1) & glm::uint64(0x0000FFFF0000FFFF); - REG2 = ((REG2 << 16) | REG2) & glm::uint64(0x0000FFFF0000FFFF); - - REG1 = ((REG1 << 8) | REG1) & glm::uint64(0x00FF00FF00FF00FF); - REG2 = ((REG2 << 8) | REG2) & glm::uint64(0x00FF00FF00FF00FF); - - REG1 = ((REG1 << 4) | REG1) & glm::uint64(0x0F0F0F0F0F0F0F0F); - REG2 = ((REG2 << 4) | REG2) & glm::uint64(0x0F0F0F0F0F0F0F0F); - - REG1 = ((REG1 << 2) | REG1) & glm::uint64(0x3333333333333333); - REG2 = ((REG2 << 2) | REG2) & glm::uint64(0x3333333333333333); - - REG1 = ((REG1 << 1) | REG1) & glm::uint64(0x5555555555555555); - REG2 = ((REG2 << 1) | REG2) & glm::uint64(0x5555555555555555); - - return REG1 | (REG2 << 1); - } - - template <> - GLM_FUNC_QUALIFIER glm::uint32 bitfieldInterleave(glm::uint8 x, glm::uint8 y, glm::uint8 z) - { - glm::uint32 REG1(x); - glm::uint32 REG2(y); - glm::uint32 REG3(z); - - REG1 = ((REG1 << 16) | REG1) & glm::uint32(0x00FF0000FF0000FF); - REG2 = ((REG2 << 16) | REG2) & glm::uint32(0x00FF0000FF0000FF); - REG3 = ((REG3 << 16) | REG3) & glm::uint32(0x00FF0000FF0000FF); - - REG1 = ((REG1 << 8) | REG1) & glm::uint32(0xF00F00F00F00F00F); - REG2 = ((REG2 << 8) | REG2) & glm::uint32(0xF00F00F00F00F00F); - REG3 = ((REG3 << 8) | REG3) & glm::uint32(0xF00F00F00F00F00F); - - REG1 = ((REG1 << 4) | REG1) & glm::uint32(0x30C30C30C30C30C3); - REG2 = ((REG2 << 4) | REG2) & glm::uint32(0x30C30C30C30C30C3); - REG3 = ((REG3 << 4) | REG3) & glm::uint32(0x30C30C30C30C30C3); - - REG1 = ((REG1 << 2) | REG1) & glm::uint32(0x9249249249249249); - REG2 = ((REG2 << 2) | REG2) & glm::uint32(0x9249249249249249); - REG3 = ((REG3 << 2) | REG3) & glm::uint32(0x9249249249249249); - - return REG1 | (REG2 << 1) | (REG3 << 2); - } - - template <> - GLM_FUNC_QUALIFIER glm::uint64 bitfieldInterleave(glm::uint16 x, glm::uint16 y, glm::uint16 z) - { - glm::uint64 REG1(x); - glm::uint64 REG2(y); - glm::uint64 REG3(z); - - REG1 = ((REG1 << 32) | REG1) & glm::uint64(0xFFFF00000000FFFF); - REG2 = ((REG2 << 32) | REG2) & glm::uint64(0xFFFF00000000FFFF); - REG3 = ((REG3 << 32) | REG3) & glm::uint64(0xFFFF00000000FFFF); - - REG1 = ((REG1 << 16) | REG1) & glm::uint64(0x00FF0000FF0000FF); - REG2 = ((REG2 << 16) | REG2) & glm::uint64(0x00FF0000FF0000FF); - REG3 = ((REG3 << 16) | REG3) & glm::uint64(0x00FF0000FF0000FF); - - REG1 = ((REG1 << 8) | REG1) & glm::uint64(0xF00F00F00F00F00F); - REG2 = ((REG2 << 8) | REG2) & glm::uint64(0xF00F00F00F00F00F); - REG3 = ((REG3 << 8) | REG3) & glm::uint64(0xF00F00F00F00F00F); - - REG1 = ((REG1 << 4) | REG1) & glm::uint64(0x30C30C30C30C30C3); - REG2 = ((REG2 << 4) | REG2) & glm::uint64(0x30C30C30C30C30C3); - REG3 = ((REG3 << 4) | REG3) & glm::uint64(0x30C30C30C30C30C3); - - REG1 = ((REG1 << 2) | REG1) & glm::uint64(0x9249249249249249); - REG2 = ((REG2 << 2) | REG2) & glm::uint64(0x9249249249249249); - REG3 = ((REG3 << 2) | REG3) & glm::uint64(0x9249249249249249); - - return REG1 | (REG2 << 1) | (REG3 << 2); - } - - template <> - GLM_FUNC_QUALIFIER glm::uint64 bitfieldInterleave(glm::uint32 x, glm::uint32 y, glm::uint32 z) - { - glm::uint64 REG1(x); - glm::uint64 REG2(y); - glm::uint64 REG3(z); - - REG1 = ((REG1 << 32) | REG1) & glm::uint64(0xFFFF00000000FFFF); - REG2 = ((REG2 << 32) | REG2) & glm::uint64(0xFFFF00000000FFFF); - REG3 = ((REG3 << 32) | REG3) & glm::uint64(0xFFFF00000000FFFF); - - REG1 = ((REG1 << 16) | REG1) & glm::uint64(0x00FF0000FF0000FF); - REG2 = ((REG2 << 16) | REG2) & glm::uint64(0x00FF0000FF0000FF); - REG3 = ((REG3 << 16) | REG3) & glm::uint64(0x00FF0000FF0000FF); - - REG1 = ((REG1 << 8) | REG1) & glm::uint64(0xF00F00F00F00F00F); - REG2 = ((REG2 << 8) | REG2) & glm::uint64(0xF00F00F00F00F00F); - REG3 = ((REG3 << 8) | REG3) & glm::uint64(0xF00F00F00F00F00F); - - REG1 = ((REG1 << 4) | REG1) & glm::uint64(0x30C30C30C30C30C3); - REG2 = ((REG2 << 4) | REG2) & glm::uint64(0x30C30C30C30C30C3); - REG3 = ((REG3 << 4) | REG3) & glm::uint64(0x30C30C30C30C30C3); - - REG1 = ((REG1 << 2) | REG1) & glm::uint64(0x9249249249249249); - REG2 = ((REG2 << 2) | REG2) & glm::uint64(0x9249249249249249); - REG3 = ((REG3 << 2) | REG3) & glm::uint64(0x9249249249249249); - - return REG1 | (REG2 << 1) | (REG3 << 2); - } - - template <> - GLM_FUNC_QUALIFIER glm::uint32 bitfieldInterleave(glm::uint8 x, glm::uint8 y, glm::uint8 z, glm::uint8 w) - { - glm::uint32 REG1(x); - glm::uint32 REG2(y); - glm::uint32 REG3(z); - glm::uint32 REG4(w); - - REG1 = ((REG1 << 12) | REG1) & glm::uint32(0x000F000F000F000F); - REG2 = ((REG2 << 12) | REG2) & glm::uint32(0x000F000F000F000F); - REG3 = ((REG3 << 12) | REG3) & glm::uint32(0x000F000F000F000F); - REG4 = ((REG4 << 12) | REG4) & glm::uint32(0x000F000F000F000F); - - REG1 = ((REG1 << 6) | REG1) & glm::uint32(0x0303030303030303); - REG2 = ((REG2 << 6) | REG2) & glm::uint32(0x0303030303030303); - REG3 = ((REG3 << 6) | REG3) & glm::uint32(0x0303030303030303); - REG4 = ((REG4 << 6) | REG4) & glm::uint32(0x0303030303030303); - - REG1 = ((REG1 << 3) | REG1) & glm::uint32(0x1111111111111111); - REG2 = ((REG2 << 3) | REG2) & glm::uint32(0x1111111111111111); - REG3 = ((REG3 << 3) | REG3) & glm::uint32(0x1111111111111111); - REG4 = ((REG4 << 3) | REG4) & glm::uint32(0x1111111111111111); - - return REG1 | (REG2 << 1) | (REG3 << 2) | (REG4 << 3); - } - - template <> - GLM_FUNC_QUALIFIER glm::uint64 bitfieldInterleave(glm::uint16 x, glm::uint16 y, glm::uint16 z, glm::uint16 w) - { - glm::uint64 REG1(x); - glm::uint64 REG2(y); - glm::uint64 REG3(z); - glm::uint64 REG4(w); - - REG1 = ((REG1 << 24) | REG1) & glm::uint64(0x000000FF000000FF); - REG2 = ((REG2 << 24) | REG2) & glm::uint64(0x000000FF000000FF); - REG3 = ((REG3 << 24) | REG3) & glm::uint64(0x000000FF000000FF); - REG4 = ((REG4 << 24) | REG4) & glm::uint64(0x000000FF000000FF); - - REG1 = ((REG1 << 12) | REG1) & glm::uint64(0x000F000F000F000F); - REG2 = ((REG2 << 12) | REG2) & glm::uint64(0x000F000F000F000F); - REG3 = ((REG3 << 12) | REG3) & glm::uint64(0x000F000F000F000F); - REG4 = ((REG4 << 12) | REG4) & glm::uint64(0x000F000F000F000F); - - REG1 = ((REG1 << 6) | REG1) & glm::uint64(0x0303030303030303); - REG2 = ((REG2 << 6) | REG2) & glm::uint64(0x0303030303030303); - REG3 = ((REG3 << 6) | REG3) & glm::uint64(0x0303030303030303); - REG4 = ((REG4 << 6) | REG4) & glm::uint64(0x0303030303030303); - - REG1 = ((REG1 << 3) | REG1) & glm::uint64(0x1111111111111111); - REG2 = ((REG2 << 3) | REG2) & glm::uint64(0x1111111111111111); - REG3 = ((REG3 << 3) | REG3) & glm::uint64(0x1111111111111111); - REG4 = ((REG4 << 3) | REG4) & glm::uint64(0x1111111111111111); - - return REG1 | (REG2 << 1) | (REG3 << 2) | (REG4 << 3); - } -}//namespace detail - - template <typename genIUType> - GLM_FUNC_QUALIFIER genIUType mask(genIUType Bits) - { - GLM_STATIC_ASSERT(std::numeric_limits<genIUType>::is_integer, "'mask' accepts only integer values"); - - return Bits >= sizeof(genIUType) * 8 ? ~static_cast<genIUType>(0) : (static_cast<genIUType>(1) << Bits) - static_cast<genIUType>(1); - } - - template <typename T, precision P, template <typename, precision> class vecIUType> - GLM_FUNC_QUALIFIER vecIUType<T, P> mask(vecIUType<T, P> const & v) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'mask' accepts only integer values"); - - return detail::functor1<T, T, P, vecIUType>::call(mask, v); - } - - template <typename genIType> - GLM_FUNC_QUALIFIER genIType bitfieldRotateRight(genIType In, int Shift) - { - GLM_STATIC_ASSERT(std::numeric_limits<genIType>::is_integer, "'bitfieldRotateRight' accepts only integer values"); - - int const BitSize = static_cast<genIType>(sizeof(genIType) * 8); - return (In << static_cast<genIType>(Shift)) | (In >> static_cast<genIType>(BitSize - Shift)); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> bitfieldRotateRight(vecType<T, P> const & In, int Shift) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'bitfieldRotateRight' accepts only integer values"); - - int const BitSize = static_cast<int>(sizeof(T) * 8); - return (In << static_cast<T>(Shift)) | (In >> static_cast<T>(BitSize - Shift)); - } - - template <typename genIType> - GLM_FUNC_QUALIFIER genIType bitfieldRotateLeft(genIType In, int Shift) - { - GLM_STATIC_ASSERT(std::numeric_limits<genIType>::is_integer, "'bitfieldRotateLeft' accepts only integer values"); - - int const BitSize = static_cast<genIType>(sizeof(genIType) * 8); - return (In >> static_cast<genIType>(Shift)) | (In << static_cast<genIType>(BitSize - Shift)); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> bitfieldRotateLeft(vecType<T, P> const & In, int Shift) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'bitfieldRotateLeft' accepts only integer values"); - - int const BitSize = static_cast<int>(sizeof(T) * 8); - return (In >> static_cast<T>(Shift)) | (In << static_cast<T>(BitSize - Shift)); - } - - template <typename genIUType> - GLM_FUNC_QUALIFIER genIUType bitfieldFillOne(genIUType Value, int FirstBit, int BitCount) - { - return Value | static_cast<genIUType>(mask(BitCount) << FirstBit); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> bitfieldFillOne(vecType<T, P> const & Value, int FirstBit, int BitCount) - { - return Value | static_cast<T>(mask(BitCount) << FirstBit); - } - - template <typename genIUType> - GLM_FUNC_QUALIFIER genIUType bitfieldFillZero(genIUType Value, int FirstBit, int BitCount) - { - return Value & static_cast<genIUType>(~(mask(BitCount) << FirstBit)); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> bitfieldFillZero(vecType<T, P> const & Value, int FirstBit, int BitCount) - { - return Value & static_cast<T>(~(mask(BitCount) << FirstBit)); - } - - GLM_FUNC_QUALIFIER int16 bitfieldInterleave(int8 x, int8 y) - { - union sign8 - { - int8 i; - uint8 u; - } sign_x, sign_y; - - union sign16 - { - int16 i; - uint16 u; - } result; - - sign_x.i = x; - sign_y.i = y; - result.u = bitfieldInterleave(sign_x.u, sign_y.u); - - return result.i; - } - - GLM_FUNC_QUALIFIER uint16 bitfieldInterleave(uint8 x, uint8 y) - { - return detail::bitfieldInterleave<uint8, uint16>(x, y); - } - - GLM_FUNC_QUALIFIER int32 bitfieldInterleave(int16 x, int16 y) - { - union sign16 - { - int16 i; - uint16 u; - } sign_x, sign_y; - - union sign32 - { - int32 i; - uint32 u; - } result; - - sign_x.i = x; - sign_y.i = y; - result.u = bitfieldInterleave(sign_x.u, sign_y.u); - - return result.i; - } - - GLM_FUNC_QUALIFIER uint32 bitfieldInterleave(uint16 x, uint16 y) - { - return detail::bitfieldInterleave<uint16, uint32>(x, y); - } - - GLM_FUNC_QUALIFIER int64 bitfieldInterleave(int32 x, int32 y) - { - union sign32 - { - int32 i; - uint32 u; - } sign_x, sign_y; - - union sign64 - { - int64 i; - uint64 u; - } result; - - sign_x.i = x; - sign_y.i = y; - result.u = bitfieldInterleave(sign_x.u, sign_y.u); - - return result.i; - } - - GLM_FUNC_QUALIFIER uint64 bitfieldInterleave(uint32 x, uint32 y) - { - return detail::bitfieldInterleave<uint32, uint64>(x, y); - } - - GLM_FUNC_QUALIFIER int32 bitfieldInterleave(int8 x, int8 y, int8 z) - { - union sign8 - { - int8 i; - uint8 u; - } sign_x, sign_y, sign_z; - - union sign32 - { - int32 i; - uint32 u; - } result; - - sign_x.i = x; - sign_y.i = y; - sign_z.i = z; - result.u = bitfieldInterleave(sign_x.u, sign_y.u, sign_z.u); - - return result.i; - } - - GLM_FUNC_QUALIFIER uint32 bitfieldInterleave(uint8 x, uint8 y, uint8 z) - { - return detail::bitfieldInterleave<uint8, uint32>(x, y, z); - } - - GLM_FUNC_QUALIFIER int64 bitfieldInterleave(int16 x, int16 y, int16 z) - { - union sign16 - { - int16 i; - uint16 u; - } sign_x, sign_y, sign_z; - - union sign64 - { - int64 i; - uint64 u; - } result; - - sign_x.i = x; - sign_y.i = y; - sign_z.i = z; - result.u = bitfieldInterleave(sign_x.u, sign_y.u, sign_z.u); - - return result.i; - } - - GLM_FUNC_QUALIFIER uint64 bitfieldInterleave(uint16 x, uint16 y, uint16 z) - { - return detail::bitfieldInterleave<uint32, uint64>(x, y, z); - } - - GLM_FUNC_QUALIFIER int64 bitfieldInterleave(int32 x, int32 y, int32 z) - { - union sign16 - { - int32 i; - uint32 u; - } sign_x, sign_y, sign_z; - - union sign64 - { - int64 i; - uint64 u; - } result; - - sign_x.i = x; - sign_y.i = y; - sign_z.i = z; - result.u = bitfieldInterleave(sign_x.u, sign_y.u, sign_z.u); - - return result.i; - } - - GLM_FUNC_QUALIFIER uint64 bitfieldInterleave(uint32 x, uint32 y, uint32 z) - { - return detail::bitfieldInterleave<uint32, uint64>(x, y, z); - } - - GLM_FUNC_QUALIFIER int32 bitfieldInterleave(int8 x, int8 y, int8 z, int8 w) - { - union sign8 - { - int8 i; - uint8 u; - } sign_x, sign_y, sign_z, sign_w; - - union sign32 - { - int32 i; - uint32 u; - } result; - - sign_x.i = x; - sign_y.i = y; - sign_z.i = z; - sign_w.i = w; - result.u = bitfieldInterleave(sign_x.u, sign_y.u, sign_z.u, sign_w.u); - - return result.i; - } - - GLM_FUNC_QUALIFIER uint32 bitfieldInterleave(uint8 x, uint8 y, uint8 z, uint8 w) - { - return detail::bitfieldInterleave<uint8, uint32>(x, y, z, w); - } - - GLM_FUNC_QUALIFIER int64 bitfieldInterleave(int16 x, int16 y, int16 z, int16 w) - { - union sign16 - { - int16 i; - uint16 u; - } sign_x, sign_y, sign_z, sign_w; - - union sign64 - { - int64 i; - uint64 u; - } result; - - sign_x.i = x; - sign_y.i = y; - sign_z.i = z; - sign_w.i = w; - result.u = bitfieldInterleave(sign_x.u, sign_y.u, sign_z.u, sign_w.u); - - return result.i; - } - - GLM_FUNC_QUALIFIER uint64 bitfieldInterleave(uint16 x, uint16 y, uint16 z, uint16 w) - { - return detail::bitfieldInterleave<uint16, uint64>(x, y, z, w); - } -}//namespace glm diff --git a/extensions/common/glm/gtc/constants.hpp b/extensions/common/glm/gtc/constants.hpp deleted file mode 100644 index b7ff221c347..00000000000 --- a/extensions/common/glm/gtc/constants.hpp +++ /dev/null @@ -1,205 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtc_constants -/// @file glm/gtc/constants.hpp -/// @date 2011-09-30 / 2012-01-25 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// @see gtc_half_float (dependence) -/// -/// @defgroup gtc_constants GLM_GTC_constants -/// @ingroup gtc -/// -/// @brief Provide a list of constants and precomputed useful values. -/// -/// <glm/gtc/constants.hpp> need to be included to use these features. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependencies -#include "../detail/setup.hpp" - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTC_constants extension included") -#endif - -namespace glm -{ - /// @addtogroup gtc_constants - /// @{ - - /// Return the epsilon constant for floating point types. - /// @see gtc_constants - template <typename genType> - GLM_FUNC_DECL genType epsilon(); - - /// Return 0. - /// @see gtc_constants - template <typename genType> - GLM_FUNC_DECL genType zero(); - - /// Return 1. - /// @see gtc_constants - template <typename genType> - GLM_FUNC_DECL genType one(); - - /// Return the pi constant. - /// @see gtc_constants - template <typename genType> - GLM_FUNC_DECL genType pi(); - - /// Return pi * 2. - /// @see gtc_constants - template <typename genType> - GLM_FUNC_DECL genType two_pi(); - - /// Return square root of pi. - /// @see gtc_constants - template <typename genType> - GLM_FUNC_DECL genType root_pi(); - - /// Return pi / 2. - /// @see gtc_constants - template <typename genType> - GLM_FUNC_DECL genType half_pi(); - - /// Return pi / 2 * 3. - /// @see gtc_constants - template <typename genType> - GLM_FUNC_DECL genType three_over_two_pi(); - - /// Return pi / 4. - /// @see gtc_constants - template <typename genType> - GLM_FUNC_DECL genType quarter_pi(); - - /// Return 1 / pi. - /// @see gtc_constants - template <typename genType> - GLM_FUNC_DECL genType one_over_pi(); - - /// Return 1 / (pi * 2). - /// @see gtc_constants - template <typename genType> - GLM_FUNC_DECL genType one_over_two_pi(); - - /// Return 2 / pi. - /// @see gtc_constants - template <typename genType> - GLM_FUNC_DECL genType two_over_pi(); - - /// Return 4 / pi. - /// @see gtc_constants - template <typename genType> - GLM_FUNC_DECL genType four_over_pi(); - - /// Return 2 / sqrt(pi). - /// @see gtc_constants - template <typename genType> - GLM_FUNC_DECL genType two_over_root_pi(); - - /// Return 1 / sqrt(2). - /// @see gtc_constants - template <typename genType> - GLM_FUNC_DECL genType one_over_root_two(); - - /// Return sqrt(pi / 2). - /// @see gtc_constants - template <typename genType> - GLM_FUNC_DECL genType root_half_pi(); - - /// Return sqrt(2 * pi). - /// @see gtc_constants - template <typename genType> - GLM_FUNC_DECL genType root_two_pi(); - - /// Return sqrt(ln(4)). - /// @see gtc_constants - template <typename genType> - GLM_FUNC_DECL genType root_ln_four(); - - /// Return e constant. - /// @see gtc_constants - template <typename genType> - GLM_FUNC_DECL genType e(); - - /// Return Euler's constant. - /// @see gtc_constants - template <typename genType> - GLM_FUNC_DECL genType euler(); - - /// Return sqrt(2). - /// @see gtc_constants - template <typename genType> - GLM_FUNC_DECL genType root_two(); - - /// Return sqrt(3). - /// @see gtc_constants - template <typename genType> - GLM_FUNC_DECL genType root_three(); - - /// Return sqrt(5). - /// @see gtc_constants - template <typename genType> - GLM_FUNC_DECL genType root_five(); - - /// Return ln(2). - /// @see gtc_constants - template <typename genType> - GLM_FUNC_DECL genType ln_two(); - - /// Return ln(10). - /// @see gtc_constants - template <typename genType> - GLM_FUNC_DECL genType ln_ten(); - - /// Return ln(ln(2)). - /// @see gtc_constants - template <typename genType> - GLM_FUNC_DECL genType ln_ln_two(); - - /// Return 1 / 3. - /// @see gtc_constants - template <typename genType> - GLM_FUNC_DECL genType third(); - - /// Return 2 / 3. - /// @see gtc_constants - template <typename genType> - GLM_FUNC_DECL genType two_thirds(); - - /// Return the golden ratio constant. - /// @see gtc_constants - template <typename genType> - GLM_FUNC_DECL genType golden_ratio(); - - /// @} -} //namespace glm - -#include "constants.inl" diff --git a/extensions/common/glm/gtc/constants.inl b/extensions/common/glm/gtc/constants.inl deleted file mode 100644 index a5de153b1db..00000000000 --- a/extensions/common/glm/gtc/constants.inl +++ /dev/null @@ -1,210 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtc_constants -/// @file glm/gtc/constants.inl -/// @date 2011-10-14 / 2014-10-25 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#include <limits> - -namespace glm -{ - template <typename genType> - GLM_FUNC_QUALIFIER genType epsilon() - { - return std::numeric_limits<genType>::epsilon(); - } - - template <typename genType> - GLM_FUNC_QUALIFIER genType zero() - { - return genType(0); - } - - template <typename genType> - GLM_FUNC_QUALIFIER genType one() - { - return genType(1); - } - - template <typename genType> - GLM_FUNC_QUALIFIER genType pi() - { - return genType(3.14159265358979323846264338327950288); - } - - template <typename genType> - GLM_FUNC_QUALIFIER genType two_pi() - { - return genType(6.28318530717958647692528676655900576); - } - - template <typename genType> - GLM_FUNC_QUALIFIER genType root_pi() - { - return genType(1.772453850905516027); - } - - template <typename genType> - GLM_FUNC_QUALIFIER genType half_pi() - { - return genType(1.57079632679489661923132169163975144); - } - - template <typename genType> - GLM_FUNC_QUALIFIER genType three_over_two_pi() - { - return genType(4.71238898038468985769396507491925432); - } - - template <typename genType> - GLM_FUNC_QUALIFIER genType quarter_pi() - { - return genType(0.785398163397448309615660845819875721); - } - - template <typename genType> - GLM_FUNC_QUALIFIER genType one_over_pi() - { - return genType(0.318309886183790671537767526745028724); - } - - template <typename genType> - GLM_FUNC_QUALIFIER genType one_over_two_pi() - { - return genType(0.159154943091895335768883763372514362); - } - - template <typename genType> - GLM_FUNC_QUALIFIER genType two_over_pi() - { - return genType(0.636619772367581343075535053490057448); - } - - template <typename genType> - GLM_FUNC_QUALIFIER genType four_over_pi() - { - return genType(1.273239544735162686151070106980114898); - } - - template <typename genType> - GLM_FUNC_QUALIFIER genType two_over_root_pi() - { - return genType(1.12837916709551257389615890312154517); - } - - template <typename genType> - GLM_FUNC_QUALIFIER genType one_over_root_two() - { - return genType(0.707106781186547524400844362104849039); - } - - template <typename genType> - GLM_FUNC_QUALIFIER genType root_half_pi() - { - return genType(1.253314137315500251); - } - - template <typename genType> - GLM_FUNC_QUALIFIER genType root_two_pi() - { - return genType(2.506628274631000502); - } - - template <typename genType> - GLM_FUNC_QUALIFIER genType root_ln_four() - { - return genType(1.17741002251547469); - } - - template <typename genType> - GLM_FUNC_QUALIFIER genType e() - { - return genType(2.71828182845904523536); - } - - template <typename genType> - GLM_FUNC_QUALIFIER genType euler() - { - return genType(0.577215664901532860606); - } - - template <typename genType> - GLM_FUNC_QUALIFIER genType root_two() - { - return genType(1.41421356237309504880168872420969808); - } - - template <typename genType> - GLM_FUNC_QUALIFIER genType root_three() - { - return genType(1.73205080756887729352744634150587236); - } - - template <typename genType> - GLM_FUNC_QUALIFIER genType root_five() - { - return genType(2.23606797749978969640917366873127623); - } - - template <typename genType> - GLM_FUNC_QUALIFIER genType ln_two() - { - return genType(0.693147180559945309417232121458176568); - } - - template <typename genType> - GLM_FUNC_QUALIFIER genType ln_ten() - { - return genType(2.30258509299404568401799145468436421); - } - - template <typename genType> - GLM_FUNC_QUALIFIER genType ln_ln_two() - { - return genType(-0.3665129205816643); - } - - template <typename genType> - GLM_FUNC_QUALIFIER genType third() - { - return genType(0.3333333333333333333333333333333333333333); - } - - template <typename genType> - GLM_FUNC_QUALIFIER genType two_thirds() - { - return genType(0.666666666666666666666666666666666666667); - } - - template <typename genType> - GLM_FUNC_QUALIFIER genType golden_ratio() - { - return genType(1.61803398874989484820458683436563811); - } -} //namespace glm diff --git a/extensions/common/glm/gtc/epsilon.hpp b/extensions/common/glm/gtc/epsilon.hpp deleted file mode 100644 index 1140fb9ce4e..00000000000 --- a/extensions/common/glm/gtc/epsilon.hpp +++ /dev/null @@ -1,102 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtc_epsilon -/// @file glm/gtc/epsilon.hpp -/// @date 2012-04-07 / 2012-04-07 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// @see gtc_half_float (dependence) -/// @see gtc_quaternion (dependence) -/// -/// @defgroup gtc_epsilon GLM_GTC_epsilon -/// @ingroup gtc -/// -/// @brief Comparison functions for a user defined epsilon values. -/// -/// <glm/gtc/epsilon.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependencies -#include "../detail/setup.hpp" -#include "../detail/precision.hpp" - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTC_epsilon extension included") -#endif - -namespace glm -{ - /// @addtogroup gtc_epsilon - /// @{ - - /// Returns the component-wise comparison of |x - y| < epsilon. - /// True if this expression is satisfied. - /// - /// @see gtc_epsilon - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<bool, P> epsilonEqual( - vecType<T, P> const & x, - vecType<T, P> const & y, - T const & epsilon); - - /// Returns the component-wise comparison of |x - y| < epsilon. - /// True if this expression is satisfied. - /// - /// @see gtc_epsilon - template <typename genType> - GLM_FUNC_DECL bool epsilonEqual( - genType const & x, - genType const & y, - genType const & epsilon); - - /// Returns the component-wise comparison of |x - y| < epsilon. - /// True if this expression is not satisfied. - /// - /// @see gtc_epsilon - template <typename genType> - GLM_FUNC_DECL typename genType::boolType epsilonNotEqual( - genType const & x, - genType const & y, - typename genType::value_type const & epsilon); - - /// Returns the component-wise comparison of |x - y| >= epsilon. - /// True if this expression is not satisfied. - /// - /// @see gtc_epsilon - template <typename genType> - GLM_FUNC_DECL bool epsilonNotEqual( - genType const & x, - genType const & y, - genType const & epsilon); - - /// @} -}//namespace glm - -#include "epsilon.inl" diff --git a/extensions/common/glm/gtc/epsilon.inl b/extensions/common/glm/gtc/epsilon.inl deleted file mode 100644 index 8e65e97402b..00000000000 --- a/extensions/common/glm/gtc/epsilon.inl +++ /dev/null @@ -1,154 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtc_epsilon -/// @file glm/gtc/epsilon.inl -/// @date 2012-04-07 / 2012-04-07 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -// Dependency: -#include "quaternion.hpp" -#include "../vector_relational.hpp" -#include "../common.hpp" -#include "../vec2.hpp" -#include "../vec3.hpp" -#include "../vec4.hpp" - -namespace glm -{ - template <> - GLM_FUNC_QUALIFIER bool epsilonEqual - ( - float const & x, - float const & y, - float const & epsilon - ) - { - return abs(x - y) < epsilon; - } - - template <> - GLM_FUNC_QUALIFIER bool epsilonEqual - ( - double const & x, - double const & y, - double const & epsilon - ) - { - return abs(x - y) < epsilon; - } - - template <> - GLM_FUNC_QUALIFIER bool epsilonNotEqual - ( - float const & x, - float const & y, - float const & epsilon - ) - { - return abs(x - y) >= epsilon; - } - - template <> - GLM_FUNC_QUALIFIER bool epsilonNotEqual - ( - double const & x, - double const & y, - double const & epsilon - ) - { - return abs(x - y) >= epsilon; - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<bool, P> epsilonEqual - ( - vecType<T, P> const & x, - vecType<T, P> const & y, - T const & epsilon - ) - { - return lessThan(abs(x - y), vecType<T, P>(epsilon)); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<bool, P> epsilonEqual - ( - vecType<T, P> const & x, - vecType<T, P> const & y, - vecType<T, P> const & epsilon - ) - { - return lessThan(abs(x - y), vecType<T, P>(epsilon)); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<bool, P> epsilonNotEqual - ( - vecType<T, P> const & x, - vecType<T, P> const & y, - T const & epsilon - ) - { - return greaterThanEqual(abs(x - y), vecType<T, P>(epsilon)); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<bool, P> epsilonNotEqual - ( - vecType<T, P> const & x, - vecType<T, P> const & y, - vecType<T, P> const & epsilon - ) - { - return greaterThanEqual(abs(x - y), vecType<T, P>(epsilon)); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<bool, P> epsilonEqual - ( - tquat<T, P> const & x, - tquat<T, P> const & y, - T const & epsilon - ) - { - tvec4<T, P> v(x.x - y.x, x.y - y.y, x.z - y.z, x.w - y.w); - return lessThan(abs(v), tvec4<T, P>(epsilon)); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<bool, P> epsilonNotEqual - ( - tquat<T, P> const & x, - tquat<T, P> const & y, - T const & epsilon - ) - { - tvec4<T, P> v(x.x - y.x, x.y - y.y, x.z - y.z, x.w - y.w); - return greaterThanEqual(abs(v), tvec4<T, P>(epsilon)); - } -}//namespace glm diff --git a/extensions/common/glm/gtc/integer.hpp b/extensions/common/glm/gtc/integer.hpp deleted file mode 100644 index 5ae91dc1278..00000000000 --- a/extensions/common/glm/gtc/integer.hpp +++ /dev/null @@ -1,105 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtc_integer -/// @file glm/gtc/integer.hpp -/// @date 2014-11-17 / 2014-11-17 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// @see gtc_integer (dependence) -/// -/// @defgroup gtc_integer GLM_GTC_integer -/// @ingroup gtc -/// -/// @brief Allow to perform bit operations on integer values -/// -/// <glm/gtc/integer.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependencies -#include "../detail/setup.hpp" -#include "../detail/precision.hpp" -#include "../detail/func_common.hpp" -#include "../detail/func_integer.hpp" -#include "../detail/func_exponential.hpp" -#include <limits> - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTC_integer extension included") -#endif - -namespace glm -{ - /// @addtogroup gtc_integer - /// @{ - - /// Returns the log2 of x for integer values. Can be reliably using to compute mipmap count from the texture size. - /// @see gtc_integer - template <typename genIUType> - GLM_FUNC_DECL genIUType log2(genIUType x); - - /// Modulus. Returns x % y - /// for each component in x using the floating point value y. - /// - /// @tparam genIUType Integer-point scalar or vector types. - /// - /// @see gtc_integer - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/mod.xml">GLSL mod man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> - template <typename genIUType> - GLM_FUNC_DECL genIUType mod(genIUType x, genIUType y); - - /// Modulus. Returns x % y - /// for each component in x using the floating point value y. - /// - /// @tparam T Integer scalar types. - /// @tparam vecType vector types. - /// - /// @see gtc_integer - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/mod.xml">GLSL mod man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> mod(vecType<T, P> const & x, T y); - - /// Modulus. Returns x % y - /// for each component in x using the floating point value y. - /// - /// @tparam T Integer scalar types. - /// @tparam vecType vector types. - /// - /// @see gtc_integer - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/mod.xml">GLSL mod man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> mod(vecType<T, P> const & x, vecType<T, P> const & y); - - /// @} -} //namespace glm - -#include "integer.inl" diff --git a/extensions/common/glm/gtc/integer.inl b/extensions/common/glm/gtc/integer.inl deleted file mode 100644 index e893328415b..00000000000 --- a/extensions/common/glm/gtc/integer.inl +++ /dev/null @@ -1,74 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtc_integer -/// @file glm/gtc/integer.inl -/// @date 2014-11-17 / 2014-11-17 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -namespace glm{ -namespace detail -{ - template <typename T, precision P, template <class, precision> class vecType> - struct compute_log2<T, P, vecType, false> - { - GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & vec) - { - //Equivalent to return findMSB(vec); but save one function call in ASM with VC - //return findMSB(vec); - return vecType<T, P>(detail::compute_findMSB_vec<T, P, vecType, sizeof(T) * 8>::call(vec)); - } - }; - -# if GLM_HAS_BITSCAN_WINDOWS - template <precision P> - struct compute_log2<int, P, tvec4, false> - { - GLM_FUNC_QUALIFIER static tvec4<int, P> call(tvec4<int, P> const & vec) - { - tvec4<int, P> Result(glm::uninitialize); - - _BitScanReverse(reinterpret_cast<unsigned long*>(&Result.x), vec.x); - _BitScanReverse(reinterpret_cast<unsigned long*>(&Result.y), vec.y); - _BitScanReverse(reinterpret_cast<unsigned long*>(&Result.z), vec.z); - _BitScanReverse(reinterpret_cast<unsigned long*>(&Result.w), vec.w); - - return Result; - } - }; -# endif//GLM_HAS_BITSCAN_WINDOWS - - template <typename T, precision P, template <class, precision> class vecType, typename genType> - struct compute_mod<T, P, vecType, genType, false> - { - GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & a, genType const & b) - { - return a % b; - } - }; -}//namespace detail -}//namespace glm diff --git a/extensions/common/glm/gtc/matrix_access.hpp b/extensions/common/glm/gtc/matrix_access.hpp deleted file mode 100644 index 2628ab30d72..00000000000 --- a/extensions/common/glm/gtc/matrix_access.hpp +++ /dev/null @@ -1,88 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtc_matrix_access -/// @file glm/gtc/matrix_access.hpp -/// @date 2005-12-27 / 2011-05-16 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// -/// @defgroup gtc_matrix_access GLM_GTC_matrix_access -/// @ingroup gtc -/// -/// Defines functions to access rows or columns of a matrix easily. -/// <glm/gtc/matrix_access.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependency: -#include "../detail/setup.hpp" - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTC_matrix_access extension included") -#endif - -namespace glm -{ - /// @addtogroup gtc_matrix_access - /// @{ - - /// Get a specific row of a matrix. - /// @see gtc_matrix_access - template <typename genType> - GLM_FUNC_DECL typename genType::row_type row( - genType const & m, - length_t index); - - /// Set a specific row to a matrix. - /// @see gtc_matrix_access - template <typename genType> - GLM_FUNC_DECL genType row( - genType const & m, - length_t index, - typename genType::row_type const & x); - - /// Get a specific column of a matrix. - /// @see gtc_matrix_access - template <typename genType> - GLM_FUNC_DECL typename genType::col_type column( - genType const & m, - length_t index); - - /// Set a specific column to a matrix. - /// @see gtc_matrix_access - template <typename genType> - GLM_FUNC_DECL genType column( - genType const & m, - length_t index, - typename genType::col_type const & x); - - /// @} -}//namespace glm - -#include "matrix_access.inl" diff --git a/extensions/common/glm/gtc/matrix_access.inl b/extensions/common/glm/gtc/matrix_access.inl deleted file mode 100644 index c0c2faad79e..00000000000 --- a/extensions/common/glm/gtc/matrix_access.inl +++ /dev/null @@ -1,92 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtc_matrix_access -/// @file glm/gtc/matrix_access.inl -/// @date 2005-12-27 / 2011-06-05 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template <typename genType> - GLM_FUNC_QUALIFIER genType row - ( - genType const & m, - length_t index, - typename genType::row_type const & x - ) - { - assert(index >= 0 && static_cast<detail::component_count_t>(index) < detail::component_count(m[0])); - - genType Result = m; - for(detail::component_count_t i = 0; i < detail::component_count(m); ++i) - Result[i][index] = x[i]; - return Result; - } - - template <typename genType> - GLM_FUNC_QUALIFIER typename genType::row_type row - ( - genType const & m, - length_t index - ) - { - assert(index >= 0 && static_cast<detail::component_count_t>(index) < detail::component_count(m[0])); - - typename genType::row_type Result; - for(detail::component_count_t i = 0; i < detail::component_count(m); ++i) - Result[i] = m[i][index]; - return Result; - } - - template <typename genType> - GLM_FUNC_QUALIFIER genType column - ( - genType const & m, - length_t index, - typename genType::col_type const & x - ) - { - assert(index >= 0 && static_cast<detail::component_count_t>(index) < detail::component_count(m)); - - genType Result = m; - Result[index] = x; - return Result; - } - - template <typename genType> - GLM_FUNC_QUALIFIER typename genType::col_type column - ( - genType const & m, - length_t index - ) - { - assert(index >= 0 && static_cast<detail::component_count_t>(index) < detail::component_count(m)); - - return m[index]; - } -}//namespace glm diff --git a/extensions/common/glm/gtc/matrix_integer.hpp b/extensions/common/glm/gtc/matrix_integer.hpp deleted file mode 100644 index 01b5c96a906..00000000000 --- a/extensions/common/glm/gtc/matrix_integer.hpp +++ /dev/null @@ -1,515 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtc_matrix_integer -/// @file glm/gtc/matrix_integer.hpp -/// @date 2011-01-20 / 2011-06-05 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// -/// @defgroup gtc_matrix_integer GLM_GTC_matrix_integer -/// @ingroup gtc -/// -/// Defines a number of matrices with integer types. -/// <glm/gtc/matrix_integer.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependency: -#include "../mat2x2.hpp" -#include "../mat2x3.hpp" -#include "../mat2x4.hpp" -#include "../mat3x2.hpp" -#include "../mat3x3.hpp" -#include "../mat3x4.hpp" -#include "../mat4x2.hpp" -#include "../mat4x3.hpp" -#include "../mat4x4.hpp" - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTC_matrix_integer extension included") -#endif - -namespace glm -{ - /// @addtogroup gtc_matrix_integer - /// @{ - - /// High-precision signed integer 2x2 matrix. - /// @see gtc_matrix_integer - typedef tmat2x2<int, highp> highp_imat2; - - /// High-precision signed integer 3x3 matrix. - /// @see gtc_matrix_integer - typedef tmat3x3<int, highp> highp_imat3; - - /// High-precision signed integer 4x4 matrix. - /// @see gtc_matrix_integer - typedef tmat4x4<int, highp> highp_imat4; - - /// High-precision signed integer 2x2 matrix. - /// @see gtc_matrix_integer - typedef tmat2x2<int, highp> highp_imat2x2; - - /// High-precision signed integer 2x3 matrix. - /// @see gtc_matrix_integer - typedef tmat2x3<int, highp> highp_imat2x3; - - /// High-precision signed integer 2x4 matrix. - /// @see gtc_matrix_integer - typedef tmat2x4<int, highp> highp_imat2x4; - - /// High-precision signed integer 3x2 matrix. - /// @see gtc_matrix_integer - typedef tmat3x2<int, highp> highp_imat3x2; - - /// High-precision signed integer 3x3 matrix. - /// @see gtc_matrix_integer - typedef tmat3x3<int, highp> highp_imat3x3; - - /// High-precision signed integer 3x4 matrix. - /// @see gtc_matrix_integer - typedef tmat3x4<int, highp> highp_imat3x4; - - /// High-precision signed integer 4x2 matrix. - /// @see gtc_matrix_integer - typedef tmat4x2<int, highp> highp_imat4x2; - - /// High-precision signed integer 4x3 matrix. - /// @see gtc_matrix_integer - typedef tmat4x3<int, highp> highp_imat4x3; - - /// High-precision signed integer 4x4 matrix. - /// @see gtc_matrix_integer - typedef tmat4x4<int, highp> highp_imat4x4; - - - /// Medium-precision signed integer 2x2 matrix. - /// @see gtc_matrix_integer - typedef tmat2x2<int, mediump> mediump_imat2; - - /// Medium-precision signed integer 3x3 matrix. - /// @see gtc_matrix_integer - typedef tmat3x3<int, mediump> mediump_imat3; - - /// Medium-precision signed integer 4x4 matrix. - /// @see gtc_matrix_integer - typedef tmat4x4<int, mediump> mediump_imat4; - - - /// Medium-precision signed integer 2x2 matrix. - /// @see gtc_matrix_integer - typedef tmat2x2<int, mediump> mediump_imat2x2; - - /// Medium-precision signed integer 2x3 matrix. - /// @see gtc_matrix_integer - typedef tmat2x3<int, mediump> mediump_imat2x3; - - /// Medium-precision signed integer 2x4 matrix. - /// @see gtc_matrix_integer - typedef tmat2x4<int, mediump> mediump_imat2x4; - - /// Medium-precision signed integer 3x2 matrix. - /// @see gtc_matrix_integer - typedef tmat3x2<int, mediump> mediump_imat3x2; - - /// Medium-precision signed integer 3x3 matrix. - /// @see gtc_matrix_integer - typedef tmat3x3<int, mediump> mediump_imat3x3; - - /// Medium-precision signed integer 3x4 matrix. - /// @see gtc_matrix_integer - typedef tmat3x4<int, mediump> mediump_imat3x4; - - /// Medium-precision signed integer 4x2 matrix. - /// @see gtc_matrix_integer - typedef tmat4x2<int, mediump> mediump_imat4x2; - - /// Medium-precision signed integer 4x3 matrix. - /// @see gtc_matrix_integer - typedef tmat4x3<int, mediump> mediump_imat4x3; - - /// Medium-precision signed integer 4x4 matrix. - /// @see gtc_matrix_integer - typedef tmat4x4<int, mediump> mediump_imat4x4; - - - /// Low-precision signed integer 2x2 matrix. - /// @see gtc_matrix_integer - typedef tmat2x2<int, lowp> lowp_imat2; - - /// Low-precision signed integer 3x3 matrix. - /// @see gtc_matrix_integer - typedef tmat3x3<int, lowp> lowp_imat3; - - /// Low-precision signed integer 4x4 matrix. - /// @see gtc_matrix_integer - typedef tmat4x4<int, lowp> lowp_imat4; - - - /// Low-precision signed integer 2x2 matrix. - /// @see gtc_matrix_integer - typedef tmat2x2<int, lowp> lowp_imat2x2; - - /// Low-precision signed integer 2x3 matrix. - /// @see gtc_matrix_integer - typedef tmat2x3<int, lowp> lowp_imat2x3; - - /// Low-precision signed integer 2x4 matrix. - /// @see gtc_matrix_integer - typedef tmat2x4<int, lowp> lowp_imat2x4; - - /// Low-precision signed integer 3x2 matrix. - /// @see gtc_matrix_integer - typedef tmat3x2<int, lowp> lowp_imat3x2; - - /// Low-precision signed integer 3x3 matrix. - /// @see gtc_matrix_integer - typedef tmat3x3<int, lowp> lowp_imat3x3; - - /// Low-precision signed integer 3x4 matrix. - /// @see gtc_matrix_integer - typedef tmat3x4<int, lowp> lowp_imat3x4; - - /// Low-precision signed integer 4x2 matrix. - /// @see gtc_matrix_integer - typedef tmat4x2<int, lowp> lowp_imat4x2; - - /// Low-precision signed integer 4x3 matrix. - /// @see gtc_matrix_integer - typedef tmat4x3<int, lowp> lowp_imat4x3; - - /// Low-precision signed integer 4x4 matrix. - /// @see gtc_matrix_integer - typedef tmat4x4<int, lowp> lowp_imat4x4; - - - /// High-precision unsigned integer 2x2 matrix. - /// @see gtc_matrix_integer - typedef tmat2x2<uint, highp> highp_umat2; - - /// High-precision unsigned integer 3x3 matrix. - /// @see gtc_matrix_integer - typedef tmat3x3<uint, highp> highp_umat3; - - /// High-precision unsigned integer 4x4 matrix. - /// @see gtc_matrix_integer - typedef tmat4x4<uint, highp> highp_umat4; - - /// High-precision unsigned integer 2x2 matrix. - /// @see gtc_matrix_integer - typedef tmat2x2<uint, highp> highp_umat2x2; - - /// High-precision unsigned integer 2x3 matrix. - /// @see gtc_matrix_integer - typedef tmat2x3<uint, highp> highp_umat2x3; - - /// High-precision unsigned integer 2x4 matrix. - /// @see gtc_matrix_integer - typedef tmat2x4<uint, highp> highp_umat2x4; - - /// High-precision unsigned integer 3x2 matrix. - /// @see gtc_matrix_integer - typedef tmat3x2<uint, highp> highp_umat3x2; - - /// High-precision unsigned integer 3x3 matrix. - /// @see gtc_matrix_integer - typedef tmat3x3<uint, highp> highp_umat3x3; - - /// High-precision unsigned integer 3x4 matrix. - /// @see gtc_matrix_integer - typedef tmat3x4<uint, highp> highp_umat3x4; - - /// High-precision unsigned integer 4x2 matrix. - /// @see gtc_matrix_integer - typedef tmat4x2<uint, highp> highp_umat4x2; - - /// High-precision unsigned integer 4x3 matrix. - /// @see gtc_matrix_integer - typedef tmat4x3<uint, highp> highp_umat4x3; - - /// High-precision unsigned integer 4x4 matrix. - /// @see gtc_matrix_integer - typedef tmat4x4<uint, highp> highp_umat4x4; - - - /// Medium-precision unsigned integer 2x2 matrix. - /// @see gtc_matrix_integer - typedef tmat2x2<uint, mediump> mediump_umat2; - - /// Medium-precision unsigned integer 3x3 matrix. - /// @see gtc_matrix_integer - typedef tmat3x3<uint, mediump> mediump_umat3; - - /// Medium-precision unsigned integer 4x4 matrix. - /// @see gtc_matrix_integer - typedef tmat4x4<uint, mediump> mediump_umat4; - - - /// Medium-precision unsigned integer 2x2 matrix. - /// @see gtc_matrix_integer - typedef tmat2x2<uint, mediump> mediump_umat2x2; - - /// Medium-precision unsigned integer 2x3 matrix. - /// @see gtc_matrix_integer - typedef tmat2x3<uint, mediump> mediump_umat2x3; - - /// Medium-precision unsigned integer 2x4 matrix. - /// @see gtc_matrix_integer - typedef tmat2x4<uint, mediump> mediump_umat2x4; - - /// Medium-precision unsigned integer 3x2 matrix. - /// @see gtc_matrix_integer - typedef tmat3x2<uint, mediump> mediump_umat3x2; - - /// Medium-precision unsigned integer 3x3 matrix. - /// @see gtc_matrix_integer - typedef tmat3x3<uint, mediump> mediump_umat3x3; - - /// Medium-precision unsigned integer 3x4 matrix. - /// @see gtc_matrix_integer - typedef tmat3x4<uint, mediump> mediump_umat3x4; - - /// Medium-precision unsigned integer 4x2 matrix. - /// @see gtc_matrix_integer - typedef tmat4x2<uint, mediump> mediump_umat4x2; - - /// Medium-precision unsigned integer 4x3 matrix. - /// @see gtc_matrix_integer - typedef tmat4x3<uint, mediump> mediump_umat4x3; - - /// Medium-precision unsigned integer 4x4 matrix. - /// @see gtc_matrix_integer - typedef tmat4x4<uint, mediump> mediump_umat4x4; - - - /// Low-precision unsigned integer 2x2 matrix. - /// @see gtc_matrix_integer - typedef tmat2x2<uint, lowp> lowp_umat2; - - /// Low-precision unsigned integer 3x3 matrix. - /// @see gtc_matrix_integer - typedef tmat3x3<uint, lowp> lowp_umat3; - - /// Low-precision unsigned integer 4x4 matrix. - /// @see gtc_matrix_integer - typedef tmat4x4<uint, lowp> lowp_umat4; - - - /// Low-precision unsigned integer 2x2 matrix. - /// @see gtc_matrix_integer - typedef tmat2x2<uint, lowp> lowp_umat2x2; - - /// Low-precision unsigned integer 2x3 matrix. - /// @see gtc_matrix_integer - typedef tmat2x3<uint, lowp> lowp_umat2x3; - - /// Low-precision unsigned integer 2x4 matrix. - /// @see gtc_matrix_integer - typedef tmat2x4<uint, lowp> lowp_umat2x4; - - /// Low-precision unsigned integer 3x2 matrix. - /// @see gtc_matrix_integer - typedef tmat3x2<uint, lowp> lowp_umat3x2; - - /// Low-precision unsigned integer 3x3 matrix. - /// @see gtc_matrix_integer - typedef tmat3x3<uint, lowp> lowp_umat3x3; - - /// Low-precision unsigned integer 3x4 matrix. - /// @see gtc_matrix_integer - typedef tmat3x4<uint, lowp> lowp_umat3x4; - - /// Low-precision unsigned integer 4x2 matrix. - /// @see gtc_matrix_integer - typedef tmat4x2<uint, lowp> lowp_umat4x2; - - /// Low-precision unsigned integer 4x3 matrix. - /// @see gtc_matrix_integer - typedef tmat4x3<uint, lowp> lowp_umat4x3; - - /// Low-precision unsigned integer 4x4 matrix. - /// @see gtc_matrix_integer - typedef tmat4x4<uint, lowp> lowp_umat4x4; - -#if(defined(GLM_PRECISION_HIGHP_INT)) - typedef highp_imat2 imat2; - typedef highp_imat3 imat3; - typedef highp_imat4 imat4; - typedef highp_imat2x2 imat2x2; - typedef highp_imat2x3 imat2x3; - typedef highp_imat2x4 imat2x4; - typedef highp_imat3x2 imat3x2; - typedef highp_imat3x3 imat3x3; - typedef highp_imat3x4 imat3x4; - typedef highp_imat4x2 imat4x2; - typedef highp_imat4x3 imat4x3; - typedef highp_imat4x4 imat4x4; -#elif(defined(GLM_PRECISION_LOWP_INT)) - typedef lowp_imat2 imat2; - typedef lowp_imat3 imat3; - typedef lowp_imat4 imat4; - typedef lowp_imat2x2 imat2x2; - typedef lowp_imat2x3 imat2x3; - typedef lowp_imat2x4 imat2x4; - typedef lowp_imat3x2 imat3x2; - typedef lowp_imat3x3 imat3x3; - typedef lowp_imat3x4 imat3x4; - typedef lowp_imat4x2 imat4x2; - typedef lowp_imat4x3 imat4x3; - typedef lowp_imat4x4 imat4x4; -#else //if(defined(GLM_PRECISION_MEDIUMP_INT)) - - /// Signed integer 2x2 matrix. - /// @see gtc_matrix_integer - typedef mediump_imat2 imat2; - - /// Signed integer 3x3 matrix. - /// @see gtc_matrix_integer - typedef mediump_imat3 imat3; - - /// Signed integer 4x4 matrix. - /// @see gtc_matrix_integer - typedef mediump_imat4 imat4; - - /// Signed integer 2x2 matrix. - /// @see gtc_matrix_integer - typedef mediump_imat2x2 imat2x2; - - /// Signed integer 2x3 matrix. - /// @see gtc_matrix_integer - typedef mediump_imat2x3 imat2x3; - - /// Signed integer 2x4 matrix. - /// @see gtc_matrix_integer - typedef mediump_imat2x4 imat2x4; - - /// Signed integer 3x2 matrix. - /// @see gtc_matrix_integer - typedef mediump_imat3x2 imat3x2; - - /// Signed integer 3x3 matrix. - /// @see gtc_matrix_integer - typedef mediump_imat3x3 imat3x3; - - /// Signed integer 3x4 matrix. - /// @see gtc_matrix_integer - typedef mediump_imat3x4 imat3x4; - - /// Signed integer 4x2 matrix. - /// @see gtc_matrix_integer - typedef mediump_imat4x2 imat4x2; - - /// Signed integer 4x3 matrix. - /// @see gtc_matrix_integer - typedef mediump_imat4x3 imat4x3; - - /// Signed integer 4x4 matrix. - /// @see gtc_matrix_integer - typedef mediump_imat4x4 imat4x4; -#endif//GLM_PRECISION - -#if(defined(GLM_PRECISION_HIGHP_UINT)) - typedef highp_umat2 umat2; - typedef highp_umat3 umat3; - typedef highp_umat4 umat4; - typedef highp_umat2x2 umat2x2; - typedef highp_umat2x3 umat2x3; - typedef highp_umat2x4 umat2x4; - typedef highp_umat3x2 umat3x2; - typedef highp_umat3x3 umat3x3; - typedef highp_umat3x4 umat3x4; - typedef highp_umat4x2 umat4x2; - typedef highp_umat4x3 umat4x3; - typedef highp_umat4x4 umat4x4; -#elif(defined(GLM_PRECISION_LOWP_UINT)) - typedef lowp_umat2 umat2; - typedef lowp_umat3 umat3; - typedef lowp_umat4 umat4; - typedef lowp_umat2x2 umat2x2; - typedef lowp_umat2x3 umat2x3; - typedef lowp_umat2x4 umat2x4; - typedef lowp_umat3x2 umat3x2; - typedef lowp_umat3x3 umat3x3; - typedef lowp_umat3x4 umat3x4; - typedef lowp_umat4x2 umat4x2; - typedef lowp_umat4x3 umat4x3; - typedef lowp_umat4x4 umat4x4; -#else //if(defined(GLM_PRECISION_MEDIUMP_UINT)) - - /// Unsigned integer 2x2 matrix. - /// @see gtc_matrix_integer - typedef mediump_umat2 umat2; - - /// Unsigned integer 3x3 matrix. - /// @see gtc_matrix_integer - typedef mediump_umat3 umat3; - - /// Unsigned integer 4x4 matrix. - /// @see gtc_matrix_integer - typedef mediump_umat4 umat4; - - /// Unsigned integer 2x2 matrix. - /// @see gtc_matrix_integer - typedef mediump_umat2x2 umat2x2; - - /// Unsigned integer 2x3 matrix. - /// @see gtc_matrix_integer - typedef mediump_umat2x3 umat2x3; - - /// Unsigned integer 2x4 matrix. - /// @see gtc_matrix_integer - typedef mediump_umat2x4 umat2x4; - - /// Unsigned integer 3x2 matrix. - /// @see gtc_matrix_integer - typedef mediump_umat3x2 umat3x2; - - /// Unsigned integer 3x3 matrix. - /// @see gtc_matrix_integer - typedef mediump_umat3x3 umat3x3; - - /// Unsigned integer 3x4 matrix. - /// @see gtc_matrix_integer - typedef mediump_umat3x4 umat3x4; - - /// Unsigned integer 4x2 matrix. - /// @see gtc_matrix_integer - typedef mediump_umat4x2 umat4x2; - - /// Unsigned integer 4x3 matrix. - /// @see gtc_matrix_integer - typedef mediump_umat4x3 umat4x3; - - /// Unsigned integer 4x4 matrix. - /// @see gtc_matrix_integer - typedef mediump_umat4x4 umat4x4; -#endif//GLM_PRECISION - - /// @} -}//namespace glm diff --git a/extensions/common/glm/gtc/matrix_inverse.hpp b/extensions/common/glm/gtc/matrix_inverse.hpp deleted file mode 100644 index cdd57e65995..00000000000 --- a/extensions/common/glm/gtc/matrix_inverse.hpp +++ /dev/null @@ -1,78 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtc_matrix_inverse -/// @file glm/gtc/matrix_inverse.hpp -/// @date 2005-12-21 / 2011-06-05 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// -/// @defgroup gtc_matrix_inverse GLM_GTC_matrix_inverse -/// @ingroup gtc -/// -/// Defines additional matrix inverting functions. -/// <glm/gtc/matrix_inverse.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependencies -#include "../detail/setup.hpp" -#include "../matrix.hpp" -#include "../mat2x2.hpp" -#include "../mat3x3.hpp" -#include "../mat4x4.hpp" - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTC_matrix_inverse extension included") -#endif - -namespace glm -{ - /// @addtogroup gtc_matrix_inverse - /// @{ - - /// Fast matrix inverse for affine matrix. - /// - /// @param m Input matrix to invert. - /// @tparam genType Squared floating-point matrix: half, float or double. Inverse of matrix based of half-precision floating point value is highly innacurate. - /// @see gtc_matrix_inverse - template <typename genType> - GLM_FUNC_DECL genType affineInverse(genType const & m); - - /// Compute the inverse transpose of a matrix. - /// - /// @param m Input matrix to invert transpose. - /// @tparam genType Squared floating-point matrix: half, float or double. Inverse of matrix based of half-precision floating point value is highly innacurate. - /// @see gtc_matrix_inverse - template <typename genType> - GLM_FUNC_DECL genType inverseTranspose(genType const & m); - - /// @} -}//namespace glm - -#include "matrix_inverse.inl" diff --git a/extensions/common/glm/gtc/matrix_inverse.inl b/extensions/common/glm/gtc/matrix_inverse.inl deleted file mode 100644 index d88a331985e..00000000000 --- a/extensions/common/glm/gtc/matrix_inverse.inl +++ /dev/null @@ -1,148 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtc_matrix_inverse -/// @file glm/gtc/matrix_inverse.inl -/// @date 2005-12-21 / 2011-06-15 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x3<T, P> affineInverse(tmat3x3<T, P> const & m) - { - tmat3x3<T, P> Result(m); - Result[2] = tvec3<T, P>(0, 0, 1); - Result = transpose(Result); - tvec3<T, P> Translation = Result * tvec3<T, P>(-tvec2<T, P>(m[2]), m[2][2]); - Result[2] = Translation; - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P> affineInverse(tmat4x4<T, P> const & m) - { - tmat4x4<T, P> Result(m); - Result[3] = tvec4<T, P>(0, 0, 0, 1); - Result = transpose(Result); - tvec4<T, P> Translation = Result * tvec4<T, P>(-tvec3<T, P>(m[3]), m[3][3]); - Result[3] = Translation; - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x2<T, P> inverseTranspose(tmat2x2<T, P> const & m) - { - T Determinant = m[0][0] * m[1][1] - m[1][0] * m[0][1]; - - tmat2x2<T, P> Inverse( - + m[1][1] / Determinant, - - m[0][1] / Determinant, - - m[1][0] / Determinant, - + m[0][0] / Determinant); - - return Inverse; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x3<T, P> inverseTranspose(tmat3x3<T, P> const & m) - { - T Determinant = - + m[0][0] * (m[1][1] * m[2][2] - m[1][2] * m[2][1]) - - m[0][1] * (m[1][0] * m[2][2] - m[1][2] * m[2][0]) - + m[0][2] * (m[1][0] * m[2][1] - m[1][1] * m[2][0]); - - tmat3x3<T, P> Inverse(uninitialize); - Inverse[0][0] = + (m[1][1] * m[2][2] - m[2][1] * m[1][2]); - Inverse[0][1] = - (m[1][0] * m[2][2] - m[2][0] * m[1][2]); - Inverse[0][2] = + (m[1][0] * m[2][1] - m[2][0] * m[1][1]); - Inverse[1][0] = - (m[0][1] * m[2][2] - m[2][1] * m[0][2]); - Inverse[1][1] = + (m[0][0] * m[2][2] - m[2][0] * m[0][2]); - Inverse[1][2] = - (m[0][0] * m[2][1] - m[2][0] * m[0][1]); - Inverse[2][0] = + (m[0][1] * m[1][2] - m[1][1] * m[0][2]); - Inverse[2][1] = - (m[0][0] * m[1][2] - m[1][0] * m[0][2]); - Inverse[2][2] = + (m[0][0] * m[1][1] - m[1][0] * m[0][1]); - Inverse /= Determinant; - - return Inverse; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P> inverseTranspose(tmat4x4<T, P> const & m) - { - T SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; - T SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; - T SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; - T SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; - T SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; - T SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; - T SubFactor06 = m[1][2] * m[3][3] - m[3][2] * m[1][3]; - T SubFactor07 = m[1][1] * m[3][3] - m[3][1] * m[1][3]; - T SubFactor08 = m[1][1] * m[3][2] - m[3][1] * m[1][2]; - T SubFactor09 = m[1][0] * m[3][3] - m[3][0] * m[1][3]; - T SubFactor10 = m[1][0] * m[3][2] - m[3][0] * m[1][2]; - T SubFactor11 = m[1][1] * m[3][3] - m[3][1] * m[1][3]; - T SubFactor12 = m[1][0] * m[3][1] - m[3][0] * m[1][1]; - T SubFactor13 = m[1][2] * m[2][3] - m[2][2] * m[1][3]; - T SubFactor14 = m[1][1] * m[2][3] - m[2][1] * m[1][3]; - T SubFactor15 = m[1][1] * m[2][2] - m[2][1] * m[1][2]; - T SubFactor16 = m[1][0] * m[2][3] - m[2][0] * m[1][3]; - T SubFactor17 = m[1][0] * m[2][2] - m[2][0] * m[1][2]; - T SubFactor18 = m[1][0] * m[2][1] - m[2][0] * m[1][1]; - - tmat4x4<T, P> Inverse(uninitialize); - Inverse[0][0] = + (m[1][1] * SubFactor00 - m[1][2] * SubFactor01 + m[1][3] * SubFactor02); - Inverse[0][1] = - (m[1][0] * SubFactor00 - m[1][2] * SubFactor03 + m[1][3] * SubFactor04); - Inverse[0][2] = + (m[1][0] * SubFactor01 - m[1][1] * SubFactor03 + m[1][3] * SubFactor05); - Inverse[0][3] = - (m[1][0] * SubFactor02 - m[1][1] * SubFactor04 + m[1][2] * SubFactor05); - - Inverse[1][0] = - (m[0][1] * SubFactor00 - m[0][2] * SubFactor01 + m[0][3] * SubFactor02); - Inverse[1][1] = + (m[0][0] * SubFactor00 - m[0][2] * SubFactor03 + m[0][3] * SubFactor04); - Inverse[1][2] = - (m[0][0] * SubFactor01 - m[0][1] * SubFactor03 + m[0][3] * SubFactor05); - Inverse[1][3] = + (m[0][0] * SubFactor02 - m[0][1] * SubFactor04 + m[0][2] * SubFactor05); - - Inverse[2][0] = + (m[0][1] * SubFactor06 - m[0][2] * SubFactor07 + m[0][3] * SubFactor08); - Inverse[2][1] = - (m[0][0] * SubFactor06 - m[0][2] * SubFactor09 + m[0][3] * SubFactor10); - Inverse[2][2] = + (m[0][0] * SubFactor11 - m[0][1] * SubFactor09 + m[0][3] * SubFactor12); - Inverse[2][3] = - (m[0][0] * SubFactor08 - m[0][1] * SubFactor10 + m[0][2] * SubFactor12); - - Inverse[3][0] = - (m[0][1] * SubFactor13 - m[0][2] * SubFactor14 + m[0][3] * SubFactor15); - Inverse[3][1] = + (m[0][0] * SubFactor13 - m[0][2] * SubFactor16 + m[0][3] * SubFactor17); - Inverse[3][2] = - (m[0][0] * SubFactor14 - m[0][1] * SubFactor16 + m[0][3] * SubFactor18); - Inverse[3][3] = + (m[0][0] * SubFactor15 - m[0][1] * SubFactor17 + m[0][2] * SubFactor18); - - T Determinant = - + m[0][0] * Inverse[0][0] - + m[0][1] * Inverse[0][1] - + m[0][2] * Inverse[0][2] - + m[0][3] * Inverse[0][3]; - - Inverse /= Determinant; - - return Inverse; - } -}//namespace glm diff --git a/extensions/common/glm/gtc/matrix_transform.hpp b/extensions/common/glm/gtc/matrix_transform.hpp deleted file mode 100644 index 9c8b3e24c0f..00000000000 --- a/extensions/common/glm/gtc/matrix_transform.hpp +++ /dev/null @@ -1,304 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtc_matrix_transform -/// @file glm/gtc/matrix_transform.hpp -/// @date 2009-04-29 / 2011-05-16 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// @see gtx_transform -/// @see gtx_transform2 -/// -/// @defgroup gtc_matrix_transform GLM_GTC_matrix_transform -/// @ingroup gtc -/// -/// @brief Defines functions that generate common transformation matrices. -/// -/// The matrices generated by this extension use standard OpenGL fixed-function -/// conventions. For example, the lookAt function generates a transform from world -/// space into the specific eye space that the projective matrix functions -/// (perspective, ortho, etc) are designed to expect. The OpenGL compatibility -/// specifications defines the particular layout of this eye space. -/// -/// <glm/gtc/matrix_transform.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependencies -#include "../mat4x4.hpp" -#include "../vec2.hpp" -#include "../vec3.hpp" -#include "../vec4.hpp" -#include "../gtc/constants.hpp" - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTC_matrix_transform extension included") -#endif - -namespace glm -{ - /// @addtogroup gtc_matrix_transform - /// @{ - - /// Builds a translation 4 * 4 matrix created from a vector of 3 components. - /// - /// @param m Input matrix multiplied by this translation matrix. - /// @param v Coordinates of a translation vector. - /// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double. - /// @code - /// #include <glm/glm.hpp> - /// #include <glm/gtc/matrix_transform.hpp> - /// ... - /// glm::mat4 m = glm::translate(glm::mat4(1.0f), glm::vec3(1.0f)); - /// // m[0][0] == 1.0f, m[0][1] == 0.0f, m[0][2] == 0.0f, m[0][3] == 0.0f - /// // m[1][0] == 0.0f, m[1][1] == 1.0f, m[1][2] == 0.0f, m[1][3] == 0.0f - /// // m[2][0] == 0.0f, m[2][1] == 0.0f, m[2][2] == 1.0f, m[2][3] == 0.0f - /// // m[3][0] == 1.0f, m[3][1] == 1.0f, m[3][2] == 1.0f, m[3][3] == 1.0f - /// @endcode - /// @see gtc_matrix_transform - /// @see - translate(tmat4x4<T, P> const & m, T x, T y, T z) - /// @see - translate(tvec3<T, P> const & v) - template <typename T, precision P> - GLM_FUNC_DECL tmat4x4<T, P> translate( - tmat4x4<T, P> const & m, - tvec3<T, P> const & v); - - /// Builds a rotation 4 * 4 matrix created from an axis vector and an angle. - /// - /// @param m Input matrix multiplied by this rotation matrix. - /// @param angle Rotation angle expressed in radians. - /// @param axis Rotation axis, recommanded to be normalized. - /// @tparam T Value type used to build the matrix. Supported: half, float or double. - /// @see gtc_matrix_transform - /// @see - rotate(tmat4x4<T, P> const & m, T angle, T x, T y, T z) - /// @see - rotate(T angle, tvec3<T, P> const & v) - template <typename T, precision P> - GLM_FUNC_DECL tmat4x4<T, P> rotate( - tmat4x4<T, P> const & m, - T angle, - tvec3<T, P> const & axis); - - /// Builds a scale 4 * 4 matrix created from 3 scalars. - /// - /// @param m Input matrix multiplied by this scale matrix. - /// @param v Ratio of scaling for each axis. - /// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double. - /// @see gtc_matrix_transform - /// @see - scale(tmat4x4<T, P> const & m, T x, T y, T z) - /// @see - scale(tvec3<T, P> const & v) - template <typename T, precision P> - GLM_FUNC_DECL tmat4x4<T, P> scale( - tmat4x4<T, P> const & m, - tvec3<T, P> const & v); - - /// Creates a matrix for an orthographic parallel viewing volume. - /// - /// @param left - /// @param right - /// @param bottom - /// @param top - /// @param zNear - /// @param zFar - /// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double. - /// @see gtc_matrix_transform - /// @see - glm::ortho(T const & left, T const & right, T const & bottom, T const & top) - template <typename T> - GLM_FUNC_DECL tmat4x4<T, defaultp> ortho( - T left, - T right, - T bottom, - T top, - T zNear, - T zFar); - - /// Creates a matrix for projecting two-dimensional coordinates onto the screen. - /// - /// @param left - /// @param right - /// @param bottom - /// @param top - /// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double. - /// @see gtc_matrix_transform - /// @see - glm::ortho(T const & left, T const & right, T const & bottom, T const & top, T const & zNear, T const & zFar) - template <typename T> - GLM_FUNC_DECL tmat4x4<T, defaultp> ortho( - T left, - T right, - T bottom, - T top); - - /// Creates a frustum matrix. - /// - /// @param left - /// @param right - /// @param bottom - /// @param top - /// @param near - /// @param far - /// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double. - /// @see gtc_matrix_transform - template <typename T> - GLM_FUNC_DECL tmat4x4<T, defaultp> frustum( - T left, - T right, - T bottom, - T top, - T near, - T far); - - /// Creates a matrix for a symetric perspective-view frustum. - /// - /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. - /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). - /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). - /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). - /// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double. - /// @see gtc_matrix_transform - template <typename T> - GLM_FUNC_DECL tmat4x4<T, defaultp> perspective( - T fovy, - T aspect, - T near, - T far); - - /// Builds a perspective projection matrix based on a field of view. - /// - /// @param fov Expressed in radians. - /// @param width - /// @param height - /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). - /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). - /// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double. - /// @see gtc_matrix_transform - template <typename T> - GLM_FUNC_DECL tmat4x4<T, defaultp> perspectiveFov( - T fov, - T width, - T height, - T near, - T far); - - /// Creates a matrix for a symmetric perspective-view frustum with far plane at infinite. - /// - /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. - /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). - /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). - /// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double. - /// @see gtc_matrix_transform - template <typename T> - GLM_FUNC_DECL tmat4x4<T, defaultp> infinitePerspective( - T fovy, T aspect, T near); - - /// Creates a matrix for a symmetric perspective-view frustum with far plane at infinite for graphics hardware that doesn't support depth clamping. - /// - /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. - /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). - /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). - /// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double. - /// @see gtc_matrix_transform - template <typename T> - GLM_FUNC_DECL tmat4x4<T, defaultp> tweakedInfinitePerspective( - T fovy, T aspect, T near); - - /// Creates a matrix for a symmetric perspective-view frustum with far plane at infinite for graphics hardware that doesn't support depth clamping. - /// - /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. - /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). - /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). - /// @param ep - /// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double. - /// @see gtc_matrix_transform - template <typename T> - GLM_FUNC_DECL tmat4x4<T, defaultp> tweakedInfinitePerspective( - T fovy, T aspect, T near, T ep); - - /// Map the specified object coordinates (obj.x, obj.y, obj.z) into window coordinates. - /// - /// @param obj Specify the object coordinates. - /// @param model Specifies the current modelview matrix - /// @param proj Specifies the current projection matrix - /// @param viewport Specifies the current viewport - /// @return Return the computed window coordinates. - /// @tparam T Native type used for the computation. Currently supported: half (not recommanded), float or double. - /// @tparam U Currently supported: Floating-point types and integer types. - /// @see gtc_matrix_transform - template <typename T, typename U, precision P> - GLM_FUNC_DECL tvec3<T, P> project( - tvec3<T, P> const & obj, - tmat4x4<T, P> const & model, - tmat4x4<T, P> const & proj, - tvec4<U, P> const & viewport); - - /// Map the specified window coordinates (win.x, win.y, win.z) into object coordinates. - /// - /// @param win Specify the window coordinates to be mapped. - /// @param model Specifies the modelview matrix - /// @param proj Specifies the projection matrix - /// @param viewport Specifies the viewport - /// @return Returns the computed object coordinates. - /// @tparam T Native type used for the computation. Currently supported: half (not recommanded), float or double. - /// @tparam U Currently supported: Floating-point types and integer types. - /// @see gtc_matrix_transform - template <typename T, typename U, precision P> - GLM_FUNC_DECL tvec3<T, P> unProject( - tvec3<T, P> const & win, - tmat4x4<T, P> const & model, - tmat4x4<T, P> const & proj, - tvec4<U, P> const & viewport); - - /// Define a picking region - /// - /// @param center - /// @param delta - /// @param viewport - /// @tparam T Native type used for the computation. Currently supported: half (not recommanded), float or double. - /// @tparam U Currently supported: Floating-point types and integer types. - /// @see gtc_matrix_transform - template <typename T, precision P, typename U> - GLM_FUNC_DECL tmat4x4<T, P> pickMatrix( - tvec2<T, P> const & center, - tvec2<T, P> const & delta, - tvec4<U, P> const & viewport); - - /// Build a look at view matrix. - /// - /// @param eye Position of the camera - /// @param center Position where the camera is looking at - /// @param up Normalized up vector, how the camera is oriented. Typically (0, 0, 1) - /// @see gtc_matrix_transform - /// @see - frustum(T const & left, T const & right, T const & bottom, T const & top, T const & nearVal, T const & farVal) frustum(T const & left, T const & right, T const & bottom, T const & top, T const & nearVal, T const & farVal) - template <typename T, precision P> - GLM_FUNC_DECL tmat4x4<T, P> lookAt( - tvec3<T, P> const & eye, - tvec3<T, P> const & center, - tvec3<T, P> const & up); - - /// @} -}//namespace glm - -#include "matrix_transform.inl" diff --git a/extensions/common/glm/gtc/matrix_transform.inl b/extensions/common/glm/gtc/matrix_transform.inl deleted file mode 100644 index 25df2e3e0db..00000000000 --- a/extensions/common/glm/gtc/matrix_transform.inl +++ /dev/null @@ -1,413 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtc_matrix_transform -/// @file glm/gtc/matrix_transform.inl -/// @date 2009-04-29 / 2011-06-15 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#include "../geometric.hpp" -#include "../trigonometric.hpp" -#include "../matrix.hpp" - -namespace glm -{ - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P> translate - ( - tmat4x4<T, P> const & m, - tvec3<T, P> const & v - ) - { - tmat4x4<T, P> Result(m); - Result[3] = m[0] * v[0] + m[1] * v[1] + m[2] * v[2] + m[3]; - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P> rotate - ( - tmat4x4<T, P> const & m, - T angle, - tvec3<T, P> const & v - ) - { - T const a = angle; - T const c = cos(a); - T const s = sin(a); - - tvec3<T, P> axis(normalize(v)); - tvec3<T, P> temp((T(1) - c) * axis); - - tmat4x4<T, P> Rotate(uninitialize); - Rotate[0][0] = c + temp[0] * axis[0]; - Rotate[0][1] = 0 + temp[0] * axis[1] + s * axis[2]; - Rotate[0][2] = 0 + temp[0] * axis[2] - s * axis[1]; - - Rotate[1][0] = 0 + temp[1] * axis[0] - s * axis[2]; - Rotate[1][1] = c + temp[1] * axis[1]; - Rotate[1][2] = 0 + temp[1] * axis[2] + s * axis[0]; - - Rotate[2][0] = 0 + temp[2] * axis[0] + s * axis[1]; - Rotate[2][1] = 0 + temp[2] * axis[1] - s * axis[0]; - Rotate[2][2] = c + temp[2] * axis[2]; - - tmat4x4<T, P> Result(uninitialize); - Result[0] = m[0] * Rotate[0][0] + m[1] * Rotate[0][1] + m[2] * Rotate[0][2]; - Result[1] = m[0] * Rotate[1][0] + m[1] * Rotate[1][1] + m[2] * Rotate[1][2]; - Result[2] = m[0] * Rotate[2][0] + m[1] * Rotate[2][1] + m[2] * Rotate[2][2]; - Result[3] = m[3]; - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P> rotate_slow - ( - tmat4x4<T, P> const & m, - T angle, - tvec3<T, P> const & v - ) - { - T const a = angle; - T const c = cos(a); - T const s = sin(a); - tmat4x4<T, P> Result; - - tvec3<T, P> axis = normalize(v); - - Result[0][0] = c + (1 - c) * axis.x * axis.x; - Result[0][1] = (1 - c) * axis.x * axis.y + s * axis.z; - Result[0][2] = (1 - c) * axis.x * axis.z - s * axis.y; - Result[0][3] = 0; - - Result[1][0] = (1 - c) * axis.y * axis.x - s * axis.z; - Result[1][1] = c + (1 - c) * axis.y * axis.y; - Result[1][2] = (1 - c) * axis.y * axis.z + s * axis.x; - Result[1][3] = 0; - - Result[2][0] = (1 - c) * axis.z * axis.x + s * axis.y; - Result[2][1] = (1 - c) * axis.z * axis.y - s * axis.x; - Result[2][2] = c + (1 - c) * axis.z * axis.z; - Result[2][3] = 0; - - Result[3] = tvec4<T, P>(0, 0, 0, 1); - return m * Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P> scale - ( - tmat4x4<T, P> const & m, - tvec3<T, P> const & v - ) - { - tmat4x4<T, P> Result(uninitialize); - Result[0] = m[0] * v[0]; - Result[1] = m[1] * v[1]; - Result[2] = m[2] * v[2]; - Result[3] = m[3]; - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P> scale_slow - ( - tmat4x4<T, P> const & m, - tvec3<T, P> const & v - ) - { - tmat4x4<T, P> Result(T(1)); - Result[0][0] = v.x; - Result[1][1] = v.y; - Result[2][2] = v.z; - return m * Result; - } - - template <typename T> - GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> ortho - ( - T left, - T right, - T bottom, - T top, - T zNear, - T zFar - ) - { - tmat4x4<T, defaultp> Result(1); - Result[0][0] = static_cast<T>(2) / (right - left); - Result[1][1] = static_cast<T>(2) / (top - bottom); - Result[2][2] = - static_cast<T>(2) / (zFar - zNear); - Result[3][0] = - (right + left) / (right - left); - Result[3][1] = - (top + bottom) / (top - bottom); - Result[3][2] = - (zFar + zNear) / (zFar - zNear); - return Result; - } - - template <typename T> - GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> ortho - ( - T left, - T right, - T bottom, - T top - ) - { - tmat4x4<T, defaultp> Result(1); - Result[0][0] = static_cast<T>(2) / (right - left); - Result[1][1] = static_cast<T>(2) / (top - bottom); - Result[2][2] = - static_cast<T>(1); - Result[3][0] = - (right + left) / (right - left); - Result[3][1] = - (top + bottom) / (top - bottom); - return Result; - } - - template <typename T> - GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> frustum - ( - T left, - T right, - T bottom, - T top, - T nearVal, - T farVal - ) - { - tmat4x4<T, defaultp> Result(0); - Result[0][0] = (static_cast<T>(2) * nearVal) / (right - left); - Result[1][1] = (static_cast<T>(2) * nearVal) / (top - bottom); - Result[2][0] = (right + left) / (right - left); - Result[2][1] = (top + bottom) / (top - bottom); - Result[2][2] = -(farVal + nearVal) / (farVal - nearVal); - Result[2][3] = static_cast<T>(-1); - Result[3][2] = -(static_cast<T>(2) * farVal * nearVal) / (farVal - nearVal); - return Result; - } - - template <typename T> - GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> perspective - ( - T fovy, - T aspect, - T zNear, - T zFar - ) - { - assert(abs(aspect - std::numeric_limits<T>::epsilon()) > static_cast<T>(0)); - - T const tanHalfFovy = tan(fovy / static_cast<T>(2)); - - tmat4x4<T, defaultp> Result(static_cast<T>(0)); - Result[0][0] = static_cast<T>(1) / (aspect * tanHalfFovy); - Result[1][1] = static_cast<T>(1) / (tanHalfFovy); - Result[2][2] = - (zFar + zNear) / (zFar - zNear); - Result[2][3] = - static_cast<T>(1); - Result[3][2] = - (static_cast<T>(2) * zFar * zNear) / (zFar - zNear); - return Result; - } - - template <typename T> - GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> perspectiveFov - ( - T fov, - T width, - T height, - T zNear, - T zFar - ) - { - assert(width > static_cast<T>(0)); - assert(height > static_cast<T>(0)); - assert(fov > static_cast<T>(0)); - - T const rad = fov; - T const h = glm::cos(static_cast<T>(0.5) * rad) / glm::sin(static_cast<T>(0.5) * rad); - T const w = h * height / width; ///todo max(width , Height) / min(width , Height)? - - tmat4x4<T, defaultp> Result(static_cast<T>(0)); - Result[0][0] = w; - Result[1][1] = h; - Result[2][2] = - (zFar + zNear) / (zFar - zNear); - Result[2][3] = - static_cast<T>(1); - Result[3][2] = - (static_cast<T>(2) * zFar * zNear) / (zFar - zNear); - return Result; - } - - template <typename T> - GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> infinitePerspective - ( - T fovy, - T aspect, - T zNear - ) - { - T const range = tan(fovy / T(2)) * zNear; - T const left = -range * aspect; - T const right = range * aspect; - T const bottom = -range; - T const top = range; - - tmat4x4<T, defaultp> Result(T(0)); - Result[0][0] = (T(2) * zNear) / (right - left); - Result[1][1] = (T(2) * zNear) / (top - bottom); - Result[2][2] = - T(1); - Result[2][3] = - T(1); - Result[3][2] = - T(2) * zNear; - return Result; - } - - // Infinite projection matrix: http://www.terathon.com/gdc07_lengyel.pdf - template <typename T> - GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> tweakedInfinitePerspective - ( - T fovy, - T aspect, - T zNear, - T ep - ) - { - T const range = tan(fovy / T(2)) * zNear; - T const left = -range * aspect; - T const right = range * aspect; - T const bottom = -range; - T const top = range; - - tmat4x4<T, defaultp> Result(T(0)); - Result[0][0] = (static_cast<T>(2) * zNear) / (right - left); - Result[1][1] = (static_cast<T>(2) * zNear) / (top - bottom); - Result[2][2] = ep - static_cast<T>(1); - Result[2][3] = static_cast<T>(-1); - Result[3][2] = (ep - static_cast<T>(2)) * zNear; - return Result; - } - - template <typename T> - GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> tweakedInfinitePerspective - ( - T fovy, - T aspect, - T zNear - ) - { - return tweakedInfinitePerspective(fovy, aspect, zNear, epsilon<T>()); - } - - template <typename T, typename U, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> project - ( - tvec3<T, P> const & obj, - tmat4x4<T, P> const & model, - tmat4x4<T, P> const & proj, - tvec4<U, P> const & viewport - ) - { - tvec4<T, P> tmp = tvec4<T, P>(obj, T(1)); - tmp = model * tmp; - tmp = proj * tmp; - - tmp /= tmp.w; - tmp = tmp * T(0.5) + T(0.5); - tmp[0] = tmp[0] * T(viewport[2]) + T(viewport[0]); - tmp[1] = tmp[1] * T(viewport[3]) + T(viewport[1]); - - return tvec3<T, P>(tmp); - } - - template <typename T, typename U, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> unProject - ( - tvec3<T, P> const & win, - tmat4x4<T, P> const & model, - tmat4x4<T, P> const & proj, - tvec4<U, P> const & viewport - ) - { - tmat4x4<T, P> Inverse = inverse(proj * model); - - tvec4<T, P> tmp = tvec4<T, P>(win, T(1)); - tmp.x = (tmp.x - T(viewport[0])) / T(viewport[2]); - tmp.y = (tmp.y - T(viewport[1])) / T(viewport[3]); - tmp = tmp * T(2) - T(1); - - tvec4<T, P> obj = Inverse * tmp; - obj /= obj.w; - - return tvec3<T, P>(obj); - } - - template <typename T, precision P, typename U> - GLM_FUNC_QUALIFIER tmat4x4<T, P> pickMatrix - ( - tvec2<T, P> const & center, - tvec2<T, P> const & delta, - tvec4<U, P> const & viewport - ) - { - assert(delta.x > T(0) && delta.y > T(0)); - tmat4x4<T, P> Result(1.0f); - - if(!(delta.x > T(0) && delta.y > T(0))) - return Result; // Error - - tvec3<T, P> Temp( - (T(viewport[2]) - T(2) * (center.x - T(viewport[0]))) / delta.x, - (T(viewport[3]) - T(2) * (center.y - T(viewport[1]))) / delta.y, - T(0)); - - // Translate and scale the picked region to the entire window - Result = translate(Result, Temp); - return scale(Result, tvec3<T, P>(T(viewport[2]) / delta.x, T(viewport[3]) / delta.y, T(1))); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P> lookAt - ( - tvec3<T, P> const & eye, - tvec3<T, P> const & center, - tvec3<T, P> const & up - ) - { - tvec3<T, P> const f(normalize(center - eye)); - tvec3<T, P> const s(normalize(cross(f, up))); - tvec3<T, P> const u(cross(s, f)); - - tmat4x4<T, P> Result(1); - Result[0][0] = s.x; - Result[1][0] = s.y; - Result[2][0] = s.z; - Result[0][1] = u.x; - Result[1][1] = u.y; - Result[2][1] = u.z; - Result[0][2] =-f.x; - Result[1][2] =-f.y; - Result[2][2] =-f.z; - Result[3][0] =-dot(s, eye); - Result[3][1] =-dot(u, eye); - Result[3][2] = dot(f, eye); - return Result; - } -}//namespace glm diff --git a/extensions/common/glm/gtc/noise.hpp b/extensions/common/glm/gtc/noise.hpp deleted file mode 100644 index 22d7bfe58a7..00000000000 --- a/extensions/common/glm/gtc/noise.hpp +++ /dev/null @@ -1,89 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtc_noise -/// @file glm/gtc/noise.hpp -/// @date 2011-04-21 / 2011-09-27 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// -/// @defgroup gtc_noise GLM_GTC_noise -/// @ingroup gtc -/// -/// Defines 2D, 3D and 4D procedural noise functions -/// Based on the work of Stefan Gustavson and Ashima Arts on "webgl-noise": -/// https://github.com/ashima/webgl-noise -/// Following Stefan Gustavson's paper "Simplex noise demystified": -/// http://www.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf -/// <glm/gtc/noise.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependencies -#include "../detail/setup.hpp" -#include "../detail/precision.hpp" -#include "../detail/_noise.hpp" -#include "../geometric.hpp" -#include "../common.hpp" -#include "../vector_relational.hpp" -#include "../vec2.hpp" -#include "../vec3.hpp" -#include "../vec4.hpp" - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTC_noise extension included") -#endif - -namespace glm -{ - /// @addtogroup gtc_noise - /// @{ - - /// Classic perlin noise. - /// @see gtc_noise - template <typename T, precision P, template<typename, precision> class vecType> - GLM_FUNC_DECL T perlin( - vecType<T, P> const & p); - - /// Periodic perlin noise. - /// @see gtc_noise - template <typename T, precision P, template<typename, precision> class vecType> - GLM_FUNC_DECL T perlin( - vecType<T, P> const & p, - vecType<T, P> const & rep); - - /// Simplex noise. - /// @see gtc_noise - template <typename T, precision P, template<typename, precision> class vecType> - GLM_FUNC_DECL T simplex( - vecType<T, P> const & p); - - /// @} -}//namespace glm - -#include "noise.inl" diff --git a/extensions/common/glm/gtc/noise.inl b/extensions/common/glm/gtc/noise.inl deleted file mode 100644 index 126c7dcc23a..00000000000 --- a/extensions/common/glm/gtc/noise.inl +++ /dev/null @@ -1,837 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtc_noise -/// @file glm/gtc/noise.inl -/// @date 2011-04-21 / 2012-04-07 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// -// Based on the work of Stefan Gustavson and Ashima Arts on "webgl-noise": -// https://github.com/ashima/webgl-noise -// Following Stefan Gustavson's paper "Simplex noise demystified": -// http://www.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf -/////////////////////////////////////////////////////////////////////////////////// - -namespace glm{ -namespace gtc -{ - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> grad4(T const & j, tvec4<T, P> const & ip) - { - tvec3<T, P> pXYZ = floor(fract(tvec3<T, P>(j) * tvec3<T, P>(ip)) * T(7)) * ip[2] - T(1); - T pW = static_cast<T>(1.5) - dot(abs(pXYZ), tvec3<T, P>(1)); - tvec4<T, P> s = tvec4<T, P>(lessThan(tvec4<T, P>(pXYZ, pW), tvec4<T, P>(0.0))); - pXYZ = pXYZ + (tvec3<T, P>(s) * T(2) - T(1)) * s.w; - return tvec4<T, P>(pXYZ, pW); - } -}//namespace gtc - - // Classic Perlin noise - template <typename T, precision P> - GLM_FUNC_QUALIFIER T perlin(tvec2<T, P> const & Position) - { - tvec4<T, P> Pi = glm::floor(tvec4<T, P>(Position.x, Position.y, Position.x, Position.y)) + tvec4<T, P>(0.0, 0.0, 1.0, 1.0); - tvec4<T, P> Pf = glm::fract(tvec4<T, P>(Position.x, Position.y, Position.x, Position.y)) - tvec4<T, P>(0.0, 0.0, 1.0, 1.0); - Pi = mod(Pi, tvec4<T, P>(289)); // To avoid truncation effects in permutation - tvec4<T, P> ix(Pi.x, Pi.z, Pi.x, Pi.z); - tvec4<T, P> iy(Pi.y, Pi.y, Pi.w, Pi.w); - tvec4<T, P> fx(Pf.x, Pf.z, Pf.x, Pf.z); - tvec4<T, P> fy(Pf.y, Pf.y, Pf.w, Pf.w); - - tvec4<T, P> i = detail::permute(detail::permute(ix) + iy); - - tvec4<T, P> gx = static_cast<T>(2) * glm::fract(i / T(41)) - T(1); - tvec4<T, P> gy = glm::abs(gx) - T(0.5); - tvec4<T, P> tx = glm::floor(gx + T(0.5)); - gx = gx - tx; - - tvec2<T, P> g00(gx.x, gy.x); - tvec2<T, P> g10(gx.y, gy.y); - tvec2<T, P> g01(gx.z, gy.z); - tvec2<T, P> g11(gx.w, gy.w); - - tvec4<T, P> norm = detail::taylorInvSqrt(tvec4<T, P>(dot(g00, g00), dot(g01, g01), dot(g10, g10), dot(g11, g11))); - g00 *= norm.x; - g01 *= norm.y; - g10 *= norm.z; - g11 *= norm.w; - - T n00 = dot(g00, tvec2<T, P>(fx.x, fy.x)); - T n10 = dot(g10, tvec2<T, P>(fx.y, fy.y)); - T n01 = dot(g01, tvec2<T, P>(fx.z, fy.z)); - T n11 = dot(g11, tvec2<T, P>(fx.w, fy.w)); - - tvec2<T, P> fade_xy = detail::fade(tvec2<T, P>(Pf.x, Pf.y)); - tvec2<T, P> n_x = mix(tvec2<T, P>(n00, n01), tvec2<T, P>(n10, n11), fade_xy.x); - T n_xy = mix(n_x.x, n_x.y, fade_xy.y); - return T(2.3) * n_xy; - } - - // Classic Perlin noise - template <typename T, precision P> - GLM_FUNC_QUALIFIER T perlin(tvec3<T, P> const & Position) - { - tvec3<T, P> Pi0 = floor(Position); // Integer part for indexing - tvec3<T, P> Pi1 = Pi0 + T(1); // Integer part + 1 - Pi0 = detail::mod289(Pi0); - Pi1 = detail::mod289(Pi1); - tvec3<T, P> Pf0 = fract(Position); // Fractional part for interpolation - tvec3<T, P> Pf1 = Pf0 - T(1); // Fractional part - 1.0 - tvec4<T, P> ix(Pi0.x, Pi1.x, Pi0.x, Pi1.x); - tvec4<T, P> iy = tvec4<T, P>(tvec2<T, P>(Pi0.y), tvec2<T, P>(Pi1.y)); - tvec4<T, P> iz0(Pi0.z); - tvec4<T, P> iz1(Pi1.z); - - tvec4<T, P> ixy = detail::permute(detail::permute(ix) + iy); - tvec4<T, P> ixy0 = detail::permute(ixy + iz0); - tvec4<T, P> ixy1 = detail::permute(ixy + iz1); - - tvec4<T, P> gx0 = ixy0 * T(1.0 / 7.0); - tvec4<T, P> gy0 = fract(floor(gx0) * T(1.0 / 7.0)) - T(0.5); - gx0 = fract(gx0); - tvec4<T, P> gz0 = tvec4<T, P>(0.5) - abs(gx0) - abs(gy0); - tvec4<T, P> sz0 = step(gz0, tvec4<T, P>(0.0)); - gx0 -= sz0 * (step(T(0), gx0) - T(0.5)); - gy0 -= sz0 * (step(T(0), gy0) - T(0.5)); - - tvec4<T, P> gx1 = ixy1 * T(1.0 / 7.0); - tvec4<T, P> gy1 = fract(floor(gx1) * T(1.0 / 7.0)) - T(0.5); - gx1 = fract(gx1); - tvec4<T, P> gz1 = tvec4<T, P>(0.5) - abs(gx1) - abs(gy1); - tvec4<T, P> sz1 = step(gz1, tvec4<T, P>(0.0)); - gx1 -= sz1 * (step(T(0), gx1) - T(0.5)); - gy1 -= sz1 * (step(T(0), gy1) - T(0.5)); - - tvec3<T, P> g000(gx0.x, gy0.x, gz0.x); - tvec3<T, P> g100(gx0.y, gy0.y, gz0.y); - tvec3<T, P> g010(gx0.z, gy0.z, gz0.z); - tvec3<T, P> g110(gx0.w, gy0.w, gz0.w); - tvec3<T, P> g001(gx1.x, gy1.x, gz1.x); - tvec3<T, P> g101(gx1.y, gy1.y, gz1.y); - tvec3<T, P> g011(gx1.z, gy1.z, gz1.z); - tvec3<T, P> g111(gx1.w, gy1.w, gz1.w); - - tvec4<T, P> norm0 = detail::taylorInvSqrt(tvec4<T, P>(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110))); - g000 *= norm0.x; - g010 *= norm0.y; - g100 *= norm0.z; - g110 *= norm0.w; - tvec4<T, P> norm1 = detail::taylorInvSqrt(tvec4<T, P>(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111))); - g001 *= norm1.x; - g011 *= norm1.y; - g101 *= norm1.z; - g111 *= norm1.w; - - T n000 = dot(g000, Pf0); - T n100 = dot(g100, tvec3<T, P>(Pf1.x, Pf0.y, Pf0.z)); - T n010 = dot(g010, tvec3<T, P>(Pf0.x, Pf1.y, Pf0.z)); - T n110 = dot(g110, tvec3<T, P>(Pf1.x, Pf1.y, Pf0.z)); - T n001 = dot(g001, tvec3<T, P>(Pf0.x, Pf0.y, Pf1.z)); - T n101 = dot(g101, tvec3<T, P>(Pf1.x, Pf0.y, Pf1.z)); - T n011 = dot(g011, tvec3<T, P>(Pf0.x, Pf1.y, Pf1.z)); - T n111 = dot(g111, Pf1); - - tvec3<T, P> fade_xyz = detail::fade(Pf0); - tvec4<T, P> n_z = mix(tvec4<T, P>(n000, n100, n010, n110), tvec4<T, P>(n001, n101, n011, n111), fade_xyz.z); - tvec2<T, P> n_yz = mix(tvec2<T, P>(n_z.x, n_z.y), tvec2<T, P>(n_z.z, n_z.w), fade_xyz.y); - T n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x); - return T(2.2) * n_xyz; - } - /* - // Classic Perlin noise - template <typename T, precision P> - GLM_FUNC_QUALIFIER T perlin(tvec3<T, P> const & P) - { - tvec3<T, P> Pi0 = floor(P); // Integer part for indexing - tvec3<T, P> Pi1 = Pi0 + T(1); // Integer part + 1 - Pi0 = mod(Pi0, T(289)); - Pi1 = mod(Pi1, T(289)); - tvec3<T, P> Pf0 = fract(P); // Fractional part for interpolation - tvec3<T, P> Pf1 = Pf0 - T(1); // Fractional part - 1.0 - tvec4<T, P> ix(Pi0.x, Pi1.x, Pi0.x, Pi1.x); - tvec4<T, P> iy(Pi0.y, Pi0.y, Pi1.y, Pi1.y); - tvec4<T, P> iz0(Pi0.z); - tvec4<T, P> iz1(Pi1.z); - - tvec4<T, P> ixy = permute(permute(ix) + iy); - tvec4<T, P> ixy0 = permute(ixy + iz0); - tvec4<T, P> ixy1 = permute(ixy + iz1); - - tvec4<T, P> gx0 = ixy0 / T(7); - tvec4<T, P> gy0 = fract(floor(gx0) / T(7)) - T(0.5); - gx0 = fract(gx0); - tvec4<T, P> gz0 = tvec4<T, P>(0.5) - abs(gx0) - abs(gy0); - tvec4<T, P> sz0 = step(gz0, tvec4<T, P>(0.0)); - gx0 -= sz0 * (step(0.0, gx0) - T(0.5)); - gy0 -= sz0 * (step(0.0, gy0) - T(0.5)); - - tvec4<T, P> gx1 = ixy1 / T(7); - tvec4<T, P> gy1 = fract(floor(gx1) / T(7)) - T(0.5); - gx1 = fract(gx1); - tvec4<T, P> gz1 = tvec4<T, P>(0.5) - abs(gx1) - abs(gy1); - tvec4<T, P> sz1 = step(gz1, tvec4<T, P>(0.0)); - gx1 -= sz1 * (step(T(0), gx1) - T(0.5)); - gy1 -= sz1 * (step(T(0), gy1) - T(0.5)); - - tvec3<T, P> g000(gx0.x, gy0.x, gz0.x); - tvec3<T, P> g100(gx0.y, gy0.y, gz0.y); - tvec3<T, P> g010(gx0.z, gy0.z, gz0.z); - tvec3<T, P> g110(gx0.w, gy0.w, gz0.w); - tvec3<T, P> g001(gx1.x, gy1.x, gz1.x); - tvec3<T, P> g101(gx1.y, gy1.y, gz1.y); - tvec3<T, P> g011(gx1.z, gy1.z, gz1.z); - tvec3<T, P> g111(gx1.w, gy1.w, gz1.w); - - tvec4<T, P> norm0 = taylorInvSqrt(tvec4<T, P>(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110))); - g000 *= norm0.x; - g010 *= norm0.y; - g100 *= norm0.z; - g110 *= norm0.w; - tvec4<T, P> norm1 = taylorInvSqrt(tvec4<T, P>(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111))); - g001 *= norm1.x; - g011 *= norm1.y; - g101 *= norm1.z; - g111 *= norm1.w; - - T n000 = dot(g000, Pf0); - T n100 = dot(g100, tvec3<T, P>(Pf1.x, Pf0.y, Pf0.z)); - T n010 = dot(g010, tvec3<T, P>(Pf0.x, Pf1.y, Pf0.z)); - T n110 = dot(g110, tvec3<T, P>(Pf1.x, Pf1.y, Pf0.z)); - T n001 = dot(g001, tvec3<T, P>(Pf0.x, Pf0.y, Pf1.z)); - T n101 = dot(g101, tvec3<T, P>(Pf1.x, Pf0.y, Pf1.z)); - T n011 = dot(g011, tvec3<T, P>(Pf0.x, Pf1.y, Pf1.z)); - T n111 = dot(g111, Pf1); - - tvec3<T, P> fade_xyz = fade(Pf0); - tvec4<T, P> n_z = mix(tvec4<T, P>(n000, n100, n010, n110), tvec4<T, P>(n001, n101, n011, n111), fade_xyz.z); - tvec2<T, P> n_yz = mix( - tvec2<T, P>(n_z.x, n_z.y), - tvec2<T, P>(n_z.z, n_z.w), fade_xyz.y); - T n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x); - return T(2.2) * n_xyz; - } - */ - // Classic Perlin noise - template <typename T, precision P> - GLM_FUNC_QUALIFIER T perlin(tvec4<T, P> const & Position) - { - tvec4<T, P> Pi0 = floor(Position); // Integer part for indexing - tvec4<T, P> Pi1 = Pi0 + T(1); // Integer part + 1 - Pi0 = mod(Pi0, tvec4<T, P>(289)); - Pi1 = mod(Pi1, tvec4<T, P>(289)); - tvec4<T, P> Pf0 = fract(Position); // Fractional part for interpolation - tvec4<T, P> Pf1 = Pf0 - T(1); // Fractional part - 1.0 - tvec4<T, P> ix(Pi0.x, Pi1.x, Pi0.x, Pi1.x); - tvec4<T, P> iy(Pi0.y, Pi0.y, Pi1.y, Pi1.y); - tvec4<T, P> iz0(Pi0.z); - tvec4<T, P> iz1(Pi1.z); - tvec4<T, P> iw0(Pi0.w); - tvec4<T, P> iw1(Pi1.w); - - tvec4<T, P> ixy = detail::permute(detail::permute(ix) + iy); - tvec4<T, P> ixy0 = detail::permute(ixy + iz0); - tvec4<T, P> ixy1 = detail::permute(ixy + iz1); - tvec4<T, P> ixy00 = detail::permute(ixy0 + iw0); - tvec4<T, P> ixy01 = detail::permute(ixy0 + iw1); - tvec4<T, P> ixy10 = detail::permute(ixy1 + iw0); - tvec4<T, P> ixy11 = detail::permute(ixy1 + iw1); - - tvec4<T, P> gx00 = ixy00 / T(7); - tvec4<T, P> gy00 = floor(gx00) / T(7); - tvec4<T, P> gz00 = floor(gy00) / T(6); - gx00 = fract(gx00) - T(0.5); - gy00 = fract(gy00) - T(0.5); - gz00 = fract(gz00) - T(0.5); - tvec4<T, P> gw00 = tvec4<T, P>(0.75) - abs(gx00) - abs(gy00) - abs(gz00); - tvec4<T, P> sw00 = step(gw00, tvec4<T, P>(0.0)); - gx00 -= sw00 * (step(T(0), gx00) - T(0.5)); - gy00 -= sw00 * (step(T(0), gy00) - T(0.5)); - - tvec4<T, P> gx01 = ixy01 / T(7); - tvec4<T, P> gy01 = floor(gx01) / T(7); - tvec4<T, P> gz01 = floor(gy01) / T(6); - gx01 = fract(gx01) - T(0.5); - gy01 = fract(gy01) - T(0.5); - gz01 = fract(gz01) - T(0.5); - tvec4<T, P> gw01 = tvec4<T, P>(0.75) - abs(gx01) - abs(gy01) - abs(gz01); - tvec4<T, P> sw01 = step(gw01, tvec4<T, P>(0.0)); - gx01 -= sw01 * (step(T(0), gx01) - T(0.5)); - gy01 -= sw01 * (step(T(0), gy01) - T(0.5)); - - tvec4<T, P> gx10 = ixy10 / T(7); - tvec4<T, P> gy10 = floor(gx10) / T(7); - tvec4<T, P> gz10 = floor(gy10) / T(6); - gx10 = fract(gx10) - T(0.5); - gy10 = fract(gy10) - T(0.5); - gz10 = fract(gz10) - T(0.5); - tvec4<T, P> gw10 = tvec4<T, P>(0.75) - abs(gx10) - abs(gy10) - abs(gz10); - tvec4<T, P> sw10 = step(gw10, tvec4<T, P>(0)); - gx10 -= sw10 * (step(T(0), gx10) - T(0.5)); - gy10 -= sw10 * (step(T(0), gy10) - T(0.5)); - - tvec4<T, P> gx11 = ixy11 / T(7); - tvec4<T, P> gy11 = floor(gx11) / T(7); - tvec4<T, P> gz11 = floor(gy11) / T(6); - gx11 = fract(gx11) - T(0.5); - gy11 = fract(gy11) - T(0.5); - gz11 = fract(gz11) - T(0.5); - tvec4<T, P> gw11 = tvec4<T, P>(0.75) - abs(gx11) - abs(gy11) - abs(gz11); - tvec4<T, P> sw11 = step(gw11, tvec4<T, P>(0.0)); - gx11 -= sw11 * (step(T(0), gx11) - T(0.5)); - gy11 -= sw11 * (step(T(0), gy11) - T(0.5)); - - tvec4<T, P> g0000(gx00.x, gy00.x, gz00.x, gw00.x); - tvec4<T, P> g1000(gx00.y, gy00.y, gz00.y, gw00.y); - tvec4<T, P> g0100(gx00.z, gy00.z, gz00.z, gw00.z); - tvec4<T, P> g1100(gx00.w, gy00.w, gz00.w, gw00.w); - tvec4<T, P> g0010(gx10.x, gy10.x, gz10.x, gw10.x); - tvec4<T, P> g1010(gx10.y, gy10.y, gz10.y, gw10.y); - tvec4<T, P> g0110(gx10.z, gy10.z, gz10.z, gw10.z); - tvec4<T, P> g1110(gx10.w, gy10.w, gz10.w, gw10.w); - tvec4<T, P> g0001(gx01.x, gy01.x, gz01.x, gw01.x); - tvec4<T, P> g1001(gx01.y, gy01.y, gz01.y, gw01.y); - tvec4<T, P> g0101(gx01.z, gy01.z, gz01.z, gw01.z); - tvec4<T, P> g1101(gx01.w, gy01.w, gz01.w, gw01.w); - tvec4<T, P> g0011(gx11.x, gy11.x, gz11.x, gw11.x); - tvec4<T, P> g1011(gx11.y, gy11.y, gz11.y, gw11.y); - tvec4<T, P> g0111(gx11.z, gy11.z, gz11.z, gw11.z); - tvec4<T, P> g1111(gx11.w, gy11.w, gz11.w, gw11.w); - - tvec4<T, P> norm00 = detail::taylorInvSqrt(tvec4<T, P>(dot(g0000, g0000), dot(g0100, g0100), dot(g1000, g1000), dot(g1100, g1100))); - g0000 *= norm00.x; - g0100 *= norm00.y; - g1000 *= norm00.z; - g1100 *= norm00.w; - - tvec4<T, P> norm01 = detail::taylorInvSqrt(tvec4<T, P>(dot(g0001, g0001), dot(g0101, g0101), dot(g1001, g1001), dot(g1101, g1101))); - g0001 *= norm01.x; - g0101 *= norm01.y; - g1001 *= norm01.z; - g1101 *= norm01.w; - - tvec4<T, P> norm10 = detail::taylorInvSqrt(tvec4<T, P>(dot(g0010, g0010), dot(g0110, g0110), dot(g1010, g1010), dot(g1110, g1110))); - g0010 *= norm10.x; - g0110 *= norm10.y; - g1010 *= norm10.z; - g1110 *= norm10.w; - - tvec4<T, P> norm11 = detail::taylorInvSqrt(tvec4<T, P>(dot(g0011, g0011), dot(g0111, g0111), dot(g1011, g1011), dot(g1111, g1111))); - g0011 *= norm11.x; - g0111 *= norm11.y; - g1011 *= norm11.z; - g1111 *= norm11.w; - - T n0000 = dot(g0000, Pf0); - T n1000 = dot(g1000, tvec4<T, P>(Pf1.x, Pf0.y, Pf0.z, Pf0.w)); - T n0100 = dot(g0100, tvec4<T, P>(Pf0.x, Pf1.y, Pf0.z, Pf0.w)); - T n1100 = dot(g1100, tvec4<T, P>(Pf1.x, Pf1.y, Pf0.z, Pf0.w)); - T n0010 = dot(g0010, tvec4<T, P>(Pf0.x, Pf0.y, Pf1.z, Pf0.w)); - T n1010 = dot(g1010, tvec4<T, P>(Pf1.x, Pf0.y, Pf1.z, Pf0.w)); - T n0110 = dot(g0110, tvec4<T, P>(Pf0.x, Pf1.y, Pf1.z, Pf0.w)); - T n1110 = dot(g1110, tvec4<T, P>(Pf1.x, Pf1.y, Pf1.z, Pf0.w)); - T n0001 = dot(g0001, tvec4<T, P>(Pf0.x, Pf0.y, Pf0.z, Pf1.w)); - T n1001 = dot(g1001, tvec4<T, P>(Pf1.x, Pf0.y, Pf0.z, Pf1.w)); - T n0101 = dot(g0101, tvec4<T, P>(Pf0.x, Pf1.y, Pf0.z, Pf1.w)); - T n1101 = dot(g1101, tvec4<T, P>(Pf1.x, Pf1.y, Pf0.z, Pf1.w)); - T n0011 = dot(g0011, tvec4<T, P>(Pf0.x, Pf0.y, Pf1.z, Pf1.w)); - T n1011 = dot(g1011, tvec4<T, P>(Pf1.x, Pf0.y, Pf1.z, Pf1.w)); - T n0111 = dot(g0111, tvec4<T, P>(Pf0.x, Pf1.y, Pf1.z, Pf1.w)); - T n1111 = dot(g1111, Pf1); - - tvec4<T, P> fade_xyzw = detail::fade(Pf0); - tvec4<T, P> n_0w = mix(tvec4<T, P>(n0000, n1000, n0100, n1100), tvec4<T, P>(n0001, n1001, n0101, n1101), fade_xyzw.w); - tvec4<T, P> n_1w = mix(tvec4<T, P>(n0010, n1010, n0110, n1110), tvec4<T, P>(n0011, n1011, n0111, n1111), fade_xyzw.w); - tvec4<T, P> n_zw = mix(n_0w, n_1w, fade_xyzw.z); - tvec2<T, P> n_yzw = mix(tvec2<T, P>(n_zw.x, n_zw.y), tvec2<T, P>(n_zw.z, n_zw.w), fade_xyzw.y); - T n_xyzw = mix(n_yzw.x, n_yzw.y, fade_xyzw.x); - return T(2.2) * n_xyzw; - } - - // Classic Perlin noise, periodic variant - template <typename T, precision P> - GLM_FUNC_QUALIFIER T perlin(tvec2<T, P> const & Position, tvec2<T, P> const & rep) - { - tvec4<T, P> Pi = floor(tvec4<T, P>(Position.x, Position.y, Position.x, Position.y)) + tvec4<T, P>(0.0, 0.0, 1.0, 1.0); - tvec4<T, P> Pf = fract(tvec4<T, P>(Position.x, Position.y, Position.x, Position.y)) - tvec4<T, P>(0.0, 0.0, 1.0, 1.0); - Pi = mod(Pi, tvec4<T, P>(rep.x, rep.y, rep.x, rep.y)); // To create noise with explicit period - Pi = mod(Pi, tvec4<T, P>(289)); // To avoid truncation effects in permutation - tvec4<T, P> ix(Pi.x, Pi.z, Pi.x, Pi.z); - tvec4<T, P> iy(Pi.y, Pi.y, Pi.w, Pi.w); - tvec4<T, P> fx(Pf.x, Pf.z, Pf.x, Pf.z); - tvec4<T, P> fy(Pf.y, Pf.y, Pf.w, Pf.w); - - tvec4<T, P> i = detail::permute(detail::permute(ix) + iy); - - tvec4<T, P> gx = static_cast<T>(2) * fract(i / T(41)) - T(1); - tvec4<T, P> gy = abs(gx) - T(0.5); - tvec4<T, P> tx = floor(gx + T(0.5)); - gx = gx - tx; - - tvec2<T, P> g00(gx.x, gy.x); - tvec2<T, P> g10(gx.y, gy.y); - tvec2<T, P> g01(gx.z, gy.z); - tvec2<T, P> g11(gx.w, gy.w); - - tvec4<T, P> norm = detail::taylorInvSqrt(tvec4<T, P>(dot(g00, g00), dot(g01, g01), dot(g10, g10), dot(g11, g11))); - g00 *= norm.x; - g01 *= norm.y; - g10 *= norm.z; - g11 *= norm.w; - - T n00 = dot(g00, tvec2<T, P>(fx.x, fy.x)); - T n10 = dot(g10, tvec2<T, P>(fx.y, fy.y)); - T n01 = dot(g01, tvec2<T, P>(fx.z, fy.z)); - T n11 = dot(g11, tvec2<T, P>(fx.w, fy.w)); - - tvec2<T, P> fade_xy = detail::fade(tvec2<T, P>(Pf.x, Pf.y)); - tvec2<T, P> n_x = mix(tvec2<T, P>(n00, n01), tvec2<T, P>(n10, n11), fade_xy.x); - T n_xy = mix(n_x.x, n_x.y, fade_xy.y); - return T(2.3) * n_xy; - } - - // Classic Perlin noise, periodic variant - template <typename T, precision P> - GLM_FUNC_QUALIFIER T perlin(tvec3<T, P> const & Position, tvec3<T, P> const & rep) - { - tvec3<T, P> Pi0 = mod(floor(Position), rep); // Integer part, modulo period - tvec3<T, P> Pi1 = mod(Pi0 + tvec3<T, P>(T(1)), rep); // Integer part + 1, mod period - Pi0 = mod(Pi0, tvec3<T, P>(289)); - Pi1 = mod(Pi1, tvec3<T, P>(289)); - tvec3<T, P> Pf0 = fract(Position); // Fractional part for interpolation - tvec3<T, P> Pf1 = Pf0 - tvec3<T, P>(T(1)); // Fractional part - 1.0 - tvec4<T, P> ix = tvec4<T, P>(Pi0.x, Pi1.x, Pi0.x, Pi1.x); - tvec4<T, P> iy = tvec4<T, P>(Pi0.y, Pi0.y, Pi1.y, Pi1.y); - tvec4<T, P> iz0(Pi0.z); - tvec4<T, P> iz1(Pi1.z); - - tvec4<T, P> ixy = detail::permute(detail::permute(ix) + iy); - tvec4<T, P> ixy0 = detail::permute(ixy + iz0); - tvec4<T, P> ixy1 = detail::permute(ixy + iz1); - - tvec4<T, P> gx0 = ixy0 / T(7); - tvec4<T, P> gy0 = fract(floor(gx0) / T(7)) - T(0.5); - gx0 = fract(gx0); - tvec4<T, P> gz0 = tvec4<T, P>(0.5) - abs(gx0) - abs(gy0); - tvec4<T, P> sz0 = step(gz0, tvec4<T, P>(0)); - gx0 -= sz0 * (step(T(0), gx0) - T(0.5)); - gy0 -= sz0 * (step(T(0), gy0) - T(0.5)); - - tvec4<T, P> gx1 = ixy1 / T(7); - tvec4<T, P> gy1 = fract(floor(gx1) / T(7)) - T(0.5); - gx1 = fract(gx1); - tvec4<T, P> gz1 = tvec4<T, P>(0.5) - abs(gx1) - abs(gy1); - tvec4<T, P> sz1 = step(gz1, tvec4<T, P>(T(0))); - gx1 -= sz1 * (step(T(0), gx1) - T(0.5)); - gy1 -= sz1 * (step(T(0), gy1) - T(0.5)); - - tvec3<T, P> g000 = tvec3<T, P>(gx0.x, gy0.x, gz0.x); - tvec3<T, P> g100 = tvec3<T, P>(gx0.y, gy0.y, gz0.y); - tvec3<T, P> g010 = tvec3<T, P>(gx0.z, gy0.z, gz0.z); - tvec3<T, P> g110 = tvec3<T, P>(gx0.w, gy0.w, gz0.w); - tvec3<T, P> g001 = tvec3<T, P>(gx1.x, gy1.x, gz1.x); - tvec3<T, P> g101 = tvec3<T, P>(gx1.y, gy1.y, gz1.y); - tvec3<T, P> g011 = tvec3<T, P>(gx1.z, gy1.z, gz1.z); - tvec3<T, P> g111 = tvec3<T, P>(gx1.w, gy1.w, gz1.w); - - tvec4<T, P> norm0 = detail::taylorInvSqrt(tvec4<T, P>(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110))); - g000 *= norm0.x; - g010 *= norm0.y; - g100 *= norm0.z; - g110 *= norm0.w; - tvec4<T, P> norm1 = detail::taylorInvSqrt(tvec4<T, P>(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111))); - g001 *= norm1.x; - g011 *= norm1.y; - g101 *= norm1.z; - g111 *= norm1.w; - - T n000 = dot(g000, Pf0); - T n100 = dot(g100, tvec3<T, P>(Pf1.x, Pf0.y, Pf0.z)); - T n010 = dot(g010, tvec3<T, P>(Pf0.x, Pf1.y, Pf0.z)); - T n110 = dot(g110, tvec3<T, P>(Pf1.x, Pf1.y, Pf0.z)); - T n001 = dot(g001, tvec3<T, P>(Pf0.x, Pf0.y, Pf1.z)); - T n101 = dot(g101, tvec3<T, P>(Pf1.x, Pf0.y, Pf1.z)); - T n011 = dot(g011, tvec3<T, P>(Pf0.x, Pf1.y, Pf1.z)); - T n111 = dot(g111, Pf1); - - tvec3<T, P> fade_xyz = detail::fade(Pf0); - tvec4<T, P> n_z = mix(tvec4<T, P>(n000, n100, n010, n110), tvec4<T, P>(n001, n101, n011, n111), fade_xyz.z); - tvec2<T, P> n_yz = mix(tvec2<T, P>(n_z.x, n_z.y), tvec2<T, P>(n_z.z, n_z.w), fade_xyz.y); - T n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x); - return T(2.2) * n_xyz; - } - - // Classic Perlin noise, periodic version - template <typename T, precision P> - GLM_FUNC_QUALIFIER T perlin(tvec4<T, P> const & Position, tvec4<T, P> const & rep) - { - tvec4<T, P> Pi0 = mod(floor(Position), rep); // Integer part modulo rep - tvec4<T, P> Pi1 = mod(Pi0 + T(1), rep); // Integer part + 1 mod rep - tvec4<T, P> Pf0 = fract(Position); // Fractional part for interpolation - tvec4<T, P> Pf1 = Pf0 - T(1); // Fractional part - 1.0 - tvec4<T, P> ix = tvec4<T, P>(Pi0.x, Pi1.x, Pi0.x, Pi1.x); - tvec4<T, P> iy = tvec4<T, P>(Pi0.y, Pi0.y, Pi1.y, Pi1.y); - tvec4<T, P> iz0(Pi0.z); - tvec4<T, P> iz1(Pi1.z); - tvec4<T, P> iw0(Pi0.w); - tvec4<T, P> iw1(Pi1.w); - - tvec4<T, P> ixy = detail::permute(detail::permute(ix) + iy); - tvec4<T, P> ixy0 = detail::permute(ixy + iz0); - tvec4<T, P> ixy1 = detail::permute(ixy + iz1); - tvec4<T, P> ixy00 = detail::permute(ixy0 + iw0); - tvec4<T, P> ixy01 = detail::permute(ixy0 + iw1); - tvec4<T, P> ixy10 = detail::permute(ixy1 + iw0); - tvec4<T, P> ixy11 = detail::permute(ixy1 + iw1); - - tvec4<T, P> gx00 = ixy00 / T(7); - tvec4<T, P> gy00 = floor(gx00) / T(7); - tvec4<T, P> gz00 = floor(gy00) / T(6); - gx00 = fract(gx00) - T(0.5); - gy00 = fract(gy00) - T(0.5); - gz00 = fract(gz00) - T(0.5); - tvec4<T, P> gw00 = tvec4<T, P>(0.75) - abs(gx00) - abs(gy00) - abs(gz00); - tvec4<T, P> sw00 = step(gw00, tvec4<T, P>(0)); - gx00 -= sw00 * (step(T(0), gx00) - T(0.5)); - gy00 -= sw00 * (step(T(0), gy00) - T(0.5)); - - tvec4<T, P> gx01 = ixy01 / T(7); - tvec4<T, P> gy01 = floor(gx01) / T(7); - tvec4<T, P> gz01 = floor(gy01) / T(6); - gx01 = fract(gx01) - T(0.5); - gy01 = fract(gy01) - T(0.5); - gz01 = fract(gz01) - T(0.5); - tvec4<T, P> gw01 = tvec4<T, P>(0.75) - abs(gx01) - abs(gy01) - abs(gz01); - tvec4<T, P> sw01 = step(gw01, tvec4<T, P>(0.0)); - gx01 -= sw01 * (step(T(0), gx01) - T(0.5)); - gy01 -= sw01 * (step(T(0), gy01) - T(0.5)); - - tvec4<T, P> gx10 = ixy10 / T(7); - tvec4<T, P> gy10 = floor(gx10) / T(7); - tvec4<T, P> gz10 = floor(gy10) / T(6); - gx10 = fract(gx10) - T(0.5); - gy10 = fract(gy10) - T(0.5); - gz10 = fract(gz10) - T(0.5); - tvec4<T, P> gw10 = tvec4<T, P>(0.75) - abs(gx10) - abs(gy10) - abs(gz10); - tvec4<T, P> sw10 = step(gw10, tvec4<T, P>(0.0)); - gx10 -= sw10 * (step(T(0), gx10) - T(0.5)); - gy10 -= sw10 * (step(T(0), gy10) - T(0.5)); - - tvec4<T, P> gx11 = ixy11 / T(7); - tvec4<T, P> gy11 = floor(gx11) / T(7); - tvec4<T, P> gz11 = floor(gy11) / T(6); - gx11 = fract(gx11) - T(0.5); - gy11 = fract(gy11) - T(0.5); - gz11 = fract(gz11) - T(0.5); - tvec4<T, P> gw11 = tvec4<T, P>(0.75) - abs(gx11) - abs(gy11) - abs(gz11); - tvec4<T, P> sw11 = step(gw11, tvec4<T, P>(T(0))); - gx11 -= sw11 * (step(T(0), gx11) - T(0.5)); - gy11 -= sw11 * (step(T(0), gy11) - T(0.5)); - - tvec4<T, P> g0000(gx00.x, gy00.x, gz00.x, gw00.x); - tvec4<T, P> g1000(gx00.y, gy00.y, gz00.y, gw00.y); - tvec4<T, P> g0100(gx00.z, gy00.z, gz00.z, gw00.z); - tvec4<T, P> g1100(gx00.w, gy00.w, gz00.w, gw00.w); - tvec4<T, P> g0010(gx10.x, gy10.x, gz10.x, gw10.x); - tvec4<T, P> g1010(gx10.y, gy10.y, gz10.y, gw10.y); - tvec4<T, P> g0110(gx10.z, gy10.z, gz10.z, gw10.z); - tvec4<T, P> g1110(gx10.w, gy10.w, gz10.w, gw10.w); - tvec4<T, P> g0001(gx01.x, gy01.x, gz01.x, gw01.x); - tvec4<T, P> g1001(gx01.y, gy01.y, gz01.y, gw01.y); - tvec4<T, P> g0101(gx01.z, gy01.z, gz01.z, gw01.z); - tvec4<T, P> g1101(gx01.w, gy01.w, gz01.w, gw01.w); - tvec4<T, P> g0011(gx11.x, gy11.x, gz11.x, gw11.x); - tvec4<T, P> g1011(gx11.y, gy11.y, gz11.y, gw11.y); - tvec4<T, P> g0111(gx11.z, gy11.z, gz11.z, gw11.z); - tvec4<T, P> g1111(gx11.w, gy11.w, gz11.w, gw11.w); - - tvec4<T, P> norm00 = detail::taylorInvSqrt(tvec4<T, P>(dot(g0000, g0000), dot(g0100, g0100), dot(g1000, g1000), dot(g1100, g1100))); - g0000 *= norm00.x; - g0100 *= norm00.y; - g1000 *= norm00.z; - g1100 *= norm00.w; - - tvec4<T, P> norm01 = detail::taylorInvSqrt(tvec4<T, P>(dot(g0001, g0001), dot(g0101, g0101), dot(g1001, g1001), dot(g1101, g1101))); - g0001 *= norm01.x; - g0101 *= norm01.y; - g1001 *= norm01.z; - g1101 *= norm01.w; - - tvec4<T, P> norm10 = detail::taylorInvSqrt(tvec4<T, P>(dot(g0010, g0010), dot(g0110, g0110), dot(g1010, g1010), dot(g1110, g1110))); - g0010 *= norm10.x; - g0110 *= norm10.y; - g1010 *= norm10.z; - g1110 *= norm10.w; - - tvec4<T, P> norm11 = detail::taylorInvSqrt(tvec4<T, P>(dot(g0011, g0011), dot(g0111, g0111), dot(g1011, g1011), dot(g1111, g1111))); - g0011 *= norm11.x; - g0111 *= norm11.y; - g1011 *= norm11.z; - g1111 *= norm11.w; - - T n0000 = dot(g0000, Pf0); - T n1000 = dot(g1000, tvec4<T, P>(Pf1.x, Pf0.y, Pf0.z, Pf0.w)); - T n0100 = dot(g0100, tvec4<T, P>(Pf0.x, Pf1.y, Pf0.z, Pf0.w)); - T n1100 = dot(g1100, tvec4<T, P>(Pf1.x, Pf1.y, Pf0.z, Pf0.w)); - T n0010 = dot(g0010, tvec4<T, P>(Pf0.x, Pf0.y, Pf1.z, Pf0.w)); - T n1010 = dot(g1010, tvec4<T, P>(Pf1.x, Pf0.y, Pf1.z, Pf0.w)); - T n0110 = dot(g0110, tvec4<T, P>(Pf0.x, Pf1.y, Pf1.z, Pf0.w)); - T n1110 = dot(g1110, tvec4<T, P>(Pf1.x, Pf1.y, Pf1.z, Pf0.w)); - T n0001 = dot(g0001, tvec4<T, P>(Pf0.x, Pf0.y, Pf0.z, Pf1.w)); - T n1001 = dot(g1001, tvec4<T, P>(Pf1.x, Pf0.y, Pf0.z, Pf1.w)); - T n0101 = dot(g0101, tvec4<T, P>(Pf0.x, Pf1.y, Pf0.z, Pf1.w)); - T n1101 = dot(g1101, tvec4<T, P>(Pf1.x, Pf1.y, Pf0.z, Pf1.w)); - T n0011 = dot(g0011, tvec4<T, P>(Pf0.x, Pf0.y, Pf1.z, Pf1.w)); - T n1011 = dot(g1011, tvec4<T, P>(Pf1.x, Pf0.y, Pf1.z, Pf1.w)); - T n0111 = dot(g0111, tvec4<T, P>(Pf0.x, Pf1.y, Pf1.z, Pf1.w)); - T n1111 = dot(g1111, Pf1); - - tvec4<T, P> fade_xyzw = detail::fade(Pf0); - tvec4<T, P> n_0w = mix(tvec4<T, P>(n0000, n1000, n0100, n1100), tvec4<T, P>(n0001, n1001, n0101, n1101), fade_xyzw.w); - tvec4<T, P> n_1w = mix(tvec4<T, P>(n0010, n1010, n0110, n1110), tvec4<T, P>(n0011, n1011, n0111, n1111), fade_xyzw.w); - tvec4<T, P> n_zw = mix(n_0w, n_1w, fade_xyzw.z); - tvec2<T, P> n_yzw = mix(tvec2<T, P>(n_zw.x, n_zw.y), tvec2<T, P>(n_zw.z, n_zw.w), fade_xyzw.y); - T n_xyzw = mix(n_yzw.x, n_yzw.y, fade_xyzw.x); - return T(2.2) * n_xyzw; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER T simplex(glm::tvec2<T, P> const & v) - { - tvec4<T, P> const C = tvec4<T, P>( - T( 0.211324865405187), // (3.0 - sqrt(3.0)) / 6.0 - T( 0.366025403784439), // 0.5 * (sqrt(3.0) - 1.0) - T(-0.577350269189626), // -1.0 + 2.0 * C.x - T( 0.024390243902439)); // 1.0 / 41.0 - - // First corner - tvec2<T, P> i = floor(v + dot(v, tvec2<T, P>(C[1]))); - tvec2<T, P> x0 = v - i + dot(i, tvec2<T, P>(C[0])); - - // Other corners - //i1.x = step( x0.y, x0.x ); // x0.x > x0.y ? 1.0 : 0.0 - //i1.y = 1.0 - i1.x; - tvec2<T, P> i1 = (x0.x > x0.y) ? tvec2<T, P>(1, 0) : tvec2<T, P>(0, 1); - // x0 = x0 - 0.0 + 0.0 * C.xx ; - // x1 = x0 - i1 + 1.0 * C.xx ; - // x2 = x0 - 1.0 + 2.0 * C.xx ; - tvec4<T, P> x12 = tvec4<T, P>(x0.x, x0.y, x0.x, x0.y) + tvec4<T, P>(C.x, C.x, C.z, C.z); - x12 = tvec4<T, P>(tvec2<T, P>(x12) - i1, x12.z, x12.w); - - // Permutations - i = mod(i, tvec2<T, P>(289)); // Avoid truncation effects in permutation - tvec3<T, P> p = detail::permute( - detail::permute(i.y + tvec3<T, P>(T(0), i1.y, T(1))) - + i.x + tvec3<T, P>(T(0), i1.x, T(1))); - - tvec3<T, P> m = max(tvec3<T, P>(0.5) - tvec3<T, P>( - dot(x0, x0), - dot(tvec2<T, P>(x12.x, x12.y), tvec2<T, P>(x12.x, x12.y)), - dot(tvec2<T, P>(x12.z, x12.w), tvec2<T, P>(x12.z, x12.w))), tvec3<T, P>(0)); - m = m * m ; - m = m * m ; - - // Gradients: 41 points uniformly over a line, mapped onto a diamond. - // The ring size 17*17 = 289 is close to a multiple of 41 (41*7 = 287) - - tvec3<T, P> x = static_cast<T>(2) * fract(p * C.w) - T(1); - tvec3<T, P> h = abs(x) - T(0.5); - tvec3<T, P> ox = floor(x + T(0.5)); - tvec3<T, P> a0 = x - ox; - - // Normalise gradients implicitly by scaling m - // Inlined for speed: m *= taylorInvSqrt( a0*a0 + h*h ); - m *= static_cast<T>(1.79284291400159) - T(0.85373472095314) * (a0 * a0 + h * h); - - // Compute final noise value at P - tvec3<T, P> g; - g.x = a0.x * x0.x + h.x * x0.y; - //g.yz = a0.yz * x12.xz + h.yz * x12.yw; - g.y = a0.y * x12.x + h.y * x12.y; - g.z = a0.z * x12.z + h.z * x12.w; - return T(130) * dot(m, g); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER T simplex(tvec3<T, P> const & v) - { - tvec2<T, P> const C(1.0 / 6.0, 1.0 / 3.0); - tvec4<T, P> const D(0.0, 0.5, 1.0, 2.0); - - // First corner - tvec3<T, P> i(floor(v + dot(v, tvec3<T, P>(C.y)))); - tvec3<T, P> x0(v - i + dot(i, tvec3<T, P>(C.x))); - - // Other corners - tvec3<T, P> g(step(tvec3<T, P>(x0.y, x0.z, x0.x), x0)); - tvec3<T, P> l(T(1) - g); - tvec3<T, P> i1(min(g, tvec3<T, P>(l.z, l.x, l.y))); - tvec3<T, P> i2(max(g, tvec3<T, P>(l.z, l.x, l.y))); - - // x0 = x0 - 0.0 + 0.0 * C.xxx; - // x1 = x0 - i1 + 1.0 * C.xxx; - // x2 = x0 - i2 + 2.0 * C.xxx; - // x3 = x0 - 1.0 + 3.0 * C.xxx; - tvec3<T, P> x1(x0 - i1 + C.x); - tvec3<T, P> x2(x0 - i2 + C.y); // 2.0*C.x = 1/3 = C.y - tvec3<T, P> x3(x0 - D.y); // -1.0+3.0*C.x = -0.5 = -D.y - - // Permutations - i = detail::mod289(i); - tvec4<T, P> p(detail::permute(detail::permute(detail::permute( - i.z + tvec4<T, P>(T(0), i1.z, i2.z, T(1))) + - i.y + tvec4<T, P>(T(0), i1.y, i2.y, T(1))) + - i.x + tvec4<T, P>(T(0), i1.x, i2.x, T(1)))); - - // Gradients: 7x7 points over a square, mapped onto an octahedron. - // The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294) - T n_ = static_cast<T>(0.142857142857); // 1.0/7.0 - tvec3<T, P> ns(n_ * tvec3<T, P>(D.w, D.y, D.z) - tvec3<T, P>(D.x, D.z, D.x)); - - tvec4<T, P> j(p - T(49) * floor(p * ns.z * ns.z)); // mod(p,7*7) - - tvec4<T, P> x_(floor(j * ns.z)); - tvec4<T, P> y_(floor(j - T(7) * x_)); // mod(j,N) - - tvec4<T, P> x(x_ * ns.x + ns.y); - tvec4<T, P> y(y_ * ns.x + ns.y); - tvec4<T, P> h(T(1) - abs(x) - abs(y)); - - tvec4<T, P> b0(x.x, x.y, y.x, y.y); - tvec4<T, P> b1(x.z, x.w, y.z, y.w); - - // vec4 s0 = vec4(lessThan(b0,0.0))*2.0 - 1.0; - // vec4 s1 = vec4(lessThan(b1,0.0))*2.0 - 1.0; - tvec4<T, P> s0(floor(b0) * T(2) + T(1)); - tvec4<T, P> s1(floor(b1) * T(2) + T(1)); - tvec4<T, P> sh(-step(h, tvec4<T, P>(0.0))); - - tvec4<T, P> a0 = tvec4<T, P>(b0.x, b0.z, b0.y, b0.w) + tvec4<T, P>(s0.x, s0.z, s0.y, s0.w) * tvec4<T, P>(sh.x, sh.x, sh.y, sh.y); - tvec4<T, P> a1 = tvec4<T, P>(b1.x, b1.z, b1.y, b1.w) + tvec4<T, P>(s1.x, s1.z, s1.y, s1.w) * tvec4<T, P>(sh.z, sh.z, sh.w, sh.w); - - tvec3<T, P> p0(a0.x, a0.y, h.x); - tvec3<T, P> p1(a0.z, a0.w, h.y); - tvec3<T, P> p2(a1.x, a1.y, h.z); - tvec3<T, P> p3(a1.z, a1.w, h.w); - - // Normalise gradients - tvec4<T, P> norm = detail::taylorInvSqrt(tvec4<T, P>(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3))); - p0 *= norm.x; - p1 *= norm.y; - p2 *= norm.z; - p3 *= norm.w; - - // Mix final noise value - tvec4<T, P> m = max(T(0.6) - tvec4<T, P>(dot(x0, x0), dot(x1, x1), dot(x2, x2), dot(x3, x3)), tvec4<T, P>(0)); - m = m * m; - return T(42) * dot(m * m, tvec4<T, P>(dot(p0, x0), dot(p1, x1), dot(p2, x2), dot(p3, x3))); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER T simplex(tvec4<T, P> const & v) - { - tvec4<T, P> const C( - 0.138196601125011, // (5 - sqrt(5))/20 G4 - 0.276393202250021, // 2 * G4 - 0.414589803375032, // 3 * G4 - -0.447213595499958); // -1 + 4 * G4 - - // (sqrt(5) - 1)/4 = F4, used once below - T const F4 = static_cast<T>(0.309016994374947451); - - // First corner - tvec4<T, P> i = floor(v + dot(v, vec4(F4))); - tvec4<T, P> x0 = v - i + dot(i, vec4(C.x)); - - // Other corners - - // Rank sorting originally contributed by Bill Licea-Kane, AMD (formerly ATI) - tvec4<T, P> i0; - tvec3<T, P> isX = step(tvec3<T, P>(x0.y, x0.z, x0.w), tvec3<T, P>(x0.x)); - tvec3<T, P> isYZ = step(tvec3<T, P>(x0.z, x0.w, x0.w), tvec3<T, P>(x0.y, x0.y, x0.z)); - // i0.x = dot(isX, vec3(1.0)); - //i0.x = isX.x + isX.y + isX.z; - //i0.yzw = static_cast<T>(1) - isX; - i0 = tvec4<T, P>(isX.x + isX.y + isX.z, T(1) - isX); - // i0.y += dot(isYZ.xy, vec2(1.0)); - i0.y += isYZ.x + isYZ.y; - //i0.zw += 1.0 - tvec2<T, P>(isYZ.x, isYZ.y); - i0.z += static_cast<T>(1) - isYZ.x; - i0.w += static_cast<T>(1) - isYZ.y; - i0.z += isYZ.z; - i0.w += static_cast<T>(1) - isYZ.z; - - // i0 now contains the unique values 0,1,2,3 in each channel - tvec4<T, P> i3 = clamp(i0, T(0), T(1)); - tvec4<T, P> i2 = clamp(i0 - T(1), T(0), T(1)); - tvec4<T, P> i1 = clamp(i0 - T(2), T(0), T(1)); - - // x0 = x0 - 0.0 + 0.0 * C.xxxx - // x1 = x0 - i1 + 0.0 * C.xxxx - // x2 = x0 - i2 + 0.0 * C.xxxx - // x3 = x0 - i3 + 0.0 * C.xxxx - // x4 = x0 - 1.0 + 4.0 * C.xxxx - tvec4<T, P> x1 = x0 - i1 + C.x; - tvec4<T, P> x2 = x0 - i2 + C.y; - tvec4<T, P> x3 = x0 - i3 + C.z; - tvec4<T, P> x4 = x0 + C.w; - - // Permutations - i = mod(i, tvec4<T, P>(289)); - T j0 = detail::permute(detail::permute(detail::permute(detail::permute(i.w) + i.z) + i.y) + i.x); - tvec4<T, P> j1 = detail::permute(detail::permute(detail::permute(detail::permute( - i.w + tvec4<T, P>(i1.w, i2.w, i3.w, T(1))) + - i.z + tvec4<T, P>(i1.z, i2.z, i3.z, T(1))) + - i.y + tvec4<T, P>(i1.y, i2.y, i3.y, T(1))) + - i.x + tvec4<T, P>(i1.x, i2.x, i3.x, T(1))); - - // Gradients: 7x7x6 points over a cube, mapped onto a 4-cross polytope - // 7*7*6 = 294, which is close to the ring size 17*17 = 289. - tvec4<T, P> ip = tvec4<T, P>(T(1) / T(294), T(1) / T(49), T(1) / T(7), T(0)); - - tvec4<T, P> p0 = gtc::grad4(j0, ip); - tvec4<T, P> p1 = gtc::grad4(j1.x, ip); - tvec4<T, P> p2 = gtc::grad4(j1.y, ip); - tvec4<T, P> p3 = gtc::grad4(j1.z, ip); - tvec4<T, P> p4 = gtc::grad4(j1.w, ip); - - // Normalise gradients - tvec4<T, P> norm = detail::taylorInvSqrt(tvec4<T, P>(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3))); - p0 *= norm.x; - p1 *= norm.y; - p2 *= norm.z; - p3 *= norm.w; - p4 *= detail::taylorInvSqrt(dot(p4, p4)); - - // Mix contributions from the five corners - tvec3<T, P> m0 = max(T(0.6) - tvec3<T, P>(dot(x0, x0), dot(x1, x1), dot(x2, x2)), tvec3<T, P>(0)); - tvec2<T, P> m1 = max(T(0.6) - tvec2<T, P>(dot(x3, x3), dot(x4, x4) ), tvec2<T, P>(0)); - m0 = m0 * m0; - m1 = m1 * m1; - return T(49) * - (dot(m0 * m0, tvec3<T, P>(dot(p0, x0), dot(p1, x1), dot(p2, x2))) + - dot(m1 * m1, tvec2<T, P>(dot(p3, x3), dot(p4, x4)))); - } -}//namespace glm diff --git a/extensions/common/glm/gtc/packing.hpp b/extensions/common/glm/gtc/packing.hpp deleted file mode 100644 index 089743f68f7..00000000000 --- a/extensions/common/glm/gtc/packing.hpp +++ /dev/null @@ -1,478 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtc_packing -/// @file glm/gtc/packing.hpp -/// @date 2013-08-08 / 2013-08-08 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// -/// @defgroup gtc_packing GLM_GTC_packing -/// @ingroup gtc -/// -/// @brief This extension provides a set of function to convert vertors to packed -/// formats. -/// -/// <glm/gtc/packing.hpp> need to be included to use these features. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependency: -#include "type_precision.hpp" - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTC_packing extension included") -#endif - -namespace glm -{ - /// @addtogroup gtc_packing - /// @{ - - /// First, converts the normalized floating-point value v into a 8-bit integer value. - /// Then, the results are packed into the returned 8-bit unsigned integer. - /// - /// The conversion for component c of v to fixed point is done as follows: - /// packUnorm1x8: round(clamp(c, 0, +1) * 255.0) - /// - /// @see gtc_packing - /// @see uint16 packUnorm2x8(vec2 const & v) - /// @see uint32 packUnorm4x8(vec4 const & v) - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packUnorm4x8.xml">GLSL packUnorm4x8 man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> - GLM_FUNC_DECL uint8 packUnorm1x8(float v); - - /// Convert a single 8-bit integer to a normalized floating-point value. - /// - /// The conversion for unpacked fixed-point value f to floating point is done as follows: - /// unpackUnorm4x8: f / 255.0 - /// - /// @see gtc_packing - /// @see vec2 unpackUnorm2x8(uint16 p) - /// @see vec4 unpackUnorm4x8(uint32 p) - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackUnorm4x8.xml">GLSL unpackUnorm4x8 man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> - GLM_FUNC_DECL float unpackUnorm1x8(uint8 p); - - /// First, converts each component of the normalized floating-point value v into 8-bit integer values. - /// Then, the results are packed into the returned 16-bit unsigned integer. - /// - /// The conversion for component c of v to fixed point is done as follows: - /// packUnorm2x8: round(clamp(c, 0, +1) * 255.0) - /// - /// The first component of the vector will be written to the least significant bits of the output; - /// the last component will be written to the most significant bits. - /// - /// @see gtc_packing - /// @see uint8 packUnorm1x8(float const & v) - /// @see uint32 packUnorm4x8(vec4 const & v) - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packUnorm4x8.xml">GLSL packUnorm4x8 man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> - GLM_FUNC_DECL uint16 packUnorm2x8(vec2 const & v); - - /// First, unpacks a single 16-bit unsigned integer p into a pair of 8-bit unsigned integers. - /// Then, each component is converted to a normalized floating-point value to generate the returned two-component vector. - /// - /// The conversion for unpacked fixed-point value f to floating point is done as follows: - /// unpackUnorm4x8: f / 255.0 - /// - /// The first component of the returned vector will be extracted from the least significant bits of the input; - /// the last component will be extracted from the most significant bits. - /// - /// @see gtc_packing - /// @see float unpackUnorm1x8(uint8 v) - /// @see vec4 unpackUnorm4x8(uint32 p) - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackUnorm4x8.xml">GLSL unpackUnorm4x8 man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> - GLM_FUNC_DECL vec2 unpackUnorm2x8(uint16 p); - - /// First, converts the normalized floating-point value v into 8-bit integer value. - /// Then, the results are packed into the returned 8-bit unsigned integer. - /// - /// The conversion to fixed point is done as follows: - /// packSnorm1x8: round(clamp(s, -1, +1) * 127.0) - /// - /// @see gtc_packing - /// @see uint16 packSnorm2x8(vec2 const & v) - /// @see uint32 packSnorm4x8(vec4 const & v) - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packSnorm4x8.xml">GLSL packSnorm4x8 man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> - GLM_FUNC_DECL uint8 packSnorm1x8(float s); - - /// First, unpacks a single 8-bit unsigned integer p into a single 8-bit signed integers. - /// Then, the value is converted to a normalized floating-point value to generate the returned scalar. - /// - /// The conversion for unpacked fixed-point value f to floating point is done as follows: - /// unpackSnorm1x8: clamp(f / 127.0, -1, +1) - /// - /// @see gtc_packing - /// @see vec2 unpackSnorm2x8(uint16 p) - /// @see vec4 unpackSnorm4x8(uint32 p) - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackSnorm4x8.xml">GLSL unpackSnorm4x8 man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> - GLM_FUNC_DECL float unpackSnorm1x8(uint8 p); - - /// First, converts each component of the normalized floating-point value v into 8-bit integer values. - /// Then, the results are packed into the returned 16-bit unsigned integer. - /// - /// The conversion for component c of v to fixed point is done as follows: - /// packSnorm2x8: round(clamp(c, -1, +1) * 127.0) - /// - /// The first component of the vector will be written to the least significant bits of the output; - /// the last component will be written to the most significant bits. - /// - /// @see gtc_packing - /// @see uint8 packSnorm1x8(float const & v) - /// @see uint32 packSnorm4x8(vec4 const & v) - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packSnorm4x8.xml">GLSL packSnorm4x8 man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> - GLM_FUNC_DECL uint16 packSnorm2x8(vec2 const & v); - - /// First, unpacks a single 16-bit unsigned integer p into a pair of 8-bit signed integers. - /// Then, each component is converted to a normalized floating-point value to generate the returned two-component vector. - /// - /// The conversion for unpacked fixed-point value f to floating point is done as follows: - /// unpackSnorm2x8: clamp(f / 127.0, -1, +1) - /// - /// The first component of the returned vector will be extracted from the least significant bits of the input; - /// the last component will be extracted from the most significant bits. - /// - /// @see gtc_packing - /// @see float unpackSnorm1x8(uint8 p) - /// @see vec4 unpackSnorm4x8(uint32 p) - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackSnorm4x8.xml">GLSL unpackSnorm4x8 man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> - GLM_FUNC_DECL vec2 unpackSnorm2x8(uint16 p); - - /// First, converts the normalized floating-point value v into a 16-bit integer value. - /// Then, the results are packed into the returned 16-bit unsigned integer. - /// - /// The conversion for component c of v to fixed point is done as follows: - /// packUnorm1x16: round(clamp(c, 0, +1) * 65535.0) - /// - /// @see gtc_packing - /// @see uint16 packSnorm1x16(float const & v) - /// @see uint64 packSnorm4x16(vec4 const & v) - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packUnorm4x8.xml">GLSL packUnorm4x8 man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> - GLM_FUNC_DECL uint16 packUnorm1x16(float v); - - /// First, unpacks a single 16-bit unsigned integer p into a of 16-bit unsigned integers. - /// Then, the value is converted to a normalized floating-point value to generate the returned scalar. - /// - /// The conversion for unpacked fixed-point value f to floating point is done as follows: - /// unpackUnorm1x16: f / 65535.0 - /// - /// @see gtc_packing - /// @see vec2 unpackUnorm2x16(uint32 p) - /// @see vec4 unpackUnorm4x16(uint64 p) - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackUnorm2x16.xml">GLSL unpackUnorm2x16 man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> - GLM_FUNC_DECL float unpackUnorm1x16(uint16 p); - - /// First, converts each component of the normalized floating-point value v into 16-bit integer values. - /// Then, the results are packed into the returned 64-bit unsigned integer. - /// - /// The conversion for component c of v to fixed point is done as follows: - /// packUnorm4x16: round(clamp(c, 0, +1) * 65535.0) - /// - /// The first component of the vector will be written to the least significant bits of the output; - /// the last component will be written to the most significant bits. - /// - /// @see gtc_packing - /// @see uint16 packUnorm1x16(float const & v) - /// @see uint32 packUnorm2x16(vec2 const & v) - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packUnorm4x8.xml">GLSL packUnorm4x8 man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> - GLM_FUNC_DECL uint64 packUnorm4x16(vec4 const & v); - - /// First, unpacks a single 64-bit unsigned integer p into four 16-bit unsigned integers. - /// Then, each component is converted to a normalized floating-point value to generate the returned four-component vector. - /// - /// The conversion for unpacked fixed-point value f to floating point is done as follows: - /// unpackUnormx4x16: f / 65535.0 - /// - /// The first component of the returned vector will be extracted from the least significant bits of the input; - /// the last component will be extracted from the most significant bits. - /// - /// @see gtc_packing - /// @see float unpackUnorm1x16(uint16 p) - /// @see vec2 unpackUnorm2x16(uint32 p) - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackUnorm2x16.xml">GLSL unpackUnorm2x16 man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> - GLM_FUNC_DECL vec4 unpackUnorm4x16(uint64 p); - - /// First, converts the normalized floating-point value v into 16-bit integer value. - /// Then, the results are packed into the returned 16-bit unsigned integer. - /// - /// The conversion to fixed point is done as follows: - /// packSnorm1x8: round(clamp(s, -1, +1) * 32767.0) - /// - /// @see gtc_packing - /// @see uint32 packSnorm2x16(vec2 const & v) - /// @see uint64 packSnorm4x16(vec4 const & v) - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packSnorm4x8.xml">GLSL packSnorm4x8 man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> - GLM_FUNC_DECL uint16 packSnorm1x16(float v); - - /// First, unpacks a single 16-bit unsigned integer p into a single 16-bit signed integers. - /// Then, each component is converted to a normalized floating-point value to generate the returned scalar. - /// - /// The conversion for unpacked fixed-point value f to floating point is done as follows: - /// unpackSnorm1x16: clamp(f / 32767.0, -1, +1) - /// - /// @see gtc_packing - /// @see vec2 unpackSnorm2x16(uint32 p) - /// @see vec4 unpackSnorm4x16(uint64 p) - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackSnorm1x16.xml">GLSL unpackSnorm4x8 man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> - GLM_FUNC_DECL float unpackSnorm1x16(uint16 p); - - /// First, converts each component of the normalized floating-point value v into 16-bit integer values. - /// Then, the results are packed into the returned 64-bit unsigned integer. - /// - /// The conversion for component c of v to fixed point is done as follows: - /// packSnorm2x8: round(clamp(c, -1, +1) * 32767.0) - /// - /// The first component of the vector will be written to the least significant bits of the output; - /// the last component will be written to the most significant bits. - /// - /// @see gtc_packing - /// @see uint16 packSnorm1x16(float const & v) - /// @see uint32 packSnorm2x16(vec2 const & v) - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packSnorm4x8.xml">GLSL packSnorm4x8 man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> - GLM_FUNC_DECL uint64 packSnorm4x16(vec4 const & v); - - /// First, unpacks a single 64-bit unsigned integer p into four 16-bit signed integers. - /// Then, each component is converted to a normalized floating-point value to generate the returned four-component vector. - /// - /// The conversion for unpacked fixed-point value f to floating point is done as follows: - /// unpackSnorm4x16: clamp(f / 32767.0, -1, +1) - /// - /// The first component of the returned vector will be extracted from the least significant bits of the input; - /// the last component will be extracted from the most significant bits. - /// - /// @see gtc_packing - /// @see float unpackSnorm1x16(uint16 p) - /// @see vec2 unpackSnorm2x16(uint32 p) - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackSnorm2x16.xml">GLSL unpackSnorm4x8 man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> - GLM_FUNC_DECL vec4 unpackSnorm4x16(uint64 p); - - /// Returns an unsigned integer obtained by converting the components of a floating-point scalar - /// to the 16-bit floating-point representation found in the OpenGL Specification, - /// and then packing this 16-bit value into a 16-bit unsigned integer. - /// - /// @see gtc_packing - /// @see uint32 packHalf2x16(vec2 const & v) - /// @see uint64 packHalf4x16(vec4 const & v) - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packHalf2x16.xml">GLSL packHalf2x16 man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> - GLM_FUNC_DECL uint16 packHalf1x16(float v); - - /// Returns a floating-point scalar with components obtained by unpacking a 16-bit unsigned integer into a 16-bit value, - /// interpreted as a 16-bit floating-point number according to the OpenGL Specification, - /// and converting it to 32-bit floating-point values. - /// - /// @see gtc_packing - /// @see vec2 unpackHalf2x16(uint32 const & v) - /// @see vec4 unpackHalf4x16(uint64 const & v) - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackHalf2x16.xml">GLSL unpackHalf2x16 man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> - GLM_FUNC_DECL float unpackHalf1x16(uint16 v); - - /// Returns an unsigned integer obtained by converting the components of a four-component floating-point vector - /// to the 16-bit floating-point representation found in the OpenGL Specification, - /// and then packing these four 16-bit values into a 64-bit unsigned integer. - /// The first vector component specifies the 16 least-significant bits of the result; - /// the forth component specifies the 16 most-significant bits. - /// - /// @see gtc_packing - /// @see uint16 packHalf1x16(float const & v) - /// @see uint32 packHalf2x16(vec2 const & v) - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packHalf2x16.xml">GLSL packHalf2x16 man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> - GLM_FUNC_DECL uint64 packHalf4x16(vec4 const & v); - - /// Returns a four-component floating-point vector with components obtained by unpacking a 64-bit unsigned integer into four 16-bit values, - /// interpreting those values as 16-bit floating-point numbers according to the OpenGL Specification, - /// and converting them to 32-bit floating-point values. - /// The first component of the vector is obtained from the 16 least-significant bits of v; - /// the forth component is obtained from the 16 most-significant bits of v. - /// - /// @see gtc_packing - /// @see float unpackHalf1x16(uint16 const & v) - /// @see vec2 unpackHalf2x16(uint32 const & v) - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackHalf2x16.xml">GLSL unpackHalf2x16 man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> - GLM_FUNC_DECL vec4 unpackHalf4x16(uint64 p); - - /// Returns an unsigned integer obtained by converting the components of a four-component signed integer vector - /// to the 10-10-10-2-bit signed integer representation found in the OpenGL Specification, - /// and then packing these four values into a 32-bit unsigned integer. - /// The first vector component specifies the 10 least-significant bits of the result; - /// the forth component specifies the 2 most-significant bits. - /// - /// @see gtc_packing - /// @see uint32 packI3x10_1x2(uvec4 const & v) - /// @see uint32 packSnorm3x10_1x2(vec4 const & v) - /// @see uint32 packUnorm3x10_1x2(vec4 const & v) - /// @see ivec4 unpackI3x10_1x2(uint32 const & p) - GLM_FUNC_DECL uint32 packI3x10_1x2(ivec4 const & v); - - /// Unpacks a single 32-bit unsigned integer p into three 10-bit and one 2-bit signed integers. - /// - /// The first component of the returned vector will be extracted from the least significant bits of the input; - /// the last component will be extracted from the most significant bits. - /// - /// @see gtc_packing - /// @see uint32 packU3x10_1x2(uvec4 const & v) - /// @see vec4 unpackSnorm3x10_1x2(uint32 const & p); - /// @see uvec4 unpackI3x10_1x2(uint32 const & p); - GLM_FUNC_DECL ivec4 unpackI3x10_1x2(uint32 p); - - /// Returns an unsigned integer obtained by converting the components of a four-component unsigned integer vector - /// to the 10-10-10-2-bit unsigned integer representation found in the OpenGL Specification, - /// and then packing these four values into a 32-bit unsigned integer. - /// The first vector component specifies the 10 least-significant bits of the result; - /// the forth component specifies the 2 most-significant bits. - /// - /// @see gtc_packing - /// @see uint32 packI3x10_1x2(ivec4 const & v) - /// @see uint32 packSnorm3x10_1x2(vec4 const & v) - /// @see uint32 packUnorm3x10_1x2(vec4 const & v) - /// @see ivec4 unpackU3x10_1x2(uint32 const & p) - GLM_FUNC_DECL uint32 packU3x10_1x2(uvec4 const & v); - - /// Unpacks a single 32-bit unsigned integer p into three 10-bit and one 2-bit unsigned integers. - /// - /// The first component of the returned vector will be extracted from the least significant bits of the input; - /// the last component will be extracted from the most significant bits. - /// - /// @see gtc_packing - /// @see uint32 packU3x10_1x2(uvec4 const & v) - /// @see vec4 unpackSnorm3x10_1x2(uint32 const & p); - /// @see uvec4 unpackI3x10_1x2(uint32 const & p); - GLM_FUNC_DECL uvec4 unpackU3x10_1x2(uint32 p); - - /// First, converts the first three components of the normalized floating-point value v into 10-bit signed integer values. - /// Then, converts the forth component of the normalized floating-point value v into 2-bit signed integer values. - /// Then, the results are packed into the returned 32-bit unsigned integer. - /// - /// The conversion for component c of v to fixed point is done as follows: - /// packSnorm3x10_1x2(xyz): round(clamp(c, -1, +1) * 511.0) - /// packSnorm3x10_1x2(w): round(clamp(c, -1, +1) * 1.0) - /// - /// The first vector component specifies the 10 least-significant bits of the result; - /// the forth component specifies the 2 most-significant bits. - /// - /// @see gtc_packing - /// @see vec4 unpackSnorm3x10_1x2(uint32 const & p) - /// @see uint32 packUnorm3x10_1x2(vec4 const & v) - /// @see uint32 packU3x10_1x2(uvec4 const & v) - /// @see uint32 packI3x10_1x2(ivec4 const & v) - GLM_FUNC_DECL uint32 packSnorm3x10_1x2(vec4 const & v); - - /// First, unpacks a single 32-bit unsigned integer p into four 16-bit signed integers. - /// Then, each component is converted to a normalized floating-point value to generate the returned four-component vector. - /// - /// The conversion for unpacked fixed-point value f to floating point is done as follows: - /// unpackSnorm3x10_1x2(xyz): clamp(f / 511.0, -1, +1) - /// unpackSnorm3x10_1x2(w): clamp(f / 511.0, -1, +1) - /// - /// The first component of the returned vector will be extracted from the least significant bits of the input; - /// the last component will be extracted from the most significant bits. - /// - /// @see gtc_packing - /// @see uint32 packSnorm3x10_1x2(vec4 const & v) - /// @see vec4 unpackUnorm3x10_1x2(uint32 const & p)) - /// @see uvec4 unpackI3x10_1x2(uint32 const & p) - /// @see uvec4 unpackU3x10_1x2(uint32 const & p) - GLM_FUNC_DECL vec4 unpackSnorm3x10_1x2(uint32 p); - - /// First, converts the first three components of the normalized floating-point value v into 10-bit unsigned integer values. - /// Then, converts the forth component of the normalized floating-point value v into 2-bit signed uninteger values. - /// Then, the results are packed into the returned 32-bit unsigned integer. - /// - /// The conversion for component c of v to fixed point is done as follows: - /// packUnorm3x10_1x2(xyz): round(clamp(c, 0, +1) * 1023.0) - /// packUnorm3x10_1x2(w): round(clamp(c, 0, +1) * 3.0) - /// - /// The first vector component specifies the 10 least-significant bits of the result; - /// the forth component specifies the 2 most-significant bits. - /// - /// @see gtc_packing - /// @see vec4 unpackUnorm3x10_1x2(uint32 const & p) - /// @see uint32 packUnorm3x10_1x2(vec4 const & v) - /// @see uint32 packU3x10_1x2(uvec4 const & v) - /// @see uint32 packI3x10_1x2(ivec4 const & v) - GLM_FUNC_DECL uint32 packUnorm3x10_1x2(vec4 const & v); - - /// First, unpacks a single 32-bit unsigned integer p into four 16-bit signed integers. - /// Then, each component is converted to a normalized floating-point value to generate the returned four-component vector. - /// - /// The conversion for unpacked fixed-point value f to floating point is done as follows: - /// unpackSnorm3x10_1x2(xyz): clamp(f / 1023.0, 0, +1) - /// unpackSnorm3x10_1x2(w): clamp(f / 3.0, 0, +1) - /// - /// The first component of the returned vector will be extracted from the least significant bits of the input; - /// the last component will be extracted from the most significant bits. - /// - /// @see gtc_packing - /// @see uint32 packSnorm3x10_1x2(vec4 const & v) - /// @see vec4 unpackInorm3x10_1x2(uint32 const & p)) - /// @see uvec4 unpackI3x10_1x2(uint32 const & p) - /// @see uvec4 unpackU3x10_1x2(uint32 const & p) - GLM_FUNC_DECL vec4 unpackUnorm3x10_1x2(uint32 p); - - /// First, converts the first two components of the normalized floating-point value v into 11-bit signless floating-point values. - /// Then, converts the third component of the normalized floating-point value v into a 10-bit signless floating-point value. - /// Then, the results are packed into the returned 32-bit unsigned integer. - /// - /// The first vector component specifies the 11 least-significant bits of the result; - /// the last component specifies the 10 most-significant bits. - /// - /// @see gtc_packing - /// @see vec3 unpackF2x11_1x10(uint32 const & p) - GLM_FUNC_DECL uint32 packF2x11_1x10(vec3 const & v); - - /// First, unpacks a single 32-bit unsigned integer p into two 11-bit signless floating-point values and one 10-bit signless floating-point value . - /// Then, each component is converted to a normalized floating-point value to generate the returned three-component vector. - /// - /// The first component of the returned vector will be extracted from the least significant bits of the input; - /// the last component will be extracted from the most significant bits. - /// - /// @see gtc_packing - /// @see uint32 packF2x11_1x10(vec3 const & v) - GLM_FUNC_DECL vec3 unpackF2x11_1x10(uint32 p); - - /// @} -}// namespace glm - -#include "packing.inl" diff --git a/extensions/common/glm/gtc/packing.inl b/extensions/common/glm/gtc/packing.inl deleted file mode 100644 index 58b1d59b917..00000000000 --- a/extensions/common/glm/gtc/packing.inl +++ /dev/null @@ -1,490 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtc_packing -/// @file glm/gtc/packing.inl -/// @date 2013-08-08 / 2013-08-08 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#include "../common.hpp" -#include "../vec2.hpp" -#include "../vec3.hpp" -#include "../vec4.hpp" -#include "../detail/type_half.hpp" -#include <cstring> - -namespace glm{ -namespace detail -{ - GLM_FUNC_QUALIFIER glm::uint16 float2half(glm::uint32 f) - { - // 10 bits => EE EEEFFFFF - // 11 bits => EEE EEFFFFFF - // Half bits => SEEEEEFF FFFFFFFF - // Float bits => SEEEEEEE EFFFFFFF FFFFFFFF FFFFFFFF - - // 0x00007c00 => 00000000 00000000 01111100 00000000 - // 0x000003ff => 00000000 00000000 00000011 11111111 - // 0x38000000 => 00111000 00000000 00000000 00000000 - // 0x7f800000 => 01111111 10000000 00000000 00000000 - // 0x00008000 => 00000000 00000000 10000000 00000000 - return - ((f >> 16) & 0x8000) | // sign - ((((f & 0x7f800000) - 0x38000000) >> 13) & 0x7c00) | // exponential - ((f >> 13) & 0x03ff); // Mantissa - } - - GLM_FUNC_QUALIFIER glm::uint32 float2packed11(glm::uint32 f) - { - // 10 bits => EE EEEFFFFF - // 11 bits => EEE EEFFFFFF - // Half bits => SEEEEEFF FFFFFFFF - // Float bits => SEEEEEEE EFFFFFFF FFFFFFFF FFFFFFFF - - // 0x000007c0 => 00000000 00000000 00000111 11000000 - // 0x00007c00 => 00000000 00000000 01111100 00000000 - // 0x000003ff => 00000000 00000000 00000011 11111111 - // 0x38000000 => 00111000 00000000 00000000 00000000 - // 0x7f800000 => 01111111 10000000 00000000 00000000 - // 0x00008000 => 00000000 00000000 10000000 00000000 - return - ((((f & 0x7f800000) - 0x38000000) >> 17) & 0x07c0) | // exponential - ((f >> 17) & 0x003f); // Mantissa - } - - GLM_FUNC_QUALIFIER glm::uint32 packed11ToFloat(glm::uint32 p) - { - // 10 bits => EE EEEFFFFF - // 11 bits => EEE EEFFFFFF - // Half bits => SEEEEEFF FFFFFFFF - // Float bits => SEEEEEEE EFFFFFFF FFFFFFFF FFFFFFFF - - // 0x000007c0 => 00000000 00000000 00000111 11000000 - // 0x00007c00 => 00000000 00000000 01111100 00000000 - // 0x000003ff => 00000000 00000000 00000011 11111111 - // 0x38000000 => 00111000 00000000 00000000 00000000 - // 0x7f800000 => 01111111 10000000 00000000 00000000 - // 0x00008000 => 00000000 00000000 10000000 00000000 - return - ((((p & 0x07c0) << 17) + 0x38000000) & 0x7f800000) | // exponential - ((p & 0x003f) << 17); // Mantissa - } - - GLM_FUNC_QUALIFIER glm::uint32 float2packed10(glm::uint32 f) - { - // 10 bits => EE EEEFFFFF - // 11 bits => EEE EEFFFFFF - // Half bits => SEEEEEFF FFFFFFFF - // Float bits => SEEEEEEE EFFFFFFF FFFFFFFF FFFFFFFF - - // 0x0000001F => 00000000 00000000 00000000 00011111 - // 0x0000003F => 00000000 00000000 00000000 00111111 - // 0x000003E0 => 00000000 00000000 00000011 11100000 - // 0x000007C0 => 00000000 00000000 00000111 11000000 - // 0x00007C00 => 00000000 00000000 01111100 00000000 - // 0x000003FF => 00000000 00000000 00000011 11111111 - // 0x38000000 => 00111000 00000000 00000000 00000000 - // 0x7f800000 => 01111111 10000000 00000000 00000000 - // 0x00008000 => 00000000 00000000 10000000 00000000 - return - ((((f & 0x7f800000) - 0x38000000) >> 18) & 0x03E0) | // exponential - ((f >> 18) & 0x001f); // Mantissa - } - - GLM_FUNC_QUALIFIER glm::uint32 packed10ToFloat(glm::uint32 p) - { - // 10 bits => EE EEEFFFFF - // 11 bits => EEE EEFFFFFF - // Half bits => SEEEEEFF FFFFFFFF - // Float bits => SEEEEEEE EFFFFFFF FFFFFFFF FFFFFFFF - - // 0x0000001F => 00000000 00000000 00000000 00011111 - // 0x0000003F => 00000000 00000000 00000000 00111111 - // 0x000003E0 => 00000000 00000000 00000011 11100000 - // 0x000007C0 => 00000000 00000000 00000111 11000000 - // 0x00007C00 => 00000000 00000000 01111100 00000000 - // 0x000003FF => 00000000 00000000 00000011 11111111 - // 0x38000000 => 00111000 00000000 00000000 00000000 - // 0x7f800000 => 01111111 10000000 00000000 00000000 - // 0x00008000 => 00000000 00000000 10000000 00000000 - return - ((((p & 0x03E0) << 18) + 0x38000000) & 0x7f800000) | // exponential - ((p & 0x001f) << 18); // Mantissa - } - - GLM_FUNC_QUALIFIER glm::uint half2float(glm::uint h) - { - return ((h & 0x8000) << 16) | ((( h & 0x7c00) + 0x1C000) << 13) | ((h & 0x03FF) << 13); - } - - GLM_FUNC_QUALIFIER glm::uint floatTo11bit(float x) - { - if(x == 0.0f) - return 0u; - else if(glm::isnan(x)) - return ~0u; - else if(glm::isinf(x)) - return 0x1Fu << 6u; - -# if(GLM_COMPILER & GLM_COMPILER_GCC || GLM_COMPILER & (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM)) - uint Pack = 0u; - memcpy(&Pack, &x, sizeof(Pack)); -# else - uint Pack = reinterpret_cast<uint&>(x); -# endif - - return float2packed11(Pack); - } - - GLM_FUNC_QUALIFIER float packed11bitToFloat(glm::uint x) - { - if(x == 0) - return 0.0f; - else if(x == ((1 << 11) - 1)) - return ~0;//NaN - else if(x == (0x1f << 6)) - return ~0;//Inf - - uint Result = packed11ToFloat(x); - -# if(GLM_COMPILER & GLM_COMPILER_GCC || GLM_COMPILER & (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM)) - float Temp = 0; - memcpy(&Temp, &Result, sizeof(Temp)); - return Temp; -# else - return reinterpret_cast<float&>(Result); -# endif - } - - GLM_FUNC_QUALIFIER glm::uint floatTo10bit(float x) - { - if(x == 0.0f) - return 0u; - else if(glm::isnan(x)) - return ~0u; - else if(glm::isinf(x)) - return 0x1Fu << 5u; - -# if(GLM_COMPILER & GLM_COMPILER_GCC || GLM_COMPILER & (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM)) - uint Pack = 0; - memcpy(&Pack, &x, sizeof(Pack)); -# else - uint Pack = reinterpret_cast<uint&>(x); -# endif - - return float2packed10(Pack); - } - - GLM_FUNC_QUALIFIER float packed10bitToFloat(glm::uint x) - { - if(x == 0) - return 0.0f; - else if(x == ((1 << 10) - 1)) - return ~0;//NaN - else if(x == (0x1f << 5)) - return ~0;//Inf - - uint Result = packed10ToFloat(x); - -# if(GLM_COMPILER & GLM_COMPILER_GCC || GLM_COMPILER & (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM)) - float Temp = 0; - memcpy(&Temp, &Result, sizeof(Temp)); - return Temp; -# else - return reinterpret_cast<float&>(Result); -# endif - } - -// GLM_FUNC_QUALIFIER glm::uint f11_f11_f10(float x, float y, float z) -// { -// return ((floatTo11bit(x) & ((1 << 11) - 1)) << 0) | ((floatTo11bit(y) & ((1 << 11) - 1)) << 11) | ((floatTo10bit(z) & ((1 << 10) - 1)) << 22); -// } - - union u10u10u10u2 - { - struct - { - uint x : 10; - uint y : 10; - uint z : 10; - uint w : 2; - } data; - uint32 pack; - }; - - union i10i10i10i2 - { - struct - { - int x : 10; - int y : 10; - int z : 10; - int w : 2; - } data; - uint32 pack; - }; - -}//namespace detail - - GLM_FUNC_QUALIFIER uint8 packUnorm1x8(float v) - { - return static_cast<uint8>(round(clamp(v, 0.0f, 1.0f) * 255.0f)); - } - - GLM_FUNC_QUALIFIER float unpackUnorm1x8(uint8 p) - { - float const Unpack(p); - return Unpack * static_cast<float>(0.0039215686274509803921568627451); // 1 / 255 - } - - GLM_FUNC_QUALIFIER uint16 packUnorm2x8(vec2 const & v) - { - u8vec2 const Topack(round(clamp(v, 0.0f, 1.0f) * 255.0f)); - return reinterpret_cast<uint16 const &>(Topack); - } - - GLM_FUNC_QUALIFIER vec2 unpackUnorm2x8(uint16 p) - { - vec2 const Unpack(reinterpret_cast<u8vec2 const &>(p)); - return Unpack * float(0.0039215686274509803921568627451); // 1 / 255 - } - - GLM_FUNC_QUALIFIER uint8 packSnorm1x8(float v) - { - int8 const Topack(static_cast<int8>(round(clamp(v ,-1.0f, 1.0f) * 127.0f))); - return reinterpret_cast<uint8 const &>(Topack); - } - - GLM_FUNC_QUALIFIER float unpackSnorm1x8(uint8 p) - { - float const Unpack(reinterpret_cast<int8 const &>(p)); - return clamp( - Unpack * 0.00787401574803149606299212598425f, // 1.0f / 127.0f - -1.0f, 1.0f); - } - - GLM_FUNC_QUALIFIER uint16 packSnorm2x8(vec2 const & v) - { - i8vec2 const Topack(round(clamp(v, -1.0f, 1.0f) * 127.0f)); - return reinterpret_cast<uint16 const &>(Topack); - } - - GLM_FUNC_QUALIFIER vec2 unpackSnorm2x8(uint16 p) - { - vec2 const Unpack(reinterpret_cast<i8vec2 const &>(p)); - return clamp( - Unpack * 0.00787401574803149606299212598425f, // 1.0f / 127.0f - -1.0f, 1.0f); - } - - GLM_FUNC_QUALIFIER uint16 packUnorm1x16(float s) - { - return static_cast<uint16>(round(clamp(s, 0.0f, 1.0f) * 65535.0f)); - } - - GLM_FUNC_QUALIFIER float unpackUnorm1x16(uint16 p) - { - float const Unpack(p); - return Unpack * 1.5259021896696421759365224689097e-5f; // 1.0 / 65535.0 - } - - GLM_FUNC_QUALIFIER uint64 packUnorm4x16(vec4 const & v) - { - u16vec4 const Topack(round(clamp(v , 0.0f, 1.0f) * 65535.0f)); - return reinterpret_cast<uint64 const &>(Topack); - } - - GLM_FUNC_QUALIFIER vec4 unpackUnorm4x16(uint64 p) - { - vec4 const Unpack(reinterpret_cast<u16vec4 const &>(p)); - return Unpack * 1.5259021896696421759365224689097e-5f; // 1.0 / 65535.0 - } - - GLM_FUNC_QUALIFIER uint16 packSnorm1x16(float v) - { - int16 const Topack = static_cast<int16>(round(clamp(v ,-1.0f, 1.0f) * 32767.0f)); - return reinterpret_cast<uint16 const &>(Topack); - } - - GLM_FUNC_QUALIFIER float unpackSnorm1x16(uint16 p) - { - float const Unpack(reinterpret_cast<int16 const &>(p)); - return clamp( - Unpack * 3.0518509475997192297128208258309e-5f, //1.0f / 32767.0f, - -1.0f, 1.0f); - } - - GLM_FUNC_QUALIFIER uint64 packSnorm4x16(vec4 const & v) - { - i16vec4 const Topack(round(clamp(v ,-1.0f, 1.0f) * 32767.0f)); - return reinterpret_cast<uint64 const &>(Topack); - } - - GLM_FUNC_QUALIFIER vec4 unpackSnorm4x16(uint64 p) - { - vec4 const Unpack(reinterpret_cast<i16vec4 const &>(p)); - return clamp( - Unpack * 3.0518509475997192297128208258309e-5f, //1.0f / 32767.0f, - -1.0f, 1.0f); - } - - GLM_FUNC_QUALIFIER uint16 packHalf1x16(float v) - { - int16 const Topack(detail::toFloat16(v)); - return reinterpret_cast<uint16 const &>(Topack); - } - - GLM_FUNC_QUALIFIER float unpackHalf1x16(uint16 v) - { - return detail::toFloat32(reinterpret_cast<int16 const &>(v)); - } - - GLM_FUNC_QUALIFIER uint64 packHalf4x16(glm::vec4 const & v) - { - i16vec4 Unpack( - detail::toFloat16(v.x), - detail::toFloat16(v.y), - detail::toFloat16(v.z), - detail::toFloat16(v.w)); - - return reinterpret_cast<uint64 const &>(Unpack); - } - - GLM_FUNC_QUALIFIER glm::vec4 unpackHalf4x16(uint64 v) - { - i16vec4 Unpack(reinterpret_cast<i16vec4 const &>(v)); - - return vec4( - detail::toFloat32(Unpack.x), - detail::toFloat32(Unpack.y), - detail::toFloat32(Unpack.z), - detail::toFloat32(Unpack.w)); - } - - GLM_FUNC_QUALIFIER uint32 packI3x10_1x2(ivec4 const & v) - { - detail::i10i10i10i2 Result; - Result.data.x = v.x; - Result.data.y = v.y; - Result.data.z = v.z; - Result.data.w = v.w; - return Result.pack; - } - - GLM_FUNC_QUALIFIER ivec4 unpackI3x10_1x2(uint32 v) - { - detail::i10i10i10i2 Unpack; - Unpack.pack = v; - return ivec4( - Unpack.data.x, - Unpack.data.y, - Unpack.data.z, - Unpack.data.w); - } - - GLM_FUNC_QUALIFIER uint32 packU3x10_1x2(uvec4 const & v) - { - detail::u10u10u10u2 Result; - Result.data.x = v.x; - Result.data.y = v.y; - Result.data.z = v.z; - Result.data.w = v.w; - return Result.pack; - } - - GLM_FUNC_QUALIFIER uvec4 unpackU3x10_1x2(uint32 v) - { - detail::u10u10u10u2 Unpack; - Unpack.pack = v; - return uvec4( - Unpack.data.x, - Unpack.data.y, - Unpack.data.z, - Unpack.data.w); - } - - GLM_FUNC_QUALIFIER uint32 packSnorm3x10_1x2(vec4 const & v) - { - detail::i10i10i10i2 Result; - Result.data.x = int(round(clamp(v.x,-1.0f, 1.0f) * 511.f)); - Result.data.y = int(round(clamp(v.y,-1.0f, 1.0f) * 511.f)); - Result.data.z = int(round(clamp(v.z,-1.0f, 1.0f) * 511.f)); - Result.data.w = int(round(clamp(v.w,-1.0f, 1.0f) * 1.f)); - return Result.pack; - } - - GLM_FUNC_QUALIFIER vec4 unpackSnorm3x10_1x2(uint32 v) - { - detail::i10i10i10i2 Unpack; - Unpack.pack = v; - vec4 Result; - Result.x = clamp(float(Unpack.data.x) / 511.f, -1.0f, 1.0f); - Result.y = clamp(float(Unpack.data.y) / 511.f, -1.0f, 1.0f); - Result.z = clamp(float(Unpack.data.z) / 511.f, -1.0f, 1.0f); - Result.w = clamp(float(Unpack.data.w) / 1.f, -1.0f, 1.0f); - return Result; - } - - GLM_FUNC_QUALIFIER uint32 packUnorm3x10_1x2(vec4 const & v) - { - detail::i10i10i10i2 Result; - Result.data.x = int(round(clamp(v.x, 0.0f, 1.0f) * 1023.f)); - Result.data.y = int(round(clamp(v.y, 0.0f, 1.0f) * 1023.f)); - Result.data.z = int(round(clamp(v.z, 0.0f, 1.0f) * 1023.f)); - Result.data.w = int(round(clamp(v.w, 0.0f, 1.0f) * 3.f)); - return Result.pack; - } - - GLM_FUNC_QUALIFIER vec4 unpackUnorm3x10_1x2(uint32 v) - { - detail::i10i10i10i2 Unpack; - Unpack.pack = v; - vec4 Result; - Result.x = float(Unpack.data.x) / 1023.f; - Result.y = float(Unpack.data.y) / 1023.f; - Result.z = float(Unpack.data.z) / 1023.f; - Result.w = float(Unpack.data.w) / 3.f; - return Result; - } - - GLM_FUNC_QUALIFIER uint32 packF2x11_1x10(vec3 const & v) - { - return - ((detail::floatTo11bit(v.x) & ((1 << 11) - 1)) << 0) | - ((detail::floatTo11bit(v.y) & ((1 << 11) - 1)) << 11) | - ((detail::floatTo10bit(v.z) & ((1 << 10) - 1)) << 22); - } - - GLM_FUNC_QUALIFIER vec3 unpackF2x11_1x10(uint32 v) - { - return vec3( - detail::packed11bitToFloat(v >> 0), - detail::packed11bitToFloat(v >> 11), - detail::packed10bitToFloat(v >> 22)); - } - -}//namespace glm diff --git a/extensions/common/glm/gtc/quaternion.hpp b/extensions/common/glm/gtc/quaternion.hpp deleted file mode 100644 index 2de90b8e17b..00000000000 --- a/extensions/common/glm/gtc/quaternion.hpp +++ /dev/null @@ -1,377 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtc_quaternion -/// @file glm/gtc/quaternion.hpp -/// @date 2009-05-21 / 2012-12-20 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// @see gtc_half_float (dependence) -/// @see gtc_constants (dependence) -/// -/// @defgroup gtc_quaternion GLM_GTC_quaternion -/// @ingroup gtc -/// -/// @brief Defines a templated quaternion type and several quaternion operations. -/// -/// <glm/gtc/quaternion.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependency: -#include "../mat3x3.hpp" -#include "../mat4x4.hpp" -#include "../vec3.hpp" -#include "../vec4.hpp" -#include "../gtc/constants.hpp" - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTC_quaternion extension included") -#endif - -namespace glm -{ - /// @addtogroup gtc_quaternion - /// @{ - - template <typename T, precision P> - struct tquat - { - typedef tquat<T, P> type; - typedef T value_type; - - public: - T x, y, z, w; - - ////////////////////////////////////// - // Component accesses - -# ifdef GLM_FORCE_SIZE_FUNC - typedef size_t size_type; - /// Return the count of components of a quaternion - GLM_FUNC_DECL GLM_CONSTEXPR size_type size() const; - - GLM_FUNC_DECL T & operator[](size_type i); - GLM_FUNC_DECL T const & operator[](size_type i) const; -# else - typedef length_t length_type; - /// Return the count of components of a quaternion - GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const; - - GLM_FUNC_DECL T & operator[](length_type i); - GLM_FUNC_DECL T const & operator[](length_type i) const; -# endif//GLM_FORCE_SIZE_FUNC - - ////////////////////////////////////// - // Implicit basic constructors - - GLM_FUNC_DECL tquat(); - GLM_FUNC_DECL tquat(tquat<T, P> const & q); - template <precision Q> - GLM_FUNC_DECL tquat(tquat<T, Q> const & q); - - ////////////////////////////////////// - // Explicit basic constructors - - GLM_FUNC_DECL explicit tquat(ctor); - GLM_FUNC_DECL explicit tquat(T const & s, tvec3<T, P> const & v); - GLM_FUNC_DECL tquat(T const & w, T const & x, T const & y, T const & z); - - ////////////////////////////////////// - // Convertions - -# ifdef GLM_FORCE_EXPLICIT_CTOR - template <typename U, precision Q> - GLM_FUNC_DECL explicit tquat(tquat<U, Q> const & q); -# else - template <typename U, precision Q> - GLM_FUNC_DECL tquat(tquat<U, Q> const & q); -# endif - - // explicit conversion operators -# if GLM_HAS_EXPLICIT_CONVERSION_OPERATORS - GLM_FUNC_DECL explicit operator tmat3x3<T, P>(); - GLM_FUNC_DECL explicit operator tmat4x4<T, P>(); -# endif - - /// Create a quaternion from two normalized axis - /// - /// @param u A first normalized axis - /// @param v A second normalized axis - /// @see gtc_quaternion - /// @see http://lolengine.net/blog/2013/09/18/beautiful-maths-quaternion-from-vectors - GLM_FUNC_DECL explicit tquat(tvec3<T, P> const & u, tvec3<T, P> const & v); - - /// Build a quaternion from euler angles (pitch, yaw, roll), in radians. - GLM_FUNC_DECL explicit tquat(tvec3<T, P> const & eulerAngles); - GLM_FUNC_DECL explicit tquat(tmat3x3<T, P> const & m); - GLM_FUNC_DECL explicit tquat(tmat4x4<T, P> const & m); - - ////////////////////////////////////// - // Operators - - GLM_FUNC_DECL tquat<T, P> & operator=(tquat<T, P> const & m); - - template <typename U> - GLM_FUNC_DECL tquat<T, P> & operator=(tquat<U, P> const & m); - template <typename U> - GLM_FUNC_DECL tquat<T, P> & operator+=(tquat<U, P> const & q); - template <typename U> - GLM_FUNC_DECL tquat<T, P> & operator*=(tquat<U, P> const & q); - template <typename U> - GLM_FUNC_DECL tquat<T, P> & operator*=(U s); - template <typename U> - GLM_FUNC_DECL tquat<T, P> & operator/=(U s); - }; - - template <typename T, precision P> - GLM_FUNC_DECL tquat<T, P> operator-(tquat<T, P> const & q); - - template <typename T, precision P> - GLM_FUNC_DECL tquat<T, P> operator+(tquat<T, P> const & q, tquat<T, P> const & p); - - template <typename T, precision P> - GLM_FUNC_DECL tquat<T, P> operator*(tquat<T, P> const & q, tquat<T, P> const & p); - - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> operator*(tquat<T, P> const & q, tvec3<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> operator*(tvec3<T, P> const & v, tquat<T, P> const & q); - - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> operator*(tquat<T, P> const & q, tvec4<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> operator*(tvec4<T, P> const & v, tquat<T, P> const & q); - - template <typename T, precision P> - GLM_FUNC_DECL tquat<T, P> operator*(tquat<T, P> const & q, T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tquat<T, P> operator*(T const & s, tquat<T, P> const & q); - - template <typename T, precision P> - GLM_FUNC_DECL tquat<T, P> operator/(tquat<T, P> const & q, T const & s); - - /// Returns the length of the quaternion. - /// - /// @see gtc_quaternion - template <typename T, precision P> - GLM_FUNC_DECL T length(tquat<T, P> const & q); - - /// Returns the normalized quaternion. - /// - /// @see gtc_quaternion - template <typename T, precision P> - GLM_FUNC_DECL tquat<T, P> normalize(tquat<T, P> const & q); - - /// Returns dot product of q1 and q2, i.e., q1[0] * q2[0] + q1[1] * q2[1] + ... - /// - /// @see gtc_quaternion - template <typename T, precision P, template <typename, precision> class quatType> - GLM_FUNC_DECL T dot(quatType<T, P> const & x, quatType<T, P> const & y); - - /// Spherical linear interpolation of two quaternions. - /// The interpolation is oriented and the rotation is performed at constant speed. - /// For short path spherical linear interpolation, use the slerp function. - /// - /// @param x A quaternion - /// @param y A quaternion - /// @param a Interpolation factor. The interpolation is defined beyond the range [0, 1]. - /// @tparam T Value type used to build the quaternion. Supported: half, float or double. - /// @see gtc_quaternion - /// @see - slerp(tquat<T, P> const & x, tquat<T, P> const & y, T const & a) - template <typename T, precision P> - GLM_FUNC_DECL tquat<T, P> mix(tquat<T, P> const & x, tquat<T, P> const & y, T a); - - /// Linear interpolation of two quaternions. - /// The interpolation is oriented. - /// - /// @param x A quaternion - /// @param y A quaternion - /// @param a Interpolation factor. The interpolation is defined in the range [0, 1]. - /// @tparam T Value type used to build the quaternion. Supported: half, float or double. - /// @see gtc_quaternion - template <typename T, precision P> - GLM_FUNC_DECL tquat<T, P> lerp(tquat<T, P> const & x, tquat<T, P> const & y, T a); - - /// Spherical linear interpolation of two quaternions. - /// The interpolation always take the short path and the rotation is performed at constant speed. - /// - /// @param x A quaternion - /// @param y A quaternion - /// @param a Interpolation factor. The interpolation is defined beyond the range [0, 1]. - /// @tparam T Value type used to build the quaternion. Supported: half, float or double. - /// @see gtc_quaternion - template <typename T, precision P> - GLM_FUNC_DECL tquat<T, P> slerp(tquat<T, P> const & x, tquat<T, P> const & y, T a); - - /// Returns the q conjugate. - /// - /// @see gtc_quaternion - template <typename T, precision P> - GLM_FUNC_DECL tquat<T, P> conjugate(tquat<T, P> const & q); - - /// Returns the q inverse. - /// - /// @see gtc_quaternion - template <typename T, precision P> - GLM_FUNC_DECL tquat<T, P> inverse(tquat<T, P> const & q); - - /// Rotates a quaternion from a vector of 3 components axis and an angle. - /// - /// @param q Source orientation - /// @param angle Angle expressed in radians. - /// @param axis Axis of the rotation - /// - /// @see gtc_quaternion - template <typename T, precision P> - GLM_FUNC_DECL tquat<T, P> rotate(tquat<T, P> const & q, T const & angle, tvec3<T, P> const & axis); - - /// Returns euler angles, yitch as x, yaw as y, roll as z. - /// The result is expressed in radians if GLM_FORCE_RADIANS is defined or degrees otherwise. - /// - /// @see gtc_quaternion - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> eulerAngles(tquat<T, P> const & x); - - /// Returns roll value of euler angles expressed in radians. - /// - /// @see gtx_quaternion - template <typename T, precision P> - GLM_FUNC_DECL T roll(tquat<T, P> const & x); - - /// Returns pitch value of euler angles expressed in radians. - /// - /// @see gtx_quaternion - template <typename T, precision P> - GLM_FUNC_DECL T pitch(tquat<T, P> const & x); - - /// Returns yaw value of euler angles expressed in radians. - /// - /// @see gtx_quaternion - template <typename T, precision P> - GLM_FUNC_DECL T yaw(tquat<T, P> const & x); - - /// Converts a quaternion to a 3 * 3 matrix. - /// - /// @see gtc_quaternion - template <typename T, precision P> - GLM_FUNC_DECL tmat3x3<T, P> mat3_cast(tquat<T, P> const & x); - - /// Converts a quaternion to a 4 * 4 matrix. - /// - /// @see gtc_quaternion - template <typename T, precision P> - GLM_FUNC_DECL tmat4x4<T, P> mat4_cast(tquat<T, P> const & x); - - /// Converts a 3 * 3 matrix to a quaternion. - /// - /// @see gtc_quaternion - template <typename T, precision P> - GLM_FUNC_DECL tquat<T, P> quat_cast(tmat3x3<T, P> const & x); - - /// Converts a 4 * 4 matrix to a quaternion. - /// - /// @see gtc_quaternion - template <typename T, precision P> - GLM_FUNC_DECL tquat<T, P> quat_cast(tmat4x4<T, P> const & x); - - /// Returns the quaternion rotation angle. - /// - /// @see gtc_quaternion - template <typename T, precision P> - GLM_FUNC_DECL T angle(tquat<T, P> const & x); - - /// Returns the q rotation axis. - /// - /// @see gtc_quaternion - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> axis(tquat<T, P> const & x); - - /// Build a quaternion from an angle and a normalized axis. - /// - /// @param angle Angle expressed in radians. - /// @param axis Axis of the quaternion, must be normalized. - /// - /// @see gtc_quaternion - template <typename T, precision P> - GLM_FUNC_DECL tquat<T, P> angleAxis(T const & angle, tvec3<T, P> const & axis); - - /// Returns the component-wise comparison result of x < y. - /// - /// @tparam quatType Floating-point quaternion types. - /// - /// @see gtc_quaternion - template <typename T, precision P> - GLM_FUNC_DECL tvec4<bool, P> lessThan(tquat<T, P> const & x, tquat<T, P> const & y); - - /// Returns the component-wise comparison of result x <= y. - /// - /// @tparam quatType Floating-point quaternion types. - /// - /// @see gtc_quaternion - template <typename T, precision P> - GLM_FUNC_DECL tvec4<bool, P> lessThanEqual(tquat<T, P> const & x, tquat<T, P> const & y); - - /// Returns the component-wise comparison of result x > y. - /// - /// @tparam quatType Floating-point quaternion types. - /// - /// @see gtc_quaternion - template <typename T, precision P> - GLM_FUNC_DECL tvec4<bool, P> greaterThan(tquat<T, P> const & x, tquat<T, P> const & y); - - /// Returns the component-wise comparison of result x >= y. - /// - /// @tparam quatType Floating-point quaternion types. - /// - /// @see gtc_quaternion - template <typename T, precision P> - GLM_FUNC_DECL tvec4<bool, P> greaterThanEqual(tquat<T, P> const & x, tquat<T, P> const & y); - - /// Returns the component-wise comparison of result x == y. - /// - /// @tparam quatType Floating-point quaternion types. - /// - /// @see gtc_quaternion - template <typename T, precision P> - GLM_FUNC_DECL tvec4<bool, P> equal(tquat<T, P> const & x, tquat<T, P> const & y); - - /// Returns the component-wise comparison of result x != y. - /// - /// @tparam quatType Floating-point quaternion types. - /// - /// @see gtc_quaternion - template <typename T, precision P> - GLM_FUNC_DECL tvec4<bool, P> notEqual(tquat<T, P> const & x, tquat<T, P> const & y); - /// @} -} //namespace glm - -#include "quaternion.inl" diff --git a/extensions/common/glm/gtc/quaternion.inl b/extensions/common/glm/gtc/quaternion.inl deleted file mode 100644 index 33ca82cc0d8..00000000000 --- a/extensions/common/glm/gtc/quaternion.inl +++ /dev/null @@ -1,784 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtc_quaternion -/// @file glm/gtc/quaternion.inl -/// @date 2009-05-21 / 2011-06-15 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#include "../trigonometric.hpp" -#include "../geometric.hpp" -#include "../exponential.hpp" -#include <limits> - -namespace glm{ -namespace detail -{ - template <typename T, precision P> - struct compute_dot<tquat, T, P> - { - static GLM_FUNC_QUALIFIER T call(tquat<T, P> const & x, tquat<T, P> const & y) - { - tvec4<T, P> tmp(x.x * y.x, x.y * y.y, x.z * y.z, x.w * y.w); - return (tmp.x + tmp.y) + (tmp.z + tmp.w); - } - }; -}//namespace detail - - ////////////////////////////////////// - // Component accesses - -# ifdef GLM_FORCE_SIZE_FUNC - template <typename T, precision P> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tquat<T, P>::size_type tquat<T, P>::size() const - { - return 4; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER T & tquat<T, P>::operator[](typename tquat<T, P>::size_type i) - { - assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this)); - return (&x)[i]; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER T const & tquat<T, P>::operator[](typename tquat<T, P>::size_type i) const - { - assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this)); - return (&x)[i]; - } -# else - template <typename T, precision P> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tquat<T, P>::length_type tquat<T, P>::length() const - { - return 4; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER T & tquat<T, P>::operator[](typename tquat<T, P>::length_type i) - { - assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this)); - return (&x)[i]; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER T const & tquat<T, P>::operator[](typename tquat<T, P>::length_type i) const - { - assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this)); - return (&x)[i]; - } -# endif//GLM_FORCE_SIZE_FUNC - - ////////////////////////////////////// - // Implicit basic constructors - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tquat<T, P>::tquat() -# ifndef GLM_FORCE_NO_CTOR_INIT - : x(0), y(0), z(0), w(1) -# endif - {} - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tquat<T, P>::tquat(tquat<T, P> const & q) - : x(q.x), y(q.y), z(q.z), w(q.w) - {} - - template <typename T, precision P> - template <precision Q> - GLM_FUNC_QUALIFIER tquat<T, P>::tquat(tquat<T, Q> const & q) - : x(q.x), y(q.y), z(q.z), w(q.w) - {} - - ////////////////////////////////////// - // Explicit basic constructors - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tquat<T, P>::tquat(ctor) - {} - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tquat<T, P>::tquat(T const & s, tvec3<T, P> const & v) - : x(v.x), y(v.y), z(v.z), w(s) - {} - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tquat<T, P>::tquat(T const & w, T const & x, T const & y, T const & z) - : x(x), y(y), z(z), w(w) - {} - - ////////////////////////////////////////////////////////////// - // Conversions - - template <typename T, precision P> - template <typename U, precision Q> - GLM_FUNC_QUALIFIER tquat<T, P>::tquat(tquat<U, Q> const & q) - : x(static_cast<T>(q.x)) - , y(static_cast<T>(q.y)) - , z(static_cast<T>(q.z)) - , w(static_cast<T>(q.w)) - {} - - //template <typename valType> - //GLM_FUNC_QUALIFIER tquat<valType>::tquat - //( - // valType const & pitch, - // valType const & yaw, - // valType const & roll - //) - //{ - // tvec3<valType> eulerAngle(pitch * valType(0.5), yaw * valType(0.5), roll * valType(0.5)); - // tvec3<valType> c = glm::cos(eulerAngle * valType(0.5)); - // tvec3<valType> s = glm::sin(eulerAngle * valType(0.5)); - // - // this->w = c.x * c.y * c.z + s.x * s.y * s.z; - // this->x = s.x * c.y * c.z - c.x * s.y * s.z; - // this->y = c.x * s.y * c.z + s.x * c.y * s.z; - // this->z = c.x * c.y * s.z - s.x * s.y * c.z; - //} - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tquat<T, P>::tquat(tvec3<T, P> const & u, tvec3<T, P> const & v) - { - tvec3<T, P> const LocalW(cross(u, v)); - T Dot = detail::compute_dot<tvec3, T, P>::call(u, v); - tquat<T, P> q(T(1) + Dot, LocalW.x, LocalW.y, LocalW.z); - - *this = normalize(q); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tquat<T, P>::tquat(tvec3<T, P> const & eulerAngle) - { - tvec3<T, P> c = glm::cos(eulerAngle * T(0.5)); - tvec3<T, P> s = glm::sin(eulerAngle * T(0.5)); - - this->w = c.x * c.y * c.z + s.x * s.y * s.z; - this->x = s.x * c.y * c.z - c.x * s.y * s.z; - this->y = c.x * s.y * c.z + s.x * c.y * s.z; - this->z = c.x * c.y * s.z - s.x * s.y * c.z; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tquat<T, P>::tquat(tmat3x3<T, P> const & m) - { - *this = quat_cast(m); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tquat<T, P>::tquat(tmat4x4<T, P> const & m) - { - *this = quat_cast(m); - } - -# if GLM_HAS_EXPLICIT_CONVERSION_OPERATORS - template <typename T, precision P> - GLM_FUNC_QUALIFIER tquat<T, P>::operator tmat3x3<T, P>() - { - return mat3_cast(*this); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tquat<T, P>::operator tmat4x4<T, P>() - { - return mat4_cast(*this); - } -# endif//GLM_HAS_EXPLICIT_CONVERSION_OPERATORS - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tquat<T, P> conjugate(tquat<T, P> const & q) - { - return tquat<T, P>(q.w, -q.x, -q.y, -q.z); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tquat<T, P> inverse(tquat<T, P> const & q) - { - return conjugate(q) / dot(q, q); - } - - ////////////////////////////////////////////////////////////// - // tquat<valType> operators - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator=(tquat<T, P> const & q) - { - this->w = q.w; - this->x = q.x; - this->y = q.y; - this->z = q.z; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator=(tquat<U, P> const & q) - { - this->w = static_cast<T>(q.w); - this->x = static_cast<T>(q.x); - this->y = static_cast<T>(q.y); - this->z = static_cast<T>(q.z); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator+=(tquat<U, P> const & q) - { - this->w += static_cast<T>(q.w); - this->x += static_cast<T>(q.x); - this->y += static_cast<T>(q.y); - this->z += static_cast<T>(q.z); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator*=(tquat<U, P> const & r) - { - tquat<T, P> const p(*this); - tquat<T, P> const q(r); - - this->w = p.w * q.w - p.x * q.x - p.y * q.y - p.z * q.z; - this->x = p.w * q.x + p.x * q.w + p.y * q.z - p.z * q.y; - this->y = p.w * q.y + p.y * q.w + p.z * q.x - p.x * q.z; - this->z = p.w * q.z + p.z * q.w + p.x * q.y - p.y * q.x; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator*=(U s) - { - this->w *= static_cast<U>(s); - this->x *= static_cast<U>(s); - this->y *= static_cast<U>(s); - this->z *= static_cast<U>(s); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator/=(U s) - { - this->w /= static_cast<U>(s); - this->x /= static_cast<U>(s); - this->y /= static_cast<U>(s); - this->z /= static_cast<U>(s); - return *this; - } - - ////////////////////////////////////////////////////////////// - // tquat<T, P> external operators - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tquat<T, P> operator-(tquat<T, P> const & q) - { - return tquat<T, P>(-q.w, -q.x, -q.y, -q.z); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tquat<T, P> operator+(tquat<T, P> const & q, tquat<T, P> const & p) - { - return tquat<T, P>(q) += p; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tquat<T, P> operator*(tquat<T, P> const & q, tquat<T, P> const & p) - { - return tquat<T, P>(q) *= p; - } - - // Transformation - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> operator*(tquat<T, P> const & q, tvec3<T, P> const & v) - { - tvec3<T, P> const QuatVector(q.x, q.y, q.z); - tvec3<T, P> const uv(glm::cross(QuatVector, v)); - tvec3<T, P> const uuv(glm::cross(QuatVector, uv)); - - return v + ((uv * q.w) + uuv) * static_cast<T>(2); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> operator*(tvec3<T, P> const & v, tquat<T, P> const & q) - { - return glm::inverse(q) * v; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> operator*(tquat<T, P> const & q, tvec4<T, P> const & v) - { - return tvec4<T, P>(q * tvec3<T, P>(v), v.w); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> operator*(tvec4<T, P> const & v, tquat<T, P> const & q) - { - return glm::inverse(q) * v; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tquat<T, P> operator*(tquat<T, P> const & q, T const & s) - { - return tquat<T, P>( - q.w * s, q.x * s, q.y * s, q.z * s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tquat<T, P> operator*(T const & s, tquat<T, P> const & q) - { - return q * s; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tquat<T, P> operator/(tquat<T, P> const & q, T const & s) - { - return tquat<T, P>( - q.w / s, q.x / s, q.y / s, q.z / s); - } - - ////////////////////////////////////// - // Boolean operators - - template <typename T, precision P> - GLM_FUNC_QUALIFIER bool operator==(tquat<T, P> const & q1, tquat<T, P> const & q2) - { - return (q1.x == q2.x) && (q1.y == q2.y) && (q1.z == q2.z) && (q1.w == q2.w); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER bool operator!=(tquat<T, P> const & q1, tquat<T, P> const & q2) - { - return (q1.x != q2.x) || (q1.y != q2.y) || (q1.z != q2.z) || (q1.w != q2.w); - } - - //////////////////////////////////////////////////////// - template <typename T, precision P> - GLM_FUNC_QUALIFIER T length(tquat<T, P> const & q) - { - return glm::sqrt(dot(q, q)); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tquat<T, P> normalize(tquat<T, P> const & q) - { - T len = length(q); - if(len <= T(0)) // Problem - return tquat<T, P>(1, 0, 0, 0); - T oneOverLen = T(1) / len; - return tquat<T, P>(q.w * oneOverLen, q.x * oneOverLen, q.y * oneOverLen, q.z * oneOverLen); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tquat<T, P> cross(tquat<T, P> const & q1, tquat<T, P> const & q2) - { - return tquat<T, P>( - q1.w * q2.w - q1.x * q2.x - q1.y * q2.y - q1.z * q2.z, - q1.w * q2.x + q1.x * q2.w + q1.y * q2.z - q1.z * q2.y, - q1.w * q2.y + q1.y * q2.w + q1.z * q2.x - q1.x * q2.z, - q1.w * q2.z + q1.z * q2.w + q1.x * q2.y - q1.y * q2.x); - } -/* - // (x * sin(1 - a) * angle / sin(angle)) + (y * sin(a) * angle / sin(angle)) - template <typename T, precision P> - GLM_FUNC_QUALIFIER tquat<T, P> mix(tquat<T, P> const & x, tquat<T, P> const & y, T const & a) - { - if(a <= T(0)) return x; - if(a >= T(1)) return y; - - float fCos = dot(x, y); - tquat<T, P> y2(y); //BUG!!! tquat<T, P> y2; - if(fCos < T(0)) - { - y2 = -y; - fCos = -fCos; - } - - //if(fCos > 1.0f) // problem - float k0, k1; - if(fCos > T(0.9999)) - { - k0 = T(1) - a; - k1 = T(0) + a; //BUG!!! 1.0f + a; - } - else - { - T fSin = sqrt(T(1) - fCos * fCos); - T fAngle = atan(fSin, fCos); - T fOneOverSin = static_cast<T>(1) / fSin; - k0 = sin((T(1) - a) * fAngle) * fOneOverSin; - k1 = sin((T(0) + a) * fAngle) * fOneOverSin; - } - - return tquat<T, P>( - k0 * x.w + k1 * y2.w, - k0 * x.x + k1 * y2.x, - k0 * x.y + k1 * y2.y, - k0 * x.z + k1 * y2.z); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tquat<T, P> mix2 - ( - tquat<T, P> const & x, - tquat<T, P> const & y, - T const & a - ) - { - bool flip = false; - if(a <= static_cast<T>(0)) return x; - if(a >= static_cast<T>(1)) return y; - - T cos_t = dot(x, y); - if(cos_t < T(0)) - { - cos_t = -cos_t; - flip = true; - } - - T alpha(0), beta(0); - - if(T(1) - cos_t < 1e-7) - beta = static_cast<T>(1) - alpha; - else - { - T theta = acos(cos_t); - T sin_t = sin(theta); - beta = sin(theta * (T(1) - alpha)) / sin_t; - alpha = sin(alpha * theta) / sin_t; - } - - if(flip) - alpha = -alpha; - - return normalize(beta * x + alpha * y); - } -*/ - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tquat<T, P> mix(tquat<T, P> const & x, tquat<T, P> const & y, T a) - { - T cosTheta = dot(x, y); - - // Perform a linear interpolation when cosTheta is close to 1 to avoid side effect of sin(angle) becoming a zero denominator - if(cosTheta > T(1) - epsilon<T>()) - { - // Linear interpolation - return tquat<T, P>( - mix(x.w, y.w, a), - mix(x.x, y.x, a), - mix(x.y, y.y, a), - mix(x.z, y.z, a)); - } - else - { - // Essential Mathematics, page 467 - T angle = acos(cosTheta); - return (sin((T(1) - a) * angle) * x + sin(a * angle) * y) / sin(angle); - } - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tquat<T, P> lerp(tquat<T, P> const & x, tquat<T, P> const & y, T a) - { - // Lerp is only defined in [0, 1] - assert(a >= static_cast<T>(0)); - assert(a <= static_cast<T>(1)); - - return x * (T(1) - a) + (y * a); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tquat<T, P> slerp(tquat<T, P> const & x, tquat<T, P> const & y, T a) - { - tquat<T, P> z = y; - - T cosTheta = dot(x, y); - - // If cosTheta < 0, the interpolation will take the long way around the sphere. - // To fix this, one quat must be negated. - if (cosTheta < T(0)) - { - z = -y; - cosTheta = -cosTheta; - } - - // Perform a linear interpolation when cosTheta is close to 1 to avoid side effect of sin(angle) becoming a zero denominator - if(cosTheta > T(1) - epsilon<T>()) - { - // Linear interpolation - return tquat<T, P>( - mix(x.w, z.w, a), - mix(x.x, z.x, a), - mix(x.y, z.y, a), - mix(x.z, z.z, a)); - } - else - { - // Essential Mathematics, page 467 - T angle = acos(cosTheta); - return (sin((T(1) - a) * angle) * x + sin(a * angle) * z) / sin(angle); - } - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tquat<T, P> rotate(tquat<T, P> const & q, T const & angle, tvec3<T, P> const & v) - { - tvec3<T, P> Tmp = v; - - // Axis of rotation must be normalised - T len = glm::length(Tmp); - if(abs(len - T(1)) > T(0.001)) - { - T oneOverLen = static_cast<T>(1) / len; - Tmp.x *= oneOverLen; - Tmp.y *= oneOverLen; - Tmp.z *= oneOverLen; - } - - T const AngleRad(angle); - T const Sin = sin(AngleRad * T(0.5)); - - return q * tquat<T, P>(cos(AngleRad * T(0.5)), Tmp.x * Sin, Tmp.y * Sin, Tmp.z * Sin); - //return gtc::quaternion::cross(q, tquat<T, P>(cos(AngleRad * T(0.5)), Tmp.x * fSin, Tmp.y * fSin, Tmp.z * fSin)); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> eulerAngles(tquat<T, P> const & x) - { - return tvec3<T, P>(pitch(x), yaw(x), roll(x)); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER T roll(tquat<T, P> const & q) - { - return T(atan(T(2) * (q.x * q.y + q.w * q.z), q.w * q.w + q.x * q.x - q.y * q.y - q.z * q.z)); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER T pitch(tquat<T, P> const & q) - { - return T(atan(T(2) * (q.y * q.z + q.w * q.x), q.w * q.w - q.x * q.x - q.y * q.y + q.z * q.z)); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER T yaw(tquat<T, P> const & q) - { - return asin(T(-2) * (q.x * q.z - q.w * q.y)); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x3<T, P> mat3_cast(tquat<T, P> const & q) - { - tmat3x3<T, P> Result(T(1)); - T qxx(q.x * q.x); - T qyy(q.y * q.y); - T qzz(q.z * q.z); - T qxz(q.x * q.z); - T qxy(q.x * q.y); - T qyz(q.y * q.z); - T qwx(q.w * q.x); - T qwy(q.w * q.y); - T qwz(q.w * q.z); - - Result[0][0] = 1 - 2 * (qyy + qzz); - Result[0][1] = 2 * (qxy + qwz); - Result[0][2] = 2 * (qxz - qwy); - - Result[1][0] = 2 * (qxy - qwz); - Result[1][1] = 1 - 2 * (qxx + qzz); - Result[1][2] = 2 * (qyz + qwx); - - Result[2][0] = 2 * (qxz + qwy); - Result[2][1] = 2 * (qyz - qwx); - Result[2][2] = 1 - 2 * (qxx + qyy); - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P> mat4_cast(tquat<T, P> const & q) - { - return tmat4x4<T, P>(mat3_cast(q)); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tquat<T, P> quat_cast(tmat3x3<T, P> const & m) - { - T fourXSquaredMinus1 = m[0][0] - m[1][1] - m[2][2]; - T fourYSquaredMinus1 = m[1][1] - m[0][0] - m[2][2]; - T fourZSquaredMinus1 = m[2][2] - m[0][0] - m[1][1]; - T fourWSquaredMinus1 = m[0][0] + m[1][1] + m[2][2]; - - int biggestIndex = 0; - T fourBiggestSquaredMinus1 = fourWSquaredMinus1; - if(fourXSquaredMinus1 > fourBiggestSquaredMinus1) - { - fourBiggestSquaredMinus1 = fourXSquaredMinus1; - biggestIndex = 1; - } - if(fourYSquaredMinus1 > fourBiggestSquaredMinus1) - { - fourBiggestSquaredMinus1 = fourYSquaredMinus1; - biggestIndex = 2; - } - if(fourZSquaredMinus1 > fourBiggestSquaredMinus1) - { - fourBiggestSquaredMinus1 = fourZSquaredMinus1; - biggestIndex = 3; - } - - T biggestVal = sqrt(fourBiggestSquaredMinus1 + T(1)) * T(0.5); - T mult = static_cast<T>(0.25) / biggestVal; - - tquat<T, P> Result(uninitialize); - switch(biggestIndex) - { - case 0: - Result.w = biggestVal; - Result.x = (m[1][2] - m[2][1]) * mult; - Result.y = (m[2][0] - m[0][2]) * mult; - Result.z = (m[0][1] - m[1][0]) * mult; - break; - case 1: - Result.w = (m[1][2] - m[2][1]) * mult; - Result.x = biggestVal; - Result.y = (m[0][1] + m[1][0]) * mult; - Result.z = (m[2][0] + m[0][2]) * mult; - break; - case 2: - Result.w = (m[2][0] - m[0][2]) * mult; - Result.x = (m[0][1] + m[1][0]) * mult; - Result.y = biggestVal; - Result.z = (m[1][2] + m[2][1]) * mult; - break; - case 3: - Result.w = (m[0][1] - m[1][0]) * mult; - Result.x = (m[2][0] + m[0][2]) * mult; - Result.y = (m[1][2] + m[2][1]) * mult; - Result.z = biggestVal; - break; - - default: // Silence a -Wswitch-default warning in GCC. Should never actually get here. Assert is just for sanity. - assert(false); - break; - } - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tquat<T, P> quat_cast(tmat4x4<T, P> const & m4) - { - return quat_cast(tmat3x3<T, P>(m4)); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER T angle(tquat<T, P> const & x) - { - return acos(x.w) * T(2); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> axis(tquat<T, P> const & x) - { - T tmp1 = static_cast<T>(1) - x.w * x.w; - if(tmp1 <= static_cast<T>(0)) - return tvec3<T, P>(0, 0, 1); - T tmp2 = static_cast<T>(1) / sqrt(tmp1); - return tvec3<T, P>(x.x * tmp2, x.y * tmp2, x.z * tmp2); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tquat<T, P> angleAxis(T const & angle, tvec3<T, P> const & v) - { - tquat<T, P> Result(uninitialize); - - T const a(angle); - T const s = glm::sin(a * static_cast<T>(0.5)); - - Result.w = glm::cos(a * static_cast<T>(0.5)); - Result.x = v.x * s; - Result.y = v.y * s; - Result.z = v.z * s; - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<bool, P> lessThan(tquat<T, P> const & x, tquat<T, P> const & y) - { - tvec4<bool, P> Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(x); ++i) - Result[i] = x[i] < y[i]; - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<bool, P> lessThanEqual(tquat<T, P> const & x, tquat<T, P> const & y) - { - tvec4<bool, P> Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(x); ++i) - Result[i] = x[i] <= y[i]; - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<bool, P> greaterThan(tquat<T, P> const & x, tquat<T, P> const & y) - { - tvec4<bool, P> Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(x); ++i) - Result[i] = x[i] > y[i]; - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<bool, P> greaterThanEqual(tquat<T, P> const & x, tquat<T, P> const & y) - { - tvec4<bool, P> Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(x); ++i) - Result[i] = x[i] >= y[i]; - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<bool, P> equal(tquat<T, P> const & x, tquat<T, P> const & y) - { - tvec4<bool, P> Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(x); ++i) - Result[i] = x[i] == y[i]; - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<bool, P> notEqual(tquat<T, P> const & x, tquat<T, P> const & y) - { - tvec4<bool, P> Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(x); ++i) - Result[i] = x[i] != y[i]; - return Result; - } -}//namespace glm diff --git a/extensions/common/glm/gtc/random.hpp b/extensions/common/glm/gtc/random.hpp deleted file mode 100644 index ae75cc1e266..00000000000 --- a/extensions/common/glm/gtc/random.hpp +++ /dev/null @@ -1,120 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtc_random -/// @file glm/gtc/random.hpp -/// @date 2011-09-18 / 2011-09-18 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// @see gtc_half_float (dependence) -/// @see gtx_random (extended) -/// -/// @defgroup gtc_random GLM_GTC_random -/// @ingroup gtc -/// -/// @brief Generate random number from various distribution methods. -/// -/// <glm/gtc/random.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependency: -#include "../vec2.hpp" -#include "../vec3.hpp" - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTC_random extension included") -#endif - -namespace glm -{ - /// @addtogroup gtc_random - /// @{ - - /// Generate random numbers in the interval [Min, Max], according a linear distribution - /// - /// @param Min - /// @param Max - /// @tparam genType Value type. Currently supported: half (not recommanded), float or double scalars and vectors. - /// @see gtc_random - template <typename genTYpe> - GLM_FUNC_DECL genTYpe linearRand( - genTYpe Min, - genTYpe Max); - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> linearRand( - vecType<T, P> const & Min, - vecType<T, P> const & Max); - - /// Generate random numbers in the interval [Min, Max], according a gaussian distribution - /// - /// @param Mean - /// @param Deviation - /// @see gtc_random - template <typename genType> - GLM_FUNC_DECL genType gaussRand( - genType Mean, - genType Deviation); - - /// Generate a random 2D vector which coordinates are regulary distributed on a circle of a given radius - /// - /// @param Radius - /// @see gtc_random - template <typename T> - GLM_FUNC_DECL tvec2<T, defaultp> circularRand( - T Radius); - - /// Generate a random 3D vector which coordinates are regulary distributed on a sphere of a given radius - /// - /// @param Radius - /// @see gtc_random - template <typename T> - GLM_FUNC_DECL tvec3<T, defaultp> sphericalRand( - T Radius); - - /// Generate a random 2D vector which coordinates are regulary distributed within the area of a disk of a given radius - /// - /// @param Radius - /// @see gtc_random - template <typename T> - GLM_FUNC_DECL tvec2<T, defaultp> diskRand( - T Radius); - - /// Generate a random 3D vector which coordinates are regulary distributed within the volume of a ball of a given radius - /// - /// @param Radius - /// @see gtc_random - template <typename T> - GLM_FUNC_DECL tvec3<T, defaultp> ballRand( - T Radius); - - /// @} -}//namespace glm - -#include "random.inl" diff --git a/extensions/common/glm/gtc/random.inl b/extensions/common/glm/gtc/random.inl deleted file mode 100644 index e21b19531ca..00000000000 --- a/extensions/common/glm/gtc/random.inl +++ /dev/null @@ -1,379 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtc_random -/// @file glm/gtc/random.inl -/// @date 2011-09-19 / 2012-04-07 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#include "../geometric.hpp" -#include "../exponential.hpp" -#include <cstdlib> -#include <ctime> -#include <cassert> - -namespace glm{ -namespace detail -{ - template <typename T, precision P, template <class, precision> class vecType> - struct compute_rand - { - GLM_FUNC_QUALIFIER static vecType<T, P> call(); - }; - - template <precision P> - struct compute_rand<uint8, P, tvec1> - { - GLM_FUNC_QUALIFIER static tvec1<uint8, P> call() - { - return tvec1<uint8, P>( - std::rand()) % std::numeric_limits<uint8>::max(); - } - }; - - template <precision P> - struct compute_rand<uint8, P, tvec2> - { - GLM_FUNC_QUALIFIER static tvec2<uint8, P> call() - { - return tvec2<uint8, P>( - std::rand(), - std::rand()) % std::numeric_limits<uint8>::max(); - } - }; - - template <precision P> - struct compute_rand<uint8, P, tvec3> - { - GLM_FUNC_QUALIFIER static tvec3<uint8, P> call() - { - return tvec3<uint8, P>( - std::rand(), - std::rand(), - std::rand()) % std::numeric_limits<uint8>::max(); - } - }; - - template <precision P> - struct compute_rand<uint8, P, tvec4> - { - GLM_FUNC_QUALIFIER static tvec4<uint8, P> call() - { - return tvec4<uint8, P>( - std::rand(), - std::rand(), - std::rand(), - std::rand()) % std::numeric_limits<uint8>::max(); - } - }; - - template <precision P, template <class, precision> class vecType> - struct compute_rand<uint16, P, vecType> - { - GLM_FUNC_QUALIFIER static vecType<uint16, P> call() - { - return - (vecType<uint16, P>(compute_rand<uint8, P, vecType>::call()) << static_cast<uint16>(8)) | - (vecType<uint16, P>(compute_rand<uint8, P, vecType>::call()) << static_cast<uint16>(0)); - } - }; - - template <precision P, template <class, precision> class vecType> - struct compute_rand<uint32, P, vecType> - { - GLM_FUNC_QUALIFIER static vecType<uint32, P> call() - { - return - (vecType<uint32, P>(compute_rand<uint16, P, vecType>::call()) << static_cast<uint32>(16)) | - (vecType<uint32, P>(compute_rand<uint16, P, vecType>::call()) << static_cast<uint32>(0)); - } - }; - - template <precision P, template <class, precision> class vecType> - struct compute_rand<uint64, P, vecType> - { - GLM_FUNC_QUALIFIER static vecType<uint64, P> call() - { - return - (vecType<uint64, P>(compute_rand<uint32, P, vecType>::call()) << static_cast<uint64>(32)) | - (vecType<uint64, P>(compute_rand<uint32, P, vecType>::call()) << static_cast<uint64>(0)); - } - }; - - template <typename T, precision P, template <class, precision> class vecType> - struct compute_linearRand - { - GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & Min, vecType<T, P> const & Max); - }; - - template <precision P, template <class, precision> class vecType> - struct compute_linearRand<int8, P, vecType> - { - GLM_FUNC_QUALIFIER static vecType<int8, P> call(vecType<int8, P> const & Min, vecType<int8, P> const & Max) - { - return (vecType<int8, P>(compute_rand<uint8, P, vecType>::call() % vecType<uint8, P>(Max + static_cast<int8>(1) - Min))) + Min; - } - }; - - template <precision P, template <class, precision> class vecType> - struct compute_linearRand<uint8, P, vecType> - { - GLM_FUNC_QUALIFIER static vecType<uint8, P> call(vecType<uint8, P> const & Min, vecType<uint8, P> const & Max) - { - return (compute_rand<uint8, P, vecType>::call() % (Max + static_cast<uint8>(1) - Min)) + Min; - } - }; - - template <precision P, template <class, precision> class vecType> - struct compute_linearRand<int16, P, vecType> - { - GLM_FUNC_QUALIFIER static vecType<int16, P> call(vecType<int16, P> const & Min, vecType<int16, P> const & Max) - { - return (vecType<int16, P>(compute_rand<uint16, P, vecType>::call() % vecType<uint16, P>(Max + static_cast<int16>(1) - Min))) + Min; - } - }; - - template <precision P, template <class, precision> class vecType> - struct compute_linearRand<uint16, P, vecType> - { - GLM_FUNC_QUALIFIER static vecType<uint16, P> call(vecType<uint16, P> const & Min, vecType<uint16, P> const & Max) - { - return (compute_rand<uint16, P, vecType>::call() % (Max + static_cast<uint16>(1) - Min)) + Min; - } - }; - - template <precision P, template <class, precision> class vecType> - struct compute_linearRand<int32, P, vecType> - { - GLM_FUNC_QUALIFIER static vecType<int32, P> call(vecType<int32, P> const & Min, vecType<int32, P> const & Max) - { - return (vecType<int32, P>(compute_rand<uint32, P, vecType>::call() % vecType<uint32, P>(Max + static_cast<int32>(1) - Min))) + Min; - } - }; - - template <precision P, template <class, precision> class vecType> - struct compute_linearRand<uint32, P, vecType> - { - GLM_FUNC_QUALIFIER static vecType<uint32, P> call(vecType<uint32, P> const & Min, vecType<uint32, P> const & Max) - { - return (compute_rand<uint32, P, vecType>::call() % (Max + static_cast<uint32>(1) - Min)) + Min; - } - }; - - template <precision P, template <class, precision> class vecType> - struct compute_linearRand<int64, P, vecType> - { - GLM_FUNC_QUALIFIER static vecType<int64, P> call(vecType<int64, P> const & Min, vecType<int64, P> const & Max) - { - return (vecType<int64, P>(compute_rand<uint64, P, vecType>::call() % vecType<uint64, P>(Max + static_cast<int64>(1) - Min))) + Min; - } - }; - - template <precision P, template <class, precision> class vecType> - struct compute_linearRand<uint64, P, vecType> - { - GLM_FUNC_QUALIFIER static vecType<uint64, P> call(vecType<uint64, P> const & Min, vecType<uint64, P> const & Max) - { - return (compute_rand<uint64, P, vecType>::call() % (Max + static_cast<uint64>(1) - Min)) + Min; - } - }; - - template <template <class, precision> class vecType> - struct compute_linearRand<float, lowp, vecType> - { - GLM_FUNC_QUALIFIER static vecType<float, lowp> call(vecType<float, lowp> const & Min, vecType<float, lowp> const & Max) - { - return vecType<float, lowp>(compute_rand<uint8, lowp, vecType>::call()) / static_cast<float>(std::numeric_limits<uint8>::max()) * (Max - Min) + Min; - } - }; - - template <template <class, precision> class vecType> - struct compute_linearRand<float, mediump, vecType> - { - GLM_FUNC_QUALIFIER static vecType<float, mediump> call(vecType<float, mediump> const & Min, vecType<float, mediump> const & Max) - { - return vecType<float, mediump>(compute_rand<uint16, mediump, vecType>::call()) / static_cast<float>(std::numeric_limits<uint16>::max()) * (Max - Min) + Min; - } - }; - - template <template <class, precision> class vecType> - struct compute_linearRand<float, highp, vecType> - { - GLM_FUNC_QUALIFIER static vecType<float, highp> call(vecType<float, highp> const & Min, vecType<float, highp> const & Max) - { - return vecType<float, highp>(compute_rand<uint32, highp, vecType>::call()) / static_cast<float>(std::numeric_limits<uint32>::max()) * (Max - Min) + Min; - } - }; - - template <template <class, precision> class vecType> - struct compute_linearRand<double, lowp, vecType> - { - GLM_FUNC_QUALIFIER static vecType<double, lowp> call(vecType<double, lowp> const & Min, vecType<double, lowp> const & Max) - { - return vecType<double, lowp>(compute_rand<uint16, lowp, vecType>::call()) / static_cast<double>(std::numeric_limits<uint16>::max()) * (Max - Min) + Min; - } - }; - - template <template <class, precision> class vecType> - struct compute_linearRand<double, mediump, vecType> - { - GLM_FUNC_QUALIFIER static vecType<double, mediump> call(vecType<double, mediump> const & Min, vecType<double, mediump> const & Max) - { - return vecType<double, mediump>(compute_rand<uint32, mediump, vecType>::call()) / static_cast<double>(std::numeric_limits<uint32>::max()) * (Max - Min) + Min; - } - }; - - template <template <class, precision> class vecType> - struct compute_linearRand<double, highp, vecType> - { - GLM_FUNC_QUALIFIER static vecType<double, highp> call(vecType<double, highp> const & Min, vecType<double, highp> const & Max) - { - return vecType<double, highp>(compute_rand<uint64, highp, vecType>::call()) / static_cast<double>(std::numeric_limits<uint64>::max()) * (Max - Min) + Min; - } - }; - - template <template <class, precision> class vecType> - struct compute_linearRand<long double, lowp, vecType> - { - GLM_FUNC_QUALIFIER static vecType<long double, lowp> call(vecType<long double, lowp> const & Min, vecType<long double, lowp> const & Max) - { - return vecType<long double, lowp>(compute_rand<uint32, lowp, vecType>::call()) / static_cast<long double>(std::numeric_limits<uint32>::max()) * (Max - Min) + Min; - } - }; - - template <template <class, precision> class vecType> - struct compute_linearRand<long double, mediump, vecType> - { - GLM_FUNC_QUALIFIER static vecType<long double, mediump> call(vecType<long double, mediump> const & Min, vecType<long double, mediump> const & Max) - { - return vecType<long double, mediump>(compute_rand<uint64, mediump, vecType>::call()) / static_cast<long double>(std::numeric_limits<uint64>::max()) * (Max - Min) + Min; - } - }; - - template <template <class, precision> class vecType> - struct compute_linearRand<long double, highp, vecType> - { - GLM_FUNC_QUALIFIER static vecType<long double, highp> call(vecType<long double, highp> const & Min, vecType<long double, highp> const & Max) - { - return vecType<long double, highp>(compute_rand<uint64, highp, vecType>::call()) / static_cast<long double>(std::numeric_limits<uint64>::max()) * (Max - Min) + Min; - } - }; -}//namespace detail - - template <typename genType> - GLM_FUNC_QUALIFIER genType linearRand(genType Min, genType Max) - { - return detail::compute_linearRand<genType, highp, tvec1>::call( - tvec1<genType, highp>(Min), - tvec1<genType, highp>(Max)).x; - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> linearRand(vecType<T, P> const & Min, vecType<T, P> const & Max) - { - return detail::compute_linearRand<T, P, vecType>::call(Min, Max); - } - - template <typename genType> - GLM_FUNC_QUALIFIER genType gaussRand(genType Mean, genType Deviation) - { - genType w, x1, x2; - - do - { - x1 = linearRand(genType(-1), genType(1)); - x2 = linearRand(genType(-1), genType(1)); - - w = x1 * x1 + x2 * x2; - } while(w > genType(1)); - - return x2 * Deviation * Deviation * sqrt((genType(-2) * log(w)) / w) + Mean; - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> gaussRand(vecType<T, P> const & Mean, vecType<T, P> const & Deviation) - { - return detail::functor2<T, P, vecType>::call(gaussRand, Mean, Deviation); - } - - template <typename T> - GLM_FUNC_QUALIFIER tvec2<T, defaultp> diskRand(T Radius) - { - tvec2<T, defaultp> Result(T(0)); - T LenRadius(T(0)); - - do - { - Result = linearRand( - tvec2<T, defaultp>(-Radius), - tvec2<T, defaultp>(Radius)); - LenRadius = length(Result); - } - while(LenRadius > Radius); - - return Result; - } - - template <typename T> - GLM_FUNC_QUALIFIER tvec3<T, defaultp> ballRand(T Radius) - { - tvec3<T, defaultp> Result(T(0)); - T LenRadius(T(0)); - - do - { - Result = linearRand( - tvec3<T, defaultp>(-Radius), - tvec3<T, defaultp>(Radius)); - LenRadius = length(Result); - } - while(LenRadius > Radius); - - return Result; - } - - template <typename T> - GLM_FUNC_QUALIFIER tvec2<T, defaultp> circularRand(T Radius) - { - T a = linearRand(T(0), T(6.283185307179586476925286766559f)); - return tvec2<T, defaultp>(cos(a), sin(a)) * Radius; - } - - template <typename T> - GLM_FUNC_QUALIFIER tvec3<T, defaultp> sphericalRand(T Radius) - { - T z = linearRand(T(-1), T(1)); - T a = linearRand(T(0), T(6.283185307179586476925286766559f)); - - T r = sqrt(T(1) - z * z); - - T x = r * cos(a); - T y = r * sin(a); - - return tvec3<T, defaultp>(x, y, z) * Radius; - } -}//namespace glm diff --git a/extensions/common/glm/gtc/reciprocal.hpp b/extensions/common/glm/gtc/reciprocal.hpp deleted file mode 100644 index 73a950d34f5..00000000000 --- a/extensions/common/glm/gtc/reciprocal.hpp +++ /dev/null @@ -1,134 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtc_reciprocal -/// @file glm/gtc/reciprocal.hpp -/// @date 2008-10-09 / 2012-01-25 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// -/// @defgroup gtc_reciprocal GLM_GTC_reciprocal -/// @ingroup gtc -/// -/// @brief Define secant, cosecant and cotangent functions. -/// -/// <glm/gtc/reciprocal.hpp> need to be included to use these features. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependencies -#include "../detail/setup.hpp" - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTC_reciprocal extension included") -#endif - -namespace glm -{ - /// @addtogroup gtc_reciprocal - /// @{ - - /// Secant function. - /// hypotenuse / adjacent or 1 / cos(x) - /// - /// @see gtc_reciprocal - template <typename genType> - GLM_FUNC_DECL genType sec(genType const & angle); - - /// Cosecant function. - /// hypotenuse / opposite or 1 / sin(x) - /// - /// @see gtc_reciprocal - template <typename genType> - GLM_FUNC_DECL genType csc(genType const & angle); - - /// Cotangent function. - /// adjacent / opposite or 1 / tan(x) - /// - /// @see gtc_reciprocal - template <typename genType> - GLM_FUNC_DECL genType cot(genType const & angle); - - /// Inverse secant function. - /// - /// @see gtc_reciprocal - template <typename genType> - GLM_FUNC_DECL genType asec(genType const & x); - - /// Inverse cosecant function. - /// - /// @see gtc_reciprocal - template <typename genType> - GLM_FUNC_DECL genType acsc(genType const & x); - - /// Inverse cotangent function. - /// - /// @see gtc_reciprocal - template <typename genType> - GLM_FUNC_DECL genType acot(genType const & x); - - /// Secant hyperbolic function. - /// - /// @see gtc_reciprocal - template <typename genType> - GLM_FUNC_DECL genType sech(genType const & angle); - - /// Cosecant hyperbolic function. - /// - /// @see gtc_reciprocal - template <typename genType> - GLM_FUNC_DECL genType csch(genType const & angle); - - /// Cotangent hyperbolic function. - /// - /// @see gtc_reciprocal - template <typename genType> - GLM_FUNC_DECL genType coth(genType const & angle); - - /// Inverse secant hyperbolic function. - /// - /// @see gtc_reciprocal - template <typename genType> - GLM_FUNC_DECL genType asech(genType const & x); - - /// Inverse cosecant hyperbolic function. - /// - /// @see gtc_reciprocal - template <typename genType> - GLM_FUNC_DECL genType acsch(genType const & x); - - /// Inverse cotangent hyperbolic function. - /// - /// @see gtc_reciprocal - template <typename genType> - GLM_FUNC_DECL genType acoth(genType const & x); - - /// @} -}//namespace glm - -#include "reciprocal.inl" diff --git a/extensions/common/glm/gtc/reciprocal.inl b/extensions/common/glm/gtc/reciprocal.inl deleted file mode 100644 index b86c347b7f0..00000000000 --- a/extensions/common/glm/gtc/reciprocal.inl +++ /dev/null @@ -1,221 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtc_reciprocal -/// @file glm/gtc/reciprocal.inl -/// @date 2008-10-09 / 2012-04-07 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#include "../trigonometric.hpp" -#include <limits> - -namespace glm -{ - // sec - template <typename genType> - GLM_FUNC_QUALIFIER genType sec(genType angle) - { - GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'sec' only accept floating-point values"); - return genType(1) / glm::cos(angle); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> sec(vecType<T, P> const & x) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'sec' only accept floating-point inputs"); - return detail::functor1<T, T, P, vecType>::call(sec, x); - } - - // csc - template <typename genType> - GLM_FUNC_QUALIFIER genType csc(genType angle) - { - GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'csc' only accept floating-point values"); - return genType(1) / glm::sin(angle); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> csc(vecType<T, P> const & x) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'csc' only accept floating-point inputs"); - return detail::functor1<T, T, P, vecType>::call(csc, x); - } - - // cot - template <typename genType> - GLM_FUNC_QUALIFIER genType cot(genType angle) - { - GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'cot' only accept floating-point values"); - - genType const pi_over_2 = genType(3.1415926535897932384626433832795 / 2.0); - return glm::tan(pi_over_2 - angle); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> cot(vecType<T, P> const & x) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'cot' only accept floating-point inputs"); - return detail::functor1<T, T, P, vecType>::call(cot, x); - } - - // asec - template <typename genType> - GLM_FUNC_QUALIFIER genType asec(genType x) - { - GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'asec' only accept floating-point values"); - return acos(genType(1) / x); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> asec(vecType<T, P> const & x) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'asec' only accept floating-point inputs"); - return detail::functor1<T, T, P, vecType>::call(asec, x); - } - - // acsc - template <typename genType> - GLM_FUNC_QUALIFIER genType acsc(genType x) - { - GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'acsc' only accept floating-point values"); - return asin(genType(1) / x); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> acsc(vecType<T, P> const & x) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'acsc' only accept floating-point inputs"); - return detail::functor1<T, T, P, vecType>::call(acsc, x); - } - - // acot - template <typename genType> - GLM_FUNC_QUALIFIER genType acot(genType x) - { - GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'acot' only accept floating-point values"); - - genType const pi_over_2 = genType(3.1415926535897932384626433832795 / 2.0); - return pi_over_2 - atan(x); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> acot(vecType<T, P> const & x) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'acot' only accept floating-point inputs"); - return detail::functor1<T, T, P, vecType>::call(acot, x); - } - - // sech - template <typename genType> - GLM_FUNC_QUALIFIER genType sech(genType angle) - { - GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'sech' only accept floating-point values"); - return genType(1) / glm::cosh(angle); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> sech(vecType<T, P> const & x) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'sech' only accept floating-point inputs"); - return detail::functor1<T, T, P, vecType>::call(sech, x); - } - - // csch - template <typename genType> - GLM_FUNC_QUALIFIER genType csch(genType angle) - { - GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'csch' only accept floating-point values"); - return genType(1) / glm::sinh(angle); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> csch(vecType<T, P> const & x) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'csch' only accept floating-point inputs"); - return detail::functor1<T, T, P, vecType>::call(csch, x); - } - - // coth - template <typename genType> - GLM_FUNC_QUALIFIER genType coth(genType angle) - { - GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'coth' only accept floating-point values"); - return glm::cosh(angle) / glm::sinh(angle); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> coth(vecType<T, P> const & x) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'coth' only accept floating-point inputs"); - return detail::functor1<T, T, P, vecType>::call(coth, x); - } - - // asech - template <typename genType> - GLM_FUNC_QUALIFIER genType asech(genType x) - { - GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'asech' only accept floating-point values"); - return acosh(genType(1) / x); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> asech(vecType<T, P> const & x) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'asech' only accept floating-point inputs"); - return detail::functor1<T, T, P, vecType>::call(asech, x); - } - - // acsch - template <typename genType> - GLM_FUNC_QUALIFIER genType acsch(genType x) - { - GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'acsch' only accept floating-point values"); - return acsch(genType(1) / x); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> acsch(vecType<T, P> const & x) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'acsch' only accept floating-point inputs"); - return detail::functor1<T, T, P, vecType>::call(acsch, x); - } - - // acoth - template <typename genType> - GLM_FUNC_QUALIFIER genType acoth(genType x) - { - GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'acoth' only accept floating-point values"); - return atanh(genType(1) / x); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> acoth(vecType<T, P> const & x) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'acoth' only accept floating-point inputs"); - return detail::functor1<T, T, P, vecType>::call(acoth, x); - } -}//namespace glm diff --git a/extensions/common/glm/gtc/round.hpp b/extensions/common/glm/gtc/round.hpp deleted file mode 100644 index e2912efb950..00000000000 --- a/extensions/common/glm/gtc/round.hpp +++ /dev/null @@ -1,203 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtc_round -/// @file glm/gtc/round.hpp -/// @date 2014-11-03 / 2014-11-03 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// @see gtc_round (dependence) -/// -/// @defgroup gtc_round GLM_GTC_round -/// @ingroup gtc -/// -/// @brief rounding value to specific boundings -/// -/// <glm/gtc/round.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependencies -#include "../detail/setup.hpp" -#include "../detail/precision.hpp" -#include "../detail/_vectorize.hpp" -#include "../vector_relational.hpp" -#include "../common.hpp" -#include <limits> - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTC_integer extension included") -#endif - -namespace glm -{ - /// @addtogroup gtc_round - /// @{ - - /// Return true if the value is a power of two number. - /// - /// @see gtc_round - template <typename genIUType> - GLM_FUNC_DECL bool isPowerOfTwo(genIUType Value); - - /// Return true if the value is a power of two number. - /// - /// @see gtc_round - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<bool, P> isPowerOfTwo(vecType<T, P> const & value); - - /// Return the power of two number which value is just higher the input value, - /// round up to a power of two. - /// - /// @see gtc_round - template <typename genIUType> - GLM_FUNC_DECL genIUType ceilPowerOfTwo(genIUType Value); - - /// Return the power of two number which value is just higher the input value, - /// round up to a power of two. - /// - /// @see gtc_round - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> ceilPowerOfTwo(vecType<T, P> const & value); - - /// Return the power of two number which value is just lower the input value, - /// round down to a power of two. - /// - /// @see gtc_round - template <typename genIUType> - GLM_FUNC_DECL genIUType floorPowerOfTwo(genIUType Value); - - /// Return the power of two number which value is just lower the input value, - /// round down to a power of two. - /// - /// @see gtc_round - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> floorPowerOfTwo(vecType<T, P> const & value); - - /// Return the power of two number which value is the closet to the input value. - /// - /// @see gtc_round - template <typename genIUType> - GLM_FUNC_DECL genIUType roundPowerOfTwo(genIUType Value); - - /// Return the power of two number which value is the closet to the input value. - /// - /// @see gtc_round - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> roundPowerOfTwo(vecType<T, P> const & value); - - /// Return true if the 'Value' is a multiple of 'Multiple'. - /// - /// @see gtc_round - template <typename genIUType> - GLM_FUNC_DECL bool isMultiple(genIUType Value, genIUType Multiple); - - /// Return true if the 'Value' is a multiple of 'Multiple'. - /// - /// @see gtc_round - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<bool, P> isMultiple(vecType<T, P> const & Value, T Multiple); - - /// Return true if the 'Value' is a multiple of 'Multiple'. - /// - /// @see gtc_round - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<bool, P> isMultiple(vecType<T, P> const & Value, vecType<T, P> const & Multiple); - - /// Higher multiple number of Source. - /// - /// @tparam genType Floating-point or integer scalar or vector types. - /// @param Source - /// @param Multiple Must be a null or positive value - /// - /// @see gtc_round - template <typename genType> - GLM_FUNC_DECL genType ceilMultiple(genType Source, genType Multiple); - - /// Higher multiple number of Source. - /// - /// @tparam genType Floating-point or integer scalar or vector types. - /// @param Source - /// @param Multiple Must be a null or positive value - /// - /// @see gtc_round - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> ceilMultiple(vecType<T, P> const & Source, vecType<T, P> const & Multiple); - - /// Lower multiple number of Source. - /// - /// @tparam genType Floating-point or integer scalar or vector types. - /// @param Source - /// @param Multiple Must be a null or positive value - /// - /// @see gtc_round - template <typename genType> - GLM_FUNC_DECL genType floorMultiple( - genType Source, - genType Multiple); - - /// Lower multiple number of Source. - /// - /// @tparam genType Floating-point or integer scalar or vector types. - /// @param Source - /// @param Multiple Must be a null or positive value - /// - /// @see gtc_round - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> floorMultiple( - vecType<T, P> const & Source, - vecType<T, P> const & Multiple); - - /// Lower multiple number of Source. - /// - /// @tparam genType Floating-point or integer scalar or vector types. - /// @param Source - /// @param Multiple Must be a null or positive value - /// - /// @see gtc_round - template <typename genType> - GLM_FUNC_DECL genType roundMultiple( - genType Source, - genType Multiple); - - /// Lower multiple number of Source. - /// - /// @tparam genType Floating-point or integer scalar or vector types. - /// @param Source - /// @param Multiple Must be a null or positive value - /// - /// @see gtc_round - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> roundMultiple( - vecType<T, P> const & Source, - vecType<T, P> const & Multiple); - - /// @} -} //namespace glm - -#include "round.inl" diff --git a/extensions/common/glm/gtc/round.inl b/extensions/common/glm/gtc/round.inl deleted file mode 100644 index 255dec66b0f..00000000000 --- a/extensions/common/glm/gtc/round.inl +++ /dev/null @@ -1,378 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtc_round -/// @file glm/gtc/round.inl -/// @date 2014-11-03 / 2014-11-03 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ -namespace detail -{ - template <typename T, precision P, template <typename, precision> class vecType, bool compute = false> - struct compute_ceilShift - { - GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & v, T) - { - return v; - } - }; - - template <typename T, precision P, template <typename, precision> class vecType> - struct compute_ceilShift<T, P, vecType, true> - { - GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & v, T Shift) - { - return v | (v >> Shift); - } - }; - - template <typename T, precision P, template <typename, precision> class vecType, bool isSigned = true> - struct compute_ceilPowerOfTwo - { - GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x) - { - GLM_STATIC_ASSERT(!std::numeric_limits<T>::is_iec559, "'ceilPowerOfTwo' only accept integer scalar or vector inputs"); - - vecType<T, P> const Sign(sign(x)); - - vecType<T, P> v(abs(x)); - - v = v - static_cast<T>(1); - v = v | (v >> static_cast<T>(1)); - v = v | (v >> static_cast<T>(2)); - v = v | (v >> static_cast<T>(4)); - v = compute_ceilShift<T, P, vecType, sizeof(T) >= 2>::call(v, 8); - v = compute_ceilShift<T, P, vecType, sizeof(T) >= 4>::call(v, 16); - v = compute_ceilShift<T, P, vecType, sizeof(T) >= 8>::call(v, 32); - return (v + static_cast<T>(1)) * Sign; - } - }; - - template <typename T, precision P, template <typename, precision> class vecType> - struct compute_ceilPowerOfTwo<T, P, vecType, false> - { - GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x) - { - GLM_STATIC_ASSERT(!std::numeric_limits<T>::is_iec559, "'ceilPowerOfTwo' only accept integer scalar or vector inputs"); - - vecType<T, P> v(x); - - v = v - static_cast<T>(1); - v = v | (v >> static_cast<T>(1)); - v = v | (v >> static_cast<T>(2)); - v = v | (v >> static_cast<T>(4)); - v = compute_ceilShift<T, P, vecType, sizeof(T) >= 2>::call(v, 8); - v = compute_ceilShift<T, P, vecType, sizeof(T) >= 4>::call(v, 16); - v = compute_ceilShift<T, P, vecType, sizeof(T) >= 8>::call(v, 32); - return v + static_cast<T>(1); - } - }; - - template <bool is_float, bool is_signed> - struct compute_ceilMultiple{}; - - template <> - struct compute_ceilMultiple<true, true> - { - template <typename genType> - GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) - { - if(Source > genType(0)) - { - genType Tmp = Source - genType(1); - return Tmp + (Multiple - std::fmod(Tmp, Multiple)); - } - else - return Source + std::fmod(-Source, Multiple); - } - }; - - template <> - struct compute_ceilMultiple<false, false> - { - template <typename genType> - GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) - { - genType Tmp = Source - genType(1); - return Tmp + (Multiple - (Tmp % Multiple)); - } - }; - - template <> - struct compute_ceilMultiple<false, true> - { - template <typename genType> - GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) - { - if(Source > genType(0)) - { - genType Tmp = Source - genType(1); - return Tmp + (Multiple - (Tmp % Multiple)); - } - else - return Source + (-Source % Multiple); - } - }; - - template <bool is_float, bool is_signed> - struct compute_floorMultiple{}; - - template <> - struct compute_floorMultiple<true, true> - { - template <typename genType> - GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) - { - if(Source >= genType(0)) - return Source - std::fmod(Source, Multiple); - else - { - genType Tmp = Source + genType(1); - return Tmp - std::fmod(Tmp, Multiple) - Multiple; - } - } - }; - - template <> - struct compute_floorMultiple<false, false> - { - template <typename genType> - GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) - { - if(Source >= genType(0)) - return Source - Source % Multiple; - else - { - genType Tmp = Source + genType(1); - return Tmp - Tmp % Multiple - Multiple; - } - } - }; - - template <> - struct compute_floorMultiple<false, true> - { - template <typename genType> - GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) - { - if(Source >= genType(0)) - return Source - Source % Multiple; - else - { - genType Tmp = Source + genType(1); - return Tmp - Tmp % Multiple - Multiple; - } - } - }; - - template <bool is_float, bool is_signed> - struct compute_roundMultiple{}; - - template <> - struct compute_roundMultiple<true, true> - { - template <typename genType> - GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) - { - if(Source >= genType(0)) - return Source - std::fmod(Source, Multiple); - else - { - genType Tmp = Source + genType(1); - return Tmp - std::fmod(Tmp, Multiple) - Multiple; - } - } - }; - - template <> - struct compute_roundMultiple<false, false> - { - template <typename genType> - GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) - { - if(Source >= genType(0)) - return Source - Source % Multiple; - else - { - genType Tmp = Source + genType(1); - return Tmp - Tmp % Multiple - Multiple; - } - } - }; - - template <> - struct compute_roundMultiple<false, true> - { - template <typename genType> - GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) - { - if(Source >= genType(0)) - return Source - Source % Multiple; - else - { - genType Tmp = Source + genType(1); - return Tmp - Tmp % Multiple - Multiple; - } - } - }; -}//namespace detail - - //////////////// - // isPowerOfTwo - - template <typename genType> - GLM_FUNC_QUALIFIER bool isPowerOfTwo(genType Value) - { - genType const Result = glm::abs(Value); - return !(Result & (Result - 1)); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<bool, P> isPowerOfTwo(vecType<T, P> const & Value) - { - vecType<T, P> const Result(abs(Value)); - return equal(Result & (Result - 1), vecType<T, P>(0)); - } - - ////////////////// - // ceilPowerOfTwo - - template <typename genType> - GLM_FUNC_QUALIFIER genType ceilPowerOfTwo(genType value) - { - return detail::compute_ceilPowerOfTwo<genType, defaultp, tvec1, std::numeric_limits<genType>::is_signed>::call(tvec1<genType, defaultp>(value)).x; - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> ceilPowerOfTwo(vecType<T, P> const & v) - { - return detail::compute_ceilPowerOfTwo<T, P, vecType, std::numeric_limits<T>::is_signed>::call(v); - } - - /////////////////// - // floorPowerOfTwo - - template <typename genType> - GLM_FUNC_QUALIFIER genType floorPowerOfTwo(genType value) - { - return isPowerOfTwo(value) ? value : highestBitValue(value); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> floorPowerOfTwo(vecType<T, P> const & v) - { - return detail::functor1<T, T, P, vecType>::call(floorPowerOfTwo, v); - } - - /////////////////// - // roundPowerOfTwo - - template <typename genIUType> - GLM_FUNC_QUALIFIER genIUType roundPowerOfTwo(genIUType value) - { - if(isPowerOfTwo(value)) - return value; - - genIUType const prev = highestBitValue(value); - genIUType const next = prev << 1; - return (next - value) < (value - prev) ? next : prev; - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> roundPowerOfTwo(vecType<T, P> const & v) - { - return detail::functor1<T, T, P, vecType>::call(roundPowerOfTwo, v); - } - - //////////////// - // isMultiple - - template <typename genType> - GLM_FUNC_QUALIFIER bool isMultiple(genType Value, genType Multiple) - { - return isMultiple(tvec1<genType>(Value), tvec1<genType>(Multiple)).x; - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<bool, P> isMultiple(vecType<T, P> const & Value, T Multiple) - { - return (Value % Multiple) == vecType<T, P>(0); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<bool, P> isMultiple(vecType<T, P> const & Value, vecType<T, P> const & Multiple) - { - return (Value % Multiple) == vecType<T, P>(0); - } - - ////////////////////// - // ceilMultiple - - template <typename genType> - GLM_FUNC_QUALIFIER genType ceilMultiple(genType Source, genType Multiple) - { - return detail::compute_ceilMultiple<std::numeric_limits<genType>::is_iec559, std::numeric_limits<genType>::is_signed>::call(Source, Multiple); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> ceilMultiple(vecType<T, P> const & Source, vecType<T, P> const & Multiple) - { - return detail::functor2<T, P, vecType>::call(ceilMultiple, Source, Multiple); - } - - ////////////////////// - // floorMultiple - - template <typename genType> - GLM_FUNC_QUALIFIER genType floorMultiple(genType Source, genType Multiple) - { - return detail::compute_floorMultiple<std::numeric_limits<genType>::is_iec559, std::numeric_limits<genType>::is_signed>::call(Source, Multiple); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> floorMultiple(vecType<T, P> const & Source, vecType<T, P> const & Multiple) - { - return detail::functor2<T, P, vecType>::call(floorMultiple, Source, Multiple); - } - - ////////////////////// - // roundMultiple - - template <typename genType> - GLM_FUNC_QUALIFIER genType roundMultiple(genType Source, genType Multiple) - { - return detail::compute_roundMultiple<std::numeric_limits<genType>::is_iec559, std::numeric_limits<genType>::is_signed>::call(Source, Multiple); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> roundMultiple(vecType<T, P> const & Source, vecType<T, P> const & Multiple) - { - return detail::functor2<T, P, vecType>::call(roundMultiple, Source, Multiple); - } -}//namespace glm diff --git a/extensions/common/glm/gtc/type_precision.hpp b/extensions/common/glm/gtc/type_precision.hpp deleted file mode 100644 index b1d35f64f0b..00000000000 --- a/extensions/common/glm/gtc/type_precision.hpp +++ /dev/null @@ -1,890 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtc_type_precision -/// @file glm/gtc/type_precision.hpp -/// @date 2009-06-04 / 2011-12-07 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// @see gtc_half_float (dependence) -/// @see gtc_quaternion (dependence) -/// -/// @defgroup gtc_type_precision GLM_GTC_type_precision -/// @ingroup gtc -/// -/// @brief Defines specific C++-based precision types. -/// -/// @ref core_precision defines types based on GLSL's precision qualifiers. This -/// extension defines types based on explicitly-sized C++ data types. -/// -/// <glm/gtc/type_precision.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependency: -#include "../gtc/quaternion.hpp" -#include "../gtc/vec1.hpp" -#include "../vec2.hpp" -#include "../vec3.hpp" -#include "../vec4.hpp" -#include "../mat2x2.hpp" -#include "../mat2x3.hpp" -#include "../mat2x4.hpp" -#include "../mat3x2.hpp" -#include "../mat3x3.hpp" -#include "../mat3x4.hpp" -#include "../mat4x2.hpp" -#include "../mat4x3.hpp" -#include "../mat4x4.hpp" - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTC_type_precision extension included") -#endif - -namespace glm -{ - /////////////////////////// - // Signed int vector types - - /// @addtogroup gtc_type_precision - /// @{ - - /// Low precision 8 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int8 lowp_int8; - - /// Low precision 16 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int16 lowp_int16; - - /// Low precision 32 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int32 lowp_int32; - - /// Low precision 64 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int64 lowp_int64; - - /// Low precision 8 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int8 lowp_int8_t; - - /// Low precision 16 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int16 lowp_int16_t; - - /// Low precision 32 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int32 lowp_int32_t; - - /// Low precision 64 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int64 lowp_int64_t; - - /// Low precision 8 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int8 lowp_i8; - - /// Low precision 16 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int16 lowp_i16; - - /// Low precision 32 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int32 lowp_i32; - - /// Low precision 64 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int64 lowp_i64; - - /// Medium precision 8 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int8 mediump_int8; - - /// Medium precision 16 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int16 mediump_int16; - - /// Medium precision 32 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int32 mediump_int32; - - /// Medium precision 64 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int64 mediump_int64; - - /// Medium precision 8 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int8 mediump_int8_t; - - /// Medium precision 16 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int16 mediump_int16_t; - - /// Medium precision 32 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int32 mediump_int32_t; - - /// Medium precision 64 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int64 mediump_int64_t; - - /// Medium precision 8 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int8 mediump_i8; - - /// Medium precision 16 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int16 mediump_i16; - - /// Medium precision 32 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int32 mediump_i32; - - /// Medium precision 64 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int64 mediump_i64; - - /// High precision 8 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int8 highp_int8; - - /// High precision 16 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int16 highp_int16; - - /// High precision 32 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int32 highp_int32; - - /// High precision 64 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int64 highp_int64; - - /// High precision 8 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int8 highp_int8_t; - - /// High precision 16 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int16 highp_int16_t; - - /// 32 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int32 highp_int32_t; - - /// High precision 64 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int64 highp_int64_t; - - /// High precision 8 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int8 highp_i8; - - /// High precision 16 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int16 highp_i16; - - /// High precision 32 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int32 highp_i32; - - /// High precision 64 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int64 highp_i64; - - - /// 8 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int8 int8; - - /// 16 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int16 int16; - - /// 32 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int32 int32; - - /// 64 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int64 int64; - -#if GLM_HAS_EXTENDED_INTEGER_TYPE - using std::int8_t; - using std::int16_t; - using std::int32_t; - using std::int64_t; -#else - /// 8 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int8 int8_t; - - /// 16 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int16 int16_t; - - /// 32 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int32 int32_t; - - /// 64 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int64 int64_t; -#endif - - /// 8 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int8 i8; - - /// 16 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int16 i16; - - /// 32 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int32 i32; - - /// 64 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int64 i64; - - - /// 8 bit signed integer scalar type. - /// @see gtc_type_precision - typedef tvec1<i8, defaultp> i8vec1; - - /// 8 bit signed integer vector of 2 components type. - /// @see gtc_type_precision - typedef tvec2<i8, defaultp> i8vec2; - - /// 8 bit signed integer vector of 3 components type. - /// @see gtc_type_precision - typedef tvec3<i8, defaultp> i8vec3; - - /// 8 bit signed integer vector of 4 components type. - /// @see gtc_type_precision - typedef tvec4<i8, defaultp> i8vec4; - - - /// 16 bit signed integer scalar type. - /// @see gtc_type_precision - typedef tvec1<i16, defaultp> i16vec1; - - /// 16 bit signed integer vector of 2 components type. - /// @see gtc_type_precision - typedef tvec2<i16, defaultp> i16vec2; - - /// 16 bit signed integer vector of 3 components type. - /// @see gtc_type_precision - typedef tvec3<i16, defaultp> i16vec3; - - /// 16 bit signed integer vector of 4 components type. - /// @see gtc_type_precision - typedef tvec4<i16, defaultp> i16vec4; - - - /// 32 bit signed integer scalar type. - /// @see gtc_type_precision - typedef tvec1<i32, defaultp> i32vec1; - - /// 32 bit signed integer vector of 2 components type. - /// @see gtc_type_precision - typedef tvec2<i32, defaultp> i32vec2; - - /// 32 bit signed integer vector of 3 components type. - /// @see gtc_type_precision - typedef tvec3<i32, defaultp> i32vec3; - - /// 32 bit signed integer vector of 4 components type. - /// @see gtc_type_precision - typedef tvec4<i32, defaultp> i32vec4; - - - /// 64 bit signed integer scalar type. - /// @see gtc_type_precision - typedef tvec1<i64, defaultp> i64vec1; - - /// 64 bit signed integer vector of 2 components type. - /// @see gtc_type_precision - typedef tvec2<i64, defaultp> i64vec2; - - /// 64 bit signed integer vector of 3 components type. - /// @see gtc_type_precision - typedef tvec3<i64, defaultp> i64vec3; - - /// 64 bit signed integer vector of 4 components type. - /// @see gtc_type_precision - typedef tvec4<i64, defaultp> i64vec4; - - - ///////////////////////////// - // Unsigned int vector types - - /// Low precision 8 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint8 lowp_uint8; - - /// Low precision 16 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint16 lowp_uint16; - - /// Low precision 32 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint32 lowp_uint32; - - /// Low precision 64 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint64 lowp_uint64; - - /// Low precision 8 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint8 lowp_uint8_t; - - /// Low precision 16 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint16 lowp_uint16_t; - - /// Low precision 32 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint32 lowp_uint32_t; - - /// Low precision 64 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint64 lowp_uint64_t; - - /// Low precision 8 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint8 lowp_u8; - - /// Low precision 16 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint16 lowp_u16; - - /// Low precision 32 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint32 lowp_u32; - - /// Low precision 64 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint64 lowp_u64; - - /// Medium precision 8 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint8 mediump_uint8; - - /// Medium precision 16 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint16 mediump_uint16; - - /// Medium precision 32 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint32 mediump_uint32; - - /// Medium precision 64 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint64 mediump_uint64; - - /// Medium precision 8 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint8 mediump_uint8_t; - - /// Medium precision 16 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint16 mediump_uint16_t; - - /// Medium precision 32 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint32 mediump_uint32_t; - - /// Medium precision 64 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint64 mediump_uint64_t; - - /// Medium precision 8 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint8 mediump_u8; - - /// Medium precision 16 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint16 mediump_u16; - - /// Medium precision 32 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint32 mediump_u32; - - /// Medium precision 64 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint64 mediump_u64; - - /// High precision 8 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint8 highp_uint8; - - /// High precision 16 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint16 highp_uint16; - - /// High precision 32 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint32 highp_uint32; - - /// High precision 64 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint64 highp_uint64; - - /// High precision 8 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint8 highp_uint8_t; - - /// High precision 16 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint16 highp_uint16_t; - - /// High precision 32 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint32 highp_uint32_t; - - /// High precision 64 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint64 highp_uint64_t; - - /// High precision 8 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint8 highp_u8; - - /// High precision 16 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint16 highp_u16; - - /// High precision 32 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint32 highp_u32; - - /// High precision 64 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint64 highp_u64; - - /// Default precision 8 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint8 uint8; - - /// Default precision 16 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint16 uint16; - - /// Default precision 32 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint32 uint32; - - /// Default precision 64 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint64 uint64; - -#if GLM_HAS_EXTENDED_INTEGER_TYPE - using std::uint8_t; - using std::uint16_t; - using std::uint32_t; - using std::uint64_t; -#else - /// Default precision 8 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint8 uint8_t; - - /// Default precision 16 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint16 uint16_t; - - /// Default precision 32 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint32 uint32_t; - - /// Default precision 64 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint64 uint64_t; -#endif - - /// Default precision 8 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint8 u8; - - /// Default precision 16 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint16 u16; - - /// Default precision 32 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint32 u32; - - /// Default precision 64 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint64 u64; - - - - /// Default precision 8 bit unsigned integer scalar type. - /// @see gtc_type_precision - typedef tvec1<u8, defaultp> u8vec1; - - /// Default precision 8 bit unsigned integer vector of 2 components type. - /// @see gtc_type_precision - typedef tvec2<u8, defaultp> u8vec2; - - /// Default precision 8 bit unsigned integer vector of 3 components type. - /// @see gtc_type_precision - typedef tvec3<u8, defaultp> u8vec3; - - /// Default precision 8 bit unsigned integer vector of 4 components type. - /// @see gtc_type_precision - typedef tvec4<u8, defaultp> u8vec4; - - - /// Default precision 16 bit unsigned integer scalar type. - /// @see gtc_type_precision - typedef tvec1<u16, defaultp> u16vec1; - - /// Default precision 16 bit unsigned integer vector of 2 components type. - /// @see gtc_type_precision - typedef tvec2<u16, defaultp> u16vec2; - - /// Default precision 16 bit unsigned integer vector of 3 components type. - /// @see gtc_type_precision - typedef tvec3<u16, defaultp> u16vec3; - - /// Default precision 16 bit unsigned integer vector of 4 components type. - /// @see gtc_type_precision - typedef tvec4<u16, defaultp> u16vec4; - - - /// Default precision 32 bit unsigned integer scalar type. - /// @see gtc_type_precision - typedef tvec1<u32, defaultp> u32vec1; - - /// Default precision 32 bit unsigned integer vector of 2 components type. - /// @see gtc_type_precision - typedef tvec2<u32, defaultp> u32vec2; - - /// Default precision 32 bit unsigned integer vector of 3 components type. - /// @see gtc_type_precision - typedef tvec3<u32, defaultp> u32vec3; - - /// Default precision 32 bit unsigned integer vector of 4 components type. - /// @see gtc_type_precision - typedef tvec4<u32, defaultp> u32vec4; - - - /// Default precision 64 bit unsigned integer scalar type. - /// @see gtc_type_precision - typedef tvec1<u64, defaultp> u64vec1; - - /// Default precision 64 bit unsigned integer vector of 2 components type. - /// @see gtc_type_precision - typedef tvec2<u64, defaultp> u64vec2; - - /// Default precision 64 bit unsigned integer vector of 3 components type. - /// @see gtc_type_precision - typedef tvec3<u64, defaultp> u64vec3; - - /// Default precision 64 bit unsigned integer vector of 4 components type. - /// @see gtc_type_precision - typedef tvec4<u64, defaultp> u64vec4; - - - ////////////////////// - // Float vector types - - /// 32 bit single-precision floating-point scalar. - /// @see gtc_type_precision - typedef detail::float32 float32; - - /// 64 bit double-precision floating-point scalar. - /// @see gtc_type_precision - typedef detail::float64 float64; - - - /// 32 bit single-precision floating-point scalar. - /// @see gtc_type_precision - typedef detail::float32 float32_t; - - /// 64 bit double-precision floating-point scalar. - /// @see gtc_type_precision - typedef detail::float64 float64_t; - - - /// 32 bit single-precision floating-point scalar. - /// @see gtc_type_precision - typedef float32 f32; - - /// 64 bit double-precision floating-point scalar. - /// @see gtc_type_precision - typedef float64 f64; - - - /// Single-precision floating-point vector of 1 component. - /// @see gtc_type_precision - typedef tvec1<float, defaultp> fvec1; - - /// Single-precision floating-point vector of 2 components. - /// @see gtc_type_precision - typedef tvec2<float, defaultp> fvec2; - - /// Single-precision floating-point vector of 3 components. - /// @see gtc_type_precision - typedef tvec3<float, defaultp> fvec3; - - /// Single-precision floating-point vector of 4 components. - /// @see gtc_type_precision - typedef tvec4<float, defaultp> fvec4; - - - /// Single-precision floating-point vector of 1 component. - /// @see gtc_type_precision - typedef tvec1<f32, defaultp> f32vec1; - - /// Single-precision floating-point vector of 2 components. - /// @see gtc_type_precision - typedef tvec2<f32, defaultp> f32vec2; - - /// Single-precision floating-point vector of 3 components. - /// @see gtc_type_precision - typedef tvec3<f32, defaultp> f32vec3; - - /// Single-precision floating-point vector of 4 components. - /// @see gtc_type_precision - typedef tvec4<f32, defaultp> f32vec4; - - - /// Double-precision floating-point vector of 1 component. - /// @see gtc_type_precision - typedef tvec1<f64, defaultp> f64vec1; - - /// Double-precision floating-point vector of 2 components. - /// @see gtc_type_precision - typedef tvec2<f64, defaultp> f64vec2; - - /// Double-precision floating-point vector of 3 components. - /// @see gtc_type_precision - typedef tvec3<f64, defaultp> f64vec3; - - /// Double-precision floating-point vector of 4 components. - /// @see gtc_type_precision - typedef tvec4<f64, defaultp> f64vec4; - - - ////////////////////// - // Float matrix types - - /// Single-precision floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef detail::tmat1x1<f32> fmat1; - - /// Single-precision floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef tmat2x2<f32, defaultp> fmat2; - - /// Single-precision floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef tmat3x3<f32, defaultp> fmat3; - - /// Single-precision floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef tmat4x4<f32, defaultp> fmat4; - - - /// Single-precision floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef f32 fmat1x1; - - /// Single-precision floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef tmat2x2<f32, defaultp> fmat2x2; - - /// Single-precision floating-point 2x3 matrix. - /// @see gtc_type_precision - typedef tmat2x3<f32, defaultp> fmat2x3; - - /// Single-precision floating-point 2x4 matrix. - /// @see gtc_type_precision - typedef tmat2x4<f32, defaultp> fmat2x4; - - /// Single-precision floating-point 3x2 matrix. - /// @see gtc_type_precision - typedef tmat3x2<f32, defaultp> fmat3x2; - - /// Single-precision floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef tmat3x3<f32, defaultp> fmat3x3; - - /// Single-precision floating-point 3x4 matrix. - /// @see gtc_type_precision - typedef tmat3x4<f32, defaultp> fmat3x4; - - /// Single-precision floating-point 4x2 matrix. - /// @see gtc_type_precision - typedef tmat4x2<f32, defaultp> fmat4x2; - - /// Single-precision floating-point 4x3 matrix. - /// @see gtc_type_precision - typedef tmat4x3<f32, defaultp> fmat4x3; - - /// Single-precision floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef tmat4x4<f32, defaultp> fmat4x4; - - - /// Single-precision floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef detail::tmat1x1<f32, defaultp> f32mat1; - - /// Single-precision floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef tmat2x2<f32, defaultp> f32mat2; - - /// Single-precision floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef tmat3x3<f32, defaultp> f32mat3; - - /// Single-precision floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef tmat4x4<f32, defaultp> f32mat4; - - - /// Single-precision floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef f32 f32mat1x1; - - /// Single-precision floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef tmat2x2<f32, defaultp> f32mat2x2; - - /// Single-precision floating-point 2x3 matrix. - /// @see gtc_type_precision - typedef tmat2x3<f32, defaultp> f32mat2x3; - - /// Single-precision floating-point 2x4 matrix. - /// @see gtc_type_precision - typedef tmat2x4<f32, defaultp> f32mat2x4; - - /// Single-precision floating-point 3x2 matrix. - /// @see gtc_type_precision - typedef tmat3x2<f32, defaultp> f32mat3x2; - - /// Single-precision floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef tmat3x3<f32, defaultp> f32mat3x3; - - /// Single-precision floating-point 3x4 matrix. - /// @see gtc_type_precision - typedef tmat3x4<f32, defaultp> f32mat3x4; - - /// Single-precision floating-point 4x2 matrix. - /// @see gtc_type_precision - typedef tmat4x2<f32, defaultp> f32mat4x2; - - /// Single-precision floating-point 4x3 matrix. - /// @see gtc_type_precision - typedef tmat4x3<f32, defaultp> f32mat4x3; - - /// Single-precision floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef tmat4x4<f32, defaultp> f32mat4x4; - - - /// Double-precision floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef detail::tmat1x1<f64, defaultp> f64mat1; - - /// Double-precision floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef tmat2x2<f64, defaultp> f64mat2; - - /// Double-precision floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef tmat3x3<f64, defaultp> f64mat3; - - /// Double-precision floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef tmat4x4<f64, defaultp> f64mat4; - - - /// Double-precision floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef f64 f64mat1x1; - - /// Double-precision floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef tmat2x2<f64, defaultp> f64mat2x2; - - /// Double-precision floating-point 2x3 matrix. - /// @see gtc_type_precision - typedef tmat2x3<f64, defaultp> f64mat2x3; - - /// Double-precision floating-point 2x4 matrix. - /// @see gtc_type_precision - typedef tmat2x4<f64, defaultp> f64mat2x4; - - /// Double-precision floating-point 3x2 matrix. - /// @see gtc_type_precision - typedef tmat3x2<f64, defaultp> f64mat3x2; - - /// Double-precision floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef tmat3x3<f64, defaultp> f64mat3x3; - - /// Double-precision floating-point 3x4 matrix. - /// @see gtc_type_precision - typedef tmat3x4<f64, defaultp> f64mat3x4; - - /// Double-precision floating-point 4x2 matrix. - /// @see gtc_type_precision - typedef tmat4x2<f64, defaultp> f64mat4x2; - - /// Double-precision floating-point 4x3 matrix. - /// @see gtc_type_precision - typedef tmat4x3<f64, defaultp> f64mat4x3; - - /// Double-precision floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef tmat4x4<f64, defaultp> f64mat4x4; - - - ////////////////////////// - // Quaternion types - - /// Single-precision floating-point quaternion. - /// @see gtc_type_precision - typedef tquat<f32, defaultp> f32quat; - - /// Double-precision floating-point quaternion. - /// @see gtc_type_precision - typedef tquat<f64, defaultp> f64quat; - - /// @} -}//namespace glm - -#include "type_precision.inl" diff --git a/extensions/common/glm/gtc/type_precision.inl b/extensions/common/glm/gtc/type_precision.inl deleted file mode 100644 index 0107db83ecd..00000000000 --- a/extensions/common/glm/gtc/type_precision.inl +++ /dev/null @@ -1,36 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtc_swizzle -/// @file glm/gtc/swizzle.inl -/// @date 2009-06-14 / 2011-06-15 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - -} diff --git a/extensions/common/glm/gtc/type_ptr.hpp b/extensions/common/glm/gtc/type_ptr.hpp deleted file mode 100644 index c6bccb0c4b4..00000000000 --- a/extensions/common/glm/gtc/type_ptr.hpp +++ /dev/null @@ -1,178 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtc_type_ptr -/// @file glm/gtc/type_ptr.hpp -/// @date 2009-05-06 / 2011-06-05 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// @see gtc_half_float (dependence) -/// @see gtc_quaternion (dependence) -/// -/// @defgroup gtc_type_ptr GLM_GTC_type_ptr -/// @ingroup gtc -/// -/// @brief Handles the interaction between pointers and vector, matrix types. -/// -/// This extension defines an overloaded function, glm::value_ptr, which -/// takes any of the \ref core_template "core template types". It returns -/// a pointer to the memory layout of the object. Matrix types store their values -/// in column-major order. -/// -/// This is useful for uploading data to matrices or copying data to buffer objects. -/// -/// Example: -/// @code -/// #include <glm/glm.hpp> -/// #include <glm/gtc/type_ptr.hpp> -/// -/// glm::vec3 aVector(3); -/// glm::mat4 someMatrix(1.0); -/// -/// glUniform3fv(uniformLoc, 1, glm::value_ptr(aVector)); -/// glUniformMatrix4fv(uniformMatrixLoc, 1, GL_FALSE, glm::value_ptr(someMatrix)); -/// @endcode -/// -/// <glm/gtc/type_ptr.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependency: -#include "../gtc/quaternion.hpp" -#include "../vec2.hpp" -#include "../vec3.hpp" -#include "../vec4.hpp" -#include "../mat2x2.hpp" -#include "../mat2x3.hpp" -#include "../mat2x4.hpp" -#include "../mat3x2.hpp" -#include "../mat3x3.hpp" -#include "../mat3x4.hpp" -#include "../mat4x2.hpp" -#include "../mat4x3.hpp" -#include "../mat4x4.hpp" -#include <cstring> - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTC_type_ptr extension included") -#endif - -namespace glm -{ - /// @addtogroup gtc_type_ptr - /// @{ - - /// Return the constant address to the data of the input parameter. - /// @see gtc_type_ptr - template<typename genType> - GLM_FUNC_DECL typename genType::value_type const * value_ptr(genType const & vec); - - /// Build a vector from a pointer. - /// @see gtc_type_ptr - template<typename T> - GLM_FUNC_DECL tvec2<T, defaultp> make_vec2(T const * const ptr); - - /// Build a vector from a pointer. - /// @see gtc_type_ptr - template<typename T> - GLM_FUNC_DECL tvec3<T, defaultp> make_vec3(T const * const ptr); - - /// Build a vector from a pointer. - /// @see gtc_type_ptr - template<typename T> - GLM_FUNC_DECL tvec4<T, defaultp> make_vec4(T const * const ptr); - - /// Build a matrix from a pointer. - /// @see gtc_type_ptr - template<typename T> - GLM_FUNC_DECL tmat2x2<T, defaultp> make_mat2x2(T const * const ptr); - - /// Build a matrix from a pointer. - /// @see gtc_type_ptr - template<typename T> - GLM_FUNC_DECL tmat2x3<T, defaultp> make_mat2x3(T const * const ptr); - - /// Build a matrix from a pointer. - /// @see gtc_type_ptr - template<typename T> - GLM_FUNC_DECL tmat2x4<T, defaultp> make_mat2x4(T const * const ptr); - - /// Build a matrix from a pointer. - /// @see gtc_type_ptr - template<typename T> - GLM_FUNC_DECL tmat3x2<T, defaultp> make_mat3x2(T const * const ptr); - - /// Build a matrix from a pointer. - /// @see gtc_type_ptr - template<typename T> - GLM_FUNC_DECL tmat3x3<T, defaultp> make_mat3x3(T const * const ptr); - - /// Build a matrix from a pointer. - /// @see gtc_type_ptr - template<typename T> - GLM_FUNC_DECL tmat3x4<T, defaultp> make_mat3x4(T const * const ptr); - - /// Build a matrix from a pointer. - /// @see gtc_type_ptr - template<typename T> - GLM_FUNC_DECL tmat4x2<T, defaultp> make_mat4x2(T const * const ptr); - - /// Build a matrix from a pointer. - /// @see gtc_type_ptr - template<typename T> - GLM_FUNC_DECL tmat4x3<T, defaultp> make_mat4x3(T const * const ptr); - - /// Build a matrix from a pointer. - /// @see gtc_type_ptr - template<typename T> - GLM_FUNC_DECL tmat4x4<T, defaultp> make_mat4x4(T const * const ptr); - - /// Build a matrix from a pointer. - /// @see gtc_type_ptr - template<typename T> - GLM_FUNC_DECL tmat2x2<T, defaultp> make_mat2(T const * const ptr); - - /// Build a matrix from a pointer. - /// @see gtc_type_ptr - template<typename T> - GLM_FUNC_DECL tmat3x3<T, defaultp> make_mat3(T const * const ptr); - - /// Build a matrix from a pointer. - /// @see gtc_type_ptr - template<typename T> - GLM_FUNC_DECL tmat4x4<T, defaultp> make_mat4(T const * const ptr); - - /// Build a quaternion from a pointer. - /// @see gtc_type_ptr - template<typename T> - GLM_FUNC_DECL tquat<T, defaultp> make_quat(T const * const ptr); - - /// @} -}//namespace glm - -#include "type_ptr.inl" diff --git a/extensions/common/glm/gtc/type_ptr.inl b/extensions/common/glm/gtc/type_ptr.inl deleted file mode 100644 index 0e1cd312c7b..00000000000 --- a/extensions/common/glm/gtc/type_ptr.inl +++ /dev/null @@ -1,479 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtc_type_ptr -/// @file glm/gtc/type_ptr.inl -/// @date 2011-06-15 / 2011-12-07 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#include <cstring> - -namespace glm -{ - /// @addtogroup gtc_type_ptr - /// @{ - - /// Return the constant address to the data of the vector input. - /// @see gtc_type_ptr - template<typename T, precision P> - GLM_FUNC_QUALIFIER T const * value_ptr - ( - tvec2<T, P> const & vec - ) - { - return &(vec.x); - } - - //! Return the address to the data of the vector input. - /// @see gtc_type_ptr - template<typename T, precision P> - GLM_FUNC_QUALIFIER T * value_ptr - ( - tvec2<T, P> & vec - ) - { - return &(vec.x); - } - - /// Return the constant address to the data of the vector input. - /// @see gtc_type_ptr - template<typename T, precision P> - GLM_FUNC_QUALIFIER T const * value_ptr - ( - tvec3<T, P> const & vec - ) - { - return &(vec.x); - } - - //! Return the address to the data of the vector input. - /// @see gtc_type_ptr - template<typename T, precision P> - GLM_FUNC_QUALIFIER T * value_ptr - ( - tvec3<T, P> & vec - ) - { - return &(vec.x); - } - - /// Return the constant address to the data of the vector input. - /// @see gtc_type_ptr - template<typename T, precision P> - GLM_FUNC_QUALIFIER T const * value_ptr - ( - tvec4<T, P> const & vec - ) - { - return &(vec.x); - } - - //! Return the address to the data of the vector input. - //! From GLM_GTC_type_ptr extension. - template<typename T, precision P> - GLM_FUNC_QUALIFIER T * value_ptr - ( - tvec4<T, P> & vec - ) - { - return &(vec.x); - } - - /// Return the constant address to the data of the matrix input. - /// @see gtc_type_ptr - template<typename T, precision P> - GLM_FUNC_QUALIFIER T const * value_ptr - ( - tmat2x2<T, P> const & mat - ) - { - return &(mat[0].x); - } - - //! Return the address to the data of the matrix input. - /// @see gtc_type_ptr - template<typename T, precision P> - GLM_FUNC_QUALIFIER T * value_ptr - ( - tmat2x2<T, P> & mat - ) - { - return &(mat[0].x); - } - - /// Return the constant address to the data of the matrix input. - /// @see gtc_type_ptr - template<typename T, precision P> - GLM_FUNC_QUALIFIER T const * value_ptr - ( - tmat3x3<T, P> const & mat - ) - { - return &(mat[0].x); - } - - //! Return the address to the data of the matrix input. - /// @see gtc_type_ptr - template<typename T, precision P> - GLM_FUNC_QUALIFIER T * value_ptr - ( - tmat3x3<T, P> & mat - ) - { - return &(mat[0].x); - } - - /// Return the constant address to the data of the matrix input. - /// @see gtc_type_ptr - template<typename T, precision P> - GLM_FUNC_QUALIFIER T const * value_ptr - ( - tmat4x4<T, P> const & mat - ) - { - return &(mat[0].x); - } - - //! Return the address to the data of the matrix input. - //! From GLM_GTC_type_ptr extension. - template<typename T, precision P> - GLM_FUNC_QUALIFIER T * value_ptr - ( - tmat4x4<T, P> & mat - ) - { - return &(mat[0].x); - } - - /// Return the constant address to the data of the matrix input. - /// @see gtc_type_ptr - template<typename T, precision P> - GLM_FUNC_QUALIFIER T const * value_ptr - ( - tmat2x3<T, P> const & mat - ) - { - return &(mat[0].x); - } - - //! Return the address to the data of the matrix input. - /// @see gtc_type_ptr - template<typename T, precision P> - GLM_FUNC_QUALIFIER T * value_ptr - ( - tmat2x3<T, P> & mat - ) - { - return &(mat[0].x); - } - - /// Return the constant address to the data of the matrix input. - /// @see gtc_type_ptr - template<typename T, precision P> - GLM_FUNC_QUALIFIER T const * value_ptr - ( - tmat3x2<T, P> const & mat - ) - { - return &(mat[0].x); - } - - //! Return the address to the data of the matrix input. - /// @see gtc_type_ptr - template<typename T, precision P> - GLM_FUNC_QUALIFIER T * value_ptr - ( - tmat3x2<T, P> & mat - ) - { - return &(mat[0].x); - } - - /// Return the constant address to the data of the matrix input. - /// @see gtc_type_ptr - template<typename T, precision P> - GLM_FUNC_QUALIFIER T const * value_ptr - ( - tmat2x4<T, P> const & mat - ) - { - return &(mat[0].x); - } - - //! Return the address to the data of the matrix input. - /// @see gtc_type_ptr - template<typename T, precision P> - GLM_FUNC_QUALIFIER T * value_ptr - ( - tmat2x4<T, P> & mat - ) - { - return &(mat[0].x); - } - - /// Return the constant address to the data of the matrix input. - /// @see gtc_type_ptr - template<typename T, precision P> - GLM_FUNC_QUALIFIER T const * value_ptr - ( - tmat4x2<T, P> const & mat - ) - { - return &(mat[0].x); - } - - //! Return the address to the data of the matrix input. - /// @see gtc_type_ptr - template<typename T, precision P> - GLM_FUNC_QUALIFIER T * value_ptr - ( - tmat4x2<T, P> & mat - ) - { - return &(mat[0].x); - } - - /// Return the constant address to the data of the matrix input. - /// @see gtc_type_ptr - template<typename T, precision P> - GLM_FUNC_QUALIFIER T const * value_ptr - ( - tmat3x4<T, P> const & mat - ) - { - return &(mat[0].x); - } - - //! Return the address to the data of the matrix input. - /// @see gtc_type_ptr - template<typename T, precision P> - GLM_FUNC_QUALIFIER T * value_ptr - ( - tmat3x4<T, P> & mat - ) - { - return &(mat[0].x); - } - - /// Return the constant address to the data of the matrix input. - /// @see gtc_type_ptr - template<typename T, precision P> - GLM_FUNC_QUALIFIER T const * value_ptr - ( - tmat4x3<T, P> const & mat - ) - { - return &(mat[0].x); - } - - /// Return the address to the data of the matrix input. - /// @see gtc_type_ptr - template<typename T, precision P> - GLM_FUNC_QUALIFIER T * value_ptr(tmat4x3<T, P> & mat) - { - return &(mat[0].x); - } - - /// Return the constant address to the data of the input parameter. - /// @see gtc_type_ptr - template<typename T, precision P> - GLM_FUNC_QUALIFIER T const * value_ptr - ( - tquat<T, P> const & q - ) - { - return &(q[0]); - } - - /// Return the address to the data of the quaternion input. - /// @see gtc_type_ptr - template<typename T, precision P> - GLM_FUNC_QUALIFIER T * value_ptr - ( - tquat<T, P> & q - ) - { - return &(q[0]); - } - - /// Build a vector from a pointer. - /// @see gtc_type_ptr - template <typename T> - GLM_FUNC_QUALIFIER tvec2<T, defaultp> make_vec2(T const * const ptr) - { - tvec2<T, defaultp> Result; - memcpy(value_ptr(Result), ptr, sizeof(tvec2<T, defaultp>)); - return Result; - } - - /// Build a vector from a pointer. - /// @see gtc_type_ptr - template <typename T> - GLM_FUNC_QUALIFIER tvec3<T, defaultp> make_vec3(T const * const ptr) - { - tvec3<T, defaultp> Result; - memcpy(value_ptr(Result), ptr, sizeof(tvec3<T, defaultp>)); - return Result; - } - - /// Build a vector from a pointer. - /// @see gtc_type_ptr - template <typename T> - GLM_FUNC_QUALIFIER tvec4<T, defaultp> make_vec4(T const * const ptr) - { - tvec4<T, defaultp> Result; - memcpy(value_ptr(Result), ptr, sizeof(tvec4<T, defaultp>)); - return Result; - } - - /// Build a matrix from a pointer. - /// @see gtc_type_ptr - template <typename T> - GLM_FUNC_QUALIFIER tmat2x2<T, defaultp> make_mat2x2(T const * const ptr) - { - tmat2x2<T, defaultp> Result; - memcpy(value_ptr(Result), ptr, sizeof(tmat2x2<T, defaultp>)); - return Result; - } - - /// Build a matrix from a pointer. - /// @see gtc_type_ptr - template <typename T> - GLM_FUNC_QUALIFIER tmat2x3<T, defaultp> make_mat2x3(T const * const ptr) - { - tmat2x3<T, defaultp> Result; - memcpy(value_ptr(Result), ptr, sizeof(tmat2x3<T, defaultp>)); - return Result; - } - - /// Build a matrix from a pointer. - /// @see gtc_type_ptr - template <typename T> - GLM_FUNC_QUALIFIER tmat2x4<T, defaultp> make_mat2x4(T const * const ptr) - { - tmat2x4<T, defaultp> Result; - memcpy(value_ptr(Result), ptr, sizeof(tmat2x4<T, defaultp>)); - return Result; - } - - /// Build a matrix from a pointer. - /// @see gtc_type_ptr - template <typename T> - GLM_FUNC_QUALIFIER tmat3x2<T, defaultp> make_mat3x2(T const * const ptr) - { - tmat3x2<T, defaultp> Result; - memcpy(value_ptr(Result), ptr, sizeof(tmat3x2<T, defaultp>)); - return Result; - } - - //! Build a matrix from a pointer. - /// @see gtc_type_ptr - template <typename T> - GLM_FUNC_QUALIFIER tmat3x3<T, defaultp> make_mat3x3(T const * const ptr) - { - tmat3x3<T, defaultp> Result; - memcpy(value_ptr(Result), ptr, sizeof(tmat3x3<T, defaultp>)); - return Result; - } - - //! Build a matrix from a pointer. - /// @see gtc_type_ptr - template <typename T> - GLM_FUNC_QUALIFIER tmat3x4<T, defaultp> make_mat3x4(T const * const ptr) - { - tmat3x4<T, defaultp> Result; - memcpy(value_ptr(Result), ptr, sizeof(tmat3x4<T, defaultp>)); - return Result; - } - - //! Build a matrix from a pointer. - /// @see gtc_type_ptr - template <typename T> - GLM_FUNC_QUALIFIER tmat4x2<T, defaultp> make_mat4x2(T const * const ptr) - { - tmat4x2<T, defaultp> Result; - memcpy(value_ptr(Result), ptr, sizeof(tmat4x2<T, defaultp>)); - return Result; - } - - //! Build a matrix from a pointer. - /// @see gtc_type_ptr - template <typename T> - GLM_FUNC_QUALIFIER tmat4x3<T, defaultp> make_mat4x3(T const * const ptr) - { - tmat4x3<T, defaultp> Result; - memcpy(value_ptr(Result), ptr, sizeof(tmat4x3<T, defaultp>)); - return Result; - } - - //! Build a matrix from a pointer. - /// @see gtc_type_ptr - template <typename T> - GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> make_mat4x4(T const * const ptr) - { - tmat4x4<T, defaultp> Result; - memcpy(value_ptr(Result), ptr, sizeof(tmat4x4<T, defaultp>)); - return Result; - } - - //! Build a matrix from a pointer. - /// @see gtc_type_ptr - template <typename T> - GLM_FUNC_QUALIFIER tmat2x2<T, defaultp> make_mat2(T const * const ptr) - { - return make_mat2x2(ptr); - } - - //! Build a matrix from a pointer. - /// @see gtc_type_ptr - template <typename T> - GLM_FUNC_QUALIFIER tmat3x3<T, defaultp> make_mat3(T const * const ptr) - { - return make_mat3x3(ptr); - } - - //! Build a matrix from a pointer. - /// @see gtc_type_ptr - template <typename T> - GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> make_mat4(T const * const ptr) - { - return make_mat4x4(ptr); - } - - //! Build a quaternion from a pointer. - /// @see gtc_type_ptr - template <typename T> - GLM_FUNC_QUALIFIER tquat<T, defaultp> make_quat(T const * const ptr) - { - tquat<T, defaultp> Result; - memcpy(value_ptr(Result), ptr, sizeof(tquat<T, defaultp>)); - return Result; - } - - /// @} -}//namespace glm - diff --git a/extensions/common/glm/gtc/ulp.hpp b/extensions/common/glm/gtc/ulp.hpp deleted file mode 100644 index 36e5f9f5fae..00000000000 --- a/extensions/common/glm/gtc/ulp.hpp +++ /dev/null @@ -1,92 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtc_ulp -/// @file glm/gtc/ulp.hpp -/// @date 2011-02-21 / 2011-12-12 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// -/// @defgroup gtc_ulp GLM_GTC_ulp -/// @ingroup gtc -/// -/// @brief Allow the measurement of the accuracy of a function against a reference -/// implementation. This extension works on floating-point data and provide results -/// in ULP. -/// <glm/gtc/ulp.hpp> need to be included to use these features. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependencies -#include "../detail/setup.hpp" -#include "../detail/precision.hpp" -#include "../detail/type_int.hpp" - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTC_ulp extension included") -#endif - -namespace glm -{ - /// @addtogroup gtc_ulp - /// @{ - - /// Return the next ULP value(s) after the input value(s). - /// @see gtc_ulp - template <typename genType> - GLM_FUNC_DECL genType next_float(genType const & x); - - /// Return the previous ULP value(s) before the input value(s). - /// @see gtc_ulp - template <typename genType> - GLM_FUNC_DECL genType prev_float(genType const & x); - - /// Return the value(s) ULP distance after the input value(s). - /// @see gtc_ulp - template <typename genType> - GLM_FUNC_DECL genType next_float(genType const & x, uint const & Distance); - - /// Return the value(s) ULP distance before the input value(s). - /// @see gtc_ulp - template <typename genType> - GLM_FUNC_DECL genType prev_float(genType const & x, uint const & Distance); - - /// Return the distance in the number of ULP between 2 scalars. - /// @see gtc_ulp - template <typename T> - GLM_FUNC_DECL uint float_distance(T const & x, T const & y); - - /// Return the distance in the number of ULP between 2 vectors. - /// @see gtc_ulp - template<typename T, template<typename> class vecType> - GLM_FUNC_DECL vecType<uint> float_distance(vecType<T> const & x, vecType<T> const & y); - - /// @} -}// namespace glm - -#include "ulp.inl" diff --git a/extensions/common/glm/gtc/ulp.inl b/extensions/common/glm/gtc/ulp.inl deleted file mode 100644 index 765698b19ca..00000000000 --- a/extensions/common/glm/gtc/ulp.inl +++ /dev/null @@ -1,350 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtc_ulp -/// @file glm/gtc/ulp.inl -/// @date 2011-03-07 / 2012-04-07 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// -/// Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. -/// -/// Developed at SunPro, a Sun Microsystems, Inc. business. -/// Permission to use, copy, modify, and distribute this -/// software is freely granted, provided that this notice -/// is preserved. -/////////////////////////////////////////////////////////////////////////////////// - -#include "../detail/type_int.hpp" -#include <cmath> -#include <cfloat> -#include <limits> - -#if(GLM_COMPILER & GLM_COMPILER_VC) -# pragma warning(push) -# pragma warning(disable : 4127) -#endif - -typedef union -{ - float value; - /* FIXME: Assumes 32 bit int. */ - unsigned int word; -} ieee_float_shape_type; - -typedef union -{ - double value; - struct - { - glm::detail::int32 lsw; - glm::detail::int32 msw; - } parts; -} ieee_double_shape_type; - -#define GLM_EXTRACT_WORDS(ix0,ix1,d) \ - do { \ - ieee_double_shape_type ew_u; \ - ew_u.value = (d); \ - (ix0) = ew_u.parts.msw; \ - (ix1) = ew_u.parts.lsw; \ - } while (0) - -#define GLM_GET_FLOAT_WORD(i,d) \ - do { \ - ieee_float_shape_type gf_u; \ - gf_u.value = (d); \ - (i) = gf_u.word; \ - } while (0) - -#define GLM_SET_FLOAT_WORD(d,i) \ - do { \ - ieee_float_shape_type sf_u; \ - sf_u.word = (i); \ - (d) = sf_u.value; \ - } while (0) - -#define GLM_INSERT_WORDS(d,ix0,ix1) \ - do { \ - ieee_double_shape_type iw_u; \ - iw_u.parts.msw = (ix0); \ - iw_u.parts.lsw = (ix1); \ - (d) = iw_u.value; \ - } while (0) - -namespace glm{ -namespace detail -{ - GLM_FUNC_QUALIFIER float nextafterf(float x, float y) - { - volatile float t; - glm::detail::int32 hx, hy, ix, iy; - - GLM_GET_FLOAT_WORD(hx, x); - GLM_GET_FLOAT_WORD(hy, y); - ix = hx&0x7fffffff; // |x| - iy = hy&0x7fffffff; // |y| - - if((ix>0x7f800000) || // x is nan - (iy>0x7f800000)) // y is nan - return x+y; - if(x==y) return y; // x=y, return y - if(ix==0) { // x == 0 - GLM_SET_FLOAT_WORD(x,(hy&0x80000000)|1);// return +-minsubnormal - t = x*x; - if(t==x) return t; else return x; // raise underflow flag - } - if(hx>=0) { // x > 0 - if(hx>hy) { // x > y, x -= ulp - hx -= 1; - } else { // x < y, x += ulp - hx += 1; - } - } else { // x < 0 - if(hy>=0||hx>hy){ // x < y, x -= ulp - hx -= 1; - } else { // x > y, x += ulp - hx += 1; - } - } - hy = hx&0x7f800000; - if(hy>=0x7f800000) return x+x; // overflow - if(hy<0x00800000) { // underflow - t = x*x; - if(t!=x) { // raise underflow flag - GLM_SET_FLOAT_WORD(y,hx); - return y; - } - } - GLM_SET_FLOAT_WORD(x,hx); - return x; - } - - GLM_FUNC_QUALIFIER double nextafter(double x, double y) - { - volatile double t; - glm::detail::int32 hx, hy, ix, iy; - glm::detail::uint32 lx, ly; - - GLM_EXTRACT_WORDS(hx, lx, x); - GLM_EXTRACT_WORDS(hy, ly, y); - ix = hx & 0x7fffffff; // |x| - iy = hy & 0x7fffffff; // |y| - - if(((ix>=0x7ff00000)&&((ix-0x7ff00000)|lx)!=0) || // x is nan - ((iy>=0x7ff00000)&&((iy-0x7ff00000)|ly)!=0)) // y is nan - return x+y; - if(x==y) return y; // x=y, return y - if((ix|lx)==0) { // x == 0 - GLM_INSERT_WORDS(x, hy & 0x80000000, 1); // return +-minsubnormal - t = x*x; - if(t==x) return t; else return x; // raise underflow flag - } - if(hx>=0) { // x > 0 - if(hx>hy||((hx==hy)&&(lx>ly))) { // x > y, x -= ulp - if(lx==0) hx -= 1; - lx -= 1; - } else { // x < y, x += ulp - lx += 1; - if(lx==0) hx += 1; - } - } else { // x < 0 - if(hy>=0||hx>hy||((hx==hy)&&(lx>ly))){// x < y, x -= ulp - if(lx==0) hx -= 1; - lx -= 1; - } else { // x > y, x += ulp - lx += 1; - if(lx==0) hx += 1; - } - } - hy = hx&0x7ff00000; - if(hy>=0x7ff00000) return x+x; // overflow - if(hy<0x00100000) { // underflow - t = x*x; - if(t!=x) { // raise underflow flag - GLM_INSERT_WORDS(y,hx,lx); - return y; - } - } - GLM_INSERT_WORDS(x,hx,lx); - return x; - } -}//namespace detail -}//namespace glm - -#if(GLM_COMPILER & GLM_COMPILER_VC) -# pragma warning(pop) -#endif - -namespace glm -{ - template <> - GLM_FUNC_QUALIFIER float next_float(float const & x) - { -# if GLM_HAS_CXX11_STL - return std::nextafter(x, std::numeric_limits<float>::max()); -# elif((GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS))) - return detail::nextafterf(x, FLT_MAX); -# elif(GLM_PLATFORM & GLM_PLATFORM_ANDROID) - return __builtin_nextafterf(x, FLT_MAX); -# else - return nextafterf(x, FLT_MAX); -# endif - } - - template <> - GLM_FUNC_QUALIFIER double next_float(double const & x) - { -# if GLM_HAS_CXX11_STL - return std::nextafter(x, std::numeric_limits<double>::max()); -# elif((GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS))) - return detail::nextafter(x, std::numeric_limits<double>::max()); -# elif(GLM_PLATFORM & GLM_PLATFORM_ANDROID) - return __builtin_nextafter(x, FLT_MAX); -# else - return nextafter(x, DBL_MAX); -# endif - } - - template<typename T, precision P, template<typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> next_float(vecType<T, P> const & x) - { - vecType<T, P> Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) - Result[i] = next_float(x[i]); - return Result; - } - - GLM_FUNC_QUALIFIER float prev_float(float const & x) - { -# if GLM_HAS_CXX11_STL - return std::nextafter(x, std::numeric_limits<float>::min()); -# elif((GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS))) - return detail::nextafterf(x, FLT_MIN); -# elif(GLM_PLATFORM & GLM_PLATFORM_ANDROID) - return __builtin_nextafterf(x, FLT_MIN); -# else - return nextafterf(x, FLT_MIN); -# endif - } - - GLM_FUNC_QUALIFIER double prev_float(double const & x) - { -# if GLM_HAS_CXX11_STL - return std::nextafter(x, std::numeric_limits<double>::min()); -# elif((GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS))) - return _nextafter(x, DBL_MIN); -# elif(GLM_PLATFORM & GLM_PLATFORM_ANDROID) - return __builtin_nextafter(x, DBL_MIN); -# else - return nextafter(x, DBL_MIN); -# endif - } - - template<typename T, precision P, template<typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> prev_float(vecType<T, P> const & x) - { - vecType<T, P> Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) - Result[i] = prev_float(x[i]); - return Result; - } - - template <typename T> - GLM_FUNC_QUALIFIER T next_float(T const & x, uint const & ulps) - { - T temp = x; - for(uint i = 0; i < ulps; ++i) - temp = next_float(temp); - return temp; - } - - template<typename T, precision P, template<typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> next_float(vecType<T, P> const & x, vecType<uint, P> const & ulps) - { - vecType<T, P> Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) - Result[i] = next_float(x[i], ulps[i]); - return Result; - } - - template <typename T> - GLM_FUNC_QUALIFIER T prev_float(T const & x, uint const & ulps) - { - T temp = x; - for(uint i = 0; i < ulps; ++i) - temp = prev_float(temp); - return temp; - } - - template<typename T, precision P, template<typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> prev_float(vecType<T, P> const & x, vecType<uint, P> const & ulps) - { - vecType<T, P> Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) - Result[i] = prev_float(x[i], ulps[i]); - return Result; - } - - template <typename T> - GLM_FUNC_QUALIFIER uint float_distance(T const & x, T const & y) - { - uint ulp = 0; - - if(x < y) - { - T temp = x; - while(temp != y)// && ulp < std::numeric_limits<std::size_t>::max()) - { - ++ulp; - temp = next_float(temp); - } - } - else if(y < x) - { - T temp = y; - while(temp != x)// && ulp < std::numeric_limits<std::size_t>::max()) - { - ++ulp; - temp = next_float(temp); - } - } - else // == - { - - } - - return ulp; - } - - template<typename T, precision P, template<typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<uint, P> float_distance(vecType<T, P> const & x, vecType<T, P> const & y) - { - vecType<uint, P> Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) - Result[i] = float_distance(x[i], y[i]); - return Result; - } -}//namespace glm diff --git a/extensions/common/glm/gtc/vec1.hpp b/extensions/common/glm/gtc/vec1.hpp deleted file mode 100644 index 244e0509f44..00000000000 --- a/extensions/common/glm/gtc/vec1.hpp +++ /dev/null @@ -1,193 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtc_vec1 -/// @file glm/gtc/vec1.hpp -/// @date 2010-02-08 / 2011-06-07 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// -/// @defgroup gtc_vec1 GLM_GTC_vec1 -/// @ingroup gtc -/// -/// @brief Add vec1, ivec1, uvec1 and bvec1 types. -/// <glm/gtc/vec1.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependency: -#include "../glm.hpp" -#include "../detail/type_vec1.hpp" - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTC_vec1 extension included") -#endif - -namespace glm -{ - /// 1 component vector of high precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// @see gtc_vec1 extension. - typedef highp_vec1_t highp_vec1; - - /// 1 component vector of medium precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// @see gtc_vec1 extension. - typedef mediump_vec1_t mediump_vec1; - - /// 1 component vector of low precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// @see gtc_vec1 extension. - typedef lowp_vec1_t lowp_vec1; - - /// 1 component vector of high precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// @see gtc_vec1 extension. - typedef highp_dvec1_t highp_dvec1; - - /// 1 component vector of medium precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// @see gtc_vec1 extension. - typedef mediump_dvec1_t mediump_dvec1; - - /// 1 component vector of low precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// @see gtc_vec1 extension. - typedef lowp_dvec1_t lowp_dvec1; - - /// 1 component vector of high precision signed integer numbers. - /// There is no guarantee on the actual precision. - /// @see gtc_vec1 extension. - typedef highp_ivec1_t highp_ivec1; - - /// 1 component vector of medium precision signed integer numbers. - /// There is no guarantee on the actual precision. - /// @see gtc_vec1 extension. - typedef mediump_ivec1_t mediump_ivec1; - - /// 1 component vector of low precision signed integer numbers. - /// There is no guarantee on the actual precision. - /// @see gtc_vec1 extension. - typedef lowp_ivec1_t lowp_ivec1; - - /// 1 component vector of high precision unsigned integer numbers. - /// There is no guarantee on the actual precision. - /// @see gtc_vec1 extension. - typedef highp_uvec1_t highp_uvec1; - - /// 1 component vector of medium precision unsigned integer numbers. - /// There is no guarantee on the actual precision. - /// @see gtc_vec1 extension. - typedef mediump_uvec1_t mediump_uvec1; - - /// 1 component vector of low precision unsigned integer numbers. - /// There is no guarantee on the actual precision. - /// @see gtc_vec1 extension. - typedef lowp_uvec1_t lowp_uvec1; - - /// 1 component vector of high precision boolean. - /// There is no guarantee on the actual precision. - /// @see gtc_vec1 extension. - typedef highp_bvec1_t highp_bvec1; - - /// 1 component vector of medium precision boolean. - /// There is no guarantee on the actual precision. - /// @see gtc_vec1 extension. - typedef mediump_bvec1_t mediump_bvec1; - - /// 1 component vector of low precision boolean. - /// There is no guarantee on the actual precision. - /// @see gtc_vec1 extension. - typedef lowp_bvec1_t lowp_bvec1; - - ////////////////////////// - // vec1 definition - -#if(defined(GLM_PRECISION_HIGHP_BOOL)) - typedef highp_bvec1 bvec1; -#elif(defined(GLM_PRECISION_MEDIUMP_BOOL)) - typedef mediump_bvec1 bvec1; -#elif(defined(GLM_PRECISION_LOWP_BOOL)) - typedef lowp_bvec1 bvec1; -#else - /// 1 component vector of boolean. - /// @see gtc_vec1 extension. - typedef highp_bvec1 bvec1; -#endif//GLM_PRECISION - -#if(defined(GLM_PRECISION_HIGHP_FLOAT)) - typedef highp_vec1 vec1; -#elif(defined(GLM_PRECISION_MEDIUMP_FLOAT)) - typedef mediump_vec1 vec1; -#elif(defined(GLM_PRECISION_LOWP_FLOAT)) - typedef lowp_vec1 vec1; -#else - /// 1 component vector of floating-point numbers. - /// @see gtc_vec1 extension. - typedef highp_vec1 vec1; -#endif//GLM_PRECISION - -#if(defined(GLM_PRECISION_HIGHP_DOUBLE)) - typedef highp_dvec1 dvec1; -#elif(defined(GLM_PRECISION_MEDIUMP_DOUBLE)) - typedef mediump_dvec1 dvec1; -#elif(defined(GLM_PRECISION_LOWP_DOUBLE)) - typedef lowp_dvec1 dvec1; -#else - /// 1 component vector of floating-point numbers. - /// @see gtc_vec1 extension. - typedef highp_dvec1 dvec1; -#endif//GLM_PRECISION - -#if(defined(GLM_PRECISION_HIGHP_INT)) - typedef highp_ivec1 ivec1; -#elif(defined(GLM_PRECISION_MEDIUMP_INT)) - typedef mediump_ivec1 ivec1; -#elif(defined(GLM_PRECISION_LOWP_INT)) - typedef lowp_ivec1 ivec1; -#else - /// 1 component vector of signed integer numbers. - /// @see gtc_vec1 extension. - typedef highp_ivec1 ivec1; -#endif//GLM_PRECISION - -#if(defined(GLM_PRECISION_HIGHP_UINT)) - typedef highp_uvec1 uvec1; -#elif(defined(GLM_PRECISION_MEDIUMP_UINT)) - typedef mediump_uvec1 uvec1; -#elif(defined(GLM_PRECISION_LOWP_UINT)) - typedef lowp_uvec1 uvec1; -#else - /// 1 component vector of unsigned integer numbers. - /// @see gtc_vec1 extension. - typedef highp_uvec1 uvec1; -#endif//GLM_PRECISION - -}// namespace glm - -#include "vec1.inl" diff --git a/extensions/common/glm/gtc/vec1.inl b/extensions/common/glm/gtc/vec1.inl deleted file mode 100644 index 4a7c88dc591..00000000000 --- a/extensions/common/glm/gtc/vec1.inl +++ /dev/null @@ -1,31 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtc_vec1 -/// @file glm/gtc/vec1.inl -/// @date 2013-03-16 / 2013-03-16 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// diff --git a/extensions/common/glm/gtx/associated_min_max.hpp b/extensions/common/glm/gtx/associated_min_max.hpp deleted file mode 100644 index 81b09d40432..00000000000 --- a/extensions/common/glm/gtx/associated_min_max.hpp +++ /dev/null @@ -1,231 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_associated_min_max -/// @file glm/gtx/associated_min_max.hpp -/// @date 2008-03-10 / 2014-10-11 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// @see gtx_extented_min_max (dependence) -/// -/// @defgroup gtx_associated_min_max GLM_GTX_associated_min_max -/// @ingroup gtx -/// -/// @brief Min and max functions that return associated values not the compared onces. -/// <glm/gtx/associated_min_max.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependency: -#include "../glm.hpp" - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTX_associated_min_max extension included") -#endif - -namespace glm -{ - /// @addtogroup gtx_associated_min_max - /// @{ - - /// Minimum comparison between 2 variables and returns 2 associated variable values - /// @see gtx_associated_min_max - template<typename T, typename U, precision P> - GLM_FUNC_DECL U associatedMin(T x, U a, T y, U b); - - /// Minimum comparison between 2 variables and returns 2 associated variable values - /// @see gtx_associated_min_max - template<typename T, typename U, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL tvec2<U, P> associatedMin( - vecType<T, P> const & x, vecType<U, P> const & a, - vecType<T, P> const & y, vecType<U, P> const & b); - - /// Minimum comparison between 2 variables and returns 2 associated variable values - /// @see gtx_associated_min_max - template<typename T, typename U, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<U, P> associatedMin( - T x, const vecType<U, P>& a, - T y, const vecType<U, P>& b); - - /// Minimum comparison between 2 variables and returns 2 associated variable values - /// @see gtx_associated_min_max - template<typename T, typename U, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<U, P> associatedMin( - vecType<T, P> const & x, U a, - vecType<T, P> const & y, U b); - - /// Minimum comparison between 3 variables and returns 3 associated variable values - /// @see gtx_associated_min_max - template<typename T, typename U> - GLM_FUNC_DECL U associatedMin( - T x, U a, - T y, U b, - T z, U c); - - /// Minimum comparison between 3 variables and returns 3 associated variable values - /// @see gtx_associated_min_max - template<typename T, typename U, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<U, P> associatedMin( - vecType<T, P> const & x, vecType<U, P> const & a, - vecType<T, P> const & y, vecType<U, P> const & b, - vecType<T, P> const & z, vecType<U, P> const & c); - - /// Minimum comparison between 4 variables and returns 4 associated variable values - /// @see gtx_associated_min_max - template<typename T, typename U> - GLM_FUNC_DECL U associatedMin( - T x, U a, - T y, U b, - T z, U c, - T w, U d); - - /// Minimum comparison between 4 variables and returns 4 associated variable values - /// @see gtx_associated_min_max - template<typename T, typename U, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<U, P> associatedMin( - vecType<T, P> const & x, vecType<U, P> const & a, - vecType<T, P> const & y, vecType<U, P> const & b, - vecType<T, P> const & z, vecType<U, P> const & c, - vecType<T, P> const & w, vecType<U, P> const & d); - - /// Minimum comparison between 4 variables and returns 4 associated variable values - /// @see gtx_associated_min_max - template<typename T, typename U, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<U, P> associatedMin( - T x, vecType<U, P> const & a, - T y, vecType<U, P> const & b, - T z, vecType<U, P> const & c, - T w, vecType<U, P> const & d); - - /// Minimum comparison between 4 variables and returns 4 associated variable values - /// @see gtx_associated_min_max - template<typename T, typename U, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<U, P> associatedMin( - vecType<T, P> const & x, U a, - vecType<T, P> const & y, U b, - vecType<T, P> const & z, U c, - vecType<T, P> const & w, U d); - - /// Maximum comparison between 2 variables and returns 2 associated variable values - /// @see gtx_associated_min_max - template<typename T, typename U> - GLM_FUNC_DECL U associatedMax(T x, U a, T y, U b); - - /// Maximum comparison between 2 variables and returns 2 associated variable values - /// @see gtx_associated_min_max - template<typename T, typename U, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL tvec2<U, P> associatedMax( - vecType<T, P> const & x, vecType<U, P> const & a, - vecType<T, P> const & y, vecType<U, P> const & b); - - /// Maximum comparison between 2 variables and returns 2 associated variable values - /// @see gtx_associated_min_max - template<typename T, typename U, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> associatedMax( - T x, vecType<U, P> const & a, - T y, vecType<U, P> const & b); - - /// Maximum comparison between 2 variables and returns 2 associated variable values - /// @see gtx_associated_min_max - template<typename T, typename U, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<U, P> associatedMax( - vecType<T, P> const & x, U a, - vecType<T, P> const & y, U b); - - /// Maximum comparison between 3 variables and returns 3 associated variable values - /// @see gtx_associated_min_max - template<typename T, typename U> - GLM_FUNC_DECL U associatedMax( - T x, U a, - T y, U b, - T z, U c); - - /// Maximum comparison between 3 variables and returns 3 associated variable values - /// @see gtx_associated_min_max - template<typename T, typename U, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<U, P> associatedMax( - vecType<T, P> const & x, vecType<U, P> const & a, - vecType<T, P> const & y, vecType<U, P> const & b, - vecType<T, P> const & z, vecType<U, P> const & c); - - /// Maximum comparison between 3 variables and returns 3 associated variable values - /// @see gtx_associated_min_max - template<typename T, typename U, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> associatedMax( - T x, vecType<U, P> const & a, - T y, vecType<U, P> const & b, - T z, vecType<U, P> const & c); - - /// Maximum comparison between 3 variables and returns 3 associated variable values - /// @see gtx_associated_min_max - template<typename T, typename U, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<U, P> associatedMax( - vecType<T, P> const & x, U a, - vecType<T, P> const & y, U b, - vecType<T, P> const & z, U c); - - /// Maximum comparison between 4 variables and returns 4 associated variable values - /// @see gtx_associated_min_max - template<typename T, typename U> - GLM_FUNC_DECL U associatedMax( - T x, U a, - T y, U b, - T z, U c, - T w, U d); - - /// Maximum comparison between 4 variables and returns 4 associated variable values - /// @see gtx_associated_min_max - template<typename T, typename U, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<U, P> associatedMax( - vecType<T, P> const & x, vecType<U, P> const & a, - vecType<T, P> const & y, vecType<U, P> const & b, - vecType<T, P> const & z, vecType<U, P> const & c, - vecType<T, P> const & w, vecType<U, P> const & d); - - /// Maximum comparison between 4 variables and returns 4 associated variable values - /// @see gtx_associated_min_max - template<typename T, typename U, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<U, P> associatedMax( - T x, vecType<U, P> const & a, - T y, vecType<U, P> const & b, - T z, vecType<U, P> const & c, - T w, vecType<U, P> const & d); - - /// Maximum comparison between 4 variables and returns 4 associated variable values - /// @see gtx_associated_min_max - template<typename T, typename U, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<U, P> associatedMax( - vecType<T, P> const & x, U a, - vecType<T, P> const & y, U b, - vecType<T, P> const & z, U c, - vecType<T, P> const & w, U d); - - /// @} -} //namespace glm - -#include "associated_min_max.inl" diff --git a/extensions/common/glm/gtx/associated_min_max.inl b/extensions/common/glm/gtx/associated_min_max.inl deleted file mode 100644 index 41f08b46ff5..00000000000 --- a/extensions/common/glm/gtx/associated_min_max.inl +++ /dev/null @@ -1,384 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_associated_min_max -/// @file glm/gtx/associated_min_max.inl -/// @date 2008-03-10 / 2014-10-11 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm{ - -// Min comparison between 2 variables -template<typename T, typename U, precision P> -GLM_FUNC_QUALIFIER U associatedMin(T x, U a, T y, U b) -{ - return x < y ? a : b; -} - -template<typename T, typename U, precision P, template <typename, precision> class vecType> -GLM_FUNC_QUALIFIER tvec2<U, P> associatedMin -( - vecType<T, P> const & x, vecType<U, P> const & a, - vecType<T, P> const & y, vecType<U, P> const & b -) -{ - vecType<U, P> Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) - Result[i] = x[i] < y[i] ? a[i] : b[i]; - return Result; -} - -template<typename T, typename U, precision P, template <typename, precision> class vecType> -GLM_FUNC_QUALIFIER vecType<U, P> associatedMin -( - T x, const vecType<U, P>& a, - T y, const vecType<U, P>& b -) -{ - vecType<U, P> Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) - Result[i] = x < y ? a[i] : b[i]; - return Result; -} - -template<typename T, typename U, precision P, template <typename, precision> class vecType> -GLM_FUNC_QUALIFIER vecType<U, P> associatedMin -( - vecType<T, P> const & x, U a, - vecType<T, P> const & y, U b -) -{ - vecType<U, P> Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) - Result[i] = x[i] < y[i] ? a : b; - return Result; -} - -// Min comparison between 3 variables -template<typename T, typename U> -GLM_FUNC_QUALIFIER U associatedMin -( - T x, U a, - T y, U b, - T z, U c -) -{ - U Result = x < y ? (x < z ? a : c) : (y < z ? b : c); - return Result; -} - -template<typename T, typename U, precision P, template <typename, precision> class vecType> -GLM_FUNC_QUALIFIER vecType<U, P> associatedMin -( - vecType<T, P> const & x, vecType<U, P> const & a, - vecType<T, P> const & y, vecType<U, P> const & b, - vecType<T, P> const & z, vecType<U, P> const & c -) -{ - vecType<U, P> Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) - Result[i] = x[i] < y[i] ? (x[i] < z[i] ? a[i] : c[i]) : (y[i] < z[i] ? b[i] : c[i]); - return Result; -} - -// Min comparison between 4 variables -template<typename T, typename U> -GLM_FUNC_QUALIFIER U associatedMin -( - T x, U a, - T y, U b, - T z, U c, - T w, U d -) -{ - T Test1 = min(x, y); - T Test2 = min(z, w);; - U Result1 = x < y ? a : b; - U Result2 = z < w ? c : d; - U Result = Test1 < Test2 ? Result1 : Result2; - return Result; -} - -// Min comparison between 4 variables -template<typename T, typename U, precision P, template <typename, precision> class vecType> -GLM_FUNC_QUALIFIER vecType<U, P> associatedMin -( - vecType<T, P> const & x, vecType<U, P> const & a, - vecType<T, P> const & y, vecType<U, P> const & b, - vecType<T, P> const & z, vecType<U, P> const & c, - vecType<T, P> const & w, vecType<U, P> const & d -) -{ - vecType<U, P> Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) - { - T Test1 = min(x[i], y[i]); - T Test2 = min(z[i], w[i]); - U Result1 = x[i] < y[i] ? a[i] : b[i]; - U Result2 = z[i] < w[i] ? c[i] : d[i]; - Result[i] = Test1 < Test2 ? Result1 : Result2; - } - return Result; -} - -// Min comparison between 4 variables -template<typename T, typename U, precision P, template <typename, precision> class vecType> -GLM_FUNC_QUALIFIER vecType<U, P> associatedMin -( - T x, vecType<U, P> const & a, - T y, vecType<U, P> const & b, - T z, vecType<U, P> const & c, - T w, vecType<U, P> const & d -) -{ - T Test1 = min(x, y); - T Test2 = min(z, w); - - vecType<U, P> Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) - { - U Result1 = x < y ? a[i] : b[i]; - U Result2 = z < w ? c[i] : d[i]; - Result[i] = Test1 < Test2 ? Result1 : Result2; - } - return Result; -} - -// Min comparison between 4 variables -template<typename T, typename U, precision P, template <typename, precision> class vecType> -GLM_FUNC_QUALIFIER vecType<U, P> associatedMin -( - vecType<T, P> const & x, U a, - vecType<T, P> const & y, U b, - vecType<T, P> const & z, U c, - vecType<T, P> const & w, U d -) -{ - vecType<U, P> Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) - { - T Test1 = min(x[i], y[i]); - T Test2 = min(z[i], w[i]);; - U Result1 = x[i] < y[i] ? a : b; - U Result2 = z[i] < w[i] ? c : d; - Result[i] = Test1 < Test2 ? Result1 : Result2; - } - return Result; -} - -// Max comparison between 2 variables -template<typename T, typename U> -GLM_FUNC_QUALIFIER U associatedMax(T x, U a, T y, U b) -{ - return x > y ? a : b; -} - -// Max comparison between 2 variables -template<typename T, typename U, precision P, template <typename, precision> class vecType> -GLM_FUNC_QUALIFIER tvec2<U, P> associatedMax -( - vecType<T, P> const & x, vecType<U, P> const & a, - vecType<T, P> const & y, vecType<U, P> const & b -) -{ - vecType<U, P> Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) - Result[i] = x[i] > y[i] ? a[i] : b[i]; - return Result; -} - -// Max comparison between 2 variables -template<typename T, typename U, precision P, template <typename, precision> class vecType> -GLM_FUNC_QUALIFIER vecType<T, P> associatedMax -( - T x, vecType<U, P> const & a, - T y, vecType<U, P> const & b -) -{ - vecType<U, P> Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) - Result[i] = x > y ? a[i] : b[i]; - return Result; -} - -// Max comparison between 2 variables -template<typename T, typename U, precision P, template <typename, precision> class vecType> -GLM_FUNC_QUALIFIER vecType<U, P> associatedMax -( - vecType<T, P> const & x, U a, - vecType<T, P> const & y, U b -) -{ - vecType<T, P> Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) - Result[i] = x[i] > y[i] ? a : b; - return Result; -} - -// Max comparison between 3 variables -template<typename T, typename U> -GLM_FUNC_QUALIFIER U associatedMax -( - T x, U a, - T y, U b, - T z, U c -) -{ - U Result = x > y ? (x > z ? a : c) : (y > z ? b : c); - return Result; -} - -// Max comparison between 3 variables -template<typename T, typename U, precision P, template <typename, precision> class vecType> -GLM_FUNC_QUALIFIER vecType<U, P> associatedMax -( - vecType<T, P> const & x, vecType<U, P> const & a, - vecType<T, P> const & y, vecType<U, P> const & b, - vecType<T, P> const & z, vecType<U, P> const & c -) -{ - vecType<U, P> Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) - Result[i] = x[i] > y[i] ? (x[i] > z[i] ? a[i] : c[i]) : (y[i] > z[i] ? b[i] : c[i]); - return Result; -} - -// Max comparison between 3 variables -template<typename T, typename U, precision P, template <typename, precision> class vecType> -GLM_FUNC_QUALIFIER vecType<T, P> associatedMax -( - T x, vecType<U, P> const & a, - T y, vecType<U, P> const & b, - T z, vecType<U, P> const & c -) -{ - vecType<U, P> Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) - Result[i] = x > y ? (x > z ? a[i] : c[i]) : (y > z ? b[i] : c[i]); - return Result; -} - -// Max comparison between 3 variables -template<typename T, typename U, precision P, template <typename, precision> class vecType> -GLM_FUNC_QUALIFIER vecType<U, P> associatedMax -( - vecType<T, P> const & x, U a, - vecType<T, P> const & y, U b, - vecType<T, P> const & z, U c -) -{ - vecType<T, P> Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) - Result[i] = x[i] > y[i] ? (x[i] > z[i] ? a : c) : (y[i] > z[i] ? b : c); - return Result; -} - -// Max comparison between 4 variables -template<typename T, typename U> -GLM_FUNC_QUALIFIER U associatedMax -( - T x, U a, - T y, U b, - T z, U c, - T w, U d -) -{ - T Test1 = max(x, y); - T Test2 = max(z, w);; - U Result1 = x > y ? a : b; - U Result2 = z > w ? c : d; - U Result = Test1 > Test2 ? Result1 : Result2; - return Result; -} - -// Max comparison between 4 variables -template<typename T, typename U, precision P, template <typename, precision> class vecType> -GLM_FUNC_QUALIFIER vecType<U, P> associatedMax -( - vecType<T, P> const & x, vecType<U, P> const & a, - vecType<T, P> const & y, vecType<U, P> const & b, - vecType<T, P> const & z, vecType<U, P> const & c, - vecType<T, P> const & w, vecType<U, P> const & d -) -{ - vecType<U, P> Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) - { - T Test1 = max(x[i], y[i]); - T Test2 = max(z[i], w[i]); - U Result1 = x[i] > y[i] ? a[i] : b[i]; - U Result2 = z[i] > w[i] ? c[i] : d[i]; - Result[i] = Test1 > Test2 ? Result1 : Result2; - } - return Result; -} - -// Max comparison between 4 variables -template<typename T, typename U, precision P, template <typename, precision> class vecType> -GLM_FUNC_QUALIFIER vecType<U, P> associatedMax -( - T x, vecType<U, P> const & a, - T y, vecType<U, P> const & b, - T z, vecType<U, P> const & c, - T w, vecType<U, P> const & d -) -{ - T Test1 = max(x, y); - T Test2 = max(z, w); - - vecType<U, P> Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) - { - U Result1 = x > y ? a[i] : b[i]; - U Result2 = z > w ? c[i] : d[i]; - Result[i] = Test1 > Test2 ? Result1 : Result2; - } - return Result; -} - -// Max comparison between 4 variables -template<typename T, typename U, precision P, template <typename, precision> class vecType> -GLM_FUNC_QUALIFIER vecType<U, P> associatedMax -( - vecType<T, P> const & x, U a, - vecType<T, P> const & y, U b, - vecType<T, P> const & z, U c, - vecType<T, P> const & w, U d -) -{ - vecType<U, P> Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) - { - T Test1 = max(x[i], y[i]); - T Test2 = max(z[i], w[i]);; - U Result1 = x[i] > y[i] ? a : b; - U Result2 = z[i] > w[i] ? c : d; - Result[i] = Test1 > Test2 ? Result1 : Result2; - } - return Result; -} -}//namespace glm diff --git a/extensions/common/glm/gtx/bit.hpp b/extensions/common/glm/gtx/bit.hpp deleted file mode 100644 index a5cf2753fce..00000000000 --- a/extensions/common/glm/gtx/bit.hpp +++ /dev/null @@ -1,120 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_bit -/// @file glm/gtx/bit.hpp -/// @date 2007-03-14 / 2011-06-07 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// @see gtc_half_float (dependence) -/// -/// @defgroup gtx_bit GLM_GTX_bit -/// @ingroup gtx -/// -/// @brief Allow to perform bit operations on integer values -/// -/// <glm/gtx/bit.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependencies -#include "../gtc/bitfield.hpp" - -#if(defined(GLM_MESSAGES)) -# pragma message("GLM: GLM_GTX_bit extension is deprecated, include GLM_GTC_bitfield and GLM_GTC_integer instead") -#endif - -namespace glm -{ - /// @addtogroup gtx_bit - /// @{ - - /// @see gtx_bit - template <typename genIUType> - GLM_FUNC_DECL genIUType highestBitValue(genIUType Value); - - /// Find the highest bit set to 1 in a integer variable and return its value. - /// - /// @see gtx_bit - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> highestBitValue(vecType<T, P> const & value); - - /// Return the power of two number which value is just higher the input value. - /// Deprecated, use ceilPowerOfTwo from GTC_round instead - /// - /// @see gtc_round - /// @see gtx_bit - template <typename genIUType> - GLM_DEPRECATED GLM_FUNC_DECL genIUType powerOfTwoAbove(genIUType Value); - - /// Return the power of two number which value is just higher the input value. - /// Deprecated, use ceilPowerOfTwo from GTC_round instead - /// - /// @see gtc_round - /// @see gtx_bit - template <typename T, precision P, template <typename, precision> class vecType> - GLM_DEPRECATED GLM_FUNC_DECL vecType<T, P> powerOfTwoAbove(vecType<T, P> const & value); - - /// Return the power of two number which value is just lower the input value. - /// Deprecated, use floorPowerOfTwo from GTC_round instead - /// - /// @see gtc_round - /// @see gtx_bit - template <typename genIUType> - GLM_DEPRECATED GLM_FUNC_DECL genIUType powerOfTwoBelow(genIUType Value); - - /// Return the power of two number which value is just lower the input value. - /// Deprecated, use floorPowerOfTwo from GTC_round instead - /// - /// @see gtc_round - /// @see gtx_bit - template <typename T, precision P, template <typename, precision> class vecType> - GLM_DEPRECATED GLM_FUNC_DECL vecType<T, P> powerOfTwoBelow(vecType<T, P> const & value); - - /// Return the power of two number which value is the closet to the input value. - /// Deprecated, use roundPowerOfTwo from GTC_round instead - /// - /// @see gtc_round - /// @see gtx_bit - template <typename genIUType> - GLM_DEPRECATED GLM_FUNC_DECL genIUType powerOfTwoNearest(genIUType Value); - - /// Return the power of two number which value is the closet to the input value. - /// Deprecated, use roundPowerOfTwo from GTC_round instead - /// - /// @see gtc_round - /// @see gtx_bit - template <typename T, precision P, template <typename, precision> class vecType> - GLM_DEPRECATED GLM_FUNC_DECL vecType<T, P> powerOfTwoNearest(vecType<T, P> const & value); - - /// @} -} //namespace glm - - -#include "bit.inl" - diff --git a/extensions/common/glm/gtx/bit.inl b/extensions/common/glm/gtx/bit.inl deleted file mode 100644 index 5178a123e28..00000000000 --- a/extensions/common/glm/gtx/bit.inl +++ /dev/null @@ -1,107 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_bit -/// @file glm/gtx/bit.inl -/// @date 2014-11-25 / 2014-11-25 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - /////////////////// - // highestBitValue - - template <typename genIUType> - GLM_FUNC_QUALIFIER genIUType highestBitValue(genIUType Value) - { - genIUType tmp = Value; - genIUType result = genIUType(0); - while(tmp) - { - result = (tmp & (~tmp + 1)); // grab lowest bit - tmp &= ~result; // clear lowest bit - } - return result; - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> highestBitValue(vecType<T, P> const & v) - { - return detail::functor1<T, T, P, vecType>::call(highestBitValue, v); - } - - /////////////////// - // powerOfTwoAbove - - template <typename genType> - GLM_FUNC_QUALIFIER genType powerOfTwoAbove(genType value) - { - return isPowerOfTwo(value) ? value : highestBitValue(value) << 1; - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> powerOfTwoAbove(vecType<T, P> const & v) - { - return detail::functor1<T, T, P, vecType>::call(powerOfTwoAbove, v); - } - - /////////////////// - // powerOfTwoBelow - - template <typename genType> - GLM_FUNC_QUALIFIER genType powerOfTwoBelow(genType value) - { - return isPowerOfTwo(value) ? value : highestBitValue(value); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> powerOfTwoBelow(vecType<T, P> const & v) - { - return detail::functor1<T, T, P, vecType>::call(powerOfTwoBelow, v); - } - - ///////////////////// - // powerOfTwoNearest - - template <typename genType> - GLM_FUNC_QUALIFIER genType powerOfTwoNearest(genType value) - { - if(isPowerOfTwo(value)) - return value; - - genType const prev = highestBitValue(value); - genType const next = prev << 1; - return (next - value) < (value - prev) ? next : prev; - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> powerOfTwoNearest(vecType<T, P> const & v) - { - return detail::functor1<T, T, P, vecType>::call(powerOfTwoNearest, v); - } - -}//namespace glm diff --git a/extensions/common/glm/gtx/closest_point.hpp b/extensions/common/glm/gtx/closest_point.hpp deleted file mode 100644 index 3a6523cf217..00000000000 --- a/extensions/common/glm/gtx/closest_point.hpp +++ /dev/null @@ -1,74 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_closest_point -/// @file glm/gtx/closest_point.hpp -/// @date 2005-12-30 / 2011-06-07 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// -/// @defgroup gtx_closest_point GLM_GTX_closest_point -/// @ingroup gtx -/// -/// @brief Find the point on a straight line which is the closet of a point. -/// -/// <glm/gtx/closest_point.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependency: -#include "../glm.hpp" - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTX_closest_point extension included") -#endif - -namespace glm -{ - /// @addtogroup gtx_closest_point - /// @{ - - /// Find the point on a straight line which is the closet of a point. - /// @see gtx_closest_point - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> closestPointOnLine( - tvec3<T, P> const & point, - tvec3<T, P> const & a, - tvec3<T, P> const & b); - - /// 2d lines work as well - template <typename T, precision P> - GLM_FUNC_DECL tvec2<T, P> closestPointOnLine( - tvec2<T, P> const & point, - tvec2<T, P> const & a, - tvec2<T, P> const & b); - - /// @} -}// namespace glm - -#include "closest_point.inl" diff --git a/extensions/common/glm/gtx/closest_point.inl b/extensions/common/glm/gtx/closest_point.inl deleted file mode 100644 index 89bb1a88ebf..00000000000 --- a/extensions/common/glm/gtx/closest_point.inl +++ /dev/null @@ -1,75 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_closest_point -/// @file glm/gtx/closest_point.inl -/// @date 2005-12-30 / 2011-06-07 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> closestPointOnLine - ( - tvec3<T, P> const & point, - tvec3<T, P> const & a, - tvec3<T, P> const & b - ) - { - T LineLength = distance(a, b); - tvec3<T, P> Vector = point - a; - tvec3<T, P> LineDirection = (b - a) / LineLength; - - // Project Vector to LineDirection to get the distance of point from a - T Distance = dot(Vector, LineDirection); - - if(Distance <= T(0)) return a; - if(Distance >= LineLength) return b; - return a + LineDirection * Distance; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> closestPointOnLine - ( - tvec2<T, P> const & point, - tvec2<T, P> const & a, - tvec2<T, P> const & b - ) - { - T LineLength = distance(a, b); - tvec2<T, P> Vector = point - a; - tvec2<T, P> LineDirection = (b - a) / LineLength; - - // Project Vector to LineDirection to get the distance of point from a - T Distance = dot(Vector, LineDirection); - - if(Distance <= T(0)) return a; - if(Distance >= LineLength) return b; - return a + LineDirection * Distance; - } - -}//namespace glm diff --git a/extensions/common/glm/gtx/color_space.hpp b/extensions/common/glm/gtx/color_space.hpp deleted file mode 100644 index befcd145151..00000000000 --- a/extensions/common/glm/gtx/color_space.hpp +++ /dev/null @@ -1,97 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_color_space -/// @file glm/gtx/color_space.hpp -/// @date 2005-12-21 / 2011-06-07 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// -/// @defgroup gtx_color_space GLM_GTX_color_space -/// @ingroup gtx -/// -/// @brief Related to RGB to HSV conversions and operations. -/// -/// <glm/gtx/color_space.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependency: -#include "../glm.hpp" - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTX_color_space extension included") -#endif - -namespace glm -{ - /// @addtogroup gtx_color_space - /// @{ - - /// Converts a color from HSV color space to its color in RGB color space. - /// @see gtx_color_space - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> rgbColor( - tvec3<T, P> const & hsvValue); - - /// Converts a color from RGB color space to its color in HSV color space. - /// @see gtx_color_space - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> hsvColor( - tvec3<T, P> const & rgbValue); - - /// Build a saturation matrix. - /// @see gtx_color_space - template <typename T> - GLM_FUNC_DECL tmat4x4<T, defaultp> saturation( - T const s); - - /// Modify the saturation of a color. - /// @see gtx_color_space - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> saturation( - T const s, - tvec3<T, P> const & color); - - /// Modify the saturation of a color. - /// @see gtx_color_space - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> saturation( - T const s, - tvec4<T, P> const & color); - - /// Compute color luminosity associating ratios (0.33, 0.59, 0.11) to RGB canals. - /// @see gtx_color_space - template <typename T, precision P> - GLM_FUNC_DECL T luminosity( - tvec3<T, P> const & color); - - /// @} -}//namespace glm - -#include "color_space.inl" diff --git a/extensions/common/glm/gtx/color_space.inl b/extensions/common/glm/gtx/color_space.inl deleted file mode 100644 index 76333b76696..00000000000 --- a/extensions/common/glm/gtx/color_space.inl +++ /dev/null @@ -1,172 +0,0 @@ -///////////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_color_space -/// @file glm/gtx/color_space.inl -/// @date 2005-12-21 / 2011-06-07 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> rgbColor(const tvec3<T, P>& hsvColor) - { - tvec3<T, P> hsv = hsvColor; - tvec3<T, P> rgbColor; - - if(hsv.y == static_cast<T>(0)) - // achromatic (grey) - rgbColor = tvec3<T, P>(hsv.z); - else - { - T sector = floor(hsv.x / T(60)); - T frac = (hsv.x / T(60)) - sector; - // factorial part of h - T o = hsv.z * (T(1) - hsv.y); - T p = hsv.z * (T(1) - hsv.y * frac); - T q = hsv.z * (T(1) - hsv.y * (T(1) - frac)); - - switch(int(sector)) - { - default: - case 0: - rgbColor.r = hsv.z; - rgbColor.g = q; - rgbColor.b = o; - break; - case 1: - rgbColor.r = p; - rgbColor.g = hsv.z; - rgbColor.b = o; - break; - case 2: - rgbColor.r = o; - rgbColor.g = hsv.z; - rgbColor.b = q; - break; - case 3: - rgbColor.r = o; - rgbColor.g = p; - rgbColor.b = hsv.z; - break; - case 4: - rgbColor.r = q; - rgbColor.g = o; - rgbColor.b = hsv.z; - break; - case 5: - rgbColor.r = hsv.z; - rgbColor.g = o; - rgbColor.b = p; - break; - } - } - - return rgbColor; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> hsvColor(const tvec3<T, P>& rgbColor) - { - tvec3<T, P> hsv = rgbColor; - float Min = min(min(rgbColor.r, rgbColor.g), rgbColor.b); - float Max = max(max(rgbColor.r, rgbColor.g), rgbColor.b); - float Delta = Max - Min; - - hsv.z = Max; - - if(Max != static_cast<T>(0)) - { - hsv.y = Delta / hsv.z; - T h = static_cast<T>(0); - - if(rgbColor.r == Max) - // between yellow & magenta - h = static_cast<T>(0) + T(60) * (rgbColor.g - rgbColor.b) / Delta; - else if(rgbColor.g == Max) - // between cyan & yellow - h = static_cast<T>(120) + T(60) * (rgbColor.b - rgbColor.r) / Delta; - else - // between magenta & cyan - h = static_cast<T>(240) + T(60) * (rgbColor.r - rgbColor.g) / Delta; - - if(h < T(0)) - hsv.x = h + T(360); - else - hsv.x = h; - } - else - { - // If r = g = b = 0 then s = 0, h is undefined - hsv.y = static_cast<T>(0); - hsv.x = static_cast<T>(0); - } - - return hsv; - } - - template <typename T> - GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> saturation(T const s) - { - tvec3<T, defaultp> rgbw = tvec3<T, defaultp>(T(0.2126), T(0.7152), T(0.0722)); - - T col0 = (T(1) - s) * rgbw.r; - T col1 = (T(1) - s) * rgbw.g; - T col2 = (T(1) - s) * rgbw.b; - - tmat4x4<T, defaultp> result(T(1)); - result[0][0] = col0 + s; - result[0][1] = col0; - result[0][2] = col0; - result[1][0] = col1; - result[1][1] = col1 + s; - result[1][2] = col1; - result[2][0] = col2; - result[2][1] = col2; - result[2][2] = col2 + s; - return result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> saturation(const T s, const tvec3<T, P>& color) - { - return tvec3<T, P>(saturation(s) * tvec4<T, P>(color, T(0))); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> saturation(const T s, const tvec4<T, P>& color) - { - return saturation(s) * color; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER T luminosity(const tvec3<T, P>& color) - { - const tvec3<T, P> tmp = tvec3<T, P>(0.33, 0.59, 0.11); - return dot(color, tmp); - } -}//namespace glm diff --git a/extensions/common/glm/gtx/color_space_YCoCg.hpp b/extensions/common/glm/gtx/color_space_YCoCg.hpp deleted file mode 100644 index 0f29248d119..00000000000 --- a/extensions/common/glm/gtx/color_space_YCoCg.hpp +++ /dev/null @@ -1,85 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_color_space_YCoCg -/// @file glm/gtx/color_space_YCoCg.hpp -/// @date 2008-10-28 / 2011-06-07 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// -/// @defgroup gtx_color_space_YCoCg GLM_GTX_color_space_YCoCg -/// @ingroup gtx -/// -/// @brief RGB to YCoCg conversions and operations -/// -/// <glm/gtx/color_space_YCoCg.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependency: -#include "../glm.hpp" - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTX_color_space_YCoCg extension included") -#endif - -namespace glm -{ - /// @addtogroup gtx_color_space_YCoCg - /// @{ - - /// Convert a color from RGB color space to YCoCg color space. - /// @see gtx_color_space_YCoCg - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> rgb2YCoCg( - tvec3<T, P> const & rgbColor); - - /// Convert a color from YCoCg color space to RGB color space. - /// @see gtx_color_space_YCoCg - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> YCoCg2rgb( - tvec3<T, P> const & YCoCgColor); - - /// Convert a color from RGB color space to YCoCgR color space. - /// @see "YCoCg-R: A Color Space with RGB Reversibility and Low Dynamic Range" - /// @see gtx_color_space_YCoCg - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> rgb2YCoCgR( - tvec3<T, P> const & rgbColor); - - /// Convert a color from YCoCgR color space to RGB color space. - /// @see "YCoCg-R: A Color Space with RGB Reversibility and Low Dynamic Range" - /// @see gtx_color_space_YCoCg - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> YCoCgR2rgb( - tvec3<T, P> const & YCoCgColor); - - /// @} -}//namespace glm - -#include "color_space_YCoCg.inl" diff --git a/extensions/common/glm/gtx/color_space_YCoCg.inl b/extensions/common/glm/gtx/color_space_YCoCg.inl deleted file mode 100644 index caf88221af5..00000000000 --- a/extensions/common/glm/gtx/color_space_YCoCg.inl +++ /dev/null @@ -1,87 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_color_space_YCoCg -/// @file glm/gtx/color_space_YCoCg.inl -/// @date 2008-10-28 / 2011-06-07 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> rgb2YCoCg - ( - tvec3<T, P> const & rgbColor - ) - { - tvec3<T, P> result; - result.x/*Y */ = rgbColor.r / T(4) + rgbColor.g / T(2) + rgbColor.b / T(4); - result.y/*Co*/ = rgbColor.r / T(2) + rgbColor.g * T(0) - rgbColor.b / T(2); - result.z/*Cg*/ = - rgbColor.r / T(4) + rgbColor.g / T(2) - rgbColor.b / T(4); - return result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> rgb2YCoCgR - ( - tvec3<T, P> const & rgbColor - ) - { - tvec3<T, P> result; - result.x/*Y */ = rgbColor.g / T(2) + (rgbColor.r + rgbColor.b) / T(4); - result.y/*Co*/ = rgbColor.r - rgbColor.b; - result.z/*Cg*/ = rgbColor.g - (rgbColor.r + rgbColor.b) / T(2); - return result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> YCoCg2rgb - ( - tvec3<T, P> const & YCoCgColor - ) - { - tvec3<T, P> result; - result.r = YCoCgColor.x + YCoCgColor.y - YCoCgColor.z; - result.g = YCoCgColor.x + YCoCgColor.z; - result.b = YCoCgColor.x - YCoCgColor.y - YCoCgColor.z; - return result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> YCoCgR2rgb - ( - tvec3<T, P> const & YCoCgRColor - ) - { - tvec3<T, P> result; - T tmp = YCoCgRColor.x - (YCoCgRColor.z / T(2)); - result.g = YCoCgRColor.z + tmp; - result.b = tmp - (YCoCgRColor.y / T(2)); - result.r = result.b + YCoCgRColor.y; - return result; - } -}//namespace glm diff --git a/extensions/common/glm/gtx/common.hpp b/extensions/common/glm/gtx/common.hpp deleted file mode 100644 index a4d0ffaf7b5..00000000000 --- a/extensions/common/glm/gtx/common.hpp +++ /dev/null @@ -1,74 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_common -/// @file glm/gtx/common.hpp -/// @date 2014-09-08 / 2014-09-08 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// @see gtc_half_float (dependence) -/// -/// @defgroup gtx_common GLM_GTX_common -/// @ingroup gtx -/// -/// @brief Provide functions to increase the compatibility with Cg and HLSL languages -/// -/// <glm/gtx/common.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependencies: -#include "../vec2.hpp" -#include "../vec3.hpp" -#include "../vec4.hpp" -#include "../gtc/vec1.hpp" - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTX_common extension included") -#endif - -namespace glm -{ - /// @addtogroup gtx_common - /// @{ - - /// Returns true if x is a denormalized number - /// Numbers whose absolute value is too small to be represented in the normal format are represented in an alternate, denormalized format. - /// This format is less precise but can represent values closer to zero. - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/isnan.xml">GLSL isnan man page</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> - template <typename genType> - GLM_FUNC_DECL typename genType::bool_type isdenormal(genType const & x); - - /// @} -}//namespace glm - -#include "common.inl" diff --git a/extensions/common/glm/gtx/common.inl b/extensions/common/glm/gtx/common.inl deleted file mode 100644 index 05e02d67611..00000000000 --- a/extensions/common/glm/gtx/common.inl +++ /dev/null @@ -1,102 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_common -/// @file glm/gtx/common.inl -/// @date 2014-09-08 / 2014-09-08 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#include <cmath> - -namespace glm -{ - template <typename T> - GLM_FUNC_QUALIFIER bool isdenormal(T const & x) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'isdenormal' only accept floating-point inputs"); - -# if GLM_HAS_CXX11_STL - return std::fpclassify(x) == FP_SUBNORMAL; -# else - return x != static_cast<T>(0) && std::fabs(x) < std::numeric_limits<T>::min(); -# endif - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tvec1<T, P>::bool_type isdenormal - ( - tvec1<T, P> const & x - ) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'isdenormal' only accept floating-point inputs"); - - return typename tvec1<T, P>::bool_type( - isdenormal(x.x)); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tvec2<T, P>::bool_type isdenormal - ( - tvec2<T, P> const & x - ) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'isdenormal' only accept floating-point inputs"); - - return typename tvec2<T, P>::bool_type( - isdenormal(x.x), - isdenormal(x.y)); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tvec3<T, P>::bool_type isdenormal - ( - tvec3<T, P> const & x - ) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'isdenormal' only accept floating-point inputs"); - - return typename tvec3<T, P>::bool_type( - isdenormal(x.x), - isdenormal(x.y), - isdenormal(x.z)); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tvec4<T, P>::bool_type isdenormal - ( - tvec4<T, P> const & x - ) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'isdenormal' only accept floating-point inputs"); - - return typename tvec4<T, P>::bool_type( - isdenormal(x.x), - isdenormal(x.y), - isdenormal(x.z), - isdenormal(x.w)); - } -}//namespace glm diff --git a/extensions/common/glm/gtx/compatibility.hpp b/extensions/common/glm/gtx/compatibility.hpp deleted file mode 100644 index 5281e3f7051..00000000000 --- a/extensions/common/glm/gtx/compatibility.hpp +++ /dev/null @@ -1,158 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_compatibility -/// @file glm/gtx/compatibility.hpp -/// @date 2007-01-24 / 2011-06-07 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// @see gtc_half_float (dependence) -/// -/// @defgroup gtx_compatibility GLM_GTX_compatibility -/// @ingroup gtx -/// -/// @brief Provide functions to increase the compatibility with Cg and HLSL languages -/// -/// <glm/gtx/compatibility.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependency: -#include "../glm.hpp" -#include "../gtc/quaternion.hpp" - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTX_compatibility extension included") -#endif - -#if(GLM_COMPILER & GLM_COMPILER_VC) -# include <cfloat> -#elif(GLM_COMPILER & GLM_COMPILER_GCC) -# include <cmath> -# if(GLM_PLATFORM & GLM_PLATFORM_ANDROID) -# undef isfinite -# endif -#endif//GLM_COMPILER - -namespace glm -{ - /// @addtogroup gtx_compatibility - /// @{ - - template <typename T> GLM_FUNC_QUALIFIER T lerp(T x, T y, T a){return mix(x, y, a);} //!< \brief Returns x * (1.0 - a) + y * a, i.e., the linear blend of x and y using the floating-point value a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility) - template <typename T, precision P> GLM_FUNC_QUALIFIER tvec2<T, P> lerp(const tvec2<T, P>& x, const tvec2<T, P>& y, T a){return mix(x, y, a);} //!< \brief Returns x * (1.0 - a) + y * a, i.e., the linear blend of x and y using the floating-point value a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility) - - template <typename T, precision P> GLM_FUNC_QUALIFIER tvec3<T, P> lerp(const tvec3<T, P>& x, const tvec3<T, P>& y, T a){return mix(x, y, a);} //!< \brief Returns x * (1.0 - a) + y * a, i.e., the linear blend of x and y using the floating-point value a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility) - template <typename T, precision P> GLM_FUNC_QUALIFIER tvec4<T, P> lerp(const tvec4<T, P>& x, const tvec4<T, P>& y, T a){return mix(x, y, a);} //!< \brief Returns x * (1.0 - a) + y * a, i.e., the linear blend of x and y using the floating-point value a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility) - template <typename T, precision P> GLM_FUNC_QUALIFIER tvec2<T, P> lerp(const tvec2<T, P>& x, const tvec2<T, P>& y, const tvec2<T, P>& a){return mix(x, y, a);} //!< \brief Returns the component-wise result of x * (1.0 - a) + y * a, i.e., the linear blend of x and y using vector a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility) - template <typename T, precision P> GLM_FUNC_QUALIFIER tvec3<T, P> lerp(const tvec3<T, P>& x, const tvec3<T, P>& y, const tvec3<T, P>& a){return mix(x, y, a);} //!< \brief Returns the component-wise result of x * (1.0 - a) + y * a, i.e., the linear blend of x and y using vector a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility) - template <typename T, precision P> GLM_FUNC_QUALIFIER tvec4<T, P> lerp(const tvec4<T, P>& x, const tvec4<T, P>& y, const tvec4<T, P>& a){return mix(x, y, a);} //!< \brief Returns the component-wise result of x * (1.0 - a) + y * a, i.e., the linear blend of x and y using vector a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility) - - template <typename T, precision P> GLM_FUNC_QUALIFIER T saturate(T x){return clamp(x, T(0), T(1));} //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility) - template <typename T, precision P> GLM_FUNC_QUALIFIER tvec2<T, P> saturate(const tvec2<T, P>& x){return clamp(x, T(0), T(1));} //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility) - template <typename T, precision P> GLM_FUNC_QUALIFIER tvec3<T, P> saturate(const tvec3<T, P>& x){return clamp(x, T(0), T(1));} //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility) - template <typename T, precision P> GLM_FUNC_QUALIFIER tvec4<T, P> saturate(const tvec4<T, P>& x){return clamp(x, T(0), T(1));} //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility) - - template <typename T, precision P> GLM_FUNC_QUALIFIER T atan2(T x, T y){return atan(x, y);} //!< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_compatibility) - template <typename T, precision P> GLM_FUNC_QUALIFIER tvec2<T, P> atan2(const tvec2<T, P>& x, const tvec2<T, P>& y){return atan(x, y);} //!< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_compatibility) - template <typename T, precision P> GLM_FUNC_QUALIFIER tvec3<T, P> atan2(const tvec3<T, P>& x, const tvec3<T, P>& y){return atan(x, y);} //!< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_compatibility) - template <typename T, precision P> GLM_FUNC_QUALIFIER tvec4<T, P> atan2(const tvec4<T, P>& x, const tvec4<T, P>& y){return atan(x, y);} //!< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_compatibility) - - template <typename genType> GLM_FUNC_DECL bool isfinite(genType const & x); //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility) - template <typename T, precision P> GLM_FUNC_DECL tvec2<bool, P> isfinite(const tvec2<T, P>& x); //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility) - template <typename T, precision P> GLM_FUNC_DECL tvec3<bool, P> isfinite(const tvec3<T, P>& x); //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility) - template <typename T, precision P> GLM_FUNC_DECL tvec4<bool, P> isfinite(const tvec4<T, P>& x); //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility) - - typedef bool bool1; //!< \brief boolean type with 1 component. (From GLM_GTX_compatibility extension) - typedef tvec2<bool, highp> bool2; //!< \brief boolean type with 2 components. (From GLM_GTX_compatibility extension) - typedef tvec3<bool, highp> bool3; //!< \brief boolean type with 3 components. (From GLM_GTX_compatibility extension) - typedef tvec4<bool, highp> bool4; //!< \brief boolean type with 4 components. (From GLM_GTX_compatibility extension) - - typedef bool bool1x1; //!< \brief boolean matrix with 1 x 1 component. (From GLM_GTX_compatibility extension) - typedef tmat2x2<bool, highp> bool2x2; //!< \brief boolean matrix with 2 x 2 components. (From GLM_GTX_compatibility extension) - typedef tmat2x3<bool, highp> bool2x3; //!< \brief boolean matrix with 2 x 3 components. (From GLM_GTX_compatibility extension) - typedef tmat2x4<bool, highp> bool2x4; //!< \brief boolean matrix with 2 x 4 components. (From GLM_GTX_compatibility extension) - typedef tmat3x2<bool, highp> bool3x2; //!< \brief boolean matrix with 3 x 2 components. (From GLM_GTX_compatibility extension) - typedef tmat3x3<bool, highp> bool3x3; //!< \brief boolean matrix with 3 x 3 components. (From GLM_GTX_compatibility extension) - typedef tmat3x4<bool, highp> bool3x4; //!< \brief boolean matrix with 3 x 4 components. (From GLM_GTX_compatibility extension) - typedef tmat4x2<bool, highp> bool4x2; //!< \brief boolean matrix with 4 x 2 components. (From GLM_GTX_compatibility extension) - typedef tmat4x3<bool, highp> bool4x3; //!< \brief boolean matrix with 4 x 3 components. (From GLM_GTX_compatibility extension) - typedef tmat4x4<bool, highp> bool4x4; //!< \brief boolean matrix with 4 x 4 components. (From GLM_GTX_compatibility extension) - - typedef int int1; //!< \brief integer vector with 1 component. (From GLM_GTX_compatibility extension) - typedef tvec2<int, highp> int2; //!< \brief integer vector with 2 components. (From GLM_GTX_compatibility extension) - typedef tvec3<int, highp> int3; //!< \brief integer vector with 3 components. (From GLM_GTX_compatibility extension) - typedef tvec4<int, highp> int4; //!< \brief integer vector with 4 components. (From GLM_GTX_compatibility extension) - - typedef int int1x1; //!< \brief integer matrix with 1 component. (From GLM_GTX_compatibility extension) - typedef tmat2x2<int, highp> int2x2; //!< \brief integer matrix with 2 x 2 components. (From GLM_GTX_compatibility extension) - typedef tmat2x3<int, highp> int2x3; //!< \brief integer matrix with 2 x 3 components. (From GLM_GTX_compatibility extension) - typedef tmat2x4<int, highp> int2x4; //!< \brief integer matrix with 2 x 4 components. (From GLM_GTX_compatibility extension) - typedef tmat3x2<int, highp> int3x2; //!< \brief integer matrix with 3 x 2 components. (From GLM_GTX_compatibility extension) - typedef tmat3x3<int, highp> int3x3; //!< \brief integer matrix with 3 x 3 components. (From GLM_GTX_compatibility extension) - typedef tmat3x4<int, highp> int3x4; //!< \brief integer matrix with 3 x 4 components. (From GLM_GTX_compatibility extension) - typedef tmat4x2<int, highp> int4x2; //!< \brief integer matrix with 4 x 2 components. (From GLM_GTX_compatibility extension) - typedef tmat4x3<int, highp> int4x3; //!< \brief integer matrix with 4 x 3 components. (From GLM_GTX_compatibility extension) - typedef tmat4x4<int, highp> int4x4; //!< \brief integer matrix with 4 x 4 components. (From GLM_GTX_compatibility extension) - - typedef float float1; //!< \brief single-precision floating-point vector with 1 component. (From GLM_GTX_compatibility extension) - typedef tvec2<float, highp> float2; //!< \brief single-precision floating-point vector with 2 components. (From GLM_GTX_compatibility extension) - typedef tvec3<float, highp> float3; //!< \brief single-precision floating-point vector with 3 components. (From GLM_GTX_compatibility extension) - typedef tvec4<float, highp> float4; //!< \brief single-precision floating-point vector with 4 components. (From GLM_GTX_compatibility extension) - - typedef float float1x1; //!< \brief single-precision floating-point matrix with 1 component. (From GLM_GTX_compatibility extension) - typedef tmat2x2<float, highp> float2x2; //!< \brief single-precision floating-point matrix with 2 x 2 components. (From GLM_GTX_compatibility extension) - typedef tmat2x3<float, highp> float2x3; //!< \brief single-precision floating-point matrix with 2 x 3 components. (From GLM_GTX_compatibility extension) - typedef tmat2x4<float, highp> float2x4; //!< \brief single-precision floating-point matrix with 2 x 4 components. (From GLM_GTX_compatibility extension) - typedef tmat3x2<float, highp> float3x2; //!< \brief single-precision floating-point matrix with 3 x 2 components. (From GLM_GTX_compatibility extension) - typedef tmat3x3<float, highp> float3x3; //!< \brief single-precision floating-point matrix with 3 x 3 components. (From GLM_GTX_compatibility extension) - typedef tmat3x4<float, highp> float3x4; //!< \brief single-precision floating-point matrix with 3 x 4 components. (From GLM_GTX_compatibility extension) - typedef tmat4x2<float, highp> float4x2; //!< \brief single-precision floating-point matrix with 4 x 2 components. (From GLM_GTX_compatibility extension) - typedef tmat4x3<float, highp> float4x3; //!< \brief single-precision floating-point matrix with 4 x 3 components. (From GLM_GTX_compatibility extension) - typedef tmat4x4<float, highp> float4x4; //!< \brief single-precision floating-point matrix with 4 x 4 components. (From GLM_GTX_compatibility extension) - - typedef double double1; //!< \brief double-precision floating-point vector with 1 component. (From GLM_GTX_compatibility extension) - typedef tvec2<double, highp> double2; //!< \brief double-precision floating-point vector with 2 components. (From GLM_GTX_compatibility extension) - typedef tvec3<double, highp> double3; //!< \brief double-precision floating-point vector with 3 components. (From GLM_GTX_compatibility extension) - typedef tvec4<double, highp> double4; //!< \brief double-precision floating-point vector with 4 components. (From GLM_GTX_compatibility extension) - - typedef double double1x1; //!< \brief double-precision floating-point matrix with 1 component. (From GLM_GTX_compatibility extension) - typedef tmat2x2<double, highp> double2x2; //!< \brief double-precision floating-point matrix with 2 x 2 components. (From GLM_GTX_compatibility extension) - typedef tmat2x3<double, highp> double2x3; //!< \brief double-precision floating-point matrix with 2 x 3 components. (From GLM_GTX_compatibility extension) - typedef tmat2x4<double, highp> double2x4; //!< \brief double-precision floating-point matrix with 2 x 4 components. (From GLM_GTX_compatibility extension) - typedef tmat3x2<double, highp> double3x2; //!< \brief double-precision floating-point matrix with 3 x 2 components. (From GLM_GTX_compatibility extension) - typedef tmat3x3<double, highp> double3x3; //!< \brief double-precision floating-point matrix with 3 x 3 components. (From GLM_GTX_compatibility extension) - typedef tmat3x4<double, highp> double3x4; //!< \brief double-precision floating-point matrix with 3 x 4 components. (From GLM_GTX_compatibility extension) - typedef tmat4x2<double, highp> double4x2; //!< \brief double-precision floating-point matrix with 4 x 2 components. (From GLM_GTX_compatibility extension) - typedef tmat4x3<double, highp> double4x3; //!< \brief double-precision floating-point matrix with 4 x 3 components. (From GLM_GTX_compatibility extension) - typedef tmat4x4<double, highp> double4x4; //!< \brief double-precision floating-point matrix with 4 x 4 components. (From GLM_GTX_compatibility extension) - - /// @} -}//namespace glm - -#include "compatibility.inl" diff --git a/extensions/common/glm/gtx/compatibility.inl b/extensions/common/glm/gtx/compatibility.inl deleted file mode 100644 index decc26c2060..00000000000 --- a/extensions/common/glm/gtx/compatibility.inl +++ /dev/null @@ -1,83 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_compatibility -/// @file glm/gtx/compatibility.inl -/// @date 2007-01-24 / 2011-06-07 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#include <limits> - -namespace glm -{ - // isfinite - template <typename genType> - GLM_FUNC_QUALIFIER bool isfinite( - genType const & x) - { -# if GLM_HAS_CXX11_STL - return std::isfinite(x) != 0; -# elif GLM_COMPILER & GLM_COMPILER_VC - return _finite(x); -# elif GLM_COMPILER & GLM_COMPILER_GCC && GLM_PLATFORM & GLM_PLATFORM_ANDROID - return _isfinite(x) != 0; -# else - return x >= std::numeric_limits<genType>::min() && x <= std::numeric_limits<genType>::max(); -# endif - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<bool, P> isfinite( - tvec2<T, P> const & x) - { - return tvec2<bool, P>( - isfinite(x.x), - isfinite(x.y)); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<bool, P> isfinite( - tvec3<T, P> const & x) - { - return tvec3<bool, P>( - isfinite(x.x), - isfinite(x.y), - isfinite(x.z)); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<bool, P> isfinite( - tvec4<T, P> const & x) - { - return tvec4<bool, P>( - isfinite(x.x), - isfinite(x.y), - isfinite(x.z), - isfinite(x.w)); - } - -}//namespace glm diff --git a/extensions/common/glm/gtx/component_wise.hpp b/extensions/common/glm/gtx/component_wise.hpp deleted file mode 100644 index c2e1012dcec..00000000000 --- a/extensions/common/glm/gtx/component_wise.hpp +++ /dev/null @@ -1,84 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_component_wise -/// @file glm/gtx/component_wise.hpp -/// @date 2007-05-21 / 2011-06-07 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// -/// @defgroup gtx_component_wise GLM_GTX_component_wise -/// @ingroup gtx -/// -/// @brief Operations between components of a type -/// -/// <glm/gtx/component_wise.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependencies -#include "../detail/setup.hpp" -#include "../detail/precision.hpp" - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTX_component_wise extension included") -#endif - -namespace glm -{ - /// @addtogroup gtx_component_wise - /// @{ - - /// Add all vector components together. - /// @see gtx_component_wise - template <typename genType> - GLM_FUNC_DECL typename genType::value_type compAdd( - genType const & v); - - /// Multiply all vector components together. - /// @see gtx_component_wise - template <typename genType> - GLM_FUNC_DECL typename genType::value_type compMul( - genType const & v); - - /// Find the minimum value between single vector components. - /// @see gtx_component_wise - template <typename genType> - GLM_FUNC_DECL typename genType::value_type compMin( - genType const & v); - - /// Find the maximum value between single vector components. - /// @see gtx_component_wise - template <typename genType> - GLM_FUNC_DECL typename genType::value_type compMax( - genType const & v); - - /// @} -}//namespace glm - -#include "component_wise.inl" diff --git a/extensions/common/glm/gtx/component_wise.inl b/extensions/common/glm/gtx/component_wise.inl deleted file mode 100644 index f944faebf88..00000000000 --- a/extensions/common/glm/gtx/component_wise.inl +++ /dev/null @@ -1,70 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_component_wise -/// @file glm/gtx/component_wise.inl -/// @date 2007-05-21 / 2011-06-07 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER T compAdd(vecType<T, P> const & v) - { - T result(0); - for(detail::component_count_t i = 0; i < detail::component_count(v); ++i) - result += v[i]; - return result; - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER T compMul(vecType<T, P> const & v) - { - T result(1); - for(detail::component_count_t i = 0; i < detail::component_count(v); ++i) - result *= v[i]; - return result; - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER T compMin(vecType<T, P> const & v) - { - T result(v[0]); - for(detail::component_count_t i = 1; i < detail::component_count(v); ++i) - result = min(result, v[i]); - return result; - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER T compMax(vecType<T, P> const & v) - { - T result(v[0]); - for(detail::component_count_t i = 1; i < detail::component_count(v); ++i) - result = max(result, v[i]); - return result; - } -}//namespace glm diff --git a/extensions/common/glm/gtx/dual_quaternion.hpp b/extensions/common/glm/gtx/dual_quaternion.hpp deleted file mode 100644 index f467b75717b..00000000000 --- a/extensions/common/glm/gtx/dual_quaternion.hpp +++ /dev/null @@ -1,321 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_dual_quaternion -/// @file glm/gtx/dual_quaternion.hpp -/// @date 2013-02-10 / 2013-02-20 -/// @author Maksim Vorobiev (msomeone@gmail.com) -/// -/// @see core (dependence) -/// @see gtc_half_float (dependence) -/// @see gtc_constants (dependence) -/// @see gtc_quaternion (dependence) -/// -/// @defgroup gtx_dual_quaternion GLM_GTX_dual_quaternion -/// @ingroup gtx -/// -/// @brief Defines a templated dual-quaternion type and several dual-quaternion operations. -/// -/// <glm/gtx/dual_quaternion.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependency: -#include "../glm.hpp" -#include "../gtc/constants.hpp" -#include "../gtc/quaternion.hpp" - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTX_dual_quaternion extension included") -#endif - -namespace glm -{ - /// @addtogroup gtx_dual_quaternion - /// @{ - - template <typename T, precision P> - struct tdualquat - { - typedef T value_type; - typedef glm::tquat<T, P> part_type; - - public: - glm::tquat<T, P> real, dual; - - ////////////////////////////////////// - // Component accesses - -# ifdef GLM_FORCE_SIZE_FUNC - typedef size_t size_type; - /// Return the count of components of a dual quaternion - GLM_FUNC_DECL GLM_CONSTEXPR size_type size() const; - - GLM_FUNC_DECL part_type & operator[](size_type i); - GLM_FUNC_DECL part_type const & operator[](size_type i) const; -# else - typedef length_t length_type; - /// Return the count of components of a dual quaternion - GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const; - - GLM_FUNC_DECL part_type & operator[](length_type i); - GLM_FUNC_DECL part_type const & operator[](length_type i) const; -# endif//GLM_FORCE_SIZE_FUNC - - ////////////////////////////////////// - // Implicit basic constructors - - GLM_FUNC_DECL tdualquat(); - GLM_FUNC_DECL tdualquat(tdualquat<T, P> const & d); - template <precision Q> - GLM_FUNC_DECL tdualquat(tdualquat<T, Q> const & d); - - ////////////////////////////////////// - // Explicit basic constructors - - GLM_FUNC_DECL explicit tdualquat(ctor); - GLM_FUNC_DECL explicit tdualquat(tquat<T, P> const & real); - GLM_FUNC_DECL tdualquat(tquat<T, P> const & orientation, tvec3<T, P> const & translation); - GLM_FUNC_DECL tdualquat(tquat<T, P> const & real, tquat<T, P> const & dual); - - ////////////////////////////////////////////////////////////// - // tdualquat conversions - -# ifdef GLM_FORCE_EXPLICIT_CTOR - template <typename U, precision Q> - GLM_FUNC_DECL explicit tdualquat(tdualquat<U, Q> const & q); -# else - template <typename U, precision Q> - GLM_FUNC_DECL tdualquat(tdualquat<U, Q> const & q); -# endif - - GLM_FUNC_DECL explicit tdualquat(tmat2x4<T, P> const & holder_mat); - GLM_FUNC_DECL explicit tdualquat(tmat3x4<T, P> const & aug_mat); - - // Operators - GLM_FUNC_DECL tdualquat<T, P> & operator=(tdualquat<T, P> const & m); - - template <typename U> - GLM_FUNC_DECL tdualquat<T, P> & operator=(tdualquat<U, P> const & m); - template <typename U> - GLM_FUNC_DECL tdualquat<T, P> & operator*=(U s); - template <typename U> - GLM_FUNC_DECL tdualquat<T, P> & operator/=(U s); - }; - - template <typename T, precision P> - GLM_FUNC_DECL tquat<T, P> operator- ( - tquat<T, P> const & q); - - template <typename T, precision P> - GLM_FUNC_DECL tdualquat<T, P> operator+ ( - tdualquat<T, P> const & q, - tdualquat<T, P> const & p); - - template <typename T, precision P> - GLM_FUNC_DECL tdualquat<T, P> operator* ( - tdualquat<T, P> const & q, - tdualquat<T, P> const & p); - - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> operator* ( - tquat<T, P> const & q, - tvec3<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> operator* ( - tvec3<T, P> const & v, - tquat<T, P> const & q); - - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> operator* ( - tquat<T, P> const & q, - tvec4<T, P> const & v); - - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> operator* ( - tvec4<T, P> const & v, - tquat<T, P> const & q); - - template <typename T, precision P> - GLM_FUNC_DECL tdualquat<T, P> operator* ( - tdualquat<T, P> const & q, - T const & s); - - template <typename T, precision P> - GLM_FUNC_DECL tdualquat<T, P> operator* ( - T const & s, - tdualquat<T, P> const & q); - - template <typename T, precision P> - GLM_FUNC_DECL tdualquat<T, P> operator/ ( - tdualquat<T, P> const & q, - T const & s); - - /// Returns the normalized quaternion. - /// - /// @see gtx_dual_quaternion - template <typename T, precision P> - GLM_FUNC_DECL tdualquat<T, P> normalize( - tdualquat<T, P> const & q); - - /// Returns the linear interpolation of two dual quaternion. - /// - /// @see gtc_dual_quaternion - template <typename T, precision P> - GLM_FUNC_DECL tdualquat<T, P> lerp( - tdualquat<T, P> const & x, - tdualquat<T, P> const & y, - T const & a); - - /// Returns the q inverse. - /// - /// @see gtx_dual_quaternion - template <typename T, precision P> - GLM_FUNC_DECL tdualquat<T, P> inverse( - tdualquat<T, P> const & q); - - /// Converts a quaternion to a 2 * 4 matrix. - /// - /// @see gtx_dual_quaternion - template <typename T, precision P> - GLM_FUNC_DECL tmat2x4<T, P> mat2x4_cast( - tdualquat<T, P> const & x); - - /// Converts a quaternion to a 3 * 4 matrix. - /// - /// @see gtx_dual_quaternion - template <typename T, precision P> - GLM_FUNC_DECL tmat3x4<T, P> mat3x4_cast( - tdualquat<T, P> const & x); - - /// Converts a 2 * 4 matrix (matrix which holds real and dual parts) to a quaternion. - /// - /// @see gtx_dual_quaternion - template <typename T, precision P> - GLM_FUNC_DECL tdualquat<T, P> dualquat_cast( - tmat2x4<T, P> const & x); - - /// Converts a 3 * 4 matrix (augmented matrix rotation + translation) to a quaternion. - /// - /// @see gtx_dual_quaternion - template <typename T, precision P> - GLM_FUNC_DECL tdualquat<T, P> dualquat_cast( - tmat3x4<T, P> const & x); - - - /// Dual-quaternion of low single-precision floating-point numbers. - /// - /// @see gtx_dual_quaternion - typedef tdualquat<float, lowp> lowp_dualquat; - - /// Dual-quaternion of medium single-precision floating-point numbers. - /// - /// @see gtx_dual_quaternion - typedef tdualquat<float, mediump> mediump_dualquat; - - /// Dual-quaternion of high single-precision floating-point numbers. - /// - /// @see gtx_dual_quaternion - typedef tdualquat<float, highp> highp_dualquat; - - - /// Dual-quaternion of low single-precision floating-point numbers. - /// - /// @see gtx_dual_quaternion - typedef tdualquat<float, lowp> lowp_fdualquat; - - /// Dual-quaternion of medium single-precision floating-point numbers. - /// - /// @see gtx_dual_quaternion - typedef tdualquat<float, mediump> mediump_fdualquat; - - /// Dual-quaternion of high single-precision floating-point numbers. - /// - /// @see gtx_dual_quaternion - typedef tdualquat<float, highp> highp_fdualquat; - - - /// Dual-quaternion of low double-precision floating-point numbers. - /// - /// @see gtx_dual_quaternion - typedef tdualquat<double, lowp> lowp_ddualquat; - - /// Dual-quaternion of medium double-precision floating-point numbers. - /// - /// @see gtx_dual_quaternion - typedef tdualquat<double, mediump> mediump_ddualquat; - - /// Dual-quaternion of high double-precision floating-point numbers. - /// - /// @see gtx_dual_quaternion - typedef tdualquat<double, highp> highp_ddualquat; - - -#if(!defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT)) - /// Dual-quaternion of floating-point numbers. - /// - /// @see gtx_dual_quaternion - typedef highp_fdualquat dualquat; - - /// Dual-quaternion of single-precision floating-point numbers. - /// - /// @see gtx_dual_quaternion - typedef highp_fdualquat fdualquat; -#elif(defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT)) - typedef highp_fdualquat dualquat; - typedef highp_fdualquat fdualquat; -#elif(!defined(GLM_PRECISION_HIGHP_FLOAT) && defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT)) - typedef mediump_fdualquat dualquat; - typedef mediump_fdualquat fdualquat; -#elif(!defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && defined(GLM_PRECISION_LOWP_FLOAT)) - typedef lowp_fdualquat dualquat; - typedef lowp_fdualquat fdualquat; -#else -# error "GLM error: multiple default precision requested for single-precision floating-point types" -#endif - - -#if(!defined(GLM_PRECISION_HIGHP_DOUBLE) && !defined(GLM_PRECISION_MEDIUMP_DOUBLE) && !defined(GLM_PRECISION_LOWP_DOUBLE)) - /// Dual-quaternion of default double-precision floating-point numbers. - /// - /// @see gtx_dual_quaternion - typedef highp_ddualquat ddualquat; -#elif(defined(GLM_PRECISION_HIGHP_DOUBLE) && !defined(GLM_PRECISION_MEDIUMP_DOUBLE) && !defined(GLM_PRECISION_LOWP_DOUBLE)) - typedef highp_ddualquat ddualquat; -#elif(!defined(GLM_PRECISION_HIGHP_DOUBLE) && defined(GLM_PRECISION_MEDIUMP_DOUBLE) && !defined(GLM_PRECISION_LOWP_DOUBLE)) - typedef mediump_ddualquat ddualquat; -#elif(!defined(GLM_PRECISION_HIGHP_DOUBLE) && !defined(GLM_PRECISION_MEDIUMP_DOUBLE) && defined(GLM_PRECISION_LOWP_DOUBLE)) - typedef lowp_ddualquat ddualquat; -#else -# error "GLM error: Multiple default precision requested for double-precision floating-point types" -#endif - - /// @} -} //namespace glm - -#include "dual_quaternion.inl" diff --git a/extensions/common/glm/gtx/dual_quaternion.inl b/extensions/common/glm/gtx/dual_quaternion.inl deleted file mode 100644 index 8fed0855495..00000000000 --- a/extensions/common/glm/gtx/dual_quaternion.inl +++ /dev/null @@ -1,400 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_dual_quaternion -/// @file glm/gtx/dual_quaternion.inl -/// @date 2013-02-10 / 2013-02-13 -/// @author Maksim Vorobiev (msomeone@gmail.com) -/////////////////////////////////////////////////////////////////////////////////// - -#include "../geometric.hpp" -#include <limits> - -namespace glm -{ - ////////////////////////////////////// - // Component accesses - -# ifdef GLM_FORCE_SIZE_FUNC - template <typename T, precision P> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tdualquat<T, P>::size_type tdualquat<T, P>::size() const - { - return 2; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tdualquat<T, P>::part_type & tdualquat<T, P>::operator[](typename tdualquat<T, P>::size_type i) - { - assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this)); - return (&real)[i]; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tdualquat<T, P>::part_type const & tdualquat<T, P>::operator[](typename tdualquat<T, P>::size_type i) const - { - assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this)); - return (&real)[i]; - } -# else - template <typename T, precision P> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tdualquat<T, P>::length_type tdualquat<T, P>::length() const - { - return 2; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tdualquat<T, P>::part_type & tdualquat<T, P>::operator[](typename tdualquat<T, P>::length_type i) - { - assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this)); - return (&real)[i]; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER typename tdualquat<T, P>::part_type const & tdualquat<T, P>::operator[](typename tdualquat<T, P>::length_type i) const - { - assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this)); - return (&real)[i]; - } -# endif//GLM_FORCE_SIZE_FUNC - - ////////////////////////////////////// - // Implicit basic constructors - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tdualquat<T, P>::tdualquat() -# ifndef GLM_FORCE_NO_CTOR_INIT - : real(tquat<T, P>()) - , dual(tquat<T, P>(0, 0, 0, 0)) -# endif - {} - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tdualquat<T, P>::tdualquat(tdualquat<T, P> const & d) - : real(d.real) - , dual(d.dual) - {} - - template <typename T, precision P> - template <precision Q> - GLM_FUNC_QUALIFIER tdualquat<T, P>::tdualquat(tdualquat<T, Q> const & d) - : real(d.real) - , dual(d.dual) - {} - - ////////////////////////////////////// - // Explicit basic constructors - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tdualquat<T, P>::tdualquat(ctor) - {} - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tdualquat<T, P>::tdualquat(tquat<T, P> const & r) - : real(r), dual(tquat<T, P>(0, 0, 0, 0)) - {} - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tdualquat<T, P>::tdualquat(tquat<T, P> const & q, tvec3<T, P> const& p) - : real(q), dual( - T(-0.5) * ( p.x*q.x + p.y*q.y + p.z*q.z), - T(+0.5) * ( p.x*q.w + p.y*q.z - p.z*q.y), - T(+0.5) * (-p.x*q.z + p.y*q.w + p.z*q.x), - T(+0.5) * ( p.x*q.y - p.y*q.x + p.z*q.w)) - {} - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tdualquat<T, P>::tdualquat(tquat<T, P> const & r, tquat<T, P> const & d) - : real(r), dual(d) - {} - - ////////////////////////////////////////////////////////////// - // tdualquat conversions - - template <typename T, precision P> - template <typename U, precision Q> - GLM_FUNC_QUALIFIER tdualquat<T, P>::tdualquat(tdualquat<U, Q> const & q) - : real(q.real) - , dual(q.dual) - {} - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tdualquat<T, P>::tdualquat(tmat2x4<T, P> const & m) - { - *this = dualquat_cast(m); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tdualquat<T, P>::tdualquat(tmat3x4<T, P> const & m) - { - *this = dualquat_cast(m); - } - - ////////////////////////////////////////////////////////////// - // tdualquat operators - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tdualquat<T, P> & tdualquat<T, P>::operator=(tdualquat<T, P> const & q) - { - this->real = q.real; - this->dual = q.dual; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tdualquat<T, P> & tdualquat<T, P>::operator=(tdualquat<U, P> const & q) - { - this->real = q.real; - this->dual = q.dual; - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tdualquat<T, P> & tdualquat<T, P>::operator*=(U s) - { - this->real *= static_cast<T>(s); - this->dual *= static_cast<T>(s); - return *this; - } - - template <typename T, precision P> - template <typename U> - GLM_FUNC_QUALIFIER tdualquat<T, P> & tdualquat<T, P>::operator/=(U s) - { - this->real /= static_cast<T>(s); - this->dual /= static_cast<T>(s); - return *this; - } - - ////////////////////////////////////////////////////////////// - // tquat<valType> external operators - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tdualquat<T, P> operator-(tdualquat<T, P> const & q) - { - return tdualquat<T, P>(-q.real,-q.dual); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tdualquat<T, P> operator+(tdualquat<T, P> const & q, tdualquat<T, P> const & p) - { - return tdualquat<T, P>(q.real + p.real,q.dual + p.dual); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tdualquat<T, P> operator*(tdualquat<T, P> const & p, tdualquat<T, P> const & o) - { - return tdualquat<T, P>(p.real * o.real,p.real * o.dual + p.dual * o.real); - } - - // Transformation - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> operator*(tdualquat<T, P> const & q, tvec3<T, P> const & v) - { - tvec3<T, P> const real_v3(q.real.x,q.real.y,q.real.z); - tvec3<T, P> const dual_v3(q.dual.x,q.dual.y,q.dual.z); - return (cross(real_v3, cross(real_v3,v) + v * q.real.w + dual_v3) + dual_v3 * q.real.w - real_v3 * q.dual.w) * T(2) + v; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> operator*(tvec3<T, P> const & v, tdualquat<T, P> const & q) - { - return glm::inverse(q) * v; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> operator*(tdualquat<T, P> const & q, tvec4<T, P> const & v) - { - return tvec4<T, P>(q * tvec3<T, P>(v), v.w); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> operator*(tvec4<T, P> const & v, tdualquat<T, P> const & q) - { - return glm::inverse(q) * v; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tdualquat<T, P> operator*(tdualquat<T, P> const & q, T const & s) - { - return tdualquat<T, P>(q.real * s, q.dual * s); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tdualquat<T, P> operator*(T const & s, tdualquat<T, P> const & q) - { - return q * s; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tdualquat<T, P> operator/(tdualquat<T, P> const & q, T const & s) - { - return tdualquat<T, P>(q.real / s, q.dual / s); - } - - ////////////////////////////////////// - // Boolean operators - template <typename T, precision P> - GLM_FUNC_QUALIFIER bool operator==(tdualquat<T, P> const & q1, tdualquat<T, P> const & q2) - { - return (q1.real == q2.real) && (q1.dual == q2.dual); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER bool operator!=(tdualquat<T, P> const & q1, tdualquat<T, P> const & q2) - { - return (q1.real != q2.dual) || (q1.real != q2.dual); - } - - //////////////////////////////////////////////////////// - template <typename T, precision P> - GLM_FUNC_QUALIFIER tdualquat<T, P> normalize(tdualquat<T, P> const & q) - { - return q / length(q.real); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tdualquat<T, P> lerp(tdualquat<T, P> const & x, tdualquat<T, P> const & y, T const & a) - { - // Dual Quaternion Linear blend aka DLB: - // Lerp is only defined in [0, 1] - assert(a >= static_cast<T>(0)); - assert(a <= static_cast<T>(1)); - T const k = dot(x.real,y.real) < static_cast<T>(0) ? -a : a; - T const one(1); - return tdualquat<T, P>(x * (one - a) + y * k); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tdualquat<T, P> inverse(tdualquat<T, P> const & q) - { - const glm::tquat<T, P> real = conjugate(q.real); - const glm::tquat<T, P> dual = conjugate(q.dual); - return tdualquat<T, P>(real, dual + (real * (-2.0f * dot(real,dual)))); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x4<T, P> mat2x4_cast(tdualquat<T, P> const & x) - { - return tmat2x4<T, P>( x[0].x, x[0].y, x[0].z, x[0].w, x[1].x, x[1].y, x[1].z, x[1].w ); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x4<T, P> mat3x4_cast(tdualquat<T, P> const & x) - { - tquat<T, P> r = x.real / length2(x.real); - - tquat<T, P> const rr(r.w * x.real.w, r.x * x.real.x, r.y * x.real.y, r.z * x.real.z); - r *= static_cast<T>(2); - - T const xy = r.x * x.real.y; - T const xz = r.x * x.real.z; - T const yz = r.y * x.real.z; - T const wx = r.w * x.real.x; - T const wy = r.w * x.real.y; - T const wz = r.w * x.real.z; - - tvec4<T, P> const a( - rr.w + rr.x - rr.y - rr.z, - xy - wz, - xz + wy, - -(x.dual.w * r.x - x.dual.x * r.w + x.dual.y * r.z - x.dual.z * r.y)); - - tvec4<T, P> const b( - xy + wz, - rr.w + rr.y - rr.x - rr.z, - yz - wx, - -(x.dual.w * r.y - x.dual.x * r.z - x.dual.y * r.w + x.dual.z * r.x)); - - tvec4<T, P> const c( - xz - wy, - yz + wx, - rr.w + rr.z - rr.x - rr.y, - -(x.dual.w * r.z + x.dual.x * r.y - x.dual.y * r.x - x.dual.z * r.w)); - - return tmat3x4<T, P>(a, b, c); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tdualquat<T, P> dualquat_cast(tmat2x4<T, P> const & x) - { - return tdualquat<T, P>( - tquat<T, P>( x[0].w, x[0].x, x[0].y, x[0].z ), - tquat<T, P>( x[1].w, x[1].x, x[1].y, x[1].z )); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tdualquat<T, P> dualquat_cast(tmat3x4<T, P> const & x) - { - tquat<T, P> real(uninitialize); - - T const trace = x[0].x + x[1].y + x[2].z; - if(trace > static_cast<T>(0)) - { - T const r = sqrt(T(1) + trace); - T const invr = static_cast<T>(0.5) / r; - real.w = static_cast<T>(0.5) * r; - real.x = (x[2].y - x[1].z) * invr; - real.y = (x[0].z - x[2].x) * invr; - real.z = (x[1].x - x[0].y) * invr; - } - else if(x[0].x > x[1].y && x[0].x > x[2].z) - { - T const r = sqrt(T(1) + x[0].x - x[1].y - x[2].z); - T const invr = static_cast<T>(0.5) / r; - real.x = static_cast<T>(0.5)*r; - real.y = (x[1].x + x[0].y) * invr; - real.z = (x[0].z + x[2].x) * invr; - real.w = (x[2].y - x[1].z) * invr; - } - else if(x[1].y > x[2].z) - { - T const r = sqrt(T(1) + x[1].y - x[0].x - x[2].z); - T const invr = static_cast<T>(0.5) / r; - real.x = (x[1].x + x[0].y) * invr; - real.y = static_cast<T>(0.5) * r; - real.z = (x[2].y + x[1].z) * invr; - real.w = (x[0].z - x[2].x) * invr; - } - else - { - T const r = sqrt(T(1) + x[2].z - x[0].x - x[1].y); - T const invr = static_cast<T>(0.5) / r; - real.x = (x[0].z + x[2].x) * invr; - real.y = (x[2].y + x[1].z) * invr; - real.z = static_cast<T>(0.5) * r; - real.w = (x[1].x - x[0].y) * invr; - } - - tquat<T, P> dual(uninitialize); - dual.x = static_cast<T>(0.5) * ( x[0].w * real.w + x[1].w * real.z - x[2].w * real.y); - dual.y = static_cast<T>(0.5) * (-x[0].w * real.z + x[1].w * real.w + x[2].w * real.x); - dual.z = static_cast<T>(0.5) * ( x[0].w * real.y - x[1].w * real.x + x[2].w * real.w); - dual.w = -static_cast<T>(0.5) * ( x[0].w * real.x + x[1].w * real.y + x[2].w * real.z); - return tdualquat<T, P>(real, dual); - } -}//namespace glm diff --git a/extensions/common/glm/gtx/euler_angles.hpp b/extensions/common/glm/gtx/euler_angles.hpp deleted file mode 100644 index 3460a375709..00000000000 --- a/extensions/common/glm/gtx/euler_angles.hpp +++ /dev/null @@ -1,156 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_euler_angles -/// @file glm/gtx/euler_angles.hpp -/// @date 2005-12-21 / 2011-06-07 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// @see gtc_half_float (dependence) -/// -/// @defgroup gtx_euler_angles GLM_GTX_euler_angles -/// @ingroup gtx -/// -/// @brief Build matrices from Euler angles. -/// -/// <glm/gtx/euler_angles.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependency: -#include "../glm.hpp" - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTX_euler_angles extension included") -#endif - -namespace glm -{ - /// @addtogroup gtx_euler_angles - /// @{ - - /// Creates a 3D 4 * 4 homogeneous rotation matrix from an euler angle X. - /// @see gtx_euler_angles - template <typename T> - GLM_FUNC_DECL tmat4x4<T, defaultp> eulerAngleX( - T const & angleX); - - /// Creates a 3D 4 * 4 homogeneous rotation matrix from an euler angle Y. - /// @see gtx_euler_angles - template <typename T> - GLM_FUNC_DECL tmat4x4<T, defaultp> eulerAngleY( - T const & angleY); - - /// Creates a 3D 4 * 4 homogeneous rotation matrix from an euler angle Z. - /// @see gtx_euler_angles - template <typename T> - GLM_FUNC_DECL tmat4x4<T, defaultp> eulerAngleZ( - T const & angleZ); - - /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (X * Y). - /// @see gtx_euler_angles - template <typename T> - GLM_FUNC_DECL tmat4x4<T, defaultp> eulerAngleXY( - T const & angleX, - T const & angleY); - - /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * X). - /// @see gtx_euler_angles - template <typename T> - GLM_FUNC_DECL tmat4x4<T, defaultp> eulerAngleYX( - T const & angleY, - T const & angleX); - - /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (X * Z). - /// @see gtx_euler_angles - template <typename T> - GLM_FUNC_DECL tmat4x4<T, defaultp> eulerAngleXZ( - T const & angleX, - T const & angleZ); - - /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Z * X). - /// @see gtx_euler_angles - template <typename T> - GLM_FUNC_DECL tmat4x4<T, defaultp> eulerAngleZX( - T const & angle, - T const & angleX); - - /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * Z). - /// @see gtx_euler_angles - template <typename T> - GLM_FUNC_DECL tmat4x4<T, defaultp> eulerAngleYZ( - T const & angleY, - T const & angleZ); - - /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Z * Y). - /// @see gtx_euler_angles - template <typename T> - GLM_FUNC_DECL tmat4x4<T, defaultp> eulerAngleZY( - T const & angleZ, - T const & angleY); - - /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * X * Z). - /// @see gtx_euler_angles - template <typename T> - GLM_FUNC_DECL tmat4x4<T, defaultp> eulerAngleYXZ( - T const & yaw, - T const & pitch, - T const & roll); - - /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * X * Z). - /// @see gtx_euler_angles - template <typename T> - GLM_FUNC_DECL tmat4x4<T, defaultp> yawPitchRoll( - T const & yaw, - T const & pitch, - T const & roll); - - /// Creates a 2D 2 * 2 rotation matrix from an euler angle. - /// @see gtx_euler_angles - template <typename T> - GLM_FUNC_DECL tmat2x2<T, defaultp> orientate2(T const & angle); - - /// Creates a 2D 4 * 4 homogeneous rotation matrix from an euler angle. - /// @see gtx_euler_angles - template <typename T> - GLM_FUNC_DECL tmat3x3<T, defaultp> orientate3(T const & angle); - - /// Creates a 3D 3 * 3 rotation matrix from euler angles (Y * X * Z). - /// @see gtx_euler_angles - template <typename T, precision P> - GLM_FUNC_DECL tmat3x3<T, P> orientate3(tvec3<T, P> const & angles); - - /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * X * Z). - /// @see gtx_euler_angles - template <typename T, precision P> - GLM_FUNC_DECL tmat4x4<T, P> orientate4(tvec3<T, P> const & angles); - - /// @} -}//namespace glm - -#include "euler_angles.inl" diff --git a/extensions/common/glm/gtx/euler_angles.inl b/extensions/common/glm/gtx/euler_angles.inl deleted file mode 100644 index 77fea4257f5..00000000000 --- a/extensions/common/glm/gtx/euler_angles.inl +++ /dev/null @@ -1,287 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_euler_angles -/// @file glm/gtx/euler_angles.inl -/// @date 2005-12-21 / 2011-06-07 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template <typename T> - GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> eulerAngleX - ( - T const & angleX - ) - { - T cosX = glm::cos(angleX); - T sinX = glm::sin(angleX); - - return tmat4x4<T, defaultp>( - T(1), T(0), T(0), T(0), - T(0), cosX, sinX, T(0), - T(0),-sinX, cosX, T(0), - T(0), T(0), T(0), T(1)); - } - - template <typename T> - GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> eulerAngleY - ( - T const & angleY - ) - { - T cosY = glm::cos(angleY); - T sinY = glm::sin(angleY); - - return tmat4x4<T, defaultp>( - cosY, T(0), -sinY, T(0), - T(0), T(1), T(0), T(0), - sinY, T(0), cosY, T(0), - T(0), T(0), T(0), T(1)); - } - - template <typename T> - GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> eulerAngleZ - ( - T const & angleZ - ) - { - T cosZ = glm::cos(angleZ); - T sinZ = glm::sin(angleZ); - - return tmat4x4<T, defaultp>( - cosZ, sinZ, T(0), T(0), - -sinZ, cosZ, T(0), T(0), - T(0), T(0), T(1), T(0), - T(0), T(0), T(0), T(1)); - } - - template <typename T> - GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> eulerAngleXY - ( - T const & angleX, - T const & angleY - ) - { - T cosX = glm::cos(angleX); - T sinX = glm::sin(angleX); - T cosY = glm::cos(angleY); - T sinY = glm::sin(angleY); - - return tmat4x4<T, defaultp>( - cosY, -sinX * -sinY, cosX * -sinY, T(0), - T(0), cosX, sinX, T(0), - sinY, -sinX * cosY, cosX * cosY, T(0), - T(0), T(0), T(0), T(1)); - } - - template <typename T> - GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> eulerAngleYX - ( - T const & angleY, - T const & angleX - ) - { - T cosX = glm::cos(angleX); - T sinX = glm::sin(angleX); - T cosY = glm::cos(angleY); - T sinY = glm::sin(angleY); - - return tmat4x4<T, defaultp>( - cosY, 0, -sinY, T(0), - sinY * sinX, cosX, cosY * sinX, T(0), - sinY * cosX, -sinX, cosY * cosX, T(0), - T(0), T(0), T(0), T(1)); - } - - template <typename T> - GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> eulerAngleXZ - ( - T const & angleX, - T const & angleZ - ) - { - return eulerAngleX(angleX) * eulerAngleZ(angleZ); - } - - template <typename T> - GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> eulerAngleZX - ( - T const & angleZ, - T const & angleX - ) - { - return eulerAngleZ(angleZ) * eulerAngleX(angleX); - } - - template <typename T> - GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> eulerAngleYZ - ( - T const & angleY, - T const & angleZ - ) - { - return eulerAngleY(angleY) * eulerAngleZ(angleZ); - } - - template <typename T> - GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> eulerAngleZY - ( - T const & angleZ, - T const & angleY - ) - { - return eulerAngleZ(angleZ) * eulerAngleY(angleY); - } - - template <typename T> - GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> eulerAngleYXZ - ( - T const & yaw, - T const & pitch, - T const & roll - ) - { - T tmp_ch = glm::cos(yaw); - T tmp_sh = glm::sin(yaw); - T tmp_cp = glm::cos(pitch); - T tmp_sp = glm::sin(pitch); - T tmp_cb = glm::cos(roll); - T tmp_sb = glm::sin(roll); - - tmat4x4<T, defaultp> Result; - Result[0][0] = tmp_ch * tmp_cb + tmp_sh * tmp_sp * tmp_sb; - Result[0][1] = tmp_sb * tmp_cp; - Result[0][2] = -tmp_sh * tmp_cb + tmp_ch * tmp_sp * tmp_sb; - Result[0][3] = static_cast<T>(0); - Result[1][0] = -tmp_ch * tmp_sb + tmp_sh * tmp_sp * tmp_cb; - Result[1][1] = tmp_cb * tmp_cp; - Result[1][2] = tmp_sb * tmp_sh + tmp_ch * tmp_sp * tmp_cb; - Result[1][3] = static_cast<T>(0); - Result[2][0] = tmp_sh * tmp_cp; - Result[2][1] = -tmp_sp; - Result[2][2] = tmp_ch * tmp_cp; - Result[2][3] = static_cast<T>(0); - Result[3][0] = static_cast<T>(0); - Result[3][1] = static_cast<T>(0); - Result[3][2] = static_cast<T>(0); - Result[3][3] = static_cast<T>(1); - return Result; - } - - template <typename T> - GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> yawPitchRoll - ( - T const & yaw, - T const & pitch, - T const & roll - ) - { - T tmp_ch = glm::cos(yaw); - T tmp_sh = glm::sin(yaw); - T tmp_cp = glm::cos(pitch); - T tmp_sp = glm::sin(pitch); - T tmp_cb = glm::cos(roll); - T tmp_sb = glm::sin(roll); - - tmat4x4<T, defaultp> Result; - Result[0][0] = tmp_ch * tmp_cb + tmp_sh * tmp_sp * tmp_sb; - Result[0][1] = tmp_sb * tmp_cp; - Result[0][2] = -tmp_sh * tmp_cb + tmp_ch * tmp_sp * tmp_sb; - Result[0][3] = static_cast<T>(0); - Result[1][0] = -tmp_ch * tmp_sb + tmp_sh * tmp_sp * tmp_cb; - Result[1][1] = tmp_cb * tmp_cp; - Result[1][2] = tmp_sb * tmp_sh + tmp_ch * tmp_sp * tmp_cb; - Result[1][3] = static_cast<T>(0); - Result[2][0] = tmp_sh * tmp_cp; - Result[2][1] = -tmp_sp; - Result[2][2] = tmp_ch * tmp_cp; - Result[2][3] = static_cast<T>(0); - Result[3][0] = static_cast<T>(0); - Result[3][1] = static_cast<T>(0); - Result[3][2] = static_cast<T>(0); - Result[3][3] = static_cast<T>(1); - return Result; - } - - template <typename T> - GLM_FUNC_QUALIFIER tmat2x2<T, defaultp> orientate2 - ( - T const & angle - ) - { - T c = glm::cos(angle); - T s = glm::sin(angle); - - tmat2x2<T, defaultp> Result; - Result[0][0] = c; - Result[0][1] = s; - Result[1][0] = -s; - Result[1][1] = c; - return Result; - } - - template <typename T> - GLM_FUNC_QUALIFIER tmat3x3<T, defaultp> orientate3 - ( - T const & angle - ) - { - T c = glm::cos(angle); - T s = glm::sin(angle); - - tmat3x3<T, defaultp> Result; - Result[0][0] = c; - Result[0][1] = s; - Result[0][2] = 0.0f; - Result[1][0] = -s; - Result[1][1] = c; - Result[1][2] = 0.0f; - Result[2][0] = 0.0f; - Result[2][1] = 0.0f; - Result[2][2] = 1.0f; - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x3<T, P> orientate3 - ( - tvec3<T, P> const & angles - ) - { - return tmat3x3<T, P>(yawPitchRoll(angles.z, angles.x, angles.y)); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P> orientate4 - ( - tvec3<T, P> const & angles - ) - { - return yawPitchRoll(angles.z, angles.x, angles.y); - } -}//namespace glm diff --git a/extensions/common/glm/gtx/extend.hpp b/extensions/common/glm/gtx/extend.hpp deleted file mode 100644 index 0bc9bae6055..00000000000 --- a/extensions/common/glm/gtx/extend.hpp +++ /dev/null @@ -1,67 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_extend -/// @file glm/gtx/extend.hpp -/// @date 2006-01-07 / 2011-06-07 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// -/// @defgroup gtx_extend GLM_GTX_extend -/// @ingroup gtx -/// -/// @brief Extend a position from a source to a position at a defined length. -/// -/// <glm/gtx/extend.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependency: -#include "../glm.hpp" - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTX_extend extension included") -#endif - -namespace glm -{ - /// @addtogroup gtx_extend - /// @{ - - /// Extends of Length the Origin position using the (Source - Origin) direction. - /// @see gtx_extend - template <typename genType> - GLM_FUNC_DECL genType extend( - genType const & Origin, - genType const & Source, - typename genType::value_type const Length); - - /// @} -}//namespace glm - -#include "extend.inl" diff --git a/extensions/common/glm/gtx/extend.inl b/extensions/common/glm/gtx/extend.inl deleted file mode 100644 index c8768e262a7..00000000000 --- a/extensions/common/glm/gtx/extend.inl +++ /dev/null @@ -1,78 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_extend -/// @file glm/gtx/extend.inl -/// @date 2006-01-07 / 2011-06-07 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template <typename genType> - GLM_FUNC_QUALIFIER genType extend - ( - genType const & Origin, - genType const & Source, - genType const & Distance - ) - { - return Origin + (Source - Origin) * Distance; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> extend - ( - tvec2<T, P> const & Origin, - tvec2<T, P> const & Source, - T const & Distance - ) - { - return Origin + (Source - Origin) * Distance; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> extend - ( - tvec3<T, P> const & Origin, - tvec3<T, P> const & Source, - T const & Distance - ) - { - return Origin + (Source - Origin) * Distance; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> extend - ( - tvec4<T, P> const & Origin, - tvec4<T, P> const & Source, - T const & Distance - ) - { - return Origin + (Source - Origin) * Distance; - } -}//namespace glm diff --git a/extensions/common/glm/gtx/extented_min_max.hpp b/extensions/common/glm/gtx/extented_min_max.hpp deleted file mode 100644 index 95691636cbd..00000000000 --- a/extensions/common/glm/gtx/extented_min_max.hpp +++ /dev/null @@ -1,162 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_extented_min_max -/// @file glm/gtx/extented_min_max.hpp -/// @date 2007-03-14 / 2011-06-07 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// @see gtx_half_float (dependence) -/// -/// @defgroup gtx_extented_min_max GLM_GTX_extented_min_max -/// @ingroup gtx -/// -/// Min and max functions for 3 to 4 parameters. -/// -/// <glm/gtx/extented_min_max.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependency: -#include "../glm.hpp" - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTX_extented_min_max extension included") -#endif - -namespace glm -{ - /// @addtogroup gtx_extented_min_max - /// @{ - - /// Return the minimum component-wise values of 3 inputs - /// @see gtx_extented_min_max - template <typename T> - GLM_FUNC_DECL T min( - T const & x, - T const & y, - T const & z); - - /// Return the minimum component-wise values of 3 inputs - /// @see gtx_extented_min_max - template <typename T, template <typename> class C> - GLM_FUNC_DECL C<T> min( - C<T> const & x, - typename C<T>::T const & y, - typename C<T>::T const & z); - - /// Return the minimum component-wise values of 3 inputs - /// @see gtx_extented_min_max - template <typename T, template <typename> class C> - GLM_FUNC_DECL C<T> min( - C<T> const & x, - C<T> const & y, - C<T> const & z); - - /// Return the minimum component-wise values of 4 inputs - /// @see gtx_extented_min_max - template <typename T> - GLM_FUNC_DECL T min( - T const & x, - T const & y, - T const & z, - T const & w); - - /// Return the minimum component-wise values of 4 inputs - /// @see gtx_extented_min_max - template <typename T, template <typename> class C> - GLM_FUNC_DECL C<T> min( - C<T> const & x, - typename C<T>::T const & y, - typename C<T>::T const & z, - typename C<T>::T const & w); - - /// Return the minimum component-wise values of 4 inputs - /// @see gtx_extented_min_max - template <typename T, template <typename> class C> - GLM_FUNC_DECL C<T> min( - C<T> const & x, - C<T> const & y, - C<T> const & z, - C<T> const & w); - - /// Return the maximum component-wise values of 3 inputs - /// @see gtx_extented_min_max - template <typename T> - GLM_FUNC_DECL T max( - T const & x, - T const & y, - T const & z); - - /// Return the maximum component-wise values of 3 inputs - /// @see gtx_extented_min_max - template <typename T, template <typename> class C> - GLM_FUNC_DECL C<T> max( - C<T> const & x, - typename C<T>::T const & y, - typename C<T>::T const & z); - - /// Return the maximum component-wise values of 3 inputs - /// @see gtx_extented_min_max - template <typename T, template <typename> class C> - GLM_FUNC_DECL C<T> max( - C<T> const & x, - C<T> const & y, - C<T> const & z); - - /// Return the maximum component-wise values of 4 inputs - /// @see gtx_extented_min_max - template <typename T> - GLM_FUNC_DECL T max( - T const & x, - T const & y, - T const & z, - T const & w); - - /// Return the maximum component-wise values of 4 inputs - /// @see gtx_extented_min_max - template <typename T, template <typename> class C> - GLM_FUNC_DECL C<T> max( - C<T> const & x, - typename C<T>::T const & y, - typename C<T>::T const & z, - typename C<T>::T const & w); - - /// Return the maximum component-wise values of 4 inputs - /// @see gtx_extented_min_max - template <typename T, template <typename> class C> - GLM_FUNC_DECL C<T> max( - C<T> const & x, - C<T> const & y, - C<T> const & z, - C<T> const & w); - - /// @} -}//namespace glm - -#include "extented_min_max.inl" diff --git a/extensions/common/glm/gtx/extented_min_max.inl b/extensions/common/glm/gtx/extented_min_max.inl deleted file mode 100644 index e54c8479d7b..00000000000 --- a/extensions/common/glm/gtx/extented_min_max.inl +++ /dev/null @@ -1,169 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_extented_min_max -/// @file glm/gtx/extented_min_max.inl -/// @date 2007-03-14 / 2011-06-07 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template <typename T> - GLM_FUNC_QUALIFIER T min( - T const & x, - T const & y, - T const & z) - { - return glm::min(glm::min(x, y), z); - } - - template <typename T, template <typename> class C> - GLM_FUNC_QUALIFIER C<T> min - ( - C<T> const & x, - typename C<T>::T const & y, - typename C<T>::T const & z - ) - { - return glm::min(glm::min(x, y), z); - } - - template <typename T, template <typename> class C> - GLM_FUNC_QUALIFIER C<T> min - ( - C<T> const & x, - C<T> const & y, - C<T> const & z - ) - { - return glm::min(glm::min(x, y), z); - } - - template <typename T> - GLM_FUNC_QUALIFIER T min - ( - T const & x, - T const & y, - T const & z, - T const & w - ) - { - return glm::min(glm::min(x, y), glm::min(z, w)); - } - - template <typename T, template <typename> class C> - GLM_FUNC_QUALIFIER C<T> min - ( - C<T> const & x, - typename C<T>::T const & y, - typename C<T>::T const & z, - typename C<T>::T const & w - ) - { - return glm::min(glm::min(x, y), glm::min(z, w)); - } - - template <typename T, template <typename> class C> - GLM_FUNC_QUALIFIER C<T> min - ( - C<T> const & x, - C<T> const & y, - C<T> const & z, - C<T> const & w - ) - { - return glm::min(glm::min(x, y), glm::min(z, w)); - } - - template <typename T> - GLM_FUNC_QUALIFIER T max( - T const & x, - T const & y, - T const & z) - { - return glm::max(glm::max(x, y), z); - } - - template <typename T, template <typename> class C> - GLM_FUNC_QUALIFIER C<T> max - ( - C<T> const & x, - typename C<T>::T const & y, - typename C<T>::T const & z - ) - { - return glm::max(glm::max(x, y), z); - } - - template <typename T, template <typename> class C> - GLM_FUNC_QUALIFIER C<T> max - ( - C<T> const & x, - C<T> const & y, - C<T> const & z - ) - { - return glm::max(glm::max(x, y), z); - } - - template <typename T> - GLM_FUNC_QUALIFIER T max - ( - T const & x, - T const & y, - T const & z, - T const & w - ) - { - return glm::max(glm::max(x, y), glm::max(z, w)); - } - - template <typename T, template <typename> class C> - GLM_FUNC_QUALIFIER C<T> max - ( - C<T> const & x, - typename C<T>::T const & y, - typename C<T>::T const & z, - typename C<T>::T const & w - ) - { - return glm::max(glm::max(x, y), glm::max(z, w)); - } - - template <typename T, template <typename> class C> - GLM_FUNC_QUALIFIER C<T> max - ( - C<T> const & x, - C<T> const & y, - C<T> const & z, - C<T> const & w - ) - { - return glm::max(glm::max(x, y), glm::max(z, w)); - } - -}//namespace glm diff --git a/extensions/common/glm/gtx/fast_exponential.hpp b/extensions/common/glm/gtx/fast_exponential.hpp deleted file mode 100644 index 91cd445b6e1..00000000000 --- a/extensions/common/glm/gtx/fast_exponential.hpp +++ /dev/null @@ -1,120 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_fast_exponential -/// @file glm/gtx/fast_exponential.hpp -/// @date 2006-01-09 / 2011-06-07 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// @see gtx_half_float (dependence) -/// -/// @defgroup gtx_fast_exponential GLM_GTX_fast_exponential -/// @ingroup gtx -/// -/// @brief Fast but less accurate implementations of exponential based functions. -/// -/// <glm/gtx/fast_exponential.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependency: -#include "../glm.hpp" - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTX_fast_exponential extension included") -#endif - -namespace glm -{ - /// @addtogroup gtx_fast_exponential - /// @{ - - /// Faster than the common pow function but less accurate. - /// @see gtx_fast_exponential - template <typename genType> - GLM_FUNC_DECL genType fastPow(genType x, genType y); - - /// Faster than the common pow function but less accurate. - /// @see gtx_fast_exponential - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> fastPow(vecType<T, P> const & x, vecType<T, P> const & y); - - /// Faster than the common pow function but less accurate. - /// @see gtx_fast_exponential - template <typename genTypeT, typename genTypeU> - GLM_FUNC_DECL genTypeT fastPow(genTypeT x, genTypeU y); - - /// Faster than the common pow function but less accurate. - /// @see gtx_fast_exponential - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> fastPow(vecType<T, P> const & x); - - /// Faster than the common exp function but less accurate. - /// @see gtx_fast_exponential - template <typename T> - GLM_FUNC_DECL T fastExp(T x); - - /// Faster than the common exp function but less accurate. - /// @see gtx_fast_exponential - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> fastExp(vecType<T, P> const & x); - - /// Faster than the common log function but less accurate. - /// @see gtx_fast_exponential - template <typename T> - GLM_FUNC_DECL T fastLog(T x); - - /// Faster than the common exp2 function but less accurate. - /// @see gtx_fast_exponential - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> fastLog(vecType<T, P> const & x); - - /// Faster than the common exp2 function but less accurate. - /// @see gtx_fast_exponential - template <typename T> - GLM_FUNC_DECL T fastExp2(T x); - - /// Faster than the common exp2 function but less accurate. - /// @see gtx_fast_exponential - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> fastExp2(vecType<T, P> const & x); - - /// Faster than the common log2 function but less accurate. - /// @see gtx_fast_exponential - template <typename T> - GLM_FUNC_DECL T fastLog2(T x); - - /// Faster than the common log2 function but less accurate. - /// @see gtx_fast_exponential - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> fastLog2(vecType<T, P> const & x); - - /// @} -}//namespace glm - -#include "fast_exponential.inl" diff --git a/extensions/common/glm/gtx/fast_exponential.inl b/extensions/common/glm/gtx/fast_exponential.inl deleted file mode 100644 index 9cf882c2de9..00000000000 --- a/extensions/common/glm/gtx/fast_exponential.inl +++ /dev/null @@ -1,166 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_fast_exponential -/// @file glm/gtx/fast_exponential.inl -/// @date 2006-01-09 / 2011-06-07 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - // fastPow: - template <typename genType> - GLM_FUNC_QUALIFIER genType fastPow(genType x, genType y) - { - return exp(y * log(x)); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> fastPow(vecType<T, P> const & x, vecType<T, P> const & y) - { - return exp(y * log(x)); - } - - template <typename T> - GLM_FUNC_QUALIFIER T fastPow(T x, int y) - { - T f = static_cast<T>(1); - for(int i = 0; i < y; ++i) - f *= x; - return f; - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> fastPow(vecType<T, P> const & x, vecType<int, P> const & y) - { - vecType<T, P> Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(x); ++i) - Result[i] = fastPow(x[i], y[i]); - return Result; - } - - // fastExp - // Note: This function provides accurate results only for value between -1 and 1, else avoid it. - template <typename T> - GLM_FUNC_QUALIFIER T fastExp(T x) - { - // This has a better looking and same performance in release mode than the following code. However, in debug mode it's slower. - // return 1.0f + x * (1.0f + x * 0.5f * (1.0f + x * 0.3333333333f * (1.0f + x * 0.25 * (1.0f + x * 0.2f)))); - T x2 = x * x; - T x3 = x2 * x; - T x4 = x3 * x; - T x5 = x4 * x; - return T(1) + x + (x2 * T(0.5)) + (x3 * T(0.1666666667)) + (x4 * T(0.041666667)) + (x5 * T(0.008333333333)); - } - /* // Try to handle all values of float... but often shower than std::exp, glm::floor and the loop kill the performance - GLM_FUNC_QUALIFIER float fastExp(float x) - { - const float e = 2.718281828f; - const float IntegerPart = floor(x); - const float FloatPart = x - IntegerPart; - float z = 1.f; - - for(int i = 0; i < int(IntegerPart); ++i) - z *= e; - - const float x2 = FloatPart * FloatPart; - const float x3 = x2 * FloatPart; - const float x4 = x3 * FloatPart; - const float x5 = x4 * FloatPart; - return z * (1.0f + FloatPart + (x2 * 0.5f) + (x3 * 0.1666666667f) + (x4 * 0.041666667f) + (x5 * 0.008333333333f)); - } - - // Increase accuracy on number bigger that 1 and smaller than -1 but it's not enough for high and negative numbers - GLM_FUNC_QUALIFIER float fastExp(float x) - { - // This has a better looking and same performance in release mode than the following code. However, in debug mode it's slower. - // return 1.0f + x * (1.0f + x * 0.5f * (1.0f + x * 0.3333333333f * (1.0f + x * 0.25 * (1.0f + x * 0.2f)))); - float x2 = x * x; - float x3 = x2 * x; - float x4 = x3 * x; - float x5 = x4 * x; - float x6 = x5 * x; - float x7 = x6 * x; - float x8 = x7 * x; - return 1.0f + x + (x2 * 0.5f) + (x3 * 0.1666666667f) + (x4 * 0.041666667f) + (x5 * 0.008333333333f)+ (x6 * 0.00138888888888f) + (x7 * 0.000198412698f) + (x8 * 0.0000248015873f);; - } - */ - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> fastExp(vecType<T, P> const & x) - { - return detail::functor1<T, T, P, vecType>::call(fastExp, x); - } - - // fastLog - template <typename genType> - GLM_FUNC_QUALIFIER genType fastLog(genType x) - { - return std::log(x); - } - - /* Slower than the VC7.1 function... - GLM_FUNC_QUALIFIER float fastLog(float x) - { - float y1 = (x - 1.0f) / (x + 1.0f); - float y2 = y1 * y1; - return 2.0f * y1 * (1.0f + y2 * (0.3333333333f + y2 * (0.2f + y2 * 0.1428571429f))); - } - */ - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> fastLog(vecType<T, P> const & x) - { - return detail::functor1<T, T, P, vecType>::call(fastLog, x); - } - - //fastExp2, ln2 = 0.69314718055994530941723212145818f - template <typename genType> - GLM_FUNC_QUALIFIER genType fastExp2(genType x) - { - return fastExp(0.69314718055994530941723212145818f * x); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> fastExp2(vecType<T, P> const & x) - { - return detail::functor1<T, T, P, vecType>::call(fastExp2, x); - } - - // fastLog2, ln2 = 0.69314718055994530941723212145818f - template <typename genType> - GLM_FUNC_QUALIFIER genType fastLog2(genType x) - { - return fastLog(x) / 0.69314718055994530941723212145818f; - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> fastLog2(vecType<T, P> const & x) - { - return detail::functor1<T, T, P, vecType>::call(fastLog2, x); - } -}//namespace glm diff --git a/extensions/common/glm/gtx/fast_square_root.hpp b/extensions/common/glm/gtx/fast_square_root.hpp deleted file mode 100644 index 23044ea4c88..00000000000 --- a/extensions/common/glm/gtx/fast_square_root.hpp +++ /dev/null @@ -1,117 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_fast_square_root -/// @file glm/gtx/fast_square_root.hpp -/// @date 2006-01-04 / 2011-06-07 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// -/// @defgroup gtx_fast_square_root GLM_GTX_fast_square_root -/// @ingroup gtx -/// -/// @brief Fast but less accurate implementations of square root based functions. -/// - Sqrt optimisation based on Newton's method, -/// www.gamedev.net/community/forums/topic.asp?topic id=139956 -/// -/// <glm/gtx/fast_square_root.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependency: -#include "../common.hpp" -#include "../exponential.hpp" -#include "../geometric.hpp" - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTX_fast_square_root extension included") -#endif - -namespace glm -{ - /// @addtogroup gtx_fast_square_root - /// @{ - - /// Faster than the common sqrt function but less accurate. - /// - /// @see gtx_fast_square_root extension. - template <typename genType> - GLM_FUNC_DECL genType fastSqrt(genType x); - - /// Faster than the common sqrt function but less accurate. - /// - /// @see gtx_fast_square_root extension. - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> fastSqrt(vecType<T, P> const & x); - - /// Faster than the common inversesqrt function but less accurate. - /// - /// @see gtx_fast_square_root extension. - template <typename genType> - GLM_FUNC_DECL genType fastInverseSqrt(genType x); - - /// Faster than the common inversesqrt function but less accurate. - /// - /// @see gtx_fast_square_root extension. - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> fastInverseSqrt(vecType<T, P> const & x); - - /// Faster than the common length function but less accurate. - /// - /// @see gtx_fast_square_root extension. - template <typename genType> - GLM_FUNC_DECL genType fastLength(genType x); - - /// Faster than the common length function but less accurate. - /// - /// @see gtx_fast_square_root extension. - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL T fastLength(vecType<T, P> const & x); - - /// Faster than the common distance function but less accurate. - /// - /// @see gtx_fast_square_root extension. - template <typename genType> - GLM_FUNC_DECL genType fastDistance(genType x, genType y); - - /// Faster than the common distance function but less accurate. - /// - /// @see gtx_fast_square_root extension. - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL T fastDistance(vecType<T, P> const & x, vecType<T, P> const & y); - - /// Faster than the common normalize function but less accurate. - /// - /// @see gtx_fast_square_root extension. - template <typename genType> - GLM_FUNC_DECL genType fastNormalize(genType const & x); - - /// @} -}// namespace glm - -#include "fast_square_root.inl" diff --git a/extensions/common/glm/gtx/fast_square_root.inl b/extensions/common/glm/gtx/fast_square_root.inl deleted file mode 100644 index 9db769dda56..00000000000 --- a/extensions/common/glm/gtx/fast_square_root.inl +++ /dev/null @@ -1,110 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_fast_square_root -/// @file glm/gtx/fast_square_root.inl -/// @date 2006-01-04 / 2011-06-07 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - // fastSqrt - template <typename genType> - GLM_FUNC_QUALIFIER genType fastSqrt(genType x) - { - GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'fastSqrt' only accept floating-point input"); - - return genType(1) / fastInverseSqrt(x); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> fastSqrt(vecType<T, P> const & x) - { - return detail::functor1<T, T, P, vecType>::call(fastSqrt, x); - } - - // fastInversesqrt - template <typename genType> - GLM_FUNC_QUALIFIER genType fastInverseSqrt(genType x) - { -# ifdef __CUDACC__ // Wordaround for a CUDA compiler bug up to CUDA6 - tvec1<T, P> tmp(detail::compute_inversesqrt<tvec1, genType, lowp>::call(tvec1<genType, lowp>(x))); - return tmp.x; -# else - return detail::compute_inversesqrt<tvec1, genType, lowp>::call(tvec1<genType, lowp>(x)).x; -# endif - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> fastInverseSqrt(vecType<T, P> const & x) - { - return detail::compute_inversesqrt<vecType, T, P>::call(x); - } - - // fastLength - template <typename genType> - GLM_FUNC_QUALIFIER genType fastLength(genType x) - { - GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'fastLength' only accept floating-point inputs"); - - return abs(x); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER T fastLength(vecType<T, P> const & x) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'fastLength' only accept floating-point inputs"); - - return fastSqrt(dot(x, x)); - } - - // fastDistance - template <typename genType> - GLM_FUNC_QUALIFIER genType fastDistance(genType x, genType y) - { - return fastLength(y - x); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER T fastDistance(vecType<T, P> const & x, vecType<T, P> const & y) - { - return fastLength(y - x); - } - - // fastNormalize - template <typename genType> - GLM_FUNC_QUALIFIER genType fastNormalize(genType x) - { - return x > genType(0) ? genType(1) : -genType(1); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> fastNormalize(vecType<T, P> const & x) - { - return x * fastInverseSqrt(dot(x, x)); - } -}//namespace glm diff --git a/extensions/common/glm/gtx/fast_trigonometry.hpp b/extensions/common/glm/gtx/fast_trigonometry.hpp deleted file mode 100644 index 280f3ada310..00000000000 --- a/extensions/common/glm/gtx/fast_trigonometry.hpp +++ /dev/null @@ -1,104 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_fast_trigonometry -/// @file glm/gtx/fast_trigonometry.hpp -/// @date 2006-01-08 / 2011-06-07 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// -/// @defgroup gtx_fast_trigonometry GLM_GTX_fast_trigonometry -/// @ingroup gtx -/// -/// @brief Fast but less accurate implementations of trigonometric functions. -/// -/// <glm/gtx/fast_trigonometry.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependency: -#include "../gtc/constants.hpp" - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTX_fast_trigonometry extension included") -#endif - -namespace glm -{ - /// @addtogroup gtx_fast_trigonometry - /// @{ - - /// Wrap an angle to [0 2pi[ - /// From GLM_GTX_fast_trigonometry extension. - template <typename T> - GLM_FUNC_DECL T wrapAngle(T angle); - - /// Faster than the common sin function but less accurate. - /// From GLM_GTX_fast_trigonometry extension. - template <typename T> - GLM_FUNC_DECL T fastSin(T angle); - - /// Faster than the common cos function but less accurate. - /// From GLM_GTX_fast_trigonometry extension. - template <typename T> - GLM_FUNC_DECL T fastCos(T angle); - - /// Faster than the common tan function but less accurate. - /// Defined between -2pi and 2pi. - /// From GLM_GTX_fast_trigonometry extension. - template <typename T> - GLM_FUNC_DECL T fastTan(T angle); - - /// Faster than the common asin function but less accurate. - /// Defined between -2pi and 2pi. - /// From GLM_GTX_fast_trigonometry extension. - template <typename T> - GLM_FUNC_DECL T fastAsin(T angle); - - /// Faster than the common acos function but less accurate. - /// Defined between -2pi and 2pi. - /// From GLM_GTX_fast_trigonometry extension. - template <typename T> - GLM_FUNC_DECL T fastAcos(T angle); - - /// Faster than the common atan function but less accurate. - /// Defined between -2pi and 2pi. - /// From GLM_GTX_fast_trigonometry extension. - template <typename T> - GLM_FUNC_DECL T fastAtan(T y, T x); - - /// Faster than the common atan function but less accurate. - /// Defined between -2pi and 2pi. - /// From GLM_GTX_fast_trigonometry extension. - template <typename T> - GLM_FUNC_DECL T fastAtan(T angle); - - /// @} -}//namespace glm - -#include "fast_trigonometry.inl" diff --git a/extensions/common/glm/gtx/fast_trigonometry.inl b/extensions/common/glm/gtx/fast_trigonometry.inl deleted file mode 100644 index 16a821ad849..00000000000 --- a/extensions/common/glm/gtx/fast_trigonometry.inl +++ /dev/null @@ -1,162 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_fast_trigonometry -/// @file glm/gtx/fast_trigonometry.inl -/// @date 2006-01-08 / 2014-11-25 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm{ -namespace detail -{ - template <typename T> - GLM_FUNC_QUALIFIER T cos_52s(T x) - { - T const xx(x * x); - return (T(0.9999932946) + xx * (T(-0.4999124376) + xx * (T(0.0414877472) + xx * T(-0.0012712095)))); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> cos_52s(vecType<T, P> const & x) - { - return detail::functor1<T, T, P, vecType>::call(cos_52s, x); - } -}//namespace detail - - // wrapAngle - template <typename T> - GLM_FUNC_QUALIFIER T wrapAngle(T angle) - { - return abs<T>(mod<T>(angle, two_pi<T>())); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> wrapAngle(vecType<T, P> const & x) - { - return detail::functor1<T, T, P, vecType>::call(wrapAngle, x); - } - - // cos - template <typename T> - GLM_FUNC_QUALIFIER T fastCos(T x) - { - T const angle(wrapAngle<T>(x)); - - if(angle<half_pi<T>()) - return detail::cos_52s(angle); - if(angle<pi<T>()) - return -detail::cos_52s(pi<T>() - angle); - if(angle<(T(3) * half_pi<T>())) - return -detail::cos_52s(angle - pi<T>()); - - return detail::cos_52s(two_pi<T>() - angle); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> fastCos(vecType<T, P> const & x) - { - return detail::functor1<T, T, P, vecType>::call(fastCos, x); - } - - // sin - template <typename T> - GLM_FUNC_QUALIFIER T fastSin(T x) - { - return fastCos<T>(half_pi<T>() - x); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> fastSin(vecType<T, P> const & x) - { - return detail::functor1<T, T, P, vecType>::call(fastSin, x); - } - - // tan - template <typename T> - GLM_FUNC_QUALIFIER T fastTan(T x) - { - return x + (x * x * x * T(0.3333333333)) + (x * x * x * x * x * T(0.1333333333333)) + (x * x * x * x * x * x * x * T(0.0539682539)); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> fastTan(vecType<T, P> const & x) - { - return detail::functor1<T, T, P, vecType>::call(fastTan, x); - } - - // asin - template <typename T> - GLM_FUNC_QUALIFIER T fastAsin(T x) - { - return x + (x * x * x * T(0.166666667)) + (x * x * x * x * x * T(0.075)) + (x * x * x * x * x * x * x * T(0.0446428571)) + (x * x * x * x * x * x * x * x * x * T(0.0303819444));// + (x * x * x * x * x * x * x * x * x * x * x * T(0.022372159)); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> fastAsin(vecType<T, P> const & x) - { - return detail::functor1<T, T, P, vecType>::call(fastAsin, x); - } - - // acos - template <typename T> - GLM_FUNC_QUALIFIER T fastAcos(T x) - { - return T(1.5707963267948966192313216916398) - fastAsin(x); //(PI / 2) - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> fastAcos(vecType<T, P> const & x) - { - return detail::functor1<T, T, P, vecType>::call(fastAcos, x); - } - - // atan - template <typename T> - GLM_FUNC_QUALIFIER T fastAtan(T y, T x) - { - T sgn = sign(y) * sign(x); - return abs(fastAtan(y / x)) * sgn; - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> fastAtan(vecType<T, P> const & y, vecType<T, P> const & x) - { - return detail::functor2<T, P, vecType>::call(fastAtan, y, x); - } - - template <typename T> - GLM_FUNC_QUALIFIER T fastAtan(T x) - { - return x - (x * x * x * T(0.333333333333)) + (x * x * x * x * x * T(0.2)) - (x * x * x * x * x * x * x * T(0.1428571429)) + (x * x * x * x * x * x * x * x * x * T(0.111111111111)) - (x * x * x * x * x * x * x * x * x * x * x * T(0.0909090909)); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> fastAtan(vecType<T, P> const & x) - { - return detail::functor1<T, T, P, vecType>::call(fastAtan, x); - } -}//namespace glm diff --git a/extensions/common/glm/gtx/gradient_paint.hpp b/extensions/common/glm/gtx/gradient_paint.hpp deleted file mode 100644 index f90e7b34f70..00000000000 --- a/extensions/common/glm/gtx/gradient_paint.hpp +++ /dev/null @@ -1,77 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_gradient_paint -/// @file glm/gtx/gradient_paint.hpp -/// @date 2009-03-06 / 2011-06-07 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// @see gtx_optimum_pow (dependence) -/// -/// @defgroup gtx_gradient_paint GLM_GTX_gradient_paint -/// @ingroup gtx -/// -/// @brief Functions that return the color of procedural gradient for specific coordinates. -/// <glm/gtx/gradient_paint.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependency: -#include "../glm.hpp" -#include "../gtx/optimum_pow.hpp" - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTX_gradient_paint extension included") -#endif - -namespace glm -{ - /// @addtogroup gtx_gradient_paint - /// @{ - - /// Return a color from a radial gradient. - /// @see - gtx_gradient_paint - template <typename T, precision P> - GLM_FUNC_DECL T radialGradient( - tvec2<T, P> const & Center, - T const & Radius, - tvec2<T, P> const & Focal, - tvec2<T, P> const & Position); - - /// Return a color from a linear gradient. - /// @see - gtx_gradient_paint - template <typename T, precision P> - GLM_FUNC_DECL T linearGradient( - tvec2<T, P> const & Point0, - tvec2<T, P> const & Point1, - tvec2<T, P> const & Position); - - /// @} -}// namespace glm - -#include "gradient_paint.inl" diff --git a/extensions/common/glm/gtx/gradient_paint.inl b/extensions/common/glm/gtx/gradient_paint.inl deleted file mode 100644 index 9a2305fe26e..00000000000 --- a/extensions/common/glm/gtx/gradient_paint.inl +++ /dev/null @@ -1,66 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_gradient_paint -/// @file glm/gtx/gradient_paint.inl -/// @date 2009-03-06 / 2013-04-09 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template <typename T, precision P> - GLM_FUNC_QUALIFIER T radialGradient - ( - tvec2<T, P> const & Center, - T const & Radius, - tvec2<T, P> const & Focal, - tvec2<T, P> const & Position - ) - { - tvec2<T, P> F = Focal - Center; - tvec2<T, P> D = Position - Focal; - T Radius2 = pow2(Radius); - T Fx2 = pow2(F.x); - T Fy2 = pow2(F.y); - - T Numerator = (D.x * F.x + D.y * F.y) + sqrt(Radius2 * (pow2(D.x) + pow2(D.y)) - pow2(D.x * F.y - D.y * F.x)); - T Denominator = Radius2 - (Fx2 + Fy2); - return Numerator / Denominator; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER T linearGradient - ( - tvec2<T, P> const & Point0, - tvec2<T, P> const & Point1, - tvec2<T, P> const & Position - ) - { - tvec2<T, P> Dist = Point1 - Point0; - return (Dist.x * (Position.x - Point0.x) + Dist.y * (Position.y - Point0.y)) / glm::dot(Dist, Dist); - } -}//namespace glm diff --git a/extensions/common/glm/gtx/handed_coordinate_space.hpp b/extensions/common/glm/gtx/handed_coordinate_space.hpp deleted file mode 100644 index 8de8ec59e72..00000000000 --- a/extensions/common/glm/gtx/handed_coordinate_space.hpp +++ /dev/null @@ -1,75 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_handed_coordinate_space -/// @file glm/gtx/handed_coordinate_space.hpp -/// @date 2005-12-21 / 2011-06-07 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// -/// @defgroup gtx_handed_coordinate_space GLM_GTX_handed_coordinate_space -/// @ingroup gtx -/// -/// @brief To know if a set of three basis vectors defines a right or left-handed coordinate system. -/// -/// <glm/gtx/handed_coordinate_system.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependency: -#include "../glm.hpp" - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTX_handed_coordinate_space extension included") -#endif - -namespace glm -{ - /// @addtogroup gtx_handed_coordinate_space - /// @{ - - //! Return if a trihedron right handed or not. - //! From GLM_GTX_handed_coordinate_space extension. - template <typename T, precision P> - GLM_FUNC_DECL bool rightHanded( - tvec3<T, P> const & tangent, - tvec3<T, P> const & binormal, - tvec3<T, P> const & normal); - - //! Return if a trihedron left handed or not. - //! From GLM_GTX_handed_coordinate_space extension. - template <typename T, precision P> - GLM_FUNC_DECL bool leftHanded( - tvec3<T, P> const & tangent, - tvec3<T, P> const & binormal, - tvec3<T, P> const & normal); - - /// @} -}// namespace glm - -#include "handed_coordinate_space.inl" diff --git a/extensions/common/glm/gtx/handed_coordinate_space.inl b/extensions/common/glm/gtx/handed_coordinate_space.inl deleted file mode 100644 index 86e9faff268..00000000000 --- a/extensions/common/glm/gtx/handed_coordinate_space.inl +++ /dev/null @@ -1,56 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_handed_coordinate_space -/// @file glm/gtx/handed_coordinate_space.inl -/// @date 2005-12-21 / 2009-02-19 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template <typename T, precision P> - GLM_FUNC_QUALIFIER bool rightHanded - ( - tvec3<T, P> const & tangent, - tvec3<T, P> const & binormal, - tvec3<T, P> const & normal - ) - { - return dot(cross(normal, tangent), binormal) > T(0); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER bool leftHanded - ( - tvec3<T, P> const & tangent, - tvec3<T, P> const & binormal, - tvec3<T, P> const & normal - ) - { - return dot(cross(normal, tangent), binormal) < T(0); - } -}//namespace glm diff --git a/extensions/common/glm/gtx/integer.hpp b/extensions/common/glm/gtx/integer.hpp deleted file mode 100644 index fd9469e3849..00000000000 --- a/extensions/common/glm/gtx/integer.hpp +++ /dev/null @@ -1,101 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_integer -/// @file glm/gtx/integer.hpp -/// @date 2005-12-24 / 2011-10-13 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// -/// @defgroup gtx_integer GLM_GTX_integer -/// @ingroup gtx -/// -/// @brief Add support for integer for core functions -/// -/// <glm/gtx/integer.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependency: -#include "../glm.hpp" -#include "../gtc/integer.hpp" - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTX_integer extension included") -#endif - -namespace glm -{ - /// @addtogroup gtx_integer - /// @{ - - //! Returns x raised to the y power. - //! From GLM_GTX_integer extension. - GLM_FUNC_DECL int pow(int x, int y); - - //! Returns the positive square root of x. - //! From GLM_GTX_integer extension. - GLM_FUNC_DECL int sqrt(int x); - - //! Returns the floor log2 of x. - //! From GLM_GTX_integer extension. - GLM_FUNC_DECL unsigned int floor_log2(unsigned int x); - - //! Modulus. Returns x - y * floor(x / y) for each component in x using the floating point value y. - //! From GLM_GTX_integer extension. - GLM_FUNC_DECL int mod(int x, int y); - - //! Return the factorial value of a number (!12 max, integer only) - //! From GLM_GTX_integer extension. - template <typename genType> - GLM_FUNC_DECL genType factorial(genType const & x); - - //! 32bit signed integer. - //! From GLM_GTX_integer extension. - typedef signed int sint; - - //! Returns x raised to the y power. - //! From GLM_GTX_integer extension. - GLM_FUNC_DECL uint pow(uint x, uint y); - - //! Returns the positive square root of x. - //! From GLM_GTX_integer extension. - GLM_FUNC_DECL uint sqrt(uint x); - - //! Modulus. Returns x - y * floor(x / y) for each component in x using the floating point value y. - //! From GLM_GTX_integer extension. - GLM_FUNC_DECL uint mod(uint x, uint y); - - //! Returns the number of leading zeros. - //! From GLM_GTX_integer extension. - GLM_FUNC_DECL uint nlz(uint x); - - /// @} -}//namespace glm - -#include "integer.inl" diff --git a/extensions/common/glm/gtx/integer.inl b/extensions/common/glm/gtx/integer.inl deleted file mode 100644 index 360818b1cd7..00000000000 --- a/extensions/common/glm/gtx/integer.inl +++ /dev/null @@ -1,211 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_integer -/// @file glm/gtx/integer.inl -/// @date 2005-12-24 / 2011-10-13 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - // pow - GLM_FUNC_QUALIFIER int pow(int x, int y) - { - if(y == 0) - return 1; - int result = x; - for(int i = 1; i < y; ++i) - result *= x; - return result; - } - - // sqrt: From Christopher J. Musial, An integer square root, Graphics Gems, 1990, page 387 - GLM_FUNC_QUALIFIER int sqrt(int x) - { - if(x <= 1) return x; - - int NextTrial = x >> 1; - int CurrentAnswer; - - do - { - CurrentAnswer = NextTrial; - NextTrial = (NextTrial + x / NextTrial) >> 1; - } while(NextTrial < CurrentAnswer); - - return CurrentAnswer; - } - -// Henry Gordon Dietz: http://aggregate.org/MAGIC/ -namespace detail -{ - GLM_FUNC_QUALIFIER unsigned int ones32(unsigned int x) - { - /* 32-bit recursive reduction using SWAR... - but first step is mapping 2-bit values - into sum of 2 1-bit values in sneaky way - */ - x -= ((x >> 1) & 0x55555555); - x = (((x >> 2) & 0x33333333) + (x & 0x33333333)); - x = (((x >> 4) + x) & 0x0f0f0f0f); - x += (x >> 8); - x += (x >> 16); - return(x & 0x0000003f); - } -}//namespace detail - - // Henry Gordon Dietz: http://aggregate.org/MAGIC/ -/* - GLM_FUNC_QUALIFIER unsigned int floor_log2(unsigned int x) - { - x |= (x >> 1); - x |= (x >> 2); - x |= (x >> 4); - x |= (x >> 8); - x |= (x >> 16); - - return _detail::ones32(x) >> 1; - } -*/ - // mod - GLM_FUNC_QUALIFIER int mod(int x, int y) - { - return x - y * (x / y); - } - - // factorial (!12 max, integer only) - template <typename genType> - GLM_FUNC_QUALIFIER genType factorial(genType const & x) - { - genType Temp = x; - genType Result; - for(Result = 1; Temp > 1; --Temp) - Result *= Temp; - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> factorial( - tvec2<T, P> const & x) - { - return tvec2<T, P>( - factorial(x.x), - factorial(x.y)); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> factorial( - tvec3<T, P> const & x) - { - return tvec3<T, P>( - factorial(x.x), - factorial(x.y), - factorial(x.z)); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> factorial( - tvec4<T, P> const & x) - { - return tvec4<T, P>( - factorial(x.x), - factorial(x.y), - factorial(x.z), - factorial(x.w)); - } - - GLM_FUNC_QUALIFIER uint pow(uint x, uint y) - { - uint result = x; - for(uint i = 1; i < y; ++i) - result *= x; - return result; - } - - GLM_FUNC_QUALIFIER uint sqrt(uint x) - { - if(x <= 1) return x; - - uint NextTrial = x >> 1; - uint CurrentAnswer; - - do - { - CurrentAnswer = NextTrial; - NextTrial = (NextTrial + x / NextTrial) >> 1; - } while(NextTrial < CurrentAnswer); - - return CurrentAnswer; - } - - GLM_FUNC_QUALIFIER uint mod(uint x, uint y) - { - return x - y * (x / y); - } - -#if(GLM_COMPILER & (GLM_COMPILER_VC | GLM_COMPILER_GCC)) - - GLM_FUNC_QUALIFIER unsigned int nlz(unsigned int x) - { - return 31u - findMSB(x); - } - -#else - - // Hackers Delight: http://www.hackersdelight.org/HDcode/nlz.c.txt - GLM_FUNC_QUALIFIER unsigned int nlz(unsigned int x) - { - int y, m, n; - - y = -int(x >> 16); // If left half of x is 0, - m = (y >> 16) & 16; // set n = 16. If left half - n = 16 - m; // is nonzero, set n = 0 and - x = x >> m; // shift x right 16. - // Now x is of the form 0000xxxx. - y = x - 0x100; // If positions 8-15 are 0, - m = (y >> 16) & 8; // add 8 to n and shift x left 8. - n = n + m; - x = x << m; - - y = x - 0x1000; // If positions 12-15 are 0, - m = (y >> 16) & 4; // add 4 to n and shift x left 4. - n = n + m; - x = x << m; - - y = x - 0x4000; // If positions 14-15 are 0, - m = (y >> 16) & 2; // add 2 to n and shift x left 2. - n = n + m; - x = x << m; - - y = x >> 14; // Set y = 0, 1, 2, or 3. - m = y & ~(y >> 1); // Set m = 0, 1, 2, or 2 resp. - return unsigned(n + 2 - m); - } - -#endif//(GLM_COMPILER) - -}//namespace glm diff --git a/extensions/common/glm/gtx/intersect.hpp b/extensions/common/glm/gtx/intersect.hpp deleted file mode 100644 index ae75e59bf4f..00000000000 --- a/extensions/common/glm/gtx/intersect.hpp +++ /dev/null @@ -1,112 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_intersect -/// @file glm/gtx/intersect.hpp -/// @date 2007-04-03 / 2011-06-07 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// @see gtx_closest_point (dependence) -/// -/// @defgroup gtx_intersect GLM_GTX_intersect -/// @ingroup gtx -/// -/// @brief Add intersection functions -/// -/// <glm/gtx/intersect.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependency: -#include "../glm.hpp" -#include "../gtx/closest_point.hpp" - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTX_closest_point extension included") -#endif - -namespace glm -{ - /// @addtogroup gtx_intersect - /// @{ - - //! Compute the intersection of a ray and a triangle. - //! Ray direction and plane normal must be unit length. - //! From GLM_GTX_intersect extension. - template <typename genType> - GLM_FUNC_DECL bool intersectRayPlane( - genType const & orig, genType const & dir, - genType const & planeOrig, genType const & planeNormal, - typename genType::value_type & intersectionDistance); - - //! Compute the intersection of a ray and a triangle. - //! From GLM_GTX_intersect extension. - template <typename genType> - GLM_FUNC_DECL bool intersectRayTriangle( - genType const & orig, genType const & dir, - genType const & vert0, genType const & vert1, genType const & vert2, - genType & baryPosition); - - //! Compute the intersection of a line and a triangle. - //! From GLM_GTX_intersect extension. - template <typename genType> - GLM_FUNC_DECL bool intersectLineTriangle( - genType const & orig, genType const & dir, - genType const & vert0, genType const & vert1, genType const & vert2, - genType & position); - - //! Compute the intersection distance of a ray and a sphere. - //! The ray direction vector is unit length. - //! From GLM_GTX_intersect extension. - template <typename genType> - GLM_FUNC_DECL bool intersectRaySphere( - genType const & rayStarting, genType const & rayNormalizedDirection, - genType const & sphereCenter, typename genType::value_type const sphereRadiusSquered, - typename genType::value_type & intersectionDistance); - - //! Compute the intersection of a ray and a sphere. - //! From GLM_GTX_intersect extension. - template <typename genType> - GLM_FUNC_DECL bool intersectRaySphere( - genType const & rayStarting, genType const & rayNormalizedDirection, - genType const & sphereCenter, const typename genType::value_type sphereRadius, - genType & intersectionPosition, genType & intersectionNormal); - - //! Compute the intersection of a line and a sphere. - //! From GLM_GTX_intersect extension - template <typename genType> - GLM_FUNC_DECL bool intersectLineSphere( - genType const & point0, genType const & point1, - genType const & sphereCenter, typename genType::value_type sphereRadius, - genType & intersectionPosition1, genType & intersectionNormal1, - genType & intersectionPosition2 = genType(), genType & intersectionNormal2 = genType()); - - /// @} -}//namespace glm - -#include "intersect.inl" diff --git a/extensions/common/glm/gtx/intersect.inl b/extensions/common/glm/gtx/intersect.inl deleted file mode 100644 index 0c1cc935388..00000000000 --- a/extensions/common/glm/gtx/intersect.inl +++ /dev/null @@ -1,217 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2007-04-03 -// Updated : 2009-01-20 -// Licence : This source is under MIT licence -// File : glm/gtx/intersect.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "../geometric.hpp" -#include <cfloat> -#include <limits> - -namespace glm -{ - template <typename genType> - GLM_FUNC_QUALIFIER bool intersectRayPlane - ( - genType const & orig, genType const & dir, - genType const & planeOrig, genType const & planeNormal, - typename genType::value_type & intersectionDistance - ) - { - typename genType::value_type d = glm::dot(dir, planeNormal); - typename genType::value_type Epsilon = std::numeric_limits<typename genType::value_type>::epsilon(); - - if(d < Epsilon) - { - intersectionDistance = glm::dot(planeOrig - orig, planeNormal) / d; - return true; - } - - return false; - } - - template <typename genType> - GLM_FUNC_QUALIFIER bool intersectRayTriangle - ( - genType const & orig, genType const & dir, - genType const & v0, genType const & v1, genType const & v2, - genType & baryPosition - ) - { - genType e1 = v1 - v0; - genType e2 = v2 - v0; - - genType p = glm::cross(dir, e2); - - typename genType::value_type a = glm::dot(e1, p); - - typename genType::value_type Epsilon = std::numeric_limits<typename genType::value_type>::epsilon(); - if(a < Epsilon) - return false; - - typename genType::value_type f = typename genType::value_type(1.0f) / a; - - genType s = orig - v0; - baryPosition.x = f * glm::dot(s, p); - if(baryPosition.x < typename genType::value_type(0.0f)) - return false; - if(baryPosition.x > typename genType::value_type(1.0f)) - return false; - - genType q = glm::cross(s, e1); - baryPosition.y = f * glm::dot(dir, q); - if(baryPosition.y < typename genType::value_type(0.0f)) - return false; - if(baryPosition.y + baryPosition.x > typename genType::value_type(1.0f)) - return false; - - baryPosition.z = f * glm::dot(e2, q); - - return baryPosition.z >= typename genType::value_type(0.0f); - } - - //template <typename genType> - //GLM_FUNC_QUALIFIER bool intersectRayTriangle - //( - // genType const & orig, genType const & dir, - // genType const & vert0, genType const & vert1, genType const & vert2, - // genType & position - //) - //{ - // typename genType::value_type Epsilon = std::numeric_limits<typename genType::value_type>::epsilon(); - // - // genType edge1 = vert1 - vert0; - // genType edge2 = vert2 - vert0; - // - // genType pvec = cross(dir, edge2); - // - // float det = dot(edge1, pvec); - // if(det < Epsilon) - // return false; - // - // genType tvec = orig - vert0; - // - // position.y = dot(tvec, pvec); - // if (position.y < typename genType::value_type(0) || position.y > det) - // return typename genType::value_type(0); - // - // genType qvec = cross(tvec, edge1); - // - // position.z = dot(dir, qvec); - // if (position.z < typename genType::value_type(0) || position.y + position.z > det) - // return typename genType::value_type(0); - // - // position.x = dot(edge2, qvec); - // position *= typename genType::value_type(1) / det; - // - // return typename genType::value_type(1); - //} - - template <typename genType> - GLM_FUNC_QUALIFIER bool intersectLineTriangle - ( - genType const & orig, genType const & dir, - genType const & vert0, genType const & vert1, genType const & vert2, - genType & position - ) - { - typename genType::value_type Epsilon = std::numeric_limits<typename genType::value_type>::epsilon(); - - genType edge1 = vert1 - vert0; - genType edge2 = vert2 - vert0; - - genType pvec = cross(dir, edge2); - - float det = dot(edge1, pvec); - - if (det > -Epsilon && det < Epsilon) - return false; - float inv_det = typename genType::value_type(1) / det; - - genType tvec = orig - vert0; - - position.y = dot(tvec, pvec) * inv_det; - if (position.y < typename genType::value_type(0) || position.y > typename genType::value_type(1)) - return false; - - genType qvec = cross(tvec, edge1); - - position.z = dot(dir, qvec) * inv_det; - if (position.z < typename genType::value_type(0) || position.y + position.z > typename genType::value_type(1)) - return false; - - position.x = dot(edge2, qvec) * inv_det; - - return true; - } - - template <typename genType> - GLM_FUNC_QUALIFIER bool intersectRaySphere - ( - genType const & rayStarting, genType const & rayNormalizedDirection, - genType const & sphereCenter, const typename genType::value_type sphereRadiusSquered, - typename genType::value_type & intersectionDistance - ) - { - typename genType::value_type Epsilon = std::numeric_limits<typename genType::value_type>::epsilon(); - genType diff = sphereCenter - rayStarting; - typename genType::value_type t0 = dot(diff, rayNormalizedDirection); - typename genType::value_type dSquared = dot(diff, diff) - t0 * t0; - if( dSquared > sphereRadiusSquered ) - { - return false; - } - typename genType::value_type t1 = sqrt( sphereRadiusSquered - dSquared ); - intersectionDistance = t0 > t1 + Epsilon ? t0 - t1 : t0 + t1; - return intersectionDistance > Epsilon; - } - - template <typename genType> - GLM_FUNC_QUALIFIER bool intersectRaySphere - ( - genType const & rayStarting, genType const & rayNormalizedDirection, - genType const & sphereCenter, const typename genType::value_type sphereRadius, - genType & intersectionPosition, genType & intersectionNormal - ) - { - typename genType::value_type distance; - if( intersectRaySphere( rayStarting, rayNormalizedDirection, sphereCenter, sphereRadius * sphereRadius, distance ) ) - { - intersectionPosition = rayStarting + rayNormalizedDirection * distance; - intersectionNormal = (intersectionPosition - sphereCenter) / sphereRadius; - return true; - } - return false; - } - - template <typename genType> - GLM_FUNC_QUALIFIER bool intersectLineSphere - ( - genType const & point0, genType const & point1, - genType const & sphereCenter, typename genType::value_type sphereRadius, - genType & intersectionPoint1, genType & intersectionNormal1, - genType & intersectionPoint2, genType & intersectionNormal2 - ) - { - typename genType::value_type Epsilon = std::numeric_limits<typename genType::value_type>::epsilon(); - genType dir = normalize(point1 - point0); - genType diff = sphereCenter - point0; - typename genType::value_type t0 = dot(diff, dir); - typename genType::value_type dSquared = dot(diff, diff) - t0 * t0; - if( dSquared > sphereRadius * sphereRadius ) - { - return false; - } - typename genType::value_type t1 = sqrt( sphereRadius * sphereRadius - dSquared ); - if( t0 < t1 + Epsilon ) - t1 = -t1; - intersectionPoint1 = point0 + dir * (t0 - t1); - intersectionNormal1 = (intersectionPoint1 - sphereCenter) / sphereRadius; - intersectionPoint2 = point0 + dir * (t0 + t1); - intersectionNormal2 = (intersectionPoint2 - sphereCenter) / sphereRadius; - return true; - } -}//namespace glm diff --git a/extensions/common/glm/gtx/io.hpp b/extensions/common/glm/gtx/io.hpp deleted file mode 100644 index 777d9374776..00000000000 --- a/extensions/common/glm/gtx/io.hpp +++ /dev/null @@ -1,224 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_io -/// @file glm/gtx/io.hpp -/// @date 2013-11-22 / 2014-11-25 -/// @author Jan P Springer (regnirpsj@gmail.com) -/// -/// @see core (dependence) -/// @see gtc_quaternion (dependence) -/// -/// @defgroup gtx_io GLM_GTX_io -/// @ingroup gtx -/// -/// @brief std::[w]ostream support for glm types -/// -/// std::[w]ostream support for glm types + precision/width/etc. manipulators -/// based on howard hinnant's std::chrono io proposal -/// [http://home.roadrunner.com/~hinnant/bloomington/chrono_io.html] -/// -/// <glm/gtx/io.hpp> needs to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependency: -#include "../glm.hpp" -#include "../gtx/quaternion.hpp" - -#if(defined(GLM_MESSAGES) && !defined(glm_ext)) -# pragma message("GLM: GLM_GTX_io extension included") -#endif - -#include <iosfwd> // std::basic_ostream<> (fwd) -#include <locale> // std::locale, std::locale::facet, std::locale::id -#include <utility> // std::pair<> - -namespace glm -{ - /// @addtogroup gtx_io - /// @{ - - namespace io - { - enum order_type { column_major, row_major}; - - template <typename CTy> - class format_punct : public std::locale::facet - { - typedef CTy char_type; - - public: - - static std::locale::id id; - - bool formatted; - unsigned precision; - unsigned width; - char_type separator; - char_type delim_left; - char_type delim_right; - char_type space; - char_type newline; - order_type order; - - explicit format_punct(size_t a = 0); - explicit format_punct(format_punct const&); - }; - - template <typename CTy, typename CTr = std::char_traits<CTy> > - class basic_state_saver { - - public: - - explicit basic_state_saver(std::basic_ios<CTy,CTr>&); - ~basic_state_saver(); - - private: - - typedef ::std::basic_ios<CTy,CTr> state_type; - typedef typename state_type::char_type char_type; - typedef ::std::ios_base::fmtflags flags_type; - typedef ::std::streamsize streamsize_type; - typedef ::std::locale const locale_type; - - state_type& state_; - flags_type flags_; - streamsize_type precision_; - streamsize_type width_; - char_type fill_; - locale_type locale_; - - basic_state_saver& operator=(basic_state_saver const&); - }; - - typedef basic_state_saver<char> state_saver; - typedef basic_state_saver<wchar_t> wstate_saver; - - template <typename CTy, typename CTr = std::char_traits<CTy> > - class basic_format_saver - { - public: - - explicit basic_format_saver(std::basic_ios<CTy,CTr>&); - ~basic_format_saver(); - - private: - - basic_state_saver<CTy> const bss_; - - basic_format_saver& operator=(basic_format_saver const&); - }; - - typedef basic_format_saver<char> format_saver; - typedef basic_format_saver<wchar_t> wformat_saver; - - struct precision - { - unsigned value; - - explicit precision(unsigned); - }; - - struct width - { - unsigned value; - - explicit width(unsigned); - }; - - template <typename CTy> - struct delimeter - { - CTy value[3]; - - explicit delimeter(CTy /* left */, CTy /* right */, CTy /* separator */ = ','); - }; - - struct order - { - order_type value; - - explicit order(order_type); - }; - - // functions, inlined (inline) - - template <typename FTy, typename CTy, typename CTr> - FTy const& get_facet(std::basic_ios<CTy,CTr>&); - template <typename FTy, typename CTy, typename CTr> - std::basic_ios<CTy,CTr>& formatted(std::basic_ios<CTy,CTr>&); - template <typename FTy, typename CTy, typename CTr> - std::basic_ios<CTy,CTr>& unformattet(std::basic_ios<CTy,CTr>&); - - template <typename CTy, typename CTr> - std::basic_ostream<CTy, CTr>& operator<<(std::basic_ostream<CTy, CTr>&, precision const&); - template <typename CTy, typename CTr> - std::basic_ostream<CTy, CTr>& operator<<(std::basic_ostream<CTy, CTr>&, width const&); - template <typename CTy, typename CTr> - std::basic_ostream<CTy, CTr>& operator<<(std::basic_ostream<CTy, CTr>&, delimeter<CTy> const&); - template <typename CTy, typename CTr> - std::basic_ostream<CTy, CTr>& operator<<(std::basic_ostream<CTy, CTr>&, order const&); - }//namespace io - - template <typename CTy, typename CTr, typename T, precision P> - GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, tquat<T,P> const&); - template <typename CTy, typename CTr, typename T, precision P> - GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, tvec2<T,P> const&); - template <typename CTy, typename CTr, typename T, precision P> - GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, tvec3<T,P> const&); - template <typename CTy, typename CTr, typename T, precision P> - GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, tvec4<T,P> const&); - template <typename CTy, typename CTr, typename T, precision P> - GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, tmat2x2<T,P> const&); - template <typename CTy, typename CTr, typename T, precision P> - GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, tmat2x3<T,P> const&); - template <typename CTy, typename CTr, typename T, precision P> - GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, tmat2x4<T,P> const&); - template <typename CTy, typename CTr, typename T, precision P> - GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, tmat3x2<T,P> const&); - template <typename CTy, typename CTr, typename T, precision P> - GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, tmat3x3<T,P> const&); - template <typename CTy, typename CTr, typename T, precision P> - GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, tmat3x4<T,P> const&); - template <typename CTy, typename CTr, typename T, precision P> - GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, tmat4x2<T,P> const&); - template <typename CTy, typename CTr, typename T, precision P> - GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, tmat4x3<T,P> const&); - template <typename CTy, typename CTr, typename T, precision P> - GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, tmat4x4<T,P> const&); - - template <typename CTy, typename CTr, typename T, precision P> - GLM_FUNC_DECL std::basic_ostream<CTy,CTr> & operator<<( - std::basic_ostream<CTy,CTr> &, - std::pair<tmat4x4<T,P> const, - tmat4x4<T,P> const> const &); - - /// @} -}//namespace glm - -#include "io.inl" diff --git a/extensions/common/glm/gtx/io.inl b/extensions/common/glm/gtx/io.inl deleted file mode 100644 index fe5f1949458..00000000000 --- a/extensions/common/glm/gtx/io.inl +++ /dev/null @@ -1,618 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_io -/// @file glm/gtx/io.inl -/// @date 2013-11-22 / 2014-11-25 -/// @author Jan P Springer (regnirpsj@gmail.com) -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#include <iomanip> // std::setfill<>, std::fixed, std::setprecision, std::right, std::setw -#include <ostream> // std::basic_ostream<> - -namespace glm{ -namespace io -{ - template <typename CTy> - /* explicit */ GLM_FUNC_QUALIFIER - format_punct<CTy>::format_punct(size_t a) - : std::locale::facet(a), - formatted (true), - precision (3), - width (1 + 4 + 1 + precision), - separator (','), - delim_left ('['), - delim_right (']'), - space (' '), - newline ('\n'), - order (row_major) - {} - - template <typename CTy> - /* explicit */ GLM_FUNC_QUALIFIER - format_punct<CTy>::format_punct(format_punct const& a) - : std::locale::facet(0), - formatted (a.formatted), - precision (a.precision), - width (a.width), - separator (a.separator), - delim_left (a.delim_left), - delim_right (a.delim_right), - space (a.space), - newline (a.newline), - order (a.order) - {} - - template <typename CTy> std::locale::id format_punct<CTy>::id; - - template <typename CTy, typename CTr> - /* explicit */ GLM_FUNC_QUALIFIER basic_state_saver<CTy,CTr>::basic_state_saver(std::basic_ios<CTy,CTr>& a) - : state_ (a), - flags_ (a.flags()), - precision_(a.precision()), - width_ (a.width()), - fill_ (a.fill()), - locale_ (a.getloc()) - {} - - template <typename CTy, typename CTr> - GLM_FUNC_QUALIFIER basic_state_saver<CTy,CTr>::~basic_state_saver() - { - state_.imbue(locale_); - state_.fill(fill_); - state_.width(width_); - state_.precision(precision_); - state_.flags(flags_); - } - - template <typename CTy, typename CTr> - /* explicit */ GLM_FUNC_QUALIFIER basic_format_saver<CTy,CTr>::basic_format_saver(std::basic_ios<CTy,CTr>& a) - : bss_(a) - { - a.imbue(std::locale(a.getloc(), new format_punct<CTy>(get_facet<format_punct<CTy> >(a)))); - } - - template <typename CTy, typename CTr> - GLM_FUNC_QUALIFIER - basic_format_saver<CTy,CTr>::~basic_format_saver() - {} - - /* explicit */ GLM_FUNC_QUALIFIER precision::precision(unsigned a) - : value(a) - {} - - /* explicit */ GLM_FUNC_QUALIFIER width::width(unsigned a) - : value(a) - {} - - template <typename CTy> - /* explicit */ GLM_FUNC_QUALIFIER delimeter<CTy>::delimeter(CTy a, CTy b, CTy c) - : value() - { - value[0] = a; - value[1] = b; - value[2] = c; - } - - /* explicit */ GLM_FUNC_QUALIFIER - order::order(order_type a) - : value(a) - {} - - template <typename FTy, typename CTy, typename CTr> - GLM_FUNC_QUALIFIER FTy const& get_facet(std::basic_ios<CTy,CTr>& ios) - { - if (!std::has_facet<FTy>(ios.getloc())) { - ios.imbue(std::locale(ios.getloc(), new FTy)); - } - - return std::use_facet<FTy>(ios.getloc()); - } - - template <typename CTy, typename CTr> - GLM_FUNC_QUALIFIER std::basic_ios<CTy,CTr>& formatted(std::basic_ios<CTy,CTr>& ios) - { - const_cast<format_punct<CTy>&>(get_facet<format_punct<CTy> >(ios)).formatted = true; - - return ios; - } - - template <typename CTy, typename CTr> - GLM_FUNC_QUALIFIER std::basic_ios<CTy,CTr>& unformatted(std::basic_ios<CTy,CTr>& ios) - { - const_cast<format_punct<CTy>&>(get_facet<format_punct<CTy> >(ios)).formatted = false; - - return ios; - } - - template <typename CTy, typename CTr> - GLM_FUNC_QUALIFIER std::basic_ostream<CTy, CTr>& operator<<(std::basic_ostream<CTy, CTr>& os, precision const& a) - { - const_cast<format_punct<CTy>&>(get_facet<format_punct<CTy> >(os)).precision = a.value; - - return os; - } - - template <typename CTy, typename CTr> - GLM_FUNC_QUALIFIER std::basic_ostream<CTy, CTr>& operator<<(std::basic_ostream<CTy, CTr>& os, width const& a) - { - const_cast<format_punct<CTy>&>(get_facet<format_punct<CTy> >(os)).width = a.value; - - return os; - } - - template <typename CTy, typename CTr> - std::basic_ostream<CTy, CTr>& operator<<(std::basic_ostream<CTy, CTr>& os, delimeter<CTy> const& a) - { - format_punct<CTy> & fmt(const_cast<format_punct<CTy>&>(get_facet<format_punct<CTy> >(os))); - - fmt.delim_left = a.value[0]; - fmt.delim_right = a.value[1]; - fmt.separator = a.value[2]; - - return os; - } - - template <typename CTy, typename CTr> - GLM_FUNC_QUALIFIER std::basic_ostream<CTy, CTr>& operator<<(std::basic_ostream<CTy, CTr>& os, order const& a) - { - const_cast<format_punct<CTy>&>(get_facet<format_punct<CTy> >(os)).order = a.value; - - return os; - } -} // namespace io - - template <typename CTy, typename CTr, typename T, precision P> - GLM_FUNC_QUALIFIER std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>& os, tquat<T,P> const& a) - { - typename std::basic_ostream<CTy,CTr>::sentry const cerberus(os); - - if(cerberus) - { - io::format_punct<CTy> const & fmt(io::get_facet<io::format_punct<CTy> >(os)); - - if(fmt.formatted) - { - io::basic_state_saver<CTy> const bss(os); - - os << std::fixed - << std::right - << std::setprecision(fmt.precision) - << std::setfill(fmt.space) - << fmt.delim_left - << std::setw(fmt.width) << a.w << fmt.separator - << std::setw(fmt.width) << a.x << fmt.separator - << std::setw(fmt.width) << a.y << fmt.separator - << std::setw(fmt.width) << a.z - << fmt.delim_right; - } - else - { - os << a.w << fmt.space << a.x << fmt.space << a.y << fmt.space << a.z; - } - } - - return os; - } - - template <typename CTy, typename CTr, typename T, precision P> - GLM_FUNC_QUALIFIER std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>& os, tvec2<T,P> const& a) - { - typename std::basic_ostream<CTy,CTr>::sentry const cerberus(os); - - if(cerberus) - { - io::format_punct<CTy> const & fmt(io::get_facet<io::format_punct<CTy> >(os)); - - if(fmt.formatted) - { - io::basic_state_saver<CTy> const bss(os); - - os << std::fixed - << std::right - << std::setprecision(fmt.precision) - << std::setfill(fmt.space) - << fmt.delim_left - << std::setw(fmt.width) << a.x << fmt.separator - << std::setw(fmt.width) << a.y - << fmt.delim_right; - } - else - { - os << a.x << fmt.space << a.y; - } - } - - return os; - } - - template <typename CTy, typename CTr, typename T, precision P> - GLM_FUNC_QUALIFIER std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>& os, tvec3<T,P> const& a) - { - typename std::basic_ostream<CTy,CTr>::sentry const cerberus(os); - - if(cerberus) - { - io::format_punct<CTy> const & fmt(io::get_facet<io::format_punct<CTy> >(os)); - - if(fmt.formatted) - { - io::basic_state_saver<CTy> const bss(os); - - os << std::fixed - << std::right - << std::setprecision(fmt.precision) - << std::setfill(fmt.space) - << fmt.delim_left - << std::setw(fmt.width) << a.x << fmt.separator - << std::setw(fmt.width) << a.y << fmt.separator - << std::setw(fmt.width) << a.z - << fmt.delim_right; - } - else - { - os << a.x << fmt.space << a.y << fmt.space << a.z; - } - } - - return os; - } - - template <typename CTy, typename CTr, typename T, precision P> - GLM_FUNC_QUALIFIER std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>& os, tvec4<T,P> const& a) - { - typename std::basic_ostream<CTy,CTr>::sentry const cerberus(os); - - if(cerberus) - { - io::format_punct<CTy> const & fmt(io::get_facet<io::format_punct<CTy> >(os)); - - if(fmt.formatted) - { - io::basic_state_saver<CTy> const bss(os); - - os << std::fixed - << std::right - << std::setprecision(fmt.precision) - << std::setfill(fmt.space) - << fmt.delim_left - << std::setw(fmt.width) << a.x << fmt.separator - << std::setw(fmt.width) << a.y << fmt.separator - << std::setw(fmt.width) << a.z << fmt.separator - << std::setw(fmt.width) << a.w - << fmt.delim_right; - } - else - { - os << a.x << fmt.space << a.y << fmt.space << a.z << fmt.space << a.w; - } - } - - return os; - } - - template <typename CTy, typename CTr, typename T, precision P> - GLM_FUNC_QUALIFIER std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>& os, tmat2x2<T,P> const& a) - { - typename std::basic_ostream<CTy,CTr>::sentry const cerberus(os); - - if(cerberus) - { - io::format_punct<CTy> const & fmt(io::get_facet<io::format_punct<CTy> >(os)); - tmat2x2<T,P> m(a); - - if(io::row_major == fmt.order) - m = transpose(a); - - if(fmt.formatted) - { - os << fmt.newline - << fmt.delim_left << m[0] << fmt.newline - << fmt.space << m[1] << fmt.delim_right; - } - else - { - os << m[0] << fmt.space << m[1]; - } - } - - return os; - } - - template <typename CTy, typename CTr, typename T, precision P> - GLM_FUNC_QUALIFIER std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>& os, tmat2x3<T,P> const& a) - { - typename std::basic_ostream<CTy,CTr>::sentry const cerberus(os); - - if(cerberus) - { - io::format_punct<CTy> const & fmt(io::get_facet<io::format_punct<CTy> >(os)); - tmat3x2<T,P> m(a); - - if(io::row_major == fmt.order) - m = transpose(a); - - if(fmt.formatted) - { - os << fmt.newline - << fmt.delim_left << m[0] << fmt.newline - << fmt.space << m[1] << fmt.newline - << fmt.space << m[2] << fmt.delim_right; - } - else - { - os << m[0] << fmt.space << m[1] << fmt.space << m[2]; - } - } - - return os; - } - - template <typename CTy, typename CTr, typename T, precision P> - GLM_FUNC_QUALIFIER std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>& os, tmat2x4<T,P> const& a) - { - typename std::basic_ostream<CTy,CTr>::sentry const cerberus(os); - - if(cerberus) - { - io::format_punct<CTy> const & fmt(io::get_facet<io::format_punct<CTy> >(os)); - tmat4x2<T,P> m(a); - - if(io::row_major == fmt.order) - m = transpose(a); - - - if(fmt.formatted) - { - os << fmt.newline - << fmt.delim_left << m[0] << fmt.newline - << fmt.space << m[1] << fmt.newline - << fmt.space << m[2] << fmt.newline - << fmt.space << m[3] << fmt.delim_right; - } - else - { - os << m[0] << fmt.space << m[1] << fmt.space << m[2] << fmt.space << m[3]; - } - } - - return os; - } - - template <typename CTy, typename CTr, typename T, precision P> - GLM_FUNC_QUALIFIER std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>& os, tmat3x2<T,P> const& a) - { - typename std::basic_ostream<CTy,CTr>::sentry const cerberus(os); - - if(cerberus) - { - io::format_punct<CTy> const & fmt(io::get_facet<io::format_punct<CTy> >(os)); - tmat2x3<T,P> m(a); - - if(io::row_major == fmt.order) - m = transpose(a); - - if(fmt.formatted) - { - os << fmt.newline - << fmt.delim_left << m[0] << fmt.newline - << fmt.space << m[1] << fmt.delim_right; - } - else - { - os << m[0] << fmt.space << m[1]; - } - } - - return os; - } - - template <typename CTy, typename CTr, typename T, precision P> - GLM_FUNC_QUALIFIER std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>& os, tmat3x3<T,P> const& a) - { - typename std::basic_ostream<CTy,CTr>::sentry const cerberus(os); - - if(cerberus) - { - io::format_punct<CTy> const & fmt(io::get_facet<io::format_punct<CTy> >(os)); - tmat3x3<T,P> m(a); - - if(io::row_major == fmt.order) - m = transpose(a); - - if(fmt.formatted) - { - os << fmt.newline - << fmt.delim_left << m[0] << fmt.newline - << fmt.space << m[1] << fmt.newline - << fmt.space << m[2] << fmt.delim_right; - } - else - { - os << m[0] << fmt.space << m[1] << fmt.space << m[2]; - } - } - - return os; - } - - template <typename CTy, typename CTr, typename T, precision P> - GLM_FUNC_QUALIFIER std::basic_ostream<CTy,CTr> & operator<<(std::basic_ostream<CTy,CTr>& os, tmat3x4<T,P> const& a) - { - typename std::basic_ostream<CTy,CTr>::sentry const cerberus(os); - - if(cerberus) - { - io::format_punct<CTy> const & fmt(io::get_facet<io::format_punct<CTy> >(os)); - tmat4x3<T,P> m(a); - - if(io::row_major == fmt.order) - m = transpose(a); - - if (fmt.formatted) - { - os << fmt.newline - << fmt.delim_left << m[0] << fmt.newline - << fmt.space << m[1] << fmt.newline - << fmt.space << m[2] << fmt.newline - << fmt.space << m[3] << fmt.delim_right; - } - else - { - os << m[0] << fmt.space << m[1] << fmt.space << m[2] << fmt.space << m[3]; - } - } - - return os; - } - - template <typename CTy, typename CTr, typename T, precision P> - GLM_FUNC_QUALIFIER std::basic_ostream<CTy,CTr> & operator<<(std::basic_ostream<CTy,CTr>& os, tmat4x2<T,P> const& a) - { - typename std::basic_ostream<CTy,CTr>::sentry const cerberus(os); - - if(cerberus) - { - io::format_punct<CTy> const & fmt(io::get_facet<io::format_punct<CTy> >(os)); - tmat2x4<T,P> m(a); - - if(io::row_major == fmt.order) - m = transpose(a); - - if (fmt.formatted) - { - os << fmt.newline - << fmt.delim_left << m[0] << fmt.newline - << fmt.space << m[1] << fmt.delim_right; - } - else - { - os << m[0] << fmt.space << m[1]; - } - } - - return os; - } - - template <typename CTy, typename CTr, typename T, precision P> - GLM_FUNC_QUALIFIER std::basic_ostream<CTy,CTr> & operator<<(std::basic_ostream<CTy,CTr>& os, tmat4x3<T,P> const& a) - { - typename std::basic_ostream<CTy,CTr>::sentry const cerberus(os); - - if(cerberus) - { - io::format_punct<CTy> const & fmt(io::get_facet<io::format_punct<CTy> >(os)); - tmat3x4<T,P> m(a); - - if(io::row_major == fmt.order) - m = transpose(a); - - if(fmt.formatted) - { - os << fmt.newline - << fmt.delim_left << m[0] << fmt.newline - << fmt.space << m[1] << fmt.newline - << fmt.space << m[2] << fmt.delim_right; - } - else - { - os << m[0] << fmt.space << m[1] << fmt.space << m[2]; - } - } - - return os; - } - - template <typename CTy, typename CTr, typename T, precision P> - GLM_FUNC_QUALIFIER std::basic_ostream<CTy,CTr> & operator<<(std::basic_ostream<CTy,CTr>& os, tmat4x4<T,P> const& a) - { - typename std::basic_ostream<CTy,CTr>::sentry const cerberus(os); - - if(cerberus) - { - io::format_punct<CTy> const & fmt(io::get_facet<io::format_punct<CTy> >(os)); - tmat4x4<T,P> m(a); - - if (io::row_major == fmt.order) - m = transpose(a); - - if(fmt.formatted) - { - os << fmt.newline - << fmt.delim_left << m[0] << fmt.newline - << fmt.space << m[1] << fmt.newline - << fmt.space << m[2] << fmt.newline - << fmt.space << m[3] << fmt.delim_right; - } - else - { - os << m[0] << fmt.space << m[1] << fmt.space << m[2] << fmt.space << m[3]; - } - } - - return os; - } - - template <typename CTy, typename CTr, typename T, precision P> - GLM_FUNC_QUALIFIER std::basic_ostream<CTy,CTr>& operator<<( - std::basic_ostream<CTy,CTr> & os, - std::pair<tmat4x4<T,P> const, tmat4x4<T,P> const> const& a) - { - typename std::basic_ostream<CTy,CTr>::sentry const cerberus(os); - - if(cerberus) - { - io::format_punct<CTy> const & fmt(io::get_facet<io::format_punct<CTy> >(os)); - tmat4x4<T,P> ml(a.first); - tmat4x4<T,P> mr(a.second); - - if(io::row_major == fmt.order) - { - ml = transpose(a.first); - mr = transpose(a.second); - } - - if(fmt.formatted) - { - CTy const & l(fmt.delim_left); - CTy const & r(fmt.delim_right); - CTy const & s(fmt.space); - - os << fmt.newline - << l << ml[0] << s << s << l << mr[0] << fmt.newline - << s << ml[1] << s << s << s << mr[1] << fmt.newline - << s << ml[2] << s << s << s << mr[2] << fmt.newline - << s << ml[3] << r << s << s << mr[3] << r; - } - else - { - os << ml << fmt.space << mr; - } - } - - return os; - } -}//namespace glm diff --git a/extensions/common/glm/gtx/log_base.hpp b/extensions/common/glm/gtx/log_base.hpp deleted file mode 100644 index 046b03c1e31..00000000000 --- a/extensions/common/glm/gtx/log_base.hpp +++ /dev/null @@ -1,73 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_log_base -/// @file glm/gtx/log_base.hpp -/// @date 2008-10-24 / 2011-06-07 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// -/// @defgroup gtx_log_base GLM_GTX_log_base -/// @ingroup gtx -/// -/// @brief Logarithm for any base. base can be a vector or a scalar. -/// -/// <glm/gtx/log_base.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependency: -#include "../glm.hpp" - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTX_log_base extension included") -#endif - -namespace glm -{ - /// @addtogroup gtx_log_base - /// @{ - - //! Logarithm for any base. - //! From GLM_GTX_log_base. - template <typename genType> - GLM_FUNC_DECL genType log( - genType x, - genType base); - - //! Logarithm for any base. - //! From GLM_GTX_log_base. - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<T, P> sign( - vecType<T, P> const & x, - vecType<T, P> const & base); - - /// @} -}//namespace glm - -#include "log_base.inl" diff --git a/extensions/common/glm/gtx/log_base.inl b/extensions/common/glm/gtx/log_base.inl deleted file mode 100644 index 95b8dfaac9d..00000000000 --- a/extensions/common/glm/gtx/log_base.inl +++ /dev/null @@ -1,47 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_log_base -/// @file glm/gtx/log_base.inl -/// @date 2008-10-24 / 2014-11-25 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template <typename genType> - GLM_FUNC_QUALIFIER genType log(genType const & x, genType const & base) - { - assert(x != genType(0)); - return glm::log(x) / glm::log(base); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> log(vecType<T, P> const & x, vecType<T, P> const & base) - { - return glm::log(x) / glm::log(base); - } -}//namespace glm diff --git a/extensions/common/glm/gtx/matrix_cross_product.hpp b/extensions/common/glm/gtx/matrix_cross_product.hpp deleted file mode 100644 index d76341998ac..00000000000 --- a/extensions/common/glm/gtx/matrix_cross_product.hpp +++ /dev/null @@ -1,72 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_matrix_cross_product -/// @file glm/gtx/matrix_cross_product.hpp -/// @date 2005-12-21 / 2011-06-07 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// @see gtx_extented_min_max (dependence) -/// -/// @defgroup gtx_matrix_cross_product GLM_GTX_matrix_cross_product -/// @ingroup gtx -/// -/// @brief Build cross product matrices -/// -/// <glm/gtx/matrix_cross_product.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependency: -#include "../glm.hpp" - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTX_matrix_cross_product extension included") -#endif - -namespace glm -{ - /// @addtogroup gtx_matrix_cross_product - /// @{ - - //! Build a cross product matrix. - //! From GLM_GTX_matrix_cross_product extension. - template <typename T, precision P> - GLM_FUNC_DECL tmat3x3<T, P> matrixCross3( - tvec3<T, P> const & x); - - //! Build a cross product matrix. - //! From GLM_GTX_matrix_cross_product extension. - template <typename T, precision P> - GLM_FUNC_DECL tmat4x4<T, P> matrixCross4( - tvec3<T, P> const & x); - - /// @} -}//namespace glm - -#include "matrix_cross_product.inl" diff --git a/extensions/common/glm/gtx/matrix_cross_product.inl b/extensions/common/glm/gtx/matrix_cross_product.inl deleted file mode 100644 index 9665b067fcb..00000000000 --- a/extensions/common/glm/gtx/matrix_cross_product.inl +++ /dev/null @@ -1,67 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_matrix_cross_product -/// @file glm/gtx/matrix_cross_product.inl -/// @date 2005-12-21 / 2005-12-21 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x3<T, P> matrixCross3 - ( - tvec3<T, P> const & x - ) - { - tmat3x3<T, P> Result(T(0)); - Result[0][1] = x.z; - Result[1][0] = -x.z; - Result[0][2] = -x.y; - Result[2][0] = x.y; - Result[1][2] = x.x; - Result[2][1] = -x.x; - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P> matrixCross4 - ( - tvec3<T, P> const & x - ) - { - tmat4x4<T, P> Result(T(0)); - Result[0][1] = x.z; - Result[1][0] = -x.z; - Result[0][2] = -x.y; - Result[2][0] = x.y; - Result[1][2] = x.x; - Result[2][1] = -x.x; - return Result; - } - -}//namespace glm diff --git a/extensions/common/glm/gtx/matrix_decompose.hpp b/extensions/common/glm/gtx/matrix_decompose.hpp deleted file mode 100644 index 05ce6ff385b..00000000000 --- a/extensions/common/glm/gtx/matrix_decompose.hpp +++ /dev/null @@ -1,70 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_matrix_decompose -/// @file glm/gtx/matrix_decompose.hpp -/// @date 2014-08-29 / 2014-08-29 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// -/// @defgroup gtx_matrix_decompose GLM_GTX_matrix_decompose -/// @ingroup gtx -/// -/// @brief Decomposes a model matrix to translations, rotation and scale components -/// -/// <glm/gtx/decomposition.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependencies -#include "../mat4x4.hpp" -#include "../vec3.hpp" -#include "../vec4.hpp" -#include "../gtc/quaternion.hpp" -#include "../gtc/matrix_transform.hpp" - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTX_matrix_decompose extension included") -#endif - -namespace glm -{ - /// @addtogroup gtx_matrix_decompose - /// @{ - - /// Decomposes a model matrix to translations, rotation and scale components - /// @see gtx_matrix_decompose - template <typename T, precision P> - GLM_FUNC_DECL bool decompose( - tmat4x4<T, P> const & modelMatrix, - tvec3<T, P> & scale, tquat<T, P> & orientation, tvec3<T, P> & translation, tvec3<T, P> & skew, tvec4<T, P> & perspective); - - /// @} -}//namespace glm - -#include "matrix_decompose.inl" diff --git a/extensions/common/glm/gtx/matrix_decompose.inl b/extensions/common/glm/gtx/matrix_decompose.inl deleted file mode 100644 index ba507d0eec0..00000000000 --- a/extensions/common/glm/gtx/matrix_decompose.inl +++ /dev/null @@ -1,231 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_matrix_decompose -/// @file glm/gtx/matrix_decompose.inl -/// @date 2014-08-29 / 2014-08-29 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - /// Make a linear combination of two vectors and return the result. - // result = (a * ascl) + (b * bscl) - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> combine( - tvec3<T, P> const & a, - tvec3<T, P> const & b, - T ascl, T bscl) - { - return (a * ascl) + (b * bscl); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER void v3Scale(tvec3<T, P> & v, T desiredLength) - { - T len = glm::length(v); - if(len != 0) - { - T l = desiredLength / len; - v[0] *= l; - v[1] *= l; - v[2] *= l; - } - } - - /** - * Matrix decompose - * http://www.opensource.apple.com/source/WebCore/WebCore-514/platform/graphics/transforms/TransformationMatrix.cpp - * Decomposes the mode matrix to translations,rotation scale components - * - */ - - template <typename T, precision P> - GLM_FUNC_QUALIFIER bool decompose(tmat4x4<T, P> const & ModelMatrix, tvec3<T, P> & Scale, tquat<T, P> & Orientation, tvec3<T, P> & Translation, tvec3<T, P> & Skew, tvec4<T, P> & Perspective) - { - tmat4x4<T, P> LocalMatrix(ModelMatrix); - - // Normalize the matrix. - if(LocalMatrix[3][3] == static_cast<T>(0)) - return false; - - for(length_t i = 0; i < 4; ++i) - for(length_t j = 0; j < 4; ++j) - LocalMatrix[i][j] /= LocalMatrix[3][3]; - - // perspectiveMatrix is used to solve for perspective, but it also provides - // an easy way to test for singularity of the upper 3x3 component. - tmat4x4<T, P> PerspectiveMatrix(LocalMatrix); - - for(length_t i = 0; i < 3; i++) - PerspectiveMatrix[i][3] = 0; - PerspectiveMatrix[3][3] = 1; - - /// TODO: Fixme! - if(determinant(PerspectiveMatrix) == static_cast<T>(0)) - return false; - - // First, isolate perspective. This is the messiest. - if(LocalMatrix[0][3] != 0 || LocalMatrix[1][3] != 0 || LocalMatrix[2][3] != 0) - { - // rightHandSide is the right hand side of the equation. - tvec4<T, P> RightHandSide; - RightHandSide[0] = LocalMatrix[0][3]; - RightHandSide[1] = LocalMatrix[1][3]; - RightHandSide[2] = LocalMatrix[2][3]; - RightHandSide[3] = LocalMatrix[3][3]; - - // Solve the equation by inverting PerspectiveMatrix and multiplying - // rightHandSide by the inverse. (This is the easiest way, not - // necessarily the best.) - tmat4x4<T, P> InversePerspectiveMatrix = glm::inverse(PerspectiveMatrix);// inverse(PerspectiveMatrix, inversePerspectiveMatrix); - tmat4x4<T, P> TransposedInversePerspectiveMatrix = glm::transpose(InversePerspectiveMatrix);// transposeMatrix4(inversePerspectiveMatrix, transposedInversePerspectiveMatrix); - - Perspective = TransposedInversePerspectiveMatrix * RightHandSide; - // v4MulPointByMatrix(rightHandSide, transposedInversePerspectiveMatrix, perspectivePoint); - - // Clear the perspective partition - LocalMatrix[0][3] = LocalMatrix[1][3] = LocalMatrix[2][3] = 0; - LocalMatrix[3][3] = 1; - } - else - { - // No perspective. - Perspective = tvec4<T, P>(0, 0, 0, 1); - } - - // Next take care of translation (easy). - Translation = tvec3<T, P>(LocalMatrix[3]); - LocalMatrix[3] = tvec4<T, P>(0, 0, 0, LocalMatrix[3].w); - - tvec3<T, P> Row[3], Pdum3; - - // Now get scale and shear. - for(length_t i = 0; i < 3; ++i) - for(int j = 0; j < 3; ++j) - Row[i][j] = LocalMatrix[i][j]; - - // Compute X scale factor and normalize first row. - Scale.x = length(Row[0]);// v3Length(Row[0]); - - v3Scale(Row[0], static_cast<T>(1)); - - // Compute XY shear factor and make 2nd row orthogonal to 1st. - Skew.z = dot(Row[0], Row[1]); - Row[1] = combine(Row[1], Row[0], static_cast<T>(1), -Skew.z); - - // Now, compute Y scale and normalize 2nd row. - Scale.y = length(Row[1]); - v3Scale(Row[1], static_cast<T>(1)); - Skew.z /= Scale.y; - - // Compute XZ and YZ shears, orthogonalize 3rd row. - Skew.y = glm::dot(Row[0], Row[2]); - Row[2] = combine(Row[2], Row[0], static_cast<T>(1), -Skew.y); - Skew.x = glm::dot(Row[1], Row[2]); - Row[2] = combine(Row[2], Row[1], static_cast<T>(1), -Skew.x); - - // Next, get Z scale and normalize 3rd row. - Scale.z = length(Row[2]); - v3Scale(Row[2], static_cast<T>(1)); - Skew.y /= Scale.z; - Skew.x /= Scale.z; - - // At this point, the matrix (in rows[]) is orthonormal. - // Check for a coordinate system flip. If the determinant - // is -1, then negate the matrix and the scaling factors. - Pdum3 = cross(Row[1], Row[2]); // v3Cross(row[1], row[2], Pdum3); - if(dot(Row[0], Pdum3) < 0) - { - for(length_t i = 0; i < 3; i++) - { - Scale.x *= static_cast<T>(-1); - Row[i] *= static_cast<T>(-1); - } - } - - // Now, get the rotations out, as described in the gem. - - // FIXME - Add the ability to return either quaternions (which are - // easier to recompose with) or Euler angles (rx, ry, rz), which - // are easier for authors to deal with. The latter will only be useful - // when we fix https://bugs.webkit.org/show_bug.cgi?id=23799, so I - // will leave the Euler angle code here for now. - - // ret.rotateY = asin(-Row[0][2]); - // if (cos(ret.rotateY) != 0) { - // ret.rotateX = atan2(Row[1][2], Row[2][2]); - // ret.rotateZ = atan2(Row[0][1], Row[0][0]); - // } else { - // ret.rotateX = atan2(-Row[2][0], Row[1][1]); - // ret.rotateZ = 0; - // } - - T s, t, x, y, z, w; - - t = Row[0][0] + Row[1][1] + Row[2][2] + 1.0; - - if(t > 1e-4) - { - s = 0.5 / sqrt(t); - w = 0.25 / s; - x = (Row[2][1] - Row[1][2]) * s; - y = (Row[0][2] - Row[2][0]) * s; - z = (Row[1][0] - Row[0][1]) * s; - } - else if(Row[0][0] > Row[1][1] && Row[0][0] > Row[2][2]) - { - s = sqrt (1.0 + Row[0][0] - Row[1][1] - Row[2][2]) * 2.0; // S=4*qx - x = 0.25 * s; - y = (Row[0][1] + Row[1][0]) / s; - z = (Row[0][2] + Row[2][0]) / s; - w = (Row[2][1] - Row[1][2]) / s; - } - else if(Row[1][1] > Row[2][2]) - { - s = sqrt (1.0 + Row[1][1] - Row[0][0] - Row[2][2]) * 2.0; // S=4*qy - x = (Row[0][1] + Row[1][0]) / s; - y = 0.25 * s; - z = (Row[1][2] + Row[2][1]) / s; - w = (Row[0][2] - Row[2][0]) / s; - } - else - { - s = sqrt(1.0 + Row[2][2] - Row[0][0] - Row[1][1]) * 2.0; // S=4*qz - x = (Row[0][2] + Row[2][0]) / s; - y = (Row[1][2] + Row[2][1]) / s; - z = 0.25 * s; - w = (Row[1][0] - Row[0][1]) / s; - } - - Orientation.x = x; - Orientation.y = y; - Orientation.z = z; - Orientation.w = w; - - return true; - } -}//namespace glm diff --git a/extensions/common/glm/gtx/matrix_interpolation.hpp b/extensions/common/glm/gtx/matrix_interpolation.hpp deleted file mode 100644 index 11cbdc8eb92..00000000000 --- a/extensions/common/glm/gtx/matrix_interpolation.hpp +++ /dev/null @@ -1,89 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_matrix_interpolation -/// @file glm/gtx/matrix_interpolation.hpp -/// @date 2011-03-05 / 2011-06-07 -/// @author Ghenadii Ursachi (the.asteroth@gmail.com) -/// -/// @see core (dependence) -/// -/// @defgroup gtx_matrix_interpolation GLM_GTX_matrix_interpolation -/// @ingroup gtx -/// -/// @brief Allows to directly interpolate two exiciting matrices. -/// -/// <glm/gtx/matrix_interpolation.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependency: -#include "../glm.hpp" - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTX_matrix_interpolation extension included") -#endif - -namespace glm -{ - /// @addtogroup gtx_matrix_interpolation - /// @{ - - /// Get the axis and angle of the rotation from a matrix. - /// From GLM_GTX_matrix_interpolation extension. - template <typename T, precision P> - GLM_FUNC_DECL void axisAngle( - tmat4x4<T, P> const & mat, - tvec3<T, P> & axis, - T & angle); - - /// Build a matrix from axis and angle. - /// From GLM_GTX_matrix_interpolation extension. - template <typename T, precision P> - GLM_FUNC_DECL tmat4x4<T, P> axisAngleMatrix( - tvec3<T, P> const & axis, - T const angle); - - /// Extracts the rotation part of a matrix. - /// From GLM_GTX_matrix_interpolation extension. - template <typename T, precision P> - GLM_FUNC_DECL tmat4x4<T, P> extractMatrixRotation( - tmat4x4<T, P> const & mat); - - /// Build a interpolation of 4 * 4 matrixes. - /// From GLM_GTX_matrix_interpolation extension. - /// Warning! works only with rotation and/or translation matrixes, scale will generate unexpected results. - template <typename T, precision P> - GLM_FUNC_DECL tmat4x4<T, P> interpolate( - tmat4x4<T, P> const & m1, - tmat4x4<T, P> const & m2, - T const delta); - - /// @} -}//namespace glm - -#include "matrix_interpolation.inl" diff --git a/extensions/common/glm/gtx/matrix_interpolation.inl b/extensions/common/glm/gtx/matrix_interpolation.inl deleted file mode 100644 index 5112d1ac255..00000000000 --- a/extensions/common/glm/gtx/matrix_interpolation.inl +++ /dev/null @@ -1,163 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_matrix_interpolation -/// @file glm/gtx/matrix_interpolation.hpp -/// @date 2011-03-05 / 2011-03-05 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template <typename T, precision P> - GLM_FUNC_QUALIFIER void axisAngle - ( - tmat4x4<T, P> const & mat, - tvec3<T, P> & axis, - T & angle - ) - { - T epsilon = (T)0.01; - T epsilon2 = (T)0.1; - - if((abs(mat[1][0] - mat[0][1]) < epsilon) && (abs(mat[2][0] - mat[0][2]) < epsilon) && (abs(mat[2][1] - mat[1][2]) < epsilon)) - { - if ((abs(mat[1][0] + mat[0][1]) < epsilon2) && (abs(mat[2][0] + mat[0][2]) < epsilon2) && (abs(mat[2][1] + mat[1][2]) < epsilon2) && (abs(mat[0][0] + mat[1][1] + mat[2][2] - (T)3.0) < epsilon2)) - { - angle = (T)0.0; - axis.x = (T)1.0; - axis.y = (T)0.0; - axis.z = (T)0.0; - return; - } - angle = static_cast<T>(3.1415926535897932384626433832795); - T xx = (mat[0][0] + (T)1.0) / (T)2.0; - T yy = (mat[1][1] + (T)1.0) / (T)2.0; - T zz = (mat[2][2] + (T)1.0) / (T)2.0; - T xy = (mat[1][0] + mat[0][1]) / (T)4.0; - T xz = (mat[2][0] + mat[0][2]) / (T)4.0; - T yz = (mat[2][1] + mat[1][2]) / (T)4.0; - if((xx > yy) && (xx > zz)) - { - if (xx < epsilon) { - axis.x = (T)0.0; - axis.y = (T)0.7071; - axis.z = (T)0.7071; - } else { - axis.x = sqrt(xx); - axis.y = xy / axis.x; - axis.z = xz / axis.x; - } - } - else if (yy > zz) - { - if (yy < epsilon) { - axis.x = (T)0.7071; - axis.y = (T)0.0; - axis.z = (T)0.7071; - } else { - axis.y = sqrt(yy); - axis.x = xy / axis.y; - axis.z = yz / axis.y; - } - } - else - { - if (zz < epsilon) { - axis.x = (T)0.7071; - axis.y = (T)0.7071; - axis.z = (T)0.0; - } else { - axis.z = sqrt(zz); - axis.x = xz / axis.z; - axis.y = yz / axis.z; - } - } - return; - } - T s = sqrt((mat[2][1] - mat[1][2]) * (mat[2][1] - mat[1][2]) + (mat[2][0] - mat[0][2]) * (mat[2][0] - mat[0][2]) + (mat[1][0] - mat[0][1]) * (mat[1][0] - mat[0][1])); - if (glm::abs(s) < T(0.001)) - s = (T)1.0; - angle = acos((mat[0][0] + mat[1][1] + mat[2][2] - (T)1.0) / (T)2.0); - axis.x = (mat[1][2] - mat[2][1]) / s; - axis.y = (mat[2][0] - mat[0][2]) / s; - axis.z = (mat[0][1] - mat[1][0]) / s; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P> axisAngleMatrix - ( - tvec3<T, P> const & axis, - T const angle - ) - { - T c = cos(angle); - T s = sin(angle); - T t = static_cast<T>(1) - c; - tvec3<T, P> n = normalize(axis); - - return tmat4x4<T, P>( - t * n.x * n.x + c, t * n.x * n.y + n.z * s, t * n.x * n.z - n.y * s, T(0), - t * n.x * n.y - n.z * s, t * n.y * n.y + c, t * n.y * n.z + n.x * s, T(0), - t * n.x * n.z + n.y * s, t * n.y * n.z - n.x * s, t * n.z * n.z + c, T(0), - T(0), T(0), T(0), T(1) - ); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P> extractMatrixRotation - ( - tmat4x4<T, P> const & mat - ) - { - return tmat4x4<T, P>( - mat[0][0], mat[0][1], mat[0][2], 0.0, - mat[1][0], mat[1][1], mat[1][2], 0.0, - mat[2][0], mat[2][1], mat[2][2], 0.0, - 0.0, 0.0, 0.0, 1.0 - ); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P> interpolate - ( - tmat4x4<T, P> const & m1, - tmat4x4<T, P> const & m2, - T const delta - ) - { - tmat4x4<T, P> m1rot = extractMatrixRotation(m1); - tmat4x4<T, P> dltRotation = m2 * transpose(m1rot); - tvec3<T, P> dltAxis; - T dltAngle; - axisAngle(dltRotation, dltAxis, dltAngle); - tmat4x4<T, P> out = axisAngleMatrix(dltAxis, dltAngle * delta) * m1rot; - out[3][0] = m1[3][0] + delta * (m2[3][0] - m1[3][0]); - out[3][1] = m1[3][1] + delta * (m2[3][1] - m1[3][1]); - out[3][2] = m1[3][2] + delta * (m2[3][2] - m1[3][2]); - return out; - } -}//namespace glm diff --git a/extensions/common/glm/gtx/matrix_major_storage.hpp b/extensions/common/glm/gtx/matrix_major_storage.hpp deleted file mode 100644 index 2f3b0fe4409..00000000000 --- a/extensions/common/glm/gtx/matrix_major_storage.hpp +++ /dev/null @@ -1,144 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_matrix_major_storage -/// @file glm/gtx/matrix_major_storage.hpp -/// @date 2006-04-19 / 2011-06-07 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// @see gtx_extented_min_max (dependence) -/// -/// @defgroup gtx_matrix_major_storage GLM_GTX_matrix_major_storage -/// @ingroup gtx -/// -/// @brief Build matrices with specific matrix order, row or column -/// -/// <glm/gtx/matrix_major_storage.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependency: -#include "../glm.hpp" - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTX_matrix_major_storage extension included") -#endif - -namespace glm -{ - /// @addtogroup gtx_matrix_major_storage - /// @{ - - //! Build a row major matrix from row vectors. - //! From GLM_GTX_matrix_major_storage extension. - template <typename T, precision P> - GLM_FUNC_DECL tmat2x2<T, P> rowMajor2( - tvec2<T, P> const & v1, - tvec2<T, P> const & v2); - - //! Build a row major matrix from other matrix. - //! From GLM_GTX_matrix_major_storage extension. - template <typename T, precision P> - GLM_FUNC_DECL tmat2x2<T, P> rowMajor2( - tmat2x2<T, P> const & m); - - //! Build a row major matrix from row vectors. - //! From GLM_GTX_matrix_major_storage extension. - template <typename T, precision P> - GLM_FUNC_DECL tmat3x3<T, P> rowMajor3( - tvec3<T, P> const & v1, - tvec3<T, P> const & v2, - tvec3<T, P> const & v3); - - //! Build a row major matrix from other matrix. - //! From GLM_GTX_matrix_major_storage extension. - template <typename T, precision P> - GLM_FUNC_DECL tmat3x3<T, P> rowMajor3( - tmat3x3<T, P> const & m); - - //! Build a row major matrix from row vectors. - //! From GLM_GTX_matrix_major_storage extension. - template <typename T, precision P> - GLM_FUNC_DECL tmat4x4<T, P> rowMajor4( - tvec4<T, P> const & v1, - tvec4<T, P> const & v2, - tvec4<T, P> const & v3, - tvec4<T, P> const & v4); - - //! Build a row major matrix from other matrix. - //! From GLM_GTX_matrix_major_storage extension. - template <typename T, precision P> - GLM_FUNC_DECL tmat4x4<T, P> rowMajor4( - tmat4x4<T, P> const & m); - - //! Build a column major matrix from column vectors. - //! From GLM_GTX_matrix_major_storage extension. - template <typename T, precision P> - GLM_FUNC_DECL tmat2x2<T, P> colMajor2( - tvec2<T, P> const & v1, - tvec2<T, P> const & v2); - - //! Build a column major matrix from other matrix. - //! From GLM_GTX_matrix_major_storage extension. - template <typename T, precision P> - GLM_FUNC_DECL tmat2x2<T, P> colMajor2( - tmat2x2<T, P> const & m); - - //! Build a column major matrix from column vectors. - //! From GLM_GTX_matrix_major_storage extension. - template <typename T, precision P> - GLM_FUNC_DECL tmat3x3<T, P> colMajor3( - tvec3<T, P> const & v1, - tvec3<T, P> const & v2, - tvec3<T, P> const & v3); - - //! Build a column major matrix from other matrix. - //! From GLM_GTX_matrix_major_storage extension. - template <typename T, precision P> - GLM_FUNC_DECL tmat3x3<T, P> colMajor3( - tmat3x3<T, P> const & m); - - //! Build a column major matrix from column vectors. - //! From GLM_GTX_matrix_major_storage extension. - template <typename T, precision P> - GLM_FUNC_DECL tmat4x4<T, P> colMajor4( - tvec4<T, P> const & v1, - tvec4<T, P> const & v2, - tvec4<T, P> const & v3, - tvec4<T, P> const & v4); - - //! Build a column major matrix from other matrix. - //! From GLM_GTX_matrix_major_storage extension. - template <typename T, precision P> - GLM_FUNC_DECL tmat4x4<T, P> colMajor4( - tmat4x4<T, P> const & m); - - /// @} -}//namespace glm - -#include "matrix_major_storage.inl" diff --git a/extensions/common/glm/gtx/matrix_major_storage.inl b/extensions/common/glm/gtx/matrix_major_storage.inl deleted file mode 100644 index 5166a667aca..00000000000 --- a/extensions/common/glm/gtx/matrix_major_storage.inl +++ /dev/null @@ -1,196 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_matrix_major_storage -/// @file glm/gtx/matrix_major_storage.hpp -/// @date 2006-04-19 / 2014-11-25 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x2<T, P> rowMajor2 - ( - tvec2<T, P> const & v1, - tvec2<T, P> const & v2 - ) - { - tmat2x2<T, P> Result; - Result[0][0] = v1.x; - Result[1][0] = v1.y; - Result[0][1] = v2.x; - Result[1][1] = v2.y; - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x2<T, P> rowMajor2( - const tmat2x2<T, P>& m) - { - tmat2x2<T, P> Result; - Result[0][0] = m[0][0]; - Result[0][1] = m[1][0]; - Result[1][0] = m[0][1]; - Result[1][1] = m[1][1]; - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x3<T, P> rowMajor3( - const tvec3<T, P>& v1, - const tvec3<T, P>& v2, - const tvec3<T, P>& v3) - { - tmat3x3<T, P> Result; - Result[0][0] = v1.x; - Result[1][0] = v1.y; - Result[2][0] = v1.z; - Result[0][1] = v2.x; - Result[1][1] = v2.y; - Result[2][1] = v2.z; - Result[0][2] = v3.x; - Result[1][2] = v3.y; - Result[2][2] = v3.z; - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x3<T, P> rowMajor3( - const tmat3x3<T, P>& m) - { - tmat3x3<T, P> Result; - Result[0][0] = m[0][0]; - Result[0][1] = m[1][0]; - Result[0][2] = m[2][0]; - Result[1][0] = m[0][1]; - Result[1][1] = m[1][1]; - Result[1][2] = m[2][1]; - Result[2][0] = m[0][2]; - Result[2][1] = m[1][2]; - Result[2][2] = m[2][2]; - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P> rowMajor4( - const tvec4<T, P>& v1, - const tvec4<T, P>& v2, - const tvec4<T, P>& v3, - const tvec4<T, P>& v4) - { - tmat4x4<T, P> Result; - Result[0][0] = v1.x; - Result[1][0] = v1.y; - Result[2][0] = v1.z; - Result[3][0] = v1.w; - Result[0][1] = v2.x; - Result[1][1] = v2.y; - Result[2][1] = v2.z; - Result[3][1] = v2.w; - Result[0][2] = v3.x; - Result[1][2] = v3.y; - Result[2][2] = v3.z; - Result[3][2] = v3.w; - Result[0][3] = v4.x; - Result[1][3] = v4.y; - Result[2][3] = v4.z; - Result[3][3] = v4.w; - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P> rowMajor4( - const tmat4x4<T, P>& m) - { - tmat4x4<T, P> Result; - Result[0][0] = m[0][0]; - Result[0][1] = m[1][0]; - Result[0][2] = m[2][0]; - Result[0][3] = m[3][0]; - Result[1][0] = m[0][1]; - Result[1][1] = m[1][1]; - Result[1][2] = m[2][1]; - Result[1][3] = m[3][1]; - Result[2][0] = m[0][2]; - Result[2][1] = m[1][2]; - Result[2][2] = m[2][2]; - Result[2][3] = m[3][2]; - Result[3][0] = m[0][3]; - Result[3][1] = m[1][3]; - Result[3][2] = m[2][3]; - Result[3][3] = m[3][3]; - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x2<T, P> colMajor2( - const tvec2<T, P>& v1, - const tvec2<T, P>& v2) - { - return tmat2x2<T, P>(v1, v2); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x2<T, P> colMajor2( - const tmat2x2<T, P>& m) - { - return tmat2x2<T, P>(m); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x3<T, P> colMajor3( - const tvec3<T, P>& v1, - const tvec3<T, P>& v2, - const tvec3<T, P>& v3) - { - return tmat3x3<T, P>(v1, v2, v3); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x3<T, P> colMajor3( - const tmat3x3<T, P>& m) - { - return tmat3x3<T, P>(m); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P> colMajor4( - const tvec4<T, P>& v1, - const tvec4<T, P>& v2, - const tvec4<T, P>& v3, - const tvec4<T, P>& v4) - { - return tmat4x4<T, P>(v1, v2, v3, v4); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P> colMajor4( - const tmat4x4<T, P>& m) - { - return tmat4x4<T, P>(m); - } -}//namespace glm diff --git a/extensions/common/glm/gtx/matrix_operation.hpp b/extensions/common/glm/gtx/matrix_operation.hpp deleted file mode 100644 index ab9e24cb65d..00000000000 --- a/extensions/common/glm/gtx/matrix_operation.hpp +++ /dev/null @@ -1,113 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_matrix_operation -/// @file glm/gtx/matrix_operation.hpp -/// @date 2009-08-29 / 2011-06-07 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// -/// @defgroup gtx_matrix_operation GLM_GTX_matrix_operation -/// @ingroup gtx -/// -/// @brief Build diagonal matrices from vectors. -/// -/// <glm/gtx/matrix_operation.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependency: -#include "../glm.hpp" - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTX_matrix_operation extension included") -#endif - -namespace glm -{ - /// @addtogroup gtx_matrix_operation - /// @{ - - //! Build a diagonal matrix. - //! From GLM_GTX_matrix_operation extension. - template <typename T, precision P> - GLM_FUNC_DECL tmat2x2<T, P> diagonal2x2( - tvec2<T, P> const & v); - - //! Build a diagonal matrix. - //! From GLM_GTX_matrix_operation extension. - template <typename T, precision P> - GLM_FUNC_DECL tmat2x3<T, P> diagonal2x3( - tvec2<T, P> const & v); - - //! Build a diagonal matrix. - //! From GLM_GTX_matrix_operation extension. - template <typename T, precision P> - GLM_FUNC_DECL tmat2x4<T, P> diagonal2x4( - tvec2<T, P> const & v); - - //! Build a diagonal matrix. - //! From GLM_GTX_matrix_operation extension. - template <typename T, precision P> - GLM_FUNC_DECL tmat3x2<T, P> diagonal3x2( - tvec2<T, P> const & v); - - //! Build a diagonal matrix. - //! From GLM_GTX_matrix_operation extension. - template <typename T, precision P> - GLM_FUNC_DECL tmat3x3<T, P> diagonal3x3( - tvec3<T, P> const & v); - - //! Build a diagonal matrix. - //! From GLM_GTX_matrix_operation extension. - template <typename T, precision P> - GLM_FUNC_DECL tmat3x4<T, P> diagonal3x4( - tvec3<T, P> const & v); - - //! Build a diagonal matrix. - //! From GLM_GTX_matrix_operation extension. - template <typename T, precision P> - GLM_FUNC_DECL tmat4x2<T, P> diagonal4x2( - tvec2<T, P> const & v); - - //! Build a diagonal matrix. - //! From GLM_GTX_matrix_operation extension. - template <typename T, precision P> - GLM_FUNC_DECL tmat4x3<T, P> diagonal4x3( - tvec3<T, P> const & v); - - //! Build a diagonal matrix. - //! From GLM_GTX_matrix_operation extension. - template <typename T, precision P> - GLM_FUNC_DECL tmat4x4<T, P> diagonal4x4( - tvec4<T, P> const & v); - - /// @} -}//namespace glm - -#include "matrix_operation.inl" diff --git a/extensions/common/glm/gtx/matrix_operation.inl b/extensions/common/glm/gtx/matrix_operation.inl deleted file mode 100644 index 20c1496d10d..00000000000 --- a/extensions/common/glm/gtx/matrix_operation.inl +++ /dev/null @@ -1,147 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_matrix_operation -/// @file glm/gtx/matrix_operation.inl -/// @date 2009-08-29 / 2009-08-29 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x2<T, P> diagonal2x2 - ( - tvec2<T, P> const & v - ) - { - tmat2x2<T, P> Result(static_cast<T>(1)); - Result[0][0] = v[0]; - Result[1][1] = v[1]; - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x3<T, P> diagonal2x3 - ( - tvec2<T, P> const & v - ) - { - tmat2x3<T, P> Result(static_cast<T>(1)); - Result[0][0] = v[0]; - Result[1][1] = v[1]; - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat2x4<T, P> diagonal2x4 - ( - tvec2<T, P> const & v - ) - { - tmat2x4<T, P> Result(static_cast<T>(1)); - Result[0][0] = v[0]; - Result[1][1] = v[1]; - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x2<T, P> diagonal3x2 - ( - tvec2<T, P> const & v - ) - { - tmat3x2<T, P> Result(static_cast<T>(1)); - Result[0][0] = v[0]; - Result[1][1] = v[1]; - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x3<T, P> diagonal3x3 - ( - tvec3<T, P> const & v - ) - { - tmat3x3<T, P> Result(static_cast<T>(1)); - Result[0][0] = v[0]; - Result[1][1] = v[1]; - Result[2][2] = v[2]; - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x4<T, P> diagonal3x4 - ( - tvec3<T, P> const & v - ) - { - tmat3x4<T, P> Result(static_cast<T>(1)); - Result[0][0] = v[0]; - Result[1][1] = v[1]; - Result[2][2] = v[2]; - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P> diagonal4x4 - ( - tvec4<T, P> const & v - ) - { - tmat4x4<T, P> Result(static_cast<T>(1)); - Result[0][0] = v[0]; - Result[1][1] = v[1]; - Result[2][2] = v[2]; - Result[3][3] = v[3]; - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x3<T, P> diagonal4x3 - ( - tvec3<T, P> const & v - ) - { - tmat4x3<T, P> Result(static_cast<T>(1)); - Result[0][0] = v[0]; - Result[1][1] = v[1]; - Result[2][2] = v[2]; - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x2<T, P> diagonal4x2 - ( - tvec2<T, P> const & v - ) - { - tmat4x2<T, P> Result(static_cast<T>(1)); - Result[0][0] = v[0]; - Result[1][1] = v[1]; - return Result; - } -}//namespace glm diff --git a/extensions/common/glm/gtx/matrix_query.hpp b/extensions/common/glm/gtx/matrix_query.hpp deleted file mode 100644 index 8f59f4dc549..00000000000 --- a/extensions/common/glm/gtx/matrix_query.hpp +++ /dev/null @@ -1,102 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_matrix_query -/// @file glm/gtx/matrix_query.hpp -/// @date 2007-03-05 / 2011-08-28 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// @see gtx_vector_query (dependence) -/// -/// @defgroup gtx_matrix_query GLM_GTX_matrix_query -/// @ingroup gtx -/// -/// @brief Query to evaluate matrix properties -/// -/// <glm/gtx/matrix_query.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependency: -#include "../glm.hpp" -#include "../gtx/vector_query.hpp" -#include <limits> - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTX_matrix_query extension included") -#endif - -namespace glm -{ - /// @addtogroup gtx_matrix_query - /// @{ - - /// Return whether a matrix a null matrix. - /// From GLM_GTX_matrix_query extension. - template<typename T, precision P> - GLM_FUNC_DECL bool isNull(tmat2x2<T, P> const & m, T const & epsilon); - - /// Return whether a matrix a null matrix. - /// From GLM_GTX_matrix_query extension. - template<typename T, precision P> - GLM_FUNC_DECL bool isNull(tmat3x3<T, P> const & m, T const & epsilon); - - /// Return whether a matrix is a null matrix. - /// From GLM_GTX_matrix_query extension. - template<typename T, precision P> - GLM_FUNC_DECL bool isNull(tmat4x4<T, P> const & m, T const & epsilon); - - /// Return whether a matrix is an identity matrix. - /// From GLM_GTX_matrix_query extension. - template<typename T, precision P, template <typename, precision> class matType> - GLM_FUNC_DECL bool isIdentity(matType<T, P> const & m, T const & epsilon); - - /// Return whether a matrix is a normalized matrix. - /// From GLM_GTX_matrix_query extension. - template<typename T, precision P> - GLM_FUNC_DECL bool isNormalized(tmat2x2<T, P> const & m, T const & epsilon); - - /// Return whether a matrix is a normalized matrix. - /// From GLM_GTX_matrix_query extension. - template<typename T, precision P> - GLM_FUNC_DECL bool isNormalized(tmat3x3<T, P> const & m, T const & epsilon); - - /// Return whether a matrix is a normalized matrix. - /// From GLM_GTX_matrix_query extension. - template<typename T, precision P> - GLM_FUNC_DECL bool isNormalized(tmat4x4<T, P> const & m, T const & epsilon); - - /// Return whether a matrix is an orthonormalized matrix. - /// From GLM_GTX_matrix_query extension. - template<typename T, precision P, template <typename, precision> class matType> - GLM_FUNC_DECL bool isOrthogonal(matType<T, P> const & m, T const & epsilon); - - /// @} -}//namespace glm - -#include "matrix_query.inl" diff --git a/extensions/common/glm/gtx/matrix_query.inl b/extensions/common/glm/gtx/matrix_query.inl deleted file mode 100644 index d913116f15b..00000000000 --- a/extensions/common/glm/gtx/matrix_query.inl +++ /dev/null @@ -1,143 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_matrix_query -/// @file glm/gtx/matrix_query.inl -/// @date 2007-03-05 / 2007-03-05 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template<typename T, precision P> - GLM_FUNC_QUALIFIER bool isNull(tmat2x2<T, P> const & m, T const & epsilon) - { - bool result = true; - for(detail::component_count_t i = 0; result && i < 2 ; ++i) - result = isNull(m[i], epsilon); - return result; - } - - template<typename T, precision P> - GLM_FUNC_QUALIFIER bool isNull(tmat3x3<T, P> const & m, T const & epsilon) - { - bool result = true; - for(detail::component_count_t i = 0; result && i < 3 ; ++i) - result = isNull(m[i], epsilon); - return result; - } - - template<typename T, precision P> - GLM_FUNC_QUALIFIER bool isNull(tmat4x4<T, P> const & m, T const & epsilon) - { - bool result = true; - for(detail::component_count_t i = 0; result && i < 4 ; ++i) - result = isNull(m[i], epsilon); - return result; - } - - template<typename T, precision P, template <typename, precision> class matType> - GLM_FUNC_QUALIFIER bool isIdentity(matType<T, P> const & m, T const & epsilon) - { - bool result = true; - for(detail::component_count_t i(0); result && i < detail::component_count(m[0]); ++i) - { - for(detail::component_count_t j(0); result && j < i ; ++j) - result = abs(m[i][j]) <= epsilon; - if(result) - result = abs(m[i][i] - 1) <= epsilon; - for(detail::component_count_t j(i + 1); result && j < detail::component_count(m); ++j) - result = abs(m[i][j]) <= epsilon; - } - return result; - } - - template<typename T, precision P> - GLM_FUNC_QUALIFIER bool isNormalized(tmat2x2<T, P> const & m, T const & epsilon) - { - bool result(true); - for(detail::component_count_t i(0); result && i < detail::component_count(m); ++i) - result = isNormalized(m[i], epsilon); - for(detail::component_count_t i(0); result && i < detail::component_count(m); ++i) - { - typename tmat2x2<T, P>::col_type v; - for(detail::component_count_t j(0); j < detail::component_count(m); ++j) - v[j] = m[j][i]; - result = isNormalized(v, epsilon); - } - return result; - } - - template<typename T, precision P> - GLM_FUNC_QUALIFIER bool isNormalized(tmat3x3<T, P> const & m, T const & epsilon) - { - bool result(true); - for(detail::component_count_t i(0); result && i < detail::component_count(m); ++i) - result = isNormalized(m[i], epsilon); - for(detail::component_count_t i(0); result && i < detail::component_count(m); ++i) - { - typename tmat3x3<T, P>::col_type v; - for(detail::component_count_t j(0); j < detail::component_count(m); ++j) - v[j] = m[j][i]; - result = isNormalized(v, epsilon); - } - return result; - } - - template<typename T, precision P> - GLM_FUNC_QUALIFIER bool isNormalized(tmat4x4<T, P> const & m, T const & epsilon) - { - bool result(true); - for(detail::component_count_t i(0); result && i < detail::component_count(m); ++i) - result = isNormalized(m[i], epsilon); - for(detail::component_count_t i(0); result && i < detail::component_count(m); ++i) - { - typename tmat4x4<T, P>::col_type v; - for(detail::component_count_t j(0); j < detail::component_count(m); ++j) - v[j] = m[j][i]; - result = isNormalized(v, epsilon); - } - return result; - } - - template<typename T, precision P, template <typename, precision> class matType> - GLM_FUNC_QUALIFIER bool isOrthogonal(matType<T, P> const & m, T const & epsilon) - { - bool result(true); - for(detail::component_count_t i(0); result && i < detail::component_count(m) - 1; ++i) - for(detail::component_count_t j(i + 1); result && j < detail::component_count(m); ++j) - result = areOrthogonal(m[i], m[j], epsilon); - - if(result) - { - matType<T, P> tmp = transpose(m); - for(detail::component_count_t i(0); result && i < detail::component_count(m) - 1 ; ++i) - for(detail::component_count_t j(i + 1); result && j < detail::component_count(m); ++j) - result = areOrthogonal(tmp[i], tmp[j], epsilon); - } - return result; - } -}//namespace glm diff --git a/extensions/common/glm/gtx/matrix_transform_2d.hpp b/extensions/common/glm/gtx/matrix_transform_2d.hpp deleted file mode 100644 index b8c45f8c5a5..00000000000 --- a/extensions/common/glm/gtx/matrix_transform_2d.hpp +++ /dev/null @@ -1,106 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_matrix_transform_2d -/// @file glm/gtx/matrix_transform_2d.hpp -/// @date 2014-02-20 -/// @author Miguel Ángel Pérez Martínez -/// -/// @see core (dependence) -/// -/// @defgroup gtx_matrix_transform_2d GLM_GTX_matrix_transform_2d -/// @ingroup gtx -/// -/// @brief Defines functions that generate common 2d transformation matrices. -/// -/// <glm/gtx/matrix_transform_2d.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependency: -#include "../mat3x3.hpp" -#include "../vec2.hpp" - - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTX_matrix_transform_2d extension included") -#endif - -namespace glm -{ - /// @addtogroup gtx_matrix_transform_2d - /// @{ - - /// Builds a translation 3 * 3 matrix created from a vector of 2 components. - /// - /// @param m Input matrix multiplied by this translation matrix. - /// @param v Coordinates of a translation vector. - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x3<T, P> translate( - tmat3x3<T, P> const & m, - tvec2<T, P> const & v); - - /// Builds a rotation 3 * 3 matrix created from an angle. - /// - /// @param m Input matrix multiplied by this translation matrix. - /// @param angle Rotation angle expressed in radians if GLM_FORCE_RADIANS is defined or degrees otherwise. - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x3<T, P> rotate( - tmat3x3<T, P> const & m, - T angle); - - /// Builds a scale 3 * 3 matrix created from a vector of 2 components. - /// - /// @param m Input matrix multiplied by this translation matrix. - /// @param v Coordinates of a scale vector. - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x3<T, P> scale( - tmat3x3<T, P> const & m, - tvec2<T, P> const & v); - - /// Builds an horizontal (parallel to the x axis) shear 3 * 3 matrix. - /// - /// @param m Input matrix multiplied by this translation matrix. - /// @param y Shear factor. - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x3<T, P> shearX( - tmat3x3<T, P> const & m, - T y); - - /// Builds a vertical (parallel to the y axis) shear 3 * 3 matrix. - /// - /// @param m Input matrix multiplied by this translation matrix. - /// @param x Shear factor. - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x3<T, P> shearY( - tmat3x3<T, P> const & m, - T x); - - /// @} -}//namespace glm - -#include "matrix_transform_2d.inl" diff --git a/extensions/common/glm/gtx/matrix_transform_2d.inl b/extensions/common/glm/gtx/matrix_transform_2d.inl deleted file mode 100644 index 0c97161ba8b..00000000000 --- a/extensions/common/glm/gtx/matrix_transform_2d.inl +++ /dev/null @@ -1,97 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_matrix_transform_2d -/// @file glm/gtc/matrix_transform_2d.inl -/// @date 2014-02-20 -/// @author Miguel Ángel Pérez Martínez -/////////////////////////////////////////////////////////////////////////////////// - -#include "../trigonometric.hpp" - -namespace glm -{ - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x3<T, P> translate( - tmat3x3<T, P> const & m, - tvec2<T, P> const & v) - { - tmat3x3<T, P> Result(m); - Result[2] = m[0] * v[0] + m[1] * v[1] + m[2]; - return Result; - } - - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x3<T, P> rotate( - tmat3x3<T, P> const & m, - T angle) - { - T const a = angle; - T const c = cos(a); - T const s = sin(a); - - tmat3x3<T, P> Result(uninitialize); - Result[0] = m[0] * c + m[1] * s; - Result[1] = m[0] * -s + m[1] * c; - Result[2] = m[2]; - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x3<T, P> scale( - tmat3x3<T, P> const & m, - tvec2<T, P> const & v) - { - tmat3x3<T, P> Result(uninitialize); - Result[0] = m[0] * v[0]; - Result[1] = m[1] * v[1]; - Result[2] = m[2]; - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x3<T, P> shearX( - tmat3x3<T, P> const & m, - T y) - { - tmat3x3<T, P> Result(1); - Result[0][1] = y; - return m * Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x3<T, P> shearY( - tmat3x3<T, P> const & m, - T x) - { - tmat3x3<T, P> Result(1); - Result[1][0] = x; - return m * Result; - } - -}//namespace glm diff --git a/extensions/common/glm/gtx/mixed_product.hpp b/extensions/common/glm/gtx/mixed_product.hpp deleted file mode 100644 index df5b5a367b0..00000000000 --- a/extensions/common/glm/gtx/mixed_product.hpp +++ /dev/null @@ -1,66 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_mixed_product -/// @file glm/gtx/mixed_product.hpp -/// @date 2007-04-03 / 2011-06-07 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// -/// @defgroup gtx_mixed_product GLM_GTX_mixed_producte -/// @ingroup gtx -/// -/// @brief Mixed product of 3 vectors. -/// -/// <glm/gtx/mixed_product.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependency: -#include "../glm.hpp" - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTX_mixed_product extension included") -#endif - -namespace glm -{ - /// @addtogroup gtx_mixed_product - /// @{ - - /// @brief Mixed product of 3 vectors (from GLM_GTX_mixed_product extension) - template <typename T, precision P> - GLM_FUNC_DECL T mixedProduct( - tvec3<T, P> const & v1, - tvec3<T, P> const & v2, - tvec3<T, P> const & v3); - - /// @} -}// namespace glm - -#include "mixed_product.inl" diff --git a/extensions/common/glm/gtx/mixed_product.inl b/extensions/common/glm/gtx/mixed_product.inl deleted file mode 100644 index 36ef8142c14..00000000000 --- a/extensions/common/glm/gtx/mixed_product.inl +++ /dev/null @@ -1,45 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_mixed_product -/// @file glm/gtx/mixed_product.inl -/// @date 2007-04-03 / 2008-09-17 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template <typename T, precision P> - GLM_FUNC_QUALIFIER T mixedProduct - ( - tvec3<T, P> const & v1, - tvec3<T, P> const & v2, - tvec3<T, P> const & v3 - ) - { - return dot(cross(v1, v2), v3); - } -}//namespace glm diff --git a/extensions/common/glm/gtx/multiple.hpp b/extensions/common/glm/gtx/multiple.hpp deleted file mode 100644 index 19bd1fd99d4..00000000000 --- a/extensions/common/glm/gtx/multiple.hpp +++ /dev/null @@ -1,106 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_multiple -/// @file glm/gtx/multiple.hpp -/// @date 2009-10-26 / 2011-06-07 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// @see gtx_extented_min_max (dependence) -/// -/// @defgroup gtx_multiple GLM_GTX_multiple -/// @ingroup gtx -/// -/// @brief Find the closest number of a number multiple of other number. -/// -/// <glm/gtx/multiple.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependency: -#include "../gtc/round.hpp" - -#pragma message("GLM: GLM_GTX_multiple extension is deprecated, use GLM_GTC_round instead.") - -namespace glm -{ - /// @addtogroup gtx_multiple - /// @{ - - /// Higher multiple number of Source. - /// - /// @tparam genType Floating-point or integer scalar or vector types. - /// @param Source - /// @param Multiple Must be a null or positive value - /// - /// @see gtx_multiple - template <typename genType> - GLM_DEPRECATED GLM_FUNC_DECL genType higherMultiple( - genType Source, - genType Multiple); - - /// Higher multiple number of Source. - /// - /// @tparam genType Floating-point or integer scalar or vector types. - /// @param Source - /// @param Multiple Must be a null or positive value - /// - /// @see gtx_multiple - template <typename T, precision P, template <typename, precision> class vecType> - GLM_DEPRECATED GLM_FUNC_DECL vecType<T, P> higherMultiple( - vecType<T, P> const & Source, - vecType<T, P> const & Multiple); - - /// Lower multiple number of Source. - /// - /// @tparam genType Floating-point or integer scalar or vector types. - /// @param Source - /// @param Multiple Must be a null or positive value - /// - /// @see gtx_multiple - template <typename genType> - GLM_DEPRECATED GLM_FUNC_DECL genType lowerMultiple( - genType Source, - genType Multiple); - - /// Lower multiple number of Source. - /// - /// @tparam genType Floating-point or integer scalar or vector types. - /// @param Source - /// @param Multiple Must be a null or positive value - /// - /// @see gtx_multiple - template <typename T, precision P, template <typename, precision> class vecType> - GLM_DEPRECATED GLM_FUNC_DECL vecType<T, P> lowerMultiple( - vecType<T, P> const & Source, - vecType<T, P> const & Multiple); - - /// @} -}//namespace glm - -#include "multiple.inl" diff --git a/extensions/common/glm/gtx/multiple.inl b/extensions/common/glm/gtx/multiple.inl deleted file mode 100644 index 878cdfbf21c..00000000000 --- a/extensions/common/glm/gtx/multiple.inl +++ /dev/null @@ -1,64 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_multiple -/// @file glm/gtx/multiple.inl -/// @date 2009-10-26 / 2011-06-07 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - ////////////////////// - // higherMultiple - - template <typename genType> - GLM_FUNC_QUALIFIER genType higherMultiple(genType Source, genType Multiple) - { - return detail::compute_ceilMultiple<std::numeric_limits<genType>::is_iec559, std::numeric_limits<genType>::is_signed>::call(Source, Multiple); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> higherMultiple(vecType<T, P> const & Source, vecType<T, P> const & Multiple) - { - return detail::functor2<T, P, vecType>::call(higherMultiple, Source, Multiple); - } - - ////////////////////// - // lowerMultiple - - template <typename genType> - GLM_FUNC_QUALIFIER genType lowerMultiple(genType Source, genType Multiple) - { - return detail::compute_floorMultiple<std::numeric_limits<genType>::is_iec559, std::numeric_limits<genType>::is_signed>::call(Source, Multiple); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<T, P> lowerMultiple(vecType<T, P> const & Source, vecType<T, P> const & Multiple) - { - return detail::functor2<T, P, vecType>::call(lowerMultiple, Source, Multiple); - } -}//namespace glm diff --git a/extensions/common/glm/gtx/norm.hpp b/extensions/common/glm/gtx/norm.hpp deleted file mode 100644 index 8bf8d5431a5..00000000000 --- a/extensions/common/glm/gtx/norm.hpp +++ /dev/null @@ -1,128 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_norm -/// @file glm/gtx/norm.hpp -/// @date 2005-12-21 / 2011-06-07 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// @see gtx_quaternion (dependence) -/// -/// @defgroup gtx_norm GLM_GTX_norm -/// @ingroup gtx -/// -/// @brief Various ways to compute vector norms. -/// -/// <glm/gtx/norm.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependency: -#include "../glm.hpp" -#include "../gtx/quaternion.hpp" - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTX_norm extension included") -#endif - -namespace glm -{ - /// @addtogroup gtx_norm - /// @{ - - //! Returns the squared length of x. - //! From GLM_GTX_norm extension. - template <typename T> - GLM_FUNC_DECL T length2( - T const & x); - - //! Returns the squared length of x. - //! From GLM_GTX_norm extension. - template <typename genType> - GLM_FUNC_DECL typename genType::value_type length2( - genType const & x); - - //! Returns the squared distance between p0 and p1, i.e., length(p0 - p1). - //! From GLM_GTX_norm extension. - template <typename T> - GLM_FUNC_DECL T distance2( - T const & p0, - T const & p1); - - //! Returns the squared distance between p0 and p1, i.e., length(p0 - p1). - //! From GLM_GTX_norm extension. - template <typename genType> - GLM_FUNC_DECL typename genType::value_type distance2( - genType const & p0, - genType const & p1); - - //! Returns the L1 norm between x and y. - //! From GLM_GTX_norm extension. - template <typename T, precision P> - GLM_FUNC_DECL T l1Norm( - tvec3<T, P> const & x, - tvec3<T, P> const & y); - - //! Returns the L1 norm of v. - //! From GLM_GTX_norm extension. - template <typename T, precision P> - GLM_FUNC_DECL T l1Norm( - tvec3<T, P> const & v); - - //! Returns the L2 norm between x and y. - //! From GLM_GTX_norm extension. - template <typename T, precision P> - GLM_FUNC_DECL T l2Norm( - tvec3<T, P> const & x, - tvec3<T, P> const & y); - - //! Returns the L2 norm of v. - //! From GLM_GTX_norm extension. - template <typename T, precision P> - GLM_FUNC_DECL T l2Norm( - tvec3<T, P> const & x); - - //! Returns the L norm between x and y. - //! From GLM_GTX_norm extension. - template <typename T, precision P> - GLM_FUNC_DECL T lxNorm( - tvec3<T, P> const & x, - tvec3<T, P> const & y, - unsigned int Depth); - - //! Returns the L norm of v. - //! From GLM_GTX_norm extension. - template <typename T, precision P> - GLM_FUNC_DECL T lxNorm( - tvec3<T, P> const & x, - unsigned int Depth); - - /// @} -}//namespace glm - -#include "norm.inl" diff --git a/extensions/common/glm/gtx/norm.inl b/extensions/common/glm/gtx/norm.inl deleted file mode 100644 index 2b8e98204a4..00000000000 --- a/extensions/common/glm/gtx/norm.inl +++ /dev/null @@ -1,170 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_norm -/// @file glm/gtx/norm.inl -/// @date 2005-12-21 / 2008-07-24 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template <typename T> - GLM_FUNC_QUALIFIER T length2 - ( - T const & x - ) - { - return x * x; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER T length2 - ( - tvec2<T, P> const & x - ) - { - return dot(x, x); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER T length2 - ( - tvec3<T, P> const & x - ) - { - return dot(x, x); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER T length2 - ( - tvec4<T, P> const & x - ) - { - return dot(x, x); - } - - template <typename T> - GLM_FUNC_QUALIFIER T distance2 - ( - T const & p0, - T const & p1 - ) - { - return length2(p1 - p0); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER T distance2 - ( - tvec2<T, P> const & p0, - tvec2<T, P> const & p1 - ) - { - return length2(p1 - p0); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER T distance2 - ( - tvec3<T, P> const & p0, - tvec3<T, P> const & p1 - ) - { - return length2(p1 - p0); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER T distance2 - ( - tvec4<T, P> const & p0, - tvec4<T, P> const & p1 - ) - { - return length2(p1 - p0); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER T l1Norm - ( - tvec3<T, P> const & a, - tvec3<T, P> const & b - ) - { - return abs(b.x - a.x) + abs(b.y - a.y) + abs(b.z - a.z); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER T l1Norm - ( - tvec3<T, P> const & v - ) - { - return abs(v.x) + abs(v.y) + abs(v.z); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER T l2Norm - ( - tvec3<T, P> const & a, - tvec3<T, P> const & b - ) - { - return length(b - a); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER T l2Norm - ( - tvec3<T, P> const & v - ) - { - return length(v); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER T lxNorm - ( - tvec3<T, P> const & x, - tvec3<T, P> const & y, - unsigned int Depth - ) - { - return pow(pow(y.x - x.x, T(Depth)) + pow(y.y - x.y, T(Depth)) + pow(y.z - x.z, T(Depth)), T(1) / T(Depth)); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER T lxNorm - ( - tvec3<T, P> const & v, - unsigned int Depth - ) - { - return pow(pow(v.x, T(Depth)) + pow(v.y, T(Depth)) + pow(v.z, T(Depth)), T(1) / T(Depth)); - } - -}//namespace glm diff --git a/extensions/common/glm/gtx/normal.hpp b/extensions/common/glm/gtx/normal.hpp deleted file mode 100644 index 4b28d85aa89..00000000000 --- a/extensions/common/glm/gtx/normal.hpp +++ /dev/null @@ -1,68 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_normal -/// @file glm/gtx/normal.hpp -/// @date 2005-12-21 / 2011-06-07 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// @see gtx_extented_min_max (dependence) -/// -/// @defgroup gtx_normal GLM_GTX_normal -/// @ingroup gtx -/// -/// @brief Compute the normal of a triangle. -/// -/// <glm/gtx/normal.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependency: -#include "../glm.hpp" - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTX_normal extension included") -#endif - -namespace glm -{ - /// @addtogroup gtx_normal - /// @{ - - //! Computes triangle normal from triangle points. - //! From GLM_GTX_normal extension. - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> triangleNormal( - tvec3<T, P> const & p1, - tvec3<T, P> const & p2, - tvec3<T, P> const & p3); - - /// @} -}//namespace glm - -#include "normal.inl" diff --git a/extensions/common/glm/gtx/normal.inl b/extensions/common/glm/gtx/normal.inl deleted file mode 100644 index 153e9a47786..00000000000 --- a/extensions/common/glm/gtx/normal.inl +++ /dev/null @@ -1,45 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_normal -/// @file glm/gtx/normal.inl -/// @date 2005-12-21 / 2011-06-07 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> triangleNormal - ( - tvec3<T, P> const & p1, - tvec3<T, P> const & p2, - tvec3<T, P> const & p3 - ) - { - return normalize(cross(p1 - p2, p1 - p3)); - } -}//namespace glm diff --git a/extensions/common/glm/gtx/normalize_dot.hpp b/extensions/common/glm/gtx/normalize_dot.hpp deleted file mode 100644 index 35905eda4a7..00000000000 --- a/extensions/common/glm/gtx/normalize_dot.hpp +++ /dev/null @@ -1,74 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_normalize_dot -/// @file glm/gtx/normalize_dot.hpp -/// @date 2007-09-28 / 2011-06-07 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// @see gtx_fast_square_root (dependence) -/// -/// @defgroup gtx_normalize_dot GLM_GTX_normalize_dot -/// @ingroup gtx -/// -/// @brief Dot product of vectors that need to be normalize with a single square root. -/// -/// <glm/gtx/normalized_dot.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependency: -#include "../gtx/fast_square_root.hpp" - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTX_normalize_dot extension included") -#endif - -namespace glm -{ - /// @addtogroup gtx_normalize_dot - /// @{ - - /// Normalize parameters and returns the dot product of x and y. - /// It's faster that dot(normalize(x), normalize(y)). - /// - /// @see gtx_normalize_dot extension. - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL T normalizeDot(vecType<T, P> const & x, vecType<T, P> const & y); - - /// Normalize parameters and returns the dot product of x and y. - /// Faster that dot(fastNormalize(x), fastNormalize(y)). - /// - /// @see gtx_normalize_dot extension. - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL T fastNormalizeDot(vecType<T, P> const & x, vecType<T, P> const & y); - - /// @} -}//namespace glm - -#include "normalize_dot.inl" diff --git a/extensions/common/glm/gtx/normalize_dot.inl b/extensions/common/glm/gtx/normalize_dot.inl deleted file mode 100644 index 80df8dd1527..00000000000 --- a/extensions/common/glm/gtx/normalize_dot.inl +++ /dev/null @@ -1,46 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_normalize_dot -/// @file glm/gtx/normalize_dot.inl -/// @date 2007-09-28 / 2008-10-07 -/// @author Christophe Riccio -////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER T normalizeDot(vecType<T, P> const & x, vecType<T, P> const & y) - { - return glm::dot(x, y) * glm::inversesqrt(glm::dot(x, x) * glm::dot(y, y)); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER T fastNormalizeDot(vecType<T, P> const & x, vecType<T, P> const & y) - { - return glm::dot(x, y) * glm::fastInverseSqrt(glm::dot(x, x) * glm::dot(y, y)); - } -}//namespace glm diff --git a/extensions/common/glm/gtx/number_precision.hpp b/extensions/common/glm/gtx/number_precision.hpp deleted file mode 100644 index 1990a0fd3bd..00000000000 --- a/extensions/common/glm/gtx/number_precision.hpp +++ /dev/null @@ -1,86 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_number_precision -/// @file glm/gtx/number_precision.hpp -/// @date 2007-05-10 / 2011-06-07 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// @see gtc_type_precision (dependence) -/// @see gtc_quaternion (dependence) -/// -/// @defgroup gtx_number_precision GLM_GTX_number_precision -/// @ingroup gtx -/// -/// @brief Defined size types. -/// -/// <glm/gtx/number_precision.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependency: -#include "../glm.hpp" -#include "../gtc/type_precision.hpp" - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTX_number_precision extension included") -#endif - -namespace glm{ -namespace gtx -{ - ///////////////////////////// - // Unsigned int vector types - - /// @addtogroup gtx_number_precision - /// @{ - - typedef u8 u8vec1; //!< \brief 8bit unsigned integer scalar. (from GLM_GTX_number_precision extension) - typedef u16 u16vec1; //!< \brief 16bit unsigned integer scalar. (from GLM_GTX_number_precision extension) - typedef u32 u32vec1; //!< \brief 32bit unsigned integer scalar. (from GLM_GTX_number_precision extension) - typedef u64 u64vec1; //!< \brief 64bit unsigned integer scalar. (from GLM_GTX_number_precision extension) - - ////////////////////// - // Float vector types - - typedef f32 f32vec1; //!< \brief Single-precision floating-point scalar. (from GLM_GTX_number_precision extension) - typedef f64 f64vec1; //!< \brief Single-precision floating-point scalar. (from GLM_GTX_number_precision extension) - - ////////////////////// - // Float matrix types - - typedef f32 f32mat1; //!< \brief Single-precision floating-point scalar. (from GLM_GTX_number_precision extension) - typedef f32 f32mat1x1; //!< \brief Single-precision floating-point scalar. (from GLM_GTX_number_precision extension) - typedef f64 f64mat1; //!< \brief Double-precision floating-point scalar. (from GLM_GTX_number_precision extension) - typedef f64 f64mat1x1; //!< \brief Double-precision floating-point scalar. (from GLM_GTX_number_precision extension) - - /// @} -}//namespace gtx -}//namespace glm - -#include "number_precision.inl" diff --git a/extensions/common/glm/gtx/number_precision.inl b/extensions/common/glm/gtx/number_precision.inl deleted file mode 100644 index cd93fe5aff4..00000000000 --- a/extensions/common/glm/gtx/number_precision.inl +++ /dev/null @@ -1,36 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_number_precision -/// @file glm/gtx/number_precision.inl -/// @date 2007-05-10 / 2011-06-07 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - -} diff --git a/extensions/common/glm/gtx/optimum_pow.hpp b/extensions/common/glm/gtx/optimum_pow.hpp deleted file mode 100644 index d6c9dd5ab7a..00000000000 --- a/extensions/common/glm/gtx/optimum_pow.hpp +++ /dev/null @@ -1,79 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_optimum_pow -/// @file glm/gtx/optimum_pow.hpp -/// @date 2005-12-21 / 2011-06-07 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// -/// @defgroup gtx_optimum_pow GLM_GTX_optimum_pow -/// @ingroup gtx -/// -/// @brief Integer exponentiation of power functions. -/// -/// <glm/gtx/optimum_pow.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependency: -#include "../glm.hpp" - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTX_optimum_pow extension included") -#endif - -namespace glm{ -namespace gtx -{ - /// @addtogroup gtx_optimum_pow - /// @{ - - /// Returns x raised to the power of 2. - /// - /// @see gtx_optimum_pow - template <typename genType> - GLM_FUNC_DECL genType pow2(genType const & x); - - /// Returns x raised to the power of 3. - /// - /// @see gtx_optimum_pow - template <typename genType> - GLM_FUNC_DECL genType pow3(genType const & x); - - /// Returns x raised to the power of 4. - /// - /// @see gtx_optimum_pow - template <typename genType> - GLM_FUNC_DECL genType pow4(genType const & x); - - /// @} -}//namespace gtx -}//namespace glm - -#include "optimum_pow.inl" diff --git a/extensions/common/glm/gtx/optimum_pow.inl b/extensions/common/glm/gtx/optimum_pow.inl deleted file mode 100644 index d0c22ab9085..00000000000 --- a/extensions/common/glm/gtx/optimum_pow.inl +++ /dev/null @@ -1,52 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_optimum_pow -/// @file glm/gtx/optimum_pow.inl -/// @date 2005-12-21 / 2011-06-07 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template <typename genType> - GLM_FUNC_QUALIFIER genType pow2(genType const & x) - { - return x * x; - } - - template <typename genType> - GLM_FUNC_QUALIFIER genType pow3(genType const & x) - { - return x * x * x; - } - - template <typename genType> - GLM_FUNC_QUALIFIER genType pow4(genType const & x) - { - return (x * x) * (x * x); - } -}//namespace glm diff --git a/extensions/common/glm/gtx/orthonormalize.hpp b/extensions/common/glm/gtx/orthonormalize.hpp deleted file mode 100644 index 3eef6dee330..00000000000 --- a/extensions/common/glm/gtx/orthonormalize.hpp +++ /dev/null @@ -1,74 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_orthonormalize -/// @file glm/gtx/orthonormalize.hpp -/// @date 2005-12-21 / 2011-06-07 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// @see gtx_extented_min_max (dependence) -/// -/// @defgroup gtx_orthonormalize GLM_GTX_orthonormalize -/// @ingroup gtx -/// -/// @brief Orthonormalize matrices. -/// -/// <glm/gtx/orthonormalize.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependency: -#include "../vec3.hpp" -#include "../mat3x3.hpp" -#include "../geometric.hpp" - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTX_orthonormalize extension included") -#endif - -namespace glm -{ - /// @addtogroup gtx_orthonormalize - /// @{ - - /// Returns the orthonormalized matrix of m. - /// - /// @see gtx_orthonormalize - template <typename T, precision P> - GLM_FUNC_DECL tmat3x3<T, P> orthonormalize(tmat3x3<T, P> const & m); - - /// Orthonormalizes x according y. - /// - /// @see gtx_orthonormalize - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> orthonormalize(tvec3<T, P> const & x, tvec3<T, P> const & y); - - /// @} -}//namespace glm - -#include "orthonormalize.inl" diff --git a/extensions/common/glm/gtx/orthonormalize.inl b/extensions/common/glm/gtx/orthonormalize.inl deleted file mode 100644 index 07491a36d58..00000000000 --- a/extensions/common/glm/gtx/orthonormalize.inl +++ /dev/null @@ -1,59 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_orthonormalize -/// @file glm/gtx/orthonormalize.inl -/// @date 2005-12-21 / 2011-06-07 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x3<T, P> orthonormalize(tmat3x3<T, P> const & m) - { - tmat3x3<T, P> r = m; - - r[0] = normalize(r[0]); - - T d0 = dot(r[0], r[1]); - r[1] -= r[0] * d0; - r[1] = normalize(r[1]); - - T d1 = dot(r[1], r[2]); - d0 = dot(r[0], r[2]); - r[2] -= r[0] * d0 + r[1] * d1; - r[2] = normalize(r[2]); - - return r; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> orthonormalize(tvec3<T, P> const & x, tvec3<T, P> const & y) - { - return normalize(x - y * dot(y, x)); - } -}//namespace glm diff --git a/extensions/common/glm/gtx/perpendicular.hpp b/extensions/common/glm/gtx/perpendicular.hpp deleted file mode 100644 index b7fb0821b1b..00000000000 --- a/extensions/common/glm/gtx/perpendicular.hpp +++ /dev/null @@ -1,68 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_perpendicular -/// @file glm/gtx/perpendicular.hpp -/// @date 2005-12-21 / 2011-06-07 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// @see gtx_projection (dependence) -/// -/// @defgroup gtx_perpendicular GLM_GTX_perpendicular -/// @ingroup gtx -/// -/// @brief Perpendicular of a vector from other one -/// -/// <glm/gtx/perpendicular.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependency: -#include "../glm.hpp" -#include "../gtx/projection.hpp" - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTX_perpendicular extension included") -#endif - -namespace glm -{ - /// @addtogroup gtx_perpendicular - /// @{ - - //! Projects x a perpendicular axis of Normal. - //! From GLM_GTX_perpendicular extension. - template <typename vecType> - GLM_FUNC_DECL vecType perp( - vecType const & x, - vecType const & Normal); - - /// @} -}//namespace glm - -#include "perpendicular.inl" diff --git a/extensions/common/glm/gtx/perpendicular.inl b/extensions/common/glm/gtx/perpendicular.inl deleted file mode 100644 index 4c321b74d76..00000000000 --- a/extensions/common/glm/gtx/perpendicular.inl +++ /dev/null @@ -1,44 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_perpendicular -/// @file glm/gtx/perpendicular.inl -/// @date 2005-12-21 / 2011-06-07 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template <typename vecType> - GLM_FUNC_QUALIFIER vecType perp - ( - vecType const & x, - vecType const & Normal - ) - { - return x - proj(x, Normal); - } -}//namespace glm diff --git a/extensions/common/glm/gtx/polar_coordinates.hpp b/extensions/common/glm/gtx/polar_coordinates.hpp deleted file mode 100644 index de8c9de1d4e..00000000000 --- a/extensions/common/glm/gtx/polar_coordinates.hpp +++ /dev/null @@ -1,73 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_polar_coordinates -/// @file glm/gtx/polar_coordinates.hpp -/// @date 2007-03-06 / 2011-06-07 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// -/// @defgroup gtx_polar_coordinates GLM_GTX_polar_coordinates -/// @ingroup gtx -/// -/// @brief Conversion from Euclidean space to polar space and revert. -/// -/// <glm/gtx/polar_coordinates.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependency: -#include "../glm.hpp" - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTX_polar_coordinates extension included") -#endif - -namespace glm -{ - /// @addtogroup gtx_polar_coordinates - /// @{ - - /// Convert Euclidean to Polar coordinates, x is the xz distance, y, the latitude and z the longitude. - /// - /// @see gtx_polar_coordinates - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> polar( - tvec3<T, P> const & euclidean); - - /// Convert Polar to Euclidean coordinates. - /// - /// @see gtx_polar_coordinates - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> euclidean( - tvec2<T, P> const & polar); - - /// @} -}//namespace glm - -#include "polar_coordinates.inl" diff --git a/extensions/common/glm/gtx/polar_coordinates.inl b/extensions/common/glm/gtx/polar_coordinates.inl deleted file mode 100644 index d1afbb232c1..00000000000 --- a/extensions/common/glm/gtx/polar_coordinates.inl +++ /dev/null @@ -1,66 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_polar_coordinates -/// @file glm/gtx/polar_coordinates.inl -/// @date 2007-03-06 / 2011-06-07 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> polar - ( - tvec3<T, P> const & euclidean - ) - { - T const Length(length(euclidean)); - tvec3<T, P> const tmp(euclidean / Length); - T const xz_dist(sqrt(tmp.x * tmp.x + tmp.z * tmp.z)); - - return tvec3<T, P>( - atan(xz_dist, tmp.y), // latitude - atan(tmp.x, tmp.z), // longitude - xz_dist); // xz distance - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> euclidean - ( - tvec2<T, P> const & polar - ) - { - T const latitude(polar.x); - T const longitude(polar.y); - - return tvec3<T, P>( - cos(latitude) * sin(longitude), - sin(latitude), - cos(latitude) * cos(longitude)); - } - -}//namespace glm diff --git a/extensions/common/glm/gtx/projection.hpp b/extensions/common/glm/gtx/projection.hpp deleted file mode 100644 index b01d51998e2..00000000000 --- a/extensions/common/glm/gtx/projection.hpp +++ /dev/null @@ -1,65 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_projection -/// @file glm/gtx/projection.hpp -/// @date 2005-12-21 / 2011-06-07 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// -/// @defgroup gtx_projection GLM_GTX_projection -/// @ingroup gtx -/// -/// @brief Projection of a vector to other one -/// -/// <glm/gtx/projection.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependency: -#include "../geometric.hpp" - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTX_projection extension included") -#endif - -namespace glm -{ - /// @addtogroup gtx_projection - /// @{ - - /// Projects x on Normal. - /// - /// @see gtx_projection - template <typename vecType> - GLM_FUNC_DECL vecType proj(vecType const & x, vecType const & Normal); - - /// @} -}//namespace glm - -#include "projection.inl" diff --git a/extensions/common/glm/gtx/projection.inl b/extensions/common/glm/gtx/projection.inl deleted file mode 100644 index c46b96a2201..00000000000 --- a/extensions/common/glm/gtx/projection.inl +++ /dev/null @@ -1,40 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_projection -/// @file glm/gtx/projection.inl -/// @date 2005-12-21 / 2011-06-07 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template <typename vecType> - GLM_FUNC_QUALIFIER vecType proj(vecType const & x, vecType const & Normal) - { - return glm::dot(x, Normal) / glm::dot(Normal, Normal) * Normal; - } -}//namespace glm diff --git a/extensions/common/glm/gtx/quaternion.hpp b/extensions/common/glm/gtx/quaternion.hpp deleted file mode 100644 index ede24d1c49b..00000000000 --- a/extensions/common/glm/gtx/quaternion.hpp +++ /dev/null @@ -1,214 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_quaternion -/// @file glm/gtx/quaternion.hpp -/// @date 2005-12-21 / 2011-06-07 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// @see gtx_extented_min_max (dependence) -/// -/// @defgroup gtx_quaternion GLM_GTX_quaternion -/// @ingroup gtx -/// -/// @brief Extented quaternion types and functions -/// -/// <glm/gtx/quaternion.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependency: -#include "../glm.hpp" -#include "../gtc/constants.hpp" -#include "../gtc/quaternion.hpp" -#include "../gtx/norm.hpp" - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTX_quaternion extension included") -#endif - -namespace glm -{ - /// @addtogroup gtx_quaternion - /// @{ - - //! Compute a cross product between a quaternion and a vector. - /// - /// @see gtx_quaternion - template<typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> cross( - tquat<T, P> const & q, - tvec3<T, P> const & v); - - //! Compute a cross product between a vector and a quaternion. - /// - /// @see gtx_quaternion - template<typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> cross( - tvec3<T, P> const & v, - tquat<T, P> const & q); - - //! Compute a point on a path according squad equation. - //! q1 and q2 are control points; s1 and s2 are intermediate control points. - /// - /// @see gtx_quaternion - template<typename T, precision P> - GLM_FUNC_DECL tquat<T, P> squad( - tquat<T, P> const & q1, - tquat<T, P> const & q2, - tquat<T, P> const & s1, - tquat<T, P> const & s2, - T const & h); - - //! Returns an intermediate control point for squad interpolation. - /// - /// @see gtx_quaternion - template<typename T, precision P> - GLM_FUNC_DECL tquat<T, P> intermediate( - tquat<T, P> const & prev, - tquat<T, P> const & curr, - tquat<T, P> const & next); - - //! Returns a exp of a quaternion. - /// - /// @see gtx_quaternion - template<typename T, precision P> - GLM_FUNC_DECL tquat<T, P> exp( - tquat<T, P> const & q); - - //! Returns a log of a quaternion. - /// - /// @see gtx_quaternion - template<typename T, precision P> - GLM_FUNC_DECL tquat<T, P> log( - tquat<T, P> const & q); - - /// Returns x raised to the y power. - /// - /// @see gtx_quaternion - template<typename T, precision P> - GLM_FUNC_DECL tquat<T, P> pow( - tquat<T, P> const & x, - T const & y); - - //! Returns quarternion square root. - /// - /// @see gtx_quaternion - //template<typename T, precision P> - //tquat<T, P> sqrt( - // tquat<T, P> const & q); - - //! Rotates a 3 components vector by a quaternion. - /// - /// @see gtx_quaternion - template<typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> rotate( - tquat<T, P> const & q, - tvec3<T, P> const & v); - - /// Rotates a 4 components vector by a quaternion. - /// - /// @see gtx_quaternion - template<typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> rotate( - tquat<T, P> const & q, - tvec4<T, P> const & v); - - /// Extract the real component of a quaternion. - /// - /// @see gtx_quaternion - template<typename T, precision P> - GLM_FUNC_DECL T extractRealComponent( - tquat<T, P> const & q); - - /// Converts a quaternion to a 3 * 3 matrix. - /// - /// @see gtx_quaternion - template<typename T, precision P> - GLM_FUNC_DECL tmat3x3<T, P> toMat3( - tquat<T, P> const & x){return mat3_cast(x);} - - /// Converts a quaternion to a 4 * 4 matrix. - /// - /// @see gtx_quaternion - template<typename T, precision P> - GLM_FUNC_DECL tmat4x4<T, P> toMat4( - tquat<T, P> const & x){return mat4_cast(x);} - - /// Converts a 3 * 3 matrix to a quaternion. - /// - /// @see gtx_quaternion - template<typename T, precision P> - GLM_FUNC_DECL tquat<T, P> toQuat( - tmat3x3<T, P> const & x){return quat_cast(x);} - - /// Converts a 4 * 4 matrix to a quaternion. - /// - /// @see gtx_quaternion - template<typename T, precision P> - GLM_FUNC_DECL tquat<T, P> toQuat( - tmat4x4<T, P> const & x){return quat_cast(x);} - - /// Quaternion interpolation using the rotation short path. - /// - /// @see gtx_quaternion - template<typename T, precision P> - GLM_FUNC_DECL tquat<T, P> shortMix( - tquat<T, P> const & x, - tquat<T, P> const & y, - T const & a); - - /// Quaternion normalized linear interpolation. - /// - /// @see gtx_quaternion - template<typename T, precision P> - GLM_FUNC_DECL tquat<T, P> fastMix( - tquat<T, P> const & x, - tquat<T, P> const & y, - T const & a); - - /// Compute the rotation between two vectors. - /// param orig vector, needs to be normalized - /// param dest vector, needs to be normalized - /// - /// @see gtx_quaternion - template<typename T, precision P> - GLM_FUNC_DECL tquat<T, P> rotation( - tvec3<T, P> const & orig, - tvec3<T, P> const & dest); - - /// Returns the squared length of x. - /// - /// @see gtx_quaternion - template<typename T, precision P> - GLM_FUNC_DECL T length2(tquat<T, P> const & q); - - /// @} -}//namespace glm - -#include "quaternion.inl" diff --git a/extensions/common/glm/gtx/quaternion.inl b/extensions/common/glm/gtx/quaternion.inl deleted file mode 100644 index 4c5b3d665d2..00000000000 --- a/extensions/common/glm/gtx/quaternion.inl +++ /dev/null @@ -1,285 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_quaternion -/// @file glm/gtx/quaternion.inl -/// @date 2005-12-21 / 2011-06-07 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#include <limits> -#include "../gtc/constants.hpp" - -namespace glm -{ - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> cross - ( - tvec3<T, P> const & v, - tquat<T, P> const & q - ) - { - return inverse(q) * v; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> cross - ( - tquat<T, P> const & q, - tvec3<T, P> const & v - ) - { - return q * v; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tquat<T, P> squad - ( - tquat<T, P> const & q1, - tquat<T, P> const & q2, - tquat<T, P> const & s1, - tquat<T, P> const & s2, - T const & h) - { - return mix(mix(q1, q2, h), mix(s1, s2, h), static_cast<T>(2) * (static_cast<T>(1) - h) * h); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tquat<T, P> intermediate - ( - tquat<T, P> const & prev, - tquat<T, P> const & curr, - tquat<T, P> const & next - ) - { - tquat<T, P> invQuat = inverse(curr); - return exp((log(next + invQuat) + log(prev + invQuat)) / static_cast<T>(-4)) * curr; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tquat<T, P> exp - ( - tquat<T, P> const & q - ) - { - tvec3<T, P> u(q.x, q.y, q.z); - T Angle = glm::length(u); - if (Angle < epsilon<T>()) - return tquat<T, P>(); - - tvec3<T, P> v(u / Angle); - return tquat<T, P>(cos(Angle), sin(Angle) * v); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tquat<T, P> log - ( - tquat<T, P> const & q - ) - { - tvec3<T, P> u(q.x, q.y, q.z); - T Vec3Len = length(u); - - if (Vec3Len < epsilon<T>()) - { - if(q.w > static_cast<T>(0)) - return tquat<T, P>(log(q.w), static_cast<T>(0), static_cast<T>(0), static_cast<T>(0)); - else if(q.w < static_cast<T>(0)) - return tquat<T, P>(log(-q.w), pi<T>(), static_cast<T>(0), static_cast<T>(0)); - else - return tquat<T, P>(std::numeric_limits<T>::infinity(), std::numeric_limits<T>::infinity(), std::numeric_limits<T>::infinity(), std::numeric_limits<T>::infinity()); - } - else - { - T QuatLen = sqrt(Vec3Len * Vec3Len + q.w * q.w); - T t = atan(Vec3Len, T(q.w)) / Vec3Len; - return tquat<T, P>(log(QuatLen), t * q.x, t * q.y, t * q.z); - } - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tquat<T, P> pow - ( - tquat<T, P> const & x, - T const & y - ) - { - if(abs(x.w) > (static_cast<T>(1) - epsilon<T>())) - return x; - T Angle = acos(y); - T NewAngle = Angle * y; - T Div = sin(NewAngle) / sin(Angle); - return tquat<T, P>( - cos(NewAngle), - x.x * Div, - x.y * Div, - x.z * Div); - } - - //template <typename T, precision P> - //GLM_FUNC_QUALIFIER tquat<T, P> sqrt - //( - // tquat<T, P> const & q - //) - //{ - // T q0 = static_cast<T>(1) - dot(q, q); - // return T(2) * (T(1) + q0) * q; - //} - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> rotate - ( - tquat<T, P> const & q, - tvec3<T, P> const & v - ) - { - return q * v; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> rotate - ( - tquat<T, P> const & q, - tvec4<T, P> const & v - ) - { - return q * v; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER T extractRealComponent - ( - tquat<T, P> const & q - ) - { - T w = static_cast<T>(1) - q.x * q.x - q.y * q.y - q.z * q.z; - if(w < T(0)) - return T(0); - else - return -sqrt(w); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER T length2 - ( - tquat<T, P> const & q - ) - { - return q.x * q.x + q.y * q.y + q.z * q.z + q.w * q.w; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tquat<T, P> shortMix - ( - tquat<T, P> const & x, - tquat<T, P> const & y, - T const & a - ) - { - if(a <= static_cast<T>(0)) return x; - if(a >= static_cast<T>(1)) return y; - - T fCos = dot(x, y); - tquat<T, P> y2(y); //BUG!!! tquat<T> y2; - if(fCos < static_cast<T>(0)) - { - y2 = -y; - fCos = -fCos; - } - - //if(fCos > 1.0f) // problem - T k0, k1; - if(fCos > (static_cast<T>(1) - epsilon<T>())) - { - k0 = static_cast<T>(1) - a; - k1 = static_cast<T>(0) + a; //BUG!!! 1.0f + a; - } - else - { - T fSin = sqrt(T(1) - fCos * fCos); - T fAngle = atan(fSin, fCos); - T fOneOverSin = static_cast<T>(1) / fSin; - k0 = sin((static_cast<T>(1) - a) * fAngle) * fOneOverSin; - k1 = sin((static_cast<T>(0) + a) * fAngle) * fOneOverSin; - } - - return tquat<T, P>( - k0 * x.w + k1 * y2.w, - k0 * x.x + k1 * y2.x, - k0 * x.y + k1 * y2.y, - k0 * x.z + k1 * y2.z); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tquat<T, P> fastMix - ( - tquat<T, P> const & x, - tquat<T, P> const & y, - T const & a - ) - { - return glm::normalize(x * (static_cast<T>(1) - a) + (y * a)); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tquat<T, P> rotation - ( - tvec3<T, P> const & orig, - tvec3<T, P> const & dest - ) - { - T cosTheta = dot(orig, dest); - tvec3<T, P> rotationAxis; - - if(cosTheta < static_cast<T>(-1) + epsilon<T>()) - { - // special case when vectors in opposite directions : - // there is no "ideal" rotation axis - // So guess one; any will do as long as it's perpendicular to start - // This implementation favors a rotation around the Up axis (Y), - // since it's often what you want to do. - rotationAxis = cross(tvec3<T, P>(0, 0, 1), orig); - if(length2(rotationAxis) < epsilon<T>()) // bad luck, they were parallel, try again! - rotationAxis = cross(tvec3<T, P>(1, 0, 0), orig); - - rotationAxis = normalize(rotationAxis); - return angleAxis(pi<T>(), rotationAxis); - } - - // Implementation from Stan Melax's Game Programming Gems 1 article - rotationAxis = cross(orig, dest); - - T s = sqrt((T(1) + cosTheta) * static_cast<T>(2)); - T invs = static_cast<T>(1) / s; - - return tquat<T, P>( - s * static_cast<T>(0.5f), - rotationAxis.x * invs, - rotationAxis.y * invs, - rotationAxis.z * invs); - } - -}//namespace glm diff --git a/extensions/common/glm/gtx/range.hpp b/extensions/common/glm/gtx/range.hpp deleted file mode 100644 index 71ac533658f..00000000000 --- a/extensions/common/glm/gtx/range.hpp +++ /dev/null @@ -1,102 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_range -/// @file glm/gtx/range.hpp -/// @date 2014-09-19 / 2014-09-19 -/// @author Joshua Moerman -/// -/// @defgroup gtx_range GLM_GTX_range -/// @ingroup gtx -/// -/// @brief Defines begin and end for vectors and matrices. Useful for range-based for loop. -/// The range is defined over the elements, not over columns or rows (e.g. mat4 has 16 elements). -/// -/// <glm/gtx/range.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependencies -#include "../detail/setup.hpp" - -#if !GLM_HAS_RANGE_FOR -# error "GLM_GTX_range requires C++11 suppport or 'range for'" -#endif - -#include "../gtc/type_ptr.hpp" - -namespace glm{ -namespace detail -{ - /* The glm types provide a .length() member, but for matrices - this only defines the number of columns, so we need to work around this */ - template <typename T, precision P> - detail::component_count_t number_of_elements_(tvec2<T, P> const & v){ - return detail::component_count(v); - } - - template <typename T, precision P> - detail::component_count_t number_of_elements_(tvec3<T, P> const & v){ - return detail::component_count(v); - } - - template <typename T, precision P> - detail::component_count_t number_of_elements_(tvec4<T, P> const & v){ - return detail::component_count(v); - } - - template <typename genType> - detail::component_count_t number_of_elements_(genType const & m){ - return detail::component_count(m) * detail::component_count(m[0]); - } -}//namespace - - /// @addtogroup gtx_range - /// @{ - - template <typename genType> - const typename genType::value_type * begin(genType const & v){ - return value_ptr(v); - } - - template <typename genType> - const typename genType::value_type * end(genType const & v){ - return begin(v) + detail::number_of_elements_(v); - } - - template <typename genType> - typename genType::value_type * begin(genType& v){ - return value_ptr(v); - } - - template <typename genType> - typename genType::value_type * end(genType& v){ - return begin(v) + detail::number_of_elements_(v); - } - - /// @} -}//namespace glm diff --git a/extensions/common/glm/gtx/raw_data.hpp b/extensions/common/glm/gtx/raw_data.hpp deleted file mode 100644 index e659644e0fd..00000000000 --- a/extensions/common/glm/gtx/raw_data.hpp +++ /dev/null @@ -1,76 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_raw_data -/// @file glm/gtx/raw_data.hpp -/// @date 2008-11-19 / 2011-06-07 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// -/// @defgroup gtx_raw_data GLM_GTX_raw_data -/// @ingroup gtx -/// -/// @brief Projection of a vector to other one -/// -/// <glm/gtx/raw_data.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependencies -#include "../detail/setup.hpp" -#include "../detail/type_int.hpp" - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTX_raw_data extension included") -#endif - -namespace glm -{ - /// @addtogroup gtx_raw_data - /// @{ - - //! Type for byte numbers. - //! From GLM_GTX_raw_data extension. - typedef detail::uint8 byte; - - //! Type for word numbers. - //! From GLM_GTX_raw_data extension. - typedef detail::uint16 word; - - //! Type for dword numbers. - //! From GLM_GTX_raw_data extension. - typedef detail::uint32 dword; - - //! Type for qword numbers. - //! From GLM_GTX_raw_data extension. - typedef detail::uint64 qword; - - /// @} -}// namespace glm - -#include "raw_data.inl" diff --git a/extensions/common/glm/gtx/raw_data.inl b/extensions/common/glm/gtx/raw_data.inl deleted file mode 100644 index f573a720e93..00000000000 --- a/extensions/common/glm/gtx/raw_data.inl +++ /dev/null @@ -1,31 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_raw_data -/// @file glm/gtx/raw_data.inl -/// @date 2008-11-19 / 2011-06-07 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// diff --git a/extensions/common/glm/gtx/rotate_normalized_axis.hpp b/extensions/common/glm/gtx/rotate_normalized_axis.hpp deleted file mode 100644 index df69f795529..00000000000 --- a/extensions/common/glm/gtx/rotate_normalized_axis.hpp +++ /dev/null @@ -1,93 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_rotate_normalized_axis -/// @file glm/gtx/rotate_normalized_axis.hpp -/// @date 2012-12-13 / 2012-12-13 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// @see gtc_matrix_transform -/// @see gtc_quaternion -/// -/// @defgroup gtx_rotate_normalized_axis GLM_GTX_rotate_normalized_axis -/// @ingroup gtx -/// -/// @brief Quaternions and matrices rotations around normalized axis. -/// -/// <glm/gtx/rotate_normalized_axis.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependency: -#include "../glm.hpp" -#include "../gtc/epsilon.hpp" -#include "../gtc/quaternion.hpp" - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTX_rotate_normalized_axis extension included") -#endif - -namespace glm -{ - /// @addtogroup gtx_rotate_normalized_axis - /// @{ - - /// Builds a rotation 4 * 4 matrix created from a normalized axis and an angle. - /// - /// @param m Input matrix multiplied by this rotation matrix. - /// @param angle Rotation angle expressed in radians if GLM_FORCE_RADIANS is define or degrees otherwise. - /// @param axis Rotation axis, must be normalized. - /// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double. - /// - /// @see gtx_rotate_normalized_axis - /// @see - rotate(T angle, T x, T y, T z) - /// @see - rotate(tmat4x4<T, P> const & m, T angle, T x, T y, T z) - /// @see - rotate(T angle, tvec3<T, P> const & v) - template <typename T, precision P> - GLM_FUNC_DECL tmat4x4<T, P> rotateNormalizedAxis( - tmat4x4<T, P> const & m, - T const & angle, - tvec3<T, P> const & axis); - - /// Rotates a quaternion from a vector of 3 components normalized axis and an angle. - /// - /// @param q Source orientation - /// @param angle Angle expressed in radians if GLM_FORCE_RADIANS is define or degrees otherwise. - /// @param axis Normalized axis of the rotation, must be normalized. - /// - /// @see gtx_rotate_normalized_axis - template <typename T, precision P> - GLM_FUNC_DECL tquat<T, P> rotateNormalizedAxis( - tquat<T, P> const & q, - T const & angle, - tvec3<T, P> const & axis); - - /// @} -}//namespace glm - -#include "rotate_normalized_axis.inl" diff --git a/extensions/common/glm/gtx/rotate_normalized_axis.inl b/extensions/common/glm/gtx/rotate_normalized_axis.inl deleted file mode 100644 index 9bb257ca86d..00000000000 --- a/extensions/common/glm/gtx/rotate_normalized_axis.inl +++ /dev/null @@ -1,88 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_rotate_normalized_axis -/// @file glm/gtx/rotate_normalized_axis.inl -/// @date 2012-12-13 / 2012-12-13 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P> rotateNormalizedAxis - ( - tmat4x4<T, P> const & m, - T const & angle, - tvec3<T, P> const & v - ) - { - T const a = angle; - T const c = cos(a); - T const s = sin(a); - - tvec3<T, P> const axis(v); - - tvec3<T, P> const temp((static_cast<T>(1) - c) * axis); - - tmat4x4<T, P> Rotate(uninitialize); - Rotate[0][0] = c + temp[0] * axis[0]; - Rotate[0][1] = 0 + temp[0] * axis[1] + s * axis[2]; - Rotate[0][2] = 0 + temp[0] * axis[2] - s * axis[1]; - - Rotate[1][0] = 0 + temp[1] * axis[0] - s * axis[2]; - Rotate[1][1] = c + temp[1] * axis[1]; - Rotate[1][2] = 0 + temp[1] * axis[2] + s * axis[0]; - - Rotate[2][0] = 0 + temp[2] * axis[0] + s * axis[1]; - Rotate[2][1] = 0 + temp[2] * axis[1] - s * axis[0]; - Rotate[2][2] = c + temp[2] * axis[2]; - - tmat4x4<T, P> Result(uninitialize); - Result[0] = m[0] * Rotate[0][0] + m[1] * Rotate[0][1] + m[2] * Rotate[0][2]; - Result[1] = m[0] * Rotate[1][0] + m[1] * Rotate[1][1] + m[2] * Rotate[1][2]; - Result[2] = m[0] * Rotate[2][0] + m[1] * Rotate[2][1] + m[2] * Rotate[2][2]; - Result[3] = m[3]; - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tquat<T, P> rotateNormalizedAxis - ( - tquat<T, P> const & q, - T const & angle, - tvec3<T, P> const & v - ) - { - tvec3<T, P> const Tmp(v); - - T const AngleRad(angle); - T const Sin = sin(AngleRad * T(0.5)); - - return q * tquat<T, P>(cos(AngleRad * static_cast<T>(0.5)), Tmp.x * Sin, Tmp.y * Sin, Tmp.z * Sin); - //return gtc::quaternion::cross(q, tquat<T, P>(cos(AngleRad * T(0.5)), Tmp.x * fSin, Tmp.y * fSin, Tmp.z * fSin)); - } -}//namespace glm diff --git a/extensions/common/glm/gtx/rotate_vector.hpp b/extensions/common/glm/gtx/rotate_vector.hpp deleted file mode 100644 index 38bd4e7e863..00000000000 --- a/extensions/common/glm/gtx/rotate_vector.hpp +++ /dev/null @@ -1,146 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_rotate_vector -/// @file glm/gtx/rotate_vector.hpp -/// @date 2006-11-02 / 2011-06-07 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// @see gtx_transform (dependence) -/// -/// @defgroup gtx_rotate_vector GLM_GTX_rotate_vector -/// @ingroup gtx -/// -/// @brief Function to directly rotate a vector -/// -/// <glm/gtx/rotate_vector.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependency: -#include "../glm.hpp" -#include "../gtx/transform.hpp" - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTX_rotate_vector extension included") -#endif - -namespace glm -{ - /// @addtogroup gtx_rotate_vector - /// @{ - - /// Returns Spherical interpolation between two vectors - /// - /// @param x A first vector - /// @param y A second vector - /// @param a Interpolation factor. The interpolation is defined beyond the range [0, 1]. - /// - /// @see gtx_rotate_vector - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> slerp( - tvec3<T, P> const & x, - tvec3<T, P> const & y, - T const & a); - - //! Rotate a two dimensional vector. - //! From GLM_GTX_rotate_vector extension. - template <typename T, precision P> - GLM_FUNC_DECL tvec2<T, P> rotate( - tvec2<T, P> const & v, - T const & angle); - - //! Rotate a three dimensional vector around an axis. - //! From GLM_GTX_rotate_vector extension. - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> rotate( - tvec3<T, P> const & v, - T const & angle, - tvec3<T, P> const & normal); - - //! Rotate a four dimensional vector around an axis. - //! From GLM_GTX_rotate_vector extension. - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> rotate( - tvec4<T, P> const & v, - T const & angle, - tvec3<T, P> const & normal); - - //! Rotate a three dimensional vector around the X axis. - //! From GLM_GTX_rotate_vector extension. - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> rotateX( - tvec3<T, P> const & v, - T const & angle); - - //! Rotate a three dimensional vector around the Y axis. - //! From GLM_GTX_rotate_vector extension. - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> rotateY( - tvec3<T, P> const & v, - T const & angle); - - //! Rotate a three dimensional vector around the Z axis. - //! From GLM_GTX_rotate_vector extension. - template <typename T, precision P> - GLM_FUNC_DECL tvec3<T, P> rotateZ( - tvec3<T, P> const & v, - T const & angle); - - //! Rotate a four dimentionnals vector around the X axis. - //! From GLM_GTX_rotate_vector extension. - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> rotateX( - tvec4<T, P> const & v, - T const & angle); - - //! Rotate a four dimensional vector around the X axis. - //! From GLM_GTX_rotate_vector extension. - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> rotateY( - tvec4<T, P> const & v, - T const & angle); - - //! Rotate a four dimensional vector around the X axis. - //! From GLM_GTX_rotate_vector extension. - template <typename T, precision P> - GLM_FUNC_DECL tvec4<T, P> rotateZ( - tvec4<T, P> const & v, - T const & angle); - - //! Build a rotation matrix from a normal and a up vector. - //! From GLM_GTX_rotate_vector extension. - template <typename T, precision P> - GLM_FUNC_DECL tmat4x4<T, P> orientation( - tvec3<T, P> const & Normal, - tvec3<T, P> const & Up); - - /// @} -}//namespace glm - -#include "rotate_vector.inl" diff --git a/extensions/common/glm/gtx/rotate_vector.inl b/extensions/common/glm/gtx/rotate_vector.inl deleted file mode 100644 index cdac5744bdb..00000000000 --- a/extensions/common/glm/gtx/rotate_vector.inl +++ /dev/null @@ -1,217 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_rotate_vector -/// @file glm/gtx/rotate_vector.inl -/// @date 2006-11-02 / 2011-06-07 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> slerp - ( - tvec3<T, P> const & x, - tvec3<T, P> const & y, - T const & a - ) - { - // get cosine of angle between vectors (-1 -> 1) - T CosAlpha = dot(x, y); - // get angle (0 -> pi) - T Alpha = acos(CosAlpha); - // get sine of angle between vectors (0 -> 1) - T SinAlpha = sin(Alpha); - // this breaks down when SinAlpha = 0, i.e. Alpha = 0 or pi - T t1 = sin((static_cast<T>(1) - a) * Alpha) / SinAlpha; - T t2 = sin(a * Alpha) / SinAlpha; - - // interpolate src vectors - return x * t1 + y * t2; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> rotate - ( - tvec2<T, P> const & v, - T const & angle - ) - { - tvec2<T, P> Result; - T const Cos(cos(angle)); - T const Sin(sin(angle)); - - Result.x = v.x * Cos - v.y * Sin; - Result.y = v.x * Sin + v.y * Cos; - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> rotate - ( - tvec3<T, P> const & v, - T const & angle, - tvec3<T, P> const & normal - ) - { - return tmat3x3<T, P>(glm::rotate(angle, normal)) * v; - } - /* - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> rotateGTX( - const tvec3<T, P>& x, - T angle, - const tvec3<T, P>& normal) - { - const T Cos = cos(radians(angle)); - const T Sin = sin(radians(angle)); - return x * Cos + ((x * normal) * (T(1) - Cos)) * normal + cross(x, normal) * Sin; - } - */ - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> rotate - ( - tvec4<T, P> const & v, - T const & angle, - tvec3<T, P> const & normal - ) - { - return rotate(angle, normal) * v; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> rotateX - ( - tvec3<T, P> const & v, - T const & angle - ) - { - tvec3<T, P> Result(v); - T const Cos(cos(angle)); - T const Sin(sin(angle)); - - Result.y = v.y * Cos - v.z * Sin; - Result.z = v.y * Sin + v.z * Cos; - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> rotateY - ( - tvec3<T, P> const & v, - T const & angle - ) - { - tvec3<T, P> Result = v; - T const Cos(cos(angle)); - T const Sin(sin(angle)); - - Result.x = v.x * Cos + v.z * Sin; - Result.z = -v.x * Sin + v.z * Cos; - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> rotateZ - ( - tvec3<T, P> const & v, - T const & angle - ) - { - tvec3<T, P> Result = v; - T const Cos(cos(angle)); - T const Sin(sin(angle)); - - Result.x = v.x * Cos - v.y * Sin; - Result.y = v.x * Sin + v.y * Cos; - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> rotateX - ( - tvec4<T, P> const & v, - T const & angle - ) - { - tvec4<T, P> Result = v; - T const Cos(cos(angle)); - T const Sin(sin(angle)); - - Result.y = v.y * Cos - v.z * Sin; - Result.z = v.y * Sin + v.z * Cos; - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> rotateY - ( - tvec4<T, P> const & v, - T const & angle - ) - { - tvec4<T, P> Result = v; - T const Cos(cos(angle)); - T const Sin(sin(angle)); - - Result.x = v.x * Cos + v.z * Sin; - Result.z = -v.x * Sin + v.z * Cos; - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> rotateZ - ( - tvec4<T, P> const & v, - T const & angle - ) - { - tvec4<T, P> Result = v; - T const Cos(cos(angle)); - T const Sin(sin(angle)); - - Result.x = v.x * Cos - v.y * Sin; - Result.y = v.x * Sin + v.y * Cos; - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P> orientation - ( - tvec3<T, P> const & Normal, - tvec3<T, P> const & Up - ) - { - if(all(equal(Normal, Up))) - return tmat4x4<T, P>(T(1)); - - tvec3<T, P> RotationAxis = cross(Up, Normal); - T Angle = acos(dot(Normal, Up)); - - return rotate(Angle, RotationAxis); - } -}//namespace glm diff --git a/extensions/common/glm/gtx/scalar_multiplication.hpp b/extensions/common/glm/gtx/scalar_multiplication.hpp deleted file mode 100644 index fd58f0ab561..00000000000 --- a/extensions/common/glm/gtx/scalar_multiplication.hpp +++ /dev/null @@ -1,98 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx -/// @file glm/gtx/scalar_multiplication.hpp -/// @date 2014-09-22 / 2014-09-22 -/// @author Joshua Moerman -/// -/// @brief Enables scalar multiplication for all types -/// -/// Since GLSL is very strict about types, the following (often used) combinations do not work: -/// double * vec4 -/// int * vec4 -/// vec4 / int -/// So we'll fix that! Of course "float * vec4" should remain the same (hence the enable_if magic) -/// -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "../detail/setup.hpp" - -#if !GLM_HAS_TEMPLATE_ALIASES && !(GLM_COMPILER & GLM_COMPILER_GCC) -# error "GLM_GTX_scalar_multiplication requires C++11 suppport or alias templates and if not support for GCC" -#endif - -#include "../vec2.hpp" -#include "../vec3.hpp" -#include "../vec4.hpp" -#include "../mat2x2.hpp" -#include <type_traits> - -namespace glm -{ - template <typename T, typename Vec> - using return_type_scalar_multiplication = typename std::enable_if< - !std::is_same<T, float>::value // T may not be a float - && std::is_arithmetic<T>::value, Vec // But it may be an int or double (no vec3 or mat3, ...) - >::type; - -#define GLM_IMPLEMENT_SCAL_MULT(Vec) \ - template <typename T> \ - return_type_scalar_multiplication<T, Vec> \ - operator*(T const & s, Vec rh){ \ - return rh *= static_cast<float>(s); \ - } \ - \ - template <typename T> \ - return_type_scalar_multiplication<T, Vec> \ - operator*(Vec lh, T const & s){ \ - return lh *= static_cast<float>(s); \ - } \ - \ - template <typename T> \ - return_type_scalar_multiplication<T, Vec> \ - operator/(Vec lh, T const & s){ \ - return lh *= 1.0f / s; \ - } - -GLM_IMPLEMENT_SCAL_MULT(vec2) -GLM_IMPLEMENT_SCAL_MULT(vec3) -GLM_IMPLEMENT_SCAL_MULT(vec4) - -GLM_IMPLEMENT_SCAL_MULT(mat2) -GLM_IMPLEMENT_SCAL_MULT(mat2x3) -GLM_IMPLEMENT_SCAL_MULT(mat2x4) -GLM_IMPLEMENT_SCAL_MULT(mat3x2) -GLM_IMPLEMENT_SCAL_MULT(mat3) -GLM_IMPLEMENT_SCAL_MULT(mat3x4) -GLM_IMPLEMENT_SCAL_MULT(mat4x2) -GLM_IMPLEMENT_SCAL_MULT(mat4x3) -GLM_IMPLEMENT_SCAL_MULT(mat4) - -#undef GLM_IMPLEMENT_SCAL_MULT -} // namespace glm diff --git a/extensions/common/glm/gtx/scalar_relational.hpp b/extensions/common/glm/gtx/scalar_relational.hpp deleted file mode 100644 index a3e361c6109..00000000000 --- a/extensions/common/glm/gtx/scalar_relational.hpp +++ /dev/null @@ -1,61 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_scalar_relational -/// @file glm/gtx/scalar_relational.hpp -/// @date 2013-02-04 / 2013-02-04 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// -/// @defgroup gtx_scalar_relational GLM_GTX_scalar_relational -/// @ingroup gtx -/// -/// @brief Extend a position from a source to a position at a defined length. -/// -/// <glm/gtx/scalar_relational.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependency: -#include "../glm.hpp" - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTX_extend extension included") -#endif - -namespace glm -{ - /// @addtogroup gtx_scalar_relational - /// @{ - - - - /// @} -}//namespace glm - -#include "scalar_relational.inl" diff --git a/extensions/common/glm/gtx/scalar_relational.inl b/extensions/common/glm/gtx/scalar_relational.inl deleted file mode 100644 index b28c8cfeeb1..00000000000 --- a/extensions/common/glm/gtx/scalar_relational.inl +++ /dev/null @@ -1,118 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_scalar_relational -/// @file glm/gtx/scalar_relational.inl -/// @date 2013-02-04 / 2013-02-04 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template <typename T> - GLM_FUNC_QUALIFIER bool lessThan - ( - T const & x, - T const & y - ) - { - return x < y; - } - - template <typename T> - GLM_FUNC_QUALIFIER bool lessThanEqual - ( - T const & x, - T const & y - ) - { - return x <= y; - } - - template <typename T> - GLM_FUNC_QUALIFIER bool greaterThan - ( - T const & x, - T const & y - ) - { - return x > y; - } - - template <typename T> - GLM_FUNC_QUALIFIER bool greaterThanEqual - ( - T const & x, - T const & y - ) - { - return x >= y; - } - - template <typename T> - GLM_FUNC_QUALIFIER bool equal - ( - T const & x, - T const & y - ) - { - return x == y; - } - - template <typename T> - GLM_FUNC_QUALIFIER bool notEqual - ( - T const & x, - T const & y - ) - { - return x != y; - } - - GLM_FUNC_QUALIFIER bool any - ( - bool const & x - ) - { - return x; - } - - GLM_FUNC_QUALIFIER bool all - ( - bool const & x - ) - { - return x; - } - - GLM_FUNC_QUALIFIER bool not_ - ( - bool const & x - ) - { - return !x; - } -}//namespace glm diff --git a/extensions/common/glm/gtx/simd_mat4.hpp b/extensions/common/glm/gtx/simd_mat4.hpp deleted file mode 100644 index d624974352d..00000000000 --- a/extensions/common/glm/gtx/simd_mat4.hpp +++ /dev/null @@ -1,205 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_simd_mat4 -/// @file glm/gtx/simd_mat4.hpp -/// @date 2009-05-07 / 2011-06-07 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// -/// @defgroup gtx_simd_mat4 GLM_GTX_simd_mat4 -/// @ingroup gtx -/// -/// @brief SIMD implementation of mat4 type. -/// -/// <glm/gtx/simd_mat4.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependencies -#include "../detail/setup.hpp" - -#if(GLM_ARCH != GLM_ARCH_PURE) - -#if(GLM_ARCH & GLM_ARCH_SSE2) -# include "../detail/intrinsic_matrix.hpp" -# include "../gtx/simd_vec4.hpp" -#else -# error "GLM: GLM_GTX_simd_mat4 requires compiler support of SSE2 through intrinsics" -#endif - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTX_simd_mat4 extension included") -#endif - -namespace glm{ -namespace detail -{ - /// 4x4 Matrix implemented using SIMD SEE intrinsics. - /// \ingroup gtx_simd_mat4 - GLM_ALIGNED_STRUCT(16) fmat4x4SIMD - { - typedef float value_type; - typedef fvec4SIMD col_type; - typedef fvec4SIMD row_type; - typedef std::size_t size_type; - typedef fmat4x4SIMD type; - typedef fmat4x4SIMD transpose_type; - - GLM_FUNC_DECL length_t length() const; - - fvec4SIMD Data[4]; - - ////////////////////////////////////// - // Constructors - - fmat4x4SIMD(); - explicit fmat4x4SIMD(float const & s); - explicit fmat4x4SIMD( - float const & x0, float const & y0, float const & z0, float const & w0, - float const & x1, float const & y1, float const & z1, float const & w1, - float const & x2, float const & y2, float const & z2, float const & w2, - float const & x3, float const & y3, float const & z3, float const & w3); - explicit fmat4x4SIMD( - fvec4SIMD const & v0, - fvec4SIMD const & v1, - fvec4SIMD const & v2, - fvec4SIMD const & v3); - explicit fmat4x4SIMD( - mat4x4 const & m); - explicit fmat4x4SIMD( - __m128 const in[4]); - - // Conversions - //template <typename U> - //explicit tmat4x4(tmat4x4<U> const & m); - - //explicit tmat4x4(tmat2x2<T> const & x); - //explicit tmat4x4(tmat3x3<T> const & x); - //explicit tmat4x4(tmat2x3<T> const & x); - //explicit tmat4x4(tmat3x2<T> const & x); - //explicit tmat4x4(tmat2x4<T> const & x); - //explicit tmat4x4(tmat4x2<T> const & x); - //explicit tmat4x4(tmat3x4<T> const & x); - //explicit tmat4x4(tmat4x3<T> const & x); - - // Accesses - fvec4SIMD & operator[](length_t i); - fvec4SIMD const & operator[](length_t i) const; - - // Unary updatable operators - fmat4x4SIMD & operator= (fmat4x4SIMD const & m); - fmat4x4SIMD & operator+= (float const & s); - fmat4x4SIMD & operator+= (fmat4x4SIMD const & m); - fmat4x4SIMD & operator-= (float const & s); - fmat4x4SIMD & operator-= (fmat4x4SIMD const & m); - fmat4x4SIMD & operator*= (float const & s); - fmat4x4SIMD & operator*= (fmat4x4SIMD const & m); - fmat4x4SIMD & operator/= (float const & s); - fmat4x4SIMD & operator/= (fmat4x4SIMD const & m); - fmat4x4SIMD & operator++ (); - fmat4x4SIMD & operator-- (); - }; - - // Binary operators - fmat4x4SIMD operator+ (fmat4x4SIMD const & m, float const & s); - fmat4x4SIMD operator+ (float const & s, fmat4x4SIMD const & m); - fmat4x4SIMD operator+ (fmat4x4SIMD const & m1, fmat4x4SIMD const & m2); - - fmat4x4SIMD operator- (fmat4x4SIMD const & m, float const & s); - fmat4x4SIMD operator- (float const & s, fmat4x4SIMD const & m); - fmat4x4SIMD operator- (fmat4x4SIMD const & m1, fmat4x4SIMD const & m2); - - fmat4x4SIMD operator* (fmat4x4SIMD const & m, float const & s); - fmat4x4SIMD operator* (float const & s, fmat4x4SIMD const & m); - - fvec4SIMD operator* (fmat4x4SIMD const & m, fvec4SIMD const & v); - fvec4SIMD operator* (fvec4SIMD const & v, fmat4x4SIMD const & m); - - fmat4x4SIMD operator* (fmat4x4SIMD const & m1, fmat4x4SIMD const & m2); - - fmat4x4SIMD operator/ (fmat4x4SIMD const & m, float const & s); - fmat4x4SIMD operator/ (float const & s, fmat4x4SIMD const & m); - - fvec4SIMD operator/ (fmat4x4SIMD const & m, fvec4SIMD const & v); - fvec4SIMD operator/ (fvec4SIMD const & v, fmat4x4SIMD const & m); - - fmat4x4SIMD operator/ (fmat4x4SIMD const & m1, fmat4x4SIMD const & m2); - - // Unary constant operators - fmat4x4SIMD const operator- (fmat4x4SIMD const & m); - fmat4x4SIMD const operator-- (fmat4x4SIMD const & m, int); - fmat4x4SIMD const operator++ (fmat4x4SIMD const & m, int); -}//namespace detail - - typedef detail::fmat4x4SIMD simdMat4; - - /// @addtogroup gtx_simd_mat4 - /// @{ - - //! Convert a simdMat4 to a mat4. - //! (From GLM_GTX_simd_mat4 extension) - mat4 mat4_cast( - detail::fmat4x4SIMD const & x); - - //! Multiply matrix x by matrix y component-wise, i.e., - //! result[i][j] is the scalar product of x[i][j] and y[i][j]. - //! (From GLM_GTX_simd_mat4 extension). - detail::fmat4x4SIMD matrixCompMult( - detail::fmat4x4SIMD const & x, - detail::fmat4x4SIMD const & y); - - //! Treats the first parameter c as a column vector - //! and the second parameter r as a row vector - //! and does a linear algebraic matrix multiply c * r. - //! (From GLM_GTX_simd_mat4 extension). - detail::fmat4x4SIMD outerProduct( - detail::fvec4SIMD const & c, - detail::fvec4SIMD const & r); - - //! Returns the transposed matrix of x - //! (From GLM_GTX_simd_mat4 extension). - detail::fmat4x4SIMD transpose( - detail::fmat4x4SIMD const & x); - - //! Return the determinant of a mat4 matrix. - //! (From GLM_GTX_simd_mat4 extension). - float determinant( - detail::fmat4x4SIMD const & m); - - //! Return the inverse of a mat4 matrix. - //! (From GLM_GTX_simd_mat4 extension). - detail::fmat4x4SIMD inverse( - detail::fmat4x4SIMD const & m); - - /// @} -}// namespace glm - -#include "simd_mat4.inl" - -#endif//(GLM_ARCH != GLM_ARCH_PURE) diff --git a/extensions/common/glm/gtx/simd_mat4.inl b/extensions/common/glm/gtx/simd_mat4.inl deleted file mode 100644 index 14c8b45e9b9..00000000000 --- a/extensions/common/glm/gtx/simd_mat4.inl +++ /dev/null @@ -1,602 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_simd_mat4 -/// @file glm/gtx/simd_mat4.inl -/// @date 2009-05-07 / 2011-06-07 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm{ -namespace detail{ - -GLM_FUNC_QUALIFIER length_t fmat4x4SIMD::length() const -{ - return 4; -} - -////////////////////////////////////// -// Accesses - -GLM_FUNC_QUALIFIER fvec4SIMD & fmat4x4SIMD::operator[] -( - length_t i -) -{ - assert(i < this->length()); - - return this->Data[i]; -} - -GLM_FUNC_QUALIFIER fvec4SIMD const & fmat4x4SIMD::operator[] -( - length_t i -) const -{ - assert(i < this->length()); - - return this->Data[i]; -} - -////////////////////////////////////////////////////////////// -// Constructors - -GLM_FUNC_QUALIFIER fmat4x4SIMD::fmat4x4SIMD() -{ -# ifndef GLM_FORCE_NO_CTOR_INIT - this->Data[0] = fvec4SIMD(1, 0, 0, 0); - this->Data[1] = fvec4SIMD(0, 1, 0, 0); - this->Data[2] = fvec4SIMD(0, 0, 1, 0); - this->Data[3] = fvec4SIMD(0, 0, 0, 1); -# endif -} - -GLM_FUNC_QUALIFIER fmat4x4SIMD::fmat4x4SIMD(float const & s) -{ - this->Data[0] = fvec4SIMD(s, 0, 0, 0); - this->Data[1] = fvec4SIMD(0, s, 0, 0); - this->Data[2] = fvec4SIMD(0, 0, s, 0); - this->Data[3] = fvec4SIMD(0, 0, 0, s); -} - -GLM_FUNC_QUALIFIER fmat4x4SIMD::fmat4x4SIMD -( - float const & x0, float const & y0, float const & z0, float const & w0, - float const & x1, float const & y1, float const & z1, float const & w1, - float const & x2, float const & y2, float const & z2, float const & w2, - float const & x3, float const & y3, float const & z3, float const & w3 -) -{ - this->Data[0] = fvec4SIMD(x0, y0, z0, w0); - this->Data[1] = fvec4SIMD(x1, y1, z1, w1); - this->Data[2] = fvec4SIMD(x2, y2, z2, w2); - this->Data[3] = fvec4SIMD(x3, y3, z3, w3); -} - -GLM_FUNC_QUALIFIER fmat4x4SIMD::fmat4x4SIMD -( - fvec4SIMD const & v0, - fvec4SIMD const & v1, - fvec4SIMD const & v2, - fvec4SIMD const & v3 -) -{ - this->Data[0] = v0; - this->Data[1] = v1; - this->Data[2] = v2; - this->Data[3] = v3; -} - -GLM_FUNC_QUALIFIER fmat4x4SIMD::fmat4x4SIMD -( - mat4 const & m -) -{ - this->Data[0] = fvec4SIMD(m[0]); - this->Data[1] = fvec4SIMD(m[1]); - this->Data[2] = fvec4SIMD(m[2]); - this->Data[3] = fvec4SIMD(m[3]); -} - -GLM_FUNC_QUALIFIER fmat4x4SIMD::fmat4x4SIMD -( - __m128 const in[4] -) -{ - this->Data[0] = in[0]; - this->Data[1] = in[1]; - this->Data[2] = in[2]; - this->Data[3] = in[3]; -} - -////////////////////////////////////////////////////////////// -// mat4 operators - -GLM_FUNC_QUALIFIER fmat4x4SIMD& fmat4x4SIMD::operator= -( - fmat4x4SIMD const & m -) -{ - this->Data[0] = m[0]; - this->Data[1] = m[1]; - this->Data[2] = m[2]; - this->Data[3] = m[3]; - return *this; -} - -GLM_FUNC_QUALIFIER fmat4x4SIMD & fmat4x4SIMD::operator+= -( - fmat4x4SIMD const & m -) -{ - this->Data[0].Data = _mm_add_ps(this->Data[0].Data, m[0].Data); - this->Data[1].Data = _mm_add_ps(this->Data[1].Data, m[1].Data); - this->Data[2].Data = _mm_add_ps(this->Data[2].Data, m[2].Data); - this->Data[3].Data = _mm_add_ps(this->Data[3].Data, m[3].Data); - return *this; -} - -GLM_FUNC_QUALIFIER fmat4x4SIMD & fmat4x4SIMD::operator-= -( - fmat4x4SIMD const & m -) -{ - this->Data[0].Data = _mm_sub_ps(this->Data[0].Data, m[0].Data); - this->Data[1].Data = _mm_sub_ps(this->Data[1].Data, m[1].Data); - this->Data[2].Data = _mm_sub_ps(this->Data[2].Data, m[2].Data); - this->Data[3].Data = _mm_sub_ps(this->Data[3].Data, m[3].Data); - - return *this; -} - -GLM_FUNC_QUALIFIER fmat4x4SIMD & fmat4x4SIMD::operator*= -( - fmat4x4SIMD const & m -) -{ - sse_mul_ps(&this->Data[0].Data, &m.Data[0].Data, &this->Data[0].Data); - return *this; -} - -GLM_FUNC_QUALIFIER fmat4x4SIMD & fmat4x4SIMD::operator/= -( - fmat4x4SIMD const & m -) -{ - __m128 Inv[4]; - sse_inverse_ps(&m.Data[0].Data, Inv); - sse_mul_ps(&this->Data[0].Data, Inv, &this->Data[0].Data); - return *this; -} - -GLM_FUNC_QUALIFIER fmat4x4SIMD & fmat4x4SIMD::operator+= -( - float const & s -) -{ - __m128 Operand = _mm_set_ps1(s); - this->Data[0].Data = _mm_add_ps(this->Data[0].Data, Operand); - this->Data[1].Data = _mm_add_ps(this->Data[1].Data, Operand); - this->Data[2].Data = _mm_add_ps(this->Data[2].Data, Operand); - this->Data[3].Data = _mm_add_ps(this->Data[3].Data, Operand); - return *this; -} - -GLM_FUNC_QUALIFIER fmat4x4SIMD & fmat4x4SIMD::operator-= -( - float const & s -) -{ - __m128 Operand = _mm_set_ps1(s); - this->Data[0].Data = _mm_sub_ps(this->Data[0].Data, Operand); - this->Data[1].Data = _mm_sub_ps(this->Data[1].Data, Operand); - this->Data[2].Data = _mm_sub_ps(this->Data[2].Data, Operand); - this->Data[3].Data = _mm_sub_ps(this->Data[3].Data, Operand); - return *this; -} - -GLM_FUNC_QUALIFIER fmat4x4SIMD & fmat4x4SIMD::operator*= -( - float const & s -) -{ - __m128 Operand = _mm_set_ps1(s); - this->Data[0].Data = _mm_mul_ps(this->Data[0].Data, Operand); - this->Data[1].Data = _mm_mul_ps(this->Data[1].Data, Operand); - this->Data[2].Data = _mm_mul_ps(this->Data[2].Data, Operand); - this->Data[3].Data = _mm_mul_ps(this->Data[3].Data, Operand); - return *this; -} - -GLM_FUNC_QUALIFIER fmat4x4SIMD & fmat4x4SIMD::operator/= -( - float const & s -) -{ - __m128 Operand = _mm_div_ps(one, _mm_set_ps1(s)); - this->Data[0].Data = _mm_mul_ps(this->Data[0].Data, Operand); - this->Data[1].Data = _mm_mul_ps(this->Data[1].Data, Operand); - this->Data[2].Data = _mm_mul_ps(this->Data[2].Data, Operand); - this->Data[3].Data = _mm_mul_ps(this->Data[3].Data, Operand); - return *this; -} - -GLM_FUNC_QUALIFIER fmat4x4SIMD & fmat4x4SIMD::operator++ () -{ - this->Data[0].Data = _mm_add_ps(this->Data[0].Data, one); - this->Data[1].Data = _mm_add_ps(this->Data[1].Data, one); - this->Data[2].Data = _mm_add_ps(this->Data[2].Data, one); - this->Data[3].Data = _mm_add_ps(this->Data[3].Data, one); - return *this; -} - -GLM_FUNC_QUALIFIER fmat4x4SIMD & fmat4x4SIMD::operator-- () -{ - this->Data[0].Data = _mm_sub_ps(this->Data[0].Data, one); - this->Data[1].Data = _mm_sub_ps(this->Data[1].Data, one); - this->Data[2].Data = _mm_sub_ps(this->Data[2].Data, one); - this->Data[3].Data = _mm_sub_ps(this->Data[3].Data, one); - return *this; -} - - -////////////////////////////////////////////////////////////// -// Binary operators - -GLM_FUNC_QUALIFIER fmat4x4SIMD operator+ -( - const fmat4x4SIMD &m, - float const & s -) -{ - return detail::fmat4x4SIMD - ( - m[0] + s, - m[1] + s, - m[2] + s, - m[3] + s - ); -} - -GLM_FUNC_QUALIFIER fmat4x4SIMD operator+ -( - float const & s, - const fmat4x4SIMD &m -) -{ - return detail::fmat4x4SIMD - ( - m[0] + s, - m[1] + s, - m[2] + s, - m[3] + s - ); -} - -GLM_FUNC_QUALIFIER fmat4x4SIMD operator+ -( - const fmat4x4SIMD &m1, - const fmat4x4SIMD &m2 -) -{ - return detail::fmat4x4SIMD - ( - m1[0] + m2[0], - m1[1] + m2[1], - m1[2] + m2[2], - m1[3] + m2[3] - ); -} - - -GLM_FUNC_QUALIFIER fmat4x4SIMD operator- -( - const fmat4x4SIMD &m, - float const & s -) -{ - return detail::fmat4x4SIMD - ( - m[0] - s, - m[1] - s, - m[2] - s, - m[3] - s - ); -} - -GLM_FUNC_QUALIFIER fmat4x4SIMD operator- -( - float const & s, - const fmat4x4SIMD &m -) -{ - return detail::fmat4x4SIMD - ( - s - m[0], - s - m[1], - s - m[2], - s - m[3] - ); -} - -GLM_FUNC_QUALIFIER fmat4x4SIMD operator- -( - const fmat4x4SIMD &m1, - const fmat4x4SIMD &m2 -) -{ - return detail::fmat4x4SIMD - ( - m1[0] - m2[0], - m1[1] - m2[1], - m1[2] - m2[2], - m1[3] - m2[3] - ); -} - - -GLM_FUNC_QUALIFIER fmat4x4SIMD operator* -( - const fmat4x4SIMD &m, - float const & s -) -{ - return detail::fmat4x4SIMD - ( - m[0] * s, - m[1] * s, - m[2] * s, - m[3] * s - ); -} - -GLM_FUNC_QUALIFIER fmat4x4SIMD operator* -( - float const & s, - const fmat4x4SIMD &m -) -{ - return detail::fmat4x4SIMD - ( - m[0] * s, - m[1] * s, - m[2] * s, - m[3] * s - ); -} - -GLM_FUNC_QUALIFIER fvec4SIMD operator* -( - const fmat4x4SIMD &m, - fvec4SIMD const & v -) -{ - return sse_mul_ps(&m.Data[0].Data, v.Data); -} - -GLM_FUNC_QUALIFIER fvec4SIMD operator* -( - fvec4SIMD const & v, - const fmat4x4SIMD &m -) -{ - return sse_mul_ps(v.Data, &m.Data[0].Data); -} - -GLM_FUNC_QUALIFIER fmat4x4SIMD operator* -( - const fmat4x4SIMD &m1, - const fmat4x4SIMD &m2 -) -{ - fmat4x4SIMD result; - sse_mul_ps(&m1.Data[0].Data, &m2.Data[0].Data, &result.Data[0].Data); - - return result; -} - - - -GLM_FUNC_QUALIFIER fmat4x4SIMD operator/ -( - const fmat4x4SIMD &m, - float const & s -) -{ - return detail::fmat4x4SIMD - ( - m[0] / s, - m[1] / s, - m[2] / s, - m[3] / s - ); -} - -GLM_FUNC_QUALIFIER fmat4x4SIMD operator/ -( - float const & s, - const fmat4x4SIMD &m -) -{ - return detail::fmat4x4SIMD - ( - s / m[0], - s / m[1], - s / m[2], - s / m[3] - ); -} - -GLM_FUNC_QUALIFIER detail::fmat4x4SIMD inverse(detail::fmat4x4SIMD const & m) -{ - detail::fmat4x4SIMD result; - detail::sse_inverse_ps(&m[0].Data, &result[0].Data); - return result; -} - -GLM_FUNC_QUALIFIER fvec4SIMD operator/ -( - const fmat4x4SIMD & m, - fvec4SIMD const & v -) -{ - return inverse(m) * v; -} - -GLM_FUNC_QUALIFIER fvec4SIMD operator/ -( - fvec4SIMD const & v, - const fmat4x4SIMD &m -) -{ - return v * inverse(m); -} - -GLM_FUNC_QUALIFIER fmat4x4SIMD operator/ -( - const fmat4x4SIMD &m1, - const fmat4x4SIMD &m2 -) -{ - __m128 result[4]; - __m128 inv[4]; - - sse_inverse_ps(&m2.Data[0].Data, inv); - sse_mul_ps(&m1.Data[0].Data, inv, result); - - return fmat4x4SIMD(result); -} - - -////////////////////////////////////////////////////////////// -// Unary constant operators -GLM_FUNC_QUALIFIER fmat4x4SIMD const operator- -( - fmat4x4SIMD const & m -) -{ - return detail::fmat4x4SIMD - ( - -m[0], - -m[1], - -m[2], - -m[3] - ); -} - -GLM_FUNC_QUALIFIER fmat4x4SIMD const operator-- -( - fmat4x4SIMD const & m, - int -) -{ - return detail::fmat4x4SIMD - ( - m[0] - 1.0f, - m[1] - 1.0f, - m[2] - 1.0f, - m[3] - 1.0f - ); -} - -GLM_FUNC_QUALIFIER fmat4x4SIMD const operator++ -( - fmat4x4SIMD const & m, - int -) -{ - return detail::fmat4x4SIMD - ( - m[0] + 1.0f, - m[1] + 1.0f, - m[2] + 1.0f, - m[3] + 1.0f - ); -} - -}//namespace detail - -GLM_FUNC_QUALIFIER mat4 mat4_cast -( - detail::fmat4x4SIMD const & x -) -{ - GLM_ALIGN(16) mat4 Result; - _mm_store_ps(&Result[0][0], x.Data[0].Data); - _mm_store_ps(&Result[1][0], x.Data[1].Data); - _mm_store_ps(&Result[2][0], x.Data[2].Data); - _mm_store_ps(&Result[3][0], x.Data[3].Data); - return Result; -} - -GLM_FUNC_QUALIFIER detail::fmat4x4SIMD matrixCompMult -( - detail::fmat4x4SIMD const & x, - detail::fmat4x4SIMD const & y -) -{ - detail::fmat4x4SIMD result; - result[0] = x[0] * y[0]; - result[1] = x[1] * y[1]; - result[2] = x[2] * y[2]; - result[3] = x[3] * y[3]; - return result; -} - -GLM_FUNC_QUALIFIER detail::fmat4x4SIMD outerProduct -( - detail::fvec4SIMD const & c, - detail::fvec4SIMD const & r -) -{ - __m128 Shu0 = _mm_shuffle_ps(r.Data, r.Data, _MM_SHUFFLE(0, 0, 0, 0)); - __m128 Shu1 = _mm_shuffle_ps(r.Data, r.Data, _MM_SHUFFLE(1, 1, 1, 1)); - __m128 Shu2 = _mm_shuffle_ps(r.Data, r.Data, _MM_SHUFFLE(2, 2, 2, 2)); - __m128 Shu3 = _mm_shuffle_ps(r.Data, r.Data, _MM_SHUFFLE(3, 3, 3, 3)); - - detail::fmat4x4SIMD result(uninitialize); - result[0].Data = _mm_mul_ps(c.Data, Shu0); - result[1].Data = _mm_mul_ps(c.Data, Shu1); - result[2].Data = _mm_mul_ps(c.Data, Shu2); - result[3].Data = _mm_mul_ps(c.Data, Shu3); - return result; -} - -GLM_FUNC_QUALIFIER detail::fmat4x4SIMD transpose(detail::fmat4x4SIMD const & m) -{ - detail::fmat4x4SIMD result; - detail::sse_transpose_ps(&m[0].Data, &result[0].Data); - return result; -} - -GLM_FUNC_QUALIFIER float determinant(detail::fmat4x4SIMD const & m) -{ - float Result; - _mm_store_ss(&Result, detail::sse_det_ps(&m[0].Data)); - return Result; -} - -}//namespace glm diff --git a/extensions/common/glm/gtx/simd_quat.hpp b/extensions/common/glm/gtx/simd_quat.hpp deleted file mode 100644 index 2709d2fc05b..00000000000 --- a/extensions/common/glm/gtx/simd_quat.hpp +++ /dev/null @@ -1,335 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_simd_quat -/// @file glm/gtx/simd_quat.hpp -/// @date 2013-04-22 / 2014-11-25 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// -/// @defgroup gtx_simd_quat GLM_GTX_simd_quat -/// @ingroup gtx -/// -/// @brief SIMD implementation of quat type. -/// -/// <glm/gtx/simd_quat.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependency: -#include "../glm.hpp" -#include "../gtc/quaternion.hpp" -#include "../gtx/fast_trigonometry.hpp" - -#if(GLM_ARCH != GLM_ARCH_PURE) - -#if(GLM_ARCH & GLM_ARCH_SSE2) -# include "../gtx/simd_mat4.hpp" -#else -# error "GLM: GLM_GTX_simd_quat requires compiler support of SSE2 through intrinsics" -#endif - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTX_simd_quat extension included") -#endif - -// Warning silencer for nameless struct/union. -#if (GLM_COMPILER & GLM_COMPILER_VC) -# pragma warning(push) -# pragma warning(disable:4201) // warning C4201: nonstandard extension used : nameless struct/union -#endif - -namespace glm{ -namespace detail -{ - GLM_ALIGNED_STRUCT(16) fquatSIMD - { - typedef __m128 value_type; - typedef std::size_t size_type; - static size_type value_size(); - - typedef fquatSIMD type; - typedef tquat<bool, defaultp> bool_type; - -#ifdef GLM_SIMD_ENABLE_XYZW_UNION - union - { - __m128 Data; - struct {float x, y, z, w;}; - }; -#else - __m128 Data; -#endif - - ////////////////////////////////////// - // Implicit basic constructors - - fquatSIMD(); - fquatSIMD(__m128 const & Data); - fquatSIMD(fquatSIMD const & q); - - ////////////////////////////////////// - // Explicit basic constructors - - explicit fquatSIMD( - ctor); - explicit fquatSIMD( - float const & w, - float const & x, - float const & y, - float const & z); - explicit fquatSIMD( - quat const & v); - explicit fquatSIMD( - vec3 const & eulerAngles); - - - ////////////////////////////////////// - // Unary arithmetic operators - - fquatSIMD& operator =(fquatSIMD const & q); - fquatSIMD& operator*=(float const & s); - fquatSIMD& operator/=(float const & s); - }; - - - ////////////////////////////////////// - // Arithmetic operators - - detail::fquatSIMD operator- ( - detail::fquatSIMD const & q); - - detail::fquatSIMD operator+ ( - detail::fquatSIMD const & q, - detail::fquatSIMD const & p); - - detail::fquatSIMD operator* ( - detail::fquatSIMD const & q, - detail::fquatSIMD const & p); - - detail::fvec4SIMD operator* ( - detail::fquatSIMD const & q, - detail::fvec4SIMD const & v); - - detail::fvec4SIMD operator* ( - detail::fvec4SIMD const & v, - detail::fquatSIMD const & q); - - detail::fquatSIMD operator* ( - detail::fquatSIMD const & q, - float s); - - detail::fquatSIMD operator* ( - float s, - detail::fquatSIMD const & q); - - detail::fquatSIMD operator/ ( - detail::fquatSIMD const & q, - float s); - -}//namespace detail - - /// @addtogroup gtx_simd_quat - /// @{ - - typedef glm::detail::fquatSIMD simdQuat; - - //! Convert a simdQuat to a quat. - /// @see gtx_simd_quat - quat quat_cast( - detail::fquatSIMD const & x); - - //! Convert a simdMat4 to a simdQuat. - /// @see gtx_simd_quat - detail::fquatSIMD quatSIMD_cast( - detail::fmat4x4SIMD const & m); - - //! Converts a mat4 to a simdQuat. - /// @see gtx_simd_quat - template <typename T, precision P> - detail::fquatSIMD quatSIMD_cast( - tmat4x4<T, P> const & m); - - //! Converts a mat3 to a simdQuat. - /// @see gtx_simd_quat - template <typename T, precision P> - detail::fquatSIMD quatSIMD_cast( - tmat3x3<T, P> const & m); - - //! Convert a simdQuat to a simdMat4 - /// @see gtx_simd_quat - detail::fmat4x4SIMD mat4SIMD_cast( - detail::fquatSIMD const & q); - - //! Converts a simdQuat to a standard mat4. - /// @see gtx_simd_quat - mat4 mat4_cast( - detail::fquatSIMD const & q); - - - /// Returns the length of the quaternion. - /// - /// @see gtx_simd_quat - float length( - detail::fquatSIMD const & x); - - /// Returns the normalized quaternion. - /// - /// @see gtx_simd_quat - detail::fquatSIMD normalize( - detail::fquatSIMD const & x); - - /// Returns dot product of q1 and q2, i.e., q1[0] * q2[0] + q1[1] * q2[1] + ... - /// - /// @see gtx_simd_quat - float dot( - detail::fquatSIMD const & q1, - detail::fquatSIMD const & q2); - - /// Spherical linear interpolation of two quaternions. - /// The interpolation is oriented and the rotation is performed at constant speed. - /// For short path spherical linear interpolation, use the slerp function. - /// - /// @param x A quaternion - /// @param y A quaternion - /// @param a Interpolation factor. The interpolation is defined beyond the range [0, 1]. - /// @tparam T Value type used to build the quaternion. Supported: half, float or double. - /// @see gtx_simd_quat - /// @see - slerp(detail::fquatSIMD const & x, detail::fquatSIMD const & y, T const & a) - detail::fquatSIMD mix( - detail::fquatSIMD const & x, - detail::fquatSIMD const & y, - float const & a); - - /// Linear interpolation of two quaternions. - /// The interpolation is oriented. - /// - /// @param x A quaternion - /// @param y A quaternion - /// @param a Interpolation factor. The interpolation is defined in the range [0, 1]. - /// @tparam T Value type used to build the quaternion. Supported: half, float or double. - /// @see gtx_simd_quat - detail::fquatSIMD lerp( - detail::fquatSIMD const & x, - detail::fquatSIMD const & y, - float const & a); - - /// Spherical linear interpolation of two quaternions. - /// The interpolation always take the short path and the rotation is performed at constant speed. - /// - /// @param x A quaternion - /// @param y A quaternion - /// @param a Interpolation factor. The interpolation is defined beyond the range [0, 1]. - /// @tparam T Value type used to build the quaternion. Supported: half, float or double. - /// @see gtx_simd_quat - detail::fquatSIMD slerp( - detail::fquatSIMD const & x, - detail::fquatSIMD const & y, - float const & a); - - - /// Faster spherical linear interpolation of two unit length quaternions. - /// - /// This is the same as mix(), except for two rules: - /// 1) The two quaternions must be unit length. - /// 2) The interpolation factor (a) must be in the range [0, 1]. - /// - /// This will use the equivalent to fastAcos() and fastSin(). - /// - /// @see gtx_simd_quat - /// @see - mix(detail::fquatSIMD const & x, detail::fquatSIMD const & y, T const & a) - detail::fquatSIMD fastMix( - detail::fquatSIMD const & x, - detail::fquatSIMD const & y, - float const & a); - - /// Identical to fastMix() except takes the shortest path. - /// - /// The same rules apply here as those in fastMix(). Both quaternions must be unit length and 'a' must be - /// in the range [0, 1]. - /// - /// @see - fastMix(detail::fquatSIMD const & x, detail::fquatSIMD const & y, T const & a) - /// @see - slerp(detail::fquatSIMD const & x, detail::fquatSIMD const & y, T const & a) - detail::fquatSIMD fastSlerp( - detail::fquatSIMD const & x, - detail::fquatSIMD const & y, - float const & a); - - - /// Returns the q conjugate. - /// - /// @see gtx_simd_quat - detail::fquatSIMD conjugate( - detail::fquatSIMD const & q); - - /// Returns the q inverse. - /// - /// @see gtx_simd_quat - detail::fquatSIMD inverse( - detail::fquatSIMD const & q); - - /// Build a quaternion from an angle and a normalized axis. - /// - /// @param angle Angle expressed in radians. - /// @param axis Axis of the quaternion, must be normalized. - /// - /// @see gtx_simd_quat - detail::fquatSIMD angleAxisSIMD( - float const & angle, - vec3 const & axis); - - /// Build a quaternion from an angle and a normalized axis. - /// - /// @param angle Angle expressed in radians. - /// @param x x component of the x-axis, x, y, z must be a normalized axis - /// @param y y component of the y-axis, x, y, z must be a normalized axis - /// @param z z component of the z-axis, x, y, z must be a normalized axis - /// - /// @see gtx_simd_quat - detail::fquatSIMD angleAxisSIMD( - float const & angle, - float const & x, - float const & y, - float const & z); - - // TODO: Move this to somewhere more appropriate. Used with fastMix() and fastSlerp(). - /// Performs the equivalent of glm::fastSin() on each component of the given __m128. - __m128 fastSin(__m128 x); - - /// @} -}//namespace glm - -#include "simd_quat.inl" - - -#if (GLM_COMPILER & GLM_COMPILER_VC) -# pragma warning(pop) -#endif - - -#endif//(GLM_ARCH != GLM_ARCH_PURE) diff --git a/extensions/common/glm/gtx/simd_quat.inl b/extensions/common/glm/gtx/simd_quat.inl deleted file mode 100644 index f9dd4c0037c..00000000000 --- a/extensions/common/glm/gtx/simd_quat.inl +++ /dev/null @@ -1,645 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_simd_quat -/// @file glm/gtx/simd_quat.inl -/// @date 2013-04-22 / 2014-11-25 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -namespace glm{ -namespace detail{ - - -////////////////////////////////////// -// Debugging -#if 0 -void print(__m128 v) -{ - GLM_ALIGN(16) float result[4]; - _mm_store_ps(result, v); - - printf("__m128: %f %f %f %f\n", result[0], result[1], result[2], result[3]); -} - -void print(const fvec4SIMD &v) -{ - printf("fvec4SIMD: %f %f %f %f\n", v.x, v.y, v.z, v.w); -} -#endif - - -////////////////////////////////////// -// Implicit basic constructors - -GLM_FUNC_QUALIFIER fquatSIMD::fquatSIMD() -# ifdef GLM_FORCE_NO_CTOR_INIT - : Data(_mm_set_ps(1.0f, 0.0f, 0.0f, 0.0f)) -# endif -{} - -GLM_FUNC_QUALIFIER fquatSIMD::fquatSIMD(__m128 const & Data) : - Data(Data) -{} - -GLM_FUNC_QUALIFIER fquatSIMD::fquatSIMD(fquatSIMD const & q) : - Data(q.Data) -{} - - -////////////////////////////////////// -// Explicit basic constructors - -GLM_FUNC_QUALIFIER fquatSIMD::fquatSIMD(float const & w, float const & x, float const & y, float const & z) : - Data(_mm_set_ps(w, z, y, x)) -{} - -GLM_FUNC_QUALIFIER fquatSIMD::fquatSIMD(quat const & q) : - Data(_mm_set_ps(q.w, q.z, q.y, q.x)) -{} - -GLM_FUNC_QUALIFIER fquatSIMD::fquatSIMD(vec3 const & eulerAngles) -{ - vec3 c = glm::cos(eulerAngles * 0.5f); - vec3 s = glm::sin(eulerAngles * 0.5f); - - Data = _mm_set_ps( - (c.x * c.y * c.z) + (s.x * s.y * s.z), - (c.x * c.y * s.z) - (s.x * s.y * c.z), - (c.x * s.y * c.z) + (s.x * c.y * s.z), - (s.x * c.y * c.z) - (c.x * s.y * s.z)); -} - - -////////////////////////////////////// -// Unary arithmetic operators - -GLM_FUNC_QUALIFIER fquatSIMD& fquatSIMD::operator=(fquatSIMD const & q) -{ - this->Data = q.Data; - return *this; -} - -GLM_FUNC_QUALIFIER fquatSIMD& fquatSIMD::operator*=(float const & s) -{ - this->Data = _mm_mul_ps(this->Data, _mm_set_ps1(s)); - return *this; -} - -GLM_FUNC_QUALIFIER fquatSIMD& fquatSIMD::operator/=(float const & s) -{ - this->Data = _mm_div_ps(Data, _mm_set1_ps(s)); - return *this; -} - - - -// negate operator -GLM_FUNC_QUALIFIER fquatSIMD operator- (fquatSIMD const & q) -{ - return fquatSIMD(_mm_mul_ps(q.Data, _mm_set_ps(-1.0f, -1.0f, -1.0f, -1.0f))); -} - -// operator+ -GLM_FUNC_QUALIFIER fquatSIMD operator+ (fquatSIMD const & q1, fquatSIMD const & q2) -{ - return fquatSIMD(_mm_add_ps(q1.Data, q2.Data)); -} - -//operator* -GLM_FUNC_QUALIFIER fquatSIMD operator* (fquatSIMD const & q1, fquatSIMD const & q2) -{ - // SSE2 STATS: - // 11 shuffle - // 8 mul - // 8 add - - // SSE4 STATS: - // 3 shuffle - // 4 mul - // 4 dpps - - __m128 mul0 = _mm_mul_ps(q1.Data, _mm_shuffle_ps(q2.Data, q2.Data, _MM_SHUFFLE(0, 1, 2, 3))); - __m128 mul1 = _mm_mul_ps(q1.Data, _mm_shuffle_ps(q2.Data, q2.Data, _MM_SHUFFLE(1, 0, 3, 2))); - __m128 mul2 = _mm_mul_ps(q1.Data, _mm_shuffle_ps(q2.Data, q2.Data, _MM_SHUFFLE(2, 3, 0, 1))); - __m128 mul3 = _mm_mul_ps(q1.Data, q2.Data); - -# if((GLM_ARCH & GLM_ARCH_SSE4)) - __m128 add0 = _mm_dp_ps(mul0, _mm_set_ps(1.0f, -1.0f, 1.0f, 1.0f), 0xff); - __m128 add1 = _mm_dp_ps(mul1, _mm_set_ps(1.0f, 1.0f, 1.0f, -1.0f), 0xff); - __m128 add2 = _mm_dp_ps(mul2, _mm_set_ps(1.0f, 1.0f, -1.0f, 1.0f), 0xff); - __m128 add3 = _mm_dp_ps(mul3, _mm_set_ps(1.0f, -1.0f, -1.0f, -1.0f), 0xff); -# else - mul0 = _mm_mul_ps(mul0, _mm_set_ps(1.0f, -1.0f, 1.0f, 1.0f)); - __m128 add0 = _mm_add_ps(mul0, _mm_movehl_ps(mul0, mul0)); - add0 = _mm_add_ss(add0, _mm_shuffle_ps(add0, add0, 1)); - - mul1 = _mm_mul_ps(mul1, _mm_set_ps(1.0f, 1.0f, 1.0f, -1.0f)); - __m128 add1 = _mm_add_ps(mul1, _mm_movehl_ps(mul1, mul1)); - add1 = _mm_add_ss(add1, _mm_shuffle_ps(add1, add1, 1)); - - mul2 = _mm_mul_ps(mul2, _mm_set_ps(1.0f, 1.0f, -1.0f, 1.0f)); - __m128 add2 = _mm_add_ps(mul2, _mm_movehl_ps(mul2, mul2)); - add2 = _mm_add_ss(add2, _mm_shuffle_ps(add2, add2, 1)); - - mul3 = _mm_mul_ps(mul3, _mm_set_ps(1.0f, -1.0f, -1.0f, -1.0f)); - __m128 add3 = _mm_add_ps(mul3, _mm_movehl_ps(mul3, mul3)); - add3 = _mm_add_ss(add3, _mm_shuffle_ps(add3, add3, 1)); -#endif - - - // This SIMD code is a politically correct way of doing this, but in every test I've tried it has been slower than - // the final code below. I'll keep this here for reference - maybe somebody else can do something better... - // - //__m128 xxyy = _mm_shuffle_ps(add0, add1, _MM_SHUFFLE(0, 0, 0, 0)); - //__m128 zzww = _mm_shuffle_ps(add2, add3, _MM_SHUFFLE(0, 0, 0, 0)); - // - //return _mm_shuffle_ps(xxyy, zzww, _MM_SHUFFLE(2, 0, 2, 0)); - - float x; - float y; - float z; - float w; - - _mm_store_ss(&x, add0); - _mm_store_ss(&y, add1); - _mm_store_ss(&z, add2); - _mm_store_ss(&w, add3); - - return detail::fquatSIMD(w, x, y, z); -} - -GLM_FUNC_QUALIFIER fvec4SIMD operator* (fquatSIMD const & q, fvec4SIMD const & v) -{ - static const __m128 two = _mm_set1_ps(2.0f); - - __m128 q_wwww = _mm_shuffle_ps(q.Data, q.Data, _MM_SHUFFLE(3, 3, 3, 3)); - __m128 q_swp0 = _mm_shuffle_ps(q.Data, q.Data, _MM_SHUFFLE(3, 0, 2, 1)); - __m128 q_swp1 = _mm_shuffle_ps(q.Data, q.Data, _MM_SHUFFLE(3, 1, 0, 2)); - __m128 v_swp0 = _mm_shuffle_ps(v.Data, v.Data, _MM_SHUFFLE(3, 0, 2, 1)); - __m128 v_swp1 = _mm_shuffle_ps(v.Data, v.Data, _MM_SHUFFLE(3, 1, 0, 2)); - - __m128 uv = _mm_sub_ps(_mm_mul_ps(q_swp0, v_swp1), _mm_mul_ps(q_swp1, v_swp0)); - __m128 uv_swp0 = _mm_shuffle_ps(uv, uv, _MM_SHUFFLE(3, 0, 2, 1)); - __m128 uv_swp1 = _mm_shuffle_ps(uv, uv, _MM_SHUFFLE(3, 1, 0, 2)); - __m128 uuv = _mm_sub_ps(_mm_mul_ps(q_swp0, uv_swp1), _mm_mul_ps(q_swp1, uv_swp0)); - - - uv = _mm_mul_ps(uv, _mm_mul_ps(q_wwww, two)); - uuv = _mm_mul_ps(uuv, two); - - return _mm_add_ps(v.Data, _mm_add_ps(uv, uuv)); -} - -GLM_FUNC_QUALIFIER fvec4SIMD operator* (fvec4SIMD const & v, fquatSIMD const & q) -{ - return glm::inverse(q) * v; -} - -GLM_FUNC_QUALIFIER fquatSIMD operator* (fquatSIMD const & q, float s) -{ - return fquatSIMD(_mm_mul_ps(q.Data, _mm_set1_ps(s))); -} - -GLM_FUNC_QUALIFIER fquatSIMD operator* (float s, fquatSIMD const & q) -{ - return fquatSIMD(_mm_mul_ps(_mm_set1_ps(s), q.Data)); -} - - -//operator/ -GLM_FUNC_QUALIFIER fquatSIMD operator/ (fquatSIMD const & q, float s) -{ - return fquatSIMD(_mm_div_ps(q.Data, _mm_set1_ps(s))); -} - - -}//namespace detail - - -GLM_FUNC_QUALIFIER quat quat_cast -( - detail::fquatSIMD const & x -) -{ - GLM_ALIGN(16) quat Result; - _mm_store_ps(&Result[0], x.Data); - - return Result; -} - -template <typename T> -GLM_FUNC_QUALIFIER detail::fquatSIMD quatSIMD_cast_impl(const T m0[], const T m1[], const T m2[]) -{ - T trace = m0[0] + m1[1] + m2[2] + T(1.0); - if (trace > T(0)) - { - T s = static_cast<T>(0.5) / sqrt(trace); - - return _mm_set_ps( - static_cast<float>(T(0.25) / s), - static_cast<float>((m0[1] - m1[0]) * s), - static_cast<float>((m2[0] - m0[2]) * s), - static_cast<float>((m1[2] - m2[1]) * s)); - } - else - { - if (m0[0] > m1[1]) - { - if (m0[0] > m2[2]) - { - // X is biggest. - T s = sqrt(m0[0] - m1[1] - m2[2] + T(1.0)) * T(0.5); - - return _mm_set_ps( - static_cast<float>((m1[2] - m2[1]) * s), - static_cast<float>((m2[0] + m0[2]) * s), - static_cast<float>((m0[1] + m1[0]) * s), - static_cast<float>(T(0.5) * s)); - } - } - else - { - if (m1[1] > m2[2]) - { - // Y is biggest. - T s = sqrt(m1[1] - m0[0] - m2[2] + T(1.0)) * T(0.5); - - return _mm_set_ps( - static_cast<float>((m2[0] - m0[2]) * s), - static_cast<float>((m1[2] + m2[1]) * s), - static_cast<float>(T(0.5) * s), - static_cast<float>((m0[1] + m1[0]) * s)); - } - } - - // Z is biggest. - T s = sqrt(m2[2] - m0[0] - m1[1] + T(1.0)) * T(0.5); - - return _mm_set_ps( - static_cast<float>((m0[1] - m1[0]) * s), - static_cast<float>(T(0.5) * s), - static_cast<float>((m1[2] + m2[1]) * s), - static_cast<float>((m2[0] + m0[2]) * s)); - } -} - -GLM_FUNC_QUALIFIER detail::fquatSIMD quatSIMD_cast -( - detail::fmat4x4SIMD const & m -) -{ - // Scalar implementation for now. - GLM_ALIGN(16) float m0[4]; - GLM_ALIGN(16) float m1[4]; - GLM_ALIGN(16) float m2[4]; - - _mm_store_ps(m0, m[0].Data); - _mm_store_ps(m1, m[1].Data); - _mm_store_ps(m2, m[2].Data); - - return quatSIMD_cast_impl(m0, m1, m2); -} - -template <typename T, precision P> -GLM_FUNC_QUALIFIER detail::fquatSIMD quatSIMD_cast -( - tmat4x4<T, P> const & m -) -{ - return quatSIMD_cast_impl(&m[0][0], &m[1][0], &m[2][0]); -} - -template <typename T, precision P> -GLM_FUNC_QUALIFIER detail::fquatSIMD quatSIMD_cast -( - tmat3x3<T, P> const & m -) -{ - return quatSIMD_cast_impl(&m[0][0], &m[1][0], &m[2][0]); -} - - -GLM_FUNC_QUALIFIER detail::fmat4x4SIMD mat4SIMD_cast -( - detail::fquatSIMD const & q -) -{ - detail::fmat4x4SIMD result; - - __m128 _wwww = _mm_shuffle_ps(q.Data, q.Data, _MM_SHUFFLE(3, 3, 3, 3)); - __m128 _xyzw = q.Data; - __m128 _zxyw = _mm_shuffle_ps(q.Data, q.Data, _MM_SHUFFLE(3, 1, 0, 2)); - __m128 _yzxw = _mm_shuffle_ps(q.Data, q.Data, _MM_SHUFFLE(3, 0, 2, 1)); - - __m128 _xyzw2 = _mm_add_ps(_xyzw, _xyzw); - __m128 _zxyw2 = _mm_shuffle_ps(_xyzw2, _xyzw2, _MM_SHUFFLE(3, 1, 0, 2)); - __m128 _yzxw2 = _mm_shuffle_ps(_xyzw2, _xyzw2, _MM_SHUFFLE(3, 0, 2, 1)); - - __m128 _tmp0 = _mm_sub_ps(_mm_set1_ps(1.0f), _mm_mul_ps(_yzxw2, _yzxw)); - _tmp0 = _mm_sub_ps(_tmp0, _mm_mul_ps(_zxyw2, _zxyw)); - - __m128 _tmp1 = _mm_mul_ps(_yzxw2, _xyzw); - _tmp1 = _mm_add_ps(_tmp1, _mm_mul_ps(_zxyw2, _wwww)); - - __m128 _tmp2 = _mm_mul_ps(_zxyw2, _xyzw); - _tmp2 = _mm_sub_ps(_tmp2, _mm_mul_ps(_yzxw2, _wwww)); - - - // There's probably a better, more politically correct way of doing this... - result[0].Data = _mm_set_ps( - 0.0f, - reinterpret_cast<float*>(&_tmp2)[0], - reinterpret_cast<float*>(&_tmp1)[0], - reinterpret_cast<float*>(&_tmp0)[0]); - - result[1].Data = _mm_set_ps( - 0.0f, - reinterpret_cast<float*>(&_tmp1)[1], - reinterpret_cast<float*>(&_tmp0)[1], - reinterpret_cast<float*>(&_tmp2)[1]); - - result[2].Data = _mm_set_ps( - 0.0f, - reinterpret_cast<float*>(&_tmp0)[2], - reinterpret_cast<float*>(&_tmp2)[2], - reinterpret_cast<float*>(&_tmp1)[2]); - - result[3].Data = _mm_set_ps( - 1.0f, - 0.0f, - 0.0f, - 0.0f); - - - return result; -} - -GLM_FUNC_QUALIFIER mat4 mat4_cast -( - detail::fquatSIMD const & q -) -{ - return mat4_cast(mat4SIMD_cast(q)); -} - - - -GLM_FUNC_QUALIFIER float length -( - detail::fquatSIMD const & q -) -{ - return glm::sqrt(dot(q, q)); -} - -GLM_FUNC_QUALIFIER detail::fquatSIMD normalize -( - detail::fquatSIMD const & q -) -{ - return _mm_mul_ps(q.Data, _mm_set1_ps(1.0f / length(q))); -} - -GLM_FUNC_QUALIFIER float dot -( - detail::fquatSIMD const & q1, - detail::fquatSIMD const & q2 -) -{ - float result; - _mm_store_ss(&result, detail::sse_dot_ps(q1.Data, q2.Data)); - - return result; -} - -GLM_FUNC_QUALIFIER detail::fquatSIMD mix -( - detail::fquatSIMD const & x, - detail::fquatSIMD const & y, - float const & a -) -{ - float cosTheta = dot(x, y); - - if (cosTheta > 1.0f - glm::epsilon<float>()) - { - return _mm_add_ps(x.Data, _mm_mul_ps(_mm_set1_ps(a), _mm_sub_ps(y.Data, x.Data))); - } - else - { - float angle = glm::acos(cosTheta); - - - float s0 = glm::sin((1.0f - a) * angle); - float s1 = glm::sin(a * angle); - float d = 1.0f / glm::sin(angle); - - return (s0 * x + s1 * y) * d; - } -} - -GLM_FUNC_QUALIFIER detail::fquatSIMD lerp -( - detail::fquatSIMD const & x, - detail::fquatSIMD const & y, - float const & a -) -{ - // Lerp is only defined in [0, 1] - assert(a >= 0.0f); - assert(a <= 1.0f); - - return _mm_add_ps(x.Data, _mm_mul_ps(_mm_set1_ps(a), _mm_sub_ps(y.Data, x.Data))); -} - -GLM_FUNC_QUALIFIER detail::fquatSIMD slerp -( - detail::fquatSIMD const & x, - detail::fquatSIMD const & y, - float const & a -) -{ - detail::fquatSIMD z = y; - - float cosTheta = dot(x, y); - - // If cosTheta < 0, the interpolation will take the long way around the sphere. - // To fix this, one quat must be negated. - if (cosTheta < 0.0f) - { - z = -y; - cosTheta = -cosTheta; - } - - // Perform a linear interpolation when cosTheta is close to 1 to avoid side effect of sin(angle) becoming a zero denominator - if(cosTheta > 1.0f - epsilon<float>()) - { - return _mm_add_ps(x.Data, _mm_mul_ps(_mm_set1_ps(a), _mm_sub_ps(y.Data, x.Data))); - } - else - { - float angle = glm::acos(cosTheta); - - - float s0 = glm::sin((1.0f - a) * angle); - float s1 = glm::sin(a * angle); - float d = 1.0f / glm::sin(angle); - - return (s0 * x + s1 * y) * d; - } -} - - -GLM_FUNC_QUALIFIER detail::fquatSIMD fastMix -( - detail::fquatSIMD const & x, - detail::fquatSIMD const & y, - float const & a -) -{ - float cosTheta = dot(x, y); - - if (cosTheta > 1.0f - glm::epsilon<float>()) - { - return _mm_add_ps(x.Data, _mm_mul_ps(_mm_set1_ps(a), _mm_sub_ps(y.Data, x.Data))); - } - else - { - float angle = glm::fastAcos(cosTheta); - - - __m128 s = glm::fastSin(_mm_set_ps((1.0f - a) * angle, a * angle, angle, 0.0f)); - - __m128 s0 = _mm_shuffle_ps(s, s, _MM_SHUFFLE(3, 3, 3, 3)); - __m128 s1 = _mm_shuffle_ps(s, s, _MM_SHUFFLE(2, 2, 2, 2)); - __m128 d = _mm_div_ps(_mm_set1_ps(1.0f), _mm_shuffle_ps(s, s, _MM_SHUFFLE(1, 1, 1, 1))); - - return _mm_mul_ps(_mm_add_ps(_mm_mul_ps(s0, x.Data), _mm_mul_ps(s1, y.Data)), d); - } -} - -GLM_FUNC_QUALIFIER detail::fquatSIMD fastSlerp -( - detail::fquatSIMD const & x, - detail::fquatSIMD const & y, - float const & a -) -{ - detail::fquatSIMD z = y; - - float cosTheta = dot(x, y); - if (cosTheta < 0.0f) - { - z = -y; - cosTheta = -cosTheta; - } - - - if(cosTheta > 1.0f - epsilon<float>()) - { - return _mm_add_ps(x.Data, _mm_mul_ps(_mm_set1_ps(a), _mm_sub_ps(y.Data, x.Data))); - } - else - { - float angle = glm::fastAcos(cosTheta); - - - __m128 s = glm::fastSin(_mm_set_ps((1.0f - a) * angle, a * angle, angle, 0.0f)); - - __m128 s0 = _mm_shuffle_ps(s, s, _MM_SHUFFLE(3, 3, 3, 3)); - __m128 s1 = _mm_shuffle_ps(s, s, _MM_SHUFFLE(2, 2, 2, 2)); - __m128 d = _mm_div_ps(_mm_set1_ps(1.0f), _mm_shuffle_ps(s, s, _MM_SHUFFLE(1, 1, 1, 1))); - - return _mm_mul_ps(_mm_add_ps(_mm_mul_ps(s0, x.Data), _mm_mul_ps(s1, y.Data)), d); - } -} - - - -GLM_FUNC_QUALIFIER detail::fquatSIMD conjugate -( - detail::fquatSIMD const & q -) -{ - return detail::fquatSIMD(_mm_mul_ps(q.Data, _mm_set_ps(1.0f, -1.0f, -1.0f, -1.0f))); -} - -GLM_FUNC_QUALIFIER detail::fquatSIMD inverse -( - detail::fquatSIMD const & q -) -{ - return conjugate(q) / dot(q, q); -} - - -GLM_FUNC_QUALIFIER detail::fquatSIMD angleAxisSIMD -( - float const & angle, - vec3 const & v -) -{ - float s = glm::sin(angle * 0.5f); - - return _mm_set_ps( - glm::cos(angle * 0.5f), - v.z * s, - v.y * s, - v.x * s); -} - -GLM_FUNC_QUALIFIER detail::fquatSIMD angleAxisSIMD -( - float const & angle, - float const & x, - float const & y, - float const & z -) -{ - return angleAxisSIMD(angle, vec3(x, y, z)); -} - - -GLM_FUNC_QUALIFIER __m128 fastSin(__m128 x) -{ - static const __m128 c0 = _mm_set1_ps(0.16666666666666666666666666666667f); - static const __m128 c1 = _mm_set1_ps(0.00833333333333333333333333333333f); - static const __m128 c2 = _mm_set1_ps(0.00019841269841269841269841269841f); - - __m128 x3 = _mm_mul_ps(x, _mm_mul_ps(x, x)); - __m128 x5 = _mm_mul_ps(x3, _mm_mul_ps(x, x)); - __m128 x7 = _mm_mul_ps(x5, _mm_mul_ps(x, x)); - - __m128 y0 = _mm_mul_ps(x3, c0); - __m128 y1 = _mm_mul_ps(x5, c1); - __m128 y2 = _mm_mul_ps(x7, c2); - - return _mm_sub_ps(_mm_add_ps(_mm_sub_ps(x, y0), y1), y2); -} - - -}//namespace glm diff --git a/extensions/common/glm/gtx/simd_vec4.hpp b/extensions/common/glm/gtx/simd_vec4.hpp deleted file mode 100644 index 8b75deb6c70..00000000000 --- a/extensions/common/glm/gtx/simd_vec4.hpp +++ /dev/null @@ -1,574 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_simd_vec4 -/// @file glm/gtx/simd_vec4.hpp -/// @date 2009-05-07 / 2011-06-07 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// -/// @defgroup gtx_simd_vec4 GLM_GTX_simd_vec4 -/// @ingroup gtx -/// -/// @brief SIMD implementation of vec4 type. -/// -/// <glm/gtx/simd_vec4.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependency: -#include "../glm.hpp" - -#if(GLM_ARCH != GLM_ARCH_PURE) - -#if(GLM_ARCH & GLM_ARCH_SSE2) -# include "../detail/intrinsic_common.hpp" -# include "../detail/intrinsic_geometric.hpp" -# include "../detail/intrinsic_integer.hpp" -#else -# error "GLM: GLM_GTX_simd_vec4 requires compiler support of SSE2 through intrinsics" -#endif - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTX_simd_vec4 extension included") -#endif - - -// Warning silencer for nameless struct/union. -#if (GLM_COMPILER & GLM_COMPILER_VC) -# pragma warning(push) -# pragma warning(disable:4201) // warning C4201: nonstandard extension used : nameless struct/union -#endif - -namespace glm -{ - enum comp - { - X = 0, - R = 0, - S = 0, - Y = 1, - G = 1, - T = 1, - Z = 2, - B = 2, - P = 2, - W = 3, - A = 3, - Q = 3 - }; - -}//namespace glm - -namespace glm{ -namespace detail -{ - /// 4-dimensional vector implemented using SIMD SEE intrinsics. - /// \ingroup gtx_simd_vec4 - GLM_ALIGNED_STRUCT(16) fvec4SIMD - { - typedef __m128 value_type; - typedef std::size_t size_type; - static size_type value_size(); - - typedef fvec4SIMD type; - typedef tvec4<bool, highp> bool_type; - -#ifdef GLM_SIMD_ENABLE_XYZW_UNION - union - { - __m128 Data; - struct {float x, y, z, w;}; - }; -#else - __m128 Data; -#endif - - ////////////////////////////////////// - // Implicit basic constructors - - fvec4SIMD(); - fvec4SIMD(__m128 const & Data); - fvec4SIMD(fvec4SIMD const & v); - - ////////////////////////////////////// - // Explicit basic constructors - - explicit fvec4SIMD( - ctor); - explicit fvec4SIMD( - float const & s); - explicit fvec4SIMD( - float const & x, - float const & y, - float const & z, - float const & w); - explicit fvec4SIMD( - vec4 const & v); - - //////////////////////////////////////// - //// Conversion vector constructors - - fvec4SIMD(vec2 const & v, float const & s1, float const & s2); - fvec4SIMD(float const & s1, vec2 const & v, float const & s2); - fvec4SIMD(float const & s1, float const & s2, vec2 const & v); - fvec4SIMD(vec3 const & v, float const & s); - fvec4SIMD(float const & s, vec3 const & v); - fvec4SIMD(vec2 const & v1, vec2 const & v2); - //fvec4SIMD(ivec4SIMD const & v); - - ////////////////////////////////////// - // Unary arithmetic operators - - fvec4SIMD& operator= (fvec4SIMD const & v); - fvec4SIMD& operator+=(fvec4SIMD const & v); - fvec4SIMD& operator-=(fvec4SIMD const & v); - fvec4SIMD& operator*=(fvec4SIMD const & v); - fvec4SIMD& operator/=(fvec4SIMD const & v); - - fvec4SIMD& operator+=(float const & s); - fvec4SIMD& operator-=(float const & s); - fvec4SIMD& operator*=(float const & s); - fvec4SIMD& operator/=(float const & s); - - fvec4SIMD& operator++(); - fvec4SIMD& operator--(); - - ////////////////////////////////////// - // Swizzle operators - - template <comp X, comp Y, comp Z, comp W> - fvec4SIMD& swizzle(); - template <comp X, comp Y, comp Z, comp W> - fvec4SIMD swizzle() const; - template <comp X, comp Y, comp Z> - fvec4SIMD swizzle() const; - template <comp X, comp Y> - fvec4SIMD swizzle() const; - template <comp X> - fvec4SIMD swizzle() const; - }; -}//namespace detail - - typedef glm::detail::fvec4SIMD simdVec4; - - /// @addtogroup gtx_simd_vec4 - /// @{ - - //! Convert a simdVec4 to a vec4. - /// @see gtx_simd_vec4 - vec4 vec4_cast( - detail::fvec4SIMD const & x); - - //! Returns x if x >= 0; otherwise, it returns -x. - /// @see gtx_simd_vec4 - detail::fvec4SIMD abs(detail::fvec4SIMD const & x); - - //! Returns 1.0 if x > 0, 0.0 if x = 0, or -1.0 if x < 0. - /// @see gtx_simd_vec4 - detail::fvec4SIMD sign(detail::fvec4SIMD const & x); - - //! Returns a value equal to the nearest integer that is less then or equal to x. - /// @see gtx_simd_vec4 - detail::fvec4SIMD floor(detail::fvec4SIMD const & x); - - //! Returns a value equal to the nearest integer to x - //! whose absolute value is not larger than the absolute value of x. - /// @see gtx_simd_vec4 - detail::fvec4SIMD trunc(detail::fvec4SIMD const & x); - - //! Returns a value equal to the nearest integer to x. - //! The fraction 0.5 will round in a direction chosen by the - //! implementation, presumably the direction that is fastest. - //! This includes the possibility that round(x) returns the - //! same value as roundEven(x) for all values of x. - /// - /// @see gtx_simd_vec4 - detail::fvec4SIMD round(detail::fvec4SIMD const & x); - - //! Returns a value equal to the nearest integer to x. - //! A fractional part of 0.5 will round toward the nearest even - //! integer. (Both 3.5 and 4.5 for x will return 4.0.) - /// - /// @see gtx_simd_vec4 - //detail::fvec4SIMD roundEven(detail::fvec4SIMD const & x); - - //! Returns a value equal to the nearest integer - //! that is greater than or equal to x. - /// @see gtx_simd_vec4 - detail::fvec4SIMD ceil(detail::fvec4SIMD const & x); - - //! Return x - floor(x). - /// - /// @see gtx_simd_vec4 - detail::fvec4SIMD fract(detail::fvec4SIMD const & x); - - //! Modulus. Returns x - y * floor(x / y) - //! for each component in x using the floating point value y. - /// - /// @see gtx_simd_vec4 - detail::fvec4SIMD mod( - detail::fvec4SIMD const & x, - detail::fvec4SIMD const & y); - - //! Modulus. Returns x - y * floor(x / y) - //! for each component in x using the floating point value y. - /// - /// @see gtx_simd_vec4 - detail::fvec4SIMD mod( - detail::fvec4SIMD const & x, - float const & y); - - //! Returns the fractional part of x and sets i to the integer - //! part (as a whole number floating point value). Both the - //! return value and the output parameter will have the same - //! sign as x. - //! (From GLM_GTX_simd_vec4 extension, common function) - //detail::fvec4SIMD modf( - // detail::fvec4SIMD const & x, - // detail::fvec4SIMD & i); - - //! Returns y if y < x; otherwise, it returns x. - /// - /// @see gtx_simd_vec4 - detail::fvec4SIMD min( - detail::fvec4SIMD const & x, - detail::fvec4SIMD const & y); - - detail::fvec4SIMD min( - detail::fvec4SIMD const & x, - float const & y); - - //! Returns y if x < y; otherwise, it returns x. - /// - /// @see gtx_simd_vec4 - detail::fvec4SIMD max( - detail::fvec4SIMD const & x, - detail::fvec4SIMD const & y); - - detail::fvec4SIMD max( - detail::fvec4SIMD const & x, - float const & y); - - //! Returns min(max(x, minVal), maxVal) for each component in x - //! using the floating-point values minVal and maxVal. - /// - /// @see gtx_simd_vec4 - detail::fvec4SIMD clamp( - detail::fvec4SIMD const & x, - detail::fvec4SIMD const & minVal, - detail::fvec4SIMD const & maxVal); - - detail::fvec4SIMD clamp( - detail::fvec4SIMD const & x, - float const & minVal, - float const & maxVal); - - //! \return If genTypeU is a floating scalar or vector: - //! Returns x * (1.0 - a) + y * a, i.e., the linear blend of - //! x and y using the floating-point value a. - //! The value for a is not restricted to the range [0, 1]. - //! - //! \return If genTypeU is a boolean scalar or vector: - //! Selects which vector each returned component comes - //! from. For a component of a that is false, the - //! corresponding component of x is returned. For a - //! component of a that is true, the corresponding - //! component of y is returned. Components of x and y that - //! are not selected are allowed to be invalid floating point - //! values and will have no effect on the results. Thus, this - //! provides different functionality than - //! genType mix(genType x, genType y, genType(a)) - //! where a is a Boolean vector. - //! - //! From GLSL 1.30.08 specification, section 8.3 - //! - //! \param[in] x Floating point scalar or vector. - //! \param[in] y Floating point scalar or vector. - //! \param[in] a Floating point or boolean scalar or vector. - //! - /// \todo Test when 'a' is a boolean. - /// - /// @see gtx_simd_vec4 - detail::fvec4SIMD mix( - detail::fvec4SIMD const & x, - detail::fvec4SIMD const & y, - detail::fvec4SIMD const & a); - - //! Returns 0.0 if x < edge, otherwise it returns 1.0. - /// - /// @see gtx_simd_vec4 - detail::fvec4SIMD step( - detail::fvec4SIMD const & edge, - detail::fvec4SIMD const & x); - - detail::fvec4SIMD step( - float const & edge, - detail::fvec4SIMD const & x); - - //! Returns 0.0 if x <= edge0 and 1.0 if x >= edge1 and - //! performs smooth Hermite interpolation between 0 and 1 - //! when edge0 < x < edge1. This is useful in cases where - //! you would want a threshold function with a smooth - //! transition. This is equivalent to: - //! genType t; - //! t = clamp ((x - edge0) / (edge1 - edge0), 0, 1); - //! return t * t * (3 - 2 * t); - //! Results are undefined if edge0 >= edge1. - /// - /// @see gtx_simd_vec4 - detail::fvec4SIMD smoothstep( - detail::fvec4SIMD const & edge0, - detail::fvec4SIMD const & edge1, - detail::fvec4SIMD const & x); - - detail::fvec4SIMD smoothstep( - float const & edge0, - float const & edge1, - detail::fvec4SIMD const & x); - - //! Returns true if x holds a NaN (not a number) - //! representation in the underlying implementation's set of - //! floating point representations. Returns false otherwise, - //! including for implementations with no NaN - //! representations. - /// - /// @see gtx_simd_vec4 - //bvec4 isnan(detail::fvec4SIMD const & x); - - //! Returns true if x holds a positive infinity or negative - //! infinity representation in the underlying implementation's - //! set of floating point representations. Returns false - //! otherwise, including for implementations with no infinity - //! representations. - /// - /// @see gtx_simd_vec4 - //bvec4 isinf(detail::fvec4SIMD const & x); - - //! Returns a signed or unsigned integer value representing - //! the encoding of a floating-point value. The floatingpoint - //! value's bit-level representation is preserved. - /// - /// @see gtx_simd_vec4 - //detail::ivec4SIMD floatBitsToInt(detail::fvec4SIMD const & value); - - //! Returns a floating-point value corresponding to a signed - //! or unsigned integer encoding of a floating-point value. - //! If an inf or NaN is passed in, it will not signal, and the - //! resulting floating point value is unspecified. Otherwise, - //! the bit-level representation is preserved. - /// - /// @see gtx_simd_vec4 - //detail::fvec4SIMD intBitsToFloat(detail::ivec4SIMD const & value); - - //! Computes and returns a * b + c. - /// - /// @see gtx_simd_vec4 - detail::fvec4SIMD fma( - detail::fvec4SIMD const & a, - detail::fvec4SIMD const & b, - detail::fvec4SIMD const & c); - - //! Splits x into a floating-point significand in the range - //! [0.5, 1.0) and an integral exponent of two, such that: - //! x = significand * exp(2, exponent) - //! The significand is returned by the function and the - //! exponent is returned in the parameter exp. For a - //! floating-point value of zero, the significant and exponent - //! are both zero. For a floating-point value that is an - //! infinity or is not a number, the results are undefined. - /// - /// @see gtx_simd_vec4 - //detail::fvec4SIMD frexp(detail::fvec4SIMD const & x, detail::ivec4SIMD & exp); - - //! Builds a floating-point number from x and the - //! corresponding integral exponent of two in exp, returning: - //! significand * exp(2, exponent) - //! If this product is too large to be represented in the - //! floating-point type, the result is undefined. - /// - /// @see gtx_simd_vec4 - //detail::fvec4SIMD ldexp(detail::fvec4SIMD const & x, detail::ivec4SIMD const & exp); - - //! Returns the length of x, i.e., sqrt(x * x). - /// - /// @see gtx_simd_vec4 - float length( - detail::fvec4SIMD const & x); - - //! Returns the length of x, i.e., sqrt(x * x). - //! Less accurate but much faster than simdLength. - /// - /// @see gtx_simd_vec4 - float fastLength( - detail::fvec4SIMD const & x); - - //! Returns the length of x, i.e., sqrt(x * x). - //! Slightly more accurate but much slower than simdLength. - /// - /// @see gtx_simd_vec4 - float niceLength( - detail::fvec4SIMD const & x); - - //! Returns the length of x, i.e., sqrt(x * x). - /// - /// @see gtx_simd_vec4 - detail::fvec4SIMD length4( - detail::fvec4SIMD const & x); - - //! Returns the length of x, i.e., sqrt(x * x). - //! Less accurate but much faster than simdLength4. - /// - /// @see gtx_simd_vec4 - detail::fvec4SIMD fastLength4( - detail::fvec4SIMD const & x); - - //! Returns the length of x, i.e., sqrt(x * x). - //! Slightly more accurate but much slower than simdLength4. - /// - /// @see gtx_simd_vec4 - detail::fvec4SIMD niceLength4( - detail::fvec4SIMD const & x); - - //! Returns the distance betwwen p0 and p1, i.e., length(p0 - p1). - /// - /// @see gtx_simd_vec4 - float distance( - detail::fvec4SIMD const & p0, - detail::fvec4SIMD const & p1); - - //! Returns the distance betwwen p0 and p1, i.e., length(p0 - p1). - /// - /// @see gtx_simd_vec4 - detail::fvec4SIMD distance4( - detail::fvec4SIMD const & p0, - detail::fvec4SIMD const & p1); - - //! Returns the dot product of x and y, i.e., result = x * y. - /// - /// @see gtx_simd_vec4 - float simdDot( - detail::fvec4SIMD const & x, - detail::fvec4SIMD const & y); - - //! Returns the dot product of x and y, i.e., result = x * y. - /// - /// @see gtx_simd_vec4 - detail::fvec4SIMD dot4( - detail::fvec4SIMD const & x, - detail::fvec4SIMD const & y); - - //! Returns the cross product of x and y. - /// - /// @see gtx_simd_vec4 - detail::fvec4SIMD cross( - detail::fvec4SIMD const & x, - detail::fvec4SIMD const & y); - - //! Returns a vector in the same direction as x but with length of 1. - /// - /// @see gtx_simd_vec4 - detail::fvec4SIMD normalize( - detail::fvec4SIMD const & x); - - //! Returns a vector in the same direction as x but with length of 1. - //! Less accurate but much faster than simdNormalize. - /// - /// @see gtx_simd_vec4 - detail::fvec4SIMD fastNormalize( - detail::fvec4SIMD const & x); - - //! If dot(Nref, I) < 0.0, return N, otherwise, return -N. - /// - /// @see gtx_simd_vec4 - detail::fvec4SIMD simdFaceforward( - detail::fvec4SIMD const & N, - detail::fvec4SIMD const & I, - detail::fvec4SIMD const & Nref); - - //! For the incident vector I and surface orientation N, - //! returns the reflection direction : result = I - 2.0 * dot(N, I) * N. - /// - /// @see gtx_simd_vec4 - detail::fvec4SIMD reflect( - detail::fvec4SIMD const & I, - detail::fvec4SIMD const & N); - - //! For the incident vector I and surface normal N, - //! and the ratio of indices of refraction eta, - //! return the refraction vector. - /// - /// @see gtx_simd_vec4 - detail::fvec4SIMD refract( - detail::fvec4SIMD const & I, - detail::fvec4SIMD const & N, - float const & eta); - - //! Returns the positive square root of x. - /// - /// @see gtx_simd_vec4 - detail::fvec4SIMD sqrt( - detail::fvec4SIMD const & x); - - //! Returns the positive square root of x with the nicest quality but very slow. - //! Slightly more accurate but much slower than simdSqrt. - /// - /// @see gtx_simd_vec4 - detail::fvec4SIMD niceSqrt( - detail::fvec4SIMD const & x); - - //! Returns the positive square root of x - //! Less accurate but much faster than sqrt. - /// - /// @see gtx_simd_vec4 - detail::fvec4SIMD fastSqrt( - detail::fvec4SIMD const & x); - - //! Returns the reciprocal of the positive square root of x. - /// - /// @see gtx_simd_vec4 - detail::fvec4SIMD inversesqrt( - detail::fvec4SIMD const & x); - - //! Returns the reciprocal of the positive square root of x. - //! Faster than inversesqrt but less accurate. - /// - /// @see gtx_simd_vec4 - detail::fvec4SIMD fastInversesqrt( - detail::fvec4SIMD const & x); - - /// @} -}//namespace glm - -#include "simd_vec4.inl" - -#if (GLM_COMPILER & GLM_COMPILER_VC) -# pragma warning(pop) -#endif - -#endif//(GLM_ARCH != GLM_ARCH_PURE) diff --git a/extensions/common/glm/gtx/simd_vec4.inl b/extensions/common/glm/gtx/simd_vec4.inl deleted file mode 100644 index ba5387c27cc..00000000000 --- a/extensions/common/glm/gtx/simd_vec4.inl +++ /dev/null @@ -1,727 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2009-05-07 -// Updated : 2009-05-07 -// Licence : This source is under MIT License -// File : glm/gtx/simd_vec4.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm{ -namespace detail{ - -template <int Value> -struct shuffle_mask -{ - enum{value = Value}; -}; - -////////////////////////////////////// -// Implicit basic constructors - -GLM_FUNC_QUALIFIER fvec4SIMD::fvec4SIMD() -# ifdef GLM_FORCE_NO_CTOR_INIT - : Data(_mm_set_ps(0.0f, 0.0f, 0.0f, 0.0f)) -# endif -{} - -GLM_FUNC_QUALIFIER fvec4SIMD::fvec4SIMD(__m128 const & Data) : - Data(Data) -{} - -GLM_FUNC_QUALIFIER fvec4SIMD::fvec4SIMD(fvec4SIMD const & v) : - Data(v.Data) -{} - -GLM_FUNC_QUALIFIER fvec4SIMD::fvec4SIMD(vec4 const & v) : - Data(_mm_set_ps(v.w, v.z, v.y, v.x)) -{} - -////////////////////////////////////// -// Explicit basic constructors - -GLM_FUNC_QUALIFIER fvec4SIMD::fvec4SIMD(float const & s) : - Data(_mm_set1_ps(s)) -{} - -GLM_FUNC_QUALIFIER fvec4SIMD::fvec4SIMD(float const & x, float const & y, float const & z, float const & w) : -// Data(_mm_setr_ps(x, y, z, w)) - Data(_mm_set_ps(w, z, y, x)) -{} -/* -GLM_FUNC_QUALIFIER fvec4SIMD::fvec4SIMD(float const v[4]) : - Data(_mm_load_ps(v)) -{} -*/ -////////////////////////////////////// -// Swizzle constructors - -//fvec4SIMD(ref4<float> const & r); - -////////////////////////////////////// -// Conversion vector constructors - -GLM_FUNC_QUALIFIER fvec4SIMD::fvec4SIMD(vec2 const & v, float const & s1, float const & s2) : - Data(_mm_set_ps(s2, s1, v.y, v.x)) -{} - -GLM_FUNC_QUALIFIER fvec4SIMD::fvec4SIMD(float const & s1, vec2 const & v, float const & s2) : - Data(_mm_set_ps(s2, v.y, v.x, s1)) -{} - -GLM_FUNC_QUALIFIER fvec4SIMD::fvec4SIMD(float const & s1, float const & s2, vec2 const & v) : - Data(_mm_set_ps(v.y, v.x, s2, s1)) -{} - -GLM_FUNC_QUALIFIER fvec4SIMD::fvec4SIMD(vec3 const & v, float const & s) : - Data(_mm_set_ps(s, v.z, v.y, v.x)) -{} - -GLM_FUNC_QUALIFIER fvec4SIMD::fvec4SIMD(float const & s, vec3 const & v) : - Data(_mm_set_ps(v.z, v.y, v.x, s)) -{} - -GLM_FUNC_QUALIFIER fvec4SIMD::fvec4SIMD(vec2 const & v1, vec2 const & v2) : - Data(_mm_set_ps(v2.y, v2.x, v1.y, v1.x)) -{} - -//GLM_FUNC_QUALIFIER fvec4SIMD::fvec4SIMD(ivec4SIMD const & v) : -// Data(_mm_cvtepi32_ps(v.Data)) -//{} - -////////////////////////////////////// -// Unary arithmetic operators - -GLM_FUNC_QUALIFIER fvec4SIMD& fvec4SIMD::operator=(fvec4SIMD const & v) -{ - this->Data = v.Data; - return *this; -} - -GLM_FUNC_QUALIFIER fvec4SIMD& fvec4SIMD::operator+=(float const & s) -{ - this->Data = _mm_add_ps(Data, _mm_set_ps1(s)); - return *this; -} - -GLM_FUNC_QUALIFIER fvec4SIMD& fvec4SIMD::operator+=(fvec4SIMD const & v) -{ - this->Data = _mm_add_ps(this->Data , v.Data); - return *this; -} - -GLM_FUNC_QUALIFIER fvec4SIMD& fvec4SIMD::operator-=(float const & s) -{ - this->Data = _mm_sub_ps(Data, _mm_set_ps1(s)); - return *this; -} - -GLM_FUNC_QUALIFIER fvec4SIMD& fvec4SIMD::operator-=(fvec4SIMD const & v) -{ - this->Data = _mm_sub_ps(this->Data , v.Data); - return *this; -} - -GLM_FUNC_QUALIFIER fvec4SIMD& fvec4SIMD::operator*=(float const & s) -{ - this->Data = _mm_mul_ps(this->Data, _mm_set_ps1(s)); - return *this; -} - -GLM_FUNC_QUALIFIER fvec4SIMD& fvec4SIMD::operator*=(fvec4SIMD const & v) -{ - this->Data = _mm_mul_ps(this->Data , v.Data); - return *this; -} - -GLM_FUNC_QUALIFIER fvec4SIMD& fvec4SIMD::operator/=(float const & s) -{ - this->Data = _mm_div_ps(Data, _mm_set1_ps(s)); - return *this; -} - -GLM_FUNC_QUALIFIER fvec4SIMD& fvec4SIMD::operator/=(fvec4SIMD const & v) -{ - this->Data = _mm_div_ps(this->Data , v.Data); - return *this; -} - -GLM_FUNC_QUALIFIER fvec4SIMD& fvec4SIMD::operator++() -{ - this->Data = _mm_add_ps(this->Data , glm::detail::one); - return *this; -} - -GLM_FUNC_QUALIFIER fvec4SIMD& fvec4SIMD::operator--() -{ - this->Data = _mm_sub_ps(this->Data, glm::detail::one); - return *this; -} - -////////////////////////////////////// -// Swizzle operators - -template <comp X, comp Y, comp Z, comp W> -GLM_FUNC_QUALIFIER fvec4SIMD fvec4SIMD::swizzle() const -{ - __m128 Data = _mm_shuffle_ps( - this->Data, this->Data, - shuffle_mask<(W << 6) | (Z << 4) | (Y << 2) | (X << 0)>::value); - return fvec4SIMD(Data); -} - -template <comp X, comp Y, comp Z, comp W> -GLM_FUNC_QUALIFIER fvec4SIMD& fvec4SIMD::swizzle() -{ - this->Data = _mm_shuffle_ps( - this->Data, this->Data, - shuffle_mask<(W << 6) | (Z << 4) | (Y << 2) | (X << 0)>::value); - return *this; -} - -// operator+ -GLM_FUNC_QUALIFIER fvec4SIMD operator+ (fvec4SIMD const & v, float s) -{ - return fvec4SIMD(_mm_add_ps(v.Data, _mm_set1_ps(s))); -} - -GLM_FUNC_QUALIFIER fvec4SIMD operator+ (float s, fvec4SIMD const & v) -{ - return fvec4SIMD(_mm_add_ps(_mm_set1_ps(s), v.Data)); -} - -GLM_FUNC_QUALIFIER fvec4SIMD operator+ (fvec4SIMD const & v1, fvec4SIMD const & v2) -{ - return fvec4SIMD(_mm_add_ps(v1.Data, v2.Data)); -} - -//operator- -GLM_FUNC_QUALIFIER fvec4SIMD operator- (fvec4SIMD const & v, float s) -{ - return fvec4SIMD(_mm_sub_ps(v.Data, _mm_set1_ps(s))); -} - -GLM_FUNC_QUALIFIER fvec4SIMD operator- (float s, fvec4SIMD const & v) -{ - return fvec4SIMD(_mm_sub_ps(_mm_set1_ps(s), v.Data)); -} - -GLM_FUNC_QUALIFIER fvec4SIMD operator- (fvec4SIMD const & v1, fvec4SIMD const & v2) -{ - return fvec4SIMD(_mm_sub_ps(v1.Data, v2.Data)); -} - -//operator* -GLM_FUNC_QUALIFIER fvec4SIMD operator* (fvec4SIMD const & v, float s) -{ - __m128 par0 = v.Data; - __m128 par1 = _mm_set1_ps(s); - return fvec4SIMD(_mm_mul_ps(par0, par1)); -} - -GLM_FUNC_QUALIFIER fvec4SIMD operator* (float s, fvec4SIMD const & v) -{ - __m128 par0 = _mm_set1_ps(s); - __m128 par1 = v.Data; - return fvec4SIMD(_mm_mul_ps(par0, par1)); -} - -GLM_FUNC_QUALIFIER fvec4SIMD operator* (fvec4SIMD const & v1, fvec4SIMD const & v2) -{ - return fvec4SIMD(_mm_mul_ps(v1.Data, v2.Data)); -} - -//operator/ -GLM_FUNC_QUALIFIER fvec4SIMD operator/ (fvec4SIMD const & v, float s) -{ - __m128 par0 = v.Data; - __m128 par1 = _mm_set1_ps(s); - return fvec4SIMD(_mm_div_ps(par0, par1)); -} - -GLM_FUNC_QUALIFIER fvec4SIMD operator/ (float s, fvec4SIMD const & v) -{ - __m128 par0 = _mm_set1_ps(s); - __m128 par1 = v.Data; - return fvec4SIMD(_mm_div_ps(par0, par1)); -} - -GLM_FUNC_QUALIFIER fvec4SIMD operator/ (fvec4SIMD const & v1, fvec4SIMD const & v2) -{ - return fvec4SIMD(_mm_div_ps(v1.Data, v2.Data)); -} - -// Unary constant operators -GLM_FUNC_QUALIFIER fvec4SIMD operator- (fvec4SIMD const & v) -{ - return fvec4SIMD(_mm_sub_ps(_mm_setzero_ps(), v.Data)); -} - -GLM_FUNC_QUALIFIER fvec4SIMD operator++ (fvec4SIMD const & v, int) -{ - return fvec4SIMD(_mm_add_ps(v.Data, glm::detail::one)); -} - -GLM_FUNC_QUALIFIER fvec4SIMD operator-- (fvec4SIMD const & v, int) -{ - return fvec4SIMD(_mm_sub_ps(v.Data, glm::detail::one)); -} - -}//namespace detail - -GLM_FUNC_QUALIFIER vec4 vec4_cast -( - detail::fvec4SIMD const & x -) -{ - GLM_ALIGN(16) vec4 Result; - _mm_store_ps(&Result[0], x.Data); - return Result; -} - -// Other possible implementation -//float abs(float a) -//{ -// return max(-a, a); -//} -GLM_FUNC_QUALIFIER detail::fvec4SIMD abs -( - detail::fvec4SIMD const & x -) -{ - return detail::sse_abs_ps(x.Data); -} - -GLM_FUNC_QUALIFIER detail::fvec4SIMD sign -( - detail::fvec4SIMD const & x -) -{ - return detail::sse_sgn_ps(x.Data); -} - -GLM_FUNC_QUALIFIER detail::fvec4SIMD floor -( - detail::fvec4SIMD const & x -) -{ - return detail::sse_flr_ps(x.Data); -} - -GLM_FUNC_QUALIFIER detail::fvec4SIMD trunc -( - detail::fvec4SIMD const & x -) -{ - //return x < 0 ? -floor(-x) : floor(x); - - __m128 Flr0 = detail::sse_flr_ps(_mm_sub_ps(_mm_setzero_ps(), x.Data)); - __m128 Sub0 = _mm_sub_ps(Flr0, x.Data); - __m128 Flr1 = detail::sse_flr_ps(x.Data); - - __m128 Cmp0 = _mm_cmplt_ps(x.Data, glm::detail::zero); - __m128 Cmp1 = _mm_cmpnlt_ps(x.Data, glm::detail::zero); - - __m128 And0 = _mm_and_ps(Sub0, Cmp0); - __m128 And1 = _mm_and_ps(Flr1, Cmp1); - - return _mm_or_ps(And0, And1); -} - -GLM_FUNC_QUALIFIER detail::fvec4SIMD round -( - detail::fvec4SIMD const & x -) -{ - return detail::sse_rnd_ps(x.Data); -} - -//GLM_FUNC_QUALIFIER detail::fvec4SIMD roundEven -//( -// detail::fvec4SIMD const & x -//) -//{ - -//} - -GLM_FUNC_QUALIFIER detail::fvec4SIMD ceil -( - detail::fvec4SIMD const & x -) -{ - return detail::sse_ceil_ps(x.Data); -} - -GLM_FUNC_QUALIFIER detail::fvec4SIMD fract -( - detail::fvec4SIMD const & x -) -{ - return detail::sse_frc_ps(x.Data); -} - -GLM_FUNC_QUALIFIER detail::fvec4SIMD mod -( - detail::fvec4SIMD const & x, - detail::fvec4SIMD const & y -) -{ - return detail::sse_mod_ps(x.Data, y.Data); -} - -GLM_FUNC_QUALIFIER detail::fvec4SIMD mod -( - detail::fvec4SIMD const & x, - float const & y -) -{ - return detail::sse_mod_ps(x.Data, _mm_set1_ps(y)); -} - -//GLM_FUNC_QUALIFIER detail::fvec4SIMD modf -//( -// detail::fvec4SIMD const & x, -// detail::fvec4SIMD & i -//) -//{ - -//} - -GLM_FUNC_QUALIFIER detail::fvec4SIMD min -( - detail::fvec4SIMD const & x, - detail::fvec4SIMD const & y -) -{ - return _mm_min_ps(x.Data, y.Data); -} - -GLM_FUNC_QUALIFIER detail::fvec4SIMD min -( - detail::fvec4SIMD const & x, - float const & y -) -{ - return _mm_min_ps(x.Data, _mm_set1_ps(y)); -} - -GLM_FUNC_QUALIFIER detail::fvec4SIMD max -( - detail::fvec4SIMD const & x, - detail::fvec4SIMD const & y -) -{ - return _mm_max_ps(x.Data, y.Data); -} - -GLM_FUNC_QUALIFIER detail::fvec4SIMD max -( - detail::fvec4SIMD const & x, - float const & y -) -{ - return _mm_max_ps(x.Data, _mm_set1_ps(y)); -} - -GLM_FUNC_QUALIFIER detail::fvec4SIMD clamp -( - detail::fvec4SIMD const & x, - detail::fvec4SIMD const & minVal, - detail::fvec4SIMD const & maxVal -) -{ - return detail::sse_clp_ps(x.Data, minVal.Data, maxVal.Data); -} - -GLM_FUNC_QUALIFIER detail::fvec4SIMD clamp -( - detail::fvec4SIMD const & x, - float const & minVal, - float const & maxVal -) -{ - return detail::sse_clp_ps(x.Data, _mm_set1_ps(minVal), _mm_set1_ps(maxVal)); -} - -GLM_FUNC_QUALIFIER detail::fvec4SIMD mix -( - detail::fvec4SIMD const & x, - detail::fvec4SIMD const & y, - detail::fvec4SIMD const & a -) -{ - __m128 Sub0 = _mm_sub_ps(y.Data, x.Data); - __m128 Mul0 = _mm_mul_ps(a.Data, Sub0); - return _mm_add_ps(x.Data, Mul0); -} - -GLM_FUNC_QUALIFIER detail::fvec4SIMD step -( - detail::fvec4SIMD const & edge, - detail::fvec4SIMD const & x -) -{ - __m128 cmp0 = _mm_cmpngt_ps(x.Data, edge.Data); - return _mm_max_ps(_mm_min_ps(cmp0, _mm_setzero_ps()), detail::one); -} - -GLM_FUNC_QUALIFIER detail::fvec4SIMD step -( - float const & edge, - detail::fvec4SIMD const & x -) -{ - __m128 cmp0 = _mm_cmpngt_ps(x.Data, _mm_set1_ps(edge)); - return _mm_max_ps(_mm_min_ps(cmp0, _mm_setzero_ps()), detail::one); -} - -GLM_FUNC_QUALIFIER detail::fvec4SIMD smoothstep -( - detail::fvec4SIMD const & edge0, - detail::fvec4SIMD const & edge1, - detail::fvec4SIMD const & x -) -{ - return detail::sse_ssp_ps(edge0.Data, edge1.Data, x.Data); -} - -GLM_FUNC_QUALIFIER detail::fvec4SIMD smoothstep -( - float const & edge0, - float const & edge1, - detail::fvec4SIMD const & x -) -{ - return detail::sse_ssp_ps(_mm_set1_ps(edge0), _mm_set1_ps(edge1), x.Data); -} - -//GLM_FUNC_QUALIFIER bvec4 isnan(detail::fvec4SIMD const & x) -//{ - -//} - -//GLM_FUNC_QUALIFIER bvec4 isinf(detail::fvec4SIMD const & x) -//{ - -//} - -//GLM_FUNC_QUALIFIER detail::ivec4SIMD floatBitsToInt -//( -// detail::fvec4SIMD const & value -//) -//{ - -//} - -//GLM_FUNC_QUALIFIER detail::fvec4SIMD intBitsToFloat -//( -// detail::ivec4SIMD const & value -//) -//{ - -//} - -GLM_FUNC_QUALIFIER detail::fvec4SIMD fma -( - detail::fvec4SIMD const & a, - detail::fvec4SIMD const & b, - detail::fvec4SIMD const & c -) -{ - return _mm_add_ps(_mm_mul_ps(a.Data, b.Data), c.Data); -} - -GLM_FUNC_QUALIFIER float length -( - detail::fvec4SIMD const & x -) -{ - detail::fvec4SIMD dot0 = detail::sse_dot_ss(x.Data, x.Data); - detail::fvec4SIMD sqt0 = sqrt(dot0); - float Result = 0; - _mm_store_ss(&Result, sqt0.Data); - return Result; -} - -GLM_FUNC_QUALIFIER float fastLength -( - detail::fvec4SIMD const & x -) -{ - detail::fvec4SIMD dot0 = detail::sse_dot_ss(x.Data, x.Data); - detail::fvec4SIMD sqt0 = fastSqrt(dot0); - float Result = 0; - _mm_store_ss(&Result, sqt0.Data); - return Result; -} - -GLM_FUNC_QUALIFIER float niceLength -( - detail::fvec4SIMD const & x -) -{ - detail::fvec4SIMD dot0 = detail::sse_dot_ss(x.Data, x.Data); - detail::fvec4SIMD sqt0 = niceSqrt(dot0); - float Result = 0; - _mm_store_ss(&Result, sqt0.Data); - return Result; -} - -GLM_FUNC_QUALIFIER detail::fvec4SIMD length4 -( - detail::fvec4SIMD const & x -) -{ - return sqrt(dot4(x, x)); -} - -GLM_FUNC_QUALIFIER detail::fvec4SIMD fastLength4 -( - detail::fvec4SIMD const & x -) -{ - return fastSqrt(dot4(x, x)); -} - -GLM_FUNC_QUALIFIER detail::fvec4SIMD niceLength4 -( - detail::fvec4SIMD const & x -) -{ - return niceSqrt(dot4(x, x)); -} - -GLM_FUNC_QUALIFIER float distance -( - detail::fvec4SIMD const & p0, - detail::fvec4SIMD const & p1 -) -{ - float Result = 0; - _mm_store_ss(&Result, detail::sse_dst_ps(p0.Data, p1.Data)); - return Result; -} - -GLM_FUNC_QUALIFIER detail::fvec4SIMD distance4 -( - detail::fvec4SIMD const & p0, - detail::fvec4SIMD const & p1 -) -{ - return detail::sse_dst_ps(p0.Data, p1.Data); -} - -GLM_FUNC_QUALIFIER float dot -( - detail::fvec4SIMD const & x, - detail::fvec4SIMD const & y -) -{ - float Result = 0; - _mm_store_ss(&Result, detail::sse_dot_ss(x.Data, y.Data)); - return Result; -} - -GLM_FUNC_QUALIFIER detail::fvec4SIMD dot4 -( - detail::fvec4SIMD const & x, - detail::fvec4SIMD const & y -) -{ - return detail::sse_dot_ps(x.Data, y.Data); -} - -GLM_FUNC_QUALIFIER detail::fvec4SIMD cross -( - detail::fvec4SIMD const & x, - detail::fvec4SIMD const & y -) -{ - return detail::sse_xpd_ps(x.Data, y.Data); -} - -GLM_FUNC_QUALIFIER detail::fvec4SIMD normalize -( - detail::fvec4SIMD const & x -) -{ - __m128 dot0 = detail::sse_dot_ps(x.Data, x.Data); - __m128 isr0 = inversesqrt(detail::fvec4SIMD(dot0)).Data; - __m128 mul0 = _mm_mul_ps(x.Data, isr0); - return mul0; -} - -GLM_FUNC_QUALIFIER detail::fvec4SIMD fastNormalize -( - detail::fvec4SIMD const & x -) -{ - __m128 dot0 = detail::sse_dot_ps(x.Data, x.Data); - __m128 isr0 = fastInversesqrt(dot0).Data; - __m128 mul0 = _mm_mul_ps(x.Data, isr0); - return mul0; -} - -GLM_FUNC_QUALIFIER detail::fvec4SIMD faceforward -( - detail::fvec4SIMD const & N, - detail::fvec4SIMD const & I, - detail::fvec4SIMD const & Nref -) -{ - return detail::sse_ffd_ps(N.Data, I.Data, Nref.Data); -} - -GLM_FUNC_QUALIFIER detail::fvec4SIMD reflect -( - detail::fvec4SIMD const & I, - detail::fvec4SIMD const & N -) -{ - return detail::sse_rfe_ps(I.Data, N.Data); -} - -GLM_FUNC_QUALIFIER detail::fvec4SIMD refract -( - detail::fvec4SIMD const & I, - detail::fvec4SIMD const & N, - float const & eta -) -{ - return detail::sse_rfa_ps(I.Data, N.Data, _mm_set1_ps(eta)); -} - -GLM_FUNC_QUALIFIER detail::fvec4SIMD sqrt(detail::fvec4SIMD const & x) -{ - return _mm_mul_ps(inversesqrt(x).Data, x.Data); -} - -GLM_FUNC_QUALIFIER detail::fvec4SIMD niceSqrt(detail::fvec4SIMD const & x) -{ - return _mm_sqrt_ps(x.Data); -} - -GLM_FUNC_QUALIFIER detail::fvec4SIMD fastSqrt(detail::fvec4SIMD const & x) -{ - return _mm_mul_ps(fastInversesqrt(x.Data).Data, x.Data); -} - -// SSE scalar reciprocal sqrt using rsqrt op, plus one Newton-Rhaphson iteration -// By Elan Ruskin, http://assemblyrequired.crashworks.org/ -GLM_FUNC_QUALIFIER detail::fvec4SIMD inversesqrt(detail::fvec4SIMD const & x) -{ - GLM_ALIGN(4) static const __m128 three = {3, 3, 3, 3}; // aligned consts for fast load - GLM_ALIGN(4) static const __m128 half = {0.5,0.5,0.5,0.5}; - - __m128 recip = _mm_rsqrt_ps(x.Data); // "estimate" opcode - __m128 halfrecip = _mm_mul_ps(half, recip); - __m128 threeminus_xrr = _mm_sub_ps(three, _mm_mul_ps(x.Data, _mm_mul_ps(recip, recip))); - return _mm_mul_ps(halfrecip, threeminus_xrr); -} - -GLM_FUNC_QUALIFIER detail::fvec4SIMD fastInversesqrt(detail::fvec4SIMD const & x) -{ - return _mm_rsqrt_ps(x.Data); -} - -}//namespace glm diff --git a/extensions/common/glm/gtx/spline.hpp b/extensions/common/glm/gtx/spline.hpp deleted file mode 100644 index f7436a9b953..00000000000 --- a/extensions/common/glm/gtx/spline.hpp +++ /dev/null @@ -1,90 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_spline -/// @file glm/gtx/spline.hpp -/// @date 2007-01-25 / 2011-06-07 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// -/// @defgroup gtx_spline GLM_GTX_spline -/// @ingroup gtx -/// -/// @brief Spline functions -/// -/// <glm/gtx/spline.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependency: -#include "../glm.hpp" -#include "../gtx/optimum_pow.hpp" - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTX_spline extension included") -#endif - -namespace glm -{ - /// @addtogroup gtx_spline - /// @{ - - /// Return a point from a catmull rom curve. - /// @see gtx_spline extension. - template <typename genType> - GLM_FUNC_DECL genType catmullRom( - genType const & v1, - genType const & v2, - genType const & v3, - genType const & v4, - typename genType::value_type const & s); - - /// Return a point from a hermite curve. - /// @see gtx_spline extension. - template <typename genType> - GLM_FUNC_DECL genType hermite( - genType const & v1, - genType const & t1, - genType const & v2, - genType const & t2, - typename genType::value_type const & s); - - /// Return a point from a cubic curve. - /// @see gtx_spline extension. - template <typename genType> - GLM_FUNC_DECL genType cubic( - genType const & v1, - genType const & v2, - genType const & v3, - genType const & v4, - typename genType::value_type const & s); - - /// @} -}//namespace glm - -#include "spline.inl" diff --git a/extensions/common/glm/gtx/spline.inl b/extensions/common/glm/gtx/spline.inl deleted file mode 100644 index befdc3c626e..00000000000 --- a/extensions/common/glm/gtx/spline.inl +++ /dev/null @@ -1,92 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_spline -/// @file glm/gtx/spline.inl -/// @date 2007-01-25 / 2011-06-07 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template <typename genType> - GLM_FUNC_QUALIFIER genType catmullRom - ( - genType const & v1, - genType const & v2, - genType const & v3, - genType const & v4, - typename genType::value_type const & s - ) - { - typename genType::value_type s1 = s; - typename genType::value_type s2 = pow2(s); - typename genType::value_type s3 = pow3(s); - - typename genType::value_type f1 = -s3 + typename genType::value_type(2) * s2 - s; - typename genType::value_type f2 = typename genType::value_type(3) * s3 - typename genType::value_type(5) * s2 + typename genType::value_type(2); - typename genType::value_type f3 = typename genType::value_type(-3) * s3 + typename genType::value_type(4) * s2 + s; - typename genType::value_type f4 = s3 - s2; - - return (f1 * v1 + f2 * v2 + f3 * v3 + f4 * v4) / typename genType::value_type(2); - - } - - template <typename genType> - GLM_FUNC_QUALIFIER genType hermite - ( - genType const & v1, - genType const & t1, - genType const & v2, - genType const & t2, - typename genType::value_type const & s - ) - { - typename genType::value_type s1 = s; - typename genType::value_type s2 = pow2(s); - typename genType::value_type s3 = pow3(s); - - typename genType::value_type f1 = typename genType::value_type(2) * s3 - typename genType::value_type(3) * s2 + typename genType::value_type(1); - typename genType::value_type f2 = typename genType::value_type(-2) * s3 + typename genType::value_type(3) * s2; - typename genType::value_type f3 = s3 - typename genType::value_type(2) * s2 + s; - typename genType::value_type f4 = s3 - s2; - - return f1 * v1 + f2 * v2 + f3 * t1 + f4 * t2; - } - - template <typename genType> - GLM_FUNC_QUALIFIER genType cubic - ( - genType const & v1, - genType const & v2, - genType const & v3, - genType const & v4, - typename genType::value_type const & s - ) - { - return ((v1 * s + v2) * s + v3) * s + v4; - } -}//namespace glm diff --git a/extensions/common/glm/gtx/std_based_type.hpp b/extensions/common/glm/gtx/std_based_type.hpp deleted file mode 100644 index f1a5c257035..00000000000 --- a/extensions/common/glm/gtx/std_based_type.hpp +++ /dev/null @@ -1,92 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_std_based_type -/// @file glm/gtx/std_based_type.hpp -/// @date 2008-06-08 / 2011-06-07 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// @see gtx_extented_min_max (dependence) -/// -/// @defgroup gtx_std_based_type GLM_GTX_std_based_type -/// @ingroup gtx -/// -/// @brief Adds vector types based on STL value types. -/// <glm/gtx/std_based_type.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependency: -#include "../glm.hpp" -#include <cstdlib> - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTX_std_based_type extension included") -#endif - -namespace glm -{ - /// @addtogroup gtx_std_based_type - /// @{ - - /// Vector type based of one std::size_t component. - /// @see GLM_GTX_std_based_type - typedef tvec1<std::size_t, defaultp> size1; - - /// Vector type based of two std::size_t components. - /// @see GLM_GTX_std_based_type - typedef tvec2<std::size_t, defaultp> size2; - - /// Vector type based of three std::size_t components. - /// @see GLM_GTX_std_based_type - typedef tvec3<std::size_t, defaultp> size3; - - /// Vector type based of four std::size_t components. - /// @see GLM_GTX_std_based_type - typedef tvec4<std::size_t, defaultp> size4; - - /// Vector type based of one std::size_t component. - /// @see GLM_GTX_std_based_type - typedef tvec1<std::size_t, defaultp> size1_t; - - /// Vector type based of two std::size_t components. - /// @see GLM_GTX_std_based_type - typedef tvec2<std::size_t, defaultp> size2_t; - - /// Vector type based of three std::size_t components. - /// @see GLM_GTX_std_based_type - typedef tvec3<std::size_t, defaultp> size3_t; - - /// Vector type based of four std::size_t components. - /// @see GLM_GTX_std_based_type - typedef tvec4<std::size_t, defaultp> size4_t; - - /// @} -}//namespace glm - -#include "std_based_type.inl" diff --git a/extensions/common/glm/gtx/std_based_type.inl b/extensions/common/glm/gtx/std_based_type.inl deleted file mode 100644 index 4e3cf1c8e06..00000000000 --- a/extensions/common/glm/gtx/std_based_type.inl +++ /dev/null @@ -1,36 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_std_based_type -/// @file glm/gtx/std_based_type.inl -/// @date 2008-06-08 / 2011-06-07 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - -} diff --git a/extensions/common/glm/gtx/string_cast.hpp b/extensions/common/glm/gtx/string_cast.hpp deleted file mode 100644 index 6ccc6fa8f81..00000000000 --- a/extensions/common/glm/gtx/string_cast.hpp +++ /dev/null @@ -1,74 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_string_cast -/// @file glm/gtx/string_cast.hpp -/// @date 2008-04-26 / 2014-05-10 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// @see gtc_half_float (dependence) -/// @see gtx_integer (dependence) -/// @see gtx_quaternion (dependence) -/// -/// @defgroup gtx_string_cast GLM_GTX_string_cast -/// @ingroup gtx -/// -/// @brief Setup strings for GLM type values -/// -/// <glm/gtx/string_cast.hpp> need to be included to use these functionalities. -/// This extension is not supported with CUDA -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependency: -#include "../glm.hpp" -#include "../gtc/type_precision.hpp" -#include <string> - -#if(GLM_COMPILER & GLM_COMPILER_CUDA) -# error "GLM_GTX_string_cast is not supported on CUDA compiler" -#endif - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTX_string_cast extension included") -#endif - -namespace glm -{ - /// @addtogroup gtx_string_cast - /// @{ - - /// Create a string from a GLM vector or matrix typed variable. - /// @see gtx_string_cast extension. - template <template <typename, precision> class matType, typename T, precision P> - GLM_FUNC_DECL std::string to_string(matType<T, P> const & x); - - /// @} -}//namespace glm - -#include "string_cast.inl" diff --git a/extensions/common/glm/gtx/string_cast.inl b/extensions/common/glm/gtx/string_cast.inl deleted file mode 100644 index fb70ebc0087..00000000000 --- a/extensions/common/glm/gtx/string_cast.inl +++ /dev/null @@ -1,455 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_string_cast -/// @file glm/gtx/string_cast.inl -/// @date 2008-04-26 / 2014-05-10 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#include <cstdarg> -#include <cstdio> - -namespace glm{ -namespace detail -{ - GLM_FUNC_QUALIFIER std::string format(const char* msg, ...) - { - std::size_t const STRING_BUFFER(4096); - char text[STRING_BUFFER]; - va_list list; - - if(msg == 0) - return std::string(); - - va_start(list, msg); -# if(GLM_COMPILER & GLM_COMPILER_VC) - vsprintf_s(text, STRING_BUFFER, msg, list); -# else// - vsprintf(text, msg, list); -# endif// - va_end(list); - - return std::string(text); - } - - static const char* LabelTrue = "true"; - static const char* LabelFalse = "false"; - - template <typename T, bool isFloat = false> - struct literal - { - GLM_FUNC_QUALIFIER static char const * value() {return "%d";}; - }; - - template <typename T> - struct literal<T, true> - { - GLM_FUNC_QUALIFIER static char const * value() {return "%f";}; - }; - -# if GLM_MODEL == GLM_MODEL_32 && GLM_COMPILER && GLM_COMPILER_VC - template <> - struct literal<uint64_t, false> - { - GLM_FUNC_QUALIFIER static char const * value() {return "%lld";}; - }; - - template <> - struct literal<int64_t, false> - { - GLM_FUNC_QUALIFIER static char const * value() {return "%lld";}; - }; -# endif//GLM_MODEL == GLM_MODEL_32 && GLM_COMPILER && GLM_COMPILER_VC - - template <typename T> - struct prefix{}; - - template <> - struct prefix<float> - { - GLM_FUNC_QUALIFIER static char const * value() {return "";}; - }; - - template <> - struct prefix<double> - { - GLM_FUNC_QUALIFIER static char const * value() {return "d";}; - }; - - template <> - struct prefix<bool> - { - GLM_FUNC_QUALIFIER static char const * value() {return "b";}; - }; - - template <> - struct prefix<uint8_t> - { - GLM_FUNC_QUALIFIER static char const * value() {return "u8";}; - }; - - template <> - struct prefix<int8_t> - { - GLM_FUNC_QUALIFIER static char const * value() {return "i8";}; - }; - - template <> - struct prefix<uint16_t> - { - GLM_FUNC_QUALIFIER static char const * value() {return "u16";}; - }; - - template <> - struct prefix<int16_t> - { - GLM_FUNC_QUALIFIER static char const * value() {return "i16";}; - }; - - template <> - struct prefix<uint32_t> - { - GLM_FUNC_QUALIFIER static char const * value() {return "u";}; - }; - - template <> - struct prefix<int32_t> - { - GLM_FUNC_QUALIFIER static char const * value() {return "i";}; - }; - - template <> - struct prefix<uint64_t> - { - GLM_FUNC_QUALIFIER static char const * value() {return "u64";}; - }; - - template <> - struct prefix<int64_t> - { - GLM_FUNC_QUALIFIER static char const * value() {return "i64";}; - }; - - template <template <typename, precision> class matType, typename T, precision P> - struct compute_to_string - {}; - - template <precision P> - struct compute_to_string<tvec1, bool, P> - { - GLM_FUNC_QUALIFIER static std::string call(tvec1<bool, P> const & x) - { - return detail::format("bvec1(%s)", - x[0] ? detail::LabelTrue : detail::LabelFalse); - } - }; - - template <precision P> - struct compute_to_string<tvec2, bool, P> - { - GLM_FUNC_QUALIFIER static std::string call(tvec2<bool, P> const & x) - { - return detail::format("bvec2(%s, %s)", - x[0] ? detail::LabelTrue : detail::LabelFalse, - x[1] ? detail::LabelTrue : detail::LabelFalse); - } - }; - - template <precision P> - struct compute_to_string<tvec3, bool, P> - { - GLM_FUNC_QUALIFIER static std::string call(tvec3<bool, P> const & x) - { - return detail::format("bvec3(%s, %s, %s)", - x[0] ? detail::LabelTrue : detail::LabelFalse, - x[1] ? detail::LabelTrue : detail::LabelFalse, - x[2] ? detail::LabelTrue : detail::LabelFalse); - } - }; - - template <precision P> - struct compute_to_string<tvec4, bool, P> - { - GLM_FUNC_QUALIFIER static std::string call(tvec4<bool, P> const & x) - { - return detail::format("bvec4(%s, %s, %s, %s)", - x[0] ? detail::LabelTrue : detail::LabelFalse, - x[1] ? detail::LabelTrue : detail::LabelFalse, - x[2] ? detail::LabelTrue : detail::LabelFalse, - x[3] ? detail::LabelTrue : detail::LabelFalse); - } - }; - - template <typename T, precision P> - struct compute_to_string<tvec1, T, P> - { - GLM_FUNC_QUALIFIER static std::string call(tvec1<T, P> const & x) - { - char const * PrefixStr = prefix<T>::value(); - char const * LiteralStr = literal<T, std::numeric_limits<T>::is_iec559>::value(); - std::string FormatStr(detail::format("%svec1(%s)", - PrefixStr, - LiteralStr)); - - return detail::format(FormatStr.c_str(), x[0]); - } - }; - - template <typename T, precision P> - struct compute_to_string<tvec2, T, P> - { - GLM_FUNC_QUALIFIER static std::string call(tvec2<T, P> const & x) - { - char const * PrefixStr = prefix<T>::value(); - char const * LiteralStr = literal<T, std::numeric_limits<T>::is_iec559>::value(); - std::string FormatStr(detail::format("%svec2(%s, %s)", - PrefixStr, - LiteralStr, LiteralStr)); - - return detail::format(FormatStr.c_str(), x[0], x[1]); - } - }; - - template <typename T, precision P> - struct compute_to_string<tvec3, T, P> - { - GLM_FUNC_QUALIFIER static std::string call(tvec3<T, P> const & x) - { - char const * PrefixStr = prefix<T>::value(); - char const * LiteralStr = literal<T, std::numeric_limits<T>::is_iec559>::value(); - std::string FormatStr(detail::format("%svec3(%s, %s, %s)", - PrefixStr, - LiteralStr, LiteralStr, LiteralStr)); - - return detail::format(FormatStr.c_str(), x[0], x[1], x[2]); - } - }; - - template <typename T, precision P> - struct compute_to_string<tvec4, T, P> - { - GLM_FUNC_QUALIFIER static std::string call(tvec4<T, P> const & x) - { - char const * PrefixStr = prefix<T>::value(); - char const * LiteralStr = literal<T, std::numeric_limits<T>::is_iec559>::value(); - std::string FormatStr(detail::format("%svec4(%s, %s, %s, %s)", - PrefixStr, - LiteralStr, LiteralStr, LiteralStr, LiteralStr)); - - return detail::format(FormatStr.c_str(), x[0], x[1], x[2], x[3]); - } - }; - - - template <typename T, precision P> - struct compute_to_string<tmat2x2, T, P> - { - GLM_FUNC_QUALIFIER static std::string call(tmat2x2<T, P> const & x) - { - char const * PrefixStr = prefix<T>::value(); - char const * LiteralStr = literal<T, std::numeric_limits<T>::is_iec559>::value(); - std::string FormatStr(detail::format("%smat2x2((%s, %s), (%s, %s))", - PrefixStr, - LiteralStr, LiteralStr, - LiteralStr, LiteralStr)); - - return detail::format(FormatStr.c_str(), - x[0][0], x[0][1], - x[1][0], x[1][1]); - } - }; - - template <typename T, precision P> - struct compute_to_string<tmat2x3, T, P> - { - GLM_FUNC_QUALIFIER static std::string call(tmat2x3<T, P> const & x) - { - char const * PrefixStr = prefix<T>::value(); - char const * LiteralStr = literal<T, std::numeric_limits<T>::is_iec559>::value(); - std::string FormatStr(detail::format("%smat2x3((%s, %s, %s), (%s, %s, %s))", - PrefixStr, - LiteralStr, LiteralStr, LiteralStr, - LiteralStr, LiteralStr, LiteralStr)); - - return detail::format(FormatStr.c_str(), - x[0][0], x[0][1], x[0][2], - x[1][0], x[1][1], x[1][2]); - } - }; - - template <typename T, precision P> - struct compute_to_string<tmat2x4, T, P> - { - GLM_FUNC_QUALIFIER static std::string call(tmat2x4<T, P> const & x) - { - char const * PrefixStr = prefix<T>::value(); - char const * LiteralStr = literal<T, std::numeric_limits<T>::is_iec559>::value(); - std::string FormatStr(detail::format("%smat2x4((%s, %s, %s, %s), (%s, %s, %s, %s))", - PrefixStr, - LiteralStr, LiteralStr, LiteralStr, LiteralStr, - LiteralStr, LiteralStr, LiteralStr, LiteralStr)); - - return detail::format(FormatStr.c_str(), - x[0][0], x[0][1], x[0][2], x[0][3], - x[1][0], x[1][1], x[1][2], x[1][3]); - } - }; - - template <typename T, precision P> - struct compute_to_string<tmat3x2, T, P> - { - GLM_FUNC_QUALIFIER static std::string call(tmat3x2<T, P> const & x) - { - char const * PrefixStr = prefix<T>::value(); - char const * LiteralStr = literal<T, std::numeric_limits<T>::is_iec559>::value(); - std::string FormatStr(detail::format("%smat3x2((%s, %s), (%s, %s), (%s, %s))", - PrefixStr, - LiteralStr, LiteralStr, - LiteralStr, LiteralStr, - LiteralStr, LiteralStr)); - - return detail::format(FormatStr.c_str(), - x[0][0], x[0][1], - x[1][0], x[1][1], - x[2][0], x[2][1]); - } - }; - - template <typename T, precision P> - struct compute_to_string<tmat3x3, T, P> - { - GLM_FUNC_QUALIFIER static std::string call(tmat3x3<T, P> const & x) - { - char const * PrefixStr = prefix<T>::value(); - char const * LiteralStr = literal<T, std::numeric_limits<T>::is_iec559>::value(); - std::string FormatStr(detail::format("%smat3x3((%s, %s, %s), (%s, %s, %s), (%s, %s, %s))", - PrefixStr, - LiteralStr, LiteralStr, LiteralStr, - LiteralStr, LiteralStr, LiteralStr, - LiteralStr, LiteralStr, LiteralStr)); - - return detail::format(FormatStr.c_str(), - x[0][0], x[0][1], x[0][2], - x[1][0], x[1][1], x[1][2], - x[2][0], x[2][1], x[2][2]); - } - }; - - template <typename T, precision P> - struct compute_to_string<tmat3x4, T, P> - { - GLM_FUNC_QUALIFIER static std::string call(tmat3x4<T, P> const & x) - { - char const * PrefixStr = prefix<T>::value(); - char const * LiteralStr = literal<T, std::numeric_limits<T>::is_iec559>::value(); - std::string FormatStr(detail::format("%smat3x4((%s, %s, %s, %s), (%s, %s, %s, %s), (%s, %s, %s, %s))", - PrefixStr, - LiteralStr, LiteralStr, LiteralStr, LiteralStr, - LiteralStr, LiteralStr, LiteralStr, LiteralStr, - LiteralStr, LiteralStr, LiteralStr, LiteralStr)); - - return detail::format(FormatStr.c_str(), - x[0][0], x[0][1], x[0][2], x[0][3], - x[1][0], x[1][1], x[1][2], x[1][3], - x[2][0], x[2][1], x[2][2], x[2][3]); - } - }; - - template <typename T, precision P> - struct compute_to_string<tmat4x2, T, P> - { - GLM_FUNC_QUALIFIER static std::string call(tmat4x2<T, P> const & x) - { - char const * PrefixStr = prefix<T>::value(); - char const * LiteralStr = literal<T, std::numeric_limits<T>::is_iec559>::value(); - std::string FormatStr(detail::format("%smat4x2((%s, %s), (%s, %s), (%s, %s), (%s, %s))", - PrefixStr, - LiteralStr, LiteralStr, - LiteralStr, LiteralStr, - LiteralStr, LiteralStr, - LiteralStr, LiteralStr)); - - return detail::format(FormatStr.c_str(), - x[0][0], x[0][1], - x[1][0], x[1][1], - x[2][0], x[2][1], - x[3][0], x[3][1]); - } - }; - - template <typename T, precision P> - struct compute_to_string<tmat4x3, T, P> - { - GLM_FUNC_QUALIFIER static std::string call(tmat4x3<T, P> const & x) - { - char const * PrefixStr = prefix<T>::value(); - char const * LiteralStr = literal<T, std::numeric_limits<T>::is_iec559>::value(); - std::string FormatStr(detail::format("%smat4x3((%s, %s, %s), (%s, %s, %s), (%s, %s, %s), (%s, %s, %s))", - PrefixStr, - LiteralStr, LiteralStr, LiteralStr, - LiteralStr, LiteralStr, LiteralStr, - LiteralStr, LiteralStr, LiteralStr, - LiteralStr, LiteralStr, LiteralStr)); - - return detail::format(FormatStr.c_str(), - x[0][0], x[0][1], x[0][2], - x[1][0], x[1][1], x[1][2], - x[2][0], x[2][1], x[2][2], - x[3][0], x[3][1], x[3][2]); - } - }; - - template <typename T, precision P> - struct compute_to_string<tmat4x4, T, P> - { - GLM_FUNC_QUALIFIER static std::string call(tmat4x4<T, P> const & x) - { - char const * PrefixStr = prefix<T>::value(); - char const * LiteralStr = literal<T, std::numeric_limits<T>::is_iec559>::value(); - std::string FormatStr(detail::format("%smat4x4((%s, %s, %s, %s), (%s, %s, %s, %s), (%s, %s, %s, %s), (%s, %s, %s, %s))", - PrefixStr, - LiteralStr, LiteralStr, LiteralStr, LiteralStr, - LiteralStr, LiteralStr, LiteralStr, LiteralStr, - LiteralStr, LiteralStr, LiteralStr, LiteralStr, - LiteralStr, LiteralStr, LiteralStr, LiteralStr)); - - return detail::format(FormatStr.c_str(), - x[0][0], x[0][1], x[0][2], x[0][3], - x[1][0], x[1][1], x[1][2], x[1][3], - x[2][0], x[2][1], x[2][2], x[2][3], - x[3][0], x[3][1], x[3][2], x[3][3]); - } - }; -}//namespace detail - -template <template <typename, precision> class matType, typename T, precision P> -GLM_FUNC_DECL std::string to_string(matType<T, P> const & x) -{ - return detail::compute_to_string<matType, T, P>::call(x); -} - -}//namespace glm diff --git a/extensions/common/glm/gtx/transform.hpp b/extensions/common/glm/gtx/transform.hpp deleted file mode 100644 index c5836aebbfc..00000000000 --- a/extensions/common/glm/gtx/transform.hpp +++ /dev/null @@ -1,85 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_transform -/// @file glm/gtx/transform.hpp -/// @date 2005-12-21 / 2011-06-07 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// @see gtc_matrix_transform (dependence) -/// @see gtx_transform -/// @see gtx_transform2 -/// -/// @defgroup gtx_transform GLM_GTX_transform -/// @ingroup gtx -/// -/// @brief Add transformation matrices -/// -/// <glm/gtx/transform.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependency: -#include "../glm.hpp" -#include "../gtc/matrix_transform.hpp" - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTX_transform extension included") -#endif - -namespace glm -{ - /// @addtogroup gtx_transform - /// @{ - - /// Transforms a matrix with a translation 4 * 4 matrix created from 3 scalars. - /// @see gtc_matrix_transform - /// @see gtx_transform - template <typename T, precision P> - GLM_FUNC_DECL tmat4x4<T, P> translate( - tvec3<T, P> const & v); - - /// Builds a rotation 4 * 4 matrix created from an axis of 3 scalars and an angle expressed in degrees. - /// @see gtc_matrix_transform - /// @see gtx_transform - template <typename T, precision P> - GLM_FUNC_DECL tmat4x4<T, P> rotate( - T angle, - tvec3<T, P> const & v); - - /// Transforms a matrix with a scale 4 * 4 matrix created from a vector of 3 components. - /// @see gtc_matrix_transform - /// @see gtx_transform - template <typename T, precision P> - GLM_FUNC_DECL tmat4x4<T, P> scale( - tvec3<T, P> const & v); - - /// @} -}// namespace glm - -#include "transform.inl" diff --git a/extensions/common/glm/gtx/transform.inl b/extensions/common/glm/gtx/transform.inl deleted file mode 100644 index 832a4ca5caa..00000000000 --- a/extensions/common/glm/gtx/transform.inl +++ /dev/null @@ -1,60 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_transform -/// @file glm/gtx/transform.inl -/// @date 2005-12-21 / 2011-06-07 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P> translate( - tvec3<T, P> const & v) - { - return translate( - tmat4x4<T, P>(1.0f), v); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P> rotate( - T angle, - tvec3<T, P> const & v) - { - return rotate( - tmat4x4<T, P>(1), angle, v); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P> scale( - tvec3<T, P> const & v) - { - return scale( - tmat4x4<T, P>(1.0f), v); - } - -}//namespace glm diff --git a/extensions/common/glm/gtx/transform2.hpp b/extensions/common/glm/gtx/transform2.hpp deleted file mode 100644 index 97cd71fdd06..00000000000 --- a/extensions/common/glm/gtx/transform2.hpp +++ /dev/null @@ -1,136 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_transform2 -/// @file glm/gtx/transform2.hpp -/// @date 2005-12-21 / 2011-06-07 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// @see gtx_transform (dependence) -/// -/// @defgroup gtx_transform2 GLM_GTX_transform2 -/// @ingroup gtx -/// -/// @brief Add extra transformation matrices -/// -/// <glm/gtx/transform2.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependency: -#include "../glm.hpp" -#include "../gtx/transform.hpp" - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTX_transform2 extension included") -#endif - -namespace glm -{ - /// @addtogroup gtx_transform2 - /// @{ - - //! Transforms a matrix with a shearing on X axis. - //! From GLM_GTX_transform2 extension. - template <typename T, precision P> - GLM_FUNC_DECL tmat3x3<T, P> shearX2D( - tmat3x3<T, P> const & m, - T y); - - //! Transforms a matrix with a shearing on Y axis. - //! From GLM_GTX_transform2 extension. - template <typename T, precision P> - GLM_FUNC_DECL tmat3x3<T, P> shearY2D( - tmat3x3<T, P> const & m, - T x); - - //! Transforms a matrix with a shearing on X axis - //! From GLM_GTX_transform2 extension. - template <typename T, precision P> - GLM_FUNC_DECL tmat4x4<T, P> shearX3D( - const tmat4x4<T, P> & m, - T y, - T z); - - //! Transforms a matrix with a shearing on Y axis. - //! From GLM_GTX_transform2 extension. - template <typename T, precision P> - GLM_FUNC_DECL tmat4x4<T, P> shearY3D( - const tmat4x4<T, P> & m, - T x, - T z); - - //! Transforms a matrix with a shearing on Z axis. - //! From GLM_GTX_transform2 extension. - template <typename T, precision P> - GLM_FUNC_DECL tmat4x4<T, P> shearZ3D( - const tmat4x4<T, P> & m, - T x, - T y); - - //template <typename T> GLM_FUNC_QUALIFIER tmat4x4<T, P> shear(const tmat4x4<T, P> & m, shearPlane, planePoint, angle) - // Identity + tan(angle) * cross(Normal, OnPlaneVector) 0 - // - dot(PointOnPlane, normal) * OnPlaneVector 1 - - // Reflect functions seem to don't work - //template <typename T> tmat3x3<T, P> reflect2D(const tmat3x3<T, P> & m, const tvec3<T, P>& normal){return reflect2DGTX(m, normal);} //!< \brief Build a reflection matrix (from GLM_GTX_transform2 extension) - //template <typename T> tmat4x4<T, P> reflect3D(const tmat4x4<T, P> & m, const tvec3<T, P>& normal){return reflect3DGTX(m, normal);} //!< \brief Build a reflection matrix (from GLM_GTX_transform2 extension) - - //! Build planar projection matrix along normal axis. - //! From GLM_GTX_transform2 extension. - template <typename T, precision P> - GLM_FUNC_DECL tmat3x3<T, P> proj2D( - const tmat3x3<T, P> & m, - const tvec3<T, P>& normal); - - //! Build planar projection matrix along normal axis. - //! From GLM_GTX_transform2 extension. - template <typename T, precision P> - GLM_FUNC_DECL tmat4x4<T, P> proj3D( - const tmat4x4<T, P> & m, - const tvec3<T, P>& normal); - - //! Build a scale bias matrix. - //! From GLM_GTX_transform2 extension. - template <typename valType, precision P> - GLM_FUNC_DECL tmat4x4<valType, P> scaleBias( - valType scale, - valType bias); - - //! Build a scale bias matrix. - //! From GLM_GTX_transform2 extension. - template <typename valType, precision P> - GLM_FUNC_DECL tmat4x4<valType, P> scaleBias( - tmat4x4<valType, P> const & m, - valType scale, - valType bias); - - /// @} -}// namespace glm - -#include "transform2.inl" diff --git a/extensions/common/glm/gtx/transform2.inl b/extensions/common/glm/gtx/transform2.inl deleted file mode 100644 index 102093b1a40..00000000000 --- a/extensions/common/glm/gtx/transform2.inl +++ /dev/null @@ -1,177 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_transform2 -/// @file glm/gtx/transform2.inl -/// @date 2005-12-21 / 2011-06-07 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x3<T, P> shearX2D( - const tmat3x3<T, P>& m, - T s) - { - tmat3x3<T, P> r(1); - r[0][1] = s; - return m * r; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x3<T, P> shearY2D( - const tmat3x3<T, P>& m, - T s) - { - tmat3x3<T, P> r(1); - r[1][0] = s; - return m * r; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P> shearX3D( - const tmat4x4<T, P>& m, - T s, - T t) - { - tmat4x4<T, P> r(1); - r[1][0] = s; - r[2][0] = t; - return m * r; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P> shearY3D( - const tmat4x4<T, P>& m, - T s, - T t) - { - tmat4x4<T, P> r(1); - r[0][1] = s; - r[2][1] = t; - return m * r; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P> shearZ3D( - const tmat4x4<T, P>& m, - T s, - T t) - { - tmat4x4<T, P> r(1); - r[0][2] = s; - r[1][2] = t; - return m * r; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x3<T, P> reflect2D( - const tmat3x3<T, P>& m, - const tvec3<T, P>& normal) - { - tmat3x3<T, P> r(1); - r[0][0] = 1 - 2 * normal.x * normal.x; - r[0][1] = -2 * normal.x * normal.y; - r[1][0] = -2 * normal.x * normal.y; - r[1][1] = 1 - 2 * normal.y * normal.y; - return m * r; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P> reflect3D( - const tmat4x4<T, P>& m, - const tvec3<T, P>& normal) - { - tmat4x4<T, P> r(1); - r[0][0] = 1 - 2 * normal.x * normal.x; - r[0][1] = -2 * normal.x * normal.y; - r[0][2] = -2 * normal.x * normal.z; - - r[1][0] = -2 * normal.x * normal.y; - r[1][1] = 1 - 2 * normal.y * normal.y; - r[1][2] = -2 * normal.y * normal.z; - - r[2][0] = -2 * normal.x * normal.z; - r[2][1] = -2 * normal.y * normal.z; - r[2][2] = 1 - 2 * normal.z * normal.z; - return m * r; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat3x3<T, P> proj2D( - const tmat3x3<T, P>& m, - const tvec3<T, P>& normal) - { - tmat3x3<T, P> r(1); - r[0][0] = 1 - normal.x * normal.x; - r[0][1] = - normal.x * normal.y; - r[1][0] = - normal.x * normal.y; - r[1][1] = 1 - normal.y * normal.y; - return m * r; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P> proj3D( - const tmat4x4<T, P>& m, - const tvec3<T, P>& normal) - { - tmat4x4<T, P> r(1); - r[0][0] = 1 - normal.x * normal.x; - r[0][1] = - normal.x * normal.y; - r[0][2] = - normal.x * normal.z; - r[1][0] = - normal.x * normal.y; - r[1][1] = 1 - normal.y * normal.y; - r[1][2] = - normal.y * normal.z; - r[2][0] = - normal.x * normal.z; - r[2][1] = - normal.y * normal.z; - r[2][2] = 1 - normal.z * normal.z; - return m * r; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P> scaleBias( - T scale, - T bias) - { - tmat4x4<T, P> result; - result[3] = tvec4<T, P>(tvec3<T, P>(bias), T(1)); - result[0][0] = scale; - result[1][1] = scale; - result[2][2] = scale; - return result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tmat4x4<T, P> scaleBias( - const tmat4x4<T, P>& m, - T scale, - T bias) - { - return m * scaleBias(scale, bias); - } -}//namespace glm - diff --git a/extensions/common/glm/gtx/type_aligned.hpp b/extensions/common/glm/gtx/type_aligned.hpp deleted file mode 100644 index 1a052e8104f..00000000000 --- a/extensions/common/glm/gtx/type_aligned.hpp +++ /dev/null @@ -1,995 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_type_aligned -/// @file glm/gtx/type_aligned.hpp -/// @date 2014-11-23 / 2014-12-23 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// @see gtc_quaternion (dependence) -/// -/// @defgroup gtx_type_aligned GLM_GTX_type_aligned -/// @ingroup gtx -/// -/// @brief Defines aligned types. -/// -/// @ref core_precision defines aligned types. -/// -/// <glm/gtx/type_aligned.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependency: -#include "../gtc/type_precision.hpp" - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTX_type_aligned extension included") -#endif - -namespace glm -{ - /////////////////////////// - // Signed int vector types - - /// @addtogroup gtx_type_aligned - /// @{ - - /// Low precision 8 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(lowp_int8, aligned_lowp_int8, 1); - - /// Low precision 16 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(lowp_int16, aligned_lowp_int16, 2); - - /// Low precision 32 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(lowp_int32, aligned_lowp_int32, 4); - - /// Low precision 64 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(lowp_int64, aligned_lowp_int64, 8); - - - /// Low precision 8 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(lowp_int8_t, aligned_lowp_int8_t, 1); - - /// Low precision 16 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(lowp_int16_t, aligned_lowp_int16_t, 2); - - /// Low precision 32 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(lowp_int32_t, aligned_lowp_int32_t, 4); - - /// Low precision 64 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(lowp_int64_t, aligned_lowp_int64_t, 8); - - - /// Low precision 8 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(lowp_i8, aligned_lowp_i8, 1); - - /// Low precision 16 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(lowp_i16, aligned_lowp_i16, 2); - - /// Low precision 32 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(lowp_i32, aligned_lowp_i32, 4); - - /// Low precision 64 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(lowp_i64, aligned_lowp_i64, 8); - - - /// Medium precision 8 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(mediump_int8, aligned_mediump_int8, 1); - - /// Medium precision 16 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(mediump_int16, aligned_mediump_int16, 2); - - /// Medium precision 32 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(mediump_int32, aligned_mediump_int32, 4); - - /// Medium precision 64 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(mediump_int64, aligned_mediump_int64, 8); - - - /// Medium precision 8 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(mediump_int8_t, aligned_mediump_int8_t, 1); - - /// Medium precision 16 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(mediump_int16_t, aligned_mediump_int16_t, 2); - - /// Medium precision 32 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(mediump_int32_t, aligned_mediump_int32_t, 4); - - /// Medium precision 64 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(mediump_int64_t, aligned_mediump_int64_t, 8); - - - /// Medium precision 8 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(mediump_i8, aligned_mediump_i8, 1); - - /// Medium precision 16 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(mediump_i16, aligned_mediump_i16, 2); - - /// Medium precision 32 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(mediump_i32, aligned_mediump_i32, 4); - - /// Medium precision 64 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(mediump_i64, aligned_mediump_i64, 8); - - - /// High precision 8 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(highp_int8, aligned_highp_int8, 1); - - /// High precision 16 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(highp_int16, aligned_highp_int16, 2); - - /// High precision 32 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(highp_int32, aligned_highp_int32, 4); - - /// High precision 64 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(highp_int64, aligned_highp_int64, 8); - - - /// High precision 8 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(highp_int8_t, aligned_highp_int8_t, 1); - - /// High precision 16 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(highp_int16_t, aligned_highp_int16_t, 2); - - /// High precision 32 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(highp_int32_t, aligned_highp_int32_t, 4); - - /// High precision 64 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(highp_int64_t, aligned_highp_int64_t, 8); - - - /// High precision 8 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(highp_i8, aligned_highp_i8, 1); - - /// High precision 16 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(highp_i16, aligned_highp_i16, 2); - - /// High precision 32 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(highp_i32, aligned_highp_i32, 4); - - /// High precision 64 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(highp_i64, aligned_highp_i64, 8); - - - /// Default precision 8 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(int8, aligned_int8, 1); - - /// Default precision 16 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(int16, aligned_int16, 2); - - /// Default precision 32 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(int32, aligned_int32, 4); - - /// Default precision 64 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(int64, aligned_int64, 8); - - - /// Default precision 8 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(int8_t, aligned_int8_t, 1); - - /// Default precision 16 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(int16_t, aligned_int16_t, 2); - - /// Default precision 32 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(int32_t, aligned_int32_t, 4); - - /// Default precision 64 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(int64_t, aligned_int64_t, 8); - - - /// Default precision 8 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(i8, aligned_i8, 1); - - /// Default precision 16 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(i16, aligned_i16, 2); - - /// Default precision 32 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(i32, aligned_i32, 4); - - /// Default precision 64 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(i64, aligned_i64, 8); - - - /// Default precision 32 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(ivec1, aligned_ivec1, 4); - - /// Default precision 32 bit signed integer aligned vector of 2 components type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(ivec2, aligned_ivec2, 8); - - /// Default precision 32 bit signed integer aligned vector of 3 components type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(ivec3, aligned_ivec3, 16); - - /// Default precision 32 bit signed integer aligned vector of 4 components type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(ivec4, aligned_ivec4, 16); - - - /// Default precision 8 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(i8vec1, aligned_i8vec1, 1); - - /// Default precision 8 bit signed integer aligned vector of 2 components type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(i8vec2, aligned_i8vec2, 2); - - /// Default precision 8 bit signed integer aligned vector of 3 components type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(i8vec3, aligned_i8vec3, 4); - - /// Default precision 8 bit signed integer aligned vector of 4 components type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(i8vec4, aligned_i8vec4, 4); - - - /// Default precision 16 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(i16vec1, aligned_i16vec1, 2); - - /// Default precision 16 bit signed integer aligned vector of 2 components type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(i16vec2, aligned_i16vec2, 4); - - /// Default precision 16 bit signed integer aligned vector of 3 components type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(i16vec3, aligned_i16vec3, 8); - - /// Default precision 16 bit signed integer aligned vector of 4 components type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(i16vec4, aligned_i16vec4, 8); - - - /// Default precision 32 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(i32vec1, aligned_i32vec1, 4); - - /// Default precision 32 bit signed integer aligned vector of 2 components type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(i32vec2, aligned_i32vec2, 8); - - /// Default precision 32 bit signed integer aligned vector of 3 components type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(i32vec3, aligned_i32vec3, 16); - - /// Default precision 32 bit signed integer aligned vector of 4 components type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(i32vec4, aligned_i32vec4, 16); - - - /// Default precision 64 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(i64vec1, aligned_i64vec1, 8); - - /// Default precision 64 bit signed integer aligned vector of 2 components type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(i64vec2, aligned_i64vec2, 16); - - /// Default precision 64 bit signed integer aligned vector of 3 components type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(i64vec3, aligned_i64vec3, 32); - - /// Default precision 64 bit signed integer aligned vector of 4 components type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(i64vec4, aligned_i64vec4, 32); - - - ///////////////////////////// - // Unsigned int vector types - - /// Low precision 8 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(lowp_uint8, aligned_lowp_uint8, 1); - - /// Low precision 16 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(lowp_uint16, aligned_lowp_uint16, 2); - - /// Low precision 32 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(lowp_uint32, aligned_lowp_uint32, 4); - - /// Low precision 64 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(lowp_uint64, aligned_lowp_uint64, 8); - - - /// Low precision 8 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(lowp_uint8_t, aligned_lowp_uint8_t, 1); - - /// Low precision 16 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(lowp_uint16_t, aligned_lowp_uint16_t, 2); - - /// Low precision 32 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(lowp_uint32_t, aligned_lowp_uint32_t, 4); - - /// Low precision 64 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(lowp_uint64_t, aligned_lowp_uint64_t, 8); - - - /// Low precision 8 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(lowp_u8, aligned_lowp_u8, 1); - - /// Low precision 16 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(lowp_u16, aligned_lowp_u16, 2); - - /// Low precision 32 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(lowp_u32, aligned_lowp_u32, 4); - - /// Low precision 64 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(lowp_u64, aligned_lowp_u64, 8); - - - /// Medium precision 8 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(mediump_uint8, aligned_mediump_uint8, 1); - - /// Medium precision 16 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(mediump_uint16, aligned_mediump_uint16, 2); - - /// Medium precision 32 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(mediump_uint32, aligned_mediump_uint32, 4); - - /// Medium precision 64 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(mediump_uint64, aligned_mediump_uint64, 8); - - - /// Medium precision 8 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(mediump_uint8_t, aligned_mediump_uint8_t, 1); - - /// Medium precision 16 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(mediump_uint16_t, aligned_mediump_uint16_t, 2); - - /// Medium precision 32 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(mediump_uint32_t, aligned_mediump_uint32_t, 4); - - /// Medium precision 64 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(mediump_uint64_t, aligned_mediump_uint64_t, 8); - - - /// Medium precision 8 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(mediump_u8, aligned_mediump_u8, 1); - - /// Medium precision 16 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(mediump_u16, aligned_mediump_u16, 2); - - /// Medium precision 32 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(mediump_u32, aligned_mediump_u32, 4); - - /// Medium precision 64 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(mediump_u64, aligned_mediump_u64, 8); - - - /// High precision 8 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(highp_uint8, aligned_highp_uint8, 1); - - /// High precision 16 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(highp_uint16, aligned_highp_uint16, 2); - - /// High precision 32 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(highp_uint32, aligned_highp_uint32, 4); - - /// High precision 64 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(highp_uint64, aligned_highp_uint64, 8); - - - /// High precision 8 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(highp_uint8_t, aligned_highp_uint8_t, 1); - - /// High precision 16 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(highp_uint16_t, aligned_highp_uint16_t, 2); - - /// High precision 32 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(highp_uint32_t, aligned_highp_uint32_t, 4); - - /// High precision 64 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(highp_uint64_t, aligned_highp_uint64_t, 8); - - - /// High precision 8 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(highp_u8, aligned_highp_u8, 1); - - /// High precision 16 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(highp_u16, aligned_highp_u16, 2); - - /// High precision 32 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(highp_u32, aligned_highp_u32, 4); - - /// High precision 64 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(highp_u64, aligned_highp_u64, 8); - - - /// Default precision 8 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(uint8, aligned_uint8, 1); - - /// Default precision 16 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(uint16, aligned_uint16, 2); - - /// Default precision 32 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(uint32, aligned_uint32, 4); - - /// Default precision 64 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(uint64, aligned_uint64, 8); - - - /// Default precision 8 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(uint8_t, aligned_uint8_t, 1); - - /// Default precision 16 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(uint16_t, aligned_uint16_t, 2); - - /// Default precision 32 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(uint32_t, aligned_uint32_t, 4); - - /// Default precision 64 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(uint64_t, aligned_uint64_t, 8); - - - /// Default precision 8 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(u8, aligned_u8, 1); - - /// Default precision 16 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(u16, aligned_u16, 2); - - /// Default precision 32 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(u32, aligned_u32, 4); - - /// Default precision 64 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(u64, aligned_u64, 8); - - - /// Default precision 32 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(uvec1, aligned_uvec1, 4); - - /// Default precision 32 bit unsigned integer aligned vector of 2 components type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(uvec2, aligned_uvec2, 8); - - /// Default precision 32 bit unsigned integer aligned vector of 3 components type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(uvec3, aligned_uvec3, 16); - - /// Default precision 32 bit unsigned integer aligned vector of 4 components type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(uvec4, aligned_uvec4, 16); - - - /// Default precision 8 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(u8vec1, aligned_u8vec1, 1); - - /// Default precision 8 bit unsigned integer aligned vector of 2 components type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(u8vec2, aligned_u8vec2, 2); - - /// Default precision 8 bit unsigned integer aligned vector of 3 components type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(u8vec3, aligned_u8vec3, 4); - - /// Default precision 8 bit unsigned integer aligned vector of 4 components type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(u8vec4, aligned_u8vec4, 4); - - - /// Default precision 16 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(u16vec1, aligned_u16vec1, 2); - - /// Default precision 16 bit unsigned integer aligned vector of 2 components type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(u16vec2, aligned_u16vec2, 4); - - /// Default precision 16 bit unsigned integer aligned vector of 3 components type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(u16vec3, aligned_u16vec3, 8); - - /// Default precision 16 bit unsigned integer aligned vector of 4 components type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(u16vec4, aligned_u16vec4, 8); - - - /// Default precision 32 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(u32vec1, aligned_u32vec1, 4); - - /// Default precision 32 bit unsigned integer aligned vector of 2 components type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(u32vec2, aligned_u32vec2, 8); - - /// Default precision 32 bit unsigned integer aligned vector of 3 components type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(u32vec3, aligned_u32vec3, 16); - - /// Default precision 32 bit unsigned integer aligned vector of 4 components type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(u32vec4, aligned_u32vec4, 16); - - - /// Default precision 64 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(u64vec1, aligned_u64vec1, 8); - - /// Default precision 64 bit unsigned integer aligned vector of 2 components type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(u64vec2, aligned_u64vec2, 16); - - /// Default precision 64 bit unsigned integer aligned vector of 3 components type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(u64vec3, aligned_u64vec3, 32); - - /// Default precision 64 bit unsigned integer aligned vector of 4 components type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(u64vec4, aligned_u64vec4, 32); - - - ////////////////////// - // Float vector types - - /// 32 bit single-precision floating-point aligned scalar. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(float32, aligned_float32, 4); - - /// 64 bit double-precision floating-point aligned scalar. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(float64, aligned_float64, 8); - - - /// 32 bit single-precision floating-point aligned scalar. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(float32_t, aligned_float32_t, 4); - - /// 64 bit double-precision floating-point aligned scalar. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(float64_t, aligned_float64_t, 8); - - - /// 32 bit single-precision floating-point aligned scalar. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(float32, aligned_f32, 4); - - /// 64 bit double-precision floating-point aligned scalar. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(float64, aligned_f64, 8); - - - /// Single-precision floating-point aligned vector of 1 component. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(vec1, aligned_vec1, 4); - - /// Single-precision floating-point aligned vector of 2 components. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(vec2, aligned_vec2, 8); - - /// Single-precision floating-point aligned vector of 3 components. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(vec3, aligned_vec3, 16); - - /// Single-precision floating-point aligned vector of 4 components. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(vec4, aligned_vec4, 16); - - - /// Single-precision floating-point aligned vector of 1 component. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(fvec1, aligned_fvec1, 4); - - /// Single-precision floating-point aligned vector of 2 components. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(fvec2, aligned_fvec2, 8); - - /// Single-precision floating-point aligned vector of 3 components. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(fvec3, aligned_fvec3, 16); - - /// Single-precision floating-point aligned vector of 4 components. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(fvec4, aligned_fvec4, 16); - - - /// Single-precision floating-point aligned vector of 1 component. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f32vec1, aligned_f32vec1, 4); - - /// Single-precision floating-point aligned vector of 2 components. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f32vec2, aligned_f32vec2, 8); - - /// Single-precision floating-point aligned vector of 3 components. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f32vec3, aligned_f32vec3, 16); - - /// Single-precision floating-point aligned vector of 4 components. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f32vec4, aligned_f32vec4, 16); - - - /// Double-precision floating-point aligned vector of 1 component. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(dvec1, aligned_dvec1, 8); - - /// Double-precision floating-point aligned vector of 2 components. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(dvec2, aligned_dvec2, 16); - - /// Double-precision floating-point aligned vector of 3 components. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(dvec3, aligned_dvec3, 32); - - /// Double-precision floating-point aligned vector of 4 components. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(dvec4, aligned_dvec4, 32); - - - /// Double-precision floating-point aligned vector of 1 component. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f64vec1, aligned_f64vec1, 8); - - /// Double-precision floating-point aligned vector of 2 components. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f64vec2, aligned_f64vec2, 16); - - /// Double-precision floating-point aligned vector of 3 components. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f64vec3, aligned_f64vec3, 32); - - /// Double-precision floating-point aligned vector of 4 components. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f64vec4, aligned_f64vec4, 32); - - - ////////////////////// - // Float matrix types - - /// Single-precision floating-point aligned 1x1 matrix. - /// @see gtx_type_aligned - //typedef detail::tmat1<f32> mat1; - - /// Single-precision floating-point aligned 2x2 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(mat2, aligned_mat2, 16); - - /// Single-precision floating-point aligned 3x3 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(mat3, aligned_mat3, 16); - - /// Single-precision floating-point aligned 4x4 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(mat4, aligned_mat4, 16); - - - /// Single-precision floating-point aligned 1x1 matrix. - /// @see gtx_type_aligned - //typedef detail::tmat1x1<f32> mat1; - - /// Single-precision floating-point aligned 2x2 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(mat2x2, aligned_mat2x2, 16); - - /// Single-precision floating-point aligned 3x3 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(mat3x3, aligned_mat3x3, 16); - - /// Single-precision floating-point aligned 4x4 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(mat4x4, aligned_mat4x4, 16); - - - /// Single-precision floating-point aligned 1x1 matrix. - /// @see gtx_type_aligned - //typedef detail::tmat1x1<f32> fmat1; - - /// Single-precision floating-point aligned 2x2 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(fmat2x2, aligned_fmat2, 16); - - /// Single-precision floating-point aligned 3x3 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(fmat3x3, aligned_fmat3, 16); - - /// Single-precision floating-point aligned 4x4 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(fmat4x4, aligned_fmat4, 16); - - - /// Single-precision floating-point aligned 1x1 matrix. - /// @see gtx_type_aligned - //typedef f32 fmat1x1; - - /// Single-precision floating-point aligned 2x2 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(fmat2x2, aligned_fmat2x2, 16); - - /// Single-precision floating-point aligned 2x3 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(fmat2x3, aligned_fmat2x3, 16); - - /// Single-precision floating-point aligned 2x4 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(fmat2x4, aligned_fmat2x4, 16); - - /// Single-precision floating-point aligned 3x2 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(fmat3x2, aligned_fmat3x2, 16); - - /// Single-precision floating-point aligned 3x3 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(fmat3x3, aligned_fmat3x3, 16); - - /// Single-precision floating-point aligned 3x4 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(fmat3x4, aligned_fmat3x4, 16); - - /// Single-precision floating-point aligned 4x2 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(fmat4x2, aligned_fmat4x2, 16); - - /// Single-precision floating-point aligned 4x3 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(fmat4x3, aligned_fmat4x3, 16); - - /// Single-precision floating-point aligned 4x4 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(fmat4x4, aligned_fmat4x4, 16); - - - /// Single-precision floating-point aligned 1x1 matrix. - /// @see gtx_type_aligned - //typedef detail::tmat1x1<f32, defaultp> f32mat1; - - /// Single-precision floating-point aligned 2x2 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f32mat2x2, aligned_f32mat2, 16); - - /// Single-precision floating-point aligned 3x3 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f32mat3x3, aligned_f32mat3, 16); - - /// Single-precision floating-point aligned 4x4 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f32mat4x4, aligned_f32mat4, 16); - - - /// Single-precision floating-point aligned 1x1 matrix. - /// @see gtx_type_aligned - //typedef f32 f32mat1x1; - - /// Single-precision floating-point aligned 2x2 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f32mat2x2, aligned_f32mat2x2, 16); - - /// Single-precision floating-point aligned 2x3 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f32mat2x3, aligned_f32mat2x3, 16); - - /// Single-precision floating-point aligned 2x4 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f32mat2x4, aligned_f32mat2x4, 16); - - /// Single-precision floating-point aligned 3x2 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f32mat3x2, aligned_f32mat3x2, 16); - - /// Single-precision floating-point aligned 3x3 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f32mat3x3, aligned_f32mat3x3, 16); - - /// Single-precision floating-point aligned 3x4 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f32mat3x4, aligned_f32mat3x4, 16); - - /// Single-precision floating-point aligned 4x2 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f32mat4x2, aligned_f32mat4x2, 16); - - /// Single-precision floating-point aligned 4x3 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f32mat4x3, aligned_f32mat4x3, 16); - - /// Single-precision floating-point aligned 4x4 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f32mat4x4, aligned_f32mat4x4, 16); - - - /// Double-precision floating-point aligned 1x1 matrix. - /// @see gtx_type_aligned - //typedef detail::tmat1x1<f64, defaultp> f64mat1; - - /// Double-precision floating-point aligned 2x2 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f64mat2x2, aligned_f64mat2, 32); - - /// Double-precision floating-point aligned 3x3 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f64mat3x3, aligned_f64mat3, 32); - - /// Double-precision floating-point aligned 4x4 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f64mat4x4, aligned_f64mat4, 32); - - - /// Double-precision floating-point aligned 1x1 matrix. - /// @see gtx_type_aligned - //typedef f64 f64mat1x1; - - /// Double-precision floating-point aligned 2x2 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f64mat2x2, aligned_f64mat2x2, 32); - - /// Double-precision floating-point aligned 2x3 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f64mat2x3, aligned_f64mat2x3, 32); - - /// Double-precision floating-point aligned 2x4 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f64mat2x4, aligned_f64mat2x4, 32); - - /// Double-precision floating-point aligned 3x2 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f64mat3x2, aligned_f64mat3x2, 32); - - /// Double-precision floating-point aligned 3x3 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f64mat3x3, aligned_f64mat3x3, 32); - - /// Double-precision floating-point aligned 3x4 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f64mat3x4, aligned_f64mat3x4, 32); - - /// Double-precision floating-point aligned 4x2 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f64mat4x2, aligned_f64mat4x2, 32); - - /// Double-precision floating-point aligned 4x3 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f64mat4x3, aligned_f64mat4x3, 32); - - /// Double-precision floating-point aligned 4x4 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f64mat4x4, aligned_f64mat4x4, 32); - - - ////////////////////////// - // Quaternion types - - /// Single-precision floating-point aligned quaternion. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(quat, aligned_quat, 16); - - /// Single-precision floating-point aligned quaternion. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(fquat, aligned_fquat, 16); - - /// Double-precision floating-point aligned quaternion. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(dquat, aligned_dquat, 32); - - /// Single-precision floating-point aligned quaternion. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f32quat, aligned_f32quat, 16); - - /// Double-precision floating-point aligned quaternion. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f64quat, aligned_f64quat, 32); - - /// @} -}//namespace glm - -#include "type_aligned.inl" diff --git a/extensions/common/glm/gtx/type_aligned.inl b/extensions/common/glm/gtx/type_aligned.inl deleted file mode 100644 index 5e755f020dd..00000000000 --- a/extensions/common/glm/gtx/type_aligned.inl +++ /dev/null @@ -1,36 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtc_type_aligned -/// @file glm/gtc/type_aligned.inl -/// @date 2014-11-23 / 2014-11-23 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - -} diff --git a/extensions/common/glm/gtx/vector_angle.hpp b/extensions/common/glm/gtx/vector_angle.hpp deleted file mode 100644 index 42ebeba4d0e..00000000000 --- a/extensions/common/glm/gtx/vector_angle.hpp +++ /dev/null @@ -1,89 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_vector_angle -/// @file glm/gtx/vector_angle.hpp -/// @date 2005-12-30 / 2011-06-07 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// @see gtx_quaternion (dependence) -/// @see gtx_epsilon (dependence) -/// -/// @defgroup gtx_vector_angle GLM_GTX_vector_angle -/// @ingroup gtx -/// -/// @brief Compute angle between vectors -/// -/// <glm/gtx/vector_angle.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependency: -#include "../glm.hpp" -#include "../gtc/epsilon.hpp" -#include "../gtx/quaternion.hpp" -#include "../gtx/rotate_vector.hpp" - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTX_vector_angle extension included") -#endif - -namespace glm -{ - /// @addtogroup gtx_vector_angle - /// @{ - - //! Returns the absolute angle between two vectors - //! Parameters need to be normalized. - /// @see gtx_vector_angle extension - template <typename vecType> - GLM_FUNC_DECL typename vecType::value_type angle( - vecType const & x, - vecType const & y); - - //! Returns the oriented angle between two 2d vectors - //! Parameters need to be normalized. - /// @see gtx_vector_angle extension. - template <typename T, precision P> - GLM_FUNC_DECL T orientedAngle( - tvec2<T, P> const & x, - tvec2<T, P> const & y); - - //! Returns the oriented angle between two 3d vectors based from a reference axis. - //! Parameters need to be normalized. - /// @see gtx_vector_angle extension. - template <typename T, precision P> - GLM_FUNC_DECL T orientedAngle( - tvec3<T, P> const & x, - tvec3<T, P> const & y, - tvec3<T, P> const & ref); - - /// @} -}// namespace glm - -#include "vector_angle.inl" diff --git a/extensions/common/glm/gtx/vector_angle.inl b/extensions/common/glm/gtx/vector_angle.inl deleted file mode 100644 index ba5fdd49d65..00000000000 --- a/extensions/common/glm/gtx/vector_angle.inl +++ /dev/null @@ -1,87 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_vector_angle -/// @file glm/gtx/vector_angle.inl -/// @date 2005-12-30 / 2011-06-07 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template <typename genType> - GLM_FUNC_QUALIFIER genType angle - ( - genType const & x, - genType const & y - ) - { - GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'angle' only accept floating-point inputs"); - return acos(clamp(dot(x, y), genType(-1), genType(1))); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER T angle - ( - vecType<T, P> const & x, - vecType<T, P> const & y - ) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'angle' only accept floating-point inputs"); - return acos(clamp(dot(x, y), T(-1), T(1))); - } - - //! \todo epsilon is hard coded to 0.01 - template <typename T, precision P> - GLM_FUNC_QUALIFIER T orientedAngle - ( - tvec2<T, P> const & x, - tvec2<T, P> const & y - ) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'orientedAngle' only accept floating-point inputs"); - T const Angle(acos(clamp(dot(x, y), T(-1), T(1)))); - - if(all(epsilonEqual(y, glm::rotate(x, Angle), T(0.0001)))) - return Angle; - else - return -Angle; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER T orientedAngle - ( - tvec3<T, P> const & x, - tvec3<T, P> const & y, - tvec3<T, P> const & ref - ) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'orientedAngle' only accept floating-point inputs"); - - T const Angle(acos(clamp(dot(x, y), T(-1), T(1)))); - return mix(Angle, -Angle, dot(ref, cross(x, y)) < T(0)); - } -}//namespace glm diff --git a/extensions/common/glm/gtx/vector_query.hpp b/extensions/common/glm/gtx/vector_query.hpp deleted file mode 100644 index 164be3c573f..00000000000 --- a/extensions/common/glm/gtx/vector_query.hpp +++ /dev/null @@ -1,91 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_vector_query -/// @file glm/gtx/vector_query.hpp -/// @date 2008-03-10 / 2011-06-07 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// -/// @defgroup gtx_vector_query GLM_GTX_vector_query -/// @ingroup gtx -/// -/// @brief Query informations of vector types -/// -/// <glm/gtx/vector_query.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependency: -#include "../glm.hpp" -#include <cfloat> -#include <limits> - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTX_vector_query extension included") -#endif - -namespace glm -{ - /// @addtogroup gtx_vector_query - /// @{ - - //! Check whether two vectors are collinears. - /// @see gtx_vector_query extensions. - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL bool areCollinear(vecType<T, P> const & v0, vecType<T, P> const & v1, T const & epsilon); - - //! Check whether two vectors are orthogonals. - /// @see gtx_vector_query extensions. - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL bool areOrthogonal(vecType<T, P> const & v0, vecType<T, P> const & v1, T const & epsilon); - - //! Check whether a vector is normalized. - /// @see gtx_vector_query extensions. - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL bool isNormalized(vecType<T, P> const & v, T const & epsilon); - - //! Check whether a vector is null. - /// @see gtx_vector_query extensions. - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL bool isNull(vecType<T, P> const & v, T const & epsilon); - - //! Check whether a each component of a vector is null. - /// @see gtx_vector_query extensions. - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL vecType<bool, P> isCompNull(vecType<T, P> const & v, T const & epsilon); - - //! Check whether two vectors are orthonormal. - /// @see gtx_vector_query extensions. - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_DECL bool areOrthonormal(vecType<T, P> const & v0, vecType<T, P> const & v1, T const & epsilon); - - /// @} -}// namespace glm - -#include "vector_query.inl" diff --git a/extensions/common/glm/gtx/vector_query.inl b/extensions/common/glm/gtx/vector_query.inl deleted file mode 100644 index e7b0cb14282..00000000000 --- a/extensions/common/glm/gtx/vector_query.inl +++ /dev/null @@ -1,222 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_vector_query -/// @file glm/gtx/vector_query.inl -/// @date 2008-03-10 / 2011-06-07 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#include <cassert> - -namespace glm{ -namespace detail -{ - template <typename T, precision P, template <typename, precision> class vecType> - struct compute_areCollinear{}; - - template <typename T, precision P> - struct compute_areCollinear<T, P, tvec2> - { - GLM_FUNC_QUALIFIER static bool call(tvec2<T, P> const & v0, tvec2<T, P> const & v1, T const & epsilon) - { - return length(cross(tvec3<T, P>(v0, static_cast<T>(0)), tvec3<T, P>(v1, static_cast<T>(0)))) < epsilon; - } - }; - - template <typename T, precision P> - struct compute_areCollinear<T, P, tvec3> - { - GLM_FUNC_QUALIFIER static bool call(tvec3<T, P> const & v0, tvec3<T, P> const & v1, T const & epsilon) - { - return length(cross(v0, v1)) < epsilon; - } - }; - - template <typename T, precision P> - struct compute_areCollinear<T, P, tvec4> - { - GLM_FUNC_QUALIFIER static bool call(tvec4<T, P> const & v0, tvec4<T, P> const & v1, T const & epsilon) - { - return length(cross(tvec3<T, P>(v0), tvec3<T, P>(v1))) < epsilon; - } - }; - - template <typename T, precision P, template <typename, precision> class vecType> - struct compute_isCompNull{}; - - template <typename T, precision P> - struct compute_isCompNull<T, P, tvec2> - { - GLM_FUNC_QUALIFIER static tvec2<bool, P> call(tvec2<T, P> const & v, T const & epsilon) - { - return tvec2<bool, P>( - (abs(v.x) < epsilon), - (abs(v.y) < epsilon)); - } - }; - - template <typename T, precision P> - struct compute_isCompNull<T, P, tvec3> - { - GLM_FUNC_QUALIFIER static tvec3<bool, P> call(tvec3<T, P> const & v, T const & epsilon) - { - return tvec3<bool, P>( - (abs(v.x) < epsilon), - (abs(v.y) < epsilon), - (abs(v.z) < epsilon)); - } - }; - - template <typename T, precision P> - struct compute_isCompNull<T, P, tvec4> - { - GLM_FUNC_QUALIFIER static tvec4<bool, P> call(tvec4<T, P> const & v, T const & epsilon) - { - return tvec4<bool, P>( - (abs(v.x) < epsilon), - (abs(v.y) < epsilon), - (abs(v.z) < epsilon), - (abs(v.w) < epsilon)); - } - }; - -}//namespace detail - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER bool areCollinear - ( - vecType<T, P> const & v0, - vecType<T, P> const & v1, - T const & epsilon - ) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'areCollinear' only accept floating-point inputs"); - - return detail::compute_areCollinear<T, P, vecType>::call(v0, v1, epsilon); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER bool areOrthogonal - ( - vecType<T, P> const & v0, - vecType<T, P> const & v1, - T const & epsilon - ) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'areOrthogonal' only accept floating-point inputs"); - - return abs(dot(v0, v1)) <= max( - static_cast<T>(1), - length(v0)) * max(static_cast<T>(1), length(v1)) * epsilon; - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER bool isNormalized - ( - vecType<T, P> const & v, - T const & epsilon - ) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'isNormalized' only accept floating-point inputs"); - - return abs(length(v) - static_cast<T>(1)) <= static_cast<T>(2) * epsilon; - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER bool isNull - ( - vecType<T, P> const & v, - T const & epsilon - ) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'isNull' only accept floating-point inputs"); - - return length(v) <= epsilon; - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<bool, P> isCompNull - ( - vecType<T, P> const & v, - T const & epsilon - ) - { - GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'isCompNull' only accept floating-point inputs"); - - return detail::compute_isCompNull<T, P, vecType>::call(v, epsilon); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<bool, P> isCompNull - ( - tvec2<T, P> const & v, - T const & epsilon) - { - return tvec2<bool, P>( - abs(v.x) < epsilon, - abs(v.y) < epsilon); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<bool, P> isCompNull - ( - tvec3<T, P> const & v, - T const & epsilon - ) - { - return tvec3<bool, P>( - abs(v.x) < epsilon, - abs(v.y) < epsilon, - abs(v.z) < epsilon); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<bool, P> isCompNull - ( - tvec4<T, P> const & v, - T const & epsilon - ) - { - return tvec4<bool, P>( - abs(v.x) < epsilon, - abs(v.y) < epsilon, - abs(v.z) < epsilon, - abs(v.w) < epsilon); - } - - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER bool areOrthonormal - ( - vecType<T, P> const & v0, - vecType<T, P> const & v1, - T const & epsilon - ) - { - return isNormalized(v0, epsilon) && isNormalized(v1, epsilon) && (abs(dot(v0, v1)) <= epsilon); - } - -}//namespace glm diff --git a/extensions/common/glm/gtx/wrap.hpp b/extensions/common/glm/gtx/wrap.hpp deleted file mode 100644 index 021728268be..00000000000 --- a/extensions/common/glm/gtx/wrap.hpp +++ /dev/null @@ -1,74 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_wrap -/// @file glm/gtx/wrap.hpp -/// @date 2009-11-25 / 2011-06-07 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// -/// @defgroup gtx_wrap GLM_GTX_wrap -/// @ingroup gtx -/// -/// @brief Wrapping mode of texture coordinates. -/// -/// <glm/gtx/wrap.hpp> need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependency: -#include "../glm.hpp" - -#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTX_wrap extension included") -#endif - -namespace glm -{ - /// @addtogroup gtx_wrap - /// @{ - - /// Simulate GL_CLAMP OpenGL wrap mode - /// @see gtx_wrap extension. - template <typename genType> - GLM_FUNC_DECL genType clamp(genType const & Texcoord); - - /// Simulate GL_REPEAT OpenGL wrap mode - /// @see gtx_wrap extension. - template <typename genType> - GLM_FUNC_DECL genType repeat(genType const & Texcoord); - - /// Simulate GL_MIRROR_REPEAT OpenGL wrap mode - /// @see gtx_wrap extension. - template <typename genType> - GLM_FUNC_DECL genType mirrorRepeat(genType const & Texcoord); - - /// @} -}// namespace glm - -#include "wrap.inl" diff --git a/extensions/common/glm/gtx/wrap.inl b/extensions/common/glm/gtx/wrap.inl deleted file mode 100644 index 5cd084ead85..00000000000 --- a/extensions/common/glm/gtx/wrap.inl +++ /dev/null @@ -1,185 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_wrap -/// @file glm/gtx/wrap.inl -/// @date 2009-11-25 / 2011-06-07 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template <typename genType> - GLM_FUNC_QUALIFIER genType clamp - ( - genType const & Texcoord - ) - { - return glm::clamp(Texcoord, genType(0), genType(1)); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> clamp - ( - tvec2<T, P> const & Texcoord - ) - { - tvec2<T, P> Result; - for(typename tvec2<T, P>::size_type i = 0; i < tvec2<T, P>::value_size(); ++i) - Result[i] = clamp(Texcoord[i]); - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> clamp - ( - tvec3<T, P> const & Texcoord - ) - { - tvec3<T, P> Result; - for(typename tvec3<T, P>::size_type i = 0; i < tvec3<T, P>::value_size(); ++i) - Result[i] = clamp(Texcoord[i]); - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> clamp - ( - tvec4<T, P> const & Texcoord - ) - { - tvec4<T, P> Result; - for(typename tvec4<T, P>::size_type i = 0; i < tvec4<T, P>::value_size(); ++i) - Result[i] = clamp(Texcoord[i]); - return Result; - } - - //////////////////////// - // repeat - - template <typename genType> - GLM_FUNC_QUALIFIER genType repeat - ( - genType const & Texcoord - ) - { - return glm::fract(Texcoord); - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> repeat - ( - tvec2<T, P> const & Texcoord - ) - { - tvec2<T, P> Result; - for(typename tvec2<T, P>::size_type i = 0; i < tvec2<T, P>::value_size(); ++i) - Result[i] = repeat(Texcoord[i]); - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> repeat - ( - tvec3<T, P> const & Texcoord - ) - { - tvec3<T, P> Result; - for(typename tvec3<T, P>::size_type i = 0; i < tvec3<T, P>::value_size(); ++i) - Result[i] = repeat(Texcoord[i]); - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> repeat - ( - tvec4<T, P> const & Texcoord - ) - { - tvec4<T, P> Result; - for(typename tvec4<T, P>::size_type i = 0; i < tvec4<T, P>::value_size(); ++i) - Result[i] = repeat(Texcoord[i]); - return Result; - } - - //////////////////////// - // mirrorRepeat - - template <typename genType, precision P> - GLM_FUNC_QUALIFIER genType mirrorRepeat - ( - genType const & Texcoord - ) - { - genType const Clamp = genType(int(glm::floor(Texcoord)) % 2); - genType const Floor = glm::floor(Texcoord); - genType const Rest = Texcoord - Floor; - genType const Mirror = Clamp + Rest; - - genType Out; - if(Mirror >= genType(1)) - Out = genType(1) - Rest; - else - Out = Rest; - return Out; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec2<T, P> mirrorRepeat - ( - tvec2<T, P> const & Texcoord - ) - { - tvec2<T, P> Result; - for(typename tvec2<T, P>::size_type i = 0; i < tvec2<T, P>::value_size(); ++i) - Result[i] = mirrorRepeat(Texcoord[i]); - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec3<T, P> mirrorRepeat - ( - tvec3<T, P> const & Texcoord - ) - { - tvec3<T, P> Result; - for(typename tvec3<T, P>::size_type i = 0; i < tvec3<T, P>::value_size(); ++i) - Result[i] = mirrorRepeat(Texcoord[i]); - return Result; - } - - template <typename T, precision P> - GLM_FUNC_QUALIFIER tvec4<T, P> mirrorRepeat - ( - tvec4<T, P> const & Texcoord - ) - { - tvec4<T, P> Result; - for(typename tvec4<T, P>::size_type i = 0; i < tvec4<T, P>::value_size(); ++i) - Result[i] = mirrorRepeat(Texcoord[i]); - return Result; - } -}//namespace glm diff --git a/extensions/common/glm/integer.hpp b/extensions/common/glm/integer.hpp deleted file mode 100644 index a049d8d80dc..00000000000 --- a/extensions/common/glm/integer.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/integer.hpp -/// @date 2013-12-24 / 2013-12-24 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "detail/func_integer.hpp" diff --git a/extensions/common/glm/mat2x2.hpp b/extensions/common/glm/mat2x2.hpp deleted file mode 100644 index c22a1cdf26d..00000000000 --- a/extensions/common/glm/mat2x2.hpp +++ /dev/null @@ -1,81 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/mat2x2.hpp -/// @date 2013-12-24 / 2013-12-24 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "detail/type_mat2x2.hpp" - -namespace glm -{ - /// 2 columns of 2 components matrix of low precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat2x2<float, lowp> lowp_mat2; - - /// 2 columns of 2 components matrix of medium precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat2x2<float, mediump> mediump_mat2; - - /// 2 columns of 2 components matrix of high precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat2x2<float, highp> highp_mat2; - - /// 2 columns of 2 components matrix of low precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat2x2<float, lowp> lowp_mat2x2; - - /// 2 columns of 2 components matrix of medium precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat2x2<float, mediump> mediump_mat2x2; - - /// 2 columns of 2 components matrix of high precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat2x2<float, highp> highp_mat2x2; - -}//namespace glm diff --git a/extensions/common/glm/mat2x3.hpp b/extensions/common/glm/mat2x3.hpp deleted file mode 100644 index 6c5a76429c1..00000000000 --- a/extensions/common/glm/mat2x3.hpp +++ /dev/null @@ -1,61 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/mat2x3.hpp -/// @date 2013-12-24 / 2013-12-24 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "detail/type_mat2x3.hpp" - -namespace glm -{ - /// 2 columns of 3 components matrix of low precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat2x3<float, lowp> lowp_mat2x3; - - /// 2 columns of 3 components matrix of medium precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat2x3<float, mediump> mediump_mat2x3; - - /// 2 columns of 3 components matrix of high precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat2x3<float, highp> highp_mat2x3; - -}//namespace glm - diff --git a/extensions/common/glm/mat2x4.hpp b/extensions/common/glm/mat2x4.hpp deleted file mode 100644 index 2e95e9498a5..00000000000 --- a/extensions/common/glm/mat2x4.hpp +++ /dev/null @@ -1,60 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/mat2x4.hpp -/// @date 2013-12-24 / 2013-12-24 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "detail/type_mat2x4.hpp" - -namespace glm -{ - /// 2 columns of 4 components matrix of low precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat2x4<float, lowp> lowp_mat2x4; - - /// 2 columns of 4 components matrix of medium precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat2x4<float, mediump> mediump_mat2x4; - - /// 2 columns of 4 components matrix of high precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat2x4<float, highp> highp_mat2x4; - -}//namespace glm diff --git a/extensions/common/glm/mat3x2.hpp b/extensions/common/glm/mat3x2.hpp deleted file mode 100644 index c4b4c129b4d..00000000000 --- a/extensions/common/glm/mat3x2.hpp +++ /dev/null @@ -1,60 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/mat3x2.hpp -/// @date 2013-12-24 / 2013-12-24 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "detail/type_mat3x2.hpp" - -namespace glm -{ - /// 3 columns of 2 components matrix of low precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat3x2<float, lowp> lowp_mat3x2; - - /// 3 columns of 2 components matrix of medium precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat3x2<float, mediump> mediump_mat3x2; - - /// 3 columns of 2 components matrix of high precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat3x2<float, highp> highp_mat3x2; - -}//namespace diff --git a/extensions/common/glm/mat3x3.hpp b/extensions/common/glm/mat3x3.hpp deleted file mode 100644 index ad30792f00d..00000000000 --- a/extensions/common/glm/mat3x3.hpp +++ /dev/null @@ -1,81 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/mat3x3.hpp -/// @date 2013-12-24 / 2013-12-24 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "detail/type_mat3x3.hpp" - -namespace glm -{ - /// 3 columns of 3 components matrix of low precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat3x3<float, lowp> lowp_mat3; - - /// 3 columns of 3 components matrix of medium precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat3x3<float, mediump> mediump_mat3; - - /// 3 columns of 3 components matrix of high precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat3x3<float, highp> highp_mat3; - - /// 3 columns of 3 components matrix of low precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat3x3<float, lowp> lowp_mat3x3; - - /// 3 columns of 3 components matrix of medium precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat3x3<float, mediump> mediump_mat3x3; - - /// 3 columns of 3 components matrix of high precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat3x3<float, highp> highp_mat3x3; - -}//namespace glm diff --git a/extensions/common/glm/mat3x4.hpp b/extensions/common/glm/mat3x4.hpp deleted file mode 100644 index 8c1f8928da5..00000000000 --- a/extensions/common/glm/mat3x4.hpp +++ /dev/null @@ -1,60 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/mat3x4.hpp -/// @date 2013-12-24 / 2013-12-24 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "detail/type_mat3x4.hpp" - -namespace glm -{ - /// 3 columns of 4 components matrix of low precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat3x4<float, lowp> lowp_mat3x4; - - /// 3 columns of 4 components matrix of medium precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat3x4<float, mediump> mediump_mat3x4; - - /// 3 columns of 4 components matrix of high precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat3x4<float, highp> highp_mat3x4; - -}//namespace glm diff --git a/extensions/common/glm/mat4x2.hpp b/extensions/common/glm/mat4x2.hpp deleted file mode 100644 index 26c70f52b20..00000000000 --- a/extensions/common/glm/mat4x2.hpp +++ /dev/null @@ -1,60 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/mat4x2.hpp -/// @date 2013-12-24 / 2013-12-24 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "detail/type_mat4x2.hpp" - -namespace glm -{ - /// 4 columns of 2 components matrix of low precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat4x2<float, lowp> lowp_mat4x2; - - /// 4 columns of 2 components matrix of medium precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat4x2<float, mediump> mediump_mat4x2; - - /// 4 columns of 2 components matrix of high precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat4x2<float, highp> highp_mat4x2; - -}//namespace glm diff --git a/extensions/common/glm/mat4x3.hpp b/extensions/common/glm/mat4x3.hpp deleted file mode 100644 index df82778c284..00000000000 --- a/extensions/common/glm/mat4x3.hpp +++ /dev/null @@ -1,60 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/mat4x4.hpp -/// @date 2013-12-24 / 2013-12-24 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "detail/type_mat4x3.hpp" - -namespace glm -{ - /// 4 columns of 3 components matrix of low precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat4x3<float, lowp> lowp_mat4x3; - - /// 4 columns of 3 components matrix of medium precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat4x3<float, mediump> mediump_mat4x3; - - /// 4 columns of 3 components matrix of high precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat4x3<float, highp> highp_mat4x3; - -}//namespace glm diff --git a/extensions/common/glm/mat4x4.hpp b/extensions/common/glm/mat4x4.hpp deleted file mode 100644 index e21c7a0fa74..00000000000 --- a/extensions/common/glm/mat4x4.hpp +++ /dev/null @@ -1,81 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/mat4x4.hpp -/// @date 2013-12-24 / 2013-12-24 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "detail/type_mat4x4.hpp" - -namespace glm -{ - /// 4 columns of 4 components matrix of low precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat4x4<float, lowp> lowp_mat4; - - /// 4 columns of 4 components matrix of medium precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat4x4<float, mediump> mediump_mat4; - - /// 4 columns of 4 components matrix of high precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat4x4<float, highp> highp_mat4; - - /// 4 columns of 4 components matrix of low precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat4x4<float, lowp> lowp_mat4x4; - - /// 4 columns of 4 components matrix of medium precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat4x4<float, mediump> mediump_mat4x4; - - /// 4 columns of 4 components matrix of high precision floating-point numbers. - /// There is no guarantee on the actual precision. - /// - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> - /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> - typedef tmat4x4<float, highp> highp_mat4x4; - -}//namespace glm diff --git a/extensions/common/glm/matrix.hpp b/extensions/common/glm/matrix.hpp deleted file mode 100644 index e0464042758..00000000000 --- a/extensions/common/glm/matrix.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/matrix.hpp -/// @date 2013-12-24 / 2013-12-24 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "detail/func_matrix.hpp" diff --git a/extensions/common/glm/packing.hpp b/extensions/common/glm/packing.hpp deleted file mode 100644 index 55337db3db0..00000000000 --- a/extensions/common/glm/packing.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/packing.hpp -/// @date 2013-12-24 / 2013-12-24 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "detail/func_packing.hpp" diff --git a/extensions/common/glm/trigonometric.hpp b/extensions/common/glm/trigonometric.hpp deleted file mode 100644 index 0ecfe3b359f..00000000000 --- a/extensions/common/glm/trigonometric.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/trigonometric.hpp -/// @date 2013-12-24 / 2013-12-24 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "detail/func_trigonometric.hpp" diff --git a/extensions/common/glm/vec2.hpp b/extensions/common/glm/vec2.hpp deleted file mode 100644 index 65c87c2ab51..00000000000 --- a/extensions/common/glm/vec2.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/vec2.hpp -/// @date 2013-12-24 / 2013-12-24 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "detail/type_vec2.hpp" diff --git a/extensions/common/glm/vec3.hpp b/extensions/common/glm/vec3.hpp deleted file mode 100644 index 761d7a612ef..00000000000 --- a/extensions/common/glm/vec3.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/vec3.hpp -/// @date 2013-12-24 / 2013-12-24 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "detail/type_vec3.hpp" diff --git a/extensions/common/glm/vec4.hpp b/extensions/common/glm/vec4.hpp deleted file mode 100644 index e1575138b72..00000000000 --- a/extensions/common/glm/vec4.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/vec4.hpp -/// @date 2013-12-24 / 2013-12-24 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "detail/type_vec4.hpp" diff --git a/extensions/common/glm/vector_relational.hpp b/extensions/common/glm/vector_relational.hpp deleted file mode 100644 index 9747de9d108..00000000000 --- a/extensions/common/glm/vector_relational.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/vector_relational.hpp -/// @date 2013-12-24 / 2013-12-24 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "detail/func_vector_relational.hpp" diff --git a/extensions/common/lzoconf.h b/extensions/common/lzoconf.h deleted file mode 100644 index 64ef27934b5..00000000000 --- a/extensions/common/lzoconf.h +++ /dev/null @@ -1,453 +0,0 @@ -/* lzoconf.h -- configuration of the LZO data compression library - - This file is part of the LZO real-time data compression library. - - Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer - All Rights Reserved. - - The LZO library is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of - the License, or (at your option) any later version. - - The LZO library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with the LZO library; see the file COPYING. - If not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - Markus F.X.J. Oberhumer - <markus@oberhumer.com> - http://www.oberhumer.com/opensource/lzo/ - */ - - -#ifndef __LZOCONF_H_INCLUDED -#define __LZOCONF_H_INCLUDED 1 - -#define LZO_VERSION 0x2090 -#define LZO_VERSION_STRING "2.09" -#define LZO_VERSION_DATE "Feb 04 2015" - -/* internal Autoconf configuration file - only used when building LZO */ -#if defined(LZO_HAVE_CONFIG_H) -# include <config.h> -#endif -#include <limits.h> -#include <stddef.h> - - -/*********************************************************************** -// LZO requires a conforming <limits.h> -************************************************************************/ - -#if !defined(CHAR_BIT) || (CHAR_BIT != 8) -# error "invalid CHAR_BIT" -#endif -#if !defined(UCHAR_MAX) || !defined(USHRT_MAX) || !defined(UINT_MAX) || !defined(ULONG_MAX) -# error "check your compiler installation" -#endif -#if (USHRT_MAX < 1) || (UINT_MAX < 1) || (ULONG_MAX < 1) -# error "your limits.h macros are broken" -#endif - -/* get OS and architecture defines */ -#ifndef __LZODEFS_H_INCLUDED -#include <lzo/lzodefs.h> -#endif - - -#ifdef __cplusplus -extern "C" { -#endif - - -/*********************************************************************** -// some core defines -************************************************************************/ - -/* memory checkers */ -#if !defined(__LZO_CHECKER) -# if defined(__BOUNDS_CHECKING_ON) -# define __LZO_CHECKER 1 -# elif defined(__CHECKER__) -# define __LZO_CHECKER 1 -# elif defined(__INSURE__) -# define __LZO_CHECKER 1 -# elif defined(__PURIFY__) -# define __LZO_CHECKER 1 -# endif -#endif - - -/*********************************************************************** -// integral and pointer types -************************************************************************/ - -/* lzo_uint must match size_t */ -#if !defined(LZO_UINT_MAX) -# if (LZO_ABI_LLP64) -# if (LZO_OS_WIN64) - typedef unsigned __int64 lzo_uint; - typedef __int64 lzo_int; -# define LZO_TYPEOF_LZO_INT LZO_TYPEOF___INT64 -# else - typedef lzo_ullong_t lzo_uint; - typedef lzo_llong_t lzo_int; -# define LZO_TYPEOF_LZO_INT LZO_TYPEOF_LONG_LONG -# endif -# define LZO_SIZEOF_LZO_INT 8 -# define LZO_UINT_MAX 0xffffffffffffffffull -# define LZO_INT_MAX 9223372036854775807LL -# define LZO_INT_MIN (-1LL - LZO_INT_MAX) -# elif (LZO_ABI_IP32L64) /* MIPS R5900 */ - typedef unsigned int lzo_uint; - typedef int lzo_int; -# define LZO_SIZEOF_LZO_INT LZO_SIZEOF_INT -# define LZO_TYPEOF_LZO_INT LZO_TYPEOF_INT -# define LZO_UINT_MAX UINT_MAX -# define LZO_INT_MAX INT_MAX -# define LZO_INT_MIN INT_MIN -# elif (ULONG_MAX >= LZO_0xffffffffL) - typedef unsigned long lzo_uint; - typedef long lzo_int; -# define LZO_SIZEOF_LZO_INT LZO_SIZEOF_LONG -# define LZO_TYPEOF_LZO_INT LZO_TYPEOF_LONG -# define LZO_UINT_MAX ULONG_MAX -# define LZO_INT_MAX LONG_MAX -# define LZO_INT_MIN LONG_MIN -# else -# error "lzo_uint" -# endif -#endif - -/* The larger type of lzo_uint and lzo_uint32_t. */ -#if (LZO_SIZEOF_LZO_INT >= 4) -# define lzo_xint lzo_uint -#else -# define lzo_xint lzo_uint32_t -#endif - -typedef int lzo_bool; - -/* sanity checks */ -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int) == LZO_SIZEOF_LZO_INT) -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint) == LZO_SIZEOF_LZO_INT) -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_xint) >= sizeof(lzo_uint)) -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_xint) >= sizeof(lzo_uint32_t)) - -#ifndef __LZO_MMODEL -#define __LZO_MMODEL /*empty*/ -#endif - -/* no typedef here because of const-pointer issues */ -#define lzo_bytep unsigned char __LZO_MMODEL * -#define lzo_charp char __LZO_MMODEL * -#define lzo_voidp void __LZO_MMODEL * -#define lzo_shortp short __LZO_MMODEL * -#define lzo_ushortp unsigned short __LZO_MMODEL * -#define lzo_intp lzo_int __LZO_MMODEL * -#define lzo_uintp lzo_uint __LZO_MMODEL * -#define lzo_xintp lzo_xint __LZO_MMODEL * -#define lzo_voidpp lzo_voidp __LZO_MMODEL * -#define lzo_bytepp lzo_bytep __LZO_MMODEL * - -#define lzo_int8_tp lzo_int8_t __LZO_MMODEL * -#define lzo_uint8_tp lzo_uint8_t __LZO_MMODEL * -#define lzo_int16_tp lzo_int16_t __LZO_MMODEL * -#define lzo_uint16_tp lzo_uint16_t __LZO_MMODEL * -#define lzo_int32_tp lzo_int32_t __LZO_MMODEL * -#define lzo_uint32_tp lzo_uint32_t __LZO_MMODEL * -#if defined(lzo_int64_t) -#define lzo_int64_tp lzo_int64_t __LZO_MMODEL * -#define lzo_uint64_tp lzo_uint64_t __LZO_MMODEL * -#endif - -/* Older LZO versions used to support ancient systems and memory models - * such as 16-bit MSDOS with __huge pointers or Cray PVP, but these - * obsolete configurations are not supported any longer. - */ -#if defined(__LZO_MMODEL_HUGE) -#error "__LZO_MMODEL_HUGE memory model is unsupported" -#endif -#if (LZO_MM_PVP) -#error "LZO_MM_PVP memory model is unsupported" -#endif -#if (LZO_SIZEOF_INT < 4) -#error "LZO_SIZEOF_INT < 4 is unsupported" -#endif -#if (__LZO_UINTPTR_T_IS_POINTER) -#error "__LZO_UINTPTR_T_IS_POINTER is unsupported" -#endif -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(int) >= 4) -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint) >= 4) -/* Strange configurations where sizeof(lzo_uint) != sizeof(size_t) should - * work but have not received much testing lately, so be strict here. - */ -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint) == sizeof(size_t)) -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint) == sizeof(ptrdiff_t)) -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint) == sizeof(lzo_uintptr_t)) -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(void *) == sizeof(lzo_uintptr_t)) -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(char *) == sizeof(lzo_uintptr_t)) -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(long *) == sizeof(lzo_uintptr_t)) -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(void *) == sizeof(lzo_voidp)) -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(char *) == sizeof(lzo_bytep)) - - -/*********************************************************************** -// function types -************************************************************************/ - -/* name mangling */ -#if !defined(__LZO_EXTERN_C) -# ifdef __cplusplus -# define __LZO_EXTERN_C extern "C" -# else -# define __LZO_EXTERN_C extern -# endif -#endif - -/* calling convention */ -#if !defined(__LZO_CDECL) -# define __LZO_CDECL __lzo_cdecl -#endif - -/* DLL export information */ -#if !defined(__LZO_EXPORT1) -# define __LZO_EXPORT1 /*empty*/ -#endif -#if !defined(__LZO_EXPORT2) -# define __LZO_EXPORT2 /*empty*/ -#endif - -/* __cdecl calling convention for public C and assembly functions */ -#if !defined(LZO_PUBLIC) -# define LZO_PUBLIC(r) __LZO_EXPORT1 r __LZO_EXPORT2 __LZO_CDECL -#endif -#if !defined(LZO_EXTERN) -# define LZO_EXTERN(r) __LZO_EXTERN_C LZO_PUBLIC(r) -#endif -#if !defined(LZO_PRIVATE) -# define LZO_PRIVATE(r) static r __LZO_CDECL -#endif - -/* function types */ -typedef int -(__LZO_CDECL *lzo_compress_t) ( const lzo_bytep src, lzo_uint src_len, - lzo_bytep dst, lzo_uintp dst_len, - lzo_voidp wrkmem ); - -typedef int -(__LZO_CDECL *lzo_decompress_t) ( const lzo_bytep src, lzo_uint src_len, - lzo_bytep dst, lzo_uintp dst_len, - lzo_voidp wrkmem ); - -typedef int -(__LZO_CDECL *lzo_optimize_t) ( lzo_bytep src, lzo_uint src_len, - lzo_bytep dst, lzo_uintp dst_len, - lzo_voidp wrkmem ); - -typedef int -(__LZO_CDECL *lzo_compress_dict_t)(const lzo_bytep src, lzo_uint src_len, - lzo_bytep dst, lzo_uintp dst_len, - lzo_voidp wrkmem, - const lzo_bytep dict, lzo_uint dict_len ); - -typedef int -(__LZO_CDECL *lzo_decompress_dict_t)(const lzo_bytep src, lzo_uint src_len, - lzo_bytep dst, lzo_uintp dst_len, - lzo_voidp wrkmem, - const lzo_bytep dict, lzo_uint dict_len ); - - -/* Callback interface. Currently only the progress indicator ("nprogress") - * is used, but this may change in a future release. */ - -struct lzo_callback_t; -typedef struct lzo_callback_t lzo_callback_t; -#define lzo_callback_p lzo_callback_t __LZO_MMODEL * - -/* malloc & free function types */ -typedef lzo_voidp (__LZO_CDECL *lzo_alloc_func_t) - (lzo_callback_p self, lzo_uint items, lzo_uint size); -typedef void (__LZO_CDECL *lzo_free_func_t) - (lzo_callback_p self, lzo_voidp ptr); - -/* a progress indicator callback function */ -typedef void (__LZO_CDECL *lzo_progress_func_t) - (lzo_callback_p, lzo_uint, lzo_uint, int); - -struct lzo_callback_t -{ - /* custom allocators (set to 0 to disable) */ - lzo_alloc_func_t nalloc; /* [not used right now] */ - lzo_free_func_t nfree; /* [not used right now] */ - - /* a progress indicator callback function (set to 0 to disable) */ - lzo_progress_func_t nprogress; - - /* INFO: the first parameter "self" of the nalloc/nfree/nprogress - * callbacks points back to this struct, so you are free to store - * some extra info in the following variables. */ - lzo_voidp user1; - lzo_xint user2; - lzo_xint user3; -}; - - -/*********************************************************************** -// error codes and prototypes -************************************************************************/ - -/* Error codes for the compression/decompression functions. Negative - * values are errors, positive values will be used for special but - * normal events. - */ -#define LZO_E_OK 0 -#define LZO_E_ERROR (-1) -#define LZO_E_OUT_OF_MEMORY (-2) /* [lzo_alloc_func_t failure] */ -#define LZO_E_NOT_COMPRESSIBLE (-3) /* [not used right now] */ -#define LZO_E_INPUT_OVERRUN (-4) -#define LZO_E_OUTPUT_OVERRUN (-5) -#define LZO_E_LOOKBEHIND_OVERRUN (-6) -#define LZO_E_EOF_NOT_FOUND (-7) -#define LZO_E_INPUT_NOT_CONSUMED (-8) -#define LZO_E_NOT_YET_IMPLEMENTED (-9) /* [not used right now] */ -#define LZO_E_INVALID_ARGUMENT (-10) -#define LZO_E_INVALID_ALIGNMENT (-11) /* pointer argument is not properly aligned */ -#define LZO_E_OUTPUT_NOT_CONSUMED (-12) -#define LZO_E_INTERNAL_ERROR (-99) - - -#ifndef lzo_sizeof_dict_t -# define lzo_sizeof_dict_t ((unsigned)sizeof(lzo_bytep)) -#endif - -/* lzo_init() should be the first function you call. - * Check the return code ! - * - * lzo_init() is a macro to allow checking that the library and the - * compiler's view of various types are consistent. - */ -#define lzo_init() __lzo_init_v2(LZO_VERSION,(int)sizeof(short),(int)sizeof(int),\ - (int)sizeof(long),(int)sizeof(lzo_uint32_t),(int)sizeof(lzo_uint),\ - (int)lzo_sizeof_dict_t,(int)sizeof(char *),(int)sizeof(lzo_voidp),\ - (int)sizeof(lzo_callback_t)) -LZO_EXTERN(int) __lzo_init_v2(unsigned,int,int,int,int,int,int,int,int,int); - -/* version functions (useful for shared libraries) */ -LZO_EXTERN(unsigned) lzo_version(void); -LZO_EXTERN(const char *) lzo_version_string(void); -LZO_EXTERN(const char *) lzo_version_date(void); -LZO_EXTERN(const lzo_charp) _lzo_version_string(void); -LZO_EXTERN(const lzo_charp) _lzo_version_date(void); - -/* string functions */ -LZO_EXTERN(int) - lzo_memcmp(const lzo_voidp a, const lzo_voidp b, lzo_uint len); -LZO_EXTERN(lzo_voidp) - lzo_memcpy(lzo_voidp dst, const lzo_voidp src, lzo_uint len); -LZO_EXTERN(lzo_voidp) - lzo_memmove(lzo_voidp dst, const lzo_voidp src, lzo_uint len); -LZO_EXTERN(lzo_voidp) - lzo_memset(lzo_voidp buf, int c, lzo_uint len); - -/* checksum functions */ -LZO_EXTERN(lzo_uint32_t) - lzo_adler32(lzo_uint32_t c, const lzo_bytep buf, lzo_uint len); -LZO_EXTERN(lzo_uint32_t) - lzo_crc32(lzo_uint32_t c, const lzo_bytep buf, lzo_uint len); -LZO_EXTERN(const lzo_uint32_tp) - lzo_get_crc32_table(void); - -/* misc. */ -LZO_EXTERN(int) _lzo_config_check(void); -typedef union { - lzo_voidp a00; lzo_bytep a01; lzo_uint a02; lzo_xint a03; lzo_uintptr_t a04; - void *a05; unsigned char *a06; unsigned long a07; size_t a08; ptrdiff_t a09; -#if defined(lzo_int64_t) - lzo_uint64_t a10; -#endif -} lzo_align_t; - -/* align a char pointer on a boundary that is a multiple of 'size' */ -LZO_EXTERN(unsigned) __lzo_align_gap(const lzo_voidp p, lzo_uint size); -#define LZO_PTR_ALIGN_UP(p,size) \ - ((p) + (lzo_uint) __lzo_align_gap((const lzo_voidp)(p),(lzo_uint)(size))) - - -/*********************************************************************** -// deprecated macros - only for backward compatibility -************************************************************************/ - -/* deprecated - use 'lzo_bytep' instead of 'lzo_byte *' */ -#define lzo_byte unsigned char -/* deprecated type names */ -#define lzo_int32 lzo_int32_t -#define lzo_uint32 lzo_uint32_t -#define lzo_int32p lzo_int32_t __LZO_MMODEL * -#define lzo_uint32p lzo_uint32_t __LZO_MMODEL * -#define LZO_INT32_MAX LZO_INT32_C(2147483647) -#define LZO_UINT32_MAX LZO_UINT32_C(4294967295) -#if defined(lzo_int64_t) -#define lzo_int64 lzo_int64_t -#define lzo_uint64 lzo_uint64_t -#define lzo_int64p lzo_int64_t __LZO_MMODEL * -#define lzo_uint64p lzo_uint64_t __LZO_MMODEL * -#define LZO_INT64_MAX LZO_INT64_C(9223372036854775807) -#define LZO_UINT64_MAX LZO_UINT64_C(18446744073709551615) -#endif -/* deprecated types */ -typedef union { lzo_bytep a; lzo_uint b; } __lzo_pu_u; -typedef union { lzo_bytep a; lzo_uint32_t b; } __lzo_pu32_u; -/* deprecated defines */ -#if !defined(LZO_SIZEOF_LZO_UINT) -# define LZO_SIZEOF_LZO_UINT LZO_SIZEOF_LZO_INT -#endif - -#if defined(LZO_CFG_COMPAT) - -#define __LZOCONF_H 1 - -#if defined(LZO_ARCH_I086) -# define __LZO_i386 1 -#elif defined(LZO_ARCH_I386) -# define __LZO_i386 1 -#endif - -#if defined(LZO_OS_DOS16) -# define __LZO_DOS 1 -# define __LZO_DOS16 1 -#elif defined(LZO_OS_DOS32) -# define __LZO_DOS 1 -#elif defined(LZO_OS_WIN16) -# define __LZO_WIN 1 -# define __LZO_WIN16 1 -#elif defined(LZO_OS_WIN32) -# define __LZO_WIN 1 -#endif - -#define __LZO_CMODEL /*empty*/ -#define __LZO_DMODEL /*empty*/ -#define __LZO_ENTRY __LZO_CDECL -#define LZO_EXTERN_CDECL LZO_EXTERN -#define LZO_ALIGN LZO_PTR_ALIGN_UP - -#define lzo_compress_asm_t lzo_compress_t -#define lzo_decompress_asm_t lzo_decompress_t - -#endif /* LZO_CFG_COMPAT */ - - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* already included */ - - -/* vim:set ts=4 sw=4 et: */ diff --git a/extensions/common/lzodefs.h b/extensions/common/lzodefs.h deleted file mode 100644 index 1535c1e2057..00000000000 --- a/extensions/common/lzodefs.h +++ /dev/null @@ -1,3134 +0,0 @@ -/* lzodefs.h -- architecture, OS and compiler specific defines - - This file is part of the LZO real-time data compression library. - - Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer - All Rights Reserved. - - The LZO library is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of - the License, or (at your option) any later version. - - The LZO library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with the LZO library; see the file COPYING. - If not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - Markus F.X.J. Oberhumer - <markus@oberhumer.com> - http://www.oberhumer.com/opensource/lzo/ - */ - - -#ifndef __LZODEFS_H_INCLUDED -#define __LZODEFS_H_INCLUDED 1 - -#if defined(__CYGWIN32__) && !defined(__CYGWIN__) -# define __CYGWIN__ __CYGWIN32__ -#endif -#if 1 && defined(__INTERIX) && defined(__GNUC__) && !defined(_ALL_SOURCE) -# define _ALL_SOURCE 1 -#endif -#if defined(__mips__) && defined(__R5900__) -# if !defined(__LONG_MAX__) -# define __LONG_MAX__ 9223372036854775807L -# endif -#endif -#if !defined(LZO_CFG_NO_DISABLE_WUNDEF) -#if defined(__ARMCC_VERSION) -# pragma diag_suppress 193 -#elif defined(__clang__) && defined(__clang_minor__) -# pragma clang diagnostic ignored "-Wundef" -#elif defined(__INTEL_COMPILER) -# pragma warning(disable: 193) -#elif defined(__KEIL__) && defined(__C166__) -# pragma warning disable = 322 -#elif defined(__GNUC__) && defined(__GNUC_MINOR__) && !defined(__PATHSCALE__) -# if ((__GNUC__-0) >= 5 || ((__GNUC__-0) == 4 && (__GNUC_MINOR__-0) >= 2)) -# pragma GCC diagnostic ignored "-Wundef" -# endif -#elif defined(_MSC_VER) && !defined(__clang__) && !defined(__INTEL_COMPILER) && !defined(__MWERKS__) -# if ((_MSC_VER-0) >= 1300) -# pragma warning(disable: 4668) -# endif -#endif -#endif -#if 0 && defined(__POCC__) && defined(_WIN32) -# if (__POCC__ >= 400) -# pragma warn(disable: 2216) -# endif -#endif -#if 0 && defined(__WATCOMC__) -# if (__WATCOMC__ >= 1050) && (__WATCOMC__ < 1060) -# pragma warning 203 9 -# endif -#endif -#if defined(__BORLANDC__) && defined(__MSDOS__) && !defined(__FLAT__) -# pragma option -h -#endif -#if !(LZO_CFG_NO_DISABLE_WCRTNONSTDC) -#ifndef _CRT_NONSTDC_NO_DEPRECATE -#define _CRT_NONSTDC_NO_DEPRECATE 1 -#endif -#ifndef _CRT_NONSTDC_NO_WARNINGS -#define _CRT_NONSTDC_NO_WARNINGS 1 -#endif -#ifndef _CRT_SECURE_NO_DEPRECATE -#define _CRT_SECURE_NO_DEPRECATE 1 -#endif -#ifndef _CRT_SECURE_NO_WARNINGS -#define _CRT_SECURE_NO_WARNINGS 1 -#endif -#endif -#if 0 -#define LZO_0xffffUL 0xfffful -#define LZO_0xffffffffUL 0xfffffffful -#else -#define LZO_0xffffUL 65535ul -#define LZO_0xffffffffUL 4294967295ul -#endif -#define LZO_0xffffL LZO_0xffffUL -#define LZO_0xffffffffL LZO_0xffffffffUL -#if (LZO_0xffffL == LZO_0xffffffffL) -# error "your preprocessor is broken 1" -#endif -#if (16ul * 16384ul != 262144ul) -# error "your preprocessor is broken 2" -#endif -#if 0 -#if (32767 >= 4294967295ul) -# error "your preprocessor is broken 3" -#endif -#if (65535u >= 4294967295ul) -# error "your preprocessor is broken 4" -#endif -#endif -#if defined(__COUNTER__) -# ifndef LZO_CFG_USE_COUNTER -# define LZO_CFG_USE_COUNTER 1 -# endif -#else -# undef LZO_CFG_USE_COUNTER -#endif -#if (UINT_MAX == LZO_0xffffL) -#if defined(__ZTC__) && defined(__I86__) && !defined(__OS2__) -# if !defined(MSDOS) -# define MSDOS 1 -# endif -# if !defined(_MSDOS) -# define _MSDOS 1 -# endif -#elif 0 && defined(__VERSION) && defined(MB_LEN_MAX) -# if (__VERSION == 520) && (MB_LEN_MAX == 1) -# if !defined(__AZTEC_C__) -# define __AZTEC_C__ __VERSION -# endif -# if !defined(__DOS__) -# define __DOS__ 1 -# endif -# endif -#endif -#endif -#if defined(_MSC_VER) && defined(M_I86HM) && (UINT_MAX == LZO_0xffffL) -# define ptrdiff_t long -# define _PTRDIFF_T_DEFINED 1 -#endif -#if (UINT_MAX == LZO_0xffffL) -# undef __LZO_RENAME_A -# undef __LZO_RENAME_B -# if defined(__AZTEC_C__) && defined(__DOS__) -# define __LZO_RENAME_A 1 -# elif defined(_MSC_VER) && defined(MSDOS) -# if (_MSC_VER < 600) -# define __LZO_RENAME_A 1 -# elif (_MSC_VER < 700) -# define __LZO_RENAME_B 1 -# endif -# elif defined(__TSC__) && defined(__OS2__) -# define __LZO_RENAME_A 1 -# elif defined(__MSDOS__) && defined(__TURBOC__) && (__TURBOC__ < 0x0410) -# define __LZO_RENAME_A 1 -# elif defined(__PACIFIC__) && defined(DOS) -# if !defined(__far) -# define __far far -# endif -# if !defined(__near) -# define __near near -# endif -# endif -# if defined(__LZO_RENAME_A) -# if !defined(__cdecl) -# define __cdecl cdecl -# endif -# if !defined(__far) -# define __far far -# endif -# if !defined(__huge) -# define __huge huge -# endif -# if !defined(__near) -# define __near near -# endif -# if !defined(__pascal) -# define __pascal pascal -# endif -# if !defined(__huge) -# define __huge huge -# endif -# elif defined(__LZO_RENAME_B) -# if !defined(__cdecl) -# define __cdecl _cdecl -# endif -# if !defined(__far) -# define __far _far -# endif -# if !defined(__huge) -# define __huge _huge -# endif -# if !defined(__near) -# define __near _near -# endif -# if !defined(__pascal) -# define __pascal _pascal -# endif -# elif (defined(__PUREC__) || defined(__TURBOC__)) && defined(__TOS__) -# if !defined(__cdecl) -# define __cdecl cdecl -# endif -# if !defined(__pascal) -# define __pascal pascal -# endif -# endif -# undef __LZO_RENAME_A -# undef __LZO_RENAME_B -#endif -#if (UINT_MAX == LZO_0xffffL) -#if defined(__AZTEC_C__) && defined(__DOS__) -# define LZO_BROKEN_CDECL_ALT_SYNTAX 1 -#elif defined(_MSC_VER) && defined(MSDOS) -# if (_MSC_VER < 600) -# define LZO_BROKEN_INTEGRAL_CONSTANTS 1 -# endif -# if (_MSC_VER < 700) -# define LZO_BROKEN_INTEGRAL_PROMOTION 1 -# define LZO_BROKEN_SIZEOF 1 -# endif -#elif defined(__PACIFIC__) && defined(DOS) -# define LZO_BROKEN_INTEGRAL_CONSTANTS 1 -#elif defined(__TURBOC__) && defined(__MSDOS__) -# if (__TURBOC__ < 0x0150) -# define LZO_BROKEN_CDECL_ALT_SYNTAX 1 -# define LZO_BROKEN_INTEGRAL_CONSTANTS 1 -# define LZO_BROKEN_INTEGRAL_PROMOTION 1 -# endif -# if (__TURBOC__ < 0x0200) -# define LZO_BROKEN_SIZEOF 1 -# endif -# if (__TURBOC__ < 0x0400) && defined(__cplusplus) -# define LZO_BROKEN_CDECL_ALT_SYNTAX 1 -# endif -#elif (defined(__PUREC__) || defined(__TURBOC__)) && defined(__TOS__) -# define LZO_BROKEN_CDECL_ALT_SYNTAX 1 -# define LZO_BROKEN_SIZEOF 1 -#endif -#endif -#if defined(__WATCOMC__) && (__WATCOMC__ < 900) -# define LZO_BROKEN_INTEGRAL_CONSTANTS 1 -#endif -#if defined(_CRAY) && defined(_CRAY1) -# define LZO_BROKEN_SIGNED_RIGHT_SHIFT 1 -#endif -#define LZO_PP_STRINGIZE(x) #x -#define LZO_PP_MACRO_EXPAND(x) LZO_PP_STRINGIZE(x) -#define LZO_PP_CONCAT0() /*empty*/ -#define LZO_PP_CONCAT1(a) a -#define LZO_PP_CONCAT2(a,b) a ## b -#define LZO_PP_CONCAT3(a,b,c) a ## b ## c -#define LZO_PP_CONCAT4(a,b,c,d) a ## b ## c ## d -#define LZO_PP_CONCAT5(a,b,c,d,e) a ## b ## c ## d ## e -#define LZO_PP_CONCAT6(a,b,c,d,e,f) a ## b ## c ## d ## e ## f -#define LZO_PP_CONCAT7(a,b,c,d,e,f,g) a ## b ## c ## d ## e ## f ## g -#define LZO_PP_ECONCAT0() LZO_PP_CONCAT0() -#define LZO_PP_ECONCAT1(a) LZO_PP_CONCAT1(a) -#define LZO_PP_ECONCAT2(a,b) LZO_PP_CONCAT2(a,b) -#define LZO_PP_ECONCAT3(a,b,c) LZO_PP_CONCAT3(a,b,c) -#define LZO_PP_ECONCAT4(a,b,c,d) LZO_PP_CONCAT4(a,b,c,d) -#define LZO_PP_ECONCAT5(a,b,c,d,e) LZO_PP_CONCAT5(a,b,c,d,e) -#define LZO_PP_ECONCAT6(a,b,c,d,e,f) LZO_PP_CONCAT6(a,b,c,d,e,f) -#define LZO_PP_ECONCAT7(a,b,c,d,e,f,g) LZO_PP_CONCAT7(a,b,c,d,e,f,g) -#define LZO_PP_EMPTY /*empty*/ -#define LZO_PP_EMPTY0() /*empty*/ -#define LZO_PP_EMPTY1(a) /*empty*/ -#define LZO_PP_EMPTY2(a,b) /*empty*/ -#define LZO_PP_EMPTY3(a,b,c) /*empty*/ -#define LZO_PP_EMPTY4(a,b,c,d) /*empty*/ -#define LZO_PP_EMPTY5(a,b,c,d,e) /*empty*/ -#define LZO_PP_EMPTY6(a,b,c,d,e,f) /*empty*/ -#define LZO_PP_EMPTY7(a,b,c,d,e,f,g) /*empty*/ -#if 1 -#define LZO_CPP_STRINGIZE(x) #x -#define LZO_CPP_MACRO_EXPAND(x) LZO_CPP_STRINGIZE(x) -#define LZO_CPP_CONCAT2(a,b) a ## b -#define LZO_CPP_CONCAT3(a,b,c) a ## b ## c -#define LZO_CPP_CONCAT4(a,b,c,d) a ## b ## c ## d -#define LZO_CPP_CONCAT5(a,b,c,d,e) a ## b ## c ## d ## e -#define LZO_CPP_CONCAT6(a,b,c,d,e,f) a ## b ## c ## d ## e ## f -#define LZO_CPP_CONCAT7(a,b,c,d,e,f,g) a ## b ## c ## d ## e ## f ## g -#define LZO_CPP_ECONCAT2(a,b) LZO_CPP_CONCAT2(a,b) -#define LZO_CPP_ECONCAT3(a,b,c) LZO_CPP_CONCAT3(a,b,c) -#define LZO_CPP_ECONCAT4(a,b,c,d) LZO_CPP_CONCAT4(a,b,c,d) -#define LZO_CPP_ECONCAT5(a,b,c,d,e) LZO_CPP_CONCAT5(a,b,c,d,e) -#define LZO_CPP_ECONCAT6(a,b,c,d,e,f) LZO_CPP_CONCAT6(a,b,c,d,e,f) -#define LZO_CPP_ECONCAT7(a,b,c,d,e,f,g) LZO_CPP_CONCAT7(a,b,c,d,e,f,g) -#endif -#define __LZO_MASK_GEN(o,b) (((((o) << ((b)-!!(b))) - (o)) << 1) + (o)*!!(b)) -#if 1 && defined(__cplusplus) -# if !defined(__STDC_CONSTANT_MACROS) -# define __STDC_CONSTANT_MACROS 1 -# endif -# if !defined(__STDC_LIMIT_MACROS) -# define __STDC_LIMIT_MACROS 1 -# endif -#endif -#if defined(__cplusplus) -# define LZO_EXTERN_C extern "C" -# define LZO_EXTERN_C_BEGIN extern "C" { -# define LZO_EXTERN_C_END } -#else -# define LZO_EXTERN_C extern -# define LZO_EXTERN_C_BEGIN /*empty*/ -# define LZO_EXTERN_C_END /*empty*/ -#endif -#if !defined(__LZO_OS_OVERRIDE) -#if (LZO_OS_FREESTANDING) -# define LZO_INFO_OS "freestanding" -#elif (LZO_OS_EMBEDDED) -# define LZO_INFO_OS "embedded" -#elif 1 && defined(__IAR_SYSTEMS_ICC__) -# define LZO_OS_EMBEDDED 1 -# define LZO_INFO_OS "embedded" -#elif defined(__CYGWIN__) && defined(__GNUC__) -# define LZO_OS_CYGWIN 1 -# define LZO_INFO_OS "cygwin" -#elif defined(__EMX__) && defined(__GNUC__) -# define LZO_OS_EMX 1 -# define LZO_INFO_OS "emx" -#elif defined(__BEOS__) -# define LZO_OS_BEOS 1 -# define LZO_INFO_OS "beos" -#elif defined(__Lynx__) -# define LZO_OS_LYNXOS 1 -# define LZO_INFO_OS "lynxos" -#elif defined(__OS400__) -# define LZO_OS_OS400 1 -# define LZO_INFO_OS "os400" -#elif defined(__QNX__) -# define LZO_OS_QNX 1 -# define LZO_INFO_OS "qnx" -#elif defined(__BORLANDC__) && defined(__DPMI32__) && (__BORLANDC__ >= 0x0460) -# define LZO_OS_DOS32 1 -# define LZO_INFO_OS "dos32" -#elif defined(__BORLANDC__) && defined(__DPMI16__) -# define LZO_OS_DOS16 1 -# define LZO_INFO_OS "dos16" -#elif defined(__ZTC__) && defined(DOS386) -# define LZO_OS_DOS32 1 -# define LZO_INFO_OS "dos32" -#elif defined(__OS2__) || defined(__OS2V2__) -# if (UINT_MAX == LZO_0xffffL) -# define LZO_OS_OS216 1 -# define LZO_INFO_OS "os216" -# elif (UINT_MAX == LZO_0xffffffffL) -# define LZO_OS_OS2 1 -# define LZO_INFO_OS "os2" -# else -# error "check your limits.h header" -# endif -#elif defined(__WIN64__) || defined(_WIN64) || defined(WIN64) -# define LZO_OS_WIN64 1 -# define LZO_INFO_OS "win64" -#elif defined(__WIN32__) || defined(_WIN32) || defined(WIN32) || defined(__WINDOWS_386__) -# define LZO_OS_WIN32 1 -# define LZO_INFO_OS "win32" -#elif defined(__MWERKS__) && defined(__INTEL__) -# define LZO_OS_WIN32 1 -# define LZO_INFO_OS "win32" -#elif defined(__WINDOWS__) || defined(_WINDOWS) || defined(_Windows) -# if (UINT_MAX == LZO_0xffffL) -# define LZO_OS_WIN16 1 -# define LZO_INFO_OS "win16" -# elif (UINT_MAX == LZO_0xffffffffL) -# define LZO_OS_WIN32 1 -# define LZO_INFO_OS "win32" -# else -# error "check your limits.h header" -# endif -#elif defined(__DOS__) || defined(__MSDOS__) || defined(_MSDOS) || defined(MSDOS) || (defined(__PACIFIC__) && defined(DOS)) -# if (UINT_MAX == LZO_0xffffL) -# define LZO_OS_DOS16 1 -# define LZO_INFO_OS "dos16" -# elif (UINT_MAX == LZO_0xffffffffL) -# define LZO_OS_DOS32 1 -# define LZO_INFO_OS "dos32" -# else -# error "check your limits.h header" -# endif -#elif defined(__WATCOMC__) -# if defined(__NT__) && (UINT_MAX == LZO_0xffffL) -# define LZO_OS_DOS16 1 -# define LZO_INFO_OS "dos16" -# elif defined(__NT__) && (__WATCOMC__ < 1100) -# define LZO_OS_WIN32 1 -# define LZO_INFO_OS "win32" -# elif defined(__linux__) || defined(__LINUX__) -# define LZO_OS_POSIX 1 -# define LZO_INFO_OS "posix" -# else -# error "please specify a target using the -bt compiler option" -# endif -#elif defined(__palmos__) -# define LZO_OS_PALMOS 1 -# define LZO_INFO_OS "palmos" -#elif defined(__TOS__) || defined(__atarist__) -# define LZO_OS_TOS 1 -# define LZO_INFO_OS "tos" -#elif defined(macintosh) && !defined(__arm__) && !defined(__i386__) && !defined(__ppc__) && !defined(__x64_64__) -# define LZO_OS_MACCLASSIC 1 -# define LZO_INFO_OS "macclassic" -#elif defined(__VMS) -# define LZO_OS_VMS 1 -# define LZO_INFO_OS "vms" -#elif (defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__) -# define LZO_OS_CONSOLE 1 -# define LZO_OS_CONSOLE_PS2 1 -# define LZO_INFO_OS "console" -# define LZO_INFO_OS_CONSOLE "ps2" -#elif defined(__mips__) && defined(__psp__) -# define LZO_OS_CONSOLE 1 -# define LZO_OS_CONSOLE_PSP 1 -# define LZO_INFO_OS "console" -# define LZO_INFO_OS_CONSOLE "psp" -#else -# define LZO_OS_POSIX 1 -# define LZO_INFO_OS "posix" -#endif -#if (LZO_OS_POSIX) -# if defined(_AIX) || defined(__AIX__) || defined(__aix__) -# define LZO_OS_POSIX_AIX 1 -# define LZO_INFO_OS_POSIX "aix" -# elif defined(__FreeBSD__) -# define LZO_OS_POSIX_FREEBSD 1 -# define LZO_INFO_OS_POSIX "freebsd" -# elif defined(__hpux__) || defined(__hpux) -# define LZO_OS_POSIX_HPUX 1 -# define LZO_INFO_OS_POSIX "hpux" -# elif defined(__INTERIX) -# define LZO_OS_POSIX_INTERIX 1 -# define LZO_INFO_OS_POSIX "interix" -# elif defined(__IRIX__) || defined(__irix__) -# define LZO_OS_POSIX_IRIX 1 -# define LZO_INFO_OS_POSIX "irix" -# elif defined(__linux__) || defined(__linux) || defined(__LINUX__) -# define LZO_OS_POSIX_LINUX 1 -# define LZO_INFO_OS_POSIX "linux" -# elif defined(__APPLE__) && defined(__MACH__) -# if ((__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__-0) >= 20000) -# define LZO_OS_POSIX_DARWIN 1040 -# define LZO_INFO_OS_POSIX "darwin_iphone" -# elif ((__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0) >= 1040) -# define LZO_OS_POSIX_DARWIN __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ -# define LZO_INFO_OS_POSIX "darwin" -# else -# define LZO_OS_POSIX_DARWIN 1 -# define LZO_INFO_OS_POSIX "darwin" -# endif -# define LZO_OS_POSIX_MACOSX LZO_OS_POSIX_DARWIN -# elif defined(__minix__) || defined(__minix) -# define LZO_OS_POSIX_MINIX 1 -# define LZO_INFO_OS_POSIX "minix" -# elif defined(__NetBSD__) -# define LZO_OS_POSIX_NETBSD 1 -# define LZO_INFO_OS_POSIX "netbsd" -# elif defined(__OpenBSD__) -# define LZO_OS_POSIX_OPENBSD 1 -# define LZO_INFO_OS_POSIX "openbsd" -# elif defined(__osf__) -# define LZO_OS_POSIX_OSF 1 -# define LZO_INFO_OS_POSIX "osf" -# elif defined(__solaris__) || defined(__sun) -# if defined(__SVR4) || defined(__svr4__) -# define LZO_OS_POSIX_SOLARIS 1 -# define LZO_INFO_OS_POSIX "solaris" -# else -# define LZO_OS_POSIX_SUNOS 1 -# define LZO_INFO_OS_POSIX "sunos" -# endif -# elif defined(__ultrix__) || defined(__ultrix) -# define LZO_OS_POSIX_ULTRIX 1 -# define LZO_INFO_OS_POSIX "ultrix" -# elif defined(_UNICOS) -# define LZO_OS_POSIX_UNICOS 1 -# define LZO_INFO_OS_POSIX "unicos" -# else -# define LZO_OS_POSIX_UNKNOWN 1 -# define LZO_INFO_OS_POSIX "unknown" -# endif -#endif -#endif -#if (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16) -# if (UINT_MAX != LZO_0xffffL) -# error "unexpected configuration - check your compiler defines" -# endif -# if (ULONG_MAX != LZO_0xffffffffL) -# error "unexpected configuration - check your compiler defines" -# endif -#endif -#if (LZO_OS_DOS32 || LZO_OS_OS2 || LZO_OS_WIN32 || LZO_OS_WIN64) -# if (UINT_MAX != LZO_0xffffffffL) -# error "unexpected configuration - check your compiler defines" -# endif -# if (ULONG_MAX != LZO_0xffffffffL) -# error "unexpected configuration - check your compiler defines" -# endif -#endif -#if defined(CIL) && defined(_GNUCC) && defined(__GNUC__) -# define LZO_CC_CILLY 1 -# define LZO_INFO_CC "Cilly" -# if defined(__CILLY__) -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__CILLY__) -# else -# define LZO_INFO_CCVER "unknown" -# endif -#elif 0 && defined(SDCC) && defined(__VERSION__) && !defined(__GNUC__) -# define LZO_CC_SDCC 1 -# define LZO_INFO_CC "sdcc" -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(SDCC) -#elif defined(__PATHSCALE__) && defined(__PATHCC_PATCHLEVEL__) -# define LZO_CC_PATHSCALE (__PATHCC__ * 0x10000L + (__PATHCC_MINOR__-0) * 0x100 + (__PATHCC_PATCHLEVEL__-0)) -# define LZO_INFO_CC "Pathscale C" -# define LZO_INFO_CCVER __PATHSCALE__ -# if defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__) -# define LZO_CC_PATHSCALE_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0)) -# endif -#elif defined(__INTEL_COMPILER) && ((__INTEL_COMPILER-0) > 0) -# define LZO_CC_INTELC __INTEL_COMPILER -# define LZO_INFO_CC "Intel C" -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__INTEL_COMPILER) -# if defined(_MSC_VER) && ((_MSC_VER-0) > 0) -# define LZO_CC_INTELC_MSC _MSC_VER -# elif defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__) -# define LZO_CC_INTELC_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0)) -# endif -#elif defined(__POCC__) && defined(_WIN32) -# define LZO_CC_PELLESC 1 -# define LZO_INFO_CC "Pelles C" -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__POCC__) -#elif defined(__ARMCC_VERSION) && defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__) -# if defined(__GNUC_PATCHLEVEL__) -# define LZO_CC_ARMCC_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0)) -# else -# define LZO_CC_ARMCC_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100) -# endif -# define LZO_CC_ARMCC __ARMCC_VERSION -# define LZO_INFO_CC "ARM C Compiler" -# define LZO_INFO_CCVER __VERSION__ -#elif defined(__clang__) && defined(__llvm__) && defined(__VERSION__) -# if defined(__clang_major__) && defined(__clang_minor__) && defined(__clang_patchlevel__) -# define LZO_CC_CLANG (__clang_major__ * 0x10000L + (__clang_minor__-0) * 0x100 + (__clang_patchlevel__-0)) -# else -# define LZO_CC_CLANG 0x010000L -# endif -# if defined(_MSC_VER) && ((_MSC_VER-0) > 0) -# define LZO_CC_CLANG_MSC _MSC_VER -# elif defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__) -# define LZO_CC_CLANG_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0)) -# endif -# define LZO_INFO_CC "clang" -# define LZO_INFO_CCVER __VERSION__ -#elif defined(__llvm__) && defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__) -# if defined(__GNUC_PATCHLEVEL__) -# define LZO_CC_LLVM_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0)) -# else -# define LZO_CC_LLVM_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100) -# endif -# define LZO_CC_LLVM LZO_CC_LLVM_GNUC -# define LZO_INFO_CC "llvm-gcc" -# define LZO_INFO_CCVER __VERSION__ -#elif defined(__ACK__) && defined(_ACK) -# define LZO_CC_ACK 1 -# define LZO_INFO_CC "Amsterdam Compiler Kit C" -# define LZO_INFO_CCVER "unknown" -#elif defined(__ARMCC_VERSION) && !defined(__GNUC__) -# define LZO_CC_ARMCC __ARMCC_VERSION -# define LZO_CC_ARMCC_ARMCC __ARMCC_VERSION -# define LZO_INFO_CC "ARM C Compiler" -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__ARMCC_VERSION) -#elif defined(__AZTEC_C__) -# define LZO_CC_AZTECC 1 -# define LZO_INFO_CC "Aztec C" -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__AZTEC_C__) -#elif defined(__CODEGEARC__) -# define LZO_CC_CODEGEARC 1 -# define LZO_INFO_CC "CodeGear C" -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__CODEGEARC__) -#elif defined(__BORLANDC__) -# define LZO_CC_BORLANDC 1 -# define LZO_INFO_CC "Borland C" -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__BORLANDC__) -#elif defined(_CRAYC) && defined(_RELEASE) -# define LZO_CC_CRAYC 1 -# define LZO_INFO_CC "Cray C" -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(_RELEASE) -#elif defined(__DMC__) && defined(__SC__) -# define LZO_CC_DMC 1 -# define LZO_INFO_CC "Digital Mars C" -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__DMC__) -#elif defined(__DECC) -# define LZO_CC_DECC 1 -# define LZO_INFO_CC "DEC C" -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__DECC) -#elif (defined(__ghs) || defined(__ghs__)) && defined(__GHS_VERSION_NUMBER) && ((__GHS_VERSION_NUMBER-0) > 0) -# define LZO_CC_GHS 1 -# define LZO_INFO_CC "Green Hills C" -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__GHS_VERSION_NUMBER) -# if defined(_MSC_VER) && ((_MSC_VER-0) > 0) -# define LZO_CC_GHS_MSC _MSC_VER -# elif defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__) -# define LZO_CC_GHS_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0)) -# endif -#elif defined(__HIGHC__) -# define LZO_CC_HIGHC 1 -# define LZO_INFO_CC "MetaWare High C" -# define LZO_INFO_CCVER "unknown" -#elif defined(__HP_aCC) && ((__HP_aCC-0) > 0) -# define LZO_CC_HPACC __HP_aCC -# define LZO_INFO_CC "HP aCC" -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__HP_aCC) -#elif defined(__IAR_SYSTEMS_ICC__) -# define LZO_CC_IARC 1 -# define LZO_INFO_CC "IAR C" -# if defined(__VER__) -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__VER__) -# else -# define LZO_INFO_CCVER "unknown" -# endif -#elif defined(__IBMC__) && ((__IBMC__-0) > 0) -# define LZO_CC_IBMC __IBMC__ -# define LZO_INFO_CC "IBM C" -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__IBMC__) -#elif defined(__IBMCPP__) && ((__IBMCPP__-0) > 0) -# define LZO_CC_IBMC __IBMCPP__ -# define LZO_INFO_CC "IBM C" -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__IBMCPP__) -#elif defined(__KEIL__) && defined(__C166__) -# define LZO_CC_KEILC 1 -# define LZO_INFO_CC "Keil C" -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__C166__) -#elif defined(__LCC__) && defined(_WIN32) && defined(__LCCOPTIMLEVEL) -# define LZO_CC_LCCWIN32 1 -# define LZO_INFO_CC "lcc-win32" -# define LZO_INFO_CCVER "unknown" -#elif defined(__LCC__) -# define LZO_CC_LCC 1 -# define LZO_INFO_CC "lcc" -# if defined(__LCC_VERSION__) -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__LCC_VERSION__) -# else -# define LZO_INFO_CCVER "unknown" -# endif -#elif defined(__MWERKS__) && ((__MWERKS__-0) > 0) -# define LZO_CC_MWERKS __MWERKS__ -# define LZO_INFO_CC "Metrowerks C" -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__MWERKS__) -#elif (defined(__NDPC__) || defined(__NDPX__)) && defined(__i386) -# define LZO_CC_NDPC 1 -# define LZO_INFO_CC "Microway NDP C" -# define LZO_INFO_CCVER "unknown" -#elif defined(__PACIFIC__) -# define LZO_CC_PACIFICC 1 -# define LZO_INFO_CC "Pacific C" -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__PACIFIC__) -#elif defined(__PGI) && defined(__PGIC__) && defined(__PGIC_MINOR__) -# if defined(__PGIC_PATCHLEVEL__) -# define LZO_CC_PGI (__PGIC__ * 0x10000L + (__PGIC_MINOR__-0) * 0x100 + (__PGIC_PATCHLEVEL__-0)) -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__PGIC__) "." LZO_PP_MACRO_EXPAND(__PGIC_MINOR__) "." LZO_PP_MACRO_EXPAND(__PGIC_PATCHLEVEL__) -# else -# define LZO_CC_PGI (__PGIC__ * 0x10000L + (__PGIC_MINOR__-0) * 0x100) -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__PGIC__) "." LZO_PP_MACRO_EXPAND(__PGIC_MINOR__) ".0" -# endif -# define LZO_INFO_CC "Portland Group PGI C" -#elif defined(__PGI) && (defined(__linux__) || defined(__WIN32__)) -# define LZO_CC_PGI 1 -# define LZO_INFO_CC "Portland Group PGI C" -# define LZO_INFO_CCVER "unknown" -#elif defined(__PUREC__) && defined(__TOS__) -# define LZO_CC_PUREC 1 -# define LZO_INFO_CC "Pure C" -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__PUREC__) -#elif defined(__SC__) && defined(__ZTC__) -# define LZO_CC_SYMANTECC 1 -# define LZO_INFO_CC "Symantec C" -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__SC__) -#elif defined(__SUNPRO_C) -# define LZO_INFO_CC "SunPro C" -# if ((__SUNPRO_C-0) > 0) -# define LZO_CC_SUNPROC __SUNPRO_C -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__SUNPRO_C) -# else -# define LZO_CC_SUNPROC 1 -# define LZO_INFO_CCVER "unknown" -# endif -#elif defined(__SUNPRO_CC) -# define LZO_INFO_CC "SunPro C" -# if ((__SUNPRO_CC-0) > 0) -# define LZO_CC_SUNPROC __SUNPRO_CC -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__SUNPRO_CC) -# else -# define LZO_CC_SUNPROC 1 -# define LZO_INFO_CCVER "unknown" -# endif -#elif defined(__TINYC__) -# define LZO_CC_TINYC 1 -# define LZO_INFO_CC "Tiny C" -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__TINYC__) -#elif defined(__TSC__) -# define LZO_CC_TOPSPEEDC 1 -# define LZO_INFO_CC "TopSpeed C" -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__TSC__) -#elif defined(__WATCOMC__) -# define LZO_CC_WATCOMC 1 -# define LZO_INFO_CC "Watcom C" -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__WATCOMC__) -#elif defined(__TURBOC__) -# define LZO_CC_TURBOC 1 -# define LZO_INFO_CC "Turbo C" -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__TURBOC__) -#elif defined(__ZTC__) -# define LZO_CC_ZORTECHC 1 -# define LZO_INFO_CC "Zortech C" -# if ((__ZTC__-0) == 0x310) -# define LZO_INFO_CCVER "0x310" -# else -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__ZTC__) -# endif -#elif defined(__GNUC__) && defined(__VERSION__) -# if defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__) -# define LZO_CC_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0)) -# elif defined(__GNUC_MINOR__) -# define LZO_CC_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100) -# else -# define LZO_CC_GNUC (__GNUC__ * 0x10000L) -# endif -# define LZO_INFO_CC "gcc" -# define LZO_INFO_CCVER __VERSION__ -#elif defined(_MSC_VER) && ((_MSC_VER-0) > 0) -# define LZO_CC_MSC _MSC_VER -# define LZO_INFO_CC "Microsoft C" -# if defined(_MSC_FULL_VER) -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(_MSC_VER) "." LZO_PP_MACRO_EXPAND(_MSC_FULL_VER) -# else -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(_MSC_VER) -# endif -#else -# define LZO_CC_UNKNOWN 1 -# define LZO_INFO_CC "unknown" -# define LZO_INFO_CCVER "unknown" -#endif -#if (LZO_CC_GNUC) && defined(__OPEN64__) -# if defined(__OPENCC__) && defined(__OPENCC_MINOR__) && defined(__OPENCC_PATCHLEVEL__) -# define LZO_CC_OPEN64 (__OPENCC__ * 0x10000L + (__OPENCC_MINOR__-0) * 0x100 + (__OPENCC_PATCHLEVEL__-0)) -# define LZO_CC_OPEN64_GNUC LZO_CC_GNUC -# endif -#endif -#if (LZO_CC_GNUC) && defined(__PCC__) -# if defined(__PCC__) && defined(__PCC_MINOR__) && defined(__PCC_MINORMINOR__) -# define LZO_CC_PCC (__PCC__ * 0x10000L + (__PCC_MINOR__-0) * 0x100 + (__PCC_MINORMINOR__-0)) -# define LZO_CC_PCC_GNUC LZO_CC_GNUC -# endif -#endif -#if 0 && (LZO_CC_MSC && (_MSC_VER >= 1200)) && !defined(_MSC_FULL_VER) -# error "LZO_CC_MSC: _MSC_FULL_VER is not defined" -#endif -#if !defined(__LZO_ARCH_OVERRIDE) && !(LZO_ARCH_GENERIC) && defined(_CRAY) -# if (UINT_MAX > LZO_0xffffffffL) && defined(_CRAY) -# if defined(_CRAYMPP) || defined(_CRAYT3D) || defined(_CRAYT3E) -# define LZO_ARCH_CRAY_MPP 1 -# elif defined(_CRAY1) -# define LZO_ARCH_CRAY_PVP 1 -# endif -# endif -#endif -#if !defined(__LZO_ARCH_OVERRIDE) -#if (LZO_ARCH_GENERIC) -# define LZO_INFO_ARCH "generic" -#elif (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16) -# define LZO_ARCH_I086 1 -# define LZO_INFO_ARCH "i086" -#elif defined(__aarch64__) -# define LZO_ARCH_ARM64 1 -# define LZO_INFO_ARCH "arm64" -#elif defined(__alpha__) || defined(__alpha) || defined(_M_ALPHA) -# define LZO_ARCH_ALPHA 1 -# define LZO_INFO_ARCH "alpha" -#elif (LZO_ARCH_CRAY_MPP) && (defined(_CRAYT3D) || defined(_CRAYT3E)) -# define LZO_ARCH_ALPHA 1 -# define LZO_INFO_ARCH "alpha" -#elif defined(__amd64__) || defined(__x86_64__) || defined(_M_AMD64) -# define LZO_ARCH_AMD64 1 -# define LZO_INFO_ARCH "amd64" -#elif defined(__arm__) || defined(_M_ARM) -# define LZO_ARCH_ARM 1 -# define LZO_INFO_ARCH "arm" -#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICCARM__) -# define LZO_ARCH_ARM 1 -# define LZO_INFO_ARCH "arm" -#elif (UINT_MAX <= LZO_0xffffL) && defined(__AVR__) -# define LZO_ARCH_AVR 1 -# define LZO_INFO_ARCH "avr" -#elif defined(__avr32__) || defined(__AVR32__) -# define LZO_ARCH_AVR32 1 -# define LZO_INFO_ARCH "avr32" -#elif defined(__bfin__) -# define LZO_ARCH_BLACKFIN 1 -# define LZO_INFO_ARCH "blackfin" -#elif (UINT_MAX == LZO_0xffffL) && defined(__C166__) -# define LZO_ARCH_C166 1 -# define LZO_INFO_ARCH "c166" -#elif defined(__cris__) -# define LZO_ARCH_CRIS 1 -# define LZO_INFO_ARCH "cris" -#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICCEZ80__) -# define LZO_ARCH_EZ80 1 -# define LZO_INFO_ARCH "ez80" -#elif defined(__H8300__) || defined(__H8300H__) || defined(__H8300S__) || defined(__H8300SX__) -# define LZO_ARCH_H8300 1 -# define LZO_INFO_ARCH "h8300" -#elif defined(__hppa__) || defined(__hppa) -# define LZO_ARCH_HPPA 1 -# define LZO_INFO_ARCH "hppa" -#elif defined(__386__) || defined(__i386__) || defined(__i386) || defined(_M_IX86) || defined(_M_I386) -# define LZO_ARCH_I386 1 -# define LZO_ARCH_IA32 1 -# define LZO_INFO_ARCH "i386" -#elif (LZO_CC_ZORTECHC && defined(__I86__)) -# define LZO_ARCH_I386 1 -# define LZO_ARCH_IA32 1 -# define LZO_INFO_ARCH "i386" -#elif (LZO_OS_DOS32 && LZO_CC_HIGHC) && defined(_I386) -# define LZO_ARCH_I386 1 -# define LZO_ARCH_IA32 1 -# define LZO_INFO_ARCH "i386" -#elif defined(__ia64__) || defined(__ia64) || defined(_M_IA64) -# define LZO_ARCH_IA64 1 -# define LZO_INFO_ARCH "ia64" -#elif (UINT_MAX == LZO_0xffffL) && defined(__m32c__) -# define LZO_ARCH_M16C 1 -# define LZO_INFO_ARCH "m16c" -#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICCM16C__) -# define LZO_ARCH_M16C 1 -# define LZO_INFO_ARCH "m16c" -#elif defined(__m32r__) -# define LZO_ARCH_M32R 1 -# define LZO_INFO_ARCH "m32r" -#elif (LZO_OS_TOS) || defined(__m68k__) || defined(__m68000__) || defined(__mc68000__) || defined(__mc68020__) || defined(_M_M68K) -# define LZO_ARCH_M68K 1 -# define LZO_INFO_ARCH "m68k" -#elif (UINT_MAX == LZO_0xffffL) && defined(__C251__) -# define LZO_ARCH_MCS251 1 -# define LZO_INFO_ARCH "mcs251" -#elif (UINT_MAX == LZO_0xffffL) && defined(__C51__) -# define LZO_ARCH_MCS51 1 -# define LZO_INFO_ARCH "mcs51" -#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICC8051__) -# define LZO_ARCH_MCS51 1 -# define LZO_INFO_ARCH "mcs51" -#elif defined(__mips__) || defined(__mips) || defined(_MIPS_ARCH) || defined(_M_MRX000) -# define LZO_ARCH_MIPS 1 -# define LZO_INFO_ARCH "mips" -#elif (UINT_MAX == LZO_0xffffL) && defined(__MSP430__) -# define LZO_ARCH_MSP430 1 -# define LZO_INFO_ARCH "msp430" -#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICC430__) -# define LZO_ARCH_MSP430 1 -# define LZO_INFO_ARCH "msp430" -#elif defined(__powerpc__) || defined(__powerpc) || defined(__ppc__) || defined(__PPC__) || defined(_M_PPC) || defined(_ARCH_PPC) || defined(_ARCH_PWR) -# define LZO_ARCH_POWERPC 1 -# define LZO_INFO_ARCH "powerpc" -#elif defined(__s390__) || defined(__s390) || defined(__s390x__) || defined(__s390x) -# define LZO_ARCH_S390 1 -# define LZO_INFO_ARCH "s390" -#elif defined(__sh__) || defined(_M_SH) -# define LZO_ARCH_SH 1 -# define LZO_INFO_ARCH "sh" -#elif defined(__sparc__) || defined(__sparc) || defined(__sparcv8) -# define LZO_ARCH_SPARC 1 -# define LZO_INFO_ARCH "sparc" -#elif defined(__SPU__) -# define LZO_ARCH_SPU 1 -# define LZO_INFO_ARCH "spu" -#elif (UINT_MAX == LZO_0xffffL) && defined(__z80) -# define LZO_ARCH_Z80 1 -# define LZO_INFO_ARCH "z80" -#elif (LZO_ARCH_CRAY_PVP) -# if defined(_CRAYSV1) -# define LZO_ARCH_CRAY_SV1 1 -# define LZO_INFO_ARCH "cray_sv1" -# elif (_ADDR64) -# define LZO_ARCH_CRAY_T90 1 -# define LZO_INFO_ARCH "cray_t90" -# elif (_ADDR32) -# define LZO_ARCH_CRAY_YMP 1 -# define LZO_INFO_ARCH "cray_ymp" -# else -# define LZO_ARCH_CRAY_XMP 1 -# define LZO_INFO_ARCH "cray_xmp" -# endif -#else -# define LZO_ARCH_UNKNOWN 1 -# define LZO_INFO_ARCH "unknown" -#endif -#endif -#if !defined(LZO_ARCH_ARM_THUMB2) -#if (LZO_ARCH_ARM) -# if defined(__ARM_ARCH_ISA_THUMB) -# if ((__ARM_ARCH_ISA_THUMB)+0 >= 2) -# define LZO_ARCH_ARM_THUMB2 1 -# endif -# elif 1 && defined(__thumb2__) -# define LZO_ARCH_ARM_THUMB2 1 -# elif 1 && defined(__TARGET_ARCH_THUMB) && ((__TARGET_ARCH_THUMB)+0 >= 4) -# define LZO_ARCH_ARM_THUMB2 1 -# endif -#endif -#endif -#if 1 && (LZO_ARCH_UNKNOWN) && (LZO_OS_DOS32 || LZO_OS_OS2) -# error "FIXME - missing define for CPU architecture" -#endif -#if 1 && (LZO_ARCH_UNKNOWN) && (LZO_OS_WIN32) -# error "FIXME - missing LZO_OS_WIN32 define for CPU architecture" -#endif -#if 1 && (LZO_ARCH_UNKNOWN) && (LZO_OS_WIN64) -# error "FIXME - missing LZO_OS_WIN64 define for CPU architecture" -#endif -#if (LZO_OS_OS216 || LZO_OS_WIN16) -# define LZO_ARCH_I086PM 1 -#elif 1 && (LZO_OS_DOS16 && defined(BLX286)) -# define LZO_ARCH_I086PM 1 -#elif 1 && (LZO_OS_DOS16 && defined(DOSX286)) -# define LZO_ARCH_I086PM 1 -#elif 1 && (LZO_OS_DOS16 && LZO_CC_BORLANDC && defined(__DPMI16__)) -# define LZO_ARCH_I086PM 1 -#endif -#if (LZO_ARCH_AMD64 && !LZO_ARCH_X64) -# define LZO_ARCH_X64 1 -#elif (!LZO_ARCH_AMD64 && LZO_ARCH_X64) && defined(__LZO_ARCH_OVERRIDE) -# define LZO_ARCH_AMD64 1 -#endif -#if (LZO_ARCH_ARM64 && !LZO_ARCH_AARCH64) -# define LZO_ARCH_AARCH64 1 -#elif (!LZO_ARCH_ARM64 && LZO_ARCH_AARCH64) && defined(__LZO_ARCH_OVERRIDE) -# define LZO_ARCH_ARM64 1 -#endif -#if (LZO_ARCH_I386 && !LZO_ARCH_X86) -# define LZO_ARCH_X86 1 -#elif (!LZO_ARCH_I386 && LZO_ARCH_X86) && defined(__LZO_ARCH_OVERRIDE) -# define LZO_ARCH_I386 1 -#endif -#if (LZO_ARCH_AMD64 && !LZO_ARCH_X64) || (!LZO_ARCH_AMD64 && LZO_ARCH_X64) -# error "unexpected configuration - check your compiler defines" -#endif -#if (LZO_ARCH_ARM64 && !LZO_ARCH_AARCH64) || (!LZO_ARCH_ARM64 && LZO_ARCH_AARCH64) -# error "unexpected configuration - check your compiler defines" -#endif -#if (LZO_ARCH_I386 && !LZO_ARCH_X86) || (!LZO_ARCH_I386 && LZO_ARCH_X86) -# error "unexpected configuration - check your compiler defines" -#endif -#if (LZO_ARCH_ARM_THUMB1 && !LZO_ARCH_ARM) -# error "unexpected configuration - check your compiler defines" -#endif -#if (LZO_ARCH_ARM_THUMB2 && !LZO_ARCH_ARM) -# error "unexpected configuration - check your compiler defines" -#endif -#if (LZO_ARCH_ARM_THUMB1 && LZO_ARCH_ARM_THUMB2) -# error "unexpected configuration - check your compiler defines" -#endif -#if (LZO_ARCH_I086PM && !LZO_ARCH_I086) -# error "unexpected configuration - check your compiler defines" -#endif -#if (LZO_ARCH_I086) -# if (UINT_MAX != LZO_0xffffL) -# error "unexpected configuration - check your compiler defines" -# endif -# if (ULONG_MAX != LZO_0xffffffffL) -# error "unexpected configuration - check your compiler defines" -# endif -#endif -#if (LZO_ARCH_I386) -# if (UINT_MAX != LZO_0xffffL) && defined(__i386_int16__) -# error "unexpected configuration - check your compiler defines" -# endif -# if (UINT_MAX != LZO_0xffffffffL) && !defined(__i386_int16__) -# error "unexpected configuration - check your compiler defines" -# endif -# if (ULONG_MAX != LZO_0xffffffffL) -# error "unexpected configuration - check your compiler defines" -# endif -#endif -#if (LZO_ARCH_AMD64 || LZO_ARCH_I386) -# if !defined(LZO_TARGET_FEATURE_SSE2) -# if defined(__SSE2__) -# define LZO_TARGET_FEATURE_SSE2 1 -# elif defined(_MSC_VER) && (defined(_M_IX86_FP) && ((_M_IX86_FP)+0 >= 2)) -# define LZO_TARGET_FEATURE_SSE2 1 -# elif (LZO_CC_INTELC_MSC || LZO_CC_MSC) && defined(_M_AMD64) -# define LZO_TARGET_FEATURE_SSE2 1 -# endif -# endif -# if !defined(LZO_TARGET_FEATURE_SSSE3) -# if (LZO_TARGET_FEATURE_SSE2) -# if defined(__SSSE3__) -# define LZO_TARGET_FEATURE_SSSE3 1 -# elif defined(_MSC_VER) && defined(__AVX__) -# define LZO_TARGET_FEATURE_SSSE3 1 -# endif -# endif -# endif -# if !defined(LZO_TARGET_FEATURE_SSE4_2) -# if (LZO_TARGET_FEATURE_SSSE3) -# if defined(__SSE4_2__) -# define LZO_TARGET_FEATURE_SSE4_2 1 -# endif -# endif -# endif -# if !defined(LZO_TARGET_FEATURE_AVX) -# if (LZO_TARGET_FEATURE_SSSE3) -# if defined(__AVX__) -# define LZO_TARGET_FEATURE_AVX 1 -# endif -# endif -# endif -# if !defined(LZO_TARGET_FEATURE_AVX2) -# if (LZO_TARGET_FEATURE_AVX) -# if defined(__AVX2__) -# define LZO_TARGET_FEATURE_AVX2 1 -# endif -# endif -# endif -#endif -#if (LZO_TARGET_FEATURE_SSSE3 && !(LZO_TARGET_FEATURE_SSE2)) -# error "unexpected configuration - check your compiler defines" -#endif -#if (LZO_TARGET_FEATURE_SSE4_2 && !(LZO_TARGET_FEATURE_SSSE3)) -# error "unexpected configuration - check your compiler defines" -#endif -#if (LZO_TARGET_FEATURE_AVX && !(LZO_TARGET_FEATURE_SSSE3)) -# error "unexpected configuration - check your compiler defines" -#endif -#if (LZO_TARGET_FEATURE_AVX2 && !(LZO_TARGET_FEATURE_AVX)) -# error "unexpected configuration - check your compiler defines" -#endif -#if (LZO_ARCH_ARM) -# if !defined(LZO_TARGET_FEATURE_NEON) -# if defined(__ARM_NEON) && ((__ARM_NEON)+0) -# define LZO_TARGET_FEATURE_NEON 1 -# elif 1 && defined(__ARM_NEON__) && ((__ARM_NEON__)+0) -# define LZO_TARGET_FEATURE_NEON 1 -# elif 1 && defined(__TARGET_FEATURE_NEON) && ((__TARGET_FEATURE_NEON)+0) -# define LZO_TARGET_FEATURE_NEON 1 -# endif -# endif -#elif (LZO_ARCH_ARM64) -# if !defined(LZO_TARGET_FEATURE_NEON) -# if 1 -# define LZO_TARGET_FEATURE_NEON 1 -# endif -# endif -#endif -#if 0 -#elif !defined(__LZO_MM_OVERRIDE) -#if (LZO_ARCH_I086) -#if (UINT_MAX != LZO_0xffffL) -# error "unexpected configuration - check your compiler defines" -#endif -#if defined(__TINY__) || defined(M_I86TM) || defined(_M_I86TM) -# define LZO_MM_TINY 1 -#elif defined(__HUGE__) || defined(_HUGE_) || defined(M_I86HM) || defined(_M_I86HM) -# define LZO_MM_HUGE 1 -#elif defined(__SMALL__) || defined(M_I86SM) || defined(_M_I86SM) || defined(SMALL_MODEL) -# define LZO_MM_SMALL 1 -#elif defined(__MEDIUM__) || defined(M_I86MM) || defined(_M_I86MM) -# define LZO_MM_MEDIUM 1 -#elif defined(__COMPACT__) || defined(M_I86CM) || defined(_M_I86CM) -# define LZO_MM_COMPACT 1 -#elif defined(__LARGE__) || defined(M_I86LM) || defined(_M_I86LM) || defined(LARGE_MODEL) -# define LZO_MM_LARGE 1 -#elif (LZO_CC_AZTECC) -# if defined(_LARGE_CODE) && defined(_LARGE_DATA) -# define LZO_MM_LARGE 1 -# elif defined(_LARGE_CODE) -# define LZO_MM_MEDIUM 1 -# elif defined(_LARGE_DATA) -# define LZO_MM_COMPACT 1 -# else -# define LZO_MM_SMALL 1 -# endif -#elif (LZO_CC_ZORTECHC && defined(__VCM__)) -# define LZO_MM_LARGE 1 -#else -# error "unknown LZO_ARCH_I086 memory model" -#endif -#if (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16) -#define LZO_HAVE_MM_HUGE_PTR 1 -#define LZO_HAVE_MM_HUGE_ARRAY 1 -#if (LZO_MM_TINY) -# undef LZO_HAVE_MM_HUGE_ARRAY -#endif -#if (LZO_CC_AZTECC || LZO_CC_PACIFICC || LZO_CC_ZORTECHC) -# undef LZO_HAVE_MM_HUGE_PTR -# undef LZO_HAVE_MM_HUGE_ARRAY -#elif (LZO_CC_DMC || LZO_CC_SYMANTECC) -# undef LZO_HAVE_MM_HUGE_ARRAY -#elif (LZO_CC_MSC && defined(_QC)) -# undef LZO_HAVE_MM_HUGE_ARRAY -# if (_MSC_VER < 600) -# undef LZO_HAVE_MM_HUGE_PTR -# endif -#elif (LZO_CC_TURBOC && (__TURBOC__ < 0x0295)) -# undef LZO_HAVE_MM_HUGE_ARRAY -#endif -#if (LZO_ARCH_I086PM) && !(LZO_HAVE_MM_HUGE_PTR) -# if (LZO_OS_DOS16) -# error "unexpected configuration - check your compiler defines" -# elif (LZO_CC_ZORTECHC) -# else -# error "unexpected configuration - check your compiler defines" -# endif -#endif -#ifdef __cplusplus -extern "C" { -#endif -#if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0200)) - extern void __near __cdecl _AHSHIFT(void); -# define LZO_MM_AHSHIFT ((unsigned) _AHSHIFT) -#elif (LZO_CC_DMC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC) - extern void __near __cdecl _AHSHIFT(void); -# define LZO_MM_AHSHIFT ((unsigned) _AHSHIFT) -#elif (LZO_CC_MSC || LZO_CC_TOPSPEEDC) - extern void __near __cdecl _AHSHIFT(void); -# define LZO_MM_AHSHIFT ((unsigned) _AHSHIFT) -#elif (LZO_CC_TURBOC && (__TURBOC__ >= 0x0295)) - extern void __near __cdecl _AHSHIFT(void); -# define LZO_MM_AHSHIFT ((unsigned) _AHSHIFT) -#elif ((LZO_CC_AZTECC || LZO_CC_PACIFICC || LZO_CC_TURBOC) && LZO_OS_DOS16) -# define LZO_MM_AHSHIFT 12 -#elif (LZO_CC_WATCOMC) - extern unsigned char _HShift; -# define LZO_MM_AHSHIFT ((unsigned) _HShift) -#else -# error "FIXME - implement LZO_MM_AHSHIFT" -#endif -#ifdef __cplusplus -} -#endif -#endif -#elif (LZO_ARCH_C166) -#if !defined(__MODEL__) -# error "FIXME - LZO_ARCH_C166 __MODEL__" -#elif ((__MODEL__) == 0) -# define LZO_MM_SMALL 1 -#elif ((__MODEL__) == 1) -# define LZO_MM_SMALL 1 -#elif ((__MODEL__) == 2) -# define LZO_MM_LARGE 1 -#elif ((__MODEL__) == 3) -# define LZO_MM_TINY 1 -#elif ((__MODEL__) == 4) -# define LZO_MM_XTINY 1 -#elif ((__MODEL__) == 5) -# define LZO_MM_XSMALL 1 -#else -# error "FIXME - LZO_ARCH_C166 __MODEL__" -#endif -#elif (LZO_ARCH_MCS251) -#if !defined(__MODEL__) -# error "FIXME - LZO_ARCH_MCS251 __MODEL__" -#elif ((__MODEL__) == 0) -# define LZO_MM_SMALL 1 -#elif ((__MODEL__) == 2) -# define LZO_MM_LARGE 1 -#elif ((__MODEL__) == 3) -# define LZO_MM_TINY 1 -#elif ((__MODEL__) == 4) -# define LZO_MM_XTINY 1 -#elif ((__MODEL__) == 5) -# define LZO_MM_XSMALL 1 -#else -# error "FIXME - LZO_ARCH_MCS251 __MODEL__" -#endif -#elif (LZO_ARCH_MCS51) -#if !defined(__MODEL__) -# error "FIXME - LZO_ARCH_MCS51 __MODEL__" -#elif ((__MODEL__) == 1) -# define LZO_MM_SMALL 1 -#elif ((__MODEL__) == 2) -# define LZO_MM_LARGE 1 -#elif ((__MODEL__) == 3) -# define LZO_MM_TINY 1 -#elif ((__MODEL__) == 4) -# define LZO_MM_XTINY 1 -#elif ((__MODEL__) == 5) -# define LZO_MM_XSMALL 1 -#else -# error "FIXME - LZO_ARCH_MCS51 __MODEL__" -#endif -#elif (LZO_ARCH_CRAY_PVP) -# define LZO_MM_PVP 1 -#else -# define LZO_MM_FLAT 1 -#endif -#if (LZO_MM_COMPACT) -# define LZO_INFO_MM "compact" -#elif (LZO_MM_FLAT) -# define LZO_INFO_MM "flat" -#elif (LZO_MM_HUGE) -# define LZO_INFO_MM "huge" -#elif (LZO_MM_LARGE) -# define LZO_INFO_MM "large" -#elif (LZO_MM_MEDIUM) -# define LZO_INFO_MM "medium" -#elif (LZO_MM_PVP) -# define LZO_INFO_MM "pvp" -#elif (LZO_MM_SMALL) -# define LZO_INFO_MM "small" -#elif (LZO_MM_TINY) -# define LZO_INFO_MM "tiny" -#else -# error "unknown memory model" -#endif -#endif -#if !defined(__lzo_gnuc_extension__) -#if (LZO_CC_GNUC >= 0x020800ul) -# define __lzo_gnuc_extension__ __extension__ -#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) -# define __lzo_gnuc_extension__ __extension__ -#elif (LZO_CC_IBMC >= 600) -# define __lzo_gnuc_extension__ __extension__ -#else -#endif -#endif -#if !defined(__lzo_gnuc_extension__) -# define __lzo_gnuc_extension__ /*empty*/ -#endif -#if !defined(lzo_has_builtin) -#if (LZO_CC_CLANG) && defined(__has_builtin) -# define lzo_has_builtin __has_builtin -#endif -#endif -#if !defined(lzo_has_builtin) -# define lzo_has_builtin(x) 0 -#endif -#if !defined(lzo_has_attribute) -#if (LZO_CC_CLANG) && defined(__has_attribute) -# define lzo_has_attribute __has_attribute -#endif -#endif -#if !defined(lzo_has_attribute) -# define lzo_has_attribute(x) 0 -#endif -#if !defined(lzo_has_declspec_attribute) -#if (LZO_CC_CLANG) && defined(__has_declspec_attribute) -# define lzo_has_declspec_attribute __has_declspec_attribute -#endif -#endif -#if !defined(lzo_has_declspec_attribute) -# define lzo_has_declspec_attribute(x) 0 -#endif -#if !defined(lzo_has_feature) -#if (LZO_CC_CLANG) && defined(__has_feature) -# define lzo_has_feature __has_feature -#endif -#endif -#if !defined(lzo_has_feature) -# define lzo_has_feature(x) 0 -#endif -#if !defined(lzo_has_extension) -#if (LZO_CC_CLANG) && defined(__has_extension) -# define lzo_has_extension __has_extension -#elif (LZO_CC_CLANG) && defined(__has_feature) -# define lzo_has_extension __has_feature -#endif -#endif -#if !defined(lzo_has_extension) -# define lzo_has_extension 0 -#endif -#if !defined(LZO_CFG_USE_NEW_STYLE_CASTS) && defined(__cplusplus) && 0 -# if (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020800ul)) -# define LZO_CFG_USE_NEW_STYLE_CASTS 0 -# elif (LZO_CC_INTELC && (__INTEL_COMPILER < 1200)) -# define LZO_CFG_USE_NEW_STYLE_CASTS 0 -# else -# define LZO_CFG_USE_NEW_STYLE_CASTS 1 -# endif -#endif -#if !defined(LZO_CFG_USE_NEW_STYLE_CASTS) -# define LZO_CFG_USE_NEW_STYLE_CASTS 0 -#endif -#if !defined(__cplusplus) -# if defined(LZO_CFG_USE_NEW_STYLE_CASTS) -# undef LZO_CFG_USE_NEW_STYLE_CASTS -# endif -# define LZO_CFG_USE_NEW_STYLE_CASTS 0 -#endif -#if !defined(LZO_REINTERPRET_CAST) -# if (LZO_CFG_USE_NEW_STYLE_CASTS) -# define LZO_REINTERPRET_CAST(t,e) (reinterpret_cast<t> (e)) -# endif -#endif -#if !defined(LZO_REINTERPRET_CAST) -# define LZO_REINTERPRET_CAST(t,e) ((t) (e)) -#endif -#if !defined(LZO_STATIC_CAST) -# if (LZO_CFG_USE_NEW_STYLE_CASTS) -# define LZO_STATIC_CAST(t,e) (static_cast<t> (e)) -# endif -#endif -#if !defined(LZO_STATIC_CAST) -# define LZO_STATIC_CAST(t,e) ((t) (e)) -#endif -#if !defined(LZO_STATIC_CAST2) -# define LZO_STATIC_CAST2(t1,t2,e) LZO_STATIC_CAST(t1, LZO_STATIC_CAST(t2, e)) -#endif -#if !defined(LZO_UNCONST_CAST) -# if (LZO_CFG_USE_NEW_STYLE_CASTS) -# define LZO_UNCONST_CAST(t,e) (const_cast<t> (e)) -# elif (LZO_HAVE_MM_HUGE_PTR) -# define LZO_UNCONST_CAST(t,e) ((t) (e)) -# elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) -# define LZO_UNCONST_CAST(t,e) ((t) ((void *) ((lzo_uintptr_t) ((const void *) (e))))) -# endif -#endif -#if !defined(LZO_UNCONST_CAST) -# define LZO_UNCONST_CAST(t,e) ((t) ((void *) ((const void *) (e)))) -#endif -#if !defined(LZO_UNCONST_VOLATILE_CAST) -# if (LZO_CFG_USE_NEW_STYLE_CASTS) -# define LZO_UNCONST_VOLATILE_CAST(t,e) (const_cast<t> (e)) -# elif (LZO_HAVE_MM_HUGE_PTR) -# define LZO_UNCONST_VOLATILE_CAST(t,e) ((t) (e)) -# elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) -# define LZO_UNCONST_VOLATILE_CAST(t,e) ((t) ((volatile void *) ((lzo_uintptr_t) ((volatile const void *) (e))))) -# endif -#endif -#if !defined(LZO_UNCONST_VOLATILE_CAST) -# define LZO_UNCONST_VOLATILE_CAST(t,e) ((t) ((volatile void *) ((volatile const void *) (e)))) -#endif -#if !defined(LZO_UNVOLATILE_CAST) -# if (LZO_CFG_USE_NEW_STYLE_CASTS) -# define LZO_UNVOLATILE_CAST(t,e) (const_cast<t> (e)) -# elif (LZO_HAVE_MM_HUGE_PTR) -# define LZO_UNVOLATILE_CAST(t,e) ((t) (e)) -# elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) -# define LZO_UNVOLATILE_CAST(t,e) ((t) ((void *) ((lzo_uintptr_t) ((volatile void *) (e))))) -# endif -#endif -#if !defined(LZO_UNVOLATILE_CAST) -# define LZO_UNVOLATILE_CAST(t,e) ((t) ((void *) ((volatile void *) (e)))) -#endif -#if !defined(LZO_UNVOLATILE_CONST_CAST) -# if (LZO_CFG_USE_NEW_STYLE_CASTS) -# define LZO_UNVOLATILE_CONST_CAST(t,e) (const_cast<t> (e)) -# elif (LZO_HAVE_MM_HUGE_PTR) -# define LZO_UNVOLATILE_CONST_CAST(t,e) ((t) (e)) -# elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) -# define LZO_UNVOLATILE_CONST_CAST(t,e) ((t) ((const void *) ((lzo_uintptr_t) ((volatile const void *) (e))))) -# endif -#endif -#if !defined(LZO_UNVOLATILE_CONST_CAST) -# define LZO_UNVOLATILE_CONST_CAST(t,e) ((t) ((const void *) ((volatile const void *) (e)))) -#endif -#if !defined(LZO_PCAST) -# if (LZO_HAVE_MM_HUGE_PTR) -# define LZO_PCAST(t,e) ((t) (e)) -# endif -#endif -#if !defined(LZO_PCAST) -# define LZO_PCAST(t,e) LZO_STATIC_CAST(t, LZO_STATIC_CAST(void *, e)) -#endif -#if !defined(LZO_CCAST) -# if (LZO_HAVE_MM_HUGE_PTR) -# define LZO_CCAST(t,e) ((t) (e)) -# endif -#endif -#if !defined(LZO_CCAST) -# define LZO_CCAST(t,e) LZO_STATIC_CAST(t, LZO_STATIC_CAST(const void *, e)) -#endif -#if !defined(LZO_ICONV) -# define LZO_ICONV(t,e) LZO_STATIC_CAST(t, e) -#endif -#if !defined(LZO_ICAST) -# define LZO_ICAST(t,e) LZO_STATIC_CAST(t, e) -#endif -#if !defined(LZO_ITRUNC) -# define LZO_ITRUNC(t,e) LZO_STATIC_CAST(t, e) -#endif -#if !defined(__lzo_cte) -# if (LZO_CC_MSC || LZO_CC_WATCOMC) -# define __lzo_cte(e) ((void)0,(e)) -# elif 1 -# define __lzo_cte(e) ((void)0,(e)) -# endif -#endif -#if !defined(__lzo_cte) -# define __lzo_cte(e) (e) -#endif -#if !defined(LZO_BLOCK_BEGIN) -# define LZO_BLOCK_BEGIN do { -# define LZO_BLOCK_END } while __lzo_cte(0) -#endif -#if !defined(LZO_UNUSED) -# if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0600)) -# define LZO_UNUSED(var) ((void) &var) -# elif (LZO_CC_BORLANDC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PELLESC || LZO_CC_TURBOC) -# define LZO_UNUSED(var) if (&var) ; else -# elif (LZO_CC_CLANG && (LZO_CC_CLANG >= 0x030200ul)) -# define LZO_UNUSED(var) ((void) &var) -# elif (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) -# define LZO_UNUSED(var) ((void) var) -# elif (LZO_CC_MSC && (_MSC_VER < 900)) -# define LZO_UNUSED(var) if (&var) ; else -# elif (LZO_CC_KEILC) -# define LZO_UNUSED(var) {extern int lzo_unused__[1-2*!(sizeof(var)>0)]; (void)lzo_unused__;} -# elif (LZO_CC_PACIFICC) -# define LZO_UNUSED(var) ((void) sizeof(var)) -# elif (LZO_CC_WATCOMC) && defined(__cplusplus) -# define LZO_UNUSED(var) ((void) var) -# else -# define LZO_UNUSED(var) ((void) &var) -# endif -#endif -#if !defined(LZO_UNUSED_FUNC) -# if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0600)) -# define LZO_UNUSED_FUNC(func) ((void) func) -# elif (LZO_CC_BORLANDC || LZO_CC_NDPC || LZO_CC_TURBOC) -# define LZO_UNUSED_FUNC(func) if (func) ; else -# elif (LZO_CC_CLANG || LZO_CC_LLVM) -# define LZO_UNUSED_FUNC(func) ((void) &func) -# elif (LZO_CC_MSC && (_MSC_VER < 900)) -# define LZO_UNUSED_FUNC(func) if (func) ; else -# elif (LZO_CC_MSC) -# define LZO_UNUSED_FUNC(func) ((void) &func) -# elif (LZO_CC_KEILC || LZO_CC_PELLESC) -# define LZO_UNUSED_FUNC(func) {extern int lzo_unused__[1-2*!(sizeof((int)func)>0)]; (void)lzo_unused__;} -# else -# define LZO_UNUSED_FUNC(func) ((void) func) -# endif -#endif -#if !defined(LZO_UNUSED_LABEL) -# if (LZO_CC_CLANG >= 0x020800ul) -# define LZO_UNUSED_LABEL(l) (__lzo_gnuc_extension__ ((void) ((const void *) &&l))) -# elif (LZO_CC_ARMCC || LZO_CC_CLANG || LZO_CC_INTELC || LZO_CC_WATCOMC) -# define LZO_UNUSED_LABEL(l) if __lzo_cte(0) goto l -# else -# define LZO_UNUSED_LABEL(l) switch (0) case 1:goto l -# endif -#endif -#if !defined(LZO_DEFINE_UNINITIALIZED_VAR) -# if 0 -# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var -# elif 0 && (LZO_CC_GNUC) -# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var = var -# else -# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var = init -# endif -#endif -#if !defined(__lzo_inline) -#if (LZO_CC_TURBOC && (__TURBOC__ <= 0x0295)) -#elif defined(__cplusplus) -# define __lzo_inline inline -#elif defined(__STDC_VERSION__) && (__STDC_VERSION__-0 >= 199901L) -# define __lzo_inline inline -#elif (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0550)) -# define __lzo_inline __inline -#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CILLY || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI) -# define __lzo_inline __inline__ -#elif (LZO_CC_DMC) -# define __lzo_inline __inline -#elif (LZO_CC_GHS) -# define __lzo_inline __inline__ -#elif (LZO_CC_IBMC >= 600) -# define __lzo_inline __inline__ -#elif (LZO_CC_INTELC) -# define __lzo_inline __inline -#elif (LZO_CC_MWERKS && (__MWERKS__ >= 0x2405)) -# define __lzo_inline __inline -#elif (LZO_CC_MSC && (_MSC_VER >= 900)) -# define __lzo_inline __inline -#elif (LZO_CC_SUNPROC >= 0x5100) -# define __lzo_inline __inline__ -#endif -#endif -#if defined(__lzo_inline) -# ifndef __lzo_HAVE_inline -# define __lzo_HAVE_inline 1 -# endif -#else -# define __lzo_inline /*empty*/ -#endif -#if !defined(__lzo_forceinline) -#if (LZO_CC_GNUC >= 0x030200ul) -# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) -#elif (LZO_CC_IBMC >= 700) -# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) -#elif (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 450)) -# define __lzo_forceinline __forceinline -#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 800)) -# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) -#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) -# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) -#elif (LZO_CC_MSC && (_MSC_VER >= 1200)) -# define __lzo_forceinline __forceinline -#elif (LZO_CC_PGI >= 0x0d0a00ul) -# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) -#elif (LZO_CC_SUNPROC >= 0x5100) -# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) -#endif -#endif -#if defined(__lzo_forceinline) -# ifndef __lzo_HAVE_forceinline -# define __lzo_HAVE_forceinline 1 -# endif -#else -# define __lzo_forceinline __lzo_inline -#endif -#if !defined(__lzo_noinline) -#if 1 && (LZO_ARCH_I386) && (LZO_CC_GNUC >= 0x040000ul) && (LZO_CC_GNUC < 0x040003ul) -# define __lzo_noinline __attribute__((__noinline__,__used__)) -#elif (LZO_CC_GNUC >= 0x030200ul) -# define __lzo_noinline __attribute__((__noinline__)) -#elif (LZO_CC_IBMC >= 700) -# define __lzo_noinline __attribute__((__noinline__)) -#elif (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 600)) -# define __lzo_noinline __declspec(noinline) -#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 800)) -# define __lzo_noinline __attribute__((__noinline__)) -#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) -# define __lzo_noinline __attribute__((__noinline__)) -#elif (LZO_CC_MSC && (_MSC_VER >= 1300)) -# define __lzo_noinline __declspec(noinline) -#elif (LZO_CC_MWERKS && (__MWERKS__ >= 0x3200) && (LZO_OS_WIN32 || LZO_OS_WIN64)) -# if defined(__cplusplus) -# else -# define __lzo_noinline __declspec(noinline) -# endif -#elif (LZO_CC_PGI >= 0x0d0a00ul) -# define __lzo_noinline __attribute__((__noinline__)) -#elif (LZO_CC_SUNPROC >= 0x5100) -# define __lzo_noinline __attribute__((__noinline__)) -#endif -#endif -#if defined(__lzo_noinline) -# ifndef __lzo_HAVE_noinline -# define __lzo_HAVE_noinline 1 -# endif -#else -# define __lzo_noinline /*empty*/ -#endif -#if (__lzo_HAVE_forceinline || __lzo_HAVE_noinline) && !(__lzo_HAVE_inline) -# error "unexpected configuration - check your compiler defines" -#endif -#if !defined(__lzo_static_inline) -#if (LZO_CC_IBMC) -# define __lzo_static_inline __lzo_gnuc_extension__ static __lzo_inline -#endif -#endif -#if !defined(__lzo_static_inline) -# define __lzo_static_inline static __lzo_inline -#endif -#if !defined(__lzo_static_forceinline) -#if (LZO_CC_IBMC) -# define __lzo_static_forceinline __lzo_gnuc_extension__ static __lzo_forceinline -#endif -#endif -#if !defined(__lzo_static_forceinline) -# define __lzo_static_forceinline static __lzo_forceinline -#endif -#if !defined(__lzo_static_noinline) -#if (LZO_CC_IBMC) -# define __lzo_static_noinline __lzo_gnuc_extension__ static __lzo_noinline -#endif -#endif -#if !defined(__lzo_static_noinline) -# define __lzo_static_noinline static __lzo_noinline -#endif -#if !defined(__lzo_c99_extern_inline) -#if defined(__GNUC_GNU_INLINE__) -# define __lzo_c99_extern_inline __lzo_inline -#elif defined(__GNUC_STDC_INLINE__) -# define __lzo_c99_extern_inline extern __lzo_inline -#elif defined(__STDC_VERSION__) && (__STDC_VERSION__-0 >= 199901L) -# define __lzo_c99_extern_inline extern __lzo_inline -#endif -#if !defined(__lzo_c99_extern_inline) && (__lzo_HAVE_inline) -# define __lzo_c99_extern_inline __lzo_inline -#endif -#endif -#if defined(__lzo_c99_extern_inline) -# ifndef __lzo_HAVE_c99_extern_inline -# define __lzo_HAVE_c99_extern_inline 1 -# endif -#else -# define __lzo_c99_extern_inline /*empty*/ -#endif -#if !defined(__lzo_may_alias) -#if (LZO_CC_GNUC >= 0x030400ul) -# define __lzo_may_alias __attribute__((__may_alias__)) -#elif (LZO_CC_CLANG >= 0x020900ul) -# define __lzo_may_alias __attribute__((__may_alias__)) -#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 1210)) && 0 -# define __lzo_may_alias __attribute__((__may_alias__)) -#elif (LZO_CC_PGI >= 0x0d0a00ul) && 0 -# define __lzo_may_alias __attribute__((__may_alias__)) -#endif -#endif -#if defined(__lzo_may_alias) -# ifndef __lzo_HAVE_may_alias -# define __lzo_HAVE_may_alias 1 -# endif -#else -# define __lzo_may_alias /*empty*/ -#endif -#if !defined(__lzo_noreturn) -#if (LZO_CC_GNUC >= 0x020700ul) -# define __lzo_noreturn __attribute__((__noreturn__)) -#elif (LZO_CC_IBMC >= 700) -# define __lzo_noreturn __attribute__((__noreturn__)) -#elif (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 450)) -# define __lzo_noreturn __declspec(noreturn) -#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 600)) -# define __lzo_noreturn __attribute__((__noreturn__)) -#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) -# define __lzo_noreturn __attribute__((__noreturn__)) -#elif (LZO_CC_MSC && (_MSC_VER >= 1200)) -# define __lzo_noreturn __declspec(noreturn) -#elif (LZO_CC_PGI >= 0x0d0a00ul) -# define __lzo_noreturn __attribute__((__noreturn__)) -#endif -#endif -#if defined(__lzo_noreturn) -# ifndef __lzo_HAVE_noreturn -# define __lzo_HAVE_noreturn 1 -# endif -#else -# define __lzo_noreturn /*empty*/ -#endif -#if !defined(__lzo_nothrow) -#if (LZO_CC_GNUC >= 0x030300ul) -# define __lzo_nothrow __attribute__((__nothrow__)) -#elif (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 450)) && defined(__cplusplus) -# define __lzo_nothrow __declspec(nothrow) -#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 900)) -# define __lzo_nothrow __attribute__((__nothrow__)) -#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) -# define __lzo_nothrow __attribute__((__nothrow__)) -#elif (LZO_CC_MSC && (_MSC_VER >= 1200)) && defined(__cplusplus) -# define __lzo_nothrow __declspec(nothrow) -#endif -#endif -#if defined(__lzo_nothrow) -# ifndef __lzo_HAVE_nothrow -# define __lzo_HAVE_nothrow 1 -# endif -#else -# define __lzo_nothrow /*empty*/ -#endif -#if !defined(__lzo_restrict) -#if (LZO_CC_GNUC >= 0x030400ul) -# define __lzo_restrict __restrict__ -#elif (LZO_CC_IBMC >= 800) && !defined(__cplusplus) -# define __lzo_restrict __restrict__ -#elif (LZO_CC_IBMC >= 1210) -# define __lzo_restrict __restrict__ -#elif (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 600)) -#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 600)) -# define __lzo_restrict __restrict__ -#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM) -# define __lzo_restrict __restrict__ -#elif (LZO_CC_MSC && (_MSC_VER >= 1400)) -# define __lzo_restrict __restrict -#elif (LZO_CC_PGI >= 0x0d0a00ul) -# define __lzo_restrict __restrict__ -#endif -#endif -#if defined(__lzo_restrict) -# ifndef __lzo_HAVE_restrict -# define __lzo_HAVE_restrict 1 -# endif -#else -# define __lzo_restrict /*empty*/ -#endif -#if !defined(__lzo_alignof) -#if (LZO_CC_ARMCC || LZO_CC_CILLY || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI) -# define __lzo_alignof(e) __alignof__(e) -#elif (LZO_CC_GHS) && !defined(__cplusplus) -# define __lzo_alignof(e) __alignof__(e) -#elif (LZO_CC_IBMC >= 600) -# define __lzo_alignof(e) (__lzo_gnuc_extension__ __alignof__(e)) -#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 700)) -# define __lzo_alignof(e) __alignof__(e) -#elif (LZO_CC_MSC && (_MSC_VER >= 1300)) -# define __lzo_alignof(e) __alignof(e) -#elif (LZO_CC_SUNPROC >= 0x5100) -# define __lzo_alignof(e) __alignof__(e) -#endif -#endif -#if defined(__lzo_alignof) -# ifndef __lzo_HAVE_alignof -# define __lzo_HAVE_alignof 1 -# endif -#endif -#if !defined(__lzo_struct_packed) -#if (LZO_CC_CLANG && (LZO_CC_CLANG < 0x020800ul)) && defined(__cplusplus) -#elif (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020700ul)) -#elif (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020800ul)) && defined(__cplusplus) -#elif (LZO_CC_PCC && (LZO_CC_PCC < 0x010100ul)) -#elif (LZO_CC_SUNPROC && (LZO_CC_SUNPROC < 0x5110)) && !defined(__cplusplus) -#elif (LZO_CC_GNUC >= 0x030400ul) && !(LZO_CC_PCC_GNUC) && (LZO_ARCH_AMD64 || LZO_ARCH_I386) -# define __lzo_struct_packed(s) struct s { -# define __lzo_struct_packed_end() } __attribute__((__gcc_struct__,__packed__)); -# define __lzo_struct_packed_ma_end() } __lzo_may_alias __attribute__((__gcc_struct__,__packed__)); -#elif (LZO_CC_ARMCC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_INTELC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || (LZO_CC_PGI >= 0x0d0a00ul) || (LZO_CC_SUNPROC >= 0x5100)) -# define __lzo_struct_packed(s) struct s { -# define __lzo_struct_packed_end() } __attribute__((__packed__)); -# define __lzo_struct_packed_ma_end() } __lzo_may_alias __attribute__((__packed__)); -#elif (LZO_CC_IBMC >= 700) -# define __lzo_struct_packed(s) __lzo_gnuc_extension__ struct s { -# define __lzo_struct_packed_end() } __attribute__((__packed__)); -# define __lzo_struct_packed_ma_end() } __lzo_may_alias __attribute__((__packed__)); -#elif (LZO_CC_INTELC_MSC) || (LZO_CC_MSC && (_MSC_VER >= 1300)) -# define __lzo_struct_packed(s) __pragma(pack(push,1)) struct s { -# define __lzo_struct_packed_end() } __pragma(pack(pop)); -#elif (LZO_CC_WATCOMC && (__WATCOMC__ >= 900)) -# define __lzo_struct_packed(s) _Packed struct s { -# define __lzo_struct_packed_end() }; -#endif -#endif -#if defined(__lzo_struct_packed) && !defined(__lzo_struct_packed_ma) -# define __lzo_struct_packed_ma(s) __lzo_struct_packed(s) -#endif -#if defined(__lzo_struct_packed_end) && !defined(__lzo_struct_packed_ma_end) -# define __lzo_struct_packed_ma_end() __lzo_struct_packed_end() -#endif -#if !defined(__lzo_byte_struct) -#if defined(__lzo_struct_packed) -# define __lzo_byte_struct(s,n) __lzo_struct_packed(s) unsigned char a[n]; __lzo_struct_packed_end() -# define __lzo_byte_struct_ma(s,n) __lzo_struct_packed_ma(s) unsigned char a[n]; __lzo_struct_packed_ma_end() -#elif (LZO_CC_CILLY || LZO_CC_CLANG || LZO_CC_PGI || (LZO_CC_SUNPROC >= 0x5100)) -# define __lzo_byte_struct(s,n) struct s { unsigned char a[n]; } __attribute__((__packed__)); -# define __lzo_byte_struct_ma(s,n) struct s { unsigned char a[n]; } __lzo_may_alias __attribute__((__packed__)); -#endif -#endif -#if defined(__lzo_byte_struct) && !defined(__lzo_byte_struct_ma) -# define __lzo_byte_struct_ma(s,n) __lzo_byte_struct(s,n) -#endif -#if !defined(__lzo_struct_align16) && (__lzo_HAVE_alignof) -#if (LZO_CC_GNUC && (LZO_CC_GNUC < 0x030000ul)) -#elif (LZO_CC_CLANG && (LZO_CC_CLANG < 0x020800ul)) && defined(__cplusplus) -#elif (LZO_CC_CILLY || LZO_CC_PCC) -#elif (LZO_CC_INTELC_MSC) || (LZO_CC_MSC && (_MSC_VER >= 1300)) -# define __lzo_struct_align16(s) struct __declspec(align(16)) s { -# define __lzo_struct_align16_end() }; -# define __lzo_struct_align32(s) struct __declspec(align(32)) s { -# define __lzo_struct_align32_end() }; -# define __lzo_struct_align64(s) struct __declspec(align(64)) s { -# define __lzo_struct_align64_end() }; -#elif (LZO_CC_ARMCC || LZO_CC_CLANG || LZO_CC_GNUC || (LZO_CC_IBMC >= 700) || LZO_CC_INTELC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) -# define __lzo_struct_align16(s) struct s { -# define __lzo_struct_align16_end() } __attribute__((__aligned__(16))); -# define __lzo_struct_align32(s) struct s { -# define __lzo_struct_align32_end() } __attribute__((__aligned__(32))); -# define __lzo_struct_align64(s) struct s { -# define __lzo_struct_align64_end() } __attribute__((__aligned__(64))); -#endif -#endif -#if !defined(__lzo_union_um) -#if (LZO_CC_CLANG && (LZO_CC_CLANG < 0x020800ul)) && defined(__cplusplus) -#elif (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020700ul)) -#elif (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020800ul)) && defined(__cplusplus) -#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER < 810)) -#elif (LZO_CC_PCC && (LZO_CC_PCC < 0x010100ul)) -#elif (LZO_CC_SUNPROC && (LZO_CC_SUNPROC < 0x5110)) && !defined(__cplusplus) -#elif (LZO_CC_ARMCC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_INTELC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || (LZO_CC_PGI >= 0x0d0a00ul) || (LZO_CC_SUNPROC >= 0x5100)) -# define __lzo_union_am(s) union s { -# define __lzo_union_am_end() } __lzo_may_alias; -# define __lzo_union_um(s) union s { -# define __lzo_union_um_end() } __lzo_may_alias __attribute__((__packed__)); -#elif (LZO_CC_IBMC >= 700) -# define __lzo_union_am(s) __lzo_gnuc_extension__ union s { -# define __lzo_union_am_end() } __lzo_may_alias; -# define __lzo_union_um(s) __lzo_gnuc_extension__ union s { -# define __lzo_union_um_end() } __lzo_may_alias __attribute__((__packed__)); -#elif (LZO_CC_INTELC_MSC) || (LZO_CC_MSC && (_MSC_VER >= 1300)) -# define __lzo_union_um(s) __pragma(pack(push,1)) union s { -# define __lzo_union_um_end() } __pragma(pack(pop)); -#elif (LZO_CC_WATCOMC && (__WATCOMC__ >= 900)) -# define __lzo_union_um(s) _Packed union s { -# define __lzo_union_um_end() }; -#endif -#endif -#if !defined(__lzo_union_am) -# define __lzo_union_am(s) union s { -# define __lzo_union_am_end() }; -#endif -#if !defined(__lzo_constructor) -#if (LZO_CC_GNUC >= 0x030400ul) -# define __lzo_constructor __attribute__((__constructor__,__used__)) -#elif (LZO_CC_GNUC >= 0x020700ul) -# define __lzo_constructor __attribute__((__constructor__)) -#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 800)) -# define __lzo_constructor __attribute__((__constructor__,__used__)) -#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) -# define __lzo_constructor __attribute__((__constructor__)) -#endif -#endif -#if defined(__lzo_constructor) -# ifndef __lzo_HAVE_constructor -# define __lzo_HAVE_constructor 1 -# endif -#endif -#if !defined(__lzo_destructor) -#if (LZO_CC_GNUC >= 0x030400ul) -# define __lzo_destructor __attribute__((__destructor__,__used__)) -#elif (LZO_CC_GNUC >= 0x020700ul) -# define __lzo_destructor __attribute__((__destructor__)) -#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 800)) -# define __lzo_destructor __attribute__((__destructor__,__used__)) -#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) -# define __lzo_destructor __attribute__((__destructor__)) -#endif -#endif -#if defined(__lzo_destructor) -# ifndef __lzo_HAVE_destructor -# define __lzo_HAVE_destructor 1 -# endif -#endif -#if (__lzo_HAVE_destructor) && !(__lzo_HAVE_constructor) -# error "unexpected configuration - check your compiler defines" -#endif -#if !defined(__lzo_likely) && !defined(__lzo_unlikely) -#if (LZO_CC_GNUC >= 0x030200ul) -# define __lzo_likely(e) (__builtin_expect(!!(e),1)) -# define __lzo_unlikely(e) (__builtin_expect(!!(e),0)) -#elif (LZO_CC_IBMC >= 1010) -# define __lzo_likely(e) (__builtin_expect(!!(e),1)) -# define __lzo_unlikely(e) (__builtin_expect(!!(e),0)) -#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 800)) -# define __lzo_likely(e) (__builtin_expect(!!(e),1)) -# define __lzo_unlikely(e) (__builtin_expect(!!(e),0)) -#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) -# define __lzo_likely(e) (__builtin_expect(!!(e),1)) -# define __lzo_unlikely(e) (__builtin_expect(!!(e),0)) -#endif -#endif -#if defined(__lzo_likely) -# ifndef __lzo_HAVE_likely -# define __lzo_HAVE_likely 1 -# endif -#else -# define __lzo_likely(e) (e) -#endif -#if defined(__lzo_very_likely) -# ifndef __lzo_HAVE_very_likely -# define __lzo_HAVE_very_likely 1 -# endif -#else -# define __lzo_very_likely(e) __lzo_likely(e) -#endif -#if defined(__lzo_unlikely) -# ifndef __lzo_HAVE_unlikely -# define __lzo_HAVE_unlikely 1 -# endif -#else -# define __lzo_unlikely(e) (e) -#endif -#if defined(__lzo_very_unlikely) -# ifndef __lzo_HAVE_very_unlikely -# define __lzo_HAVE_very_unlikely 1 -# endif -#else -# define __lzo_very_unlikely(e) __lzo_unlikely(e) -#endif -#if !defined(__lzo_loop_forever) -# if (LZO_CC_IBMC) -# define __lzo_loop_forever() LZO_BLOCK_BEGIN for (;;) { ; } LZO_BLOCK_END -# else -# define __lzo_loop_forever() do { ; } while __lzo_cte(1) -# endif -#endif -#if !defined(__lzo_unreachable) -#if (LZO_CC_CLANG && (LZO_CC_CLANG >= 0x020800ul)) && lzo_has_builtin(__builtin_unreachable) -# define __lzo_unreachable() __builtin_unreachable(); -#elif (LZO_CC_GNUC >= 0x040500ul) -# define __lzo_unreachable() __builtin_unreachable(); -#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 1300)) && 1 -# define __lzo_unreachable() __builtin_unreachable(); -#endif -#endif -#if defined(__lzo_unreachable) -# ifndef __lzo_HAVE_unreachable -# define __lzo_HAVE_unreachable 1 -# endif -#else -# if 0 -# define __lzo_unreachable() ((void)0); -# else -# define __lzo_unreachable() __lzo_loop_forever(); -# endif -#endif -#if !defined(lzo_unused_funcs_impl) -# if 1 && (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || (LZO_CC_GNUC >= 0x020700ul) || LZO_CC_INTELC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI) -# define lzo_unused_funcs_impl(r,f) static r __attribute__((__unused__)) f -# elif 1 && (LZO_CC_BORLANDC || LZO_CC_GNUC) -# define lzo_unused_funcs_impl(r,f) static r f -# else -# define lzo_unused_funcs_impl(r,f) __lzo_static_forceinline r f -# endif -#endif -#ifndef __LZO_CTA_NAME -#if (LZO_CFG_USE_COUNTER) -# define __LZO_CTA_NAME(a) LZO_PP_ECONCAT2(a,__COUNTER__) -#else -# define __LZO_CTA_NAME(a) LZO_PP_ECONCAT2(a,__LINE__) -#endif -#endif -#if !defined(LZO_COMPILE_TIME_ASSERT_HEADER) -# if (LZO_CC_AZTECC || LZO_CC_ZORTECHC) -# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN extern int __LZO_CTA_NAME(lzo_cta__)[1-!(e)]; LZO_EXTERN_C_END -# elif (LZO_CC_DMC || LZO_CC_SYMANTECC) -# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN extern int __LZO_CTA_NAME(lzo_cta__)[1u-2*!(e)]; LZO_EXTERN_C_END -# elif (LZO_CC_TURBOC && (__TURBOC__ == 0x0295)) -# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN extern int __LZO_CTA_NAME(lzo_cta__)[1-!(e)]; LZO_EXTERN_C_END -# elif (LZO_CC_CLANG && (LZO_CC_CLANG < 0x020900ul)) && defined(__cplusplus) -# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN int __LZO_CTA_NAME(lzo_cta_f__)(int [1-2*!(e)]); LZO_EXTERN_C_END -# elif (LZO_CC_GNUC) && defined(__CHECKER__) && defined(__SPARSE_CHECKER__) -# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN enum {__LZO_CTA_NAME(lzo_cta_e__)=1/!!(e)} __attribute__((__unused__)); LZO_EXTERN_C_END -# else -# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN extern int __LZO_CTA_NAME(lzo_cta__)[1-2*!(e)]; LZO_EXTERN_C_END -# endif -#endif -#if !defined(LZO_COMPILE_TIME_ASSERT) -# if (LZO_CC_AZTECC) -# define LZO_COMPILE_TIME_ASSERT(e) {typedef int __LZO_CTA_NAME(lzo_cta_t__)[1-!(e)];} -# elif (LZO_CC_CLANG && (LZO_CC_CLANG >= 0x030000ul)) -# define LZO_COMPILE_TIME_ASSERT(e) {typedef int __LZO_CTA_NAME(lzo_cta_t__)[1-2*!(e)] __attribute__((__unused__));} -# elif (LZO_CC_DMC || LZO_CC_PACIFICC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC) -# define LZO_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break; -# elif (LZO_CC_GNUC) && defined(__CHECKER__) && defined(__SPARSE_CHECKER__) -# define LZO_COMPILE_TIME_ASSERT(e) {(void) (0/!!(e));} -# elif (LZO_CC_GNUC >= 0x040700ul) && (LZO_CFG_USE_COUNTER) && defined(__cplusplus) -# define LZO_COMPILE_TIME_ASSERT(e) {enum {__LZO_CTA_NAME(lzo_cta_e__)=1/!!(e)} __attribute__((__unused__));} -# elif (LZO_CC_GNUC >= 0x040700ul) -# define LZO_COMPILE_TIME_ASSERT(e) {typedef int __LZO_CTA_NAME(lzo_cta_t__)[1-2*!(e)] __attribute__((__unused__));} -# elif (LZO_CC_MSC && (_MSC_VER < 900)) -# define LZO_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break; -# elif (LZO_CC_TURBOC && (__TURBOC__ == 0x0295)) -# define LZO_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break; -# else -# define LZO_COMPILE_TIME_ASSERT(e) {typedef int __LZO_CTA_NAME(lzo_cta_t__)[1-2*!(e)];} -# endif -#endif -LZO_COMPILE_TIME_ASSERT_HEADER(1 == 1) -#if defined(__cplusplus) -extern "C" { LZO_COMPILE_TIME_ASSERT_HEADER(2 == 2) } -#endif -LZO_COMPILE_TIME_ASSERT_HEADER(3 == 3) -#if (LZO_ARCH_I086 || LZO_ARCH_I386) && (LZO_OS_DOS16 || LZO_OS_DOS32 || LZO_OS_OS2 || LZO_OS_OS216 || LZO_OS_WIN16 || LZO_OS_WIN32 || LZO_OS_WIN64) -# if (LZO_CC_GNUC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PACIFICC) -# elif (LZO_CC_DMC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC) -# define __lzo_cdecl __cdecl -# define __lzo_cdecl_atexit /*empty*/ -# define __lzo_cdecl_main __cdecl -# if (LZO_OS_OS2 && (LZO_CC_DMC || LZO_CC_SYMANTECC)) -# define __lzo_cdecl_qsort __pascal -# elif (LZO_OS_OS2 && (LZO_CC_ZORTECHC)) -# define __lzo_cdecl_qsort _stdcall -# else -# define __lzo_cdecl_qsort __cdecl -# endif -# elif (LZO_CC_WATCOMC) -# define __lzo_cdecl __cdecl -# else -# define __lzo_cdecl __cdecl -# define __lzo_cdecl_atexit __cdecl -# define __lzo_cdecl_main __cdecl -# define __lzo_cdecl_qsort __cdecl -# endif -# if (LZO_CC_GNUC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PACIFICC || LZO_CC_WATCOMC) -# elif (LZO_OS_OS2 && (LZO_CC_DMC || LZO_CC_SYMANTECC)) -# define __lzo_cdecl_sighandler __pascal -# elif (LZO_OS_OS2 && (LZO_CC_ZORTECHC)) -# define __lzo_cdecl_sighandler _stdcall -# elif (LZO_CC_MSC && (_MSC_VER >= 1400)) && defined(_M_CEE_PURE) -# define __lzo_cdecl_sighandler __clrcall -# elif (LZO_CC_MSC && (_MSC_VER >= 600 && _MSC_VER < 700)) -# if defined(_DLL) -# define __lzo_cdecl_sighandler _far _cdecl _loadds -# elif defined(_MT) -# define __lzo_cdecl_sighandler _far _cdecl -# else -# define __lzo_cdecl_sighandler _cdecl -# endif -# else -# define __lzo_cdecl_sighandler __cdecl -# endif -#elif (LZO_ARCH_I386) && (LZO_CC_WATCOMC) -# define __lzo_cdecl __cdecl -#elif (LZO_ARCH_M68K && LZO_OS_TOS && (LZO_CC_PUREC || LZO_CC_TURBOC)) -# define __lzo_cdecl cdecl -#endif -#if !defined(__lzo_cdecl) -# define __lzo_cdecl /*empty*/ -#endif -#if !defined(__lzo_cdecl_atexit) -# define __lzo_cdecl_atexit /*empty*/ -#endif -#if !defined(__lzo_cdecl_main) -# define __lzo_cdecl_main /*empty*/ -#endif -#if !defined(__lzo_cdecl_qsort) -# define __lzo_cdecl_qsort /*empty*/ -#endif -#if !defined(__lzo_cdecl_sighandler) -# define __lzo_cdecl_sighandler /*empty*/ -#endif -#if !defined(__lzo_cdecl_va) -# define __lzo_cdecl_va __lzo_cdecl -#endif -#if !(LZO_CFG_NO_WINDOWS_H) -#if !defined(LZO_HAVE_WINDOWS_H) -#if (LZO_OS_CYGWIN || (LZO_OS_EMX && defined(__RSXNT__)) || LZO_OS_WIN32 || LZO_OS_WIN64) -# if (LZO_CC_WATCOMC && (__WATCOMC__ < 1000)) -# elif ((LZO_OS_WIN32 && defined(__PW32__)) && (LZO_CC_GNUC && (LZO_CC_GNUC < 0x030000ul))) -# elif ((LZO_OS_CYGWIN || defined(__MINGW32__)) && (LZO_CC_GNUC && (LZO_CC_GNUC < 0x025f00ul))) -# else -# define LZO_HAVE_WINDOWS_H 1 -# endif -#endif -#endif -#endif -#ifndef LZO_SIZEOF_SHORT -#if defined(SIZEOF_SHORT) -# define LZO_SIZEOF_SHORT (SIZEOF_SHORT) -#elif defined(__SIZEOF_SHORT__) -# define LZO_SIZEOF_SHORT (__SIZEOF_SHORT__) -#endif -#endif -#ifndef LZO_SIZEOF_INT -#if defined(SIZEOF_INT) -# define LZO_SIZEOF_INT (SIZEOF_INT) -#elif defined(__SIZEOF_INT__) -# define LZO_SIZEOF_INT (__SIZEOF_INT__) -#endif -#endif -#ifndef LZO_SIZEOF_LONG -#if defined(SIZEOF_LONG) -# define LZO_SIZEOF_LONG (SIZEOF_LONG) -#elif defined(__SIZEOF_LONG__) -# define LZO_SIZEOF_LONG (__SIZEOF_LONG__) -#endif -#endif -#ifndef LZO_SIZEOF_LONG_LONG -#if defined(SIZEOF_LONG_LONG) -# define LZO_SIZEOF_LONG_LONG (SIZEOF_LONG_LONG) -#elif defined(__SIZEOF_LONG_LONG__) -# define LZO_SIZEOF_LONG_LONG (__SIZEOF_LONG_LONG__) -#endif -#endif -#ifndef LZO_SIZEOF___INT16 -#if defined(SIZEOF___INT16) -# define LZO_SIZEOF___INT16 (SIZEOF___INT16) -#endif -#endif -#ifndef LZO_SIZEOF___INT32 -#if defined(SIZEOF___INT32) -# define LZO_SIZEOF___INT32 (SIZEOF___INT32) -#endif -#endif -#ifndef LZO_SIZEOF___INT64 -#if defined(SIZEOF___INT64) -# define LZO_SIZEOF___INT64 (SIZEOF___INT64) -#endif -#endif -#ifndef LZO_SIZEOF_VOID_P -#if defined(SIZEOF_VOID_P) -# define LZO_SIZEOF_VOID_P (SIZEOF_VOID_P) -#elif defined(__SIZEOF_POINTER__) -# define LZO_SIZEOF_VOID_P (__SIZEOF_POINTER__) -#endif -#endif -#ifndef LZO_SIZEOF_SIZE_T -#if defined(SIZEOF_SIZE_T) -# define LZO_SIZEOF_SIZE_T (SIZEOF_SIZE_T) -#elif defined(__SIZEOF_SIZE_T__) -# define LZO_SIZEOF_SIZE_T (__SIZEOF_SIZE_T__) -#endif -#endif -#ifndef LZO_SIZEOF_PTRDIFF_T -#if defined(SIZEOF_PTRDIFF_T) -# define LZO_SIZEOF_PTRDIFF_T (SIZEOF_PTRDIFF_T) -#elif defined(__SIZEOF_PTRDIFF_T__) -# define LZO_SIZEOF_PTRDIFF_T (__SIZEOF_PTRDIFF_T__) -#endif -#endif -#define __LZO_LSR(x,b) (((x)+0ul) >> (b)) -#if !defined(LZO_SIZEOF_SHORT) -# if (LZO_ARCH_CRAY_PVP) -# define LZO_SIZEOF_SHORT 8 -# elif (USHRT_MAX == LZO_0xffffL) -# define LZO_SIZEOF_SHORT 2 -# elif (__LZO_LSR(USHRT_MAX,7) == 1) -# define LZO_SIZEOF_SHORT 1 -# elif (__LZO_LSR(USHRT_MAX,15) == 1) -# define LZO_SIZEOF_SHORT 2 -# elif (__LZO_LSR(USHRT_MAX,31) == 1) -# define LZO_SIZEOF_SHORT 4 -# elif (__LZO_LSR(USHRT_MAX,63) == 1) -# define LZO_SIZEOF_SHORT 8 -# elif (__LZO_LSR(USHRT_MAX,127) == 1) -# define LZO_SIZEOF_SHORT 16 -# else -# error "LZO_SIZEOF_SHORT" -# endif -#endif -LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_SHORT == sizeof(short)) -#if !defined(LZO_SIZEOF_INT) -# if (LZO_ARCH_CRAY_PVP) -# define LZO_SIZEOF_INT 8 -# elif (UINT_MAX == LZO_0xffffL) -# define LZO_SIZEOF_INT 2 -# elif (UINT_MAX == LZO_0xffffffffL) -# define LZO_SIZEOF_INT 4 -# elif (__LZO_LSR(UINT_MAX,7) == 1) -# define LZO_SIZEOF_INT 1 -# elif (__LZO_LSR(UINT_MAX,15) == 1) -# define LZO_SIZEOF_INT 2 -# elif (__LZO_LSR(UINT_MAX,31) == 1) -# define LZO_SIZEOF_INT 4 -# elif (__LZO_LSR(UINT_MAX,63) == 1) -# define LZO_SIZEOF_INT 8 -# elif (__LZO_LSR(UINT_MAX,127) == 1) -# define LZO_SIZEOF_INT 16 -# else -# error "LZO_SIZEOF_INT" -# endif -#endif -LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_INT == sizeof(int)) -#if !defined(LZO_SIZEOF_LONG) -# if (ULONG_MAX == LZO_0xffffffffL) -# define LZO_SIZEOF_LONG 4 -# elif (__LZO_LSR(ULONG_MAX,7) == 1) -# define LZO_SIZEOF_LONG 1 -# elif (__LZO_LSR(ULONG_MAX,15) == 1) -# define LZO_SIZEOF_LONG 2 -# elif (__LZO_LSR(ULONG_MAX,31) == 1) -# define LZO_SIZEOF_LONG 4 -# elif (__LZO_LSR(ULONG_MAX,39) == 1) -# define LZO_SIZEOF_LONG 5 -# elif (__LZO_LSR(ULONG_MAX,63) == 1) -# define LZO_SIZEOF_LONG 8 -# elif (__LZO_LSR(ULONG_MAX,127) == 1) -# define LZO_SIZEOF_LONG 16 -# else -# error "LZO_SIZEOF_LONG" -# endif -#endif -LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_LONG == sizeof(long)) -#if !defined(LZO_SIZEOF_LONG_LONG) && !defined(LZO_SIZEOF___INT64) -#if (LZO_SIZEOF_LONG > 0 && LZO_SIZEOF_LONG < 8) -# if defined(__LONG_MAX__) && defined(__LONG_LONG_MAX__) -# if (LZO_CC_GNUC >= 0x030300ul) -# if ((__LONG_MAX__-0) == (__LONG_LONG_MAX__-0)) -# define LZO_SIZEOF_LONG_LONG LZO_SIZEOF_LONG -# elif (__LZO_LSR(__LONG_LONG_MAX__,30) == 1) -# define LZO_SIZEOF_LONG_LONG 4 -# endif -# endif -# endif -#endif -#endif -#if !defined(LZO_SIZEOF_LONG_LONG) && !defined(LZO_SIZEOF___INT64) -#if (LZO_SIZEOF_LONG > 0 && LZO_SIZEOF_LONG < 8) -#if (LZO_ARCH_I086 && LZO_CC_DMC) -#elif (LZO_CC_CILLY) && defined(__GNUC__) -# define LZO_SIZEOF_LONG_LONG 8 -#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) -# define LZO_SIZEOF_LONG_LONG 8 -#elif ((LZO_OS_WIN32 || LZO_OS_WIN64 || defined(_WIN32)) && LZO_CC_MSC && (_MSC_VER >= 1400)) -# define LZO_SIZEOF_LONG_LONG 8 -#elif (LZO_OS_WIN64 || defined(_WIN64)) -# define LZO_SIZEOF___INT64 8 -#elif (LZO_ARCH_I386 && (LZO_CC_DMC)) -# define LZO_SIZEOF_LONG_LONG 8 -#elif (LZO_ARCH_I386 && (LZO_CC_SYMANTECC && (__SC__ >= 0x700))) -# define LZO_SIZEOF_LONG_LONG 8 -#elif (LZO_ARCH_I386 && (LZO_CC_INTELC && defined(__linux__))) -# define LZO_SIZEOF_LONG_LONG 8 -#elif (LZO_ARCH_I386 && (LZO_CC_MWERKS || LZO_CC_PELLESC || LZO_CC_PGI || LZO_CC_SUNPROC)) -# define LZO_SIZEOF_LONG_LONG 8 -#elif (LZO_ARCH_I386 && (LZO_CC_INTELC || LZO_CC_MSC)) -# define LZO_SIZEOF___INT64 8 -#elif ((LZO_OS_WIN32 || defined(_WIN32)) && (LZO_CC_MSC)) -# define LZO_SIZEOF___INT64 8 -#elif (LZO_ARCH_I386 && (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0520))) -# define LZO_SIZEOF___INT64 8 -#elif (LZO_ARCH_I386 && (LZO_CC_WATCOMC && (__WATCOMC__ >= 1100))) -# define LZO_SIZEOF___INT64 8 -#elif (LZO_CC_GHS && defined(__LLONG_BIT) && ((__LLONG_BIT-0) == 64)) -# define LZO_SIZEOF_LONG_LONG 8 -#elif (LZO_CC_WATCOMC && defined(_INTEGRAL_MAX_BITS) && ((_INTEGRAL_MAX_BITS-0) == 64)) -# define LZO_SIZEOF___INT64 8 -#elif (LZO_OS_OS400 || defined(__OS400__)) && defined(__LLP64_IFC__) -# define LZO_SIZEOF_LONG_LONG 8 -#elif (defined(__vms) || defined(__VMS)) && ((__INITIAL_POINTER_SIZE-0) == 64) -# define LZO_SIZEOF_LONG_LONG 8 -#elif (LZO_CC_SDCC) && (LZO_SIZEOF_INT == 2) -#elif 1 && defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) -# define LZO_SIZEOF_LONG_LONG 8 -#endif -#endif -#endif -#if defined(__cplusplus) && (LZO_CC_GNUC) -# if (LZO_CC_GNUC < 0x020800ul) -# undef LZO_SIZEOF_LONG_LONG -# endif -#endif -#if (LZO_CFG_NO_LONG_LONG) -# undef LZO_SIZEOF_LONG_LONG -#elif defined(__NO_LONG_LONG) -# undef LZO_SIZEOF_LONG_LONG -#elif defined(_NO_LONGLONG) -# undef LZO_SIZEOF_LONG_LONG -#endif -#if !defined(LZO_WORDSIZE) -#if (LZO_ARCH_ALPHA) -# define LZO_WORDSIZE 8 -#elif (LZO_ARCH_AMD64) -# define LZO_WORDSIZE 8 -#elif (LZO_ARCH_AVR) -# define LZO_WORDSIZE 1 -#elif (LZO_ARCH_H8300) -# if defined(__NORMAL_MODE__) -# define LZO_WORDSIZE 4 -# elif defined(__H8300H__) || defined(__H8300S__) || defined(__H8300SX__) -# define LZO_WORDSIZE 4 -# else -# define LZO_WORDSIZE 2 -# endif -#elif (LZO_ARCH_I086) -# define LZO_WORDSIZE 2 -#elif (LZO_ARCH_IA64) -# define LZO_WORDSIZE 8 -#elif (LZO_ARCH_M16C) -# define LZO_WORDSIZE 2 -#elif (LZO_ARCH_SPU) -# define LZO_WORDSIZE 4 -#elif (LZO_ARCH_Z80) -# define LZO_WORDSIZE 1 -#elif (LZO_SIZEOF_LONG == 8) && ((defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__)) -# define LZO_WORDSIZE 8 -#elif (LZO_OS_OS400 || defined(__OS400__)) -# define LZO_WORDSIZE 8 -#elif (defined(__vms) || defined(__VMS)) && (__INITIAL_POINTER_SIZE+0 == 64) -# define LZO_WORDSIZE 8 -#endif -#endif -#if !defined(LZO_SIZEOF_VOID_P) -#if defined(__ILP32__) || defined(__ILP32) || defined(_ILP32) -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(int) == 4) -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(long) == 4) -# define LZO_SIZEOF_VOID_P 4 -#elif defined(__ILP64__) || defined(__ILP64) || defined(_ILP64) -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(int) == 8) -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(long) == 8) -# define LZO_SIZEOF_VOID_P 8 -#elif defined(__LLP64__) || defined(__LLP64) || defined(_LLP64) || defined(_WIN64) -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(long) == 4) -# define LZO_SIZEOF_VOID_P 8 -#elif defined(__LP64__) || defined(__LP64) || defined(_LP64) -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(long) == 8) -# define LZO_SIZEOF_VOID_P 8 -#elif (LZO_ARCH_AVR) -# define LZO_SIZEOF_VOID_P 2 -#elif (LZO_ARCH_C166 || LZO_ARCH_MCS51 || LZO_ARCH_MCS251 || LZO_ARCH_MSP430) -# define LZO_SIZEOF_VOID_P 2 -#elif (LZO_ARCH_H8300) -# if defined(__NORMAL_MODE__) -# define LZO_SIZEOF_VOID_P 2 -# elif defined(__H8300H__) || defined(__H8300S__) || defined(__H8300SX__) -# define LZO_SIZEOF_VOID_P 4 -# else -# define LZO_SIZEOF_VOID_P 2 -# endif -# if (LZO_CC_GNUC && (LZO_CC_GNUC < 0x040000ul)) && (LZO_SIZEOF_INT == 4) -# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_INT -# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_INT -# endif -#elif (LZO_ARCH_I086) -# if (LZO_MM_TINY || LZO_MM_SMALL || LZO_MM_MEDIUM) -# define LZO_SIZEOF_VOID_P 2 -# elif (LZO_MM_COMPACT || LZO_MM_LARGE || LZO_MM_HUGE) -# define LZO_SIZEOF_VOID_P 4 -# else -# error "invalid LZO_ARCH_I086 memory model" -# endif -#elif (LZO_ARCH_M16C) -# if defined(__m32c_cpu__) || defined(__m32cm_cpu__) -# define LZO_SIZEOF_VOID_P 4 -# else -# define LZO_SIZEOF_VOID_P 2 -# endif -#elif (LZO_ARCH_SPU) -# define LZO_SIZEOF_VOID_P 4 -#elif (LZO_ARCH_Z80) -# define LZO_SIZEOF_VOID_P 2 -#elif (LZO_SIZEOF_LONG == 8) && ((defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__)) -# define LZO_SIZEOF_VOID_P 4 -#elif (LZO_OS_OS400 || defined(__OS400__)) -# if defined(__LLP64_IFC__) -# define LZO_SIZEOF_VOID_P 8 -# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG -# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG -# else -# define LZO_SIZEOF_VOID_P 16 -# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG -# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG -# endif -#elif (defined(__vms) || defined(__VMS)) && (__INITIAL_POINTER_SIZE+0 == 64) -# define LZO_SIZEOF_VOID_P 8 -# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG -# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG -#endif -#endif -#if !defined(LZO_SIZEOF_VOID_P) -# define LZO_SIZEOF_VOID_P LZO_SIZEOF_LONG -#endif -LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_VOID_P == sizeof(void *)) -#if !defined(LZO_SIZEOF_SIZE_T) -#if (LZO_ARCH_I086 || LZO_ARCH_M16C) -# define LZO_SIZEOF_SIZE_T 2 -#endif -#endif -#if !defined(LZO_SIZEOF_SIZE_T) -# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_VOID_P -#endif -#if defined(offsetof) -LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_SIZE_T == sizeof(size_t)) -#endif -#if !defined(LZO_SIZEOF_PTRDIFF_T) -#if (LZO_ARCH_I086) -# if (LZO_MM_TINY || LZO_MM_SMALL || LZO_MM_MEDIUM || LZO_MM_HUGE) -# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_VOID_P -# elif (LZO_MM_COMPACT || LZO_MM_LARGE) -# if (LZO_CC_BORLANDC || LZO_CC_TURBOC) -# define LZO_SIZEOF_PTRDIFF_T 4 -# else -# define LZO_SIZEOF_PTRDIFF_T 2 -# endif -# else -# error "invalid LZO_ARCH_I086 memory model" -# endif -#endif -#endif -#if !defined(LZO_SIZEOF_PTRDIFF_T) -# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_SIZE_T -#endif -#if defined(offsetof) -LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_PTRDIFF_T == sizeof(ptrdiff_t)) -#endif -#if !defined(LZO_WORDSIZE) -# define LZO_WORDSIZE LZO_SIZEOF_VOID_P -#endif -#if (LZO_ABI_NEUTRAL_ENDIAN) -# undef LZO_ABI_BIG_ENDIAN -# undef LZO_ABI_LITTLE_ENDIAN -#elif !(LZO_ABI_BIG_ENDIAN) && !(LZO_ABI_LITTLE_ENDIAN) -#if (LZO_ARCH_ALPHA) && (LZO_ARCH_CRAY_MPP) -# define LZO_ABI_BIG_ENDIAN 1 -#elif (LZO_ARCH_IA64) && (LZO_OS_POSIX_LINUX || LZO_OS_WIN64) -# define LZO_ABI_LITTLE_ENDIAN 1 -#elif (LZO_ARCH_ALPHA || LZO_ARCH_AMD64 || LZO_ARCH_BLACKFIN || LZO_ARCH_CRIS || LZO_ARCH_I086 || LZO_ARCH_I386 || LZO_ARCH_MSP430) -# define LZO_ABI_LITTLE_ENDIAN 1 -#elif (LZO_ARCH_AVR32 || LZO_ARCH_M68K || LZO_ARCH_S390 || LZO_ARCH_SPU) -# define LZO_ABI_BIG_ENDIAN 1 -#elif 1 && defined(__IAR_SYSTEMS_ICC__) && defined(__LITTLE_ENDIAN__) -# if (__LITTLE_ENDIAN__ == 1) -# define LZO_ABI_LITTLE_ENDIAN 1 -# else -# define LZO_ABI_BIG_ENDIAN 1 -# endif -#elif 1 && defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__) -# define LZO_ABI_BIG_ENDIAN 1 -#elif 1 && defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__) -# define LZO_ABI_LITTLE_ENDIAN 1 -#elif 1 && (LZO_ARCH_ARM) && defined(__ARM_BIG_ENDIAN) && ((__ARM_BIG_ENDIAN)+0) -# define LZO_ABI_BIG_ENDIAN 1 -#elif 1 && (LZO_ARCH_ARM) && defined(__ARMEB__) && !defined(__ARMEL__) -# define LZO_ABI_BIG_ENDIAN 1 -#elif 1 && (LZO_ARCH_ARM) && defined(__ARMEL__) && !defined(__ARMEB__) -# define LZO_ABI_LITTLE_ENDIAN 1 -#elif 1 && (LZO_ARCH_ARM && LZO_CC_ARMCC_ARMCC) -# if defined(__BIG_ENDIAN) && defined(__LITTLE_ENDIAN) -# error "unexpected configuration - check your compiler defines" -# elif defined(__BIG_ENDIAN) -# define LZO_ABI_BIG_ENDIAN 1 -# else -# define LZO_ABI_LITTLE_ENDIAN 1 -# endif -# define LZO_ABI_LITTLE_ENDIAN 1 -#elif 1 && (LZO_ARCH_ARM64) && defined(__ARM_BIG_ENDIAN) && ((__ARM_BIG_ENDIAN)+0) -# define LZO_ABI_BIG_ENDIAN 1 -#elif 1 && (LZO_ARCH_ARM64) && defined(__AARCH64EB__) && !defined(__AARCH64EL__) -# define LZO_ABI_BIG_ENDIAN 1 -#elif 1 && (LZO_ARCH_ARM64) && defined(__AARCH64EL__) && !defined(__AARCH64EB__) -# define LZO_ABI_LITTLE_ENDIAN 1 -#elif 1 && (LZO_ARCH_MIPS) && defined(__MIPSEB__) && !defined(__MIPSEL__) -# define LZO_ABI_BIG_ENDIAN 1 -#elif 1 && (LZO_ARCH_MIPS) && defined(__MIPSEL__) && !defined(__MIPSEB__) -# define LZO_ABI_LITTLE_ENDIAN 1 -#endif -#endif -#if (LZO_ABI_BIG_ENDIAN) && (LZO_ABI_LITTLE_ENDIAN) -# error "unexpected configuration - check your compiler defines" -#endif -#if (LZO_ABI_BIG_ENDIAN) -# define LZO_INFO_ABI_ENDIAN "be" -#elif (LZO_ABI_LITTLE_ENDIAN) -# define LZO_INFO_ABI_ENDIAN "le" -#elif (LZO_ABI_NEUTRAL_ENDIAN) -# define LZO_INFO_ABI_ENDIAN "neutral" -#endif -#if (LZO_SIZEOF_INT == 1 && LZO_SIZEOF_LONG == 2 && LZO_SIZEOF_VOID_P == 2) -# define LZO_ABI_I8LP16 1 -# define LZO_INFO_ABI_PM "i8lp16" -#elif (LZO_SIZEOF_INT == 2 && LZO_SIZEOF_LONG == 2 && LZO_SIZEOF_VOID_P == 2) -# define LZO_ABI_ILP16 1 -# define LZO_INFO_ABI_PM "ilp16" -#elif (LZO_SIZEOF_INT == 2 && LZO_SIZEOF_LONG == 4 && LZO_SIZEOF_VOID_P == 4) -# define LZO_ABI_LP32 1 -# define LZO_INFO_ABI_PM "lp32" -#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 4 && LZO_SIZEOF_VOID_P == 4) -# define LZO_ABI_ILP32 1 -# define LZO_INFO_ABI_PM "ilp32" -#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 4 && LZO_SIZEOF_VOID_P == 8 && LZO_SIZEOF_SIZE_T == 8) -# define LZO_ABI_LLP64 1 -# define LZO_INFO_ABI_PM "llp64" -#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 8 && LZO_SIZEOF_VOID_P == 8) -# define LZO_ABI_LP64 1 -# define LZO_INFO_ABI_PM "lp64" -#elif (LZO_SIZEOF_INT == 8 && LZO_SIZEOF_LONG == 8 && LZO_SIZEOF_VOID_P == 8) -# define LZO_ABI_ILP64 1 -# define LZO_INFO_ABI_PM "ilp64" -#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 8 && LZO_SIZEOF_VOID_P == 4) -# define LZO_ABI_IP32L64 1 -# define LZO_INFO_ABI_PM "ip32l64" -#endif -#if 0 -#elif !defined(__LZO_LIBC_OVERRIDE) -#if (LZO_LIBC_NAKED) -# define LZO_INFO_LIBC "naked" -#elif (LZO_LIBC_FREESTANDING) -# define LZO_INFO_LIBC "freestanding" -#elif (LZO_LIBC_MOSTLY_FREESTANDING) -# define LZO_INFO_LIBC "mfreestanding" -#elif (LZO_LIBC_ISOC90) -# define LZO_INFO_LIBC "isoc90" -#elif (LZO_LIBC_ISOC99) -# define LZO_INFO_LIBC "isoc99" -#elif (LZO_CC_ARMCC_ARMCC) && defined(__ARMCLIB_VERSION) -# define LZO_LIBC_ISOC90 1 -# define LZO_INFO_LIBC "isoc90" -#elif defined(__dietlibc__) -# define LZO_LIBC_DIETLIBC 1 -# define LZO_INFO_LIBC "dietlibc" -#elif defined(_NEWLIB_VERSION) -# define LZO_LIBC_NEWLIB 1 -# define LZO_INFO_LIBC "newlib" -#elif defined(__UCLIBC__) && defined(__UCLIBC_MAJOR__) && defined(__UCLIBC_MINOR__) -# if defined(__UCLIBC_SUBLEVEL__) -# define LZO_LIBC_UCLIBC (__UCLIBC_MAJOR__ * 0x10000L + (__UCLIBC_MINOR__-0) * 0x100 + (__UCLIBC_SUBLEVEL__-0)) -# else -# define LZO_LIBC_UCLIBC 0x00090bL -# endif -# define LZO_INFO_LIBC "uc" "libc" -#elif defined(__GLIBC__) && defined(__GLIBC_MINOR__) -# define LZO_LIBC_GLIBC (__GLIBC__ * 0x10000L + (__GLIBC_MINOR__-0) * 0x100) -# define LZO_INFO_LIBC "glibc" -#elif (LZO_CC_MWERKS) && defined(__MSL__) -# define LZO_LIBC_MSL __MSL__ -# define LZO_INFO_LIBC "msl" -#elif 1 && defined(__IAR_SYSTEMS_ICC__) -# define LZO_LIBC_ISOC90 1 -# define LZO_INFO_LIBC "isoc90" -#else -# define LZO_LIBC_DEFAULT 1 -# define LZO_INFO_LIBC "default" -#endif -#endif -#if (LZO_ARCH_I386 && (LZO_OS_DOS32 || LZO_OS_WIN32) && (LZO_CC_DMC || LZO_CC_INTELC || LZO_CC_MSC || LZO_CC_PELLESC)) -# define LZO_ASM_SYNTAX_MSC 1 -#elif (LZO_OS_WIN64 && (LZO_CC_DMC || LZO_CC_INTELC || LZO_CC_MSC || LZO_CC_PELLESC)) -#elif (LZO_ARCH_I386 && LZO_CC_GNUC && (LZO_CC_GNUC == 0x011f00ul)) -#elif (LZO_ARCH_I386 && (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_INTELC || LZO_CC_PATHSCALE)) -# define LZO_ASM_SYNTAX_GNUC 1 -#elif (LZO_ARCH_AMD64 && (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_INTELC || LZO_CC_PATHSCALE)) -# define LZO_ASM_SYNTAX_GNUC 1 -#elif (LZO_CC_GNUC) -# define LZO_ASM_SYNTAX_GNUC 1 -#endif -#if (LZO_ASM_SYNTAX_GNUC) -#if (LZO_ARCH_I386 && LZO_CC_GNUC && (LZO_CC_GNUC < 0x020000ul)) -# define __LZO_ASM_CLOBBER "ax" -# define __LZO_ASM_CLOBBER_LIST_CC /*empty*/ -# define __LZO_ASM_CLOBBER_LIST_CC_MEMORY /*empty*/ -# define __LZO_ASM_CLOBBER_LIST_EMPTY /*empty*/ -#elif (LZO_CC_INTELC && (__INTEL_COMPILER < 1000)) -# define __LZO_ASM_CLOBBER "memory" -# define __LZO_ASM_CLOBBER_LIST_CC /*empty*/ -# define __LZO_ASM_CLOBBER_LIST_CC_MEMORY : "memory" -# define __LZO_ASM_CLOBBER_LIST_EMPTY /*empty*/ -#else -# define __LZO_ASM_CLOBBER "cc", "memory" -# define __LZO_ASM_CLOBBER_LIST_CC : "cc" -# define __LZO_ASM_CLOBBER_LIST_CC_MEMORY : "cc", "memory" -# define __LZO_ASM_CLOBBER_LIST_EMPTY /*empty*/ -#endif -#endif -#if (LZO_ARCH_ALPHA) -# define LZO_OPT_AVOID_UINT_INDEX 1 -#elif (LZO_ARCH_AMD64) -# define LZO_OPT_AVOID_INT_INDEX 1 -# define LZO_OPT_AVOID_UINT_INDEX 1 -# ifndef LZO_OPT_UNALIGNED16 -# define LZO_OPT_UNALIGNED16 1 -# endif -# ifndef LZO_OPT_UNALIGNED32 -# define LZO_OPT_UNALIGNED32 1 -# endif -# ifndef LZO_OPT_UNALIGNED64 -# define LZO_OPT_UNALIGNED64 1 -# endif -#elif (LZO_ARCH_ARM) -# if defined(__ARM_FEATURE_UNALIGNED) -# if ((__ARM_FEATURE_UNALIGNED)+0) -# ifndef LZO_OPT_UNALIGNED16 -# define LZO_OPT_UNALIGNED16 1 -# endif -# ifndef LZO_OPT_UNALIGNED32 -# define LZO_OPT_UNALIGNED32 1 -# endif -# endif -# elif 1 && (LZO_ARCH_ARM_THUMB2) -# ifndef LZO_OPT_UNALIGNED16 -# define LZO_OPT_UNALIGNED16 1 -# endif -# ifndef LZO_OPT_UNALIGNED32 -# define LZO_OPT_UNALIGNED32 1 -# endif -# elif 1 && defined(__TARGET_ARCH_ARM) && ((__TARGET_ARCH_ARM)+0 >= 7) -# ifndef LZO_OPT_UNALIGNED16 -# define LZO_OPT_UNALIGNED16 1 -# endif -# ifndef LZO_OPT_UNALIGNED32 -# define LZO_OPT_UNALIGNED32 1 -# endif -# elif 1 && defined(__TARGET_ARCH_ARM) && ((__TARGET_ARCH_ARM)+0 >= 6) && (defined(__TARGET_PROFILE_A) || defined(__TARGET_PROFILE_R)) -# ifndef LZO_OPT_UNALIGNED16 -# define LZO_OPT_UNALIGNED16 1 -# endif -# ifndef LZO_OPT_UNALIGNED32 -# define LZO_OPT_UNALIGNED32 1 -# endif -# endif -#elif (LZO_ARCH_ARM64) -# ifndef LZO_OPT_UNALIGNED16 -# define LZO_OPT_UNALIGNED16 1 -# endif -# ifndef LZO_OPT_UNALIGNED32 -# define LZO_OPT_UNALIGNED32 1 -# endif -# ifndef LZO_OPT_UNALIGNED64 -# define LZO_OPT_UNALIGNED64 1 -# endif -#elif (LZO_ARCH_CRIS) -# ifndef LZO_OPT_UNALIGNED16 -# define LZO_OPT_UNALIGNED16 1 -# endif -# ifndef LZO_OPT_UNALIGNED32 -# define LZO_OPT_UNALIGNED32 1 -# endif -#elif (LZO_ARCH_I386) -# ifndef LZO_OPT_UNALIGNED16 -# define LZO_OPT_UNALIGNED16 1 -# endif -# ifndef LZO_OPT_UNALIGNED32 -# define LZO_OPT_UNALIGNED32 1 -# endif -#elif (LZO_ARCH_IA64) -# define LZO_OPT_AVOID_INT_INDEX 1 -# define LZO_OPT_AVOID_UINT_INDEX 1 -# define LZO_OPT_PREFER_POSTINC 1 -#elif (LZO_ARCH_M68K) -# define LZO_OPT_PREFER_POSTINC 1 -# define LZO_OPT_PREFER_PREDEC 1 -# if defined(__mc68020__) && !defined(__mcoldfire__) -# ifndef LZO_OPT_UNALIGNED16 -# define LZO_OPT_UNALIGNED16 1 -# endif -# ifndef LZO_OPT_UNALIGNED32 -# define LZO_OPT_UNALIGNED32 1 -# endif -# endif -#elif (LZO_ARCH_MIPS) -# define LZO_OPT_AVOID_UINT_INDEX 1 -#elif (LZO_ARCH_POWERPC) -# define LZO_OPT_PREFER_PREINC 1 -# define LZO_OPT_PREFER_PREDEC 1 -# if (LZO_ABI_BIG_ENDIAN) -# ifndef LZO_OPT_UNALIGNED16 -# define LZO_OPT_UNALIGNED16 1 -# endif -# ifndef LZO_OPT_UNALIGNED32 -# define LZO_OPT_UNALIGNED32 1 -# endif -# if (LZO_WORDSIZE == 8) -# ifndef LZO_OPT_UNALIGNED64 -# define LZO_OPT_UNALIGNED64 1 -# endif -# endif -# endif -#elif (LZO_ARCH_S390) -# ifndef LZO_OPT_UNALIGNED16 -# define LZO_OPT_UNALIGNED16 1 -# endif -# ifndef LZO_OPT_UNALIGNED32 -# define LZO_OPT_UNALIGNED32 1 -# endif -# if (LZO_WORDSIZE == 8) -# ifndef LZO_OPT_UNALIGNED64 -# define LZO_OPT_UNALIGNED64 1 -# endif -# endif -#elif (LZO_ARCH_SH) -# define LZO_OPT_PREFER_POSTINC 1 -# define LZO_OPT_PREFER_PREDEC 1 -#endif -#ifndef LZO_CFG_NO_INLINE_ASM -#if (LZO_ABI_NEUTRAL_ENDIAN) || (LZO_ARCH_GENERIC) -# define LZO_CFG_NO_INLINE_ASM 1 -#elif (LZO_CC_LLVM) -# define LZO_CFG_NO_INLINE_ASM 1 -#endif -#endif -#if (LZO_CFG_NO_INLINE_ASM) -# undef LZO_ASM_SYNTAX_MSC -# undef LZO_ASM_SYNTAX_GNUC -# undef __LZO_ASM_CLOBBER -# undef __LZO_ASM_CLOBBER_LIST_CC -# undef __LZO_ASM_CLOBBER_LIST_CC_MEMORY -# undef __LZO_ASM_CLOBBER_LIST_EMPTY -#endif -#ifndef LZO_CFG_NO_UNALIGNED -#if (LZO_ABI_NEUTRAL_ENDIAN) || (LZO_ARCH_GENERIC) -# define LZO_CFG_NO_UNALIGNED 1 -#endif -#endif -#if (LZO_CFG_NO_UNALIGNED) -# undef LZO_OPT_UNALIGNED16 -# undef LZO_OPT_UNALIGNED32 -# undef LZO_OPT_UNALIGNED64 -#endif -#if defined(__LZO_INFOSTR_MM) -#elif (LZO_MM_FLAT) && (defined(__LZO_INFOSTR_PM) || defined(LZO_INFO_ABI_PM)) -# define __LZO_INFOSTR_MM "" -#elif defined(LZO_INFO_MM) -# define __LZO_INFOSTR_MM "." LZO_INFO_MM -#else -# define __LZO_INFOSTR_MM "" -#endif -#if defined(__LZO_INFOSTR_PM) -#elif defined(LZO_INFO_ABI_PM) -# define __LZO_INFOSTR_PM "." LZO_INFO_ABI_PM -#else -# define __LZO_INFOSTR_PM "" -#endif -#if defined(__LZO_INFOSTR_ENDIAN) -#elif defined(LZO_INFO_ABI_ENDIAN) -# define __LZO_INFOSTR_ENDIAN "." LZO_INFO_ABI_ENDIAN -#else -# define __LZO_INFOSTR_ENDIAN "" -#endif -#if defined(__LZO_INFOSTR_OSNAME) -#elif defined(LZO_INFO_OS_CONSOLE) -# define __LZO_INFOSTR_OSNAME LZO_INFO_OS "." LZO_INFO_OS_CONSOLE -#elif defined(LZO_INFO_OS_POSIX) -# define __LZO_INFOSTR_OSNAME LZO_INFO_OS "." LZO_INFO_OS_POSIX -#else -# define __LZO_INFOSTR_OSNAME LZO_INFO_OS -#endif -#if defined(__LZO_INFOSTR_LIBC) -#elif defined(LZO_INFO_LIBC) -# define __LZO_INFOSTR_LIBC "." LZO_INFO_LIBC -#else -# define __LZO_INFOSTR_LIBC "" -#endif -#if defined(__LZO_INFOSTR_CCVER) -#elif defined(LZO_INFO_CCVER) -# define __LZO_INFOSTR_CCVER " " LZO_INFO_CCVER -#else -# define __LZO_INFOSTR_CCVER "" -#endif -#define LZO_INFO_STRING \ - LZO_INFO_ARCH __LZO_INFOSTR_MM __LZO_INFOSTR_PM __LZO_INFOSTR_ENDIAN \ - " " __LZO_INFOSTR_OSNAME __LZO_INFOSTR_LIBC " " LZO_INFO_CC __LZO_INFOSTR_CCVER -#if !(LZO_CFG_SKIP_LZO_TYPES) -#if (!(LZO_SIZEOF_SHORT+0 > 0 && LZO_SIZEOF_INT+0 > 0 && LZO_SIZEOF_LONG+0 > 0)) -# error "missing defines for sizes" -#endif -#if (!(LZO_SIZEOF_PTRDIFF_T+0 > 0 && LZO_SIZEOF_SIZE_T+0 > 0 && LZO_SIZEOF_VOID_P+0 > 0)) -# error "missing defines for sizes" -#endif -#define LZO_TYPEOF_CHAR 1u -#define LZO_TYPEOF_SHORT 2u -#define LZO_TYPEOF_INT 3u -#define LZO_TYPEOF_LONG 4u -#define LZO_TYPEOF_LONG_LONG 5u -#define LZO_TYPEOF___INT8 17u -#define LZO_TYPEOF___INT16 18u -#define LZO_TYPEOF___INT32 19u -#define LZO_TYPEOF___INT64 20u -#define LZO_TYPEOF___INT128 21u -#define LZO_TYPEOF___INT256 22u -#define LZO_TYPEOF___MODE_QI 33u -#define LZO_TYPEOF___MODE_HI 34u -#define LZO_TYPEOF___MODE_SI 35u -#define LZO_TYPEOF___MODE_DI 36u -#define LZO_TYPEOF___MODE_TI 37u -#define LZO_TYPEOF_CHAR_P 129u -#if !defined(lzo_llong_t) -#if (LZO_SIZEOF_LONG_LONG+0 > 0) -__lzo_gnuc_extension__ typedef long long lzo_llong_t__; -__lzo_gnuc_extension__ typedef unsigned long long lzo_ullong_t__; -# define lzo_llong_t lzo_llong_t__ -# define lzo_ullong_t lzo_ullong_t__ -#endif -#endif -#if !defined(lzo_int16e_t) -#if (LZO_SIZEOF_LONG == 2) -# define lzo_int16e_t long -# define lzo_uint16e_t unsigned long -# define LZO_TYPEOF_LZO_INT16E_T LZO_TYPEOF_LONG -#elif (LZO_SIZEOF_INT == 2) -# define lzo_int16e_t int -# define lzo_uint16e_t unsigned int -# define LZO_TYPEOF_LZO_INT16E_T LZO_TYPEOF_INT -#elif (LZO_SIZEOF_SHORT == 2) -# define lzo_int16e_t short int -# define lzo_uint16e_t unsigned short int -# define LZO_TYPEOF_LZO_INT16E_T LZO_TYPEOF_SHORT -#elif 1 && !(LZO_CFG_TYPE_NO_MODE_HI) && (LZO_CC_CLANG || (LZO_CC_GNUC >= 0x025f00ul) || LZO_CC_LLVM) - typedef int lzo_int16e_hi_t__ __attribute__((__mode__(__HI__))); - typedef unsigned int lzo_uint16e_hi_t__ __attribute__((__mode__(__HI__))); -# define lzo_int16e_t lzo_int16e_hi_t__ -# define lzo_uint16e_t lzo_uint16e_hi_t__ -# define LZO_TYPEOF_LZO_INT16E_T LZO_TYPEOF___MODE_HI -#elif (LZO_SIZEOF___INT16 == 2) -# define lzo_int16e_t __int16 -# define lzo_uint16e_t unsigned __int16 -# define LZO_TYPEOF_LZO_INT16E_T LZO_TYPEOF___INT16 -#else -#endif -#endif -#if defined(lzo_int16e_t) -# define LZO_SIZEOF_LZO_INT16E_T 2 - LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int16e_t) == 2) - LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int16e_t) == LZO_SIZEOF_LZO_INT16E_T) -#endif -#if !defined(lzo_int32e_t) -#if (LZO_SIZEOF_LONG == 4) -# define lzo_int32e_t long int -# define lzo_uint32e_t unsigned long int -# define LZO_TYPEOF_LZO_INT32E_T LZO_TYPEOF_LONG -#elif (LZO_SIZEOF_INT == 4) -# define lzo_int32e_t int -# define lzo_uint32e_t unsigned int -# define LZO_TYPEOF_LZO_INT32E_T LZO_TYPEOF_INT -#elif (LZO_SIZEOF_SHORT == 4) -# define lzo_int32e_t short int -# define lzo_uint32e_t unsigned short int -# define LZO_TYPEOF_LZO_INT32E_T LZO_TYPEOF_SHORT -#elif (LZO_SIZEOF_LONG_LONG == 4) -# define lzo_int32e_t lzo_llong_t -# define lzo_uint32e_t lzo_ullong_t -# define LZO_TYPEOF_LZO_INT32E_T LZO_TYPEOF_LONG_LONG -#elif 1 && !(LZO_CFG_TYPE_NO_MODE_SI) && (LZO_CC_CLANG || (LZO_CC_GNUC >= 0x025f00ul) || LZO_CC_LLVM) && (__INT_MAX__+0 > 2147483647L) - typedef int lzo_int32e_si_t__ __attribute__((__mode__(__SI__))); - typedef unsigned int lzo_uint32e_si_t__ __attribute__((__mode__(__SI__))); -# define lzo_int32e_t lzo_int32e_si_t__ -# define lzo_uint32e_t lzo_uint32e_si_t__ -# define LZO_TYPEOF_LZO_INT32E_T LZO_TYPEOF___MODE_SI -#elif 1 && !(LZO_CFG_TYPE_NO_MODE_SI) && (LZO_CC_GNUC >= 0x025f00ul) && defined(__AVR__) && (__LONG_MAX__+0 == 32767L) - typedef int lzo_int32e_si_t__ __attribute__((__mode__(__SI__))); - typedef unsigned int lzo_uint32e_si_t__ __attribute__((__mode__(__SI__))); -# define lzo_int32e_t lzo_int32e_si_t__ -# define lzo_uint32e_t lzo_uint32e_si_t__ -# define LZO_INT32_C(c) (c##LL) -# define LZO_UINT32_C(c) (c##ULL) -# define LZO_TYPEOF_LZO_INT32E_T LZO_TYPEOF___MODE_SI -#elif (LZO_SIZEOF___INT32 == 4) -# define lzo_int32e_t __int32 -# define lzo_uint32e_t unsigned __int32 -# define LZO_TYPEOF_LZO_INT32E_T LZO_TYPEOF___INT32 -#else -#endif -#endif -#if defined(lzo_int32e_t) -# define LZO_SIZEOF_LZO_INT32E_T 4 - LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32e_t) == 4) - LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32e_t) == LZO_SIZEOF_LZO_INT32E_T) -#endif -#if !defined(lzo_int64e_t) -#if (LZO_SIZEOF___INT64 == 8) -# if (LZO_CC_BORLANDC) && !(LZO_CFG_TYPE_PREFER___INT64) -# define LZO_CFG_TYPE_PREFER___INT64 1 -# endif -#endif -#if (LZO_SIZEOF_INT == 8) && (LZO_SIZEOF_INT < LZO_SIZEOF_LONG) -# define lzo_int64e_t int -# define lzo_uint64e_t unsigned int -# define LZO_TYPEOF_LZO_INT64E_T LZO_TYPEOF_INT -#elif (LZO_SIZEOF_LONG == 8) -# define lzo_int64e_t long int -# define lzo_uint64e_t unsigned long int -# define LZO_TYPEOF_LZO_INT64E_T LZO_TYPEOF_LONG -#elif (LZO_SIZEOF_LONG_LONG == 8) && !(LZO_CFG_TYPE_PREFER___INT64) -# define lzo_int64e_t lzo_llong_t -# define lzo_uint64e_t lzo_ullong_t -# define LZO_TYPEOF_LZO_INT64E_T LZO_TYPEOF_LONG_LONG -# if (LZO_CC_BORLANDC) -# define LZO_INT64_C(c) ((c) + 0ll) -# define LZO_UINT64_C(c) ((c) + 0ull) -# elif 0 -# define LZO_INT64_C(c) (__lzo_gnuc_extension__ (c##LL)) -# define LZO_UINT64_C(c) (__lzo_gnuc_extension__ (c##ULL)) -# else -# define LZO_INT64_C(c) (c##LL) -# define LZO_UINT64_C(c) (c##ULL) -# endif -#elif (LZO_SIZEOF___INT64 == 8) -# define lzo_int64e_t __int64 -# define lzo_uint64e_t unsigned __int64 -# define LZO_TYPEOF_LZO_INT64E_T LZO_TYPEOF___INT64 -# if (LZO_CC_BORLANDC) -# define LZO_INT64_C(c) ((c) + 0i64) -# define LZO_UINT64_C(c) ((c) + 0ui64) -# else -# define LZO_INT64_C(c) (c##i64) -# define LZO_UINT64_C(c) (c##ui64) -# endif -#else -#endif -#endif -#if defined(lzo_int64e_t) -# define LZO_SIZEOF_LZO_INT64E_T 8 - LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64e_t) == 8) - LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64e_t) == LZO_SIZEOF_LZO_INT64E_T) -#endif -#if !defined(lzo_int32l_t) -#if defined(lzo_int32e_t) -# define lzo_int32l_t lzo_int32e_t -# define lzo_uint32l_t lzo_uint32e_t -# define LZO_SIZEOF_LZO_INT32L_T LZO_SIZEOF_LZO_INT32E_T -# define LZO_TYPEOF_LZO_INT32L_T LZO_TYPEOF_LZO_INT32E_T -#elif (LZO_SIZEOF_INT >= 4) && (LZO_SIZEOF_INT < LZO_SIZEOF_LONG) -# define lzo_int32l_t int -# define lzo_uint32l_t unsigned int -# define LZO_SIZEOF_LZO_INT32L_T LZO_SIZEOF_INT -# define LZO_TYPEOF_LZO_INT32L_T LZO_SIZEOF_INT -#elif (LZO_SIZEOF_LONG >= 4) -# define lzo_int32l_t long int -# define lzo_uint32l_t unsigned long int -# define LZO_SIZEOF_LZO_INT32L_T LZO_SIZEOF_LONG -# define LZO_TYPEOF_LZO_INT32L_T LZO_SIZEOF_LONG -#else -# error "lzo_int32l_t" -#endif -#endif -#if 1 - LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32l_t) >= 4) - LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32l_t) == LZO_SIZEOF_LZO_INT32L_T) -#endif -#if !defined(lzo_int64l_t) -#if defined(lzo_int64e_t) -# define lzo_int64l_t lzo_int64e_t -# define lzo_uint64l_t lzo_uint64e_t -# define LZO_SIZEOF_LZO_INT64L_T LZO_SIZEOF_LZO_INT64E_T -# define LZO_TYPEOF_LZO_INT64L_T LZO_TYPEOF_LZO_INT64E_T -#else -#endif -#endif -#if defined(lzo_int64l_t) - LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64l_t) >= 8) - LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64l_t) == LZO_SIZEOF_LZO_INT64L_T) -#endif -#if !defined(lzo_int32f_t) -#if (LZO_SIZEOF_SIZE_T >= 8) -# define lzo_int32f_t lzo_int64l_t -# define lzo_uint32f_t lzo_uint64l_t -# define LZO_SIZEOF_LZO_INT32F_T LZO_SIZEOF_LZO_INT64L_T -# define LZO_TYPEOF_LZO_INT32F_T LZO_TYPEOF_LZO_INT64L_T -#else -# define lzo_int32f_t lzo_int32l_t -# define lzo_uint32f_t lzo_uint32l_t -# define LZO_SIZEOF_LZO_INT32F_T LZO_SIZEOF_LZO_INT32L_T -# define LZO_TYPEOF_LZO_INT32F_T LZO_TYPEOF_LZO_INT32L_T -#endif -#endif -#if 1 - LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32f_t) >= 4) - LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32f_t) == LZO_SIZEOF_LZO_INT32F_T) -#endif -#if !defined(lzo_int64f_t) -#if defined(lzo_int64l_t) -# define lzo_int64f_t lzo_int64l_t -# define lzo_uint64f_t lzo_uint64l_t -# define LZO_SIZEOF_LZO_INT64F_T LZO_SIZEOF_LZO_INT64L_T -# define LZO_TYPEOF_LZO_INT64F_T LZO_TYPEOF_LZO_INT64L_T -#else -#endif -#endif -#if defined(lzo_int64f_t) - LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64f_t) >= 8) - LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64f_t) == LZO_SIZEOF_LZO_INT64F_T) -#endif -#if !defined(lzo_intptr_t) -#if 1 && (LZO_OS_OS400 && (LZO_SIZEOF_VOID_P == 16)) -# define __LZO_INTPTR_T_IS_POINTER 1 - typedef char * lzo_intptr_t; - typedef char * lzo_uintptr_t; -# define lzo_intptr_t lzo_intptr_t -# define lzo_uintptr_t lzo_uintptr_t -# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_VOID_P -# define LZO_TYPEOF_LZO_INTPTR_T LZO_TYPEOF_CHAR_P -#elif (LZO_CC_MSC && (_MSC_VER >= 1300) && (LZO_SIZEOF_VOID_P == 4) && (LZO_SIZEOF_INT == 4)) - typedef __w64 int lzo_intptr_t; - typedef __w64 unsigned int lzo_uintptr_t; -# define lzo_intptr_t lzo_intptr_t -# define lzo_uintptr_t lzo_uintptr_t -# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_INT -# define LZO_TYPEOF_LZO_INTPTR_T LZO_TYPEOF_INT -#elif (LZO_SIZEOF_SHORT == LZO_SIZEOF_VOID_P) && (LZO_SIZEOF_INT > LZO_SIZEOF_VOID_P) -# define lzo_intptr_t short -# define lzo_uintptr_t unsigned short -# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_SHORT -# define LZO_TYPEOF_LZO_INTPTR_T LZO_TYPEOF_SHORT -#elif (LZO_SIZEOF_INT >= LZO_SIZEOF_VOID_P) && (LZO_SIZEOF_INT < LZO_SIZEOF_LONG) -# define lzo_intptr_t int -# define lzo_uintptr_t unsigned int -# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_INT -# define LZO_TYPEOF_LZO_INTPTR_T LZO_TYPEOF_INT -#elif (LZO_SIZEOF_LONG >= LZO_SIZEOF_VOID_P) -# define lzo_intptr_t long -# define lzo_uintptr_t unsigned long -# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_LONG -# define LZO_TYPEOF_LZO_INTPTR_T LZO_TYPEOF_LONG -#elif (LZO_SIZEOF_LZO_INT64L_T >= LZO_SIZEOF_VOID_P) -# define lzo_intptr_t lzo_int64l_t -# define lzo_uintptr_t lzo_uint64l_t -# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_LZO_INT64L_T -# define LZO_TYPEOF_LZO_INTPTR_T LZO_TYPEOF_LZO_INT64L_T -#else -# error "lzo_intptr_t" -#endif -#endif -#if 1 - LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_intptr_t) >= sizeof(void *)) - LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_intptr_t) == sizeof(lzo_uintptr_t)) -#endif -#if !defined(lzo_word_t) -#if defined(LZO_WORDSIZE) && (LZO_WORDSIZE+0 > 0) -#if (LZO_WORDSIZE == LZO_SIZEOF_LZO_INTPTR_T) && !(__LZO_INTPTR_T_IS_POINTER) -# define lzo_word_t lzo_uintptr_t -# define lzo_sword_t lzo_intptr_t -# define LZO_SIZEOF_LZO_WORD_T LZO_SIZEOF_LZO_INTPTR_T -# define LZO_TYPEOF_LZO_WORD_T LZO_TYPEOF_LZO_INTPTR_T -#elif (LZO_WORDSIZE == LZO_SIZEOF_LONG) -# define lzo_word_t unsigned long -# define lzo_sword_t long -# define LZO_SIZEOF_LZO_WORD_T LZO_SIZEOF_LONG -# define LZO_TYPEOF_LZO_WORD_T LZO_TYPEOF_LONG -#elif (LZO_WORDSIZE == LZO_SIZEOF_INT) -# define lzo_word_t unsigned int -# define lzo_sword_t int -# define LZO_SIZEOF_LZO_WORD_T LZO_SIZEOF_INT -# define LZO_TYPEOF_LZO_WORD_T LZO_TYPEOF_INT -#elif (LZO_WORDSIZE == LZO_SIZEOF_SHORT) -# define lzo_word_t unsigned short -# define lzo_sword_t short -# define LZO_SIZEOF_LZO_WORD_T LZO_SIZEOF_SHORT -# define LZO_TYPEOF_LZO_WORD_T LZO_TYPEOF_SHORT -#elif (LZO_WORDSIZE == 1) -# define lzo_word_t unsigned char -# define lzo_sword_t signed char -# define LZO_SIZEOF_LZO_WORD_T 1 -# define LZO_TYPEOF_LZO_WORD_T LZO_TYPEOF_CHAR -#elif (LZO_WORDSIZE == LZO_SIZEOF_LZO_INT64L_T) -# define lzo_word_t lzo_uint64l_t -# define lzo_sword_t lzo_int64l_t -# define LZO_SIZEOF_LZO_WORD_T LZO_SIZEOF_LZO_INT64L_T -# define LZO_TYPEOF_LZO_WORD_T LZO_SIZEOF_LZO_INT64L_T -#elif (LZO_ARCH_SPU) && (LZO_CC_GNUC) -#if 0 - typedef unsigned lzo_word_t __attribute__((__mode__(__V16QI__))); - typedef int lzo_sword_t __attribute__((__mode__(__V16QI__))); -# define lzo_word_t lzo_word_t -# define lzo_sword_t lzo_sword_t -# define LZO_SIZEOF_LZO_WORD_T 16 -# define LZO_TYPEOF_LZO_WORD_T LZO_TYPEOF___MODE_V16QI -#endif -#else -# error "lzo_word_t" -#endif -#endif -#endif -#if 1 && defined(lzo_word_t) - LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_word_t) == LZO_WORDSIZE) - LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_sword_t) == LZO_WORDSIZE) -#endif -#if 1 -#define lzo_int8_t signed char -#define lzo_uint8_t unsigned char -#define LZO_SIZEOF_LZO_INT8_T 1 -#define LZO_TYPEOF_LZO_INT8_T LZO_TYPEOF_CHAR -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int8_t) == 1) -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int8_t) == sizeof(lzo_uint8_t)) -#endif -#if defined(lzo_int16e_t) -#define lzo_int16_t lzo_int16e_t -#define lzo_uint16_t lzo_uint16e_t -#define LZO_SIZEOF_LZO_INT16_T LZO_SIZEOF_LZO_INT16E_T -#define LZO_TYPEOF_LZO_INT16_T LZO_TYPEOF_LZO_INT16E_T -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int16_t) == 2) -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int16_t) == sizeof(lzo_uint16_t)) -#endif -#if defined(lzo_int32e_t) -#define lzo_int32_t lzo_int32e_t -#define lzo_uint32_t lzo_uint32e_t -#define LZO_SIZEOF_LZO_INT32_T LZO_SIZEOF_LZO_INT32E_T -#define LZO_TYPEOF_LZO_INT32_T LZO_TYPEOF_LZO_INT32E_T -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32_t) == 4) -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32_t) == sizeof(lzo_uint32_t)) -#endif -#if defined(lzo_int64e_t) -#define lzo_int64_t lzo_int64e_t -#define lzo_uint64_t lzo_uint64e_t -#define LZO_SIZEOF_LZO_INT64_T LZO_SIZEOF_LZO_INT64E_T -#define LZO_TYPEOF_LZO_INT64_T LZO_TYPEOF_LZO_INT64E_T -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64_t) == 8) -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64_t) == sizeof(lzo_uint64_t)) -#endif -#if 1 -#define lzo_int_least32_t lzo_int32l_t -#define lzo_uint_least32_t lzo_uint32l_t -#define LZO_SIZEOF_LZO_INT_LEAST32_T LZO_SIZEOF_LZO_INT32L_T -#define LZO_TYPEOF_LZO_INT_LEAST32_T LZO_TYPEOF_LZO_INT32L_T -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_least32_t) >= 4) -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_least32_t) == sizeof(lzo_uint_least32_t)) -#endif -#if defined(lzo_int64l_t) -#define lzo_int_least64_t lzo_int64l_t -#define lzo_uint_least64_t lzo_uint64l_t -#define LZO_SIZEOF_LZO_INT_LEAST64_T LZO_SIZEOF_LZO_INT64L_T -#define LZO_TYPEOF_LZO_INT_LEAST64_T LZO_TYPEOF_LZO_INT64L_T -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_least64_t) >= 8) -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_least64_t) == sizeof(lzo_uint_least64_t)) -#endif -#if 1 -#define lzo_int_fast32_t lzo_int32f_t -#define lzo_uint_fast32_t lzo_uint32f_t -#define LZO_SIZEOF_LZO_INT_FAST32_T LZO_SIZEOF_LZO_INT32F_T -#define LZO_TYPEOF_LZO_INT_FAST32_T LZO_TYPEOF_LZO_INT32F_T -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_fast32_t) >= 4) -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_fast32_t) == sizeof(lzo_uint_fast32_t)) -#endif -#if defined(lzo_int64f_t) -#define lzo_int_fast64_t lzo_int64f_t -#define lzo_uint_fast64_t lzo_uint64f_t -#define LZO_SIZEOF_LZO_INT_FAST64_T LZO_SIZEOF_LZO_INT64F_T -#define LZO_TYPEOF_LZO_INT_FAST64_T LZO_TYPEOF_LZO_INT64F_T -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_fast64_t) >= 8) -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_fast64_t) == sizeof(lzo_uint_fast64_t)) -#endif -#if !defined(LZO_INT16_C) -# if (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_INT >= 2) -# define LZO_INT16_C(c) ((c) + 0) -# define LZO_UINT16_C(c) ((c) + 0U) -# elif (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_LONG >= 2) -# define LZO_INT16_C(c) ((c) + 0L) -# define LZO_UINT16_C(c) ((c) + 0UL) -# elif (LZO_SIZEOF_INT >= 2) -# define LZO_INT16_C(c) (c) -# define LZO_UINT16_C(c) (c##U) -# elif (LZO_SIZEOF_LONG >= 2) -# define LZO_INT16_C(c) (c##L) -# define LZO_UINT16_C(c) (c##UL) -# else -# error "LZO_INT16_C" -# endif -#endif -#if !defined(LZO_INT32_C) -# if (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_INT >= 4) -# define LZO_INT32_C(c) ((c) + 0) -# define LZO_UINT32_C(c) ((c) + 0U) -# elif (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_LONG >= 4) -# define LZO_INT32_C(c) ((c) + 0L) -# define LZO_UINT32_C(c) ((c) + 0UL) -# elif (LZO_SIZEOF_INT >= 4) -# define LZO_INT32_C(c) (c) -# define LZO_UINT32_C(c) (c##U) -# elif (LZO_SIZEOF_LONG >= 4) -# define LZO_INT32_C(c) (c##L) -# define LZO_UINT32_C(c) (c##UL) -# elif (LZO_SIZEOF_LONG_LONG >= 4) -# define LZO_INT32_C(c) (c##LL) -# define LZO_UINT32_C(c) (c##ULL) -# else -# error "LZO_INT32_C" -# endif -#endif -#if !defined(LZO_INT64_C) && defined(lzo_int64l_t) -# if (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_INT >= 8) -# define LZO_INT64_C(c) ((c) + 0) -# define LZO_UINT64_C(c) ((c) + 0U) -# elif (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_LONG >= 8) -# define LZO_INT64_C(c) ((c) + 0L) -# define LZO_UINT64_C(c) ((c) + 0UL) -# elif (LZO_SIZEOF_INT >= 8) -# define LZO_INT64_C(c) (c) -# define LZO_UINT64_C(c) (c##U) -# elif (LZO_SIZEOF_LONG >= 8) -# define LZO_INT64_C(c) (c##L) -# define LZO_UINT64_C(c) (c##UL) -# else -# error "LZO_INT64_C" -# endif -#endif -#endif - -#endif /* already included */ - -/* vim:set ts=4 sw=4 et: */ diff --git a/extensions/common/membuf.hpp b/extensions/common/membuf.hpp deleted file mode 100644 index a34b57b6fce..00000000000 --- a/extensions/common/membuf.hpp +++ /dev/null @@ -1,56 +0,0 @@ -#pragma once - -#include <streambuf> - -namespace ace { - class membuf : public std::streambuf - { - public: - membuf(char* mem, size_t length) { - - setg(mem, mem, mem + length); - setp(mem, mem + length); - } - - int_type underflow() { - if (gptr() >= egptr()) { - return traits_type::eof(); - } - return traits_type::to_int_type(*gptr()); - } - - std::streampos seekpos(std::streampos pos, std::ios_base::openmode) { - char *p = eback() + pos; - if (p >= eback() && p <= egptr()) { - setg(eback(), p, egptr()); - return pos; - } else { - return -1; - } - } - - std::streampos seekoff(std::streamoff off, std::ios_base::seekdir dir, std::ios_base::openmode) { - char *p; - switch (dir) { - case std::ios_base::beg: - p = eback() + off; - break; - case std::ios_base::cur: - p = gptr() + off; - break; - case std::ios_base::end: - p = egptr() - off; - break; - default: - p = 0; - break; - } - if (p >= eback() && p <= egptr()) { - setg(eback(), p, egptr()); - return std::streampos(p - eback()); - } else { - return -1; - } - } - }; -} \ No newline at end of file diff --git a/extensions/common/minilzo.c b/extensions/common/minilzo.c deleted file mode 100644 index 801f53001d0..00000000000 --- a/extensions/common/minilzo.c +++ /dev/null @@ -1,6231 +0,0 @@ -/* minilzo.c -- mini subset of the LZO real-time data compression library - - This file is part of the LZO real-time data compression library. - - Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer - All Rights Reserved. - - The LZO library is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of - the License, or (at your option) any later version. - - The LZO library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with the LZO library; see the file COPYING. - If not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - Markus F.X.J. Oberhumer - <markus@oberhumer.com> - http://www.oberhumer.com/opensource/lzo/ - */ - -/* - * NOTE: - * the full LZO package can be found at - * http://www.oberhumer.com/opensource/lzo/ - */ - -#define __LZO_IN_MINILZO 1 - -#if defined(LZO_CFG_FREESTANDING) -# undef MINILZO_HAVE_CONFIG_H -# define LZO_LIBC_FREESTANDING 1 -# define LZO_OS_FREESTANDING 1 -#endif - -#ifdef MINILZO_HAVE_CONFIG_H -# include <config.h> -#endif -#include <limits.h> -#include <stddef.h> -#if defined(MINILZO_CFG_USE_INTERNAL_LZODEFS) - -#ifndef __LZODEFS_H_INCLUDED -#define __LZODEFS_H_INCLUDED 1 - -#if defined(__CYGWIN32__) && !defined(__CYGWIN__) -# define __CYGWIN__ __CYGWIN32__ -#endif -#if 1 && defined(__INTERIX) && defined(__GNUC__) && !defined(_ALL_SOURCE) -# define _ALL_SOURCE 1 -#endif -#if defined(__mips__) && defined(__R5900__) -# if !defined(__LONG_MAX__) -# define __LONG_MAX__ 9223372036854775807L -# endif -#endif -#if !defined(LZO_CFG_NO_DISABLE_WUNDEF) -#if defined(__ARMCC_VERSION) -# pragma diag_suppress 193 -#elif defined(__clang__) && defined(__clang_minor__) -# pragma clang diagnostic ignored "-Wundef" -#elif defined(__INTEL_COMPILER) -# pragma warning(disable: 193) -#elif defined(__KEIL__) && defined(__C166__) -# pragma warning disable = 322 -#elif defined(__GNUC__) && defined(__GNUC_MINOR__) && !defined(__PATHSCALE__) -# if ((__GNUC__-0) >= 5 || ((__GNUC__-0) == 4 && (__GNUC_MINOR__-0) >= 2)) -# pragma GCC diagnostic ignored "-Wundef" -# endif -#elif defined(_MSC_VER) && !defined(__clang__) && !defined(__INTEL_COMPILER) && !defined(__MWERKS__) -# if ((_MSC_VER-0) >= 1300) -# pragma warning(disable: 4668) -# endif -#endif -#endif -#if 0 && defined(__POCC__) && defined(_WIN32) -# if (__POCC__ >= 400) -# pragma warn(disable: 2216) -# endif -#endif -#if 0 && defined(__WATCOMC__) -# if (__WATCOMC__ >= 1050) && (__WATCOMC__ < 1060) -# pragma warning 203 9 -# endif -#endif -#if defined(__BORLANDC__) && defined(__MSDOS__) && !defined(__FLAT__) -# pragma option -h -#endif -#if !(LZO_CFG_NO_DISABLE_WCRTNONSTDC) -#ifndef _CRT_NONSTDC_NO_DEPRECATE -#define _CRT_NONSTDC_NO_DEPRECATE 1 -#endif -#ifndef _CRT_NONSTDC_NO_WARNINGS -#define _CRT_NONSTDC_NO_WARNINGS 1 -#endif -#ifndef _CRT_SECURE_NO_DEPRECATE -#define _CRT_SECURE_NO_DEPRECATE 1 -#endif -#ifndef _CRT_SECURE_NO_WARNINGS -#define _CRT_SECURE_NO_WARNINGS 1 -#endif -#endif -#if 0 -#define LZO_0xffffUL 0xfffful -#define LZO_0xffffffffUL 0xfffffffful -#else -#define LZO_0xffffUL 65535ul -#define LZO_0xffffffffUL 4294967295ul -#endif -#define LZO_0xffffL LZO_0xffffUL -#define LZO_0xffffffffL LZO_0xffffffffUL -#if (LZO_0xffffL == LZO_0xffffffffL) -# error "your preprocessor is broken 1" -#endif -#if (16ul * 16384ul != 262144ul) -# error "your preprocessor is broken 2" -#endif -#if 0 -#if (32767 >= 4294967295ul) -# error "your preprocessor is broken 3" -#endif -#if (65535u >= 4294967295ul) -# error "your preprocessor is broken 4" -#endif -#endif -#if defined(__COUNTER__) -# ifndef LZO_CFG_USE_COUNTER -# define LZO_CFG_USE_COUNTER 1 -# endif -#else -# undef LZO_CFG_USE_COUNTER -#endif -#if (UINT_MAX == LZO_0xffffL) -#if defined(__ZTC__) && defined(__I86__) && !defined(__OS2__) -# if !defined(MSDOS) -# define MSDOS 1 -# endif -# if !defined(_MSDOS) -# define _MSDOS 1 -# endif -#elif 0 && defined(__VERSION) && defined(MB_LEN_MAX) -# if (__VERSION == 520) && (MB_LEN_MAX == 1) -# if !defined(__AZTEC_C__) -# define __AZTEC_C__ __VERSION -# endif -# if !defined(__DOS__) -# define __DOS__ 1 -# endif -# endif -#endif -#endif -#if defined(_MSC_VER) && defined(M_I86HM) && (UINT_MAX == LZO_0xffffL) -# define ptrdiff_t long -# define _PTRDIFF_T_DEFINED 1 -#endif -#if (UINT_MAX == LZO_0xffffL) -# undef __LZO_RENAME_A -# undef __LZO_RENAME_B -# if defined(__AZTEC_C__) && defined(__DOS__) -# define __LZO_RENAME_A 1 -# elif defined(_MSC_VER) && defined(MSDOS) -# if (_MSC_VER < 600) -# define __LZO_RENAME_A 1 -# elif (_MSC_VER < 700) -# define __LZO_RENAME_B 1 -# endif -# elif defined(__TSC__) && defined(__OS2__) -# define __LZO_RENAME_A 1 -# elif defined(__MSDOS__) && defined(__TURBOC__) && (__TURBOC__ < 0x0410) -# define __LZO_RENAME_A 1 -# elif defined(__PACIFIC__) && defined(DOS) -# if !defined(__far) -# define __far far -# endif -# if !defined(__near) -# define __near near -# endif -# endif -# if defined(__LZO_RENAME_A) -# if !defined(__cdecl) -# define __cdecl cdecl -# endif -# if !defined(__far) -# define __far far -# endif -# if !defined(__huge) -# define __huge huge -# endif -# if !defined(__near) -# define __near near -# endif -# if !defined(__pascal) -# define __pascal pascal -# endif -# if !defined(__huge) -# define __huge huge -# endif -# elif defined(__LZO_RENAME_B) -# if !defined(__cdecl) -# define __cdecl _cdecl -# endif -# if !defined(__far) -# define __far _far -# endif -# if !defined(__huge) -# define __huge _huge -# endif -# if !defined(__near) -# define __near _near -# endif -# if !defined(__pascal) -# define __pascal _pascal -# endif -# elif (defined(__PUREC__) || defined(__TURBOC__)) && defined(__TOS__) -# if !defined(__cdecl) -# define __cdecl cdecl -# endif -# if !defined(__pascal) -# define __pascal pascal -# endif -# endif -# undef __LZO_RENAME_A -# undef __LZO_RENAME_B -#endif -#if (UINT_MAX == LZO_0xffffL) -#if defined(__AZTEC_C__) && defined(__DOS__) -# define LZO_BROKEN_CDECL_ALT_SYNTAX 1 -#elif defined(_MSC_VER) && defined(MSDOS) -# if (_MSC_VER < 600) -# define LZO_BROKEN_INTEGRAL_CONSTANTS 1 -# endif -# if (_MSC_VER < 700) -# define LZO_BROKEN_INTEGRAL_PROMOTION 1 -# define LZO_BROKEN_SIZEOF 1 -# endif -#elif defined(__PACIFIC__) && defined(DOS) -# define LZO_BROKEN_INTEGRAL_CONSTANTS 1 -#elif defined(__TURBOC__) && defined(__MSDOS__) -# if (__TURBOC__ < 0x0150) -# define LZO_BROKEN_CDECL_ALT_SYNTAX 1 -# define LZO_BROKEN_INTEGRAL_CONSTANTS 1 -# define LZO_BROKEN_INTEGRAL_PROMOTION 1 -# endif -# if (__TURBOC__ < 0x0200) -# define LZO_BROKEN_SIZEOF 1 -# endif -# if (__TURBOC__ < 0x0400) && defined(__cplusplus) -# define LZO_BROKEN_CDECL_ALT_SYNTAX 1 -# endif -#elif (defined(__PUREC__) || defined(__TURBOC__)) && defined(__TOS__) -# define LZO_BROKEN_CDECL_ALT_SYNTAX 1 -# define LZO_BROKEN_SIZEOF 1 -#endif -#endif -#if defined(__WATCOMC__) && (__WATCOMC__ < 900) -# define LZO_BROKEN_INTEGRAL_CONSTANTS 1 -#endif -#if defined(_CRAY) && defined(_CRAY1) -# define LZO_BROKEN_SIGNED_RIGHT_SHIFT 1 -#endif -#define LZO_PP_STRINGIZE(x) #x -#define LZO_PP_MACRO_EXPAND(x) LZO_PP_STRINGIZE(x) -#define LZO_PP_CONCAT0() /*empty*/ -#define LZO_PP_CONCAT1(a) a -#define LZO_PP_CONCAT2(a,b) a ## b -#define LZO_PP_CONCAT3(a,b,c) a ## b ## c -#define LZO_PP_CONCAT4(a,b,c,d) a ## b ## c ## d -#define LZO_PP_CONCAT5(a,b,c,d,e) a ## b ## c ## d ## e -#define LZO_PP_CONCAT6(a,b,c,d,e,f) a ## b ## c ## d ## e ## f -#define LZO_PP_CONCAT7(a,b,c,d,e,f,g) a ## b ## c ## d ## e ## f ## g -#define LZO_PP_ECONCAT0() LZO_PP_CONCAT0() -#define LZO_PP_ECONCAT1(a) LZO_PP_CONCAT1(a) -#define LZO_PP_ECONCAT2(a,b) LZO_PP_CONCAT2(a,b) -#define LZO_PP_ECONCAT3(a,b,c) LZO_PP_CONCAT3(a,b,c) -#define LZO_PP_ECONCAT4(a,b,c,d) LZO_PP_CONCAT4(a,b,c,d) -#define LZO_PP_ECONCAT5(a,b,c,d,e) LZO_PP_CONCAT5(a,b,c,d,e) -#define LZO_PP_ECONCAT6(a,b,c,d,e,f) LZO_PP_CONCAT6(a,b,c,d,e,f) -#define LZO_PP_ECONCAT7(a,b,c,d,e,f,g) LZO_PP_CONCAT7(a,b,c,d,e,f,g) -#define LZO_PP_EMPTY /*empty*/ -#define LZO_PP_EMPTY0() /*empty*/ -#define LZO_PP_EMPTY1(a) /*empty*/ -#define LZO_PP_EMPTY2(a,b) /*empty*/ -#define LZO_PP_EMPTY3(a,b,c) /*empty*/ -#define LZO_PP_EMPTY4(a,b,c,d) /*empty*/ -#define LZO_PP_EMPTY5(a,b,c,d,e) /*empty*/ -#define LZO_PP_EMPTY6(a,b,c,d,e,f) /*empty*/ -#define LZO_PP_EMPTY7(a,b,c,d,e,f,g) /*empty*/ -#if 1 -#define LZO_CPP_STRINGIZE(x) #x -#define LZO_CPP_MACRO_EXPAND(x) LZO_CPP_STRINGIZE(x) -#define LZO_CPP_CONCAT2(a,b) a ## b -#define LZO_CPP_CONCAT3(a,b,c) a ## b ## c -#define LZO_CPP_CONCAT4(a,b,c,d) a ## b ## c ## d -#define LZO_CPP_CONCAT5(a,b,c,d,e) a ## b ## c ## d ## e -#define LZO_CPP_CONCAT6(a,b,c,d,e,f) a ## b ## c ## d ## e ## f -#define LZO_CPP_CONCAT7(a,b,c,d,e,f,g) a ## b ## c ## d ## e ## f ## g -#define LZO_CPP_ECONCAT2(a,b) LZO_CPP_CONCAT2(a,b) -#define LZO_CPP_ECONCAT3(a,b,c) LZO_CPP_CONCAT3(a,b,c) -#define LZO_CPP_ECONCAT4(a,b,c,d) LZO_CPP_CONCAT4(a,b,c,d) -#define LZO_CPP_ECONCAT5(a,b,c,d,e) LZO_CPP_CONCAT5(a,b,c,d,e) -#define LZO_CPP_ECONCAT6(a,b,c,d,e,f) LZO_CPP_CONCAT6(a,b,c,d,e,f) -#define LZO_CPP_ECONCAT7(a,b,c,d,e,f,g) LZO_CPP_CONCAT7(a,b,c,d,e,f,g) -#endif -#define __LZO_MASK_GEN(o,b) (((((o) << ((b)-!!(b))) - (o)) << 1) + (o)*!!(b)) -#if 1 && defined(__cplusplus) -# if !defined(__STDC_CONSTANT_MACROS) -# define __STDC_CONSTANT_MACROS 1 -# endif -# if !defined(__STDC_LIMIT_MACROS) -# define __STDC_LIMIT_MACROS 1 -# endif -#endif -#if defined(__cplusplus) -# define LZO_EXTERN_C extern "C" -# define LZO_EXTERN_C_BEGIN extern "C" { -# define LZO_EXTERN_C_END } -#else -# define LZO_EXTERN_C extern -# define LZO_EXTERN_C_BEGIN /*empty*/ -# define LZO_EXTERN_C_END /*empty*/ -#endif -#if !defined(__LZO_OS_OVERRIDE) -#if (LZO_OS_FREESTANDING) -# define LZO_INFO_OS "freestanding" -#elif (LZO_OS_EMBEDDED) -# define LZO_INFO_OS "embedded" -#elif 1 && defined(__IAR_SYSTEMS_ICC__) -# define LZO_OS_EMBEDDED 1 -# define LZO_INFO_OS "embedded" -#elif defined(__CYGWIN__) && defined(__GNUC__) -# define LZO_OS_CYGWIN 1 -# define LZO_INFO_OS "cygwin" -#elif defined(__EMX__) && defined(__GNUC__) -# define LZO_OS_EMX 1 -# define LZO_INFO_OS "emx" -#elif defined(__BEOS__) -# define LZO_OS_BEOS 1 -# define LZO_INFO_OS "beos" -#elif defined(__Lynx__) -# define LZO_OS_LYNXOS 1 -# define LZO_INFO_OS "lynxos" -#elif defined(__OS400__) -# define LZO_OS_OS400 1 -# define LZO_INFO_OS "os400" -#elif defined(__QNX__) -# define LZO_OS_QNX 1 -# define LZO_INFO_OS "qnx" -#elif defined(__BORLANDC__) && defined(__DPMI32__) && (__BORLANDC__ >= 0x0460) -# define LZO_OS_DOS32 1 -# define LZO_INFO_OS "dos32" -#elif defined(__BORLANDC__) && defined(__DPMI16__) -# define LZO_OS_DOS16 1 -# define LZO_INFO_OS "dos16" -#elif defined(__ZTC__) && defined(DOS386) -# define LZO_OS_DOS32 1 -# define LZO_INFO_OS "dos32" -#elif defined(__OS2__) || defined(__OS2V2__) -# if (UINT_MAX == LZO_0xffffL) -# define LZO_OS_OS216 1 -# define LZO_INFO_OS "os216" -# elif (UINT_MAX == LZO_0xffffffffL) -# define LZO_OS_OS2 1 -# define LZO_INFO_OS "os2" -# else -# error "check your limits.h header" -# endif -#elif defined(__WIN64__) || defined(_WIN64) || defined(WIN64) -# define LZO_OS_WIN64 1 -# define LZO_INFO_OS "win64" -#elif defined(__WIN32__) || defined(_WIN32) || defined(WIN32) || defined(__WINDOWS_386__) -# define LZO_OS_WIN32 1 -# define LZO_INFO_OS "win32" -#elif defined(__MWERKS__) && defined(__INTEL__) -# define LZO_OS_WIN32 1 -# define LZO_INFO_OS "win32" -#elif defined(__WINDOWS__) || defined(_WINDOWS) || defined(_Windows) -# if (UINT_MAX == LZO_0xffffL) -# define LZO_OS_WIN16 1 -# define LZO_INFO_OS "win16" -# elif (UINT_MAX == LZO_0xffffffffL) -# define LZO_OS_WIN32 1 -# define LZO_INFO_OS "win32" -# else -# error "check your limits.h header" -# endif -#elif defined(__DOS__) || defined(__MSDOS__) || defined(_MSDOS) || defined(MSDOS) || (defined(__PACIFIC__) && defined(DOS)) -# if (UINT_MAX == LZO_0xffffL) -# define LZO_OS_DOS16 1 -# define LZO_INFO_OS "dos16" -# elif (UINT_MAX == LZO_0xffffffffL) -# define LZO_OS_DOS32 1 -# define LZO_INFO_OS "dos32" -# else -# error "check your limits.h header" -# endif -#elif defined(__WATCOMC__) -# if defined(__NT__) && (UINT_MAX == LZO_0xffffL) -# define LZO_OS_DOS16 1 -# define LZO_INFO_OS "dos16" -# elif defined(__NT__) && (__WATCOMC__ < 1100) -# define LZO_OS_WIN32 1 -# define LZO_INFO_OS "win32" -# elif defined(__linux__) || defined(__LINUX__) -# define LZO_OS_POSIX 1 -# define LZO_INFO_OS "posix" -# else -# error "please specify a target using the -bt compiler option" -# endif -#elif defined(__palmos__) -# define LZO_OS_PALMOS 1 -# define LZO_INFO_OS "palmos" -#elif defined(__TOS__) || defined(__atarist__) -# define LZO_OS_TOS 1 -# define LZO_INFO_OS "tos" -#elif defined(macintosh) && !defined(__arm__) && !defined(__i386__) && !defined(__ppc__) && !defined(__x64_64__) -# define LZO_OS_MACCLASSIC 1 -# define LZO_INFO_OS "macclassic" -#elif defined(__VMS) -# define LZO_OS_VMS 1 -# define LZO_INFO_OS "vms" -#elif (defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__) -# define LZO_OS_CONSOLE 1 -# define LZO_OS_CONSOLE_PS2 1 -# define LZO_INFO_OS "console" -# define LZO_INFO_OS_CONSOLE "ps2" -#elif defined(__mips__) && defined(__psp__) -# define LZO_OS_CONSOLE 1 -# define LZO_OS_CONSOLE_PSP 1 -# define LZO_INFO_OS "console" -# define LZO_INFO_OS_CONSOLE "psp" -#else -# define LZO_OS_POSIX 1 -# define LZO_INFO_OS "posix" -#endif -#if (LZO_OS_POSIX) -# if defined(_AIX) || defined(__AIX__) || defined(__aix__) -# define LZO_OS_POSIX_AIX 1 -# define LZO_INFO_OS_POSIX "aix" -# elif defined(__FreeBSD__) -# define LZO_OS_POSIX_FREEBSD 1 -# define LZO_INFO_OS_POSIX "freebsd" -# elif defined(__hpux__) || defined(__hpux) -# define LZO_OS_POSIX_HPUX 1 -# define LZO_INFO_OS_POSIX "hpux" -# elif defined(__INTERIX) -# define LZO_OS_POSIX_INTERIX 1 -# define LZO_INFO_OS_POSIX "interix" -# elif defined(__IRIX__) || defined(__irix__) -# define LZO_OS_POSIX_IRIX 1 -# define LZO_INFO_OS_POSIX "irix" -# elif defined(__linux__) || defined(__linux) || defined(__LINUX__) -# define LZO_OS_POSIX_LINUX 1 -# define LZO_INFO_OS_POSIX "linux" -# elif defined(__APPLE__) && defined(__MACH__) -# if ((__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__-0) >= 20000) -# define LZO_OS_POSIX_DARWIN 1040 -# define LZO_INFO_OS_POSIX "darwin_iphone" -# elif ((__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0) >= 1040) -# define LZO_OS_POSIX_DARWIN __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ -# define LZO_INFO_OS_POSIX "darwin" -# else -# define LZO_OS_POSIX_DARWIN 1 -# define LZO_INFO_OS_POSIX "darwin" -# endif -# define LZO_OS_POSIX_MACOSX LZO_OS_POSIX_DARWIN -# elif defined(__minix__) || defined(__minix) -# define LZO_OS_POSIX_MINIX 1 -# define LZO_INFO_OS_POSIX "minix" -# elif defined(__NetBSD__) -# define LZO_OS_POSIX_NETBSD 1 -# define LZO_INFO_OS_POSIX "netbsd" -# elif defined(__OpenBSD__) -# define LZO_OS_POSIX_OPENBSD 1 -# define LZO_INFO_OS_POSIX "openbsd" -# elif defined(__osf__) -# define LZO_OS_POSIX_OSF 1 -# define LZO_INFO_OS_POSIX "osf" -# elif defined(__solaris__) || defined(__sun) -# if defined(__SVR4) || defined(__svr4__) -# define LZO_OS_POSIX_SOLARIS 1 -# define LZO_INFO_OS_POSIX "solaris" -# else -# define LZO_OS_POSIX_SUNOS 1 -# define LZO_INFO_OS_POSIX "sunos" -# endif -# elif defined(__ultrix__) || defined(__ultrix) -# define LZO_OS_POSIX_ULTRIX 1 -# define LZO_INFO_OS_POSIX "ultrix" -# elif defined(_UNICOS) -# define LZO_OS_POSIX_UNICOS 1 -# define LZO_INFO_OS_POSIX "unicos" -# else -# define LZO_OS_POSIX_UNKNOWN 1 -# define LZO_INFO_OS_POSIX "unknown" -# endif -#endif -#endif -#if (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16) -# if (UINT_MAX != LZO_0xffffL) -# error "unexpected configuration - check your compiler defines" -# endif -# if (ULONG_MAX != LZO_0xffffffffL) -# error "unexpected configuration - check your compiler defines" -# endif -#endif -#if (LZO_OS_DOS32 || LZO_OS_OS2 || LZO_OS_WIN32 || LZO_OS_WIN64) -# if (UINT_MAX != LZO_0xffffffffL) -# error "unexpected configuration - check your compiler defines" -# endif -# if (ULONG_MAX != LZO_0xffffffffL) -# error "unexpected configuration - check your compiler defines" -# endif -#endif -#if defined(CIL) && defined(_GNUCC) && defined(__GNUC__) -# define LZO_CC_CILLY 1 -# define LZO_INFO_CC "Cilly" -# if defined(__CILLY__) -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__CILLY__) -# else -# define LZO_INFO_CCVER "unknown" -# endif -#elif 0 && defined(SDCC) && defined(__VERSION__) && !defined(__GNUC__) -# define LZO_CC_SDCC 1 -# define LZO_INFO_CC "sdcc" -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(SDCC) -#elif defined(__PATHSCALE__) && defined(__PATHCC_PATCHLEVEL__) -# define LZO_CC_PATHSCALE (__PATHCC__ * 0x10000L + (__PATHCC_MINOR__-0) * 0x100 + (__PATHCC_PATCHLEVEL__-0)) -# define LZO_INFO_CC "Pathscale C" -# define LZO_INFO_CCVER __PATHSCALE__ -# if defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__) -# define LZO_CC_PATHSCALE_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0)) -# endif -#elif defined(__INTEL_COMPILER) && ((__INTEL_COMPILER-0) > 0) -# define LZO_CC_INTELC __INTEL_COMPILER -# define LZO_INFO_CC "Intel C" -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__INTEL_COMPILER) -# if defined(_MSC_VER) && ((_MSC_VER-0) > 0) -# define LZO_CC_INTELC_MSC _MSC_VER -# elif defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__) -# define LZO_CC_INTELC_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0)) -# endif -#elif defined(__POCC__) && defined(_WIN32) -# define LZO_CC_PELLESC 1 -# define LZO_INFO_CC "Pelles C" -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__POCC__) -#elif defined(__ARMCC_VERSION) && defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__) -# if defined(__GNUC_PATCHLEVEL__) -# define LZO_CC_ARMCC_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0)) -# else -# define LZO_CC_ARMCC_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100) -# endif -# define LZO_CC_ARMCC __ARMCC_VERSION -# define LZO_INFO_CC "ARM C Compiler" -# define LZO_INFO_CCVER __VERSION__ -#elif defined(__clang__) && defined(__llvm__) && defined(__VERSION__) -# if defined(__clang_major__) && defined(__clang_minor__) && defined(__clang_patchlevel__) -# define LZO_CC_CLANG (__clang_major__ * 0x10000L + (__clang_minor__-0) * 0x100 + (__clang_patchlevel__-0)) -# else -# define LZO_CC_CLANG 0x010000L -# endif -# if defined(_MSC_VER) && ((_MSC_VER-0) > 0) -# define LZO_CC_CLANG_MSC _MSC_VER -# elif defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__) -# define LZO_CC_CLANG_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0)) -# endif -# define LZO_INFO_CC "clang" -# define LZO_INFO_CCVER __VERSION__ -#elif defined(__llvm__) && defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__) -# if defined(__GNUC_PATCHLEVEL__) -# define LZO_CC_LLVM_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0)) -# else -# define LZO_CC_LLVM_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100) -# endif -# define LZO_CC_LLVM LZO_CC_LLVM_GNUC -# define LZO_INFO_CC "llvm-gcc" -# define LZO_INFO_CCVER __VERSION__ -#elif defined(__ACK__) && defined(_ACK) -# define LZO_CC_ACK 1 -# define LZO_INFO_CC "Amsterdam Compiler Kit C" -# define LZO_INFO_CCVER "unknown" -#elif defined(__ARMCC_VERSION) && !defined(__GNUC__) -# define LZO_CC_ARMCC __ARMCC_VERSION -# define LZO_CC_ARMCC_ARMCC __ARMCC_VERSION -# define LZO_INFO_CC "ARM C Compiler" -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__ARMCC_VERSION) -#elif defined(__AZTEC_C__) -# define LZO_CC_AZTECC 1 -# define LZO_INFO_CC "Aztec C" -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__AZTEC_C__) -#elif defined(__CODEGEARC__) -# define LZO_CC_CODEGEARC 1 -# define LZO_INFO_CC "CodeGear C" -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__CODEGEARC__) -#elif defined(__BORLANDC__) -# define LZO_CC_BORLANDC 1 -# define LZO_INFO_CC "Borland C" -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__BORLANDC__) -#elif defined(_CRAYC) && defined(_RELEASE) -# define LZO_CC_CRAYC 1 -# define LZO_INFO_CC "Cray C" -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(_RELEASE) -#elif defined(__DMC__) && defined(__SC__) -# define LZO_CC_DMC 1 -# define LZO_INFO_CC "Digital Mars C" -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__DMC__) -#elif defined(__DECC) -# define LZO_CC_DECC 1 -# define LZO_INFO_CC "DEC C" -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__DECC) -#elif (defined(__ghs) || defined(__ghs__)) && defined(__GHS_VERSION_NUMBER) && ((__GHS_VERSION_NUMBER-0) > 0) -# define LZO_CC_GHS 1 -# define LZO_INFO_CC "Green Hills C" -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__GHS_VERSION_NUMBER) -# if defined(_MSC_VER) && ((_MSC_VER-0) > 0) -# define LZO_CC_GHS_MSC _MSC_VER -# elif defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__) -# define LZO_CC_GHS_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0)) -# endif -#elif defined(__HIGHC__) -# define LZO_CC_HIGHC 1 -# define LZO_INFO_CC "MetaWare High C" -# define LZO_INFO_CCVER "unknown" -#elif defined(__HP_aCC) && ((__HP_aCC-0) > 0) -# define LZO_CC_HPACC __HP_aCC -# define LZO_INFO_CC "HP aCC" -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__HP_aCC) -#elif defined(__IAR_SYSTEMS_ICC__) -# define LZO_CC_IARC 1 -# define LZO_INFO_CC "IAR C" -# if defined(__VER__) -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__VER__) -# else -# define LZO_INFO_CCVER "unknown" -# endif -#elif defined(__IBMC__) && ((__IBMC__-0) > 0) -# define LZO_CC_IBMC __IBMC__ -# define LZO_INFO_CC "IBM C" -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__IBMC__) -#elif defined(__IBMCPP__) && ((__IBMCPP__-0) > 0) -# define LZO_CC_IBMC __IBMCPP__ -# define LZO_INFO_CC "IBM C" -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__IBMCPP__) -#elif defined(__KEIL__) && defined(__C166__) -# define LZO_CC_KEILC 1 -# define LZO_INFO_CC "Keil C" -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__C166__) -#elif defined(__LCC__) && defined(_WIN32) && defined(__LCCOPTIMLEVEL) -# define LZO_CC_LCCWIN32 1 -# define LZO_INFO_CC "lcc-win32" -# define LZO_INFO_CCVER "unknown" -#elif defined(__LCC__) -# define LZO_CC_LCC 1 -# define LZO_INFO_CC "lcc" -# if defined(__LCC_VERSION__) -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__LCC_VERSION__) -# else -# define LZO_INFO_CCVER "unknown" -# endif -#elif defined(__MWERKS__) && ((__MWERKS__-0) > 0) -# define LZO_CC_MWERKS __MWERKS__ -# define LZO_INFO_CC "Metrowerks C" -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__MWERKS__) -#elif (defined(__NDPC__) || defined(__NDPX__)) && defined(__i386) -# define LZO_CC_NDPC 1 -# define LZO_INFO_CC "Microway NDP C" -# define LZO_INFO_CCVER "unknown" -#elif defined(__PACIFIC__) -# define LZO_CC_PACIFICC 1 -# define LZO_INFO_CC "Pacific C" -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__PACIFIC__) -#elif defined(__PGI) && defined(__PGIC__) && defined(__PGIC_MINOR__) -# if defined(__PGIC_PATCHLEVEL__) -# define LZO_CC_PGI (__PGIC__ * 0x10000L + (__PGIC_MINOR__-0) * 0x100 + (__PGIC_PATCHLEVEL__-0)) -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__PGIC__) "." LZO_PP_MACRO_EXPAND(__PGIC_MINOR__) "." LZO_PP_MACRO_EXPAND(__PGIC_PATCHLEVEL__) -# else -# define LZO_CC_PGI (__PGIC__ * 0x10000L + (__PGIC_MINOR__-0) * 0x100) -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__PGIC__) "." LZO_PP_MACRO_EXPAND(__PGIC_MINOR__) ".0" -# endif -# define LZO_INFO_CC "Portland Group PGI C" -#elif defined(__PGI) && (defined(__linux__) || defined(__WIN32__)) -# define LZO_CC_PGI 1 -# define LZO_INFO_CC "Portland Group PGI C" -# define LZO_INFO_CCVER "unknown" -#elif defined(__PUREC__) && defined(__TOS__) -# define LZO_CC_PUREC 1 -# define LZO_INFO_CC "Pure C" -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__PUREC__) -#elif defined(__SC__) && defined(__ZTC__) -# define LZO_CC_SYMANTECC 1 -# define LZO_INFO_CC "Symantec C" -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__SC__) -#elif defined(__SUNPRO_C) -# define LZO_INFO_CC "SunPro C" -# if ((__SUNPRO_C-0) > 0) -# define LZO_CC_SUNPROC __SUNPRO_C -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__SUNPRO_C) -# else -# define LZO_CC_SUNPROC 1 -# define LZO_INFO_CCVER "unknown" -# endif -#elif defined(__SUNPRO_CC) -# define LZO_INFO_CC "SunPro C" -# if ((__SUNPRO_CC-0) > 0) -# define LZO_CC_SUNPROC __SUNPRO_CC -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__SUNPRO_CC) -# else -# define LZO_CC_SUNPROC 1 -# define LZO_INFO_CCVER "unknown" -# endif -#elif defined(__TINYC__) -# define LZO_CC_TINYC 1 -# define LZO_INFO_CC "Tiny C" -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__TINYC__) -#elif defined(__TSC__) -# define LZO_CC_TOPSPEEDC 1 -# define LZO_INFO_CC "TopSpeed C" -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__TSC__) -#elif defined(__WATCOMC__) -# define LZO_CC_WATCOMC 1 -# define LZO_INFO_CC "Watcom C" -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__WATCOMC__) -#elif defined(__TURBOC__) -# define LZO_CC_TURBOC 1 -# define LZO_INFO_CC "Turbo C" -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__TURBOC__) -#elif defined(__ZTC__) -# define LZO_CC_ZORTECHC 1 -# define LZO_INFO_CC "Zortech C" -# if ((__ZTC__-0) == 0x310) -# define LZO_INFO_CCVER "0x310" -# else -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__ZTC__) -# endif -#elif defined(__GNUC__) && defined(__VERSION__) -# if defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__) -# define LZO_CC_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0)) -# elif defined(__GNUC_MINOR__) -# define LZO_CC_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100) -# else -# define LZO_CC_GNUC (__GNUC__ * 0x10000L) -# endif -# define LZO_INFO_CC "gcc" -# define LZO_INFO_CCVER __VERSION__ -#elif defined(_MSC_VER) && ((_MSC_VER-0) > 0) -# define LZO_CC_MSC _MSC_VER -# define LZO_INFO_CC "Microsoft C" -# if defined(_MSC_FULL_VER) -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(_MSC_VER) "." LZO_PP_MACRO_EXPAND(_MSC_FULL_VER) -# else -# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(_MSC_VER) -# endif -#else -# define LZO_CC_UNKNOWN 1 -# define LZO_INFO_CC "unknown" -# define LZO_INFO_CCVER "unknown" -#endif -#if (LZO_CC_GNUC) && defined(__OPEN64__) -# if defined(__OPENCC__) && defined(__OPENCC_MINOR__) && defined(__OPENCC_PATCHLEVEL__) -# define LZO_CC_OPEN64 (__OPENCC__ * 0x10000L + (__OPENCC_MINOR__-0) * 0x100 + (__OPENCC_PATCHLEVEL__-0)) -# define LZO_CC_OPEN64_GNUC LZO_CC_GNUC -# endif -#endif -#if (LZO_CC_GNUC) && defined(__PCC__) -# if defined(__PCC__) && defined(__PCC_MINOR__) && defined(__PCC_MINORMINOR__) -# define LZO_CC_PCC (__PCC__ * 0x10000L + (__PCC_MINOR__-0) * 0x100 + (__PCC_MINORMINOR__-0)) -# define LZO_CC_PCC_GNUC LZO_CC_GNUC -# endif -#endif -#if 0 && (LZO_CC_MSC && (_MSC_VER >= 1200)) && !defined(_MSC_FULL_VER) -# error "LZO_CC_MSC: _MSC_FULL_VER is not defined" -#endif -#if !defined(__LZO_ARCH_OVERRIDE) && !(LZO_ARCH_GENERIC) && defined(_CRAY) -# if (UINT_MAX > LZO_0xffffffffL) && defined(_CRAY) -# if defined(_CRAYMPP) || defined(_CRAYT3D) || defined(_CRAYT3E) -# define LZO_ARCH_CRAY_MPP 1 -# elif defined(_CRAY1) -# define LZO_ARCH_CRAY_PVP 1 -# endif -# endif -#endif -#if !defined(__LZO_ARCH_OVERRIDE) -#if (LZO_ARCH_GENERIC) -# define LZO_INFO_ARCH "generic" -#elif (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16) -# define LZO_ARCH_I086 1 -# define LZO_INFO_ARCH "i086" -#elif defined(__aarch64__) -# define LZO_ARCH_ARM64 1 -# define LZO_INFO_ARCH "arm64" -#elif defined(__alpha__) || defined(__alpha) || defined(_M_ALPHA) -# define LZO_ARCH_ALPHA 1 -# define LZO_INFO_ARCH "alpha" -#elif (LZO_ARCH_CRAY_MPP) && (defined(_CRAYT3D) || defined(_CRAYT3E)) -# define LZO_ARCH_ALPHA 1 -# define LZO_INFO_ARCH "alpha" -#elif defined(__amd64__) || defined(__x86_64__) || defined(_M_AMD64) -# define LZO_ARCH_AMD64 1 -# define LZO_INFO_ARCH "amd64" -#elif defined(__arm__) || defined(_M_ARM) -# define LZO_ARCH_ARM 1 -# define LZO_INFO_ARCH "arm" -#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICCARM__) -# define LZO_ARCH_ARM 1 -# define LZO_INFO_ARCH "arm" -#elif (UINT_MAX <= LZO_0xffffL) && defined(__AVR__) -# define LZO_ARCH_AVR 1 -# define LZO_INFO_ARCH "avr" -#elif defined(__avr32__) || defined(__AVR32__) -# define LZO_ARCH_AVR32 1 -# define LZO_INFO_ARCH "avr32" -#elif defined(__bfin__) -# define LZO_ARCH_BLACKFIN 1 -# define LZO_INFO_ARCH "blackfin" -#elif (UINT_MAX == LZO_0xffffL) && defined(__C166__) -# define LZO_ARCH_C166 1 -# define LZO_INFO_ARCH "c166" -#elif defined(__cris__) -# define LZO_ARCH_CRIS 1 -# define LZO_INFO_ARCH "cris" -#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICCEZ80__) -# define LZO_ARCH_EZ80 1 -# define LZO_INFO_ARCH "ez80" -#elif defined(__H8300__) || defined(__H8300H__) || defined(__H8300S__) || defined(__H8300SX__) -# define LZO_ARCH_H8300 1 -# define LZO_INFO_ARCH "h8300" -#elif defined(__hppa__) || defined(__hppa) -# define LZO_ARCH_HPPA 1 -# define LZO_INFO_ARCH "hppa" -#elif defined(__386__) || defined(__i386__) || defined(__i386) || defined(_M_IX86) || defined(_M_I386) -# define LZO_ARCH_I386 1 -# define LZO_ARCH_IA32 1 -# define LZO_INFO_ARCH "i386" -#elif (LZO_CC_ZORTECHC && defined(__I86__)) -# define LZO_ARCH_I386 1 -# define LZO_ARCH_IA32 1 -# define LZO_INFO_ARCH "i386" -#elif (LZO_OS_DOS32 && LZO_CC_HIGHC) && defined(_I386) -# define LZO_ARCH_I386 1 -# define LZO_ARCH_IA32 1 -# define LZO_INFO_ARCH "i386" -#elif defined(__ia64__) || defined(__ia64) || defined(_M_IA64) -# define LZO_ARCH_IA64 1 -# define LZO_INFO_ARCH "ia64" -#elif (UINT_MAX == LZO_0xffffL) && defined(__m32c__) -# define LZO_ARCH_M16C 1 -# define LZO_INFO_ARCH "m16c" -#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICCM16C__) -# define LZO_ARCH_M16C 1 -# define LZO_INFO_ARCH "m16c" -#elif defined(__m32r__) -# define LZO_ARCH_M32R 1 -# define LZO_INFO_ARCH "m32r" -#elif (LZO_OS_TOS) || defined(__m68k__) || defined(__m68000__) || defined(__mc68000__) || defined(__mc68020__) || defined(_M_M68K) -# define LZO_ARCH_M68K 1 -# define LZO_INFO_ARCH "m68k" -#elif (UINT_MAX == LZO_0xffffL) && defined(__C251__) -# define LZO_ARCH_MCS251 1 -# define LZO_INFO_ARCH "mcs251" -#elif (UINT_MAX == LZO_0xffffL) && defined(__C51__) -# define LZO_ARCH_MCS51 1 -# define LZO_INFO_ARCH "mcs51" -#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICC8051__) -# define LZO_ARCH_MCS51 1 -# define LZO_INFO_ARCH "mcs51" -#elif defined(__mips__) || defined(__mips) || defined(_MIPS_ARCH) || defined(_M_MRX000) -# define LZO_ARCH_MIPS 1 -# define LZO_INFO_ARCH "mips" -#elif (UINT_MAX == LZO_0xffffL) && defined(__MSP430__) -# define LZO_ARCH_MSP430 1 -# define LZO_INFO_ARCH "msp430" -#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICC430__) -# define LZO_ARCH_MSP430 1 -# define LZO_INFO_ARCH "msp430" -#elif defined(__powerpc__) || defined(__powerpc) || defined(__ppc__) || defined(__PPC__) || defined(_M_PPC) || defined(_ARCH_PPC) || defined(_ARCH_PWR) -# define LZO_ARCH_POWERPC 1 -# define LZO_INFO_ARCH "powerpc" -#elif defined(__s390__) || defined(__s390) || defined(__s390x__) || defined(__s390x) -# define LZO_ARCH_S390 1 -# define LZO_INFO_ARCH "s390" -#elif defined(__sh__) || defined(_M_SH) -# define LZO_ARCH_SH 1 -# define LZO_INFO_ARCH "sh" -#elif defined(__sparc__) || defined(__sparc) || defined(__sparcv8) -# define LZO_ARCH_SPARC 1 -# define LZO_INFO_ARCH "sparc" -#elif defined(__SPU__) -# define LZO_ARCH_SPU 1 -# define LZO_INFO_ARCH "spu" -#elif (UINT_MAX == LZO_0xffffL) && defined(__z80) -# define LZO_ARCH_Z80 1 -# define LZO_INFO_ARCH "z80" -#elif (LZO_ARCH_CRAY_PVP) -# if defined(_CRAYSV1) -# define LZO_ARCH_CRAY_SV1 1 -# define LZO_INFO_ARCH "cray_sv1" -# elif (_ADDR64) -# define LZO_ARCH_CRAY_T90 1 -# define LZO_INFO_ARCH "cray_t90" -# elif (_ADDR32) -# define LZO_ARCH_CRAY_YMP 1 -# define LZO_INFO_ARCH "cray_ymp" -# else -# define LZO_ARCH_CRAY_XMP 1 -# define LZO_INFO_ARCH "cray_xmp" -# endif -#else -# define LZO_ARCH_UNKNOWN 1 -# define LZO_INFO_ARCH "unknown" -#endif -#endif -#if !defined(LZO_ARCH_ARM_THUMB2) -#if (LZO_ARCH_ARM) -# if defined(__ARM_ARCH_ISA_THUMB) -# if ((__ARM_ARCH_ISA_THUMB)+0 >= 2) -# define LZO_ARCH_ARM_THUMB2 1 -# endif -# elif 1 && defined(__thumb2__) -# define LZO_ARCH_ARM_THUMB2 1 -# elif 1 && defined(__TARGET_ARCH_THUMB) && ((__TARGET_ARCH_THUMB)+0 >= 4) -# define LZO_ARCH_ARM_THUMB2 1 -# endif -#endif -#endif -#if 1 && (LZO_ARCH_UNKNOWN) && (LZO_OS_DOS32 || LZO_OS_OS2) -# error "FIXME - missing define for CPU architecture" -#endif -#if 1 && (LZO_ARCH_UNKNOWN) && (LZO_OS_WIN32) -# error "FIXME - missing LZO_OS_WIN32 define for CPU architecture" -#endif -#if 1 && (LZO_ARCH_UNKNOWN) && (LZO_OS_WIN64) -# error "FIXME - missing LZO_OS_WIN64 define for CPU architecture" -#endif -#if (LZO_OS_OS216 || LZO_OS_WIN16) -# define LZO_ARCH_I086PM 1 -#elif 1 && (LZO_OS_DOS16 && defined(BLX286)) -# define LZO_ARCH_I086PM 1 -#elif 1 && (LZO_OS_DOS16 && defined(DOSX286)) -# define LZO_ARCH_I086PM 1 -#elif 1 && (LZO_OS_DOS16 && LZO_CC_BORLANDC && defined(__DPMI16__)) -# define LZO_ARCH_I086PM 1 -#endif -#if (LZO_ARCH_AMD64 && !LZO_ARCH_X64) -# define LZO_ARCH_X64 1 -#elif (!LZO_ARCH_AMD64 && LZO_ARCH_X64) && defined(__LZO_ARCH_OVERRIDE) -# define LZO_ARCH_AMD64 1 -#endif -#if (LZO_ARCH_ARM64 && !LZO_ARCH_AARCH64) -# define LZO_ARCH_AARCH64 1 -#elif (!LZO_ARCH_ARM64 && LZO_ARCH_AARCH64) && defined(__LZO_ARCH_OVERRIDE) -# define LZO_ARCH_ARM64 1 -#endif -#if (LZO_ARCH_I386 && !LZO_ARCH_X86) -# define LZO_ARCH_X86 1 -#elif (!LZO_ARCH_I386 && LZO_ARCH_X86) && defined(__LZO_ARCH_OVERRIDE) -# define LZO_ARCH_I386 1 -#endif -#if (LZO_ARCH_AMD64 && !LZO_ARCH_X64) || (!LZO_ARCH_AMD64 && LZO_ARCH_X64) -# error "unexpected configuration - check your compiler defines" -#endif -#if (LZO_ARCH_ARM64 && !LZO_ARCH_AARCH64) || (!LZO_ARCH_ARM64 && LZO_ARCH_AARCH64) -# error "unexpected configuration - check your compiler defines" -#endif -#if (LZO_ARCH_I386 && !LZO_ARCH_X86) || (!LZO_ARCH_I386 && LZO_ARCH_X86) -# error "unexpected configuration - check your compiler defines" -#endif -#if (LZO_ARCH_ARM_THUMB1 && !LZO_ARCH_ARM) -# error "unexpected configuration - check your compiler defines" -#endif -#if (LZO_ARCH_ARM_THUMB2 && !LZO_ARCH_ARM) -# error "unexpected configuration - check your compiler defines" -#endif -#if (LZO_ARCH_ARM_THUMB1 && LZO_ARCH_ARM_THUMB2) -# error "unexpected configuration - check your compiler defines" -#endif -#if (LZO_ARCH_I086PM && !LZO_ARCH_I086) -# error "unexpected configuration - check your compiler defines" -#endif -#if (LZO_ARCH_I086) -# if (UINT_MAX != LZO_0xffffL) -# error "unexpected configuration - check your compiler defines" -# endif -# if (ULONG_MAX != LZO_0xffffffffL) -# error "unexpected configuration - check your compiler defines" -# endif -#endif -#if (LZO_ARCH_I386) -# if (UINT_MAX != LZO_0xffffL) && defined(__i386_int16__) -# error "unexpected configuration - check your compiler defines" -# endif -# if (UINT_MAX != LZO_0xffffffffL) && !defined(__i386_int16__) -# error "unexpected configuration - check your compiler defines" -# endif -# if (ULONG_MAX != LZO_0xffffffffL) -# error "unexpected configuration - check your compiler defines" -# endif -#endif -#if (LZO_ARCH_AMD64 || LZO_ARCH_I386) -# if !defined(LZO_TARGET_FEATURE_SSE2) -# if defined(__SSE2__) -# define LZO_TARGET_FEATURE_SSE2 1 -# elif defined(_MSC_VER) && (defined(_M_IX86_FP) && ((_M_IX86_FP)+0 >= 2)) -# define LZO_TARGET_FEATURE_SSE2 1 -# elif (LZO_CC_INTELC_MSC || LZO_CC_MSC) && defined(_M_AMD64) -# define LZO_TARGET_FEATURE_SSE2 1 -# endif -# endif -# if !defined(LZO_TARGET_FEATURE_SSSE3) -# if (LZO_TARGET_FEATURE_SSE2) -# if defined(__SSSE3__) -# define LZO_TARGET_FEATURE_SSSE3 1 -# elif defined(_MSC_VER) && defined(__AVX__) -# define LZO_TARGET_FEATURE_SSSE3 1 -# endif -# endif -# endif -# if !defined(LZO_TARGET_FEATURE_SSE4_2) -# if (LZO_TARGET_FEATURE_SSSE3) -# if defined(__SSE4_2__) -# define LZO_TARGET_FEATURE_SSE4_2 1 -# endif -# endif -# endif -# if !defined(LZO_TARGET_FEATURE_AVX) -# if (LZO_TARGET_FEATURE_SSSE3) -# if defined(__AVX__) -# define LZO_TARGET_FEATURE_AVX 1 -# endif -# endif -# endif -# if !defined(LZO_TARGET_FEATURE_AVX2) -# if (LZO_TARGET_FEATURE_AVX) -# if defined(__AVX2__) -# define LZO_TARGET_FEATURE_AVX2 1 -# endif -# endif -# endif -#endif -#if (LZO_TARGET_FEATURE_SSSE3 && !(LZO_TARGET_FEATURE_SSE2)) -# error "unexpected configuration - check your compiler defines" -#endif -#if (LZO_TARGET_FEATURE_SSE4_2 && !(LZO_TARGET_FEATURE_SSSE3)) -# error "unexpected configuration - check your compiler defines" -#endif -#if (LZO_TARGET_FEATURE_AVX && !(LZO_TARGET_FEATURE_SSSE3)) -# error "unexpected configuration - check your compiler defines" -#endif -#if (LZO_TARGET_FEATURE_AVX2 && !(LZO_TARGET_FEATURE_AVX)) -# error "unexpected configuration - check your compiler defines" -#endif -#if (LZO_ARCH_ARM) -# if !defined(LZO_TARGET_FEATURE_NEON) -# if defined(__ARM_NEON) && ((__ARM_NEON)+0) -# define LZO_TARGET_FEATURE_NEON 1 -# elif 1 && defined(__ARM_NEON__) && ((__ARM_NEON__)+0) -# define LZO_TARGET_FEATURE_NEON 1 -# elif 1 && defined(__TARGET_FEATURE_NEON) && ((__TARGET_FEATURE_NEON)+0) -# define LZO_TARGET_FEATURE_NEON 1 -# endif -# endif -#elif (LZO_ARCH_ARM64) -# if !defined(LZO_TARGET_FEATURE_NEON) -# if 1 -# define LZO_TARGET_FEATURE_NEON 1 -# endif -# endif -#endif -#if 0 -#elif !defined(__LZO_MM_OVERRIDE) -#if (LZO_ARCH_I086) -#if (UINT_MAX != LZO_0xffffL) -# error "unexpected configuration - check your compiler defines" -#endif -#if defined(__TINY__) || defined(M_I86TM) || defined(_M_I86TM) -# define LZO_MM_TINY 1 -#elif defined(__HUGE__) || defined(_HUGE_) || defined(M_I86HM) || defined(_M_I86HM) -# define LZO_MM_HUGE 1 -#elif defined(__SMALL__) || defined(M_I86SM) || defined(_M_I86SM) || defined(SMALL_MODEL) -# define LZO_MM_SMALL 1 -#elif defined(__MEDIUM__) || defined(M_I86MM) || defined(_M_I86MM) -# define LZO_MM_MEDIUM 1 -#elif defined(__COMPACT__) || defined(M_I86CM) || defined(_M_I86CM) -# define LZO_MM_COMPACT 1 -#elif defined(__LARGE__) || defined(M_I86LM) || defined(_M_I86LM) || defined(LARGE_MODEL) -# define LZO_MM_LARGE 1 -#elif (LZO_CC_AZTECC) -# if defined(_LARGE_CODE) && defined(_LARGE_DATA) -# define LZO_MM_LARGE 1 -# elif defined(_LARGE_CODE) -# define LZO_MM_MEDIUM 1 -# elif defined(_LARGE_DATA) -# define LZO_MM_COMPACT 1 -# else -# define LZO_MM_SMALL 1 -# endif -#elif (LZO_CC_ZORTECHC && defined(__VCM__)) -# define LZO_MM_LARGE 1 -#else -# error "unknown LZO_ARCH_I086 memory model" -#endif -#if (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16) -#define LZO_HAVE_MM_HUGE_PTR 1 -#define LZO_HAVE_MM_HUGE_ARRAY 1 -#if (LZO_MM_TINY) -# undef LZO_HAVE_MM_HUGE_ARRAY -#endif -#if (LZO_CC_AZTECC || LZO_CC_PACIFICC || LZO_CC_ZORTECHC) -# undef LZO_HAVE_MM_HUGE_PTR -# undef LZO_HAVE_MM_HUGE_ARRAY -#elif (LZO_CC_DMC || LZO_CC_SYMANTECC) -# undef LZO_HAVE_MM_HUGE_ARRAY -#elif (LZO_CC_MSC && defined(_QC)) -# undef LZO_HAVE_MM_HUGE_ARRAY -# if (_MSC_VER < 600) -# undef LZO_HAVE_MM_HUGE_PTR -# endif -#elif (LZO_CC_TURBOC && (__TURBOC__ < 0x0295)) -# undef LZO_HAVE_MM_HUGE_ARRAY -#endif -#if (LZO_ARCH_I086PM) && !(LZO_HAVE_MM_HUGE_PTR) -# if (LZO_OS_DOS16) -# error "unexpected configuration - check your compiler defines" -# elif (LZO_CC_ZORTECHC) -# else -# error "unexpected configuration - check your compiler defines" -# endif -#endif -#ifdef __cplusplus -extern "C" { -#endif -#if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0200)) - extern void __near __cdecl _AHSHIFT(void); -# define LZO_MM_AHSHIFT ((unsigned) _AHSHIFT) -#elif (LZO_CC_DMC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC) - extern void __near __cdecl _AHSHIFT(void); -# define LZO_MM_AHSHIFT ((unsigned) _AHSHIFT) -#elif (LZO_CC_MSC || LZO_CC_TOPSPEEDC) - extern void __near __cdecl _AHSHIFT(void); -# define LZO_MM_AHSHIFT ((unsigned) _AHSHIFT) -#elif (LZO_CC_TURBOC && (__TURBOC__ >= 0x0295)) - extern void __near __cdecl _AHSHIFT(void); -# define LZO_MM_AHSHIFT ((unsigned) _AHSHIFT) -#elif ((LZO_CC_AZTECC || LZO_CC_PACIFICC || LZO_CC_TURBOC) && LZO_OS_DOS16) -# define LZO_MM_AHSHIFT 12 -#elif (LZO_CC_WATCOMC) - extern unsigned char _HShift; -# define LZO_MM_AHSHIFT ((unsigned) _HShift) -#else -# error "FIXME - implement LZO_MM_AHSHIFT" -#endif -#ifdef __cplusplus -} -#endif -#endif -#elif (LZO_ARCH_C166) -#if !defined(__MODEL__) -# error "FIXME - LZO_ARCH_C166 __MODEL__" -#elif ((__MODEL__) == 0) -# define LZO_MM_SMALL 1 -#elif ((__MODEL__) == 1) -# define LZO_MM_SMALL 1 -#elif ((__MODEL__) == 2) -# define LZO_MM_LARGE 1 -#elif ((__MODEL__) == 3) -# define LZO_MM_TINY 1 -#elif ((__MODEL__) == 4) -# define LZO_MM_XTINY 1 -#elif ((__MODEL__) == 5) -# define LZO_MM_XSMALL 1 -#else -# error "FIXME - LZO_ARCH_C166 __MODEL__" -#endif -#elif (LZO_ARCH_MCS251) -#if !defined(__MODEL__) -# error "FIXME - LZO_ARCH_MCS251 __MODEL__" -#elif ((__MODEL__) == 0) -# define LZO_MM_SMALL 1 -#elif ((__MODEL__) == 2) -# define LZO_MM_LARGE 1 -#elif ((__MODEL__) == 3) -# define LZO_MM_TINY 1 -#elif ((__MODEL__) == 4) -# define LZO_MM_XTINY 1 -#elif ((__MODEL__) == 5) -# define LZO_MM_XSMALL 1 -#else -# error "FIXME - LZO_ARCH_MCS251 __MODEL__" -#endif -#elif (LZO_ARCH_MCS51) -#if !defined(__MODEL__) -# error "FIXME - LZO_ARCH_MCS51 __MODEL__" -#elif ((__MODEL__) == 1) -# define LZO_MM_SMALL 1 -#elif ((__MODEL__) == 2) -# define LZO_MM_LARGE 1 -#elif ((__MODEL__) == 3) -# define LZO_MM_TINY 1 -#elif ((__MODEL__) == 4) -# define LZO_MM_XTINY 1 -#elif ((__MODEL__) == 5) -# define LZO_MM_XSMALL 1 -#else -# error "FIXME - LZO_ARCH_MCS51 __MODEL__" -#endif -#elif (LZO_ARCH_CRAY_PVP) -# define LZO_MM_PVP 1 -#else -# define LZO_MM_FLAT 1 -#endif -#if (LZO_MM_COMPACT) -# define LZO_INFO_MM "compact" -#elif (LZO_MM_FLAT) -# define LZO_INFO_MM "flat" -#elif (LZO_MM_HUGE) -# define LZO_INFO_MM "huge" -#elif (LZO_MM_LARGE) -# define LZO_INFO_MM "large" -#elif (LZO_MM_MEDIUM) -# define LZO_INFO_MM "medium" -#elif (LZO_MM_PVP) -# define LZO_INFO_MM "pvp" -#elif (LZO_MM_SMALL) -# define LZO_INFO_MM "small" -#elif (LZO_MM_TINY) -# define LZO_INFO_MM "tiny" -#else -# error "unknown memory model" -#endif -#endif -#if !defined(__lzo_gnuc_extension__) -#if (LZO_CC_GNUC >= 0x020800ul) -# define __lzo_gnuc_extension__ __extension__ -#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) -# define __lzo_gnuc_extension__ __extension__ -#elif (LZO_CC_IBMC >= 600) -# define __lzo_gnuc_extension__ __extension__ -#else -#endif -#endif -#if !defined(__lzo_gnuc_extension__) -# define __lzo_gnuc_extension__ /*empty*/ -#endif -#if !defined(lzo_has_builtin) -#if (LZO_CC_CLANG) && defined(__has_builtin) -# define lzo_has_builtin __has_builtin -#endif -#endif -#if !defined(lzo_has_builtin) -# define lzo_has_builtin(x) 0 -#endif -#if !defined(lzo_has_attribute) -#if (LZO_CC_CLANG) && defined(__has_attribute) -# define lzo_has_attribute __has_attribute -#endif -#endif -#if !defined(lzo_has_attribute) -# define lzo_has_attribute(x) 0 -#endif -#if !defined(lzo_has_declspec_attribute) -#if (LZO_CC_CLANG) && defined(__has_declspec_attribute) -# define lzo_has_declspec_attribute __has_declspec_attribute -#endif -#endif -#if !defined(lzo_has_declspec_attribute) -# define lzo_has_declspec_attribute(x) 0 -#endif -#if !defined(lzo_has_feature) -#if (LZO_CC_CLANG) && defined(__has_feature) -# define lzo_has_feature __has_feature -#endif -#endif -#if !defined(lzo_has_feature) -# define lzo_has_feature(x) 0 -#endif -#if !defined(lzo_has_extension) -#if (LZO_CC_CLANG) && defined(__has_extension) -# define lzo_has_extension __has_extension -#elif (LZO_CC_CLANG) && defined(__has_feature) -# define lzo_has_extension __has_feature -#endif -#endif -#if !defined(lzo_has_extension) -# define lzo_has_extension 0 -#endif -#if !defined(LZO_CFG_USE_NEW_STYLE_CASTS) && defined(__cplusplus) && 0 -# if (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020800ul)) -# define LZO_CFG_USE_NEW_STYLE_CASTS 0 -# elif (LZO_CC_INTELC && (__INTEL_COMPILER < 1200)) -# define LZO_CFG_USE_NEW_STYLE_CASTS 0 -# else -# define LZO_CFG_USE_NEW_STYLE_CASTS 1 -# endif -#endif -#if !defined(LZO_CFG_USE_NEW_STYLE_CASTS) -# define LZO_CFG_USE_NEW_STYLE_CASTS 0 -#endif -#if !defined(__cplusplus) -# if defined(LZO_CFG_USE_NEW_STYLE_CASTS) -# undef LZO_CFG_USE_NEW_STYLE_CASTS -# endif -# define LZO_CFG_USE_NEW_STYLE_CASTS 0 -#endif -#if !defined(LZO_REINTERPRET_CAST) -# if (LZO_CFG_USE_NEW_STYLE_CASTS) -# define LZO_REINTERPRET_CAST(t,e) (reinterpret_cast<t> (e)) -# endif -#endif -#if !defined(LZO_REINTERPRET_CAST) -# define LZO_REINTERPRET_CAST(t,e) ((t) (e)) -#endif -#if !defined(LZO_STATIC_CAST) -# if (LZO_CFG_USE_NEW_STYLE_CASTS) -# define LZO_STATIC_CAST(t,e) (static_cast<t> (e)) -# endif -#endif -#if !defined(LZO_STATIC_CAST) -# define LZO_STATIC_CAST(t,e) ((t) (e)) -#endif -#if !defined(LZO_STATIC_CAST2) -# define LZO_STATIC_CAST2(t1,t2,e) LZO_STATIC_CAST(t1, LZO_STATIC_CAST(t2, e)) -#endif -#if !defined(LZO_UNCONST_CAST) -# if (LZO_CFG_USE_NEW_STYLE_CASTS) -# define LZO_UNCONST_CAST(t,e) (const_cast<t> (e)) -# elif (LZO_HAVE_MM_HUGE_PTR) -# define LZO_UNCONST_CAST(t,e) ((t) (e)) -# elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) -# define LZO_UNCONST_CAST(t,e) ((t) ((void *) ((lzo_uintptr_t) ((const void *) (e))))) -# endif -#endif -#if !defined(LZO_UNCONST_CAST) -# define LZO_UNCONST_CAST(t,e) ((t) ((void *) ((const void *) (e)))) -#endif -#if !defined(LZO_UNCONST_VOLATILE_CAST) -# if (LZO_CFG_USE_NEW_STYLE_CASTS) -# define LZO_UNCONST_VOLATILE_CAST(t,e) (const_cast<t> (e)) -# elif (LZO_HAVE_MM_HUGE_PTR) -# define LZO_UNCONST_VOLATILE_CAST(t,e) ((t) (e)) -# elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) -# define LZO_UNCONST_VOLATILE_CAST(t,e) ((t) ((volatile void *) ((lzo_uintptr_t) ((volatile const void *) (e))))) -# endif -#endif -#if !defined(LZO_UNCONST_VOLATILE_CAST) -# define LZO_UNCONST_VOLATILE_CAST(t,e) ((t) ((volatile void *) ((volatile const void *) (e)))) -#endif -#if !defined(LZO_UNVOLATILE_CAST) -# if (LZO_CFG_USE_NEW_STYLE_CASTS) -# define LZO_UNVOLATILE_CAST(t,e) (const_cast<t> (e)) -# elif (LZO_HAVE_MM_HUGE_PTR) -# define LZO_UNVOLATILE_CAST(t,e) ((t) (e)) -# elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) -# define LZO_UNVOLATILE_CAST(t,e) ((t) ((void *) ((lzo_uintptr_t) ((volatile void *) (e))))) -# endif -#endif -#if !defined(LZO_UNVOLATILE_CAST) -# define LZO_UNVOLATILE_CAST(t,e) ((t) ((void *) ((volatile void *) (e)))) -#endif -#if !defined(LZO_UNVOLATILE_CONST_CAST) -# if (LZO_CFG_USE_NEW_STYLE_CASTS) -# define LZO_UNVOLATILE_CONST_CAST(t,e) (const_cast<t> (e)) -# elif (LZO_HAVE_MM_HUGE_PTR) -# define LZO_UNVOLATILE_CONST_CAST(t,e) ((t) (e)) -# elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) -# define LZO_UNVOLATILE_CONST_CAST(t,e) ((t) ((const void *) ((lzo_uintptr_t) ((volatile const void *) (e))))) -# endif -#endif -#if !defined(LZO_UNVOLATILE_CONST_CAST) -# define LZO_UNVOLATILE_CONST_CAST(t,e) ((t) ((const void *) ((volatile const void *) (e)))) -#endif -#if !defined(LZO_PCAST) -# if (LZO_HAVE_MM_HUGE_PTR) -# define LZO_PCAST(t,e) ((t) (e)) -# endif -#endif -#if !defined(LZO_PCAST) -# define LZO_PCAST(t,e) LZO_STATIC_CAST(t, LZO_STATIC_CAST(void *, e)) -#endif -#if !defined(LZO_CCAST) -# if (LZO_HAVE_MM_HUGE_PTR) -# define LZO_CCAST(t,e) ((t) (e)) -# endif -#endif -#if !defined(LZO_CCAST) -# define LZO_CCAST(t,e) LZO_STATIC_CAST(t, LZO_STATIC_CAST(const void *, e)) -#endif -#if !defined(LZO_ICONV) -# define LZO_ICONV(t,e) LZO_STATIC_CAST(t, e) -#endif -#if !defined(LZO_ICAST) -# define LZO_ICAST(t,e) LZO_STATIC_CAST(t, e) -#endif -#if !defined(LZO_ITRUNC) -# define LZO_ITRUNC(t,e) LZO_STATIC_CAST(t, e) -#endif -#if !defined(__lzo_cte) -# if (LZO_CC_MSC || LZO_CC_WATCOMC) -# define __lzo_cte(e) ((void)0,(e)) -# elif 1 -# define __lzo_cte(e) ((void)0,(e)) -# endif -#endif -#if !defined(__lzo_cte) -# define __lzo_cte(e) (e) -#endif -#if !defined(LZO_BLOCK_BEGIN) -# define LZO_BLOCK_BEGIN do { -# define LZO_BLOCK_END } while __lzo_cte(0) -#endif -#if !defined(LZO_UNUSED) -# if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0600)) -# define LZO_UNUSED(var) ((void) &var) -# elif (LZO_CC_BORLANDC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PELLESC || LZO_CC_TURBOC) -# define LZO_UNUSED(var) if (&var) ; else -# elif (LZO_CC_CLANG && (LZO_CC_CLANG >= 0x030200ul)) -# define LZO_UNUSED(var) ((void) &var) -# elif (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) -# define LZO_UNUSED(var) ((void) var) -# elif (LZO_CC_MSC && (_MSC_VER < 900)) -# define LZO_UNUSED(var) if (&var) ; else -# elif (LZO_CC_KEILC) -# define LZO_UNUSED(var) {extern int lzo_unused__[1-2*!(sizeof(var)>0)]; (void)lzo_unused__;} -# elif (LZO_CC_PACIFICC) -# define LZO_UNUSED(var) ((void) sizeof(var)) -# elif (LZO_CC_WATCOMC) && defined(__cplusplus) -# define LZO_UNUSED(var) ((void) var) -# else -# define LZO_UNUSED(var) ((void) &var) -# endif -#endif -#if !defined(LZO_UNUSED_FUNC) -# if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0600)) -# define LZO_UNUSED_FUNC(func) ((void) func) -# elif (LZO_CC_BORLANDC || LZO_CC_NDPC || LZO_CC_TURBOC) -# define LZO_UNUSED_FUNC(func) if (func) ; else -# elif (LZO_CC_CLANG || LZO_CC_LLVM) -# define LZO_UNUSED_FUNC(func) ((void) &func) -# elif (LZO_CC_MSC && (_MSC_VER < 900)) -# define LZO_UNUSED_FUNC(func) if (func) ; else -# elif (LZO_CC_MSC) -# define LZO_UNUSED_FUNC(func) ((void) &func) -# elif (LZO_CC_KEILC || LZO_CC_PELLESC) -# define LZO_UNUSED_FUNC(func) {extern int lzo_unused__[1-2*!(sizeof((int)func)>0)]; (void)lzo_unused__;} -# else -# define LZO_UNUSED_FUNC(func) ((void) func) -# endif -#endif -#if !defined(LZO_UNUSED_LABEL) -# if (LZO_CC_CLANG >= 0x020800ul) -# define LZO_UNUSED_LABEL(l) (__lzo_gnuc_extension__ ((void) ((const void *) &&l))) -# elif (LZO_CC_ARMCC || LZO_CC_CLANG || LZO_CC_INTELC || LZO_CC_WATCOMC) -# define LZO_UNUSED_LABEL(l) if __lzo_cte(0) goto l -# else -# define LZO_UNUSED_LABEL(l) switch (0) case 1:goto l -# endif -#endif -#if !defined(LZO_DEFINE_UNINITIALIZED_VAR) -# if 0 -# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var -# elif 0 && (LZO_CC_GNUC) -# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var = var -# else -# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var = init -# endif -#endif -#if !defined(__lzo_inline) -#if (LZO_CC_TURBOC && (__TURBOC__ <= 0x0295)) -#elif defined(__cplusplus) -# define __lzo_inline inline -#elif defined(__STDC_VERSION__) && (__STDC_VERSION__-0 >= 199901L) -# define __lzo_inline inline -#elif (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0550)) -# define __lzo_inline __inline -#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CILLY || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI) -# define __lzo_inline __inline__ -#elif (LZO_CC_DMC) -# define __lzo_inline __inline -#elif (LZO_CC_GHS) -# define __lzo_inline __inline__ -#elif (LZO_CC_IBMC >= 600) -# define __lzo_inline __inline__ -#elif (LZO_CC_INTELC) -# define __lzo_inline __inline -#elif (LZO_CC_MWERKS && (__MWERKS__ >= 0x2405)) -# define __lzo_inline __inline -#elif (LZO_CC_MSC && (_MSC_VER >= 900)) -# define __lzo_inline __inline -#elif (LZO_CC_SUNPROC >= 0x5100) -# define __lzo_inline __inline__ -#endif -#endif -#if defined(__lzo_inline) -# ifndef __lzo_HAVE_inline -# define __lzo_HAVE_inline 1 -# endif -#else -# define __lzo_inline /*empty*/ -#endif -#if !defined(__lzo_forceinline) -#if (LZO_CC_GNUC >= 0x030200ul) -# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) -#elif (LZO_CC_IBMC >= 700) -# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) -#elif (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 450)) -# define __lzo_forceinline __forceinline -#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 800)) -# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) -#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) -# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) -#elif (LZO_CC_MSC && (_MSC_VER >= 1200)) -# define __lzo_forceinline __forceinline -#elif (LZO_CC_PGI >= 0x0d0a00ul) -# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) -#elif (LZO_CC_SUNPROC >= 0x5100) -# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) -#endif -#endif -#if defined(__lzo_forceinline) -# ifndef __lzo_HAVE_forceinline -# define __lzo_HAVE_forceinline 1 -# endif -#else -# define __lzo_forceinline __lzo_inline -#endif -#if !defined(__lzo_noinline) -#if 1 && (LZO_ARCH_I386) && (LZO_CC_GNUC >= 0x040000ul) && (LZO_CC_GNUC < 0x040003ul) -# define __lzo_noinline __attribute__((__noinline__,__used__)) -#elif (LZO_CC_GNUC >= 0x030200ul) -# define __lzo_noinline __attribute__((__noinline__)) -#elif (LZO_CC_IBMC >= 700) -# define __lzo_noinline __attribute__((__noinline__)) -#elif (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 600)) -# define __lzo_noinline __declspec(noinline) -#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 800)) -# define __lzo_noinline __attribute__((__noinline__)) -#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) -# define __lzo_noinline __attribute__((__noinline__)) -#elif (LZO_CC_MSC && (_MSC_VER >= 1300)) -# define __lzo_noinline __declspec(noinline) -#elif (LZO_CC_MWERKS && (__MWERKS__ >= 0x3200) && (LZO_OS_WIN32 || LZO_OS_WIN64)) -# if defined(__cplusplus) -# else -# define __lzo_noinline __declspec(noinline) -# endif -#elif (LZO_CC_PGI >= 0x0d0a00ul) -# define __lzo_noinline __attribute__((__noinline__)) -#elif (LZO_CC_SUNPROC >= 0x5100) -# define __lzo_noinline __attribute__((__noinline__)) -#endif -#endif -#if defined(__lzo_noinline) -# ifndef __lzo_HAVE_noinline -# define __lzo_HAVE_noinline 1 -# endif -#else -# define __lzo_noinline /*empty*/ -#endif -#if (__lzo_HAVE_forceinline || __lzo_HAVE_noinline) && !(__lzo_HAVE_inline) -# error "unexpected configuration - check your compiler defines" -#endif -#if !defined(__lzo_static_inline) -#if (LZO_CC_IBMC) -# define __lzo_static_inline __lzo_gnuc_extension__ static __lzo_inline -#endif -#endif -#if !defined(__lzo_static_inline) -# define __lzo_static_inline static __lzo_inline -#endif -#if !defined(__lzo_static_forceinline) -#if (LZO_CC_IBMC) -# define __lzo_static_forceinline __lzo_gnuc_extension__ static __lzo_forceinline -#endif -#endif -#if !defined(__lzo_static_forceinline) -# define __lzo_static_forceinline static __lzo_forceinline -#endif -#if !defined(__lzo_static_noinline) -#if (LZO_CC_IBMC) -# define __lzo_static_noinline __lzo_gnuc_extension__ static __lzo_noinline -#endif -#endif -#if !defined(__lzo_static_noinline) -# define __lzo_static_noinline static __lzo_noinline -#endif -#if !defined(__lzo_c99_extern_inline) -#if defined(__GNUC_GNU_INLINE__) -# define __lzo_c99_extern_inline __lzo_inline -#elif defined(__GNUC_STDC_INLINE__) -# define __lzo_c99_extern_inline extern __lzo_inline -#elif defined(__STDC_VERSION__) && (__STDC_VERSION__-0 >= 199901L) -# define __lzo_c99_extern_inline extern __lzo_inline -#endif -#if !defined(__lzo_c99_extern_inline) && (__lzo_HAVE_inline) -# define __lzo_c99_extern_inline __lzo_inline -#endif -#endif -#if defined(__lzo_c99_extern_inline) -# ifndef __lzo_HAVE_c99_extern_inline -# define __lzo_HAVE_c99_extern_inline 1 -# endif -#else -# define __lzo_c99_extern_inline /*empty*/ -#endif -#if !defined(__lzo_may_alias) -#if (LZO_CC_GNUC >= 0x030400ul) -# define __lzo_may_alias __attribute__((__may_alias__)) -#elif (LZO_CC_CLANG >= 0x020900ul) -# define __lzo_may_alias __attribute__((__may_alias__)) -#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 1210)) && 0 -# define __lzo_may_alias __attribute__((__may_alias__)) -#elif (LZO_CC_PGI >= 0x0d0a00ul) && 0 -# define __lzo_may_alias __attribute__((__may_alias__)) -#endif -#endif -#if defined(__lzo_may_alias) -# ifndef __lzo_HAVE_may_alias -# define __lzo_HAVE_may_alias 1 -# endif -#else -# define __lzo_may_alias /*empty*/ -#endif -#if !defined(__lzo_noreturn) -#if (LZO_CC_GNUC >= 0x020700ul) -# define __lzo_noreturn __attribute__((__noreturn__)) -#elif (LZO_CC_IBMC >= 700) -# define __lzo_noreturn __attribute__((__noreturn__)) -#elif (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 450)) -# define __lzo_noreturn __declspec(noreturn) -#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 600)) -# define __lzo_noreturn __attribute__((__noreturn__)) -#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) -# define __lzo_noreturn __attribute__((__noreturn__)) -#elif (LZO_CC_MSC && (_MSC_VER >= 1200)) -# define __lzo_noreturn __declspec(noreturn) -#elif (LZO_CC_PGI >= 0x0d0a00ul) -# define __lzo_noreturn __attribute__((__noreturn__)) -#endif -#endif -#if defined(__lzo_noreturn) -# ifndef __lzo_HAVE_noreturn -# define __lzo_HAVE_noreturn 1 -# endif -#else -# define __lzo_noreturn /*empty*/ -#endif -#if !defined(__lzo_nothrow) -#if (LZO_CC_GNUC >= 0x030300ul) -# define __lzo_nothrow __attribute__((__nothrow__)) -#elif (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 450)) && defined(__cplusplus) -# define __lzo_nothrow __declspec(nothrow) -#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 900)) -# define __lzo_nothrow __attribute__((__nothrow__)) -#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) -# define __lzo_nothrow __attribute__((__nothrow__)) -#elif (LZO_CC_MSC && (_MSC_VER >= 1200)) && defined(__cplusplus) -# define __lzo_nothrow __declspec(nothrow) -#endif -#endif -#if defined(__lzo_nothrow) -# ifndef __lzo_HAVE_nothrow -# define __lzo_HAVE_nothrow 1 -# endif -#else -# define __lzo_nothrow /*empty*/ -#endif -#if !defined(__lzo_restrict) -#if (LZO_CC_GNUC >= 0x030400ul) -# define __lzo_restrict __restrict__ -#elif (LZO_CC_IBMC >= 800) && !defined(__cplusplus) -# define __lzo_restrict __restrict__ -#elif (LZO_CC_IBMC >= 1210) -# define __lzo_restrict __restrict__ -#elif (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 600)) -#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 600)) -# define __lzo_restrict __restrict__ -#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM) -# define __lzo_restrict __restrict__ -#elif (LZO_CC_MSC && (_MSC_VER >= 1400)) -# define __lzo_restrict __restrict -#elif (LZO_CC_PGI >= 0x0d0a00ul) -# define __lzo_restrict __restrict__ -#endif -#endif -#if defined(__lzo_restrict) -# ifndef __lzo_HAVE_restrict -# define __lzo_HAVE_restrict 1 -# endif -#else -# define __lzo_restrict /*empty*/ -#endif -#if !defined(__lzo_alignof) -#if (LZO_CC_ARMCC || LZO_CC_CILLY || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI) -# define __lzo_alignof(e) __alignof__(e) -#elif (LZO_CC_GHS) && !defined(__cplusplus) -# define __lzo_alignof(e) __alignof__(e) -#elif (LZO_CC_IBMC >= 600) -# define __lzo_alignof(e) (__lzo_gnuc_extension__ __alignof__(e)) -#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 700)) -# define __lzo_alignof(e) __alignof__(e) -#elif (LZO_CC_MSC && (_MSC_VER >= 1300)) -# define __lzo_alignof(e) __alignof(e) -#elif (LZO_CC_SUNPROC >= 0x5100) -# define __lzo_alignof(e) __alignof__(e) -#endif -#endif -#if defined(__lzo_alignof) -# ifndef __lzo_HAVE_alignof -# define __lzo_HAVE_alignof 1 -# endif -#endif -#if !defined(__lzo_struct_packed) -#if (LZO_CC_CLANG && (LZO_CC_CLANG < 0x020800ul)) && defined(__cplusplus) -#elif (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020700ul)) -#elif (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020800ul)) && defined(__cplusplus) -#elif (LZO_CC_PCC && (LZO_CC_PCC < 0x010100ul)) -#elif (LZO_CC_SUNPROC && (LZO_CC_SUNPROC < 0x5110)) && !defined(__cplusplus) -#elif (LZO_CC_GNUC >= 0x030400ul) && !(LZO_CC_PCC_GNUC) && (LZO_ARCH_AMD64 || LZO_ARCH_I386) -# define __lzo_struct_packed(s) struct s { -# define __lzo_struct_packed_end() } __attribute__((__gcc_struct__,__packed__)); -# define __lzo_struct_packed_ma_end() } __lzo_may_alias __attribute__((__gcc_struct__,__packed__)); -#elif (LZO_CC_ARMCC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_INTELC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || (LZO_CC_PGI >= 0x0d0a00ul) || (LZO_CC_SUNPROC >= 0x5100)) -# define __lzo_struct_packed(s) struct s { -# define __lzo_struct_packed_end() } __attribute__((__packed__)); -# define __lzo_struct_packed_ma_end() } __lzo_may_alias __attribute__((__packed__)); -#elif (LZO_CC_IBMC >= 700) -# define __lzo_struct_packed(s) __lzo_gnuc_extension__ struct s { -# define __lzo_struct_packed_end() } __attribute__((__packed__)); -# define __lzo_struct_packed_ma_end() } __lzo_may_alias __attribute__((__packed__)); -#elif (LZO_CC_INTELC_MSC) || (LZO_CC_MSC && (_MSC_VER >= 1300)) -# define __lzo_struct_packed(s) __pragma(pack(push,1)) struct s { -# define __lzo_struct_packed_end() } __pragma(pack(pop)); -#elif (LZO_CC_WATCOMC && (__WATCOMC__ >= 900)) -# define __lzo_struct_packed(s) _Packed struct s { -# define __lzo_struct_packed_end() }; -#endif -#endif -#if defined(__lzo_struct_packed) && !defined(__lzo_struct_packed_ma) -# define __lzo_struct_packed_ma(s) __lzo_struct_packed(s) -#endif -#if defined(__lzo_struct_packed_end) && !defined(__lzo_struct_packed_ma_end) -# define __lzo_struct_packed_ma_end() __lzo_struct_packed_end() -#endif -#if !defined(__lzo_byte_struct) -#if defined(__lzo_struct_packed) -# define __lzo_byte_struct(s,n) __lzo_struct_packed(s) unsigned char a[n]; __lzo_struct_packed_end() -# define __lzo_byte_struct_ma(s,n) __lzo_struct_packed_ma(s) unsigned char a[n]; __lzo_struct_packed_ma_end() -#elif (LZO_CC_CILLY || LZO_CC_CLANG || LZO_CC_PGI || (LZO_CC_SUNPROC >= 0x5100)) -# define __lzo_byte_struct(s,n) struct s { unsigned char a[n]; } __attribute__((__packed__)); -# define __lzo_byte_struct_ma(s,n) struct s { unsigned char a[n]; } __lzo_may_alias __attribute__((__packed__)); -#endif -#endif -#if defined(__lzo_byte_struct) && !defined(__lzo_byte_struct_ma) -# define __lzo_byte_struct_ma(s,n) __lzo_byte_struct(s,n) -#endif -#if !defined(__lzo_struct_align16) && (__lzo_HAVE_alignof) -#if (LZO_CC_GNUC && (LZO_CC_GNUC < 0x030000ul)) -#elif (LZO_CC_CLANG && (LZO_CC_CLANG < 0x020800ul)) && defined(__cplusplus) -#elif (LZO_CC_CILLY || LZO_CC_PCC) -#elif (LZO_CC_INTELC_MSC) || (LZO_CC_MSC && (_MSC_VER >= 1300)) -# define __lzo_struct_align16(s) struct __declspec(align(16)) s { -# define __lzo_struct_align16_end() }; -# define __lzo_struct_align32(s) struct __declspec(align(32)) s { -# define __lzo_struct_align32_end() }; -# define __lzo_struct_align64(s) struct __declspec(align(64)) s { -# define __lzo_struct_align64_end() }; -#elif (LZO_CC_ARMCC || LZO_CC_CLANG || LZO_CC_GNUC || (LZO_CC_IBMC >= 700) || LZO_CC_INTELC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) -# define __lzo_struct_align16(s) struct s { -# define __lzo_struct_align16_end() } __attribute__((__aligned__(16))); -# define __lzo_struct_align32(s) struct s { -# define __lzo_struct_align32_end() } __attribute__((__aligned__(32))); -# define __lzo_struct_align64(s) struct s { -# define __lzo_struct_align64_end() } __attribute__((__aligned__(64))); -#endif -#endif -#if !defined(__lzo_union_um) -#if (LZO_CC_CLANG && (LZO_CC_CLANG < 0x020800ul)) && defined(__cplusplus) -#elif (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020700ul)) -#elif (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020800ul)) && defined(__cplusplus) -#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER < 810)) -#elif (LZO_CC_PCC && (LZO_CC_PCC < 0x010100ul)) -#elif (LZO_CC_SUNPROC && (LZO_CC_SUNPROC < 0x5110)) && !defined(__cplusplus) -#elif (LZO_CC_ARMCC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_INTELC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || (LZO_CC_PGI >= 0x0d0a00ul) || (LZO_CC_SUNPROC >= 0x5100)) -# define __lzo_union_am(s) union s { -# define __lzo_union_am_end() } __lzo_may_alias; -# define __lzo_union_um(s) union s { -# define __lzo_union_um_end() } __lzo_may_alias __attribute__((__packed__)); -#elif (LZO_CC_IBMC >= 700) -# define __lzo_union_am(s) __lzo_gnuc_extension__ union s { -# define __lzo_union_am_end() } __lzo_may_alias; -# define __lzo_union_um(s) __lzo_gnuc_extension__ union s { -# define __lzo_union_um_end() } __lzo_may_alias __attribute__((__packed__)); -#elif (LZO_CC_INTELC_MSC) || (LZO_CC_MSC && (_MSC_VER >= 1300)) -# define __lzo_union_um(s) __pragma(pack(push,1)) union s { -# define __lzo_union_um_end() } __pragma(pack(pop)); -#elif (LZO_CC_WATCOMC && (__WATCOMC__ >= 900)) -# define __lzo_union_um(s) _Packed union s { -# define __lzo_union_um_end() }; -#endif -#endif -#if !defined(__lzo_union_am) -# define __lzo_union_am(s) union s { -# define __lzo_union_am_end() }; -#endif -#if !defined(__lzo_constructor) -#if (LZO_CC_GNUC >= 0x030400ul) -# define __lzo_constructor __attribute__((__constructor__,__used__)) -#elif (LZO_CC_GNUC >= 0x020700ul) -# define __lzo_constructor __attribute__((__constructor__)) -#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 800)) -# define __lzo_constructor __attribute__((__constructor__,__used__)) -#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) -# define __lzo_constructor __attribute__((__constructor__)) -#endif -#endif -#if defined(__lzo_constructor) -# ifndef __lzo_HAVE_constructor -# define __lzo_HAVE_constructor 1 -# endif -#endif -#if !defined(__lzo_destructor) -#if (LZO_CC_GNUC >= 0x030400ul) -# define __lzo_destructor __attribute__((__destructor__,__used__)) -#elif (LZO_CC_GNUC >= 0x020700ul) -# define __lzo_destructor __attribute__((__destructor__)) -#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 800)) -# define __lzo_destructor __attribute__((__destructor__,__used__)) -#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) -# define __lzo_destructor __attribute__((__destructor__)) -#endif -#endif -#if defined(__lzo_destructor) -# ifndef __lzo_HAVE_destructor -# define __lzo_HAVE_destructor 1 -# endif -#endif -#if (__lzo_HAVE_destructor) && !(__lzo_HAVE_constructor) -# error "unexpected configuration - check your compiler defines" -#endif -#if !defined(__lzo_likely) && !defined(__lzo_unlikely) -#if (LZO_CC_GNUC >= 0x030200ul) -# define __lzo_likely(e) (__builtin_expect(!!(e),1)) -# define __lzo_unlikely(e) (__builtin_expect(!!(e),0)) -#elif (LZO_CC_IBMC >= 1010) -# define __lzo_likely(e) (__builtin_expect(!!(e),1)) -# define __lzo_unlikely(e) (__builtin_expect(!!(e),0)) -#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 800)) -# define __lzo_likely(e) (__builtin_expect(!!(e),1)) -# define __lzo_unlikely(e) (__builtin_expect(!!(e),0)) -#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) -# define __lzo_likely(e) (__builtin_expect(!!(e),1)) -# define __lzo_unlikely(e) (__builtin_expect(!!(e),0)) -#endif -#endif -#if defined(__lzo_likely) -# ifndef __lzo_HAVE_likely -# define __lzo_HAVE_likely 1 -# endif -#else -# define __lzo_likely(e) (e) -#endif -#if defined(__lzo_very_likely) -# ifndef __lzo_HAVE_very_likely -# define __lzo_HAVE_very_likely 1 -# endif -#else -# define __lzo_very_likely(e) __lzo_likely(e) -#endif -#if defined(__lzo_unlikely) -# ifndef __lzo_HAVE_unlikely -# define __lzo_HAVE_unlikely 1 -# endif -#else -# define __lzo_unlikely(e) (e) -#endif -#if defined(__lzo_very_unlikely) -# ifndef __lzo_HAVE_very_unlikely -# define __lzo_HAVE_very_unlikely 1 -# endif -#else -# define __lzo_very_unlikely(e) __lzo_unlikely(e) -#endif -#if !defined(__lzo_loop_forever) -# if (LZO_CC_IBMC) -# define __lzo_loop_forever() LZO_BLOCK_BEGIN for (;;) { ; } LZO_BLOCK_END -# else -# define __lzo_loop_forever() do { ; } while __lzo_cte(1) -# endif -#endif -#if !defined(__lzo_unreachable) -#if (LZO_CC_CLANG && (LZO_CC_CLANG >= 0x020800ul)) && lzo_has_builtin(__builtin_unreachable) -# define __lzo_unreachable() __builtin_unreachable(); -#elif (LZO_CC_GNUC >= 0x040500ul) -# define __lzo_unreachable() __builtin_unreachable(); -#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 1300)) && 1 -# define __lzo_unreachable() __builtin_unreachable(); -#endif -#endif -#if defined(__lzo_unreachable) -# ifndef __lzo_HAVE_unreachable -# define __lzo_HAVE_unreachable 1 -# endif -#else -# if 0 -# define __lzo_unreachable() ((void)0); -# else -# define __lzo_unreachable() __lzo_loop_forever(); -# endif -#endif -#if !defined(lzo_unused_funcs_impl) -# if 1 && (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || (LZO_CC_GNUC >= 0x020700ul) || LZO_CC_INTELC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI) -# define lzo_unused_funcs_impl(r,f) static r __attribute__((__unused__)) f -# elif 1 && (LZO_CC_BORLANDC || LZO_CC_GNUC) -# define lzo_unused_funcs_impl(r,f) static r f -# else -# define lzo_unused_funcs_impl(r,f) __lzo_static_forceinline r f -# endif -#endif -#ifndef __LZO_CTA_NAME -#if (LZO_CFG_USE_COUNTER) -# define __LZO_CTA_NAME(a) LZO_PP_ECONCAT2(a,__COUNTER__) -#else -# define __LZO_CTA_NAME(a) LZO_PP_ECONCAT2(a,__LINE__) -#endif -#endif -#if !defined(LZO_COMPILE_TIME_ASSERT_HEADER) -# if (LZO_CC_AZTECC || LZO_CC_ZORTECHC) -# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN extern int __LZO_CTA_NAME(lzo_cta__)[1-!(e)]; LZO_EXTERN_C_END -# elif (LZO_CC_DMC || LZO_CC_SYMANTECC) -# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN extern int __LZO_CTA_NAME(lzo_cta__)[1u-2*!(e)]; LZO_EXTERN_C_END -# elif (LZO_CC_TURBOC && (__TURBOC__ == 0x0295)) -# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN extern int __LZO_CTA_NAME(lzo_cta__)[1-!(e)]; LZO_EXTERN_C_END -# elif (LZO_CC_CLANG && (LZO_CC_CLANG < 0x020900ul)) && defined(__cplusplus) -# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN int __LZO_CTA_NAME(lzo_cta_f__)(int [1-2*!(e)]); LZO_EXTERN_C_END -# elif (LZO_CC_GNUC) && defined(__CHECKER__) && defined(__SPARSE_CHECKER__) -# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN enum {__LZO_CTA_NAME(lzo_cta_e__)=1/!!(e)} __attribute__((__unused__)); LZO_EXTERN_C_END -# else -# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN extern int __LZO_CTA_NAME(lzo_cta__)[1-2*!(e)]; LZO_EXTERN_C_END -# endif -#endif -#if !defined(LZO_COMPILE_TIME_ASSERT) -# if (LZO_CC_AZTECC) -# define LZO_COMPILE_TIME_ASSERT(e) {typedef int __LZO_CTA_NAME(lzo_cta_t__)[1-!(e)];} -# elif (LZO_CC_CLANG && (LZO_CC_CLANG >= 0x030000ul)) -# define LZO_COMPILE_TIME_ASSERT(e) {typedef int __LZO_CTA_NAME(lzo_cta_t__)[1-2*!(e)] __attribute__((__unused__));} -# elif (LZO_CC_DMC || LZO_CC_PACIFICC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC) -# define LZO_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break; -# elif (LZO_CC_GNUC) && defined(__CHECKER__) && defined(__SPARSE_CHECKER__) -# define LZO_COMPILE_TIME_ASSERT(e) {(void) (0/!!(e));} -# elif (LZO_CC_GNUC >= 0x040700ul) && (LZO_CFG_USE_COUNTER) && defined(__cplusplus) -# define LZO_COMPILE_TIME_ASSERT(e) {enum {__LZO_CTA_NAME(lzo_cta_e__)=1/!!(e)} __attribute__((__unused__));} -# elif (LZO_CC_GNUC >= 0x040700ul) -# define LZO_COMPILE_TIME_ASSERT(e) {typedef int __LZO_CTA_NAME(lzo_cta_t__)[1-2*!(e)] __attribute__((__unused__));} -# elif (LZO_CC_MSC && (_MSC_VER < 900)) -# define LZO_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break; -# elif (LZO_CC_TURBOC && (__TURBOC__ == 0x0295)) -# define LZO_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break; -# else -# define LZO_COMPILE_TIME_ASSERT(e) {typedef int __LZO_CTA_NAME(lzo_cta_t__)[1-2*!(e)];} -# endif -#endif -LZO_COMPILE_TIME_ASSERT_HEADER(1 == 1) -#if defined(__cplusplus) -extern "C" { LZO_COMPILE_TIME_ASSERT_HEADER(2 == 2) } -#endif -LZO_COMPILE_TIME_ASSERT_HEADER(3 == 3) -#if (LZO_ARCH_I086 || LZO_ARCH_I386) && (LZO_OS_DOS16 || LZO_OS_DOS32 || LZO_OS_OS2 || LZO_OS_OS216 || LZO_OS_WIN16 || LZO_OS_WIN32 || LZO_OS_WIN64) -# if (LZO_CC_GNUC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PACIFICC) -# elif (LZO_CC_DMC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC) -# define __lzo_cdecl __cdecl -# define __lzo_cdecl_atexit /*empty*/ -# define __lzo_cdecl_main __cdecl -# if (LZO_OS_OS2 && (LZO_CC_DMC || LZO_CC_SYMANTECC)) -# define __lzo_cdecl_qsort __pascal -# elif (LZO_OS_OS2 && (LZO_CC_ZORTECHC)) -# define __lzo_cdecl_qsort _stdcall -# else -# define __lzo_cdecl_qsort __cdecl -# endif -# elif (LZO_CC_WATCOMC) -# define __lzo_cdecl __cdecl -# else -# define __lzo_cdecl __cdecl -# define __lzo_cdecl_atexit __cdecl -# define __lzo_cdecl_main __cdecl -# define __lzo_cdecl_qsort __cdecl -# endif -# if (LZO_CC_GNUC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PACIFICC || LZO_CC_WATCOMC) -# elif (LZO_OS_OS2 && (LZO_CC_DMC || LZO_CC_SYMANTECC)) -# define __lzo_cdecl_sighandler __pascal -# elif (LZO_OS_OS2 && (LZO_CC_ZORTECHC)) -# define __lzo_cdecl_sighandler _stdcall -# elif (LZO_CC_MSC && (_MSC_VER >= 1400)) && defined(_M_CEE_PURE) -# define __lzo_cdecl_sighandler __clrcall -# elif (LZO_CC_MSC && (_MSC_VER >= 600 && _MSC_VER < 700)) -# if defined(_DLL) -# define __lzo_cdecl_sighandler _far _cdecl _loadds -# elif defined(_MT) -# define __lzo_cdecl_sighandler _far _cdecl -# else -# define __lzo_cdecl_sighandler _cdecl -# endif -# else -# define __lzo_cdecl_sighandler __cdecl -# endif -#elif (LZO_ARCH_I386) && (LZO_CC_WATCOMC) -# define __lzo_cdecl __cdecl -#elif (LZO_ARCH_M68K && LZO_OS_TOS && (LZO_CC_PUREC || LZO_CC_TURBOC)) -# define __lzo_cdecl cdecl -#endif -#if !defined(__lzo_cdecl) -# define __lzo_cdecl /*empty*/ -#endif -#if !defined(__lzo_cdecl_atexit) -# define __lzo_cdecl_atexit /*empty*/ -#endif -#if !defined(__lzo_cdecl_main) -# define __lzo_cdecl_main /*empty*/ -#endif -#if !defined(__lzo_cdecl_qsort) -# define __lzo_cdecl_qsort /*empty*/ -#endif -#if !defined(__lzo_cdecl_sighandler) -# define __lzo_cdecl_sighandler /*empty*/ -#endif -#if !defined(__lzo_cdecl_va) -# define __lzo_cdecl_va __lzo_cdecl -#endif -#if !(LZO_CFG_NO_WINDOWS_H) -#if !defined(LZO_HAVE_WINDOWS_H) -#if (LZO_OS_CYGWIN || (LZO_OS_EMX && defined(__RSXNT__)) || LZO_OS_WIN32 || LZO_OS_WIN64) -# if (LZO_CC_WATCOMC && (__WATCOMC__ < 1000)) -# elif ((LZO_OS_WIN32 && defined(__PW32__)) && (LZO_CC_GNUC && (LZO_CC_GNUC < 0x030000ul))) -# elif ((LZO_OS_CYGWIN || defined(__MINGW32__)) && (LZO_CC_GNUC && (LZO_CC_GNUC < 0x025f00ul))) -# else -# define LZO_HAVE_WINDOWS_H 1 -# endif -#endif -#endif -#endif -#ifndef LZO_SIZEOF_SHORT -#if defined(SIZEOF_SHORT) -# define LZO_SIZEOF_SHORT (SIZEOF_SHORT) -#elif defined(__SIZEOF_SHORT__) -# define LZO_SIZEOF_SHORT (__SIZEOF_SHORT__) -#endif -#endif -#ifndef LZO_SIZEOF_INT -#if defined(SIZEOF_INT) -# define LZO_SIZEOF_INT (SIZEOF_INT) -#elif defined(__SIZEOF_INT__) -# define LZO_SIZEOF_INT (__SIZEOF_INT__) -#endif -#endif -#ifndef LZO_SIZEOF_LONG -#if defined(SIZEOF_LONG) -# define LZO_SIZEOF_LONG (SIZEOF_LONG) -#elif defined(__SIZEOF_LONG__) -# define LZO_SIZEOF_LONG (__SIZEOF_LONG__) -#endif -#endif -#ifndef LZO_SIZEOF_LONG_LONG -#if defined(SIZEOF_LONG_LONG) -# define LZO_SIZEOF_LONG_LONG (SIZEOF_LONG_LONG) -#elif defined(__SIZEOF_LONG_LONG__) -# define LZO_SIZEOF_LONG_LONG (__SIZEOF_LONG_LONG__) -#endif -#endif -#ifndef LZO_SIZEOF___INT16 -#if defined(SIZEOF___INT16) -# define LZO_SIZEOF___INT16 (SIZEOF___INT16) -#endif -#endif -#ifndef LZO_SIZEOF___INT32 -#if defined(SIZEOF___INT32) -# define LZO_SIZEOF___INT32 (SIZEOF___INT32) -#endif -#endif -#ifndef LZO_SIZEOF___INT64 -#if defined(SIZEOF___INT64) -# define LZO_SIZEOF___INT64 (SIZEOF___INT64) -#endif -#endif -#ifndef LZO_SIZEOF_VOID_P -#if defined(SIZEOF_VOID_P) -# define LZO_SIZEOF_VOID_P (SIZEOF_VOID_P) -#elif defined(__SIZEOF_POINTER__) -# define LZO_SIZEOF_VOID_P (__SIZEOF_POINTER__) -#endif -#endif -#ifndef LZO_SIZEOF_SIZE_T -#if defined(SIZEOF_SIZE_T) -# define LZO_SIZEOF_SIZE_T (SIZEOF_SIZE_T) -#elif defined(__SIZEOF_SIZE_T__) -# define LZO_SIZEOF_SIZE_T (__SIZEOF_SIZE_T__) -#endif -#endif -#ifndef LZO_SIZEOF_PTRDIFF_T -#if defined(SIZEOF_PTRDIFF_T) -# define LZO_SIZEOF_PTRDIFF_T (SIZEOF_PTRDIFF_T) -#elif defined(__SIZEOF_PTRDIFF_T__) -# define LZO_SIZEOF_PTRDIFF_T (__SIZEOF_PTRDIFF_T__) -#endif -#endif -#define __LZO_LSR(x,b) (((x)+0ul) >> (b)) -#if !defined(LZO_SIZEOF_SHORT) -# if (LZO_ARCH_CRAY_PVP) -# define LZO_SIZEOF_SHORT 8 -# elif (USHRT_MAX == LZO_0xffffL) -# define LZO_SIZEOF_SHORT 2 -# elif (__LZO_LSR(USHRT_MAX,7) == 1) -# define LZO_SIZEOF_SHORT 1 -# elif (__LZO_LSR(USHRT_MAX,15) == 1) -# define LZO_SIZEOF_SHORT 2 -# elif (__LZO_LSR(USHRT_MAX,31) == 1) -# define LZO_SIZEOF_SHORT 4 -# elif (__LZO_LSR(USHRT_MAX,63) == 1) -# define LZO_SIZEOF_SHORT 8 -# elif (__LZO_LSR(USHRT_MAX,127) == 1) -# define LZO_SIZEOF_SHORT 16 -# else -# error "LZO_SIZEOF_SHORT" -# endif -#endif -LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_SHORT == sizeof(short)) -#if !defined(LZO_SIZEOF_INT) -# if (LZO_ARCH_CRAY_PVP) -# define LZO_SIZEOF_INT 8 -# elif (UINT_MAX == LZO_0xffffL) -# define LZO_SIZEOF_INT 2 -# elif (UINT_MAX == LZO_0xffffffffL) -# define LZO_SIZEOF_INT 4 -# elif (__LZO_LSR(UINT_MAX,7) == 1) -# define LZO_SIZEOF_INT 1 -# elif (__LZO_LSR(UINT_MAX,15) == 1) -# define LZO_SIZEOF_INT 2 -# elif (__LZO_LSR(UINT_MAX,31) == 1) -# define LZO_SIZEOF_INT 4 -# elif (__LZO_LSR(UINT_MAX,63) == 1) -# define LZO_SIZEOF_INT 8 -# elif (__LZO_LSR(UINT_MAX,127) == 1) -# define LZO_SIZEOF_INT 16 -# else -# error "LZO_SIZEOF_INT" -# endif -#endif -LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_INT == sizeof(int)) -#if !defined(LZO_SIZEOF_LONG) -# if (ULONG_MAX == LZO_0xffffffffL) -# define LZO_SIZEOF_LONG 4 -# elif (__LZO_LSR(ULONG_MAX,7) == 1) -# define LZO_SIZEOF_LONG 1 -# elif (__LZO_LSR(ULONG_MAX,15) == 1) -# define LZO_SIZEOF_LONG 2 -# elif (__LZO_LSR(ULONG_MAX,31) == 1) -# define LZO_SIZEOF_LONG 4 -# elif (__LZO_LSR(ULONG_MAX,39) == 1) -# define LZO_SIZEOF_LONG 5 -# elif (__LZO_LSR(ULONG_MAX,63) == 1) -# define LZO_SIZEOF_LONG 8 -# elif (__LZO_LSR(ULONG_MAX,127) == 1) -# define LZO_SIZEOF_LONG 16 -# else -# error "LZO_SIZEOF_LONG" -# endif -#endif -LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_LONG == sizeof(long)) -#if !defined(LZO_SIZEOF_LONG_LONG) && !defined(LZO_SIZEOF___INT64) -#if (LZO_SIZEOF_LONG > 0 && LZO_SIZEOF_LONG < 8) -# if defined(__LONG_MAX__) && defined(__LONG_LONG_MAX__) -# if (LZO_CC_GNUC >= 0x030300ul) -# if ((__LONG_MAX__-0) == (__LONG_LONG_MAX__-0)) -# define LZO_SIZEOF_LONG_LONG LZO_SIZEOF_LONG -# elif (__LZO_LSR(__LONG_LONG_MAX__,30) == 1) -# define LZO_SIZEOF_LONG_LONG 4 -# endif -# endif -# endif -#endif -#endif -#if !defined(LZO_SIZEOF_LONG_LONG) && !defined(LZO_SIZEOF___INT64) -#if (LZO_SIZEOF_LONG > 0 && LZO_SIZEOF_LONG < 8) -#if (LZO_ARCH_I086 && LZO_CC_DMC) -#elif (LZO_CC_CILLY) && defined(__GNUC__) -# define LZO_SIZEOF_LONG_LONG 8 -#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) -# define LZO_SIZEOF_LONG_LONG 8 -#elif ((LZO_OS_WIN32 || LZO_OS_WIN64 || defined(_WIN32)) && LZO_CC_MSC && (_MSC_VER >= 1400)) -# define LZO_SIZEOF_LONG_LONG 8 -#elif (LZO_OS_WIN64 || defined(_WIN64)) -# define LZO_SIZEOF___INT64 8 -#elif (LZO_ARCH_I386 && (LZO_CC_DMC)) -# define LZO_SIZEOF_LONG_LONG 8 -#elif (LZO_ARCH_I386 && (LZO_CC_SYMANTECC && (__SC__ >= 0x700))) -# define LZO_SIZEOF_LONG_LONG 8 -#elif (LZO_ARCH_I386 && (LZO_CC_INTELC && defined(__linux__))) -# define LZO_SIZEOF_LONG_LONG 8 -#elif (LZO_ARCH_I386 && (LZO_CC_MWERKS || LZO_CC_PELLESC || LZO_CC_PGI || LZO_CC_SUNPROC)) -# define LZO_SIZEOF_LONG_LONG 8 -#elif (LZO_ARCH_I386 && (LZO_CC_INTELC || LZO_CC_MSC)) -# define LZO_SIZEOF___INT64 8 -#elif ((LZO_OS_WIN32 || defined(_WIN32)) && (LZO_CC_MSC)) -# define LZO_SIZEOF___INT64 8 -#elif (LZO_ARCH_I386 && (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0520))) -# define LZO_SIZEOF___INT64 8 -#elif (LZO_ARCH_I386 && (LZO_CC_WATCOMC && (__WATCOMC__ >= 1100))) -# define LZO_SIZEOF___INT64 8 -#elif (LZO_CC_GHS && defined(__LLONG_BIT) && ((__LLONG_BIT-0) == 64)) -# define LZO_SIZEOF_LONG_LONG 8 -#elif (LZO_CC_WATCOMC && defined(_INTEGRAL_MAX_BITS) && ((_INTEGRAL_MAX_BITS-0) == 64)) -# define LZO_SIZEOF___INT64 8 -#elif (LZO_OS_OS400 || defined(__OS400__)) && defined(__LLP64_IFC__) -# define LZO_SIZEOF_LONG_LONG 8 -#elif (defined(__vms) || defined(__VMS)) && ((__INITIAL_POINTER_SIZE-0) == 64) -# define LZO_SIZEOF_LONG_LONG 8 -#elif (LZO_CC_SDCC) && (LZO_SIZEOF_INT == 2) -#elif 1 && defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) -# define LZO_SIZEOF_LONG_LONG 8 -#endif -#endif -#endif -#if defined(__cplusplus) && (LZO_CC_GNUC) -# if (LZO_CC_GNUC < 0x020800ul) -# undef LZO_SIZEOF_LONG_LONG -# endif -#endif -#if (LZO_CFG_NO_LONG_LONG) -# undef LZO_SIZEOF_LONG_LONG -#elif defined(__NO_LONG_LONG) -# undef LZO_SIZEOF_LONG_LONG -#elif defined(_NO_LONGLONG) -# undef LZO_SIZEOF_LONG_LONG -#endif -#if !defined(LZO_WORDSIZE) -#if (LZO_ARCH_ALPHA) -# define LZO_WORDSIZE 8 -#elif (LZO_ARCH_AMD64) -# define LZO_WORDSIZE 8 -#elif (LZO_ARCH_AVR) -# define LZO_WORDSIZE 1 -#elif (LZO_ARCH_H8300) -# if defined(__NORMAL_MODE__) -# define LZO_WORDSIZE 4 -# elif defined(__H8300H__) || defined(__H8300S__) || defined(__H8300SX__) -# define LZO_WORDSIZE 4 -# else -# define LZO_WORDSIZE 2 -# endif -#elif (LZO_ARCH_I086) -# define LZO_WORDSIZE 2 -#elif (LZO_ARCH_IA64) -# define LZO_WORDSIZE 8 -#elif (LZO_ARCH_M16C) -# define LZO_WORDSIZE 2 -#elif (LZO_ARCH_SPU) -# define LZO_WORDSIZE 4 -#elif (LZO_ARCH_Z80) -# define LZO_WORDSIZE 1 -#elif (LZO_SIZEOF_LONG == 8) && ((defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__)) -# define LZO_WORDSIZE 8 -#elif (LZO_OS_OS400 || defined(__OS400__)) -# define LZO_WORDSIZE 8 -#elif (defined(__vms) || defined(__VMS)) && (__INITIAL_POINTER_SIZE+0 == 64) -# define LZO_WORDSIZE 8 -#endif -#endif -#if !defined(LZO_SIZEOF_VOID_P) -#if defined(__ILP32__) || defined(__ILP32) || defined(_ILP32) -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(int) == 4) -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(long) == 4) -# define LZO_SIZEOF_VOID_P 4 -#elif defined(__ILP64__) || defined(__ILP64) || defined(_ILP64) -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(int) == 8) -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(long) == 8) -# define LZO_SIZEOF_VOID_P 8 -#elif defined(__LLP64__) || defined(__LLP64) || defined(_LLP64) || defined(_WIN64) -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(long) == 4) -# define LZO_SIZEOF_VOID_P 8 -#elif defined(__LP64__) || defined(__LP64) || defined(_LP64) -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(long) == 8) -# define LZO_SIZEOF_VOID_P 8 -#elif (LZO_ARCH_AVR) -# define LZO_SIZEOF_VOID_P 2 -#elif (LZO_ARCH_C166 || LZO_ARCH_MCS51 || LZO_ARCH_MCS251 || LZO_ARCH_MSP430) -# define LZO_SIZEOF_VOID_P 2 -#elif (LZO_ARCH_H8300) -# if defined(__NORMAL_MODE__) -# define LZO_SIZEOF_VOID_P 2 -# elif defined(__H8300H__) || defined(__H8300S__) || defined(__H8300SX__) -# define LZO_SIZEOF_VOID_P 4 -# else -# define LZO_SIZEOF_VOID_P 2 -# endif -# if (LZO_CC_GNUC && (LZO_CC_GNUC < 0x040000ul)) && (LZO_SIZEOF_INT == 4) -# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_INT -# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_INT -# endif -#elif (LZO_ARCH_I086) -# if (LZO_MM_TINY || LZO_MM_SMALL || LZO_MM_MEDIUM) -# define LZO_SIZEOF_VOID_P 2 -# elif (LZO_MM_COMPACT || LZO_MM_LARGE || LZO_MM_HUGE) -# define LZO_SIZEOF_VOID_P 4 -# else -# error "invalid LZO_ARCH_I086 memory model" -# endif -#elif (LZO_ARCH_M16C) -# if defined(__m32c_cpu__) || defined(__m32cm_cpu__) -# define LZO_SIZEOF_VOID_P 4 -# else -# define LZO_SIZEOF_VOID_P 2 -# endif -#elif (LZO_ARCH_SPU) -# define LZO_SIZEOF_VOID_P 4 -#elif (LZO_ARCH_Z80) -# define LZO_SIZEOF_VOID_P 2 -#elif (LZO_SIZEOF_LONG == 8) && ((defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__)) -# define LZO_SIZEOF_VOID_P 4 -#elif (LZO_OS_OS400 || defined(__OS400__)) -# if defined(__LLP64_IFC__) -# define LZO_SIZEOF_VOID_P 8 -# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG -# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG -# else -# define LZO_SIZEOF_VOID_P 16 -# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG -# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG -# endif -#elif (defined(__vms) || defined(__VMS)) && (__INITIAL_POINTER_SIZE+0 == 64) -# define LZO_SIZEOF_VOID_P 8 -# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG -# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG -#endif -#endif -#if !defined(LZO_SIZEOF_VOID_P) -# define LZO_SIZEOF_VOID_P LZO_SIZEOF_LONG -#endif -LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_VOID_P == sizeof(void *)) -#if !defined(LZO_SIZEOF_SIZE_T) -#if (LZO_ARCH_I086 || LZO_ARCH_M16C) -# define LZO_SIZEOF_SIZE_T 2 -#endif -#endif -#if !defined(LZO_SIZEOF_SIZE_T) -# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_VOID_P -#endif -#if defined(offsetof) -LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_SIZE_T == sizeof(size_t)) -#endif -#if !defined(LZO_SIZEOF_PTRDIFF_T) -#if (LZO_ARCH_I086) -# if (LZO_MM_TINY || LZO_MM_SMALL || LZO_MM_MEDIUM || LZO_MM_HUGE) -# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_VOID_P -# elif (LZO_MM_COMPACT || LZO_MM_LARGE) -# if (LZO_CC_BORLANDC || LZO_CC_TURBOC) -# define LZO_SIZEOF_PTRDIFF_T 4 -# else -# define LZO_SIZEOF_PTRDIFF_T 2 -# endif -# else -# error "invalid LZO_ARCH_I086 memory model" -# endif -#endif -#endif -#if !defined(LZO_SIZEOF_PTRDIFF_T) -# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_SIZE_T -#endif -#if defined(offsetof) -LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_PTRDIFF_T == sizeof(ptrdiff_t)) -#endif -#if !defined(LZO_WORDSIZE) -# define LZO_WORDSIZE LZO_SIZEOF_VOID_P -#endif -#if (LZO_ABI_NEUTRAL_ENDIAN) -# undef LZO_ABI_BIG_ENDIAN -# undef LZO_ABI_LITTLE_ENDIAN -#elif !(LZO_ABI_BIG_ENDIAN) && !(LZO_ABI_LITTLE_ENDIAN) -#if (LZO_ARCH_ALPHA) && (LZO_ARCH_CRAY_MPP) -# define LZO_ABI_BIG_ENDIAN 1 -#elif (LZO_ARCH_IA64) && (LZO_OS_POSIX_LINUX || LZO_OS_WIN64) -# define LZO_ABI_LITTLE_ENDIAN 1 -#elif (LZO_ARCH_ALPHA || LZO_ARCH_AMD64 || LZO_ARCH_BLACKFIN || LZO_ARCH_CRIS || LZO_ARCH_I086 || LZO_ARCH_I386 || LZO_ARCH_MSP430) -# define LZO_ABI_LITTLE_ENDIAN 1 -#elif (LZO_ARCH_AVR32 || LZO_ARCH_M68K || LZO_ARCH_S390 || LZO_ARCH_SPU) -# define LZO_ABI_BIG_ENDIAN 1 -#elif 1 && defined(__IAR_SYSTEMS_ICC__) && defined(__LITTLE_ENDIAN__) -# if (__LITTLE_ENDIAN__ == 1) -# define LZO_ABI_LITTLE_ENDIAN 1 -# else -# define LZO_ABI_BIG_ENDIAN 1 -# endif -#elif 1 && defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__) -# define LZO_ABI_BIG_ENDIAN 1 -#elif 1 && defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__) -# define LZO_ABI_LITTLE_ENDIAN 1 -#elif 1 && (LZO_ARCH_ARM) && defined(__ARM_BIG_ENDIAN) && ((__ARM_BIG_ENDIAN)+0) -# define LZO_ABI_BIG_ENDIAN 1 -#elif 1 && (LZO_ARCH_ARM) && defined(__ARMEB__) && !defined(__ARMEL__) -# define LZO_ABI_BIG_ENDIAN 1 -#elif 1 && (LZO_ARCH_ARM) && defined(__ARMEL__) && !defined(__ARMEB__) -# define LZO_ABI_LITTLE_ENDIAN 1 -#elif 1 && (LZO_ARCH_ARM && LZO_CC_ARMCC_ARMCC) -# if defined(__BIG_ENDIAN) && defined(__LITTLE_ENDIAN) -# error "unexpected configuration - check your compiler defines" -# elif defined(__BIG_ENDIAN) -# define LZO_ABI_BIG_ENDIAN 1 -# else -# define LZO_ABI_LITTLE_ENDIAN 1 -# endif -# define LZO_ABI_LITTLE_ENDIAN 1 -#elif 1 && (LZO_ARCH_ARM64) && defined(__ARM_BIG_ENDIAN) && ((__ARM_BIG_ENDIAN)+0) -# define LZO_ABI_BIG_ENDIAN 1 -#elif 1 && (LZO_ARCH_ARM64) && defined(__AARCH64EB__) && !defined(__AARCH64EL__) -# define LZO_ABI_BIG_ENDIAN 1 -#elif 1 && (LZO_ARCH_ARM64) && defined(__AARCH64EL__) && !defined(__AARCH64EB__) -# define LZO_ABI_LITTLE_ENDIAN 1 -#elif 1 && (LZO_ARCH_MIPS) && defined(__MIPSEB__) && !defined(__MIPSEL__) -# define LZO_ABI_BIG_ENDIAN 1 -#elif 1 && (LZO_ARCH_MIPS) && defined(__MIPSEL__) && !defined(__MIPSEB__) -# define LZO_ABI_LITTLE_ENDIAN 1 -#endif -#endif -#if (LZO_ABI_BIG_ENDIAN) && (LZO_ABI_LITTLE_ENDIAN) -# error "unexpected configuration - check your compiler defines" -#endif -#if (LZO_ABI_BIG_ENDIAN) -# define LZO_INFO_ABI_ENDIAN "be" -#elif (LZO_ABI_LITTLE_ENDIAN) -# define LZO_INFO_ABI_ENDIAN "le" -#elif (LZO_ABI_NEUTRAL_ENDIAN) -# define LZO_INFO_ABI_ENDIAN "neutral" -#endif -#if (LZO_SIZEOF_INT == 1 && LZO_SIZEOF_LONG == 2 && LZO_SIZEOF_VOID_P == 2) -# define LZO_ABI_I8LP16 1 -# define LZO_INFO_ABI_PM "i8lp16" -#elif (LZO_SIZEOF_INT == 2 && LZO_SIZEOF_LONG == 2 && LZO_SIZEOF_VOID_P == 2) -# define LZO_ABI_ILP16 1 -# define LZO_INFO_ABI_PM "ilp16" -#elif (LZO_SIZEOF_INT == 2 && LZO_SIZEOF_LONG == 4 && LZO_SIZEOF_VOID_P == 4) -# define LZO_ABI_LP32 1 -# define LZO_INFO_ABI_PM "lp32" -#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 4 && LZO_SIZEOF_VOID_P == 4) -# define LZO_ABI_ILP32 1 -# define LZO_INFO_ABI_PM "ilp32" -#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 4 && LZO_SIZEOF_VOID_P == 8 && LZO_SIZEOF_SIZE_T == 8) -# define LZO_ABI_LLP64 1 -# define LZO_INFO_ABI_PM "llp64" -#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 8 && LZO_SIZEOF_VOID_P == 8) -# define LZO_ABI_LP64 1 -# define LZO_INFO_ABI_PM "lp64" -#elif (LZO_SIZEOF_INT == 8 && LZO_SIZEOF_LONG == 8 && LZO_SIZEOF_VOID_P == 8) -# define LZO_ABI_ILP64 1 -# define LZO_INFO_ABI_PM "ilp64" -#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 8 && LZO_SIZEOF_VOID_P == 4) -# define LZO_ABI_IP32L64 1 -# define LZO_INFO_ABI_PM "ip32l64" -#endif -#if 0 -#elif !defined(__LZO_LIBC_OVERRIDE) -#if (LZO_LIBC_NAKED) -# define LZO_INFO_LIBC "naked" -#elif (LZO_LIBC_FREESTANDING) -# define LZO_INFO_LIBC "freestanding" -#elif (LZO_LIBC_MOSTLY_FREESTANDING) -# define LZO_INFO_LIBC "mfreestanding" -#elif (LZO_LIBC_ISOC90) -# define LZO_INFO_LIBC "isoc90" -#elif (LZO_LIBC_ISOC99) -# define LZO_INFO_LIBC "isoc99" -#elif (LZO_CC_ARMCC_ARMCC) && defined(__ARMCLIB_VERSION) -# define LZO_LIBC_ISOC90 1 -# define LZO_INFO_LIBC "isoc90" -#elif defined(__dietlibc__) -# define LZO_LIBC_DIETLIBC 1 -# define LZO_INFO_LIBC "dietlibc" -#elif defined(_NEWLIB_VERSION) -# define LZO_LIBC_NEWLIB 1 -# define LZO_INFO_LIBC "newlib" -#elif defined(__UCLIBC__) && defined(__UCLIBC_MAJOR__) && defined(__UCLIBC_MINOR__) -# if defined(__UCLIBC_SUBLEVEL__) -# define LZO_LIBC_UCLIBC (__UCLIBC_MAJOR__ * 0x10000L + (__UCLIBC_MINOR__-0) * 0x100 + (__UCLIBC_SUBLEVEL__-0)) -# else -# define LZO_LIBC_UCLIBC 0x00090bL -# endif -# define LZO_INFO_LIBC "uc" "libc" -#elif defined(__GLIBC__) && defined(__GLIBC_MINOR__) -# define LZO_LIBC_GLIBC (__GLIBC__ * 0x10000L + (__GLIBC_MINOR__-0) * 0x100) -# define LZO_INFO_LIBC "glibc" -#elif (LZO_CC_MWERKS) && defined(__MSL__) -# define LZO_LIBC_MSL __MSL__ -# define LZO_INFO_LIBC "msl" -#elif 1 && defined(__IAR_SYSTEMS_ICC__) -# define LZO_LIBC_ISOC90 1 -# define LZO_INFO_LIBC "isoc90" -#else -# define LZO_LIBC_DEFAULT 1 -# define LZO_INFO_LIBC "default" -#endif -#endif -#if (LZO_ARCH_I386 && (LZO_OS_DOS32 || LZO_OS_WIN32) && (LZO_CC_DMC || LZO_CC_INTELC || LZO_CC_MSC || LZO_CC_PELLESC)) -# define LZO_ASM_SYNTAX_MSC 1 -#elif (LZO_OS_WIN64 && (LZO_CC_DMC || LZO_CC_INTELC || LZO_CC_MSC || LZO_CC_PELLESC)) -#elif (LZO_ARCH_I386 && LZO_CC_GNUC && (LZO_CC_GNUC == 0x011f00ul)) -#elif (LZO_ARCH_I386 && (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_INTELC || LZO_CC_PATHSCALE)) -# define LZO_ASM_SYNTAX_GNUC 1 -#elif (LZO_ARCH_AMD64 && (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_INTELC || LZO_CC_PATHSCALE)) -# define LZO_ASM_SYNTAX_GNUC 1 -#elif (LZO_CC_GNUC) -# define LZO_ASM_SYNTAX_GNUC 1 -#endif -#if (LZO_ASM_SYNTAX_GNUC) -#if (LZO_ARCH_I386 && LZO_CC_GNUC && (LZO_CC_GNUC < 0x020000ul)) -# define __LZO_ASM_CLOBBER "ax" -# define __LZO_ASM_CLOBBER_LIST_CC /*empty*/ -# define __LZO_ASM_CLOBBER_LIST_CC_MEMORY /*empty*/ -# define __LZO_ASM_CLOBBER_LIST_EMPTY /*empty*/ -#elif (LZO_CC_INTELC && (__INTEL_COMPILER < 1000)) -# define __LZO_ASM_CLOBBER "memory" -# define __LZO_ASM_CLOBBER_LIST_CC /*empty*/ -# define __LZO_ASM_CLOBBER_LIST_CC_MEMORY : "memory" -# define __LZO_ASM_CLOBBER_LIST_EMPTY /*empty*/ -#else -# define __LZO_ASM_CLOBBER "cc", "memory" -# define __LZO_ASM_CLOBBER_LIST_CC : "cc" -# define __LZO_ASM_CLOBBER_LIST_CC_MEMORY : "cc", "memory" -# define __LZO_ASM_CLOBBER_LIST_EMPTY /*empty*/ -#endif -#endif -#if (LZO_ARCH_ALPHA) -# define LZO_OPT_AVOID_UINT_INDEX 1 -#elif (LZO_ARCH_AMD64) -# define LZO_OPT_AVOID_INT_INDEX 1 -# define LZO_OPT_AVOID_UINT_INDEX 1 -# ifndef LZO_OPT_UNALIGNED16 -# define LZO_OPT_UNALIGNED16 1 -# endif -# ifndef LZO_OPT_UNALIGNED32 -# define LZO_OPT_UNALIGNED32 1 -# endif -# ifndef LZO_OPT_UNALIGNED64 -# define LZO_OPT_UNALIGNED64 1 -# endif -#elif (LZO_ARCH_ARM) -# if defined(__ARM_FEATURE_UNALIGNED) -# if ((__ARM_FEATURE_UNALIGNED)+0) -# ifndef LZO_OPT_UNALIGNED16 -# define LZO_OPT_UNALIGNED16 1 -# endif -# ifndef LZO_OPT_UNALIGNED32 -# define LZO_OPT_UNALIGNED32 1 -# endif -# endif -# elif 1 && (LZO_ARCH_ARM_THUMB2) -# ifndef LZO_OPT_UNALIGNED16 -# define LZO_OPT_UNALIGNED16 1 -# endif -# ifndef LZO_OPT_UNALIGNED32 -# define LZO_OPT_UNALIGNED32 1 -# endif -# elif 1 && defined(__TARGET_ARCH_ARM) && ((__TARGET_ARCH_ARM)+0 >= 7) -# ifndef LZO_OPT_UNALIGNED16 -# define LZO_OPT_UNALIGNED16 1 -# endif -# ifndef LZO_OPT_UNALIGNED32 -# define LZO_OPT_UNALIGNED32 1 -# endif -# elif 1 && defined(__TARGET_ARCH_ARM) && ((__TARGET_ARCH_ARM)+0 >= 6) && (defined(__TARGET_PROFILE_A) || defined(__TARGET_PROFILE_R)) -# ifndef LZO_OPT_UNALIGNED16 -# define LZO_OPT_UNALIGNED16 1 -# endif -# ifndef LZO_OPT_UNALIGNED32 -# define LZO_OPT_UNALIGNED32 1 -# endif -# endif -#elif (LZO_ARCH_ARM64) -# ifndef LZO_OPT_UNALIGNED16 -# define LZO_OPT_UNALIGNED16 1 -# endif -# ifndef LZO_OPT_UNALIGNED32 -# define LZO_OPT_UNALIGNED32 1 -# endif -# ifndef LZO_OPT_UNALIGNED64 -# define LZO_OPT_UNALIGNED64 1 -# endif -#elif (LZO_ARCH_CRIS) -# ifndef LZO_OPT_UNALIGNED16 -# define LZO_OPT_UNALIGNED16 1 -# endif -# ifndef LZO_OPT_UNALIGNED32 -# define LZO_OPT_UNALIGNED32 1 -# endif -#elif (LZO_ARCH_I386) -# ifndef LZO_OPT_UNALIGNED16 -# define LZO_OPT_UNALIGNED16 1 -# endif -# ifndef LZO_OPT_UNALIGNED32 -# define LZO_OPT_UNALIGNED32 1 -# endif -#elif (LZO_ARCH_IA64) -# define LZO_OPT_AVOID_INT_INDEX 1 -# define LZO_OPT_AVOID_UINT_INDEX 1 -# define LZO_OPT_PREFER_POSTINC 1 -#elif (LZO_ARCH_M68K) -# define LZO_OPT_PREFER_POSTINC 1 -# define LZO_OPT_PREFER_PREDEC 1 -# if defined(__mc68020__) && !defined(__mcoldfire__) -# ifndef LZO_OPT_UNALIGNED16 -# define LZO_OPT_UNALIGNED16 1 -# endif -# ifndef LZO_OPT_UNALIGNED32 -# define LZO_OPT_UNALIGNED32 1 -# endif -# endif -#elif (LZO_ARCH_MIPS) -# define LZO_OPT_AVOID_UINT_INDEX 1 -#elif (LZO_ARCH_POWERPC) -# define LZO_OPT_PREFER_PREINC 1 -# define LZO_OPT_PREFER_PREDEC 1 -# if (LZO_ABI_BIG_ENDIAN) -# ifndef LZO_OPT_UNALIGNED16 -# define LZO_OPT_UNALIGNED16 1 -# endif -# ifndef LZO_OPT_UNALIGNED32 -# define LZO_OPT_UNALIGNED32 1 -# endif -# if (LZO_WORDSIZE == 8) -# ifndef LZO_OPT_UNALIGNED64 -# define LZO_OPT_UNALIGNED64 1 -# endif -# endif -# endif -#elif (LZO_ARCH_S390) -# ifndef LZO_OPT_UNALIGNED16 -# define LZO_OPT_UNALIGNED16 1 -# endif -# ifndef LZO_OPT_UNALIGNED32 -# define LZO_OPT_UNALIGNED32 1 -# endif -# if (LZO_WORDSIZE == 8) -# ifndef LZO_OPT_UNALIGNED64 -# define LZO_OPT_UNALIGNED64 1 -# endif -# endif -#elif (LZO_ARCH_SH) -# define LZO_OPT_PREFER_POSTINC 1 -# define LZO_OPT_PREFER_PREDEC 1 -#endif -#ifndef LZO_CFG_NO_INLINE_ASM -#if (LZO_ABI_NEUTRAL_ENDIAN) || (LZO_ARCH_GENERIC) -# define LZO_CFG_NO_INLINE_ASM 1 -#elif (LZO_CC_LLVM) -# define LZO_CFG_NO_INLINE_ASM 1 -#endif -#endif -#if (LZO_CFG_NO_INLINE_ASM) -# undef LZO_ASM_SYNTAX_MSC -# undef LZO_ASM_SYNTAX_GNUC -# undef __LZO_ASM_CLOBBER -# undef __LZO_ASM_CLOBBER_LIST_CC -# undef __LZO_ASM_CLOBBER_LIST_CC_MEMORY -# undef __LZO_ASM_CLOBBER_LIST_EMPTY -#endif -#ifndef LZO_CFG_NO_UNALIGNED -#if (LZO_ABI_NEUTRAL_ENDIAN) || (LZO_ARCH_GENERIC) -# define LZO_CFG_NO_UNALIGNED 1 -#endif -#endif -#if (LZO_CFG_NO_UNALIGNED) -# undef LZO_OPT_UNALIGNED16 -# undef LZO_OPT_UNALIGNED32 -# undef LZO_OPT_UNALIGNED64 -#endif -#if defined(__LZO_INFOSTR_MM) -#elif (LZO_MM_FLAT) && (defined(__LZO_INFOSTR_PM) || defined(LZO_INFO_ABI_PM)) -# define __LZO_INFOSTR_MM "" -#elif defined(LZO_INFO_MM) -# define __LZO_INFOSTR_MM "." LZO_INFO_MM -#else -# define __LZO_INFOSTR_MM "" -#endif -#if defined(__LZO_INFOSTR_PM) -#elif defined(LZO_INFO_ABI_PM) -# define __LZO_INFOSTR_PM "." LZO_INFO_ABI_PM -#else -# define __LZO_INFOSTR_PM "" -#endif -#if defined(__LZO_INFOSTR_ENDIAN) -#elif defined(LZO_INFO_ABI_ENDIAN) -# define __LZO_INFOSTR_ENDIAN "." LZO_INFO_ABI_ENDIAN -#else -# define __LZO_INFOSTR_ENDIAN "" -#endif -#if defined(__LZO_INFOSTR_OSNAME) -#elif defined(LZO_INFO_OS_CONSOLE) -# define __LZO_INFOSTR_OSNAME LZO_INFO_OS "." LZO_INFO_OS_CONSOLE -#elif defined(LZO_INFO_OS_POSIX) -# define __LZO_INFOSTR_OSNAME LZO_INFO_OS "." LZO_INFO_OS_POSIX -#else -# define __LZO_INFOSTR_OSNAME LZO_INFO_OS -#endif -#if defined(__LZO_INFOSTR_LIBC) -#elif defined(LZO_INFO_LIBC) -# define __LZO_INFOSTR_LIBC "." LZO_INFO_LIBC -#else -# define __LZO_INFOSTR_LIBC "" -#endif -#if defined(__LZO_INFOSTR_CCVER) -#elif defined(LZO_INFO_CCVER) -# define __LZO_INFOSTR_CCVER " " LZO_INFO_CCVER -#else -# define __LZO_INFOSTR_CCVER "" -#endif -#define LZO_INFO_STRING \ - LZO_INFO_ARCH __LZO_INFOSTR_MM __LZO_INFOSTR_PM __LZO_INFOSTR_ENDIAN \ - " " __LZO_INFOSTR_OSNAME __LZO_INFOSTR_LIBC " " LZO_INFO_CC __LZO_INFOSTR_CCVER -#if !(LZO_CFG_SKIP_LZO_TYPES) -#if (!(LZO_SIZEOF_SHORT+0 > 0 && LZO_SIZEOF_INT+0 > 0 && LZO_SIZEOF_LONG+0 > 0)) -# error "missing defines for sizes" -#endif -#if (!(LZO_SIZEOF_PTRDIFF_T+0 > 0 && LZO_SIZEOF_SIZE_T+0 > 0 && LZO_SIZEOF_VOID_P+0 > 0)) -# error "missing defines for sizes" -#endif -#define LZO_TYPEOF_CHAR 1u -#define LZO_TYPEOF_SHORT 2u -#define LZO_TYPEOF_INT 3u -#define LZO_TYPEOF_LONG 4u -#define LZO_TYPEOF_LONG_LONG 5u -#define LZO_TYPEOF___INT8 17u -#define LZO_TYPEOF___INT16 18u -#define LZO_TYPEOF___INT32 19u -#define LZO_TYPEOF___INT64 20u -#define LZO_TYPEOF___INT128 21u -#define LZO_TYPEOF___INT256 22u -#define LZO_TYPEOF___MODE_QI 33u -#define LZO_TYPEOF___MODE_HI 34u -#define LZO_TYPEOF___MODE_SI 35u -#define LZO_TYPEOF___MODE_DI 36u -#define LZO_TYPEOF___MODE_TI 37u -#define LZO_TYPEOF_CHAR_P 129u -#if !defined(lzo_llong_t) -#if (LZO_SIZEOF_LONG_LONG+0 > 0) -__lzo_gnuc_extension__ typedef long long lzo_llong_t__; -__lzo_gnuc_extension__ typedef unsigned long long lzo_ullong_t__; -# define lzo_llong_t lzo_llong_t__ -# define lzo_ullong_t lzo_ullong_t__ -#endif -#endif -#if !defined(lzo_int16e_t) -#if (LZO_SIZEOF_LONG == 2) -# define lzo_int16e_t long -# define lzo_uint16e_t unsigned long -# define LZO_TYPEOF_LZO_INT16E_T LZO_TYPEOF_LONG -#elif (LZO_SIZEOF_INT == 2) -# define lzo_int16e_t int -# define lzo_uint16e_t unsigned int -# define LZO_TYPEOF_LZO_INT16E_T LZO_TYPEOF_INT -#elif (LZO_SIZEOF_SHORT == 2) -# define lzo_int16e_t short int -# define lzo_uint16e_t unsigned short int -# define LZO_TYPEOF_LZO_INT16E_T LZO_TYPEOF_SHORT -#elif 1 && !(LZO_CFG_TYPE_NO_MODE_HI) && (LZO_CC_CLANG || (LZO_CC_GNUC >= 0x025f00ul) || LZO_CC_LLVM) - typedef int lzo_int16e_hi_t__ __attribute__((__mode__(__HI__))); - typedef unsigned int lzo_uint16e_hi_t__ __attribute__((__mode__(__HI__))); -# define lzo_int16e_t lzo_int16e_hi_t__ -# define lzo_uint16e_t lzo_uint16e_hi_t__ -# define LZO_TYPEOF_LZO_INT16E_T LZO_TYPEOF___MODE_HI -#elif (LZO_SIZEOF___INT16 == 2) -# define lzo_int16e_t __int16 -# define lzo_uint16e_t unsigned __int16 -# define LZO_TYPEOF_LZO_INT16E_T LZO_TYPEOF___INT16 -#else -#endif -#endif -#if defined(lzo_int16e_t) -# define LZO_SIZEOF_LZO_INT16E_T 2 - LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int16e_t) == 2) - LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int16e_t) == LZO_SIZEOF_LZO_INT16E_T) -#endif -#if !defined(lzo_int32e_t) -#if (LZO_SIZEOF_LONG == 4) -# define lzo_int32e_t long int -# define lzo_uint32e_t unsigned long int -# define LZO_TYPEOF_LZO_INT32E_T LZO_TYPEOF_LONG -#elif (LZO_SIZEOF_INT == 4) -# define lzo_int32e_t int -# define lzo_uint32e_t unsigned int -# define LZO_TYPEOF_LZO_INT32E_T LZO_TYPEOF_INT -#elif (LZO_SIZEOF_SHORT == 4) -# define lzo_int32e_t short int -# define lzo_uint32e_t unsigned short int -# define LZO_TYPEOF_LZO_INT32E_T LZO_TYPEOF_SHORT -#elif (LZO_SIZEOF_LONG_LONG == 4) -# define lzo_int32e_t lzo_llong_t -# define lzo_uint32e_t lzo_ullong_t -# define LZO_TYPEOF_LZO_INT32E_T LZO_TYPEOF_LONG_LONG -#elif 1 && !(LZO_CFG_TYPE_NO_MODE_SI) && (LZO_CC_CLANG || (LZO_CC_GNUC >= 0x025f00ul) || LZO_CC_LLVM) && (__INT_MAX__+0 > 2147483647L) - typedef int lzo_int32e_si_t__ __attribute__((__mode__(__SI__))); - typedef unsigned int lzo_uint32e_si_t__ __attribute__((__mode__(__SI__))); -# define lzo_int32e_t lzo_int32e_si_t__ -# define lzo_uint32e_t lzo_uint32e_si_t__ -# define LZO_TYPEOF_LZO_INT32E_T LZO_TYPEOF___MODE_SI -#elif 1 && !(LZO_CFG_TYPE_NO_MODE_SI) && (LZO_CC_GNUC >= 0x025f00ul) && defined(__AVR__) && (__LONG_MAX__+0 == 32767L) - typedef int lzo_int32e_si_t__ __attribute__((__mode__(__SI__))); - typedef unsigned int lzo_uint32e_si_t__ __attribute__((__mode__(__SI__))); -# define lzo_int32e_t lzo_int32e_si_t__ -# define lzo_uint32e_t lzo_uint32e_si_t__ -# define LZO_INT32_C(c) (c##LL) -# define LZO_UINT32_C(c) (c##ULL) -# define LZO_TYPEOF_LZO_INT32E_T LZO_TYPEOF___MODE_SI -#elif (LZO_SIZEOF___INT32 == 4) -# define lzo_int32e_t __int32 -# define lzo_uint32e_t unsigned __int32 -# define LZO_TYPEOF_LZO_INT32E_T LZO_TYPEOF___INT32 -#else -#endif -#endif -#if defined(lzo_int32e_t) -# define LZO_SIZEOF_LZO_INT32E_T 4 - LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32e_t) == 4) - LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32e_t) == LZO_SIZEOF_LZO_INT32E_T) -#endif -#if !defined(lzo_int64e_t) -#if (LZO_SIZEOF___INT64 == 8) -# if (LZO_CC_BORLANDC) && !(LZO_CFG_TYPE_PREFER___INT64) -# define LZO_CFG_TYPE_PREFER___INT64 1 -# endif -#endif -#if (LZO_SIZEOF_INT == 8) && (LZO_SIZEOF_INT < LZO_SIZEOF_LONG) -# define lzo_int64e_t int -# define lzo_uint64e_t unsigned int -# define LZO_TYPEOF_LZO_INT64E_T LZO_TYPEOF_INT -#elif (LZO_SIZEOF_LONG == 8) -# define lzo_int64e_t long int -# define lzo_uint64e_t unsigned long int -# define LZO_TYPEOF_LZO_INT64E_T LZO_TYPEOF_LONG -#elif (LZO_SIZEOF_LONG_LONG == 8) && !(LZO_CFG_TYPE_PREFER___INT64) -# define lzo_int64e_t lzo_llong_t -# define lzo_uint64e_t lzo_ullong_t -# define LZO_TYPEOF_LZO_INT64E_T LZO_TYPEOF_LONG_LONG -# if (LZO_CC_BORLANDC) -# define LZO_INT64_C(c) ((c) + 0ll) -# define LZO_UINT64_C(c) ((c) + 0ull) -# elif 0 -# define LZO_INT64_C(c) (__lzo_gnuc_extension__ (c##LL)) -# define LZO_UINT64_C(c) (__lzo_gnuc_extension__ (c##ULL)) -# else -# define LZO_INT64_C(c) (c##LL) -# define LZO_UINT64_C(c) (c##ULL) -# endif -#elif (LZO_SIZEOF___INT64 == 8) -# define lzo_int64e_t __int64 -# define lzo_uint64e_t unsigned __int64 -# define LZO_TYPEOF_LZO_INT64E_T LZO_TYPEOF___INT64 -# if (LZO_CC_BORLANDC) -# define LZO_INT64_C(c) ((c) + 0i64) -# define LZO_UINT64_C(c) ((c) + 0ui64) -# else -# define LZO_INT64_C(c) (c##i64) -# define LZO_UINT64_C(c) (c##ui64) -# endif -#else -#endif -#endif -#if defined(lzo_int64e_t) -# define LZO_SIZEOF_LZO_INT64E_T 8 - LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64e_t) == 8) - LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64e_t) == LZO_SIZEOF_LZO_INT64E_T) -#endif -#if !defined(lzo_int32l_t) -#if defined(lzo_int32e_t) -# define lzo_int32l_t lzo_int32e_t -# define lzo_uint32l_t lzo_uint32e_t -# define LZO_SIZEOF_LZO_INT32L_T LZO_SIZEOF_LZO_INT32E_T -# define LZO_TYPEOF_LZO_INT32L_T LZO_TYPEOF_LZO_INT32E_T -#elif (LZO_SIZEOF_INT >= 4) && (LZO_SIZEOF_INT < LZO_SIZEOF_LONG) -# define lzo_int32l_t int -# define lzo_uint32l_t unsigned int -# define LZO_SIZEOF_LZO_INT32L_T LZO_SIZEOF_INT -# define LZO_TYPEOF_LZO_INT32L_T LZO_SIZEOF_INT -#elif (LZO_SIZEOF_LONG >= 4) -# define lzo_int32l_t long int -# define lzo_uint32l_t unsigned long int -# define LZO_SIZEOF_LZO_INT32L_T LZO_SIZEOF_LONG -# define LZO_TYPEOF_LZO_INT32L_T LZO_SIZEOF_LONG -#else -# error "lzo_int32l_t" -#endif -#endif -#if 1 - LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32l_t) >= 4) - LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32l_t) == LZO_SIZEOF_LZO_INT32L_T) -#endif -#if !defined(lzo_int64l_t) -#if defined(lzo_int64e_t) -# define lzo_int64l_t lzo_int64e_t -# define lzo_uint64l_t lzo_uint64e_t -# define LZO_SIZEOF_LZO_INT64L_T LZO_SIZEOF_LZO_INT64E_T -# define LZO_TYPEOF_LZO_INT64L_T LZO_TYPEOF_LZO_INT64E_T -#else -#endif -#endif -#if defined(lzo_int64l_t) - LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64l_t) >= 8) - LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64l_t) == LZO_SIZEOF_LZO_INT64L_T) -#endif -#if !defined(lzo_int32f_t) -#if (LZO_SIZEOF_SIZE_T >= 8) -# define lzo_int32f_t lzo_int64l_t -# define lzo_uint32f_t lzo_uint64l_t -# define LZO_SIZEOF_LZO_INT32F_T LZO_SIZEOF_LZO_INT64L_T -# define LZO_TYPEOF_LZO_INT32F_T LZO_TYPEOF_LZO_INT64L_T -#else -# define lzo_int32f_t lzo_int32l_t -# define lzo_uint32f_t lzo_uint32l_t -# define LZO_SIZEOF_LZO_INT32F_T LZO_SIZEOF_LZO_INT32L_T -# define LZO_TYPEOF_LZO_INT32F_T LZO_TYPEOF_LZO_INT32L_T -#endif -#endif -#if 1 - LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32f_t) >= 4) - LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32f_t) == LZO_SIZEOF_LZO_INT32F_T) -#endif -#if !defined(lzo_int64f_t) -#if defined(lzo_int64l_t) -# define lzo_int64f_t lzo_int64l_t -# define lzo_uint64f_t lzo_uint64l_t -# define LZO_SIZEOF_LZO_INT64F_T LZO_SIZEOF_LZO_INT64L_T -# define LZO_TYPEOF_LZO_INT64F_T LZO_TYPEOF_LZO_INT64L_T -#else -#endif -#endif -#if defined(lzo_int64f_t) - LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64f_t) >= 8) - LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64f_t) == LZO_SIZEOF_LZO_INT64F_T) -#endif -#if !defined(lzo_intptr_t) -#if 1 && (LZO_OS_OS400 && (LZO_SIZEOF_VOID_P == 16)) -# define __LZO_INTPTR_T_IS_POINTER 1 - typedef char * lzo_intptr_t; - typedef char * lzo_uintptr_t; -# define lzo_intptr_t lzo_intptr_t -# define lzo_uintptr_t lzo_uintptr_t -# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_VOID_P -# define LZO_TYPEOF_LZO_INTPTR_T LZO_TYPEOF_CHAR_P -#elif (LZO_CC_MSC && (_MSC_VER >= 1300) && (LZO_SIZEOF_VOID_P == 4) && (LZO_SIZEOF_INT == 4)) - typedef __w64 int lzo_intptr_t; - typedef __w64 unsigned int lzo_uintptr_t; -# define lzo_intptr_t lzo_intptr_t -# define lzo_uintptr_t lzo_uintptr_t -# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_INT -# define LZO_TYPEOF_LZO_INTPTR_T LZO_TYPEOF_INT -#elif (LZO_SIZEOF_SHORT == LZO_SIZEOF_VOID_P) && (LZO_SIZEOF_INT > LZO_SIZEOF_VOID_P) -# define lzo_intptr_t short -# define lzo_uintptr_t unsigned short -# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_SHORT -# define LZO_TYPEOF_LZO_INTPTR_T LZO_TYPEOF_SHORT -#elif (LZO_SIZEOF_INT >= LZO_SIZEOF_VOID_P) && (LZO_SIZEOF_INT < LZO_SIZEOF_LONG) -# define lzo_intptr_t int -# define lzo_uintptr_t unsigned int -# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_INT -# define LZO_TYPEOF_LZO_INTPTR_T LZO_TYPEOF_INT -#elif (LZO_SIZEOF_LONG >= LZO_SIZEOF_VOID_P) -# define lzo_intptr_t long -# define lzo_uintptr_t unsigned long -# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_LONG -# define LZO_TYPEOF_LZO_INTPTR_T LZO_TYPEOF_LONG -#elif (LZO_SIZEOF_LZO_INT64L_T >= LZO_SIZEOF_VOID_P) -# define lzo_intptr_t lzo_int64l_t -# define lzo_uintptr_t lzo_uint64l_t -# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_LZO_INT64L_T -# define LZO_TYPEOF_LZO_INTPTR_T LZO_TYPEOF_LZO_INT64L_T -#else -# error "lzo_intptr_t" -#endif -#endif -#if 1 - LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_intptr_t) >= sizeof(void *)) - LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_intptr_t) == sizeof(lzo_uintptr_t)) -#endif -#if !defined(lzo_word_t) -#if defined(LZO_WORDSIZE) && (LZO_WORDSIZE+0 > 0) -#if (LZO_WORDSIZE == LZO_SIZEOF_LZO_INTPTR_T) && !(__LZO_INTPTR_T_IS_POINTER) -# define lzo_word_t lzo_uintptr_t -# define lzo_sword_t lzo_intptr_t -# define LZO_SIZEOF_LZO_WORD_T LZO_SIZEOF_LZO_INTPTR_T -# define LZO_TYPEOF_LZO_WORD_T LZO_TYPEOF_LZO_INTPTR_T -#elif (LZO_WORDSIZE == LZO_SIZEOF_LONG) -# define lzo_word_t unsigned long -# define lzo_sword_t long -# define LZO_SIZEOF_LZO_WORD_T LZO_SIZEOF_LONG -# define LZO_TYPEOF_LZO_WORD_T LZO_TYPEOF_LONG -#elif (LZO_WORDSIZE == LZO_SIZEOF_INT) -# define lzo_word_t unsigned int -# define lzo_sword_t int -# define LZO_SIZEOF_LZO_WORD_T LZO_SIZEOF_INT -# define LZO_TYPEOF_LZO_WORD_T LZO_TYPEOF_INT -#elif (LZO_WORDSIZE == LZO_SIZEOF_SHORT) -# define lzo_word_t unsigned short -# define lzo_sword_t short -# define LZO_SIZEOF_LZO_WORD_T LZO_SIZEOF_SHORT -# define LZO_TYPEOF_LZO_WORD_T LZO_TYPEOF_SHORT -#elif (LZO_WORDSIZE == 1) -# define lzo_word_t unsigned char -# define lzo_sword_t signed char -# define LZO_SIZEOF_LZO_WORD_T 1 -# define LZO_TYPEOF_LZO_WORD_T LZO_TYPEOF_CHAR -#elif (LZO_WORDSIZE == LZO_SIZEOF_LZO_INT64L_T) -# define lzo_word_t lzo_uint64l_t -# define lzo_sword_t lzo_int64l_t -# define LZO_SIZEOF_LZO_WORD_T LZO_SIZEOF_LZO_INT64L_T -# define LZO_TYPEOF_LZO_WORD_T LZO_SIZEOF_LZO_INT64L_T -#elif (LZO_ARCH_SPU) && (LZO_CC_GNUC) -#if 0 - typedef unsigned lzo_word_t __attribute__((__mode__(__V16QI__))); - typedef int lzo_sword_t __attribute__((__mode__(__V16QI__))); -# define lzo_word_t lzo_word_t -# define lzo_sword_t lzo_sword_t -# define LZO_SIZEOF_LZO_WORD_T 16 -# define LZO_TYPEOF_LZO_WORD_T LZO_TYPEOF___MODE_V16QI -#endif -#else -# error "lzo_word_t" -#endif -#endif -#endif -#if 1 && defined(lzo_word_t) - LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_word_t) == LZO_WORDSIZE) - LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_sword_t) == LZO_WORDSIZE) -#endif -#if 1 -#define lzo_int8_t signed char -#define lzo_uint8_t unsigned char -#define LZO_SIZEOF_LZO_INT8_T 1 -#define LZO_TYPEOF_LZO_INT8_T LZO_TYPEOF_CHAR -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int8_t) == 1) -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int8_t) == sizeof(lzo_uint8_t)) -#endif -#if defined(lzo_int16e_t) -#define lzo_int16_t lzo_int16e_t -#define lzo_uint16_t lzo_uint16e_t -#define LZO_SIZEOF_LZO_INT16_T LZO_SIZEOF_LZO_INT16E_T -#define LZO_TYPEOF_LZO_INT16_T LZO_TYPEOF_LZO_INT16E_T -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int16_t) == 2) -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int16_t) == sizeof(lzo_uint16_t)) -#endif -#if defined(lzo_int32e_t) -#define lzo_int32_t lzo_int32e_t -#define lzo_uint32_t lzo_uint32e_t -#define LZO_SIZEOF_LZO_INT32_T LZO_SIZEOF_LZO_INT32E_T -#define LZO_TYPEOF_LZO_INT32_T LZO_TYPEOF_LZO_INT32E_T -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32_t) == 4) -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32_t) == sizeof(lzo_uint32_t)) -#endif -#if defined(lzo_int64e_t) -#define lzo_int64_t lzo_int64e_t -#define lzo_uint64_t lzo_uint64e_t -#define LZO_SIZEOF_LZO_INT64_T LZO_SIZEOF_LZO_INT64E_T -#define LZO_TYPEOF_LZO_INT64_T LZO_TYPEOF_LZO_INT64E_T -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64_t) == 8) -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64_t) == sizeof(lzo_uint64_t)) -#endif -#if 1 -#define lzo_int_least32_t lzo_int32l_t -#define lzo_uint_least32_t lzo_uint32l_t -#define LZO_SIZEOF_LZO_INT_LEAST32_T LZO_SIZEOF_LZO_INT32L_T -#define LZO_TYPEOF_LZO_INT_LEAST32_T LZO_TYPEOF_LZO_INT32L_T -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_least32_t) >= 4) -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_least32_t) == sizeof(lzo_uint_least32_t)) -#endif -#if defined(lzo_int64l_t) -#define lzo_int_least64_t lzo_int64l_t -#define lzo_uint_least64_t lzo_uint64l_t -#define LZO_SIZEOF_LZO_INT_LEAST64_T LZO_SIZEOF_LZO_INT64L_T -#define LZO_TYPEOF_LZO_INT_LEAST64_T LZO_TYPEOF_LZO_INT64L_T -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_least64_t) >= 8) -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_least64_t) == sizeof(lzo_uint_least64_t)) -#endif -#if 1 -#define lzo_int_fast32_t lzo_int32f_t -#define lzo_uint_fast32_t lzo_uint32f_t -#define LZO_SIZEOF_LZO_INT_FAST32_T LZO_SIZEOF_LZO_INT32F_T -#define LZO_TYPEOF_LZO_INT_FAST32_T LZO_TYPEOF_LZO_INT32F_T -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_fast32_t) >= 4) -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_fast32_t) == sizeof(lzo_uint_fast32_t)) -#endif -#if defined(lzo_int64f_t) -#define lzo_int_fast64_t lzo_int64f_t -#define lzo_uint_fast64_t lzo_uint64f_t -#define LZO_SIZEOF_LZO_INT_FAST64_T LZO_SIZEOF_LZO_INT64F_T -#define LZO_TYPEOF_LZO_INT_FAST64_T LZO_TYPEOF_LZO_INT64F_T -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_fast64_t) >= 8) -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_fast64_t) == sizeof(lzo_uint_fast64_t)) -#endif -#if !defined(LZO_INT16_C) -# if (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_INT >= 2) -# define LZO_INT16_C(c) ((c) + 0) -# define LZO_UINT16_C(c) ((c) + 0U) -# elif (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_LONG >= 2) -# define LZO_INT16_C(c) ((c) + 0L) -# define LZO_UINT16_C(c) ((c) + 0UL) -# elif (LZO_SIZEOF_INT >= 2) -# define LZO_INT16_C(c) (c) -# define LZO_UINT16_C(c) (c##U) -# elif (LZO_SIZEOF_LONG >= 2) -# define LZO_INT16_C(c) (c##L) -# define LZO_UINT16_C(c) (c##UL) -# else -# error "LZO_INT16_C" -# endif -#endif -#if !defined(LZO_INT32_C) -# if (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_INT >= 4) -# define LZO_INT32_C(c) ((c) + 0) -# define LZO_UINT32_C(c) ((c) + 0U) -# elif (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_LONG >= 4) -# define LZO_INT32_C(c) ((c) + 0L) -# define LZO_UINT32_C(c) ((c) + 0UL) -# elif (LZO_SIZEOF_INT >= 4) -# define LZO_INT32_C(c) (c) -# define LZO_UINT32_C(c) (c##U) -# elif (LZO_SIZEOF_LONG >= 4) -# define LZO_INT32_C(c) (c##L) -# define LZO_UINT32_C(c) (c##UL) -# elif (LZO_SIZEOF_LONG_LONG >= 4) -# define LZO_INT32_C(c) (c##LL) -# define LZO_UINT32_C(c) (c##ULL) -# else -# error "LZO_INT32_C" -# endif -#endif -#if !defined(LZO_INT64_C) && defined(lzo_int64l_t) -# if (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_INT >= 8) -# define LZO_INT64_C(c) ((c) + 0) -# define LZO_UINT64_C(c) ((c) + 0U) -# elif (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_LONG >= 8) -# define LZO_INT64_C(c) ((c) + 0L) -# define LZO_UINT64_C(c) ((c) + 0UL) -# elif (LZO_SIZEOF_INT >= 8) -# define LZO_INT64_C(c) (c) -# define LZO_UINT64_C(c) (c##U) -# elif (LZO_SIZEOF_LONG >= 8) -# define LZO_INT64_C(c) (c##L) -# define LZO_UINT64_C(c) (c##UL) -# else -# error "LZO_INT64_C" -# endif -#endif -#endif - -#endif - -#endif - -#undef LZO_HAVE_CONFIG_H -#include "minilzo.h" - -#if !defined(MINILZO_VERSION) || (MINILZO_VERSION != 0x2090) -# error "version mismatch in miniLZO source files" -#endif - -#ifdef MINILZO_HAVE_CONFIG_H -# define LZO_HAVE_CONFIG_H 1 -#endif - -#ifndef __LZO_CONF_H -#define __LZO_CONF_H 1 - -#if !defined(__LZO_IN_MINILZO) -#if defined(LZO_CFG_FREESTANDING) && (LZO_CFG_FREESTANDING) -# define LZO_LIBC_FREESTANDING 1 -# define LZO_OS_FREESTANDING 1 -#endif -#if defined(LZO_CFG_EXTRA_CONFIG_HEADER) -# include LZO_CFG_EXTRA_CONFIG_HEADER -#endif -#if defined(__LZOCONF_H) || defined(__LZOCONF_H_INCLUDED) -# error "include this file first" -#endif -#if defined(LZO_CFG_BUILD_DLL) && (LZO_CFG_BUILD_DLL+0) && !defined(__LZO_EXPORT1) && !defined(__LZO_EXPORT2) && 0 -#ifndef __LZODEFS_H_INCLUDED -#if defined(LZO_HAVE_CONFIG_H) -# include <config.h> -#endif -#include <limits.h> -#include <stddef.h> -#include <lzo/lzodefs.h> -#endif -#endif -#include <lzo/lzoconf.h> -#if defined(LZO_CFG_EXTRA_CONFIG_HEADER2) -# include LZO_CFG_EXTRA_CONFIG_HEADER2 -#endif -#endif - -#if !defined(__LZOCONF_H_INCLUDED) || (LZO_VERSION+0 != 0x2090) -# error "version mismatch" -#endif - -#if (LZO_CC_MSC && (_MSC_VER >= 1000 && _MSC_VER < 1100)) -# pragma warning(disable: 4702) -#endif -#if (LZO_CC_MSC && (_MSC_VER >= 1000)) -# pragma warning(disable: 4127 4701) -# pragma warning(disable: 4514 4710 4711) -#endif -#if (LZO_CC_MSC && (_MSC_VER >= 1300)) -# pragma warning(disable: 4820) -#endif -#if (LZO_CC_MSC && (_MSC_VER >= 1800)) -# pragma warning(disable: 4746) -#endif -#if (LZO_CC_INTELC && (__INTEL_COMPILER >= 900)) -# pragma warning(disable: 1684) -#endif - -#if (LZO_CC_SUNPROC) -#if !defined(__cplusplus) -# pragma error_messages(off,E_END_OF_LOOP_CODE_NOT_REACHED) -# pragma error_messages(off,E_LOOP_NOT_ENTERED_AT_TOP) -# pragma error_messages(off,E_STATEMENT_NOT_REACHED) -#endif -#endif - -#if !defined(__LZO_NOEXPORT1) -# define __LZO_NOEXPORT1 /*empty*/ -#endif -#if !defined(__LZO_NOEXPORT2) -# define __LZO_NOEXPORT2 /*empty*/ -#endif - -#if 1 -# define LZO_PUBLIC_DECL(r) LZO_EXTERN(r) -#endif -#if 1 -# define LZO_PUBLIC_IMPL(r) LZO_PUBLIC(r) -#endif -#if !defined(LZO_LOCAL_DECL) -# define LZO_LOCAL_DECL(r) __LZO_EXTERN_C LZO_LOCAL_IMPL(r) -#endif -#if !defined(LZO_LOCAL_IMPL) -# define LZO_LOCAL_IMPL(r) __LZO_NOEXPORT1 r __LZO_NOEXPORT2 __LZO_CDECL -#endif -#if 1 -# define LZO_STATIC_DECL(r) LZO_PRIVATE(r) -#endif -#if 1 -# define LZO_STATIC_IMPL(r) LZO_PRIVATE(r) -#endif - -#if defined(__LZO_IN_MINILZO) || (LZO_CFG_FREESTANDING) -#elif 1 -# include <string.h> -#else -# define LZO_WANT_ACC_INCD_H 1 -#endif -#if defined(LZO_HAVE_CONFIG_H) -# define LZO_CFG_NO_CONFIG_HEADER 1 -#endif - -#if 1 && !defined(LZO_CFG_FREESTANDING) -#if 1 && !defined(HAVE_STRING_H) -#define HAVE_STRING_H 1 -#endif -#if 1 && !defined(HAVE_MEMCMP) -#define HAVE_MEMCMP 1 -#endif -#if 1 && !defined(HAVE_MEMCPY) -#define HAVE_MEMCPY 1 -#endif -#if 1 && !defined(HAVE_MEMMOVE) -#define HAVE_MEMMOVE 1 -#endif -#if 1 && !defined(HAVE_MEMSET) -#define HAVE_MEMSET 1 -#endif -#endif - -#if 1 && defined(HAVE_STRING_H) -#include <string.h> -#endif - -#if 1 || defined(lzo_int8_t) || defined(lzo_uint8_t) -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int8_t) == 1) -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint8_t) == 1) -#endif -#if 1 || defined(lzo_int16_t) || defined(lzo_uint16_t) -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int16_t) == 2) -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint16_t) == 2) -#endif -#if 1 || defined(lzo_int32_t) || defined(lzo_uint32_t) -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32_t) == 4) -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint32_t) == 4) -#endif -#if defined(lzo_int64_t) || defined(lzo_uint64_t) -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64_t) == 8) -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint64_t) == 8) -#endif - -#if (LZO_CFG_FREESTANDING) -# undef HAVE_MEMCMP -# undef HAVE_MEMCPY -# undef HAVE_MEMMOVE -# undef HAVE_MEMSET -#endif - -#if !(HAVE_MEMCMP) -# undef memcmp -# define memcmp(a,b,c) lzo_memcmp(a,b,c) -#else -# undef lzo_memcmp -# define lzo_memcmp(a,b,c) memcmp(a,b,c) -#endif -#if !(HAVE_MEMCPY) -# undef memcpy -# define memcpy(a,b,c) lzo_memcpy(a,b,c) -#else -# undef lzo_memcpy -# define lzo_memcpy(a,b,c) memcpy(a,b,c) -#endif -#if !(HAVE_MEMMOVE) -# undef memmove -# define memmove(a,b,c) lzo_memmove(a,b,c) -#else -# undef lzo_memmove -# define lzo_memmove(a,b,c) memmove(a,b,c) -#endif -#if !(HAVE_MEMSET) -# undef memset -# define memset(a,b,c) lzo_memset(a,b,c) -#else -# undef lzo_memset -# define lzo_memset(a,b,c) memset(a,b,c) -#endif - -#undef NDEBUG -#if (LZO_CFG_FREESTANDING) -# undef LZO_DEBUG -# define NDEBUG 1 -# undef assert -# define assert(e) ((void)0) -#else -# if !defined(LZO_DEBUG) -# define NDEBUG 1 -# endif -# include <assert.h> -#endif - -#if 0 && defined(__BOUNDS_CHECKING_ON) -# include <unchecked.h> -#else -# define BOUNDS_CHECKING_OFF_DURING(stmt) stmt -# define BOUNDS_CHECKING_OFF_IN_EXPR(expr) (expr) -#endif - -#if (LZO_CFG_PGO) -# undef __lzo_likely -# undef __lzo_unlikely -# define __lzo_likely(e) (e) -# define __lzo_unlikely(e) (e) -#endif - -#undef _ -#undef __ -#undef ___ -#undef ____ -#undef _p0 -#undef _p1 -#undef _p2 -#undef _p3 -#undef _p4 -#undef _s0 -#undef _s1 -#undef _s2 -#undef _s3 -#undef _s4 -#undef _ww - -#if 1 -# define LZO_BYTE(x) ((unsigned char) (x)) -#else -# define LZO_BYTE(x) ((unsigned char) ((x) & 0xff)) -#endif - -#define LZO_MAX(a,b) ((a) >= (b) ? (a) : (b)) -#define LZO_MIN(a,b) ((a) <= (b) ? (a) : (b)) -#define LZO_MAX3(a,b,c) ((a) >= (b) ? LZO_MAX(a,c) : LZO_MAX(b,c)) -#define LZO_MIN3(a,b,c) ((a) <= (b) ? LZO_MIN(a,c) : LZO_MIN(b,c)) - -#define lzo_sizeof(type) ((lzo_uint) (sizeof(type))) - -#define LZO_HIGH(array) ((lzo_uint) (sizeof(array)/sizeof(*(array)))) - -#define LZO_SIZE(bits) (1u << (bits)) -#define LZO_MASK(bits) (LZO_SIZE(bits) - 1) - -#define LZO_USIZE(bits) ((lzo_uint) 1 << (bits)) -#define LZO_UMASK(bits) (LZO_USIZE(bits) - 1) - -#if !defined(DMUL) -#if 0 - -# define DMUL(a,b) ((lzo_xint) ((lzo_uint32_t)(a) * (lzo_uint32_t)(b))) -#else -# define DMUL(a,b) ((lzo_xint) ((a) * (b))) -#endif -#endif - -#ifndef __LZO_FUNC_H -#define __LZO_FUNC_H 1 - -#if !defined(LZO_BITOPS_USE_ASM_BITSCAN) && !defined(LZO_BITOPS_USE_GNUC_BITSCAN) && !defined(LZO_BITOPS_USE_MSC_BITSCAN) -#if 1 && (LZO_ARCH_AMD64) && (LZO_CC_GNUC && (LZO_CC_GNUC < 0x040000ul)) && (LZO_ASM_SYNTAX_GNUC) -#define LZO_BITOPS_USE_ASM_BITSCAN 1 -#elif (LZO_CC_CLANG || (LZO_CC_GNUC >= 0x030400ul) || (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 1000)) || (LZO_CC_LLVM && (!defined(__llvm_tools_version__) || (__llvm_tools_version__+0 >= 0x010500ul)))) -#define LZO_BITOPS_USE_GNUC_BITSCAN 1 -#elif (LZO_OS_WIN32 || LZO_OS_WIN64) && ((LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 1010)) || (LZO_CC_MSC && (_MSC_VER >= 1400))) -#define LZO_BITOPS_USE_MSC_BITSCAN 1 -#if (LZO_CC_MSC) && (LZO_ARCH_AMD64 || LZO_ARCH_I386) -#include <intrin.h> -#endif -#if (LZO_CC_MSC) && (LZO_ARCH_AMD64 || LZO_ARCH_I386) -#pragma intrinsic(_BitScanReverse) -#pragma intrinsic(_BitScanForward) -#endif -#if (LZO_CC_MSC) && (LZO_ARCH_AMD64) -#pragma intrinsic(_BitScanReverse64) -#pragma intrinsic(_BitScanForward64) -#endif -#endif -#endif - -__lzo_static_forceinline unsigned lzo_bitops_ctlz32_func(lzo_uint32_t v) -{ -#if (LZO_BITOPS_USE_MSC_BITSCAN) && (LZO_ARCH_AMD64 || LZO_ARCH_I386) - unsigned long r; (void) _BitScanReverse(&r, v); return (unsigned) r ^ 31; -#define lzo_bitops_ctlz32(v) lzo_bitops_ctlz32_func(v) -#elif (LZO_BITOPS_USE_ASM_BITSCAN) && (LZO_ARCH_AMD64 || LZO_ARCH_I386) && (LZO_ASM_SYNTAX_GNUC) - lzo_uint32_t r; - __asm__("bsr %1,%0" : "=r" (r) : "rm" (v) __LZO_ASM_CLOBBER_LIST_CC); - return (unsigned) r ^ 31; -#define lzo_bitops_ctlz32(v) lzo_bitops_ctlz32_func(v) -#elif (LZO_BITOPS_USE_GNUC_BITSCAN) && (LZO_SIZEOF_INT == 4) - unsigned r; r = (unsigned) __builtin_clz(v); return r; -#define lzo_bitops_ctlz32(v) ((unsigned) __builtin_clz(v)) -#elif (LZO_BITOPS_USE_GNUC_BITSCAN) && (LZO_SIZEOF_LONG == 8) && (LZO_WORDSIZE >= 8) - unsigned r; r = (unsigned) __builtin_clzl(v); return r ^ 32; -#define lzo_bitops_ctlz32(v) (((unsigned) __builtin_clzl(v)) ^ 32) -#else - LZO_UNUSED(v); return 0; -#endif -} - -#if defined(lzo_uint64_t) -__lzo_static_forceinline unsigned lzo_bitops_ctlz64_func(lzo_uint64_t v) -{ -#if (LZO_BITOPS_USE_MSC_BITSCAN) && (LZO_ARCH_AMD64) - unsigned long r; (void) _BitScanReverse64(&r, v); return (unsigned) r ^ 63; -#define lzo_bitops_ctlz64(v) lzo_bitops_ctlz64_func(v) -#elif (LZO_BITOPS_USE_ASM_BITSCAN) && (LZO_ARCH_AMD64) && (LZO_ASM_SYNTAX_GNUC) - lzo_uint64_t r; - __asm__("bsr %1,%0" : "=r" (r) : "rm" (v) __LZO_ASM_CLOBBER_LIST_CC); - return (unsigned) r ^ 63; -#define lzo_bitops_ctlz64(v) lzo_bitops_ctlz64_func(v) -#elif (LZO_BITOPS_USE_GNUC_BITSCAN) && (LZO_SIZEOF_LONG == 8) && (LZO_WORDSIZE >= 8) - unsigned r; r = (unsigned) __builtin_clzl(v); return r; -#define lzo_bitops_ctlz64(v) ((unsigned) __builtin_clzl(v)) -#elif (LZO_BITOPS_USE_GNUC_BITSCAN) && (LZO_SIZEOF_LONG_LONG == 8) && (LZO_WORDSIZE >= 8) - unsigned r; r = (unsigned) __builtin_clzll(v); return r; -#define lzo_bitops_ctlz64(v) ((unsigned) __builtin_clzll(v)) -#else - LZO_UNUSED(v); return 0; -#endif -} -#endif - -__lzo_static_forceinline unsigned lzo_bitops_cttz32_func(lzo_uint32_t v) -{ -#if (LZO_BITOPS_USE_MSC_BITSCAN) && (LZO_ARCH_AMD64 || LZO_ARCH_I386) - unsigned long r; (void) _BitScanForward(&r, v); return (unsigned) r; -#define lzo_bitops_cttz32(v) lzo_bitops_cttz32_func(v) -#elif (LZO_BITOPS_USE_ASM_BITSCAN) && (LZO_ARCH_AMD64 || LZO_ARCH_I386) && (LZO_ASM_SYNTAX_GNUC) - lzo_uint32_t r; - __asm__("bsf %1,%0" : "=r" (r) : "rm" (v) __LZO_ASM_CLOBBER_LIST_CC); - return (unsigned) r; -#define lzo_bitops_cttz32(v) lzo_bitops_cttz32_func(v) -#elif (LZO_BITOPS_USE_GNUC_BITSCAN) && (LZO_SIZEOF_INT >= 4) - unsigned r; r = (unsigned) __builtin_ctz(v); return r; -#define lzo_bitops_cttz32(v) ((unsigned) __builtin_ctz(v)) -#else - LZO_UNUSED(v); return 0; -#endif -} - -#if defined(lzo_uint64_t) -__lzo_static_forceinline unsigned lzo_bitops_cttz64_func(lzo_uint64_t v) -{ -#if (LZO_BITOPS_USE_MSC_BITSCAN) && (LZO_ARCH_AMD64) - unsigned long r; (void) _BitScanForward64(&r, v); return (unsigned) r; -#define lzo_bitops_cttz64(v) lzo_bitops_cttz64_func(v) -#elif (LZO_BITOPS_USE_ASM_BITSCAN) && (LZO_ARCH_AMD64) && (LZO_ASM_SYNTAX_GNUC) - lzo_uint64_t r; - __asm__("bsf %1,%0" : "=r" (r) : "rm" (v) __LZO_ASM_CLOBBER_LIST_CC); - return (unsigned) r; -#define lzo_bitops_cttz64(v) lzo_bitops_cttz64_func(v) -#elif (LZO_BITOPS_USE_GNUC_BITSCAN) && (LZO_SIZEOF_LONG >= 8) && (LZO_WORDSIZE >= 8) - unsigned r; r = (unsigned) __builtin_ctzl(v); return r; -#define lzo_bitops_cttz64(v) ((unsigned) __builtin_ctzl(v)) -#elif (LZO_BITOPS_USE_GNUC_BITSCAN) && (LZO_SIZEOF_LONG_LONG >= 8) && (LZO_WORDSIZE >= 8) - unsigned r; r = (unsigned) __builtin_ctzll(v); return r; -#define lzo_bitops_cttz64(v) ((unsigned) __builtin_ctzll(v)) -#else - LZO_UNUSED(v); return 0; -#endif -} -#endif - -lzo_unused_funcs_impl(void, lzo_bitops_unused_funcs)(void) -{ - LZO_UNUSED_FUNC(lzo_bitops_unused_funcs); - LZO_UNUSED_FUNC(lzo_bitops_ctlz32_func); - LZO_UNUSED_FUNC(lzo_bitops_cttz32_func); -#if defined(lzo_uint64_t) - LZO_UNUSED_FUNC(lzo_bitops_ctlz64_func); - LZO_UNUSED_FUNC(lzo_bitops_cttz64_func); -#endif -} - -#if defined(__lzo_alignof) && !(LZO_CFG_NO_UNALIGNED) -#if !defined(lzo_memops_tcheck__) && 0 -#define lzo_memops_tcheck__(t,a,b) ((void)0, sizeof(t) == (a) && __lzo_alignof(t) == (b)) -#endif -#endif -#ifndef lzo_memops_TU0p -#define lzo_memops_TU0p void __LZO_MMODEL * -#endif -#ifndef lzo_memops_TU1p -#define lzo_memops_TU1p unsigned char __LZO_MMODEL * -#endif -#ifndef lzo_memops_TU2p -#if (LZO_OPT_UNALIGNED16) -typedef lzo_uint16_t __lzo_may_alias lzo_memops_TU2; -#define lzo_memops_TU2p volatile lzo_memops_TU2 * -#elif defined(__lzo_byte_struct) -__lzo_byte_struct(lzo_memops_TU2_struct,2) -typedef struct lzo_memops_TU2_struct lzo_memops_TU2; -#else -struct lzo_memops_TU2_struct { unsigned char a[2]; } __lzo_may_alias; -typedef struct lzo_memops_TU2_struct lzo_memops_TU2; -#endif -#ifndef lzo_memops_TU2p -#define lzo_memops_TU2p lzo_memops_TU2 * -#endif -#endif -#ifndef lzo_memops_TU4p -#if (LZO_OPT_UNALIGNED32) -typedef lzo_uint32_t __lzo_may_alias lzo_memops_TU4; -#define lzo_memops_TU4p volatile lzo_memops_TU4 __LZO_MMODEL * -#elif defined(__lzo_byte_struct) -__lzo_byte_struct(lzo_memops_TU4_struct,4) -typedef struct lzo_memops_TU4_struct lzo_memops_TU4; -#else -struct lzo_memops_TU4_struct { unsigned char a[4]; } __lzo_may_alias; -typedef struct lzo_memops_TU4_struct lzo_memops_TU4; -#endif -#ifndef lzo_memops_TU4p -#define lzo_memops_TU4p lzo_memops_TU4 __LZO_MMODEL * -#endif -#endif -#ifndef lzo_memops_TU8p -#if (LZO_OPT_UNALIGNED64) -typedef lzo_uint64_t __lzo_may_alias lzo_memops_TU8; -#define lzo_memops_TU8p volatile lzo_memops_TU8 __LZO_MMODEL * -#elif defined(__lzo_byte_struct) -__lzo_byte_struct(lzo_memops_TU8_struct,8) -typedef struct lzo_memops_TU8_struct lzo_memops_TU8; -#else -struct lzo_memops_TU8_struct { unsigned char a[8]; } __lzo_may_alias; -typedef struct lzo_memops_TU8_struct lzo_memops_TU8; -#endif -#ifndef lzo_memops_TU8p -#define lzo_memops_TU8p lzo_memops_TU8 __LZO_MMODEL * -#endif -#endif -#ifndef lzo_memops_set_TU1p -#define lzo_memops_set_TU1p volatile lzo_memops_TU1p -#endif -#ifndef lzo_memops_move_TU1p -#define lzo_memops_move_TU1p lzo_memops_TU1p -#endif -#define LZO_MEMOPS_SET1(dd,cc) \ - LZO_BLOCK_BEGIN \ - lzo_memops_set_TU1p d__1 = (lzo_memops_set_TU1p) (lzo_memops_TU0p) (dd); \ - d__1[0] = LZO_BYTE(cc); \ - LZO_BLOCK_END -#define LZO_MEMOPS_SET2(dd,cc) \ - LZO_BLOCK_BEGIN \ - lzo_memops_set_TU1p d__2 = (lzo_memops_set_TU1p) (lzo_memops_TU0p) (dd); \ - d__2[0] = LZO_BYTE(cc); d__2[1] = LZO_BYTE(cc); \ - LZO_BLOCK_END -#define LZO_MEMOPS_SET3(dd,cc) \ - LZO_BLOCK_BEGIN \ - lzo_memops_set_TU1p d__3 = (lzo_memops_set_TU1p) (lzo_memops_TU0p) (dd); \ - d__3[0] = LZO_BYTE(cc); d__3[1] = LZO_BYTE(cc); d__3[2] = LZO_BYTE(cc); \ - LZO_BLOCK_END -#define LZO_MEMOPS_SET4(dd,cc) \ - LZO_BLOCK_BEGIN \ - lzo_memops_set_TU1p d__4 = (lzo_memops_set_TU1p) (lzo_memops_TU0p) (dd); \ - d__4[0] = LZO_BYTE(cc); d__4[1] = LZO_BYTE(cc); d__4[2] = LZO_BYTE(cc); d__4[3] = LZO_BYTE(cc); \ - LZO_BLOCK_END -#define LZO_MEMOPS_MOVE1(dd,ss) \ - LZO_BLOCK_BEGIN \ - lzo_memops_move_TU1p d__1 = (lzo_memops_move_TU1p) (lzo_memops_TU0p) (dd); \ - const lzo_memops_move_TU1p s__1 = (const lzo_memops_move_TU1p) (const lzo_memops_TU0p) (ss); \ - d__1[0] = s__1[0]; \ - LZO_BLOCK_END -#define LZO_MEMOPS_MOVE2(dd,ss) \ - LZO_BLOCK_BEGIN \ - lzo_memops_move_TU1p d__2 = (lzo_memops_move_TU1p) (lzo_memops_TU0p) (dd); \ - const lzo_memops_move_TU1p s__2 = (const lzo_memops_move_TU1p) (const lzo_memops_TU0p) (ss); \ - d__2[0] = s__2[0]; d__2[1] = s__2[1]; \ - LZO_BLOCK_END -#define LZO_MEMOPS_MOVE3(dd,ss) \ - LZO_BLOCK_BEGIN \ - lzo_memops_move_TU1p d__3 = (lzo_memops_move_TU1p) (lzo_memops_TU0p) (dd); \ - const lzo_memops_move_TU1p s__3 = (const lzo_memops_move_TU1p) (const lzo_memops_TU0p) (ss); \ - d__3[0] = s__3[0]; d__3[1] = s__3[1]; d__3[2] = s__3[2]; \ - LZO_BLOCK_END -#define LZO_MEMOPS_MOVE4(dd,ss) \ - LZO_BLOCK_BEGIN \ - lzo_memops_move_TU1p d__4 = (lzo_memops_move_TU1p) (lzo_memops_TU0p) (dd); \ - const lzo_memops_move_TU1p s__4 = (const lzo_memops_move_TU1p) (const lzo_memops_TU0p) (ss); \ - d__4[0] = s__4[0]; d__4[1] = s__4[1]; d__4[2] = s__4[2]; d__4[3] = s__4[3]; \ - LZO_BLOCK_END -#define LZO_MEMOPS_MOVE8(dd,ss) \ - LZO_BLOCK_BEGIN \ - lzo_memops_move_TU1p d__8 = (lzo_memops_move_TU1p) (lzo_memops_TU0p) (dd); \ - const lzo_memops_move_TU1p s__8 = (const lzo_memops_move_TU1p) (const lzo_memops_TU0p) (ss); \ - d__8[0] = s__8[0]; d__8[1] = s__8[1]; d__8[2] = s__8[2]; d__8[3] = s__8[3]; \ - d__8[4] = s__8[4]; d__8[5] = s__8[5]; d__8[6] = s__8[6]; d__8[7] = s__8[7]; \ - LZO_BLOCK_END -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(*(lzo_memops_TU1p)0)==1) -#define LZO_MEMOPS_COPY1(dd,ss) LZO_MEMOPS_MOVE1(dd,ss) -#if (LZO_OPT_UNALIGNED16) -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(*(lzo_memops_TU2p)0)==2) -#define LZO_MEMOPS_COPY2(dd,ss) \ - * (lzo_memops_TU2p) (lzo_memops_TU0p) (dd) = * (const lzo_memops_TU2p) (const lzo_memops_TU0p) (ss) -#elif defined(lzo_memops_tcheck__) -#define LZO_MEMOPS_COPY2(dd,ss) \ - LZO_BLOCK_BEGIN if (lzo_memops_tcheck__(lzo_memops_TU2,2,1)) { \ - * (lzo_memops_TU2p) (lzo_memops_TU0p) (dd) = * (const lzo_memops_TU2p) (const lzo_memops_TU0p) (ss); \ - } else { LZO_MEMOPS_MOVE2(dd,ss); } LZO_BLOCK_END -#else -#define LZO_MEMOPS_COPY2(dd,ss) LZO_MEMOPS_MOVE2(dd,ss) -#endif -#if (LZO_OPT_UNALIGNED32) -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(*(lzo_memops_TU4p)0)==4) -#define LZO_MEMOPS_COPY4(dd,ss) \ - * (lzo_memops_TU4p) (lzo_memops_TU0p) (dd) = * (const lzo_memops_TU4p) (const lzo_memops_TU0p) (ss) -#elif defined(lzo_memops_tcheck__) -#define LZO_MEMOPS_COPY4(dd,ss) \ - LZO_BLOCK_BEGIN if (lzo_memops_tcheck__(lzo_memops_TU4,4,1)) { \ - * (lzo_memops_TU4p) (lzo_memops_TU0p) (dd) = * (const lzo_memops_TU4p) (const lzo_memops_TU0p) (ss); \ - } else { LZO_MEMOPS_MOVE4(dd,ss); } LZO_BLOCK_END -#else -#define LZO_MEMOPS_COPY4(dd,ss) LZO_MEMOPS_MOVE4(dd,ss) -#endif -#if (LZO_WORDSIZE != 8) -#define LZO_MEMOPS_COPY8(dd,ss) \ - LZO_BLOCK_BEGIN LZO_MEMOPS_COPY4(dd,ss); LZO_MEMOPS_COPY4((lzo_memops_TU1p)(lzo_memops_TU0p)(dd)+4,(const lzo_memops_TU1p)(const lzo_memops_TU0p)(ss)+4); LZO_BLOCK_END -#else -#if (LZO_OPT_UNALIGNED64) -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(*(lzo_memops_TU8p)0)==8) -#define LZO_MEMOPS_COPY8(dd,ss) \ - * (lzo_memops_TU8p) (lzo_memops_TU0p) (dd) = * (const lzo_memops_TU8p) (const lzo_memops_TU0p) (ss) -#elif (LZO_OPT_UNALIGNED32) -#define LZO_MEMOPS_COPY8(dd,ss) \ - LZO_BLOCK_BEGIN LZO_MEMOPS_COPY4(dd,ss); LZO_MEMOPS_COPY4((lzo_memops_TU1p)(lzo_memops_TU0p)(dd)+4,(const lzo_memops_TU1p)(const lzo_memops_TU0p)(ss)+4); LZO_BLOCK_END -#elif defined(lzo_memops_tcheck__) -#define LZO_MEMOPS_COPY8(dd,ss) \ - LZO_BLOCK_BEGIN if (lzo_memops_tcheck__(lzo_memops_TU8,8,1)) { \ - * (lzo_memops_TU8p) (lzo_memops_TU0p) (dd) = * (const lzo_memops_TU8p) (const lzo_memops_TU0p) (ss); \ - } else { LZO_MEMOPS_MOVE8(dd,ss); } LZO_BLOCK_END -#else -#define LZO_MEMOPS_COPY8(dd,ss) LZO_MEMOPS_MOVE8(dd,ss) -#endif -#endif -#define LZO_MEMOPS_COPYN(dd,ss,nn) \ - LZO_BLOCK_BEGIN \ - lzo_memops_TU1p d__n = (lzo_memops_TU1p) (lzo_memops_TU0p) (dd); \ - const lzo_memops_TU1p s__n = (const lzo_memops_TU1p) (const lzo_memops_TU0p) (ss); \ - lzo_uint n__n = (nn); \ - while ((void)0, n__n >= 8) { LZO_MEMOPS_COPY8(d__n, s__n); d__n += 8; s__n += 8; n__n -= 8; } \ - if ((void)0, n__n >= 4) { LZO_MEMOPS_COPY4(d__n, s__n); d__n += 4; s__n += 4; n__n -= 4; } \ - if ((void)0, n__n > 0) do { *d__n++ = *s__n++; } while (--n__n > 0); \ - LZO_BLOCK_END - -__lzo_static_forceinline lzo_uint16_t lzo_memops_get_le16(const lzo_voidp ss) -{ - lzo_uint16_t v; -#if (LZO_ABI_LITTLE_ENDIAN) - LZO_MEMOPS_COPY2(&v, ss); -#elif (LZO_OPT_UNALIGNED16 && LZO_ARCH_POWERPC && LZO_ABI_BIG_ENDIAN) && (LZO_ASM_SYNTAX_GNUC) - const lzo_memops_TU2p s = (const lzo_memops_TU2p) ss; - unsigned long vv; - __asm__("lhbrx %0,0,%1" : "=r" (vv) : "r" (s), "m" (*s)); - v = (lzo_uint16_t) vv; -#else - const lzo_memops_TU1p s = (const lzo_memops_TU1p) ss; - v = (lzo_uint16_t) (((lzo_uint16_t)s[0]) | ((lzo_uint16_t)s[1] << 8)); -#endif - return v; -} -#if (LZO_OPT_UNALIGNED16) && (LZO_ABI_LITTLE_ENDIAN) -#define LZO_MEMOPS_GET_LE16(ss) (* (const lzo_memops_TU2p) (const lzo_memops_TU0p) (ss)) -#else -#define LZO_MEMOPS_GET_LE16(ss) lzo_memops_get_le16(ss) -#endif - -__lzo_static_forceinline lzo_uint32_t lzo_memops_get_le32(const lzo_voidp ss) -{ - lzo_uint32_t v; -#if (LZO_ABI_LITTLE_ENDIAN) - LZO_MEMOPS_COPY4(&v, ss); -#elif (LZO_OPT_UNALIGNED32 && LZO_ARCH_POWERPC && LZO_ABI_BIG_ENDIAN) && (LZO_ASM_SYNTAX_GNUC) - const lzo_memops_TU4p s = (const lzo_memops_TU4p) ss; - unsigned long vv; - __asm__("lwbrx %0,0,%1" : "=r" (vv) : "r" (s), "m" (*s)); - v = (lzo_uint32_t) vv; -#else - const lzo_memops_TU1p s = (const lzo_memops_TU1p) ss; - v = (lzo_uint32_t) (((lzo_uint32_t)s[0]) | ((lzo_uint32_t)s[1] << 8) | ((lzo_uint32_t)s[2] << 16) | ((lzo_uint32_t)s[3] << 24)); -#endif - return v; -} -#if (LZO_OPT_UNALIGNED32) && (LZO_ABI_LITTLE_ENDIAN) -#define LZO_MEMOPS_GET_LE32(ss) (* (const lzo_memops_TU4p) (const lzo_memops_TU0p) (ss)) -#else -#define LZO_MEMOPS_GET_LE32(ss) lzo_memops_get_le32(ss) -#endif - -#if (LZO_OPT_UNALIGNED64) && (LZO_ABI_LITTLE_ENDIAN) -#define LZO_MEMOPS_GET_LE64(ss) (* (const lzo_memops_TU8p) (const lzo_memops_TU0p) (ss)) -#endif - -__lzo_static_forceinline lzo_uint16_t lzo_memops_get_ne16(const lzo_voidp ss) -{ - lzo_uint16_t v; - LZO_MEMOPS_COPY2(&v, ss); - return v; -} -#if (LZO_OPT_UNALIGNED16) -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(*(lzo_memops_TU2p)0)==2) -#define LZO_MEMOPS_GET_NE16(ss) (* (const lzo_memops_TU2p) (const lzo_memops_TU0p) (ss)) -#else -#define LZO_MEMOPS_GET_NE16(ss) lzo_memops_get_ne16(ss) -#endif - -__lzo_static_forceinline lzo_uint32_t lzo_memops_get_ne32(const lzo_voidp ss) -{ - lzo_uint32_t v; - LZO_MEMOPS_COPY4(&v, ss); - return v; -} -#if (LZO_OPT_UNALIGNED32) -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(*(lzo_memops_TU4p)0)==4) -#define LZO_MEMOPS_GET_NE32(ss) (* (const lzo_memops_TU4p) (const lzo_memops_TU0p) (ss)) -#else -#define LZO_MEMOPS_GET_NE32(ss) lzo_memops_get_ne32(ss) -#endif - -#if (LZO_OPT_UNALIGNED64) -LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(*(lzo_memops_TU8p)0)==8) -#define LZO_MEMOPS_GET_NE64(ss) (* (const lzo_memops_TU8p) (const lzo_memops_TU0p) (ss)) -#endif - -__lzo_static_forceinline void lzo_memops_put_le16(lzo_voidp dd, lzo_uint16_t vv) -{ -#if (LZO_ABI_LITTLE_ENDIAN) - LZO_MEMOPS_COPY2(dd, &vv); -#elif (LZO_OPT_UNALIGNED16 && LZO_ARCH_POWERPC && LZO_ABI_BIG_ENDIAN) && (LZO_ASM_SYNTAX_GNUC) - lzo_memops_TU2p d = (lzo_memops_TU2p) dd; - unsigned long v = vv; - __asm__("sthbrx %2,0,%1" : "=m" (*d) : "r" (d), "r" (v)); -#else - lzo_memops_TU1p d = (lzo_memops_TU1p) dd; - d[0] = LZO_BYTE((vv ) & 0xff); - d[1] = LZO_BYTE((vv >> 8) & 0xff); -#endif -} -#if (LZO_OPT_UNALIGNED16) && (LZO_ABI_LITTLE_ENDIAN) -#define LZO_MEMOPS_PUT_LE16(dd,vv) (* (lzo_memops_TU2p) (lzo_memops_TU0p) (dd) = (vv)) -#else -#define LZO_MEMOPS_PUT_LE16(dd,vv) lzo_memops_put_le16(dd,vv) -#endif - -__lzo_static_forceinline void lzo_memops_put_le32(lzo_voidp dd, lzo_uint32_t vv) -{ -#if (LZO_ABI_LITTLE_ENDIAN) - LZO_MEMOPS_COPY4(dd, &vv); -#elif (LZO_OPT_UNALIGNED32 && LZO_ARCH_POWERPC && LZO_ABI_BIG_ENDIAN) && (LZO_ASM_SYNTAX_GNUC) - lzo_memops_TU4p d = (lzo_memops_TU4p) dd; - unsigned long v = vv; - __asm__("stwbrx %2,0,%1" : "=m" (*d) : "r" (d), "r" (v)); -#else - lzo_memops_TU1p d = (lzo_memops_TU1p) dd; - d[0] = LZO_BYTE((vv ) & 0xff); - d[1] = LZO_BYTE((vv >> 8) & 0xff); - d[2] = LZO_BYTE((vv >> 16) & 0xff); - d[3] = LZO_BYTE((vv >> 24) & 0xff); -#endif -} -#if (LZO_OPT_UNALIGNED32) && (LZO_ABI_LITTLE_ENDIAN) -#define LZO_MEMOPS_PUT_LE32(dd,vv) (* (lzo_memops_TU4p) (lzo_memops_TU0p) (dd) = (vv)) -#else -#define LZO_MEMOPS_PUT_LE32(dd,vv) lzo_memops_put_le32(dd,vv) -#endif - -__lzo_static_forceinline void lzo_memops_put_ne16(lzo_voidp dd, lzo_uint16_t vv) -{ - LZO_MEMOPS_COPY2(dd, &vv); -} -#if (LZO_OPT_UNALIGNED16) -#define LZO_MEMOPS_PUT_NE16(dd,vv) (* (lzo_memops_TU2p) (lzo_memops_TU0p) (dd) = (vv)) -#else -#define LZO_MEMOPS_PUT_NE16(dd,vv) lzo_memops_put_ne16(dd,vv) -#endif - -__lzo_static_forceinline void lzo_memops_put_ne32(lzo_voidp dd, lzo_uint32_t vv) -{ - LZO_MEMOPS_COPY4(dd, &vv); -} -#if (LZO_OPT_UNALIGNED32) -#define LZO_MEMOPS_PUT_NE32(dd,vv) (* (lzo_memops_TU4p) (lzo_memops_TU0p) (dd) = (vv)) -#else -#define LZO_MEMOPS_PUT_NE32(dd,vv) lzo_memops_put_ne32(dd,vv) -#endif - -lzo_unused_funcs_impl(void, lzo_memops_unused_funcs)(void) -{ - LZO_UNUSED_FUNC(lzo_memops_unused_funcs); - LZO_UNUSED_FUNC(lzo_memops_get_le16); - LZO_UNUSED_FUNC(lzo_memops_get_le32); - LZO_UNUSED_FUNC(lzo_memops_get_ne16); - LZO_UNUSED_FUNC(lzo_memops_get_ne32); - LZO_UNUSED_FUNC(lzo_memops_put_le16); - LZO_UNUSED_FUNC(lzo_memops_put_le32); - LZO_UNUSED_FUNC(lzo_memops_put_ne16); - LZO_UNUSED_FUNC(lzo_memops_put_ne32); -} - -#endif - -#ifndef UA_SET1 -#define UA_SET1 LZO_MEMOPS_SET1 -#endif -#ifndef UA_SET2 -#define UA_SET2 LZO_MEMOPS_SET2 -#endif -#ifndef UA_SET3 -#define UA_SET3 LZO_MEMOPS_SET3 -#endif -#ifndef UA_SET4 -#define UA_SET4 LZO_MEMOPS_SET4 -#endif -#ifndef UA_MOVE1 -#define UA_MOVE1 LZO_MEMOPS_MOVE1 -#endif -#ifndef UA_MOVE2 -#define UA_MOVE2 LZO_MEMOPS_MOVE2 -#endif -#ifndef UA_MOVE3 -#define UA_MOVE3 LZO_MEMOPS_MOVE3 -#endif -#ifndef UA_MOVE4 -#define UA_MOVE4 LZO_MEMOPS_MOVE4 -#endif -#ifndef UA_MOVE8 -#define UA_MOVE8 LZO_MEMOPS_MOVE8 -#endif -#ifndef UA_COPY1 -#define UA_COPY1 LZO_MEMOPS_COPY1 -#endif -#ifndef UA_COPY2 -#define UA_COPY2 LZO_MEMOPS_COPY2 -#endif -#ifndef UA_COPY3 -#define UA_COPY3 LZO_MEMOPS_COPY3 -#endif -#ifndef UA_COPY4 -#define UA_COPY4 LZO_MEMOPS_COPY4 -#endif -#ifndef UA_COPY8 -#define UA_COPY8 LZO_MEMOPS_COPY8 -#endif -#ifndef UA_COPYN -#define UA_COPYN LZO_MEMOPS_COPYN -#endif -#ifndef UA_COPYN_X -#define UA_COPYN_X LZO_MEMOPS_COPYN -#endif -#ifndef UA_GET_LE16 -#define UA_GET_LE16 LZO_MEMOPS_GET_LE16 -#endif -#ifndef UA_GET_LE32 -#define UA_GET_LE32 LZO_MEMOPS_GET_LE32 -#endif -#ifdef LZO_MEMOPS_GET_LE64 -#ifndef UA_GET_LE64 -#define UA_GET_LE64 LZO_MEMOPS_GET_LE64 -#endif -#endif -#ifndef UA_GET_NE16 -#define UA_GET_NE16 LZO_MEMOPS_GET_NE16 -#endif -#ifndef UA_GET_NE32 -#define UA_GET_NE32 LZO_MEMOPS_GET_NE32 -#endif -#ifdef LZO_MEMOPS_GET_NE64 -#ifndef UA_GET_NE64 -#define UA_GET_NE64 LZO_MEMOPS_GET_NE64 -#endif -#endif -#ifndef UA_PUT_LE16 -#define UA_PUT_LE16 LZO_MEMOPS_PUT_LE16 -#endif -#ifndef UA_PUT_LE32 -#define UA_PUT_LE32 LZO_MEMOPS_PUT_LE32 -#endif -#ifndef UA_PUT_NE16 -#define UA_PUT_NE16 LZO_MEMOPS_PUT_NE16 -#endif -#ifndef UA_PUT_NE32 -#define UA_PUT_NE32 LZO_MEMOPS_PUT_NE32 -#endif - -#define MEMCPY8_DS(dest,src,len) \ - lzo_memcpy(dest,src,len); dest += len; src += len - -#define BZERO8_PTR(s,l,n) \ - lzo_memset((lzo_voidp)(s),0,(lzo_uint)(l)*(n)) - -#define MEMCPY_DS(dest,src,len) \ - do *dest++ = *src++; while (--len > 0) - -LZO_EXTERN(const lzo_bytep) lzo_copyright(void); - -#ifndef __LZO_PTR_H -#define __LZO_PTR_H 1 - -#ifdef __cplusplus -extern "C" { -#endif - -#if (LZO_ARCH_I086) -#error "LZO_ARCH_I086 is unsupported" -#elif (LZO_MM_PVP) -#error "LZO_MM_PVP is unsupported" -#else -#define PTR(a) ((lzo_uintptr_t) (a)) -#define PTR_LINEAR(a) PTR(a) -#define PTR_ALIGNED_4(a) ((PTR_LINEAR(a) & 3) == 0) -#define PTR_ALIGNED_8(a) ((PTR_LINEAR(a) & 7) == 0) -#define PTR_ALIGNED2_4(a,b) (((PTR_LINEAR(a) | PTR_LINEAR(b)) & 3) == 0) -#define PTR_ALIGNED2_8(a,b) (((PTR_LINEAR(a) | PTR_LINEAR(b)) & 7) == 0) -#endif - -#define PTR_LT(a,b) (PTR(a) < PTR(b)) -#define PTR_GE(a,b) (PTR(a) >= PTR(b)) -#define PTR_DIFF(a,b) (PTR(a) - PTR(b)) -#define pd(a,b) ((lzo_uint) ((a)-(b))) - -LZO_EXTERN(lzo_uintptr_t) -__lzo_ptr_linear(const lzo_voidp ptr); - -typedef union -{ - char a_char; - unsigned char a_uchar; - short a_short; - unsigned short a_ushort; - int a_int; - unsigned int a_uint; - long a_long; - unsigned long a_ulong; - lzo_int a_lzo_int; - lzo_uint a_lzo_uint; - lzo_xint a_lzo_xint; - lzo_int16_t a_lzo_int16_t; - lzo_uint16_t a_lzo_uint16_t; - lzo_int32_t a_lzo_int32_t; - lzo_uint32_t a_lzo_uint32_t; -#if defined(lzo_uint64_t) - lzo_int64_t a_lzo_int64_t; - lzo_uint64_t a_lzo_uint64_t; -#endif - size_t a_size_t; - ptrdiff_t a_ptrdiff_t; - lzo_uintptr_t a_lzo_uintptr_t; - void * a_void_p; - char * a_char_p; - unsigned char * a_uchar_p; - const void * a_c_void_p; - const char * a_c_char_p; - const unsigned char * a_c_uchar_p; - lzo_voidp a_lzo_voidp; - lzo_bytep a_lzo_bytep; - const lzo_voidp a_c_lzo_voidp; - const lzo_bytep a_c_lzo_bytep; -} -lzo_full_align_t; - -#ifdef __cplusplus -} -#endif - -#endif - -#ifndef LZO_DETERMINISTIC -#define LZO_DETERMINISTIC 1 -#endif - -#ifndef LZO_DICT_USE_PTR -#define LZO_DICT_USE_PTR 1 -#endif - -#if (LZO_DICT_USE_PTR) -# define lzo_dict_t const lzo_bytep -# define lzo_dict_p lzo_dict_t * -#else -# define lzo_dict_t lzo_uint -# define lzo_dict_p lzo_dict_t * -#endif - -#endif - -#if !defined(MINILZO_CFG_SKIP_LZO_PTR) - -LZO_PUBLIC(lzo_uintptr_t) -__lzo_ptr_linear(const lzo_voidp ptr) -{ - lzo_uintptr_t p; - -#if (LZO_ARCH_I086) -#error "LZO_ARCH_I086 is unsupported" -#elif (LZO_MM_PVP) -#error "LZO_MM_PVP is unsupported" -#else - p = (lzo_uintptr_t) PTR_LINEAR(ptr); -#endif - - return p; -} - -LZO_PUBLIC(unsigned) -__lzo_align_gap(const lzo_voidp ptr, lzo_uint size) -{ -#if (__LZO_UINTPTR_T_IS_POINTER) -#error "__LZO_UINTPTR_T_IS_POINTER is unsupported" -#else - lzo_uintptr_t p, n; - if (size < 2) return 0; - p = __lzo_ptr_linear(ptr); -#if 0 - n = (((p + size - 1) / size) * size) - p; -#else - if ((size & (size - 1)) != 0) - return 0; - n = size; n = ((p + n - 1) & ~(n - 1)) - p; -#endif -#endif - assert((long)n >= 0); - assert(n <= size); - return (unsigned)n; -} - -#endif -#if !defined(MINILZO_CFG_SKIP_LZO_UTIL) - -/* If you use the LZO library in a product, I would appreciate that you - * keep this copyright string in the executable of your product. - */ - -static const char lzo_copyright_[] = -#if !defined(__LZO_IN_MINLZO) - LZO_VERSION_STRING; -#else - "\r\n\n" - "LZO data compression library.\n" - "$Copyright: LZO Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer\n" - "<markus@oberhumer.com>\n" - "http://www.oberhumer.com $\n\n" - "$Id: LZO version: v" LZO_VERSION_STRING ", " LZO_VERSION_DATE " $\n" - "$Info: " LZO_INFO_STRING " $\n"; -#endif -static const char lzo_version_string_[] = LZO_VERSION_STRING; -static const char lzo_version_date_[] = LZO_VERSION_DATE; - -LZO_PUBLIC(const lzo_bytep) -lzo_copyright(void) -{ - return (const lzo_bytep) lzo_copyright_; -} - -LZO_PUBLIC(unsigned) -lzo_version(void) -{ - return LZO_VERSION; -} - -LZO_PUBLIC(const char *) -lzo_version_string(void) -{ - return lzo_version_string_; -} - -LZO_PUBLIC(const char *) -lzo_version_date(void) -{ - return lzo_version_date_; -} - -LZO_PUBLIC(const lzo_charp) -_lzo_version_string(void) -{ - return lzo_version_string_; -} - -LZO_PUBLIC(const lzo_charp) -_lzo_version_date(void) -{ - return lzo_version_date_; -} - -#define LZO_BASE 65521u -#define LZO_NMAX 5552 - -#define LZO_DO1(buf,i) s1 += buf[i]; s2 += s1 -#define LZO_DO2(buf,i) LZO_DO1(buf,i); LZO_DO1(buf,i+1) -#define LZO_DO4(buf,i) LZO_DO2(buf,i); LZO_DO2(buf,i+2) -#define LZO_DO8(buf,i) LZO_DO4(buf,i); LZO_DO4(buf,i+4) -#define LZO_DO16(buf,i) LZO_DO8(buf,i); LZO_DO8(buf,i+8) - -LZO_PUBLIC(lzo_uint32_t) -lzo_adler32(lzo_uint32_t adler, const lzo_bytep buf, lzo_uint len) -{ - lzo_uint32_t s1 = adler & 0xffff; - lzo_uint32_t s2 = (adler >> 16) & 0xffff; - unsigned k; - - if (buf == NULL) - return 1; - - while (len > 0) - { - k = len < LZO_NMAX ? (unsigned) len : LZO_NMAX; - len -= k; - if (k >= 16) do - { - LZO_DO16(buf,0); - buf += 16; - k -= 16; - } while (k >= 16); - if (k != 0) do - { - s1 += *buf++; - s2 += s1; - } while (--k > 0); - s1 %= LZO_BASE; - s2 %= LZO_BASE; - } - return (s2 << 16) | s1; -} - -#undef LZO_DO1 -#undef LZO_DO2 -#undef LZO_DO4 -#undef LZO_DO8 -#undef LZO_DO16 - -#endif -#if !defined(MINILZO_CFG_SKIP_LZO_STRING) -#undef lzo_memcmp -#undef lzo_memcpy -#undef lzo_memmove -#undef lzo_memset -#if !defined(__LZO_MMODEL_HUGE) -# undef LZO_HAVE_MM_HUGE_PTR -#endif -#define lzo_hsize_t lzo_uint -#define lzo_hvoid_p lzo_voidp -#define lzo_hbyte_p lzo_bytep -#define LZOLIB_PUBLIC(r,f) LZO_PUBLIC(r) f -#define lzo_hmemcmp lzo_memcmp -#define lzo_hmemcpy lzo_memcpy -#define lzo_hmemmove lzo_memmove -#define lzo_hmemset lzo_memset -#define __LZOLIB_HMEMCPY_CH_INCLUDED 1 -#if !defined(LZOLIB_PUBLIC) -# define LZOLIB_PUBLIC(r,f) r __LZOLIB_FUNCNAME(f) -#endif -LZOLIB_PUBLIC(int, lzo_hmemcmp) (const lzo_hvoid_p s1, const lzo_hvoid_p s2, lzo_hsize_t len) -{ -#if (LZO_HAVE_MM_HUGE_PTR) || !(HAVE_MEMCMP) - const lzo_hbyte_p p1 = LZO_STATIC_CAST(const lzo_hbyte_p, s1); - const lzo_hbyte_p p2 = LZO_STATIC_CAST(const lzo_hbyte_p, s2); - if __lzo_likely(len > 0) do - { - int d = *p1 - *p2; - if (d != 0) - return d; - p1++; p2++; - } while __lzo_likely(--len > 0); - return 0; -#else - return memcmp(s1, s2, len); -#endif -} -LZOLIB_PUBLIC(lzo_hvoid_p, lzo_hmemcpy) (lzo_hvoid_p dest, const lzo_hvoid_p src, lzo_hsize_t len) -{ -#if (LZO_HAVE_MM_HUGE_PTR) || !(HAVE_MEMCPY) - lzo_hbyte_p p1 = LZO_STATIC_CAST(lzo_hbyte_p, dest); - const lzo_hbyte_p p2 = LZO_STATIC_CAST(const lzo_hbyte_p, src); - if (!(len > 0) || p1 == p2) - return dest; - do - *p1++ = *p2++; - while __lzo_likely(--len > 0); - return dest; -#else - return memcpy(dest, src, len); -#endif -} -LZOLIB_PUBLIC(lzo_hvoid_p, lzo_hmemmove) (lzo_hvoid_p dest, const lzo_hvoid_p src, lzo_hsize_t len) -{ -#if (LZO_HAVE_MM_HUGE_PTR) || !(HAVE_MEMMOVE) - lzo_hbyte_p p1 = LZO_STATIC_CAST(lzo_hbyte_p, dest); - const lzo_hbyte_p p2 = LZO_STATIC_CAST(const lzo_hbyte_p, src); - if (!(len > 0) || p1 == p2) - return dest; - if (p1 < p2) - { - do - *p1++ = *p2++; - while __lzo_likely(--len > 0); - } - else - { - p1 += len; - p2 += len; - do - *--p1 = *--p2; - while __lzo_likely(--len > 0); - } - return dest; -#else - return memmove(dest, src, len); -#endif -} -LZOLIB_PUBLIC(lzo_hvoid_p, lzo_hmemset) (lzo_hvoid_p s, int cc, lzo_hsize_t len) -{ -#if (LZO_HAVE_MM_HUGE_PTR) || !(HAVE_MEMSET) - lzo_hbyte_p p = LZO_STATIC_CAST(lzo_hbyte_p, s); - unsigned char c = LZO_ITRUNC(unsigned char, cc); - if __lzo_likely(len > 0) do - *p++ = c; - while __lzo_likely(--len > 0); - return s; -#else - return memset(s, cc, len); -#endif -} -#undef LZOLIB_PUBLIC -#endif -#if !defined(MINILZO_CFG_SKIP_LZO_INIT) - -#if !defined(__LZO_IN_MINILZO) - -#define LZO_WANT_ACC_CHK_CH 1 -#undef LZOCHK_ASSERT - - LZOCHK_ASSERT((LZO_UINT32_C(1) << (int)(8*sizeof(LZO_UINT32_C(1))-1)) > 0) - LZOCHK_ASSERT_IS_SIGNED_T(lzo_int) - LZOCHK_ASSERT_IS_UNSIGNED_T(lzo_uint) -#if !(__LZO_UINTPTR_T_IS_POINTER) - LZOCHK_ASSERT_IS_UNSIGNED_T(lzo_uintptr_t) -#endif - LZOCHK_ASSERT(sizeof(lzo_uintptr_t) >= sizeof(lzo_voidp)) - LZOCHK_ASSERT_IS_UNSIGNED_T(lzo_xint) - -#endif -#undef LZOCHK_ASSERT - -union lzo_config_check_union { - lzo_uint a[2]; - unsigned char b[2*LZO_MAX(8,sizeof(lzo_uint))]; -#if defined(lzo_uint64_t) - lzo_uint64_t c[2]; -#endif -}; - -#if 0 -#define u2p(ptr,off) ((lzo_voidp) (((lzo_bytep)(lzo_voidp)(ptr)) + (off))) -#else -static __lzo_noinline lzo_voidp u2p(lzo_voidp ptr, lzo_uint off) -{ - return (lzo_voidp) ((lzo_bytep) ptr + off); -} -#endif - -LZO_PUBLIC(int) -_lzo_config_check(void) -{ -#if (LZO_CC_CLANG && (LZO_CC_CLANG >= 0x030100ul && LZO_CC_CLANG < 0x030300ul)) -# if 0 - volatile -# endif -#endif - union lzo_config_check_union u; - lzo_voidp p; - unsigned r = 1; - - u.a[0] = u.a[1] = 0; - p = u2p(&u, 0); - r &= ((* (lzo_bytep) p) == 0); -#if !(LZO_CFG_NO_CONFIG_CHECK) -#if (LZO_ABI_BIG_ENDIAN) - u.a[0] = u.a[1] = 0; u.b[sizeof(lzo_uint) - 1] = 128; - p = u2p(&u, 0); - r &= ((* (lzo_uintp) p) == 128); -#endif -#if (LZO_ABI_LITTLE_ENDIAN) - u.a[0] = u.a[1] = 0; u.b[0] = 128; - p = u2p(&u, 0); - r &= ((* (lzo_uintp) p) == 128); -#endif - u.a[0] = u.a[1] = 0; - u.b[0] = 1; u.b[3] = 2; - p = u2p(&u, 1); - r &= UA_GET_NE16(p) == 0; - r &= UA_GET_LE16(p) == 0; - u.b[1] = 128; - r &= UA_GET_LE16(p) == 128; - u.b[2] = 129; - r &= UA_GET_LE16(p) == LZO_UINT16_C(0x8180); -#if (LZO_ABI_BIG_ENDIAN) - r &= UA_GET_NE16(p) == LZO_UINT16_C(0x8081); -#endif -#if (LZO_ABI_LITTLE_ENDIAN) - r &= UA_GET_NE16(p) == LZO_UINT16_C(0x8180); -#endif - u.a[0] = u.a[1] = 0; - u.b[0] = 3; u.b[5] = 4; - p = u2p(&u, 1); - r &= UA_GET_NE32(p) == 0; - r &= UA_GET_LE32(p) == 0; - u.b[1] = 128; - r &= UA_GET_LE32(p) == 128; - u.b[2] = 129; u.b[3] = 130; u.b[4] = 131; - r &= UA_GET_LE32(p) == LZO_UINT32_C(0x83828180); -#if (LZO_ABI_BIG_ENDIAN) - r &= UA_GET_NE32(p) == LZO_UINT32_C(0x80818283); -#endif -#if (LZO_ABI_LITTLE_ENDIAN) - r &= UA_GET_NE32(p) == LZO_UINT32_C(0x83828180); -#endif -#if defined(UA_GET_NE64) - u.c[0] = u.c[1] = 0; - u.b[0] = 5; u.b[9] = 6; - p = u2p(&u, 1); - u.c[0] = u.c[1] = 0; - r &= UA_GET_NE64(p) == 0; -#if defined(UA_GET_LE64) - r &= UA_GET_LE64(p) == 0; - u.b[1] = 128; - r &= UA_GET_LE64(p) == 128; -#endif -#endif -#if defined(lzo_bitops_ctlz32) - { unsigned i = 0; lzo_uint32_t v; - for (v = 1; v != 0 && r == 1; v <<= 1, i++) { - r &= lzo_bitops_ctlz32(v) == 31 - i; - r &= lzo_bitops_ctlz32_func(v) == 31 - i; - }} -#endif -#if defined(lzo_bitops_ctlz64) - { unsigned i = 0; lzo_uint64_t v; - for (v = 1; v != 0 && r == 1; v <<= 1, i++) { - r &= lzo_bitops_ctlz64(v) == 63 - i; - r &= lzo_bitops_ctlz64_func(v) == 63 - i; - }} -#endif -#if defined(lzo_bitops_cttz32) - { unsigned i = 0; lzo_uint32_t v; - for (v = 1; v != 0 && r == 1; v <<= 1, i++) { - r &= lzo_bitops_cttz32(v) == i; - r &= lzo_bitops_cttz32_func(v) == i; - }} -#endif -#if defined(lzo_bitops_cttz64) - { unsigned i = 0; lzo_uint64_t v; - for (v = 1; v != 0 && r == 1; v <<= 1, i++) { - r &= lzo_bitops_cttz64(v) == i; - r &= lzo_bitops_cttz64_func(v) == i; - }} -#endif -#endif - LZO_UNUSED_FUNC(lzo_bitops_unused_funcs); - - return r == 1 ? LZO_E_OK : LZO_E_ERROR; -} - -LZO_PUBLIC(int) -__lzo_init_v2(unsigned v, int s1, int s2, int s3, int s4, int s5, - int s6, int s7, int s8, int s9) -{ - int r; - -#if defined(__LZO_IN_MINILZO) -#elif (LZO_CC_MSC && ((_MSC_VER) < 700)) -#else -#define LZO_WANT_ACC_CHK_CH 1 -#undef LZOCHK_ASSERT -#define LZOCHK_ASSERT(expr) LZO_COMPILE_TIME_ASSERT(expr) -#endif -#undef LZOCHK_ASSERT - - if (v == 0) - return LZO_E_ERROR; - - r = (s1 == -1 || s1 == (int) sizeof(short)) && - (s2 == -1 || s2 == (int) sizeof(int)) && - (s3 == -1 || s3 == (int) sizeof(long)) && - (s4 == -1 || s4 == (int) sizeof(lzo_uint32_t)) && - (s5 == -1 || s5 == (int) sizeof(lzo_uint)) && - (s6 == -1 || s6 == (int) lzo_sizeof_dict_t) && - (s7 == -1 || s7 == (int) sizeof(char *)) && - (s8 == -1 || s8 == (int) sizeof(lzo_voidp)) && - (s9 == -1 || s9 == (int) sizeof(lzo_callback_t)); - if (!r) - return LZO_E_ERROR; - - r = _lzo_config_check(); - if (r != LZO_E_OK) - return r; - - return r; -} - -#if !defined(__LZO_IN_MINILZO) - -#if (LZO_OS_WIN16 && LZO_CC_WATCOMC) && defined(__SW_BD) - -#if 0 -BOOL FAR PASCAL LibMain ( HANDLE hInstance, WORD wDataSegment, - WORD wHeapSize, LPSTR lpszCmdLine ) -#else -int __far __pascal LibMain ( int a, short b, short c, long d ) -#endif -{ - LZO_UNUSED(a); LZO_UNUSED(b); LZO_UNUSED(c); LZO_UNUSED(d); - return 1; -} - -#endif - -#endif - -#endif - -#define LZO1X 1 -#define LZO_EOF_CODE 1 -#define M2_MAX_OFFSET 0x0800 - -#if !defined(MINILZO_CFG_SKIP_LZO1X_1_COMPRESS) - -#if 1 && defined(UA_GET_LE32) -#undef LZO_DICT_USE_PTR -#define LZO_DICT_USE_PTR 0 -#undef lzo_dict_t -#define lzo_dict_t lzo_uint16_t -#endif - -#define LZO_NEED_DICT_H 1 -#ifndef D_BITS -#define D_BITS 14 -#endif -#define D_INDEX1(d,p) d = DM(DMUL(0x21,DX3(p,5,5,6)) >> 5) -#define D_INDEX2(d,p) d = (d & (D_MASK & 0x7ff)) ^ (D_HIGH | 0x1f) -#if 1 -#define DINDEX(dv,p) DM(((DMUL(0x1824429d,dv)) >> (32-D_BITS))) -#else -#define DINDEX(dv,p) DM((dv) + ((dv) >> (32-D_BITS))) -#endif - -#ifndef __LZO_CONFIG1X_H -#define __LZO_CONFIG1X_H 1 - -#if !defined(LZO1X) && !defined(LZO1Y) && !defined(LZO1Z) -# define LZO1X 1 -#endif - -#if !defined(__LZO_IN_MINILZO) -#include <lzo/lzo1x.h> -#endif - -#ifndef LZO_EOF_CODE -#define LZO_EOF_CODE 1 -#endif -#undef LZO_DETERMINISTIC - -#define M1_MAX_OFFSET 0x0400 -#ifndef M2_MAX_OFFSET -#define M2_MAX_OFFSET 0x0800 -#endif -#define M3_MAX_OFFSET 0x4000 -#define M4_MAX_OFFSET 0xbfff - -#define MX_MAX_OFFSET (M1_MAX_OFFSET + M2_MAX_OFFSET) - -#define M1_MIN_LEN 2 -#define M1_MAX_LEN 2 -#define M2_MIN_LEN 3 -#ifndef M2_MAX_LEN -#define M2_MAX_LEN 8 -#endif -#define M3_MIN_LEN 3 -#define M3_MAX_LEN 33 -#define M4_MIN_LEN 3 -#define M4_MAX_LEN 9 - -#define M1_MARKER 0 -#define M2_MARKER 64 -#define M3_MARKER 32 -#define M4_MARKER 16 - -#ifndef MIN_LOOKAHEAD -#define MIN_LOOKAHEAD (M2_MAX_LEN + 1) -#endif - -#if defined(LZO_NEED_DICT_H) - -#ifndef LZO_HASH -#define LZO_HASH LZO_HASH_LZO_INCREMENTAL_B -#endif -#define DL_MIN_LEN M2_MIN_LEN - -#ifndef __LZO_DICT_H -#define __LZO_DICT_H 1 - -#ifdef __cplusplus -extern "C" { -#endif - -#if !defined(D_BITS) && defined(DBITS) -# define D_BITS DBITS -#endif -#if !defined(D_BITS) -# error "D_BITS is not defined" -#endif -#if (D_BITS < 16) -# define D_SIZE LZO_SIZE(D_BITS) -# define D_MASK LZO_MASK(D_BITS) -#else -# define D_SIZE LZO_USIZE(D_BITS) -# define D_MASK LZO_UMASK(D_BITS) -#endif -#define D_HIGH ((D_MASK >> 1) + 1) - -#if !defined(DD_BITS) -# define DD_BITS 0 -#endif -#define DD_SIZE LZO_SIZE(DD_BITS) -#define DD_MASK LZO_MASK(DD_BITS) - -#if !defined(DL_BITS) -# define DL_BITS (D_BITS - DD_BITS) -#endif -#if (DL_BITS < 16) -# define DL_SIZE LZO_SIZE(DL_BITS) -# define DL_MASK LZO_MASK(DL_BITS) -#else -# define DL_SIZE LZO_USIZE(DL_BITS) -# define DL_MASK LZO_UMASK(DL_BITS) -#endif - -#if (D_BITS != DL_BITS + DD_BITS) -# error "D_BITS does not match" -#endif -#if (D_BITS < 6 || D_BITS > 18) -# error "invalid D_BITS" -#endif -#if (DL_BITS < 6 || DL_BITS > 20) -# error "invalid DL_BITS" -#endif -#if (DD_BITS < 0 || DD_BITS > 6) -# error "invalid DD_BITS" -#endif - -#if !defined(DL_MIN_LEN) -# define DL_MIN_LEN 3 -#endif -#if !defined(DL_SHIFT) -# define DL_SHIFT ((DL_BITS + (DL_MIN_LEN - 1)) / DL_MIN_LEN) -#endif - -#define LZO_HASH_GZIP 1 -#define LZO_HASH_GZIP_INCREMENTAL 2 -#define LZO_HASH_LZO_INCREMENTAL_A 3 -#define LZO_HASH_LZO_INCREMENTAL_B 4 - -#if !defined(LZO_HASH) -# error "choose a hashing strategy" -#endif - -#undef DM -#undef DX - -#if (DL_MIN_LEN == 3) -# define _DV2_A(p,shift1,shift2) \ - (((( (lzo_xint)((p)[0]) << shift1) ^ (p)[1]) << shift2) ^ (p)[2]) -# define _DV2_B(p,shift1,shift2) \ - (((( (lzo_xint)((p)[2]) << shift1) ^ (p)[1]) << shift2) ^ (p)[0]) -# define _DV3_B(p,shift1,shift2,shift3) \ - ((_DV2_B((p)+1,shift1,shift2) << (shift3)) ^ (p)[0]) -#elif (DL_MIN_LEN == 2) -# define _DV2_A(p,shift1,shift2) \ - (( (lzo_xint)(p[0]) << shift1) ^ p[1]) -# define _DV2_B(p,shift1,shift2) \ - (( (lzo_xint)(p[1]) << shift1) ^ p[2]) -#else -# error "invalid DL_MIN_LEN" -#endif -#define _DV_A(p,shift) _DV2_A(p,shift,shift) -#define _DV_B(p,shift) _DV2_B(p,shift,shift) -#define DA2(p,s1,s2) \ - (((((lzo_xint)((p)[2]) << (s2)) + (p)[1]) << (s1)) + (p)[0]) -#define DS2(p,s1,s2) \ - (((((lzo_xint)((p)[2]) << (s2)) - (p)[1]) << (s1)) - (p)[0]) -#define DX2(p,s1,s2) \ - (((((lzo_xint)((p)[2]) << (s2)) ^ (p)[1]) << (s1)) ^ (p)[0]) -#define DA3(p,s1,s2,s3) ((DA2((p)+1,s2,s3) << (s1)) + (p)[0]) -#define DS3(p,s1,s2,s3) ((DS2((p)+1,s2,s3) << (s1)) - (p)[0]) -#define DX3(p,s1,s2,s3) ((DX2((p)+1,s2,s3) << (s1)) ^ (p)[0]) -#define DMS(v,s) ((lzo_uint) (((v) & (D_MASK >> (s))) << (s))) -#define DM(v) DMS(v,0) - -#if (LZO_HASH == LZO_HASH_GZIP) -# define _DINDEX(dv,p) (_DV_A((p),DL_SHIFT)) - -#elif (LZO_HASH == LZO_HASH_GZIP_INCREMENTAL) -# define __LZO_HASH_INCREMENTAL 1 -# define DVAL_FIRST(dv,p) dv = _DV_A((p),DL_SHIFT) -# define DVAL_NEXT(dv,p) dv = (((dv) << DL_SHIFT) ^ p[2]) -# define _DINDEX(dv,p) (dv) -# define DVAL_LOOKAHEAD DL_MIN_LEN - -#elif (LZO_HASH == LZO_HASH_LZO_INCREMENTAL_A) -# define __LZO_HASH_INCREMENTAL 1 -# define DVAL_FIRST(dv,p) dv = _DV_A((p),5) -# define DVAL_NEXT(dv,p) \ - dv ^= (lzo_xint)(p[-1]) << (2*5); dv = (((dv) << 5) ^ p[2]) -# define _DINDEX(dv,p) ((DMUL(0x9f5f,dv)) >> 5) -# define DVAL_LOOKAHEAD DL_MIN_LEN - -#elif (LZO_HASH == LZO_HASH_LZO_INCREMENTAL_B) -# define __LZO_HASH_INCREMENTAL 1 -# define DVAL_FIRST(dv,p) dv = _DV_B((p),5) -# define DVAL_NEXT(dv,p) \ - dv ^= p[-1]; dv = (((dv) >> 5) ^ ((lzo_xint)(p[2]) << (2*5))) -# define _DINDEX(dv,p) ((DMUL(0x9f5f,dv)) >> 5) -# define DVAL_LOOKAHEAD DL_MIN_LEN - -#else -# error "choose a hashing strategy" -#endif - -#ifndef DINDEX -#define DINDEX(dv,p) ((lzo_uint)((_DINDEX(dv,p)) & DL_MASK) << DD_BITS) -#endif -#if !defined(DINDEX1) && defined(D_INDEX1) -#define DINDEX1 D_INDEX1 -#endif -#if !defined(DINDEX2) && defined(D_INDEX2) -#define DINDEX2 D_INDEX2 -#endif - -#if !defined(__LZO_HASH_INCREMENTAL) -# define DVAL_FIRST(dv,p) ((void) 0) -# define DVAL_NEXT(dv,p) ((void) 0) -# define DVAL_LOOKAHEAD 0 -#endif - -#if !defined(DVAL_ASSERT) -#if defined(__LZO_HASH_INCREMENTAL) && !defined(NDEBUG) -#if 1 && (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || (LZO_CC_GNUC >= 0x020700ul) || LZO_CC_INTELC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI) -static void __attribute__((__unused__)) -#else -static void -#endif -DVAL_ASSERT(lzo_xint dv, const lzo_bytep p) -{ - lzo_xint df; - DVAL_FIRST(df,(p)); - assert(DINDEX(dv,p) == DINDEX(df,p)); -} -#else -# define DVAL_ASSERT(dv,p) ((void) 0) -#endif -#endif - -#if (LZO_DICT_USE_PTR) -# define DENTRY(p,in) (p) -# define GINDEX(m_pos,m_off,dict,dindex,in) m_pos = dict[dindex] -#else -# define DENTRY(p,in) ((lzo_dict_t) pd(p, in)) -# define GINDEX(m_pos,m_off,dict,dindex,in) m_off = dict[dindex] -#endif - -#if (DD_BITS == 0) - -# define UPDATE_D(dict,drun,dv,p,in) dict[ DINDEX(dv,p) ] = DENTRY(p,in) -# define UPDATE_I(dict,drun,index,p,in) dict[index] = DENTRY(p,in) -# define UPDATE_P(ptr,drun,p,in) (ptr)[0] = DENTRY(p,in) - -#else - -# define UPDATE_D(dict,drun,dv,p,in) \ - dict[ DINDEX(dv,p) + drun++ ] = DENTRY(p,in); drun &= DD_MASK -# define UPDATE_I(dict,drun,index,p,in) \ - dict[ (index) + drun++ ] = DENTRY(p,in); drun &= DD_MASK -# define UPDATE_P(ptr,drun,p,in) \ - (ptr) [ drun++ ] = DENTRY(p,in); drun &= DD_MASK - -#endif - -#if (LZO_DICT_USE_PTR) - -#define LZO_CHECK_MPOS_DET(m_pos,m_off,in,ip,max_offset) \ - (m_pos == NULL || (m_off = pd(ip, m_pos)) > max_offset) - -#define LZO_CHECK_MPOS_NON_DET(m_pos,m_off,in,ip,max_offset) \ - (BOUNDS_CHECKING_OFF_IN_EXPR(( \ - m_pos = ip - (lzo_uint) PTR_DIFF(ip,m_pos), \ - PTR_LT(m_pos,in) || \ - (m_off = (lzo_uint) PTR_DIFF(ip,m_pos)) == 0 || \ - m_off > max_offset ))) - -#else - -#define LZO_CHECK_MPOS_DET(m_pos,m_off,in,ip,max_offset) \ - (m_off == 0 || \ - ((m_off = pd(ip, in) - m_off) > max_offset) || \ - (m_pos = (ip) - (m_off), 0) ) - -#define LZO_CHECK_MPOS_NON_DET(m_pos,m_off,in,ip,max_offset) \ - (pd(ip, in) <= m_off || \ - ((m_off = pd(ip, in) - m_off) > max_offset) || \ - (m_pos = (ip) - (m_off), 0) ) - -#endif - -#if (LZO_DETERMINISTIC) -# define LZO_CHECK_MPOS LZO_CHECK_MPOS_DET -#else -# define LZO_CHECK_MPOS LZO_CHECK_MPOS_NON_DET -#endif - -#ifdef __cplusplus -} -#endif - -#endif - -#endif - -#endif - -#define LZO_DETERMINISTIC !(LZO_DICT_USE_PTR) - -#ifndef DO_COMPRESS -#define DO_COMPRESS lzo1x_1_compress -#endif - -#if 1 && defined(DO_COMPRESS) && !defined(do_compress) -# define do_compress LZO_PP_ECONCAT2(DO_COMPRESS,_core) -#endif - -static __lzo_noinline lzo_uint -do_compress ( const lzo_bytep in , lzo_uint in_len, - lzo_bytep out, lzo_uintp out_len, - lzo_uint ti, lzo_voidp wrkmem) -{ - const lzo_bytep ip; - lzo_bytep op; - const lzo_bytep const in_end = in + in_len; - const lzo_bytep const ip_end = in + in_len - 20; - const lzo_bytep ii; - lzo_dict_p const dict = (lzo_dict_p) wrkmem; - - op = out; - ip = in; - ii = ip; - - ip += ti < 4 ? 4 - ti : 0; - for (;;) - { - const lzo_bytep m_pos; -#if !(LZO_DETERMINISTIC) - LZO_DEFINE_UNINITIALIZED_VAR(lzo_uint, m_off, 0); - lzo_uint m_len; - lzo_uint dindex; -next: - if __lzo_unlikely(ip >= ip_end) - break; - DINDEX1(dindex,ip); - GINDEX(m_pos,m_off,dict,dindex,in); - if (LZO_CHECK_MPOS_NON_DET(m_pos,m_off,in,ip,M4_MAX_OFFSET)) - goto literal; -#if 1 - if (m_off <= M2_MAX_OFFSET || m_pos[3] == ip[3]) - goto try_match; - DINDEX2(dindex,ip); -#endif - GINDEX(m_pos,m_off,dict,dindex,in); - if (LZO_CHECK_MPOS_NON_DET(m_pos,m_off,in,ip,M4_MAX_OFFSET)) - goto literal; - if (m_off <= M2_MAX_OFFSET || m_pos[3] == ip[3]) - goto try_match; - goto literal; - -try_match: -#if (LZO_OPT_UNALIGNED32) - if (UA_GET_NE32(m_pos) != UA_GET_NE32(ip)) -#else - if (m_pos[0] != ip[0] || m_pos[1] != ip[1] || m_pos[2] != ip[2] || m_pos[3] != ip[3]) -#endif - { -literal: - UPDATE_I(dict,0,dindex,ip,in); - ip += 1 + ((ip - ii) >> 5); - continue; - } - UPDATE_I(dict,0,dindex,ip,in); -#else - lzo_uint m_off; - lzo_uint m_len; - { - lzo_uint32_t dv; - lzo_uint dindex; -literal: - ip += 1 + ((ip - ii) >> 5); -next: - if __lzo_unlikely(ip >= ip_end) - break; - dv = UA_GET_LE32(ip); - dindex = DINDEX(dv,ip); - GINDEX(m_off,m_pos,in+dict,dindex,in); - UPDATE_I(dict,0,dindex,ip,in); - if __lzo_unlikely(dv != UA_GET_LE32(m_pos)) - goto literal; - } -#endif - - ii -= ti; ti = 0; - { - lzo_uint t = pd(ip,ii); - if (t != 0) - { - if (t <= 3) - { - op[-2] = LZO_BYTE(op[-2] | t); -#if (LZO_OPT_UNALIGNED32) - UA_COPY4(op, ii); - op += t; -#else - { do *op++ = *ii++; while (--t > 0); } -#endif - } -#if (LZO_OPT_UNALIGNED32) || (LZO_OPT_UNALIGNED64) - else if (t <= 16) - { - *op++ = LZO_BYTE(t - 3); - UA_COPY8(op, ii); - UA_COPY8(op+8, ii+8); - op += t; - } -#endif - else - { - if (t <= 18) - *op++ = LZO_BYTE(t - 3); - else - { - lzo_uint tt = t - 18; - *op++ = 0; - while __lzo_unlikely(tt > 255) - { - tt -= 255; - UA_SET1(op, 0); - op++; - } - assert(tt > 0); - *op++ = LZO_BYTE(tt); - } -#if (LZO_OPT_UNALIGNED32) || (LZO_OPT_UNALIGNED64) - do { - UA_COPY8(op, ii); - UA_COPY8(op+8, ii+8); - op += 16; ii += 16; t -= 16; - } while (t >= 16); if (t > 0) -#endif - { do *op++ = *ii++; while (--t > 0); } - } - } - } - m_len = 4; - { -#if (LZO_OPT_UNALIGNED64) - lzo_uint64_t v; - v = UA_GET_NE64(ip + m_len) ^ UA_GET_NE64(m_pos + m_len); - if __lzo_unlikely(v == 0) { - do { - m_len += 8; - v = UA_GET_NE64(ip + m_len) ^ UA_GET_NE64(m_pos + m_len); - if __lzo_unlikely(ip + m_len >= ip_end) - goto m_len_done; - } while (v == 0); - } -#if (LZO_ABI_BIG_ENDIAN) && defined(lzo_bitops_ctlz64) - m_len += lzo_bitops_ctlz64(v) / CHAR_BIT; -#elif (LZO_ABI_BIG_ENDIAN) - if ((v >> (64 - CHAR_BIT)) == 0) do { - v <<= CHAR_BIT; - m_len += 1; - } while ((v >> (64 - CHAR_BIT)) == 0); -#elif (LZO_ABI_LITTLE_ENDIAN) && defined(lzo_bitops_cttz64) - m_len += lzo_bitops_cttz64(v) / CHAR_BIT; -#elif (LZO_ABI_LITTLE_ENDIAN) - if ((v & UCHAR_MAX) == 0) do { - v >>= CHAR_BIT; - m_len += 1; - } while ((v & UCHAR_MAX) == 0); -#else - if (ip[m_len] == m_pos[m_len]) do { - m_len += 1; - } while (ip[m_len] == m_pos[m_len]); -#endif -#elif (LZO_OPT_UNALIGNED32) - lzo_uint32_t v; - v = UA_GET_NE32(ip + m_len) ^ UA_GET_NE32(m_pos + m_len); - if __lzo_unlikely(v == 0) { - do { - m_len += 4; - v = UA_GET_NE32(ip + m_len) ^ UA_GET_NE32(m_pos + m_len); - if (v != 0) - break; - m_len += 4; - v = UA_GET_NE32(ip + m_len) ^ UA_GET_NE32(m_pos + m_len); - if __lzo_unlikely(ip + m_len >= ip_end) - goto m_len_done; - } while (v == 0); - } -#if (LZO_ABI_BIG_ENDIAN) && defined(lzo_bitops_ctlz32) - m_len += lzo_bitops_ctlz32(v) / CHAR_BIT; -#elif (LZO_ABI_BIG_ENDIAN) - if ((v >> (32 - CHAR_BIT)) == 0) do { - v <<= CHAR_BIT; - m_len += 1; - } while ((v >> (32 - CHAR_BIT)) == 0); -#elif (LZO_ABI_LITTLE_ENDIAN) && defined(lzo_bitops_cttz32) - m_len += lzo_bitops_cttz32(v) / CHAR_BIT; -#elif (LZO_ABI_LITTLE_ENDIAN) - if ((v & UCHAR_MAX) == 0) do { - v >>= CHAR_BIT; - m_len += 1; - } while ((v & UCHAR_MAX) == 0); -#else - if (ip[m_len] == m_pos[m_len]) do { - m_len += 1; - } while (ip[m_len] == m_pos[m_len]); -#endif -#else - if __lzo_unlikely(ip[m_len] == m_pos[m_len]) { - do { - m_len += 1; - if (ip[m_len] != m_pos[m_len]) - break; - m_len += 1; - if (ip[m_len] != m_pos[m_len]) - break; - m_len += 1; - if (ip[m_len] != m_pos[m_len]) - break; - m_len += 1; - if (ip[m_len] != m_pos[m_len]) - break; - m_len += 1; - if (ip[m_len] != m_pos[m_len]) - break; - m_len += 1; - if (ip[m_len] != m_pos[m_len]) - break; - m_len += 1; - if (ip[m_len] != m_pos[m_len]) - break; - m_len += 1; - if __lzo_unlikely(ip + m_len >= ip_end) - goto m_len_done; - } while (ip[m_len] == m_pos[m_len]); - } -#endif - } -m_len_done: - m_off = pd(ip,m_pos); - ip += m_len; - ii = ip; - if (m_len <= M2_MAX_LEN && m_off <= M2_MAX_OFFSET) - { - m_off -= 1; -#if defined(LZO1X) - *op++ = LZO_BYTE(((m_len - 1) << 5) | ((m_off & 7) << 2)); - *op++ = LZO_BYTE(m_off >> 3); -#elif defined(LZO1Y) - *op++ = LZO_BYTE(((m_len + 1) << 4) | ((m_off & 3) << 2)); - *op++ = LZO_BYTE(m_off >> 2); -#endif - } - else if (m_off <= M3_MAX_OFFSET) - { - m_off -= 1; - if (m_len <= M3_MAX_LEN) - *op++ = LZO_BYTE(M3_MARKER | (m_len - 2)); - else - { - m_len -= M3_MAX_LEN; - *op++ = M3_MARKER | 0; - while __lzo_unlikely(m_len > 255) - { - m_len -= 255; - UA_SET1(op, 0); - op++; - } - *op++ = LZO_BYTE(m_len); - } - *op++ = LZO_BYTE(m_off << 2); - *op++ = LZO_BYTE(m_off >> 6); - } - else - { - m_off -= 0x4000; - if (m_len <= M4_MAX_LEN) - *op++ = LZO_BYTE(M4_MARKER | ((m_off >> 11) & 8) | (m_len - 2)); - else - { - m_len -= M4_MAX_LEN; - *op++ = LZO_BYTE(M4_MARKER | ((m_off >> 11) & 8)); - while __lzo_unlikely(m_len > 255) - { - m_len -= 255; - UA_SET1(op, 0); - op++; - } - *op++ = LZO_BYTE(m_len); - } - *op++ = LZO_BYTE(m_off << 2); - *op++ = LZO_BYTE(m_off >> 6); - } - goto next; - } - - *out_len = pd(op, out); - return pd(in_end,ii-ti); -} - -LZO_PUBLIC(int) -DO_COMPRESS ( const lzo_bytep in , lzo_uint in_len, - lzo_bytep out, lzo_uintp out_len, - lzo_voidp wrkmem ) -{ - const lzo_bytep ip = in; - lzo_bytep op = out; - lzo_uint l = in_len; - lzo_uint t = 0; - - while (l > 20) - { - lzo_uint ll = l; - lzo_uintptr_t ll_end; -#if 0 || (LZO_DETERMINISTIC) - ll = LZO_MIN(ll, 49152); -#endif - ll_end = (lzo_uintptr_t)ip + ll; - if ((ll_end + ((t + ll) >> 5)) <= ll_end || (const lzo_bytep)(ll_end + ((t + ll) >> 5)) <= ip + ll) - break; -#if (LZO_DETERMINISTIC) - lzo_memset(wrkmem, 0, ((lzo_uint)1 << D_BITS) * sizeof(lzo_dict_t)); -#endif - t = do_compress(ip,ll,op,out_len,t,wrkmem); - ip += ll; - op += *out_len; - l -= ll; - } - t += l; - - if (t > 0) - { - const lzo_bytep ii = in + in_len - t; - - if (op == out && t <= 238) - *op++ = LZO_BYTE(17 + t); - else if (t <= 3) - op[-2] = LZO_BYTE(op[-2] | t); - else if (t <= 18) - *op++ = LZO_BYTE(t - 3); - else - { - lzo_uint tt = t - 18; - - *op++ = 0; - while (tt > 255) - { - tt -= 255; - UA_SET1(op, 0); - op++; - } - assert(tt > 0); - *op++ = LZO_BYTE(tt); - } - UA_COPYN(op, ii, t); - op += t; - } - - *op++ = M4_MARKER | 1; - *op++ = 0; - *op++ = 0; - - *out_len = pd(op, out); - return LZO_E_OK; -} - -#endif - -#undef do_compress -#undef DO_COMPRESS -#undef LZO_HASH - -#undef LZO_TEST_OVERRUN -#undef DO_DECOMPRESS -#define DO_DECOMPRESS lzo1x_decompress - -#if !defined(MINILZO_CFG_SKIP_LZO1X_DECOMPRESS) - -#if defined(LZO_TEST_OVERRUN) -# if !defined(LZO_TEST_OVERRUN_INPUT) -# define LZO_TEST_OVERRUN_INPUT 2 -# endif -# if !defined(LZO_TEST_OVERRUN_OUTPUT) -# define LZO_TEST_OVERRUN_OUTPUT 2 -# endif -# if !defined(LZO_TEST_OVERRUN_LOOKBEHIND) -# define LZO_TEST_OVERRUN_LOOKBEHIND 1 -# endif -#endif - -#undef TEST_IP -#undef TEST_OP -#undef TEST_IP_AND_TEST_OP -#undef TEST_LB -#undef TEST_LBO -#undef NEED_IP -#undef NEED_OP -#undef TEST_IV -#undef TEST_OV -#undef HAVE_TEST_IP -#undef HAVE_TEST_OP -#undef HAVE_NEED_IP -#undef HAVE_NEED_OP -#undef HAVE_ANY_IP -#undef HAVE_ANY_OP - -#if defined(LZO_TEST_OVERRUN_INPUT) -# if (LZO_TEST_OVERRUN_INPUT >= 1) -# define TEST_IP (ip < ip_end) -# endif -# if (LZO_TEST_OVERRUN_INPUT >= 2) -# define NEED_IP(x) \ - if ((lzo_uint)(ip_end - ip) < (lzo_uint)(x)) goto input_overrun -# define TEST_IV(x) if ((x) > (lzo_uint)0 - (511)) goto input_overrun -# endif -#endif - -#if defined(LZO_TEST_OVERRUN_OUTPUT) -# if (LZO_TEST_OVERRUN_OUTPUT >= 1) -# define TEST_OP (op <= op_end) -# endif -# if (LZO_TEST_OVERRUN_OUTPUT >= 2) -# undef TEST_OP -# define NEED_OP(x) \ - if ((lzo_uint)(op_end - op) < (lzo_uint)(x)) goto output_overrun -# define TEST_OV(x) if ((x) > (lzo_uint)0 - (511)) goto output_overrun -# endif -#endif - -#if defined(LZO_TEST_OVERRUN_LOOKBEHIND) -# define TEST_LB(m_pos) if (PTR_LT(m_pos,out) || PTR_GE(m_pos,op)) goto lookbehind_overrun -# define TEST_LBO(m_pos,o) if (PTR_LT(m_pos,out) || PTR_GE(m_pos,op-(o))) goto lookbehind_overrun -#else -# define TEST_LB(m_pos) ((void) 0) -# define TEST_LBO(m_pos,o) ((void) 0) -#endif - -#if !defined(LZO_EOF_CODE) && !defined(TEST_IP) -# define TEST_IP (ip < ip_end) -#endif - -#if defined(TEST_IP) -# define HAVE_TEST_IP 1 -#else -# define TEST_IP 1 -#endif -#if defined(TEST_OP) -# define HAVE_TEST_OP 1 -#else -# define TEST_OP 1 -#endif - -#if defined(HAVE_TEST_IP) && defined(HAVE_TEST_OP) -# define TEST_IP_AND_TEST_OP (TEST_IP && TEST_OP) -#elif defined(HAVE_TEST_IP) -# define TEST_IP_AND_TEST_OP TEST_IP -#elif defined(HAVE_TEST_OP) -# define TEST_IP_AND_TEST_OP TEST_OP -#else -# define TEST_IP_AND_TEST_OP 1 -#endif - -#if defined(NEED_IP) -# define HAVE_NEED_IP 1 -#else -# define NEED_IP(x) ((void) 0) -# define TEST_IV(x) ((void) 0) -#endif -#if defined(NEED_OP) -# define HAVE_NEED_OP 1 -#else -# define NEED_OP(x) ((void) 0) -# define TEST_OV(x) ((void) 0) -#endif - -#if defined(HAVE_TEST_IP) || defined(HAVE_NEED_IP) -# define HAVE_ANY_IP 1 -#endif -#if defined(HAVE_TEST_OP) || defined(HAVE_NEED_OP) -# define HAVE_ANY_OP 1 -#endif - -#if defined(DO_DECOMPRESS) -LZO_PUBLIC(int) -DO_DECOMPRESS ( const lzo_bytep in , lzo_uint in_len, - lzo_bytep out, lzo_uintp out_len, - lzo_voidp wrkmem ) -#endif -{ - lzo_bytep op; - const lzo_bytep ip; - lzo_uint t; -#if defined(COPY_DICT) - lzo_uint m_off; - const lzo_bytep dict_end; -#else - const lzo_bytep m_pos; -#endif - - const lzo_bytep const ip_end = in + in_len; -#if defined(HAVE_ANY_OP) - lzo_bytep const op_end = out + *out_len; -#endif -#if defined(LZO1Z) - lzo_uint last_m_off = 0; -#endif - - LZO_UNUSED(wrkmem); - -#if defined(COPY_DICT) - if (dict) - { - if (dict_len > M4_MAX_OFFSET) - { - dict += dict_len - M4_MAX_OFFSET; - dict_len = M4_MAX_OFFSET; - } - dict_end = dict + dict_len; - } - else - { - dict_len = 0; - dict_end = NULL; - } -#endif - - *out_len = 0; - - op = out; - ip = in; - - NEED_IP(1); - if (*ip > 17) - { - t = *ip++ - 17; - if (t < 4) - goto match_next; - assert(t > 0); NEED_OP(t); NEED_IP(t+3); - do *op++ = *ip++; while (--t > 0); - goto first_literal_run; - } - - for (;;) - { - NEED_IP(3); - t = *ip++; - if (t >= 16) - goto match; - if (t == 0) - { - while (*ip == 0) - { - t += 255; - ip++; - TEST_IV(t); - NEED_IP(1); - } - t += 15 + *ip++; - } - assert(t > 0); NEED_OP(t+3); NEED_IP(t+6); -#if (LZO_OPT_UNALIGNED64) && (LZO_OPT_UNALIGNED32) - t += 3; - if (t >= 8) do - { - UA_COPY8(op,ip); - op += 8; ip += 8; t -= 8; - } while (t >= 8); - if (t >= 4) - { - UA_COPY4(op,ip); - op += 4; ip += 4; t -= 4; - } - if (t > 0) - { - *op++ = *ip++; - if (t > 1) { *op++ = *ip++; if (t > 2) { *op++ = *ip++; } } - } -#elif (LZO_OPT_UNALIGNED32) || (LZO_ALIGNED_OK_4) -#if !(LZO_OPT_UNALIGNED32) - if (PTR_ALIGNED2_4(op,ip)) - { -#endif - UA_COPY4(op,ip); - op += 4; ip += 4; - if (--t > 0) - { - if (t >= 4) - { - do { - UA_COPY4(op,ip); - op += 4; ip += 4; t -= 4; - } while (t >= 4); - if (t > 0) do *op++ = *ip++; while (--t > 0); - } - else - do *op++ = *ip++; while (--t > 0); - } -#if !(LZO_OPT_UNALIGNED32) - } - else -#endif -#endif -#if !(LZO_OPT_UNALIGNED32) - { - *op++ = *ip++; *op++ = *ip++; *op++ = *ip++; - do *op++ = *ip++; while (--t > 0); - } -#endif - -first_literal_run: - - t = *ip++; - if (t >= 16) - goto match; -#if defined(COPY_DICT) -#if defined(LZO1Z) - m_off = (1 + M2_MAX_OFFSET) + (t << 6) + (*ip++ >> 2); - last_m_off = m_off; -#else - m_off = (1 + M2_MAX_OFFSET) + (t >> 2) + (*ip++ << 2); -#endif - NEED_OP(3); - t = 3; COPY_DICT(t,m_off) -#else -#if defined(LZO1Z) - t = (1 + M2_MAX_OFFSET) + (t << 6) + (*ip++ >> 2); - m_pos = op - t; - last_m_off = t; -#else - m_pos = op - (1 + M2_MAX_OFFSET); - m_pos -= t >> 2; - m_pos -= *ip++ << 2; -#endif - TEST_LB(m_pos); NEED_OP(3); - *op++ = *m_pos++; *op++ = *m_pos++; *op++ = *m_pos; -#endif - goto match_done; - - for (;;) { -match: - if (t >= 64) - { -#if defined(COPY_DICT) -#if defined(LZO1X) - m_off = 1 + ((t >> 2) & 7) + (*ip++ << 3); - t = (t >> 5) - 1; -#elif defined(LZO1Y) - m_off = 1 + ((t >> 2) & 3) + (*ip++ << 2); - t = (t >> 4) - 3; -#elif defined(LZO1Z) - m_off = t & 0x1f; - if (m_off >= 0x1c) - m_off = last_m_off; - else - { - m_off = 1 + (m_off << 6) + (*ip++ >> 2); - last_m_off = m_off; - } - t = (t >> 5) - 1; -#endif -#else -#if defined(LZO1X) - m_pos = op - 1; - m_pos -= (t >> 2) & 7; - m_pos -= *ip++ << 3; - t = (t >> 5) - 1; -#elif defined(LZO1Y) - m_pos = op - 1; - m_pos -= (t >> 2) & 3; - m_pos -= *ip++ << 2; - t = (t >> 4) - 3; -#elif defined(LZO1Z) - { - lzo_uint off = t & 0x1f; - m_pos = op; - if (off >= 0x1c) - { - assert(last_m_off > 0); - m_pos -= last_m_off; - } - else - { - off = 1 + (off << 6) + (*ip++ >> 2); - m_pos -= off; - last_m_off = off; - } - } - t = (t >> 5) - 1; -#endif - TEST_LB(m_pos); assert(t > 0); NEED_OP(t+3-1); - goto copy_match; -#endif - } - else if (t >= 32) - { - t &= 31; - if (t == 0) - { - while (*ip == 0) - { - t += 255; - ip++; - TEST_OV(t); - NEED_IP(1); - } - t += 31 + *ip++; - NEED_IP(2); - } -#if defined(COPY_DICT) -#if defined(LZO1Z) - m_off = 1 + (ip[0] << 6) + (ip[1] >> 2); - last_m_off = m_off; -#else - m_off = 1 + (ip[0] >> 2) + (ip[1] << 6); -#endif -#else -#if defined(LZO1Z) - { - lzo_uint off = 1 + (ip[0] << 6) + (ip[1] >> 2); - m_pos = op - off; - last_m_off = off; - } -#elif (LZO_OPT_UNALIGNED16) && (LZO_ABI_LITTLE_ENDIAN) - m_pos = op - 1; - m_pos -= UA_GET_LE16(ip) >> 2; -#else - m_pos = op - 1; - m_pos -= (ip[0] >> 2) + (ip[1] << 6); -#endif -#endif - ip += 2; - } - else if (t >= 16) - { -#if defined(COPY_DICT) - m_off = (t & 8) << 11; -#else - m_pos = op; - m_pos -= (t & 8) << 11; -#endif - t &= 7; - if (t == 0) - { - while (*ip == 0) - { - t += 255; - ip++; - TEST_OV(t); - NEED_IP(1); - } - t += 7 + *ip++; - NEED_IP(2); - } -#if defined(COPY_DICT) -#if defined(LZO1Z) - m_off += (ip[0] << 6) + (ip[1] >> 2); -#else - m_off += (ip[0] >> 2) + (ip[1] << 6); -#endif - ip += 2; - if (m_off == 0) - goto eof_found; - m_off += 0x4000; -#if defined(LZO1Z) - last_m_off = m_off; -#endif -#else -#if defined(LZO1Z) - m_pos -= (ip[0] << 6) + (ip[1] >> 2); -#elif (LZO_OPT_UNALIGNED16) && (LZO_ABI_LITTLE_ENDIAN) - m_pos -= UA_GET_LE16(ip) >> 2; -#else - m_pos -= (ip[0] >> 2) + (ip[1] << 6); -#endif - ip += 2; - if (m_pos == op) - goto eof_found; - m_pos -= 0x4000; -#if defined(LZO1Z) - last_m_off = pd((const lzo_bytep)op, m_pos); -#endif -#endif - } - else - { -#if defined(COPY_DICT) -#if defined(LZO1Z) - m_off = 1 + (t << 6) + (*ip++ >> 2); - last_m_off = m_off; -#else - m_off = 1 + (t >> 2) + (*ip++ << 2); -#endif - NEED_OP(2); - t = 2; COPY_DICT(t,m_off) -#else -#if defined(LZO1Z) - t = 1 + (t << 6) + (*ip++ >> 2); - m_pos = op - t; - last_m_off = t; -#else - m_pos = op - 1; - m_pos -= t >> 2; - m_pos -= *ip++ << 2; -#endif - TEST_LB(m_pos); NEED_OP(2); - *op++ = *m_pos++; *op++ = *m_pos; -#endif - goto match_done; - } - -#if defined(COPY_DICT) - - NEED_OP(t+3-1); - t += 3-1; COPY_DICT(t,m_off) - -#else - - TEST_LB(m_pos); assert(t > 0); NEED_OP(t+3-1); -#if (LZO_OPT_UNALIGNED64) && (LZO_OPT_UNALIGNED32) - if (op - m_pos >= 8) - { - t += (3 - 1); - if (t >= 8) do - { - UA_COPY8(op,m_pos); - op += 8; m_pos += 8; t -= 8; - } while (t >= 8); - if (t >= 4) - { - UA_COPY4(op,m_pos); - op += 4; m_pos += 4; t -= 4; - } - if (t > 0) - { - *op++ = m_pos[0]; - if (t > 1) { *op++ = m_pos[1]; if (t > 2) { *op++ = m_pos[2]; } } - } - } - else -#elif (LZO_OPT_UNALIGNED32) || (LZO_ALIGNED_OK_4) -#if !(LZO_OPT_UNALIGNED32) - if (t >= 2 * 4 - (3 - 1) && PTR_ALIGNED2_4(op,m_pos)) - { - assert((op - m_pos) >= 4); -#else - if (t >= 2 * 4 - (3 - 1) && (op - m_pos) >= 4) - { -#endif - UA_COPY4(op,m_pos); - op += 4; m_pos += 4; t -= 4 - (3 - 1); - do { - UA_COPY4(op,m_pos); - op += 4; m_pos += 4; t -= 4; - } while (t >= 4); - if (t > 0) do *op++ = *m_pos++; while (--t > 0); - } - else -#endif - { -copy_match: - *op++ = *m_pos++; *op++ = *m_pos++; - do *op++ = *m_pos++; while (--t > 0); - } - -#endif - -match_done: -#if defined(LZO1Z) - t = ip[-1] & 3; -#else - t = ip[-2] & 3; -#endif - if (t == 0) - break; - -match_next: - assert(t > 0); assert(t < 4); NEED_OP(t); NEED_IP(t+3); -#if 0 - do *op++ = *ip++; while (--t > 0); -#else - *op++ = *ip++; - if (t > 1) { *op++ = *ip++; if (t > 2) { *op++ = *ip++; } } -#endif - t = *ip++; - } - } - -eof_found: - *out_len = pd(op, out); - return (ip == ip_end ? LZO_E_OK : - (ip < ip_end ? LZO_E_INPUT_NOT_CONSUMED : LZO_E_INPUT_OVERRUN)); - -#if defined(HAVE_NEED_IP) -input_overrun: - *out_len = pd(op, out); - return LZO_E_INPUT_OVERRUN; -#endif - -#if defined(HAVE_NEED_OP) -output_overrun: - *out_len = pd(op, out); - return LZO_E_OUTPUT_OVERRUN; -#endif - -#if defined(LZO_TEST_OVERRUN_LOOKBEHIND) -lookbehind_overrun: - *out_len = pd(op, out); - return LZO_E_LOOKBEHIND_OVERRUN; -#endif -} - -#endif - -#define LZO_TEST_OVERRUN 1 -#undef DO_DECOMPRESS -#define DO_DECOMPRESS lzo1x_decompress_safe - -#if !defined(MINILZO_CFG_SKIP_LZO1X_DECOMPRESS_SAFE) - -#if defined(LZO_TEST_OVERRUN) -# if !defined(LZO_TEST_OVERRUN_INPUT) -# define LZO_TEST_OVERRUN_INPUT 2 -# endif -# if !defined(LZO_TEST_OVERRUN_OUTPUT) -# define LZO_TEST_OVERRUN_OUTPUT 2 -# endif -# if !defined(LZO_TEST_OVERRUN_LOOKBEHIND) -# define LZO_TEST_OVERRUN_LOOKBEHIND 1 -# endif -#endif - -#undef TEST_IP -#undef TEST_OP -#undef TEST_IP_AND_TEST_OP -#undef TEST_LB -#undef TEST_LBO -#undef NEED_IP -#undef NEED_OP -#undef TEST_IV -#undef TEST_OV -#undef HAVE_TEST_IP -#undef HAVE_TEST_OP -#undef HAVE_NEED_IP -#undef HAVE_NEED_OP -#undef HAVE_ANY_IP -#undef HAVE_ANY_OP - -#if defined(LZO_TEST_OVERRUN_INPUT) -# if (LZO_TEST_OVERRUN_INPUT >= 1) -# define TEST_IP (ip < ip_end) -# endif -# if (LZO_TEST_OVERRUN_INPUT >= 2) -# define NEED_IP(x) \ - if ((lzo_uint)(ip_end - ip) < (lzo_uint)(x)) goto input_overrun -# define TEST_IV(x) if ((x) > (lzo_uint)0 - (511)) goto input_overrun -# endif -#endif - -#if defined(LZO_TEST_OVERRUN_OUTPUT) -# if (LZO_TEST_OVERRUN_OUTPUT >= 1) -# define TEST_OP (op <= op_end) -# endif -# if (LZO_TEST_OVERRUN_OUTPUT >= 2) -# undef TEST_OP -# define NEED_OP(x) \ - if ((lzo_uint)(op_end - op) < (lzo_uint)(x)) goto output_overrun -# define TEST_OV(x) if ((x) > (lzo_uint)0 - (511)) goto output_overrun -# endif -#endif - -#if defined(LZO_TEST_OVERRUN_LOOKBEHIND) -# define TEST_LB(m_pos) if (PTR_LT(m_pos,out) || PTR_GE(m_pos,op)) goto lookbehind_overrun -# define TEST_LBO(m_pos,o) if (PTR_LT(m_pos,out) || PTR_GE(m_pos,op-(o))) goto lookbehind_overrun -#else -# define TEST_LB(m_pos) ((void) 0) -# define TEST_LBO(m_pos,o) ((void) 0) -#endif - -#if !defined(LZO_EOF_CODE) && !defined(TEST_IP) -# define TEST_IP (ip < ip_end) -#endif - -#if defined(TEST_IP) -# define HAVE_TEST_IP 1 -#else -# define TEST_IP 1 -#endif -#if defined(TEST_OP) -# define HAVE_TEST_OP 1 -#else -# define TEST_OP 1 -#endif - -#if defined(HAVE_TEST_IP) && defined(HAVE_TEST_OP) -# define TEST_IP_AND_TEST_OP (TEST_IP && TEST_OP) -#elif defined(HAVE_TEST_IP) -# define TEST_IP_AND_TEST_OP TEST_IP -#elif defined(HAVE_TEST_OP) -# define TEST_IP_AND_TEST_OP TEST_OP -#else -# define TEST_IP_AND_TEST_OP 1 -#endif - -#if defined(NEED_IP) -# define HAVE_NEED_IP 1 -#else -# define NEED_IP(x) ((void) 0) -# define TEST_IV(x) ((void) 0) -#endif -#if defined(NEED_OP) -# define HAVE_NEED_OP 1 -#else -# define NEED_OP(x) ((void) 0) -# define TEST_OV(x) ((void) 0) -#endif - -#if defined(HAVE_TEST_IP) || defined(HAVE_NEED_IP) -# define HAVE_ANY_IP 1 -#endif -#if defined(HAVE_TEST_OP) || defined(HAVE_NEED_OP) -# define HAVE_ANY_OP 1 -#endif - -#if defined(DO_DECOMPRESS) -LZO_PUBLIC(int) -DO_DECOMPRESS ( const lzo_bytep in , lzo_uint in_len, - lzo_bytep out, lzo_uintp out_len, - lzo_voidp wrkmem ) -#endif -{ - lzo_bytep op; - const lzo_bytep ip; - lzo_uint t; -#if defined(COPY_DICT) - lzo_uint m_off; - const lzo_bytep dict_end; -#else - const lzo_bytep m_pos; -#endif - - const lzo_bytep const ip_end = in + in_len; -#if defined(HAVE_ANY_OP) - lzo_bytep const op_end = out + *out_len; -#endif -#if defined(LZO1Z) - lzo_uint last_m_off = 0; -#endif - - LZO_UNUSED(wrkmem); - -#if defined(COPY_DICT) - if (dict) - { - if (dict_len > M4_MAX_OFFSET) - { - dict += dict_len - M4_MAX_OFFSET; - dict_len = M4_MAX_OFFSET; - } - dict_end = dict + dict_len; - } - else - { - dict_len = 0; - dict_end = NULL; - } -#endif - - *out_len = 0; - - op = out; - ip = in; - - NEED_IP(1); - if (*ip > 17) - { - t = *ip++ - 17; - if (t < 4) - goto match_next; - assert(t > 0); NEED_OP(t); NEED_IP(t+3); - do *op++ = *ip++; while (--t > 0); - goto first_literal_run; - } - - for (;;) - { - NEED_IP(3); - t = *ip++; - if (t >= 16) - goto match; - if (t == 0) - { - while (*ip == 0) - { - t += 255; - ip++; - TEST_IV(t); - NEED_IP(1); - } - t += 15 + *ip++; - } - assert(t > 0); NEED_OP(t+3); NEED_IP(t+6); -#if (LZO_OPT_UNALIGNED64) && (LZO_OPT_UNALIGNED32) - t += 3; - if (t >= 8) do - { - UA_COPY8(op,ip); - op += 8; ip += 8; t -= 8; - } while (t >= 8); - if (t >= 4) - { - UA_COPY4(op,ip); - op += 4; ip += 4; t -= 4; - } - if (t > 0) - { - *op++ = *ip++; - if (t > 1) { *op++ = *ip++; if (t > 2) { *op++ = *ip++; } } - } -#elif (LZO_OPT_UNALIGNED32) || (LZO_ALIGNED_OK_4) -#if !(LZO_OPT_UNALIGNED32) - if (PTR_ALIGNED2_4(op,ip)) - { -#endif - UA_COPY4(op,ip); - op += 4; ip += 4; - if (--t > 0) - { - if (t >= 4) - { - do { - UA_COPY4(op,ip); - op += 4; ip += 4; t -= 4; - } while (t >= 4); - if (t > 0) do *op++ = *ip++; while (--t > 0); - } - else - do *op++ = *ip++; while (--t > 0); - } -#if !(LZO_OPT_UNALIGNED32) - } - else -#endif -#endif -#if !(LZO_OPT_UNALIGNED32) - { - *op++ = *ip++; *op++ = *ip++; *op++ = *ip++; - do *op++ = *ip++; while (--t > 0); - } -#endif - -first_literal_run: - - t = *ip++; - if (t >= 16) - goto match; -#if defined(COPY_DICT) -#if defined(LZO1Z) - m_off = (1 + M2_MAX_OFFSET) + (t << 6) + (*ip++ >> 2); - last_m_off = m_off; -#else - m_off = (1 + M2_MAX_OFFSET) + (t >> 2) + (*ip++ << 2); -#endif - NEED_OP(3); - t = 3; COPY_DICT(t,m_off) -#else -#if defined(LZO1Z) - t = (1 + M2_MAX_OFFSET) + (t << 6) + (*ip++ >> 2); - m_pos = op - t; - last_m_off = t; -#else - m_pos = op - (1 + M2_MAX_OFFSET); - m_pos -= t >> 2; - m_pos -= *ip++ << 2; -#endif - TEST_LB(m_pos); NEED_OP(3); - *op++ = *m_pos++; *op++ = *m_pos++; *op++ = *m_pos; -#endif - goto match_done; - - for (;;) { -match: - if (t >= 64) - { -#if defined(COPY_DICT) -#if defined(LZO1X) - m_off = 1 + ((t >> 2) & 7) + (*ip++ << 3); - t = (t >> 5) - 1; -#elif defined(LZO1Y) - m_off = 1 + ((t >> 2) & 3) + (*ip++ << 2); - t = (t >> 4) - 3; -#elif defined(LZO1Z) - m_off = t & 0x1f; - if (m_off >= 0x1c) - m_off = last_m_off; - else - { - m_off = 1 + (m_off << 6) + (*ip++ >> 2); - last_m_off = m_off; - } - t = (t >> 5) - 1; -#endif -#else -#if defined(LZO1X) - m_pos = op - 1; - m_pos -= (t >> 2) & 7; - m_pos -= *ip++ << 3; - t = (t >> 5) - 1; -#elif defined(LZO1Y) - m_pos = op - 1; - m_pos -= (t >> 2) & 3; - m_pos -= *ip++ << 2; - t = (t >> 4) - 3; -#elif defined(LZO1Z) - { - lzo_uint off = t & 0x1f; - m_pos = op; - if (off >= 0x1c) - { - assert(last_m_off > 0); - m_pos -= last_m_off; - } - else - { - off = 1 + (off << 6) + (*ip++ >> 2); - m_pos -= off; - last_m_off = off; - } - } - t = (t >> 5) - 1; -#endif - TEST_LB(m_pos); assert(t > 0); NEED_OP(t+3-1); - goto copy_match; -#endif - } - else if (t >= 32) - { - t &= 31; - if (t == 0) - { - while (*ip == 0) - { - t += 255; - ip++; - TEST_OV(t); - NEED_IP(1); - } - t += 31 + *ip++; - NEED_IP(2); - } -#if defined(COPY_DICT) -#if defined(LZO1Z) - m_off = 1 + (ip[0] << 6) + (ip[1] >> 2); - last_m_off = m_off; -#else - m_off = 1 + (ip[0] >> 2) + (ip[1] << 6); -#endif -#else -#if defined(LZO1Z) - { - lzo_uint off = 1 + (ip[0] << 6) + (ip[1] >> 2); - m_pos = op - off; - last_m_off = off; - } -#elif (LZO_OPT_UNALIGNED16) && (LZO_ABI_LITTLE_ENDIAN) - m_pos = op - 1; - m_pos -= UA_GET_LE16(ip) >> 2; -#else - m_pos = op - 1; - m_pos -= (ip[0] >> 2) + (ip[1] << 6); -#endif -#endif - ip += 2; - } - else if (t >= 16) - { -#if defined(COPY_DICT) - m_off = (t & 8) << 11; -#else - m_pos = op; - m_pos -= (t & 8) << 11; -#endif - t &= 7; - if (t == 0) - { - while (*ip == 0) - { - t += 255; - ip++; - TEST_OV(t); - NEED_IP(1); - } - t += 7 + *ip++; - NEED_IP(2); - } -#if defined(COPY_DICT) -#if defined(LZO1Z) - m_off += (ip[0] << 6) + (ip[1] >> 2); -#else - m_off += (ip[0] >> 2) + (ip[1] << 6); -#endif - ip += 2; - if (m_off == 0) - goto eof_found; - m_off += 0x4000; -#if defined(LZO1Z) - last_m_off = m_off; -#endif -#else -#if defined(LZO1Z) - m_pos -= (ip[0] << 6) + (ip[1] >> 2); -#elif (LZO_OPT_UNALIGNED16) && (LZO_ABI_LITTLE_ENDIAN) - m_pos -= UA_GET_LE16(ip) >> 2; -#else - m_pos -= (ip[0] >> 2) + (ip[1] << 6); -#endif - ip += 2; - if (m_pos == op) - goto eof_found; - m_pos -= 0x4000; -#if defined(LZO1Z) - last_m_off = pd((const lzo_bytep)op, m_pos); -#endif -#endif - } - else - { -#if defined(COPY_DICT) -#if defined(LZO1Z) - m_off = 1 + (t << 6) + (*ip++ >> 2); - last_m_off = m_off; -#else - m_off = 1 + (t >> 2) + (*ip++ << 2); -#endif - NEED_OP(2); - t = 2; COPY_DICT(t,m_off) -#else -#if defined(LZO1Z) - t = 1 + (t << 6) + (*ip++ >> 2); - m_pos = op - t; - last_m_off = t; -#else - m_pos = op - 1; - m_pos -= t >> 2; - m_pos -= *ip++ << 2; -#endif - TEST_LB(m_pos); NEED_OP(2); - *op++ = *m_pos++; *op++ = *m_pos; -#endif - goto match_done; - } - -#if defined(COPY_DICT) - - NEED_OP(t+3-1); - t += 3-1; COPY_DICT(t,m_off) - -#else - - TEST_LB(m_pos); assert(t > 0); NEED_OP(t+3-1); -#if (LZO_OPT_UNALIGNED64) && (LZO_OPT_UNALIGNED32) - if (op - m_pos >= 8) - { - t += (3 - 1); - if (t >= 8) do - { - UA_COPY8(op,m_pos); - op += 8; m_pos += 8; t -= 8; - } while (t >= 8); - if (t >= 4) - { - UA_COPY4(op,m_pos); - op += 4; m_pos += 4; t -= 4; - } - if (t > 0) - { - *op++ = m_pos[0]; - if (t > 1) { *op++ = m_pos[1]; if (t > 2) { *op++ = m_pos[2]; } } - } - } - else -#elif (LZO_OPT_UNALIGNED32) || (LZO_ALIGNED_OK_4) -#if !(LZO_OPT_UNALIGNED32) - if (t >= 2 * 4 - (3 - 1) && PTR_ALIGNED2_4(op,m_pos)) - { - assert((op - m_pos) >= 4); -#else - if (t >= 2 * 4 - (3 - 1) && (op - m_pos) >= 4) - { -#endif - UA_COPY4(op,m_pos); - op += 4; m_pos += 4; t -= 4 - (3 - 1); - do { - UA_COPY4(op,m_pos); - op += 4; m_pos += 4; t -= 4; - } while (t >= 4); - if (t > 0) do *op++ = *m_pos++; while (--t > 0); - } - else -#endif - { -copy_match: - *op++ = *m_pos++; *op++ = *m_pos++; - do *op++ = *m_pos++; while (--t > 0); - } - -#endif - -match_done: -#if defined(LZO1Z) - t = ip[-1] & 3; -#else - t = ip[-2] & 3; -#endif - if (t == 0) - break; - -match_next: - assert(t > 0); assert(t < 4); NEED_OP(t); NEED_IP(t+3); -#if 0 - do *op++ = *ip++; while (--t > 0); -#else - *op++ = *ip++; - if (t > 1) { *op++ = *ip++; if (t > 2) { *op++ = *ip++; } } -#endif - t = *ip++; - } - } - -eof_found: - *out_len = pd(op, out); - return (ip == ip_end ? LZO_E_OK : - (ip < ip_end ? LZO_E_INPUT_NOT_CONSUMED : LZO_E_INPUT_OVERRUN)); - -#if defined(HAVE_NEED_IP) -input_overrun: - *out_len = pd(op, out); - return LZO_E_INPUT_OVERRUN; -#endif - -#if defined(HAVE_NEED_OP) -output_overrun: - *out_len = pd(op, out); - return LZO_E_OUTPUT_OVERRUN; -#endif - -#if defined(LZO_TEST_OVERRUN_LOOKBEHIND) -lookbehind_overrun: - *out_len = pd(op, out); - return LZO_E_LOOKBEHIND_OVERRUN; -#endif -} - -#endif - -/***** End of minilzo.c *****/ diff --git a/extensions/common/minilzo.h b/extensions/common/minilzo.h deleted file mode 100644 index e5adc6ed942..00000000000 --- a/extensions/common/minilzo.h +++ /dev/null @@ -1,106 +0,0 @@ -/* minilzo.h -- mini subset of the LZO real-time data compression library - - This file is part of the LZO real-time data compression library. - - Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer - All Rights Reserved. - - The LZO library is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of - the License, or (at your option) any later version. - - The LZO library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with the LZO library; see the file COPYING. - If not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - Markus F.X.J. Oberhumer - <markus@oberhumer.com> - http://www.oberhumer.com/opensource/lzo/ - */ - -/* - * NOTE: - * the full LZO package can be found at - * http://www.oberhumer.com/opensource/lzo/ - */ - - -#ifndef __MINILZO_H_INCLUDED -#define __MINILZO_H_INCLUDED 1 - -#define MINILZO_VERSION 0x2090 - -#if defined(__LZOCONF_H_INCLUDED) -# error "you cannot use both LZO and miniLZO" -#endif - -/* internal Autoconf configuration file - only used when building miniLZO */ -#ifdef MINILZO_HAVE_CONFIG_H -# include <config.h> -#endif -#include <limits.h> -#include <stddef.h> - -#ifndef __LZODEFS_H_INCLUDED -#include "lzodefs.h" -#endif -#undef LZO_HAVE_CONFIG_H -#include "lzoconf.h" - -#if !defined(LZO_VERSION) || (LZO_VERSION != MINILZO_VERSION) -# error "version mismatch in header files" -#endif - - -#ifdef __cplusplus -extern "C" { -#endif - - -/*********************************************************************** -// -************************************************************************/ - -/* Memory required for the wrkmem parameter. - * When the required size is 0, you can also pass a NULL pointer. - */ - -#define LZO1X_MEM_COMPRESS LZO1X_1_MEM_COMPRESS -#define LZO1X_1_MEM_COMPRESS ((lzo_uint32_t) (16384L * lzo_sizeof_dict_t)) -#define LZO1X_MEM_DECOMPRESS (0) - - -/* compression */ -LZO_EXTERN(int) -lzo1x_1_compress ( const lzo_bytep src, lzo_uint src_len, - lzo_bytep dst, lzo_uintp dst_len, - lzo_voidp wrkmem ); - -/* decompression */ -LZO_EXTERN(int) -lzo1x_decompress ( const lzo_bytep src, lzo_uint src_len, - lzo_bytep dst, lzo_uintp dst_len, - lzo_voidp wrkmem /* NOT USED */ ); - -/* safe decompression with overrun testing */ -LZO_EXTERN(int) -lzo1x_decompress_safe ( const lzo_bytep src, lzo_uint src_len, - lzo_bytep dst, lzo_uintp dst_len, - lzo_voidp wrkmem /* NOT USED */ ); - - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* already included */ - - -/* vim:set ts=4 sw=4 et: */ diff --git a/extensions/common/p3d/animation.cpp b/extensions/common/p3d/animation.cpp deleted file mode 100644 index b948b2c28a6..00000000000 --- a/extensions/common/p3d/animation.cpp +++ /dev/null @@ -1,71 +0,0 @@ -#pragma once - -#include "p3d/animation.hpp" -#include "read_helpers.hpp" - -namespace ace { - namespace p3d { - animation::animation() {} - animation::animation(std::istream &stream_, uint32_t version = 68) { - float tvalue = 0; - - stream_.read((char *)&type, sizeof(uint32_t)); - - READ_STRING(name); - READ_STRING(source); - - stream_.read((char *)&min_value, sizeof(float)); - stream_.read((char *)&max_value, sizeof(float)); - stream_.read((char *)&min_phase, sizeof(float)); - stream_.read((char *)&max_phase, sizeof(float)); - - stream_.read((char *)&junk, sizeof(uint32_t)); - stream_.read((char *)&junk2, sizeof(uint32_t)); - stream_.read((char *)&source_address, sizeof(uint32_t)); - - // This always adds up to 2*4 more bytes unless its direct apparently - switch (type) { - // rotations - case 0: - case 1: - case 2: - case 3: - stream_.read((char *)&angle0, sizeof(float)); - stream_.read((char *)&angle1, sizeof(float)); - break; - // translations - case 4: - case 5: - case 6: - case 7: // also do the hide here, it'll always be 0 - stream_.read((char *)&offset0, sizeof(float)); - stream_.read((char *)&offset1, sizeof(float)); - break; - case 8: - float pos[3]; - stream_.read((char *)&pos, sizeof(float) * 3); - direct_axis_pos = ace::vector3<float>(pos); - float dir[3]; - stream_.read((char *)&dir, sizeof(float) * 3); - direct_axis_dir = ace::vector3<float>(dir); - stream_.read((char *)&direct_angle, sizeof(float)); - stream_.read((char *)&direct_axis_offset, sizeof(float)); - break; - case 9: // fucking hides... - stream_.read((char *)&hide_value, sizeof(float)); - stream_.read((char *)&offset1, sizeof(float)); // this is junk throw it in offset1 for hides - break; - default: - stream_.read((char *)&offset0, sizeof(float)); - stream_.read((char *)&offset1, sizeof(float)); - break; - } - - - LOG(DEBUG) << "Animation loaded: " << name << ", source=" << source; - } - - animation::~animation() { - } - } -} diff --git a/extensions/common/p3d/animation.hpp b/extensions/common/p3d/animation.hpp deleted file mode 100644 index dd0f27e445b..00000000000 --- a/extensions/common/p3d/animation.hpp +++ /dev/null @@ -1,69 +0,0 @@ -#pragma once - -#include "shared.hpp" -#include "vector.hpp" - -namespace ace { - namespace p3d { - - class animate_bone { - public: - animate_bone() : index(-1) {} - int32_t index; - uint32_t lod; - ace::vector3<float> axis_direction; - ace::vector3<float> axis_position; - }; - typedef std::shared_ptr<animate_bone> animate_bone_p; - - class animation { - public: - animation(); - animation(std::istream &, uint32_t); - ~animation(); - - uint32_t type; - std::string name; // "RightDoor" - std::string source; // "rotor" - float min_value; - float max_value; - float min_phase; - float max_phase; - uint32_t junk; - - uint32_t junk2; - - uint32_t source_address; - - float offset0; - float offset1; - - float angle0; - float angle1; - - float hide_value; - - ace::vector3<float> direct_axis_pos; - ace::vector3<float> direct_axis_dir; - - float direct_angle; - float direct_axis_offset; - - - std::vector<animate_bone_p> bones; - - //uint32_t null; - //uint32_t floats_count; //always 2 - //float *floats; - - //float transforms[4]; - //float angles[2]; - //float offsets[2]; - //float hide; - - //ace::vector3<float> axis_pos; - //ace::vector3<float> axis_dir; - }; - typedef std::shared_ptr<animation> animation_p; - } -} diff --git a/extensions/common/p3d/compressed.cpp b/extensions/common/p3d/compressed.cpp deleted file mode 100644 index 8f1078f1296..00000000000 --- a/extensions/common/p3d/compressed.cpp +++ /dev/null @@ -1,240 +0,0 @@ -#include "compressed.hpp" - -#include <memory> - -#include <limits.h> -#include <stddef.h> -#include <limits.h> -#include <stddef.h> -#include <string.h> -#include <malloc.h> - -#define COMPRESS_ASSERT(val) if (!(val)) return LZO_E_ERROR -#define M2_MAX_OFFSET 0x0800 - -#define NEED_OP(x) if ((unsigned)(op_end - op) < (unsigned)(x)) return LZO_E_OUTPUT_OVERRUN; -#define TEST_LB() if (m_pos < out || m_pos >= op) return LZO_E_LOOKBEHIND_OVERRUN; - -#define COPY4(dst,src) * (unsigned *)(dst) = * (const unsigned *)(src) - -#define LZO_E_OK 0 -#define LZO_E_ERROR (-1) -#define LZO_E_OUTPUT_OVERRUN (-5) -#define LZO_E_LOOKBEHIND_OVERRUN (-6) -#define LZO_E_OUTPUT_UNDERRUN (-4) - -namespace ace { - namespace p3d { - /*lzo1x_decompress_safe ( const lzo_bytep src, lzo_uint src_len, - lzo_bytep dst, lzo_uintp dst_len, - lzo_voidp wrkmem ) */ - int _compressed_base::_decompress_safe(std::istream & in, uint32_t expected_size) { - // We read 512 bytes at a time, until we have hit the end of the compressed stream - uint8_t *buffer; - uint32_t input_size = 0; - int32_t result; - std::streampos save_pos; - - save_pos = in.tellg(); - buffer = new uint8_t[expected_size + 1024]; - - in.read((char *)buffer, expected_size + 1024); - input_size = in.gcount(); - if (in.eof()) { - in.clear(); - } - _data = std::unique_ptr<uint8_t[]>(new uint8_t[expected_size + (expected_size % 8)]); - - result = _mikero_lzo1x_decompress_safe(buffer, _data.get(), expected_size); - if (result < 0) { - LOG(ERROR) << "Decompression failed"; - assert(false); - } - in.seekg(save_pos); - in.seekg(result, in.cur); - - delete[] buffer; - - return result; - } - int _compressed_base::_mikero_lzo1x_decompress_safe(const uint8_t* in, uint8_t* out, uint32_t OutLen) { - register uint8_t* op; - register const uint8_t* ip; - register size_t t; - register const uint8_t* m_pos; - - uint8_t* const op_end = out + OutLen; - - OutLen = 0; - op = out; - ip = in; - - if (*ip > 17) - { - t = *ip++ - 17; - if (t < 4) goto match_next; - COMPRESS_ASSERT(t > 0);// return LZO_E_ERROR; - NEED_OP(t); - do *op++ = *ip++; while (--t > 0); - goto first_literal_run; - } - - while (1) - { - t = *ip++; - if (t >= 16) goto match; - if (t == 0) - { - while (*ip == 0) - { - t += 255; - ip++; - } - t += 15 + *ip++; - } - COMPRESS_ASSERT(t > 0); NEED_OP(t + 3); - - COPY4(op, ip); - op += 4; ip += 4; - if (--t > 0) - { - if (t >= 4) - { - do { - COPY4(op, ip); - op += 4; ip += 4; t -= 4; - } while (t >= 4); - if (t > 0) do *op++ = *ip++; while (--t > 0); - } - else - do *op++ = *ip++; while (--t > 0); - } - - first_literal_run: - - t = *ip++; - if (t >= 16) goto match; - - m_pos = op - (1 + M2_MAX_OFFSET); - m_pos -= t >> 2; - m_pos -= *ip++ << 2; - - TEST_LB(); - NEED_OP(3); - *op++ = *m_pos++; *op++ = *m_pos++; *op++ = *m_pos; - - goto match_done; - - do { - match: - if (t >= 64) - { - - m_pos = op - 1; - m_pos -= (t >> 2) & 7; - m_pos -= *ip++ << 3; - t = (t >> 5) - 1; - TEST_LB(); COMPRESS_ASSERT(t > 0); NEED_OP(t + 3 - 1); - goto copy_match; - } - else if (t >= 32) - { - t &= 31; - if (t == 0) - { - while (*ip == 0) - { - t += 255; - ip++; - } - t += 31 + *ip++; - } - - m_pos = op - 1; - m_pos -= (ip[0] >> 2) + (ip[1] << 6); - - ip += 2; - } - else if (t >= 16) - { - - m_pos = op; - m_pos -= (t & 8) << 11; - - t &= 7; - if (t == 0) - { - while (*ip == 0) - { - t += 255; - ip++; - } - t += 7 + *ip++; - } - - m_pos -= (ip[0] >> 2) + (ip[1] << 6); - - ip += 2; - ////// done - if (m_pos == op) - { - COMPRESS_ASSERT(t == 1); - if (m_pos != op_end) - return LZO_E_LOOKBEHIND_OVERRUN; - return ip - in; - } - m_pos -= 0x4000; - } - else - { - m_pos = op - 1; - m_pos -= t >> 2; - m_pos -= *ip++ << 2; - - TEST_LB(); - NEED_OP(2); - *op++ = *m_pos++; *op++ = *m_pos; - goto match_done; - } - - TEST_LB(); - COMPRESS_ASSERT(t > 0); - NEED_OP(t + 3 - 1); - - if (t >= 2 * 4 - (3 - 1) && (op - m_pos) >= 4) - { - COPY4(op, m_pos); - op += 4; m_pos += 4; t -= 4 - (3 - 1); - do { - COPY4(op, m_pos); - op += 4; m_pos += 4; t -= 4; - } while (t >= 4); - if (t > 0) do *op++ = *m_pos++; while (--t > 0); - } - else - { - copy_match: - *op++ = *m_pos++; *op++ = *m_pos++; - - do *op++ = *m_pos++; while (--t > 0); - - } - match_done: - - t = ip[-2] & 3; - if (t == 0) break; - match_next: - COMPRESS_ASSERT(t > 0); COMPRESS_ASSERT(t < 4); NEED_OP(t); - *op++ = *ip++; - if (t > 1) { *op++ = *ip++; if (t > 2) { *op++ = *ip++; } } - - t = *ip++; - } while (1); - } - // return LZO_E_EOF_NOT_FOUND;/never gets here - - - } - } -} - diff --git a/extensions/common/p3d/compressed.hpp b/extensions/common/p3d/compressed.hpp deleted file mode 100644 index 35da0fed231..00000000000 --- a/extensions/common/p3d/compressed.hpp +++ /dev/null @@ -1,170 +0,0 @@ -#pragma once - -#include "shared.hpp" -#include "vector.hpp" - -#include "read_helpers.hpp" - - -namespace ace { - namespace p3d { - class _compressed_base { - protected: - int _mikero_lzo1x_decompress_safe(const uint8_t*, uint8_t*, uint32_t); - int _decompress_safe(std::istream &, uint32_t); -#if _MSC_VER == 1800 - std::shared_ptr<uint8_t[]> _data; -#else - std::unique_ptr<uint8_t[]> _data; -#endif - }; - template<typename T> - class compressed_base : public _compressed_base { - public: - compressed_base() : fill(false), size(0), flag(0) {} - - T & operator[] (const int index) { return data[index]; } - - uint32_t size; - bool fill; - std::vector<T> data; - bool flag; - }; - - template<typename T> - class compressed : public compressed_base<T> { - public: - compressed() { } - compressed(std::istream &stream_, bool compressed_ = false, bool fill_ = false, uint32_t version = 68) - { - stream_.read((char *)&this->size, sizeof(uint32_t)); - - // if(version <) - if(fill_) - READ_BOOL(this->fill); - - assert(this->size < 4095 * 10); - if (this->size > 0) { - if (this->fill) { - T val; - stream_.read((char *)&val, sizeof(T)); - for (int x = 0; x < this->size; x++) { - this->data.push_back(val); - } - } else { - if (version >= 64 && compressed_) { - READ_BOOL(this->flag); - } - if ( (this->size * sizeof(T) >= 1024 && compressed_ && version < 64) || (this->flag && compressed_)) { - int32_t result = this->_decompress_safe(stream_, this->size * sizeof(T)); - assert(result > 0); - T * ptr = (T *)(this->_data.get()); - this->data.assign(ptr, ptr + this->size ); - } else { - for (int x = 0; x < this->size; x++) { - T val; - stream_.read((char *)&val, sizeof(T)); - this->data.push_back(val); - } - } - } - } - } - }; - - template<> - class compressed<vector3<float>> : public compressed_base<vector3<float>>{ - public: - compressed() {} - compressed(std::istream &stream_, bool compressed_ = false, bool fill_ = false, bool xyzCompressed = false, uint32_t version = 68) { - stream_.read((char *)&size, sizeof(uint32_t)); - - if(fill_) - READ_BOOL(fill); - - if (fill) { - ace::vector3<float> val(stream_); - for (int x = 0; x < size; x++) { - data.push_back(val); - } - } - else { - if (version >= 64) { - READ_BOOL(flag); - } - if ((size * sizeof(float)*3 >= 1024 && compressed_ && version < 64) || (flag && compressed_)) { - if (xyzCompressed) { - int32_t result = _decompress_safe(stream_, size * sizeof(float)); - uint32_t * ptr = (uint32_t *)(_data.get()); - for (int x = 0; x < size; x++) { - uint32_t value = ptr[x]; - data.push_back(decode_xyz(value)); - } - } else { - int32_t result = _decompress_safe(stream_, size * sizeof(float) * 3); - float * ptr = (float *)(_data.get()); - for (int x = 0; x < size*3; x+=3) { - data.push_back(ace::vector3<float>(ptr+x)); - } - } - } else { - for (int x = 0; x < size; x++) { - data.push_back(ace::vector3<float>(stream_)); - } - } - } - } - - ace::vector3<float> decode_xyz(uint32_t CompressedXYZ) - { - double scaleFactor = -1.0 / 511; - - int x = CompressedXYZ & 0x3FF; - int y = (CompressedXYZ >> 10) & 0x3FF; - int z = (CompressedXYZ >> 20) & 0x3FF; - if (x > 511) x -= 1024; - if (y > 511) y -= 1024; - if (z > 511) z -= 1024; - - return ace::vector3<float>(x * scaleFactor, y * scaleFactor, z * scaleFactor); - } - }; - - template<> - class compressed<pair<float>> : public compressed_base<pair<float>>{ - public: - compressed() {} - compressed(std::istream &stream_, bool compressed_ = false, bool fill_ = false, uint32_t version = 68) { - stream_.read((char *)&size, sizeof(uint32_t)); - - if (fill_) - READ_BOOL(fill); - - if (fill) { - ace::pair<float> val(stream_); - for (int x = 0; x < size; x++) { - data.push_back(val); - } - } - else { - if (version >= 64) { - READ_BOOL(flag); - } - if ((size * sizeof(float)*2 >= 1024 && compressed_ && version < 64) || (flag && compressed_)) { - - int32_t result = _decompress_safe(stream_, size * sizeof(float) * 2); - float * ptr = (float *)(_data.get()); - for (int x = 0; x < size * 2; x += 2) { - data.push_back(ace::pair<float>(ptr + x)); - } - } - else { - for (int x = 0; x < size; x++) { - data.push_back(ace::pair<float>(stream_)); - } - } - } - } - }; - } -} diff --git a/extensions/common/p3d/lod_info.cpp b/extensions/common/p3d/lod_info.cpp deleted file mode 100644 index 149d238e2c2..00000000000 --- a/extensions/common/p3d/lod_info.cpp +++ /dev/null @@ -1,289 +0,0 @@ -#include "lod_info.hpp" - -#include "read_helpers.hpp" - -namespace ace { - namespace p3d { - - - lod::lod() {} - lod::lod(std::istream & stream_, uint32_t id_, uint32_t version = 68) : id(id_) { - uint32_t temp_count; - - // proxies - stream_.read((char *)&temp_count, sizeof(uint32_t)); assert(temp_count < 4096 * 10); - for (int x = 0; x < temp_count; x++) { - proxies.push_back(std::make_shared<proxy>(stream_, version)); - } - LOG(DEBUG) << "Found Proxies:"; - for (auto & proxy : proxies) { - LOG(DEBUG) << "\t" << proxy->name; - } - - compressed<uint32_t> item(stream_, false, false); - items.resize(item.data.size()); - std::copy(item.data.begin(), item.data.end(), items.begin()); - - // bone links - stream_.read((char *)&temp_count, sizeof(uint32_t)); assert(temp_count < 4096 * 10); - for (int x = 0; x < temp_count; x++) { - // @ TODO: BoneLInks - uint32_t link_count; - std::vector<uint32_t> links; - stream_.read((char *)&link_count, sizeof(uint32_t)); - for (int x = 0; x < link_count; x++) { - uint32_t val; - stream_.read((char *)&val, sizeof(uint32_t)); - links.push_back(val); - } - bone_links.push_back(links); - } - - stream_.read((char *)&point_count, sizeof(uint32_t)); - stream_.read((char *)&u_float_1, sizeof(float)); - - // Derp, this was only TOH apparently!? - //point_flags = compressed<uint32_t>(stream_, true, true, version); - - stream_.read((char *)&u_float_2, sizeof(float)); - stream_.read((char *)&u_float_3, sizeof(float)); - - min_pos = ace::vector3<float>(stream_); - max_pos = ace::vector3<float>(stream_); - autocenter_pos = ace::vector3<float>(stream_); - - stream_.read((char *)&sphere, sizeof(float)); - - // Texture strings - stream_.read((char *)&temp_count, sizeof(uint32_t)); - for (int x = 0; x < temp_count; x++) { - std::string temp; - - READ_STRING(temp); - textures.push_back(temp); - LOG(DEBUG) << "Found texture: " << temp << " pos: " << stream_.tellg(); - } - - //Materials - stream_.read((char *)&temp_count, sizeof(uint32_t)); - for (int x = 0; x < temp_count; x++) { - materials.push_back(std::make_shared<material>(stream_, version)); - } - - edges.mlod = compressed<uint16_t>(stream_, true, false, version).data; - edges.vertex = compressed<uint16_t>(stream_, true, false, version).data; - - // @TODO: THIS IS OFF WTF?! - // The first face is coming up null, so we missed something - // Faces magic - stream_.read((char *)&temp_count, sizeof(uint32_t)); - stream_.read((char *)&faces_allocation_size, sizeof(uint32_t)); - - // WTF IS GOING ON!? - stream_.seekg(2, stream_.cur); - - for (int x = 0; x < temp_count; x++) { - faces.push_back(std::make_shared<face>(stream_, version)); - } - - // Sections - stream_.read((char *)&temp_count, sizeof(uint32_t)); - for (int x = 0; x < temp_count; x++) { - sections.push_back(std::make_shared<section>(stream_, version)); - } - - stream_.read((char *)&temp_count, sizeof(uint32_t)); - for (int x = 0; x < temp_count; x++) { - selections.push_back(std::make_shared<named_selection>(stream_, version)); - } - - // named properties - LOG(DEBUG) << "Loaded properties"; - stream_.read((char *)&temp_count, sizeof(uint32_t)); - for (int x = 0; x < temp_count; x++) { - std::string key, value; - READ_STRING(key); - READ_STRING(value); - named_properties[key] = value; - LOG(DEBUG) << "\t\t" << key << "->" << value; - } - - stream_.read((char *)&temp_count, sizeof(uint32_t)); - for (int x = 0; x < temp_count; x++) { - frames.push_back(std::make_shared<frame>(stream_, version)); - } - - stream_.read((char *)&icon_color, sizeof(uint32_t)); - stream_.read((char *)&selected_color, sizeof(uint32_t)); - stream_.read((char *)&u_residue, sizeof(uint32_t)); - stream_.read((char *)&u_byte_1, sizeof(uint8_t)); - stream_.read((char *)&temp_count, sizeof(uint32_t)); - - // Vertex Table starts here - vertices = std::make_shared<c_vertex_table>(stream_, temp_count, version); - } - - lod::~lod() {} - - uv::uv() {} - uv::uv(std::istream &stream_, uint32_t version = 68) { - stream_.read((char *)&uv_scale, sizeof(float) * 4); - data = compressed<float>(stream_, true, true, version); - } - - c_vertex_table::c_vertex_table() {} - c_vertex_table::c_vertex_table(std::istream &stream_, uint32_t size_, uint32_t version = 68) : size(size_) { - uint32_t temp_count; - - point_flags = compressed<uint32_t>(stream_, true, true, version); - - uvsets.push_back(std::make_shared<uv>(stream_, version)); - - // UV optionala additional sets - stream_.read((char *)&temp_count, sizeof(uint32_t)); - for (int x = 0; x < temp_count-1; x++) { - uvsets.push_back(std::make_shared<uv>(stream_, version)); - } - - points = compressed<ace::vector3<float>>(stream_, true, false, false, version); - - size = points.size; - } - - named_selection::named_selection() {} - named_selection::named_selection(std::istream &stream_, uint32_t version = 68) { - uint32_t count; - uint32_t junk; - - READ_STRING(name); - - faces = compressed<uint16_t>(stream_, true, false, version); - - //face_weights = compressed<uint32_t>(stream_, true, false, version); // Face weights - face_weights = compressed<uint32_t>(stream_, true, false, version); - READ_BOOL(is_sectional); - - sections = compressed<uint32_t>(stream_, true, false, version); - vertex_table = compressed<uint16_t>(stream_, true, false, version); - texture_weights = compressed<uint8_t>(stream_, true, false, version); - - //stream_.read((char *)&junk, 4); - } - - - section::section() {} - section::section(std::istream &stream_, uint32_t version = 68) { - stream_.read((char *)&face_offsets, sizeof(uint32_t) * 2); - stream_.read((char *)&material_offsets, sizeof(uint32_t) * 2); - - stream_.read((char *)&common_points_user_value, sizeof(uint32_t)); - stream_.read((char *)&common_texture, sizeof(uint16_t)); - stream_.read((char *)&common_face_flags, sizeof(uint32_t)); - - stream_.read((char *)&material_index, sizeof(int32_t)); - if (material_index == -1) { - stream_.read((char *)&extra, sizeof(uint8_t)); - } - - if(version >= 68) stream_.read((char *)&u_long_2, sizeof(uint32_t)); - stream_.read((char *)&u_long_1, sizeof(uint32_t)); - stream_.read((char *)&u_float_resolution_1, sizeof(float)); - stream_.read((char *)&u_float_resolution_2, sizeof(float)); - } - - face::face() { } - face::face(std::istream & stream_, uint32_t version = 68) { - stream_.read((char *)&type, sizeof(uint8_t)); - assert(type == 3 || type == 4); - for (int x = 0; x < type; x++) { - uint16_t val; - stream_.read((char *)&val, sizeof(uint16_t)); - vertex_table.push_back(val); - } - } - - uint32_t flags; //ODOL7 ONLY see P3D Point and Face Flags - uint16_t texture; //ODOL7 ONLY - uint8_t type; // 3==Triangle or 4==Box - std::vector<uint16_t> vertex_table; - - stage_texture::stage_texture() : file(""), filter(0), transform_id(0) { } - stage_texture::stage_texture(std::istream &stream_, uint32_t type_) { - stream_.read((char *)&filter, sizeof(uint32_t)); - READ_STRING(file); - stream_.read((char *)&transform_id, sizeof(uint32_t)); - if (type_ == 11) { - READ_BOOL(wtf); - } - } - - material::material() { } - material::material(std::istream &stream_, uint32_t version = 68) { - uint32_t textures_count, transforms_count; - - READ_STRING(name); - - stream_.read((char *)&type, sizeof(uint32_t)); - - stream_.read((char *)&emissive, sizeof(float) * 4); - stream_.read((char *)&ambient, sizeof(float) * 4); - stream_.read((char *)&diffuse, sizeof(float) * 4); - stream_.read((char *)&forced_diffuse, sizeof(float) * 4); - stream_.read((char *)&specular, sizeof(float) * 4); - stream_.read((char *)&specular_2, sizeof(float) * 4); - - stream_.read((char *)&specular_power, sizeof(float)); - stream_.read((char *)&pixel_shader, sizeof(uint32_t)); - stream_.read((char *)&vertex_shader, sizeof(uint32_t)); - stream_.read((char *)&u_long_1, sizeof(uint32_t)); - stream_.read((char *)&an_index, sizeof(uint32_t)); - stream_.read((char *)&u_long_2, sizeof(uint32_t)); - - READ_STRING(surface); - - stream_.read((char *)&u_long_3, sizeof(uint32_t)); - stream_.read((char *)&render_flags, sizeof(uint32_t)); - - stream_.read((char *)&textures_count, sizeof(uint32_t)); - stream_.read((char *)&transforms_count, sizeof(uint32_t)); - - for (int x = 0; x < textures_count; x++) { - texture_stages.push_back(std::make_shared<stage_texture>(stream_, type)); - } - - for (int x = 0; x < textures_count; x++) { - uint32_t uv_source; - stream_.read((char *)&uv_source, sizeof(uint32_t)); - transform_stages.push_back(std::pair<uint32_t, transform_matrix>(uv_source, transform_matrix(stream_))); - } - if (type >= 10) { - texture_stages.push_back(std::make_shared<stage_texture>(stream_, type)); - } - } - - frame::frame() {} - frame::frame(std::istream &stream_, uint32_t version = 68) { - uint32_t count; - - stream_.read((char *)&time, sizeof(float)); - - stream_.read((char *)&count, sizeof(uint32_t)); - for (int x = 0; x < count; x++) { - bone_positions.push_back(ace::vector3<float>(stream_)); - } - } - - proxy::proxy() { } - proxy::proxy(std::istream &stream_, uint32_t version = 68) { - READ_STRING(name); - transform = ace::transform_matrix(stream_); - stream_.read((char *)&sequence_id, sizeof(uint32_t)); - stream_.read((char *)&named_selection_id, sizeof(uint32_t)); - stream_.read((char *)&bone_id, sizeof(uint32_t)); - stream_.read((char *)§ion_id, sizeof(uint32_t)); - - LOG(DEBUG) << "Proxy: [" << name << "]"; - - } - } -} \ No newline at end of file diff --git a/extensions/common/p3d/lod_info.hpp b/extensions/common/p3d/lod_info.hpp deleted file mode 100644 index 6d72f452506..00000000000 --- a/extensions/common/p3d/lod_info.hpp +++ /dev/null @@ -1,237 +0,0 @@ -#pragma once - -#include "shared.hpp" - -#include "vector.hpp" -#include "transform_matrix.hpp" -#include "compressed.hpp" - -namespace ace { - namespace p3d { - - class proxy { - public: - proxy(); - proxy(std::istream &, uint32_t); - - std::string name; //"\ca\a10\agm65" (.p3d is implied) <<note the leading filename backslash - ace::transform_matrix transform; //see Generic FileFormat Data Types - uint32_t sequence_id; // - uint32_t named_selection_id; //see P3D Named Selections - //////// ARMA ONLY (ODOLV4x) /////// - int32_t bone_id; - uint32_t section_id; //see P3D_Lod_Sections - }; - typedef std::shared_ptr<proxy> proxy_p; - - class stage_texture { - public: - stage_texture(); - stage_texture(std::istream &, uint32_t); - - uint32_t filter; - std::string file; - uint32_t transform_id; - bool wtf; - }; - typedef std::shared_ptr<stage_texture> stage_texture_p; - - class material { - public: - material(); - material(std::istream &, uint32_t); - - std::string name; - std::string surface; - - uint32_t render_flags; - uint32_t type; - - float emissive[4]; - float ambient[4]; - float diffuse[4]; - float forced_diffuse[4]; - float specular[4]; - float specular_2[4]; - float specular_power; - - uint32_t pixel_shader; - uint32_t vertex_shader; - - uint32_t u_long_1; - uint32_t an_index; - uint32_t u_long_2; - uint32_t u_long_3; - - std::vector<stage_texture_p> texture_stages; - std::vector<std::pair<uint32_t, transform_matrix>> transform_stages; - }; - typedef std::shared_ptr<material> material_p; - - class edge_set { - public: - std::vector<uint16_t> mlod; - std::vector<uint16_t> vertex; - }; - - class face { - public: - face(); - face(std::istream &, uint32_t); - - uint32_t flags; //ODOL7 ONLY see P3D Point and Face Flags - uint16_t texture; //ODOL7 ONLY - uint8_t type; // 3==Triangle or 4==Box - std::vector<uint16_t> vertex_table; - }; - typedef std::shared_ptr<face> face_p; - - class section { - public: - section(); - section(std::istream &, uint32_t); - - uint32_t face_offsets[2]; // from / to region of LodFaces used - uint32_t material_offsets[2]; // ODOLV4x only - uint32_t common_points_user_value; // see P3D Point and Face Flags - // 0xC9 -> LodPoints 0x0C90003F - // LodPointFlags are in a separate table for arma, and in the VertexTable for ofp (odol7) - uint16_t common_texture; // - uint32_t common_face_flags; // see P3D Point and Face Flags - ///////// // ODOLV4x only////// - int32_t material_index; - //if MaterialIndex == -1 - // { - // byte ExtraByte; - //} - uint8_t extra; - uint32_t u_long_1; // ???? New in version 68!!! - uint32_t u_long_2; // generally 2 - float u_float_resolution_1; - float u_float_resolution_2; // generally 1000.0 - }; - typedef std::shared_ptr<section> section_p; - - class named_selection { - public: - named_selection(); - named_selection(std::istream &, uint32_t); - - std::string name; // "rightleg" or "neck" eg - compressed<uint16_t> faces; // indexing into the LodFaces Table - compressed<uint32_t> face_weights; - uint32_t Always0Count; - bool is_sectional; //Appears in the sections[]= list of a model.cfg - compressed<uint32_t> sections; //IsSectional must be true. Indexes into the LodSections Table - compressed<uint16_t> vertex_table; - compressed<uint8_t> texture_weights; // if present they correspond to (are exentsions of) the VertexTableIndexes - }; - typedef std::shared_ptr<named_selection> named_selection_p; - - class frame { - public: - frame(); - frame(std::istream &, uint32_t); - - float time; - std::vector<ace::vector3<float>> bone_positions; - }; - typedef std::shared_ptr<frame> frame_p; - - class uv { - public: - uv(); - uv(std::istream &, uint32_t); - - float uv_scale[4]; - compressed<float> data; - }; - typedef std::shared_ptr<uv> uv_p; - - class c_vertex_table { - public: - c_vertex_table(); - c_vertex_table(std::istream &, uint32_t, uint32_t); - - uint32_t size; - - compressed<uint32_t> point_flags; // Potentially compressed - std::vector<uv_p> uvsets; - - compressed<ace::vector3<float>> points; - compressed<ace::vector3<float>> normals; - compressed<ace::pair<float>> minmax; - compressed<ace::vector3<float>> vert_properties; - compressed<ace::vector3<float>> unknown_vtx; - /* - uint32_t NoOfPoints; - - uint32_t nNormals; - (A2)LodNormals LodNormals[nNormals]; - uint32_t nMinMax; - (A2)LodMinMax MinMax[nMinMax]; //optional - uint32_t nProperties; - VertProperty VertProperties[nProperties]; //optional related to skeleton - uint32_t Count; - UnknownVtxStruct UnknownVtxStructs[Count]; //optional - */ - - }; - typedef std::shared_ptr<c_vertex_table> vertex_table_p; - - class lod { - public: - lod(); - lod(std::istream &, uint32_t, uint32_t); - ~lod(); - - uint32_t id; - - std::vector<proxy_p> proxies; // see P3D Lod Proxies - std::vector<uint32_t> items; // potentially compressed - std::vector<std::vector<uint32_t>> bone_links; - uint32_t point_count; - uint32_t u_float_1; - - float u_float_2; - float u_float_3; - ace::vector3<float> min_pos; - ace::vector3<float> max_pos; - ace::vector3<float> autocenter_pos; - float sphere; // same as geo or mem values in modelinfo, if this lod is geo or memlod of course - std::vector<std::string> textures; //"ca\characters\hhl\hhl_01_co.paa" - std::vector<material_p> materials; - - edge_set edges; - - uint32_t u_count; - uint32_t offset_sections; // see below - uint16_t u_short_1; - - uint32_t faces_allocation_size; - std::vector<face_p> faces; - std::vector<section_p> sections; - - std::vector<named_selection_p> selections; - - std::map<std::string, std::string> named_properties; - - std::vector<frame_p> frames; - - uint32_t icon_color; - uint32_t selected_color; - uint32_t u_residue; - uint8_t u_byte_1; - uint32_t vertex_table_size; - - vertex_table_p vertices; - - /* - //(including these 4 bytes) - LodPointFlags LodPointFlags; // Potentially compressed - VertexTable VertexTable;*/ - }; - typedef std::shared_ptr<lod> lod_p; - - } -} diff --git a/extensions/common/p3d/lod_types.hpp b/extensions/common/p3d/lod_types.hpp deleted file mode 100644 index 6affd2d3dc2..00000000000 --- a/extensions/common/p3d/lod_types.hpp +++ /dev/null @@ -1,33 +0,0 @@ -#pragma once - -enum lod_types { - LOD_TYPE_VIEWGUNNER = 0x447a0000, //1.0e3 1,000 View Gunner - LOD_TYPE_VIEWPILOT = 0x44898000, //1.1e3 1,100 View Pilot - LOD_TYPE_VIEWCARGO = 0x44960000, //1.2e3 1,200 View Cargo - LOD_TYPE_SHADOWSTENCILE = 0x461c4000, //1.0e4 10,000 Stencil Shadow - LOD_TYPE_SHADOWSTENCILE_2 = 0x461c6800,// 1.001e4 10, 010 Stencil Shadow 2 - LOD_TYPE_SHADOWVOLUME = 0x462be000,// 1.1e4 11000 Shadow Volume - LOD_TYPE_SHADOWVOLUME_2 = 0x462c0800,// 1.101e4 11010 Shadow Volume 2 - LOD_TYPE_GEOMETRY = 0x551184e7, // 1.0e13 10, 000, 000, 000, 000 Geometry - LOD_TYPE_MEMORY = 0x58635fa9, // 1.0e15 1, 000, 000, 000, 000, 000 Memory - LOD_TYPE_LANDCONTACT = 0x58e35fa9, // 2.0e15 2, 000, 000, 000, 000, 000 Land Contact - LOD_TYPE_ROADWAY = 0x592a87bf, // 3.0e15 3, 000, 000, 000, 000, 000 Roadway - LOD_TYPE_PATHS = 0x59635fa9, // 4.0e15 4, 000, 000, 000, 000, 000 Paths - LOD_TYPE_HITPOINTS = 0x598e1bca, // 5.0e15 5, 000, 000, 000, 000, 000 HitPoints - LOD_TYPE_GEOMETRY_VIEW = 0x59aa87bf, // 6.0e15 6, 000, 000, 000, 000, 000 View Geometry - LOD_TYPE_GEOMETRY_FIRE = 0x59c6f3b4, // 7.0e15 7, 000, 000, 000, 000, 000 Fire Geometry - LOD_TYPE_GEOMETRY_VIEWCARGO = 0x59e35fa9, // 8.0e15 8, 000, 000, 000, 000, 000 View Cargo Geometry - LOD_TYPE_GEOMETRY_VIEWCARGO_FIRE = 0x59ffcb9e, // 9.0e15 9, 000, 000, 000, 000, 000 View Cargo Fire Geometry - LOD_TYPE_VIEWCOMMANDER = 0x5a0e1bca, // 1.0e16 10, 000, 000, 000, 000, 000 View Commander - LOD_TYPE_GEOMETRY_VIEWCOMMANDER = 0x5a1c51c4, // 1.1e16 11, 000, 000, 000, 000, 000 View Commander Geometry - LOD_TYPE_GEOMETRY_VIEWCOMMANDER_FIRE = 0x5a2a87bf, // 1.2e16 12, 000, 000, 000, 000, 000 View Commander Fire Geometry - LOD_TYPE_VIEWPILOT_GEOMETRY = 0x5a38bdb9, // 1.3e16 13, 000, 000, 000, 000, 000 View Pilot Geometry - LOD_TYPE_GEOMETRY_VIEWPILOT_FIRE = 0x5a46f3b4, // 1.4e16 14, 000, 000, 000, 000, 000 View Pilot Fire Geometry - LOD_TYPE_VIEWGUNNER_GEOMETRY = 0x5a5529af, // 1.5e16 15, 000, 000, 000, 000, 000 View Gunner Geometry - LOD_TYPE_GEOMETRY_VIEWGUNNER_FIRE = 0x5a635fa9, // 1.6e16 16, 000, 000, 000, 000, 000 View Gunner Fire Geometry - LOD_TYPE_SUBPARTS = 0x5a7195a4, // 1.7e16 17, 000, 000, 000, 000, 000 Sub Parts - LOD_TYPE_SHADOWVOLUME_VIEWCARGO = 0x5a7fcb9e, // 1.8e16 18, 000, 000, 000, 000, 000 SHADOW_VOLUME_VIEW_CARGO - LOD_TYPE_SHADOWVOLUME_VIEWPILOT = 0x5a8700cc, // 1.9e16 19, 000, 000, 000, 000, 000 SHADOW_VOLUME_VIEW_PILOT - LOD_TYPE_SHADOWVOLUME_VIEWGUNNER = 0x5a8e1bca, // 2.0e16 20, 000, 000, 000, 000, 000 SHADOW_VOLUME_VIEW_GUNNER - LOD_TYPE_WRECK = 0x5a9536c7 // 2.1e16 21, 000, 000, 000, 000, 000 WRECK -}; \ No newline at end of file diff --git a/extensions/common/p3d/model.cpp b/extensions/common/p3d/model.cpp deleted file mode 100644 index e31858a5923..00000000000 --- a/extensions/common/p3d/model.cpp +++ /dev/null @@ -1,116 +0,0 @@ -#include "p3d/model.hpp" - -#include "read_helpers.hpp" - -namespace ace { - namespace p3d { - model::model() : skeleton(nullptr), info(nullptr), useFaceDefaults(nullptr) {} - model::model(std::istream &stream_, const std::string &filename_) { - filename = filename_; - - // get the full file size - stream_.seekg(0, std::ios::end); - size = stream_.tellg(); - stream_.seekg(0, std::ios::beg); - - // Parse header here - stream_.read((char *)&filetype, sizeof(uint32_t)); - stream_.read((char *)&version, sizeof(uint64_t)); - if (version >= 48) { - READ_STRING(prefix_name); - } - - stream_.read((char *)&lod_count, sizeof(uint32_t)); - - // parse model info here - info = std::make_shared<model_info>(stream_, lod_count); - skeleton = info->skeleton; - - READ_BOOL(has_animations); - if (has_animations) { - uint32_t animation_count = 0; - stream_.read((char *)&animation_count, sizeof(uint32_t)); - for (int x = 0; x < animation_count; x++) { - animations.push_back(std::make_shared<animation>(stream_, version)); - } - - - // Now we re-walk, and association animations and bones - uint32_t bone_count, local_lod_count; - stream_.read((char *)&local_lod_count, sizeof(uint32_t)); - for (int lod = 0; lod < local_lod_count; lod++) { - stream_.read((char *)&bone_count, sizeof(uint32_t)); - std::vector<uint32_t> lod_bone2anim; - for (int x = 0; x < bone_count; x++) { - uint32_t anim_count; - stream_.read((char *)&anim_count, sizeof(uint32_t)); - - for (int anim = 0; anim < anim_count; anim++) { - uint32_t anim_index; - stream_.read((char *)&anim_index, sizeof(uint32_t)); - if(std::find(skeleton->all_bones[x]->animations.begin(), skeleton->all_bones[x]->animations.end(), anim_index) == skeleton->all_bones[x]->animations.end()) { - skeleton->all_bones[x]->animations.push_back(anim_index); - } - }; - } - } - - // Anims2Bones - for (int lod = 0; lod < lod_count; lod++) { - for (animation_p & anim : animations) { - animate_bone_p next = std::make_shared<animate_bone>(); - next->lod = lod; - stream_.read((char *)&next->index, sizeof(int32_t)); - if (next->index != -1 && anim->type != 8 && anim->type != 9) { - next->axis_position = ace::vector3<float>(stream_); - next->axis_direction = ace::vector3<float>(stream_); - } - anim->bones.push_back(next); - } - } - } - // LOD indexes - for (int lod = 0; lod < lod_count; lod++) { - uint32_t offset; - stream_.read((char *)&offset, sizeof(uint32_t)); - start_lod.push_back(offset); - LOG(DEBUG) << "LOD Offset: #" << lod << " : " << offset; - } - for (int lod = 0; lod < lod_count; lod++) { - uint32_t offset; - stream_.read((char *)&offset, sizeof(uint32_t)); - end_lod.push_back(offset); - LOG(DEBUG) << "LOD Offset: #" << lod << " : " << offset; - } - - // Attempt to read the faces? - useFaceDefaults = new bool[lod_count]; - for (int lod = 0; lod < lod_count; lod++) { - READ_BOOL(useFaceDefaults[lod]); - } - for (int x = 0; x < lod_count; x++) { - if (!useFaceDefaults[x]) { - face_settings tface(stream_); // @TODO: we dont save these because WHY!? - } - } - - for (int lod = 0; lod < lod_count; lod++) { - char buffer[64]; - #ifdef _DEBUG - sprintf_s(buffer, "\t\t%08X", info->resolutions[lod]); - LOG(DEBUG) << "LOD #" << lod << ", type: " << buffer; - #endif - //if (info->resolutions[lod] == LOD_TYPE_GEOMETRY_FIRE) { - // LOG(DEBUG) << "Found a desired geometry"; - stream_.clear(); - stream_.seekg(start_lod[lod], stream_.beg); - lods.push_back(std::make_shared<ace::p3d::lod>(stream_, lod, version)); - //} - } - } - model::~model() { - if(useFaceDefaults) - delete[] useFaceDefaults; - } - } -} diff --git a/extensions/common/p3d/model.hpp b/extensions/common/p3d/model.hpp deleted file mode 100644 index fd25185637d..00000000000 --- a/extensions/common/p3d/model.hpp +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include "shared.hpp" - -#include "animation.hpp" -#include "skeleton.hpp" -#include "model_info.hpp" -#include "lod_info.hpp" - -namespace ace { - namespace p3d { - class face_settings { - public: - face_settings() {} - face_settings(std::istream &stream_, uint32_t version = 68) { - stream_.read((char *)&count, sizeof(uint32_t)); - stream_.read((char *)&unknown, sizeof(uint8_t) * 21); - } - - uint32_t count; - uint8_t unknown[21]; - }; - typedef std::shared_ptr<face_settings> face_settings_p; - - class model { - public: - model(); - model(std::istream &, const std::string &filename_ = ""); - ~model(); - - // LOD info - bool *useFaceDefaults; - std::vector<face> defaultFaces; - std::vector<lod_p> lods; - - size_t size; - model_info_p info; - skeleton_p skeleton; - - bool has_animations; - std::vector<animation_p> animations; - - - std::vector<uint32_t> start_lod; - std::vector<uint32_t> end_lod; - - // data root fileds - std::string filename; - uint32_t lod_count; - uint32_t filetype; - uint64_t version; - std::string prefix_name; - - }; - typedef std::shared_ptr<model> model_p; - } -} diff --git a/extensions/common/p3d/model_info.cpp b/extensions/common/p3d/model_info.cpp deleted file mode 100644 index c0ea50b71d3..00000000000 --- a/extensions/common/p3d/model_info.cpp +++ /dev/null @@ -1,91 +0,0 @@ -#include "p3d/model_info.hpp" -#include "compressed.hpp" -#include "read_helpers.hpp" - -namespace ace { - namespace p3d { - model_info::model_info() : - raw_resolutions(nullptr), u_floats_1(nullptr), default_indicators(nullptr) - { } - - model_info::model_info(std::istream & stream_, const uint32_t lod_count, uint32_t version) - : raw_resolutions(nullptr), u_floats_1(nullptr), default_indicators(nullptr) { - - raw_resolutions = new float[lod_count]; - stream_.read((char *)raw_resolutions, sizeof(float) * lod_count); - // Get them to parsable int values - for (int x = 0; x < lod_count; x++) { - resolutions.push_back(*(int *)&raw_resolutions[x]); - } - - stream_.read((char *)&index, sizeof(uint32_t)); - stream_.read((char *)&lod_sphere_mem, sizeof(float)); - stream_.read((char *)&lod_sphere_geo, sizeof(float)); - stream_.read((char *)&point_flags, sizeof(uint32_t) * 3); - - offset_1 = ace::vector3<float>(stream_); - - stream_.read((char *)&map_icon_color, sizeof(uint32_t)); - stream_.read((char *)&map_selected_color, sizeof(uint32_t)); - stream_.read((char *)&view_density, sizeof(float)); - - bbox_min_pos = ace::vector3<float>(stream_); - bbox_max_pos = ace::vector3<float>(stream_); - - center_of_gravity = ace::vector3<float>(stream_); - offset_2 = ace::vector3<float>(stream_); - cog_offset = ace::vector3<float>(stream_); - - mass_vectors[0] = ace::vector3<float>(stream_); - mass_vectors[1] = ace::vector3<float>(stream_); - mass_vectors[2] = ace::vector3<float>(stream_); - - stream_.read((char *)&thermal_profile_2, sizeof(uint8_t) * 24); - - READ_BOOL(autocenter); - READ_BOOL(lock_autocenter); - READ_BOOL(allow_occlude); - READ_BOOL(allow_occluded); - READ_BOOL(allow_animation); - - stream_.read((char *)&u_bytes_1, sizeof(uint8_t) * 6); - stream_.read((char *)&thermal_profile, sizeof(uint8_t) * 24); - stream_.read((char *)&u_long_1, sizeof(uint32_t)); - - // Parse the full skeletal structure - skeleton = std::make_shared<ace::p3d::skeleton>(stream_, lod_count); - - stream_.read((char *)&u_byte_1, sizeof(uint8_t)); - - compressed<float> u_floats_1(stream_, true, false, version); - - stream_.read((char *)&mass, sizeof(float)); - stream_.read((char *)&mass_reciprocal, sizeof(float)); - stream_.read((char *)&mass_alt, sizeof(float)); - stream_.read((char *)&mass_alt_reciprocoal, sizeof(float)); - - stream_.read((char *)&u_bytes_1, sizeof(uint8_t) * 14); - - // - stream_.read((char *)&u_long_1, sizeof(uint32_t)); - READ_BOOL(u_bool_1); - //if (u_bool_1) { - - READ_STRING(class_type); - READ_STRING(destruct_type); - READ_BOOL(u_bool_2); - stream_.read((char *)&u_long_2, sizeof(uint32_t)); - - stream_.seekg(sizeof(uint8_t) * 12 * lod_count, stream_.cur); - } - - model_info::~model_info() { - if (raw_resolutions) - delete[] raw_resolutions; - if (u_floats_1) - delete[] u_floats_1; - if (default_indicators) - delete[] default_indicators; - } - } -} diff --git a/extensions/common/p3d/model_info.hpp b/extensions/common/p3d/model_info.hpp deleted file mode 100644 index 57eb07fab3b..00000000000 --- a/extensions/common/p3d/model_info.hpp +++ /dev/null @@ -1,74 +0,0 @@ -#pragma once - -#include "shared.hpp" -#include "vector.hpp" -#include "skeleton.hpp" -#include "lod_types.hpp" -#include <sstream> - -namespace ace { - namespace p3d { - class model_info { - public: - model_info(); - model_info(std::istream &, const uint32_t lod_count, uint32_t version = 68); - ~model_info(); - - - public: - std::vector<int> resolutions; - float *raw_resolutions;//LodTypes[Header.NoOfLods];// alias resolutions - uint32_t index; // appears to be a bit flag, 512, 256 eg - float lod_sphere_mem; - float lod_sphere_geo; // mostly same as MemLodSphere - uint32_t point_flags[3]; // typically 00 00 00 00 00 00 00 00 00 00 0C 00 eg (last is same as user point flags) - ace::vector3<float> offset_1; // model offset (unknown functionality),//mostly same as offset2 - uint32_t map_icon_color; // RGBA 32 color - uint32_t map_selected_color; // RGBA 32 color - float view_density; // - - ace::vector3<float> bbox_min_pos; // minimum coordinates of bounding box - ace::vector3<float> bbox_max_pos; // maximum coordinates of bounding box. Generally the complement of the 1st - // pew.GeometryBounds in Pew is bboxMinPosition-bboxMaxPosition for X and Z - // pew.ResolutionBounds mostly the same - ace::vector3<float> center_of_gravity; // pew.GeometryAutoCenterPos (and mostly pew.ResolutionAutoCenterPos too) - ace::vector3<float> offset_2; // mostly same as Offset1 often same as CentreOfGravity (but it isn't ResolutionPos) - ace::vector3<float> cog_offset; // see below - ace::vector3<float> mass_vectors[3]; // for ODOL7 this is a mixture of floats and index values - //// if Arma3 ///////////////// - uint8_t thermal_profile_2[24]; - /////////////////////////////// - bool autocenter; - bool lock_autocenter; - bool allow_occlude; - bool allow_occluded; - bool allow_animation; - ///////////ARMA/VBS2 //////////// - uint8_t u_bytes_1[6]; // - uint8_t thermal_profile[24]; // - uint32_t u_long_1; // V48 and beyond - //uint8_t thermal_profile[24]; // TOH only (v52) see above for arma3 - - skeleton_p skeleton; // - - uint8_t u_byte_1; - uint32_t u_floats_1_size; // always zero for arma - float *u_floats_1; // potentially compressed - float mass; - float mass_reciprocal; // see note - float mass_alt; // see note - float mass_alt_reciprocoal; // see note - uint8_t u_bytes_2[14]; // see note generally FF FF FF FF FF FF FF FF FF FF FF FF - uint8_t u_short_1; // often same as NoOfLods - bool u_bool_1; // generally set if ascii below has strings - std::string class_type; // asciiz ClassType; // class="House" See Named Properties - std::string destruct_type; //DestructType; // damage="Tent" See Named Properties - bool u_bool_2; // rarely true - bool u_bool_3; // rarely true - uint32_t u_long_2; // - uint8_t *default_indicators;//default_indicators[NoOfLods][12]; //generally FF FF FF FF FF FF FF FF FF FF FF FF - }; - typedef std::shared_ptr<model_info> model_info_p; - - } -} diff --git a/extensions/common/p3d/parser.cpp b/extensions/common/p3d/parser.cpp deleted file mode 100644 index ba85aa3234e..00000000000 --- a/extensions/common/p3d/parser.cpp +++ /dev/null @@ -1,26 +0,0 @@ -#pragma once - -#include "p3d/parser.hpp" - -namespace ace { - namespace p3d { - parser::parser() { } - parser::~parser() { } - - model_p parser::load(const std::string &filepath) { - std::fstream filestream; - model_p _model = nullptr; - - filestream.open(filepath, std::ios::binary | std::ios::in); - if (!filestream.good()) { - LOG(ERROR) << "Cannot open file"; - return _model; - } - - _model = std::make_shared<model>(filestream, filepath); - - return _model; - } - } -} - diff --git a/extensions/common/p3d/parser.hpp b/extensions/common/p3d/parser.hpp deleted file mode 100644 index a4edd838b72..00000000000 --- a/extensions/common/p3d/parser.hpp +++ /dev/null @@ -1,17 +0,0 @@ -#pragma once - -#include "shared.hpp" -#include "p3d/model.hpp" - - -namespace ace { - namespace p3d { - class parser { - public: - parser(); - ~parser(); - - model_p load(const std::string &); - }; - } -} diff --git a/extensions/common/p3d/parser_ref.txt b/extensions/common/p3d/parser_ref.txt deleted file mode 100644 index d72e5aa9680..00000000000 --- a/extensions/common/p3d/parser_ref.txt +++ /dev/null @@ -1,269 +0,0 @@ -#pragma once - -#include "ace_common.h" -#include "p3d/parser.hpp" -#include "p3d/model.hpp" - -#include <fstream> - -#include <lzo/minilzo.h> - -namespace ace { - namespace p3d { - - parser::parser() {} - parser::~parser() {} - - model * parser::load(const std::string filepath) { - std::ifstream ifstream; - model *_model = new model(); - size_t index = 4; - - _model->filepath = filepath; - - ifstream.open(filepath, std::ios::binary); - if (!ifstream.good()) { - printf("! File not found\n"); - return false; - } - // get length of file: - ifstream.seekg(0, std::ios::end); - _model->size = ifstream.tellg(); - ifstream.seekg(0, std::ios::beg); - - // Read the whole file into memory real fast - _model->raw = new unsigned char[_model->size]; - ifstream.read((char *)_model->raw, _model->size); - - // use the ifstream to read the data - ifstream.seekg(0, std::ios::beg); - - ifstream.read((char *)&_model->header.filetype, 4); - ifstream.read((char *)&_model->header.version, sizeof(uint64_t)); - - // If version > 48, it may have a path or a empty null byte. - if (_model->header.version >= 48) { - for (int x = 0; x < sizeof(_model->header.prefix); x++) { - char byte; - ifstream.read(&byte, 1); - _model->header.prefix[x] = byte; - if (byte == 0x00) break; - } - } - - ifstream.read((char *)&_model->header.lod_count, sizeof(uint32_t)); - - printf("Version: %d\n", _model->header.version); - printf("%s\n", _model->header.prefix); - printf("\tLODs:\t%d\n", (long long)_model->header.lod_count); -#ifdef _DEBUG -#define READ_DATA(stream, output, size) stream.read((char *)&output, size); -#else -#define READ_DATA(stream, output, size) stream.read((char *)&output, size); -#endif -#define PRINT_INDEX { std::streamoff pos = ifstream.tellg(); printf("Current Index: %08x\n", pos); } - - // Begin model info - READ_DATA(ifstream, _model->info.LodResolutions, sizeof(float)*_model->header.lod_count); - READ_DATA(ifstream, _model->info.Index, sizeof(uint32_t)); - READ_DATA(ifstream, _model->info.MemLodSphere, sizeof(float)); - READ_DATA(ifstream, _model->info.GeoLodSphere, sizeof(float)); - READ_DATA(ifstream, _model->info.PointFlags, sizeof(uint32_t)*3); - READ_DATA(ifstream, _model->info.Offset1, sizeof(XYZTriplet)); - - READ_DATA(ifstream, _model->info.mapIconColor, sizeof(uint32_t)); - READ_DATA(ifstream, _model->info.mapSelectedColor, sizeof(uint32_t)); - READ_DATA(ifstream, _model->info.ViewDensity, sizeof(float)); - - READ_DATA(ifstream, _model->info.bboxMinPosition, sizeof(XYZTriplet)); - READ_DATA(ifstream, _model->info.bboxMaxPosition, sizeof(XYZTriplet)); - READ_DATA(ifstream, _model->info.CentreOfGravity, sizeof(XYZTriplet)); - READ_DATA(ifstream, _model->info.Offset2, sizeof(XYZTriplet)); - READ_DATA(ifstream, _model->info.CogOffset, sizeof(XYZTriplet)); - READ_DATA(ifstream, _model->info.ModelMassVectors, sizeof(XYZTriplet)*3); - - READ_DATA(ifstream, _model->info.ThermalProfile2, sizeof(uint8_t)*24); - - READ_DATA(ifstream, _model->info.AutoCenter, sizeof(uint8_t)); - READ_DATA(ifstream, _model->info.lockAutoCenter, sizeof(uint8_t)); - READ_DATA(ifstream, _model->info.canOcclude, sizeof(uint8_t)); - READ_DATA(ifstream, _model->info.canBeOccluded, sizeof(uint8_t)); - READ_DATA(ifstream, _model->info.allowAnimation, sizeof(uint8_t)); - - READ_DATA(ifstream, _model->info.UnknownARMAFlags, sizeof(uint8_t) * 6); - READ_DATA(ifstream, _model->info.ThermalProfile, sizeof(uint8_t) * 24); - READ_DATA(ifstream, _model->info.UnknownLong, sizeof(uint32_t)); - - // Skeleton! - for (int x = 0; x < sizeof(_model->info.Skeleton); x++) { - char byte; - ifstream.read(&byte, 1); - _model->info.Skeleton.name[x] = byte; - if (byte == 0x00) break; - } - if (_model->info.Skeleton.name[0] != 0x00) { - READ_DATA(ifstream, _model->info.Skeleton.isInherited, sizeof(uint8_t)); - READ_DATA(ifstream, _model->info.Skeleton.bone_count, sizeof(uint32_t)); - for (int x = 0; x < 256 && x < _model->info.Skeleton.bone_count; x++) { - for (int y = 0; y < sizeof(_model->info.Skeleton.bone_names[x].BoneName); y++) { - char byte; - ifstream.read(&byte, 1); - _model->info.Skeleton.bone_names[x].BoneName[y] = byte; - if (byte == 0x00) break; - } - for (int y = 0; y < sizeof(_model->info.Skeleton.bone_names[x].ParentBoneName); y++) { - char byte; - ifstream.read(&byte, 1); - _model->info.Skeleton.bone_names[x].ParentBoneName[y] = byte; - if (byte == 0x00) break; - } - printf("Read bone entry: %s -> Parent:%s\n", _model->info.Skeleton.bone_names[x].BoneName, _model->info.Skeleton.bone_names[x].ParentBoneName); - } - } - - READ_DATA(ifstream, _model->info.UnknownByte, sizeof(uint8_t)); - READ_DATA(ifstream, _model->info.nFloats, sizeof(uint32_t)); - - printf("Floats: %d\n", _model->info.nFloats); - if (_model->info.nFloats * sizeof(float) > 1024) { - // TODO!: Read compressed segment - } else { - ifstream.seekg(_model->info.nFloats*sizeof(float), ifstream.cur); - //READ_DATA(ifstream, _model->info.UnknownFloats, ); - } - - READ_DATA(ifstream, _model->info.Mass, sizeof(float)); - READ_DATA(ifstream, _model->info.MassReciprocal, sizeof(float)); - READ_DATA(ifstream, _model->info.AltMass, sizeof(float)); - READ_DATA(ifstream, _model->info.AltMassReciprocal, sizeof(float)); - - READ_DATA(ifstream, _model->info.UnknownByteIndices, sizeof(uint8_t) * 14); - READ_DATA(ifstream, _model->info.UnknownShort, sizeof(uint16_t)); - READ_DATA(ifstream, _model->info.UnknownLodCount, sizeof(uint32_t)); - READ_DATA(ifstream, _model->info.UnknownBool, sizeof(uint8_t)); - /* - for (int x = 0; x < sizeof(_model->info.ClassType); x++) { - char byte; - ifstream.read(&byte, 1); - _model->info.ClassType[x] = byte; - if (byte == 0x00 || byte == 0xff) break; - } - for (int x = 0; x < sizeof(_model->info.DestructType); x++) { - char byte; - ifstream.read(&byte, 1); - _model->info.DestructType[x] = byte; - if (byte == 0x00 || byte == 0xff) break; - }*/ - - READ_DATA(ifstream, _model->info.UnknownBool2, sizeof(uint8_t)); - READ_DATA(ifstream, _model->info.Always0, sizeof(uint8_t)); - for (int x = 0; x < sizeof(_model->header.lod_count); x++) { - READ_DATA(ifstream, _model->info.DefaultIndicators[x], sizeof(uint8_t)*12); - } - - // Read ahead because i dont understand whats going on - for (int x = 0; x < _model->size; x++) { - char byte; - ifstream.read(&byte, 1); - if (byte != -1) { - ifstream.seekg(-1, ifstream.cur); - break; - }; - } - - READ_DATA(ifstream, _model->animations.AnimsExist, sizeof(uint8_t)); - if (_model->animations.AnimsExist) { - READ_DATA(ifstream, _model->animations.nAnimationClasses, sizeof(uint32_t)); - printf("Animations: %d", _model->animations.nAnimationClasses); - - for (int n = 0; n < _model->animations.nAnimationClasses; n++) { - READ_DATA(ifstream, _model->animations.AnimationClasses[n].AnimTransformType, sizeof(uint32_t)); - - for (int x = 0; x < sizeof(_model->animations.AnimationClasses[n].AnimClassName); x++) { - char byte; - ifstream.read(&byte, 1); - _model->animations.AnimationClasses[n].AnimClassName[x] = byte; - if (byte == 0x00) break; - } - for (int x = 0; x < sizeof(_model->animations.AnimationClasses[n].AnimSource); x++) { - char byte; - ifstream.read(&byte, 1); - _model->animations.AnimationClasses[n].AnimSource[x] = byte; - if (byte == 0x00) break; - } - - printf("Reading animation: [%08x]-[%s]-%s\n", _model->animations.AnimationClasses[n].AnimTransformType, _model->animations.AnimationClasses[n].AnimClassName, _model->animations.AnimationClasses[n].AnimSource); - - READ_DATA(ifstream, _model->animations.AnimationClasses[n].MinMaxValue, sizeof(float) * 2); - READ_DATA(ifstream, _model->animations.AnimationClasses[n].MinMaxPhase, sizeof(float) * 2); - READ_DATA(ifstream, _model->animations.AnimationClasses[n].sourceAddress, sizeof(uint32_t)); - READ_DATA(ifstream, _model->animations.AnimationClasses[n].Always0, sizeof(uint32_t)); - - READ_DATA(ifstream, _model->animations.AnimationClasses[n].nFloats, sizeof(uint32_t)); - for (int x = 0; x < _model->animations.AnimationClasses[n].nFloats; x++) { - READ_DATA(ifstream, _model->animations.AnimationClasses[n].floats, sizeof(float)); - } - - READ_DATA(ifstream, _model->animations.AnimationClasses[n].value, sizeof(float)); - switch (_model->animations.AnimationClasses[n].AnimTransformType) { - case 0:READ_DATA(ifstream, _model->animations.AnimationClasses[n].data, sizeof(float)); break;//rotaton - case 1:READ_DATA(ifstream, _model->animations.AnimationClasses[n].data, sizeof(float)); break;//rotationX - case 2:READ_DATA(ifstream, _model->animations.AnimationClasses[n].data, sizeof(float)); break;//rotationY - case 3:READ_DATA(ifstream, _model->animations.AnimationClasses[n].data, sizeof(float)); break;//rotationZ - READ_DATA(ifstream, _model->animations.AnimationClasses[n].data, sizeof(float) * 2); - break; - case 4:READ_DATA(ifstream, _model->animations.AnimationClasses[n].data, sizeof(float)); break;//translation - case 5:READ_DATA(ifstream, _model->animations.AnimationClasses[n].data, sizeof(float)); break;//translationX - case 6:READ_DATA(ifstream, _model->animations.AnimationClasses[n].data, sizeof(float)); break;//translationY - case 7:READ_DATA(ifstream, _model->animations.AnimationClasses[n].data, sizeof(float)); break; //translationZ - READ_DATA(ifstream, _model->animations.AnimationClasses[n].data, sizeof(float)*2); - break; - case 8: //"direct" - READ_DATA(ifstream, _model->animations.AnimationClasses[n].data, sizeof(float) * 8); - break; - case 9: //"hide" - READ_DATA(ifstream, _model->animations.AnimationClasses[n].data, sizeof(float)); - break; - default: - READ_DATA(ifstream, _model->animations.AnimationClasses[n].value, sizeof(float)); - } - PRINT_INDEX; - } - } - - // Animations done, WEEE! - READ_DATA(ifstream, _model->animations.NoOfResolutions, sizeof(uint32_t)); - for (int x = 0; x < _model->animations.NoOfResolutions; x++) { - // Read a Bones2Anims entry - READ_DATA(ifstream, _model->animations.Bones2Anims[x].NoOfBones, sizeof(uint32_t)); - for (int y = 0; y < _model->animations.Bones2Anims[x].NoOfBones; y++) { - READ_DATA(ifstream, _model->animations.Bones2Anims[x].Bone2AnimClassLists[y].NoOfAnimClasses, sizeof(uint32_t)); - for (int z = 0; z < _model->animations.Bones2Anims[x].Bone2AnimClassLists[y].NoOfAnimClasses; z++) { - READ_DATA(ifstream, _model->animations.Bones2Anims[x].Bone2AnimClassLists[y].AnimationClassIndex[z], sizeof(uint32_t)); - } - } - } - - for (int x = 0; x < _model->animations.NoOfResolutions; x++) { - // Read Anims2Bones - for (int y = 0; y < _model->animations.nAnimationClasses; y++) { - READ_DATA(ifstream, _model->animations.Anims2Bones[x].AnimBones[y].SkeletonBoneNameIndex, sizeof(uint32_t)); - - if (_model->animations.Anims2Bones[x].AnimBones[y].SkeletonBoneNameIndex != -1 && _model->animations.AnimationClasses[y].AnimTransformType != 8 && _model->animations.AnimationClasses[y].AnimTransformType != 9) { - READ_DATA(ifstream, _model->animations.Anims2Bones[x].AnimBones[y].axisPos, sizeof(float) * 3); - READ_DATA(ifstream, _model->animations.Anims2Bones[x].AnimBones[y].axisDir, sizeof(float) * 3); - } - PRINT_INDEX; - printf("Read bone index: %d\n", _model->animations.Anims2Bones[x].AnimBones[y].SkeletonBoneNameIndex); - } - } - - READ_DATA(ifstream, _model->StartAddressOfLods, sizeof(uint32_t)*_model->header.lod_count); - READ_DATA(ifstream, _model->EndAddressOfLods, sizeof(uint32_t)*_model->header.lod_count); - - printf("Beginning LOD Read: Start[%d] End[%d]\n", _model->StartAddressOfLods, _model->EndAddressOfLods); - - return _model; - } - }; -}; \ No newline at end of file diff --git a/extensions/common/p3d/read_helpers.hpp b/extensions/common/p3d/read_helpers.hpp deleted file mode 100644 index af5fa2f63a1..00000000000 --- a/extensions/common/p3d/read_helpers.hpp +++ /dev/null @@ -1,11 +0,0 @@ -#pragma once - -#define READ_BOOL(output) { uint8_t temp; stream_.read((char *)&temp, 1); if(temp != 0) { output = true; } else { output = false; } } -#define READ_DATA(output, size) stream_.read((char *)&output, size); -#define READ_STRING(output) { \ - std::stringstream ss; \ - for(int x = 0; x < 2056;x++) { char byte = 0; stream_.read((char *)&byte, 1); if(byte == 0x00) break; ss << byte; } \ - output = ss.str(); \ - } -// @TODO: -#define READ_COMPRESSED_DATA(output, size) stream_.read((char *)&output, size) diff --git a/extensions/common/p3d/skeleton.cpp b/extensions/common/p3d/skeleton.cpp deleted file mode 100644 index 3cf7a9b736f..00000000000 --- a/extensions/common/p3d/skeleton.cpp +++ /dev/null @@ -1,46 +0,0 @@ -#include "p3d/model.hpp" -#include <sstream> - -#include "read_helpers.hpp" - -namespace ace { - namespace p3d { - skeleton::skeleton() : size(0) {} - skeleton::skeleton(std::istream & stream_, const uint32_t lod_count) : size(0) { - READ_STRING(name); - if (name.length() > 1) { - READ_BOOL(inherited); - stream_.read((char *)&size, sizeof(uint32_t)); - - for (int x = 0; x < size; x++) { - std::string _name, _parent; - - READ_STRING(_name); - READ_STRING(_parent); - - all_bones.push_back(std::make_shared<bone>(_name, _parent)); - } - - for (auto& tbone : all_bones) { - for (auto& child : all_bones) { - if (child->parent == tbone->name) { - tbone->children.push_back(child->name); - } - } - - if (tbone->parent.length() < 1) { - root_bones[tbone->name] = tbone; - } - } - - // Skip a byte because! - //stream_.seekg(1, stream_.cur); - LOG(DEBUG) << "Skeleton loaded: " << name; - char junk; - stream_.read((char *)&junk, sizeof(uint8_t)); - } - - } - skeleton::~skeleton() {} - } -} diff --git a/extensions/common/p3d/skeleton.hpp b/extensions/common/p3d/skeleton.hpp deleted file mode 100644 index 5b2a5b9a755..00000000000 --- a/extensions/common/p3d/skeleton.hpp +++ /dev/null @@ -1,36 +0,0 @@ -#pragma once -#pragma once - -#include "shared.hpp" - - -namespace ace { - namespace p3d { - class bone { - public: - bone() : name(""), parent("") {} - bone(const std::string & name_, const std::string & parent_) - : name(name_), parent(parent_) { - } - std::string name; - std::string parent; - std::vector<std::string> children; - std::vector<uint32_t> animations; - }; - typedef std::shared_ptr<bone> bone_p; - - class skeleton { - public: - skeleton(); - skeleton(std::istream &, const uint32_t lod_count); - ~skeleton(); - - std::string name; - bool inherited; - uint32_t size; - std::map<std::string, bone_p> root_bones; - std::vector<bone_p> all_bones; - }; - typedef std::shared_ptr<skeleton> skeleton_p; - } -} diff --git a/extensions/common/pbo/archive.cpp b/extensions/common/pbo/archive.cpp deleted file mode 100644 index 32ae110efa6..00000000000 --- a/extensions/common/pbo/archive.cpp +++ /dev/null @@ -1,91 +0,0 @@ -#pragma once - -#include "archive.hpp" -#include "p3d/read_helpers.hpp" - -namespace ace { - namespace pbo { - - bool archive::get_file(std::istream &, const std::string & file, file_p output) { - return false; - } - - bool archive::get_file(std::istream & stream_, const entry_p entry, file_p output) { - uint32_t file_offset, bytes_read, use_size; - - std::streampos _save = stream_.tellg(); - file_offset = begin_data_offset + entry->offset; - - use_size = std::max(entry->size, entry->storage_size); - output->data = new uint8_t[use_size]; - - bytes_read = 0; - stream_.seekg(file_offset, stream_.beg); - while (bytes_read < use_size) { - if (!stream_.read((char *)output->data + bytes_read, use_size - bytes_read)) { - delete[] output->data; - output->data = nullptr; - return false; - } - bytes_read += stream_.gcount(); - } - - - output->size = use_size; - output->entry = entry; - - stream_.seekg(_save, stream_.beg); - - return true; - } - - archive::archive() { } - archive::archive(std::istream &stream_) { - // Read the first entry, then info, then next entry - uint32_t offset = 0; - entry_p root_entry = std::make_shared<entry>(stream_); - info = std::make_shared<ext_entry>(stream_); - root_entry->offset = 0; - entries.push_back(root_entry); - - entry_p next_entry = std::make_shared<entry>(stream_); - while (next_entry->filename != "") { // off by 1006 ?! - next_entry->offset = offset; - entries.push_back(next_entry); - offset += next_entry->storage_size; - - next_entry = std::make_shared<entry>(stream_); - } - begin_data_offset = stream_.tellg(); - } - archive::~archive() {} - - entry::entry() {} - entry::entry(std::istream &stream_) { - READ_STRING(filename); - std::transform(filename.begin(), filename.end(), filename.begin(), ::tolower); - - stream_.read((char *)&compression, sizeof(uint32_t)); - stream_.read((char *)&size, sizeof(uint32_t)); - stream_.read((char *)&reserved, sizeof(uint32_t)); - stream_.read((char *)×tamp, sizeof(uint32_t)); - stream_.read((char *)&storage_size, sizeof(uint32_t)); - } - - ext_entry::ext_entry() {} - ext_entry::ext_entry(std::istream &stream_) { - READ_STRING(name); - READ_STRING(data); - READ_STRING(version); - - std::string temp; - temp = version; - - while (temp != "") { - extras.push_back(temp); - READ_STRING(temp); - } - - } - } -} diff --git a/extensions/common/pbo/archive.hpp b/extensions/common/pbo/archive.hpp deleted file mode 100644 index dab2cf78f6f..00000000000 --- a/extensions/common/pbo/archive.hpp +++ /dev/null @@ -1,61 +0,0 @@ -#pragma once - -#include "shared.hpp" - -namespace ace { - namespace pbo { - class ext_entry { - public: - ext_entry(); - ext_entry(std::istream &); - - std::string name; - std::string data; - std::string version; - - std::vector<std::string> extras; - }; - typedef std::shared_ptr<ext_entry> ext_entry_p; - - class entry { - public: - entry(); - entry(std::istream &); - - std::string filename; - - uint32_t compression; - uint32_t size; - uint32_t storage_size; - uint32_t offset; // pre-computed during search, offset of file - - uint32_t reserved; - uint32_t timestamp; - }; - typedef std::shared_ptr<entry> entry_p; - - class file { - public: - entry_p entry; - uint8_t *data; - uint32_t size; - }; - typedef std::shared_ptr<file> file_p; - - class archive { - public: - archive(); - archive(std::istream &); - ~archive(); - - bool get_file(std::istream &, const std::string & file, file_p output); - bool get_file(std::istream &, const entry_p entry, file_p output); - - uint32_t begin_data_offset; - - ext_entry_p info; - std::vector<entry_p> entries; - }; - typedef std::shared_ptr<archive> archive_p; - } -} diff --git a/extensions/common/pbo/search.cpp b/extensions/common/pbo/search.cpp deleted file mode 100644 index d4e3ef53b0c..00000000000 --- a/extensions/common/pbo/search.cpp +++ /dev/null @@ -1,305 +0,0 @@ -#ifdef _WIN32 - -#include "search.hpp" -#include <sstream> -#include <iterator> -#include <algorithm> -#include <regex> - -#define NT_SUCCESS(x) ((x) >= 0) -#define STATUS_INFO_LENGTH_MISMATCH 0xc0000004 - -#define SystemHandleInformation 16 -#define ObjectBasicInformation 0 -#define ObjectNameInformation 1 -#define ObjectTypeInformation 2 - -typedef NTSTATUS(NTAPI *_NtQuerySystemInformation)( - ULONG SystemInformationClass, - PVOID SystemInformation, - ULONG SystemInformationLength, - PULONG ReturnLength - ); -typedef NTSTATUS(NTAPI *_NtDuplicateObject)( - HANDLE SourceProcessHandle, - HANDLE SourceHandle, - HANDLE TargetProcessHandle, - PHANDLE TargetHandle, - ACCESS_MASK DesiredAccess, - ULONG Attributes, - ULONG Options - ); -typedef NTSTATUS(NTAPI *_NtQueryObject)( - HANDLE ObjectHandle, - ULONG ObjectInformationClass, - PVOID ObjectInformation, - ULONG ObjectInformationLength, - PULONG ReturnLength - ); - -typedef struct _UNICODE_STRING -{ - USHORT Length; - USHORT MaximumLength; - PWSTR Buffer; -} UNICODE_STRING, *PUNICODE_STRING; - -typedef struct _SYSTEM_HANDLE -{ - ULONG ProcessId; - BYTE ObjectTypeNumber; - BYTE Flags; - USHORT Handle; - PVOID Object; - ACCESS_MASK GrantedAccess; -} SYSTEM_HANDLE, *PSYSTEM_HANDLE; - -typedef struct _SYSTEM_HANDLE_INFORMATION -{ - ULONG HandleCount; - SYSTEM_HANDLE Handles[1]; -} SYSTEM_HANDLE_INFORMATION, *PSYSTEM_HANDLE_INFORMATION; - -typedef enum _POOL_TYPE -{ - NonPagedPool, - PagedPool, - NonPagedPoolMustSucceed, - DontUseThisType, - NonPagedPoolCacheAligned, - PagedPoolCacheAligned, - NonPagedPoolCacheAlignedMustS -} POOL_TYPE, *PPOOL_TYPE; - -typedef struct _OBJECT_TYPE_INFORMATION -{ - UNICODE_STRING Name; - ULONG TotalNumberOfObjects; - ULONG TotalNumberOfHandles; - ULONG TotalPagedPoolUsage; - ULONG TotalNonPagedPoolUsage; - ULONG TotalNamePoolUsage; - ULONG TotalHandleTableUsage; - ULONG HighWaterNumberOfObjects; - ULONG HighWaterNumberOfHandles; - ULONG HighWaterPagedPoolUsage; - ULONG HighWaterNonPagedPoolUsage; - ULONG HighWaterNamePoolUsage; - ULONG HighWaterHandleTableUsage; - ULONG InvalidAttributes; - GENERIC_MAPPING GenericMapping; - ULONG ValidAccess; - BOOLEAN SecurityRequired; - BOOLEAN MaintainHandleCount; - USHORT MaintainTypeList; - POOL_TYPE PoolType; - ULONG PagedPoolUsage; - ULONG NonPagedPoolUsage; -} OBJECT_TYPE_INFORMATION, *POBJECT_TYPE_INFORMATION; - -PVOID GetLibraryProcAddress(LPCSTR LibraryName, LPCSTR ProcName) -{ - return GetProcAddress(GetModuleHandleA(LibraryName), ProcName); -} - -namespace ace { - namespace pbo { - - bool search::index_files() { - return index_files(".*"); - } - - bool search::index_files(const std::string &filter) { - std::ifstream pbo_stream; - std::regex txt_regex(filter); - - if (_active_pbo_list.size() < 1) - return false; - - for (auto & pbo_file_path : _active_pbo_list) { - pbo_stream.open(pbo_file_path, std::ios::binary | std::ios::in); - if (!pbo_stream.good()) { - LOG(ERROR) << "Cannot open file - " << pbo_file_path; - continue; - } - - ace::pbo::archive _archive(pbo_stream); - for (ace::pbo::entry_p & entry : _archive.entries) { - if (entry->filename != "") { - if (std::regex_match(entry->filename, txt_regex)) { - std::string full_virtual_path = _archive.info->data + "\\" + entry->filename; - std::transform(full_virtual_path.begin(), full_virtual_path.end(), full_virtual_path.begin(), ::tolower); - _file_pbo_index[full_virtual_path] = pbo_file_path; - //LOG(DEBUG) << full_virtual_path << " = " << pbo_file_path; - } - } - } - pbo_stream.close(); - } - - LOG(INFO) << "PBO Index complete"; - - return true; - } - - search::search(const std::string & filter) { - generate_pbo_list(); - index_files(filter); - } - - search::search() { - generate_pbo_list(); - index_files(); - } - - bool search::generate_pbo_list() { - NTSTATUS status; - PSYSTEM_HANDLE_INFORMATION handleInfo; - ULONG handleInfoSize = 0x10000; - ULONG pid; - HANDLE processHandle; - ULONG i; - - _NtQuerySystemInformation NtQuerySystemInformation = - (_NtQuerySystemInformation)GetLibraryProcAddress("ntdll.dll", "NtQuerySystemInformation"); - _NtDuplicateObject NtDuplicateObject = - (_NtDuplicateObject)GetLibraryProcAddress("ntdll.dll", "NtDuplicateObject"); - _NtQueryObject NtQueryObject = - (_NtQueryObject)GetLibraryProcAddress("ntdll.dll", "NtQueryObject"); - - if (!NtQuerySystemInformation || !NtDuplicateObject || !NtQueryObject) - return false; - - pid = GetCurrentProcessId(); - processHandle = GetCurrentProcess(); - - handleInfo = (PSYSTEM_HANDLE_INFORMATION)malloc(handleInfoSize); - - while ((status = NtQuerySystemInformation( - SystemHandleInformation, - handleInfo, - handleInfoSize, - NULL - )) == STATUS_INFO_LENGTH_MISMATCH) - handleInfo = (PSYSTEM_HANDLE_INFORMATION)realloc(handleInfo, handleInfoSize *= 2); - - /* NtQuerySystemInformation stopped giving us STATUS_INFO_LENGTH_MISMATCH. */ - if (!NT_SUCCESS(status)) - { - LOG(ERROR) << "Error opening object for pbo search"; - free(handleInfo); - return false; - } - - for (i = 0; i < handleInfo->HandleCount; i++) - { - SYSTEM_HANDLE handle = handleInfo->Handles[i]; - HANDLE dupHandle = NULL; - POBJECT_TYPE_INFORMATION objectTypeInfo; - PVOID objectNameInfo; - UNICODE_STRING objectName; - ULONG returnLength; - - /* Check if this handle belongs to the PID the user specified. */ - if (handle.ProcessId != pid) - continue; - - /* Duplicate the handle so we can query it. */ - if (!NT_SUCCESS(NtDuplicateObject( - processHandle, - (HANDLE)handle.Handle, - GetCurrentProcess(), - &dupHandle, - 0, - 0, - 0 - ))) - { - continue; - } - - /* Query the object type. */ - objectTypeInfo = (POBJECT_TYPE_INFORMATION)malloc(0x1000); - if (!NT_SUCCESS(NtQueryObject( - dupHandle, - ObjectTypeInformation, - objectTypeInfo, - 0x1000, - NULL - ))) - { - CloseHandle(dupHandle); - continue; - } - - /* Query the object name (unless it has an access of - 0x0012019f, on which NtQueryObject could hang. */ - if (handle.GrantedAccess == 0x0012019f) - { - - free(objectTypeInfo); - CloseHandle(dupHandle); - continue; - } - - objectNameInfo = malloc(0x1000); - if (!NT_SUCCESS(NtQueryObject( - dupHandle, - ObjectNameInformation, - objectNameInfo, - 0x1000, - &returnLength - ))) - { - /* Reallocate the buffer and try again. */ - objectNameInfo = realloc(objectNameInfo, returnLength); - if (!NT_SUCCESS(NtQueryObject( - dupHandle, - ObjectNameInformation, - objectNameInfo, - returnLength, - NULL - ))) - { - free(objectTypeInfo); - free(objectNameInfo); - CloseHandle(dupHandle); - continue; - } - } - - /* Cast our buffer into an UNICODE_STRING. */ - objectName = *(PUNICODE_STRING)objectNameInfo; - - - - /* Print the information! */ - if (objectName.Length) - { - std::wstring tmp_type(objectTypeInfo->Name.Buffer); - std::wstring tmp_name(objectName.Buffer); - - std::string object_type(tmp_type.begin(), tmp_type.end()); - std::string object_name(tmp_name.begin(), tmp_name.end()); - if (object_type == "File" && object_name.find(".pbo") != object_name.npos) { - char buffer[MAX_PATH]; - GetFinalPathNameByHandle(dupHandle, buffer, sizeof(buffer), VOLUME_NAME_DOS); - - LOG(DEBUG) << "Pbo: " << buffer; - _active_pbo_list.push_back(std::string(buffer)); - } - } - - free(objectTypeInfo); - free(objectNameInfo); - CloseHandle(dupHandle); - } - - free(handleInfo); - - return true; - } - } -} - -#endif diff --git a/extensions/common/pbo/search.hpp b/extensions/common/pbo/search.hpp deleted file mode 100644 index 9434657ff86..00000000000 --- a/extensions/common/pbo/search.hpp +++ /dev/null @@ -1,31 +0,0 @@ -#ifdef _WIN32 - -#pragma once - -#include "shared.hpp" -#include "pbo/archive.hpp" - -namespace ace { - namespace pbo { - class search { - public: - search(); - search(const std::string &); - - const std::unordered_map<std::string, std::string> & file_index() { return _file_pbo_index; } - const std::vector<std::string> & active_pbo_list() { return _active_pbo_list; } - protected: - bool index_files(); - bool index_files(const std::string &); - bool generate_pbo_list(); - - std::unordered_map<std::string, std::string> _file_pbo_index; - - std::vector<std::string> _active_pbo_list; - std::vector<ace::pbo::archive_p> _archives; - }; - typedef std::shared_ptr<search> search_p; - } -} - -#endif diff --git a/extensions/common/shared.cpp b/extensions/common/shared.cpp deleted file mode 100644 index 8a68566ba92..00000000000 --- a/extensions/common/shared.cpp +++ /dev/null @@ -1,24 +0,0 @@ -#include "shared.hpp" - -#include <functional> -#include <sstream> - -int test(int var) { - return var; -} -namespace ace { - std::vector<std::string> &split(const std::string &s, char delim, std::vector<std::string> &elems) { - std::stringstream ss(s); - std::string item; - while (std::getline(ss, item, delim)) { - elems.push_back(item); - } - return elems; - } - - std::vector<std::string> split(const std::string &s, char delim) { - std::vector<std::string> elems; - split(s, delim, elems); - return elems; - } -} diff --git a/extensions/common/shared.hpp b/extensions/common/shared.hpp deleted file mode 100644 index c7c8c614030..00000000000 --- a/extensions/common/shared.hpp +++ /dev/null @@ -1,104 +0,0 @@ -#pragma once - -//_USE_MATH_DEFINES + cmath needs to be first or M_PI won't be defined in VS2015 -#define _USE_MATH_DEFINES -#include <cmath> - -#include "targetver.h" -#include <assert.h> -#include <stdio.h> -#include <math.h> - -#include <string> -#include <vector> -#include <list> -#include <map> -#include <unordered_map> -#include <memory> -#include <cstdint> -#include <streambuf> -#include "ace_version.hpp" -#include <algorithm> -#include <cctype> //std::isspace -#include <cstring> -#include <istream> - -#ifdef _DEBUG -#define ZERO_OUTPUT() { memset(output, 0x00, outputSize); } -#define EXTENSION_RETURN() {output[outputSize-1] = 0x00; } return; -#else -#define ZERO_OUTPUT() -#define EXTENSION_RETURN() return; -#endif - -#ifdef _WIN32 -#define sleep(x) Sleep(x) -#else -#define _strdup strdup -#define strtok_s strtok_r -#endif - -namespace ace { - template< typename T > - struct array_deleter - { - void operator ()(T const * p) - { - delete[] p; - } - }; - - std::vector<std::string> &split(const std::string &s, char delim, std::vector<std::string> &elems); - std::vector<std::string> split(const std::string &s, char delim); - - template<typename T, typename... Args> - std::unique_ptr<T> make_unique(Args&&... args) { - return std::unique_ptr<T>(new T(std::forward<Args>(args)...)); - } - - // trim from start - static inline std::string <rim(std::string &s) { - s.erase(s.begin(), std::find_if(s.begin(), s.end(), [](const char _char) noexcept {return !std::isspace(_char); })); - return s; - } - - // trim from end - static inline std::string &rtrim(std::string &s) { - s.erase(std::find_if(s.rbegin(), s.rend(), [](const char _char) noexcept {return !std::isspace(_char); }).base(), s.end()); - return s; - } - - // trim from both ends - static inline std::string &trim(std::string &s) { - return ltrim(rtrim(s)); - } - - struct exception { - exception(const uint32_t code_, const std::string & text_) : code(code_), text(text_) {} - - exception & operator= (const exception& other) { code = other.code; text = other.text; return *this; } - bool operator == (const exception &r) const { return ( code == r.code ); } - - uint32_t code; - std::string text; - }; -} - -#ifndef _WIN32 -#define __stdcall -#endif - -#if defined(_MSC_VER) - // Microsoft - #define EXPORT __declspec(dllexport) - #define IMPORT __declspec(dllimport) -#elif defined(_GCC) - // GCC - #define EXPORT __attribute__((visibility("default"))) - #define IMPORT -#else - // do nothing and hope for the best? - #define EXPORT - #define IMPORT - #pragma warning Unknown dynamic link import/export semantics. -#endif diff --git a/extensions/common/simulation/object.cpp b/extensions/common/simulation/object.cpp deleted file mode 100644 index eed0f520f76..00000000000 --- a/extensions/common/simulation/object.cpp +++ /dev/null @@ -1,464 +0,0 @@ -#include "object.hpp" -#include "p3d/parser.hpp" - - -#include "glm/gtc/matrix_transform.hpp" - -ace::simulation::vertex::vertex(vertex_table & _table, ace::vector3<float> _vertex, uint32_t _id) : table(_table), vertex_id(_id) -{ - this->original_vertex = _vertex; - this->animated_vertex = _vertex; -} - -ace::simulation::vertex::~vertex() -{ -} - - -ace::simulation::face::face( - const ace::p3d::face_p p3d_face, - const ace::p3d::lod_p p3d_lod, - const ace::p3d::model_p p3d, - ace::simulation::lod *object_lod) -{ - this->type = p3d_face->type; - for (uint16_t vertex_id : p3d_face->vertex_table) { - this->vertices.push_back(object_lod->vertices[vertex_id]); - object_lod->vertices[vertex_id]->faces.push_back(this); - } -} - -ace::simulation::face::~face() -{ -} - -void ace::simulation::vertex::animate(const glm::mat4 &matrix, ace::vector3<float> rotation_offset, bool offset) -{ - ace::vector3<float> temp_vector = this->original_vertex; - if (offset) { - temp_vector = temp_vector - rotation_offset; - } - glm::vec4 temp_gl_vector = glm::vec4(temp_vector.x(), temp_vector.y(), temp_vector.z(), 1.0f); - temp_gl_vector = matrix*temp_gl_vector; - this->animated_vertex = ace::vector3<float>(temp_gl_vector.x, temp_gl_vector.y, temp_gl_vector.z); - if (offset) { - // this->animated_vertex = this->animated_vertex + rotation_offset; - } -} - -ace::simulation::named_selection::named_selection( - const ace::p3d::named_selection_p p3d_selection, - const ace::p3d::lod_p p3d_lod, - const ace::p3d::model_p p3d, - ace::simulation::lod *object_lod) -{ - this->name = p3d_selection->name; - for (uint16_t vertex_id : p3d_selection->vertex_table.data) { - this->vertices.push_back(object_lod->vertices[vertex_id]); - object_lod->vertices[vertex_id]->selections.push_back(this); - } - for (uint16_t face_id : p3d_selection->faces.data) { - this->faces.push_back(object_lod->faces[face_id]); - } -} - -ace::simulation::named_selection::~named_selection() -{ -} - -void ace::simulation::named_selection::animate(const glm::mat4 &matrix, ace::vector3<float> rotation_offset) -{ - bool offset = !rotation_offset.zero_distance(); - for (auto selection_vertex : this->vertices) { - selection_vertex->animate(matrix, rotation_offset, offset); - } -} - - - - -ace::simulation::vertex_table::vertex_table(const ace::p3d::vertex_table_p p3d_vertex_table, const ace::p3d::lod_p p3d_lod, const ace::p3d::model_p p3d) : animated(false) -{ - this->vertices.resize(p3d_vertex_table->points.size); - for (uint32_t i = 0; i <= p3d_vertex_table->points.size - 1; ++i) { - if (p3d->info->autocenter) { - ace::vector3<float> new_vertex = ace::vector3<float>( - p3d_vertex_table->points[i].x() + (p3d_lod->autocenter_pos.x()*-1), - p3d_vertex_table->points[i].y() + (p3d_lod->autocenter_pos.y()*-1), - p3d_vertex_table->points[i].z() + (p3d_lod->autocenter_pos.z()*-1) - ); - this->vertices[i] = std::make_shared<vertex>(*this, new_vertex, i); - - } - else { - this->vertices[i] = std::make_shared<vertex>(*this, p3d_vertex_table->points[i], i); - } - } -} - -ace::simulation::vertex_table::~vertex_table() -{ -} - -ace::simulation::lod::lod(const ace::p3d::lod_p p3d_lod, const ace::p3d::model_p p3d) -{ - this->id = p3d_lod->id; - this->vertices = vertex_table(p3d_lod->vertices, p3d_lod, p3d); - this->autocenter_pos = p3d_lod->autocenter_pos; - - for (ace::p3d::face_p p3d_face : p3d_lod->faces) { - this->faces.push_back(std::make_shared<face>(p3d_face, p3d_lod, p3d, this)); - } - - for (ace::p3d::named_selection_p p3d_selection : p3d_lod->selections) { - this->selections[p3d_selection->name] = std::make_shared<named_selection>(p3d_selection, p3d_lod, p3d, this); - } -} - - -ace::simulation::lod::~lod() -{ -} - -ace::simulation::lod_animation_info::lod_animation_info( - animation *_animation, - lod_p _lod, - const ace::p3d::animate_bone_p p3d_animate_bone, - const ace::p3d::animation_p p3d_animation, - const ace::p3d::model_p p3d) : animation_definition(_animation), lod(_lod) -{ - this->index = p3d_animate_bone->index; - if (p3d->info->autocenter) { - this->axis_position = p3d_animate_bone->axis_position + (lod->autocenter_pos*-1); - this->axis_direction = p3d_animate_bone->axis_direction.normalize(); - } - else { - this->axis_position = p3d_animate_bone->axis_position; - this->axis_direction = p3d_animate_bone->axis_direction.normalize(); - } -} - -ace::simulation::lod_animation_info::~lod_animation_info() -{ -} - -ace::simulation::animation::animation(object *parent_object, const ace::p3d::animation_p p3d_animation, const ace::p3d::model_p p3d) -{ - this->type = p3d_animation->type; - this->name = p3d_animation->name; - this->source = p3d_animation->source; - - this->source_address = p3d_animation->source_address; - - this->min_value = p3d_animation->min_value; - this->max_value = p3d_animation->max_value; - - this->min_phase = p3d_animation->min_phase; - this->max_phase = p3d_animation->max_phase; - - switch (type) { - // rotations - case 0: - case 1: - case 2: - case 3: - angle0 = p3d_animation->angle0; - angle1 = p3d_animation->angle1; - break; - // translations - case 4: - case 5: - case 6: - case 7: - offset0 = p3d_animation->offset0; - offset1 = p3d_animation->offset1; - break; - case 8: - direct_axis_pos = p3d_animation->direct_axis_pos; - direct_axis_dir = p3d_animation->direct_axis_dir; - direct_angle = p3d_animation->direct_angle; - direct_axis_offset = p3d_animation->direct_axis_offset; - break; - case 9: - hide_value = p3d_animation->hide_value; - default: - offset0 = 0.0f; - offset1 = 0.0f; - } - - - - - for (ace::p3d::animate_bone_p animation_bone : p3d_animation->bones) { - this->lod_info[animation_bone->lod] = std::make_shared<lod_animation_info>(this, parent_object->lods[animation_bone->lod], animation_bone, p3d_animation, p3d); - } - -} - -ace::simulation::animation::~animation() -{ -} - -typedef union { - float f; - struct { - uint32_t sh1 : 32; - } parts; -} double_cast; - -#define RAD2DEG(rad) (rad * 180.0f / 3.1415926f); - -typedef std::map<uint32_t, std::pair<glm::mat4, ace::vector3<float>>> animation_transform; -animation_transform ace::simulation::animation::animate(const float phase, const std::vector<uint32_t> &lods, animation_transform base_transforms) -{ - animation_transform return_matrices; - for (auto lod_id : lods) { - glm::mat4 base_matrix = base_transforms[lod_id].first; - ace::vector3<float> base_rotation_offset = base_transforms[lod_id].second; - glm::mat4 animation_matrix, direction_matrix; - ace::vector3<float> rotation_offset = ace::vector3<float>(0, 0, 0); - - float scale = get_scale(phase); - - glm::vec3 axis_position = glm::vec3(this->lod_info[lod_id]->axis_position.x(), this->lod_info[lod_id]->axis_position.y(), this->lod_info[lod_id]->axis_position.z()); - glm::vec3 axis_direction = glm::vec3(this->lod_info[lod_id]->axis_direction.x(), this->lod_info[lod_id]->axis_direction.y(), this->lod_info[lod_id]->axis_direction.z()); - - if (this->type < 4) { - switch (this->type) { - //rotation - case 0: { - scale = (scale / (max_value - min_value)) * (angle1 - angle0); - - animation_matrix = glm::rotate(glm::mat4(1.0f), scale, axis_direction); - direction_matrix = glm::translate(glm::mat4(1.0f), axis_position); - - animation_matrix = animation_matrix * direction_matrix; - - rotation_offset = this->lod_info[lod_id]->axis_position; - break; - } - //rotationX - case 1: { - scale = (scale / (max_value - min_value)) * (angle1 - angle0); - glm::vec3 rotation_axis = glm::vec3(1.0f, 0.0f, 0.0f); - - animation_matrix = glm::rotate(glm::mat4(1.0f), -scale, rotation_axis); - direction_matrix = glm::translate(glm::mat4(1.0f), axis_position); - - animation_matrix = animation_matrix * direction_matrix; - - rotation_offset = this->lod_info[lod_id]->axis_position; - break; - } - //rotationY - case 2: { - scale = (scale / (max_value - min_value)) * (angle1 - angle0); - glm::vec3 rotation_axis = glm::vec3(0.0f, 1.0f, 0.0f); - - animation_matrix = glm::rotate(glm::mat4(1.0f), scale, rotation_axis); - direction_matrix = glm::translate(glm::mat4(1.0f), axis_position); - - animation_matrix = animation_matrix * direction_matrix; - - rotation_offset = this->lod_info[lod_id]->axis_position; - break; - } - //rotationZ - case 3: { - scale = (scale / (max_value - min_value)) * (angle1 - angle0); - glm::vec3 rotation_axis = glm::vec3(0.0f, 0.0f, 1.0f); - - direction_matrix = glm::translate(glm::mat4(1.0f), axis_position); - animation_matrix = glm::rotate(direction_matrix, -scale, rotation_axis); - - - animation_matrix = animation_matrix * direction_matrix; - - rotation_offset = this->lod_info[lod_id]->axis_position; - break; - } - //translation - case 4: { - scale = (scale / (max_value - min_value)) * (offset1 - offset0); - glm::vec3 direction( - this->lod_info[lod_id]->axis_direction.x(), - this->lod_info[lod_id]->axis_direction.y(), - this->lod_info[lod_id]->axis_direction.z() - ); - direction = direction * scale; - direction_matrix = glm::translate(glm::mat4(1.0f), axis_position); - animation_matrix = glm::translate(glm::mat4(1.0f), direction); - animation_matrix = animation_matrix * direction_matrix; - - break; - } - //translationX - case 5: { - scale = (scale / (max_value - min_value)) * (offset1 - offset0); - animation_matrix = glm::translate(animation_matrix, glm::vec3( - scale, - 0.0f, - 0.0f - )); - break; - } - //translationY - case 6: { - scale = (scale / (max_value - min_value)) * (offset1 - offset0); - animation_matrix = glm::translate(animation_matrix, glm::vec3( - 0.0f, - scale, - 0.0f - )); - break; - } - //translationZ - case 7: { - scale = (scale / (max_value - min_value)) * (offset1 - offset0); - animation_matrix = glm::translate(animation_matrix, glm::vec3( - 0.0f, - 0.0f, - scale - )); - break; - } - case 8: { - // fuck direct for now - break; - } - //hide - case 9: { - if (phase >= hide_value) - animation_matrix = glm::mat4x4(0.0f); - break; - } - default: {} - } - return_matrices[lod_id].first = animation_matrix * base_matrix; - return_matrices[lod_id].second = base_rotation_offset + rotation_offset; - } - } - return return_matrices; -} - -float ace::simulation::animation::get_scale(float phase) -{ - float scale = 0; - - - switch (source_address) - { - case 1: - scale = fmod(phase - min_value, (max_value - min_value) * 2) + min_value; - // when over limit, mirror - if (phase > max_value) phase = max_value - (phase - max_value); - - scale = std::min(std::max(scale, min_phase), max_phase); - - break; - case 2: - scale = fmod(phase - min_value, (max_value - min_value)) + min_value; - if (scale > max_value) scale = max_value - (scale - max_value); - scale = std::min(std::max(scale, min_phase), max_phase); - break; - default: - scale = std::min(std::max(phase, min_phase), max_phase); - } - - return scale; -} - -ace::simulation::bone::bone( - const std::string _name, - const std::vector<std::string> &children, - const std::map<std::string, ace::p3d::bone_p> &p3d_bones, - bone *_parent, - const ace::p3d::model_p p3d, - object * sim_object - ) : parent(_parent), name(_name), base_object(sim_object) -{ - for (auto const child_bone : children) { - if (sim_object->all_bones.find(child_bone) == sim_object->all_bones.end()) { - ace::p3d::bone_p p3d_bone = p3d_bones.find(child_bone)->second; - sim_object->all_bones[child_bone] = std::make_shared<bone>(p3d_bone->name, p3d_bone->children, p3d_bones, this, p3d, sim_object); - } - this->children.push_back(sim_object->all_bones[child_bone]); - } - if (parent) { - for (auto p3d_animation : p3d_bones.find(name)->second->animations) { - this->animations.push_back(sim_object->animations[p3d_animation]); - } - } -} - -void ace::simulation::bone::animate(const std::map<std::string, float> &animation_state, const std::vector<uint32_t> &lods, animation_transform base_transforms) -{ - if (animations.size() > 0) { - for (auto bone_animation : animations) { - if (animation_state.find(bone_animation->name) != animation_state.end()) { - base_transforms = bone_animation->animate(animation_state.find(bone_animation->name)->second, lods, base_transforms); - } - } - } - for (auto child_bone : children) { - child_bone->animate(animation_state, lods, base_transforms); - } - if (animations.size() > 0) { - for (auto bone_animation : animations) { - for (auto lod_id : lods) { - auto selection = this->base_object->lods[lod_id]->selections.find(this->name); - if (selection != this->base_object->lods[lod_id]->selections.end()) { - selection->second->animate(base_transforms[lod_id].first, base_transforms[lod_id].second); - } - } - } - } -} - -ace::simulation::object::object() -{ -} - -ace::simulation::object::object(const ace::p3d::model_p model) -{ - for (ace::p3d::lod_p p3d_lod : model->lods) { - lod_p new_lod = std::make_shared<lod>(p3d_lod, model); - this->lods.push_back(new_lod); - this->lods[p3d_lod->id]->type = model->info->resolutions[p3d_lod->id]; - } - - for (ace::p3d::animation_p p3d_animation : model->animations) { - this->animations.push_back(std::make_shared<animation>(this, p3d_animation, model)); - } - - std::map<std::string, ace::p3d::bone_p> p3d_bones; - for (auto const skeleton_bone : model->skeleton->all_bones) { - p3d_bones[skeleton_bone->name] = skeleton_bone; - } - - std::vector<std::string> root_bones; - for (auto const root_bone : model->skeleton->root_bones) { - root_bones.push_back(root_bone.first); - } - - this->root_bone = std::make_shared<bone>("", root_bones, p3d_bones, nullptr, model, this); -} - - - -ace::simulation::object::~object() -{ - -} - -void ace::simulation::object::animate(const std::map<std::string, float> &animation_state, const std::vector<uint32_t> &selected_lods) -{ - animation_transform identity_transform; - for (uint32_t lod_id : selected_lods) { - identity_transform[lod_id].first = glm::mat4(); - identity_transform[lod_id].second = ace::vector3<float>(0, 0, 0); - } - this->root_bone->animate(animation_state, selected_lods, identity_transform); -} - - diff --git a/extensions/common/simulation/object.hpp b/extensions/common/simulation/object.hpp deleted file mode 100644 index 6a5ffbb9ec1..00000000000 --- a/extensions/common/simulation/object.hpp +++ /dev/null @@ -1,221 +0,0 @@ -#pragma once - -#include "shared.hpp" - -#include <string> -#include <vector> -#include <map> - -#define GLM_PRECISION_HIGHP_FLOAT - -#include "p3d/model.hpp" -#include "glm/glm.hpp" -#include "glm/vec3.hpp" -#include "glm/mat4x4.hpp" - - -namespace ace { - namespace simulation { - - class vertex; - typedef std::shared_ptr<vertex> vertex_p; - - class lod; - typedef std::shared_ptr<lod> lod_p; - - class object; - typedef std::shared_ptr<object> object_p; - - typedef std::map<uint32_t, std::pair<glm::mat4, ace::vector3<float>>> animation_transform; - - class vertex_table { - public: - vertex_table() {}; - vertex_table(const ace::p3d::vertex_table_p, const ace::p3d::lod_p, const ace::p3d::model_p); - ~vertex_table(); - vertex_p operator[] (const int index) { return vertices[index]; } - std::vector<vertex_p> vertices; - private: - bool animated; - }; - - class face { - public: - face() {}; - face(const ace::p3d::face_p, const ace::p3d::lod_p, const ace::p3d::model_p, ace::simulation::lod *); - ~face(); - uint8_t type; - std::vector<vertex_p> vertices; - }; - typedef std::shared_ptr<face> face_p; - - class named_selection { - public: - named_selection() {}; - named_selection(const ace::p3d::named_selection_p, const ace::p3d::lod_p, const ace::p3d::model_p, ace::simulation::lod *); - ~named_selection(); - - std::string name; - std::vector<face_p> faces; - std::vector<vertex_p> vertices; - - void animate(const glm::mat4 &, ace::vector3<float>); - }; - typedef std::shared_ptr<named_selection> named_selection_p; - - class vertex { - public: - vertex(vertex_table &, ace::vector3<float>, uint32_t); - ~vertex(); - - ace::vector3<float> operator * (const float &v) { return animated_vertex * v; } - ace::vector3<float> operator / (const float &v) { return animated_vertex / v; } - - ace::vector3<float> operator * (const ace::vector3<float> &v) { return animated_vertex * v; } - ace::vector3<float> operator / (const ace::vector3<float> &v) { return animated_vertex / v; } - ace::vector3<float> operator + (const ace::vector3<float> &v) { return animated_vertex + v; } - ace::vector3<float> operator - (const ace::vector3<float> &v) { return animated_vertex - v; } - ace::vector3<float> operator - () { return -(animated_vertex); } - - bool operator == (const ace::vector3<float> &r) { return (animated_vertex == r); } - bool operator > (const ace::vector3<float> &r) const { throw 1; } - bool operator < (const ace::vector3<float> &r) const { throw 1; } - bool operator <= (const ace::vector3<float> &r) const { throw 1; } - bool operator >= (const ace::vector3<float> &r) const { throw 1; } - - float x() { return animated_vertex.x(); } - float y() { return animated_vertex.y(); } - float z() { return animated_vertex.z(); } - uint16_t id() { return this->vertex_id; } - - operator ace::vector3<float>() { return animated_vertex; } - - std::vector<face *> faces; - std::vector<named_selection *> selections; - - void animate(const glm::mat4 &, ace::vector3<float>, bool); - - private: - ace::vector3<float> original_vertex; - ace::vector3<float> animated_vertex; - vertex_table &table; - uint16_t vertex_id; - }; - - - - - class lod { - public: - lod() {}; - lod(const ace::p3d::lod_p, const ace::p3d::model_p); - ~lod(); - uint32_t id; - float type; - vertex_table vertices; - ace::vector3<float> autocenter_pos; - std::map<std::string, named_selection_p> selections; - std::vector<face_p> faces; - }; - - class animation; - typedef std::shared_ptr<animation> animation_p; - - class lod_animation_info { - public: - lod_animation_info() {}; - lod_animation_info(animation *, lod_p, const ace::p3d::animate_bone_p, const ace::p3d::animation_p, const ace::p3d::model_p); - ~lod_animation_info(); - animation *animation_definition; - int32_t index; - lod_p lod; - ace::vector3<float> axis_direction; - ace::vector3<float> axis_position; - }; - typedef std::shared_ptr<lod_animation_info> lod_animation_info_p; - - - - class animation { - public: - animation() {}; - animation(object *, const ace::p3d::animation_p, const ace::p3d::model_p); - ~animation(); - - uint32_t type; - std::string name; // "RightDoor" - std::string source; // "rotor" - - float min_value; - float max_value; - float min_phase; - float max_phase; - - float offset0; - float offset1; - - float angle0; - float angle1; - - float hide_value; - - ace::vector3<float> direct_axis_pos; - ace::vector3<float> direct_axis_dir; - - float direct_angle; - float direct_axis_offset; - - uint32_t source_address; - - std::vector<float> transforms; - std::map<uint32_t, lod_animation_info_p> lod_info; - - animation_transform animate(const float, const std::vector<uint32_t> &, animation_transform); - - float get_scale(float); - }; - - - class bone; - typedef std::shared_ptr<bone> bone_p; - - class bone { - public: - bone( - const std::string, - const std::vector<std::string> &, - const std::map<std::string, ace::p3d::bone_p> &, - bone *, - const ace::p3d::model_p, - object *); - - ~bone() {}; - std::string name; - bone *parent; - std::vector<bone_p> children; - std::vector<animation_p> animations; - object *base_object; - void animate(const std::map<std::string, float> &, const std::vector<uint32_t> &, animation_transform base_transforms); - }; - - - class object { - public: - object(); - object(const ace::p3d::model_p); - ~object(); - - std::vector<lod_p> lods; - - std::vector<animation_p> animations; - - void animate(const std::map<std::string, float> &, const std::vector<std::uint32_t> &); - - std::map<std::string, bone_p> all_bones; - - bone_p root_bone; - - }; - - } -} diff --git a/extensions/common/singleton.hpp b/extensions/common/singleton.hpp deleted file mode 100644 index 0e8797dbc6f..00000000000 --- a/extensions/common/singleton.hpp +++ /dev/null @@ -1,31 +0,0 @@ -#include <cstdint> -#include <assert.h> - -#pragma once - -namespace ace { - template<typename T> - class singleton { - public: - static T & get() { - - if (_singletonInstance == nullptr) { - assert(_initialized == false); - _initialized = true; - _singletonInstance = new T(); - } - - return *_singletonInstance; - } - static void release() { - delete _singletonInstance; - } - protected: - static T *_singletonInstance; - static bool _initialized; - }; - template<typename T> - T* singleton<T>::_singletonInstance = nullptr; - template<typename T> - bool singleton<T>::_initialized = false; -} \ No newline at end of file diff --git a/extensions/common/targetver.h b/extensions/common/targetver.h deleted file mode 100644 index d8082dcf946..00000000000 --- a/extensions/common/targetver.h +++ /dev/null @@ -1,9 +0,0 @@ -#pragma once - -#ifdef _WIN32 -// #define WIN32_LEAN_AND_MEAN - #define NOMINMAX - #include <windows.h> -#else - -#endif diff --git a/extensions/common/transform_matrix.hpp b/extensions/common/transform_matrix.hpp deleted file mode 100644 index 3d7de8fb542..00000000000 --- a/extensions/common/transform_matrix.hpp +++ /dev/null @@ -1,34 +0,0 @@ -#pragma once - -#include "shared.hpp" -#include "vector.hpp" - -namespace ace { - template <typename T> - class transform_matrix_base { - public: - transform_matrix_base & operator= (const transform_matrix_base& other) { _x = other.x(); _y = other.y(); _z = other.z(); _n = other.n(); return *this; } - - transform_matrix_base() {} - transform_matrix_base(std::istream &stream_, uint32_t version = 68) : _x(stream_), _y(stream_), _z(stream_), _n(stream_) { } - transform_matrix_base(ace::vector3<T> x_, ace::vector3<T> y_, ace::vector3<T> z_, ace::vector3<T> n_) : _x(x_), _y(y_), _z(z_), _n(n_) { } - - const ace::vector3<T> & x() const { return _x; } - const ace::vector3<T> & y() const { return _y; } - const ace::vector3<T> & z() const { return _z; } - const ace::vector3<T> & n() const { return _n; } - - void x(const ace::vector3<T> val) { _x = val; } - void y(const ace::vector3<T> val) { _y = val; } - void z(const ace::vector3<T> val) { _z = val; } - void n(const ace::vector3<T> val) { _n = val; } - - protected: - ace::vector3<T> _x; - ace::vector3<T> _y; - ace::vector3<T> _z; - ace::vector3<T> _n; - }; - - typedef transform_matrix_base<float> transform_matrix; -} diff --git a/extensions/common/vector.cpp b/extensions/common/vector.cpp deleted file mode 100644 index 19190036c71..00000000000 --- a/extensions/common/vector.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "vector.hpp" - - -namespace ace { - template <> float acos(float n) { return std::acosf(n); } - template <> double acos(double n) { return std::acos(n); } - template <> float cos(float n) { return std::cosf(n); } - template <> double cos(double n) { return std::cos(n); } - template <> float sin(float n) { return std::sinf(n); } - template <> double sin(double n) { return std::sin(n); } -} \ No newline at end of file diff --git a/extensions/common/vector.hpp b/extensions/common/vector.hpp deleted file mode 100644 index 101ee0746dc..00000000000 --- a/extensions/common/vector.hpp +++ /dev/null @@ -1,176 +0,0 @@ -#pragma once - -/* -#ifdef USE_BULLET -#include "LinearMath\btVector3.h" -#endif -*/ - -#include "shared.hpp" - -#ifndef _WIN32 - -#define sinf(x) sin(x) -#define cosf(x) cos(x) -#define acosf(x) acos(x) - -#endif - -namespace ace { - - template <typename T> T acos(T n) { return -1; } - template <typename T> T cos(T n) { return -1; } - template <typename T> T sin(T n) { return -1; } - - template<typename T> - class vector3 { - public: - vector3() : - _x(0), - _y(0), - _z(0) { - } - vector3(const T x_, const T y_, const T z_) : - _x(x_), - _y(y_), - _z(z_) { - } - vector3(std::istream & read_) { - // Constructor to read from a stream - read_.read((char *)&_x, sizeof(T)); - read_.read((char *)&_y, sizeof(T)); - read_.read((char *)&_z, sizeof(T)); - } - vector3(const float *buffer) { - _x = buffer[0]; - _y = buffer[1]; - _z = buffer[2]; - } - - vector3& operator= (const vector3& other) { _x = other.x(); _y = other.y(); _z = other.z(); return *this; } -/*#ifdef _WIN32 && _DIRECTX - vector3<T> & operator= (const XMFLOAT3& Float3) { _x = Float3.x; _y = Float3.y; _z = Float3.z; return *this; } -#endif - -#ifdef USE_BULLET - vector3<T> & operator= (const btVector3& bt_vec) { _x = bt_vec.x(); _y = bt_vec.y(); _z = bt_vec.z(); return *this; } -#endif -*/ - vector3 operator * (const T& val) const { return vector3(_x * val, _y * val, _z * val); } - vector3 operator / (const T& val) const { T invVal = T(1) / val; return vector3(_x * invVal, _y * invVal, _z * invVal); } - vector3 operator + (const vector3& v) const { return vector3(_x + v.x(), _y + v.y(), _z + v.z()); } - vector3 operator / (const vector3& v) const { return vector3(_x / v.x(), _y / v.y(), _z / v.z()); } - vector3 operator * (const vector3& v) const { return vector3(_x * v.x(), _y * v.y(), _z * v.z()); } - vector3 operator - (const vector3& v) const { return vector3(_x - v.x(), _y - v.y(), _z - v.z()); } - vector3 operator - () const { return vector3(-_x, -_y, -_z); } - - vector3& operator *=(const vector3& v) { _x *= v._x; _y *= v._y; _z *= v._z; return *this; } - vector3& operator *=(T mag) { _x *= mag; _y *= mag; _z *= mag; return *this; } - vector3& operator /=(const vector3& v) { _x /= v._x; _y /= v._y; _z /= v._z; return *this; } - vector3& operator /=(T mag) { _x /= mag; _y /= mag; _y /= mag; return *this; } - vector3& operator +=(const vector3& v) { _x += v._x; _y += v._y; _z += v._z; return *this; } - vector3& operator -=(const vector3& v) { _x -= v._x; _y -= v._y; _z -= v._z; return *this; } - - - bool operator == (const vector3 &r) const { return (_x == r.x() && _y == r.y() && _z == r.z()); } - - T magnitude() const { return sqrt(_x * _x + _y * _y + _z * _z); } - T magnitude_squared() const { return _x * _x + _y * _y + _z * _z; } - T dot(const vector3& v) const { return (_x * v.x() + _y * v.y() + _z * v.z()); } - T distance(const vector3& v) const { vector3 dist = (*this - v); dist = dist * dist; return sqrt(dist.x() + dist.y() + dist.z()); } - vector3 cross(const vector3& v) const { return vector3(_y * v.z() - _z * v.y(), _z * v.x() - _x * v.z(), _x * v.y() - _y * v.x()); } - vector3 normalize() const { return (*this / abs(magnitude())); }; - bool zero_distance() const { return ((_x == 0.0f && _y == 0.0f && _z == 0.0f) ? true : false ); } - - static float clamp(T x, T a, T b) { return x < a ? a : (x > b ? b : x); } - - static vector3 lerp(const vector3& A, const vector3& B, const T t) { return A*t + B*(1.f - t); } - vector3 lerp(const vector3& B, const T t) const { return vector3::lerp(*this, B, t); } - - static vector3 slerp(vector3 start, vector3 end, T percent) { - T dot = start.dot(end); - dot = vector3::clamp(dot, -1.0f, 1.0f); - - T theta = acos(dot) * percent; - vector3 relative = end - start*dot; - relative.normalize(); - return ((start * cos(theta)) + (relative*sin(theta))); - } - vector3 slerp(const vector3& B, const T p) const { - return vector3::slerp(*this, B, p); - } - - const T& x() const { return _x; } - const T& y() const { return _y; } - const T& z() const { return _z; } - - void x(const T val) { _x = val; } - void y(const T val) { _y = val; } - void z(const T val) { _z = val; } - protected: - T _x; - T _y; - T _z; - }; - - template<typename T, unsigned int N = 3> - class vector { - public: - vector() : - _values(std::vector<T>(N)) { - } - std::vector<T> _values; - }; - - - template<typename T> - class spatial { - public: - spatial() : - position(vector3<T>()), - orientation(vector3<T>()) - { - } - explicit spatial(const vector3<T> & position_, const vector3<T> & orientation_) : - position(position_), - orientation(orientation_) - {} - spatial<T> & operator= (const spatial<T> & other) { position = other.position; orientation = other.orientation; return *this; } - vector3<T> position; - vector3<T> orientation; - }; - - - template<typename T> - class pair { - public: - pair() : - _x(0), - _y(0) { - } - pair(const T x_, const T y_, const T z_) : - _x(x_), - _y(y_) { - } - pair(const float *buffer) { - _x = buffer[0]; - _y = buffer[1]; - } - pair(std::istream & read_) { - // Constructor to read from a stream - read_.read((char *)&_x, sizeof(T)); - read_.read((char *)&_y, sizeof(T)); - } - - pair<T> & operator= (const pair<T>& other) { _x = other.x(); _y = other.y(); return *this; } - - const T & x() const { return _x; } - const T & y() const { return _y; } - - void x(const T val) { _x = val; } - void y(const T val) { _y = val; } - protected: - T _x; - T _y; - }; -} diff --git a/extensions/dynload/CMakeLists.txt b/extensions/dynload/CMakeLists.txt deleted file mode 100644 index ac258692034..00000000000 --- a/extensions/dynload/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -set(ACE_EXTENSION_NAME "ace_dynload") - -file(GLOB SOURCES *.h *.hpp *.c *.cpp) -add_library( ${ACE_EXTENSION_NAME} SHARED ${SOURCES} ${GLOBAL_SOURCES}) -add_library( ${ACE_EXTENSION_NAME}_static STATIC ${SOURCES} ${GLOBAL_SOURCES}) - -target_link_libraries(${ACE_EXTENSION_NAME} ace_common) -set_target_properties(${ACE_EXTENSION_NAME} PROPERTIES PREFIX "") -set_target_properties(${ACE_EXTENSION_NAME} PROPERTIES FOLDER Extensions) - -if(CMAKE_COMPILER_IS_GNUCXX) - set_target_properties(${ACE_EXTENSION_NAME} PROPERTIES LINK_SEARCH_START_STATIC 1) - set_target_properties(${ACE_EXTENSION_NAME} PROPERTIES LINK_SEARCH_END_STATIC 1) -endif() \ No newline at end of file diff --git a/extensions/dynload/ace_dynload.cpp b/extensions/dynload/ace_dynload.cpp deleted file mode 100644 index 5cf2c52919a..00000000000 --- a/extensions/dynload/ace_dynload.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/* - * ace_vd.cpp - * - * - */ - -#include "shared.hpp" -#include "arguments.hpp" -#include "dispatch.hpp" - -static char version[] = "1.0"; - -#ifndef _STATIC -extern "C" { - __declspec (dllexport) void __stdcall RVExtension(char *output, int outputSize, const char *function); -}; - -#endif - -std::string get_command(const std::string & input) { - size_t cmd_end; - std::string command; - - cmd_end = input.find(':'); - if (cmd_end < 1) { - return ""; - } - - return input.substr(0, cmd_end); -} - - -void __stdcall RVExtension(char *output, int outputSize, const char *function) { - ZERO_OUTPUT(); - - // Get the command, then the command args - std::string input = function; - - std::string command = get_command(input); - std::string argument_str; - if (command.length() > 1 && input.length() > command.length()+1) { - argument_str = input.substr(command.length() + 1, (input.length() + 1 - command.length())); - } - ace::arguments _args(argument_str); - - std::string result = ""; - - if (command.size() < 1) { - output[0] = 0x00; - EXTENSION_RETURN(); - } - if (command == "version") { - result = version; - } - if (command == "echo") { - result = function; - } - - /*************************/ - // Real functionality goes here - ace::dispatch::get().call(command, _args, result); - - sprintf_s(output, outputSize - 1, "%s", result.c_str()); - EXTENSION_RETURN(); -} diff --git a/extensions/dynload/ace_dynload_dllmain.cpp b/extensions/dynload/ace_dynload_dllmain.cpp deleted file mode 100644 index aa3f3a35ab1..00000000000 --- a/extensions/dynload/ace_dynload_dllmain.cpp +++ /dev/null @@ -1,33 +0,0 @@ -#include "shared.hpp" -#include "logging.hpp" -#include "dynloader.hpp" - -INITIALIZE_EASYLOGGINGPP - -BOOLEAN WINAPI DllMain(IN HINSTANCE hDllHandle, - IN DWORD nReason, - IN LPVOID Reserved) { - BOOLEAN bSuccess = TRUE; - el::Configurations conf; - - switch (nReason) { - case DLL_PROCESS_ATTACH: - conf.setGlobally(el::ConfigurationType::Filename, "logs/ace_dynload.log"); - el::Loggers::setDefaultConfigurations(conf, true); - - conf.set( - el::Level::Global, - el::ConfigurationType::Filename, - "logs/server_events.log"); - - // Register functions - ace::dynloader::get().register_functions(); - - break; - case DLL_PROCESS_DETACH: - break; - } - - return bSuccess; - -} \ No newline at end of file diff --git a/extensions/dynload/dynloader.hpp b/extensions/dynload/dynloader.hpp deleted file mode 100644 index e9682a7195f..00000000000 --- a/extensions/dynload/dynloader.hpp +++ /dev/null @@ -1,168 +0,0 @@ -#pragma once - -#include "shared.hpp" -#include "dispatch.hpp" -#include "arguments.hpp" - -typedef void (__stdcall *RVExtension)(char *output, int outputSize, const char *function); - -namespace ace { - - class module { - public: - module() : handle(nullptr), function(nullptr), name("") {} - module(const std::string & name_, HMODULE handle_, RVExtension function_, const std::string & file_) : handle(handle_), function(function_), name(name_), temp_filename(file_) {} - - std::string name; - std::string temp_filename; - HMODULE handle; - RVExtension function; - }; - - class dynloader : public singleton<dynloader> { - public: - dynloader() {} - ~dynloader() { - for (auto & kv : _modules) { - arguments temp(kv.first); - std::string result_temp; - unload(temp, result_temp); - } - } - -#ifdef _WINDOWS - bool load(const arguments & args_, std::string & result) { - HMODULE dllHandle; - RVExtension function; - - LOG(INFO) << "Load requested [" << args_.as_string(0) << "]"; - - if (_modules.find(args_.as_string(0)) != _modules.end()) { - LOG(ERROR) << "Module already loaded [" << args_.as_string(0) << "]"; - return true; - } - -#ifdef _WINDOWS - // Make a copy of the file to temp, and load it from there, referencing the current path name - char tmpPath[MAX_PATH +1], buffer[MAX_PATH + 1]; - - if(!GetTempPathA(MAX_PATH, tmpPath)) { - LOG(ERROR) << "GetTempPath() failed, e=" << GetLastError(); - return false; - } - if(!GetTempFileNameA(tmpPath, "ace_dynload", TRUE, buffer)) { - LOG(ERROR) << "GetTempFileName() failed, e=" << GetLastError(); - return false; - } - std::string temp_filename = buffer; - if (!CopyFileA(args_.as_string(0).c_str(), temp_filename.c_str(), FALSE)) { - DeleteFile(temp_filename.c_str()); - if (!CopyFileA(args_.as_string(0).c_str(), temp_filename.c_str(), FALSE)) { - LOG(ERROR) << "CopyFile() , e=" << GetLastError(); - return false; - } - } -#else - std::string temp_filename = args_.as_string(0); -#endif - - dllHandle = LoadLibrary(temp_filename.c_str()); - if (!dllHandle) { - LOG(ERROR) << "LoadLibrary() failed, e=" << GetLastError() << " [" << args_.as_string(0) << "]"; - return false; - } - - function = (RVExtension)GetProcAddress(dllHandle, "_RVExtension@12"); - if (!function) { - LOG(ERROR) << "GetProcAddress() failed, e=" << GetLastError() << " [" << args_.as_string(0) << "]"; - FreeLibrary(dllHandle); - return false; - } - - LOG(INFO) << "Load completed [" << args_.as_string(0) << "]"; - - _modules[args_.as_string(0)] = module(args_.as_string(0), dllHandle, function, temp_filename); - - return false; - } - bool unload(const arguments & args_, std::string & result) { - - LOG(INFO) << "Unload requested [" << args_.as_string(0) << "]"; - - if (_modules.find(args_.as_string(0)) == _modules.end()) { - LOG(INFO) << "Unload failed, module not loaded [" << args_.as_string(0) << "]"; - return true; - } - - if (!FreeLibrary(_modules[args_.as_string(0)].handle)) { - LOG(INFO) << "FreeLibrary() failed during unload, e=" << GetLastError(); - return false; - } - //if (!DeleteFileA(_modules[args_.as_string(0)].temp_filename.c_str())) { - // LOG(INFO) << "DeleteFile() failed during unload, e=" << GetLastError(); - // return false; - //} - - _modules.erase(args_.as_string(0)); - - LOG(INFO) << "Unload complete [" << args_.as_string(0) << "]"; - - return true; - } -#endif - - bool call(const arguments & args_, std::string & result) { - //LOG(INFO) << "Calling [" << args_.as_string(0) << "]"; - - if (_modules.find(args_.as_string(0)) == _modules.end()) { - return false; - } - - result = ""; - result.resize(4096); - - std::string function_str; - std::vector<std::string> temp = ace::split(args_.get(), ','); - - if (temp.size() < 3) { - function_str = temp[1]; - } else { - for (int x = 1; x < temp.size(); x++) - function_str = function_str + temp[x] + ","; - } - _modules[args_.as_string(0)].function((char *)result.c_str(), 4096, (const char *)function_str.c_str()); -#ifdef _DEBUG - //if (args_.as_string(0) != "fetch_result" && args_.as_string(0) != "ready") { - // LOG(INFO) << "Called [" << args_.as_string(0) << "], with {" << function_str << "} result={" << result << "}"; - //} -#endif - return true; - } - - bool list(const arguments & args_, std::string & result) { - - LOG(INFO) << "Listing loaded modules"; - std::string res; - - for (auto & kv : _modules) { - res = res + kv.first + ", "; - LOG(INFO) << "\t" << kv.first; - } - - result = res; - - return false; - } - - bool register_functions() { - dispatch::get().add("list", std::bind(&ace::dynloader::list, this, std::placeholders::_1, std::placeholders::_2)); - dispatch::get().add("load", std::bind(&ace::dynloader::load, this, std::placeholders::_1, std::placeholders::_2)); - dispatch::get().add("unload", std::bind(&ace::dynloader::unload, this, std::placeholders::_1, std::placeholders::_2)); - dispatch::get().add("call", std::bind(&ace::dynloader::call, this, std::placeholders::_1, std::placeholders::_2)); - - return true; - } - protected: - std::unordered_map<std::string, module> _modules; - }; -}; diff --git a/extensions/fcs/CMakeLists.txt b/extensions/fcs/CMakeLists.txt deleted file mode 100644 index e7e69138825..00000000000 --- a/extensions/fcs/CMakeLists.txt +++ /dev/null @@ -1,22 +0,0 @@ -set(ACE_EXTENSION_NAME "ace_fcs") - -file(GLOB SOURCES *.h *.hpp *.c *.cpp) -add_library( ${ACE_EXTENSION_NAME} SHARED ${SOURCES} ${GLOBAL_SOURCES}) -target_link_libraries(${ACE_EXTENSION_NAME} ace_common) -set_target_properties(${ACE_EXTENSION_NAME} PROPERTIES PREFIX "") -set_target_properties(${ACE_EXTENSION_NAME} PROPERTIES FOLDER Extensions) - -if(CMAKE_COMPILER_IS_GNUCXX) - set_target_properties(${ACE_EXTENSION_NAME} PROPERTIES LINK_SEARCH_START_STATIC 1) - set_target_properties(${ACE_EXTENSION_NAME} PROPERTIES LINK_SEARCH_END_STATIC 1) -endif() - -# Copy and rename DLL to root -if(USE_64BIT_BUILD) - set(FINAL_DLL_NAME ${ACE_EXTENSION_NAME}_x64.dll) -else() - set(FINAL_DLL_NAME ${ACE_EXTENSION_NAME}.dll) -endif() -add_custom_command(TARGET ${ACE_EXTENSION_NAME} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${ACE_EXTENSION_NAME}> ${PROJECT_SOURCE_DIR}/../${FINAL_DLL_NAME} -) diff --git a/extensions/fcs/ace_fcs.cpp b/extensions/fcs/ace_fcs.cpp deleted file mode 100644 index f15066bc11b..00000000000 --- a/extensions/fcs/ace_fcs.cpp +++ /dev/null @@ -1,118 +0,0 @@ -/* - * ace_fcs.cpp - * - * Calculates firing solution. - * - * Takes: - * initSpeed,airFriction,angle,distance as string - * Example: "900,-0.0004,2,1050" - * - * Returns: - * Correction to angle - */ - -#include "shared.hpp" - -#define _USE_MATH_DEFINES - -#include <stdlib.h> -#include <math.h> -#include <sstream> -#include <vector> -#include <string> - -#define MAXELEVATION 20 -#define MAXITERATIONS 600 -#define PRECISION 0.1 -#define RADIANS(X) (X / (180 / M_PI)) - -extern "C" { - EXPORT void __stdcall RVExtension(char *output, int outputSize, const char *function); - EXPORT void __stdcall RVExtensionVersion(char *output, int outputSize) { - strncpy(output, ACE_FULL_VERSION_STR, outputSize - 1); - } -} - -std::vector<std::string> splitString(std::string input) { - std::istringstream ss(input); - std::string token; - - std::vector<std::string> output; - while (std::getline(ss, token, ',')) { - output.push_back(token); - } - - return output; -} - -double traceBullet(double initSpeed, double airFriction, double angle, double angleTarget, double distance) { - double velX, velY, posX, posY, lastPosX, lastPosY, posTargetX, posTargetY, velMag; - velX = cos(RADIANS(angle)) * initSpeed; - velY = sin(RADIANS(angle)) * initSpeed; - posX = 0; - posY = 0; - posTargetX = cos(RADIANS(angleTarget)) * distance; - posTargetY = sin(RADIANS(angleTarget)) * distance; - - double simulationStep = 0.05; - - int i = 0; - while (i < MAXITERATIONS) { - lastPosX = posX; - lastPosY = posY; - velMag = sqrt(pow(velX, 2) + pow(velY, 2)); - posX += velX * simulationStep * 0.5; - posY += velY * simulationStep * 0.5; - velX += simulationStep * (velX * velMag * airFriction); - velY += simulationStep * (velY * velMag * airFriction - 9.8066); - posX += velX * simulationStep * 0.5; - posY += velY * simulationStep * 0.5; - if (posX >= posTargetX) { break; } - i++; - } - - double coef = (posTargetX - lastPosX) / (posX - lastPosX); - return (lastPosY + (posY - lastPosY) * coef) - posTargetY; -} - -double getSolution(double initSpeed, double airFriction, double angleTarget, double distance) { - if (traceBullet(initSpeed, airFriction, MAXELEVATION, angleTarget, distance) < 0) { - return MAXELEVATION - angleTarget; - } - - double a1 = angleTarget; - double a2 = MAXELEVATION; - double f1, f2, tmp; - f1 = traceBullet(initSpeed, airFriction, a1, angleTarget, distance); - if (fabs(f1) <= PRECISION) { return 0; } - while (fabs(f1) > PRECISION) { - f2 = traceBullet(initSpeed, airFriction, a2, angleTarget, distance); - tmp = a2 - f2 * (a2 - a1) / (f2 - f1); - a1 = a2; - a2 = tmp; - f1 = f2; - } - - return a2 - angleTarget; -} - -void __stdcall RVExtension(char *output, int outputSize, const char *function) { - ZERO_OUTPUT(); - if (!strcmp(function, "version")) { - strncpy(output, ACE_FULL_VERSION_STR, outputSize - 1); - } else { - std::vector<std::string> argStrings = splitString(function); - double initSpeed = std::stod(argStrings[0]); - double airFriction = std::stod(argStrings[1]); - double angleTarget = std::stod(argStrings[2]); - double distance = std::stod(argStrings[3]); - - double result = getSolution(initSpeed, airFriction, angleTarget, distance); - - std::stringstream sstream; - sstream << result; - - strncpy(output, sstream.str().c_str(), outputSize - 1); - } - EXTENSION_RETURN(); -} diff --git a/extensions/medical/CMakeLists.txt b/extensions/medical/CMakeLists.txt deleted file mode 100644 index 63d7105810a..00000000000 --- a/extensions/medical/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(ACE_EXTENSION_NAME "ace_medical") - -file(GLOB SOURCES *.h *.hpp *.c *.cpp) - -add_library( ${ACE_EXTENSION_NAME} SHARED ${SOURCES} ${GLOBAL_SOURCES}) -target_link_libraries(${ACE_EXTENSION_NAME} ace_common) -set_target_properties(${ACE_EXTENSION_NAME} PROPERTIES PREFIX "") -set_target_properties(${ACE_EXTENSION_NAME} PROPERTIES FOLDER Extensions) - -if(CMAKE_COMPILER_IS_GNUCXX) - set_target_properties(${ACE_EXTENSION_NAME} PROPERTIES LINK_SEARCH_START_STATIC 1) - set_target_properties(${ACE_EXTENSION_NAME} PROPERTIES LINK_SEARCH_END_STATIC 1) -endif() \ No newline at end of file diff --git a/extensions/medical/DamageType.cpp b/extensions/medical/DamageType.cpp deleted file mode 100644 index 3e6b08e5078..00000000000 --- a/extensions/medical/DamageType.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "DamageType.h" - -ace::medical::injuries::DamageType::DamageType(std::string aTypeName, double minimalLethalDamage, std::vector<double> minDamage, std::vector<double> amountOfInjuresOnDamage, bool specificOnly) - : typeName(aTypeName), minLethalDamage(minimalLethalDamage), minDamageThreshold(minDamage), amountOfInjuresOnDamage(amountOfInjuresOnDamage), selectionSpecific(specificOnly) -{ -} - - -ace::medical::injuries::DamageType::~DamageType() -{ -} diff --git a/extensions/medical/DamageType.h b/extensions/medical/DamageType.h deleted file mode 100644 index 3cd9fb41d03..00000000000 --- a/extensions/medical/DamageType.h +++ /dev/null @@ -1,28 +0,0 @@ -#include <string> -#include <vector> -#include <memory> - - -namespace ace { - namespace medical { - namespace injuries { - class InjuryType; - - class DamageType - { - public: - DamageType(std::string aTypeName, double minimalLethalDamage, std::vector<double> minDamageThreshold, std::vector<double> amountOfInjuresOnDamage, bool specificOnly); - ~DamageType(); - - std::string typeName; - double minLethalDamage; - std::vector<double> minDamageThreshold; - std::vector<double> amountOfInjuresOnDamage; - - bool selectionSpecific; - - std::vector<std::shared_ptr<InjuryType>> possibleInjuries; - }; - } - } -} diff --git a/extensions/medical/InjuryType.cpp b/extensions/medical/InjuryType.cpp deleted file mode 100644 index a959e5dd70a..00000000000 --- a/extensions/medical/InjuryType.cpp +++ /dev/null @@ -1,13 +0,0 @@ -#include "InjuryType.h" -#include "DamageType.h" - - -ace::medical::injuries::InjuryType::InjuryType(signed int anId, const std::string& aClassname, std::vector<std::string>& allowedSelections, double theBloodLoss, double thePain, double minimumDamage, double maximumDamage, std::vector<std::string>& possibleCauses, std::string& aDisplayname) - : ID(anId), className(aClassname), selections(allowedSelections), bloodLoss(theBloodLoss), pain(thePain), minDamage(minimumDamage), maxDamage(maximumDamage), causes(possibleCauses), displayName(aDisplayname) -{ -} - - -ace::medical::injuries::InjuryType::~InjuryType() -{ -} diff --git a/extensions/medical/InjuryType.h b/extensions/medical/InjuryType.h deleted file mode 100644 index 27909174682..00000000000 --- a/extensions/medical/InjuryType.h +++ /dev/null @@ -1,27 +0,0 @@ -#include <string> -#include <vector> - -namespace ace { - namespace medical { - namespace injuries { - class DamageType; - - class InjuryType - { - public: - InjuryType(signed int anId, const std::string& aClassname, std::vector<std::string>& allowedSelections, double theBloodLoss, double thePain, double minimumDamage, double maximumDamage, std::vector<std::string>& possibleCauses, std::string& aDisplayname); - ~InjuryType(); - - signed int ID; - std::string className; - std::vector<std::string> selections; - double bloodLoss; - double pain; - double minDamage; - double maxDamage; - std::vector<std::string> causes; - std::string displayName; - }; - } - } -} \ No newline at end of file diff --git a/extensions/medical/OpenWound.cpp b/extensions/medical/OpenWound.cpp deleted file mode 100644 index 340955aac66..00000000000 --- a/extensions/medical/OpenWound.cpp +++ /dev/null @@ -1,18 +0,0 @@ -#include "OpenWound.h" -#include <sstream> - -ace::medical::injuries::OpenWound::OpenWound(int anID, int aClassID, int aBodyPartId, double aPercentage, double aBl, double painAmount) : - woundID(anID), classID(aClassID), bodyPart(aBodyPartId), percentage(aPercentage), bloodlossRate(aBl), pain(painAmount) -{ -} - -ace::medical::injuries::OpenWound::~OpenWound() -{ -} - -std::string ace::medical::injuries::OpenWound::AsString() -{ - std::stringstream stream; - stream << "[" << woundID << "," << classID << "," << bodyPart << "," << 1 << "," << bloodlossRate << "]"; - return stream.str(); -} diff --git a/extensions/medical/OpenWound.h b/extensions/medical/OpenWound.h deleted file mode 100644 index 4de796d5f9a..00000000000 --- a/extensions/medical/OpenWound.h +++ /dev/null @@ -1,26 +0,0 @@ -#pragma once - -#include <string> - -namespace ace { - namespace medical { - namespace injuries { - class OpenWound - { - public: - OpenWound(int anID, int aClassID, int aBodyPartId, double aPercentage, double aBl, double painAmount); - ~OpenWound(); - - std::string AsString(); - - int woundID; - int classID; - int percentage; - double bodyPart; - double bloodlossRate; - double pain; - }; - - } - } -} diff --git a/extensions/medical/handleDamage.cpp b/extensions/medical/handleDamage.cpp deleted file mode 100644 index 9b0e5e78ef1..00000000000 --- a/extensions/medical/handleDamage.cpp +++ /dev/null @@ -1,243 +0,0 @@ -#include "handleDamage.h" -#include "OpenWound.h" -#include "DamageType.h" -#include "InjuryType.h" -#include <sstream> -#include <algorithm> - -namespace ace { - namespace medical { - - handleDamage::handleDamage() - { - } - - - handleDamage& handleDamage::GetInstance() - { - static handleDamage instance; - return instance; - } - - handleDamage::~handleDamage() - { - } - - std::string handleDamage::HandleDamageWounds(const std::string& selectionName, double amountOfDamage, const std::string& typeOfDamage, int woundID) - { - std::vector<ace::medical::injuries::OpenWound> wounds; - int selectionN = SelectionToNumber(selectionName); - std::stringstream stream; - - if (selectionN >= 0) - { - double painToAdd = 0; - wounds = GetInjuryInfoFor(typeOfDamage, amountOfDamage, selectionN, woundID); - - stream << "[["; - for (int i = 0; i < wounds.size(); ++i) - { - stream << wounds.at(i).AsString(); - if (i != wounds.size() - 1) - { - stream << ","; - } - - painToAdd += wounds.at(i).pain; - } - stream << "],"; - - stream << painToAdd << "]"; - - return stream.str(); - } - return stream.str(); - } - - std::vector<ace::medical::injuries::OpenWound> handleDamage::GetInjuryInfoFor(const std::string& typeOfDamage, double amountOfDamage, int selection, int woundID) - { - std::vector<ace::medical::injuries::OpenWound> injuriesToAdd; - std::vector<std::shared_ptr<ace::medical::injuries::InjuryType>> information; - std::shared_ptr<ace::medical::injuries::InjuryType> highestSpot = nullptr; - - for (auto & damageType : damageTypes) - { - if (damageType->typeName == typeOfDamage) - { - for (auto & possibleInjury : damageType->possibleInjuries) - { - if (amountOfDamage >= possibleInjury->minDamage && (amountOfDamage <= possibleInjury->maxDamage || possibleInjury->maxDamage <= 0)) - { - if (highestSpot == NULL) - highestSpot = possibleInjury; - - if (possibleInjury->minDamage > highestSpot->minDamage) - highestSpot = possibleInjury; - - information.push_back(possibleInjury); - } - } - if (highestSpot == NULL) { - break; - } - - int c = 0; - for (double & threshold : damageType->minDamageThreshold) - { - if (amountOfDamage >= threshold) - { - double amountOfInjuriesOnDamage = damageType->amountOfInjuresOnDamage.at(c); - for (double injuryAmount = 0; injuryAmount < amountOfInjuriesOnDamage; ++injuryAmount) - { - std::shared_ptr<ace::medical::injuries::InjuryType> injuryToAdd; - if (rand() % 100 >= 85) - { - injuryToAdd = highestSpot; - } - else - { - int indexNewInjuryToAdd = rand() % information.size(); - injuryToAdd = information.at(indexNewInjuryToAdd); - } - - int bodyPartID = selection; - if (!damageType->selectionSpecific) - { - bodyPartID = rand() % 6; - } - - injuries::OpenWound newWound(woundID++, injuryToAdd->ID, bodyPartID, 1, injuryToAdd->bloodLoss, injuryToAdd->pain); - injuriesToAdd.push_back(newWound); - } - return injuriesToAdd; - } - ++c; - } - } - } - return injuriesToAdd; - } - - std::string handleDamage::AddDamageType(const std::vector<std::string>& input) - { - if (input.size() == 5) - { - std::string typeName = input[0]; - double minimalLethalDamage = std::stod(input[1]); - std::vector<double> minDamageThreshold = inputToVectorDouble(input[2]); - std::vector<double> amountOfInjuresOnDamage = inputToVectorDouble(input[3]); - bool selectionSpecific = std::stod(input[4]) > 0; - - std::shared_ptr<ace::medical::injuries::DamageType> type(new ace::medical::injuries::DamageType(typeName, minimalLethalDamage, minDamageThreshold, amountOfInjuresOnDamage, selectionSpecific)); - damageTypes.push_back(type); - - std::stringstream stream; - - stream << "ADDED: " << typeName << " - " << minimalLethalDamage << " - ["; - for (double & sel : minDamageThreshold) - { - stream << sel << " -"; - } - stream << "] - ["; - for (double & sel : amountOfInjuresOnDamage) - { - stream << sel << " -"; - } - stream << "] - " << selectionSpecific; - return stream.str(); - } - return "failed"; - } - - std::string handleDamage::AddInjuryType(const std::vector<std::string>& input) - { - if (input.size() == 9) - { - int ID = std::stod(input[0]); - std::string className = input[1]; - std::vector<std::string> allowedSelections = inputToVector(input[2]); - double bloodLoss = std::stod(input[3]); - double pain = std::stod(input[4]); - - double minDamage = std::stod(input[5]); - double maxDamage = std::stod(input[6]); - std::vector<std::string> possibleCauses = inputToVector(input[7]); - std::string displayName = input[8]; - - std::shared_ptr<ace::medical::injuries::InjuryType> type(new ace::medical::injuries::InjuryType(ID, className, allowedSelections, bloodLoss, pain, minDamage, maxDamage, possibleCauses, displayName)); - injuryTypes.push_back(type); - std::stringstream stream; - - stream << "ADDED: " << ID << " - " << className << " - ["; - for (std::string & sel : allowedSelections) - { - stream << sel << " -"; - } - stream << "] - "; - stream << bloodLoss << " - " << pain << " - " << minDamage << " - " << maxDamage; - for (std::string & sel : possibleCauses) - { - stream << sel << " -"; - } - stream << displayName; - return stream.str(); - } - return "failed"; - } - - void handleDamage::FinalizeDefinitions() - { - // We are finding all possible injuries for a specific damage type here, so we don't have to figure that out at a later stage. - for (auto & damageType : damageTypes) - { - for (auto & injuryType : injuryTypes) - { - std::vector<std::string>::iterator it = std::find(injuryType->causes.begin(), injuryType->causes.end(), damageType->typeName); - // outputstream << " Evaluating causes: " << (it != injuryType->causes.end()) << " "; - if (it != injuryType->causes.end()) - { - damageType->possibleInjuries.push_back(injuryType); - } - } - } - } - - int handleDamage::SelectionToNumber(const std::string& hitpointName) - { - // TODO use dynamic selections instead - std::vector<std::string> hitpoints = { "Head", "Body", "LeftArm", "RightArm", "LeftLeg", "RightLeg" }; - std::vector<std::string>::iterator it = find(hitpoints.begin(), hitpoints.end(), hitpointName); - if (it != hitpoints.end()) - { - return it - hitpoints.begin(); - } - else - { - return -1; // TODO throw exception - } - } - - std::vector<std::string> handleDamage::inputToVector(const std::string& input) - { - std::istringstream ss(input); - std::string token; - - std::vector<std::string> output; - while (std::getline(ss, token, ':')) { - output.push_back(token); - } - return output; - } - std::vector<double> handleDamage::inputToVectorDouble(const std::string& input) - { - std::istringstream ss(input); - std::string token; - - std::vector<double> output; - while (std::getline(ss, token, ':')) { - output.push_back(std::stod(token)); - } - return output; - } - } -} diff --git a/extensions/medical/handleDamage.h b/extensions/medical/handleDamage.h deleted file mode 100644 index 3b2cd739c8b..00000000000 --- a/extensions/medical/handleDamage.h +++ /dev/null @@ -1,92 +0,0 @@ -#pragma once - -#include <string> -#include <vector> -#include <memory> - -namespace ace { - namespace medical { - - namespace injuries { - class DamageType; - class InjuryType; - class OpenWound; - } - - class handleDamage - { - public: - /** - * - */ - static handleDamage& GetInstance(); - - ~handleDamage(); - - /** - * Find new open wounds from advanced medical based upon the received damage. - * - * @param selectionName A string representation of the bodypart (for example: leg_r) - * @param amountOfDamage The damage received - * @param typeOfDamage The type of the damage received - * @param woundID latest wound ID - * @return SQF string containing _woundsCreated and _painAdded. - */ - std::string HandleDamageWounds(const std::string& selectionName, double amountOfDamage, const std::string& typeOfDamage, int woundID); - - /** - * Find new open wounds from advanced medical based upon the received damage. - * - * @param typeOfDamage The type of the damage received - * @param amountOfDamage The damage received - * @param selection A number representation of the bodypart. Number from 0 to 6. - * @param woundID latest wound ID - * @return New open wounds. - */ - std::vector<ace::medical::injuries::OpenWound> GetInjuryInfoFor(const std::string& typeOfDamage, double amountOfDamage, int selection, int woundID); - - /** - * Add a new damage type from extension input parameters - * - * @param sqfDamageTypeDefinition - * @return String with result of addition: ADDED [parameters] or FAILED - */ - std::string AddDamageType(const std::vector<std::string>& sqfDamageTypeDefinition); - - /** - * Add a new injury type from extension input parameters - * - * @param sqfDamageTypeDefinition - * @return String with result of addition: ADDED [parameters] or FAILED - */ - std::string AddInjuryType(const std::vector<std::string>& sqfInjuryDefinition); - - /** - * Convert a selectionName to a number - * - * @param selectionName - * @return number of selection - */ - int SelectionToNumber(const std::string& selectionName); - - /** - * Lets the system know that all data has been added - */ - void FinalizeDefinitions(); - - private: - handleDamage(); - - handleDamage(handleDamage const&) = delete; - void operator=(handleDamage const&) = delete; - - std::vector<std::string> inputToVector(const std::string& input); - std::vector<double> inputToVectorDouble(const std::string& input); - - std::vector<std::shared_ptr<ace::medical::injuries::DamageType>> damageTypes; - std::vector<std::shared_ptr<ace::medical::injuries::InjuryType>> injuryTypes; - std::vector<std::string> selections; - std::vector<std::string> hitPoints; - }; - } -} diff --git a/extensions/medical/medical.cpp b/extensions/medical/medical.cpp deleted file mode 100644 index 8d13216f913..00000000000 --- a/extensions/medical/medical.cpp +++ /dev/null @@ -1,90 +0,0 @@ -/* -* ace_medical.cpp -* -* Author: -* Glowbal -*/ - -#include "shared.hpp" - -#include <stdlib.h> -#include <vector> -#include <string> -#include <sstream> -#include "handleDamage.h" -#include "OpenWound.h" - -extern "C" { - EXPORT void __stdcall RVExtension(char *output, int outputSize, const char *function); -} - -std::vector<std::string> parseExtensionInput(const std::string& input) -{ - std::istringstream ss(input); - std::string token; - - std::vector<std::string> output; - while (std::getline(ss, token, ',')) { - output.push_back(token); - } - return output; -} - - -void __stdcall RVExtension(char *output, int outputSize, const char *function) { - if (!strcmp(function, "version")) { - strncpy(output, ACE_FULL_VERSION_STR, outputSize - 1); - } - else - { - std::string returnValue = ""; - std::vector<std::string> arguments = parseExtensionInput(function); - if (arguments.size() > 0) - { - try { - std::string command = arguments.at(0); - arguments.erase(arguments.begin()); - - if (command == "addInjuryType") { - returnValue = ace::medical::handleDamage::GetInstance().AddInjuryType(arguments); - } - else if (command == "addDamageType") { - returnValue = ace::medical::handleDamage::GetInstance().AddDamageType(arguments); - } - else if (command == "HandleDamageWounds") { - if (arguments.size() >= 4) { - std::string selectionName = arguments.at(0); - double amountOfDamage = std::stod(arguments.at(1)); - std::string typeOfDamage = arguments.at(2); - int woundID = std::stoi(arguments.at(3)); - returnValue = ace::medical::handleDamage::GetInstance().HandleDamageWounds(selectionName, amountOfDamage, typeOfDamage, woundID); - } - } - else if (command == "ConfigComplete") { - ace::medical::handleDamage::GetInstance().FinalizeDefinitions(); - } - } - catch (std::exception e) { - std::stringstream debugreturn; - debugreturn << "diag_log format['ACE3 ERROR - Medical Extension: Something went wrong. Input: '];"; - int i = 0; - for (auto arg : arguments) { - debugreturn << "diag_log format[' arg " << i++ << ":" << arg << "'];"; - } - debugreturn << "diag_log format['Exception: " << e.what() << "'];"; - returnValue = debugreturn.str(); - } - catch (...) { - std::stringstream debugreturn; - debugreturn << "diag_log format['ACE3 ERROR - Medical Extension: Something went wrong. Input: '];"; - int i = 0; - for (auto arg : arguments) { - debugreturn << "diag_log format[' arg " << i++ << ":" << arg << "'];"; - } - returnValue = debugreturn.str(); - } - } - - strncpy(output, returnValue.c_str(), outputSize - 1); - } -} diff --git a/include/a3/ui_f/hpp/defineCommonGrids.inc b/include/a3/ui_f/hpp/defineCommonGrids.inc index 9574a6982c6..1900458d1e7 100644 --- a/include/a3/ui_f/hpp/defineCommonGrids.inc +++ b/include/a3/ui_f/hpp/defineCommonGrids.inc @@ -3,15 +3,15 @@ /////////////////////////////////////////////////////////////////////////// //--- Hack to avoid too large display upon first startup (fixed in engine) -//#define GUI_GRID_OLD_WAbs ((safezoneW / ((floor (safezoneW / safezoneH)) max 1)) min 1.2) +//#define GUI_GRID_OLD_WAbs ((safeZoneW / ((floor (safeZoneW / safeZoneH)) max 1)) min 1.2) //--- New grid for new A3 displays -#define GUI_GRID_WAbs ((safezoneW / safezoneH) min 1.2) +#define GUI_GRID_WAbs ((safeZoneW / safeZoneH) min 1.2) #define GUI_GRID_HAbs (GUI_GRID_WAbs / 1.2) #define GUI_GRID_W (GUI_GRID_WAbs / 40) #define GUI_GRID_H (GUI_GRID_HAbs / 25) -#define GUI_GRID_X (safezoneX) -#define GUI_GRID_Y (safezoneY + safezoneH - GUI_GRID_HAbs) +#define GUI_GRID_X (safeZoneX) +#define GUI_GRID_Y (safeZoneY + safeZoneH - GUI_GRID_HAbs) //--- MUF - Test grid used in MP #define GUI_GRID_MP_WAbs GUI_GRID_WAbs @@ -19,23 +19,23 @@ #define GUI_GRID_MP_W GUI_GRID_W #define GUI_GRID_MP_H GUI_GRID_H #define GUI_GRID_MP_X (SafezoneX) -#define GUI_GRID_MP_Y (safezoneY) +#define GUI_GRID_MP_Y (safeZoneY) //--- Screen Center #define GUI_GRID_CENTER_WAbs GUI_GRID_WAbs #define GUI_GRID_CENTER_HAbs GUI_GRID_HAbs #define GUI_GRID_CENTER_W GUI_GRID_W #define GUI_GRID_CENTER_H GUI_GRID_H -#define GUI_GRID_CENTER_X (safezoneX + (safezoneW - GUI_GRID_CENTER_WAbs)/2) -#define GUI_GRID_CENTER_Y (safezoneY + (safezoneH - GUI_GRID_CENTER_HAbs)/2) +#define GUI_GRID_CENTER_X (safeZoneX + (safeZoneW - GUI_GRID_CENTER_WAbs)/2) +#define GUI_GRID_CENTER_Y (safeZoneY + (safeZoneH - GUI_GRID_CENTER_HAbs)/2) //--- Bottom center position (used by Revive UI) #define GUI_GRID_CENTER_BOTTOM_WAbs GUI_GRID_WAbs #define GUI_GRID_CENTER_BOTTOM_HAbs GUI_GRID_HAbs #define GUI_GRID_CENTER_BOTTOM_W GUI_GRID_W #define GUI_GRID_CENTER_BOTTOM_H GUI_GRID_H -#define GUI_GRID_CENTER_BOTTOM_X (safezoneX + (safezoneW - GUI_GRID_CENTER_WAbs)/2) -#define GUI_GRID_CENTER_BOTTOM_Y (safezoneY + safezoneH - GUI_GRID_CENTER_HAbs) +#define GUI_GRID_CENTER_BOTTOM_X (safeZoneX + (safeZoneW - GUI_GRID_CENTER_WAbs)/2) +#define GUI_GRID_CENTER_BOTTOM_Y (safeZoneY + safeZoneH - GUI_GRID_CENTER_HAbs) //--- Screen Top Center #define GUI_GRID_TOPCENTER_WAbs GUI_GRID_WAbs @@ -43,7 +43,7 @@ #define GUI_GRID_TOPCENTER_W GUI_GRID_W #define GUI_GRID_TOPCENTER_H GUI_GRID_H #define GUI_GRID_TOPCENTER_X GUI_GRID_CENTER_X -#define GUI_GRID_TOPCENTER_Y safezoneY +#define GUI_GRID_TOPCENTER_Y safeZoneY //--- Screen Bottom Center #define GUI_GRID_BOTTOMCENTER_WAbs GUI_GRID_WAbs @@ -58,24 +58,24 @@ #define GUI_GRID_EDITOR_HAbs GUI_GRID_CENTER_HAbs #define GUI_GRID_EDITOR_W GUI_GRID_CENTER_W #define GUI_GRID_EDITOR_H GUI_GRID_CENTER_H -#define GUI_GRID_EDITOR_X (safezoneX) -#define GUI_GRID_EDITOR_Y (safezoneY) +#define GUI_GRID_EDITOR_X (safeZoneX) +#define GUI_GRID_EDITOR_Y (safeZoneY) //--- Diary #define GUI_GRID_DIARY_WAbs GUI_GRID_WAbs #define GUI_GRID_DIARY_HAbs GUI_GRID_HAbs #define GUI_GRID_DIARY_W GUI_GRID_W #define GUI_GRID_DIARY_H GUI_GRID_H -#define GUI_GRID_DIARY_X (safezoneX) -#define GUI_GRID_DIARY_Y (safezoneY) +#define GUI_GRID_DIARY_X (safeZoneX) +#define GUI_GRID_DIARY_Y (safeZoneY) //--- Top left #define GUI_GRID_TOPLEFT_WAbs GUI_GRID_WAbs #define GUI_GRID_TOPLEFT_HAbs GUI_GRID_HAbs #define GUI_GRID_TOPLEFT_W GUI_GRID_W #define GUI_GRID_TOPLEFT_H GUI_GRID_H -#define GUI_GRID_TOPLEFT_X (safezoneX) -#define GUI_GRID_TOPLEFT_Y (safezoneY) +#define GUI_GRID_TOPLEFT_X (safeZoneX) +#define GUI_GRID_TOPLEFT_Y (safeZoneY) /////////////////////////////////////////////////////////////////////////// @@ -85,8 +85,8 @@ //--- IGUI Vehicle #define IGUI_GRID_VEHICLE_WAbs (10 * GUI_GRID_W) #define IGUI_GRID_VEHICLE_HAbs (4.5 * GUI_GRID_H) -#define IGUI_GRID_VEHICLE_XDef (safezoneX + 0.5 * GUI_GRID_W) -#define IGUI_GRID_VEHICLE_YDef (safezoneY + 0.5 * GUI_GRID_H) +#define IGUI_GRID_VEHICLE_XDef (safeZoneX + 0.5 * GUI_GRID_W) +#define IGUI_GRID_VEHICLE_YDef (safeZoneY + 0.5 * GUI_GRID_H) #define IGUI_GRID_VEHICLE_X (profilenamespace getvariable ["IGUI_GRID_VEHICLE_X",IGUI_GRID_VEHICLE_XDef]) #define IGUI_GRID_VEHICLE_Y (profilenamespace getvariable ["IGUI_GRID_VEHICLE_Y",IGUI_GRID_VEHICLE_YDef]) #define IGUI_GRID_VEHICLE_W GUI_GRID_W @@ -95,8 +95,8 @@ //--- IGUI Radar #define IGUI_GRID_RADAR_WAbs (5.6 * GUI_GRID_W) #define IGUI_GRID_RADAR_HAbs (5.6 * GUI_GRID_H) -#define IGUI_GRID_RADAR_XDef (safezoneX + safezoneW / 2 - 2.8 * GUI_GRID_W) -#define IGUI_GRID_RADAR_YDef (safezoneY + 0.5 * GUI_GRID_H) +#define IGUI_GRID_RADAR_XDef (safeZoneX + safeZoneW / 2 - 2.8 * GUI_GRID_W) +#define IGUI_GRID_RADAR_YDef (safeZoneY + 0.5 * GUI_GRID_H) #define IGUI_GRID_RADAR_X (profilenamespace getvariable ["IGUI_GRID_RADAR_X",IGUI_GRID_RADAR_XDef]) #define IGUI_GRID_RADAR_Y (profilenamespace getvariable ["IGUI_GRID_RADAR_Y",IGUI_GRID_RADAR_YDef]) #define IGUI_GRID_RADAR_W GUI_GRID_W @@ -105,8 +105,8 @@ //--- IGUI Weapon #define IGUI_GRID_WEAPON_WAbs (10 * GUI_GRID_W) #define IGUI_GRID_WEAPON_HAbs (4.5 * GUI_GRID_H) -#define IGUI_GRID_WEAPON_XDef ((safezoneX + safezoneW) - IGUI_GRID_WEAPON_WAbs - 4.3 * GUI_GRID_W) -#define IGUI_GRID_WEAPON_YDef (safezoneY + 0.5 * GUI_GRID_H) +#define IGUI_GRID_WEAPON_XDef ((safeZoneX + safeZoneW) - IGUI_GRID_WEAPON_WAbs - 4.3 * GUI_GRID_W) +#define IGUI_GRID_WEAPON_YDef (safeZoneY + 0.5 * GUI_GRID_H) #define IGUI_GRID_WEAPON_X (profilenamespace getvariable ["IGUI_GRID_WEAPON_X",IGUI_GRID_WEAPON_XDef]) #define IGUI_GRID_WEAPON_Y (profilenamespace getvariable ["IGUI_GRID_WEAPON_Y",IGUI_GRID_WEAPON_YDef]) #define IGUI_GRID_WEAPON_W GUI_GRID_W @@ -115,8 +115,8 @@ //--- IGUI Stance indicator #define IGUI_GRID_STANCE_WAbs (3.7 * GUI_GRID_W) #define IGUI_GRID_STANCE_HAbs (3.7 * GUI_GRID_H) -#define IGUI_GRID_STANCE_XDef ((safezoneX + safezoneW) - IGUI_GRID_STANCE_WAbs - 0.5 * GUI_GRID_W) -#define IGUI_GRID_STANCE_YDef (safezoneY + 0.5 * GUI_GRID_H) +#define IGUI_GRID_STANCE_XDef ((safeZoneX + safeZoneW) - IGUI_GRID_STANCE_WAbs - 0.5 * GUI_GRID_W) +#define IGUI_GRID_STANCE_YDef (safeZoneY + 0.5 * GUI_GRID_H) #define IGUI_GRID_STANCE_X (profilenamespace getvariable ["IGUI_GRID_STANCE_X",IGUI_GRID_STANCE_XDef]) #define IGUI_GRID_STANCE_Y (profilenamespace getvariable ["IGUI_GRID_STANCE_Y",IGUI_GRID_STANCE_YDef]) #define IGUI_GRID_STANCE_W GUI_GRID_W @@ -126,7 +126,7 @@ #define IGUI_GRID_STAMINA_WAbs (10 * GUI_GRID_W) #define IGUI_GRID_STAMINA_HAbs (1 * GUI_GRID_H) #define IGUI_GRID_STAMINA_XDef IGUI_GRID_WEAPON_XDef -#define IGUI_GRID_STAMINA_YDef (safezoneY + 4.05 * GUI_GRID_H) +#define IGUI_GRID_STAMINA_YDef (safeZoneY + 4.05 * GUI_GRID_H) #define IGUI_GRID_STAMINA_X (profilenamespace getvariable ["IGUI_GRID_STAMINA_X",IGUI_GRID_STAMINA_XDef]) #define IGUI_GRID_STAMINA_Y (profilenamespace getvariable ["IGUI_GRID_STAMINA_Y",IGUI_GRID_STAMINA_YDef]) #define IGUI_GRID_STAMINA_W GUI_GRID_W @@ -136,7 +136,7 @@ #define IGUI_GRID_NOTIFICATION_WAbs (12 * GUI_GRID_W) #define IGUI_GRID_NOTIFICATION_HAbs (6 * GUI_GRID_H) #define IGUI_GRID_NOTIFICATION_XDef (0.5 - 6 * GUI_GRID_W) -#define IGUI_GRID_NOTIFICATION_YDef (safezoneY + 6.5 * GUI_GRID_H) +#define IGUI_GRID_NOTIFICATION_YDef (safeZoneY + 6.5 * GUI_GRID_H) #define IGUI_GRID_NOTIFICATION_X (profilenamespace getvariable ["IGUI_GRID_NOTIFICATION_X",IGUI_GRID_NOTIFICATION_XDef]) #define IGUI_GRID_NOTIFICATION_Y (profilenamespace getvariable ["IGUI_GRID_NOTIFICATION_Y",IGUI_GRID_NOTIFICATION_YDef]) #define IGUI_GRID_NOTIFICATION_W GUI_GRID_W @@ -145,8 +145,8 @@ //--- IGUI Action / Command Menu #define IGUI_GRID_MENU_WAbs (4.5 * GUI_GRID_W) #define IGUI_GRID_MENU_HAbs (13.5 * IGUI_TEXT_SIZE_MEDIUM) -#define IGUI_GRID_MENU_XDef (1.5 * GUI_GRID_W + safezoneX) -#define IGUI_GRID_MENU_YDef (5 * GUI_GRID_H + safezoneY) +#define IGUI_GRID_MENU_XDef (1.5 * GUI_GRID_W + safeZoneX) +#define IGUI_GRID_MENU_YDef (5 * GUI_GRID_H + safeZoneY) #define IGUI_GRID_MENU_X (profilenamespace getvariable ["IGUI_GRID_MENU_X",IGUI_GRID_MENU_XDef]) #define IGUI_GRID_MENU_Y (profilenamespace getvariable ["IGUI_GRID_MENU_Y",IGUI_GRID_MENU_YDef]) #define IGUI_GRID_MENU_W GUI_GRID_W @@ -155,8 +155,8 @@ //--- IGUI Communication menu icons #define IGUI_GRID_COMM_WAbs (1.5 * GUI_GRID_W) #define IGUI_GRID_COMM_HAbs (15 * GUI_GRID_H) -#define IGUI_GRID_COMM_XDef (0 * GUI_GRID_W + safezoneX) -#define IGUI_GRID_COMM_YDef (5 * GUI_GRID_H + safezoneY) +#define IGUI_GRID_COMM_XDef (0 * GUI_GRID_W + safeZoneX) +#define IGUI_GRID_COMM_YDef (5 * GUI_GRID_H + safeZoneY) #define IGUI_GRID_COMM_X (profilenamespace getvariable ["IGUI_GRID_COMM_X",IGUI_GRID_COMM_XDef]) #define IGUI_GRID_COMM_Y (profilenamespace getvariable ["IGUI_GRID_COMM_Y",IGUI_GRID_COMM_YDef]) #define IGUI_GRID_COMM_W GUI_GRID_W @@ -165,16 +165,16 @@ //--- IGUI Hint #define IGUI_GRID_HINT_WAbs (12 * GUI_GRID_W) #define IGUI_GRID_HINT_HAbs (8 * GUI_GRID_H) -#define IGUI_GRID_HINT_XDef ((safezoneX + safezoneW) - IGUI_GRID_HINT_WAbs - 1 * GUI_GRID_W) -#define IGUI_GRID_HINT_YDef (safezoneY + 6 * GUI_GRID_H) +#define IGUI_GRID_HINT_XDef ((safeZoneX + safeZoneW) - IGUI_GRID_HINT_WAbs - 1 * GUI_GRID_W) +#define IGUI_GRID_HINT_YDef (safeZoneY + 6 * GUI_GRID_H) #define IGUI_GRID_HINT_X (profilenamespace getvariable ["IGUI_GRID_HINT_X",IGUI_GRID_HINT_XDef]) #define IGUI_GRID_HINT_Y (profilenamespace getvariable ["IGUI_GRID_HINT_Y",IGUI_GRID_HINT_YDef]) #define IGUI_GRID_HINT_W GUI_GRID_W #define IGUI_GRID_HINT_H GUI_GRID_H //--- IGUI GPS -#define IGUI_GRID_GPS_XDef (safezoneX + safezoneW - 11 * GUI_GRID_W) -#define IGUI_GRID_GPS_YDef (safezoneY + safezoneH - 20.5 * GUI_GRID_H) +#define IGUI_GRID_GPS_XDef (safeZoneX + safeZoneW - 11 * GUI_GRID_W) +#define IGUI_GRID_GPS_YDef (safeZoneY + safeZoneH - 20.5 * GUI_GRID_H) #define IGUI_GRID_GPS_WDef (10 * GUI_GRID_W) #define IGUI_GRID_GPS_HDef (10 * GUI_GRID_H) #define IGUI_GRID_GPS_X (profilenamespace getvariable ['IGUI_GRID_GPS_X',IGUI_GRID_GPS_XDef]) @@ -183,8 +183,8 @@ #define IGUI_GRID_GPS_HAbs (profilenamespace getvariable ['IGUI_GRID_GPS_H',IGUI_GRID_GPS_HDef]) //--- IGUI AV Camera -#define IGUI_GRID_AVCAMERA_XDef (safezoneX + safezoneW - 11.6 * GUI_GRID_W) -#define IGUI_GRID_AVCAMERA_YDef (safezoneY + safezoneH - 17.2 * GUI_GRID_H) +#define IGUI_GRID_AVCAMERA_XDef (safeZoneX + safeZoneW - 11.6 * GUI_GRID_W) +#define IGUI_GRID_AVCAMERA_YDef (safeZoneY + safeZoneH - 17.2 * GUI_GRID_H) #define IGUI_GRID_AVCAMERA_WDef (10.6 * GUI_GRID_W) #define IGUI_GRID_AVCAMERA_HDef (6.7 * GUI_GRID_H) #define IGUI_GRID_AVCAMERA_X (profilenamespace getvariable ['IGUI_GRID_AVCAMERA_X',IGUI_GRID_AVCAMERA_XDef]) @@ -193,8 +193,8 @@ #define IGUI_GRID_AVCAMERA_HAbs (profilenamespace getvariable ['IGUI_GRID_AVCAMERA_H',IGUI_GRID_AVCAMERA_HDef]) //--- IGUI IGUI Chat Log -#define IGUI_GRID_CHAT_XDef (safezoneX + 1 * GUI_GRID_W) -#define IGUI_GRID_CHAT_YDef (safezoneY + safezoneH - 10.5 * GUI_GRID_H) +#define IGUI_GRID_CHAT_XDef (safeZoneX + 1 * GUI_GRID_W) +#define IGUI_GRID_CHAT_YDef (safeZoneY + safeZoneH - 10.5 * GUI_GRID_H) #define IGUI_GRID_CHAT_WDef (20 * GUI_GRID_W) #define IGUI_GRID_CHAT_HDef (5 * GUI_GRID_H) #define IGUI_GRID_CHAT_X (profilenamespace getvariable ["IGUI_GRID_CHAT_X",IGUI_GRID_CHAT_XDef]) @@ -205,8 +205,8 @@ //--- IGUI Command Bar #define IGUI_GRID_BAR_WAbs (36 * GUI_GRID_W) #define IGUI_GRID_BAR_HAbs (4 * GUI_GRID_H) -#define IGUI_GRID_BAR_XDef (safezoneX + 1 * GUI_GRID_W) -#define IGUI_GRID_BAR_YDef (safezoneY + safezoneH - 4.5 * GUI_GRID_H) +#define IGUI_GRID_BAR_XDef (safeZoneX + 1 * GUI_GRID_W) +#define IGUI_GRID_BAR_YDef (safeZoneY + safeZoneH - 4.5 * GUI_GRID_H) #define IGUI_GRID_BAR_X (profilenamespace getvariable ["IGUI_GRID_BAR_X",IGUI_GRID_BAR_XDef]) #define IGUI_GRID_BAR_Y (profilenamespace getvariable ["IGUI_GRID_BAR_Y",IGUI_GRID_BAR_YDef]) #define IGUI_GRID_BAR_W GUI_GRID_W @@ -215,8 +215,8 @@ //--- IGUI MP Progress #define IGUI_GRID_MP_WAbs (2.5 * GUI_GRID_W) #define IGUI_GRID_MP_HAbs (15 * GUI_GRID_H) -#define IGUI_GRID_MP_XDef (safezoneX + safezoneW - 2 * GUI_GRID_W) -#define IGUI_GRID_MP_YDef (5 * GUI_GRID_H + safezoneY) +#define IGUI_GRID_MP_XDef (safeZoneX + safeZoneW - 2 * GUI_GRID_W) +#define IGUI_GRID_MP_YDef (5 * GUI_GRID_H + safeZoneY) #define IGUI_GRID_MP_X (profilenamespace getvariable ["IGUI_GRID_MP_X",IGUI_GRID_MP_XDef]) #define IGUI_GRID_MP_Y (profilenamespace getvariable ["IGUI_GRID_MP_Y",IGUI_GRID_MP_YDef]) #define IGUI_GRID_MP_W GUI_GRID_W @@ -225,8 +225,8 @@ //--- IGUI Custom Mission Display #define IGUI_GRID_MISSION_WAbs (20 * GUI_GRID_W) #define IGUI_GRID_MISSION_HAbs (5 * GUI_GRID_H) -#define IGUI_GRID_MISSION_XDef (safezoneX + safezoneW - 21 * GUI_GRID_W) -#define IGUI_GRID_MISSION_YDef (safezoneY + safezoneH - 10.5 * GUI_GRID_H) +#define IGUI_GRID_MISSION_XDef (safeZoneX + safeZoneW - 21 * GUI_GRID_W) +#define IGUI_GRID_MISSION_YDef (safeZoneY + safeZoneH - 10.5 * GUI_GRID_H) #define IGUI_GRID_MISSION_X (profilenamespace getvariable ["IGUI_GRID_MISSION_X",IGUI_GRID_MISSION_XDef]) #define IGUI_GRID_MISSION_Y (profilenamespace getvariable ["IGUI_GRID_MISSION_Y",IGUI_GRID_MISSION_YDef]) #define IGUI_GRID_MISSION_W GUI_GRID_W @@ -235,10 +235,10 @@ //--- IGUI Custom Info #define IGUI_GRID_CUSTOMINFO_WDef (10 * GUI_GRID_W) #define IGUI_GRID_CUSTOMINFO_HDef (10 * GUI_GRID_H) -#define IGUI_GRID_CUSTOMINFOLEFT_XDef (safezoneX + 0.5 * GUI_GRID_W) -#define IGUI_GRID_CUSTOMINFOLEFT_YDef (safezoneY + safezoneH - 21 * GUI_GRID_H) -#define IGUI_GRID_CUSTOMINFORIGHT_XDef ((safezoneX + safezoneW) - (IGUI_GRID_CUSTOMINFO_WDef + 0.5 * GUI_GRID_W)) -#define IGUI_GRID_CUSTOMINFORIGHT_YDef (safezoneY + safezoneH - 21 * GUI_GRID_H) +#define IGUI_GRID_CUSTOMINFOLEFT_XDef (safeZoneX + 0.5 * GUI_GRID_W) +#define IGUI_GRID_CUSTOMINFOLEFT_YDef (safeZoneY + safeZoneH - 21 * GUI_GRID_H) +#define IGUI_GRID_CUSTOMINFORIGHT_XDef ((safeZoneX + safeZoneW) - (IGUI_GRID_CUSTOMINFO_WDef + 0.5 * GUI_GRID_W)) +#define IGUI_GRID_CUSTOMINFORIGHT_YDef (safeZoneY + safeZoneH - 21 * GUI_GRID_H) #define IGUI_GRID_CUSTOMINFOLEFT_X (profilenamespace getvariable ["IGUI_GRID_CUSTOMINFOLEFT_X",IGUI_GRID_CUSTOMINFOLEFT_XDef]) #define IGUI_GRID_CUSTOMINFOLEFT_Y (profilenamespace getvariable ["IGUI_GRID_CUSTOMINFOLEFT_Y",IGUI_GRID_CUSTOMINFOLEFT_YDef]) @@ -255,21 +255,21 @@ /////////////////////////////////////////////////////////////////////////// //--- Old grid, that is used for old A3 and TKOH displays -#define GUI_GRID_OLD_WAbs ((safezoneW / safezoneH) min 1.2) +#define GUI_GRID_OLD_WAbs ((safeZoneW / safeZoneH) min 1.2) #define GUI_GRID_OLD_HAbs (GUI_GRID_OLD_WAbs / 1.2) #define GUI_GRID_OLD_W (GUI_GRID_OLD_WAbs / 32) #define GUI_GRID_OLD_H (GUI_GRID_OLD_HAbs / 20) -#define GUI_GRID_OLD_X (safezoneX) -#define GUI_GRID_OLD_Y (safezoneY + safezoneH - GUI_GRID_OLD_HAbs) +#define GUI_GRID_OLD_X (safeZoneX) +#define GUI_GRID_OLD_Y (safeZoneY + safeZoneH - GUI_GRID_OLD_HAbs) //--- Centered -//#define GUI_GRID_OLD_X (safezoneX + (safezoneW - GUI_GRID_OLD_CENTER_WAbs)/2) +//#define GUI_GRID_OLD_X (safeZoneX + (safeZoneW - GUI_GRID_OLD_CENTER_WAbs)/2) //--- Dark magic -//#define GUI_GRID_OLD_X (profilenamespace getvariable ['GUI_GRID_OLD_X',(safezoneX + (safezoneW - GUI_GRID_OLD_CENTER_WAbs)/2)]) -//#define GUI_GRID_OLD_Y (profilenamespace getvariable ['GUI_GRID_OLD_Y',(safezoneY + safezoneH - GUI_GRID_OLD_HAbs)]) +//#define GUI_GRID_OLD_X (profilenamespace getvariable ['GUI_GRID_OLD_X',(safeZoneX + (safeZoneW - GUI_GRID_OLD_CENTER_WAbs)/2)]) +//#define GUI_GRID_OLD_Y (profilenamespace getvariable ['GUI_GRID_OLD_Y',(safeZoneY + safeZoneH - GUI_GRID_OLD_HAbs)]) //MUF-TEST: Anchor near the right edge of the screen - when changing Interface size, this point doesn't change its X position -#define GUI_ANCHOR_RIGHT (0.983 * safezoneW + safezoneX) +#define GUI_ANCHOR_RIGHT (0.983 * safeZoneW + safeZoneX) #define GUI_ANCHOR_LEFT 0 //--- Screen Center @@ -277,8 +277,8 @@ #define GUI_GRID_OLD_CENTER_HAbs GUI_GRID_OLD_HAbs #define GUI_GRID_OLD_CENTER_W GUI_GRID_OLD_W #define GUI_GRID_OLD_CENTER_H GUI_GRID_OLD_H -#define GUI_GRID_OLD_CENTER_X (safezoneX + (safezoneW - GUI_GRID_OLD_CENTER_WAbs)/2) -#define GUI_GRID_OLD_CENTER_Y (safezoneY + (safezoneH - GUI_GRID_OLD_CENTER_HAbs)/2) +#define GUI_GRID_OLD_CENTER_X (safeZoneX + (safeZoneW - GUI_GRID_OLD_CENTER_WAbs)/2) +#define GUI_GRID_OLD_CENTER_Y (safeZoneY + (safeZoneH - GUI_GRID_OLD_CENTER_HAbs)/2) //--- 2D Editor #define GUI_GRID_OLD_EDITOR_WAbs GUI_GRID_OLD_CENTER_WAbs @@ -286,76 +286,76 @@ #define GUI_GRID_OLD_EDITOR_W GUI_GRID_OLD_CENTER_W #define GUI_GRID_OLD_EDITOR_H GUI_GRID_OLD_CENTER_H #define GUI_GRID_OLD_EDITOR_X GUI_GRID_OLD_CENTER_X -#define GUI_GRID_OLD_EDITOR_Y (safezoneY) +#define GUI_GRID_OLD_EDITOR_Y (safeZoneY) //--- Debug console (center down) #define GUI_GRID_OLD_DEBUG_WAbs GUI_GRID_OLD_WAbs #define GUI_GRID_OLD_DEBUG_HAbs GUI_GRID_OLD_HAbs #define GUI_GRID_OLD_DEBUG_W GUI_GRID_OLD_W #define GUI_GRID_OLD_DEBUG_H GUI_GRID_OLD_H -#define GUI_GRID_OLD_DEBUG_X (safezoneX + (safezoneW - GUI_GRID_OLD_DEBUG_WAbs)/2) -#define GUI_GRID_OLD_DEBUG_Y (safezoneY + safezoneH - GUI_GRID_OLD_DEBUG_HAbs) +#define GUI_GRID_OLD_DEBUG_X (safeZoneX + (safeZoneW - GUI_GRID_OLD_DEBUG_WAbs)/2) +#define GUI_GRID_OLD_DEBUG_Y (safeZoneY + safeZoneH - GUI_GRID_OLD_DEBUG_HAbs) //--- IGUI Common #define IGUI_GRID_OLD_WAbs GUI_GRID_OLD_WAbs #define IGUI_GRID_OLD_HAbs GUI_GRID_OLD_HAbs #define IGUI_GRID_OLD_W GUI_GRID_OLD_W #define IGUI_GRID_OLD_H GUI_GRID_OLD_H -#define IGUI_GRID_OLD_X (safezoneX + (safezoneW - IGUI_GRID_OLD_WAbs) / 2) -#define IGUI_GRID_OLD_Y (safezoneY + safezoneH - IGUI_GRID_OLD_HAbs) +#define IGUI_GRID_OLD_X (safeZoneX + (safeZoneW - IGUI_GRID_OLD_WAbs) / 2) +#define IGUI_GRID_OLD_Y (safeZoneY + safeZoneH - IGUI_GRID_OLD_HAbs) //--- IGUI Bottom #define IGUI_GRID_OLD_BOTTOM_WAbs IGUI_GRID_OLD_WAbs #define IGUI_GRID_OLD_BOTTOM_HAbs IGUI_GRID_OLD_HAbs #define IGUI_GRID_OLD_BOTTOM_W IGUI_GRID_OLD_W #define IGUI_GRID_OLD_BOTTOM_H IGUI_GRID_OLD_H -#define IGUI_GRID_OLD_BOTTOM_X (safezoneX + (safezoneW - IGUI_GRID_OLD_BOTTOM_WAbs) / 2) -#define IGUI_GRID_OLD_BOTTOM_Y (safezoneY + safezoneH - IGUI_GRID_OLD_BOTTOM_HAbs) +#define IGUI_GRID_OLD_BOTTOM_X (safeZoneX + (safeZoneW - IGUI_GRID_OLD_BOTTOM_WAbs) / 2) +#define IGUI_GRID_OLD_BOTTOM_Y (safeZoneY + safeZoneH - IGUI_GRID_OLD_BOTTOM_HAbs) //--- IGUI Analogue Gauges ----------------------------------------------------------------------------------------------------- //--- Analogue gauge - Speed -#define IGUI_GRID_GAUGESPEED_XDef (safezoneX + (safezoneW / 2) - 19.75 * GUI_GRID_W) -#define IGUI_GRID_GAUGESPEED_YDef (safezoneY + safezoneH - 11.7 * GUI_GRID_H) +#define IGUI_GRID_GAUGESPEED_XDef (safeZoneX + (safeZoneW / 2) - 19.75 * GUI_GRID_W) +#define IGUI_GRID_GAUGESPEED_YDef (safeZoneY + safeZoneH - 11.7 * GUI_GRID_H) #define IGUI_GRID_GAUGESPEED_X (profilenamespace getvariable ['IGUI_GRID_GAUGESPEED_X',IGUI_GRID_GAUGESPEED_XDef]) #define IGUI_GRID_GAUGESPEED_Y (profilenamespace getvariable ['IGUI_GRID_GAUGESPEED_Y',IGUI_GRID_GAUGESPEED_YDef]) #define IGUI_GRID_GAUGESPEED_WAbs (7.5 * GUI_GRID_W) #define IGUI_GRID_GAUGESPEED_HAbs (7.5 * GUI_GRID_H) //--- Analogue gauge - Alt -#define IGUI_GRID_GAUGEALT_XDef (safezoneX + (safezoneW / 2) - 11.75 * GUI_GRID_W) -#define IGUI_GRID_GAUGEALT_YDef (safezoneY + safezoneH - 11.7 * GUI_GRID_H) +#define IGUI_GRID_GAUGEALT_XDef (safeZoneX + (safeZoneW / 2) - 11.75 * GUI_GRID_W) +#define IGUI_GRID_GAUGEALT_YDef (safeZoneY + safeZoneH - 11.7 * GUI_GRID_H) #define IGUI_GRID_GAUGEALT_X (profilenamespace getvariable ['IGUI_GRID_GAUGEALT_X',IGUI_GRID_GAUGEALT_XDef]) #define IGUI_GRID_GAUGEALT_Y (profilenamespace getvariable ['IGUI_GRID_GAUGEALT_Y',IGUI_GRID_GAUGEALT_YDef]) #define IGUI_GRID_GAUGEALT_WAbs (7.5 * GUI_GRID_W) #define IGUI_GRID_GAUGEALT_HAbs (7.5 * GUI_GRID_H) //--- Analogue gauge - Horizon -#define IGUI_GRID_GAUGEHORIZON_XDef (safezoneX + ((safezoneW - 7.5 * GUI_GRID_W) / 2)) -#define IGUI_GRID_GAUGEHORIZON_YDef (safezoneY + safezoneH - 11.7 * GUI_GRID_H) +#define IGUI_GRID_GAUGEHORIZON_XDef (safeZoneX + ((safeZoneW - 7.5 * GUI_GRID_W) / 2)) +#define IGUI_GRID_GAUGEHORIZON_YDef (safeZoneY + safeZoneH - 11.7 * GUI_GRID_H) #define IGUI_GRID_GAUGEHORIZON_X (profilenamespace getvariable ['IGUI_GRID_GAUGEHORIZON_X',IGUI_GRID_GAUGEHORIZON_XDef]) #define IGUI_GRID_GAUGEHORIZON_Y (profilenamespace getvariable ['IGUI_GRID_GAUGEHORIZON_Y',IGUI_GRID_GAUGEHORIZON_YDef]) #define IGUI_GRID_GAUGEHORIZON_WAbs (7.5 * GUI_GRID_W) #define IGUI_GRID_GAUGEHORIZON_HAbs (7.5 * GUI_GRID_H) //--- Analogue gauge - Stability -#define IGUI_GRID_GAUGESTABILITY_XDef (safezoneX + (safezoneW / 2) + 4.25 * GUI_GRID_W) -#define IGUI_GRID_GAUGESTABILITY_YDef (safezoneY + safezoneH - 11.7 * GUI_GRID_H) +#define IGUI_GRID_GAUGESTABILITY_XDef (safeZoneX + (safeZoneW / 2) + 4.25 * GUI_GRID_W) +#define IGUI_GRID_GAUGESTABILITY_YDef (safeZoneY + safeZoneH - 11.7 * GUI_GRID_H) #define IGUI_GRID_GAUGESTABILITY_X (profilenamespace getvariable ['IGUI_GRID_GAUGESTABILITY_X',IGUI_GRID_GAUGESTABILITY_XDef]) #define IGUI_GRID_GAUGESTABILITY_Y (profilenamespace getvariable ['IGUI_GRID_GAUGESTABILITY_Y',IGUI_GRID_GAUGESTABILITY_YDef]) #define IGUI_GRID_GAUGESTABILITY_WAbs (7.5 * GUI_GRID_W) #define IGUI_GRID_GAUGESTABILITY_HAbs (7.5 * GUI_GRID_H) //--- Analogue gauge - Compass -#define IGUI_GRID_GAUGECOMPASS_XDef (safezoneX + (safezoneW / 2) + 12.25 * GUI_GRID_W) -#define IGUI_GRID_GAUGECOMPASS_YDef (safezoneY + safezoneH - 11.7 * GUI_GRID_H) +#define IGUI_GRID_GAUGECOMPASS_XDef (safeZoneX + (safeZoneW / 2) + 12.25 * GUI_GRID_W) +#define IGUI_GRID_GAUGECOMPASS_YDef (safeZoneY + safeZoneH - 11.7 * GUI_GRID_H) #define IGUI_GRID_GAUGECOMPASS_X (profilenamespace getvariable ['IGUI_GRID_GAUGECOMPASS_X',IGUI_GRID_GAUGECOMPASS_XDef]) #define IGUI_GRID_GAUGECOMPASS_Y (profilenamespace getvariable ['IGUI_GRID_GAUGECOMPASS_Y',IGUI_GRID_GAUGECOMPASS_YDef]) #define IGUI_GRID_GAUGECOMPASS_WAbs (7.5 * GUI_GRID_W) #define IGUI_GRID_GAUGECOMPASS_HAbs (7.5 * GUI_GRID_H) //--- Analogue gauge - Damage indicators -// #define IGUI_GRID_GAUGEDAMAGE_XDef (safezoneX + (safezoneW / 2) - 19 * GUI_GRID_W) -// #define IGUI_GRID_GAUGEDAMAGE_YDef (safezoneY + safezoneH - 7 * GUI_GRID_H) +// #define IGUI_GRID_GAUGEDAMAGE_XDef (safeZoneX + (safeZoneW / 2) - 19 * GUI_GRID_W) +// #define IGUI_GRID_GAUGEDAMAGE_YDef (safeZoneY + safeZoneH - 7 * GUI_GRID_H) // #define IGUI_GRID_GAUGEDAMAGE_X (profilenamespace getvariable ['IGUI_GRID_GAUGEDAMAGE_X',IGUI_GRID_GAUGEDAMAGE_XDef]) // #define IGUI_GRID_GAUGEDAMAGE_Y (profilenamespace getvariable ['IGUI_GRID_GAUGEDAMAGE_Y',IGUI_GRID_GAUGEDAMAGE_YDef]) // #define IGUI_GRID_GAUGEDAMAGE_WAbs (9.6 * GUI_GRID_W) @@ -363,8 +363,8 @@ //--- IGUI Analogue Gauges ----------------------------------------------------------------------------------------------------- //--- Sling Load Assistant -#define IGUI_GRID_SLINGLOADASSISTANT_XDef (safezoneX + safezoneW - 8 * GUI_GRID_W) -#define IGUI_GRID_SLINGLOADASSISTANT_YDef (safezoneY + safezoneH - 19.5 * GUI_GRID_H) +#define IGUI_GRID_SLINGLOADASSISTANT_XDef (safeZoneX + safeZoneW - 8 * GUI_GRID_W) +#define IGUI_GRID_SLINGLOADASSISTANT_YDef (safeZoneY + safeZoneH - 19.5 * GUI_GRID_H) #define IGUI_GRID_SLINGLOADASSISTANT_WDef (7 * GUI_GRID_W) #define IGUI_GRID_SLINGLOADASSISTANT_HDef (9.5 * GUI_GRID_H) #define IGUI_GRID_SLINGLOADASSISTANT_X (profilenamespace getvariable ['IGUI_GRID_SLINGLOADASSISTANT_X',IGUI_GRID_SLINGLOADASSISTANT_XDef]) @@ -373,8 +373,8 @@ #define IGUI_GRID_SLINGLOADASSISTANT_HAbs (profilenamespace getvariable ['IGUI_GRID_SLINGLOADASSISTANT_H',IGUI_GRID_SLINGLOADASSISTANT_HDef]) //--- Squad Radar -// #define IGUI_GRID_SQUADRADAR_XDef (safezoneX + (safezoneW / 2) - 3 * GUI_GRID_W) -// #define IGUI_GRID_SQUADRADAR_YDef (safezoneY + safezoneH - 10.9 * GUI_GRID_H) +// #define IGUI_GRID_SQUADRADAR_XDef (safeZoneX + (safeZoneW / 2) - 3 * GUI_GRID_W) +// #define IGUI_GRID_SQUADRADAR_YDef (safeZoneY + safeZoneH - 10.9 * GUI_GRID_H) // #define IGUI_GRID_SQUADRADAR_X (profilenamespace getvariable ['IGUI_GRID_SQUADRADAR_X',IGUI_GRID_SQUADRADAR_XDef]) // #define IGUI_GRID_SQUADRADAR_Y (profilenamespace getvariable ['IGUI_GRID_SQUADRADAR_Y',IGUI_GRID_SQUADRADAR_YDef]) // #define IGUI_GRID_SQUADRADAR_WAbs (6 * GUI_GRID_W) @@ -397,8 +397,8 @@ //--- IGUI Action / Command Menu #define IGUI_GRID_OLD_MENU_WAbs (4.5 * IGUI_GRID_OLD_W) #define IGUI_GRID_OLD_MENU_HAbs (10 * (IGUI_TEXT_SIZE_MEDIUM * 1.3)) -#define IGUI_GRID_OLD_MENU_XDef (1 * IGUI_GRID_OLD_W + safezoneX) -#define IGUI_GRID_OLD_MENU_YDef (5 * IGUI_GRID_OLD_H + safezoneY) +#define IGUI_GRID_OLD_MENU_XDef (1 * IGUI_GRID_OLD_W + safeZoneX) +#define IGUI_GRID_OLD_MENU_YDef (5 * IGUI_GRID_OLD_H + safeZoneY) #define IGUI_GRID_OLD_MENU_X (profilenamespace getvariable ["IGUI_GRID_OLD_MENU_X",IGUI_GRID_OLD_MENU_XDef]) #define IGUI_GRID_OLD_MENU_Y (profilenamespace getvariable ["IGUI_GRID_OLD_MENU_Y",IGUI_GRID_OLD_MENU_YDef]) #define IGUI_GRID_OLD_MENU_W IGUI_GRID_OLD_W @@ -420,14 +420,14 @@ #define IGUI_GRID_OLD_TASK_WAbs (12 * IGUI_GRID_OLD_W) #define IGUI_GRID_OLD_TASK_HAbs (2 * IGUI_GRID_OLD_H) #define IGUI_GRID_OLD_TASK_XDef (10 * IGUI_GRID_OLD_W + IGUI_GRID_OLD_X) -#define IGUI_GRID_OLD_TASK_YDef (1 * IGUI_GRID_OLD_H + safezoneY) +#define IGUI_GRID_OLD_TASK_YDef (1 * IGUI_GRID_OLD_H + safeZoneY) #define IGUI_GRID_OLD_TASK_X IGUI_GRID_OLD_TASK_XDef #define IGUI_GRID_OLD_TASK_Y IGUI_GRID_OLD_TASK_YDef #define IGUI_GRID_OLD_TASK_W IGUI_GRID_OLD_W #define IGUI_GRID_OLD_TASK_H IGUI_GRID_OLD_H //--- IGUI PIP -#define IGUI_GRID_OLD_PIP_XDef (safezoneX + safezoneW - 6.8 * IGUI_GRID_OLD_W) +#define IGUI_GRID_OLD_PIP_XDef (safeZoneX + safeZoneW - 6.8 * IGUI_GRID_OLD_W) #define IGUI_GRID_OLD_PIP_YDef (7 * IGUI_GRID_OLD_H + IGUI_GRID_OLD_Y) #define IGUI_GRID_OLD_PIP_WDef (6 * IGUI_GRID_OLD_W) #define IGUI_GRID_OLD_PIP_HDef (IGUI_GRID_OLD_PIP_WDef) @@ -456,9 +456,9 @@ #define GUI_GRID_OLD_OPTICS_HAbs (SafezoneH) //--- MUF - experimental AV Terminal grid -#define GUI_GRID_OLD_AV_TERMINAL_X (safezoneX) -#define GUI_GRID_OLD_AV_TERMINAL_Y (safezoneY) -#define GUI_GRID_OLD_AV_TERMINAL_W (safezoneW / 64) -#define GUI_GRID_OLD_AV_TERMINAL_H (safezoneH / 40) -#define GUI_GRID_OLD_AV_TERMINAL_WAbs (safezoneW) -#define GUI_GRID_OLD_AV_TERMINAL_HAbs (safezoneH) +#define GUI_GRID_OLD_AV_TERMINAL_X (safeZoneX) +#define GUI_GRID_OLD_AV_TERMINAL_Y (safeZoneY) +#define GUI_GRID_OLD_AV_TERMINAL_W (safeZoneW / 64) +#define GUI_GRID_OLD_AV_TERMINAL_H (safeZoneH / 40) +#define GUI_GRID_OLD_AV_TERMINAL_WAbs (safeZoneW) +#define GUI_GRID_OLD_AV_TERMINAL_HAbs (safeZoneH) diff --git a/include/a3/ui_f_curator/ui/displays/RscDisplayAttributes.sqf b/include/a3/ui_f_curator/ui/displays/RscDisplayAttributes.sqf index 09aba83b06e..45ba7c87ff8 100644 --- a/include/a3/ui_f_curator/ui/displays/RscDisplayAttributes.sqf +++ b/include/a3/ui_f_curator/ui/displays/RscDisplayAttributes.sqf @@ -8,130 +8,130 @@ switch _mode do { case "onLoad": { _display = _params select 0; - _displayConfig = configfile >> _class; - - _ctrlBackground = _display displayctrl IDC_RSCDISPLAYATTRIBUTES_BACKGROUND; - _ctrlTitle = _display displayctrl IDC_RSCDISPLAYATTRIBUTES_TITLE; - _ctrlContent = _display displayctrl IDC_RSCDISPLAYATTRIBUTES_CONTENT; - _ctrlButtonOK = _display displayctrl IDC_OK; - _ctrlButtonCancel = _display displayctrl IDC_CANCEL; - _ctrlButtonCustom = _display displayctrl IDC_RSCDISPLAYATTRIBUTES_BUTTONCUSTOM; - - _ctrlBackgroundPos = ctrlposition _ctrlBackground; - _ctrlTitlePos = ctrlposition _ctrlTitle; - _ctrlContentPos = ctrlposition _ctrlContent; - _ctrlButtonOKPos = ctrlposition _ctrlButtonOK; - _ctrlButtonCancelPos = ctrlposition _ctrlButtonCancel; - _ctrlButtonCustomPos = ctrlposition _ctrlButtonCustom; + _displayConfig = configFile >> _class; + + _ctrlBackground = _display displayCtrl IDC_RSCDISPLAYATTRIBUTES_BACKGROUND; + _ctrlTitle = _display displayCtrl IDC_RSCDISPLAYATTRIBUTES_TITLE; + _ctrlContent = _display displayCtrl IDC_RSCDISPLAYATTRIBUTES_CONTENT; + _ctrlButtonOK = _display displayCtrl IDC_OK; + _ctrlButtonCancel = _display displayCtrl IDC_CANCEL; + _ctrlButtonCustom = _display displayCtrl IDC_RSCDISPLAYATTRIBUTES_BUTTONCUSTOM; + + _ctrlBackgroundPos = ctrlPosition _ctrlBackground; + _ctrlTitlePos = ctrlPosition _ctrlTitle; + _ctrlContentPos = ctrlPosition _ctrlContent; + _ctrlButtonOKPos = ctrlPosition _ctrlButtonOK; + _ctrlButtonCancelPos = ctrlPosition _ctrlButtonCancel; + _ctrlButtonCustomPos = ctrlPosition _ctrlButtonCustom; _ctrlTitleOffsetY = (_ctrlBackgroundPos select 1) - (_ctrlTitlePos select 1) - (_ctrlTitlePos select 3); _ctrlContentOffsetY = (_ctrlContentPos select 1) - (_ctrlBackgroundPos select 1); //--- Show fake map in the background - _ctrlMap = _display displayctrl IDC_RSCDISPLAYCURATOR_MAINMAP; - _ctrlMap ctrlenable false; - if (visiblemap) then { - _ctrlCuratorMap = (finddisplay IDD_RSCDISPLAYCURATOR) displayctrl IDC_RSCDISPLAYCURATOR_MAINMAP; - _ctrlMap ctrlmapanimadd [0,ctrlmapscale _ctrlCuratorMap,_ctrlCuratorMap ctrlmapscreentoworld [0.5,0.5]]; - ctrlmapanimcommit _ctrlMap; + _ctrlMap = _display displayCtrl IDC_RSCDISPLAYCURATOR_MAINMAP; + _ctrlMap ctrlEnable false; + if (visibleMap) then { + _ctrlCuratorMap = (findDisplay IDD_RSCDISPLAYCURATOR) displayCtrl IDC_RSCDISPLAYCURATOR_MAINMAP; + _ctrlMap ctrlMapAnimAdd [0,ctrlMapScale _ctrlCuratorMap,_ctrlCuratorMap ctrlMapScreenToWorld [0.5,0.5]]; + ctrlMapAnimCommit _ctrlMap; } else { - _ctrlMap ctrlshow false; + _ctrlMap ctrlShow false; }; //--- Load default attributes - _attributes = if (getnumber (_displayConfig >> "filterAttributes") > 0) then {missionnamespace getvariable ["BIS_fnc_initCuratorAttributes_attributes",[]]} else {["%ALL"]}; + _attributes = if (getNumber (_displayConfig >> "filterAttributes") > 0) then {missionNamespace getVariable ["BIS_fnc_initCuratorAttributes_attributes",[]]} else {["%ALL"]}; _allAttributes = "%ALL" in _attributes; //--- Initialize attributes _posY = _ctrlContentOffsetY; _contentControls = _displayConfig >> "Controls" >> "Content" >> "Controls"; - _enableDebugConsole = ["DebugConsole",getnumber (missionconfigfile >> "enableDebugConsole")] call bis_fnc_getParamValue; - _enableAdmin = (_enableDebugConsole == 1 && (isserver || serverCommandAvailable "#shutdown")) || _enableDebugConsole == 2; + _enableDebugConsole = ["DebugConsole",getNumber (missionConfigFile >> "enableDebugConsole")] call bis_fnc_getParamValue; + _enableAdmin = (_enableDebugConsole == 1 && (isServer || serverCommandAvailable "#shutdown")) || _enableDebugConsole == 2; for "_i" from 0 to (count _contentControls - 1) do { _cfgControl = _contentControls select _i; - if (isclass _cfgControl) then { - _idc = getnumber (_cfgControl >> "idc"); - _control = _display displayctrl _idc; + if (isClass _cfgControl) then { + _idc = getNumber (_cfgControl >> "idc"); + _control = _display displayCtrl _idc; //--- Admin specific attribute - _show = [true, _enableAdmin] select (getnumber (_cfgControl >> "adminOnly") > 0); + _show = [true, _enableAdmin] select (getNumber (_cfgControl >> "adminOnly") > 0); - if ((_allAttributes || {_x == configname _cfgControl} count _attributes > 0) && _show) then { - _controlPos = ctrlposition _control; + if ((_allAttributes || {_x == configName _cfgControl} count _attributes > 0) && _show) then { + _controlPos = ctrlPosition _control; _controlPos set [0,0]; _controlPos set [1,_posY]; - _control ctrlsetposition _controlPos; - _control ctrlcommit 0; + _control ctrlSetPosition _controlPos; + _control ctrlCommit 0; _posY = _posY + (_controlPos select 3) + 0.005; - ctrlsetfocus _control; + ctrlSetFocus _control; } else { - _control ctrlsetposition [0,0,0,0]; - _control ctrlcommit 0; - _control ctrlshow false; + _control ctrlSetPosition [0,0,0,0]; + _control ctrlCommit 0; + _control ctrlShow false; }; }; }; _posH = ((_posY + _ctrlContentOffsetY) min 0.9) * 0.5; - _target = missionnamespace getvariable ["BIS_fnc_initCuratorAttributes_target",objnull]; - _name = switch (typename _target) do { - case ("OBJECT"): {gettext (configfile >> "cfgvehicles" >> typeof _target >> "displayname")}; - case ("GROUP"): {groupid _target}; - case ("ARRAY"): {format ["%1: %3 #%2",groupid (_target select 0),_target select 1,localize "str_a3_cfgmarkers_waypoint_0"]}; - case ("STRING"): {markertext _target}; + _target = missionNamespace getVariable ["BIS_fnc_initCuratorAttributes_target",objNull]; + _name = switch (typeName _target) do { + case ("OBJECT"): {getText (configFile >> "cfgvehicles" >> typeOf _target >> "displayname")}; + case ("GROUP"): {groupId _target}; + case ("ARRAY"): {format ["%1: %3 #%2",groupId (_target select 0),_target select 1,localize "str_a3_cfgmarkers_waypoint_0"]}; + case ("STRING"): {markerText _target}; }; - _ctrlTitle ctrlsettext format [ctrltext _ctrlTitle,toupper _name]; + _ctrlTitle ctrlSetText format [ctrlText _ctrlTitle,toUpper _name]; _ctrlTitlePos set [1,(0.5 - _posH) - (_ctrlTitlePos select 3) - _ctrlTitleOffsetY]; - _ctrlTitle ctrlsetposition _ctrlTitlePos; - _ctrlTitle ctrlcommit 0; + _ctrlTitle ctrlSetPosition _ctrlTitlePos; + _ctrlTitle ctrlCommit 0; _ctrlContentPos set [1,0.5 - _posH]; _ctrlContentPos set [3,_posH * 2]; - _ctrlContent ctrlsetposition _ctrlContentPos; - _ctrlContent ctrlcommit 0; + _ctrlContent ctrlSetPosition _ctrlContentPos; + _ctrlContent ctrlCommit 0; _ctrlBackgroundPos set [1,0.5 - _posH]; _ctrlBackgroundPos set [3,_posH * 2]; - _ctrlBackground ctrlsetposition _ctrlBackgroundPos; - _ctrlBackground ctrlcommit 0; + _ctrlBackground ctrlSetPosition _ctrlBackgroundPos; + _ctrlBackground ctrlCommit 0; _ctrlButtonOKPos set [1,0.5 + _posH + _ctrlTitleOffsetY]; - _ctrlButtonOK ctrlsetposition _ctrlButtonOKPos; - _ctrlButtonOK ctrlcommit 0; - ctrlsetfocus _ctrlButtonOK; + _ctrlButtonOK ctrlSetPosition _ctrlButtonOKPos; + _ctrlButtonOK ctrlCommit 0; + ctrlSetFocus _ctrlButtonOK; _ctrlButtonCancelPos set [1,0.5 + _posH + _ctrlTitleOffsetY]; - _ctrlButtonCancel ctrlsetposition _ctrlButtonCancelPos; - _ctrlButtonCancel ctrlcommit 0; + _ctrlButtonCancel ctrlSetPosition _ctrlButtonCancelPos; + _ctrlButtonCancel ctrlCommit 0; _ctrlButtonCustomPos set [1,0.5 + _posH + _ctrlTitleOffsetY]; - _ctrlButtonCustom ctrlsetposition _ctrlButtonCustomPos; - _ctrlButtonCustom ctrlcommit 0; + _ctrlButtonCustom ctrlSetPosition _ctrlButtonCustomPos; + _ctrlButtonCustom ctrlCommit 0; //--- Close the display when entity is altered [_display] spawn { - disableserialization; + disableSerialization; _display = _this select 0; - _target = missionnamespace getvariable ["BIS_fnc_initCuratorAttributes_target",objnull]; - switch (typename _target) do { + _target = missionNamespace getVariable ["BIS_fnc_initCuratorAttributes_target",objNull]; + switch (typeName _target) do { case ("OBJECT"): { _isAlive = alive _target; - waituntil {isnull _display || (_isAlive && !alive _target)}; + waitUntil {isNull _display || (_isAlive && !alive _target)}; }; case ("GROUP"): { - waituntil {isnull _display || isnull _target}; + waitUntil {isNull _display || isNull _target}; }; case ("ARRAY"): { _grp = _target select 0; _wpCount = count waypoints _grp; - waituntil {isnull _display || (count waypoints _grp != _wpCount)}; + waitUntil {isNull _display || (count waypoints _grp != _wpCount)}; }; case ("STRING"): { - waituntil {isnull _display || markertype _target == ""}; + waitUntil {isNull _display || markerType _target == ""}; }; }; - _display closedisplay 2; + _display closeDisplay 2; }; }; case "onUnload": { diff --git a/optionals/nomedical/config.cpp b/optionals/nomedical/config.cpp index 8a34203ea2e..274f8640f2b 100644 --- a/optionals/nomedical/config.cpp +++ b/optionals/nomedical/config.cpp @@ -6,7 +6,7 @@ class CfgPatches { units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {}; + requiredAddons[] = {"ace_main"}; author = ECSTRING(common,ACETeam); authors[] = {"Dystopian"}; url = ECSTRING(main,URL); diff --git a/optionals/norealisticnames/config.cpp b/optionals/norealisticnames/config.cpp index c682a9e7141..b25da5466c7 100644 --- a/optionals/norealisticnames/config.cpp +++ b/optionals/norealisticnames/config.cpp @@ -6,7 +6,7 @@ class CfgPatches { units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {}; + requiredAddons[] = {"ace_main"}; author = ECSTRING(common,ACETeam); authors[] = {"Dystopian"}; url = ECSTRING(main,URL); diff --git a/optionals/nouniformrestrictions/functions/fnc_exportConfig.sqf b/optionals/nouniformrestrictions/functions/fnc_exportConfig.sqf index f3b6f632ca3..130acd2bbef 100644 --- a/optionals/nouniformrestrictions/functions/fnc_exportConfig.sqf +++ b/optionals/nouniformrestrictions/functions/fnc_exportConfig.sqf @@ -23,28 +23,26 @@ private _baseClasses = []; if !(_baseClass in (_modifyClasses apply {_x select 0})) then { _baseClasses pushBackUnique _baseClass; }; - false -} count ( - ("!isNull (_x >> 'modelSides') &&" + - "{(_x >> 'modelSides') in (configProperties [_x, 'true', false])} &&" + - "{getArray (_x >> 'modelSides') isNotEqualTo [6]} &&" + - "{getArray (_x >> 'modelSides') isNotEqualTo [0,1,2,3]}") - configClasses (configFile >> "CfgVehicles") -); +} forEach ((toString { + !isNull (_x >> 'modelSides') && + {(_x >> 'modelSides') in (configProperties [_x, 'true', false])} && + {getArray (_x >> 'modelSides') isNotEqualTo [6]} && + {getArray (_x >> 'modelSides') isNotEqualTo [0,1,2,3]} +}) configClasses (configFile >> "CfgVehicles")); -private _nl = toString [13, 10]; -private _output = "class CfgVehicles {" + _nl; +private _nl = endl; +private _output = ["class CfgVehicles {", _nl]; { - ADD(_output,format [ARR_3(" class %1;%2",configName _x,_nl)]); - false -} count _baseClasses; -ADD(_output,_nl); + _output pushBack format [" class %1;%2", configName _x, _nl]; +} forEach _baseClasses; +_output pushBack _nl; { _x params ["_class", "_parent"]; - ADD(_output,format [ARR_4(" class %1: %2 {%3 modelSides[] = {6};%3 };%3",configName _class,configName _parent,_nl)]); - false -} count _modifyClasses; -ADD(_output,"};"); + _output pushBack format [" class %1: %2 {%3 modelSides[] = {6};%3 };%3", configName _class, configName _parent, _nl]; +} forEach _modifyClasses; +_output pushBack "};"; + +_output = _output joinString ""; copyToClipboard _output; -_output; +_output // return diff --git a/optionals/tracers/stringtable.xml b/optionals/tracers/stringtable.xml index f4b1d5a750b..fa26278744c 100644 --- a/optionals/tracers/stringtable.xml +++ b/optionals/tracers/stringtable.xml @@ -9,9 +9,9 @@ <Italian>5.56 mm 150 colpi ricarica traccianti (verdi) caricatore</Italian> <Czech>5.56 mm 150 ranný zásobník, stopovka pro přebití (Zelená)</Czech> <Portuguese>Recarregar magazine de 150 balas tracejantes (Verde)</Portuguese> - <Japanese>5.56 mm 150発入り 残通知 曳光弾 (緑) マガジン</Japanese> + <Japanese>5.56mm 150Rnd 装填トレーサー (緑) マガジン</Japanese> <Spanish>Cargador de 150 Cartuchos 5.56 mm Trazadora de recarga (Verde)</Spanish> - <Korean>5.56mm 150발들이 재장전 알림 예광탄 (초록) 탄창 </Korean> + <Korean>5.56mm 150발 들이 탄창 (재장전 알림 예광탄/녹색)</Korean> <Chinesesimp>5.56 mm 150发 弹鼓(曳光,装填指示,绿)</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_150Rnd_556x45_Drum_yellow"> @@ -21,9 +21,9 @@ <Italian>5.56 mm 150 colpi Ricarica traccianti (gialli) caricatore</Italian> <Czech>5.56 mm 150 ranný zásobník, stopovka pro přebití (Žlutá)</Czech> <Portuguese>Recarregar magazine 150 balas tracejantes (Amarelo)</Portuguese> - <Japanese>5.56 mm 150発入り 残通知 曳光弾 (黄) マガジン</Japanese> + <Japanese>5.56mm 150Rnd 装填トレーサー (黄) マガジン</Japanese> <Spanish>Cargador de 150 Cartuchos 5.56 mm Trazadora de recarga (Amarilla)</Spanish> - <Korean>5.56mm 150발들이 재장전 알림 예광탄 (노랑) 탄창 </Korean> + <Korean>5.56mm 150발 들이 탄창 (재장전 알림 예광탄/황색)</Korean> <Chinesesimp>5.56 mm 150发 弹鼓(曳光,装填指示,黄)</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_150Rnd_556x45_Drum_tracer_green"> @@ -33,9 +33,9 @@ <Italian>5.56 mm 150 colpi traccianti (verdi) caricatore</Italian> <Czech>5.56 mm 150 ranný zásobník, stopovka (Zelená)</Czech> <Portuguese>Magazine 5.56mm Tracejante (Verde)</Portuguese> - <Japanese>5.56 mm 150発入り 曳光弾 (緑) マガジン</Japanese> + <Japanese>5.56mm 150Rnd トレーサー (緑) マガジン</Japanese> <Spanish>Cargador de 150 Cartuchos 5.56 mm Trazadora (Verde)</Spanish> - <Korean>5.56mm 150발들이 예광탄 (초록) 탄창 </Korean> + <Korean>5.56mm 150발 들이 탄창 (예광탄/녹색)</Korean> <Chinesesimp>5.56 mm 150发 弹鼓(曳光,绿)</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_150Rnd_556x45_Drum_tracer_green_description"> @@ -45,9 +45,9 @@ <Italian>calibro: 5.56x46 mm traccianti - verdi<br/> Colpi: 150<br/> Usati in: SPAR-16S </Italian> <Czech>Kalibr: 5.56×45 mm Stopovka - Zelená<br />Nábojů: 150<br />Použito v: SPAR-16S</Czech> <Portuguese>Calibre 5.56x45mm Tracejante - Verde<br/>Balas:150<br/>Usado em: Spar-16S</Portuguese> - <Japanese>口径: 5.56x45 mm 曳光弾 - 緑<br />弾数: 150<br />使用武器: SPAR-16S</Japanese> + <Japanese>口径: 5.56x45 mm トレーサー - 緑<br />弾数: 150<br />使用武器: SPAR-16/S</Japanese> <Spanish>Calibre: 5.56x45 mm Trazadora - Verde<br />Cartuchos: 150<br />Usada en:: SPAR-16S</Spanish> - <Korean>구경: 5.56x45mm 예광탄 - 초록<br />장탄수: 150발<br />사용처: SPAR-16S</Korean> + <Korean>구경: 5.56x45mm 예광탄 - 녹색<br />장탄수: 150발<br />사용처: SPAR-16S</Korean> <Chinesesimp>口径:5.56x45 mm 曳光—绿色<br/>发数:150<br/>使用于:SPAR-16S</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_150Rnd_556x45_Drum_tracer_yellow"> @@ -57,9 +57,9 @@ <Italian>5.56 mm 150Colpi Traccianti (gialli) caricatore</Italian> <Czech>5.56 mm 150 ranný zásobník, stopovka (Žlutá)</Czech> <Portuguese>Magazine 5.56mm 150 balas tracejante (amarelo)</Portuguese> - <Japanese>5.56 mm 150発入り 曳光弾 (黄) マガジン</Japanese> + <Japanese>5.56mm 150Rnd トレーサー (黄) マガジン</Japanese> <Spanish>Cargador de 150 Cartuchos 5.56 mm Trazadora (Amarilla)</Spanish> - <Korean>5.56mm 150발들이 예광탄 (노랑) 탄창 </Korean> + <Korean>5.56mm 150발 들이 탄창 (예광탄/황색)</Korean> <Chinesesimp>5.56 mm 150发 弹鼓(曳光,黄)</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_150Rnd_556x45_Drum_tracer_yellow_description"> @@ -69,9 +69,9 @@ <Italian>calibro:5.56x45 traccianti - gialli <br/>Colpi:150<br/>Usati in: SPAR-16S</Italian> <Czech>Kalibr: 5.56×45 mm Stopovka - Žlutá<br />Nábojů: 150<br />Použito v: SPAR-16S</Czech> <Portuguese>Calibre: 5.56x45mm Tracejante - Amarelo <br/>Balas:150<br/>Usado em:Spar-16S</Portuguese> - <Japanese>口径: 5.56x45 mm 曳光弾 - 黄<br />弾数: 150<br />使用武器: SPAR-16S</Japanese> + <Japanese>口径: 5.56x45 mm トレーサー - 黄<br />弾数: 150<br />使用武器: SPAR-16/S</Japanese> <Spanish>Calibre: 5.56x45 mm Trazadora - Amarilla<br />Cartuchos: 150<br />Usada en: SPAR-16S</Spanish> - <Korean>구경: 5.56x45mm 예광탄 - 노랑<br />장탄수: 150발<br />사용처: SPAR-16S</Korean> + <Korean>구경: 5.56x45mm 예광탄 - 황색<br />장탄수: 150발<br />사용처: SPAR-16S</Korean> <Chinesesimp>口径:5.56x45 mm 曳光—黄色<br/>发数:150<br/>使用于:SPAR-16S</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_200Rnd_556x45_Box_green"> @@ -81,9 +81,9 @@ <Italian>5.56 mm 200colpi Ricarica traccianti (verdi) scatola</Italian> <Czech>5.56 mm 200 ranný box, stopovka pro přebití (Zelená)</Czech> <Portuguese>Recarregar Caixa 5.56mm 200 Balas tracejantes (Verdes)</Portuguese> - <Japanese>5.56 mm 200発入り 残通知 曳光弾 (緑) ボックス</Japanese> + <Japanese>5.56mm 200Rnd 装填トレーサー (緑) ボックス</Japanese> <Spanish>Caja de 200 Cartuchos 5.56 mm Trazadora de recarga (Verde)</Spanish> - <Korean>5.56mm 150발들이 예광탄 (노랑) 탄창 </Korean> + <Korean>5.56mm 150발 들이 탄창 (예광탄/녹색)</Korean> <Chinesesimp>5.56 mm 200发 弹链盒(曳光,装填指示,绿)</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_200Rnd_556x45_Box_tracer_green"> @@ -93,9 +93,9 @@ <Italian>5.56 mm 200colpi Traccianti (verdi) Scatola</Italian> <Czech>5.56 mm 200 ranný box, stopovka (Zelená)</Czech> <Portuguese>Caixa 5.56mm 200 balas tracejantes (Verdes) </Portuguese> - <Japanese>5.56 mm 200発入り 曳光弾 (緑) ボックス</Japanese> + <Japanese>5.56mm 200Rnd トレーサー (緑) ボックス</Japanese> <Spanish>Caja de 200 Cartuchos 5.56 mm Trazadora (Verde)</Spanish> - <Korean>5.56mm 200발들이 예광탄 (초록) 탄상자</Korean> + <Korean>5.56mm 200발 들이 탄상자 (예광탄/녹색)</Korean> <Chinesesimp>5.56 mm 200发 弹链盒(曳光,绿)</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_200Rnd_556x45_Box_tracer_green_description"> @@ -105,9 +105,9 @@ <Italian>Calibro: 5.56x45 mm Traccianti - Verdi<br />Colpi: 200<br />Usati in: LIM-85</Italian> <Czech>Kalibr: 5.56×45 mm Stopovka - Zelená<br />Nábojů: 200<br />Použito v: LIM-85</Czech> <Portuguese>Calibre:5.56x45 mm Tracejante - Verde <br/>Balas: 200<br/>Usado em:LIM-85</Portuguese> - <Japanese>口径: 5.56x45 mm 曳光弾 - 緑<br />弾数: 200<br />使用武器: LIM-85</Japanese> + <Japanese>口径: 5.56x45 mm トレーサー - 緑<br />弾数: 200<br />使用武器: LIM-85</Japanese> <Spanish>Calibre: 5.56x45 mm Trazadora - Verde<br />Cartuchos: 200<br />Usada en: LIM-85</Spanish> - <Korean>구경: 5.56x45mm 예광탄 - 초록<br />장탄수: 200발<br />사용처: LIM-85</Korean> + <Korean>구경: 5.56x45mm 예광탄 - 녹색<br />장탄수: 200발<br />사용처: LIM-85</Korean> <Chinesesimp>口径:5.56x45 mm 曳光—绿色<br/>发数:200<br/>使用于:LIM-85</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_30Rnd_580x42_Mag_red"> @@ -117,9 +117,9 @@ <Italian>5.8 mm 30Colpi Ricarica Tracciante (Rosso) Caricatore</Italian> <Czech>5.8 mm 30 ranný zásobník, stopovka pro přebití (Červená)</Czech> <Portuguese>Recarregar magazine 5.8mm 30 Balas tracejantes (vermelho)</Portuguese> - <Japanese>5.8 mm 30発入り 残通知 曳光弾 (赤) マガジン</Japanese> + <Japanese>5.8mm 30Rnd 装填トレーサー (赤) マガジン</Japanese> <Spanish>Cargador de 30 Cartuchos 5.8 mm Trazadora de recarga (Roja)</Spanish> - <Korean>5.8mm 30발들이 재장전 알림 예광탄 (빨강) 탄창 </Korean> + <Korean>5.8mm 30발 들이 탄창 (재장전 알림 예광탄/적색)</Korean> <Chinesesimp>5.8 mm 30发 弹匣(曳光,装填指示,红)</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_30Rnd_580x42_Mag_yellow"> @@ -129,9 +129,9 @@ <Italian>5.8 mm 30Colpi ricarica Traccianti (Giallo) Caricatore</Italian> <Czech>5.8 mm 30 ranný zásobník, stopovka pro přebití (Žlutá)</Czech> <Portuguese>Recarregar magazine 5.8mm 30 Balas tracejantes (amarelo)</Portuguese> - <Japanese>5.8 mm 30発入り 残通知 曳光弾 (黄) マガジン</Japanese> + <Japanese>5.8mm 30Rnd 装填トレーサー (黄) マガジン</Japanese> <Spanish>Cargador de 30 Cartuchos 5.8 mm Trazadora de recarga (Amarilla)</Spanish> - <Korean>5.8mm 30발들이 재장전 알림 예광탄 (노랑) 탄창 </Korean> + <Korean>5.8mm 30발 들이 탄창 (재장전 알림 예광탄/황색)</Korean> <Chinesesimp>5.8 mm 30发 弹匣(曳光,装填指示,黄)</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_30Rnd_580x42_Mag_tracer_red"> @@ -141,9 +141,9 @@ <Italian>5.8 mm 30Colpi Traccianti (rossi) Caricatore</Italian> <Czech>5.8 mm 30 ranný zásobník, stopovka (Červená)</Czech> <Portuguese>Magazine 5.8 mm 30 balas tracejantes (vermelho)</Portuguese> - <Japanese>5.8 mm 30発入り 曳光弾 (赤) マガジン</Japanese> + <Japanese>5.8mm 30Rnd トレーサー (赤) マガジン</Japanese> <Spanish>Cargador de 30 Cartuchos 5.8 mm Trazadora (Roja)</Spanish> - <Korean>5.8mm 30발들이 예광탄 (빨강) 탄창 </Korean> + <Korean>5.8mm 30발 들이 탄창 (예광탄/적색)</Korean> <Chinesesimp>5.8 mm 30发 弹匣(曳光,红)</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_30Rnd_580x42_Mag_tracer_red_description"> @@ -153,9 +153,9 @@ <Italian>Calibro: 5.8x42 mm Traccianti - Rossi<br />Colpi: 30<br />Usati in: CAR-95, CAR-95 GL</Italian> <Czech>Kalibr: 5.8×42 mm Stopovka - Červená<br />Nábojů: 30<br />Použito v: CAR-95, CAR-95 GL</Czech> <Portuguese>Calibre: 5.8x42 mm Tracejante - Vermelho<br/>Balas:30<br/>Usado em CAR-95, CAR-95 GL</Portuguese> - <Japanese>口径: 5.8x42 mm 曳光弾 - 赤<br />弾数: 30<br />使用武器: CAR-95, CAR-95 GL</Japanese> + <Japanese>口径: 5.8x42 mm トレーサー - 赤<br />弾数: 30<br />使用武器: CAR-95, CAR-95-1, CAR-95 GL</Japanese> <Spanish>Calibre: 5.8x42 mm Trazadora - Roja<br />Cartuchos: 30<br />Usada en: CAR-95, CAR-95 GL</Spanish> - <Korean>구경: 5.8x42mm 예광탄 - 빨강<br />장탄수: 30발<br />사용처: CAR-95, CAR-95GL</Korean> + <Korean>구경: 5.8x42mm 예광탄 - 적색<br />장탄수: 30발<br />사용처: CAR-95, CAR-95GL</Korean> <Chinesesimp>口径:5.8x42 mm 曳光—红色<br/>发数:30<br/>使用于:CAR-95、CAR-95 GL</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_30Rnd_580x42_Mag_tracer_yellow"> @@ -165,9 +165,9 @@ <Italian>5.8 mm 30Colpi Traccianti (Giallo) Caricatore</Italian> <Czech>5.8 mm 30 ranný zásobník, stopovka (Žlutá)</Czech> <Portuguese>Magazine 5.8 mm 30 balas tracejante (amarelo)</Portuguese> - <Japanese>5.8 mm 30発入り 曳光弾 (黄) マガジン</Japanese> + <Japanese>5.8mm 30Rnd トレーサー (黄) マガジン</Japanese> <Spanish>Cargador de 30 Cartuchos 5.8 mm Trazadora (Amarilla)</Spanish> - <Korean>5.8mm 30발들이 예광탄 (노랑) 탄창 </Korean> + <Korean>5.8mm 30발 들이 탄창 (예광탄/황색)</Korean> <Chinesesimp>5.8 mm 30发 弹匣(曳光,黄)</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_30Rnd_580x42_Mag_tracer_yellow_description"> @@ -177,9 +177,9 @@ <Italian>Caliber: 5.8x42 mm Tracer - Yellow<br />Rounds: 30<br />Used in: CAR-95, CAR-95 GL</Italian> <Czech>Kalibr: 5.8×42 mm Stopovka - Žlutá<br />Nábojů: 30<br />Použito v: CAR-95, CAR-95 GL</Czech> <Portuguese>Calibre: 5.8x42 mm Tracejante - Amarelo <br/>Balas: 30<br/>Usado em: CAR-95, CAR-95 GL</Portuguese> - <Japanese>口径: 5.8x42 mm 曳光弾 - 黄<br />弾数: 30<br />使用武器: CAR-95, CAR-95 GL</Japanese> + <Japanese>口径: 5.8x42 mm トレーサー - 黄<br />弾数: 30<br />使用武器: CAR-95, CAR-95-1, CAR-95 GL</Japanese> <Spanish>Calibre: 5.8x42 mm Trazadora - Amarilla<br />Cartuchos: 30<br />Usada en: CAR-95, CAR-95 GL</Spanish> - <Korean>구경: 5.8x42mm 예광탄 - 노랑<br />장탄수: 30발<br />사용처: CAR-95, CAR-95GL</Korean> + <Korean>구경: 5.8x42mm 예광탄 - 황색<br />장탄수: 30발<br />사용처: CAR-95, CAR-95GL</Korean> <Chinesesimp>口径:5.8x42 mm 曳光—黄色<br/>发数:30<br/>使用于:CAR-95、CAR-95 GL</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_100Rnd_580x42_Drum_red"> @@ -189,9 +189,9 @@ <Italian>5,8 mm 100Colpi Ricarica Tracciante (rosso) Caricatore</Italian> <Czech>5.8 mm 100 ranný zásobník, stopovka pro přebití (Červená)</Czech> <Portuguese>Recarregar magazine 5.8 mm 100 balas tracejante (vermelho)</Portuguese> - <Japanese>5.8 mm 100発入り 残通知 曳光弾 (赤) マガジン</Japanese> + <Japanese>5.8mm 100Rnd 装填トレーサー (赤) マガジン</Japanese> <Spanish>Cargador de 100 Cartuchos 5.8 mm Trazadora de recarga (Roja)</Spanish> - <Korean>5.8mm 100발들이 재장전 알림 예광탄 (빨강) 탄창 </Korean> + <Korean>5.8mm 100발 들이 탄창 (재장전 알림 예광탄/적색)</Korean> <Chinesesimp>5.8 mm 100发 弹鼓(曳光,装填指示,红)</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_100Rnd_580x42_Drum_yellow"> @@ -201,9 +201,9 @@ <Italian>5.8 mm 100Colpi Ricarica Traccianti (gialli) Caricatore</Italian> <Czech>5.8 mm 100 ranný zásobník, stopovka pro přebití (Žlutá)</Czech> <Portuguese>Recarregar magazine 5.8 mm 100 balas tracejantes (amarelo)</Portuguese> - <Japanese>5.8 mm 100発入り 残通知 曳光弾 (黄) マガジン</Japanese> + <Japanese>5.8mm 100Rnd 装填トレーサー (黄) マガジン</Japanese> <Spanish>Cargador de 100 Cartuchos 5.8 mm Trazadora de recarga (Amarilla)</Spanish> - <Korean>5.8mm 100발들이 재장전 알림 예광탄 (노랑) 탄창 </Korean> + <Korean>5.8mm 100발 들이 탄창 (재장전 알림 예광탄/황색)</Korean> <Chinesesimp>5.8 mm 100发 弹鼓(曳光,装填指示,黄)</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_100Rnd_580x42_Drum_tracer_red"> @@ -213,9 +213,9 @@ <Italian>5.8 mm 100Colpi Ricarica Traccianti (rossi) Caricatore</Italian> <Czech>5.8 mm 100 ranný zásobník, stopovka (Červená)</Czech> <Portuguese>Magazine 5.8 mm 100 balas tracejantes (vermelho)</Portuguese> - <Japanese>5.8 mm 100発入り 曳光弾 (赤) マガジン</Japanese> + <Japanese>5.8mm 100Rnd トレーサー (赤) マガジン</Japanese> <Spanish>Cargador de 100 Cartuchos 5.8 mm Trazadora (Roja)</Spanish> - <Korean>5.8mm 100발들이 예광탄 (빨강) 탄창 </Korean> + <Korean>5.8mm 100발 들이 탄창 (예광탄/적색)</Korean> <Chinesesimp>5.8 mm 100发 弹鼓(曳光,红)</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_100Rnd_580x42_Drum_tracer_red_description"> @@ -225,9 +225,9 @@ <Italian>Calibro: 5.8x42 mm Tracciante - Rosso<br />Colpi: 100<br />Usati in: CAR-95-1</Italian> <Czech>Kalibr: 5.8×42 mm Stopovka - Červená<br />Nábojů: 100<br />Použito v: CAR-95-1</Czech> <Portuguese>Calibre: 5.8x42 mm Tracejante - Vermelho<br/>Balas:100<br/>Usado em CAR-95-1</Portuguese> - <Japanese>口径: 5.8x42 mm 曳光弾 - 赤<br />弾数: 100<br />使用武器: CAR-95-1</Japanese> + <Japanese>口径: 5.8x42 mm トレーサー - 赤<br />弾数: 100<br />使用武器: CAR-95-1</Japanese> <Spanish>Calibre: 5.8x42 mm Trazadora - Roja<br />Cartuchos: 100<br />Usada en: CAR-95-1</Spanish> - <Korean>구경: 5.8x42mm 예광탄 - 빨강<br />장탄수: 100발<br />사용처: CAR-95-1</Korean> + <Korean>구경: 5.8x42mm 예광탄 - 적색<br />장탄수: 100발<br />사용처: CAR-95-1</Korean> <Chinesesimp>口径:5.8x42 mm 曳光—红色<br/>发数:100<br/>使用于:CAR-95-1</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_100Rnd_580x42_Drum_tracer_yellow"> @@ -237,9 +237,9 @@ <Italian>5.8mm 100Colpi Traccianti (gialli) Caricatore</Italian> <Czech>5.8 mm 100 ranný zásobník, stopovka (Žlutá)</Czech> <Portuguese>Magazine 5.8 mm 100 balas tracejantes (amarelo)</Portuguese> - <Japanese>5.8 mm 100発入り 曳光弾 (黄) マガジン</Japanese> + <Japanese>5.8mm 100Rnd トレーサー (黄) マガジン</Japanese> <Spanish>Cargador de 100 Cartuchos 5.8 mm Trazadora (Amarilla)</Spanish> - <Korean>5.8mm 100발들이 예광탄 (노랑) 탄창 </Korean> + <Korean>5.8mm 100발 들이 탄창 (예광탄/황색)</Korean> <Chinesesimp>5.8 mm 100发 弹鼓(曳光,黄)</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_100Rnd_580x42_Drum_tracer_yellow_description"> @@ -249,9 +249,9 @@ <Italian>Calibro: 5.8x42 mm Traccianti - Gialli<br />Colpi: 100<br />Usati in: CAR-95-1</Italian> <Czech>Kalibr: 5.8×42 mm Stopovka - Žlutá<br />Nábojů: 100<br />Použito v: CAR-95-1</Czech> <Portuguese>Calibre: 5.8x42 mm Tracejante - Amarelo<br/>Balas:100<br/>Usado em CAR-95-1</Portuguese> - <Japanese>口径: 5.8x42 mm 曳光弾 - 黄<br />弾数: 100<br />使用武器: CAR-95-1</Japanese> + <Japanese>口径: 5.8x42 mm トレーサー - 黄<br />弾数: 100<br />使用武器: CAR-95-1</Japanese> <Spanish>Calibre: 5.8x42 mm Trazadora - Amarilla<br />Cartuchos: 100<br />Usada en: CAR-95-1</Spanish> - <Korean>구경: 5.8x42mm 예광탄 - 노랑<br />장탄수: 100발<br />사용처: CAR-95-1</Korean> + <Korean>구경: 5.8x42mm 예광탄 - 황색<br />장탄수: 100발<br />사용처: CAR-95-1</Korean> <Chinesesimp>口径:5.8x42 mm 曳光—黄色<br/>发数:100<br/>使用于:CAR-95-1</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_30Rnd_65x39_mx_green"> @@ -261,9 +261,9 @@ <Italian>6.5mm 30Colpi Ricarica Traccianti(verdi) Caricatore</Italian> <Czech>6.5 mm 30 ranný zásobník, stopovka pro přebití (Zelená)</Czech> <Portuguese>Recarregar magazine 6.5mm 30 balas tracejantes (Verde)</Portuguese> - <Japanese>6.5 mm 30発入り 残通知 曳光弾 (緑) マガジン</Japanese> + <Japanese>6.5mm 30Rnd 装填トレーサー (緑) マガジン</Japanese> <Spanish>Cargador de 30 Cartuchos 6.5 mm Trazadora de recarga (Verde)</Spanish> - <Korean>6.5mm 30발들이 재장전 알림 예광탄 (초록) 탄창 </Korean> + <Korean>6.5mm 30발 들이 탄창 (재장전 알림 예광탄/녹색)</Korean> <Chinesesimp>6.5 mm 30发 弹匣(曳光,装填指示,绿)</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_30Rnd_65x39_mx_green_description"> @@ -273,9 +273,9 @@ <Italian>Calibro: 6.5x39 mm Traccianti - Verdi<br />Colpi: 30<br />Usati in: MX/C/M/SW/3GL</Italian> <Czech>Kalibr: 6.5×39 mm Stopovka - Zelená<br />Nábojů: 30<br />Použito v: MX/C/M/SW/3GL</Czech> <Portuguese>Calibre: 6.5x39 mm Tracejante - Verde<br/>Balas:30<br/>Usado em: MX/C/M/SW/3GL</Portuguese> - <Japanese>口径: 6.5x39 mm 曳光弾 - 緑<br />弾数: 30<br />使用武器: MX/C/M/SW/3GL</Japanese> + <Japanese>口径: 6.5x39 mm トレーサー - 緑<br />弾数: 30<br />使用武器: MX/C/M/SW/3GL</Japanese> <Spanish>Calibre: 6.5x39 mm Tracer - Green<br />Rounds: 30<br />Used in: MX/C/M/SW/3GL</Spanish> - <Korean>구경: 6.5x39mm 예광탄 - 초록<br />장탄수: 30발<br />사용처: MX/C/M/SW/3GL </Korean> + <Korean>구경: 6.5x39mm 예광탄 - 녹색<br />장탄수: 30발<br />사용처: MX/C/M/SW/3GL </Korean> <Chinesesimp>口径:6.5x39 mm 曳光—绿色<br/>发数:30<br/>使用于:MX/C/M/SW/3GL</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_30Rnd_65x39_mx_yellow"> @@ -285,9 +285,9 @@ <Italian>6.5mm 30Colpi Ricarica Traccianti (Gialli) Caricatore</Italian> <Czech>6.5 mm 30 ranný zásobník, stopovka pro přebití (Žlutá)</Czech> <Portuguese>Recarregar magazine 6.5mm 30 balas tracejantes (amarelo)</Portuguese> - <Japanese>6.5 mm 30発入り 残通知 曳光弾 (黄) マガジン</Japanese> + <Japanese>6.5mm 30Rnd 装填トレーサー (黄) マガジン</Japanese> <Spanish>Cargador de 30 Cartuchos 6.5 mm Trazadora de recarga (Amarilla)</Spanish> - <Korean>6.5mm 30발들이 재장전 알림 예광탄 (노랑) 탄창 </Korean> + <Korean>6.5mm 30발 들이 탄창 (재장전 알림 예광탄/황색)</Korean> <Chinesesimp>6.5 mm 30发 弹匣(曳光,装填指示,黄)</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_30Rnd_65x39_mx_yellow_description"> @@ -297,9 +297,9 @@ <Italian>Calibro: 6.5x39 mm Tracciante - Giallo<br />Colpi: 30<br />Usati in: MX/C/M/SW/3GL</Italian> <Czech>Kalibr: 6.5×39 mm Stopovka - Žlutá<br />Nábojů: 30<br />Použito v: MX/C/M/SW/3GL</Czech> <Portuguese>Calibre: 6.5x39 mm Tracejante - Amarelo<br/>Balas:30<br/>Usado em: MX/C/M/SW/3GL</Portuguese> - <Japanese>口径: 6.5x39 mm 曳光弾 - 黄<br />弾数: 30<br />使用武器: MX/C/M/SW/3GL</Japanese> + <Japanese>口径: 6.5x39 mm トレーサー - 黄<br />弾数: 30<br />使用武器: MX/C/M/SW/3GL</Japanese> <Spanish>Calibre: 6.5x39 mm Trazadora - Amarilla<br />Cartuchos: 30<br />Usada en: MX/C/M/SW/3GL</Spanish> - <Korean>구경: 6.5x39mm 예광탄 - 노랑<br />장탄수: 30발<br />사용처: MX/C/M/SW/3GL </Korean> + <Korean>구경: 6.5x39mm 예광탄 - 황색<br />장탄수: 30발<br />사용처: MX/C/M/SW/3GL </Korean> <Chinesesimp>口径:6.5x39 mm 曳光—黄色<br/>发数:30<br/>使用于:MX/C/M/SW/3GL</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_30Rnd_65x39_mx_tracer_green"> @@ -309,9 +309,9 @@ <Italian>6.5mm 30Colpi Traccianti (Verdi) Caricatore</Italian> <Czech>6.5 mm 30 ranný zásobník, stopovka (Zelená)</Czech> <Portuguese>Magazine 6.5mm 30 balas tracejantes (Verde)</Portuguese> - <Japanese>6.5 mm 30発入り 曳光弾 (緑) マガジン</Japanese> + <Japanese>6.5mm 30Rnd トレーサー (緑) マガジン</Japanese> <Spanish>Cargador de 30 Cartuchos 6.5 mm Trazadora (Verde)</Spanish> - <Korean>6.5mm 30발들이 예광탄 (초록) 탄창 </Korean> + <Korean>6.5mm 30발 들이 탄창 (예광탄/녹색)</Korean> <Chinesesimp>6.5 mm 30发 弹匣(曳光,绿)</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_30Rnd_65x39_mx_tracer_green_description"> @@ -321,9 +321,9 @@ <Italian>Calibro: 6.5x39 mm traccianti - Verdi<br />Colpi: 30<br />Usati in: MX/C/M/SW/3GL</Italian> <Czech>Kalibr: 6.5×39 mm Stopovka - Zelená<br />Nábojů: 30<br />Použito v: MX/C/M/SW/3GL</Czech> <Portuguese>Calibre: 6.5x39 mm Tracejante - Verde<br/>Balas:30<br/>Usado em: MX/C/M/SW/3GL</Portuguese> - <Japanese>口径: 6.5x39 mm 曳光弾 - 緑<br />弾数: 30<br />使用武器: MX/C/M/SW/3GL</Japanese> + <Japanese>口径: 6.5x39 mm トレーサー - 緑<br />弾数: 30<br />使用武器: MX/C/M/SW/3GL</Japanese> <Spanish>Calibre: 6.5x39 mm Trazadora - Verde<br />Cartuchos: 30<br />Usada en: MX/C/M/SW/3GL</Spanish> - <Korean>구경: 6.5x39mm 예광탄 - 초록<br />장탄수: 30발<br />사용처: MX/C/M/SW/3GL </Korean> + <Korean>구경: 6.5x39mm 예광탄 - 녹색<br />장탄수: 30발<br />사용처: MX/C/M/SW/3GL </Korean> <Chinesesimp>口径:6.5x39 mm 曳光—绿色<br/>发数:30<br/>使用于:MX/C/M/SW/3GL</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_30Rnd_65x39_mx_tracer_yellow"> @@ -333,9 +333,9 @@ <Italian>6.5mm 30 Colpi Traccianti (Gialli) Caricatore</Italian> <Czech>6.5 mm 30 ranný zásobník, stopovka (Žlutá)</Czech> <Portuguese>Magazine 6.5mm 30 balas tracejantes (amarelo)</Portuguese> - <Japanese>6.5 mm 30発入り 曳光弾 (黄) マガジン</Japanese> + <Japanese>6.5mm 30Rnd トレーサー (黄) マガジン</Japanese> <Spanish>Cargador de 30 Cartuchos 6.5 mm Trazadora (Amarilla)</Spanish> - <Korean>6.5mm 30발들이 예광탄 (노랑) 탄창 </Korean> + <Korean>6.5mm 30발 들이 탄창 (예광탄/황색)</Korean> <Chinesesimp>6.5 mm 30发 弹匣(曳光,黄)</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_30Rnd_65x39_mx_tracer_yellow_description"> @@ -345,9 +345,9 @@ <Italian>Caliber: 6.5x39 mm Tracciante - Giallo<br />Colpi: 30<br />Usati in: MX/C/M/SW/3GL</Italian> <Czech>Kalibr: 6.5×39 mm Stopovka - Žlutá<br />Nábojů: 30<br />Použito v: MX/C/M/SW/3GL</Czech> <Portuguese>Calibre: 6.5x39 mm Tracejante - Amarelo<br/>Balas:30<br/>Usado em: MX/C/M/SW/3GL</Portuguese> - <Japanese>口径: 6.5x39 mm 曳光弾 - 黄<br />弾数: 30<br />使用武器: MX/C/M/SW/3GL</Japanese> + <Japanese>口径: 6.5x39 mm トレーサー - 黄<br />弾数: 30<br />使用武器: MX/C/M/SW/3GL</Japanese> <Spanish>Calibre: 6.5x39 mm Trazadora - Amarilla<br />Cartuchos: 30<br />Usada en: MX/C/M/SW/3GL</Spanish> - <Korean>구경: 6.5x39mm 예광탄 - 노랑<br />장탄수: 30발<br />사용처: MX/C/M/SW/3GL </Korean> + <Korean>구경: 6.5x39mm 예광탄 - 황색<br />장탄수: 30발<br />사용처: MX/C/M/SW/3GL </Korean> <Chinesesimp>口径:6.5x39 mm 曳光—黄色<br/>发数:30<br/>使用于:MX/C/M/SW/3GL</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_100Rnd_65x39_mx_green"> @@ -357,9 +357,9 @@ <Italian>6.5mm 100Colpi Misti Caricatore (verdi)</Italian> <Czech>6.5 mm 100 ranný zásobník, částečná stopovka (Zelená)</Czech> <Portuguese>Magazine 6.5mm 100 balas misturadas (Verde)</Portuguese> - <Japanese>6.5 mm 100発入り 混合 (緑) マガジン</Japanese> + <Japanese>6.5mm 100Rnd 混合 (緑) マガジン</Japanese> <Spanish>Cargador de 100 cartuchos 6.5 mm Mezcla (Verde)</Spanish> - <Korean>6.5mm 100발들이 혼합탄 (초록) 탄창 </Korean> + <Korean>6.5mm 100발 들이 탄창 (보통, 예광혼합탄/녹색) </Korean> <Chinesesimp>6.5 mm 100发 弹匣(曳光,每四发,绿)</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_100Rnd_65x39_mx_yellow"> @@ -369,9 +369,9 @@ <Italian>6.5mm 100Colpi Misti Caricatore (gialli)</Italian> <Czech>6.5 mm 100 ranný zásobník, částečná stopovka (Žlutá)</Czech> <Portuguese>Magazine 6.5mm 100 balas misturadas (amarelo)</Portuguese> - <Japanese>6.5 mm 100発入り 混合 (黄) マガジン</Japanese> + <Japanese>6.5mm 100Rnd 混合 (黄) マガジン</Japanese> <Spanish>Cargador de 100 cartuchos 6.5 mm Mezcla (Amarilla)</Spanish> - <Korean>6.5mm 100발들이 혼합탄 (노랑) 탄창 </Korean> + <Korean>6.5mm 100발 들이 탄창 (보통, 예광혼합탄/황색) </Korean> <Chinesesimp>6.5 mm 100发 弹匣(曳光,每四发,黄)</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_100Rnd_65x39_mx_tracer_green"> @@ -381,9 +381,9 @@ <Italian>6.5mm 100Colpi Caricatore Tracciante (Verde)</Italian> <Czech>6.5 mm 100 ranný zásobník, stopovka (Zelená)</Czech> <Portuguese>Magazine 6.5mm 100 balas tracejantes</Portuguese> - <Japanese>6.5 mm 100発入り (緑) マガジン</Japanese> + <Japanese>6.5mm 100Rndトレーサー (緑) マガジン</Japanese> <Spanish>Cargador de 100 cartuchos 6.5 mm Trazadora (Verde)</Spanish> - <Korean>6.5mm 100발들이 예광탄 (초록) 탄창 </Korean> + <Korean>6.5mm 100발들이 탄창 (예광탄/녹색)</Korean> <Chinesesimp>6.5 mm 100发 弹匣(曳光,绿)</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_100Rnd_65x39_mx_tracer_green_description"> @@ -393,9 +393,9 @@ <Italian>Calibro: 6.5x39 mm Traccianti - Verdi<br />Colpi: 100<br />Usati in: MX SW</Italian> <Czech>Kalibr: 6.5×39 mm Stopovka - Zelená<br />Nábojů: 100<br />Použito v: MX SW</Czech> <Portuguese>Calibre: 6.5x39 mm Tracejante - Verde<br/>Balas: 100<br/>Usado em: MX SW</Portuguese> - <Japanese>口径: 6.5x39 mm 曳光弾 - 緑<br />弾数: 100<br />使用武器: MX SW</Japanese> + <Japanese>口径: 6.5x39 mm トレーサー - 緑<br />弾数: 100<br />使用武器: MX SW</Japanese> <Spanish>Calibre: 6.5x39 mm Trazadora - Verde<br />Cartuchos: 100<br />Usada en: MX SW</Spanish> - <Korean>구경: 6.5x39mm 예광탄 - 초록<br />장탄수: 100발<br />사용처: MX SW</Korean> + <Korean>구경: 6.5x39mm 예광탄 - 녹색<br />장탄수: 100발<br />사용처: MX SW</Korean> <Chinesesimp>口径:6.5x39 mm 曳光—绿色<br/>发数:100<br/>使用于:MX SW</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_100Rnd_65x39_mx_tracer_yellow"> @@ -405,9 +405,9 @@ <Italian>6.5mm 100Colpi Caricatore Traccianti (giallo)</Italian> <Czech>6.5 mm 100 ranný zásobník, stopovka (Žlutá)</Czech> <Portuguese>Magazine 6.5mm 100 balas tracejantes (amarelo)</Portuguese> - <Japanese>6.5 mm 100発入り 曳光弾 (黄) マガジン</Japanese> + <Japanese>6.5mm 100Rndトレーサー (黄) マガジン</Japanese> <Spanish>Cargador de 100 cartuchos 6.5 mm Trazadora (Amarilla)</Spanish> - <Korean>6.5mm 100발들이 예광탄 (노랑) 탄창 </Korean> + <Korean>6.5mm 100발들이 탄창 (예광탄/황색)</Korean> <Chinesesimp>6.5 mm 100发 弹匣(曳光,黄)</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_100Rnd_65x39_mx_tracer_yellow_description"> @@ -417,9 +417,9 @@ <Italian>Calibro: 6.5x39 mm Traccianti - Gialli<br />Colpi: 100<br />Usati in: MX SW</Italian> <Czech>Kalibr: 6.5×39 mm Stopovka - Žlutá<br />Nábojů: 100<br />Použito v: MX SW</Czech> <Portuguese>Calibre: 6.5x39 mm Tracejante - Amarelo<br/>Balas: 100<br/>Usado em: MX SW</Portuguese> - <Japanese>口径: 6.5x39 mm 曳光弾 - 黄<br />弾数: 100<br />使用武器: MX SW</Japanese> + <Japanese>口径: 6.5x39 mm トレーサー - 黄<br />弾数: 100<br />使用武器: MX SW</Japanese> <Spanish>Calibre: 6.5x39 mm Trazadora - Amarilla<br />Cartuchos: 100<br />Usada en: MX SW</Spanish> - <Korean>구경: 6.5x39mm 예광탄 - 노랑<br />장탄수: 100발<br />사용처: MX SW</Korean> + <Korean>구경: 6.5x39mm 예광탄 - 황색<br />장탄수: 100발<br />사용처: MX SW</Korean> <Chinesesimp>口径:6.5x39 mm 曳光—黄色<br/>发数:100<br/>使用于:MX SW</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_30Rnd_65x39_katiba_red"> @@ -429,9 +429,9 @@ <Italian>6.5mm 30Colpi Ricarica Traccianti (Rossi) Caricatore </Italian> <Czech>6.5 mm 30 ranný zásobník, stopovka pro přebití (Červená)</Czech> <Portuguese>Recarregar magazine 6.5mm 30 balas tracejantes (vermelho)</Portuguese> - <Japanese>6.5 mm 30発入り 残通知 曳光弾 (赤) マガジン</Japanese> + <Japanese>6.5mm 30Rnd 装填トレーサー (赤) マガジン</Japanese> <Spanish>Cargador de 30 Cartuchos 6.5 mm Trazadora de recarga (Roja)</Spanish> - <Korean>6.5mm 30발들이 재장전 알림 예광탄 (빨강) 탄창 </Korean> + <Korean>6.5mm 30발 들이 탄창 (재장전 알림 예광탄/적색)</Korean> <Chinesesimp>6.5 mm 30发 弹匣(曳光,装填指示,红)</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_30Rnd_65x39_katiba_yellow"> @@ -441,9 +441,9 @@ <Italian>6.5mm 30Colpi Ricarica Traccianti (gialli) Caricatore</Italian> <Czech>6.5 mm 30 ranný zásobník, stopovka pro přebití (Žlutá)</Czech> <Portuguese>Recarregar magazine 6.5mm 30 balas tracejantes (amarelo)</Portuguese> - <Japanese>6.5 mm 30発入り 残通知 曳光弾 (黄) マガジン</Japanese> + <Japanese>6.5mm 30Rnd 装填トレーサー (黄) マガジン</Japanese> <Spanish>Cargador de 30 Cartuchos 6.5 mm Trazadora de recarga (Amarilla)</Spanish> - <Korean>6.5mm 30발들이 재장전 알림 예광탄 (노랑) 탄창 </Korean> + <Korean>6.5mm 30발 들이 탄창 (재장전 알림 예광탄/황색)</Korean> <Chinesesimp>6.5 mm 30发 弹匣(曳光,装填指示,黄)</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_30Rnd_65x39_katiba_tracer_red"> @@ -453,9 +453,9 @@ <Italian>6.5mm 30Colpi Traccianti (rossi) Caricatori</Italian> <Czech>6.5 mm 30 ranný zásobník, stopovka (Červená)</Czech> <Portuguese>Magazine 6.5mm 30 balas tracejantes (vermelho)</Portuguese> - <Japanese>6.5 mm 30発入り 曳光弾 (赤) マガジン</Japanese> + <Japanese>6.5mm 30Rnd トレーサー (赤) マガジン</Japanese> <Spanish>Cargador de 30 Cartuchos 6.5 mm Trazadora (Roja)</Spanish> - <Korean>6.5mm 30발들이 예광탄 (빨강) 탄창 </Korean> + <Korean>6.5mm 30발 들이 탄창 (예광탄/적색)</Korean> <Chinesesimp>6.5 mm 30发 弹匣(曳光,红)</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_30Rnd_65x39_katiba_tracer_red_description"> @@ -465,9 +465,9 @@ <Italian>Calibro: 6.5x39 mm Traccianti (Rossi) - Senza Bossolo<br />Colpi: 30<br />Usati in: Katiba, Type 115</Italian> <Czech>Kalibr: 6.5×39 mm Stopovka - Červená - Beznábojnicová<br />Nábojů: 30<br />Použito v: Katiba, Type 115</Czech> <Portuguese>Calibre: 6.5x39 mm Tracejante (Vermelho) - Sem Cartucho<br/>Balas: 30<br/>Usado em: Katiba, Type 115</Portuguese> - <Japanese>口径: 6.5x39 mm 曳光弾 - 赤 (ケースレス)<br />弾数: 30<br />使用武器: Katiba, Type 115</Japanese> + <Japanese>口径: 6.5x39 mm トレーサー (赤) - ケースレス弾<br />弾数: 30<br />使用武器: Katiba, Type 115</Japanese> <Spanish>Calibre: 6.5x39 mm Trazadora (Roja) - Sin casquillo<br />Cartuchos: 30<br />Usada en: Katiba, Type 115</Spanish> - <Korean>구경: 6.5x39mm 예광탄 - 빨강<br />장탄수: 30발<br />사용처: Katiba, Type 115</Korean> + <Korean>구경: 6.5x39mm 예광탄 - 적색<br />장탄수: 30발<br />사용처: Katiba, Type 115</Korean> <Chinesesimp>口径:6.5x39 mm 曳光—红色<br/>发数:30<br/>使用于:Katiba,Type 115</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_30Rnd_65x39_katiba_tracer_yellow"> @@ -477,9 +477,9 @@ <Italian>6.5mm 30 Colpi Traccianti (gialli) Caricatore</Italian> <Czech>6.5 mm 30 ranný zásobník, stopovka (Žlutá)</Czech> <Portuguese>Magazine 6.5mm 30 balas tracejantes (amarelo)</Portuguese> - <Japanese>6.5 mm 30発入り 曳光弾 (黄) マガジン</Japanese> + <Japanese>6.5mm 30Rnd トレーサー (黄) マガジン</Japanese> <Spanish>Cargador de 30 Cartuchos 6.5 mm Trazadora (Amarilla)</Spanish> - <Korean>6.5mm 30발들이 예광탄 (노랑) 탄창 </Korean> + <Korean>6.5mm 30발 들이 탄창 (예광탄/황색)</Korean> <Chinesesimp>6.5 mm 30发 弹匣(曳光,黄)</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_30Rnd_65x39_katiba_tracer_yellow_description"> @@ -489,9 +489,9 @@ <Italian>Calibro: 6.5x39 mm Traccianti (Gialli) - Senza Bossolo<br />Colpi: 30<br />Usati in: Katiba, Type 115</Italian> <Czech>Kalibr: 6.5×39 mm Stopovka - Žlutá - Beznábojnicová<br />Nábojů: 30<br />Použito v: Katiba, Type 115</Czech> <Portuguese>Caliber: 6.5x39 mm Tracejante (Vermelho) - Sem Cartucho<br/>Balas: 30<br/>Usado em: Katiba, Type 115</Portuguese> - <Japanese>口径: 6.5x39 mm 曳光弾 - 黄 (ケースレス)<br />弾数: 30<br />使用武器: Katiba, Type 115</Japanese> + <Japanese>口径: 6.5x39 mm トレーサー (黄) - ケースレス弾<br />弾数: 30<br />使用武器: Katiba, Type 115</Japanese> <Spanish>Calibre: 6.5x39 mm Trazadora (Amarilla) - Sin casquillo<br />Cartuchos: 30<br />Usada en: Katiba, Type 115</Spanish> - <Korean>구경: 6.5x39mm 예광탄 - 노랑<br />장탄수: 30발<br />사용처: Katiba, Type 115</Korean> + <Korean>구경: 6.5x39mm 예광탄 - 황색<br />장탄수: 30발<br />사용처: Katiba, Type 115</Korean> <Chinesesimp>口径:6.5x39 mm 曳光—黄色<br/>发数:30<br/>使用于:Katiba,Type 115</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_200Rnd_65x39_cased_Box_green"> @@ -501,9 +501,9 @@ <Italian>6.5mm 200Colpi Caricatore esteso Misti (Verdi)</Italian> <Czech>6.5 mm 200 ranný pás, částečná stopovka (Zelená)</Czech> <Portuguese>Caixa de Cinto 6.5 mm 200 Balas Misturados (Verde) </Portuguese> - <Japanese>6.5 mm 200発入り 混合 (緑) ベルト ケース </Japanese> + <Japanese>6.5mm 200Rnd ベルト・混合 (緑)</Japanese> <Spanish>Caja con cinta de 200 cartuchos 6.5 mm Mezcla (Verde)</Spanish> - <Korean>6.5mm 200발들이 혼합탄 (초록) 탄상자</Korean> + <Korean>6.5mm 200발 들이 탄상자 (보통, 예광혼합탄/녹색)</Korean> <Chinesesimp>6.5 mm 200发 弹链盒(曳光,每四发,绿)</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_200Rnd_65x39_cased_Box_green_description"> @@ -515,7 +515,7 @@ <Portuguese>Calibre: 6.5x39 mm Misturado - Verde<br/>Balas: 200<br/>Usado em: Mk200</Portuguese> <Japanese>口径: 6.5x39 mm 混合 - 緑<br />弾数: 200<br />使用武器: Mk200</Japanese> <Spanish>Calibre: 6.5x39 mm Mezcla - Verde<br />Cartuchos: 200<br />Usada en: Mk200</Spanish> - <Korean>구경: 6.5x39mm 혼합탄 - 초록<br />장탄수: 200발<br />사용처: Mk200</Korean> + <Korean>구경: 6.5x39mm 보통, 예광혼합탄 - 녹색<br />장탄수: 200발<br />사용처: Mk200</Korean> <Chinesesimp>口径:6.5x39 mm 混合曳光—绿色<br/>发数:200<br/>使用于:Mk200</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_200Rnd_65x39_cased_Box_red"> @@ -525,9 +525,9 @@ <Italian>6.5 mm 200Colpi Caritore maggiorato Misti (rossi)</Italian> <Czech>6.5 mm 200 ranný pás, částečná stopovka (Červená)</Czech> <Portuguese>Caixa de Cinto 6.5 mm 200 balas misturadas (Vermelho)</Portuguese> - <Japanese>6.5 mm 200発入り 混合 (赤) ベルト ケース </Japanese> + <Japanese>6.5mm 200Rnd ベルト・混合 (赤)</Japanese> <Spanish>Caja con cinta de 200 cartuchos 6.5 mm Mezcla (Roja)</Spanish> - <Korean>6.5mm 200발들이 혼합탄 (빨강) 탄상자</Korean> + <Korean>6.5mm 200발 들이 탄상자 (보통, 예광혼합탄/적색)</Korean> <Chinesesimp>6.5 mm 200发 弹链盒(曳光,每四发,红)</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_200Rnd_65x39_cased_Box_red_description"> @@ -539,7 +539,7 @@ <Portuguese>Caliber: 6.5x39 mm Misturado - Vermelho<br/>Balas: 200<br/>Usado em: Mk200</Portuguese> <Japanese>口径: 6.5x39 mm 混合 - 赤<br />弾数: 200<br />使用武器: Mk200</Japanese> <Spanish>Calibre: 6.5x39 mm Mezcla - Roja<br />Cartuchos: 200<br />Usada en: Mk200</Spanish> - <Korean>구경: 6.5x39mm 혼합탄 - 빨강<br />장탄수: 200발<br />사용처: Mk200</Korean> + <Korean>구경: 6.5x39mm 보통, 예광혼합탄 - 적색<br />장탄수: 200발<br />사용처: Mk200</Korean> <Chinesesimp>口径:6.5x39 mm 混合曳光—红色<br/>发数:200<br/>使用于:Mk200</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_200Rnd_65x39_cased_Box_tracer_green"> @@ -549,9 +549,9 @@ <Italian>6.5 mm 200Colpi Caricatore maggiorato Traccianti (verdi)</Italian> <Czech>6.5 mm 200 ranný pás, částečná stopovka (Zelená)</Czech> <Portuguese>Caixa de Cinto 6;5 mm 200 balas tracejantes (Verde)</Portuguese> - <Japanese>6.5 mm 200発入り 混合 (緑) ベルト ケース </Japanese> + <Japanese>6.5mm 200Rnd ベルト・トレーサー (緑)</Japanese> <Spanish>Caja con cinta de 200 cartuchos 6.5 mm Trazadora (Verde)</Spanish> - <Korean>6.5mm 200발들이 예광탄 (초록) 탄상자</Korean> + <Korean>6.5mm 200발 들이 탄상자 (예광탄/녹색)</Korean> <Chinesesimp>6.5 mm 200发 弹链盒(曳光,绿)</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_200Rnd_65x39_cased_Box_tracer_green_description"> @@ -562,9 +562,9 @@ <Czech>Kalibr: 6.5×39 mm Stopovka - Zelená<br />Nábojů: 200<br />Použito v: Mk200</Czech> <Polish>Kaliber: 6.5x39 mm Smugowa - Zielona<br />Sztuk: 200<br />Używana w: Mk200</Polish> <Portuguese>Caliber: 6.5x39 mm Tracejante - Verde<br/>Balas: 200<br/>Usado em: Mk200</Portuguese> - <Japanese>口径: 6.5x39 mm 曳光弾 - 緑<br />弾数: 200<br />使用武器: Mk200</Japanese> + <Japanese>口径: 6.5x39 mm トレーサー - 緑<br />弾数: 200<br />使用武器: Mk200</Japanese> <Spanish>Calibre: 6.5x39 mm Trazadora - Verde<br />Cartuchos: 200<br />Usada en: Mk200</Spanish> - <Korean>구경: 6.5x39mm 예광탄 - 초록<br />장탄수: 200발<br />사용처: Mk200</Korean> + <Korean>구경: 6.5x39mm 예광탄 - 녹색<br />장탄수: 200발<br />사용처: Mk200</Korean> <Chinesesimp>口径:6.5x39 mm 曳光—绿色<br/>发数:200<br/>使用于:Mk200</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_200Rnd_65x39_cased_Box_tracer_red"> @@ -575,9 +575,9 @@ <Czech>6.5 mm 200 ranný pás, stopovka (Červená)</Czech> <Polish>6.5 mm Magazynek pudełkowy 200szt. Smugowa (Czerwona)</Polish> <Portuguese>Caixa de Cinto 6.5 mm 200 Balas Tracejantes (Vermelho)</Portuguese> - <Japanese>6.5 mm 200発入り 曳光弾 (赤) ベルト ケース </Japanese> + <Japanese>6.5mm 200Rnd ベルト・トレーサー (赤)</Japanese> <Spanish>Caja con cinta de 200 cartuchos 6.5 mm Trazadora (Roja)</Spanish> - <Korean>6.5mm 200발들이 예광탄 (빨강) 탄상자</Korean> + <Korean>6.5mm 200발 들이 탄상자 (예광탄/적색)</Korean> <Chinesesimp>6.5 mm 200发 弹链盒(曳光,红)</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_200Rnd_65x39_cased_Box_tracer_red_description"> @@ -588,9 +588,9 @@ <Czech>Kalibr: 6.5×39 mm Stopovka - Červená<br />Nábojů: 200<br />Použito v: Mk200</Czech> <Polish>Kaliber: 6.5x39 mm Smugowa - Czerwona<br />Sztuk: 200<br />Używana w: Mk200</Polish> <Portuguese>Caliber: 6.5x39 mm Tracejante - Vermelho<br/>Balas: 200<br/>Usado em: Mk200</Portuguese> - <Japanese>口径: 6.5x39 mm 曳光弾 - 赤<br />弾数: 200<br />使用武器: Mk200</Japanese> + <Japanese>口径: 6.5x39 mm トレーサー - 赤<br />弾数: 200<br />使用武器: Mk200</Japanese> <Spanish>Calibre: 6.5x39 mm Trazadora - Roja<br />Cartuchos: 200<br />Usada en: Mk200</Spanish> - <Korean>구경: 6.5x39mm 예광탄 - 빨강<br />장탄수: 200발<br />사용처: Mk200</Korean> + <Korean>구경: 6.5x39mm 예광탄 - 적색<br />장탄수: 200발<br />사용처: Mk200</Korean> <Chinesesimp>口径:6.5x39 mm 曳光—红色<br/>发数:200<br/>使用于:Mk200</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_20Rnd_762x51_Mag_Tracer_green"> @@ -601,9 +601,9 @@ <Czech>7.62 mm 20 ranný zásobník, stopovka (Zelená)</Czech> <Polish>7.62 mm Magazynek 20szt. Smugowa (Zielona)</Polish> <Portuguese>Magazine 7.62 mm 20 Balas Tracejantes (Verdes)</Portuguese> - <Japanese>7.62 mm 20発入り 曳光弾 (緑) マガジン</Japanese> + <Japanese>7.62mm 20Rnd トレーサー (緑) マガジン</Japanese> <Spanish>Cargador de 20 cartuchos 7.62 mm Trazadora (Verde)</Spanish> - <Korean>7.62mm 20발들이 예광탄 (초록) 탄창</Korean> + <Korean>7.62mm 20발 들이 탄창 (예광탄/녹색)</Korean> <Chinesesimp>7.62 mm 20发 弹匣(曳光,绿)</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_20Rnd_762x51_Mag_Tracer_green_description"> @@ -614,9 +614,9 @@ <Czech>Kalibr: 7.62×51 mm NATO Stopovka - Zelená<br />Nábojů: 20<br />Použito v: Mk18 ABR, Mk-I EMR, Mk14, SPAR-17</Czech> <Polish>Kaliber: 7.62x51 mm NATO Smugowa - Zielona<br />Sztuk: 20<br />Używana w: Mk18 ABR, Mk-I EMR, Mk14, SPAR-17</Polish> <Portuguese>Calibre: 7.62x51 mm NATO Tracejante - Verde<br/>Balas: 20<br/>Usado em: Mk18 ABR, Mk-I EMR, Mk14, SPAR-17</Portuguese> - <Japanese>口径: 7.62x51 mm NATO 曳光弾 - 緑<br />弾数: 20<br />使用武器: Mk18 ABR, Mk-I EMR, Mk14, SPAR-17</Japanese> + <Japanese>口径: 7.62x51 mm NATO トレーサー - 緑<br />弾数: 20<br />使用武器: Mk18 ABR, Mk-I EMR, Mk14, SPAR-17</Japanese> <Spanish>Calibre: 7.62x51 mm NATO Trazadora - Verde<br />Cartuchos: 20<br />Usada en: Mk18 ABR, Mk-I EMR, Mk14, SPAR-17</Spanish> - <Korean>구경: 7.62x51mm 나토 예광탄 - 초록<br />장탄수: 20발<br />사용처: Mk18 ABR, Mk-I EMR, Mk14, SPAR-17</Korean> + <Korean>구경: 7.62x51mm NATO 예광탄 - 녹색<br />장탄수: 20발<br />사용처: Mk18 ABR, Mk-I EMR, Mk14, SPAR-17</Korean> <Chinesesimp>口径:7.62x51 mm 北约曳光—绿色<br/>发数:20<br/>使用于:Mk18 ABR、Mk-I EMR、Mk14、SPAR-17</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_20Rnd_762x51_Mag_Tracer_yellow"> @@ -627,9 +627,9 @@ <Czech>7.62 mm 20 ranný zásobník, stopovka (Žlutá)</Czech> <Polish>7.62 mm Magazynek 20szt. Smugowa (Żółta)</Polish> <Portuguese>Magazine 7.62 mm 20 Balas Tracejantes (Amarelo)</Portuguese> - <Japanese>7.62 mm 20発入り 曳光弾 (黄) マガジン</Japanese> + <Japanese>7.62mm 20Rnd トレーサー (黄) マガジン</Japanese> <Spanish>Cargador de 20 cartuchos 7.62 mm Trazadora (Amarilla)</Spanish> - <Korean>7.62mm 20발들이 예광탄 (노랑) 탄창</Korean> + <Korean>7.62mm 20발 들이 탄창 (예광탄/황색)</Korean> <Chinesesimp>7.62 mm 20发 弹匣(曳光,黄)</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_20Rnd_762x51_Mag_Tracer_yellow_description"> @@ -640,9 +640,9 @@ <Czech>Kalibr: 7.62×51 mm NATO Stopovka - Žlutá<br />Nábojů: 20<br />Použito v: Mk18 ABR, Mk-I EMR, Mk14, SPAR-17</Czech> <Polish>Kaliber: 7.62x51 mm NATO Smugowa - Żółta<br />Sztuk: 20<br />Używana w: Mk18 ABR, Mk-I EMR, Mk14, SPAR-17</Polish> <Portuguese>Calibre: 7.62x51 mm NATO Tracejante - Amarelo<br/>Balas: 20<br/>Usado em: Mk18 ABR, Mk-I EMR, Mk14, SPAR-17</Portuguese> - <Japanese>口径: 7.62x51 mm NATO 曳光弾 - 黄<br />弾数: 20<br />使用武器: Mk18 ABR, Mk-I EMR, Mk14, SPAR-17</Japanese> + <Japanese>口径: 7.62x51 mm NATO トレーサー - 黄<br />弾数: 20<br />使用武器: Mk18 ABR, Mk-I EMR, Mk14, SPAR-17</Japanese> <Spanish>Calibre: 7.62x51 mm NATO Trazadora - Amarilla<br />Cartuchos: 20<br />Usada en: Mk18 ABR, Mk-I EMR, Mk14, SPAR-17</Spanish> - <Korean>구경: 7.62x51mm 나토 예광탄 - 노랑<br />장탄수: 20발<br />사용처: Mk18 ABR, Mk-I EMR, Mk14, SPAR-17</Korean> + <Korean>구경: 7.62x51mm NATO 예광탄 - 황색<br />장탄수: 20발<br />사용처: Mk18 ABR, Mk-I EMR, Mk14, SPAR-17</Korean> <Chinesesimp>口径:7.62x51 mm 北约曳光—黄色<br/>发数:20<br/>使用于:Mk18 ABR、Mk-I EMR、Mk14、SPAR-17</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_150Rnd_762x54_Box_red"> @@ -653,9 +653,9 @@ <Czech>7.62 mm 150 ranný pás, částečná stopovka (Červená)</Czech> <Polish>7.62 mm Magazynek pudełkowy 150szt. Mieszana (Czerwona)</Polish> <Portuguese>Caixa 7.62mm 150 Balas Misturadas (Vermelho)</Portuguese> - <Japanese>7.62 mm 150発入り 混合 (緑) ボックス</Japanese> + <Japanese>7.62mm 150Rnd 混合 (赤) ボックス</Japanese> <Spanish>Caja de 150 cartuchos 7.62 mm Mezcla (Roja)</Spanish> - <Korean>7.62mm 150발들이 혼합탄 (빨강) 탄상자</Korean> + <Korean>7.62mm 150발 들이 탄상자 (보통, 예광혼합탄/적색)</Korean> <Chinesesimp>7.62 mm 150发 弹链盒(曳光,每四发,红)</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_150Rnd_762x54_Box_yellow"> @@ -666,9 +666,9 @@ <Czech>7.62 mm 150 ranný pás, částečná stopovka (Žlutá)</Czech> <Polish>7.62 mm Magazynek pudełkowy 150szt. Mieszana (Żółta)</Polish> <Portuguese>Caixa 7.62mm 150 Balas Misturadas (Amarelo)</Portuguese> - <Japanese>7.62 mm 150発入り 混合 (黄) ボックス</Japanese> + <Japanese>7.62mm 150Rnd 混合 (黄) ボックス</Japanese> <Spanish>Caja de 150 cartuchos 7.62 mm Mezcla (Amarilla)</Spanish> - <Korean>7.62mm 150발들이 혼합탄 (노랑) 탄상자</Korean> + <Korean>7.62mm 150발 들이 탄상자 (보통, 예광혼합탄/황색)</Korean> <Chinesesimp>7.62 mm 150发 弹链盒(曳光,每四发,黄)</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_150Rnd_762x54_Box_Tracer_red"> @@ -679,9 +679,9 @@ <Czech>7.62 mm 150 ranný pás, stopovka (Červená)</Czech> <Polish>7.62mm Magazynek pudełkowy 150szt. Smugowa (Czerwona)</Polish> <Portuguese>Caixa 7.62mm 150 Balas Misturadas (Vermelho)</Portuguese> - <Japanese>7.62 mm 150発入り 曳光弾 (赤) ボックス</Japanese> + <Japanese>7.62mm 150Rnd トレーサー (赤) ボックス</Japanese> <Spanish>Caja de 150 cartuchos 7.62 mm Trazadora (Roja)</Spanish> - <Korean>7.62mm 150발들이 예광탄 (빨강) 탄상자</Korean> + <Korean>7.62mm 150발 들이 탄상자 (예광탄/적색)</Korean> <Chinesesimp>7.62 mm 150发 弹链盒(曳光,红)</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_150Rnd_762x54_Box_Tracer_red_description"> @@ -692,9 +692,9 @@ <Czech>Kalibr: 7.62×54 mm Stopovka - Červená<br />Nábojů: 150<br />Použito v: Zafir</Czech> <Polish>Kaliber: 7.62x54 mm Smugowa - Czerwona<br />Sztuk: 150<br />Używana w: Zafir</Polish> <Portuguese>Calibre: 7.62x54 mm Tracejante - Vermelho<br/>Balas: 150<br/>Usado em:Zafir</Portuguese> - <Japanese>口径: 7.62x54 mm 曳光弾 - 赤<br />弾数: 150<br />使用武器: ザフィル</Japanese> + <Japanese>口径: 7.62x54 mm トレーサー - 赤<br />弾数: 150<br />使用武器: ザフィール</Japanese> <Spanish>Calibre: 7.62x54 mm Trazadora - Roja<br />Cartuchos: 150<br />Usada en: Zafir</Spanish> - <Korean>구경: 7.62x54mm 예광탄 - 빨강<br />장탄수: 150발<br />사용처: Zafir</Korean> + <Korean>구경: 7.62x54mmR 예광탄 - 적색<br />장탄수: 150발<br />사용처: Zafir</Korean> <Chinesesimp>口径:7.62x54 mm 曳光—红色<br/>发数:150<br/>使用于:Zafir</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_150Rnd_762x54_Box_Tracer_yellow"> @@ -705,9 +705,9 @@ <Czech>7.62 mm 150 ranný pás, stopovka (Žlutá)</Czech> <Polish>7.62 mm Magazynek pudełkowy 150szt. Smugowa (Żółta)</Polish> <Portuguese>Caixa 7.62mm 150 Balas Tracejantes (Amarelo)</Portuguese> - <Japanese>7.62 mm 150発入り 曳光弾 (緑) ボックス</Japanese> + <Japanese>7.62mm 150Rnd トレーサー (黄) ボックス</Japanese> <Spanish>Caja de 150 cartuchos 7.62 mm Trazadora (Amarilla)</Spanish> - <Korean>7.62mm 150발들이 예광탄 (노랑) 탄상자</Korean> + <Korean>7.62mm 150발 들이 탄상자 (예광탄/황색)</Korean> <Chinesesimp>7.62 mm 150发 弹链盒(曳光,黄)</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_150Rnd_762x54_Box_Tracer_yellow_description"> @@ -718,9 +718,9 @@ <Czech>Kalibr: 7.62×54 mm Stopovka - Žlutá<br />Nábojů: 150<br />Použito v: Zafir</Czech> <Polish>Kaliber: 7.62x54 mm Smugowa - Żółta<br />Sztuk: 150<br />Używana w: Zafir</Polish> <Portuguese>Calibre: 7.62x54 mm Tracejante - Amarelo<br/>Balas: 150<br/>Usado em:Zafir</Portuguese> - <Japanese>口径: 7.62x54 mm 曳光弾 - 黄<br />弾数: 150<br />使用武器: ザフィル</Japanese> + <Japanese>口径: 7.62x54 mm トレーサー - 黄<br />弾数: 150<br />使用武器: ザフィール</Japanese> <Spanish>Calibre: 7.62x54 mm Trazadora - Amarilla<br />Cartuchos: 150<br />Usada en: Zafir</Spanish> - <Korean>구경: 7.62x54mm 예광탄 - 노랑<br />장탄수: 150발<br />사용처: Zafir</Korean> + <Korean>구경: 7.62x54mmR 예광탄 - 황색<br />장탄수: 150발<br />사용처: Zafir</Korean> <Chinesesimp>口径:7.62x54 mm 曳光—黄色<br/>发数:150<br/>使用于:Zafir</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_150Rnd_93x64_Mag_yellow"> @@ -731,9 +731,9 @@ <Czech>9.3 mm 150 ranný pás, částečná stopovka (Žlutá)</Czech> <Polish>9.3 mm Taśma 150szt. Mieszana (Żółta)</Polish> <Portuguese>Cinto 9.3mm 150 Balas Misturadas (Amarelo)</Portuguese> - <Japanese>9.3 mm 150発入り 混合 (黄) ベルト</Japanese> + <Japanese>9.3mm 150Rnd 混合 (黄) ベルト</Japanese> <Spanish>Cinta de 150 cartuchos 9.3 mm Mezcla (Amarilla)</Spanish> - <Korean>9.3mm 150발 혼합탄 (노랑) 탄띠</Korean> + <Korean>9.3mm 150발 들이 탄띠 (보통, 예광혼합탄/황색)</Korean> <Chinesesimp>9.3 mm 150发 弹链盒(曳光,每四发,黄)</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_150Rnd_93x64_Mag_red"> @@ -744,9 +744,9 @@ <Czech>9.3 mm 150 ranný pás, částečná stopovka (Červená)</Czech> <Polish>9.3 mm Taśma 150szt. Mieszana (Czerwona)</Polish> <Portuguese>Cinto 9.3mm 150 Balas Misturadas (Vermelho)</Portuguese> - <Japanese>9.3 mm 150発入り 混合 (赤) ベルト</Japanese> + <Japanese>9.3mm 150Rnd 混合 (赤) ベルト</Japanese> <Spanish>Cinta de 150 cartuchos 9.3 mm Mezcla (Roja)</Spanish> - <Korean>9.3mm 150발 혼합탄 (빨강) 탄띠</Korean> + <Korean>9.3mm 150발 들이 탄띠 (보통, 예광혼합탄/적색)</Korean> <Chinesesimp>9.3 mm 150发 弹链盒(曳光,每四发,红)</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_130Rnd_338_Mag_yellow"> @@ -757,9 +757,9 @@ <Czech>.338 NM 130 ranný pás, částečná stopovka (Žlutá)</Czech> <Polish>.338 NM Taśma 130szt. Mieszana (Żółta)</Polish> <Portuguese>Cinto .338 NM Misturado (Amarelo)</Portuguese> - <Japanese>.338 NM 130発入り 混合 (黄) ベルト</Japanese> + <Japanese>.338 NM 130Rnd 混合 (黄) ベルト</Japanese> <Spanish>Cinta de 130 cartuchos .338 NM Mezcla (Amarilla)</Spanish> - <Korean>.338 130발들이 혼합탄 (노랑) 탄띠</Korean> + <Korean>.338구경 노르마 매그넘 130발 들이 탄띠 (보통, 예광혼합탄/황색)</Korean> <Chinesesimp>.338 NM 130发 弹链盒(曳光,每四发,黄)</Chinesesimp> </Key> <Key ID="STR_ACE_Tracers_130Rnd_338_Mag_green"> @@ -770,9 +770,9 @@ <Czech>.338 NM 130 ranný pás, částečná stopovka (Zelená)</Czech> <Polish>.338 NM Taśma 130szt. Mieszana (Zielona)</Polish> <Portuguese>Cinto .338 NM 130 Balas Misturados (Verde)</Portuguese> - <Japanese>.338 NM 130発入り 混合 (緑) ベルト</Japanese> + <Japanese>.338 NM 130Rnd 混合 (緑) ベルト</Japanese> <Spanish>Cinta de 130 cartuchos .338 NM Mezcla (Verde)</Spanish> - <Korean>.338 130발들이 혼합탄 (초록) 탄띠</Korean> + <Korean>.338구경 노르마 매그넘 130발 들이 탄띠 (보통, 예광혼합탄/녹색)</Korean> <Chinesesimp>.338 NM 130发 弹链盒(曳光,每四发,绿)</Chinesesimp> </Key> </Container> diff --git a/tools/.vscode/tasks.json b/tools/.vscode/tasks.json index eb919f53092..86ba973164a 100644 --- a/tools/.vscode/tasks.json +++ b/tools/.vscode/tasks.json @@ -118,5 +118,33 @@ "isDefault": true } } + { + "label": "Extension: x64", + "command": "cargo", + "options": { + "cwd": "${workspaceFolder}" + }, + "args": [ + "make", + "move_x64_release" + ], + "group": { + "kind": "build" + } + } + { + "label": "Extension: Release", + "command": "cargo", + "options": { + "cwd": "${workspaceFolder}" + }, + "args": [ + "make", + "release" + ], + "group": { + "kind": "build" + } + } ] } \ No newline at end of file diff --git a/tools/compileExtensions.py b/tools/compileExtensions.py deleted file mode 100644 index 8864d98e7a4..00000000000 --- a/tools/compileExtensions.py +++ /dev/null @@ -1,97 +0,0 @@ -#!/usr/bin/env python3 -# vim: set fileencoding=utf-8 : - -# compileExtensions.py (from acre2's make.py) - -############################################################################### - -# The MIT License (MIT) - -# Copyright (c) 2013-2014 Ryan Schultz - -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: - -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. - -############################################################################### - -import sys -import os.path -import subprocess -import shutil -import time -import timeit - -if sys.platform == "win32": - import winreg - - -def compile_extensions(force_build): - originalDir = os.getcwd() - extensions_root = os.path.join(os.path.dirname(os.getcwd()), "extensions") - os.chdir(extensions_root) - print("\nCompiling extensions in {} with rebuild:{}\n".format(extensions_root, force_build)) - - if shutil.which("git") == None: - print("Failed to find Git!") - return - if shutil.which("cmake") == None: - print("Failed to find CMake!") - return - if shutil.which("msbuild") == None: - print("Failed to find MSBuild!") - return - - try: - buildType = "rebuild" if force_build else "build" - # 32-bit - vcproj32 = os.path.join(extensions_root, "vcproj32") - if not os.path.exists(vcproj32): - os.mkdir(vcproj32) - os.chdir(vcproj32) - subprocess.call(["cmake", "..", "-A", "Win32"]) # note: cmake will update ace_version stuff - subprocess.call(["msbuild", "ACE.sln", "/m", "/t:{}".format(buildType), "/p:Configuration=Release"]) - - # 64-bit - vcproj64 = os.path.join(extensions_root, "vcproj64") - if not os.path.exists(vcproj64): - os.mkdir(vcproj64) - os.chdir(vcproj64) - subprocess.call(["cmake", "..", "-A", "x64"]) - subprocess.call(["msbuild", "ACE.sln", "/m", "/t:{}".format(buildType), "/p:Configuration=Release"]) - except Exception as e: - print("Error: COMPILING EXTENSIONS - {}".format(e)) - raise - finally: - os.chdir(originalDir) - - -def main(argv): - if "force" in argv: - argv.remove("force") - force_build = True - else: - force_build = False - - compile_extensions(force_build) - - -if __name__ == "__main__": - start_time = timeit.default_timer() - main(sys.argv) - print("\nTotal Program time elapsed: {0} sec".format(timeit.default_timer() - start_time)) - input("Press Enter to continue...") diff --git a/tools/extract_dependencies.py b/tools/extract_dependencies.py index e28eb6cd9c9..ac19d5946c5 100644 --- a/tools/extract_dependencies.py +++ b/tools/extract_dependencies.py @@ -89,6 +89,9 @@ def main(): data += get_dependencies(line) continue + # Sort addons alphabetically + data.sort(key=str.casefold) + data = "`, `".join(data) data = "`{}`".format(data) diff --git a/tools/pDummies/WW2/SPE_Assets_m/Vehicles/StaticWeapons_U1_m/SPE_M3_Tripod.p3d b/tools/pDummies/WW2/SPE_Assets_m/Vehicles/StaticWeapons_U1_m/SPE_M3_Tripod.p3d new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tools/pDummies/WW2/SPE_Assets_m/Vehicles/StaticWeapons_m/SPE_Lafette_Tripod_High.p3d b/tools/pDummies/WW2/SPE_Assets_m/Vehicles/StaticWeapons_m/SPE_Lafette_Tripod_High.p3d new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tools/pDummies/WW2/SPE_Assets_m/Vehicles/StaticWeapons_m/SPE_Lafette_Tripod_Low.p3d b/tools/pDummies/WW2/SPE_Assets_m/Vehicles/StaticWeapons_m/SPE_Lafette_Tripod_Low.p3d new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tools/pDummies/WW2/SPE_Assets_m/Vehicles/StaticWeapons_m/SPE_M2_Tripod_Low.p3d b/tools/pDummies/WW2/SPE_Assets_m/Vehicles/StaticWeapons_m/SPE_M2_Tripod_Low.p3d new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tools/pDummies/WW2/SPE_Assets_t/Weapons/Equipment_U1_t/Weapons/Launchers/Gear_M3_Tripod_X_ca.paa b/tools/pDummies/WW2/SPE_Assets_t/Weapons/Equipment_U1_t/Weapons/Launchers/Gear_M3_Tripod_X_ca.paa new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tools/pDummies/WW2/SPE_Assets_t/Weapons/Equipment_t/Weapons/Launchers/Gear_Lafette_Tripod_X_ca.paa b/tools/pDummies/WW2/SPE_Assets_t/Weapons/Equipment_t/Weapons/Launchers/Gear_Lafette_Tripod_X_ca.paa new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tools/pDummies/WW2/SPE_Assets_t/Weapons/Equipment_t/Weapons/Launchers/Gear_M2_Tripod_X_ca.paa b/tools/pDummies/WW2/SPE_Assets_t/Weapons/Equipment_t/Weapons/Launchers/Gear_M2_Tripod_X_ca.paa new file mode 100644 index 00000000000..e69de29bb2d