hexsha
stringlengths
40
40
size
int64
7
1.05M
ext
stringclasses
13 values
lang
stringclasses
1 value
max_stars_repo_path
stringlengths
4
269
max_stars_repo_name
stringlengths
5
109
max_stars_repo_head_hexsha
stringlengths
40
40
max_stars_repo_licenses
listlengths
1
9
max_stars_count
int64
1
191k
max_stars_repo_stars_event_min_datetime
stringlengths
24
24
max_stars_repo_stars_event_max_datetime
stringlengths
24
24
max_issues_repo_path
stringlengths
4
269
max_issues_repo_name
stringlengths
5
116
max_issues_repo_head_hexsha
stringlengths
40
40
max_issues_repo_licenses
listlengths
1
9
max_issues_count
int64
1
48.5k
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
max_forks_repo_path
stringlengths
4
269
max_forks_repo_name
stringlengths
5
116
max_forks_repo_head_hexsha
stringlengths
40
40
max_forks_repo_licenses
listlengths
1
9
max_forks_count
int64
1
105k
max_forks_repo_forks_event_min_datetime
stringlengths
24
24
max_forks_repo_forks_event_max_datetime
stringlengths
24
24
content
stringlengths
7
1.05M
avg_line_length
float64
1.21
330k
max_line_length
int64
6
990k
alphanum_fraction
float64
0.01
0.99
author_id
stringlengths
2
40
a3b77947bb6d27142baf68bf8d1acb9c35582dfb
921
cpp
C++
0600/00/604a.cpp
actium/cf
d7be128c3a9adb014a231a399f1c5f19e1ab2a38
[ "Unlicense" ]
1
2020-07-03T15:55:52.000Z
2020-07-03T15:55:52.000Z
0600/00/604a.cpp
actium/cf
d7be128c3a9adb014a231a399f1c5f19e1ab2a38
[ "Unlicense" ]
null
null
null
0600/00/604a.cpp
actium/cf
d7be128c3a9adb014a231a399f1c5f19e1ab2a38
[ "Unlicense" ]
3
2020-10-01T14:55:28.000Z
2021-07-11T11:33:58.000Z
#include <array> #include <iostream> template <typename T, size_t N> std::istream& operator >>(std::istream& input, std::array<T, N>& v) { for (T& a : v) input >> a; return input; } void answer(unsigned v) { std::cout << v << '\n'; } void solve(const std::array<unsigned, 5>& m, const std::array<unsigned, 5>& w, unsigned hs, unsigned hu) { constexpr unsigned c[5] = { 500, 1000, 1500, 2000, 2500 }; unsigned s = 100 * hs; for (size_t i = 0; i < 5; ++i) { const unsigned u = c[i] - c[i] * m[i] / 250; const unsigned v = 50 * w[i]; s += std::max(c[i] * 3 / 10, v > u ? 0 : u - v); } const unsigned d = 50 * hu; answer(s > d ? s - d : 0); } int main() { std::array<unsigned, 5> m; std::cin >> m; std::array<unsigned, 5> w; std::cin >> w; unsigned hs, hu; std::cin >> hs >> hu; solve(m, w, hs, hu); return 0; }
18.42
104
0.511401
actium
a3ba8646d5be6e36548de446ccf3b6a9b0dd658a
2,207
cpp
C++
2017-08-03/F.cpp
tangjz/Three-Investigators
46dc9b2f0fbb4fe89b075a81feaacc33feeb1b52
[ "MIT" ]
3
2018-04-02T06:00:51.000Z
2018-05-29T04:46:29.000Z
2017-08-03/F.cpp
tangjz/Three-Investigators
46dc9b2f0fbb4fe89b075a81feaacc33feeb1b52
[ "MIT" ]
2
2018-03-31T17:54:30.000Z
2018-05-02T11:31:06.000Z
2017-08-03/F.cpp
tangjz/Three-Investigators
46dc9b2f0fbb4fe89b075a81feaacc33feeb1b52
[ "MIT" ]
2
2018-10-07T00:08:06.000Z
2021-06-28T11:02:59.000Z
#include <cstdio> typedef unsigned long long ULL; const int maxn = 251, maxs = 1 << 16 | 1; int t, n, m, lbt[maxs], tot, seq[maxn], ans; inline int lowbit(unsigned msk) { return msk & 65535 ? lbt[msk & 65535] : 16 + lbt[msk >> 16]; } inline int lowbit(ULL msk) { return msk & 4294967295ULL ? lowbit((unsigned)msk) : 32 + lowbit((unsigned)(msk >> 32)); } struct Bitset { ULL data[4]; void clear() { data[0] = data[1] = data[2] = data[3] = 0; } bool test(int pos) const { return (data[pos >> 6] >> (pos & 63)) & 1; } void flip(int pos) { data[pos >> 6] ^= 1ULL << (pos & 63); } bool operator == (Bitset const &t) const { return data[0] == t.data[0] && data[1] == t.data[1] && data[2] == t.data[2] && data[3] == t.data[3]; } Bitset operator - (Bitset const &t) const { return (Bitset){data[0] & (~t.data[0]), data[1] & (~t.data[1]), data[2] & (~t.data[2]), data[3] & (~t.data[3])}; } int lowbit() const { return data[0] ? ::lowbit(data[0]) : data[1] ? 64 + ::lowbit(data[1]) : data[2] ? 128 + ::lowbit(data[2]) : data[3] ? 192 + ::lowbit(data[3]) : 256; } } e[maxn], g[maxn], cur; char buf[maxn]; void dfs1(int u) { cur.flip(u); for(int v = (e[u] - cur).lowbit(); v < n; v = (e[u] - cur).lowbit()) dfs1(v); seq[--tot] = u; } void dfs2(int u) { ++tot; cur.flip(u); for(int v = (g[u] - cur).lowbit(); v < n; v = (g[u] - cur).lowbit()) dfs2(v); } int main() { lbt[0] = -1; for(int i = 1; i < maxs; ++i) lbt[i] = i & 1 ? 0 : lbt[i >> 1] + 1; scanf("%d", &t); while(t--) { scanf("%d%d", &n, &m); for(int i = 0; i < n; ++i) { e[i].clear(); g[i].clear(); } for(int i = 0; i < n; ++i) { scanf("%s", buf); for(int j = 0; j < n; ++j) if(buf[j] == '1') { e[i].flip(j); g[j].flip(i); } } while(m--) { int c, u, v; scanf("%d", &c); while(c--) { scanf("%d%d", &u, &v); --u; --v; e[u].flip(v); g[v].flip(u); } tot = n; cur.clear(); for(int i = 0; i < n; ++i) if(!cur.test(i)) dfs1(i); ans = 0; cur.clear(); for(int i = 0; i < n; ++i) if(!cur.test(seq[i])) { tot = 0; dfs2(seq[i]); ans += (tot * (tot - 1)) >> 1; } printf("%d\n", ans); } } return 0; }
23.98913
150
0.481196
tangjz
a3bf2ebc2fedfd268796cf08b2446dd094df5a8b
4,832
cpp
C++
zebus/src/network/zebus-wifi.cpp
guidoschreuder/zebus
62ddf7acee79bcc3b4899cae1d971efab55f9047
[ "MIT" ]
1
2022-01-23T12:03:25.000Z
2022-01-23T12:03:25.000Z
zebus/src/network/zebus-wifi.cpp
guidoschreuder/zebus
62ddf7acee79bcc3b4899cae1d971efab55f9047
[ "MIT" ]
null
null
null
zebus/src/network/zebus-wifi.cpp
guidoschreuder/zebus
62ddf7acee79bcc3b4899cae1d971efab55f9047
[ "MIT" ]
null
null
null
#include "zebus-wifi.h" #include <WiFiManager.h> #include <nvs_flash.h> #include "zebus-config.h" #include "zebus-events.h" #include "zebus-state.h" #include "zebus-system-info.h" #include "zebus-telegram-bot.h" #include "zebus-time.h" #include "zebus-secrets.h" #include "zebus-espnow.h" #include "zebus-mqtt.h" const char PWD_CHARS[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890"; WiFiManager wiFiManager; bool wiFiEnabled = false; RTC_DATA_ATTR bool configPortalHasRan = false; uint64_t ntp_last_init; // prototype void setupWiFi(); void disableWiFi(); void runConfigPortal(); void saveConfigPortalParamsCallback(); void onWiFiConnected(); void onWiFiConnectionLost(); void refreshNTP(); // public functions const char *generate_ap_password() { uint32_t seed = ESP.getEfuseMac() >> 32; static char pwd[ZEBUS_WIFI_CONFIG_AP_PASSWORD_LENGTH + 1] = {0}; for (uint8_t i = 0; i < ZEBUS_WIFI_CONFIG_AP_PASSWORD_LENGTH; i++) { pwd[i] = PWD_CHARS[rand_r(&seed) % sizeof(PWD_CHARS)]; } return pwd; } void wiFiTask(void *pvParameter) { // CRITICAL: WiFi will fail to startup without this // see: https://github.com/espressif/arduino-esp32/issues/761 nvs_flash_init(); EventGroupHandle_t event_group = (EventGroupHandle_t)pvParameter; for (;;) { // always wait for the config portal to finish before turning off WiFi if (system_info->wifi.config_ap.active) { wiFiManager.process(); vTaskDelay(1); continue; } EventBits_t uxBits = xEventGroupGetBits(event_group); if (uxBits & WIFI_ENABLED) { setupWiFi(); if (WiFi.status() == WL_CONNECTED) { onWiFiConnected(); } else { onWiFiConnectionLost(); } } else if (wiFiEnabled) { disableWiFi(); xEventGroupSetBits(event_group, WIFI_DISABLED); } vTaskDelay(pdMS_TO_TICKS(100)); } } // implementations void setupWiFi() { if (wiFiEnabled) { return; } ESP_LOGI(ZEBUS_LOG_TAG, "Setup WiFi"); esp_wifi_set_storage(WIFI_STORAGE_FLASH); // explicitly set mode, ESP32 defaults to STA+AP esp_wifi_set_mode(WIFI_MODE_STA); WiFi.setAutoReconnect(false); // disable modem sleep so ESP-NOW packets can be received // TODO: this is not very power efficient, investigate if we can estimate when ESP_NOW packets are expected to be received esp_wifi_set_ps(WIFI_PS_NONE); if (!configPortalHasRan) { runConfigPortal(); configPortalHasRan = true; } else { esp_wifi_start(); } espnow_setup(); mqtt_setup(); system_info->wifi.rssi = WIFI_NO_SIGNAL; wiFiEnabled = true; } void disableWiFi() { ESP_LOGI(ZEBUS_LOG_TAG, "Disable WiFi"); system_info->wifi.config_ap.active = false; espnow_disable(); // set storage to RAM so saved settings are not erased esp_wifi_set_storage(WIFI_STORAGE_RAM); esp_wifi_disconnect(); esp_wifi_set_mode(WIFI_MODE_NULL); esp_wifi_stop(); wiFiEnabled = false; } void runConfigPortal() { char apName[16] = {0}; snprintf(apName, sizeof(apName), "%s %x", ZEBUS_APPNAME, (uint32_t)ESP.getEfuseMac()); system_info->wifi.rssi = WIFI_NO_SIGNAL; system_info->wifi.config_ap.ap_name = strdup(apName); system_info->wifi.config_ap.ap_password = generate_ap_password(); wiFiManager.setConfigPortalBlocking(false); wiFiManager.setCaptivePortalEnable(false); wiFiManager.setShowInfoUpdate(false); wiFiManager.setSaveParamsCallback(saveConfigPortalParamsCallback); wiFiManager.setHostname(ZEBUS_WIFI_HOSTNAME); system_info->wifi.config_ap.active = !wiFiManager.autoConnect(system_info->wifi.config_ap.ap_name, system_info->wifi.config_ap.ap_password); if (system_info->wifi.config_ap.active) { ESP_LOGI(ZEBUS_LOG_TAG, "WiFi Configuration Portal is activated"); } } void saveConfigPortalParamsCallback() { ESP_LOGI(ZEBUS_LOG_TAG, "WiFiManager saveParamsCallback called"); system_info->wifi.config_ap.active = false; } void onWiFiConnected() { system_info->wifi.rssi = WiFi.RSSI(); system_info->wifi.ip_addr = WiFi.localIP(); refreshNTP(); handleTelegramMessages(); } void onWiFiConnectionLost() { ESP_LOGW(ZEBUS_LOG_TAG, "WiFi connection was lost"); system_info->wifi.rssi = WIFI_NO_SIGNAL; esp_wifi_set_storage(WIFI_STORAGE_FLASH); ESP_ERROR_CHECK(esp_wifi_connect()); for (int i = 0; i < 20 && (WiFi.status() != WL_CONNECTED); i++) { vTaskDelay(100); } if (WiFi.status() == WL_CONNECTED) { ESP_LOGI(ZEBUS_LOG_TAG, "WiFi reconnection SUCCESS"); } else { ESP_LOGW(ZEBUS_LOG_TAG, "WiFi reconnection FAILED"); } } void refreshNTP() { if (interval_expired(&ntp_last_init, ZEBUS_NTP_REFRESH_INTERVAL_MS)) { ESP_LOGD(ZEBUS_LOG_TAG, "Refreshing NTP"); configTime(ZEBUS_NTP_GMT_OFFSET_SEC, ZEBUS_NTP_GMT_DST_OFFSET_SEC, ZEBUS_NTP_SERVER); } }
26.696133
124
0.723924
guidoschreuder
a3c0cf7706f93222ead7137931fd157d8390645b
697
cpp
C++
lw/net/tls_router.cpp
LifeWanted/liblw
af8e08c47cb8aa7542eb2bef9fe09b7a0b44fed8
[ "MIT" ]
36
2015-10-04T15:05:21.000Z
2022-01-30T07:18:36.000Z
lw/net/tls_router.cpp
LifeWanted/liblw
af8e08c47cb8aa7542eb2bef9fe09b7a0b44fed8
[ "MIT" ]
8
2017-03-20T12:28:15.000Z
2021-02-24T20:40:45.000Z
lw/net/tls_router.cpp
LifeWanted/liblw
af8e08c47cb8aa7542eb2bef9fe09b7a0b44fed8
[ "MIT" ]
6
2017-09-25T13:50:03.000Z
2021-01-16T00:01:44.000Z
#include "lw/net/tls_router.h" #include "lw/co/future.h" #include "lw/co/task.h" #include "lw/log/log.h" #include "lw/net/router.h" #include "lw/net/tls.h" #include "lw/net/tls_options.h" namespace lw::net::internal { co::Future<std::unique_ptr<net::TLSStream>> tls_wrap_connection( net::TLSStreamFactory& tls_factory, std::unique_ptr<io::CoStream> conn ) { std::unique_ptr<net::TLSStream> tls_conn; try { tls_conn = tls_factory.wrap_stream(std::move(conn)); co_await tls_conn->handshake(); } catch(const Error& err) { if (tls_conn->good()) tls_conn->close(); log(INFO) << "Failed to establish TLS connection/handshake: " << err.what(); } co_return tls_conn; } }
24.892857
80
0.688666
LifeWanted
a3c1d03d8c03af38c4e952ab591a977f30553fc4
2,061
cpp
C++
test_recv.cpp
Steamgjk/Stellar-Bench
048161b02008463ce35cc3481cfd37913174d069
[ "Apache-2.0" ]
null
null
null
test_recv.cpp
Steamgjk/Stellar-Bench
048161b02008463ce35cc3481cfd37913174d069
[ "Apache-2.0" ]
null
null
null
test_recv.cpp
Steamgjk/Stellar-Bench
048161b02008463ce35cc3481cfd37913174d069
[ "Apache-2.0" ]
null
null
null
#include <iostream> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <signal.h> #include <unistd.h> #include <stdlib.h> #include <assert.h> #include <stdio.h> #include <string> #include <cstring> #include <cmath> #include <time.h> #include <vector> #include <list> #include <thread> #include <chrono> #include <algorithm> #include <mutex> #include <atomic> #include <fstream> #include <sys/time.h> #include <map> #include "mf_common.h" #include "rdma_two_sided_client_op.h" #include "rdma_two_sided_server_op.h" using namespace std; #define RIP "12.12.10.13" #define LIP "12.12.11.13" #define RPORT 5555 #define LPORT 4444 void rdma_sendTd_loop(); void rdma_recvTd_loop(); struct client_context c_ctx; struct conn_context s_ctx; void rdma_sendTd_loop() { string remote_ip = RIP; int remote_port = RPORT; printf("remote_ip=%s remote_port=%d\n", remote_ip.c_str(), remote_port); char str_port[100]; sprintf(str_port, "%d", remote_port); RdmaTwoSidedClientOp ct; ct.rc_client_loop(remote_ip.c_str(), str_port, &(c_ctx)); } void rdma_recvTd_loop() { int bind_port = LPORT; char str_port[100]; sprintf(str_port, "%d", bind_port); printf("bind_port = %d\n", bind_port ); RdmaTwoSidedServerOp rtos; rtos.rc_server_loop(str_port, &(s_ctx)); } int main(int argc, const char * argv[]) { s_ctx.buf_recv_counter = 0; s_ctx.can_recv = true; std::thread recv_loop_thread(rdma_recvTd_loop); recv_loop_thread.detach(); while ( s_ctx.buf_registered == false) { std::this_thread::sleep_for(std::chrono::milliseconds(1000)); } printf("BUF registered!\n"); int read_counter = 0; while (1 == 1) { if (read_counter >= s_ctx.buf_recv_counter) { std::this_thread::sleep_for(std::chrono::milliseconds(1000)); printf("read_counter=%d buf_recv_counter=%d\n", read_counter, s_ctx.buf_recv_counter ); } else { printf("len= %d\n", s_ctx.buf_len ); for (int i = 0; i < s_ctx.buf_len; i++) { printf("%c", s_ctx.buffer[i] ); } printf("\n"); read_counter++; s_ctx.can_recv = true; } } }
22.648352
91
0.702086
Steamgjk
a3c64a03870476bd3e65597b0dfa276f3de90038
11,931
cpp
C++
src/serac/numerics/tests/expr_templates.cpp
btalamini/serac
f7a1628d05393a3f5efce4d1808a0c3fde9bf188
[ "BSD-3-Clause" ]
null
null
null
src/serac/numerics/tests/expr_templates.cpp
btalamini/serac
f7a1628d05393a3f5efce4d1808a0c3fde9bf188
[ "BSD-3-Clause" ]
null
null
null
src/serac/numerics/tests/expr_templates.cpp
btalamini/serac
f7a1628d05393a3f5efce4d1808a0c3fde9bf188
[ "BSD-3-Clause" ]
null
null
null
// Copyright (c) 2019-2022, Lawrence Livermore National Security, LLC and // other Serac Project Developers. See the top-level LICENSE file for // details. // // SPDX-License-Identifier: (BSD-3-Clause) #include "serac/numerics/expr_template_ops.hpp" #include <gtest/gtest.h> static std::pair<mfem::Vector, mfem::Vector> sample_vectors(const int entries) { mfem::Vector lhs(entries); mfem::Vector rhs(entries); for (int i = 0; i < entries; i++) { lhs[i] = i * 4 + 1; rhs[i] = i * i * 3 + 2; } return {lhs, rhs}; } static std::pair<mfem::DenseMatrix, mfem::Vector> sample_matvec(const int rows, const int cols) { mfem::Vector vec_in(cols); mfem::DenseMatrix matrix(rows, cols); for (int i = 0; i < cols; i++) { vec_in[i] = i * 4 + 1; for (int j = 0; j < rows; j++) { matrix(j, i) = 2 * (i == j) - (i == (j + 1)) - (i == (j - 1)); } } return {matrix, vec_in}; } static auto build_partitioning(MPI_Comm comm, const int size) { int num_procs = 0; int rank = 0; MPI_Comm_size(comm, &num_procs); MPI_Comm_rank(comm, &rank); bool assumed_partition = HYPRE_AssumedPartitionCheck(); auto partitioning = std::make_unique<int[]>(assumed_partition ? 2 : static_cast<std::size_t>(num_procs + 1)); const int per_proc = (size / num_procs) + ((size % num_procs != 0) ? 1 : 0); if (assumed_partition) { auto n_entries = (rank == num_procs - 1) ? size - ((num_procs - 1) * per_proc) : per_proc; partitioning[0] = per_proc * rank; partitioning[1] = (per_proc * rank) + n_entries; } else { for (int i = 0; i < num_procs; i++) { partitioning[static_cast<std::size_t>(i)] = per_proc * i; } partitioning[static_cast<std::size_t>(num_procs)] = size; } return std::make_pair(std::move(partitioning), per_proc * rank); } TEST(expr_templates, basic_add) { MPI_Barrier(MPI_COMM_WORLD); constexpr int size = 10; auto [lhs, rhs] = sample_vectors(size); mfem::Vector mfem_result(size); add(lhs, rhs, mfem_result); mfem::Vector expr_result = lhs + rhs; for (int i = 0; i < size; i++) { EXPECT_DOUBLE_EQ(mfem_result[i], expr_result[i]); } MPI_Barrier(MPI_COMM_WORLD); } TEST(expr_templates, basic_add_hyprepar) { MPI_Barrier(MPI_COMM_WORLD); constexpr int size = 10; auto [lhs, rhs] = sample_vectors(size); auto [partitioning, start] = build_partitioning(MPI_COMM_WORLD, size); mfem::HypreParVector lhs_par(MPI_COMM_WORLD, size, lhs + start, partitioning.get()); mfem::HypreParVector rhs_par(MPI_COMM_WORLD, size, rhs + start, partitioning.get()); mfem::HypreParVector mfem_result(MPI_COMM_WORLD, size, partitioning.get()); add(lhs_par, rhs_par, mfem_result); mfem::HypreParVector expr_result(MPI_COMM_WORLD, size, partitioning.get()); evaluate(lhs_par + rhs_par, expr_result); double* mfem_local = mfem_result; double* expr_local = expr_result; for (int i = 0; i < expr_result.Size(); i++) { EXPECT_DOUBLE_EQ(mfem_local[i], expr_local[i]); } MPI_Barrier(MPI_COMM_WORLD); } TEST(expr_templates, basic_div) { MPI_Barrier(MPI_COMM_WORLD); constexpr int size = 10; constexpr double scalar = 0.3; mfem::Vector a(size); mfem::Vector mfem_result(size); for (int i = 0; i < size; i++) { a[i] = i * 4 + 1; mfem_result[i] = a[i]; } // Dividing a vector by a scalar mfem_result /= scalar; mfem::Vector expr_result = a / scalar; for (int i = 0; i < size; i++) { EXPECT_DOUBLE_EQ(mfem_result[i], expr_result[i]); } // Dividing a scalar by a vector mfem_result = a; for (int i = 0; i < size; i++) { a[i] = scalar / a[i]; } expr_result = scalar / a; for (int i = 0; i < size; i++) { EXPECT_DOUBLE_EQ(mfem_result[i], expr_result[i]); } MPI_Barrier(MPI_COMM_WORLD); } TEST(expr_templates, basic_add_lambda) { MPI_Barrier(MPI_COMM_WORLD); constexpr int size = 10; auto [lhs, rhs] = sample_vectors(size); mfem::Vector mfem_result(size); add(lhs, rhs, mfem_result); auto lambda_add = [](const auto& l, const auto& r) { return l + r; }; mfem::Vector expr_result = lambda_add(lhs, rhs); EXPECT_EQ(mfem_result.Size(), expr_result.Size()); for (int i = 0; i < size; i++) { EXPECT_DOUBLE_EQ(mfem_result[i], expr_result[i]); } MPI_Barrier(MPI_COMM_WORLD); } TEST(expr_templates, subtraction_not_commutative) { MPI_Barrier(MPI_COMM_WORLD); constexpr int size = 10; mfem::Vector a(size); mfem::Vector b(size); mfem::Vector c(size); for (int i = 0; i < size; i++) { a[i] = i * 4 + 1; b[i] = i * i * 3 + 2; c[i] = i * i * i * 7 + 23; } // Tests that switching the order of operations // does not change the result mfem::Vector result1 = a + c - b; // Parsed as (a + c) - b mfem::Vector result2 = c - b + a; // Parsed as (c - b) + a for (int i = 0; i < size; i++) { EXPECT_DOUBLE_EQ(result1[i], result2[i]); } mfem::Vector result3 = a - c; mfem::Vector result4 = c - a; for (int i = 0; i < size; i++) { EXPECT_FALSE(result3[i] == result4[i]); } MPI_Barrier(MPI_COMM_WORLD); } TEST(expr_templates, subtraction_not_commutative_rvalue) { MPI_Barrier(MPI_COMM_WORLD); constexpr int size = 3; double a_values[size] = {-12.2692, 6.23918, -12.2692}; double b_values[size] = {0.0850848, -0.17017, 0.0850848}; auto fext = [](const double t) { mfem::Vector force(3); force[0] = -10 * t; force[1] = 0; force[2] = 10 * t * t; return force; }; mfem::Vector a(a_values, size); mfem::Vector b(b_values, size); mfem::Vector c = fext(0.0); mfem::Vector resulta1 = c - a - b; mfem::Vector resulta2 = fext(0.0) - a - b; for (int i = 0; i < size; i++) { EXPECT_DOUBLE_EQ(resulta1[i], resulta2[i]); } MPI_Barrier(MPI_COMM_WORLD); } TEST(expr_templates, addition_commutative) { MPI_Barrier(MPI_COMM_WORLD); constexpr int size = 10; auto [a, b] = sample_vectors(size); mfem::Vector result1 = a + b; mfem::Vector result2 = b + a; for (int i = 0; i < size; i++) { EXPECT_DOUBLE_EQ(result1[i], result2[i]); } MPI_Barrier(MPI_COMM_WORLD); } TEST(expr_templates, scalar_mult_commutative) { MPI_Barrier(MPI_COMM_WORLD); constexpr int size = 10; mfem::Vector a(size); double scalar = 0.3; for (int i = 0; i < size; i++) { a[i] = i * 4 + 1; } mfem::Vector result1 = scalar * a; mfem::Vector result2 = a * scalar; for (int i = 0; i < size; i++) { EXPECT_DOUBLE_EQ(result1[i], result2[i]); } MPI_Barrier(MPI_COMM_WORLD); } TEST(expr_templates, move_from_temp_lambda) { MPI_Barrier(MPI_COMM_WORLD); constexpr int size = 10; auto [lhs, rhs] = sample_vectors(size); mfem::Vector mfem_result(size); add(lhs, 3.5, rhs, mfem_result); auto lambda_add = [](const auto& l, const auto& r) { auto r35 = r * 3.5; return l + std::move(r35); }; mfem::Vector expr_result = lambda_add(lhs, rhs); EXPECT_EQ(mfem_result.Size(), expr_result.Size()); for (int i = 0; i < size; i++) { EXPECT_DOUBLE_EQ(mfem_result[i], expr_result[i]); } MPI_Barrier(MPI_COMM_WORLD); } TEST(expr_templates, move_from_temp_vec_lambda) { MPI_Barrier(MPI_COMM_WORLD); constexpr int size = 10; auto [lhs, rhs] = sample_vectors(size); mfem::Vector mfem_result(size); add(lhs, 3.5, rhs, mfem_result); auto lambda_add = [](const auto& l, const auto& r) { mfem::Vector r35 = r * 3.5; return l + std::move(r35); }; mfem::Vector expr_result = lambda_add(lhs, rhs); EXPECT_EQ(mfem_result.Size(), expr_result.Size()); for (int i = 0; i < size; i++) { EXPECT_DOUBLE_EQ(mfem_result[i], expr_result[i]); } MPI_Barrier(MPI_COMM_WORLD); } TEST(expr_templates, small_matvec) { MPI_Barrier(MPI_COMM_WORLD); constexpr int rows = 10; constexpr int cols = 12; auto [matrix, vec_in] = sample_matvec(rows, cols); mfem::Vector mfem_result(rows); matrix.Mult(vec_in, mfem_result); mfem::Vector expr_result = matrix * vec_in; EXPECT_EQ(mfem_result.Size(), expr_result.Size()); for (int i = 0; i < rows; i++) { EXPECT_DOUBLE_EQ(mfem_result[i], expr_result[i]); } MPI_Barrier(MPI_COMM_WORLD); } TEST(expr_templates, small_mixed_expr) { MPI_Barrier(MPI_COMM_WORLD); constexpr int rows = 10; auto [lhs, rhs] = sample_vectors(rows); constexpr int cols = 12; auto [matrix, vec_in] = sample_matvec(rows, cols); mfem::Vector mfem_result(rows); mfem::Vector expr_result(rows); // -lhs + rhs * 3.0 - 0.3 * (matrix * vec_in) mfem::Vector matvec(rows); matrix.Mult(vec_in, matvec); mfem::Vector vec_negate_scale(rows); add(-1.0, lhs, 3.0, rhs, vec_negate_scale); add(vec_negate_scale, -0.3, matvec, mfem_result); expr_result = -lhs + rhs * 3.0 - 0.3 * (matrix * vec_in); EXPECT_EQ(mfem_result.Size(), expr_result.Size()); for (int i = 0; i < rows; i++) { EXPECT_DOUBLE_EQ(mfem_result[i], expr_result[i]); } MPI_Barrier(MPI_COMM_WORLD); } TEST(expr_templates, small_mixed_expr_single_alloc) { MPI_Barrier(MPI_COMM_WORLD); constexpr int rows = 10; auto [lhs, rhs] = sample_vectors(rows); constexpr int cols = 12; auto [matrix, vec_in] = sample_matvec(rows, cols); mfem::Vector mfem_result(rows); mfem::Vector expr_result(rows); // Scratchpad vectors mfem::Vector matvec(rows); mfem::Vector vec_negate_scale(rows); // -lhs + rhs * 3.0 - 0.3 * (matrix * vec_in) matrix.Mult(vec_in, matvec); add(-1.0, lhs, 3.0, rhs, vec_negate_scale); add(vec_negate_scale, -0.3, matvec, mfem_result); evaluate(-lhs + rhs * 3.0 - 0.3 * (matrix * vec_in), expr_result); EXPECT_EQ(mfem_result.Size(), expr_result.Size()); for (int i = 0; i < rows; i++) { EXPECT_DOUBLE_EQ(mfem_result[i], expr_result[i]); } MPI_Barrier(MPI_COMM_WORLD); } TEST(expr_templates, large_mixed_expr) { MPI_Barrier(MPI_COMM_WORLD); constexpr int rows = 10000; auto [lhs, rhs] = sample_vectors(rows); constexpr int cols = 1200; auto [matrix, vec_in] = sample_matvec(rows, cols); mfem::Vector mfem_result(rows); mfem::Vector expr_result(rows); // -lhs + rhs * 3.0 - 0.3 * (matrix * vec_in) mfem::Vector matvec(rows); matrix.Mult(vec_in, matvec); mfem::Vector vec_negate_scale(rows); add(-1.0, lhs, 3.0, rhs, vec_negate_scale); add(vec_negate_scale, -0.3, matvec, mfem_result); expr_result = -lhs + rhs * 3.0 - 0.3 * (matrix * vec_in); EXPECT_EQ(mfem_result.Size(), expr_result.Size()); for (int i = 0; i < rows; i++) { EXPECT_DOUBLE_EQ(mfem_result[i], expr_result[i]); } MPI_Barrier(MPI_COMM_WORLD); } TEST(expr_templates, complex_expr_lambda) { MPI_Barrier(MPI_COMM_WORLD); constexpr int rows = 10; auto [lhs, rhs] = sample_vectors(rows); constexpr int cols = 12; auto [matrix, vec_in] = sample_matvec(rows, cols); mfem::Vector matvec(rows); matrix.Mult(vec_in, matvec); mfem::Vector vec_negate_scale(rows); add(-1.0, lhs, 3.0, rhs, vec_negate_scale); mfem::Vector mfem_result(rows); add(vec_negate_scale, -0.3, matvec, mfem_result); auto lambda_expr = [](const auto& l, const auto& r, const auto& mat, const auto& vec) { return -l + r * 3.0 - 0.3 * (mat * vec); }; mfem::Vector expr_result = lambda_expr(lhs, rhs, matrix, vec_in); EXPECT_EQ(mfem_result.Size(), expr_result.Size()); for (int i = 0; i < rows; i++) { EXPECT_DOUBLE_EQ(mfem_result[i], expr_result[i]); } MPI_Barrier(MPI_COMM_WORLD); } //------------------------------------------------------------------------------ #include "axom/slic/core/SimpleLogger.hpp" int main(int argc, char* argv[]) { int result = 0; ::testing::InitGoogleTest(&argc, argv); MPI_Init(&argc, &argv); axom::slic::SimpleLogger logger; // create & initialize test logger, finalized when // exiting main scope result = RUN_ALL_TESTS(); MPI_Finalize(); return result; }
26.454545
116
0.640097
btalamini
a3c6c08e62deef0f37c2b741ff04664269344d0b
438
cpp
C++
Source/Life/AI/Considerations/UtilityAiMinConsideration.cpp
PsichiX/Unreal-Systems-Architecture
fb2ccb243c8e79b0890736d611db7ba536937a93
[ "Apache-2.0" ]
5
2022-02-09T21:19:03.000Z
2022-03-03T01:53:03.000Z
Source/Life/AI/Considerations/UtilityAiMinConsideration.cpp
PsichiX/Unreal-Systems-Architecture
fb2ccb243c8e79b0890736d611db7ba536937a93
[ "Apache-2.0" ]
null
null
null
Source/Life/AI/Considerations/UtilityAiMinConsideration.cpp
PsichiX/Unreal-Systems-Architecture
fb2ccb243c8e79b0890736d611db7ba536937a93
[ "Apache-2.0" ]
null
null
null
#include "Life/AI/Considerations/UtilityAiMinConsideration.h" #include "Systems/Public/Iterator.h" float UUtilityAiMinConsideration::Score(AActor* Actor, USystemsWorld& Systems, FUtilityAiMemory& Memory) { return IterStd(this->Considerations) .Fold<float>(INFINITY, [&](const auto Accum, auto& Consideration) { const auto Score = Consideration.Score(Actor, Systems, Memory); return FMath::Min(Accum, Score); }); }
25.764706
67
0.739726
PsichiX
a3d2de25f3a208ee9fa617fb3282779b27e38f55
5,050
cpp
C++
Project/002-QSql_nmea/sqliteoperator.cpp
liukai-tech/Qt-Learning
5f7d29f5868b6fa8b9340095af6cd025f94f698f
[ "MIT" ]
null
null
null
Project/002-QSql_nmea/sqliteoperator.cpp
liukai-tech/Qt-Learning
5f7d29f5868b6fa8b9340095af6cd025f94f698f
[ "MIT" ]
null
null
null
Project/002-QSql_nmea/sqliteoperator.cpp
liukai-tech/Qt-Learning
5f7d29f5868b6fa8b9340095af6cd025f94f698f
[ "MIT" ]
null
null
null
#include "sqliteoperator.h" // 构造函数中初始化数据库对象,并建立数据库 SqliteOperator::SqliteOperator() { if (QSqlDatabase::contains("qt_sql_default_connection")) { m_database = QSqlDatabase::database("qt_sql_default_connection"); } else { // 建立和SQlite数据库的连接 m_database = QSqlDatabase::addDatabase("QSQLITE"); // 设置数据库文件的名字 m_database.setDatabaseName("MyGpsLandDataBase.db"); } } // 打开数据库 bool SqliteOperator::openDb() { if (!m_database.open()) { qDebug() << "Error: Failed to connect database." << m_database.lastError(); } else { // do something } return true; } // 创建数据表 void SqliteOperator::createTable() { // 用于执行sql语句的对象 QSqlQuery sqlQuery; // 构建创建数据库的sql语句字符串 QString createSql = QString("CREATE TABLE gpsland (\ id INT PRIMARY KEY NOT NULL,\ posx REAL NOT NULL,\ posy REAL NOT NULL,\ height FLOAT NOT NULL,\ basehgt FLOAT NOT NULL)"); sqlQuery.prepare(createSql); // 执行sql语句 if(!sqlQuery.exec()) { qDebug() << "Error: Fail to create table. " << sqlQuery.lastError(); } else { qDebug() << "Table created!"; } } // 判断数据库中某个数据表是否存在 bool SqliteOperator::isTableExist(QString& tableName) { QSqlDatabase database = QSqlDatabase::database(); if(database.tables().contains(tableName)) { return true; } return false; } // 查询全部数据 void SqliteOperator::queryTable() { QSqlQuery sqlQuery; sqlQuery.exec("SELECT * FROM gpsland"); if(!sqlQuery.exec()) { qDebug() << "Error: Fail to query table. " << sqlQuery.lastError(); } else { while(sqlQuery.next()) { int id = sqlQuery.value(0).toInt(); double posx = sqlQuery.value(1).toDouble(); double posy = sqlQuery.value(2).toDouble(); float height = sqlQuery.value(3).toFloat(); float basehgt = sqlQuery.value(4).toFloat(); qDebug()<<QString("id:%1 posx:%2 posy:%3 height:%4 basehgt:%5") .arg(id) .arg(posx, 0, 'f', 4, QChar('0')) .arg(posy, 0, 'f', 4, QChar('0')) .arg(height, 0, 'f', 4, QChar('0')) .arg(basehgt, 0, 'f', 4, QChar('0')); } } } // 插入单条数据 void SqliteOperator::singleInsertData(gpslanddb_t &singledb) { QSqlQuery sqlQuery; sqlQuery.prepare("INSERT INTO gpsland VALUES(:id,:posx,:posy,:height,:basehgt)"); sqlQuery.bindValue(":id", singledb.id); sqlQuery.bindValue(":posx", singledb.posx); sqlQuery.bindValue(":posy", singledb.posy); sqlQuery.bindValue(":height", singledb.height); sqlQuery.bindValue(":basehgt", singledb.basehgt); if(!sqlQuery.exec()) { qDebug() << "Error: Fail to insert data. " << sqlQuery.lastError(); } else { // do something } } // 插入多条数据 void SqliteOperator::moreInsertData(QList<gpslanddb_t>& moredb) { // 进行多个数据的插入时,可以利用绑定进行批处理 QSqlQuery sqlQuery; sqlQuery.prepare("INSERT INTO gpsland VALUES(?,?,?,?,?)"); QVariantList idList, posxList, posyList, heightList, basehgtList; for(int i=0; i< moredb.size(); i++) { idList << moredb.at(i).id; posxList << moredb.at(i).posx; posyList << moredb.at(i).posy; heightList << moredb.at(i).height; basehgtList << moredb.at(i).basehgt; } sqlQuery.addBindValue(idList); sqlQuery.addBindValue(posxList); sqlQuery.addBindValue(posyList); sqlQuery.addBindValue(heightList); sqlQuery.addBindValue(basehgtList); if (!sqlQuery.execBatch()) // 进行批处理,如果出错就输出错误 { qDebug() << sqlQuery.lastError(); } } // 修改数据 void SqliteOperator::modifyData(int id, double posx, double posy, float height, float basehgt) { QSqlQuery sqlQuery; sqlQuery.prepare("UPDATE gpsland SET posx=?,posy=?,height=?,basehgt=? WHERE id=?"); sqlQuery.addBindValue(posx); sqlQuery.addBindValue(posy); sqlQuery.addBindValue(height); sqlQuery.addBindValue(basehgt); sqlQuery.addBindValue(id); if(!sqlQuery.exec()) { qDebug() << sqlQuery.lastError(); } else { qDebug() << "updated data success!"; } } // 删除数据 void SqliteOperator::deleteData(int id) { QSqlQuery sqlQuery; sqlQuery.exec(QString("DELETE FROM gpsland WHERE id = %1").arg(id)); if(!sqlQuery.exec()) { qDebug()<<sqlQuery.lastError(); } else { qDebug()<<"deleted data success!"; } } //删除数据表 void SqliteOperator::deleteTable(QString& tableName) { QSqlQuery sqlQuery; sqlQuery.exec(QString("DROP TABLE %1").arg(tableName)); if(sqlQuery.exec()) { qDebug() << sqlQuery.lastError(); } else { qDebug() << "deleted table success"; } } void SqliteOperator::closeDb(void) { m_database.close(); }
24.754902
94
0.582574
liukai-tech
a3d431e6c6e288660d1609e53c84ac24506ebe07
3,534
cc
C++
test/server/hot_restart_impl_test.cc
tgalkovskyi/envoy
9d702c125acde33933fc5d63818b1defe36b5cf3
[ "Apache-2.0" ]
1
2022-01-22T10:01:08.000Z
2022-01-22T10:01:08.000Z
test/server/hot_restart_impl_test.cc
tgalkovskyi/envoy
9d702c125acde33933fc5d63818b1defe36b5cf3
[ "Apache-2.0" ]
null
null
null
test/server/hot_restart_impl_test.cc
tgalkovskyi/envoy
9d702c125acde33933fc5d63818b1defe36b5cf3
[ "Apache-2.0" ]
1
2021-03-13T05:25:47.000Z
2021-03-13T05:25:47.000Z
#include <memory> #include "common/api/os_sys_calls_impl.h" #include "common/api/os_sys_calls_impl_hot_restart.h" #include "common/common/hex.h" #include "server/hot_restart_impl.h" #include "test/mocks/api/hot_restart.h" #include "test/mocks/api/mocks.h" #include "test/mocks/server/mocks.h" #include "test/test_common/logging.h" #include "test/test_common/threadsafe_singleton_injector.h" #include "absl/strings/match.h" #include "absl/strings/string_view.h" #include "gtest/gtest.h" using testing::_; using testing::AnyNumber; using testing::Invoke; using testing::InvokeWithoutArgs; using testing::Return; using testing::WithArg; namespace Envoy { namespace Server { namespace { class HotRestartImplTest : public testing::Test { public: void setup() { EXPECT_CALL(hot_restart_os_sys_calls_, shmUnlink(_)).Times(AnyNumber()); EXPECT_CALL(hot_restart_os_sys_calls_, shmOpen(_, _, _)); EXPECT_CALL(os_sys_calls_, ftruncate(_, _)).WillOnce(WithArg<1>(Invoke([this](off_t size) { buffer_.resize(size); return Api::SysCallIntResult{0, 0}; }))); EXPECT_CALL(os_sys_calls_, mmap(_, _, _, _, _, _)).WillOnce(InvokeWithoutArgs([this]() { return Api::SysCallPtrResult{buffer_.data(), 0}; })); // We bind two sockets: one to talk to parent, one to talk to our (hypothetical eventual) child EXPECT_CALL(os_sys_calls_, bind(_, _, _)).Times(2); // Test we match the correct stat with empty-slots before, after, or both. hot_restart_ = std::make_unique<HotRestartImpl>(0, 0); hot_restart_->drainParentListeners(); // We close both sockets. EXPECT_CALL(os_sys_calls_, close(_)).Times(2); } Api::MockOsSysCalls os_sys_calls_; TestThreadsafeSingletonInjector<Api::OsSysCallsImpl> os_calls{&os_sys_calls_}; Api::MockHotRestartOsSysCalls hot_restart_os_sys_calls_; TestThreadsafeSingletonInjector<Api::HotRestartOsSysCallsImpl> hot_restart_os_calls{ &hot_restart_os_sys_calls_}; std::vector<uint8_t> buffer_; std::unique_ptr<HotRestartImpl> hot_restart_; }; TEST_F(HotRestartImplTest, VersionString) { // Tests that the version-string will be consistent and HOT_RESTART_VERSION, // between multiple instantiations. std::string version; // The mocking infrastructure requires a test setup and teardown every time we // want to re-instantiate HotRestartImpl. { setup(); version = hot_restart_->version(); EXPECT_TRUE(absl::StartsWith(version, fmt::format("{}.", HOT_RESTART_VERSION))) << version; TearDown(); } { setup(); EXPECT_EQ(version, hot_restart_->version()) << "Version string deterministic from options"; TearDown(); } } // Test that HotRestartDomainSocketInUseException is thrown when the domain socket is already // in use, TEST_F(HotRestartImplTest, DomainSocketAlreadyInUse) { EXPECT_CALL(os_sys_calls_, bind(_, _, _)).WillOnce(Return(Api::SysCallIntResult{-1, EADDRINUSE})); EXPECT_CALL(os_sys_calls_, close(_)).Times(1); EXPECT_THROW(std::make_unique<HotRestartImpl>(0, 0), Server::HotRestartDomainSocketInUseException); } // Test that EnvoyException is thrown when the domain socket bind fails for reasons other than // being in use. TEST_F(HotRestartImplTest, DomainSocketError) { EXPECT_CALL(os_sys_calls_, bind(_, _, _)).WillOnce(Return(Api::SysCallIntResult{-1, EACCES})); EXPECT_CALL(os_sys_calls_, close(_)).Times(1); EXPECT_THROW(std::make_unique<HotRestartImpl>(0, 0), EnvoyException); } } // namespace } // namespace Server } // namespace Envoy
33.657143
100
0.739672
tgalkovskyi
a3d463f6bb28527528e8ca37496141e9cc778030
984
cpp
C++
exercises/03_exercise/shared_value_basic.cpp
jrmejiaa/multithreading-cpp
462f24bb3c63e5b7b4bba767ed423beb89bc09b0
[ "MIT" ]
null
null
null
exercises/03_exercise/shared_value_basic.cpp
jrmejiaa/multithreading-cpp
462f24bb3c63e5b7b4bba767ed423beb89bc09b0
[ "MIT" ]
null
null
null
exercises/03_exercise/shared_value_basic.cpp
jrmejiaa/multithreading-cpp
462f24bb3c63e5b7b4bba767ed423beb89bc09b0
[ "MIT" ]
null
null
null
#include <string> #include <thread> int sharedValue = 0; void IncrementSharedValue10000000Times() { int count = 0; while (count < 10000000) { sharedValue++; count++; } } /* * Questions about the code * * a) What would be the expected output of this program? * R/ The expected output of the program would be 20000000 in the * sharedValue variable after both threads has finished. * a.1) Is it consistent between executions? If not, give a reason why. * R/ No, every time that the code is executed, there are problems of consistency with the variable, because * there are two threads trying to access the same global variable at the same time and there are no memory * consistency */ int main(int argc, char *argv[]) { sharedValue = 0; std::thread thread2(IncrementSharedValue10000000Times); IncrementSharedValue10000000Times(); thread2.join(); printf("sharedValue=%d \n", sharedValue); return 0; }
31.741935
113
0.686992
jrmejiaa
a3d835c853e2fbcae3cf94d9085d601ccacd49f2
7,398
cc
C++
src/sys/appmgr/namespace.cc
zarelaky/fuchsia
858cc1914de722b13afc2aaaee8a6bd491cd8d9a
[ "BSD-3-Clause" ]
null
null
null
src/sys/appmgr/namespace.cc
zarelaky/fuchsia
858cc1914de722b13afc2aaaee8a6bd491cd8d9a
[ "BSD-3-Clause" ]
null
null
null
src/sys/appmgr/namespace.cc
zarelaky/fuchsia
858cc1914de722b13afc2aaaee8a6bd491cd8d9a
[ "BSD-3-Clause" ]
null
null
null
// Copyright 2016 The Fuchsia Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "src/sys/appmgr/namespace.h" #include <fuchsia/process/cpp/fidl.h> #include <fuchsia/sys/internal/cpp/fidl.h> #include <lib/async/default.h> #include <lib/fdio/directory.h> #include <lib/fdio/fd.h> #include <lib/fdio/fdio.h> #include <utility> #include <trace/event.h> #include "src/sys/appmgr/job_provider_impl.h" #include "src/sys/appmgr/realm.h" #include "src/sys/appmgr/util.h" namespace component { Namespace::Namespace(fxl::RefPtr<Namespace> parent, fxl::WeakPtr<Realm> realm, fuchsia::sys::ServiceListPtr additional_services, const std::vector<std::string>* service_whitelist) : vfs_(async_get_default_dispatcher()), services_(fbl::AdoptRef(new ServiceProviderDirImpl(service_whitelist))), job_provider_(fbl::AdoptRef(new JobProviderImpl(realm.get()))), realm_(std::move(realm)) { // WARNING! Do not add new services here! This makes services available in all // component namespaces ambiently without requiring proper routing between // realms, and this list should not be expanded. services_->AddService( fuchsia::sys::Environment::Name_, fbl::AdoptRef(new fs::Service([this](zx::channel channel) { environment_bindings_.AddBinding( this, fidl::InterfaceRequest<fuchsia::sys::Environment>(std::move(channel))); return ZX_OK; }))); services_->AddService(Launcher::Name_, fbl::AdoptRef(new fs::Service([this](zx::channel channel) { launcher_bindings_.AddBinding( this, fidl::InterfaceRequest<Launcher>(std::move(channel))); return ZX_OK; }))); services_->AddService( fuchsia::process::Launcher::Name_, fbl::AdoptRef(new fs::Service([this](zx::channel channel) { realm_->environment_services()->Connect( fidl::InterfaceRequest<fuchsia::process::Launcher>(std::move(channel))); return ZX_OK; }))); services_->AddService( fuchsia::process::Resolver::Name_, fbl::AdoptRef(new fs::Service([this](zx::channel channel) { resolver_bindings_.AddBinding( this, fidl::InterfaceRequest<fuchsia::process::Resolver>(std::move(channel))); return ZX_OK; }))); // WARNING! Do not add new services here! This makes services available in all // component namespaces ambiently without requiring proper routing between // realms, and this list should not be expanded. if (additional_services) { auto& names = additional_services->names; service_provider_ = additional_services->provider.Bind(); service_host_directory_ = std::move(additional_services->host_directory); for (auto& name : names) { if (service_host_directory_) { services_->AddService(name, fbl::AdoptRef(new fs::Service([this, name](zx::channel channel) { fdio_service_connect_at(service_host_directory_.get(), name.c_str(), channel.release()); return ZX_OK; }))); } else { services_->AddService(name, fbl::AdoptRef(new fs::Service([this, name](zx::channel channel) { service_provider_->ConnectToService(name, std::move(channel)); return ZX_OK; }))); } } } // If any services in |parent| share a name with |additional_services|, // |additional_services| takes priority. if (parent) { services_->set_parent(parent->services()); } } Namespace::~Namespace() {} void Namespace::AddBinding(fidl::InterfaceRequest<fuchsia::sys::Environment> environment) { environment_bindings_.AddBinding(this, std::move(environment)); } void Namespace::CreateNestedEnvironment( fidl::InterfaceRequest<fuchsia::sys::Environment> environment, fidl::InterfaceRequest<fuchsia::sys::EnvironmentController> controller, std::string label, fuchsia::sys::ServiceListPtr additional_services, fuchsia::sys::EnvironmentOptions options) { realm_->CreateNestedEnvironment(std::move(environment), std::move(controller), std::move(label), std::move(additional_services), options); } void Namespace::GetLauncher(fidl::InterfaceRequest<Launcher> launcher) { launcher_bindings_.AddBinding(this, std::move(launcher)); } void Namespace::GetServices(fidl::InterfaceRequest<fuchsia::sys::ServiceProvider> services) { services_->AddBinding(std::move(services)); } zx_status_t Namespace::ServeServiceDirectory(zx::channel directory_request) { return vfs_.ServeDirectory(services_, std::move(directory_request)); } void Namespace::CreateComponent( fuchsia::sys::LaunchInfo launch_info, fidl::InterfaceRequest<fuchsia::sys::ComponentController> controller) { auto cc_trace_id = TRACE_NONCE(); TRACE_ASYNC_BEGIN("appmgr", "Namespace::CreateComponent", cc_trace_id, "launch_info.url", launch_info.url); realm_->CreateComponent(std::move(launch_info), std::move(controller), [cc_trace_id](std::weak_ptr<ComponentControllerImpl> component) { TRACE_ASYNC_END("appmgr", "Namespace::CreateComponent", cc_trace_id); }); } zx::channel Namespace::OpenServicesAsDirectory() { return Util::OpenAsDirectory(&vfs_, services_); } void Namespace::Resolve(std::string name, fuchsia::process::Resolver::ResolveCallback callback) { realm_->Resolve(name, std::move(callback)); } void Namespace::NotifyComponentDiagnosticsDirReady( const std::string& component_url, const std::string& component_name, const std::string& component_id, fidl::InterfaceHandle<fuchsia::io::Directory> directory) { if (realm_) { realm_->NotifyComponentDiagnosticsDirReady(component_url, component_name, component_id, std::move(directory)); } } void Namespace::NotifyComponentStarted(const std::string& component_url, const std::string& component_name, const std::string& component_id) { if (realm_) { realm_->NotifyComponentStarted(component_url, component_name, component_id); } } void Namespace::NotifyComponentStopped(const std::string& component_url, const std::string& component_name, const std::string& component_id) { if (realm_) { realm_->NotifyComponentStopped(component_url, component_name, component_id); } } void Namespace::MaybeAddComponentEventProvider() { if (services_->IsServiceWhitelisted(fuchsia::sys::internal::ComponentEventProvider::Name_)) { services_->AddService( fuchsia::sys::internal::ComponentEventProvider::Name_, fbl::AdoptRef(new fs::Service([this](zx::channel channel) { return realm_->BindComponentEventProvider( fidl::InterfaceRequest<fuchsia::sys::internal::ComponentEventProvider>( std::move(channel))); }))); } } } // namespace component
42.763006
100
0.655447
zarelaky
a3d9563dfb39a4c9a1a5eae6020d8bcb1ddff240
2,014
cpp
C++
src/noncryptographic/saxhash32.cpp
namralkeeg/QHashlib
5b4fdb33833b6b0a1856c87a6d4696371aecfe59
[ "MIT" ]
null
null
null
src/noncryptographic/saxhash32.cpp
namralkeeg/QHashlib
5b4fdb33833b6b0a1856c87a6d4696371aecfe59
[ "MIT" ]
null
null
null
src/noncryptographic/saxhash32.cpp
namralkeeg/QHashlib
5b4fdb33833b6b0a1856c87a6d4696371aecfe59
[ "MIT" ]
null
null
null
/* * Copyright (C) 2017 Larry Lopez * * 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. */ #include <noncryptographic/saxhash32.hpp> #include <QDataStream> namespace QHashlib { namespace noncryptographic { SaxHash32::SaxHash32() { initialize(); } QByteArray SaxHash32::hashFinal() { QByteArray qba; QDataStream stream(&qba, QIODevice::WriteOnly); // Make sure the data is Big-Endian stream.setByteOrder(QDataStream::BigEndian); stream << m_hash; return qba; } quint32 SaxHash32::hashSize() { return m_hashSize; } void SaxHash32::initialize() { m_hash = 0; m_hashValue.clear(); } void SaxHash32::hashCore(const void *data, const quint64 &dataLength, const quint64 &startIndex) { const quint8 *current = static_cast<const quint8*>(data) + startIndex; for (quint64 i = 0; i < dataLength; ++current, ++i) { m_hash ^= (m_hash << 5) + (m_hash >> 2) + *current; } } } // namespace noncryptographic } // namespace QHashlib
30.059701
96
0.722443
namralkeeg
a3dabcc99e138135f320eab79e1863896ef03b75
36,933
cc
C++
test/regression/set_pose_loop.cc
thomas-moulard/gazebo-deb
456da84cfb7b0bdac53241f6c4e86ffe1becfa7d
[ "ECL-2.0", "Apache-2.0" ]
8
2015-07-02T08:23:30.000Z
2020-11-17T19:00:38.000Z
test/regression/set_pose_loop.cc
thomas-moulard/gazebo-deb
456da84cfb7b0bdac53241f6c4e86ffe1becfa7d
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
test/regression/set_pose_loop.cc
thomas-moulard/gazebo-deb
456da84cfb7b0bdac53241f6c4e86ffe1becfa7d
[ "ECL-2.0", "Apache-2.0" ]
10
2015-04-22T18:33:15.000Z
2021-11-16T10:17:45.000Z
/* * Copyright 2012 Open Source Robotics Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ #include "ServerFixture.hh" #include "physics/physics.hh" using namespace gazebo; class PhysicsTest : public ServerFixture { }; TEST_F(PhysicsTest, State) { srand(time(NULL)); int seed = time(NULL); { // intentionally break the joint using Link::SetWorldPose // let it conflict with Physics pose updates and make sure // internal model state stays consistent Load("worlds/empty.world"); physics::WorldPtr world = physics::get_world("default"); world->SetPaused(true); EXPECT_TRUE(world != NULL); physics::WorldState worldState = world->GetState(); physics::ModelState modelState = worldState.GetModelState(0); physics::LinkState linkState = modelState.GetLinkState(0); { msgs::Factory msg; std::ostringstream newModelStr; math::Pose pose(0, 0, 3, 0, 0, 0); math::Vector3 size(1.0, 0.1, 0.1); newModelStr << "<gazebo version='" << SDF_VERSION << "'>\n" << " <model name='model_1'>\n" << " <pose>" << pose << "</pose>\n" << " <link name='link_1'>\n" << " <pose>0 0 0 0 0 0</pose>\n" << " <inertial>\n" << " <pose>0.5 0 0 0 0 0</pose>\n" << " <mass>1</mass>\n" << " <inertia>\n" << " <ixx>1</ixx>\n" << " <ixy>0</ixy>\n" << " <ixz>0</ixz>\n" << " <iyy>1</iyy>\n" << " <iyz>0</iyz>\n" << " <izz>1</izz>\n" << " </inertia>\n" << " </inertial>\n" << " <collision name ='collision'>\n" << " <pose>0.5 0 0 0 0 0</pose>\n" << " <geometry>\n" << " <box>\n" << " <size>" << size.x << " " << size.y << " " << size.z << "</size>\n" << " </box>\n" << " </geometry>\n" << " </collision>\n" << " <visual name ='visual'>\n" << " <pose>0.5 0 0 0 0 0</pose>\n" << " <geometry>\n" << " <box>\n" << " <size>" << size.x << " " << size.y << " " << size.z << "</size>\n" << " </box>\n" << " </geometry>\n" << " <material><script>Gazebo/Grey</script></material>\n" << " </visual>\n" << " </link>\n" << " <link name='link_2'>\n" << " <pose>1 0 0 0 0 0</pose>\n" << " <inertial>\n" << " <pose>0.5 0 0 0 0 0</pose>\n" << " <mass>1</mass>\n" << " <inertia>\n" << " <ixx>1</ixx>\n" << " <ixy>0</ixy>\n" << " <ixz>0</ixz>\n" << " <iyy>1</iyy>\n" << " <iyz>0</iyz>\n" << " <izz>1</izz>\n" << " </inertia>\n" << " </inertial>\n" << " <collision name ='collision'>\n" << " <pose>0.5 0 0 0 0 0</pose>\n" << " <geometry>\n" << " <box>\n" << " <size>" << size.x << " " << size.y << " " << size.z << "</size>\n" << " </box>\n" << " </geometry>\n" << " </collision>\n" << " <visual name ='visual'>\n" << " <pose>0.5 0 0 0 0 0</pose>\n" << " <geometry>\n" << " <box>\n" << " <size>" << size.x << " " << size.y << " " << size.z << "</size>\n" << " </box>\n" << " </geometry>\n" << " <material><script>Gazebo/Grey</script></material>\n" << " </visual>\n" << " </link>\n" << " <joint name='joint_01' type='revolute'>\n" << " <parent>world</parent>\n" << " <child>link_1</child>\n" << " <axis>\n" << " <xyz>1 1 0</xyz>\n" << " <limit>\n" << " <upper>0.7071</upper>\n" << " <lower>-0.7071</lower>\n" << " </limit>\n" << " </axis>\n" << " </joint>\n" << " <joint name='joint_12' type='revolute'>\n" << " <parent>link_1</parent>\n" << " <child>link_2</child>\n" << " <axis>\n" << " <xyz>1 -1 0</xyz>\n" << " <limit>\n" << " <upper>0.7071</upper>\n" << " <lower>-0.7071</lower>\n" << " </limit>\n" << " </axis>\n" << " </joint>\n" << " <link name='link_3'>\n" << " <pose>2 0 0 0 0 " << 0.5*M_PI << "</pose>\n" << " <inertial>\n" << " <pose>0.5 0 0 0 0 0</pose>\n" << " <mass>1</mass>\n" << " <inertia>\n" << " <ixx>1</ixx>\n" << " <ixy>0</ixy>\n" << " <ixz>0</ixz>\n" << " <iyy>1</iyy>\n" << " <iyz>0</iyz>\n" << " <izz>1</izz>\n" << " </inertia>\n" << " </inertial>\n" << " <collision name ='collision'>\n" << " <pose>0.5 0 0 0 0 0</pose>\n" << " <geometry>\n" << " <box>\n" << " <size>" << size.x << " " << size.y << " " << size.z << "</size>\n" << " </box>\n" << " </geometry>\n" << " </collision>\n" << " <visual name ='visual'>\n" << " <pose>0.5 0 0 0 0 0</pose>\n" << " <geometry>\n" << " <box>\n" << " <size>" << size.x << " " << size.y << " " << size.z << "</size>\n" << " </box>\n" << " </geometry>\n" << " <material><script>Gazebo/Grey</script></material>\n" << " </visual>\n" << " </link>\n" << " <joint name='joint_23' type='revolute'>\n" << " <parent>link_2</parent>\n" << " <child>link_3</child>\n" << " <axis>\n" << " <xyz>0 0 1</xyz>\n" << " <limit>\n" << " <upper>0.7071</upper>\n" << " <lower>-0.7071</lower>\n" << " </limit>\n" << " </axis>\n" << " </joint>\n" << " <link name='link_4'>\n" << " <pose>2 1 0 0 0 " << M_PI << "</pose>\n" << " <inertial>\n" << " <pose>0.5 0 0 0 0 0</pose>\n" << " <mass>1</mass>\n" << " <inertia>\n" << " <ixx>1</ixx>\n" << " <ixy>0</ixy>\n" << " <ixz>0</ixz>\n" << " <iyy>1</iyy>\n" << " <iyz>0</iyz>\n" << " <izz>1</izz>\n" << " </inertia>\n" << " </inertial>\n" << " <collision name ='collision'>\n" << " <pose>0.5 0 0 0 0 0</pose>\n" << " <geometry>\n" << " <box>\n" << " <size>" << size.x << " " << size.y << " " << size.z << "</size>\n" << " </box>\n" << " </geometry>\n" << " </collision>\n" << " <visual name ='visual'>\n" << " <pose>0.5 0 0 0 0 0</pose>\n" << " <geometry>\n" << " <box>\n" << " <size>" << size.x << " " << size.y << " " << size.z << "</size>\n" << " </box>\n" << " </geometry>\n" << " <material><script>Gazebo/Grey</script></material>\n" << " </visual>\n" << " </link>\n" << " <joint name='joint_34' type='revolute'>\n" << " <parent>link_3</parent>\n" << " <child>link_4</child>\n" << " <axis>\n" << " <xyz>0 0 1</xyz>\n" << " <limit>\n" << " <upper>0.7071</upper>\n" << " <lower>-0.7071</lower>\n" << " </limit>\n" << " </axis>\n" << " </joint>\n" << " <link name='link_5'>\n" << " <pose>1 1 0 0 0 " << 1.5*M_PI << "</pose>\n" << " <inertial>\n" << " <pose>0.5 0 0 0 0 0</pose>\n" << " <mass>1</mass>\n" << " <inertia>\n" << " <ixx>1</ixx>\n" << " <ixy>0</ixy>\n" << " <ixz>0</ixz>\n" << " <iyy>1</iyy>\n" << " <iyz>0</iyz>\n" << " <izz>1</izz>\n" << " </inertia>\n" << " </inertial>\n" << " <collision name ='collision'>\n" << " <pose>0.5 0 0 0 0 0</pose>\n" << " <geometry>\n" << " <box>\n" << " <size>" << size.x << " " << size.y << " " << size.z << "</size>\n" << " </box>\n" << " </geometry>\n" << " </collision>\n" << " <visual name ='visual'>\n" << " <pose>0.5 0 0 0 0 0</pose>\n" << " <geometry>\n" << " <box>\n" << " <size>" << size.x << " " << size.y << " " << size.z << "</size>\n" << " </box>\n" << " </geometry>\n" << " <material><script>Gazebo/Grey</script></material>\n" << " </visual>\n" << " </link>\n" << " <joint name='joint_45' type='revolute'>\n" << " <parent>link_4</parent>\n" << " <child>link_5</child>\n" << " <axis>\n" << " <xyz>0 0 1</xyz>\n" << " <limit>\n" << " <upper>0.7071</upper>\n" << " <lower>-0.7071</lower>\n" << " </limit>\n" << " </axis>\n" << " </joint>\n" << " <joint name='joint_52' type='revolute'>\n" << " <parent>link_5</parent>\n" << " <child>link_2</child>\n" << " <axis>\n" << " <xyz>0 0 1</xyz>\n" << " <limit>\n" << " <upper>0.7071</upper>\n" << " <lower>-0.7071</lower>\n" << " </limit>\n" << " </axis>\n" << " </joint>\n" << " </model>\n" << "</gazebo>\n"; msg.set_sdf(newModelStr.str()); transport::PublisherPtr factoryPub = this->node->Advertise<msgs::Factory>("~/factory"); this->factoryPub->Publish(msg); } physics::ModelPtr model = world->GetModel("model_1"); while (!model) { model = world->GetModel("model_1"); gzdbg << "waiting for model_1 to spawn\n"; sleep(1); } world->SetPaused(false); double start_time; double start_wall_time; double test_duration; double pub_rate; double last_update_time; double elapsed_wall_time; physics::JointPtr joint_01 = model->GetJoint("model_1::joint_01"); physics::JointPtr joint_12 = model->GetJoint("model_1::joint_12"); physics::JointPtr joint_23 = model->GetJoint("model_1::joint_23"); physics::JointPtr joint_34 = model->GetJoint("model_1::joint_34"); physics::JointPtr joint_45 = model->GetJoint("model_1::joint_45"); physics::JointPtr joint_52 = model->GetJoint("model_1::joint_52"); start_time = world->GetSimTime().Double(); start_wall_time = world->GetRealTime().Double(); test_duration = 10; pub_rate = 10.0; gzdbg << " -------------------------------------------------------------\n"; gzdbg << " Publishing Joint::SetAngle at [" << pub_rate << "] Hz.\n"; last_update_time = start_time; while (world->GetSimTime().Double() < start_time + test_duration) if (world->GetSimTime().Double() - last_update_time >= (1.0/pub_rate)) { last_update_time = world->GetSimTime().Double(); // gzdbg << "setting link poses without violation\n"; // double cur_time = world->GetSimTime().Double(); joint_01->SetAngle(0, 0.1); joint_12->SetAngle(0, 0.1); joint_23->SetAngle(0, 0.1); joint_34->SetAngle(0, 0.1); joint_45->SetAngle(0, 0.1); joint_52->SetAngle(0, 0.1); joint_01->SetAngle(0, 0.2); joint_12->SetAngle(0, 0.2); joint_23->SetAngle(0, 0.2); joint_34->SetAngle(0, 0.2); joint_45->SetAngle(0, 0.2); joint_52->SetAngle(0, 0.2); } elapsed_wall_time = world->GetRealTime().Double() - start_wall_time; gzdbg << " elapsed sim time [" << test_duration << "] elapsed wall time [" << elapsed_wall_time << "] sim performance [" << test_duration / elapsed_wall_time << "]\n"; world->EnablePhysicsEngine(false); start_time = world->GetSimTime().Double(); start_wall_time = world->GetRealTime().Double(); test_duration = 20; pub_rate = 10.0; gzdbg << " -------------------------------------------------------------\n"; gzdbg << " Publishing Joint::SetAngle at [" << pub_rate << "] Hz with real time duration.\n"; last_update_time = start_wall_time; while (world->GetRealTime().Double() < start_wall_time + test_duration) if (world->GetRealTime().Double() - last_update_time >= (1.0/pub_rate)) { last_update_time = world->GetRealTime().Double(); joint_01->SetAngle(0, static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX)); joint_12->SetAngle(0, static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX)); joint_23->SetAngle(0, static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX)); joint_34->SetAngle(0, static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX)); joint_45->SetAngle(0, static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX)); joint_52->SetAngle(0, static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX)); sleep(1); } test_duration = world->GetSimTime().Double() - start_time; elapsed_wall_time = world->GetRealTime().Double() - start_wall_time; gzdbg << " elapsed sim time [" << test_duration << "] elapsed wall time [" << elapsed_wall_time << "] sim performance [" << test_duration / elapsed_wall_time << "]\n"; world->EnablePhysicsEngine(true); physics::LinkPtr link_1 = model->GetLink("link_1"); physics::LinkPtr link_2 = model->GetLink("link_2"); physics::LinkPtr link_3 = model->GetLink("link_3"); physics::LinkPtr link_4 = model->GetLink("link_4"); physics::LinkPtr link_5 = model->GetLink("link_5"); EXPECT_TRUE(link_1 != NULL); start_time = world->GetSimTime().Double(); start_wall_time = world->GetRealTime().Double(); test_duration = 10; pub_rate = 2.0; gzdbg << " -------------------------------------------------------------\n"; gzdbg << " Publishing SetWorld Pose at [" << pub_rate << "] Hz without constraint violation.\n"; last_update_time = start_time; while (world->GetSimTime().Double() < start_time + test_duration) if (world->GetSimTime().Double() - last_update_time >= (1.0/pub_rate)) { // gzdbg << "setting link poses without violation\n"; // double cur_time = world->GetSimTime().Double(); last_update_time = world->GetSimTime().Double(); link_1->SetWorldPose(math::Pose(0, 0, 3, 0, 0, 0)); link_2->SetWorldPose(math::Pose(1.00, 0, 3, 0, 0, 0)); link_3->SetWorldPose(math::Pose(2.00, 0, 3, 0, 0.5*M_PI, 0)); link_4->SetWorldPose(math::Pose(2.00, 1, 3, 0, 1.0*M_PI, 0)); link_5->SetWorldPose(math::Pose(1.00, 1, 3, 0, 1.5*M_PI, 0)); } elapsed_wall_time = world->GetRealTime().Double() - start_wall_time; gzdbg << " elapsed sim time [" << test_duration << "] elapsed wall time [" << elapsed_wall_time << "] sim performance [" << test_duration / elapsed_wall_time << "]\n"; start_time = world->GetSimTime().Double(); start_wall_time = world->GetRealTime().Double(); test_duration = 10; pub_rate = 1.0; gzdbg << " -------------------------------------------------------------\n"; gzdbg << " Publishing SetWorld Pose at [" << pub_rate << "] Hz without constraint violation.\n"; last_update_time = start_time; while (world->GetSimTime().Double() < start_time + test_duration) if (world->GetSimTime().Double() - last_update_time >= (1.0/pub_rate)) { last_update_time = world->GetSimTime().Double(); // gzdbg << "setting link poses without violation\n"; // double cur_time = world->GetSimTime().Double(); link_1->SetWorldPose(math::Pose(0, 0, 3, 0, 0, 0)); link_2->SetWorldPose(math::Pose(1.00, 0, 3, 0, 0, 0)); link_3->SetWorldPose(math::Pose(2.00, 0, 3, 0, 0.5*M_PI, 0)); link_4->SetWorldPose(math::Pose(2.00, 1, 3, 0, 1.0*M_PI, 0)); link_5->SetWorldPose(math::Pose(1.00, 1, 3, 0, 1.5*M_PI, 0)); } elapsed_wall_time = world->GetRealTime().Double() - start_wall_time; gzdbg << " elapsed sim time [" << test_duration << "] elapsed wall time [" << elapsed_wall_time << "] sim performance [" << test_duration / elapsed_wall_time << "]\n"; // set random pose within joint limit start_time = world->GetSimTime().Double(); start_wall_time = world->GetRealTime().Double(); test_duration = 20; pub_rate = 2.0; gzdbg << " -------------------------------------------------------------\n"; gzdbg << " Publishing SetWorld Pose at [" << pub_rate << "] Hz with less constraint violation.\n"; last_update_time = start_time; while (world->GetSimTime().Double() < start_time + test_duration) // if (world->GetSimTime().Double() - last_update_time >= (1.0/pub_rate)) { last_update_time = world->GetSimTime().Double(); math::Pose p; p = math::Pose( static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX) + 3.0, static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX)); link_1->SetWorldPose(p); p = math::Pose( static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX) + 1.0, static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX) + 3.0, static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX)); link_2->SetWorldPose(p); p = math::Pose( static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX) + 2.0, static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/ static_cast<double>(RAND_MAX) + 3.0, static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/ static_cast<double>(RAND_MAX) + 0.5*M_PI, static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX)); link_3->SetWorldPose(p); p = math::Pose( static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX) + 2.0, static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX) + 1.0, static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX) + 3.0, static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/ static_cast<double>(RAND_MAX) + M_PI, static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX)); link_4->SetWorldPose(p); p = math::Pose( static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX) + 1.0, static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX) + 1.0, static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX) + 3.0, static_cast<double>(rand_r(seed))/ static_cast<double>(RAND_MAX) + 1.5*M_PI, static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX)); link_5->SetWorldPose(p); math::Vector3 v; v = math::Vector3( static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX)); link_1->SetAngularVel(v); v = math::Vector3( static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX)); link_1->SetLinearVel(v); v = math::Vector3( static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX)); link_2->SetAngularVel(v); v = math::Vector3( static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX)); link_2->SetLinearVel(v); v = math::Vector3( static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX)); link_3->SetAngularVel(v); v = math::Vector3( static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX)); link_3->SetLinearVel(v); v = math::Vector3( static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX)); link_4->SetAngularVel(v); v = math::Vector3( static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX)); link_4->SetLinearVel(v); v = math::Vector3( static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX)); link_5->SetAngularVel(v); v = math::Vector3( static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX)); link_5->SetLinearVel(v); } elapsed_wall_time = world->GetRealTime().Double() - start_wall_time; gzdbg << " elapsed sim time [" << test_duration << "] elapsed wall time [" << elapsed_wall_time << "] sim performance [" << test_duration / elapsed_wall_time << "]\n"; // set random pose outside of joint limit start_time = world->GetSimTime().Double(); start_wall_time = world->GetRealTime().Double(); test_duration = 20; pub_rate = 1000.0; gzdbg << " -------------------------------------------------------------\n"; gzdbg << " Publishing SetWorld Pose at [" << pub_rate << "] Hz with more random constraint violation.\n"; last_update_time = start_time; while (world->GetSimTime().Double() < start_time + test_duration) if (world->GetSimTime().Double() - last_update_time >= (1.0/pub_rate)) { last_update_time = world->GetSimTime().Double(); math::Pose p; p = math::Pose( static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/ static_cast<double>(RAND_MAX) + 3.0, static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/ static_cast<double>(RAND_MAX) + 1.57079, static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX)); link_1->SetWorldPose(p); p = math::Pose( static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/ static_cast<double>(RAND_MAX) + 2.0, static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/ static_cast<double>(RAND_MAX) + 1.57079, static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX)); link_2->SetWorldPose(p); p = math::Pose( static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/ static_cast<double>(RAND_MAX) + 1.0, static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/ static_cast<double>(RAND_MAX) + 1.57079, static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX)); link_3->SetWorldPose(p); p = math::Pose( static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/ static_cast<double>(RAND_MAX) + 1.0, static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/ static_cast<double>(RAND_MAX) + 1.57079, static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX)); link_4->SetWorldPose(p); p = math::Pose( static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/ static_cast<double>(RAND_MAX) + 1.0, static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/ static_cast<double>(RAND_MAX) + 1.57079, static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX)); link_5->SetWorldPose(p); math::Vector3 v; v = math::Vector3( static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX)); link_1->SetAngularVel(v); v = math::Vector3( static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX)); link_1->SetLinearVel(v); v = math::Vector3( static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX)); link_2->SetAngularVel(v); v = math::Vector3( static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX)); link_2->SetLinearVel(v); v = math::Vector3( static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX)); link_3->SetAngularVel(v); v = math::Vector3( static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX)); link_3->SetLinearVel(v); v = math::Vector3( static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX)); link_4->SetAngularVel(v); v = math::Vector3( static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX)); link_4->SetLinearVel(v); v = math::Vector3( static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX)); link_5->SetAngularVel(v); v = math::Vector3( static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX)); link_5->SetLinearVel(v); } elapsed_wall_time = world->GetRealTime().Double() - start_wall_time; gzdbg << " elapsed sim time [" << test_duration << "] elapsed wall time [" << elapsed_wall_time << "] sim performance [" << test_duration / elapsed_wall_time << "]\n"; start_time = world->GetSimTime().Double(); start_wall_time = world->GetRealTime().Double(); test_duration = 10; pub_rate = 1000.0; gzdbg << " -------------------------------------------------------------\n"; gzdbg << " Publishing Set*Vel at [" << pub_rate << "] Hz with random velocities.\n"; last_update_time = start_time; while (world->GetSimTime().Double() < start_time + test_duration) if (world->GetSimTime().Double() - last_update_time >= (1.0/pub_rate)) { last_update_time = world->GetSimTime().Double(); // gzdbg << "setting link poses with violation\n"; math::Vector3 v; v = math::Vector3( static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX)); link_1->SetAngularVel(v); v = math::Vector3( static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX)); link_1->SetLinearVel(v); v = math::Vector3( static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX)); link_2->SetAngularVel(v); v = math::Vector3( static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX)); link_2->SetLinearVel(v); v = math::Vector3( static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX)); link_3->SetAngularVel(v); v = math::Vector3( static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX)); link_3->SetLinearVel(v); v = math::Vector3( static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX)); link_4->SetAngularVel(v); v = math::Vector3( static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX)); link_4->SetLinearVel(v); v = math::Vector3( static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX)); link_5->SetAngularVel(v); v = math::Vector3( static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX), static_cast<double>(rand_r(seed))/static_cast<double>(RAND_MAX)); link_5->SetLinearVel(v); } elapsed_wall_time = world->GetRealTime().Double() - start_wall_time; gzdbg << " elapsed sim time [" << test_duration << "] elapsed wall time [" << elapsed_wall_time << "] sim performance [" << test_duration / elapsed_wall_time << "]\n"; start_time = world->GetSimTime().Double(); start_wall_time = world->GetRealTime().Double(); test_duration = 20; pub_rate = 500.0; gzdbg << " -------------------------------------------------------------\n"; gzdbg << " Publishing Set*Vel at [" << pub_rate << "] Hz with velocity decay.\n"; last_update_time = start_time; while (world->GetSimTime().Double() < start_time + test_duration) if (world->GetSimTime().Double() - last_update_time >= (1.0/pub_rate)) { last_update_time = world->GetSimTime().Double(); // gzdbg << "setting link poses with violation\n"; link_1->SetAngularVel(link_1->GetWorldAngularVel() * 0.999); link_1->SetLinearVel(link_1->GetWorldLinearVel() * 0.999); link_2->SetAngularVel(link_2->GetWorldAngularVel() * 0.999); link_2->SetLinearVel(link_2->GetWorldLinearVel() * 0.999); link_3->SetAngularVel(link_3->GetWorldAngularVel() * 0.999); link_3->SetLinearVel(link_3->GetWorldLinearVel() * 0.999); link_4->SetAngularVel(link_4->GetWorldAngularVel() * 0.999); link_4->SetLinearVel(link_4->GetWorldLinearVel() * 0.999); link_5->SetAngularVel(link_5->GetWorldAngularVel() * 0.999); link_5->SetLinearVel(link_5->GetWorldLinearVel() * 0.999); } elapsed_wall_time = world->GetRealTime().Double() - start_wall_time; gzdbg << " elapsed sim time [" << test_duration << "] elapsed wall time [" << elapsed_wall_time << "] sim performance [" << test_duration / elapsed_wall_time << "]\n"; EXPECT_EQ(link_3->GetWorldPose(), math::Pose(0.292968, 0.612084, 1.43649, -2.07141, 1.50881, -1.19487)); Unload(); } } int main(int argc, char **argv) { ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); }
44.17823
80
0.536323
thomas-moulard
a3db470873a4820096db369972629f375adac459
1,888
hpp
C++
include/fdeep/shape3_variable.hpp
chammika/frugally-deep
6c0b03efcb05cf5ace17e2f74c369ee44f95817a
[ "MIT" ]
1
2018-12-05T22:43:05.000Z
2018-12-05T22:43:05.000Z
include/fdeep/shape3_variable.hpp
szad670401/frugally-deep
c84d256f49e41b213d740999140dd7099a853491
[ "MIT" ]
null
null
null
include/fdeep/shape3_variable.hpp
szad670401/frugally-deep
c84d256f49e41b213d740999140dd7099a853491
[ "MIT" ]
null
null
null
// Copyright 2016, Tobias Hermann. // https://github.com/Dobiasd/frugally-deep // Distributed under the MIT License. // (See accompanying LICENSE file or at // https://opensource.org/licenses/MIT) #pragma once #include "fdeep/common.hpp" #include "fdeep/shape2_variable.hpp" #include "fdeep/shape2.hpp" #include <algorithm> #include <cstddef> #include <cstdlib> #include <string> #include <vector> namespace fdeep { namespace internal { class shape3_variable { public: explicit shape3_variable( fplus::maybe<std::size_t> depth, fplus::maybe<std::size_t> height, fplus::maybe<std::size_t> width) : depth_(depth), height_(height), width_(width) { } shape2_variable without_depth() const { return shape2_variable(height_, width_); } fplus::maybe<std::size_t> depth_; fplus::maybe<std::size_t> height_; fplus::maybe<std::size_t> width_; }; inline bool operator == (const shape3_variable& lhs, const shape3_variable& rhs) { return lhs.depth_ == rhs.depth_ && lhs.height_ == rhs.height_ && lhs.width_ == rhs.width_; } inline bool operator != (const shape3_variable& lhs, const shape3_variable& rhs) { return !(lhs == rhs); } } // namespace internal using shape3_variable = internal::shape3_variable; inline std::string show_shape3_variable(const shape3_variable& s) { const std::vector<fplus::maybe<std::size_t>> dimensions = {s.depth_, s.height_, s.width_}; const auto dimensions_repr = fplus::transform( fplus::show_maybe<std::size_t>, dimensions); return fplus::show_cont_with_frame(", ", "(", ")", dimensions_repr); } inline std::string show_shape3s_variable( const std::vector<shape3_variable>& shapes) { return fplus::show_cont(fplus::transform(show_shape3_variable, shapes)); } } // namespace fdeep
23.898734
80
0.675847
chammika
a3de061695c75e2defbd16e3c7cfa7f53c2ea63a
1,148
cc
C++
sentinel-core/transport/command/command_request_test.cc
windrunner123/sentinel-cpp
7957e692466db0b7b83b7218602757113e9f2d22
[ "Apache-2.0" ]
121
2019-02-22T06:50:31.000Z
2022-01-22T23:23:42.000Z
sentinel-core/transport/command/command_request_test.cc
windrunner123/sentinel-cpp
7957e692466db0b7b83b7218602757113e9f2d22
[ "Apache-2.0" ]
24
2019-05-07T08:58:38.000Z
2022-01-26T02:36:06.000Z
sentinel-core/transport/command/command_request_test.cc
windrunner123/sentinel-cpp
7957e692466db0b7b83b7218602757113e9f2d22
[ "Apache-2.0" ]
36
2019-03-19T09:46:08.000Z
2021-11-24T13:20:56.000Z
#include "gmock/gmock.h" #include "gtest/gtest.h" #define private public #include "sentinel-core/transport/command/command_request.h" namespace Sentinel { namespace Transport { TEST(CommandRequestTest, TestBody) { CommandRequest request; request.set_body("testbody"); auto ret = request.body(); EXPECT_EQ(ret, "testbody"); } TEST(CommandRequestTest, TestParam) { CommandRequest request; request.AddParam("key1", "val1"); request.AddParam("key2", "val2"); auto v1 = request.GetParam("key1"); EXPECT_EQ(v1, "val1"); auto v2 = request.GetParam("key2"); EXPECT_EQ(v2, "val2"); auto v3 = request.GetParam("key3"); EXPECT_EQ(v3, ""); auto v4 = request.GetParam("key4", "defaultVal"); EXPECT_EQ(v4, "defaultVal"); } TEST(CommandRequestTest, TestMetadata) { CommandRequest request; request.AddMetadata("key1", "val1"); request.AddMetadata("key2", "val2"); auto v1 = request.GetMetadata("key1"); EXPECT_EQ(v1, "val1"); auto v2 = request.GetMetadata("key2"); EXPECT_EQ(v2, "val2"); auto v3 = request.GetMetadata("key3"); EXPECT_EQ(v3, ""); } } // namespace Transport } // namespace Sentinel
20.5
60
0.688153
windrunner123
a3de66041da608b9870b79e11425eefc41de396e
3,562
hpp
C++
include/Nazara/OpenGLRenderer/OpenGLDevice.hpp
gogo2464/NazaraEngine
f1a00c36cb27d9f07d1b7db03313e0038d9a7d00
[ "BSD-3-Clause-Clear", "Apache-2.0", "MIT" ]
null
null
null
include/Nazara/OpenGLRenderer/OpenGLDevice.hpp
gogo2464/NazaraEngine
f1a00c36cb27d9f07d1b7db03313e0038d9a7d00
[ "BSD-3-Clause-Clear", "Apache-2.0", "MIT" ]
null
null
null
include/Nazara/OpenGLRenderer/OpenGLDevice.hpp
gogo2464/NazaraEngine
f1a00c36cb27d9f07d1b7db03313e0038d9a7d00
[ "BSD-3-Clause-Clear", "Apache-2.0", "MIT" ]
null
null
null
// Copyright (C) 2020 Jérôme Leclercq // This file is part of the "Nazara Engine - OpenGL Renderer" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once #ifndef NAZARA_OPENGLRENDERER_OPENGLDEVICE_HPP #define NAZARA_OPENGLRENDERER_OPENGLDEVICE_HPP #include <Nazara/Prerequisites.hpp> #include <Nazara/Platform/WindowHandle.hpp> #include <Nazara/OpenGLRenderer/Config.hpp> #include <Nazara/OpenGLRenderer/Wrapper/Context.hpp> #include <Nazara/Renderer/RenderDevice.hpp> #include <Nazara/Renderer/RenderDeviceInfo.hpp> #include <unordered_set> #include <vector> namespace Nz { class NAZARA_OPENGLRENDERER_API OpenGLDevice : public RenderDevice { friend GL::Context; public: OpenGLDevice(GL::Loader& loader); OpenGLDevice(const OpenGLDevice&) = delete; OpenGLDevice(OpenGLDevice&&) = delete; ///TODO? ~OpenGLDevice(); std::unique_ptr<GL::Context> CreateContext(const GL::ContextParams& params) const; std::unique_ptr<GL::Context> CreateContext(const GL::ContextParams& params, WindowHandle handle) const; const RenderDeviceInfo& GetDeviceInfo() const override; const RenderDeviceFeatures& GetEnabledFeatures() const override; inline const GL::Context& GetReferenceContext() const; std::shared_ptr<AbstractBuffer> InstantiateBuffer(BufferType type) override; std::shared_ptr<CommandPool> InstantiateCommandPool(QueueType queueType) override; std::shared_ptr<Framebuffer> InstantiateFramebuffer(unsigned int width, unsigned int height, const std::shared_ptr<RenderPass>& renderPass, const std::vector<std::shared_ptr<Texture>>& attachments) override; std::shared_ptr<RenderPass> InstantiateRenderPass(std::vector<RenderPass::Attachment> attachments, std::vector<RenderPass::SubpassDescription> subpassDescriptions, std::vector<RenderPass::SubpassDependency> subpassDependencies) override; std::shared_ptr<RenderPipeline> InstantiateRenderPipeline(RenderPipelineInfo pipelineInfo) override; std::shared_ptr<RenderPipelineLayout> InstantiateRenderPipelineLayout(RenderPipelineLayoutInfo pipelineLayoutInfo) override; std::shared_ptr<ShaderModule> InstantiateShaderModule(ShaderStageTypeFlags shaderStages, ShaderAst::Statement& shaderAst, const ShaderWriter::States& states) override; std::shared_ptr<ShaderModule> InstantiateShaderModule(ShaderStageTypeFlags shaderStages, ShaderLanguage lang, const void* source, std::size_t sourceSize, const ShaderWriter::States& states) override; std::shared_ptr<Texture> InstantiateTexture(const TextureInfo& params) override; std::shared_ptr<TextureSampler> InstantiateTextureSampler(const TextureSamplerInfo& params) override; bool IsTextureFormatSupported(PixelFormat format, TextureUsage usage) const override; inline void NotifyBufferDestruction(GLuint buffer) const; inline void NotifyFramebufferDestruction(GLuint fbo) const; inline void NotifyProgramDestruction(GLuint program) const; inline void NotifySamplerDestruction(GLuint sampler) const; inline void NotifyTextureDestruction(GLuint texture) const; OpenGLDevice& operator=(const OpenGLDevice&) = delete; OpenGLDevice& operator=(OpenGLDevice&&) = delete; ///TODO? private: inline void NotifyContextDestruction(const GL::Context& context) const; std::unique_ptr<GL::Context> m_referenceContext; mutable std::unordered_set<const GL::Context*> m_contexts; RenderDeviceInfo m_deviceInfo; GL::Loader& m_loader; }; } #include <Nazara/OpenGLRenderer/OpenGLDevice.inl> #endif // NAZARA_OPENGLRENDERER_OPENGLDEVICE_HPP
48.794521
240
0.805446
gogo2464
a3e021f7c73b50d2533ec543691194a19cdcbd16
426
hpp
C++
Quiz1/quiz1.hpp
deror1869107/yypoop
f3605961787610bf08f8a9ea2afb905d1af3c5c0
[ "MIT" ]
null
null
null
Quiz1/quiz1.hpp
deror1869107/yypoop
f3605961787610bf08f8a9ea2afb905d1af3c5c0
[ "MIT" ]
null
null
null
Quiz1/quiz1.hpp
deror1869107/yypoop
f3605961787610bf08f8a9ea2afb905d1af3c5c0
[ "MIT" ]
null
null
null
#include <vector> #include <cmath> namespace quiz1{ template<class T> T EuclideanDistance(const std::vector<T>& Pa, const std::vector<T>& Pb){ if( Pa.size() != Pb.size() ) throw ":("; T Distance = 0; // Fill your code here for(size_t i = 0; i < Pa.size(); ++i){ Distance += pow(Pa[i] - Pb[i], 2); } Distance = sqrt(Distance); return Distance; } }
17.75
47
0.518779
deror1869107
9cb174f74ff59788031d23f2001abf3a2edb5b7c
2,006
cpp
C++
src/examples/ex1/ex1.cpp
juzzlin/Argengine
c3f71f32356e966e92459736b1805c7600087bd6
[ "MIT" ]
4
2020-03-01T19:59:20.000Z
2022-01-03T07:09:56.000Z
src/examples/ex1/ex1.cpp
juzzlin/Argengine
c3f71f32356e966e92459736b1805c7600087bd6
[ "MIT" ]
5
2020-03-01T18:28:27.000Z
2020-03-04T19:50:34.000Z
src/examples/ex1/ex1.cpp
juzzlin/Argengine
c3f71f32356e966e92459736b1805c7600087bd6
[ "MIT" ]
2
2020-06-12T15:07:46.000Z
2022-03-30T08:31:37.000Z
// MIT License // // Copyright (c) 2020 Jussi Lind <jussi.lind@iki.fi> // // https://github.com/juzzlin/Argengine // // 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. #include "argengine.hpp" #include <cstdlib> #include <iostream> using juzzlin::Argengine; int main(int argc, char ** argv) { Argengine ae(argc, argv); ae.addOption( { "-a", "--arguments" }, [&] { for (int i = 0; i < argc; i++) { std::cout << argv[i] << std::endl; } }, false, "Print arguments."); ae.addOption( { "-p" }, [](std::string value) { std::cout << value.size() << std::endl; }, true, "Print length of given text. This is required", "TEXT"); Argengine::Error error; ae.parse(error); if (error.code != Argengine::Error::Code::Ok) { std::cerr << error.message << std::endl << std::endl; ae.printHelp(); return EXIT_FAILURE; } return EXIT_SUCCESS; }
33.433333
81
0.658524
juzzlin
9cb1c3b14795b396cd1f421d7e7d6adce6589149
19,619
cpp
C++
bmp/main.cpp
martinberlin/inkster-jpegdec
96ac266ac3701126e3fa1cd5acaaac632d885954
[ "MIT" ]
1
2022-03-19T19:57:56.000Z
2022-03-19T19:57:56.000Z
bmp/main.cpp
martinberlin/inkster-jpegdec
96ac266ac3701126e3fa1cd5acaaac632d885954
[ "MIT" ]
null
null
null
bmp/main.cpp
martinberlin/inkster-jpegdec
96ac266ac3701126e3fa1cd5acaaac632d885954
[ "MIT" ]
null
null
null
/* Simple firmware for a ESP32 displaying a static image on an EPaper Screen */ #include <Arduino.h> // Needs to be on the top otherwise there will be errors #include "freertos/FreeRTOS.h" #include "freertos/task.h" #include "freertos/event_groups.h" #include "esp_system.h" #include "esp_wifi.h" #include "esp_event.h" #include "esp_log.h" #include "nvs_flash.h" #include "lwip/err.h" #include "lwip/sys.h" #include <math.h> // round // - - - - HTTP Client #include "esp_netif.h" #include "esp_err.h" #include "esp_tls.h" #include "esp_http_client.h" #include "esp_sleep.h" #include "string.h" // - - - - EPDiy includes #include "epd_driver.h" #include "epd_highlevel.h" EpdiyHighlevelState hl; uint8_t* fb; // BMP debug Mode: Turn false for production since it will make things slower and dump Serial debug bool bmpDebug = false; uint16_t countDataEventCalls = 0; uint32_t countDataBytes = 0; uint16_t in_red = 0; // for depth 24 uint16_t in_green = 0; // for depth 24 uint16_t in_blue = 0; // for depth 24 char espIpAddress[16]; uint32_t rowSize; uint32_t rowByteCounter; uint16_t w; uint16_t h; uint8_t bitmask = 0xFF; uint8_t bitshift, whitish, red, green, blue; uint16_t drawX = 0; uint16_t drawY = 0; uint8_t index24 = 0; // Index for 24 bit uint16_t bPointer = 34; // Byte pointer - Attention drawPixel has uint16_t uint16_t imageBytesRead = 0; uint32_t dataLenTotal = 0; uint32_t in_bytes = 0; uint8_t in_byte = 0; // for depth <= 8 uint8_t in_bits = 0; // for depth <= 8 bool isReadingImage = false; bool isSupportedBitmap = true; bool isPaddingAware = false; uint16_t forCount = 0; uint8_t mono_palette_buffer[32]; // palette buffer for depth <= 8 b/w uint16_t totalDrawPixels = 0; int color = 0xff; uint32_t startTime = 0; uint32_t endTime = 0; struct BmpHeader { uint32_t fileSize; uint32_t imageOffset; uint32_t headerSize; uint32_t width; uint32_t height; uint16_t planes; uint16_t depth; uint32_t format; } bmp; uint16_t read16(uint8_t output_buffer[512], uint8_t startPointer) { // BMP data is stored little-endian uint16_t result; ((uint8_t *)&result)[0] = output_buffer[startPointer]; // LSB ((uint8_t *)&result)[1] = output_buffer[startPointer + 1]; // MSB return result; } uint32_t read32(uint8_t output_buffer[512], uint8_t startPointer) { //Debug - Leave disabled to avoid Serial output //printf("read32: %x %x %x %x\n", output_buffer[startPointer],output_buffer[startPointer+1],output_buffer[startPointer+2],output_buffer[startPointer+3]); uint32_t result; ((uint8_t *)&result)[0] = output_buffer[startPointer]; // LSB ((uint8_t *)&result)[1] = output_buffer[startPointer + 1]; ((uint8_t *)&result)[2] = output_buffer[startPointer + 2]; ((uint8_t *)&result)[3] = output_buffer[startPointer + 3]; // MSB return result; } void deepsleep(){ epd_deinit(); esp_deep_sleep(1000000LL * 60 * DEEPSLEEP_MINUTES_AFTER_RENDER); } esp_err_t _http_event_handler(esp_http_client_event_t *evt) { uint8_t output_buffer[HTTP_RECEIVE_BUFFER_SIZE]; // Buffer to store HTTP response switch (evt->event_id) { case HTTP_EVENT_ERROR: printf("HTTP_EVENT_ERROR\n"); break; case HTTP_EVENT_ON_CONNECTED: printf("HTTP_EVENT_ON_CONNECTED\n"); break; case HTTP_EVENT_HEADER_SENT: printf("HTTP_EVENT_HEADER_SENT\n"); break; case HTTP_EVENT_ON_HEADER: printf("HTTP_EVENT_ON_HEADER, key=%s, value=%s\n", evt->header_key, evt->header_value); break; case HTTP_EVENT_ON_DATA: ++countDataEventCalls; #if DEBUG_VERBOSE if (countDataEventCalls%10==0) { printf("%d len:%d\n", countDataEventCalls, evt->data_len); } #endif if (isSupportedBitmap == false) break; dataLenTotal += evt->data_len; // Unless bmp.imageOffset initial skip we start reading stream always on byte pointer 0: bPointer = 0; // Copy the response into the buffer memcpy(output_buffer, evt->data, evt->data_len); if (countDataEventCalls == 1) { startTime = millis(); // Read BMP header -In total 34 bytes header bmp.fileSize = read32(output_buffer, 2); bmp.imageOffset = read32(output_buffer, 10); bmp.headerSize = read32(output_buffer, 14); bmp.width = read32(output_buffer, 18); bmp.height = read32(output_buffer, 22); bmp.planes = read16(output_buffer, 26); bmp.depth = read16(output_buffer, 28); bmp.format = read32(output_buffer, 30); drawY = bmp.height; printf("BMP HEADERS\nfilesize:%d\noffset:%d\nW:%d\nH:%d\nplanes:%d\ndepth:%d\nformat:%d\n", bmp.fileSize, bmp.imageOffset, bmp.width, bmp.height, bmp.planes, bmp.depth, bmp.format); printf("Hold on. Downloading image...\n\n"); if (bmp.depth == 1) { isPaddingAware = true; printf("BMP isPaddingAware: 1 bit depth are 4 bit padded. Wikipedia gave me a lesson."); } if (((bmp.planes == 1) && ((bmp.format == 0) || (bmp.format == 3))) == false) { // uncompressed is handled isSupportedBitmap = false; printf("BMP NOT SUPPORTED: Compressed formats not handled.\nBMP NOT SUPPORTED: Only planes==1, format 0 or 3\n"); } if (bmp.depth == 4 || bmp.depth == 16 || bmp.depth > 24) { isSupportedBitmap = false; printf("BMP DEPTH %d: Only 1, 8 and 24 bits depth are supported.\n", bmp.depth); break; } rowSize = (bmp.width * bmp.depth / 8 + 3) & ~3; if (bmp.depth < 8) { rowSize = ((bmp.width * bmp.depth + 8 - bmp.depth) / 8 + 3) & ~3; bitmask >>= bmp.depth; // Color-palette location: bPointer = bmp.imageOffset - (4 << bmp.depth); if (bmpDebug) printf("Palette location: %d\n\n", bPointer); for (uint16_t pn = 0; pn < (1 << bmp.depth); pn++) { blue = output_buffer[bPointer++]; green = output_buffer[bPointer++]; red = output_buffer[bPointer++]; bPointer++; whitish = ((red > 0xF0) && (green > 0xF0) && (blue > 0xF0)); if (0 == pn % 8) { mono_palette_buffer[pn / 8] = 0; } mono_palette_buffer[pn / 8] |= whitish << pn % 8; } } if (bmpDebug) printf("ROW Size %d\n", rowSize); w = bmp.width; h = bmp.height; if ((w - 1) >= EPD_WIDTH) w = EPD_WIDTH; if ((h - 1) >= EPD_HEIGHT) h = EPD_HEIGHT; bitshift = 8 - bmp.depth; imageBytesRead += evt->data_len; } if (!isSupportedBitmap) return ESP_FAIL; if (bmpDebug) { printf("\n--> bPointer %d\n_inX: %d _inY: %d DATALEN TOTAL:%d bytesRead so far:%d\n", bPointer, drawX, drawY, dataLenTotal, imageBytesRead); printf("Is reading image: %d\n", isReadingImage); } // Didn't arrived to imageOffset YET, it will in next calls of HTTP_EVENT_ON_DATA: if (dataLenTotal < bmp.imageOffset) { imageBytesRead = dataLenTotal; if (bmpDebug) printf("IF read<offset UPDATE bytesRead:%d\n", imageBytesRead); return ESP_OK; } else { // Only move pointer once to set right offset if (countDataEventCalls == 1 && bmp.imageOffset < evt->data_len) { bPointer = bmp.imageOffset; isReadingImage = true; printf("Offset comes in first DATA callback. bPointer: %d == bmp.imageOffset\n", bPointer); } if (!isReadingImage) { bPointer = bmp.imageOffset - imageBytesRead; imageBytesRead += bPointer; isReadingImage = true; printf("Start reading image. bPointer: %d\n", bPointer); } } forCount = 0; // LOOP all the received Buffer but start on ImageOffset if first call for (uint32_t byteIndex = bPointer; byteIndex < evt->data_len; ++byteIndex) { in_byte = output_buffer[byteIndex]; // Dump only the first calls if (countDataEventCalls < 2 && bmpDebug) { printf("L%d: BrsF:%d %x\n", byteIndex, imageBytesRead, in_byte); } in_bits = 8; switch (bmp.depth) { case 1: { while (in_bits != 0) { uint16_t pn = (in_byte >> bitshift) & bitmask; uint8_t white = mono_palette_buffer[pn / 8] & (0x1 << pn % 8); in_byte <<= bmp.depth; in_bits -= bmp.depth; if (white) { color = 0xFF; } else { color = 0x00; } // bmp.width reached? Then go one line up (Is readed from bottom to top) if (isPaddingAware) { // 1 bit images are 4-bit padded (Filled usually with 0's) if (drawX + 1 > rowSize * 8) { drawX = 0; rowByteCounter = 0; --drawY; } } else { if (drawX + 1 > bmp.width) { drawX = 0; rowByteCounter = 0; --drawY; } } // The ultimate mission: Send the X / Y pixel to the GFX Buffer epd_draw_pixel(drawX, drawY, color, fb); totalDrawPixels++; ++drawX; } } break; case 8: if (drawX+1 > bmp.width) { drawX = 0; --drawY; } epd_draw_pixel(drawX, drawY, in_byte, fb); //printf("%d ", in_byte); ++drawX; break; case 24: // index24 3 byte B,G,R counter starts on 1 ++index24; // Convert the 24 bits into 16 bit 565 (Adafruit GFX format) switch (index24) { case 1: in_blue = in_byte; break; case 2: in_green = in_byte; break; case 3: in_red = in_byte; break; } // Every 3rd byte we advance one X if (index24 == 3) { if (drawX+1 > bmp.width) { drawX = 0; --drawY; } totalDrawPixels++; // Color conversion // Method 1: This works the best for me so far, best variation found //color = 0.3 * in_red + 0.4 * in_green + 0.3 * in_blue; // Method 2: Sent by @vroland https://www.programmersought.com/article/19593930102 color = (38 * in_red + 75 * in_green + 15 * in_blue) >> 7; // DEBUG: Turn to true if (false && totalDrawPixels<200) { printf("R:%d G:%d B:%d CALC:%d\n", in_red, in_green, in_blue, color); } epd_draw_pixel(drawX, drawY, color, fb); ++drawX; index24 = 0; } break; default: printf("ERROR: Unsupported bit-depth mode: %d", bmp.depth); break; } rowByteCounter++; imageBytesRead++; forCount++; } endTime = millis(); if (bmpDebug) printf("Total drawPixel calls: %d\noutX: %d outY: %d\n", totalDrawPixels, drawX, drawY); break; case HTTP_EVENT_ON_FINISH: printf("HTTP_EVENT_ON_FINISH\nDownload time: %lu ms.\n\nRefresh and go to sleep %d minutes\n", endTime-startTime, DEEPSLEEP_MINUTES_AFTER_RENDER); epd_hl_update_screen(&hl, MODE_GC16, 25); if (bmpDebug) printf("Free heap after display render: %d\n", xPortGetFreeHeapSize()); deepsleep(); break; case HTTP_EVENT_DISCONNECTED: printf("HTTP_EVENT_DISCONNECTED\n"); break; } return ESP_OK; } static void http_post(void) { /** * NOTE: All the configuration parameters for http_client must be spefied * either in URL or as host and path parameters. */ esp_http_client_config_t config = { .url = IMG_URL, .event_handler = _http_event_handler, .buffer_size = HTTP_RECEIVE_BUFFER_SIZE }; esp_http_client_handle_t client = esp_http_client_init(&config); esp_err_t err = esp_http_client_perform(client); if (err == ESP_OK) { printf("\nIMAGE URL: %s\n\nHTTP GET Status = %d, content_length = %d\n", IMG_URL, esp_http_client_get_status_code(client), esp_http_client_get_content_length(client)); } else { printf("\nHTTP GET request failed: %s", esp_err_to_name(err)); } } /* FreeRTOS event group to signal when we are connected*/ static EventGroupHandle_t s_wifi_event_group; /* The event group allows multiple bits for each event, but we only care about two events: * - we are connected to the AP with an IP * - we failed to connect after the maximum amount of retries */ #define WIFI_CONNECTED_BIT BIT0 #define WIFI_FAIL_BIT BIT1 static int s_retry_num = 0; static void event_handler(void *arg, esp_event_base_t event_base, int32_t event_id, void *event_data) { if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_STA_START) { esp_wifi_connect(); } else if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_STA_DISCONNECTED) { if (s_retry_num < 5) { esp_wifi_connect(); s_retry_num++; printf("Retry to connect to the AP"); } else { xEventGroupSetBits(s_wifi_event_group, WIFI_FAIL_BIT); printf("Connect to the AP failed %d times. Going to deepsleep %d minutes", 5, DEEPSLEEP_MINUTES_AFTER_RENDER); deepsleep(); } } else if (event_base == IP_EVENT && event_id == IP_EVENT_STA_GOT_IP) { ip_event_got_ip_t *event = (ip_event_got_ip_t *)event_data; sprintf(espIpAddress, IPSTR, IP2STR(&event->ip_info.ip)); printf("\ngot ip: %s\n", espIpAddress); s_retry_num = 0; xEventGroupSetBits(s_wifi_event_group, WIFI_CONNECTED_BIT); } } void wifi_init_sta(void) { s_wifi_event_group = xEventGroupCreate(); ESP_ERROR_CHECK(esp_netif_init()); ESP_ERROR_CHECK(esp_event_loop_create_default()); esp_netif_create_default_wifi_sta(); wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT(); ESP_ERROR_CHECK(esp_wifi_init(&cfg)); esp_event_handler_instance_t instance_any_id; esp_event_handler_instance_t instance_got_ip; ESP_ERROR_CHECK(esp_event_handler_instance_register(WIFI_EVENT, ESP_EVENT_ANY_ID, &event_handler, NULL, &instance_any_id)); ESP_ERROR_CHECK(esp_event_handler_instance_register(IP_EVENT, IP_EVENT_STA_GOT_IP, &event_handler, NULL, &instance_got_ip)); // C++ wifi config wifi_config_t wifi_config; memset(&wifi_config, 0, sizeof(wifi_config)); wifi_config.sta.threshold.authmode = WIFI_AUTH_WPA2_PSK; sprintf(reinterpret_cast<char *>(wifi_config.sta.ssid), ESP_WIFI_SSID); sprintf(reinterpret_cast<char *>(wifi_config.sta.password), ESP_WIFI_PASSWORD); wifi_config.sta.pmf_cfg.capable = true; ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA)); ESP_ERROR_CHECK(esp_wifi_set_config((wifi_interface_t)ESP_IF_WIFI_STA, &wifi_config)); ESP_ERROR_CHECK(esp_wifi_start()); printf("wifi_init_sta finished."); /* Waiting until either the connection is established (WIFI_CONNECTED_BIT) or connection failed for the maximum * number of re-tries (WIFI_FAIL_BIT). The bits are set by event_handler() (see above) */ EventBits_t bits = xEventGroupWaitBits(s_wifi_event_group, WIFI_CONNECTED_BIT | WIFI_FAIL_BIT, pdFALSE, pdFALSE, portMAX_DELAY); /* xEventGroupWaitBits() returns the bits before the call returned, hence we can test which event actually happened. */ if (bits & WIFI_CONNECTED_BIT) { printf("connected to ap SSID:%s\n", ESP_WIFI_SSID); } else if (bits & WIFI_FAIL_BIT) { printf("Failed to connect to SSID:%s\n", ESP_WIFI_SSID); } else { printf("ERR: UNEXPECTED EVENT\n"); } /* The event will not be processed after unregister */ ESP_ERROR_CHECK(esp_event_handler_instance_unregister(IP_EVENT, IP_EVENT_STA_GOT_IP, instance_got_ip)); ESP_ERROR_CHECK(esp_event_handler_instance_unregister(WIFI_EVENT, ESP_EVENT_ANY_ID, instance_any_id)); vEventGroupDelete(s_wifi_event_group); } void loop() {} void setup(void) { // Initialize EPDiy component epd_init(EPD_OPTIONS_DEFAULT); hl = epd_hl_init(EPD_BUILTIN_WAVEFORM); fb = epd_hl_get_framebuffer(&hl); //Initialize NVS esp_err_t ret = nvs_flash_init(); if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND) { ESP_ERROR_CHECK(nvs_flash_erase()); ret = nvs_flash_init(); } ESP_ERROR_CHECK(ret); // WiFi log level set only to Error otherwise outputs too much esp_log_level_set("wifi", ESP_LOG_ERROR); wifi_init_sta(); epd_poweron(); // Clear screen #if EPD_START_CLEAR epd_fullclear(&hl, 25); #endif // Handle rotation epd_set_rotation(EPD_ROT_LANDSCAPE); // Show available Dynamic Random Access Memory available after initialization printf("Free heap: %d (After epaper instantiation)\n\n", xPortGetFreeHeapSize()); http_post(); }
35.159498
157
0.546511
martinberlin
9cb2ee388a18e726945fb5bf84b25c8081439a19
5,852
cpp
C++
backends/db2/standard-use-type.cpp
staticlibs/lookaside_soci
b3326cff7d4cf2dc122179eb8b988f2521944550
[ "BSL-1.0" ]
null
null
null
backends/db2/standard-use-type.cpp
staticlibs/lookaside_soci
b3326cff7d4cf2dc122179eb8b988f2521944550
[ "BSL-1.0" ]
null
null
null
backends/db2/standard-use-type.cpp
staticlibs/lookaside_soci
b3326cff7d4cf2dc122179eb8b988f2521944550
[ "BSL-1.0" ]
null
null
null
// // Copyright (C) 2011-2013 Denis Chapligin // Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton, David Courtney // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #define SOCI_DB2_SOURCE #include "soci-db2.h" #include <cctype> #include <cstdio> #include <cstring> #include <ctime> #include <sstream> using namespace soci; using namespace soci::details; void *db2_standard_use_type_backend::prepare_for_bind( void *data, SQLLEN &size, SQLSMALLINT &sqlType, SQLSMALLINT &cType) { switch (type) { // simple cases case x_short: sqlType = SQL_SMALLINT; cType = SQL_C_SSHORT; size = sizeof(short); break; case x_integer: sqlType = SQL_INTEGER; cType = SQL_C_SLONG; size = sizeof(int); break; case x_long_long: sqlType = SQL_BIGINT; cType = SQL_C_SBIGINT; size = sizeof(long long); break; case x_unsigned_long_long: sqlType = SQL_BIGINT; cType = SQL_C_UBIGINT; size = sizeof(unsigned long long); break; case x_double: sqlType = SQL_DOUBLE; cType = SQL_C_DOUBLE; size = sizeof(double); break; // cases that require adjustments and buffer management case x_char: { sqlType = SQL_CHAR; cType = SQL_C_CHAR; size = sizeof(char) + 1; buf = new char[size]; char *c = static_cast<char*>(data); buf[0] = *c; buf[1] = '\0'; ind = SQL_NTS; } break; case x_stdstring: { // TODO: No textual value is assigned here! std::string* s = static_cast<std::string*>(data); sqlType = SQL_LONGVARCHAR; cType = SQL_C_CHAR; size = s->size() + 1; buf = new char[size]; strncpy(buf, s->c_str(), size); ind = SQL_NTS; } break; case x_stdtm: { sqlType = SQL_TIMESTAMP; cType = SQL_C_TIMESTAMP; buf = new char[sizeof(TIMESTAMP_STRUCT)]; std::tm *t = static_cast<std::tm *>(data); data = buf; size = 19; // This number is not the size in bytes, but the number // of characters in the date if it was written out // yyyy-mm-dd hh:mm:ss TIMESTAMP_STRUCT * ts = reinterpret_cast<TIMESTAMP_STRUCT*>(buf); ts->year = static_cast<SQLSMALLINT>(t->tm_year + 1900); ts->month = static_cast<SQLUSMALLINT>(t->tm_mon + 1); ts->day = static_cast<SQLUSMALLINT>(t->tm_mday); ts->hour = static_cast<SQLUSMALLINT>(t->tm_hour); ts->minute = static_cast<SQLUSMALLINT>(t->tm_min); ts->second = static_cast<SQLUSMALLINT>(t->tm_sec); ts->fraction = 0; } break; case x_blob: break; case x_statement: case x_rowid: break; } // Return either the pointer to C++ data itself or the buffer that we // allocated, if any. return buf ? buf : data; } void db2_standard_use_type_backend::bind_by_pos( int &position, void *data, exchange_type type, bool /* readOnly */) { if (statement_.use_binding_method_ == details::db2::BOUND_BY_NAME) { throw soci_error("Binding for use elements must be either by position or by name."); } statement_.use_binding_method_ = details::db2::BOUND_BY_POSITION; this->data = data; // for future reference this->type = type; // for future reference this->position = position++; } void db2_standard_use_type_backend::bind_by_name( std::string const &name, void *data, exchange_type type, bool /* readOnly */) { if (statement_.use_binding_method_ == details::db2::BOUND_BY_POSITION) { throw soci_error("Binding for use elements must be either by position or by name."); } statement_.use_binding_method_ = details::db2::BOUND_BY_NAME; int position = -1; int count = 1; for (std::vector<std::string>::iterator it = statement_.names.begin(); it != statement_.names.end(); ++it) { if (*it == name) { position = count; break; } count++; } if (position != -1) { this->data = data; // for future reference this->type = type; // for future reference this->position = position; } else { std::ostringstream ss; ss << "Unable to find name '" << name << "' to bind to"; throw soci_error(ss.str().c_str()); } } void db2_standard_use_type_backend::pre_use(indicator const *ind_ptr) { // first deal with data SQLSMALLINT sqlType; SQLSMALLINT cType; SQLLEN size; void *sqlData = prepare_for_bind(data, size, sqlType, cType); SQLRETURN cliRC = SQLBindParameter(statement_.hStmt, static_cast<SQLUSMALLINT>(position), SQL_PARAM_INPUT, cType, sqlType, size, 0, sqlData, size, &ind); if (cliRC != SQL_SUCCESS) { throw db2_soci_error("Error while binding value",cliRC); } // then handle indicators if (ind_ptr != NULL && *ind_ptr == i_null) { ind = SQL_NULL_DATA; // null } } void db2_standard_use_type_backend::post_use(bool /*gotData*/, indicator* /*ind*/) { } void db2_standard_use_type_backend::clean_up() { if (buf != NULL) { delete [] buf; buf = NULL; } }
28.970297
93
0.561176
staticlibs
9cb64db33461bab41798517484b75e5ef23a1ea8
2,494
cpp
C++
src/GUI/Text.cpp
szebest/Basic-SFML-Application-Framework
e6b979283a1aba87ea5eefb1785d6f9bf4485d4a
[ "MIT" ]
null
null
null
src/GUI/Text.cpp
szebest/Basic-SFML-Application-Framework
e6b979283a1aba87ea5eefb1785d6f9bf4485d4a
[ "MIT" ]
null
null
null
src/GUI/Text.cpp
szebest/Basic-SFML-Application-Framework
e6b979283a1aba87ea5eefb1785d6f9bf4485d4a
[ "MIT" ]
null
null
null
#include "Text.h" Text::Text(sf::Vector2f pos, const std::string& text) : m_pattern(text), m_pos(pos), m_fixedPos(false) { setFont(holder::get().fonts.get("arial")); setText(text); setColor(sf::Color::White); setCharSize(32); setPosition(pos); m_fPos = getPosition() - sf::Vector2f(m_text.getGlobalBounds().width , -m_text.getGlobalBounds().height / 2.f); } Text::Text(const Text& other) : m_text(other.m_text), m_pattern(other.m_pattern), m_pos(other.m_pos), m_func(other.m_func), m_fixedPos(other.m_fixedPos), m_fPos(other.m_fPos) { } void Text::handleEvents(sf::Event e, const sf::RenderWindow& window, sf::Vector2f displacement) { } void Text::update(const sf::Time& deltaTime) { m_ss.clear(); m_func(); std::string tmp = ""; bool special = false; for (int i = 0; i < m_pattern.size(); i++) { bool wasSpecial = special; if (m_pattern[i] == '-') special = true; else special = false; if (m_pattern[i] == '%' && wasSpecial) { std::string val = ""; getline(m_ss, val); if (val.size() > 0) tmp += val; } else if (!special) { if (wasSpecial) tmp = tmp + "-" + m_pattern[i]; else tmp += m_pattern[i]; } else if (wasSpecial) tmp = tmp + "-"; } setText(tmp); setPosition(m_pos); } void Text::draw(sf::RenderTarget& target) { target.draw(m_text); } void Text::setPosition(sf::Vector2f pos) { if (m_fixedPos) m_text.setPosition(m_fPos); else m_text.setPosition(pos - sf::Vector2f(m_text.getGlobalBounds().width, m_text.getGlobalBounds().height) / 2.f); } sf::Vector2f Text::getPosition() { return m_text.getPosition() + sf::Vector2f(m_text.getGlobalBounds().width, m_text.getGlobalBounds().height) / 2.f; } void Text::setCharSize(int size) { m_text.setCharacterSize(size); } int Text::getCharSize() { return m_text.getCharacterSize(); } void Text::setText(const std::string& text) { m_text.setString(text); } void Text::setFont(const sf::Font& font) { m_text.setFont(font); } void Text::setColor(sf::Color color) { m_text.setFillColor(color); } void Text::setOutlineColor(sf::Color color) { m_text.setOutlineColor(color); } void Text::setOutlineThickness(int thickness) { m_text.setOutlineThickness(thickness); } void Text::setFixedPos(bool fixedPos) { m_fixedPos = fixedPos; } sf::Vector2f Text::getSize() { auto globalBounds = m_text.getGlobalBounds(); return sf::Vector2f(globalBounds.width, globalBounds.height); } std::string Text::getString() { return m_text.getString(); }
18.338235
143
0.680433
szebest
9cb7fa499ac58a511a165c80731f7142b0912fc1
12,863
cpp
C++
src/game/shared/tf/tf_weapon_pda.cpp
cstom4994/SourceEngineRebuild
edfd7f8ce8af13e9d23586318350319a2e193c08
[ "MIT" ]
6
2022-01-23T09:40:33.000Z
2022-03-20T20:53:25.000Z
src/game/shared/tf/tf_weapon_pda.cpp
cstom4994/SourceEngineRebuild
edfd7f8ce8af13e9d23586318350319a2e193c08
[ "MIT" ]
null
null
null
src/game/shared/tf/tf_weapon_pda.cpp
cstom4994/SourceEngineRebuild
edfd7f8ce8af13e9d23586318350319a2e193c08
[ "MIT" ]
1
2022-02-06T21:05:23.000Z
2022-02-06T21:05:23.000Z
//========= Copyright Valve Corporation, All rights reserved. ============// // // Purpose: // //============================================================================= #include "cbase.h" #ifdef CLIENT_DLL #include "iinput.h" #endif #include "tf_weapon_pda.h" #include "in_buttons.h" #include "tf_gamerules.h" #include "tf_weaponbase_gun.h" // Server specific. #if !defined( CLIENT_DLL ) #include "tf_player.h" #include "vguiscreen.h" // Client specific. #else #include "c_tf_player.h" #include <igameevents.h> #include "tf_hud_menu_engy_build.h" #include "tf_hud_menu_engy_destroy.h" #include "tf_hud_menu_spy_disguise.h" #include "prediction.h" #ifdef STAGING_ONLY #include "tf_hud_menu_spy_build.h" #endif // STAGING_ONLY #endif //============================================================================= // // TFWeaponBase Melee tables. // IMPLEMENT_NETWORKCLASS_ALIASED( TFWeaponPDA, DT_TFWeaponPDA ) BEGIN_NETWORK_TABLE( CTFWeaponPDA, DT_TFWeaponPDA ) END_NETWORK_TABLE() BEGIN_PREDICTION_DATA( CTFWeaponPDA ) END_PREDICTION_DATA() // Server specific. #if !defined( CLIENT_DLL ) BEGIN_DATADESC( CTFWeaponPDA ) END_DATADESC() #endif LINK_ENTITY_TO_CLASS( tf_pda_expansion_dispenser, CTFWeaponPDAExpansion_Dispenser ); IMPLEMENT_NETWORKCLASS_ALIASED( TFWeaponPDAExpansion_Dispenser, DT_TFWeaponPDAExpansion_Dispenser ) // Network Table -- BEGIN_NETWORK_TABLE( CTFWeaponPDAExpansion_Dispenser, DT_TFWeaponPDAExpansion_Dispenser ) END_NETWORK_TABLE() // -- Network Table // Data Desc -- BEGIN_DATADESC( CTFWeaponPDAExpansion_Dispenser ) END_DATADESC() //************************************************************************************************ LINK_ENTITY_TO_CLASS( tf_pda_expansion_teleporter, CTFWeaponPDAExpansion_Teleporter ); IMPLEMENT_NETWORKCLASS_ALIASED( TFWeaponPDAExpansion_Teleporter, DT_TFWeaponPDAExpansion_Teleporter ) // Network Table -- BEGIN_NETWORK_TABLE( CTFWeaponPDAExpansion_Teleporter, DT_TFWeaponPDAExpansion_Teleporter ) END_NETWORK_TABLE() // -- Network Table // Data Desc -- BEGIN_DATADESC( CTFWeaponPDAExpansion_Teleporter ) END_DATADESC() CTFWeaponPDA::CTFWeaponPDA() { } void CTFWeaponPDA::Spawn() { BaseClass::Spawn(); } //----------------------------------------------------------------------------- // Purpose: cancel menu //----------------------------------------------------------------------------- void CTFWeaponPDA::PrimaryAttack( void ) { CTFPlayer *pOwner = ToTFPlayer( GetOwner() ); if ( !pOwner ) { return; } pOwner->SelectLastItem(); } //----------------------------------------------------------------------------- // Purpose: toggle invis //----------------------------------------------------------------------------- void CTFWeaponPDA::SecondaryAttack( void ) { // semi-auto behaviour if ( m_bInAttack2 ) return; // Get the player owning the weapon. CTFPlayer *pPlayer = ToTFPlayer( GetPlayerOwner() ); if ( !pPlayer ) return; pPlayer->DoClassSpecialSkill(); m_bInAttack2 = true; m_flNextSecondaryAttack = gpGlobals->curtime + 0.5; } #if !defined( CLIENT_DLL ) void CTFWeaponPDA::Precache() { BaseClass::Precache(); PrecacheVGuiScreen( GetPanelName() ); } //----------------------------------------------------------------------------- // Purpose: Gets info about the control panels //----------------------------------------------------------------------------- void CTFWeaponPDA::GetControlPanelInfo( int nPanelIndex, const char *&pPanelName ) { pPanelName = GetPanelName(); } #else float CTFWeaponPDA::CalcViewmodelBob( void ) { // no bob return BaseClass::CalcViewmodelBob(); } #endif //----------------------------------------------------------------------------- // Purpose: // Output : Returns true on success, false on failure. //----------------------------------------------------------------------------- bool CTFWeaponPDA::ShouldShowControlPanels( void ) { return true; } #ifdef CLIENT_DLL void CTFWeaponPDA::OnDataChanged( DataUpdateType_t type ) { if ( m_iState != m_iOldState && GetOwner() == C_TFPlayer::GetLocalTFPlayer() ) { // Was active, now not if ( m_iOldState == WEAPON_IS_ACTIVE && m_iState != m_iOldState ) { CHudBaseBuildMenu *pBuildMenu = GetBuildMenu(); Assert( pBuildMenu ); if ( pBuildMenu ) { pBuildMenu->SetBuilderEquipped( false ); } } else if ( m_iState == WEAPON_IS_ACTIVE && m_iOldState == WEAPON_IS_CARRIED_BY_PLAYER ) // Was inactive, now is { CHudBaseBuildMenu *pBuildMenu = GetBuildMenu(); Assert( pBuildMenu ); if ( pBuildMenu ) { pBuildMenu->SetBuilderEquipped( true ); } } } BaseClass::OnDataChanged( type ); } void CTFWeaponPDA::UpdateOnRemove() { CHudBaseBuildMenu *pBuildMenu = GetBuildMenu(); Assert( pBuildMenu ); if ( pBuildMenu ) { pBuildMenu->SetBuilderEquipped( false ); } return BaseClass::UpdateOnRemove(); } #endif //============================== IMPLEMENT_NETWORKCLASS_ALIASED( TFWeaponPDA_Engineer_Build, DT_TFWeaponPDA_Engineer_Build ) BEGIN_NETWORK_TABLE( CTFWeaponPDA_Engineer_Build, DT_TFWeaponPDA_Engineer_Build ) END_NETWORK_TABLE() BEGIN_PREDICTION_DATA( CTFWeaponPDA_Engineer_Build ) END_PREDICTION_DATA() LINK_ENTITY_TO_CLASS( tf_weapon_pda_engineer_build, CTFWeaponPDA_Engineer_Build ); PRECACHE_WEAPON_REGISTER( tf_weapon_pda_engineer_build ); #ifdef CLIENT_DLL CHudBaseBuildMenu *CTFWeaponPDA_Engineer_Build::GetBuildMenu() const { return GET_HUDELEMENT( CHudMenuEngyBuild ); } #endif // CLIENT_DLL //============================== IMPLEMENT_NETWORKCLASS_ALIASED( TFWeaponPDA_Engineer_Destroy, DT_TFWeaponPDA_Engineer_Destroy ) BEGIN_NETWORK_TABLE( CTFWeaponPDA_Engineer_Destroy, DT_TFWeaponPDA_Engineer_Destroy ) END_NETWORK_TABLE() BEGIN_PREDICTION_DATA( CTFWeaponPDA_Engineer_Destroy ) END_PREDICTION_DATA() LINK_ENTITY_TO_CLASS( tf_weapon_pda_engineer_destroy, CTFWeaponPDA_Engineer_Destroy ); PRECACHE_WEAPON_REGISTER( tf_weapon_pda_engineer_destroy ); #ifdef CLIENT_DLL CHudBaseBuildMenu *CTFWeaponPDA_Engineer_Destroy::GetBuildMenu() const { return GET_HUDELEMENT( CHudMenuEngyDestroy ); } #endif // CLIENT_DLL //============================== IMPLEMENT_NETWORKCLASS_ALIASED( TFWeaponPDA_Spy, DT_TFWeaponPDA_Spy ) BEGIN_NETWORK_TABLE( CTFWeaponPDA_Spy, DT_TFWeaponPDA_Spy ) END_NETWORK_TABLE() BEGIN_PREDICTION_DATA( CTFWeaponPDA_Spy ) END_PREDICTION_DATA() LINK_ENTITY_TO_CLASS( tf_weapon_pda_spy, CTFWeaponPDA_Spy ); PRECACHE_WEAPON_REGISTER( tf_weapon_pda_spy ); #ifdef CLIENT_DLL CHudBaseBuildMenu *CTFWeaponPDA_Spy::GetBuildMenu() const { return GET_HUDELEMENT( CHudMenuSpyDisguise ); } #endif // CLIENT_DLL #ifdef STAGING_ONLY //============================== IMPLEMENT_NETWORKCLASS_ALIASED( TFWeaponPDA_Spy_Build, DT_TFWeaponPDA_Spy_Build ) BEGIN_NETWORK_TABLE( CTFWeaponPDA_Spy_Build, DT_TFWeaponPDA_Spy_Build ) END_NETWORK_TABLE() BEGIN_PREDICTION_DATA( CTFWeaponPDA_Spy_Build ) END_PREDICTION_DATA() LINK_ENTITY_TO_CLASS( tf_weapon_pda_spy_build, CTFWeaponPDA_Spy_Build ); PRECACHE_WEAPON_REGISTER( tf_weapon_pda_spy_build ); #ifdef CLIENT_DLL CHudBaseBuildMenu *CTFWeaponPDA_Spy_Build::GetBuildMenu() const { return GET_HUDELEMENT( CHudMenuSpyBuild ); } #endif // CLIENT_DLL #endif // STAGING_ONLY //============================== void CTFWeaponPDA_Spy::ItemPreFrame( void ) { BaseClass::ItemPreFrame(); ProcessDisguiseImpulse(); CheckDisguiseTimer(); } void CTFWeaponPDA_Spy::ItemBusyFrame( void ) { BaseClass::ItemBusyFrame(); ProcessDisguiseImpulse(); CheckDisguiseTimer(); } void CTFWeaponPDA_Spy::ItemHolsterFrame( void ) { BaseClass::ItemHolsterFrame(); ProcessDisguiseImpulse(); CheckDisguiseTimer(); } void CTFWeaponPDA_Spy::ProcessDisguiseImpulse( void ) { CTFPlayer *pPlayer = ToTFPlayer( GetPlayerOwner() ); if ( !pPlayer ) return; pPlayer->m_Shared.ProcessDisguiseImpulse( pPlayer ); } void CTFWeaponPDA_Spy::CheckDisguiseTimer( void ) { /* // Get the player owning the weapon. CTFPlayer *pPlayer = ToTFPlayer( GetPlayerOwner() ); if ( !pPlayer ) return; if ( pPlayer->m_Shared.InCond( TF_COND_DISGUISING ) ) { if ( gpGlobals->curtime > pPlayer->m_Shared.GetDisguiseCompleteTime() ) { pPlayer->m_Shared.CompleteDisguise(); } } */ } #ifdef CLIENT_DLL bool CTFWeaponPDA_Spy::Deploy( void ) { bool bDeploy = BaseClass::Deploy(); if ( bDeploy ) { // let the spy pda menu know to reset IGameEvent *event = gameeventmanager->CreateEvent( "spy_pda_reset" ); if ( event ) { gameeventmanager->FireEventClientSide( event ); } } return bDeploy; } #endif bool CTFWeaponPDA_Spy::CanBeSelected( void ) { CTFPlayer *pOwner = ToTFPlayer( GetOwner() ); if ( pOwner && !pOwner->CanDisguise() ) { return false; } return BaseClass::CanBeSelected(); } bool CTFWeaponPDA_Spy::VisibleInWeaponSelection( void ) { if ( !CanBeSelected() ) return false; return BaseClass::VisibleInWeaponSelection(); } //----------------------------------------------------------------------------- // PDA Expansion Slots void CTFWeaponPDAExpansion_Dispenser::Equip( CBasePlayer *pOwner ) { #ifdef GAME_DLL CTFPlayer *pPlayer = ToTFPlayer( pOwner ); if ( pPlayer ) { // Detonate CBaseObject *pObject = pPlayer->GetObjectOfType( OBJ_DISPENSER ); if ( pObject ) { pObject->DetonateObject(); } } #endif BaseClass::Equip( pOwner ); } //----------------------------------------------------------------------------- void CTFWeaponPDAExpansion_Dispenser::UnEquip( CBasePlayer *pOwner ) { #ifdef GAME_DLL CTFPlayer *pPlayer = ToTFPlayer( pOwner ); if ( pPlayer ) { // Detonate CBaseObject *pObject = pPlayer->GetObjectOfType( OBJ_DISPENSER ); if ( pObject ) { pObject->DetonateObject(); } } #endif BaseClass::UnEquip( pOwner ); } //----------------------------------------------------------------------------- void CTFWeaponPDAExpansion_Teleporter::Equip( CBasePlayer *pOwner ) { #ifdef GAME_DLL CTFPlayer *pPlayer = ToTFPlayer( pOwner ); if ( pPlayer ) { // Detonate entrance and exit CBaseObject *pObject = pPlayer->GetObjectOfType( OBJ_TELEPORTER, 0 ); if ( pObject ) { pObject->DetonateObject(); } pObject = pPlayer->GetObjectOfType( OBJ_TELEPORTER, 1 ); if ( pObject ) { pObject->DetonateObject(); } pObject = pPlayer->GetObjectOfType( OBJ_TELEPORTER, 2 ); if ( pObject ) { pObject->DetonateObject(); } pObject = pPlayer->GetObjectOfType( OBJ_TELEPORTER, 3 ); if ( pObject ) { pObject->DetonateObject(); } } #endif BaseClass::Equip( pOwner ); } //----------------------------------------------------------------------------- void CTFWeaponPDAExpansion_Teleporter::UnEquip( CBasePlayer *pOwner ) { #ifdef GAME_DLL CTFPlayer *pPlayer = ToTFPlayer( pOwner ); if ( pPlayer ) { // Detonate entrance and exit CBaseObject *pObject = pPlayer->GetObjectOfType( OBJ_TELEPORTER, 0 ); if ( pObject ) { pObject->DetonateObject(); } pObject = pPlayer->GetObjectOfType( OBJ_TELEPORTER, 1 ); if ( pObject ) { pObject->DetonateObject(); } pObject = pPlayer->GetObjectOfType( OBJ_TELEPORTER, 2 ); if ( pObject ) { pObject->DetonateObject(); } pObject = pPlayer->GetObjectOfType( OBJ_TELEPORTER, 3 ); if ( pObject ) { pObject->DetonateObject(); } } #endif BaseClass::UnEquip( pOwner ); } //----------------------------------------------------------------------------- // Purpose: Check if we should show the "destroy" panel //----------------------------------------------------------------------------- bool CTFWeaponPDA_Engineer_Destroy::VisibleInWeaponSelection( void ) { if ( IsConsole() #ifdef CLIENT_DLL || ::input->IsSteamControllerActive() || tf_build_menu_controller_mode.GetBool() #endif ) { return false; } return BaseClass::VisibleInWeaponSelection(); } #ifdef STAGING_ONLY //----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- bool CTFWeaponPDA_Spy_Build::CanDeploy( void ) { if ( !TFGameRules() || !TFGameRules()->GameModeUsesUpgrades() ) return false; CTFPlayer *pPlayer = GetTFPlayerOwner(); if ( !pPlayer || !pPlayer->m_Shared.CanBuildSpyTraps() ) return false; return BaseClass::CanDeploy(); } //----------------------------------------------------------------------------- // Purpose: UI Progress //----------------------------------------------------------------------------- float CTFWeaponPDA_Spy_Build::GetProgress( void ) { CTFPlayer *pPlayer = GetTFPlayerOwner(); if ( !pPlayer ) return 0.f; return pPlayer->m_Shared.GetRageMeter() / 100.0f; } bool CTFWeaponPDA_Spy_Build::VisibleInWeaponSelection( void ) { if ( !BaseClass::VisibleInWeaponSelection() ) return false; return TFGameRules() && TFGameRules()->GameModeUsesUpgrades(); } #endif // STAGING_ONLY
23.864564
112
0.640286
cstom4994
9cb914f7946f09e7cb641b6cc7223539ebb8d534
315
cpp
C++
test/doom_test.cpp
Aneurin/devilutionX
b3274325a1a47b917df484ee7b92c8b641e26c13
[ "Unlicense" ]
4
2021-05-11T06:10:24.000Z
2021-07-31T22:31:03.000Z
test/doom_test.cpp
Aneurin/devilutionX
b3274325a1a47b917df484ee7b92c8b641e26c13
[ "Unlicense" ]
6
2020-07-25T22:09:00.000Z
2020-07-26T04:32:34.000Z
test/doom_test.cpp
Aneurin/devilutionX
b3274325a1a47b917df484ee7b92c8b641e26c13
[ "Unlicense" ]
1
2021-08-01T11:55:36.000Z
2021-08-01T11:55:36.000Z
#include <gtest/gtest.h> #include "doom.h" using namespace devilution; TEST(Doom, doom_get_frame_from_time) { DoomQuestState = 1200 * 8 + 548; EXPECT_EQ(doom_get_frame_from_time(), 8); } TEST(Doom, doom_get_frame_from_time_max) { DoomQuestState = 1200 * 30 + 1; EXPECT_EQ(doom_get_frame_from_time(), 31); }
17.5
43
0.742857
Aneurin
9cbe87c5cb1260cfa37e51b99b9eba34cd5783df
1,187
cpp
C++
Plugins/CustomVariantManager/Source/4Application/Private/ApplicationModule.cpp
IhnoL/GoogleMockUnreal
0f52573de99b7f4e94d3af3eff37a64a1b03a8e2
[ "Apache-2.0" ]
4
2021-06-29T00:06:03.000Z
2022-03-09T11:29:59.000Z
Plugins/CustomVariantManager/Source/4Application/Private/ApplicationModule.cpp
IhnoL/GoogleMockUnreal
0f52573de99b7f4e94d3af3eff37a64a1b03a8e2
[ "Apache-2.0" ]
null
null
null
Plugins/CustomVariantManager/Source/4Application/Private/ApplicationModule.cpp
IhnoL/GoogleMockUnreal
0f52573de99b7f4e94d3af3eff37a64a1b03a8e2
[ "Apache-2.0" ]
null
null
null
#define LOCTEXT_NAMESPACE "FApplicationModule" #include "ApplicationModule.h" #include "Scenes/GeometryVariantSetDetail/IGeometryVariantSetDataStore.h" #include "Scenes/GeometryVariantSetDetail/IGeometryVariantSetDetailInteractor.h" #include "Scenes/GeometryVariantSetDetail/Interactor/GeometryVariantSetDetailInteractor.h" void FApplicationModule::RegisterVIPInterfaces() { Container.RegisterClass<IGeometryVariantSetDatastore, FGeometryVariantSetDatastore>(ETypeContainerScope::Process); Container.RegisterClass<IGeometryVariantSetDetailInteractor, FGeometryVariantSetDetailInteractor>(ETypeContainerScope::Process); #if WITH_GOOGLE_TEST OnVipInterfacesRegisteredDelegate.ExecuteIfBound(); #endif } void FApplicationModule::UnregisterVIPInterfaces() { Container.Unregister<IGeometryVariantSetDatastore>(); Container.Unregister<IGeometryVariantSetDetailInteractor>(); } void FApplicationModule::StartupModule() { UE_LOG(LogTemp, Warning, TEXT("Application module has started!")); } void FApplicationModule::ShutdownModule() { UE_LOG(LogTemp, Warning, TEXT("Application module has shut down")); } #undef LOCTEXT_NAMESPACE IMPLEMENT_MODULE(FApplicationModule,Application)
32.972222
129
0.850042
IhnoL
9cc07e6bb048c268523d5879dbe8ae6856e725cd
5,905
hpp
C++
MemStream2.hpp
zswdjh/A_Functional_Database_Application
79583984aac3b8dfd007633ac0a1f39f7e2cb573
[ "MIT" ]
null
null
null
MemStream2.hpp
zswdjh/A_Functional_Database_Application
79583984aac3b8dfd007633ac0a1f39f7e2cb573
[ "MIT" ]
null
null
null
MemStream2.hpp
zswdjh/A_Functional_Database_Application
79583984aac3b8dfd007633ac0a1f39f7e2cb573
[ "MIT" ]
null
null
null
// // MemStream2.hpp // ECEDatabase5 // // Created by rick gessner on 5/8/18. // Copyright © 2018 rick gessner. All rights reserved. // #ifndef MemStream2_h #define MemStream2_h #include <fstream> #include <stdint.h> #include <cstdio> #include <string> #include <cstring> #include <stdexcept> #include <iostream> #include "UserValue.hpp" #include "Keywords.hpp" namespace SF { //------------------------------------------- class InMemStream { protected: char* buffer; size_t size; //actual size size_t max; //max size... int pos; //read pos public: InMemStream() { close();} InMemStream(char* aBuffer, size_t aSize, size_t aMax) : buffer(aBuffer) { size=aSize; //#bytes written into buffer... max=aMax; //actual buffer len pos=0; memcpy(buffer, aBuffer, aSize); } void close() { memset(buffer,0,max); pos=size=max=0; } bool eof() const { return pos >= size; } char* getBuffer() {return (char*)&buffer[0];} std::ifstream::pos_type tellg() {return pos;} bool seekg (size_t aPos) { if(pos<size) pos = (int)aPos; else return false; return true; } bool seekg (std::streamoff offset, std::ios_base::seekdir way) { if(way==std::ios_base::beg && offset < size) pos = (int)offset; else if(way==std::ios_base::cur && (pos + offset) < size) pos += offset; else if(way==std::ios_base::end && (size + offset) < size) pos = (int)(size + offset); else return false; return true; } template<typename T> void read(T& t) { if(eof()) throw std::runtime_error("EOF"); if((pos + sizeof(T)) > size) throw std::runtime_error("EOF"); std::memcpy(reinterpret_cast<void*>(&t), &buffer[pos], sizeof(T)); pos += sizeof(T); } void read(char* aPtr, size_t aSize) { if(eof()) throw std::runtime_error("EOF"); if((pos + aSize) > size) throw std::runtime_error("EOF"); std::memcpy(reinterpret_cast<void*>(aPtr), &buffer[pos], aSize); pos += aSize; } void read(std::string& str, const unsigned int aSize) { if (eof()) throw std::runtime_error("EOF"); if ((pos + aSize) > size) throw std::runtime_error("EOF"); str.assign(&buffer[pos], aSize); pos += str.size(); } }; InMemStream& operator >> (InMemStream& istm, UserValue& aValue) { switch(aValue.datatype) { case Keywords::integer_kw: istm.read(aValue.anInteger); aValue.value=std::to_string(aValue.anInteger); break; case Keywords::float_kw: istm.read(aValue.aFloat); aValue.value=std::to_string(aValue.aFloat); break; case Keywords::datetime_kw: istm.read(aValue.aDateTime); break; case Keywords::varchar_kw: { uint8_t theSize=0; istm.read(theSize); //grab the length... char theBuffer[256]; //YIKES -- FIX ME! Bad idea!!!! memset(theBuffer, 0, sizeof(theBuffer)); istm.read(theBuffer, theSize); aValue.value=theBuffer; } break; default: break; } return istm; } template<typename T> InMemStream& operator >> ( InMemStream& istm, T& aValue) { istm.read(aValue); return istm; } InMemStream& operator >> (InMemStream& istm, std::string& aValue) { aValue.clear(); int theSize = 0; istm.read(theSize); if(theSize<=0) return istm; istm.read(aValue, theSize); return istm; } //------------------------------------------------- class OutMemStream { protected: char* buffer; size_t max; size_t pos; //curr write offset... public: OutMemStream(char* aBuffer, size_t aMax) : max(aMax), buffer(aBuffer) { close(); } void close() { memset(buffer,0,max); pos=0; } char* getBuffer() {return (char*)&buffer[0];} std::ifstream::pos_type tellp() {return pos;} template<typename T> void write(const T& t) { size_t theSize=sizeof(T); std::memcpy(reinterpret_cast<void*>(&buffer[pos]), reinterpret_cast<const void*>(&t), theSize); pos+=theSize; } void write(const char* aPtr, size_t aSize) { std::memcpy(reinterpret_cast<void*>(&buffer[pos]), reinterpret_cast<const void*>(aPtr), aSize); pos+=aSize; } }; OutMemStream& operator << (OutMemStream& ostm, const UserValue& aValue) { uint8_t theSize = (uint8_t)aValue.value.size(); switch(aValue.datatype) { case Keywords::integer_kw: ostm.write(aValue.anInteger); break; case Keywords::float_kw: ostm.write(aValue.aFloat); break; case Keywords::datetime_kw: ostm.write(aValue.aDateTime); break; case Keywords::varchar_kw: ostm.write(theSize); ostm.write(aValue.value.c_str(), theSize); break; default: break; } return ostm; } template<typename T> OutMemStream& operator << (OutMemStream& ostm, const T& aValue) { ostm.write(aValue); return ostm; } OutMemStream& operator << (OutMemStream& ostm, const std::string& aValue) { uint8_t theSize = (uint8_t)aValue.size(); ostm.write(theSize); if(aValue.size()<=0) return ostm; ostm.write(aValue.c_str(), theSize); return ostm; } OutMemStream& operator << (OutMemStream& ostm, const char* aValue) { int theSize = (int)std::strlen(aValue); ostm.write(theSize); if(theSize<=0) return ostm; ostm.write(aValue, theSize); return ostm; } } //namespace #endif /* MemStream2_h */
23.714859
101
0.562574
zswdjh
9cc0b88f04072069caf207a769965a7eb022d5cd
14,785
cpp
C++
source/backend/cpu/CPUReduction.cpp
xindongzhang/MNN
f4740c78dc8fc67ee4596552d2257f12c48af067
[ "Apache-2.0" ]
1
2019-08-09T03:16:49.000Z
2019-08-09T03:16:49.000Z
source/backend/cpu/CPUReduction.cpp
xindongzhang/MNN
f4740c78dc8fc67ee4596552d2257f12c48af067
[ "Apache-2.0" ]
null
null
null
source/backend/cpu/CPUReduction.cpp
xindongzhang/MNN
f4740c78dc8fc67ee4596552d2257f12c48af067
[ "Apache-2.0" ]
1
2021-08-23T03:40:09.000Z
2021-08-23T03:40:09.000Z
// // CPUReduction.cpp // MNN // // Created by MNN on 2018/07/25. // Copyright © 2018, Alibaba Group Holding Limited // #include "CPUReduction.hpp" #include "CommonOptFunction.h" #include "Macro.h" #define UNIT 4 #define UNIT_DUP(value) \ { (value), (value), (value), (value) } namespace MNN { class Reduction : public Execution { public: Reduction(Backend* backend, const Op* op) : Execution(backend) { auto reduct = op->main_as_ReductionParam(); mdataType = reduct->dType(); if (nullptr == reduct->dim()) { return; } for (int i = 0; i < reduct->dim()->size(); ++i) { mAxis.push_back(reduct->dim()->data()[i]); } } virtual ~Reduction() = default; void reduce(halide_buffer_t& srcBuffer, halide_buffer_t& dstBuffer, int axis) { int outsideSize = 1; for (int x = 0; x < axis; ++x) { outsideSize *= srcBuffer.dim[x].extent; } int insideSize = 1; for (int x = axis + 1; x < srcBuffer.dimensions; ++x) { insideSize *= srcBuffer.dim[x].extent; } int axisSize = srcBuffer.dim[axis].extent; if (MNN::DataType_DT_FLOAT == mdataType) { this->onReduce((const float*)srcBuffer.host, (float*)dstBuffer.host, insideSize, outsideSize, axisSize); } else if (MNN::DataType_DT_INT32 == mdataType) { this->onReduce((const int32_t*)srcBuffer.host, (int32_t*)dstBuffer.host, insideSize, outsideSize, axisSize); } } virtual ErrorCode onExecute(const std::vector<Tensor*>& inputs, const std::vector<Tensor*>& outputs) override { auto input = inputs[0]; auto output = outputs[0]; if (mAxis.empty()) { int size = (int)input->size() / input->buffer().type.bytes(); if (MNN::DataType_DT_FLOAT == mdataType) { this->onReduce(input->host<float>(), output->host<float>(), 1, 1, size); } else if (MNN::DataType_DT_INT32 == mdataType) { this->onReduce(input->host<int32_t>(), output->host<int32_t>(), 1, 1, size); } return NO_ERROR; } auto srcBuffer = input->buffer(); for (int i = 0; i < mAxis.size() - 1; ++i) { auto axis = mAxis[i]; if (axis == -1) { axis = input->dimensions() - 1; } auto dstBuffer = mMidBuffer[i]->buffer(); reduce(srcBuffer, dstBuffer, axis); srcBuffer = dstBuffer; } int lastAxis = mAxis[mAxis.size() - 1]; if (lastAxis == -1) { lastAxis = input->dimensions() - 1; } reduce(srcBuffer, output->buffer(), lastAxis); return NO_ERROR; } virtual ErrorCode onResize(const std::vector<Tensor*>& inputs, const std::vector<Tensor*>& outputs) override { if (inputs.size() >= 2) { mAxis.clear(); auto size = inputs[1]->elementSize(); auto dims = inputs[1]->host<int32_t>(); for (int i = 0; i < size; ++i) { mAxis.emplace_back(dims[i]); } } if (mAxis.empty()) { return NO_ERROR; } mMidBuffer.clear(); auto input = inputs[0]; std::vector<int> reducedAxis; for (int i = 0; i < mAxis.size() - 1; ++i) { const auto axis = mAxis[i]; if (axis == -1) { reducedAxis.push_back(input->dimensions() - 1); } else { reducedAxis.push_back(mAxis[i]); } auto tensor = new Tensor(input->buffer().dimensions); ::memcpy(tensor->buffer().dim, input->buffer().dim, input->buffer().dimensions * sizeof(halide_dimension_t)); for (auto ra : reducedAxis) { tensor->buffer().dim[ra].extent = 1; } mMidBuffer.push_back(std::unique_ptr<Tensor>(tensor)); } for (auto& t : mMidBuffer) { backend()->onAcquireBuffer(t.get(), Backend::DYNAMIC); backend()->onReleaseBuffer(t.get(), Backend::DYNAMIC); } return NO_ERROR; } protected: virtual void onReduce(const float* src, float* dst, int inside, int outside, int axis) const = 0; virtual void onReduce(const int32_t* src, int32_t* dst, int inside, int outsize, int axis) const = 0; std::vector<int> mAxis; MNN::DataType mdataType; std::vector<std::unique_ptr<Tensor>> mMidBuffer; }; class MeanReduce : public Reduction { public: MeanReduce(Backend* backend, const Op* op) : Reduction(backend, op) { // nothing to do } virtual ~MeanReduce() = default; protected: virtual void onReduce(const float* src, float* dst, int inside, int outside, int axisSize) const override { for (int oi = 0; oi < outside; ++oi) { auto srcOutSide = src + oi * axisSize * inside; auto dstOutSide = dst + oi * inside; for (int ii = 0; ii < inside; ++ii) { auto srcInside = srcOutSide + ii; auto dstInside = dstOutSide + ii; float summer = 0.0f; for (int a = 0; a < axisSize; ++a) { summer += srcInside[a * inside]; } *dstInside = summer / (float)axisSize; } } } virtual void onReduce(const int32_t* src, int32_t* dst, int inside, int outside, int axisSize) const override { for (int oi = 0; oi < outside; ++oi) { auto srcOutSide = src + oi * axisSize * inside; auto dstOutSide = dst + oi * inside; for (int ii = 0; ii < inside; ++ii) { auto srcInside = srcOutSide + ii; auto dstInside = dstOutSide + ii; int32_t summer = 0; for (int a = 0; a < axisSize; ++a) { summer += srcInside[a * inside]; } *dstInside = summer / axisSize; } } } }; class SumReduce : public Reduction { public: SumReduce(Backend* backend, const Op* op) : Reduction(backend, op) { // nothing to do } virtual ~SumReduce() = default; protected: virtual void onReduce(const float* src, float* dst, int inside, int outside, int axisSize) const override { for (int oi = 0; oi < outside; ++oi) { auto srcOutSide = src + oi * axisSize * inside; auto dstOutSide = dst + oi * inside; for (int ii = 0; ii < inside; ++ii) { auto srcInside = srcOutSide + ii; auto dstInside = dstOutSide + ii; float summer = 0.0f; for (int a = 0; a < axisSize; ++a) { summer += srcInside[a * inside]; } *dstInside = summer; } } } virtual void onReduce(const int32_t* src, int32_t* dst, int inside, int outside, int axisSize) const override { for (int oi = 0; oi < outside; ++oi) { auto srcOutSide = src + oi * axisSize * inside; auto dstOutSide = dst + oi * inside; for (int ii = 0; ii < inside; ++ii) { auto srcInside = srcOutSide + ii; auto dstInside = dstOutSide + ii; int32_t summer = 0; for (int a = 0; a < axisSize; ++a) { summer += srcInside[a * inside]; } *dstInside = summer; } } } }; class MinReduce : public Reduction { public: MinReduce(Backend* backend, const Op* op) : Reduction(backend, op) { // nothing to do } virtual ~MinReduce() = default; protected: virtual void onReduce(const float* src, float* dst, int inside, int outside, int axisSize) const override { for (int oi = 0; oi < outside; ++oi) { auto srcOutSide = src + oi * axisSize * inside; auto dstOutSide = dst + oi * inside; for (int ii = 0; ii < inside; ++ii) { auto srcInside = srcOutSide + ii; auto dstInside = dstOutSide + ii; float Min = srcInside[0]; if (1 == inside) { int32_t inputCountUnit = axisSize / (UNIT * 2); int32_t remain = axisSize - (inputCountUnit * UNIT * 2); float minArray[UNIT] = UNIT_DUP(Min); MNNMinFloat((float*)srcInside, minArray, inputCountUnit); for (int i = 0; i < UNIT; i++) { Min = std::min(Min, minArray[i]); } if (remain > 0) { int currentIndex = inputCountUnit * UNIT * 2; for (int i = 0; i < remain; i++) { float currentInputData = srcInside[currentIndex + i]; Min = std::min(Min, currentInputData); } } } else { for (int a = 0; a < axisSize; ++a) { Min = std::min(Min, srcInside[a * inside]); } } *dstInside = Min; } } } virtual void onReduce(const int32_t* src, int32_t* dst, int inside, int outside, int axisSize) const override { for (int oi = 0; oi < outside; ++oi) { auto srcOutSide = src + oi * axisSize * inside; auto dstOutSide = dst + oi * inside; for (int ii = 0; ii < inside; ++ii) { auto srcInside = srcOutSide + ii; auto dstInside = dstOutSide + ii; int32_t Min = srcInside[0]; for (int a = 0; a < axisSize; ++a) { Min = std::min(Min, srcInside[a * inside]); } *dstInside = Min; } } } }; class MaxReduce : public Reduction { public: MaxReduce(Backend* backend, const Op* op) : Reduction(backend, op) { // nothing to do } virtual ~MaxReduce() = default; protected: virtual void onReduce(const float* src, float* dst, int inside, int outside, int axisSize) const override { for (int oi = 0; oi < outside; ++oi) { auto srcOutSide = src + oi * axisSize * inside; auto dstOutSide = dst + oi * inside; for (int ii = 0; ii < inside; ++ii) { auto srcInside = srcOutSide + ii; auto dstInside = dstOutSide + ii; float Max = srcInside[0]; if (1 == inside) { int32_t inputCountUnit = axisSize / (UNIT * 2); int32_t remain = axisSize - (inputCountUnit * UNIT * 2); float maxArray[UNIT] = UNIT_DUP(Max); MNNMaxFloat((float*)srcInside, maxArray, inputCountUnit); for (int i = 0; i < UNIT; i++) { Max = std::max(Max, maxArray[i]); } if (remain > 0) { int currentIndex = inputCountUnit * UNIT * 2; for (int i = 0; i < remain; i++) { float currentInputData = srcInside[currentIndex + i]; Max = std::max(Max, currentInputData); } } } else { for (int a = 0; a < axisSize; ++a) { Max = std::max(Max, srcInside[a * inside]); } } *dstInside = Max; } } } virtual void onReduce(const int32_t* src, int32_t* dst, int inside, int outside, int axisSize) const override { for (int oi = 0; oi < outside; ++oi) { auto srcOutSide = src + oi * axisSize * inside; auto dstOutSide = dst + oi * inside; for (int ii = 0; ii < inside; ++ii) { auto srcInside = srcOutSide + ii; auto dstInside = dstOutSide + ii; int32_t Max = srcInside[0]; for (int a = 0; a < axisSize; ++a) { Max = std::max(Max, srcInside[a * inside]); } *dstInside = Max; } } } }; class ProdReduce : public Reduction { public: ProdReduce(Backend* backend, const Op* op) : Reduction(backend, op) { // nothing to do } virtual ~ProdReduce() = default; protected: virtual void onReduce(const float* src, float* dst, int inside, int outside, int axisSize) const override { for (int oi = 0; oi < outside; ++oi) { auto srcOutSide = src + oi * axisSize * inside; auto dstOutSide = dst + oi * inside; for (int ii = 0; ii < inside; ++ii) { auto srcInside = srcOutSide + ii; auto dstInside = dstOutSide + ii; float product = 1.0f; for (int a = 0; a < axisSize; ++a) { product *= srcInside[a * inside]; } *dstInside = product; } } } virtual void onReduce(const int32_t* src, int32_t* dst, int inside, int outside, int axisSize) const override { for (int oi = 0; oi < outside; ++oi) { auto srcOutSide = src + oi * axisSize * inside; auto dstOutSide = dst + oi * inside; for (int ii = 0; ii < inside; ++ii) { auto srcInside = srcOutSide + ii; auto dstInside = dstOutSide + ii; int32_t product = 1; for (int a = 0; a < axisSize; ++a) { product *= srcInside[a * inside]; } *dstInside = product; } } } }; Execution* CPUReductionCreator::onCreate(const std::vector<Tensor*>& inputs, const std::vector<Tensor*>& outputs, const MNN::Op* op, Backend* backend) const { switch (op->main_as_ReductionParam()->operation()) { case ReductionType_MEAN: return new MeanReduce(backend, op); case ReductionType_SUM: return new SumReduce(backend, op); case ReductionType_MINIMUM: return new MinReduce(backend, op); case ReductionType_MAXIMUM: return new MaxReduce(backend, op); case ReductionType_PROD: return new ProdReduce(backend, op); default: MNN_ASSERT(false); break; } return nullptr; } REGISTER_CPU_OP_CREATOR(CPUReductionCreator, OpType_Reduction); } // namespace MNN
37.620865
120
0.497328
xindongzhang
9cc3e2e224a36a3d811a29fab5f252451791d505
3,551
cpp
C++
src/Writer.cpp
AmayaHena/ClassCreatorGeneric
0d332d3fd3996f9fc3269878a31ae4fdda00b10e
[ "MIT" ]
null
null
null
src/Writer.cpp
AmayaHena/ClassCreatorGeneric
0d332d3fd3996f9fc3269878a31ae4fdda00b10e
[ "MIT" ]
null
null
null
src/Writer.cpp
AmayaHena/ClassCreatorGeneric
0d332d3fd3996f9fc3269878a31ae4fdda00b10e
[ "MIT" ]
null
null
null
/* ** EPITECH PROJECT, 2019 ** ClassCreator ** File description: ** Writer */ /* STD Library */ #include <functional> /* STD Types Library */ #include <fstream> #include <string> #include "Writer.hpp" Writer::Writer() : _tag_ref("/*#!") { _tagMake["ProgramName"] = PROGNAME; _tagMake["SrcMakefile"] = SRCMAKE; _tagMake["SrcCMake"] = SRCCMAKE; _tagMake["IncCMake"] = INCCMAKE; _tagMake["Compiler"] = COMPILER; } void Writer::setHeader(std::vector<std::string> v) { _header = v; } void Writer::setFile(const std::vector<std::string> &v) { _file = v; } void Writer::setSrc(const std::vector<std::string> &v) { _src = v; } void Writer::setInc(const std::vector<std::string> &v) { _inc = v; } void Writer::setCompiler(const std::string &s) { _compiler = s; } void Writer::cleanRessources() { _of.close(); _file.clear(); _src.clear(); _inc.clear(); } int Writer::occurenceNbInS(const std::string &s, const std::string &tag) { int N = s.length(); int M = tag.length(); int match = 0; int j = 0; for (int i = 0; i <= N - M; i++) { for (j = 0; j < M; j++) if (s[i + j] != tag[j]) break; if (j == M) match++; } return match; } void Writer::writeVectorInFile(const std::string &s1, const std::vector<std::string> &v, const std::string &s2) { for (const std::string &s: v) _of << s1 << s << s2 << std::endl; } std::ofstream Writer::createFile(const std::string &name, const std::string &path, const std::string &type) { std::string s; if (type == "Makefile") s = path + "/Makefile"; else if (type == "CMake") s = path + "/CMakeLists.txt"; else s = path + "/" + name + type; std::ofstream file(s); std::cout << "\033[0;32mFile \033[0m" << path << '/' << name << "\033[0;32m created\033[0m" << std::endl; return file; } void Writer::useTagG(const std::string &tag, const std::string &name) { if (tag == "FileName") _of << name; } void Writer::useTagMake(const std::string &tag, const std::string &path) { switch (_tagMake[tag]) { case PROGNAME : _of << path; return; case SRCMAKE : Writer::writeVectorInFile("\t\t", _src, "\t\\"); return; case SRCCMAKE : Writer::writeVectorInFile("\t", _src, ""); return; case INCCMAKE : Writer::writeVectorInFile("\t", _inc, ""); return; case COMPILER : _of << _compiler; return; } } void Writer::useTag(const std::string &name, const std::string &tag, const std::string &path, const std::string &type) { if (tag == "Header") { Writer::writeVectorInFile("", _header, ""); return; } if ((type == "Makefile") || type == "CMake") { Writer::useTagMake(tag, path); return; } Writer::useTagG(tag, name); } void Writer::processTag(const std::string &s, const std::string &name, const std::string &path, const std::string type) { std::string buf; int i = 0; int j = s.find(_tag_ref, 0); int k = Writer::occurenceNbInS(s, _tag_ref); for (int m = 0; m != k; m++) { while (i < j) _of << s[i++]; while (s[i++] != '!'); while (s[i] != '*') buf += s[i++]; i += 2; Writer::useTag(name, buf, path, type); j = s.find(_tag_ref, j + 1); buf.clear(); } for (unsigned int pos = i; pos < s.length(); pos++) _of << s[pos]; _of << std::endl; } bool Writer::create(const std::string &name, const std::string &path, const std::string type) { _of = Writer::createFile(name, path, type); for (const std::string &s: _file) { if (Writer::occurenceNbInS(s, _tag_ref) > 0) Writer::processTag(s, name, path, type); else _of << s << std::endl; } Writer::cleanRessources(); return true; }
20.526012
119
0.608561
AmayaHena
9cc4c88453298c67fa3b7f596f3e38c2abf2e0ae
12,926
cpp
C++
hdf5-1.8.20/c++/src/H5FcreatProp.cpp
GWU-CFD/flash-distro
740f45047bde057365823036158893c19c6d7c72
[ "MIT" ]
null
null
null
hdf5-1.8.20/c++/src/H5FcreatProp.cpp
GWU-CFD/flash-distro
740f45047bde057365823036158893c19c6d7c72
[ "MIT" ]
null
null
null
hdf5-1.8.20/c++/src/H5FcreatProp.cpp
GWU-CFD/flash-distro
740f45047bde057365823036158893c19c6d7c72
[ "MIT" ]
null
null
null
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * * the COPYING file, which can be found at the root of the source code * * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * * If you do not have access to either file, you may request a copy from * * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include <string> #include "H5Include.h" #include "H5Exception.h" #include "H5IdComponent.h" #include "H5PropList.h" #include "H5FcreatProp.h" namespace H5 { #ifndef DOXYGEN_SHOULD_SKIP_THIS // This DOXYGEN_SHOULD_SKIP_THIS block is a work-around approach to control // the order of creation and deletion of the global constants. See Design Notes // in "H5PredType.cpp" for information. // Initialize a pointer for the constant FileCreatPropList* FileCreatPropList::DEFAULT_ = 0; //-------------------------------------------------------------------------- // Function: FileCreatPropList::getConstant // Purpose: Creates a FileCreatPropList object representing the HDF5 // constant H5P_FILE_ACCESS, pointed to by FileCreatPropList::DEFAULT_ // exception H5::PropListIException // Description // If FileCreatPropList::DEFAULT_ already points to an allocated // object, throw a PropListIException. This scenario should not happen. // Programmer Binh-Minh Ribler - 2015 //-------------------------------------------------------------------------- FileCreatPropList* FileCreatPropList::getConstant() { // Tell the C library not to clean up, H5Library::termH5cpp will call // H5close - more dependency if use H5Library::dontAtExit() if (!IdComponent::H5dontAtexit_called) { (void) H5dont_atexit(); IdComponent::H5dontAtexit_called = true; } // If the constant pointer is not allocated, allocate it. Otherwise, // throw because it shouldn't be. if (DEFAULT_ == 0) DEFAULT_ = new FileCreatPropList(H5P_FILE_CREATE); else throw PropListIException("FileCreatPropList::getConstant", "FileCreatPropList::getConstant is being invoked on an allocated DEFAULT_"); return(DEFAULT_); } //-------------------------------------------------------------------------- // Function: FileCreatPropList::deleteConstants // Purpose: Deletes the constant object that FileCreatPropList::DEFAULT_ // points to. // Programmer Binh-Minh Ribler - 2015 //-------------------------------------------------------------------------- void FileCreatPropList::deleteConstants() { if (DEFAULT_ != 0) delete DEFAULT_; } //-------------------------------------------------------------------------- // Purpose Constant for default property //-------------------------------------------------------------------------- const FileCreatPropList& FileCreatPropList::DEFAULT = *getConstant(); #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- // Function: FileCreatPropList default constructor ///\brief Default constructor: Creates a file create property list // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- FileCreatPropList::FileCreatPropList() : PropList(H5P_FILE_CREATE) {} //-------------------------------------------------------------------------- // Function: FileCreatPropList copy constructor ///\brief Copy constructor: makes a copy of the original /// FileCreatPropList object. ///\param original - IN: FileCreatPropList instance to copy // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- FileCreatPropList::FileCreatPropList(const FileCreatPropList& original) : PropList(original) {} //-------------------------------------------------------------------------- // Function: FileCreatPropList overloaded constructor ///\brief Creates a file creation property list using the id of an /// existing one. ///\param plist_id - IN: FileCreatPropList id to use // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- FileCreatPropList::FileCreatPropList(const hid_t plist_id) : PropList(plist_id) {} //-------------------------------------------------------------------------- // Function: FileCreatPropList::getVersion ///\brief Retrieves version information for various parts of a file. ///\param super - OUT: The file super block. ///\param freelist - OUT: The global free list. ///\param stab - OUT: The root symbol table entry. ///\param shhdr - OUT: Shared object headers. ///\exception H5::PropListIException ///\par Description /// Any (or even all) of the output arguments can be null pointers. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void FileCreatPropList::getVersion(unsigned& super, unsigned& freelist, unsigned& stab, unsigned& shhdr) const { herr_t ret_value = H5Pget_version(id, &super, &freelist, &stab, &shhdr); if(ret_value < 0) { throw PropListIException("FileCreatPropList::getVersion", "H5Pget_version failed"); } } //-------------------------------------------------------------------------- // Function: FileCreatPropList::setUserblock ///\brief Sets the user block size field of this file creation property list. ///\param size - IN: User block size to be set, in bytes ///\exception H5::PropListIException ///\par Description /// The default user block size is 0; it may be set to any power /// of 2 equal to 512 or greater (512, 1024, 2048, etc.) // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void FileCreatPropList::setUserblock(hsize_t size) const { herr_t ret_value = H5Pset_userblock(id, size); if(ret_value < 0) { throw PropListIException("FileCreatPropList::setUserblock", "H5Pset_userblock failed"); } } //-------------------------------------------------------------------------- // Function: FileCreatPropList::getUserblock ///\brief Returns the user block size of this file creation property list. ///\return User block size ///\exception H5::PropListIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- hsize_t FileCreatPropList::getUserblock() const { hsize_t userblock_size; herr_t ret_value = H5Pget_userblock(id, &userblock_size); if(ret_value < 0) { throw PropListIException("FileCreatPropList::getUserblock", "H5Pget_userblock failed"); } return(userblock_size); } //-------------------------------------------------------------------------- // Function: FileCreatPropList::setSizes ///\brief Sets the byte size of the offsets and lengths used to /// address objects in an HDF5 file. ///\param sizeof_addr - IN: Size of an object offset in bytes ///\param sizeof_size - IN: Size of an object length in bytes. ///\exception H5::PropListIException ///\par Description /// For information on setting sizes, please refer to the /// C layer Reference Manual at: /// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetSizes // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void FileCreatPropList::setSizes(size_t sizeof_addr, size_t sizeof_size) const { herr_t ret_value = H5Pset_sizes(id, sizeof_addr, sizeof_size); if(ret_value < 0) { throw PropListIException("FileCreatPropList::setSizes", "H5Pset_sizes failed"); } } //-------------------------------------------------------------------------- // Function: FileCreatPropList::getSizes ///\brief Retrieves the size of the offsets and lengths used in an /// HDF5 file. /// ///\exception H5::PropListIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void FileCreatPropList::getSizes(size_t& sizeof_addr, size_t& sizeof_size) const { herr_t ret_value = H5Pget_sizes(id, &sizeof_addr, &sizeof_size); if(ret_value < 0) { throw PropListIException("FileCreatPropList::getSizes", "H5Pget_sizes failed"); } } //-------------------------------------------------------------------------- // Function: FileCreatPropList::setSymk ///\brief Sets the size of parameters used to control the symbol table /// nodes. ///\param ik - IN: Symbol table tree rank ///\param lk - IN: Symbol table node size ///\exception H5::PropListIException ///\par Description /// For information, please see the C layer Reference Manual at: /// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetSymK // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void FileCreatPropList::setSymk(unsigned ik, unsigned lk) const { herr_t ret_value = H5Pset_sym_k(id, ik, lk); if(ret_value < 0) { throw PropListIException("FileCreatPropList::setSymk", "H5Pset_sym_k failed"); } } //-------------------------------------------------------------------------- // Function: FileCreatPropList::getSymk ///\brief Retrieves the size of the symbol table B-tree 1/2 rank and /// the symbol table leaf node 1/2 size. /// ///\exception H5::PropListIException ///\par Description /// For information, please see /// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetSymK // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void FileCreatPropList::getSymk(unsigned& ik, unsigned& lk) const { herr_t ret_value = H5Pget_sym_k(id, &ik, &lk); if(ret_value < 0) { throw PropListIException("FileCreatPropList::getSymk", "H5Pget_sym_k failed"); } } //-------------------------------------------------------------------------- // Function: FileCreatPropList::setIstorek ///\brief Sets the size of the parameter used to control the B-trees /// for indexing chunked datasets. ///\param ik - IN: 1/2 rank of chunked storage B-tree ///\exception H5::PropListIException ///\par Description /// For information, please see the C layer Reference Manual at: /// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetIstoreK // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void FileCreatPropList::setIstorek(unsigned ik) const { herr_t ret_value = H5Pset_istore_k(id, ik); if(ret_value < 0) { throw PropListIException("FileCreatPropList::setIstorek", "H5Pset_istore_k failed"); } } //-------------------------------------------------------------------------- // Function: FileCreatPropList::getIstorek ///\brief Returns the 1/2 rank of an indexed storage B-tree. ///\return 1/2 rank of chunked storage B-tree ///\exception H5::PropListIException ///\par Description /// For information, please see /// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetIstoreK // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- unsigned FileCreatPropList::getIstorek() const { unsigned ik; herr_t ret_value = H5Pget_istore_k(id, &ik); if(ret_value < 0) { throw PropListIException("FileCreatPropList::getIstorek", "H5Pget_istore_k failed"); } return(ik); } //-------------------------------------------------------------------------- // Function: FileCreatPropList destructor ///\brief Noop destructor. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- FileCreatPropList::~FileCreatPropList() {} } // end namespace
42.943522
143
0.534195
GWU-CFD
9cc6475c1b57d20b665fae970c15f99ce2eeef0f
1,140
cpp
C++
examples/ex_spsc.cpp
ankitkk/mahi-util
0881b43c0d86d0250c9a2c3162e88a95dcbe8a33
[ "MIT" ]
10
2020-05-08T09:02:17.000Z
2021-09-17T19:18:10.000Z
examples/ex_spsc.cpp
ankitkk/mahi-util
0881b43c0d86d0250c9a2c3162e88a95dcbe8a33
[ "MIT" ]
6
2020-03-29T15:24:25.000Z
2021-07-08T07:16:51.000Z
examples/ex_spsc.cpp
ankitkk/mahi-util
0881b43c0d86d0250c9a2c3162e88a95dcbe8a33
[ "MIT" ]
11
2020-03-29T09:05:29.000Z
2022-02-11T20:59:19.000Z
#include <Mahi/Util/Templates/SPSCQueue.hpp> #include <Mahi/Util/System.hpp> #include <Mahi/Util/Print.hpp> #include <Mahi/Util/Timing/Clock.hpp> #include <thread> #include <string> #include <iostream> using namespace mahi::util; // SPSCQueue is a single-producer-single-consumer, wait free, lock free queue for multithreadeding. // It's a convenient way to send high throughput messages or data between threads without mutexing // See: https://github.com/rigtorp/SPSCQueue for more documentation. SPSCQueue<std::size_t> g_queue1(2048); const std::size_t iters = 4096*4096*16; void consumer() { std::size_t sum = 0; while (true) { while (!g_queue1.front()); auto i = *g_queue1.front(); sum += i; g_queue1.pop(); if (i == iters-1) break; } print("Sum: {}",sum); } inline void producer() { for (std::size_t i = 0; i < iters; ++i) g_queue1.push(i); } int main(int argc, char const *argv[]) { std::thread thrd(consumer); Clock clk; producer(); thrd.join(); print("Time: {} ms",clk.get_elapsed_time().as_milliseconds()); return 0; }
24.782609
99
0.642982
ankitkk
9cc7fd56e81b95750c41c34a3509777469e5a947
2,399
hpp
C++
dac_contracts/distribution/distribution.hpp
eosdac/eosdac_contracts
f213b0f07c425912692c38e8b7e07ad99da9ddca
[ "MIT" ]
16
2019-06-13T18:07:51.000Z
2021-12-09T06:43:21.000Z
dac_contracts/distribution/distribution.hpp
eosdac/eosdac_contracts
f213b0f07c425912692c38e8b7e07ad99da9ddca
[ "MIT" ]
70
2019-05-11T15:20:51.000Z
2021-08-31T17:35:24.000Z
dac_contracts/distribution/distribution.hpp
eosdac/eosdac_contracts
f213b0f07c425912692c38e8b7e07ad99da9ddca
[ "MIT" ]
11
2019-06-13T18:07:56.000Z
2021-12-19T19:11:53.000Z
#include <eosio/asset.hpp> #include <eosio/eosio.hpp> #include <eosio/multi_index.hpp> #include <eosio/print.hpp> #include <eosio/symbol.hpp> using namespace eosio; using namespace std; CONTRACT distribution : public contract { public: using contract::contract; distribution(eosio::name receiver, eosio::name code, datastream<const char *> ds) : contract(receiver, code, ds) {} struct dropdata { name receiver; asset amount; }; enum distri_types : uint8_t { CLAIMABLE = 0, SENDABLE = 1, INVALID = 2 }; ACTION regdistri(name distri_id, name dac_id, name owner, name approver_account, extended_asset total_amount, uint8_t distri_type, string memo); ACTION unregdistri(name distri_id); ACTION approve(name distri_id); ACTION populate(name distri_id, vector<dropdata> data, bool allow_modify); ACTION empty(name distri_id, uint8_t batch_size); ACTION send(name distri_id, uint8_t batch_size); ACTION claim(name distri_id, name receiver); [[eosio::on_notify("eosio.token::transfer")]] void receive(name from, name to, asset quantity, string memo); private: // table to hold distribution configs/state TABLE districonf { name distri_id; name dac_id; name owner; bool approved; // default false uint8_t distri_type; name approver_account; extended_asset total_amount; asset total_sent; // update by each claim/sendtokens asset total_received; // updated when tokens are sent to the contract string memo; uint64_t primary_key() const { return distri_id.value; } uint64_t by_dac_id() const { return dac_id.value; } uint64_t by_owner() const { return owner.value; } }; typedef eosio::multi_index<"districonfs"_n, districonf, eosio::indexed_by<"bydacid"_n, eosio::const_mem_fun<districonf, uint64_t, &districonf::by_dac_id>>, eosio::indexed_by<"byowner"_n, eosio::const_mem_fun<districonf, uint64_t, &districonf::by_owner>>> districonf_table; // scoped table by distri_id TABLE distri { name receiver; asset amount; uint64_t primary_key() const { return receiver.value; } }; typedef eosio::multi_index<"distris"_n, distri> distri_table; };
36.348485
119
0.660275
eosdac
9ccbe1107a139974ba9ae4cebce851e65872c686
2,113
hpp
C++
include/gridtools/stencil_composition/backend.hpp
jdahm/gridtools
5961932cd2ccf336d3d73b4bc967243828e55cc5
[ "BSD-3-Clause" ]
null
null
null
include/gridtools/stencil_composition/backend.hpp
jdahm/gridtools
5961932cd2ccf336d3d73b4bc967243828e55cc5
[ "BSD-3-Clause" ]
null
null
null
include/gridtools/stencil_composition/backend.hpp
jdahm/gridtools
5961932cd2ccf336d3d73b4bc967243828e55cc5
[ "BSD-3-Clause" ]
null
null
null
/* * GridTools * * Copyright (c) 2014-2019, ETH Zurich * All rights reserved. * * Please, refer to the LICENSE file in the root directory. * SPDX-License-Identifier: BSD-3-Clause */ #pragma once #include <functional> #include <utility> #include "../common/hymap.hpp" #include "../common/tuple.hpp" #include "../common/tuple_util.hpp" #include "dim.hpp" #include "make_stage_matrix.hpp" #include "positional.hpp" #include "sid/sid_shift_origin.hpp" namespace gridtools { namespace backend_impl_ { template <class Grid, class DataStores> auto shift_origin(Grid const &grid, DataStores data_stores) { return tuple_util::transform( [offsets = grid.origin()](auto &src) { return sid::shift_sid_origin(std::ref(src), offsets); }, std::move(data_stores)); } template <class Grid> auto make_positionals(Grid const &grid, std::true_type) { auto origin = grid.origin(); return tuple_util::make<hymap::keys<positional<dim::i>, positional<dim::j>, positional<dim::k>>::values>( positional<dim::i>(at_key<dim::i>(origin)), positional<dim::j>(at_key<dim::j>(origin)), positional<dim::k>(at_key<dim::k>(origin))); } template <class Grid> tuple<> make_positionals(Grid &&, std::false_type) { return {}; } template <class Backend, class NeedPositionals, class Msses> struct backend_entry_point_f { template <class Grid, class DataStores> void operator()(Grid const &grid, DataStores data_stores) const { gridtools_backend_entry_point(Backend(), make_stage_matrices<Msses, NeedPositionals, typename Grid::interval_t, DataStores>(), grid, hymap::concat( shift_origin(grid, std::move(data_stores)), make_positionals(grid, NeedPositionals()))); } }; } // namespace backend_impl_ using backend_impl_::backend_entry_point_f; } // namespace gridtools
35.216667
117
0.613819
jdahm
9ccc3c9484b256c07da2e913d882bd6ca55a7302
1,153
cpp
C++
src/dmove_eig.cpp
klast/magma
cfb849621be6f697288e995831ec3c9e84530d9d
[ "BSD-3-Clause" ]
4
2020-12-04T13:31:18.000Z
2021-12-10T11:41:23.000Z
src/dmove_eig.cpp
klast/magma
cfb849621be6f697288e995831ec3c9e84530d9d
[ "BSD-3-Clause" ]
1
2021-03-27T20:00:25.000Z
2021-03-28T06:19:59.000Z
src/dmove_eig.cpp
klast/magma
cfb849621be6f697288e995831ec3c9e84530d9d
[ "BSD-3-Clause" ]
2
2020-12-04T13:23:36.000Z
2021-03-27T00:50:27.000Z
/* -- MAGMA (version 2.5.4) -- Univ. of Tennessee, Knoxville Univ. of California, Berkeley Univ. of Colorado, Denver @date October 2020 @author Raffaele Solca @author Azzam Haidar @precisions normal d -> s */ #include "magma_internal.h" extern "C" void magma_dmove_eig( magma_range_t range, magma_int_t n, double *w, magma_int_t *il, magma_int_t *iu, double vl, double vu, magma_int_t *mout) { magma_int_t valeig, indeig, i; valeig = (range == MagmaRangeV); indeig = (range == MagmaRangeI); if (indeig) { *mout = *iu - *il + 1; if (*il > 1) for (i = 0; i < *mout; ++i) w[i] = w[*il - 1 + i]; } else if (valeig) { *il=1; *iu=n; for (i = 0; i < n; ++i) { if (w[i] > vu) { *iu = i; break; } else if (w[i] < vl) ++*il; else if (*il > 1) w[i-*il+1]=w[i]; } *mout = *iu - *il + 1; } else { *il = 1; *iu = n; *mout = n; } return; }
20.963636
67
0.433651
klast
9ccee7753c800ea05ddcfb88715862cf451a0e7d
4,913
cpp
C++
thirdparty/ULib/examples/rsign/rsignclient.cpp
liftchampion/nativejson-benchmark
6d575ffa4359a5c4230f74b07d994602a8016fb5
[ "MIT" ]
null
null
null
thirdparty/ULib/examples/rsign/rsignclient.cpp
liftchampion/nativejson-benchmark
6d575ffa4359a5c4230f74b07d994602a8016fb5
[ "MIT" ]
null
null
null
thirdparty/ULib/examples/rsign/rsignclient.cpp
liftchampion/nativejson-benchmark
6d575ffa4359a5c4230f74b07d994602a8016fb5
[ "MIT" ]
null
null
null
// rsignclient.cpp #include <ulib/file_config.h> #include <ulib/utility/base64.h> #include <ulib/utility/services.h> #include <ulib/ssl/net/sslsocket.h> #include <ulib/xml/soap/soap_client.h> #undef PACKAGE #define PACKAGE "rsignclient" #undef ARGS #define ARGS "" #define U_OPTIONS \ "purpose \"client for interface to SIGN server\"\n" \ "option c config 1 \"path of configuration file\" \"\"\n" \ "option k inkey 1 \"path of private key file - format PEM\" \"\"\n" #include <ulib/application.h> template <class T> class UClientRSIGN : public USOAPClient<T> { public: // COSTRUTTORE explicit UClientRSIGN(UFileConfig* cfg) : USOAPClient<T>(cfg) {} virtual ~UClientRSIGN() {} // OBJECT FOR METHOD REQUEST class RSIGN_SIGN : public URPCMethod { // URPCMethod provides an interface for the things that methods most know how to do public: UString data, key; RSIGN_SIGN() { U_TRACE_REGISTER_OBJECT(5, RSIGN_SIGN, "") URPCMethod::method_name = U_STRING_FROM_CONSTANT("SIG2"); } virtual ~RSIGN_SIGN() { U_TRACE_UNREGISTER_OBJECT(5, RSIGN_SIGN) } // Transforms the method into something that SOAP servers and clients can send. // The encoder holds the actual data while the client hands data to be entered in virtual void encode() { U_TRACE(5, "RSIGN_SIGN::encode()") U_SOAP_ENCB64_ARG(data); U_SOAP_ENCODE_ARG(key); } }; RSIGN_SIGN m_RSIGN_SIGN; // SERVICES UString signData(const UString& n, const UString& k) // 1 { U_TRACE(5, "UClientRSIGN::signData(%.*S,%.*S)", U_STRING_TO_TRACE(n), U_STRING_TO_TRACE(k)) m_RSIGN_SIGN.data = n; m_RSIGN_SIGN.key = k; UString result; if (USOAPClient<T>::processRequest(m_RSIGN_SIGN)) { result = USOAPClient<T>::getResponse(); // Get the value of the element inside the response UString _buffer(result.size()); UBase64::decode(result, _buffer); if (_buffer) U_RETURN_STRING(_buffer); } U_RETURN_STRING(result); } }; class Application : public UApplication { public: Application() { U_TRACE(5, "Application::Application()") client = 0; } ~Application() { U_TRACE(5, "Application::~Application()") delete client; } void run(int argc, char* argv[], char* env[]) { U_TRACE(5, "Application::run(%d,%p,%p)", argc, argv, env) UApplication::run(argc, argv, env); UString::str_allocate(STR_ALLOCATE_SOAP); // manage arg operation // manage options UFileConfig cfg; UString cfg_str, cfg_key; if (UApplication::isOptions()) { cfg_str = opt['c']; cfg_key = opt['k']; } // manage file configuration if (cfg_str.empty()) cfg_str = U_STRING_FROM_CONSTANT("rsignclient.cfg"); cfg.UFile::setPath(cfg_str); // ----------------------------------------------------------------------------------------------- // client RSIGN - configuration parameters // ----------------------------------------------------------------------------------------------- // ENABLE_IPV6 flag to indicate use of ipv6 // SERVER host name or ip address for server // PORT port number for the server // CERT_FILE certificate of client // KEY_FILE private key of client // PASSWORD password for private key of client // CA_FILE locations of trusted CA certificates used in the verification // CA_PATH locations of trusted CA certificates used in the verification // VERIFY_MODE mode of verification (SSL_VERIFY_NONE=0, SSL_VERIFY_PEER=1, // SSL_VERIFY_FAIL_IF_NO_PEER_CERT=2, SSL_VERIFY_CLIENT_ONCE=4) // ----------------------------------------------------------------------------------------------- client = new UClientRSIGN<USSLSocket>(&cfg); UApplication::exit_value = 1; if (client->connect()) { // int ns__RSIGN_SIGN(const char* ca, const char* policy, const char* pkcs10, char** response); UString result, data(U_CAPACITY), key = UFile::contentOf(cfg_key); UServices::readEOF(STDIN_FILENO, data); result = client->signData(data, key); if (result.empty() == false) { (void) write(1, U_STRING_TO_PARAM(result)); UApplication::exit_value = 0; } if (UApplication::exit_value == 1) { result = client->getResponse(); if (result) U_WARNING("%v", result.rep); } } } private: UClientRSIGN<USSLSocket>* client; }; U_MAIN
26.994505
125
0.561571
liftchampion
9cd41651defe5ebc0ac43823c08c3b39643ce730
15,131
cc
C++
test/gurka/test_oneways.cc
sidilabs/valhalla
d2914a4527f2aeb7495dfdbacea60fdc0b92c6a0
[ "MIT" ]
null
null
null
test/gurka/test_oneways.cc
sidilabs/valhalla
d2914a4527f2aeb7495dfdbacea60fdc0b92c6a0
[ "MIT" ]
null
null
null
test/gurka/test_oneways.cc
sidilabs/valhalla
d2914a4527f2aeb7495dfdbacea60fdc0b92c6a0
[ "MIT" ]
null
null
null
#include "gurka.h" #include <boost/geometry.hpp> #include <boost/geometry/geometries/register/point.hpp> #include <boost/geometry/multi/geometries/register/multi_polygon.hpp> #include <gtest/gtest.h> #include <valhalla/proto/options.pb.h> #include "baldr/graphconstants.h" #include "baldr/graphreader.h" #include "loki/polygon_search.h" #include "midgard/pointll.h" #include "mjolnir/graphtilebuilder.h" #include "sif/costfactory.h" #include "worker.h" #if !defined(VALHALLA_SOURCE_DIR) #define VALHALLA_SOURCE_DIR #endif using namespace valhalla; const std::vector<std::string>& costing = {"auto", "hov", "taxi", "bus", "truck", "bicycle", "motor_scooter", "motorcycle", "pedestrian"}; const std::unordered_map<std::string, std::string> build_config{ {"mjolnir.admin", {VALHALLA_SOURCE_DIR "test/data/netherlands_admin.sqlite"}}}; constexpr double gridsize_metres = 100; // parameterized test class to test all costings class OnewayTest : public ::testing::TestWithParam<std::tuple<std::string, std::map<std::string, std::string>>> { protected: static gurka::ways ways; static std::string ascii_map; static std::map<std::string, midgard::PointLL> layout; static void SetUpTestSuite() { ascii_map = R"( A---B---C---D---E | | J---I---H---G---F )"; ways = { {"AB", {{"highway", "unclassified"}}}, {"BC", {{"highway", "unclassified"}}}, {"CD", {{"highway", "unclassified"}}}, {"DE", {{"highway", "unclassified"}}}, {"EF", {{"highway", "unclassified"}}}, {"FG", {{"highway", "unclassified"}}}, {"GH", {{"highway", "unclassified"}}}, {"HI", {{"highway", "unclassified"}}}, {"IJ", {{"highway", "unclassified"}}}, }; layout = gurka::detail::map_to_coordinates(ascii_map, gridsize_metres, {5.1079374, 52.0887174}); } }; gurka::ways OnewayTest::ways = {}; std::string OnewayTest::ascii_map = {}; std::map<std::string, midgard::PointLL> OnewayTest::layout = {}; TEST_P(OnewayTest, TestOneways) { const auto& param_cost = std::get<0>(GetParam()); auto test_ways = ways; test_ways.emplace("DG", std::get<1>(GetParam())); auto map = gurka::buildtiles(layout, test_ways, {}, {}, "test/data/gurka_oneway", build_config); auto result = gurka::do_action(valhalla::Options::route, map, {"A", "J"}, param_cost); gurka::assert::raw::expect_path(result, {"AB", "BC", "CD", "DG", "GH", "HI", "IJ"}); // loop over the other modes for (auto const& c : costing) { result = gurka::do_action(valhalla::Options::route, map, {"J", "A"}, c); if (c == "pedestrian" && c != param_cost) gurka::assert::raw::expect_path(result, {"IJ", "HI", "GH", "DG", "CD", "BC", "AB"}); else gurka::assert::raw::expect_path(result, {"IJ", "HI", "GH", "FG", "EF", "DE", "CD", "BC", "AB"}); } } TEST_P(OnewayTest, TestReverseOneways) { const auto& param_cost = std::get<0>(GetParam()); auto test_ways = ways; bool is_psv = false; auto way_attributes = std::get<1>(GetParam()); std::map<std::string, std::string> updated_attributes; for (auto const& w : way_attributes) { if (w.first == "highway" || w.first == "oneway") updated_attributes.emplace(w.first, w.second); else { updated_attributes.emplace(w.first, "-1"); if (w.first == "oneway:psv") // taxi and bus onewayness will be updated. is_psv = true; } } test_ways.emplace("DG", updated_attributes); auto map = gurka::buildtiles(layout, test_ways, {}, {}, "test/data/gurka_reverse_oneway", build_config); auto result = gurka::do_action(valhalla::Options::route, map, {"A", "J"}, param_cost); gurka::assert::raw::expect_path(result, {"AB", "BC", "CD", "DE", "EF", "FG", "GH", "HI", "IJ"}); // loop over the other modes for (auto const& c : costing) { result = gurka::do_action(valhalla::Options::route, map, {"J", "A"}, c); if (c == param_cost || c == "pedestrian" || (is_psv && (c == "bus" || c == "taxi"))) gurka::assert::raw::expect_path(result, {"IJ", "HI", "GH", "DG", "CD", "BC", "AB"}); else // still has to go around the block...oneway:<mode>=-1 should have no impact on this costing. gurka::assert::raw::expect_path(result, {"IJ", "HI", "GH", "FG", "EF", "DE", "CD", "BC", "AB"}); } } TEST_P(OnewayTest, TestOnewaysWithYes) { const auto& param_cost = std::get<0>(GetParam()); auto test_ways = ways; bool is_psv = false; auto way_attributes = std::get<1>(GetParam()); std::map<std::string, std::string> updated_attributes; for (auto const& w : way_attributes) { if (w.first == "oneway") continue; // toss oneway=yes else { updated_attributes.emplace(w.first, w.second); if (w.first == "oneway:psv") // taxi and bus onewayness will be updated. is_psv = true; } } test_ways.emplace("DG", updated_attributes); auto map = gurka::buildtiles(layout, test_ways, {}, {}, "test/data/gurka_oneway_with_yes", build_config); auto result = gurka::do_action(valhalla::Options::route, map, {"A", "J"}, param_cost); gurka::assert::raw::expect_path(result, {"AB", "BC", "CD", "DG", "GH", "HI", "IJ"}); // loop over the other modes for (auto const& c : costing) { result = gurka::do_action(valhalla::Options::route, map, {"J", "A"}, c); if (c == param_cost || (is_psv && (c == "bus" || c == "taxi"))) gurka::assert::raw::expect_path(result, {"IJ", "HI", "GH", "FG", "EF", "DE", "CD", "BC", "AB"}); else gurka::assert::raw::expect_path(result, {"IJ", "HI", "GH", "DG", "CD", "BC", "AB"}); } } TEST_P(OnewayTest, TestOnewaysWithOnewayNo) { const auto& param_cost = std::get<0>(GetParam()); auto test_ways = ways; bool is_psv = false; auto way_attributes = std::get<1>(GetParam()); std::map<std::string, std::string> updated_attributes; for (auto const& w : way_attributes) { if (w.first == "oneway") updated_attributes.emplace(w.first, "no"); else { updated_attributes.emplace(w.first, w.second); if (w.first == "oneway:psv") // taxi and bus onewayness will be updated. is_psv = true; } } test_ways.emplace("DG", updated_attributes); auto map = gurka::buildtiles(layout, test_ways, {}, {}, "test/data/gurka_oneway_no", build_config); auto result = gurka::do_action(valhalla::Options::route, map, {"A", "J"}, param_cost); gurka::assert::raw::expect_path(result, {"AB", "BC", "CD", "DG", "GH", "HI", "IJ"}); // loop over the other modes for (auto const& c : costing) { result = gurka::do_action(valhalla::Options::route, map, {"J", "A"}, c); if (c == param_cost || (is_psv && (c == "bus" || c == "taxi"))) gurka::assert::raw::expect_path(result, {"IJ", "HI", "GH", "FG", "EF", "DE", "CD", "BC", "AB"}); else gurka::assert::raw::expect_path(result, {"IJ", "HI", "GH", "DG", "CD", "BC", "AB"}); } } TEST_P(OnewayTest, TestOnewaysWithNo) { const auto& param_cost = std::get<0>(GetParam()); auto test_ways = ways; bool is_psv = false; auto way_attributes = std::get<1>(GetParam()); std::map<std::string, std::string> updated_attributes; for (auto const& w : way_attributes) { if (w.first == "highway" || w.first == "oneway") updated_attributes.emplace(w.first, w.second); else { updated_attributes.emplace(w.first, "no"); if (w.first == "oneway:psv") // taxi and bus onewayness will be updated. is_psv = true; } } test_ways.emplace("DG", updated_attributes); auto map = gurka::buildtiles(layout, test_ways, {}, {}, "test/data/gurka_oneway_with_no", build_config); auto result = gurka::do_action(valhalla::Options::route, map, {"A", "J"}, param_cost); gurka::assert::raw::expect_path(result, {"AB", "BC", "CD", "DG", "GH", "HI", "IJ"}); // loop over the other modes for (auto const& c : costing) { result = gurka::do_action(valhalla::Options::route, map, {"J", "A"}, c); if (c == param_cost || c == "pedestrian" || (is_psv && (c == "bus" || c == "taxi"))) gurka::assert::raw::expect_path(result, {"IJ", "HI", "GH", "DG", "CD", "BC", "AB"}); else gurka::assert::raw::expect_path(result, {"IJ", "HI", "GH", "FG", "EF", "DE", "CD", "BC", "AB"}); } } TEST_P(OnewayTest, TestSharedLane) { const auto& param_cost = std::get<0>(GetParam()); auto test_ways = ways; auto way_attributes = std::get<1>(GetParam()); way_attributes.emplace("cycleway", "shared_lane"); test_ways.emplace("DG", way_attributes); auto map = gurka::buildtiles(layout, test_ways, {}, {}, "test/data/gurka_oneway_shared", build_config); auto result = gurka::do_action(valhalla::Options::route, map, {"A", "J"}, param_cost); gurka::assert::raw::expect_path(result, {"AB", "BC", "CD", "DG", "GH", "HI", "IJ"}); // loop over the other modes for (auto const& c : costing) { result = gurka::do_action(valhalla::Options::route, map, {"J", "A"}, c); if (c == "pedestrian" && c != param_cost) gurka::assert::raw::expect_path(result, {"IJ", "HI", "GH", "DG", "CD", "BC", "AB"}); else gurka::assert::raw::expect_path(result, {"IJ", "HI", "GH", "FG", "EF", "DE", "CD", "BC", "AB"}); } } TEST_P(OnewayTest, TestOpposite) { const auto& param_cost = std::get<0>(GetParam()); auto test_ways = ways; auto way_attributes = std::get<1>(GetParam()); way_attributes.emplace("cycleway", "opposite"); test_ways.emplace("DG", way_attributes); auto map = gurka::buildtiles(layout, test_ways, {}, {}, "test/data/gurka_oneway_opposite", build_config); auto result = gurka::do_action(valhalla::Options::route, map, {"A", "J"}, param_cost); if (param_cost == "bicycle") // opposite flips the onewayness gurka::assert::raw::expect_path(result, {"AB", "BC", "CD", "DE", "EF", "FG", "GH", "HI", "IJ"}); else gurka::assert::raw::expect_path(result, {"AB", "BC", "CD", "DG", "GH", "HI", "IJ"}); // loop over the other modes for (auto const& c : costing) { result = gurka::do_action(valhalla::Options::route, map, {"J", "A"}, c); if ((c == "pedestrian" && c != param_cost) || c == "bicycle") gurka::assert::raw::expect_path(result, {"IJ", "HI", "GH", "DG", "CD", "BC", "AB"}); else gurka::assert::raw::expect_path(result, {"IJ", "HI", "GH", "FG", "EF", "DE", "CD", "BC", "AB"}); } } TEST_P(OnewayTest, TestOppositeWithNo) { const auto& param_cost = std::get<0>(GetParam()); auto test_ways = ways; bool is_psv = false; auto way_attributes = std::get<1>(GetParam()); std::map<std::string, std::string> updated_attributes; for (auto const& w : way_attributes) { if (w.first == "highway" || w.first == "oneway") updated_attributes.emplace(w.first, w.second); else { updated_attributes.emplace(w.first, "no"); if (w.first == "oneway:psv") // taxi and bus onewayness will be updated. is_psv = true; } } updated_attributes.emplace("cycleway", "opposite"); test_ways.emplace("DG", updated_attributes); auto map = gurka::buildtiles(layout, test_ways, {}, {}, "test/data/gurka_oneway_opposite_no", build_config); auto result = gurka::do_action(valhalla::Options::route, map, {"A", "J"}, param_cost); gurka::assert::raw::expect_path(result, {"AB", "BC", "CD", "DG", "GH", "HI", "IJ"}); // loop over the other modes for (auto const& c : costing) { result = gurka::do_action(valhalla::Options::route, map, {"J", "A"}, c); if (c == "pedestrian" || c == "bicycle" || c == param_cost || (is_psv && (c == "bus" || c == "taxi"))) gurka::assert::raw::expect_path(result, {"IJ", "HI", "GH", "DG", "CD", "BC", "AB"}); else gurka::assert::raw::expect_path(result, {"IJ", "HI", "GH", "FG", "EF", "DE", "CD", "BC", "AB"}); } } INSTANTIATE_TEST_SUITE_P( OnewayProfilesTest, OnewayTest, ::testing::Values(std::make_tuple("taxi", std::map<std::string, std::string>{{"highway", "unclassified"}, {"oneway", "yes"}, {"oneway:psv", "yes"}}), std::make_tuple("taxi", std::map<std::string, std::string>{{"highway", "unclassified"}, {"oneway", "yes"}, {"oneway:taxi", "yes"}}), std::make_tuple("bus", std::map<std::string, std::string>{{"highway", "unclassified"}, {"oneway", "yes"}, {"oneway:psv", "yes"}}), std::make_tuple("bus", std::map<std::string, std::string>{{"highway", "unclassified"}, {"oneway", "yes"}, {"oneway:bus", "yes"}}), std::make_tuple("bicycle", std::map<std::string, std::string>{{"highway", "unclassified"}, {"oneway", "yes"}, {"oneway:bicycle", "yes"}}), std::make_tuple("motor_scooter", std::map<std::string, std::string>{{"highway", "unclassified"}, {"oneway", "yes"}, {"oneway:mofa", "yes"}}), std::make_tuple("motor_scooter", std::map<std::string, std::string>{{"highway", "unclassified"}, {"oneway", "yes"}, {"oneway:moped", "yes"}}), std::make_tuple("motorcycle", std::map<std::string, std::string>{{"highway", "unclassified"}, {"oneway", "yes"}, {"oneway:motorcycle", "yes"}}), std::make_tuple("pedestrian", std::map<std::string, std::string>{{"highway", "unclassified"}, {"oneway", "yes"}, {"oneway:foot", "yes"}})));
43.731214
102
0.526667
sidilabs
9cd45c257fc7f0a43fee25df1556895064fd3ae0
12,141
cpp
C++
Foobar2000_SDK/foobar2000/SDK/metadb_handle_list.cpp
pfqwsqqq/lyrics-extend-source-for-lyrics3
0337bae961952cfbedeac377d60743c5c6ec16b8
[ "Zlib" ]
null
null
null
Foobar2000_SDK/foobar2000/SDK/metadb_handle_list.cpp
pfqwsqqq/lyrics-extend-source-for-lyrics3
0337bae961952cfbedeac377d60743c5c6ec16b8
[ "Zlib" ]
null
null
null
Foobar2000_SDK/foobar2000/SDK/metadb_handle_list.cpp
pfqwsqqq/lyrics-extend-source-for-lyrics3
0337bae961952cfbedeac377d60743c5c6ec16b8
[ "Zlib" ]
1
2019-04-20T06:32:58.000Z
2019-04-20T06:32:58.000Z
#include "foobar2000.h" #include <shlwapi.h> namespace { wchar_t * makeSortString(const char * in) { wchar_t * out = new wchar_t[pfc::stringcvt::estimate_utf8_to_wide(in) + 1]; out[0] = ' ';//StrCmpLogicalW bug workaround. pfc::stringcvt::convert_utf8_to_wide_unchecked(out + 1, in); return out; } struct custom_sort_data { wchar_t * text; t_size index; }; } template<int direction> static int custom_sort_compare(const custom_sort_data & elem1, const custom_sort_data & elem2 ) { int ret = direction * StrCmpLogicalW(elem1.text,elem2.text); if (ret == 0) ret = pfc::sgn_t((t_ssize)elem1.index - (t_ssize)elem2.index); return ret; } template<int direction> static int _cdecl _custom_sort_compare(const void * v1, const void * v2) { return custom_sort_compare<direction>(*reinterpret_cast<const custom_sort_data*>(v1),*reinterpret_cast<const custom_sort_data*>(v2)); } void metadb_handle_list_helper::sort_by_format(metadb_handle_list_ref p_list,const char * spec,titleformat_hook * p_hook) { service_ptr_t<titleformat_object> script; if (static_api_ptr_t<titleformat_compiler>()->compile(script,spec)) sort_by_format(p_list,script,p_hook); } void metadb_handle_list_helper::sort_by_format_get_order(metadb_handle_list_cref p_list,t_size* order,const char * spec,titleformat_hook * p_hook) { service_ptr_t<titleformat_object> script; if (static_api_ptr_t<titleformat_compiler>()->compile(script,spec)) sort_by_format_get_order(p_list,order,script,p_hook); } void metadb_handle_list_helper::sort_by_format(metadb_handle_list_ref p_list,const service_ptr_t<titleformat_object> & p_script,titleformat_hook * p_hook, int direction) { const t_size count = p_list.get_count(); pfc::array_t<t_size> order; order.set_size(count); sort_by_format_get_order(p_list,order.get_ptr(),p_script,p_hook,direction); p_list.reorder(order.get_ptr()); } namespace { class tfhook_sort : public titleformat_hook { public: tfhook_sort() { m_API->seed((unsigned)__rdtsc()); } bool process_field(titleformat_text_out * p_out,const char * p_name,t_size p_name_length,bool & p_found_flag) { return false; } bool process_function(titleformat_text_out * p_out,const char * p_name,t_size p_name_length,titleformat_hook_function_params * p_params,bool & p_found_flag) { if (stricmp_utf8_ex(p_name, p_name_length, "rand", ~0) == 0) { t_size param_count = p_params->get_param_count(); t_uint32 val; if (param_count == 1) { t_uint32 mod = (t_uint32)p_params->get_param_uint(0); if (mod > 0) { val = m_API->genrand(mod); } else { val = 0; } } else { val = m_API->genrand(0xFFFFFFFF); } p_out->write_int(titleformat_inputtypes::unknown, val); p_found_flag = true; return true; } else { return false; } } private: static_api_ptr_t<genrand_service> m_API; }; class tfthread : public pfc::thread { public: tfthread(pfc::counter * walk, metadb_handle_list_cref items,custom_sort_data * out,titleformat_object::ptr script,titleformat_hook * hook) : m_walk(walk), m_items(items), m_out(out), m_script(script), m_hook(hook) {} ~tfthread() {waitTillDone();} void threadProc() { TRACK_CALL_TEXT("metadb_handle sort helper thread"); tfhook_sort myHook; titleformat_hook_impl_splitter hookSplitter(&myHook, m_hook); titleformat_hook * const hookPtr = m_hook ? pfc::implicit_cast<titleformat_hook*>(&hookSplitter) : &myHook; pfc::string8_fastalloc temp; temp.prealloc(512); const t_size total = m_items.get_size(); for(;;) { const t_size index = (*m_walk)++; if (index >= total) break; m_out[index].index = index; m_items[index]->format_title_nonlocking(hookPtr,temp,m_script,0); m_out[index].text = makeSortString(temp); } } private: pfc::counter * const m_walk; metadb_handle_list_cref m_items; custom_sort_data * const m_out; titleformat_object::ptr const m_script; titleformat_hook * const m_hook; }; } void metadb_handle_list_helper::sort_by_format_get_order(metadb_handle_list_cref p_list,t_size* order,const service_ptr_t<titleformat_object> & p_script,titleformat_hook * p_hook,int p_direction) { // pfc::hires_timer timer; timer.start(); const t_size count = p_list.get_count(); pfc::array_t<custom_sort_data> data; data.set_size(count); { in_metadb_sync sync; pfc::counter counter(0); pfc::array_t<pfc::rcptr_t<tfthread> > threads; threads.set_size(pfc::getOptimalWorkerThreadCountEx(p_list.get_count() / 128)); PFC_ASSERT( threads.get_size() > 0 ); for(t_size walk = 0; walk < threads.get_size(); ++walk) { threads[walk].new_t(&counter,p_list,data.get_ptr(),p_script,p_hook); } for(t_size walk = 1; walk < threads.get_size(); ++walk) threads[walk]->start(); threads[0]->threadProc(); for(t_size walk = 1; walk < threads.get_size(); ++walk) threads[walk]->waitTillDone(); } // console::formatter() << "metadb_handle sort: prepared in " << pfc::format_time_ex(timer.query(),6); pfc::sort_t(data, p_direction > 0 ? custom_sort_compare<1> : custom_sort_compare<-1>,count); //qsort(data.get_ptr(),count,sizeof(custom_sort_data),p_direction > 0 ? _custom_sort_compare<1> : _custom_sort_compare<-1>); // console::formatter() << "metadb_handle sort: sorted in " << pfc::format_time_ex(timer.query(),6); for(t_size n=0;n<count;n++) { order[n]=data[n].index; delete[] data[n].text; } // console::formatter() << "metadb_handle sort: finished in " << pfc::format_time_ex(timer.query(),6); } void metadb_handle_list_helper::sort_by_relative_path(metadb_handle_list_ref p_list) { const t_size count = p_list.get_count(); pfc::array_t<t_size> order; order.set_size(count); sort_by_relative_path_get_order(p_list,order.get_ptr()); p_list.reorder(order.get_ptr()); } void metadb_handle_list_helper::sort_by_relative_path_get_order(metadb_handle_list_cref p_list,t_size* order) { const t_size count = p_list.get_count(); t_size n; pfc::array_t<custom_sort_data> data; data.set_size(count); static_api_ptr_t<library_manager> api; pfc::string8_fastalloc temp; temp.prealloc(512); for(n=0;n<count;n++) { metadb_handle_ptr item; p_list.get_item_ex(item,n); if (!api->get_relative_path(item,temp)) temp = ""; data[n].index = n; data[n].text = makeSortString(temp); //data[n].subsong = item->get_subsong_index(); } pfc::sort_t(data,custom_sort_compare<1>,count); //qsort(data.get_ptr(),count,sizeof(custom_sort_data),(int (__cdecl *)(const void *elem1, const void *elem2 ))custom_sort_compare); for(n=0;n<count;n++) { order[n]=data[n].index; delete[] data[n].text; } } void metadb_handle_list_helper::remove_duplicates(metadb_handle_list_ref p_list) { t_size count = p_list.get_count(); if (count>0) { bit_array_bittable mask(count); pfc::array_t<t_size> order; order.set_size(count); order_helper::g_fill(order); p_list.sort_get_permutation_t(pfc::compare_t<metadb_handle_ptr,metadb_handle_ptr>,order.get_ptr()); t_size n; bool found = false; for(n=0;n<count-1;n++) { if (p_list.get_item(order[n])==p_list.get_item(order[n+1])) { found = true; mask.set(order[n+1],true); } } if (found) p_list.remove_mask(mask); } } void metadb_handle_list_helper::sort_by_pointer_remove_duplicates(metadb_handle_list_ref p_list) { t_size count = p_list.get_count(); if (count>0) { sort_by_pointer(p_list); bool b_found = false; t_size n; for(n=0;n<count-1;n++) { if (p_list.get_item(n)==p_list.get_item(n+1)) { b_found = true; break; } } if (b_found) { bit_array_bittable mask(count); t_size n; for(n=0;n<count-1;n++) { if (p_list.get_item(n)==p_list.get_item(n+1)) mask.set(n+1,true); } p_list.remove_mask(mask); } } } void metadb_handle_list_helper::sort_by_path_quick(metadb_handle_list_ref p_list) { p_list.sort_t(metadb::path_compare_metadb_handle); } void metadb_handle_list_helper::sort_by_pointer(metadb_handle_list_ref p_list) { //it seems MSVC71 /GL does something highly retarded here //p_list.sort_t(pfc::compare_t<metadb_handle_ptr,metadb_handle_ptr>); p_list.sort(); } t_size metadb_handle_list_helper::bsearch_by_pointer(metadb_handle_list_cref p_list,const metadb_handle_ptr & val) { t_size blah; if (p_list.bsearch_t(pfc::compare_t<metadb_handle_ptr,metadb_handle_ptr>,val,blah)) return blah; else return ~0; } void metadb_handle_list_helper::sorted_by_pointer_extract_difference(metadb_handle_list const & p_list_1,metadb_handle_list const & p_list_2,metadb_handle_list & p_list_1_specific,metadb_handle_list & p_list_2_specific) { t_size found_1, found_2; const t_size count_1 = p_list_1.get_count(), count_2 = p_list_2.get_count(); t_size ptr_1, ptr_2; found_1 = found_2 = 0; ptr_1 = ptr_2 = 0; while(ptr_1 < count_1 || ptr_2 < count_2) { while(ptr_1 < count_1 && (ptr_2 == count_2 || p_list_1[ptr_1] < p_list_2[ptr_2])) { found_1++; t_size ptr_1_new = ptr_1 + 1; while(ptr_1_new < count_1 && p_list_1[ptr_1_new] == p_list_1[ptr_1]) ptr_1_new++; ptr_1 = ptr_1_new; } while(ptr_2 < count_2 && (ptr_1 == count_1 || p_list_2[ptr_2] < p_list_1[ptr_1])) { found_2++; t_size ptr_2_new = ptr_2 + 1; while(ptr_2_new < count_2 && p_list_2[ptr_2_new] == p_list_2[ptr_2]) ptr_2_new++; ptr_2 = ptr_2_new; } while(ptr_1 < count_1 && ptr_2 < count_2 && p_list_1[ptr_1] == p_list_2[ptr_2]) {ptr_1++; ptr_2++;} } p_list_1_specific.set_count(found_1); p_list_2_specific.set_count(found_2); if (found_1 > 0 || found_2 > 0) { found_1 = found_2 = 0; ptr_1 = ptr_2 = 0; while(ptr_1 < count_1 || ptr_2 < count_2) { while(ptr_1 < count_1 && (ptr_2 == count_2 || p_list_1[ptr_1] < p_list_2[ptr_2])) { p_list_1_specific[found_1++] = p_list_1[ptr_1]; t_size ptr_1_new = ptr_1 + 1; while(ptr_1_new < count_1 && p_list_1[ptr_1_new] == p_list_1[ptr_1]) ptr_1_new++; ptr_1 = ptr_1_new; } while(ptr_2 < count_2 && (ptr_1 == count_1 || p_list_2[ptr_2] < p_list_1[ptr_1])) { p_list_2_specific[found_2++] = p_list_2[ptr_2]; t_size ptr_2_new = ptr_2 + 1; while(ptr_2_new < count_2 && p_list_2[ptr_2_new] == p_list_2[ptr_2]) ptr_2_new++; ptr_2 = ptr_2_new; } while(ptr_1 < count_1 && ptr_2 < count_2 && p_list_1[ptr_1] == p_list_2[ptr_2]) {ptr_1++; ptr_2++;} } } } double metadb_handle_list_helper::calc_total_duration(metadb_handle_list_cref p_list) { double ret = 0; t_size n, m = p_list.get_count(); for(n=0;n<m;n++) { double temp = p_list.get_item(n)->get_length(); if (temp > 0) ret += temp; } return ret; } void metadb_handle_list_helper::sort_by_path(metadb_handle_list_ref p_list) { sort_by_format(p_list,"%path_sort%",NULL); } t_filesize metadb_handle_list_helper::calc_total_size(metadb_handle_list_cref p_list, bool skipUnknown) { metadb_handle_list list(p_list); list.sort_t(metadb::path_compare_metadb_handle); t_filesize ret = 0; t_size n, m = list.get_count(); for(n=0;n<m;n++) { if (n==0 || metadb::path_compare(list[n-1]->get_path(),list[n]->get_path())) { t_filesize t = list[n]->get_filesize(); if (t == filesize_invalid) { if (!skipUnknown) return filesize_invalid; } else { ret += t; } } } return ret; } t_filesize metadb_handle_list_helper::calc_total_size_ex(metadb_handle_list_cref p_list, bool & foundUnknown) { foundUnknown = false; metadb_handle_list list(p_list); list.sort_t(metadb::path_compare_metadb_handle); t_filesize ret = 0; t_size n, m = list.get_count(); for(n=0;n<m;n++) { if (n==0 || metadb::path_compare(list[n-1]->get_path(),list[n]->get_path())) { t_filesize t = list[n]->get_filesize(); if (t == filesize_invalid) { foundUnknown = true; } else { ret += t; } } } return ret; } bool metadb_handle_list_helper::extract_single_path(metadb_handle_list_cref list, const char * &pathOut) { const t_size total = list.get_count(); if (total == 0) return false; const char * path = list[0]->get_path(); for(t_size walk = 1; walk < total; ++walk) { if (metadb::path_compare(path, list[walk]->get_path()) != 0) return false; } pathOut = path; return true; }
30.581864
219
0.715015
pfqwsqqq
9cde04d1464313946847fffe47b366d4e9465aeb
1,352
cpp
C++
Challenges/codcad_contagem_de_algarismos.cpp
oJordany/CodCad
d3c76d8631583428f5e32caf79a421f2487dbd4c
[ "MIT" ]
null
null
null
Challenges/codcad_contagem_de_algarismos.cpp
oJordany/CodCad
d3c76d8631583428f5e32caf79a421f2487dbd4c
[ "MIT" ]
8
2021-12-23T13:55:40.000Z
2022-01-03T18:55:52.000Z
Challenges/codcad_contagem_de_algarismos.cpp
oJordany/CodCad
d3c76d8631583428f5e32caf79a421f2487dbd4c
[ "MIT" ]
null
null
null
#include <iostream> using namespace std; int main(){ int n, a0 = 0, a1 = 0, a2 = 0, a3 = 0, a4 = 0, a5 = 0, a6 = 0, a7 = 0, a8 = 0, a9 = 0; string nums; cin >> n; for (int c = 0; c < n; c++){ cin >> nums; for (int i = 0; i < nums.size(); i++){ if (nums[i] == '0'){ a0++; } if (nums[i] == '1'){ a1++; } if (nums[i] == '2'){ a2++; } if (nums[i] == '3'){ a3++; } if (nums[i] == '4'){ a4++; } if (nums[i] == '5'){ a5++; } if (nums[i] == '6'){ a6++; } if (nums[i] == '7'){ a7++; } if (nums[i] == '8'){ a8++; } if (nums[i] == '9'){ a9++; } } } cout << "0 - " << a0 << endl; cout << "1 - " << a1 << endl; cout << "2 - " << a2 << endl; cout << "3 - " << a3 << endl; cout << "4 - " << a4 << endl; cout << "5 - " << a5 << endl; cout << "6 - " << a6 << endl; cout << "7 - " << a7 << endl; cout << "8 - " << a8 << endl; cout << "9 - " << a9 << endl; return 0; }
22.915254
90
0.251479
oJordany
9ce4490f66e6ada7c6f8ad1deb5478e3f9bcae9a
292,272
cpp
C++
GCG_Source.build/module.pyperclip.clipboards.cpp
Pckool/GCG
cee786d04ea30f3995e910bca82635f442b2a6a8
[ "MIT" ]
null
null
null
GCG_Source.build/module.pyperclip.clipboards.cpp
Pckool/GCG
cee786d04ea30f3995e910bca82635f442b2a6a8
[ "MIT" ]
null
null
null
GCG_Source.build/module.pyperclip.clipboards.cpp
Pckool/GCG
cee786d04ea30f3995e910bca82635f442b2a6a8
[ "MIT" ]
null
null
null
/* Generated code for Python source for module 'pyperclip.clipboards' * created by Nuitka version 0.5.28.2 * * This code is in part copyright 2017 Kay Hayen. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "nuitka/prelude.h" #include "__helpers.h" /* The _module_pyperclip$clipboards is a Python object pointer of module type. */ /* Note: For full compatibility with CPython, every module variable access * needs to go through it except for cases where the module cannot possibly * have changed in the mean time. */ PyObject *module_pyperclip$clipboards; PyDictObject *moduledict_pyperclip$clipboards; /* The module constants used, if any. */ static PyObject *const_str_plain_cb; extern PyObject *const_tuple_str_digest_c075052d723d6707083e869a0e3659bb_tuple; static PyObject *const_str_digest_c74b8fc24b688b8525cf2e0b3a7db16d; extern PyObject *const_str_plain_metaclass; extern PyObject *const_str_plain___spec__; static PyObject *const_list_71826f1b3786fb88c225418f225b3823_list; static PyObject *const_str_plain_wait_for_text; static PyObject *const_str_digest_363b20897abb8fe206a2ed773d13d28a; extern PyObject *const_dict_empty; static PyObject *const_str_digest_344ef046ed627942028fc8b792076a41; static PyObject *const_list_str_plain_pbpaste_str_plain_r_list; extern PyObject *const_str_plain___file__; static PyObject *const_tuple_str_plain_p_str_plain_stdout_str_plain_stderr_tuple; extern PyObject *const_str_plain_qdbus; extern PyObject *const_str_plain_args; extern PyObject *const_tuple_str_plain_self_str_plain_args_str_plain_kwargs_tuple; extern PyObject *const_str_plain_encode; extern PyObject *const_str_plain_gtk; static PyObject *const_tuple_str_plain_ClipboardUnavailable_tuple; extern PyObject *const_str_plain_init_xsel_clipboard; static PyObject *const_str_digest_9c1b8d1bf096eeae592150bfe0b7f351; static PyObject *const_str_digest_4426d352e097e773052a840f474bc09a; static PyObject *const_str_plain_paste_osx; extern PyObject *const_int_neg_1; static PyObject *const_list_a197c19226e81914eb0e409d9a9b699d_list; extern PyObject *const_str_plain_init_osx_clipboard; extern PyObject *const_str_plain_input; static PyObject *const_str_plain_Clipboard; static PyObject *const_str_digest_57a50efac3dc6f8b8afc68b347b3c8cd; static PyObject *const_tuple_str_plain_PyperclipException_tuple; static PyObject *const_str_plain_paste_qt; static PyObject *const_str_digest_12824c42ae734a5ec21969db08809d5c; static PyObject *const_tuple_str_plain_text_str_plain_cb_str_plain_app_tuple; static PyObject *const_tuple_str_plain_copy_xclip_str_plain_paste_xclip_tuple; extern PyObject *const_str_plain_stdout; extern PyObject *const_str_plain_PyperclipException; extern PyObject *const_str_plain_PIPE; extern PyObject *const_str_plain___doc__; extern PyObject *const_str_plain_Popen; static PyObject *const_str_plain_pbcopy; static PyObject *const_str_digest_7f6d117bc092141e51ea443a0e0999c2; extern PyObject *const_str_plain_setText; extern PyObject *const_str_plain___package__; static PyObject *const_tuple_str_plain_QApplication_tuple; static PyObject *const_str_plain_ClipboardUnavailable; static PyObject *const_str_digest_77292a4a8d17a0319dc328f25380c431; extern PyObject *const_str_plain___qualname__; extern PyObject *const_str_plain___bool__; extern PyObject *const_str_plain_w; extern PyObject *const_str_plain_p; static PyObject *const_str_plain_EXCEPT_MSG; extern PyObject *const_str_plain_clipboard; extern PyObject *const_tuple_str_plain_self_tuple; extern PyObject *const_str_plain_unicode; static PyObject *const_list_80c22030d7e9874daf8196134c6cac83_list; extern PyObject *const_str_plain_subprocess; static PyObject *const_tuple_d6651be8fe64dd14e68ee317bda2aea6_tuple; extern PyObject *const_str_plain_xsel; static PyObject *const_str_plain_copy_xsel; static PyObject *const_str_plain_setClipboardContents; extern PyObject *const_tuple_str_newline_tuple; extern PyObject *const_tuple_empty; static PyObject *const_tuple_list_80c22030d7e9874daf8196134c6cac83_list_tuple; extern PyObject *const_str_plain_stderr; extern PyObject *const_str_plain___loader__; extern PyObject *const_str_plain_store; extern PyObject *const_str_plain_r; static PyObject *const_list_e4d6a0388a09ce944591175f0308d4e0_list; extern PyObject *const_str_plain_endswith; static PyObject *const_str_plain_clipboardContents; static PyObject *const_str_digest_5bfd7f32b3b59128ef50a98dbb13a245; static PyObject *const_tuple_str_plain_text_str_plain_p_tuple; extern PyObject *const_str_plain_exceptions; static PyObject *const_str_plain_copy_gtk; static PyObject *const_str_digest_e75ca76f27e0e640a58096dff4d2ac2a; static PyObject *const_str_digest_d577dede9743e2b3fad57acdda45ba59; static PyObject *const_tuple_str_plain_copy_xsel_str_plain_paste_xsel_tuple; static PyObject *const_str_digest_75c1113d1333e3f18890bd794bf85661; static PyObject *const_tuple_list_67e309ba5d5eed8090523ac1cf863d7d_list_tuple; extern PyObject *const_str_plain_ModuleSpec; static PyObject *const_tuple_str_plain_copy_osx_str_plain_paste_osx_tuple; extern PyObject *const_str_plain_decode; static PyObject *const_tuple_str_plain_text_str_plain_gtk_tuple; extern PyObject *const_str_digest_c075052d723d6707083e869a0e3659bb; static PyObject *const_str_plain_getClipboardContents; static PyObject *const_str_digest_cfd481547e4233f4d35d18b7c9fe25ca; extern PyObject *const_int_0; static PyObject *const_dict_c453dda1d3901e4cb85d5781f8962504; static PyObject *const_tuple_list_71826f1b3786fb88c225418f225b3823_list_tuple; static PyObject *const_str_plain_copy_klipper; static PyObject *const_str_plain_copy_osx; extern PyObject *const_str_plain_init_qt_clipboard; static PyObject *const_tuple_list_str_plain_pbcopy_str_plain_w_list_tuple; static PyObject *const_tuple_str_plain_clipboardContents_str_plain_gtk_tuple; extern PyObject *const_str_plain_text; static PyObject *const_str_plain_set_text; extern PyObject *const_str_plain_init_klipper_clipboard; extern PyObject *const_str_plain_init_gtk_clipboard; static PyObject *const_str_plain_paste_xclip; static PyObject *const_str_plain_close_fds; static PyObject *const_tuple_str_plain_gtk_str_plain_copy_gtk_str_plain_paste_gtk_tuple; static PyObject *const_list_67e309ba5d5eed8090523ac1cf863d7d_list; static PyObject *const_tuple_str_plain_cb_str_plain_app_tuple; extern PyObject *const_str_plain_xclip; extern PyObject *const_str_plain_init_no_clipboard; extern PyObject *const_str_plain_c; static PyObject *const_str_digest_fe278fbce1ae480c42f145639e1ea634; extern PyObject *const_str_plain_pyperclip; extern PyObject *const_str_plain_communicate; extern PyObject *const_str_plain_app; extern PyObject *const_str_plain___cached__; static PyObject *const_list_str_plain_pbcopy_str_plain_w_list; extern PyObject *const_str_plain___class__; static PyObject *const_str_plain_paste_xsel; extern PyObject *const_str_plain_PY2; extern PyObject *const_tuple_type_object_tuple; extern PyObject *const_str_plain___module__; extern PyObject *const_str_plain_sys; static PyObject *const_str_plain_copy_xclip; static PyObject *const_str_plain_paste_klipper; extern PyObject *const_str_plain_text_type; static PyObject *const_str_plain_copy_qt; static PyObject *const_str_digest_78382f502c325686bf515744a066db9f; extern PyObject *const_slice_none_int_neg_1_none; extern PyObject *const_int_pos_1; static PyObject *const_tuple_list_a197c19226e81914eb0e409d9a9b699d_list_tuple; extern PyObject *const_str_plain___nonzero__; static PyObject *const_str_digest_0d36178cf1fdd7da1acd434235941e8a; static PyObject *const_str_digest_b8883e772664a69f81a6c1eee0e6292f; extern PyObject *const_str_plain_init_xclip_clipboard; extern PyObject *const_str_newline; static PyObject *const_tuple_94f5801727ab58a7d419ef1a672c6a73_tuple; extern PyObject *const_str_plain___prepare__; extern PyObject *const_str_plain_self; static PyObject *const_str_digest_88e1244ea918f637f982de49331de205; static PyObject *const_str_digest_488addb9f0a7f06aba6f2490db82d71c; extern PyObject *const_str_plain_stdin; extern PyObject *const_str_plain_version_info; extern PyObject *const_str_plain___call__; extern PyObject *const_str_plain_QApplication; static PyObject *const_str_digest_01d040ac9dfb1f7d0f957fcd5293298f; extern PyObject *const_str_digest_91d3fabe5e3af50ef0546b25193cf397; extern PyObject *const_str_plain_kwargs; static PyObject *const_tuple_c539b0fd4893754a4d313c619c321aa4_tuple; extern PyObject *const_int_pos_2; static PyObject *const_tuple_list_str_plain_pbpaste_str_plain_r_list_tuple; static PyObject *const_tuple_list_e4d6a0388a09ce944591175f0308d4e0_list_tuple; static PyObject *const_str_plain_pbpaste; static PyObject *const_str_plain_paste_gtk; extern PyObject *const_str_empty; static PyObject *const_tuple_str_plain_copy_klipper_str_plain_paste_klipper_tuple; static PyObject *const_str_digest_aefe37d186409357e48b054613e2a70f; static PyObject *const_str_digest_f20837e53c97e663ae559a2f47d1375d; static PyObject *const_str_digest_abf798afbed237310b8352ae4dd25846; static PyObject *const_str_digest_d3a192d9a90f12283eb154da5edd57d5; static PyObject *const_str_digest_b75401c8f73575104762484b09641fec; static PyObject *module_filename_obj; static bool constants_created = false; static void createModuleConstants( void ) { const_str_plain_cb = UNSTREAM_STRING( &constant_bin[ 54227 ], 2, 1 ); const_str_digest_c74b8fc24b688b8525cf2e0b3a7db16d = UNSTREAM_STRING( &constant_bin[ 72581 ], 2, 0 ); const_list_71826f1b3786fb88c225418f225b3823_list = PyList_New( 4 ); PyList_SET_ITEM( const_list_71826f1b3786fb88c225418f225b3823_list, 0, const_str_plain_qdbus ); Py_INCREF( const_str_plain_qdbus ); const_str_digest_57a50efac3dc6f8b8afc68b347b3c8cd = UNSTREAM_STRING( &constant_bin[ 1768292 ], 15, 0 ); PyList_SET_ITEM( const_list_71826f1b3786fb88c225418f225b3823_list, 1, const_str_digest_57a50efac3dc6f8b8afc68b347b3c8cd ); Py_INCREF( const_str_digest_57a50efac3dc6f8b8afc68b347b3c8cd ); const_str_digest_5bfd7f32b3b59128ef50a98dbb13a245 = UNSTREAM_STRING( &constant_bin[ 1768307 ], 8, 0 ); PyList_SET_ITEM( const_list_71826f1b3786fb88c225418f225b3823_list, 2, const_str_digest_5bfd7f32b3b59128ef50a98dbb13a245 ); Py_INCREF( const_str_digest_5bfd7f32b3b59128ef50a98dbb13a245 ); const_str_plain_getClipboardContents = UNSTREAM_STRING( &constant_bin[ 1768315 ], 20, 1 ); PyList_SET_ITEM( const_list_71826f1b3786fb88c225418f225b3823_list, 3, const_str_plain_getClipboardContents ); Py_INCREF( const_str_plain_getClipboardContents ); const_str_plain_wait_for_text = UNSTREAM_STRING( &constant_bin[ 1768335 ], 13, 1 ); const_str_digest_363b20897abb8fe206a2ed773d13d28a = UNSTREAM_STRING( &constant_bin[ 1768348 ], 36, 0 ); const_str_digest_344ef046ed627942028fc8b792076a41 = UNSTREAM_STRING( &constant_bin[ 1768384 ], 47, 0 ); const_list_str_plain_pbpaste_str_plain_r_list = PyList_New( 2 ); const_str_plain_pbpaste = UNSTREAM_STRING( &constant_bin[ 1767921 ], 7, 1 ); PyList_SET_ITEM( const_list_str_plain_pbpaste_str_plain_r_list, 0, const_str_plain_pbpaste ); Py_INCREF( const_str_plain_pbpaste ); PyList_SET_ITEM( const_list_str_plain_pbpaste_str_plain_r_list, 1, const_str_plain_r ); Py_INCREF( const_str_plain_r ); const_tuple_str_plain_p_str_plain_stdout_str_plain_stderr_tuple = PyTuple_New( 3 ); PyTuple_SET_ITEM( const_tuple_str_plain_p_str_plain_stdout_str_plain_stderr_tuple, 0, const_str_plain_p ); Py_INCREF( const_str_plain_p ); PyTuple_SET_ITEM( const_tuple_str_plain_p_str_plain_stdout_str_plain_stderr_tuple, 1, const_str_plain_stdout ); Py_INCREF( const_str_plain_stdout ); PyTuple_SET_ITEM( const_tuple_str_plain_p_str_plain_stdout_str_plain_stderr_tuple, 2, const_str_plain_stderr ); Py_INCREF( const_str_plain_stderr ); const_tuple_str_plain_ClipboardUnavailable_tuple = PyTuple_New( 1 ); const_str_plain_ClipboardUnavailable = UNSTREAM_STRING( &constant_bin[ 1768411 ], 20, 1 ); PyTuple_SET_ITEM( const_tuple_str_plain_ClipboardUnavailable_tuple, 0, const_str_plain_ClipboardUnavailable ); Py_INCREF( const_str_plain_ClipboardUnavailable ); const_str_digest_9c1b8d1bf096eeae592150bfe0b7f351 = UNSTREAM_STRING( &constant_bin[ 1768431 ], 39, 0 ); const_str_digest_4426d352e097e773052a840f474bc09a = UNSTREAM_STRING( &constant_bin[ 1768470 ], 29, 0 ); const_str_plain_paste_osx = UNSTREAM_STRING( &constant_bin[ 1768499 ], 9, 1 ); const_list_a197c19226e81914eb0e409d9a9b699d_list = PyList_New( 3 ); PyList_SET_ITEM( const_list_a197c19226e81914eb0e409d9a9b699d_list, 0, const_str_plain_xsel ); Py_INCREF( const_str_plain_xsel ); const_str_digest_78382f502c325686bf515744a066db9f = UNSTREAM_STRING( &constant_bin[ 11847 ], 2, 0 ); PyList_SET_ITEM( const_list_a197c19226e81914eb0e409d9a9b699d_list, 1, const_str_digest_78382f502c325686bf515744a066db9f ); Py_INCREF( const_str_digest_78382f502c325686bf515744a066db9f ); const_str_digest_75c1113d1333e3f18890bd794bf85661 = UNSTREAM_STRING( &constant_bin[ 34301 ], 2, 0 ); PyList_SET_ITEM( const_list_a197c19226e81914eb0e409d9a9b699d_list, 2, const_str_digest_75c1113d1333e3f18890bd794bf85661 ); Py_INCREF( const_str_digest_75c1113d1333e3f18890bd794bf85661 ); const_str_plain_Clipboard = UNSTREAM_STRING( &constant_bin[ 1768318 ], 9, 1 ); const_tuple_str_plain_PyperclipException_tuple = PyTuple_New( 1 ); PyTuple_SET_ITEM( const_tuple_str_plain_PyperclipException_tuple, 0, const_str_plain_PyperclipException ); Py_INCREF( const_str_plain_PyperclipException ); const_str_plain_paste_qt = UNSTREAM_STRING( &constant_bin[ 1768508 ], 8, 1 ); const_str_digest_12824c42ae734a5ec21969db08809d5c = UNSTREAM_STRING( &constant_bin[ 1768516 ], 37, 0 ); const_tuple_str_plain_text_str_plain_cb_str_plain_app_tuple = PyTuple_New( 3 ); PyTuple_SET_ITEM( const_tuple_str_plain_text_str_plain_cb_str_plain_app_tuple, 0, const_str_plain_text ); Py_INCREF( const_str_plain_text ); PyTuple_SET_ITEM( const_tuple_str_plain_text_str_plain_cb_str_plain_app_tuple, 1, const_str_plain_cb ); Py_INCREF( const_str_plain_cb ); PyTuple_SET_ITEM( const_tuple_str_plain_text_str_plain_cb_str_plain_app_tuple, 2, const_str_plain_app ); Py_INCREF( const_str_plain_app ); const_tuple_str_plain_copy_xclip_str_plain_paste_xclip_tuple = PyTuple_New( 2 ); const_str_plain_copy_xclip = UNSTREAM_STRING( &constant_bin[ 1768553 ], 10, 1 ); PyTuple_SET_ITEM( const_tuple_str_plain_copy_xclip_str_plain_paste_xclip_tuple, 0, const_str_plain_copy_xclip ); Py_INCREF( const_str_plain_copy_xclip ); const_str_plain_paste_xclip = UNSTREAM_STRING( &constant_bin[ 1768563 ], 11, 1 ); PyTuple_SET_ITEM( const_tuple_str_plain_copy_xclip_str_plain_paste_xclip_tuple, 1, const_str_plain_paste_xclip ); Py_INCREF( const_str_plain_paste_xclip ); const_str_plain_pbcopy = UNSTREAM_STRING( &constant_bin[ 1767910 ], 6, 1 ); const_str_digest_7f6d117bc092141e51ea443a0e0999c2 = UNSTREAM_STRING( &constant_bin[ 1768574 ], 38, 0 ); const_tuple_str_plain_QApplication_tuple = PyTuple_New( 1 ); PyTuple_SET_ITEM( const_tuple_str_plain_QApplication_tuple, 0, const_str_plain_QApplication ); Py_INCREF( const_str_plain_QApplication ); const_str_digest_77292a4a8d17a0319dc328f25380c431 = UNSTREAM_STRING( &constant_bin[ 1768612 ], 56, 0 ); const_str_plain_EXCEPT_MSG = UNSTREAM_STRING( &constant_bin[ 1768668 ], 10, 1 ); const_list_80c22030d7e9874daf8196134c6cac83_list = PyList_New( 3 ); PyList_SET_ITEM( const_list_80c22030d7e9874daf8196134c6cac83_list, 0, const_str_plain_xclip ); Py_INCREF( const_str_plain_xclip ); const_str_digest_f20837e53c97e663ae559a2f47d1375d = UNSTREAM_STRING( &constant_bin[ 1768678 ], 10, 0 ); PyList_SET_ITEM( const_list_80c22030d7e9874daf8196134c6cac83_list, 1, const_str_digest_f20837e53c97e663ae559a2f47d1375d ); Py_INCREF( const_str_digest_f20837e53c97e663ae559a2f47d1375d ); PyList_SET_ITEM( const_list_80c22030d7e9874daf8196134c6cac83_list, 2, const_str_plain_c ); Py_INCREF( const_str_plain_c ); const_tuple_d6651be8fe64dd14e68ee317bda2aea6_tuple = PyTuple_New( 4 ); PyTuple_SET_ITEM( const_tuple_d6651be8fe64dd14e68ee317bda2aea6_tuple, 0, const_str_plain_p ); Py_INCREF( const_str_plain_p ); PyTuple_SET_ITEM( const_tuple_d6651be8fe64dd14e68ee317bda2aea6_tuple, 1, const_str_plain_stdout ); Py_INCREF( const_str_plain_stdout ); PyTuple_SET_ITEM( const_tuple_d6651be8fe64dd14e68ee317bda2aea6_tuple, 2, const_str_plain_stderr ); Py_INCREF( const_str_plain_stderr ); const_str_plain_clipboardContents = UNSTREAM_STRING( &constant_bin[ 1768688 ], 17, 1 ); PyTuple_SET_ITEM( const_tuple_d6651be8fe64dd14e68ee317bda2aea6_tuple, 3, const_str_plain_clipboardContents ); Py_INCREF( const_str_plain_clipboardContents ); const_str_plain_copy_xsel = UNSTREAM_STRING( &constant_bin[ 1768603 ], 9, 1 ); const_str_plain_setClipboardContents = UNSTREAM_STRING( &constant_bin[ 1768705 ], 20, 1 ); const_tuple_list_80c22030d7e9874daf8196134c6cac83_list_tuple = PyTuple_New( 1 ); PyTuple_SET_ITEM( const_tuple_list_80c22030d7e9874daf8196134c6cac83_list_tuple, 0, const_list_80c22030d7e9874daf8196134c6cac83_list ); Py_INCREF( const_list_80c22030d7e9874daf8196134c6cac83_list ); const_list_e4d6a0388a09ce944591175f0308d4e0_list = PyList_New( 4 ); PyList_SET_ITEM( const_list_e4d6a0388a09ce944591175f0308d4e0_list, 0, const_str_plain_xclip ); Py_INCREF( const_str_plain_xclip ); PyList_SET_ITEM( const_list_e4d6a0388a09ce944591175f0308d4e0_list, 1, const_str_digest_f20837e53c97e663ae559a2f47d1375d ); Py_INCREF( const_str_digest_f20837e53c97e663ae559a2f47d1375d ); PyList_SET_ITEM( const_list_e4d6a0388a09ce944591175f0308d4e0_list, 2, const_str_plain_c ); Py_INCREF( const_str_plain_c ); PyList_SET_ITEM( const_list_e4d6a0388a09ce944591175f0308d4e0_list, 3, const_str_digest_c74b8fc24b688b8525cf2e0b3a7db16d ); Py_INCREF( const_str_digest_c74b8fc24b688b8525cf2e0b3a7db16d ); const_tuple_str_plain_text_str_plain_p_tuple = PyTuple_New( 2 ); PyTuple_SET_ITEM( const_tuple_str_plain_text_str_plain_p_tuple, 0, const_str_plain_text ); Py_INCREF( const_str_plain_text ); PyTuple_SET_ITEM( const_tuple_str_plain_text_str_plain_p_tuple, 1, const_str_plain_p ); Py_INCREF( const_str_plain_p ); const_str_plain_copy_gtk = UNSTREAM_STRING( &constant_bin[ 1768376 ], 8, 1 ); const_str_digest_e75ca76f27e0e640a58096dff4d2ac2a = UNSTREAM_STRING( &constant_bin[ 1768725 ], 41, 0 ); const_str_digest_d577dede9743e2b3fad57acdda45ba59 = UNSTREAM_STRING( &constant_bin[ 1768766 ], 56, 0 ); const_tuple_str_plain_copy_xsel_str_plain_paste_xsel_tuple = PyTuple_New( 2 ); PyTuple_SET_ITEM( const_tuple_str_plain_copy_xsel_str_plain_paste_xsel_tuple, 0, const_str_plain_copy_xsel ); Py_INCREF( const_str_plain_copy_xsel ); const_str_plain_paste_xsel = UNSTREAM_STRING( &constant_bin[ 1768460 ], 10, 1 ); PyTuple_SET_ITEM( const_tuple_str_plain_copy_xsel_str_plain_paste_xsel_tuple, 1, const_str_plain_paste_xsel ); Py_INCREF( const_str_plain_paste_xsel ); const_tuple_list_67e309ba5d5eed8090523ac1cf863d7d_list_tuple = PyTuple_New( 1 ); const_list_67e309ba5d5eed8090523ac1cf863d7d_list = PyList_New( 3 ); PyList_SET_ITEM( const_list_67e309ba5d5eed8090523ac1cf863d7d_list, 0, const_str_plain_xsel ); Py_INCREF( const_str_plain_xsel ); PyList_SET_ITEM( const_list_67e309ba5d5eed8090523ac1cf863d7d_list, 1, const_str_digest_78382f502c325686bf515744a066db9f ); Py_INCREF( const_str_digest_78382f502c325686bf515744a066db9f ); PyList_SET_ITEM( const_list_67e309ba5d5eed8090523ac1cf863d7d_list, 2, const_str_digest_c74b8fc24b688b8525cf2e0b3a7db16d ); Py_INCREF( const_str_digest_c74b8fc24b688b8525cf2e0b3a7db16d ); PyTuple_SET_ITEM( const_tuple_list_67e309ba5d5eed8090523ac1cf863d7d_list_tuple, 0, const_list_67e309ba5d5eed8090523ac1cf863d7d_list ); Py_INCREF( const_list_67e309ba5d5eed8090523ac1cf863d7d_list ); const_tuple_str_plain_copy_osx_str_plain_paste_osx_tuple = PyTuple_New( 2 ); const_str_plain_copy_osx = UNSTREAM_STRING( &constant_bin[ 1768822 ], 8, 1 ); PyTuple_SET_ITEM( const_tuple_str_plain_copy_osx_str_plain_paste_osx_tuple, 0, const_str_plain_copy_osx ); Py_INCREF( const_str_plain_copy_osx ); PyTuple_SET_ITEM( const_tuple_str_plain_copy_osx_str_plain_paste_osx_tuple, 1, const_str_plain_paste_osx ); Py_INCREF( const_str_plain_paste_osx ); const_tuple_str_plain_text_str_plain_gtk_tuple = PyTuple_New( 2 ); PyTuple_SET_ITEM( const_tuple_str_plain_text_str_plain_gtk_tuple, 0, const_str_plain_text ); Py_INCREF( const_str_plain_text ); PyTuple_SET_ITEM( const_tuple_str_plain_text_str_plain_gtk_tuple, 1, const_str_plain_gtk ); Py_INCREF( const_str_plain_gtk ); const_str_digest_cfd481547e4233f4d35d18b7c9fe25ca = UNSTREAM_STRING( &constant_bin[ 1768830 ], 23, 0 ); const_dict_c453dda1d3901e4cb85d5781f8962504 = _PyDict_NewPresized( 1 ); PyDict_SetItem( const_dict_c453dda1d3901e4cb85d5781f8962504, const_str_plain_input, Py_None ); assert( PyDict_Size( const_dict_c453dda1d3901e4cb85d5781f8962504 ) == 1 ); const_tuple_list_71826f1b3786fb88c225418f225b3823_list_tuple = PyTuple_New( 1 ); PyTuple_SET_ITEM( const_tuple_list_71826f1b3786fb88c225418f225b3823_list_tuple, 0, const_list_71826f1b3786fb88c225418f225b3823_list ); Py_INCREF( const_list_71826f1b3786fb88c225418f225b3823_list ); const_str_plain_copy_klipper = UNSTREAM_STRING( &constant_bin[ 1768853 ], 12, 1 ); const_tuple_list_str_plain_pbcopy_str_plain_w_list_tuple = PyTuple_New( 1 ); const_list_str_plain_pbcopy_str_plain_w_list = PyList_New( 2 ); PyList_SET_ITEM( const_list_str_plain_pbcopy_str_plain_w_list, 0, const_str_plain_pbcopy ); Py_INCREF( const_str_plain_pbcopy ); PyList_SET_ITEM( const_list_str_plain_pbcopy_str_plain_w_list, 1, const_str_plain_w ); Py_INCREF( const_str_plain_w ); PyTuple_SET_ITEM( const_tuple_list_str_plain_pbcopy_str_plain_w_list_tuple, 0, const_list_str_plain_pbcopy_str_plain_w_list ); Py_INCREF( const_list_str_plain_pbcopy_str_plain_w_list ); const_tuple_str_plain_clipboardContents_str_plain_gtk_tuple = PyTuple_New( 2 ); PyTuple_SET_ITEM( const_tuple_str_plain_clipboardContents_str_plain_gtk_tuple, 0, const_str_plain_clipboardContents ); Py_INCREF( const_str_plain_clipboardContents ); PyTuple_SET_ITEM( const_tuple_str_plain_clipboardContents_str_plain_gtk_tuple, 1, const_str_plain_gtk ); Py_INCREF( const_str_plain_gtk ); const_str_plain_set_text = UNSTREAM_STRING( &constant_bin[ 1768865 ], 8, 1 ); const_str_plain_close_fds = UNSTREAM_STRING( &constant_bin[ 1768873 ], 9, 1 ); const_tuple_str_plain_gtk_str_plain_copy_gtk_str_plain_paste_gtk_tuple = PyTuple_New( 3 ); PyTuple_SET_ITEM( const_tuple_str_plain_gtk_str_plain_copy_gtk_str_plain_paste_gtk_tuple, 0, const_str_plain_gtk ); Py_INCREF( const_str_plain_gtk ); PyTuple_SET_ITEM( const_tuple_str_plain_gtk_str_plain_copy_gtk_str_plain_paste_gtk_tuple, 1, const_str_plain_copy_gtk ); Py_INCREF( const_str_plain_copy_gtk ); const_str_plain_paste_gtk = UNSTREAM_STRING( &constant_bin[ 1768544 ], 9, 1 ); PyTuple_SET_ITEM( const_tuple_str_plain_gtk_str_plain_copy_gtk_str_plain_paste_gtk_tuple, 2, const_str_plain_paste_gtk ); Py_INCREF( const_str_plain_paste_gtk ); const_tuple_str_plain_cb_str_plain_app_tuple = PyTuple_New( 2 ); PyTuple_SET_ITEM( const_tuple_str_plain_cb_str_plain_app_tuple, 0, const_str_plain_cb ); Py_INCREF( const_str_plain_cb ); PyTuple_SET_ITEM( const_tuple_str_plain_cb_str_plain_app_tuple, 1, const_str_plain_app ); Py_INCREF( const_str_plain_app ); const_str_digest_fe278fbce1ae480c42f145639e1ea634 = UNSTREAM_STRING( &constant_bin[ 1768882 ], 37, 0 ); const_str_plain_paste_klipper = UNSTREAM_STRING( &constant_bin[ 1768919 ], 13, 1 ); const_str_plain_copy_qt = UNSTREAM_STRING( &constant_bin[ 1768932 ], 7, 1 ); const_tuple_list_a197c19226e81914eb0e409d9a9b699d_list_tuple = PyTuple_New( 1 ); PyTuple_SET_ITEM( const_tuple_list_a197c19226e81914eb0e409d9a9b699d_list_tuple, 0, const_list_a197c19226e81914eb0e409d9a9b699d_list ); Py_INCREF( const_list_a197c19226e81914eb0e409d9a9b699d_list ); const_str_digest_0d36178cf1fdd7da1acd434235941e8a = UNSTREAM_STRING( &constant_bin[ 1768939 ], 36, 0 ); const_str_digest_b8883e772664a69f81a6c1eee0e6292f = UNSTREAM_STRING( &constant_bin[ 1768975 ], 143, 0 ); const_tuple_94f5801727ab58a7d419ef1a672c6a73_tuple = PyTuple_New( 4 ); PyTuple_SET_ITEM( const_tuple_94f5801727ab58a7d419ef1a672c6a73_tuple, 0, const_str_plain_QApplication ); Py_INCREF( const_str_plain_QApplication ); PyTuple_SET_ITEM( const_tuple_94f5801727ab58a7d419ef1a672c6a73_tuple, 1, const_str_plain_app ); Py_INCREF( const_str_plain_app ); PyTuple_SET_ITEM( const_tuple_94f5801727ab58a7d419ef1a672c6a73_tuple, 2, const_str_plain_copy_qt ); Py_INCREF( const_str_plain_copy_qt ); PyTuple_SET_ITEM( const_tuple_94f5801727ab58a7d419ef1a672c6a73_tuple, 3, const_str_plain_paste_qt ); Py_INCREF( const_str_plain_paste_qt ); const_str_digest_88e1244ea918f637f982de49331de205 = UNSTREAM_STRING( &constant_bin[ 1769118 ], 34, 0 ); const_str_digest_488addb9f0a7f06aba6f2490db82d71c = UNSTREAM_STRING( &constant_bin[ 1769152 ], 40, 0 ); const_str_digest_01d040ac9dfb1f7d0f957fcd5293298f = UNSTREAM_STRING( &constant_bin[ 1769192 ], 59, 0 ); const_tuple_c539b0fd4893754a4d313c619c321aa4_tuple = PyTuple_New( 6 ); PyTuple_SET_ITEM( const_tuple_c539b0fd4893754a4d313c619c321aa4_tuple, 0, const_str_plain___class__ ); Py_INCREF( const_str_plain___class__ ); PyTuple_SET_ITEM( const_tuple_c539b0fd4893754a4d313c619c321aa4_tuple, 1, const_str_plain___qualname__ ); Py_INCREF( const_str_plain___qualname__ ); PyTuple_SET_ITEM( const_tuple_c539b0fd4893754a4d313c619c321aa4_tuple, 2, const_str_plain___module__ ); Py_INCREF( const_str_plain___module__ ); PyTuple_SET_ITEM( const_tuple_c539b0fd4893754a4d313c619c321aa4_tuple, 3, const_str_plain___call__ ); Py_INCREF( const_str_plain___call__ ); PyTuple_SET_ITEM( const_tuple_c539b0fd4893754a4d313c619c321aa4_tuple, 4, const_str_plain___nonzero__ ); Py_INCREF( const_str_plain___nonzero__ ); PyTuple_SET_ITEM( const_tuple_c539b0fd4893754a4d313c619c321aa4_tuple, 5, const_str_plain___bool__ ); Py_INCREF( const_str_plain___bool__ ); const_tuple_list_str_plain_pbpaste_str_plain_r_list_tuple = PyTuple_New( 1 ); PyTuple_SET_ITEM( const_tuple_list_str_plain_pbpaste_str_plain_r_list_tuple, 0, const_list_str_plain_pbpaste_str_plain_r_list ); Py_INCREF( const_list_str_plain_pbpaste_str_plain_r_list ); const_tuple_list_e4d6a0388a09ce944591175f0308d4e0_list_tuple = PyTuple_New( 1 ); PyTuple_SET_ITEM( const_tuple_list_e4d6a0388a09ce944591175f0308d4e0_list_tuple, 0, const_list_e4d6a0388a09ce944591175f0308d4e0_list ); Py_INCREF( const_list_e4d6a0388a09ce944591175f0308d4e0_list ); const_tuple_str_plain_copy_klipper_str_plain_paste_klipper_tuple = PyTuple_New( 2 ); PyTuple_SET_ITEM( const_tuple_str_plain_copy_klipper_str_plain_paste_klipper_tuple, 0, const_str_plain_copy_klipper ); Py_INCREF( const_str_plain_copy_klipper ); PyTuple_SET_ITEM( const_tuple_str_plain_copy_klipper_str_plain_paste_klipper_tuple, 1, const_str_plain_paste_klipper ); Py_INCREF( const_str_plain_paste_klipper ); const_str_digest_aefe37d186409357e48b054613e2a70f = UNSTREAM_STRING( &constant_bin[ 1769251 ], 35, 0 ); const_str_digest_abf798afbed237310b8352ae4dd25846 = UNSTREAM_STRING( &constant_bin[ 1768478 ], 20, 0 ); const_str_digest_d3a192d9a90f12283eb154da5edd57d5 = UNSTREAM_STRING( &constant_bin[ 1769286 ], 44, 0 ); const_str_digest_b75401c8f73575104762484b09641fec = UNSTREAM_STRING( &constant_bin[ 1769330 ], 45, 0 ); constants_created = true; } #ifndef __NUITKA_NO_ASSERT__ void checkModuleConstants_pyperclip$clipboards( void ) { // The module may not have been used at all. if (constants_created == false) return; } #endif // The module code objects. static PyCodeObject *codeobj_46b2ba739d21d8e36683e28bbbe03322; static PyCodeObject *codeobj_6ab20e863ca616e71bb7580d671fbf83; static PyCodeObject *codeobj_72f17b2905fbc9b53a6c4b832c293385; static PyCodeObject *codeobj_994acfe311cd5303f7a3d90127e45d73; static PyCodeObject *codeobj_1b3001ad8a78106b42b4b432170e09c4; static PyCodeObject *codeobj_6c43a1687d3fc7e03237a18bb4a7ff7d; static PyCodeObject *codeobj_bb325fb2ba607198bce74bc146ecfdfa; static PyCodeObject *codeobj_0c00caeab83633b5a6b5c185156303f2; static PyCodeObject *codeobj_d32c80b8cc4f52e8ea4f7cf8e00a5a72; static PyCodeObject *codeobj_87896ad4334adfc69f0daabfac3e30c6; static PyCodeObject *codeobj_b0f3bfc3d3d61adca3747b3845cc6ff6; static PyCodeObject *codeobj_7512eea690737b69fcf042e9389861f9; static PyCodeObject *codeobj_b13a7a5eb19cb6d46f4de7194120c1c9; static PyCodeObject *codeobj_9176fa465259af4c58ea8214415ad323; static PyCodeObject *codeobj_b27a0a0307e87f3792f3ffffd65055d7; static PyCodeObject *codeobj_e886f435cf3ab0f2a1d23a7b972501c4; static PyCodeObject *codeobj_8982018ca2c7d40aa223cd827eb6be8b; static PyCodeObject *codeobj_200f844cab6cbcad05505017ccc475ca; static PyCodeObject *codeobj_113d5874740330562529e560a6ae6b38; static PyCodeObject *codeobj_99270ef4c1c45db5d9ad06ee758619b6; static PyCodeObject *codeobj_fe9ce96a2fa59097f4e8994392986166; static PyCodeObject *codeobj_082a9101cf76bcbc1c84e8a20e574a7c; static PyCodeObject *codeobj_f950ff59b50650874131d45114feb4ed; static PyCodeObject *codeobj_ea0d5a0280e03dec96cb094dc6e0c388; static void createModuleCodeObjects(void) { module_filename_obj = MAKE_RELATIVE_PATH( const_str_digest_cfd481547e4233f4d35d18b7c9fe25ca ); codeobj_46b2ba739d21d8e36683e28bbbe03322 = MAKE_CODEOBJ( module_filename_obj, const_str_digest_4426d352e097e773052a840f474bc09a, 1, const_tuple_empty, 0, 0, CO_NOFREE ); codeobj_6ab20e863ca616e71bb7580d671fbf83 = MAKE_CODEOBJ( module_filename_obj, const_str_plain_ClipboardUnavailable, 123, const_tuple_c539b0fd4893754a4d313c619c321aa4_tuple, 0, 0, CO_OPTIMIZED | CO_NOFREE ); codeobj_72f17b2905fbc9b53a6c4b832c293385 = MAKE_CODEOBJ( module_filename_obj, const_str_plain___bool__, 131, const_tuple_str_plain_self_tuple, 1, 0, CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE ); codeobj_994acfe311cd5303f7a3d90127e45d73 = MAKE_CODEOBJ( module_filename_obj, const_str_plain___call__, 124, const_tuple_str_plain_self_str_plain_args_str_plain_kwargs_tuple, 1, 0, CO_OPTIMIZED | CO_NEWLOCALS | CO_VARARGS | CO_VARKEYWORDS | CO_NOFREE ); codeobj_1b3001ad8a78106b42b4b432170e09c4 = MAKE_CODEOBJ( module_filename_obj, const_str_plain___nonzero__, 128, const_tuple_str_plain_self_tuple, 1, 0, CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE ); codeobj_6c43a1687d3fc7e03237a18bb4a7ff7d = MAKE_CODEOBJ( module_filename_obj, const_str_plain_copy_gtk, 30, const_tuple_str_plain_text_str_plain_gtk_tuple, 1, 0, CO_OPTIMIZED | CO_NEWLOCALS ); codeobj_bb325fb2ba607198bce74bc146ecfdfa = MAKE_CODEOBJ( module_filename_obj, const_str_plain_copy_klipper, 95, const_tuple_str_plain_text_str_plain_p_tuple, 1, 0, CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE ); codeobj_0c00caeab83633b5a6b5c185156303f2 = MAKE_CODEOBJ( module_filename_obj, const_str_plain_copy_osx, 13, const_tuple_str_plain_text_str_plain_p_tuple, 1, 0, CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE ); codeobj_d32c80b8cc4f52e8ea4f7cf8e00a5a72 = MAKE_CODEOBJ( module_filename_obj, const_str_plain_copy_qt, 53, const_tuple_str_plain_text_str_plain_cb_str_plain_app_tuple, 1, 0, CO_OPTIMIZED | CO_NEWLOCALS ); codeobj_87896ad4334adfc69f0daabfac3e30c6 = MAKE_CODEOBJ( module_filename_obj, const_str_plain_copy_xclip, 65, const_tuple_str_plain_text_str_plain_p_tuple, 1, 0, CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE ); codeobj_b0f3bfc3d3d61adca3747b3845cc6ff6 = MAKE_CODEOBJ( module_filename_obj, const_str_plain_copy_xsel, 80, const_tuple_str_plain_text_str_plain_p_tuple, 1, 0, CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE ); codeobj_7512eea690737b69fcf042e9389861f9 = MAKE_CODEOBJ( module_filename_obj, const_str_plain_init_gtk_clipboard, 27, const_tuple_str_plain_gtk_str_plain_copy_gtk_str_plain_paste_gtk_tuple, 0, 0, CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE ); codeobj_b13a7a5eb19cb6d46f4de7194120c1c9 = MAKE_CODEOBJ( module_filename_obj, const_str_plain_init_klipper_clipboard, 94, const_tuple_str_plain_copy_klipper_str_plain_paste_klipper_tuple, 0, 0, CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE ); codeobj_9176fa465259af4c58ea8214415ad323 = MAKE_CODEOBJ( module_filename_obj, const_str_plain_init_no_clipboard, 122, const_tuple_str_plain_ClipboardUnavailable_tuple, 0, 0, CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE ); codeobj_b27a0a0307e87f3792f3ffffd65055d7 = MAKE_CODEOBJ( module_filename_obj, const_str_plain_init_osx_clipboard, 12, const_tuple_str_plain_copy_osx_str_plain_paste_osx_tuple, 0, 0, CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE ); codeobj_e886f435cf3ab0f2a1d23a7b972501c4 = MAKE_CODEOBJ( module_filename_obj, const_str_plain_init_qt_clipboard, 47, const_tuple_94f5801727ab58a7d419ef1a672c6a73_tuple, 0, 0, CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE ); codeobj_8982018ca2c7d40aa223cd827eb6be8b = MAKE_CODEOBJ( module_filename_obj, const_str_plain_init_xclip_clipboard, 64, const_tuple_str_plain_copy_xclip_str_plain_paste_xclip_tuple, 0, 0, CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE ); codeobj_200f844cab6cbcad05505017ccc475ca = MAKE_CODEOBJ( module_filename_obj, const_str_plain_init_xsel_clipboard, 79, const_tuple_str_plain_copy_xsel_str_plain_paste_xsel_tuple, 0, 0, CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE ); codeobj_113d5874740330562529e560a6ae6b38 = MAKE_CODEOBJ( module_filename_obj, const_str_plain_paste_gtk, 36, const_tuple_str_plain_clipboardContents_str_plain_gtk_tuple, 0, 0, CO_OPTIMIZED | CO_NEWLOCALS ); codeobj_99270ef4c1c45db5d9ad06ee758619b6 = MAKE_CODEOBJ( module_filename_obj, const_str_plain_paste_klipper, 102, const_tuple_d6651be8fe64dd14e68ee317bda2aea6_tuple, 0, 0, CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE ); codeobj_fe9ce96a2fa59097f4e8994392986166 = MAKE_CODEOBJ( module_filename_obj, const_str_plain_paste_osx, 18, const_tuple_str_plain_p_str_plain_stdout_str_plain_stderr_tuple, 0, 0, CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE ); codeobj_082a9101cf76bcbc1c84e8a20e574a7c = MAKE_CODEOBJ( module_filename_obj, const_str_plain_paste_qt, 57, const_tuple_str_plain_cb_str_plain_app_tuple, 0, 0, CO_OPTIMIZED | CO_NEWLOCALS ); codeobj_f950ff59b50650874131d45114feb4ed = MAKE_CODEOBJ( module_filename_obj, const_str_plain_paste_xclip, 70, const_tuple_str_plain_p_str_plain_stdout_str_plain_stderr_tuple, 0, 0, CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE ); codeobj_ea0d5a0280e03dec96cb094dc6e0c388 = MAKE_CODEOBJ( module_filename_obj, const_str_plain_paste_xsel, 85, const_tuple_str_plain_p_str_plain_stdout_str_plain_stderr_tuple, 0, 0, CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE ); } // The module function declarations. static PyObject *MAKE_FUNCTION_pyperclip$clipboards$$$function_1_init_osx_clipboard( ); static PyObject *MAKE_FUNCTION_pyperclip$clipboards$$$function_1_init_osx_clipboard$$$function_1_copy_osx( ); static PyObject *MAKE_FUNCTION_pyperclip$clipboards$$$function_1_init_osx_clipboard$$$function_2_paste_osx( ); static PyObject *MAKE_FUNCTION_pyperclip$clipboards$$$function_2_init_gtk_clipboard( ); static PyObject *MAKE_FUNCTION_pyperclip$clipboards$$$function_2_init_gtk_clipboard$$$function_1_copy_gtk( struct Nuitka_CellObject *closure_gtk ); static PyObject *MAKE_FUNCTION_pyperclip$clipboards$$$function_2_init_gtk_clipboard$$$function_2_paste_gtk( struct Nuitka_CellObject *closure_gtk ); static PyObject *MAKE_FUNCTION_pyperclip$clipboards$$$function_3_init_qt_clipboard( ); static PyObject *MAKE_FUNCTION_pyperclip$clipboards$$$function_3_init_qt_clipboard$$$function_1_copy_qt( struct Nuitka_CellObject *closure_app ); static PyObject *MAKE_FUNCTION_pyperclip$clipboards$$$function_3_init_qt_clipboard$$$function_2_paste_qt( struct Nuitka_CellObject *closure_app ); static PyObject *MAKE_FUNCTION_pyperclip$clipboards$$$function_4_init_xclip_clipboard( ); static PyObject *MAKE_FUNCTION_pyperclip$clipboards$$$function_4_init_xclip_clipboard$$$function_1_copy_xclip( ); static PyObject *MAKE_FUNCTION_pyperclip$clipboards$$$function_4_init_xclip_clipboard$$$function_2_paste_xclip( ); static PyObject *MAKE_FUNCTION_pyperclip$clipboards$$$function_5_init_xsel_clipboard( ); static PyObject *MAKE_FUNCTION_pyperclip$clipboards$$$function_5_init_xsel_clipboard$$$function_1_copy_xsel( ); static PyObject *MAKE_FUNCTION_pyperclip$clipboards$$$function_5_init_xsel_clipboard$$$function_2_paste_xsel( ); static PyObject *MAKE_FUNCTION_pyperclip$clipboards$$$function_6_init_klipper_clipboard( ); static PyObject *MAKE_FUNCTION_pyperclip$clipboards$$$function_6_init_klipper_clipboard$$$function_1_copy_klipper( ); static PyObject *MAKE_FUNCTION_pyperclip$clipboards$$$function_6_init_klipper_clipboard$$$function_2_paste_klipper( ); static PyObject *MAKE_FUNCTION_pyperclip$clipboards$$$function_7_init_no_clipboard( ); static PyObject *MAKE_FUNCTION_pyperclip$clipboards$$$function_7_init_no_clipboard$$$function_1___call__( ); static PyObject *MAKE_FUNCTION_pyperclip$clipboards$$$function_7_init_no_clipboard$$$function_2___nonzero__( ); static PyObject *MAKE_FUNCTION_pyperclip$clipboards$$$function_7_init_no_clipboard$$$function_3___bool__( ); // The module function definitions. static PyObject *impl_pyperclip$clipboards$$$function_1_init_osx_clipboard( struct Nuitka_FunctionObject const *self, PyObject **python_pars ) { // Preserve error status for checks #ifndef __NUITKA_NO_ASSERT__ NUITKA_MAY_BE_UNUSED bool had_error = ERROR_OCCURRED(); #endif // Local variable declarations. PyObject *var_copy_osx = NULL; PyObject *var_paste_osx = NULL; PyObject *tmp_assign_source_1; PyObject *tmp_assign_source_2; PyObject *tmp_return_value; PyObject *tmp_tuple_element_1; tmp_return_value = NULL; // Actual function code. tmp_assign_source_1 = MAKE_FUNCTION_pyperclip$clipboards$$$function_1_init_osx_clipboard$$$function_1_copy_osx( ); assert( var_copy_osx == NULL ); var_copy_osx = tmp_assign_source_1; tmp_assign_source_2 = MAKE_FUNCTION_pyperclip$clipboards$$$function_1_init_osx_clipboard$$$function_2_paste_osx( ); assert( var_paste_osx == NULL ); var_paste_osx = tmp_assign_source_2; // Tried code: tmp_return_value = PyTuple_New( 2 ); tmp_tuple_element_1 = var_copy_osx; CHECK_OBJECT( tmp_tuple_element_1 ); Py_INCREF( tmp_tuple_element_1 ); PyTuple_SET_ITEM( tmp_return_value, 0, tmp_tuple_element_1 ); tmp_tuple_element_1 = var_paste_osx; CHECK_OBJECT( tmp_tuple_element_1 ); Py_INCREF( tmp_tuple_element_1 ); PyTuple_SET_ITEM( tmp_return_value, 1, tmp_tuple_element_1 ); goto try_return_handler_1; // tried codes exits in all cases NUITKA_CANNOT_GET_HERE( pyperclip$clipboards$$$function_1_init_osx_clipboard ); return NULL; // Return handler code: try_return_handler_1:; CHECK_OBJECT( (PyObject *)var_copy_osx ); Py_DECREF( var_copy_osx ); var_copy_osx = NULL; Py_XDECREF( var_paste_osx ); var_paste_osx = NULL; goto function_return_exit; // End of try: // Return statement must have exited already. NUITKA_CANNOT_GET_HERE( pyperclip$clipboards$$$function_1_init_osx_clipboard ); return NULL; function_return_exit: CHECK_OBJECT( tmp_return_value ); assert( had_error || !ERROR_OCCURRED() ); return tmp_return_value; } static PyObject *impl_pyperclip$clipboards$$$function_1_init_osx_clipboard$$$function_1_copy_osx( struct Nuitka_FunctionObject const *self, PyObject **python_pars ) { // Preserve error status for checks #ifndef __NUITKA_NO_ASSERT__ NUITKA_MAY_BE_UNUSED bool had_error = ERROR_OCCURRED(); #endif // Local variable declarations. PyObject *par_text = python_pars[ 0 ]; PyObject *var_p = NULL; PyObject *exception_type = NULL; PyObject *exception_value = NULL; PyTracebackObject *exception_tb = NULL; NUITKA_MAY_BE_UNUSED int exception_lineno = 0; PyObject *exception_keeper_type_1; PyObject *exception_keeper_value_1; PyTracebackObject *exception_keeper_tb_1; NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_1; PyObject *tmp_args_name_1; PyObject *tmp_assign_source_1; PyObject *tmp_called_instance_1; PyObject *tmp_called_name_1; PyObject *tmp_called_name_2; PyObject *tmp_dict_key_1; PyObject *tmp_dict_key_2; PyObject *tmp_dict_key_3; PyObject *tmp_dict_value_1; PyObject *tmp_dict_value_2; PyObject *tmp_dict_value_3; PyObject *tmp_kw_name_1; PyObject *tmp_kw_name_2; int tmp_res; PyObject *tmp_return_value; PyObject *tmp_source_name_1; PyObject *tmp_source_name_2; PyObject *tmp_source_name_3; NUITKA_MAY_BE_UNUSED PyObject *tmp_unused; static struct Nuitka_FrameObject *cache_frame_0c00caeab83633b5a6b5c185156303f2 = NULL; struct Nuitka_FrameObject *frame_0c00caeab83633b5a6b5c185156303f2; NUITKA_MAY_BE_UNUSED char const *type_description_1 = NULL; tmp_return_value = NULL; // Actual function code. // Tried code: MAKE_OR_REUSE_FRAME( cache_frame_0c00caeab83633b5a6b5c185156303f2, codeobj_0c00caeab83633b5a6b5c185156303f2, module_pyperclip$clipboards, sizeof(void *)+sizeof(void *) ); frame_0c00caeab83633b5a6b5c185156303f2 = cache_frame_0c00caeab83633b5a6b5c185156303f2; // Push the new frame as the currently active one. pushFrameStack( frame_0c00caeab83633b5a6b5c185156303f2 ); // Mark the frame object as in use, ref count 1 will be up for reuse. assert( Py_REFCNT( frame_0c00caeab83633b5a6b5c185156303f2 ) == 2 ); // Frame stack // Framed code: tmp_source_name_1 = GET_STRING_DICT_VALUE( moduledict_pyperclip$clipboards, (Nuitka_StringObject *)const_str_plain_subprocess ); if (unlikely( tmp_source_name_1 == NULL )) { tmp_source_name_1 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_subprocess ); } if ( tmp_source_name_1 == NULL ) { exception_type = PyExc_NameError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "subprocess" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 14; type_description_1 = "oo"; goto frame_exception_exit_1; } tmp_called_name_1 = LOOKUP_ATTRIBUTE( tmp_source_name_1, const_str_plain_Popen ); if ( tmp_called_name_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 14; type_description_1 = "oo"; goto frame_exception_exit_1; } tmp_args_name_1 = DEEP_COPY( const_tuple_list_str_plain_pbcopy_str_plain_w_list_tuple ); tmp_kw_name_1 = _PyDict_NewPresized( 2 ); tmp_dict_key_1 = const_str_plain_stdin; tmp_source_name_2 = GET_STRING_DICT_VALUE( moduledict_pyperclip$clipboards, (Nuitka_StringObject *)const_str_plain_subprocess ); if (unlikely( tmp_source_name_2 == NULL )) { tmp_source_name_2 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_subprocess ); } if ( tmp_source_name_2 == NULL ) { Py_DECREF( tmp_called_name_1 ); Py_DECREF( tmp_args_name_1 ); Py_DECREF( tmp_kw_name_1 ); exception_type = PyExc_NameError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "subprocess" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 15; type_description_1 = "oo"; goto frame_exception_exit_1; } tmp_dict_value_1 = LOOKUP_ATTRIBUTE( tmp_source_name_2, const_str_plain_PIPE ); if ( tmp_dict_value_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); Py_DECREF( tmp_called_name_1 ); Py_DECREF( tmp_args_name_1 ); Py_DECREF( tmp_kw_name_1 ); exception_lineno = 15; type_description_1 = "oo"; goto frame_exception_exit_1; } tmp_res = PyDict_SetItem( tmp_kw_name_1, tmp_dict_key_1, tmp_dict_value_1 ); Py_DECREF( tmp_dict_value_1 ); assert( !(tmp_res != 0) ); tmp_dict_key_2 = const_str_plain_close_fds; tmp_dict_value_2 = Py_True; tmp_res = PyDict_SetItem( tmp_kw_name_1, tmp_dict_key_2, tmp_dict_value_2 ); assert( !(tmp_res != 0) ); frame_0c00caeab83633b5a6b5c185156303f2->m_frame.f_lineno = 14; tmp_assign_source_1 = CALL_FUNCTION( tmp_called_name_1, tmp_args_name_1, tmp_kw_name_1 ); Py_DECREF( tmp_called_name_1 ); Py_DECREF( tmp_args_name_1 ); Py_DECREF( tmp_kw_name_1 ); if ( tmp_assign_source_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 14; type_description_1 = "oo"; goto frame_exception_exit_1; } assert( var_p == NULL ); var_p = tmp_assign_source_1; tmp_source_name_3 = var_p; CHECK_OBJECT( tmp_source_name_3 ); tmp_called_name_2 = LOOKUP_ATTRIBUTE( tmp_source_name_3, const_str_plain_communicate ); if ( tmp_called_name_2 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 16; type_description_1 = "oo"; goto frame_exception_exit_1; } tmp_kw_name_2 = _PyDict_NewPresized( 1 ); tmp_dict_key_3 = const_str_plain_input; tmp_called_instance_1 = par_text; if ( tmp_called_instance_1 == NULL ) { Py_DECREF( tmp_called_name_2 ); Py_DECREF( tmp_kw_name_2 ); exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "text" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 16; type_description_1 = "oo"; goto frame_exception_exit_1; } frame_0c00caeab83633b5a6b5c185156303f2->m_frame.f_lineno = 16; tmp_dict_value_3 = CALL_METHOD_WITH_ARGS1( tmp_called_instance_1, const_str_plain_encode, &PyTuple_GET_ITEM( const_tuple_str_digest_c075052d723d6707083e869a0e3659bb_tuple, 0 ) ); if ( tmp_dict_value_3 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); Py_DECREF( tmp_called_name_2 ); Py_DECREF( tmp_kw_name_2 ); exception_lineno = 16; type_description_1 = "oo"; goto frame_exception_exit_1; } tmp_res = PyDict_SetItem( tmp_kw_name_2, tmp_dict_key_3, tmp_dict_value_3 ); Py_DECREF( tmp_dict_value_3 ); assert( !(tmp_res != 0) ); frame_0c00caeab83633b5a6b5c185156303f2->m_frame.f_lineno = 16; tmp_unused = CALL_FUNCTION_WITH_KEYARGS( tmp_called_name_2, tmp_kw_name_2 ); Py_DECREF( tmp_called_name_2 ); Py_DECREF( tmp_kw_name_2 ); if ( tmp_unused == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 16; type_description_1 = "oo"; goto frame_exception_exit_1; } Py_DECREF( tmp_unused ); #if 0 RESTORE_FRAME_EXCEPTION( frame_0c00caeab83633b5a6b5c185156303f2 ); #endif // Put the previous frame back on top. popFrameStack(); goto frame_no_exception_1; frame_exception_exit_1:; #if 0 RESTORE_FRAME_EXCEPTION( frame_0c00caeab83633b5a6b5c185156303f2 ); #endif if ( exception_tb == NULL ) { exception_tb = MAKE_TRACEBACK( frame_0c00caeab83633b5a6b5c185156303f2, exception_lineno ); } else if ( exception_tb->tb_frame != &frame_0c00caeab83633b5a6b5c185156303f2->m_frame ) { exception_tb = ADD_TRACEBACK( exception_tb, frame_0c00caeab83633b5a6b5c185156303f2, exception_lineno ); } // Attachs locals to frame if any. Nuitka_Frame_AttachLocals( (struct Nuitka_FrameObject *)frame_0c00caeab83633b5a6b5c185156303f2, type_description_1, par_text, var_p ); // Release cached frame. if ( frame_0c00caeab83633b5a6b5c185156303f2 == cache_frame_0c00caeab83633b5a6b5c185156303f2 ) { Py_DECREF( frame_0c00caeab83633b5a6b5c185156303f2 ); } cache_frame_0c00caeab83633b5a6b5c185156303f2 = NULL; assertFrameObject( frame_0c00caeab83633b5a6b5c185156303f2 ); // Put the previous frame back on top. popFrameStack(); // Return the error. goto try_except_handler_1; frame_no_exception_1:; tmp_return_value = Py_None; Py_INCREF( tmp_return_value ); goto try_return_handler_1; // tried codes exits in all cases NUITKA_CANNOT_GET_HERE( pyperclip$clipboards$$$function_1_init_osx_clipboard$$$function_1_copy_osx ); return NULL; // Return handler code: try_return_handler_1:; Py_XDECREF( par_text ); par_text = NULL; Py_XDECREF( var_p ); var_p = NULL; goto function_return_exit; // Exception handler code: try_except_handler_1:; exception_keeper_type_1 = exception_type; exception_keeper_value_1 = exception_value; exception_keeper_tb_1 = exception_tb; exception_keeper_lineno_1 = exception_lineno; exception_type = NULL; exception_value = NULL; exception_tb = NULL; exception_lineno = 0; Py_XDECREF( par_text ); par_text = NULL; Py_XDECREF( var_p ); var_p = NULL; // Re-raise. exception_type = exception_keeper_type_1; exception_value = exception_keeper_value_1; exception_tb = exception_keeper_tb_1; exception_lineno = exception_keeper_lineno_1; goto function_exception_exit; // End of try: // Return statement must have exited already. NUITKA_CANNOT_GET_HERE( pyperclip$clipboards$$$function_1_init_osx_clipboard$$$function_1_copy_osx ); return NULL; function_exception_exit: assert( exception_type ); RESTORE_ERROR_OCCURRED( exception_type, exception_value, exception_tb ); return NULL; function_return_exit: CHECK_OBJECT( tmp_return_value ); assert( had_error || !ERROR_OCCURRED() ); return tmp_return_value; } static PyObject *impl_pyperclip$clipboards$$$function_1_init_osx_clipboard$$$function_2_paste_osx( struct Nuitka_FunctionObject const *self, PyObject **python_pars ) { // Preserve error status for checks #ifndef __NUITKA_NO_ASSERT__ NUITKA_MAY_BE_UNUSED bool had_error = ERROR_OCCURRED(); #endif // Local variable declarations. PyObject *var_p = NULL; PyObject *var_stdout = NULL; PyObject *var_stderr = NULL; PyObject *tmp_tuple_unpack_1__element_1 = NULL; PyObject *tmp_tuple_unpack_1__element_2 = NULL; PyObject *tmp_tuple_unpack_1__source_iter = NULL; PyObject *exception_type = NULL; PyObject *exception_value = NULL; PyTracebackObject *exception_tb = NULL; NUITKA_MAY_BE_UNUSED int exception_lineno = 0; PyObject *exception_keeper_type_1; PyObject *exception_keeper_value_1; PyTracebackObject *exception_keeper_tb_1; NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_1; PyObject *exception_keeper_type_2; PyObject *exception_keeper_value_2; PyTracebackObject *exception_keeper_tb_2; NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_2; PyObject *exception_keeper_type_3; PyObject *exception_keeper_value_3; PyTracebackObject *exception_keeper_tb_3; NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_3; PyObject *tmp_args_name_1; PyObject *tmp_assign_source_1; PyObject *tmp_assign_source_2; PyObject *tmp_assign_source_3; PyObject *tmp_assign_source_4; PyObject *tmp_assign_source_5; PyObject *tmp_assign_source_6; PyObject *tmp_called_instance_1; PyObject *tmp_called_instance_2; PyObject *tmp_called_name_1; PyObject *tmp_dict_key_1; PyObject *tmp_dict_key_2; PyObject *tmp_dict_value_1; PyObject *tmp_dict_value_2; PyObject *tmp_iter_arg_1; PyObject *tmp_iterator_attempt; PyObject *tmp_iterator_name_1; PyObject *tmp_kw_name_1; int tmp_res; PyObject *tmp_return_value; PyObject *tmp_source_name_1; PyObject *tmp_source_name_2; PyObject *tmp_unpack_1; PyObject *tmp_unpack_2; static struct Nuitka_FrameObject *cache_frame_fe9ce96a2fa59097f4e8994392986166 = NULL; struct Nuitka_FrameObject *frame_fe9ce96a2fa59097f4e8994392986166; NUITKA_MAY_BE_UNUSED char const *type_description_1 = NULL; tmp_return_value = NULL; // Actual function code. // Tried code: MAKE_OR_REUSE_FRAME( cache_frame_fe9ce96a2fa59097f4e8994392986166, codeobj_fe9ce96a2fa59097f4e8994392986166, module_pyperclip$clipboards, sizeof(void *)+sizeof(void *)+sizeof(void *) ); frame_fe9ce96a2fa59097f4e8994392986166 = cache_frame_fe9ce96a2fa59097f4e8994392986166; // Push the new frame as the currently active one. pushFrameStack( frame_fe9ce96a2fa59097f4e8994392986166 ); // Mark the frame object as in use, ref count 1 will be up for reuse. assert( Py_REFCNT( frame_fe9ce96a2fa59097f4e8994392986166 ) == 2 ); // Frame stack // Framed code: tmp_source_name_1 = GET_STRING_DICT_VALUE( moduledict_pyperclip$clipboards, (Nuitka_StringObject *)const_str_plain_subprocess ); if (unlikely( tmp_source_name_1 == NULL )) { tmp_source_name_1 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_subprocess ); } if ( tmp_source_name_1 == NULL ) { exception_type = PyExc_NameError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "subprocess" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 19; type_description_1 = "ooo"; goto frame_exception_exit_1; } tmp_called_name_1 = LOOKUP_ATTRIBUTE( tmp_source_name_1, const_str_plain_Popen ); if ( tmp_called_name_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 19; type_description_1 = "ooo"; goto frame_exception_exit_1; } tmp_args_name_1 = DEEP_COPY( const_tuple_list_str_plain_pbpaste_str_plain_r_list_tuple ); tmp_kw_name_1 = _PyDict_NewPresized( 2 ); tmp_dict_key_1 = const_str_plain_stdout; tmp_source_name_2 = GET_STRING_DICT_VALUE( moduledict_pyperclip$clipboards, (Nuitka_StringObject *)const_str_plain_subprocess ); if (unlikely( tmp_source_name_2 == NULL )) { tmp_source_name_2 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_subprocess ); } if ( tmp_source_name_2 == NULL ) { Py_DECREF( tmp_called_name_1 ); Py_DECREF( tmp_args_name_1 ); Py_DECREF( tmp_kw_name_1 ); exception_type = PyExc_NameError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "subprocess" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 20; type_description_1 = "ooo"; goto frame_exception_exit_1; } tmp_dict_value_1 = LOOKUP_ATTRIBUTE( tmp_source_name_2, const_str_plain_PIPE ); if ( tmp_dict_value_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); Py_DECREF( tmp_called_name_1 ); Py_DECREF( tmp_args_name_1 ); Py_DECREF( tmp_kw_name_1 ); exception_lineno = 20; type_description_1 = "ooo"; goto frame_exception_exit_1; } tmp_res = PyDict_SetItem( tmp_kw_name_1, tmp_dict_key_1, tmp_dict_value_1 ); Py_DECREF( tmp_dict_value_1 ); assert( !(tmp_res != 0) ); tmp_dict_key_2 = const_str_plain_close_fds; tmp_dict_value_2 = Py_True; tmp_res = PyDict_SetItem( tmp_kw_name_1, tmp_dict_key_2, tmp_dict_value_2 ); assert( !(tmp_res != 0) ); frame_fe9ce96a2fa59097f4e8994392986166->m_frame.f_lineno = 19; tmp_assign_source_1 = CALL_FUNCTION( tmp_called_name_1, tmp_args_name_1, tmp_kw_name_1 ); Py_DECREF( tmp_called_name_1 ); Py_DECREF( tmp_args_name_1 ); Py_DECREF( tmp_kw_name_1 ); if ( tmp_assign_source_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 19; type_description_1 = "ooo"; goto frame_exception_exit_1; } assert( var_p == NULL ); var_p = tmp_assign_source_1; // Tried code: tmp_called_instance_1 = var_p; CHECK_OBJECT( tmp_called_instance_1 ); frame_fe9ce96a2fa59097f4e8994392986166->m_frame.f_lineno = 21; tmp_iter_arg_1 = CALL_METHOD_NO_ARGS( tmp_called_instance_1, const_str_plain_communicate ); if ( tmp_iter_arg_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 21; type_description_1 = "ooo"; goto try_except_handler_2; } tmp_assign_source_2 = MAKE_ITERATOR( tmp_iter_arg_1 ); Py_DECREF( tmp_iter_arg_1 ); if ( tmp_assign_source_2 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 21; type_description_1 = "ooo"; goto try_except_handler_2; } assert( tmp_tuple_unpack_1__source_iter == NULL ); tmp_tuple_unpack_1__source_iter = tmp_assign_source_2; // Tried code: tmp_unpack_1 = tmp_tuple_unpack_1__source_iter; CHECK_OBJECT( tmp_unpack_1 ); tmp_assign_source_3 = UNPACK_NEXT( tmp_unpack_1, 0, 2 ); if ( tmp_assign_source_3 == NULL ) { if ( !ERROR_OCCURRED() ) { exception_type = PyExc_StopIteration; Py_INCREF( exception_type ); exception_value = NULL; exception_tb = NULL; } else { FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); } type_description_1 = "ooo"; exception_lineno = 21; goto try_except_handler_3; } assert( tmp_tuple_unpack_1__element_1 == NULL ); tmp_tuple_unpack_1__element_1 = tmp_assign_source_3; tmp_unpack_2 = tmp_tuple_unpack_1__source_iter; CHECK_OBJECT( tmp_unpack_2 ); tmp_assign_source_4 = UNPACK_NEXT( tmp_unpack_2, 1, 2 ); if ( tmp_assign_source_4 == NULL ) { if ( !ERROR_OCCURRED() ) { exception_type = PyExc_StopIteration; Py_INCREF( exception_type ); exception_value = NULL; exception_tb = NULL; } else { FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); } type_description_1 = "ooo"; exception_lineno = 21; goto try_except_handler_3; } assert( tmp_tuple_unpack_1__element_2 == NULL ); tmp_tuple_unpack_1__element_2 = tmp_assign_source_4; tmp_iterator_name_1 = tmp_tuple_unpack_1__source_iter; CHECK_OBJECT( tmp_iterator_name_1 ); // Check if iterator has left-over elements. CHECK_OBJECT( tmp_iterator_name_1 ); assert( HAS_ITERNEXT( tmp_iterator_name_1 ) ); tmp_iterator_attempt = (*Py_TYPE( tmp_iterator_name_1 )->tp_iternext)( tmp_iterator_name_1 ); if (likely( tmp_iterator_attempt == NULL )) { PyObject *error = GET_ERROR_OCCURRED(); if ( error != NULL ) { if ( EXCEPTION_MATCH_BOOL_SINGLE( error, PyExc_StopIteration )) { CLEAR_ERROR_OCCURRED(); } else { FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); type_description_1 = "ooo"; exception_lineno = 21; goto try_except_handler_3; } } } else { Py_DECREF( tmp_iterator_attempt ); // TODO: Could avoid PyErr_Format. #if PYTHON_VERSION < 300 PyErr_Format( PyExc_ValueError, "too many values to unpack" ); #else PyErr_Format( PyExc_ValueError, "too many values to unpack (expected 2)" ); #endif FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); type_description_1 = "ooo"; exception_lineno = 21; goto try_except_handler_3; } goto try_end_1; // Exception handler code: try_except_handler_3:; exception_keeper_type_1 = exception_type; exception_keeper_value_1 = exception_value; exception_keeper_tb_1 = exception_tb; exception_keeper_lineno_1 = exception_lineno; exception_type = NULL; exception_value = NULL; exception_tb = NULL; exception_lineno = 0; Py_XDECREF( tmp_tuple_unpack_1__source_iter ); tmp_tuple_unpack_1__source_iter = NULL; // Re-raise. exception_type = exception_keeper_type_1; exception_value = exception_keeper_value_1; exception_tb = exception_keeper_tb_1; exception_lineno = exception_keeper_lineno_1; goto try_except_handler_2; // End of try: try_end_1:; goto try_end_2; // Exception handler code: try_except_handler_2:; exception_keeper_type_2 = exception_type; exception_keeper_value_2 = exception_value; exception_keeper_tb_2 = exception_tb; exception_keeper_lineno_2 = exception_lineno; exception_type = NULL; exception_value = NULL; exception_tb = NULL; exception_lineno = 0; Py_XDECREF( tmp_tuple_unpack_1__element_1 ); tmp_tuple_unpack_1__element_1 = NULL; Py_XDECREF( tmp_tuple_unpack_1__element_2 ); tmp_tuple_unpack_1__element_2 = NULL; // Re-raise. exception_type = exception_keeper_type_2; exception_value = exception_keeper_value_2; exception_tb = exception_keeper_tb_2; exception_lineno = exception_keeper_lineno_2; goto frame_exception_exit_1; // End of try: try_end_2:; Py_XDECREF( tmp_tuple_unpack_1__source_iter ); tmp_tuple_unpack_1__source_iter = NULL; tmp_assign_source_5 = tmp_tuple_unpack_1__element_1; CHECK_OBJECT( tmp_assign_source_5 ); assert( var_stdout == NULL ); Py_INCREF( tmp_assign_source_5 ); var_stdout = tmp_assign_source_5; Py_XDECREF( tmp_tuple_unpack_1__element_1 ); tmp_tuple_unpack_1__element_1 = NULL; tmp_assign_source_6 = tmp_tuple_unpack_1__element_2; CHECK_OBJECT( tmp_assign_source_6 ); assert( var_stderr == NULL ); Py_INCREF( tmp_assign_source_6 ); var_stderr = tmp_assign_source_6; Py_XDECREF( tmp_tuple_unpack_1__element_2 ); tmp_tuple_unpack_1__element_2 = NULL; Py_XDECREF( tmp_tuple_unpack_1__element_1 ); tmp_tuple_unpack_1__element_1 = NULL; Py_XDECREF( tmp_tuple_unpack_1__element_2 ); tmp_tuple_unpack_1__element_2 = NULL; tmp_called_instance_2 = var_stdout; if ( tmp_called_instance_2 == NULL ) { exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "stdout" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 22; type_description_1 = "ooo"; goto frame_exception_exit_1; } frame_fe9ce96a2fa59097f4e8994392986166->m_frame.f_lineno = 22; tmp_return_value = CALL_METHOD_WITH_ARGS1( tmp_called_instance_2, const_str_plain_decode, &PyTuple_GET_ITEM( const_tuple_str_digest_c075052d723d6707083e869a0e3659bb_tuple, 0 ) ); if ( tmp_return_value == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 22; type_description_1 = "ooo"; goto frame_exception_exit_1; } goto frame_return_exit_1; #if 0 RESTORE_FRAME_EXCEPTION( frame_fe9ce96a2fa59097f4e8994392986166 ); #endif // Put the previous frame back on top. popFrameStack(); goto frame_no_exception_1; frame_return_exit_1:; #if 0 RESTORE_FRAME_EXCEPTION( frame_fe9ce96a2fa59097f4e8994392986166 ); #endif // Put the previous frame back on top. popFrameStack(); goto try_return_handler_1; frame_exception_exit_1:; #if 0 RESTORE_FRAME_EXCEPTION( frame_fe9ce96a2fa59097f4e8994392986166 ); #endif if ( exception_tb == NULL ) { exception_tb = MAKE_TRACEBACK( frame_fe9ce96a2fa59097f4e8994392986166, exception_lineno ); } else if ( exception_tb->tb_frame != &frame_fe9ce96a2fa59097f4e8994392986166->m_frame ) { exception_tb = ADD_TRACEBACK( exception_tb, frame_fe9ce96a2fa59097f4e8994392986166, exception_lineno ); } // Attachs locals to frame if any. Nuitka_Frame_AttachLocals( (struct Nuitka_FrameObject *)frame_fe9ce96a2fa59097f4e8994392986166, type_description_1, var_p, var_stdout, var_stderr ); // Release cached frame. if ( frame_fe9ce96a2fa59097f4e8994392986166 == cache_frame_fe9ce96a2fa59097f4e8994392986166 ) { Py_DECREF( frame_fe9ce96a2fa59097f4e8994392986166 ); } cache_frame_fe9ce96a2fa59097f4e8994392986166 = NULL; assertFrameObject( frame_fe9ce96a2fa59097f4e8994392986166 ); // Put the previous frame back on top. popFrameStack(); // Return the error. goto try_except_handler_1; frame_no_exception_1:; // tried codes exits in all cases NUITKA_CANNOT_GET_HERE( pyperclip$clipboards$$$function_1_init_osx_clipboard$$$function_2_paste_osx ); return NULL; // Return handler code: try_return_handler_1:; Py_XDECREF( var_p ); var_p = NULL; Py_XDECREF( var_stdout ); var_stdout = NULL; Py_XDECREF( var_stderr ); var_stderr = NULL; goto function_return_exit; // Exception handler code: try_except_handler_1:; exception_keeper_type_3 = exception_type; exception_keeper_value_3 = exception_value; exception_keeper_tb_3 = exception_tb; exception_keeper_lineno_3 = exception_lineno; exception_type = NULL; exception_value = NULL; exception_tb = NULL; exception_lineno = 0; Py_XDECREF( var_p ); var_p = NULL; Py_XDECREF( var_stdout ); var_stdout = NULL; Py_XDECREF( var_stderr ); var_stderr = NULL; // Re-raise. exception_type = exception_keeper_type_3; exception_value = exception_keeper_value_3; exception_tb = exception_keeper_tb_3; exception_lineno = exception_keeper_lineno_3; goto function_exception_exit; // End of try: // Return statement must have exited already. NUITKA_CANNOT_GET_HERE( pyperclip$clipboards$$$function_1_init_osx_clipboard$$$function_2_paste_osx ); return NULL; function_exception_exit: assert( exception_type ); RESTORE_ERROR_OCCURRED( exception_type, exception_value, exception_tb ); return NULL; function_return_exit: CHECK_OBJECT( tmp_return_value ); assert( had_error || !ERROR_OCCURRED() ); return tmp_return_value; } static PyObject *impl_pyperclip$clipboards$$$function_2_init_gtk_clipboard( struct Nuitka_FunctionObject const *self, PyObject **python_pars ) { // Preserve error status for checks #ifndef __NUITKA_NO_ASSERT__ NUITKA_MAY_BE_UNUSED bool had_error = ERROR_OCCURRED(); #endif // Local variable declarations. struct Nuitka_CellObject *var_gtk = PyCell_EMPTY(); PyObject *var_copy_gtk = NULL; PyObject *var_paste_gtk = NULL; PyObject *exception_type = NULL; PyObject *exception_value = NULL; PyTracebackObject *exception_tb = NULL; NUITKA_MAY_BE_UNUSED int exception_lineno = 0; PyObject *exception_keeper_type_1; PyObject *exception_keeper_value_1; PyTracebackObject *exception_keeper_tb_1; NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_1; PyObject *tmp_assign_source_1; PyObject *tmp_assign_source_2; PyObject *tmp_assign_source_3; PyObject *tmp_fromlist_name_1; PyObject *tmp_globals_name_1; PyObject *tmp_level_name_1; PyObject *tmp_locals_name_1; PyObject *tmp_name_name_1; PyObject *tmp_return_value; PyObject *tmp_tuple_element_1; static struct Nuitka_FrameObject *cache_frame_7512eea690737b69fcf042e9389861f9 = NULL; struct Nuitka_FrameObject *frame_7512eea690737b69fcf042e9389861f9; NUITKA_MAY_BE_UNUSED char const *type_description_1 = NULL; tmp_return_value = NULL; // Actual function code. // Tried code: MAKE_OR_REUSE_FRAME( cache_frame_7512eea690737b69fcf042e9389861f9, codeobj_7512eea690737b69fcf042e9389861f9, module_pyperclip$clipboards, sizeof(void *)+sizeof(void *)+sizeof(void *) ); frame_7512eea690737b69fcf042e9389861f9 = cache_frame_7512eea690737b69fcf042e9389861f9; // Push the new frame as the currently active one. pushFrameStack( frame_7512eea690737b69fcf042e9389861f9 ); // Mark the frame object as in use, ref count 1 will be up for reuse. assert( Py_REFCNT( frame_7512eea690737b69fcf042e9389861f9 ) == 2 ); // Frame stack // Framed code: tmp_name_name_1 = const_str_plain_gtk; tmp_globals_name_1 = (PyObject *)moduledict_pyperclip$clipboards; tmp_locals_name_1 = Py_None; tmp_fromlist_name_1 = Py_None; tmp_level_name_1 = const_int_0; frame_7512eea690737b69fcf042e9389861f9->m_frame.f_lineno = 28; tmp_assign_source_1 = IMPORT_MODULE5( tmp_name_name_1, tmp_globals_name_1, tmp_locals_name_1, tmp_fromlist_name_1, tmp_level_name_1 ); if ( tmp_assign_source_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 28; type_description_1 = "coo"; goto frame_exception_exit_1; } { PyObject *old = PyCell_GET( var_gtk ); PyCell_SET( var_gtk, tmp_assign_source_1 ); Py_XDECREF( old ); } #if 0 RESTORE_FRAME_EXCEPTION( frame_7512eea690737b69fcf042e9389861f9 ); #endif // Put the previous frame back on top. popFrameStack(); goto frame_no_exception_1; frame_exception_exit_1:; #if 0 RESTORE_FRAME_EXCEPTION( frame_7512eea690737b69fcf042e9389861f9 ); #endif if ( exception_tb == NULL ) { exception_tb = MAKE_TRACEBACK( frame_7512eea690737b69fcf042e9389861f9, exception_lineno ); } else if ( exception_tb->tb_frame != &frame_7512eea690737b69fcf042e9389861f9->m_frame ) { exception_tb = ADD_TRACEBACK( exception_tb, frame_7512eea690737b69fcf042e9389861f9, exception_lineno ); } // Attachs locals to frame if any. Nuitka_Frame_AttachLocals( (struct Nuitka_FrameObject *)frame_7512eea690737b69fcf042e9389861f9, type_description_1, var_gtk, var_copy_gtk, var_paste_gtk ); // Release cached frame. if ( frame_7512eea690737b69fcf042e9389861f9 == cache_frame_7512eea690737b69fcf042e9389861f9 ) { Py_DECREF( frame_7512eea690737b69fcf042e9389861f9 ); } cache_frame_7512eea690737b69fcf042e9389861f9 = NULL; assertFrameObject( frame_7512eea690737b69fcf042e9389861f9 ); // Put the previous frame back on top. popFrameStack(); // Return the error. goto try_except_handler_1; frame_no_exception_1:; tmp_assign_source_2 = MAKE_FUNCTION_pyperclip$clipboards$$$function_2_init_gtk_clipboard$$$function_1_copy_gtk( var_gtk ); assert( var_copy_gtk == NULL ); var_copy_gtk = tmp_assign_source_2; tmp_assign_source_3 = MAKE_FUNCTION_pyperclip$clipboards$$$function_2_init_gtk_clipboard$$$function_2_paste_gtk( var_gtk ); assert( var_paste_gtk == NULL ); var_paste_gtk = tmp_assign_source_3; tmp_return_value = PyTuple_New( 2 ); tmp_tuple_element_1 = var_copy_gtk; CHECK_OBJECT( tmp_tuple_element_1 ); Py_INCREF( tmp_tuple_element_1 ); PyTuple_SET_ITEM( tmp_return_value, 0, tmp_tuple_element_1 ); tmp_tuple_element_1 = var_paste_gtk; CHECK_OBJECT( tmp_tuple_element_1 ); Py_INCREF( tmp_tuple_element_1 ); PyTuple_SET_ITEM( tmp_return_value, 1, tmp_tuple_element_1 ); goto try_return_handler_1; // tried codes exits in all cases NUITKA_CANNOT_GET_HERE( pyperclip$clipboards$$$function_2_init_gtk_clipboard ); return NULL; // Return handler code: try_return_handler_1:; CHECK_OBJECT( (PyObject *)var_gtk ); Py_DECREF( var_gtk ); var_gtk = NULL; Py_XDECREF( var_copy_gtk ); var_copy_gtk = NULL; Py_XDECREF( var_paste_gtk ); var_paste_gtk = NULL; goto function_return_exit; // Exception handler code: try_except_handler_1:; exception_keeper_type_1 = exception_type; exception_keeper_value_1 = exception_value; exception_keeper_tb_1 = exception_tb; exception_keeper_lineno_1 = exception_lineno; exception_type = NULL; exception_value = NULL; exception_tb = NULL; exception_lineno = 0; // Re-raise. exception_type = exception_keeper_type_1; exception_value = exception_keeper_value_1; exception_tb = exception_keeper_tb_1; exception_lineno = exception_keeper_lineno_1; goto function_exception_exit; // End of try: // Return statement must have exited already. NUITKA_CANNOT_GET_HERE( pyperclip$clipboards$$$function_2_init_gtk_clipboard ); return NULL; function_exception_exit: assert( exception_type ); RESTORE_ERROR_OCCURRED( exception_type, exception_value, exception_tb ); return NULL; function_return_exit: CHECK_OBJECT( tmp_return_value ); assert( had_error || !ERROR_OCCURRED() ); return tmp_return_value; } static PyObject *impl_pyperclip$clipboards$$$function_2_init_gtk_clipboard$$$function_1_copy_gtk( struct Nuitka_FunctionObject const *self, PyObject **python_pars ) { // Preserve error status for checks #ifndef __NUITKA_NO_ASSERT__ NUITKA_MAY_BE_UNUSED bool had_error = ERROR_OCCURRED(); #endif // Local variable declarations. PyObject *par_text = python_pars[ 0 ]; PyObject *exception_type = NULL; PyObject *exception_value = NULL; PyTracebackObject *exception_tb = NULL; NUITKA_MAY_BE_UNUSED int exception_lineno = 0; PyObject *exception_keeper_type_1; PyObject *exception_keeper_value_1; PyTracebackObject *exception_keeper_tb_1; NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_1; PyObject *tmp_args_element_name_1; PyObject *tmp_assign_source_1; PyObject *tmp_called_instance_1; PyObject *tmp_called_instance_2; PyObject *tmp_called_name_1; PyObject *tmp_return_value; PyObject *tmp_source_name_1; NUITKA_MAY_BE_UNUSED PyObject *tmp_unused; static struct Nuitka_FrameObject *cache_frame_6c43a1687d3fc7e03237a18bb4a7ff7d = NULL; struct Nuitka_FrameObject *frame_6c43a1687d3fc7e03237a18bb4a7ff7d; NUITKA_MAY_BE_UNUSED char const *type_description_1 = NULL; tmp_return_value = NULL; // Actual function code. // Tried code: MAKE_OR_REUSE_FRAME( cache_frame_6c43a1687d3fc7e03237a18bb4a7ff7d, codeobj_6c43a1687d3fc7e03237a18bb4a7ff7d, module_pyperclip$clipboards, sizeof(void *)+sizeof(void *) ); frame_6c43a1687d3fc7e03237a18bb4a7ff7d = cache_frame_6c43a1687d3fc7e03237a18bb4a7ff7d; // Push the new frame as the currently active one. pushFrameStack( frame_6c43a1687d3fc7e03237a18bb4a7ff7d ); // Mark the frame object as in use, ref count 1 will be up for reuse. assert( Py_REFCNT( frame_6c43a1687d3fc7e03237a18bb4a7ff7d ) == 2 ); // Frame stack // Framed code: if ( self->m_closure[0] == NULL ) { tmp_called_instance_1 = NULL; } else { tmp_called_instance_1 = PyCell_GET( self->m_closure[0] ); } if ( tmp_called_instance_1 == NULL ) { exception_type = PyExc_NameError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "free variable '%s' referenced before assignment in enclosing scope", "gtk" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 32; type_description_1 = "oc"; goto frame_exception_exit_1; } frame_6c43a1687d3fc7e03237a18bb4a7ff7d->m_frame.f_lineno = 32; tmp_assign_source_1 = CALL_METHOD_NO_ARGS( tmp_called_instance_1, const_str_plain_Clipboard ); if ( tmp_assign_source_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 32; type_description_1 = "oc"; goto frame_exception_exit_1; } UPDATE_STRING_DICT1( moduledict_pyperclip$clipboards, (Nuitka_StringObject *)const_str_plain_cb, tmp_assign_source_1 ); tmp_source_name_1 = GET_STRING_DICT_VALUE( moduledict_pyperclip$clipboards, (Nuitka_StringObject *)const_str_plain_cb ); if (unlikely( tmp_source_name_1 == NULL )) { tmp_source_name_1 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_cb ); } if ( tmp_source_name_1 == NULL ) { exception_type = PyExc_NameError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "cb" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 33; type_description_1 = "oc"; goto frame_exception_exit_1; } tmp_called_name_1 = LOOKUP_ATTRIBUTE( tmp_source_name_1, const_str_plain_set_text ); if ( tmp_called_name_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 33; type_description_1 = "oc"; goto frame_exception_exit_1; } tmp_args_element_name_1 = par_text; if ( tmp_args_element_name_1 == NULL ) { Py_DECREF( tmp_called_name_1 ); exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "text" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 33; type_description_1 = "oc"; goto frame_exception_exit_1; } frame_6c43a1687d3fc7e03237a18bb4a7ff7d->m_frame.f_lineno = 33; { PyObject *call_args[] = { tmp_args_element_name_1 }; tmp_unused = CALL_FUNCTION_WITH_ARGS1( tmp_called_name_1, call_args ); } Py_DECREF( tmp_called_name_1 ); if ( tmp_unused == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 33; type_description_1 = "oc"; goto frame_exception_exit_1; } Py_DECREF( tmp_unused ); tmp_called_instance_2 = GET_STRING_DICT_VALUE( moduledict_pyperclip$clipboards, (Nuitka_StringObject *)const_str_plain_cb ); if (unlikely( tmp_called_instance_2 == NULL )) { tmp_called_instance_2 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_cb ); } if ( tmp_called_instance_2 == NULL ) { exception_type = PyExc_NameError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "cb" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 34; type_description_1 = "oc"; goto frame_exception_exit_1; } frame_6c43a1687d3fc7e03237a18bb4a7ff7d->m_frame.f_lineno = 34; tmp_unused = CALL_METHOD_NO_ARGS( tmp_called_instance_2, const_str_plain_store ); if ( tmp_unused == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 34; type_description_1 = "oc"; goto frame_exception_exit_1; } Py_DECREF( tmp_unused ); #if 0 RESTORE_FRAME_EXCEPTION( frame_6c43a1687d3fc7e03237a18bb4a7ff7d ); #endif // Put the previous frame back on top. popFrameStack(); goto frame_no_exception_1; frame_exception_exit_1:; #if 0 RESTORE_FRAME_EXCEPTION( frame_6c43a1687d3fc7e03237a18bb4a7ff7d ); #endif if ( exception_tb == NULL ) { exception_tb = MAKE_TRACEBACK( frame_6c43a1687d3fc7e03237a18bb4a7ff7d, exception_lineno ); } else if ( exception_tb->tb_frame != &frame_6c43a1687d3fc7e03237a18bb4a7ff7d->m_frame ) { exception_tb = ADD_TRACEBACK( exception_tb, frame_6c43a1687d3fc7e03237a18bb4a7ff7d, exception_lineno ); } // Attachs locals to frame if any. Nuitka_Frame_AttachLocals( (struct Nuitka_FrameObject *)frame_6c43a1687d3fc7e03237a18bb4a7ff7d, type_description_1, par_text, self->m_closure[0] ); // Release cached frame. if ( frame_6c43a1687d3fc7e03237a18bb4a7ff7d == cache_frame_6c43a1687d3fc7e03237a18bb4a7ff7d ) { Py_DECREF( frame_6c43a1687d3fc7e03237a18bb4a7ff7d ); } cache_frame_6c43a1687d3fc7e03237a18bb4a7ff7d = NULL; assertFrameObject( frame_6c43a1687d3fc7e03237a18bb4a7ff7d ); // Put the previous frame back on top. popFrameStack(); // Return the error. goto try_except_handler_1; frame_no_exception_1:; tmp_return_value = Py_None; Py_INCREF( tmp_return_value ); goto try_return_handler_1; // tried codes exits in all cases NUITKA_CANNOT_GET_HERE( pyperclip$clipboards$$$function_2_init_gtk_clipboard$$$function_1_copy_gtk ); return NULL; // Return handler code: try_return_handler_1:; Py_XDECREF( par_text ); par_text = NULL; goto function_return_exit; // Exception handler code: try_except_handler_1:; exception_keeper_type_1 = exception_type; exception_keeper_value_1 = exception_value; exception_keeper_tb_1 = exception_tb; exception_keeper_lineno_1 = exception_lineno; exception_type = NULL; exception_value = NULL; exception_tb = NULL; exception_lineno = 0; Py_XDECREF( par_text ); par_text = NULL; // Re-raise. exception_type = exception_keeper_type_1; exception_value = exception_keeper_value_1; exception_tb = exception_keeper_tb_1; exception_lineno = exception_keeper_lineno_1; goto function_exception_exit; // End of try: // Return statement must have exited already. NUITKA_CANNOT_GET_HERE( pyperclip$clipboards$$$function_2_init_gtk_clipboard$$$function_1_copy_gtk ); return NULL; function_exception_exit: assert( exception_type ); RESTORE_ERROR_OCCURRED( exception_type, exception_value, exception_tb ); return NULL; function_return_exit: CHECK_OBJECT( tmp_return_value ); assert( had_error || !ERROR_OCCURRED() ); return tmp_return_value; } static PyObject *impl_pyperclip$clipboards$$$function_2_init_gtk_clipboard$$$function_2_paste_gtk( struct Nuitka_FunctionObject const *self, PyObject **python_pars ) { // Preserve error status for checks #ifndef __NUITKA_NO_ASSERT__ NUITKA_MAY_BE_UNUSED bool had_error = ERROR_OCCURRED(); #endif // Local variable declarations. PyObject *var_clipboardContents = NULL; PyObject *exception_type = NULL; PyObject *exception_value = NULL; PyTracebackObject *exception_tb = NULL; NUITKA_MAY_BE_UNUSED int exception_lineno = 0; PyObject *exception_keeper_type_1; PyObject *exception_keeper_value_1; PyTracebackObject *exception_keeper_tb_1; NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_1; PyObject *tmp_assign_source_1; PyObject *tmp_called_instance_1; PyObject *tmp_called_instance_2; PyObject *tmp_compare_left_1; PyObject *tmp_compare_right_1; bool tmp_is_1; PyObject *tmp_return_value; static struct Nuitka_FrameObject *cache_frame_113d5874740330562529e560a6ae6b38 = NULL; struct Nuitka_FrameObject *frame_113d5874740330562529e560a6ae6b38; NUITKA_MAY_BE_UNUSED char const *type_description_1 = NULL; tmp_return_value = NULL; // Actual function code. // Tried code: MAKE_OR_REUSE_FRAME( cache_frame_113d5874740330562529e560a6ae6b38, codeobj_113d5874740330562529e560a6ae6b38, module_pyperclip$clipboards, sizeof(void *)+sizeof(void *) ); frame_113d5874740330562529e560a6ae6b38 = cache_frame_113d5874740330562529e560a6ae6b38; // Push the new frame as the currently active one. pushFrameStack( frame_113d5874740330562529e560a6ae6b38 ); // Mark the frame object as in use, ref count 1 will be up for reuse. assert( Py_REFCNT( frame_113d5874740330562529e560a6ae6b38 ) == 2 ); // Frame stack // Framed code: if ( self->m_closure[0] == NULL ) { tmp_called_instance_2 = NULL; } else { tmp_called_instance_2 = PyCell_GET( self->m_closure[0] ); } if ( tmp_called_instance_2 == NULL ) { exception_type = PyExc_NameError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "free variable '%s' referenced before assignment in enclosing scope", "gtk" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 37; type_description_1 = "oc"; goto frame_exception_exit_1; } frame_113d5874740330562529e560a6ae6b38->m_frame.f_lineno = 37; tmp_called_instance_1 = CALL_METHOD_NO_ARGS( tmp_called_instance_2, const_str_plain_Clipboard ); if ( tmp_called_instance_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 37; type_description_1 = "oc"; goto frame_exception_exit_1; } frame_113d5874740330562529e560a6ae6b38->m_frame.f_lineno = 37; tmp_assign_source_1 = CALL_METHOD_NO_ARGS( tmp_called_instance_1, const_str_plain_wait_for_text ); Py_DECREF( tmp_called_instance_1 ); if ( tmp_assign_source_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 37; type_description_1 = "oc"; goto frame_exception_exit_1; } assert( var_clipboardContents == NULL ); var_clipboardContents = tmp_assign_source_1; tmp_compare_left_1 = var_clipboardContents; CHECK_OBJECT( tmp_compare_left_1 ); tmp_compare_right_1 = Py_None; tmp_is_1 = ( tmp_compare_left_1 == tmp_compare_right_1 ); if ( tmp_is_1 ) { goto branch_yes_1; } else { goto branch_no_1; } branch_yes_1:; tmp_return_value = const_str_empty; Py_INCREF( tmp_return_value ); goto frame_return_exit_1; goto branch_end_1; branch_no_1:; tmp_return_value = var_clipboardContents; if ( tmp_return_value == NULL ) { exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "clipboardContents" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 42; type_description_1 = "oc"; goto frame_exception_exit_1; } Py_INCREF( tmp_return_value ); goto frame_return_exit_1; branch_end_1:; #if 0 RESTORE_FRAME_EXCEPTION( frame_113d5874740330562529e560a6ae6b38 ); #endif // Put the previous frame back on top. popFrameStack(); goto frame_no_exception_1; frame_return_exit_1:; #if 0 RESTORE_FRAME_EXCEPTION( frame_113d5874740330562529e560a6ae6b38 ); #endif // Put the previous frame back on top. popFrameStack(); goto try_return_handler_1; frame_exception_exit_1:; #if 0 RESTORE_FRAME_EXCEPTION( frame_113d5874740330562529e560a6ae6b38 ); #endif if ( exception_tb == NULL ) { exception_tb = MAKE_TRACEBACK( frame_113d5874740330562529e560a6ae6b38, exception_lineno ); } else if ( exception_tb->tb_frame != &frame_113d5874740330562529e560a6ae6b38->m_frame ) { exception_tb = ADD_TRACEBACK( exception_tb, frame_113d5874740330562529e560a6ae6b38, exception_lineno ); } // Attachs locals to frame if any. Nuitka_Frame_AttachLocals( (struct Nuitka_FrameObject *)frame_113d5874740330562529e560a6ae6b38, type_description_1, var_clipboardContents, self->m_closure[0] ); // Release cached frame. if ( frame_113d5874740330562529e560a6ae6b38 == cache_frame_113d5874740330562529e560a6ae6b38 ) { Py_DECREF( frame_113d5874740330562529e560a6ae6b38 ); } cache_frame_113d5874740330562529e560a6ae6b38 = NULL; assertFrameObject( frame_113d5874740330562529e560a6ae6b38 ); // Put the previous frame back on top. popFrameStack(); // Return the error. goto try_except_handler_1; frame_no_exception_1:; // tried codes exits in all cases NUITKA_CANNOT_GET_HERE( pyperclip$clipboards$$$function_2_init_gtk_clipboard$$$function_2_paste_gtk ); return NULL; // Return handler code: try_return_handler_1:; Py_XDECREF( var_clipboardContents ); var_clipboardContents = NULL; goto function_return_exit; // Exception handler code: try_except_handler_1:; exception_keeper_type_1 = exception_type; exception_keeper_value_1 = exception_value; exception_keeper_tb_1 = exception_tb; exception_keeper_lineno_1 = exception_lineno; exception_type = NULL; exception_value = NULL; exception_tb = NULL; exception_lineno = 0; Py_XDECREF( var_clipboardContents ); var_clipboardContents = NULL; // Re-raise. exception_type = exception_keeper_type_1; exception_value = exception_keeper_value_1; exception_tb = exception_keeper_tb_1; exception_lineno = exception_keeper_lineno_1; goto function_exception_exit; // End of try: // Return statement must have exited already. NUITKA_CANNOT_GET_HERE( pyperclip$clipboards$$$function_2_init_gtk_clipboard$$$function_2_paste_gtk ); return NULL; function_exception_exit: assert( exception_type ); RESTORE_ERROR_OCCURRED( exception_type, exception_value, exception_tb ); return NULL; function_return_exit: CHECK_OBJECT( tmp_return_value ); assert( had_error || !ERROR_OCCURRED() ); return tmp_return_value; } static PyObject *impl_pyperclip$clipboards$$$function_3_init_qt_clipboard( struct Nuitka_FunctionObject const *self, PyObject **python_pars ) { // Preserve error status for checks #ifndef __NUITKA_NO_ASSERT__ NUITKA_MAY_BE_UNUSED bool had_error = ERROR_OCCURRED(); #endif // Local variable declarations. PyObject *var_QApplication = NULL; struct Nuitka_CellObject *var_app = PyCell_EMPTY(); PyObject *var_copy_qt = NULL; PyObject *var_paste_qt = NULL; PyObject *exception_type = NULL; PyObject *exception_value = NULL; PyTracebackObject *exception_tb = NULL; NUITKA_MAY_BE_UNUSED int exception_lineno = 0; PyObject *exception_keeper_type_1; PyObject *exception_keeper_value_1; PyTracebackObject *exception_keeper_tb_1; NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_1; PyObject *tmp_assign_source_1; PyObject *tmp_assign_source_2; PyObject *tmp_assign_source_3; PyObject *tmp_assign_source_4; PyObject *tmp_call_arg_element_1; PyObject *tmp_called_name_1; PyObject *tmp_fromlist_name_1; PyObject *tmp_globals_name_1; PyObject *tmp_import_name_from_1; PyObject *tmp_level_name_1; PyObject *tmp_locals_name_1; PyObject *tmp_name_name_1; PyObject *tmp_return_value; PyObject *tmp_tuple_element_1; static struct Nuitka_FrameObject *cache_frame_e886f435cf3ab0f2a1d23a7b972501c4 = NULL; struct Nuitka_FrameObject *frame_e886f435cf3ab0f2a1d23a7b972501c4; NUITKA_MAY_BE_UNUSED char const *type_description_1 = NULL; tmp_return_value = NULL; // Actual function code. // Tried code: MAKE_OR_REUSE_FRAME( cache_frame_e886f435cf3ab0f2a1d23a7b972501c4, codeobj_e886f435cf3ab0f2a1d23a7b972501c4, module_pyperclip$clipboards, sizeof(void *)+sizeof(void *)+sizeof(void *)+sizeof(void *) ); frame_e886f435cf3ab0f2a1d23a7b972501c4 = cache_frame_e886f435cf3ab0f2a1d23a7b972501c4; // Push the new frame as the currently active one. pushFrameStack( frame_e886f435cf3ab0f2a1d23a7b972501c4 ); // Mark the frame object as in use, ref count 1 will be up for reuse. assert( Py_REFCNT( frame_e886f435cf3ab0f2a1d23a7b972501c4 ) == 2 ); // Frame stack // Framed code: tmp_name_name_1 = const_str_digest_91d3fabe5e3af50ef0546b25193cf397; tmp_globals_name_1 = (PyObject *)moduledict_pyperclip$clipboards; tmp_locals_name_1 = Py_None; tmp_fromlist_name_1 = const_tuple_str_plain_QApplication_tuple; tmp_level_name_1 = const_int_0; frame_e886f435cf3ab0f2a1d23a7b972501c4->m_frame.f_lineno = 49; tmp_import_name_from_1 = IMPORT_MODULE5( tmp_name_name_1, tmp_globals_name_1, tmp_locals_name_1, tmp_fromlist_name_1, tmp_level_name_1 ); if ( tmp_import_name_from_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 49; type_description_1 = "ocoo"; goto frame_exception_exit_1; } tmp_assign_source_1 = IMPORT_NAME( tmp_import_name_from_1, const_str_plain_QApplication ); Py_DECREF( tmp_import_name_from_1 ); if ( tmp_assign_source_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 49; type_description_1 = "ocoo"; goto frame_exception_exit_1; } assert( var_QApplication == NULL ); var_QApplication = tmp_assign_source_1; tmp_called_name_1 = var_QApplication; CHECK_OBJECT( tmp_called_name_1 ); tmp_call_arg_element_1 = PyList_New( 0 ); frame_e886f435cf3ab0f2a1d23a7b972501c4->m_frame.f_lineno = 51; { PyObject *call_args[] = { tmp_call_arg_element_1 }; tmp_assign_source_2 = CALL_FUNCTION_WITH_ARGS1( tmp_called_name_1, call_args ); } Py_DECREF( tmp_call_arg_element_1 ); if ( tmp_assign_source_2 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 51; type_description_1 = "ocoo"; goto frame_exception_exit_1; } { PyObject *old = PyCell_GET( var_app ); PyCell_SET( var_app, tmp_assign_source_2 ); Py_XDECREF( old ); } #if 0 RESTORE_FRAME_EXCEPTION( frame_e886f435cf3ab0f2a1d23a7b972501c4 ); #endif // Put the previous frame back on top. popFrameStack(); goto frame_no_exception_1; frame_exception_exit_1:; #if 0 RESTORE_FRAME_EXCEPTION( frame_e886f435cf3ab0f2a1d23a7b972501c4 ); #endif if ( exception_tb == NULL ) { exception_tb = MAKE_TRACEBACK( frame_e886f435cf3ab0f2a1d23a7b972501c4, exception_lineno ); } else if ( exception_tb->tb_frame != &frame_e886f435cf3ab0f2a1d23a7b972501c4->m_frame ) { exception_tb = ADD_TRACEBACK( exception_tb, frame_e886f435cf3ab0f2a1d23a7b972501c4, exception_lineno ); } // Attachs locals to frame if any. Nuitka_Frame_AttachLocals( (struct Nuitka_FrameObject *)frame_e886f435cf3ab0f2a1d23a7b972501c4, type_description_1, var_QApplication, var_app, var_copy_qt, var_paste_qt ); // Release cached frame. if ( frame_e886f435cf3ab0f2a1d23a7b972501c4 == cache_frame_e886f435cf3ab0f2a1d23a7b972501c4 ) { Py_DECREF( frame_e886f435cf3ab0f2a1d23a7b972501c4 ); } cache_frame_e886f435cf3ab0f2a1d23a7b972501c4 = NULL; assertFrameObject( frame_e886f435cf3ab0f2a1d23a7b972501c4 ); // Put the previous frame back on top. popFrameStack(); // Return the error. goto try_except_handler_1; frame_no_exception_1:; tmp_assign_source_3 = MAKE_FUNCTION_pyperclip$clipboards$$$function_3_init_qt_clipboard$$$function_1_copy_qt( var_app ); assert( var_copy_qt == NULL ); var_copy_qt = tmp_assign_source_3; tmp_assign_source_4 = MAKE_FUNCTION_pyperclip$clipboards$$$function_3_init_qt_clipboard$$$function_2_paste_qt( var_app ); assert( var_paste_qt == NULL ); var_paste_qt = tmp_assign_source_4; tmp_return_value = PyTuple_New( 2 ); tmp_tuple_element_1 = var_copy_qt; CHECK_OBJECT( tmp_tuple_element_1 ); Py_INCREF( tmp_tuple_element_1 ); PyTuple_SET_ITEM( tmp_return_value, 0, tmp_tuple_element_1 ); tmp_tuple_element_1 = var_paste_qt; CHECK_OBJECT( tmp_tuple_element_1 ); Py_INCREF( tmp_tuple_element_1 ); PyTuple_SET_ITEM( tmp_return_value, 1, tmp_tuple_element_1 ); goto try_return_handler_1; // tried codes exits in all cases NUITKA_CANNOT_GET_HERE( pyperclip$clipboards$$$function_3_init_qt_clipboard ); return NULL; // Return handler code: try_return_handler_1:; Py_XDECREF( var_QApplication ); var_QApplication = NULL; CHECK_OBJECT( (PyObject *)var_app ); Py_DECREF( var_app ); var_app = NULL; Py_XDECREF( var_copy_qt ); var_copy_qt = NULL; Py_XDECREF( var_paste_qt ); var_paste_qt = NULL; goto function_return_exit; // Exception handler code: try_except_handler_1:; exception_keeper_type_1 = exception_type; exception_keeper_value_1 = exception_value; exception_keeper_tb_1 = exception_tb; exception_keeper_lineno_1 = exception_lineno; exception_type = NULL; exception_value = NULL; exception_tb = NULL; exception_lineno = 0; Py_XDECREF( var_QApplication ); var_QApplication = NULL; // Re-raise. exception_type = exception_keeper_type_1; exception_value = exception_keeper_value_1; exception_tb = exception_keeper_tb_1; exception_lineno = exception_keeper_lineno_1; goto function_exception_exit; // End of try: // Return statement must have exited already. NUITKA_CANNOT_GET_HERE( pyperclip$clipboards$$$function_3_init_qt_clipboard ); return NULL; function_exception_exit: assert( exception_type ); RESTORE_ERROR_OCCURRED( exception_type, exception_value, exception_tb ); return NULL; function_return_exit: CHECK_OBJECT( tmp_return_value ); assert( had_error || !ERROR_OCCURRED() ); return tmp_return_value; } static PyObject *impl_pyperclip$clipboards$$$function_3_init_qt_clipboard$$$function_1_copy_qt( struct Nuitka_FunctionObject const *self, PyObject **python_pars ) { // Preserve error status for checks #ifndef __NUITKA_NO_ASSERT__ NUITKA_MAY_BE_UNUSED bool had_error = ERROR_OCCURRED(); #endif // Local variable declarations. PyObject *par_text = python_pars[ 0 ]; PyObject *var_cb = NULL; PyObject *exception_type = NULL; PyObject *exception_value = NULL; PyTracebackObject *exception_tb = NULL; NUITKA_MAY_BE_UNUSED int exception_lineno = 0; PyObject *exception_keeper_type_1; PyObject *exception_keeper_value_1; PyTracebackObject *exception_keeper_tb_1; NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_1; PyObject *tmp_args_element_name_1; PyObject *tmp_assign_source_1; PyObject *tmp_called_instance_1; PyObject *tmp_called_name_1; PyObject *tmp_return_value; PyObject *tmp_source_name_1; NUITKA_MAY_BE_UNUSED PyObject *tmp_unused; static struct Nuitka_FrameObject *cache_frame_d32c80b8cc4f52e8ea4f7cf8e00a5a72 = NULL; struct Nuitka_FrameObject *frame_d32c80b8cc4f52e8ea4f7cf8e00a5a72; NUITKA_MAY_BE_UNUSED char const *type_description_1 = NULL; tmp_return_value = NULL; // Actual function code. // Tried code: MAKE_OR_REUSE_FRAME( cache_frame_d32c80b8cc4f52e8ea4f7cf8e00a5a72, codeobj_d32c80b8cc4f52e8ea4f7cf8e00a5a72, module_pyperclip$clipboards, sizeof(void *)+sizeof(void *)+sizeof(void *) ); frame_d32c80b8cc4f52e8ea4f7cf8e00a5a72 = cache_frame_d32c80b8cc4f52e8ea4f7cf8e00a5a72; // Push the new frame as the currently active one. pushFrameStack( frame_d32c80b8cc4f52e8ea4f7cf8e00a5a72 ); // Mark the frame object as in use, ref count 1 will be up for reuse. assert( Py_REFCNT( frame_d32c80b8cc4f52e8ea4f7cf8e00a5a72 ) == 2 ); // Frame stack // Framed code: if ( self->m_closure[0] == NULL ) { tmp_called_instance_1 = NULL; } else { tmp_called_instance_1 = PyCell_GET( self->m_closure[0] ); } if ( tmp_called_instance_1 == NULL ) { exception_type = PyExc_NameError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "free variable '%s' referenced before assignment in enclosing scope", "app" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 54; type_description_1 = "ooc"; goto frame_exception_exit_1; } frame_d32c80b8cc4f52e8ea4f7cf8e00a5a72->m_frame.f_lineno = 54; tmp_assign_source_1 = CALL_METHOD_NO_ARGS( tmp_called_instance_1, const_str_plain_clipboard ); if ( tmp_assign_source_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 54; type_description_1 = "ooc"; goto frame_exception_exit_1; } assert( var_cb == NULL ); var_cb = tmp_assign_source_1; tmp_source_name_1 = var_cb; CHECK_OBJECT( tmp_source_name_1 ); tmp_called_name_1 = LOOKUP_ATTRIBUTE( tmp_source_name_1, const_str_plain_setText ); if ( tmp_called_name_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 55; type_description_1 = "ooc"; goto frame_exception_exit_1; } tmp_args_element_name_1 = par_text; if ( tmp_args_element_name_1 == NULL ) { Py_DECREF( tmp_called_name_1 ); exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "text" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 55; type_description_1 = "ooc"; goto frame_exception_exit_1; } frame_d32c80b8cc4f52e8ea4f7cf8e00a5a72->m_frame.f_lineno = 55; { PyObject *call_args[] = { tmp_args_element_name_1 }; tmp_unused = CALL_FUNCTION_WITH_ARGS1( tmp_called_name_1, call_args ); } Py_DECREF( tmp_called_name_1 ); if ( tmp_unused == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 55; type_description_1 = "ooc"; goto frame_exception_exit_1; } Py_DECREF( tmp_unused ); #if 0 RESTORE_FRAME_EXCEPTION( frame_d32c80b8cc4f52e8ea4f7cf8e00a5a72 ); #endif // Put the previous frame back on top. popFrameStack(); goto frame_no_exception_1; frame_exception_exit_1:; #if 0 RESTORE_FRAME_EXCEPTION( frame_d32c80b8cc4f52e8ea4f7cf8e00a5a72 ); #endif if ( exception_tb == NULL ) { exception_tb = MAKE_TRACEBACK( frame_d32c80b8cc4f52e8ea4f7cf8e00a5a72, exception_lineno ); } else if ( exception_tb->tb_frame != &frame_d32c80b8cc4f52e8ea4f7cf8e00a5a72->m_frame ) { exception_tb = ADD_TRACEBACK( exception_tb, frame_d32c80b8cc4f52e8ea4f7cf8e00a5a72, exception_lineno ); } // Attachs locals to frame if any. Nuitka_Frame_AttachLocals( (struct Nuitka_FrameObject *)frame_d32c80b8cc4f52e8ea4f7cf8e00a5a72, type_description_1, par_text, var_cb, self->m_closure[0] ); // Release cached frame. if ( frame_d32c80b8cc4f52e8ea4f7cf8e00a5a72 == cache_frame_d32c80b8cc4f52e8ea4f7cf8e00a5a72 ) { Py_DECREF( frame_d32c80b8cc4f52e8ea4f7cf8e00a5a72 ); } cache_frame_d32c80b8cc4f52e8ea4f7cf8e00a5a72 = NULL; assertFrameObject( frame_d32c80b8cc4f52e8ea4f7cf8e00a5a72 ); // Put the previous frame back on top. popFrameStack(); // Return the error. goto try_except_handler_1; frame_no_exception_1:; tmp_return_value = Py_None; Py_INCREF( tmp_return_value ); goto try_return_handler_1; // tried codes exits in all cases NUITKA_CANNOT_GET_HERE( pyperclip$clipboards$$$function_3_init_qt_clipboard$$$function_1_copy_qt ); return NULL; // Return handler code: try_return_handler_1:; Py_XDECREF( par_text ); par_text = NULL; Py_XDECREF( var_cb ); var_cb = NULL; goto function_return_exit; // Exception handler code: try_except_handler_1:; exception_keeper_type_1 = exception_type; exception_keeper_value_1 = exception_value; exception_keeper_tb_1 = exception_tb; exception_keeper_lineno_1 = exception_lineno; exception_type = NULL; exception_value = NULL; exception_tb = NULL; exception_lineno = 0; Py_XDECREF( par_text ); par_text = NULL; Py_XDECREF( var_cb ); var_cb = NULL; // Re-raise. exception_type = exception_keeper_type_1; exception_value = exception_keeper_value_1; exception_tb = exception_keeper_tb_1; exception_lineno = exception_keeper_lineno_1; goto function_exception_exit; // End of try: // Return statement must have exited already. NUITKA_CANNOT_GET_HERE( pyperclip$clipboards$$$function_3_init_qt_clipboard$$$function_1_copy_qt ); return NULL; function_exception_exit: assert( exception_type ); RESTORE_ERROR_OCCURRED( exception_type, exception_value, exception_tb ); return NULL; function_return_exit: CHECK_OBJECT( tmp_return_value ); assert( had_error || !ERROR_OCCURRED() ); return tmp_return_value; } static PyObject *impl_pyperclip$clipboards$$$function_3_init_qt_clipboard$$$function_2_paste_qt( struct Nuitka_FunctionObject const *self, PyObject **python_pars ) { // Preserve error status for checks #ifndef __NUITKA_NO_ASSERT__ NUITKA_MAY_BE_UNUSED bool had_error = ERROR_OCCURRED(); #endif // Local variable declarations. PyObject *var_cb = NULL; PyObject *exception_type = NULL; PyObject *exception_value = NULL; PyTracebackObject *exception_tb = NULL; NUITKA_MAY_BE_UNUSED int exception_lineno = 0; PyObject *exception_keeper_type_1; PyObject *exception_keeper_value_1; PyTracebackObject *exception_keeper_tb_1; NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_1; PyObject *tmp_args_element_name_1; PyObject *tmp_assign_source_1; PyObject *tmp_called_instance_1; PyObject *tmp_called_instance_2; PyObject *tmp_called_name_1; PyObject *tmp_return_value; static struct Nuitka_FrameObject *cache_frame_082a9101cf76bcbc1c84e8a20e574a7c = NULL; struct Nuitka_FrameObject *frame_082a9101cf76bcbc1c84e8a20e574a7c; NUITKA_MAY_BE_UNUSED char const *type_description_1 = NULL; tmp_return_value = NULL; // Actual function code. // Tried code: MAKE_OR_REUSE_FRAME( cache_frame_082a9101cf76bcbc1c84e8a20e574a7c, codeobj_082a9101cf76bcbc1c84e8a20e574a7c, module_pyperclip$clipboards, sizeof(void *)+sizeof(void *) ); frame_082a9101cf76bcbc1c84e8a20e574a7c = cache_frame_082a9101cf76bcbc1c84e8a20e574a7c; // Push the new frame as the currently active one. pushFrameStack( frame_082a9101cf76bcbc1c84e8a20e574a7c ); // Mark the frame object as in use, ref count 1 will be up for reuse. assert( Py_REFCNT( frame_082a9101cf76bcbc1c84e8a20e574a7c ) == 2 ); // Frame stack // Framed code: if ( self->m_closure[0] == NULL ) { tmp_called_instance_1 = NULL; } else { tmp_called_instance_1 = PyCell_GET( self->m_closure[0] ); } if ( tmp_called_instance_1 == NULL ) { exception_type = PyExc_NameError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "free variable '%s' referenced before assignment in enclosing scope", "app" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 58; type_description_1 = "oc"; goto frame_exception_exit_1; } frame_082a9101cf76bcbc1c84e8a20e574a7c->m_frame.f_lineno = 58; tmp_assign_source_1 = CALL_METHOD_NO_ARGS( tmp_called_instance_1, const_str_plain_clipboard ); if ( tmp_assign_source_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 58; type_description_1 = "oc"; goto frame_exception_exit_1; } assert( var_cb == NULL ); var_cb = tmp_assign_source_1; tmp_called_name_1 = GET_STRING_DICT_VALUE( moduledict_pyperclip$clipboards, (Nuitka_StringObject *)const_str_plain_text_type ); if (unlikely( tmp_called_name_1 == NULL )) { tmp_called_name_1 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_text_type ); } if ( tmp_called_name_1 == NULL ) { exception_type = PyExc_NameError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "text_type" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 59; type_description_1 = "oc"; goto frame_exception_exit_1; } tmp_called_instance_2 = var_cb; CHECK_OBJECT( tmp_called_instance_2 ); frame_082a9101cf76bcbc1c84e8a20e574a7c->m_frame.f_lineno = 59; tmp_args_element_name_1 = CALL_METHOD_NO_ARGS( tmp_called_instance_2, const_str_plain_text ); if ( tmp_args_element_name_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 59; type_description_1 = "oc"; goto frame_exception_exit_1; } frame_082a9101cf76bcbc1c84e8a20e574a7c->m_frame.f_lineno = 59; { PyObject *call_args[] = { tmp_args_element_name_1 }; tmp_return_value = CALL_FUNCTION_WITH_ARGS1( tmp_called_name_1, call_args ); } Py_DECREF( tmp_args_element_name_1 ); if ( tmp_return_value == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 59; type_description_1 = "oc"; goto frame_exception_exit_1; } goto frame_return_exit_1; #if 0 RESTORE_FRAME_EXCEPTION( frame_082a9101cf76bcbc1c84e8a20e574a7c ); #endif // Put the previous frame back on top. popFrameStack(); goto frame_no_exception_1; frame_return_exit_1:; #if 0 RESTORE_FRAME_EXCEPTION( frame_082a9101cf76bcbc1c84e8a20e574a7c ); #endif // Put the previous frame back on top. popFrameStack(); goto try_return_handler_1; frame_exception_exit_1:; #if 0 RESTORE_FRAME_EXCEPTION( frame_082a9101cf76bcbc1c84e8a20e574a7c ); #endif if ( exception_tb == NULL ) { exception_tb = MAKE_TRACEBACK( frame_082a9101cf76bcbc1c84e8a20e574a7c, exception_lineno ); } else if ( exception_tb->tb_frame != &frame_082a9101cf76bcbc1c84e8a20e574a7c->m_frame ) { exception_tb = ADD_TRACEBACK( exception_tb, frame_082a9101cf76bcbc1c84e8a20e574a7c, exception_lineno ); } // Attachs locals to frame if any. Nuitka_Frame_AttachLocals( (struct Nuitka_FrameObject *)frame_082a9101cf76bcbc1c84e8a20e574a7c, type_description_1, var_cb, self->m_closure[0] ); // Release cached frame. if ( frame_082a9101cf76bcbc1c84e8a20e574a7c == cache_frame_082a9101cf76bcbc1c84e8a20e574a7c ) { Py_DECREF( frame_082a9101cf76bcbc1c84e8a20e574a7c ); } cache_frame_082a9101cf76bcbc1c84e8a20e574a7c = NULL; assertFrameObject( frame_082a9101cf76bcbc1c84e8a20e574a7c ); // Put the previous frame back on top. popFrameStack(); // Return the error. goto try_except_handler_1; frame_no_exception_1:; // tried codes exits in all cases NUITKA_CANNOT_GET_HERE( pyperclip$clipboards$$$function_3_init_qt_clipboard$$$function_2_paste_qt ); return NULL; // Return handler code: try_return_handler_1:; Py_XDECREF( var_cb ); var_cb = NULL; goto function_return_exit; // Exception handler code: try_except_handler_1:; exception_keeper_type_1 = exception_type; exception_keeper_value_1 = exception_value; exception_keeper_tb_1 = exception_tb; exception_keeper_lineno_1 = exception_lineno; exception_type = NULL; exception_value = NULL; exception_tb = NULL; exception_lineno = 0; Py_XDECREF( var_cb ); var_cb = NULL; // Re-raise. exception_type = exception_keeper_type_1; exception_value = exception_keeper_value_1; exception_tb = exception_keeper_tb_1; exception_lineno = exception_keeper_lineno_1; goto function_exception_exit; // End of try: // Return statement must have exited already. NUITKA_CANNOT_GET_HERE( pyperclip$clipboards$$$function_3_init_qt_clipboard$$$function_2_paste_qt ); return NULL; function_exception_exit: assert( exception_type ); RESTORE_ERROR_OCCURRED( exception_type, exception_value, exception_tb ); return NULL; function_return_exit: CHECK_OBJECT( tmp_return_value ); assert( had_error || !ERROR_OCCURRED() ); return tmp_return_value; } static PyObject *impl_pyperclip$clipboards$$$function_4_init_xclip_clipboard( struct Nuitka_FunctionObject const *self, PyObject **python_pars ) { // Preserve error status for checks #ifndef __NUITKA_NO_ASSERT__ NUITKA_MAY_BE_UNUSED bool had_error = ERROR_OCCURRED(); #endif // Local variable declarations. PyObject *var_copy_xclip = NULL; PyObject *var_paste_xclip = NULL; PyObject *tmp_assign_source_1; PyObject *tmp_assign_source_2; PyObject *tmp_return_value; PyObject *tmp_tuple_element_1; tmp_return_value = NULL; // Actual function code. tmp_assign_source_1 = MAKE_FUNCTION_pyperclip$clipboards$$$function_4_init_xclip_clipboard$$$function_1_copy_xclip( ); assert( var_copy_xclip == NULL ); var_copy_xclip = tmp_assign_source_1; tmp_assign_source_2 = MAKE_FUNCTION_pyperclip$clipboards$$$function_4_init_xclip_clipboard$$$function_2_paste_xclip( ); assert( var_paste_xclip == NULL ); var_paste_xclip = tmp_assign_source_2; // Tried code: tmp_return_value = PyTuple_New( 2 ); tmp_tuple_element_1 = var_copy_xclip; CHECK_OBJECT( tmp_tuple_element_1 ); Py_INCREF( tmp_tuple_element_1 ); PyTuple_SET_ITEM( tmp_return_value, 0, tmp_tuple_element_1 ); tmp_tuple_element_1 = var_paste_xclip; CHECK_OBJECT( tmp_tuple_element_1 ); Py_INCREF( tmp_tuple_element_1 ); PyTuple_SET_ITEM( tmp_return_value, 1, tmp_tuple_element_1 ); goto try_return_handler_1; // tried codes exits in all cases NUITKA_CANNOT_GET_HERE( pyperclip$clipboards$$$function_4_init_xclip_clipboard ); return NULL; // Return handler code: try_return_handler_1:; CHECK_OBJECT( (PyObject *)var_copy_xclip ); Py_DECREF( var_copy_xclip ); var_copy_xclip = NULL; Py_XDECREF( var_paste_xclip ); var_paste_xclip = NULL; goto function_return_exit; // End of try: // Return statement must have exited already. NUITKA_CANNOT_GET_HERE( pyperclip$clipboards$$$function_4_init_xclip_clipboard ); return NULL; function_return_exit: CHECK_OBJECT( tmp_return_value ); assert( had_error || !ERROR_OCCURRED() ); return tmp_return_value; } static PyObject *impl_pyperclip$clipboards$$$function_4_init_xclip_clipboard$$$function_1_copy_xclip( struct Nuitka_FunctionObject const *self, PyObject **python_pars ) { // Preserve error status for checks #ifndef __NUITKA_NO_ASSERT__ NUITKA_MAY_BE_UNUSED bool had_error = ERROR_OCCURRED(); #endif // Local variable declarations. PyObject *par_text = python_pars[ 0 ]; PyObject *var_p = NULL; PyObject *exception_type = NULL; PyObject *exception_value = NULL; PyTracebackObject *exception_tb = NULL; NUITKA_MAY_BE_UNUSED int exception_lineno = 0; PyObject *exception_keeper_type_1; PyObject *exception_keeper_value_1; PyTracebackObject *exception_keeper_tb_1; NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_1; PyObject *tmp_args_name_1; PyObject *tmp_assign_source_1; PyObject *tmp_called_instance_1; PyObject *tmp_called_name_1; PyObject *tmp_called_name_2; PyObject *tmp_dict_key_1; PyObject *tmp_dict_key_2; PyObject *tmp_dict_key_3; PyObject *tmp_dict_value_1; PyObject *tmp_dict_value_2; PyObject *tmp_dict_value_3; PyObject *tmp_kw_name_1; PyObject *tmp_kw_name_2; int tmp_res; PyObject *tmp_return_value; PyObject *tmp_source_name_1; PyObject *tmp_source_name_2; PyObject *tmp_source_name_3; NUITKA_MAY_BE_UNUSED PyObject *tmp_unused; static struct Nuitka_FrameObject *cache_frame_87896ad4334adfc69f0daabfac3e30c6 = NULL; struct Nuitka_FrameObject *frame_87896ad4334adfc69f0daabfac3e30c6; NUITKA_MAY_BE_UNUSED char const *type_description_1 = NULL; tmp_return_value = NULL; // Actual function code. // Tried code: MAKE_OR_REUSE_FRAME( cache_frame_87896ad4334adfc69f0daabfac3e30c6, codeobj_87896ad4334adfc69f0daabfac3e30c6, module_pyperclip$clipboards, sizeof(void *)+sizeof(void *) ); frame_87896ad4334adfc69f0daabfac3e30c6 = cache_frame_87896ad4334adfc69f0daabfac3e30c6; // Push the new frame as the currently active one. pushFrameStack( frame_87896ad4334adfc69f0daabfac3e30c6 ); // Mark the frame object as in use, ref count 1 will be up for reuse. assert( Py_REFCNT( frame_87896ad4334adfc69f0daabfac3e30c6 ) == 2 ); // Frame stack // Framed code: tmp_source_name_1 = GET_STRING_DICT_VALUE( moduledict_pyperclip$clipboards, (Nuitka_StringObject *)const_str_plain_subprocess ); if (unlikely( tmp_source_name_1 == NULL )) { tmp_source_name_1 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_subprocess ); } if ( tmp_source_name_1 == NULL ) { exception_type = PyExc_NameError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "subprocess" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 66; type_description_1 = "oo"; goto frame_exception_exit_1; } tmp_called_name_1 = LOOKUP_ATTRIBUTE( tmp_source_name_1, const_str_plain_Popen ); if ( tmp_called_name_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 66; type_description_1 = "oo"; goto frame_exception_exit_1; } tmp_args_name_1 = DEEP_COPY( const_tuple_list_80c22030d7e9874daf8196134c6cac83_list_tuple ); tmp_kw_name_1 = _PyDict_NewPresized( 2 ); tmp_dict_key_1 = const_str_plain_stdin; tmp_source_name_2 = GET_STRING_DICT_VALUE( moduledict_pyperclip$clipboards, (Nuitka_StringObject *)const_str_plain_subprocess ); if (unlikely( tmp_source_name_2 == NULL )) { tmp_source_name_2 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_subprocess ); } if ( tmp_source_name_2 == NULL ) { Py_DECREF( tmp_called_name_1 ); Py_DECREF( tmp_args_name_1 ); Py_DECREF( tmp_kw_name_1 ); exception_type = PyExc_NameError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "subprocess" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 67; type_description_1 = "oo"; goto frame_exception_exit_1; } tmp_dict_value_1 = LOOKUP_ATTRIBUTE( tmp_source_name_2, const_str_plain_PIPE ); if ( tmp_dict_value_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); Py_DECREF( tmp_called_name_1 ); Py_DECREF( tmp_args_name_1 ); Py_DECREF( tmp_kw_name_1 ); exception_lineno = 67; type_description_1 = "oo"; goto frame_exception_exit_1; } tmp_res = PyDict_SetItem( tmp_kw_name_1, tmp_dict_key_1, tmp_dict_value_1 ); Py_DECREF( tmp_dict_value_1 ); assert( !(tmp_res != 0) ); tmp_dict_key_2 = const_str_plain_close_fds; tmp_dict_value_2 = Py_True; tmp_res = PyDict_SetItem( tmp_kw_name_1, tmp_dict_key_2, tmp_dict_value_2 ); assert( !(tmp_res != 0) ); frame_87896ad4334adfc69f0daabfac3e30c6->m_frame.f_lineno = 66; tmp_assign_source_1 = CALL_FUNCTION( tmp_called_name_1, tmp_args_name_1, tmp_kw_name_1 ); Py_DECREF( tmp_called_name_1 ); Py_DECREF( tmp_args_name_1 ); Py_DECREF( tmp_kw_name_1 ); if ( tmp_assign_source_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 66; type_description_1 = "oo"; goto frame_exception_exit_1; } assert( var_p == NULL ); var_p = tmp_assign_source_1; tmp_source_name_3 = var_p; CHECK_OBJECT( tmp_source_name_3 ); tmp_called_name_2 = LOOKUP_ATTRIBUTE( tmp_source_name_3, const_str_plain_communicate ); if ( tmp_called_name_2 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 68; type_description_1 = "oo"; goto frame_exception_exit_1; } tmp_kw_name_2 = _PyDict_NewPresized( 1 ); tmp_dict_key_3 = const_str_plain_input; tmp_called_instance_1 = par_text; if ( tmp_called_instance_1 == NULL ) { Py_DECREF( tmp_called_name_2 ); Py_DECREF( tmp_kw_name_2 ); exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "text" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 68; type_description_1 = "oo"; goto frame_exception_exit_1; } frame_87896ad4334adfc69f0daabfac3e30c6->m_frame.f_lineno = 68; tmp_dict_value_3 = CALL_METHOD_WITH_ARGS1( tmp_called_instance_1, const_str_plain_encode, &PyTuple_GET_ITEM( const_tuple_str_digest_c075052d723d6707083e869a0e3659bb_tuple, 0 ) ); if ( tmp_dict_value_3 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); Py_DECREF( tmp_called_name_2 ); Py_DECREF( tmp_kw_name_2 ); exception_lineno = 68; type_description_1 = "oo"; goto frame_exception_exit_1; } tmp_res = PyDict_SetItem( tmp_kw_name_2, tmp_dict_key_3, tmp_dict_value_3 ); Py_DECREF( tmp_dict_value_3 ); assert( !(tmp_res != 0) ); frame_87896ad4334adfc69f0daabfac3e30c6->m_frame.f_lineno = 68; tmp_unused = CALL_FUNCTION_WITH_KEYARGS( tmp_called_name_2, tmp_kw_name_2 ); Py_DECREF( tmp_called_name_2 ); Py_DECREF( tmp_kw_name_2 ); if ( tmp_unused == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 68; type_description_1 = "oo"; goto frame_exception_exit_1; } Py_DECREF( tmp_unused ); #if 0 RESTORE_FRAME_EXCEPTION( frame_87896ad4334adfc69f0daabfac3e30c6 ); #endif // Put the previous frame back on top. popFrameStack(); goto frame_no_exception_1; frame_exception_exit_1:; #if 0 RESTORE_FRAME_EXCEPTION( frame_87896ad4334adfc69f0daabfac3e30c6 ); #endif if ( exception_tb == NULL ) { exception_tb = MAKE_TRACEBACK( frame_87896ad4334adfc69f0daabfac3e30c6, exception_lineno ); } else if ( exception_tb->tb_frame != &frame_87896ad4334adfc69f0daabfac3e30c6->m_frame ) { exception_tb = ADD_TRACEBACK( exception_tb, frame_87896ad4334adfc69f0daabfac3e30c6, exception_lineno ); } // Attachs locals to frame if any. Nuitka_Frame_AttachLocals( (struct Nuitka_FrameObject *)frame_87896ad4334adfc69f0daabfac3e30c6, type_description_1, par_text, var_p ); // Release cached frame. if ( frame_87896ad4334adfc69f0daabfac3e30c6 == cache_frame_87896ad4334adfc69f0daabfac3e30c6 ) { Py_DECREF( frame_87896ad4334adfc69f0daabfac3e30c6 ); } cache_frame_87896ad4334adfc69f0daabfac3e30c6 = NULL; assertFrameObject( frame_87896ad4334adfc69f0daabfac3e30c6 ); // Put the previous frame back on top. popFrameStack(); // Return the error. goto try_except_handler_1; frame_no_exception_1:; tmp_return_value = Py_None; Py_INCREF( tmp_return_value ); goto try_return_handler_1; // tried codes exits in all cases NUITKA_CANNOT_GET_HERE( pyperclip$clipboards$$$function_4_init_xclip_clipboard$$$function_1_copy_xclip ); return NULL; // Return handler code: try_return_handler_1:; Py_XDECREF( par_text ); par_text = NULL; Py_XDECREF( var_p ); var_p = NULL; goto function_return_exit; // Exception handler code: try_except_handler_1:; exception_keeper_type_1 = exception_type; exception_keeper_value_1 = exception_value; exception_keeper_tb_1 = exception_tb; exception_keeper_lineno_1 = exception_lineno; exception_type = NULL; exception_value = NULL; exception_tb = NULL; exception_lineno = 0; Py_XDECREF( par_text ); par_text = NULL; Py_XDECREF( var_p ); var_p = NULL; // Re-raise. exception_type = exception_keeper_type_1; exception_value = exception_keeper_value_1; exception_tb = exception_keeper_tb_1; exception_lineno = exception_keeper_lineno_1; goto function_exception_exit; // End of try: // Return statement must have exited already. NUITKA_CANNOT_GET_HERE( pyperclip$clipboards$$$function_4_init_xclip_clipboard$$$function_1_copy_xclip ); return NULL; function_exception_exit: assert( exception_type ); RESTORE_ERROR_OCCURRED( exception_type, exception_value, exception_tb ); return NULL; function_return_exit: CHECK_OBJECT( tmp_return_value ); assert( had_error || !ERROR_OCCURRED() ); return tmp_return_value; } static PyObject *impl_pyperclip$clipboards$$$function_4_init_xclip_clipboard$$$function_2_paste_xclip( struct Nuitka_FunctionObject const *self, PyObject **python_pars ) { // Preserve error status for checks #ifndef __NUITKA_NO_ASSERT__ NUITKA_MAY_BE_UNUSED bool had_error = ERROR_OCCURRED(); #endif // Local variable declarations. PyObject *var_p = NULL; PyObject *var_stdout = NULL; PyObject *var_stderr = NULL; PyObject *tmp_tuple_unpack_1__element_1 = NULL; PyObject *tmp_tuple_unpack_1__element_2 = NULL; PyObject *tmp_tuple_unpack_1__source_iter = NULL; PyObject *exception_type = NULL; PyObject *exception_value = NULL; PyTracebackObject *exception_tb = NULL; NUITKA_MAY_BE_UNUSED int exception_lineno = 0; PyObject *exception_keeper_type_1; PyObject *exception_keeper_value_1; PyTracebackObject *exception_keeper_tb_1; NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_1; PyObject *exception_keeper_type_2; PyObject *exception_keeper_value_2; PyTracebackObject *exception_keeper_tb_2; NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_2; PyObject *exception_keeper_type_3; PyObject *exception_keeper_value_3; PyTracebackObject *exception_keeper_tb_3; NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_3; PyObject *tmp_args_name_1; PyObject *tmp_assign_source_1; PyObject *tmp_assign_source_2; PyObject *tmp_assign_source_3; PyObject *tmp_assign_source_4; PyObject *tmp_assign_source_5; PyObject *tmp_assign_source_6; PyObject *tmp_called_instance_1; PyObject *tmp_called_instance_2; PyObject *tmp_called_name_1; PyObject *tmp_dict_key_1; PyObject *tmp_dict_key_2; PyObject *tmp_dict_value_1; PyObject *tmp_dict_value_2; PyObject *tmp_iter_arg_1; PyObject *tmp_iterator_attempt; PyObject *tmp_iterator_name_1; PyObject *tmp_kw_name_1; int tmp_res; PyObject *tmp_return_value; PyObject *tmp_source_name_1; PyObject *tmp_source_name_2; PyObject *tmp_unpack_1; PyObject *tmp_unpack_2; static struct Nuitka_FrameObject *cache_frame_f950ff59b50650874131d45114feb4ed = NULL; struct Nuitka_FrameObject *frame_f950ff59b50650874131d45114feb4ed; NUITKA_MAY_BE_UNUSED char const *type_description_1 = NULL; tmp_return_value = NULL; // Actual function code. // Tried code: MAKE_OR_REUSE_FRAME( cache_frame_f950ff59b50650874131d45114feb4ed, codeobj_f950ff59b50650874131d45114feb4ed, module_pyperclip$clipboards, sizeof(void *)+sizeof(void *)+sizeof(void *) ); frame_f950ff59b50650874131d45114feb4ed = cache_frame_f950ff59b50650874131d45114feb4ed; // Push the new frame as the currently active one. pushFrameStack( frame_f950ff59b50650874131d45114feb4ed ); // Mark the frame object as in use, ref count 1 will be up for reuse. assert( Py_REFCNT( frame_f950ff59b50650874131d45114feb4ed ) == 2 ); // Frame stack // Framed code: tmp_source_name_1 = GET_STRING_DICT_VALUE( moduledict_pyperclip$clipboards, (Nuitka_StringObject *)const_str_plain_subprocess ); if (unlikely( tmp_source_name_1 == NULL )) { tmp_source_name_1 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_subprocess ); } if ( tmp_source_name_1 == NULL ) { exception_type = PyExc_NameError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "subprocess" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 71; type_description_1 = "ooo"; goto frame_exception_exit_1; } tmp_called_name_1 = LOOKUP_ATTRIBUTE( tmp_source_name_1, const_str_plain_Popen ); if ( tmp_called_name_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 71; type_description_1 = "ooo"; goto frame_exception_exit_1; } tmp_args_name_1 = DEEP_COPY( const_tuple_list_e4d6a0388a09ce944591175f0308d4e0_list_tuple ); tmp_kw_name_1 = _PyDict_NewPresized( 2 ); tmp_dict_key_1 = const_str_plain_stdout; tmp_source_name_2 = GET_STRING_DICT_VALUE( moduledict_pyperclip$clipboards, (Nuitka_StringObject *)const_str_plain_subprocess ); if (unlikely( tmp_source_name_2 == NULL )) { tmp_source_name_2 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_subprocess ); } if ( tmp_source_name_2 == NULL ) { Py_DECREF( tmp_called_name_1 ); Py_DECREF( tmp_args_name_1 ); Py_DECREF( tmp_kw_name_1 ); exception_type = PyExc_NameError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "subprocess" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 72; type_description_1 = "ooo"; goto frame_exception_exit_1; } tmp_dict_value_1 = LOOKUP_ATTRIBUTE( tmp_source_name_2, const_str_plain_PIPE ); if ( tmp_dict_value_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); Py_DECREF( tmp_called_name_1 ); Py_DECREF( tmp_args_name_1 ); Py_DECREF( tmp_kw_name_1 ); exception_lineno = 72; type_description_1 = "ooo"; goto frame_exception_exit_1; } tmp_res = PyDict_SetItem( tmp_kw_name_1, tmp_dict_key_1, tmp_dict_value_1 ); Py_DECREF( tmp_dict_value_1 ); assert( !(tmp_res != 0) ); tmp_dict_key_2 = const_str_plain_close_fds; tmp_dict_value_2 = Py_True; tmp_res = PyDict_SetItem( tmp_kw_name_1, tmp_dict_key_2, tmp_dict_value_2 ); assert( !(tmp_res != 0) ); frame_f950ff59b50650874131d45114feb4ed->m_frame.f_lineno = 71; tmp_assign_source_1 = CALL_FUNCTION( tmp_called_name_1, tmp_args_name_1, tmp_kw_name_1 ); Py_DECREF( tmp_called_name_1 ); Py_DECREF( tmp_args_name_1 ); Py_DECREF( tmp_kw_name_1 ); if ( tmp_assign_source_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 71; type_description_1 = "ooo"; goto frame_exception_exit_1; } assert( var_p == NULL ); var_p = tmp_assign_source_1; // Tried code: tmp_called_instance_1 = var_p; CHECK_OBJECT( tmp_called_instance_1 ); frame_f950ff59b50650874131d45114feb4ed->m_frame.f_lineno = 73; tmp_iter_arg_1 = CALL_METHOD_NO_ARGS( tmp_called_instance_1, const_str_plain_communicate ); if ( tmp_iter_arg_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 73; type_description_1 = "ooo"; goto try_except_handler_2; } tmp_assign_source_2 = MAKE_ITERATOR( tmp_iter_arg_1 ); Py_DECREF( tmp_iter_arg_1 ); if ( tmp_assign_source_2 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 73; type_description_1 = "ooo"; goto try_except_handler_2; } assert( tmp_tuple_unpack_1__source_iter == NULL ); tmp_tuple_unpack_1__source_iter = tmp_assign_source_2; // Tried code: tmp_unpack_1 = tmp_tuple_unpack_1__source_iter; CHECK_OBJECT( tmp_unpack_1 ); tmp_assign_source_3 = UNPACK_NEXT( tmp_unpack_1, 0, 2 ); if ( tmp_assign_source_3 == NULL ) { if ( !ERROR_OCCURRED() ) { exception_type = PyExc_StopIteration; Py_INCREF( exception_type ); exception_value = NULL; exception_tb = NULL; } else { FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); } type_description_1 = "ooo"; exception_lineno = 73; goto try_except_handler_3; } assert( tmp_tuple_unpack_1__element_1 == NULL ); tmp_tuple_unpack_1__element_1 = tmp_assign_source_3; tmp_unpack_2 = tmp_tuple_unpack_1__source_iter; CHECK_OBJECT( tmp_unpack_2 ); tmp_assign_source_4 = UNPACK_NEXT( tmp_unpack_2, 1, 2 ); if ( tmp_assign_source_4 == NULL ) { if ( !ERROR_OCCURRED() ) { exception_type = PyExc_StopIteration; Py_INCREF( exception_type ); exception_value = NULL; exception_tb = NULL; } else { FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); } type_description_1 = "ooo"; exception_lineno = 73; goto try_except_handler_3; } assert( tmp_tuple_unpack_1__element_2 == NULL ); tmp_tuple_unpack_1__element_2 = tmp_assign_source_4; tmp_iterator_name_1 = tmp_tuple_unpack_1__source_iter; CHECK_OBJECT( tmp_iterator_name_1 ); // Check if iterator has left-over elements. CHECK_OBJECT( tmp_iterator_name_1 ); assert( HAS_ITERNEXT( tmp_iterator_name_1 ) ); tmp_iterator_attempt = (*Py_TYPE( tmp_iterator_name_1 )->tp_iternext)( tmp_iterator_name_1 ); if (likely( tmp_iterator_attempt == NULL )) { PyObject *error = GET_ERROR_OCCURRED(); if ( error != NULL ) { if ( EXCEPTION_MATCH_BOOL_SINGLE( error, PyExc_StopIteration )) { CLEAR_ERROR_OCCURRED(); } else { FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); type_description_1 = "ooo"; exception_lineno = 73; goto try_except_handler_3; } } } else { Py_DECREF( tmp_iterator_attempt ); // TODO: Could avoid PyErr_Format. #if PYTHON_VERSION < 300 PyErr_Format( PyExc_ValueError, "too many values to unpack" ); #else PyErr_Format( PyExc_ValueError, "too many values to unpack (expected 2)" ); #endif FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); type_description_1 = "ooo"; exception_lineno = 73; goto try_except_handler_3; } goto try_end_1; // Exception handler code: try_except_handler_3:; exception_keeper_type_1 = exception_type; exception_keeper_value_1 = exception_value; exception_keeper_tb_1 = exception_tb; exception_keeper_lineno_1 = exception_lineno; exception_type = NULL; exception_value = NULL; exception_tb = NULL; exception_lineno = 0; Py_XDECREF( tmp_tuple_unpack_1__source_iter ); tmp_tuple_unpack_1__source_iter = NULL; // Re-raise. exception_type = exception_keeper_type_1; exception_value = exception_keeper_value_1; exception_tb = exception_keeper_tb_1; exception_lineno = exception_keeper_lineno_1; goto try_except_handler_2; // End of try: try_end_1:; goto try_end_2; // Exception handler code: try_except_handler_2:; exception_keeper_type_2 = exception_type; exception_keeper_value_2 = exception_value; exception_keeper_tb_2 = exception_tb; exception_keeper_lineno_2 = exception_lineno; exception_type = NULL; exception_value = NULL; exception_tb = NULL; exception_lineno = 0; Py_XDECREF( tmp_tuple_unpack_1__element_1 ); tmp_tuple_unpack_1__element_1 = NULL; Py_XDECREF( tmp_tuple_unpack_1__element_2 ); tmp_tuple_unpack_1__element_2 = NULL; // Re-raise. exception_type = exception_keeper_type_2; exception_value = exception_keeper_value_2; exception_tb = exception_keeper_tb_2; exception_lineno = exception_keeper_lineno_2; goto frame_exception_exit_1; // End of try: try_end_2:; Py_XDECREF( tmp_tuple_unpack_1__source_iter ); tmp_tuple_unpack_1__source_iter = NULL; tmp_assign_source_5 = tmp_tuple_unpack_1__element_1; CHECK_OBJECT( tmp_assign_source_5 ); assert( var_stdout == NULL ); Py_INCREF( tmp_assign_source_5 ); var_stdout = tmp_assign_source_5; Py_XDECREF( tmp_tuple_unpack_1__element_1 ); tmp_tuple_unpack_1__element_1 = NULL; tmp_assign_source_6 = tmp_tuple_unpack_1__element_2; CHECK_OBJECT( tmp_assign_source_6 ); assert( var_stderr == NULL ); Py_INCREF( tmp_assign_source_6 ); var_stderr = tmp_assign_source_6; Py_XDECREF( tmp_tuple_unpack_1__element_2 ); tmp_tuple_unpack_1__element_2 = NULL; Py_XDECREF( tmp_tuple_unpack_1__element_1 ); tmp_tuple_unpack_1__element_1 = NULL; Py_XDECREF( tmp_tuple_unpack_1__element_2 ); tmp_tuple_unpack_1__element_2 = NULL; tmp_called_instance_2 = var_stdout; if ( tmp_called_instance_2 == NULL ) { exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "stdout" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 74; type_description_1 = "ooo"; goto frame_exception_exit_1; } frame_f950ff59b50650874131d45114feb4ed->m_frame.f_lineno = 74; tmp_return_value = CALL_METHOD_WITH_ARGS1( tmp_called_instance_2, const_str_plain_decode, &PyTuple_GET_ITEM( const_tuple_str_digest_c075052d723d6707083e869a0e3659bb_tuple, 0 ) ); if ( tmp_return_value == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 74; type_description_1 = "ooo"; goto frame_exception_exit_1; } goto frame_return_exit_1; #if 0 RESTORE_FRAME_EXCEPTION( frame_f950ff59b50650874131d45114feb4ed ); #endif // Put the previous frame back on top. popFrameStack(); goto frame_no_exception_1; frame_return_exit_1:; #if 0 RESTORE_FRAME_EXCEPTION( frame_f950ff59b50650874131d45114feb4ed ); #endif // Put the previous frame back on top. popFrameStack(); goto try_return_handler_1; frame_exception_exit_1:; #if 0 RESTORE_FRAME_EXCEPTION( frame_f950ff59b50650874131d45114feb4ed ); #endif if ( exception_tb == NULL ) { exception_tb = MAKE_TRACEBACK( frame_f950ff59b50650874131d45114feb4ed, exception_lineno ); } else if ( exception_tb->tb_frame != &frame_f950ff59b50650874131d45114feb4ed->m_frame ) { exception_tb = ADD_TRACEBACK( exception_tb, frame_f950ff59b50650874131d45114feb4ed, exception_lineno ); } // Attachs locals to frame if any. Nuitka_Frame_AttachLocals( (struct Nuitka_FrameObject *)frame_f950ff59b50650874131d45114feb4ed, type_description_1, var_p, var_stdout, var_stderr ); // Release cached frame. if ( frame_f950ff59b50650874131d45114feb4ed == cache_frame_f950ff59b50650874131d45114feb4ed ) { Py_DECREF( frame_f950ff59b50650874131d45114feb4ed ); } cache_frame_f950ff59b50650874131d45114feb4ed = NULL; assertFrameObject( frame_f950ff59b50650874131d45114feb4ed ); // Put the previous frame back on top. popFrameStack(); // Return the error. goto try_except_handler_1; frame_no_exception_1:; // tried codes exits in all cases NUITKA_CANNOT_GET_HERE( pyperclip$clipboards$$$function_4_init_xclip_clipboard$$$function_2_paste_xclip ); return NULL; // Return handler code: try_return_handler_1:; Py_XDECREF( var_p ); var_p = NULL; Py_XDECREF( var_stdout ); var_stdout = NULL; Py_XDECREF( var_stderr ); var_stderr = NULL; goto function_return_exit; // Exception handler code: try_except_handler_1:; exception_keeper_type_3 = exception_type; exception_keeper_value_3 = exception_value; exception_keeper_tb_3 = exception_tb; exception_keeper_lineno_3 = exception_lineno; exception_type = NULL; exception_value = NULL; exception_tb = NULL; exception_lineno = 0; Py_XDECREF( var_p ); var_p = NULL; Py_XDECREF( var_stdout ); var_stdout = NULL; Py_XDECREF( var_stderr ); var_stderr = NULL; // Re-raise. exception_type = exception_keeper_type_3; exception_value = exception_keeper_value_3; exception_tb = exception_keeper_tb_3; exception_lineno = exception_keeper_lineno_3; goto function_exception_exit; // End of try: // Return statement must have exited already. NUITKA_CANNOT_GET_HERE( pyperclip$clipboards$$$function_4_init_xclip_clipboard$$$function_2_paste_xclip ); return NULL; function_exception_exit: assert( exception_type ); RESTORE_ERROR_OCCURRED( exception_type, exception_value, exception_tb ); return NULL; function_return_exit: CHECK_OBJECT( tmp_return_value ); assert( had_error || !ERROR_OCCURRED() ); return tmp_return_value; } static PyObject *impl_pyperclip$clipboards$$$function_5_init_xsel_clipboard( struct Nuitka_FunctionObject const *self, PyObject **python_pars ) { // Preserve error status for checks #ifndef __NUITKA_NO_ASSERT__ NUITKA_MAY_BE_UNUSED bool had_error = ERROR_OCCURRED(); #endif // Local variable declarations. PyObject *var_copy_xsel = NULL; PyObject *var_paste_xsel = NULL; PyObject *tmp_assign_source_1; PyObject *tmp_assign_source_2; PyObject *tmp_return_value; PyObject *tmp_tuple_element_1; tmp_return_value = NULL; // Actual function code. tmp_assign_source_1 = MAKE_FUNCTION_pyperclip$clipboards$$$function_5_init_xsel_clipboard$$$function_1_copy_xsel( ); assert( var_copy_xsel == NULL ); var_copy_xsel = tmp_assign_source_1; tmp_assign_source_2 = MAKE_FUNCTION_pyperclip$clipboards$$$function_5_init_xsel_clipboard$$$function_2_paste_xsel( ); assert( var_paste_xsel == NULL ); var_paste_xsel = tmp_assign_source_2; // Tried code: tmp_return_value = PyTuple_New( 2 ); tmp_tuple_element_1 = var_copy_xsel; CHECK_OBJECT( tmp_tuple_element_1 ); Py_INCREF( tmp_tuple_element_1 ); PyTuple_SET_ITEM( tmp_return_value, 0, tmp_tuple_element_1 ); tmp_tuple_element_1 = var_paste_xsel; CHECK_OBJECT( tmp_tuple_element_1 ); Py_INCREF( tmp_tuple_element_1 ); PyTuple_SET_ITEM( tmp_return_value, 1, tmp_tuple_element_1 ); goto try_return_handler_1; // tried codes exits in all cases NUITKA_CANNOT_GET_HERE( pyperclip$clipboards$$$function_5_init_xsel_clipboard ); return NULL; // Return handler code: try_return_handler_1:; CHECK_OBJECT( (PyObject *)var_copy_xsel ); Py_DECREF( var_copy_xsel ); var_copy_xsel = NULL; Py_XDECREF( var_paste_xsel ); var_paste_xsel = NULL; goto function_return_exit; // End of try: // Return statement must have exited already. NUITKA_CANNOT_GET_HERE( pyperclip$clipboards$$$function_5_init_xsel_clipboard ); return NULL; function_return_exit: CHECK_OBJECT( tmp_return_value ); assert( had_error || !ERROR_OCCURRED() ); return tmp_return_value; } static PyObject *impl_pyperclip$clipboards$$$function_5_init_xsel_clipboard$$$function_1_copy_xsel( struct Nuitka_FunctionObject const *self, PyObject **python_pars ) { // Preserve error status for checks #ifndef __NUITKA_NO_ASSERT__ NUITKA_MAY_BE_UNUSED bool had_error = ERROR_OCCURRED(); #endif // Local variable declarations. PyObject *par_text = python_pars[ 0 ]; PyObject *var_p = NULL; PyObject *exception_type = NULL; PyObject *exception_value = NULL; PyTracebackObject *exception_tb = NULL; NUITKA_MAY_BE_UNUSED int exception_lineno = 0; PyObject *exception_keeper_type_1; PyObject *exception_keeper_value_1; PyTracebackObject *exception_keeper_tb_1; NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_1; PyObject *tmp_args_name_1; PyObject *tmp_assign_source_1; PyObject *tmp_called_instance_1; PyObject *tmp_called_name_1; PyObject *tmp_called_name_2; PyObject *tmp_dict_key_1; PyObject *tmp_dict_key_2; PyObject *tmp_dict_key_3; PyObject *tmp_dict_value_1; PyObject *tmp_dict_value_2; PyObject *tmp_dict_value_3; PyObject *tmp_kw_name_1; PyObject *tmp_kw_name_2; int tmp_res; PyObject *tmp_return_value; PyObject *tmp_source_name_1; PyObject *tmp_source_name_2; PyObject *tmp_source_name_3; NUITKA_MAY_BE_UNUSED PyObject *tmp_unused; static struct Nuitka_FrameObject *cache_frame_b0f3bfc3d3d61adca3747b3845cc6ff6 = NULL; struct Nuitka_FrameObject *frame_b0f3bfc3d3d61adca3747b3845cc6ff6; NUITKA_MAY_BE_UNUSED char const *type_description_1 = NULL; tmp_return_value = NULL; // Actual function code. // Tried code: MAKE_OR_REUSE_FRAME( cache_frame_b0f3bfc3d3d61adca3747b3845cc6ff6, codeobj_b0f3bfc3d3d61adca3747b3845cc6ff6, module_pyperclip$clipboards, sizeof(void *)+sizeof(void *) ); frame_b0f3bfc3d3d61adca3747b3845cc6ff6 = cache_frame_b0f3bfc3d3d61adca3747b3845cc6ff6; // Push the new frame as the currently active one. pushFrameStack( frame_b0f3bfc3d3d61adca3747b3845cc6ff6 ); // Mark the frame object as in use, ref count 1 will be up for reuse. assert( Py_REFCNT( frame_b0f3bfc3d3d61adca3747b3845cc6ff6 ) == 2 ); // Frame stack // Framed code: tmp_source_name_1 = GET_STRING_DICT_VALUE( moduledict_pyperclip$clipboards, (Nuitka_StringObject *)const_str_plain_subprocess ); if (unlikely( tmp_source_name_1 == NULL )) { tmp_source_name_1 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_subprocess ); } if ( tmp_source_name_1 == NULL ) { exception_type = PyExc_NameError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "subprocess" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 81; type_description_1 = "oo"; goto frame_exception_exit_1; } tmp_called_name_1 = LOOKUP_ATTRIBUTE( tmp_source_name_1, const_str_plain_Popen ); if ( tmp_called_name_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 81; type_description_1 = "oo"; goto frame_exception_exit_1; } tmp_args_name_1 = DEEP_COPY( const_tuple_list_a197c19226e81914eb0e409d9a9b699d_list_tuple ); tmp_kw_name_1 = _PyDict_NewPresized( 2 ); tmp_dict_key_1 = const_str_plain_stdin; tmp_source_name_2 = GET_STRING_DICT_VALUE( moduledict_pyperclip$clipboards, (Nuitka_StringObject *)const_str_plain_subprocess ); if (unlikely( tmp_source_name_2 == NULL )) { tmp_source_name_2 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_subprocess ); } if ( tmp_source_name_2 == NULL ) { Py_DECREF( tmp_called_name_1 ); Py_DECREF( tmp_args_name_1 ); Py_DECREF( tmp_kw_name_1 ); exception_type = PyExc_NameError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "subprocess" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 82; type_description_1 = "oo"; goto frame_exception_exit_1; } tmp_dict_value_1 = LOOKUP_ATTRIBUTE( tmp_source_name_2, const_str_plain_PIPE ); if ( tmp_dict_value_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); Py_DECREF( tmp_called_name_1 ); Py_DECREF( tmp_args_name_1 ); Py_DECREF( tmp_kw_name_1 ); exception_lineno = 82; type_description_1 = "oo"; goto frame_exception_exit_1; } tmp_res = PyDict_SetItem( tmp_kw_name_1, tmp_dict_key_1, tmp_dict_value_1 ); Py_DECREF( tmp_dict_value_1 ); assert( !(tmp_res != 0) ); tmp_dict_key_2 = const_str_plain_close_fds; tmp_dict_value_2 = Py_True; tmp_res = PyDict_SetItem( tmp_kw_name_1, tmp_dict_key_2, tmp_dict_value_2 ); assert( !(tmp_res != 0) ); frame_b0f3bfc3d3d61adca3747b3845cc6ff6->m_frame.f_lineno = 81; tmp_assign_source_1 = CALL_FUNCTION( tmp_called_name_1, tmp_args_name_1, tmp_kw_name_1 ); Py_DECREF( tmp_called_name_1 ); Py_DECREF( tmp_args_name_1 ); Py_DECREF( tmp_kw_name_1 ); if ( tmp_assign_source_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 81; type_description_1 = "oo"; goto frame_exception_exit_1; } assert( var_p == NULL ); var_p = tmp_assign_source_1; tmp_source_name_3 = var_p; CHECK_OBJECT( tmp_source_name_3 ); tmp_called_name_2 = LOOKUP_ATTRIBUTE( tmp_source_name_3, const_str_plain_communicate ); if ( tmp_called_name_2 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 83; type_description_1 = "oo"; goto frame_exception_exit_1; } tmp_kw_name_2 = _PyDict_NewPresized( 1 ); tmp_dict_key_3 = const_str_plain_input; tmp_called_instance_1 = par_text; if ( tmp_called_instance_1 == NULL ) { Py_DECREF( tmp_called_name_2 ); Py_DECREF( tmp_kw_name_2 ); exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "text" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 83; type_description_1 = "oo"; goto frame_exception_exit_1; } frame_b0f3bfc3d3d61adca3747b3845cc6ff6->m_frame.f_lineno = 83; tmp_dict_value_3 = CALL_METHOD_WITH_ARGS1( tmp_called_instance_1, const_str_plain_encode, &PyTuple_GET_ITEM( const_tuple_str_digest_c075052d723d6707083e869a0e3659bb_tuple, 0 ) ); if ( tmp_dict_value_3 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); Py_DECREF( tmp_called_name_2 ); Py_DECREF( tmp_kw_name_2 ); exception_lineno = 83; type_description_1 = "oo"; goto frame_exception_exit_1; } tmp_res = PyDict_SetItem( tmp_kw_name_2, tmp_dict_key_3, tmp_dict_value_3 ); Py_DECREF( tmp_dict_value_3 ); assert( !(tmp_res != 0) ); frame_b0f3bfc3d3d61adca3747b3845cc6ff6->m_frame.f_lineno = 83; tmp_unused = CALL_FUNCTION_WITH_KEYARGS( tmp_called_name_2, tmp_kw_name_2 ); Py_DECREF( tmp_called_name_2 ); Py_DECREF( tmp_kw_name_2 ); if ( tmp_unused == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 83; type_description_1 = "oo"; goto frame_exception_exit_1; } Py_DECREF( tmp_unused ); #if 0 RESTORE_FRAME_EXCEPTION( frame_b0f3bfc3d3d61adca3747b3845cc6ff6 ); #endif // Put the previous frame back on top. popFrameStack(); goto frame_no_exception_1; frame_exception_exit_1:; #if 0 RESTORE_FRAME_EXCEPTION( frame_b0f3bfc3d3d61adca3747b3845cc6ff6 ); #endif if ( exception_tb == NULL ) { exception_tb = MAKE_TRACEBACK( frame_b0f3bfc3d3d61adca3747b3845cc6ff6, exception_lineno ); } else if ( exception_tb->tb_frame != &frame_b0f3bfc3d3d61adca3747b3845cc6ff6->m_frame ) { exception_tb = ADD_TRACEBACK( exception_tb, frame_b0f3bfc3d3d61adca3747b3845cc6ff6, exception_lineno ); } // Attachs locals to frame if any. Nuitka_Frame_AttachLocals( (struct Nuitka_FrameObject *)frame_b0f3bfc3d3d61adca3747b3845cc6ff6, type_description_1, par_text, var_p ); // Release cached frame. if ( frame_b0f3bfc3d3d61adca3747b3845cc6ff6 == cache_frame_b0f3bfc3d3d61adca3747b3845cc6ff6 ) { Py_DECREF( frame_b0f3bfc3d3d61adca3747b3845cc6ff6 ); } cache_frame_b0f3bfc3d3d61adca3747b3845cc6ff6 = NULL; assertFrameObject( frame_b0f3bfc3d3d61adca3747b3845cc6ff6 ); // Put the previous frame back on top. popFrameStack(); // Return the error. goto try_except_handler_1; frame_no_exception_1:; tmp_return_value = Py_None; Py_INCREF( tmp_return_value ); goto try_return_handler_1; // tried codes exits in all cases NUITKA_CANNOT_GET_HERE( pyperclip$clipboards$$$function_5_init_xsel_clipboard$$$function_1_copy_xsel ); return NULL; // Return handler code: try_return_handler_1:; Py_XDECREF( par_text ); par_text = NULL; Py_XDECREF( var_p ); var_p = NULL; goto function_return_exit; // Exception handler code: try_except_handler_1:; exception_keeper_type_1 = exception_type; exception_keeper_value_1 = exception_value; exception_keeper_tb_1 = exception_tb; exception_keeper_lineno_1 = exception_lineno; exception_type = NULL; exception_value = NULL; exception_tb = NULL; exception_lineno = 0; Py_XDECREF( par_text ); par_text = NULL; Py_XDECREF( var_p ); var_p = NULL; // Re-raise. exception_type = exception_keeper_type_1; exception_value = exception_keeper_value_1; exception_tb = exception_keeper_tb_1; exception_lineno = exception_keeper_lineno_1; goto function_exception_exit; // End of try: // Return statement must have exited already. NUITKA_CANNOT_GET_HERE( pyperclip$clipboards$$$function_5_init_xsel_clipboard$$$function_1_copy_xsel ); return NULL; function_exception_exit: assert( exception_type ); RESTORE_ERROR_OCCURRED( exception_type, exception_value, exception_tb ); return NULL; function_return_exit: CHECK_OBJECT( tmp_return_value ); assert( had_error || !ERROR_OCCURRED() ); return tmp_return_value; } static PyObject *impl_pyperclip$clipboards$$$function_5_init_xsel_clipboard$$$function_2_paste_xsel( struct Nuitka_FunctionObject const *self, PyObject **python_pars ) { // Preserve error status for checks #ifndef __NUITKA_NO_ASSERT__ NUITKA_MAY_BE_UNUSED bool had_error = ERROR_OCCURRED(); #endif // Local variable declarations. PyObject *var_p = NULL; PyObject *var_stdout = NULL; PyObject *var_stderr = NULL; PyObject *tmp_tuple_unpack_1__element_1 = NULL; PyObject *tmp_tuple_unpack_1__element_2 = NULL; PyObject *tmp_tuple_unpack_1__source_iter = NULL; PyObject *exception_type = NULL; PyObject *exception_value = NULL; PyTracebackObject *exception_tb = NULL; NUITKA_MAY_BE_UNUSED int exception_lineno = 0; PyObject *exception_keeper_type_1; PyObject *exception_keeper_value_1; PyTracebackObject *exception_keeper_tb_1; NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_1; PyObject *exception_keeper_type_2; PyObject *exception_keeper_value_2; PyTracebackObject *exception_keeper_tb_2; NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_2; PyObject *exception_keeper_type_3; PyObject *exception_keeper_value_3; PyTracebackObject *exception_keeper_tb_3; NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_3; PyObject *tmp_args_name_1; PyObject *tmp_assign_source_1; PyObject *tmp_assign_source_2; PyObject *tmp_assign_source_3; PyObject *tmp_assign_source_4; PyObject *tmp_assign_source_5; PyObject *tmp_assign_source_6; PyObject *tmp_called_instance_1; PyObject *tmp_called_instance_2; PyObject *tmp_called_name_1; PyObject *tmp_dict_key_1; PyObject *tmp_dict_key_2; PyObject *tmp_dict_value_1; PyObject *tmp_dict_value_2; PyObject *tmp_iter_arg_1; PyObject *tmp_iterator_attempt; PyObject *tmp_iterator_name_1; PyObject *tmp_kw_name_1; int tmp_res; PyObject *tmp_return_value; PyObject *tmp_source_name_1; PyObject *tmp_source_name_2; PyObject *tmp_unpack_1; PyObject *tmp_unpack_2; static struct Nuitka_FrameObject *cache_frame_ea0d5a0280e03dec96cb094dc6e0c388 = NULL; struct Nuitka_FrameObject *frame_ea0d5a0280e03dec96cb094dc6e0c388; NUITKA_MAY_BE_UNUSED char const *type_description_1 = NULL; tmp_return_value = NULL; // Actual function code. // Tried code: MAKE_OR_REUSE_FRAME( cache_frame_ea0d5a0280e03dec96cb094dc6e0c388, codeobj_ea0d5a0280e03dec96cb094dc6e0c388, module_pyperclip$clipboards, sizeof(void *)+sizeof(void *)+sizeof(void *) ); frame_ea0d5a0280e03dec96cb094dc6e0c388 = cache_frame_ea0d5a0280e03dec96cb094dc6e0c388; // Push the new frame as the currently active one. pushFrameStack( frame_ea0d5a0280e03dec96cb094dc6e0c388 ); // Mark the frame object as in use, ref count 1 will be up for reuse. assert( Py_REFCNT( frame_ea0d5a0280e03dec96cb094dc6e0c388 ) == 2 ); // Frame stack // Framed code: tmp_source_name_1 = GET_STRING_DICT_VALUE( moduledict_pyperclip$clipboards, (Nuitka_StringObject *)const_str_plain_subprocess ); if (unlikely( tmp_source_name_1 == NULL )) { tmp_source_name_1 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_subprocess ); } if ( tmp_source_name_1 == NULL ) { exception_type = PyExc_NameError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "subprocess" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 86; type_description_1 = "ooo"; goto frame_exception_exit_1; } tmp_called_name_1 = LOOKUP_ATTRIBUTE( tmp_source_name_1, const_str_plain_Popen ); if ( tmp_called_name_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 86; type_description_1 = "ooo"; goto frame_exception_exit_1; } tmp_args_name_1 = DEEP_COPY( const_tuple_list_67e309ba5d5eed8090523ac1cf863d7d_list_tuple ); tmp_kw_name_1 = _PyDict_NewPresized( 2 ); tmp_dict_key_1 = const_str_plain_stdout; tmp_source_name_2 = GET_STRING_DICT_VALUE( moduledict_pyperclip$clipboards, (Nuitka_StringObject *)const_str_plain_subprocess ); if (unlikely( tmp_source_name_2 == NULL )) { tmp_source_name_2 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_subprocess ); } if ( tmp_source_name_2 == NULL ) { Py_DECREF( tmp_called_name_1 ); Py_DECREF( tmp_args_name_1 ); Py_DECREF( tmp_kw_name_1 ); exception_type = PyExc_NameError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "subprocess" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 87; type_description_1 = "ooo"; goto frame_exception_exit_1; } tmp_dict_value_1 = LOOKUP_ATTRIBUTE( tmp_source_name_2, const_str_plain_PIPE ); if ( tmp_dict_value_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); Py_DECREF( tmp_called_name_1 ); Py_DECREF( tmp_args_name_1 ); Py_DECREF( tmp_kw_name_1 ); exception_lineno = 87; type_description_1 = "ooo"; goto frame_exception_exit_1; } tmp_res = PyDict_SetItem( tmp_kw_name_1, tmp_dict_key_1, tmp_dict_value_1 ); Py_DECREF( tmp_dict_value_1 ); assert( !(tmp_res != 0) ); tmp_dict_key_2 = const_str_plain_close_fds; tmp_dict_value_2 = Py_True; tmp_res = PyDict_SetItem( tmp_kw_name_1, tmp_dict_key_2, tmp_dict_value_2 ); assert( !(tmp_res != 0) ); frame_ea0d5a0280e03dec96cb094dc6e0c388->m_frame.f_lineno = 86; tmp_assign_source_1 = CALL_FUNCTION( tmp_called_name_1, tmp_args_name_1, tmp_kw_name_1 ); Py_DECREF( tmp_called_name_1 ); Py_DECREF( tmp_args_name_1 ); Py_DECREF( tmp_kw_name_1 ); if ( tmp_assign_source_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 86; type_description_1 = "ooo"; goto frame_exception_exit_1; } assert( var_p == NULL ); var_p = tmp_assign_source_1; // Tried code: tmp_called_instance_1 = var_p; CHECK_OBJECT( tmp_called_instance_1 ); frame_ea0d5a0280e03dec96cb094dc6e0c388->m_frame.f_lineno = 88; tmp_iter_arg_1 = CALL_METHOD_NO_ARGS( tmp_called_instance_1, const_str_plain_communicate ); if ( tmp_iter_arg_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 88; type_description_1 = "ooo"; goto try_except_handler_2; } tmp_assign_source_2 = MAKE_ITERATOR( tmp_iter_arg_1 ); Py_DECREF( tmp_iter_arg_1 ); if ( tmp_assign_source_2 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 88; type_description_1 = "ooo"; goto try_except_handler_2; } assert( tmp_tuple_unpack_1__source_iter == NULL ); tmp_tuple_unpack_1__source_iter = tmp_assign_source_2; // Tried code: tmp_unpack_1 = tmp_tuple_unpack_1__source_iter; CHECK_OBJECT( tmp_unpack_1 ); tmp_assign_source_3 = UNPACK_NEXT( tmp_unpack_1, 0, 2 ); if ( tmp_assign_source_3 == NULL ) { if ( !ERROR_OCCURRED() ) { exception_type = PyExc_StopIteration; Py_INCREF( exception_type ); exception_value = NULL; exception_tb = NULL; } else { FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); } type_description_1 = "ooo"; exception_lineno = 88; goto try_except_handler_3; } assert( tmp_tuple_unpack_1__element_1 == NULL ); tmp_tuple_unpack_1__element_1 = tmp_assign_source_3; tmp_unpack_2 = tmp_tuple_unpack_1__source_iter; CHECK_OBJECT( tmp_unpack_2 ); tmp_assign_source_4 = UNPACK_NEXT( tmp_unpack_2, 1, 2 ); if ( tmp_assign_source_4 == NULL ) { if ( !ERROR_OCCURRED() ) { exception_type = PyExc_StopIteration; Py_INCREF( exception_type ); exception_value = NULL; exception_tb = NULL; } else { FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); } type_description_1 = "ooo"; exception_lineno = 88; goto try_except_handler_3; } assert( tmp_tuple_unpack_1__element_2 == NULL ); tmp_tuple_unpack_1__element_2 = tmp_assign_source_4; tmp_iterator_name_1 = tmp_tuple_unpack_1__source_iter; CHECK_OBJECT( tmp_iterator_name_1 ); // Check if iterator has left-over elements. CHECK_OBJECT( tmp_iterator_name_1 ); assert( HAS_ITERNEXT( tmp_iterator_name_1 ) ); tmp_iterator_attempt = (*Py_TYPE( tmp_iterator_name_1 )->tp_iternext)( tmp_iterator_name_1 ); if (likely( tmp_iterator_attempt == NULL )) { PyObject *error = GET_ERROR_OCCURRED(); if ( error != NULL ) { if ( EXCEPTION_MATCH_BOOL_SINGLE( error, PyExc_StopIteration )) { CLEAR_ERROR_OCCURRED(); } else { FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); type_description_1 = "ooo"; exception_lineno = 88; goto try_except_handler_3; } } } else { Py_DECREF( tmp_iterator_attempt ); // TODO: Could avoid PyErr_Format. #if PYTHON_VERSION < 300 PyErr_Format( PyExc_ValueError, "too many values to unpack" ); #else PyErr_Format( PyExc_ValueError, "too many values to unpack (expected 2)" ); #endif FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); type_description_1 = "ooo"; exception_lineno = 88; goto try_except_handler_3; } goto try_end_1; // Exception handler code: try_except_handler_3:; exception_keeper_type_1 = exception_type; exception_keeper_value_1 = exception_value; exception_keeper_tb_1 = exception_tb; exception_keeper_lineno_1 = exception_lineno; exception_type = NULL; exception_value = NULL; exception_tb = NULL; exception_lineno = 0; Py_XDECREF( tmp_tuple_unpack_1__source_iter ); tmp_tuple_unpack_1__source_iter = NULL; // Re-raise. exception_type = exception_keeper_type_1; exception_value = exception_keeper_value_1; exception_tb = exception_keeper_tb_1; exception_lineno = exception_keeper_lineno_1; goto try_except_handler_2; // End of try: try_end_1:; goto try_end_2; // Exception handler code: try_except_handler_2:; exception_keeper_type_2 = exception_type; exception_keeper_value_2 = exception_value; exception_keeper_tb_2 = exception_tb; exception_keeper_lineno_2 = exception_lineno; exception_type = NULL; exception_value = NULL; exception_tb = NULL; exception_lineno = 0; Py_XDECREF( tmp_tuple_unpack_1__element_1 ); tmp_tuple_unpack_1__element_1 = NULL; Py_XDECREF( tmp_tuple_unpack_1__element_2 ); tmp_tuple_unpack_1__element_2 = NULL; // Re-raise. exception_type = exception_keeper_type_2; exception_value = exception_keeper_value_2; exception_tb = exception_keeper_tb_2; exception_lineno = exception_keeper_lineno_2; goto frame_exception_exit_1; // End of try: try_end_2:; Py_XDECREF( tmp_tuple_unpack_1__source_iter ); tmp_tuple_unpack_1__source_iter = NULL; tmp_assign_source_5 = tmp_tuple_unpack_1__element_1; CHECK_OBJECT( tmp_assign_source_5 ); assert( var_stdout == NULL ); Py_INCREF( tmp_assign_source_5 ); var_stdout = tmp_assign_source_5; Py_XDECREF( tmp_tuple_unpack_1__element_1 ); tmp_tuple_unpack_1__element_1 = NULL; tmp_assign_source_6 = tmp_tuple_unpack_1__element_2; CHECK_OBJECT( tmp_assign_source_6 ); assert( var_stderr == NULL ); Py_INCREF( tmp_assign_source_6 ); var_stderr = tmp_assign_source_6; Py_XDECREF( tmp_tuple_unpack_1__element_2 ); tmp_tuple_unpack_1__element_2 = NULL; Py_XDECREF( tmp_tuple_unpack_1__element_1 ); tmp_tuple_unpack_1__element_1 = NULL; Py_XDECREF( tmp_tuple_unpack_1__element_2 ); tmp_tuple_unpack_1__element_2 = NULL; tmp_called_instance_2 = var_stdout; if ( tmp_called_instance_2 == NULL ) { exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "stdout" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 89; type_description_1 = "ooo"; goto frame_exception_exit_1; } frame_ea0d5a0280e03dec96cb094dc6e0c388->m_frame.f_lineno = 89; tmp_return_value = CALL_METHOD_WITH_ARGS1( tmp_called_instance_2, const_str_plain_decode, &PyTuple_GET_ITEM( const_tuple_str_digest_c075052d723d6707083e869a0e3659bb_tuple, 0 ) ); if ( tmp_return_value == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 89; type_description_1 = "ooo"; goto frame_exception_exit_1; } goto frame_return_exit_1; #if 0 RESTORE_FRAME_EXCEPTION( frame_ea0d5a0280e03dec96cb094dc6e0c388 ); #endif // Put the previous frame back on top. popFrameStack(); goto frame_no_exception_1; frame_return_exit_1:; #if 0 RESTORE_FRAME_EXCEPTION( frame_ea0d5a0280e03dec96cb094dc6e0c388 ); #endif // Put the previous frame back on top. popFrameStack(); goto try_return_handler_1; frame_exception_exit_1:; #if 0 RESTORE_FRAME_EXCEPTION( frame_ea0d5a0280e03dec96cb094dc6e0c388 ); #endif if ( exception_tb == NULL ) { exception_tb = MAKE_TRACEBACK( frame_ea0d5a0280e03dec96cb094dc6e0c388, exception_lineno ); } else if ( exception_tb->tb_frame != &frame_ea0d5a0280e03dec96cb094dc6e0c388->m_frame ) { exception_tb = ADD_TRACEBACK( exception_tb, frame_ea0d5a0280e03dec96cb094dc6e0c388, exception_lineno ); } // Attachs locals to frame if any. Nuitka_Frame_AttachLocals( (struct Nuitka_FrameObject *)frame_ea0d5a0280e03dec96cb094dc6e0c388, type_description_1, var_p, var_stdout, var_stderr ); // Release cached frame. if ( frame_ea0d5a0280e03dec96cb094dc6e0c388 == cache_frame_ea0d5a0280e03dec96cb094dc6e0c388 ) { Py_DECREF( frame_ea0d5a0280e03dec96cb094dc6e0c388 ); } cache_frame_ea0d5a0280e03dec96cb094dc6e0c388 = NULL; assertFrameObject( frame_ea0d5a0280e03dec96cb094dc6e0c388 ); // Put the previous frame back on top. popFrameStack(); // Return the error. goto try_except_handler_1; frame_no_exception_1:; // tried codes exits in all cases NUITKA_CANNOT_GET_HERE( pyperclip$clipboards$$$function_5_init_xsel_clipboard$$$function_2_paste_xsel ); return NULL; // Return handler code: try_return_handler_1:; Py_XDECREF( var_p ); var_p = NULL; Py_XDECREF( var_stdout ); var_stdout = NULL; Py_XDECREF( var_stderr ); var_stderr = NULL; goto function_return_exit; // Exception handler code: try_except_handler_1:; exception_keeper_type_3 = exception_type; exception_keeper_value_3 = exception_value; exception_keeper_tb_3 = exception_tb; exception_keeper_lineno_3 = exception_lineno; exception_type = NULL; exception_value = NULL; exception_tb = NULL; exception_lineno = 0; Py_XDECREF( var_p ); var_p = NULL; Py_XDECREF( var_stdout ); var_stdout = NULL; Py_XDECREF( var_stderr ); var_stderr = NULL; // Re-raise. exception_type = exception_keeper_type_3; exception_value = exception_keeper_value_3; exception_tb = exception_keeper_tb_3; exception_lineno = exception_keeper_lineno_3; goto function_exception_exit; // End of try: // Return statement must have exited already. NUITKA_CANNOT_GET_HERE( pyperclip$clipboards$$$function_5_init_xsel_clipboard$$$function_2_paste_xsel ); return NULL; function_exception_exit: assert( exception_type ); RESTORE_ERROR_OCCURRED( exception_type, exception_value, exception_tb ); return NULL; function_return_exit: CHECK_OBJECT( tmp_return_value ); assert( had_error || !ERROR_OCCURRED() ); return tmp_return_value; } static PyObject *impl_pyperclip$clipboards$$$function_6_init_klipper_clipboard( struct Nuitka_FunctionObject const *self, PyObject **python_pars ) { // Preserve error status for checks #ifndef __NUITKA_NO_ASSERT__ NUITKA_MAY_BE_UNUSED bool had_error = ERROR_OCCURRED(); #endif // Local variable declarations. PyObject *var_copy_klipper = NULL; PyObject *var_paste_klipper = NULL; PyObject *tmp_assign_source_1; PyObject *tmp_assign_source_2; PyObject *tmp_return_value; PyObject *tmp_tuple_element_1; tmp_return_value = NULL; // Actual function code. tmp_assign_source_1 = MAKE_FUNCTION_pyperclip$clipboards$$$function_6_init_klipper_clipboard$$$function_1_copy_klipper( ); assert( var_copy_klipper == NULL ); var_copy_klipper = tmp_assign_source_1; tmp_assign_source_2 = MAKE_FUNCTION_pyperclip$clipboards$$$function_6_init_klipper_clipboard$$$function_2_paste_klipper( ); assert( var_paste_klipper == NULL ); var_paste_klipper = tmp_assign_source_2; // Tried code: tmp_return_value = PyTuple_New( 2 ); tmp_tuple_element_1 = var_copy_klipper; CHECK_OBJECT( tmp_tuple_element_1 ); Py_INCREF( tmp_tuple_element_1 ); PyTuple_SET_ITEM( tmp_return_value, 0, tmp_tuple_element_1 ); tmp_tuple_element_1 = var_paste_klipper; CHECK_OBJECT( tmp_tuple_element_1 ); Py_INCREF( tmp_tuple_element_1 ); PyTuple_SET_ITEM( tmp_return_value, 1, tmp_tuple_element_1 ); goto try_return_handler_1; // tried codes exits in all cases NUITKA_CANNOT_GET_HERE( pyperclip$clipboards$$$function_6_init_klipper_clipboard ); return NULL; // Return handler code: try_return_handler_1:; CHECK_OBJECT( (PyObject *)var_copy_klipper ); Py_DECREF( var_copy_klipper ); var_copy_klipper = NULL; Py_XDECREF( var_paste_klipper ); var_paste_klipper = NULL; goto function_return_exit; // End of try: // Return statement must have exited already. NUITKA_CANNOT_GET_HERE( pyperclip$clipboards$$$function_6_init_klipper_clipboard ); return NULL; function_return_exit: CHECK_OBJECT( tmp_return_value ); assert( had_error || !ERROR_OCCURRED() ); return tmp_return_value; } static PyObject *impl_pyperclip$clipboards$$$function_6_init_klipper_clipboard$$$function_1_copy_klipper( struct Nuitka_FunctionObject const *self, PyObject **python_pars ) { // Preserve error status for checks #ifndef __NUITKA_NO_ASSERT__ NUITKA_MAY_BE_UNUSED bool had_error = ERROR_OCCURRED(); #endif // Local variable declarations. PyObject *par_text = python_pars[ 0 ]; PyObject *var_p = NULL; PyObject *exception_type = NULL; PyObject *exception_value = NULL; PyTracebackObject *exception_tb = NULL; NUITKA_MAY_BE_UNUSED int exception_lineno = 0; PyObject *exception_keeper_type_1; PyObject *exception_keeper_value_1; PyTracebackObject *exception_keeper_tb_1; NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_1; PyObject *tmp_args_name_1; PyObject *tmp_assign_source_1; PyObject *tmp_called_instance_1; PyObject *tmp_called_name_1; PyObject *tmp_called_name_2; PyObject *tmp_dict_key_1; PyObject *tmp_dict_key_2; PyObject *tmp_dict_value_1; PyObject *tmp_dict_value_2; PyObject *tmp_kw_name_1; PyObject *tmp_kw_name_2; PyObject *tmp_list_element_1; int tmp_res; PyObject *tmp_return_value; PyObject *tmp_source_name_1; PyObject *tmp_source_name_2; PyObject *tmp_source_name_3; PyObject *tmp_tuple_element_1; NUITKA_MAY_BE_UNUSED PyObject *tmp_unused; static struct Nuitka_FrameObject *cache_frame_bb325fb2ba607198bce74bc146ecfdfa = NULL; struct Nuitka_FrameObject *frame_bb325fb2ba607198bce74bc146ecfdfa; NUITKA_MAY_BE_UNUSED char const *type_description_1 = NULL; tmp_return_value = NULL; // Actual function code. // Tried code: MAKE_OR_REUSE_FRAME( cache_frame_bb325fb2ba607198bce74bc146ecfdfa, codeobj_bb325fb2ba607198bce74bc146ecfdfa, module_pyperclip$clipboards, sizeof(void *)+sizeof(void *) ); frame_bb325fb2ba607198bce74bc146ecfdfa = cache_frame_bb325fb2ba607198bce74bc146ecfdfa; // Push the new frame as the currently active one. pushFrameStack( frame_bb325fb2ba607198bce74bc146ecfdfa ); // Mark the frame object as in use, ref count 1 will be up for reuse. assert( Py_REFCNT( frame_bb325fb2ba607198bce74bc146ecfdfa ) == 2 ); // Frame stack // Framed code: tmp_source_name_1 = GET_STRING_DICT_VALUE( moduledict_pyperclip$clipboards, (Nuitka_StringObject *)const_str_plain_subprocess ); if (unlikely( tmp_source_name_1 == NULL )) { tmp_source_name_1 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_subprocess ); } if ( tmp_source_name_1 == NULL ) { exception_type = PyExc_NameError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "subprocess" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 96; type_description_1 = "oo"; goto frame_exception_exit_1; } tmp_called_name_1 = LOOKUP_ATTRIBUTE( tmp_source_name_1, const_str_plain_Popen ); if ( tmp_called_name_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 96; type_description_1 = "oo"; goto frame_exception_exit_1; } tmp_args_name_1 = PyTuple_New( 1 ); tmp_tuple_element_1 = PyList_New( 5 ); tmp_list_element_1 = const_str_plain_qdbus; Py_INCREF( tmp_list_element_1 ); PyList_SET_ITEM( tmp_tuple_element_1, 0, tmp_list_element_1 ); tmp_list_element_1 = const_str_digest_57a50efac3dc6f8b8afc68b347b3c8cd; Py_INCREF( tmp_list_element_1 ); PyList_SET_ITEM( tmp_tuple_element_1, 1, tmp_list_element_1 ); tmp_list_element_1 = const_str_digest_5bfd7f32b3b59128ef50a98dbb13a245; Py_INCREF( tmp_list_element_1 ); PyList_SET_ITEM( tmp_tuple_element_1, 2, tmp_list_element_1 ); tmp_list_element_1 = const_str_plain_setClipboardContents; Py_INCREF( tmp_list_element_1 ); PyList_SET_ITEM( tmp_tuple_element_1, 3, tmp_list_element_1 ); tmp_called_instance_1 = par_text; if ( tmp_called_instance_1 == NULL ) { Py_DECREF( tmp_called_name_1 ); Py_DECREF( tmp_args_name_1 ); Py_DECREF( tmp_tuple_element_1 ); exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "text" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 98; type_description_1 = "oo"; goto frame_exception_exit_1; } frame_bb325fb2ba607198bce74bc146ecfdfa->m_frame.f_lineno = 98; tmp_list_element_1 = CALL_METHOD_WITH_ARGS1( tmp_called_instance_1, const_str_plain_encode, &PyTuple_GET_ITEM( const_tuple_str_digest_c075052d723d6707083e869a0e3659bb_tuple, 0 ) ); if ( tmp_list_element_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); Py_DECREF( tmp_called_name_1 ); Py_DECREF( tmp_args_name_1 ); Py_DECREF( tmp_tuple_element_1 ); exception_lineno = 98; type_description_1 = "oo"; goto frame_exception_exit_1; } PyList_SET_ITEM( tmp_tuple_element_1, 4, tmp_list_element_1 ); PyTuple_SET_ITEM( tmp_args_name_1, 0, tmp_tuple_element_1 ); tmp_kw_name_1 = _PyDict_NewPresized( 2 ); tmp_dict_key_1 = const_str_plain_stdin; tmp_source_name_2 = GET_STRING_DICT_VALUE( moduledict_pyperclip$clipboards, (Nuitka_StringObject *)const_str_plain_subprocess ); if (unlikely( tmp_source_name_2 == NULL )) { tmp_source_name_2 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_subprocess ); } if ( tmp_source_name_2 == NULL ) { Py_DECREF( tmp_called_name_1 ); Py_DECREF( tmp_args_name_1 ); Py_DECREF( tmp_kw_name_1 ); exception_type = PyExc_NameError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "subprocess" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 99; type_description_1 = "oo"; goto frame_exception_exit_1; } tmp_dict_value_1 = LOOKUP_ATTRIBUTE( tmp_source_name_2, const_str_plain_PIPE ); if ( tmp_dict_value_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); Py_DECREF( tmp_called_name_1 ); Py_DECREF( tmp_args_name_1 ); Py_DECREF( tmp_kw_name_1 ); exception_lineno = 99; type_description_1 = "oo"; goto frame_exception_exit_1; } tmp_res = PyDict_SetItem( tmp_kw_name_1, tmp_dict_key_1, tmp_dict_value_1 ); Py_DECREF( tmp_dict_value_1 ); assert( !(tmp_res != 0) ); tmp_dict_key_2 = const_str_plain_close_fds; tmp_dict_value_2 = Py_True; tmp_res = PyDict_SetItem( tmp_kw_name_1, tmp_dict_key_2, tmp_dict_value_2 ); assert( !(tmp_res != 0) ); frame_bb325fb2ba607198bce74bc146ecfdfa->m_frame.f_lineno = 96; tmp_assign_source_1 = CALL_FUNCTION( tmp_called_name_1, tmp_args_name_1, tmp_kw_name_1 ); Py_DECREF( tmp_called_name_1 ); Py_DECREF( tmp_args_name_1 ); Py_DECREF( tmp_kw_name_1 ); if ( tmp_assign_source_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 96; type_description_1 = "oo"; goto frame_exception_exit_1; } assert( var_p == NULL ); var_p = tmp_assign_source_1; tmp_source_name_3 = var_p; CHECK_OBJECT( tmp_source_name_3 ); tmp_called_name_2 = LOOKUP_ATTRIBUTE( tmp_source_name_3, const_str_plain_communicate ); if ( tmp_called_name_2 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 100; type_description_1 = "oo"; goto frame_exception_exit_1; } tmp_kw_name_2 = PyDict_Copy( const_dict_c453dda1d3901e4cb85d5781f8962504 ); frame_bb325fb2ba607198bce74bc146ecfdfa->m_frame.f_lineno = 100; tmp_unused = CALL_FUNCTION_WITH_KEYARGS( tmp_called_name_2, tmp_kw_name_2 ); Py_DECREF( tmp_called_name_2 ); Py_DECREF( tmp_kw_name_2 ); if ( tmp_unused == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 100; type_description_1 = "oo"; goto frame_exception_exit_1; } Py_DECREF( tmp_unused ); #if 0 RESTORE_FRAME_EXCEPTION( frame_bb325fb2ba607198bce74bc146ecfdfa ); #endif // Put the previous frame back on top. popFrameStack(); goto frame_no_exception_1; frame_exception_exit_1:; #if 0 RESTORE_FRAME_EXCEPTION( frame_bb325fb2ba607198bce74bc146ecfdfa ); #endif if ( exception_tb == NULL ) { exception_tb = MAKE_TRACEBACK( frame_bb325fb2ba607198bce74bc146ecfdfa, exception_lineno ); } else if ( exception_tb->tb_frame != &frame_bb325fb2ba607198bce74bc146ecfdfa->m_frame ) { exception_tb = ADD_TRACEBACK( exception_tb, frame_bb325fb2ba607198bce74bc146ecfdfa, exception_lineno ); } // Attachs locals to frame if any. Nuitka_Frame_AttachLocals( (struct Nuitka_FrameObject *)frame_bb325fb2ba607198bce74bc146ecfdfa, type_description_1, par_text, var_p ); // Release cached frame. if ( frame_bb325fb2ba607198bce74bc146ecfdfa == cache_frame_bb325fb2ba607198bce74bc146ecfdfa ) { Py_DECREF( frame_bb325fb2ba607198bce74bc146ecfdfa ); } cache_frame_bb325fb2ba607198bce74bc146ecfdfa = NULL; assertFrameObject( frame_bb325fb2ba607198bce74bc146ecfdfa ); // Put the previous frame back on top. popFrameStack(); // Return the error. goto try_except_handler_1; frame_no_exception_1:; tmp_return_value = Py_None; Py_INCREF( tmp_return_value ); goto try_return_handler_1; // tried codes exits in all cases NUITKA_CANNOT_GET_HERE( pyperclip$clipboards$$$function_6_init_klipper_clipboard$$$function_1_copy_klipper ); return NULL; // Return handler code: try_return_handler_1:; Py_XDECREF( par_text ); par_text = NULL; Py_XDECREF( var_p ); var_p = NULL; goto function_return_exit; // Exception handler code: try_except_handler_1:; exception_keeper_type_1 = exception_type; exception_keeper_value_1 = exception_value; exception_keeper_tb_1 = exception_tb; exception_keeper_lineno_1 = exception_lineno; exception_type = NULL; exception_value = NULL; exception_tb = NULL; exception_lineno = 0; Py_XDECREF( par_text ); par_text = NULL; Py_XDECREF( var_p ); var_p = NULL; // Re-raise. exception_type = exception_keeper_type_1; exception_value = exception_keeper_value_1; exception_tb = exception_keeper_tb_1; exception_lineno = exception_keeper_lineno_1; goto function_exception_exit; // End of try: // Return statement must have exited already. NUITKA_CANNOT_GET_HERE( pyperclip$clipboards$$$function_6_init_klipper_clipboard$$$function_1_copy_klipper ); return NULL; function_exception_exit: assert( exception_type ); RESTORE_ERROR_OCCURRED( exception_type, exception_value, exception_tb ); return NULL; function_return_exit: CHECK_OBJECT( tmp_return_value ); assert( had_error || !ERROR_OCCURRED() ); return tmp_return_value; } static PyObject *impl_pyperclip$clipboards$$$function_6_init_klipper_clipboard$$$function_2_paste_klipper( struct Nuitka_FunctionObject const *self, PyObject **python_pars ) { // Preserve error status for checks #ifndef __NUITKA_NO_ASSERT__ NUITKA_MAY_BE_UNUSED bool had_error = ERROR_OCCURRED(); #endif // Local variable declarations. PyObject *var_p = NULL; PyObject *var_stdout = NULL; PyObject *var_stderr = NULL; PyObject *var_clipboardContents = NULL; PyObject *tmp_tuple_unpack_1__element_1 = NULL; PyObject *tmp_tuple_unpack_1__element_2 = NULL; PyObject *tmp_tuple_unpack_1__source_iter = NULL; PyObject *exception_type = NULL; PyObject *exception_value = NULL; PyTracebackObject *exception_tb = NULL; NUITKA_MAY_BE_UNUSED int exception_lineno = 0; PyObject *exception_keeper_type_1; PyObject *exception_keeper_value_1; PyTracebackObject *exception_keeper_tb_1; NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_1; PyObject *exception_keeper_type_2; PyObject *exception_keeper_value_2; PyTracebackObject *exception_keeper_tb_2; NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_2; PyObject *exception_keeper_type_3; PyObject *exception_keeper_value_3; PyTracebackObject *exception_keeper_tb_3; NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_3; PyObject *tmp_args_name_1; PyObject *tmp_assign_source_1; PyObject *tmp_assign_source_2; PyObject *tmp_assign_source_3; PyObject *tmp_assign_source_4; PyObject *tmp_assign_source_5; PyObject *tmp_assign_source_6; PyObject *tmp_assign_source_7; PyObject *tmp_assign_source_8; PyObject *tmp_called_instance_1; PyObject *tmp_called_instance_2; PyObject *tmp_called_instance_3; PyObject *tmp_called_instance_4; PyObject *tmp_called_name_1; int tmp_cmp_Gt_1; PyObject *tmp_compare_left_1; PyObject *tmp_compare_right_1; int tmp_cond_truth_1; int tmp_cond_truth_2; PyObject *tmp_cond_value_1; PyObject *tmp_cond_value_2; PyObject *tmp_dict_key_1; PyObject *tmp_dict_key_2; PyObject *tmp_dict_value_1; PyObject *tmp_dict_value_2; PyObject *tmp_iter_arg_1; PyObject *tmp_iterator_attempt; PyObject *tmp_iterator_name_1; PyObject *tmp_kw_name_1; PyObject *tmp_len_arg_1; PyObject *tmp_raise_type_1; PyObject *tmp_raise_type_2; int tmp_res; PyObject *tmp_return_value; PyObject *tmp_source_name_1; PyObject *tmp_source_name_2; PyObject *tmp_subscribed_name_1; PyObject *tmp_subscript_name_1; PyObject *tmp_unpack_1; PyObject *tmp_unpack_2; static struct Nuitka_FrameObject *cache_frame_99270ef4c1c45db5d9ad06ee758619b6 = NULL; struct Nuitka_FrameObject *frame_99270ef4c1c45db5d9ad06ee758619b6; NUITKA_MAY_BE_UNUSED char const *type_description_1 = NULL; tmp_return_value = NULL; // Actual function code. // Tried code: MAKE_OR_REUSE_FRAME( cache_frame_99270ef4c1c45db5d9ad06ee758619b6, codeobj_99270ef4c1c45db5d9ad06ee758619b6, module_pyperclip$clipboards, sizeof(void *)+sizeof(void *)+sizeof(void *)+sizeof(void *) ); frame_99270ef4c1c45db5d9ad06ee758619b6 = cache_frame_99270ef4c1c45db5d9ad06ee758619b6; // Push the new frame as the currently active one. pushFrameStack( frame_99270ef4c1c45db5d9ad06ee758619b6 ); // Mark the frame object as in use, ref count 1 will be up for reuse. assert( Py_REFCNT( frame_99270ef4c1c45db5d9ad06ee758619b6 ) == 2 ); // Frame stack // Framed code: tmp_source_name_1 = GET_STRING_DICT_VALUE( moduledict_pyperclip$clipboards, (Nuitka_StringObject *)const_str_plain_subprocess ); if (unlikely( tmp_source_name_1 == NULL )) { tmp_source_name_1 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_subprocess ); } if ( tmp_source_name_1 == NULL ) { exception_type = PyExc_NameError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "subprocess" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 103; type_description_1 = "oooo"; goto frame_exception_exit_1; } tmp_called_name_1 = LOOKUP_ATTRIBUTE( tmp_source_name_1, const_str_plain_Popen ); if ( tmp_called_name_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 103; type_description_1 = "oooo"; goto frame_exception_exit_1; } tmp_args_name_1 = DEEP_COPY( const_tuple_list_71826f1b3786fb88c225418f225b3823_list_tuple ); tmp_kw_name_1 = _PyDict_NewPresized( 2 ); tmp_dict_key_1 = const_str_plain_stdout; tmp_source_name_2 = GET_STRING_DICT_VALUE( moduledict_pyperclip$clipboards, (Nuitka_StringObject *)const_str_plain_subprocess ); if (unlikely( tmp_source_name_2 == NULL )) { tmp_source_name_2 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_subprocess ); } if ( tmp_source_name_2 == NULL ) { Py_DECREF( tmp_called_name_1 ); Py_DECREF( tmp_args_name_1 ); Py_DECREF( tmp_kw_name_1 ); exception_type = PyExc_NameError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "subprocess" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 105; type_description_1 = "oooo"; goto frame_exception_exit_1; } tmp_dict_value_1 = LOOKUP_ATTRIBUTE( tmp_source_name_2, const_str_plain_PIPE ); if ( tmp_dict_value_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); Py_DECREF( tmp_called_name_1 ); Py_DECREF( tmp_args_name_1 ); Py_DECREF( tmp_kw_name_1 ); exception_lineno = 105; type_description_1 = "oooo"; goto frame_exception_exit_1; } tmp_res = PyDict_SetItem( tmp_kw_name_1, tmp_dict_key_1, tmp_dict_value_1 ); Py_DECREF( tmp_dict_value_1 ); assert( !(tmp_res != 0) ); tmp_dict_key_2 = const_str_plain_close_fds; tmp_dict_value_2 = Py_True; tmp_res = PyDict_SetItem( tmp_kw_name_1, tmp_dict_key_2, tmp_dict_value_2 ); assert( !(tmp_res != 0) ); frame_99270ef4c1c45db5d9ad06ee758619b6->m_frame.f_lineno = 103; tmp_assign_source_1 = CALL_FUNCTION( tmp_called_name_1, tmp_args_name_1, tmp_kw_name_1 ); Py_DECREF( tmp_called_name_1 ); Py_DECREF( tmp_args_name_1 ); Py_DECREF( tmp_kw_name_1 ); if ( tmp_assign_source_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 103; type_description_1 = "oooo"; goto frame_exception_exit_1; } assert( var_p == NULL ); var_p = tmp_assign_source_1; // Tried code: tmp_called_instance_1 = var_p; CHECK_OBJECT( tmp_called_instance_1 ); frame_99270ef4c1c45db5d9ad06ee758619b6->m_frame.f_lineno = 106; tmp_iter_arg_1 = CALL_METHOD_NO_ARGS( tmp_called_instance_1, const_str_plain_communicate ); if ( tmp_iter_arg_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 106; type_description_1 = "oooo"; goto try_except_handler_2; } tmp_assign_source_2 = MAKE_ITERATOR( tmp_iter_arg_1 ); Py_DECREF( tmp_iter_arg_1 ); if ( tmp_assign_source_2 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 106; type_description_1 = "oooo"; goto try_except_handler_2; } assert( tmp_tuple_unpack_1__source_iter == NULL ); tmp_tuple_unpack_1__source_iter = tmp_assign_source_2; // Tried code: tmp_unpack_1 = tmp_tuple_unpack_1__source_iter; CHECK_OBJECT( tmp_unpack_1 ); tmp_assign_source_3 = UNPACK_NEXT( tmp_unpack_1, 0, 2 ); if ( tmp_assign_source_3 == NULL ) { if ( !ERROR_OCCURRED() ) { exception_type = PyExc_StopIteration; Py_INCREF( exception_type ); exception_value = NULL; exception_tb = NULL; } else { FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); } type_description_1 = "oooo"; exception_lineno = 106; goto try_except_handler_3; } assert( tmp_tuple_unpack_1__element_1 == NULL ); tmp_tuple_unpack_1__element_1 = tmp_assign_source_3; tmp_unpack_2 = tmp_tuple_unpack_1__source_iter; CHECK_OBJECT( tmp_unpack_2 ); tmp_assign_source_4 = UNPACK_NEXT( tmp_unpack_2, 1, 2 ); if ( tmp_assign_source_4 == NULL ) { if ( !ERROR_OCCURRED() ) { exception_type = PyExc_StopIteration; Py_INCREF( exception_type ); exception_value = NULL; exception_tb = NULL; } else { FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); } type_description_1 = "oooo"; exception_lineno = 106; goto try_except_handler_3; } assert( tmp_tuple_unpack_1__element_2 == NULL ); tmp_tuple_unpack_1__element_2 = tmp_assign_source_4; tmp_iterator_name_1 = tmp_tuple_unpack_1__source_iter; CHECK_OBJECT( tmp_iterator_name_1 ); // Check if iterator has left-over elements. CHECK_OBJECT( tmp_iterator_name_1 ); assert( HAS_ITERNEXT( tmp_iterator_name_1 ) ); tmp_iterator_attempt = (*Py_TYPE( tmp_iterator_name_1 )->tp_iternext)( tmp_iterator_name_1 ); if (likely( tmp_iterator_attempt == NULL )) { PyObject *error = GET_ERROR_OCCURRED(); if ( error != NULL ) { if ( EXCEPTION_MATCH_BOOL_SINGLE( error, PyExc_StopIteration )) { CLEAR_ERROR_OCCURRED(); } else { FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); type_description_1 = "oooo"; exception_lineno = 106; goto try_except_handler_3; } } } else { Py_DECREF( tmp_iterator_attempt ); // TODO: Could avoid PyErr_Format. #if PYTHON_VERSION < 300 PyErr_Format( PyExc_ValueError, "too many values to unpack" ); #else PyErr_Format( PyExc_ValueError, "too many values to unpack (expected 2)" ); #endif FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); type_description_1 = "oooo"; exception_lineno = 106; goto try_except_handler_3; } goto try_end_1; // Exception handler code: try_except_handler_3:; exception_keeper_type_1 = exception_type; exception_keeper_value_1 = exception_value; exception_keeper_tb_1 = exception_tb; exception_keeper_lineno_1 = exception_lineno; exception_type = NULL; exception_value = NULL; exception_tb = NULL; exception_lineno = 0; Py_XDECREF( tmp_tuple_unpack_1__source_iter ); tmp_tuple_unpack_1__source_iter = NULL; // Re-raise. exception_type = exception_keeper_type_1; exception_value = exception_keeper_value_1; exception_tb = exception_keeper_tb_1; exception_lineno = exception_keeper_lineno_1; goto try_except_handler_2; // End of try: try_end_1:; goto try_end_2; // Exception handler code: try_except_handler_2:; exception_keeper_type_2 = exception_type; exception_keeper_value_2 = exception_value; exception_keeper_tb_2 = exception_tb; exception_keeper_lineno_2 = exception_lineno; exception_type = NULL; exception_value = NULL; exception_tb = NULL; exception_lineno = 0; Py_XDECREF( tmp_tuple_unpack_1__element_1 ); tmp_tuple_unpack_1__element_1 = NULL; Py_XDECREF( tmp_tuple_unpack_1__element_2 ); tmp_tuple_unpack_1__element_2 = NULL; // Re-raise. exception_type = exception_keeper_type_2; exception_value = exception_keeper_value_2; exception_tb = exception_keeper_tb_2; exception_lineno = exception_keeper_lineno_2; goto frame_exception_exit_1; // End of try: try_end_2:; Py_XDECREF( tmp_tuple_unpack_1__source_iter ); tmp_tuple_unpack_1__source_iter = NULL; tmp_assign_source_5 = tmp_tuple_unpack_1__element_1; CHECK_OBJECT( tmp_assign_source_5 ); assert( var_stdout == NULL ); Py_INCREF( tmp_assign_source_5 ); var_stdout = tmp_assign_source_5; Py_XDECREF( tmp_tuple_unpack_1__element_1 ); tmp_tuple_unpack_1__element_1 = NULL; tmp_assign_source_6 = tmp_tuple_unpack_1__element_2; CHECK_OBJECT( tmp_assign_source_6 ); assert( var_stderr == NULL ); Py_INCREF( tmp_assign_source_6 ); var_stderr = tmp_assign_source_6; Py_XDECREF( tmp_tuple_unpack_1__element_2 ); tmp_tuple_unpack_1__element_2 = NULL; Py_XDECREF( tmp_tuple_unpack_1__element_1 ); tmp_tuple_unpack_1__element_1 = NULL; Py_XDECREF( tmp_tuple_unpack_1__element_2 ); tmp_tuple_unpack_1__element_2 = NULL; tmp_called_instance_2 = var_stdout; if ( tmp_called_instance_2 == NULL ) { exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "stdout" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 110; type_description_1 = "oooo"; goto frame_exception_exit_1; } frame_99270ef4c1c45db5d9ad06ee758619b6->m_frame.f_lineno = 110; tmp_assign_source_7 = CALL_METHOD_WITH_ARGS1( tmp_called_instance_2, const_str_plain_decode, &PyTuple_GET_ITEM( const_tuple_str_digest_c075052d723d6707083e869a0e3659bb_tuple, 0 ) ); if ( tmp_assign_source_7 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 110; type_description_1 = "oooo"; goto frame_exception_exit_1; } assert( var_clipboardContents == NULL ); var_clipboardContents = tmp_assign_source_7; tmp_len_arg_1 = var_clipboardContents; CHECK_OBJECT( tmp_len_arg_1 ); tmp_compare_left_1 = BUILTIN_LEN( tmp_len_arg_1 ); if ( tmp_compare_left_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 112; type_description_1 = "oooo"; goto frame_exception_exit_1; } tmp_compare_right_1 = const_int_0; tmp_cmp_Gt_1 = RICH_COMPARE_BOOL_GT( tmp_compare_left_1, tmp_compare_right_1 ); if ( tmp_cmp_Gt_1 == -1 ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); Py_DECREF( tmp_compare_left_1 ); exception_lineno = 112; type_description_1 = "oooo"; goto frame_exception_exit_1; } Py_DECREF( tmp_compare_left_1 ); if ( tmp_cmp_Gt_1 == 1 ) { goto branch_no_1; } else { goto branch_yes_1; } branch_yes_1:; tmp_raise_type_1 = PyExc_AssertionError; exception_type = tmp_raise_type_1; Py_INCREF( tmp_raise_type_1 ); exception_lineno = 112; RAISE_EXCEPTION_WITH_TYPE( &exception_type, &exception_value, &exception_tb ); type_description_1 = "oooo"; goto frame_exception_exit_1; branch_no_1:; tmp_called_instance_3 = var_clipboardContents; if ( tmp_called_instance_3 == NULL ) { exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "clipboardContents" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 114; type_description_1 = "oooo"; goto frame_exception_exit_1; } frame_99270ef4c1c45db5d9ad06ee758619b6->m_frame.f_lineno = 114; tmp_cond_value_1 = CALL_METHOD_WITH_ARGS1( tmp_called_instance_3, const_str_plain_endswith, &PyTuple_GET_ITEM( const_tuple_str_newline_tuple, 0 ) ); if ( tmp_cond_value_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 114; type_description_1 = "oooo"; goto frame_exception_exit_1; } tmp_cond_truth_1 = CHECK_IF_TRUE( tmp_cond_value_1 ); if ( tmp_cond_truth_1 == -1 ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); Py_DECREF( tmp_cond_value_1 ); exception_lineno = 114; type_description_1 = "oooo"; goto frame_exception_exit_1; } Py_DECREF( tmp_cond_value_1 ); if ( tmp_cond_truth_1 == 1 ) { goto branch_no_2; } else { goto branch_yes_2; } branch_yes_2:; tmp_raise_type_2 = PyExc_AssertionError; exception_type = tmp_raise_type_2; Py_INCREF( tmp_raise_type_2 ); exception_lineno = 114; RAISE_EXCEPTION_WITH_TYPE( &exception_type, &exception_value, &exception_tb ); type_description_1 = "oooo"; goto frame_exception_exit_1; branch_no_2:; tmp_called_instance_4 = var_clipboardContents; if ( tmp_called_instance_4 == NULL ) { exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "clipboardContents" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 115; type_description_1 = "oooo"; goto frame_exception_exit_1; } frame_99270ef4c1c45db5d9ad06ee758619b6->m_frame.f_lineno = 115; tmp_cond_value_2 = CALL_METHOD_WITH_ARGS1( tmp_called_instance_4, const_str_plain_endswith, &PyTuple_GET_ITEM( const_tuple_str_newline_tuple, 0 ) ); if ( tmp_cond_value_2 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 115; type_description_1 = "oooo"; goto frame_exception_exit_1; } tmp_cond_truth_2 = CHECK_IF_TRUE( tmp_cond_value_2 ); if ( tmp_cond_truth_2 == -1 ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); Py_DECREF( tmp_cond_value_2 ); exception_lineno = 115; type_description_1 = "oooo"; goto frame_exception_exit_1; } Py_DECREF( tmp_cond_value_2 ); if ( tmp_cond_truth_2 == 1 ) { goto branch_yes_3; } else { goto branch_no_3; } branch_yes_3:; tmp_subscribed_name_1 = var_clipboardContents; if ( tmp_subscribed_name_1 == NULL ) { exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "clipboardContents" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 116; type_description_1 = "oooo"; goto frame_exception_exit_1; } tmp_subscript_name_1 = const_slice_none_int_neg_1_none; tmp_assign_source_8 = LOOKUP_SUBSCRIPT( tmp_subscribed_name_1, tmp_subscript_name_1 ); if ( tmp_assign_source_8 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 116; type_description_1 = "oooo"; goto frame_exception_exit_1; } { PyObject *old = var_clipboardContents; var_clipboardContents = tmp_assign_source_8; Py_XDECREF( old ); } branch_no_3:; tmp_return_value = var_clipboardContents; if ( tmp_return_value == NULL ) { exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "clipboardContents" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 117; type_description_1 = "oooo"; goto frame_exception_exit_1; } Py_INCREF( tmp_return_value ); goto frame_return_exit_1; #if 0 RESTORE_FRAME_EXCEPTION( frame_99270ef4c1c45db5d9ad06ee758619b6 ); #endif // Put the previous frame back on top. popFrameStack(); goto frame_no_exception_1; frame_return_exit_1:; #if 0 RESTORE_FRAME_EXCEPTION( frame_99270ef4c1c45db5d9ad06ee758619b6 ); #endif // Put the previous frame back on top. popFrameStack(); goto try_return_handler_1; frame_exception_exit_1:; #if 0 RESTORE_FRAME_EXCEPTION( frame_99270ef4c1c45db5d9ad06ee758619b6 ); #endif if ( exception_tb == NULL ) { exception_tb = MAKE_TRACEBACK( frame_99270ef4c1c45db5d9ad06ee758619b6, exception_lineno ); } else if ( exception_tb->tb_frame != &frame_99270ef4c1c45db5d9ad06ee758619b6->m_frame ) { exception_tb = ADD_TRACEBACK( exception_tb, frame_99270ef4c1c45db5d9ad06ee758619b6, exception_lineno ); } // Attachs locals to frame if any. Nuitka_Frame_AttachLocals( (struct Nuitka_FrameObject *)frame_99270ef4c1c45db5d9ad06ee758619b6, type_description_1, var_p, var_stdout, var_stderr, var_clipboardContents ); // Release cached frame. if ( frame_99270ef4c1c45db5d9ad06ee758619b6 == cache_frame_99270ef4c1c45db5d9ad06ee758619b6 ) { Py_DECREF( frame_99270ef4c1c45db5d9ad06ee758619b6 ); } cache_frame_99270ef4c1c45db5d9ad06ee758619b6 = NULL; assertFrameObject( frame_99270ef4c1c45db5d9ad06ee758619b6 ); // Put the previous frame back on top. popFrameStack(); // Return the error. goto try_except_handler_1; frame_no_exception_1:; // tried codes exits in all cases NUITKA_CANNOT_GET_HERE( pyperclip$clipboards$$$function_6_init_klipper_clipboard$$$function_2_paste_klipper ); return NULL; // Return handler code: try_return_handler_1:; Py_XDECREF( var_p ); var_p = NULL; Py_XDECREF( var_stdout ); var_stdout = NULL; Py_XDECREF( var_stderr ); var_stderr = NULL; Py_XDECREF( var_clipboardContents ); var_clipboardContents = NULL; goto function_return_exit; // Exception handler code: try_except_handler_1:; exception_keeper_type_3 = exception_type; exception_keeper_value_3 = exception_value; exception_keeper_tb_3 = exception_tb; exception_keeper_lineno_3 = exception_lineno; exception_type = NULL; exception_value = NULL; exception_tb = NULL; exception_lineno = 0; Py_XDECREF( var_p ); var_p = NULL; Py_XDECREF( var_stdout ); var_stdout = NULL; Py_XDECREF( var_stderr ); var_stderr = NULL; Py_XDECREF( var_clipboardContents ); var_clipboardContents = NULL; // Re-raise. exception_type = exception_keeper_type_3; exception_value = exception_keeper_value_3; exception_tb = exception_keeper_tb_3; exception_lineno = exception_keeper_lineno_3; goto function_exception_exit; // End of try: // Return statement must have exited already. NUITKA_CANNOT_GET_HERE( pyperclip$clipboards$$$function_6_init_klipper_clipboard$$$function_2_paste_klipper ); return NULL; function_exception_exit: assert( exception_type ); RESTORE_ERROR_OCCURRED( exception_type, exception_value, exception_tb ); return NULL; function_return_exit: CHECK_OBJECT( tmp_return_value ); assert( had_error || !ERROR_OCCURRED() ); return tmp_return_value; } static PyObject *impl_pyperclip$clipboards$$$function_7_init_no_clipboard( struct Nuitka_FunctionObject const *self, PyObject **python_pars ) { // Preserve error status for checks #ifndef __NUITKA_NO_ASSERT__ NUITKA_MAY_BE_UNUSED bool had_error = ERROR_OCCURRED(); #endif // Local variable declarations. PyObject *var_ClipboardUnavailable = NULL; PyObject *outline_0_var___class__ = NULL; PyObject *outline_0_var___qualname__ = NULL; PyObject *outline_0_var___module__ = NULL; PyObject *outline_0_var___call__ = NULL; PyObject *outline_0_var___nonzero__ = NULL; PyObject *outline_0_var___bool__ = NULL; PyObject *tmp_class_creation_1__bases = NULL; PyObject *tmp_class_creation_1__class_decl_dict = NULL; PyObject *tmp_class_creation_1__metaclass = NULL; PyObject *tmp_class_creation_1__prepared = NULL; PyObject *exception_type = NULL; PyObject *exception_value = NULL; PyTracebackObject *exception_tb = NULL; NUITKA_MAY_BE_UNUSED int exception_lineno = 0; PyObject *exception_keeper_type_1; PyObject *exception_keeper_value_1; PyTracebackObject *exception_keeper_tb_1; NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_1; PyObject *exception_keeper_type_2; PyObject *exception_keeper_value_2; PyTracebackObject *exception_keeper_tb_2; NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_2; PyObject *exception_keeper_type_3; PyObject *exception_keeper_value_3; PyTracebackObject *exception_keeper_tb_3; NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_3; PyObject *tmp_args_name_1; PyObject *tmp_args_name_2; PyObject *tmp_assign_source_1; PyObject *tmp_assign_source_2; PyObject *tmp_assign_source_3; PyObject *tmp_assign_source_4; PyObject *tmp_assign_source_5; PyObject *tmp_assign_source_6; PyObject *tmp_assign_source_7; PyObject *tmp_assign_source_8; PyObject *tmp_assign_source_9; PyObject *tmp_assign_source_10; PyObject *tmp_assign_source_11; PyObject *tmp_bases_name_1; PyObject *tmp_called_name_1; PyObject *tmp_called_name_2; PyObject *tmp_called_name_3; PyObject *tmp_called_name_4; int tmp_cmp_In_1; int tmp_cmp_In_2; PyObject *tmp_compare_left_1; PyObject *tmp_compare_left_2; PyObject *tmp_compare_right_1; PyObject *tmp_compare_right_2; int tmp_cond_truth_1; int tmp_cond_truth_2; PyObject *tmp_cond_value_1; PyObject *tmp_cond_value_2; PyObject *tmp_dict_name_1; PyObject *tmp_dictdel_dict; PyObject *tmp_dictdel_key; PyObject *tmp_hasattr_attr_1; PyObject *tmp_hasattr_source_1; PyObject *tmp_key_name_1; PyObject *tmp_kw_name_1; PyObject *tmp_kw_name_2; PyObject *tmp_metaclass_name_1; PyObject *tmp_outline_return_value_1; int tmp_res; bool tmp_result; PyObject *tmp_return_value; PyObject *tmp_set_locals; PyObject *tmp_source_name_1; PyObject *tmp_subscribed_name_1; PyObject *tmp_subscript_name_1; PyObject *tmp_tuple_element_1; PyObject *tmp_tuple_element_2; PyObject *tmp_tuple_element_3; PyObject *tmp_type_arg_1; static struct Nuitka_FrameObject *cache_frame_6ab20e863ca616e71bb7580d671fbf83_2 = NULL; struct Nuitka_FrameObject *frame_6ab20e863ca616e71bb7580d671fbf83_2; static struct Nuitka_FrameObject *cache_frame_9176fa465259af4c58ea8214415ad323 = NULL; struct Nuitka_FrameObject *frame_9176fa465259af4c58ea8214415ad323; NUITKA_MAY_BE_UNUSED char const *type_description_1 = NULL; NUITKA_MAY_BE_UNUSED char const *type_description_2 = NULL; tmp_return_value = NULL; tmp_outline_return_value_1 = NULL; // Locals dictionary setup. PyObject *locals_dict_1 = PyDict_New(); // Actual function code. tmp_assign_source_1 = const_tuple_type_object_tuple; assert( tmp_class_creation_1__bases == NULL ); Py_INCREF( tmp_assign_source_1 ); tmp_class_creation_1__bases = tmp_assign_source_1; tmp_assign_source_2 = PyDict_New(); assert( tmp_class_creation_1__class_decl_dict == NULL ); tmp_class_creation_1__class_decl_dict = tmp_assign_source_2; // Tried code: MAKE_OR_REUSE_FRAME( cache_frame_9176fa465259af4c58ea8214415ad323, codeobj_9176fa465259af4c58ea8214415ad323, module_pyperclip$clipboards, sizeof(void *) ); frame_9176fa465259af4c58ea8214415ad323 = cache_frame_9176fa465259af4c58ea8214415ad323; // Push the new frame as the currently active one. pushFrameStack( frame_9176fa465259af4c58ea8214415ad323 ); // Mark the frame object as in use, ref count 1 will be up for reuse. assert( Py_REFCNT( frame_9176fa465259af4c58ea8214415ad323 ) == 2 ); // Frame stack // Framed code: // Tried code: tmp_compare_left_1 = const_str_plain_metaclass; tmp_compare_right_1 = tmp_class_creation_1__class_decl_dict; CHECK_OBJECT( tmp_compare_right_1 ); tmp_cmp_In_1 = PySequence_Contains( tmp_compare_right_1, tmp_compare_left_1 ); assert( !(tmp_cmp_In_1 == -1) ); if ( tmp_cmp_In_1 == 1 ) { goto condexpr_true_1; } else { goto condexpr_false_1; } condexpr_true_1:; tmp_dict_name_1 = tmp_class_creation_1__class_decl_dict; CHECK_OBJECT( tmp_dict_name_1 ); tmp_key_name_1 = const_str_plain_metaclass; tmp_metaclass_name_1 = DICT_GET_ITEM( tmp_dict_name_1, tmp_key_name_1 ); if ( tmp_metaclass_name_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 123; type_description_1 = "o"; goto try_except_handler_2; } goto condexpr_end_1; condexpr_false_1:; tmp_cond_value_1 = tmp_class_creation_1__bases; CHECK_OBJECT( tmp_cond_value_1 ); tmp_cond_truth_1 = CHECK_IF_TRUE( tmp_cond_value_1 ); if ( tmp_cond_truth_1 == -1 ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 123; type_description_1 = "o"; goto try_except_handler_2; } if ( tmp_cond_truth_1 == 1 ) { goto condexpr_true_2; } else { goto condexpr_false_2; } condexpr_true_2:; tmp_subscribed_name_1 = tmp_class_creation_1__bases; CHECK_OBJECT( tmp_subscribed_name_1 ); tmp_subscript_name_1 = const_int_0; tmp_type_arg_1 = LOOKUP_SUBSCRIPT( tmp_subscribed_name_1, tmp_subscript_name_1 ); if ( tmp_type_arg_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 123; type_description_1 = "o"; goto try_except_handler_2; } tmp_metaclass_name_1 = BUILTIN_TYPE1( tmp_type_arg_1 ); Py_DECREF( tmp_type_arg_1 ); if ( tmp_metaclass_name_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 123; type_description_1 = "o"; goto try_except_handler_2; } goto condexpr_end_2; condexpr_false_2:; tmp_metaclass_name_1 = (PyObject *)&PyType_Type; Py_INCREF( tmp_metaclass_name_1 ); condexpr_end_2:; condexpr_end_1:; tmp_bases_name_1 = tmp_class_creation_1__bases; CHECK_OBJECT( tmp_bases_name_1 ); tmp_assign_source_3 = SELECT_METACLASS( tmp_metaclass_name_1, tmp_bases_name_1 ); if ( tmp_assign_source_3 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); Py_DECREF( tmp_metaclass_name_1 ); exception_lineno = 123; type_description_1 = "o"; goto try_except_handler_2; } Py_DECREF( tmp_metaclass_name_1 ); assert( tmp_class_creation_1__metaclass == NULL ); tmp_class_creation_1__metaclass = tmp_assign_source_3; tmp_compare_left_2 = const_str_plain_metaclass; tmp_compare_right_2 = tmp_class_creation_1__class_decl_dict; CHECK_OBJECT( tmp_compare_right_2 ); tmp_cmp_In_2 = PySequence_Contains( tmp_compare_right_2, tmp_compare_left_2 ); assert( !(tmp_cmp_In_2 == -1) ); if ( tmp_cmp_In_2 == 1 ) { goto branch_yes_1; } else { goto branch_no_1; } branch_yes_1:; tmp_dictdel_dict = tmp_class_creation_1__class_decl_dict; CHECK_OBJECT( tmp_dictdel_dict ); tmp_dictdel_key = const_str_plain_metaclass; tmp_result = DICT_REMOVE_ITEM( tmp_dictdel_dict, tmp_dictdel_key ); if ( tmp_result == false ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 123; type_description_1 = "o"; goto try_except_handler_2; } branch_no_1:; tmp_hasattr_source_1 = tmp_class_creation_1__metaclass; CHECK_OBJECT( tmp_hasattr_source_1 ); tmp_hasattr_attr_1 = const_str_plain___prepare__; tmp_res = PyObject_HasAttr( tmp_hasattr_source_1, tmp_hasattr_attr_1 ); if ( tmp_res == -1 ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 123; type_description_1 = "o"; goto try_except_handler_2; } if ( tmp_res == 1 ) { goto condexpr_true_3; } else { goto condexpr_false_3; } condexpr_true_3:; tmp_source_name_1 = tmp_class_creation_1__metaclass; CHECK_OBJECT( tmp_source_name_1 ); tmp_called_name_1 = LOOKUP_ATTRIBUTE( tmp_source_name_1, const_str_plain___prepare__ ); if ( tmp_called_name_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 123; type_description_1 = "o"; goto try_except_handler_2; } tmp_args_name_1 = PyTuple_New( 2 ); tmp_tuple_element_1 = const_str_plain_ClipboardUnavailable; Py_INCREF( tmp_tuple_element_1 ); PyTuple_SET_ITEM( tmp_args_name_1, 0, tmp_tuple_element_1 ); tmp_tuple_element_1 = tmp_class_creation_1__bases; CHECK_OBJECT( tmp_tuple_element_1 ); Py_INCREF( tmp_tuple_element_1 ); PyTuple_SET_ITEM( tmp_args_name_1, 1, tmp_tuple_element_1 ); tmp_kw_name_1 = tmp_class_creation_1__class_decl_dict; CHECK_OBJECT( tmp_kw_name_1 ); frame_9176fa465259af4c58ea8214415ad323->m_frame.f_lineno = 123; tmp_assign_source_4 = CALL_FUNCTION( tmp_called_name_1, tmp_args_name_1, tmp_kw_name_1 ); Py_DECREF( tmp_called_name_1 ); Py_DECREF( tmp_args_name_1 ); if ( tmp_assign_source_4 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 123; type_description_1 = "o"; goto try_except_handler_2; } goto condexpr_end_3; condexpr_false_3:; tmp_assign_source_4 = PyDict_New(); condexpr_end_3:; assert( tmp_class_creation_1__prepared == NULL ); tmp_class_creation_1__prepared = tmp_assign_source_4; tmp_set_locals = tmp_class_creation_1__prepared; CHECK_OBJECT( tmp_set_locals ); Py_DECREF(locals_dict_1); locals_dict_1 = tmp_set_locals; Py_INCREF( tmp_set_locals ); tmp_assign_source_6 = const_str_digest_abf798afbed237310b8352ae4dd25846; assert( outline_0_var___module__ == NULL ); Py_INCREF( tmp_assign_source_6 ); outline_0_var___module__ = tmp_assign_source_6; tmp_assign_source_7 = const_str_digest_344ef046ed627942028fc8b792076a41; assert( outline_0_var___qualname__ == NULL ); Py_INCREF( tmp_assign_source_7 ); outline_0_var___qualname__ = tmp_assign_source_7; tmp_assign_source_8 = MAKE_FUNCTION_pyperclip$clipboards$$$function_7_init_no_clipboard$$$function_1___call__( ); assert( outline_0_var___call__ == NULL ); outline_0_var___call__ = tmp_assign_source_8; // Tried code: MAKE_OR_REUSE_FRAME( cache_frame_6ab20e863ca616e71bb7580d671fbf83_2, codeobj_6ab20e863ca616e71bb7580d671fbf83, module_pyperclip$clipboards, sizeof(void *)+sizeof(void *)+sizeof(void *)+sizeof(void *)+sizeof(void *)+sizeof(void *) ); frame_6ab20e863ca616e71bb7580d671fbf83_2 = cache_frame_6ab20e863ca616e71bb7580d671fbf83_2; // Push the new frame as the currently active one. pushFrameStack( frame_6ab20e863ca616e71bb7580d671fbf83_2 ); // Mark the frame object as in use, ref count 1 will be up for reuse. assert( Py_REFCNT( frame_6ab20e863ca616e71bb7580d671fbf83_2 ) == 2 ); // Frame stack // Framed code: tmp_cond_value_2 = PyDict_GetItem( locals_dict_1, const_str_plain_PY2 ); if ( tmp_cond_value_2 == NULL ) { tmp_cond_value_2 = GET_STRING_DICT_VALUE( moduledict_pyperclip$clipboards, (Nuitka_StringObject *)const_str_plain_PY2 ); if (unlikely( tmp_cond_value_2 == NULL )) { tmp_cond_value_2 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_PY2 ); } if ( tmp_cond_value_2 == NULL ) { exception_type = PyExc_NameError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "PY2" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 127; type_description_2 = "oooooo"; goto frame_exception_exit_2; } } tmp_cond_truth_2 = CHECK_IF_TRUE( tmp_cond_value_2 ); if ( tmp_cond_truth_2 == -1 ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 127; type_description_2 = "oooooo"; goto frame_exception_exit_2; } if ( tmp_cond_truth_2 == 1 ) { goto branch_yes_2; } else { goto branch_no_2; } branch_yes_2:; tmp_assign_source_9 = MAKE_FUNCTION_pyperclip$clipboards$$$function_7_init_no_clipboard$$$function_2___nonzero__( ); assert( outline_0_var___nonzero__ == NULL ); outline_0_var___nonzero__ = tmp_assign_source_9; goto branch_end_2; branch_no_2:; tmp_assign_source_10 = MAKE_FUNCTION_pyperclip$clipboards$$$function_7_init_no_clipboard$$$function_3___bool__( ); assert( outline_0_var___bool__ == NULL ); outline_0_var___bool__ = tmp_assign_source_10; branch_end_2:; #if 0 RESTORE_FRAME_EXCEPTION( frame_6ab20e863ca616e71bb7580d671fbf83_2 ); #endif // Put the previous frame back on top. popFrameStack(); goto frame_no_exception_1; frame_exception_exit_2:; #if 0 RESTORE_FRAME_EXCEPTION( frame_6ab20e863ca616e71bb7580d671fbf83_2 ); #endif if ( exception_tb == NULL ) { exception_tb = MAKE_TRACEBACK( frame_6ab20e863ca616e71bb7580d671fbf83_2, exception_lineno ); } else if ( exception_tb->tb_frame != &frame_6ab20e863ca616e71bb7580d671fbf83_2->m_frame ) { exception_tb = ADD_TRACEBACK( exception_tb, frame_6ab20e863ca616e71bb7580d671fbf83_2, exception_lineno ); } // Attachs locals to frame if any. Nuitka_Frame_AttachLocals( (struct Nuitka_FrameObject *)frame_6ab20e863ca616e71bb7580d671fbf83_2, type_description_2, outline_0_var___class__, outline_0_var___qualname__, outline_0_var___module__, outline_0_var___call__, outline_0_var___nonzero__, outline_0_var___bool__ ); // Release cached frame. if ( frame_6ab20e863ca616e71bb7580d671fbf83_2 == cache_frame_6ab20e863ca616e71bb7580d671fbf83_2 ) { Py_DECREF( frame_6ab20e863ca616e71bb7580d671fbf83_2 ); } cache_frame_6ab20e863ca616e71bb7580d671fbf83_2 = NULL; assertFrameObject( frame_6ab20e863ca616e71bb7580d671fbf83_2 ); // Put the previous frame back on top. popFrameStack(); // Return the error. goto nested_frame_exit_1; frame_no_exception_1:; goto skip_nested_handling_1; nested_frame_exit_1:; type_description_1 = "o"; goto try_except_handler_3; skip_nested_handling_1:; tmp_called_name_2 = tmp_class_creation_1__metaclass; CHECK_OBJECT( tmp_called_name_2 ); tmp_args_name_2 = PyTuple_New( 3 ); tmp_tuple_element_2 = const_str_plain_ClipboardUnavailable; Py_INCREF( tmp_tuple_element_2 ); PyTuple_SET_ITEM( tmp_args_name_2, 0, tmp_tuple_element_2 ); tmp_tuple_element_2 = tmp_class_creation_1__bases; CHECK_OBJECT( tmp_tuple_element_2 ); Py_INCREF( tmp_tuple_element_2 ); PyTuple_SET_ITEM( tmp_args_name_2, 1, tmp_tuple_element_2 ); tmp_tuple_element_2 = locals_dict_1; Py_INCREF( tmp_tuple_element_2 ); if ( outline_0_var___qualname__ != NULL ) { int res = PyObject_SetItem( tmp_tuple_element_2, const_str_plain___qualname__, outline_0_var___qualname__ ); tmp_result = res == 0; } else { PyObject *test_value = PyObject_GetItem( tmp_tuple_element_2, const_str_plain___qualname__ ); if ( test_value ) { Py_DECREF( test_value ); int res = PyObject_DelItem( tmp_tuple_element_2, const_str_plain___qualname__ ); tmp_result = res == 0; } else { CLEAR_ERROR_OCCURRED(); tmp_result = true; } } if ( tmp_result == false ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); Py_DECREF( tmp_args_name_2 ); Py_DECREF( tmp_tuple_element_2 ); exception_lineno = 123; type_description_1 = "o"; goto try_except_handler_3; } if ( outline_0_var___module__ != NULL ) { int res = PyObject_SetItem( tmp_tuple_element_2, const_str_plain___module__, outline_0_var___module__ ); tmp_result = res == 0; } else { PyObject *test_value = PyObject_GetItem( tmp_tuple_element_2, const_str_plain___module__ ); if ( test_value ) { Py_DECREF( test_value ); int res = PyObject_DelItem( tmp_tuple_element_2, const_str_plain___module__ ); tmp_result = res == 0; } else { CLEAR_ERROR_OCCURRED(); tmp_result = true; } } if ( tmp_result == false ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); Py_DECREF( tmp_args_name_2 ); Py_DECREF( tmp_tuple_element_2 ); exception_lineno = 123; type_description_1 = "o"; goto try_except_handler_3; } if ( outline_0_var___call__ != NULL ) { int res = PyObject_SetItem( tmp_tuple_element_2, const_str_plain___call__, outline_0_var___call__ ); tmp_result = res == 0; } else { PyObject *test_value = PyObject_GetItem( tmp_tuple_element_2, const_str_plain___call__ ); if ( test_value ) { Py_DECREF( test_value ); int res = PyObject_DelItem( tmp_tuple_element_2, const_str_plain___call__ ); tmp_result = res == 0; } else { CLEAR_ERROR_OCCURRED(); tmp_result = true; } } if ( tmp_result == false ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); Py_DECREF( tmp_args_name_2 ); Py_DECREF( tmp_tuple_element_2 ); exception_lineno = 123; type_description_1 = "o"; goto try_except_handler_3; } if ( outline_0_var___nonzero__ != NULL ) { int res = PyObject_SetItem( tmp_tuple_element_2, const_str_plain___nonzero__, outline_0_var___nonzero__ ); tmp_result = res == 0; } else { PyObject *test_value = PyObject_GetItem( tmp_tuple_element_2, const_str_plain___nonzero__ ); if ( test_value ) { Py_DECREF( test_value ); int res = PyObject_DelItem( tmp_tuple_element_2, const_str_plain___nonzero__ ); tmp_result = res == 0; } else { CLEAR_ERROR_OCCURRED(); tmp_result = true; } } if ( tmp_result == false ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); Py_DECREF( tmp_args_name_2 ); Py_DECREF( tmp_tuple_element_2 ); exception_lineno = 123; type_description_1 = "o"; goto try_except_handler_3; } if ( outline_0_var___bool__ != NULL ) { int res = PyObject_SetItem( tmp_tuple_element_2, const_str_plain___bool__, outline_0_var___bool__ ); tmp_result = res == 0; } else { PyObject *test_value = PyObject_GetItem( tmp_tuple_element_2, const_str_plain___bool__ ); if ( test_value ) { Py_DECREF( test_value ); int res = PyObject_DelItem( tmp_tuple_element_2, const_str_plain___bool__ ); tmp_result = res == 0; } else { CLEAR_ERROR_OCCURRED(); tmp_result = true; } } if ( tmp_result == false ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); Py_DECREF( tmp_args_name_2 ); Py_DECREF( tmp_tuple_element_2 ); exception_lineno = 123; type_description_1 = "o"; goto try_except_handler_3; } PyTuple_SET_ITEM( tmp_args_name_2, 2, tmp_tuple_element_2 ); tmp_kw_name_2 = tmp_class_creation_1__class_decl_dict; CHECK_OBJECT( tmp_kw_name_2 ); frame_9176fa465259af4c58ea8214415ad323->m_frame.f_lineno = 123; tmp_assign_source_11 = CALL_FUNCTION( tmp_called_name_2, tmp_args_name_2, tmp_kw_name_2 ); Py_DECREF( tmp_args_name_2 ); if ( tmp_assign_source_11 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 123; type_description_1 = "o"; goto try_except_handler_3; } assert( outline_0_var___class__ == NULL ); outline_0_var___class__ = tmp_assign_source_11; tmp_outline_return_value_1 = outline_0_var___class__; CHECK_OBJECT( tmp_outline_return_value_1 ); Py_INCREF( tmp_outline_return_value_1 ); goto try_return_handler_3; // tried codes exits in all cases NUITKA_CANNOT_GET_HERE( pyperclip$clipboards$$$function_7_init_no_clipboard ); return NULL; // Return handler code: try_return_handler_3:; CHECK_OBJECT( (PyObject *)outline_0_var___class__ ); Py_DECREF( outline_0_var___class__ ); outline_0_var___class__ = NULL; Py_XDECREF( outline_0_var___qualname__ ); outline_0_var___qualname__ = NULL; Py_XDECREF( outline_0_var___module__ ); outline_0_var___module__ = NULL; Py_XDECREF( outline_0_var___call__ ); outline_0_var___call__ = NULL; Py_XDECREF( outline_0_var___nonzero__ ); outline_0_var___nonzero__ = NULL; Py_XDECREF( outline_0_var___bool__ ); outline_0_var___bool__ = NULL; goto outline_result_1; // Exception handler code: try_except_handler_3:; exception_keeper_type_1 = exception_type; exception_keeper_value_1 = exception_value; exception_keeper_tb_1 = exception_tb; exception_keeper_lineno_1 = exception_lineno; exception_type = NULL; exception_value = NULL; exception_tb = NULL; exception_lineno = 0; Py_XDECREF( outline_0_var___qualname__ ); outline_0_var___qualname__ = NULL; Py_XDECREF( outline_0_var___module__ ); outline_0_var___module__ = NULL; Py_XDECREF( outline_0_var___call__ ); outline_0_var___call__ = NULL; Py_XDECREF( outline_0_var___nonzero__ ); outline_0_var___nonzero__ = NULL; Py_XDECREF( outline_0_var___bool__ ); outline_0_var___bool__ = NULL; // Re-raise. exception_type = exception_keeper_type_1; exception_value = exception_keeper_value_1; exception_tb = exception_keeper_tb_1; exception_lineno = exception_keeper_lineno_1; goto outline_exception_1; // End of try: // Return statement must have exited already. NUITKA_CANNOT_GET_HERE( pyperclip$clipboards$$$function_7_init_no_clipboard ); return NULL; outline_exception_1:; exception_lineno = 123; goto try_except_handler_2; outline_result_1:; tmp_assign_source_5 = tmp_outline_return_value_1; assert( var_ClipboardUnavailable == NULL ); var_ClipboardUnavailable = tmp_assign_source_5; goto try_end_1; // Exception handler code: try_except_handler_2:; exception_keeper_type_2 = exception_type; exception_keeper_value_2 = exception_value; exception_keeper_tb_2 = exception_tb; exception_keeper_lineno_2 = exception_lineno; exception_type = NULL; exception_value = NULL; exception_tb = NULL; exception_lineno = 0; Py_XDECREF( tmp_class_creation_1__bases ); tmp_class_creation_1__bases = NULL; Py_XDECREF( tmp_class_creation_1__class_decl_dict ); tmp_class_creation_1__class_decl_dict = NULL; Py_XDECREF( tmp_class_creation_1__metaclass ); tmp_class_creation_1__metaclass = NULL; Py_XDECREF( tmp_class_creation_1__prepared ); tmp_class_creation_1__prepared = NULL; // Re-raise. exception_type = exception_keeper_type_2; exception_value = exception_keeper_value_2; exception_tb = exception_keeper_tb_2; exception_lineno = exception_keeper_lineno_2; goto frame_exception_exit_1; // End of try: try_end_1:; Py_XDECREF( tmp_class_creation_1__bases ); tmp_class_creation_1__bases = NULL; Py_XDECREF( tmp_class_creation_1__class_decl_dict ); tmp_class_creation_1__class_decl_dict = NULL; Py_XDECREF( tmp_class_creation_1__metaclass ); tmp_class_creation_1__metaclass = NULL; Py_XDECREF( tmp_class_creation_1__prepared ); tmp_class_creation_1__prepared = NULL; tmp_return_value = PyTuple_New( 2 ); tmp_called_name_3 = var_ClipboardUnavailable; if ( tmp_called_name_3 == NULL ) { Py_DECREF( tmp_return_value ); exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "ClipboardUnavailable" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 134; type_description_1 = "o"; goto frame_exception_exit_1; } frame_9176fa465259af4c58ea8214415ad323->m_frame.f_lineno = 134; tmp_tuple_element_3 = CALL_FUNCTION_NO_ARGS( tmp_called_name_3 ); if ( tmp_tuple_element_3 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); Py_DECREF( tmp_return_value ); exception_lineno = 134; type_description_1 = "o"; goto frame_exception_exit_1; } PyTuple_SET_ITEM( tmp_return_value, 0, tmp_tuple_element_3 ); tmp_called_name_4 = var_ClipboardUnavailable; if ( tmp_called_name_4 == NULL ) { Py_DECREF( tmp_return_value ); exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "ClipboardUnavailable" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 134; type_description_1 = "o"; goto frame_exception_exit_1; } frame_9176fa465259af4c58ea8214415ad323->m_frame.f_lineno = 134; tmp_tuple_element_3 = CALL_FUNCTION_NO_ARGS( tmp_called_name_4 ); if ( tmp_tuple_element_3 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); Py_DECREF( tmp_return_value ); exception_lineno = 134; type_description_1 = "o"; goto frame_exception_exit_1; } PyTuple_SET_ITEM( tmp_return_value, 1, tmp_tuple_element_3 ); goto frame_return_exit_1; #if 0 RESTORE_FRAME_EXCEPTION( frame_9176fa465259af4c58ea8214415ad323 ); #endif // Put the previous frame back on top. popFrameStack(); goto frame_no_exception_2; frame_return_exit_1:; #if 0 RESTORE_FRAME_EXCEPTION( frame_9176fa465259af4c58ea8214415ad323 ); #endif // Put the previous frame back on top. popFrameStack(); goto try_return_handler_1; frame_exception_exit_1:; #if 0 RESTORE_FRAME_EXCEPTION( frame_9176fa465259af4c58ea8214415ad323 ); #endif if ( exception_tb == NULL ) { exception_tb = MAKE_TRACEBACK( frame_9176fa465259af4c58ea8214415ad323, exception_lineno ); } else if ( exception_tb->tb_frame != &frame_9176fa465259af4c58ea8214415ad323->m_frame ) { exception_tb = ADD_TRACEBACK( exception_tb, frame_9176fa465259af4c58ea8214415ad323, exception_lineno ); } // Attachs locals to frame if any. Nuitka_Frame_AttachLocals( (struct Nuitka_FrameObject *)frame_9176fa465259af4c58ea8214415ad323, type_description_1, var_ClipboardUnavailable ); // Release cached frame. if ( frame_9176fa465259af4c58ea8214415ad323 == cache_frame_9176fa465259af4c58ea8214415ad323 ) { Py_DECREF( frame_9176fa465259af4c58ea8214415ad323 ); } cache_frame_9176fa465259af4c58ea8214415ad323 = NULL; assertFrameObject( frame_9176fa465259af4c58ea8214415ad323 ); // Put the previous frame back on top. popFrameStack(); // Return the error. goto try_except_handler_1; frame_no_exception_2:; // tried codes exits in all cases NUITKA_CANNOT_GET_HERE( pyperclip$clipboards$$$function_7_init_no_clipboard ); return NULL; // Return handler code: try_return_handler_1:; Py_XDECREF( var_ClipboardUnavailable ); var_ClipboardUnavailable = NULL; goto function_return_exit; // Exception handler code: try_except_handler_1:; exception_keeper_type_3 = exception_type; exception_keeper_value_3 = exception_value; exception_keeper_tb_3 = exception_tb; exception_keeper_lineno_3 = exception_lineno; exception_type = NULL; exception_value = NULL; exception_tb = NULL; exception_lineno = 0; Py_XDECREF( var_ClipboardUnavailable ); var_ClipboardUnavailable = NULL; // Re-raise. exception_type = exception_keeper_type_3; exception_value = exception_keeper_value_3; exception_tb = exception_keeper_tb_3; exception_lineno = exception_keeper_lineno_3; goto function_exception_exit; // End of try: // Return statement must have exited already. NUITKA_CANNOT_GET_HERE( pyperclip$clipboards$$$function_7_init_no_clipboard ); return NULL; function_exception_exit: Py_DECREF( locals_dict_1 ); assert( exception_type ); RESTORE_ERROR_OCCURRED( exception_type, exception_value, exception_tb ); return NULL; function_return_exit: Py_DECREF( locals_dict_1 ); CHECK_OBJECT( tmp_return_value ); assert( had_error || !ERROR_OCCURRED() ); return tmp_return_value; } static PyObject *impl_pyperclip$clipboards$$$function_7_init_no_clipboard$$$function_1___call__( struct Nuitka_FunctionObject const *self, PyObject **python_pars ) { // Preserve error status for checks #ifndef __NUITKA_NO_ASSERT__ NUITKA_MAY_BE_UNUSED bool had_error = ERROR_OCCURRED(); #endif // Local variable declarations. PyObject *par_self = python_pars[ 0 ]; PyObject *par_args = python_pars[ 1 ]; PyObject *par_kwargs = python_pars[ 2 ]; PyObject *exception_type = NULL; PyObject *exception_value = NULL; PyTracebackObject *exception_tb = NULL; NUITKA_MAY_BE_UNUSED int exception_lineno = 0; PyObject *exception_keeper_type_1; PyObject *exception_keeper_value_1; PyTracebackObject *exception_keeper_tb_1; NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_1; PyObject *tmp_args_element_name_1; PyObject *tmp_called_name_1; PyObject *tmp_raise_type_1; static struct Nuitka_FrameObject *cache_frame_994acfe311cd5303f7a3d90127e45d73 = NULL; struct Nuitka_FrameObject *frame_994acfe311cd5303f7a3d90127e45d73; NUITKA_MAY_BE_UNUSED char const *type_description_1 = NULL; // Actual function code. // Tried code: MAKE_OR_REUSE_FRAME( cache_frame_994acfe311cd5303f7a3d90127e45d73, codeobj_994acfe311cd5303f7a3d90127e45d73, module_pyperclip$clipboards, sizeof(void *)+sizeof(void *)+sizeof(void *) ); frame_994acfe311cd5303f7a3d90127e45d73 = cache_frame_994acfe311cd5303f7a3d90127e45d73; // Push the new frame as the currently active one. pushFrameStack( frame_994acfe311cd5303f7a3d90127e45d73 ); // Mark the frame object as in use, ref count 1 will be up for reuse. assert( Py_REFCNT( frame_994acfe311cd5303f7a3d90127e45d73 ) == 2 ); // Frame stack // Framed code: tmp_called_name_1 = GET_STRING_DICT_VALUE( moduledict_pyperclip$clipboards, (Nuitka_StringObject *)const_str_plain_PyperclipException ); if (unlikely( tmp_called_name_1 == NULL )) { tmp_called_name_1 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_PyperclipException ); } if ( tmp_called_name_1 == NULL ) { exception_type = PyExc_NameError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "PyperclipException" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 125; type_description_1 = "ooo"; goto frame_exception_exit_1; } tmp_args_element_name_1 = GET_STRING_DICT_VALUE( moduledict_pyperclip$clipboards, (Nuitka_StringObject *)const_str_plain_EXCEPT_MSG ); if (unlikely( tmp_args_element_name_1 == NULL )) { tmp_args_element_name_1 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_EXCEPT_MSG ); } if ( tmp_args_element_name_1 == NULL ) { exception_type = PyExc_NameError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "EXCEPT_MSG" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 125; type_description_1 = "ooo"; goto frame_exception_exit_1; } frame_994acfe311cd5303f7a3d90127e45d73->m_frame.f_lineno = 125; { PyObject *call_args[] = { tmp_args_element_name_1 }; tmp_raise_type_1 = CALL_FUNCTION_WITH_ARGS1( tmp_called_name_1, call_args ); } if ( tmp_raise_type_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 125; type_description_1 = "ooo"; goto frame_exception_exit_1; } exception_type = tmp_raise_type_1; exception_lineno = 125; RAISE_EXCEPTION_WITH_TYPE( &exception_type, &exception_value, &exception_tb ); type_description_1 = "ooo"; goto frame_exception_exit_1; #if 0 RESTORE_FRAME_EXCEPTION( frame_994acfe311cd5303f7a3d90127e45d73 ); #endif // Put the previous frame back on top. popFrameStack(); goto frame_no_exception_1; frame_exception_exit_1:; #if 0 RESTORE_FRAME_EXCEPTION( frame_994acfe311cd5303f7a3d90127e45d73 ); #endif if ( exception_tb == NULL ) { exception_tb = MAKE_TRACEBACK( frame_994acfe311cd5303f7a3d90127e45d73, exception_lineno ); } else if ( exception_tb->tb_frame != &frame_994acfe311cd5303f7a3d90127e45d73->m_frame ) { exception_tb = ADD_TRACEBACK( exception_tb, frame_994acfe311cd5303f7a3d90127e45d73, exception_lineno ); } // Attachs locals to frame if any. Nuitka_Frame_AttachLocals( (struct Nuitka_FrameObject *)frame_994acfe311cd5303f7a3d90127e45d73, type_description_1, par_self, par_args, par_kwargs ); // Release cached frame. if ( frame_994acfe311cd5303f7a3d90127e45d73 == cache_frame_994acfe311cd5303f7a3d90127e45d73 ) { Py_DECREF( frame_994acfe311cd5303f7a3d90127e45d73 ); } cache_frame_994acfe311cd5303f7a3d90127e45d73 = NULL; assertFrameObject( frame_994acfe311cd5303f7a3d90127e45d73 ); // Put the previous frame back on top. popFrameStack(); // Return the error. goto try_except_handler_1; frame_no_exception_1:; // tried codes exits in all cases NUITKA_CANNOT_GET_HERE( pyperclip$clipboards$$$function_7_init_no_clipboard$$$function_1___call__ ); return NULL; // Exception handler code: try_except_handler_1:; exception_keeper_type_1 = exception_type; exception_keeper_value_1 = exception_value; exception_keeper_tb_1 = exception_tb; exception_keeper_lineno_1 = exception_lineno; exception_type = NULL; exception_value = NULL; exception_tb = NULL; exception_lineno = 0; Py_XDECREF( par_self ); par_self = NULL; Py_XDECREF( par_args ); par_args = NULL; Py_XDECREF( par_kwargs ); par_kwargs = NULL; // Re-raise. exception_type = exception_keeper_type_1; exception_value = exception_keeper_value_1; exception_tb = exception_keeper_tb_1; exception_lineno = exception_keeper_lineno_1; goto function_exception_exit; // End of try: // Return statement must have exited already. NUITKA_CANNOT_GET_HERE( pyperclip$clipboards$$$function_7_init_no_clipboard$$$function_1___call__ ); return NULL; function_exception_exit: assert( exception_type ); RESTORE_ERROR_OCCURRED( exception_type, exception_value, exception_tb ); return NULL; } static PyObject *impl_pyperclip$clipboards$$$function_7_init_no_clipboard$$$function_2___nonzero__( struct Nuitka_FunctionObject const *self, PyObject **python_pars ) { // Preserve error status for checks #ifndef __NUITKA_NO_ASSERT__ NUITKA_MAY_BE_UNUSED bool had_error = ERROR_OCCURRED(); #endif // Local variable declarations. PyObject *par_self = python_pars[ 0 ]; PyObject *tmp_return_value; tmp_return_value = NULL; // Actual function code. // Tried code: tmp_return_value = Py_False; Py_INCREF( tmp_return_value ); goto try_return_handler_1; // tried codes exits in all cases NUITKA_CANNOT_GET_HERE( pyperclip$clipboards$$$function_7_init_no_clipboard$$$function_2___nonzero__ ); return NULL; // Return handler code: try_return_handler_1:; CHECK_OBJECT( (PyObject *)par_self ); Py_DECREF( par_self ); par_self = NULL; goto function_return_exit; // End of try: CHECK_OBJECT( (PyObject *)par_self ); Py_DECREF( par_self ); par_self = NULL; // Return statement must have exited already. NUITKA_CANNOT_GET_HERE( pyperclip$clipboards$$$function_7_init_no_clipboard$$$function_2___nonzero__ ); return NULL; function_return_exit: CHECK_OBJECT( tmp_return_value ); assert( had_error || !ERROR_OCCURRED() ); return tmp_return_value; } static PyObject *impl_pyperclip$clipboards$$$function_7_init_no_clipboard$$$function_3___bool__( struct Nuitka_FunctionObject const *self, PyObject **python_pars ) { // Preserve error status for checks #ifndef __NUITKA_NO_ASSERT__ NUITKA_MAY_BE_UNUSED bool had_error = ERROR_OCCURRED(); #endif // Local variable declarations. PyObject *par_self = python_pars[ 0 ]; PyObject *tmp_return_value; tmp_return_value = NULL; // Actual function code. // Tried code: tmp_return_value = Py_False; Py_INCREF( tmp_return_value ); goto try_return_handler_1; // tried codes exits in all cases NUITKA_CANNOT_GET_HERE( pyperclip$clipboards$$$function_7_init_no_clipboard$$$function_3___bool__ ); return NULL; // Return handler code: try_return_handler_1:; CHECK_OBJECT( (PyObject *)par_self ); Py_DECREF( par_self ); par_self = NULL; goto function_return_exit; // End of try: CHECK_OBJECT( (PyObject *)par_self ); Py_DECREF( par_self ); par_self = NULL; // Return statement must have exited already. NUITKA_CANNOT_GET_HERE( pyperclip$clipboards$$$function_7_init_no_clipboard$$$function_3___bool__ ); return NULL; function_return_exit: CHECK_OBJECT( tmp_return_value ); assert( had_error || !ERROR_OCCURRED() ); return tmp_return_value; } static PyObject *MAKE_FUNCTION_pyperclip$clipboards$$$function_1_init_osx_clipboard( ) { struct Nuitka_FunctionObject *result = Nuitka_Function_New( impl_pyperclip$clipboards$$$function_1_init_osx_clipboard, const_str_plain_init_osx_clipboard, #if PYTHON_VERSION >= 330 NULL, #endif codeobj_b27a0a0307e87f3792f3ffffd65055d7, NULL, #if PYTHON_VERSION >= 300 NULL, const_dict_empty, #endif module_pyperclip$clipboards, Py_None, 0 ); return (PyObject *)result; } static PyObject *MAKE_FUNCTION_pyperclip$clipboards$$$function_1_init_osx_clipboard$$$function_1_copy_osx( ) { struct Nuitka_FunctionObject *result = Nuitka_Function_New( impl_pyperclip$clipboards$$$function_1_init_osx_clipboard$$$function_1_copy_osx, const_str_plain_copy_osx, #if PYTHON_VERSION >= 330 const_str_digest_0d36178cf1fdd7da1acd434235941e8a, #endif codeobj_0c00caeab83633b5a6b5c185156303f2, NULL, #if PYTHON_VERSION >= 300 NULL, const_dict_empty, #endif module_pyperclip$clipboards, Py_None, 0 ); return (PyObject *)result; } static PyObject *MAKE_FUNCTION_pyperclip$clipboards$$$function_1_init_osx_clipboard$$$function_2_paste_osx( ) { struct Nuitka_FunctionObject *result = Nuitka_Function_New( impl_pyperclip$clipboards$$$function_1_init_osx_clipboard$$$function_2_paste_osx, const_str_plain_paste_osx, #if PYTHON_VERSION >= 330 const_str_digest_fe278fbce1ae480c42f145639e1ea634, #endif codeobj_fe9ce96a2fa59097f4e8994392986166, NULL, #if PYTHON_VERSION >= 300 NULL, const_dict_empty, #endif module_pyperclip$clipboards, Py_None, 0 ); return (PyObject *)result; } static PyObject *MAKE_FUNCTION_pyperclip$clipboards$$$function_2_init_gtk_clipboard( ) { struct Nuitka_FunctionObject *result = Nuitka_Function_New( impl_pyperclip$clipboards$$$function_2_init_gtk_clipboard, const_str_plain_init_gtk_clipboard, #if PYTHON_VERSION >= 330 NULL, #endif codeobj_7512eea690737b69fcf042e9389861f9, NULL, #if PYTHON_VERSION >= 300 NULL, const_dict_empty, #endif module_pyperclip$clipboards, Py_None, 0 ); return (PyObject *)result; } static PyObject *MAKE_FUNCTION_pyperclip$clipboards$$$function_2_init_gtk_clipboard$$$function_1_copy_gtk( struct Nuitka_CellObject *closure_gtk ) { struct Nuitka_FunctionObject *result = Nuitka_Function_New( impl_pyperclip$clipboards$$$function_2_init_gtk_clipboard$$$function_1_copy_gtk, const_str_plain_copy_gtk, #if PYTHON_VERSION >= 330 const_str_digest_363b20897abb8fe206a2ed773d13d28a, #endif codeobj_6c43a1687d3fc7e03237a18bb4a7ff7d, NULL, #if PYTHON_VERSION >= 300 NULL, const_dict_empty, #endif module_pyperclip$clipboards, Py_None, 1 ); result->m_closure[0] = closure_gtk; Py_INCREF( result->m_closure[0] ); return (PyObject *)result; } static PyObject *MAKE_FUNCTION_pyperclip$clipboards$$$function_2_init_gtk_clipboard$$$function_2_paste_gtk( struct Nuitka_CellObject *closure_gtk ) { struct Nuitka_FunctionObject *result = Nuitka_Function_New( impl_pyperclip$clipboards$$$function_2_init_gtk_clipboard$$$function_2_paste_gtk, const_str_plain_paste_gtk, #if PYTHON_VERSION >= 330 const_str_digest_12824c42ae734a5ec21969db08809d5c, #endif codeobj_113d5874740330562529e560a6ae6b38, NULL, #if PYTHON_VERSION >= 300 NULL, const_dict_empty, #endif module_pyperclip$clipboards, Py_None, 1 ); result->m_closure[0] = closure_gtk; Py_INCREF( result->m_closure[0] ); return (PyObject *)result; } static PyObject *MAKE_FUNCTION_pyperclip$clipboards$$$function_3_init_qt_clipboard( ) { struct Nuitka_FunctionObject *result = Nuitka_Function_New( impl_pyperclip$clipboards$$$function_3_init_qt_clipboard, const_str_plain_init_qt_clipboard, #if PYTHON_VERSION >= 330 NULL, #endif codeobj_e886f435cf3ab0f2a1d23a7b972501c4, NULL, #if PYTHON_VERSION >= 300 NULL, const_dict_empty, #endif module_pyperclip$clipboards, Py_None, 0 ); return (PyObject *)result; } static PyObject *MAKE_FUNCTION_pyperclip$clipboards$$$function_3_init_qt_clipboard$$$function_1_copy_qt( struct Nuitka_CellObject *closure_app ) { struct Nuitka_FunctionObject *result = Nuitka_Function_New( impl_pyperclip$clipboards$$$function_3_init_qt_clipboard$$$function_1_copy_qt, const_str_plain_copy_qt, #if PYTHON_VERSION >= 330 const_str_digest_88e1244ea918f637f982de49331de205, #endif codeobj_d32c80b8cc4f52e8ea4f7cf8e00a5a72, NULL, #if PYTHON_VERSION >= 300 NULL, const_dict_empty, #endif module_pyperclip$clipboards, Py_None, 1 ); result->m_closure[0] = closure_app; Py_INCREF( result->m_closure[0] ); return (PyObject *)result; } static PyObject *MAKE_FUNCTION_pyperclip$clipboards$$$function_3_init_qt_clipboard$$$function_2_paste_qt( struct Nuitka_CellObject *closure_app ) { struct Nuitka_FunctionObject *result = Nuitka_Function_New( impl_pyperclip$clipboards$$$function_3_init_qt_clipboard$$$function_2_paste_qt, const_str_plain_paste_qt, #if PYTHON_VERSION >= 330 const_str_digest_aefe37d186409357e48b054613e2a70f, #endif codeobj_082a9101cf76bcbc1c84e8a20e574a7c, NULL, #if PYTHON_VERSION >= 300 NULL, const_dict_empty, #endif module_pyperclip$clipboards, Py_None, 1 ); result->m_closure[0] = closure_app; Py_INCREF( result->m_closure[0] ); return (PyObject *)result; } static PyObject *MAKE_FUNCTION_pyperclip$clipboards$$$function_4_init_xclip_clipboard( ) { struct Nuitka_FunctionObject *result = Nuitka_Function_New( impl_pyperclip$clipboards$$$function_4_init_xclip_clipboard, const_str_plain_init_xclip_clipboard, #if PYTHON_VERSION >= 330 NULL, #endif codeobj_8982018ca2c7d40aa223cd827eb6be8b, NULL, #if PYTHON_VERSION >= 300 NULL, const_dict_empty, #endif module_pyperclip$clipboards, Py_None, 0 ); return (PyObject *)result; } static PyObject *MAKE_FUNCTION_pyperclip$clipboards$$$function_4_init_xclip_clipboard$$$function_1_copy_xclip( ) { struct Nuitka_FunctionObject *result = Nuitka_Function_New( impl_pyperclip$clipboards$$$function_4_init_xclip_clipboard$$$function_1_copy_xclip, const_str_plain_copy_xclip, #if PYTHON_VERSION >= 330 const_str_digest_488addb9f0a7f06aba6f2490db82d71c, #endif codeobj_87896ad4334adfc69f0daabfac3e30c6, NULL, #if PYTHON_VERSION >= 300 NULL, const_dict_empty, #endif module_pyperclip$clipboards, Py_None, 0 ); return (PyObject *)result; } static PyObject *MAKE_FUNCTION_pyperclip$clipboards$$$function_4_init_xclip_clipboard$$$function_2_paste_xclip( ) { struct Nuitka_FunctionObject *result = Nuitka_Function_New( impl_pyperclip$clipboards$$$function_4_init_xclip_clipboard$$$function_2_paste_xclip, const_str_plain_paste_xclip, #if PYTHON_VERSION >= 330 const_str_digest_e75ca76f27e0e640a58096dff4d2ac2a, #endif codeobj_f950ff59b50650874131d45114feb4ed, NULL, #if PYTHON_VERSION >= 300 NULL, const_dict_empty, #endif module_pyperclip$clipboards, Py_None, 0 ); return (PyObject *)result; } static PyObject *MAKE_FUNCTION_pyperclip$clipboards$$$function_5_init_xsel_clipboard( ) { struct Nuitka_FunctionObject *result = Nuitka_Function_New( impl_pyperclip$clipboards$$$function_5_init_xsel_clipboard, const_str_plain_init_xsel_clipboard, #if PYTHON_VERSION >= 330 NULL, #endif codeobj_200f844cab6cbcad05505017ccc475ca, NULL, #if PYTHON_VERSION >= 300 NULL, const_dict_empty, #endif module_pyperclip$clipboards, Py_None, 0 ); return (PyObject *)result; } static PyObject *MAKE_FUNCTION_pyperclip$clipboards$$$function_5_init_xsel_clipboard$$$function_1_copy_xsel( ) { struct Nuitka_FunctionObject *result = Nuitka_Function_New( impl_pyperclip$clipboards$$$function_5_init_xsel_clipboard$$$function_1_copy_xsel, const_str_plain_copy_xsel, #if PYTHON_VERSION >= 330 const_str_digest_7f6d117bc092141e51ea443a0e0999c2, #endif codeobj_b0f3bfc3d3d61adca3747b3845cc6ff6, NULL, #if PYTHON_VERSION >= 300 NULL, const_dict_empty, #endif module_pyperclip$clipboards, Py_None, 0 ); return (PyObject *)result; } static PyObject *MAKE_FUNCTION_pyperclip$clipboards$$$function_5_init_xsel_clipboard$$$function_2_paste_xsel( ) { struct Nuitka_FunctionObject *result = Nuitka_Function_New( impl_pyperclip$clipboards$$$function_5_init_xsel_clipboard$$$function_2_paste_xsel, const_str_plain_paste_xsel, #if PYTHON_VERSION >= 330 const_str_digest_9c1b8d1bf096eeae592150bfe0b7f351, #endif codeobj_ea0d5a0280e03dec96cb094dc6e0c388, NULL, #if PYTHON_VERSION >= 300 NULL, const_dict_empty, #endif module_pyperclip$clipboards, Py_None, 0 ); return (PyObject *)result; } static PyObject *MAKE_FUNCTION_pyperclip$clipboards$$$function_6_init_klipper_clipboard( ) { struct Nuitka_FunctionObject *result = Nuitka_Function_New( impl_pyperclip$clipboards$$$function_6_init_klipper_clipboard, const_str_plain_init_klipper_clipboard, #if PYTHON_VERSION >= 330 NULL, #endif codeobj_b13a7a5eb19cb6d46f4de7194120c1c9, NULL, #if PYTHON_VERSION >= 300 NULL, const_dict_empty, #endif module_pyperclip$clipboards, Py_None, 0 ); return (PyObject *)result; } static PyObject *MAKE_FUNCTION_pyperclip$clipboards$$$function_6_init_klipper_clipboard$$$function_1_copy_klipper( ) { struct Nuitka_FunctionObject *result = Nuitka_Function_New( impl_pyperclip$clipboards$$$function_6_init_klipper_clipboard$$$function_1_copy_klipper, const_str_plain_copy_klipper, #if PYTHON_VERSION >= 330 const_str_digest_d3a192d9a90f12283eb154da5edd57d5, #endif codeobj_bb325fb2ba607198bce74bc146ecfdfa, NULL, #if PYTHON_VERSION >= 300 NULL, const_dict_empty, #endif module_pyperclip$clipboards, Py_None, 0 ); return (PyObject *)result; } static PyObject *MAKE_FUNCTION_pyperclip$clipboards$$$function_6_init_klipper_clipboard$$$function_2_paste_klipper( ) { struct Nuitka_FunctionObject *result = Nuitka_Function_New( impl_pyperclip$clipboards$$$function_6_init_klipper_clipboard$$$function_2_paste_klipper, const_str_plain_paste_klipper, #if PYTHON_VERSION >= 330 const_str_digest_b75401c8f73575104762484b09641fec, #endif codeobj_99270ef4c1c45db5d9ad06ee758619b6, NULL, #if PYTHON_VERSION >= 300 NULL, const_dict_empty, #endif module_pyperclip$clipboards, Py_None, 0 ); return (PyObject *)result; } static PyObject *MAKE_FUNCTION_pyperclip$clipboards$$$function_7_init_no_clipboard( ) { struct Nuitka_FunctionObject *result = Nuitka_Function_New( impl_pyperclip$clipboards$$$function_7_init_no_clipboard, const_str_plain_init_no_clipboard, #if PYTHON_VERSION >= 330 NULL, #endif codeobj_9176fa465259af4c58ea8214415ad323, NULL, #if PYTHON_VERSION >= 300 NULL, const_dict_empty, #endif module_pyperclip$clipboards, Py_None, 0 ); return (PyObject *)result; } static PyObject *MAKE_FUNCTION_pyperclip$clipboards$$$function_7_init_no_clipboard$$$function_1___call__( ) { struct Nuitka_FunctionObject *result = Nuitka_Function_New( impl_pyperclip$clipboards$$$function_7_init_no_clipboard$$$function_1___call__, const_str_plain___call__, #if PYTHON_VERSION >= 330 const_str_digest_77292a4a8d17a0319dc328f25380c431, #endif codeobj_994acfe311cd5303f7a3d90127e45d73, NULL, #if PYTHON_VERSION >= 300 NULL, const_dict_empty, #endif module_pyperclip$clipboards, Py_None, 0 ); return (PyObject *)result; } static PyObject *MAKE_FUNCTION_pyperclip$clipboards$$$function_7_init_no_clipboard$$$function_2___nonzero__( ) { struct Nuitka_FunctionObject *result = Nuitka_Function_New( impl_pyperclip$clipboards$$$function_7_init_no_clipboard$$$function_2___nonzero__, const_str_plain___nonzero__, #if PYTHON_VERSION >= 330 const_str_digest_01d040ac9dfb1f7d0f957fcd5293298f, #endif codeobj_1b3001ad8a78106b42b4b432170e09c4, NULL, #if PYTHON_VERSION >= 300 NULL, const_dict_empty, #endif module_pyperclip$clipboards, Py_None, 0 ); return (PyObject *)result; } static PyObject *MAKE_FUNCTION_pyperclip$clipboards$$$function_7_init_no_clipboard$$$function_3___bool__( ) { struct Nuitka_FunctionObject *result = Nuitka_Function_New( impl_pyperclip$clipboards$$$function_7_init_no_clipboard$$$function_3___bool__, const_str_plain___bool__, #if PYTHON_VERSION >= 330 const_str_digest_d577dede9743e2b3fad57acdda45ba59, #endif codeobj_72f17b2905fbc9b53a6c4b832c293385, NULL, #if PYTHON_VERSION >= 300 NULL, const_dict_empty, #endif module_pyperclip$clipboards, Py_None, 0 ); return (PyObject *)result; } #if PYTHON_VERSION >= 300 static struct PyModuleDef mdef_pyperclip$clipboards = { PyModuleDef_HEAD_INIT, "pyperclip.clipboards", /* m_name */ NULL, /* m_doc */ -1, /* m_size */ NULL, /* m_methods */ NULL, /* m_reload */ NULL, /* m_traverse */ NULL, /* m_clear */ NULL, /* m_free */ }; #endif #if PYTHON_VERSION >= 300 extern PyObject *metapath_based_loader; #endif #if PYTHON_VERSION >= 330 extern PyObject *const_str_plain___loader__; #endif extern void _initCompiledCellType(); extern void _initCompiledGeneratorType(); extern void _initCompiledFunctionType(); extern void _initCompiledMethodType(); extern void _initCompiledFrameType(); #if PYTHON_VERSION >= 350 extern void _initCompiledCoroutineTypes(); #endif #if PYTHON_VERSION >= 360 extern void _initCompiledAsyncgenTypes(); #endif // The exported interface to CPython. On import of the module, this function // gets called. It has to have an exact function name, in cases it's a shared // library export. This is hidden behind the MOD_INIT_DECL. MOD_INIT_DECL( pyperclip$clipboards ) { #if defined(_NUITKA_EXE) || PYTHON_VERSION >= 300 static bool _init_done = false; // Modules might be imported repeatedly, which is to be ignored. if ( _init_done ) { return MOD_RETURN_VALUE( module_pyperclip$clipboards ); } else { _init_done = true; } #endif #ifdef _NUITKA_MODULE // In case of a stand alone extension module, need to call initialization // the init here because that's the first and only time we are going to get // called here. // Initialize the constant values used. _initBuiltinModule(); createGlobalConstants(); /* Initialize the compiled types of Nuitka. */ _initCompiledCellType(); _initCompiledGeneratorType(); _initCompiledFunctionType(); _initCompiledMethodType(); _initCompiledFrameType(); #if PYTHON_VERSION >= 350 _initCompiledCoroutineTypes(); #endif #if PYTHON_VERSION >= 360 _initCompiledAsyncgenTypes(); #endif #if PYTHON_VERSION < 300 _initSlotCompare(); #endif #if PYTHON_VERSION >= 270 _initSlotIternext(); #endif patchBuiltinModule(); patchTypeComparison(); // Enable meta path based loader if not already done. setupMetaPathBasedLoader(); #if PYTHON_VERSION >= 300 patchInspectModule(); #endif #endif /* The constants only used by this module are created now. */ #ifdef _NUITKA_TRACE puts("pyperclip.clipboards: Calling createModuleConstants()."); #endif createModuleConstants(); /* The code objects used by this module are created now. */ #ifdef _NUITKA_TRACE puts("pyperclip.clipboards: Calling createModuleCodeObjects()."); #endif createModuleCodeObjects(); // puts( "in initpyperclip$clipboards" ); // Create the module object first. There are no methods initially, all are // added dynamically in actual code only. Also no "__doc__" is initially // set at this time, as it could not contain NUL characters this way, they // are instead set in early module code. No "self" for modules, we have no // use for it. #if PYTHON_VERSION < 300 module_pyperclip$clipboards = Py_InitModule4( "pyperclip.clipboards", // Module Name NULL, // No methods initially, all are added // dynamically in actual module code only. NULL, // No __doc__ is initially set, as it could // not contain NUL this way, added early in // actual code. NULL, // No self for modules, we don't use it. PYTHON_API_VERSION ); #else module_pyperclip$clipboards = PyModule_Create( &mdef_pyperclip$clipboards ); #endif moduledict_pyperclip$clipboards = MODULE_DICT( module_pyperclip$clipboards ); CHECK_OBJECT( module_pyperclip$clipboards ); // Seems to work for Python2.7 out of the box, but for Python3, the module // doesn't automatically enter "sys.modules", so do it manually. #if PYTHON_VERSION >= 300 { int r = PyObject_SetItem( PySys_GetObject( (char *)"modules" ), const_str_digest_abf798afbed237310b8352ae4dd25846, module_pyperclip$clipboards ); assert( r != -1 ); } #endif // For deep importing of a module we need to have "__builtins__", so we set // it ourselves in the same way than CPython does. Note: This must be done // before the frame object is allocated, or else it may fail. if ( GET_STRING_DICT_VALUE( moduledict_pyperclip$clipboards, (Nuitka_StringObject *)const_str_plain___builtins__ ) == NULL ) { PyObject *value = (PyObject *)builtin_module; // Check if main module, not a dict then but the module itself. #if !defined(_NUITKA_EXE) || !0 value = PyModule_GetDict( value ); #endif UPDATE_STRING_DICT0( moduledict_pyperclip$clipboards, (Nuitka_StringObject *)const_str_plain___builtins__, value ); } #if PYTHON_VERSION >= 330 UPDATE_STRING_DICT0( moduledict_pyperclip$clipboards, (Nuitka_StringObject *)const_str_plain___loader__, metapath_based_loader ); #endif // Temp variables if any PyObject *exception_type = NULL; PyObject *exception_value = NULL; PyTracebackObject *exception_tb = NULL; NUITKA_MAY_BE_UNUSED int exception_lineno = 0; PyObject *tmp_args_element_name_1; PyObject *tmp_args_element_name_2; PyObject *tmp_assign_source_1; PyObject *tmp_assign_source_2; PyObject *tmp_assign_source_3; PyObject *tmp_assign_source_4; PyObject *tmp_assign_source_5; PyObject *tmp_assign_source_6; PyObject *tmp_assign_source_7; PyObject *tmp_assign_source_8; PyObject *tmp_assign_source_9; PyObject *tmp_assign_source_10; PyObject *tmp_assign_source_11; PyObject *tmp_assign_source_12; PyObject *tmp_assign_source_13; PyObject *tmp_assign_source_14; PyObject *tmp_assign_source_15; PyObject *tmp_assign_source_16; PyObject *tmp_assign_source_17; PyObject *tmp_assign_source_18; PyObject *tmp_assign_source_19; PyObject *tmp_called_name_1; PyObject *tmp_compexpr_left_1; PyObject *tmp_compexpr_right_1; int tmp_cond_truth_1; PyObject *tmp_cond_value_1; PyObject *tmp_fromlist_name_1; PyObject *tmp_fromlist_name_2; PyObject *tmp_fromlist_name_3; PyObject *tmp_globals_name_1; PyObject *tmp_globals_name_2; PyObject *tmp_globals_name_3; PyObject *tmp_import_name_from_1; PyObject *tmp_level_name_1; PyObject *tmp_level_name_2; PyObject *tmp_level_name_3; PyObject *tmp_locals_name_1; PyObject *tmp_locals_name_2; PyObject *tmp_locals_name_3; PyObject *tmp_name_name_1; PyObject *tmp_name_name_2; PyObject *tmp_name_name_3; PyObject *tmp_source_name_1; PyObject *tmp_subscribed_name_1; PyObject *tmp_subscript_name_1; struct Nuitka_FrameObject *frame_46b2ba739d21d8e36683e28bbbe03322; NUITKA_MAY_BE_UNUSED char const *type_description_1 = NULL; // Module code. tmp_assign_source_1 = Py_None; UPDATE_STRING_DICT0( moduledict_pyperclip$clipboards, (Nuitka_StringObject *)const_str_plain___doc__, tmp_assign_source_1 ); tmp_assign_source_2 = module_filename_obj; UPDATE_STRING_DICT0( moduledict_pyperclip$clipboards, (Nuitka_StringObject *)const_str_plain___file__, tmp_assign_source_2 ); tmp_assign_source_3 = metapath_based_loader; UPDATE_STRING_DICT0( moduledict_pyperclip$clipboards, (Nuitka_StringObject *)const_str_plain___loader__, tmp_assign_source_3 ); // Frame without reuse. frame_46b2ba739d21d8e36683e28bbbe03322 = MAKE_MODULE_FRAME( codeobj_46b2ba739d21d8e36683e28bbbe03322, module_pyperclip$clipboards ); // Push the new frame as the currently active one, and we should be exclusively // owning it. pushFrameStack( frame_46b2ba739d21d8e36683e28bbbe03322 ); assert( Py_REFCNT( frame_46b2ba739d21d8e36683e28bbbe03322 ) == 2 ); // Framed code: frame_46b2ba739d21d8e36683e28bbbe03322->m_frame.f_lineno = 1; { PyObject *module = PyImport_ImportModule("importlib._bootstrap"); if (likely( module != NULL )) { tmp_called_name_1 = PyObject_GetAttr( module, const_str_plain_ModuleSpec ); } else { tmp_called_name_1 = NULL; } } if ( tmp_called_name_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 1; goto frame_exception_exit_1; } tmp_args_element_name_1 = const_str_digest_abf798afbed237310b8352ae4dd25846; tmp_args_element_name_2 = metapath_based_loader; frame_46b2ba739d21d8e36683e28bbbe03322->m_frame.f_lineno = 1; { PyObject *call_args[] = { tmp_args_element_name_1, tmp_args_element_name_2 }; tmp_assign_source_4 = CALL_FUNCTION_WITH_ARGS2( tmp_called_name_1, call_args ); } if ( tmp_assign_source_4 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 1; goto frame_exception_exit_1; } UPDATE_STRING_DICT1( moduledict_pyperclip$clipboards, (Nuitka_StringObject *)const_str_plain___spec__, tmp_assign_source_4 ); tmp_assign_source_5 = Py_None; UPDATE_STRING_DICT0( moduledict_pyperclip$clipboards, (Nuitka_StringObject *)const_str_plain___cached__, tmp_assign_source_5 ); tmp_assign_source_6 = const_str_plain_pyperclip; UPDATE_STRING_DICT0( moduledict_pyperclip$clipboards, (Nuitka_StringObject *)const_str_plain___package__, tmp_assign_source_6 ); tmp_name_name_1 = const_str_plain_sys; tmp_globals_name_1 = (PyObject *)moduledict_pyperclip$clipboards; tmp_locals_name_1 = Py_None; tmp_fromlist_name_1 = Py_None; tmp_level_name_1 = const_int_0; frame_46b2ba739d21d8e36683e28bbbe03322->m_frame.f_lineno = 1; tmp_assign_source_7 = IMPORT_MODULE5( tmp_name_name_1, tmp_globals_name_1, tmp_locals_name_1, tmp_fromlist_name_1, tmp_level_name_1 ); assert( tmp_assign_source_7 != NULL ); UPDATE_STRING_DICT1( moduledict_pyperclip$clipboards, (Nuitka_StringObject *)const_str_plain_sys, tmp_assign_source_7 ); tmp_name_name_2 = const_str_plain_subprocess; tmp_globals_name_2 = (PyObject *)moduledict_pyperclip$clipboards; tmp_locals_name_2 = Py_None; tmp_fromlist_name_2 = Py_None; tmp_level_name_2 = const_int_0; frame_46b2ba739d21d8e36683e28bbbe03322->m_frame.f_lineno = 2; tmp_assign_source_8 = IMPORT_MODULE5( tmp_name_name_2, tmp_globals_name_2, tmp_locals_name_2, tmp_fromlist_name_2, tmp_level_name_2 ); if ( tmp_assign_source_8 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 2; goto frame_exception_exit_1; } UPDATE_STRING_DICT1( moduledict_pyperclip$clipboards, (Nuitka_StringObject *)const_str_plain_subprocess, tmp_assign_source_8 ); tmp_name_name_3 = const_str_plain_exceptions; tmp_globals_name_3 = (PyObject *)moduledict_pyperclip$clipboards; tmp_locals_name_3 = Py_None; tmp_fromlist_name_3 = const_tuple_str_plain_PyperclipException_tuple; tmp_level_name_3 = const_int_pos_1; frame_46b2ba739d21d8e36683e28bbbe03322->m_frame.f_lineno = 3; tmp_import_name_from_1 = IMPORT_MODULE5( tmp_name_name_3, tmp_globals_name_3, tmp_locals_name_3, tmp_fromlist_name_3, tmp_level_name_3 ); if ( tmp_import_name_from_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 3; goto frame_exception_exit_1; } tmp_assign_source_9 = IMPORT_NAME( tmp_import_name_from_1, const_str_plain_PyperclipException ); Py_DECREF( tmp_import_name_from_1 ); if ( tmp_assign_source_9 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 3; goto frame_exception_exit_1; } UPDATE_STRING_DICT1( moduledict_pyperclip$clipboards, (Nuitka_StringObject *)const_str_plain_PyperclipException, tmp_assign_source_9 ); tmp_assign_source_10 = const_str_digest_b8883e772664a69f81a6c1eee0e6292f; UPDATE_STRING_DICT0( moduledict_pyperclip$clipboards, (Nuitka_StringObject *)const_str_plain_EXCEPT_MSG, tmp_assign_source_10 ); tmp_source_name_1 = GET_STRING_DICT_VALUE( moduledict_pyperclip$clipboards, (Nuitka_StringObject *)const_str_plain_sys ); if (unlikely( tmp_source_name_1 == NULL )) { tmp_source_name_1 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_sys ); } if ( tmp_source_name_1 == NULL ) { exception_type = PyExc_NameError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "sys" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 8; goto frame_exception_exit_1; } tmp_subscribed_name_1 = LOOKUP_ATTRIBUTE( tmp_source_name_1, const_str_plain_version_info ); if ( tmp_subscribed_name_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 8; goto frame_exception_exit_1; } tmp_subscript_name_1 = const_int_0; tmp_compexpr_left_1 = LOOKUP_SUBSCRIPT( tmp_subscribed_name_1, tmp_subscript_name_1 ); Py_DECREF( tmp_subscribed_name_1 ); if ( tmp_compexpr_left_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 8; goto frame_exception_exit_1; } tmp_compexpr_right_1 = const_int_pos_2; tmp_assign_source_11 = RICH_COMPARE_EQ_NORECURSE( tmp_compexpr_left_1, tmp_compexpr_right_1 ); Py_DECREF( tmp_compexpr_left_1 ); if ( tmp_assign_source_11 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 8; goto frame_exception_exit_1; } UPDATE_STRING_DICT1( moduledict_pyperclip$clipboards, (Nuitka_StringObject *)const_str_plain_PY2, tmp_assign_source_11 ); tmp_cond_value_1 = GET_STRING_DICT_VALUE( moduledict_pyperclip$clipboards, (Nuitka_StringObject *)const_str_plain_PY2 ); if (unlikely( tmp_cond_value_1 == NULL )) { tmp_cond_value_1 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_PY2 ); } if ( tmp_cond_value_1 == NULL ) { exception_type = PyExc_NameError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "PY2" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 9; goto frame_exception_exit_1; } tmp_cond_truth_1 = CHECK_IF_TRUE( tmp_cond_value_1 ); if ( tmp_cond_truth_1 == -1 ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 9; goto frame_exception_exit_1; } if ( tmp_cond_truth_1 == 1 ) { goto condexpr_true_1; } else { goto condexpr_false_1; } condexpr_true_1:; tmp_assign_source_12 = GET_STRING_DICT_VALUE( moduledict_pyperclip$clipboards, (Nuitka_StringObject *)const_str_plain_unicode ); if (unlikely( tmp_assign_source_12 == NULL )) { tmp_assign_source_12 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_unicode ); } if ( tmp_assign_source_12 == NULL ) { exception_type = PyExc_NameError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "unicode" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 9; goto frame_exception_exit_1; } goto condexpr_end_1; condexpr_false_1:; tmp_assign_source_12 = (PyObject *)&PyUnicode_Type; condexpr_end_1:; UPDATE_STRING_DICT0( moduledict_pyperclip$clipboards, (Nuitka_StringObject *)const_str_plain_text_type, tmp_assign_source_12 ); // Restore frame exception if necessary. #if 0 RESTORE_FRAME_EXCEPTION( frame_46b2ba739d21d8e36683e28bbbe03322 ); #endif popFrameStack(); assertFrameObject( frame_46b2ba739d21d8e36683e28bbbe03322 ); goto frame_no_exception_1; frame_exception_exit_1:; #if 0 RESTORE_FRAME_EXCEPTION( frame_46b2ba739d21d8e36683e28bbbe03322 ); #endif if ( exception_tb == NULL ) { exception_tb = MAKE_TRACEBACK( frame_46b2ba739d21d8e36683e28bbbe03322, exception_lineno ); } else if ( exception_tb->tb_frame != &frame_46b2ba739d21d8e36683e28bbbe03322->m_frame ) { exception_tb = ADD_TRACEBACK( exception_tb, frame_46b2ba739d21d8e36683e28bbbe03322, exception_lineno ); } // Put the previous frame back on top. popFrameStack(); // Return the error. goto module_exception_exit; frame_no_exception_1:; tmp_assign_source_13 = MAKE_FUNCTION_pyperclip$clipboards$$$function_1_init_osx_clipboard( ); UPDATE_STRING_DICT1( moduledict_pyperclip$clipboards, (Nuitka_StringObject *)const_str_plain_init_osx_clipboard, tmp_assign_source_13 ); tmp_assign_source_14 = MAKE_FUNCTION_pyperclip$clipboards$$$function_2_init_gtk_clipboard( ); UPDATE_STRING_DICT1( moduledict_pyperclip$clipboards, (Nuitka_StringObject *)const_str_plain_init_gtk_clipboard, tmp_assign_source_14 ); tmp_assign_source_15 = MAKE_FUNCTION_pyperclip$clipboards$$$function_3_init_qt_clipboard( ); UPDATE_STRING_DICT1( moduledict_pyperclip$clipboards, (Nuitka_StringObject *)const_str_plain_init_qt_clipboard, tmp_assign_source_15 ); tmp_assign_source_16 = MAKE_FUNCTION_pyperclip$clipboards$$$function_4_init_xclip_clipboard( ); UPDATE_STRING_DICT1( moduledict_pyperclip$clipboards, (Nuitka_StringObject *)const_str_plain_init_xclip_clipboard, tmp_assign_source_16 ); tmp_assign_source_17 = MAKE_FUNCTION_pyperclip$clipboards$$$function_5_init_xsel_clipboard( ); UPDATE_STRING_DICT1( moduledict_pyperclip$clipboards, (Nuitka_StringObject *)const_str_plain_init_xsel_clipboard, tmp_assign_source_17 ); tmp_assign_source_18 = MAKE_FUNCTION_pyperclip$clipboards$$$function_6_init_klipper_clipboard( ); UPDATE_STRING_DICT1( moduledict_pyperclip$clipboards, (Nuitka_StringObject *)const_str_plain_init_klipper_clipboard, tmp_assign_source_18 ); tmp_assign_source_19 = MAKE_FUNCTION_pyperclip$clipboards$$$function_7_init_no_clipboard( ); UPDATE_STRING_DICT1( moduledict_pyperclip$clipboards, (Nuitka_StringObject *)const_str_plain_init_no_clipboard, tmp_assign_source_19 ); return MOD_RETURN_VALUE( module_pyperclip$clipboards ); module_exception_exit: RESTORE_ERROR_OCCURRED( exception_type, exception_value, exception_tb ); return MOD_RETURN_VALUE( NULL ); }
34.682805
257
0.733077
Pckool
9ce5de86e6ac6e095f4687d82f7786086937ebbf
458
cpp
C++
RecursiveFibonacciSeries/main.cpp
ATomar2150/DataStructuresAndAlgorithm
b1cbea4ea4b27e396ebbada464417818d2862283
[ "Apache-2.0" ]
null
null
null
RecursiveFibonacciSeries/main.cpp
ATomar2150/DataStructuresAndAlgorithm
b1cbea4ea4b27e396ebbada464417818d2862283
[ "Apache-2.0" ]
null
null
null
RecursiveFibonacciSeries/main.cpp
ATomar2150/DataStructuresAndAlgorithm
b1cbea4ea4b27e396ebbada464417818d2862283
[ "Apache-2.0" ]
null
null
null
#include <iostream> using namespace std; //prototype int fib(int); int main() { cout<<"The first 10 Fibonaci numbers are: \n"; for(int i = 0; i < 10 ; i++) { cout<<fib(i)<<" "; cout<<endl; } return 0; } int fib(int n) { if(n <= 0) { return 0; //Base case } else if(n==1) { return 1; //Base case } else { return fib(n-1) + fib(n-2); //Recursive case } }
13.470588
52
0.458515
ATomar2150
9ce7d3251a089d238a5ce9d56f1194e273d6b2c2
10,907
cpp
C++
src/xml/SkDOM.cpp
NearTox/Skia
8b7e0616161fff86ecbd8938b90600d72b8d5c1d
[ "BSD-3-Clause" ]
null
null
null
src/xml/SkDOM.cpp
NearTox/Skia
8b7e0616161fff86ecbd8938b90600d72b8d5c1d
[ "BSD-3-Clause" ]
null
null
null
src/xml/SkDOM.cpp
NearTox/Skia
8b7e0616161fff86ecbd8938b90600d72b8d5c1d
[ "BSD-3-Clause" ]
null
null
null
/* * Copyright 2006 The Android Open Source Project * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #include "src/xml/SkDOM.h" #include <memory> #include "include/core/SkStream.h" #include "include/private/SkTo.h" #include "src/xml/SkXMLParser.h" #include "src/xml/SkXMLWriter.h" bool SkXMLParser::parse(const SkDOM& dom, const SkDOMNode* node) { const char* elemName = dom.getName(node); if (this->startElement(elemName)) { return false; } SkDOM::AttrIter iter(dom, node); const char *name, *value; while ((name = iter.next(&value)) != nullptr) { if (this->addAttribute(name, value)) { return false; } } if ((node = dom.getFirstChild(node)) != nullptr) { do { if (!this->parse(dom, node)) { return false; } } while ((node = dom.getNextSibling(node)) != nullptr); } return !this->endElement(elemName); } ///////////////////////////////////////////////////////////////////////// struct SkDOMAttr { const char* fName; const char* fValue; }; struct SkDOMNode { const char* fName; SkDOMNode* fFirstChild; SkDOMNode* fNextSibling; SkDOMAttr* fAttrs; uint16_t fAttrCount; uint8_t fType; uint8_t fPad; const SkDOMAttr* attrs() const { return fAttrs; } SkDOMAttr* attrs() { return fAttrs; } }; ///////////////////////////////////////////////////////////////////////// #define kMinChunkSize 4096 SkDOM::SkDOM() : fAlloc(kMinChunkSize), fRoot(nullptr) {} SkDOM::~SkDOM() {} const SkDOM::Node* SkDOM::getRootNode() const { return fRoot; } const SkDOM::Node* SkDOM::getFirstChild(const Node* node, const char name[]) const { SkASSERT(node); const Node* child = node->fFirstChild; if (name) { for (; child != nullptr; child = child->fNextSibling) { if (!strcmp(name, child->fName)) { break; } } } return child; } const SkDOM::Node* SkDOM::getNextSibling(const Node* node, const char name[]) const { SkASSERT(node); const Node* sibling = node->fNextSibling; if (name) { for (; sibling != nullptr; sibling = sibling->fNextSibling) { if (!strcmp(name, sibling->fName)) { break; } } } return sibling; } SkDOM::Type SkDOM::getType(const Node* node) const { SkASSERT(node); return (Type)node->fType; } const char* SkDOM::getName(const Node* node) const { SkASSERT(node); return node->fName; } const char* SkDOM::findAttr(const Node* node, const char name[]) const { SkASSERT(node); const Attr* attr = node->attrs(); const Attr* stop = attr + node->fAttrCount; while (attr < stop) { if (!strcmp(attr->fName, name)) { return attr->fValue; } attr += 1; } return nullptr; } ///////////////////////////////////////////////////////////////////////////////////// const SkDOM::Attr* SkDOM::getFirstAttr(const Node* node) const { return node->fAttrCount ? node->attrs() : nullptr; } const SkDOM::Attr* SkDOM::getNextAttr(const Node* node, const Attr* attr) const { SkASSERT(node); if (attr == nullptr) { return nullptr; } return (attr - node->attrs() + 1) < node->fAttrCount ? attr + 1 : nullptr; } const char* SkDOM::getAttrName(const Node* node, const Attr* attr) const { SkASSERT(node); SkASSERT(attr); return attr->fName; } const char* SkDOM::getAttrValue(const Node* node, const Attr* attr) const { SkASSERT(node); SkASSERT(attr); return attr->fValue; } ///////////////////////////////////////////////////////////////////////////////////// SkDOM::AttrIter::AttrIter(const SkDOM&, const SkDOM::Node* node) { SkASSERT(node); fAttr = node->attrs(); fStop = fAttr + node->fAttrCount; } const char* SkDOM::AttrIter::next(const char** value) { const char* name = nullptr; if (fAttr < fStop) { name = fAttr->fName; if (value) *value = fAttr->fValue; fAttr += 1; } return name; } ////////////////////////////////////////////////////////////////////////////// #include "include/private/SkTDArray.h" #include "src/xml/SkXMLParser.h" static char* dupstr(SkArenaAlloc* chunk, const char src[]) { SkASSERT(chunk && src); size_t len = strlen(src); char* dst = chunk->makeArrayDefault<char>(len + 1); memcpy(dst, src, len + 1); return dst; } class SkDOMParser : public SkXMLParser { public: SkDOMParser(SkArenaAllocWithReset* chunk) : SkXMLParser(&fParserError), fAlloc(chunk) { fAlloc->reset(); fRoot = nullptr; fLevel = 0; fNeedToFlush = true; } SkDOM::Node* getRoot() const { return fRoot; } SkXMLParserError fParserError; protected: void flushAttributes() { SkASSERT(fLevel > 0); int attrCount = fAttrs.count(); SkDOMAttr* attrs = fAlloc->makeArrayDefault<SkDOMAttr>(attrCount); SkDOM::Node* node = fAlloc->make<SkDOM::Node>(); node->fName = fElemName; node->fFirstChild = nullptr; node->fAttrCount = SkToU16(attrCount); node->fAttrs = attrs; node->fType = fElemType; if (fRoot == nullptr) { node->fNextSibling = nullptr; fRoot = node; } else { // this adds siblings in reverse order. gets corrected in onEndElement() SkDOM::Node* parent = fParentStack.top(); SkASSERT(fRoot && parent); node->fNextSibling = parent->fFirstChild; parent->fFirstChild = node; } *fParentStack.push() = node; sk_careful_memcpy(node->attrs(), fAttrs.begin(), attrCount * sizeof(SkDOM::Attr)); fAttrs.reset(); } bool onStartElement(const char elem[]) override { this->startCommon(elem, SkDOM::kElement_Type); return false; } bool onAddAttribute(const char name[], const char value[]) override { SkDOM::Attr* attr = fAttrs.append(); attr->fName = dupstr(fAlloc, name); attr->fValue = dupstr(fAlloc, value); return false; } bool onEndElement(const char elem[]) override { --fLevel; if (fNeedToFlush) this->flushAttributes(); fNeedToFlush = false; SkDOM::Node* parent; fParentStack.pop(&parent); SkDOM::Node* child = parent->fFirstChild; SkDOM::Node* prev = nullptr; while (child) { SkDOM::Node* next = child->fNextSibling; child->fNextSibling = prev; prev = child; child = next; } parent->fFirstChild = prev; return false; } bool onText(const char text[], int len) override { SkString str(text, len); this->startCommon(str.c_str(), SkDOM::kText_Type); this->SkDOMParser::onEndElement(str.c_str()); return false; } private: void startCommon(const char elem[], SkDOM::Type type) { if (fLevel > 0 && fNeedToFlush) { this->flushAttributes(); } fNeedToFlush = true; fElemName = dupstr(fAlloc, elem); fElemType = type; ++fLevel; } SkTDArray<SkDOM::Node*> fParentStack; SkArenaAllocWithReset* fAlloc; SkDOM::Node* fRoot; bool fNeedToFlush; // state needed for flushAttributes() SkTDArray<SkDOM::Attr> fAttrs; char* fElemName; SkDOM::Type fElemType; int fLevel; }; const SkDOM::Node* SkDOM::build(SkStream& docStream) { SkDOMParser parser(&fAlloc); if (!parser.parse(docStream)) { SkDEBUGCODE(SkDebugf("xml parse error, line %d\n", parser.fParserError.getLineNumber());) fRoot = nullptr; fAlloc.reset(); return nullptr; } fRoot = parser.getRoot(); return fRoot; } /////////////////////////////////////////////////////////////////////////// static void walk_dom(const SkDOM& dom, const SkDOM::Node* node, SkXMLParser* parser) { const char* elem = dom.getName(node); if (dom.getType(node) == SkDOM::kText_Type) { SkASSERT(dom.countChildren(node) == 0); parser->text(elem, SkToInt(strlen(elem))); return; } parser->startElement(elem); SkDOM::AttrIter iter(dom, node); const char* name; const char* value; while ((name = iter.next(&value)) != nullptr) parser->addAttribute(name, value); node = dom.getFirstChild(node, nullptr); while (node) { walk_dom(dom, node, parser); node = dom.getNextSibling(node, nullptr); } parser->endElement(elem); } const SkDOM::Node* SkDOM::copy(const SkDOM& dom, const SkDOM::Node* node) { SkDOMParser parser(&fAlloc); walk_dom(dom, node, &parser); fRoot = parser.getRoot(); return fRoot; } SkXMLParser* SkDOM::beginParsing() { SkASSERT(!fParser); fParser = std::make_unique<SkDOMParser>(&fAlloc); return fParser.get(); } const SkDOM::Node* SkDOM::finishParsing() { SkASSERT(fParser); fRoot = fParser->getRoot(); fParser.reset(); return fRoot; } ////////////////////////////////////////////////////////////////////////// int SkDOM::countChildren(const Node* node, const char elem[]) const { int count = 0; node = this->getFirstChild(node, elem); while (node) { count += 1; node = this->getNextSibling(node, elem); } return count; } ////////////////////////////////////////////////////////////////////////// #include "include/utils/SkParse.h" bool SkDOM::findS32(const Node* node, const char name[], int32_t* value) const { const char* vstr = this->findAttr(node, name); return vstr && SkParse::FindS32(vstr, value); } bool SkDOM::findScalars(const Node* node, const char name[], SkScalar value[], int count) const { const char* vstr = this->findAttr(node, name); return vstr && SkParse::FindScalars(vstr, value, count); } bool SkDOM::findHex(const Node* node, const char name[], uint32_t* value) const { const char* vstr = this->findAttr(node, name); return vstr && SkParse::FindHex(vstr, value); } bool SkDOM::findBool(const Node* node, const char name[], bool* value) const { const char* vstr = this->findAttr(node, name); return vstr && SkParse::FindBool(vstr, value); } int SkDOM::findList(const Node* node, const char name[], const char list[]) const { const char* vstr = this->findAttr(node, name); return vstr ? SkParse::FindList(vstr, list) : -1; } bool SkDOM::hasAttr(const Node* node, const char name[], const char value[]) const { const char* vstr = this->findAttr(node, name); return vstr && !strcmp(vstr, value); } bool SkDOM::hasS32(const Node* node, const char name[], int32_t target) const { const char* vstr = this->findAttr(node, name); int32_t value; return vstr && SkParse::FindS32(vstr, &value) && value == target; } bool SkDOM::hasScalar(const Node* node, const char name[], SkScalar target) const { const char* vstr = this->findAttr(node, name); SkScalar value; return vstr && SkParse::FindScalar(vstr, &value) && value == target; } bool SkDOM::hasHex(const Node* node, const char name[], uint32_t target) const { const char* vstr = this->findAttr(node, name); uint32_t value; return vstr && SkParse::FindHex(vstr, &value) && value == target; } bool SkDOM::hasBool(const Node* node, const char name[], bool target) const { const char* vstr = this->findAttr(node, name); bool value; return vstr && SkParse::FindBool(vstr, &value) && value == target; }
25.969048
97
0.620886
NearTox
9cea0b11c1367fa698aedbdf3afc9c9efa138669
10,714
cpp
C++
Source/General/Misc/DynamicObject.cpp
paintdream/paintsnow
3a1cbc9e571eaa2e62a3a2d60f75817b45f0c781
[ "MIT" ]
null
null
null
Source/General/Misc/DynamicObject.cpp
paintdream/paintsnow
3a1cbc9e571eaa2e62a3a2d60f75817b45f0c781
[ "MIT" ]
null
null
null
Source/General/Misc/DynamicObject.cpp
paintdream/paintsnow
3a1cbc9e571eaa2e62a3a2d60f75817b45f0c781
[ "MIT" ]
null
null
null
#include "DynamicObject.h" #include <sstream> using namespace PaintsNow; DynamicUniqueAllocator::DynamicUniqueAllocator() {} DynamicInfo::Field::Field() : controller(nullptr) { reflectable = 0; offset = 0; } IReflectObject* DynamicInfo::Create() const { assert(Math::Alignment(sizeof(DynamicObject)) >= sizeof(size_t)); size_t s = sizeof(DynamicObject) + size; char* buffer = new char[s]; memset(buffer, 0, s); DynamicObject* proxy = new (buffer) DynamicObject(const_cast<DynamicInfo*>(this)); return proxy; } const DynamicInfo::Field* DynamicInfo::operator [] (const String& key) const { std::map<String, uint32_t>::const_iterator it = mapNameToField.find(key); return it == mapNameToField.end() ? (DynamicInfo::Field*)nullptr : &fields[it->second]; } DynamicObject::DynamicObject(DynamicInfo* info) : dynamicInfo(info) { std::vector<DynamicInfo::Field>& fields = dynamicInfo->fields; char* base = (char*)this + sizeof(*this); for (size_t i = 0; i < fields.size(); i++) { DynamicInfo::Field& field = fields[i]; char* ptr = base + field.offset; if (field.type->GetAllocator() == dynamicInfo->GetAllocator()) { // dynamic-created class? assert(field.controller == nullptr); new (ptr) DynamicObject(dynamicInfo); } else if (field.controller != nullptr) { field.controller->Creator(ptr); } } } DynamicObject::~DynamicObject() { std::vector<DynamicInfo::Field>& fields = dynamicInfo->fields; char* base = (char*)this + sizeof(*this); for (size_t i = 0; i < fields.size(); i++) { DynamicInfo::Field& field = fields[i]; char* ptr = base + field.offset; if (field.type->GetAllocator() == dynamicInfo->GetAllocator()) { assert(field.controller == nullptr); DynamicObject* proxy = reinterpret_cast<DynamicObject*>(ptr); proxy->~DynamicObject(); } else if (field.controller != nullptr) { field.controller->Deletor(ptr); } } #ifdef _DEBUG dynamicInfo = nullptr; #endif } void DynamicObject::Destroy() { // call destructor manually this->~DynamicObject(); delete[] (char*)this; } DynamicVector::Iterator::Iterator(DynamicVector* vec) : base(vec), i(0) {} void DynamicVector::Iterator::Initialize(size_t c) { i = 0; base->Reinit(base->unique, base->memController, c, base->reflectable); } size_t DynamicVector::Iterator::GetTotalCount() const { return base->count; } bool DynamicVector::Iterator::IsElementBasicObject() const { return true; } Unique DynamicVector::Iterator::GetElementUnique() const { return base->unique; } Unique DynamicVector::Iterator::GetElementReferenceUnique() const { return base->unique; } static IReflectObject dummyObject((int)0); const IReflectObject& DynamicVector::Iterator::GetElementPrototype() const { return base->count == 0 || !base->reflectable ? dummyObject : *reinterpret_cast<const IReflectObject*>(base->buffer); } void* DynamicVector::Iterator::Get() { return (char*)base->buffer + (i - 1) * base->unique->GetSize(); } bool DynamicVector::Iterator::Next() { if (i >= base->count) { return false; } i++; return true; } IIterator* DynamicVector::Iterator::New() const { return new DynamicVector::Iterator(base); } void DynamicVector::Iterator::Attach(void* p) { base = reinterpret_cast<DynamicVector*>(p); i = 0; } bool DynamicVector::Iterator::IsLayoutLinear() const { return true; } bool DynamicVector::Iterator::IsLayoutPinned() const { return false; } void* DynamicVector::Iterator::GetHost() const { return base; } TObject<IReflect>& DynamicObject::operator () (IReflect& reflect) { reflect.Class(*this, dynamicInfo, dynamicInfo->GetName().c_str(), "PaintsNow", nullptr); if (reflect.IsReflectProperty()) { char* base = (char*)this + sizeof(*this); std::vector<DynamicInfo::Field>& fields = dynamicInfo->fields; for (size_t i = 0; i < fields.size(); i++) { DynamicInfo::Field& field = fields[i]; char* ptr = base + field.offset; IReflectObject* reflectObject = reinterpret_cast<IReflectObject*>(ptr); if (field.type == UniqueType<DynamicVector>::Get()) { DynamicVector::Iterator iterator(static_cast<DynamicVector*>(reflectObject)); reflect.Property(iterator, field.type, field.type, field.name.c_str(), (char*)this, ptr, nullptr); } else { reflect.Property(field.reflectable ? dummyObject : *reflectObject, field.type, field.type, field.name.c_str(), (char*)(this), ptr, nullptr); } } } return *this; } DynamicInfo* DynamicUniqueAllocator::Create(const String& name, size_t size) { assert(false); return nullptr; } DynamicInfo* DynamicUniqueAllocator::Get(const String& name) { std::map<String, DynamicInfo>::iterator it = mapType.find(name); return it == mapType.end() ? nullptr : &it->second; } DynamicInfo* DynamicUniqueAllocator::AllocFromDescriptor(const String& name, const std::vector<DynamicInfo::Field>& descriptors) { // Compose new name String desc; String allNames; size_t maxSize = (size_t)-1; std::vector<DynamicInfo::Field> fields = descriptors; size_t lastOffset = 0; size_t maxAlignment = sizeof(DynamicObject); for (size_t k = 0; k < fields.size(); k++) { if (k != 0) desc += ", "; DynamicInfo::Field& p = fields[k]; Unique info = p.type; maxSize = Math::Min(maxSize, info->GetSize()); desc += p.name + ": " + info->GetName(); allNames += info->GetName(); size_t s = Math::Alignment(info->GetSize()); maxAlignment = Math::Max(maxAlignment, s); while (lastOffset != 0 && Math::Alignment(lastOffset) < s) { lastOffset += Math::Alignment(lastOffset); } p.offset = lastOffset; lastOffset += info->GetSize(); } std::stringstream ss; ss << name.c_str() << "{" << descriptors.size() << "-" << (size_t)HashBuffer(allNames.c_str(), allNames.size()) << "-" << (size_t)HashBuffer(desc.c_str(), desc.size()) << "}"; String newName = StdToUtf8(ss.str()); std::map<String, DynamicInfo>::iterator it = mapType.find(newName); if (it != mapType.end()) { // assert(false); // Performance warning: should check it before calling me! return &it->second; } else { DynamicInfo& info = mapType[newName]; info.SetAllocator(this); info.SetName(newName); std::sort(fields.begin(), fields.end()); for (size_t i = 0; i < fields.size(); i++) { info.mapNameToField[fields[i].name] = verify_cast<uint32_t>(i); } while (lastOffset != 0 && Math::Alignment(lastOffset) < maxAlignment) { lastOffset += Math::Alignment(lastOffset); } info.SetSize(fields.empty() ? sizeof(size_t) : lastOffset); std::swap(info.fields, fields); return &info; } } DynamicInfo* DynamicObject::GetDynamicInfo() const { return dynamicInfo; } DynamicObject& DynamicObject::operator = (const DynamicObject& rhs) { if (dynamicInfo == rhs.dynamicInfo && this != &rhs) { std::vector<DynamicInfo::Field>& fields = dynamicInfo->fields; const char* rbase = (const char*)&rhs + sizeof(*this); for (size_t i = 0; i < fields.size(); i++) { DynamicInfo::Field& field = fields[i]; Set(field, rbase); } } return *this; } void DynamicObject::Set(const DynamicInfo::Field& field, const void* value) { char* buffer = (char*)this + sizeof(*this) + field.offset; if (buffer == value) return; if (field.type->GetAllocator() == dynamicInfo->GetAllocator()) { const DynamicObject* src = reinterpret_cast<const DynamicObject*>(value); DynamicObject* dst = reinterpret_cast<DynamicObject*>(buffer); *dst = *src; } else if (field.controller != nullptr) { field.controller->Assigner(buffer, value); } else { memcpy(buffer, value, field.type->GetSize()); } } void* DynamicObject::Get(const DynamicInfo::Field& field) const { return (char*)this + sizeof(*this) + field.offset; } DynamicObjectWrapper::DynamicObjectWrapper(DynamicUniqueAllocator& allocator) : uniqueAllocator(allocator), dynamicObject(nullptr) {} DynamicObjectWrapper::~DynamicObjectWrapper() { if (dynamicObject != nullptr) { dynamicObject->Destroy(); } } TObject<IReflect>& DynamicObjectWrapper::operator () (IReflect& reflect) { BaseClass::operator () (reflect); return *this; } DynamicVector::DynamicVector(Unique type, DynamicInfo::MemController* mc, size_t c, bool r) : unique(type), memController(mc), reflectable(r), count(verify_cast<uint32_t>(c)), buffer(nullptr) { Init(); } void DynamicVector::Init() { size_t size = unique->GetSize(); if (count != 0) { assert(buffer == nullptr); buffer = new char[size * count]; // initialize them if (memController != nullptr) { char* base = reinterpret_cast<char*>(buffer); for (size_t k = 0; k < count; k++) { memController->Creator(base + k * size); } } } } DynamicVector::~DynamicVector() { Cleanup(); } void DynamicVector::Reinit(Unique u, DynamicInfo::MemController* mc, size_t n, bool r) { Cleanup(); reflectable = r; unique = u; memController = mc; count = n; Init(); } void DynamicVector::Set(size_t i , const void* value) { memController->Assigner(reinterpret_cast<char*>(buffer) + i * unique->GetSize(), value); } void* DynamicVector::Get(size_t i) const { return reinterpret_cast<char*>(buffer) + i * unique->GetSize(); } void DynamicVector::Cleanup() { if (buffer != nullptr) { if (memController != nullptr) { size_t size = unique->GetSize(); char* base = reinterpret_cast<char*>(buffer); for (size_t k = 0; k < count; k++) { memController->Deletor(base + k * size); } } delete[] reinterpret_cast<char*>(buffer); buffer = nullptr; } } DynamicVector& DynamicVector::operator = (const DynamicVector& vec) { if (this != &vec) { Cleanup(); // copy info assert(buffer == nullptr); unique = vec.unique; memController = vec.memController; count = vec.count; size_t size = unique->GetSize(); if (count != 0) { buffer = new char[size * count]; // initialize them if (memController != nullptr) { char* base = reinterpret_cast<char*>(buffer); const char* src = reinterpret_cast<const char*>(vec.buffer); for (size_t k = 0; k < count; k++) { memController->Creator(base + k * size); memController->Assigner(base + k * size, src + k * size); } } } } return *this; } void DynamicVector::VectorCreator(void* buffer) { new (buffer) DynamicVector(UniqueType<int>::Get(), nullptr, 0, false); } void DynamicVector::VectorDeletor(void* buffer) { reinterpret_cast<DynamicVector*>(buffer)->~DynamicVector(); } void DynamicVector::VectorAssigner(void* dst, const void* src) { *reinterpret_cast<DynamicVector*>(dst) = *reinterpret_cast<const DynamicVector*>(src); } DynamicInfo::MemController& DynamicVector::GetVectorController() { static DynamicInfo::MemController controller = { &DynamicVector::VectorCreator, &DynamicVector::VectorDeletor, &DynamicVector::VectorAssigner, }; return controller; }
28.801075
193
0.688445
paintdream
9ceb662e99ac75757164261fd45ad9a95c30f435
10,930
cpp
C++
src/python/gameboycore_module.cpp
nnarain/gameboycore-python
f6dde95a5e51f38bd1037abcc2f569cf254bf9de
[ "MIT" ]
5
2016-12-29T01:48:05.000Z
2020-04-06T18:19:39.000Z
src/python/gameboycore_module.cpp
nnarain/gameboycore-python
f6dde95a5e51f38bd1037abcc2f569cf254bf9de
[ "MIT" ]
48
2016-12-02T03:49:56.000Z
2019-08-23T04:30:55.000Z
src/python/gameboycore_module.cpp
nnarain/gameboycore-python
f6dde95a5e51f38bd1037abcc2f569cf254bf9de
[ "MIT" ]
2
2017-01-03T22:25:43.000Z
2021-02-05T08:30:45.000Z
/** \file gameboycore_python.cpp \brief Gameboy Core Python Wrapper \author Natesh Narain <nnaraindev@gmail.com> \date Dec 1 2016 */ #include "gameboycore_python.h" #include <gameboycore/memorymap.h> #include <pybind11/pybind11.h> #include <pybind11/stl_bind.h> PYBIND11_MAKE_OPAQUE(GameboyCorePython::ByteList); PYBIND11_MAKE_OPAQUE(GameboyCorePython::PixelList); PYBIND11_MAKE_OPAQUE(GameboyCorePython::SpriteList); PYBIND11_MODULE(gameboycore, m) { namespace py = pybind11; m.doc() = R"pbdoc( GameboyCore Python API ---------------------- .. currentmodule:: gameboycore .. autosummary:: :toctree: _generate GameboyCore JoypadKey KeyAction Pixel Sprite ColorTheme )pbdoc"; // STL container types py::bind_vector<GameboyCorePython::ByteList>(m, "ByteList"); py::bind_vector<GameboyCorePython::PixelList>(m, "PixelList"); py::bind_vector<GameboyCorePython::SpriteList>(m, "SpriteList"); // GPU Pixel py::class_<gb::Pixel>(m, "Pixel", R"pbdoc(Pixel, contained in scanlines)pbdoc") .def_readwrite("r", &gb::Pixel::r, R"pbdoc(red)pbdoc") .def_readwrite("g", &gb::Pixel::g, R"pbdoc(green)pbdoc") .def_readwrite("b", &gb::Pixel::b, R"pbdoc(blue)pbdoc"); // Joypad enums py::enum_<gb::Joy::Key>(m, "JoypadKey", R"pbdoc(Joypad Key)pbdoc") .value("KEY_RIGHT", gb::Joy::Key::RIGHT) .value("KEY_LEFT", gb::Joy::Key::LEFT) .value("KEY_UP", gb::Joy::Key::UP) .value("KEY_DOWN", gb::Joy::Key::DOWN) .value("KEY_A", gb::Joy::Key::A) .value("KEY_B", gb::Joy::Key::B) .value("KEY_SELECT", gb::Joy::Key::SELECT) .value("KEY_START", gb::Joy::Key::START); // Joypad Action enums py::enum_<GameboyCorePython::KeyAction>(m, "KeyAction", R"pbdoc(Joypad Key Event)pbdoc") .value("ACTION_PRESS", GameboyCorePython::KeyAction::PRESS) .value("ACTION_RELEASE", GameboyCorePython::KeyAction::RELEASE); // Sprites py::class_<gb::Sprite>(m, "Sprite", R"pbdoc(OAM Sprite)pbdoc") .def_readwrite("y", &gb::Sprite::y, R"pbdoc(Sprite y position)pbdoc") .def_readwrite("x", &gb::Sprite::x, R"pbdoc(Sprite x position)pbdoc") .def_readwrite("tile", &gb::Sprite::tile, R"pbdoc(Sprite tile code)pbdoc") .def_readwrite("attr", &gb::Sprite::attr, R"pbdoc(Sprite attributes)pbdoc") .def_readwrite("height", &gb::Sprite::height, R"pbdoc(Sprite height (8 or 16 px))pbdoc"); // Premade color themes py::enum_<gb::GameboyCore::ColorTheme>(m, "ColorTheme", R"pbdoc(Pre-configured color themes)pbdoc") .value("DEFAULT", gb::GameboyCore::ColorTheme::DEFAULT) .value("GOLD", gb::GameboyCore::ColorTheme::GOLD) .value("GREEN", gb::GameboyCore::ColorTheme::GREEN); // CPU Status py::class_<gb::CPU::Status>(m, "CPUStatus", R"pbdoc(CPU Registers)pbdoc") .def_readonly("a", &gb::CPU::Status::a, R"pbdoc(A register (general purpose))pbdoc") .def_readonly("f", &gb::CPU::Status::f, R"pbdoc(F register (flags))pbdoc") .def_readonly("af", &gb::CPU::Status::af, R"pbdoc(AF register (Combined A and F registers))pbdoc") .def_readonly("b", &gb::CPU::Status::b, R"pbdoc(B register (general purpose))pbdoc") .def_readonly("c", &gb::CPU::Status::c, R"pbdoc(C register (general purpose))pbdoc") .def_readonly("bc", &gb::CPU::Status::bc, R"pbdoc(BC register (Combined B and C registers))pbdoc") .def_readonly("d", &gb::CPU::Status::d, R"pbdoc(D register (general purpose))pbdoc") .def_readonly("e", &gb::CPU::Status::e, R"pbdoc(E register (general purpose))pbdoc") .def_readonly("de", &gb::CPU::Status::de, R"pbdoc(DE register (Combined D and E registers))pbdoc") .def_readonly("h", &gb::CPU::Status::h, R"pbdoc(H register (general purpose))pbdoc") .def_readonly("l", &gb::CPU::Status::l, R"pbdoc(L register (general purpose))pbdoc") .def_readonly("hl", &gb::CPU::Status::hl, R"pbdoc(HL register (Combined H and L registers))pbdoc") .def_readonly("pc", &gb::CPU::Status::pc, R"pbdoc(PC register (Program counter))pbdoc") .def_readonly("sp", &gb::CPU::Status::sp, R"pbdoc(SP register (Stack pointer))pbdoc") .def_readonly("halt", &gb::CPU::Status::halt, R"pbdoc(Flag indicating CPU halt)pbdoc") .def_readonly("stopped", &gb::CPU::Status::stopped, R"pbdoc(Flag indicating CPU is stopped)pbdoc") .def_readonly("ime", &gb::CPU::Status::ime, R"pbdoc(Master interrupts enabled flag)pbdoc") .def_readonly("enabled_interrupts", &gb::CPU::Status::enabled_interrupts, R"pbdoc(Bit field for enabled interrupts)pbdoc") .def(py::pickle( [](const gb::CPU::Status& cpu) { return py::make_tuple(cpu.a, cpu.f, cpu.af, cpu.b, cpu.c, cpu.bc, cpu.d, cpu.e, cpu.de, cpu.h, cpu.l, cpu.hl, cpu.pc, cpu.sp, cpu.halt, cpu.stopped, cpu.ime, cpu.enabled_interrupts); }, [](py::tuple t) { gb::CPU::Status cpu; cpu.a = t[0].cast<uint8_t>(); cpu.f = t[1].cast<uint8_t>(); cpu.af = t[2].cast<uint16_t>(); cpu.b = t[3].cast<uint8_t>(); cpu.c = t[4].cast<uint8_t>(); cpu.bc = t[5].cast<uint16_t>(); cpu.d = t[6].cast<uint8_t>(); cpu.e = t[7].cast<uint8_t>(); cpu.de = t[8].cast<uint16_t>(); cpu.h = t[9].cast<uint8_t>(); cpu.l = t[10].cast<uint8_t>(); cpu.hl = t[11].cast<uint16_t>(); cpu.pc = t[12].cast<uint16_t>(); cpu.sp = t[13].cast<uint16_t>(); cpu.halt = t[14].cast<bool>(); cpu.stopped = t[15].cast<bool>(); cpu.ime = t[16].cast<bool>(); cpu.enabled_interrupts = t[17].cast<bool>(); return cpu; } )); // Memory map enums py::enum_<gb::memorymap::Locations>(m, "MemoryLocations", R"pbdoc()pbdoc") .value("INTERRUPT_HANDLER_VBLANK", gb::memorymap::INTERRUPT_HANDLER_VBLANK) .value("INTERRUPT_HANDLER_LCDSTAT", gb::memorymap::INTERRUPT_HANDLER_LCDSTAT) .value("INTERRUPT_HANDLER_TIMER", gb::memorymap::INTERRUPT_HANDLER_TIMER) .value("INTERRUPT_HANDLER_SERIAL", gb::memorymap::INTERRUPT_HANDLER_SERIAL) .value("INTERRUPT_HANDLER_JOYPAD", gb::memorymap::INTERRUPT_HANDLER_JOYPAD) .value("PROGRAM_START", gb::memorymap::PROGRAM_START) .value("BG_MAP_DATA_1_START", gb::memorymap::BG_MAP_DATA_1_START) .value("BG_MAP_DATA_1_END", gb::memorymap::BG_MAP_DATA_1_END) .value("BG_MAP_DATA_2_START", gb::memorymap::BG_MAP_DATA_2_START) .value("BG_MAP_DATA_2_END", gb::memorymap::BG_MAP_DATA_2_END) .value("JOYPAD_REGISTER", gb::memorymap::JOYPAD_REGISTER) .value("LCDC_REGISTER", gb::memorymap::LCDC_REGISTER) .value("LCD_STAT_REGISTER", gb::memorymap::LCD_STAT_REGISTER) .value("SCY", gb::memorymap::SCY_REGISTER) .value("SCX", gb::memorymap::SCX_REGISTER) .value("LY", gb::memorymap::LY_REGISTER) .value("LYC", gb::memorymap::LYC_REGISTER) .value("INTERRUPT_ENABLE", gb::memorymap::INTERRUPT_ENABLE) .value("INTERRUPT_FLAG", gb::memorymap::INTERRUPT_FLAG); // GameboyCore py::class_<GameboyCorePython>(m, "GameboyCore", R"pbdoc(Instance of a GameboyCore)pbdoc") .def(py::init<>()) .def("open", &GameboyCorePython::open, R"pbdoc(Load the specified ROM file)pbdoc") .def("input", &GameboyCorePython::input, R"pbdoc(Joypad input)pbdoc") .def("update", &GameboyCorePython::update, R"pbdoc(Run n steps of the CPU)pbdoc") .def("emulate_frame", &GameboyCorePython::emulateFrame, R"pbdoc(Emulate a single frame)pbdoc") .def("read_memory", &GameboyCorePython::readMemory, R"pbdoc(Read a value from memory)pbdoc") .def("write_memory", &GameboyCorePython::writeMemory, R"pbdoc(Write a value to memory)pbdoc") .def("register_scanline_callback", &GameboyCorePython::registerScanlineCallback, R"pbdoc(Register a callback for scanlines)pbdoc") .def("register_vblank_callback", &GameboyCorePython::registerVBlankCallback, R"pbdoc(Register a callback for vblank)pbdoc") .def("register_audio_callback", &GameboyCorePython::registerAudioCallback, R"pbdoc(Register a callbackf for audio samples)pbdoc") .def("get_cpu_state", &GameboyCorePython::getCPUStatus, R"pbdoc(Get the current CPU state)pbdoc") .def("get_background_hash", &GameboyCorePython::getBackgroundHash, R"pbdoc(Get a hash of the background tile map)pbdoc") .def("get_background_tilemap", &GameboyCorePython::getBackgroundTileMap, R"pbdoc(Get the background tile map)pbdoc") .def("get_sprite_cache", &GameboyCorePython::getSpriteCache, R"pbdoc(Get OAM sprites)pbdoc") .def("set_color_theme", &GameboyCorePython::setColorTheme, R"pbdoc(Set a pre-configured color theme)pbdoc") .def("get_battery_ram", &GameboyCorePython::getBatteryRam, R"pbdoc(Get battery RAM)pbdoc") .def("set_battery_ram", &GameboyCorePython::setBatteryRam, R"pbdoc(Set battery RAM)pbdoc"); #ifdef VERSION_INFO m.attr("__version__") = VERSION_INFO; #else m.attr("__version__") = "dev"; #endif }
60.054945
143
0.551235
nnarain
9cebea0dee0885f116a248e3e323c7bd873cd6ee
2,476
hh
C++
dune/gdt/local/functionals/interfaces.hh
TiKeil/dune-gdt
25c8b987cc07a4b8b966c1a07ea21b78dba7852f
[ "BSD-2-Clause" ]
null
null
null
dune/gdt/local/functionals/interfaces.hh
TiKeil/dune-gdt
25c8b987cc07a4b8b966c1a07ea21b78dba7852f
[ "BSD-2-Clause" ]
null
null
null
dune/gdt/local/functionals/interfaces.hh
TiKeil/dune-gdt
25c8b987cc07a4b8b966c1a07ea21b78dba7852f
[ "BSD-2-Clause" ]
null
null
null
// This file is part of the dune-gdt project: // https://github.com/dune-community/dune-gdt // Copyright 2010-2018 dune-gdt developers and contributors. All rights reserved. // License: Dual licensed as BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) // or GPL-2.0+ (http://opensource.org/licenses/gpl-license) // with "runtime exception" (http://www.dune-project.org/license.html) // Authors: // Felix Schindler (2015 - 2017) // Rene Milk (2016 - 2018) // Tobias Leibner (2016 - 2017) #ifndef DUNE_GDT_LOCAL_FUNCTIONALS_INTERFACES_HH #define DUNE_GDT_LOCAL_FUNCTIONALS_INTERFACES_HH #include <vector> #include <dune/common/dynvector.hh> #include <dune/xt/common/crtp.hh> #include <dune/xt/functions/type_traits.hh> #include <dune/xt/grid/type_traits.hh> #include <dune/gdt/spaces/basefunctionset/interface.hh> namespace Dune { namespace GDT { template <class TestBase, class Field = typename TestBase::RangeFieldType> class LocalVolumeFunctionalInterface { static_assert(XT::Functions::is_localfunction_set<TestBase>::value, ""); public: typedef TestBase TestBaseType; typedef Field FieldType; virtual ~LocalVolumeFunctionalInterface() = default; virtual void apply(const TestBaseType& test_basis, DynamicVector<FieldType>& ret) const = 0; DynamicVector<FieldType> apply(const TestBaseType& test_basis) const { DynamicVector<FieldType> ret(test_basis.size(), 0.); apply(test_basis, ret); return ret; } }; // class LocalFunctionalInterface template <class TestBase, class Intersection, class Field = typename TestBase::RangeFieldType> class LocalFaceFunctionalInterface { static_assert(XT::Functions::is_localfunction_set<TestBase>::value, ""); static_assert(XT::Grid::is_intersection<Intersection>::value, ""); public: typedef TestBase TestBaseType; typedef Intersection IntersectionType; typedef Field FieldType; virtual ~LocalFaceFunctionalInterface() = default; virtual void apply(const TestBaseType& test_basis, const IntersectionType& intersection, DynamicVector<FieldType>& ret) const = 0; DynamicVector<FieldType> apply(const TestBaseType& test_basis, const IntersectionType& intersection) const { DynamicVector<FieldType> ret(test_basis.size(), 0.); apply(test_basis, intersection, ret); return ret; } }; // class LocalFaceFunctionalInterface } // namespace GDT } // namespace Dune #endif // DUNE_GDT_LOCAL_FUNCTIONALS_INTERFACES_HH
30.195122
119
0.755654
TiKeil
9cee2d465a71ce5ac04a0361fddf5c12d4592b0c
5,053
cc
C++
wrspice/src/analysis/dctsetp.cc
wrcad/xictools
f46ba6d42801426739cc8b2940a809b74f1641e2
[ "Apache-2.0" ]
73
2017-10-26T12:40:24.000Z
2022-03-02T16:59:43.000Z
wrspice/src/analysis/dctsetp.cc
chris-ayala/xictools
4ea72c118679caed700dab3d49a8d36445acaec3
[ "Apache-2.0" ]
12
2017-11-01T10:18:22.000Z
2022-03-20T19:35:36.000Z
wrspice/src/analysis/dctsetp.cc
chris-ayala/xictools
4ea72c118679caed700dab3d49a8d36445acaec3
[ "Apache-2.0" ]
34
2017-10-06T17:04:21.000Z
2022-02-18T16:22:03.000Z
/*========================================================================* * * * Distributed by Whiteley Research Inc., Sunnyvale, California, USA * * http://wrcad.com * * Copyright (C) 2017 Whiteley Research Inc., all rights reserved. * * Author: Stephen R. Whiteley, except as indicated. * * * * As fully as possible recognizing licensing terms and conditions * * imposed by earlier work from which this work was derived, if any, * * this work is released under the Apache License, Version 2.0 (the * * "License"). You may not use this file except in compliance with * * the License, and compliance with inherited licenses which are * * specified in a sub-header below this one if applicable. A copy * * of the License is provided with this distribution, or you may * * obtain a copy of the License at * * * * http://www.apache.org/licenses/LICENSE-2.0 * * * * See the License for the specific language governing permissions * * and limitations under the License. * * * * 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 NON- * * INFRINGEMENT. IN NO EVENT SHALL WHITELEY RESEARCH INCORPORATED * * OR STEPHEN R. WHITELEY 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. * * * *========================================================================* * XicTools Integrated Circuit Design System * * * * WRspice Circuit Simulation and Analysis Tool * * * *========================================================================* $Id:$ *========================================================================*/ /*************************************************************************** JSPICE3 adaptation of Spice3f2 - Copyright (c) Stephen R. Whiteley 1992 Copyright 1990 Regents of the University of California. All rights reserved. Authors: 1985 Thomas L. Quarles 1993 Stephen R. Whiteley ****************************************************************************/ #include "dctdefs.h" #include "errors.h" #include "output.h" #include "kwords_analysis.h" DCTanalysis DCTinfo; // DC keywords const char *dckw_name1 = "name1"; const char *dckw_start1 = "start1"; const char *dckw_stop1 = "stop1"; const char *dckw_step1 = "step1"; const char *dckw_name2 = "name2"; const char *dckw_start2 = "start2"; const char *dckw_stop2 = "stop2"; const char *dckw_step2 = "step2"; // Sweep keywords const char *kw_dc = "dc"; const char *kw_sweep = "sweep"; namespace { IFparm DCTparms[] = { IFparm(dckw_name1, DC_NAME1, IF_IO|IF_INSTANCE, #ifdef ALLPRMS "device[param] to step"), #else "name of source to step"), #endif IFparm(dckw_start1, DC_START1, IF_IO|IF_REAL, "starting value"), IFparm(dckw_stop1, DC_STOP1, IF_IO|IF_REAL, "ending value"), IFparm(dckw_step1, DC_STEP1, IF_IO|IF_REAL, "value step"), IFparm(dckw_name2, DC_NAME2, IF_IO|IF_INSTANCE, #ifdef ALLPRMS "device[param] to step"), #else "name of source to step"), #endif IFparm(dckw_start2, DC_START2, IF_IO|IF_REAL, "starting value"), IFparm(dckw_stop2, DC_STOP2, IF_IO|IF_REAL, "ending value"), IFparm(dckw_step2, DC_STEP2, IF_IO|IF_REAL, "value step") }; } DCTanalysis::DCTanalysis() { name = "DC"; description = "D.C. Transfer curve analysis"; numParms = sizeof(DCTparms)/sizeof(IFparm); analysisParms = DCTparms; domain = SWEEPDOMAIN; }; int DCTanalysis::setParm(sJOB *anal, int which, IFdata *data) { sDCTAN *job = static_cast<sDCTAN*>(anal); if (!job) return (E_PANIC); if (job->JOBdc.setp(which, data) == OK) return (OK); return (E_BADPARM); }
41.418033
77
0.476746
wrcad
9cefc0dd45daa44fb70ed925b351c4301cc358c0
2,193
cpp
C++
runtime/src/cloe/utility/evaluate.cpp
Sidharth-S-S/cloe
974ef649e7dc6ec4e6869e4cf690c5b021e5091e
[ "Apache-2.0" ]
20
2020-07-07T18:28:35.000Z
2022-03-21T04:35:28.000Z
runtime/src/cloe/utility/evaluate.cpp
Sidharth-S-S/cloe
974ef649e7dc6ec4e6869e4cf690c5b021e5091e
[ "Apache-2.0" ]
46
2021-01-20T10:13:09.000Z
2022-03-29T12:27:19.000Z
runtime/src/cloe/utility/evaluate.cpp
Sidharth-S-S/cloe
974ef649e7dc6ec4e6869e4cf690c5b021e5091e
[ "Apache-2.0" ]
12
2021-01-25T08:01:24.000Z
2021-07-27T10:09:53.000Z
/* * Copyright 2020 Robert Bosch GmbH * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * SPDX-License-Identifier: Apache-2.0 */ /** * \file cloe/utility/evaluate.cpp * \see cloe/utility/evaluate.hpp */ #include <cloe/utility/evaluate.hpp> #include <algorithm> // for less_equal, ... #include <functional> // for function<>, bind #include <string> // for string #include <boost/lexical_cast.hpp> // for lexical_cast<> namespace cloe { namespace utility { std::function<bool(double)> compile_evaluation(const std::string& s) { std::string op; size_t pos = 0; for (auto ch : s) { if ((ch >= '0' && ch <= '9') || ch == '.') { break; } pos++; if (ch == ' ') { continue; } op.push_back(ch); } double num = boost::lexical_cast<double>(s.substr(pos)); // NOLINT return compile_evaluation(op, num); } std::function<bool(double)> compile_evaluation(const std::string& op, double num) { if (op == "==") { return std::bind(std::equal_to<double>(), std::placeholders::_1, num); } else if (op == "!=") { return std::bind(std::not_equal_to<double>(), std::placeholders::_1, num); } else if (op == "<") { return std::bind(std::less<double>(), std::placeholders::_1, num); } else if (op == "<=") { return std::bind(std::less_equal<double>(), std::placeholders::_1, num); } else if (op == ">") { return std::bind(std::greater<double>(), std::placeholders::_1, num); } else if (op == ">=") { return std::bind(std::greater_equal<double>(), std::placeholders::_1, num); } else { throw std::out_of_range("unknown operator '" + op + "'"); } } } // namespace utility } // namespace cloe
30.887324
83
0.636571
Sidharth-S-S
9cf3c12c70245d145de40d2dd1ce0c5396b9f060
18,994
cc
C++
src/geometry/strings/split.cc
odvratnozgodan/s2
e5293d0944e5053e0300d61823914728032c16c9
[ "Apache-2.0" ]
33
2016-08-10T09:13:43.000Z
2021-06-22T22:52:04.000Z
src/geometry/strings/split.cc
odvratnozgodan/s2
e5293d0944e5053e0300d61823914728032c16c9
[ "Apache-2.0" ]
9
2016-12-12T17:28:20.000Z
2020-08-11T14:41:19.000Z
src/geometry/strings/split.cc
odvratnozgodan/s2
e5293d0944e5053e0300d61823914728032c16c9
[ "Apache-2.0" ]
10
2016-12-12T17:19:40.000Z
2021-12-03T17:44:29.000Z
// Copyright 2008 and onwards Google Inc. All rights reserved. #include <limits> using std::numeric_limits; #include <stdint.h> #include "base/commandlineflags.h" #include "base/integral_types.h" #include "base/logging.h" #include "base/macros.h" #include "base/strtoint.h" #include "split.h" #include "strutil.h" #include "util/hash/hash_jenkins_lookup2.h" static const uint32 MIX32 = 0x12b9b0a1UL; // pi; an arbitrary number static const uint64 MIX64 = GG_ULONGLONG(0x2b992ddfa23249d6); // more of pi // ---------------------------------------------------------------------- // Hash32StringWithSeed() // Hash64StringWithSeed() // Hash32NumWithSeed() // Hash64NumWithSeed() // These are Bob Jenkins' hash functions, one for 32 bit numbers // and one for 64 bit numbers. Each takes a string as input and // a start seed. Hashing the same string with two different seeds // should give two independent hash values. // The *Num*() functions just do a single mix, in order to // convert the given number into something *random*. // // Note that these methods may return any value for the given size, while // the corresponding HashToXX() methods avoids certain reserved values. // ---------------------------------------------------------------------- // These slow down a lot if inlined, so do not inline them --Sanjay extern uint32 Hash32StringWithSeed(const char *s, uint32 len, uint32 c); extern uint64 Hash64StringWithSeed(const char *s, uint32 len, uint64 c); extern uint32 Hash32StringWithSeedReferenceImplementation(const char *s, uint32 len, uint32 c); // ---------------------------------------------------------------------- // HashTo32() // HashTo16() // HashTo8() // These functions take various types of input (through operator // overloading) and return 32, 16, and 8 bit quantities, respectively. // The basic rule of our hashing is: always mix(). Thus, even for // char outputs we cast to a uint32 and mix with two arbitrary numbers. // As indicated in basictypes.h, there are a few illegal hash // values to watch out for. // // Note that these methods avoid returning certain reserved values, while // the corresponding HashXXStringWithSeed() methdos may return any value. // ---------------------------------------------------------------------- // This macro defines the HashTo32, To16, and To8 versions all in one go. // It takes the argument list and a command that hashes your number. // (For 16 and 8, we just mod retval before returning it.) Example: // HASH_TO((char c), Hash32NumWithSeed(c, MIX32_1)) // evaluates to // uint32 retval; // retval = Hash32NumWithSeed(c, MIX32_1); // return retval == kIllegalHash32 ? retval-1 : retval; // inline uint32 Hash32NumWithSeed(uint32 num, uint32 c) { uint32 b = 0x9e3779b9UL; // the golden ratio; an arbitrary value mix(num, b, c); return c; } inline uint64 Hash64NumWithSeed(uint64 num, uint64 c) { uint64 b = GG_ULONGLONG(0xe08c1d668b756f82); // more of the golden ratio mix(num, b, c); return c; } #define HASH_TO(arglist, command) \ inline uint32 HashTo32 arglist { \ uint32 retval = command; \ return retval == kIllegalHash32 ? retval-1 : retval; \ } \ inline uint16 HashTo16 arglist { \ uint16 retval16 = command >> 16; /* take upper 16 bits */ \ return retval16 == kIllegalHash16 ? retval16-1 : retval16; \ } \ inline unsigned char HashTo8 arglist { \ unsigned char retval8 = command >> 24; /* take upper 8 bits */ \ return retval8 == kIllegalHash8 ? retval8-1 : retval8; \ } // This defines: // HashToXX(char *s, int slen); // HashToXX(char c); // etc HASH_TO((const char *s, uint32 slen), Hash32StringWithSeed(s, slen, MIX32)) HASH_TO((const wchar_t *s, uint32 slen), Hash32StringWithSeed(reinterpret_cast<const char*>(s), sizeof(wchar_t) * slen, MIX32)) HASH_TO((char c), Hash32NumWithSeed(static_cast<uint32>(c), MIX32)) HASH_TO((schar c), Hash32NumWithSeed(static_cast<uint32>(c), MIX32)) HASH_TO((uint16 c), Hash32NumWithSeed(static_cast<uint32>(c), MIX32)) HASH_TO((int16 c), Hash32NumWithSeed(static_cast<uint32>(c), MIX32)) HASH_TO((uint32 c), Hash32NumWithSeed(static_cast<uint32>(c), MIX32)) HASH_TO((int32 c), Hash32NumWithSeed(static_cast<uint32>(c), MIX32)) HASH_TO((uint64 c), static_cast<uint32>(Hash64NumWithSeed(c, MIX64) >> 32)) HASH_TO((int64 c), static_cast<uint32>(Hash64NumWithSeed(c, MIX64) >> 32)) #ifdef _LP64 HASH_TO((intptr_t c), static_cast<uint32>(Hash64NumWithSeed(c, MIX64) >> 32)) #endif #undef HASH_TO // clean up the macro space // HASH_NAMESPACE_DECLARATION_START namespace std { // #if defined(__GNUC__) // // Use our nice hash function for strings // template<class _CharT, class _Traits, class _Alloc> // struct hash<basic_string<_CharT, _Traits, _Alloc> > { // size_t operator()(const basic_string<_CharT, _Traits, _Alloc>& k) const { // return HashTo32(k.data(), static_cast<uint32>(k.length())); // } // }; // // // they don't define a hash for const string at all // template<> struct hash<const string> { // size_t operator()(const string& k) const { // return HashTo32(k.data(), static_cast<uint32>(k.length())); // } // }; // #endif // __GNUC__ // MSVC's STL requires an ever-so slightly different decl #if defined STL_MSVC template<> struct hash<char const*> : PortableHashBase { size_t operator()(char const* const k) const { return HashTo32(k, strlen(k)); } // Less than operator: bool operator()(char const* const a, char const* const b) const { return strcmp(a, b) < 0; } }; template<> struct hash<string> : PortableHashBase { size_t operator()(const string& k) const { return HashTo32(k.data(), k.length()); } // Less than operator: bool operator()(const string& a, const string& b) const { return a < b; } }; #endif } // hash namespace namespace { // NOTE(user): we have to implement our own interator because // insert_iterator<set<string> > does not instantiate without // errors, perhaps since string != std::string. // This is not a fully functional iterator, but is // sufficient for SplitStringToIteratorUsing(). template <typename T> struct simple_insert_iterator { T* t_; simple_insert_iterator(T* t) : t_(t) { } simple_insert_iterator<T>& operator=(const typename T::value_type& value) { t_->insert(value); return *this; } simple_insert_iterator<T>& operator*() { return *this; } simple_insert_iterator<T>& operator++() { return *this; } simple_insert_iterator<T>& operator++(int) { return *this; } }; // Used to populate a hash_map out of pairs of consecutive strings in // SplitStringToIterator{Using|AllowEmpty}(). template <typename T> struct simple_hash_map_iterator { typedef unordered_map<T, T> hashmap; hashmap* t; bool even; typename hashmap::iterator curr; simple_hash_map_iterator(hashmap* t_init) : t(t_init), even(true) { curr = t->begin(); } simple_hash_map_iterator<T>& operator=(const T& value) { if (even) { curr = t->insert(make_pair(value, T())).first; } else { curr->second = value; } even = !even; return *this; } simple_hash_map_iterator<T>& operator*() { return *this; } simple_hash_map_iterator<T>& operator++() { return *this; } simple_hash_map_iterator<T>& operator++(int i) { return *this; } }; } // anonymous namespace // ---------------------------------------------------------------------- // SplitStringIntoNPiecesAllowEmpty() // SplitStringToIteratorAllowEmpty() // Split a string using a character delimiter. Append the components // to 'result'. If there are consecutive delimiters, this function // will return corresponding empty strings. The string is split into // at most the specified number of pieces greedily. This means that the // last piece may possibly be split further. To split into as many pieces // as possible, specify 0 as the number of pieces. // // If "full" is the empty string, yields an empty string as the only value. // // If "pieces" is negative for some reason, it returns the whole string // ---------------------------------------------------------------------- template <typename StringType, typename ITR> static inline void SplitStringToIteratorAllowEmpty(const StringType& full, const char* delim, int pieces, ITR& result) { string::size_type begin_index, end_index; begin_index = 0; for (int i=0; (i < pieces-1) || (pieces == 0); i++) { end_index = full.find_first_of(delim, begin_index); if (end_index == string::npos) { *result++ = full.substr(begin_index); return; } *result++ = full.substr(begin_index, (end_index - begin_index)); begin_index = end_index + 1; } *result++ = full.substr(begin_index); } void SplitStringIntoNPiecesAllowEmpty(const string& full, const char* delim, int pieces, vector<string>* result) { back_insert_iterator<vector<string> > it(*result); SplitStringToIteratorAllowEmpty(full, delim, pieces, it); } // ---------------------------------------------------------------------- // SplitStringAllowEmpty // SplitStringToHashsetAllowEmpty // SplitStringToSetAllowEmpty // SplitStringToHashmapAllowEmpty // Split a string using a character delimiter. Append the components // to 'result'. If there are consecutive delimiters, this function // will return corresponding empty strings. // ---------------------------------------------------------------------- void SplitStringAllowEmpty(const string& full, const char* delim, vector<string>* result) { back_insert_iterator<vector<string> > it(*result); SplitStringToIteratorAllowEmpty(full, delim, 0, it); } void SplitStringToHashsetAllowEmpty(const string& full, const char* delim, unordered_set<string>* result) { simple_insert_iterator<unordered_set<string> > it(result); SplitStringToIteratorAllowEmpty(full, delim, 0, it); } void SplitStringToSetAllowEmpty(const string& full, const char* delim, set<string>* result) { simple_insert_iterator<set<string> > it(result); SplitStringToIteratorAllowEmpty(full, delim, 0, it); } void SplitStringToHashmapAllowEmpty(const string& full, const char* delim, unordered_map<string, string>* result) { simple_hash_map_iterator<string> it(result); SplitStringToIteratorAllowEmpty(full, delim, 0, it); } // If we know how much to allocate for a vector of strings, we can // allocate the vector<string> only once and directly to the right size. // This saves in between 33-66 % of memory space needed for the result, // and runs faster in the microbenchmarks. // // The reserve is only implemented for the single character delim. // // The implementation for counting is cut-and-pasted from // SplitStringToIteratorUsing. I could have written my own counting iterator, // and use the existing template function, but probably this is more clear // and more sure to get optimized to reasonable code. static int CalculateReserveForVector(const string& full, const char* delim) { int count = 0; if (delim[0] != '\0' && delim[1] == '\0') { // Optimize the common case where delim is a single character. char c = delim[0]; const char* p = full.data(); const char* end = p + full.size(); while (p != end) { if (*p == c) { // This could be optimized with hasless(v,1) trick. ++p; } else { while (++p != end && *p != c) { // Skip to the next occurence of the delimiter. } ++count; } } } return count; } // ---------------------------------------------------------------------- // SplitStringUsing() // SplitStringToHashsetUsing() // SplitStringToSetUsing() // SplitStringToHashmapUsing() // Split a string using a character delimiter. Append the components // to 'result'. // // Note: For multi-character delimiters, this routine will split on *ANY* of // the characters in the string, not the entire string as a single delimiter. // ---------------------------------------------------------------------- template <typename StringType, typename ITR> static inline void SplitStringToIteratorUsing(const StringType& full, const char* delim, ITR& result) { // Optimize the common case where delim is a single character. if (delim[0] != '\0' && delim[1] == '\0') { char c = delim[0]; const char* p = full.data(); const char* end = p + full.size(); while (p != end) { if (*p == c) { ++p; } else { const char* start = p; while (++p != end && *p != c) { // Skip to the next occurence of the delimiter. } *result++ = StringType(start, p - start); } } return; } string::size_type begin_index, end_index; begin_index = full.find_first_not_of(delim); while (begin_index != string::npos) { end_index = full.find_first_of(delim, begin_index); if (end_index == string::npos) { *result++ = full.substr(begin_index); return; } *result++ = full.substr(begin_index, (end_index - begin_index)); begin_index = full.find_first_not_of(delim, end_index); } } void SplitStringUsing(const string& full, const char* delim, vector<string>* result) { result->reserve(result->size() + CalculateReserveForVector(full, delim)); back_insert_iterator< vector<string> > it(*result); SplitStringToIteratorUsing(full, delim, it); } void SplitStringToHashsetUsing(const string& full, const char* delim, unordered_set<string>* result) { simple_insert_iterator<unordered_set<string> > it(result); SplitStringToIteratorUsing(full, delim, it); } void SplitStringToSetUsing(const string& full, const char* delim, set<string>* result) { simple_insert_iterator<set<string> > it(result); SplitStringToIteratorUsing(full, delim, it); } void SplitStringToHashmapUsing(const string& full, const char* delim, unordered_map<string, string>* result) { simple_hash_map_iterator<string> it(result); SplitStringToIteratorUsing(full, delim, it); } // ---------------------------------------------------------------------- // SplitOneIntToken() // SplitOneInt32Token() // SplitOneUint32Token() // SplitOneInt64Token() // SplitOneUint64Token() // SplitOneDoubleToken() // SplitOneFloatToken() // SplitOneDecimalIntToken() // SplitOneDecimalInt32Token() // SplitOneDecimalUint32Token() // SplitOneDecimalInt64Token() // SplitOneDecimalUint64Token() // SplitOneHexUint32Token() // SplitOneHexUint64Token() // Mainly a stringified wrapper around strtol/strtoul/strtod // ---------------------------------------------------------------------- // Curried functions for the macro below static inline long strto32_0(const char * source, char ** end) { return strto32(source, end, 0); } static inline unsigned long strtou32_0(const char * source, char ** end) { return strtou32(source, end, 0); } static inline int64 strto64_0(const char * source, char ** end) { return strto64(source, end, 0); } static inline uint64 strtou64_0(const char * source, char ** end) { return strtou64(source, end, 0); } static inline long strto32_10(const char * source, char ** end) { return strto32(source, end, 10); } static inline unsigned long strtou32_10(const char * source, char ** end) { return strtou32(source, end, 10); } static inline int64 strto64_10(const char * source, char ** end) { return strto64(source, end, 10); } static inline uint64 strtou64_10(const char * source, char ** end) { return strtou64(source, end, 10); } static inline uint32 strtou32_16(const char * source, char ** end) { return strtou32(source, end, 16); } static inline uint64 strtou64_16(const char * source, char ** end) { return strtou64(source, end, 16); } #define DEFINE_SPLIT_ONE_NUMBER_TOKEN(name, type, function) \ bool SplitOne##name##Token(const char ** source, const char * delim, \ type * value) { \ assert(source); \ assert(delim); \ assert(value); \ if (!*source) \ return false; \ /* Parse int */ \ char * end; \ *value = function(*source, &end); \ if (end == *source) \ return false; /* number not present at start of string */ \ if (end[0] && !strchr(delim, end[0])) \ return false; /* Garbage characters after int */ \ /* Advance past token */ \ if (*end != '\0') \ *source = const_cast<const char *>(end+1); \ else \ *source = NULL; \ return true; \ } DEFINE_SPLIT_ONE_NUMBER_TOKEN(Int, int, strto32_0) DEFINE_SPLIT_ONE_NUMBER_TOKEN(Int32, int32, strto32_0) DEFINE_SPLIT_ONE_NUMBER_TOKEN(Uint32, uint32, strtou32_0) DEFINE_SPLIT_ONE_NUMBER_TOKEN(Int64, int64, strto64_0) DEFINE_SPLIT_ONE_NUMBER_TOKEN(Uint64, uint64, strtou64_0) DEFINE_SPLIT_ONE_NUMBER_TOKEN(Double, double, strtod) #ifdef COMPILER_MSVC // has no strtof() // Note: does an implicit cast to float. DEFINE_SPLIT_ONE_NUMBER_TOKEN(Float, float, strtod) #else DEFINE_SPLIT_ONE_NUMBER_TOKEN(Float, float, strtof) #endif DEFINE_SPLIT_ONE_NUMBER_TOKEN(DecimalInt, int, strto32_10) DEFINE_SPLIT_ONE_NUMBER_TOKEN(DecimalInt32, int32, strto32_10) DEFINE_SPLIT_ONE_NUMBER_TOKEN(DecimalUint32, uint32, strtou32_10) DEFINE_SPLIT_ONE_NUMBER_TOKEN(DecimalInt64, int64, strto64_10) DEFINE_SPLIT_ONE_NUMBER_TOKEN(DecimalUint64, uint64, strtou64_10) DEFINE_SPLIT_ONE_NUMBER_TOKEN(HexUint32, uint32, strtou32_16) DEFINE_SPLIT_ONE_NUMBER_TOKEN(HexUint64, uint64, strtou64_16)
39.736402
80
0.612772
odvratnozgodan
9cf5cba739c26a8845eaa9d2e0e252ab77f7eea2
422
cpp
C++
LibFoundation/Wm4FoundationPCH.cpp
wjezxujian/WildMagic4
249a17f8c447cf57c6283408e01009039810206a
[ "BSL-1.0" ]
3
2021-08-02T04:03:03.000Z
2022-01-04T07:31:20.000Z
LibFoundation/Wm4FoundationPCH.cpp
wjezxujian/WildMagic4
249a17f8c447cf57c6283408e01009039810206a
[ "BSL-1.0" ]
null
null
null
LibFoundation/Wm4FoundationPCH.cpp
wjezxujian/WildMagic4
249a17f8c447cf57c6283408e01009039810206a
[ "BSL-1.0" ]
5
2019-10-13T02:44:19.000Z
2021-08-02T04:03:10.000Z
// Geometric Tools, Inc. // http://www.geometrictools.com // Copyright (c) 1998-2006. All Rights Reserved // // The Wild Magic Version 4 Foundation Library source code is supplied // under the terms of the license agreement // http://www.geometrictools.com/License/Wm4FoundationLicense.pdf // and may not be copied or disclosed except in accordance with the terms // of that agreement. #include "Wm4FoundationPCH.h"
35.166667
73
0.753555
wjezxujian
9cf709fb2fdb8038b98aefdfa1b703425b6f4e79
1,425
cpp
C++
src/ButtonManager.cpp
klaus-liebler/smopla-dps
ab92c73d16769a09d70b5519792c29a4276543c5
[ "MIT" ]
null
null
null
src/ButtonManager.cpp
klaus-liebler/smopla-dps
ab92c73d16769a09d70b5519792c29a4276543c5
[ "MIT" ]
null
null
null
src/ButtonManager.cpp
klaus-liebler/smopla-dps
ab92c73d16769a09d70b5519792c29a4276543c5
[ "MIT" ]
null
null
null
#include "ButtonManager.hh" #include "pindefs.hh" constexpr uint32_t LONG_PRESS_LIMIT=600; ButtonManager::ButtonManager() { // TODO Auto-generated constructor stub } ButtonManager::~ButtonManager() { // TODO Auto-generated destructor stub } void ButtonManager::Update() { bool v=Gpio::Get(SW_ONOFF); if(prevSW_ONOFF && !v)//now pressed { prevSW_ONOFF=false; } else if(!prevSW_ONOFF && v) { shortEvents|=0b00001; prevSW_ONOFF=true; } v=Gpio::Get(SW_DOWN); if(prevSW_DOWN && !v)//now pressed { prevSW_DOWN=false; } else if(!prevSW_DOWN && v) { shortEvents|=0b00010; prevSW_DOWN=true; } v=Gpio::Get(SW_SET); if(prevSW_SET && !v)//now pressed { prevSW_SET=false; } else if(!prevSW_SET && v) { shortEvents|=0b00100; prevSW_SET=true; } v=Gpio::Get(SW_UP); if(prevSW_UP && !v)//now pressed { prevSW_UP=false; } else if(!prevSW_UP && v) { shortEvents|=0b01000; prevSW_UP=true; } v=Gpio::Get(ROTENC_SW); if(prevROT_SW && !v)//now pressed { prevROT_SW=false; timeROT_SW = SysTick->VAL; } else if(!prevROT_SW && v) { if(SysTick->VAL-timeROT_SW > LONG_PRESS_LIMIT) { longEvents|=0b10000; } else { shortEvents|=0b10000; } prevROT_SW=true; } } uint32_t ButtonManager::GetShortPresses(){ uint8_t tmp = shortEvents; shortEvents=0; return tmp; } uint32_t ButtonManager::GetLongPresses() { uint8_t tmp = longEvents; longEvents=0; return tmp; }
15.833333
48
0.677895
klaus-liebler
9cf85d58477c1e121667fbd8e426230ef941b59d
5,196
cpp
C++
src/ToolTip/RDesktopTip2.cpp
gongjianbo/RectangleComponent
2b4b0f4d3c8ac6949d70934b52b390e6c3a05881
[ "MIT" ]
4
2020-06-17T14:28:53.000Z
2021-08-19T01:04:58.000Z
src/ToolTip/RDesktopTip2.cpp
gongjianbo/RectangleComponent
2b4b0f4d3c8ac6949d70934b52b390e6c3a05881
[ "MIT" ]
null
null
null
src/ToolTip/RDesktopTip2.cpp
gongjianbo/RectangleComponent
2b4b0f4d3c8ac6949d70934b52b390e6c3a05881
[ "MIT" ]
10
2020-06-07T13:25:19.000Z
2022-03-03T05:15:12.000Z
#include "RDesktopTip2.h" #include "ui_RDesktopTip2.h" #include <QApplication> #include <QScreen> #include <QDebug> RDesktopTip2* RDesktopTip2::instance=nullptr; RDesktopTip2::AnimationMode RDesktopTip2::mode=RDesktopTip2::AllAnimation; RDesktopTip2::RDesktopTip2() : QWidget(nullptr), ui(new Ui::RDesktopTip2), showGroup(new QParallelAnimationGroup(this)) { ui->setupUi(this); setWindowFlags(Qt::FramelessWindowHint | Qt::ToolTip); setAttribute(Qt::WA_TranslucentBackground); setAttribute(Qt::WA_DeleteOnClose); //setWindowModality(Qt::WindowModal); //resize会被label撑开 this->setFixedSize(310,210); ui->tipArea->setFixedSize(310,210); //关闭 connect(ui->btnClose,&QPushButton::clicked,this,&RDesktopTip2::hideTip); //程序退出时释放 connect(qApp,&QApplication::aboutToQuit,this,&RDesktopTip2::close); //动画设置 initAnimation(); //定时器设置 initTimer(); } RDesktopTip2::~RDesktopTip2() { qDebug()<<"delete DesktopTip2"; delete ui; } void RDesktopTip2::showTip(const QStringList &texts, int timeout) { if(!instance){ //仅在ui线程 instance=new RDesktopTip2; } instance->readyTimer(timeout); //模态框 instance->setWindowModality(Qt::WindowModal); instance->setTextList(texts); instance->showAnimation(); } void RDesktopTip2::keepTip(const QStringList &texts) { if(!instance){ //仅在ui线程 instance=new RDesktopTip2; } instance->readyTimer(0); //模态框 instance->setWindowModality(Qt::WindowModal); instance->setTextList(texts); instance->keepAnimation(); } void RDesktopTip2::hideTip() { if(!instance){ return; } instance->hideAnimation(); } RDesktopTip2::AnimationMode RDesktopTip2::getMode() { return mode; } void RDesktopTip2::setMode(RDesktopTip2::AnimationMode newMode) { if(mode!=newMode){ mode=newMode; } } void RDesktopTip2::initAnimation() { //透明度动画 showOpacity=new QPropertyAnimation(ui->tipArea,"windowOpacity"); //判断是否设置了此模式的动画 if(mode&AnimationMode::OpacityAnimation){ showOpacity->setDuration(1500); showOpacity->setStartValue(0); }else{ showOpacity->setDuration(0); showOpacity->setStartValue(1); } showOpacity->setEndValue(1); showGroup->addAnimation(showOpacity); //位置动画 showPos=new QPropertyAnimation(ui->tipArea,"pos"); //QScreen * screen = QGuiApplication::primaryScreen(); //if (screen) { // const QRect desk_rect = screen->availableGeometry(); //} //TODO 提供设置动画位置的接口 //TODO 丰富入场动画选项 const QPoint hide_pos{0,ui->tipArea->height()}; const QPoint show_pos{0,0}; //判断是否设置了此模式的动画 if(mode&AnimationMode::PosAnimation){ showPos->setDuration(1500); showPos->setStartValue(hide_pos); }else{ showPos->setDuration(0); showPos->setStartValue(show_pos); } showPos->setEndValue(show_pos); showGroup->addAnimation(showPos); // connect(showGroup,&QParallelAnimationGroup::finished,[this]{ //back消失动画结束关闭窗口 if(showGroup->direction()==QAbstractAnimation::Backward){ //Qt::WA_DeleteOnClose后手动设置为null instance=nullptr; qApp->disconnect(this); //关闭时设置为非模态,方式主窗口被遮挡,待测试 this->setWindowModality(Qt::NonModal); this->close(); }else{ //配合keepAnimation showAnimEnd=true; //配合定时关闭 if(hideCount>0) hideTimer->start(); } }); } void RDesktopTip2::initTimer() { hideTimer=new QTimer(this); hideTimer->setInterval(1000); //1s间隔 connect(hideTimer,&QTimer::timeout,[this]{ if(hideCount>1){ hideCount--; ui->btnClose->setText(QString("%1 S").arg(hideCount)); }else{ ui->btnClose->setText(QString("Close")); hideTimer->stop(); hideTip(); } }); } void RDesktopTip2::readyTimer(int timeout) { //先设置,在显示动画结束再start开始计时器 hideCount=timeout; hideTimer->stop(); if(hideCount>0){ ui->btnClose->setText(QString("%1 S").arg(hideCount)); }else{ ui->btnClose->setText(QString("Close")); } } void RDesktopTip2::showAnimation() { showGroup->setDirection(QAbstractAnimation::Forward); //停止正在进行的动画重新 if(showGroup->state()==QAbstractAnimation::Running){ showGroup->stop(); } showGroup->start(); show(); } void RDesktopTip2::keepAnimation() { //show没有完成,或者正在动画中才进入 if(!showAnimEnd||showGroup->state()!=QAbstractAnimation::Stopped){ showGroup->setDirection(QAbstractAnimation::Forward); showGroup->start(); show(); } } void RDesktopTip2::hideAnimation() { //Backward反向执行动画 showGroup->setDirection(QAbstractAnimation::Backward); showGroup->start(); } void RDesktopTip2::setTextList(const QStringList &texts) { QString tip_text("<p style='line-height:120%'>"); for (const QString &text : texts) { if (text.isEmpty()) continue; tip_text += text + "<br>"; } tip_text += "</p>"; ui->contentLabel->setText(tip_text); }
24.280374
76
0.635681
gongjianbo
9cf92e3031a285d19d3b35fa2d254518989fd211
1,664
hpp
C++
Libraries/Sound/SoundStandard.hpp
DaveTheGameDev/PlasmaEngine
bb5013e7ba1731b2269f4e4aea1109870ab82092
[ "MIT" ]
null
null
null
Libraries/Sound/SoundStandard.hpp
DaveTheGameDev/PlasmaEngine
bb5013e7ba1731b2269f4e4aea1109870ab82092
[ "MIT" ]
null
null
null
Libraries/Sound/SoundStandard.hpp
DaveTheGameDev/PlasmaEngine
bb5013e7ba1731b2269f4e4aea1109870ab82092
[ "MIT" ]
null
null
null
// MIT Licensed (see LICENSE.md). #pragma once #include "Common/CommonStandard.hpp" #include "PlatformStandard.hpp" #include "Serialization/SerializationStandard.hpp" #include "Meta/MetaStandard.hpp" #include "Support/SupportStandard.hpp" #include "Engine/EngineStandard.hpp" #include "Geometry/DebugDraw.hpp" namespace Plasma { // Forward declarations class SoundSystem; class SoundSpace; class SoundNode; class SoundInstance; class SoundCue; class SoundEntry; class SoundTag; class SoundTagEntry; class Sound; // Sound library class PlasmaNoImportExport SoundLibrary : public Lightning::StaticLibrary { public: LightningDeclareStaticLibraryInternals(SoundLibrary, "PlasmaEngine"); static void Initialize(); static void Shutdown(); }; } // namespace Plasma #include "Definitions.hpp" #include "RingBuffer.hpp" #include "LockFreeQueue.hpp" #include "Interpolator.hpp" #include "AudioIOInterface.hpp" #include "Filters.hpp" #include "Resampler.hpp" #include "VBAP.hpp" #include "PitchChange.hpp" #include "FileDecoder.hpp" #include "VolumeModifier.hpp" #include "SoundAsset.hpp" #include "SoundNode.hpp" #include "SoundTag.hpp" #include "AudioMixer.hpp" #include "AttenuatorNode.hpp" #include "EmitterNode.hpp" #include "ListenerNode.hpp" #include "CustomAudioNode.hpp" #include "GeneratedAudio.hpp" #include "Recording.hpp" #include "SoundListener.hpp" #include "DspFilterNodes.hpp" #include "SoundAttenuator.hpp" #include "SoundEmitter.hpp" #include "SoundSpace.hpp" #include "SoundNodeGraph.hpp" #include "SoundInstance.hpp" #include "SoundSystem.hpp" #include "Sound.hpp" #include "SoundCue.hpp" #include "SimpleSound.hpp" #include "SimpleSound.hpp"
24.115942
73
0.786659
DaveTheGameDev
9cf964676049f526422a17056c3df5f672410a1b
994
cc
C++
test/main.cc
pvhoffman/heapsort
b5a44b3207060a997937c5e4bd7af06427b7cb48
[ "MIT" ]
null
null
null
test/main.cc
pvhoffman/heapsort
b5a44b3207060a997937c5e4bd7af06427b7cb48
[ "MIT" ]
null
null
null
test/main.cc
pvhoffman/heapsort
b5a44b3207060a997937c5e4bd7af06427b7cb48
[ "MIT" ]
null
null
null
#include <config.h> #include <iostream> #include <random> #include <algorithm> #include <iterator> #include <functional> #define CATCH_CONFIG_MAIN #include "catch.hpp" #include "../src/heapsort.h" SCENARIO( "vectors can be sorted", "[vector]" ) { GIVEN( "A vector of 10000000 random integers" ) { using namespace std; random_device rnd_device; // Specify the engine and distribution. mt19937 mersenne_engine {rnd_device()}; // Generates random integers uniform_int_distribution<int> dist {-10000000, 10000000}; auto gen = [&dist, &mersenne_engine]() { return dist(mersenne_engine); }; vector<int> vec(10000000); generate(begin(vec), end(vec), gen); WHEN("heapsort is applied") { ch4::heapsort hs; auto cs = hs.sort(vec); THEN("the container should be sorted") REQUIRE(is_sorted(begin(cs), end(cs))); } } }
23.116279
77
0.594567
pvhoffman
9cfbb8f5edcf3e0c2ce5914d381df3e047ce4837
9,531
cpp
C++
src/mapnik_color.cpp
naturalatlas/node-mapnik
02e5d8eb0488128e1c51ad7d9ea9e5becb57dbb9
[ "BSD-3-Clause" ]
null
null
null
src/mapnik_color.cpp
naturalatlas/node-mapnik
02e5d8eb0488128e1c51ad7d9ea9e5becb57dbb9
[ "BSD-3-Clause" ]
null
null
null
src/mapnik_color.cpp
naturalatlas/node-mapnik
02e5d8eb0488128e1c51ad7d9ea9e5becb57dbb9
[ "BSD-3-Clause" ]
null
null
null
#include "mapnik_color.hpp" Napi::FunctionReference Color::constructor; Napi::Object Color::Initialize(Napi::Env env, Napi::Object exports, napi_property_attributes prop_attr) { Napi::Function func = DefineClass(env, "Color", { InstanceMethod<&Color::hex>("hex", prop_attr), InstanceMethod<&Color::toString>("toString", prop_attr), InstanceAccessor<&Color::red, &Color::red>("r", prop_attr), InstanceAccessor<&Color::green, &Color::green>("g", prop_attr), InstanceAccessor<&Color::blue, &Color::blue>("b", prop_attr), InstanceAccessor<&Color::alpha, &Color::alpha>("a", prop_attr), InstanceAccessor<&Color::premultiplied, &Color::premultiplied>("premultiplied", prop_attr) }); constructor = Napi::Persistent(func); constructor.SuppressDestruct(); exports.Set("Color", func); return exports; } /** * **`mapnik.Color`** * * A `mapnik.Color` object used for handling and converting colors * * @class Color * @param {string|number} value either an array of [r, g, b, a], * a color keyword, or a CSS color in rgba() form. * @param {number} r - red value between `0` and `255` * @param {number} g - green value between `0` and `255` * @param {number} b - blue value between `0` and `255` * @param {boolean} pre - premultiplied, either `true` or `false` * @throws {TypeError} if a `rgb` component is outside of the 0-255 range * @example * var c = new mapnik.Color('green'); * var c = new mapnik.Color(0, 128, 0, 255); * // premultiplied * var c = new mapnik.Color(0, 128, 0, 255, true); */ Color::Color(Napi::CallbackInfo const& info) : Napi::ObjectWrap<Color>(info) { Napi::Env env = info.Env(); if (info.Length() == 1 && info[0].IsExternal()) { auto ext = info[0].As<Napi::External<mapnik::color>>(); if (ext) color_ = *ext.Data(); return; } else if (info.Length() == 1 && info[0].IsString()) { try { color_ = mapnik::color{info[0].As<Napi::String>()}; } catch (std::exception const& ex) { Napi::TypeError::New(env, ex.what()).ThrowAsJavaScriptException(); } } else if (info.Length() == 2 && info[0].IsString() && info[1].IsBoolean()) { try { color_ = {info[0].As<Napi::String>()}; color_.set_premultiplied(info[1].As<Napi::Boolean>()); // FIXME: operator=(rhs) is broken in mapnik } catch (std::exception const& ex) { Napi::TypeError::New(env, ex.what()).ThrowAsJavaScriptException(); } } else if (info.Length() == 3 && info[0].IsNumber() && info[1].IsNumber() && info[2].IsNumber()) { int r = info[0].As<Napi::Number>().Int32Value(); int g = info[1].As<Napi::Number>().Int32Value(); int b = info[2].As<Napi::Number>().Int32Value(); if (r < 0 || r > 255 || g < 0 || g > 255 || b < 0 || b > 255) { Napi::TypeError::New(env, "color value out of range").ThrowAsJavaScriptException(); } color_ = mapnik::color(r, g, b); } else if (info.Length() == 4 && info[0].IsNumber() && info[1].IsNumber() && info[2].IsNumber() && info[3].IsBoolean()) { int r = info[0].As<Napi::Number>().Int32Value(); int g = info[1].As<Napi::Number>().Int32Value(); int b = info[2].As<Napi::Number>().Int32Value(); if (r < 0 || r > 255 || g < 0 || g > 255 || b < 0 || b > 255) { Napi::TypeError::New(env, "color value out of range").ThrowAsJavaScriptException(); } color_ = mapnik::color(r, g, b, 255); color_.set_premultiplied(info[3].As<Napi::Boolean>()); } else if (info.Length() == 4 && info[0].IsNumber() && info[1].IsNumber() && info[2].IsNumber() && info[3].IsNumber()) { int r = info[0].As<Napi::Number>().Int32Value(); int g = info[1].As<Napi::Number>().Int32Value(); int b = info[2].As<Napi::Number>().Int32Value(); int a = info[3].As<Napi::Number>().Int32Value(); if (r < 0 || r > 255 || g < 0 || g > 255 || b < 0 || b > 255 || a < 0 || a > 255) { Napi::TypeError::New(env, "color value out of range").ThrowAsJavaScriptException(); } color_ = mapnik::color(r, g, b, a); } else if (info.Length() == 5 && info[0].IsNumber() && info[1].IsNumber() && info[2].IsNumber() && info[3].IsNumber() && info[4].IsBoolean()) { int r = info[0].As<Napi::Number>().Int32Value(); int g = info[1].As<Napi::Number>().Int32Value(); int b = info[2].As<Napi::Number>().Int32Value(); int a = info[3].As<Napi::Number>().Int32Value(); if (r < 0 || r > 255 || g < 0 || g > 255 || b < 0 || b > 255 || a < 0 || a > 255) { Napi::TypeError::New(env, "color value out of range").ThrowAsJavaScriptException(); } color_ = mapnik::color(r, g, b, a); color_.set_premultiplied(info[4].As<Napi::Boolean>()); } else { Napi::TypeError::New(env, "invalid arguments: colors can be created from a string, integer r,g,b values, or integer r,g,b,a values") .ThrowAsJavaScriptException(); } } Napi::Value Color::red(Napi::CallbackInfo const& info) { Napi::Env env = info.Env(); return Napi::Number::New(env, color_.red()); } void Color::red(Napi::CallbackInfo const& info, Napi::Value const& val) { Napi::Env env = info.Env(); if (!val.IsNumber()) { Napi::TypeError::New(env, "color channel value must be an integer").ThrowAsJavaScriptException(); } int r = val.As<Napi::Number>().Int32Value(); if (r < 0 || r > 255) { Napi::TypeError::New(env, "Value out of range for color channel").ThrowAsJavaScriptException(); } color_.set_red(r); } Napi::Value Color::green(Napi::CallbackInfo const& info) { Napi::Env env = info.Env(); return Napi::Number::New(env, color_.green()); } void Color::green(Napi::CallbackInfo const& info, Napi::Value const& val) { Napi::Env env = info.Env(); if (!val.IsNumber()) { Napi::TypeError::New(env, "color channel value must be an integer").ThrowAsJavaScriptException(); } int g = val.As<Napi::Number>().Int32Value(); if (g < 0 || g > 255) { Napi::TypeError::New(env, "Value out of range for color channel").ThrowAsJavaScriptException(); } color_.set_green(g); } Napi::Value Color::blue(Napi::CallbackInfo const& info) { Napi::Env env = info.Env(); return Napi::Number::New(env, color_.blue()); } void Color::blue(Napi::CallbackInfo const& info, Napi::Value const& val) { Napi::Env env = info.Env(); if (!val.IsNumber()) { Napi::TypeError::New(env, "color channel value must be an integer").ThrowAsJavaScriptException(); } int b = val.As<Napi::Number>().Int32Value(); if (b < 0 || b > 255) { Napi::TypeError::New(env, "Value out of range for color channel").ThrowAsJavaScriptException(); } color_.set_blue(b); } Napi::Value Color::alpha(Napi::CallbackInfo const& info) { Napi::Env env = info.Env(); return Napi::Number::New(env, color_.alpha()); } void Color::alpha(Napi::CallbackInfo const& info, Napi::Value const& val) { Napi::Env env = info.Env(); if (!val.IsNumber()) { Napi::TypeError::New(env, "color channel value must be an integer").ThrowAsJavaScriptException(); } int a = val.As<Napi::Number>().Int32Value(); if (a < 0 || a > 255) { Napi::TypeError::New(env, "Value out of range for color channel").ThrowAsJavaScriptException(); } color_.set_alpha(a); } /** * Get whether this color is premultiplied * * @name get_premultiplied * @memberof Color * @instance * @returns {boolean} premultiplied */ Napi::Value Color::premultiplied(Napi::CallbackInfo const& info) { Napi::Env env = info.Env(); return Napi::Boolean::New(env, color_.get_premultiplied()); } /** * Set whether this color should be premultiplied * * @name set_premultiplied * @memberof Color * @instance * @param {boolean} premultiplied * @example * var c = new mapnik.Color('green'); * c.set_premultiplied(true); * @throws {TypeError} given a non-boolean argument */ void Color::premultiplied(Napi::CallbackInfo const& info, Napi::Value const& val) { Napi::Env env = info.Env(); if (!val.IsBoolean()) { Napi::TypeError::New(env, "Value set to premultiplied must be a boolean").ThrowAsJavaScriptException(); } color_.set_premultiplied(val.As<Napi::Boolean>()); } /** * Get this color's representation as a string * * @name toString * @memberof Color * @instance * @returns {string} color as a string * @example * var green = new mapnik.Color('green'); * green.toString() * // 'rgb(0,128,0)' */ Napi::Value Color::toString(Napi::CallbackInfo const& info) { Napi::Env env = info.Env(); return Napi::String::New(env, color_.to_string()); } /** * Get this color represented as a hexademical string * * @name hex * @memberof Color * @instance * @returns {string} hex representation * @example * var c = new mapnik.Color('green'); * c.hex(); * // '#008000' */ Napi::Value Color::hex(Napi::CallbackInfo const& info) { Napi::Env env = info.Env(); return Napi::String::New(env, color_.to_hex_string()); }
31.876254
140
0.585878
naturalatlas
9cfe9641b39b1896bcf6e3e8f9f1db6c838c1aeb
2,654
cpp
C++
local_planner/src/nodes/local_planner_node_main.cpp
jengakim/avoidance
978bb05f3fd6b060de4c417809e73318a3e121a4
[ "BSD-3-Clause" ]
null
null
null
local_planner/src/nodes/local_planner_node_main.cpp
jengakim/avoidance
978bb05f3fd6b060de4c417809e73318a3e121a4
[ "BSD-3-Clause" ]
null
null
null
local_planner/src/nodes/local_planner_node_main.cpp
jengakim/avoidance
978bb05f3fd6b060de4c417809e73318a3e121a4
[ "BSD-3-Clause" ]
null
null
null
#include "local_planner/local_planner.h" #include "local_planner/common.h" #include "local_planner/local_planner_node.h" #include "local_planner/waypoint_generator.h" #include <boost/algorithm/string.hpp> int main(int argc, char** argv) { using namespace avoidance; ros::init(argc, argv, "local_planner_node"); ros::NodeHandle nh("~"); ros::NodeHandle nh_private(""); LocalPlannerNode Node(nh, nh_private, true); ros::Duration(2).sleep(); ros::Time start_time = ros::Time::now(); bool hover = false; bool planner_is_healthy = true; avoidanceOutput planner_output; Node.local_planner_->disable_rise_to_goal_altitude_ = Node.disable_rise_to_goal_altitude_; bool startup = true; bool callPx4Params = true; Node.status_msg_.state = (int)MAV_STATE::MAV_STATE_BOOT; std::thread worker(&LocalPlannerNode::threadFunction, &Node); // spin node, execute callbacks while (ros::ok()) { hover = false; #ifdef DISABLE_SIMULATION startup = false; #else // visualize world in RVIZ if (!Node.world_path_.empty() && startup) { if (!Node.world_visualizer_.visualizeRVIZWorld(Node.world_path_)) { ROS_WARN("Failed to visualize Rviz world"); } startup = false; } #endif // Process callbacks & wait for a position update while (!Node.position_received_ && ros::ok()) { ros::getGlobalCallbackQueue()->callAvailable(ros::WallDuration(0.1)); } // Check if all information was received ros::Time now = ros::Time::now(); ros::Duration since_last_cloud = now - Node.last_wp_time_; ros::Duration since_start = now - start_time; Node.checkFailsafe(since_last_cloud, since_start, planner_is_healthy, hover); // If planner is not running, update planner info and get last results Node.updatePlanner(); // send waypoint if (!Node.never_run_ && planner_is_healthy) { Node.calculateWaypoints(hover); if (!hover) Node.status_msg_.state = (int)MAV_STATE::MAV_STATE_ACTIVE; } else { for (size_t i = 0; i < Node.cameras_.size(); ++i) { // once the camera info have been set once, unsubscribe from topic Node.cameras_[i].camera_info_sub_.shutdown(); } } Node.position_received_ = false; // publish system status if (now - Node.t_status_sent_ > ros::Duration(0.2)) Node.publishSystemStatus(); } Node.should_exit_ = true; Node.data_ready_cv_.notify_all(); worker.join(); for (size_t i = 0; i < Node.cameras_.size(); ++i) { Node.cameras_[i].cloud_ready_cv_->notify_all(); Node.cameras_[i].transform_thread_.join(); } return 0; }
29.488889
76
0.680106
jengakim
140088da6d1eec58da5d44239c50c28777e65ed0
484
cpp
C++
Data Structures/k-d tree.cpp
utkarsh-1997/Code-Repo
47786ae93a7b8cea100b7b7e6478f10403c33baa
[ "MIT" ]
null
null
null
Data Structures/k-d tree.cpp
utkarsh-1997/Code-Repo
47786ae93a7b8cea100b7b7e6478f10403c33baa
[ "MIT" ]
null
null
null
Data Structures/k-d tree.cpp
utkarsh-1997/Code-Repo
47786ae93a7b8cea100b7b7e6478f10403c33baa
[ "MIT" ]
null
null
null
// Refer to: // https://github.com/utkarsh1097/DBMS-Assignments/blob/master/Assignment%203/bestfirstsearch.cpp // for the implementation of the k-d tree. Please modify the main() function according to your needs. // The code is pretty neat and it will not be difficult to understand. Still, will add comments in future if needed. //Just for writing something, I will write a "Hello World" program below! #include<stdio.h> int main() { printf("Hello World!\n"); return 0; }
32.266667
116
0.735537
utkarsh-1997
140140fc93d5f6cbf73ff6b692659eda565627bc
32,032
cpp
C++
libi2pd_client/SAM.cpp
KenanSulayman/i2pd
50e4fb138a48ce07a89c19d1f5c8888cec3dae78
[ "BSD-3-Clause" ]
1
2021-09-05T04:25:24.000Z
2021-09-05T04:25:24.000Z
libi2pd_client/SAM.cpp
KenanSulayman/i2pd
50e4fb138a48ce07a89c19d1f5c8888cec3dae78
[ "BSD-3-Clause" ]
null
null
null
libi2pd_client/SAM.cpp
KenanSulayman/i2pd
50e4fb138a48ce07a89c19d1f5c8888cec3dae78
[ "BSD-3-Clause" ]
null
null
null
#include <string.h> #include <stdio.h> #ifdef _MSC_VER #include <stdlib.h> #endif #include "Base.h" #include "Identity.h" #include "Log.h" #include "Destination.h" #include "ClientContext.h" #include "util.h" #include "SAM.h" namespace i2p { namespace client { SAMSocket::SAMSocket (SAMBridge& owner): m_Owner (owner), m_Socket (m_Owner.GetService ()), m_Timer (m_Owner.GetService ()), m_BufferOffset (0), m_SocketType (eSAMSocketTypeUnknown), m_IsSilent (false), m_IsAccepting (false), m_Stream (nullptr), m_Session (nullptr) { } SAMSocket::~SAMSocket () { Terminate ("~SAMSocket()"); } void SAMSocket::CloseStream (const char* reason) { LogPrint (eLogDebug, "SAMSocket::CloseStream, reason: ", reason); if (m_Stream) { m_Stream->Close (); m_Stream.reset (); } } void SAMSocket::Terminate (const char* reason) { CloseStream (reason); switch (m_SocketType) { case eSAMSocketTypeSession: m_Owner.CloseSession (m_ID); break; case eSAMSocketTypeStream: { if (m_Session) m_Session->DelSocket (shared_from_this ()); break; } case eSAMSocketTypeAcceptor: { if (m_Session) { m_Session->DelSocket (shared_from_this ()); if (m_IsAccepting && m_Session->localDestination) m_Session->localDestination->StopAcceptingStreams (); } break; } default: ; } m_SocketType = eSAMSocketTypeTerminated; if (m_Socket.is_open()) m_Socket.close (); m_Session = nullptr; } void SAMSocket::ReceiveHandshake () { m_Socket.async_read_some (boost::asio::buffer(m_Buffer, SAM_SOCKET_BUFFER_SIZE), std::bind(&SAMSocket::HandleHandshakeReceived, shared_from_this (), std::placeholders::_1, std::placeholders::_2)); } void SAMSocket::HandleHandshakeReceived (const boost::system::error_code& ecode, std::size_t bytes_transferred) { if (ecode) { LogPrint (eLogError, "SAM: handshake read error: ", ecode.message ()); if (ecode != boost::asio::error::operation_aborted) Terminate ("SAM: handshake read error"); } else { m_Buffer[bytes_transferred] = 0; char * eol = (char *)memchr (m_Buffer, '\n', bytes_transferred); if (eol) *eol = 0; LogPrint (eLogDebug, "SAM: handshake ", m_Buffer); char * separator = strchr (m_Buffer, ' '); if (separator) { separator = strchr (separator + 1, ' '); if (separator) *separator = 0; } if (!strcmp (m_Buffer, SAM_HANDSHAKE)) { std::string version("3.0"); // try to find MIN and MAX, 3.0 if not found if (separator) { separator++; std::map<std::string, std::string> params; ExtractParams (separator, params); //auto it = params.find (SAM_PARAM_MAX); // TODO: check MIN as well //if (it != params.end ()) // version = it->second; } if (version[0] == '3') // we support v3 (3.0 and 3.1) only { #ifdef _MSC_VER size_t l = sprintf_s (m_Buffer, SAM_SOCKET_BUFFER_SIZE, SAM_HANDSHAKE_REPLY, version.c_str ()); #else size_t l = snprintf (m_Buffer, SAM_SOCKET_BUFFER_SIZE, SAM_HANDSHAKE_REPLY, version.c_str ()); #endif boost::asio::async_write (m_Socket, boost::asio::buffer (m_Buffer, l), boost::asio::transfer_all (), std::bind(&SAMSocket::HandleHandshakeReplySent, shared_from_this (), std::placeholders::_1, std::placeholders::_2)); } else SendMessageReply (SAM_HANDSHAKE_I2P_ERROR, strlen (SAM_HANDSHAKE_I2P_ERROR), true); } else { LogPrint (eLogError, "SAM: handshake mismatch"); Terminate ("SAM: handshake mismatch"); } } } void SAMSocket::HandleHandshakeReplySent (const boost::system::error_code& ecode, std::size_t bytes_transferred) { if (ecode) { LogPrint (eLogError, "SAM: handshake reply send error: ", ecode.message ()); if (ecode != boost::asio::error::operation_aborted) Terminate ("SAM: handshake reply send error"); } else { m_Socket.async_read_some (boost::asio::buffer(m_Buffer, SAM_SOCKET_BUFFER_SIZE), std::bind(&SAMSocket::HandleMessage, shared_from_this (), std::placeholders::_1, std::placeholders::_2)); } } void SAMSocket::SendMessageReply (const char * msg, size_t len, bool close) { LogPrint (eLogDebug, "SAMSocket::SendMessageReply, close=",close?"true":"false", " reason: ", msg); if (!m_IsSilent) boost::asio::async_write (m_Socket, boost::asio::buffer (msg, len), boost::asio::transfer_all (), std::bind(&SAMSocket::HandleMessageReplySent, shared_from_this (), std::placeholders::_1, std::placeholders::_2, close)); else { if (close) Terminate ("SAMSocket::SendMessageReply(close=true)"); else Receive (); } } void SAMSocket::HandleMessageReplySent (const boost::system::error_code& ecode, std::size_t bytes_transferred, bool close) { if (ecode) { LogPrint (eLogError, "SAM: reply send error: ", ecode.message ()); if (ecode != boost::asio::error::operation_aborted) Terminate ("SAM: reply send error"); } else { if (close) Terminate ("SAMSocket::HandleMessageReplySent(close=true)"); else Receive (); } } void SAMSocket::HandleMessage (const boost::system::error_code& ecode, std::size_t bytes_transferred) { if (ecode) { LogPrint (eLogError, "SAM: read error: ", ecode.message ()); if (ecode != boost::asio::error::operation_aborted) Terminate ("SAM: read error"); } else if (m_SocketType == eSAMSocketTypeStream) HandleReceived (ecode, bytes_transferred); else { bytes_transferred += m_BufferOffset; m_BufferOffset = 0; m_Buffer[bytes_transferred] = 0; char * eol = (char *)memchr (m_Buffer, '\n', bytes_transferred); if (eol) { *eol = 0; char * separator = strchr (m_Buffer, ' '); if (separator) { separator = strchr (separator + 1, ' '); if (separator) *separator = 0; else separator = eol; if (!strcmp (m_Buffer, SAM_SESSION_CREATE)) ProcessSessionCreate (separator + 1, bytes_transferred - (separator - m_Buffer) - 1); else if (!strcmp (m_Buffer, SAM_STREAM_CONNECT)) ProcessStreamConnect (separator + 1, bytes_transferred - (separator - m_Buffer) - 1, bytes_transferred - (eol - m_Buffer) - 1); else if (!strcmp (m_Buffer, SAM_STREAM_ACCEPT)) ProcessStreamAccept (separator + 1, bytes_transferred - (separator - m_Buffer) - 1); else if (!strcmp (m_Buffer, SAM_DEST_GENERATE)) ProcessDestGenerate (separator + 1, bytes_transferred - (separator - m_Buffer) - 1); else if (!strcmp (m_Buffer, SAM_NAMING_LOOKUP)) ProcessNamingLookup (separator + 1, bytes_transferred - (separator - m_Buffer) - 1); else if (!strcmp (m_Buffer, SAM_DATAGRAM_SEND)) { size_t len = bytes_transferred - (separator - m_Buffer) - 1; size_t processed = ProcessDatagramSend (separator + 1, len, eol + 1); if (processed < len) { m_BufferOffset = len - processed; if (processed > 0) memmove (m_Buffer, separator + 1 + processed, m_BufferOffset); else { // restore string back *separator = ' '; *eol = '\n'; } } // since it's SAM v1 reply is not expected Receive (); } else { LogPrint (eLogError, "SAM: unexpected message ", m_Buffer); Terminate ("SAM: unexpected message"); } } else { LogPrint (eLogError, "SAM: malformed message ", m_Buffer); Terminate ("malformed message"); } } else { LogPrint (eLogWarning, "SAM: incomplete message ", bytes_transferred); m_BufferOffset = bytes_transferred; // try to receive remaining message Receive (); } } } void SAMSocket::ProcessSessionCreate (char * buf, size_t len) { LogPrint (eLogDebug, "SAM: session create: ", buf); std::map<std::string, std::string> params; ExtractParams (buf, params); std::string& style = params[SAM_PARAM_STYLE]; std::string& id = params[SAM_PARAM_ID]; std::string& destination = params[SAM_PARAM_DESTINATION]; m_ID = id; if (m_Owner.FindSession (id)) { // session exists SendMessageReply (SAM_SESSION_CREATE_DUPLICATED_ID, strlen(SAM_SESSION_CREATE_DUPLICATED_ID), true); return; } std::shared_ptr<boost::asio::ip::udp::endpoint> forward = nullptr; if (style == SAM_VALUE_DATAGRAM && params.find(SAM_VALUE_HOST) != params.end() && params.find(SAM_VALUE_PORT) != params.end()) { // udp forward selected boost::system::error_code e; // TODO: support hostnames in udp forward auto addr = boost::asio::ip::address::from_string(params[SAM_VALUE_HOST], e); if (e) { // not an ip address SendI2PError("Invalid IP Address in HOST"); return; } auto port = std::stoi(params[SAM_VALUE_PORT]); if (port == -1) { SendI2PError("Invalid port"); return; } forward = std::make_shared<boost::asio::ip::udp::endpoint>(addr, port); } // create destination m_Session = m_Owner.CreateSession (id, destination == SAM_VALUE_TRANSIENT ? "" : destination, &params); if (m_Session) { m_SocketType = eSAMSocketTypeSession; if (style == SAM_VALUE_DATAGRAM) { m_Session->UDPEndpoint = forward; auto dest = m_Session->localDestination->CreateDatagramDestination (); dest->SetReceiver (std::bind (&SAMSocket::HandleI2PDatagramReceive, shared_from_this (), std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4, std::placeholders::_5)); } if (m_Session->localDestination->IsReady ()) SendSessionCreateReplyOk (); else { m_Timer.expires_from_now (boost::posix_time::seconds(SAM_SESSION_READINESS_CHECK_INTERVAL)); m_Timer.async_wait (std::bind (&SAMSocket::HandleSessionReadinessCheckTimer, shared_from_this (), std::placeholders::_1)); } } else SendMessageReply (SAM_SESSION_CREATE_DUPLICATED_DEST, strlen(SAM_SESSION_CREATE_DUPLICATED_DEST), true); } void SAMSocket::HandleSessionReadinessCheckTimer (const boost::system::error_code& ecode) { if (ecode != boost::asio::error::operation_aborted) { if (m_Session->localDestination->IsReady ()) SendSessionCreateReplyOk (); else { m_Timer.expires_from_now (boost::posix_time::seconds(SAM_SESSION_READINESS_CHECK_INTERVAL)); m_Timer.async_wait (std::bind (&SAMSocket::HandleSessionReadinessCheckTimer, shared_from_this (), std::placeholders::_1)); } } } void SAMSocket::SendSessionCreateReplyOk () { uint8_t buf[1024]; char priv[1024]; size_t l = m_Session->localDestination->GetPrivateKeys ().ToBuffer (buf, 1024); size_t l1 = i2p::data::ByteStreamToBase64 (buf, l, priv, 1024); priv[l1] = 0; #ifdef _MSC_VER size_t l2 = sprintf_s (m_Buffer, SAM_SOCKET_BUFFER_SIZE, SAM_SESSION_CREATE_REPLY_OK, priv); #else size_t l2 = snprintf (m_Buffer, SAM_SOCKET_BUFFER_SIZE, SAM_SESSION_CREATE_REPLY_OK, priv); #endif SendMessageReply (m_Buffer, l2, false); } void SAMSocket::ProcessStreamConnect (char * buf, size_t len, size_t rem) { LogPrint (eLogDebug, "SAM: stream connect: ", buf); std::map<std::string, std::string> params; ExtractParams (buf, params); std::string& id = params[SAM_PARAM_ID]; std::string& destination = params[SAM_PARAM_DESTINATION]; std::string& silent = params[SAM_PARAM_SILENT]; if (silent == SAM_VALUE_TRUE) m_IsSilent = true; m_ID = id; m_Session = m_Owner.FindSession (id); if (m_Session) { if (rem > 0) // handle follow on data { memmove (m_Buffer, buf + len + 1, rem); // buf is a pointer to m_Buffer's content m_BufferOffset = rem; } else m_BufferOffset = 0; auto dest = std::make_shared<i2p::data::IdentityEx> (); size_t l = dest->FromBase64(destination); if (l > 0) { context.GetAddressBook().InsertAddress(dest); auto leaseSet = m_Session->localDestination->FindLeaseSet(dest->GetIdentHash()); if (leaseSet) Connect(leaseSet); else { m_Session->localDestination->RequestDestination(dest->GetIdentHash(), std::bind(&SAMSocket::HandleConnectLeaseSetRequestComplete, shared_from_this(), std::placeholders::_1)); } } else SendMessageReply(SAM_SESSION_STATUS_INVALID_KEY, strlen(SAM_SESSION_STATUS_INVALID_KEY), true); } else SendMessageReply (SAM_STREAM_STATUS_INVALID_ID, strlen(SAM_STREAM_STATUS_INVALID_ID), true); } void SAMSocket::Connect (std::shared_ptr<const i2p::data::LeaseSet> remote) { m_SocketType = eSAMSocketTypeStream; m_Session->AddSocket (shared_from_this ()); m_Stream = m_Session->localDestination->CreateStream (remote); m_Stream->Send ((uint8_t *)m_Buffer, m_BufferOffset); // connect and send m_BufferOffset = 0; I2PReceive (); SendMessageReply (SAM_STREAM_STATUS_OK, strlen(SAM_STREAM_STATUS_OK), false); } void SAMSocket::HandleConnectLeaseSetRequestComplete (std::shared_ptr<i2p::data::LeaseSet> leaseSet) { if (leaseSet) Connect (leaseSet); else { LogPrint (eLogError, "SAM: destination to connect not found"); SendMessageReply (SAM_STREAM_STATUS_CANT_REACH_PEER, strlen(SAM_STREAM_STATUS_CANT_REACH_PEER), true); } } void SAMSocket::ProcessStreamAccept (char * buf, size_t len) { LogPrint (eLogDebug, "SAM: stream accept: ", buf); std::map<std::string, std::string> params; ExtractParams (buf, params); std::string& id = params[SAM_PARAM_ID]; std::string& silent = params[SAM_PARAM_SILENT]; if (silent == SAM_VALUE_TRUE) m_IsSilent = true; m_ID = id; m_Session = m_Owner.FindSession (id); if (m_Session) { m_SocketType = eSAMSocketTypeAcceptor; m_Session->AddSocket (shared_from_this ()); if (!m_Session->localDestination->IsAcceptingStreams ()) { m_IsAccepting = true; m_Session->localDestination->AcceptOnce (std::bind (&SAMSocket::HandleI2PAccept, shared_from_this (), std::placeholders::_1)); } SendMessageReply (SAM_STREAM_STATUS_OK, strlen(SAM_STREAM_STATUS_OK), false); } else SendMessageReply (SAM_STREAM_STATUS_INVALID_ID, strlen(SAM_STREAM_STATUS_INVALID_ID), true); } size_t SAMSocket::ProcessDatagramSend (char * buf, size_t len, const char * data) { LogPrint (eLogDebug, "SAM: datagram send: ", buf, " ", len); std::map<std::string, std::string> params; ExtractParams (buf, params); size_t size = std::stoi(params[SAM_PARAM_SIZE]), offset = data - buf; if (offset + size <= len) { if (m_Session) { auto d = m_Session->localDestination->GetDatagramDestination (); if (d) { i2p::data::IdentityEx dest; dest.FromBase64 (params[SAM_PARAM_DESTINATION]); d->SendDatagramTo ((const uint8_t *)data, size, dest.GetIdentHash ()); } else LogPrint (eLogError, "SAM: missing datagram destination"); } else LogPrint (eLogError, "SAM: session is not created from DATAGRAM SEND"); } else { LogPrint (eLogWarning, "SAM: sent datagram size ", size, " exceeds buffer ", len - offset); return 0; // try to receive more } return offset + size; } void SAMSocket::ProcessDestGenerate (char * buf, size_t len) { LogPrint (eLogDebug, "SAM: dest generate"); std::map<std::string, std::string> params; ExtractParams (buf, params); // extract signature type i2p::data::SigningKeyType signatureType = i2p::data::SIGNING_KEY_TYPE_DSA_SHA1; i2p::data::CryptoKeyType cryptoType = i2p::data::CRYPTO_KEY_TYPE_ELGAMAL; auto it = params.find (SAM_PARAM_SIGNATURE_TYPE); if (it != params.end ()) // TODO: extract string values signatureType = std::stoi(it->second); it = params.find (SAM_PARAM_CRYPTO_TYPE); if (it != params.end ()) cryptoType = std::stoi(it->second); auto keys = i2p::data::PrivateKeys::CreateRandomKeys (signatureType, cryptoType); #ifdef _MSC_VER size_t l = sprintf_s (m_Buffer, SAM_SOCKET_BUFFER_SIZE, SAM_DEST_REPLY, keys.GetPublic ()->ToBase64 ().c_str (), keys.ToBase64 ().c_str ()); #else size_t l = snprintf (m_Buffer, SAM_SOCKET_BUFFER_SIZE, SAM_DEST_REPLY, keys.GetPublic ()->ToBase64 ().c_str (), keys.ToBase64 ().c_str ()); #endif SendMessageReply (m_Buffer, l, false); } void SAMSocket::ProcessNamingLookup (char * buf, size_t len) { LogPrint (eLogDebug, "SAM: naming lookup: ", buf); std::map<std::string, std::string> params; ExtractParams (buf, params); std::string& name = params[SAM_PARAM_NAME]; std::shared_ptr<const i2p::data::IdentityEx> identity; i2p::data::IdentHash ident; auto dest = m_Session == nullptr ? context.GetSharedLocalDestination() : m_Session->localDestination; if (name == "ME") SendNamingLookupReply (dest->GetIdentity ()); else if ((identity = context.GetAddressBook ().GetAddress (name)) != nullptr) SendNamingLookupReply (identity); else if (context.GetAddressBook ().GetIdentHash (name, ident)) { auto leaseSet = dest->FindLeaseSet (ident); if (leaseSet) SendNamingLookupReply (leaseSet->GetIdentity ()); else dest->RequestDestination (ident, std::bind (&SAMSocket::HandleNamingLookupLeaseSetRequestComplete, shared_from_this (), std::placeholders::_1, ident)); } else { LogPrint (eLogError, "SAM: naming failed, unknown address ", name); #ifdef _MSC_VER size_t len = sprintf_s (m_Buffer, SAM_SOCKET_BUFFER_SIZE, SAM_NAMING_REPLY_INVALID_KEY, name.c_str()); #else size_t len = snprintf (m_Buffer, SAM_SOCKET_BUFFER_SIZE, SAM_NAMING_REPLY_INVALID_KEY, name.c_str()); #endif SendMessageReply (m_Buffer, len, false); } } void SAMSocket::SendI2PError(const std::string & msg) { LogPrint (eLogError, "SAM: i2p error ", msg); #ifdef _MSC_VER size_t len = sprintf_s (m_Buffer, SAM_SOCKET_BUFFER_SIZE, SAM_SESSION_STATUS_I2P_ERROR, msg.c_str()); #else size_t len = snprintf (m_Buffer, SAM_SOCKET_BUFFER_SIZE, SAM_SESSION_STATUS_I2P_ERROR, msg.c_str()); #endif SendMessageReply (m_Buffer, len, true); } void SAMSocket::HandleNamingLookupLeaseSetRequestComplete (std::shared_ptr<i2p::data::LeaseSet> leaseSet, i2p::data::IdentHash ident) { if (leaseSet) { context.GetAddressBook ().InsertAddress (leaseSet->GetIdentity ()); SendNamingLookupReply (leaseSet->GetIdentity ()); } else { LogPrint (eLogError, "SAM: naming lookup failed. LeaseSet for ", ident.ToBase32 (), " not found"); #ifdef _MSC_VER size_t len = sprintf_s (m_Buffer, SAM_SOCKET_BUFFER_SIZE, SAM_NAMING_REPLY_INVALID_KEY, context.GetAddressBook ().ToAddress (ident).c_str()); #else size_t len = snprintf (m_Buffer, SAM_SOCKET_BUFFER_SIZE, SAM_NAMING_REPLY_INVALID_KEY, context.GetAddressBook ().ToAddress (ident).c_str()); #endif SendMessageReply (m_Buffer, len, false); } } void SAMSocket::SendNamingLookupReply (std::shared_ptr<const i2p::data::IdentityEx> identity) { auto base64 = identity->ToBase64 (); #ifdef _MSC_VER size_t l = sprintf_s (m_Buffer, SAM_SOCKET_BUFFER_SIZE, SAM_NAMING_REPLY, base64.c_str ()); #else size_t l = snprintf (m_Buffer, SAM_SOCKET_BUFFER_SIZE, SAM_NAMING_REPLY, base64.c_str ()); #endif SendMessageReply (m_Buffer, l, false); } void SAMSocket::ExtractParams (char * buf, std::map<std::string, std::string>& params) { char * separator; do { separator = strchr (buf, ' '); if (separator) *separator = 0; char * value = strchr (buf, '='); if (value) { *value = 0; value++; params[buf] = value; } buf = separator + 1; } while (separator); } void SAMSocket::Receive () { if (m_BufferOffset >= SAM_SOCKET_BUFFER_SIZE) { LogPrint (eLogError, "SAM: Buffer is full, terminate"); Terminate ("Buffer is full"); return; } m_Socket.async_read_some (boost::asio::buffer(m_Buffer + m_BufferOffset, SAM_SOCKET_BUFFER_SIZE - m_BufferOffset), std::bind((m_SocketType == eSAMSocketTypeStream) ? &SAMSocket::HandleReceived : &SAMSocket::HandleMessage, shared_from_this (), std::placeholders::_1, std::placeholders::_2)); } void SAMSocket::HandleReceived (const boost::system::error_code& ecode, std::size_t bytes_transferred) { if (ecode) { LogPrint (eLogError, "SAM: read error: ", ecode.message ()); if (ecode != boost::asio::error::operation_aborted) Terminate ("read error"); } else { if (m_Stream) { bytes_transferred += m_BufferOffset; m_BufferOffset = 0; auto s = shared_from_this (); m_Stream->AsyncSend ((uint8_t *)m_Buffer, bytes_transferred, [s](const boost::system::error_code& ecode) { if (!ecode) s->Receive (); else s->m_Owner.GetService ().post ([s] { s->Terminate ("AsyncSend failed"); }); }); } } } void SAMSocket::I2PReceive () { if (m_Stream) { if (m_Stream->GetStatus () == i2p::stream::eStreamStatusNew || m_Stream->GetStatus () == i2p::stream::eStreamStatusOpen) // regular { m_Stream->AsyncReceive (boost::asio::buffer (m_StreamBuffer, SAM_SOCKET_BUFFER_SIZE), std::bind (&SAMSocket::HandleI2PReceive, shared_from_this (), std::placeholders::_1, std::placeholders::_2), SAM_SOCKET_CONNECTION_MAX_IDLE); } else // closed by peer { // get remaning data auto len = m_Stream->ReadSome (m_StreamBuffer, SAM_SOCKET_BUFFER_SIZE); if (len > 0) // still some data { boost::asio::async_write (m_Socket, boost::asio::buffer (m_StreamBuffer, len), std::bind (&SAMSocket::HandleWriteI2PData, shared_from_this (), std::placeholders::_1)); } else // no more data Terminate ("no more data"); } } } void SAMSocket::HandleI2PReceive (const boost::system::error_code& ecode, std::size_t bytes_transferred) { if (ecode) { LogPrint (eLogError, "SAM: stream read error: ", ecode.message ()); if (ecode != boost::asio::error::operation_aborted) { if (bytes_transferred > 0) boost::asio::async_write (m_Socket, boost::asio::buffer (m_StreamBuffer, bytes_transferred), std::bind (&SAMSocket::HandleWriteI2PData, shared_from_this (), std::placeholders::_1)); // postpone termination else { auto s = shared_from_this (); m_Owner.GetService ().post ([s] { s->Terminate ("stream read error"); }); } } else { auto s = shared_from_this (); m_Owner.GetService ().post ([s] { s->Terminate ("stream read error (op aborted)"); }); } } else { if (m_SocketType != eSAMSocketTypeTerminated) // check for possible race condition with Terminate() boost::asio::async_write (m_Socket, boost::asio::buffer (m_StreamBuffer, bytes_transferred), std::bind (&SAMSocket::HandleWriteI2PData, shared_from_this (), std::placeholders::_1)); } } void SAMSocket::HandleWriteI2PData (const boost::system::error_code& ecode) { if (ecode) { LogPrint (eLogError, "SAM: socket write error: ", ecode.message ()); if (ecode != boost::asio::error::operation_aborted) Terminate ("socket write error at HandleWriteI2PData"); } else I2PReceive (); } void SAMSocket::HandleI2PAccept (std::shared_ptr<i2p::stream::Stream> stream) { if (stream) { LogPrint (eLogDebug, "SAM: incoming I2P connection for session ", m_ID); m_SocketType = eSAMSocketTypeStream; m_IsAccepting = false; m_Stream = stream; context.GetAddressBook ().InsertAddress (stream->GetRemoteIdentity ()); auto session = m_Owner.FindSession (m_ID); if (session) { // find more pending acceptors for (auto it: session->ListSockets ()) if (it->m_SocketType == eSAMSocketTypeAcceptor) { it->m_IsAccepting = true; session->localDestination->AcceptOnce (std::bind (&SAMSocket::HandleI2PAccept, it, std::placeholders::_1)); break; } } if (!m_IsSilent) { // get remote peer address auto ident_ptr = stream->GetRemoteIdentity(); const size_t ident_len = ident_ptr->GetFullLen(); uint8_t* ident = new uint8_t[ident_len]; // send remote peer address as base64 const size_t l = ident_ptr->ToBuffer (ident, ident_len); const size_t l1 = i2p::data::ByteStreamToBase64 (ident, l, (char *)m_StreamBuffer, SAM_SOCKET_BUFFER_SIZE); delete[] ident; m_StreamBuffer[l1] = '\n'; HandleI2PReceive (boost::system::error_code (), l1 +1); // we send identity like it has been received from stream } else I2PReceive (); } else LogPrint (eLogWarning, "SAM: I2P acceptor has been reset"); } void SAMSocket::HandleI2PDatagramReceive (const i2p::data::IdentityEx& from, uint16_t fromPort, uint16_t toPort, const uint8_t * buf, size_t len) { LogPrint (eLogDebug, "SAM: datagram received ", len); auto base64 = from.ToBase64 (); auto ep = m_Session->UDPEndpoint; if (ep) { // udp forward enabled size_t bsz = base64.size(); size_t sz = bsz + 1 + len; // build datagram body uint8_t * data = new uint8_t[sz]; // Destination memcpy(data, base64.c_str(), bsz); // linefeed data[bsz] = '\n'; // Payload memcpy(data+bsz+1, buf, len); // send to remote endpoint m_Owner.SendTo(data, sz, ep); delete [] data; } else { #ifdef _MSC_VER size_t l = sprintf_s ((char *)m_StreamBuffer, SAM_SOCKET_BUFFER_SIZE, SAM_DATAGRAM_RECEIVED, base64.c_str (), (long unsigned int)len); #else size_t l = snprintf ((char *)m_StreamBuffer, SAM_SOCKET_BUFFER_SIZE, SAM_DATAGRAM_RECEIVED, base64.c_str (), (long unsigned int)len); #endif if (len < SAM_SOCKET_BUFFER_SIZE - l) { memcpy (m_StreamBuffer + l, buf, len); boost::asio::async_write (m_Socket, boost::asio::buffer (m_StreamBuffer, len + l), std::bind (&SAMSocket::HandleWriteI2PData, shared_from_this (), std::placeholders::_1)); } else LogPrint (eLogWarning, "SAM: received datagram size ", len," exceeds buffer"); } } SAMSession::SAMSession (std::shared_ptr<ClientDestination> dest): localDestination (dest), UDPEndpoint(nullptr) { } SAMSession::~SAMSession () { CloseStreams(); i2p::client::context.DeleteLocalDestination (localDestination); } void SAMSession::CloseStreams () { std::vector<std::shared_ptr<SAMSocket> > socks; { std::lock_guard<std::mutex> lock(m_SocketsMutex); for (const auto& sock : m_Sockets) { socks.push_back(sock); } } for (auto & sock : socks ) sock->Terminate("SAMSession::CloseStreams()"); m_Sockets.clear(); } SAMBridge::SAMBridge (const std::string& address, int port): m_IsRunning (false), m_Thread (nullptr), m_Acceptor (m_Service, boost::asio::ip::tcp::endpoint(boost::asio::ip::address::from_string(address), port)), m_DatagramEndpoint (boost::asio::ip::address::from_string(address), port-1), m_DatagramSocket (m_Service, m_DatagramEndpoint) { } SAMBridge::~SAMBridge () { if (m_IsRunning) Stop (); } void SAMBridge::Start () { Accept (); ReceiveDatagram (); m_IsRunning = true; m_Thread = new std::thread (std::bind (&SAMBridge::Run, this)); } void SAMBridge::Stop () { m_IsRunning = false; m_Acceptor.cancel (); for (auto& it: m_Sessions) it.second->CloseStreams (); m_Sessions.clear (); m_Service.stop (); if (m_Thread) { m_Thread->join (); delete m_Thread; m_Thread = nullptr; } } void SAMBridge::Run () { while (m_IsRunning) { try { m_Service.run (); } catch (std::exception& ex) { LogPrint (eLogError, "SAM: runtime exception: ", ex.what ()); } } } void SAMBridge::Accept () { auto newSocket = std::make_shared<SAMSocket> (*this); m_Acceptor.async_accept (newSocket->GetSocket (), std::bind (&SAMBridge::HandleAccept, this, std::placeholders::_1, newSocket)); } void SAMBridge::HandleAccept(const boost::system::error_code& ecode, std::shared_ptr<SAMSocket> socket) { if (!ecode) { boost::system::error_code ec; auto ep = socket->GetSocket ().remote_endpoint (ec); if (!ec) { LogPrint (eLogDebug, "SAM: new connection from ", ep); socket->ReceiveHandshake (); } else LogPrint (eLogError, "SAM: incoming connection error ", ec.message ()); } else LogPrint (eLogError, "SAM: accept error: ", ecode.message ()); if (ecode != boost::asio::error::operation_aborted) Accept (); } std::shared_ptr<SAMSession> SAMBridge::CreateSession (const std::string& id, const std::string& destination, const std::map<std::string, std::string> * params) { std::shared_ptr<ClientDestination> localDestination = nullptr; if (destination != "") { i2p::data::PrivateKeys keys; if (!keys.FromBase64 (destination)) return nullptr; localDestination = i2p::client::context.CreateNewLocalDestination (keys, true, params); } else // transient { // extract signature type i2p::data::SigningKeyType signatureType = i2p::data::SIGNING_KEY_TYPE_DSA_SHA1; i2p::data::CryptoKeyType cryptoType = i2p::data::CRYPTO_KEY_TYPE_ELGAMAL; if (params) { auto it = params->find (SAM_PARAM_SIGNATURE_TYPE); if (it != params->end ()) // TODO: extract string values signatureType = std::stoi(it->second); it = params->find (SAM_PARAM_CRYPTO_TYPE); if (it != params->end ()) cryptoType = std::stoi(it->second); } localDestination = i2p::client::context.CreateNewLocalDestination (true, signatureType, cryptoType, params); } if (localDestination) { localDestination->Acquire (); auto session = std::make_shared<SAMSession>(localDestination); std::unique_lock<std::mutex> l(m_SessionsMutex); auto ret = m_Sessions.insert (std::make_pair(id, session)); if (!ret.second) LogPrint (eLogWarning, "SAM: Session ", id, " already exists"); return ret.first->second; } return nullptr; } void SAMBridge::CloseSession (const std::string& id) { std::shared_ptr<SAMSession> session; { std::unique_lock<std::mutex> l(m_SessionsMutex); auto it = m_Sessions.find (id); if (it != m_Sessions.end ()) { session = it->second; m_Sessions.erase (it); } } if (session) { session->localDestination->Release (); session->localDestination->StopAcceptingStreams (); session->CloseStreams (); } } std::shared_ptr<SAMSession> SAMBridge::FindSession (const std::string& id) const { std::unique_lock<std::mutex> l(m_SessionsMutex); auto it = m_Sessions.find (id); if (it != m_Sessions.end ()) return it->second; return nullptr; } void SAMBridge::SendTo(const uint8_t * buf, size_t len, std::shared_ptr<boost::asio::ip::udp::endpoint> remote) { if(remote) { m_DatagramSocket.send_to(boost::asio::buffer(buf, len), *remote); } } void SAMBridge::ReceiveDatagram () { m_DatagramSocket.async_receive_from ( boost::asio::buffer (m_DatagramReceiveBuffer, i2p::datagram::MAX_DATAGRAM_SIZE), m_SenderEndpoint, std::bind (&SAMBridge::HandleReceivedDatagram, this, std::placeholders::_1, std::placeholders::_2)); } void SAMBridge::HandleReceivedDatagram (const boost::system::error_code& ecode, std::size_t bytes_transferred) { if (!ecode) { m_DatagramReceiveBuffer[bytes_transferred] = 0; char * eol = strchr ((char *)m_DatagramReceiveBuffer, '\n'); *eol = 0; eol++; size_t payloadLen = bytes_transferred - ((uint8_t *)eol - m_DatagramReceiveBuffer); LogPrint (eLogDebug, "SAM: datagram received ", m_DatagramReceiveBuffer," size=", payloadLen); char * sessionID = strchr ((char *)m_DatagramReceiveBuffer, ' '); if (sessionID) { sessionID++; char * destination = strchr (sessionID, ' '); if (destination) { *destination = 0; destination++; auto session = FindSession (sessionID); if (session) { i2p::data::IdentityEx dest; dest.FromBase64 (destination); session->localDestination->GetDatagramDestination ()-> SendDatagramTo ((uint8_t *)eol, payloadLen, dest.GetIdentHash ()); } else LogPrint (eLogError, "SAM: Session ", sessionID, " not found"); } else LogPrint (eLogError, "SAM: Missing destination key"); } else LogPrint (eLogError, "SAM: Missing sessionID"); ReceiveDatagram (); } else LogPrint (eLogError, "SAM: datagram receive error: ", ecode.message ()); } } }
31.129252
146
0.676761
KenanSulayman
14015331ee63314407f3da4cc1f599ded0369e93
2,846
hpp
C++
include/pxx/core/iter_range/iter_range.hpp
GarrickLin/pxx11
f7519b678678c60540a68d26aa04fe95d4c0873f
[ "MIT" ]
1
2019-06-11T08:30:24.000Z
2019-06-11T08:30:24.000Z
include/pxx/core/iter_range/iter_range.hpp
GarrickLin/pxx11
f7519b678678c60540a68d26aa04fe95d4c0873f
[ "MIT" ]
null
null
null
include/pxx/core/iter_range/iter_range.hpp
GarrickLin/pxx11
f7519b678678c60540a68d26aa04fe95d4c0873f
[ "MIT" ]
null
null
null
#pragma once namespace detail_range { template <typename T> class iterator { public: using value_type = T; using size_type = size_t; private: size_type cursor_; const value_type step_; value_type value_; public: iterator(size_type cur_start, value_type begin_val, value_type step_val) : cursor_(cur_start) , step_(step_val) , value_(begin_val) { value_ += (step_ * cursor_); } value_type operator* () const {return value_;} bool operator!=(const iterator& rhs) const { return (cursor_!=rhs.cursor_); } iterator& operator++(void) { // prefix ++ opetator only value_ += step_; ++cursor_; return (*this); } }; template <typename T> class impl { public: using value_type = T; using reference = const value_type&; using const_reference = const value_type&; using iterator = const detail_range::iterator<value_type>; using const_iterator = const detail_range::iterator<value_type>; using size_type = typename iterator::size_type; private: const value_type begin_; const value_type end_; const value_type step_; const size_type max_count_; size_type get_adjust_count(void) const { if (step_ > 0 && begin_ >= end_) throw std::logic_error("End value must be greater than begin value."); else if (step_ < 0 && begin_ <= end_) throw std::logic_error("End value must be less than begin value."); size_type x = static_cast<size_type>((end_-begin_)/step_); if (begin_ + (step_ * x) != end_) ++x; return x; } public: impl(value_type begin_val, value_type end_val, value_type step_val) : begin_(begin_val) , end_(end_val) , step_(step_val) , max_count_(get_adjust_count()) {} size_type size(void) const { return max_count_; } const_iterator begin(void) const { return {0, begin_, step_}; } const iterator end(void) const { return {max_count_, begin_, step_}; } }; } // namespace detail_range namespace pxx { template<typename T> detail_range::impl<T> range(T end) { return {{}, end, 1}; } template<typename T> detail_range::impl<T> range(T begin, T end) { return {begin, end, 1}; } template<typename T, typename U> auto range(T begin, T end, U step) -> detail_range::impl<decltype(begin + step)> { // may be narrowing using r_t = detail_range::impl<decltype(begin + step)>; return r_t(begin, end, step); } } // namespace pxx
27.901961
86
0.572734
GarrickLin
1402922a68d3106dc2384ff06fb9ff40710e1031
85
cpp
C++
cplusplus/Complex2.cpp
chtld/Programming-and-Algorithm-Course
669f266fc97db9050013ffbb388517667de33433
[ "MIT" ]
2
2019-06-10T11:50:06.000Z
2019-10-14T08:00:41.000Z
cplusplus/Complex2.cpp
chtld/Programming-and-Algorithm-Course
669f266fc97db9050013ffbb388517667de33433
[ "MIT" ]
null
null
null
cplusplus/Complex2.cpp
chtld/Programming-and-Algorithm-Course
669f266fc97db9050013ffbb388517667de33433
[ "MIT" ]
null
null
null
#include <isotream> #include <cstring> using namespace std; class Complex{ }
12.142857
21
0.682353
chtld
1403fd7c3e49565760a0788e3a1c44d816f43b5c
7,257
cpp
C++
Desktop/CCore/src/video/lib/Shape.LineEdit.cpp
SergeyStrukov/CCore-2-99
1eca5b9b2de067bbab43326718b877465ae664fe
[ "BSL-1.0" ]
1
2016-05-22T07:51:02.000Z
2016-05-22T07:51:02.000Z
Desktop/CCore/src/video/lib/Shape.LineEdit.cpp
SergeyStrukov/CCore-2-99
1eca5b9b2de067bbab43326718b877465ae664fe
[ "BSL-1.0" ]
null
null
null
Desktop/CCore/src/video/lib/Shape.LineEdit.cpp
SergeyStrukov/CCore-2-99
1eca5b9b2de067bbab43326718b877465ae664fe
[ "BSL-1.0" ]
null
null
null
/* Shape.LineEdit.cpp */ //---------------------------------------------------------------------------------------- // // Project: CCore 3.00 // // Tag: Desktop // // License: Boost Software License - Version 1.0 - August 17th, 2003 // // see http://www.boost.org/LICENSE_1_0.txt or the local copy // // Copyright (c) 2016 Sergey Strukov. All rights reserved. // //---------------------------------------------------------------------------------------- #include <CCore/inc/video/lib/Shape.LineEdit.h> #include <CCore/inc/video/FigureLib.h> namespace CCore { namespace Video { /* class LineEditShape */ MCoord LineEditShape::FigEX(Coord fdy,MCoord width,Coord ex) { return (Fraction(fdy)+2*width)/4+Fraction(ex); } Point LineEditShape::getMinSize() const { return getMinSize("Sample 1234567890"); } Point LineEditShape::getMinSize(StrLen sample_text) const { Font font=cfg.font.get(); MCoord width=+cfg.width; FontSize fs=font->getSize(); MCoord ex=FigEX(fs.dy,width,+cfg.ex); Coordinate dx=RoundUpLen(ex+width); Coordinate dy=RoundUpLen(width); Coordinate cursor_dx=+cfg.cursor_dx; TextSize ts=font->text_guarded(sample_text); return Point(ts.full_dx,ts.dy)+Point(2*dx+2*cursor_dx+dy+IntAbs(fs.skew),2*dy+2*cursor_dx)+(+cfg.space); } void LineEditShape::setMax() { Font font=cfg.font.get(); MCoord width=+cfg.width; FontSize fs=font->getSize(); MCoord ex=FigEX(fs.dy,width,+cfg.ex); Coord dx=RoundUpLen(ex+width); Coord dy=RoundUpLen(width); Pane inner=pane.shrink(dx,dy); if( +inner ) { TextSize ts=font->text_guarded(text_buf.prefix(len)); Coordinate cursor_dx=+cfg.cursor_dx; Coordinate extra=2*cursor_dx+dy+IntAbs(fs.skew); Coordinate tx=ts.full_dx+extra; if( tx>inner.dx ) xoffMax=+tx-inner.dx; else xoffMax=0; dxoff=fs.medDX(); } else { xoffMax=0; dxoff=fs.medDX(); } } void LineEditShape::showCursor() { Font font=cfg.font.get(); MCoord width=+cfg.width; FontSize fs=font->getSize(); MCoord ex=FigEX(fs.dy,width,+cfg.ex); Coord dx=RoundUpLen(ex+width); Coord dy=RoundUpLen(width); Pane inner=pane.shrink(dx,dy); if( +inner ) { bool show_cursor = enable && ( !hide_cursor || focus ) ; ulen pos = show_cursor? this->pos : len ; TextSize ts=font->text_guarded(text_buf.prefix(pos)); Coordinate cursor_dx=+cfg.cursor_dx; Coordinate x1=(fs.dx0+cursor_dx)-xoff; Coordinate x=x1+ts.dx; Coordinate a=cursor_dx; Coordinate b=inner.dx-2*cursor_dx; if( x<a ) { xoff -= +Min_cast(a-x,xoff) ; } else if( x>b ) { xoff += +Min_cast(x-b,xoffMax-xoff) ; } } } ulen LineEditShape::getPosition(Point point) const { Font font=cfg.font.get(); MCoord width=+cfg.width; FontSize fs=font->getSize(); MCoord ex=FigEX(fs.dy,width,+cfg.ex); Coord dx=RoundUpLen(ex+width); Coord dy=RoundUpLen(width); Pane inner=pane.shrink(dx,dy); if( !inner ) return 0; bool show_cursor = enable && ( !hide_cursor || focus ) ; ulen pos = show_cursor? this->pos : len ; point-=inner.getBase(); TextSize ts=font->text_guarded(text_buf.prefix(pos)); Coordinate cursor_dx=+cfg.cursor_dx; Coordinate x1=(fs.dx0+cursor_dx)-xoff; Coordinate x2=x1+ts.dx; Coordinate x3=x2+cursor_dx; Coord ytop=(inner.dy-ts.dy)/2; Coord ybase=ytop+ts.by; ulen pos1=font->position(text_buf.prefix(pos),point-Point(x1,ybase)); if( pos1==0 ) return 0; if( pos1<=pos ) return pos1-1; ulen pos2=font->position(text_buf.part(pos,len-pos),point-Point(x3,ybase)); if( pos2==0 ) return pos; if( pos2<=len-pos ) return pos2-1+pos; return len; } void LineEditShape::drawText(Font font,const DrawBuf &buf,Pane pane,TextPlace place,StrLen text,ulen,VColor vc) const { font->text(buf,pane,place,text,vc); } void LineEditShape::draw(const DrawBuf &buf) const { MPane p(pane); if( !p ) return; SmoothDrawArt art(buf.cut(pane)); Font font=cfg.font.get(); // figure MCoord width=+cfg.width; FontSize fs=font->getSize(); MCoord ex=FigEX(fs.dy,width,+cfg.ex); if( ex>p.dx/3 ) { art.block(pane,+cfg.inactive); return; } VColor text = enable? +cfg.text : +cfg.inactive ; FigureButton fig(p,ex); // body fig.curveSolid(art,enable? ( alert? +cfg.alert : +cfg.back ) : ( len? +cfg.back : +cfg.inactive ) ) ; // border if( focus ) { fig.curveLoop(art,HalfPos,width,+cfg.focus); } else { auto fig_top=fig.getTop(); fig_top.curvePath(art,HalfPos,width,+cfg.gray); auto fig_bottom=fig.getBottom(); fig_bottom.curvePath(art,HalfPos,width,+cfg.snow); } // arrows { MCoord len=ex-width; MCoord y=p.y+p.dy/2; if( xoff>0 ) // Left { MCoord x=p.x+width; FigureLeftMark fig(x,y,len); fig.solid(art,text); } if( xoff<xoffMax ) // Right { MCoord x=p.ex-width; FigureRightMark fig(x,y,len); fig.solid(art,text); } } // text { Coord dx=RoundUpLen(ex+width); Coord dy=RoundUpLen(width); Pane inner=pane.shrink(dx,dy); if( !inner ) return; bool show_cursor = enable && ( !hide_cursor || focus ) ; DrawBuf tbuf=buf.cut(inner); SmoothDrawArt tart(tbuf); ulen pos = show_cursor? this->pos : len ; TextSize ts=font->text_guarded(text_buf.prefix(pos)); Coordinate cursor_dx=+cfg.cursor_dx; Coordinate x1=(fs.dx0+cursor_dx)-xoff; Coordinate x2=x1+ts.dx; Coordinate x3=x2+cursor_dx; MCoord DX=Fraction(dx); MCoord X1=Fraction(x1)+DX; MCoord X2=Fraction(x2)+DX; MCoord X3=Fraction(x3)+DX; Coord ytop=(inner.dy-ts.dy)/2; Coord ybase=ytop+ts.by; MCoord w=Fraction(cursor_dx); MCoord h=Fraction(ts.dy); MCoord skew=Fraction(ts.skew); MCoord Y0=Fraction(ytop)+Fraction(dy); MCoord Y1=Y0+h; MCoord skew1=Div(h-Fraction(ts.by),h)*skew; // selection if( enable && select_len ) { MCoord xs0; if( select_off<pos ) { xs0=X1+Fraction( font->text_guarded(text_buf.prefix(pos),select_off).dx ); } else { xs0=X3+Fraction( font->text_guarded(text_buf.part(pos,len-pos),select_off-pos).dx ); } ulen lim=select_off+select_len; MCoord xs1; if( lim<=pos ) { xs1=X1+Fraction( font->text_guarded(text_buf.prefix(pos),lim).dx ); } else { xs1=X3+Fraction( font->text_guarded(text_buf.part(pos,len-pos),lim-pos).dx ); } FigureSkew fig(xs0-skew1,xs1-skew1,Y0,Y1,skew); fig.shift(pane.getBase()); fig.solid(tart,+cfg.select); } drawText(font,tbuf,inner,TextPlace(x1,ybase),text_buf.prefix(pos),0,text); drawText(font,tbuf,inner,TextPlace(x3,ybase),text_buf.part(pos,len-pos),pos,text); // cursor if( show_cursor ) { FigureCursor fig(X2-skew1,Y0,Y1,w,skew); fig.shift(pane.getBase()); if( focus && cursor ) { fig.solid(tart,+cfg.cursor); } else { fig.loop(tart,HalfPos,w/3,+cfg.cursor); } } } } } // namespace Video } // namespace CCore
19.508065
117
0.609756
SergeyStrukov
1405ebd2cdf088008a915fb7b83334f0e6e0c776
6,223
cpp
C++
Server/src/modules/SD3/scripts/eastern_kingdoms/ghostlands.cpp
ZON3DEV/wow-vanilla
7b6f03c3e1e7d8dd29a92ba77ed021e5913e5e9f
[ "OpenSSL" ]
null
null
null
Server/src/modules/SD3/scripts/eastern_kingdoms/ghostlands.cpp
ZON3DEV/wow-vanilla
7b6f03c3e1e7d8dd29a92ba77ed021e5913e5e9f
[ "OpenSSL" ]
null
null
null
Server/src/modules/SD3/scripts/eastern_kingdoms/ghostlands.cpp
ZON3DEV/wow-vanilla
7b6f03c3e1e7d8dd29a92ba77ed021e5913e5e9f
[ "OpenSSL" ]
null
null
null
/** * ScriptDev3 is an extension for mangos providing enhanced features for * area triggers, creatures, game objects, instances, items, and spells beyond * the default database scripting in mangos. * * Copyright (C) 2006-2013 ScriptDev2 <http://www.scriptdev2.com/> * Copyright (C) 2014-2022 MaNGOS <https://getmangos.eu> * * This program 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. * * This program 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 this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * World of Warcraft, and all World of Warcraft or Warcraft art, images, * and lore are copyrighted by Blizzard Entertainment, Inc. */ /* ScriptData SDName: Ghostlands SD%Complete: 100 SDComment: Quest support: 9212. SDCategory: Ghostlands EndScriptData */ /* ContentData npc_ranger_lilatha EndContentData */ #include "precompiled.h" #include "escort_ai.h" /*###### ## npc_ranger_lilatha ######*/ enum { SAY_START = -1000140, SAY_PROGRESS1 = -1000141, SAY_PROGRESS2 = -1000142, SAY_PROGRESS3 = -1000143, SAY_END1 = -1000144, SAY_END2 = -1000145, CAPTAIN_ANSWER = -1000146, QUEST_CATACOMBS = 9212, GO_CAGE = 181152, NPC_CAPTAIN_HELIOS = 16220, FACTION_SMOON_E = 1603, }; struct npc_ranger_lilatha : public CreatureScript { npc_ranger_lilatha() : CreatureScript("npc_ranger_lilatha") {} struct npc_ranger_lilathaAI : public npc_escortAI { npc_ranger_lilathaAI(Creature* pCreature) : npc_escortAI(pCreature) { } ObjectGuid m_goCageGuid; ObjectGuid m_heliosGuid; void MoveInLineOfSight(Unit* pUnit) override { if (HasEscortState(STATE_ESCORT_ESCORTING)) { if (!m_heliosGuid && pUnit->GetEntry() == NPC_CAPTAIN_HELIOS) { if (m_creature->IsWithinDistInMap(pUnit, 30.0f)) { m_heliosGuid = pUnit->GetObjectGuid(); } } } npc_escortAI::MoveInLineOfSight(pUnit); } void WaypointReached(uint32 i) override { Player* pPlayer = GetPlayerForEscort(); if (!pPlayer) { return; } switch (i) { case 0: if (GameObject* pGoTemp = GetClosestGameObjectWithEntry(m_creature, GO_CAGE, 10.0f)) { m_goCageGuid = pGoTemp->GetObjectGuid(); pGoTemp->SetGoState(GO_STATE_ACTIVE); } m_creature->SetStandState(UNIT_STAND_STATE_STAND); DoScriptText(SAY_START, m_creature, pPlayer); break; case 1: if (GameObject* pGo = m_creature->GetMap()->GetGameObject(m_goCageGuid)) { pGo->SetGoState(GO_STATE_READY); } break; case 5: DoScriptText(SAY_PROGRESS1, m_creature, pPlayer); break; case 11: DoScriptText(SAY_PROGRESS2, m_creature, pPlayer); break; case 18: DoScriptText(SAY_PROGRESS3, m_creature, pPlayer); if (Creature* pSum1 = m_creature->SummonCreature(16342, 7627.083984f, -7532.538086f, 152.128616f, 1.082733f, TEMPSPAWN_DEAD_DESPAWN, 0)) { pSum1->AI()->AttackStart(m_creature); } if (Creature* pSum2 = m_creature->SummonCreature(16343, 7620.432129f, -7532.550293f, 152.454865f, 0.827478f, TEMPSPAWN_DEAD_DESPAWN, 0)) { pSum2->AI()->AttackStart(pPlayer); } break; case 19: SetRun(); break; case 25: SetRun(false); break; case 30: pPlayer->GroupEventHappens(QUEST_CATACOMBS, m_creature); break; case 32: DoScriptText(SAY_END1, m_creature, pPlayer); break; case 33: DoScriptText(SAY_END2, m_creature, pPlayer); if (Creature* pHelios = m_creature->GetMap()->GetCreature(m_heliosGuid)) { DoScriptText(CAPTAIN_ANSWER, pHelios, m_creature); } break; } } void Reset() override { if (!HasEscortState(STATE_ESCORT_ESCORTING)) { m_goCageGuid.Clear(); m_heliosGuid.Clear(); } } }; CreatureAI* GetAI(Creature* pCreature) override { return new npc_ranger_lilathaAI(pCreature); } bool OnQuestAccept(Player* pPlayer, Creature* pCreature, const Quest* pQuest) override { if (pQuest->GetQuestId() == QUEST_CATACOMBS) { pCreature->SetFactionTemporary(FACTION_SMOON_E, TEMPFACTION_RESTORE_RESPAWN); if (npc_ranger_lilathaAI* pEscortAI = dynamic_cast<npc_ranger_lilathaAI*>(pCreature->AI())) { pEscortAI->Start(false, pPlayer, pQuest); } } return true; } }; void AddSC_ghostlands() { Script* s; s = new npc_ranger_lilatha(); s->RegisterSelf(); //pNewScript = new Script; //pNewScript->Name = "npc_ranger_lilatha"; //pNewScript->GetAI = &GetAI_npc_ranger_lilathaAI; //pNewScript->pQuestAcceptNPC = &QuestAccept_npc_ranger_lilatha; //pNewScript->RegisterSelf(); }
31.429293
152
0.571911
ZON3DEV
14072d437d496136cab9dfbecb630944343c56d4
1,319
cpp
C++
Queues/reverse-queue.cpp
divyanshu013/algorithm-journey
8dc32daa732f16099da148bb8669778d4ef3172a
[ "MIT" ]
null
null
null
Queues/reverse-queue.cpp
divyanshu013/algorithm-journey
8dc32daa732f16099da148bb8669778d4ef3172a
[ "MIT" ]
null
null
null
Queues/reverse-queue.cpp
divyanshu013/algorithm-journey
8dc32daa732f16099da148bb8669778d4ef3172a
[ "MIT" ]
null
null
null
/******************************************************************************* Reverse queue ============= Ref - http://stackoverflow.com/questions/818443/a-way-to-reverse-queue-using-only-two-temporary-queues-and-nothing-more -------------------------------------------------------------------------------- Problem ======= Reverse a queue using queue operations only. -------------------------------------------------------------------------------- Time Complexity =============== O(n) Space Complexity =============== O(n) - for stack -------------------------------------------------------------------------------- Output ====== 4 3 2 1 *******************************************************************************/ #include <stdio.h> #include <queue> #include <stack> using namespace std; void reverseQueue(queue<int> *q) { stack<int> s; while(!(*q).empty()) { s.push((*q).front()); (*q).pop(); } while(!s.empty()) { (*q).push(s.top()); s.pop(); } } void printQueue(queue<int> q) { while(!q.empty()) { printf("%d ", q.front()); q.pop(); } printf("\n"); } int main() { queue<int> q; q.push(1); q.push(2); q.push(3); q.push(4); reverseQueue(&q); printQueue(q); return 0; }
19.115942
119
0.357089
divyanshu013
140c141c0356cdf7f84a11e08a4509f0fc73c34a
455
cpp
C++
examples/app-libs-depends/src/main.cpp
str2num/buildmake
6320bb9e86cb1bc20c51f4f980a83cdd5ac49e8d
[ "BSD-3-Clause" ]
11
2017-11-10T12:24:18.000Z
2021-05-08T03:37:32.000Z
examples/app-libs-depends/src/main.cpp
str2num/buildmake
6320bb9e86cb1bc20c51f4f980a83cdd5ac49e8d
[ "BSD-3-Clause" ]
null
null
null
examples/app-libs-depends/src/main.cpp
str2num/buildmake
6320bb9e86cb1bc20c51f4f980a83cdd5ac49e8d
[ "BSD-3-Clause" ]
1
2019-01-26T19:32:34.000Z
2019-01-26T19:32:34.000Z
/*************************************************************************** * * Copyright (c) 2017 str2num.com, Inc. All Rights Reserved * $Id$ * **************************************************************************/ /** * @file main.cpp * @author str2num * @version $Revision$ * @brief * **/ #include <iostream> #include <math/math.h> int main() { std::cout << "1 + 1 = " << add(1, 1) << std::endl; return 0; }
16.25
76
0.342857
str2num
140df2b1c3eac69c11cd8bea488181b59931018e
937
cpp
C++
source/Ch08/swap.cpp
gorzsaszarvak/UDProg-Introduction
591d1d05c950da2ab4d59d78cbf5a1408caa78e6
[ "CC0-1.0" ]
null
null
null
source/Ch08/swap.cpp
gorzsaszarvak/UDProg-Introduction
591d1d05c950da2ab4d59d78cbf5a1408caa78e6
[ "CC0-1.0" ]
null
null
null
source/Ch08/swap.cpp
gorzsaszarvak/UDProg-Introduction
591d1d05c950da2ab4d59d78cbf5a1408caa78e6
[ "CC0-1.0" ]
null
null
null
#include "../../std_lib_facilities.h" void swap_v(int a, int b) { int temp; temp=a; a=b; b=temp; } void swap_r(int& a, int& b) { int temp; temp=a; a=b; b=temp; } /*void swap_cr(const int& a, const int& b) { int temp; temp=a; a=b; b=temp; } */ int main() { int x = 7; int y = 9; cout << "x: " << x << ", y: " << y << endl; swap_v(x,y); cout << "swap_v(): x: " << x << ", y: " << y << endl; swap_r(x,y); cout << "swap_r(): x: " << x << ", y: " << y << endl; //swap_cr(x,y); swap_v(7,9); cout << "swap_v(numbers) 7: " << x << ", 9: " << y << endl; const int cx=7; const int cy=9; swap_v(cx,cy); cout << "swap_v(): cx: " << cx << ", cy: " << cy << endl; swap_v(7.7, 9.9); cout << "swap_v(numbers) 7.7: " << x << ", 9.9: " << y << endl; double dx = 7.7; double dy = 9.9; cout << "dx: " << dx << ", dy: " << dy << endl; swap_v(dx, dy); cout << "dx: " << dx << ", dy: " << dy << endl; return 0; }
15.360656
64
0.459979
gorzsaszarvak
140e9fa23e5777fae72eb128a8ac762c0b5cad5d
426,132
hpp
C++
zeccup/zeccup/military/woodland/fort.hpp
LISTINGS09/ZECCUP
e0ad1fae580dde6e5d90903b1295fecc41684f63
[ "Naumen", "Condor-1.1", "MS-PL" ]
3
2016-08-29T09:23:49.000Z
2019-06-13T20:29:28.000Z
zeccup/zeccup/military/woodland/fort.hpp
LISTINGS09/ZECCUP
e0ad1fae580dde6e5d90903b1295fecc41684f63
[ "Naumen", "Condor-1.1", "MS-PL" ]
null
null
null
zeccup/zeccup/military/woodland/fort.hpp
LISTINGS09/ZECCUP
e0ad1fae580dde6e5d90903b1295fecc41684f63
[ "Naumen", "Condor-1.1", "MS-PL" ]
null
null
null
class FortLarge { name = $STR_ZECCUP_FortLarge; class MortarPit_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortLarge_MortarPit_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object1 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {-2.45862,-4.78491,0}; dir = 15;}; class Object2 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {2.02954,-7.46338,0}; dir = 270;}; class Object3 {side = 8; vehicle = "Barrel3"; rank = ""; position[] = {-9,-1.125,0}; dir = 60;}; class Object4 {side = 8; vehicle = "Barrel3"; rank = ""; position[] = {-9.625,-0.375,0}; dir = 0;}; class Object5 {side = 8; vehicle = "Land_fort_artillery_nest"; rank = ""; position[] = {-10.4399,5.7124,0}; dir = 300;}; class Object6 {side = 8; vehicle = "Barrel2"; rank = ""; position[] = {2.9054,6.48584,0}; dir = 180;}; class Object7 {side = 8; vehicle = "Barrel3"; rank = ""; position[] = {-10,5.375,0}; dir = 15;}; class Object8 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {0.374878,6.375,0}; dir = 29.9835;}; class Object9 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {0.96521,6.04248,0}; dir = 233.199;}; // Z: 0.0707073 class Object11 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {10.1108,-4.76831,0}; dir = 345;}; class Object12 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {6.28662,-7.90454,0}; dir = 0;}; class Object13 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {8.10962,-1.92017,0}; dir = 0;}; class Object14 {side = 8; vehicle = "Land_CratesWooden_F"; rank = ""; position[] = {10.625,-1.625,0}; dir = 180;}; class Object15 {side = 8; vehicle = "Land_fort_artillery_nest"; rank = ""; position[] = {18.3906,5.56348,0}; dir = 60;}; class Object16 {side = 8; vehicle = "Land_CamoNetB_EAST"; rank = ""; position[] = {12.2356,2.79517,0}; dir = 90;}; class Object17 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {4,7.27441,0}; dir = 180;}; class Object18 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {10.3145,4.12646,0}; dir = 0;}; class Object19 {side = 8; vehicle = "Land_CratesWooden_F"; rank = ""; position[] = {7,6,0}; dir = 0;}; class Object20 {side = 8; vehicle = "CUP_hromada_beden_dekorativniX"; rank = ""; position[] = {11.875,2.125,0}; dir = 345;}; class Object21 {side = 8; vehicle = "Barrels"; rank = ""; position[] = {12.735,7.36865,0}; dir = 195;}; class Object22 {side = 8; vehicle = "Land_Sacks_heap_F"; rank = ""; position[] = {16.875,5.875,0}; dir = 135;}; class Object23 {side = 8; vehicle = "Fort_Crate_wood"; rank = ""; position[] = {15.4989,1.25195,0}; dir = 360;}; class Object24 {side = 8; vehicle = "Land_Sack_F"; rank = ""; position[] = {16.3767,6.62964,0}; dir = 60;}; class Object25 {side = 8; vehicle = "Land_MetalBarrel_empty_F"; rank = ""; position[] = {8.625,6.125,0}; dir = 150;}; class Object26 {side = 8; vehicle = "Fort_Crate_wood"; rank = ""; position[] = {14.9989,2.37695,0}; dir = 360;}; class Object27 {side = 8; vehicle = "Land_Cargo20_military_green_F"; rank = ""; position[] = {11.8813,0.280029,0}; dir = 359.744;}; }; class MortarPit_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortLarge_MortarPit_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object1 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {-3.20862,-7.03491,0}; dir = 15;}; class Object2 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {-3.20313,-4.82178,0}; dir = 0;}; class Object3 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {2.20166,-8.82397,0}; dir = 255;}; class Object4 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {1.42334,-11.551,0}; dir = 75;}; class Object5 {side = 8; vehicle = "Land_Sacks_heap_F"; rank = ""; position[] = {-6.625,-5,0}; dir = 90;}; class Object6 {side = 8; vehicle = "Fort_Crate_wood"; rank = ""; position[] = {-9.37268,-3.25,0}; dir = 120;}; class Object7 {side = 8; vehicle = "Fort_Crate_wood"; rank = ""; position[] = {-10.248,-2.37622,0}; dir = 150;}; class Object8 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {3.21423,-13.1228,0}; dir = 30;}; class Object9 {side = 8; vehicle = "Land_Sacks_heap_F"; rank = ""; position[] = {-5.5,-5.375,0}; dir = 210;}; class Object10 {side = 8; vehicle = "Land_fort_artillery_nest"; rank = ""; position[] = {-11.1899,3.4624,0}; dir = 300;}; class Object11 {side = 8; vehicle = "Land_CamoNetB_NATO"; rank = ""; position[] = {-5.34497,0.531006,0}; dir = 315;}; class Object12 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {3.25,5.02441,0}; dir = 180;}; class Object13 {side = 8; vehicle = "Land_Cargo20_light_green_F"; rank = ""; position[] = {-3.75,-1.375,0}; dir = 210;}; class Object14 {side = 8; vehicle = "Land_GarbageBags_F"; rank = ""; position[] = {1.25996,3.16011,0}; dir = 0;}; class Object15 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {1.91272,3.57178,0}; dir = 0;}; class Object16 {side = 8; vehicle = "Land_Cargo10_grey_F"; rank = ""; position[] = {-2.25,0.75,0}; dir = 210;}; class Object17 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {-7.61658,4.86548,0}; dir = 150;}; class Object18 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {-9.24292,3.6355,0}; dir = 45;}; class Object20 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {9.36084,-7.01831,0}; dir = 345;}; class Object21 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {4.04614,-9.08984,0}; dir = 90;}; class Object22 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {5.76172,-11.3662,0}; dir = 45;}; class Object23 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {7.67712,-12.5344,0}; dir = 15;}; class Object24 {side = 8; vehicle = "Land_fort_artillery_nest"; rank = ""; position[] = {17.6406,3.31348,0}; dir = 60;}; class Object25 {side = 8; vehicle = "Barrel2"; rank = ""; position[] = {3.79651,3.92334,0}; dir = 75;}; class Object26 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {17.375,-1.25,0}; dir = 165;}; class Object27 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {17.605,-0.379395,0}; dir = 165;}; class Object28 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {17.125,3,0}; dir = 270;}; }; }; class FortMedium { name = $STR_ZECCUP_FortMedium; // EAST class VehicleBunker_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortMedium_VehicleBunker_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object1 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {-7.64453,-10.3911,0}; dir = 225;}; class Object2 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-7.61548,-5.39331,0}; dir = 285;}; class Object3 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-2.61377,-10.3577,0}; dir = 165;}; class Object4 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {-0.399536,1.75,0}; dir = 90;}; class Object5 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {-0.46228,7.32178,0}; dir = 0;}; class Object6 {side = 8; vehicle = "Land_GarbagePallet_F"; rank = ""; position[] = {-0.475098,7.21338,0}; dir = 0;}; class Object8 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {4.125,-6.14941,0}; dir = 0;}; class Object9 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {15.2661,-10.6445,0}; dir = 135;}; class Object10 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {7.39038,-10.2361,0}; dir = 180;}; class Object11 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {15.2325,-5.61377,0}; dir = 75;}; class Object12 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {10.2684,-10.6155,0}; dir = 195;}; class Object13 {side = 8; vehicle = "Land_CratesWooden_F"; rank = ""; position[] = {5.5,-5.125,0}; dir = 0;}; class Object14 {side = 8; vehicle = "Barrel3"; rank = ""; position[] = {7.125,-5.25,0}; dir = 15;}; class Object15 {side = 8; vehicle = "Land_Pallets_stack_F"; rank = ""; position[] = {3.375,-4.75,0}; dir = 270.001;}; class Object16 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {8.89954,2.25,0}; dir = 270;}; }; class BunkerTowerHvy_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortMedium_BunkerTowerHvy_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object1 {side = 8; vehicle = "Land_BagBunker_Tower_F"; rank = ""; position[] = {-2.76685,-0.980469,0}; dir = 0;}; class Object2 {side = 8; vehicle = "Land_HBarrier_1_F"; rank = ""; position[] = {-1.63245,-1.625,0}; dir = 90;}; class Object4 {side = 8; vehicle = "Land_CamoNet_EAST"; rank = ""; position[] = {7.52417,-6.44946,0}; dir = 180;}; class Object5 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {7.375,-8.39941,0}; dir = 0;}; class Object6 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {17.5858,-5.62744,0}; dir = 90;}; class Object7 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {0.911621,-7.90454,0}; dir = 0;}; class Object8 {side = 8; vehicle = "Land_HBarrier_5_F"; rank = ""; position[] = {11.6211,-3.12622,0}; dir = 90;}; class Object9 {side = 8; vehicle = "Land_HBarrier_5_F"; rank = ""; position[] = {0.626221,-1.87891,0}; dir = 0;}; class Object10 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {13.7654,-8.36108,0}; dir = 180;}; class Object11 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {9.63611,-1.89795,0}; dir = 0;}; class Object12 {side = 8; vehicle = "Land_CratesWooden_F"; rank = ""; position[] = {10,-6.75,0}; dir = 270;}; class Object13 {side = 8; vehicle = "Land_Pallet_F"; rank = ""; position[] = {5.875,-6.75,0}; dir = 344.653;}; class Object14 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {10.1226,-3.48755,0}; dir = 0;}; class Object15 {side = 8; vehicle = "Gunrack1"; rank = ""; position[] = {2.125,-3.125,0}; dir = 180;}; class Object16 {side = 8; vehicle = "Barrel3"; rank = ""; position[] = {1.25,-3.125,0}; dir = 150;}; class Object17 {side = 8; vehicle = "Barrel3"; rank = ""; position[] = {8.07983,-7.75439,0}; dir = 180;}; class Object18 {side = 8; vehicle = "Barrel3"; rank = ""; position[] = {3.75,-3.125,0}; dir = 60;}; class Object19 {side = 8; vehicle = "Barrel3"; rank = ""; position[] = {7.20483,-7.50439,0}; dir = 195;}; class Object20 {side = 8; vehicle = "Barrel3"; rank = ""; position[] = {7.75,-7,0}; dir = 240;}; class Object21 {side = 8; vehicle = "Barrel3"; rank = ""; position[] = {0.625,-3.125,0}; dir = 240;}; class Object22 {side = 8; vehicle = "Gunrack1"; rank = ""; position[] = {10.125,-4.875,0}; dir = 90;}; class Object23 {side = 8; vehicle = "Land_CamoNetVar_EAST"; rank = ""; position[] = {7.72375,-0.237549,0}; dir = 0;}; class Object24 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {0.636108,1.35205,0}; dir = 0;}; class Object25 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {4.14795,1.26099,0}; dir = 270;}; class Object26 {side = 8; vehicle = "Land_WoodenTable_large_F"; rank = ""; position[] = {10.3748,2.37158,0}; dir = 89.6784;}; class Object27 {side = 8; vehicle = "Land_CampingChair_V2_F"; rank = ""; position[] = {9.87744,1.39209,0}; dir = 105.009;}; class Object28 {side = 8; vehicle = "Land_CampingChair_V2_F"; rank = ""; position[] = {9.87732,2.89404,0}; dir = 359.975;}; class Object29 {side = 8; vehicle = "Land_CampingChair_V2_F"; rank = ""; position[] = {10.8773,3.14209,0}; dir = 345.008;}; class Object30 {side = 8; vehicle = "Land_CampingChair_V2_F"; rank = ""; position[] = {10.8774,1.64209,0}; dir = 165.009;}; class Object31 {side = 8; vehicle = "CUP_metalcrate"; rank = ""; position[] = {5.56909,2.27563,0}; dir = 45;}; class Object32 {side = 8; vehicle = "CUP_metalcrate"; rank = ""; position[] = {5.375,3,0}; dir = 255;}; }; class BunkerTowerMed_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortMedium_BunkerTowerMed_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object1 {side = 8; vehicle = "Land_CamoNetVar_EAST"; rank = ""; position[] = {3.09875,-9.98755,0}; dir = 0;}; class Object2 {side = 8; vehicle = "Land_BagBunker_Tower_F"; rank = ""; position[] = {-6.89185,-5.23047,0}; dir = 0;}; class Object3 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {-0.710815,-9.37256,0}; dir = 270;}; class Object4 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-2.35962,-9.61108,0}; dir = 180;}; class Object5 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {3.14038,-12.1111,0}; dir = 180;}; class Object6 {side = 8; vehicle = "Land_HBarrier_5_F"; rank = ""; position[] = {0.876221,-2.62891,0}; dir = 0;}; class Object7 {side = 8; vehicle = "Land_BarrelTrash_F"; rank = ""; position[] = {-3.50012,-6.75,0}; dir = 359.981;}; class Object8 {side = 8; vehicle = "Land_CamoNetVar_EAST"; rank = ""; position[] = {1.76233,2.77612,0}; dir = 90;}; class Object9 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {0.5,8.39941,0}; dir = 180;}; class Object10 {side = 8; vehicle = "Land_HBarrier_5_F"; rank = ""; position[] = {-5.12109,4.25122,0}; dir = 270;}; class Object11 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {-0.21228,8.19678,0}; dir = 0;}; class Object12 {side = 8; vehicle = "Land_GarbagePallet_F"; rank = ""; position[] = {-0.225098,8.08838,0}; dir = 0;}; class Object13 {side = 8; vehicle = "Land_WoodenTable_large_F"; rank = ""; position[] = {0.125,4,0}; dir = 164.69;}; class Object14 {side = 8; vehicle = "Land_CampingChair_V2_F"; rank = ""; position[] = {-0.953247,4.22632,0}; dir = 285.009;}; class Object15 {side = 8; vehicle = "Land_CampingChair_V2_F"; rank = ""; position[] = {1.01099,4.62305,0}; dir = 359.978;}; class Object16 {side = 8; vehicle = "Land_CampingChair_V2_F"; rank = ""; position[] = {1.30212,3.53638,0}; dir = 15.0077;}; class Object17 {side = 8; vehicle = "Land_CampingChair_V2_F"; rank = ""; position[] = {-0.452881,3.32495,0}; dir = 255.009;}; class Object19 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {6.96082,-9.37744,0}; dir = 90;}; class Object20 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {6.60205,-0.635986,0}; dir = 90;}; class Object21 {side = 8; vehicle = "Land_CratesShabby_F"; rank = ""; position[] = {5.25769,-1.50146,0}; dir = 270;}; class Object22 {side = 8; vehicle = "Land_CratesShabby_F"; rank = ""; position[] = {4.24231,-1.49854,0}; dir = 90;}; class Object23 {side = 8; vehicle = "Land_HBarrier_Big_F"; rank = ""; position[] = {6.1676,4.16016,0}; dir = 90;}; class Object24 {side = 8; vehicle = "Land_CratesWooden_F"; rank = ""; position[] = {4.375,0.25,0}; dir = 270;}; class Object25 {side = 8; vehicle = "Land_Sacks_heap_F"; rank = ""; position[] = {4.75,4.5,0}; dir = 75;}; class Object26 {side = 8; vehicle = "Land_Sack_F"; rank = ""; position[] = {4.15173,3.8269,0}; dir = 360;}; class Object27 {side = 8; vehicle = "Land_Sack_EP1"; rank = ""; position[] = {3.87793,4.39478,0}; dir = 150;}; }; class BunkerLargeMed_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortMedium_BunkerLargeMed_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object1 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {-0.0245361,-3.5,0}; dir = 90;}; class Object2 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {1.73462,-8.13892,0}; dir = 0;}; class Object3 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {-2.64172,3.96948,0}; dir = 270;}; class Object4 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {1.23462,6.73608,0}; dir = 0;}; class Object6 {side = 8; vehicle = "Land_BagBunker_Large_F"; rank = ""; position[] = {7.62073,-3.95142,0}; dir = 0;}; class Object7 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {15.0245,-3.5,0}; dir = 270;}; class Object8 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {13.3596,-8.13892,0}; dir = 0;}; class Object9 {side = 8; vehicle = "Land_CamoNetVar_EAST"; rank = ""; position[] = {7.59875,2.88745,0}; dir = 0;}; class Object10 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {7.5,6.77441,0}; dir = 180;}; class Object11 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {17.7108,4.24756,0}; dir = 90;}; class Object12 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {13.8596,6.98608,0}; dir = 0;}; class Object13 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {6.375,5.875,0}; dir = 105;}; class Object14 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {5.75,5.25,0}; dir = 180;}; class Object15 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {5.5,5.875,0}; dir = 105;}; class Object16 {side = 8; vehicle = "Misc_concrete_High"; rank = ""; position[] = {8.60999,5.40625,0}; dir = 90;}; }; class BunkerTowerLit_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortMedium_BunkerTowerLit_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object1 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {-0.375,-9.02441,0}; dir = 0;}; class Object2 {side = 8; vehicle = "Land_BagBunker_Tower_F"; rank = ""; position[] = {-8.14185,-7.23047,0}; dir = 0;}; class Object3 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {0.493774,-2.42969,0}; dir = 0;}; class Object4 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {-1.05432,-6.10059,0}; dir = 0;}; class Object5 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-11.3889,-0.734619,0}; dir = 90;}; class Object6 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-3.61389,-0.0229492,0}; dir = 0;}; class Object7 {side = 8; vehicle = "Land_MetalBarrel_empty_F"; rank = ""; position[] = {-7.91296,-2.05029,0}; dir = 270;}; class Object8 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {-0.250122,-4.75,0}; dir = 359.986;}; class Object9 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {-0.624878,-4.125,0}; dir = 194.982;}; class Object10 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {0.500122,-4.25,0}; dir = 164.992;}; class Object11 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {-8.74988,-2,0}; dir = 149.985;}; class Object13 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-4.78662,2.90454,0}; dir = 180;}; class Object14 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {-10.0409,4.06665,0}; dir = 330;}; class Object15 {side = 8; vehicle = "Land_CamoNet_EAST"; rank = ""; position[] = {3.07446,-3.85083,0}; dir = 90;}; class Object16 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {4.64954,-3.875,0}; dir = 270;}; class Object17 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {3.16272,-7.26709,0}; dir = 330;}; class Object18 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {3.4873,-5.49927,0}; dir = 285;}; class Object19 {side = 8; vehicle = "Fort_Crate_wood"; rank = ""; position[] = {3.625,-4.0022,0}; dir = 210;}; class Object20 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {2.125,-8,0}; dir = 180;}; class Object21 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {1.62732,3.21094,0}; dir = 0;}; }; class BunkerLargeLit_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortMedium_BunkerLargeLit_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object1 {side = 8; vehicle = "Land_CamoNetVar_EAST"; rank = ""; position[] = {1.51233,-1.09888,0}; dir = 90;}; // Z: 0.17834 class Object2 {side = 8; vehicle = "Land_BagBunker_Large_F"; rank = ""; position[] = {1.99573,-1.32642,0}; dir = 0;}; class Object3 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {-5.41992,-9.68921,0}; dir = 210;}; class Object4 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-6.24048,-4.89331,0}; dir = 285;}; class Object5 {side = 8; vehicle = "MetalBarrel_burning_F"; rank = ""; position[] = {-5.625,-2.875,0}; dir = 0;}; class Object7 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {1.625,8.64941,0}; dir = 180;}; class Object8 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-1.65454,4.83838,0}; dir = 90;}; class Object9 {side = 8; vehicle = "Land_MetalBarrel_empty_F"; rank = ""; position[] = {-3.125,3.25,0}; dir = 150;}; class Object10 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {-3.25012,2.5,0}; dir = 29.9737;}; class Object11 {side = 8; vehicle = "CUP_metalcrate"; rank = ""; position[] = {-3.125,4.125,0}; dir = 0;}; class Object12 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {5.26843,-9.36548,0}; dir = 195;}; class Object13 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {10.1659,-10.3167,0}; dir = 150;}; class Object14 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {3.58838,5.27954,0}; dir = 180;}; class Object15 {side = 8; vehicle = "GunrackTK_EP1"; rank = ""; position[] = {3.76904,3.91968,0}; dir = 180;}; }; class BunkerLarge1_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortMedium_BunkerLarge1_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "AmmoCrates_NoInteractive_Small"; rank = ""; position[] = {0.354492,-5.64844,0}; dir = 90;}; class Object1 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {-4.08752,-8.30334,0}; dir = 0;}; class Object2 {side = 8; vehicle = "Barrels"; rank = ""; position[] = {4.875,-5.25,0}; dir = 345;}; class Object3 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {2.75,-6.52405,0}; dir = 0;}; class Object4 {side = 8; vehicle = "Barrel3"; rank = ""; position[] = {1.78271,-4.89636,0}; dir = 150;}; class Object5 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-2.89038,-6.01343,0}; dir = 0;}; class Object7 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {-6.58582,-3.12219,0}; dir = 270;}; class Object8 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {2.375,-5.5,0}; dir = 150;}; class Object9 {side = 8; vehicle = "AmmoCrates_NoInteractive_Large"; rank = ""; position[] = {-0.834351,-5.63062,0}; dir = 0;}; class Object10 {side = 8; vehicle = "Land_GarbageBags_F"; rank = ""; position[] = {-4.41504,-9.01501,0}; dir = 0;}; class Object11 {side = 8; vehicle = "Land_BagBunker_Large_F"; rank = ""; position[] = {0.129272,3.57727,0}; dir = 180;}; class Object12 {side = 8; vehicle = "Wire"; rank = ""; position[] = {5.55957,5.15808,0}; dir = 270;}; class Object13 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-0.282593,9.18506,0}; dir = 180;}; class Object14 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-5.44043,4.65808,0}; dir = 270;}; class Object15 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {7.51392,-2.01489,0}; dir = 270;}; class Object16 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {7.48608,-4.85913,0}; dir = 90;}; class Object17 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {5.89038,-0.610596,0}; dir = 180;}; }; class BunkerLarge2_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortMedium_BunkerLarge2_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {3.51245,-6.49756,0}; dir = 90;}; class Object1 {side = 8; vehicle = "Land_PaperBox_open_empty_F"; rank = ""; position[] = {1.87537,-6.49988,0}; dir = 90;}; class Object2 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-4.71338,-12.6541,0}; dir = 1.70755e-005;}; class Object3 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {4.90454,-6.46289,0}; dir = 270;}; class Object4 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {-4.47534,-5.82556,0}; dir = 105;}; class Object5 {side = 8; vehicle = "Land_Pallet_F"; rank = ""; position[] = {-5.375,-14.75,0}; dir = 359.332;}; class Object6 {side = 8; vehicle = "Land_Pallets_F"; rank = ""; position[] = {-6.45947,-14.26,0}; dir = 255;}; class Object7 {side = 8; vehicle = "Barrel3"; rank = ""; position[] = {3.25,-9,0}; dir = 165;}; class Object8 {side = 8; vehicle = "Barrel3"; rank = ""; position[] = {4.18555,-8.38708,0}; dir = 330;}; class Object9 {side = 8; vehicle = "AmmoCrates_NoInteractive_Medium"; rank = ""; position[] = {-3.95325,-7.72046,0}; dir = 195;}; class Object10 {side = 8; vehicle = "AmmoCrate_NoInteractive_"; rank = ""; position[] = {-3.65515,-6.8894,0}; dir = 195;}; class Object11 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {1.89038,-7.6106,0}; dir = 180;}; class Object12 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-1.64038,-13.2634,0}; dir = 5.46415e-005;}; class Object13 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {5.48608,-3.23413,0}; dir = 90;}; class Object15 {side = 8; vehicle = "Land_Pallets_stack_F"; rank = ""; position[] = {-7.75,-12.125,0}; dir = 194.998;}; class Object16 {side = 8; vehicle = "Land_Misc_IronPipes_EP1"; rank = ""; position[] = {-8.79529,-6.33154,0}; dir = 90;}; class Object17 {side = 8; vehicle = "Land_BagBunker_Large_F"; rank = ""; position[] = {1.25427,2.57727,0}; dir = 180;}; class Object18 {side = 8; vehicle = "Land_CamoNet_EAST"; rank = ""; position[] = {3.44946,-7.47583,0}; dir = 90;}; class Object19 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-4.26709,3.60437,0}; dir = 270;}; class Object20 {side = 8; vehicle = "Wire"; rank = ""; position[] = {0.890747,8.13135,0}; dir = 180;}; class Object21 {side = 8; vehicle = "Wire"; rank = ""; position[] = {6.73291,4.10437,0}; dir = 270;}; }; class BunkerLarge3_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortMedium_BunkerLarge3_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_CratesShabby_F"; rank = ""; position[] = {-7.69299,0.311279,0}; dir = 90;}; class Object1 {side = 8; vehicle = "Land_GarbagePallet_F"; rank = ""; position[] = {-3.58508,-6.76929,0}; dir = 330;}; class Object2 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {-3.62817,-6.66895,0}; dir = 330;}; class Object3 {side = 8; vehicle = "Land_CratesWooden_F"; rank = ""; position[] = {-7.5,1.87451,0}; dir = 270;}; class Object4 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-8.15454,4.08838,0}; dir = 90;}; class Object5 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-7.71338,-2.52954,0}; dir = 3.41509e-006;}; class Object6 {side = 8; vehicle = "Land_Pneu"; rank = ""; position[] = {-1.78931,-7.42847,0}; dir = 330;}; class Object7 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {4.10962,4.11157,0}; dir = 1.36604e-005;}; class Object8 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-8.76392,1.01538,0}; dir = 90;}; class Object9 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-4.51538,-3.13892,0}; dir = 2.73208e-005;}; class Object10 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {5.36108,2.39087,0}; dir = 90;}; class Object12 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {4.89111,-2.64404,0}; dir = 135;}; class Object13 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {4.5,1.875,0}; dir = 150;}; class Object14 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {3.5,1.875,0}; dir = 60;}; class Object15 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {3.875,1.25,0}; dir = 255;}; class Object16 {side = 8; vehicle = "Land_BagBunker_Large_F"; rank = ""; position[] = {-1.74573,9.45227,0}; dir = 180;}; }; class BunkerLarge4_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortMedium_BunkerLarge4_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_CratesShabby_F"; rank = ""; position[] = {-1.99854,-7.36731,0}; dir = 180;}; class Object1 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {-2.58752,-11.9283,0}; dir = 0;}; class Object2 {side = 8; vehicle = "Land_CratesWooden_F"; rank = ""; position[] = {-0.375,-7.125,0}; dir = 0;}; class Object3 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-7.15454,-6.53613,0}; dir = 90;}; class Object4 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-4.65454,-3.91113,0}; dir = 90;}; class Object5 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {2.625,-8.27405,0}; dir = 0;}; class Object6 {side = 8; vehicle = "Land_Pallet_F"; rank = ""; position[] = {-6.75,-1.75,0}; dir = 149.332;}; class Object7 {side = 8; vehicle = "Land_Sacks_heap_F"; rank = ""; position[] = {4.125,-7.375,0}; dir = 165;}; class Object9 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {-4.87732,-10.4603,0}; dir = 180;}; class Object10 {side = 8; vehicle = "Land_Pallets_stack_F"; rank = ""; position[] = {-7.625,-3.625,0}; dir = 29.999;}; class Object11 {side = 8; vehicle = "Land_GarbageBags_F"; rank = ""; position[] = {-2.91504,-12.64,0}; dir = 0;}; class Object12 {side = 8; vehicle = "Land_BagBunker_Large_F"; rank = ""; position[] = {1.87927,1.07727,0}; dir = 180;}; class Object13 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-3.76611,1.89734,0}; dir = 270;}; class Object14 {side = 8; vehicle = "Wire"; rank = ""; position[] = {1.39172,6.42432,0}; dir = 180;}; class Object15 {side = 8; vehicle = "Wire"; rank = ""; position[] = {7.23389,2.39734,0}; dir = 270;}; }; class BunkerLarge5_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortMedium_BunkerLarge5_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {-0.598389,-5.99341,0}; dir = 270;}; class Object1 {side = 8; vehicle = "Land_PaperBox_open_empty_F"; rank = ""; position[] = {1.12463,-5.875,0}; dir = 285;}; class Object2 {side = 8; vehicle = "Fort_Crate_wood"; rank = ""; position[] = {2.6239,-6.24805,0}; dir = 0;}; class Object3 {side = 8; vehicle = "Barrel2"; rank = ""; position[] = {5.9397,-6.3147,0}; dir = 105;}; class Object4 {side = 8; vehicle = "Barrel2"; rank = ""; position[] = {6.625,-5.875,0}; dir = 300;}; class Object5 {side = 8; vehicle = "Barrel2"; rank = ""; position[] = {6.875,-6.5,0}; dir = 0;}; class Object6 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-3.90454,-2.78613,0}; dir = 90;}; class Object7 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-3.33838,-6.65405,0}; dir = 360;}; class Object8 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {3,-7.39954,0}; dir = 0;}; class Object9 {side = 8; vehicle = "AmmoCrates_NoInteractive_Medium"; rank = ""; position[] = {4.7373,-6.35034,0}; dir = 90;}; class Object10 {side = 8; vehicle = "AmmoCrate_NoInteractive_"; rank = ""; position[] = {3.85742,-6.27759,0}; dir = 90;}; class Object12 {side = 8; vehicle = "GunrackTK_EP1"; rank = ""; position[] = {-1.89404,-6.04468,0}; dir = 0;}; class Object13 {side = 8; vehicle = "Land_BagBunker_Large_F"; rank = ""; position[] = {2.62927,2.32727,0}; dir = 180;}; class Object14 {side = 8; vehicle = "Land_CamoNet_EAST"; rank = ""; position[] = {2.77417,-6.82446,0}; dir = 180;}; class Object15 {side = 8; vehicle = "Wire"; rank = ""; position[] = {2.34241,8.06006,0}; dir = 180;}; class Object16 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-2.81543,3.53308,0}; dir = 270;}; class Object17 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {11.3384,-2.46997,0}; dir = 180;}; class Object18 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {8.39038,-1.8606,0}; dir = 180;}; class Object19 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {11.0409,-7.44104,0}; dir = 150;}; }; class BunkerLarge6_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortMedium_BunkerLarge6_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Fort_Crate_wood"; rank = ""; position[] = {-2.1261,-6.87305,0}; dir = 0;}; class Object1 {side = 8; vehicle = "Fort_Crate_wood"; rank = ""; position[] = {0.625,-6.87732,0}; dir = 210;}; class Object2 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {4.375,-6.5,0}; dir = 315;}; class Object3 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {3.30542,-6.81421,0}; dir = 270;}; class Object4 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-6.02954,-3.66113,0}; dir = 90;}; class Object5 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-4.72046,-9.58789,0}; dir = 270;}; class Object6 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {0.625,-8.02405,0}; dir = 0;}; class Object7 {side = 8; vehicle = "Land_CamoNetVar_EAST"; rank = ""; position[] = {0.862671,-7.27625,0}; dir = 270;}; class Object9 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {-9.08582,-7.87219,0}; dir = 270;}; class Object10 {side = 8; vehicle = "Land_Ammobox_rounds_F"; rank = ""; position[] = {-1.146,-6.78149,0}; dir = 74.982;}; class Object11 {side = 8; vehicle = "Land_Ammobox_rounds_F"; rank = ""; position[] = {-0.928345,-6.45215,0}; dir = 224.994;}; class Object12 {side = 8; vehicle = "CUP_ammobednaX"; rank = ""; position[] = {-0.25,-6.25,0}; dir = 105;}; class Object13 {side = 8; vehicle = "Land_WaterBarrel_F"; rank = ""; position[] = {2,-6.75,0}; dir = 359.991;}; class Object14 {side = 8; vehicle = "Land_BagBunker_Large_F"; rank = ""; position[] = {0.379272,1.57727,0}; dir = 180;}; class Object15 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-5.19629,2.3783,0}; dir = 270;}; class Object16 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-0.0384521,6.90527,0}; dir = 180;}; class Object17 {side = 8; vehicle = "Wire"; rank = ""; position[] = {5.80371,2.8783,0}; dir = 270;}; class Object18 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {6.58838,-3.09497,0}; dir = 180;}; class Object19 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {7.15454,-6.83789,0}; dir = 270;}; }; class BunkerLarge7_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortMedium_BunkerLarge7_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-1.39307,-2.94934,0}; dir = 270;}; class Object1 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {4.85693,-2.69934,0}; dir = 270;}; class Object2 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {2.84509,-3.8584,0}; dir = 1.36604e-005;}; class Object3 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {3.74915,-5.6377,0}; dir = 195;}; class Object4 {side = 8; vehicle = "AmmoCrates_NoInteractive_Medium"; rank = ""; position[] = {-3.0127,-1.10022,0}; dir = 90;}; class Object5 {side = 8; vehicle = "AmmoCrate_NoInteractive_"; rank = ""; position[] = {-4.26514,-0.970947,0}; dir = 210;}; class Object6 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {5.11108,-6.10913,0}; dir = 90;}; class Object7 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-5.01538,-5.38843,0}; dir = 0;}; class Object8 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-5.02563,0.303467,0}; dir = 180;}; class Object10 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {-8.71082,-2.49719,0}; dir = 270;}; class Object11 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {2.37268,-9.83533,0}; dir = 180;}; class Object12 {side = 8; vehicle = "Misc_Backpackheap"; rank = ""; position[] = {2.20703,-5.40723,0}; dir = 210;}; class Object13 {side = 8; vehicle = "Land_WaterBarrel_F"; rank = ""; position[] = {-2.75,-2.375,0}; dir = 359.995;}; class Object14 {side = 8; vehicle = "Land_BagBunker_Large_F"; rank = ""; position[] = {1.00427,4.57727,0}; dir = 180;}; class Object15 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-4.48145,5.57214,0}; dir = 270;}; class Object16 {side = 8; vehicle = "Wire"; rank = ""; position[] = {0.676392,10.0991,0}; dir = 180;}; class Object17 {side = 8; vehicle = "Wire"; rank = ""; position[] = {6.51855,6.07214,0}; dir = 270;}; class Object18 {side = 8; vehicle = "Hedgehog"; rank = ""; position[] = {6.84375,-4.03662,0}; dir = 120;}; class Object19 {side = 8; vehicle = "Hedgehog"; rank = ""; position[] = {6.66162,-1.03125,0}; dir = 30;}; class Object20 {side = 8; vehicle = "Hedgehog"; rank = ""; position[] = {6.87109,-2.62878,0}; dir = 255;}; }; class BunkerLarge8_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortMedium_BunkerLarge8_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {-0.375854,-7.0127,0}; dir = 195;}; class Object1 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {1.49292,-7.26062,0}; dir = 225;}; class Object2 {side = 8; vehicle = "Land_CratesWooden_F"; rank = ""; position[] = {1.25,-5.25,0}; dir = 315;}; class Object3 {side = 8; vehicle = "MetalBarrel_burning_F"; rank = ""; position[] = {-0.375,-5.125,0}; dir = 0;}; class Object4 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-1.41162,-10.595,0}; dir = 180;}; class Object5 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {5.78662,-9.15405,0}; dir = 0;}; class Object6 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {5.78662,-3.65405,0}; dir = 0;}; class Object7 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-3.84546,-3.08789,0}; dir = 270;}; class Object8 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-4.71338,-9.40405,0}; dir = 6.83019e-006;}; class Object9 {side = 8; vehicle = "Land_Sacks_heap_F"; rank = ""; position[] = {2.375,-6.25,0}; dir = 120;}; class Object10 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-5.73608,-5.88989,0}; dir = 270;}; class Object12 {side = 8; vehicle = "Land_BagBunker_Large_F"; rank = ""; position[] = {0.754272,2.95227,0}; dir = 180;}; class Object13 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-4.73145,3.94714,0}; dir = 270;}; class Object14 {side = 8; vehicle = "Wire"; rank = ""; position[] = {0.426392,8.47412,0}; dir = 180;}; class Object15 {side = 8; vehicle = "Wire"; rank = ""; position[] = {6.26855,4.44714,0}; dir = 270;}; class Object16 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {6.79492,-2.2981,0}; dir = 225;}; class Object17 {side = 8; vehicle = "Land_Pneu"; rank = ""; position[] = {8.90869,-2.18152,0}; dir = 225;}; class Object18 {side = 8; vehicle = "Land_GarbageWashingMachine_F"; rank = ""; position[] = {6.99402,-2.14441,0}; dir = 225;}; class Object19 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {9.71082,-7.00183,0}; dir = 90;}; }; class BunkerLarge9_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortMedium_BunkerLarge9_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_Sack_F"; rank = ""; position[] = {-3.37317,-6.62976,0}; dir = 195;}; class Object1 {side = 8; vehicle = "Land_GarbagePallet_F"; rank = ""; position[] = {3.8999,-1.78662,0}; dir = 0;}; class Object2 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {3.91272,-1.67822,0}; dir = 0;}; class Object3 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-3.96338,-7.65405,0}; dir = 0;}; class Object4 {side = 8; vehicle = "Land_Sack_EP1"; rank = ""; position[] = {-3.25537,-7.24902,0}; dir = 345;}; class Object5 {side = 8; vehicle = "Land_Sacks_heap_F"; rank = ""; position[] = {-4.125,-7.125,0}; dir = 270;}; class Object6 {side = 8; vehicle = "Land_CamoNetVar_EAST"; rank = ""; position[] = {-0.723755,-4.38733,0}; dir = 180;}; class Object7 {side = 8; vehicle = "FoldTable"; rank = ""; position[] = {1.875,-4.75,0}; dir = 330;}; class Object8 {side = 8; vehicle = "FoldChair"; rank = ""; position[] = {2.74561,-5.25781,0}; dir = 255;}; class Object9 {side = 8; vehicle = "FoldChair"; rank = ""; position[] = {1.19263,-4.56555,0}; dir = 315;}; class Object10 {side = 8; vehicle = "FoldChair"; rank = ""; position[] = {1.75439,-5.54126,0}; dir = 180;}; class Object11 {side = 8; vehicle = "FoldChair"; rank = ""; position[] = {1.99561,-3.95874,0}; dir = 345;}; class Object12 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {4.26538,-8.2356,0}; dir = 180;}; class Object13 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-4.98608,-2.01489,0}; dir = 270;}; class Object15 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {0.247681,-10.8353,0}; dir = 180;}; class Object16 {side = 8; vehicle = "Land_WaterBarrel_F"; rank = ""; position[] = {-3.87439,-1.30725,0}; dir = 0.0656431;}; class Object17 {side = 8; vehicle = "Land_BagBunker_Large_F"; rank = ""; position[] = {-1.37073,3.95178,0}; dir = 180;}; class Object18 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-6.85645,4.94714,0}; dir = 270;}; class Object19 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-1.69861,9.47412,0}; dir = 180;}; class Object20 {side = 8; vehicle = "Wire"; rank = ""; position[] = {4.14355,5.44714,0}; dir = 270;}; class Object21 {side = 8; vehicle = "Land_CratesWooden_F"; rank = ""; position[] = {7.5,-9.5,0}; dir = 0;}; class Object22 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {4.55627,-0.839233,0}; dir = 180;}; class Object23 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {7.77954,-7.21289,0}; dir = 270;}; class Object24 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {7.21338,-3.34497,0}; dir = 180;}; class Object25 {side = 8; vehicle = "Land_Pneu"; rank = ""; position[] = {5.12549,-3.25537,0}; dir = 0;}; }; class CargoTower1_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortMedium_CargoTower1_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-3.34302,-7.09717,0}; dir = 0;}; class Object1 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-6.18433,-6.69873,0}; dir = 195;}; class Object3 {side = 8; vehicle = "Land_Pallets_F"; rank = ""; position[] = {-0.0842285,2.29468,0}; dir = 139.016;}; class Object4 {side = 8; vehicle = "Land_Pallets_F"; rank = ""; position[] = {1.73315,-1.71655,0}; dir = 237.491;}; class Object5 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {0.669922,-9.54419,0}; dir = 180;}; class Object6 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {-9.91357,-3.58081,0}; dir = 270;}; class Object7 {side = 8; vehicle = "Land_Cargo_Tower_V1_F"; rank = ""; position[] = {-1.18994,1.08496,0}; dir = 0;}; class Object8 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-2.31226,6.55566,0}; dir = 180;}; class Object9 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {0.562744,6.55566,0}; dir = 180;}; class Object10 {side = 8; vehicle = "Land_Pallets_stack_F"; rank = ""; position[] = {1.12939,3.21777,0}; dir = 209.407;}; class Object11 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {5.90845,-5.44287,0}; dir = 90;}; class Object12 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {4.65698,-7.22217,0}; dir = 0;}; class Object13 {side = 8; vehicle = "Land_CratesPlastic_F"; rank = ""; position[] = {2.61182,-0.640869,0}; dir = 225;}; class Object14 {side = 8; vehicle = "Land_GarbageBags_F"; rank = ""; position[] = {3.5498,1.78442,0}; dir = 120;}; class Object15 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {6.82178,-1.45825,0}; dir = 270;}; class Object16 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {7.40845,4.93213,0}; dir = 90;}; class Object17 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {4.6748,8.62769,0}; dir = 0;}; }; class CargoTower2_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortMedium_CargoTower2_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-9.84155,1.80713,0}; dir = 90;}; class Object1 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-7.18726,-7.69434,0}; dir = 180;}; class Object3 {side = 8; vehicle = "Land_Sacks_heap_F"; rank = ""; position[] = {-1.30029,-1.57666,0}; dir = 203.249;}; class Object4 {side = 8; vehicle = "Land_CratesPlastic_F"; rank = ""; position[] = {-4.83179,-7.58325,0}; dir = 150;}; class Object5 {side = 8; vehicle = "GunrackTK_EP1"; rank = ""; position[] = {-1.94287,-0.320068,0}; dir = 0;}; class Object6 {side = 8; vehicle = "Land_CratesShabby_F"; rank = ""; position[] = {-6.57715,-6.86279,0}; dir = 90;}; class Object7 {side = 8; vehicle = "Land_CratesShabby_F"; rank = ""; position[] = {-5.7041,-6.84106,0}; dir = 0;}; class Object8 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {-10.9136,-4.95581,0}; dir = 270;}; class Object9 {side = 8; vehicle = "Land_Cargo_Tower_V2_F"; rank = ""; position[] = {-0.851807,0.32959,0}; dir = 0;}; class Object10 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-9.23218,4.88013,0}; dir = 90;}; class Object11 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-5.65845,5.98853,0}; dir = 180;}; class Object12 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {0.716553,-7.51147,0}; dir = 180;}; class Object13 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {8.29297,-6.56299,0}; dir = 120;}; class Object14 {side = 8; vehicle = "MetalBarrel_burning_F"; rank = ""; position[] = {4.07617,-1.27539,0}; dir = 224.981;}; class Object15 {side = 8; vehicle = "Land_MetalBarrel_empty_F"; rank = ""; position[] = {3.45117,-0.775391,0}; dir = 299.986;}; class Object16 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {4.32617,-0.525146,0}; dir = 89.9624;}; class Object17 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {4.32617,0.224609,0}; dir = 299.966;}; class Object18 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {3.45117,-1.52515,0}; dir = 89.9624;}; class Object19 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {4.95166,-0.275391,0}; dir = 224.986;}; class Object20 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {10.4719,-2.05444,0}; dir = 75;}; class Object21 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {4.79492,-10.0442,0}; dir = 180;}; class Object22 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {1.18774,7.18066,0}; dir = 180;}; class Object23 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {6.06689,6.68286,0}; dir = 45;}; }; class CargoTower3_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortMedium_CargoTower3_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {-2.2605,-1.51782,0}; dir = 195;}; class Object1 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {-0.0427246,-3.88647,0}; dir = 0;}; class Object2 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {0.531982,-7.22217,0}; dir = 0;}; class Object4 {side = 8; vehicle = "Land_CratesPlastic_F"; rank = ""; position[] = {2.04419,-2.0874,0}; dir = 75;}; class Object5 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {1.87842,1.24072,0}; dir = 0;}; class Object6 {side = 8; vehicle = "Land_GarbageBags_F"; rank = ""; position[] = {-0.870117,-3.09814,0}; dir = 0;}; class Object7 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {-6.41357,3.54419,0}; dir = 270;}; class Object8 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {-4.47217,-6.72437,0}; dir = 225;}; class Object9 {side = 8; vehicle = "Barrel3"; rank = ""; position[] = {0.919922,-5.58325,0}; dir = 299.971;}; class Object10 {side = 8; vehicle = "Barrel3"; rank = ""; position[] = {1.54541,-6.08325,0}; dir = 224.987;}; class Object11 {side = 8; vehicle = "Barrel3"; rank = ""; position[] = {0.919922,-6.33301,0}; dir = 89.9763;}; class Object12 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-2.68726,6.30566,0}; dir = 180;}; class Object13 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {0.187744,6.30566,0}; dir = 180;}; class Object14 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {7.40454,-6.59717,0}; dir = 0;}; class Object15 {side = 8; vehicle = "Land_PaperBox_open_full_F"; rank = ""; position[] = {7.66138,-1.2041,0}; dir = 117.271;}; class Object16 {side = 8; vehicle = "Land_Pallets_stack_F"; rank = ""; position[] = {3.60986,1.10791,0}; dir = 181.668;}; class Object17 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {12.1116,-5.37817,0}; dir = 120;}; class Object18 {side = 8; vehicle = "Land_Cargo_Tower_V1_F"; rank = ""; position[] = {2.49194,0.896729,0}; dir = 0;}; class Object19 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {3.06274,6.30566,0}; dir = 180;}; class Object20 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {8.81274,6.30566,0}; dir = 180;}; class Object21 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {5.93774,6.30566,0}; dir = 180;}; class Object22 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {13.2219,4.19556,0}; dir = 75;}; }; class CargoTower4_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortMedium_CargoTower4_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-8.16602,-6.61279,0}; dir = 1.36604e-005;}; class Object1 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-4.93726,-7.19434,0}; dir = 180;}; class Object3 {side = 8; vehicle = "MetalBarrel_burning_F"; rank = ""; position[] = {-4.57764,0.541748,0}; dir = 224.981;}; class Object4 {side = 8; vehicle = "Land_CratesPlastic_F"; rank = ""; position[] = {-1.56714,2.35449,0}; dir = 135;}; class Object5 {side = 8; vehicle = "AmmoCrates_NoInteractive_Large"; rank = ""; position[] = {-1.23706,3.78662,0}; dir = 0.0150947;}; class Object6 {side = 8; vehicle = "Land_Tyres_F"; rank = ""; position[] = {-8.0144,-1.26733,0}; dir = 270;}; class Object7 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {-9.22705,0.166748,0}; dir = 90;}; class Object8 {side = 8; vehicle = "Land_Cargo_Tower_V2_F"; rank = ""; position[] = {0.419189,3.27222,0}; dir = 0;}; class Object9 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-8.85718,6.75513,0}; dir = 90;}; class Object10 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {-1.95264,7.81616,0}; dir = 180;}; class Object11 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {5.64282,-4.36987,0}; dir = 90;}; class Object12 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {3.28198,-5.84717,0}; dir = 360;}; class Object13 {side = 8; vehicle = "Land_Tyre_F"; rank = ""; position[] = {5.34668,3.0437,0}; dir = 0.0248815;}; class Object14 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {3.16455,2.69556,0}; dir = 145.177;}; class Object15 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {3.53271,3.56421,0}; dir = 100.178;}; class Object16 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {2.35986,3.91895,0}; dir = 93.2767;}; class Object17 {side = 8; vehicle = "Land_PaperBox_open_full_F"; rank = ""; position[] = {0.740723,3.81104,0}; dir = 0;}; class Object18 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {9.8833,-0.460693,0}; dir = 90;}; class Object19 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {7.13574,7.32129,0}; dir = 180;}; class Object20 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {4.03198,7.90283,0}; dir = 360;}; }; class CargoTower5_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortMedium_CargoTower5_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object1 {side = 8; vehicle = "Land_Pallets_F"; rank = ""; position[] = {0.245361,-2.41504,0}; dir = 279.076;}; class Object2 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {-0.327637,-8.73267,0}; dir = 0;}; class Object3 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {-5.22705,-3.83325,0}; dir = 90;}; class Object4 {side = 8; vehicle = "Land_Sack_F"; rank = ""; position[] = {-1.08252,3.16577,0}; dir = 300;}; class Object5 {side = 8; vehicle = "Land_Pallets_F"; rank = ""; position[] = {-0.694824,5.17651,0}; dir = 240;}; class Object6 {side = 8; vehicle = "Land_Pallets_stack_F"; rank = ""; position[] = {-3.82764,5.04175,0}; dir = 209.134;}; class Object7 {side = 8; vehicle = "Land_Pallets_stack_F"; rank = ""; position[] = {-5.45264,6.41675,0}; dir = 150.062;}; class Object8 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {0.797363,6.44116,0}; dir = 180;}; class Object9 {side = 8; vehicle = "Land_Pallet_vertical_F"; rank = ""; position[] = {6.96533,-1.03687,0}; dir = 129.025;}; class Object10 {side = 8; vehicle = "GunrackTK_EP1"; rank = ""; position[] = {8.65723,-2.03467,0}; dir = 220.358;}; class Object11 {side = 8; vehicle = "Land_Pallet_F"; rank = ""; position[] = {5.92529,0.130127,0}; dir = 153.337;}; class Object12 {side = 8; vehicle = "Land_Pallets_F"; rank = ""; position[] = {10.5574,-0.537354,0}; dir = 279.076;}; class Object13 {side = 8; vehicle = "Land_Pallets_stack_F"; rank = ""; position[] = {7.83667,0.667969,0}; dir = 2.80062;}; class Object14 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {9.04736,-8.73267,0}; dir = 0;}; class Object15 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {13.9468,-3.83325,0}; dir = 270;}; class Object16 {side = 8; vehicle = "Land_Cargo_Tower_V1_F"; rank = ""; position[] = {5.49634,0.248535,0}; dir = 0;}; class Object17 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {10.1724,6.44116,0}; dir = 180;}; }; class CargoTower6_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortMedium_CargoTower6_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object1 {side = 8; vehicle = "Land_Sacks_heap_F"; rank = ""; position[] = {-2.21191,-1.36353,0}; dir = 210;}; class Object2 {side = 8; vehicle = "Land_Sacks_heap_F"; rank = ""; position[] = {-2.21191,-0.113525,0}; dir = 270;}; class Object3 {side = 8; vehicle = "Land_CratesPlastic_F"; rank = ""; position[] = {-3.21411,-0.367188,0}; dir = 90;}; class Object4 {side = 8; vehicle = "GunrackTK_EP1"; rank = ""; position[] = {0.446045,2.14429,0}; dir = 12.58;}; class Object5 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {-2.70264,-5.23267,0}; dir = 0;}; class Object6 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {-11.0193,-3.74902,0}; dir = 240;}; class Object7 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {-0.20166,2.17651,0}; dir = 138.673;}; class Object8 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {0.0380859,2.88647,0}; dir = 288.637;}; class Object9 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {-0.634277,2.84937,0}; dir = 63.6359;}; class Object10 {side = 8; vehicle = "Land_Cargo_Tower_V2_F"; rank = ""; position[] = {-0.0148926,3.99146,0}; dir = 0;}; class Object11 {side = 8; vehicle = "Land_Sacks_heap_F"; rank = ""; position[] = {-8.24658,7.1687,0}; dir = 74.6844;}; class Object12 {side = 8; vehicle = "Land_Sacks_heap_F"; rank = ""; position[] = {-8.95264,5.79175,0}; dir = 284.684;}; class Object13 {side = 8; vehicle = "Land_Sacks_heap_F"; rank = ""; position[] = {-7.70264,5.91675,0}; dir = 359.684;}; class Object14 {side = 8; vehicle = "Barrel2"; rank = ""; position[] = {-10.5229,6.448,0}; dir = 63.6359;}; class Object15 {side = 8; vehicle = "Barrel2"; rank = ""; position[] = {-9.85107,6.48511,0}; dir = 288.638;}; class Object16 {side = 8; vehicle = "Barrel2"; rank = ""; position[] = {-10.0913,5.77515,0}; dir = 138.673;}; class Object17 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {-8.59375,10.1863,0}; dir = 315;}; class Object18 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {3.17261,2.55444,0}; dir = 12.58;}; class Object19 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {7.69678,-0.458252,0}; dir = 270;}; class Object20 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {4.91992,-7.41919,0}; dir = 180;}; class Object21 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {9.8833,7.16431,0}; dir = 90;}; }; class CargoTower7_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortMedium_CargoTower7_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-0.593018,-4.59717,0}; dir = 0;}; class Object1 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-3.46802,-4.59717,0}; dir = 0;}; class Object2 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {0.681152,-7.88501,0}; dir = 29.9921;}; class Object3 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {-0.193848,-7.88501,0}; dir = 59.9955;}; class Object4 {side = 8; vehicle = "Land_CratesWooden_F"; rank = ""; position[] = {0.181152,-6.26001,0}; dir = 270;}; class Object5 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {0.422363,-10.9827,0}; dir = 0;}; class Object6 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-3.56226,5.05615,0}; dir = 180;}; class Object8 {side = 8; vehicle = "MetalBarrel_burning_F"; rank = ""; position[] = {-4.20264,0.0419922,0}; dir = 224.981;}; class Object9 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {0.674805,7.25293,0}; dir = 360;}; class Object10 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {-8.00098,2.9502,0}; dir = 285;}; class Object11 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {6.68774,-11.0693,0}; dir = 180;}; class Object12 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {10.9363,-4.97363,0}; dir = 270;}; class Object13 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {10.9363,-2.34863,0}; dir = 270;}; class Object14 {side = 8; vehicle = "Land_Pallets_stack_F"; rank = ""; position[] = {7.90186,-1.41089,0}; dir = 180;}; class Object15 {side = 8; vehicle = "Land_Pallets_stack_F"; rank = ""; position[] = {6.30615,-2.15503,0}; dir = 179.999;}; class Object16 {side = 8; vehicle = "Land_CratesShabby_F"; rank = ""; position[] = {7.54834,-2.50854,0}; dir = 90;}; class Object17 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {11.3616,-9.87817,0}; dir = 120;}; class Object18 {side = 8; vehicle = "Land_Cargo_Tower_V1_F"; rank = ""; position[] = {2.87817,-1.40503,0}; dir = 0;}; class Object19 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {10.9084,0.432129,0}; dir = 90;}; class Object20 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {4.81274,4.68115,0}; dir = 180;}; class Object21 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {9.71729,5.10596,0}; dir = 30;}; }; class CargoTower8_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortMedium_CargoTower8_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_Sacks_heap_F"; rank = ""; position[] = {-1.89111,-4.20728,0}; dir = 240;}; class Object1 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-8.89844,-6.53979,0}; dir = 45;}; class Object2 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {-9.52856,-4.39941,0}; dir = 255;}; class Object3 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-6.26782,-7.09619,0}; dir = 180;}; class Object4 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-2.26099,-7.10327,0}; dir = 180;}; class Object5 {side = 8; vehicle = "Land_CratesShabby_F"; rank = ""; position[] = {-0.785156,-3.10913,0}; dir = 270;}; class Object6 {side = 8; vehicle = "Misc_concrete_High"; rank = ""; position[] = {-6.875,-0.75,0}; dir = 0;}; class Object7 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-8.14648,4.32031,0}; dir = 315;}; class Object8 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-2.61401,6.47607,0}; dir = 0;}; class Object9 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-8.85205,-1.73975,0}; dir = 270;}; class Object10 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {7.81592,-6.7146,0}; dir = 315;}; class Object11 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {3.13452,-3.32959,0}; dir = 210.651;}; class Object12 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {5.10669,-7.09619,0}; dir = 180;}; class Object13 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-0.642822,-7.09619,0}; dir = 180;}; class Object14 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {8.37329,-4.08398,0}; dir = 90;}; class Object15 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {3.36401,-6.97827,0}; dir = 180;}; class Object17 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {2,3.25,0}; dir = 45;}; class Object18 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {2,2.25,0}; dir = 255;}; class Object19 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {7.99072,4.25049,0}; dir = 225;}; class Object20 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {5.8064,4.95313,0}; dir = 195;}; class Object21 {side = 8; vehicle = "Land_Pallets_F"; rank = ""; position[] = {3.30298,-1.9375,0}; dir = 37.886;}; class Object22 {side = 8; vehicle = "Land_Pallets_stack_F"; rank = ""; position[] = {2.00684,-1.32422,0}; dir = 92.3558;}; class Object23 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {8.37329,1.66602,0}; dir = 90;}; class Object24 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {5.23901,6.39697,0}; dir = 180;}; class Object25 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {8.35205,-0.262207,0}; dir = 90;}; class Object26 {side = 8; vehicle = "Land_Cargo_Tower_V1_F"; rank = ""; position[] = {0.555908,0.147949,0}; dir = 0;}; }; class CargoTower9_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortMedium_CargoTower9_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Gunrack2"; rank = ""; position[] = {-5.16968,-1.83398,0}; dir = 90;}; class Object1 {side = 8; vehicle = "Land_Sacks_heap_F"; rank = ""; position[] = {-1.25,-7.375,0}; dir = 285;}; class Object2 {side = 8; vehicle = "AmmoCrates_NoInteractive_Large"; rank = ""; position[] = {-7.99316,-3.70947,0}; dir = 271.83;}; class Object3 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {-6.79053,-7.25195,0}; dir = 180;}; class Object4 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {-2.49902,-7.29053,0}; dir = 90;}; class Object5 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {-2.45947,-2.87402,0}; dir = 0;}; class Object6 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {-6.75098,-2.83447,0}; dir = 270;}; class Object7 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {-7.87964,-5.48828,0}; dir = 349.905;}; class Object8 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-6.7356,-5.25195,0}; dir = 90;}; class Object9 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-4.4978,-7.23535,0}; dir = 0;}; class Object10 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-4.7522,-2.88965,0}; dir = 180;}; class Object11 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-2.5144,-4.87305,0}; dir = 270;}; class Object12 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {-6.79053,1.62305,0}; dir = 180;}; class Object13 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {-6.75098,6.04053,0}; dir = 270;}; class Object14 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {-2.49902,1.58447,0}; dir = 90;}; class Object15 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {-2.45947,6.00098,0}; dir = 0;}; class Object16 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {-6.76221,-1.75342,0}; dir = 266.367;}; class Object17 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-2.5144,4.00195,0}; dir = 270;}; class Object18 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-6.7356,3.62305,0}; dir = 90;}; class Object19 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-4.7522,5.98535,0}; dir = 180;}; class Object20 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-4.4978,1.63965,0}; dir = 0;}; class Object21 {side = 8; vehicle = "Land_CratesPlastic_F"; rank = ""; position[] = {0.00366211,-6.62793,0}; dir = 0;}; class Object22 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {3.58447,-7.00195,0}; dir = 180;}; class Object23 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {3.62402,-2.58447,0}; dir = 270;}; class Object24 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {7.87598,-7.04053,0}; dir = 90;}; class Object25 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {7.91553,-2.62402,0}; dir = 0;}; class Object26 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {7.8606,-4.62305,0}; dir = 270;}; class Object27 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {3.6394,-5.00195,0}; dir = 90;}; class Object28 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {5.8772,-6.98535,0}; dir = 0;}; class Object29 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {5.6228,-2.63965,0}; dir = 180;}; class Object31 {side = 8; vehicle = "Land_Sacks_heap_F"; rank = ""; position[] = {5.25,0.75,0}; dir = 0;}; class Object32 {side = 8; vehicle = "Land_Cargo_Tower_V1_F"; rank = ""; position[] = {0.697021,0.47998,0}; dir = 0;}; class Object33 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {3.58447,1.49805,0}; dir = 180;}; class Object34 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {7.91553,5.87598,0}; dir = 0;}; class Object35 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {3.62402,5.91553,0}; dir = 270;}; class Object36 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {7.87598,1.45947,0}; dir = 90;}; class Object37 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {5.8772,1.51465,0}; dir = 0;}; class Object38 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {3.6394,3.49805,0}; dir = 90;}; class Object39 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {7.8606,3.87695,0}; dir = 270;}; class Object40 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {5.6228,5.86035,0}; dir = 180;}; class Object41 {side = 8; vehicle = "Wooden_barrels"; rank = ""; position[] = {3.75,0.5,0}; dir = 0;}; }; class VehicleSmallBunker_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortMedium_VehicleSmallBunker_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-8.61108,4.61011,0}; dir = 270;}; class Object1 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-4.63892,2.51587,0}; dir = 90;}; class Object2 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {0.890381,4.51392,0}; dir = 180;}; class Object3 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-1.26538,4.48608,0}; dir = 0;}; class Object4 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-8.61108,2.36011,0}; dir = 270;}; class Object5 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {2.26099,4.60205,0}; dir = 0;}; class Object6 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-4.61401,4.60205,0}; dir = 0;}; class Object7 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-5.90771,9.43457,0}; dir = 180;}; class Object8 {side = 8; vehicle = "Wire"; rank = ""; position[] = {1.84741,7.70959,0}; dir = 210;}; class Object9 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-9.55957,5.46741,0}; dir = 90;}; class Object10 {side = 8; vehicle = "Land_BagBunker_Small_F"; rank = ""; position[] = {-6.75,6.80554,0}; dir = 180;}; class Object11 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {5.02441,-1.24951,0}; dir = 270;}; class Object12 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {-11.0859,-1.62219,0}; dir = 270;}; class Object13 {side = 8; vehicle = "CUP_A2_barels2"; rank = ""; position[] = {-8.04565,-6.14014,0}; dir = 330;}; class Object14 {side = 8; vehicle = "Barrel3"; rank = ""; position[] = {-10.2095,-5.27991,0}; dir = 120;}; class Object15 {side = 8; vehicle = "Barrel3"; rank = ""; position[] = {-9.5,-5.5,0}; dir = 75;}; class Object16 {side = 8; vehicle = "Land_CamoNetB_EAST"; rank = ""; position[] = {1.29517,-2.7356,0}; dir = 180;}; }; class VehicleTower_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortMedium_VehicleTower_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_IronPipes_F"; rank = ""; position[] = {-12.0142,-2.40515,0}; dir = 75;}; class Object1 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-8.48889,10.3521,0}; dir = 0;}; class Object2 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-8.27295,9.23889,0}; dir = 90;}; class Object3 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-9.80957,7.59241,0}; dir = 90;}; class Object4 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {-7.77454,1.50049,0}; dir = 90;}; class Object5 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {4.66162,-8.02905,0}; dir = 360;}; class Object6 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {8.40454,-7.46289,0}; dir = 270;}; class Object7 {side = 8; vehicle = "Land_PalletTrolley_01_khaki_F"; rank = ""; position[] = {2.62488,-10.375,0}; dir = 314.323;}; class Object8 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {3.48608,-5.60913,0}; dir = 90;}; class Object9 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {5.13892,0.110107,0}; dir = 270;}; class Object10 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {9.01392,-4.38989,0}; dir = 270;}; class Object11 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {7.64038,2.51392,0}; dir = 180;}; class Object12 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {1.63611,-4.14746,0}; dir = 0;}; class Object13 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-5.36389,10.3521,0}; dir = 0;}; class Object14 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {5.10205,-2.13562,0}; dir = 90;}; class Object15 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-2.23889,10.3521,0}; dir = 0;}; class Object16 {side = 8; vehicle = "Wire"; rank = ""; position[] = {7.18457,7.65759,0}; dir = 270;}; class Object17 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-5.78259,11.8096,0}; dir = 180;}; class Object18 {side = 8; vehicle = "Wire"; rank = ""; position[] = {2.21741,11.8096,0}; dir = 180;}; class Object19 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {-6.21228,8.69678,0}; dir = 0;}; class Object20 {side = 8; vehicle = "Land_CamoNetVar_EAST"; rank = ""; position[] = {5.86267,-4.15125,0}; dir = 270;}; class Object21 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {-0.125122,8.875,0}; dir = 344.996;}; class Object22 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {-1.27795,9.00122,0}; dir = 60.0096;}; class Object23 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {2.11255,-6.12744,0}; dir = 270;}; class Object24 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {1.70361,-7.70728,0}; dir = 195;}; class Object25 {side = 8; vehicle = "Land_GarbagePallet_F"; rank = ""; position[] = {-6.2251,8.58838,0}; dir = 0;}; class Object26 {side = 8; vehicle = "Land_Pneu"; rank = ""; position[] = {-4.99951,7.11963,0}; dir = 0;}; class Object27 {side = 8; vehicle = "Land_BagBunker_Tower_F"; rank = ""; position[] = {3.51685,6.35559,0}; dir = 180;}; class Object28 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {11.3358,-0.251831,0}; dir = 90;}; }; class VehicleLargeBunker_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortMedium_VehicleLargeBunker_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-5.58838,-12.1541,0}; dir = 1.70755e-005;}; class Object1 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-6.76392,-8.73462,0}; dir = 90;}; class Object2 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-6.61108,2.60962,0}; dir = 270;}; class Object3 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-3.73889,7.97705,0}; dir = 0;}; class Object4 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-6.64795,6.86389,0}; dir = 90;}; class Object5 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-0.613892,7.97705,0}; dir = 0;}; class Object6 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-6.86389,7.97705,0}; dir = 0;}; class Object7 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-1.34241,10.1904,0}; dir = 0;}; class Object8 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {-6.27454,-3.12451,0}; dir = 90;}; class Object9 {side = 8; vehicle = "Hhedgehog_concrete"; rank = ""; position[] = {-14.875,1.87708,0}; dir = 90;}; class Object10 {side = 8; vehicle = "Hhedgehog_concrete"; rank = ""; position[] = {-14.875,-7.24792,0}; dir = 90;}; class Object12 {side = 8; vehicle = "Hhedgehog_concrete"; rank = ""; position[] = {-2.74792,17.125,0}; dir = 180;}; class Object13 {side = 8; vehicle = "Land_PalletTrolley_01_khaki_F"; rank = ""; position[] = {5.74377,-4.82483,0}; dir = 134.361;}; class Object14 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {2.48608,-1.23462,0}; dir = 90;}; class Object15 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {10.7361,-4.73462,0}; dir = 90;}; class Object16 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {3.01392,-6.76538,0}; dir = 270;}; class Object17 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {10.7361,-7.48462,0}; dir = 90;}; class Object18 {side = 8; vehicle = "Hedgehog"; rank = ""; position[] = {9.21875,-11.9116,0}; dir = 120;}; class Object19 {side = 8; vehicle = "Hedgehog"; rank = ""; position[] = {9.24609,-10.5038,0}; dir = 255;}; class Object20 {side = 8; vehicle = "Hedgehog"; rank = ""; position[] = {7.66162,-11.6563,0}; dir = 30;}; class Object21 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {2.97705,-3.13611,0}; dir = 90;}; class Object22 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {10.7271,-0.511108,0}; dir = 90;}; class Object23 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {8.38611,-8.52246,0}; dir = 6.83019e-006;}; class Object24 {side = 8; vehicle = "Wire"; rank = ""; position[] = {12.2686,5.94714,0}; dir = 270;}; class Object25 {side = 8; vehicle = "Land_CamoNetVar_EAST"; rank = ""; position[] = {7.23767,4.84875,0}; dir = 270;}; class Object26 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {5.04651,-3.66772,0}; dir = 15;}; class Object27 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {4.63745,-5.24756,0}; dir = 90;}; class Object28 {side = 8; vehicle = "Land_BagBunker_Large_F"; rank = ""; position[] = {6.75427,4.45178,0}; dir = 180;}; class Object29 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {5.74768,-10.4603,0}; dir = 180;}; class Object30 {side = 8; vehicle = "Hhedgehog_concrete"; rank = ""; position[] = {6.37708,17.125,0}; dir = 180;}; }; class VehicleCargoPost_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortMedium_VehicleCargoPost_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-13.9346,-1.03259,0}; dir = 90;}; class Object1 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-12.7096,7.09753,0}; dir = 120;}; class Object2 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-6.53259,9.30957,0}; dir = 180;}; class Object3 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {-4.25,4.52502,0}; dir = 180;}; class Object4 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {-9.27454,-0.249512,0}; dir = 90;}; class Object5 {side = 8; vehicle = "Hhedgehog_concrete"; rank = ""; position[] = {-16,-1.49792,0}; dir = 90;}; class Object6 {side = 8; vehicle = "Hhedgehog_concrete"; rank = ""; position[] = {-10.4979,12.375,0}; dir = 180;}; class Object7 {side = 8; vehicle = "Hhedgehog_concrete"; rank = ""; position[] = {-16,7.62708,0}; dir = 90;}; class Object8 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {2.16162,-2.90405,0}; dir = 1.70755e-005;}; class Object9 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {11.8384,-5.96997,0}; dir = 180;}; class Object10 {side = 8; vehicle = "FoldTable"; rank = ""; position[] = {6.25,-8.125,0}; dir = 45;}; class Object11 {side = 8; vehicle = "FoldChair"; rank = ""; position[] = {7.04541,-8.03662,0}; dir = 60;}; class Object12 {side = 8; vehicle = "FoldChair"; rank = ""; position[] = {5.98486,-9.09729,0}; dir = 330;}; class Object13 {side = 8; vehicle = "FoldChair"; rank = ""; position[] = {5.45459,-8.21338,0}; dir = 255;}; class Object14 {side = 8; vehicle = "FoldChair"; rank = ""; position[] = {6.25146,-7.41809,0}; dir = 30;}; class Object15 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {1.13892,2.73511,0}; dir = 270;}; class Object16 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {1.13892,0.609619,0}; dir = 270;}; class Object17 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {12.8611,-9.48413,0}; dir = 90;}; class Object18 {side = 8; vehicle = "Wire"; rank = ""; position[] = {8.96741,9.43457,0}; dir = 180;}; class Object19 {side = 8; vehicle = "Wire"; rank = ""; position[] = {1.53259,9.19043,0}; dir = 0;}; class Object20 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {10.3995,-0.249512,0}; dir = 270;}; class Object21 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {5.25,4.52502,0}; dir = 180;}; class Object22 {side = 8; vehicle = "Land_CamoNetVar_EAST"; rank = ""; position[] = {7.15125,-7.26233,0}; dir = 180;}; class Object23 {side = 8; vehicle = "Land_CratesShabby_F"; rank = ""; position[] = {2.37439,-1.24219,0}; dir = 165;}; class Object24 {side = 8; vehicle = "Land_CratesShabby_F"; rank = ""; position[] = {3.68872,-1.54456,0}; dir = 75;}; class Object25 {side = 8; vehicle = "Hhedgehog_concrete"; rank = ""; position[] = {-1.62292,12.375,0}; dir = 180;}; class Object26 {side = 8; vehicle = "Hhedgehog_concrete"; rank = ""; position[] = {7.50208,12.375,0}; dir = 180;}; class Object27 {side = 8; vehicle = "Land_Cargo_Patrol_V1_F"; rank = ""; position[] = {4.50281,1.24683,0}; dir = 180;}; }; class VehicleWatchtower_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortMedium_VehicleWatchtower_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-7.11389,7.10205,0}; dir = 0;}; class Object1 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-9.14795,4.98889,0}; dir = 90;}; class Object2 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-9.02136,5.32104,0}; dir = 315;}; class Object3 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-11.8849,5.71008,0}; dir = 105;}; class Object4 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-12.9346,-2.65759,0}; dir = 90;}; class Object5 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {-8.77454,-2.62451,0}; dir = 90;}; class Object6 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {-6.95081,4.87915,0}; dir = 315;}; class Object7 {side = 8; vehicle = "Land_GarbagePallet_F"; rank = ""; position[] = {-6.8833,4.79358,0}; dir = 315;}; class Object8 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {9.90454,-0.837891,0}; dir = 270;}; class Object9 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-0.486084,-0.640381,0}; dir = 270;}; class Object10 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {6.39038,-1.8606,0}; dir = 180;}; class Object11 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-0.397949,3.48889,0}; dir = 90;}; class Object12 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-1.76111,7.14795,0}; dir = 180;}; class Object13 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-5.6311,10.8636,0}; dir = 165;}; class Object14 {side = 8; vehicle = "Wire"; rank = ""; position[] = {2.96741,12.3096,0}; dir = 180;}; class Object15 {side = 8; vehicle = "Wire"; rank = ""; position[] = {6.30957,7.40759,0}; dir = 270;}; class Object16 {side = 8; vehicle = "Land_CratesShabby_F"; rank = ""; position[] = {7.37646,-2.86731,0}; dir = 180;}; class Object17 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {9.24756,-0.862549,0}; dir = 0;}; class Object18 {side = 8; vehicle = "Land_Pneu"; rank = ""; position[] = {-4.97803,4.62158,0}; dir = 315;}; class Object19 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {2.24768,-4.33533,0}; dir = 180;}; class Object20 {side = 8; vehicle = "Land_HBarrierTower_F"; rank = ""; position[] = {1.87451,5.59839,0}; dir = 180;}; class Object21 {side = 8; vehicle = "Misc_concrete_High"; rank = ""; position[] = {4.75,2.25,0}; dir = 90;}; class Object22 {side = 8; vehicle = "Land_PaperBox_open_empty_F"; rank = ""; position[] = {6.12512,-3.12537,0}; dir = 180;}; }; // WEST class BunkerTowerHvy_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortMedium_BunkerTowerHvy_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object1 {side = 8; vehicle = "Land_BagBunker_Tower_F"; rank = ""; position[] = {-8.76685,-5.60547,0}; dir = 0;}; class Object2 {side = 8; vehicle = "Land_HBarrier_Big_F"; rank = ""; position[] = {-1.91028,-9.33228,0}; dir = 0;}; class Object3 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {-3.24756,-7.51245,0}; dir = 180;}; class Object4 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {-4.87744,-7.48755,0}; dir = 0;}; class Object5 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {-0.25,-6.125,0}; dir = 180;}; class Object6 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {-0.375,-7.625,0}; dir = 60;}; class Object7 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {-0.375,-6.875,0}; dir = 315;}; class Object8 {side = 8; vehicle = "Land_BarrelEmpty_grey_F"; rank = ""; position[] = {-5.37512,-2.25,0}; dir = 359.981;}; class Object9 {side = 8; vehicle = "Barrel2"; rank = ""; position[] = {-2.0304,-7.86084,0}; dir = 0;}; class Object10 {side = 8; vehicle = "Land_Pallets_stack_F"; rank = ""; position[] = {-2.37354,-0.126465,0}; dir = 0;}; class Object11 {side = 8; vehicle = "Land_Pallet_vertical_F"; rank = ""; position[] = {-2.37488,0.878662,0}; dir = 359.993;}; class Object12 {side = 8; vehicle = "Land_HBarrier_Big_F"; rank = ""; position[] = {-7.53528,-0.0822754,0}; dir = 0;}; class Object13 {side = 8; vehicle = "Land_CamoNetVar_NATO"; rank = ""; position[] = {0.223755,-5.48755,0}; dir = 0;}; class Object14 {side = 8; vehicle = "Land_HBarrier_Big_F"; rank = ""; position[] = {5.6676,-5.83984,0}; dir = 90;}; class Object15 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {3.87305,-12.5144,0}; dir = 180;}; class Object16 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {6.00647,-10.741,0}; dir = 270;}; class Object17 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {1.50647,-10.991,0}; dir = 270;}; class Object18 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {1.45959,-12.501,0}; dir = 180;}; class Object19 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {6.00098,-12.5405,0}; dir = 90;}; class Object20 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {0.375,-6.875,0}; dir = 60;}; class Object21 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {0.5,-6.125,0}; dir = 180;}; class Object22 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {0.375,-7.625,0}; dir = 240;}; class Object23 {side = 8; vehicle = "Land_CampingTable_F"; rank = ""; position[] = {0.554321,-2.04272,0}; dir = 316.418;}; // Z: 0.377088 class Object24 {side = 8; vehicle = "Land_CampingTable_F"; rank = ""; position[] = {1.45618,-2.91553,0}; dir = 134.577;}; class Object25 {side = 8; vehicle = "Land_CampingChair_V1_F"; rank = ""; position[] = {0.243408,-2.41504,0}; dir = 345.135;}; class Object26 {side = 8; vehicle = "Land_CampingChair_V1_F"; rank = ""; position[] = {0.961304,-1.71338,0}; dir = 299.971;}; class Object27 {side = 8; vehicle = "Land_CampingChair_V1_F"; rank = ""; position[] = {1.31433,-3.48145,0}; dir = 134.961;}; class Object28 {side = 8; vehicle = "Land_CampingChair_V1_F"; rank = ""; position[] = {2.19849,-2.95093,0}; dir = 149.982;}; class Object29 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {2.98816,4.7229,0}; dir = 165;}; class Object30 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {7.9126,1.82202,0}; dir = 255;}; class Object31 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {5.63403,3.63647,0}; dir = 30;}; class Object32 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {7.08032,-0.332275,0}; dir = 120;}; class Object33 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {1.45117,2.91772,0}; dir = 120;}; }; class BunkerTowerMed_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortMedium_BunkerTowerMed_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object1 {side = 8; vehicle = "Land_CamoNetVar_NATO"; rank = ""; position[] = {2.72375,-3.86255,0}; dir = 0;}; class Object2 {side = 8; vehicle = "Land_BagBunker_Tower_F"; rank = ""; position[] = {-6.39185,-3.60547,0}; dir = 0;}; class Object3 {side = 8; vehicle = "Land_HBarrier_5_F"; rank = ""; position[] = {-2.99878,-7.50391,0}; dir = 0;}; class Object4 {side = 8; vehicle = "Land_WoodenTable_large_F"; rank = ""; position[] = {-0.5,-2.625,0}; dir = 344.69;}; class Object5 {side = 8; vehicle = "Barrel5"; rank = ""; position[] = {-2.25,-6.375,0}; dir = 300;}; class Object6 {side = 8; vehicle = "Land_CampingChair_V2_F"; rank = ""; position[] = {-1.67712,-2.16138,0}; dir = 195.008;}; class Object7 {side = 8; vehicle = "Land_CampingChair_V2_F"; rank = ""; position[] = {0.0778809,-1.94995,0}; dir = 75.0084;}; class Object8 {side = 8; vehicle = "Land_CampingChair_V2_F"; rank = ""; position[] = {-1.38599,-3.24805,0}; dir = 179.978;}; class Object9 {side = 8; vehicle = "Land_CampingChair_V2_F"; rank = ""; position[] = {0.578247,-2.85132,0}; dir = 105.009;}; class Object10 {side = 8; vehicle = "Barrel5"; rank = ""; position[] = {-3,-6.25,0}; dir = 195;}; class Object11 {side = 8; vehicle = "Land_HBarrier_5_F"; rank = ""; position[] = {-2.87378,0.246094,0}; dir = 0;}; class Object12 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {2.72705,0.489014,0}; dir = 90;}; class Object13 {side = 8; vehicle = "Land_Pallets_F"; rank = ""; position[] = {2.04053,1.73999,0}; dir = 255;}; class Object14 {side = 8; vehicle = "Land_Pallet_F"; rank = ""; position[] = {2.81873,2.06201,0}; dir = 359.641;}; class Object15 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {-0.25,1.375,0}; dir = 0;}; class Object16 {side = 8; vehicle = "Land_CratesPlastic_F"; rank = ""; position[] = {1.18042,2.80859,0}; dir = 360;}; class Object18 {side = 8; vehicle = "Land_HBarrier_5_F"; rank = ""; position[] = {2.62622,-7.50391,0}; dir = 0;}; class Object19 {side = 8; vehicle = "Land_HBarrier_5_F"; rank = ""; position[] = {6.87891,-6.24878,0}; dir = 270;}; class Object20 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {10.7076,-7.13232,0}; dir = 315;}; class Object21 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {11.1394,-4.2522,0}; dir = 90;}; class Object22 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {8.49097,-7.49365,0}; dir = 180;}; class Object23 {side = 8; vehicle = "Gunrack1"; rank = ""; position[] = {5.5249,-6.19141,0}; dir = 90;}; class Object24 {side = 8; vehicle = "Land_BarrelWater_grey_F"; rank = ""; position[] = {7.99988,-2.5,0}; dir = 359.981;}; class Object25 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {10.6324,1.45752,0}; dir = 225;}; class Object26 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {8.30042,1.88599,0}; dir = 180;}; class Object27 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {11.1106,-1.3728,0}; dir = 270;}; }; class BunkerLargeMed_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortMedium_BunkerLargeMed_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object1 {side = 8; vehicle = "Land_BagBunker_Large_F"; rank = ""; position[] = {3.24573,-5.82642,0}; dir = 0;}; class Object2 {side = 8; vehicle = "Land_CamoNetVar_NATO"; rank = ""; position[] = {3.09875,0.137451,0}; dir = 0;}; class Object3 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-3.4176,3.43115,0}; dir = 135;}; class Object4 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-3.76453,0.626953,0}; dir = 270;}; class Object5 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {-1.25635,2.24097,0}; dir = 90;}; class Object6 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {-1.99097,-1.50635,0}; dir = 0;}; class Object7 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {-3.79065,-1.50098,0}; dir = 180;}; class Object8 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {-1.20947,3.75098,0}; dir = 0;}; class Object9 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {-0.507935,0.953125,0}; dir = 30;}; class Object11 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {8.66992,-4.70483,0}; dir = 15;}; class Object12 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {11.3804,-3.63867,0}; dir = 150;}; class Object13 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {10.4926,2.29248,0}; dir = 45;}; class Object14 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {9.68164,4.91724,0}; dir = 225;}; class Object15 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {13.6442,-1.89038,0}; dir = 285;}; class Object16 {side = 8; vehicle = "CUP_ammobednaX"; rank = ""; position[] = {6.12976,-0.521973,0}; dir = 0;}; class Object17 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {12.6115,0.744629,0}; dir = 240;}; class Object18 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {6.8772,5.2644,0}; dir = 0;}; class Object19 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {4.74377,3.49097,0}; dir = 90;}; class Object20 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {4.74927,5.29053,0}; dir = 270;}; class Object21 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {5.375,3.5,0}; dir = 105;}; class Object22 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {5.01318,1.81714,0}; dir = 75;}; class Object23 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {5.375,2.625,0}; dir = 270;}; }; class BunkerTowerLit_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortMedium_BunkerTowerLit_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object1 {side = 8; vehicle = "Land_BagBunker_Tower_F"; rank = ""; position[] = {-8.26685,-2.48047,0}; dir = 0;}; class Object2 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {1.20752,-10.5073,0}; dir = 315;}; class Object3 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-4.50745,-10.4575,0}; dir = 45;}; class Object4 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-1.6272,-10.8894,0}; dir = 180;}; class Object5 {side = 8; vehicle = "Land_HBarrier_1_F"; rank = ""; position[] = {0.117554,-6.25,0}; dir = 90;}; class Object6 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {-4.86414,-8.17554,0}; dir = 270;}; class Object7 {side = 8; vehicle = "Land_HBarrier_1_F"; rank = ""; position[] = {-4.63245,-6.25,0}; dir = 90;}; class Object8 {side = 8; vehicle = "Land_WaterBarrel_F"; rank = ""; position[] = {0,-4.25,0}; dir = 359.995;}; class Object9 {side = 8; vehicle = "Land_WaterBarrel_F"; rank = ""; position[] = {-0.125,-3,0}; dir = 164.995;}; class Object10 {side = 8; vehicle = "Land_CamoNet_NATO"; rank = ""; position[] = {0.333496,3.57153,0}; dir = 355;}; class Object11 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {-1.67346,2.7312,0}; dir = 0;}; class Object12 {side = 8; vehicle = "Land_Pallets_F"; rank = ""; position[] = {-2.18237,5.63281,0}; dir = 90;}; class Object13 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-2.4978,6.5144,0}; dir = 0;}; class Object14 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {0.377197,6.5144,0}; dir = 0;}; class Object15 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {-4.63123,4.74097,0}; dir = 90;}; class Object16 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {-4.62573,6.54053,0}; dir = 270;}; class Object17 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {-4.36182,3.06714,0}; dir = 75;}; class Object18 {side = 8; vehicle = "Land_CratesPlastic_F"; rank = ""; position[] = {-1.62793,4.37793,0}; dir = 195;}; class Object19 {side = 8; vehicle = "Land_MetalBarrel_empty_F"; rank = ""; position[] = {-4.69971,0.836914,0}; dir = 180;}; class Object20 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {-4.75,0,0}; dir = 59.9934;}; class Object22 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {1.47705,-4.01099,0}; dir = 90;}; class Object23 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {1.63586,-8.17554,0}; dir = 270;}; class Object24 {side = 8; vehicle = "Land_HBarrier_5_F"; rank = ""; position[] = {1.25122,-2.87891,0}; dir = 0;}; class Object25 {side = 8; vehicle = "Land_HBarrier_5_F"; rank = ""; position[] = {6.99609,1.37378,0}; dir = 90;}; class Object26 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {1.85999,0.962158,0}; dir = 0;}; class Object27 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {3.2522,6.3894,0}; dir = 0;}; class Object28 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {3.4812,1.65112,0}; dir = 195;}; class Object29 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {2.85583,3.33643,0}; dir = 330;}; class Object30 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {5.61865,4.86597,0}; dir = 90;}; class Object31 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {5.66553,6.37598,0}; dir = 0;}; class Object32 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {5.88806,3.19214,0}; dir = 75;}; class Object33 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {1.74756,1.88745,0}; dir = 0;}; }; class BunkerLargeLit_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortMedium_BunkerLargeLit_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object1 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-6.55017,-11.9258,0}; dir = 75;}; class Object2 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-2.76819,-13.7957,0}; dir = 330;}; class Object3 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {-3.25244,-4.48755,0}; dir = 0;}; class Object4 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {-4.87964,-13.365,0}; dir = 210;}; class Object5 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {-5.71802,-9.77124,0}; dir = 300;}; class Object6 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {-1.7511,-11.6543,0}; dir = 285;}; class Object7 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {-3.38342,-2.74048,0}; dir = 330;}; class Object8 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {1.12695,2.5144,0}; dir = 0;}; class Object9 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {-1.00647,0.740967,0}; dir = 90;}; class Object10 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {-1.00098,2.54053,0}; dir = 270;}; class Object12 {side = 8; vehicle = "Land_CamoNetVar_NATO"; rank = ""; position[] = {2.47375,-6.23755,0}; dir = 0;}; // Z: 0.17834 class Object13 {side = 8; vehicle = "Land_BagBunker_Large_F"; rank = ""; position[] = {2.37073,-4.70142,0}; dir = 0;}; class Object14 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {9.54163,-13.2432,0}; dir = 0;}; class Object15 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {12.3267,-10.074,0}; dir = 255;}; class Object16 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {7.67578,-11.8816,0}; dir = 225;}; class Object17 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {10.5214,-8.53711,0}; dir = 210;}; class Object18 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {11.3641,-12.0017,0}; dir = 135;}; class Object19 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {3.54041,2.50098,0}; dir = 0;}; class Object20 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {4.49207,1.45313,0}; dir = 30;}; class Object21 {side = 8; vehicle = "MetalBarrel_burning_F"; rank = ""; position[] = {3.5,3.5,0}; dir = 0;}; class Object22 {side = 8; vehicle = "CUP_metalcrate"; rank = ""; position[] = {5.875,0.375,0}; dir = 270;}; }; class BunkerLarge1_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortMedium_BunkerLarge1_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_Pallet_F"; rank = ""; position[] = {-1.62744,-8.00098,0}; dir = 224.332;}; class Object2 {side = 8; vehicle = "Land_Pneu"; rank = ""; position[] = {-4.50244,-0.500977,0}; dir = 0;}; class Object3 {side = 8; vehicle = "Land_Sacks_goods_F"; rank = ""; position[] = {-2.50146,-2.48804,0}; dir = 0;}; class Object4 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {-3.62842,-1.08594,0}; dir = 270;}; class Object5 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {-3.66797,-5.50195,0}; dir = 180;}; class Object6 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-3.61304,-3.50366,0}; dir = 90;}; class Object7 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-1.37524,-5.48706,0}; dir = 0;}; class Object8 {side = 8; vehicle = "AmmoCrates_NoInteractive_Large"; rank = ""; position[] = {0.956909,-7.12036,0}; dir = 180;}; class Object9 {side = 8; vehicle = "Wire"; rank = ""; position[] = {1.08997,8.43359,0}; dir = 180;}; class Object10 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-4.06787,3.90674,0}; dir = 270;}; class Object11 {side = 8; vehicle = "Land_CamoNetVar_NATO"; rank = ""; position[] = {1.77625,4.11255,0}; dir = 180;}; class Object12 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {0.633667,-5.52393,0}; dir = 0;}; class Object13 {side = 8; vehicle = "Land_BarrelEmpty_F"; rank = ""; position[] = {2.12244,-6.87598,0}; dir = 359.973;}; class Object14 {side = 8; vehicle = "Land_BagBunker_Large_F"; rank = ""; position[] = {1.50183,2.82593,0}; dir = 180;}; class Object15 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {9.53809,-1.25049,0}; dir = 0;}; class Object16 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {9.49854,-5.6665,0}; dir = 90;}; class Object17 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {9.48315,-3.24878,0}; dir = 270;}; class Object18 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {7.24536,-1.26538,0}; dir = 180;}; class Object19 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {7.49976,-5.61206,0}; dir = 0;}; class Object20 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {4.62476,-5.61157,0}; dir = 0;}; class Object21 {side = 8; vehicle = "Land_CratesWooden_F"; rank = ""; position[] = {1.62256,-4.00098,0}; dir = 180;}; class Object22 {side = 8; vehicle = "Wire"; rank = ""; position[] = {6.93213,4.40674,0}; dir = 270;}; }; class BunkerLarge2_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortMedium_BunkerLarge2_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Hedgehog"; rank = ""; position[] = {-6.63977,1.59253,0}; dir = 105;}; class Object1 {side = 8; vehicle = "Hedgehog"; rank = ""; position[] = {-5.59326,2.97852,0}; dir = 195;}; class Object2 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-2.22705,1.68433,0}; dir = 90;}; class Object3 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-4.31799,-1.70264,0}; dir = 0;}; class Object4 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {-4.49255,0.80542,0}; dir = 120;}; class Object5 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {-1.00366,1.74219,0}; dir = 195.433;}; class Object6 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {-0.877441,0.749023,0}; dir = 285;}; class Object8 {side = 8; vehicle = "Land_GarbagePallet_F"; rank = ""; position[] = {-4.58008,0.87085,0}; dir = 120;}; class Object9 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-4.39185,-3.87378,0}; dir = 270;}; class Object10 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-4.00989,-6.5835,0}; dir = 45;}; class Object11 {side = 8; vehicle = "Land_Pallets_F"; rank = ""; position[] = {-7.03137,-4.64722,0}; dir = 15;}; class Object12 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-4.01953,7.72803,0}; dir = 270;}; class Object13 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {5.39795,1.80933,0}; dir = 90;}; class Object14 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {1.93201,-1.07764,0}; dir = 0;}; class Object15 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {5.39795,-0.815674,0}; dir = 90;}; class Object16 {side = 8; vehicle = "Land_Sack_F"; rank = ""; position[] = {3.69812,0.262939,0}; dir = 285;}; class Object17 {side = 8; vehicle = "Land_Sack_F"; rank = ""; position[] = {4.11877,-0.00415039,0}; dir = 270;}; class Object18 {side = 8; vehicle = "Land_Sack_F"; rank = ""; position[] = {4.24719,0.619141,0}; dir = 225;}; class Object19 {side = 8; vehicle = "Land_CratesShabby_F"; rank = ""; position[] = {3.70361,-3.04224,0}; dir = 0;}; class Object20 {side = 8; vehicle = "Land_PaperBox_open_full_F"; rank = ""; position[] = {2.49744,-2.63525,0}; dir = 0;}; class Object21 {side = 8; vehicle = "Land_BagBunker_Large_F"; rank = ""; position[] = {1.50183,6.70093,0}; dir = 180;}; class Object22 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {2.12036,-7.76538,0}; dir = 180;}; class Object23 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {5.38696,-4.87817,0}; dir = 90;}; class Object24 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {4.8302,-7.3833,0}; dir = 315;}; class Object25 {side = 8; vehicle = "Land_CratesShabby_F"; rank = ""; position[] = {4.04211,-2.21558,0}; dir = 270;}; class Object26 {side = 8; vehicle = "Wire"; rank = ""; position[] = {1.13831,12.2549,0}; dir = 180;}; class Object27 {side = 8; vehicle = "Wire"; rank = ""; position[] = {6.98047,8.22803,0}; dir = 270;}; }; class BunkerLarge3_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortMedium_BunkerLarge3_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_CamoNetVar_NATO"; rank = ""; position[] = {1.52625,-0.137451,0}; dir = 180;}; class Object1 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-1.24133,-0.0239258,0}; dir = 0;}; class Object2 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {2.09961,1.98804,0}; dir = 90;}; class Object3 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-3.61633,3.10107,0}; dir = 0;}; class Object4 {side = 8; vehicle = "Land_Pallet_F"; rank = ""; position[] = {-2.12744,-5.62598,0}; dir = 134.332;}; class Object5 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {2.24512,-1.61353,0}; dir = 6.83019e-006;}; class Object7 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-3.00024,-3.23657,0}; dir = 1.36604e-005;}; class Object8 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-5.98804,-0.00317383,0}; dir = 90;}; class Object9 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-5.58508,2.75635,0}; dir = 135;}; class Object10 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-5.6554,-2.78516,0}; dir = 45;}; class Object11 {side = 8; vehicle = "Land_Pallets_F"; rank = ""; position[] = {1.02124,-7.52881,0}; dir = 285;}; class Object12 {side = 8; vehicle = "Land_Pallets_stack_F"; rank = ""; position[] = {0.622559,-1.62598,0}; dir = 359.998;}; class Object13 {side = 8; vehicle = "Land_BagBunker_Large_F"; rank = ""; position[] = {0.251831,8.45093,0}; dir = 180;}; class Object14 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {1.88367,3.10107,0}; dir = 0;}; class Object15 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {3.86414,-0.616455,0}; dir = 330;}; class Object16 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {9.01196,-0.00317383,0}; dir = 90;}; class Object17 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {6.12476,3.13843,0}; dir = 1.36604e-005;}; class Object18 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {8.63,2.70654,0}; dir = 225;}; class Object19 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {3.99048,1.36353,0}; dir = 225;}; class Object20 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {3.49756,-2.12598,0}; dir = 270;}; class Object21 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {4.24756,-1.87598,0}; dir = 15;}; class Object22 {side = 8; vehicle = "Land_GarbageBags_F"; rank = ""; position[] = {7.38757,4.33423,0}; dir = 270;}; class Object23 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {6.67578,4.66187,0}; dir = 270;}; }; class BunkerLarge4_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortMedium_BunkerLarge4_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_CamoNetVar_NATO"; rank = ""; position[] = {-6.11267,-3.22388,0}; dir = 90;}; class Object1 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-0.442017,-5.65967,0}; dir = 0;}; class Object2 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-2.26855,4.396,0}; dir = 270;}; class Object3 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {-6.33972,-5.6792,0}; dir = 0;}; class Object4 {side = 8; vehicle = "Land_CratesWooden_F"; rank = ""; position[] = {1.74756,-4.00098,0}; dir = 0;}; class Object6 {side = 8; vehicle = "Land_GarbageBags_F"; rank = ""; position[] = {-6.66724,-6.39063,0}; dir = 0;}; class Object7 {side = 8; vehicle = "Misc_concrete_High"; rank = ""; position[] = {1.62256,-7.62598,0}; dir = 90;}; class Object8 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {-9.08118,-1.25366,0}; dir = 90;}; class Object9 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {-6.51636,-3.88232,0}; dir = 0;}; class Object10 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {-6.38647,1.25098,0}; dir = 180;}; class Object11 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {-3.88391,-1.26001,0}; dir = 90;}; class Object12 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-8.53674,0.865234,0}; dir = 135;}; class Object13 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-4.26794,0.706543,0}; dir = 225;}; class Object14 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-8.63489,-3.33789,0}; dir = 45;}; class Object15 {side = 8; vehicle = "AmmoCrates_NoInteractive_Medium"; rank = ""; position[] = {0.0223389,-4.11328,0}; dir = 180;}; class Object16 {side = 8; vehicle = "Land_Pallet_F"; rank = ""; position[] = {-3.87744,-8.00098,0}; dir = 224.332;}; class Object17 {side = 8; vehicle = "Wire"; rank = ""; position[] = {2.88928,8.92285,0}; dir = 180;}; class Object18 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {2.80798,-5.65967,0}; dir = 0;}; class Object19 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {6.94324,-3.95776,0}; dir = 135;}; class Object20 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {7.14893,-1.39771,0}; dir = 90;}; class Object21 {side = 8; vehicle = "Land_BagBunker_Large_F"; rank = ""; position[] = {3.37683,3.57593,0}; dir = 180;}; class Object22 {side = 8; vehicle = "Land_CamoNetVar_NATO"; rank = ""; position[] = {3.65125,-4.26245,0}; dir = 180;}; class Object23 {side = 8; vehicle = "Land_Pallets_stack_F"; rank = ""; position[] = {3.99756,-4.00098,0}; dir = 269.999;}; class Object24 {side = 8; vehicle = "Wire"; rank = ""; position[] = {8.73145,4.896,0}; dir = 270;}; }; class BunkerLarge5_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortMedium_BunkerLarge5_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {3.48645,-5.35303,0}; dir = 180;}; class Object1 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {-0.118408,-5.13232,0}; dir = 360;}; class Object2 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {-2.62317,-2.43774,0}; dir = 90;}; class Object3 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-2.23694,-4.58789,0}; dir = 45;}; class Object4 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-2.07874,-0.319824,0}; dir = 135;}; class Object6 {side = 8; vehicle = "Land_Pallet_F"; rank = ""; position[] = {3.49756,-7.75098,0}; dir = 224.332;}; class Object7 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {2.48254,-4.30444,0}; dir = 26.9265;}; class Object8 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {2.12268,-7.00098,0}; dir = 225.005;}; class Object9 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {2.89917,-2.52539,0}; dir = 276.389;}; class Object10 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {1.24768,-6.87598,0}; dir = 225.005;}; class Object11 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {1.62268,-7.75098,0}; dir = 179.991;}; class Object12 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {1.74756,-4.12598,0}; dir = 285;}; class Object13 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-1.69287,5.53174,0}; dir = 270;}; class Object14 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {6.61145,-5.35303,0}; dir = 180;}; class Object15 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {7.77051,-5.61499,0}; dir = 270;}; class Object16 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {6.53503,-7.67944,0}; dir = 0;}; class Object17 {side = 8; vehicle = "CUP_A2_barels3"; rank = ""; position[] = {4.45105,-3.79932,0}; dir = 255;}; class Object18 {side = 8; vehicle = "Land_GarbageBags_F"; rank = ""; position[] = {6.20752,-8.39087,0}; dir = 0;}; class Object19 {side = 8; vehicle = "Land_BagBunker_Large_F"; rank = ""; position[] = {3.75183,4.32593,0}; dir = 180;}; class Object20 {side = 8; vehicle = "Land_BarrelTrash_F"; rank = ""; position[] = {8.74756,0.873779,0}; dir = 239.995;}; class Object21 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {9.62036,1.60962,0}; dir = 180;}; class Object22 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {12.762,-1.50317,0}; dir = 90;}; class Object23 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {12.38,1.20654,0}; dir = 225;}; class Object24 {side = 8; vehicle = "CUP_hromada_beden_dekorativniX"; rank = ""; position[] = {6.38354,-3.41724,0}; dir = 270;}; class Object25 {side = 8; vehicle = "Wire"; rank = ""; position[] = {3.46497,10.0586,0}; dir = 180;}; }; class BunkerLarge6_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortMedium_BunkerLarge6_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_CamoNetVar_NATO"; rank = ""; position[] = {-7.3562,-1.14185,0}; dir = 60;}; class Object1 {side = 8; vehicle = "Land_HBarrier_1_F"; rank = ""; position[] = {1.2489,-5.78271,0}; dir = 285;}; class Object2 {side = 8; vehicle = "Land_HBarrier_1_F"; rank = ""; position[] = {-1.25452,-4.16235,0}; dir = 330;}; class Object3 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-2.57373,5.62695,0}; dir = 270;}; class Object4 {side = 8; vehicle = "Land_Sack_F"; rank = ""; position[] = {0.868774,-1.50415,0}; dir = 270;}; class Object5 {side = 8; vehicle = "Land_CratesShabby_F"; rank = ""; position[] = {-2.255,-4.61865,0}; dir = 150;}; class Object6 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {-3.12732,-4.25098,0}; dir = 194.982;}; class Object7 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {-2.87744,-5.12598,0}; dir = 285;}; class Object8 {side = 8; vehicle = "Land_PaperBox_open_full_F"; rank = ""; position[] = {-0.261597,-0.625977,0}; dir = 90;}; class Object10 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {-5.00354,0.863037,0}; dir = 60;}; class Object11 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {-9.47571,-1.67114,0}; dir = 60;}; class Object12 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {-8.39429,1.84521,0}; dir = 150;}; class Object13 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-10.0634,0.436035,0}; dir = 105;}; class Object14 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-6.2876,2.43311,0}; dir = 195;}; class Object15 {side = 8; vehicle = "Land_CratesShabby_F"; rank = ""; position[] = {1.12195,-0.493164,0}; dir = 165;}; class Object16 {side = 8; vehicle = "Wire"; rank = ""; position[] = {2.58411,10.1538,0}; dir = 180;}; class Object17 {side = 8; vehicle = "Land_CamoNetVar_NATO"; rank = ""; position[] = {11.8827,-1.81177,0}; dir = 105;}; class Object18 {side = 8; vehicle = "Land_HBarrier_1_F"; rank = ""; position[] = {7.49548,-2.77417,0}; dir = 210;}; class Object19 {side = 8; vehicle = "Land_HBarrier_1_F"; rank = ""; position[] = {4.4989,-5.52881,0}; dir = 255;}; class Object20 {side = 8; vehicle = "Hedgehog"; rank = ""; position[] = {7.31775,-8.26538,0}; dir = 105;}; class Object21 {side = 8; vehicle = "Hedgehog"; rank = ""; position[] = {8.60962,-9.19263,0}; dir = 195;}; class Object22 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {10.4127,-4.80322,0}; dir = 0;}; class Object23 {side = 8; vehicle = "Land_GarbagePallet_F"; rank = ""; position[] = {10.3999,-4.91162,0}; dir = 0;}; class Object24 {side = 8; vehicle = "Land_BagBunker_Large_F"; rank = ""; position[] = {3.00183,4.82593,0}; dir = 180;}; class Object25 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {15.489,-1.75806,0}; dir = 105;}; class Object26 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {10.4836,-0.493896,0}; dir = 105;}; class Object27 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {13.7346,1.22778,0}; dir = 195;}; class Object28 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {15.6398,0.154053,0}; dir = 240;}; class Object29 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {11.558,1.41113,0}; dir = 150;}; class Object30 {side = 8; vehicle = "Land_Pallets_F"; rank = ""; position[] = {4.59607,-8.39624,0}; dir = 15;}; class Object31 {side = 8; vehicle = "Wire"; rank = ""; position[] = {8.42627,6.12695,0}; dir = 270;}; }; class BunkerLarge7_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortMedium_BunkerLarge7_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {1.22949,0.299072,0}; dir = 270;}; class Object1 {side = 8; vehicle = "Land_CratesShabby_F"; rank = ""; position[] = {-0.918579,1.16797,0}; dir = 90;}; class Object2 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {-0.790405,0.375244,0}; dir = 225.005;}; class Object3 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {-1.67297,0.596191,0}; dir = 135.008;}; class Object4 {side = 8; vehicle = "Land_PaperBox_open_full_F"; rank = ""; position[] = {-0.511597,2.37402,0}; dir = 90;}; class Object6 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {-4.40918,3.58057,0}; dir = 270;}; class Object7 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {-4.45898,-2.58789,0}; dir = 180;}; class Object8 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {-2.67749,-2.58057,0}; dir = 180;}; class Object9 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {-4.41199,1.79712,0}; dir = 270;}; class Object10 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-2.42065,3.52368,0}; dir = 180;}; class Object11 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-4.40405,-0.589111,0}; dir = 90;}; class Object12 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-0.289307,-2.58276,0}; dir = 0;}; class Object13 {side = 8; vehicle = "Land_CratesShabby_F"; rank = ""; position[] = {-0.092041,0.829346,0}; dir = 360;}; class Object14 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-1.85889,8.8208,0}; dir = 270;}; class Object15 {side = 8; vehicle = "Hedgehog"; rank = ""; position[] = {9.86609,-4.06201,0}; dir = 315;}; class Object16 {side = 8; vehicle = "Hedgehog"; rank = ""; position[] = {8.26685,-4.73901,0}; dir = 45;}; class Object17 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {7.47949,0.549072,0}; dir = 270;}; class Object18 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {5.46765,-0.609863,0}; dir = 1.36604e-005;}; class Object19 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {8.17896,-3.04419,0}; dir = 210;}; class Object20 {side = 8; vehicle = "Land_Sack_F"; rank = ""; position[] = {6.24719,2.11914,0}; dir = 225;}; class Object21 {side = 8; vehicle = "Land_Sack_F"; rank = ""; position[] = {5.69812,1.76294,0}; dir = 285;}; class Object22 {side = 8; vehicle = "Land_Sack_F"; rank = ""; position[] = {6.11877,1.49585,0}; dir = 270;}; class Object23 {side = 8; vehicle = "Land_GarbagePallet_F"; rank = ""; position[] = {8.24426,-2.95679,0}; dir = 210;}; class Object24 {side = 8; vehicle = "Land_BagBunker_Large_F"; rank = ""; position[] = {3.62683,7.82593,0}; dir = 180;}; class Object25 {side = 8; vehicle = "Land_Pallets_F"; rank = ""; position[] = {4.96863,-4.02222,0}; dir = 15;}; class Object26 {side = 8; vehicle = "Wire"; rank = ""; position[] = {3.29895,13.3477,0}; dir = 180;}; class Object27 {side = 8; vehicle = "Wire"; rank = ""; position[] = {9.14111,9.3208,0}; dir = 270;}; }; class BunkerLarge8_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortMedium_BunkerLarge8_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_CamoNetVar_NATO"; rank = ""; position[] = {0.901245,-2.38745,0}; dir = 180;}; class Object1 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {3.28528,-2.0542,0}; dir = 0;}; class Object3 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {-4.49597,-1.99194,0}; dir = 270;}; class Object4 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {-2.11841,-4.63232,0}; dir = 0;}; class Object5 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-4.08508,0.00634766,0}; dir = 135;}; class Object6 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-4.13489,-4.0835,0}; dir = 45;}; class Object7 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-1.4198,0.741699,0}; dir = 315;}; class Object8 {side = 8; vehicle = "Land_GarbagePallet_F"; rank = ""; position[] = {3.27246,-2.1626,0}; dir = 0;}; class Object9 {side = 8; vehicle = "Land_BarrelWater_F"; rank = ""; position[] = {-0.252563,1.12402,0}; dir = 359.973;}; class Object10 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {-2.75244,-6.12598,0}; dir = 225;}; class Object11 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {-2.92334,-5.40942,0}; dir = 150;}; class Object12 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {-2.04834,-5.40942,0}; dir = 45;}; class Object13 {side = 8; vehicle = "Land_Pallet_F"; rank = ""; position[] = {1.85022,-4.53027,0}; dir = 223.887;}; class Object14 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-2.10889,7.1958,0}; dir = 270;}; class Object15 {side = 8; vehicle = "Land_BagBunker_Large_F"; rank = ""; position[] = {3.37683,6.20093,0}; dir = 180;}; class Object16 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {6.99011,0.541504,0}; dir = 45;}; class Object17 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {9.3302,-4.2583,0}; dir = 315;}; class Object18 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {9.38,-0.418457,0}; dir = 225;}; class Object19 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {6.66492,-4.99365,0}; dir = 135;}; class Object20 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {9.74109,-2.51001,0}; dir = 90;}; class Object21 {side = 8; vehicle = "Land_Pneu"; rank = ""; position[] = {4.74756,-4.25098,0}; dir = 0;}; class Object22 {side = 8; vehicle = "Wire"; rank = ""; position[] = {3.04895,11.7227,0}; dir = 180;}; class Object23 {side = 8; vehicle = "Wire"; rank = ""; position[] = {8.89111,7.6958,0}; dir = 270;}; }; class BunkerLarge9_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortMedium_BunkerLarge9_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object1 {side = 8; vehicle = "Land_Pallets_stack_F"; rank = ""; position[] = {1.18201,1.78955,0}; dir = 192.084;}; class Object2 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {0.892822,-1.26465,0}; dir = 165;}; class Object3 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {0.872559,-2.00098,0}; dir = 240;}; class Object4 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {1.73804,-1.49121,0}; dir = 60;}; class Object5 {side = 8; vehicle = "Land_PaperBox_open_empty_F"; rank = ""; position[] = {1.12244,0.124512,0}; dir = 0;}; class Object6 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-0.141846,-1.37427,0}; dir = 270;}; class Object7 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-0.118896,1.49634,0}; dir = 270;}; class Object8 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {0.263062,-4.21338,0}; dir = 45;}; class Object9 {side = 8; vehicle = "AmmoCrates_NoInteractive_Medium"; rank = ""; position[] = {2.47278,-0.0136719,0}; dir = 0;}; class Object10 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-2.10889,8.3208,0}; dir = 270;}; class Object11 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {6.66028,-5.5542,0}; dir = 0;}; class Object12 {side = 8; vehicle = "Land_GarbagePallet_F"; rank = ""; position[] = {6.64746,-5.6626,0}; dir = 0;}; class Object13 {side = 8; vehicle = "Land_Pneu"; rank = ""; position[] = {4.46191,-6.78198,0}; dir = 90;}; class Object14 {side = 8; vehicle = "Land_Pneu"; rank = ""; position[] = {3.99756,-5.00098,0}; dir = 0;}; class Object15 {side = 8; vehicle = "Land_BagBunker_Large_F"; rank = ""; position[] = {3.37683,7.32544,0}; dir = 180;}; class Object16 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {9.87903,-1.49243,0}; dir = 270;}; class Object17 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {6.62036,-4.01587,0}; dir = 180;}; class Object18 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {9.505,0.581055,0}; dir = 225;}; class Object19 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {6.99011,1.54102,0}; dir = 45;}; class Object20 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {9.3302,-3.63379,0}; dir = 315;}; class Object21 {side = 8; vehicle = "Land_Pallets_F"; rank = ""; position[] = {8.0188,-6.00806,0}; dir = 120;}; class Object22 {side = 8; vehicle = "Wire"; rank = ""; position[] = {3.04895,12.8477,0}; dir = 180;}; class Object23 {side = 8; vehicle = "Wire"; rank = ""; position[] = {8.89111,8.8208,0}; dir = 270;}; }; class CargoTower1_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortMedium_CargoTower1_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {-8.12231,-2.43604,0}; dir = 0;}; class Object1 {side = 8; vehicle = "Land_Pallets_F"; rank = ""; position[] = {-11.2468,-2.2644,0}; dir = 165;}; class Object2 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-3.79297,-7.26733,0}; dir = 195;}; class Object3 {side = 8; vehicle = "Land_Pipes_small_F"; rank = ""; position[] = {-8.17822,-5.66724,0}; dir = 106.399;}; class Object4 {side = 8; vehicle = "Land_Pipes_small_F"; rank = ""; position[] = {-7.76953,-6.69556,0}; dir = 300;}; class Object5 {side = 8; vehicle = "Fort_Crate_wood"; rank = ""; position[] = {-6.13403,2.31934,0}; dir = 276.378;}; class Object6 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {-10.6255,2.9541,0}; dir = 270;}; class Object7 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-5.08936,0.452637,0}; dir = 135;}; class Object8 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-10.3169,-2.02319,0}; dir = 45;}; class Object9 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-10.2144,4.82764,0}; dir = 135;}; class Object10 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-6.04883,-2.06201,0}; dir = 315;}; class Object11 {side = 8; vehicle = "Land_Pallet_F"; rank = ""; position[] = {-12.3818,-1.17993,0}; dir = 165;}; class Object12 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-10.6174,0.693115,0}; dir = 90;}; class Object13 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-2.38403,0.805908,0}; dir = 180;}; class Object14 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-4.50415,5.20972,0}; dir = 0;}; class Object15 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-7.37476,5.23267,0}; dir = 0;}; class Object16 {side = 8; vehicle = "Land_CratesShabby_F"; rank = ""; position[] = {-7.12842,2.82715,0}; dir = 195;}; class Object17 {side = 8; vehicle = "Land_Sacks_heap_F"; rank = ""; position[] = {3.74316,-4.05493,0}; dir = 105;}; class Object18 {side = 8; vehicle = "MetalBarrel_burning_F"; rank = ""; position[] = {-1.48438,-4.93359,0}; dir = 224.981;}; class Object19 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {2.74316,-4.05493,0}; dir = 74.9929;}; class Object20 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {2.74365,-3.05493,0}; dir = 224.989;}; class Object21 {side = 8; vehicle = "Land_Pallet_F"; rank = ""; position[] = {-0.381836,-2.55493,0}; dir = 159.292;}; class Object22 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {2.36597,-2.19409,0}; dir = 180;}; class Object23 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {5.23706,-2.21704,0}; dir = 180;}; class Object24 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {5.73901,-7.35327,0}; dir = 180;}; class Object25 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-0.635986,-7.35327,0}; dir = 180;}; class Object26 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {8.69507,-6.69067,0}; dir = 165;}; class Object28 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {6.10913,4.07666,0}; dir = 180;}; class Object29 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {8.07617,-1.81201,0}; dir = 315;}; class Object30 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {3.07617,1.18799,0}; dir = 315;}; class Object31 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {4.03564,3.70264,0}; dir = 135;}; class Object32 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {8.30371,3.66357,0}; dir = 225;}; class Object33 {side = 8; vehicle = "Land_HBarrier_5_F"; rank = ""; position[] = {-2.49878,5.24487,0}; dir = 0;}; class Object34 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {0.365967,0.805908,0}; dir = 180;}; class Object35 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {8.60425,0.94751,0}; dir = 270;}; class Object36 {side = 8; vehicle = "Land_Cargo_Tower_V1_F"; rank = ""; position[] = {1.19019,-0.0751953,0}; dir = 0;}; }; class CargoTower2_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortMedium_CargoTower2_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_Pallet_F"; rank = ""; position[] = {-3.70068,-6.32104,0}; dir = 159.292;}; class Object1 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {-6.94165,5.42261,0}; dir = 0;}; class Object2 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {-5.26733,5.69165,0}; dir = 345;}; class Object3 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {-8.45117,5.46948,0}; dir = 270;}; class Object4 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {-8.52393,-1.85059,0}; dir = 180;}; class Object5 {side = 8; vehicle = "Land_Pallet_F"; rank = ""; position[] = {-3.82568,5.92896,0}; dir = 159.292;}; class Object6 {side = 8; vehicle = "Land_Pallets_stack_F"; rank = ""; position[] = {-6.13867,6.62524,0}; dir = 75.002;}; class Object7 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-8.4646,3.05615,0}; dir = 270;}; class Object8 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-8.4646,0.306152,0}; dir = 270;}; class Object9 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-6.198,-1.80688,0}; dir = 0;}; class Object10 {side = 8; vehicle = "Barrel3"; rank = ""; position[] = {-6.95068,2.67896,0}; dir = 30.0015;}; class Object11 {side = 8; vehicle = "Barrel3"; rank = ""; position[] = {-6.45068,1.05396,0}; dir = 359.995;}; class Object12 {side = 8; vehicle = "Barrel3"; rank = ""; position[] = {-6.20508,1.79272,0}; dir = 359.909;}; class Object13 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {-6.95068,1.80396,0}; dir = 240.004;}; class Object14 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {-6.31543,2.69141,0}; dir = 107.286;}; class Object15 {side = 8; vehicle = "Land_Pallets_F"; rank = ""; position[] = {-1.44092,-7.20361,0}; dir = 330;}; class Object16 {side = 8; vehicle = "Land_HBarrier_5_F"; rank = ""; position[] = {8.50391,-6.625,0}; dir = 270;}; class Object17 {side = 8; vehicle = "Land_HBarrier_5_F"; rank = ""; position[] = {7.24878,-6.49731,0}; dir = 180;}; class Object19 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {2.67188,0.441406,0}; dir = 0;}; class Object20 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {2.66187,-1.26025,0}; dir = 89.2324;}; class Object21 {side = 8; vehicle = "Land_Pallets_stack_F"; rank = ""; position[] = {4.23584,-0.466309,0}; dir = 0.000373316;}; class Object22 {side = 8; vehicle = "Land_HBarrier_5_F"; rank = ""; position[] = {8.49609,3.24756,0}; dir = 90;}; class Object23 {side = 8; vehicle = "Land_HBarrier_5_F"; rank = ""; position[] = {0.251221,6.99487,0}; dir = 0;}; class Object24 {side = 8; vehicle = "Land_HBarrier_5_F"; rank = ""; position[] = {5.15723,6.83618,0}; dir = 45;}; class Object25 {side = 8; vehicle = "Land_Cargo_Tower_V2_F"; rank = ""; position[] = {0.246338,0.658936,0}; dir = 0;}; }; class CargoTower3_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortMedium_CargoTower3_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {-7.92432,-4.62939,0}; dir = 90;}; class Object1 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {-5.35913,-7.2583,0}; dir = 0;}; class Object2 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-7.47803,-6.71387,0}; dir = 45;}; class Object3 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-7.37988,-2.51099,0}; dir = 135;}; class Object4 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-4.61597,-2.11255,0}; dir = 0;}; class Object5 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-4.61401,-6.89917,0}; dir = 0;}; class Object6 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-7.25488,5.73901,0}; dir = 135;}; class Object7 {side = 8; vehicle = "Land_Pallets_stack_F"; rank = ""; position[] = {-3.24316,2.99805,0}; dir = 14.9996;}; class Object8 {side = 8; vehicle = "Land_HBarrier_5_F"; rank = ""; position[] = {-7.62109,-0.5,0}; dir = 270;}; class Object9 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-4.49097,6.13721,0}; dir = 0;}; class Object10 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-1.74097,6.13721,0}; dir = 0;}; class Object11 {side = 8; vehicle = "MetalBarrel_burning_F"; rank = ""; position[] = {0.506836,-3.37695,0}; dir = 224.981;}; class Object12 {side = 8; vehicle = "Land_Cargo_Tower_V1_No4_F"; rank = ""; position[] = {-0.545898,0.353027,0}; dir = 0;}; class Object13 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {6.38818,-4.61792,0}; dir = 270;}; class Object14 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {3.76587,-7.2583,0}; dir = 0;}; class Object15 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {5.83936,-6.88452,0}; dir = 315;}; class Object16 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {6.01416,-2.66919,0}; dir = 225;}; class Object17 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-0.990967,-7.23779,0}; dir = 0;}; class Object18 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {3.75464,-2.14136,0}; dir = 180;}; class Object19 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {1.01099,-7.14917,0}; dir = 0;}; class Object21 {side = 8; vehicle = "Land_CratesPlastic_F"; rank = ""; position[] = {0.627686,0.623047,0}; dir = 150;}; class Object22 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {6.51318,3.63208,0}; dir = 270;}; class Object23 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {5.96436,1.36548,0}; dir = 315;}; class Object24 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {6.13916,5.58081,0}; dir = 225;}; class Object25 {side = 8; vehicle = "Land_Pallets_stack_F"; rank = ""; position[] = {1.27637,-0.876953,0}; dir = 90.0004;}; class Object26 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {3.63403,6.13721,0}; dir = 0;}; class Object27 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {3.63403,1.01221,0}; dir = 0;}; class Object28 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {2.39575,-0.50415,0}; dir = 90;}; class Object29 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-0.364014,5.97583,0}; dir = 0;}; class Object30 {side = 8; vehicle = "Land_CratesShabby_F"; rank = ""; position[] = {1.63037,0.365479,0}; dir = 0;}; }; class CargoTower4_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortMedium_CargoTower4_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_WoodenBox_F"; rank = ""; position[] = {-9.11377,-4.74829,0}; dir = 240;}; class Object1 {side = 8; vehicle = "Fort_Crate_wood"; rank = ""; position[] = {-8.30859,-3.38452,0}; dir = 270;}; class Object2 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {-12.0977,-0.884277,0}; dir = 180;}; class Object3 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {-7.26611,-0.882324,0}; dir = 0;}; class Object4 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-7.29272,-3.0105,0}; dir = 90;}; class Object5 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-9.68433,-0.897705,0}; dir = 180;}; class Object6 {side = 8; vehicle = "Land_Sacks_heap_F"; rank = ""; position[] = {-6.80664,2.6167,0}; dir = 0;}; class Object7 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {-5.18262,8.15723,0}; dir = 270;}; class Object8 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {-12.0576,3.53223,0}; dir = 270;}; class Object9 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {-5.18115,3.45117,0}; dir = 90;}; class Object10 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-5.19604,5.8689,0}; dir = 270;}; class Object11 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-7.17944,3.5061,0}; dir = 0;}; class Object12 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-3.18384,8.10229,0}; dir = 180;}; class Object13 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-10.0593,3.47729,0}; dir = 180;}; class Object14 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-12.0427,1.1145,0}; dir = 90;}; class Object15 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {6.94385,-8.29907,0}; dir = 90;}; class Object16 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {2.63013,-3.14648,0}; dir = 172.335;}; class Object17 {side = 8; vehicle = "Land_PaperBox_open_full_F"; rank = ""; position[] = {2.18799,-1.25073,0}; dir = 144.595;}; class Object18 {side = 8; vehicle = "Land_HBarrier_5_F"; rank = ""; position[] = {-0.0012207,-8.37231,0}; dir = 180;}; class Object19 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {4.94556,-8.24414,0}; dir = 0;}; class Object20 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {2.06567,-8.27295,0}; dir = 180;}; class Object21 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {6.92896,-5.88135,0}; dir = 270;}; class Object22 {side = 8; vehicle = "Land_Cargo_Tower_V2_F"; rank = ""; position[] = {0.515381,-1.15332,0}; dir = 0;}; class Object24 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {-0.766113,8.11768,0}; dir = 0;}; class Object25 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {2.83057,5.36865,0}; dir = 92.3801;}; class Object26 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {4.63745,5.49756,0}; dir = 112.335;}; class Object27 {side = 8; vehicle = "Land_HBarrier_5_F"; rank = ""; position[] = {7.50391,3.25,0}; dir = 270;}; class Object28 {side = 8; vehicle = "Land_HBarrier_5_F"; rank = ""; position[] = {1.87622,7.49487,0}; dir = 0;}; class Object29 {side = 8; vehicle = "Land_HBarrier_5_F"; rank = ""; position[] = {7.49609,2.12256,0}; dir = 90;}; class Object30 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-0.792725,6.1145,0}; dir = 90;}; class Object31 {side = 8; vehicle = "Wooden_barrels"; rank = ""; position[] = {1.06812,3.99194,0}; dir = 84.595;}; }; class CargoTower5_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortMedium_CargoTower5_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object0 {side = 8; vehicle = "MetalBarrel_burning_F"; rank = ""; position[] = {-7.03809,-2.40234,0}; dir = 224.981;}; class Object1 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-9.98682,-3.46729,0}; dir = 225;}; class Object2 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-9.25244,-6.13232,0}; dir = 45;}; class Object3 {side = 8; vehicle = "Land_HBarrier_5_F"; rank = ""; position[] = {-5.12378,-6.63013,0}; dir = 0;}; class Object4 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-7.36401,-6.64917,0}; dir = 0;}; class Object5 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {-3.83228,2.64722,0}; dir = 0;}; class Object6 {side = 8; vehicle = "Land_CratesPlastic_F"; rank = ""; position[] = {-2.35962,0.623291,0}; dir = 270;}; class Object7 {side = 8; vehicle = "Fort_Crate_wood"; rank = ""; position[] = {-0.86084,0.617676,0}; dir = 186.378;}; class Object8 {side = 8; vehicle = "Land_Cargo_Tower_V1_No6_F"; rank = ""; position[] = {-1.6731,0.304932,0}; dir = 0;}; class Object9 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {-12.7388,-0.415527,0}; dir = 270;}; class Object10 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {-6.48608,5.06909,0}; dir = 0;}; class Object11 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-12.3774,-2.50732,0}; dir = 45;}; class Object12 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-12.3276,1.58252,0}; dir = 135;}; class Object13 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-8.70264,4.70752,0}; dir = 135;}; class Object14 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-9.66211,2.31787,0}; dir = 315;}; class Object15 {side = 8; vehicle = "Land_Pallets_F"; rank = ""; position[] = {-2.99268,0.796631,0}; dir = 270;}; class Object16 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-5.23901,5.22583,0}; dir = 0;}; class Object17 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {11.1677,-6.60278,0}; dir = 0;}; class Object18 {side = 8; vehicle = "Land_Tyre_F"; rank = ""; position[] = {10.3794,-5.54761,0}; dir = 0.0265076;}; class Object19 {side = 8; vehicle = "AmmoCrates_NoInteractive_Large"; rank = ""; position[] = {3.04443,-2.43506,0}; dir = 7.1366;}; class Object20 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {2.74585,-6.66846,0}; dir = 180;}; class Object21 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {11.2173,-3.15894,0}; dir = 315;}; class Object22 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {5.79736,-3.91748,0}; dir = 135;}; class Object23 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {4.83789,-6.30713,0}; dir = 315;}; class Object24 {side = 8; vehicle = "Land_Pallets_F"; rank = ""; position[] = {6.13696,-5.90332,0}; dir = 30;}; class Object25 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {0.627686,-6.68872,0}; dir = 180;}; class Object26 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {8.50708,-3.5354,0}; dir = 0;}; class Object27 {side = 8; vehicle = "Land_GarbageBags_F"; rank = ""; position[] = {7.83984,-7.68945,0}; dir = 0;}; class Object29 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {11.7612,-1.04053,0}; dir = 270;}; class Object30 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {3.37085,4.95679,0}; dir = 180;}; class Object31 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {5.3877,4.53271,0}; dir = 225;}; class Object32 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {11.3872,0.907715,0}; dir = 225;}; class Object33 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {6.12256,1.86768,0}; dir = 45;}; class Object34 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {5.00488,1.95044,0}; dir = 299.977;}; class Object35 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {5.62988,1.45044,0}; dir = 224.988;}; class Object36 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {5.00488,1.20044,0}; dir = 89.962;}; class Object37 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {8.62769,1.31079,0}; dir = 180;}; class Object38 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-0.239014,5.35083,0}; dir = 0;}; }; class CargoTower6_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortMedium_CargoTower6_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {-8.01611,-2.36279,0}; dir = 1.36604e-005;}; class Object1 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {-3.68066,-6.27905,0}; dir = 90;}; class Object2 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {-8.09717,-6.23926,0}; dir = 180;}; class Object3 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-10.4338,-2.37769,0}; dir = 180;}; class Object4 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-5.67944,-6.22437,0}; dir = 0;}; class Object5 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-8.07104,-4.23633,0}; dir = 270;}; class Object6 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-3.69604,-3.98608,0}; dir = 270;}; class Object7 {side = 8; vehicle = "Land_Tyre_F"; rank = ""; position[] = {-7.55884,7.0105,0}; dir = 270.013;}; class Object8 {side = 8; vehicle = "Land_Pallet_vertical_F"; rank = ""; position[] = {-5.05664,7.63428,0}; dir = 180.001;}; class Object9 {side = 8; vehicle = "Land_Pallet_vertical_F"; rank = ""; position[] = {-6.18433,7.13721,0}; dir = 284.996;}; class Object10 {side = 8; vehicle = "Fort_Crate_wood"; rank = ""; position[] = {-4.80786,6.88843,0}; dir = 0;}; class Object11 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {-9.30762,5.802,0}; dir = 270;}; class Object12 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {-9.34717,2.0105,0}; dir = 180;}; class Object13 {side = 8; vehicle = "Land_Pallets_stack_F"; rank = ""; position[] = {-2.30664,1.51147,0}; dir = 94.988;}; class Object14 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-7.05444,2.02588,0}; dir = 0;}; class Object15 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-9.29272,3.75928,0}; dir = 90;}; class Object16 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-7.30444,5.77588,0}; dir = 0;}; class Object17 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-4.67944,5.77588,0}; dir = 0;}; class Object19 {side = 8; vehicle = "AmmoCrates_NoInteractive_Large"; rank = ""; position[] = {-1.41382,-0.275146,0}; dir = 55.6619;}; class Object20 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {5.98389,-1.73755,0}; dir = 0;}; class Object21 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {5.94385,-6.15405,0}; dir = 90;}; class Object22 {side = 8; vehicle = "Land_Pallets_F"; rank = ""; position[] = {-0.641357,-7.26685,0}; dir = 237.491;}; class Object23 {side = 8; vehicle = "Land_Pallets_F"; rank = ""; position[] = {-0.503662,-6.17383,0}; dir = 139.016;}; class Object24 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {5.92896,-3.73633,0}; dir = 270;}; class Object25 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {3.94116,-6.12769,0}; dir = 180;}; class Object26 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {3.69067,-1.75293,0}; dir = 180;}; class Object27 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {2.58228,-0.240723,0}; dir = 90;}; class Object28 {side = 8; vehicle = "Land_GarbagePallet_F"; rank = ""; position[] = {4.3147,-0.285889,0}; dir = 210;}; class Object29 {side = 8; vehicle = "Land_Cargo_Tower_V1_F"; rank = ""; position[] = {-0.859619,0.991455,0}; dir = 0;}; class Object30 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {7.60571,4.33325,0}; dir = 0;}; class Object31 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {5.98389,5.76245,0}; dir = 0;}; class Object32 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {5.94385,1.34595,0}; dir = 90;}; class Object33 {side = 8; vehicle = "Land_Pallets_F"; rank = ""; position[] = {8.1394,2.07788,0}; dir = 279.076;}; class Object34 {side = 8; vehicle = "Land_Pallets_stack_F"; rank = ""; position[] = {7.06494,0.574219,0}; dir = 139.965;}; class Object35 {side = 8; vehicle = "Land_HBarrier_5_F"; rank = ""; position[] = {-2.74878,5.86987,0}; dir = 0;}; class Object36 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {3.94556,1.40088,0}; dir = 0;}; class Object37 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {3.69067,5.74707,0}; dir = 180;}; class Object38 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {5.92896,3.76367,0}; dir = 270;}; class Object39 {side = 8; vehicle = "Barrels"; rank = ""; position[] = {7.25,4.125,0}; dir = 210.003;}; }; class CargoTower7_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortMedium_CargoTower7_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-6.77417,-6.46045,0}; dir = 0;}; class Object1 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-2.51099,-6.47827,0}; dir = 180;}; class Object2 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-9.35889,-0.591553,0}; dir = 135;}; class Object3 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-9.42969,-6.00854,0}; dir = 45;}; class Object4 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-9.76196,-3.35156,0}; dir = 90;}; class Object5 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-7.47705,0.134766,0}; dir = 270;}; class Object6 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {5.47583,-6.45996,0}; dir = 0;}; class Object7 {side = 8; vehicle = "Gunrack2"; rank = ""; position[] = {-0.661865,1.6582,0}; dir = 36.432;}; class Object9 {side = 8; vehicle = "Land_CanisterFuel_F"; rank = ""; position[] = {3.0813,-0.838867,0}; dir = 135.013;}; class Object10 {side = 8; vehicle = "Land_CanisterFuel_F"; rank = ""; position[] = {2.65601,-0.867432,0}; dir = 104.931;}; class Object11 {side = 8; vehicle = "Fort_Crate_wood"; rank = ""; position[] = {6.47241,0.777588,0}; dir = 0;}; class Object12 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {8.35596,-0.766357,0}; dir = 225;}; class Object13 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {8.2583,-6.1272,0}; dir = 315;}; class Object14 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {2.71582,-6.05688,0}; dir = 45;}; class Object15 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {2.41992,0.676025,0}; dir = 74.9879;}; class Object16 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {2.71094,-0.0695801,0}; dir = 150;}; class Object17 {side = 8; vehicle = "Land_PaperBox_open_full_F"; rank = ""; position[] = {1.34766,-0.483887,0}; dir = 6.432;}; class Object18 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {5.70093,-0.31543,0}; dir = 180;}; class Object19 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {8.70923,-3.47217,0}; dir = 270;}; class Object20 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {1.89795,-4.36523,0}; dir = 270;}; class Object21 {side = 8; vehicle = "Wooden_barrels"; rank = ""; position[] = {5.125,0.75,0}; dir = 90;}; class Object22 {side = 8; vehicle = "Land_Cargo_Tower_V2_F"; rank = ""; position[] = {-0.704346,1.50562,0}; dir = 0;}; }; class CargoTower8_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortMedium_CargoTower8_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_Sacks_heap_F"; rank = ""; position[] = {-1.89111,-4.20728,0}; dir = 240;}; class Object1 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-8.89844,-6.53979,0}; dir = 45;}; class Object2 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {-9.52856,-4.39941,0}; dir = 255;}; class Object3 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-6.26782,-7.09619,0}; dir = 180;}; class Object4 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-2.26099,-7.10327,0}; dir = 180;}; class Object5 {side = 8; vehicle = "Land_CratesShabby_F"; rank = ""; position[] = {-0.785156,-3.10913,0}; dir = 270;}; class Object6 {side = 8; vehicle = "Misc_concrete_High"; rank = ""; position[] = {-6.875,-0.75,0}; dir = 0;}; class Object7 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-8.14648,4.32031,0}; dir = 315;}; class Object8 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-2.61401,6.47607,0}; dir = 0;}; class Object9 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-8.85205,-1.73975,0}; dir = 270;}; class Object10 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {7.81592,-6.7146,0}; dir = 315;}; class Object11 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {3.13452,-3.32959,0}; dir = 210.651;}; class Object12 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {5.10669,-7.09619,0}; dir = 180;}; class Object13 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-0.642822,-7.09619,0}; dir = 180;}; class Object14 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {8.37329,-4.08398,0}; dir = 90;}; class Object15 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {3.36401,-6.97827,0}; dir = 180;}; class Object17 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {2,3.25,0}; dir = 45;}; class Object18 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {2,2.25,0}; dir = 255;}; class Object19 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {7.99072,4.25049,0}; dir = 225;}; class Object20 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {5.8064,4.95313,0}; dir = 195;}; class Object21 {side = 8; vehicle = "Land_Pallets_F"; rank = ""; position[] = {3.30298,-1.9375,0}; dir = 37.886;}; class Object22 {side = 8; vehicle = "Land_Pallets_stack_F"; rank = ""; position[] = {2.00684,-1.32422,0}; dir = 92.3558;}; class Object23 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {8.37329,1.66602,0}; dir = 90;}; class Object24 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {5.23901,6.39697,0}; dir = 180;}; class Object25 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {8.35205,-0.262207,0}; dir = 90;}; class Object26 {side = 8; vehicle = "Land_Cargo_Tower_V1_F"; rank = ""; position[] = {0.555908,0.147949,0}; dir = 0;}; }; class CargoTower9_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortMedium_CargoTower9_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Gunrack2"; rank = ""; position[] = {-5.16968,-1.83398,0}; dir = 90;}; class Object1 {side = 8; vehicle = "Land_Sacks_heap_F"; rank = ""; position[] = {-1.25,-7.375,0}; dir = 285;}; class Object2 {side = 8; vehicle = "AmmoCrates_NoInteractive_Large"; rank = ""; position[] = {-7.99316,-3.70947,0}; dir = 271.83;}; class Object3 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {-6.79053,-7.25195,0}; dir = 180;}; class Object4 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {-2.49902,-7.29053,0}; dir = 90;}; class Object5 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {-2.45947,-2.87402,0}; dir = 0;}; class Object6 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {-6.75098,-2.83447,0}; dir = 270;}; class Object7 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {-7.87964,-5.48828,0}; dir = 349.905;}; class Object8 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-6.7356,-5.25195,0}; dir = 90;}; class Object9 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-4.4978,-7.23535,0}; dir = 0;}; class Object10 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-4.7522,-2.88965,0}; dir = 180;}; class Object11 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-2.5144,-4.87305,0}; dir = 270;}; class Object12 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {-6.79053,1.62305,0}; dir = 180;}; class Object13 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {-6.75098,6.04053,0}; dir = 270;}; class Object14 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {-2.49902,1.58447,0}; dir = 90;}; class Object15 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {-2.45947,6.00098,0}; dir = 0;}; class Object16 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {-6.76221,-1.75342,0}; dir = 266.367;}; class Object17 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-2.5144,4.00195,0}; dir = 270;}; class Object18 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-6.7356,3.62305,0}; dir = 90;}; class Object19 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-4.7522,5.98535,0}; dir = 180;}; class Object20 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-4.4978,1.63965,0}; dir = 0;}; class Object21 {side = 8; vehicle = "Land_CratesPlastic_F"; rank = ""; position[] = {0.00366211,-6.62793,0}; dir = 0;}; class Object22 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {3.58447,-7.00195,0}; dir = 180;}; class Object23 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {3.62402,-2.58447,0}; dir = 270;}; class Object24 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {7.87598,-7.04053,0}; dir = 90;}; class Object25 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {7.91553,-2.62402,0}; dir = 0;}; class Object26 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {7.8606,-4.62305,0}; dir = 270;}; class Object27 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {3.6394,-5.00195,0}; dir = 90;}; class Object28 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {5.8772,-6.98535,0}; dir = 0;}; class Object29 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {5.6228,-2.63965,0}; dir = 180;}; class Object31 {side = 8; vehicle = "Land_Sacks_heap_F"; rank = ""; position[] = {5.25,0.75,0}; dir = 0;}; class Object32 {side = 8; vehicle = "Land_Cargo_Tower_V1_No2_F"; rank = ""; position[] = {0.697021,0.47998,0}; dir = 0;}; class Object33 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {3.58447,1.49805,0}; dir = 180;}; class Object34 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {7.91553,5.87598,0}; dir = 0;}; class Object35 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {3.62402,5.91553,0}; dir = 270;}; class Object36 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {7.87598,1.45947,0}; dir = 90;}; class Object37 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {5.8772,1.51465,0}; dir = 0;}; class Object38 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {3.6394,3.49805,0}; dir = 90;}; class Object39 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {7.8606,3.87695,0}; dir = 270;}; class Object40 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {5.6228,5.86035,0}; dir = 180;}; class Object41 {side = 8; vehicle = "Wooden_barrels"; rank = ""; position[] = {3.75,0.5,0}; dir = 0;}; }; class VehicleSmallBunker_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortMedium_VehicleSmallBunker_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object0 {side = 8; vehicle = "AmmoCrates_NoInteractive_Small"; rank = ""; position[] = {-8.89795,-3.35352,0}; dir = 180;}; class Object1 {side = 8; vehicle = "Land_Pallet_F"; rank = ""; position[] = {-10.7665,-3.24854,0}; dir = 224.349;}; class Object2 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-8.9884,-1.89746,0}; dir = 0;}; class Object3 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {4.3866,1.85254,0}; dir = 0;}; class Object4 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-2.4884,1.85254,0}; dir = 0;}; class Object5 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {6.35254,-2.6355,0}; dir = 90;}; class Object6 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {6.35254,0.614502,0}; dir = 90;}; class Object7 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-3.7821,6.68506,0}; dir = 180;}; class Object8 {side = 8; vehicle = "Wire"; rank = ""; position[] = {7.93506,-0.591797,0}; dir = 270;}; class Object9 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-7.43408,2.71777,0}; dir = 90;}; class Object10 {side = 8; vehicle = "Wire"; rank = ""; position[] = {3.97302,4.96021,0}; dir = 210;}; class Object11 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-2.48511,-1.75171,0}; dir = 90;}; class Object12 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-6.51392,-0.122314,0}; dir = 270;}; class Object13 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {2.99829,1.73608,0}; dir = 180;}; class Object14 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {0.877686,1.76489,0}; dir = 0;}; class Object15 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {4.64282,-0.0217285,0}; dir = 90;}; class Object16 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-2.91687,-4.25684,0}; dir = 315;}; class Object17 {side = 8; vehicle = "Fort_Crate_wood"; rank = ""; position[] = {-5.50061,-2.12207,0}; dir = 0;}; class Object18 {side = 8; vehicle = "Fort_Crate_wood"; rank = ""; position[] = {-5.6261,-0.872314,0}; dir = 345;}; class Object19 {side = 8; vehicle = "Land_BagBunker_Small_F"; rank = ""; position[] = {-4.62439,4.05591,0}; dir = 180;}; class Object20 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {-5.00903,-4.61865,0}; dir = 180;}; class Object21 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {-2.50598,0.241455,0}; dir = 90;}; class Object22 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {-6.50598,1.86646,0}; dir = 90;}; class Object23 {side = 8; vehicle = "Land_GarbageWashingMachine_F"; rank = ""; position[] = {4.39343,0.010498,0}; dir = 90;}; class Object25 {side = 8; vehicle = "Land_BarrelSand_F"; rank = ""; position[] = {-7.49963,-3.12402,0}; dir = 359.977;}; }; class VehicleTower_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortMedium_VehicleTower_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-7.52246,-3.8855,0}; dir = 90;}; class Object1 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-7.52246,7.4895,0}; dir = 90;}; class Object2 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-7.7384,8.60254,0}; dir = 0;}; class Object3 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-9.05908,5.84277,0}; dir = 90;}; class Object4 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-5.0321,10.0601,0}; dir = 180;}; class Object5 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-9.05908,-2.15723,0}; dir = 90;}; class Object6 {side = 8; vehicle = "Land_HBarrier_Big_F"; rank = ""; position[] = {-7.58191,0.660645,0}; dir = 90;}; class Object7 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {2.3866,-6.52246,0}; dir = 0;}; class Object8 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {5.85254,-4.5105,0}; dir = 90;}; class Object9 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-4.6134,8.60254,0}; dir = 0;}; class Object10 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-1.4884,8.60254,0}; dir = 0;}; class Object11 {side = 8; vehicle = "Land_CamoNetVar_NATO"; rank = ""; position[] = {9.01233,-5.59888,0}; dir = 90;}; class Object12 {side = 8; vehicle = "Wire"; rank = ""; position[] = {7.93506,5.9082,0}; dir = 270;}; class Object13 {side = 8; vehicle = "Wire"; rank = ""; position[] = {2.9679,10.0601,0}; dir = 180;}; class Object14 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {2.01489,-1.37671,0}; dir = 90;}; class Object15 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {11.4861,-3.74731,0}; dir = 270;}; class Object16 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {5.73608,-2.37231,0}; dir = 270;}; class Object17 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {8.37329,0.736084,0}; dir = 180;}; class Object18 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {3.03796,-9.05249,0}; dir = 0;}; class Object19 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {11.1324,0.333496,0}; dir = 225;}; class Object20 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {11.0836,-6.50635,0}; dir = 315;}; class Object21 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {11.494,-1.75854,0}; dir = 90;}; class Object22 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {8.99146,-6.86816,0}; dir = 180;}; class Object23 {side = 8; vehicle = "CUP_hromada_beden_dekorativniX"; rank = ""; position[] = {4.00049,-4.24902,0}; dir = 180;}; class Object24 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {5.49426,-8.8208,0}; dir = 30.0076;}; class Object25 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {5.72058,-7.97559,0}; dir = 300.001;}; class Object26 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {4.77197,-7.91577,0}; dir = 104.885;}; class Object27 {side = 8; vehicle = "Land_Pallet_F"; rank = ""; position[] = {5.75049,-11.874,0}; dir = 14.332;}; class Object28 {side = 8; vehicle = "Land_BagBunker_Tower_F"; rank = ""; position[] = {4.26733,4.60596,0}; dir = 180;}; class Object29 {side = 8; vehicle = "CUP_A2_barels3"; rank = ""; position[] = {7.09387,-8.54077,0}; dir = 315;}; class Object31 {side = 8; vehicle = "Land_BarrelTrash_F"; rank = ""; position[] = {7.12537,-6.37402,0}; dir = 359.983;}; class Object32 {side = 8; vehicle = "Land_GarbageBags_F"; rank = ""; position[] = {2.71045,-9.76392,0}; dir = 0;}; }; class VehicleLargeBunker_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortMedium_VehicleLargeBunker_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-2.7384,8.85254,0}; dir = 0;}; class Object1 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-8.9884,8.85254,0}; dir = 0;}; class Object2 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-5.8634,8.85254,0}; dir = 0;}; class Object3 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-8.77246,7.7395,0}; dir = 90;}; class Object4 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-3.46692,11.0659,0}; dir = 0;}; class Object5 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-8.86011,-7.87671,0}; dir = 90;}; class Object6 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-8.76392,3.50269,0}; dir = 270;}; class Object7 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {0.389893,-0.376709,0}; dir = 90;}; class Object9 {side = 8; vehicle = "Land_HBarrier_Big_F"; rank = ""; position[] = {-8.83191,-2.21436,0}; dir = 90;}; class Object10 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {6.3866,-8.64746,0}; dir = 6.83019e-006;}; class Object11 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {8.60254,0.364502,0}; dir = 90;}; class Object12 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {0.852539,-2.2605,0}; dir = 90;}; class Object13 {side = 8; vehicle = "Wire"; rank = ""; position[] = {10.144,6.82275,0}; dir = 270;}; class Object14 {side = 8; vehicle = "Wire"; rank = ""; position[] = {4.30188,10.8496,0}; dir = 180;}; class Object15 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {8.63989,-6.62671,0}; dir = 90;}; class Object16 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {8.63989,-3.87671,0}; dir = 90;}; class Object17 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {0.861084,-5.87231,0}; dir = 270;}; class Object18 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {2.51294,-2.49658,0}; dir = 90;}; class Object19 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {6.66296,-10.9275,0}; dir = 0;}; class Object20 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {1.31531,-8.59277,0}; dir = 45;}; class Object21 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {5.11646,-8.99316,0}; dir = 180;}; class Object22 {side = 8; vehicle = "Land_Pneu"; rank = ""; position[] = {7.62549,-12.999,0}; dir = 0;}; class Object23 {side = 8; vehicle = "Land_Pallets_F"; rank = ""; position[] = {8.20996,-10.364,0}; dir = 75;}; class Object24 {side = 8; vehicle = "Land_Pallets_stack_F"; rank = ""; position[] = {2.50049,-4.12402,0}; dir = 180;}; class Object25 {side = 8; vehicle = "Land_Pallets_stack_F"; rank = ""; position[] = {1.50049,-0.124023,0}; dir = 179.999;}; class Object26 {side = 8; vehicle = "Land_Pallets_stack_F"; rank = ""; position[] = {2.12817,-6.00977,0}; dir = 194.81;}; class Object27 {side = 8; vehicle = "Land_CratesPlastic_F"; rank = ""; position[] = {8.37183,-11.7512,0}; dir = 120;}; class Object28 {side = 8; vehicle = "AmmoCrates_NoInteractive_Large"; rank = ""; position[] = {2.92139,0.00292969,0}; dir = 270;}; class Object29 {side = 8; vehicle = "Land_GarbageBags_F"; rank = ""; position[] = {6.33545,-11.6389,0}; dir = 0;}; class Object30 {side = 8; vehicle = "Land_BagBunker_Large_F"; rank = ""; position[] = {4.62976,5.32739,0}; dir = 180;}; }; class VehicleCargoPost_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortMedium_VehicleCargoPost_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-11.0591,5.59277,0}; dir = 90;}; class Object1 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-6.1571,10.5601,0}; dir = 180;}; class Object2 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-11.3091,-2.53223,0}; dir = 90;}; class Object3 {side = 8; vehicle = "Land_HBarrier_Big_F"; rank = ""; position[] = {-9.16711,3.59033,0}; dir = 270;}; class Object4 {side = 8; vehicle = "Land_HBarrier_Big_F"; rank = ""; position[] = {-9.04211,-4.65918,0}; dir = 270;}; class Object5 {side = 8; vehicle = "Land_HBarrier_Big_F"; rank = ""; position[] = {-5.90979,8.66821,0}; dir = 0;}; class Object6 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {7.2616,-1.02246,0}; dir = 0;}; class Object7 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-0.726563,1.76147,0}; dir = 270;}; class Object8 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {0.386597,-1.14746,0}; dir = 0;}; class Object9 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-0.726563,4.88647,0}; dir = 270;}; class Object10 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-0.726563,-1.36353,0}; dir = 270;}; class Object11 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {7.39844,-0.238525,0}; dir = 270;}; class Object12 {side = 8; vehicle = "Wire"; rank = ""; position[] = {9.43506,6.0332,0}; dir = 270;}; class Object13 {side = 8; vehicle = "Wire"; rank = ""; position[] = {3.7179,10.5601,0}; dir = 180;}; class Object14 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {2.48608,-3.37231,0}; dir = 270;}; class Object15 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {11.7649,-4.12671,0}; dir = 90;}; class Object16 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {1.49963,2.36328,0}; dir = 195;}; class Object17 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {1.38696,4.63159,0}; dir = 75;}; class Object18 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {0.85791,-3.60132,0}; dir = 270;}; class Object19 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {11.3107,-1.40625,0}; dir = 225;}; class Object20 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {2.94031,-6.09277,0}; dir = 45;}; class Object21 {side = 8; vehicle = "CUP_hromada_beden_dekorativniX"; rank = ""; position[] = {9.50049,-2.99902,0}; dir = 15;}; class Object22 {side = 8; vehicle = "Barrel2"; rank = ""; position[] = {6.8855,-2.20679,0}; dir = 75;}; class Object23 {side = 8; vehicle = "Barrel2"; rank = ""; position[] = {8.25049,-2.37402,0}; dir = 255;}; class Object24 {side = 8; vehicle = "Land_Pneu"; rank = ""; position[] = {-0.600098,-3.15552,0}; dir = 270;}; class Object25 {side = 8; vehicle = "Land_Pallets_F"; rank = ""; position[] = {2.02173,-6.77783,0}; dir = 285;}; class Object26 {side = 8; vehicle = "Land_GarbageWashingMachine_F"; rank = ""; position[] = {1.10754,-3.63354,0}; dir = 270;}; class Object28 {side = 8; vehicle = "Land_HBarrier_Big_F"; rank = ""; position[] = {7.45789,5.34033,0}; dir = 270;}; class Object29 {side = 8; vehicle = "Land_HBarrier_Big_F"; rank = ""; position[] = {2.34021,8.54321,0}; dir = 0;}; class Object30 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {8.00049,-3.24902,0}; dir = 150;}; class Object31 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {7.14697,-3.08105,0}; dir = 45;}; class Object32 {side = 8; vehicle = "Land_Cargo_Patrol_V1_F"; rank = ""; position[] = {3.0033,4.87231,0}; dir = 180;}; }; class VehicleWatchtower_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortMedium_VehicleWatchtower_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-7.77246,4.3645,0}; dir = 90;}; class Object1 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-7.77246,1.1145,0}; dir = 90;}; class Object2 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-5.7384,6.47754,0}; dir = 0;}; class Object3 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-7.77246,-1.8855,0}; dir = 90;}; class Object4 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-7.64587,4.69653,0}; dir = 315;}; class Object5 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-7.81006,-4.55444,0}; dir = 75;}; class Object6 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-9.3844,4.08545,0}; dir = 105;}; class Object7 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-4.50952,9.17798,0}; dir = 165;}; class Object8 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-10.3091,-3.78223,0}; dir = 90;}; class Object9 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-0.38562,6.52344,0}; dir = 180;}; class Object10 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {0.977539,2.8645,0}; dir = 90;}; class Object11 {side = 8; vehicle = "Wire"; rank = ""; position[] = {3.3429,10.3101,0}; dir = 180;}; class Object12 {side = 8; vehicle = "Wire"; rank = ""; position[] = {7.68506,6.7832,0}; dir = 270;}; class Object13 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {0.861084,-1.24731,0}; dir = 270;}; class Object14 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {3.74829,-4.51392,0}; dir = 180;}; class Object15 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {7.8811,2.6145,0}; dir = 165;}; class Object16 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {6.53796,-5.92749,0}; dir = 0;}; class Object17 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {1.24304,-3.95703,0}; dir = 45;}; class Object18 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {6.46887,-4.05957,0}; dir = 315;}; class Object19 {side = 8; vehicle = "Land_Pneu"; rank = ""; position[] = {5.25049,-7.62402,0}; dir = 0;}; class Object20 {side = 8; vehicle = "Land_Pallets_F"; rank = ""; position[] = {7.64673,-3.7561,0}; dir = 120;}; class Object21 {side = 8; vehicle = "Land_HBarrierTower_F"; rank = ""; position[] = {3.25,4.97388,0}; dir = 180;}; class Object23 {side = 8; vehicle = "Land_Pallets_stack_F"; rank = ""; position[] = {7.37231,0.747803,0}; dir = 164.999;}; class Object24 {side = 8; vehicle = "Land_Pallets_stack_F"; rank = ""; position[] = {6.0271,2.20923,0}; dir = 330;}; class Object25 {side = 8; vehicle = "AmmoCrates_NoInteractive_Large"; rank = ""; position[] = {8.71191,1.23804,0}; dir = 255;}; class Object26 {side = 8; vehicle = "Land_GarbageBags_F"; rank = ""; position[] = {6.21045,-6.63892,0}; dir = 0;}; }; class VehicleBunker_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortMedium_VehicleBunker_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object1 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-10.0892,-4.15674,0}; dir = 270;}; class Object2 {side = 8; vehicle = "Land_HBarrier_1_F"; rank = ""; position[] = {-4.80811,-3.98853,0}; dir = 120;}; class Object3 {side = 8; vehicle = "Land_HBarrier_1_F"; rank = ""; position[] = {-8.75366,-4.13379,0}; dir = 90;}; class Object4 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-9.9845,0.128906,0}; dir = 90;}; class Object5 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-6.87109,-4.14063,0}; dir = 180;}; class Object6 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-1.13257,-1.72778,0}; dir = 195;}; class Object7 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-6.83386,4.98291,0}; dir = 75;}; class Object8 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-9.57947,2.87402,0}; dir = 135;}; class Object9 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {-7.38525,2.94312,0}; dir = 15;}; class Object10 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-6.85278,5.75781,0}; dir = 285;}; class Object11 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-0.358032,-1.70898,0}; dir = 345;}; class Object12 {side = 8; vehicle = "Land_HBarrier_1_F"; rank = ""; position[] = {5.74243,-8.13062,0}; dir = 120;}; class Object13 {side = 8; vehicle = "Land_HBarrier_1_F"; rank = ""; position[] = {10.7424,-3.13062,0}; dir = 120;}; class Object14 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {3.87585,-7.20435,0}; dir = 45;}; class Object15 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {10.3295,-7.87402,0}; dir = 315;}; class Object16 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {7.74609,-8.23438,0}; dir = 0;}; class Object17 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {10.7345,-5.12891,0}; dir = 270;}; class Object18 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {3.4845,-4.37891,0}; dir = 270;}; class Object19 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {3.927,-2.27344,0}; dir = 300;}; class Object21 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {7.16357,3.39844,0}; dir = 285;}; class Object22 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {8.26208,1.62085,0}; dir = 120;}; class Object23 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {8.75,3.625,0}; dir = 0;}; class Object24 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {8.5,2.875,0}; dir = 105;}; class Object25 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {6.7926,2.71826,0}; dir = 135;}; }; }; class FortSmall { name = $STR_ZECCUP_FortSmall; // EAST class NestSandbag_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_NestSandbag_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object1 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-5.198,0.462158,0}; dir = 240;}; class Object3 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {7.62268,-0.210938,0}; dir = 180;}; class Object4 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {10.3889,3.60962,0}; dir = 270;}; class Object5 {side = 8; vehicle = "Wire"; rank = ""; position[] = {2.46741,-4.69043,0}; dir = 180;}; class Object6 {side = 8; vehicle = "Land_BagBunker_Small_F"; rank = ""; position[] = {2.99988,3.69458,0}; dir = 0;}; class Object7 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {9.21338,7.27954,0}; dir = 180;}; class Object8 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {1.84546,6.71338,0}; dir = 90;}; class Object9 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {6.78992,4.23657,0}; dir = 0;}; class Object10 {side = 8; vehicle = "Fort_Crate_wood"; rank = ""; position[] = {5.74805,4.62378,0}; dir = 270;}; class Object11 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {5.875,3.75,0}; dir = 225;}; class Object12 {side = 8; vehicle = "Land_Sack_F"; rank = ""; position[] = {6.50317,5.12109,0}; dir = 180;}; }; class NestHBarrier_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_NestHBarrier_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object1 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-8.802,0.0378418,0}; dir = 60;}; class Object3 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-1.60962,4.38892,0}; dir = 180;}; class Object4 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {-5.46082,7.12744,0}; dir = 270;}; class Object5 {side = 8; vehicle = "Wire"; rank = ""; position[] = {1.59241,-5.56543,0}; dir = 180;}; class Object6 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {1.875,9.89941,0}; dir = 180;}; class Object7 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {6.89954,4.75,0}; dir = 270;}; class Object8 {side = 8; vehicle = "Land_BagBunker_Small_F"; rank = ""; position[] = {1.37488,2.81958,0}; dir = 0;}; class Object9 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {3.04883,8.09619,0}; dir = 0;}; class Object10 {side = 8; vehicle = "Land_WaterBarrel_F"; rank = ""; position[] = {5.83057,8.92017,0}; dir = 0.0389721;}; class Object11 {side = 8; vehicle = "Gunrack1"; rank = ""; position[] = {4.375,9,0}; dir = 270;}; class Object12 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {1.875,9,0}; dir = 180;}; class Object13 {side = 8; vehicle = "Barrel3"; rank = ""; position[] = {2.125,8.375,0}; dir = 60;}; class Object14 {side = 8; vehicle = "Barrel3"; rank = ""; position[] = {2.625,9,0}; dir = 15;}; }; class Sandbags_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_Sandbags_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object1 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {-1.56653,-0.415771,0}; dir = 240;}; class Object3 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {14.6659,-1.44165,0}; dir = 150;}; class Object4 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {7.89453,-3.98389,0}; dir = 45;}; class Object5 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {2.10547,-8.64111,0}; dir = 225;}; class Object6 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {1.73608,-3.48462,0}; dir = 90;}; class Object7 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {7.00635,-8.23022,0}; dir = 150;}; class Object8 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {8.25,4.64941,0}; dir = 180;}; class Object9 {side = 8; vehicle = "Land_Wreck_BMP2_F"; rank = ""; position[] = {2.98621,3.06323,0}; dir = 300;}; class Object10 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {14.8384,4.15454,0}; dir = 180;}; class Object11 {side = 8; vehicle = "Land_GarbageBags_F"; rank = ""; position[] = {8.46008,3.23511,0}; dir = 0;}; class Object12 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {8.78772,3.94678,0}; dir = 0;}; class Object13 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {11.875,3.75,0}; dir = 0;}; class Object14 {side = 8; vehicle = "Land_Pallets_stack_F"; rank = ""; position[] = {10.9023,3.38647,0}; dir = 265.803;}; // Z: 0.133556 }; class SandbagsNet_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_SandbagNet_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object1 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {2.69861,-2.42676,0}; dir = 0;}; class Object2 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-0.588379,-5.02954,0}; dir = 0;}; class Object3 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {3.625,0.149414,0}; dir = 180;}; class Object4 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-1.76392,-1.35962,0}; dir = 90;}; class Object5 {side = 8; vehicle = "Land_Pallets_stack_F"; rank = ""; position[] = {2.12354,-1.00146,0}; dir = 90;}; class Object6 {side = 8; vehicle = "Land_Pallet_vertical_F"; rank = ""; position[] = {3.12866,-1.00024,0}; dir = 89.9965;}; class Object7 {side = 8; vehicle = "Fort_Crate_wood"; rank = ""; position[] = {0.747803,-1.12549,0}; dir = 285;}; class Object9 {side = 8; vehicle = "Land_CamoNet_EAST"; rank = ""; position[] = {3.85083,-2.17554,0}; dir = 0;}; class Object10 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {6.76538,-5.23608,0}; dir = 180;}; class Object11 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {10.5858,-2.50244,0}; dir = 90;}; }; class SandbagNetHvy_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_SandbagNetHvy_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object1 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {1.01538,-1.98608,0}; dir = 180;}; class Object3 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {10.2795,-1.33838,0}; dir = 270;}; class Object4 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {5.12268,-4.46094,0}; dir = 180;}; class Object5 {side = 8; vehicle = "Land_CamoNet_EAST"; rank = ""; position[] = {5.22583,1.19946,0}; dir = 0;}; class Object6 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {5.25,2.89941,0}; dir = 180;}; class Object7 {side = 8; vehicle = "Land_Sacks_heap_F"; rank = ""; position[] = {3.375,2.25,0}; dir = 0;}; class Object8 {side = 8; vehicle = "Land_Sack_F"; rank = ""; position[] = {7.49548,2.3728,0}; dir = 285;}; class Object9 {side = 8; vehicle = "Land_BarrelWater_F"; rank = ""; position[] = {4.49988,2.125,0}; dir = 359.981;}; class Object10 {side = 8; vehicle = "Land_Sack_EP1"; rank = ""; position[] = {8.0011,2.38037,0}; dir = 75;}; }; class NestMed_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_NestMed_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object1 {side = 8; vehicle = "Land_BagBunker_Small_F"; rank = ""; position[] = {1.12488,3.69458,0}; dir = 0;}; class Object3 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-0.029541,6.71338,0}; dir = 90;}; class Object4 {side = 8; vehicle = "Fort_Crate_wood"; rank = ""; position[] = {1.1261,8.74805,0}; dir = 180;}; class Object5 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {0.25,8.5,0}; dir = 180;}; class Object6 {side = 8; vehicle = "Land_CamoNetVar_EAST"; rank = ""; position[] = {2.84875,5.38745,0}; dir = 0;}; class Object7 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {4.90454,6.28662,0}; dir = 270;}; class Object8 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {7.23462,7.61108,0}; dir = 0;}; }; class SandbagNetLit_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_SandbagNetLit_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object1 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-0.138916,-0.234619,0}; dir = 90;}; class Object3 {side = 8; vehicle = "Land_CamoNet_EAST"; rank = ""; position[] = {2.60083,-0.800537,0}; dir = 0;}; class Object4 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {2.5,1.64941,0}; dir = 180;}; class Object5 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {2.62268,-3.96094,0}; dir = 180;}; class Object6 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {2.88208,-0.727783,0}; dir = 0;}; class Object7 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {5.36108,-0.234619,0}; dir = 90;}; class Object8 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {3.875,0.875,0}; dir = 285;}; class Object9 {side = 8; vehicle = "Barrel3"; rank = ""; position[] = {4.625,0.75,0}; dir = 60;}; }; class LightNet1_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_LightNet1_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-5.51123,-1.89258,0}; dir = 0;}; class Object1 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-2.40747,-2.47363,0}; dir = 180;}; class Object2 {side = 8; vehicle = "Land_CamoNet_EAST"; rank = ""; position[] = {-1.57202,0.961426,0}; dir = 0;}; class Object3 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-5.16187,3.11426,0}; dir = 0;}; class Object4 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {3.90918,2.24609,0}; dir = 195;}; class Object5 {side = 8; vehicle = "Land_CratesWooden_F"; rank = ""; position[] = {2.70215,0.887207,0}; dir = 15;}; class Object6 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {1.20215,1.63721,0}; dir = 0;}; }; class LightNet2_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_LightNet2_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-7.77954,0.713379,0}; dir = 90;}; class Object1 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-2.85962,-3.61084,0}; dir = 180;}; class Object2 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-5.60962,-3.61084,0}; dir = 180;}; class Object3 {side = 8; vehicle = "Land_CratesWooden_F"; rank = ""; position[] = {-2.5,1,0}; dir = 0;}; class Object4 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {-4.25,1.25,0}; dir = 0;}; class Object5 {side = 8; vehicle = "Land_CamoNet_EAST"; rank = ""; position[] = {-1.64917,0.0742188,0}; dir = 0;}; class Object6 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-5.23901,2.47705,0}; dir = 0;}; class Object7 {side = 8; vehicle = "Land_HBarrier_5_F"; rank = ""; position[] = {4.99609,1.24854,0}; dir = 90;}; class Object8 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {2.89038,-3.61084,0}; dir = 180;}; }; class LightNet3_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_LightNet3_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_CamoNetVar_EAST"; rank = ""; position[] = {0.348877,0.387207,0}; dir = 0;}; class Object1 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-0.984619,-2.86084,0}; dir = 180;}; class Object2 {side = 8; vehicle = "Land_HBarrier_1_F"; rank = ""; position[] = {-5.00659,-3.62109,0}; dir = 120;}; class Object4 {side = 8; vehicle = "Land_HBarrier_1_F"; rank = ""; position[] = {-5.24463,5.38037,0}; dir = 225;}; class Object5 {side = 8; vehicle = "Land_CratesWooden_F"; rank = ""; position[] = {-4.375,4.25,0}; dir = 330;}; class Object6 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {-5.625,3,0}; dir = 180;}; class Object7 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {1.76538,-2.86084,0}; dir = 180;}; class Object8 {side = 8; vehicle = "Land_HBarrier_1_F"; rank = ""; position[] = {5.00537,-2.99463,0}; dir = 225;}; class Object9 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {6.98608,-0.234863,0}; dir = 90;}; class Object10 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {6.98608,2.51514,0}; dir = 90;}; class Object11 {side = 8; vehicle = "Land_HBarrier_1_F"; rank = ""; position[] = {5.13037,5.11963,0}; dir = 315;}; class Object12 {side = 8; vehicle = "Land_BarrelWater_F"; rank = ""; position[] = {4.83496,4.03662,0}; dir = 356.324;}; class Object13 {side = 8; vehicle = "Land_Pallets_F"; rank = ""; position[] = {4.40625,4.88672,0}; dir = 225;}; class Object14 {side = 8; vehicle = "Land_Pallet_F"; rank = ""; position[] = {4.13037,6.63232,0}; dir = 329.339;}; }; class LightNet4_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_LightNet4_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-6.52954,1.08838,0}; dir = 90;}; class Object1 {side = 8; vehicle = "Land_HBarrier_1_F"; rank = ""; position[] = {-7.13037,-4.24463,0}; dir = 135;}; class Object2 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-7.11108,-2.01514,0}; dir = 270;}; class Object3 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-3.60962,5.01416,0}; dir = 180;}; class Object4 {side = 8; vehicle = "Land_CamoNetVar_EAST"; rank = ""; position[] = {-1.77612,-0.487793,0}; dir = 0;}; class Object5 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {3.77441,0,0}; dir = 270;}; class Object6 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-0.838379,-4.15479,0}; dir = 0;}; class Object7 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {2.26538,-4.73584,0}; dir = 180;}; class Object8 {side = 8; vehicle = "Land_CratesShabby_F"; rank = ""; position[] = {2.75635,0.379395,0}; dir = 225;}; class Object9 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {2.875,1.375,0}; dir = 240;}; class Object10 {side = 8; vehicle = "Land_BarrelEmpty_F"; rank = ""; position[] = {2.875,-0.375,0}; dir = 359.981;}; class Object12 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {2.14038,5.01416,0}; dir = 180;}; class Object13 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-0.734619,5.01416,0}; dir = 180;}; class Object14 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {2.94775,2.02686,0}; dir = 0;}; }; class NetCamo_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_NetCamo_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object2 {side = 8; vehicle = "Land_CamoNetB_EAST"; rank = ""; position[] = {5.45471,5.6106,0}; dir = 0;}; class Object3 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {-0.149536,5.375,0}; dir = 90;}; class Object4 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {11.1545,-3.21338,0}; dir = 270;}; class Object5 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {11.7361,0.0153809,0}; dir = 90;}; class Object6 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {5.875,11.5244,0}; dir = 180;}; class Object7 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {11.8995,6.25,0}; dir = 270;}; }; class BunkerSmall1_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_BunkerSmall1_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {-4.71216,-4.67822,0}; dir = 0;}; class Object1 {side = 8; vehicle = "Land_BagBunker_Small_F"; rank = ""; position[] = {-0.75,2.80603,0}; dir = 180;}; class Object2 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-4.16162,-3.21997,0}; dir = 180;}; class Object3 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {2.76538,1.7644,0}; dir = 180;}; class Object5 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {-7.96094,0.127808,0}; dir = 270;}; class Object6 {side = 8; vehicle = "Land_GarbageBags_F"; rank = ""; position[] = {-5.03979,-5.38989,0}; dir = 0;}; class Object7 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-4.8811,9.48914,0}; dir = 165;}; class Object8 {side = 8; vehicle = "Wire"; rank = ""; position[] = {2.83496,9.76038,0}; dir = 195;}; class Object9 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-4.26538,2.86157,0}; dir = 0;}; class Object10 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {6.27954,-5.33789,0}; dir = 270;}; class Object11 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {5.83838,1.15503,0}; dir = 180;}; class Object12 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {6.88892,-2.38989,0}; dir = 270;}; class Object13 {side = 8; vehicle = "AmmoCrates_NoInteractive_Large"; rank = ""; position[] = {5.88062,0.540649,0}; dir = 270;}; }; class BunkerSmall2_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_BunkerSmall2_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-9.30957,1.4679,0}; dir = 90;}; class Object1 {side = 8; vehicle = "AmmoCrates_NoInteractive_Small"; rank = ""; position[] = {0.0322266,0.255127,0}; dir = 165;}; class Object2 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {-2.10229,-4.85754,0}; dir = 0;}; class Object3 {side = 8; vehicle = "Land_BagBunker_Small_F"; rank = ""; position[] = {-3.125,2.05603,0}; dir = 180;}; class Object4 {side = 8; vehicle = "Land_Pneu"; rank = ""; position[] = {-3.75,-6.5,0}; dir = 0;}; class Object5 {side = 8; vehicle = "Land_GarbageWashingMachine_F"; rank = ""; position[] = {-2.13452,-5.10706,0}; dir = 0;}; class Object6 {side = 8; vehicle = "Land_IronPipes_F"; rank = ""; position[] = {-6.26416,-3.40515,0}; dir = 75;}; class Object8 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-5.8811,6.73914,0}; dir = 165;}; class Object9 {side = 8; vehicle = "Wire"; rank = ""; position[] = {2.09229,7.93506,0}; dir = 180;}; class Object10 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {0.390381,2.1394,0}; dir = 180;}; class Object11 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {4,-7,0}; dir = 255;}; class Object12 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {3.875,-6.125,0}; dir = 300;}; class Object13 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {4.51538,-5.1106,0}; dir = 180;}; class Object14 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {5.76392,-3.38989,0}; dir = 270;}; class Object15 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {5.39453,1.6416,0}; dir = 45;}; class Object16 {side = 8; vehicle = "GunrackTK_EP1"; rank = ""; position[] = {3.39404,-3.95532,0}; dir = 180;}; class Object17 {side = 8; vehicle = "GunrackTK_EP1"; rank = ""; position[] = {4.76904,-3.95532,0}; dir = 180;}; }; class BunkerSmall3_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_BunkerSmall3_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {-1.53516,-0.576294,0}; dir = 285;}; class Object1 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {-2.30444,-1.38318,0}; dir = 240;}; class Object2 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {-2.5105,-0.348267,0}; dir = 105;}; class Object3 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {-3.625,-0.375,0}; dir = 150;}; class Object4 {side = 8; vehicle = "Land_BagBunker_Small_F"; rank = ""; position[] = {0.125,3.93103,0}; dir = 180;}; class Object5 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-6.40454,1.33887,0}; dir = 90;}; class Object6 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {4.15454,-4.71289,0}; dir = 270;}; class Object7 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {-2.67407,-4.34985,0}; dir = 15;}; class Object8 {side = 8; vehicle = "Land_Pallets_F"; rank = ""; position[] = {1.52881,-3.10376,0}; dir = 195;}; class Object9 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {3.26538,2.3894,0}; dir = 180;}; class Object10 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-2.89038,2.36157,0}; dir = 0;}; class Object12 {side = 8; vehicle = "Land_Pallets_stack_F"; rank = ""; position[] = {-1.00098,-3.57141,0}; dir = 29.0276;}; class Object13 {side = 8; vehicle = "Land_CamoNet_EAST"; rank = ""; position[] = {-0.22583,-3.82483,0}; dir = 180;}; class Object14 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-2.15771,9.06006,0}; dir = 180;}; class Object15 {side = 8; vehicle = "Land_Pallet_F"; rank = ""; position[] = {5.625,4.875,0}; dir = 299.332;}; class Object16 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {7.08594,-0.501831,0}; dir = 90;}; class Object17 {side = 8; vehicle = "Wire"; rank = ""; position[] = {5.85352,8.15149,0}; dir = 195;}; }; class BunkerSmall4_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_BunkerSmall4_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "AmmoCrates_NoInteractive_Small"; rank = ""; position[] = {-4.39551,-2.02344,0}; dir = 90;}; class Object1 {side = 8; vehicle = "Land_GarbagePallet_F"; rank = ""; position[] = {-4.91846,-6.6333,0}; dir = 225;}; class Object2 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {-5.00415,-6.70081,0}; dir = 225;}; class Object3 {side = 8; vehicle = "Land_CratesWooden_F"; rank = ""; position[] = {-1,-0.5,0}; dir = 270;}; class Object4 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-5.58838,-2.52905,0}; dir = 0;}; class Object5 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {1.28662,-1.65405,0}; dir = 0;}; class Object6 {side = 8; vehicle = "Land_Pneu"; rank = ""; position[] = {-4.74658,-4.72815,0}; dir = 225;}; class Object7 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {4.39038,-2.2356,0}; dir = 180;}; class Object9 {side = 8; vehicle = "AmmoCrates_NoInteractive_Large"; rank = ""; position[] = {-5.58423,-2.00562,0}; dir = 0;}; class Object10 {side = 8; vehicle = "Land_CamoNet_EAST"; rank = ""; position[] = {2.39917,-3.19946,0}; dir = 180;}; class Object11 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-7.5061,11.2391,0}; dir = 165;}; class Object12 {side = 8; vehicle = "Wire"; rank = ""; position[] = {0.467285,12.4351,0}; dir = 180;}; class Object13 {side = 8; vehicle = "Land_BagBunker_Small_F"; rank = ""; position[] = {0.75,6.43103,0}; dir = 180;}; class Object14 {side = 8; vehicle = "MetalBarrel_burning_F"; rank = ""; position[] = {3.67505,2.5802,0}; dir = 0;}; class Object15 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {4.46338,5.15503,0}; dir = 180;}; class Object16 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-3.40454,6.33887,0}; dir = 90;}; class Object17 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-5.60962,5.0144,0}; dir = 180;}; class Object18 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {-9.21094,2.25281,0}; dir = 270;}; class Object19 {side = 8; vehicle = "Wire"; rank = ""; position[] = {8.33496,11.5101,0}; dir = 195;}; class Object20 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {8.08594,0.498169,0}; dir = 90;}; }; class BunkerSmall5_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_BunkerSmall5_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_CratesWooden_F"; rank = ""; position[] = {2.75,-4,0}; dir = 0;}; class Object1 {side = 8; vehicle = "Land_CratesWooden_F"; rank = ""; position[] = {4.75,-3.375,0}; dir = 90;}; class Object2 {side = 8; vehicle = "Land_BagBunker_Small_F"; rank = ""; position[] = {1.75,1.55603,0}; dir = 180;}; class Object3 {side = 8; vehicle = "AmmoCrates_NoInteractive_Medium"; rank = ""; position[] = {-1.1377,-0.72522,0}; dir = 90;}; class Object4 {side = 8; vehicle = "AmmoCrate_NoInteractive_"; rank = ""; position[] = {-2.01758,-0.652466,0}; dir = 90;}; class Object5 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {2.26538,-2.7356,0}; dir = 180;}; class Object6 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {3.48608,-1.10913,0}; dir = 90;}; class Object7 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-1.10962,0.264404,0}; dir = 180;}; class Object9 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {-3.62744,-5.96033,0}; dir = 180;}; class Object10 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {-6.01611,-0.22998,0}; dir = 315;}; class Object11 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-6.5061,5.48914,0}; dir = 165;}; class Object12 {side = 8; vehicle = "Wire"; rank = ""; position[] = {1.46729,6.68506,0}; dir = 180;}; class Object13 {side = 8; vehicle = "Wire"; rank = ""; position[] = {6.19043,2.4679,0}; dir = 90;}; }; class BunkerSmall6_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_BunkerSmall6_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {4.0376,-1.92834,0}; dir = 0;}; class Object1 {side = 8; vehicle = "Fort_Crate_wood"; rank = ""; position[] = {-6.00122,-1.74805,0}; dir = 0;}; class Object2 {side = 8; vehicle = "Land_BagBunker_Small_F"; rank = ""; position[] = {-0.5,0.80603,0}; dir = 180;}; class Object3 {side = 8; vehicle = "CUP_hromada_beden_dekorativniX"; rank = ""; position[] = {1.5,-6.75,0}; dir = 45;}; class Object4 {side = 8; vehicle = "Barrel2"; rank = ""; position[] = {-6.79321,-2.75781,0}; dir = 240;}; class Object5 {side = 8; vehicle = "Barrel2"; rank = ""; position[] = {-6,-2.75,0}; dir = 0;}; class Object6 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {1.66162,-10.7791,0}; dir = 0;}; class Object7 {side = 8; vehicle = "Land_CamoNetVar_EAST"; rank = ""; position[] = {0.223877,-6.61267,0}; dir = 0;}; class Object8 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-1.10962,-8.8606,0}; dir = 180;}; class Object9 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-2.25854,-2.04028,0}; dir = 90;}; class Object11 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {-4.83594,-6.12219,0}; dir = 270;}; class Object12 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {3.87939,-5.89502,0}; dir = 75;}; class Object13 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {3.16064,-5.98596,0}; dir = 180;}; class Object14 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {3.75,-6.625,0}; dir = 75;}; class Object15 {side = 8; vehicle = "Land_GarbageBags_F"; rank = ""; position[] = {3.70996,-2.64001,0}; dir = 0;}; class Object16 {side = 8; vehicle = "Wire"; rank = ""; position[] = {3.22266,7.50391,0}; dir = 180;}; class Object17 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-4.20679,5.37134,0}; dir = 150;}; class Object18 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {9.03662,-9.27905,0}; dir = 360;}; class Object19 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {5.79907,-3.02417,0}; dir = 195;}; class Object20 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {12.8359,-7.12683,0}; dir = 90;}; }; class BunkerSmall7_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_BunkerSmall7_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_GarbagePallet_F"; rank = ""; position[] = {4.20654,-0.758301,0}; dir = 225;}; class Object1 {side = 8; vehicle = "Land_PaperBox_open_empty_F"; rank = ""; position[] = {-1.50488,-6.38818,0}; dir = 270;}; class Object2 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {4.12085,-0.825806,0}; dir = 225;}; class Object3 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {-6.125,-3.875,0}; dir = 225;}; class Object4 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {-6.125,-4.625,0}; dir = 75;}; class Object5 {side = 8; vehicle = "Land_BagBunker_Small_F"; rank = ""; position[] = {0.125,3.80603,0}; dir = 180;}; class Object6 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {2.91162,-2.27905,0}; dir = 1.70755e-005;}; class Object7 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-2.09546,-1.83789,0}; dir = 270;}; class Object8 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {-7.27441,-6.74951,0}; dir = 90;}; class Object9 {side = 8; vehicle = "Land_Pneu"; rank = ""; position[] = {3.67944,1.90295,0}; dir = 225;}; class Object10 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-5.35962,-2.9856,0}; dir = 180;}; class Object11 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {1.84302,1.22534,0}; dir = 270;}; class Object12 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {4.36108,-4.60913,0}; dir = 90;}; class Object13 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-1.55981,1.1311,0}; dir = 90;}; class Object15 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {1.62256,-8.33533,0}; dir = 180;}; class Object16 {side = 8; vehicle = "AmmoCrates_NoInteractive_Large"; rank = ""; position[] = {-2.88062,-6.29065,0}; dir = 90;}; class Object17 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-0.203613,7.80029,0}; dir = 180;}; class Object18 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-5.83618,4.76819,0}; dir = 300;}; class Object19 {side = 8; vehicle = "Wire"; rank = ""; position[] = {5.8811,4.70276,0}; dir = 240;}; }; class BunkerSmall8_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_BunkerSmall8_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {3.26245,-1.99756,0}; dir = 90;}; class Object1 {side = 8; vehicle = "Land_PaperBox_open_empty_F"; rank = ""; position[] = {1.6897,-1.93579,0}; dir = 180;}; class Object2 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {3.65454,0.412109,0}; dir = 270;}; class Object3 {side = 8; vehicle = "Land_CamoNetVar_EAST"; rank = ""; position[] = {0.223877,0.262329,0}; dir = 0;}; class Object4 {side = 8; vehicle = "FoldTable"; rank = ""; position[] = {-1,0.875,0}; dir = 30;}; class Object5 {side = 8; vehicle = "FoldChair"; rank = ""; position[] = {-1.74561,0.58374,0}; dir = 240;}; class Object6 {side = 8; vehicle = "FoldChair"; rank = ""; position[] = {-1.1814,1.55823,0}; dir = 15;}; class Object7 {side = 8; vehicle = "FoldChair"; rank = ""; position[] = {-0.254395,1.16626,0}; dir = 45;}; class Object8 {side = 8; vehicle = "FoldChair"; rank = ""; position[] = {-1.00439,-0.132813,0}; dir = 315;}; class Object9 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-4.38892,0.515869,0}; dir = 90;}; class Object11 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-6.55957,4.7179,0}; dir = 90;}; class Object12 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-2.53271,8.81006,0}; dir = 180;}; class Object13 {side = 8; vehicle = "Land_Sack_F"; rank = ""; position[] = {-2.74805,3.99524,0}; dir = 195;}; class Object14 {side = 8; vehicle = "Land_BagBunker_Small_F"; rank = ""; position[] = {-0.125,6.18103,0}; dir = 180;}; class Object15 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-3.77954,3.58887,0}; dir = 90;}; class Object16 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {3.08838,4.15503,0}; dir = 180;}; class Object17 {side = 8; vehicle = "Land_Sacks_heap_F"; rank = ""; position[] = {-3.5,3.5,0}; dir = 270;}; }; class BunkerSmall9_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_BunkerSmall9_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-5.05957,1.84241,0}; dir = 90;}; class Object1 {side = 8; vehicle = "Land_Sack_F"; rank = ""; position[] = {-0.499023,-3.00488,0}; dir = 210;}; class Object2 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {-2.88745,-2.62744,0}; dir = 270;}; class Object3 {side = 8; vehicle = "Fort_Crate_wood"; rank = ""; position[] = {-1.37549,-2.6228,0}; dir = 15;}; class Object4 {side = 8; vehicle = "Land_BagBunker_Small_F"; rank = ""; position[] = {-2.25,3.18054,0}; dir = 180;}; class Object5 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-2.96338,-3.27905,0}; dir = 360;}; class Object6 {side = 8; vehicle = "Land_CamoNetVar_EAST"; rank = ""; position[] = {1.09888,-2.23767,0}; dir = 0;}; class Object7 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {0.765381,1.76392,0}; dir = 180;}; class Object8 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-4.13892,0.265381,0}; dir = 90;}; class Object9 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-0.234619,-3.8606,0}; dir = 180;}; class Object11 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-1.40771,5.80957,0}; dir = 180;}; class Object12 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {5.52954,-3.71289,0}; dir = 270;}; class Object13 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {5.64453,1.3916,0}; dir = 45;}; }; class BunkerTower1_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_BunkerTower1_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-1.98889,2.10254,0}; dir = 0;}; class Object1 {side = 8; vehicle = "Fort_Crate_wood"; rank = ""; position[] = {3.62341,1.87341,0}; dir = 255;}; class Object2 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {2.65454,-5.08789,0}; dir = 270;}; class Object3 {side = 8; vehicle = "Barrel3"; rank = ""; position[] = {-1.5647,-1.1897,0}; dir = 270;}; class Object4 {side = 8; vehicle = "Barrel3"; rank = ""; position[] = {-1.75,-2.125,0}; dir = 15;}; class Object5 {side = 8; vehicle = "Barrel3"; rank = ""; position[] = {-2.3147,-1.1897,0}; dir = 210;}; class Object6 {side = 8; vehicle = "Land_CamoNetVar_EAST"; rank = ""; position[] = {0.401245,0.612671,0}; dir = 180;}; class Object7 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-0.859619,-6.1106,0}; dir = 180;}; class Object8 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-6.26392,-0.984131,0}; dir = 90;}; class Object10 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {-5.76953,-5.76563,0}; dir = 225;}; class Object11 {side = 8; vehicle = "GunrackTK_EP1"; rank = ""; position[] = {0.855957,-2.16968,0}; dir = 0;}; class Object12 {side = 8; vehicle = "Land_Pallets_stack_F"; rank = ""; position[] = {-0.5,-2,0}; dir = 194.999;}; class Object13 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {-1,-3.125,0}; dir = 195;}; class Object14 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {-1.75,-3.125,0}; dir = 150;}; class Object15 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-10.3096,5.5929,0}; dir = 90;}; class Object16 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-7.90356,12.5044,0}; dir = 135;}; class Object17 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-1.28259,15.5601,0}; dir = 180;}; class Object18 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {-6.02454,5.12549,0}; dir = 90;}; class Object19 {side = 8; vehicle = "Land_BagBunker_Tower_F"; rank = ""; position[] = {-0.98645,8.22046,0}; dir = 90;}; class Object20 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {6.52454,1.00049,0}; dir = 270;}; class Object21 {side = 8; vehicle = "Land_Pallet_F"; rank = ""; position[] = {9.8877,-1.69385,0}; dir = 250.487;}; class Object22 {side = 8; vehicle = "Land_Pallets_F"; rank = ""; position[] = {6.27124,-1.2572,0}; dir = 120;}; class Object23 {side = 8; vehicle = "Wire"; rank = ""; position[] = {8.93457,6.40808,0}; dir = 270;}; class Object24 {side = 8; vehicle = "Wire"; rank = ""; position[] = {5.87891,13.0291,0}; dir = 225;}; class Object25 {side = 8; vehicle = "Land_CratesWooden_F"; rank = ""; position[] = {5.125,2.625,0}; dir = 270;}; class Object26 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {5.58838,8.03003,0}; dir = 180;}; }; class BunkerTower2_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_BunkerTower2_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_PaperBox_open_empty_F"; rank = ""; position[] = {-5.49988,0.749634,0}; dir = 180;}; class Object1 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {1.53772,-5.92822,0}; dir = 0;}; class Object2 {side = 8; vehicle = "MetalBarrel_burning_F"; rank = ""; position[] = {3,-4.5,0}; dir = 0;}; class Object3 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-7.33838,-5.40405,0}; dir = 360;}; class Object4 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {6.15454,-4.83789,0}; dir = 270;}; class Object5 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {-0.75,-5.89905,0}; dir = 0;}; class Object6 {side = 8; vehicle = "Land_Pallets_F"; rank = ""; position[] = {-6.26245,-6.05066,0}; dir = 124.15;}; class Object7 {side = 8; vehicle = "Land_BagBunker_Tower_F"; rank = ""; position[] = {0.269409,1.14233,0}; dir = 90;}; class Object8 {side = 8; vehicle = "Land_Sacks_heap_F"; rank = ""; position[] = {-4.25,-6.5,0}; dir = 0;}; class Object10 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {-10.8358,-0.622192,0}; dir = 270;}; class Object11 {side = 8; vehicle = "Land_Sacks_goods_F"; rank = ""; position[] = {-2.67212,-6.55359,0}; dir = 0;}; class Object12 {side = 8; vehicle = "Land_GarbageBags_F"; rank = ""; position[] = {1.21021,-6.63989,0}; dir = 0;}; class Object13 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-0.754272,8.89111,0}; dir = 180;}; class Object14 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-8.72778,7.69519,0}; dir = 165;}; class Object15 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {-5.48755,2.50244,0}; dir = 90;}; class Object16 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {9.31177,-0.44043,0}; dir = 270;}; class Object17 {side = 8; vehicle = "Land_CamoNetVar_EAST"; rank = ""; position[] = {8.36267,-0.901245,0}; dir = 270;}; class Object18 {side = 8; vehicle = "Wire"; rank = ""; position[] = {7.1134,7.96643,0}; dir = 195;}; class Object19 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {8.71338,3.40503,0}; dir = 180;}; }; class BunkerTower3_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_BunkerTower3_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {2.47705,-0.0106201,0}; dir = 90;}; class Object1 {side = 8; vehicle = "Land_Sack_F"; rank = ""; position[] = {-1.37878,-0.128174,0}; dir = 270;}; class Object2 {side = 8; vehicle = "Land_GarbagePallet_F"; rank = ""; position[] = {4.41675,-4.11035,0}; dir = 285;}; class Object3 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {4.31543,-4.06995,0}; dir = 285;}; class Object4 {side = 8; vehicle = "Fort_Crate_wood"; rank = ""; position[] = {-3.49939,-0.377197,0}; dir = 195;}; class Object5 {side = 8; vehicle = "Fort_Crate_wood"; rank = ""; position[] = {-2.2489,-0.626953,0}; dir = 180;}; class Object6 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {2.02954,-4.33789,0}; dir = 270;}; class Object7 {side = 8; vehicle = "Hedgehog"; rank = ""; position[] = {4.41162,-0.65625,0}; dir = 30;}; class Object8 {side = 8; vehicle = "Hedgehog"; rank = ""; position[] = {4.37109,-2.00378,0}; dir = 255;}; class Object9 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {-7.27454,-1.12451,0}; dir = 90;}; class Object10 {side = 8; vehicle = "Land_BagBunker_Tower_F"; rank = ""; position[] = {0.0194092,3.26733,0}; dir = 90;}; class Object11 {side = 8; vehicle = "Land_CamoNetVar_EAST"; rank = ""; position[] = {-2.34875,-3.01233,0}; dir = 180;}; class Object12 {side = 8; vehicle = "Misc_cargo_cont_net1"; rank = ""; position[] = {-5.2489,-3.49927,0}; dir = 0;}; class Object13 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-1.48462,-5.3606,0}; dir = 180;}; class Object15 {side = 8; vehicle = "Land_BarrelWater_F"; rank = ""; position[] = {-4.00012,-3.99988,0}; dir = 359.981;}; class Object16 {side = 8; vehicle = "GunrackTK_EP1"; rank = ""; position[] = {-4.64404,-0.419678,0}; dir = 0;}; class Object17 {side = 8; vehicle = "Land_BarrelTrash_F"; rank = ""; position[] = {-4.00012,-3.12488,0}; dir = 359.981;}; class Object18 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-1.89038,10.2366,0}; dir = 0;}; class Object19 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-7.38892,4.89087,0}; dir = 90;}; class Object20 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {-6.89111,9.89502,0}; dir = 315;}; class Object21 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {3.01953,9.7666,0}; dir = 45;}; class Object22 {side = 8; vehicle = "Land_Pneu"; rank = ""; position[] = {6.15283,-3.30676,0}; dir = 285;}; }; class BunkerTower4_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_BunkerTower4_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {2.63489,-9.83447,0}; dir = 180;}; class Object1 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-7.50195,-2.49353,0}; dir = 90;}; class Object2 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {3.37305,-3.61853,0}; dir = 90;}; class Object3 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {2.38745,-11.4976,0}; dir = 90;}; class Object4 {side = 8; vehicle = "Fort_Crate_wood"; rank = ""; position[] = {-2.0022,-5.75061,0}; dir = 285;}; class Object5 {side = 8; vehicle = "Barrel2"; rank = ""; position[] = {-2.54321,-6.75781,0}; dir = 240;}; class Object6 {side = 8; vehicle = "Barrel2"; rank = ""; position[] = {-1.75,-6.75,0}; dir = 0;}; class Object7 {side = 8; vehicle = "Land_Pallet_F"; rank = ""; position[] = {-0.75,-13.375,0}; dir = 29.332;}; class Object8 {side = 8; vehicle = "Land_Pallets_F"; rank = ""; position[] = {4.24744,-4.34607,0}; dir = 90;}; class Object9 {side = 8; vehicle = "Land_HBarrier_1_F"; rank = ""; position[] = {-6.98096,-7.85022,0}; dir = 165;}; class Object10 {side = 8; vehicle = "Land_HBarrier_1_F"; rank = ""; position[] = {-0.729004,-6.22498,0}; dir = 180;}; class Object11 {side = 8; vehicle = "Land_HBarrier_1_F"; rank = ""; position[] = {-3.86121,-10.8555,0}; dir = 105;}; class Object12 {side = 8; vehicle = "Land_HBarrier_1_F"; rank = ""; position[] = {-4.84875,-10.2377,0}; dir = 315;}; class Object13 {side = 8; vehicle = "Land_BagBunker_Tower_F"; rank = ""; position[] = {0.894409,-0.357666,0}; dir = 90;}; class Object14 {side = 8; vehicle = "Land_BarrelWater_grey_F"; rank = ""; position[] = {3.49988,-10.9999,0}; dir = 359.981;}; class Object15 {side = 8; vehicle = "Land_BarrelTrash_grey_F"; rank = ""; position[] = {-3.12512,-6.12488,0}; dir = 359.981;}; class Object16 {side = 8; vehicle = "Land_Pallets_stack_F"; rank = ""; position[] = {0.625,-11.375,0}; dir = 179.999;}; class Object17 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-5.65515,6.93604,0}; dir = 180;}; class Object18 {side = 8; vehicle = "Wire"; rank = ""; position[] = {2.35608,6.02747,0}; dir = 195;}; class Object19 {side = 8; vehicle = "Land_Pallet_F"; rank = ""; position[] = {-8.83228,0.531738,0}; dir = 224.332;}; class Object20 {side = 8; vehicle = "Land_HBarrier_1_F"; rank = ""; position[] = {-6.47253,0.396362,0}; dir = 240;}; class Object22 {side = 8; vehicle = "Wire"; rank = ""; position[] = {9.71619,3.09827,0}; dir = 210;}; }; class BunkerTower5_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_BunkerTower5_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {4.01245,-6.74756,0}; dir = 90;}; class Object1 {side = 8; vehicle = "MetalBarrel_burning_F"; rank = ""; position[] = {-2.75,-2.875,0}; dir = 0;}; class Object2 {side = 8; vehicle = "Land_BagBunker_Tower_F"; rank = ""; position[] = {1.64441,0.892334,0}; dir = 90;}; class Object3 {side = 8; vehicle = "Land_Pallet_vertical_F"; rank = ""; position[] = {2.12622,-7.3811,0}; dir = 179.996;}; class Object4 {side = 8; vehicle = "Land_CamoNetVar_EAST"; rank = ""; position[] = {1.02625,-5.51233,0}; dir = 180;}; class Object5 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-4.53491,0.515869,0}; dir = 360;}; class Object6 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-5.76392,-6.23413,0}; dir = 90;}; class Object8 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {-8.21082,-2.24719,0}; dir = 270;}; class Object9 {side = 8; vehicle = "Land_Ammobox_rounds_F"; rank = ""; position[] = {-2.63916,-6.38855,0}; dir = 284.98;}; class Object10 {side = 8; vehicle = "Land_Ammobox_rounds_F"; rank = ""; position[] = {-3.03333,-6.36462,0}; dir = 134.998;}; class Object11 {side = 8; vehicle = "CUP_ammobednaX"; rank = ""; position[] = {-2.125,-6.875,0}; dir = 165;}; class Object12 {side = 8; vehicle = "Barrel5"; rank = ""; position[] = {-1.49121,-3.42651,0}; dir = 30;}; class Object13 {side = 8; vehicle = "Barrel5"; rank = ""; position[] = {-1,-2.75,0}; dir = 210;}; class Object14 {side = 8; vehicle = "Barrel5"; rank = ""; position[] = {-1.74121,-2.67651,0}; dir = 270;}; class Object15 {side = 8; vehicle = "Land_Pallets_stack_F"; rank = ""; position[] = {0.125,-6.5,0}; dir = 14.9988;}; class Object16 {side = 8; vehicle = "Land_Pallets_stack_F"; rank = ""; position[] = {2.125,-6.375,0}; dir = 180;}; class Object17 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {4.39038,6.3894,0}; dir = 180;}; class Object18 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {9.73608,0.890869,0}; dir = 90;}; class Object19 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {9.26611,-4.01904,0}; dir = 135;}; class Object20 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {9.39453,5.8916,0}; dir = 45;}; }; class BunkerTower6_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_BunkerTower6_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-8.42896,-4.35315,0}; dir = 45;}; class Object1 {side = 8; vehicle = "Barrels"; rank = ""; position[] = {-1.375,-6.5,0}; dir = 105;}; class Object2 {side = 8; vehicle = "Barrels"; rank = ""; position[] = {-3.125,-6.75,0}; dir = 270;}; class Object3 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {-0.375,-8.52405,0}; dir = 0;}; class Object4 {side = 8; vehicle = "Land_HBarrier_1_F"; rank = ""; position[] = {-8.74805,-0.74231,0}; dir = 195;}; class Object5 {side = 8; vehicle = "Land_BagBunker_Tower_F"; rank = ""; position[] = {-0.605591,0.142334,0}; dir = 90;}; class Object6 {side = 8; vehicle = "Land_CamoNetVar_EAST"; rank = ""; position[] = {-1.72375,-5.88733,0}; dir = 180;}; class Object8 {side = 8; vehicle = "Misc_concrete_High"; rank = ""; position[] = {1.25,-6.5,0}; dir = 270;}; class Object9 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-9.1311,2.86414,0}; dir = 165;}; class Object10 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-1.15759,4.06006,0}; dir = 180;}; class Object11 {side = 8; vehicle = "Land_HBarrier_1_F"; rank = ""; position[] = {-5.8822,1.62354,0}; dir = 75;}; class Object12 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {5.60364,-5.92847,0}; dir = 315;}; class Object13 {side = 8; vehicle = "Land_HBarrier_1_F"; rank = ""; position[] = {8.50195,-1.13171,0}; dir = 345;}; class Object14 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {4.26111,0.977539,0}; dir = 1.36604e-005;}; class Object15 {side = 8; vehicle = "Wire"; rank = ""; position[] = {6.71008,3.13538,0}; dir = 195;}; }; class BunkerTower7_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_BunkerTower7_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Barrels"; rank = ""; position[] = {-1.5,-0.875,0}; dir = 60;}; class Object1 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-6.33838,-3.65405,0}; dir = 360;}; class Object2 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {0.029541,-5.96289,0}; dir = 270;}; class Object3 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-6.77954,0.0888672,0}; dir = 90;}; class Object4 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-3.71338,-6.52905,0}; dir = 0;}; class Object5 {side = 8; vehicle = "Land_Pallet_F"; rank = ""; position[] = {3.25,-6.25,0}; dir = 224.332;}; class Object6 {side = 8; vehicle = "Land_BagBunker_Tower_F"; rank = ""; position[] = {0.0194092,3.14233,0}; dir = 90;}; class Object8 {side = 8; vehicle = "Land_BarrelWater_F"; rank = ""; position[] = {4.87488,-2.87488,0}; dir = 359.981;}; class Object9 {side = 8; vehicle = "Land_WaterBarrel_F"; rank = ""; position[] = {-3.005,-0.750732,0}; dir = 359.897;}; class Object10 {side = 8; vehicle = "Land_CamoNet_EAST"; rank = ""; position[] = {-0.10083,-6.07446,0}; dir = 180;}; class Object11 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-2.65454,7.71387,0}; dir = 90;}; class Object12 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {2.00232,11.2113,0}; dir = 360;}; class Object13 {side = 8; vehicle = "CUP_ammobednaX"; rank = ""; position[] = {2.375,6.625,0}; dir = 0;}; class Object14 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {7.02954,-0.962891,0}; dir = 270;}; class Object15 {side = 8; vehicle = "Land_Pallets_F"; rank = ""; position[] = {8.02124,-3.7572,0}; dir = 120;}; class Object16 {side = 8; vehicle = "Land_CratesPlastic_F"; rank = ""; position[] = {5.7489,-3.12085,0}; dir = 225;}; class Object17 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {6.33838,8.53003,0}; dir = 180;}; }; class BunkerTower8_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_BunkerTower8_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-5.68457,0.967896,0}; dir = 90;}; class Object1 {side = 8; vehicle = "Land_CratesShabby_F"; rank = ""; position[] = {-3.43823,-2.05688,0}; dir = 180;}; class Object2 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {2.62585,-2.3623,0}; dir = 15;}; class Object3 {side = 8; vehicle = "Land_CratesWooden_F"; rank = ""; position[] = {-1.875,-2.25,0}; dir = 0;}; class Object4 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-3.33838,-6.52905,0}; dir = 0;}; class Object5 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {4.02954,-6.08789,0}; dir = 270;}; class Object6 {side = 8; vehicle = "Land_BagBunker_Tower_F"; rank = ""; position[] = {-0.230591,1.51733,0}; dir = 90;}; class Object7 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-4.51392,-3.10913,0}; dir = 90;}; class Object9 {side = 8; vehicle = "GunrackTK_EP1"; rank = ""; position[] = {-2.16968,-3.48096,0}; dir = 90;}; class Object10 {side = 8; vehicle = "Land_CampingChair_V2_F"; rank = ""; position[] = {4.81445,-0.896484,0}; dir = 14.9797;}; class Object11 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-0.407593,5.18506,0}; dir = 180;}; class Object12 {side = 8; vehicle = "Land_CamoNetVar_EAST"; rank = ""; position[] = {8.11267,-0.651245,0}; dir = 270;}; class Object13 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {5.89038,-4.3606,0}; dir = 180;}; class Object14 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {9.58582,-1.62683,0}; dir = 90;}; class Object15 {side = 8; vehicle = "Land_CampingChair_V2_F"; rank = ""; position[] = {5.43311,-0.100952,0}; dir = 195.001;}; class Object16 {side = 8; vehicle = "Land_CampingChair_V2_F"; rank = ""; position[] = {6.93555,-1.60352,0}; dir = 90.0115;}; class Object17 {side = 8; vehicle = "Land_CampingChair_V2_F"; rank = ""; position[] = {5.96338,-2.04553,0}; dir = 135.011;}; class Object18 {side = 8; vehicle = "Land_WoodenTable_large_F"; rank = ""; position[] = {5.875,-1.25,0}; dir = 44.6909;}; class Object19 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {5.96338,3.03003,0}; dir = 180;}; }; class BunkerTower9_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_BunkerTower9_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Wire"; rank = ""; position[] = {3.05957,2.90759,0}; dir = 270;}; class Object1 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-7.55957,1.96741,0}; dir = 90;}; class Object2 {side = 8; vehicle = "Land_Sack_F"; rank = ""; position[] = {-3.62976,-3.50195,0}; dir = 285;}; class Object3 {side = 8; vehicle = "Land_PaperBox_open_empty_F"; rank = ""; position[] = {-3.24988,-1.50037,0}; dir = 180;}; class Object4 {side = 8; vehicle = "Land_PaperBox_open_empty_F"; rank = ""; position[] = {-4.87463,-1.5,0}; dir = 105;}; class Object5 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {1.15454,-4.71289,0}; dir = 270;}; class Object6 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-8.52954,-4.03613,0}; dir = 90;}; class Object7 {side = 8; vehicle = "Land_Sack_EP1"; rank = ""; position[] = {-4.24902,-3.61963,0}; dir = 75;}; class Object8 {side = 8; vehicle = "Land_BagBunker_Tower_F"; rank = ""; position[] = {-2.35559,2.51685,0}; dir = 90;}; class Object9 {side = 8; vehicle = "Land_Sacks_heap_F"; rank = ""; position[] = {-5.0647,-2.9397,0}; dir = 270;}; class Object10 {side = 8; vehicle = "Land_Sacks_heap_F"; rank = ""; position[] = {-4.125,-2.75,0}; dir = 0;}; class Object11 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-6.26392,-1.73462,0}; dir = 90;}; class Object12 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {1.76392,-1.76538,0}; dir = 270;}; class Object14 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-2.28259,6.18457,0}; dir = 180;}; class Object15 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {3.41272,-5.42822,0}; dir = 0;}; class Object16 {side = 8; vehicle = "Land_GarbageBags_F"; rank = ""; position[] = {3.08521,-6.13989,0}; dir = 0;}; }; class CargoPost1_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_CargoPost1_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "MetalBarrel_burning_F"; rank = ""; position[] = {1.25,-1.5,0}; dir = 0;}; class Object1 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {-8.27454,0.750488,0}; dir = 90;}; class Object2 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {-3.25,-3.02405,0}; dir = 0;}; class Object3 {side = 8; vehicle = "Land_Pallets_F"; rank = ""; position[] = {1.02124,-6.3822,0}; dir = 120;}; class Object5 {side = 8; vehicle = "Land_Pallets_stack_F"; rank = ""; position[] = {-4.5,-0.375,0}; dir = 194.999;}; class Object6 {side = 8; vehicle = "Land_Cargo_Patrol_V1_F"; rank = ""; position[] = {-2.87219,2.12231,0}; dir = 180;}; class Object7 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {2.125,6.02502,0}; dir = 180;}; class Object8 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {-5.37268,8.4613,0}; dir = 0;}; class Object9 {side = 8; vehicle = "GunrackTK_EP1"; rank = ""; position[] = {2.14404,5.41968,0}; dir = 180;}; class Object10 {side = 8; vehicle = "Land_Pallets_stack_F"; rank = ""; position[] = {-5.25,2.125,0}; dir = 89.9999;}; class Object11 {side = 8; vehicle = "Hhedgehog_concrete"; rank = ""; position[] = {-4.12292,15.625,0}; dir = 180;}; class Object12 {side = 8; vehicle = "Land_GarbagePallet_F"; rank = ""; position[] = {4.16492,-5.80273,0}; dir = 330;}; class Object13 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {4.12183,-5.70251,0}; dir = 330;}; class Object14 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {6.65454,-1.96289,0}; dir = 270;}; class Object15 {side = 8; vehicle = "Land_Pneu"; rank = ""; position[] = {5.96069,-6.46191,0}; dir = 330;}; class Object16 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {3.10962,-3.13843,0}; dir = 0;}; class Object17 {side = 8; vehicle = "Land_CratesShabby_F"; rank = ""; position[] = {4.75146,4.00769,0}; dir = 180;}; class Object18 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {5.13745,5.37744,0}; dir = 90;}; class Object19 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {8.71338,5.40503,0}; dir = 180;}; class Object20 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {9.88892,1.86011,0}; dir = 270;}; class Object21 {side = 8; vehicle = "Hhedgehog_concrete"; rank = ""; position[] = {5.00208,15.625,0}; dir = 180;}; }; class CargoPost2_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_CargoPost2_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_CratesShabby_F"; rank = ""; position[] = {-3.18823,-7.68188,0}; dir = 180;}; class Object1 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {-4.21228,-1.55322,0}; dir = 0;}; class Object2 {side = 8; vehicle = "Land_CratesWooden_F"; rank = ""; position[] = {-1.625,-7.875,0}; dir = 0;}; class Object3 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {-2.10571,-2.19312,0}; dir = 285;}; class Object4 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {-2.875,-3,0}; dir = 240;}; class Object5 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-5.33838,-8.40405,0}; dir = 0;}; class Object6 {side = 8; vehicle = "Land_Pallets_F"; rank = ""; position[] = {-3.85376,-10.1322,0}; dir = 120;}; class Object7 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-2.26538,-9.01343,0}; dir = 0;}; class Object8 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-6.51392,-2.60913,0}; dir = 90;}; class Object10 {side = 8; vehicle = "Land_GarbageBags_F"; rank = ""; position[] = {-4.53979,-2.26489,0}; dir = 0;}; class Object11 {side = 8; vehicle = "Land_Cargo_Patrol_V1_F"; rank = ""; position[] = {-1.74719,1.12231,0}; dir = 180;}; class Object12 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-2.01111,1.39844,0}; dir = 180;}; class Object13 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {1.23889,1.39844,0}; dir = 180;}; class Object14 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-5.90454,0.463867,0}; dir = 90;}; class Object15 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {2.73462,4.98657,0}; dir = 0;}; class Object16 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-4.01392,3.51587,0}; dir = 90;}; class Object17 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {-1.24768,7.3363,0}; dir = 0;}; class Object18 {side = 8; vehicle = "Hhedgehog_concrete"; rank = ""; position[] = {3.50208,12.625,0}; dir = 180;}; class Object19 {side = 8; vehicle = "Hhedgehog_concrete"; rank = ""; position[] = {-5.62292,12.625,0}; dir = 180;}; class Object20 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {4.77954,-8.83789,0}; dir = 270;}; class Object21 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {5.14954,-2.49951,0}; dir = 270;}; class Object22 {side = 8; vehicle = "Land_CamoNet_EAST"; rank = ""; position[] = {4.82336,-1.72717,0}; dir = 90;}; class Object23 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {4.21338,4.40503,0}; dir = 180;}; }; class CargoPost3_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_CargoPost3_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_CratesWooden_F"; rank = ""; position[] = {-3.75,1,0}; dir = 90;}; class Object1 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-4.96338,-1.40405,0}; dir = 0;}; class Object2 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {1.65454,-0.962891,0}; dir = 270;}; class Object3 {side = 8; vehicle = "Land_Pallet_F"; rank = ""; position[] = {-3.75,-4,0}; dir = 314.332;}; class Object4 {side = 8; vehicle = "Land_Sacks_heap_F"; rank = ""; position[] = {-6.375,-3.25,0}; dir = 300;}; class Object5 {side = 8; vehicle = "Land_Sacks_heap_F"; rank = ""; position[] = {-7.125,-2.625,0}; dir = 75;}; class Object6 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-6.01392,1.01587,0}; dir = 90;}; class Object7 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-2.01538,-2.01343,0}; dir = 0;}; class Object8 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {2.23608,1.64087,0}; dir = 90;}; class Object9 {side = 8; vehicle = "Land_Cargo_Patrol_V2_F"; rank = ""; position[] = {-1.99719,3.24731,0}; dir = 180;}; class Object11 {side = 8; vehicle = "Land_BarrelWater_grey_F"; rank = ""; position[] = {-5.00012,-2.99988,0}; dir = 359.981;}; class Object12 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {-2,6.40002,0}; dir = 180;}; class Object13 {side = 8; vehicle = "Land_Sacks_heap_F"; rank = ""; position[] = {0.375,4.625,0}; dir = 240;}; class Object14 {side = 8; vehicle = "Hhedgehog_concrete"; rank = ""; position[] = {-6.49792,11.25,0}; dir = 180;}; class Object15 {side = 8; vehicle = "Hhedgehog_concrete"; rank = ""; position[] = {2.62708,11.25,0}; dir = 180;}; }; class CargoPost4_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_CargoPost4_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-9.68457,-2.9071,0}; dir = 90;}; class Object1 {side = 8; vehicle = "Land_PaperBox_open_empty_F"; rank = ""; position[] = {-2.87537,-3,0}; dir = 285;}; class Object2 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {-2.75,-5,0}; dir = 180;}; class Object3 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {-2.875,-1.625,0}; dir = 180;}; class Object4 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {-2.875,-4.25,0}; dir = 105;}; class Object5 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-4.46338,-9.40405,0}; dir = 0;}; class Object6 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {-5.52454,-2.24951,0}; dir = 90;}; class Object7 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-1.35962,-9.9856,0}; dir = 180;}; class Object8 {side = 8; vehicle = "Land_Misc_IronPipes_EP1"; rank = ""; position[] = {1.53015,-12.8892,0}; dir = 345;}; class Object9 {side = 8; vehicle = "Land_Cargo_Patrol_V1_F"; rank = ""; position[] = {-1.12219,-0.377686,0}; dir = 180;}; class Object10 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-7.02856,3.87939,0}; dir = 135;}; class Object11 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-0.282593,6.81006,0}; dir = 180;}; class Object12 {side = 8; vehicle = "Land_CratesShabby_F"; rank = ""; position[] = {-2.24854,0.88269,0}; dir = 180;}; class Object13 {side = 8; vehicle = "Land_CratesWooden_F"; rank = ""; position[] = {0.125,0.5,0}; dir = 0;}; class Object14 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {-0.25,2.02502,0}; dir = 180;}; class Object15 {side = 8; vehicle = "Land_PaperBox_open_full_F"; rank = ""; position[] = {-3.50012,-0.384155,0}; dir = 2.04906e-005;}; class Object17 {side = 8; vehicle = "Land_Sacks_heap_F"; rank = ""; position[] = {5.75,-8.75,0}; dir = 300;}; class Object18 {side = 8; vehicle = "Land_Sacks_heap_F"; rank = ""; position[] = {5.57593,-7.53052,0}; dir = 345;}; class Object19 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {6.86108,-8.10913,0}; dir = 90;}; class Object20 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {9.33582,-4.12683,0}; dir = 90;}; class Object21 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {5.71338,0.530029,0}; dir = 180;}; }; class CargoPost5_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_CargoPost5_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {-2.98755,-5.62256,0}; dir = 90;}; class Object1 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {0.154541,-13.4629,0}; dir = 270;}; class Object2 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {-4.39954,-1.37451,0}; dir = 90;}; class Object3 {side = 8; vehicle = "Barrel3"; rank = ""; position[] = {4.9353,-4.0647,0}; dir = 270;}; class Object4 {side = 8; vehicle = "Barrel3"; rank = ""; position[] = {4.1853,-4.0647,0}; dir = 210;}; class Object5 {side = 8; vehicle = "Barrel3"; rank = ""; position[] = {4.75,-5,0}; dir = 15;}; class Object6 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-3.51538,-14.6384,0}; dir = 0;}; class Object7 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-4.73608,-7.88989,0}; dir = 270;}; class Object8 {side = 8; vehicle = "Land_Cargo_Patrol_V2_F"; rank = ""; position[] = {0.377808,0.122314,0}; dir = 180;}; class Object9 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {-7.21082,-11.8722,0}; dir = 270;}; class Object10 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {-1.15649,-1.35205,0}; dir = 150;}; class Object11 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {-1.10181,-2.57971,0}; dir = 150;}; class Object12 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {-1.96655,-1.84021,0}; dir = 165;}; class Object13 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {-0.334473,-2.29382,0}; dir = 315;}; class Object14 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-3.78259,6.18506,0}; dir = 180;}; class Object15 {side = 8; vehicle = "Wire"; rank = ""; position[] = {3.96741,6.06006,0}; dir = 180;}; class Object16 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-8.50989,1.96057,0}; dir = 105;}; class Object17 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {0.75,2.52502,0}; dir = 180;}; class Object19 {side = 8; vehicle = "Land_Pallets_stack_F"; rank = ""; position[] = {-0.875,1.125,0}; dir = 89.9994;}; class Object20 {side = 8; vehicle = "Land_Pallets_stack_F"; rank = ""; position[] = {-2.625,0,0}; dir = 164.999;}; class Object21 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {7.77954,-8.33789,0}; dir = 270;}; class Object22 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {6.85034,-2.07556,0}; dir = 255;}; class Object23 {side = 8; vehicle = "Land_Pallet_F"; rank = ""; position[] = {10.5,-8,0}; dir = 224.332;}; class Object24 {side = 8; vehicle = "Land_Pallets_F"; rank = ""; position[] = {4.83447,-7.48999,0}; dir = 75;}; class Object25 {side = 8; vehicle = "Wire"; rank = ""; position[] = {9.36365,2.50659,0}; dir = 255;}; }; class CargoPost6_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_CargoPost6_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-10.4886,-6.88062,0}; dir = 75;}; class Object1 {side = 8; vehicle = "Barrels"; rank = ""; position[] = {-4.5,-2.25,0}; dir = 345;}; class Object2 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-6.33838,-9.15405,0}; dir = 0;}; class Object3 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {-7.39954,-2.12451,0}; dir = 90;}; class Object4 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {2.98608,-2.23413,0}; dir = 90;}; class Object5 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-3.23462,-9.7356,0}; dir = 180;}; class Object6 {side = 8; vehicle = "GunrackTK_EP1"; rank = ""; position[] = {-4.51904,-3.91968,0}; dir = 0;}; class Object7 {side = 8; vehicle = "Land_Cargo_Patrol_V1_F"; rank = ""; position[] = {-2.62219,0.122314,0}; dir = 180;}; class Object8 {side = 8; vehicle = "Wire"; rank = ""; position[] = {1.58508,5.76038,0}; dir = 195;}; class Object9 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-10.6349,0.710571,0}; dir = 105;}; class Object10 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-6.0061,5.61414,0}; dir = 165;}; class Object11 {side = 8; vehicle = "Barrels"; rank = ""; position[] = {-4.5,0.125,0}; dir = 30;}; class Object12 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {-2.25,2.40002,0}; dir = 180;}; class Object13 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {2.98608,0.765869,0}; dir = 90;}; class Object15 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {5.46082,-6.25183,0}; dir = 90;}; class Object16 {side = 8; vehicle = "Land_GarbagePallet_F"; rank = ""; position[] = {5.05029,-0.670654,0}; dir = 285;}; class Object17 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {4.94897,-0.630249,0}; dir = 285;}; class Object18 {side = 8; vehicle = "Land_Pneu"; rank = ""; position[] = {6.5,1.5,0}; dir = 0;}; }; class CargoPost7_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_CargoPost7_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {-4.75244,-2.36255,0}; dir = 0;}; class Object1 {side = 8; vehicle = "Land_PaperBox_open_empty_F"; rank = ""; position[] = {-4.81409,-3.93518,0}; dir = 90;}; class Object2 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-4.96338,-5.77905,0}; dir = 360;}; class Object3 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {-5.89954,1.25049,0}; dir = 90;}; class Object4 {side = 8; vehicle = "Land_Pneu"; rank = ""; position[] = {-2.625,0.5,0}; dir = 285;}; class Object5 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {3.61108,-6.23413,0}; dir = 90;}; class Object6 {side = 8; vehicle = "Land_Cargo_Patrol_V2_F"; rank = ""; position[] = {-1.99719,3.12231,0}; dir = 180;}; class Object8 {side = 8; vehicle = "Land_Pallets_stack_F"; rank = ""; position[] = {-3,-1.625,0}; dir = 104.999;}; class Object9 {side = 8; vehicle = "Land_WaterBarrel_F"; rank = ""; position[] = {-4.375,0.625,0}; dir = 359.991;}; class Object10 {side = 8; vehicle = "Land_Sack_F"; rank = ""; position[] = {3.49524,3.99805,0}; dir = 285;}; class Object11 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {-3.75244,3.46606,0}; dir = 285;}; class Object12 {side = 8; vehicle = "Land_Sack_EP1"; rank = ""; position[] = {2.87598,3.88037,0}; dir = 75;}; class Object13 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {-1.125,5.90002,0}; dir = 180;}; class Object14 {side = 8; vehicle = "Land_GarbageWashingMachine_F"; rank = ""; position[] = {-3.51978,3.37061,0}; dir = 285;}; class Object15 {side = 8; vehicle = "Land_Sacks_heap_F"; rank = ""; position[] = {3,4.75,0}; dir = 0;}; class Object16 {side = 8; vehicle = "Land_Sacks_heap_F"; rank = ""; position[] = {2.0603,4.5603,0}; dir = 270;}; class Object17 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {6.02954,-3.96289,0}; dir = 270;}; class Object18 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {6.63892,1.86011,0}; dir = 270;}; class Object19 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {6.63892,-0.889893,0}; dir = 270;}; class Object20 {side = 8; vehicle = "Land_CamoNet_EAST"; rank = ""; position[] = {5.57446,0.39917,0}; dir = 90;}; class Object21 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {5.46338,5.40503,0}; dir = 180;}; }; class CargoPost8_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_CargoPost8_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {-3.86255,-4.87256,0}; dir = 90;}; class Object1 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {-3.6123,-0.875854,0}; dir = 105;}; class Object2 {side = 8; vehicle = "Land_PaperBox_open_empty_F"; rank = ""; position[] = {-3.87463,-3.24988,0}; dir = 90;}; class Object3 {side = 8; vehicle = "Land_CratesWooden_F"; rank = ""; position[] = {2.625,-4.125,0}; dir = 330;}; class Object4 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-4.46338,-6.65405,0}; dir = 0;}; class Object5 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {2.12488,-3,0}; dir = 344.994;}; class Object6 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {1.49329,-2.28479,0}; dir = 150.01;}; class Object7 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {1.36719,-3.43738,0}; dir = 74.9976;}; class Object8 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {2.99097,-2.49988,0}; dir = 104.991;}; class Object9 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-1.39038,-7.26343,0}; dir = 0;}; class Object10 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-5.51392,-0.109131,0}; dir = 90;}; class Object11 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-5.51392,-2.98413,0}; dir = 90;}; class Object12 {side = 8; vehicle = "CUP_A2_barels3"; rank = ""; position[] = {-2.64001,-8.38147,0}; dir = 195;}; class Object13 {side = 8; vehicle = "CUP_A2_barels3"; rank = ""; position[] = {-5.70349,-8.82678,0}; dir = 75;}; class Object15 {side = 8; vehicle = "Land_Cargo_Patrol_V1_F"; rank = ""; position[] = {-2.24719,1.49731,0}; dir = 180;}; class Object16 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-4.90454,2.83887,0}; dir = 90;}; class Object17 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {1.48462,3.86157,0}; dir = 0;}; class Object18 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-1.51538,3.86157,0}; dir = 0;}; class Object19 {side = 8; vehicle = "Misc_concrete_High"; rank = ""; position[] = {-3.375,2.25,0}; dir = 90;}; class Object20 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {5.65454,-5.96289,0}; dir = 270;}; class Object21 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {8.21082,-1.37683,0}; dir = 90;}; class Object22 {side = 8; vehicle = "Land_CamoNet_EAST"; rank = ""; position[] = {5.57446,-1.47583,0}; dir = 90;}; class Object23 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {4.58838,3.28003,0}; dir = 180;}; }; class CargoPost9_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_CargoPost9_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {-5.98853,-1.74438,0}; dir = 75;}; class Object1 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {-5.98792,0.495972,0}; dir = 120;}; class Object2 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-13.04,-5.63306,0}; dir = 0;}; class Object3 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-6.58838,-2.52905,0}; dir = 0;}; class Object4 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {-5,-6.02405,0}; dir = 0;}; class Object5 {side = 8; vehicle = "AmmoCrates_NoInteractive_Medium"; rank = ""; position[] = {-4.2627,-4.47522,0}; dir = 90;}; class Object6 {side = 8; vehicle = "AmmoCrate_NoInteractive_"; rank = ""; position[] = {-5.14258,-4.40247,0}; dir = 90;}; class Object7 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-14.2156,0.786865,0}; dir = 90;}; class Object8 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-14.2156,-2.08813,0}; dir = 90;}; class Object9 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-7.61108,-0.0148926,0}; dir = 270;}; class Object11 {side = 8; vehicle = "Land_WaterBarrel_F"; rank = ""; position[] = {-2.75,-4.25,0}; dir = 359.991;}; class Object12 {side = 8; vehicle = "Land_Cargo_Patrol_V1_F"; rank = ""; position[] = {-4.24719,1.87134,0}; dir = 180;}; class Object13 {side = 8; vehicle = "Land_CamoNet_EAST"; rank = ""; position[] = {-11.5745,0.35083,0}; dir = 270;}; class Object14 {side = 8; vehicle = "Land_PaperBox_open_empty_F"; rank = ""; position[] = {-5.99988,2.37463,0}; dir = 180;}; class Object15 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {0.0377197,3.69678,0}; dir = 0;}; class Object16 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-13.6062,3.85986,0}; dir = 90;}; class Object17 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {-4.25,5.02502,0}; dir = 180;}; class Object18 {side = 8; vehicle = "Land_PaperBox_open_full_F"; rank = ""; position[] = {-5.99988,4.25916,0}; dir = 180;}; class Object19 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-7.61108,2.86011,0}; dir = 270;}; class Object20 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-10.7346,5.0144,0}; dir = 180;}; class Object21 {side = 8; vehicle = "Land_GarbageBags_F"; rank = ""; position[] = {-0.289795,2.98511,0}; dir = 0;}; class Object22 {side = 8; vehicle = "MetalBarrel_burning_F"; rank = ""; position[] = {3.625,0.375,0}; dir = 0;}; class Object23 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {5.65454,-4.58789,0}; dir = 270;}; class Object24 {side = 8; vehicle = "Land_CamoNetVar_EAST"; rank = ""; position[] = {4.23767,0.473755,0}; dir = 270;}; class Object25 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {2.01538,-5.6106,0}; dir = 180;}; class Object26 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {8.71082,-0.376831,0}; dir = 90;}; class Object27 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {5.33838,4.40503,0}; dir = 180;}; class Object28 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {2.26538,5.01392,0}; dir = 180;}; }; class Watchtower1_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_Watchtower1_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-3.27295,3.11438,0}; dir = 90;}; class Object1 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {1.60205,3.11438,0}; dir = 90;}; class Object2 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {3.66248,0.696655,0}; dir = 0;}; class Object3 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {2.66162,-1.65405,0}; dir = 0;}; class Object4 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-3.84546,-1.21289,0}; dir = 270;}; class Object5 {side = 8; vehicle = "Barrel3"; rank = ""; position[] = {1,-3.125,0}; dir = 210;}; class Object6 {side = 8; vehicle = "Barrel3"; rank = ""; position[] = {1.5647,-4.0603,0}; dir = 15;}; class Object7 {side = 8; vehicle = "Barrel3"; rank = ""; position[] = {1.75,-3.125,0}; dir = 270;}; class Object8 {side = 8; vehicle = "Land_HBarrierTower_F"; rank = ""; position[] = {-1.12549,5.34888,0}; dir = 180;}; class Object9 {side = 8; vehicle = "FoldTable"; rank = ""; position[] = {-1.1311,-5.93677,0}; dir = 345;}; class Object10 {side = 8; vehicle = "FoldChair"; rank = ""; position[] = {-0.809814,-5.20361,0}; dir = 0;}; class Object11 {side = 8; vehicle = "FoldChair"; rank = ""; position[] = {-1.74243,-5.58191,0}; dir = 330;}; class Object12 {side = 8; vehicle = "FoldChair"; rank = ""; position[] = {-1.45239,-6.66992,0}; dir = 195;}; class Object13 {side = 8; vehicle = "FoldChair"; rank = ""; position[] = {-0.421631,-6.65259,0}; dir = 270;}; class Object15 {side = 8; vehicle = "Land_BarrelWater_F"; rank = ""; position[] = {-2.50012,-6.62488,0}; dir = 359.981;}; class Object16 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {-8.08582,-5.12219,0}; dir = 270;}; class Object17 {side = 8; vehicle = "Land_Pallets_stack_F"; rank = ""; position[] = {3,-3.5,0}; dir = 194.999;}; class Object18 {side = 8; vehicle = "Land_GarbageBags_F"; rank = ""; position[] = {3.33496,-0.0150146,0}; dir = 0;}; class Object19 {side = 8; vehicle = "Land_CamoNet_EAST"; rank = ""; position[] = {-3.85083,-5.57446,0}; dir = 180;}; class Object20 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-5.18457,6.2179,0}; dir = 90;}; class Object21 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-1.03259,10.4351,0}; dir = 180;}; class Object22 {side = 8; vehicle = "Wire"; rank = ""; position[] = {3.30957,6.90808,0}; dir = 270;}; class Object23 {side = 8; vehicle = "Land_Pallet_F"; rank = ""; position[] = {5,-3.25,0}; dir = 224.332;}; }; class Watchtower2_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_Watchtower2_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {2.22705,1.98938,0}; dir = 90;}; class Object1 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {3.88745,1.75244,0}; dir = 90;}; class Object2 {side = 8; vehicle = "Fort_Crate_wood"; rank = ""; position[] = {1.8739,-4.37305,0}; dir = 0;}; class Object3 {side = 8; vehicle = "MetalBarrel_burning_F"; rank = ""; position[] = {2.25,-1.375,0}; dir = 0;}; class Object4 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-5.02954,-1.66113,0}; dir = 90;}; class Object5 {side = 8; vehicle = "Land_HBarrierTower_F"; rank = ""; position[] = {-0.000488281,4.34888,0}; dir = 180;}; class Object6 {side = 8; vehicle = "Land_Sacks_heap_F"; rank = ""; position[] = {0.375,-4.375,0}; dir = 165;}; class Object7 {side = 8; vehicle = "Land_CamoNetVar_EAST"; rank = ""; position[] = {2.60815,-2.6438,0}; dir = 150;}; class Object8 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-3.13892,1.01587,0}; dir = 90;}; class Object9 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {1.60962,-5.38843,0}; dir = 0;}; class Object10 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-4.35962,-3.6106,0}; dir = 180;}; class Object12 {side = 8; vehicle = "Land_Sacks_goods_F"; rank = ""; position[] = {3.88721,0.245728,0}; dir = 105;}; class Object13 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-0.0325928,9.81006,0}; dir = 180;}; class Object14 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-4.44043,6.65808,0}; dir = 270;}; class Object15 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {4.14038,7.2644,0}; dir = 180;}; class Object16 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {8.35205,1.48938,0}; dir = 90;}; class Object17 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {8.38892,3.23511,0}; dir = 270;}; class Object18 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {8.23608,-2.60913,0}; dir = 90;}; class Object19 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {6.15381,-7.04895,0}; dir = 165;}; class Object20 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {7.21338,6.65503,0}; dir = 180;}; }; class Watchtower3_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_Watchtower3_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {1.97705,1.23938,0}; dir = 90;}; class Object1 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-4.48889,-0.772461,0}; dir = 0;}; class Object2 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {1.97705,4.23938,0}; dir = 90;}; class Object3 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-1.36389,-0.772461,0}; dir = 0;}; class Object4 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {-5.13647,0.744385,0}; dir = 255;}; class Object5 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {-3.36255,0.877441,0}; dir = 90;}; class Object6 {side = 8; vehicle = "Land_Pallets_F"; rank = ""; position[] = {-11.3538,7.1178,0}; dir = 120;}; class Object7 {side = 8; vehicle = "Land_HBarrierTower_F"; rank = ""; position[] = {-0.250488,6.47388,0}; dir = 180;}; class Object8 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-6.64038,-0.763916,0}; dir = 0;}; class Object9 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-6.64038,4.86157,0}; dir = 0;}; class Object11 {side = 8; vehicle = "Land_BarrelWater_grey_F"; rank = ""; position[] = {-2.25012,0.500122,0}; dir = 359.981;}; class Object12 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {-10.3358,2.12781,0}; dir = 270;}; class Object13 {side = 8; vehicle = "GunrackTK_EP1"; rank = ""; position[] = {0.544678,0.605957,0}; dir = 270;}; class Object14 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-0.407593,11.8101,0}; dir = 180;}; class Object15 {side = 8; vehicle = "Wire"; rank = ""; position[] = {3.93457,8.28308,0}; dir = 270;}; class Object16 {side = 8; vehicle = "Land_GarbagePallet_F"; rank = ""; position[] = {-9.41846,8.50818,0}; dir = 135;}; class Object17 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {-9.35095,8.42261,0}; dir = 135;}; class Object18 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-5.65454,9.58887,0}; dir = 90;}; class Object19 {side = 8; vehicle = "Land_Pallet_F"; rank = ""; position[] = {-12.1489,7.44177,0}; dir = 223.945;}; class Object20 {side = 8; vehicle = "Land_Pneu"; rank = ""; position[] = {-11.3237,8.68018,0}; dir = 135;}; }; class Watchtower4_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_Watchtower4_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {1.91248,-1.44604,0}; dir = 0;}; class Object1 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {0.25,-2.91113,0}; dir = 0;}; class Object2 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-5.89526,-2.31873,0}; dir = 30;}; class Object4 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {-9.21082,0.900879,0}; dir = 270;}; class Object5 {side = 8; vehicle = "Land_GarbageBags_F"; rank = ""; position[] = {1.58496,-2.09937,0}; dir = 0;}; class Object6 {side = 8; vehicle = "Land_CamoNet_EAST"; rank = ""; position[] = {-0.47583,-2.25073,0}; dir = 180;}; class Object7 {side = 8; vehicle = "Wire"; rank = ""; position[] = {4.68457,6.20789,0}; dir = 270;}; class Object8 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-3.80957,5.57422,0}; dir = 90;}; class Object9 {side = 8; vehicle = "Wire"; rank = ""; position[] = {0.342407,9.44617,0}; dir = 180;}; class Object10 {side = 8; vehicle = "Land_HBarrierTower_F"; rank = ""; position[] = {0.308594,4.39038,0}; dir = 180;}; class Object11 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {6.61865,-2.33289,0}; dir = 330;}; class Object12 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {10.0858,0.896606,0}; dir = 90;}; }; class Watchtower5_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_Watchtower5_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-0.897949,-1.51062,0}; dir = 90;}; class Object1 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-0.897949,1.73938,0}; dir = 90;}; class Object2 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {4.88611,3.35254,0}; dir = 0;}; class Object3 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-2.93457,-1.7821,0}; dir = 90;}; class Object4 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {0.880615,-2.26147,0}; dir = 165;}; class Object5 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {4.85095,0.952393,0}; dir = 315;}; class Object6 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {0.560791,-3.68042,0}; dir = 225;}; class Object7 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {1.18579,-3.80542,0}; dir = 75;}; class Object8 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {0.875,-4.75,0}; dir = 180;}; class Object9 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {0.233887,-4.38574,0}; dir = 120;}; class Object10 {side = 8; vehicle = "Land_Pneu"; rank = ""; position[] = {4.96753,-1.16138,0}; dir = 315;}; class Object11 {side = 8; vehicle = "Land_GarbageWashingMachine_F"; rank = ""; position[] = {5.00476,0.753296,0}; dir = 315;}; class Object12 {side = 8; vehicle = "Land_HBarrierTower_F"; rank = ""; position[] = {1.37451,4.09888,0}; dir = 180;}; class Object13 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {4.63892,-5.64038,0}; dir = 270;}; class Object14 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-0.888916,-5.60913,0}; dir = 90;}; class Object16 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {1.87268,-9.33533,0}; dir = 180;}; class Object17 {side = 8; vehicle = "Wire"; rank = ""; position[] = {1.21741,9.56006,0}; dir = 180;}; class Object18 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-2.93457,5.8429,0}; dir = 90;}; class Object19 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {7.88342,1.74048,0}; dir = 150;}; class Object20 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {9.77954,-3.71289,0}; dir = 270;}; class Object21 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {9.21338,2.78003,0}; dir = 180;}; class Object22 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {10.3889,-0.764893,0}; dir = 270;}; }; class Watchtower6_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_Watchtower6_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {-2.98755,-2.24756,0}; dir = 90;}; class Object1 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {-4.61938,-2.26147,0}; dir = 165;}; class Object2 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {3.62256,-0.487549,0}; dir = 0;}; class Object3 {side = 8; vehicle = "Land_PaperBox_open_empty_F"; rank = ""; position[] = {3.62537,-2.12488,0}; dir = 75;}; class Object4 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {-3.375,-0.75,0}; dir = 165;}; class Object5 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {-4.22021,-0.52356,0}; dir = 240;}; class Object6 {side = 8; vehicle = "MetalBarrel_burning_F"; rank = ""; position[] = {1.75,2,0}; dir = 0;}; class Object7 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {4.40454,-4.08789,0}; dir = 270;}; class Object8 {side = 8; vehicle = "Land_PalletTrolley_01_khaki_F"; rank = ""; position[] = {-3.927,-3.22034,0}; dir = 209.127;}; class Object9 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {0.734619,-5.26343,0}; dir = 0;}; class Object10 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-7.99902,2.14612,0}; dir = 135;}; class Object11 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-7.35962,-4.3606,0}; dir = 180;}; class Object13 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {-11.0858,-1.62219,0}; dir = 270;}; class Object14 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-1.40759,13.3101,0}; dir = 180;}; class Object15 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-8.71204,11.1775,0}; dir = 150;}; class Object16 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-6.40454,7.58887,0}; dir = 89.9999;}; class Object17 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {3.96338,8.28003,0}; dir = 180;}; class Object18 {side = 8; vehicle = "Land_HBarrierTower_F"; rank = ""; position[] = {-1.19141,5.30347,0}; dir = 180;}; class Object19 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-6.98608,4.48511,0}; dir = 270;}; class Object20 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {7.27954,1.28711,0}; dir = 270;}; class Object21 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {5.01392,-1.01489,0}; dir = 270;}; class Object22 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {7.85205,5.73938,0}; dir = 90;}; class Object23 {side = 8; vehicle = "Wire"; rank = ""; position[] = {6.09753,11.4601,0}; dir = 210;}; class Object24 {side = 8; vehicle = "Land_PaperBox_open_full_F"; rank = ""; position[] = {6.25012,4.63416,0}; dir = 180;}; class Object25 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {6.23462,5.98657,0}; dir = 360;}; }; class Watchtower7_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_Watchtower7_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {2.22705,4.11438,0}; dir = 90;}; class Object1 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-9.39795,1.48938,0}; dir = 90;}; class Object2 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {2.22705,1.11438,0}; dir = 90;}; class Object3 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-9.27136,1.82153,0}; dir = 315;}; class Object4 {side = 8; vehicle = "Land_GarbagePallet_F"; rank = ""; position[] = {-6.58154,1.49182,0}; dir = 315;}; class Object5 {side = 8; vehicle = "Land_PaperBox_open_empty_F"; rank = ""; position[] = {0.499878,-0.499634,0}; dir = 0;}; class Object6 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {-6.64905,1.57739,0}; dir = 315;}; class Object7 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {4.71338,-1.71997,0}; dir = 180;}; class Object8 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-5.65454,6.46387,0}; dir = 90;}; class Object9 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-8.33838,-3.52905,0}; dir = 0;}; class Object10 {side = 8; vehicle = "Land_Pallet_F"; rank = ""; position[] = {5.25,3.5,0}; dir = 224.332;}; class Object11 {side = 8; vehicle = "Land_Pneu"; rank = ""; position[] = {-4.67627,1.31982,0}; dir = 315;}; class Object12 {side = 8; vehicle = "Land_Pallets_F"; rank = ""; position[] = {-10.1038,-5.5072,0}; dir = 120;}; class Object13 {side = 8; vehicle = "Land_HBarrierTower_F"; rank = ""; position[] = {-0.250488,6.34888,0}; dir = 180;}; class Object14 {side = 8; vehicle = "Land_Pallet_vertical_F"; rank = ""; position[] = {3.3689,0.248779,0}; dir = 269.997;}; class Object15 {side = 8; vehicle = "AmmoCrate_NoInteractive_"; rank = ""; position[] = {-7.90625,-0.365112,0}; dir = 165;}; class Object16 {side = 8; vehicle = "AmmoCrate_NoInteractive_"; rank = ""; position[] = {-8.14917,-1.39709,0}; dir = 105;}; class Object17 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {2.23462,-4.01343,0}; dir = 0;}; class Object18 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {4.64038,-3.9856,0}; dir = 180;}; class Object19 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-7.24902,4.02112,0}; dir = 135;}; class Object21 {side = 8; vehicle = "Land_fort_bagfence_round"; rank = ""; position[] = {-4.12732,-6.71033,0}; dir = 180;}; class Object22 {side = 8; vehicle = "GunrackTK_EP1"; rank = ""; position[] = {-5.48096,-1.08032,0}; dir = 180;}; class Object23 {side = 8; vehicle = "Land_Pallets_stack_F"; rank = ""; position[] = {4.375,0.25,0}; dir = 270;}; class Object24 {side = 8; vehicle = "Land_CamoNet_EAST"; rank = ""; position[] = {-9.19946,-2.14917,0}; dir = 270;}; class Object25 {side = 8; vehicle = "Wire"; rank = ""; position[] = {3.93457,8.40808,0}; dir = 270;}; class Object26 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-0.407593,11.9351,0}; dir = 180;}; }; class Watchtower8_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_Watchtower8_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-0.647949,-3.13562,0}; dir = 90;}; class Object1 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {1.36389,-6.47656,0}; dir = 180;}; class Object2 {side = 8; vehicle = "Land_CratesShabby_F"; rank = ""; position[] = {2.13098,-5.38013,0}; dir = 300;}; class Object3 {side = 8; vehicle = "Land_CratesShabby_F"; rank = ""; position[] = {0.932007,-5.06323,0}; dir = 90;}; class Object4 {side = 8; vehicle = "Land_CratesWooden_F"; rank = ""; position[] = {1.125,-3.5,0}; dir = 270;}; class Object5 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-1.22046,-8.96289,0}; dir = 270;}; class Object6 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {2.78662,2.47095,0}; dir = 0;}; class Object7 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-7.58838,-9.40405,0}; dir = 0;}; class Object8 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-8.15454,4.08887,0}; dir = 90;}; class Object9 {side = 8; vehicle = "Hedgehog"; rank = ""; position[] = {-14.7134,-4.15625,0}; dir = 30;}; class Object10 {side = 8; vehicle = "Hedgehog"; rank = ""; position[] = {-13.2813,-3.41162,0}; dir = 120;}; class Object11 {side = 8; vehicle = "Hedgehog"; rank = ""; position[] = {-13.2539,-5.37878,0}; dir = 255;}; class Object12 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {-8.52454,-2.24951,0}; dir = 90;}; class Object13 {side = 8; vehicle = "Land_HBarrierTower_F"; rank = ""; position[] = {-0.500488,4.72388,0}; dir = 180;}; class Object14 {side = 8; vehicle = "Land_Pallet_vertical_F"; rank = ""; position[] = {-8.0061,-3.62622,0}; dir = 269.996;}; class Object15 {side = 8; vehicle = "AmmoCrates_NoInteractive_Medium"; rank = ""; position[] = {-1.97522,-3.3623,0}; dir = 180;}; class Object16 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-4.64038,-10.0134,0}; dir = 0;}; class Object17 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {3.23462,-6.38843,0}; dir = 0;}; class Object19 {side = 8; vehicle = "GunrackTK_EP1"; rank = ""; position[] = {-1.98096,-4.70532,0}; dir = 180;}; class Object20 {side = 8; vehicle = "Land_Pallets_stack_F"; rank = ""; position[] = {-7,-3.625,0}; dir = 270.001;}; class Object21 {side = 8; vehicle = "Land_Pallets_stack_F"; rank = ""; position[] = {-7.25,1.125,0}; dir = 255;}; class Object22 {side = 8; vehicle = "Land_Misc_IronPipes_EP1"; rank = ""; position[] = {-12.8064,0.497681,0}; dir = 105;}; class Object23 {side = 8; vehicle = "Land_CamoNet_EAST"; rank = ""; position[] = {-5.97583,-6.94946,0}; dir = 180;}; class Object24 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-0.782593,10.1851,0}; dir = 180;}; class Object25 {side = 8; vehicle = "Wire"; rank = ""; position[] = {3.55957,6.65808,0}; dir = 270;}; class Object26 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-4.85962,5.1394,0}; dir = 180;}; class Object27 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {6.65454,-5.21289,0}; dir = 270;}; class Object28 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {6.08838,1.28003,0}; dir = 180;}; class Object29 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {7.26392,-2.26489,0}; dir = 270;}; }; class Watchtower9_CUP_O_RU { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_Watchtower9_CUP_O_RU; // Credit: 2600K icon = "\ca\data\flag_rus_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-7.97473,2.05786,0}; dir = 135;}; class Object1 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-9.64795,0.113892,0}; dir = 90;}; class Object2 {side = 8; vehicle = "Land_CratesShabby_F"; rank = ""; position[] = {-7.25647,0.995605,0}; dir = 45;}; class Object3 {side = 8; vehicle = "Land_PaperBox_open_empty_F"; rank = ""; position[] = {-7.81506,-2.06042,0}; dir = 270;}; class Object4 {side = 8; vehicle = "Land_CratesWooden_F"; rank = ""; position[] = {-0.5,-6.75,0}; dir = 0;}; class Object5 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-8.46338,-4.77905,0}; dir = 0;}; class Object6 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {1.02954,-4.33789,0}; dir = 270;}; class Object7 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {1.96338,5.53003,0}; dir = 180;}; class Object8 {side = 8; vehicle = "Land_fort_bagfence_corner"; rank = ""; position[] = {-7.65454,4.21387,0}; dir = 90;}; class Object9 {side = 8; vehicle = "Land_PaperBox_open_full_F"; rank = ""; position[] = {-7.75916,-0.499878,0}; dir = 90;}; class Object10 {side = 8; vehicle = "Land_HBarrierTower_F"; rank = ""; position[] = {-2.62549,5.72339,0}; dir = 180;}; class Object11 {side = 8; vehicle = "Land_CamoNetVar_EAST"; rank = ""; position[] = {-4.06311,-4.24231,0}; dir = 15;}; class Object12 {side = 8; vehicle = "FoldTable"; rank = ""; position[] = {-4.125,-1.875,0}; dir = 30;}; class Object13 {side = 8; vehicle = "FoldChair"; rank = ""; position[] = {-4.3064,-1.19177,0}; dir = 15;}; class Object14 {side = 8; vehicle = "FoldChair"; rank = ""; position[] = {-4.12939,-2.88281,0}; dir = 315;}; class Object15 {side = 8; vehicle = "FoldChair"; rank = ""; position[] = {-4.87061,-2.16626,0}; dir = 240;}; class Object16 {side = 8; vehicle = "FoldChair"; rank = ""; position[] = {-3.37939,-1.58374,0}; dir = 45;}; class Object17 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-5.39038,-5.38843,0}; dir = 0;}; class Object18 {side = 8; vehicle = "Land_fort_bagfence_long"; rank = ""; position[] = {-2.48462,-5.3606,0}; dir = 180;}; class Object20 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-2.78259,11.1846,0}; dir = 180;}; class Object21 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-10.6311,9.98865,0}; dir = 165;}; class Object22 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {2.99695,2.66211,0}; dir = 30;}; class Object23 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {4.85205,1.23889,0}; dir = 90;}; class Object24 {side = 8; vehicle = "Misc_concrete_High"; rank = ""; position[] = {6.875,-0.125,0}; dir = 0;}; class Object25 {side = 8; vehicle = "Wire"; rank = ""; position[] = {4.12891,8.65356,0}; dir = 225;}; }; // WEST class NestSandbag_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_NestSandbag_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object1 {side = 8; vehicle = "Fort_RazorWire"; rank = ""; position[] = {-0.742676,-5.06226,0}; dir = 255;}; class Object3 {side = 8; vehicle = "Land_BagBunker_Small_F"; rank = ""; position[] = {4.12488,-2.18042,0}; dir = 0;}; class Object4 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {2.3606,0.627197,0}; dir = 270;}; class Object5 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {7.2478,-0.639404,0}; dir = 180;}; class Object6 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {9.38123,1.13403,0}; dir = 270;}; class Object7 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {9.37573,-0.665527,0}; dir = 90;}; class Object8 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {9.11182,2.80786,0}; dir = 255;}; class Object9 {side = 8; vehicle = "Fort_RazorWire"; rank = ""; position[] = {2.64624,-7.30762,0}; dir = 0;}; class Object10 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {2.79248,3.50757,0}; dir = 135;}; class Object11 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {5.07471,3.86426,0}; dir = 360;}; }; class NestHBarrier_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_NestHBarrier_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object1 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {0.647949,-1.86401,0}; dir = 270;}; class Object2 {side = 8; vehicle = "Fort_RazorWire"; rank = ""; position[] = {-1.7002,-9.27002,0}; dir = 225;}; class Object4 {side = 8; vehicle = "Land_BagBunker_Small_F"; rank = ""; position[] = {2.74988,-3.93042,0}; dir = 0;}; class Object5 {side = 8; vehicle = "Wire"; rank = ""; position[] = {2.34241,-11.3154,0}; dir = 180;}; class Object6 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {4.88611,-2.02295,0}; dir = 0;}; class Object7 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {8.18005,-3.89209,0}; dir = 30;}; class Object8 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {10.9576,-3.63232,0}; dir = 315;}; class Object9 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {11.386,-1.30054,0}; dir = 270;}; class Object10 {side = 8; vehicle = "Fort_RazorWire"; rank = ""; position[] = {10.2809,-8.31885,0}; dir = 150;}; class Object11 {side = 8; vehicle = "Land_fort_rampart"; rank = ""; position[] = {5,1.14941,0}; dir = 180;}; }; class Sandbags_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_Sandbags_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object1 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-0.730957,-2.01538,0}; dir = 285;}; class Object2 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-5.64465,-4.81177,0}; dir = 15;}; class Object3 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-7.3927,-2.54785,0}; dir = 240;}; class Object4 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-2.99463,-3.76367,0}; dir = 150;}; class Object5 {side = 8; vehicle = "Land_Wreck_Ural_F"; rank = ""; position[] = {-0.481567,3.83252,0}; dir = 240;}; class Object6 {side = 8; vehicle = "Land_GarbageBags_F"; rank = ""; position[] = {-0.914917,3.11011,0}; dir = 0;}; class Object7 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {0.28772,1.19678,0}; dir = 0;}; class Object8 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {-0.96228,5.07178,0}; dir = 0;}; class Object9 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {0.558472,8.13086,0}; dir = 285;}; class Object10 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-2.36792,12.7371,0}; dir = 90;}; class Object11 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-8.45898,0.162598,0}; dir = 105;}; class Object12 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-0.669678,10.4487,0}; dir = 225;}; class Object13 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-0.633667,15.0117,0}; dir = 315;}; class Object14 {side = 8; vehicle = "Barrel5"; rank = ""; position[] = {-2.875,3.5,0}; dir = 45;}; class Object15 {side = 8; vehicle = "Barrel5"; rank = ""; position[] = {-2.125,3.75,0}; dir = 0;}; class Object16 {side = 8; vehicle = "Barrel5"; rank = ""; position[] = {-2.5,4.5,0}; dir = 120;}; class Object17 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {-1.52588,0.218262,0}; dir = 240;}; class Object18 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {-1.23962,6.68091,0}; dir = 150;}; class Object19 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {-6.66089,1.61255,0}; dir = 330;}; class Object21 {side = 8; vehicle = "Land_GarbageBags_F"; rank = ""; position[] = {0.959961,1.73511,0}; dir = 0;}; class Object22 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {3.78772,3.07178,0}; dir = 0;}; class Object23 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {3.20129,9.85376,0}; dir = 0;}; class Object24 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {5.88367,1.71436,0}; dir = 360;}; class Object25 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {1.70837,16.7432,0}; dir = 180;}; class Object26 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {6.31042,10.105,0}; dir = 75;}; class Object27 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {9.95996,5.72021,0}; dir = 270;}; class Object28 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {6.92029,12.7837,0}; dir = 255;}; class Object29 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {8.22571,3.4458,0}; dir = 135;}; class Object30 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {8.26172,8.00879,0}; dir = 45;}; class Object31 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {4.01782,3.07593,0}; dir = 225;}; class Object32 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {5.10974,14.3167,0}; dir = 210;}; class Object33 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {3.57422,15.3816,0}; dir = 45;}; class Object34 {side = 8; vehicle = "Land_Pallets_F"; rank = ""; position[] = {3.61536,10.2578,0}; dir = 150;}; class Object35 {side = 8; vehicle = "Land_Pallet_F"; rank = ""; position[] = {3.1012,10.9221,0}; dir = 254.443;}; }; class SandbagsNet_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_SandbagNet_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object1 {side = 8; vehicle = "Land_CamoNet_NATO"; rank = ""; position[] = {2.47583,-5.17554,0}; dir = 0;}; class Object2 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {0.443848,-4.552,0}; dir = 0;}; class Object3 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {1.70764,-7.75732,0}; dir = 315;}; class Object4 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-2.63257,-7.70752,0}; dir = 45;}; class Object5 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {-0.490967,-8.13135,0}; dir = 0;}; class Object6 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {2.13599,-5.42554,0}; dir = 270;}; class Object7 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {-3.11401,-3.92554,0}; dir = 270;}; class Object8 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {-2.99353,-5.61597,0}; dir = 270;}; class Object9 {side = 8; vehicle = "Land_BarrelTrash_grey_F"; rank = ""; position[] = {0.625,-3.25,0}; dir = 359.988;}; class Object10 {side = 8; vehicle = "Fort_Crate_wood"; rank = ""; position[] = {1.37695,-2.87622,0}; dir = 150;}; class Object11 {side = 8; vehicle = "Fort_Crate_wood"; rank = ""; position[] = {-0.248901,-2.75195,0}; dir = 180;}; class Object13 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {5.06946,-8.45483,0}; dir = 15;}; class Object14 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {8.85303,-6.32788,0}; dir = 285;}; class Object15 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {3.61963,-6.65649,0}; dir = 240;}; class Object16 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {8.05811,-4.09399,0}; dir = 240;}; class Object17 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {7.13599,-7.75098,0}; dir = 330;}; }; class SandbagNetHvy_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_SandbagNetHvy_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object1 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-2.25745,-6.20752,0}; dir = 45;}; class Object2 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-2.6394,-3.3728,0}; dir = 270;}; class Object3 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {0.074585,-6.63599,0}; dir = 360;}; class Object4 {side = 8; vehicle = "CUP_ammobednaX"; rank = ""; position[] = {0.379761,-1.02197,0}; dir = 0;}; class Object5 {side = 8; vehicle = "Land_HBarrier_5_F"; rank = ""; position[] = {3.74878,0.378906,0}; dir = 180;}; class Object6 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-2.20764,-0.492676,0}; dir = 135;}; class Object8 {side = 8; vehicle = "Land_CamoNet_NATO"; rank = ""; position[] = {3.97583,-2.55054,0}; dir = 0;}; class Object9 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {9.58264,-6.00732,0}; dir = 315;}; class Object10 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {3.9978,-5.7644,0}; dir = 180;}; class Object11 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {10.0144,-3.1272,0}; dir = 90;}; class Object12 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {1.63562,-5.81445,0}; dir = 180;}; class Object13 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {6.30212,-6.03442,0}; dir = 15;}; class Object14 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {7.30042,-6.36401,0}; dir = 180;}; class Object15 {side = 8; vehicle = "Gunrack1"; rank = ""; position[] = {2.125,-1,0}; dir = 180;}; class Object16 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {5.91272,-0.428223,0}; dir = 0;}; class Object17 {side = 8; vehicle = "Land_GarbagePallet_F"; rank = ""; position[] = {5.8999,-0.536621,0}; dir = 0;}; class Object18 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {8.16101,0.0559082,0}; dir = 180;}; class Object19 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {9.63245,-0.29248,0}; dir = 225;}; class Object20 {side = 8; vehicle = "Land_HBarrier_1_F"; rank = ""; position[] = {5.15247,0.150146,0}; dir = 0;}; class Object21 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {3.125,-0.875,0}; dir = 0;}; }; class NestMed_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_NestMed_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object1 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-0.632446,-0.33252,0}; dir = 45;}; class Object2 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {-0.989014,1.94946,0}; dir = 270;}; class Object4 {side = 8; vehicle = "Land_CamoNetVar_NATO"; rank = ""; position[] = {4.84875,-0.237549,0}; dir = 0;}; class Object5 {side = 8; vehicle = "Land_BagBunker_Small_F"; rank = ""; position[] = {2.24988,-2.18042,0}; dir = 0;}; class Object6 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {4.58984,3.17114,0}; dir = 0;}; class Object7 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {8.58252,-0.632324,0}; dir = 315;}; class Object8 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {5.7478,-1.0144,0}; dir = 180;}; class Object9 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {9.01086,1.69946,0}; dir = 270;}; class Object10 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {9.02344,3.08594,0}; dir = 45;}; class Object11 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {7.16016,4.45386,0}; dir = 180;}; class Object12 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {3.11194,4.80786,0}; dir = 255;}; }; class SandbagNetLit_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_SandbagNetLit_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object1 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-0.132568,-6.83252,0}; dir = 45;}; class Object2 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {2.11597,-7.24365,0}; dir = 180;}; class Object3 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {-0.489136,-4.55054,0}; dir = 270;}; class Object4 {side = 8; vehicle = "Land_HBarrier_1_F"; rank = ""; position[] = {-3.25525,-8.11963,0}; dir = 135;}; class Object5 {side = 8; vehicle = "Land_CamoNet_NATO"; rank = ""; position[] = {2.10083,-4.05054,0}; dir = 2.73208e-005;}; class Object6 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {1.17651,-3.71899,0}; dir = 0;}; class Object7 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-0.463257,-0.87207,0}; dir = 5.00003;}; class Object8 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {-2.74304,-2.45288,0}; dir = 95;}; class Object9 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {-2.58069,-0.660645,0}; dir = 275;}; class Object10 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {-0.25,-1.75,0}; dir = 225;}; class Object11 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {0.625,-1.75,0}; dir = 0;}; class Object12 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {-2.62073,-4.1438,0}; dir = 80;}; class Object14 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {4.20764,-6.88232,0}; dir = 315;}; class Object15 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {4.63599,-4.55054,0}; dir = 270;}; class Object16 {side = 8; vehicle = "Land_HBarrier_1_F"; rank = ""; position[] = {6.75647,-7.74634,0}; dir = 240;}; class Object17 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {3.7688,-4.37866,0}; dir = 0;}; class Object18 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {5.25391,-1.4978,0}; dir = 5.00003;}; class Object19 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {2.40076,-1.1228,0}; dir = 5.00003;}; class Object20 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {7.47864,-3.22168,0}; dir = 95;}; class Object21 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {7.65686,-1.72144,0}; dir = 5.00003;}; class Object22 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {7.60107,-4.9126,0}; dir = 80;}; class Object23 {side = 8; vehicle = "Land_Pallets_stack_F"; rank = ""; position[] = {3.37317,-2.25098,0}; dir = 105;}; class Object24 {side = 8; vehicle = "Land_Pallet_vertical_F"; rank = ""; position[] = {4.36011,-2.79248,0}; dir = 108.131;}; // Z: 0.197157 }; class LightNet1_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_LightNet1_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-5.0481,-2.45313,0}; dir = 240;}; class Object1 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-5.04688,1.57666,0}; dir = 150;}; class Object2 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {-3.92017,-3.61963,0}; dir = 180;}; class Object3 {side = 8; vehicle = "Land_HBarrier_1_F"; rank = ""; position[] = {-4.49268,-3.00195,0}; dir = 285;}; class Object4 {side = 8; vehicle = "Land_CamoNet_NATO"; rank = ""; position[] = {0.60083,0.824219,0}; dir = 0;}; class Object5 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {1.20752,-3.25732,0}; dir = 315;}; class Object6 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-1.59351,-3.61621,0}; dir = 0;}; class Object7 {side = 8; vehicle = "Land_HBarrier_1_F"; rank = ""; position[] = {7.37695,0.742676,0}; dir = 345;}; class Object8 {side = 8; vehicle = "Land_HBarrier_1_F"; rank = ""; position[] = {5.24634,-3.00635,0}; dir = 30;}; class Object9 {side = 8; vehicle = "Land_CratesShabby_F"; rank = ""; position[] = {-0.742188,1.74854,0}; dir = 270;}; class Object10 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {1.63599,-1.0498,0}; dir = 270;}; class Object11 {side = 8; vehicle = "Land_BarrelWater_grey_F"; rank = ""; position[] = {0,2,0}; dir = 359.982;}; class Object13 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {1.98901,3.14795,0}; dir = 180;}; class Object14 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {5.20703,2.35889,0}; dir = 195;}; class Object15 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {-1.87744,2.8877,0}; dir = 0;}; }; class LightNet2_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_LightNet2_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-2.23706,-5.71582,0}; dir = 0;}; class Object1 {side = 8; vehicle = "Land_HBarrier_1_F"; rank = ""; position[] = {-4.08228,-4.50684,0}; dir = 135;}; class Object2 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-5.17896,-1.25098,0}; dir = 270;}; class Object3 {side = 8; vehicle = "Land_HBarrier_1_F"; rank = ""; position[] = {-3.94653,4.36816,0}; dir = 225;}; class Object4 {side = 8; vehicle = "Land_CamoNetVar_NATO"; rank = ""; position[] = {1.39697,-0.5,0}; dir = 0;}; class Object5 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {6.99414,1.00928,0}; dir = 45;}; class Object6 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {7.18359,-1.51904,0}; dir = 135;}; class Object7 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {-0.373291,-4.45801,0}; dir = 315;}; class Object9 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {2.84106,5.37891,0}; dir = 15;}; class Object10 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-0.0219727,4.80225,0}; dir = 345;}; class Object11 {side = 8; vehicle = "Land_HBarrier_1_F"; rank = ""; position[] = {5.91943,4.35645,0}; dir = 30;}; }; class LightNet3_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_LightNet3_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_CamoNet_NATO"; rank = ""; position[] = {0.203125,0.287598,0}; dir = 0;}; class Object1 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-5.31592,-3.78516,0}; dir = 0;}; class Object3 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-4.69092,2.33984,0}; dir = 0;}; class Object4 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {-0.827637,2.2251,0}; dir = 195;}; class Object5 {side = 8; vehicle = "Land_CratesShabby_F"; rank = ""; position[] = {-4.56909,1.11133,0}; dir = 270;}; class Object6 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {-4.7019,0.362793,0}; dir = 0;}; class Object7 {side = 8; vehicle = "Land_BarrelEmpty_grey_F"; rank = ""; position[] = {-1.7019,1.11279,0}; dir = 359.981;}; class Object8 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-6.05396,0.249023,0}; dir = 270;}; class Object9 {side = 8; vehicle = "Land_Pallets_F"; rank = ""; position[] = {7.83862,-1.77197,0}; dir = 255;}; class Object10 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {2.66724,-3.02539,0}; dir = 195;}; class Object11 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {4.91553,-3.62451,0}; dir = 15;}; class Object12 {side = 8; vehicle = "Land_HBarrier_1_F"; rank = ""; position[] = {0.428467,-2.75684,0}; dir = 225;}; class Object13 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {3.68408,2.08984,0}; dir = 0;}; class Object14 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {7.15015,2.35156,0}; dir = 90;}; }; class LightNet4_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_LightNet4_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_HBarrier_5_F"; rank = ""; position[] = {-5.49609,-1.49854,0}; dir = 270;}; class Object1 {side = 8; vehicle = "Land_CamoNetVar_NATO"; rank = ""; position[] = {1.09888,-0.612793,0}; dir = 0;}; class Object2 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {3.46484,-4.45361,0}; dir = 0;}; class Object3 {side = 8; vehicle = "Land_HBarrier_1_F"; rank = ""; position[] = {7.875,-0.132324,0}; dir = 0;}; class Object4 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {6.75,-0.875,0}; dir = 0;}; class Object5 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {1.62207,-3.12988,0}; dir = 225;}; class Object6 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {5.32861,-3.1958,0}; dir = 315;}; class Object8 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {0.385986,4.10205,0}; dir = 0;}; class Object9 {side = 8; vehicle = "Land_Pallet_F"; rank = ""; position[] = {1.875,2,0}; dir = 194.653;}; class Object10 {side = 8; vehicle = "Land_PaperBox_open_full_F"; rank = ""; position[] = {5.99121,2.37256,0}; dir = 75;}; class Object11 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {3.63599,4.10205,0}; dir = 0;}; }; class NetCamo_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_NetCamo_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object1 {side = 8; vehicle = "Land_CamoNetB_NATO"; rank = ""; position[] = {4.07971,-1.2644,0}; dir = 0;}; class Object2 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {0.430054,-8.89209,0}; dir = 30;}; class Object3 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-1.48547,-3.49829,0}; dir = 75;}; class Object4 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-0.735474,-6.24829,0}; dir = 75;}; class Object5 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {2.80786,-8.73706,0}; dir = 345;}; class Object6 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-2.23547,-0.748291,0}; dir = 75;}; class Object8 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-2.93347,1.99414,0}; dir = 105;}; class Object9 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-0.619629,3.73633,0}; dir = 150;}; class Object10 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {1.88037,5.23633,0}; dir = 150;}; class Object11 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {4.55042,6.26099,0}; dir = 180;}; class Object12 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {4.05786,6.26294,0}; dir = 345;}; class Object13 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {12.2671,-5.31982,0}; dir = 300;}; class Object14 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {11.9388,-2.42578,0}; dir = 75;}; class Object15 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {10.155,-6.25488,0}; dir = 165;}; class Object16 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {11.2355,0.373291,0}; dir = 255;}; class Object17 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {6.8728,6.2356,0}; dir = 180;}; class Object18 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {10.4855,3.12329,0}; dir = 255;}; class Object19 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {9.63245,5.83252,0}; dir = 225;}; }; class BunkerSmall1_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_BunkerSmall1_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-5.25989,-1.3335,0}; dir = 45;}; class Object1 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {-4.37585,-5.3877,0}; dir = 195;}; class Object2 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-4.63354,6.61255,0}; dir = 165;}; class Object3 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-5.61304,1.37183,0}; dir = 90;}; class Object4 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-5.16174,4.02686,0}; dir = 135;}; class Object5 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-2.37524,4.38843,0}; dir = 0;}; class Object6 {side = 8; vehicle = "Land_CamoNetVar_NATO"; rank = ""; position[] = {-0.276245,-2.61255,0}; dir = 0;}; class Object7 {side = 8; vehicle = "Land_BagBunker_Small_F"; rank = ""; position[] = {-0.502319,-0.0705566,0}; dir = 180;}; class Object8 {side = 8; vehicle = "CUP_A2_barels3"; rank = ""; position[] = {0.794067,-6.57764,0}; dir = 75;}; class Object10 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {4.28186,-1.4043,0}; dir = 315;}; class Object11 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {1.36304,-4.88428,0}; dir = 240;}; class Object12 {side = 8; vehicle = "Wire"; rank = ""; position[] = {3.08264,6.88403,0}; dir = 195;}; class Object13 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {1.62036,4.35962,0}; dir = 180;}; class Object14 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {4.73315,1.25073,0}; dir = 270;}; class Object15 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {4.38,3.95605,0}; dir = 225;}; class Object16 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {-0.511475,4.38037,0}; dir = 180;}; }; class BunkerSmall2_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_BunkerSmall2_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-6.68701,3.21631,0}; dir = 90;}; class Object1 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-3.25854,8.48755,0}; dir = 165;}; class Object2 {side = 8; vehicle = "Land_CamoNetVar_NATO"; rank = ""; position[] = {4.13733,2.27612,0}; dir = 90;}; class Object3 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {3.34961,0.113037,0}; dir = 90;}; class Object4 {side = 8; vehicle = "Land_BagBunker_Small_F"; rank = ""; position[] = {-0.502319,3.80444,0}; dir = 180;}; class Object6 {side = 8; vehicle = "Land_Pneu"; rank = ""; position[] = {3.37256,-5.00098,0}; dir = 0;}; class Object7 {side = 8; vehicle = "Barrel3"; rank = ""; position[] = {3.24756,-3.75098,0}; dir = 0;}; class Object8 {side = 8; vehicle = "Barrel3"; rank = ""; position[] = {3.74756,-3.12598,0}; dir = 210;}; class Object9 {side = 8; vehicle = "Barrel3"; rank = ""; position[] = {2.74756,-3.12598,0}; dir = 15;}; class Object10 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {7.49023,0.195801,0}; dir = 90;}; class Object11 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {7.49304,1.97925,0}; dir = 90;}; class Object12 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {5.49731,0.223877,0}; dir = 180;}; class Object13 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {7.48511,4.36548,0}; dir = 270;}; class Object14 {side = 8; vehicle = "Land_Pallets_F"; rank = ""; position[] = {1.1438,-3.50806,0}; dir = 120;}; class Object15 {side = 8; vehicle = "Land_Pallets_stack_F"; rank = ""; position[] = {1.49756,-0.500977,0}; dir = 165;}; class Object16 {side = 8; vehicle = "Land_Pallets_stack_F"; rank = ""; position[] = {1.62256,-2.12598,0}; dir = 179.998;}; class Object17 {side = 8; vehicle = "Wire"; rank = ""; position[] = {4.71497,9.68359,0}; dir = 180;}; class Object18 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {1.38184,6.4165,0}; dir = 270;}; class Object19 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {5.75854,6.35742,0}; dir = 0;}; class Object20 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {3.37036,6.35962,0}; dir = 180;}; class Object21 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {7.54004,6.36426,0}; dir = 0;}; }; class BunkerSmall3_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_BunkerSmall3_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_CamoNetVar_NATO"; rank = ""; position[] = {-0.0987549,-5.26245,0}; dir = 180;}; class Object1 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-0.150391,-6.26196,0}; dir = 90;}; class Object2 {side = 8; vehicle = "Land_Sack_F"; rank = ""; position[] = {0.243774,-10.3792,0}; dir = 270;}; class Object3 {side = 8; vehicle = "Land_Pallets_F"; rank = ""; position[] = {-2.9812,-9.13306,0}; dir = 120;}; class Object5 {side = 8; vehicle = "Land_Pneu"; rank = ""; position[] = {-1.49658,-4.56274,0}; dir = 105;}; class Object6 {side = 8; vehicle = "Barrel3"; rank = ""; position[] = {-0.502441,-10.126,0}; dir = 0;}; class Object7 {side = 8; vehicle = "Barrel3"; rank = ""; position[] = {-1.00244,-9.50098,0}; dir = 15;}; class Object8 {side = 8; vehicle = "Barrel3"; rank = ""; position[] = {-1.5,-8.625,0}; dir = 210;}; class Object9 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {-5.28674,-3.30298,0}; dir = 105;}; class Object10 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-2.00024,-0.736572,0}; dir = 0;}; class Object11 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-4.58508,-1.11865,0}; dir = 135;}; class Object12 {side = 8; vehicle = "Land_Pallets_F"; rank = ""; position[] = {-3.9812,-4.63306,0}; dir = 120;}; class Object13 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-1.28503,5.93359,0}; dir = 180;}; class Object14 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {3.36145,-8.22803,0}; dir = 180;}; class Object15 {side = 8; vehicle = "Land_BagBunker_Small_F"; rank = ""; position[] = {0.997681,0.804443,0}; dir = 180;}; class Object16 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {8.11267,-6.55737,0}; dir = 300;}; class Object17 {side = 8; vehicle = "Land_Pallet_F"; rank = ""; position[] = {3.49756,-10.501,0}; dir = 224.332;}; class Object18 {side = 8; vehicle = "Land_GarbagePallet_F"; rank = ""; position[] = {8.2002,-6.6228,0}; dir = 300;}; class Object19 {side = 8; vehicle = "Land_Pallets_stack_F"; rank = ""; position[] = {1.49756,-6.62598,0}; dir = 269.999;}; class Object20 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {10.1335,-2.052,0}; dir = 270;}; class Object21 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {4.12036,-0.765381,0}; dir = 180;}; class Object22 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {6.51196,-7.50317,0}; dir = 90;}; class Object23 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {6.99536,-0.765381,0}; dir = 180;}; class Object24 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {9.755,-1.16846,0}; dir = 225;}; class Object25 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {7.03992,-4.99365,0}; dir = 135;}; class Object26 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {9.7052,-4.2583,0}; dir = 315;}; class Object27 {side = 8; vehicle = "AmmoCrates_NoInteractive_Small"; rank = ""; position[] = {2.87378,-6.60571,0}; dir = 90;}; class Object28 {side = 8; vehicle = "Wire"; rank = ""; position[] = {6.7262,5.02515,0}; dir = 195;}; }; class BunkerSmall4_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_BunkerSmall4_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-0.900391,2.11304,0}; dir = 90;}; class Object1 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {0.270142,-1.73364,0}; dir = 0;}; class Object3 {side = 8; vehicle = "Land_GarbageWashingMachine_F"; rank = ""; position[] = {0.238159,-1.98291,0}; dir = 0;}; class Object4 {side = 8; vehicle = "Land_Pneu"; rank = ""; position[] = {-1.14209,-3.31079,0}; dir = 0;}; class Object5 {side = 8; vehicle = "Land_Pallets_F"; rank = ""; position[] = {-2.7312,-0.883057,0}; dir = 120;}; class Object6 {side = 8; vehicle = "Wire"; rank = ""; position[] = {0.839966,12.8086,0}; dir = 180;}; class Object7 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-7.13354,11.6125,0}; dir = 165;}; class Object8 {side = 8; vehicle = "Land_BagBunker_Small_F"; rank = ""; position[] = {1.12268,6.80444,0}; dir = 180;}; class Object9 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {-5.81079,8.51147,0}; dir = 180;}; class Object10 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {-8.50549,6.00708,0}; dir = 90;}; class Object11 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {-5.94067,3.37817,0}; dir = 0;}; class Object12 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {-3.24597,5.88306,0}; dir = 270;}; class Object13 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-1.87964,5.10962,0}; dir = 180;}; class Object14 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-8.0592,3.92261,0}; dir = 45;}; class Object15 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-3.69226,7.96704,0}; dir = 225;}; class Object16 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-7.96106,8.12524,0}; dir = 135;}; class Object17 {side = 8; vehicle = "Land_CamoNetVar_NATO"; rank = ""; position[] = {-3.86267,4.27612,0}; dir = 90;}; class Object18 {side = 8; vehicle = "Barrel3"; rank = ""; position[] = {1.11401,1.55737,0}; dir = 195;}; class Object19 {side = 8; vehicle = "Barrel3"; rank = ""; position[] = {0.674316,2.24243,0}; dir = 180;}; class Object20 {side = 8; vehicle = "Barrel3"; rank = ""; position[] = {0.364014,1.55737,0}; dir = 30;}; class Object21 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {0.258667,0.101074,0}; dir = 1.36604e-005;}; class Object22 {side = 8; vehicle = "Land_CratesShabby_F"; rank = ""; position[] = {3.74817,0.741211,0}; dir = 345;}; class Object23 {side = 8; vehicle = "Land_Pallets_F"; rank = ""; position[] = {2.46643,-2.0127,0}; dir = 45;}; class Object24 {side = 8; vehicle = "Land_CamoNetVar_NATO"; rank = ""; position[] = {5.01233,4.27612,0}; dir = 90;}; class Object25 {side = 8; vehicle = "Wire"; rank = ""; position[] = {8.70764,11.8838,0}; dir = 195;}; class Object26 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {1.49756,2.24902,0}; dir = 345;}; class Object27 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {10.8756,5.99048,0}; dir = 270;}; class Object28 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {8.31079,8.61914,0}; dir = 180;}; class Object29 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {5.61609,6.11499,0}; dir = 90;}; class Object30 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {8.16284,3.49854,0}; dir = 180;}; class Object31 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {4.24536,5.23462,0}; dir = 180;}; class Object32 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {10.3312,3.87207,0}; dir = 315;}; class Object33 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {10.4293,8.07471,0}; dir = 225;}; class Object34 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {6.16052,8.2334,0}; dir = 135;}; class Object35 {side = 8; vehicle = "Land_CratesShabby_F"; rank = ""; position[] = {2.99109,1.49463,0}; dir = 45;}; }; class BunkerSmall5_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_BunkerSmall5_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_CamoNet_NATO"; rank = ""; position[] = {-0.72583,-4.44946,0}; dir = 180;}; class Object1 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {-3.33997,-5.55444,0}; dir = 0;}; class Object2 {side = 8; vehicle = "Land_Pallet_F"; rank = ""; position[] = {1.125,-5.875,0}; dir = 119.332;}; class Object4 {side = 8; vehicle = "Land_GarbageBags_F"; rank = ""; position[] = {-3.66748,-6.26587,0}; dir = 0;}; class Object5 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {-6.91797,-3.75195,0}; dir = 180;}; class Object6 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {-6.87842,0.539551,0}; dir = 270;}; class Object7 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {-2.50146,-3.7915,0}; dir = 90;}; class Object8 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {-2.46191,0.5,0}; dir = 0;}; class Object9 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-1.12524,-0.111572,0}; dir = 0;}; class Object10 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-4.50024,-3.73657,0}; dir = 0;}; class Object11 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-4.87964,0.484619,0}; dir = 180;}; class Object12 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-6.86304,-1.75317,0}; dir = 90;}; class Object13 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-1.12524,-2.73657,0}; dir = 0;}; class Object14 {side = 8; vehicle = "Land_CratesWooden_F"; rank = ""; position[] = {-0.877441,-3.87598,0}; dir = 0;}; class Object15 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-6.50854,5.36255,0}; dir = 165;}; class Object16 {side = 8; vehicle = "Land_BagBunker_Small_F"; rank = ""; position[] = {1.74768,1.42944,0}; dir = 180;}; class Object17 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {4.37268,0.124023,0}; dir = 194.988;}; class Object18 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {3.99756,-0.875732,0}; dir = 105.007;}; class Object19 {side = 8; vehicle = "Wire"; rank = ""; position[] = {1.46497,6.55859,0}; dir = 180;}; class Object20 {side = 8; vehicle = "Wire"; rank = ""; position[] = {6.18799,2.34131,0}; dir = 90;}; }; class BunkerSmall6_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_BunkerSmall6_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object1 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-0.732666,-0.934326,0}; dir = 90;}; class Object2 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-3.99927,-3.82153,0}; dir = 180;}; class Object3 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-1.16443,-3.43945,0}; dir = 315;}; class Object4 {side = 8; vehicle = "Land_CratesShabby_F"; rank = ""; position[] = {-1.37598,-0.368164,0}; dir = 180;}; class Object5 {side = 8; vehicle = "Land_Pallets_stack_F"; rank = ""; position[] = {-2.00244,-1.75098,0}; dir = 194.999;}; class Object6 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {-1.73828,0.588379,0}; dir = 345;}; class Object7 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {-2.46826,0.717773,0}; dir = 345;}; class Object8 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {-2.37744,-0.000976563,0}; dir = 90;}; class Object9 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-2.70911,6.49487,0}; dir = 150;}; class Object10 {side = 8; vehicle = "Hedgehog"; rank = ""; position[] = {6.53418,-4.78223,0}; dir = 30;}; class Object11 {side = 8; vehicle = "Hedgehog"; rank = ""; position[] = {5.34131,-5.6626,0}; dir = 120;}; class Object12 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {3.01404,-3.45508,0}; dir = 1.36604e-005;}; class Object13 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {3.22998,0.0568848,0}; dir = 90;}; class Object14 {side = 8; vehicle = "Land_BagBunker_Small_F"; rank = ""; position[] = {0.997681,1.92944,0}; dir = 180;}; class Object15 {side = 8; vehicle = "Land_GarbageBags_F"; rank = ""; position[] = {4.83252,-2.26587,0}; dir = 0;}; class Object16 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {7.89233,2.06567,0}; dir = 90;}; class Object17 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {5.16003,-1.55444,0}; dir = 0;}; class Object18 {side = 8; vehicle = "Land_Pallet_F"; rank = ""; position[] = {2.99756,-6.62598,0}; dir = 119.332;}; class Object19 {side = 8; vehicle = "Wire"; rank = ""; position[] = {4.72034,8.62744,0}; dir = 180;}; class Object20 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {7.56311,4.78613,0}; dir = 225;}; class Object21 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {3.29529,4.8252,0}; dir = 135;}; class Object22 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {5.3689,5.19922,0}; dir = 180;}; }; class BunkerSmall7_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_BunkerSmall7_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-5.32129,-0.896729,0}; dir = 90;}; class Object1 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {0.0877686,-4.15869,0}; dir = 1.36604e-005;}; class Object2 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-4.33875,5.89185,0}; dir = 300;}; class Object3 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {-3.44922,-2.71313,0}; dir = 270;}; class Object5 {side = 8; vehicle = "Land_PaperBox_open_empty_F"; rank = ""; position[] = {-0.627441,-5.75146,0}; dir = 195;}; class Object6 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-0.0339355,2.23706,0}; dir = 90;}; class Object7 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-3.30054,-0.650146,0}; dir = 180;}; class Object8 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-0.465698,-0.268066,0}; dir = 315;}; class Object9 {side = 8; vehicle = "Land_GarbagePallet_F"; rank = ""; position[] = {-3.34082,-2.72607,0}; dir = 270;}; class Object10 {side = 8; vehicle = "Land_CamoNet_NATO"; rank = ""; position[] = {4.07446,-4.22583,0}; dir = 90;}; class Object11 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {5.67871,-1.14673,0}; dir = 90;}; class Object12 {side = 8; vehicle = "Wire"; rank = ""; position[] = {7.37866,5.82642,0}; dir = 240;}; class Object13 {side = 8; vehicle = "Land_BagBunker_Small_F"; rank = ""; position[] = {1.62268,4.92944,0}; dir = 180;}; class Object14 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {3.31226,2.36646,0}; dir = 270;}; class Object15 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {5.71606,-5.38794,0}; dir = 90;}; class Object16 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {3.69421,-0.468262,0}; dir = 45;}; class Object17 {side = 8; vehicle = "Land_CratesWooden_F"; rank = ""; position[] = {1.62256,-5.75098,0}; dir = 0;}; class Object18 {side = 8; vehicle = "Wire"; rank = ""; position[] = {1.29407,8.92383,0}; dir = 180;}; }; class BunkerSmall8_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_BunkerSmall8_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_CamoNet_NATO"; rank = ""; position[] = {1.27417,1.67554,0}; dir = 180;}; class Object1 {side = 8; vehicle = "Land_Sack_F"; rank = ""; position[] = {0.627563,1.99854,0}; dir = 135;}; class Object2 {side = 8; vehicle = "Land_CratesShabby_F"; rank = ""; position[] = {0.990479,2.75244,0}; dir = 105;}; class Object3 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {-0.378296,2.48633,0}; dir = 195;}; class Object5 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-3.36304,2.74683,0}; dir = 90;}; class Object6 {side = 8; vehicle = "AmmoCrates_NoInteractive_Small"; rank = ""; position[] = {-0.705078,1.26636,0}; dir = 195;}; class Object7 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-1.03503,9.93359,0}; dir = 180;}; class Object8 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-5.06201,5.84131,0}; dir = 90;}; class Object9 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-2.96008,5.50635,0}; dir = 135;}; class Object10 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {-1.01147,5.88037,0}; dir = 180;}; class Object11 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {4.2052,1.2417,0}; dir = 315;}; class Object12 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {4.61609,3.23999,0}; dir = 90;}; class Object13 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {4.255,5.33154,0}; dir = 225;}; class Object14 {side = 8; vehicle = "Land_BagBunker_Small_F"; rank = ""; position[] = {1.37268,7.30444,0}; dir = 180;}; }; class BunkerSmall9_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_BunkerSmall9_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {-0.760986,-0.758545,0}; dir = 105;}; class Object1 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-0.488037,1.49634,0}; dir = 90;}; class Object3 {side = 8; vehicle = "Wire"; rank = ""; position[] = {0.967407,8.93457,0}; dir = 180;}; class Object4 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-6.70959,5.34741,0}; dir = 120;}; class Object5 {side = 8; vehicle = "Land_CamoNetVar_NATO"; rank = ""; position[] = {1.52625,2.61255,0}; dir = 180;}; class Object6 {side = 8; vehicle = "Land_BagBunker_Small_F"; rank = ""; position[] = {1.37268,4.42896,0}; dir = 180;}; class Object7 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {2.99756,0.874023,0}; dir = 150;}; class Object8 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {3.87256,0.874023,0}; dir = 45;}; class Object9 {side = 8; vehicle = "Fort_Crate_wood"; rank = ""; position[] = {5.99915,2.12573,0}; dir = 75;}; class Object10 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {7.50403,0.632568,0}; dir = 270;}; class Object11 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {4.37036,2.98413,0}; dir = 180;}; class Object12 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {4.24536,-1.89087,0}; dir = 180;}; class Object13 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {7.13,2.58105,0}; dir = 225;}; class Object14 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {6.95959,-1.48584,0}; dir = 315;}; class Object15 {side = 8; vehicle = "Land_CratesWooden_F"; rank = ""; position[] = {4.12256,1.99902,0}; dir = 2.73208e-005;}; }; class BunkerTower1_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_BunkerTower1_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-4.90039,0.863037,0}; dir = 90;}; class Object2 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-4.90039,3.86304,0}; dir = 90;}; class Object3 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-0.0350342,13.5586,0}; dir = 180;}; class Object4 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-6.65601,10.5029,0}; dir = 135;}; class Object5 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-9.06201,3.59131,0}; dir = 90;}; class Object6 {side = 8; vehicle = "Land_CratesShabby_F"; rank = ""; position[] = {-2.12891,2.86621,0}; dir = 0;}; class Object7 {side = 8; vehicle = "Land_BagBunker_Tower_F"; rank = ""; position[] = {0.261108,6.21899,0}; dir = 90;}; class Object8 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {-3.02026,2.90942,0}; dir = 315;}; class Object9 {side = 8; vehicle = "Barrel3"; rank = ""; position[] = {-3.00659,2.11865,0}; dir = 165;}; class Object10 {side = 8; vehicle = "Barrel3"; rank = ""; position[] = {-3.65601,1.74365,0}; dir = 0;}; class Object11 {side = 8; vehicle = "Barrel3"; rank = ""; position[] = {-3.72998,2.49219,0}; dir = 150;}; class Object12 {side = 8; vehicle = "Land_CratesShabby_F"; rank = ""; position[] = {-1.06091,2.8689,0}; dir = 300;}; class Object13 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {4.74744,-1.59619,0}; dir = 360;}; class Object14 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {8.08838,0.415771,0}; dir = 90;}; class Object15 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-0.741333,0.101074,0}; dir = 0;}; class Object16 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {5.57434,0.704102,0}; dir = 315;}; class Object17 {side = 8; vehicle = "Land_GarbageWashingMachine_F"; rank = ""; position[] = {5.72815,0.505127,0}; dir = 315;}; class Object18 {side = 8; vehicle = "Land_Pneu"; rank = ""; position[] = {3.49756,-0.625977,0}; dir = 315;}; class Object19 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {1.74536,-3.89038,0}; dir = 180;}; class Object20 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {4.4552,-3.5083,0}; dir = 315;}; class Object21 {side = 8; vehicle = "Land_Pallets_F"; rank = ""; position[] = {0.268799,-4.75806,0}; dir = 120;}; class Object22 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {8.08838,3.54077,0}; dir = 90;}; class Object23 {side = 8; vehicle = "Wire"; rank = ""; position[] = {7.12646,11.0276,0}; dir = 225;}; class Object24 {side = 8; vehicle = "Wire"; rank = ""; position[] = {10.1821,4.40674,0}; dir = 270;}; class Object25 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {8.1178,4.81079,0}; dir = 270;}; class Object26 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {7.73206,6.96094,0}; dir = 225;}; class Object27 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {5.61353,7.50537,0}; dir = 180;}; }; class BunkerTower2_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_BunkerTower2_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_CamoNet_NATO"; rank = ""; position[] = {-7.82446,-0.14917,0}; dir = 270;}; class Object1 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-4.58801,-2.19287,0}; dir = 360;}; class Object2 {side = 8; vehicle = "Land_Sack_F"; rank = ""; position[] = {-0.381226,-6.12915,0}; dir = 270;}; class Object3 {side = 8; vehicle = "Land_Pallet_F"; rank = ""; position[] = {-1.50244,-7.50098,0}; dir = 224.332;}; class Object5 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {-5.29871,1.71606,0}; dir = 180;}; class Object6 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {-6.61011,-0.869385,0}; dir = 90;}; class Object7 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-6.23157,-1.75244,0}; dir = 45;}; class Object8 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-6.18176,1.33691,0}; dir = 135;}; class Object9 {side = 8; vehicle = "AmmoCrates_NoInteractive_Small"; rank = ""; position[] = {-0.900879,0.394531,0}; dir = 180;}; class Object10 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-0.631714,11.7646,0}; dir = 180;}; class Object11 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-8.60522,10.5686,0}; dir = 165;}; class Object12 {side = 8; vehicle = "Land_CamoNet_NATO"; rank = ""; position[] = {7.07446,1.02417,0}; dir = 90;}; class Object13 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {3.37793,-2.93091,0}; dir = 90;}; class Object14 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {0.0369873,-4.94287,0}; dir = 360;}; class Object15 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {1.53528,-6.8042,0}; dir = 0;}; class Object16 {side = 8; vehicle = "Land_Pallets_F"; rank = ""; position[] = {3.39954,-7.76099,0}; dir = 15;}; class Object17 {side = 8; vehicle = "Land_GarbagePallet_F"; rank = ""; position[] = {1.52246,-6.9126,0}; dir = 0;}; class Object18 {side = 8; vehicle = "Land_BagBunker_Tower_F"; rank = ""; position[] = {0.391968,4.01587,0}; dir = 90;}; class Object19 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {6.28687,-0.345947,0}; dir = 270;}; class Object20 {side = 8; vehicle = "Land_BagFenceEnd"; rank = ""; position[] = {4.97546,-2.93091,0}; dir = 1.36604e-005;}; class Object21 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {5.73352,-2.55273,0}; dir = 315;}; class Object22 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {5.90833,0.537598,0}; dir = 225;}; class Object23 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {1.75,-3.38843,0}; dir = 180;}; class Object24 {side = 8; vehicle = "Wire"; rank = ""; position[] = {7.23596,10.8401,0}; dir = 195;}; }; class BunkerTower3_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_BunkerTower3_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-2.38855,-6.10303,0}; dir = 180;}; class Object1 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-5.65039,-4.01196,0}; dir = 90;}; class Object2 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-5.65039,1.11304,0}; dir = 90;}; class Object3 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {-0.569946,-2.41455,0}; dir = 359.991;}; class Object4 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {-1.50232,-2.50098,0}; dir = 194.982;}; class Object5 {side = 8; vehicle = "CUP_A2_barels3"; rank = ""; position[] = {0.983398,-3.40649,0}; dir = 270;}; class Object7 {side = 8; vehicle = "Land_Pneu"; rank = ""; position[] = {-1.00244,-3.62598,0}; dir = 0;}; class Object8 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {-4.50244,-4.00098,0}; dir = 45;}; class Object9 {side = 8; vehicle = "Barrel3"; rank = ""; position[] = {-2.87744,-4.87598,0}; dir = 255;}; class Object10 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {1.12036,-6.64038,0}; dir = 180;}; class Object11 {side = 8; vehicle = "Land_CratesShabby_F"; rank = ""; position[] = {-4.01013,-4.74951,0}; dir = 90;}; class Object12 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-5.12415,5.42334,0}; dir = 135;}; class Object13 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-2.495,5.33154,0}; dir = 225;}; class Object14 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-5.61304,2.87183,0}; dir = 90;}; class Object15 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {4.34961,-2.26196,0}; dir = 90;}; class Object16 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {3.8302,-6.2583,0}; dir = 315;}; class Object17 {side = 8; vehicle = "Land_BagBunker_Tower_F"; rank = ""; position[] = {1.89197,1.01587,0}; dir = 90;}; class Object18 {side = 8; vehicle = "Barrel3"; rank = ""; position[] = {5.69629,-3.37451,0}; dir = 330;}; class Object19 {side = 8; vehicle = "Barrel3"; rank = ""; position[] = {5.62256,-2.62598,0}; dir = 180;}; }; class BunkerTower4_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_BunkerTower4_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_CamoNetVar_NATO"; rank = ""; position[] = {1.77625,-5.76245,0}; dir = 180;}; class Object1 {side = 8; vehicle = "Land_HBarrier_1_F"; rank = ""; position[] = {-5.09998,1.64478,0}; dir = 240;}; class Object2 {side = 8; vehicle = "Land_HBarrier_1_F"; rank = ""; position[] = {-3.4762,-8.98926,0}; dir = 315;}; class Object3 {side = 8; vehicle = "Land_HBarrier_1_F"; rank = ""; position[] = {0.643555,-4.97632,0}; dir = 180;}; class Object4 {side = 8; vehicle = "Land_HBarrier_1_F"; rank = ""; position[] = {-2.48865,-9.60693,0}; dir = 105;}; class Object5 {side = 8; vehicle = "Land_HBarrier_1_F"; rank = ""; position[] = {-5.6084,-6.60156,0}; dir = 165;}; class Object6 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-6.12939,-1.24487,0}; dir = 90;}; class Object7 {side = 8; vehicle = "Land_Sack_F"; rank = ""; position[] = {-0.249878,-4.15063,0}; dir = 195;}; class Object8 {side = 8; vehicle = "Land_Pallet_F"; rank = ""; position[] = {-1,-11.75,0}; dir = 74.332;}; class Object9 {side = 8; vehicle = "Land_Pallets_F"; rank = ""; position[] = {-5.15637,-11.5222,0}; dir = 15;}; class Object11 {side = 8; vehicle = "Land_Pallets_stack_F"; rank = ""; position[] = {0.020874,-2.95703,0}; dir = 89.9331;}; class Object12 {side = 8; vehicle = "Barrel3"; rank = ""; position[] = {-0.6875,-4.80591,0}; dir = 285;}; class Object13 {side = 8; vehicle = "Barrel3"; rank = ""; position[] = {-1.16187,-4.16113,0}; dir = 135;}; class Object14 {side = 8; vehicle = "Barrel3"; rank = ""; position[] = {-1.42065,-5.12695,0}; dir = 300;}; class Object15 {side = 8; vehicle = "AmmoCrates_NoInteractive_Small"; rank = ""; position[] = {-1.35693,-2.97754,0}; dir = 270;}; class Object16 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-4.28259,8.18457,0}; dir = 180;}; class Object17 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {4.00745,-8.58594,0}; dir = 180;}; class Object18 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {4.74561,-2.36987,0}; dir = 90;}; class Object19 {side = 8; vehicle = "Land_BagBunker_Tower_F"; rank = ""; position[] = {2.26697,0.890869,0}; dir = 90;}; class Object20 {side = 8; vehicle = "Land_Pallets_F"; rank = ""; position[] = {5.8938,-3.00806,0}; dir = 120;}; class Object21 {side = 8; vehicle = "Wire"; rank = ""; position[] = {11.0887,4.34692,0}; dir = 210;}; class Object22 {side = 8; vehicle = "Wire"; rank = ""; position[] = {3.72864,7.27612,0}; dir = 195;}; }; class BunkerTower5_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_BunkerTower5_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object1 {side = 8; vehicle = "Land_BarrelTrash_F"; rank = ""; position[] = {1.87244,-1.75098,0}; dir = 359.973;}; class Object2 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {-5.5127,2.8208,0}; dir = 270;}; class Object3 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {-5.56445,-3.3374,0}; dir = 180;}; class Object4 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {-5.5155,1.03735,0}; dir = 270;}; class Object5 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {-3.78101,-3.34033,0}; dir = 180;}; class Object6 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-3.39478,2.79272,0}; dir = 360;}; class Object7 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-5.50757,-1.34888,0}; dir = 90;}; class Object8 {side = 8; vehicle = "CUP_hromada_beden_dekorativniX"; rank = ""; position[] = {-0.127441,-2.62598,0}; dir = 15;}; class Object9 {side = 8; vehicle = "Land_CamoNet_NATO"; rank = ""; position[] = {3.02417,-3.94946,0}; dir = 180;}; class Object10 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {8.41003,-2.05444,0}; dir = 0;}; class Object11 {side = 8; vehicle = "Land_Pallet_F"; rank = ""; position[] = {7.73877,-4.27905,0}; dir = 223.724;}; class Object12 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {5.99756,-2.75098,0}; dir = 60.003;}; class Object13 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {5.37903,-2.13232,0}; dir = 150.013;}; class Object14 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {6.52502,-1.95581,0}; dir = 225.005;}; class Object15 {side = 8; vehicle = "Land_GarbageBags_F"; rank = ""; position[] = {8.08252,-2.76587,0}; dir = 0;}; class Object16 {side = 8; vehicle = "Land_BagBunker_Tower_F"; rank = ""; position[] = {2.64197,1.64087,0}; dir = 90;}; class Object17 {side = 8; vehicle = "CUP_A2_barels3"; rank = ""; position[] = {8.6554,1.48584,0}; dir = 180;}; class Object18 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {11.1455,7.01904,0}; dir = 1.36604e-005;}; class Object19 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {9.36206,7.02197,0}; dir = 1.36604e-005;}; class Object20 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {4.9845,5.28735,0}; dir = 270;}; class Object21 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {11.1174,4.90112,0}; dir = 90;}; class Object22 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {6.97583,7.01392,0}; dir = 180;}; class Object23 {side = 8; vehicle = "Land_BagFenceCorner"; rank = ""; position[] = {4.9873,7.0708,0}; dir = 270;}; }; class BunkerTower6_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_BunkerTower6_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_HBarrier_1_F"; rank = ""; position[] = {-6.25049,1.25635,0}; dir = 195;}; class Object1 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-5.9314,-2.35449,0}; dir = 45;}; class Object3 {side = 8; vehicle = "Fort_Crate_wood"; rank = ""; position[] = {1.74915,-4.74927,0}; dir = 75;}; class Object4 {side = 8; vehicle = "Fort_Crate_wood"; rank = ""; position[] = {0.499512,-4.87476,0}; dir = 90;}; class Object5 {side = 8; vehicle = "Land_CratesShabby_F"; rank = ""; position[] = {0.754639,-4.00439,0}; dir = 285;}; class Object6 {side = 8; vehicle = "Land_BarrelSand_F"; rank = ""; position[] = {-0.502563,-4.87598,0}; dir = 359.973;}; class Object7 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-6.63354,4.86255,0}; dir = 165;}; class Object8 {side = 8; vehicle = "Wire"; rank = ""; position[] = {1.33997,6.05859,0}; dir = 180;}; class Object9 {side = 8; vehicle = "Land_HBarrier_1_F"; rank = ""; position[] = {-3.38464,3.62207,0}; dir = 75;}; class Object10 {side = 8; vehicle = "Land_CamoNet_NATO"; rank = ""; position[] = {1.89917,-3.82446,0}; dir = 180;}; class Object11 {side = 8; vehicle = "Land_HBarrier_1_F"; rank = ""; position[] = {10.9995,0.866699,0}; dir = 345;}; class Object12 {side = 8; vehicle = "Hedgehog"; rank = ""; position[] = {9.96631,-4.9126,0}; dir = 120;}; class Object13 {side = 8; vehicle = "Hedgehog"; rank = ""; position[] = {11.3359,-3.84473,0}; dir = 210;}; class Object14 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {6.75867,2.97607,0}; dir = 1.36604e-005;}; class Object15 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {8.1012,-3.92993,0}; dir = 315;}; class Object16 {side = 8; vehicle = "Land_HBarrier_Big_F"; rank = ""; position[] = {2.03284,-6.4187,0}; dir = 180;}; class Object17 {side = 8; vehicle = "Land_GarbageBags_F"; rank = ""; position[] = {3.70752,-5.14087,0}; dir = 0;}; class Object18 {side = 8; vehicle = "Land_BagBunker_Tower_F"; rank = ""; position[] = {1.89197,2.14087,0}; dir = 90;}; class Object19 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {4.03503,-4.42944,0}; dir = 0;}; class Object20 {side = 8; vehicle = "Land_Pallets_stack_F"; rank = ""; position[] = {10.505,2.86548,0}; dir = 359.855;}; class Object21 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {7.91919,1.43506,0}; dir = 0;}; class Object22 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {7.24756,1.74902,0}; dir = 0;}; class Object23 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {7.14941,1.03125,0}; dir = 105;}; class Object24 {side = 8; vehicle = "Wire"; rank = ""; position[] = {9.20764,5.13403,0}; dir = 195;}; }; class BunkerTower7_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_BunkerTower7_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_CamoNet_NATO"; rank = ""; position[] = {-5.07446,2.97583,0}; dir = 270;}; class Object2 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {-5.00891,6.23999,0}; dir = 90;}; class Object3 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {-0.620972,1.63306,0}; dir = 270;}; class Object4 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {-2.49341,3.74268,0}; dir = 360;}; class Object5 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-4.63489,4.1665,0}; dir = 45;}; class Object6 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-0.259888,-0.458496,0}; dir = 45;}; class Object7 {side = 8; vehicle = "CUP_hromada_beden_dekorativniX"; rank = ""; position[] = {0.622559,0.749023,0}; dir = 6.83019e-006;}; class Object8 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {1.13159,13.4927,0}; dir = 360;}; class Object9 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-1.9198,10.7417,0}; dir = 315;}; class Object10 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-4.58508,10.0063,0}; dir = 135;}; class Object11 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-0.960083,13.1313,0}; dir = 135;}; class Object12 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {-4.99597,8.00806,0}; dir = 270;}; class Object13 {side = 8; vehicle = "Land_Sack_F"; rank = ""; position[] = {8.26355,1.90698,0}; dir = 150;}; class Object14 {side = 8; vehicle = "Land_BagBunker_Tower_F"; rank = ""; position[] = {2.51697,5.14087,0}; dir = 90;}; class Object15 {side = 8; vehicle = "Fort_Crate_wood"; rank = ""; position[] = {7.37451,1.50024,0}; dir = 90;}; class Object16 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {6.50403,1.75806,0}; dir = 270;}; class Object17 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {6.0802,-0.383301,0}; dir = 315;}; class Object18 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {3.41492,-1.11914,0}; dir = 135;}; class Object19 {side = 8; vehicle = "Land_CratesWooden_F"; rank = ""; position[] = {8.12256,3.37402,0}; dir = 270;}; class Object20 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {3.86511,10.4165,0}; dir = 45;}; class Object21 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {3.13,13.0815,0}; dir = 225;}; class Object22 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {6.255,9.45654,0}; dir = 225;}; }; class BunkerTower8_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_BunkerTower8_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-3.18701,2.96631,0}; dir = 90;}; class Object2 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {-1.62097,-0.241943,0}; dir = 270;}; class Object3 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-1.25989,-2.3335,0}; dir = 45;}; class Object4 {side = 8; vehicle = "CUP_hromada_beden_dekorativniX"; rank = ""; position[] = {-0.377441,-0.750977,0}; dir = 0;}; class Object5 {side = 8; vehicle = "Land_BagBunker_Tower_F"; rank = ""; position[] = {2.26697,3.51587,0}; dir = 90;}; class Object6 {side = 8; vehicle = "Land_BarrelTrash_F"; rank = ""; position[] = {8.49744,-1.12598,0}; dir = 359.973;}; class Object7 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {6.60815,-0.623779,0}; dir = 270;}; class Object8 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {3.62036,-3.76538,0}; dir = 180;}; class Object9 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {10.262,2.99683,0}; dir = 90;}; class Object10 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {6.2052,-3.3833,0}; dir = 315;}; class Object11 {side = 8; vehicle = "CUP_A2_barels3"; rank = ""; position[] = {7.54407,0.547363,0}; dir = 75;}; class Object12 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {7.59924,-1.15576,0}; dir = 210.007;}; class Object13 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {7.37268,-2.00098,0}; dir = 120.001;}; class Object14 {side = 8; vehicle = "Wire"; rank = ""; position[] = {2.08997,7.18359,0}; dir = 180;}; class Object15 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {9.85706,5.71094,0}; dir = 225;}; class Object16 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {7.73853,6.25537,0}; dir = 180;}; }; class BunkerTower9_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_BunkerTower9_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {-0.836548,0.318604,0}; dir = 134.981;}; class Object1 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {-0.930176,1.01807,0}; dir = 254.969;}; class Object2 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {-0.164185,1.06396,0}; dir = 344.975;}; class Object4 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-1.61304,0.371338,0}; dir = 90;}; class Object5 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-1.23694,-2.33838,0}; dir = 45;}; class Object6 {side = 8; vehicle = "CUP_hromada_beden_dekorativniX"; rank = ""; position[] = {-0.752441,-1.00098,0}; dir = 90;}; class Object7 {side = 8; vehicle = "Land_BagBunker_Tower_F"; rank = ""; position[] = {2.26697,4.64038,0}; dir = 90;}; class Object8 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {3.86353,-2.74512,0}; dir = 180;}; class Object9 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {6.35815,0.375732,0}; dir = 270;}; class Object10 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {5.95569,-2.3833,0}; dir = 315;}; class Object11 {side = 8; vehicle = "Land_CamoNetVar_NATO"; rank = ""; position[] = {2.47375,-2.36255,0}; dir = 0;}; class Object12 {side = 8; vehicle = "Land_BarrelTrash_F"; rank = ""; position[] = {5.49744,1.12402,0}; dir = 359.973;}; class Object13 {side = 8; vehicle = "Land_Pallet_F"; rank = ""; position[] = {8.24756,0.374023,0}; dir = 224.332;}; class Object14 {side = 8; vehicle = "Wire"; rank = ""; position[] = {2.33997,8.30811,0}; dir = 180;}; }; class CargoPost1_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_CargoPost1_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-6.40039,-1.63696,0}; dir = 90;}; class Object1 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-6.61633,-5.14893,0}; dir = 0;}; class Object2 {side = 8; vehicle = "Land_Pneu"; rank = ""; position[] = {-3.00244,-2.00098,0}; dir = 0;}; class Object3 {side = 8; vehicle = "Barrel2"; rank = ""; position[] = {-5.00244,-2.87598,0}; dir = 60;}; class Object4 {side = 8; vehicle = "Barrel2"; rank = ""; position[] = {-4.56494,-3.63379,0}; dir = 180;}; class Object5 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {-4.27661,-2.51099,0}; dir = 60;}; class Object6 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {-4.34058,-1.77222,0}; dir = 60;}; class Object7 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {-5.01123,-2.04614,0}; dir = 165;}; class Object8 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-6.40039,1.73804,0}; dir = 90;}; class Object9 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-4.38855,2.64697,0}; dir = 180;}; class Object10 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-2.71008,6.50635,0}; dir = 135;}; class Object11 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-3.10449,2.51001,0}; dir = 270;}; class Object12 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-3.36633,-5.14893,0}; dir = 0;}; class Object13 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-0.239868,-5.11279,0}; dir = 0;}; class Object14 {side = 8; vehicle = "Land_Pallets_F"; rank = ""; position[] = {-2.53137,-4.14722,0}; dir = 15;}; class Object16 {side = 8; vehicle = "Land_Cargo_Patrol_V1_F"; rank = ""; position[] = {-2.37463,-0.00415039,0}; dir = 180;}; class Object17 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {5.88159,-5.25732,0}; dir = 0;}; class Object18 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {3.62476,-5.23657,0}; dir = 0;}; class Object19 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {7.9552,-4.8833,0}; dir = 315;}; class Object20 {side = 8; vehicle = "AmmoCrates_NoInteractive_Small"; rank = ""; position[] = {-0.604004,-3.77148,0}; dir = 360;}; class Object21 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {4.02051,1.13501,0}; dir = 270;}; class Object22 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {4.23645,4.52197,0}; dir = 180;}; class Object23 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-0.125244,6.88843,0}; dir = 0;}; class Object24 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {6.12476,4.51343,0}; dir = 0;}; class Object25 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {8.63,3.95654,0}; dir = 225;}; class Object26 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {8.99109,1.86499,0}; dir = 90;}; class Object27 {side = 8; vehicle = "Misc_concrete_High"; rank = ""; position[] = {2.12256,2.12402,0}; dir = 180;}; }; class CargoPost2_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_CargoPost2_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {-5.5835,-2.75415,0}; dir = 240;}; class Object1 {side = 8; vehicle = "Land_Sack_F"; rank = ""; position[] = {-3.75281,-0.130859,0}; dir = 225;}; class Object2 {side = 8; vehicle = "Land_CratesShabby_F"; rank = ""; position[] = {-3.7113,2.20508,0}; dir = 270;}; class Object3 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {-2.75256,1.12402,0}; dir = 195.006;}; class Object4 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {-2.50232,0.249023,0}; dir = 285.002;}; class Object5 {side = 8; vehicle = "Land_PaperBox_open_full_F"; rank = ""; position[] = {-4.11829,0.999023,0}; dir = 270;}; class Object6 {side = 8; vehicle = "Land_GarbagePallet_F"; rank = ""; position[] = {-5.48315,-2.71118,0}; dir = 240;}; class Object7 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-4.12524,-4.73657,0}; dir = 0;}; class Object8 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-7.11304,-1.75317,0}; dir = 90;}; class Object9 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-7.11304,1.12183,0}; dir = 90;}; class Object10 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-6.75989,-4.3335,0}; dir = 45;}; class Object11 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-6.58508,3.88135,0}; dir = 135;}; class Object12 {side = 8; vehicle = "Land_CratesShabby_F"; rank = ""; position[] = {-4.53784,2.5437,0}; dir = 180;}; class Object13 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-4.61304,6.24683,0}; dir = 90;}; class Object14 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-4.08508,9.00635,0}; dir = 135;}; class Object15 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-2.63855,4.14697,0}; dir = 180;}; class Object16 {side = 8; vehicle = "Hedgehog"; rank = ""; position[] = {5.81531,-4.01636,0}; dir = 105;}; class Object17 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {4.47461,2.23804,0}; dir = 90;}; class Object19 {side = 8; vehicle = "Land_Cargo_Patrol_V1_F"; rank = ""; position[] = {-2.37463,3.87085,0}; dir = 180;}; class Object20 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {1.98853,-4.86963,0}; dir = 180;}; class Object21 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {-1.86841,-4.75732,0}; dir = 0;}; class Object22 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {4.51196,-2.00317,0}; dir = 90;}; class Object23 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {3.9552,-4.5083,0}; dir = 315;}; class Object24 {side = 8; vehicle = "Hedgehog"; rank = ""; position[] = {6.10718,-1.9436,0}; dir = 195;}; class Object25 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {4.47461,5.48804,0}; dir = 90;}; class Object26 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {0.61145,4.14697,0}; dir = 180;}; class Object27 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {4.49109,6.73999,0}; dir = 90;}; class Object28 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-1.24585,9.41089,0}; dir = 0;}; class Object29 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {1.62476,9.38843,0}; dir = 0;}; class Object30 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {4.13,8.83154,0}; dir = 225;}; class Object31 {side = 8; vehicle = "Land_Pallets_F"; rank = ""; position[] = {-1.78137,5.47778,0}; dir = 15;}; }; class CargoPost3_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_CargoPost3_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {-2.5033,-1.51367,0}; dir = 195;}; class Object1 {side = 8; vehicle = "Fort_Crate_wood"; rank = ""; position[] = {-2.25439,-3.37476,0}; dir = 330;}; class Object2 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-1.87524,-4.36157,0}; dir = 0;}; class Object3 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-4.86304,-1.37817,0}; dir = 90;}; class Object4 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-4.50989,-3.9585,0}; dir = 45;}; class Object5 {side = 8; vehicle = "Land_Sack_F"; rank = ""; position[] = {-3.0033,-2.74609,0}; dir = 30;}; class Object6 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-2.88855,4.14697,0}; dir = 180;}; class Object7 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-4.90039,2.98804,0}; dir = 90;}; class Object8 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {-1.61841,4.11768,0}; dir = 0;}; class Object9 {side = 8; vehicle = "Land_CratesWooden_F"; rank = ""; position[] = {-3.25244,1.24902,0}; dir = 270;}; class Object10 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {4.8584,-1.17334,0}; dir = 255;}; class Object11 {side = 8; vehicle = "Land_Pallet_F"; rank = ""; position[] = {5.62256,-4.75098,0}; dir = 284.332;}; class Object12 {side = 8; vehicle = "Land_Cargo_Patrol_V2_F"; rank = ""; position[] = {-0.874634,0.87085,0}; dir = 180;}; class Object14 {side = 8; vehicle = "Land_GarbageWashingMachine_F"; rank = ""; position[] = {5.10767,-1.13965,0}; dir = 255;}; class Object15 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {3.87891,-3.86963,0}; dir = 105;}; class Object16 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {4.49756,-3.25098,0}; dir = 0;}; class Object17 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {3.63696,-1.37817,0}; dir = 90;}; class Object18 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {0.874756,-4.36157,0}; dir = 0;}; class Object19 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {3.2052,-4.0083,0}; dir = 315;}; class Object20 {side = 8; vehicle = "AmmoCrates_NoInteractive_Small"; rank = ""; position[] = {-1.01978,-2.57861,0}; dir = 105;}; class Object21 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {3.36145,3.89697,0}; dir = 180;}; class Object22 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {3.14551,0.51001,0}; dir = 270;}; class Object23 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {-0.136475,4.13037,0}; dir = 180;}; class Object24 {side = 8; vehicle = "Land_CratesShabby_F"; rank = ""; position[] = {1.99902,1.50684,0}; dir = 180;}; }; class CargoPost4_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_CargoPost4_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-2.61633,-5.39893,0}; dir = 0;}; class Object1 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-4.6814,-3.72949,0}; dir = 45;}; class Object2 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-4.90039,-1.13696,0}; dir = 90;}; class Object3 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-6.00635,-8.40454,0}; dir = 45;}; class Object4 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-9.06201,-1.78369,0}; dir = 90;}; class Object5 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {-2.13037,-1.78516,0}; dir = 105;}; class Object6 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {-1.75488,-3.86353,0}; dir = 0;}; class Object7 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-3.23108,4.05298,0}; dir = 135;}; class Object8 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-0.51355,4.14697,0}; dir = 180;}; class Object9 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-4.90039,2.11304,0}; dir = 90;}; class Object10 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-6.40601,5.00293,0}; dir = 135;}; class Object11 {side = 8; vehicle = "Land_Pallets_F"; rank = ""; position[] = {-1.7312,0.470215,0}; dir = 285;}; class Object12 {side = 8; vehicle = "Land_Cargo_Patrol_V1_F"; rank = ""; position[] = {-0.499634,0.74585,0}; dir = 180;}; class Object13 {side = 8; vehicle = "Land_PaperBox_open_empty_F"; rank = ""; position[] = {0.247925,-3.87598,0}; dir = 105;}; class Object14 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {0.863525,-5.36963,0}; dir = 180;}; class Object15 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {6.13696,-1.00317,0}; dir = 90;}; class Object16 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {3.35815,-2.49878,0}; dir = 270;}; class Object17 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {2.9552,-5.0083,0}; dir = 315;}; class Object19 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {-0.127441,-2.25098,0}; dir = 270;}; class Object20 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {0.997559,-2.62598,0}; dir = 15;}; class Object21 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {2.61145,4.14697,0}; dir = 180;}; class Object22 {side = 8; vehicle = "Wire"; rank = ""; position[] = {0.339966,7.93359,0}; dir = 180;}; class Object23 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {5.755,1.70654,0}; dir = 225;}; class Object24 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {3.77051,2.13501,0}; dir = 270;}; class Object25 {side = 8; vehicle = "Land_Pallet_F"; rank = ""; position[] = {5.74756,5.37402,0}; dir = 134.332;}; class Object26 {side = 8; vehicle = "Land_Pallets_stack_F"; rank = ""; position[] = {5.49756,3.37402,0}; dir = 269.999;}; }; class CargoPost5_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_CargoPost5_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {-1.27649,1.45142,0}; dir = 315;}; class Object1 {side = 8; vehicle = "Land_HBarrier_Big_F"; rank = ""; position[] = {-4.42004,1.33887,0}; dir = 270;}; class Object2 {side = 8; vehicle = "Land_Pallets_F"; rank = ""; position[] = {-6.9812,-2.63306,0}; dir = 120;}; class Object3 {side = 8; vehicle = "Land_GarbagePallet_F"; rank = ""; position[] = {-1.20898,1.36572,0}; dir = 315;}; class Object4 {side = 8; vehicle = "Land_Pneu"; rank = ""; position[] = {-1.70215,-3.99463,0}; dir = 285;}; class Object5 {side = 8; vehicle = "Land_Pallets_stack_F"; rank = ""; position[] = {-3.15442,-4.00562,0}; dir = 29.8841;}; class Object6 {side = 8; vehicle = "Land_PaperBox_open_empty_F"; rank = ""; position[] = {-1.75269,-2.00122,0}; dir = 225;}; class Object7 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-1.50024,-7.23657,0}; dir = 0;}; class Object8 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-4.51685,-4.12378,0}; dir = 270;}; class Object9 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-4.13489,-6.8335,0}; dir = 45;}; class Object10 {side = 8; vehicle = "AmmoCrates_NoInteractive_Medium"; rank = ""; position[] = {-1.01514,-8.10132,0}; dir = 90;}; class Object11 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-3.53503,6.80859,0}; dir = 180;}; class Object12 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-6.31201,1.59131,0}; dir = 90;}; class Object13 {side = 8; vehicle = "Land_HBarrier_Big_F"; rank = ""; position[] = {5.70496,1.46387,0}; dir = 270;}; class Object14 {side = 8; vehicle = "Land_Cargo_Patrol_V2_F"; rank = ""; position[] = {0.625366,0.74585,0}; dir = 180;}; class Object15 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {0.756592,-7.25732,0}; dir = 0;}; class Object16 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {2.8302,-6.8833,0}; dir = 315;}; class Object18 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {1.24756,-7.87598,0}; dir = 90;}; class Object19 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {0.861816,-8.50342,0}; dir = 15;}; class Object20 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {0.243164,-7.88477,0}; dir = 270;}; class Object21 {side = 8; vehicle = "Wire"; rank = ""; position[] = {4.21497,6.68359,0}; dir = 180;}; class Object22 {side = 8; vehicle = "Wire"; rank = ""; position[] = {7.68213,2.15674,0}; dir = 270;}; class Object23 {side = 8; vehicle = "Land_HBarrier_Big_F"; rank = ""; position[] = {0.58728,4.66675,0}; dir = 0;}; class Object24 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {0.660156,1.92798,0}; dir = 285;}; class Object25 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {1.35718,2.28442,0}; dir = 60;}; class Object26 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {1.29321,3.02295,0}; dir = 60;}; class Object27 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {0.622559,2.74902,0}; dir = 165;}; }; class CargoPost6_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_CargoPost6_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-5.10449,-0.73999,0}; dir = 270;}; class Object1 {side = 8; vehicle = "Land_Sacks_heap_F"; rank = ""; position[] = {-4.25244,-3.00098,0}; dir = 30;}; class Object2 {side = 8; vehicle = "Land_CratesShabby_F"; rank = ""; position[] = {-3.00098,-2.11816,0}; dir = 180;}; class Object3 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {-2.54504,-0.700439,0}; dir = 195;}; class Object4 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {-5.24158,-1.96948,0}; dir = 270;}; class Object5 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-2.37524,-4.61792,0}; dir = 180;}; class Object6 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-4.88049,-4.06104,0}; dir = 45;}; class Object7 {side = 8; vehicle = "Land_CratesShabby_F"; rank = ""; position[] = {-1.99463,-2.12524,0}; dir = 255;}; class Object8 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-5.10449,2.51001,0}; dir = 270;}; class Object9 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {-2.99292,2.50732,0}; dir = 60;}; class Object10 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {-1.24097,2.87964,0}; dir = 75;}; class Object12 {side = 8; vehicle = "Land_GarbageBags_F"; rank = ""; position[] = {4.58301,-0.015625,0}; dir = 0;}; class Object13 {side = 8; vehicle = "Land_Cargo_Patrol_V1_F"; rank = ""; position[] = {-0.874634,1.99585,0}; dir = 180;}; class Object14 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {0.499756,-4.61157,0}; dir = 0;}; class Object15 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {6.51196,-2.25317,0}; dir = 90;}; class Object16 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {6.51196,0.621826,0}; dir = 90;}; class Object17 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {4.91052,0.696045,0}; dir = 0;}; class Object18 {side = 8; vehicle = "Land_Pneu"; rank = ""; position[] = {5.62256,-1.12598,0}; dir = 0;}; class Object19 {side = 8; vehicle = "Land_Pallets_stack_F"; rank = ""; position[] = {-0.0258789,-1.72437,0}; dir = 359.999;}; class Object20 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {4.38367,2.72607,0}; dir = 0;}; class Object21 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {3.27051,2.51001,0}; dir = 270;}; class Object22 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-1.16003,6.68359,0}; dir = 180;}; class Object23 {side = 8; vehicle = "Land_HBarrier_Big_F"; rank = ""; position[] = {-0.91272,4.91675,0}; dir = 0;}; }; class CargoPost7_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_CargoPost7_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-4.22949,-0.36499,0}; dir = 270;}; class Object1 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-4.22949,2.63501,0}; dir = 270;}; class Object2 {side = 8; vehicle = "Land_Pallet_F"; rank = ""; position[] = {-6.12744,-1.62598,0}; dir = 224.332;}; class Object3 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {-1.72498,-0.330811,0}; dir = 225.005;}; class Object4 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {-2.87097,-0.507324,0}; dir = 150.013;}; class Object5 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {-2.25244,-1.12598,0}; dir = 60.004;}; class Object6 {side = 8; vehicle = "CUP_A2_barels3"; rank = ""; position[] = {-2.58093,2.79736,0}; dir = 75;}; class Object7 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {-2.74341,0.367676,0}; dir = 0;}; class Object8 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-0.6698,0.741699,0}; dir = 315;}; class Object9 {side = 8; vehicle = "CUP_A2_barels3"; rank = ""; position[] = {-4.33093,-1.82764,0}; dir = 75;}; class Object10 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-4.22949,5.63501,0}; dir = 270;}; class Object11 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-1.13855,7.77197,0}; dir = 180;}; class Object12 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-0.910034,9.43359,0}; dir = 180;}; class Object13 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-5.56201,5.46631,0}; dir = 90;}; class Object14 {side = 8; vehicle = "Land_GarbageBags_F"; rank = ""; position[] = {-2.54248,4.48413,0}; dir = 0;}; class Object15 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {-2.21497,5.19556,0}; dir = 0;}; class Object16 {side = 8; vehicle = "Land_Cargo_Patrol_V2_F"; rank = ""; position[] = {-0.249634,4.99585,0}; dir = 180;}; class Object17 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {6.60815,1.75122,0}; dir = 270;}; class Object18 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {3.24536,-1.39038,0}; dir = 180;}; class Object19 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {6.60815,4.50122,0}; dir = 270;}; class Object20 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {6.0802,-1.0083,0}; dir = 315;}; class Object22 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {4.86145,7.77197,0}; dir = 180;}; class Object23 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {1.86145,7.77197,0}; dir = 180;}; class Object24 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {6.255,7.08154,0}; dir = 225;}; class Object25 {side = 8; vehicle = "CUP_hromada_beden_dekorativniX"; rank = ""; position[] = {4.37256,5.74902,0}; dir = 15;}; class Object26 {side = 8; vehicle = "Land_BarrelTrash_F"; rank = ""; position[] = {2.99744,5.87402,0}; dir = 359.972;}; }; class CargoPost8_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_CargoPost8_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-4.48804,0.871826,0}; dir = 90;}; class Object1 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-4.13489,-1.7085,0}; dir = 45;}; class Object2 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-1.50024,-2.11157,0}; dir = 0;}; class Object3 {side = 8; vehicle = "Land_Pneu"; rank = ""; position[] = {-0.752441,0.374023,0}; dir = 0;}; class Object4 {side = 8; vehicle = "Land_Pallet_F"; rank = ""; position[] = {-1.12744,-4.12598,0}; dir = 194.332;}; class Object5 {side = 8; vehicle = "Barrels"; rank = ""; position[] = {-2.19873,0.86792,0}; dir = 105;}; class Object6 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-1.12085,6.78589,0}; dir = 0;}; class Object7 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-3.96008,6.38086,0}; dir = 135;}; class Object8 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-4.48804,3.62183,0}; dir = 90;}; class Object9 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {-2.75244,5.99902,0}; dir = 270;}; class Object10 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {-1.74805,6.00781,0}; dir = 90;}; class Object11 {side = 8; vehicle = "Land_Pallet_F"; rank = ""; position[] = {-2.25244,8.24902,0}; dir = 104.332;}; class Object12 {side = 8; vehicle = "Land_Cargo_Patrol_V1_F"; rank = ""; position[] = {-0.499634,3.37085,0}; dir = 180;}; class Object13 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {0.756592,-2.13232,0}; dir = 0;}; class Object14 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {2.8302,-1.7583,0}; dir = 315;}; class Object16 {side = 8; vehicle = "Land_BarrelWater_F"; rank = ""; position[] = {1.12244,-3.00098,0}; dir = 359.973;}; class Object17 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {0.329834,-3.38037,0}; dir = 360;}; class Object18 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {0.957275,-3.76611,0}; dir = 285;}; class Object19 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {0.338623,-4.38477,0}; dir = 180;}; class Object20 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {1.74976,6.76294,0}; dir = 0;}; class Object21 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {4.255,6.20654,0}; dir = 225;}; class Object22 {side = 8; vehicle = "Land_BagFenceShort"; rank = ""; position[] = {4.61609,4.11499,0}; dir = 90;}; }; class CargoPost9_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_CargoPost9_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_HBarrier_Big_F"; rank = ""; position[] = {-0.91272,-1.20874,0}; dir = 0;}; class Object1 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {-2.3783,2.23633,0}; dir = 195;}; class Object2 {side = 8; vehicle = "Land_Pallets_stack_F"; rank = ""; position[] = {-4.12744,2.62402,0}; dir = 194.999;}; class Object3 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-9.61304,1.87134,0}; dir = 90;}; class Object4 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-6.50024,-1.11206,0}; dir = 0;}; class Object5 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-9.25989,-0.708984,0}; dir = 45;}; class Object6 {side = 8; vehicle = "AmmoCrates_NoInteractive_Large"; rank = ""; position[] = {-4.49683,1.03979,0}; dir = 270;}; class Object7 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-5.28503,9.68311,0}; dir = 180;}; class Object8 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-9.66138,4.72583,0}; dir = 90;}; class Object9 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-6.42798,7.71362,0}; dir = 180;}; class Object10 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-9.21008,7.38086,0}; dir = 135;}; class Object11 {side = 8; vehicle = "Land_HBarrier_Big_F"; rank = ""; position[] = {-1.03772,7.79126,0}; dir = 0;}; class Object12 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {1.04932,1.1106,0}; dir = 60;}; class Object14 {side = 8; vehicle = "Land_GarbageBags_F"; rank = ""; position[] = {0.269287,1.03833,0}; dir = 60;}; class Object15 {side = 8; vehicle = "Land_Pneu"; rank = ""; position[] = {3.74756,0.749023,0}; dir = 0;}; class Object16 {side = 8; vehicle = "Land_Cargo_Patrol_V1_F"; rank = ""; position[] = {-0.499634,4.49536,0}; dir = 180;}; class Object17 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {7.73315,4.50073,0}; dir = 270;}; class Object18 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {4.62036,-1.26587,0}; dir = 180;}; class Object19 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {7.73315,1.75073,0}; dir = 270;}; class Object20 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {7.3302,-0.883789,0}; dir = 315;}; class Object21 {side = 8; vehicle = "Land_Pallets_F"; rank = ""; position[] = {3.7688,-2.13306,0}; dir = 120;}; class Object22 {side = 8; vehicle = "Wire"; rank = ""; position[] = {2.71497,9.68311,0}; dir = 180;}; class Object23 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {7.38,7.20605,0}; dir = 225;}; class Object24 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {4.62036,7.60913,0}; dir = 180;}; class Object25 {side = 8; vehicle = "Land_Pallets_stack_F"; rank = ""; position[] = {3.99756,6.24902,0}; dir = 315;}; }; class Watchtower1_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_Watchtower1_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-2.77539,-1.26196,0}; dir = 90;}; class Object1 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-4.68701,1.84131,0}; dir = 90;}; class Object2 {side = 8; vehicle = "Land_Pallet_vertical_F"; rank = ""; position[] = {-3.87866,-2.00098,0}; dir = 269.998;}; class Object3 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-2.86304,-5.37817,0}; dir = 90;}; class Object4 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-2.50989,-8.0835,0}; dir = 45;}; class Object5 {side = 8; vehicle = "Land_Sacks_heap_F"; rank = ""; position[] = {-4.75244,-1.50098,0}; dir = 105;}; class Object6 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {-4.00244,-3.25098,0}; dir = 0;}; class Object7 {side = 8; vehicle = "Land_Pallet_F"; rank = ""; position[] = {-6.00244,-3.50098,0}; dir = 224.332;}; class Object8 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {2.09961,-1.26196,0}; dir = 90;}; class Object9 {side = 8; vehicle = "Land_Sack_F"; rank = ""; position[] = {3.84937,-2.6394,0}; dir = 240;}; class Object10 {side = 8; vehicle = "Land_Sack_F"; rank = ""; position[] = {3.23071,-2.72778,0}; dir = 240;}; class Object12 {side = 8; vehicle = "Land_HBarrierTower_F"; rank = ""; position[] = {-0.62793,0.972412,0}; dir = 180;}; class Object13 {side = 8; vehicle = "Land_Sack_EP1"; rank = ""; position[] = {3.67432,-3.16528,0}; dir = 30;}; class Object14 {side = 8; vehicle = "Fort_Crate_wood"; rank = ""; position[] = {3.49866,-1.75293,0}; dir = 180;}; class Object15 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {0.249756,-8.48706,0}; dir = 0;}; class Object16 {side = 8; vehicle = "AmmoCrates_NoInteractive_Small"; rank = ""; position[] = {3.48022,-4.07861,0}; dir = 105;}; class Object17 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-0.535034,6.05859,0}; dir = 180;}; class Object18 {side = 8; vehicle = "Wire"; rank = ""; position[] = {3.80713,2.53174,0}; dir = 270;}; }; class Watchtower2_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_Watchtower2_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {-4.55884,-1.95776,0}; dir = 30;}; class Object1 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {-4.875,0.236572,0}; dir = 180;}; class Object2 {side = 8; vehicle = "Land_GarbagePallet_F"; rank = ""; position[] = {-4.62415,-2.04517,0}; dir = 30;}; class Object3 {side = 8; vehicle = "Land_Pneu"; rank = ""; position[] = {-2.50806,-3.08032,0}; dir = 30;}; class Object4 {side = 8; vehicle = "Barrel2"; rank = ""; position[] = {-4.62744,3.24902,0}; dir = 120;}; class Object5 {side = 8; vehicle = "Barrel2"; rank = ""; position[] = {-4.62744,2.49902,0}; dir = 75;}; class Object6 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-3.73804,1.49683,0}; dir = 90;}; class Object7 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-3.38489,-1.2085,0}; dir = 45;}; class Object8 {side = 8; vehicle = "Land_Pallets_F"; rank = ""; position[] = {-6.53137,1.10278,0}; dir = 15;}; class Object9 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-5.06787,7.15674,0}; dir = 270;}; class Object10 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {6.97461,2.73804,0}; dir = 90;}; class Object11 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {1.59961,2.48804,0}; dir = 90;}; class Object13 {side = 8; vehicle = "Land_HBarrierTower_F"; rank = ""; position[] = {-0.62793,4.84741,0}; dir = 180;}; class Object14 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {1.99756,-0.750977,0}; dir = 75;}; class Object15 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {1.86816,-1.48096,0}; dir = 75;}; class Object16 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {1.27905,-0.841797,0}; dir = 180;}; class Object17 {side = 8; vehicle = "Misc_concrete_High"; rank = ""; position[] = {8.99756,1.49902,0}; dir = 360;}; class Object18 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {6.88696,-1.37817,0}; dir = 90;}; class Object19 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {3.6731,-4.21606,0}; dir = 0;}; class Object20 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {6.98315,4.00122,0}; dir = 270;}; class Object21 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {0.995361,-4.26538,0}; dir = 180;}; class Object22 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {6.4552,-3.8833,0}; dir = 315;}; class Object23 {side = 8; vehicle = "AmmoCrates_NoInteractive_Small"; rank = ""; position[] = {2.85522,-0.703613,0}; dir = 105;}; class Object24 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-0.660034,10.3086,0}; dir = 180;}; class Object25 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {6.63,6.70654,0}; dir = 225;}; class Object26 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {3.87036,7.10962,0}; dir = 180;}; }; class Watchtower3_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_Watchtower3_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_CamoNet_NATO"; rank = ""; position[] = {-1.97583,-7.57446,0}; dir = 180;}; class Object1 {side = 8; vehicle = "Hedgehog"; rank = ""; position[] = {-4.93469,2.73364,0}; dir = 105;}; class Object2 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-3.36633,-5.39893,0}; dir = 0;}; class Object3 {side = 8; vehicle = "Land_Sack_F"; rank = ""; position[] = {0.620117,-4.27515,0}; dir = 240;}; class Object4 {side = 8; vehicle = "Land_Sack_F"; rank = ""; position[] = {0.122192,-4.25415,0}; dir = 255;}; class Object5 {side = 8; vehicle = "Land_CratesShabby_F"; rank = ""; position[] = {-1.70544,-0.670166,0}; dir = 90;}; class Object6 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {-2.45984,-1.24194,0}; dir = 135.008;}; class Object7 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {-1.57703,-1.46289,0}; dir = 225.005;}; class Object8 {side = 8; vehicle = "Land_PaperBox_open_full_F"; rank = ""; position[] = {-4.13635,-3.87817,0}; dir = 75;}; class Object10 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-8.61304,-2.25317,0}; dir = 90;}; class Object11 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-5.50024,-5.36206,0}; dir = 0;}; class Object12 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-5.37524,0.763428,0}; dir = 0;}; class Object13 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-8.16174,0.401855,0}; dir = 135;}; class Object14 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-8.25989,-4.9585,0}; dir = 45;}; class Object15 {side = 8; vehicle = "Land_CratesShabby_F"; rank = ""; position[] = {-0.878906,-1.00879,0}; dir = 360;}; class Object16 {side = 8; vehicle = "Hedgehog"; rank = ""; position[] = {-3.88818,4.11963,0}; dir = 195;}; class Object17 {side = 8; vehicle = "Land_Pallets_F"; rank = ""; position[] = {-3.11975,6.75879,0}; dir = 240;}; class Object18 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {3.09961,-3.38696,0}; dir = 90;}; class Object19 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {3.09961,-0.386963,0}; dir = 90;}; class Object20 {side = 8; vehicle = "Land_HBarrierTower_F"; rank = ""; position[] = {0.87207,1.84741,0}; dir = 180;}; class Object21 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-0.241333,-5.39893,0}; dir = 0;}; class Object22 {side = 8; vehicle = "Wire"; rank = ""; position[] = {5.05713,3.65674,0}; dir = 270;}; class Object23 {side = 8; vehicle = "Wire"; rank = ""; position[] = {0.714966,7.18359,0}; dir = 180;}; }; class Watchtower4_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_Watchtower4_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-2.60364,-3.33887,0}; dir = 30;}; class Object1 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-0.116333,-4.64893,0}; dir = 3.41509e-006;}; class Object2 {side = 8; vehicle = "Land_Sacks_heap_F"; rank = ""; position[] = {-0.502441,0.874023,0}; dir = 135;}; class Object4 {side = 8; vehicle = "Land_Pneu"; rank = ""; position[] = {0.872559,0.499023,0}; dir = 0;}; class Object5 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {-1.97339,0.366211,0}; dir = 345;}; class Object6 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {-2.65112,0.880127,0}; dir = 120;}; class Object7 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-4.24341,-2.3645,0}; dir = 30;}; class Object8 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-6.31689,-0.64624,0}; dir = 75;}; class Object9 {side = 8; vehicle = "Land_CratesShabby_F"; rank = ""; position[] = {-1.74536,1.24561,0}; dir = 285;}; class Object10 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-3.18701,4.96631,0}; dir = 90;}; class Object11 {side = 8; vehicle = "Land_HBarrierTower_F"; rank = ""; position[] = {1.12207,3.59741,0}; dir = 180;}; class Object12 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {2.79431,-4.45288,0}; dir = 330;}; class Object13 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {4.94434,-5.53857,0}; dir = 90;}; class Object14 {side = 8; vehicle = "Land_GarbageBags_F"; rank = ""; position[] = {4.23254,-5.21094,0}; dir = 90;}; class Object15 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {5.25024,-1.73584,0}; dir = 270;}; class Object16 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {4.80835,-0.94043,0}; dir = 15;}; class Object17 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {6.36719,-2.2373,0}; dir = 330;}; class Object18 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {8.61023,-0.558594,0}; dir = 285;}; class Object19 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {2.25317,-2.88745,0}; dir = 165;}; class Object20 {side = 8; vehicle = "Land_Pallets_stack_F"; rank = ""; position[] = {3.74756,-2.00098,0}; dir = 149.999;}; class Object21 {side = 8; vehicle = "Wire"; rank = ""; position[] = {5.30713,5.65674,0}; dir = 270;}; class Object22 {side = 8; vehicle = "Wire"; rank = ""; position[] = {0.964966,9.18359,0}; dir = 180;}; }; class Watchtower5_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_Watchtower5_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-0.650391,0.113037,0}; dir = 90;}; class Object1 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-0.650391,-3.13696,0}; dir = 90;}; class Object2 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-2.68701,-3.40869,0}; dir = 90;}; class Object3 {side = 8; vehicle = "Land_Sack_F"; rank = ""; position[] = {0.00195313,-6.21924,0}; dir = 240;}; class Object5 {side = 8; vehicle = "Land_Pallet_vertical_F"; rank = ""; position[] = {0.371338,-4.25098,0}; dir = 269.997;}; class Object6 {side = 8; vehicle = "Fort_Crate_wood"; rank = ""; position[] = {1.08069,-4.42969,0}; dir = 180;}; class Object7 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-0.259888,-7.2085,0}; dir = 45;}; class Object8 {side = 8; vehicle = "Land_Sack_F"; rank = ""; position[] = {0.49585,-5.75562,0}; dir = 240;}; class Object9 {side = 8; vehicle = "Land_Sack_EP1"; rank = ""; position[] = {0.445801,-6.65649,0}; dir = 30;}; class Object10 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {0.902832,-3.36719,0}; dir = 315;}; class Object11 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-2.68701,4.21631,0}; dir = 90;}; class Object12 {side = 8; vehicle = "AmmoCrates_NoInteractive_Medium"; rank = ""; position[] = {3.23486,0.0236816,0}; dir = 90;}; class Object13 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {5.13367,1.72607,0}; dir = 0;}; class Object14 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {5.77014,0.0163574,0}; dir = 0;}; class Object15 {side = 8; vehicle = "Land_Sacks_heap_F"; rank = ""; position[] = {7.87256,0.249023,0}; dir = 105;}; class Object16 {side = 8; vehicle = "Land_GarbageWashingMachine_F"; rank = ""; position[] = {5.73816,-0.23291,0}; dir = 0;}; class Object17 {side = 8; vehicle = "Land_HBarrierTower_F"; rank = ""; position[] = {1.62207,2.47241,0}; dir = 180;}; class Object18 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {9.48315,-1.49878,0}; dir = 270;}; class Object19 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {6.24536,-4.51538,0}; dir = 180;}; class Object20 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {2.49976,-7.61157,0}; dir = 0;}; class Object21 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {9.03186,-4.1543,0}; dir = 315;}; class Object22 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {9.13,1.20654,0}; dir = 225;}; class Object23 {side = 8; vehicle = "AmmoCrates_NoInteractive_Small"; rank = ""; position[] = {6.021,-3.77148,0}; dir = 360;}; class Object24 {side = 8; vehicle = "Wire"; rank = ""; position[] = {1.46497,7.93359,0}; dir = 180;}; class Object25 {side = 8; vehicle = "Land_Pallet_F"; rank = ""; position[] = {8.49756,4.99902,0}; dir = 224.332;}; }; class Watchtower6_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_Watchtower6_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_CamoNet_NATO"; rank = ""; position[] = {-8.50439,-1.41064,0}; dir = 150;}; class Object1 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-9.20569,1.92212,0}; dir = 330;}; class Object2 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {-7.50562,0.580078,0}; dir = 330;}; class Object4 {side = 8; vehicle = "Land_GarbagePallet_F"; rank = ""; position[] = {-7.46252,0.479736,0}; dir = 330;}; class Object5 {side = 8; vehicle = "Land_Pneu"; rank = ""; position[] = {-4.50244,1.87402,0}; dir = 330;}; class Object6 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {-6.03125,2.8938,0}; dir = 195;}; class Object7 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {-5.31348,2.79565,0}; dir = 90;}; class Object8 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {-5.62744,2.12402,0}; dir = 90;}; class Object9 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {-6.40942,2.16382,0}; dir = 282.378;}; class Object10 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-9.49915,-1.90723,0}; dir = 60;}; class Object11 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-5.24951,-3.04248,0}; dir = 330;}; class Object12 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-5.63281,4.0127,0}; dir = 330;}; class Object13 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-7.84082,-4.07373,0}; dir = 15;}; class Object14 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-10.4359,0.618164,0}; dir = 105;}; class Object15 {side = 8; vehicle = "Land_Pallets_F"; rank = ""; position[] = {-6.10217,0.866211,0}; dir = 90;}; class Object16 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-6.96448,10.801,0}; dir = 150;}; class Object17 {side = 8; vehicle = "Wire"; rank = ""; position[] = {0.339966,12.9336,0}; dir = 180;}; class Object18 {side = 8; vehicle = "Land_HBarrierTower_F"; rank = ""; position[] = {0.556152,4.927,0}; dir = 180;}; class Object19 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-3.2583,4.80762,0}; dir = 195;}; class Object20 {side = 8; vehicle = "Land_CamoNet_NATO"; rank = ""; position[] = {9.04626,-0.809814,0}; dir = 210;}; class Object21 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {8.39636,3.66113,0}; dir = 30;}; class Object22 {side = 8; vehicle = "Land_Pneu"; rank = ""; position[] = {8.24756,0.124023,0}; dir = 60;}; class Object23 {side = 8; vehicle = "Land_Pallets_stack_F"; rank = ""; position[] = {9.37134,1.06152,0}; dir = 314.999;}; class Object24 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {6.04102,2.27368,0}; dir = 180;}; class Object25 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {6.03223,3.27808,0}; dir = 0;}; class Object26 {side = 8; vehicle = "Barrel1"; rank = ""; position[] = {6.65991,2.89233,0}; dir = 285;}; class Object27 {side = 8; vehicle = "Land_PaperBox_open_empty_F"; rank = ""; position[] = {7.74792,1.99878,0}; dir = 120;}; class Object28 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {10.4861,-1.36694,0}; dir = 300;}; class Object29 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {6.21948,-2.53149,0}; dir = 210;}; class Object30 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {11.5894,1.20825,0}; dir = 255;}; class Object31 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {8.7572,-3.55518,0}; dir = 345;}; class Object32 {side = 8; vehicle = "AmmoCrates_NoInteractive_Medium"; rank = ""; position[] = {6.95313,0.898438,0}; dir = 120;}; class Object33 {side = 8; vehicle = "Wire"; rank = ""; position[] = {7.84509,11.0837,0}; dir = 210;}; class Object34 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {4.32141,5.45068,0}; dir = 165;}; class Object35 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {6.73853,4.48755,0}; dir = 210;}; }; class Watchtower7_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_Watchtower7_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_CamoNet_NATO"; rank = ""; position[] = {-6.82446,0.60083,0}; dir = 270;}; class Object1 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-7.5238,1.44507,0}; dir = 315;}; class Object2 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-7.65039,1.11304,0}; dir = 90;}; class Object3 {side = 8; vehicle = "Land_CratesShabby_F"; rank = ""; position[] = {-6.12402,0.756104,0}; dir = 195;}; class Object4 {side = 8; vehicle = "Land_CratesShabby_F"; rank = ""; position[] = {-1.75891,1.86963,0}; dir = 45;}; class Object5 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {-6.25232,-1.12598,0}; dir = 179.985;}; class Object6 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {-6.25244,-0.251221,0}; dir = 270.01;}; class Object7 {side = 8; vehicle = "Land_PaperBox_open_full_F"; rank = ""; position[] = {-4.88403,1.61768,0}; dir = 45;}; class Object9 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-4.50024,-3.11206,0}; dir = 0;}; class Object10 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {0.870361,-3.51538,0}; dir = 180;}; class Object11 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-4.86877,4.2373,0}; dir = 135;}; class Object12 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-2.67236,5.79565,0}; dir = 180;}; class Object13 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-7.25989,-2.7085,0}; dir = 45;}; class Object14 {side = 8; vehicle = "Land_Pallets_F"; rank = ""; position[] = {-7.78137,-5.64722,0}; dir = 15;}; class Object15 {side = 8; vehicle = "Hedgehog"; rank = ""; position[] = {-3.0321,7.87427,0}; dir = 60;}; class Object16 {side = 8; vehicle = "Hedgehog"; rank = ""; position[] = {-3.27209,9.59424,0}; dir = 150;}; class Object17 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {3.97461,0.738037,0}; dir = 90;}; class Object18 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {3.97461,3.73804,0}; dir = 90;}; class Object19 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {5.80078,1.91187,0}; dir = 270;}; class Object20 {side = 8; vehicle = "Land_Sack_F"; rank = ""; position[] = {5.39368,0.043457,0}; dir = 135;}; class Object21 {side = 8; vehicle = "Land_Sack_F"; rank = ""; position[] = {5.74963,-0.505615,0}; dir = 195;}; class Object22 {side = 8; vehicle = "Land_GarbagePallet_F"; rank = ""; position[] = {5.90918,1.89893,0}; dir = 270;}; class Object23 {side = 8; vehicle = "Land_HBarrierTower_F"; rank = ""; position[] = {1.49707,5.97241,0}; dir = 180;}; class Object24 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {3.65686,-3.1543,0}; dir = 315;}; class Object25 {side = 8; vehicle = "Land_Sack_F"; rank = ""; position[] = {6.01685,-0.0849609,0}; dir = 180;}; class Object26 {side = 8; vehicle = "Wire"; rank = ""; position[] = {5.68213,8.03174,0}; dir = 270;}; class Object27 {side = 8; vehicle = "Wire"; rank = ""; position[] = {1.33997,11.5586,0}; dir = 180;}; }; class Watchtower8_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_Watchtower8_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_CamoNetVar_NATO"; rank = ""; position[] = {-5.23767,-2.47388,0}; dir = 90;}; class Object1 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {1.48645,-5.47803,0}; dir = 180;}; class Object2 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-6.90039,1.61304,0}; dir = 90;}; class Object3 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-0.525391,-2.13696,0}; dir = 90;}; class Object4 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-6.90039,-1.38696,0}; dir = 90;}; class Object5 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {-4.81689,-1.69067,0}; dir = 285;}; class Object6 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {-5.62756,-3.87598,0}; dir = 29.9644;}; class Object7 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {-5.69177,-1.69067,0}; dir = 194.982;}; class Object8 {side = 8; vehicle = "Land_MetalBarrel_F"; rank = ""; position[] = {-5.50256,-2.62598,0}; dir = 359.991;}; class Object9 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {1.11011,-3.75342,0}; dir = 270;}; class Object11 {side = 8; vehicle = "Misc_concrete_High"; rank = ""; position[] = {-5.00244,0.249023,0}; dir = 360;}; class Object12 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-3.62964,3.60962,0}; dir = 180;}; class Object13 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-3.87524,-7.73706,0}; dir = 0;}; class Object14 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-6.98804,-4.62817,0}; dir = 90;}; class Object15 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-6.63489,-7.3335,0}; dir = 45;}; class Object16 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-1.09314,-7.4043,0}; dir = 315;}; class Object17 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-6.41174,3.27686,0}; dir = 135;}; class Object18 {side = 8; vehicle = "Land_CratesPlastic_F"; rank = ""; position[] = {-4.75549,-2.50391,0}; dir = 105;}; class Object19 {side = 8; vehicle = "Land_Garbage_square5_F"; rank = ""; position[] = {-4.58411,6.68042,0}; dir = 120;}; class Object20 {side = 8; vehicle = "Land_GarbageWashingMachine_F"; rank = ""; position[] = {-4.78418,6.83301,0}; dir = 120;}; class Object21 {side = 8; vehicle = "Land_HBarrierTower_F"; rank = ""; position[] = {1.24707,4.34741,0}; dir = 180;}; class Object22 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {3.37476,-5.36157,0}; dir = 0;}; class Object23 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {6.60815,-2.37378,0}; dir = 270;}; class Object24 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {6.15686,-5.0293,0}; dir = 315;}; class Object25 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {3.86511,1.2915,0}; dir = 45;}; class Object26 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {6.255,0.331543,0}; dir = 225;}; class Object27 {side = 8; vehicle = "Land_PaperBox_closed_F"; rank = ""; position[] = {2.8717,-4.01367,0}; dir = 195;}; class Object28 {side = 8; vehicle = "Wire"; rank = ""; position[] = {5.30713,6.28174,0}; dir = 270;}; class Object29 {side = 8; vehicle = "Wire"; rank = ""; position[] = {0.964966,9.80859,0}; dir = 180;}; }; class Watchtower9_CUP_B_CDF { name = $STR_ZECCUP_MilitaryWoodland_FortSmall_Watchtower9_CUP_B_CDF; // Credit: 2600K icon = "\ca\data\flag_usa_co.paa"; side = 8; class Object0 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-5.77539,-0.137451,0}; dir = 90;}; class Object1 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {-4.10217,1.8064,0}; dir = 135;}; class Object2 {side = 8; vehicle = "Land_Pallets_F"; rank = ""; position[] = {-2.1062,-0.279785,0}; dir = 285;}; class Object4 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {-2.62524,-4.73706,0}; dir = 0;}; class Object5 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-3.33508,3.63086,0}; dir = 135;}; class Object6 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {-5.38489,-4.33398,0}; dir = 45;}; class Object7 {side = 8; vehicle = "CUP_hromada_beden_dekorativniX"; rank = ""; position[] = {-3.62744,-2.12598,0}; dir = 285;}; class Object8 {side = 8; vehicle = "Wire"; rank = ""; position[] = {-6.75854,9.73706,0}; dir = 165;}; class Object9 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {6.86951,2.41064,0}; dir = 30;}; class Object10 {side = 8; vehicle = "Land_HBarrierTower_F"; rank = ""; position[] = {1.24707,5.47192,0}; dir = 180;}; class Object11 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {5.5437,-3.36987,0}; dir = 180;}; class Object12 {side = 8; vehicle = "Land_BagFenceLong"; rank = ""; position[] = {2.87036,-3.39087,0}; dir = 180;}; class Object13 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {8.3302,-3.00879,0}; dir = 315;}; class Object14 {side = 8; vehicle = "Land_BagFenceRound"; rank = ""; position[] = {5.88,3.58105,0}; dir = 225;}; class Object15 {side = 8; vehicle = "Land_HBarrier_3_F"; rank = ""; position[] = {8.72461,0.987549,0}; dir = 90;}; class Object16 {side = 8; vehicle = "Barrel2"; rank = ""; position[] = {6.81421,-0.304199,0}; dir = 300;}; class Object17 {side = 8; vehicle = "Barrel2"; rank = ""; position[] = {6.37256,1.24902,0}; dir = 120;}; class Object18 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {7.24756,0.499023,0}; dir = 270;}; class Object19 {side = 8; vehicle = "Barrel4"; rank = ""; position[] = {6.49756,0.249023,0}; dir = 15;}; class Object20 {side = 8; vehicle = "Land_Pallets_stack_F"; rank = ""; position[] = {7.12256,-2.00098,0}; dir = 164.999;}; class Object21 {side = 8; vehicle = "Wire"; rank = ""; position[] = {8.00146,8.4021,0}; dir = 225;}; class Object22 {side = 8; vehicle = "Wire"; rank = ""; position[] = {1.08997,10.9331,0}; dir = 180;}; }; };
102.288046
142
0.617586
LISTINGS09
14102c4a0ed80618ca80ccacb8b2d709bc8380c9
7,820
cpp
C++
externals/browser/externals/browser/externals/libgeometry/geometry/estimate-point-normals.cpp
HanochZhu/vts-browser-unity-plugin
32a22d41e21b95fb015326f95e401d87756d0374
[ "BSD-2-Clause" ]
1
2021-09-02T08:42:59.000Z
2021-09-02T08:42:59.000Z
externals/browser/externals/browser/externals/libgeometry/geometry/estimate-point-normals.cpp
HanochZhu/vts-browser-unity-plugin
32a22d41e21b95fb015326f95e401d87756d0374
[ "BSD-2-Clause" ]
null
null
null
externals/browser/externals/browser/externals/libgeometry/geometry/estimate-point-normals.cpp
HanochZhu/vts-browser-unity-plugin
32a22d41e21b95fb015326f95e401d87756d0374
[ "BSD-2-Clause" ]
null
null
null
/** * Copyright (c) 2020 Melown Technologies SE * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #include "estimate-point-normals.hpp" #include "bvh.hpp" #include "math/math.hpp" #include "math/geometry.hpp" #include <boost/iterator/counting_iterator.hpp> namespace geometry { namespace ublas = math::ublas; Eigen::VectorXd estimateNormal(const Eigen::MatrixXd& data) { using namespace Eigen; // calculate centroid (1 x K) of all (N) data points RowVectorXd centroid = data.colwise().mean(); // mean-center sample matrix MatrixXd centered = data.rowwise() - centroid; // calculate the covariance matrix (K x K), for PCA we may ommit // scaling by the factor 1/(N - 1) MatrixXd covariance = centered.transpose() * centered; // calculate SVD (ordered by the magnitude of SV) JacobiSVD<MatrixXd> svd(covariance, ComputeFullU); // the normal is the last column of U, singular vector of the covariance // matrix corresponding to the smallest singular value // (i.e., the direction of the least variability in the data) VectorXd sgVec(svd.matrixU().col(data.cols() - 1)); // normalization shouldn't be needed as U should be a unitary matrix. return sgVec;//.normalized(); } namespace { class BvhDisk : public BvhPrimitive { math::Point3 center_; math::Point3 normal_; double radius_; public: BvhDisk() = default; BvhDisk(const math::Point3& center , const math::Point3& normal , const double radius , const std::uint32_t index) : center_(center) , normal_(normal) , radius_(radius) { assert(radius_ > 0.); userData = index; } bool getIntersection(const Ray& ray, IntersectionInfo& intersection) const { // ray-plane intersection const double denom = inner_prod(normal_, ray.direction()); if (std::fabs(denom) < 1.e-6) { return false; } const math::Point3 diff = center_ - ray.origin(); const double t = inner_prod(diff, normal_) / denom; if (t > 0.) { // find the distance of the intersection from the disk center const math::Point3 dp = ray.origin() + ray.direction() * t - center_; const double distSqr = inner_prod(dp, dp); if (distSqr < math::sqr(radius_)) { intersection.object = this; intersection.t = t; return true; } } return false; } math::Extents3 getBBox() const { ublas::scalar_vector<double> size(3, radius_); return math::Extents3(center_ - size, center_ + size); } math::Point3 getCenter() const { return center_; } }; } // namespace static constexpr float DX = 0.25; static constexpr float DZ = 1.; static math::Points3 ALL_DIRS = { math::Point3(0., 0., DZ), math::Point3(0., DX, DZ), math::Point3(0., -DX, DZ), math::Point3(DX, 0., DZ), math::Point3(-DX, 0., DZ), math::Point3(DX, DX, DZ), math::Point3(DX, -DX, DZ), math::Point3(-DX, -DX, DZ), math::Point3(-DX, DX, DZ), }; void reorientNormals(const std::vector<math::Point3>& pc , std::vector<math::Point3>& normals , const double pointRadius) { std::vector<BvhDisk> disks(pc.size()); UTILITY_OMP(parallel for) for (std::uint32_t i = 0; i < pc.size(); ++i) { disks[i] = BvhDisk(pc[i], normals[i], pointRadius, i); } LOG(info2) << "Building BVH for " << disks.size() << " points"; geometry::Bvh<BvhDisk> bvh(20); bvh.build(std::move(disks)); // find order in z-direction std::vector<std::uint32_t> orderZ(pc.size()); std::copy(boost::counting_iterator<std::uint32_t>(0) , boost::counting_iterator<std::uint32_t>(pc.size()) , orderZ.begin()); std::sort(orderZ.begin(), orderZ.end() , [&](std::uint32_t i1, std::uint32_t i2) { return pc[i1](2) > pc[i2](2); }); // step 1 - determine normal orientation based on normals of already determined points, // assuming the topmost points (roofs) have z>0 orientation. LOG(info2) << "Estimating normal orientations"; UTILITY_OMP(parallel for) for (std::uint32_t rankZ = 0; rankZ < orderZ.size(); ++rankZ) { const std::uint32_t i = orderZ[rankZ]; int doFlip = 0; for (math::Point3 dir : ALL_DIRS) { dir = math::normalize(dir); // whether the ray is outward or inward with respect to current normal orientation const int outward = math::sgn(inner_prod(dir, normals[i])); const Ray ray(pc[i] + pointRadius * dir, dir); IntersectionInfo is; if (bvh.getFirstIntersection(ray, is)) { const std::uint32_t j = is.object->userData; // if this is an outward ray, flip the normal if the intersected point has // the same orientation as the ray (i.e. likely a backface); // for an inward ray, flip the normal if the intersected point is NOT a backface. doFlip += int(inner_prod(normals[j], dir) > 0.) * outward; } else { // no occlusion -> normal correct if this is an outward ray doFlip -= outward; } } if (doFlip > 0) { // more votes for flipping the normal normals[i] *= -1; } } // step 2 - flip normals which have opposite orientation than their neighbors LOG(info2) << "Flipping outliers"; KdTree<math::Point3, 3> tree(pc.begin(), pc.end()); std::vector<uint8_t> doFlip(pc.size(), false); std::vector<math::Points3::const_iterator> neighs; UTILITY_OMP(parallel for private(neighs)) for (std::uint32_t i = 0; i < pc.size(); ++i) { neighs.clear(); tree.range(pc[i], 2 * pointRadius, neighs); double count = 0.; for (auto& n : neighs) { const std::uint32_t j = std::uint32_t(n - pc.begin()); count += inner_prod(normals[i], normals[j]); } if (count < 0.) { doFlip[i] = true; } } UTILITY_OMP(parallel for) for (std::uint32_t i = 0; i < pc.size(); ++i) { if (doFlip[i]) { normals[i] *= -1; } } } } // namespace geometry
37.416268
97
0.602046
HanochZhu
1410beb61ab5c3b500d4c939dcf5c1dbd52be287
5,528
cpp
C++
source/Process/Blend/Blend.cpp
Fabrice-Praxinos/ULIS
232ad5c0804da1202d8231fda67ff4aea70f57ef
[ "RSA-MD" ]
30
2020-09-16T17:39:36.000Z
2022-02-17T08:32:53.000Z
source/Process/Blend/Blend.cpp
Fabrice-Praxinos/ULIS
232ad5c0804da1202d8231fda67ff4aea70f57ef
[ "RSA-MD" ]
7
2020-11-23T14:37:15.000Z
2022-01-17T11:35:32.000Z
source/Process/Blend/Blend.cpp
Fabrice-Praxinos/ULIS
232ad5c0804da1202d8231fda67ff4aea70f57ef
[ "RSA-MD" ]
5
2020-09-17T00:39:14.000Z
2021-08-30T16:14:07.000Z
// IDDN FR.001.250001.004.S.X.2019.000.00000 // ULIS is subject to copyright laws and is the legal and intellectual property of Praxinos,Inc /* * ULIS *__________________ * @file Blend.cpp * @author Clement Berthaud * @brief This file provides the definitions for the Blend API. * @copyright Copyright 2018-2021 Praxinos, Inc. All Rights Reserved. * @license Please refer to LICENSE.md */ #include "Process/Blend/Blend.h" // Include SSE RGBA8 Implementation #ifdef ULIS_COMPILETIME_SSE_SUPPORT #include "Process/Blend/RGBA8/BlendMT_Separable_SSE_RGBA8.h" #include "Process/Blend/RGBA8/BlendMT_NonSeparable_SSE_RGBA8.h" #include "Process/Blend/RGBA8/AlphaBlendMT_SSE_RGBA8.h" #include "Process/Blend/RGBA8/TiledBlendMT_Separable_SSE_RGBA8.h" #include "Process/Blend/RGBA8/TiledBlendMT_NonSeparable_SSE_RGBA8.h" #endif // ULIS_COMPILETIME_SSE_SUPPORT // Include AVX RGBA8 Implementation #ifdef ULIS_COMPILETIME_AVX_SUPPORT #include "Process/Blend/RGBA8/BlendMT_Separable_AVX_RGBA8.h" #include "Process/Blend/RGBA8/AlphaBlendMT_AVX_RGBA8.h" #endif // ULIS_COMPILETIME_AVX_SUPPORT ULIS_NAMESPACE_BEGIN ///////////////////////////////////////////////////// // Blend Sep ULIS_BEGIN_DISPATCHER_SPECIALIZATION_DEFINITION( FDispatchedBlendSeparableInvocationSchedulerSelector ) ULIS_DEFINE_DISPATCHER_SPECIALIZATION( &DispatchTestIsUnorderedRGBA8 , &ScheduleBlendMT_Separable_AVX_RGBA8 , &ScheduleBlendMT_Separable_SSE_RGBA8 , &ScheduleBlendMT_Separable_MEM_Generic< uint8 > ) ULIS_END_DISPATCHER_SPECIALIZATION_DEFINITION( FDispatchedBlendSeparableInvocationSchedulerSelector ) // Blend NSep ULIS_BEGIN_DISPATCHER_SPECIALIZATION_DEFINITION( FDispatchedBlendNonSeparableInvocationSchedulerSelector ) ULIS_DEFINE_DISPATCHER_SPECIALIZATION( &DispatchTestIsUnorderedRGBA8 , &ScheduleBlendMT_NonSeparable_SSE_RGBA8 , &ScheduleBlendMT_NonSeparable_SSE_RGBA8 , &ScheduleBlendMT_NonSeparable_MEM_Generic< uint8 > ) ULIS_END_DISPATCHER_SPECIALIZATION_DEFINITION( FDispatchedBlendNonSeparableInvocationSchedulerSelector ) // Blend Misc ULIS_DISPATCHER_NO_SPECIALIZATION_DEFINITION( FDispatchedBlendMiscInvocationSchedulerSelector ) // Blend Subpixel Sep ULIS_BEGIN_DISPATCHER_SPECIALIZATION_DEFINITION( FDispatchedBlendSeparableSubpixelInvocationSchedulerSelector ) ULIS_DEFINE_DISPATCHER_SPECIALIZATION( &DispatchTestIsUnorderedRGBA8 , &ScheduleBlendMT_Separable_AVX_RGBA8_Subpixel , &ScheduleBlendMT_Separable_SSE_RGBA8_Subpixel , &ScheduleBlendMT_Separable_MEM_Generic_Subpixel< uint8 > ) ULIS_END_DISPATCHER_SPECIALIZATION_DEFINITION( FDispatchedBlendSeparableSubpixelInvocationSchedulerSelector ) // Blend Subpixel NSep ULIS_BEGIN_DISPATCHER_SPECIALIZATION_DEFINITION( FDispatchedBlendNonSeparableSubpixelInvocationSchedulerSelector ) ULIS_DEFINE_DISPATCHER_SPECIALIZATION( &DispatchTestIsUnorderedRGBA8 , &ScheduleBlendMT_NonSeparable_SSE_RGBA8_Subpixel , &ScheduleBlendMT_NonSeparable_SSE_RGBA8_Subpixel , &ScheduleBlendMT_NonSeparable_MEM_Generic_Subpixel< uint8 > ) ULIS_END_DISPATCHER_SPECIALIZATION_DEFINITION( FDispatchedBlendNonSeparableSubpixelInvocationSchedulerSelector ) // Blend Subpixel Misc ULIS_DISPATCHER_NO_SPECIALIZATION_DEFINITION( FDispatchedBlendMiscSubpixelInvocationSchedulerSelector ) // AlphaBlend ULIS_BEGIN_DISPATCHER_SPECIALIZATION_DEFINITION( FDispatchedAlphaBlendSeparableInvocationSchedulerSelector ) ULIS_DEFINE_DISPATCHER_SPECIALIZATION( &DispatchTestIsUnorderedRGBA8 , &ScheduleAlphaBlendMT_Separable_AVX_RGBA8 , &ScheduleAlphaBlendMT_Separable_SSE_RGBA8 , &ScheduleAlphaBlendMT_Separable_MEM_Generic< uint8 > ) ULIS_END_DISPATCHER_SPECIALIZATION_DEFINITION( FDispatchedAlphaBlendSeparableInvocationSchedulerSelector ) // AlphaBlend Subpixel ULIS_BEGIN_DISPATCHER_SPECIALIZATION_DEFINITION( FDispatchedAlphaBlendSeparableSubpixelInvocationSchedulerSelector ) ULIS_DEFINE_DISPATCHER_SPECIALIZATION( &DispatchTestIsUnorderedRGBA8 , &ScheduleAlphaBlendMT_Separable_AVX_RGBA8_Subpixel , &ScheduleAlphaBlendMT_Separable_SSE_RGBA8_Subpixel , &ScheduleAlphaBlendMT_Separable_MEM_Generic_Subpixel< uint8 > ) ULIS_END_DISPATCHER_SPECIALIZATION_DEFINITION( FDispatchedAlphaBlendSeparableSubpixelInvocationSchedulerSelector ) // TiledBlend Sep ULIS_BEGIN_DISPATCHER_SPECIALIZATION_DEFINITION( FDispatchedTiledBlendSeparableInvocationSchedulerSelector ) ULIS_DEFINE_DISPATCHER_SPECIALIZATION( &DispatchTestIsUnorderedRGBA8 , &ScheduleTiledBlendMT_Separable_SSE_RGBA8 , &ScheduleTiledBlendMT_Separable_SSE_RGBA8 , &ScheduleTiledBlendMT_Separable_MEM_Generic< uint8 > ) ULIS_END_DISPATCHER_SPECIALIZATION_DEFINITION( FDispatchedTiledBlendSeparableInvocationSchedulerSelector ) // TiledBlend NSep ULIS_BEGIN_DISPATCHER_SPECIALIZATION_DEFINITION( FDispatchedTiledBlendNonSeparableInvocationSchedulerSelector ) ULIS_DEFINE_DISPATCHER_SPECIALIZATION( &DispatchTestIsUnorderedRGBA8 , &ScheduleTiledBlendMT_NonSeparable_SSE_RGBA8 , &ScheduleTiledBlendMT_NonSeparable_SSE_RGBA8 , &ScheduleTiledBlendMT_NonSeparable_MEM_Generic< uint8 > ) ULIS_END_DISPATCHER_SPECIALIZATION_DEFINITION( FDispatchedTiledBlendNonSeparableInvocationSchedulerSelector ) // TiledBlend Misc ULIS_DISPATCHER_NO_SPECIALIZATION_DEFINITION( FDispatchedTiledBlendMiscInvocationSchedulerSelector ) ULIS_NAMESPACE_END
53.153846
116
0.833575
Fabrice-Praxinos
1412ddbcbc628a60b8c2c08545deaf1fcfd105bf
1,895
cpp
C++
sdf.cpp
temple-reconstruction/mview
1440b5716d595c5c4d568fc45dd5afbb6f54dfc7
[ "MIT" ]
3
2018-09-17T07:39:35.000Z
2020-02-24T21:09:27.000Z
sdf.cpp
temple-reconstruction/mview
1440b5716d595c5c4d568fc45dd5afbb6f54dfc7
[ "MIT" ]
1
2018-06-11T19:25:03.000Z
2018-06-11T21:51:32.000Z
sdf.cpp
temple-reconstruction/mview
1440b5716d595c5c4d568fc45dd5afbb6f54dfc7
[ "MIT" ]
null
null
null
#include "sdf.h" #include "MarchingCubes.h" #include <iostream> SdfIntegrator::SdfIntegrator(int x, int y, int z, coordinate min, coordinate max) : min(min), size(max - min), count_x(x), count_y(y), count_z(z), cubes(new Cube[x*y*z]) { } auto SdfIntegrator::coordinate_of(int x, int y, int z) const -> coordinate { coordinate dist { static_cast<float>(x)/static_cast<float>(count_x - 1)*size[0], static_cast<float>(y)/static_cast<float>(count_y - 1)*size[1], static_cast<float>(z)/static_cast<float>(count_z - 1)*size[2], }; return min + dist; } static float weight_of(float estimated) { return 1./(1 + 10.*estimated*estimated); } void Cube::integrate(float estimated_distance) { const float previous_sum = distance*weights; const float previous_weight = weights; const float weight = weight_of(estimated_distance); const float new_sum = previous_sum + weight*estimated_distance; const float new_weights = previous_weight + weight; distance = new_sum/new_weights; weights = new_weights; } void Cube::markFree() { freeCtr++; } int SdfIntegrator::index_of(int x, int y, int z) const { // Assumes that z is the fastest index in loops for cache. return x*(count_z*count_y) + y*count_z + z; } Cube& SdfIntegrator::get(int x, int y, int z) { return cubes[index_of(x, y, z)]; } const Cube& SdfIntegrator::get(int x, int y, int z) const { return cubes[index_of(x, y, z)]; } void SdfIntegrator::remove_free() { visit([](auto _coord, auto& cube) { if(cube.freeCtr > cube.weights) cube.distance = 1000.f; }); } SimpleMesh SdfIntegrator::mesh() const { SimpleMesh mesh; for (int x = 0; x < count_x - 1; x++) { std::cerr << "Marching Cubes on slice " << x << " of " << count_x << std::endl; for (int y = 0; y < count_y - 1; y++) { for (int z = 0; z < count_z - 1; z++) { ProcessVolumeCell(*this, x, y, z, 0.f, mesh); } } } return mesh; }
25.266667
83
0.671768
temple-reconstruction
1414ea81c54b9fb70de43d45206bf4b0c446824a
1,455
cpp
C++
Game/fmodapi/tools/example.cpp
hackerlank/SourceCode
b702c9e0a9ca5d86933f3c827abb02a18ffc9a59
[ "MIT" ]
4
2021-07-31T13:56:01.000Z
2021-11-13T02:55:10.000Z
Game/fmodapi/tools/example.cpp
shacojx/SourceCodeGameTLBB
e3cea615b06761c2098a05427a5f41c236b71bf7
[ "MIT" ]
null
null
null
Game/fmodapi/tools/example.cpp
shacojx/SourceCodeGameTLBB
e3cea615b06761c2098a05427a5f41c236b71bf7
[ "MIT" ]
7
2021-08-31T14:34:23.000Z
2022-01-19T08:25:58.000Z
#include "fsbanklib.h" #include <stdio.h> #define NUMFILES 2 char *files[NUMFILES] = { "jbtennis.wav", "drumloop.wav" }; void __stdcall Update(int index, int memused, void *userdata) { printf("UPDATE : File %s, memory used %d kb\n", files[index], memused / 1024); } void __stdcall Debug(const char *debugstring, void *userdata) { printf("DEBUG : %s\n", debugstring); } void main() { FSBANK_RESULT result; result = FSBank_Init(); if (result != FSBANK_OK) { printf("ERROR\n"); return; } result = FSBank_SetUpdateCallback(Update, 0); if (result != FSBANK_OK) { printf("ERROR\n"); return; } result = FSBank_SetDebugCallback(Debug, 0); if (result != FSBANK_OK) { printf("ERROR\n"); return; } #if 1 /* This version compiles the wavs into 1 fsb. */ result = FSBank_Build(FSBANK_BUILDMODE_SINGLE, FSBANK_FORMAT_PCM, FSBANK_PLATFORM_CROSS, 0, "test.fsb", NUMFILES, &files[0], 0, 0, 0, 0, 1); #else /* This version compiles the wavs into their own fsb. 1 each. */ result = FSBank_Build(FSBANK_BUILDMODE_MULTI, FSBANK_FORMAT_PCM, FSBANK_PLATFORM_CROSS, 0, ".", NUMFILES, &files[0], 0, 0, 1); #endif if (result != FSBANK_OK) { printf("ERROR\n"); return; } result = FSBank_Close(); if (result != FSBANK_OK) { printf("ERROR\n"); return; } }
20.492958
144
0.59244
hackerlank
141841843e8b17d6d4b2c4eac2143a40d6543c9e
6,149
hpp
C++
include/boost/json/except.hpp
AeroStun/json
14bc67b63f5ce6ae5a119e2957e1f44f15277f5b
[ "BSL-1.0" ]
null
null
null
include/boost/json/except.hpp
AeroStun/json
14bc67b63f5ce6ae5a119e2957e1f44f15277f5b
[ "BSL-1.0" ]
null
null
null
include/boost/json/except.hpp
AeroStun/json
14bc67b63f5ce6ae5a119e2957e1f44f15277f5b
[ "BSL-1.0" ]
1
2017-04-20T20:17:06.000Z
2017-04-20T20:17:06.000Z
// // Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // // Official repository: https://github.com/vinniefalco/json // #ifndef BOOST_JSON_EXCEPT_HPP #define BOOST_JSON_EXCEPT_HPP #include <boost/json/detail/config.hpp> #include <stdexcept> namespace boost { namespace json { /** Exception thrown when a value's kind is mismatched. */ struct BOOST_SYMBOL_VISIBLE type_error : std::invalid_argument { /** Constructor. Construct the exception using the specified message. @param what The exception message text. */ BOOST_JSON_DECL explicit type_error(char const* what); }; /** Exception thrown when a number is required. @see @ref value::as_int64, @ref value::as_uint64, @ref value::as_double */ struct BOOST_SYMBOL_VISIBLE number_required_error : type_error { /** Constructor. Construct the exception using the specified message. @param what The exception message text. */ BOOST_JSON_DECL explicit number_required_error(char const* what); }; //---------------------------------------------------------- /** Exception thrown when an array index is out of range. */ struct BOOST_SYMBOL_VISIBLE array_index_error : std::out_of_range { /// Default constructor BOOST_JSON_DECL array_index_error(); #ifndef BOOST_JSON_DOCS BOOST_JSON_DECL static BOOST_NORETURN void raise(); #endif }; /** Exception thrown when an array is required. @see @ref value::as_array */ struct BOOST_SYMBOL_VISIBLE array_required_error : type_error { /// Default constructor. BOOST_JSON_DECL array_required_error(); #ifndef BOOST_JSON_DOCS BOOST_JSON_DECL static BOOST_NORETURN void raise(); #endif }; /** Exception thrown when an array's maximum size would be exceeded. */ struct BOOST_SYMBOL_VISIBLE array_too_large : std::length_error { /// Default constructor BOOST_JSON_DECL array_too_large(); #ifndef BOOST_JSON_DOCS BOOST_JSON_DECL static BOOST_NORETURN void raise(); #endif }; /** Exception thrown when a bool is required. @see @ref value::as_bool */ struct BOOST_SYMBOL_VISIBLE bool_required_error : type_error { /// Default constructor. BOOST_JSON_DECL bool_required_error(); #ifndef BOOST_JSON_DOCS BOOST_JSON_DECL static BOOST_NORETURN void raise(); #endif }; /** Exception thrown when a character offset is out of range. */ struct BOOST_SYMBOL_VISIBLE char_pos_error : std::out_of_range { /// Default constructor BOOST_JSON_DECL char_pos_error(); #ifndef BOOST_JSON_DOCS BOOST_JSON_DECL static BOOST_NORETURN void raise(); #endif }; /** Exception thrown when a double is required. @see @ref value::as_double */ struct BOOST_SYMBOL_VISIBLE double_required_error : number_required_error { /// Default constructor. BOOST_JSON_DECL double_required_error(); #ifndef BOOST_JSON_DOCS BOOST_JSON_DECL static BOOST_NORETURN void raise(); #endif }; /** Exception thrown when a signed 64-bit integer is required. @see @ref value::as_int64 */ struct BOOST_SYMBOL_VISIBLE int64_required_error : number_required_error { /// Default constructor. BOOST_JSON_DECL int64_required_error(); #ifndef BOOST_JSON_DOCS BOOST_JSON_DECL static BOOST_NORETURN void raise(); #endif }; /** Exception thrown when a key is not find in an object. */ struct BOOST_SYMBOL_VISIBLE key_not_found : std::invalid_argument { /// Default constructor BOOST_JSON_DECL key_not_found(); #ifndef BOOST_JSON_DOCS BOOST_JSON_DECL static BOOST_NORETURN void raise(); #endif }; /** Exception thrown when a key is too large. */ struct BOOST_SYMBOL_VISIBLE key_too_large : std::length_error { /// Default constructor BOOST_JSON_DECL key_too_large(); #ifndef BOOST_JSON_DOCS BOOST_JSON_DECL static BOOST_NORETURN void raise(); #endif }; /** Exception thrown when an object is required. @see @ref value::as_object */ struct BOOST_SYMBOL_VISIBLE object_required_error : type_error { /// Default constructor. BOOST_JSON_DECL object_required_error(); #ifndef BOOST_JSON_DOCS BOOST_JSON_DECL static BOOST_NORETURN void raise(); #endif }; /** Exception thrown when an object's maximum size would be exceeded. */ struct BOOST_SYMBOL_VISIBLE object_too_large : std::length_error { /// Default constructor BOOST_JSON_DECL object_too_large(); #ifndef BOOST_JSON_DOCS BOOST_JSON_DECL static BOOST_NORETURN void raise(); #endif }; /** Exception thrown when a stack limit is exceeded. */ struct BOOST_SYMBOL_VISIBLE stack_overflow : std::runtime_error { /// Default constructor BOOST_JSON_DECL stack_overflow(); #ifndef BOOST_JSON_DOCS BOOST_JSON_DECL static BOOST_NORETURN void raise(); #endif }; /** Exception thrown when a string is required. @see @ref value::as_string */ struct BOOST_SYMBOL_VISIBLE string_required_error : type_error { /// Default constructor. BOOST_JSON_DECL string_required_error(); #ifndef BOOST_JSON_DOCS BOOST_JSON_DECL static BOOST_NORETURN void raise(); #endif }; /** Exception thrown when a string's maximum size would be exceeded. */ struct BOOST_SYMBOL_VISIBLE string_too_large : std::length_error { /// Default constructor BOOST_JSON_DECL string_too_large(); #ifndef BOOST_JSON_DOCS BOOST_JSON_DECL static BOOST_NORETURN void raise(); #endif }; /** Exception thrown when an unsigned 64-bit integer is required. @see @ref value::as_uint64 */ struct BOOST_SYMBOL_VISIBLE uint64_required_error : number_required_error { /// Default constructor. BOOST_JSON_DECL uint64_required_error(); #ifndef BOOST_JSON_DOCS BOOST_JSON_DECL static BOOST_NORETURN void raise(); #endif }; } // json } // boost #ifdef BOOST_JSON_HEADER_ONLY #include <boost/json/impl/except.ipp> #endif #endif
20.029316
79
0.715238
AeroStun
141abd68d2f847866d82ff8eb4e2a709256861aa
1,025
cpp
C++
UpdateSystemTest/src/Utils.cpp
ProtocolONE/cord.update-system
ec14aa3210f41f788d2ea3229d36bff7f0b327d0
[ "Apache-2.0" ]
1
2019-08-07T06:13:57.000Z
2019-08-07T06:13:57.000Z
UpdateSystemTest/src/Utils.cpp
ProtocolONE/cord.update-system
ec14aa3210f41f788d2ea3229d36bff7f0b327d0
[ "Apache-2.0" ]
null
null
null
UpdateSystemTest/src/Utils.cpp
ProtocolONE/cord.update-system
ec14aa3210f41f788d2ea3229d36bff7f0b327d0
[ "Apache-2.0" ]
null
null
null
#include <QDir> #include <QFile> #include <QFileInfo> #include <QFileInfoList> #include "Utils.h" /*! Delete a directory along with all of its contents. \param dirName Path of directory to remove. \return true on success; false on error. */ bool Utils::removeDir(const QString &dirName){ bool result = true; QDir dir(dirName); if (dir.exists(dirName)) { Q_FOREACH(QFileInfo info, dir.entryInfoList(QDir::NoDotAndDotDot | QDir::System | QDir::Hidden | QDir::AllDirs | QDir::Files, QDir::DirsFirst)) { if (info.isDir()) { result = removeDir(info.absoluteFilePath()); } else { result = QFile::remove(info.absoluteFilePath()); } if (!result) { return result; } } result = dir.rmdir(dirName); } return result; } bool Utils::removeDir(const QDir &dirName){ return removeDir(dirName.absolutePath()); }
25
155
0.564878
ProtocolONE
1421a165f7ee36e62ecade9c843075ed6146f5c6
719
cpp
C++
C++/LeetCode/0784.cpp
spycedcoffee/DSA
1e559ed5251a2005cc2815438d865f0293f4cd44
[ "MIT" ]
4
2021-08-28T19:16:50.000Z
2022-03-04T19:46:31.000Z
C++/LeetCode/0784.cpp
spycedcoffee/DSA
1e559ed5251a2005cc2815438d865f0293f4cd44
[ "MIT" ]
8
2021-10-29T19:10:51.000Z
2021-11-03T12:38:00.000Z
C++/LeetCode/0784.cpp
spycedcoffee/DSA
1e559ed5251a2005cc2815438d865f0293f4cd44
[ "MIT" ]
4
2021-09-06T05:53:07.000Z
2021-12-24T10:31:40.000Z
class Solution { vector<string> casePerms; public: void backtrack(string& s, int pos, string ans){ if(pos == s.length()){ casePerms.push_back(ans); return; } char ch = s[pos]; if(isdigit(ch)) backtrack(s, pos + 1, ans + ch); else{ char temp = isupper(ch) ? tolower(ch) : toupper(ch); backtrack(s, pos + 1, ans + ch); backtrack(s, pos + 1, ans + temp); } } vector<string> letterCasePermutation(string s) { string temp; temp.clear(); backtrack(s, 0, temp); return casePerms; } };
21.147059
64
0.447844
spycedcoffee
142384fba7072142c189881bd7c0d680cca3d49b
388
cpp
C++
SYCL/DeviceLib/assert-aot.cpp
Fznamznon/llvm-test-suite
e813726bf0c5c6af67a188ee86daea55fa871a5d
[ "Apache-2.0" ]
null
null
null
SYCL/DeviceLib/assert-aot.cpp
Fznamznon/llvm-test-suite
e813726bf0c5c6af67a188ee86daea55fa871a5d
[ "Apache-2.0" ]
null
null
null
SYCL/DeviceLib/assert-aot.cpp
Fznamznon/llvm-test-suite
e813726bf0c5c6af67a188ee86daea55fa871a5d
[ "Apache-2.0" ]
null
null
null
// REQUIRES: opencl-aot, cpu, linux, UNSUPPORTED // FIXME re-enable after intel/llvm#3767 is merged // RUN: %clangxx -fsycl -fsycl-targets=spir64_x86_64-unknown-unknown-sycldevice %S/assert.cpp -o %t.aot.out // RUN: %CPU_RUN_PLACEHOLDER EXPECTED_SIGNAL=SIGABRT SHOULD_CRASH=1 %t.aot.out 2>%t.aot.msg // RUN: FileCheck %S/assert.cpp --input-file %t.aot.msg --check-prefixes=CHECK-MESSAGE
55.428571
107
0.752577
Fznamznon
14246c6fa4f58d9da36f1b1f5d1f2e15f9555025
37,061
cpp
C++
Code/Engine/Math/MathUtils.cpp
yixuan-wei/PersonalEngine
6f3b1df3ddeb662fbf65ca8b3ea7ddb446ef5a20
[ "MIT" ]
1
2021-06-11T06:41:29.000Z
2021-06-11T06:41:29.000Z
Code/Engine/Math/MathUtils.cpp
yixuan-wei/PersonalEngine
6f3b1df3ddeb662fbf65ca8b3ea7ddb446ef5a20
[ "MIT" ]
1
2022-02-25T07:46:54.000Z
2022-02-25T07:46:54.000Z
Code/Engine/Math/MathUtils.cpp
yixuan-wei/PersonalEngine
6f3b1df3ddeb662fbf65ca8b3ea7ddb446ef5a20
[ "MIT" ]
null
null
null
#include "Engine/Math/MathUtils.hpp" #include "Engine/Math/Vec3.hpp" #include "Engine/Math/Vec2.hpp" #include "Engine/Math/Vec4.hpp" #include "Engine/Math/OBB2.hpp" #include "Engine/Math/Disc2.hpp" #include "Engine/Math/FloatRange.hpp" #include "Engine/Math/IntVec2.hpp" #include "Engine/Math/AABB2.hpp" #include "Engine/Math/Plane2D.hpp" #include "Engine/Math/LineSegment2.hpp" #include "Engine/Core/Vertex_PCU.hpp" #include "Engine/Core/DevConsole.hpp" #include "Engine/Core/StringUtils.hpp" #include <cmath> ////////////////////////////////////////////////////////////////////////// Vec3 Power(Vec3 const& base, float index) { return Vec3(std::powf(base.x, index), std::powf(base.y, index), std::powf(base.z, index)); } ////////////////////////////////////////////////////////////////////////// float ConvertDegreesToRadians( float degrees ) { return degrees * (fPI/180.f); } ////////////////////////////////////////////////////////////////////////// float ConvertRadiansToDegrees( float radians ) { return radians * (180.0f/fPI); } ////////////////////////////////////////////////////////////////////////// float CosDegrees( float degrees ) { return std::cosf(ConvertDegreesToRadians(degrees)); } ////////////////////////////////////////////////////////////////////////// float SinDegrees( float degrees ) { return std::sinf(ConvertDegreesToRadians(degrees)); } ////////////////////////////////////////////////////////////////////////// float TanDegrees(float degrees) { return std::tanf(ConvertDegreesToRadians(degrees)); } ////////////////////////////////////////////////////////////////////////// float Atan2Degrees( float y, float x ) { return ConvertRadiansToDegrees(std::atan2f(y,x)); } ////////////////////////////////////////////////////////////////////////// float GetSmallestSameDegrees( float degrees ) { while( degrees > 360.f ) degrees -= 360.f; while( degrees < -360.f ) degrees += 360.f; if( degrees > 180.f ) { degrees = degrees - 360.f; } else if( degrees < -180.f ) { degrees = 360.f + degrees; } return degrees; } ////////////////////////////////////////////////////////////////////////// float GetShortestAngularDisplacement( float fromDegrees, float toDegrees ) { float rawDisplacement = toDegrees - fromDegrees; rawDisplacement = GetSmallestSameDegrees( rawDisplacement ); return rawDisplacement; } ////////////////////////////////////////////////////////////////////////// float GetTurnedToward( float currentDegrees, float goalDegrees, float maxDeltaDegrees ) { float displacement = GetShortestAngularDisplacement( currentDegrees, goalDegrees ); if( displacement <= maxDeltaDegrees && displacement >= -maxDeltaDegrees ) return goalDegrees; else if( displacement > maxDeltaDegrees ) return currentDegrees+maxDeltaDegrees; else return currentDegrees-maxDeltaDegrees; } ////////////////////////////////////////////////////////////////////////// float GetDistance2D( const Vec2& firstVec2, const Vec2& secondVec2 ) { return std::sqrtf( GetDistanceSquared2D( firstVec2, secondVec2 ) ); } ////////////////////////////////////////////////////////////////////////// float GetDistanceSquared2D( const Vec2& firstVec2, const Vec2& secondVec2 ) { Vec2 result = firstVec2 - secondVec2; return result.x*result.x + result.y*result.y; } ////////////////////////////////////////////////////////////////////////// float GetDistance3D( const Vec3& firstVec3, const Vec3& secondVec3 ) { return std::sqrtf( GetDistanceSquared3D( firstVec3, secondVec3 ) ); } ////////////////////////////////////////////////////////////////////////// float GetDistanceSquared3D( const Vec3& firstVec3, const Vec3& secondVec3 ) { Vec3 result = firstVec3-secondVec3; return result.x*result.x + result.y*result.y + result.z*result.z; } ////////////////////////////////////////////////////////////////////////// float GetDistanceXY3D( const Vec3& firstVec3, const Vec3& secondVec3 ) { return std::sqrtf( GetDistanceXYSquared3D( firstVec3, secondVec3 ) ); } ////////////////////////////////////////////////////////////////////////// float GetDistanceXYSquared3D( const Vec3& firstVec3, const Vec3& secondVec3 ) { Vec3 result = firstVec3 - secondVec3; return result.x*result.x + result.y*result.y; } ////////////////////////////////////////////////////////////////////////// int GetTaxicabDistance2D( const IntVec2& positionA, const IntVec2& positionB ) { IntVec2 displacement = positionA - positionB; return displacement.GetTaxicabLength(); } ////////////////////////////////////////////////////////////////////////// const Vec2 TransformPosition2D( const Vec2& position, float uniformScale, float rotationDegrees, const Vec2& translation ) { //change scale of position Vec2 result = position*uniformScale; //rotate if( rotationDegrees != 0.f ) { float newRadians = ConvertDegreesToRadians( Atan2Degrees( result.y, result.x ) + rotationDegrees ); float length = std::sqrtf( result.x * result.x + result.y * result.y ); result.x = length * std::cosf( newRadians ); result.y = length * std::sinf( newRadians ); } //translate result = result+translation; return result; } ////////////////////////////////////////////////////////////////////////// const Vec2 TransformPosition2D( const Vec2& position, const Vec2& basisIVector, const Vec2& basisJVector, const Vec2& translation ) { Vec2 newPosition; newPosition = basisIVector * position.x + basisJVector * position.y + translation; return newPosition; } ////////////////////////////////////////////////////////////////////////// const Vec3 TransformPosition3DXY( const Vec3& position, float uniformScale, float zRotationDegrees, const Vec2& translationXY ) { Vec2 resultXY = TransformPosition2D(Vec2(position.x, position.y), uniformScale, zRotationDegrees, translationXY); return Vec3(resultXY.x, resultXY.y, position.z); } ////////////////////////////////////////////////////////////////////////// const Vec3 TransformPosition3DXY( const Vec3& position, const Vec2& basisIVector, const Vec2& basisJVector, const Vec2& translationXY ) { Vec2 positionXY ( position.x, position.y); positionXY = TransformPosition2D( positionXY, basisIVector, basisJVector, translationXY ); return Vec3( positionXY.x, positionXY.y, position.z ); } ////////////////////////////////////////////////////////////////////////// float GetAngleDegreesBetweenVectors2D( const Vec2& vectorA, const Vec2& vectorB ) { float lengthA = vectorA.GetLengthSquared(); float lengthB = vectorB.GetLengthSquared(); if( lengthA == 0.f || lengthB == 0.f ) { g_theConsole->PrintString( Rgba8::WHITE, Stringf( "MathUtils::GetAngleDegreesBetweenVectors2D has one 0 vector, return 0" ) ); return 0.f; } float dotProduct = DotProduct2D( vectorA, vectorB ); float radians = std::acosf( dotProduct / std::sqrtf(lengthA *lengthB) ); return ConvertRadiansToDegrees( radians ); } ////////////////////////////////////////////////////////////////////////// float GetAngleDegreesBetweenVectors3D(Vec3 const& vectorA, Vec3 const& vectorB) { float lengthA = vectorA.GetLengthSquared(); float lengthB = vectorB.GetLengthSquared(); if (lengthB == 0.f || lengthA == 0.f) { g_theConsole->PrintError("MathUtils::GetAngleDegreesBetweenVectors3D has one 0 vector, return 0"); return 0.f; } float dotProduct = DotProduct3D(vectorA, vectorB); float radians = std::acosf(dotProduct/std::sqrtf(lengthA*lengthB)); return ConvertRadiansToDegrees(radians); } ////////////////////////////////////////////////////////////////////////// float GetProjectedLength2D( const Vec2& sourceVector, const Vec2& ontoVector ) { float ontoLength = ontoVector.GetLength(); if( ontoLength == 0.f ) { g_theConsole->PrintString( Rgba8::WHITE, Stringf( "MathUtils::GetProjectedLength2D has 0 ontoVector, return 0" ) ); return 0; } float dotProduct = DotProduct2D( sourceVector, ontoVector ); return dotProduct / ontoLength; } ////////////////////////////////////////////////////////////////////////// float GetProjectedLength3D(Vec3 const& sourceVec, Vec3 const& ontoVec) { float ontoLength = ontoVec.GetLength(); if (ontoLength == 0.f) { g_theConsole->PrintString(Rgba8::WHITE, Stringf("MathUtils::GetProjectedLength3D has 0 ontoVector, return 0")); return 0.f; } float dotProduct = DotProduct3D(sourceVec,ontoVec); return dotProduct/ontoLength; } ////////////////////////////////////////////////////////////////////////// const Vec2 GetProjectedOnto2D( const Vec2& sourceVector, const Vec2& ontoVector ) { float ontoLengthSquared = ontoVector.GetLengthSquared(); if( ontoLengthSquared == 0.f ) { g_theConsole->PrintString( Rgba8::WHITE, Stringf( "MathUtils::GetProjectedOnto2D has 0 ontoVector, return ZERO" ) ); return Vec2::ZERO; } float dotProduct = DotProduct2D( sourceVector, ontoVector ); return ontoVector * dotProduct / ontoLengthSquared; } ////////////////////////////////////////////////////////////////////////// bool DoDiscsOverlap2D( const Vec2& centerA, float radiusA, const Vec2& centerB, float radiusB ) { float distanceSquared = GetDistanceSquared2D( centerA, centerB ); float radiusSum = radiusA + radiusB; if( radiusSum*radiusSum > distanceSquared ) return true; else return false; } ////////////////////////////////////////////////////////////////////////// bool DoSpheresOverlap3D( const Vec3& centerA, float radiusA, const Vec3& centerB, float radiusB ) { float distanceSquared = GetDistanceSquared3D( centerA, centerB ); float radiusSum = radiusA + radiusB; if( radiusSum*radiusSum > distanceSquared ) return true; else return false; } ////////////////////////////////////////////////////////////////////////// bool DoAABBsOverlap2D( const AABB2& aabb2D1, const AABB2& aabb2D2 ) { if( aabb2D1.maxs.x<aabb2D2.mins.x || aabb2D1.maxs.y<aabb2D2.mins.y || aabb2D1.mins.x>aabb2D2.maxs.x || aabb2D1.mins.y>aabb2D2.maxs.y ) return true; else return false; } ////////////////////////////////////////////////////////////////////////// bool DoDiscAndAABBOverlap2D( const Vec2& center, float radius, const AABB2& aabb2D ) { Vec2 nearestDiscCenterOnAABB = GetNearestPointOnAABB2D( center, aabb2D ); if( GetDistance2D( center, nearestDiscCenterOnAABB ) > radius ) return false; else return true; } ////////////////////////////////////////////////////////////////////////// const Vec2 GetNearestPointOnDisc2D( const Vec2& point, const Vec2& center, float radius ) { Vec2 toPoint = point - center; toPoint.ClampLength( radius ); return center + toPoint; } ////////////////////////////////////////////////////////////////////////// const Vec2 GetNearestPointOnAABB2D( const Vec2& point, const AABB2& aabb2D ) { float newX = Clamp( point.x, aabb2D.mins.x, aabb2D.maxs.x ); float newY = Clamp( point.y, aabb2D.mins.y, aabb2D.maxs.y ); return Vec2( newX, newY ); } ////////////////////////////////////////////////////////////////////////// const Vec2 GetNearestPointOnInfiniteLine2D( const Vec2& refPos, const Vec2& somePointOnLine, const Vec2& anotherPointOnLine ) { Vec2 someToAnother = anotherPointOnLine - somePointOnLine; Vec2 someToRef = refPos - somePointOnLine; Vec2 someToRefOnLine = GetProjectedOnto2D( someToRef, someToAnother ); return somePointOnLine + someToRefOnLine; } ////////////////////////////////////////////////////////////////////////// const Vec2 GetNearestPointOnLineSegment2D( const Vec2& refPos, const Vec2& start, const Vec2& end ) { Vec2 startToEnd = end - start; float segmentLengthSquared = startToEnd.GetLengthSquared(); if( segmentLengthSquared == 0.f ) //line segment is a point { return start; } Vec2 startToRefPos = refPos - start; float projectedUnit = DotProduct2D( startToEnd, startToRefPos )/segmentLengthSquared; Vec2 startToRefProjected = projectedUnit * startToEnd; if( projectedUnit <= 0.f ) // nearest point is start { return start; } else if( projectedUnit >= 1.f )//nearest point is end { return end; } else { return start + startToEnd*projectedUnit; } } ////////////////////////////////////////////////////////////////////////// const Vec2 GetNearestPointOnCapsule2D( const Vec2& refPos, const Vec2& capsuleMidStart, const Vec2& capsuleMidEnd, float capsuleRadius ) { Vec2 startToEnd = capsuleMidEnd - capsuleMidStart; Vec2 startToRefPos = refPos - capsuleMidStart; float segmentLengthSquared = startToEnd.GetLengthSquared(); if( segmentLengthSquared == 0.f ) //line segment is a point { return startToRefPos.GetClamped(capsuleRadius) + capsuleMidStart; } float projectedUnit = DotProduct2D( startToEnd, startToRefPos ) / segmentLengthSquared; Vec2 startToRefProjected = projectedUnit * startToEnd; if( projectedUnit <= 0.f ) // nearest point is start semi-circle { return startToRefPos.GetClamped( capsuleRadius ) + capsuleMidStart; } else if( projectedUnit >= 1.f )//nearest point is end semi-circle { Vec2 endToRefPos = refPos - capsuleMidEnd; return capsuleMidEnd + endToRefPos.GetClamped( capsuleRadius ); } else { Vec2 pointOnLine = capsuleMidStart + startToEnd * projectedUnit; Vec2 onLineToBound = (refPos - pointOnLine).GetClamped( capsuleRadius ); return pointOnLine + onLineToBound; } } ////////////////////////////////////////////////////////////////////////// const Vec2 GetNearestPointOnOBB2D( const Vec2& refPos, const OBB2& box ) { return box.GetNearestPoint( refPos ); } ////////////////////////////////////////////////////////////////////////// FloatRange GetRangeOnProjectedAxis( int numPoints, const Vec2* points, const Vec2& relativeCenter, const Vec2& axisNormalized ) { float* projectedLength = new float[numPoints]; for( int pIdx = 0; pIdx < numPoints; pIdx++ ) { Vec2 centerToPoint = points[pIdx] - relativeCenter; float length = DotProduct2D( centerToPoint, axisNormalized ); projectedLength[pIdx] = length; } if( numPoints <1 ) { return FloatRange( 0.f ); } else { float minimum = projectedLength[0]; float maximum = projectedLength[0]; for( int pIdx = 1; pIdx < numPoints; pIdx++ ) { float curLength = projectedLength[pIdx]; if( curLength < minimum ) { minimum = curLength; } else if( curLength > maximum ) { maximum = curLength; } } delete[] projectedLength; return FloatRange( minimum, maximum ); } } ////////////////////////////////////////////////////////////////////////// bool DoesRayHitPlane2D(Vec2 const& start, Vec2 const& forward, Plane2D const& plane) { if (plane.IsPointInFront(start)) { return DotProduct2D(forward,plane.normal)<0.f; } else { return DotProduct2D(forward, plane.normal)>0.f; } } ////////////////////////////////////////////////////////////////////////// bool DoesRayHitBoundingBox2D(Vec2 const& start, Vec2 const& end, AABB2 const& bounds) { //https://www.scratchapixel.com/lessons/3d-basic-rendering/minimal-ray-tracer-rendering-simple-shapes/ray-box-intersection Vec2 raySeg = end-start; if (raySeg.x == 0.f) { //ray parallel to y axis float rayMinY = MinFloat(start.y, end.y); float rayMaxY = MaxFloat(start.y, end.y); FloatRange rayYRange(rayMinY, rayMaxY); FloatRange boundYRange(bounds.mins.y, bounds.maxs.y); FloatRange boundXRange(bounds.mins.x, bounds.maxs.x); return boundXRange.IsInRange(start.x) && rayYRange.DoesOverlap(boundYRange); } if (raySeg.y == 0.f) { //ray parallel to x axis float rayMinX = MinFloat(start.x, end.x); float rayMaxX = MaxFloat(start.x, end.x); FloatRange rayXRange(rayMinX, rayMaxX); FloatRange boundYRange(bounds.mins.y, bounds.maxs.y); FloatRange boundXRange(bounds.mins.x, bounds.maxs.x); return boundYRange.IsInRange(start.y) && rayXRange.DoesOverlap(boundXRange); } float raySegXFrac = 1.f / raySeg.x; float raySegYFrac = 1.f / raySeg.y; float boundFirstX = raySeg.x < 0 ? bounds.maxs.x : bounds.mins.x; float boundSecondX = raySeg.x < 0 ? bounds.mins.x : bounds.maxs.x; float boundFirstY = raySeg.y < 0 ? bounds.maxs.y : bounds.mins.y; float boundSecondY = raySeg.y < 0 ? bounds.mins.y : bounds.maxs.y; float minInterX = (boundFirstX - start.x) * raySegXFrac; float maxInterX = (boundSecondX - start.x) * raySegXFrac; float minInterY = (boundFirstY - start.y) * raySegYFrac; float maxInterY = (boundSecondY - start.y) * raySegYFrac; if (minInterX > maxInterY || minInterY > maxInterX) { return false; } //out of reach by length float minLength = MinFloat(minInterX,maxInterX); minLength = MinFloat(minLength,minInterY); minLength = MinFloat(maxInterY, minLength); if (minLength * minLength > raySeg.GetLengthSquared()) { return false; } return true; } ////////////////////////////////////////////////////////////////////////// bool DoesRayHitLineSegment2D(Vec2 const& start, Vec2 const& end, Vec2 const& lineA, Vec2 const& lineB) { //referencing https://www.youtube.com/watch?v=c065KoXooSw Vec2 sToA = lineA-start; Vec2 sToB = lineB-start; Vec2 forward = end-start; float sToADot = DotProduct2D(sToA, forward); float sToBDot = DotProduct2D(sToB, forward); if (sToADot < 0.f && sToBDot < 0.f) { return false; } float rayLengthSquared = GetDistanceSquared2D(start,end); if (sToADot > rayLengthSquared && sToBDot > rayLengthSquared) { return false; } Vec2 vertical = forward.GetRotated90Degrees(); float sToAVertDot = DotProduct2D(vertical, sToA); float sToBVertDot = DotProduct2D(vertical, sToB); if ((sToAVertDot > 0.f && sToBVertDot > 0.f) || (sToAVertDot < 0.f && sToBVertDot<0.f)) { return false; } Vec2 aToB = lineB-lineA; float fraction = 1.f/(CrossProduct2D(forward, aToB)); float rayParameter = CrossProduct2D(sToA,aToB)*fraction; float segParameter = CrossProduct2D(sToA, forward)*fraction; return rayParameter>=0.f && segParameter>=0.f && segParameter<=1.f; } ////////////////////////////////////////////////////////////////////////// bool DoesRayHitLineSegment2D(Vec2 const& start, Vec2 const& end, Vec2 const& lineA, Vec2 const& lineB, Vec2& outHitPoint, Vec2& outHitNormal, float& outDistance) { Vec2 sToA = lineA - start; Vec2 forward = end - start; Vec2 sToB = lineB - start; float sToADot = DotProduct2D(sToA, forward); float sToBDot = DotProduct2D(sToB, forward); if (sToADot < 0.f && sToBDot < 0.f) { return false; } float rayLengthSquared = GetDistanceSquared2D(start, end); if (sToADot > rayLengthSquared && sToBDot > rayLengthSquared) { return false; } Vec2 vertical = forward.GetRotated90Degrees(); float sToAVertDot = DotProduct2D(vertical, sToA); float sToBVertDot = DotProduct2D(vertical, sToB); if ((sToAVertDot > 0.f && sToBVertDot > 0.f) || (sToAVertDot < 0.f && sToBVertDot < 0.f)) { return false; } Vec2 aToB = lineB - lineA; float fraction = 1.f / CrossProduct2D(forward, aToB); float rayParameter = CrossProduct2D(sToA, aToB) * fraction; if (rayParameter<0.f||rayParameter>1.f) { return false; } float edgeParameter = CrossProduct2D(sToA, forward) * fraction; if (edgeParameter>=0.f && edgeParameter<=1.f) {//ray hit line outHitPoint = start + rayParameter * forward; outHitNormal = aToB.GetNormalized().GetRotatedMinus90Degrees(); outDistance = rayParameter; return true; } return false; } ////////////////////////////////////////////////////////////////////////// Vec2 GetCentroidOfPolygon(Vec2 const* points, int pointCount) { if (pointCount <= 0) { return Vec2::ZERO; } else if (pointCount <= 2) { return points[0]; } std::vector<Vec2> relativePoints; for (size_t idx = 0; idx < pointCount; idx++) { relativePoints.push_back(points[idx] - points[0]); } float areaSum = 0.f; Vec2 centroidSum; for (size_t idx = 1; idx < pointCount - 1; idx++) { Vec2 first = relativePoints[idx]; Vec2 second = relativePoints[idx + 1]; float tempArea = first.x * second.y - first.y * second.x; tempArea = tempArea < 0 ? -tempArea : tempArea; areaSum += tempArea; centroidSum += tempArea * Vec2(first.x + second.x, first.y + second.y); } return centroidSum / (areaSum * 3.f) + points[0]; } //////////////////////////////////////////////////////////////////////////S Disc2 GetMinimumOuterDiscForPolygon(Vec2 const* points, int pointCount) { float maxDiameterSquared = 0.f; Vec2 maxCenter; //TODO less complexity? for (int i = 0; i < pointCount; i++) { Vec2 first = points[i]; for (int j = i+1; j < pointCount; j++) { Vec2 second = points[j]; for (int k = j+1; k < pointCount; k++) { Vec2 third = points[k]; float diameterSquared = 0.f; float cosineSquared = 0.f; Vec2 center; float f2tSquared = GetDistanceSquared2D(first, third); float s2tSquared = GetDistanceSquared2D(second, third); float f2sSquared = GetDistanceSquared2D(first, second); //Non-acute triangle if (f2tSquared + s2tSquared <= f2sSquared) { diameterSquared = f2sSquared; if (diameterSquared > maxDiameterSquared) { maxCenter = (first + second) * .5f; maxDiameterSquared = diameterSquared; } continue; } else if (f2tSquared + f2sSquared <= s2tSquared) { diameterSquared = s2tSquared; if (diameterSquared > maxDiameterSquared) { maxCenter = (second + third) * .5f; maxDiameterSquared = diameterSquared; } continue; } else if (f2sSquared + s2tSquared <= f2tSquared) { diameterSquared = f2tSquared; if (diameterSquared > maxDiameterSquared) { maxCenter = (first + third) * .5f; maxDiameterSquared = diameterSquared; } continue; } //acute triangle float dotProduct = DotProduct2D(first - third, second - third); float dotProductSquared = dotProduct * dotProduct; if (f2tSquared != 0.f && s2tSquared != 0.f) { cosineSquared = dotProductSquared / (f2tSquared * s2tSquared); if (cosineSquared == 1.f) { diameterSquared = s2tSquared > f2tSquared ? s2tSquared : f2tSquared; } else { diameterSquared = f2sSquared / (1 - cosineSquared); } } else if (f2tSquared == 0.f) { diameterSquared = s2tSquared; } else { diameterSquared = f2tSquared; } if (diameterSquared > maxDiameterSquared) { maxDiameterSquared = diameterSquared; float centerToFSLength = std::sqrtf(diameterSquared * cosineSquared) * .5f; Vec2 halfFirst2Second = (second - first) * .5f; Vec2 edgeToCenter = halfFirst2Second.GetRotated90Degrees(); edgeToCenter.SetLength(centerToFSLength); maxCenter = first + halfFirst2Second + edgeToCenter; } } } } return Disc2(maxCenter,std::sqrtf(maxDiameterSquared) * .5f); } ////////////////////////////////////////////////////////////////////////// bool IsPointOnRightSide(Vec2 const& point, Vec2 const& start, Vec2 const& end) { Vec2 normal = (end - start).GetRotated90Degrees(); Vec2 startToP = point - start; if (DotProduct2D(startToP, normal) < 0.f) { return true; } return false; } ////////////////////////////////////////////////////////////////////////// bool IsPointInForwardSector2D( const Vec2& point, const Vec2& observerPos, float forwardDegrees, float apertureDegrees, float maxDist ) { Vec2 obToPoint = point - observerPos; float dist = obToPoint.GetLengthSquared(); if( dist >= maxDist*maxDist ) return false; float obToPointDegrees = obToPoint.GetAngleDegrees(); float deltaDegrees = GetShortestAngularDisplacement( forwardDegrees, obToPointDegrees ); float validDeltaDegrees = .5f * apertureDegrees; if( deltaDegrees>=validDeltaDegrees || deltaDegrees<=-validDeltaDegrees) return false; else return true; } ////////////////////////////////////////////////////////////////////////// bool IsPointInsideDisc2D( const Vec2& point, const Vec2& discCenter, float discRadius ) { Vec2 discToPoint = point - discCenter; if( discToPoint.GetLengthSquared() < discRadius * discRadius ) return true; else return false; } ////////////////////////////////////////////////////////////////////////// bool IsPointInsideAABB2D( const Vec2& point, const AABB2& box ) { Vec2 boxCenterToPoint = point - box.GetCenter(); if( boxCenterToPoint.x < box.maxs.x && boxCenterToPoint.x > box.mins.x && boxCenterToPoint.y < box.maxs.y && boxCenterToPoint.y > box.mins.y ) return true; else return false; } ////////////////////////////////////////////////////////////////////////// bool IsPointInsideCapsule2D( const Vec2& point, const Vec2& capsuleMidStart, const Vec2& capsuleMidEnd, float capsuleRadius ) { Vec2 startToEnd = capsuleMidEnd - capsuleMidStart; Vec2 startToRefPos = point - capsuleMidStart; float segmentLengthSquared = startToEnd.GetLengthSquared(); if( segmentLengthSquared == 0.f ) //line segment is a point { if( startToRefPos.GetLengthSquared() < capsuleRadius * capsuleRadius ) return true; else return false; } float projectedUnit = DotProduct2D( startToEnd, startToRefPos ) / segmentLengthSquared; Vec2 startToRefProjected = projectedUnit * startToEnd; if( projectedUnit <= 0.f ) // nearest point is start semi-circle { if( startToRefPos.GetLengthSquared() < capsuleRadius * capsuleRadius ) return true; else return false; } else if( projectedUnit >= 1.f )//nearest point is end semi-circle { Vec2 endToRefPos = point - capsuleMidEnd; if( endToRefPos.GetLengthSquared() < capsuleRadius * capsuleRadius ) return true; else return false; } else { Vec2 pointOnLine = capsuleMidStart + startToEnd * projectedUnit; Vec2 onLineToRef = (point - pointOnLine); if( onLineToRef.GetLengthSquared() < capsuleRadius * capsuleRadius ) return true; else return false; } } ////////////////////////////////////////////////////////////////////////// bool IsPointInsideOBB2D( const Vec2& point, const OBB2& box ) { return box.IsPointInside( point ); } ////////////////////////////////////////////////////////////////////////// float DotProduct2D( const Vec2& vec2DA, const Vec2& vec2DB ) { return vec2DA.x * vec2DB.x + vec2DA.y * vec2DB.y; } ////////////////////////////////////////////////////////////////////////// float DotProduct3D( const Vec3& vec3DA, const Vec3& vec3DB ) { return vec3DA.x * vec3DB.x + vec3DA.y * vec3DB.y + vec3DA.z * vec3DB.z; } ////////////////////////////////////////////////////////////////////////// float DotProduct4D( const Vec4& vec4DA, const Vec4& vec4DB ) { return vec4DA.x * vec4DB.x + vec4DA.y * vec4DB.y + vec4DA.z * vec4DB.z + vec4DA.w * vec4DB.w; } ////////////////////////////////////////////////////////////////////////// float CrossProduct2D(Vec2 const& vec2DA, Vec2 const& vec2DB) { return vec2DA.x * vec2DB.y - vec2DA.y * vec2DB.x; } ////////////////////////////////////////////////////////////////////////// Vec3 CrossProduct3D(Vec3 const& vec3DA, Vec3 const& vec3DB) { return Vec3(vec3DA.y*vec3DB.z - vec3DA.z*vec3DB.y, vec3DA.z*vec3DB.x - vec3DA.x*vec3DB.z, vec3DA.x*vec3DB.y - vec3DA.y*vec3DB.x); } ////////////////////////////////////////////////////////////////////////// bool DoOBBAndOBBOverlap2D(const OBB2& boxA, const OBB2& boxB) { //set boxA as relative center Vec2 boxPoints[4]; boxB.GetCornerPositions( &boxPoints[0] ); FloatRange boxBRange = GetRangeOnProjectedAxis( 4, &boxPoints[0], boxA.GetCenter(), boxA.GetIBasisNormal() ); Vec2 boxAHalfDim = boxA.GetDimensions()*.5f; FloatRange boxARange( -boxAHalfDim.x, boxAHalfDim.x ); if( !boxARange.DoesOverlap( boxBRange ) ) return false; boxBRange = GetRangeOnProjectedAxis( 4, &boxPoints[0], boxA.GetCenter(), boxA.GetJBasisNormal() ); boxARange = FloatRange( -boxAHalfDim.y, boxAHalfDim.y ); if( !boxARange.DoesOverlap( boxBRange ) ) return false; //Set boxB as relative center boxA.GetCornerPositions( &boxPoints[0] ); boxARange = GetRangeOnProjectedAxis( 4, &boxPoints[0], boxB.GetCenter(), boxB.GetIBasisNormal() ); Vec2 boxBHalfDim = boxB.GetDimensions() * .5f; boxBRange= FloatRange( -boxBHalfDim.x, boxBHalfDim.x ); if( !boxBRange.DoesOverlap( boxARange ) ) return false; boxARange = GetRangeOnProjectedAxis( 4, &boxPoints[0], boxB.GetCenter(), boxB.GetJBasisNormal() ); boxBRange = FloatRange( -boxBHalfDim.y, boxBHalfDim.y ); if( !boxBRange.DoesOverlap( boxARange ) ) return false; return true; } ////////////////////////////////////////////////////////////////////////// void PushDiscOutOfDisc2D( Vec2& discMobile, float radiusMobile, const Vec2& discStill, float radiusStill ) { Vec2 stillToPushed = discMobile - discStill; float radiusSum = radiusMobile + radiusStill; float stillToPushedSquared = stillToPushed.GetLengthSquared(); if( stillToPushedSquared < radiusSum*radiusSum ) { float scale = radiusSum / std::sqrtf( stillToPushedSquared ); stillToPushed *= scale; discMobile = discStill + stillToPushed; } } ////////////////////////////////////////////////////////////////////////// void PushDiscsOutOfEachOther2D( Vec2& discA, float radiusA, Vec2& discB, float radiusB) { Vec2 difference = discA - discB; float radiusSum = radiusA + radiusB; float diffSquared = difference.GetLengthSquared(); if( diffSquared < radiusSum*radiusSum ) { float diff = std::sqrtf( diffSquared ); float scale = (radiusA + radiusB - diff) * .5f / diff; difference *= scale; discA += difference; discB -= difference; } } ////////////////////////////////////////////////////////////////////////// void PushDiscOutOfPoint2D( Vec2& disc, float radius, const Vec2& point ) { Vec2 pointToDisc = disc-point; float pointToDiscDistanceSquared = pointToDisc.GetLengthSquared(); if( radius*radius > pointToDiscDistanceSquared ) { float scale = radius / std::sqrtf( pointToDiscDistanceSquared ); pointToDisc *= scale; disc = point + pointToDisc; } } ////////////////////////////////////////////////////////////////////////// void PushDiscOutOfAABB2D( Vec2& disc, float radius, const AABB2& bounds ) { Vec2 pointOnBounds = GetNearestPointOnAABB2D( disc, bounds ); PushDiscOutOfPoint2D( disc, radius, pointOnBounds ); } ////////////////////////////////////////////////////////////////////////// bool NearlyEqual(float a, float b, float epsilon) { float diff = a - b; return (diff < epsilon) && (diff > -epsilon); } ////////////////////////////////////////////////////////////////////////// void SwapFloat(float& a, float& b) { float temp = b; b = a; a = temp; } ////////////////////////////////////////////////////////////////////////// float SqrtFloat(float a) { if (a < 0.f) { g_theConsole->PrintString(Rgba8::RED, "sqartFloat receive negative"); return 0.f; } else { return std::sqrtf(a); } } ////////////////////////////////////////////////////////////////////////// float AbsFloat(float a) { return a >= 0.f ? a : -a; } ////////////////////////////////////////////////////////////////////////// float SignFloat(float a) { return (a >= 0.f) ? 1.f : -1.f; } ////////////////////////////////////////////////////////////////////////// float MaxFloat(float a, float b, float c) { if (a > b) { if (a > c) { return a; } else { return c; } } else { if (b > c) { return b; } else { return c; } } } ////////////////////////////////////////////////////////////////////////// float MaxFloat(float a, float b) { return a > b ? a : b; } ////////////////////////////////////////////////////////////////////////// float MinFloat(float a, float b, float c) { if (a < b) { if (a < c) { return a; } else { return c; } } else { if (b < c) { return b; } else { return c; } } } ////////////////////////////////////////////////////////////////////////// float MinFloat(float a, float b) { return a < b ? a : b; } ////////////////////////////////////////////////////////////////////////// bool IsAbsValueBigger( float a, float b ) { return AbsFloat(a) > AbsFloat(b); } ////////////////////////////////////////////////////////////////////////// float RangeMapFloatClamped(float inBegin, float inEnd, float outBegin, float outEnd, float inTarget) { inTarget = Clamp(inTarget, inBegin, inEnd); return RangeMapFloat(inBegin,inEnd,outBegin,outEnd,inTarget); } ////////////////////////////////////////////////////////////////////////// float RangeMapFloat( float inBegin, float inEnd, float outBegin, float outEnd, float inTarget ) { float fraction = GetFractionInRange( inBegin, inEnd, inTarget ); return outBegin + fraction * (outEnd - outBegin); } ////////////////////////////////////////////////////////////////////////// Vec2 RangeMapVector2D(Vec2 const& inBegin, Vec2 const& inEnd, Vec2 const& outBegin, Vec2 const& outEnd, Vec2 const& inTarget) { float x = RangeMapFloat(inBegin.x, inEnd.x, outBegin.x, outEnd.x, inTarget.x); float y = RangeMapFloat(inBegin.y, inEnd.y, outBegin.y, outEnd.y, inTarget.y); return Vec2(x, y); } ////////////////////////////////////////////////////////////////////////// Vec3 RangeMapVector3D(Vec3 const& inBegin, Vec3 const& inEnd, Vec3 const& outBegin, Vec3 const& outEnd, Vec3 const& inTarget) { float x = RangeMapFloat(inBegin.x, inEnd.x, outBegin.x, outEnd.x, inTarget.x); float y = RangeMapFloat(inBegin.y, inEnd.y, outBegin.y, outEnd.y, inTarget.y); float z = RangeMapFloat(inBegin.z, inEnd.z, outBegin.z, outEnd.z, inTarget.z); return Vec3(x, y, z); } ////////////////////////////////////////////////////////////////////////// float GetFractionInRange( float begin, float end, float target ) { if( begin == end ) return 0.f; else return (target - begin) / (end - begin); } ////////////////////////////////////////////////////////////////////////// LineSegment2 ClipLineSegmentToLineSegment(LineSegment2 const& toClip, LineSegment2 const& refLine) { Vec2 start = refLine.GetNearestPoint(toClip.start); Vec2 end = refLine.GetNearestPoint(toClip.end); return LineSegment2(start, end); } ////////////////////////////////////////////////////////////////////////// float Clamp( float target, float begin, float end ) { if( target < begin ) return begin; else if( target > end ) return end; else return target; } ////////////////////////////////////////////////////////////////////////// int Clamp(int target, int begin, int end) { if (target > end) { return end; } else if (target < begin) { return begin; } return target; } ////////////////////////////////////////////////////////////////////////// double Clamp(double target, double begin, double end) { if (target > end) { return end; } else if (target < begin) { return begin; } return target; } ////////////////////////////////////////////////////////////////////////// float ClampZeroToOne( float target ) { if( target < 0.f ) return 0.f; else if( target > 1.f ) return 1.f; else return target; } ////////////////////////////////////////////////////////////////////////// float Interpolate( float a, float b, float fractionOfB ) { return (1 - fractionOfB) * a + b * fractionOfB; } ////////////////////////////////////////////////////////////////////////// Vec2 Interpolate(Vec2 const& vecA, Vec2 const& vecB, float fractionOfB) { return fractionOfB*vecB + (1.f-fractionOfB)*vecA; } ////////////////////////////////////////////////////////////////////////// float Round( float value ) { return static_cast<float>(RoundToNearestInt( value )); } ////////////////////////////////////////////////////////////////////////// int RoundDownToInt( float value ) { if( value >= 0.f ) return static_cast<int>(value); else return static_cast<int>(value) - 1; } ////////////////////////////////////////////////////////////////////////// int RoundToNearestInt( float value ) { if( value > 0 ) { value += .5f; } else { value -= .5f; } return static_cast<int>(value); } ////////////////////////////////////////////////////////////////////////// float SmoothStart2( float t ) { return t * t; } ////////////////////////////////////////////////////////////////////////// float SmoothStart3( float t ) { return t * t * t; } ////////////////////////////////////////////////////////////////////////// float SmoothStart4( float t ) { return t * t * t * t; } ////////////////////////////////////////////////////////////////////////// float SmoothStart5( float t ) { return t * t * t * t * t; } ////////////////////////////////////////////////////////////////////////// float SmoothStop2( float t ) { return -t * t + 2 * t; } ////////////////////////////////////////////////////////////////////////// float SmoothStop3( float t ) { float m = t - 1; return -m * m * m + 1; } ////////////////////////////////////////////////////////////////////////// float SmoothStop4( float t ) { float m = t - 1; return -m * m * m * m + 1; } ////////////////////////////////////////////////////////////////////////// float SmoothStop5( float t ) { float m = t - 1; return -m * m * m * m * m + 1; } ////////////////////////////////////////////////////////////////////////// float SmoothStep3( float t ) { return 3 * t * t - 2 * t * t * t; }
31.434266
161
0.574323
yixuan-wei
1427aa5826b3287720e85bc8104ef422c9a60b21
6,505
cc
C++
src/storage/volume_image/utils/lz4_compressor.cc
oshunter/fuchsia
2196fc8c176d01969466b97bba3f31ec55f7767b
[ "BSD-3-Clause" ]
2
2020-08-16T15:32:35.000Z
2021-11-07T20:09:46.000Z
src/storage/volume_image/utils/lz4_compressor.cc
oshunter/fuchsia
2196fc8c176d01969466b97bba3f31ec55f7767b
[ "BSD-3-Clause" ]
null
null
null
src/storage/volume_image/utils/lz4_compressor.cc
oshunter/fuchsia
2196fc8c176d01969466b97bba3f31ec55f7767b
[ "BSD-3-Clause" ]
1
2021-08-15T04:29:11.000Z
2021-08-15T04:29:11.000Z
// Copyright 2020 The Fuchsia Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "src/storage/volume_image/utils/lz4_compressor.h" #include "src/storage/volume_image/options.h" namespace storage::volume_image { namespace { // Wrapper on top of LZ4* function return code. class Lz4Result { public: // Implicit conversion from LZ4F_error_code_t. Lz4Result(LZ4F_errorCode_t code) : code_(code) {} // Returns true if the underlying |code_| is not an error. bool is_ok() const { return !is_error(); } // Returns true if the underlying |code_| is an error. bool is_error() const { return LZ4F_isError(code_); } // Returns a view into the error name of the underlying |code_|. std::string_view error() const { assert(is_error()); return std::string_view(LZ4F_getErrorName(code_)); } // Returns the byte count, when overriden return value happens. This usually means that // a function either returns a negative value or a number of bytes. size_t byte_count() const { assert(is_ok() && code_ >= 0); return static_cast<size_t>(code_); } private: LZ4F_errorCode_t code_ = -1; }; Lz4Compressor::Preferences ConvertOptionsToPreferences( const CompressionOptions& compression_options) { Lz4Compressor::Preferences preferences = {}; preferences.frameInfo.blockMode = LZ4F_blockIndependent; const auto& options = compression_options.options; auto const_it = options.find("block_size"); int block_size_kb = 0; if (const_it != options.end()) { block_size_kb = static_cast<int>(const_it->second); } LZ4F_blockSizeID_t block_size_id = LZ4F_max64KB; if (block_size_kb <= 64) { block_size_id = LZ4F_max64KB; } else if (block_size_kb <= 256) { block_size_id = LZ4F_max256KB; } else if (block_size_kb <= 1024) { block_size_id = LZ4F_max1MB; } else { block_size_id = LZ4F_max4MB; } preferences.frameInfo.blockSizeID = block_size_id; const_it = options.find("compression_level"); int compression_level = 0; if (const_it != options.end()) { compression_level = static_cast<int>(const_it->second); } preferences.compressionLevel = compression_level; return preferences; } } // namespace Lz4Compressor::~Lz4Compressor() { if (context_ != nullptr) { LZ4F_freeCompressionContext(context_); context_ = nullptr; } } fit::result<Lz4Compressor, std::string> Lz4Compressor::Create(const CompressionOptions& options) { if (options.schema != CompressionSchema::kLz4) { std::string error = "Lz4Compressor requires"; error.append(EnumAsString(CompressionSchema::kLz4)) .append(". Provided: ") .append(EnumAsString(options.schema)) .append("."); return fit::error(error); } Preferences preferences = ConvertOptionsToPreferences(options); return fit::ok(Lz4Compressor(preferences)); } fit::result<void, std::string> Lz4Compressor::Prepare(Handler handler) { if (state_ != State::kInitalized && state_ != State::kFinalized) { return fit::error("Lz4Compressor::Prepare must be in |kInitialized| or |kFinalized| state."); } if (handler == nullptr) { return fit::error("Lz4Compressor::Prepare requires a valid |handler|."); } Lz4Result result = LZ4F_createCompressionContext(&context_, LZ4F_VERSION); if (result.is_error()) { std::string error = "Failed to create LZ4 Compression Context. LZ4 Error: "; error.append(result.error()).append("."); return fit::error(error); } // Adjust buffer so it fits the header. if (compression_buffer_.size() < LZ4F_HEADER_SIZE_MAX) { compression_buffer_.resize(LZ4F_HEADER_SIZE_MAX, 0); } handler_ = std::move(handler); result = LZ4F_compressBegin(context_, compression_buffer_.data(), compression_buffer_.size(), &preferences_); if (result.is_error()) { std::string error = "Failed to emit LZ4 Frame header. LZ4 Error: "; error.append(result.error()).append("."); return fit::error(error); } state_ = State::kPrepared; return handler_(fbl::Span(compression_buffer_.data(), result.byte_count())); } fit::result<void, std::string> Lz4Compressor::Compress(fbl::Span<const uint8_t> uncompressed_data) { if (state_ != State::kPrepared && state_ != State::kCompressed) { return fit::error("Lz4Compressor::Compress must be in |kPrepared| or |kCompressed| state."); } size_t max_compressed_size = LZ4F_compressBound(uncompressed_data.size(), &preferences_); if (compression_buffer_.size() < max_compressed_size) { compression_buffer_.resize(max_compressed_size, 0); } Lz4Result result = LZ4F_compressUpdate(context_, compression_buffer_.data(), compression_buffer_.size(), uncompressed_data.data(), uncompressed_data.size(), nullptr); if (result.is_error()) { std::string error = "Failed to compress data with LZ4 compressor. LZ4 Error: "; error.append(result.error()).append("."); return fit::error(error); } state_ = State::kCompressed; return handler_(fbl::Span(compression_buffer_.data(), result.byte_count())); } fit::result<void, std::string> Lz4Compressor::Finalize() { if (state_ != State::kCompressed) { return fit::error("Lz4Compressor::Finalize must be in |kCompressed| state."); } size_t max_compressed_size = LZ4F_compressBound(0, &preferences_); if (compression_buffer_.size() < max_compressed_size) { compression_buffer_.resize(max_compressed_size, 0); } Lz4Result result = LZ4F_compressEnd(context_, compression_buffer_.data(), compression_buffer_.size(), nullptr); if (result.is_error()) { std::string error = "Failed to finalize compression with LZ4 Compressor. LZ4 Error: "; error.append(result.error()).append("."); return fit::error(error); } auto handler_result = handler_(fbl::Span(compression_buffer_.data(), result.byte_count())); // Even though we can reuse compression context after compressionEnd, its preferred not to // delegate this to the destructor, since it may error, and we wont be able to surface it. result = LZ4F_freeCompressionContext(context_); context_ = nullptr; if (result.is_error()) { std::string error = "Failed to free compression contrext in LZ4 Compressor. LZ4 Error: "; error.append(result.error()).append("."); return fit::error(error); } state_ = State::kFinalized; return handler_result; } } // namespace storage::volume_image
34.417989
100
0.708686
oshunter
1428f0a86b442b4b67e4cea7685687b2a796bf5c
4,058
cpp
C++
main.cpp
kobli/GPU-fluid_simulation
99a4f3964a48f8e76be3a545a1358cc92a512ff4
[ "MIT" ]
null
null
null
main.cpp
kobli/GPU-fluid_simulation
99a4f3964a48f8e76be3a545a1358cc92a512ff4
[ "MIT" ]
null
null
null
main.cpp
kobli/GPU-fluid_simulation
99a4f3964a48f8e76be3a545a1358cc92a512ff4
[ "MIT" ]
null
null
null
#define _USE_MATH_DEFINES #include <memory> #include <sstream> #include <iomanip> #include <GL/glew.h> #include <GL/gl.h> #include <GL/glext.h> #include <GL/freeglut.h> #include "utils.hpp" #include "application.hpp" #include "sphGpu.hpp" #include "sphCpu.hpp" ///////////////////////////// BEGINNING OF CONFIGURATION //////////////////////////////// unsigned WinSize = 1024; unsigned ParticleN = 1024*8; // must be power of two unsigned SubdivisionN = 8; // must be power of two vec3 BoxSize{2,2,2}; const float Step = 0.005; // [seconds] const float H = 0.1; const float M = 32; const float Rho0 = 1; const float K = 2.4; const float Mu = 2048; using SPHimpl = SPHgpu; //using SPHimpl = SPHcpu; ///////////////////////////// END OF CONFIGURATION //////////////////////////////// std::unique_ptr<SPHconfig> config; using namespace std; unique_ptr<Application> app; void DrawImage( void ) { app->draw(); glutSwapBuffers(); } static void HandleKeys(unsigned char key, int /*x*/, int /*y*/) { switch (key) { case 27: // ESC exit(0); break; case 'r': app->reset(); break; case 's': config->Step /= 2; break; case 'S': config->Step *= 2; break; case 'h': config->H /= 2; break; case 'H': config->H *= 2; break; case 'm': config->M /= 2; break; case 'M': config->M *= 2; break; case 'k': config->K /= 2; break; case 'K': config->K *= 2; break; case 'u': config->Mu /= 2; break; case 'U': config->Mu *= 2; break; case 'o': config->Rho0 /= 2; break; case 'O': config->Rho0 *= 2; break; } cout << "step: " << Step << endl; cout << "h: " << H << endl; cout << "m: " << M << endl; cout << "k: " << K << endl; cout << "mu: " << Mu << endl; cout << "rho0: " << Rho0 << endl; cout << endl; } void idleFunc() { app->update(); ostringstream title; title << "SPH demo - avg frame time: " << std::fixed << setw(8) << setprecision(2) << app->avgFrameTime << " [ms]"; glutSetWindowTitle(title.str().c_str()); glutPostRedisplay(); } int main(int argc, char* argv[]) { cout << "usage: " << argv[0] << " [particleN [subdivisionN [boxSize [windowSize]]]]\n"; if(argc >= 2) ParticleN = std::stoi(argv[1]); if(argc >= 3) SubdivisionN = std::stoi(argv[2]); if(argc >= 4) BoxSize = {std::stoi(argv[3]), std::stoi(argv[3]), std::stoi(argv[3])}; if(argc >= 5) WinSize = std::stoi(argv[4]); double p = log2(ParticleN); if(ParticleN < 1024 || p != int(p)) { std::cerr << "ParticleN must be at least 1024 and it must be a power of two\n"; exit(1); } p = log2(SubdivisionN); if(SubdivisionN < 1 || p != int(p)) { std::cerr << "SubdivisionN must be a power of two, >=1\n"; exit(1); } config.reset(new SPHconfig(ParticleN, SubdivisionN)); config->Step = Step; config->H = H; config->M = M; config->Rho0 = Rho0; config->K = K; config->Mu = Mu; glutInit(&argc, argv); #ifdef DEBUG cout << "Debug build\n"; glutInitContextFlags (GLUT_CORE_PROFILE | GLUT_DEBUG); #else cout << "Release build\n"; glutInitContextFlags (GLUT_CORE_PROFILE); #endif glutInitWindowSize(WinSize, WinSize); glutInitDisplayMode( GLUT_DOUBLE | GLUT_RGBA ); glutCreateWindow("SPH demo"); if(glewInit()) { cerr << "Cannot initialize GLEW\n"; exit(EXIT_FAILURE); } #ifdef DEBUG if(glDebugMessageCallback){ cout << "Register OpenGL debug callback " << endl; glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS); glDebugMessageCallback(GLDEBUGPROC(openglCallbackFunction), nullptr); GLuint unusedIds = 0; glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DONT_CARE, 0, &unusedIds, true); } else cout << "glDebugMessageCallback not available" << endl; #endif std::cout << "# of particles: " << ParticleN << std::endl; std::cout << "level of subdivision: " << SubdivisionN << std::endl; glutDisplayFunc(DrawImage); glutKeyboardFunc(HandleKeys); glutIdleFunc(idleFunc); Bounds b(BoxSize); app.reset(new Application(std::unique_ptr<SPH>(new SPHimpl(*config, b)), b)); glutMainLoop(); return 0; }
22.926554
116
0.608428
kobli
289f713aef0c7ec09bdca2676d6242c798567c2b
2,112
cpp
C++
cpp/godot-cpp/src/gen/NavigationPolygonInstance.cpp
GDNative-Gradle/proof-of-concept
162f467430760cf959f68f1638adc663fd05c5fd
[ "MIT" ]
1
2021-03-16T09:51:00.000Z
2021-03-16T09:51:00.000Z
cpp/godot-cpp/src/gen/NavigationPolygonInstance.cpp
GDNative-Gradle/proof-of-concept
162f467430760cf959f68f1638adc663fd05c5fd
[ "MIT" ]
null
null
null
cpp/godot-cpp/src/gen/NavigationPolygonInstance.cpp
GDNative-Gradle/proof-of-concept
162f467430760cf959f68f1638adc663fd05c5fd
[ "MIT" ]
null
null
null
#include "NavigationPolygonInstance.hpp" #include <core/GodotGlobal.hpp> #include <core/CoreTypes.hpp> #include <core/Ref.hpp> #include <core/Godot.hpp> #include "__icalls.hpp" #include "NavigationPolygon.hpp" namespace godot { NavigationPolygonInstance::___method_bindings NavigationPolygonInstance::___mb = {}; void NavigationPolygonInstance::___init_method_bindings() { ___mb.mb__navpoly_changed = godot::api->godot_method_bind_get_method("NavigationPolygonInstance", "_navpoly_changed"); ___mb.mb_get_navigation_polygon = godot::api->godot_method_bind_get_method("NavigationPolygonInstance", "get_navigation_polygon"); ___mb.mb_is_enabled = godot::api->godot_method_bind_get_method("NavigationPolygonInstance", "is_enabled"); ___mb.mb_set_enabled = godot::api->godot_method_bind_get_method("NavigationPolygonInstance", "set_enabled"); ___mb.mb_set_navigation_polygon = godot::api->godot_method_bind_get_method("NavigationPolygonInstance", "set_navigation_polygon"); } NavigationPolygonInstance *NavigationPolygonInstance::_new() { return (NavigationPolygonInstance *) godot::nativescript_1_1_api->godot_nativescript_get_instance_binding_data(godot::_RegisterState::language_index, godot::api->godot_get_class_constructor((char *)"NavigationPolygonInstance")()); } void NavigationPolygonInstance::_navpoly_changed() { ___godot_icall_void(___mb.mb__navpoly_changed, (const Object *) this); } Ref<NavigationPolygon> NavigationPolygonInstance::get_navigation_polygon() const { return Ref<NavigationPolygon>::__internal_constructor(___godot_icall_Object(___mb.mb_get_navigation_polygon, (const Object *) this)); } bool NavigationPolygonInstance::is_enabled() const { return ___godot_icall_bool(___mb.mb_is_enabled, (const Object *) this); } void NavigationPolygonInstance::set_enabled(const bool enabled) { ___godot_icall_void_bool(___mb.mb_set_enabled, (const Object *) this, enabled); } void NavigationPolygonInstance::set_navigation_polygon(const Ref<NavigationPolygon> navpoly) { ___godot_icall_void_Object(___mb.mb_set_navigation_polygon, (const Object *) this, navpoly.ptr()); } }
40.615385
231
0.822443
GDNative-Gradle
28a27b9b294e8154099ac2d58758e895acec5ee3
31,116
cxx
C++
Plugins/VisItDatabaseBridge/vtkVisItDatabaseBridge.cxx
matthb2/ParaView-beforekitwareswtichedtogit
e47e57d6ce88444d9e6af9ab29f9db8c23d24cef
[ "BSD-3-Clause" ]
1
2021-07-31T19:38:03.000Z
2021-07-31T19:38:03.000Z
Plugins/VisItDatabaseBridge/vtkVisItDatabaseBridge.cxx
matthb2/ParaView-beforekitwareswtichedtogit
e47e57d6ce88444d9e6af9ab29f9db8c23d24cef
[ "BSD-3-Clause" ]
null
null
null
Plugins/VisItDatabaseBridge/vtkVisItDatabaseBridge.cxx
matthb2/ParaView-beforekitwareswtichedtogit
e47e57d6ce88444d9e6af9ab29f9db8c23d24cef
[ "BSD-3-Clause" ]
2
2019-01-22T19:51:40.000Z
2021-07-31T19:38:05.000Z
/*========================================================================= Program: Visualization Toolkit Module: $RCSfile$ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen All rights reserved. See Copyright.txt or http://www.kitware.com/Copyright.htm for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notice for more information. =========================================================================*/ #include "vtkVisItDatabaseBridge.h" #include "vtkVisItDatabase.h" #include "vtkVisItDatabaseBridgeTypes.h" #include "vtkCallbackCommand.h" #include "vtkCompositeDataPipeline.h" #include "vtkDataArraySelection.h" #include "vtkHierarchicalBoxDataSet.h" #include "vtkInformation.h" #include "vtkInformationVector.h" #include "vtkMultiBlockDataSet.h" #include "vtkMutableDirectedGraph.h" #include "vtkObjectFactory.h" #include "vtkPointData.h" #include "vtkProcessModule.h" #include "vtkRectilinearGrid.h" #include "vtkStreamingDemandDrivenPipeline.h" #include "vtkStructuredGrid.h" #include "vtkUnstructuredGrid.h" #include "vtkProcessModule.h" #include "vtkPVOptions.h" #include <vtksys/SystemTools.hxx> #include <vtkstd/string> using vtkstd::string; #include <vtkstd/vector> using vtkstd::vector; vtkCxxRevisionMacro(vtkVisItDatabaseBridge, "$Revision$"); vtkStandardNewMacro(vtkVisItDatabaseBridge); // Never try to print a null pointer to a string. const char *safeio(const char *s){ return (s?s:"NULL"); } // Compare two doubles. int fequal(double a, double b, double tol) { double pda=fabs(a); double pdb=fabs(b); pda=pda<tol?tol:pda; pdb=pdb<tol?tol:pdb; double smaller=pda<pdb?pda:pdb; double norm=fabs(b-a)/smaller; if (norm<=tol) { return 1; } return 0; } //----------------------------------------------------------------------------- vtkVisItDatabaseBridge::vtkVisItDatabaseBridge() { #if defined vtkVisItDatabaseBridgeDEBUG cerr << "====================================================================vtkVisItDatabaseBridge" << endl; #endif this->FileName=0; this->PluginId=0; this->PluginPath=0; const char* executable_path = vtkProcessModule::GetProcessModule()-> GetOptions()->GetArgv0(); this->SetPluginPath( vtksys::SystemTools::GetFilenamePath(executable_path).c_str()); this->Clear(); this->VisitSource=vtkVisItDatabase::New(); this->SetNumberOfInputPorts(0); this->SetNumberOfOutputPorts(1); /// PV Interface. // Setup the selection callback to modify this object when // selections are changed. this->SelectionObserver = vtkCallbackCommand::New(); this->SelectionObserver->SetCallback( &vtkVisItDatabaseBridge::SelectionModifiedCallback); this->SelectionObserver->SetClientData(this); this->DatabaseViewMTime=0; } //----------------------------------------------------------------------------- vtkVisItDatabaseBridge::~vtkVisItDatabaseBridge() { #if defined vtkVisItDatabaseBridgeDEBUG cerr << "====================================================================~vtkVisItDatabaseBridge" << endl; #endif this->Clear(); if (this->VisitSource) { this->VisitSource->Delete(); } /// PV Interface. this->SelectionObserver->Delete(); } //----------------------------------------------------------------------------- int vtkVisItDatabaseBridge::UpdateVisitSource() { int ok; // We need to re-configure first. if (this->UpdatePlugin) { this->VisitSource->SetPluginPath(this->PluginPath); this->VisitSource->SetPluginId(this->PluginId); ok=this->VisitSource->Configure(); if (!ok) { vtkWarningMacro("Failed to configure the Visit source."); return 0; } this->UpdatePlugin=0; } // We need to reload the database first. if (this->UpdateDatabase) { this->VisitSource->CloseDatabase(); this->VisitSource->SetFileName(this->FileName); ok=this->VisitSource->OpenDatabase(); if (!ok) { vtkWarningMacro("Failed to open the Visit database."); return 0; } this->UpdateDatabase=0; } return 1; } //---------------------------------------------------------------------------- vtkExecutive* vtkVisItDatabaseBridge::CreateDefaultExecutive() { #if defined vtkVisItDatabaseBridgeDEBUG cerr << "====================================================================CreateDefaultExecutive" << endl; #endif return vtkCompositeDataPipeline::New(); } //----------------------------------------------------------------------------- void vtkVisItDatabaseBridge::Clear() { this->SetFileName(0); this->SetPluginId(0); //this->SetPluginPath(0); this->UpdatePlugin=1; this->UpdateDatabase=1; this->UpdateDatabaseView=1; } //----------------------------------------------------------------------------- int vtkVisItDatabaseBridge::CanReadFile(const char *file) { #if defined vtkVisItDatabaseBridgeDEBUG cerr << "====================================================================CanReadFile" << endl; cerr << "Check " << safeio(file) << "." << endl; #endif // Configure. if (this->UpdatePlugin || !this->VisitSource->Configured()) { this->VisitSource->SetPluginPath(this->PluginPath); this->VisitSource->SetPluginId(this->PluginId); int ok=this->VisitSource->Configure(); if (!ok) { vtkWarningMacro("Failed to configure the Visit source."); return 0; } this->UpdatePlugin=0; } // Close. this->VisitSource->CloseDatabase(); // Open with new file. this->VisitSource->SetFileName(file); int ret=this->VisitSource->OpenDatabase(); this->VisitSource->SetFileName(NULL); // Note to self, to re-load the database. this->UpdateDatabase=1; this->UpdateDatabaseView=1; return ret; } //----------------------------------------------------------------------------- void vtkVisItDatabaseBridge::SetFileName(const char* _arg) { #if defined vtkVisItDatabaseBridgeDEBUG cerr << "Set FileName from " << safeio(this->FileName) << " to " << safeio(_arg) << "." << endl; #endif vtkDebugMacro(<< this->GetClassName() << ": setting FileName to " << (_arg?_arg:"(null)")); if (this->FileName == NULL && _arg == NULL) { return;} if (this->FileName && _arg && (!strcmp(this->FileName,_arg))) { return;} if (this->FileName) { delete [] this->FileName; } if (_arg) { size_t n = strlen(_arg) + 1; char *cp1 = new char[n]; const char *cp2 = (_arg); this->FileName = cp1; do { *cp1++ = *cp2++; } while ( --n ); } else { this->FileName = NULL; } // This tells us that the current database must be re-loaded. this->UpdateDatabase=1; this->UpdateDatabaseView=1; this->Modified(); } //----------------------------------------------------------------------------- void vtkVisItDatabaseBridge::SetPluginPath(const char* _arg) { #if defined vtkVisItDatabaseBridgeDEBUG cerr << "Set PluginPath from " << safeio(this->PluginPath) << " to " << safeio(_arg) << "." << endl; #endif vtkDebugMacro(<< this->GetClassName() << ": setting PluginPath to " << (_arg?_arg:"(null)")); if (this->PluginPath == NULL && _arg == NULL) { return;} if (this->PluginPath && _arg && (!strcmp(this->PluginPath,_arg))) { return;} if (this->PluginPath) { delete [] this->PluginPath; } if (_arg) { size_t n = strlen(_arg) + 1; char *cp1 = new char[n]; const char *cp2 = (_arg); this->PluginPath = cp1; do { *cp1++ = *cp2++; } while ( --n ); } else { this->PluginPath = NULL; } // This tells us that the current plugin & database must be // re-loaded. this->UpdatePlugin=1; this->UpdateDatabase=1; this->UpdateDatabaseView=1; this->Modified(); } //----------------------------------------------------------------------------- void vtkVisItDatabaseBridge::SetPluginId(const char* _arg) { #if defined vtkVisItDatabaseBridgeDEBUG cerr << "Set PluginId from " << safeio(this->PluginId) << " to " << safeio(_arg) << "." << endl; #endif vtkDebugMacro(<< this->GetClassName() << ": setting PluginId to " << (_arg?_arg:"(null)")); if (this->PluginId == NULL && _arg == NULL) { return;} if (this->PluginId && _arg && (!strcmp(this->PluginId,_arg))) { return;} if (this->PluginId) { delete [] this->PluginId; } if (_arg) { size_t n = strlen(_arg) + 1; char *cp1 = new char[n]; const char *cp2 = (_arg); this->PluginId = cp1; do { *cp1++ = *cp2++; } while ( --n ); } else { this->PluginId = NULL; } // This tells us that the current plugin and database must be // re-loaded. this->UpdatePlugin=1; this->UpdateDatabase=1; this->UpdateDatabaseView=1; this->Modified(); } //----------------------------------------------------------------------------- int vtkVisItDatabaseBridge::RequestInformation( vtkInformation* req, vtkInformationVector** inputVector, vtkInformationVector* outputVector) { #if defined vtkVisItDatabaseBridgeDEBUG cerr << "====================================================================RequestInformation" << endl; #endif if (!this->UpdateDatabaseView) { // Nothing has changed since the last request for information, // so we have nothing to do. return 1; } this->UpdateDatabaseView=0; vtkInformation* info=outputVector->GetInformationObject(0); const int nMeshes=this->VisitSource->GetNumberOfMeshes(); // Either, Multiple meshes are stored in this file if (nMeshes>1) { info->Set(vtkStreamingDemandDrivenPipeline::MAXIMUM_NUMBER_OF_PIECES(),-1); } // Or, a single mesh is stored in this file. else { // Either the data produced is AMR or MultiBlock data... if (this->VisitSource->ProducesAMRData(0) || this->VisitSource->ProducesMultiBlockData(0)) { info->Set(vtkStreamingDemandDrivenPipeline::MAXIMUM_NUMBER_OF_PIECES(),-1); } // Or, the data produced is ordinary VTK data. else { if (this->VisitSource->DecomposesDomain()) { info->Set(vtkStreamingDemandDrivenPipeline::MAXIMUM_NUMBER_OF_PIECES(),-1); // TODO: Databases with this property decide how the data is split up. } else if (this->VisitSource->ProducesStructuredData(0)) { if (!info->Has(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT())) { // i,j,k extents can't be found without reading data... // insert this place holder and adjust in RequestData. int ext[6]={0,1,0,1,0,1}; info->Set(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT(),ext,6); #if defined vtkVisItDatabaseBridgeDEBUG cerr << "Set extents to 0, 1, 0, 1, 0, 1." << endl; #endif } } else { info->Set(vtkStreamingDemandDrivenPipeline::MAXIMUM_NUMBER_OF_PIECES(),1); } } } // Create a view of the SIL. The SIL tells us the relationships // of the various entities in the database. The view exposes // these to the U.I. for convenient manipulation. vtkMutableDirectedGraph *view=vtkMutableDirectedGraph::New(); this->VisitSource->GenerateDatabaseView(view); info->Set(vtkDataObject::SIL(), view); view->Delete(); ++this->DatabaseViewMTime; // Enumerate Array and Expressions as strings because the client // will send a list of id's while VisIt expects the strings. this->ArrayNames.clear(); this->VisitSource->EnumerateDataArrays(this->ArrayNames); this->ExpressionNames.clear(); this->VisitSource->EnumerateExpressions(this->ExpressionNames); // Determine which time steps are available. vector<double> times; this->VisitSource->EnumerateTimeSteps(times); info->Set(vtkStreamingDemandDrivenPipeline::TIME_STEPS(),&times[0],times.size()); if (times.size()>1) { double timeRange[2]={times[0],times[times.size()-1]}; info->Set(vtkStreamingDemandDrivenPipeline::TIME_RANGE(),timeRange,2); } return 1; } //---------------------------------------------------------------------------- int vtkVisItDatabaseBridge::RequestDataObject( vtkInformation* /*req*/, vtkInformationVector** /*inputVector*/, vtkInformationVector* outputVector) { #if defined vtkVisItDatabaseBridgeDEBUG cerr << "====================================================================RequestDataObject" << endl; cerr << safeio(this->FileName) << endl; #endif int ok; ok=this->UpdateVisitSource(); if (!ok) { vtkWarningMacro("Failed to update the visit source."); return 0; } ok=this->VisitSource->UpdateMetaData(); if (!ok) { vtkWarningMacro("Failed to read the meta-data."); return 0; } vtkInformation* info=outputVector->GetInformationObject(0); // Construct the data object. // TODO no need to construct each time. const char *datasetType=this->VisitSource->GetDataObjectType(); vtkDataObject *dataset=this->VisitSource->GetDataObject(); if (!datasetType||!dataset) { vtkWarningMacro( "Failed to get the dataset or type. DatasetType is " << safeio(datasetType) << ". DataSet is " << dataset << ". "); return 0; } info->Set(vtkDataObject::DATA_TYPE_NAME(),datasetType); info->Set(vtkDataObject::DATA_OBJECT(),dataset); info->Set(vtkDataObject::DATA_EXTENT_TYPE(), dataset->GetExtentType()); dataset->SetPipelineInformation(info); dataset->Delete(); #if defined vtkVisItDatabaseBridgeDEBUG cerr << "datasetType=" << info->Get(vtkDataObject::DATA_TYPE_NAME()) << endl; cerr << "dataset=" << info->Get(vtkDataObject::DATA_OBJECT()) << endl; #endif // TODO delete data return 1; } //----------------------------------------------------------------------------- void vtkVisItDatabaseBridge::DistributeBlocks( int procId, int nProcs, int nBlocks, vtkstd::vector<int> &blockIds) { #if defined vtkVisItDatabaseBridgeDEBUG cerr << "====================================================================DistributeBlocks" << endl; #endif if (nProcs>nBlocks) { vtkWarningMacro("More processes than data blocks, some will have no data."); if (procId<nBlocks) { blockIds.push_back(procId); } } else { int nBlocksPerProc=nBlocks/nProcs; int nLeftOver=nBlocks%nProcs; int lastProc=nProcs-1; int nBlocks = nBlocksPerProc+(procId==lastProc?nLeftOver:0); int blockId=procId*nBlocksPerProc; blockIds.resize(nBlocks); for (int i=0; i<nBlocks; ++i) { blockIds[i]=blockId; ++blockId; } } size_t n=blockIds.size(); #if defined vtkVisItDatabaseBridgeDEBUG cerr << "Proc Id " << procId << " owns blocks " << blockIds[0] << " through " << blockIds[n-1] << "." << endl; #endif } //----------------------------------------------------------------------------- int vtkVisItDatabaseBridge::RequestData( vtkInformation * /*req*/, vtkInformationVector ** /*input*/, vtkInformationVector *output) { #if defined vtkVisItDatabaseBridgeDEBUG cerr << "====================================================================RequestData" << endl; #endif int ok; vtkInformation *outputInfo=output->GetInformationObject(0); // Get the output. vtkDataObject *dataOut=outputInfo->Get(vtkDataObject::DATA_OBJECT()); if (dataOut==NULL) { vtkWarningMacro("Filter data has not been configured correctly. Aborting."); return 1; } const size_t nActiveMeshes=this->MeshIds.size(); if (nActiveMeshes==0) { // No meshes selected then nothing to do. return 1; } // Determine what time step we are being asked for. if (outputInfo->Has(vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEPS())) { double *step = outputInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEPS()); int nSteps = outputInfo->Length(vtkStreamingDemandDrivenPipeline::TIME_STEPS()); double* steps = outputInfo->Get(vtkStreamingDemandDrivenPipeline::TIME_STEPS()); int stepId=-1; for (int i=0; i<nSteps; ++i) { if (fequal(steps[i],*step,1E-10)) { stepId=i; this->VisitSource->SetActiveTimeStep(i); break; } } outputInfo->Set(vtkDataObject::DATA_TIME_STEPS(),step,1); #if defined vtkVisItDatabaseBridgeDEBUG cerr << "Requested time " << step[0] << " at " << stepId << "." << endl; #endif } // TODO Make use of UPDATE_EXTENT ?? const int procId = outputInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_PIECE_NUMBER()); const int nProcs = outputInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_PIECES()); #if defined vtkVisItDatabaseBridgeDEBUG cerr << "I am " << procId << " of " << nProcs << "." << endl; #endif // Configure the data object. The pipeline Initializes dataobjects // after RequestDataObject so this has to be done here. ok=this->VisitSource->ConfigureDataObject(this->MeshIds,dataOut); if (!ok) { vtkWarningMacro("Failed to configure the output. Aborting."); return 1; } // Configure for the read. This involves sorting the arrays by mesh and // load balancing for multiblock data. vector<vector<int> >blockIdsThisProc(nActiveMeshes); vector<vector<string> >activeArrayNames(nActiveMeshes); for (int meshIdx=0; meshIdx<nActiveMeshes; ++meshIdx) { int meshId=this->MeshIds[meshIdx]; // Convert array id's into names for VisIt. Id's are negative // so that they do not conflict with SIL set ids. const size_t nActiveArrays=this->ArrayIds[meshIdx].size(); for (size_t arrayIdx=0; arrayIdx<nActiveArrays; ++arrayIdx) { int id=-this->ArrayIds[meshIdx][arrayIdx]-1; // ids are < 0 and off by one in the view. activeArrayNames[meshIdx].push_back(this->ArrayNames[meshId][id]); #if defined vtkVisItDatabaseBridgeDEBUG cerr << "Selected " << this->ArrayNames[meshId][id] << endl; #endif } // Distribute blocks to processes. const int nBlocks=this->VisitSource->GetNumberOfBlocks(this->MeshIds[meshIdx]); this->DistributeBlocks(procId,nProcs,nBlocks,blockIdsThisProc[meshIdx]); } this->UpdateProgress(0.5); // Read. ok=this->VisitSource->ReadData( this->MeshIds, activeArrayNames, blockIdsThisProc, this->DomainSSIds, this->MaterialSSIds, dataOut); ok=1; //TODO This is because AMR support is only partially complete. Remove this line after 3.6 release. if (!ok) { vtkWarningMacro( << "Read database encountered an error. Aborting execution."); return 1; } // FIXME if (!this->VisitSource->HasMultipleMeshes() && !this->VisitSource->ProducesAMRData(0) && !this->VisitSource->ProducesMultiBlockData(0) && this->VisitSource->ProducesStructuredData(0)) { // For structured data fix WHOLE_EXTENTS. In RequestDataObject // we set a place holder because we don't have a way of determining // index space extents before we read the meshes. vtkDataSet *ds; ds=dynamic_cast<vtkDataSet *>(dataOut); int ext[6]={0,1,0,1,0,1}; vtkRectilinearGrid *rg=dynamic_cast<vtkRectilinearGrid *>(dataOut); vtkStructuredGrid *sg=dynamic_cast<vtkStructuredGrid *>(dataOut); if (rg) { rg->GetExtent(ext); } else if (sg) { sg->GetExtent(ext); } outputInfo->Set(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT(),ext,6); } //dataOut->Print(cerr); return 1; } //----------------------------------------------------------------------------- void vtkVisItDatabaseBridge::PrintSelf(ostream& os, vtkIndent indent) { this->Superclass::PrintSelf(os,indent); os << indent << "FileName: " << safeio(this->FileName) << endl; os << indent << "PluginPath: " << safeio(this->PluginPath) << endl; os << indent << "PluginId: " << safeio(this->PluginId) << endl; this->VisitSource->PrintSelf(os,indent.GetNextIndent()); } /// U.I. //---------------------------------------------------------------------------- // observe PV interface and set modified if user makes changes void vtkVisItDatabaseBridge::SelectionModifiedCallback( vtkObject*, unsigned long, void* clientdata, void*) { vtkVisItDatabaseBridge *dbb = static_cast<vtkVisItDatabaseBridge*>(clientdata); dbb->Modified(); } //----------------------------------------------------------------------------- void vtkVisItDatabaseBridge::InitializeUI() { #if defined vtkVisItDatabaseBridgeDEBUG cerr << "====================================================================InitializeUI" << endl; #endif // initialize read lists. this->MeshIds.clear(); this->ArrayIds.clear(); this->ExpressionIds.clear(); this->DomainSSIds.clear(); this->BlockSSIds.clear(); this->AssemblySSIds.clear(); this->MaterialSSIds.clear(); this->SpeciesSSIds.clear(); this->Modified(); // Reset SIL Set operations. // this->DomainBlockSSOp=SIL_OPERATION_INTERSECT; // this->DomainAssemblySSOp=SIL_OPERATION_INTERSECT; // this->DomainMaterialSSOp=SIL_OPERATION_INTERSECT; } //----------------------------------------------------------------------------- void vtkVisItDatabaseBridge::SetNumberOfMeshes(int nMeshes) { #if defined vtkVisItDatabaseBridgeDEBUG cerr << "====================================================================SetNumberOfMeshes " << endl; #endif this->ArrayIds.clear(); this->ArrayIds.resize(nMeshes); this->ExpressionIds.clear(); this->ExpressionIds.resize(nMeshes); this->DomainSSIds.clear(); this->DomainSSIds.resize(nMeshes); this->BlockSSIds.clear(); this->BlockSSIds.resize(nMeshes); this->AssemblySSIds.clear(); this->AssemblySSIds.resize(nMeshes); this->MaterialSSIds.clear(); this->MaterialSSIds.resize(nMeshes); this->SpeciesSSIds.clear(); this->SpeciesSSIds.resize(nMeshes); this->Modified(); } //----------------------------------------------------------------------------- void vtkVisItDatabaseBridge::SetMeshIds(int *ids) { #if defined vtkVisItDatabaseBridgeDEBUG cerr << "====================================================================SetMeshIds " << endl; #endif const int n=ids[0]; if (n>1) { this->MeshIds.assign(ids+1,ids+n); } else { this->MeshIds.clear(); } this->SetNumberOfMeshes(n-1); this->Modified(); } //----------------------------------------------------------------------------- void vtkVisItDatabaseBridge::SetMeshIds(int n, int *ids) { #if defined vtkVisItDatabaseBridgeDEBUG cerr << "====================================================================SetMeshIds " << endl; #endif if (n) { this->MeshIds.assign(ids,ids+n); } else { this->MeshIds.clear(); } this->SetNumberOfMeshes(n); this->Modified(); } //----------------------------------------------------------------------------- void vtkVisItDatabaseBridge::SetArrayIds(int *ids) { #if defined vtkVisItDatabaseBridgeDEBUG cerr << "====================================================================SetArrayIds " << endl; #endif const size_t n=ids[0]; const size_t meshId=ids[1]; if (n>2 && meshId>=0 && meshId<this->ArrayIds.size()) { this->ArrayIds[meshId].assign(ids+2,ids+n); } else { this->ArrayIds[meshId].clear(); } this->Modified(); } //----------------------------------------------------------------------------- void vtkVisItDatabaseBridge::SetArrayIds(int meshId, int n, int *ids) { #if defined vtkVisItDatabaseBridgeDEBUG cerr << "====================================================================SetArrayIds " << endl; #endif if (n>0 && meshId>=0 && meshId<this->ArrayIds.size()) { this->ArrayIds[meshId].assign(ids,ids+n); } else { this->ArrayIds[meshId].clear(); } this->Modified(); } //----------------------------------------------------------------------------- void vtkVisItDatabaseBridge::SetExpressionIds(int *ids) { #if defined vtkVisItDatabaseBridgeDEBUG cerr << "====================================================================SetExpressionIds " << endl; #endif const size_t n=ids[0]; const size_t meshId=ids[1]; if (n>2 && meshId>=0 && meshId<this->ExpressionIds.size()) { this->ExpressionIds[meshId].assign(ids+2,ids+n); } else { this->ExpressionIds[meshId].clear(); } this->Modified(); } //----------------------------------------------------------------------------- void vtkVisItDatabaseBridge::SetExpressionIds(int meshId, int n, int *ids) { #if defined vtkVisItDatabaseBridgeDEBUG cerr << "====================================================================SetExpressionIds " << endl; #endif if (n>0 && meshId>=0 && meshId<this->ExpressionIds.size()) { this->ExpressionIds[meshId].assign(ids,ids+n); } else { this->ExpressionIds[meshId].clear(); } this->Modified(); } //----------------------------------------------------------------------------- void vtkVisItDatabaseBridge::SetDomainSSIds(int *ids) { #if defined vtkVisItDatabaseBridgeDEBUG cerr << "====================================================================SetDomainSSIds " << endl; #endif const size_t n=ids[0]; const size_t meshId=ids[1]; if (n>2 && meshId>=0 && meshId<this->DomainSSIds.size()) { this->DomainSSIds[meshId].assign(ids+2,ids+n); } else { this->DomainSSIds[meshId].clear(); } this->Modified(); } //----------------------------------------------------------------------------- void vtkVisItDatabaseBridge::SetDomainSSIds(int meshId, int n, int *ids) { #if defined vtkVisItDatabaseBridgeDEBUG cerr << "====================================================================SetDomainSSIds " << endl; #endif if (n>0 && meshId>=0 && meshId<this->DomainSSIds.size()) { this->DomainSSIds[meshId].assign(ids,ids+n); } else { this->DomainSSIds[meshId].clear(); } this->Modified(); } //----------------------------------------------------------------------------- void vtkVisItDatabaseBridge::SetBlockSSIds(int *ids) { #if defined vtkVisItDatabaseBridgeDEBUG cerr << "====================================================================SetBlockSSIds " << endl; #endif const size_t n=ids[0]; const size_t meshId=ids[1]; if (n>2 && meshId>=0 && meshId<this->BlockSSIds.size()) { this->BlockSSIds[meshId].assign(ids+2,ids+n); } else { this->BlockSSIds[meshId].clear(); } this->Modified(); } //----------------------------------------------------------------------------- void vtkVisItDatabaseBridge::SetBlockSSIds(int meshId, int n, int *ids) { #if defined vtkVisItDatabaseBridgeDEBUG cerr << "====================================================================SetBlockSSIds " << endl; #endif if (n>0 && meshId>=0 && meshId<this->BlockSSIds.size()) { this->BlockSSIds[meshId].assign(ids,ids+n); } else { this->BlockSSIds[meshId].clear(); } this->Modified(); } //----------------------------------------------------------------------------- void vtkVisItDatabaseBridge::SetAssemblySSIds(int *ids) { #if defined vtkVisItDatabaseBridgeDEBUG cerr << "====================================================================SetAssemblySSIds " << endl; #endif const size_t n=ids[0]; const size_t meshId=ids[1]; if (n>2 && meshId>=0 && meshId<this->AssemblySSIds.size()) { this->AssemblySSIds[meshId].assign(ids+2,ids+n); } else { this->AssemblySSIds[meshId].clear(); } this->Modified(); } //----------------------------------------------------------------------------- void vtkVisItDatabaseBridge::SetAssemblySSIds(int meshId, int n, int *ids) { #if defined vtkVisItDatabaseBridgeDEBUG cerr << "====================================================================SetAssemblySSIds " << endl; #endif if (n>0 && meshId>=0 && meshId<this->AssemblySSIds.size()) { this->AssemblySSIds[meshId].assign(ids,ids+n); } else { this->AssemblySSIds[meshId].clear(); } this->Modified(); } //----------------------------------------------------------------------------- void vtkVisItDatabaseBridge::SetMaterialSSIds(int *ids) { #if defined vtkVisItDatabaseBridgeDEBUG cerr << "====================================================================SetMaterialSSIds " << endl; #endif const size_t n=ids[0]; const size_t meshId=ids[1]; if (n>2 && meshId>=0 && meshId<this->MaterialSSIds.size()) { this->MaterialSSIds[meshId].assign(ids+2,ids+n); } else { this->MaterialSSIds[meshId].clear(); } this->Modified(); } //----------------------------------------------------------------------------- void vtkVisItDatabaseBridge::SetMaterialSSIds(int meshId, int n, int *ids) { #if defined vtkVisItDatabaseBridgeDEBUG cerr << "====================================================================SetMaterialSSIds " << endl; #endif if (n>0 && meshId>=0 && meshId<this->MaterialSSIds.size()) { this->MaterialSSIds[meshId].assign(ids,ids+n); } else { this->MaterialSSIds[meshId].clear(); } this->Modified(); } //----------------------------------------------------------------------------- void vtkVisItDatabaseBridge::SetSpeciesSSIds(int *ids) { #if defined vtkVisItDatabaseBridgeDEBUG cerr << "====================================================================SetSpeciesSSIds " << endl; #endif const size_t n=ids[0]; const size_t meshId=ids[1]; if (n>2 && meshId>=0 && meshId<this->SpeciesSSIds.size()) { this->SpeciesSSIds[meshId].assign(ids+2,ids+n); } else { this->SpeciesSSIds[meshId].clear(); } this->Modified(); } //----------------------------------------------------------------------------- void vtkVisItDatabaseBridge::SetSpeciesSSIds(int meshId, int n, int *ids) { #if defined vtkVisItDatabaseBridgeDEBUG cerr << "====================================================================SetSpeciesSSIds " << endl; #endif if (n>0 && meshId>=0 && meshId<this->SpeciesSSIds.size()) { this->SpeciesSSIds[meshId].assign(ids,ids+n); } else { this->SpeciesSSIds[meshId].clear(); } this->Modified(); } //----------------------------------------------------------------------------- void vtkVisItDatabaseBridge::SetDomainToBlockSetOperation(int op) { #if defined vtkVisItDatabaseBridgeDEBUG cerr << "SetDomainToBlockSetOperation " << op << endl; #endif } //----------------------------------------------------------------------------- void vtkVisItDatabaseBridge::SetDomainToAssemblySetOperation(int op) { #if defined vtkVisItDatabaseBridgeDEBUG cerr << "SetDomainToAssemblyOperation " << op << endl; #endif } //----------------------------------------------------------------------------- void vtkVisItDatabaseBridge::SetDomainToMaterialSetOperation(int op) { #if defined vtkVisItDatabaseBridgeDEBUG cerr << "SetDomainToMaterialOperation " << op << endl; #endif }
29.89049
112
0.567714
matthb2
28a4742217ef89800b681b239d2610c5dcb4acad
4,068
hpp
C++
lib/inc/facter/facts/resolver.hpp
Dorin-Pleava/facter
74769988e1b132edc401eb7e420901495092c74c
[ "Apache-2.0" ]
null
null
null
lib/inc/facter/facts/resolver.hpp
Dorin-Pleava/facter
74769988e1b132edc401eb7e420901495092c74c
[ "Apache-2.0" ]
null
null
null
lib/inc/facter/facts/resolver.hpp
Dorin-Pleava/facter
74769988e1b132edc401eb7e420901495092c74c
[ "Apache-2.0" ]
null
null
null
/** * @file * Declares the base class for fact resolvers. */ #pragma once #include "../export.h" #include <vector> #include <memory> #include <stdexcept> #include <string> #include <boost/regex.hpp> namespace facter { namespace facts { /** * Thrown when a resolver is constructed with an invalid fact name pattern. */ struct LIBFACTER_EXPORT invalid_name_pattern_exception : std::runtime_error { /** * Constructs a invalid_name_pattern_exception. * @param message The exception message. */ explicit invalid_name_pattern_exception(std::string const& message); }; struct collection; /** * Base class for fact resolvers. * A fact resolver is responsible for resolving one or more facts. * This type can be moved but cannot be copied. */ struct LIBFACTER_EXPORT resolver { /** * Constructs a resolver. * @param name The fact resolver name. * @param names The fact names the resolver is responsible for. * @param patterns Regular expression patterns for additional ("dynamic") facts the resolver is responsible for. */ resolver(std::string name, std::vector<std::string> names, std::vector<std::string> const& patterns = {}); /** * Destructs the resolver. */ virtual ~resolver(); /** * Prevents the resolver from being copied. */ resolver(resolver const&) = delete; /** * Prevents the resolver from being copied. * @returns Returns this resolver. */ resolver& operator=(resolver const&) = delete; /** * Moves the given resolver into this resolver. * @param other The resolver to move into this resolver. */ // Visual Studio 12 still doesn't allow default for move constructor. resolver(resolver&& other); /** * Moves the given resolver into this resolver. * @param other The resolver to move into this resolver. * @return Returns this resolver. */ // Visual Studio 12 still doesn't allow default for move assignment. resolver& operator=(resolver&& other); /** * Gets the name of the fact resolver. * @return Returns the fact resolver's name. */ std::string const& name() const; /** * Gets the fact names the resolver is responsible for resolving. * @return Returns a vector of fact names. */ std::vector<std::string> const& names() const; /** * Determines if the resolver has patterns. * @return Returns true if the resolver has patterns or false if it does not. */ bool has_patterns() const; /** * Determines if the given name matches a pattern for the resolver. * @param name The fact name to check. * @return Returns true if the name matches a pattern or returns false if it does not. */ bool is_match(std::string const& name) const; /** * Gets list of languages accepted by the fact resolver for HTTP requests. * @return Returns the fact resolver's accepted languages (comma-separated list of language tags formatted for the HTTP Accept-Language header.) */ std::string const& http_langs(); /** * Called to resolve all facts the resolver is responsible for. * @param facts The fact collection that is resolving facts. */ virtual void resolve(collection& facts) = 0; /** * Determines if this resolver can be blocked from collecting its facts. * @return Returns true if this resolver can be blocked, false otherwise */ virtual bool is_blockable() const; private: std::string _name; std::vector<std::string> _names; std::vector<boost::regex> _regexes; std::string _http_langs; }; }} // namespace facter::facts
32.031496
152
0.605211
Dorin-Pleava
28a4e98997a368ff6663aa958e26718b65a8c5f5
259,262
cpp
C++
src/peds/Ped.cpp
gameblabla/reeee3
1b6d0f742b1b6fb681756de702ed618e90361139
[ "Unlicense" ]
2
2021-03-24T22:11:27.000Z
2021-05-07T06:51:04.000Z
src/peds/Ped.cpp
gameblabla/reeee3
1b6d0f742b1b6fb681756de702ed618e90361139
[ "Unlicense" ]
null
null
null
src/peds/Ped.cpp
gameblabla/reeee3
1b6d0f742b1b6fb681756de702ed618e90361139
[ "Unlicense" ]
null
null
null
#include "common.h" #include "main.h" #include "Pools.h" #include "Particle.h" #include "RpAnimBlend.h" #include "Bones.h" #include "Ped.h" #include "AnimBlendAssociation.h" #include "Fire.h" #include "DMAudio.h" #include "General.h" #include "VisibilityPlugins.h" #include "HandlingMgr.h" #include "Replay.h" #include "Radar.h" #include "PedPlacement.h" #include "Shadows.h" #include "Weather.h" #include "ZoneCull.h" #include "Population.h" #include "Pad.h" #include "Phones.h" #include "TrafficLights.h" #include "CopPed.h" #include "Script.h" #include "CarCtrl.h" #include "Garages.h" #include "WaterLevel.h" #include "Timecycle.h" #include "ParticleObject.h" #include "Floater.h" #include "Range2D.h" #include "Wanted.h" CPed *gapTempPedList[50]; uint16 gnNumTempPedList; static CColPoint aTempPedColPts[MAX_COLLISION_POINTS]; uint16 CPed::nThreatReactionRangeMultiplier = 1; uint16 CPed::nEnterCarRangeMultiplier = 1; bool CPed::bNastyLimbsCheat; bool CPed::bPedCheat2; bool CPed::bPedCheat3; CVector2D CPed::ms_vec2DFleePosition; void *CPed::operator new(size_t sz) { return CPools::GetPedPool()->New(); } void *CPed::operator new(size_t sz, int handle) { return CPools::GetPedPool()->New(handle); } void CPed::operator delete(void *p, size_t sz) { CPools::GetPedPool()->Delete((CPed*)p); } void CPed::operator delete(void *p, int handle) { CPools::GetPedPool()->Delete((CPed*)p); } #ifdef DEBUGMENU bool CPed::bPopHeadsOnHeadshot = false; #endif CPed::CPed(uint32 pedType) : m_pedIK(this) { m_type = ENTITY_TYPE_PED; bPedPhysics = true; bUseCollisionRecords = true; m_vecAnimMoveDelta.x = 0.0f; m_vecAnimMoveDelta.y = 0.0f; m_fHealth = 100.0f; m_fArmour = 0.0f; m_nPedType = pedType; m_lastSoundStart = 0; m_soundStart = 0; m_lastQueuedSound = SOUND_NO_SOUND; m_queuedSound = SOUND_NO_SOUND; m_objective = OBJECTIVE_NONE; m_prevObjective = OBJECTIVE_NONE; #ifdef FIX_BUGS m_objectiveTimer = 0; #endif CharCreatedBy = RANDOM_CHAR; m_leader = nil; m_pedInObjective = nil; m_carInObjective = nil; bInVehicle = false; m_pMyVehicle = nil; m_pVehicleAnim = nil; m_vecOffsetSeek.x = 0.0f; m_vecOffsetSeek.y = 0.0f; m_vecOffsetSeek.z = 0.0f; m_pedFormation = FORMATION_UNDEFINED; m_collidingThingTimer = 0; m_nPedStateTimer = 0; m_actionX = 0.0f; m_actionY = 0.0f; m_phoneTalkTimer = 0; m_stateUnused = 0; m_leaveCarTimer = 0; m_getUpTimer = 0; m_attackTimer = 0; m_timerUnused = 0; m_lookTimer = 0; m_chatTimer = 0; m_shootTimer = 0; m_carJackTimer = 0; m_duckAndCoverTimer = 0; m_moved = CVector2D(0.0f, 0.0f); m_fRotationCur = 0.0f; m_headingRate = 15.0f; m_fRotationDest = 0.0f; m_vehDoor = CAR_DOOR_LF; m_walkAroundType = 0; m_pCurrentPhysSurface = nil; m_vecOffsetFromPhysSurface = CVector(0.0f, 0.0f, 0.0f); m_pSeekTarget = nil; m_vecSeekPos = CVector(0.0f, 0.0f, 0.0f); m_wepSkills = 0; m_distanceToCountSeekDone = 1.0f; bRunningToPhone = false; m_phoneId = -1; m_lastAccident = 0; m_fleeFrom = nil; m_fleeFromPosX = 0; m_fleeFromPosY = 0; m_fleeTimer = 0; m_vecSeekPosEx = CVector(0.0f, 0.0f, 0.0f); m_distanceToCountSeekDoneEx = 0.0f; m_nWaitState = WAITSTATE_FALSE; m_nWaitTimer = 0; m_pCollidingEntity = nil; m_nPedState = PED_IDLE; m_nLastPedState = PED_NONE; m_nMoveState = PEDMOVE_STILL; #ifdef FIX_BUGS m_nPrevMoveState = PEDMOVE_NONE; #endif m_nStoredMoveState = PEDMOVE_NONE; m_pFire = nil; m_pPointGunAt = nil; m_pLookTarget = nil; m_fLookDirection = 0.0f; m_pCurSurface = nil; m_wanderRangeBounds = nil; m_nPathNodes = 0; m_nCurPathNode = 0; m_nPathDir = 0; m_pLastPathNode = nil; m_pNextPathNode = nil; m_routeLastPoint = -1; m_routeStartPoint = 0; m_routePointsPassed = 0; m_routeType = 0; m_bodyPartBleeding = -1; m_fMass = 70.0f; m_fTurnMass = 100.0f; m_fAirResistance = 0.4f / m_fMass; m_fElasticity = 0.05f; bIsStanding = false; bWasStanding = false; bIsAttacking = false; bIsPointingGunAt = false; bIsLooking = false; bKeepTryingToLook = false; bIsRestoringLook = false; bIsAimingGun = false; bIsRestoringGun = false; bCanPointGunAtTarget = false; bIsTalking = false; bIsInTheAir = false; bIsLanding = false; bIsRunning = false; bHitSomethingLastFrame = false; bVehEnterDoorIsBlocked = false; bCanPedEnterSeekedCar = false; bRespondsToThreats = true; bRenderPedInCar = true; bChangedSeat = false; bUpdateAnimHeading = false; bBodyPartJustCameOff = false; bIsShooting = false; bFindNewNodeAfterStateRestore = false; bGonnaInvestigateEvent = false; bPedIsBleeding = false; bStopAndShoot = false; bIsPedDieAnimPlaying = false; bUsePedNodeSeek = false; bObjectiveCompleted = false; bScriptObjectiveCompleted = false; bKindaStayInSamePlace = false; bBeingChasedByPolice = false; bNotAllowedToDuck = false; bCrouchWhenShooting = false; bIsDucking = false; bGetUpAnimStarted = false; bDoBloodyFootprints = false; bFleeAfterExitingCar = false; bWanderPathAfterExitingCar = false; bIsLeader = false; bDontDragMeOutCar = false; m_ped_flagF8 = false; bWillBeQuickJacked = false; bCancelEnteringCar = false; bObstacleShowedUpDuringKillObjective = false; bDuckAndCover = false; bStillOnValidPoly = false; bAllowMedicsToReviveMe = true; bResetWalkAnims = false; bStartWanderPathOnFoot = false; bOnBoat = false; bBusJacked = false; bGonnaKillTheCarJacker = false; bFadeOut = false; bKnockedUpIntoAir = false; bHitSteepSlope = false; bCullExtraFarAway = false; bClearObjective = false; bTryingToReachDryLand = false; bCollidedWithMyVehicle = false; bRichFromMugging = false; bChrisCriminal = false; bShakeFist = false; bNoCriticalHits = false; bVehExitWillBeInstant = false; bHasAlreadyBeenRecorded = false; bFallenDown = false; #ifdef KANGAROO_CHEAT m_ped_flagI80 = false; #endif #ifdef VC_PED_PORTS bSomeVCflag1 = false; #endif if (CGeneral::GetRandomNumber() & 3) bHasACamera = false; else bHasACamera = true; m_audioEntityId = DMAudio.CreateEntity(AUDIOTYPE_PHYSICAL, this); DMAudio.SetEntityStatus(m_audioEntityId, true); m_fearFlags = CPedType::GetThreats(m_nPedType); m_threatEntity = nil; m_eventOrThreat = CVector2D(0.0f, 0.0f); m_pEventEntity = nil; m_fAngleToEvent = 0.0f; m_numNearPeds = 0; for (int i = 0; i < ARRAY_SIZE(m_nearPeds); i++) { m_nearPeds[i] = nil; if (i < ARRAY_SIZE(m_pPathNodesStates)) { m_pPathNodesStates[i] = nil; } } m_maxWeaponTypeAllowed = WEAPONTYPE_UNARMED; m_currentWeapon = WEAPONTYPE_UNARMED; m_storedWeapon = WEAPONTYPE_UNIDENTIFIED; for(int i = 0; i < WEAPONTYPE_TOTAL_INVENTORY_WEAPONS; i++) { CWeapon &weapon = GetWeapon(i); weapon.m_eWeaponType = WEAPONTYPE_UNARMED; weapon.m_eWeaponState = WEAPONSTATE_READY; weapon.m_nAmmoInClip = 0; weapon.m_nAmmoTotal = 0; weapon.m_nTimer = 0; } m_curFightMove = FIGHTMOVE_NULL; GiveWeapon(WEAPONTYPE_UNARMED, 0); m_wepAccuracy = 60; m_lastWepDam = -1; m_collPoly.valid = false; m_fCollisionSpeed = 0.0f; m_wepModelID = -1; #ifdef PED_SKIN m_pWeaponModel = nil; #endif CPopulation::UpdatePedCount((ePedType)m_nPedType, false); } CPed::~CPed(void) { CWorld::Remove(this); CRadar::ClearBlipForEntity(BLIP_CHAR, CPools::GetPedPool()->GetIndex(this)); if (InVehicle()){ uint8 door_flag = GetCarDoorFlag(m_vehDoor); if (m_pMyVehicle->pDriver == this) m_pMyVehicle->pDriver = nil; else { // FIX: Passenger counter now decreasing after removing ourself from vehicle. m_pMyVehicle->RemovePassenger(this); } if (m_nPedState == PED_EXIT_CAR || m_nPedState == PED_DRAG_FROM_CAR) m_pMyVehicle->m_nGettingOutFlags &= ~door_flag; bInVehicle = false; m_pMyVehicle = nil; } else if (EnteringCar()) { QuitEnteringCar(); } if (m_pFire) m_pFire->Extinguish(); CPopulation::UpdatePedCount((ePedType)m_nPedType, true); DMAudio.DestroyEntity(m_audioEntityId); } void CPed::Initialise(void) { debug("Initialising CPed...\n"); CPedType::Initialise(); LoadFightData(); SetAnimOffsetForEnterOrExitVehicle(); debug("CPed ready\n"); } void CPed::SetModelIndex(uint32 mi) { CEntity::SetModelIndex(mi); RpAnimBlendClumpInit(GetClump()); RpAnimBlendClumpFillFrameArray(GetClump(), m_pFrames); CPedModelInfo *modelInfo = (CPedModelInfo *)CModelInfo::GetModelInfo(GetModelIndex()); SetPedStats(modelInfo->m_pedStatType); m_headingRate = m_pedStats->m_headingChangeRate; m_animGroup = (AssocGroupId) modelInfo->m_animGroup; CAnimManager::AddAnimation(GetClump(), m_animGroup, ANIM_STD_IDLE); (*RPANIMBLENDCLUMPDATA(m_rwObject))->velocity2d = &m_vecAnimMoveDelta; #ifdef PED_SKIN if(modelInfo->GetHitColModel() == nil) modelInfo->CreateHitColModelSkinned(GetClump()); #endif } void CPed::SetPedStats(ePedStats pedStat) { m_pedStats = CPedStats::ms_apPedStats[pedStat]; } void CPed::BuildPedLists(void) { if (((CTimer::GetFrameCounter() + m_randomSeed) % 16) == 0) { CVector centre = CEntity::GetBoundCentre(); CRect rect(centre.x - 20.0f, centre.y - 20.0f, centre.x + 20.0f, centre.y + 20.0f); int xstart = CWorld::GetSectorIndexX(rect.left); int ystart = CWorld::GetSectorIndexY(rect.top); int xend = CWorld::GetSectorIndexX(rect.right); int yend = CWorld::GetSectorIndexY(rect.bottom); gnNumTempPedList = 0; for(int y = ystart; y <= yend; y++) { for(int x = xstart; x <= xend; x++) { for (CPtrNode *pedPtrNode = CWorld::GetSector(x,y)->m_lists[ENTITYLIST_PEDS].first; pedPtrNode; pedPtrNode = pedPtrNode->next) { CPed *ped = (CPed*)pedPtrNode->item; if (ped != this && !ped->bInVehicle) { float dist = (ped->GetPosition() - GetPosition()).Magnitude2D(); if (nThreatReactionRangeMultiplier * 30.0f > dist) { gapTempPedList[gnNumTempPedList] = ped; gnNumTempPedList++; assert(gnNumTempPedList < ARRAY_SIZE(gapTempPedList)); } } } } } gapTempPedList[gnNumTempPedList] = nil; SortPeds(gapTempPedList, 0, gnNumTempPedList - 1); for (m_numNearPeds = 0; m_numNearPeds < ARRAY_SIZE(m_nearPeds); m_numNearPeds++) { CPed *ped = gapTempPedList[m_numNearPeds]; if (!ped) break; m_nearPeds[m_numNearPeds] = ped; } for (int pedToClear = m_numNearPeds; pedToClear < ARRAY_SIZE(m_nearPeds); pedToClear++) m_nearPeds[pedToClear] = nil; } else { for(int i = 0; i < ARRAY_SIZE(m_nearPeds); ) { bool removePed = false; if (m_nearPeds[i]) { if (m_nearPeds[i]->IsPointerValid()) { float distSqr = (GetPosition() - m_nearPeds[i]->GetPosition()).MagnitudeSqr2D(); if (distSqr > 900.0f) removePed = true; } else removePed = true; } if (removePed) { // If we arrive here, the ped we're checking isn't "near", so we should remove it. for (int j = i; j < ARRAY_SIZE(m_nearPeds) - 1; j++) { m_nearPeds[j] = m_nearPeds[j + 1]; m_nearPeds[j + 1] = nil; } // Above loop won't work on last slot, so we need to empty it. m_nearPeds[ARRAY_SIZE(m_nearPeds) - 1] = nil; m_numNearPeds--; } else i++; } } } bool CPed::OurPedCanSeeThisOne(CEntity *target) { CColPoint colpoint; CEntity *ent; CVector2D dist = CVector2D(target->GetPosition()) - CVector2D(GetPosition()); // Check if target is behind ped if (DotProduct2D(dist, CVector2D(GetForward())) < 0.0f) return false; // Check if target is too far away if (dist.Magnitude() >= 40.0f) return false; // Check line of sight from head CVector headPos = this->GetPosition(); headPos.z += 1.0f; return !CWorld::ProcessLineOfSight(headPos, target->GetPosition(), colpoint, ent, true, false, false, false, false, false); } // Some kind of binary sort void CPed::SortPeds(CPed **list, int min, int max) { if (min >= max) return; CVector leftDiff, rightDiff; CVector middleDiff = GetPosition() - list[(max + min) / 2]->GetPosition(); float middleDist = middleDiff.Magnitude(); int left = max; int right = min; while(right <= left){ float rightDist, leftDist; do { rightDiff = GetPosition() - list[right]->GetPosition(); rightDist = rightDiff.Magnitude(); } while (middleDist > rightDist && ++right); do { leftDiff = GetPosition() - list[left]->GetPosition(); leftDist = leftDiff.Magnitude(); } while (middleDist < leftDist && left--); if (right <= left) { CPed *ped = list[right]; list[right] = list[left]; list[left] = ped; right++; left--; } } SortPeds(list, min, left); SortPeds(list, right, max); } void CPed::SetMoveState(eMoveState state) { m_nMoveState = state; } void CPed::SetMoveAnim(void) { if (m_nStoredMoveState == m_nMoveState || !IsPedInControl()) return; if (m_nMoveState == PEDMOVE_NONE) { m_nStoredMoveState = PEDMOVE_NONE; return; } AssocGroupId animGroupToUse; if (m_leader && m_leader->IsPlayer()) animGroupToUse = ASSOCGRP_PLAYER; else animGroupToUse = m_animGroup; CAnimBlendAssociation *animAssoc = RpAnimBlendClumpGetFirstAssociation(GetClump(), ASSOC_BLOCK); if (!animAssoc) { CAnimBlendAssociation *fightIdleAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_FIGHT_IDLE); animAssoc = fightIdleAssoc; if (fightIdleAssoc && m_nPedState == PED_FIGHT) return; if (fightIdleAssoc) { CAnimBlendAssociation *idleAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_IDLE); if (!idleAssoc || idleAssoc->blendDelta <= 0.0f) { animAssoc->flags |= ASSOC_DELETEFADEDOUT; animAssoc = CAnimManager::BlendAnimation(GetClump(), animGroupToUse, ANIM_STD_IDLE, 8.0f); } } } if (!animAssoc) { animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_IDLE_TIRED); if (animAssoc) if (m_nWaitState == WAITSTATE_STUCK || m_nWaitState == WAITSTATE_FINISH_FLEE) return; if (animAssoc) { CAnimBlendAssociation *idleAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_IDLE); if (!idleAssoc || idleAssoc->blendDelta <= 0.0f) { animAssoc->flags |= ASSOC_DELETEFADEDOUT; animAssoc = CAnimManager::BlendAnimation(GetClump(), animGroupToUse, ANIM_STD_IDLE, 4.0f); } } } if (!animAssoc) { m_nStoredMoveState = m_nMoveState; if (m_nMoveState == PEDMOVE_WALK || m_nMoveState == PEDMOVE_RUN || m_nMoveState == PEDMOVE_SPRINT) { for (CAnimBlendAssociation *assoc = RpAnimBlendClumpGetFirstAssociation(GetClump(), ASSOC_PARTIAL); assoc; assoc = RpAnimBlendGetNextAssociation(assoc, ASSOC_PARTIAL)) { if (!(assoc->flags & ASSOC_FADEOUTWHENDONE)) { assoc->blendDelta = -2.0f; assoc->flags |= ASSOC_DELETEFADEDOUT; } } ClearAimFlag(); ClearLookFlag(); } switch (m_nMoveState) { case PEDMOVE_STILL: animAssoc = CAnimManager::BlendAnimation(GetClump(), animGroupToUse, ANIM_STD_IDLE, 4.0f); break; case PEDMOVE_WALK: animAssoc = CAnimManager::BlendAnimation(GetClump(), animGroupToUse, ANIM_STD_WALK, 1.0f); break; case PEDMOVE_RUN: if (m_nPedState == PED_FLEE_ENTITY) { animAssoc = CAnimManager::BlendAnimation(GetClump(), animGroupToUse, ANIM_STD_RUN, 3.0f); } else { animAssoc = CAnimManager::BlendAnimation(GetClump(), animGroupToUse, ANIM_STD_RUN, 1.0f); } break; case PEDMOVE_SPRINT: animAssoc = CAnimManager::BlendAnimation(GetClump(), animGroupToUse, ANIM_STD_RUNFAST, 1.0f); break; default: break; } if (animAssoc) { if (m_leader) { CAnimBlendAssociation *walkAssoc = RpAnimBlendClumpGetAssociation(m_leader->GetClump(), ANIM_STD_WALK); if (!walkAssoc) walkAssoc = RpAnimBlendClumpGetAssociation(m_leader->GetClump(), ANIM_STD_RUN); if (!walkAssoc) walkAssoc = RpAnimBlendClumpGetAssociation(m_leader->GetClump(), ANIM_STD_RUNFAST); if (walkAssoc) { animAssoc->speed = walkAssoc->speed; } else { if (CharCreatedBy == MISSION_CHAR) animAssoc->speed = 1.0f; else animAssoc->speed = 1.2f - m_randomSeed * 0.4f / MYRAND_MAX; } } else { if (CharCreatedBy == MISSION_CHAR) animAssoc->speed = 1.0f; else animAssoc->speed = 1.2f - m_randomSeed * 0.4f / MYRAND_MAX; } } } } void CPed::StopNonPartialAnims(void) { CAnimBlendAssociation *assoc; for (assoc = RpAnimBlendClumpGetFirstAssociation(GetClump()); assoc; assoc = RpAnimBlendGetNextAssociation(assoc)) { if (!assoc->IsPartial()) assoc->flags &= ~ASSOC_RUNNING; } } void CPed::RestartNonPartialAnims(void) { CAnimBlendAssociation *assoc; for (assoc = RpAnimBlendClumpGetFirstAssociation(GetClump()); assoc; assoc = RpAnimBlendGetNextAssociation(assoc)) { if (!assoc->IsPartial()) assoc->SetRun(); } } void CPed::SetStoredState(void) { if (m_nLastPedState != PED_NONE || !CanPedReturnToState()) return; if (m_nPedState == PED_WANDER_PATH) { bFindNewNodeAfterStateRestore = true; if (m_nMoveState == PEDMOVE_NONE || m_nMoveState == PEDMOVE_STILL) m_nMoveState = PEDMOVE_WALK; } #ifdef VC_PED_PORTS if (m_nPedState != PED_IDLE) #endif { m_nLastPedState = m_nPedState; if (m_nMoveState >= m_nPrevMoveState) m_nPrevMoveState = m_nMoveState; } } void CPed::RestorePreviousState(void) { if(!CanSetPedState() || m_nPedState == PED_FALL) return; if (m_nPedState == PED_GETUP && !bGetUpAnimStarted) return; if (InVehicle()) { SetPedState(PED_DRIVING); m_nLastPedState = PED_NONE; } else { if (m_nLastPedState == PED_NONE) { if (!IsPlayer() && CharCreatedBy != MISSION_CHAR && m_objective == OBJECTIVE_NONE) { if (SetWanderPath(CGeneral::GetRandomNumber() & 7) != 0) return; } SetIdle(); return; } switch (m_nLastPedState) { case PED_IDLE: SetIdle(); break; case PED_WANDER_PATH: SetPedState(PED_WANDER_PATH); bIsRunning = false; if (bFindNewNodeAfterStateRestore) { if (m_pNextPathNode) { CVector diff = m_pNextPathNode->GetPosition() - GetPosition(); if (diff.MagnitudeSqr() < sq(7.0f)) { SetMoveState(PEDMOVE_WALK); break; } } } SetWanderPath(CGeneral::GetRandomNumber() & 7); break; default: SetPedState(m_nLastPedState); SetMoveState((eMoveState) m_nPrevMoveState); break; } m_nLastPedState = PED_NONE; } } uint32 CPed::ScanForThreats(void) { int fearFlags = m_fearFlags; CVector ourPos = GetPosition(); float closestPedDist = 60.0f; CVector2D explosionPos = GetPosition(); if (fearFlags & PED_FLAG_EXPLOSION && CheckForExplosions(explosionPos)) { m_eventOrThreat = explosionPos; return PED_FLAG_EXPLOSION; } CPed *shooter = nil; if ((fearFlags & PED_FLAG_GUN) && (shooter = CheckForGunShots()) && (m_nPedType != shooter->m_nPedType || m_nPedType == PEDTYPE_CIVMALE || m_nPedType == PEDTYPE_CIVFEMALE)) { if (!IsGangMember()) { m_threatEntity = shooter; m_threatEntity->RegisterReference((CEntity **) &m_threatEntity); return PED_FLAG_GUN; } if (CPedType::GetFlag(shooter->m_nPedType) & fearFlags) { m_threatEntity = shooter; m_threatEntity->RegisterReference((CEntity **) &m_threatEntity); return CPedType::GetFlag(shooter->m_nPedType); } } CPed *deadPed; if (fearFlags & PED_FLAG_DEADPEDS && CharCreatedBy != MISSION_CHAR && (deadPed = CheckForDeadPeds()) != nil && (deadPed->GetPosition() - ourPos).MagnitudeSqr() < sq(20.0f) #ifdef FIX_BUGS && !deadPed->bIsInWater #endif ) { m_pEventEntity = deadPed; m_pEventEntity->RegisterReference((CEntity **) &m_pEventEntity); return PED_FLAG_DEADPEDS; } else { uint32 flagsOfNearPed = 0; CPed *pedToFearFrom = nil; #ifndef VC_PED_PORTS for (int i = 0; i < m_numNearPeds; i++) { if (CharCreatedBy != RANDOM_CHAR || m_nearPeds[i]->CharCreatedBy != MISSION_CHAR || m_nearPeds[i]->IsPlayer()) { CPed *nearPed = m_nearPeds[i]; // BUG: WTF Rockstar?! Putting this here will result in returning the flags of farthest ped to us, since m_nearPeds is sorted by distance. // Fixed at the bottom of the function. flagsOfNearPed = CPedType::GetFlag(nearPed->m_nPedType); if (flagsOfNearPed & fearFlags) { if (nearPed->m_fHealth > 0.0f && OurPedCanSeeThisOne(m_nearPeds[i])) { // FIX: Taken from VC #ifdef FIX_BUGS float nearPedDistSqr = (nearPed->GetPosition() - ourPos).MagnitudeSqr2D(); #else float nearPedDistSqr = (CVector2D(ourPos) - explosionPos).MagnitudeSqr(); #endif if (sq(closestPedDist) > nearPedDistSqr) { closestPedDist = Sqrt(nearPedDistSqr); pedToFearFrom = m_nearPeds[i]; } } } } } #else bool weSawOurEnemy = false; bool weMaySeeOurEnemy = false; float closestEnemyDist = 60.0f; if ((CTimer::GetFrameCounter() + (uint8)m_randomSeed + 16) & 4) { for (int i = 0; i < m_numNearPeds; ++i) { if (CharCreatedBy == RANDOM_CHAR && m_nearPeds[i]->CharCreatedBy == MISSION_CHAR && !m_nearPeds[i]->IsPlayer()) { continue; } // BUG: Explained at the same occurence of this bug above. Fixed at the bottom of the function. flagsOfNearPed = CPedType::GetFlag(m_nearPeds[i]->m_nPedType); if (flagsOfNearPed & fearFlags) { if (m_nearPeds[i]->m_fHealth > 0.0f) { // VC also has ability to include objects to line of sight check here (via last bit of flagsL) if (OurPedCanSeeThisOne(m_nearPeds[i])) { if (m_nearPeds[i]->m_nPedState == PED_ATTACK) { if (m_nearPeds[i]->m_pedInObjective == this) { float enemyDistSqr = (m_nearPeds[i]->GetPosition() - ourPos).MagnitudeSqr2D(); if (sq(closestEnemyDist) > enemyDistSqr) { float enemyDist = Sqrt(enemyDistSqr); weSawOurEnemy = true; closestPedDist = enemyDist; closestEnemyDist = enemyDist; pedToFearFrom = m_nearPeds[i]; } } } else { float nearPedDistSqr = (m_nearPeds[i]->GetPosition() - ourPos).MagnitudeSqr2D(); if (sq(closestPedDist) > nearPedDistSqr && !weSawOurEnemy) { closestPedDist = Sqrt(nearPedDistSqr); pedToFearFrom = m_nearPeds[i]; } } } else if (!weSawOurEnemy) { CPed *nearPed = m_nearPeds[i]; if (nearPed->m_nPedState == PED_ATTACK) { CColPoint foundCol; CEntity *foundEnt; // We don't see him yet but he's behind a ped, vehicle or object // VC also has ability to include objects to line of sight check here (via last bit of flagsL) if (!CWorld::ProcessLineOfSight(ourPos, nearPed->GetPosition(), foundCol, foundEnt, true, false, false, false, false, false, false)) { if (nearPed->m_pedInObjective == this) { float enemyDistSqr = (m_nearPeds[i]->GetPosition() - ourPos).MagnitudeSqr2D(); if (sq(closestEnemyDist) > enemyDistSqr) { float enemyDist = Sqrt(enemyDistSqr); weMaySeeOurEnemy = true; closestPedDist = enemyDist; closestEnemyDist = enemyDist; pedToFearFrom = m_nearPeds[i]; } } else if (!nearPed->GetWeapon()->IsTypeMelee() && !weMaySeeOurEnemy) { float nearPedDistSqr = (m_nearPeds[i]->GetPosition() - ourPos).MagnitudeSqr2D(); if (sq(closestPedDist) > nearPedDistSqr) { weMaySeeOurEnemy = true; closestPedDist = Sqrt(nearPedDistSqr); pedToFearFrom = m_nearPeds[i]; } } } } } } } } } #endif int16 lastVehicle; CEntity* vehicles[8]; CWorld::FindObjectsInRange(ourPos, 20.0f, true, &lastVehicle, 6, vehicles, false, true, false, false, false); CVehicle* foundVeh = nil; for (int i = 0; i < lastVehicle; i++) { CVehicle* nearVeh = (CVehicle*)vehicles[i]; CPed *driver = nearVeh->pDriver; if (driver) { // BUG: Same bug as above. Fixed at the bottom of function. flagsOfNearPed = CPedType::GetFlag(driver->m_nPedType); if (flagsOfNearPed & fearFlags) { if (driver->m_fHealth > 0.0f && OurPedCanSeeThisOne(nearVeh->pDriver)) { // FIX: Taken from VC #ifdef FIX_BUGS float driverDistSqr = (driver->GetPosition() - ourPos).MagnitudeSqr2D(); #else float driverDistSqr = (CVector2D(ourPos) - explosionPos).MagnitudeSqr(); #endif if (sq(closestPedDist) > driverDistSqr) { closestPedDist = Sqrt(driverDistSqr); pedToFearFrom = nearVeh->pDriver; } } } } } m_threatEntity = pedToFearFrom; if (m_threatEntity) m_threatEntity->RegisterReference((CEntity **) &m_threatEntity); #ifdef FIX_BUGS if (pedToFearFrom) flagsOfNearPed = CPedType::GetFlag(((CPed*)m_threatEntity)->m_nPedType); else flagsOfNearPed = 0; #endif return flagsOfNearPed; } } void CPed::SetLookFlag(float direction, bool keepTryingToLook) { if (m_lookTimer < CTimer::GetTimeInMilliseconds()) { bIsLooking = true; bIsRestoringLook = false; m_pLookTarget = nil; m_fLookDirection = direction; m_lookTimer = 0; bKeepTryingToLook = keepTryingToLook; if (m_nPedState != PED_DRIVING) { m_pedIK.m_flags &= ~CPedIK::LOOKAROUND_HEAD_ONLY; } } } void CPed::SetLookFlag(CEntity *target, bool keepTryingToLook) { if (m_lookTimer < CTimer::GetTimeInMilliseconds()) { bIsLooking = true; bIsRestoringLook = false; m_pLookTarget = target; m_pLookTarget->RegisterReference((CEntity**)&m_pLookTarget); m_fLookDirection = 999999.0f; m_lookTimer = 0; bKeepTryingToLook = keepTryingToLook; if (m_nPedState != PED_DRIVING) { m_pedIK.m_flags &= ~CPedIK::LOOKAROUND_HEAD_ONLY; } } } void CPed::ClearLookFlag(void) { if (bIsLooking) { bIsLooking = false; bIsRestoringLook = true; bShakeFist = false; m_pedIK.m_flags &= ~CPedIK::LOOKAROUND_HEAD_ONLY; if (IsPlayer()) m_lookTimer = CTimer::GetTimeInMilliseconds() + 2000; else m_lookTimer = CTimer::GetTimeInMilliseconds() + 4000; if (m_nPedState == PED_LOOK_HEADING || m_nPedState == PED_LOOK_ENTITY) { ClearLook(); } } } void FinishFuckUCB(CAnimBlendAssociation *animAssoc, void *arg) { CPed *ped = (CPed*)arg; if (animAssoc->animId == ANIM_STD_PARTIAL_FUCKU && ped->GetWeapon()->m_eWeaponType == WEAPONTYPE_UNARMED) ped->RemoveWeaponModel(0); } void CPed::MoveHeadToLook(void) { CVector lookPos; if (m_lookTimer && CTimer::GetTimeInMilliseconds() > m_lookTimer) { ClearLookFlag(); } else if (m_nPedState == PED_DRIVING) { m_pedIK.m_flags |= CPedIK::LOOKAROUND_HEAD_ONLY; } if (m_pLookTarget) { if (!bShakeFist && GetWeapon()->m_eWeaponType == WEAPONTYPE_UNARMED) { CAnimBlendAssociation *fuckUAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_PARTIAL_FUCKU); if (fuckUAssoc) { float animTime = fuckUAssoc->currentTime; if (animTime > 4.0f / 30.0f && animTime - fuckUAssoc->timeStep > 4.0f / 30.0f) { bool lookingToCop = false; if (m_pLookTarget->GetModelIndex() == MI_POLICE || m_pLookTarget->IsPed() && ((CPed*)m_pLookTarget)->m_nPedType == PEDTYPE_COP) { lookingToCop = true; } if (IsPlayer() && (m_pedStats->m_temper >= 52 || lookingToCop)) { AddWeaponModel(MI_FINGERS); ((CPlayerPed*)this)->AnnoyPlayerPed(true); } else if ((CGeneral::GetRandomNumber() & 3) == 0) { AddWeaponModel(MI_FINGERS); } } } } if (m_pLookTarget->IsPed()) { ((CPed*)m_pLookTarget)->m_pedIK.GetComponentPosition(lookPos, PED_MID); } else { lookPos = m_pLookTarget->GetPosition(); } if (!m_pedIK.LookAtPosition(lookPos)) { if (!bKeepTryingToLook) { ClearLookFlag(); } return; } if (!bShakeFist || bIsAimingGun || bIsRestoringGun) return; if (m_lookTimer - CTimer::GetTimeInMilliseconds() >= 1000) return; bool notRocketLauncher = false; bool notTwoHanded = false; AnimationId animToPlay = ANIM_STD_NUM; if (!GetWeapon()->IsType2Handed()) notTwoHanded = true; if (notTwoHanded && GetWeapon()->m_eWeaponType != WEAPONTYPE_ROCKETLAUNCHER) notRocketLauncher = true; if (IsPlayer() && notRocketLauncher) { if (m_pLookTarget->IsPed()) { if (m_pedStats->m_temper >= 49 && ((CPed*)m_pLookTarget)->m_nPedType != PEDTYPE_COP) { // FIX: Unreachable and meaningless condition #ifndef FIX_BUGS if (m_pedStats->m_temper < 47) #endif animToPlay = ANIM_STD_PARTIAL_PUNCH; } else { animToPlay = ANIM_STD_PARTIAL_FUCKU; } } else if (m_pedStats->m_temper > 49 || m_pLookTarget->GetModelIndex() == MI_POLICE) { animToPlay = ANIM_STD_PARTIAL_FUCKU; } } else if (notRocketLauncher && (CGeneral::GetRandomNumber() & 1)) { animToPlay = ANIM_STD_PARTIAL_FUCKU; } if (animToPlay != ANIM_STD_NUM) { CAnimBlendAssociation *newAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, animToPlay, 4.0f); if (newAssoc) { newAssoc->flags |= ASSOC_FADEOUTWHENDONE; newAssoc->flags |= ASSOC_DELETEFADEDOUT; if (newAssoc->animId == ANIM_STD_PARTIAL_FUCKU) newAssoc->SetDeleteCallback(FinishFuckUCB, this); } } bShakeFist = false; return; } else if (999999.0f == m_fLookDirection) { ClearLookFlag(); } else if (!m_pedIK.LookInDirection(m_fLookDirection, 0.0f)) { if (!bKeepTryingToLook) ClearLookFlag(); } } void CPed::RestoreHeadPosition(void) { if (m_pedIK.RestoreLookAt()) { bIsRestoringLook = false; } } void CPed::SetAimFlag(float angle) { bIsAimingGun = true; bIsRestoringGun = false; m_fLookDirection = angle; m_lookTimer = 0; m_pLookTarget = nil; m_pSeekTarget = nil; if (CWeaponInfo::GetWeaponInfo(GetWeapon()->m_eWeaponType)->IsFlagSet(WEAPONFLAG_CANAIM_WITHARM)) m_pedIK.m_flags |= CPedIK::AIMS_WITH_ARM; else m_pedIK.m_flags &= ~CPedIK::AIMS_WITH_ARM; } void CPed::SetAimFlag(CEntity *to) { bIsAimingGun = true; bIsRestoringGun = false; m_pLookTarget = to; m_pLookTarget->RegisterReference((CEntity **) &m_pLookTarget); m_pSeekTarget = to; m_pSeekTarget->RegisterReference((CEntity **) &m_pSeekTarget); m_lookTimer = 0; } void CPed::ClearAimFlag(void) { if (bIsAimingGun) { bIsAimingGun = false; bIsRestoringGun = true; m_pedIK.m_flags &= ~CPedIK::AIMS_WITH_ARM; #if defined VC_PED_PORTS || defined FIX_BUGS m_lookTimer = 0; #endif } if (IsPlayer()) ((CPlayerPed*)this)->m_fFPSMoveHeading = 0.0f; } void CPed::AimGun(void) { CVector vector; if (m_pSeekTarget) { if (m_pSeekTarget->IsPed()) { ((CPed*)m_pSeekTarget)->m_pedIK.GetComponentPosition(vector, PED_MID); } else { vector = m_pSeekTarget->GetPosition(); } Say(SOUND_PED_ATTACK); bCanPointGunAtTarget = m_pedIK.PointGunAtPosition(vector); if (m_pLookTarget != m_pSeekTarget) { SetLookFlag(m_pSeekTarget, true); } } else { if (IsPlayer()) { bCanPointGunAtTarget = m_pedIK.PointGunInDirection(m_fLookDirection, ((CPlayerPed*)this)->m_fFPSMoveHeading); } else { bCanPointGunAtTarget = m_pedIK.PointGunInDirection(m_fLookDirection, 0.0f); } } } void CPed::RestoreGunPosition(void) { if (bIsLooking) { m_pedIK.m_flags &= ~CPedIK::LOOKAROUND_HEAD_ONLY; bIsRestoringGun = false; } else if (m_pedIK.RestoreGunPosn()) { bIsRestoringGun = false; } else { if (IsPlayer()) ((CPlayerPed*)this)->m_fFPSMoveHeading = 0.0f; } } void CPed::ScanForInterestingStuff(void) { if (!IsPedInControl()) return; if (m_objective != OBJECTIVE_NONE) return; if (CharCreatedBy == MISSION_CHAR) return; LookForSexyPeds(); LookForSexyCars(); if (LookForInterestingNodes()) return; if (m_nPedType == PEDTYPE_CRIMINAL && m_carJackTimer < CTimer::GetTimeInMilliseconds()) { // Find a car to steal or a ped to mug if we haven't already decided to steal a car if (CGeneral::GetRandomNumber() % 100 < 10) { int mostExpensiveVehAround = -1; int bestMonetaryValue = 0; CVector pos = GetPosition(); int16 lastVehicle; CEntity *vehicles[8]; CWorld::FindObjectsInRange(pos, 10.0f, true, &lastVehicle, 6, vehicles, false, true, false, false, false); for (int i = 0; i < lastVehicle; i++) { CVehicle* veh = (CVehicle*)vehicles[i]; if (veh->VehicleCreatedBy != MISSION_VEHICLE) { if (veh->m_vecMoveSpeed.Magnitude() <= 0.1f && veh->IsVehicleNormal() && veh->IsCar() && bestMonetaryValue < veh->pHandling->nMonetaryValue) { mostExpensiveVehAround = i; bestMonetaryValue = veh->pHandling->nMonetaryValue; } } } if (bestMonetaryValue > 2000 && mostExpensiveVehAround != -1 && vehicles[mostExpensiveVehAround]) { SetObjective(OBJECTIVE_ENTER_CAR_AS_DRIVER, vehicles[mostExpensiveVehAround]); m_carJackTimer = CTimer::GetTimeInMilliseconds() + 5000; return; } m_carJackTimer = CTimer::GetTimeInMilliseconds() + 5000; } else if (m_objective != OBJECTIVE_MUG_CHAR && !(CGeneral::GetRandomNumber() & 7)) { CPed *charToMug = nil; for (int i = 0; i < m_numNearPeds; ++i) { CPed *nearPed = m_nearPeds[i]; if ((nearPed->GetPosition() - GetPosition()).MagnitudeSqr() > sq(7.0f)) break; if ((nearPed->m_nPedType == PEDTYPE_CIVFEMALE || nearPed->m_nPedType == PEDTYPE_CIVMALE || nearPed->m_nPedType == PEDTYPE_CRIMINAL || nearPed->m_nPedType == PEDTYPE_UNUSED1 || nearPed->m_nPedType == PEDTYPE_PROSTITUTE) && nearPed->CharCreatedBy != MISSION_CHAR && nearPed->IsPedShootable() && nearPed->m_objective != OBJECTIVE_MUG_CHAR) { charToMug = nearPed; break; } } if (charToMug) SetObjective(OBJECTIVE_MUG_CHAR, charToMug); m_carJackTimer = CTimer::GetTimeInMilliseconds() + 5000; } } if (m_nPedState == PED_WANDER_PATH) { #ifndef VC_PED_PORTS if (CTimer::GetTimeInMilliseconds() > m_chatTimer) { // += 2 is weird for (int i = 0; i < m_numNearPeds; i += 2) { if (m_nearPeds[i]->m_nPedState == PED_WANDER_PATH && WillChat(m_nearPeds[i])) { if (CGeneral::GetRandomNumberInRange(0, 100) >= 100) m_chatTimer = CTimer::GetTimeInMilliseconds() + 30000; else { if ((GetPosition() - m_nearPeds[i]->GetPosition()).Magnitude() >= 1.8f) { m_chatTimer = CTimer::GetTimeInMilliseconds() + 30000; } else if (CanSeeEntity(m_nearPeds[i])) { int time = CGeneral::GetRandomNumber() % 4000 + 10000; SetChat(m_nearPeds[i], time); m_nearPeds[i]->SetChat(this, time); return; } } } } } #else if (CGeneral::GetRandomNumberInRange(0.0f, 1.0f) < 0.5f) { if (CTimer::GetTimeInMilliseconds() > m_chatTimer) { for (int i = 0; i < m_numNearPeds; i ++) { if (m_nearPeds[i] && m_nearPeds[i]->m_nPedState == PED_WANDER_PATH) { if ((GetPosition() - m_nearPeds[i]->GetPosition()).Magnitude() < 1.8f && CanSeeEntity(m_nearPeds[i]) && m_nearPeds[i]->CanSeeEntity(this) && WillChat(m_nearPeds[i])) { int time = CGeneral::GetRandomNumber() % 4000 + 10000; SetChat(m_nearPeds[i], time); m_nearPeds[i]->SetChat(this, time); return; } } } } } else { m_chatTimer = CTimer::GetTimeInMilliseconds() + 200; } #endif } // Parts below aren't there in VC, they're in somewhere else. if (!CGame::noProstitutes && m_nPedType == PEDTYPE_PROSTITUTE && CharCreatedBy != MISSION_CHAR && m_objectiveTimer < CTimer::GetTimeInMilliseconds() && !CTheScripts::IsPlayerOnAMission()) { CVector pos = GetPosition(); int16 lastVehicle; CEntity* vehicles[8]; CWorld::FindObjectsInRange(pos, CHECK_NEARBY_THINGS_MAX_DIST, true, &lastVehicle, 6, vehicles, false, true, false, false, false); for (int i = 0; i < lastVehicle; i++) { CVehicle* veh = (CVehicle*)vehicles[i]; if (veh->IsVehicleNormal()) { if (veh->IsCar()) { if ((GetPosition() - veh->GetPosition()).Magnitude() < 5.0f && veh->IsRoomForPedToLeaveCar(CAR_DOOR_LF, nil)) { SetObjective(OBJECTIVE_SOLICIT_VEHICLE, veh); Say(SOUND_PED_SOLICIT); return; } } } } } if (m_nPedType == PEDTYPE_CIVMALE || m_nPedType == PEDTYPE_CIVFEMALE) { CVector pos = GetPosition(); int16 lastVehicle; CEntity* vehicles[8]; CWorld::FindObjectsInRange(pos, CHECK_NEARBY_THINGS_MAX_DIST, true, &lastVehicle, 6, vehicles, false, true, false, false, false); for (int i = 0; i < lastVehicle; i++) { CVehicle* veh = (CVehicle*)vehicles[i]; if (veh->GetModelIndex() == MI_MRWHOOP) { if (veh->GetStatus() != STATUS_ABANDONED && veh->GetStatus() != STATUS_WRECKED) { if ((GetPosition() - veh->GetPosition()).Magnitude() < 5.0f) { SetObjective(OBJECTIVE_BUY_ICE_CREAM, veh); return; } } } } } } bool CPed::WillChat(CPed *stranger) { if (m_pNextPathNode && m_pLastPathNode) { if (m_pNextPathNode != m_pLastPathNode && ThePaths.TestCrossesRoad(m_pNextPathNode, m_pLastPathNode)) { return false; } } if (m_nSurfaceTouched == SURFACE_TARMAC) return false; if (stranger == this) return false; if (m_nPedType == stranger->m_nPedType) return true; if (m_nPedType == PEDTYPE_CRIMINAL) return false; if ((IsGangMember() || stranger->IsGangMember()) && m_nPedType != stranger->m_nPedType) return false; return true; } void CPed::CalculateNewVelocity(void) { if (IsPedInControl()) { float headAmount = DEGTORAD(m_headingRate) * CTimer::GetTimeStep(); m_fRotationCur = CGeneral::LimitRadianAngle(m_fRotationCur); float limitedRotDest = CGeneral::LimitRadianAngle(m_fRotationDest); if (m_fRotationCur - PI > limitedRotDest) { limitedRotDest += 2 * PI; } else if(PI + m_fRotationCur < limitedRotDest) { limitedRotDest -= 2 * PI; } if (IsPlayer() && m_nPedState == PED_ATTACK) headAmount /= 4.0f; float neededTurn = limitedRotDest - m_fRotationCur; if (neededTurn <= headAmount) { if (neededTurn > (-headAmount)) m_fRotationCur += neededTurn; else m_fRotationCur -= headAmount; } else { m_fRotationCur += headAmount; } } CVector2D forward(Sin(m_fRotationCur), Cos(m_fRotationCur)); m_moved.x = CrossProduct2D(m_vecAnimMoveDelta, forward); // (m_vecAnimMoveDelta.x * Cos(m_fRotationCur)) + -Sin(m_fRotationCur) * m_vecAnimMoveDelta.y; m_moved.y = DotProduct2D(m_vecAnimMoveDelta, forward); // m_vecAnimMoveDelta.y* Cos(m_fRotationCur) + (m_vecAnimMoveDelta.x * Sin(m_fRotationCur)); if (CTimer::GetTimeStep() >= 0.01f) { m_moved = m_moved * (1 / CTimer::GetTimeStep()); } else { m_moved = m_moved * (1 / 100.0f); } if ((!TheCamera.Cams[TheCamera.ActiveCam].GetWeaponFirstPersonOn() && !TheCamera.Cams[0].Using3rdPersonMouseCam()) || FindPlayerPed() != this || !CanStrafeOrMouseControl()) return; float walkAngle = WorkOutHeadingForMovingFirstPerson(m_fRotationCur); float pedSpeed = m_moved.Magnitude(); float localWalkAngle = CGeneral::LimitRadianAngle(walkAngle - m_fRotationCur); if (localWalkAngle < -0.5f * PI) { localWalkAngle += PI; } else if (localWalkAngle > 0.5f * PI) { localWalkAngle -= PI; } // Interestingly this part is responsible for diagonal walking. if (localWalkAngle > -DEGTORAD(50.0f) && localWalkAngle < DEGTORAD(50.0f)) { TheCamera.Cams[TheCamera.ActiveCam].m_fPlayerVelocity = pedSpeed; m_moved = CVector2D(-Sin(walkAngle), Cos(walkAngle)) * pedSpeed; } CAnimBlendAssociation *idleAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_IDLE); CAnimBlendAssociation *fightAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_FIGHT_IDLE); #ifdef VC_PED_PORTS if ((!idleAssoc || idleAssoc->blendAmount < 0.5f) && !fightAssoc && !bIsDucking) { #else if ((!idleAssoc || idleAssoc->blendAmount < 0.5f) && !fightAssoc) { #endif LimbOrientation newUpperLegs; newUpperLegs.yaw = localWalkAngle; if (newUpperLegs.yaw < -DEGTORAD(100.0f)) { newUpperLegs.yaw += PI; } else if (newUpperLegs.yaw > DEGTORAD(100.0f)) { newUpperLegs.yaw -= PI; } if (newUpperLegs.yaw > -DEGTORAD(50.0f) && newUpperLegs.yaw < DEGTORAD(50.0f)) { #ifdef PED_SKIN if(IsClumpSkinned(GetClump())){ /* // this looks shit newUpperLegs.pitch = 0.0f; RwV3d axis = { -1.0f, 0.0f, 0.0f }; RtQuatRotate(&m_pFrames[PED_UPPERLEGL]->hanimFrame->q, &axis, RADTODEG(newUpperLegs.yaw), rwCOMBINEPRECONCAT); RtQuatRotate(&m_pFrames[PED_UPPERLEGR]->hanimFrame->q, &axis, RADTODEG(newUpperLegs.yaw), rwCOMBINEPRECONCAT); */ newUpperLegs.pitch = 0.1f; RwV3d Xaxis = { 1.0f, 0.0f, 0.0f }; RwV3d Zaxis = { 0.0f, 0.0f, 1.0f }; RtQuatRotate(&m_pFrames[PED_UPPERLEGL]->hanimFrame->q, &Zaxis, RADTODEG(newUpperLegs.pitch), rwCOMBINEPOSTCONCAT); RtQuatRotate(&m_pFrames[PED_UPPERLEGL]->hanimFrame->q, &Xaxis, RADTODEG(newUpperLegs.yaw), rwCOMBINEPOSTCONCAT); RtQuatRotate(&m_pFrames[PED_UPPERLEGR]->hanimFrame->q, &Zaxis, RADTODEG(newUpperLegs.pitch), rwCOMBINEPOSTCONCAT); RtQuatRotate(&m_pFrames[PED_UPPERLEGR]->hanimFrame->q, &Xaxis, RADTODEG(newUpperLegs.yaw), rwCOMBINEPOSTCONCAT); bDontAcceptIKLookAts = true; }else #endif { newUpperLegs.pitch = 0.0f; m_pedIK.RotateTorso(m_pFrames[PED_UPPERLEGL], &newUpperLegs, false); m_pedIK.RotateTorso(m_pFrames[PED_UPPERLEGR], &newUpperLegs, false); } } } } float CPed::WorkOutHeadingForMovingFirstPerson(float offset) { if (!IsPlayer()) return 0.0f; CPad *pad0 = CPad::GetPad(0); float leftRight = pad0->GetPedWalkLeftRight(); float upDown = pad0->GetPedWalkUpDown(); float &angle = ((CPlayerPed*)this)->m_fWalkAngle; if (upDown != 0.0f) { angle = CGeneral::GetRadianAngleBetweenPoints(0.0f, 0.0f, -leftRight, upDown); } else { if (leftRight < 0.0f) angle = 0.5f * PI; else if (leftRight > 0.0f) angle = -0.5f * PI; } return CGeneral::LimitRadianAngle(offset + angle); } void CPed::UpdatePosition(void) { if (CReplay::IsPlayingBack() || !bIsStanding) return; CVector2D velocityChange; SetHeading(m_fRotationCur); if (m_pCurrentPhysSurface) { CVector2D velocityOfSurface; if (!IsPlayer() && m_pCurrentPhysSurface->IsVehicle() && ((CVehicle*)m_pCurrentPhysSurface)->IsBoat()) { // It seems R* didn't like m_vecOffsetFromPhysSurface for boats CVector offsetToSurface = GetPosition() - m_pCurrentPhysSurface->GetPosition(); offsetToSurface.z -= FEET_OFFSET; CVector surfaceMoveVelocity = m_pCurrentPhysSurface->m_vecMoveSpeed; CVector surfaceTurnVelocity = CrossProduct(m_pCurrentPhysSurface->m_vecTurnSpeed, offsetToSurface); // Also we use that weird formula instead of friction if it's boat float slideMult = -m_pCurrentPhysSurface->m_vecTurnSpeed.MagnitudeSqr(); velocityOfSurface = slideMult * offsetToSurface * CTimer::GetTimeStep() + (surfaceTurnVelocity + surfaceMoveVelocity); m_vecMoveSpeed.z = slideMult * offsetToSurface.z * CTimer::GetTimeStep() + (surfaceTurnVelocity.z + surfaceMoveVelocity.z); } else { velocityOfSurface = m_pCurrentPhysSurface->GetSpeed(m_vecOffsetFromPhysSurface); } // Reminder: m_moved is displacement from walking/running. velocityChange = m_moved + velocityOfSurface - m_vecMoveSpeed; m_fRotationCur += m_pCurrentPhysSurface->m_vecTurnSpeed.z * CTimer::GetTimeStep(); m_fRotationDest += m_pCurrentPhysSurface->m_vecTurnSpeed.z * CTimer::GetTimeStep(); } else if (m_nSurfaceTouched == SURFACE_STEEP_CLIFF && (m_vecDamageNormal.x != 0.0f || m_vecDamageNormal.y != 0.0f)) { // Ped got damaged by steep slope m_vecMoveSpeed = CVector(0.0f, 0.0f, -0.001f); // some kind of CVector2D reactionForce = m_vecDamageNormal; reactionForce.Normalise(); velocityChange = 0.02f * reactionForce + m_moved; float reactionAndVelocityDotProd = DotProduct2D(reactionForce, velocityChange); // they're in same direction if (reactionAndVelocityDotProd < 0.0f) { velocityChange -= reactionAndVelocityDotProd * reactionForce; } } else { velocityChange = m_moved - m_vecMoveSpeed; } // Take time step into account if (m_pCurrentPhysSurface) { float speedChange = velocityChange.Magnitude(); float changeMult = speedChange; if (m_nPedState == PED_DIE && m_pCurrentPhysSurface->IsVehicle()) { changeMult = 0.002f * CTimer::GetTimeStep(); } else if (!(m_pCurrentPhysSurface->IsVehicle() && ((CVehicle*)m_pCurrentPhysSurface)->IsBoat())) { changeMult = 0.01f * CTimer::GetTimeStep(); } if (speedChange > changeMult) { velocityChange = velocityChange * (changeMult / speedChange); } } m_vecMoveSpeed.x += velocityChange.x; m_vecMoveSpeed.y += velocityChange.y; } void CPed::CalculateNewOrientation(void) { if (CReplay::IsPlayingBack() || !IsPedInControl()) return; SetHeading(m_fRotationCur); } void CPed::ClearAll(void) { if (!IsPedInControl() && m_nPedState != PED_DEAD) return; SetPedState(PED_NONE); SetMoveState(PEDMOVE_NONE); m_pSeekTarget = nil; m_vecSeekPos = CVector(0.0f, 0.0f, 0.0f); m_fleeFromPosX = 0.0f; m_fleeFromPosY = 0.0f; m_fleeFrom = nil; m_fleeTimer = 0; bUsesCollision = true; #ifdef VC_PED_PORTS ClearPointGunAt(); #else ClearAimFlag(); ClearLookFlag(); #endif bIsPointingGunAt = false; bRenderPedInCar = true; bKnockedUpIntoAir = false; m_pCollidingEntity = nil; } void CPed::ProcessBuoyancy(void) { static uint32 nGenerateRaindrops = 0; static uint32 nGenerateWaterCircles = 0; CRGBA color(((0.5f * CTimeCycle::GetDirectionalRed() + CTimeCycle::GetAmbientRed()) * 127.5f), ((0.5f * CTimeCycle::GetDirectionalBlue() + CTimeCycle::GetAmbientBlue()) * 127.5f), ((0.5f * CTimeCycle::GetDirectionalGreen() + CTimeCycle::GetAmbientGreen()) * 127.5f), CGeneral::GetRandomNumberInRange(48.0f, 96.0f)); if (bInVehicle) return; CVector buoyancyPoint; CVector buoyancyImpulse; #ifndef VC_PED_PORTS float buoyancyLevel = (m_nPedState == PED_DEAD ? 1.5f : 1.3f); #else float buoyancyLevel = (m_nPedState == PED_DEAD ? 1.8f : 1.1f); #endif if (mod_Buoyancy.ProcessBuoyancy(this, GRAVITY * m_fMass * buoyancyLevel, &buoyancyPoint, &buoyancyImpulse)) { bTouchingWater = true; CEntity *entity; CColPoint point; if (CWorld::ProcessVerticalLine(GetPosition(), GetPosition().z - 3.0f, point, entity, false, true, false, false, false, false, nil) && entity->IsVehicle() && ((CVehicle*)entity)->IsBoat()) { bIsInWater = false; return; } bIsInWater = true; ApplyMoveForce(buoyancyImpulse); if (!DyingOrDead()) { if (bTryingToReachDryLand) { if (buoyancyImpulse.z / m_fMass > GRAVITY * 0.4f * CTimer::GetTimeStep()) { bTryingToReachDryLand = false; CVector pos = GetPosition(); if (PlacePedOnDryLand()) { if (m_fHealth > 20.0f) InflictDamage(nil, WEAPONTYPE_DROWNING, 15.0f, PEDPIECE_TORSO, false); if (bIsInTheAir) { RpAnimBlendClumpSetBlendDeltas(GetClump(), ASSOC_PARTIAL, -1000.0f); bIsInTheAir = false; } pos.z = pos.z - 0.8f; #ifdef PC_PARTICLE CParticleObject::AddObject(POBJECT_PED_WATER_SPLASH, pos, CVector(0.0f, 0.0f, 0.0f), 0.0f, 50, color, true); #else CParticleObject::AddObject(POBJECT_PED_WATER_SPLASH, pos, CVector(0.0f, 0.0f, 0.0f), 0.0f, 50, CRGBA(0, 0, 0, 0), true); #endif m_vecMoveSpeed = CVector(0.0f, 0.0f, 0.0f); SetPedState(PED_IDLE); return; } } } float speedMult = 0.0f; if (buoyancyImpulse.z / m_fMass > GRAVITY * 0.75f * CTimer::GetTimeStep() || mod_Buoyancy.m_waterlevel > GetPosition().z) { speedMult = pow(0.9f, CTimer::GetTimeStep()); m_vecMoveSpeed.x *= speedMult; m_vecMoveSpeed.y *= speedMult; m_vecMoveSpeed.z *= speedMult; bIsStanding = false; InflictDamage(nil, WEAPONTYPE_DROWNING, 3.0f * CTimer::GetTimeStep(), PEDPIECE_TORSO, 0); } if (buoyancyImpulse.z / m_fMass > GRAVITY * 0.25f * CTimer::GetTimeStep()) { if (speedMult == 0.0f) { speedMult = pow(0.9f, CTimer::GetTimeStep()); } m_vecMoveSpeed.x *= speedMult; m_vecMoveSpeed.y *= speedMult; if (m_vecMoveSpeed.z >= -0.1f) { if (m_vecMoveSpeed.z < -0.04f) m_vecMoveSpeed.z = -0.02f; } else { m_vecMoveSpeed.z = -0.01f; DMAudio.PlayOneShot(m_audioEntityId, SOUND_SPLASH, 0.0f); #ifdef PC_PARTICLE CVector aBitForward = 2.2f * m_vecMoveSpeed + GetPosition(); float level = 0.0f; if (CWaterLevel::GetWaterLevel(aBitForward, &level, false)) aBitForward.z = level; CParticleObject::AddObject(POBJECT_PED_WATER_SPLASH, aBitForward, CVector(0.0f, 0.0f, 0.1f), 0.0f, 200, color, true); nGenerateRaindrops = CTimer::GetTimeInMilliseconds() + 80; nGenerateWaterCircles = CTimer::GetTimeInMilliseconds() + 100; #else CVector aBitForward = 1.6f * m_vecMoveSpeed + GetPosition(); float level = 0.0f; if (CWaterLevel::GetWaterLevel(aBitForward, &level, false)) aBitForward.z = level + 0.5f; CVector vel = m_vecMoveSpeed * 0.1f; vel.z = 0.18f; CParticleObject::AddObject(POBJECT_PED_WATER_SPLASH, aBitForward, vel, 0.0f, 350, CRGBA(0, 0, 0, 0), true); nGenerateRaindrops = CTimer::GetTimeInMilliseconds() + 300; nGenerateWaterCircles = CTimer::GetTimeInMilliseconds() + 60; #endif } } } else return; } else bTouchingWater = false; if (nGenerateWaterCircles && CTimer::GetTimeInMilliseconds() >= nGenerateWaterCircles) { CVector pos = GetPosition(); float level = 0.0f; if (CWaterLevel::GetWaterLevel(pos, &level, false)) pos.z = level; if (pos.z != 0.0f) { nGenerateWaterCircles = 0; for(int i = 0; i < 4; i++) { #ifdef PC_PARTICLE pos.x += CGeneral::GetRandomNumberInRange(-0.75f, 0.75f); pos.y += CGeneral::GetRandomNumberInRange(-0.75f, 0.75f); CParticle::AddParticle(PARTICLE_RAIN_SPLASH_BIGGROW, pos, CVector(0.0f, 0.0f, 0.0f), nil, 0.0f, color, 0, 0, 0, 0); #else pos.x += CGeneral::GetRandomNumberInRange(-2.5f, 2.5f); pos.y += CGeneral::GetRandomNumberInRange(-2.5f, 2.5f); CParticle::AddParticle(PARTICLE_RAIN_SPLASH_BIGGROW, pos+CVector(0.0f, 0.0f, 1.0f), CVector(0.0f, 0.0f, 0.0f)); #endif } } } if (nGenerateRaindrops && CTimer::GetTimeInMilliseconds() >= nGenerateRaindrops) { CVector pos = GetPosition(); float level = 0.0f; if (CWaterLevel::GetWaterLevel(pos, &level, false)) pos.z = level; if (pos.z >= 0.0f) { #ifdef PC_PARTICLE pos.z += 0.25f; #else pos.z += 0.5f; #endif nGenerateRaindrops = 0; #ifdef PC_PARTICLE CParticleObject::AddObject(POBJECT_SPLASHES_AROUND, pos, CVector(0.0f, 0.0f, 0.0f), 4.5f, 1500, CRGBA(0,0,0,0), true); #else CParticleObject::AddObject(POBJECT_SPLASHES_AROUND, pos, CVector(0.0f, 0.0f, 0.0f), 4.5f, 2500, CRGBA(0,0,0,0), true); #endif } } } void CPed::ProcessControl(void) { CColPoint foundCol; CEntity *foundEnt = nil; if (m_nZoneLevel > LEVEL_GENERIC && m_nZoneLevel != CCollision::ms_collisionInMemory) return; int alpha = CVisibilityPlugins::GetClumpAlpha(GetClump()); if (!bFadeOut) { if (alpha < 255) { alpha += 16; if (alpha > 255) alpha = 255; } } else { alpha -= 8; if (alpha < 0) alpha = 0; } CVisibilityPlugins::SetClumpAlpha(GetClump(), alpha); bIsShooting = false; BuildPedLists(); bIsInWater = false; ProcessBuoyancy(); if (m_nPedState != PED_ARRESTED) { if (m_nPedState == PED_DEAD) { DeadPedMakesTyresBloody(); #ifndef VC_PED_PORTS if (CGame::nastyGame) { #else if (CGame::nastyGame && !bIsInWater) { #endif uint32 remainingBloodyFpTime = CTimer::GetTimeInMilliseconds() - m_bloodyFootprintCountOrDeathTime; float timeDependentDist; if (remainingBloodyFpTime >= 2000) { if (remainingBloodyFpTime <= 7000) timeDependentDist = (remainingBloodyFpTime - 2000) / 5000.0f * 0.75f; else timeDependentDist = 0.75f; } else { timeDependentDist = 0.0f; } for (int i = 0; i < m_numNearPeds; ++i) { CPed *nearPed = m_nearPeds[i]; if (!nearPed->DyingOrDead()) { CVector dist = nearPed->GetPosition() - GetPosition(); if (dist.MagnitudeSqr() < sq(timeDependentDist)) { nearPed->m_bloodyFootprintCountOrDeathTime = 200; nearPed->bDoBloodyFootprints = true; if (nearPed->IsPlayer()) { if (!nearPed->bIsLooking && nearPed->m_nPedState != PED_ATTACK) { int16 camMode = TheCamera.Cams[TheCamera.ActiveCam].Mode; if (camMode != CCam::MODE_SNIPER && camMode != CCam::MODE_ROCKETLAUNCHER && camMode != CCam::MODE_M16_1STPERSON && camMode != CCam::MODE_1STPERSON && camMode != CCam::MODE_HELICANNON_1STPERSON && !TheCamera.Cams[TheCamera.ActiveCam].GetWeaponFirstPersonOn()) { nearPed->SetLookFlag(this, true); nearPed->SetLookTimer(500); } } } } } } if (remainingBloodyFpTime > 2000) { CVector bloodPos = GetPosition(); if (remainingBloodyFpTime - 2000 >= 5000) { if (!m_deadBleeding) { CShadows::AddPermanentShadow(SHADOWTYPE_DARK, gpBloodPoolTex, &bloodPos, 0.75f, 0.0f, 0.0f, -0.75f, 255, 255, 0, 0, 4.0f, 40000, 1.0f); m_deadBleeding = true; } } else { CShadows::StoreStaticShadow( (uintptr)this + 17, SHADOWTYPE_DARK, gpBloodPoolTex, &bloodPos, (remainingBloodyFpTime - 2000) / 5000.0f * 0.75f, 0.0f, 0.0f, (remainingBloodyFpTime - 2000) / 5000.0f * -0.75f, 255, 255, 0, 0, 4.0f, 1.0f, 40.0f, false, 0.0f); } } } if (ServiceTalkingWhenDead()) ServiceTalking(); #ifdef VC_PED_PORTS if (bIsInWater) { bIsStanding = false; bWasStanding = false; CPhysical::ProcessControl(); } #endif return; } bWasStanding = false; if (bIsStanding) { if (!CWorld::bForceProcessControl) { if (m_pCurrentPhysSurface && m_pCurrentPhysSurface->bIsInSafePosition) { bWasPostponed = true; return; } } } if (!IsPedInControl() || m_nWaitState != WAITSTATE_FALSE || 0.01f * CTimer::GetTimeStep() <= m_fDistanceTravelled || (m_nStoredMoveState != PEDMOVE_WALK && m_nStoredMoveState != PEDMOVE_RUN && m_nStoredMoveState != PEDMOVE_SPRINT)) m_panicCounter = 0; else if (m_panicCounter < 50) ++m_panicCounter; if (m_fHealth <= 1.0f && m_nPedState <= PED_STATES_NO_AI && !bIsInTheAir && !bIsLanding) SetDie(ANIM_STD_KO_FRONT, 4.0f, 0.0f); bCollidedWithMyVehicle = false; CEntity *collidingEnt = m_pDamageEntity; #ifndef VC_PED_PORTS if (!bUsesCollision || m_fDamageImpulse <= 0.0f || m_nPedState == PED_DIE || !collidingEnt) { #else if (!bUsesCollision || ((!collidingEnt || m_fDamageImpulse <= 0.0f) && (!IsPlayer() || !bIsStuck)) || m_nPedState == PED_DIE) { #endif bHitSomethingLastFrame = false; if (m_nPedStateTimer <= 500 && bIsInTheAir) { if (m_nPedStateTimer) m_nPedStateTimer--; } else if (m_nPedStateTimer < 1001) { m_nPedStateTimer = 0; } } else { if (m_panicCounter == 50 && IsPedInControl()) { SetWaitState(WAITSTATE_STUCK, nil); // Leftover /* if (m_nPedType < PEDTYPE_COP) { } else { } */ #ifndef VC_PED_PORTS } else { #else } else if (collidingEnt) { #endif switch (collidingEnt->GetType()) { case ENTITY_TYPE_BUILDING: case ENTITY_TYPE_OBJECT: { CBaseModelInfo *collidingModel = CModelInfo::GetModelInfo(collidingEnt->GetModelIndex()); CColModel *collidingCol = collidingModel->GetColModel(); if (collidingEnt->IsObject() && ((CObject*)collidingEnt)->m_nSpecialCollisionResponseCases != COLLRESPONSE_FENCEPART || collidingCol->boundingBox.max.x < 3.0f && collidingCol->boundingBox.max.y < 3.0f) { if (!IsPlayer()) { SetDirectionToWalkAroundObject(collidingEnt); break; } } if (IsPlayer()) { bHitSomethingLastFrame = true; break; } float angleToFaceWhenHit = CGeneral::GetRadianAngleBetweenPoints( GetPosition().x, GetPosition().y, m_vecDamageNormal.x + GetPosition().x, m_vecDamageNormal.y + GetPosition().y); float neededTurn = Abs(m_fRotationCur - angleToFaceWhenHit); if (neededTurn > PI) neededTurn = TWOPI - neededTurn; float oldDestRot = CGeneral::LimitRadianAngle(m_fRotationDest); if (m_pedInObjective && (m_objective == OBJECTIVE_GOTO_CHAR_ON_FOOT || m_objective == OBJECTIVE_KILL_CHAR_ON_FOOT)) { if (m_pedInObjective->IsPlayer() && (neededTurn < DEGTORAD(20.0f) || m_panicCounter > 10)) { if (CanPedJumpThis(collidingEnt)) { SetJump(); } else if (m_objective == OBJECTIVE_KILL_CHAR_ON_FOOT) { SetWaitState(WAITSTATE_LOOK_ABOUT, nil); } else { SetWaitState(WAITSTATE_PLAYANIM_TAXI, nil); m_headingRate = 0.0f; SetLookFlag(m_pedInObjective, true); SetLookTimer(3000); Say(SOUND_PED_TAXI_CALL); } } else { m_pLookTarget = m_pedInObjective; m_pLookTarget->RegisterReference((CEntity **) &m_pLookTarget); TurnBody(); } } else { if (m_nPedType != PEDTYPE_COP && neededTurn < DEGTORAD(15.0f) && m_nWaitState == WAITSTATE_FALSE) { if ((m_nStoredMoveState == PEDMOVE_RUN || m_nStoredMoveState == PEDMOVE_SPRINT) && m_vecDamageNormal.z < 0.3f) { CAnimBlendAssociation *runAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_RUN); if (!runAssoc) runAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_RUNFAST); if (runAssoc && runAssoc->blendAmount > 0.9f && runAssoc->IsRunning()) { SetWaitState(WAITSTATE_HITWALL, nil); } } } if (m_nPedState == PED_FLEE_POS) { CVector2D fleePos = collidingEnt->GetPosition(); uint32 oldFleeTimer = m_fleeTimer; SetFlee(fleePos, 5000); if (oldFleeTimer != m_fleeTimer) m_nPedStateTimer = CTimer::GetTimeInMilliseconds() + 500; } else { if (m_nPedState == PED_FLEE_ENTITY && (neededTurn < DEGTORAD(25.0f) || m_panicCounter > 10)) { m_collidingThingTimer = CTimer::GetTimeInMilliseconds() + 2500; m_collidingEntityWhileFleeing = collidingEnt; m_collidingEntityWhileFleeing->RegisterReference((CEntity **) &m_collidingEntityWhileFleeing); uint8 currentDir = Floor((PI + m_fRotationCur) / DEGTORAD(45.0f)); uint8 nextDir; ThePaths.FindNextNodeWandering(PATH_PED, GetPosition(), &m_pLastPathNode, &m_pNextPathNode, currentDir, &nextDir); } else { if (neededTurn < DEGTORAD(60.0f)) { CVector posToHead = m_vecDamageNormal * 4.0f; posToHead.z = 0.0f; posToHead += GetPosition(); int closestNodeId = ThePaths.FindNodeClosestToCoors(posToHead, PATH_PED, 999999.9f, false, false); float angleToFace; if (m_objective != OBJECTIVE_KILL_CHAR_ON_FOOT && m_objective != OBJECTIVE_KILL_CHAR_ANY_MEANS) { if (m_nPedState != PED_SEEK_POS && m_nPedState != PED_SEEK_CAR) { if (m_nPedState == PED_WANDER_PATH) { m_pNextPathNode = &ThePaths.m_pathNodes[closestNodeId]; angleToFace = CGeneral::GetRadianAngleBetweenPoints( m_pNextPathNode->GetX(), m_pNextPathNode->GetY(), GetPosition().x, GetPosition().y); } else { if (ThePaths.m_pathNodes[closestNodeId].GetX() == 0.0f || ThePaths.m_pathNodes[closestNodeId].GetY() == 0.0f) { posToHead = (3.0f * m_vecDamageNormal) + GetPosition(); posToHead.x += (CGeneral::GetRandomNumber() % 512) / 250.0f - 1.0f; posToHead.y += (CGeneral::GetRandomNumber() % 512) / 250.0f - 1.0f; } else { posToHead.x = ThePaths.m_pathNodes[closestNodeId].GetX(); posToHead.y = ThePaths.m_pathNodes[closestNodeId].GetY(); } angleToFace = CGeneral::GetRadianAngleBetweenPoints( posToHead.x, posToHead.y, GetPosition().x, GetPosition().y); if (m_nPedState != PED_FOLLOW_PATH) m_nPedStateTimer = CTimer::GetTimeInMilliseconds() + 500; } } else { angleToFace = CGeneral::GetRadianAngleBetweenPoints( ThePaths.m_pathNodes[closestNodeId].GetX(), ThePaths.m_pathNodes[closestNodeId].GetY(), GetPosition().x, GetPosition().y); CVector2D distToNode = ThePaths.m_pathNodes[closestNodeId].GetPosition() - GetPosition(); CVector2D distToSeekPos = m_vecSeekPos - GetPosition(); if (DotProduct2D(distToNode, distToSeekPos) < 0.0f) { m_fRotationCur = m_fRotationDest; break; } } } else { float angleToFaceAwayDamage = CGeneral::GetRadianAngleBetweenPoints( m_vecDamageNormal.x, m_vecDamageNormal.y, 0.0f, 0.0f); if (angleToFaceAwayDamage < m_fRotationCur) angleToFaceAwayDamage += TWOPI; float neededTurn = angleToFaceAwayDamage - m_fRotationCur; if (neededTurn <= PI) { angleToFace = 0.5f * neededTurn + m_fRotationCur; m_fRotationCur += DEGTORAD(m_pedStats->m_headingChangeRate) * 2.0f; } else { angleToFace = m_fRotationCur - (TWOPI - neededTurn) * 0.5f; m_fRotationCur -= DEGTORAD(m_pedStats->m_headingChangeRate) * 2.0f; } m_nPedStateTimer = CTimer::GetTimeInMilliseconds() + 200; if (m_nPedType == PEDTYPE_COP) { if (m_pedInObjective) { float angleToLookCriminal = CGeneral::GetRadianAngleBetweenPoints( m_pedInObjective->GetPosition().x, m_pedInObjective->GetPosition().y, GetPosition().x, GetPosition().y); angleToLookCriminal = CGeneral::LimitRadianAngle(angleToLookCriminal); angleToFace = CGeneral::LimitRadianAngle(angleToFace); if (angleToLookCriminal < angleToFace) angleToLookCriminal += TWOPI; float neededTurnToCriminal = angleToLookCriminal - angleToFace; if (neededTurnToCriminal > DEGTORAD(150.0f) && neededTurnToCriminal < DEGTORAD(210.0f)) { ((CCopPed*)this)->m_bStopAndShootDisabledZone = true; } } } } m_fRotationDest = CGeneral::LimitRadianAngle(angleToFace); if (m_fRotationCur - PI > m_fRotationDest) { m_fRotationDest += TWOPI; } else if (PI + m_fRotationCur < m_fRotationDest) { m_fRotationDest -= TWOPI; } if (oldDestRot == m_fRotationDest && CTimer::GetTimeInMilliseconds() > m_nPedStateTimer) { m_nPedStateTimer = CTimer::GetTimeInMilliseconds() + 200; m_fRotationDest += HALFPI; } } } } } if (m_nPedState != PED_WANDER_PATH && m_nPedState != PED_FLEE_ENTITY) m_pNextPathNode = nil; bHitSomethingLastFrame = true; break; } case ENTITY_TYPE_VEHICLE: { CVehicle* collidingVeh = ((CVehicle*)collidingEnt); float collidingVehSpeedSqr = collidingVeh->m_vecMoveSpeed.MagnitudeSqr(); if (collidingVeh == m_pMyVehicle) bCollidedWithMyVehicle = true; #ifdef VC_PED_PORTS float oldHealth = m_fHealth; bool playerSufferSound = false; if (collidingVehSpeedSqr <= 1.0f / 400.0f) { if (IsPedInControl() && (!IsPlayer() || m_objective == OBJECTIVE_GOTO_AREA_ON_FOOT || m_objective == OBJECTIVE_RUN_TO_AREA || m_objective == OBJECTIVE_ENTER_CAR_AS_DRIVER)) { if (collidingVeh != m_pCurrentPhysSurface || IsPlayer()) { if (!bVehEnterDoorIsBlocked) { if (collidingVeh->GetStatus() != STATUS_PLAYER || CharCreatedBy == MISSION_CHAR) { // VC calls SetDirectionToWalkAroundVehicle instead if ped is in PED_SEEK_CAR. SetDirectionToWalkAroundObject(collidingVeh); CWorld::Players[CWorld::PlayerInFocus].m_nLastBumpPlayerCarTimer = m_nPedStateTimer; } else { if (CTimer::GetTimeInMilliseconds() >= CWorld::Players[CWorld::PlayerInFocus].m_nLastBumpPlayerCarTimer || m_nPedStateTimer >= CTimer::GetTimeInMilliseconds()) { // VC calls SetDirectionToWalkAroundVehicle instead if ped is in PED_SEEK_CAR. SetDirectionToWalkAroundObject(collidingVeh); CWorld::Players[CWorld::PlayerInFocus].m_nLastBumpPlayerCarTimer = m_nPedStateTimer; } else if (m_fleeFrom != collidingVeh) { SetFlee(collidingVeh, 4000); bUsePedNodeSeek = false; SetMoveState(PEDMOVE_WALK); } } } } else { float angleLeftToCompleteTurn = Abs(m_fRotationCur - m_fRotationDest); if (angleLeftToCompleteTurn < 0.01f && CanPedJumpThis(collidingVeh)) { SetJump(); } } } else if (IsPlayer() && !bIsInTheAir) { if (IsPedInControl() && ((CPlayerPed*)this)->m_fMoveSpeed == 0.0f && !bIsLooking && CTimer::GetTimeInMilliseconds() > m_lookTimer && collidingVeh->pDriver) { ((CPlayerPed*)this)->AnnoyPlayerPed(false); SetLookFlag(collidingVeh, true); SetLookTimer(1300); eWeaponType weaponType = GetWeapon()->m_eWeaponType; if (weaponType == WEAPONTYPE_UNARMED || weaponType == WEAPONTYPE_BASEBALLBAT || weaponType == WEAPONTYPE_COLT45 || weaponType == WEAPONTYPE_UZI) { bShakeFist = true; } } else { SetLookFlag(collidingVeh, true); SetLookTimer(500); } } } else { float adjustedImpulse = m_fDamageImpulse; if (IsPlayer()) { if (bIsStanding) { float forwardVecAndDamageDirDotProd = DotProduct(m_vecAnimMoveDelta.y * GetForward(), m_vecDamageNormal); if (forwardVecAndDamageDirDotProd < 0.0f) { adjustedImpulse = forwardVecAndDamageDirDotProd * m_fMass + m_fDamageImpulse; if (adjustedImpulse < 0.0f) adjustedImpulse = 0.0f; } } } if (m_fMass / 20.0f < adjustedImpulse) DMAudio.PlayOneShot(collidingVeh->m_audioEntityId, SOUND_CAR_PED_COLLISION, adjustedImpulse); if (IsPlayer()) { if (adjustedImpulse > 20.0f) adjustedImpulse = 20.0f; if (adjustedImpulse > 5.0f) { if (adjustedImpulse <= 13.0f) playerSufferSound = true; else Say(SOUND_PED_DAMAGE); } CColModel* collidingCol = CModelInfo::GetModelInfo(collidingVeh->m_modelIndex)->GetColModel(); CVector colMinVec = collidingCol->boundingBox.min; CVector colMaxVec = collidingCol->boundingBox.max; CVector vehColCenterDist = collidingVeh->GetMatrix() * ((colMinVec + colMaxVec) * 0.5f) - GetPosition(); // TLVC = To look vehicle center float angleToVehFront = collidingVeh->GetForward().Heading(); float angleDiffFromLookingFrontTLVC = angleToVehFront - vehColCenterDist.Heading(); angleDiffFromLookingFrontTLVC = CGeneral::LimitRadianAngle(angleDiffFromLookingFrontTLVC); // I don't know why do we use that float vehTopRightHeading = Atan2(colMaxVec.x - colMinVec.x, colMaxVec.y - colMinVec.y); CVector vehDist = GetPosition() - collidingVeh->GetPosition(); vehDist.Normalise(); float vehRightVecAndSpeedDotProd; if (Abs(angleDiffFromLookingFrontTLVC) >= vehTopRightHeading && Abs(angleDiffFromLookingFrontTLVC) < PI - vehTopRightHeading) { if (angleDiffFromLookingFrontTLVC <= 0.0f) { vehRightVecAndSpeedDotProd = DotProduct(collidingVeh->GetRight(), collidingVeh->m_vecMoveSpeed); // vehRightVecAndSpeedDotProd < 0.1f = Vehicle being overturned or spinning to it's right? if (collidingVehSpeedSqr > 1.0f / 100.0f && vehRightVecAndSpeedDotProd < 0.1f) { // Car's right faces towards us and isn't coming directly to us if (DotProduct(collidingVeh->GetRight(), GetForward()) < 0.0f && DotProduct(vehDist, collidingVeh->m_vecMoveSpeed) > 0.0f) { SetEvasiveStep(collidingVeh, 1); } } } else { vehRightVecAndSpeedDotProd = DotProduct(-1.0f * collidingVeh->GetRight(), collidingVeh->m_vecMoveSpeed); if (collidingVehSpeedSqr > 1.0f / 100.0f && vehRightVecAndSpeedDotProd < 0.1f) { if (DotProduct(collidingVeh->GetRight(), GetForward()) > 0.0f && DotProduct(vehDist, collidingVeh->m_vecMoveSpeed) > 0.0f) { SetEvasiveStep(collidingVeh, 1); } } } } else { vehRightVecAndSpeedDotProd = DotProduct(vehDist, collidingVeh->m_vecMoveSpeed); } if (vehRightVecAndSpeedDotProd <= 0.1f) { if (m_nPedState != PED_FIGHT) { SetLookFlag(collidingVeh, true); SetLookTimer(700); } } else { bIsStanding = false; CVector2D collidingEntMoveDir = -collidingVeh->m_vecMoveSpeed; int dir = GetLocalDirection(collidingEntMoveDir); SetFall(1000, (AnimationId)(dir + ANIM_STD_HIGHIMPACT_FRONT), false); float damage; if (collidingVeh->m_modelIndex == MI_TRAIN) { damage = 50.0f; } else { damage = 20.0f; } InflictDamage(collidingVeh, WEAPONTYPE_RAMMEDBYCAR, damage, PEDPIECE_TORSO, dir); Say(SOUND_PED_DAMAGE); } } else { KillPedWithCar(collidingVeh, m_fDamageImpulse); } /* VC specific if (m_pCollidingEntity != collidingEnt) bPushedAlongByCar = true; */ } if (m_fHealth < oldHealth && playerSufferSound) Say(SOUND_PED_HIT); #else if (collidingVehSpeedSqr <= 1.0f / 400.0f) { if (!IsPedInControl() || IsPlayer() && m_objective != OBJECTIVE_GOTO_AREA_ON_FOOT && m_objective != OBJECTIVE_ENTER_CAR_AS_DRIVER && m_objective != OBJECTIVE_RUN_TO_AREA) { if (IsPlayer() && !bIsInTheAir) { if (IsPedInControl() && ((CPlayerPed*)this)->m_fMoveSpeed == 0.0f && !bIsLooking && CTimer::GetTimeInMilliseconds() > m_lookTimer && collidingVeh->pDriver) { ((CPlayerPed*)this)->AnnoyPlayerPed(false); SetLookFlag(collidingVeh, true); SetLookTimer(1300); eWeaponType weaponType = GetWeapon()->m_eWeaponType; if (weaponType == WEAPONTYPE_UNARMED || weaponType == WEAPONTYPE_BASEBALLBAT || weaponType == WEAPONTYPE_COLT45 || weaponType == WEAPONTYPE_UZI) { bShakeFist = true; } } else { SetLookFlag(collidingVeh, true); SetLookTimer(500); } } } else if (!bVehEnterDoorIsBlocked) { if (collidingVeh->GetStatus() != STATUS_PLAYER || CharCreatedBy == MISSION_CHAR) { SetDirectionToWalkAroundObject(collidingVeh); } else if (CTimer::GetTimeInMilliseconds() >= CWorld::Players[CWorld::PlayerInFocus].m_nLastBumpPlayerCarTimer || m_nPedStateTimer >= CTimer::GetTimeInMilliseconds()) { SetDirectionToWalkAroundObject(collidingVeh); CWorld::Players[CWorld::PlayerInFocus].m_nLastBumpPlayerCarTimer = m_nPedStateTimer; } else if (m_fleeFrom != collidingVeh) { SetFlee(collidingVeh, 4000); bUsePedNodeSeek = false; SetMoveState(PEDMOVE_WALK); } } } else { DMAudio.PlayOneShot(collidingVeh->m_audioEntityId, SOUND_CAR_PED_COLLISION, m_fDamageImpulse); if (IsPlayer()) { CColModel *collidingCol = CModelInfo::GetModelInfo(collidingVeh->GetModelIndex())->GetColModel(); CVector colMinVec = collidingCol->boundingBox.min; CVector colMaxVec = collidingCol->boundingBox.max; CVector vehColCenterDist = collidingVeh->GetMatrix() * ((colMinVec + colMaxVec) * 0.5f) - GetPosition(); // TLVC = To look vehicle center float angleToVehFront = collidingVeh->GetForward().Heading(); float angleDiffFromLookingFrontTLVC = angleToVehFront - vehColCenterDist.Heading(); angleDiffFromLookingFrontTLVC = CGeneral::LimitRadianAngle(angleDiffFromLookingFrontTLVC); // I don't know why do we use that float vehTopRightHeading = Atan2(colMaxVec.x - colMinVec.x, colMaxVec.y - colMinVec.y); CVector vehDist = GetPosition() - collidingVeh->GetPosition(); vehDist.Normalise(); float vehRightVecAndSpeedDotProd; if (Abs(angleDiffFromLookingFrontTLVC) >= vehTopRightHeading && Abs(angleDiffFromLookingFrontTLVC) < PI - vehTopRightHeading) { if (angleDiffFromLookingFrontTLVC <= 0.0f) { vehRightVecAndSpeedDotProd = DotProduct(collidingVeh->GetRight(), collidingVeh->m_vecMoveSpeed); // vehRightVecAndSpeedDotProd < 0.1f = Vehicle being overturned or spinning to it's right? if (collidingVehSpeedSqr > 1.0f / 100.0f && vehRightVecAndSpeedDotProd < 0.1f) { // Car's right faces towards us and isn't coming directly to us if (DotProduct(collidingVeh->GetRight(), GetForward()) < 0.0f && DotProduct(vehDist, collidingVeh->m_vecMoveSpeed) > 0.0f) { SetEvasiveStep(collidingVeh, 1); } } } else { vehRightVecAndSpeedDotProd = DotProduct(-1.0f * collidingVeh->GetRight(), collidingVeh->m_vecMoveSpeed); if (collidingVehSpeedSqr > 1.0f / 100.0f && vehRightVecAndSpeedDotProd < 0.1f) { if (DotProduct(collidingVeh->GetRight(), GetForward()) > 0.0f && DotProduct(vehDist, collidingVeh->m_vecMoveSpeed) > 0.0f) { SetEvasiveStep(collidingVeh, 1); } } } } else { vehRightVecAndSpeedDotProd = DotProduct(vehDist, collidingVeh->m_vecMoveSpeed); } if (vehRightVecAndSpeedDotProd <= 0.1f) { if (m_nPedState != PED_FIGHT) { SetLookFlag(collidingVeh, true); SetLookTimer(700); } } else { bIsStanding = false; CVector2D collidingEntMoveDir = -collidingVeh->m_vecMoveSpeed; int dir = GetLocalDirection(collidingEntMoveDir); SetFall(1000, (AnimationId)(dir + ANIM_STD_HIGHIMPACT_FRONT), false); CPed *driver = collidingVeh->pDriver; float damage; if (driver && driver->IsPlayer()) { damage = vehRightVecAndSpeedDotProd * 1000.0f; } else if (collidingVeh->GetModelIndex() == MI_TRAIN) { damage = 50.0f; } else { damage = 20.0f; } InflictDamage(collidingVeh, WEAPONTYPE_RAMMEDBYCAR, damage, PEDPIECE_TORSO, dir); Say(SOUND_PED_DAMAGE); } } else { KillPedWithCar(collidingVeh, m_fDamageImpulse); } } #endif break; } case ENTITY_TYPE_PED: { CollideWithPed((CPed*)collidingEnt); if (((CPed*)collidingEnt)->IsPlayer()) { CPlayerPed *player = ((CPlayerPed*)collidingEnt); Say(SOUND_PED_CHAT); if (m_nMoveState > PEDMOVE_STILL && player->IsPedInControl()) { if (player->m_fMoveSpeed < 1.0f) { if (!player->bIsLooking) { if (CTimer::GetTimeInMilliseconds() > player->m_lookTimer) { player->AnnoyPlayerPed(false); player->SetLookFlag(this, true); player->SetLookTimer(1300); eWeaponType weapon = player->GetWeapon()->m_eWeaponType; if (weapon == WEAPONTYPE_UNARMED || weapon == WEAPONTYPE_BASEBALLBAT || weapon == WEAPONTYPE_COLT45 || weapon == WEAPONTYPE_UZI) { player->bShakeFist = true; } } } } } } break; } default: break; } } CVector forceDir; if (!bIsInTheAir && m_nPedState != PED_JUMP #ifdef VC_PED_PORTS && m_fDamageImpulse > 0.0f #endif ) { forceDir = m_vecDamageNormal; forceDir.z = 0.0f; if (!bIsStanding) { forceDir *= 4.0f; } else { forceDir *= 0.5f; } ApplyMoveForce(forceDir); } if ((bIsInTheAir && !DyingOrDead()) #ifdef VC_PED_PORTS || (!bIsStanding && !bWasStanding && m_nPedState == PED_FALL) #endif ) { if (m_nPedStateTimer > 0 && m_nPedStateTimer <= 1000) { forceDir = GetPosition() - m_vecHitLastPos; } else { m_nPedStateTimer = 0; m_vecHitLastPos = GetPosition(); forceDir = CVector(0.0f, 0.0f, 0.0f); } CVector offsetToCheck; m_nPedStateTimer++; float adjustedTs = Max(CTimer::GetTimeStep(), 0.01f); CPad *pad0 = CPad::GetPad(0); if ((m_nPedStateTimer <= 50.0f / (4.0f * adjustedTs) || m_nPedStateTimer * 0.01f <= forceDir.MagnitudeSqr()) && (m_nCollisionRecords <= 1 || m_nPedStateTimer <= 50.0f / (2.0f * adjustedTs) || m_nPedStateTimer * 1.0f / 250.0f <= Abs(forceDir.z))) { if (m_nCollisionRecords == 1 && m_aCollisionRecords[0] != nil && m_aCollisionRecords[0]->IsBuilding() && m_nPedStateTimer > 50.0f / (2.0f * adjustedTs) && m_nPedStateTimer * 1.0f / 250.0f > Abs(forceDir.z)) { offsetToCheck.x = -forceDir.y; #ifdef VC_PED_PORTS offsetToCheck.z = 1.0f; #else offsetToCheck.z = 0.0f; #endif offsetToCheck.y = forceDir.x; offsetToCheck.Normalise(); CVector posToCheck = GetPosition() + offsetToCheck; // These are either obstacle or ground to land, I don't know which one. float obstacleForFlyingZ, obstacleForFlyingOtherDirZ; CColPoint obstacleForFlying, obstacleForFlyingOtherDir; // Check is there any room for being knocked up in reverse direction of force if (CWorld::ProcessVerticalLine(posToCheck, -20.0f, obstacleForFlying, foundEnt, true, false, false, false, false, false, nil)) { obstacleForFlyingZ = obstacleForFlying.point.z; } else { obstacleForFlyingZ = 500.0f; } posToCheck = GetPosition() - offsetToCheck; // Now check for direction of force this time if (CWorld::ProcessVerticalLine(posToCheck, -20.0f, obstacleForFlyingOtherDir, foundEnt, true, false, false, false, false, false, nil)) { obstacleForFlyingOtherDirZ = obstacleForFlyingOtherDir.point.z; } else { obstacleForFlyingOtherDirZ = 501.0f; } #ifdef VC_PED_PORTS uint8 flyDir = 0; float feetZ = GetPosition().z - FEET_OFFSET; #ifdef FIX_BUGS if (obstacleForFlyingZ > feetZ && obstacleForFlyingOtherDirZ < 501.0f) flyDir = 1; else if (obstacleForFlyingOtherDirZ > feetZ && obstacleForFlyingZ < 500.0f) flyDir = 2; #else if ((obstacleForFlyingZ > feetZ && obstacleForFlyingOtherDirZ < 500.0f) || (obstacleForFlyingZ > feetZ && obstacleForFlyingOtherDirZ > feetZ)) flyDir = 1; else if (obstacleForFlyingOtherDirZ > feetZ && obstacleForFlyingZ < 499.0f) flyDir = 2; #endif if (flyDir != 0 && !bSomeVCflag1) { SetPosition((flyDir == 2 ? obstacleForFlyingOtherDir.point : obstacleForFlying.point)); GetMatrix().GetPosition().z += FEET_OFFSET; GetMatrix().UpdateRW(); SetLanding(); bIsStanding = true; } #endif if (obstacleForFlyingZ < obstacleForFlyingOtherDirZ) { offsetToCheck *= -1.0f; } offsetToCheck.z = 1.0f; forceDir = 4.0f * offsetToCheck; forceDir.z = 4.0f; ApplyMoveForce(forceDir); // What was that for?? It pushes player inside of collision sometimes and kills him. #ifdef FIX_BUGS if (!IsPlayer()) #endif GetMatrix().GetPosition() += 0.25f * offsetToCheck; m_fRotationCur = CGeneral::GetRadianAngleBetweenPoints(offsetToCheck.x, offsetToCheck.y, 0.0f, 0.0f); m_fRotationCur = CGeneral::LimitRadianAngle(m_fRotationCur); m_fRotationDest = m_fRotationCur; SetHeading(m_fRotationCur); if (m_nPedState != PED_FALL && !bIsPedDieAnimPlaying) { SetFall(1000, ANIM_STD_HIGHIMPACT_BACK, true); } bIsInTheAir = false; } else if (m_vecDamageNormal.z > 0.4f) { #ifndef VC_PED_PORTS forceDir = m_vecDamageNormal; forceDir.z = 0.0f; forceDir.Normalise(); ApplyMoveForce(2.0f * forceDir); #else if (m_nPedState == PED_JUMP) { if (m_nWaitTimer <= 2000) { if (m_nWaitTimer < 1000) m_nWaitTimer += CTimer::GetTimeStep() * 0.02f * 1000.0f; } else { m_nWaitTimer = 0; } } forceDir = m_vecDamageNormal; forceDir.z = 0.0f; forceDir.Normalise(); if (m_nPedState != PED_JUMP || m_nWaitTimer >= 300) { ApplyMoveForce(2.0f * forceDir); } else { ApplyMoveForce(-4.0f * forceDir); } #endif } } else if ((CTimer::GetFrameCounter() + m_randomSeed % 256 + 3) & 7) { if (IsPlayer() && m_nPedState != PED_JUMP && pad0->JumpJustDown()) { int16 padWalkX = pad0->GetPedWalkLeftRight(); int16 padWalkY = pad0->GetPedWalkUpDown(); if (Abs(padWalkX) > 0.0f || Abs(padWalkY) > 0.0f) { m_fRotationDest = CGeneral::GetRadianAngleBetweenPoints(0.0f, 0.0f, -padWalkX, padWalkY); m_fRotationDest -= TheCamera.Orientation; m_fRotationDest = CGeneral::LimitRadianAngle(m_fRotationDest); m_fRotationCur = m_fRotationDest; SetHeading(m_fRotationCur); } SetJump(); m_nPedStateTimer = 0; m_vecHitLastPos = GetPosition(); // Why? forceDir is unused after this point. forceDir = CVector(0.0f, 0.0f, 0.0f); } else if (IsPlayer()) { int16 padWalkX = pad0->GetPedWalkLeftRight(); int16 padWalkY = pad0->GetPedWalkUpDown(); if (Abs(padWalkX) > 0.0f || Abs(padWalkY) > 0.0f) { m_fRotationDest = CGeneral::GetRadianAngleBetweenPoints(0.0f, 0.0f, -padWalkX, padWalkY); m_fRotationDest -= TheCamera.Orientation; m_fRotationDest = CGeneral::LimitRadianAngle(m_fRotationDest); m_fRotationCur = m_fRotationDest; SetHeading(m_fRotationCur); } CAnimBlendAssociation *jumpAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_JUMP_GLIDE); if (!jumpAssoc) jumpAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_FALL_GLIDE); if (jumpAssoc) { jumpAssoc->blendDelta = -3.0f; jumpAssoc->flags |= ASSOC_DELETEFADEDOUT; } if (m_nPedState == PED_JUMP) m_nPedState = PED_IDLE; } else { CAnimBlendAssociation *jumpAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_JUMP_GLIDE); if (!jumpAssoc) jumpAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_FALL_GLIDE); if (jumpAssoc) { jumpAssoc->blendDelta = -3.0f; jumpAssoc->flags |= ASSOC_DELETEFADEDOUT; } } } else { offsetToCheck = GetPosition(); offsetToCheck.z += 0.5f; if (CWorld::ProcessVerticalLine(offsetToCheck, GetPosition().z - FEET_OFFSET, foundCol, foundEnt, true, true, false, true, false, false, nil)) { #ifdef VC_PED_PORTS if (!bSomeVCflag1 || FEET_OFFSET + foundCol.point.z < GetPosition().z) { GetMatrix().GetPosition().z = FEET_OFFSET + foundCol.point.z; GetMatrix().UpdateRW(); if (bSomeVCflag1) bSomeVCflag1 = false; } #else GetMatrix().GetPosition().z = FEET_OFFSET + foundCol.point.z; GetMatrix().UpdateRW(); #endif SetLanding(); bIsStanding = true; } } } else if (m_nPedStateTimer < 1001) { m_nPedStateTimer = 0; } } if (bIsDucking) Duck(); if (bStartWanderPathOnFoot) { if (IsPedInControl()) { ClearAll(); SetWanderPath(m_nPathDir); bStartWanderPathOnFoot = false; } else if (m_nPedState == PED_DRIVING) { bWanderPathAfterExitingCar = true; SetObjective(OBJECTIVE_LEAVE_CAR, m_pMyVehicle); } } if (!bIsStanding && m_vecMoveSpeed.z > 0.25f) { float airResistance = Pow(0.95f, CTimer::GetTimeStep()); m_vecMoveSpeed *= airResistance; } #ifdef VC_PED_PORTS if (IsPlayer() || !bIsStanding || m_vecMoveSpeed.x != 0.0f || m_vecMoveSpeed.y != 0.0f || m_vecMoveSpeed.z != 0.0f || (m_nMoveState != PEDMOVE_NONE && m_nMoveState != PEDMOVE_STILL) || m_vecAnimMoveDelta.x != 0.0f || m_vecAnimMoveDelta.y != 0.0f || m_nPedState == PED_JUMP || bIsInTheAir || m_pCurrentPhysSurface) { CPhysical::ProcessControl(); } else { bHasContacted = false; bIsInSafePosition = false; bWasPostponed = false; bHasHitWall = false; m_nCollisionRecords = 0; bHasCollided = false; m_nDamagePieceType = 0; m_fDamageImpulse = 0.0f; m_pDamageEntity = nil; m_vecTurnFriction = CVector(0.0f, 0.0f, 0.0f); m_vecMoveFriction = CVector(0.0f, 0.0f, 0.0f); } #else CPhysical::ProcessControl(); #endif if (m_nPedState != PED_DIE || bIsPedDieAnimPlaying) { if (m_nPedState != PED_DEAD) { CalculateNewVelocity(); CalculateNewOrientation(); } UpdatePosition(); PlayFootSteps(); if (IsPedInControl() && !bIsStanding && !m_pDamageEntity && CheckIfInTheAir()) { SetInTheAir(); #ifdef VC_PED_PORTS bSomeVCflag1 = false; #endif } #ifdef VC_PED_PORTS if (bSomeVCflag1) { CVector posToCheck = GetPosition(); posToCheck.z += 0.9f; if (!CWorld::TestSphereAgainstWorld(posToCheck, 0.2f, this, true, true, false, true, false, false)) bSomeVCflag1 = false; } #endif ProcessObjective(); if (!bIsAimingGun) { if (bIsRestoringGun) RestoreGunPosition(); } else { AimGun(); } if (bIsLooking) { MoveHeadToLook(); } else if (bIsRestoringLook) { RestoreHeadPosition(); } if (bIsInTheAir) InTheAir(); if (bUpdateAnimHeading) { if (m_nPedState != PED_GETUP && m_nPedState != PED_FALL) { m_fRotationCur -= HALFPI; m_fRotationDest = m_fRotationCur; bUpdateAnimHeading = false; } } if (m_nWaitState != WAITSTATE_FALSE) Wait(); if (m_nPedState != PED_IDLE) { CAnimBlendAssociation *idleAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_IDLE_BIGGUN); if(idleAssoc) { idleAssoc->blendDelta = -8.0f; idleAssoc->flags |= ASSOC_DELETEFADEDOUT; } } #ifdef CANCELLABLE_CAR_ENTER static bool cancelJack = false; if (IsPlayer()) { if (EnteringCar() && m_pVehicleAnim) { CPad *pad = CPad::GetPad(0); if (!pad->ArePlayerControlsDisabled()) { int vehAnim = m_pVehicleAnim->animId; int16 padWalkX = pad->GetPedWalkLeftRight(); int16 padWalkY = pad->GetPedWalkUpDown(); if (Abs(padWalkX) > 0.0f || Abs(padWalkY) > 0.0f) { if (vehAnim == ANIM_STD_CAR_OPEN_DOOR_LHS || vehAnim == ANIM_STD_CAR_OPEN_DOOR_RHS || vehAnim == ANIM_STD_COACH_OPEN_LHS || vehAnim == ANIM_STD_COACH_OPEN_RHS || vehAnim == ANIM_STD_VAN_OPEN_DOOR_REAR_LHS || vehAnim == ANIM_STD_VAN_OPEN_DOOR_REAR_RHS) { if (!m_pMyVehicle->pDriver) { cancelJack = false; bCancelEnteringCar = true; } else cancelJack = true; } else if (vehAnim == ANIM_STD_QUICKJACK && m_pVehicleAnim->GetTimeLeft() > 0.75f) { cancelJack = true; } else if (vehAnim == ANIM_STD_CAR_PULL_OUT_PED_LHS || vehAnim == ANIM_STD_CAR_PULL_OUT_PED_LO_LHS || vehAnim == ANIM_STD_CAR_PULL_OUT_PED_LO_RHS || vehAnim == ANIM_STD_CAR_PULL_OUT_PED_RHS) { bCancelEnteringCar = true; cancelJack = false; } } if (cancelJack && vehAnim == ANIM_STD_QUICKJACK && m_pVehicleAnim->GetTimeLeft() > 0.75f && m_pVehicleAnim->GetTimeLeft() < 0.78f) { cancelJack = false; QuitEnteringCar(); RestorePreviousObjective(); } if (cancelJack && (vehAnim == ANIM_STD_CAR_PULL_OUT_PED_LHS || vehAnim == ANIM_STD_CAR_PULL_OUT_PED_LO_LHS || vehAnim == ANIM_STD_CAR_PULL_OUT_PED_LO_RHS || vehAnim == ANIM_STD_CAR_PULL_OUT_PED_RHS)) { cancelJack = false; bCancelEnteringCar = true; } } } else cancelJack = false; } #endif switch (m_nPedState) { case PED_IDLE: Idle(); break; case PED_LOOK_ENTITY: case PED_LOOK_HEADING: Look(); break; case PED_WANDER_RANGE: WanderRange(); CheckAroundForPossibleCollisions(); break; case PED_WANDER_PATH: WanderPath(); break; case PED_ENTER_CAR: case PED_CARJACK: break; case PED_FLEE_POS: ms_vec2DFleePosition.x = m_fleeFromPosX; ms_vec2DFleePosition.y = m_fleeFromPosY; Flee(); break; case PED_FLEE_ENTITY: if (!m_fleeFrom) { SetIdle(); break; } if (CTimer::GetTimeInMilliseconds() <= m_nPedStateTimer) break; ms_vec2DFleePosition = m_fleeFrom->GetPosition(); Flee(); break; case PED_FOLLOW_PATH: FollowPath(); break; case PED_PAUSE: Pause(); break; case PED_ATTACK: Attack(); break; case PED_FIGHT: Fight(); break; case PED_CHAT: Chat(); break; case PED_AIM_GUN: if (m_pPointGunAt && m_pPointGunAt->IsPed() #ifdef FIX_BUGS && !GetWeapon()->IsTypeMelee() #endif && ((CPed*)m_pPointGunAt)->CanSeeEntity(this, CAN_SEE_ENTITY_ANGLE_THRESHOLD * 2)) { ((CPed*)m_pPointGunAt)->ReactToPointGun(this); } PointGunAt(); break; case PED_SEEK_CAR: SeekCar(); break; case PED_SEEK_IN_BOAT: SeekBoatPosition(); break; case PED_INVESTIGATE: InvestigateEvent(); break; case PED_ON_FIRE: if (IsPlayer()) break; if (CTimer::GetTimeInMilliseconds() <= m_fleeTimer) { if (m_fleeFrom) { ms_vec2DFleePosition = m_fleeFrom->GetPosition(); } else { ms_vec2DFleePosition.x = m_fleeFromPosX; ms_vec2DFleePosition.y = m_fleeFromPosY; } Flee(); } else { if (m_pFire) m_pFire->Extinguish(); } break; case PED_FALL: Fall(); break; case PED_GETUP: SetGetUp(); break; case PED_ENTER_TRAIN: EnterTrain(); break; case PED_EXIT_TRAIN: ExitTrain(); break; case PED_DRIVING: { if (!m_pMyVehicle) { bInVehicle = false; FlagToDestroyWhenNextProcessed(); return; } if (m_pMyVehicle->pDriver != this || m_pMyVehicle->IsBoat()) { LookForSexyPeds(); LookForSexyCars(); break; } if (m_pMyVehicle->m_vehType == VEHICLE_TYPE_BIKE || !m_pMyVehicle->pDriver->IsPlayer()) { break; } CPad* pad = CPad::GetPad(0); #ifdef CAR_AIRBREAK if (!pad->ArePlayerControlsDisabled()) { if (pad->GetHorn()) { float c = Cos(m_fRotationCur); float s = Sin(m_fRotationCur); m_pMyVehicle->GetRight() = CVector(1.0f, 0.0f, 0.0f); m_pMyVehicle->GetForward() = CVector(0.0f, 1.0f, 0.0f); m_pMyVehicle->GetUp() = CVector(0.0f, 0.0f, 1.0f); if (pad->GetAccelerate()) { m_pMyVehicle->ApplyMoveForce(GetForward() * 30.0f); } else if (pad->GetBrake()) { m_pMyVehicle->ApplyMoveForce(-GetForward() * 30.0f); } else { int16 lr = pad->GetSteeringLeftRight(); if (lr < 0) { //m_pMyVehicle->ApplyTurnForce(20.0f * -GetRight(), GetForward()); m_pMyVehicle->ApplyMoveForce(-GetRight() * 30.0f); } else if (lr > 0) { m_pMyVehicle->ApplyMoveForce(GetRight() * 30.0f); } else { m_pMyVehicle->ApplyMoveForce(0.0f, 0.0f, 50.0f); } } } } #endif float steerAngle = m_pMyVehicle->m_fSteerAngle; CAnimBlendAssociation *lDriveAssoc; CAnimBlendAssociation *rDriveAssoc; CAnimBlendAssociation *lbAssoc; CAnimBlendAssociation *sitAssoc; if (m_pMyVehicle->bLowVehicle) { sitAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_CAR_SIT_LO); if (!sitAssoc || sitAssoc->blendAmount < 1.0f) { break; } lDriveAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_CAR_DRIVE_LEFT_LO); lbAssoc = nil; rDriveAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_CAR_DRIVE_RIGHT_LO); } else { sitAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_CAR_SIT); if (!sitAssoc || sitAssoc->blendAmount < 1.0f) { break; } lDriveAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_CAR_DRIVE_LEFT); rDriveAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_CAR_DRIVE_RIGHT); lbAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_CAR_LOOKBEHIND); if (lbAssoc && TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_1STPERSON && TheCamera.Cams[TheCamera.ActiveCam].DirectionWasLooking == LOOKING_LEFT) { lbAssoc->blendDelta = -1000.0f; } } CAnimBlendAssociation *driveByAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_CAR_DRIVEBY_LEFT); if (!driveByAssoc) driveByAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_CAR_DRIVEBY_RIGHT); if (m_pMyVehicle->bLowVehicle || m_pMyVehicle->m_fGasPedal >= 0.0f || driveByAssoc) { if (steerAngle == 0.0f || driveByAssoc) { if (lDriveAssoc) lDriveAssoc->blendAmount = 0.0f; if (rDriveAssoc) rDriveAssoc->blendAmount = 0.0f; } else if (steerAngle <= 0.0f) { if (lDriveAssoc) lDriveAssoc->blendAmount = 0.0f; if (rDriveAssoc) rDriveAssoc->blendAmount = clamp(steerAngle * -100.0f / 61.0f, 0.0f, 1.0f); else if (m_pMyVehicle->bLowVehicle) CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_CAR_DRIVE_RIGHT_LO); else CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_CAR_DRIVE_RIGHT); } else { if (rDriveAssoc) rDriveAssoc->blendAmount = 0.0f; if (lDriveAssoc) lDriveAssoc->blendAmount = clamp(steerAngle * 100.0f / 61.0f, 0.0f, 1.0f); else if (m_pMyVehicle->bLowVehicle) CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_CAR_DRIVE_LEFT_LO); else CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_CAR_DRIVE_LEFT); } if (lbAssoc) lbAssoc->blendDelta = -4.0f; } else { if ((TheCamera.Cams[TheCamera.ActiveCam].Mode != CCam::MODE_1STPERSON || TheCamera.Cams[TheCamera.ActiveCam].DirectionWasLooking != LOOKING_LEFT) && (!lbAssoc || lbAssoc->blendAmount < 1.0f)) { CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_CAR_LOOKBEHIND, 4.0f); } } break; } case PED_DIE: Die(); break; case PED_HANDS_UP: if (m_pedStats->m_temper <= 50) { if (!RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_HANDSCOWER)) { CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_HANDSCOWER); Say(SOUND_PED_HANDS_COWER); } } else if (!RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_HANDSUP)) { CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_HANDSUP); Say(SOUND_PED_HANDS_UP); } break; default: break; } SetMoveAnim(); if (bPedIsBleeding) { if (CGame::nastyGame) { if (!(CTimer::GetFrameCounter() & 3)) { CVector cameraDist = GetPosition() - TheCamera.GetPosition(); if (cameraDist.MagnitudeSqr() < sq(50.0f)) { float length = (CGeneral::GetRandomNumber() & 127) * 0.0015f + 0.15f; CVector bloodPos( ((CGeneral::GetRandomNumber() & 127) - 64) * 0.007f, ((CGeneral::GetRandomNumber() & 127) - 64) * 0.007f, 1.0f); bloodPos += GetPosition(); CShadows::AddPermanentShadow(SHADOWTYPE_DARK, gpBloodPoolTex, &bloodPos, length, 0.0f, 0.0f, -length, 255, 255, 0, 0, 4.0f, (CGeneral::GetRandomNumber() & 4095) + 2000, 1.0f); } } } } ServiceTalking(); if (bInVehicle && !m_pMyVehicle) bInVehicle = false; #ifndef VC_PED_PORTS m_pCurrentPhysSurface = nil; #endif } else { if (bIsStanding && (!m_pCurrentPhysSurface || IsPlayer()) || bIsInWater || !bUsesCollision) { SetDead(); } m_pCurrentPhysSurface = nil; } } } int32 CPed::ProcessEntityCollision(CEntity *collidingEnt, CColPoint *collidingPoints) { bool collidedWithBoat = false; bool belowTorsoCollided = false; float gravityEffect = -0.15f * CTimer::GetTimeStep(); CColPoint intersectionPoint; CColLine ourLine; CColModel *ourCol = CModelInfo::GetModelInfo(GetModelIndex())->GetColModel(); CColModel *hisCol = CModelInfo::GetModelInfo(collidingEnt->GetModelIndex())->GetColModel(); if (!bUsesCollision) return false; if (collidingEnt->IsVehicle() && ((CVehicle*)collidingEnt)->IsBoat()) collidedWithBoat = true; // ofc we're not vehicle if (!m_bIsVehicleBeingShifted && !bSkipLineCol #ifdef VC_PED_PORTS && !collidingEnt->IsPed() #endif ) { if (!bCollisionProcessed) { #ifdef VC_PED_PORTS m_pCurrentPhysSurface = nil; #endif if (bIsStanding) { bIsStanding = false; bWasStanding = true; } bCollisionProcessed = true; m_fCollisionSpeed += m_vecMoveSpeed.Magnitude2D() * CTimer::GetTimeStep(); bStillOnValidPoly = false; if (IsPlayer() || m_fCollisionSpeed >= 1.0f && (m_fCollisionSpeed >= 2.0f || m_nPedState != PED_WANDER_PATH)) { m_collPoly.valid = false; m_fCollisionSpeed = 0.0f; bHitSteepSlope = false; } else { CVector pos = GetPosition(); float potentialGroundZ = GetPosition().z - FEET_OFFSET; if (bWasStanding) { pos.z += -0.25f; potentialGroundZ += gravityEffect; } if (CCollision::IsStoredPolyStillValidVerticalLine(pos, potentialGroundZ, intersectionPoint, &m_collPoly)) { bStillOnValidPoly = true; #ifdef VC_PED_PORTS if(!bSomeVCflag1 || FEET_OFFSET + intersectionPoint.point.z < GetPosition().z) { GetMatrix().GetPosition().z = FEET_OFFSET + intersectionPoint.point.z; if (bSomeVCflag1) bSomeVCflag1 = false; } #else GetMatrix().GetPosition().z = FEET_OFFSET + intersectionPoint.point.z; #endif m_vecMoveSpeed.z = 0.0f; bIsStanding = true; } else { m_collPoly.valid = false; m_fCollisionSpeed = 0.0f; bHitSteepSlope = false; } } } if (!bStillOnValidPoly) { CVector potentialCenter = GetPosition(); potentialCenter.z = GetPosition().z - 0.52f; // 0.52f should be a ped's approx. radius float totalRadiusWhenCollided = collidingEnt->GetBoundRadius() + 0.52f - gravityEffect; if (bWasStanding) { if (collidedWithBoat) { potentialCenter.z += 2.0f * gravityEffect; totalRadiusWhenCollided += Abs(gravityEffect); } else { potentialCenter.z += gravityEffect; } } if (sq(totalRadiusWhenCollided) > (potentialCenter - collidingEnt->GetBoundCentre()).MagnitudeSqr()) { ourLine.p0 = GetPosition(); ourLine.p1 = GetPosition(); ourLine.p1.z = GetPosition().z - FEET_OFFSET; if (bWasStanding) { ourLine.p1.z = ourLine.p1.z + gravityEffect; ourLine.p0.z = ourLine.p0.z + -0.25f; } float minDist = 1.0f; belowTorsoCollided = CCollision::ProcessVerticalLine(ourLine, collidingEnt->GetMatrix(), *hisCol, intersectionPoint, minDist, false, &m_collPoly); if (collidedWithBoat && bWasStanding && !belowTorsoCollided) { ourLine.p0.z = ourLine.p1.z; ourLine.p1.z = ourLine.p1.z + gravityEffect; belowTorsoCollided = CCollision::ProcessVerticalLine(ourLine, collidingEnt->GetMatrix(), *hisCol, intersectionPoint, minDist, false, &m_collPoly); } if (belowTorsoCollided) { #ifndef VC_PED_PORTS if (!collidingEnt->IsPed()) { #endif if (!bIsStanding || FEET_OFFSET + intersectionPoint.point.z > GetPosition().z || collidedWithBoat && 3.12f + intersectionPoint.point.z > GetPosition().z) { if (!collidingEnt->IsVehicle() && !collidingEnt->IsObject()) { m_pCurSurface = collidingEnt; collidingEnt->RegisterReference((CEntity**)&m_pCurSurface); bTryingToReachDryLand = false; bOnBoat = false; } else { m_pCurrentPhysSurface = (CPhysical*)collidingEnt; collidingEnt->RegisterReference((CEntity**)&m_pCurrentPhysSurface); m_vecOffsetFromPhysSurface = intersectionPoint.point - collidingEnt->GetPosition(); m_pCurSurface = collidingEnt; collidingEnt->RegisterReference((CEntity**)&m_pCurSurface); m_collPoly.valid = false; if (collidingEnt->IsVehicle() && ((CVehicle*)collidingEnt)->IsBoat()) { bOnBoat = true; } else { bOnBoat = false; } } #ifdef VC_PED_PORTS if (!bSomeVCflag1 || FEET_OFFSET + intersectionPoint.point.z < GetPosition().z) { GetMatrix().GetPosition().z = FEET_OFFSET + intersectionPoint.point.z; if (bSomeVCflag1) bSomeVCflag1 = false; } #else GetMatrix().GetPosition().z = FEET_OFFSET + intersectionPoint.point.z; #endif m_nSurfaceTouched = intersectionPoint.surfaceB; if (m_nSurfaceTouched == SURFACE_STEEP_CLIFF) { bHitSteepSlope = true; m_vecDamageNormal = intersectionPoint.normal; } } #ifdef VC_PED_PORTS float upperSpeedLimit = 0.33f; float lowerSpeedLimit = -0.25f; float speed = m_vecMoveSpeed.Magnitude2D(); if (m_nPedState == PED_IDLE) { upperSpeedLimit *= 2.0f; lowerSpeedLimit *= 1.5f; } CAnimBlendAssociation *fallAnim = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_FALL); if (!bWasStanding && speed > upperSpeedLimit && (/*!bPushedAlongByCar ||*/ m_vecMoveSpeed.z < lowerSpeedLimit) && m_pCollidingEntity != collidingEnt) { float damage = 100.0f * Max(speed - 0.25f, 0.0f); float damage2 = damage; if (m_vecMoveSpeed.z < -0.25f) damage += (-0.25f - m_vecMoveSpeed.z) * 150.0f; uint8 dir = 2; // from backward if (m_vecMoveSpeed.x > 0.01f || m_vecMoveSpeed.x < -0.01f || m_vecMoveSpeed.y > 0.01f || m_vecMoveSpeed.y < -0.01f) { CVector2D offset = -m_vecMoveSpeed; dir = GetLocalDirection(offset); } InflictDamage(collidingEnt, WEAPONTYPE_FALL, damage, PEDPIECE_TORSO, dir); if (IsPlayer() && damage2 > 5.0f) Say(SOUND_PED_LAND); } else if (!bWasStanding && fallAnim && -0.016f * CTimer::GetTimeStep() > m_vecMoveSpeed.z) { InflictDamage(collidingEnt, WEAPONTYPE_FALL, 15.0f, PEDPIECE_TORSO, 2); } #else float speedSqr = 0.0f; CAnimBlendAssociation *fallAnim = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_FALL); if (!bWasStanding && (m_vecMoveSpeed.z < -0.25f || (speedSqr = m_vecMoveSpeed.MagnitudeSqr()) > sq(0.5f))) { if (speedSqr == 0.0f) speedSqr = sq(m_vecMoveSpeed.z); uint8 dir = 2; // from backward if (m_vecMoveSpeed.x > 0.01f || m_vecMoveSpeed.x < -0.01f || m_vecMoveSpeed.y > 0.01f || m_vecMoveSpeed.y < -0.01f) { CVector2D offset = -m_vecMoveSpeed; dir = GetLocalDirection(offset); } InflictDamage(collidingEnt, WEAPONTYPE_FALL, 350.0f * sq(speedSqr), PEDPIECE_TORSO, dir); } else if (!bWasStanding && fallAnim && -0.016f * CTimer::GetTimeStep() > m_vecMoveSpeed.z) { InflictDamage(collidingEnt, WEAPONTYPE_FALL, 15.0f, PEDPIECE_TORSO, 2); } #endif m_vecMoveSpeed.z = 0.0f; bIsStanding = true; #ifndef VC_PED_PORTS } else { bOnBoat = false; } #endif } else { bOnBoat = false; } } } } int ourCollidedSpheres = CCollision::ProcessColModels(GetMatrix(), *ourCol, collidingEnt->GetMatrix(), *hisCol, collidingPoints, nil, nil); if (ourCollidedSpheres > 0 || belowTorsoCollided) { AddCollisionRecord(collidingEnt); if (!collidingEnt->IsBuilding()) ((CPhysical*)collidingEnt)->AddCollisionRecord(this); if (ourCollidedSpheres > 0 && (collidingEnt->IsBuilding() || collidingEnt->GetIsStatic())) { bHasHitWall = true; } } if (collidingEnt->IsBuilding() || collidingEnt->GetIsStatic()) { if (bWasStanding) { CVector sphereNormal; float normalLength; for(int sphere = 0; sphere < ourCollidedSpheres; sphere++) { sphereNormal = collidingPoints[sphere].normal; #ifdef VC_PED_PORTS if (sphereNormal.z >= -1.0f || !IsPlayer()) { #endif normalLength = sphereNormal.Magnitude2D(); if (normalLength != 0.0f) { sphereNormal.x = sphereNormal.x / normalLength; sphereNormal.y = sphereNormal.y / normalLength; } #ifdef VC_PED_PORTS } else { float speed = m_vecMoveSpeed.Magnitude2D(); sphereNormal.x = -m_vecMoveSpeed.x / Max(0.001f, speed); sphereNormal.y = -m_vecMoveSpeed.y / Max(0.001f, speed); GetMatrix().GetPosition().z -= 0.05f; bSomeVCflag1 = true; } #endif sphereNormal.Normalise(); collidingPoints[sphere].normal = sphereNormal; if (collidingPoints[sphere].surfaceB == SURFACE_STEEP_CLIFF) bHitSteepSlope = true; } } } return ourCollidedSpheres; } static void particleProduceFootSplash(CPed *ped, CVector const &pos, float size, int times) { #ifdef PC_PARTICLE for (int i = 0; i < times; i++) { CVector adjustedPos = pos; adjustedPos.x += CGeneral::GetRandomNumberInRange(-0.1f, 0.1f); adjustedPos.y += CGeneral::GetRandomNumberInRange(-0.1f, 0.1f); CVector direction = ped->GetForward() * -0.05f; CParticle::AddParticle(PARTICLE_RAIN_SPLASHUP, adjustedPos, direction, nil, size, CRGBA(32, 32, 32, 32), 0, 0, CGeneral::GetRandomNumber() & 1, 200); } #else for ( int32 i = 0; i < times; i++ ) { CVector adjustedPos = pos; adjustedPos.x += CGeneral::GetRandomNumberInRange(-0.2f, 0.2f); adjustedPos.y += CGeneral::GetRandomNumberInRange(-0.2f, 0.2f); CParticle::AddParticle(PARTICLE_RAIN_SPLASHUP, adjustedPos, CVector(0.0f, 0.0f, 0.0f), nil, size, CRGBA(0, 0, 0, 0), 0, 0, CGeneral::GetRandomNumber() & 1, 200); } #endif } static void particleProduceFootDust(CPed *ped, CVector const &pos, float size, int times) { switch (ped->m_nSurfaceTouched) { case SURFACE_TARMAC: case SURFACE_GRAVEL: case SURFACE_PAVEMENT: case SURFACE_SAND: for (int i = 0; i < times; ++i) { CVector adjustedPos = pos; adjustedPos.x += CGeneral::GetRandomNumberInRange(-0.1f, 0.1f); adjustedPos.y += CGeneral::GetRandomNumberInRange(-0.1f, 0.1f); CParticle::AddParticle(PARTICLE_PEDFOOT_DUST, adjustedPos, CVector(0.0f, 0.0f, 0.0f), nil, size, CRGBA(0, 0, 0, 0), 0, 0, 0, 0); } break; default: break; } } void CPed::PlayFootSteps(void) { if (bDoBloodyFootprints) { if (m_bloodyFootprintCountOrDeathTime > 0 && m_bloodyFootprintCountOrDeathTime < 300) { m_bloodyFootprintCountOrDeathTime--; if (m_bloodyFootprintCountOrDeathTime == 0) bDoBloodyFootprints = false; } } if (!bIsStanding) return; CAnimBlendAssociation *assoc = RpAnimBlendClumpGetFirstAssociation(GetClump()); CAnimBlendAssociation *walkRunAssoc = nil; float walkRunAssocBlend = 0.0f, idleAssocBlend = 0.0f; for (; assoc; assoc = RpAnimBlendGetNextAssociation(assoc)) { if (assoc->flags & ASSOC_WALK) { walkRunAssoc = assoc; walkRunAssocBlend += assoc->blendAmount; } else if ((assoc->flags & ASSOC_NOWALK) == 0) { idleAssocBlend += assoc->blendAmount; } } #ifdef GTA_PS2_STUFF CAnimBlendAssociation *runStopAsoc = NULL; if ( IsPlayer() ) { runStopAsoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_RUNSTOP2); if ( runStopAsoc == NULL ) runStopAsoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_RUNSTOP2); } if ( runStopAsoc != NULL && runStopAsoc->blendAmount > 0.1f ) { { CVector pos(0.0f, 0.0f, 0.0f); TransformToNode(pos, PED_FOOTL); pos.z -= 0.1f; pos += GetForward()*0.2f; particleProduceFootDust(this, pos, 0.02f, 1); } { CVector pos(0.0f, 0.0f, 0.0f); TransformToNode(pos, PED_FOOTR); pos.z -= 0.1f; pos += GetForward()*0.2f; particleProduceFootDust(this, pos, 0.02f, 1); } } #endif if (walkRunAssoc && walkRunAssocBlend > 0.5f && idleAssocBlend < 1.0f) { float stepStart = 1 / 15.0f; float stepEnd = walkRunAssoc->hierarchy->totalLength / 2.0f + stepStart; float currentTime = walkRunAssoc->currentTime; int stepPart = 0; if (currentTime >= stepStart && currentTime - walkRunAssoc->timeStep < stepStart) stepPart = 1; else if (currentTime >= stepEnd && currentTime - walkRunAssoc->timeStep < stepEnd) stepPart = 2; if (stepPart != 0) { DMAudio.PlayOneShot(m_audioEntityId, stepPart == 1 ? SOUND_STEP_START : SOUND_STEP_END, 1.0f); CVector footPos(0.0f, 0.0f, 0.0f); TransformToNode(footPos, stepPart == 1 ? PED_FOOTL : PED_FOOTR); CVector forward = GetForward(); footPos.z -= 0.1f; footPos += 0.2f * forward; if (bDoBloodyFootprints) { CVector2D top(forward * 0.26f); CVector2D right(GetRight() * 0.14f); CShadows::AddPermanentShadow(SHADOWTYPE_DARK, gpBloodPoolTex, &footPos, top.x, top.y, right.x, right.y, 255, 255, 0, 0, 4.0f, 3000.0f, 1.0f); if (m_bloodyFootprintCountOrDeathTime <= 20) { m_bloodyFootprintCountOrDeathTime = 0; bDoBloodyFootprints = false; } else { m_bloodyFootprintCountOrDeathTime -= 20; } } if (CWeather::Rain <= 0.1f || CCullZones::CamNoRain() || CCullZones::PlayerNoRain()) { if(IsPlayer()) particleProduceFootDust(this, footPos, 0.0f, 4); } #ifdef PC_PARTICLE else if(stepPart == 2) #else else #endif { particleProduceFootSplash(this, footPos, 0.15f, 4); } } } if (m_nSurfaceTouched == SURFACE_WATER) { float pedSpeed = CVector2D(m_vecMoveSpeed).Magnitude(); if (pedSpeed > 0.03f && CTimer::GetFrameCounter() % 2 == 0 && pedSpeed > 0.13f) { #ifdef PC_PARTICLE float particleSize = pedSpeed * 2.0f; if (particleSize < 0.25f) particleSize = 0.25f; if (particleSize > 0.75f) particleSize = 0.75f; CVector particlePos = GetPosition() + GetForward() * 0.3f; particlePos.z -= 1.2f; CVector particleDir = m_vecMoveSpeed * -0.75f; particleDir.z = CGeneral::GetRandomNumberInRange(0.01f, 0.03f); CParticle::AddParticle(PARTICLE_PED_SPLASH, particlePos, particleDir, nil, 0.8f * particleSize, CRGBA(155,155,185,128), 0, 0, 0, 0); particleDir.z = CGeneral::GetRandomNumberInRange(0.03f, 0.05f); CParticle::AddParticle(PARTICLE_RUBBER_SMOKE, particlePos, particleDir, nil, particleSize, CRGBA(255,255,255,255), 0, 0, 0, 0); #else CVector particlePos = (GetPosition() - 0.3f * GetUp()) + GetForward()*0.3f; CVector particleDir = m_vecMoveSpeed * 0.45f; particleDir.z = CGeneral::GetRandomNumberInRange(0.03f, 0.05f); CParticle::AddParticle(PARTICLE_PED_SPLASH, particlePos-CVector(0.0f, 0.0f, 1.2f), particleDir, nil, 0.0f, CRGBA(155, 185, 155, 255)); #endif } } } // Actually GetLocalDirectionTo(Turn/Look) int CPed::GetLocalDirection(const CVector2D &posOffset) { int direction; float angle; for (angle = posOffset.Heading() - m_fRotationCur + DEGTORAD(45.0f); angle < 0.0f; angle += TWOPI); for (direction = RADTODEG(angle)/90.0f; direction > 3; direction -= 4); // 0-forward, 1-left, 2-backward, 3-right. return direction; } #ifdef NEW_WALK_AROUND_ALGORITHM CVector LocalPosForWalkAround(CVector2D colMin, CVector2D colMax, int walkAround, uint32 enterDoorNode, bool itsVan) { switch (walkAround) { case 0: if (enterDoorNode == CAR_DOOR_LF) return CVector(colMin.x, colMax.y - 1.0f, 0.0f); case 1: return CVector(colMin.x, colMax.y, 0.0f); case 2: case 3: if (walkAround == 3 && enterDoorNode == CAR_DOOR_RF) return CVector(colMax.x, colMax.y - 1.0f, 0.0f); return CVector(colMax.x, colMax.y, 0.0f); case 4: if (enterDoorNode == CAR_DOOR_RR && !itsVan) return CVector(colMax.x, colMin.y + 1.0f, 0.0f); case 5: return CVector(colMax.x, colMin.y, 0.0f); case 6: case 7: if (walkAround == 7 && enterDoorNode == CAR_DOOR_LR && !itsVan) return CVector(colMin.x, colMin.y + 1.0f, 0.0f); return CVector(colMin.x, colMin.y, 0.0f); default: return CVector(0.0f, 0.0f, 0.0f); } } bool CanWeSeeTheCorner(CVector2D dist, CVector2D fwdOffset) { // because fov isn't important if dist is more then 5 unit, we want shortest way if (dist.Magnitude() > 5.0f) return true; if (DotProduct2D(dist, fwdOffset) < 0.0f) return false; return true; } #endif // This function looks completely same on VC. void CPed::SetDirectionToWalkAroundObject(CEntity *obj) { float distLimitForTimer = 8.0f; CColModel *objCol = CModelInfo::GetModelInfo(obj->GetModelIndex())->GetColModel(); CVector objColMin = objCol->boundingBox.min; CVector objColMax = objCol->boundingBox.max; CVector objColCenter = (objColMin + objColMax) / 2.0f; CMatrix objMat(obj->GetMatrix()); float dirToSet = obj->GetForward().Heading(); bool goingToEnterCarAndItsVan = false; bool goingToEnterCar = false; bool objUpsideDown = false; float checkIntervalInDist = (objColMax.y - objColMin.y) * 0.1f; float checkIntervalInTime; if (m_nMoveState == PEDMOVE_NONE || m_nMoveState == PEDMOVE_STILL) return; #ifndef PEDS_REPORT_CRIMES_ON_PHONE if (CharCreatedBy != MISSION_CHAR && obj->GetModelIndex() == MI_PHONEBOOTH1) { bool isRunning = m_nMoveState == PEDMOVE_RUN || m_nMoveState == PEDMOVE_SPRINT; SetFindPathAndFlee(obj, 5000, !isRunning); return; } #endif CVector2D adjustedColMin(objColMin.x - 0.35f, objColMin.y - 0.35f); CVector2D adjustedColMax(objColMax.x + 0.35f, objColMax.y + 0.35f); checkIntervalInDist = Max(checkIntervalInDist, 0.5f); checkIntervalInDist = Min(checkIntervalInDist, (objColMax.z - objColMin.z) / 2.0f); checkIntervalInDist = Min(checkIntervalInDist, (adjustedColMax.x - adjustedColMin.x) / 2.0f); if (objMat.GetUp().z < 0.0f) objUpsideDown = true; if (obj->GetModelIndex() != MI_TRAFFICLIGHTS && obj->GetModelIndex() != MI_SINGLESTREETLIGHTS1 && obj->GetModelIndex() != MI_SINGLESTREETLIGHTS2) { objColCenter = obj->GetMatrix() * objColCenter; } else { checkIntervalInDist = 0.4f; if (objMat.GetUp().z <= 0.57f) { // Specific calculations for traffic lights, didn't get a bit. adjustedColMin.x = 1.2f * (adjustedColMin.x < adjustedColMin.y ? adjustedColMin.x : adjustedColMin.y); adjustedColMax.x = 1.2f * (adjustedColMax.x > adjustedColMax.y ? adjustedColMax.x : adjustedColMax.y); adjustedColMin.y = 1.2f * objColMin.z; adjustedColMax.y = 1.2f * objColMax.z; dirToSet = objMat.GetUp().Heading(); objMat.SetUnity(); objMat.RotateZ(dirToSet); objMat.GetPosition() += obj->GetPosition(); objColCenter = obj->GetPosition(); } else { objColCenter.x = adjustedColMax.x - 0.25f; objColCenter = obj->GetMatrix() * objColCenter; distLimitForTimer = 0.75f; } objUpsideDown = false; } float oldRotDest = m_fRotationDest; #ifndef NEW_WALK_AROUND_ALGORITHM float angleToFaceObjCenter = (objColCenter - GetPosition()).Heading(); float angleDiffBtwObjCenterAndForward = CGeneral::LimitRadianAngle(dirToSet - angleToFaceObjCenter); float objTopRightHeading = Atan2(adjustedColMax.x - adjustedColMin.x, adjustedColMax.y - adjustedColMin.y); #endif if (IsPlayer()) { if (FindPlayerPed()->m_fMoveSpeed <= 0.0f) checkIntervalInTime = 0.0f; else checkIntervalInTime = 2.0f / FindPlayerPed()->m_fMoveSpeed; } else { switch (m_nMoveState) { case PEDMOVE_WALK: checkIntervalInTime = 2.0f; break; case PEDMOVE_RUN: checkIntervalInTime = 0.5f; break; case PEDMOVE_SPRINT: checkIntervalInTime = 0.5f; break; default: checkIntervalInTime = 0.0f; break; } } if (m_pSeekTarget == obj && obj->IsVehicle()) { if (m_objective == OBJECTIVE_ENTER_CAR_AS_DRIVER || m_objective == OBJECTIVE_ENTER_CAR_AS_PASSENGER || m_objective == OBJECTIVE_SOLICIT_VEHICLE) { goingToEnterCar = true; if (IsPlayer()) checkIntervalInTime = 0.0f; if (((CVehicle*)obj)->bIsVan) goingToEnterCarAndItsVan = true; } } int entityOnTopLeftOfObj = 0; int entityOnBottomLeftOfObj = 0; int entityOnTopRightOfObj = 0; int entityOnBottomRightOfObj = 0; if (CTimer::GetTimeInMilliseconds() > m_collidingThingTimer || m_collidingEntityWhileFleeing != obj) { bool collidingThingChanged = true; CEntity *obstacle; #ifndef NEW_WALK_AROUND_ALGORITHM if (!obj->IsVehicle() || objUpsideDown) { collidingThingChanged = false; } else { #else CVector cornerToGo = CVector(10.0f, 10.0f, 10.0f); int dirToGo; m_walkAroundType = 0; int iWouldPreferGoingBack = 0; // 1:left 2:right #endif float adjustedCheckInterval = 0.7f * checkIntervalInDist; CVector posToCheck; // Top left of obj posToCheck.x = adjustedColMin.x + adjustedCheckInterval; posToCheck.y = adjustedColMax.y - adjustedCheckInterval; posToCheck.z = 0.0f; posToCheck = objMat * posToCheck; posToCheck.z += 0.6f; obstacle = CWorld::TestSphereAgainstWorld(posToCheck, checkIntervalInDist, obj, true, true, false, true, false, false); if (obstacle) { if (obstacle->IsBuilding()) { entityOnTopLeftOfObj = 1; } else if (obstacle->IsVehicle()) { entityOnTopLeftOfObj = 2; } else { entityOnTopLeftOfObj = 3; } } #ifdef NEW_WALK_AROUND_ALGORITHM else { CVector tl = obj->GetMatrix() * CVector(adjustedColMin.x, adjustedColMax.y, 0.0f) - GetPosition(); if (goingToEnterCar && (m_vehDoor == CAR_DOOR_LF || m_vehDoor == CAR_DOOR_LR)) { cornerToGo = tl; m_walkAroundType = 1; if (m_vehDoor == CAR_DOOR_LR) iWouldPreferGoingBack = 1; } else if(CanWeSeeTheCorner(tl, GetForward())){ cornerToGo = tl; dirToGo = GetLocalDirection(tl); if (dirToGo == 1) m_walkAroundType = 0; // ALL of the next turns will be right turn else if (dirToGo == 3) m_walkAroundType = 1; // ALL of the next turns will be left turn } } #endif // Top right of obj posToCheck.x = adjustedColMax.x - adjustedCheckInterval; posToCheck.y = adjustedColMax.y - adjustedCheckInterval; posToCheck.z = 0.0f; posToCheck = objMat * posToCheck; posToCheck.z += 0.6f; obstacle = CWorld::TestSphereAgainstWorld(posToCheck, checkIntervalInDist, obj, true, true, false, true, false, false); if (obstacle) { if (obstacle->IsBuilding()) { entityOnTopRightOfObj = 1; } else if (obstacle->IsVehicle()) { entityOnTopRightOfObj = 2; } else { entityOnTopRightOfObj = 3; } } #ifdef NEW_WALK_AROUND_ALGORITHM else { CVector tr = obj->GetMatrix() * CVector(adjustedColMax.x, adjustedColMax.y, 0.0f) - GetPosition(); if (tr.Magnitude2D() < cornerToGo.Magnitude2D()) { if (goingToEnterCar && (m_vehDoor == CAR_DOOR_RF || m_vehDoor == CAR_DOOR_RR)) { cornerToGo = tr; m_walkAroundType = 2; if (m_vehDoor == CAR_DOOR_RR) iWouldPreferGoingBack = 2; } else if (CanWeSeeTheCorner(tr, GetForward())) { cornerToGo = tr; dirToGo = GetLocalDirection(tr); if (dirToGo == 1) m_walkAroundType = 2; // ALL of the next turns will be right turn else if (dirToGo == 3) m_walkAroundType = 3; // ALL of the next turns will be left turn } } } #endif // Bottom right of obj posToCheck.x = adjustedColMax.x - adjustedCheckInterval; posToCheck.y = adjustedColMin.y + adjustedCheckInterval; posToCheck.z = 0.0f; posToCheck = objMat * posToCheck; posToCheck.z += 0.6f; obstacle = CWorld::TestSphereAgainstWorld(posToCheck, checkIntervalInDist, obj, true, true, false, true, false, false); if (obstacle) { if (obstacle->IsBuilding()) { entityOnBottomRightOfObj = 1; } else if (obstacle->IsVehicle()) { entityOnBottomRightOfObj = 2; } else { entityOnBottomRightOfObj = 3; } } #ifdef NEW_WALK_AROUND_ALGORITHM else { CVector br = obj->GetMatrix() * CVector(adjustedColMax.x, adjustedColMin.y, 0.0f) - GetPosition(); if (iWouldPreferGoingBack == 2) m_walkAroundType = 4; else if (br.Magnitude2D() < cornerToGo.Magnitude2D()) { if (goingToEnterCar && (m_vehDoor == CAR_DOOR_RF || m_vehDoor == CAR_DOOR_RR)) { cornerToGo = br; m_walkAroundType = 5; } else if (CanWeSeeTheCorner(br, GetForward())) { cornerToGo = br; dirToGo = GetLocalDirection(br); if (dirToGo == 1) m_walkAroundType = 4; // ALL of the next turns will be right turn else if (dirToGo == 3) m_walkAroundType = 5; // ALL of the next turns will be left turn } } } #endif // Bottom left of obj posToCheck.x = adjustedColMin.x + adjustedCheckInterval; posToCheck.y = adjustedColMin.y + adjustedCheckInterval; posToCheck.z = 0.0f; posToCheck = objMat * posToCheck; posToCheck.z += 0.6f; obstacle = CWorld::TestSphereAgainstWorld(posToCheck, checkIntervalInDist, obj, true, true, false, true, false, false); if (obstacle) { if (obstacle->IsBuilding()) { entityOnBottomLeftOfObj = 1; } else if (obstacle->IsVehicle()) { entityOnBottomLeftOfObj = 2; } else { entityOnBottomLeftOfObj = 3; } } #ifdef NEW_WALK_AROUND_ALGORITHM else { CVector bl = obj->GetMatrix() * CVector(adjustedColMin.x, adjustedColMin.y, 0.0f) - GetPosition(); if (iWouldPreferGoingBack == 1) m_walkAroundType = 7; else if (bl.Magnitude2D() < cornerToGo.Magnitude2D()) { if (goingToEnterCar && (m_vehDoor == CAR_DOOR_LF || m_vehDoor == CAR_DOOR_LR)) { cornerToGo = bl; m_walkAroundType = 6; } else if (CanWeSeeTheCorner(bl, GetForward())) { cornerToGo = bl; dirToGo = GetLocalDirection(bl); if (dirToGo == 1) m_walkAroundType = 6; // ALL of the next turns will be right turn else if (dirToGo == 3) m_walkAroundType = 7; // ALL of the next turns will be left turn } } } #else } if (entityOnTopLeftOfObj && entityOnTopRightOfObj && entityOnBottomRightOfObj && entityOnBottomLeftOfObj) { collidingThingChanged = false; entityOnTopLeftOfObj = 0; entityOnBottomLeftOfObj = 0; entityOnTopRightOfObj = 0; entityOnBottomRightOfObj = 0; } if (!collidingThingChanged) { m_walkAroundType = 0; } else { if (Abs(angleDiffBtwObjCenterAndForward) >= objTopRightHeading) { if (PI - objTopRightHeading >= Abs(angleDiffBtwObjCenterAndForward)) { if ((angleDiffBtwObjCenterAndForward <= 0.0f || objUpsideDown) && (angleDiffBtwObjCenterAndForward < 0.0f || !objUpsideDown)) { if (goingToEnterCar && (m_vehDoor == CAR_DOOR_RF || m_vehDoor == CAR_DOOR_RR)) { m_walkAroundType = 0; } else { if (CGeneral::LimitRadianAngle(m_fRotationDest - angleToFaceObjCenter) >= 0.0f) { if (entityOnBottomRightOfObj == 1 || entityOnBottomRightOfObj && !entityOnTopLeftOfObj && !entityOnTopRightOfObj) { m_walkAroundType = 1; } else if (entityOnBottomLeftOfObj == 1 || entityOnBottomLeftOfObj && !entityOnTopLeftOfObj && !entityOnTopRightOfObj) { m_walkAroundType = 1; } } else { if (entityOnTopRightOfObj == 1 || entityOnTopRightOfObj && !entityOnBottomRightOfObj && !entityOnBottomLeftOfObj) { m_walkAroundType = 4; } else if (entityOnTopLeftOfObj == 1 || entityOnTopLeftOfObj && !entityOnBottomRightOfObj && !entityOnBottomLeftOfObj) { m_walkAroundType = 4; } } } } else { if (goingToEnterCar && (m_vehDoor == CAR_DOOR_LF || m_vehDoor == CAR_DOOR_LR)) { m_walkAroundType = 0; } else { if (CGeneral::LimitRadianAngle(m_fRotationDest - angleToFaceObjCenter) <= 0.0f) { if (entityOnBottomLeftOfObj == 1 || entityOnBottomLeftOfObj && !entityOnTopLeftOfObj && !entityOnTopRightOfObj) { m_walkAroundType = 2; } else if (entityOnBottomRightOfObj == 1 || entityOnBottomRightOfObj && !entityOnTopLeftOfObj && !entityOnTopRightOfObj) { m_walkAroundType = 2; } } else { if (entityOnTopLeftOfObj == 1 || entityOnTopLeftOfObj && !entityOnBottomRightOfObj && !entityOnBottomLeftOfObj) { m_walkAroundType = 3; } else if (entityOnTopRightOfObj == 1 || entityOnTopRightOfObj && !entityOnBottomRightOfObj && !entityOnBottomLeftOfObj) { m_walkAroundType = 3; } } } } } else if (goingToEnterCar && (m_vehDoor == CAR_DOOR_LF || m_vehDoor == CAR_DOOR_LR) || CGeneral::LimitRadianAngle(m_fRotationDest - angleToFaceObjCenter) < 0.0f) { if (entityOnTopLeftOfObj == 1 || entityOnTopLeftOfObj && !entityOnTopRightOfObj && !entityOnBottomRightOfObj) { m_walkAroundType = 3; } } else if (entityOnTopRightOfObj == 1 || entityOnTopRightOfObj && !entityOnTopLeftOfObj && !entityOnBottomLeftOfObj) { m_walkAroundType = 4; } } else if (goingToEnterCar && (m_vehDoor == CAR_DOOR_LF || m_vehDoor == CAR_DOOR_LR) || CGeneral::LimitRadianAngle(m_fRotationDest - angleToFaceObjCenter) > 0.0f) { if (entityOnBottomLeftOfObj == 1 || entityOnBottomLeftOfObj && !entityOnTopRightOfObj && !entityOnBottomRightOfObj) { m_walkAroundType = 2; } } else if (entityOnBottomRightOfObj == 1 || entityOnBottomRightOfObj && !entityOnTopLeftOfObj && !entityOnBottomLeftOfObj) { m_walkAroundType = 1; } else { m_walkAroundType = 0; } } #endif } m_collidingEntityWhileFleeing = obj; m_collidingEntityWhileFleeing->RegisterReference((CEntity**) &m_collidingEntityWhileFleeing); // TODO: This random may need to be changed. m_collidingThingTimer = CTimer::GetTimeInMilliseconds() + 512 + CGeneral::GetRandomNumber(); CVector localPosToHead; #ifdef NEW_WALK_AROUND_ALGORITHM int nextWalkAround = m_walkAroundType; if (m_walkAroundType % 2 == 0) { nextWalkAround += 2; if (nextWalkAround > 6) nextWalkAround = 0; } else { nextWalkAround -= 2; if (nextWalkAround < 0) nextWalkAround = 7; } CVector nextPosToHead = objMat * LocalPosForWalkAround(adjustedColMin, adjustedColMax, nextWalkAround, goingToEnterCar ? m_vehDoor : 0, goingToEnterCarAndItsVan); bool nextRouteIsClear = CWorld::GetIsLineOfSightClear(GetPosition(), nextPosToHead, true, true, true, true, true, true, false); if(nextRouteIsClear) m_walkAroundType = nextWalkAround; else { CVector posToHead = objMat * LocalPosForWalkAround(adjustedColMin, adjustedColMax, m_walkAroundType, goingToEnterCar ? m_vehDoor : 0, goingToEnterCarAndItsVan); bool currentRouteIsClear = CWorld::GetIsLineOfSightClear(GetPosition(), posToHead, true, true, true, true, true, true, false); /* Either; * - Some obstacle came in and it's impossible to reach current destination * - We reached to the destination, but since next route is not clear, we're turning around us */ if (!currentRouteIsClear || ((posToHead - GetPosition()).Magnitude2D() < 0.8f && !CWorld::GetIsLineOfSightClear(GetPosition() + GetForward(), nextPosToHead, true, true, true, true, true, true, false))) { // Change both target and direction (involves changing even/oddness) if (m_walkAroundType % 2 == 0) { m_walkAroundType -= 2; if (m_walkAroundType < 0) m_walkAroundType = 7; else m_walkAroundType += 1; } else { m_walkAroundType += 2; if (m_walkAroundType > 7) m_walkAroundType = 0; else m_walkAroundType -= 1; } } } localPosToHead = LocalPosForWalkAround(adjustedColMin, adjustedColMax, m_walkAroundType, goingToEnterCar ? m_vehDoor : 0, goingToEnterCarAndItsVan); #else if (Abs(angleDiffBtwObjCenterAndForward) < objTopRightHeading) { if (goingToEnterCar) { if (goingToEnterCarAndItsVan) { if (m_vehDoor == CAR_DOOR_LR || m_vehDoor == CAR_DOOR_RR) return; } if (m_vehDoor != CAR_DOOR_LF && m_vehDoor != CAR_DOOR_LR && (!entityOnBottomRightOfObj || entityOnBottomLeftOfObj)) { m_fRotationDest = CGeneral::LimitRadianAngle(dirToSet - HALFPI); localPosToHead.x = adjustedColMax.x; localPosToHead.z = 0.0f; localPosToHead.y = adjustedColMin.y; } else { m_fRotationDest = CGeneral::LimitRadianAngle(HALFPI + dirToSet); localPosToHead.x = adjustedColMin.x; localPosToHead.z = 0.0f; localPosToHead.y = adjustedColMin.y; } } else { if (m_walkAroundType != 1 && m_walkAroundType != 4 && (m_walkAroundType || CGeneral::LimitRadianAngle(m_fRotationDest - angleToFaceObjCenter) <= 0.0f)) { m_fRotationDest = CGeneral::LimitRadianAngle(dirToSet - HALFPI); localPosToHead.x = adjustedColMax.x; localPosToHead.z = 0.0f; localPosToHead.y = adjustedColMin.y; } else { m_fRotationDest = CGeneral::LimitRadianAngle(HALFPI + dirToSet); localPosToHead.x = adjustedColMin.x; localPosToHead.z = 0.0f; localPosToHead.y = adjustedColMin.y; } } } else { if (PI - objTopRightHeading >= Abs(angleDiffBtwObjCenterAndForward)) { if (angleDiffBtwObjCenterAndForward <= 0.0f) { if (!goingToEnterCar || !goingToEnterCarAndItsVan || m_vehDoor != CAR_DOOR_LR && m_vehDoor != CAR_DOOR_RR) { if (goingToEnterCar) { if (m_vehDoor == CAR_DOOR_RF || (m_vehDoor == CAR_DOOR_RR && !goingToEnterCarAndItsVan)) return; } if (m_walkAroundType == 4 || m_walkAroundType == 3 || !m_walkAroundType && CGeneral::LimitRadianAngle(m_fRotationDest - angleToFaceObjCenter) > 0.0f) { m_fRotationDest = CGeneral::LimitRadianAngle(PI + dirToSet); localPosToHead.x = adjustedColMax.x; localPosToHead.z = 0.0f; localPosToHead.y = adjustedColMin.y; } else { m_fRotationDest = dirToSet; localPosToHead.x = adjustedColMax.x; localPosToHead.z = 0.0f; localPosToHead.y = adjustedColMax.y; } } else { m_fRotationDest = CGeneral::LimitRadianAngle(PI + dirToSet); localPosToHead.x = adjustedColMax.x; localPosToHead.z = 0.0f; localPosToHead.y = adjustedColMin.y; } } else if (goingToEnterCar && goingToEnterCarAndItsVan && (m_vehDoor == CAR_DOOR_LR || m_vehDoor == CAR_DOOR_RR)) { m_fRotationDest = CGeneral::LimitRadianAngle(PI + dirToSet); localPosToHead.x = adjustedColMin.x; localPosToHead.z = 0.0f; localPosToHead.y = adjustedColMin.y; } else { if (goingToEnterCar) { if (m_vehDoor == CAR_DOOR_LF || m_vehDoor == CAR_DOOR_LR && !goingToEnterCarAndItsVan) return; } if (m_walkAroundType == 1 || m_walkAroundType == 2 || !m_walkAroundType && CGeneral::LimitRadianAngle(m_fRotationDest - angleToFaceObjCenter) > 0.0f) { m_fRotationDest = dirToSet; localPosToHead.x = adjustedColMin.x; localPosToHead.z = 0.0f; localPosToHead.y = adjustedColMax.y; } else { m_fRotationDest = CGeneral::LimitRadianAngle(PI + dirToSet); localPosToHead.x = adjustedColMin.x; localPosToHead.z = 0.0f; localPosToHead.y = adjustedColMin.y; } } } else { if (goingToEnterCar && (!goingToEnterCarAndItsVan || m_vehDoor != CAR_DOOR_LR && m_vehDoor != CAR_DOOR_RR)) { if (m_vehDoor != CAR_DOOR_LF && m_vehDoor != CAR_DOOR_LR && (!entityOnTopRightOfObj || entityOnTopLeftOfObj)) { m_fRotationDest = CGeneral::LimitRadianAngle(dirToSet - HALFPI); localPosToHead.x = adjustedColMax.x; localPosToHead.z = 0.0f; localPosToHead.y = adjustedColMax.y; } else { m_fRotationDest = CGeneral::LimitRadianAngle(HALFPI + dirToSet); localPosToHead.x = adjustedColMin.x; localPosToHead.z = 0.0f; localPosToHead.y = adjustedColMax.y; } } else { if (m_walkAroundType == 2 || m_walkAroundType == 3 || !m_walkAroundType && CGeneral::LimitRadianAngle(m_fRotationDest - angleToFaceObjCenter) > 0.0f) { m_fRotationDest = CGeneral::LimitRadianAngle(dirToSet - HALFPI); localPosToHead.x = adjustedColMax.x; localPosToHead.z = 0.0f; localPosToHead.y = adjustedColMax.y; } else { m_fRotationDest = CGeneral::LimitRadianAngle(HALFPI + dirToSet); localPosToHead.x = adjustedColMin.x; localPosToHead.z = 0.0f; localPosToHead.y = adjustedColMax.y; } } } } #endif if (objUpsideDown) localPosToHead.x = localPosToHead.x * -1.0f; localPosToHead = objMat * localPosToHead; m_actionX = localPosToHead.x; m_actionY = localPosToHead.y; localPosToHead -= GetPosition(); m_fRotationDest = CGeneral::LimitRadianAngle(localPosToHead.Heading()); if (m_fRotationDest != m_fRotationCur && bHitSomethingLastFrame) { if (m_fRotationDest == oldRotDest) { m_fRotationDest = oldRotDest; } else { m_fRotationDest = CGeneral::LimitRadianAngle(PI + dirToSet); } } float dist = localPosToHead.Magnitude2D(); if (dist < 0.5f) dist = 0.5f; if (dist > distLimitForTimer) dist = distLimitForTimer; m_nPedStateTimer = CTimer::GetTimeInMilliseconds() + 280.0f * dist * checkIntervalInTime; } bool CPed::IsPedInControl(void) { return m_nPedState <= PED_STATES_NO_AI && !bIsInTheAir && !bIsLanding && m_fHealth > 0.0f; } bool CPed::IsPedShootable(void) { return m_nPedState <= PED_STATES_NO_ST; } bool CPed::UseGroundColModel(void) { return m_nPedState == PED_FALL || m_nPedState == PED_DIVE_AWAY || m_nPedState == PED_DIE || m_nPedState == PED_DEAD; } bool CPed::CanPedReturnToState(void) { return m_nPedState <= PED_STATES_NO_AI && m_nPedState != PED_AIM_GUN && m_nPedState != PED_ATTACK && m_nPedState != PED_FIGHT && m_nPedState != PED_STEP_AWAY && m_nPedState != PED_SNIPER_MODE && m_nPedState != PED_LOOK_ENTITY; } bool CPed::CanSetPedState(void) { return !DyingOrDead() && m_nPedState != PED_ARRESTED && !EnteringCar() && m_nPedState != PED_STEAL_CAR; } bool CPed::CanStrafeOrMouseControl(void) { #ifdef FREE_CAM if (CCamera::bFreeCam) return false; #endif return m_nPedState == PED_NONE || m_nPedState == PED_IDLE || m_nPedState == PED_FLEE_POS || m_nPedState == PED_FLEE_ENTITY || m_nPedState == PED_ATTACK || m_nPedState == PED_FIGHT || m_nPedState == PED_AIM_GUN || m_nPedState == PED_JUMP; } void CPed::PedGetupCB(CAnimBlendAssociation* animAssoc, void* arg) { CPed* ped = (CPed*)arg; if (ped->m_nPedState == PED_GETUP) RpAnimBlendClumpSetBlendDeltas(ped->GetClump(), ASSOC_PARTIAL, -1000.0f); ped->bFallenDown = false; animAssoc->blendDelta = -1000.0f; if (ped->m_nPedState == PED_GETUP) ped->RestorePreviousState(); if (ped->m_nPedState != PED_FLEE_POS && ped->m_nPedState != PED_FLEE_ENTITY) ped->SetMoveState(PEDMOVE_STILL); else ped->SetMoveState(PEDMOVE_RUN); ped->SetMoveAnim(); ped->bGetUpAnimStarted = false; } void CPed::PedLandCB(CAnimBlendAssociation* animAssoc, void* arg) { CPed* ped = (CPed*)arg; animAssoc->blendDelta = -1000.0f; ped->bIsLanding = false; if (ped->m_nPedState == PED_JUMP) ped->RestorePreviousState(); } void CPed::PedStaggerCB(CAnimBlendAssociation* animAssoc, void* arg) { /* CPed *ped = (CPed*)arg; if (ped->m_nPedState == PED_STAGGER) // nothing */ } void CPed::PedSetOutCarCB(CAnimBlendAssociation *animAssoc, void *arg) { CPed *ped = (CPed*)arg; CVehicle *veh = ped->m_pMyVehicle; bool startedToRun = false; ped->bUsesCollision = true; ped->m_actionX = 0.0f; ped->m_actionY = 0.0f; ped->bVehExitWillBeInstant = false; if (veh && veh->IsBoat()) ped->ApplyMoveSpeed(); if (ped->m_objective == OBJECTIVE_LEAVE_CAR) ped->RestorePreviousObjective(); #ifdef VC_PED_PORTS else if (ped->m_objective == OBJECTIVE_LEAVE_CAR_AND_DIE) { ped->m_fHealth = 0.0f; ped->SetDie(ANIM_STD_HIT_FLOOR, 4.0f, 0.5f); } #endif ped->bInVehicle = false; if (veh && veh->IsCar() && !veh->IsRoomForPedToLeaveCar(ped->m_vehDoor, nil)) { ped->PositionPedOutOfCollision(); } if (ped->m_nPedState == PED_EXIT_CAR) { if (ped->m_nPedType == PEDTYPE_COP) ped->SetIdle(); else ped->RestorePreviousState(); veh = ped->m_pMyVehicle; if (ped->bFleeAfterExitingCar && veh) { ped->bFleeAfterExitingCar = false; ped->SetFlee(veh->GetPosition(), 12000); ped->bUsePedNodeSeek = true; ped->m_pNextPathNode = nil; if (CGeneral::GetRandomNumber() & 1 || ped->m_pedStats->m_fear > 70) { ped->SetMoveState(PEDMOVE_SPRINT); ped->Say(SOUND_PED_FLEE_SPRINT); } else { ped->SetMoveState(PEDMOVE_RUN); ped->Say(SOUND_PED_FLEE_RUN); } startedToRun = true; // This is not a good way to do this... ped->m_nLastPedState = PED_WANDER_PATH; } else if (ped->bWanderPathAfterExitingCar) { ped->SetWanderPath(CGeneral::GetRandomNumberInRange(0.0f, 8.0f)); ped->bWanderPathAfterExitingCar = false; if (ped->m_nPedType == PEDTYPE_PROSTITUTE) ped->SetObjectiveTimer(30000); ped->m_nLastPedState = PED_NONE; } else if (ped->bGonnaKillTheCarJacker) { // Kill objective is already given at this point. ped->bGonnaKillTheCarJacker = false; if (ped->m_pedInObjective) { if (!(CGeneral::GetRandomNumber() & 1) && ped->m_nPedType != PEDTYPE_COP && (!ped->m_pedInObjective->IsPlayer() || !CTheScripts::IsPlayerOnAMission())) { ped->ClearObjective(); ped->SetObjective(OBJECTIVE_ENTER_CAR_AS_DRIVER, veh); } ped->m_leaveCarTimer = CTimer::GetTimeInMilliseconds() + 1500; } int waitTime = 1500; ped->SetWaitState(WAITSTATE_PLAYANIM_COWER, &waitTime); ped->SetMoveState(PEDMOVE_RUN); startedToRun = true; } else if (ped->m_objective == OBJECTIVE_NONE && ped->CharCreatedBy != MISSION_CHAR && ped->m_nPedState == PED_IDLE && !ped->IsPlayer()) { ped->SetWanderPath(CGeneral::GetRandomNumberInRange(0.0f, 8.0f)); } } #ifdef VC_PED_PORTS else { ped->m_nPedState = PED_IDLE; } #endif if (animAssoc) animAssoc->blendDelta = -1000.0f; ped->RestartNonPartialAnims(); ped->m_pVehicleAnim = nil; CVector posFromZ = ped->GetPosition(); CPedPlacement::FindZCoorForPed(&posFromZ); ped->m_vecMoveSpeed = CVector(0.0f, 0.0f, 0.0f); ped->SetPosition(posFromZ); veh = ped->m_pMyVehicle; if (veh) { if (ped->m_nPedType == PEDTYPE_PROSTITUTE) { if (veh->pDriver) { if (veh->pDriver->IsPlayer() && ped->CharCreatedBy == RANDOM_CHAR) { CWorld::Players[CWorld::PlayerInFocus].m_nNextSexMoneyUpdateTime = 0; CWorld::Players[CWorld::PlayerInFocus].m_nNextSexFrequencyUpdateTime = 0; CWorld::Players[CWorld::PlayerInFocus].m_pHooker = nil; CWorld::Players[CWorld::PlayerInFocus].m_nMoney -= 100; if (CWorld::Players[CWorld::PlayerInFocus].m_nMoney < 0) CWorld::Players[CWorld::PlayerInFocus].m_nMoney = 0; } } } veh->m_nGettingOutFlags &= ~GetCarDoorFlag(ped->m_vehDoor); if (veh->pDriver == ped) { veh->RemoveDriver(); #ifndef FIX_BUGS // RemoveDriver does it anyway veh->SetStatus(STATUS_ABANDONED); #endif if (veh->m_nDoorLock == CARLOCK_LOCKED_INITIALLY) veh->m_nDoorLock = CARLOCK_UNLOCKED; if (ped->m_nPedType == PEDTYPE_COP && veh->IsLawEnforcementVehicle()) veh->ChangeLawEnforcerState(false); } else { veh->RemovePassenger(ped); } if (veh->bIsBus && !veh->IsUpsideDown() && !veh->IsOnItsSide()) { float angleAfterExit; if (ped->m_vehDoor == CAR_DOOR_LF) { angleAfterExit = HALFPI + veh->GetForward().Heading(); } else { angleAfterExit = veh->GetForward().Heading() - HALFPI; } ped->SetHeading(angleAfterExit); ped->m_fRotationDest = angleAfterExit; ped->m_fRotationCur = angleAfterExit; if (!ped->bBusJacked) ped->SetMoveState(PEDMOVE_WALK); } if (CGarages::IsPointWithinAnyGarage(ped->GetPosition())) veh->bLightsOn = false; } if (ped->IsPlayer()) AudioManager.PlayerJustLeftCar(); ped->ReplaceWeaponWhenExitingVehicle(); ped->bOnBoat = false; if (ped->bBusJacked) { ped->SetFall(1500, ANIM_STD_HIGHIMPACT_BACK, false); ped->bBusJacked = false; } ped->m_nStoredMoveState = PEDMOVE_NONE; if (!ped->IsPlayer()) { // It's a shame... #ifdef FIX_BUGS int createdBy = ped->CharCreatedBy; #else int createdBy = !ped->CharCreatedBy; #endif if (createdBy == MISSION_CHAR && !startedToRun) ped->SetMoveState(PEDMOVE_WALK); } } void CPed::PedSetDraggedOutCarCB(CAnimBlendAssociation *dragAssoc, void *arg) { CAnimBlendAssociation *quickJackedAssoc; CVehicle *vehicle; CPed *ped = (CPed*)arg; quickJackedAssoc = RpAnimBlendClumpGetAssociation(ped->GetClump(), ANIM_STD_QUICKJACKED); if (ped->m_nPedState != PED_ARRESTED) { ped->m_nLastPedState = PED_NONE; if (dragAssoc) dragAssoc->blendDelta = -1000.0f; } ped->RestartNonPartialAnims(); ped->m_pVehicleAnim = nil; ped->m_pSeekTarget = nil; vehicle = ped->m_pMyVehicle; if (vehicle) { vehicle->m_nGettingOutFlags &= ~GetCarDoorFlag(ped->m_vehDoor); if (vehicle->pDriver == ped) { vehicle->RemoveDriver(); if (vehicle->m_nDoorLock == CARLOCK_LOCKED_INITIALLY) vehicle->m_nDoorLock = CARLOCK_UNLOCKED; if (ped->m_nPedType == PEDTYPE_COP && vehicle->IsLawEnforcementVehicle()) vehicle->ChangeLawEnforcerState(false); } else { vehicle->RemovePassenger(ped); } } ped->bInVehicle = false; if (ped->IsPlayer()) AudioManager.PlayerJustLeftCar(); #ifdef VC_PED_PORTS if (ped->m_objective == OBJECTIVE_LEAVE_CAR_AND_DIE) { dragAssoc->SetDeleteCallback(PedSetDraggedOutCarPositionCB, ped); ped->m_fHealth = 0.0f; ped->SetDie(ANIM_STD_HIT_FLOOR, 1000.0f, 0.5f); return; } #endif if (quickJackedAssoc) { dragAssoc->SetDeleteCallback(PedSetQuickDraggedOutCarPositionCB, ped); } else { dragAssoc->SetDeleteCallback(PedSetDraggedOutCarPositionCB, ped); if (ped->CanSetPedState()) CAnimManager::BlendAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_STD_GET_UP, 1000.0f); } ped->ReplaceWeaponWhenExitingVehicle(); ped->m_nStoredMoveState = PEDMOVE_NONE; ped->bVehExitWillBeInstant = false; } void CPed::PedSetInCarCB(CAnimBlendAssociation *animAssoc, void *arg) { CPed *ped = (CPed*)arg; CVehicle *veh = ped->m_pMyVehicle; // Pointless code if (!veh) return; #ifdef VC_PED_PORTS // Situation of entering car as a driver while there is already a driver exiting atm. CPed *driver = veh->pDriver; if (driver && driver->m_nPedState == PED_DRIVING && !veh->bIsBus && driver->m_objective == OBJECTIVE_LEAVE_CAR && (ped->m_objective == OBJECTIVE_ENTER_CAR_AS_DRIVER || ped->m_nPedState == PED_CARJACK)) { if (!ped->IsPlayer() && (ped->CharCreatedBy != MISSION_CHAR || driver->IsPlayer())) { ped->QuitEnteringCar(); return; } if (driver->CharCreatedBy == MISSION_CHAR) { PedSetOutCarCB(nil, veh->pDriver); if (driver->m_pMyVehicle) { driver->PositionPedOutOfCollision(); } else { driver->m_pMyVehicle = veh; driver->PositionPedOutOfCollision(); driver->m_pMyVehicle = nil; } veh->pDriver = nil; } else { driver->SetDead(); driver->FlagToDestroyWhenNextProcessed(); veh->pDriver = nil; } } #endif if (!ped->IsNotInWreckedVehicle() || ped->DyingOrDead()) return; ped->bInVehicle = true; if (ped->m_nPedType == PEDTYPE_PROSTITUTE) { if (veh->pDriver) { if (veh->pDriver->IsPlayer() && ped->CharCreatedBy == RANDOM_CHAR) { CWorld::Players[CWorld::PlayerInFocus].m_nSexFrequency = 1000; CWorld::Players[CWorld::PlayerInFocus].m_nNextSexMoneyUpdateTime = CTimer::GetTimeInMilliseconds() + 1000; CWorld::Players[CWorld::PlayerInFocus].m_nNextSexFrequencyUpdateTime = CTimer::GetTimeInMilliseconds() + 3000; CWorld::Players[CWorld::PlayerInFocus].m_pHooker = (CCivilianPed*)ped; } } } if (ped->m_objective == OBJECTIVE_ENTER_CAR_AS_DRIVER #if defined VC_PED_PORTS || defined FIX_BUGS || ped->m_nPedState == PED_CARJACK #endif ) veh->bIsBeingCarJacked = false; if (veh->m_nNumGettingIn) --veh->m_nNumGettingIn; if (ped->IsPlayer() && ((CPlayerPed*)ped)->m_bAdrenalineActive) ((CPlayerPed*)ped)->ClearAdrenaline(); if (veh->IsBoat()) { if (ped->IsPlayer()) { #if defined VC_PED_PORTS || defined FIX_BUGS CCarCtrl::RegisterVehicleOfInterest(veh); #endif if (veh->GetStatus() == STATUS_SIMPLE) { veh->m_vecMoveSpeed = CVector(0.0f, 0.0f, -0.00001f); veh->m_vecTurnSpeed = CVector(0.0f, 0.0f, 0.0f); } veh->SetStatus(STATUS_PLAYER); AudioManager.PlayerJustGotInCar(); } veh->SetDriver(ped); if (!veh->bEngineOn) veh->bEngineOn = true; ped->SetPedState(PED_DRIVING); ped->StopNonPartialAnims(); return; } if (ped->m_pVehicleAnim) ped->m_pVehicleAnim->blendDelta = -1000.0f; ped->bDoBloodyFootprints = false; if (veh->m_nAlarmState == -1) veh->m_nAlarmState = 15000; if (ped->IsPlayer()) { if (ped->m_objective == OBJECTIVE_ENTER_CAR_AS_DRIVER) { if (veh->GetStatus() == STATUS_SIMPLE) { veh->m_vecMoveSpeed = CVector(0.0f, 0.0f, 0.0f); veh->m_vecTurnSpeed = CVector(0.0f, 0.0f, 0.0f); } veh->SetStatus(STATUS_PLAYER); } AudioManager.PlayerJustGotInCar(); } else if (ped->m_objective == OBJECTIVE_ENTER_CAR_AS_DRIVER) { if (veh->GetStatus() == STATUS_SIMPLE) { veh->m_vecMoveSpeed = CVector(0.0f, 0.0f, 0.0f); veh->m_vecTurnSpeed = CVector(0.0f, 0.0f, 0.0f); } veh->SetStatus(STATUS_PHYSICS); } if (ped->m_objective == OBJECTIVE_ENTER_CAR_AS_DRIVER) { for (int i = 0; i < veh->m_nNumMaxPassengers; ++i) { CPed *passenger = veh->pPassengers[i]; if (passenger && passenger->CharCreatedBy == RANDOM_CHAR) { passenger->SetObjective(OBJECTIVE_LEAVE_CAR, veh); #ifdef VC_PED_PORTS passenger->m_leaveCarTimer = CTimer::GetTimeInMilliseconds(); #endif } } } // This shouldn't happen at all. Passengers can't enter with PED_CARJACK. Even though they did, we shouldn't call AddPassenger in here and SetDriver in below. #if !defined VC_PED_PORTS && !defined FIX_BUGS else if (ped->m_objective == OBJECTIVE_ENTER_CAR_AS_PASSENGER) { if (ped->m_nPedState == PED_CARJACK) { veh->AddPassenger(ped, 0); ped->SetPedState(PED_DRIVING); ped->RestorePreviousObjective(); ped->SetObjective(OBJECTIVE_LEAVE_CAR, veh); } else if (veh->pDriver && ped->CharCreatedBy == RANDOM_CHAR) { veh->AutoPilot.m_nCruiseSpeed = 17; } } #endif if (ped->m_objective == OBJECTIVE_ENTER_CAR_AS_DRIVER || ped->m_nPedState == PED_CARJACK) { veh->SetDriver(ped); if (veh->VehicleCreatedBy == PARKED_VEHICLE) { veh->VehicleCreatedBy = RANDOM_VEHICLE; ++CCarCtrl::NumRandomCars; --CCarCtrl::NumParkedCars; } if (veh->bIsAmbulanceOnDuty) { veh->bIsAmbulanceOnDuty = false; --CCarCtrl::NumAmbulancesOnDuty; } if (veh->bIsFireTruckOnDuty) { veh->bIsFireTruckOnDuty = false; --CCarCtrl::NumFiretrucksOnDuty; } if (ped->m_nPedType == PEDTYPE_COP && veh->IsLawEnforcementVehicle()) veh->ChangeLawEnforcerState(true); if (!veh->bEngineOn) { veh->bEngineOn = true; DMAudio.PlayOneShot(ped->m_audioEntityId, SOUND_CAR_ENGINE_START, 1.0f); } if (ped->m_objective == OBJECTIVE_ENTER_CAR_AS_DRIVER && ped->CharCreatedBy == RANDOM_CHAR && ped != FindPlayerPed() && ped->m_nPedType != PEDTYPE_EMERGENCY) { CCarCtrl::JoinCarWithRoadSystem(veh); veh->AutoPilot.m_nCarMission = MISSION_CRUISE; veh->AutoPilot.m_nTempAction = TEMPACT_NONE; veh->AutoPilot.m_nDrivingStyle = DRIVINGSTYLE_AVOID_CARS; veh->AutoPilot.m_nCruiseSpeed = 25; } ped->SetPedState(PED_DRIVING); if (ped->m_objective == OBJECTIVE_ENTER_CAR_AS_DRIVER) { if (ped->m_prevObjective == OBJECTIVE_RUN_TO_AREA || ped->m_prevObjective == OBJECTIVE_GOTO_CHAR_ON_FOOT || ped->m_prevObjective == OBJECTIVE_KILL_CHAR_ON_FOOT) ped->m_prevObjective = OBJECTIVE_NONE; ped->RestorePreviousObjective(); } } else if (ped->m_objective == OBJECTIVE_ENTER_CAR_AS_PASSENGER) { if (veh->bIsBus) { veh->AddPassenger(ped); } else { switch (ped->m_vehDoor) { case CAR_DOOR_RF: veh->AddPassenger(ped, 0); break; case CAR_DOOR_RR: veh->AddPassenger(ped, 2); break; case CAR_DOOR_LR: veh->AddPassenger(ped, 1); break; default: veh->AddPassenger(ped); break; } } ped->SetPedState(PED_DRIVING); if (ped->m_prevObjective == OBJECTIVE_RUN_TO_AREA || ped->m_prevObjective == OBJECTIVE_GOTO_CHAR_ON_FOOT || ped->m_prevObjective == OBJECTIVE_KILL_CHAR_ON_FOOT) ped->m_prevObjective = OBJECTIVE_NONE; ped->RestorePreviousObjective(); #ifdef VC_PED_PORTS if(veh->pDriver && ped->CharCreatedBy == RANDOM_CHAR) veh->AutoPilot.m_nCruiseSpeed = 17; #endif } veh->m_nGettingInFlags &= ~GetCarDoorFlag(ped->m_vehDoor); if (veh->bIsBus && !veh->m_nGettingInFlags) ((CAutomobile*)veh)->SetBusDoorTimer(1000, 1); switch (ped->m_objective) { case OBJECTIVE_KILL_CHAR_ON_FOOT: case OBJECTIVE_KILL_CHAR_ANY_MEANS: case OBJECTIVE_LEAVE_CAR: case OBJECTIVE_FOLLOW_CAR_IN_CAR: case OBJECTIVE_GOTO_AREA_ANY_MEANS: case OBJECTIVE_GOTO_AREA_ON_FOOT: case OBJECTIVE_RUN_TO_AREA: break; default: ped->SetObjective(OBJECTIVE_NONE); } if (veh->pDriver == ped) { if (veh->bLowVehicle) { ped->m_pVehicleAnim = CAnimManager::BlendAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_STD_CAR_SIT_LO, 100.0f); } else { ped->m_pVehicleAnim = CAnimManager::BlendAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_STD_CAR_SIT, 100.0f); } } else if (veh->bLowVehicle) { ped->m_pVehicleAnim = CAnimManager::BlendAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_STD_CAR_SIT_P_LO, 100.0f); } else { ped->m_pVehicleAnim = CAnimManager::BlendAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_STD_CAR_SIT_P, 100.0f); } ped->StopNonPartialAnims(); if (veh->bIsBus) ped->bRenderPedInCar = false; // FIX: RegisterVehicleOfInterest not just registers the vehicle, but also updates register time. So remove the IsThisVehicleInteresting check. #ifndef FIX_BUGS if (ped->IsPlayer() && !CCarCtrl::IsThisVehicleInteresting(veh) && veh->VehicleCreatedBy != MISSION_VEHICLE) { #else if (ped->IsPlayer() && veh->VehicleCreatedBy != MISSION_VEHICLE) { #endif CCarCtrl::RegisterVehicleOfInterest(veh); if (!veh->bHasBeenOwnedByPlayer && veh->VehicleCreatedBy != MISSION_VEHICLE) CEventList::RegisterEvent(EVENT_STEAL_CAR, EVENT_ENTITY_VEHICLE, veh, ped, 1500); veh->bHasBeenOwnedByPlayer = true; } ped->bChangedSeat = true; } bool CPed::CanBeDeleted(void) { if (bInVehicle) return false; switch (CharCreatedBy) { case RANDOM_CHAR: return true; case MISSION_CHAR: return false; default: return true; } } void CPed::AddWeaponModel(int id) { RpAtomic *atm; if (id != -1) { #ifdef PED_SKIN if (IsClumpSkinned(GetClump())) { if (m_pWeaponModel) RemoveWeaponModel(-1); m_pWeaponModel = (RpAtomic*)CModelInfo::GetModelInfo(id)->CreateInstance(); } else #endif { atm = (RpAtomic*)CModelInfo::GetModelInfo(id)->CreateInstance(); RwFrameDestroy(RpAtomicGetFrame(atm)); RpAtomicSetFrame(atm, m_pFrames[PED_HANDR]->frame); RpClumpAddAtomic(GetClump(), atm); } m_wepModelID = id; } } static RwObject* RemoveAllModelCB(RwObject *object, void *data) { RpAtomic *atomic = (RpAtomic*)object; if (CVisibilityPlugins::GetAtomicModelInfo(atomic)) { RpClumpRemoveAtomic(RpAtomicGetClump(atomic), atomic); RpAtomicDestroy(atomic); } return object; } void CPed::RemoveWeaponModel(int modelId) { // modelId is not used!! This function just removes the current weapon. #ifdef PED_SKIN if(IsClumpSkinned(GetClump())){ if(m_pWeaponModel){ RwFrame *frm = RpAtomicGetFrame(m_pWeaponModel); RpAtomicDestroy(m_pWeaponModel); RwFrameDestroy(frm); m_pWeaponModel = nil; } }else #endif RwFrameForAllObjects(m_pFrames[PED_HANDR]->frame,RemoveAllModelCB,nil); m_wepModelID = -1; } uint32 CPed::GiveWeapon(eWeaponType weaponType, uint32 ammo) { CWeapon &weapon = GetWeapon(weaponType); if (HasWeapon(weaponType)) { if (weapon.m_nAmmoTotal + ammo > 99999) weapon.m_nAmmoTotal = 99999; else weapon.m_nAmmoTotal += ammo; weapon.Reload(); } else { weapon.Initialise(weaponType, ammo); // TODO: It seems game uses this as both weapon count and max WeaponType we have, which is ofcourse erroneous. m_maxWeaponTypeAllowed++; } if (weapon.m_eWeaponState == WEAPONSTATE_OUT_OF_AMMO) weapon.m_eWeaponState = WEAPONSTATE_READY; return weaponType; } // Some kind of VC leftover I think int CPed::GetWeaponSlot(eWeaponType weaponType) { if (HasWeapon(weaponType)) return weaponType; else return -1; } void CPed::SetCurrentWeapon(uint32 weaponType) { CWeaponInfo *weaponInfo; if (HasWeapon(weaponType)) { weaponInfo = CWeaponInfo::GetWeaponInfo(GetWeapon()->m_eWeaponType); RemoveWeaponModel(weaponInfo->m_nModelId); m_currentWeapon = weaponType; weaponInfo = CWeaponInfo::GetWeaponInfo(GetWeapon()->m_eWeaponType); AddWeaponModel(weaponInfo->m_nModelId); } } void CPed::GrantAmmo(eWeaponType weaponType, uint32 ammo) { if (HasWeapon(weaponType)) { GetWeapon(weaponType).m_nAmmoTotal += ammo; } else { GetWeapon(weaponType).Initialise(weaponType, ammo); m_maxWeaponTypeAllowed++; } } void CPed::SetAmmo(eWeaponType weaponType, uint32 ammo) { if (HasWeapon(weaponType)) { GetWeapon(weaponType).m_nAmmoTotal = ammo; } else { GetWeapon(weaponType).Initialise(weaponType, ammo); m_maxWeaponTypeAllowed++; } } void CPed::ClearWeapons(void) { CWeaponInfo *currentWeapon = CWeaponInfo::GetWeaponInfo(GetWeapon()->m_eWeaponType); RemoveWeaponModel(currentWeapon->m_nModelId); m_maxWeaponTypeAllowed = WEAPONTYPE_BASEBALLBAT; m_currentWeapon = WEAPONTYPE_UNARMED; currentWeapon = CWeaponInfo::GetWeaponInfo(GetWeapon()->m_eWeaponType); AddWeaponModel(currentWeapon->m_nModelId); for(int i = 0; i < WEAPONTYPE_TOTAL_INVENTORY_WEAPONS; i++) { CWeapon &weapon = GetWeapon(i); weapon.m_eWeaponType = WEAPONTYPE_UNARMED; weapon.m_eWeaponState = WEAPONSTATE_READY; weapon.m_nAmmoInClip = 0; weapon.m_nAmmoTotal = 0; weapon.m_nTimer = 0; } } void CPed::PreRender(void) { CShadows::StoreShadowForPed(this, CTimeCycle::m_fShadowDisplacementX[CTimeCycle::m_CurrentStoredValue], CTimeCycle::m_fShadowDisplacementY[CTimeCycle::m_CurrentStoredValue], CTimeCycle::m_fShadowFrontX[CTimeCycle::m_CurrentStoredValue], CTimeCycle::m_fShadowFrontY[CTimeCycle::m_CurrentStoredValue], CTimeCycle::m_fShadowSideX[CTimeCycle::m_CurrentStoredValue], CTimeCycle::m_fShadowSideY[CTimeCycle::m_CurrentStoredValue]); #ifdef PED_SKIN if(IsClumpSkinned(GetClump())){ UpdateRpHAnim(); if(bBodyPartJustCameOff && m_bodyPartBleeding == PED_HEAD){ // scale head to 0 if shot off RpHAnimHierarchy *hier = GetAnimHierarchyFromSkinClump(GetClump()); int32 idx = RpHAnimIDGetIndex(hier, ConvertPedNode2BoneTag(PED_HEAD)); RwMatrix *head = &RpHAnimHierarchyGetMatrixArray(hier)[idx]; RwV3d zero = { 0.0f, 0.0f, 0.0f }; RwMatrixScale(head, &zero, rwCOMBINEPRECONCAT); } } #endif if (bBodyPartJustCameOff && bIsPedDieAnimPlaying && m_bodyPartBleeding != -1 && (CTimer::GetFrameCounter() & 7) > 3) { CVector bloodDir(0.0f, 0.0f, 0.0f); CVector bloodPos(0.0f, 0.0f, 0.0f); TransformToNode(bloodPos, m_bodyPartBleeding); switch (m_bodyPartBleeding) { case PED_HEAD: bloodDir = 0.1f * GetUp(); break; case PED_UPPERARML: bloodDir = 0.04f * GetUp() - 0.04f * GetRight(); break; case PED_UPPERARMR: bloodDir = 0.04f * GetUp() - 0.04f * GetRight(); break; case PED_UPPERLEGL: bloodDir = 0.04f * GetUp() + 0.05f * GetForward(); break; case PED_UPPERLEGR: bloodDir = 0.04f * GetUp() + 0.05f * GetForward(); break; default: bloodDir = CVector(0.0f, 0.0f, 0.0f); break; } for(int i = 0; i < 4; i++) CParticle::AddParticle(PARTICLE_BLOOD_SPURT, bloodPos, bloodDir, nil, 0.0f, 0, 0, 0, 0); } if (CWeather::Rain > 0.3f && TheCamera.SoundDistUp > 15.0f) { if ((TheCamera.GetPosition() - GetPosition()).Magnitude() < 25.0f) { bool doSplashUp = true; CColModel *ourCol = CModelInfo::GetModelInfo(GetModelIndex())->GetColModel(); CVector speed = FindPlayerSpeed(); if (Abs(speed.x) <= 0.05f && Abs(speed.y) <= 0.05f) { if (!OnGround() && m_nPedState != PED_ATTACK && m_nPedState != PED_FIGHT) { if (!IsPedHeadAbovePos(0.3f) || RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_IDLE_TIRED)) { doSplashUp = false; } } else doSplashUp = false; } else doSplashUp = false; if (doSplashUp && ourCol->numSpheres > 0) { for(int i = 0; i < ourCol->numSpheres; i++) { CColSphere *sphere = &ourCol->spheres[i]; CVector splashPos; switch (sphere->piece) { case PEDPIECE_LEFTARM: case PEDPIECE_RIGHTARM: case PEDPIECE_HEAD: splashPos = GetMatrix() * ourCol->spheres[i].center; splashPos.z += 0.7f * sphere->radius; splashPos.x += CGeneral::GetRandomNumberInRange(-0.15f, 0.15f); splashPos.y += CGeneral::GetRandomNumberInRange(-0.15f, 0.15f); CParticle::AddParticle(PARTICLE_RAIN_SPLASHUP, splashPos, CVector(0.0f, 0.0f, 0.0f), nil, 0.0f, 0, 0, CGeneral::GetRandomNumber() & 1, 0); break; default: break; } } } } } } void CPed::Render(void) { if (bInVehicle && m_nPedState != PED_EXIT_CAR && m_nPedState != PED_DRAG_FROM_CAR) { if (!bRenderPedInCar) return; float camDistSq = (TheCamera.GetPosition() - GetPosition()).MagnitudeSqr(); if (camDistSq > SQR(25.0f * TheCamera.LODDistMultiplier)) return; } CEntity::Render(); #ifdef PED_SKIN if(IsClumpSkinned(GetClump())){ renderLimb(PED_HEAD); renderLimb(PED_HANDL); renderLimb(PED_HANDR); } if(m_pWeaponModel && IsClumpSkinned(GetClump())){ RpHAnimHierarchy *hier = GetAnimHierarchyFromSkinClump(GetClump()); int idx = RpHAnimIDGetIndex(hier, m_pFrames[PED_HANDR]->nodeID); RwMatrix *mat = &RpHAnimHierarchyGetMatrixArray(hier)[idx]; RwFrame *frame = RpAtomicGetFrame(m_pWeaponModel); *RwFrameGetMatrix(frame) = *mat; RwFrameUpdateObjects(frame); RpAtomicRender(m_pWeaponModel); } #endif } void CPed::CheckAroundForPossibleCollisions(void) { CVector ourCentre, objCentre; CEntity *objects[8]; int16 maxObject; if (CTimer::GetTimeInMilliseconds() <= m_nPedStateTimer) return; GetBoundCentre(ourCentre); CWorld::FindObjectsInRange(ourCentre, 10.0f, true, &maxObject, 6, objects, false, true, false, true, false); for (int i = 0; i < maxObject; i++) { CEntity *object = objects[i]; if (bRunningToPhone) { if (gPhoneInfo.PhoneAtThisPosition(object->GetPosition())) break; } object->GetBoundCentre(objCentre); float radius = object->GetBoundRadius(); if (radius > 4.5f || radius < 1.0f) radius = 1.0f; // Developers gave up calculating Z diff. later according to asm. float diff = CVector(ourCentre - objCentre).MagnitudeSqr2D(); if (sq(radius + 1.0f) > diff) m_fRotationDest += DEGTORAD(22.5f); } } void CPed::SetIdle(void) { if (m_nPedState != PED_IDLE && m_nPedState != PED_MUG && m_nPedState != PED_FLEE_ENTITY) { #ifdef VC_PED_PORTS if (m_nPedState == PED_AIM_GUN) ClearPointGunAt(); m_nLastPedState = PED_NONE; #endif SetPedState(PED_IDLE); SetMoveState(PEDMOVE_STILL); } if (m_nWaitState == WAITSTATE_FALSE) { m_nWaitTimer = CTimer::GetTimeInMilliseconds() + CGeneral::GetRandomNumberInRange(2000, 4000); } } void CPed::Idle(void) { CVehicle *veh = m_pMyVehicle; if (veh && veh->m_nGettingOutFlags && m_vehDoor) { if (veh->m_nGettingOutFlags & GetCarDoorFlag(m_vehDoor)) { if (m_objective != OBJECTIVE_KILL_CHAR_ON_FOOT) { CVector doorPos = GetPositionToOpenCarDoor(veh, m_vehDoor); CVector doorDist = GetPosition() - doorPos; if (doorDist.MagnitudeSqr() < sq(0.5f)) { SetMoveState(PEDMOVE_WALK); return; } } } } CAnimBlendAssociation *armedIdleAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_IDLE_BIGGUN); CAnimBlendAssociation *unarmedIdleAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_IDLE); int waitTime; if (m_nMoveState == PEDMOVE_STILL) { eWeaponType curWeapon = GetWeapon()->m_eWeaponType; if (!armedIdleAssoc || CTimer::GetTimeInMilliseconds() <= m_nWaitTimer && curWeapon != WEAPONTYPE_UNARMED && curWeapon != WEAPONTYPE_MOLOTOV && curWeapon != WEAPONTYPE_GRENADE) { if ((!GetWeapon()->IsType2Handed() || curWeapon == WEAPONTYPE_SHOTGUN) && curWeapon != WEAPONTYPE_BASEBALLBAT || !unarmedIdleAssoc || unarmedIdleAssoc->blendAmount <= 0.95f || m_nWaitState != WAITSTATE_FALSE || CTimer::GetTimeInMilliseconds() <= m_nWaitTimer) { m_moved = CVector2D(0.0f, 0.0f); return; } CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_IDLE_BIGGUN, 3.0f); waitTime = CGeneral::GetRandomNumberInRange(4000, 7500); } else { armedIdleAssoc->blendDelta = -2.0f; armedIdleAssoc->flags |= ASSOC_DELETEFADEDOUT; waitTime = CGeneral::GetRandomNumberInRange(3000, 8500); } m_nWaitTimer = CTimer::GetTimeInMilliseconds() + waitTime; } else { if (armedIdleAssoc) { armedIdleAssoc->blendDelta = -8.0f; armedIdleAssoc->flags |= ASSOC_DELETEFADEDOUT; m_nWaitTimer = 0; } if (!IsPlayer()) SetMoveState(PEDMOVE_STILL); } m_moved = CVector2D(0.0f, 0.0f); } void CPed::ClearPause(void) { RestorePreviousState(); } void CPed::Pause(void) { m_moved = CVector2D(0.0f, 0.0f); if (CTimer::GetTimeInMilliseconds() > m_leaveCarTimer) ClearPause(); } void CPed::SetFall(int extraTime, AnimationId animId, uint8 evenIfNotInControl) { if (!IsPedInControl() && (!evenIfNotInControl || DyingOrDead())) return; ClearLookFlag(); ClearAimFlag(); SetStoredState(); SetPedState(PED_FALL); CAnimBlendAssociation *fallAssoc = RpAnimBlendClumpGetAssociation(GetClump(), animId); if (fallAssoc) { fallAssoc->SetCurrentTime(0.0f); fallAssoc->blendAmount = 0.0f; fallAssoc->blendDelta = 8.0f; fallAssoc->SetRun(); } else { fallAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, animId, 8.0f); } if (extraTime == -1) { m_getUpTimer = UINT32_MAX; } else if (fallAssoc) { if (IsPlayer()) { m_getUpTimer = 1000.0f * fallAssoc->hierarchy->totalLength + CTimer::GetTimeInMilliseconds() + 500.0f; } else { m_getUpTimer = 1000.0f * fallAssoc->hierarchy->totalLength + CTimer::GetTimeInMilliseconds() + extraTime + ((m_randomSeed + CTimer::GetFrameCounter()) % 1000); } } else { m_getUpTimer = extraTime + CTimer::GetTimeInMilliseconds() + 1000 + ((m_randomSeed + CTimer::GetFrameCounter()) % 1000); } bFallenDown = true; } void CPed::ClearFall(void) { SetGetUp(); } void CPed::Fall(void) { if (m_getUpTimer != UINT32_MAX && CTimer::GetTimeInMilliseconds() > m_getUpTimer #ifdef VC_PED_PORTS && bIsStanding #endif ) ClearFall(); // VC plays animations ANIM_STD_FALL_ONBACK and ANIM_STD_FALL_ONFRONT in here, which doesn't exist in III. } bool CPed::CheckIfInTheAir(void) { if (bInVehicle) return false; CVector pos = GetPosition(); CColPoint foundColPoint; CEntity *foundEntity; float startZ = pos.z - 1.54f; bool foundGround = CWorld::ProcessVerticalLine(pos, startZ, foundColPoint, foundEntity, true, true, false, true, false, false, nil); if (!foundGround && m_nPedState != PED_JUMP) { pos.z -= FEET_OFFSET; if (CWorld::TestSphereAgainstWorld(pos, 0.15f, this, true, false, false, false, false, false)) foundGround = true; } return !foundGround; } void CPed::SetInTheAir(void) { if (bIsInTheAir) return; bIsInTheAir = true; CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_FALL_GLIDE, 4.0f); if (m_nPedState == PED_ATTACK) { ClearAttack(); ClearPointGunAt(); } else if (m_nPedState == PED_FIGHT) { EndFight(ENDFIGHT_FAST); } } void CPed::InTheAir(void) { CColPoint foundCol; CEntity *foundEnt; CVector ourPos = GetPosition(); CVector bitBelow = GetPosition(); bitBelow.z -= 4.04f; if (m_vecMoveSpeed.z < 0.0f && !bIsPedDieAnimPlaying) { if (!DyingOrDead()) { if (CWorld::ProcessLineOfSight(ourPos, bitBelow, foundCol, foundEnt, true, true, false, true, false, false, false)) { if (GetPosition().z - foundCol.point.z < 1.3f #ifdef VC_PED_PORTS || bIsStanding #endif ) SetLanding(); } else { if (!RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_FALL)) { if (m_vecMoveSpeed.z < -0.1f) CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_FALL, 4.0f); } } } } } void CPed::SetLanding(void) { if (DyingOrDead()) return; CAnimBlendAssociation *fallAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_FALL); CAnimBlendAssociation *landAssoc; RpAnimBlendClumpSetBlendDeltas(GetClump(), ASSOC_PARTIAL, -1000.0f); if (fallAssoc) { landAssoc = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_FALL_COLLAPSE); DMAudio.PlayOneShot(m_audioEntityId, SOUND_FALL_COLLAPSE, 1.0f); if (IsPlayer()) Say(SOUND_PED_LAND); } else { landAssoc = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_FALL_LAND); DMAudio.PlayOneShot(m_audioEntityId, SOUND_FALL_LAND, 1.0f); } landAssoc->SetFinishCallback(PedLandCB, this); bIsInTheAir = false; bIsLanding = true; } void CPed::SetGetUp(void) { if (m_nPedState == PED_GETUP && bGetUpAnimStarted) return; if (!CanSetPedState()) return; if (m_fHealth >= 1.0f || IsPedHeadAbovePos(-0.3f)) { if (bUpdateAnimHeading) { m_fRotationCur = CGeneral::LimitRadianAngle(m_fRotationCur); m_fRotationCur -= HALFPI; bUpdateAnimHeading = false; } if (m_nPedState != PED_GETUP) { SetStoredState(); SetPedState(PED_GETUP); } CVehicle *collidingVeh = (CVehicle*)m_pCollidingEntity; CVehicle *veh = (CVehicle*)CPedPlacement::IsPositionClearOfCars(&GetPosition()); if (veh && veh->m_vehType != VEHICLE_TYPE_BIKE || collidingVeh && collidingVeh->IsVehicle() && collidingVeh->m_vehType != VEHICLE_TYPE_BIKE && ((uint8)(CTimer::GetFrameCounter() + m_randomSeed + 5) % 8 || CCollision::ProcessColModels(GetMatrix(), *GetColModel(), collidingVeh->GetMatrix(), *collidingVeh->GetColModel(), aTempPedColPts, nil, nil) > 0)) { bGetUpAnimStarted = false; if (IsPlayer()) InflictDamage(nil, WEAPONTYPE_RUNOVERBYCAR, CTimer::GetTimeStep(), PEDPIECE_TORSO, 0); else { if (!CPad::GetPad(0)->ArePlayerControlsDisabled()) return; InflictDamage(nil, WEAPONTYPE_RUNOVERBYCAR, 1000.0f, PEDPIECE_TORSO, 0); } return; } bGetUpAnimStarted = true; m_pCollidingEntity = nil; bKnockedUpIntoAir = false; CAnimBlendAssociation *animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_RUNFAST); if (animAssoc) { if (RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_RUN)) { CAnimManager::BlendAnimation(GetClump(), m_animGroup, ANIM_STD_RUN, 8.0f); } else { CAnimManager::BlendAnimation(GetClump(), m_animGroup, ANIM_STD_IDLE, 8.0f); } animAssoc->flags |= ASSOC_DELETEFADEDOUT; } if (RpAnimBlendClumpGetFirstAssociation(GetClump(), ASSOC_FRONTAL)) animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_GET_UP_FRONT, 1000.0f); else animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_GET_UP, 1000.0f); animAssoc->SetFinishCallback(PedGetupCB,this); } else { m_fHealth = 0.0f; SetDie(ANIM_STD_NUM, 4.0f, 0.0f); } } void CPed::Mug(void) { if (m_pSeekTarget && m_pSeekTarget->IsPed()) { if (CTimer::GetTimeInMilliseconds() <= m_attackTimer - 2000) { if ((m_pSeekTarget->GetPosition() - GetPosition()).Magnitude() > 3.0f) m_wepSkills = 50; Say(SOUND_PED_MUGGING); ((CPed*)m_pSeekTarget)->Say(SOUND_PED_ROBBED); } else { SetWanderPath(CGeneral::GetRandomNumber() & 7); SetFlee(m_pSeekTarget, 20000); } } else { SetIdle(); } } void CPed::SetLookTimer(int time) { if (CTimer::GetTimeInMilliseconds() > m_lookTimer) { m_lookTimer = CTimer::GetTimeInMilliseconds() + time; } } void CPed::SetAttackTimer(uint32 time) { if (CTimer::GetTimeInMilliseconds() > m_attackTimer) m_attackTimer = Max(m_shootTimer, CTimer::GetTimeInMilliseconds()) + time; } void CPed::SetShootTimer(uint32 time) { if (CTimer::GetTimeInMilliseconds() > m_shootTimer) { m_shootTimer = CTimer::GetTimeInMilliseconds() + time; } } void CPed::ClearLook(void) { RestorePreviousState(); ClearLookFlag(); } void CPed::Look(void) { // UNUSED: This is a perfectly empty function. } bool CPed::TurnBody(void) { bool turnDone = true; if (m_pLookTarget) m_fLookDirection = CGeneral::GetRadianAngleBetweenPoints( m_pLookTarget->GetPosition().x, m_pLookTarget->GetPosition().y, GetPosition().x, GetPosition().y); float limitedLookDir = CGeneral::LimitRadianAngle(m_fLookDirection); float currentRot = m_fRotationCur; if (currentRot - PI > limitedLookDir) limitedLookDir += 2 * PI; else if (PI + currentRot < limitedLookDir) limitedLookDir -= 2 * PI; float neededTurn = currentRot - limitedLookDir; m_fRotationDest = limitedLookDir; if (Abs(neededTurn) > 0.05f) { turnDone = false; currentRot -= neededTurn * 0.2f; } m_fRotationCur = currentRot; m_fLookDirection = limitedLookDir; return turnDone; } void CPed::SetSeek(CVector pos, float distanceToCountDone) { if (!IsPedInControl() || (m_nPedState == PED_SEEK_POS && m_vecSeekPos.x == pos.x && m_vecSeekPos.y == pos.y)) return; if (GetWeapon()->m_eWeaponType == WEAPONTYPE_M16 || GetWeapon()->m_eWeaponType == WEAPONTYPE_AK47 || GetWeapon()->m_eWeaponType == WEAPONTYPE_SNIPERRIFLE || GetWeapon()->m_eWeaponType == WEAPONTYPE_ROCKETLAUNCHER || GetWeapon()->m_eWeaponType == WEAPONTYPE_SHOTGUN) { ClearPointGunAt(); } if (m_nPedState != PED_SEEK_POS) SetStoredState(); SetPedState(PED_SEEK_POS); m_distanceToCountSeekDone = distanceToCountDone; m_vecSeekPos = pos; } void CPed::SetSeek(CEntity *seeking, float distanceToCountDone) { if (!IsPedInControl()) return; if (m_nPedState == PED_SEEK_ENTITY && m_pSeekTarget == seeking) return; if (!seeking) return; if (m_nPedState != PED_SEEK_ENTITY) SetStoredState(); SetPedState(PED_SEEK_ENTITY); m_distanceToCountSeekDone = distanceToCountDone; m_pSeekTarget = seeking; m_pSeekTarget->RegisterReference((CEntity **) &m_pSeekTarget); SetMoveState(PEDMOVE_STILL); } void CPed::ClearSeek(void) { SetIdle(); bRunningToPhone = false; } bool CPed::Seek(void) { float distanceToCountItDone = m_distanceToCountSeekDone; eMoveState nextMove = PEDMOVE_NONE; if (m_objective != OBJECTIVE_ENTER_CAR_AS_DRIVER) { if (m_nPedState != PED_EXIT_TRAIN && m_nPedState != PED_ENTER_TRAIN && m_nPedState != PED_SEEK_IN_BOAT && m_objective != OBJECTIVE_ENTER_CAR_AS_PASSENGER && m_objective != OBJECTIVE_SOLICIT_VEHICLE && !bDuckAndCover) { if ((!m_pedInObjective || !m_pedInObjective->bInVehicle) && !((CTimer::GetFrameCounter() + (m_randomSeed % 256) + 17) & 7)) { CEntity *obstacle = CWorld::TestSphereAgainstWorld(m_vecSeekPos, 0.4f, nil, false, true, false, false, false, false); if (obstacle) { if (!obstacle->IsVehicle() || ((CVehicle*)obstacle)->m_vehType == VEHICLE_TYPE_CAR) { distanceToCountItDone = 2.5f; } else { CVehicleModelInfo *vehModel = (CVehicleModelInfo *)CModelInfo::GetModelInfo(obstacle->GetModelIndex()); float yLength = vehModel->GetColModel()->boundingBox.max.y - vehModel->GetColModel()->boundingBox.min.y; distanceToCountItDone = yLength * 0.55f; } } } } } if (!m_pSeekTarget && m_nPedState == PED_SEEK_ENTITY) ClearSeek(); float seekPosDist = (m_vecSeekPos - GetPosition()).Magnitude2D(); if (seekPosDist < 2.0f || m_objective == OBJECTIVE_GOTO_AREA_ON_FOOT) { if (m_objective == OBJECTIVE_FOLLOW_CHAR_IN_FORMATION) { if (m_pedInObjective->m_nMoveState != PEDMOVE_STILL) nextMove = m_pedInObjective->m_nMoveState; } else nextMove = PEDMOVE_WALK; } else if (m_objective != OBJECTIVE_FOLLOW_CHAR_IN_FORMATION) { if (m_objective == OBJECTIVE_KILL_CHAR_ON_FOOT || m_objective == OBJECTIVE_KILL_CHAR_ANY_MEANS || m_objective == OBJECTIVE_RUN_TO_AREA || bIsRunning) nextMove = PEDMOVE_RUN; else nextMove = PEDMOVE_WALK; } else if (seekPosDist <= 2.0f) { if (m_pedInObjective->m_nMoveState != PEDMOVE_STILL) nextMove = m_pedInObjective->m_nMoveState; } else { nextMove = PEDMOVE_RUN; } if (m_nPedState == PED_SEEK_ENTITY) { if (m_pSeekTarget->IsPed()) { if (((CPed*)m_pSeekTarget)->bInVehicle) distanceToCountItDone += 2.0f; } } if (seekPosDist >= distanceToCountItDone) { if (bIsRunning) nextMove = PEDMOVE_RUN; if (CTimer::GetTimeInMilliseconds() <= m_nPedStateTimer) { if (m_actionX != 0.0f && m_actionY != 0.0f) { m_fRotationDest = CGeneral::GetRadianAngleBetweenPoints( m_actionX, m_actionY, GetPosition().x, GetPosition().y); float neededTurn = Abs(m_fRotationDest - m_fRotationCur); if (neededTurn > PI) neededTurn = TWOPI - neededTurn; if (neededTurn > HALFPI) { if (seekPosDist >= 1.0f) { if (seekPosDist < 2.0f) { if (bIsRunning) nextMove = PEDMOVE_RUN; else nextMove = PEDMOVE_WALK; } } else { nextMove = PEDMOVE_STILL; } } CVector2D moveDist(GetPosition().x - m_actionX, GetPosition().y - m_actionY); if (moveDist.Magnitude() < 0.5f) { m_nPedStateTimer = 0; m_actionX = 0; m_actionY = 0; } } } else { m_fRotationDest = CGeneral::GetRadianAngleBetweenPoints( m_vecSeekPos.x, m_vecSeekPos.y, GetPosition().x, GetPosition().y); float neededTurn = Abs(m_fRotationDest - m_fRotationCur); if (neededTurn > PI) neededTurn = TWOPI - neededTurn; if (neededTurn > HALFPI) { if (seekPosDist >= 1.0 && neededTurn <= DEGTORAD(135.0f)) { if (seekPosDist < 2.0f) nextMove = PEDMOVE_WALK; } else { nextMove = PEDMOVE_STILL; } } } if (((m_nPedState == PED_FLEE_POS || m_nPedState == PED_FLEE_ENTITY) && m_nMoveState < nextMove) || (m_nPedState != PED_FLEE_POS && m_nPedState != PED_FLEE_ENTITY && m_objective != OBJECTIVE_GOTO_CHAR_ON_FOOT && m_nWaitState == WAITSTATE_FALSE)) { SetMoveState(nextMove); } SetMoveAnim(); return false; } if ((m_objective != OBJECTIVE_FOLLOW_CHAR_IN_FORMATION || m_pedInObjective->m_nMoveState == PEDMOVE_STILL) && m_nMoveState != PEDMOVE_STILL) { m_nPedStateTimer = 0; m_actionX = 0; m_actionY = 0; } if (m_objective == OBJECTIVE_GOTO_AREA_ON_FOOT || m_objective == OBJECTIVE_RUN_TO_AREA || m_objective == OBJECTIVE_GOTO_AREA_ANY_MEANS) { if (m_pNextPathNode) m_pNextPathNode = nil; else bScriptObjectiveCompleted = true; bUsePedNodeSeek = true; } if (SeekFollowingPath(nil)) m_nCurPathNode++; return true; } void CPed::SetFlee(CVector2D const &from, int time) { if (CTimer::GetTimeInMilliseconds() < m_nPedStateTimer || !IsPedInControl() || bKindaStayInSamePlace) return; if (m_nPedState != PED_FLEE_ENTITY) { SetStoredState(); SetPedState(PED_FLEE_POS); SetMoveState(PEDMOVE_RUN); m_fleeFromPosX = from.x; m_fleeFromPosY = from.y; } bUsePedNodeSeek = true; m_pNextPathNode = nil; m_fleeTimer = CTimer::GetTimeInMilliseconds() + time; float angleToFace = CGeneral::GetRadianAngleBetweenPoints( GetPosition().x, GetPosition().y, from.x, from.y); m_fRotationDest = CGeneral::LimitRadianAngle(angleToFace); if (m_fRotationCur - PI > m_fRotationDest) { m_fRotationDest += 2 * PI; } else if (PI + m_fRotationCur < m_fRotationDest) { m_fRotationDest -= 2 * PI; } } void CPed::SetFlee(CEntity *fleeFrom, int time) { if (!IsPedInControl() || bKindaStayInSamePlace || !fleeFrom) return; SetStoredState(); SetPedState(PED_FLEE_ENTITY); bUsePedNodeSeek = true; SetMoveState(PEDMOVE_RUN); m_fleeFrom = fleeFrom; m_fleeFrom->RegisterReference((CEntity **) &m_fleeFrom); if (time <= 0) m_fleeTimer = 0; else m_fleeTimer = CTimer::GetTimeInMilliseconds() + time; float angleToFace = CGeneral::GetRadianAngleBetweenPoints( GetPosition().x, GetPosition().y, fleeFrom->GetPosition().x, fleeFrom->GetPosition().y); m_fRotationDest = CGeneral::LimitRadianAngle(angleToFace); if (m_fRotationCur - PI > m_fRotationDest) { m_fRotationDest += 2 * PI; } else if (PI + m_fRotationCur < m_fRotationDest) { m_fRotationDest -= 2 * PI; } } void CPed::ClearFlee(void) { RestorePreviousState(); bUsePedNodeSeek = false; m_chatTimer = 0; m_fleeTimer = 0; } void CPed::Flee(void) { if (CTimer::GetTimeInMilliseconds() > m_fleeTimer && m_fleeTimer) { bool mayFinishFleeing = true; if (m_nPedState == PED_FLEE_ENTITY) { if ((CVector2D(GetPosition()) - ms_vec2DFleePosition).MagnitudeSqr() < sq(30.0f)) mayFinishFleeing = false; } if (mayFinishFleeing) { eMoveState moveState = m_nMoveState; ClearFlee(); if (m_objective == OBJECTIVE_FLEE_CHAR_ON_FOOT_TILL_SAFE || m_objective == OBJECTIVE_FLEE_CHAR_ON_FOOT_ALWAYS) RestorePreviousObjective(); if ((m_nPedState == PED_IDLE || m_nPedState == PED_WANDER_PATH) && CGeneral::GetRandomNumber() & 1) { SetWaitState(moveState <= PEDMOVE_WALK ? WAITSTATE_CROSS_ROAD_LOOK : WAITSTATE_FINISH_FLEE, nil); } return; } m_fleeTimer = CTimer::GetTimeInMilliseconds() + 5000; } if (bUsePedNodeSeek) { CPathNode *realLastNode = nil; uint8 nextDirection = 0; uint8 curDirectionShouldBe = 9; // means not defined yet if (m_nPedStateTimer < CTimer::GetTimeInMilliseconds() && m_collidingThingTimer < CTimer::GetTimeInMilliseconds()) { if (m_pNextPathNode && CTimer::GetTimeInMilliseconds() > m_chatTimer) { curDirectionShouldBe = CGeneral::GetNodeHeadingFromVector(GetPosition().x - ms_vec2DFleePosition.x, GetPosition().y - ms_vec2DFleePosition.y); if (m_nPathDir < curDirectionShouldBe) m_nPathDir += 8; int dirDiff = m_nPathDir - curDirectionShouldBe; if (dirDiff > 2 && dirDiff < 6) { realLastNode = nil; m_pLastPathNode = m_pNextPathNode; m_pNextPathNode = nil; } } if (m_pNextPathNode) { m_vecSeekPos = m_pNextPathNode->GetPosition(); if (m_nMoveState == PEDMOVE_RUN) bIsRunning = true; eMoveState moveState = m_nMoveState; if (Seek()) { realLastNode = m_pLastPathNode; m_pLastPathNode = m_pNextPathNode; m_pNextPathNode = nil; } bIsRunning = false; SetMoveState(moveState); } } if (!m_pNextPathNode) { if (curDirectionShouldBe == 9) { curDirectionShouldBe = CGeneral::GetNodeHeadingFromVector(GetPosition().x - ms_vec2DFleePosition.x, GetPosition().y - ms_vec2DFleePosition.y); } ThePaths.FindNextNodeWandering(PATH_PED, GetPosition(), &m_pLastPathNode, &m_pNextPathNode, curDirectionShouldBe, &nextDirection); if (curDirectionShouldBe < nextDirection) curDirectionShouldBe += 8; if (m_pNextPathNode && m_pNextPathNode != realLastNode && m_pNextPathNode != m_pLastPathNode && curDirectionShouldBe - nextDirection != 4) { m_nPathDir = nextDirection; m_chatTimer = CTimer::GetTimeInMilliseconds() + 2000; } else { bUsePedNodeSeek = false; SetMoveState(PEDMOVE_RUN); Flee(); } } return; } if ((m_nPedState == PED_FLEE_ENTITY || m_nPedState == PED_ON_FIRE) && m_nPedStateTimer < CTimer::GetTimeInMilliseconds()) { float angleToFleeFromPos = CGeneral::GetRadianAngleBetweenPoints( GetPosition().x, GetPosition().y, ms_vec2DFleePosition.x, ms_vec2DFleePosition.y); m_fRotationDest = CGeneral::LimitRadianAngle(angleToFleeFromPos); if (m_fRotationCur - PI > m_fRotationDest) m_fRotationDest += TWOPI; else if (PI + m_fRotationCur < m_fRotationDest) m_fRotationDest -= TWOPI; } if (CTimer::GetTimeInMilliseconds() & 0x20) { //CVector forwardPos = GetPosition(); CMatrix forwardMat(GetMatrix()); forwardMat.GetPosition() += Multiply3x3(forwardMat, CVector(0.0f, 4.0f, 0.0f)); CVector forwardPos = forwardMat.GetPosition(); CEntity *foundEnt; CColPoint foundCol; bool found = CWorld::ProcessVerticalLine(forwardPos, forwardMat.GetPosition().z - 100.0f, foundCol, foundEnt, 1, 0, 0, 0, 1, 0, 0); if (!found || Abs(forwardPos.z - forwardMat.GetPosition().z) > 1.0f) { m_fRotationDest += DEGTORAD(112.5f); m_nPedStateTimer = CTimer::GetTimeInMilliseconds() + 2000; } } if (CTimer::GetTimeInMilliseconds() >= m_collidingThingTimer) return; if (!m_collidingEntityWhileFleeing) return; double collidingThingPriorityMult = (double)(m_collidingThingTimer - CTimer::GetTimeInMilliseconds()) * 2.0 / 2500; if (collidingThingPriorityMult <= 1.5) { double angleToFleeEntity = CGeneral::GetRadianAngleBetweenPoints( GetPosition().x, GetPosition().y, m_collidingEntityWhileFleeing->GetPosition().x, m_collidingEntityWhileFleeing->GetPosition().y); angleToFleeEntity = CGeneral::LimitRadianAngle(angleToFleeEntity); double angleToFleeCollidingThing = CGeneral::GetRadianAngleBetweenPoints( m_vecDamageNormal.x, m_vecDamageNormal.y, 0.0f, 0.0f); angleToFleeCollidingThing = CGeneral::LimitRadianAngle(angleToFleeCollidingThing); if (angleToFleeEntity - PI > angleToFleeCollidingThing) angleToFleeCollidingThing += TWOPI; else if (PI + angleToFleeEntity < angleToFleeCollidingThing) angleToFleeCollidingThing -= TWOPI; if (collidingThingPriorityMult <= 1.0f) { // Range [0.0, 1.0] float angleToFleeBoth = (angleToFleeCollidingThing + angleToFleeEntity) * 0.5f; if (m_fRotationDest - PI > angleToFleeBoth) angleToFleeBoth += TWOPI; else if (PI + m_fRotationDest < angleToFleeBoth) angleToFleeBoth -= TWOPI; m_fRotationDest = (1.0f - collidingThingPriorityMult) * m_fRotationDest + collidingThingPriorityMult * angleToFleeBoth; } else { // Range (1.0, 1.5] double adjustedMult = (collidingThingPriorityMult - 1.0f) * 2.0f; m_fRotationDest = angleToFleeEntity * (1.0 - adjustedMult) + adjustedMult * angleToFleeCollidingThing; } } else { m_fRotationDest = CGeneral::GetRadianAngleBetweenPoints( m_vecDamageNormal.x, m_vecDamageNormal.y, 0.0f, 0.0f); m_fRotationDest = CGeneral::LimitRadianAngle(m_fRotationDest); } m_fRotationCur = CGeneral::LimitRadianAngle(m_fRotationCur); if (m_fRotationCur - PI > m_fRotationDest) m_fRotationDest += TWOPI; else if (PI + m_fRotationCur < m_fRotationDest) m_fRotationDest -= TWOPI; } // "Wander range" state is unused in game, and you can't use it without SetWanderRange anyway void CPed::WanderRange(void) { bool arrived = Seek(); if (arrived) { Idle(); if ((m_randomSeed + 3 * CTimer::GetFrameCounter()) % 1000 > 997) { CVector2D newCoords2D = m_wanderRangeBounds->GetRandomPointInRange(); SetSeek(CVector(newCoords2D.x, newCoords2D.y, GetPosition().z), 2.5f); } } } bool CPed::SetWanderPath(int8 pathStateDest) { uint8 nextPathState; if (IsPedInControl()) { if (bKindaStayInSamePlace) { SetIdle(); return false; } else { m_nPathDir = pathStateDest; if (pathStateDest == 0) pathStateDest = CGeneral::GetRandomNumberInRange(1, 7); ThePaths.FindNextNodeWandering(PATH_PED, GetPosition(), &m_pLastPathNode, &m_pNextPathNode, m_nPathDir, &nextPathState); // Circular loop until we find a node for current m_nPathDir while (!m_pNextPathNode) { m_nPathDir = (m_nPathDir+1) % 8; // We're at where we started and couldn't find any node if (m_nPathDir == pathStateDest) { ClearAll(); SetIdle(); return false; } ThePaths.FindNextNodeWandering(PATH_PED, GetPosition(), &m_pLastPathNode, &m_pNextPathNode, m_nPathDir, &nextPathState); } // We did it, save next path state and return true m_nPathDir = nextPathState; SetPedState(PED_WANDER_PATH); SetMoveState(PEDMOVE_WALK); bIsRunning = false; return true; } } else { m_nPathDir = pathStateDest; bStartWanderPathOnFoot = true; return false; } } void CPed::WanderPath(void) { if (!m_pNextPathNode) { printf("THIS SHOULDN@T HAPPEN TOO OFTEN\n"); SetIdle(); return; } if (m_nWaitState == WAITSTATE_FALSE) { if (m_nMoveState == PEDMOVE_STILL || m_nMoveState == PEDMOVE_NONE) SetMoveState(PEDMOVE_WALK); } m_vecSeekPos = m_pNextPathNode->GetPosition(); m_vecSeekPos.z += 1.0f; // Only returns true when ped is stuck(not stopped) I think, then we should assign new direction or wait state to him. if (!Seek()) return; CPathNode *previousLastNode = m_pLastPathNode; uint8 randVal = (m_randomSeed + 3 * CTimer::GetFrameCounter()) % 100; // We don't prefer 180-degree turns in normal situations uint8 dirWeWouldntPrefer = m_nPathDir; if (dirWeWouldntPrefer <= 3) dirWeWouldntPrefer += 4; else dirWeWouldntPrefer -= 4; CPathNode *nodeWeWouldntPrefer = nil; uint8 dirToSet = 9; // means undefined uint8 dirWeWouldntPrefer2 = 9; // means undefined if (randVal <= 90) { if (randVal > 80) { m_nPathDir += 2; m_nPathDir %= 8; } } else { m_nPathDir -= 2; if (m_nPathDir < 0) m_nPathDir += 8; } m_pLastPathNode = m_pNextPathNode; ThePaths.FindNextNodeWandering(PATH_PED, GetPosition(), &m_pLastPathNode, &m_pNextPathNode, m_nPathDir, &dirToSet); uint8 tryCount = 0; // NB: SetWanderPath checks for m_nPathDir == dirToStartWith, this one checks for tryCount > 7 while (!m_pNextPathNode) { tryCount++; m_nPathDir = (m_nPathDir + 1) % 8; // We're at where we started and couldn't find any node if (tryCount > 7) { if (!nodeWeWouldntPrefer) { ClearAll(); SetIdle(); // Probably this text carried over here after copy-pasting this loop from early version of SetWanderPath. Error("Can't find valid path node, SetWanderPath, Ped.cpp"); return; } m_pNextPathNode = nodeWeWouldntPrefer; dirToSet = dirWeWouldntPrefer2; } else { ThePaths.FindNextNodeWandering(PATH_PED, GetPosition(), &m_pLastPathNode, &m_pNextPathNode, m_nPathDir, &dirToSet); if (m_pNextPathNode) { if (dirToSet == dirWeWouldntPrefer) { nodeWeWouldntPrefer = m_pNextPathNode; dirWeWouldntPrefer2 = dirToSet; m_pNextPathNode = nil; } } } } m_nPathDir = dirToSet; if (m_pLastPathNode == m_pNextPathNode) { m_pNextPathNode = previousLastNode; SetWaitState(WAITSTATE_DOUBLEBACK, nil); Say(SOUND_PED_WAIT_DOUBLEBACK); } else if (ThePaths.TestForPedTrafficLight(m_pLastPathNode, m_pNextPathNode)) { SetWaitState(WAITSTATE_TRAFFIC_LIGHTS, nil); } else if (ThePaths.TestCrossesRoad(m_pLastPathNode, m_pNextPathNode)) { SetWaitState(WAITSTATE_CROSS_ROAD, nil); } else if (m_pNextPathNode == previousLastNode) { SetWaitState(WAITSTATE_DOUBLEBACK, nil); Say(SOUND_PED_WAIT_DOUBLEBACK); } } void CPed::Avoid(void) { CPed *nearestPed; if(m_pedStats->m_temper > m_pedStats->m_fear && m_pedStats->m_temper > 50) return; if (CTimer::GetTimeInMilliseconds() > m_nPedStateTimer) { if (m_nMoveState != PEDMOVE_NONE && m_nMoveState != PEDMOVE_STILL) { nearestPed = m_nearPeds[0]; if (nearestPed && nearestPed->m_nPedState != PED_DEAD && nearestPed != m_pSeekTarget && nearestPed != m_pedInObjective) { // Check if this ped wants to avoid the nearest one if (CPedType::GetAvoid(m_nPedType) & CPedType::GetFlag(nearestPed->m_nPedType)) { // Further codes checks whether the distance between us and ped will be equal or below 1.0, if we walk up to him by 1.25 meters. // If so, we want to avoid it, so we turn our body 45 degree and look to somewhere else. // Game converts from radians to degress and back again here, doesn't make much sense CVector2D forward(-Sin(m_fRotationCur), Cos(m_fRotationCur)); forward.Normalise(); // this is kinda pointless // Move forward 1.25 meters CVector2D testPosition = CVector2D(GetPosition()) + forward*1.25f; // Get distance to ped we want to avoid CVector2D distToPed = CVector2D(nearestPed->GetPosition()) - testPosition; if (distToPed.Magnitude() <= 1.0f && OurPedCanSeeThisOne((CEntity*)nearestPed)) { m_nPedStateTimer = CTimer::GetTimeInMilliseconds() + 500 + (m_randomSeed + 3 * CTimer::GetFrameCounter()) % 1000 / 5; m_fRotationDest += DEGTORAD(45.0f); if (!bIsLooking) { SetLookFlag(nearestPed, false); SetLookTimer(CGeneral::GetRandomNumberInRange(500, 800)); } } } } } } } bool CPed::SeekFollowingPath(CVector *unused) { return m_nCurPathNode <= m_nPathNodes && m_nPathNodes; } bool CPed::SetFollowPath(CVector dest) { if (m_nPedState == PED_FOLLOW_PATH) return false; if (FindPlayerPed() != this) return false; if ((dest - GetPosition()).Magnitude() <= 2.0f) return false; CVector pointPoses[7]; int16 pointsFound; CPedPath::CalcPedRoute(0, GetPosition(), dest, pointPoses, &pointsFound, 7); for(int i = 0; i < pointsFound; i++) { m_stPathNodeStates[i].x = pointPoses[i].x; m_stPathNodeStates[i].y = pointPoses[i].y; } m_nCurPathNode = 0; m_nPathNodes = pointsFound; if (m_nPathNodes < 1) return false; SetStoredState(); SetPedState(PED_FOLLOW_PATH); SetMoveState(PEDMOVE_WALK); return true; } void CPed::FollowPath(void) { m_vecSeekPos.x = m_stPathNodeStates[m_nCurPathNode].x; m_vecSeekPos.y = m_stPathNodeStates[m_nCurPathNode].y; m_vecSeekPos.z = GetPosition().z; // Mysterious code /* int v4 = 0; int maxNodeIndex = m_nPathNodes - 1; if (maxNodeIndex > 0) { if (maxNodeIndex > 8) { while (v4 < maxNodeIndex - 8) v4 += 8; } while (v4 < maxNodeIndex) v4++; } */ if (Seek()) { m_nCurPathNode++; if (m_nCurPathNode == m_nPathNodes) RestorePreviousState(); } } void CPed::SetEvasiveStep(CEntity *reason, uint8 animType) { AnimationId stepAnim; if (m_nPedState == PED_STEP_AWAY || !IsPedInControl() || ((IsPlayer() || !bRespondsToThreats) && animType == 0)) return; float angleToFace = CGeneral::GetRadianAngleBetweenPoints( reason->GetPosition().x, reason->GetPosition().y, GetPosition().x, GetPosition().y); angleToFace = CGeneral::LimitRadianAngle(angleToFace); m_fRotationCur = CGeneral::LimitRadianAngle(m_fRotationCur); float neededTurn = Abs(angleToFace - m_fRotationCur); bool vehPressedHorn = false; if (neededTurn > PI) neededTurn = TWOPI - neededTurn; CVehicle *veh = (CVehicle*)reason; if (reason->IsVehicle() && veh->m_vehType == VEHICLE_TYPE_CAR) { if (veh->m_nCarHornTimer != 0) { vehPressedHorn = true; if (!IsPlayer()) animType = 1; } } if (neededTurn <= DEGTORAD(90.0f) || veh->GetModelIndex() == MI_RCBANDIT || vehPressedHorn || animType != 0) { SetLookFlag(veh, true); if ((CGeneral::GetRandomNumber() & 1) && veh->GetModelIndex() != MI_RCBANDIT && animType == 0) { stepAnim = ANIM_STD_HAILTAXI; } else { float vehDirection = CGeneral::GetRadianAngleBetweenPoints( veh->m_vecMoveSpeed.x, veh->m_vecMoveSpeed.y, 0.0f, 0.0f); // Let's turn our back to the "reason" angleToFace += PI; if (angleToFace > PI) angleToFace -= TWOPI; // We don't want to run towards car's direction float dangerZone = angleToFace - vehDirection; dangerZone = CGeneral::LimitRadianAngle(dangerZone); // So, add or subtract 90deg (jump to left/right) according to that if (dangerZone > 0.0f) angleToFace = vehDirection - HALFPI; else angleToFace = vehDirection + HALFPI; stepAnim = ANIM_STD_NUM; if (animType == 0 || animType == 1) stepAnim = ANIM_STD_EVADE_STEP; else if (animType == 2) stepAnim = ANIM_STD_HANDSCOWER; } if (!RpAnimBlendClumpGetAssociation(GetClump(), stepAnim)) { CAnimBlendAssociation *stepAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, stepAnim, 8.0f); stepAssoc->flags &= ~ASSOC_DELETEFADEDOUT; stepAssoc->SetFinishCallback(PedEvadeCB, this); if (animType == 0) Say(SOUND_PED_EVADE); m_fRotationCur = CGeneral::LimitRadianAngle(angleToFace); ClearAimFlag(); SetStoredState(); SetPedState(PED_STEP_AWAY); } } } void CPed::SetEvasiveDive(CPhysical *reason, uint8 onlyRandomJump) { if (!IsPedInControl() || !bRespondsToThreats) return; CAnimBlendAssociation *animAssoc; float angleToFace, neededTurn; bool handsUp = false; angleToFace = m_fRotationCur; CVehicle *veh = (CVehicle*) reason; if (reason->IsVehicle() && veh->m_vehType == VEHICLE_TYPE_CAR && veh->m_nCarHornTimer != 0 && !IsPlayer()) { onlyRandomJump = true; } if (onlyRandomJump) { if (reason) { // Simple version of my bug fix below. Doesn't calculate "danger zone", selects jump direction randomly. // Also doesn't include random hands up, sound etc. Only used on player ped and peds running from gun shots. float vehDirection = CGeneral::GetRadianAngleBetweenPoints( veh->m_vecMoveSpeed.x, veh->m_vecMoveSpeed.y, 0.0f, 0.0f); angleToFace = (CGeneral::GetRandomNumber() & 1) * PI + (-0.5f*PI) + vehDirection; angleToFace = CGeneral::LimitRadianAngle(angleToFace); } } else { if (IsPlayer()) { ((CPlayerPed*)this)->m_nEvadeAmount = 5; ((CPlayerPed*)this)->m_pEvadingFrom = reason; reason->RegisterReference((CEntity**) &((CPlayerPed*)this)->m_pEvadingFrom); return; } angleToFace = CGeneral::GetRadianAngleBetweenPoints( reason->GetPosition().x, reason->GetPosition().y, GetPosition().x, GetPosition().y); angleToFace = CGeneral::LimitRadianAngle(angleToFace); m_fRotationCur = CGeneral::LimitRadianAngle(m_fRotationCur); // FIX: Peds no more dive into cars. Taken from SetEvasiveStep, last if statement inverted #ifdef FIX_BUGS float vehDirection = CGeneral::GetRadianAngleBetweenPoints( veh->m_vecMoveSpeed.x, veh->m_vecMoveSpeed.y, 0.0f, 0.0f); // Let's turn our back to the "reason" angleToFace += PI; if (angleToFace > PI) angleToFace -= 2 * PI; // We don't want to dive towards car's direction float dangerZone = angleToFace - vehDirection; dangerZone = CGeneral::LimitRadianAngle(dangerZone); // So, add or subtract 90deg (jump to left/right) according to that if (dangerZone > 0.0f) angleToFace = 0.5f * PI + vehDirection; else angleToFace = vehDirection - 0.5f * PI; #endif neededTurn = Abs(angleToFace - m_fRotationCur); if (neededTurn > PI) neededTurn = 2 * PI - neededTurn; if (neededTurn <= 0.5f*PI) { if (CGeneral::GetRandomNumber() & 1) handsUp = true; } else { if (CGeneral::GetRandomNumber() & 7) return; } Say(SOUND_PED_EVADE); } if (handsUp || !IsPlayer() && m_pedStats->m_flags & STAT_NO_DIVE) { m_fRotationCur = angleToFace; ClearLookFlag(); ClearAimFlag(); SetLookFlag(reason, true); animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_HANDSUP); if (animAssoc) return; animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_HANDSUP, 8.0f); animAssoc->flags &= ~ASSOC_DELETEFADEDOUT; animAssoc->SetFinishCallback(PedEvadeCB, this); SetStoredState(); SetPedState(PED_STEP_AWAY); } else { m_fRotationCur = angleToFace; ClearLookFlag(); ClearAimFlag(); SetStoredState(); SetPedState(PED_DIVE_AWAY); animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_EVADE_DIVE, 8.0f); animAssoc->SetFinishCallback(PedEvadeCB, this); } if (reason->IsVehicle() && m_nPedType == PEDTYPE_COP) { if (veh->pDriver && veh->pDriver->IsPlayer()) { CWanted *wanted = FindPlayerPed()->m_pWanted; wanted->RegisterCrime_Immediately(CRIME_RECKLESS_DRIVING, GetPosition(), (uintptr)this, false); wanted->RegisterCrime_Immediately(CRIME_SPEEDING, GetPosition(), (uintptr)this, false); } } #ifdef PEDS_REPORT_CRIMES_ON_PHONE else if (reason->IsVehicle()) { if (veh->pDriver && veh->pDriver->IsPlayer()) { CWanted* wanted = FindPlayerPed()->m_pWanted; wanted->RegisterCrime(CRIME_RECKLESS_DRIVING, GetPosition(), (uintptr)this, false); } } #endif } void CPed::PedEvadeCB(CAnimBlendAssociation* animAssoc, void* arg) { CPed* ped = (CPed*)arg; if (!animAssoc) { ped->ClearLookFlag(); if (ped->m_nPedState == PED_DIVE_AWAY || ped->m_nPedState == PED_STEP_AWAY) ped->RestorePreviousState(); } else if (animAssoc->animId == ANIM_STD_EVADE_DIVE) { ped->bUpdateAnimHeading = true; ped->ClearLookFlag(); if (ped->m_nPedState == PED_DIVE_AWAY) { ped->m_getUpTimer = CTimer::GetTimeInMilliseconds() + 1; ped->SetPedState(PED_FALL); } animAssoc->flags &= ~ASSOC_FADEOUTWHENDONE; animAssoc->flags |= ASSOC_DELETEFADEDOUT; } else if (animAssoc->flags & ASSOC_FADEOUTWHENDONE) { ped->ClearLookFlag(); if (ped->m_nPedState == PED_DIVE_AWAY || ped->m_nPedState == PED_STEP_AWAY) ped->RestorePreviousState(); } else if (ped->m_nPedState != PED_ARRESTED) { animAssoc->flags |= ASSOC_DELETEFADEDOUT; if (animAssoc->blendDelta >= 0.0f) animAssoc->blendDelta = -4.0f; ped->ClearLookFlag(); if (ped->m_nPedState == PED_DIVE_AWAY || ped->m_nPedState == PED_STEP_AWAY) { ped->RestorePreviousState(); } } } void CPed::SetDie(AnimationId animId, float delta, float speed) { CPlayerPed *player = FindPlayerPed(); if (player == this) { if (!player->m_bCanBeDamaged) return; } m_threatEntity = nil; if (DyingOrDead()) return; if (m_nPedState == PED_FALL || m_nPedState == PED_GETUP) delta *= 0.5f; SetStoredState(); ClearAll(); m_fHealth = 0.0f; if (m_nPedState == PED_DRIVING) { if (!IsPlayer()) FlagToDestroyWhenNextProcessed(); } else if (bInVehicle) { if (m_pVehicleAnim) m_pVehicleAnim->blendDelta = -1000.0f; } else if (EnteringCar()) { QuitEnteringCar(); } SetPedState(PED_DIE); if (animId == ANIM_STD_NUM) { bIsPedDieAnimPlaying = false; } else { CAnimBlendAssociation *dieAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, animId, delta); if (speed > 0.0f) dieAssoc->speed = speed; dieAssoc->flags &= ~ASSOC_FADEOUTWHENDONE; if (dieAssoc->IsRunning()) { dieAssoc->SetFinishCallback(FinishDieAnimCB, this); bIsPedDieAnimPlaying = true; } } Say(SOUND_PED_DEATH); if (m_nLastPedState == PED_ENTER_CAR || m_nLastPedState == PED_CARJACK) QuitEnteringCar(); if (!bInVehicle) StopNonPartialAnims(); m_bloodyFootprintCountOrDeathTime = CTimer::GetTimeInMilliseconds(); } void CPed::FinishDieAnimCB(CAnimBlendAssociation *animAssoc, void *arg) { CPed *ped = (CPed*)arg; if (ped->bIsPedDieAnimPlaying) ped->bIsPedDieAnimPlaying = false; } void CPed::SetDead(void) { bUsesCollision = false; m_fHealth = 0.0f; if (m_nPedState == PED_DRIVING) bIsVisible = false; SetPedState(PED_DEAD); m_pVehicleAnim = nil; m_pCollidingEntity = nil; CWeaponInfo *weapon = CWeaponInfo::GetWeaponInfo(GetWeapon()->m_eWeaponType); RemoveWeaponModel(weapon->m_nModelId); m_currentWeapon = WEAPONTYPE_UNARMED; CEventList::RegisterEvent(EVENT_INJURED_PED, EVENT_ENTITY_PED, this, nil, 250); if (this != FindPlayerPed()) { CreateDeadPedWeaponPickups(); CreateDeadPedMoney(); } m_bloodyFootprintCountOrDeathTime = CTimer::GetTimeInMilliseconds(); m_deadBleeding = false; bDoBloodyFootprints = false; bVehExitWillBeInstant = false; CEventList::RegisterEvent(EVENT_DEAD_PED, EVENT_ENTITY_PED, this, nil, 1000); } void CPed::Die(void) { // UNUSED: This is a perfectly empty function. } void CPed::SetChat(CEntity *chatWith, uint32 time) { if(m_nPedState != PED_CHAT) SetStoredState(); SetPedState(PED_CHAT); SetMoveState(PEDMOVE_STILL); #if defined VC_PED_PORTS || defined FIX_BUGS m_lookTimer = 0; #endif SetLookFlag(chatWith, true); m_chatTimer = CTimer::GetTimeInMilliseconds() + time; m_lookTimer = CTimer::GetTimeInMilliseconds() + 3000; } void CPed::Chat(void) { // We're already looking to our partner if (bIsLooking && TurnBody()) ClearLookFlag(); if (!m_pLookTarget || !m_pLookTarget->IsPed()) { ClearChat(); return; } CPed *partner = (CPed*) m_pLookTarget; if (partner->m_nPedState != PED_CHAT) { ClearChat(); if (partner->m_pedInObjective) { if (partner->m_objective == OBJECTIVE_KILL_CHAR_ON_FOOT || partner->m_objective == OBJECTIVE_FLEE_CHAR_ON_FOOT_TILL_SAFE) ReactToAttack(partner->m_pedInObjective); } return; } if (bIsTalking) { if (CGeneral::GetRandomNumber() < 512) { CAnimBlendAssociation *chatAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_CHAT); if (chatAssoc) { chatAssoc->blendDelta = -4.0f; chatAssoc->flags |= ASSOC_DELETEFADEDOUT; } bIsTalking = false; } else Say(SOUND_PED_CHAT); } else { if (CGeneral::GetRandomNumber() < 20 && !RpAnimBlendClumpGetFirstAssociation(GetClump(), ASSOC_IDLE)) { CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_XPRESS_SCRATCH, 4.0f); } if (!bIsTalking && !RpAnimBlendClumpGetFirstAssociation(GetClump(), ASSOC_IDLE)) { CAnimBlendAssociation *chatAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_CHAT, 4.0f); float chatTime = CGeneral::GetRandomNumberInRange(0.0f, 3.0f); chatAssoc->SetCurrentTime(chatTime); bIsTalking = true; Say(SOUND_PED_CHAT); } } if (m_chatTimer && CTimer::GetTimeInMilliseconds() > m_chatTimer) { ClearChat(); m_chatTimer = CTimer::GetTimeInMilliseconds() + 30000; } } void CPed::ClearChat(void) { CAnimBlendAssociation *animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_CHAT); if (animAssoc) { animAssoc->blendDelta = -8.0f; animAssoc->flags |= ASSOC_DELETEFADEDOUT; } bIsTalking = false; ClearLookFlag(); RestorePreviousState(); } #ifdef PEDS_REPORT_CRIMES_ON_PHONE void ReportPhonePickUpCB(CAnimBlendAssociation* assoc, void* arg) { CPed* ped = (CPed*)arg; ped->m_nMoveState = PEDMOVE_STILL; CAnimManager::BlendAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_STD_IDLE, 8.0f); if (assoc->blendAmount > 0.5f && ped) { CAnimManager::BlendAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_STD_PHONE_TALK, 8.0f); } } void ReportPhonePutDownCB(CAnimBlendAssociation* assoc, void* arg) { assoc->flags |= ASSOC_DELETEFADEDOUT; assoc->blendDelta = -1000.0f; CPed* ped = (CPed*)arg; if (ped->m_phoneId != -1 && crimeReporters[ped->m_phoneId] == ped) { crimeReporters[ped->m_phoneId] = nil; gPhoneInfo.m_aPhones[ped->m_phoneId].m_nState = PHONE_STATE_FREE; ped->m_phoneId = -1; } if (assoc->blendAmount > 0.5f) ped->bUpdateAnimHeading = true; ped->SetWanderPath(CGeneral::GetRandomNumber() & 7); } #endif bool CPed::FacePhone(void) { // This function was broken since it's left unused early in development. #ifdef PEDS_REPORT_CRIMES_ON_PHONE float phoneDir = CGeneral::GetRadianAngleBetweenPoints( gPhoneInfo.m_aPhones[m_phoneId].m_vecPos.x, gPhoneInfo.m_aPhones[m_phoneId].m_vecPos.y, GetPosition().x, GetPosition().y); if (m_facePhoneStart) { m_lookTimer = 0; SetLookFlag(phoneDir, true); m_lookTimer = CTimer::GetTimeInMilliseconds() + 3000; m_facePhoneStart = false; } if (bIsLooking && TurnBody()) { ClearLookFlag(); SetIdle(); m_phoneTalkTimer = CTimer::GetTimeInMilliseconds() + 10000; CAnimBlendAssociation* assoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_PHONE_IN, 4.0f); assoc->SetFinishCallback(ReportPhonePickUpCB, this); return true; } return false; #else float currentRot = RADTODEG(m_fRotationCur); float phoneDir = CGeneral::GetRadianAngleBetweenPoints( gPhoneInfo.m_aPhones[m_phoneId].m_vecPos.x, gPhoneInfo.m_aPhones[m_phoneId].m_vecPos.y, GetPosition().x, GetPosition().y); SetLookFlag(phoneDir, false); phoneDir = CGeneral::LimitAngle(phoneDir); m_moved = CVector2D(0.0f, 0.0f); if (currentRot - 180.0f > phoneDir) phoneDir += 2 * 180.0f; else if (180.0f + currentRot < phoneDir) phoneDir -= 2 * 180.0f; float neededTurn = currentRot - phoneDir; if (Abs(neededTurn) <= 0.75f) { SetIdle(); ClearLookFlag(); m_phoneTalkTimer = CTimer::GetTimeInMilliseconds() + 10000; return true; } else { m_fRotationCur = DEGTORAD(currentRot - neededTurn * 0.2f); return false; } #endif } bool CPed::MakePhonecall(void) { #ifdef PEDS_REPORT_CRIMES_ON_PHONE if (!IsPlayer() && CTimer::GetTimeInMilliseconds() > m_phoneTalkTimer - 7000 && bRunningToPhone) { FindPlayerPed()->m_pWanted->RegisterCrime_Immediately(m_crimeToReportOnPhone, GetPosition(), (m_crimeToReportOnPhone == CRIME_POSSESSION_GUN ? (uintptr)m_threatEntity : (uintptr)m_victimOfPlayerCrime), false); if (m_crimeToReportOnPhone != CRIME_POSSESSION_GUN) FindPlayerPed()->m_pWanted->SetWantedLevelNoDrop(1); bRunningToPhone = false; } #endif if (CTimer::GetTimeInMilliseconds() <= m_phoneTalkTimer) return false; #ifdef PEDS_REPORT_CRIMES_ON_PHONE CAnimBlendAssociation* talkAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_PHONE_TALK); if (talkAssoc && talkAssoc->blendAmount > 0.5f) { CAnimBlendAssociation* endAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_PHONE_OUT, 8.0f); endAssoc->flags &= ~ASSOC_DELETEFADEDOUT; endAssoc->SetFinishCallback(ReportPhonePutDownCB, this); } #endif SetIdle(); gPhoneInfo.m_aPhones[m_phoneId].m_nState = PHONE_STATE_FREE; #ifndef PEDS_REPORT_CRIMES_ON_PHONE m_phoneId = -1; #endif // Because SetWanderPath is now done async in ReportPhonePutDownCB #ifdef PEDS_REPORT_CRIMES_ON_PHONE return false; #else return true; #endif } void CPed::Teleport(CVector pos) { CWorld::Remove(this); SetPosition(pos); bIsStanding = false; m_nPedStateTimer = 0; m_actionX = 0.0f; m_actionY = 0.0f; m_pDamageEntity = nil; CWorld::Add(this); } void CPed::SetSeekCar(CVehicle *car, uint32 doorNode) { if (m_nPedState == PED_SEEK_CAR) return; #ifdef VC_PED_PORTS if (!CanSetPedState() || m_nPedState == PED_DRIVING) return; #endif SetStoredState(); m_pSeekTarget = car; m_pSeekTarget->RegisterReference((CEntity**) &m_pSeekTarget); m_carInObjective = car; m_carInObjective->RegisterReference((CEntity**) &m_carInObjective); m_pMyVehicle = car; m_pMyVehicle->RegisterReference((CEntity**) &m_pMyVehicle); // m_pSeekTarget->RegisterReference((CEntity**) &m_pSeekTarget); m_vehDoor = doorNode; m_distanceToCountSeekDone = 0.5f; SetPedState(PED_SEEK_CAR); } void CPed::SeekCar(void) { CVehicle *vehToSeek = m_carInObjective; CVector dest(0.0f, 0.0f, 0.0f); if (!vehToSeek) { RestorePreviousState(); return; } if (m_objective != OBJECTIVE_ENTER_CAR_AS_PASSENGER) { if (m_vehDoor && m_objective != OBJECTIVE_ENTER_CAR_AS_DRIVER) { if (IsRoomToBeCarJacked()) { dest = GetPositionToOpenCarDoor(vehToSeek, m_vehDoor); } else if (m_nPedType == PEDTYPE_COP) { dest = GetPositionToOpenCarDoor(vehToSeek, CAR_DOOR_RF); } else { SetMoveState(PEDMOVE_STILL); } } else GetNearestDoor(vehToSeek, dest); } else { if (m_carJackTimer > CTimer::GetTimeInMilliseconds()) { SetMoveState(PEDMOVE_STILL); return; } if (vehToSeek->GetModelIndex() == MI_COACH) { GetNearestDoor(vehToSeek, dest); } else { if (vehToSeek->IsTrain()) { if (vehToSeek->GetStatus() != STATUS_TRAIN_NOT_MOVING) { RestorePreviousObjective(); RestorePreviousState(); return; } if (!GetNearestTrainDoor(vehToSeek, dest)) { RestorePreviousObjective(); RestorePreviousState(); return; } } else { if (!GetNearestPassengerDoor(vehToSeek, dest)) { if (vehToSeek->m_nNumPassengers == vehToSeek->m_nNumMaxPassengers) { RestorePreviousObjective(); RestorePreviousState(); } else { SetMoveState(PEDMOVE_STILL); } bVehEnterDoorIsBlocked = true; return; } bVehEnterDoorIsBlocked = false; } } } if (dest.x == 0.0f && dest.y == 0.0f) { #ifdef FIX_BUGS if ((!IsPlayer() && CharCreatedBy != MISSION_CHAR) || vehToSeek->VehicleCreatedBy != MISSION_VEHICLE || vehToSeek->pDriver || !vehToSeek->CanPedOpenLocks(this)) { #else if ((!IsPlayer() && CharCreatedBy != MISSION_CHAR) || vehToSeek->VehicleCreatedBy != MISSION_VEHICLE || vehToSeek->pDriver) { #endif RestorePreviousState(); if (IsPlayer()) { ClearObjective(); } else if (CharCreatedBy == RANDOM_CHAR) { m_carJackTimer = CTimer::GetTimeInMilliseconds() + 30000; } SetMoveState(PEDMOVE_STILL); TheCamera.ClearPlayerWeaponMode(); CCarCtrl::RemoveFromInterestingVehicleList(vehToSeek); return; } dest = vehToSeek->GetPosition(); if (bCollidedWithMyVehicle) { WarpPedIntoCar(m_pMyVehicle); return; } } bool foundBetterPosToSeek = PossiblyFindBetterPosToSeekCar(&dest, vehToSeek); m_vecSeekPos = dest; float distToDestSqr = (m_vecSeekPos - GetPosition()).MagnitudeSqr(); #ifndef VC_PED_PORTS if (bIsRunning) SetMoveState(PEDMOVE_RUN); #else if (bIsRunning || vehToSeek->pDriver && distToDestSqr > sq(2.0f) && (Abs(vehToSeek->m_vecMoveSpeed.x) > 0.01f || Abs(vehToSeek->m_vecMoveSpeed.y) > 0.01f)) SetMoveState(PEDMOVE_RUN); #endif else if (distToDestSqr < sq(2.0f)) SetMoveState(PEDMOVE_WALK); if (distToDestSqr >= 1.0f) bCanPedEnterSeekedCar = false; else if (2.0f * vehToSeek->GetColModel()->boundingBox.max.x > distToDestSqr) bCanPedEnterSeekedCar = true; if (vehToSeek->m_nGettingInFlags & GetCarDoorFlag(m_vehDoor)) bVehEnterDoorIsBlocked = true; else bVehEnterDoorIsBlocked = false; // Arrived to the car if (Seek()) { if (!foundBetterPosToSeek) { if (1.5f + GetPosition().z > dest.z && GetPosition().z - 0.5f < dest.z) { if (vehToSeek->IsTrain()) { SetEnterTrain(vehToSeek, m_vehDoor); } else { m_fRotationCur = m_fRotationDest; if (!bVehEnterDoorIsBlocked) { vehToSeek->SetIsStatic(false); if (m_objective == OBJECTIVE_SOLICIT_VEHICLE) { SetSolicit(1000); } else if (m_objective == OBJECTIVE_BUY_ICE_CREAM) { SetBuyIceCream(); } else if (vehToSeek->m_nNumGettingIn < vehToSeek->m_nNumMaxPassengers + 1 && vehToSeek->CanPedEnterCar()) { switch (vehToSeek->GetStatus()) { case STATUS_PLAYER: case STATUS_SIMPLE: case STATUS_PHYSICS: case STATUS_PLAYER_DISABLED: if (!vehToSeek->bIsBus && (!m_leader || m_leader != vehToSeek->pDriver) && (m_vehDoor == CAR_DOOR_LF && vehToSeek->pDriver || m_vehDoor == CAR_DOOR_RF && vehToSeek->pPassengers[0] || m_vehDoor == CAR_DOOR_LR && vehToSeek->pPassengers[1] || m_vehDoor == CAR_DOOR_RR && vehToSeek->pPassengers[2])) { SetCarJack(vehToSeek); if (m_objective == OBJECTIVE_ENTER_CAR_AS_DRIVER && m_vehDoor != CAR_DOOR_LF) vehToSeek->pDriver->bFleeAfterExitingCar = true; } else { SetEnterCar(vehToSeek, m_vehDoor); } break; case STATUS_ABANDONED: if (m_vehDoor == CAR_DOOR_RF && vehToSeek->pPassengers[0]) { if (vehToSeek->pPassengers[0]->bDontDragMeOutCar) { if (IsPlayer()) SetEnterCar(vehToSeek, m_vehDoor); } else { SetCarJack(vehToSeek); } } else { SetEnterCar(vehToSeek, m_vehDoor); } break; case STATUS_WRECKED: SetIdle(); break; default: return; } } else { RestorePreviousState(); } } else { SetMoveState(PEDMOVE_STILL); } } } } } } bool CPed::CheckForExplosions(CVector2D &area) { int event = 0; if (CEventList::FindClosestEvent(EVENT_EXPLOSION, GetPosition(), &event)) { area.x = gaEvent[event].posn.x; area.y = gaEvent[event].posn.y; CEntity *actualEntity = nil; switch (gaEvent[event].entityType) { case EVENT_ENTITY_PED: actualEntity = CPools::GetPed(gaEvent[event].entityRef); break; case EVENT_ENTITY_VEHICLE: actualEntity = CPools::GetVehicle(gaEvent[event].entityRef); break; case EVENT_ENTITY_OBJECT: actualEntity = CPools::GetObject(gaEvent[event].entityRef); break; default: break; } if (actualEntity) { m_pEventEntity = actualEntity; m_pEventEntity->RegisterReference((CEntity **) &m_pEventEntity); bGonnaInvestigateEvent = true; } else bGonnaInvestigateEvent = false; CEventList::ClearEvent(event); return true; } else if (CEventList::FindClosestEvent(EVENT_FIRE, GetPosition(), &event)) { area.x = gaEvent[event].posn.x; area.y = gaEvent[event].posn.y; CEventList::ClearEvent(event); bGonnaInvestigateEvent = false; return true; } bGonnaInvestigateEvent = false; return false; } CPed * CPed::CheckForGunShots(void) { int event; if (CEventList::FindClosestEvent(EVENT_GUNSHOT, GetPosition(), &event)) { if (gaEvent[event].entityType == EVENT_ENTITY_PED) { // Probably due to we don't want peds to go gunshot area? (same on VC) bGonnaInvestigateEvent = false; return CPools::GetPed(gaEvent[event].entityRef); } } bGonnaInvestigateEvent = false; return nil; } CPed * CPed::CheckForDeadPeds(void) { int event; if (CEventList::FindClosestEvent(EVENT_DEAD_PED, GetPosition(), &event)) { int pedHandle = gaEvent[event].entityRef; if (pedHandle && gaEvent[event].entityType == EVENT_ENTITY_PED) { bGonnaInvestigateEvent = true; return CPools::GetPed(pedHandle); } } bGonnaInvestigateEvent = false; return nil; } bool CPed::IsPlayer(void) const { return m_nPedType == PEDTYPE_PLAYER1 || m_nPedType == PEDTYPE_PLAYER2 || m_nPedType == PEDTYPE_PLAYER3 || m_nPedType == PEDTYPE_PLAYER4; } bool CPed::IsGangMember(void) const { return m_nPedType >= PEDTYPE_GANG1 && m_nPedType <= PEDTYPE_GANG9; } bool CPed::IsPointerValid(void) { int pedIndex = CPools::GetPedPool()->GetIndex(this) >> 8; if (pedIndex < 0 || pedIndex >= NUMPEDS) return false; if (m_entryInfoList.first || FindPlayerPed() == this) return true; return false; } void CPed::SetPedPositionInCar(void) { if (CReplay::IsPlayingBack()) return; if (bChangedSeat) { bool notYet = false; if (RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_CAR_GET_IN_LHS) || RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_CAR_GET_IN_LO_LHS) || RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_CAR_CLOSE_DOOR_LHS) || RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_CAR_CLOSE_DOOR_LO_LHS) || RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_CAR_SHUFFLE_RHS) || RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_CAR_SHUFFLE_LO_RHS) || RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_VAN_CLOSE_DOOR_REAR_LHS) || RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_VAN_CLOSE_DOOR_REAR_RHS) || RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_VAN_GET_IN_REAR_LHS) || RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_VAN_GET_IN_REAR_RHS) || RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_COACH_GET_IN_LHS) || RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_COACH_GET_IN_RHS)) { notYet = true; } if (notYet) { LineUpPedWithCar(LINE_UP_TO_CAR_START); bChangedSeat = false; return; } } CVehicleModelInfo *vehModel = (CVehicleModelInfo *)CModelInfo::GetModelInfo(m_pMyVehicle->GetModelIndex()); CMatrix newMat(m_pMyVehicle->GetMatrix()); CVector seatPos; if (m_pMyVehicle->pDriver == this) { seatPos = vehModel->GetFrontSeatPosn(); if (!m_pMyVehicle->IsBoat() && m_pMyVehicle->m_vehType != VEHICLE_TYPE_BIKE) seatPos.x = -seatPos.x; } else if (m_pMyVehicle->pPassengers[0] == this) { seatPos = vehModel->GetFrontSeatPosn(); } else if (m_pMyVehicle->pPassengers[1] == this) { seatPos = vehModel->m_positions[CAR_POS_BACKSEAT]; seatPos.x = -seatPos.x; } else { if (m_pMyVehicle->pPassengers[2] == this) { seatPos = vehModel->m_positions[CAR_POS_BACKSEAT]; } else { seatPos = vehModel->GetFrontSeatPosn(); } } newMat.GetPosition() += Multiply3x3(newMat, seatPos); // Already done below (SetTranslate(0.0f, 0.0f, 0.0f)) // tempMat.SetUnity(); // Rear seats on vans don't face to front, so rotate them HALFPI. if (m_pMyVehicle->bIsVan) { CMatrix tempMat; if (m_pMyVehicle->pPassengers[1] == this) { m_fRotationCur = m_pMyVehicle->GetForward().Heading() - HALFPI; tempMat.SetTranslate(0.0f, 0.0f, 0.0f); tempMat.RotateZ(-HALFPI); newMat = newMat * tempMat; } else if (m_pMyVehicle->pPassengers[2] == this) { m_fRotationCur = m_pMyVehicle->GetForward().Heading() + HALFPI; tempMat.SetTranslate(0.0f, 0.0f, 0.0f); tempMat.RotateZ(HALFPI); newMat = newMat * tempMat; } else { m_fRotationCur = m_pMyVehicle->GetForward().Heading(); } } else { m_fRotationCur = m_pMyVehicle->GetForward().Heading(); } GetMatrix() = newMat; } void CPed::LookForSexyPeds(void) { if ((!IsPedInControl() && m_nPedState != PED_DRIVING) || m_lookTimer >= CTimer::GetTimeInMilliseconds() || m_nPedType != PEDTYPE_CIVMALE) return; for (int i = 0; i < m_numNearPeds; i++) { if (CanSeeEntity(m_nearPeds[i])) { if ((GetPosition() - m_nearPeds[i]->GetPosition()).Magnitude() < 10.0f) { CPed *nearPed = m_nearPeds[i]; if ((nearPed->m_pedStats->m_sexiness > m_pedStats->m_sexiness) && nearPed->m_nPedType == PEDTYPE_CIVFEMALE) { SetLookFlag(nearPed, true); m_lookTimer = CTimer::GetTimeInMilliseconds() + 4000; Say(SOUND_PED_CHAT_SEXY); return; } } } } m_lookTimer = CTimer::GetTimeInMilliseconds() + 10000; } void CPed::LookForSexyCars(void) { CEntity *vehicles[8]; CVehicle *veh; int foundVehId = 0; int bestPriceYet = 0; int16 lastVehicle; if (!IsPedInControl() && m_nPedState != PED_DRIVING) return; if (m_lookTimer < CTimer::GetTimeInMilliseconds()) { CWorld::FindObjectsInRange(GetPosition(), 10.0f, true, &lastVehicle, 6, vehicles, false, true, false, false, false); for (int vehId = 0; vehId < lastVehicle; vehId++) { veh = (CVehicle*)vehicles[vehId]; if (veh != m_pMyVehicle && bestPriceYet < veh->pHandling->nMonetaryValue) { foundVehId = vehId; bestPriceYet = veh->pHandling->nMonetaryValue; } } if (lastVehicle > 0 && bestPriceYet > 40000) SetLookFlag(vehicles[foundVehId], false); m_lookTimer = CTimer::GetTimeInMilliseconds() + 10000; } } bool CPed::LookForInterestingNodes(void) { CBaseModelInfo *model; CPtrNode *ptrNode; CVector effectDist; C2dEffect *effect; CMatrix *objMat; if ((CTimer::GetFrameCounter() + (m_randomSeed % 256)) & 7 || CTimer::GetTimeInMilliseconds() <= m_chatTimer) { return false; } bool found = false; uint8 randVal = CGeneral::GetRandomNumber() % 256; int minX = CWorld::GetSectorIndexX(GetPosition().x - CHECK_NEARBY_THINGS_MAX_DIST); if (minX < 0) minX = 0; int minY = CWorld::GetSectorIndexY(GetPosition().y - CHECK_NEARBY_THINGS_MAX_DIST); if (minY < 0) minY = 0; int maxX = CWorld::GetSectorIndexX(GetPosition().x + CHECK_NEARBY_THINGS_MAX_DIST); #ifdef FIX_BUGS if (maxX >= NUMSECTORS_X) maxX = NUMSECTORS_X - 1; #else if (maxX >= NUMSECTORS_X) maxX = NUMSECTORS_X; #endif int maxY = CWorld::GetSectorIndexY(GetPosition().y + CHECK_NEARBY_THINGS_MAX_DIST); #ifdef FIX_BUGS if (maxY >= NUMSECTORS_Y) maxY = NUMSECTORS_Y - 1; #else if (maxY >= NUMSECTORS_Y) maxY = NUMSECTORS_Y; #endif for (int curY = minY; curY <= maxY && !found; curY++) { for (int curX = minX; curX <= maxX && !found; curX++) { CSector *sector = CWorld::GetSector(curX, curY); for (ptrNode = sector->m_lists[ENTITYLIST_VEHICLES].first; ptrNode && !found; ptrNode = ptrNode->next) { CVehicle *veh = (CVehicle*)ptrNode->item; model = veh->GetModelInfo(); if (model->GetNum2dEffects() != 0) { for (int e = 0; e < model->GetNum2dEffects(); e++) { effect = model->Get2dEffect(e); if (effect->type == EFFECT_ATTRACTOR && effect->attractor.probability >= randVal) { objMat = &veh->GetMatrix(); CVector effectPos = veh->GetMatrix() * effect->pos; effectDist = effectPos - GetPosition(); if (effectDist.MagnitudeSqr() < sq(8.0f)) { found = true; break; } } } } } for (ptrNode = sector->m_lists[ENTITYLIST_OBJECTS].first; ptrNode && !found; ptrNode = ptrNode->next) { CObject *obj = (CObject*)ptrNode->item; model = CModelInfo::GetModelInfo(obj->GetModelIndex()); if (model->GetNum2dEffects() != 0) { for (int e = 0; e < model->GetNum2dEffects(); e++) { effect = model->Get2dEffect(e); if (effect->type == EFFECT_ATTRACTOR && effect->attractor.probability >= randVal) { objMat = &obj->GetMatrix(); CVector effectPos = obj->GetMatrix() * effect->pos; effectDist = effectPos - GetPosition(); if (effectDist.MagnitudeSqr() < sq(8.0f)) { found = true; break; } } } } } for (ptrNode = sector->m_lists[ENTITYLIST_BUILDINGS].first; ptrNode && !found; ptrNode = ptrNode->next) { CBuilding *building = (CBuilding*)ptrNode->item; model = CModelInfo::GetModelInfo(building->GetModelIndex()); if (model->GetNum2dEffects() != 0) { for (int e = 0; e < model->GetNum2dEffects(); e++) { effect = model->Get2dEffect(e); if (effect->type == EFFECT_ATTRACTOR && effect->attractor.probability >= randVal) { objMat = &building->GetMatrix(); CVector effectPos = building->GetMatrix() * effect->pos; effectDist = effectPos - GetPosition(); if (effectDist.MagnitudeSqr() < sq(8.0f)) { found = true; break; } } } } } for (ptrNode = sector->m_lists[ENTITYLIST_BUILDINGS_OVERLAP].first; ptrNode && !found; ptrNode = ptrNode->next) { CBuilding *building = (CBuilding*)ptrNode->item; model = CModelInfo::GetModelInfo(building->GetModelIndex()); if (model->GetNum2dEffects() != 0) { for (int e = 0; e < model->GetNum2dEffects(); e++) { effect = model->Get2dEffect(e); if (effect->type == EFFECT_ATTRACTOR && effect->attractor.probability >= randVal) { objMat = &building->GetMatrix(); CVector effectPos = building->GetMatrix() * effect->pos; effectDist = effectPos - GetPosition(); if (effectDist.MagnitudeSqr() < sq(8.0f)) { found = true; break; } } } } } } } if (!found) return false; CVector effectFrontLocal = Multiply3x3(*objMat, effect->attractor.dir); float angleToFace = CGeneral::GetRadianAngleBetweenPoints(effectFrontLocal.x, effectFrontLocal.y, 0.0f, 0.0f); randVal = CGeneral::GetRandomNumber() % 256; if (randVal <= m_randomSeed % 256) { m_chatTimer = CTimer::GetTimeInMilliseconds() + 2000; SetLookFlag(angleToFace, true); SetLookTimer(1000); return false; } CVector2D effectPos = *objMat * effect->pos; switch (effect->attractor.type) { case ATTRACTORTYPE_ICECREAM: SetInvestigateEvent(EVENT_ICECREAM, effectPos, 0.1f, 15000, angleToFace); break; case ATTRACTORTYPE_STARE: SetInvestigateEvent(EVENT_SHOPSTALL, effectPos, 1.0f, CGeneral::GetRandomNumberInRange(8000, 10 * effect->attractor.probability + 8500), angleToFace); break; default: return true; } return true; } void CPed::SetWaitState(eWaitState state, void *time) { AnimationId waitAnim = ANIM_STD_NUM; CAnimBlendAssociation *animAssoc; if (!IsPedInControl()) return; if (state != m_nWaitState) FinishedWaitCB(nil, this); switch (state) { case WAITSTATE_TRAFFIC_LIGHTS: m_nWaitTimer = CTimer::GetTimeInMilliseconds() + 500; SetMoveState(PEDMOVE_STILL); break; case WAITSTATE_CROSS_ROAD: m_nWaitTimer = CTimer::GetTimeInMilliseconds() + 1000; CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_IDLE_HBHB, 4.0f); break; case WAITSTATE_CROSS_ROAD_LOOK: CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_ROADCROSS, 8.0f); if (time) m_nWaitTimer = CTimer::GetTimeInMilliseconds() + *(int*)time; else m_nWaitTimer = CTimer::GetTimeInMilliseconds() + CGeneral::GetRandomNumberInRange(2000,5000); break; case WAITSTATE_LOOK_PED: case WAITSTATE_LOOK_SHOP: case WAITSTATE_LOOK_ACCIDENT: case WAITSTATE_FACEOFF_GANG: break; case WAITSTATE_DOUBLEBACK: m_headingRate = 0.0f; m_nWaitTimer = CTimer::GetTimeInMilliseconds() + 3500; animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_IDLE_HBHB, 4.0f); #ifdef FIX_BUGS animAssoc->SetFinishCallback(RestoreHeadingRateCB, this); #endif break; case WAITSTATE_HITWALL: m_headingRate = 2.0f; m_nWaitTimer = CTimer::GetTimeInMilliseconds() + 5000; animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_HIT_WALL, 16.0f); animAssoc->flags |= ASSOC_DELETEFADEDOUT; animAssoc->flags |= ASSOC_FADEOUTWHENDONE; animAssoc->SetDeleteCallback(FinishedWaitCB, this); if (m_objective == OBJECTIVE_ENTER_CAR_AS_PASSENGER && CharCreatedBy == RANDOM_CHAR && m_nPedState == PED_SEEK_CAR) { ClearObjective(); RestorePreviousState(); m_carJackTimer = CTimer::GetTimeInMilliseconds() + 30000; } break; case WAITSTATE_TURN180: m_headingRate = 0.0f; m_nWaitTimer = CTimer::GetTimeInMilliseconds() + 5000; animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_TURN180, 4.0f); animAssoc->SetFinishCallback(FinishedWaitCB, this); animAssoc->SetDeleteCallback(RestoreHeadingRateCB, this); break; case WAITSTATE_SURPRISE: m_headingRate = 0.0f; m_nWaitTimer = CTimer::GetTimeInMilliseconds() + 2000; animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_HIT_WALL, 4.0f); animAssoc->SetFinishCallback(FinishedWaitCB, this); break; case WAITSTATE_STUCK: SetMoveState(PEDMOVE_STILL); SetMoveAnim(); m_headingRate = 0.0f; m_nWaitTimer = CTimer::GetTimeInMilliseconds() + 5000; animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_IDLE_TIRED, 4.0f); #ifdef FIX_BUGS animAssoc->SetFinishCallback(RestoreHeadingRateCB, this); #endif if (m_objective == OBJECTIVE_ENTER_CAR_AS_PASSENGER && CharCreatedBy == RANDOM_CHAR && m_nPedState == PED_SEEK_CAR) { ClearObjective(); RestorePreviousState(); m_carJackTimer = CTimer::GetTimeInMilliseconds() + 30000; } break; case WAITSTATE_LOOK_ABOUT: SetMoveState(PEDMOVE_STILL); SetMoveAnim(); m_headingRate = 0.0f; m_nWaitTimer = CTimer::GetTimeInMilliseconds() + 5000; animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_IDLE_HBHB, 4.0f); #ifdef FIX_BUGS animAssoc->SetFinishCallback(RestoreHeadingRateCB, this); #endif break; case WAITSTATE_PLAYANIM_COWER: waitAnim = ANIM_STD_HANDSCOWER; case WAITSTATE_PLAYANIM_HANDSUP: if (waitAnim == ANIM_STD_NUM) waitAnim = ANIM_STD_HANDSUP; case WAITSTATE_PLAYANIM_HANDSCOWER: if (waitAnim == ANIM_STD_NUM) waitAnim = ANIM_STD_HANDSCOWER; m_headingRate = 0.0f; if (time) m_nWaitTimer = CTimer::GetTimeInMilliseconds() + *(int*)time; else m_nWaitTimer = CTimer::GetTimeInMilliseconds() + 3000; animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, waitAnim, 4.0f); animAssoc->SetDeleteCallback(FinishedWaitCB, this); break; case WAITSTATE_PLAYANIM_DUCK: waitAnim = ANIM_STD_DUCK_DOWN; case WAITSTATE_PLAYANIM_TAXI: if (waitAnim == ANIM_STD_NUM) waitAnim = ANIM_STD_HAILTAXI; case WAITSTATE_PLAYANIM_CHAT: if (waitAnim == ANIM_STD_NUM) waitAnim = ANIM_STD_CHAT; if (time) m_nWaitTimer = CTimer::GetTimeInMilliseconds() + *(int*)time; else m_nWaitTimer = CTimer::GetTimeInMilliseconds() + 3000; animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, waitAnim, 4.0f); animAssoc->flags &= ~ASSOC_FADEOUTWHENDONE; animAssoc->flags |= ASSOC_DELETEFADEDOUT; animAssoc->SetDeleteCallback(FinishedWaitCB, this); break; case WAITSTATE_FINISH_FLEE: SetMoveState(PEDMOVE_STILL); SetMoveAnim(); m_headingRate = 0.0f; m_nWaitTimer = CTimer::GetTimeInMilliseconds() + 2500; animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_IDLE_TIRED, 4.0f); #ifdef FIX_BUGS animAssoc->SetFinishCallback(RestoreHeadingRateCB, this); #endif break; default: m_nWaitState = WAITSTATE_FALSE; RestoreHeadingRate(); return; } m_nWaitState = state; } void CPed::Wait(void) { AnimationId mustHaveAnim = ANIM_STD_NUM; CAnimBlendAssociation *animAssoc; CPed *pedWeLook; if (DyingOrDead()) { m_nWaitState = WAITSTATE_FALSE; RestoreHeadingRate(); return; } switch (m_nWaitState) { case WAITSTATE_TRAFFIC_LIGHTS: if (CTimer::GetTimeInMilliseconds() > m_nWaitTimer) { if (CTrafficLights::LightForPeds() == PED_LIGHTS_WALK) { m_nWaitState = WAITSTATE_FALSE; SetMoveState(PEDMOVE_WALK); } } break; case WAITSTATE_CROSS_ROAD: if (CTimer::GetTimeInMilliseconds() > m_nWaitTimer) { if (CGeneral::GetRandomNumber() & 1 || !m_nWaitTimer) m_nWaitState = WAITSTATE_FALSE; else SetWaitState(WAITSTATE_CROSS_ROAD_LOOK, nil); animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_IDLE_HBHB); if (animAssoc) { animAssoc->blendDelta = -8.0f; animAssoc->flags |= ASSOC_DELETEFADEDOUT; } } break; case WAITSTATE_CROSS_ROAD_LOOK: if (CTimer::GetTimeInMilliseconds() > m_nWaitTimer) { m_nWaitState = WAITSTATE_FALSE; animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_ROADCROSS); if (animAssoc) { animAssoc->blendDelta = -8.0f; animAssoc->flags |= ASSOC_DELETEFADEDOUT; } } break; case WAITSTATE_DOUBLEBACK: if (CTimer::GetTimeInMilliseconds() <= m_nWaitTimer) { uint32 timeLeft = m_nWaitTimer - CTimer::GetTimeInMilliseconds(); if (timeLeft < 2500 && timeLeft > 2000) { m_nWaitTimer -= 500; CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_XPRESS_SCRATCH, 4.0f); } } else { m_nWaitState = WAITSTATE_FALSE; SetMoveState(PEDMOVE_WALK); } break; case WAITSTATE_HITWALL: if (CTimer::GetTimeInMilliseconds() <= m_nWaitTimer) { if (m_collidingThingTimer > CTimer::GetTimeInMilliseconds()) { m_collidingThingTimer = CTimer::GetTimeInMilliseconds() + 2500; } } else { m_nWaitState = WAITSTATE_FALSE; } break; case WAITSTATE_TURN180: if (CTimer::GetTimeInMilliseconds() > m_nWaitTimer) { m_nWaitState = WAITSTATE_FALSE; SetMoveState(PEDMOVE_WALK); m_fRotationCur = m_fRotationCur + PI; if (m_nPedState == PED_INVESTIGATE) ClearInvestigateEvent(); } if (m_collidingThingTimer > CTimer::GetTimeInMilliseconds()) { m_collidingThingTimer = CTimer::GetTimeInMilliseconds() + 2500; } break; case WAITSTATE_SURPRISE: if (CTimer::GetTimeInMilliseconds() > m_nWaitTimer) { if (RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_HIT_WALL)) { animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_XPRESS_SCRATCH, 4.0f); animAssoc->SetFinishCallback(FinishedWaitCB, this); m_nWaitTimer = CTimer::GetTimeInMilliseconds() + 5000; } else { m_nWaitState = WAITSTATE_FALSE; } } break; case WAITSTATE_STUCK: if (CTimer::GetTimeInMilliseconds() <= m_nWaitTimer) break; animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_IDLE_TIRED); if (!animAssoc) animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_TURN180); if (!animAssoc) animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_XPRESS_SCRATCH); if (!animAssoc) animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_ROADCROSS); if (animAssoc) { if (animAssoc->IsPartial()) { animAssoc->blendDelta = -8.0f; animAssoc->flags |= ASSOC_DELETEFADEDOUT; } else { animAssoc->flags |= ASSOC_DELETEFADEDOUT; CAnimManager::BlendAnimation(GetClump(), m_animGroup, ANIM_STD_IDLE, 4.0f); } if (animAssoc->animId == ANIM_STD_TURN180) { m_fRotationCur = CGeneral::LimitRadianAngle(PI + m_fRotationCur); m_nWaitState = WAITSTATE_FALSE; SetMoveState(PEDMOVE_WALK); m_nStoredMoveState = PEDMOVE_NONE; m_panicCounter = 0; return; } } AnimationId animToPlay; switch (CGeneral::GetRandomNumber() & 3) { case 0: animToPlay = ANIM_STD_ROADCROSS; break; case 1: animToPlay = ANIM_STD_IDLE_TIRED; break; case 2: animToPlay = ANIM_STD_XPRESS_SCRATCH; break; case 3: animToPlay = ANIM_STD_TURN180; break; default: break; } animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, animToPlay, 4.0f); if (animToPlay == ANIM_STD_TURN180) animAssoc->SetFinishCallback(FinishedWaitCB, this); m_nWaitTimer = CTimer::GetTimeInMilliseconds() + CGeneral::GetRandomNumberInRange(1500, 5000); break; case WAITSTATE_LOOK_ABOUT: if (CTimer::GetTimeInMilliseconds() > m_nWaitTimer) { m_nWaitState = WAITSTATE_FALSE; animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_IDLE_HBHB); if (animAssoc) { animAssoc->blendDelta = -8.0f; animAssoc->flags |= ASSOC_DELETEFADEDOUT; } } break; case WAITSTATE_PLAYANIM_HANDSUP: mustHaveAnim = ANIM_STD_HANDSUP; case WAITSTATE_PLAYANIM_HANDSCOWER: if (mustHaveAnim == ANIM_STD_NUM) mustHaveAnim = ANIM_STD_HANDSCOWER; animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), mustHaveAnim); pedWeLook = (CPed*) m_pLookTarget; if ((!m_pLookTarget || !m_pLookTarget->IsPed() || pedWeLook->m_pPointGunAt) && m_nPedState != PED_FLEE_ENTITY && m_nPedState != PED_ATTACK && CTimer::GetTimeInMilliseconds() <= m_nWaitTimer && animAssoc) { TurnBody(); } else { m_nWaitState = WAITSTATE_FALSE; m_nWaitTimer = 0; if (m_pLookTarget && m_pLookTarget->IsPed()) { if (m_nPedState != PED_FLEE_ENTITY && m_nPedState != PED_ATTACK) { if (m_pedStats->m_fear <= 100 - pedWeLook->m_pedStats->m_temper) { if (GetWeapon()->IsTypeMelee()) { #ifdef VC_PED_PORTS if(m_pedStats->m_flags & STAT_GUN_PANIC) { #endif SetObjective(OBJECTIVE_FLEE_CHAR_ON_FOOT_TILL_SAFE, m_pLookTarget); if (m_nPedState == PED_FLEE_ENTITY || m_nPedState == PED_FLEE_POS) { bUsePedNodeSeek = true; m_pNextPathNode = nil; } if (m_nMoveState != PEDMOVE_RUN) SetMoveState(PEDMOVE_WALK); if (m_nPedType != PEDTYPE_COP) { ProcessObjective(); SetMoveState(PEDMOVE_WALK); } #ifdef VC_PED_PORTS } else { SetObjective(OBJECTIVE_NONE); SetWanderPath(CGeneral::GetRandomNumberInRange(0.0f, 8.0f)); } #endif } else { SetObjective(OBJECTIVE_KILL_CHAR_ON_FOOT, m_pLookTarget); SetObjectiveTimer(20000); } } else { SetObjective(OBJECTIVE_FLEE_CHAR_ON_FOOT_TILL_SAFE, m_pLookTarget); if (m_nPedState == PED_FLEE_ENTITY || m_nPedState == PED_FLEE_POS) { bUsePedNodeSeek = true; m_pNextPathNode = nil; } SetMoveState(PEDMOVE_RUN); Say(SOUND_PED_FLEE_RUN); } } } animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), mustHaveAnim); if (animAssoc) { animAssoc->blendDelta = -4.0f; animAssoc->flags |= ASSOC_DELETEFADEDOUT; } } break; case WAITSTATE_PLAYANIM_COWER: mustHaveAnim = ANIM_STD_HANDSCOWER; case WAITSTATE_PLAYANIM_DUCK: if (mustHaveAnim == ANIM_STD_NUM) mustHaveAnim = ANIM_STD_DUCK_DOWN; case WAITSTATE_PLAYANIM_TAXI: if (mustHaveAnim == ANIM_STD_NUM) mustHaveAnim = ANIM_STD_HAILTAXI; case WAITSTATE_PLAYANIM_CHAT: if (mustHaveAnim == ANIM_STD_NUM) mustHaveAnim = ANIM_STD_CHAT; if (CTimer::GetTimeInMilliseconds() > m_nWaitTimer) { animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), mustHaveAnim); if (animAssoc) { animAssoc->blendDelta = -4.0f; animAssoc->flags |= ASSOC_DELETEFADEDOUT; } m_nWaitState = WAITSTATE_FALSE; } #ifdef VC_PED_PORTS else if (m_nWaitState == WAITSTATE_PLAYANIM_TAXI) { if (m_pedInObjective) { if (m_objective == OBJECTIVE_GOTO_CHAR_ON_FOOT || m_objective == OBJECTIVE_KILL_CHAR_ON_FOOT) { // VC also calls CleanUpOldReference here for old LookTarget. m_pLookTarget = m_pedInObjective; m_pLookTarget->RegisterReference((CEntity **) &m_pLookTarget); TurnBody(); } } } #endif break; case WAITSTATE_FINISH_FLEE: animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_IDLE_TIRED); if (animAssoc) { if (CTimer::GetTimeInMilliseconds() > m_nWaitTimer) { animAssoc->flags |= ASSOC_DELETEFADEDOUT; CAnimManager::BlendAnimation(GetClump(), m_animGroup, ANIM_STD_IDLE, 4.0f); int timer = 2000; m_nWaitState = WAITSTATE_FALSE; SetWaitState(WAITSTATE_CROSS_ROAD_LOOK, &timer); } } else { m_nWaitState = WAITSTATE_FALSE; } break; default: break; } if(!m_nWaitState) RestoreHeadingRate(); } void CPed::FinishedWaitCB(CAnimBlendAssociation *animAssoc, void *arg) { CPed *ped = (CPed*)arg; ped->m_nWaitTimer = 0; ped->RestoreHeadingRate(); ped->Wait(); } void CPed::RestoreHeadingRate(void) { m_headingRate = m_pedStats->m_headingChangeRate; } void CPed::RestoreHeadingRateCB(CAnimBlendAssociation *assoc, void *arg) { ((CPed*)arg)->m_headingRate = ((CPed*)arg)->m_pedStats->m_headingChangeRate; } void CPed::FlagToDestroyWhenNextProcessed(void) { bRemoveFromWorld = true; if (!InVehicle()) return; if (m_pMyVehicle->pDriver == this){ m_pMyVehicle->pDriver = nil; if (IsPlayer() && m_pMyVehicle->GetStatus() != STATUS_WRECKED) m_pMyVehicle->SetStatus(STATUS_ABANDONED); }else{ m_pMyVehicle->RemovePassenger(this); } bInVehicle = false; m_pMyVehicle = nil; if (CharCreatedBy == MISSION_CHAR) SetPedState(PED_DEAD); else SetPedState(PED_NONE); m_pVehicleAnim = nil; } void CPed::SetSolicit(uint32 time) { if (m_nPedState == PED_SOLICIT || !IsPedInControl() || !m_carInObjective) return; if (CharCreatedBy != MISSION_CHAR && m_carInObjective->m_nNumGettingIn == 0 && CTimer::GetTimeInMilliseconds() < m_objectiveTimer) { if (m_vehDoor == CAR_DOOR_LF) { m_fRotationDest = m_carInObjective->GetForward().Heading() - HALFPI; } else { m_fRotationDest = m_carInObjective->GetForward().Heading() + HALFPI; } if (Abs(m_fRotationDest - m_fRotationCur) < HALFPI) { m_chatTimer = CTimer::GetTimeInMilliseconds() + time; if(!m_carInObjective->bIsVan && !m_carInObjective->bIsBus) m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_CAR_HOOKERTALK, 4.0f); SetPedState(PED_SOLICIT); } } } void CPed::Solicit(void) { if (m_chatTimer >= CTimer::GetTimeInMilliseconds() && m_carInObjective) { CVector doorPos = GetPositionToOpenCarDoor(m_carInObjective, m_vehDoor, 0.0f); SetMoveState(PEDMOVE_STILL); // Game uses GetAngleBetweenPoints and converts it to radian m_fRotationDest = CGeneral::GetRadianAngleBetweenPoints( doorPos.x, doorPos.y, GetPosition().x, GetPosition().y); if (m_fRotationDest < 0.0f) { m_fRotationDest = m_fRotationDest + TWOPI; } else if (m_fRotationDest > TWOPI) { m_fRotationDest = m_fRotationDest - TWOPI; } if ((GetPosition() - doorPos).MagnitudeSqr() <= 1.0f) return; CAnimBlendAssociation *talkAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_CAR_HOOKERTALK); if (talkAssoc) { talkAssoc->blendDelta = -1000.0f; talkAssoc->flags |= ASSOC_DELETEFADEDOUT; } RestorePreviousState(); RestorePreviousObjective(); SetObjectiveTimer(10000); } else if (!m_carInObjective) { RestorePreviousState(); RestorePreviousObjective(); SetObjectiveTimer(10000); } else if (CWorld::Players[CWorld::PlayerInFocus].m_nMoney <= 100) { m_carInObjective = nil; } else { m_pVehicleAnim = nil; SetLeader(m_carInObjective->pDriver); } } void CPed::SetBuyIceCream(void) { if (m_nPedState == PED_BUY_ICECREAM || !IsPedInControl()) return; if (!m_carInObjective) return; #ifdef FIX_ICECREAM // Simulating BuyIceCream CPed* driver = m_carInObjective->pDriver; if (driver) { SetPedState(PED_BUY_ICECREAM); bFindNewNodeAfterStateRestore = true; SetObjectiveTimer(8000); SetChat(driver, 8000); driver->SetChat(this, 8000); return; } #endif // Side of the Ice Cream van m_fRotationDest = m_carInObjective->GetForward().Heading() - HALFPI; if (Abs(m_fRotationDest - m_fRotationCur) < HALFPI) { m_chatTimer = CTimer::GetTimeInMilliseconds() + 3000; SetPedState(PED_BUY_ICECREAM); } } bool CPed::PossiblyFindBetterPosToSeekCar(CVector *pos, CVehicle *veh) { bool foundIt = false; CVector helperPos = GetPosition(); helperPos.z = pos->z - 0.5f; CVector foundPos = *pos; foundPos.z -= 0.5f; // If there is another car between target car and us. if (CWorld::TestSphereAgainstWorld((foundPos + helperPos) / 2.0f, 0.25f, veh, false, true, false, false, false, false)) { CColModel *vehCol = veh->GetModelInfo()->GetColModel(); CVector *colMin = &vehCol->boundingBox.min; CVector *colMax = &vehCol->boundingBox.max; CVector leftRearPos = CVector(colMin->x - 0.5f, colMin->y - 0.5f, 0.0f); CVector rightRearPos = CVector(0.5f + colMax->x, colMin->y - 0.5f, 0.0f); CVector leftFrontPos = CVector(colMin->x - 0.5f, 0.5f + colMax->y, 0.0f); CVector rightFrontPos = CVector(0.5f + colMax->x, 0.5f + colMax->y, 0.0f); leftRearPos = veh->GetMatrix() * leftRearPos; rightRearPos = veh->GetMatrix() * rightRearPos; leftFrontPos = veh->GetMatrix() * leftFrontPos; rightFrontPos = veh->GetMatrix() * rightFrontPos; // Makes helperPos veh-ped distance vector. helperPos -= veh->GetPosition(); // ?!? I think it's absurd to use this unless another function like SeekCar finds next pos. with it and we're trying to simulate it's behaviour. // On every run it returns another pos. for ped, with same distance to the veh. // Sequence of positions are not guaranteed, it depends on global pos. (So sometimes it returns positions to make ped draw circle, sometimes don't) helperPos = veh->GetMatrix() * helperPos; float vehForwardHeading = veh->GetForward().Heading(); // I'm absolutely not sure about these namings. // NTVF = needed turn if we're looking to vehicle front and wanna look to... float potentialLrHeading = Atan2(leftRearPos.x - helperPos.x, leftRearPos.y - helperPos.y); float NTVF_LR = CGeneral::LimitRadianAngle(potentialLrHeading - vehForwardHeading); float potentialRrHeading = Atan2(rightRearPos.x - helperPos.x, rightRearPos.y - helperPos.y); float NTVF_RR = CGeneral::LimitRadianAngle(potentialRrHeading - vehForwardHeading); float potentialLfHeading = Atan2(leftFrontPos.x - helperPos.x, leftFrontPos.y - helperPos.y); float NTVF_LF = CGeneral::LimitRadianAngle(potentialLfHeading - vehForwardHeading); float potentialRfHeading = Atan2(rightFrontPos.x - helperPos.x, rightFrontPos.y - helperPos.y); float NTVF_RF = CGeneral::LimitRadianAngle(potentialRfHeading - vehForwardHeading); bool canHeadToLr = NTVF_LR <= -PI || NTVF_LR >= -HALFPI; bool canHeadToRr = NTVF_RR <= HALFPI || NTVF_RR >= PI; bool canHeadToLf = NTVF_LF >= 0.0f || NTVF_LF <= -HALFPI; bool canHeadToRf = NTVF_RF <= 0.0f || NTVF_RF >= HALFPI; // Only order of conditions are different among enterTypes. if (m_vehDoor == CAR_DOOR_RR) { if (canHeadToRr) { foundPos = rightRearPos; foundIt = true; } else if (canHeadToRf) { foundPos = rightFrontPos; foundIt = true; } else if (canHeadToLr) { foundPos = leftRearPos; foundIt = true; } else if (canHeadToLf) { foundPos = leftFrontPos; foundIt = true; } } else if(m_vehDoor == CAR_DOOR_RF) { if (canHeadToRf) { foundPos = rightFrontPos; foundIt = true; } else if (canHeadToRr) { foundPos = rightRearPos; foundIt = true; } else if (canHeadToLf) { foundPos = leftFrontPos; foundIt = true; } else if (canHeadToLr) { foundPos = leftRearPos; foundIt = true; } } else if (m_vehDoor == CAR_DOOR_LF) { if (canHeadToLf) { foundPos = leftFrontPos; foundIt = true; } else if (canHeadToLr) { foundPos = leftRearPos; foundIt = true; } else if (canHeadToRf) { foundPos = rightFrontPos; foundIt = true; } else if (canHeadToRr) { foundPos = rightRearPos; foundIt = true; } } else if (m_vehDoor == CAR_DOOR_LR) { if (canHeadToLr) { foundPos = leftRearPos; foundIt = true; } else if (canHeadToLf) { foundPos = leftFrontPos; foundIt = true; } else if (canHeadToRr) { foundPos = rightRearPos; foundIt = true; } else if (canHeadToRf) { foundPos = rightFrontPos; foundIt = true; } } } if (!foundIt) return false; helperPos = GetPosition() - foundPos; helperPos.z = 0.0f; if (helperPos.MagnitudeSqr() <= sq(0.5f)) return false; pos->x = foundPos.x; pos->y = foundPos.y; return true; } void CPed::SetLeader(CEntity *leader) { m_leader = (CPed*)leader; if(m_leader) m_leader->RegisterReference((CEntity **)&m_leader); } #ifdef VC_PED_PORTS bool CPed::CanPedJumpThis(CEntity *unused, CVector *damageNormal) { if (m_nSurfaceTouched == SURFACE_WATER) return true; CVector pos = GetPosition(); CVector forwardOffset = GetForward(); if (damageNormal && damageNormal->z > 0.17f) { if (damageNormal->z > 0.9f) return false; CColModel *ourCol = CModelInfo::GetModelInfo(m_modelIndex)->GetColModel(); pos.z = ourCol->spheres->center.z - ourCol->spheres->radius * damageNormal->z + pos.z; pos.z = pos.z + 0.05f; float collPower = damageNormal->Magnitude2D(); if (damageNormal->z > 0.5f) { CVector invDamageNormal(-damageNormal->x, -damageNormal->y, 0.0f); invDamageNormal *= 1.0f / collPower; CVector estimatedJumpDist = invDamageNormal + collPower * invDamageNormal * ourCol->spheres->radius; forwardOffset = estimatedJumpDist * Min(2.0f / collPower, 4.0f); } else { forwardOffset += collPower * ourCol->spheres->radius * forwardOffset; } } else { pos.z -= 0.15f; } CVector forwardPos = pos + forwardOffset; return CWorld::GetIsLineOfSightClear(pos, forwardPos, true, false, false, true, false, false, false); } #else bool CPed::CanPedJumpThis(CEntity *unused) { CVector2D forward(-Sin(m_fRotationCur), Cos(m_fRotationCur)); CVector pos = GetPosition(); CVector forwardPos( forward.x + pos.x, forward.y + pos.y, pos.z); return CWorld::GetIsLineOfSightClear(pos, forwardPos, true, false, false, true, false, false, false); } #endif void CPed::SetJump(void) { if (!bInVehicle && #if defined VC_PED_PORTS || defined FIX_BUGS m_nPedState != PED_JUMP && !RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_JUMP_LAUNCH) && #endif (m_nSurfaceTouched != SURFACE_STEEP_CLIFF || DotProduct(GetForward(), m_vecDamageNormal) >= 0.0f)) { SetStoredState(); SetPedState(PED_JUMP); CAnimBlendAssociation *jumpAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_JUMP_LAUNCH, 8.0f); jumpAssoc->SetFinishCallback(FinishLaunchCB, this); m_fRotationDest = m_fRotationCur; } } void CPed::FinishLaunchCB(CAnimBlendAssociation *animAssoc, void *arg) { CPed *ped = (CPed*)arg; if (ped->m_nPedState != PED_JUMP) return; CVector forward(0.15f * ped->GetForward() + ped->GetPosition()); forward.z += CModelInfo::GetModelInfo(ped->GetModelIndex())->GetColModel()->spheres->center.z + 0.25f; CEntity *obstacle = CWorld::TestSphereAgainstWorld(forward, 0.25f, nil, true, true, false, true, false, false); if (!obstacle) { // Forward of forward forward += 0.15f * ped->GetForward(); forward.z += 0.15f; obstacle = CWorld::TestSphereAgainstWorld(forward, 0.25f, nil, true, true, false, true, false, false); } if (obstacle) { animAssoc->flags |= ASSOC_DELETEFADEDOUT; // ANIM_HIT_WALL in VC (which makes more sense) CAnimBlendAssociation *handsCoverAssoc = CAnimManager::BlendAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_STD_HANDSCOWER, 8.0f); handsCoverAssoc->flags &= ~ASSOC_FADEOUTWHENDONE; handsCoverAssoc->SetFinishCallback(FinishHitHeadCB, ped); ped->bIsLanding = true; return; } float velocityFromAnim = 0.1f; CAnimBlendAssociation *sprintAssoc = RpAnimBlendClumpGetAssociation(ped->GetClump(), ANIM_STD_RUNFAST); if (sprintAssoc) { velocityFromAnim = 0.05f * sprintAssoc->blendAmount + 0.17f; } else { CAnimBlendAssociation *runAssoc = RpAnimBlendClumpGetAssociation(ped->GetClump(), ANIM_STD_RUN); if (runAssoc) { velocityFromAnim = 0.07f * runAssoc->blendAmount + 0.1f; } } if (ped->IsPlayer() #ifdef VC_PED_PORTS || ped->m_pedInObjective && ped->m_pedInObjective->IsPlayer() #endif ) ped->ApplyMoveForce(0.0f, 0.0f, 8.5f); else ped->ApplyMoveForce(0.0f, 0.0f, 4.5f); if (sq(velocityFromAnim) > ped->m_vecMoveSpeed.MagnitudeSqr2D() #ifdef VC_PED_PORTS || ped->m_pCurrentPhysSurface #endif ) { #ifdef FREE_CAM if (TheCamera.Cams[0].Using3rdPersonMouseCam() && !CCamera::bFreeCam) { #else if (TheCamera.Cams[0].Using3rdPersonMouseCam()) { #endif float fpsAngle = ped->WorkOutHeadingForMovingFirstPerson(ped->m_fRotationCur); ped->m_vecMoveSpeed.x = -velocityFromAnim * Sin(fpsAngle); ped->m_vecMoveSpeed.y = velocityFromAnim * Cos(fpsAngle); } else { ped->m_vecMoveSpeed.x = -velocityFromAnim * Sin(ped->m_fRotationCur); ped->m_vecMoveSpeed.y = velocityFromAnim * Cos(ped->m_fRotationCur); } #ifdef VC_PED_PORTS if (ped->m_pCurrentPhysSurface) { ped->m_vecMoveSpeed.x += ped->m_pCurrentPhysSurface->m_vecMoveSpeed.x; ped->m_vecMoveSpeed.y += ped->m_pCurrentPhysSurface->m_vecMoveSpeed.y; } #endif } ped->bIsStanding = false; ped->bIsInTheAir = true; animAssoc->blendDelta = -1000.0f; CAnimManager::AddAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_STD_JUMP_GLIDE); if (ped->bDoBloodyFootprints) { CVector bloodPos(0.0f, 0.0f, 0.0f); ped->TransformToNode(bloodPos, PED_FOOTL); bloodPos.z -= 0.1f; bloodPos += 0.2f * ped->GetForward(); CShadows::AddPermanentShadow(SHADOWTYPE_DARK, gpBloodPoolTex, &bloodPos, 0.26f * ped->GetForward().x, 0.26f * ped->GetForward().y, 0.14f * ped->GetRight().x, 0.14f * ped->GetRight().y, 255, 255, 0, 0, 4.0f, 3000, 1.0f); bloodPos = CVector(0.0f, 0.0f, 0.0f); ped->TransformToNode(bloodPos, PED_FOOTR); bloodPos.z -= 0.1f; bloodPos += 0.2f * ped->GetForward(); CShadows::AddPermanentShadow(SHADOWTYPE_DARK, gpBloodPoolTex, &bloodPos, 0.26f * ped->GetForward().x, 0.26f * ped->GetForward().y, 0.14f * ped->GetRight().x, 0.14f * ped->GetRight().y, 255, 255, 0, 0, 4.0f, 3000, 1.0f); if (ped->m_bloodyFootprintCountOrDeathTime <= 40) { ped->m_bloodyFootprintCountOrDeathTime = 0; ped->bDoBloodyFootprints = false; } else { ped->m_bloodyFootprintCountOrDeathTime -= 40; } } } void CPed::FinishJumpCB(CAnimBlendAssociation *animAssoc, void *arg) { CPed *ped = (CPed*)arg; ped->bResetWalkAnims = true; ped->bIsLanding = false; animAssoc->blendDelta = -1000.0f; } void CPed::FinishHitHeadCB(CAnimBlendAssociation *animAssoc, void *arg) { CPed *ped = (CPed*)arg; if (animAssoc) { animAssoc->blendDelta = -4.0f; animAssoc->flags |= ASSOC_DELETEFADEDOUT; } if (ped->m_nPedState == PED_JUMP) ped->RestorePreviousState(); ped->bIsLanding = false; } bool CPed::CanPedDriveOff(void) { if (m_nPedState != PED_DRIVING || m_lookTimer > CTimer::GetTimeInMilliseconds()) return false; for (int i = 0; i < m_numNearPeds; i++) { CPed *nearPed = m_nearPeds[i]; if (nearPed->m_nPedType == m_nPedType && nearPed->m_objective == OBJECTIVE_ENTER_CAR_AS_PASSENGER && nearPed->m_carInObjective == m_carInObjective) { m_lookTimer = CTimer::GetTimeInMilliseconds() + 1000; return false; } } return true; } // These categories are purely random, most of ped models have no correlation. So I don't think making an enum. uint8 CPed::GetPedRadioCategory(uint32 modelIndex) { switch (modelIndex) { case MI_MALE01: case MI_FEMALE03: case MI_PROSTITUTE2: case MI_WORKER1: case MI_MOD_MAN: case MI_MOD_WOM: case MI_ST_WOM: case MI_FAN_WOM: return 3; case MI_TAXI_D: case MI_PIMP: case MI_MALE02: case MI_FEMALE02: case MI_FATFEMALE01: case MI_FATFEMALE02: case MI_DOCKER1: case MI_WORKER2: case MI_FAN_MAN2: return 9; case MI_GANG01: case MI_GANG02: case MI_SCUM_MAN: case MI_SCUM_WOM: case MI_HOS_WOM: case MI_CONST1: return 1; case MI_GANG03: case MI_GANG04: case MI_GANG07: case MI_GANG08: case MI_CT_MAN2: case MI_CT_WOM2: case MI_B_MAN3: case MI_SHOPPER3: return 4; case MI_GANG05: case MI_GANG06: case MI_GANG11: case MI_GANG12: case MI_CRIMINAL02: case MI_B_WOM2: case MI_ST_MAN: case MI_HOS_MAN: return 5; case MI_FATMALE01: case MI_LI_MAN2: case MI_SHOPPER1: case MI_CAS_MAN: return 6; case MI_PROSTITUTE: case MI_P_WOM2: case MI_LI_WOM2: case MI_B_WOM3: case MI_CAS_WOM: return 2; case MI_P_WOM1: case MI_DOCKER2: case MI_STUD_MAN: return 7; case MI_CT_MAN1: case MI_CT_WOM1: case MI_LI_MAN1: case MI_LI_WOM1: case MI_B_MAN1: case MI_B_MAN2: case MI_B_WOM1: case MI_SHOPPER2: case MI_STUD_WOM: return 8; default: return 0; } } void CPed::SetRadioStation(void) { static const uint8 radiosPerRadioCategories[10][4] = { {JAH_RADIO, RISE_FM, GAME_FM, MSX_FM}, {HEAD_RADIO, DOUBLE_CLEF, LIPS_106, FLASHBACK}, {RISE_FM, GAME_FM, MSX_FM, FLASHBACK}, {HEAD_RADIO, RISE_FM, LIPS_106, MSX_FM}, {HEAD_RADIO, RISE_FM, MSX_FM, FLASHBACK}, {JAH_RADIO, RISE_FM, LIPS_106, FLASHBACK}, {HEAD_RADIO, RISE_FM, LIPS_106, FLASHBACK}, {HEAD_RADIO, JAH_RADIO, LIPS_106, FLASHBACK}, {HEAD_RADIO, DOUBLE_CLEF, LIPS_106, FLASHBACK}, {CHATTERBOX, HEAD_RADIO, LIPS_106, GAME_FM} }; uint8 orderInCat = 0; // BUG: this wasn't initialized if (IsPlayer() || !m_pMyVehicle || m_pMyVehicle->pDriver != this) return; uint8 category = GetPedRadioCategory(GetModelIndex()); if (DMAudio.IsMP3RadioChannelAvailable()) { if (CGeneral::GetRandomNumber() & 15) { for (orderInCat = 0; orderInCat < 4; orderInCat++) { if (m_pMyVehicle->m_nRadioStation == radiosPerRadioCategories[category][orderInCat]) break; } } else { m_pMyVehicle->m_nRadioStation = USERTRACK; } } else { for (orderInCat = 0; orderInCat < 4; orderInCat++) { if (m_pMyVehicle->m_nRadioStation == radiosPerRadioCategories[category][orderInCat]) break; } } if (orderInCat == 4) { if (DMAudio.IsMP3RadioChannelAvailable()) { if (CGeneral::GetRandomNumber() & 15) m_pMyVehicle->m_nRadioStation = radiosPerRadioCategories[category][CGeneral::GetRandomNumber() & 3]; else m_pMyVehicle->m_nRadioStation = USERTRACK; } else { m_pMyVehicle->m_nRadioStation = radiosPerRadioCategories[category][CGeneral::GetRandomNumber() & 3]; } } } void CPed::WarpPedIntoCar(CVehicle *car) { bInVehicle = true; m_pMyVehicle = car; m_pMyVehicle->RegisterReference((CEntity **) &m_pMyVehicle); m_carInObjective = car; m_carInObjective->RegisterReference((CEntity **) &m_carInObjective); SetPedState(PED_DRIVING); bUsesCollision = false; bIsInTheAir = false; bVehExitWillBeInstant = true; if (m_objective == OBJECTIVE_ENTER_CAR_AS_DRIVER) { car->SetDriver(this); car->pDriver->RegisterReference((CEntity **) &car->pDriver); } else if (m_objective == OBJECTIVE_ENTER_CAR_AS_PASSENGER) { for (int i = 0; i < 4; i++) { if (!car->pPassengers[i]) { car->pPassengers[i] = this; car->pPassengers[i]->RegisterReference((CEntity **) &car->pPassengers[i]); break; } } } else return; if (IsPlayer()) { car->SetStatus(STATUS_PLAYER); AudioManager.PlayerJustGotInCar(); CCarCtrl::RegisterVehicleOfInterest(car); } else { car->SetStatus(STATUS_PHYSICS); } CWorld::Remove(this); SetPosition(car->GetPosition()); CWorld::Add(this); if (car->bIsAmbulanceOnDuty) { car->bIsAmbulanceOnDuty = false; --CCarCtrl::NumAmbulancesOnDuty; } if (car->bIsFireTruckOnDuty) { car->bIsFireTruckOnDuty = false; --CCarCtrl::NumFiretrucksOnDuty; } if (!car->bEngineOn) { car->bEngineOn = true; DMAudio.PlayOneShot(car->m_audioEntityId, SOUND_CAR_ENGINE_START, 1.0f); } #ifdef VC_PED_PORTS RpAnimBlendClumpSetBlendDeltas(GetClump(), ASSOC_PARTIAL, -1000.0f); // VC uses AddInCarAnims but we don't have that m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, car->GetDriverAnim(), 100.0f); RemoveWeaponWhenEnteringVehicle(); #else if (car->IsBoat()) { #ifndef FIX_BUGS m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_BOAT_DRIVE, 100.0f); #else m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, car->GetDriverAnim(), 100.0f); #endif CWeaponInfo *ourWeapon = CWeaponInfo::GetWeaponInfo(GetWeapon()->m_eWeaponType); RemoveWeaponModel(ourWeapon->m_nModelId); } else { // Because we can use Uzi for drive by RemoveWeaponWhenEnteringVehicle(); if (car->bLowVehicle) m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_CAR_SIT_LO, 100.0f); else m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_CAR_SIT, 100.0f); } #endif StopNonPartialAnims(); if (car->bIsBus) bRenderPedInCar = false; bChangedSeat = true; } #ifdef PEDS_REPORT_CRIMES_ON_PHONE // returns event id, parameter is optional int32 CPed::CheckForPlayerCrimes(CPed *victim) { int i; float dist; float mindist = 60.0f; CPlayerPed *player = FindPlayerPed(); int32 victimRef = (victim ? CPools::GetPedRef(victim) : 0); int event = -1; for (i = 0; i < NUMEVENTS; i++) { if (gaEvent[i].type == EVENT_NULL || gaEvent[i].type > EVENT_CAR_SET_ON_FIRE) continue; // those are already handled in game, also DEAD_PED isn't registered alone, most of the time there is SHOOT_PED etc. if (gaEvent[i].type == EVENT_DEAD_PED || gaEvent[i].type == EVENT_GUNSHOT || gaEvent[i].type == EVENT_EXPLOSION) continue; if (victim && gaEvent[i].entityRef != victimRef) continue; if (gaEvent[i].criminal != player) continue; dist = (GetPosition() - gaEvent[i].posn).Magnitude(); if (dist < mindist) { mindist = dist; event = i; } } if (event != -1) { if (victim) { m_victimOfPlayerCrime = victim; } else { switch (gaEvent[event].entityType) { case EVENT_ENTITY_PED: m_victimOfPlayerCrime = CPools::GetPed(gaEvent[event].entityRef); break; case EVENT_ENTITY_VEHICLE: m_victimOfPlayerCrime = CPools::GetVehicle(gaEvent[event].entityRef); break; case EVENT_ENTITY_OBJECT: m_victimOfPlayerCrime = CPools::GetObject(gaEvent[event].entityRef); break; default: break; } } } return event; } #endif #ifdef PED_SKIN static RpMaterial* SetLimbAlphaCB(RpMaterial *material, void *data) { ((RwRGBA*)RpMaterialGetColor(material))->alpha = *(uint8*)data; return material; } void CPed::renderLimb(int node) { RpHAnimHierarchy *hier = GetAnimHierarchyFromSkinClump(GetClump()); int idx = RpHAnimIDGetIndex(hier, m_pFrames[node]->nodeID); RwMatrix *mat = &RpHAnimHierarchyGetMatrixArray(hier)[idx]; CPedModelInfo *mi = (CPedModelInfo *)CModelInfo::GetModelInfo(GetModelIndex()); RpAtomic *atomic; switch(node){ case PED_HEAD: atomic = mi->getHead(); break; case PED_HANDL: atomic = mi->getLeftHand(); break; case PED_HANDR: atomic = mi->getRightHand(); break; default: return; } if(atomic == nil) return; RwFrame *frame = RpAtomicGetFrame(atomic); *RwFrameGetMatrix(frame) = *mat; RwFrameUpdateObjects(frame); int alpha = CVisibilityPlugins::GetClumpAlpha(GetClump()); RpGeometryForAllMaterials(RpAtomicGetGeometry(atomic), SetLimbAlphaCB, &alpha); RpAtomicRender(atomic); } #endif #ifdef COMPATIBLE_SAVES #define CopyFromBuf(buf, data) memcpy(&data, buf, sizeof(data)); SkipSaveBuf(buf, sizeof(data)); #define CopyToBuf(buf, data) memcpy(buf, &data, sizeof(data)); SkipSaveBuf(buf, sizeof(data)); void CPed::Save(uint8*& buf) { SkipSaveBuf(buf, 52); CopyToBuf(buf, GetPosition().x); CopyToBuf(buf, GetPosition().y); CopyToBuf(buf, GetPosition().z); SkipSaveBuf(buf, 288); CopyToBuf(buf, CharCreatedBy); SkipSaveBuf(buf, 351); CopyToBuf(buf, m_fHealth); CopyToBuf(buf, m_fArmour); SkipSaveBuf(buf, 148); for (int i = 0; i < 13; i++) // has to be hardcoded m_weapons[i].Save(buf); SkipSaveBuf(buf, 5); CopyToBuf(buf, m_maxWeaponTypeAllowed); SkipSaveBuf(buf, 162); } void CPed::Load(uint8*& buf) { SkipSaveBuf(buf, 52); CopyFromBuf(buf, GetMatrix().GetPosition().x); CopyFromBuf(buf, GetMatrix().GetPosition().y); CopyFromBuf(buf, GetMatrix().GetPosition().z); SkipSaveBuf(buf, 288); CopyFromBuf(buf, CharCreatedBy); SkipSaveBuf(buf, 351); CopyFromBuf(buf, m_fHealth); CopyFromBuf(buf, m_fArmour); SkipSaveBuf(buf, 148); for (int i = 0; i < 13; i++) // has to be hardcoded m_weapons[i].Load(buf); SkipSaveBuf(buf, 5); CopyFromBuf(buf, m_maxWeaponTypeAllowed); SkipSaveBuf(buf, 162); } #undef CopyFromBuf #undef CopyToBuf #endif
30.50859
232
0.688751
gameblabla
28a693938444d64da4b549eac332a99c2412ede5
1,868
hpp
C++
include/util/dist_table_wrapper.hpp
mortada/osrm-backend
aae02cd1be7e99eb75117c7d8c9f39b858ad9019
[ "BSD-2-Clause" ]
null
null
null
include/util/dist_table_wrapper.hpp
mortada/osrm-backend
aae02cd1be7e99eb75117c7d8c9f39b858ad9019
[ "BSD-2-Clause" ]
null
null
null
include/util/dist_table_wrapper.hpp
mortada/osrm-backend
aae02cd1be7e99eb75117c7d8c9f39b858ad9019
[ "BSD-2-Clause" ]
1
2019-09-20T00:55:14.000Z
2019-09-20T00:55:14.000Z
#ifndef DIST_TABLE_WRAPPER_H #define DIST_TABLE_WRAPPER_H #include <vector> #include <utility> #include <boost/assert.hpp> #include <cstddef> namespace osrm { namespace util { // This Wrapper provides an easier access to a distance table that is given as an linear vector template <typename T> class DistTableWrapper { public: using Iterator = typename std::vector<T>::iterator; using ConstIterator = typename std::vector<T>::const_iterator; DistTableWrapper(std::vector<T> table, std::size_t number_of_nodes) : table_(std::move(table)), number_of_nodes_(number_of_nodes) { BOOST_ASSERT_MSG(table.size() == 0, "table is empty"); BOOST_ASSERT_MSG(number_of_nodes_ * number_of_nodes_ <= table_.size(), "number_of_nodes_ is invalid"); }; std::size_t GetNumberOfNodes() const { return number_of_nodes_; } std::size_t size() const { return table_.size(); } EdgeWeight operator()(NodeID from, NodeID to) const { BOOST_ASSERT_MSG(from < number_of_nodes_, "from ID is out of bound"); BOOST_ASSERT_MSG(to < number_of_nodes_, "to ID is out of bound"); const auto index = from * number_of_nodes_ + to; BOOST_ASSERT_MSG(index < table_.size(), "index is out of bound"); return table_[index]; } ConstIterator begin() const { return std::begin(table_); } Iterator begin() { return std::begin(table_); } ConstIterator end() const { return std::end(table_); } Iterator end() { return std::end(table_); } NodeID GetIndexOfMaxValue() const { return std::distance(table_.begin(), std::max_element(table_.begin(), table_.end())); } std::vector<T> GetTable() const { return table_; } private: std::vector<T> table_; const std::size_t number_of_nodes_; }; } } #endif // DIST_TABLE_WRAPPER_H
27.072464
95
0.671306
mortada
28a7ad946ebfbf2df68e52204044ea982d133cc6
1,553
cpp
C++
test/20171018/source/std/test20171018/source/sxy/sequence/sequence.cpp
DesZou/Eros
f49c9ce1dfe193de8199163286afc28ff8c52eef
[ "MIT" ]
1
2017-10-12T13:49:10.000Z
2017-10-12T13:49:10.000Z
test/20171018/source/std/test20171018/source/sxy/sequence/sequence.cpp
DesZou/Eros
f49c9ce1dfe193de8199163286afc28ff8c52eef
[ "MIT" ]
null
null
null
test/20171018/source/std/test20171018/source/sxy/sequence/sequence.cpp
DesZou/Eros
f49c9ce1dfe193de8199163286afc28ff8c52eef
[ "MIT" ]
1
2017-10-12T13:49:38.000Z
2017-10-12T13:49:38.000Z
//Serene #include<algorithm> #include<iostream> #include<cstring> #include<cstdlib> #include<cstdio> #include<cmath> using namespace std; #define ll long long const int maxn=2e5+10; ll n,m,k,t,ans[maxn],a[maxn],lx[maxn],tot,tot2; ll aa;char cc; ll read() { aa=0;cc=getchar(); while(cc<'0'||cc>'9') cc=getchar(); while(cc>='0'&&cc<='9') aa=aa*10+cc-'0',cc=getchar(); return aa; } ll ef(ll l,ll r,ll x) { if(x<a[l]) return -1; ll mid; while(l<r-1) { mid=(l+r)>>1; if(a[mid]<=x) l=mid; else r=mid; } return l; } struct Ask{ ll l,r;int pos; }ask[maxn]; bool cmp(const Ask& a,const Ask& b) { return a.r<b.r; } ll sz1[maxn],sz2[maxn]; void add(ll pos,ll x,ll* sz) { if(!pos) return; while(pos<=n) { sz[pos]+=x; pos+=(pos&-pos); } } ll q(ll pos,ll* sz) { ll rs=0; while(pos) { rs+=sz[pos]; pos-=(pos&-pos); } return rs; } int main() { freopen("sequence.in","r",stdin); freopen("sequence.out","w",stdout); n=read();m=read();k=read(); for(int i=1;i<=n;++i) { a[i]=read(); a[i]=(a[i]>=m? 1:0)+a[i-1]; } for(int i=1;i<=n;++i) lx[i]=ef(0,n,a[i]-k)+1; t=read(); for(int i=1;i<=t;++i) { ask[i].l=read(); ask[i].r=read(); ask[i].pos=i; } sort(ask+1,ask+t+1,cmp); int pos=1; for(int i=1;i<=t;++i) { while(pos<=ask[i].r) { add(lx[pos],lx[pos],sz1); add(lx[pos],1,sz2); if(lx[pos]) tot+=lx[pos],tot2++; pos++; } ans[ask[i].pos]=tot-q(ask[i].l-1,sz1) -(ask[i].l-1)*(tot2-q(ask[i].l-1,sz2)); } for(int i=1;i<=t;++i) printf("%lld\n",ans[i]); fclose(stdin);fclose(stdout); return 0; }
17.255556
54
0.555055
DesZou
28a9a07b9550f1a3019cee5cf4763bbc45cc6b93
8,828
cpp
C++
Source/Samples/40_Localization/L10n.cpp
daokoder/Craft
13dd4219e30f71b48f368c01b6e33e8ce5a515e0
[ "MIT" ]
15
2019-06-25T14:06:57.000Z
2021-03-05T00:33:54.000Z
Source/Samples/40_Localization/L10n.cpp
daokoder/Craft3D
13dd4219e30f71b48f368c01b6e33e8ce5a515e0
[ "MIT" ]
null
null
null
Source/Samples/40_Localization/L10n.cpp
daokoder/Craft3D
13dd4219e30f71b48f368c01b6e33e8ce5a515e0
[ "MIT" ]
null
null
null
// // Copyright (c) 2008-2019 the Urho3D project. // // 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. // #include <Craft/Core/CoreEvents.h> #include <Craft/Graphics/Material.h> #include <Craft/Graphics/Model.h> #include <Craft/Graphics/Octree.h> #include <Craft/Graphics/StaticModel.h> #include <Craft/Graphics/Zone.h> #include <Craft/Resource/Localization.h> #include <Craft/Resource/ResourceEvents.h> #include <Craft/UI/Button.h> #include <Craft/UI/Font.h> #include <Craft/UI/Text.h> #include <Craft/UI/Text3D.h> #include <Craft/UI/UIEvents.h> #include <Craft/UI/Window.h> #include "L10n.h" #include <Craft/DebugNew.h> CRAFT_DEFINE_APPLICATION_MAIN(L10n) L10n::L10n(Context* context) : Sample(context) { } void L10n::Start() { // Execute base class startup Sample::Start(); // Enable and center OS cursor auto* input = GetSubsystem<Input>(); input->SetMouseVisible(true); input->CenterMousePosition(); // Load strings from JSON files and subscribe to the change language event InitLocalizationSystem(); // Init the 3D space CreateScene(); // Init the user interface CreateGUI(); // Set the mouse mode to use in the sample Sample::InitMouseMode(MM_FREE); } void L10n::InitLocalizationSystem() { auto* l10n = GetSubsystem<Localization>(); // JSON files must be in UTF8 encoding without BOM // The first found language will be set as current l10n->LoadJSONFile("StringsEnRu.json"); // You can load multiple files l10n->LoadJSONFile("StringsDe.json"); l10n->LoadJSONFile("StringsLv.json", "lv"); // Hook up to the change language SubscribeToEvent(E_CHANGELANGUAGE, CRAFT_HANDLER(L10n, HandleChangeLanguage)); } void L10n::CreateGUI() { // Get localization subsystem auto* l10n = GetSubsystem<Localization>(); auto* cache = GetSubsystem<ResourceCache>(); UIElement* root = GetSubsystem<UI>()->GetRoot(); root->SetDefaultStyle(cache->GetResource<XMLFile>("UI/DefaultStyle.xml")); auto* window = new Window(context_); root->AddChild(window); window->SetMinSize(384, 192); window->SetLayout(LM_VERTICAL, 6, IntRect(6, 6, 6, 6)); window->SetAlignment(HA_CENTER, VA_CENTER); window->SetStyleAuto(); auto* windowTitle = new Text(context_); windowTitle->SetName("WindowTitle"); windowTitle->SetStyleAuto(); window->AddChild(windowTitle); // In this place the current language is "en" because it was found first when loading the JSON files String langName = l10n->GetLanguage(); // Languages are numbered in the loading order int langIndex = l10n->GetLanguageIndex(); // == 0 at the beginning // Get string with identifier "title" in the current language String localizedString = l10n->Get("title"); // Localization::Get returns String::EMPTY if the id is empty. // Localization::Get returns the id if translation is not found and will be added a warning into the log. windowTitle->SetText(localizedString + " (" + String(langIndex) + " " + langName + ")"); auto* b = new Button(context_); window->AddChild(b); b->SetStyle("Button"); b->SetMinHeight(24); auto* t = b->CreateChild<Text>("ButtonTextChangeLang"); // The showing text value will automatically change when language is changed t->SetAutoLocalizable(true); // The text value used as a string identifier in this mode. // Remember that a letter case of the id and of the lang name is important. t->SetText("Press this button"); t->SetAlignment(HA_CENTER, VA_CENTER); t->SetStyle("Text"); SubscribeToEvent(b, E_RELEASED, CRAFT_HANDLER(L10n, HandleChangeLangButtonPressed)); b = new Button(context_); window->AddChild(b); b->SetStyle("Button"); b->SetMinHeight(24); t = b->CreateChild<Text>("ButtonTextQuit"); t->SetAlignment(HA_CENTER, VA_CENTER); t->SetStyle("Text"); // Manually set text in the current language t->SetText(l10n->Get("quit")); SubscribeToEvent(b, E_RELEASED, CRAFT_HANDLER(L10n, HandleQuitButtonPressed)); } void L10n::CreateScene() { // Get localization subsystem auto* l10n = GetSubsystem<Localization>(); auto* cache = GetSubsystem<ResourceCache>(); scene_ = new Scene(context_); scene_->CreateComponent<Octree>(); auto* zone = scene_->CreateComponent<Zone>(); zone->SetBoundingBox(BoundingBox(-1000.0f, 1000.0f)); zone->SetAmbientColor(Color(0.5f, 0.5f, 0.5f)); zone->SetFogColor(Color(0.4f, 0.5f, 0.8f)); zone->SetFogStart(1.0f); zone->SetFogEnd(100.0f); Node* planeNode = scene_->CreateChild("Plane"); planeNode->SetScale(Vector3(300.0f, 1.0f, 300.0f)); auto* planeObject = planeNode->CreateComponent<StaticModel>(); planeObject->SetModel(cache->GetResource<Model>("Models/Plane.mdl")); planeObject->SetMaterial(cache->GetResource<Material>("Materials/StoneTiled.xml")); Node* lightNode = scene_->CreateChild("DirectionalLight"); lightNode->SetDirection(Vector3(0.6f, -1.0f, 0.8f)); auto* light = lightNode->CreateComponent<Light>(); light->SetLightType(LIGHT_DIRECTIONAL); light->SetColor(Color(0.8f, 0.8f, 0.8f)); cameraNode_ = scene_->CreateChild("Camera"); cameraNode_->CreateComponent<Camera>(); cameraNode_->SetPosition(Vector3(0.0f, 10.0f, -30.0f)); Node* text3DNode = scene_->CreateChild("Text3D"); text3DNode->SetPosition(Vector3(0.0f, 0.1f, 30.0f)); auto* text3D = text3DNode->CreateComponent<Text3D>(); // Manually set text in the current language. text3D->SetText(l10n->Get("lang")); text3D->SetFont(cache->GetResource<Font>("Fonts/Anonymous Pro.ttf"), 30); text3D->SetColor(Color::BLACK); text3D->SetAlignment(HA_CENTER, VA_BOTTOM); text3DNode->SetScale(15); auto* renderer = GetSubsystem<Renderer>(); SharedPtr<Viewport> viewport(new Viewport(context_, scene_, cameraNode_->GetComponent<Camera>())); renderer->SetViewport(0, viewport); SubscribeToEvent(E_UPDATE, CRAFT_HANDLER(L10n, HandleUpdate)); } void L10n::HandleUpdate(StringHash eventType, VariantMap& eventData) { using namespace Update; float timeStep = eventData[P_TIMESTEP].GetFloat(); auto* input = GetSubsystem<Input>(); const float MOUSE_SENSITIVITY = 0.1f; IntVector2 mouseMove = input->GetMouseMove(); yaw_ += MOUSE_SENSITIVITY * mouseMove.x_; pitch_ += MOUSE_SENSITIVITY * mouseMove.y_; pitch_ = Clamp(pitch_, -90.0f, 90.0f); cameraNode_->SetRotation(Quaternion(pitch_, yaw_, 0.0f)); } void L10n::HandleChangeLangButtonPressed(StringHash eventType, VariantMap& eventData) { auto* l10n = GetSubsystem<Localization>(); // Languages are numbered in the loading order int lang = l10n->GetLanguageIndex(); lang++; if (lang >= l10n->GetNumLanguages()) lang = 0; l10n->SetLanguage(lang); } void L10n::HandleQuitButtonPressed(StringHash eventType, VariantMap& eventData) { if (GetPlatform() != "Web") engine_->Exit(); } // You can manually change texts, sprites and other aspects of the game when language is changed void L10n::HandleChangeLanguage(StringHash eventType, VariantMap& eventData) { auto* l10n = GetSubsystem<Localization>(); UIElement* uiRoot = GetSubsystem<UI>()->GetRoot(); auto* windowTitle = uiRoot->GetChildStaticCast<Text>("WindowTitle", true); windowTitle->SetText(l10n->Get("title") + " (" + String(l10n->GetLanguageIndex()) + " " + l10n->GetLanguage() + ")"); auto* buttonText = uiRoot->GetChildStaticCast<Text>("ButtonTextQuit", true); buttonText->SetText(l10n->Get("quit")); auto* text3D = scene_->GetChild("Text3D")->GetComponent<Text3D>(); text3D->SetText(l10n->Get("lang")); // A text on the button "Press this button" changes automatically }
36.032653
121
0.702651
daokoder
28abfd6272252b3a1daaafd4540a8518f8969cc0
11,418
cpp
C++
parser/pe/ResourceDirWrapper.cpp
yjd/bearparser
7ec04943a7b7f478d8b924aebe1fc0e831cb27da
[ "BSD-2-Clause" ]
516
2015-01-04T14:04:21.000Z
2022-03-13T05:07:27.000Z
parser/pe/ResourceDirWrapper.cpp
yjd/bearparser
7ec04943a7b7f478d8b924aebe1fc0e831cb27da
[ "BSD-2-Clause" ]
12
2018-08-04T22:37:46.000Z
2021-02-17T00:37:56.000Z
parser/pe/ResourceDirWrapper.cpp
yjd/bearparser
7ec04943a7b7f478d8b924aebe1fc0e831cb27da
[ "BSD-2-Clause" ]
99
2015-04-23T01:59:24.000Z
2022-03-03T04:38:28.000Z
#include "pe/ResourceDirWrapper.h" #include "pe/PEFile.h" #define MAX_ENTRIES 50 #define MAX_DEPTH 5 /* typedef struct _IMAGE_RESOURCE_DIRECTORY { DWORD Characteristics; DWORD TimeDateStamp; WORD MajorVersion; WORD MinorVersion; WORD NumberOfNamedEntries; WORD NumberOfIdEntries; // IMAGE_RESOURCE_DIRECTORY_ENTRY DirectoryEntries[]; } IMAGE_RESOURCE_DIRECTORY, *PIMAGE_RESOURCE_DIRECTORY; // Each directory contains the 32-bit Name of the entry and an offset, // relative to the beginning of the resource directory of the data associated // with this directory entry. If the name of the entry is an actual text // string instead of an integer Id, then the high order bit of the name field // is set to one and the low order 31-bits are an offset, relative to the // beginning of the resource directory of the string, which is of type // IMAGE_RESOURCE_DIRECTORY_STRING. Otherwise the high bit is clear and the // low-order 16-bits are the integer Id that identify this resource directory // entry. If the directory entry is yet another resource directory (i.e. a // subdirectory), then the high order bit of the offset field will be // set to indicate this. Otherwise the high bit is clear and the offset // field points to a resource data entry. #define RESOURCE_NAME_IS_STRING 0x80000000 #define RESOURCE_DATA_IS_DIRECTORY 0x80000000 typedef struct _IMAGE_RESOURCE_DIRECTORY_ENTRY { union { struct { DWORD NameOffset:31; DWORD NameIsString:1; } name; DWORD Name; WORD Id; }; union { DWORD OffsetToData; struct { DWORD OffsetToDirectory:31; DWORD DataIsDirectory:1; } dir; }; } IMAGE_RESOURCE_DIRECTORY_ENTRY, *PIMAGE_RESOURCE_DIRECTORY_ENTRY; */ //------------- IMAGE_RESOURCE_DIRECTORY* ResourceDirWrapper::mainResourceDir() { offset_t rva = getDirEntryAddress(); BYTE *ptr = m_Exe->getContentAt(rva, Executable::RVA, sizeof(IMAGE_RESOURCE_DIRECTORY)); return (IMAGE_RESOURCE_DIRECTORY*) ptr; } IMAGE_RESOURCE_DIRECTORY* ResourceDirWrapper::resourceDir() { if (this->rawOff == 0) return mainResourceDir(); BYTE *ptr = m_Exe->getContentAt(this->rawOff, Executable::RAW, sizeof(IMAGE_RESOURCE_DIRECTORY)); return (IMAGE_RESOURCE_DIRECTORY*) ptr; } bool ResourceDirWrapper::wrap() { clear(); if (this->topEntryID == TOP_ENTRY_ROOT && this->album != NULL) { this->album->clear(); } IMAGE_RESOURCE_DIRECTORY* dir = resourceDir(); if (dir == NULL) return false; size_t namesNum = dir->NumberOfNamedEntries; size_t idsNum = dir->NumberOfIdEntries; size_t totalEntries = namesNum + idsNum; for (size_t i = 0; i < totalEntries && i < MAX_ENTRIES; i++ ) { long topDirId = (this->topEntryID != TOP_ENTRY_ROOT) ? this->topEntryID : long(i) ; //ResourceEntryWrapper(PEFile *pe, ResourceDirWrapper *parentDir, size_t entryNumber, long topEntryId, ResourcesAlbum *resAlbum) ResourceEntryWrapper* entry = new ResourceEntryWrapper(this->m_PE, this, i, topDirId, this->album); if (entry->getPtr() == NULL) { delete entry; break; } if (this->topEntryID == TOP_ENTRY_ROOT && this->album != NULL) { pe::resource_type typeId = static_cast<pe::resource_type>(entry->getID()); this->album->mapIdToLeafType(i, typeId); } //this->parsedSize += val; this->entries.push_back(entry); } //printf("Entries: %d\n", getEntriesCount()); return true; } bufsize_t ResourceDirWrapper::getSize() { if (getPtr() == NULL) return 0; bufsize_t size = sizeof(IMAGE_RESOURCE_DIRECTORY); size += getEntriesAreaSize(); return size; } void* ResourceDirWrapper::getFieldPtr(size_t fId, size_t subField) { IMAGE_RESOURCE_DIRECTORY* d = resourceDir(); if (d == NULL) return NULL; switch (fId) { case CHARACTERISTIC: return &d->Characteristics; case TIMESTAMP: return &d->TimeDateStamp; case MAJOR_VER: return &d->MajorVersion; case MINOR_VER: return &d->MinorVersion; case NAMED_ENTRIES_NUM : return &d->NumberOfNamedEntries; case ID_ENTRIES_NUM : return &d->NumberOfIdEntries; case CHILDREN : return (&d->NumberOfIdEntries) + 1; } return this->getPtr(); } QString ResourceDirWrapper::getFieldName(size_t fieldId) { switch (fieldId) { case CHARACTERISTIC: return "Characteristics"; case TIMESTAMP: return "TimeDateStamp"; case MAJOR_VER: return "MajorVersion"; case MINOR_VER: return "MinorVersion"; case NAMED_ENTRIES_NUM : return "NumberOfNamedEntries"; case ID_ENTRIES_NUM : return "NumberOfIdEntries"; case CHILDREN : return "Entries"; } return getName(); } //----------------------------------------------------------------- void ResourceEntryWrapper::clear() { delete childDir; this->childDir = NULL; //--- delete childLeaf; this->childLeaf = NULL; } bool ResourceEntryWrapper::wrap() { clear(); //--- offset_t childRaw = getChildAddress(); if (childRaw == 0 || childRaw == INVALID_ADDR) return false; if (this->isDir()) { long depth = this->parentDir->getDepth() + 1; if (depth >= MAX_DEPTH) return false; //printf("Subdir at: %x ,depth : %lld\n", childRaw, depth); this->childDir = new ResourceDirWrapper(this->m_PE, this->album, childRaw, depth, topEntryID); } else { //printf("Leaf at: %x\n", childRaw); this->childLeaf = new ResourceLeafWrapper(m_Exe, childRaw, topEntryID); //test if (this->album != NULL) { album->putLeaf(childLeaf, topEntryID); //printf("Album: topEntryID: %x\n", topEntryID); } } return true; } IMAGE_RESOURCE_DIRECTORY_ENTRY* ResourceEntryWrapper::getEntryPtr() { if (this->parentDir == NULL) return NULL; uint64_t offset = parentDir->getFieldOffset(ResourceDirWrapper::ID_ENTRIES_NUM); if (offset == INVALID_ADDR) return NULL; size_t lastSize = parentDir->getFieldSize(ResourceDirWrapper::ID_ENTRIES_NUM, FIELD_NONE); offset += lastSize; offset += (this->entryNum * sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY)); void *ptr = m_Exe->getContentAt(offset, Executable::RAW, sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY)); return (IMAGE_RESOURCE_DIRECTORY_ENTRY*) ptr; } //IMAGE_RESOURCE_DIRECTORY_ENTRY void* ResourceEntryWrapper::getFieldPtr(size_t fieldId, size_t subField) { IMAGE_RESOURCE_DIRECTORY_ENTRY* entry = getEntryPtr(); if (entry == NULL) return NULL; switch (fieldId) { case NAME_ID_ADDR: return &entry->Name; case OFFSET_TO_DATA: return &entry->OffsetToData; } return getPtr(); } QString ResourceEntryWrapper::getFieldName(size_t fieldId) { switch (fieldId) { case NAME_ID_ADDR: return(isByName()) ? "Name": "ID"; case OFFSET_TO_DATA: return "Offset To Data"; } return getName(); } bool ResourceEntryWrapper::isByName() { IMAGE_RESOURCE_DIRECTORY_ENTRY* entry = getEntryPtr(); if (entry == NULL) return false; if (entry->NameIsString == 1) return true; return false; } bool ResourceEntryWrapper::isDir() { IMAGE_RESOURCE_DIRECTORY_ENTRY* entry = getEntryPtr(); if (entry == NULL) return false; if (entry->DataIsDirectory == 1) return true; return false; } offset_t ResourceEntryWrapper::getNameOffset() { IMAGE_RESOURCE_DIRECTORY_ENTRY* entry = getEntryPtr(); if (entry == NULL) return INVALID_ADDR; if (this->parentDir == NULL) return INVALID_ADDR; offset_t fOff = this->parentDir->getOffset(this->parentDir->getPtr()); if (fOff == INVALID_ADDR) return INVALID_ADDR; if (entry->NameIsString != 1) return INVALID_ADDR; return fOff + entry->NameOffset; } IMAGE_RESOURCE_DIRECTORY_STRING* ResourceEntryWrapper::getNameStr() { offset_t nameOff = getNameOffset(); if (nameOff == INVALID_ADDR) return NULL; const size_t BASIC_SIZE = sizeof(IMAGE_RESOURCE_DIRECTORY_STRING); IMAGE_RESOURCE_DIRECTORY_STRING *ptr = (IMAGE_RESOURCE_DIRECTORY_STRING*) this->m_Exe->getContentAt(nameOff, Executable::RAW, BASIC_SIZE); return ptr; } QString ResourceEntryWrapper::translateType(WORD id) { switch (id) { case pe::RESTYPE_CURSOR : return "Cursor"; case pe::RESTYPE_FONT :return "Font"; case pe::RESTYPE_BITMAP : return "Bitmap"; case pe::RESTYPE_ICON : return "Icon"; case pe::RESTYPE_MENU : return "Menu"; case pe::RESTYPE_DIALOG : return "Dialog"; case pe::RESTYPE_STRING : return "String"; case pe::RESTYPE_FONTDIR : return "Font Dir"; case pe::RESTYPE_ACCELERATOR : return "Accelerator"; case pe::RESTYPE_RCDATA : return "RC Data"; case pe::RESTYPE_MESSAGETABLE : return "Message Table"; case pe::RESTYPE_GROUP_CURSOR : return "Cursors Group"; case pe::RESTYPE_GROUP_ICON : return "Icons Group"; case pe::RESTYPE_VERSION : return "Version"; case pe::RESTYPE_DLGINCLUDE : return "Dlg Include"; case pe::RESTYPE_PLUGPLAY : return "Plug & Play"; case pe::RESTYPE_VXD : return "VXD"; case pe::RESTYPE_ANICURSOR : return "Animated Cursor"; case pe::RESTYPE_ANIICON : return "Animated Icon"; case pe::RESTYPE_HTML : return "HTML"; case pe::RESTYPE_MANIFEST : return "Manifest"; } return ""; } WORD ResourceEntryWrapper::getID() { IMAGE_RESOURCE_DIRECTORY_ENTRY* entry = getEntryPtr(); if (entry == NULL) return 0; if (this->isByName()) return 0; return entry->Id; } DWORD ResourceEntryWrapper::getChildOffsetToDirectory() { IMAGE_RESOURCE_DIRECTORY_ENTRY* entry = getEntryPtr(); if (entry == NULL) return 0; return entry->OffsetToDirectory; } offset_t ResourceEntryWrapper::getChildAddress() { if (this->parentDir == NULL) return INVALID_ADDR; offset_t fOff = this->parentDir->getOffset(this->parentDir->mainResourceDir()); if (fOff == INVALID_ADDR) return INVALID_ADDR; fOff += static_cast<offset_t>(getChildOffsetToDirectory()); return fOff; } //------------------------------------------------------------------------- IMAGE_RESOURCE_DATA_ENTRY* ResourceLeafWrapper::leafEntryPtr() { if (this->offset == 0 || this->offset == INVALID_ADDR) return NULL; IMAGE_RESOURCE_DATA_ENTRY* leaf = (IMAGE_RESOURCE_DATA_ENTRY*) this->m_Exe->getContentAt(this->offset, Executable::RAW, sizeof(IMAGE_RESOURCE_DATA_ENTRY)); return leaf; } void* ResourceLeafWrapper::getFieldPtr(size_t fieldId, size_t subField) { IMAGE_RESOURCE_DATA_ENTRY* leaf = leafEntryPtr(); if (leaf == NULL) return NULL; switch (fieldId) { case OFFSET_TO_DATA: return &leaf->OffsetToData; case DATA_SIZE: return &leaf->Size; case CODE_PAGE: return &leaf->CodePage; case RESERVED: return &leaf->Reserved; } return NULL; } QString ResourceLeafWrapper::getFieldName(size_t fieldId) { switch (fieldId) { case OFFSET_TO_DATA: return "OffsetToData"; case DATA_SIZE: return "DataSize"; case CODE_PAGE: return "CodePage"; case RESERVED: return "Reserved"; } return ""; }
32.345609
159
0.667192
yjd
28ae594c588d8980e30799ccebfab704dacbb3d1
10,394
hpp
C++
inc/msp430/msp_timer.hpp
ecrampton1/MspPeripheralmm
ae1f64cc785b9a3b994074e851e68c170aef613f
[ "MIT" ]
null
null
null
inc/msp430/msp_timer.hpp
ecrampton1/MspPeripheralmm
ae1f64cc785b9a3b994074e851e68c170aef613f
[ "MIT" ]
1
2021-03-07T14:18:31.000Z
2021-03-07T14:18:31.000Z
inc/msp430/msp_timer.hpp
ecrampton1/MspPeripheralmm
ae1f64cc785b9a3b994074e851e68c170aef613f
[ "MIT" ]
null
null
null
#ifndef _MSP_TIMER_HPP #define _MSP_TIMER_HPP #include <stdint.h> #include "mcu_timer.hpp" #include "msp_periph.hpp" #include "msp430/msp_gpio.hpp"//TODO debug #include <msp430.h> namespace McuPeripheral { enum class TimerSource : uint16_t { SMCLK = TASSEL_2, ACLK = TASSEL_1 }; enum class TimerMode : uint16_t { UP_MODE = MC_1, CONT_MODE = MC_2, UP_DOWN_MODE = MC_3 }; enum class ClockDivider : uint16_t { DIVIDE_1 = ID_0, DIVIDE_2 = ID_1, DIVIDE_4 = ID_2, DIVIDE_8 = ID_3 }; enum class CapCompSelect : uint16_t { CCIA = CCIS_0, CCIB = CCIS_1, GND = CCIS_2, VCC = CCIS_3 }; enum class CapMode : uint16_t { RISING_EDGE = CM_1, FALLING_EDGE = CM_2, DUAL_EDGE = CM_3 }; enum class OutputMode : uint16_t { TOGGLE_RESET = OUTMOD_2, SET_RESET = OUTMOD_3, TOGGLE_SET = OUTMOD_6, RESET_SET = OUTMOD_7, }; enum class SyncCapSource : uint16_t { ASYNC = 0, SYNC = SCS }; template< uint16_t _ccc> class CaptureCompareControl { public: /**@brief Enable the capture/compare irq of the specified compare/capture * register. */ static void intEnable() { REG_16(_ccc) |= CCIE; } /**@brief Enable the capture/compare irq of the specified compare/capture * register. @ref CapCompRegister for valid registers to use. */ static void intDisable() { REG_16(_ccc) &= ~CCIE; } static bool getCciValue() { return REG_16(_ccc) & CCI; } static bool getCovValue() { return REG_16(_ccc) & COV; } static bool clearCov() { return REG_16(_ccc) &= ~COV; } static void startCompare(OutputMode mode ) { REG_16(_ccc) |= static_cast<uint16_t>(mode); } /**@brief Starts the capture based on the parameters passed in * @param [in] ccis selects what is triggering the input for the capture @ref CapCompSelect * @param [in] cm selects the capture mode uses @ref CapMode * @param [in] scs sets if this is asynchronous trigger synchronous triggered based on clock */ static void startCapture(CapCompSelect ccis, CapMode cm = CapMode::RISING_EDGE, SyncCapSource scs = SyncCapSource::ASYNC ) { REG_16(_ccc) |= static_cast<uint16_t>(scs) | static_cast<uint16_t>(cm) | CAP | static_cast<uint16_t>(ccis); } /**@brief Stop capturing */ static void stopCapture(){ REG_16(_ccc) &= ~(CM_3 | CAP); } /**@brief this will return the state of the capture flag and will clear. * @return the state of the capture input flag if set a capture has occurred */ static bool readCaptureFlag() { //read the capture input flag and clear it. bool ret = CCIFG & REG_16(_ccc); if(ret) { REG_16(_ccc) &= ~CCIFG; } return ret; } static callback_t mCallback; private: }; template<uint16_t _control, uint16_t _counter, uint16_t _taiv, uint16_t _ccc0, uint16_t _ccc1, uint16_t _ccc2, uint16_t _ccr0, uint16_t _ccr1, uint16_t _ccr2> class TimerControl { public: //Capture Compare Register Control //TODO _ccr0,1,2 are shared amongst all three ccc0,1,2. //static uint8_t that is shared to show ownership? using CapCompControl0 = CaptureCompareControl<_ccc0>; using CapCompControl1 = CaptureCompareControl<_ccc1>; using CapCompControl2 = CaptureCompareControl<_ccc2>; static callback_t mCallback; /**@brief Enable the overflow irq of the timer */ static void intEnable() { _DINT(); REG_16(_control) |= TAIE; _EINT();} /**@brief Disable the overflow irq of the timer */ static void intDisable() { REG_16(_control) &= ~TAIE; } static bool isIntEnable() { return REG_16(_control) & TAIE; } static void clearTimer() { REG_16(_control) |= TACLR; } static void stopTimer() { REG_16(_control) &= ~MC_3; } static void setCcr0( const uint16_t count) { REG_16(_ccr0) = count; } static void setCcr1(const uint16_t count) { REG_16(_ccr1) = count; } static void setCcr2(const uint16_t count) { REG_16(_ccr2) = count; } static uint16_t getCcr0() { return REG_16(_ccr0); } static uint16_t getCcr1() { return REG_16(_ccr1); } static uint16_t getCcr2() { return REG_16(_ccr2); } static bool clearOverFlow() {return REG_16(_taiv) &= ~TAIV;} static uint16_t getCounterValue() { return REG_16(_counter); } static bool isCaptureOverFlowSet() {return REG_16(_control) & COV;} static bool isOverFlowFlagSet() { return REG_16(_taiv) & TAIFG;} static void startTimer( TimerMode mode, TimerSource source, ClockDivider divide=ClockDivider::DIVIDE_1 ) { *((volatile uint16_t*)_control) |= ((uint16_t)source | (uint16_t)mode | (uint16_t)divide); } static bool isRunning() { return ( *((volatile uint16_t*)_control) & MC_3 ) > 0; } }; template < TimerSource r, uint64_t s, int32_t c > constexpr uint32_t compute_rollover() { return (r == TimerSource::SMCLK) ? (s / 1000000.0F) / (1 / ( c / 1.0F ) * 65535.0F) : (s / 1000000.0F) / (1 / ( 32768.0F / 1.0F ) * 65535.0F); //TODO ACLK } //MCLK source template<TimerSource _source, uint32_t _clockspeed, ClockDivider _divider=ClockDivider::DIVIDE_1> class TimerConfig { public: static constexpr float computeTickTiming() { return 1.0F / _clockspeed; } static constexpr uint32_t computeTickTimingNs() { return (uint32_t)(computeTickTiming() * 1000000000.0F); } static constexpr float computeOverFlowTiming() { return computeTickTiming()*0xFFFF; } static constexpr TimerSource Source = _source; static constexpr uint32_t ClockSpeed = _clockspeed; static constexpr ClockDivider Divider = _divider; }; //Output pwm TODO /* * Waveform: ___ * | |______| * A B C * A-C: Period timing * A-B: Percentage high/low depending on _pulseHigh * * always uses ccr1 and ccr2? */ template< class _timer, class _timerconfig, class _ccc, class _gpio, bool _pulsehigh=true > class PulseWidthOutput { public: static void init() { _gpio::clear(); _gpio::output(); _gpio::selectOn();//Only works for Port2? intEnable(); _ccc::mCallback = &timerCallback; } //Same timer interrupt static void intEnable() { _ccc::intEnable(); } //Same timer interrupt static void intDisable() { _ccc::intDisable(); } static void start() { _timer::clearTimer(); //copy paste from continuous mode timer... TODO clean up _timer::startTimer(TimerMode::CONT_MODE,_timerconfig::Source,_timerconfig::Divider); } static void stop() { _timer::stopTimer(); _ccc::stopCapture(); } static void timerCallback(callback_args_t callback) { //TODO count the number of times? } }; //Measure the width input pulses (always uses ccr0?) template< class _timer, class _timerconfig, class _ccc, class _gpio,uint16_t _ccr, CapCompSelect _ccis=CapCompSelect::CCIA, bool _pulsehigh=true > class PulseWidthMeasure { public: static void init() { _gpio::clear(); _gpio::input(); _gpio::selectOn();//Only works for Port2? intEnable(); _ccc::mCallback = &timerCallback; } //Same timer interrupt static void intEnable() { _ccc::intEnable(); } //Same timer interrupt static void intDisable() { _ccc::intDisable(); } static void start() { _timer::clearTimer(); //copy paste from continuous mode timer... TODO clean up _timer::startTimer(TimerMode::CONT_MODE,_timerconfig::Source,_timerconfig::Divider); _ccc::startCapture(_ccis,CapMode::DUAL_EDGE); } static void stop() { _timer::stopTimer(); _ccc::stopCapture(); (void)_ccc::readCaptureFlag(); } static uint16_t getPulseWidthTicks() { return mEndCount - mStartCount; } static uint32_t getPulseWidthNs() { //TODO determine the formula for ticks to us return getPulseWidthTicks()*_timerconfig::computeTickTimingNs(); } static void timerCallback(callback_args_t callback) { const uint16_t count = REG_16(_ccr);//always get ccr0? if(_ccc::getCovValue()) { _ccc::clearCov(); } if(_pulsehigh) { setCounts(_ccc::getCciValue(), count); } else { setCounts(!_ccc::getCciValue(), count); } } static inline void setCounts(const bool start, const uint16_t count) { if(start) { mStartCount = count; } else { stop(); mEndCount = count; mCallback(0); //send the pulse width to user } } static void setCallback(callback_t callback) { mCallback = callback; //User callback } static volatile uint16_t mStartCount; static volatile uint16_t mEndCount; static callback_t mCallback; private: PulseWidthMeasure() =delete; PulseWidthMeasure(const PulseWidthMeasure&) =delete; PulseWidthMeasure& operator=(const PulseWidthMeasure&) =delete; }; template< class _timer, class _timerconfig > class ContinuousTimer { public: static void intEnable() { _timer::intEnable(); } static void start() { _timer::clearTimer(); _timer::startTimer(TimerMode::CONT_MODE,_timerconfig::Source,_timerconfig::Divider); } static void setCallback(callback_t callback) { _timer::mCallback = callback; } static uint16_t getTimerCount(){ return _timer::getCounterValue(); } static void stop() { _timer::stopTimer(); } private: ContinuousTimer() =delete; ContinuousTimer(const ContinuousTimer&) =delete; ContinuousTimer& operator=(const ContinuousTimer&) =delete; }; template<uint16_t _control, uint16_t _counter, uint16_t _taiv,uint16_t _ccc0,uint16_t _ccc1, uint16_t _ccc2, uint16_t _ccr0, uint16_t _ccr1, uint16_t _ccr2 > McuPeripheral::callback_t McuPeripheral::TimerControl<_control,_counter, _taiv, _ccc0,_ccc1, _ccc2,_ccr0,_ccr1,_ccr2>::mCallback; template< class _timer, class _timerconfig, class _ccc, class _gpio, uint16_t _ccr,CapCompSelect _ccis, bool _pulsehigh > volatile uint16_t PulseWidthMeasure<_timer, _timerconfig, _ccc, _gpio,_ccr, _ccis, _pulsehigh>::mStartCount; template< class _timer, class _timerconfig, class _ccc, class _gpio,uint16_t _ccr, CapCompSelect _ccis, bool _pulsehigh > volatile uint16_t PulseWidthMeasure<_timer, _timerconfig, _ccc, _gpio,_ccr, _ccis, _pulsehigh>::mEndCount; template< class _timer, class _timerconfig, class _ccc, class _gpio,uint16_t _ccr, CapCompSelect _ccis, bool _pulsehigh > callback_t PulseWidthMeasure<_timer, _timerconfig, _ccc, _gpio, _ccr,_ccis, _pulsehigh>::mCallback; template< uint16_t _ccc> callback_t CaptureCompareControl<_ccc>::mCallback; } using Timer_Source = McuPeripheral::TimerSource; using Timer_Mode = McuPeripheral::TimerMode; using Timer0 = McuPeripheral::TimerControl<TACTL_, TAR_, TAIV_, TACCTL0_, TACCTL1_, TACCTL2_, TACCR0_, TACCR1_, TACCR2_>; using Timer1 = McuPeripheral::TimerControl<TA1CTL_, TA1R_, TAIV_, TA1CCTL0_, TA1CCTL1_, TA1CCTL2_, TA1CCR0_, TA1CCR1_, TA1CCR2_>; #endif //_MSP_TIMER_HPP
24.747619
200
0.724649
ecrampton1
28b1a3096dd8b67434d93f54d61cffac988f556d
589
cpp
C++
hal/STM32F4/systick/systick.cpp
yhsb2k/omef
7425b62dd4b5d0af4e320816293f69d16d39f57a
[ "MIT" ]
null
null
null
hal/STM32F4/systick/systick.cpp
yhsb2k/omef
7425b62dd4b5d0af4e320816293f69d16d39f57a
[ "MIT" ]
null
null
null
hal/STM32F4/systick/systick.cpp
yhsb2k/omef
7425b62dd4b5d0af4e320816293f69d16d39f57a
[ "MIT" ]
null
null
null
#include "systick.hpp" #include "rcc/rcc.hpp" #include "CMSIS/Device/STM32F4xx/Include/stm32f4xx.h" #include "CMSIS/Include/core_cm4.h" #include "FreeRTOS.h" #include "task.h" using namespace hal; void systick::init(void) { uint32_t systick_freq = rcc_get_freq(RCC_SRC_AHB); SysTick_Config(systick_freq / configTICK_RATE_HZ); } uint32_t systick::get_ms(void) { return xTaskGetTickCount(); } uint32_t systick::get_past(uint32_t start) { return xTaskGetTickCount() - start; } /* Implemented in third_party/FreeRTOS/port.c extern "C" void SysTick_Handler(void) { systick_cnt++; } */
19
53
0.757216
yhsb2k
28b2d2bbf16e2821601d88d1ad2cdc07d9dd9ef2
2,133
cpp
C++
Samples/OpenGL/Demo/proj.win.cmake/src/LAppDefine.cpp
adrianiainlam/CubismNativeSamples
b48ca90d39bdef27007b1a191049959d79949a58
[ "RSA-MD" ]
3
2021-01-12T02:38:38.000Z
2021-12-27T20:54:11.000Z
Samples/OpenGL/Demo/proj.win.cmake/src/LAppDefine.cpp
adrianiainlam/CubismNativeSamples
b48ca90d39bdef27007b1a191049959d79949a58
[ "RSA-MD" ]
2
2020-12-22T17:04:53.000Z
2021-02-24T00:58:07.000Z
Samples/OpenGL/Demo/proj.win.cmake/src/LAppDefine.cpp
adrianiainlam/CubismNativeSamples
b48ca90d39bdef27007b1a191049959d79949a58
[ "RSA-MD" ]
null
null
null
/** * Copyright(c) Live2D Inc. All rights reserved. * * Use of this source code is governed by the Live2D Open Software license * that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html. */ #include "LAppDefine.hpp" #include <CubismFramework.hpp> namespace LAppDefine { using namespace Csm; // 画面 const csmFloat32 ViewMaxScale = 2.0f; const csmFloat32 ViewMinScale = 0.8f; const csmFloat32 ViewLogicalLeft = -1.0f; const csmFloat32 ViewLogicalRight = 1.0f; const csmFloat32 ViewLogicalMaxLeft = -2.0f; const csmFloat32 ViewLogicalMaxRight = 2.0f; const csmFloat32 ViewLogicalMaxBottom = -2.0f; const csmFloat32 ViewLogicalMaxTop = 2.0f; // 相対パス const csmChar* ResourcesPath = "Resources/"; // モデルの後ろにある背景の画像ファイル const csmChar* BackImageName = "back_class_normal.png"; // 歯車 const csmChar* GearImageName = "icon_gear.png"; // 終了ボタン const csmChar* PowerImageName = "close.png"; // モデル定義------------------------------------------ // モデルを配置したディレクトリ名の配列 // ディレクトリ名とmodel3.jsonの名前を一致させておくこと const csmChar* ModelDir[] = { "Haru", "Hiyori", "Mark", "Natori", "Rice" }; const csmInt32 ModelDirSize = sizeof(ModelDir) / sizeof(const csmChar*); // 外部定義ファイル(json)と合わせる const csmChar* MotionGroupIdle = "Idle"; // アイドリング const csmChar* MotionGroupTapBody = "TapBody"; // 体をタップしたとき // 外部定義ファイル(json)と合わせる const csmChar* HitAreaNameHead = "Head"; const csmChar* HitAreaNameBody = "Body"; // モーションの優先度定数 const csmInt32 PriorityNone = 0; const csmInt32 PriorityIdle = 1; const csmInt32 PriorityNormal = 2; const csmInt32 PriorityForce = 3; // デバッグ用ログの表示オプション const csmBool DebugLogEnable = true; const csmBool DebugTouchLogEnable = false; // Frameworkから出力するログのレベル設定 const CubismFramework::Option::LogLevel CubismLoggingLevel = CubismFramework::Option::LogLevel_Verbose; // デフォルトのレンダーターゲットサイズ const csmInt32 RenderTargetWidth = 1900; const csmInt32 RenderTargetHeight = 1000; }
28.824324
107
0.675105
adrianiainlam
28b80b75d8885d467e412197d27f5a6a99f36b29
7,708
hxx
C++
Modules/Filtering/DisplacementField/include/itkBSplineExponentialDiffeomorphicTransform.hxx
arnaudgelas/ITK
b5251da65f37d7e7e5e94d17072d275f89fb26ea
[ "Apache-2.0" ]
null
null
null
Modules/Filtering/DisplacementField/include/itkBSplineExponentialDiffeomorphicTransform.hxx
arnaudgelas/ITK
b5251da65f37d7e7e5e94d17072d275f89fb26ea
[ "Apache-2.0" ]
null
null
null
Modules/Filtering/DisplacementField/include/itkBSplineExponentialDiffeomorphicTransform.hxx
arnaudgelas/ITK
b5251da65f37d7e7e5e94d17072d275f89fb26ea
[ "Apache-2.0" ]
null
null
null
/*========================================================================= * * Copyright Insight Software Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0.txt * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * *=========================================================================*/ #ifndef itkBSplineExponentialDiffeomorphicTransform_hxx #define itkBSplineExponentialDiffeomorphicTransform_hxx #include "itkBSplineExponentialDiffeomorphicTransform.h" #include "itkAddImageFilter.h" #include "itkImageDuplicator.h" #include "itkImportImageFilter.h" #include "itkMultiplyImageFilter.h" namespace itk { /** * Constructor */ template<typename TScalar, unsigned int NDimensions> BSplineExponentialDiffeomorphicTransform<TScalar, NDimensions> ::BSplineExponentialDiffeomorphicTransform() : m_SplineOrder( 3 ) { this->m_NumberOfControlPointsForTheConstantVelocityField.Fill( 4 ); this->m_NumberOfControlPointsForTheUpdateField.Fill( 4 ); } /** * Destructor */ template<typename TScalar, unsigned int NDimensions> BSplineExponentialDiffeomorphicTransform<TScalar, NDimensions>:: ~BSplineExponentialDiffeomorphicTransform() { } /** * set mesh size for update field */ template<typename TScalar, unsigned int NDimensions> void BSplineExponentialDiffeomorphicTransform<TScalar, NDimensions> ::SetMeshSizeForTheUpdateField( const ArrayType &meshSize ) { ArrayType numberOfControlPoints; for( unsigned int d = 0; d < Dimension; d++ ) { numberOfControlPoints[d] = meshSize[d] + this->m_SplineOrder; } this->SetNumberOfControlPointsForTheUpdateField( numberOfControlPoints ); } /** * set mesh size for update field */ template<typename TScalar, unsigned int NDimensions> void BSplineExponentialDiffeomorphicTransform<TScalar, NDimensions> ::SetMeshSizeForTheConstantVelocityField( const ArrayType &meshSize ) { ArrayType numberOfControlPoints; for( unsigned int d = 0; d < Dimension; d++ ) { numberOfControlPoints[d] = meshSize[d] + this->m_SplineOrder; } this->SetNumberOfControlPointsForTheConstantVelocityField( numberOfControlPoints ); } template<typename TScalar, unsigned int NDimensions> void BSplineExponentialDiffeomorphicTransform<TScalar, NDimensions> ::UpdateTransformParameters( const DerivativeType & update, ScalarType factor ) { // // Smooth the update field // bool smoothUpdateField = true; for( unsigned int d = 0; d < Dimension; d++ ) { if( this->GetNumberOfControlPointsForTheUpdateField()[d] <= this->GetSplineOrder() ) { itkDebugMacro( "Not smooothing the update field." ); smoothUpdateField = false; break; } } ConstantVelocityFieldPointer velocityField = this->GetModifiableConstantVelocityField(); if( !velocityField ) { itkExceptionMacro( "The velocity field has not been set." ); } const typename ConstantVelocityFieldType::RegionType & bufferedRegion = velocityField->GetBufferedRegion(); const SizeValueType numberOfPixels = bufferedRegion.GetNumberOfPixels(); DisplacementVectorType *updateFieldPointer = reinterpret_cast<DisplacementVectorType *>( const_cast<DerivativeType &>( update ).data_block() ); typedef ImportImageFilter<DisplacementVectorType, NDimensions> ImporterType; const bool importFilterWillReleaseMemory = false; typename ImporterType::Pointer importer = ImporterType::New(); importer->SetImportPointer( updateFieldPointer, numberOfPixels, importFilterWillReleaseMemory ); importer->SetRegion( velocityField->GetBufferedRegion() ); importer->SetOrigin( velocityField->GetOrigin() ); importer->SetSpacing( velocityField->GetSpacing() ); importer->SetDirection( velocityField->GetDirection() ); ConstantVelocityFieldPointer updateField = importer->GetOutput(); updateField->Update(); updateField->DisconnectPipeline(); if( smoothUpdateField ) { itkDebugMacro( "Smoothing the update field." ); ConstantVelocityFieldPointer updateSmoothField = this->BSplineSmoothConstantVelocityField( updateField, this->GetNumberOfControlPointsForTheUpdateField() ); updateField = updateSmoothField; } typedef Image<ScalarType, NDimensions> RealImageType; typedef MultiplyImageFilter<ConstantVelocityFieldType, RealImageType, ConstantVelocityFieldType> MultiplierType; typename MultiplierType::Pointer multiplier = MultiplierType::New(); multiplier->SetInput( updateField ); multiplier->SetConstant( factor ); multiplier->Update(); typedef AddImageFilter<ConstantVelocityFieldType, ConstantVelocityFieldType, ConstantVelocityFieldType> AdderType; typename AdderType::Pointer adder = AdderType::New(); adder->SetInput1( velocityField ); adder->SetInput2( multiplier->GetOutput() ); ConstantVelocityFieldPointer updatedVelocityField = adder->GetOutput(); updatedVelocityField->Update(); updatedVelocityField->DisconnectPipeline(); // // Smooth the velocity field // bool smoothVelocityField = true; for( unsigned int d = 0; d < Dimension; d++ ) { if( this->GetNumberOfControlPointsForTheConstantVelocityField()[d] <= this->GetSplineOrder() ) { itkDebugMacro( "Not smoothing the velocity field." ); smoothVelocityField = false; break; } } if( smoothVelocityField ) { itkDebugMacro( "Smoothing the velocity field." ); ConstantVelocityFieldPointer velocitySmoothField = this->BSplineSmoothConstantVelocityField( updatedVelocityField, this->GetNumberOfControlPointsForTheConstantVelocityField() ); this->SetConstantVelocityField( velocitySmoothField ); } else { this->SetConstantVelocityField( updatedVelocityField ); } this->IntegrateVelocityField(); } template<typename TScalar, unsigned int NDimensions> typename BSplineExponentialDiffeomorphicTransform<TScalar, NDimensions>::ConstantVelocityFieldPointer BSplineExponentialDiffeomorphicTransform<TScalar, NDimensions> ::BSplineSmoothConstantVelocityField( const ConstantVelocityFieldType * field, const ArrayType &numberOfControlPoints ) { typename BSplineFilterType::Pointer bspliner = BSplineFilterType::New(); bspliner->SetUseInputFieldToDefineTheBSplineDomain( true ); bspliner->SetDisplacementField( field ); bspliner->SetNumberOfControlPoints( numberOfControlPoints ); bspliner->SetSplineOrder( this->m_SplineOrder ); bspliner->SetNumberOfFittingLevels( 1 ); bspliner->SetEnforceStationaryBoundary( true ); bspliner->SetEstimateInverse( false ); bspliner->Update(); ConstantVelocityFieldPointer smoothField = bspliner->GetOutput(); return smoothField; } /** * Standard "PrintSelf" method */ template<typename TScalar, unsigned int NDimensions> void BSplineExponentialDiffeomorphicTransform<TScalar, NDimensions> ::PrintSelf( std::ostream& os, Indent indent) const { Superclass::PrintSelf( os, indent ); os << indent << "Spline order = " << this->m_SplineOrder << std::endl; os << indent << "Number of control points for the velocity field = " << this->m_NumberOfControlPointsForTheConstantVelocityField << std::endl; os << indent << "Number of control points for the update field = " << this->m_NumberOfControlPointsForTheUpdateField << std::endl; } } // namespace itk #endif
34.106195
145
0.750519
arnaudgelas
28baa29df830ec62b41b750d21e1e7616250b0be
87
cpp
C++
disc0ver-Engine/disc0ver-Engine/Render/scene.cpp
Kpure1000/disc0ver-Engine
e2aeec3984aa6cd8ecbaa0da539bf53e37846602
[ "MIT" ]
5
2020-09-19T03:34:09.000Z
2021-04-10T07:39:53.000Z
disc0ver-Engine/disc0ver-Engine/Render/scene.cpp
Kpure1000/disc0ver-Engine
e2aeec3984aa6cd8ecbaa0da539bf53e37846602
[ "MIT" ]
null
null
null
disc0ver-Engine/disc0ver-Engine/Render/scene.cpp
Kpure1000/disc0ver-Engine
e2aeec3984aa6cd8ecbaa0da539bf53e37846602
[ "MIT" ]
3
2020-10-25T10:58:18.000Z
2021-03-26T01:08:54.000Z
/* * @Description: * @Author: 妄想 * @Email: long452a@163.com * @Date: 2021-2-16 */
12.428571
27
0.563218
Kpure1000
28bcfdb47b9262bbd8322b037494800e7c91164c
15,263
cpp
C++
source/exhumed/src/lavadude.cpp
madame-rachelle/Raze
67c8187d620e6cf9e99543cab5c5746dd31007af
[ "RSA-MD" ]
null
null
null
source/exhumed/src/lavadude.cpp
madame-rachelle/Raze
67c8187d620e6cf9e99543cab5c5746dd31007af
[ "RSA-MD" ]
null
null
null
source/exhumed/src/lavadude.cpp
madame-rachelle/Raze
67c8187d620e6cf9e99543cab5c5746dd31007af
[ "RSA-MD" ]
null
null
null
//------------------------------------------------------------------------- /* Copyright (C) 2010-2019 EDuke32 developers and contributors Copyright (C) 2019 sirlemonhead, Nuke.YKT This file is part of PCExhumed. PCExhumed is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program 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 this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- #include "ns.h" #include "engine.h" #include "aistuff.h" #include "sequence.h" #include "exhumed.h" #include "sound.h" #include <assert.h> BEGIN_PS_NS #define kMaxLavas 20 struct Lava { short nSprite; short nRun; short nAction; short nTarget; short nHealth; short nFrame; short nChannel; }; Lava LavaList[kMaxLavas]; short LavaCount = 0; static actionSeq ActionSeq[] = { {0, 1}, {0, 1}, {1, 0}, {10, 0}, {19, 0}, {28, 1}, {29, 1}, {33, 0}, {42, 1} }; static SavegameHelper sgh("lavadude", SA(LavaList), SV(LavaCount), nullptr); void InitLava() { LavaCount = 0; } int BuildLavaLimb(int nSprite, int edx, int ebx) { short nSector = sprite[nSprite].sectnum; int nLimbSprite = insertsprite(nSector, 118); assert(nLimbSprite >= 0 && nLimbSprite < kMaxSprites); sprite[nLimbSprite].x = sprite[nSprite].x; sprite[nLimbSprite].y = sprite[nSprite].y; sprite[nLimbSprite].z = sprite[nSprite].z - RandomLong() % ebx; sprite[nLimbSprite].cstat = 0; sprite[nLimbSprite].shade = -127; sprite[nLimbSprite].pal = 1; sprite[nLimbSprite].xvel = (RandomSize(5) - 16) << 8; sprite[nLimbSprite].yvel = (RandomSize(5) - 16) << 8; sprite[nLimbSprite].zvel = 2560 - (RandomSize(5) << 8); sprite[nLimbSprite].xoffset = 0; sprite[nLimbSprite].yoffset = 0; sprite[nLimbSprite].xrepeat = 90; sprite[nLimbSprite].yrepeat = 90; sprite[nLimbSprite].picnum = (edx & 3) % 3; sprite[nLimbSprite].hitag = 0; sprite[nLimbSprite].lotag = runlist_HeadRun() + 1; sprite[nLimbSprite].clipdist = 0; // GrabTimeSlot(3); sprite[nLimbSprite].extra = -1; sprite[nLimbSprite].owner = runlist_AddRunRec(sprite[nLimbSprite].lotag - 1, nLimbSprite | 0x160000); sprite[nLimbSprite].hitag = runlist_AddRunRec(NewRun, nLimbSprite | 0x160000); return nLimbSprite; } void FuncLavaLimb(int a, int, int nRun) { short nSprite = RunData[nRun].nVal; assert(nSprite >= 0 && nSprite < kMaxSprites); int nMessage = a & kMessageMask; switch (nMessage) { case 0x20000: { sprite[nSprite].shade += 3; int nRet = movesprite(nSprite, sprite[nSprite].xvel << 12, sprite[nSprite].yvel << 12, sprite[nSprite].zvel, 2560, -2560, CLIPMASK1); if (nRet || sprite[nSprite].shade > 100) { sprite[nSprite].xvel = 0; sprite[nSprite].yvel = 0; sprite[nSprite].zvel = 0; runlist_DoSubRunRec(sprite[nSprite].owner); runlist_FreeRun(sprite[nSprite].lotag - 1); runlist_SubRunRec(sprite[nSprite].hitag); mydeletesprite(nSprite); } break; } case 0x90000: { seq_PlotSequence(a & 0xFFFF, (SeqOffsets[kSeqLavag] + 30) + sprite[nSprite].picnum, 0, 1); break; } default: return; } } int BuildLava(short nSprite, int x, int y, int, short nSector, short nAngle, int nChannel) { short nLava = LavaCount; LavaCount++; if (nLava >= kMaxLavas) { return -1; } if (nSprite == -1) { nSprite = insertsprite(nSector, 118); } else { nSector = sprite[nSprite].sectnum; nAngle = sprite[nSprite].ang; x = sprite[nSprite].x; y = sprite[nSprite].y; changespritestat(nSprite, 118); } assert(nSprite >= 0 && nSprite < kMaxSprites); sprite[nSprite].x = x; sprite[nSprite].y = y; sprite[nSprite].z = sector[nSector].floorz; sprite[nSprite].cstat = 0x8000; sprite[nSprite].xrepeat = 200; sprite[nSprite].yrepeat = 200; sprite[nSprite].shade = -12; sprite[nSprite].pal = 0; sprite[nSprite].clipdist = 127; sprite[nSprite].xoffset = 0; sprite[nSprite].yoffset = 0; sprite[nSprite].picnum = seq_GetSeqPicnum(kSeqLavag, ActionSeq[3].a, 0); sprite[nSprite].xvel = 0; sprite[nSprite].yvel = 0; sprite[nSprite].zvel = 0; sprite[nSprite].ang = nAngle; sprite[nSprite].hitag = 0; sprite[nSprite].lotag = runlist_HeadRun() + 1; // GrabTimeSlot(3); sprite[nSprite].extra = -1; LavaList[nLava].nAction = 0; LavaList[nLava].nHealth = 4000; LavaList[nLava].nSprite = nSprite; LavaList[nLava].nTarget = -1; LavaList[nLava].nChannel = nChannel; LavaList[nLava].nFrame = 0; sprite[nSprite].owner = runlist_AddRunRec(sprite[nSprite].lotag - 1, nLava | 0x150000); LavaList[nLava].nRun = runlist_AddRunRec(NewRun, nLava | 0x150000); nCreaturesTotal++; return nLava | 0x150000; } void FuncLava(int a, int nDamage, int nRun) { short nLava = RunData[nRun].nVal; assert(nLava >= 0 && nLava < kMaxLavas); short nAction = LavaList[nLava].nAction; short nSeq = ActionSeq[nAction].a + SeqOffsets[kSeqLavag]; short nSprite = LavaList[nLava].nSprite; int nMessage = a & kMessageMask; switch (nMessage) { default: { Printf("unknown msg %d for Lava\n", nMessage); return; } case 0x90000: { seq_PlotSequence(a & 0xFFFF, nSeq, LavaList[nLava].nFrame, ActionSeq[nAction].b); tsprite[a & 0xFFFF].owner = -1; return; } case 0xA0000: { return; } case 0x80000: { if (!nDamage) { return; } LavaList[nLava].nHealth -= nDamage; if (LavaList[nLava].nHealth <= 0) { LavaList[nLava].nHealth = 0; LavaList[nLava].nAction = 5; LavaList[nLava].nFrame = 0; nCreaturesKilled++; sprite[nSprite].cstat &= 0xFEFE; } else { short nTarget = a & 0xFFFF; if (nTarget >= 0) { if (sprite[nTarget].statnum < 199) { LavaList[nLava].nTarget = nTarget; } } if (nAction == 3) { if (!RandomSize(2)) { LavaList[nLava].nAction = 4; LavaList[nLava].nFrame = 0; sprite[nSprite].cstat = 0; } } BuildLavaLimb(nSprite, totalmoves, 64000); } return; } case 0x20000: { sprite[nSprite].picnum = seq_GetSeqPicnum2(nSeq, LavaList[nLava].nFrame); int var_38 = LavaList[nLava].nFrame; short nFlag = FrameFlag[SeqBase[nSeq] + var_38]; int var_1C; if (nAction) { seq_MoveSequence(nSprite, nSeq, var_38); LavaList[nLava].nFrame++; if (LavaList[nLava].nFrame >= SeqSize[nSeq]) { var_1C = 1; LavaList[nLava].nFrame = 0; } else { var_1C = 0; } } short nTarget = LavaList[nLava].nTarget; if (nTarget >= 0 && nAction < 4) { if (!(sprite[nTarget].cstat & 0x101) || sprite[nTarget].sectnum >= 1024) { nTarget = -1; LavaList[nLava].nTarget = -1; } } switch (nAction) { case 0: { if ((nLava & 0x1F) == (totalmoves & 0x1F)) { if (nTarget < 0) { nTarget = FindPlayer(nSprite, 76800); } PlotCourseToSprite(nSprite, nTarget); sprite[nSprite].xvel = Cos(sprite[nSprite].ang); sprite[nSprite].yvel = Sin(sprite[nSprite].ang); if (nTarget >= 0 && !RandomSize(1)) { LavaList[nLava].nTarget = nTarget; LavaList[nLava].nAction = 2; sprite[nSprite].cstat = 0x101; LavaList[nLava].nFrame = 0; break; } } int x = sprite[nSprite].x; int y = sprite[nSprite].y; int z = sprite[nSprite].z; short nSector = sprite[nSprite].sectnum; int nVal = movesprite(nSprite, sprite[nSprite].xvel << 8, sprite[nSprite].yvel << 8, 0, 0, 0, CLIPMASK0); if (nSector != sprite[nSprite].sectnum) { changespritesect(nSprite, nSector); sprite[nSprite].x = x; sprite[nSprite].y = y; sprite[nSprite].z = z; sprite[nSprite].ang = (sprite[nSprite].ang + ((RandomWord() & 0x3FF) + 1024)) & kAngleMask; sprite[nSprite].xvel = Cos(sprite[nSprite].ang); sprite[nSprite].yvel = Sin(sprite[nSprite].ang); break; } if (!nVal) { break; } if ((nVal & 0xC000) == 0x8000) { sprite[nSprite].ang = (sprite[nSprite].ang + ((RandomWord() & 0x3FF) + 1024)) & kAngleMask; sprite[nSprite].xvel = Cos(sprite[nSprite].ang); sprite[nSprite].yvel = Sin(sprite[nSprite].ang); break; } else if ((nVal & 0xC000) == 0xC000) { if ((nVal & 0x3FFF) == nTarget) { int nAng = getangle(sprite[nTarget].x - sprite[nSprite].x, sprite[nTarget].y - sprite[nSprite].y); if (AngleDiff(sprite[nSprite].ang, nAng) < 64) { LavaList[nLava].nAction = 2; LavaList[nLava].nFrame = 0; sprite[nSprite].cstat = 0x101; break; } } } break; } case 1: case 6: { break; } case 2: { if (var_1C) { LavaList[nLava].nAction = 3; LavaList[nLava].nFrame = 0; PlotCourseToSprite(nSprite, nTarget); sprite[nSprite].cstat |= 0x101; } break; } case 3: { if ((nFlag & 0x80) && nTarget > -1) { int nHeight = GetSpriteHeight(nSprite); GetUpAngle(nSprite, -64000, nTarget, (-(nHeight >> 1))); BuildBullet(nSprite, 10, Cos(sprite[nSprite].ang) << 8, Sin(sprite[nSprite].ang) << 8, -1, sprite[nSprite].ang, nTarget + 10000, 1); } else if (var_1C) { PlotCourseToSprite(nSprite, nTarget); LavaList[nLava].nAction = 7; LavaList[nLava].nFrame = 0; } break; } case 4: { if (var_1C) { LavaList[nLava].nAction = 7; sprite[nSprite].cstat &= 0xFEFE; } break; } case 5: { if (nFlag & 0x40) { int nLimbSprite = BuildLavaLimb(nSprite, LavaList[nLava].nFrame, 64000); D3PlayFX(StaticSound[kSound26], nLimbSprite); } if (LavaList[nLava].nFrame) { if (nFlag & 0x80) { int ecx = 0; do { BuildLavaLimb(nSprite, ecx, 64000); ecx++; } while (ecx < 20); runlist_ChangeChannel(LavaList[nLava].nChannel, 1); } } else { int ecx = 0; do { BuildLavaLimb(nSprite, ecx, 256); ecx++; } while (ecx < 30); runlist_DoSubRunRec(sprite[nSprite].owner); runlist_FreeRun(sprite[nSprite].lotag - 1); runlist_SubRunRec(LavaList[nLava].nRun); mydeletesprite(nSprite); } break; } case 7: { if (var_1C) { LavaList[nLava].nAction = 8; LavaList[nLava].nFrame = 0; } break; } case 8: { if (var_1C) { LavaList[nLava].nAction = 0; LavaList[nLava].nFrame = 0; sprite[nSprite].cstat = 0x8000; } break; } } // loc_31521: sprite[nSprite].pal = 1; } } } END_PS_NS
29.636893
156
0.443687
madame-rachelle
28bd019847f48cd53f96e919d2826749bf88c7cf
2,958
cpp
C++
test/scratch/test.scratch.fe.WindowsRegistry.controller/test.scratch.fe.WindowsRegistry.controller.cpp
stlsoft/Pantheios
a35eaa4c070f88d0642bd78c223f1c0399374c3b
[ "BSD-3-Clause" ]
44
2015-09-27T09:17:38.000Z
2022-02-10T12:58:40.000Z
test/scratch/test.scratch.fe.WindowsRegistry.controller/test.scratch.fe.WindowsRegistry.controller.cpp
stlsoft/Pantheios
a35eaa4c070f88d0642bd78c223f1c0399374c3b
[ "BSD-3-Clause" ]
3
2017-03-08T06:54:59.000Z
2020-07-05T05:31:50.000Z
test/scratch/test.scratch.fe.WindowsRegistry.controller/test.scratch.fe.WindowsRegistry.controller.cpp
stlsoft/Pantheios
a35eaa4c070f88d0642bd78c223f1c0399374c3b
[ "BSD-3-Clause" ]
16
2015-10-22T07:39:47.000Z
2022-01-08T23:46:07.000Z
/* ///////////////////////////////////////////////////////////////////////// * File: test/scratch/test.scratch.fe.WindowsRegistry.controller/test.scratch.fe.WindowsRegistry.controller.cpp * * Purpose: Implementation file for the test.scratch.fe.WindowsRegistry.controller project. * * Created: 2nd December 2007 * Updated: 29th June 2016 * * Status: Wizard-generated * * License: (Licensed under the Synesis Software Open License) * * Copyright (c) 2007-2016, Synesis Software Pty Ltd. * All rights reserved. * * www: http://www.synesis.com.au/software * * ////////////////////////////////////////////////////////////////////// */ #define PANTHEIOS_NO_INCLUDE_OS_AND_3PTYLIB_STRING_ACCESS /* STLSoft header files */ #include <stlsoft/stlsoft.h> /* PlatformSTL header files */ #include <platformstl/platformstl.hpp> /* Standard C++ header files */ #include <exception> #if 0 #include <algorithm> #include <iterator> #include <list> #include <string> #include <vector> #endif /* 0 */ /* Standard C header files */ #include <stdio.h> #include <stdlib.h> #if defined(_MSC_VER) && \ defined(_DEBUG) # include <crtdbg.h> #endif /* _MSC_VER) && _DEBUG */ /* ///////////////////////////////////////////////////////////////////////// * typedefs */ namespace pantheios { namespace control { namespace fe { class WindowsRegistryController { public: typedef WindowsRegistryController class_type; public: explicit WindowsRegistryController(char const *) { } }; } /* namespace fe */ } /* namespace control */ } /* namespace pantheios */ /* ////////////////////////////////////////////////////////////////////// */ static int main_(int argc, char** argv) { int bVerbose = true; { for(int i = 1; i < argc; ++i) { char const* const arg = argv[i]; if(arg[0] == '-') { } else { } }} /* . */ // pantheios::control::fe::WindowsRegistryController::; return EXIT_SUCCESS; } int main(int argc, char** argv) { int res; #if defined(_MSC_VER) && \ defined(_DEBUG) _CrtMemState memState; #endif /* _MSC_VER && _MSC_VER */ #if defined(_MSC_VER) && \ defined(_DEBUG) _CrtMemCheckpoint(&memState); #endif /* _MSC_VER && _MSC_VER */ try { res = main_(argc, argv); } catch(std::exception &x) { fprintf(stderr, "Unhandled error: %s\n", x.what()); res = EXIT_FAILURE; } catch(...) { fprintf(stderr, "Unhandled unknown error\n"); res = EXIT_FAILURE; } #if defined(_MSC_VER) && \ defined(_DEBUG) _CrtMemDumpAllObjectsSince(&memState); #endif /* _MSC_VER) && _DEBUG */ return res; } /* ////////////////////////////////////////////////////////////////////// */
20.830986
118
0.514537
stlsoft
28bf6f39d3c3ccaa58ce5ef4b4f795d0407e96a8
2,208
cpp
C++
LearningCpp/Smthing.cpp
mertess/learningCpp
001a5322d2a895ce1feadc78a5ddabaae0c34d4a
[ "MIT" ]
null
null
null
LearningCpp/Smthing.cpp
mertess/learningCpp
001a5322d2a895ce1feadc78a5ddabaae0c34d4a
[ "MIT" ]
null
null
null
LearningCpp/Smthing.cpp
mertess/learningCpp
001a5322d2a895ce1feadc78a5ddabaae0c34d4a
[ "MIT" ]
null
null
null
#include <iostream> #include "Smthing.h" using namespace std; int& getA(my_struct& st) { /* *структура никак не записывается в объектный файл, она представляет собой способ управления последоавательностями байт *фактически структура my_struct представляет собой последовательность из 8 байт - 4 байта на int a, и 4 на int b *если разрядность системы 64 бит то 8 байт - машинное слово, то всего данные поля int a, b будут уже занимать 16 байт (выравнивание памяти!) */ int* ptr = (int*)&st; cout << *ptr << endl; return *ptr; } static int func() { return 0; } int& getB(my_struct& st) { int* ptr = (int*)((char*)&st + 4); cout << *ptr << endl; return *ptr; } void get_c(Cls& cls) { cout << *((char*)&cls) << endl; } void get_d(Cls& cls) { cout << *((double*)((char*)&cls + 8)) << endl; } void get_i(Cls& cls) { cout << *((int*)((char*)&cls + 16)) << endl; } void swap_min(int* m[], unsigned rows, unsigned cols) { int* min_row = 0; int min_value = m[0][0]; for (int i = 0; i < rows; i++) { for (int j = 0; j < cols; j++) { if (m[i][j] < min_value) { min_value = m[i][j]; min_row = m[i]; } } } int* tmp = new int[cols]; memcpy(tmp, m[0], sizeof(int) * cols); memcpy(m[0], min_row, sizeof(int) * cols); memcpy(min_row, tmp, sizeof(int) * cols); } int strLenght(const char* text, const char* pattern) { if (*pattern == 0) return 0; int index = 0; while (*text != '\0') { const char* pattPointer = pattern; const char* sub_text = text; while (*sub_text == *pattPointer) { if (*sub_text == '\0') return index; pattPointer++; sub_text++; if (*pattPointer == '\0') return index; } index++; text++; } return -1; } unsigned gcd(unsigned a, unsigned b, unsigned x) { if (a % x != 0 || b % x != 0) { gcd(a, b, --x); } else return x; return 0; } unsigned gcd(unsigned a, unsigned b) { return gcd(a, b, a > b ? a : b); }
21.647059
144
0.518569
mertess
28c058f8a7f545930e4e8ac334cba42bb8dd2568
1,616
cpp
C++
src/clReflectTest/TestArrays.cpp
chip5441/clReflect
d366cced2fff9aefcfc5ec6a0c97ed6c827263eb
[ "MIT" ]
null
null
null
src/clReflectTest/TestArrays.cpp
chip5441/clReflect
d366cced2fff9aefcfc5ec6a0c97ed6c827263eb
[ "MIT" ]
1
2020-02-22T09:59:21.000Z
2020-02-22T09:59:21.000Z
src/clReflectTest/TestArrays.cpp
chip5441/clReflect
d366cced2fff9aefcfc5ec6a0c97ed6c827263eb
[ "MIT" ]
null
null
null
// // =============================================================================== // clReflect // ------------------------------------------------------------------------------- // Copyright (c) 2011-2012 Don Williamson & clReflect Authors (see AUTHORS file) // Released under MIT License (see LICENSE file) // =============================================================================== // #include <clcpp/clcpp.h> #include <clcpp/Containers.h> #include <stdio.h> clcpp_reflect(TestArrays) namespace TestArrays { struct S { int x[3]; float y[30]; }; } void TestArraysFunc(clcpp::Database& db) { TestArrays::S s; const clcpp::Class* type = clcpp::GetType<TestArrays::S>()->AsClass(); for (unsigned int i = 0; i < type->fields.size; i++) { const clcpp::Field* field = type->fields[i]; clcpp::WriteIterator writer; writer.Initialise(field, (char*)&s + field->offset); for (unsigned int j = 0; j < writer.m_Count; j++) { void* value_ptr = writer.AddEmpty(); if (writer.m_ValueType == clcpp::GetType<float>()) *(float*)value_ptr = (float)j; if (writer.m_ValueType == clcpp::GetType<int>()) *(int*)value_ptr = j; } clcpp::ReadIterator reader(field, (char*)&s + field->offset); for (unsigned int j = 0; j < reader.m_Count; j++) { clcpp::ContainerKeyValue kv = reader.GetKeyValue(); if (reader.m_ValueType == clcpp::GetType<float>()) printf("%f\n", *(float*)kv.value); if (reader.m_ValueType == clcpp::GetType<int>()) printf("%d\n", *(int*)kv.value); reader.MoveNext(); } } }
26.491803
83
0.519802
chip5441
28c160d0e87ff265bbf609370c2f562ea22d80c8
1,243
hpp
C++
sprout/container/traits_fwd.hpp
kariya-mitsuru/Sprout
8274f34db498b02bff12277bac5416ea72e018cd
[ "BSL-1.0" ]
null
null
null
sprout/container/traits_fwd.hpp
kariya-mitsuru/Sprout
8274f34db498b02bff12277bac5416ea72e018cd
[ "BSL-1.0" ]
null
null
null
sprout/container/traits_fwd.hpp
kariya-mitsuru/Sprout
8274f34db498b02bff12277bac5416ea72e018cd
[ "BSL-1.0" ]
null
null
null
/*============================================================================= Copyright (c) 2011-2017 Bolero MURAKAMI https://github.com/bolero-MURAKAMI/Sprout Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) =============================================================================*/ #ifndef SPROUT_CONTAINER_TRAITS_FWD_HPP #define SPROUT_CONTAINER_TRAITS_FWD_HPP #include <sprout/config.hpp> namespace sprout { // // container_traits // template<typename Container> struct container_traits; // // container_range_traits // template<typename Container> struct container_range_traits; // // container_construct_traits // template<typename Container> struct container_construct_traits; // // container_transform_traits // template<typename Container> struct container_transform_traits; // // container_fitness_traits // template<typename Container> struct container_fitness_traits; // // sub_container_traits // template<typename Container> struct sub_container_traits; } // namespace sprout #endif // #ifndef SPROUT_CONTAINER_TRAITS_FWD_HPP
23.903846
80
0.648431
kariya-mitsuru
28c1f54bab3341138acb607ca48d3c007936995e
6,310
cpp
C++
src/xalanc/XPath/XNodeSetBase.cpp
ulisesten/xalanc
a722de08e61ce66965c4a828242f7d1250950621
[ "Apache-2.0" ]
24
2015-07-29T22:49:17.000Z
2022-03-25T10:14:17.000Z
src/xalanc/XPath/XNodeSetBase.cpp
ulisesten/xalanc
a722de08e61ce66965c4a828242f7d1250950621
[ "Apache-2.0" ]
14
2019-05-10T16:25:50.000Z
2021-11-24T18:04:47.000Z
src/xalanc/XPath/XNodeSetBase.cpp
ulisesten/xalanc
a722de08e61ce66965c4a828242f7d1250950621
[ "Apache-2.0" ]
28
2015-04-20T15:50:51.000Z
2022-01-26T14:56:55.000Z
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // Class header file. #include "XNodeSetBase.hpp" #include <xalanc/XalanDOM/XalanNode.hpp> #include <xalanc/PlatformSupport/DOMStringHelper.hpp> #include <xalanc/PlatformSupport/DoubleSupport.hpp> #include <xalanc/DOMSupport/DOMServices.hpp> #include "FormatterStringLengthCounter.hpp" #include "XObjectTypeCallback.hpp" #include "XPathExecutionContext.hpp" namespace XALAN_CPP_NAMESPACE { const double theBogusNumberValue = 123456789; XNodeSetBase::XNodeSetBase(MemoryManager& theMemoryManager) : XObject(eTypeNodeSet, theMemoryManager), m_proxy(*this), m_cachedStringValue(theMemoryManager), m_cachedNumberValue(theBogusNumberValue) { } XNodeSetBase::XNodeSetBase( const XNodeSetBase& source, MemoryManager& theMemoryManager) : XObject(source, theMemoryManager), m_proxy(*this), m_cachedStringValue(source.m_cachedStringValue, theMemoryManager), m_cachedNumberValue(source.m_cachedNumberValue) { } XNodeSetBase::~XNodeSetBase() { } const XalanDOMString& XNodeSetBase::getTypeString() const { return s_nodesetString; } double XNodeSetBase::num(XPathExecutionContext& executionContext) const { if (DoubleSupport::equal(m_cachedNumberValue, theBogusNumberValue) == true) { m_cachedNumberValue = DoubleSupport::toDouble( str(executionContext), getMemoryManager()); } return m_cachedNumberValue; } bool XNodeSetBase::boolean(XPathExecutionContext& /* executionContext */) const { return getLength() > 0 ? true : false; } const XalanDOMString& XNodeSetBase::str(XPathExecutionContext& executionContext) const { if (m_cachedStringValue.empty() == true && getLength() > 0) { const XalanNode* const theNode = item(0); assert(theNode != 0); DOMServices::getNodeData( *theNode, executionContext, m_cachedStringValue); } return m_cachedStringValue; } const XalanDOMString& XNodeSetBase::str() const { if (m_cachedStringValue.empty() == true && getLength() > 0) { const XalanNode* const theNode = item(0); assert(theNode != 0); DOMServices::getNodeData( *theNode, m_cachedStringValue); } return m_cachedStringValue; } void XNodeSetBase::str( XPathExecutionContext& executionContext, FormatterListener& formatterListener, MemberFunctionPtr function) const { if (m_cachedStringValue.empty() == false) { XObject::string(m_cachedStringValue, formatterListener, function); } else if (getLength() > 0) { const XalanNode* const theNode = item(0); assert(theNode != 0); DOMServices::getNodeData( *theNode, executionContext, formatterListener, function); } } void XNodeSetBase::str( FormatterListener& formatterListener, MemberFunctionPtr function) const { if (m_cachedStringValue.empty() == false) { XObject::string(m_cachedStringValue, formatterListener, function); } else if (getLength() > 0) { const XalanNode* const theNode = item(0); assert(theNode != 0); DOMServices::getNodeData( *theNode, formatterListener, function); } } void XNodeSetBase::str( XPathExecutionContext& executionContext, XalanDOMString& theBuffer) const { if (m_cachedStringValue.empty() == false) { theBuffer.append(m_cachedStringValue); } else if (getLength() > 0) { const XalanNode* const theNode = item(0); assert(theNode != 0); DOMServices::getNodeData( *theNode, executionContext, theBuffer); } } void XNodeSetBase::str(XalanDOMString& theBuffer) const { if (m_cachedStringValue.empty() == false) { theBuffer.append(m_cachedStringValue); } else if (getLength() > 0) { const XalanNode* const theNode = item(0); assert(theNode != 0); DOMServices::getNodeData( *theNode, theBuffer); } } double XNodeSetBase::stringLength(XPathExecutionContext& executionContext) const { if (m_cachedStringValue.empty() == false) { return static_cast<double>(m_cachedStringValue.length()); } else if (getLength() == 0) { return 0; } else { const XalanNode* const theNode = item(0); assert(theNode != 0); FormatterStringLengthCounter theCounter; DOMServices::getNodeData( *theNode, executionContext, theCounter, &FormatterListener::characters); return static_cast<double>(theCounter.getCount()); } } const XalanDocumentFragment& XNodeSetBase::rtree() const { return m_proxy; } void XNodeSetBase::ProcessXObjectTypeCallback(XObjectTypeCallback& theCallbackObject) { theCallbackObject.NodeSet( *this, nodeset()); } void XNodeSetBase::ProcessXObjectTypeCallback(XObjectTypeCallback& theCallbackObject) const { theCallbackObject.NodeSet( *this, nodeset()); } void XNodeSetBase::clearCachedValues() { m_cachedNumberValue = theBogusNumberValue; m_cachedStringValue.clear(); } }
20.420712
88
0.647861
ulisesten
28c3bb370bc935e96fe41d0929b8eb0d65e9f23d
66,324
cpp
C++
docs/round-lcd/LCD_1inch28/font20.cpp
JeremyProffitt/PlatformIO-TTGO-ESP-One-Ring
58a94e5d20fa6dc23dd9d9d275c29e14749aa841
[ "MIT" ]
null
null
null
docs/round-lcd/LCD_1inch28/font20.cpp
JeremyProffitt/PlatformIO-TTGO-ESP-One-Ring
58a94e5d20fa6dc23dd9d9d275c29e14749aa841
[ "MIT" ]
null
null
null
docs/round-lcd/LCD_1inch28/font20.cpp
JeremyProffitt/PlatformIO-TTGO-ESP-One-Ring
58a94e5d20fa6dc23dd9d9d275c29e14749aa841
[ "MIT" ]
null
null
null
/** ****************************************************************************** * @file font20.c * @author MCD Application Team * @version V1.0.0 * @date 18-February-2014 * @brief This file provides text font20 for STM32xx-EVAL's LCD driver. ****************************************************************************** * @attention * * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2> * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. Neither the name of STMicroelectronics nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ****************************************************************************** */ /* Includes ------------------------------------------------------------------*/ #include "fonts.h" // Character bitmaps for Courier New 15pt const uint8_t Font20_Table[] PROGMEM = { // @0 ' ' (14 pixels wide) 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @40 '!' (14 pixels wide) 0x00, 0x00, // 0x07, 0x00, // ### 0x07, 0x00, // ### 0x07, 0x00, // ### 0x07, 0x00, // ### 0x07, 0x00, // ### 0x07, 0x00, // ### 0x07, 0x00, // ### 0x02, 0x00, // # 0x02, 0x00, // # 0x00, 0x00, // 0x00, 0x00, // 0x07, 0x00, // ### 0x07, 0x00, // ### 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @80 '"' (14 pixels wide) 0x00, 0x00, // 0x00, 0x00, // 0x1C, 0xE0, // ### ### 0x1C, 0xE0, // ### ### 0x1C, 0xE0, // ### ### 0x08, 0x40, // # # 0x08, 0x40, // # # 0x08, 0x40, // # # 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @120 '#' (14 pixels wide) 0x0C, 0xC0, // ## ## 0x0C, 0xC0, // ## ## 0x0C, 0xC0, // ## ## 0x0C, 0xC0, // ## ## 0x0C, 0xC0, // ## ## 0x3F, 0xF0, // ########## 0x3F, 0xF0, // ########## 0x0C, 0xC0, // ## ## 0x0C, 0xC0, // ## ## 0x3F, 0xF0, // ########## 0x3F, 0xF0, // ########## 0x0C, 0xC0, // ## ## 0x0C, 0xC0, // ## ## 0x0C, 0xC0, // ## ## 0x0C, 0xC0, // ## ## 0x0C, 0xC0, // ## ## 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @160 '$' (14 pixels wide) 0x03, 0x00, // ## 0x03, 0x00, // ## 0x07, 0xE0, // ###### 0x0F, 0xE0, // ####### 0x18, 0x60, // ## ## 0x18, 0x00, // ## 0x1F, 0x00, // ##### 0x0F, 0xC0, // ###### 0x00, 0xE0, // ### 0x18, 0x60, // ## ## 0x18, 0x60, // ## ## 0x1F, 0xC0, // ####### 0x1F, 0x80, // ###### 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @200 '%' (14 pixels wide) 0x00, 0x00, // 0x1C, 0x00, // ### 0x22, 0x00, // # # 0x22, 0x00, // # # 0x22, 0x00, // # # 0x1C, 0x60, // ### ## 0x01, 0xE0, // #### 0x0F, 0x80, // ##### 0x3C, 0x00, // #### 0x31, 0xC0, // ## ### 0x02, 0x20, // # # 0x02, 0x20, // # # 0x02, 0x20, // # # 0x01, 0xC0, // ### 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @240 '&' (14 pixels wide) 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x03, 0xE0, // ##### 0x0F, 0xE0, // ####### 0x0C, 0x00, // ## 0x0C, 0x00, // ## 0x06, 0x00, // ## 0x0F, 0x30, // #### ## 0x1F, 0xF0, // ######### 0x19, 0xE0, // ## #### 0x18, 0xC0, // ## ## 0x1F, 0xF0, // ######### 0x07, 0xB0, // #### ## 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @280 ''' (14 pixels wide) 0x00, 0x00, // 0x00, 0x00, // 0x03, 0x80, // ### 0x03, 0x80, // ### 0x03, 0x80, // ### 0x01, 0x00, // # 0x01, 0x00, // # 0x01, 0x00, // # 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @320 '(' (14 pixels wide) 0x00, 0x00, // 0x00, 0xC0, // ## 0x00, 0xC0, // ## 0x01, 0x80, // ## 0x01, 0x80, // ## 0x01, 0x80, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x01, 0x80, // ## 0x01, 0x80, // ## 0x01, 0x80, // ## 0x00, 0xC0, // ## 0x00, 0xC0, // ## 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @360 ')' (14 pixels wide) 0x00, 0x00, // 0x0C, 0x00, // ## 0x0C, 0x00, // ## 0x06, 0x00, // ## 0x06, 0x00, // ## 0x06, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x06, 0x00, // ## 0x06, 0x00, // ## 0x06, 0x00, // ## 0x0C, 0x00, // ## 0x0C, 0x00, // ## 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @400 '*' (14 pixels wide) 0x00, 0x00, // 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x1B, 0x60, // ## ## ## 0x1F, 0xE0, // ######## 0x07, 0x80, // #### 0x07, 0x80, // #### 0x0F, 0xC0, // ###### 0x0C, 0xC0, // ## ## 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @440 '+' (14 pixels wide) 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x3F, 0xF0, // ########## 0x3F, 0xF0, // ########## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @480 ',' (14 pixels wide) 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x03, 0x80, // ### 0x03, 0x00, // ## 0x03, 0x00, // ## 0x06, 0x00, // ## 0x06, 0x00, // ## 0x04, 0x00, // # 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @520 '-' (14 pixels wide) 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x3F, 0xE0, // ######### 0x3F, 0xE0, // ######### 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @560 '.' (14 pixels wide) 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x03, 0x80, // ### 0x03, 0x80, // ### 0x03, 0x80, // ### 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @600 '/' (14 pixels wide) 0x00, 0x60, // ## 0x00, 0x60, // ## 0x00, 0xC0, // ## 0x00, 0xC0, // ## 0x00, 0xC0, // ## 0x01, 0x80, // ## 0x01, 0x80, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x06, 0x00, // ## 0x06, 0x00, // ## 0x0C, 0x00, // ## 0x0C, 0x00, // ## 0x0C, 0x00, // ## 0x18, 0x00, // ## 0x18, 0x00, // ## 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @640 '0' (14 pixels wide) 0x00, 0x00, // 0x0F, 0x80, // ##### 0x1F, 0xC0, // ####### 0x18, 0xC0, // ## ## 0x30, 0x60, // ## ## 0x30, 0x60, // ## ## 0x30, 0x60, // ## ## 0x30, 0x60, // ## ## 0x30, 0x60, // ## ## 0x30, 0x60, // ## ## 0x30, 0x60, // ## ## 0x18, 0xC0, // ## ## 0x1F, 0xC0, // ####### 0x0F, 0x80, // ##### 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @680 '1' (14 pixels wide) 0x00, 0x00, // 0x03, 0x00, // ## 0x1F, 0x00, // ##### 0x1F, 0x00, // ##### 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x1F, 0xE0, // ######## 0x1F, 0xE0, // ######## 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @720 '2' (14 pixels wide) 0x00, 0x00, // 0x0F, 0x80, // ##### 0x1F, 0xC0, // ####### 0x38, 0xE0, // ### ### 0x30, 0x60, // ## ## 0x00, 0x60, // ## 0x00, 0xC0, // ## 0x01, 0x80, // ## 0x03, 0x00, // ## 0x06, 0x00, // ## 0x0C, 0x00, // ## 0x18, 0x00, // ## 0x3F, 0xE0, // ######### 0x3F, 0xE0, // ######### 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @760 '3' (14 pixels wide) 0x00, 0x00, // 0x0F, 0x80, // ##### 0x3F, 0xC0, // ######## 0x30, 0xE0, // ## ### 0x00, 0x60, // ## 0x00, 0xE0, // ### 0x07, 0xC0, // ##### 0x07, 0xC0, // ##### 0x00, 0xE0, // ### 0x00, 0x60, // ## 0x00, 0x60, // ## 0x60, 0xE0, // ## ### 0x7F, 0xC0, // ######### 0x3F, 0x80, // ####### 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @800 '4' (14 pixels wide) 0x00, 0x00, // 0x01, 0xC0, // ### 0x03, 0xC0, // #### 0x03, 0xC0, // #### 0x06, 0xC0, // ## ## 0x0C, 0xC0, // ## ## 0x0C, 0xC0, // ## ## 0x18, 0xC0, // ## ## 0x30, 0xC0, // ## ## 0x3F, 0xE0, // ######### 0x3F, 0xE0, // ######### 0x00, 0xC0, // ## 0x03, 0xE0, // ##### 0x03, 0xE0, // ##### 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @840 '5' (14 pixels wide) 0x00, 0x00, // 0x1F, 0xC0, // ####### 0x1F, 0xC0, // ####### 0x18, 0x00, // ## 0x18, 0x00, // ## 0x1F, 0x80, // ###### 0x1F, 0xC0, // ####### 0x18, 0xE0, // ## ### 0x00, 0x60, // ## 0x00, 0x60, // ## 0x00, 0x60, // ## 0x30, 0xE0, // ## ### 0x3F, 0xC0, // ######## 0x1F, 0x80, // ###### 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @880 '6' (14 pixels wide) 0x00, 0x00, // 0x03, 0xE0, // ##### 0x0F, 0xE0, // ####### 0x1E, 0x00, // #### 0x18, 0x00, // ## 0x38, 0x00, // ### 0x37, 0x80, // ## #### 0x3F, 0xC0, // ######## 0x38, 0xE0, // ### ### 0x30, 0x60, // ## ## 0x30, 0x60, // ## ## 0x18, 0xE0, // ## ### 0x1F, 0xC0, // ####### 0x07, 0x80, // #### 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @920 '7' (14 pixels wide) 0x00, 0x00, // 0x3F, 0xE0, // ######### 0x3F, 0xE0, // ######### 0x30, 0x60, // ## ## 0x00, 0x60, // ## 0x00, 0xC0, // ## 0x00, 0xC0, // ## 0x00, 0xC0, // ## 0x01, 0x80, // ## 0x01, 0x80, // ## 0x01, 0x80, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @960 '8' (14 pixels wide) 0x00, 0x00, // 0x0F, 0x80, // ##### 0x1F, 0xC0, // ####### 0x38, 0xE0, // ### ### 0x30, 0x60, // ## ## 0x38, 0xE0, // ### ### 0x1F, 0xC0, // ####### 0x1F, 0xC0, // ####### 0x38, 0xE0, // ### ### 0x30, 0x60, // ## ## 0x30, 0x60, // ## ## 0x38, 0xE0, // ### ### 0x1F, 0xC0, // ####### 0x0F, 0x80, // ##### 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @1000 '9' (14 pixels wide) 0x00, 0x00, // 0x0F, 0x00, // #### 0x1F, 0xC0, // ####### 0x38, 0xC0, // ### ## 0x30, 0x60, // ## ## 0x30, 0x60, // ## ## 0x38, 0xE0, // ### ### 0x1F, 0xE0, // ######## 0x0F, 0x60, // #### ## 0x00, 0xE0, // ### 0x00, 0xC0, // ## 0x03, 0xC0, // #### 0x3F, 0x80, // ####### 0x3E, 0x00, // ##### 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @1040 ':' (14 pixels wide) 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x03, 0x80, // ### 0x03, 0x80, // ### 0x03, 0x80, // ### 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x03, 0x80, // ### 0x03, 0x80, // ### 0x03, 0x80, // ### 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @1080 ';' (14 pixels wide) 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x01, 0xC0, // ### 0x01, 0xC0, // ### 0x01, 0xC0, // ### 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x03, 0x80, // ### 0x03, 0x00, // ## 0x06, 0x00, // ## 0x06, 0x00, // ## 0x04, 0x00, // # 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @1120 '<' (14 pixels wide) 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x30, // ## 0x00, 0xF0, // #### 0x03, 0xC0, // #### 0x07, 0x00, // ### 0x1C, 0x00, // ### 0x78, 0x00, // #### 0x1C, 0x00, // ### 0x07, 0x00, // ### 0x03, 0xC0, // #### 0x00, 0xF0, // #### 0x00, 0x30, // ## 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @1160 '=' (14 pixels wide) 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x7F, 0xF0, // ########### 0x7F, 0xF0, // ########### 0x00, 0x00, // 0x00, 0x00, // 0x7F, 0xF0, // ########### 0x7F, 0xF0, // ########### 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @1200 '>' (14 pixels wide) 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x30, 0x00, // ## 0x3C, 0x00, // #### 0x0F, 0x00, // #### 0x03, 0x80, // ### 0x00, 0xE0, // ### 0x00, 0x78, // #### 0x00, 0xE0, // ### 0x03, 0x80, // ### 0x0F, 0x00, // #### 0x3C, 0x00, // #### 0x30, 0x00, // ## 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @1240 '?' (14 pixels wide) 0x00, 0x00, // 0x00, 0x00, // 0x0F, 0x80, // ##### 0x1F, 0xC0, // ####### 0x18, 0x60, // ## ## 0x18, 0x60, // ## ## 0x00, 0x60, // ## 0x01, 0xC0, // ### 0x03, 0x80, // ### 0x03, 0x00, // ## 0x00, 0x00, // 0x00, 0x00, // 0x07, 0x00, // ### 0x07, 0x00, // ### 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @1280 '@' (14 pixels wide) 0x00, 0x00, // 0x03, 0x80, // ### 0x0C, 0x80, // ## # 0x08, 0x40, // # # 0x10, 0x40, // # # 0x10, 0x40, // # # 0x11, 0xC0, // # ### 0x12, 0x40, // # # # 0x12, 0x40, // # # # 0x12, 0x40, // # # # 0x11, 0xC0, // # ### 0x10, 0x00, // # 0x08, 0x00, // # 0x08, 0x40, // # # 0x07, 0x80, // #### 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @1320 'A' (14 pixels wide) 0x00, 0x00, // 0x00, 0x00, // 0x1F, 0x80, // ###### 0x1F, 0x80, // ###### 0x03, 0x80, // ### 0x06, 0xC0, // ## ## 0x06, 0xC0, // ## ## 0x0C, 0xC0, // ## ## 0x0C, 0x60, // ## ## 0x1F, 0xE0, // ######## 0x1F, 0xE0, // ######## 0x30, 0x30, // ## ## 0x78, 0x78, // #### #### 0x78, 0x78, // #### #### 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @1360 'B' (14 pixels wide) 0x00, 0x00, // 0x00, 0x00, // 0x3F, 0x80, // ####### 0x3F, 0xC0, // ######## 0x18, 0x60, // ## ## 0x18, 0x60, // ## ## 0x18, 0xE0, // ## ### 0x1F, 0xC0, // ####### 0x1F, 0xE0, // ######## 0x18, 0x70, // ## ### 0x18, 0x30, // ## ## 0x18, 0x30, // ## ## 0x3F, 0xF0, // ########## 0x3F, 0xE0, // ######### 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @1400 'C' (14 pixels wide) 0x00, 0x00, // 0x00, 0x00, // 0x07, 0xB0, // #### ## 0x0F, 0xF0, // ######## 0x1C, 0x70, // ### ### 0x38, 0x30, // ### ## 0x30, 0x00, // ## 0x30, 0x00, // ## 0x30, 0x00, // ## 0x30, 0x00, // ## 0x38, 0x30, // ### ## 0x1C, 0x70, // ### ### 0x0F, 0xE0, // ####### 0x07, 0xC0, // ##### 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @1440 'D' (14 pixels wide) 0x00, 0x00, // 0x00, 0x00, // 0x7F, 0x80, // ######## 0x7F, 0xC0, // ######### 0x30, 0xE0, // ## ### 0x30, 0x70, // ## ### 0x30, 0x30, // ## ## 0x30, 0x30, // ## ## 0x30, 0x30, // ## ## 0x30, 0x30, // ## ## 0x30, 0x70, // ## ### 0x30, 0xE0, // ## ### 0x7F, 0xC0, // ######### 0x7F, 0x80, // ######## 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @1480 'E' (14 pixels wide) 0x00, 0x00, // 0x00, 0x00, // 0x3F, 0xF0, // ########## 0x3F, 0xF0, // ########## 0x18, 0x30, // ## ## 0x18, 0x30, // ## ## 0x19, 0x80, // ## ## 0x1F, 0x80, // ###### 0x1F, 0x80, // ###### 0x19, 0x80, // ## ## 0x18, 0x30, // ## ## 0x18, 0x30, // ## ## 0x3F, 0xF0, // ########## 0x3F, 0xF0, // ########## 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @1520 'F' (14 pixels wide) 0x00, 0x00, // 0x00, 0x00, // 0x3F, 0xF0, // ########## 0x3F, 0xF0, // ########## 0x18, 0x30, // ## ## 0x18, 0x30, // ## ## 0x19, 0x80, // ## ## 0x1F, 0x80, // ###### 0x1F, 0x80, // ###### 0x19, 0x80, // ## ## 0x18, 0x00, // ## 0x18, 0x00, // ## 0x3F, 0x00, // ###### 0x3F, 0x00, // ###### 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @1560 'G' (14 pixels wide) 0x00, 0x00, // 0x00, 0x00, // 0x07, 0xB0, // #### ## 0x1F, 0xF0, // ######### 0x18, 0x70, // ## ### 0x30, 0x30, // ## ## 0x30, 0x00, // ## 0x30, 0x00, // ## 0x31, 0xF8, // ## ###### 0x31, 0xF8, // ## ###### 0x30, 0x30, // ## ## 0x18, 0x30, // ## ## 0x1F, 0xF0, // ######### 0x07, 0xC0, // ##### 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @1600 'H' (14 pixels wide) 0x00, 0x00, // 0x00, 0x00, // 0x3C, 0xF0, // #### #### 0x3C, 0xF0, // #### #### 0x18, 0x60, // ## ## 0x18, 0x60, // ## ## 0x18, 0x60, // ## ## 0x1F, 0xE0, // ######## 0x1F, 0xE0, // ######## 0x18, 0x60, // ## ## 0x18, 0x60, // ## ## 0x18, 0x60, // ## ## 0x3C, 0xF0, // #### #### 0x3C, 0xF0, // #### #### 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @1640 'I' (14 pixels wide) 0x00, 0x00, // 0x00, 0x00, // 0x1F, 0xE0, // ######## 0x1F, 0xE0, // ######## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x1F, 0xE0, // ######## 0x1F, 0xE0, // ######## 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @1680 'J' (14 pixels wide) 0x00, 0x00, // 0x00, 0x00, // 0x03, 0xF8, // ####### 0x03, 0xF8, // ####### 0x00, 0x60, // ## 0x00, 0x60, // ## 0x00, 0x60, // ## 0x00, 0x60, // ## 0x30, 0x60, // ## ## 0x30, 0x60, // ## ## 0x30, 0x60, // ## ## 0x30, 0xE0, // ## ### 0x3F, 0xC0, // ######## 0x0F, 0x80, // ##### 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @1720 'K' (14 pixels wide) 0x00, 0x00, // 0x00, 0x00, // 0x3E, 0xF8, // ##### ##### 0x3E, 0xF8, // ##### ##### 0x18, 0xE0, // ## ### 0x19, 0x80, // ## ## 0x1B, 0x00, // ## ## 0x1F, 0x00, // ##### 0x1D, 0x80, // ### ## 0x18, 0xC0, // ## ## 0x18, 0xC0, // ## ## 0x18, 0x60, // ## ## 0x3E, 0x78, // ##### #### 0x3E, 0x38, // ##### ### 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @1760 'L' (14 pixels wide) 0x00, 0x00, // 0x00, 0x00, // 0x3F, 0x00, // ###### 0x3F, 0x00, // ###### 0x0C, 0x00, // ## 0x0C, 0x00, // ## 0x0C, 0x00, // ## 0x0C, 0x00, // ## 0x0C, 0x00, // ## 0x0C, 0x30, // ## ## 0x0C, 0x30, // ## ## 0x0C, 0x30, // ## ## 0x3F, 0xF0, // ########## 0x3F, 0xF0, // ########## 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @1800 'M' (14 pixels wide) 0x00, 0x00, // 0x00, 0x00, // 0x78, 0x78, // #### #### 0x78, 0x78, // #### #### 0x38, 0x70, // ### ### 0x3C, 0xF0, // #### #### 0x34, 0xB0, // ## # # ## 0x37, 0xB0, // ## #### ## 0x37, 0xB0, // ## #### ## 0x33, 0x30, // ## ## ## 0x33, 0x30, // ## ## ## 0x30, 0x30, // ## ## 0x7C, 0xF8, // ##### ##### 0x7C, 0xF8, // ##### ##### 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @1840 'N' (14 pixels wide) 0x00, 0x00, // 0x00, 0x00, // 0x39, 0xF0, // ### ##### 0x3D, 0xF0, // #### ##### 0x1C, 0x60, // ### ## 0x1E, 0x60, // #### ## 0x1E, 0x60, // #### ## 0x1B, 0x60, // ## ## ## 0x1B, 0x60, // ## ## ## 0x19, 0xE0, // ## #### 0x19, 0xE0, // ## #### 0x18, 0xE0, // ## ### 0x3E, 0xE0, // ##### ### 0x3E, 0x60, // ##### ## 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @1880 'O' (14 pixels wide) 0x00, 0x00, // 0x00, 0x00, // 0x07, 0x80, // #### 0x0F, 0xC0, // ###### 0x1C, 0xE0, // ### ### 0x38, 0x70, // ### ### 0x30, 0x30, // ## ## 0x30, 0x30, // ## ## 0x30, 0x30, // ## ## 0x30, 0x30, // ## ## 0x38, 0x70, // ### ### 0x1C, 0xE0, // ### ### 0x0F, 0xC0, // ###### 0x07, 0x80, // #### 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @1920 'P' (14 pixels wide) 0x00, 0x00, // 0x00, 0x00, // 0x3F, 0xC0, // ######## 0x3F, 0xE0, // ######### 0x18, 0x70, // ## ### 0x18, 0x30, // ## ## 0x18, 0x30, // ## ## 0x18, 0x70, // ## ### 0x1F, 0xE0, // ######## 0x1F, 0xC0, // ####### 0x18, 0x00, // ## 0x18, 0x00, // ## 0x3F, 0x00, // ###### 0x3F, 0x00, // ###### 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @1960 'Q' (14 pixels wide) 0x00, 0x00, // 0x00, 0x00, // 0x07, 0x80, // #### 0x0F, 0xC0, // ###### 0x1C, 0xE0, // ### ### 0x38, 0x70, // ### ### 0x30, 0x30, // ## ## 0x30, 0x30, // ## ## 0x30, 0x30, // ## ## 0x30, 0x30, // ## ## 0x38, 0x70, // ### ### 0x1C, 0xE0, // ### ### 0x0F, 0xC0, // ###### 0x07, 0x80, // #### 0x07, 0xB0, // #### ## 0x0F, 0xF0, // ######## 0x0C, 0xE0, // ## ### 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @2000 'R' (14 pixels wide) 0x00, 0x00, // 0x00, 0x00, // 0x3F, 0xC0, // ######## 0x3F, 0xE0, // ######### 0x18, 0x70, // ## ### 0x18, 0x30, // ## ## 0x18, 0x70, // ## ### 0x1F, 0xE0, // ######## 0x1F, 0xC0, // ####### 0x18, 0xE0, // ## ### 0x18, 0x60, // ## ## 0x18, 0x70, // ## ### 0x3E, 0x38, // ##### ### 0x3E, 0x18, // ##### ## 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @2040 'S' (14 pixels wide) 0x00, 0x00, // 0x00, 0x00, // 0x0F, 0xB0, // ##### ## 0x1F, 0xF0, // ######### 0x38, 0x70, // ### ### 0x30, 0x30, // ## ## 0x38, 0x00, // ### 0x1F, 0x80, // ###### 0x07, 0xE0, // ###### 0x00, 0x70, // ### 0x30, 0x30, // ## ## 0x38, 0x70, // ### ### 0x3F, 0xE0, // ######### 0x37, 0xC0, // ## ##### 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @2080 'T' (14 pixels wide) 0x00, 0x00, // 0x00, 0x00, // 0x3F, 0xF0, // ########## 0x3F, 0xF0, // ########## 0x33, 0x30, // ## ## ## 0x33, 0x30, // ## ## ## 0x33, 0x30, // ## ## ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x0F, 0xC0, // ###### 0x0F, 0xC0, // ###### 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @2120 'U' (14 pixels wide) 0x00, 0x00, // 0x00, 0x00, // 0x3C, 0xF0, // #### #### 0x3C, 0xF0, // #### #### 0x18, 0x60, // ## ## 0x18, 0x60, // ## ## 0x18, 0x60, // ## ## 0x18, 0x60, // ## ## 0x18, 0x60, // ## ## 0x18, 0x60, // ## ## 0x18, 0x60, // ## ## 0x1C, 0xE0, // ### ### 0x0F, 0xC0, // ###### 0x07, 0x80, // #### 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @2160 'V' (14 pixels wide) 0x00, 0x00, // 0x00, 0x00, // 0x78, 0xF0, // #### #### 0x78, 0xF0, // #### #### 0x30, 0x60, // ## ## 0x30, 0x60, // ## ## 0x18, 0xC0, // ## ## 0x18, 0xC0, // ## ## 0x0D, 0x80, // ## ## 0x0D, 0x80, // ## ## 0x0D, 0x80, // ## ## 0x07, 0x00, // ### 0x07, 0x00, // ### 0x07, 0x00, // ### 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @2200 'W' (14 pixels wide) 0x00, 0x00, // 0x00, 0x00, // 0x7C, 0x7C, // ##### ##### 0x7C, 0x7C, // ##### ##### 0x30, 0x18, // ## ## 0x33, 0x98, // ## ### ## 0x33, 0x98, // ## ### ## 0x33, 0x98, // ## ### ## 0x36, 0xD8, // ## ## ## ## 0x16, 0xD0, // # ## ## # 0x1C, 0x70, // ### ### 0x1C, 0x70, // ### ### 0x1C, 0x70, // ### ### 0x18, 0x30, // ## ## 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @2240 'X' (14 pixels wide) 0x00, 0x00, // 0x00, 0x00, // 0x78, 0xF0, // #### #### 0x78, 0xF0, // #### #### 0x30, 0x60, // ## ## 0x18, 0xC0, // ## ## 0x0D, 0x80, // ## ## 0x07, 0x00, // ### 0x07, 0x00, // ### 0x0D, 0x80, // ## ## 0x18, 0xC0, // ## ## 0x30, 0x60, // ## ## 0x78, 0xF0, // #### #### 0x78, 0xF0, // #### #### 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @2280 'Y' (14 pixels wide) 0x00, 0x00, // 0x00, 0x00, // 0x3C, 0xF0, // #### #### 0x3C, 0xF0, // #### #### 0x18, 0x60, // ## ## 0x0C, 0xC0, // ## ## 0x07, 0x80, // #### 0x07, 0x80, // #### 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x0F, 0xC0, // ###### 0x0F, 0xC0, // ###### 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @2320 'Z' (14 pixels wide) 0x00, 0x00, // 0x00, 0x00, // 0x1F, 0xE0, // ######## 0x1F, 0xE0, // ######## 0x18, 0x60, // ## ## 0x18, 0xC0, // ## ## 0x01, 0x80, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x06, 0x00, // ## 0x0C, 0x60, // ## ## 0x18, 0x60, // ## ## 0x1F, 0xE0, // ######## 0x1F, 0xE0, // ######## 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @2360 '[' (14 pixels wide) 0x00, 0x00, // 0x03, 0xC0, // #### 0x03, 0xC0, // #### 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0xC0, // #### 0x03, 0xC0, // #### 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @2400 '\' (14 pixels wide) 0x18, 0x00, // ## 0x18, 0x00, // ## 0x0C, 0x00, // ## 0x0C, 0x00, // ## 0x0C, 0x00, // ## 0x06, 0x00, // ## 0x06, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x01, 0x80, // ## 0x01, 0x80, // ## 0x00, 0xC0, // ## 0x00, 0xC0, // ## 0x00, 0xC0, // ## 0x00, 0x60, // ## 0x00, 0x60, // ## 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @2440 ']' (14 pixels wide) 0x00, 0x00, // 0x0F, 0x00, // #### 0x0F, 0x00, // #### 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x0F, 0x00, // #### 0x0F, 0x00, // #### 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @2480 '^' (14 pixels wide) 0x00, 0x00, // 0x02, 0x00, // # 0x07, 0x00, // ### 0x0D, 0x80, // ## ## 0x18, 0xC0, // ## ## 0x30, 0x60, // ## ## 0x20, 0x20, // # # 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @2520 '_' (14 pixels wide) 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0xFF, 0xFC, // ############## 0xFF, 0xFC, // ############## // @2560 '`' (14 pixels wide) 0x00, 0x00, // 0x04, 0x00, // # 0x03, 0x00, // ## 0x00, 0x80, // # 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @2600 'a' (14 pixels wide) 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x0F, 0xC0, // ###### 0x1F, 0xE0, // ######## 0x00, 0x60, // ## 0x0F, 0xE0, // ####### 0x1F, 0xE0, // ######## 0x38, 0x60, // ### ## 0x30, 0xE0, // ## ### 0x3F, 0xF0, // ########## 0x1F, 0x70, // ##### ### 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @2640 'b' (14 pixels wide) 0x00, 0x00, // 0x70, 0x00, // ### 0x70, 0x00, // ### 0x30, 0x00, // ## 0x30, 0x00, // ## 0x37, 0x80, // ## #### 0x3F, 0xE0, // ######### 0x38, 0x60, // ### ## 0x30, 0x30, // ## ## 0x30, 0x30, // ## ## 0x30, 0x30, // ## ## 0x38, 0x60, // ### ## 0x7F, 0xE0, // ########## 0x77, 0x80, // ### #### 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @2680 'c' (14 pixels wide) 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x07, 0xB0, // #### ## 0x1F, 0xF0, // ######### 0x18, 0x30, // ## ## 0x30, 0x30, // ## ## 0x30, 0x00, // ## 0x30, 0x00, // ## 0x38, 0x30, // ### ## 0x1F, 0xF0, // ######### 0x0F, 0xC0, // ###### 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @2720 'd' (14 pixels wide) 0x00, 0x00, // 0x00, 0x70, // ### 0x00, 0x70, // ### 0x00, 0x30, // ## 0x00, 0x30, // ## 0x07, 0xB0, // #### ## 0x1F, 0xF0, // ######### 0x18, 0x70, // ## ### 0x30, 0x30, // ## ## 0x30, 0x30, // ## ## 0x30, 0x30, // ## ## 0x38, 0x70, // ### ### 0x1F, 0xF8, // ########## 0x07, 0xB8, // #### ### 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @2760 'e' (14 pixels wide) 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x07, 0x80, // #### 0x1F, 0xE0, // ######## 0x18, 0x60, // ## ## 0x3F, 0xF0, // ########## 0x3F, 0xF0, // ########## 0x30, 0x00, // ## 0x18, 0x30, // ## ## 0x1F, 0xF0, // ######### 0x07, 0xC0, // ##### 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @2800 'f' (14 pixels wide) 0x00, 0x00, // 0x03, 0xF0, // ###### 0x07, 0xF0, // ####### 0x06, 0x00, // ## 0x06, 0x00, // ## 0x1F, 0xE0, // ######## 0x1F, 0xE0, // ######## 0x06, 0x00, // ## 0x06, 0x00, // ## 0x06, 0x00, // ## 0x06, 0x00, // ## 0x06, 0x00, // ## 0x1F, 0xE0, // ######## 0x1F, 0xE0, // ######## 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @2840 'g' (14 pixels wide) 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x07, 0xB8, // #### ### 0x1F, 0xF8, // ########## 0x18, 0x70, // ## ### 0x30, 0x30, // ## ## 0x30, 0x30, // ## ## 0x30, 0x30, // ## ## 0x18, 0x70, // ## ### 0x1F, 0xF0, // ######### 0x07, 0xB0, // #### ## 0x00, 0x30, // ## 0x00, 0x70, // ### 0x0F, 0xE0, // ####### 0x0F, 0xC0, // ###### 0x00, 0x00, // 0x00, 0x00, // // @2880 'h' (14 pixels wide) 0x00, 0x00, // 0x38, 0x00, // ### 0x38, 0x00, // ### 0x18, 0x00, // ## 0x18, 0x00, // ## 0x1B, 0xC0, // ## #### 0x1F, 0xE0, // ######## 0x1C, 0x60, // ### ## 0x18, 0x60, // ## ## 0x18, 0x60, // ## ## 0x18, 0x60, // ## ## 0x18, 0x60, // ## ## 0x3C, 0xF0, // #### #### 0x3C, 0xF0, // #### #### 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @2920 'i' (14 pixels wide) 0x00, 0x00, // 0x03, 0x00, // ## 0x03, 0x00, // ## 0x00, 0x00, // 0x00, 0x00, // 0x1F, 0x00, // ##### 0x1F, 0x00, // ##### 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x1F, 0xE0, // ######## 0x1F, 0xE0, // ######## 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @2960 'j' (14 pixels wide) 0x00, 0x00, // 0x03, 0x00, // ## 0x03, 0x00, // ## 0x00, 0x00, // 0x00, 0x00, // 0x1F, 0xC0, // ####### 0x1F, 0xC0, // ####### 0x00, 0xC0, // ## 0x00, 0xC0, // ## 0x00, 0xC0, // ## 0x00, 0xC0, // ## 0x00, 0xC0, // ## 0x00, 0xC0, // ## 0x00, 0xC0, // ## 0x00, 0xC0, // ## 0x01, 0xC0, // ### 0x3F, 0x80, // ####### 0x3F, 0x00, // ###### 0x00, 0x00, // 0x00, 0x00, // // @3000 'k' (14 pixels wide) 0x00, 0x00, // 0x38, 0x00, // ### 0x38, 0x00, // ### 0x18, 0x00, // ## 0x18, 0x00, // ## 0x1B, 0xE0, // ## ##### 0x1B, 0xE0, // ## ##### 0x1B, 0x00, // ## ## 0x1E, 0x00, // #### 0x1E, 0x00, // #### 0x1B, 0x00, // ## ## 0x19, 0x80, // ## ## 0x39, 0xF0, // ### ##### 0x39, 0xF0, // ### ##### 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @3040 'l' (14 pixels wide) 0x00, 0x00, // 0x1F, 0x00, // ##### 0x1F, 0x00, // ##### 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x1F, 0xE0, // ######## 0x1F, 0xE0, // ######## 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @3080 'm' (14 pixels wide) 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x7E, 0xE0, // ###### ### 0x7F, 0xF0, // ########### 0x33, 0x30, // ## ## ## 0x33, 0x30, // ## ## ## 0x33, 0x30, // ## ## ## 0x33, 0x30, // ## ## ## 0x33, 0x30, // ## ## ## 0x7B, 0xB8, // #### ### ### 0x7B, 0xB8, // #### ### ### 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @3120 'n' (14 pixels wide) 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x3B, 0xC0, // ### #### 0x3F, 0xE0, // ######### 0x1C, 0x60, // ### ## 0x18, 0x60, // ## ## 0x18, 0x60, // ## ## 0x18, 0x60, // ## ## 0x18, 0x60, // ## ## 0x3C, 0xF0, // #### #### 0x3C, 0xF0, // #### #### 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @3160 'o' (14 pixels wide) 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x07, 0x80, // #### 0x1F, 0xE0, // ######## 0x18, 0x60, // ## ## 0x30, 0x30, // ## ## 0x30, 0x30, // ## ## 0x30, 0x30, // ## ## 0x18, 0x60, // ## ## 0x1F, 0xE0, // ######## 0x07, 0x80, // #### 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @3200 'p' (14 pixels wide) 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x77, 0x80, // ### #### 0x7F, 0xE0, // ########## 0x38, 0x60, // ### ## 0x30, 0x30, // ## ## 0x30, 0x30, // ## ## 0x30, 0x30, // ## ## 0x38, 0x60, // ### ## 0x3F, 0xE0, // ######### 0x37, 0x80, // ## #### 0x30, 0x00, // ## 0x30, 0x00, // ## 0x7C, 0x00, // ##### 0x7C, 0x00, // ##### 0x00, 0x00, // 0x00, 0x00, // // @3240 'q' (14 pixels wide) 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x07, 0xB8, // #### ### 0x1F, 0xF8, // ########## 0x18, 0x70, // ## ### 0x30, 0x30, // ## ## 0x30, 0x30, // ## ## 0x30, 0x30, // ## ## 0x18, 0x70, // ## ### 0x1F, 0xF0, // ######### 0x07, 0xB0, // #### ## 0x00, 0x30, // ## 0x00, 0x30, // ## 0x00, 0xF8, // ##### 0x00, 0xF8, // ##### 0x00, 0x00, // 0x00, 0x00, // // @3280 'r' (14 pixels wide) 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x3C, 0xE0, // #### ### 0x3D, 0xF0, // #### ##### 0x0F, 0x30, // #### ## 0x0E, 0x00, // ### 0x0C, 0x00, // ## 0x0C, 0x00, // ## 0x0C, 0x00, // ## 0x3F, 0xC0, // ######## 0x3F, 0xC0, // ######## 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @3320 's' (14 pixels wide) 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x07, 0xE0, // ###### 0x1F, 0xE0, // ######## 0x18, 0x60, // ## ## 0x1E, 0x00, // #### 0x0F, 0xC0, // ###### 0x01, 0xE0, // #### 0x18, 0x60, // ## ## 0x1F, 0xE0, // ######## 0x1F, 0x80, // ###### 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @3360 't' (14 pixels wide) 0x00, 0x00, // 0x00, 0x00, // 0x0C, 0x00, // ## 0x0C, 0x00, // ## 0x0C, 0x00, // ## 0x3F, 0xE0, // ######### 0x3F, 0xE0, // ######### 0x0C, 0x00, // ## 0x0C, 0x00, // ## 0x0C, 0x00, // ## 0x0C, 0x00, // ## 0x0C, 0x30, // ## ## 0x0F, 0xF0, // ######## 0x07, 0xC0, // ##### 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @3400 'u' (14 pixels wide) 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x38, 0xE0, // ### ### 0x38, 0xE0, // ### ### 0x18, 0x60, // ## ## 0x18, 0x60, // ## ## 0x18, 0x60, // ## ## 0x18, 0x60, // ## ## 0x18, 0xE0, // ## ### 0x1F, 0xF0, // ######### 0x0F, 0x70, // #### ### 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @3440 'v' (14 pixels wide) 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x78, 0xF0, // #### #### 0x78, 0xF0, // #### #### 0x30, 0x60, // ## ## 0x18, 0xC0, // ## ## 0x18, 0xC0, // ## ## 0x0D, 0x80, // ## ## 0x0D, 0x80, // ## ## 0x07, 0x00, // ### 0x07, 0x00, // ### 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @3480 'w' (14 pixels wide) 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x78, 0xF0, // #### #### 0x78, 0xF0, // #### #### 0x32, 0x60, // ## # ## 0x32, 0x60, // ## # ## 0x37, 0xE0, // ## ###### 0x1D, 0xC0, // ### ### 0x1D, 0xC0, // ### ### 0x18, 0xC0, // ## ## 0x18, 0xC0, // ## ## 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @3520 'x' (14 pixels wide) 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x3C, 0xF0, // #### #### 0x3C, 0xF0, // #### #### 0x0C, 0xC0, // ## ## 0x07, 0x80, // #### 0x03, 0x00, // ## 0x07, 0x80, // #### 0x0C, 0xC0, // ## ## 0x3C, 0xF0, // #### #### 0x3C, 0xF0, // #### #### 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @3560 'y' (14 pixels wide) 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x78, 0xF0, // #### #### 0x78, 0xF0, // #### #### 0x30, 0x60, // ## ## 0x18, 0xC0, // ## ## 0x18, 0xC0, // ## ## 0x0D, 0x80, // ## ## 0x0F, 0x80, // ##### 0x07, 0x00, // ### 0x06, 0x00, // ## 0x06, 0x00, // ## 0x0C, 0x00, // ## 0x7F, 0x00, // ####### 0x7F, 0x00, // ####### 0x00, 0x00, // 0x00, 0x00, // // @3600 'z' (14 pixels wide) 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x1F, 0xE0, // ######## 0x1F, 0xE0, // ######## 0x18, 0xC0, // ## ## 0x01, 0x80, // ## 0x03, 0x00, // ## 0x06, 0x00, // ## 0x0C, 0x60, // ## ## 0x1F, 0xE0, // ######## 0x1F, 0xE0, // ######## 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @3640 '{' (14 pixels wide) 0x00, 0x00, // 0x01, 0xC0, // ### 0x03, 0xC0, // #### 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x07, 0x00, // ### 0x0E, 0x00, // ### 0x07, 0x00, // ### 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0xC0, // #### 0x01, 0xC0, // ### 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @3680 '|' (14 pixels wide) 0x00, 0x00, // 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x03, 0x00, // ## 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @3720 '}' (14 pixels wide) 0x00, 0x00, // 0x1C, 0x00, // ### 0x1E, 0x00, // #### 0x06, 0x00, // ## 0x06, 0x00, // ## 0x06, 0x00, // ## 0x06, 0x00, // ## 0x06, 0x00, // ## 0x07, 0x00, // ### 0x03, 0x80, // ### 0x07, 0x00, // ### 0x06, 0x00, // ## 0x06, 0x00, // ## 0x06, 0x00, // ## 0x06, 0x00, // ## 0x1E, 0x00, // #### 0x1C, 0x00, // ### 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // // @3760 '~' (14 pixels wide) 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x0E, 0x00, // ### 0x3F, 0x30, // ###### ## 0x33, 0xF0, // ## ###### 0x01, 0xE0, // #### 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // 0x00, 0x00, // }; sFONT Font20 = { Font20_Table, 14, /* Width */ 20, /* Height */ }; /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
30.934701
84
0.275375
JeremyProffitt
28c42c9c848d3453afdf9cf8faab0da1b5354d9e
9,043
cpp
C++
simulator/infra/cache/cache_tag_array.cpp
VasiliyMatr/mipt-mips
6331f0f07a061d5fbd849b24d996d363f343fef9
[ "MIT" ]
351
2015-09-23T08:30:41.000Z
2022-03-19T09:25:05.000Z
simulator/infra/cache/cache_tag_array.cpp
VasiliyMatr/mipt-mips
6331f0f07a061d5fbd849b24d996d363f343fef9
[ "MIT" ]
1,098
2016-04-14T18:24:01.000Z
2022-03-28T09:15:05.000Z
simulator/infra/cache/cache_tag_array.cpp
VasiliyMatr/mipt-mips
6331f0f07a061d5fbd849b24d996d363f343fef9
[ "MIT" ]
243
2016-01-03T02:46:01.000Z
2021-11-23T14:49:09.000Z
/** * cache_tag_array.cpp * Implementation of the cache tag array model. * @author Oleg Ladin, Denis Los, Andrey Agrachev, Pavel Kryukov * Copyright 2014-2019 MIPT-MIPS */ #include "infra/cache/cache_tag_array.h" #include "infra/macro.h" #include "infra/replacement/cache_replacement.h" #include <sparsehash/dense_hash_map.h> #include <utility> #include <vector> class AlwaysHitCacheTagArray : public CacheTagArray { public: uint32 set( Addr /* unused */) const final { return 0; } Addr tag( Addr addr) const final { return addr; } int32 write( Addr /* unused */) final { return -1; } std::pair<bool, int32> read( Addr addr) final { return read_no_touch( addr); } std::pair<bool, int32> read_no_touch( Addr /* unused */) const final { return {true, -1}; } }; class InfiniteCacheTagArray : public CacheTagArray { public: InfiniteCacheTagArray() { lookup_helper.set_empty_key( impossible_key); lookup_helper.set_deleted_key( impossible_key - 1); } uint32 set( Addr /* unused */) const final { return 0; } Addr tag( Addr addr) const final { return addr; } int32 write( Addr addr) final; std::pair<bool, int32> read( Addr addr) final { return read_no_touch( addr); } std::pair<bool, int32> read_no_touch( Addr addr) const final; private: std::vector<Addr> tags; // hash table to lookup tags in O(1) google::dense_hash_map<Addr, int32> lookup_helper; const int32 impossible_key = INT32_MAX; }; std::pair<bool, int32> InfiniteCacheTagArray::read_no_touch( Addr addr) const { auto res = lookup_helper.find( addr); return res == lookup_helper.end() ? std::pair{ false, -1 } : std::pair{ true, res->second }; } int32 InfiniteCacheTagArray::write( Addr addr) { auto result = read_no_touch( addr); if ( result.first) return result.second; auto way = narrow_cast<int32>( tags.size()); tags.emplace_back( addr); lookup_helper.emplace( addr, way); return way; } // Cache tag array module implementation class CacheTagArraySizeCheck : public CacheTagArray { public: CacheTagArraySizeCheck( uint32 size_in_bytes, uint32 ways, uint32 line_size, uint32 addr_size_in_bits ); uint32 size_in_bytes; uint32 ways; const uint32 line_size; const uint32 addr_size_in_bits; }; CacheTagArraySizeCheck::CacheTagArraySizeCheck( uint32 size_in_bytes, uint32 ways, uint32 line_size, uint32 addr_size_in_bits) : size_in_bytes( size_in_bytes) , ways( ways) , line_size( line_size) , addr_size_in_bits( addr_size_in_bits) { if ( size_in_bytes == 0) throw CacheTagArrayInvalidSizeException("Cache size should be greater than zero"); if ( ways == 0) throw CacheTagArrayInvalidSizeException("Num of ways should be greater than zero"); if ( line_size == 0) throw CacheTagArrayInvalidSizeException("Size of the line should be greater than zero"); if ( addr_size_in_bits == 0) throw CacheTagArrayInvalidSizeException("Address size should be greater than zero"); if ( addr_size_in_bits > 32) throw CacheTagArrayInvalidSizeException("Address size should be less or equal than 32"); if ( size_in_bytes < ways * line_size) throw CacheTagArrayInvalidSizeException("Cache size should be greater" "than the number of ways multiplied by line size"); if ( !is_power_of_two( size_in_bytes)) throw CacheTagArrayInvalidSizeException("Cache size should be a power of 2"); if ( !is_power_of_two( line_size)) throw CacheTagArrayInvalidSizeException("Block size should be a power of 2"); if ( size_in_bytes % ( line_size * ways) != 0) throw CacheTagArrayInvalidSizeException("Cache size should be multiple of"); } class CacheTagArraySize : public CacheTagArraySizeCheck { protected: CacheTagArraySize( uint32 size_in_bytes, uint32 ways, uint32 line_size, uint32 addr_size_in_bits ) : CacheTagArraySizeCheck( size_in_bytes, ways, line_size, addr_size_in_bits) , line_bits( std::countr_zero( line_size)) // the number of offset bits , sets( size_in_bytes / ( ways * line_size)) , set_bits( std::countr_zero( sets) + line_bits) , addr_mask( bitmask<Addr>( addr_size_in_bits)) { } auto get_line_bits() const noexcept { return line_bits; } public: const size_t line_bits; uint32 sets; const size_t set_bits; const Addr addr_mask; uint32 set( Addr addr) const final { return ( ( addr & addr_mask) >> line_bits) & (sets - 1); } Addr tag( Addr addr) const final { return ( addr & addr_mask) >> set_bits; } }; class ReplacementModule { public: ReplacementModule( std::size_t number_of_sets, std::size_t number_of_ways, const std::string& replacement_policy); void touch( uint32 num_set, uint32 num_way) { replacement_info[ num_set]->touch( num_way); } auto update( uint32 num_set) { return replacement_info[ num_set]->update(); } private: std::vector<std::unique_ptr<CacheReplacement>> replacement_info; }; ReplacementModule::ReplacementModule( std::size_t number_of_sets, std::size_t number_of_ways, const std::string& replacement_policy) : replacement_info( number_of_sets) { for (auto& e : replacement_info) e = create_cache_replacement( replacement_policy, number_of_ways); } class SimpleCacheTagArray : public CacheTagArraySize { public: SimpleCacheTagArray( uint32 size_in_bytes, uint32 ways, uint32 line_size, uint32 addr_size_in_bits, const std::string& repl_policy ); int32 write( Addr addr) final; std::pair<bool, int32> read( Addr addr) final; std::pair<bool, int32> read_no_touch( Addr addr) const final; private: struct Tag { bool is_valid = false; Addr tag = {}; }; // tags storage std::vector<std::vector<Tag>> tags; // hash table to lookup tags in O(1) std::vector<google::dense_hash_map<Addr, int32>> lookup_helper; const int32 impossible_key = INT32_MAX; std::unique_ptr<ReplacementModule> replacement_module = nullptr; }; SimpleCacheTagArray::SimpleCacheTagArray( uint32 size_in_bytes, uint32 ways, uint32 line_size, uint32 addr_size_in_bits, const std::string& repl_policy) : CacheTagArraySize( size_in_bytes, ways, line_size, addr_size_in_bits) , tags( sets, std::vector<Tag>( ways)) , lookup_helper( sets, google::dense_hash_map<Addr, int32>( ways)) { replacement_module = std::make_unique<ReplacementModule>( sets, ways, repl_policy); // these are special dense_hash_map requirements for (uint32 i = 0; i < sets; i++) { lookup_helper[i].set_empty_key( impossible_key); lookup_helper[i].set_deleted_key( impossible_key - 1); } } std::pair<bool, int32> SimpleCacheTagArray::read( Addr addr) { const auto lookup_result = read_no_touch( addr); const auto&[ is_hit, way] = lookup_result; if ( is_hit) { uint32 num_set = set( addr); replacement_module->touch( num_set, way); // for replacement policy (updates the current address) } return lookup_result; } std::pair<bool, int32> SimpleCacheTagArray::read_no_touch( Addr addr) const { const uint32 num_set = set( addr); const Addr num_tag = tag( addr); const auto& result = lookup_helper[ num_set].find( num_tag); return ( result != lookup_helper[ num_set].end()) ? std::pair{ true, result->second} : std::pair{ false, -1}; } int32 SimpleCacheTagArray::write( Addr addr) { const Addr new_tag = tag( addr); // get cache coordinates const uint32 num_set = set( addr); const auto way = narrow_cast<int32>( replacement_module->update( num_set)); // get an old tag auto& entry = tags[ num_set][ way]; const Addr old_tag = entry.tag; // Remove old tag from lookup helper and add a new tag if ( entry.is_valid) lookup_helper[ num_set].erase( old_tag); lookup_helper[ num_set].emplace( new_tag, way); // Update tag array entry.tag = new_tag; entry.is_valid = true; return way; } std::unique_ptr<CacheTagArray> CacheTagArray::create( const std::string& type, uint32 size_in_bytes, uint32 ways, uint32 line_size, uint32 addr_size_in_bits) { if ( type == "always_hit") return std::make_unique<AlwaysHitCacheTagArray>(); if ( type == "infinite") return std::make_unique<InfiniteCacheTagArray>(); return std::make_unique<SimpleCacheTagArray>( size_in_bytes, ways, line_size, addr_size_in_bits, type); }
31.841549
132
0.658852
VasiliyMatr
28c511520214ca23147826350fe56703352ebb2a
7,221
cpp
C++
src/jlcxx.cpp
RelationalAI-oss/libcxxwrap-julia
b01c70c6c30b6d1aa2b7b78b082ee07f5e90ac28
[ "MIT" ]
null
null
null
src/jlcxx.cpp
RelationalAI-oss/libcxxwrap-julia
b01c70c6c30b6d1aa2b7b78b082ee07f5e90ac28
[ "MIT" ]
null
null
null
src/jlcxx.cpp
RelationalAI-oss/libcxxwrap-julia
b01c70c6c30b6d1aa2b7b78b082ee07f5e90ac28
[ "MIT" ]
null
null
null
#include "jlcxx/array.hpp" #include "jlcxx/jlcxx.hpp" #include "jlcxx/functions.hpp" #include "jlcxx/jlcxx_config.hpp" #include <julia.h> #if JULIA_VERSION_MAJOR == 0 && JULIA_VERSION_MINOR > 4 || JULIA_VERSION_MAJOR > 0 #include <julia_threads.h> #endif namespace jlcxx { jl_module_t* g_cxxwrap_module; jl_datatype_t* g_cppfunctioninfo_type; JLCXX_API jl_array_t* gc_protected() { static jl_array_t* m_arr = nullptr; if (m_arr == nullptr) { #if JULIA_VERSION_MAJOR == 0 && JULIA_VERSION_MINOR > 4 || JULIA_VERSION_MAJOR > 0 jl_value_t* array_type = apply_array_type(jl_any_type, 1); m_arr = jl_alloc_array_1d(array_type, 0); #else m_arr = jl_alloc_cell_1d(0); #endif jl_set_const(g_cxxwrap_module, jl_symbol("_gc_protected"), (jl_value_t*)m_arr); } return m_arr; } JLCXX_API std::stack<std::size_t>& gc_free_stack() { static std::stack<std::size_t> m_stack; return m_stack; } JLCXX_API std::map<jl_value_t*, std::pair<std::size_t,std::size_t>>& gc_index_map() { static std::map<jl_value_t*, std::pair<std::size_t,std::size_t>> m_map; return m_map; } Module::Module(jl_module_t* jmod) : m_jl_mod(jmod), m_pointer_array((jl_array_t*)jl_get_global(jmod, jl_symbol("__cxxwrap_pointers"))) { } int_t Module::store_pointer(void *ptr) { assert(ptr != nullptr); m_pointer_array.push_back(ptr); return m_pointer_array.size(); } void Module::bind_constants(jl_module_t* mod) { for(auto& dt_pair : m_jl_constants) { jl_set_const(mod, jl_symbol(dt_pair.first.c_str()), dt_pair.second); } } Module &ModuleRegistry::create_module(jl_module_t* jmod) { if(jmod == nullptr) throw std::runtime_error("Can't create module from null Julia module"); if(m_modules.count(jmod)) throw std::runtime_error("Error registering module: " + module_name(jmod) + " was already registered"); m_current_module = new Module(jmod); m_modules[jmod].reset(m_current_module); return *m_current_module; } Module& ModuleRegistry::current_module() { assert(m_current_module != nullptr); return *m_current_module; } void FunctionWrapperBase::set_pointer_indices() { m_pointer_index = m_module->store_pointer(pointer()); void* thk = thunk(); if(thk != nullptr) { m_thunk_index = m_module->store_pointer(thunk()); } } JLCXX_API ModuleRegistry& registry() { static ModuleRegistry m_registry; return m_registry; } JLCXX_API jl_value_t* julia_type(const std::string& name, const std::string& module_name) { std::vector<jl_module_t*> mods; mods.reserve(6); jl_module_t* current_mod = registry().has_current_module() ? registry().current_module().julia_module() : nullptr; if(!module_name.empty()) { jl_sym_t* modsym = jl_symbol(module_name.c_str()); jl_module_t* found_mod = nullptr; if(current_mod != nullptr) { found_mod = (jl_module_t*)jl_get_global(current_mod, modsym); } if(found_mod == nullptr) { found_mod = (jl_module_t*)jl_get_global(jl_main_module, jl_symbol(module_name.c_str())); } if(found_mod != nullptr) { mods.push_back(found_mod); } else { throw std::runtime_error("Failed to find module " + module_name); } } else { if (current_mod != nullptr) { mods.push_back(current_mod); } mods.push_back(jl_main_module); mods.push_back(jl_base_module); mods.push_back(g_cxxwrap_module); mods.push_back(jl_top_module); } std::string found_type = "null"; for(jl_module_t* mod : mods) { if(mod == nullptr) { continue; } jl_value_t* gval = jl_get_global(mod, jl_symbol(name.c_str())); #if JULIA_VERSION_MAJOR == 0 && JULIA_VERSION_MINOR < 6 if(gval != nullptr && (jl_is_datatype(gval) || jl_is_typector(gval))) #else if(gval != nullptr && (jl_is_datatype(gval) || jl_is_unionall(gval))) #endif { return gval; } if(gval != nullptr) { found_type = julia_type_name(jl_typeof(gval)); } } std::string errmsg = "Symbol for type " + name + " was not found. A Value of type " + found_type + " was found instead. Searched modules:"; for(jl_module_t* mod : mods) { if(mod != nullptr) { errmsg += " " + symbol_name(mod->name); } } throw std::runtime_error(errmsg); } InitHooks& InitHooks::instance() { static InitHooks hooks; return hooks; } InitHooks::InitHooks() { } void InitHooks::add_hook(const hook_t hook) { m_hooks.push_back(hook); } void InitHooks::run_hooks() { for(const hook_t& h : m_hooks) { h(); } } JLCXX_API jl_value_t* apply_type(jl_value_t* tc, jl_svec_t* params) { #if JULIA_VERSION_MAJOR == 0 && JULIA_VERSION_MINOR < 6 return jl_apply_type(tc, params); #else return jl_apply_type(jl_is_unionall(tc) ? tc : ((jl_datatype_t*)tc)->name->wrapper, jl_svec_data(params), jl_svec_len(params)); #endif } jl_value_t* ConvertToJulia<std::wstring, false, false, false>::operator()(const std::wstring& str) const { static const JuliaFunction wstring_to_julia("wstring_to_julia", "CxxWrap"); return wstring_to_julia(str.c_str(), static_cast<int_t>(str.size())); } std::wstring ConvertToCpp<std::wstring, false, false, false>::operator()(jl_value_t* jstr) const { static const JuliaFunction wstring_to_cpp("wstring_to_cpp", "CxxWrap"); ArrayRef<wchar_t> arr((jl_array_t*)wstring_to_cpp(jstr)); return std::wstring(arr.data(), arr.size()); } static constexpr const char* dt_prefix = "__cxxwrap_dt_"; jl_datatype_t* existing_datatype(jl_module_t* mod, jl_sym_t* name) { const std::string prefixed_name = dt_prefix + symbol_name(name); jl_value_t* found_dt = jl_get_global(mod, jl_symbol(prefixed_name.c_str())); if(found_dt == nullptr || !jl_is_datatype(found_dt)) { return nullptr; } return (jl_datatype_t*)found_dt; } void set_internal_constant(jl_module_t* mod, jl_datatype_t* dt, const std::string& prefixed_name) { jl_set_const(mod, jl_symbol(prefixed_name.c_str()), (jl_value_t*)dt); } JLCXX_API jl_datatype_t* new_datatype(jl_sym_t *name, jl_module_t* module, jl_datatype_t *super, jl_svec_t *parameters, jl_svec_t *fnames, jl_svec_t *ftypes, int abstract, int mutabl, int ninitialized) { if(module == nullptr) { throw std::runtime_error("null module when creating type"); } jl_datatype_t* dt = existing_datatype(module, name); if(dt != nullptr) { return dt; } dt = jl_new_datatype(name, module, super, parameters, fnames, ftypes, abstract, mutabl, ninitialized); set_internal_constant(module, dt, dt_prefix + symbol_name(name)); return dt; } JLCXX_API jl_datatype_t* new_bitstype(jl_sym_t *name, jl_module_t* module, jl_datatype_t *super, jl_svec_t *parameters, const size_t nbits) { assert(module != nullptr); jl_datatype_t* dt = existing_datatype(module, name); if(dt != nullptr) { return dt; } dt = jl_new_primitivetype((jl_value_t*)name, module, super, parameters, nbits); set_internal_constant(module, dt, dt_prefix + symbol_name(name)); return dt; } }
26.258182
141
0.680931
RelationalAI-oss
28c894cb2d1a634d021485ba140cca64c65fe929
1,213
hpp
C++
src/algorithms/other/fizzbuzz.hpp
iamantony/CppNotes
2707db6560ad80b0e5e286a04b2d46e5c0280b3f
[ "MIT" ]
2
2020-07-31T14:13:56.000Z
2021-02-03T09:51:43.000Z
src/algorithms/other/fizzbuzz.hpp
iamantony/CppNotes
2707db6560ad80b0e5e286a04b2d46e5c0280b3f
[ "MIT" ]
28
2015-09-22T07:38:21.000Z
2018-10-02T11:00:58.000Z
src/algorithms/other/fizzbuzz.hpp
iamantony/CppNotes
2707db6560ad80b0e5e286a04b2d46e5c0280b3f
[ "MIT" ]
2
2018-10-11T14:10:50.000Z
2021-02-27T08:53:50.000Z
#ifndef FIZZBUZZ_HPP #define FIZZBUZZ_HPP #include <string> #include <vector> /* https://leetcode.com/problems/fizz-buzz/ Write a program that outputs the string representation of numbers from 1 to n. But for multiples of three it should output “Fizz” instead of the number and for the multiples of five output “Buzz”. For numbers which are multiples of both three and five output “FizzBuzz”. Example: n = 15, Return: [ "1", "2", "Fizz", "4", "Buzz", "Fizz", "7", "8", "Fizz", "Buzz", "11", "Fizz", "13", "14", "FizzBuzz" ] */ namespace Algo::Other { class FizzBuzz { public: static std::vector<std::string> Calc(int n) { std::vector<std::string> result; for (int i = 1; i <= n; ++i) { if (i % 3 == 0 && i % 5 == 0) { result.push_back("FizzBuzz"); } else if (i % 3 == 0) { result.push_back("Fizz"); } else if (i % 5 == 0) { result.push_back("Buzz"); } else { result.push_back(std::to_string(i)); } } return result; } }; } #endif // FIZZBUZZ_HPP
18.953125
78
0.511129
iamantony
28c9a34e7d623f88dc740dffdd6e86954f605bbf
15,535
cpp
C++
android-28/android/media/tv/TvContract_PreviewPrograms.cpp
YJBeetle/QtAndroidAPI
1468b5dc6eafaf7709f0b00ba1a6ec2b70684266
[ "Apache-2.0" ]
12
2020-03-26T02:38:56.000Z
2022-03-14T08:17:26.000Z
android-28/android/media/tv/TvContract_PreviewPrograms.cpp
YJBeetle/QtAndroidAPI
1468b5dc6eafaf7709f0b00ba1a6ec2b70684266
[ "Apache-2.0" ]
1
2021-01-27T06:07:45.000Z
2021-11-13T19:19:43.000Z
android-28/android/media/tv/TvContract_PreviewPrograms.cpp
YJBeetle/QtAndroidAPI
1468b5dc6eafaf7709f0b00ba1a6ec2b70684266
[ "Apache-2.0" ]
3
2021-02-02T12:34:55.000Z
2022-03-08T07:45:57.000Z
#include "../../net/Uri.hpp" #include "../../../JString.hpp" #include "./TvContract_PreviewPrograms.hpp" namespace android::media::tv { // Fields jint TvContract_PreviewPrograms::ASPECT_RATIO_16_9() { return getStaticField<jint>( "android.media.tv.TvContract$PreviewPrograms", "ASPECT_RATIO_16_9" ); } jint TvContract_PreviewPrograms::ASPECT_RATIO_1_1() { return getStaticField<jint>( "android.media.tv.TvContract$PreviewPrograms", "ASPECT_RATIO_1_1" ); } jint TvContract_PreviewPrograms::ASPECT_RATIO_2_3() { return getStaticField<jint>( "android.media.tv.TvContract$PreviewPrograms", "ASPECT_RATIO_2_3" ); } jint TvContract_PreviewPrograms::ASPECT_RATIO_3_2() { return getStaticField<jint>( "android.media.tv.TvContract$PreviewPrograms", "ASPECT_RATIO_3_2" ); } jint TvContract_PreviewPrograms::ASPECT_RATIO_4_3() { return getStaticField<jint>( "android.media.tv.TvContract$PreviewPrograms", "ASPECT_RATIO_4_3" ); } jint TvContract_PreviewPrograms::AVAILABILITY_AVAILABLE() { return getStaticField<jint>( "android.media.tv.TvContract$PreviewPrograms", "AVAILABILITY_AVAILABLE" ); } jint TvContract_PreviewPrograms::AVAILABILITY_FREE_WITH_SUBSCRIPTION() { return getStaticField<jint>( "android.media.tv.TvContract$PreviewPrograms", "AVAILABILITY_FREE_WITH_SUBSCRIPTION" ); } jint TvContract_PreviewPrograms::AVAILABILITY_PAID_CONTENT() { return getStaticField<jint>( "android.media.tv.TvContract$PreviewPrograms", "AVAILABILITY_PAID_CONTENT" ); } JString TvContract_PreviewPrograms::COLUMN_AUDIO_LANGUAGE() { return getStaticObjectField( "android.media.tv.TvContract$PreviewPrograms", "COLUMN_AUDIO_LANGUAGE", "Ljava/lang/String;" ); } JString TvContract_PreviewPrograms::COLUMN_AUTHOR() { return getStaticObjectField( "android.media.tv.TvContract$PreviewPrograms", "COLUMN_AUTHOR", "Ljava/lang/String;" ); } JString TvContract_PreviewPrograms::COLUMN_AVAILABILITY() { return getStaticObjectField( "android.media.tv.TvContract$PreviewPrograms", "COLUMN_AVAILABILITY", "Ljava/lang/String;" ); } JString TvContract_PreviewPrograms::COLUMN_BROWSABLE() { return getStaticObjectField( "android.media.tv.TvContract$PreviewPrograms", "COLUMN_BROWSABLE", "Ljava/lang/String;" ); } JString TvContract_PreviewPrograms::COLUMN_CANONICAL_GENRE() { return getStaticObjectField( "android.media.tv.TvContract$PreviewPrograms", "COLUMN_CANONICAL_GENRE", "Ljava/lang/String;" ); } JString TvContract_PreviewPrograms::COLUMN_CHANNEL_ID() { return getStaticObjectField( "android.media.tv.TvContract$PreviewPrograms", "COLUMN_CHANNEL_ID", "Ljava/lang/String;" ); } JString TvContract_PreviewPrograms::COLUMN_CONTENT_ID() { return getStaticObjectField( "android.media.tv.TvContract$PreviewPrograms", "COLUMN_CONTENT_ID", "Ljava/lang/String;" ); } JString TvContract_PreviewPrograms::COLUMN_CONTENT_RATING() { return getStaticObjectField( "android.media.tv.TvContract$PreviewPrograms", "COLUMN_CONTENT_RATING", "Ljava/lang/String;" ); } JString TvContract_PreviewPrograms::COLUMN_DURATION_MILLIS() { return getStaticObjectField( "android.media.tv.TvContract$PreviewPrograms", "COLUMN_DURATION_MILLIS", "Ljava/lang/String;" ); } JString TvContract_PreviewPrograms::COLUMN_EPISODE_DISPLAY_NUMBER() { return getStaticObjectField( "android.media.tv.TvContract$PreviewPrograms", "COLUMN_EPISODE_DISPLAY_NUMBER", "Ljava/lang/String;" ); } JString TvContract_PreviewPrograms::COLUMN_EPISODE_TITLE() { return getStaticObjectField( "android.media.tv.TvContract$PreviewPrograms", "COLUMN_EPISODE_TITLE", "Ljava/lang/String;" ); } JString TvContract_PreviewPrograms::COLUMN_INTENT_URI() { return getStaticObjectField( "android.media.tv.TvContract$PreviewPrograms", "COLUMN_INTENT_URI", "Ljava/lang/String;" ); } JString TvContract_PreviewPrograms::COLUMN_INTERACTION_COUNT() { return getStaticObjectField( "android.media.tv.TvContract$PreviewPrograms", "COLUMN_INTERACTION_COUNT", "Ljava/lang/String;" ); } JString TvContract_PreviewPrograms::COLUMN_INTERACTION_TYPE() { return getStaticObjectField( "android.media.tv.TvContract$PreviewPrograms", "COLUMN_INTERACTION_TYPE", "Ljava/lang/String;" ); } JString TvContract_PreviewPrograms::COLUMN_INTERNAL_PROVIDER_DATA() { return getStaticObjectField( "android.media.tv.TvContract$PreviewPrograms", "COLUMN_INTERNAL_PROVIDER_DATA", "Ljava/lang/String;" ); } JString TvContract_PreviewPrograms::COLUMN_INTERNAL_PROVIDER_FLAG1() { return getStaticObjectField( "android.media.tv.TvContract$PreviewPrograms", "COLUMN_INTERNAL_PROVIDER_FLAG1", "Ljava/lang/String;" ); } JString TvContract_PreviewPrograms::COLUMN_INTERNAL_PROVIDER_FLAG2() { return getStaticObjectField( "android.media.tv.TvContract$PreviewPrograms", "COLUMN_INTERNAL_PROVIDER_FLAG2", "Ljava/lang/String;" ); } JString TvContract_PreviewPrograms::COLUMN_INTERNAL_PROVIDER_FLAG3() { return getStaticObjectField( "android.media.tv.TvContract$PreviewPrograms", "COLUMN_INTERNAL_PROVIDER_FLAG3", "Ljava/lang/String;" ); } JString TvContract_PreviewPrograms::COLUMN_INTERNAL_PROVIDER_FLAG4() { return getStaticObjectField( "android.media.tv.TvContract$PreviewPrograms", "COLUMN_INTERNAL_PROVIDER_FLAG4", "Ljava/lang/String;" ); } JString TvContract_PreviewPrograms::COLUMN_INTERNAL_PROVIDER_ID() { return getStaticObjectField( "android.media.tv.TvContract$PreviewPrograms", "COLUMN_INTERNAL_PROVIDER_ID", "Ljava/lang/String;" ); } JString TvContract_PreviewPrograms::COLUMN_ITEM_COUNT() { return getStaticObjectField( "android.media.tv.TvContract$PreviewPrograms", "COLUMN_ITEM_COUNT", "Ljava/lang/String;" ); } JString TvContract_PreviewPrograms::COLUMN_LAST_PLAYBACK_POSITION_MILLIS() { return getStaticObjectField( "android.media.tv.TvContract$PreviewPrograms", "COLUMN_LAST_PLAYBACK_POSITION_MILLIS", "Ljava/lang/String;" ); } JString TvContract_PreviewPrograms::COLUMN_LIVE() { return getStaticObjectField( "android.media.tv.TvContract$PreviewPrograms", "COLUMN_LIVE", "Ljava/lang/String;" ); } JString TvContract_PreviewPrograms::COLUMN_LOGO_URI() { return getStaticObjectField( "android.media.tv.TvContract$PreviewPrograms", "COLUMN_LOGO_URI", "Ljava/lang/String;" ); } JString TvContract_PreviewPrograms::COLUMN_LONG_DESCRIPTION() { return getStaticObjectField( "android.media.tv.TvContract$PreviewPrograms", "COLUMN_LONG_DESCRIPTION", "Ljava/lang/String;" ); } JString TvContract_PreviewPrograms::COLUMN_OFFER_PRICE() { return getStaticObjectField( "android.media.tv.TvContract$PreviewPrograms", "COLUMN_OFFER_PRICE", "Ljava/lang/String;" ); } JString TvContract_PreviewPrograms::COLUMN_POSTER_ART_ASPECT_RATIO() { return getStaticObjectField( "android.media.tv.TvContract$PreviewPrograms", "COLUMN_POSTER_ART_ASPECT_RATIO", "Ljava/lang/String;" ); } JString TvContract_PreviewPrograms::COLUMN_POSTER_ART_URI() { return getStaticObjectField( "android.media.tv.TvContract$PreviewPrograms", "COLUMN_POSTER_ART_URI", "Ljava/lang/String;" ); } JString TvContract_PreviewPrograms::COLUMN_PREVIEW_VIDEO_URI() { return getStaticObjectField( "android.media.tv.TvContract$PreviewPrograms", "COLUMN_PREVIEW_VIDEO_URI", "Ljava/lang/String;" ); } JString TvContract_PreviewPrograms::COLUMN_RELEASE_DATE() { return getStaticObjectField( "android.media.tv.TvContract$PreviewPrograms", "COLUMN_RELEASE_DATE", "Ljava/lang/String;" ); } JString TvContract_PreviewPrograms::COLUMN_REVIEW_RATING() { return getStaticObjectField( "android.media.tv.TvContract$PreviewPrograms", "COLUMN_REVIEW_RATING", "Ljava/lang/String;" ); } JString TvContract_PreviewPrograms::COLUMN_REVIEW_RATING_STYLE() { return getStaticObjectField( "android.media.tv.TvContract$PreviewPrograms", "COLUMN_REVIEW_RATING_STYLE", "Ljava/lang/String;" ); } JString TvContract_PreviewPrograms::COLUMN_SEARCHABLE() { return getStaticObjectField( "android.media.tv.TvContract$PreviewPrograms", "COLUMN_SEARCHABLE", "Ljava/lang/String;" ); } JString TvContract_PreviewPrograms::COLUMN_SEASON_DISPLAY_NUMBER() { return getStaticObjectField( "android.media.tv.TvContract$PreviewPrograms", "COLUMN_SEASON_DISPLAY_NUMBER", "Ljava/lang/String;" ); } JString TvContract_PreviewPrograms::COLUMN_SEASON_TITLE() { return getStaticObjectField( "android.media.tv.TvContract$PreviewPrograms", "COLUMN_SEASON_TITLE", "Ljava/lang/String;" ); } JString TvContract_PreviewPrograms::COLUMN_SHORT_DESCRIPTION() { return getStaticObjectField( "android.media.tv.TvContract$PreviewPrograms", "COLUMN_SHORT_DESCRIPTION", "Ljava/lang/String;" ); } JString TvContract_PreviewPrograms::COLUMN_STARTING_PRICE() { return getStaticObjectField( "android.media.tv.TvContract$PreviewPrograms", "COLUMN_STARTING_PRICE", "Ljava/lang/String;" ); } JString TvContract_PreviewPrograms::COLUMN_THUMBNAIL_ASPECT_RATIO() { return getStaticObjectField( "android.media.tv.TvContract$PreviewPrograms", "COLUMN_THUMBNAIL_ASPECT_RATIO", "Ljava/lang/String;" ); } JString TvContract_PreviewPrograms::COLUMN_THUMBNAIL_URI() { return getStaticObjectField( "android.media.tv.TvContract$PreviewPrograms", "COLUMN_THUMBNAIL_URI", "Ljava/lang/String;" ); } JString TvContract_PreviewPrograms::COLUMN_TITLE() { return getStaticObjectField( "android.media.tv.TvContract$PreviewPrograms", "COLUMN_TITLE", "Ljava/lang/String;" ); } JString TvContract_PreviewPrograms::COLUMN_TRANSIENT() { return getStaticObjectField( "android.media.tv.TvContract$PreviewPrograms", "COLUMN_TRANSIENT", "Ljava/lang/String;" ); } JString TvContract_PreviewPrograms::COLUMN_TYPE() { return getStaticObjectField( "android.media.tv.TvContract$PreviewPrograms", "COLUMN_TYPE", "Ljava/lang/String;" ); } JString TvContract_PreviewPrograms::COLUMN_VERSION_NUMBER() { return getStaticObjectField( "android.media.tv.TvContract$PreviewPrograms", "COLUMN_VERSION_NUMBER", "Ljava/lang/String;" ); } JString TvContract_PreviewPrograms::COLUMN_VIDEO_HEIGHT() { return getStaticObjectField( "android.media.tv.TvContract$PreviewPrograms", "COLUMN_VIDEO_HEIGHT", "Ljava/lang/String;" ); } JString TvContract_PreviewPrograms::COLUMN_VIDEO_WIDTH() { return getStaticObjectField( "android.media.tv.TvContract$PreviewPrograms", "COLUMN_VIDEO_WIDTH", "Ljava/lang/String;" ); } JString TvContract_PreviewPrograms::COLUMN_WEIGHT() { return getStaticObjectField( "android.media.tv.TvContract$PreviewPrograms", "COLUMN_WEIGHT", "Ljava/lang/String;" ); } JString TvContract_PreviewPrograms::CONTENT_ITEM_TYPE() { return getStaticObjectField( "android.media.tv.TvContract$PreviewPrograms", "CONTENT_ITEM_TYPE", "Ljava/lang/String;" ); } JString TvContract_PreviewPrograms::CONTENT_TYPE() { return getStaticObjectField( "android.media.tv.TvContract$PreviewPrograms", "CONTENT_TYPE", "Ljava/lang/String;" ); } android::net::Uri TvContract_PreviewPrograms::CONTENT_URI() { return getStaticObjectField( "android.media.tv.TvContract$PreviewPrograms", "CONTENT_URI", "Landroid/net/Uri;" ); } jint TvContract_PreviewPrograms::INTERACTION_TYPE_FANS() { return getStaticField<jint>( "android.media.tv.TvContract$PreviewPrograms", "INTERACTION_TYPE_FANS" ); } jint TvContract_PreviewPrograms::INTERACTION_TYPE_FOLLOWERS() { return getStaticField<jint>( "android.media.tv.TvContract$PreviewPrograms", "INTERACTION_TYPE_FOLLOWERS" ); } jint TvContract_PreviewPrograms::INTERACTION_TYPE_LIKES() { return getStaticField<jint>( "android.media.tv.TvContract$PreviewPrograms", "INTERACTION_TYPE_LIKES" ); } jint TvContract_PreviewPrograms::INTERACTION_TYPE_LISTENS() { return getStaticField<jint>( "android.media.tv.TvContract$PreviewPrograms", "INTERACTION_TYPE_LISTENS" ); } jint TvContract_PreviewPrograms::INTERACTION_TYPE_THUMBS() { return getStaticField<jint>( "android.media.tv.TvContract$PreviewPrograms", "INTERACTION_TYPE_THUMBS" ); } jint TvContract_PreviewPrograms::INTERACTION_TYPE_VIEWERS() { return getStaticField<jint>( "android.media.tv.TvContract$PreviewPrograms", "INTERACTION_TYPE_VIEWERS" ); } jint TvContract_PreviewPrograms::INTERACTION_TYPE_VIEWS() { return getStaticField<jint>( "android.media.tv.TvContract$PreviewPrograms", "INTERACTION_TYPE_VIEWS" ); } jint TvContract_PreviewPrograms::REVIEW_RATING_STYLE_PERCENTAGE() { return getStaticField<jint>( "android.media.tv.TvContract$PreviewPrograms", "REVIEW_RATING_STYLE_PERCENTAGE" ); } jint TvContract_PreviewPrograms::REVIEW_RATING_STYLE_STARS() { return getStaticField<jint>( "android.media.tv.TvContract$PreviewPrograms", "REVIEW_RATING_STYLE_STARS" ); } jint TvContract_PreviewPrograms::REVIEW_RATING_STYLE_THUMBS_UP_DOWN() { return getStaticField<jint>( "android.media.tv.TvContract$PreviewPrograms", "REVIEW_RATING_STYLE_THUMBS_UP_DOWN" ); } jint TvContract_PreviewPrograms::TYPE_ALBUM() { return getStaticField<jint>( "android.media.tv.TvContract$PreviewPrograms", "TYPE_ALBUM" ); } jint TvContract_PreviewPrograms::TYPE_ARTIST() { return getStaticField<jint>( "android.media.tv.TvContract$PreviewPrograms", "TYPE_ARTIST" ); } jint TvContract_PreviewPrograms::TYPE_CHANNEL() { return getStaticField<jint>( "android.media.tv.TvContract$PreviewPrograms", "TYPE_CHANNEL" ); } jint TvContract_PreviewPrograms::TYPE_CLIP() { return getStaticField<jint>( "android.media.tv.TvContract$PreviewPrograms", "TYPE_CLIP" ); } jint TvContract_PreviewPrograms::TYPE_EVENT() { return getStaticField<jint>( "android.media.tv.TvContract$PreviewPrograms", "TYPE_EVENT" ); } jint TvContract_PreviewPrograms::TYPE_MOVIE() { return getStaticField<jint>( "android.media.tv.TvContract$PreviewPrograms", "TYPE_MOVIE" ); } jint TvContract_PreviewPrograms::TYPE_PLAYLIST() { return getStaticField<jint>( "android.media.tv.TvContract$PreviewPrograms", "TYPE_PLAYLIST" ); } jint TvContract_PreviewPrograms::TYPE_STATION() { return getStaticField<jint>( "android.media.tv.TvContract$PreviewPrograms", "TYPE_STATION" ); } jint TvContract_PreviewPrograms::TYPE_TRACK() { return getStaticField<jint>( "android.media.tv.TvContract$PreviewPrograms", "TYPE_TRACK" ); } jint TvContract_PreviewPrograms::TYPE_TV_EPISODE() { return getStaticField<jint>( "android.media.tv.TvContract$PreviewPrograms", "TYPE_TV_EPISODE" ); } jint TvContract_PreviewPrograms::TYPE_TV_SEASON() { return getStaticField<jint>( "android.media.tv.TvContract$PreviewPrograms", "TYPE_TV_SEASON" ); } jint TvContract_PreviewPrograms::TYPE_TV_SERIES() { return getStaticField<jint>( "android.media.tv.TvContract$PreviewPrograms", "TYPE_TV_SERIES" ); } // QJniObject forward TvContract_PreviewPrograms::TvContract_PreviewPrograms(QJniObject obj) : JObject(obj) {} // Constructors // Methods } // namespace android::media::tv
25.096931
89
0.754554
YJBeetle
28c9d95a7c044e1d625c4013a8fefc03ef9bc8bd
32,436
cpp
C++
libs/ddengine/src/pack.cpp
FaultyRAM/MuckyFoot-UrbanChaos
45c9553189f80785a4ea0ec34b960d864782155b
[ "MIT" ]
5
2017-10-02T00:20:06.000Z
2021-07-09T10:00:18.000Z
libs/ddengine/src/pack.cpp
FaultyRAM/MuckyFoot-UrbanChaos
45c9553189f80785a4ea0ec34b960d864782155b
[ "MIT" ]
null
null
null
libs/ddengine/src/pack.cpp
FaultyRAM/MuckyFoot-UrbanChaos
45c9553189f80785a4ea0ec34b960d864782155b
[ "MIT" ]
null
null
null
// // Looks at all the textures loaded and packs similar ones // onto 256x256s... // #include <ddlibrary/dd_lib.h> #include <fallen/game.h> #include <ddlibrary/tga.h> #include <ddengine/texture.h> #ifndef TARGET_DC // // From elev.cpp... // extern CBYTE ELEV_fname_level[]; // // From texture.cpp // extern D3DTexture TEXTURE_texture[]; // // The current texture we are creating. // TGA_Pixel PACK_tga[256 * 256]; // // Temporary buffer for a texture we've loaded in. // TGA_Pixel PACK_buffer[64 * 64]; // // The files packed onto our current texture. // CBYTE PACK_fname[9][256]; CBYTE PACK_fname_dir[256]; SLONG PACK_fname_upto; SLONG PACK_texture_upto; CBYTE PACK_output_directory[256]; CBYTE PACK_fname_array[256]; FILE *PACK_fname_array_handle; #define MAX_NUM_PACKED_PAGES 100 int iNumPackedPages; D3DPage pagePacking[MAX_NUM_PACKED_PAGES]; #if 0 void PACK_output() { SLONG i; CBYTE texture_filename[256]; sprintf(texture_filename, "%s\\PackedTexture%03d.tga", PACK_output_directory, PACK_texture_upto); // // Got a whole new texture. // TGA_save(texture_filename, 256, 256, (TGA_Pixel *) PACK_tga, FALSE); // // If you want to run this bit of code then do a search for 'save_out_the_vqs' // in d3dtexture.cpp and re-enable if (save_out_the_vqs) // save_out_the_vqs = TRUE; { D3DTexture *pTex; #define DO_DC_CONVERT(name) pTex = MFnew<D3DTexture>(); pTex->LoadTextureTGA ( (name), -1, TRUE ); MFdelete ( pTex ) DO_DC_CONVERT(texture_filename); } save_out_the_vqs = FALSE; // // Write out the array. // fprintf(PACK_fname_array_handle, "\t\"***64_3:"); // // Now output the directory containing the texture. Becuase this is 'C' code we // are generating, each '\' must be written out as '\\'. // CBYTE *ch; for (ch = PACK_fname_dir; *ch; ch++) { if (*ch == '\\') { fprintf(PACK_fname_array_handle, "\\\\"); } else { fprintf(PACK_fname_array_handle, "%c", *ch); } } // // Write in the rest of the line. // fprintf(PACK_fname_array_handle, "\\\\\", \""); for (ch = texture_filename; *ch; ch++) { if (*ch == '\\') { fprintf(PACK_fname_array_handle, "\\\\"); } else { fprintf(PACK_fname_array_handle, "%c", *ch); } } fprintf(PACK_fname_array_handle, "\",\n"); for (i = 0; i < 9; i++) { fprintf(PACK_fname_array_handle, "\t\"%s\",\n", PACK_fname[i]); } fprintf(PACK_fname_array_handle, "\n"); PACK_texture_upto += 1; PACK_fname_upto = 0; memset(PACK_fname, 0, sizeof(PACK_fname )); memset(PACK_fname_dir, 0, sizeof(PACK_fname_dir)); memset(PACK_tga, 0, sizeof(PACK_tga)); } #endif void read_string ( FILE *handle, char *string ) { char *pch = string; while ( TRUE ) { int character = fgetc ( handle ); // Silly person - didn't finish your file properly. ASSERT ( character != EOF ); if ( ( character == '\0' ) || ( character == '\n' ) || ( character == EOF ) ) { *pch = '\0'; break; } *pch++ = (char)character; } } char *copy_string ( char *input ) { char *temp = (char *)MemAlloc ( strlen ( input ) + 1 ); ASSERT ( temp != NULL ); strcpy ( temp, input ); return temp; } void PACK_do() { SLONG i; SLONG j; SLONG reqd_page_type; SLONG page_size; SLONG texture_size; SLONG border_size; TGA_Info ti; D3DTexture *tt; CBYTE level_name [256]; CBYTE texture_dir[256]; // // The level name without spaces and without the extension... // CBYTE *ch; CBYTE *just_filename; TRACE ( "PACKing level %s", ELEV_fname_level ); for (ch = ELEV_fname_level; *ch; ch++); while(1) { ch -= 1; if (ch == ELEV_fname_level) { break; } if (*ch == '\\') { ch += 1; break; } } CBYTE *src; CBYTE *dest; src = ch; dest = level_name; while(1) { if (*src == '.' || *src == '\000') { *dest = '\000'; break; } if (*src == ' ') { src++; } else { *dest++ = *src++; } } char PACK_text_array[100]; FILE *PACK_text_array_handle; sprintf(PACK_output_directory, "PackedTextures\\%s", level_name); sprintf(PACK_fname_array, "%s\\array_%s.cpp", PACK_output_directory, level_name); sprintf(PACK_text_array, "%s\\text_%s.txt", PACK_output_directory, level_name); // // Create the directory we will be outputting into. // CreateDirectory(PACK_output_directory, NULL); // // Start off the array... // PACK_fname_array_handle = fopen(PACK_fname_array, "wb"); if (!PACK_fname_array_handle) { ASSERT ( FALSE ); return; } PACK_text_array_handle = fopen(PACK_text_array, "wt"); if (!PACK_text_array_handle) { ASSERT ( FALSE ); return; } fprintf(PACK_fname_array_handle, "//\n"); fprintf(PACK_fname_array_handle, "// Packing array for \"%s\"\n", ELEV_fname_level); fprintf(PACK_fname_array_handle, "//\n"); fprintf(PACK_fname_array_handle, "\n"); fprintf(PACK_fname_array_handle, "CBYTE *packed_array_%s[] = \n", level_name); fprintf(PACK_fname_array_handle, "{\n"); // // Go through all the textures. // // Read in any hand-done ones first & construct the corresponding textures. // The filename is int he same directory, called "hand_done_[levname].txt". // It has the same format as the included ones, except one-per-line, // and there is no explicit texture name - that's auto-generated. // // ***64_4:server\\textures\\extras\\DC\\ // button_A.tga // button_B.tga // button_C.tga // button_X.tga // button_Y.tga // button_Z.tga // button_LEFT.tga // button_RIGHT.tga // button_PADLEFT.tga // button_PADRIGHT.tga // button_PADDOWN.tga // button_PADUP.tga iNumPackedPages = 0; // Find the list. char PACK_file_in[100]; sprintf(PACK_file_in, "%s\\hand_done_%s.txt", PACK_output_directory, level_name); // // Start off the array... // FILE *PACK_file_in_handle = fopen(PACK_file_in, "rt"); if (PACK_file_in_handle) { // Scan my text list, initialising the D3DPages as we go. int iPageType = 0; int iPagePos = 0; int iSafetyTimeout = 1000; char pcCurString[500]; // Read the first string. read_string ( PACK_file_in_handle, pcCurString ); while ( TRUE ) { iSafetyTimeout--; if ( iSafetyTimeout <= 0 ) { // Oops. ASSERT ( FALSE ); break; } // This should be a command. //char *pcCurString = *ppcList; ASSERT ( ( pcCurString[0] == '*' ) && ( pcCurString[1] == '*' ) && ( pcCurString[2] == '*' ) ); if ( 0 == stricmp ( pcCurString+3, "END" ) ) { // End of list. break; } // Find the page type if ( 0 == strncmp ( pcCurString, "***64_4:", 8 ) ) { iPageType = D3DPAGE_64_4X4; } else if ( 0 == strncmp ( pcCurString, "***32_4:", 8 ) ) { iPageType = D3DPAGE_32_4X4; } else if ( 0 == strncmp ( pcCurString, "***64_3:", 8 ) ) { iPageType = D3DPAGE_64_3X3; } else if ( 0 == strncmp ( pcCurString, "***32_3:", 8 ) ) { iPageType = D3DPAGE_32_3X3; } else { ASSERT ( FALSE ); } // Set up the texture page. pagePacking[iNumPackedPages].bPageType = (UBYTE)iPageType; pagePacking[iNumPackedPages].bNumTextures = 0; pagePacking[iNumPackedPages].pcDirectory = copy_string ( pcCurString + 8 ); // Name it. char pcTemp[100]; sprintf ( pcTemp, "%s\\PackedTexture%03d.tga", PACK_output_directory, iNumPackedPages); pagePacking[iNumPackedPages].pcFilename = copy_string ( pcTemp ); //pagePacking[iNumPackedPages].ppcTextureList = ppcList; pagePacking[iNumPackedPages].pTex = NULL; // See how many textures there are. pagePacking[iNumPackedPages].ppcTextureList = (char **)MemAlloc ( 16 * sizeof ( char * ) ); for ( int iTemp = 0; iTemp < 16; iTemp++ ) { pagePacking[iNumPackedPages].ppcTextureList[iTemp] = NULL; } read_string ( PACK_file_in_handle, pcCurString ); while ( pcCurString[0] != '*' ) { if ( pcCurString[0] == '\0' ) { // Empty slot. pagePacking[iNumPackedPages].ppcTextureList[pagePacking[iNumPackedPages].bNumTextures] = NULL; } else { // Make sure it hasn't already been added. for ( int i = 0; i <= iNumPackedPages; i++ ) { if ( 0 == stricmp ( pagePacking[i].pcDirectory, pagePacking[iNumPackedPages].pcDirectory ) ) { for ( int j = 0; j < pagePacking[i].bNumTextures; j++ ) { if ( ( pagePacking[i].ppcTextureList[j] != NULL ) && ( 0 == stricmp ( pagePacking[i].ppcTextureList[j], pcCurString ) ) ) { // Silly person. ASSERT ( FALSE ); // Skip it. goto try_the_next_texture_coz_this_is_not_needed; } } } } // Also make sure we actually need it for this level. { bool bFound = FALSE; for (i = 0; i < 512; i++) { tt = &TEXTURE_texture[i]; if (tt->Type == D3DTEXTURE_TYPE_UNUSED) { continue; } if (POLY_page_flag[i]) { // We can't pack this page because it's a funny one. continue; } // Extract directory name. strcpy(texture_dir, tt->texture_name); for (ch = texture_dir; *ch; ch++); while(ch > texture_dir && *ch != '\\') {ch--;} if (*ch == '\\') { *ch = '\000'; } just_filename = ch + 1; if ( 0 == stricmp ( just_filename, pcCurString ) ) { // Right name. SLONG strlen_texture_dir = strlen(texture_dir); SLONG strlen_pagepack_dir = strlen(pagePacking[iNumPackedPages].pcDirectory); if (strlen_pagepack_dir == strlen_texture_dir + 1) { if ( 0 == strnicmp ( texture_dir, pagePacking[iNumPackedPages].pcDirectory, strlen_texture_dir ) ) { // And same directory. bFound = TRUE; break; } } } } if ( !bFound ) { // No, this doesn't need to be loaded. ASSERT ( FALSE ); goto try_the_next_texture_coz_this_is_not_needed; } } pagePacking[iNumPackedPages].ppcTextureList[pagePacking[iNumPackedPages].bNumTextures] = copy_string ( pcCurString ); } //pagePacking[iNumPackedPages].pTextures[pagePacking[iNumPackedPages].bNumTextures] = NULL; pagePacking[iNumPackedPages].bNumTextures++; try_the_next_texture_coz_this_is_not_needed: read_string ( PACK_file_in_handle, pcCurString ); } switch ( iPageType ) { case D3DPAGE_64_4X4: case D3DPAGE_32_4X4: ASSERT ( pagePacking[iNumPackedPages].bNumTextures <= 16 ); break; case D3DPAGE_64_3X3: case D3DPAGE_32_3X3: ASSERT ( pagePacking[iNumPackedPages].bNumTextures <= 9 ); break; default: ASSERT ( FALSE ); break; } iNumPackedPages++; } fclose(PACK_file_in_handle); } PACK_fname_upto = 0; PACK_texture_upto = 0; memset(PACK_fname, 0, sizeof(PACK_fname )); memset(PACK_fname_dir, 0, sizeof(PACK_fname_dir)); for (i = 0; i < 64 * 22; i++) { tt = &TEXTURE_texture[i]; if (tt->Type == D3DTEXTURE_TYPE_UNUSED) { continue; } if (POLY_page_flag[i]) { // We can't pack this page because it's a funny one. continue; } // Extract directory name. strcpy(texture_dir, tt->texture_name); for (ch = texture_dir; *ch; ch++); while(ch > texture_dir && *ch != '\\') {ch--;} if (*ch == '\\') { *ch = '\000'; } just_filename = ch + 1; // See if it's in a texture page already bool bFound = FALSE; for ( int iPageNum = 0; iPageNum < iNumPackedPages; iPageNum++ ) { // // The texture_dir doesn't have a final backslash whereas // the packPacking directory does... // SLONG strlen_texture_dir = strlen(texture_dir); SLONG strlen_pagepack_dir = strlen(pagePacking[iPageNum].pcDirectory); if (strlen_pagepack_dir == strlen_texture_dir + 1) { if ( strnicmp ( texture_dir, pagePacking[iPageNum].pcDirectory, strlen_texture_dir) == 0 ) { for ( int iTexNum = 0; iTexNum < pagePacking[iPageNum].bNumTextures; iTexNum++ ) { if ( ( pagePacking[iPageNum].ppcTextureList[iTexNum] != NULL ) && ( 0 == stricmp ( pagePacking[iPageNum].ppcTextureList[iTexNum], just_filename ) ) ) { bFound = TRUE; break; } } } } if ( bFound ) { break; } } if ( bFound ) { // Already got it. continue; } // // What size of texture do we have and which page type // do we need? // texture_size = tt->size; if (texture_size == 64) { if (strstr(texture_dir, "people")) { // // This is a people page, pack it 4x4 // reqd_page_type = D3DPAGE_64_4X4; } else { // // Put world textures on a 3x3 because of wrapping... // reqd_page_type = D3DPAGE_64_3X3; if (i >= 64 * 8) { // // Try squeezing in the prims! // reqd_page_type = D3DPAGE_64_4X4; } } } else if (texture_size == 32) { if (strstr(texture_dir, "people")) { // // This is a people page, pack it 4x4 // reqd_page_type = D3DPAGE_32_4X4; } else { // // Put world textures on a 3x3 because of wrapping... // reqd_page_type = D3DPAGE_32_3X3; if (i >= 64 * 8) { // // Try squeezing in the prims! // reqd_page_type = D3DPAGE_32_4X4; } } } else { // // We don't support funny sizes... // continue; } ASSERT(reqd_page_type != 0); // OK, try to pack it into an existing page in the right directory with a gap. bFound = FALSE; for ( iPageNum = 0; iPageNum < iNumPackedPages; iPageNum++ ) { // Only auto-pack into 3x3s if ( pagePacking[iPageNum].bPageType == reqd_page_type ) { // // The texture_dir doesn't have a final backslash whereas // the packPacking directory does... // SLONG strlen_texture_dir = strlen(texture_dir); SLONG strlen_pagepack_dir = strlen(pagePacking[iPageNum].pcDirectory); if (strlen_pagepack_dir == strlen_texture_dir + 1) { if ( strnicmp ( texture_dir, pagePacking[iPageNum].pcDirectory, strlen_texture_dir ) == 0 ) { // // What's the max number of textures this pagepage can hold? // SLONG max_textures_in_this_page; if (reqd_page_type == D3DPAGE_32_3X3 || reqd_page_type == D3DPAGE_64_3X3) { max_textures_in_this_page = 9; } else { max_textures_in_this_page = 16; } // Has it got a gap? if ( pagePacking[iPageNum].bNumTextures < max_textures_in_this_page ) { // Yes, there's a gap. bFound = TRUE; break; } } } } } if ( !bFound ) { // Make a new page then. iPageNum = iNumPackedPages; // Set up the texture page. pagePacking[iNumPackedPages].bPageType = reqd_page_type; pagePacking[iNumPackedPages].bNumTextures = 0; char pcTemp[100]; strcpy ( pcTemp, texture_dir ); strcat ( pcTemp, "\\" ); pagePacking[iNumPackedPages].pcDirectory = copy_string ( pcTemp ); //pagePacking[iNumPackedPages].ppcTextureList = ppcList; pagePacking[iNumPackedPages].pTex = NULL; // Allocate space for the source texture names. pagePacking[iNumPackedPages].ppcTextureList = (char **)MemAlloc ( 16 * sizeof ( char * ) ); // Name it. sprintf ( pcTemp, "%s\\PackedTexture%03d.tga", PACK_output_directory, iNumPackedPages); pagePacking[iNumPackedPages].pcFilename = copy_string ( pcTemp ); iNumPackedPages++; } // Add to this page. ASSERT ( pagePacking[iPageNum].bNumTextures < 16 ); pagePacking[iPageNum].ppcTextureList[pagePacking[iPageNum].bNumTextures] = copy_string ( just_filename ); pagePacking[iPageNum].bNumTextures++; } // OK, so we've compiled our pages. Now write them out. for ( int iPageNum = 0; iPageNum < iNumPackedPages; iPageNum++ ) { // First write the cpp file data. switch ( pagePacking[iPageNum].bPageType ) { case D3DPAGE_64_4X4: fprintf ( PACK_fname_array_handle, "\"***64_4:" ); fprintf ( PACK_text_array_handle, "***64_4:" ); break; case D3DPAGE_32_4X4: fprintf ( PACK_fname_array_handle, "\"***32_4:" ); fprintf ( PACK_text_array_handle, "***32_4:" ); break; case D3DPAGE_64_3X3: fprintf ( PACK_fname_array_handle, "\"***64_3:" ); fprintf ( PACK_text_array_handle, "***64_3:" ); break; case D3DPAGE_32_3X3: fprintf ( PACK_fname_array_handle, "\"***32_3:" ); fprintf ( PACK_text_array_handle, "***32_3:" ); break; default: ASSERT ( FALSE ); break; } // // Now output the directory containing the texture. Becuase this is 'C' code we // are generating, each '\' must be written out as '\\'. // CBYTE *ch; for (ch = pagePacking[iPageNum].pcDirectory; *ch; ch++) { if (*ch == '\\') { fprintf(PACK_fname_array_handle, "\\\\"); fprintf(PACK_text_array_handle, "\\"); } else { fprintf(PACK_fname_array_handle, "%c", *ch); fprintf(PACK_text_array_handle, "%c", *ch); } } // // Write in the rest of the line. // fprintf(PACK_fname_array_handle, "\", \""); fprintf(PACK_text_array_handle, " "); for (ch = pagePacking[iPageNum].pcFilename; *ch; ch++) { if (*ch == '\\') { fprintf(PACK_fname_array_handle, "\\\\"); fprintf(PACK_text_array_handle, "\\"); } else { fprintf(PACK_fname_array_handle, "%c", *ch); fprintf(PACK_text_array_handle, "%c", *ch); } } fprintf(PACK_fname_array_handle, "\",\n"); fprintf(PACK_text_array_handle, "\n"); // Now write out the texture names. for (i = 0; i < pagePacking[iPageNum].bNumTextures; i++) { if ( pagePacking[iPageNum].ppcTextureList[i] == NULL ) { fprintf(PACK_fname_array_handle, "\t\"\",\n" ); fprintf(PACK_text_array_handle, "\n" ); } else { fprintf(PACK_fname_array_handle, "\t\"%s\",\n", pagePacking[iPageNum].ppcTextureList[i]); fprintf(PACK_text_array_handle, "%s\n", pagePacking[iPageNum].ppcTextureList[i]); } } fprintf(PACK_fname_array_handle, "\n"); // // How big are the page, the individual textures // and the border? // switch(pagePacking[iPageNum].bPageType) { case D3DPAGE_64_4X4: page_size = 256; break; case D3DPAGE_32_4X4: page_size = 128; break; case D3DPAGE_64_3X3: page_size = 256; break; case D3DPAGE_32_3X3: page_size = 128; break; default: ASSERT(0); break; } texture_size = page_size >> 2; border_size = texture_size >> 2; #define PLOT_PIX(fx,fy,tx,ty) if (WITHIN((tx), 0, page_size - 1) && WITHIN((ty), 0, page_size - 1) && WITHIN((fx), 0, page_size - 1) && WITHIN((fy), 0, page_size - 1)) PACK_tga[(tx) + (ty) * page_size] = PACK_tga[(fx) + (fy) * page_size] // Clear the page - don't want old data confusing the VQ rout & chewing palette entries. for ( int iY = 0; iY < 256; iY++ ) { for ( int iX = 0; iX < 256; iX++ ) { PACK_tga[iX + iY * 256].alpha = 0xff; PACK_tga[iX + iY * 256].blue = 0; PACK_tga[iX + iY * 256].green = 0; PACK_tga[iX + iY * 256].red = 0; } } // And now construct this page's texture. for ( int iTexNum = 0; iTexNum < pagePacking[iPageNum].bNumTextures; iTexNum++) { if ( pagePacking[iPageNum].ppcTextureList[iTexNum] == NULL ) { // Empty slot. continue; } // Load up the tga. char pcTemp[100]; strcpy ( pcTemp, pagePacking[iPageNum].pcDirectory ); strcat ( pcTemp, pagePacking[iPageNum].ppcTextureList[iTexNum] ); ti = TGA_load ( pcTemp, 64, 64, (TGA_Pixel *) PACK_buffer, 0, 0); if (!ti.valid) { // Nads. ASSERT ( FALSE ); } ASSERT(ti.width == texture_size); ASSERT(ti.height == texture_size); if (ti.valid) { // // Copy over the texture to the right place. // SLONG x; SLONG y; SLONG fx; SLONG fy; SLONG tx; SLONG ty; SLONG base_x; SLONG base_y; // // What is the base (x,y) for this position? // switch ( pagePacking[iPageNum].bPageType ) { case D3DPAGE_64_4X4: base_x = (iTexNum % 4) * 64; base_y = (iTexNum / 4) * 64; break; case D3DPAGE_32_4X4: base_x = (iTexNum % 4) * 32; base_y = (iTexNum / 4) * 32; break; case D3DPAGE_64_3X3: base_x = (iTexNum % 3) * 96; base_y = (iTexNum / 3) * 96; break; case D3DPAGE_32_3X3: base_x = (iTexNum % 3) * 48; base_y = (iTexNum / 3) * 48; break; default: ASSERT ( FALSE ); break; } // // Copy over the main body of the texture. // for (x = 0; x < texture_size; x++) { for (y = 0; y < texture_size; y++) { fx = x; fy = y; tx = base_x + x; ty = base_y + y; PACK_tga[tx + ty * page_size] = PACK_buffer[fx + fy * texture_size]; } } } } if ( pagePacking[iPageNum].bPageType == D3DPAGE_64_3X3 || pagePacking[iPageNum].bPageType == D3DPAGE_32_3X3) { for ( int iTexNum = 0; iTexNum < pagePacking[iPageNum].bNumTextures; iTexNum++) { SLONG fx; SLONG fy; SLONG tx; SLONG ty; SLONG base_x; SLONG base_y; switch (pagePacking[iPageNum].bPageType) { case D3DPAGE_64_3X3: base_x = (iTexNum % 3) * 96; base_y = (iTexNum / 3) * 96; break; case D3DPAGE_32_3X3: base_x = (iTexNum % 3) * 48; base_y = (iTexNum / 3) * 48; break; default: ASSERT(0); break; } // Now do the edges so we effectively have clamping... for ( int iBorder = 1; iBorder <= border_size; iBorder++ ) { for (j = 0; j < texture_size; j++) { // // Top... // fx = base_x + j; fy = base_y; tx = base_x + j; ty = base_y - iBorder; PLOT_PIX ( fx, fy, tx, ty ); // // Bottom... // fx = base_x + j; fy = base_y + texture_size - 1; tx = base_x + j; ty = base_y + texture_size - 1 + iBorder; PLOT_PIX ( fx, fy, tx, ty ); // // Left... // fx = base_x; fy = base_y + j; tx = base_x - iBorder; ty = base_y + j; PLOT_PIX ( fx, fy, tx, ty ); // // Right... // fx = base_x + texture_size - 1; fy = base_y + j; tx = base_x + texture_size - 1 + iBorder; ty = base_y + j; PLOT_PIX ( fx, fy, tx, ty ); } } for ( int iBordX = 1; iBordX <= border_size; iBordX++ ) { for ( int iBordY = 1; iBordY <= border_size; iBordY++ ) { // // Now do the corners. // // // Top left... // fx = base_x; fy = base_y; tx = base_x - iBordX; ty = base_y - iBordY; PLOT_PIX ( fx, fy, tx, ty ); // // Bottom right... // fx = base_x + texture_size - 1; fy = base_y + texture_size - 1; tx = base_x + texture_size - 1 + iBordX; ty = base_y + texture_size - 1 + iBordY; PLOT_PIX ( fx, fy, tx, ty ); // // Top right... // fx = base_x + texture_size - 1; fy = base_y; tx = base_x + texture_size - 1 + iBordX; ty = base_y - iBordY; PLOT_PIX ( fx, fy, tx, ty ); // // Bottom left... // fx = base_x; fy = base_y + texture_size - 1; tx = base_x - iBordX; ty = base_y + texture_size - 1 + iBordY; PLOT_PIX ( fx, fy, tx, ty ); } } } } else { // 4x4s often have gaps - fill them in too, but in a more cunning way. // Look for empty spaces. for ( int iTexNum = 0; iTexNum < 16; iTexNum++ ) { if ( pagePacking[iPageNum].ppcTextureList[iTexNum] == NULL ) { // Found a gap. // What surroundings does it have? bool bHasU = FALSE; bool bHasD = FALSE; bool bHasL = FALSE; bool bHasR = FALSE; if ( iTexNum >= 4 ) { if ( pagePacking[iPageNum].ppcTextureList[iTexNum-4] != NULL ) { bHasU = TRUE; } } if ( iTexNum <= 11 ) { if ( pagePacking[iPageNum].ppcTextureList[iTexNum+4] != NULL ) { bHasD = TRUE; } } if ( ( iTexNum % 4 ) > 0 ) { if ( pagePacking[iPageNum].ppcTextureList[iTexNum-1] != NULL ) { bHasL = TRUE; } } if ( ( iTexNum % 4 ) < 3 ) { if ( pagePacking[iPageNum].ppcTextureList[iTexNum+1] != NULL ) { bHasR = TRUE; } } SLONG base_x; SLONG base_y; switch (pagePacking[iPageNum].bPageType) { case D3DPAGE_64_4X4: base_x = (iTexNum % 4) * 64; base_y = (iTexNum / 4) * 64; break; case D3DPAGE_32_4X4: base_x = (iTexNum % 4) * 32; base_y = (iTexNum / 4) * 32; break; default: ASSERT(0); break; } SLONG diag_size = texture_size >> 1; // Do top-left corner. if ( bHasU ) { if ( bHasL ) { // Has both - fill both, diagonal join. for ( int iPixX = 0; iPixX < diag_size; iPixX++ ) { for ( int iPixY = 0; iPixY < diag_size; iPixY++ ) { if ( iPixY > iPixX ) { // Copy from left. PLOT_PIX ( base_x - 1, base_y + iPixY, base_x + iPixX, base_y + iPixY ); } else { // Copy from top. PLOT_PIX ( base_x + iPixX, base_y - 1, base_x + iPixX, base_y + iPixY ); } } } } else { // Has top - fill from that. for ( int iPixX = 0; iPixX < diag_size; iPixX++ ) { for ( int iPixY = 0; iPixY < diag_size; iPixY++ ) { // Copy from top. PLOT_PIX ( base_x + iPixX, base_y - 1, base_x + iPixX, base_y + iPixY ); } } } } else { if ( bHasL ) { // Has left. for ( int iPixX = 0; iPixX < diag_size; iPixX++ ) { for ( int iPixY = 0; iPixY < diag_size; iPixY++ ) { // Copy from left. PLOT_PIX ( base_x - 1, base_y + iPixY, base_x + iPixX, base_y + iPixY ); } } } else { // Has neither - copy from top-left. for ( int iPixX = 0; iPixX < diag_size; iPixX++ ) { for ( int iPixY = 0; iPixY < diag_size; iPixY++ ) { PLOT_PIX ( base_x - 1, base_y - 1, base_x + iPixX, base_y + iPixY ); } } } } // Do top-right corner. if ( bHasU ) { if ( bHasR ) { // Has both - fill both, diagonal join. for ( int iPixX = 0; iPixX < diag_size; iPixX++ ) { for ( int iPixY = 0; iPixY < diag_size; iPixY++ ) { if ( iPixY > iPixX ) { // Copy from right. PLOT_PIX ( base_x + texture_size, base_y + iPixY, base_x + texture_size - 1 - iPixX, base_y + iPixY ); } else { // Copy from top. PLOT_PIX ( base_x + texture_size - 1 - iPixX, base_y - 1, base_x + texture_size - 1 - iPixX, base_y + iPixY ); } } } } else { // Has top - fill from that. for ( int iPixX = 0; iPixX < diag_size; iPixX++ ) { for ( int iPixY = 0; iPixY < diag_size; iPixY++ ) { // Copy from top. PLOT_PIX ( base_x + texture_size - 1 - iPixX, base_y - 1, base_x + texture_size - 1 - iPixX, base_y + iPixY ); } } } } else { if ( bHasR ) { // Has right. for ( int iPixX = 0; iPixX < diag_size; iPixX++ ) { for ( int iPixY = 0; iPixY < diag_size; iPixY++ ) { // Copy from right. PLOT_PIX ( base_x + texture_size, base_y + iPixY, base_x + texture_size - 1 - iPixX, base_y + iPixY ); } } } else { // Has neither - copy from top-right. for ( int iPixX = 0; iPixX < diag_size; iPixX++ ) { for ( int iPixY = 0; iPixY < diag_size; iPixY++ ) { PLOT_PIX ( base_x + texture_size, base_y - 1, base_x + texture_size - 1 - iPixX, base_y + iPixY ); } } } } // Do bottom-left corner. if ( bHasD ) { if ( bHasL ) { // Has both - fill both, diagonal join. for ( int iPixX = 0; iPixX < diag_size; iPixX++ ) { for ( int iPixY = 0; iPixY < diag_size; iPixY++ ) { if ( iPixY > iPixX ) { // Copy from left. PLOT_PIX ( base_x - 1, base_y + texture_size - 1 - iPixY, base_x + iPixX, base_y + texture_size - 1 - iPixY ); } else { // Copy from bottom. PLOT_PIX ( base_x + iPixX, base_y + texture_size, base_x + iPixX, base_y + texture_size - 1 - iPixY ); } } } } else { // Has bottom - fill from that. for ( int iPixX = 0; iPixX < diag_size; iPixX++ ) { for ( int iPixY = 0; iPixY < diag_size; iPixY++ ) { // Copy from bottom. PLOT_PIX ( base_x + iPixX, base_y + texture_size, base_x + iPixX, base_y + texture_size - 1 - iPixY ); } } } } else { if ( bHasL ) { // Has left. for ( int iPixX = 0; iPixX < diag_size; iPixX++ ) { for ( int iPixY = 0; iPixY < diag_size; iPixY++ ) { // Copy from left. PLOT_PIX ( base_x - 1, base_y + texture_size - 1 - iPixY, base_x + iPixX, base_y + texture_size - 1 - iPixY ); } } } else { // Has neither - copy from bottom-left. for ( int iPixX = 0; iPixX < diag_size; iPixX++ ) { for ( int iPixY = 0; iPixY < diag_size; iPixY++ ) { PLOT_PIX ( base_x - 1, base_y + texture_size, base_x + iPixX, base_y + texture_size - 1 - iPixY ); } } } } // Do bottom-right corner. if ( bHasD ) { if ( bHasR ) { // Has both - fill both, diagonal join. for ( int iPixX = 0; iPixX < diag_size; iPixX++ ) { for ( int iPixY = 0; iPixY < diag_size; iPixY++ ) { if ( iPixY > iPixX ) { // Copy from right. PLOT_PIX ( base_x + texture_size, base_y + texture_size - 1 - iPixY, base_x + texture_size - 1 - iPixX, base_y + texture_size - 1 - iPixY ); } else { // Copy from bottom. PLOT_PIX ( base_x + texture_size - 1 - iPixX, base_y + texture_size, base_x + texture_size - 1 - iPixX, base_y + texture_size - 1 - iPixY ); } } } } else { // Has bottom - fill from that. for ( int iPixX = 0; iPixX < diag_size; iPixX++ ) { for ( int iPixY = 0; iPixY < diag_size; iPixY++ ) { // Copy from bottom. PLOT_PIX ( base_x + texture_size - 1 - iPixX, base_y + texture_size, base_x + texture_size - 1 - iPixX, base_y + texture_size - 1 - iPixY ); } } } } else { if ( bHasR ) { // Has right. for ( int iPixX = 0; iPixX < diag_size; iPixX++ ) { for ( int iPixY = 0; iPixY < diag_size; iPixY++ ) { // Copy from right. PLOT_PIX ( base_x + texture_size, base_y + texture_size - 1 - iPixY, base_x + texture_size - 1 - iPixX, base_y + texture_size - 1 - iPixY ); } } } else { // Has neither - copy from bottom-right. for ( int iPixX = 0; iPixX < diag_size; iPixX++ ) { for ( int iPixY = 0; iPixY < diag_size; iPixY++ ) { PLOT_PIX ( base_x + texture_size, base_y + texture_size, base_x + texture_size - 1 - iPixX, base_y + texture_size - 1 - iPixY ); } } } } } } } // And finally write it out. CBYTE texture_filename[256]; sprintf(texture_filename, "%s\\PackedTexture%03d.tga", PACK_output_directory, iPageNum ); // // Got a whole new texture. // TGA_save(texture_filename, page_size, page_size, (TGA_Pixel *) PACK_tga, FALSE); } fprintf(PACK_fname_array_handle, "\t\"***END\"\n"); fprintf(PACK_text_array_handle, "***END\n\n\n"); fprintf(PACK_fname_array_handle, "};\n\n"); fclose(PACK_fname_array_handle); fclose(PACK_text_array_handle); TRACE ( "Finished PACKing level %s", ELEV_fname_level ); } #endif //#ifndef TARGET_DC
22.095368
239
0.563602
FaultyRAM
28cd60d0bcc4a7d141a03fd324d50b9126afcb27
11,931
cpp
C++
libraries/fc/src/crypto/pke.cpp
titans-world/titan-core
f358f48290f3501b26b26eff6a1e57bf6c077d79
[ "MIT" ]
8
2020-11-29T20:19:52.000Z
2021-11-02T21:01:41.000Z
libraries/fc/src/crypto/pke.cpp
titans-world/titan-core
f358f48290f3501b26b26eff6a1e57bf6c077d79
[ "MIT" ]
5
2021-03-06T10:58:34.000Z
2021-08-07T09:51:09.000Z
libraries/fc/src/crypto/pke.cpp
titans-world/titan-core
f358f48290f3501b26b26eff6a1e57bf6c077d79
[ "MIT" ]
5
2020-10-22T17:01:27.000Z
2022-02-02T12:53:47.000Z
#include <fc/crypto/pke.hpp> #include <openssl/rsa.h> #include <openssl/rand.h> #include <openssl/sha.h> #include <openssl/pem.h> #include <openssl/err.h> #include <assert.h> #include <fc/crypto/base64.hpp> #include <fc/io/sstream.hpp> #include <fc/io/stdio.hpp> #include <fc/exception/exception.hpp> #include <fc/variant.hpp> namespace fc { namespace detail { class pke_impl { public: pke_impl():rsa(nullptr){} ~pke_impl() { if( rsa != nullptr ) RSA_free(rsa); } RSA* rsa; }; } // detail public_key::operator bool()const { return !!my; } private_key::operator bool()const { return !!my; } public_key::public_key() {} public_key::public_key( const bytes& d ) :my( std::make_shared<detail::pke_impl>() ) { string pem = "-----BEGIN RSA PUBLIC KEY-----\n"; auto b64 = fc::base64_encode( (const unsigned char*)d.data(), d.size() ); for( size_t i = 0; i < b64.size(); i += 64 ) pem += b64.substr( i, 64 ) + "\n"; pem += "-----END RSA PUBLIC KEY-----\n"; // fc::cerr<<pem; BIO* mem = (BIO*)BIO_new_mem_buf( (void*)pem.c_str(), pem.size() ); my->rsa = PEM_read_bio_RSAPublicKey(mem, NULL, NULL, NULL ); BIO_free(mem); } public_key::public_key( const public_key& k ) :my(k.my) { } public_key::public_key( public_key&& k ) :my(std::move(k.my)) { } public_key::~public_key() { } public_key& public_key::operator=(const public_key& p ) { my = p.my; return *this; } public_key& public_key::operator=( public_key&& p ) { my = std::move(p.my); return *this; } bool public_key::verify( const sha1& digest, const array<char,2048/8>& sig )const { return 0 != RSA_verify( NID_sha1, (const uint8_t*)&digest, 20, (uint8_t*)&sig, 2048/8, my->rsa ); } bool public_key::verify( const sha1& digest, const signature& sig )const { static_assert( sig.size() == 2048/8, "Invalid signature size" ); return 0 != RSA_verify( NID_sha1, (const uint8_t*)&digest, 20, (uint8_t*)sig.data(), 2048/8, my->rsa ); } bool public_key::verify( const sha256& digest, const signature& sig )const { static_assert( sig.size() == 2048/8, "Invalid signature size" ); return 0 != RSA_verify( NID_sha256, (const uint8_t*)&digest, 32, (uint8_t*)sig.data(), 2048/8, my->rsa ); } bytes public_key::encrypt( const char* b, size_t l )const { FC_ASSERT( my && my->rsa ); bytes out( RSA_size(my->rsa) ); //, char(0) ); int rtn = RSA_public_encrypt( l, (unsigned char*)b, (unsigned char*)out.data(), my->rsa, RSA_PKCS1_OAEP_PADDING ); if( rtn >= 0 ) { out.resize(rtn); return out; } FC_THROW_EXCEPTION( exception, "openssl: ${message}", ("message",fc::string(ERR_error_string( ERR_get_error(),NULL))) ); } bytes public_key::encrypt( const bytes& in )const { FC_ASSERT( my && my->rsa ); bytes out( RSA_size(my->rsa) ); //, char(0) ); int rtn = RSA_public_encrypt( in.size(), (unsigned char*)in.data(), (unsigned char*)out.data(), my->rsa, RSA_PKCS1_OAEP_PADDING ); fc::cerr<<"rtn: "<<rtn<<"\n"; if( rtn >= 0 ) { out.resize(rtn); return out; } FC_THROW_EXCEPTION( exception, "openssl: ${message}", ("message",fc::string(ERR_error_string( ERR_get_error(),NULL))) ); } bytes public_key::decrypt( const bytes& in )const { FC_ASSERT( my && my->rsa ); bytes out( RSA_size(my->rsa) );//, char(0) ); int rtn = RSA_public_decrypt( in.size(), (unsigned char*)in.data(), (unsigned char*)out.data(), my->rsa, RSA_PKCS1_OAEP_PADDING ); if( rtn >= 0 ) { out.resize(rtn); return out; } FC_THROW_EXCEPTION( exception, "openssl: ${message}", ("message",fc::string(ERR_error_string( ERR_get_error(),NULL))) ); } bytes public_key::serialize()const { bytes ba; if( !my ) { return ba; } BIO *mem = BIO_new(BIO_s_mem()); int e = PEM_write_bio_RSAPublicKey( mem, my->rsa ); if( e != 1 ) { BIO_free(mem); FC_THROW_EXCEPTION( exception, "openssl: ${message}", ("message",fc::string(ERR_error_string( ERR_get_error(),NULL))) ); } char* dat; uint32_t l = BIO_get_mem_data( mem, &dat ); fc::stringstream ss( string( dat, l ) ); fc::stringstream key; fc::string tmp; fc::getline( ss, tmp ); fc::getline( ss, tmp ); while( tmp.size() && tmp[0] != '-' ) { key << tmp; fc::getline( ss, tmp ); } auto str = key.str(); str = fc::base64_decode( str ); ba = bytes( str.begin(), str.end() ); BIO_free(mem); return ba; } private_key::private_key() { } private_key::private_key( const bytes& d ) :my( std::make_shared<detail::pke_impl>() ) { string pem = "-----BEGIN RSA PRIVATE KEY-----\n"; auto b64 = fc::base64_encode( (const unsigned char*)d.data(), d.size() ); for( size_t i = 0; i < b64.size(); i += 64 ) pem += b64.substr( i, 64 ) + "\n"; pem += "-----END RSA PRIVATE KEY-----\n"; // fc::cerr<<pem; BIO* mem = (BIO*)BIO_new_mem_buf( (void*)pem.c_str(), pem.size() ); my->rsa = PEM_read_bio_RSAPrivateKey(mem, NULL, NULL, NULL ); BIO_free(mem); FC_ASSERT( my->rsa, "read private key" ); } private_key::private_key( const private_key& k ) :my(k.my) { } private_key::private_key( private_key&& k ) :my(std::move(k.my) ) { } private_key::~private_key() { } private_key& private_key::operator=(const private_key& p ) { my = p.my; return *this; } private_key& private_key::operator=(private_key&& p ) { my = std::move(p.my); return *this; } void private_key::sign( const sha1& digest, array<char,2048/8>& sig )const { FC_ASSERT( (size_t(RSA_size(my->rsa)) <= sizeof(sig)), "Invalid RSA size" ); uint32_t slen = 0; if( 1 != RSA_sign( NID_sha1, (uint8_t*)&digest, 20, (unsigned char*)&sig, &slen, my->rsa ) ) { FC_THROW_EXCEPTION( exception, "rsa sign failed with ${message}", ("message",fc::string(ERR_error_string( ERR_get_error(),NULL))) ); } } signature private_key::sign( const sha1& digest )const { if( !my ) FC_THROW_EXCEPTION( assert_exception, "!null" ); signature sig; sig.resize( RSA_size(my->rsa) ); uint32_t slen = 0; if( 1 != RSA_sign( NID_sha1, (uint8_t*)digest.data(), 20, (unsigned char*)sig.data(), &slen, my->rsa ) ) { FC_THROW_EXCEPTION( exception, "rsa sign failed with ${message}", ("message",fc::string(ERR_error_string( ERR_get_error(),NULL))) ); } return sig; } signature private_key::sign( const sha256& digest )const { if( !my ) FC_THROW_EXCEPTION( assert_exception, "!null" ); signature sig; sig.resize( RSA_size(my->rsa) ); uint32_t slen = 0; if( 1 != RSA_sign( NID_sha256, (uint8_t*)digest.data(), 32, (unsigned char*)sig.data(), &slen, my->rsa ) ) { FC_THROW_EXCEPTION( exception, "rsa sign failed with ${message}", ("message",fc::string(ERR_error_string( ERR_get_error(),NULL))) ); } return sig; } bytes private_key::encrypt( const bytes& in )const { if( !my ) FC_THROW_EXCEPTION( assert_exception, "!null" ); bytes out; out.resize( RSA_size(my->rsa) ); int rtn = RSA_private_encrypt( in.size(), (unsigned char*)in.data(), (unsigned char*)out.data(), my->rsa, RSA_PKCS1_OAEP_PADDING ); if( rtn >= 0 ) { out.resize(rtn); return out; } FC_THROW_EXCEPTION( exception, "encrypt failed" ); } bytes private_key::decrypt( const char* in, size_t l )const { if( !my ) FC_THROW_EXCEPTION( assert_exception, "!null" ); bytes out; out.resize( RSA_size(my->rsa) ); int rtn = RSA_private_decrypt( l, (unsigned char*)in, (unsigned char*)out.data(), my->rsa, RSA_PKCS1_OAEP_PADDING ); if( rtn >= 0 ) { out.resize(rtn); return out; } FC_THROW_EXCEPTION( exception, "decrypt failed" ); } bytes private_key::decrypt( const bytes& in )const { if( !my ) FC_THROW_EXCEPTION( assert_exception, "!null" ); bytes out; out.resize( RSA_size(my->rsa) ); int rtn = RSA_private_decrypt( in.size(), (unsigned char*)in.data(), (unsigned char*)out.data(), my->rsa, RSA_PKCS1_OAEP_PADDING ); if( rtn >= 0 ) { out.resize(rtn); return out; } FC_THROW_EXCEPTION( exception, "decrypt failed" ); } bytes private_key::serialize()const { bytes ba; if( !my ) { return ba; } BIO *mem = BIO_new(BIO_s_mem()); int e = PEM_write_bio_RSAPrivateKey( mem, my->rsa, NULL, NULL, 0, NULL, NULL ); if( e != 1 ) { BIO_free(mem); FC_THROW_EXCEPTION( exception, "Error writing private key, ${message}", ("message",fc::string(ERR_error_string( ERR_get_error(),NULL))) ); } char* dat; uint32_t l = BIO_get_mem_data( mem, &dat ); // return bytes( dat, dat + l ); stringstream ss( string( dat, l ) ); stringstream key; string tmp; fc::getline( ss, tmp ); fc::getline( ss, tmp ); while( tmp.size() && tmp[0] != '-' ) { key << tmp; fc::getline( ss, tmp ); } auto str = key.str(); str = fc::base64_decode( str ); ba = bytes( str.begin(), str.end() ); // ba = bytes( dat, dat + l ); BIO_free(mem); return ba; } void generate_key_pair( public_key& pub, private_key& priv ) { static bool init = true; if( init ) { ERR_load_crypto_strings(); init = false; } pub.my = std::make_shared<detail::pke_impl>(); priv.my = pub.my; pub.my->rsa = RSA_generate_key( 2048, 65537, NULL, NULL ); } /** encodes the big int as base64 string, or a number */ void to_variant( const public_key& bi, variant& v, uint32_t max_depth ) { v = bi.serialize(); } /** decodes the big int as base64 string, or a number */ void from_variant( const variant& v, public_key& bi, uint32_t max_depth ) { bi = public_key( v.as<std::vector<char> >(max_depth) ); } /** encodes the big int as base64 string, or a number */ void to_variant( const private_key& bi, variant& v, uint32_t max_depth ) { v = bi.serialize(); } /** decodes the big int as base64 string, or a number */ void from_variant( const variant& v, private_key& bi, uint32_t max_depth ) { bi = private_key( v.as<std::vector<char> >(max_depth) ); } } // fc
32.598361
149
0.52351
titans-world
28d34d2985e98911742b847a963f4308d6712a0e
52,938
hpp
C++
sdk/structs.hpp
xsoma/drugs.club
a1dace54a8425a2a52d3af0d1c8053bf7fb0e895
[ "Unlicense" ]
3
2021-08-02T16:59:36.000Z
2022-01-07T20:54:57.000Z
sdk/structs.hpp
xsoma/drugs.club
a1dace54a8425a2a52d3af0d1c8053bf7fb0e895
[ "Unlicense" ]
null
null
null
sdk/structs.hpp
xsoma/drugs.club
a1dace54a8425a2a52d3af0d1c8053bf7fb0e895
[ "Unlicense" ]
2
2021-12-14T04:29:32.000Z
2022-01-07T20:54:56.000Z
#pragma once #include "..\includes.hpp" #include "interfaces\IClientEntity.hpp" #include "misc\EHandle.hpp" #include "misc\UtlVector.hpp" #include "math\QAngle.hpp" #include "..\utils\netmanager.hpp" #include "misc\CBoneAccessor.hpp" #include "..\cheats\misc\fakelag.h" #include "..\sdk\misc\Recv.hpp" #define min(a, b) (((a) < (b)) ? (a) : (b)) #define max(a, b) (((a) > (b)) ? (a) : (b)) #define TIME_TO_TICKS(t) ((int)(0.5f + (float)(t) / m_globals()->m_intervalpertick)) #define TICKS_TO_TIME(t) (m_globals()->m_intervalpertick * (t)) #define NETVAR(type, name, table, netvar) \ type& name##() const { \ static int _##name = netvars::get().get_offset(table, netvar); \ return *(type*)((uintptr_t)this + _##name); \ } #define PNETVAR(type, name, table, netvar) \ type* name##() const { \ static int _##name = netvars::get().get_offset(table, netvar); \ return (type*)((uintptr_t)this + _##name); \ } #define OFFSET(type, name, offset)\ type &name##() const\ {\ return *(type*)(uintptr_t(this) + offset);\ } class player_t; struct datamap_t; enum CSWeaponType { WEAPONTYPE_KNIFE = 0, WEAPONTYPE_PISTOL, WEAPONTYPE_SUBMACHINEGUN, WEAPONTYPE_RIFLE, WEAPONTYPE_SHOTGUN, WEAPONTYPE_SNIPER_RIFLE, WEAPONTYPE_MACHINEGUN, WEAPONTYPE_C4, WEAPONTYPE_PLACEHOLDER, WEAPONTYPE_GRENADE, WEAPONTYPE_UNKNOWN }; class VarMapEntry_t { public: unsigned short type; unsigned short m_bNeedsToInterpolate; void* data; void* watcher; }; struct VarMapping_t { VarMapping_t() { m_Entries = nullptr; m_nInterpolatedEntries = 0; m_lastInterpolationTime = 0.0f; } VarMapEntry_t* m_Entries; int m_nInterpolatedEntries; float m_lastInterpolationTime; }; struct client_hit_verify_t { Vector position; float time; float expires; }; class AnimationLayer; class c_baseplayeranimationstate; class entity_t; class clientanimating_t; class weapon_info_t { public: char pad_0000[4]; //0x0000 char* ConsoleName; //0x0004 char pad_0008[12]; //0x0008 int iMaxClip1; //0x0014 char pad_0018[12]; //0x0018 int iMaxClip2; //0x0024 char pad_0028[4]; //0x0028 char* szWorldModel; //0x002C char* szViewModel; //0x0030 char* szDropedModel; //0x0034 char pad_0038[4]; //0x0038 char* N00000984; //0x003C char pad_0040[56]; //0x0040 char* szEmptySound; //0x0078 char pad_007C[4]; //0x007C char* szBulletType; //0x0080 char pad_0084[4]; //0x0084 char* szHudName; //0x0088 char* szWeaponName; //0x008C char pad_0090[60]; //0x0090 int WeaponType; //0x00CC int iWeaponPrice; //0x00D0 int iKillAward; //0x00D4 char* szAnimationPrefex; //0x00D8 float flCycleTime; //0x00DC float flCycleTimeAlt; //0x00E0 float flTimeToIdle; //0x00E4 float flIdleInterval; //0x00E8 bool bFullAuto; //0x00EC char pad_00ED[3]; //0x00ED int iDamage; //0x00F0 float flArmorRatio; //0x00F4 int iBullets; //0x00F8 float flPenetration; //0x00FC float flFlinchVelocityModifierLarge; //0x0100 float flFlinchVelocityModifierSmall; //0x0104 float flRange; //0x0108 float flRangeModifier; //0x010C char pad_0110[28]; //0x0110 int iCrosshairMinDistance; //0x012C float flMaxPlayerSpeed; //0x0130 float flMaxPlayerSpeedAlt; //0x0134 char pad_0138[4]; //0x0138 float flSpread; //0x013C float flSpreadAlt; //0x0140 float flInaccuracyCrouch; //0x0144 float flInaccuracyCrouchAlt; //0x0148 float flInaccuracyStand; //0x014C float flInaccuracyStandAlt; //0x0150 float flInaccuracyJumpIntial; //0x0154 float flInaccaurcyJumpApex; float flInaccuracyJump; //0x0158 float flInaccuracyJumpAlt; //0x015C float flInaccuracyLand; //0x0160 float flInaccuracyLandAlt; //0x0164 float flInaccuracyLadder; //0x0168 float flInaccuracyLadderAlt; //0x016C float flInaccuracyFire; //0x0170 float flInaccuracyFireAlt; //0x0174 float flInaccuracyMove; //0x0178 float flInaccuracyMoveAlt; //0x017C float flInaccuracyReload; //0x0180 int iRecoilSeed; //0x0184 float flRecoilAngle; //0x0188 float flRecoilAngleAlt; //0x018C float flRecoilVariance; //0x0190 float flRecoilAngleVarianceAlt; //0x0194 float flRecoilMagnitude; //0x0198 float flRecoilMagnitudeAlt; //0x019C float flRecoilMagnatiudeVeriance; //0x01A0 float flRecoilMagnatiudeVerianceAlt; //0x01A4 float flRecoveryTimeCrouch; //0x01A8 float flRecoveryTimeStand; //0x01AC float flRecoveryTimeCrouchFinal; //0x01B0 float flRecoveryTimeStandFinal; //0x01B4 int iRecoveryTransititionStartBullet; //0x01B8 int iRecoveryTransititionEndBullet; //0x01BC bool bUnzoomAfterShot; //0x01C0 char pad_01C1[31]; //0x01C1 char* szWeaponClass; //0x01E0 char pad_01E4[56]; //0x01E4 float flInaccuracyPitchShift; //0x021C float flInaccuracySoundThreshold; //0x0220 float flBotAudibleRange; //0x0224 char pad_0228[12]; //0x0228 bool bHasBurstMode; //0x0234 }; struct NoticeText_t { wchar_t text[512]; int unk0; // 0x400 float unk1; // 0x404 float unk2; // 0x408 int unk3; // 0x40C float time; // 0x410 int unk4; // 0x414 float fade; // 0x418 int unk5; // 0x41C }; struct KillFeed_t { char pad[0x7C]; CUtlVector <NoticeText_t> notices; }; class entity_t : public IClientEntity { public: NETVAR(int, body, crypt_str("CBaseAnimating"), crypt_str("m_nBody")); NETVAR(int, m_nModelIndex, crypt_str("CBaseEntity"), crypt_str("m_nModelIndex")); NETVAR(int, m_iTeamNum, crypt_str("CBaseEntity"), crypt_str("m_iTeamNum")); NETVAR(Vector, m_vecOrigin, crypt_str("CBaseEntity"), crypt_str("m_vecOrigin")); NETVAR(CHandle <player_t>, m_hOwnerEntity, crypt_str("CBaseEntity"), crypt_str("m_hOwnerEntity")); NETVAR(int, m_CollisionGroup, crypt_str("CBaseEntity"), crypt_str("m_CollisionGroup")); NETVAR(int, m_nSequence, crypt_str("CBaseAnimating"), crypt_str("m_nSequence")); void set_m_bUseCustomBloomScale(byte value) { *reinterpret_cast<byte*>(uintptr_t(this) + (int)netvars::get().get_offset(crypt_str("CEnvTonemapController"), crypt_str("m_bUseCustomBloomScale"))) = value; } void set_m_flCustomBloomScale(float value) { *reinterpret_cast<float*>(uintptr_t(this) + (int)netvars::get().get_offset(crypt_str("CEnvTonemapController"), crypt_str("m_flCustomBloomScale"))) = value; } void set_m_bUseCustomAutoExposureMin(byte value) { *reinterpret_cast<byte*>(uintptr_t(this) + (int)netvars::get().get_offset(crypt_str("CEnvTonemapController"), crypt_str("m_bUseCustomAutoExposureMin"))) = value; } void set_m_flCustomAutoExposureMin(float value) { *reinterpret_cast<float*>(uintptr_t(this) + (int)netvars::get().get_offset(crypt_str("CEnvTonemapController"), crypt_str("m_flCustomAutoExposureMin"))) = value; } void set_m_bUseCustomAutoExposureMax(byte value) { *reinterpret_cast<byte*>(uintptr_t(this) + (int)netvars::get().get_offset(crypt_str("CEnvTonemapController"), crypt_str("m_bUseCustomAutoExposureMax"))) = value; } void set_m_flCustomAutoExposureMax(float value) { *reinterpret_cast<float*>(uintptr_t(this) + (int)netvars::get().get_offset(crypt_str("CEnvTonemapController"), crypt_str("m_flCustomAutoExposureMax"))) = value; } const matrix3x4_t& m_rgflCoordinateFrame() { static auto _m_rgflCoordinateFrame = netvars::get().get_offset(crypt_str("CBaseEntity"), crypt_str("m_CollisionGroup")) - 0x30; return *(matrix3x4_t*)((uintptr_t)this + _m_rgflCoordinateFrame); } int GetPropInt(std::string& table, std::string& var) { static auto offset = netvars::get().get_offset(table.c_str(), var.c_str()); int val = *(int*)(uintptr_t(this) + (int)offset); return val; } float GetPropFloat(std::string& table, std::string& var) { static auto offset = netvars::get().get_offset(table.c_str(), var.c_str()); float val = *(float*)(uintptr_t(this) + (int)offset); return val; } bool GetPropBool(std::string& table, std::string& var) { static auto offset = netvars::get().get_offset(table.c_str(), var.c_str()); bool val = *(bool*)(uintptr_t(this) + (int)offset); return val; } std::string GetPropString(std::string& table, std::string& var) { static auto offset = netvars::get().get_offset(table.c_str(), var.c_str()); char* val = (char*)(uintptr_t(this) + (int)offset); return std::string(val); } void SetPropInt(std::string& table, std::string& var, int val) { *reinterpret_cast<int*>(uintptr_t(this) + (int)netvars::get().get_offset(table.c_str(), var.c_str())) = val; } void SetPropFloat(std::string& table, std::string& var, float val) { *reinterpret_cast<float*>(uintptr_t(this) + (int)netvars::get().get_offset(table.c_str(), var.c_str())) = val; } void SetPropBool(std::string& table, std::string& var, bool val) { *reinterpret_cast<float*>(uintptr_t(this) + (int)netvars::get().get_offset(table.c_str(), var.c_str())) = val; } datamap_t* GetPredDescMap(); std::array <float, 24>& m_flPoseParameter(); bool is_player(); void set_model_index(int index); void set_abs_angles(const Vector& angle); void set_abs_origin(const Vector& origin); }; class attributableitem_t : public entity_t { public: NETVAR(int, m_iItemDefinitionIndex, crypt_str("CBaseAttributableItem"), crypt_str("m_iItemDefinitionIndex")); NETVAR(int, m_nFallbackStatTrak, crypt_str("CBaseAttributableItem"), crypt_str("m_nFallbackStatTrak")); NETVAR(int, m_nFallbackPaintKit, crypt_str("CBaseAttributableItem"), crypt_str("m_nFallbackPaintKit")); NETVAR(int, m_nFallbackSeed, crypt_str("CBaseAttributableItem"), crypt_str("m_nFallbackSeed")); NETVAR(float, m_flFallbackWear, crypt_str("CBaseAttributableItem"), crypt_str("m_flFallbackWear")); NETVAR(int, m_iAccountID, crypt_str("CBaseAttributableItem"), crypt_str("m_iAccountID")); NETVAR(int, m_iItemIDHigh, crypt_str("CBaseAttributableItem"), crypt_str("m_iItemIDHigh")); PNETVAR(char, m_szCustomName, crypt_str("CBaseAttributableItem"), crypt_str("m_szCustomName")); NETVAR(int, m_OriginalOwnerXuidLow, crypt_str("CBaseAttributableItem"), crypt_str("m_OriginalOwnerXuidLow")); NETVAR(int, m_OriginalOwnerXuidHigh, crypt_str("CBaseAttributableItem"), crypt_str("m_OriginalOwnerXuidHigh")); NETVAR(int, m_iEntityQuality, crypt_str("CBaseAttributableItem"), crypt_str("m_iEntityQuality")); }; class weapon_t : public attributableitem_t { public: NETVAR(float, m_flNextPrimaryAttack, crypt_str("CBaseCombatWeapon"), crypt_str("m_flNextPrimaryAttack")); NETVAR(float, m_flNextSecondaryAttack, crypt_str("CBaseCombatWeapon"), crypt_str("m_flNextSecondaryAttack")); NETVAR(bool, initialized, crypt_str("CBaseAttributableItem"), crypt_str("m_bInitialized")); NETVAR(int, weapon, crypt_str("CBaseViewModel"), crypt_str("m_hWeapon")); NETVAR(short, m_iItemDefinitionIndex, crypt_str("CBaseCombatWeapon"), crypt_str("m_iItemDefinitionIndex")); NETVAR(int, m_iClip1, crypt_str("CBaseCombatWeapon"), crypt_str("m_iClip1")); NETVAR(int, m_iViewModelIndex, crypt_str("CBaseCombatWeapon"), crypt_str("m_iViewModelIndex")); NETVAR(int, m_iWorldModelIndex, crypt_str("CBaseCombatWeapon"), crypt_str("m_iWorldModelIndex")); NETVAR(float, m_fAccuracyPenalty, crypt_str("CWeaponCSBase"), crypt_str("m_fAccuracyPenalty")); NETVAR(int, m_zoomLevel, crypt_str("CWeaponCSBaseGun"), crypt_str("m_zoomLevel")); NETVAR(bool, m_bPinPulled, crypt_str("CBaseCSGrenade"), crypt_str("m_bPinPulled")); NETVAR(float, m_fThrowTime, crypt_str("CBaseCSGrenade"), crypt_str("m_fThrowTime")); NETVAR(float, m_flPostponeFireReadyTime, crypt_str("CWeaponCSBase"), crypt_str("m_flPostponeFireReadyTime")); NETVAR(float, m_fLastShotTime, crypt_str("CWeaponCSBase"), crypt_str("m_fLastShotTime")); NETVAR(float, m_flRecoilSeed, crypt_str("CWeaponCSBase"), crypt_str("m_flRecoilIndex")); NETVAR(int, m_weaponMode, crypt_str("CWeaponCSBase"), crypt_str("m_weaponMode")); NETVAR(CHandle <weapon_t>, m_hWeaponWorldModel, crypt_str("CBaseCombatWeapon"), crypt_str("m_hWeaponWorldModel")); weapon_info_t* get_csweapon_info(); bool is_empty(); bool can_fire(bool check_revolver); int get_weapon_group(bool rage); bool is_rifle(); bool is_smg(); bool is_shotgun(); bool is_pistol(); int get_max_tickbase_shift(); bool is_sniper(); bool is_grenade(); bool is_knife(); bool is_non_aim(); bool can_double_tap(); float get_inaccuracy(); float get_spread(); void update_accuracy_penality(); char* get_icon(); std::string get_name(); }; class viewmodel_t; class player_t : public entity_t { public: NETVAR(bool, m_bClientSideAnimation, crypt_str("CBaseAnimating"), crypt_str("m_bClientSideAnimation")); NETVAR(bool, m_bHasDefuser, crypt_str("CCSPlayer"), crypt_str("m_bHasDefuser")); NETVAR(bool, m_bGunGameImmunity, crypt_str("CCSPlayer"), crypt_str("m_bGunGameImmunity")); NETVAR(int, m_iShotsFired, crypt_str("CCSPlayer"), crypt_str("m_iShotsFired")); NETVAR(Vector, m_angEyeAngles, crypt_str("CCSPlayer"), crypt_str("m_angEyeAngles[0]")); NETVAR(Vector, m_angRotation, crypt_str("CBaseEntity"), crypt_str("m_angRotation")); NETVAR(int, m_ArmorValue, crypt_str("CCSPlayer"), crypt_str("m_ArmorValue")); NETVAR(int, m_iAccount, crypt_str("CCSPlayer"), crypt_str("m_iAccount")); NETVAR(bool, m_bHasHelmet, crypt_str("CCSPlayer"), crypt_str("m_bHasHelmet")); NETVAR(bool, m_bHasHeavyArmor, crypt_str("CCSPlayer"), crypt_str("m_bHasHeavyArmor")); NETVAR(bool, m_bIsScoped, crypt_str("CCSPlayer"), crypt_str("m_bIsScoped")); NETVAR(float, m_flLowerBodyYawTarget, crypt_str("CCSPlayer"), crypt_str("m_flLowerBodyYawTarget")); NETVAR(float, m_flFlashDuration, crypt_str("CCSPlayer"), crypt_str("m_flFlashDuration")); NETVAR(CBaseHandle, m_hVehicle, crypt_str("CBasePlayer"), crypt_str("m_hVehicle")); NETVAR(int, m_iHealth, crypt_str("CBasePlayer"), crypt_str("m_iHealth")); NETVAR(int, m_lifeState, crypt_str("CBasePlayer"), crypt_str("m_lifeState")); NETVAR(int, m_fFlags, crypt_str("CBasePlayer"), crypt_str("m_fFlags")); NETVAR(int, get_next_think_tick, crypt_str("CBasePlayer"), crypt_str("m_nNextThinkTick")); NETVAR(int, m_nHitboxSet, crypt_str("CBasePlayer"), crypt_str("m_nHitboxSet")); NETVAR(int, m_nTickBase, crypt_str("CBasePlayer"), crypt_str("m_nTickBase")); NETVAR(Vector, m_vecViewOffset, crypt_str("CBasePlayer"), crypt_str("m_vecViewOffset[0]")); NETVAR(Vector, m_viewPunchAngle, crypt_str("CBasePlayer"), crypt_str("m_viewPunchAngle")); NETVAR(Vector, m_aimPunchAngle, crypt_str("CBasePlayer"), crypt_str("m_aimPunchAngle")); NETVAR(Vector, m_aimPunchAngleVel, crypt_str("CBasePlayer"), crypt_str("m_aimPunchAngleVel")); NETVAR(CHandle <viewmodel_t>, m_hViewModel, crypt_str("CBasePlayer"), crypt_str("m_hViewModel[0]")); NETVAR(Vector, m_vecVelocity, crypt_str("CBasePlayer"), crypt_str("m_vecVelocity[0]")); NETVAR(Vector, m_vecMins, crypt_str("CBaseEntity"), crypt_str("m_vecMins")); NETVAR(Vector, m_vecMaxs, crypt_str("CBaseEntity"), crypt_str("m_vecMaxs")); NETVAR(float, m_flVelocityModifier, crypt_str("CCSPlayer"), crypt_str("m_flVelocityModifier")); NETVAR(float, m_flSimulationTime, crypt_str("CBaseEntity"), crypt_str("m_flSimulationTime")); OFFSET(float, m_flOldSimulationTime, netvars::get().get_offset(crypt_str("CBaseEntity"), crypt_str("m_flSimulationTime")) + 0x4); NETVAR(float, m_flDuckSpeed, crypt_str("CCSPlayer"), crypt_str("m_flDuckSpeed")); NETVAR(float, m_flDuckAmount, crypt_str("CCSPlayer"), crypt_str("m_flDuckAmount")); NETVAR(bool, m_bDucked, crypt_str("CCSPlayer"), crypt_str("m_bDucked")); NETVAR(bool, m_bDucking, crypt_str("CCSPlayer"), crypt_str("m_bDucking")); NETVAR(float, m_flHealthShotBoostExpirationTime, crypt_str("CCSPlayer"), crypt_str("m_flHealthShotBoostExpirationTime")); NETVAR(int, m_bInBombZone, crypt_str("CCSPlayer"), crypt_str("m_bInBombZone")); NETVAR(float, m_flFallVelocity, crypt_str("CBasePlayer"), crypt_str("m_flFallVelocity")); NETVAR(float, m_flStepSize, crypt_str("CBaseEntity"), crypt_str("m_flStepSize")); NETVAR(float, m_flNextAttack, crypt_str("CBaseCombatCharacter"), crypt_str("m_flNextAttack")); PNETVAR(CBaseHandle, m_hMyWearables, crypt_str("CBaseCombatCharacter"), crypt_str("m_hMyWearables")); NETVAR(int, m_iObserverMode, crypt_str("CBasePlayer"), crypt_str("m_iObserverMode")); NETVAR(CHandle <player_t>, m_hObserverTarget, crypt_str("CBasePlayer"), crypt_str("m_hObserverTarget")); NETVAR(CHandle <weapon_t>, m_hActiveWeapon, crypt_str("CBaseCombatCharacter"), crypt_str("m_hActiveWeapon")); NETVAR(CHandle <attributableitem_t>, m_hWeaponWorldModel, crypt_str("CBaseCombatWeapon"), crypt_str("m_hWeaponWorldModel")); NETVAR(CHandle <entity_t>, m_hGroundEntity, crypt_str("CBasePlayer"), crypt_str("m_hGroundEntity")); NETVAR(bool, m_bSpotted, crypt_str("CBaseEntity"), crypt_str("m_bSpotted")); NETVAR(int, m_vphysicsCollisionState, crypt_str("CBasePlayer"), crypt_str("m_vphysicsCollisionState")); NETVAR(bool, m_bIsWalking, crypt_str("CCSPlayer"), crypt_str("m_bIsWalking")); NETVAR(bool, m_bIsDefusing, crypt_str("CCSPlayer"), crypt_str("m_bIsDefusing")); VIRTUAL(think(void), 138, void(__thiscall*)(void*)); VIRTUAL(pre_think(void), 317, void(__thiscall*)(void*)); VIRTUAL(post_think(void), 318, void(__thiscall*)(void*)); VIRTUAL(set_local_view_angles(Vector& angle), 372, void(__thiscall*)(void*, Vector&), angle); CBaseHandle* m_hMyWeapons() { return (CBaseHandle*)((uintptr_t)this + 0x2DF8); } float& m_flSpawnTime() { return *(float*)((uintptr_t)this + 0xA360); } uint32_t& m_iMostRecentModelBoneCounter(); float& m_flLastBoneSetupTime(); void select_item(const char* string, int sub_type); bool using_standard_weapons_in_vechile(); bool physics_run_think(int index); VarMapping_t* var_mapping(); c_baseplayeranimationstate* get_animation_state(); CStudioHdr* m_pStudioHdr(); bool setup_bones_fixed(matrix3x4_t* matrix, int mask); Vector get_shoot_position(); void modify_eye_position(Vector& eye_position); uint32_t& m_fEffects(); uint32_t& m_iEFlags(); float& m_surfaceFriction(); Vector& m_vecAbsVelocity(); int get_hitbox_bone_id(int hitbox_id); Vector hitbox_position(int hitbox_id); Vector hitbox_position_matrix(int hitbox_id, matrix3x4_t matrix[MAXSTUDIOBONES]); AnimationLayer* get_animlayers(); CUtlVector <matrix3x4_t>& m_CachedBoneData(); CBoneAccessor& m_BoneAccessor(); void invalidate_bone_cache(); void set_abs_velocity(const Vector& velocity); Vector get_render_angles(); void set_render_angles(const Vector& angles); void update_clientside_animation(); bool is_alive(); bool valid(bool check_team, bool check_dormant = true); int get_move_type(); int animlayer_count(); int sequence_activity(int sequence); float get_max_desync_delta(); void invalidate_physics_recursive(int change_flags); }; class viewmodel_t : public entity_t { public: NETVAR(int, m_nModelIndex, crypt_str("CBaseViewModel"), crypt_str("m_nModelIndex")); NETVAR(int, m_nViewModelIndex, crypt_str("CBaseViewModel"), crypt_str("m_nViewModelIndex")); NETVAR(CHandle <weapon_t>, m_hWeapon, crypt_str("CBaseViewModel"), crypt_str("m_hWeapon")); NETVAR(CHandle <player_t>, m_hOwner, crypt_str("CBaseViewModel"), crypt_str("m_hOwner")); NETVAR(int, m_nAnimationParity, crypt_str("CBaseViewModel"), crypt_str("m_nAnimationParity")); float& m_flCycle(); float& m_flAnimTime(); void SendViewModelMatchingSequence(int sequence); }; class CCSBomb : public entity_t { public: NETVAR(float, m_flDefuseCountDown, crypt_str("CPlantedC4"), crypt_str("m_flDefuseCountDown")); NETVAR(int, m_hBombDefuser, crypt_str("CPlantedC4"), crypt_str("m_hBombDefuser")); NETVAR(float, m_flC4Blow, crypt_str("CPlantedC4"), crypt_str("m_flC4Blow")); NETVAR(bool, m_bBombDefused, crypt_str("CPlantedC4"), crypt_str("m_bBombDefused")); }; class ragdoll_t : public entity_t { public: NETVAR(Vector, m_vecForce, crypt_str("CCSRagdoll"), crypt_str("m_vecForce")); NETVAR(Vector, m_vecRagdollVelocity, crypt_str("CCSRagdoll"), crypt_str("m_vecRagdollVelocity")); }; struct inferno_t : public entity_t { OFFSET(int, m_DmgRadius, 0x7ec); OFFSET(float, get_spawn_time, 0x20); static float get_expiry_time() { return 7.03125f; } }; struct smoke_t : public entity_t { NETVAR(int, m_nSmokeEffectTickBegin, crypt_str("CSmokeGrenadeProjectile"), crypt_str("m_nSmokeEffectTickBegin")); NETVAR(bool, m_bDidSmokeEffect, crypt_str("CSmokeGrenadeProjectile"), crypt_str("m_bDidSmokeEffect")); static float get_expiry_time() { return 19.0f; } }; class CHudChat { public: char pad_0x0000[0x4C]; int m_timesOpened; char pad_0x0050[0x8]; bool m_isOpen; char pad_0x0059[0x427]; void chat_print(const char* fmt, ...); }; class AnimationLayer { public: bool m_bClientBlend; //0x0000 float m_flBlendIn; //0x0004 void* m_pStudioHdr; //0x0008 int m_nDispatchSequence; //0x000C int m_nDispatchSequence_2; //0x0010 uint32_t m_nOrder; //0x0014 uint32_t m_nSequence; //0x0018 float_t m_flPrevCycle; //0x001C float_t m_flWeight; //0x0020 float_t m_flWeightDeltaRate; //0x0024 float_t m_flPlaybackRate; //0x0028 float_t m_flCycle; //0x002C void* m_pOwner; //0x0030 char pad_0038[4]; //0x0034 }; class c_baseplayeranimationstate { public: char pad[3]; char bUnknown; //0x4 char pad2[87]; weapon_t* m_pLastBoneSetupWeapon; //0x5C player_t* m_pBaseEntity; //0x60 weapon_t* m_pActiveWeapon; //0x64 weapon_t* m_pLastActiveWeapon; //0x68 float m_flLastClientSideAnimationUpdateTime; //0x6C int m_iLastClientSideAnimationUpdateFramecount; //0x70 float m_flUpdateTimeDelta; //0x74 float m_flEyeYaw; //0x78 float m_flPitch; //0x7C float m_flGoalFeetYaw; //0x80 float m_flCurrentFeetYaw; //0x84 float m_flCurrentTorsoYaw; //0x88 float m_flUnknownVelocityLean; //0x8C //changes when moving/jumping/hitting ground float m_flLeanAmount; //0x90 char pad4[4]; //NaN float m_flFeetCycle; //0x98 0 to 1 float m_flFeetYawRate; //0x9C 0 to 1 float m_fUnknown2; float m_fDuckAmount; //0xA4 float m_fLandingDuckAdditiveSomething; //0xA8 float m_fUnknown3; //0xAC Vector m_vOrigin; //0xB0, 0xB4, 0xB8 Vector m_vLastOrigin; //0xBC, 0xC0, 0xC4 float m_vVelocityX; //0xC8 float m_vVelocityY; //0xCC char pad5[4]; float m_flUnknownFloat1; //0xD4 Affected by movement and direction char pad6[8]; float m_flUnknownFloat2; //0xE0 //from -1 to 1 when moving and affected by direction float m_flUnknownFloat3; //0xE4 //from -1 to 1 when moving and affected by direction float m_unknown; //0xE8 float m_velocity; //0xEC float flUpVelocity; //0xF0 float m_flSpeedNormalized; //0xF4 //from 0 to 1 float m_flFeetSpeedForwardsOrSideWays; //0xF8 //from 0 to 2. something is 1 when walking, 2.something when running, 0.653 when crouch walking float m_flFeetSpeedUnknownForwardOrSideways; //0xFC //from 0 to 3. something float m_flTimeSinceStartedMoving; //0x100 float m_flTimeSinceStoppedMoving; //0x104 bool m_bOnGround; //0x108 bool m_bInHitGroundAnimation; //0x109 char pad7[10]; float m_flLastOriginZ; //0x114 float m_flHeadHeightOrOffsetFromHittingGroundAnimation; //0x118 from 0 to 1, is 1 when standing float m_flStopToFullRunningFraction; //0x11C from 0 to 1, doesnt change when walking or crouching, only running char pad8[4]; //NaN float m_flMovingFraction; //0x124 affected while jumping and running, or when just jumping, 0 to 1 char pad9[4]; //NaN float m_flUnknown3; char pad10[528]; float& time_since_in_air() { return *(float*)((uintptr_t)this + 0x110); } float& yaw_desync_adjustment() { return *(float*)((uintptr_t)this + 0x334); } }; enum Activity { ACT_RESET, ACT_IDLE, ACT_TRANSITION, ACT_COVER, ACT_COVER_MED, ACT_COVER_LOW, ACT_WALK, ACT_WALK_AIM, ACT_WALK_CROUCH, ACT_WALK_CROUCH_AIM, ACT_RUN, ACT_RUN_AIM, ACT_RUN_CROUCH, ACT_RUN_CROUCH_AIM, ACT_RUN_PROTECTED, ACT_SCRIPT_CUSTOM_MOVE, ACT_RANGE_ATTACK1, ACT_RANGE_ATTACK2, ACT_RANGE_ATTACK1_LOW, ACT_RANGE_ATTACK2_LOW, ACT_DIESIMPLE, ACT_DIEBACKWARD, ACT_DIEFORWARD, ACT_DIEVIOLENT, ACT_DIERAGDOLL, ACT_FLY, ACT_HOVER, ACT_GLIDE, ACT_SWIM, ACT_JUMP, ACT_HOP, ACT_LEAP, ACT_LAND, ACT_CLIMB_UP, ACT_CLIMB_DOWN, ACT_CLIMB_DISMOUNT, ACT_SHIPLADDER_UP, ACT_SHIPLADDER_DOWN, ACT_STRAFE_LEFT, ACT_STRAFE_RIGHT, ACT_ROLL_LEFT, ACT_ROLL_RIGHT, ACT_TURN_LEFT, ACT_TURN_RIGHT, ACT_CROUCH, ACT_CROUCHIDLE, ACT_STAND, ACT_USE, ACT_ALIEN_BURROW_IDLE, ACT_ALIEN_BURROW_OUT, ACT_SIGNAL1, ACT_SIGNAL2, ACT_SIGNAL3, ACT_SIGNAL_ADVANCE, ACT_SIGNAL_FORWARD, ACT_SIGNAL_GROUP, ACT_SIGNAL_HALT, ACT_SIGNAL_LEFT, ACT_SIGNAL_RIGHT, ACT_SIGNAL_TAKECOVER, ACT_LOOKBACK_RIGHT, ACT_LOOKBACK_LEFT, ACT_COWER, ACT_SMALL_FLINCH, ACT_BIG_FLINCH, ACT_MELEE_ATTACK1, ACT_MELEE_ATTACK2, ACT_RELOAD, ACT_RELOAD_START, ACT_RELOAD_FINISH, ACT_RELOAD_LOW, ACT_ARM, ACT_DISARM, ACT_DROP_WEAPON, ACT_DROP_WEAPON_SHOTGUN, ACT_PICKUP_GROUND, ACT_PICKUP_RACK, ACT_IDLE_ANGRY, ACT_IDLE_RELAXED, ACT_IDLE_STIMULATED, ACT_IDLE_AGITATED, ACT_IDLE_STEALTH, ACT_IDLE_HURT, ACT_WALK_RELAXED, ACT_WALK_STIMULATED, ACT_WALK_AGITATED, ACT_WALK_STEALTH, ACT_RUN_RELAXED, ACT_RUN_STIMULATED, ACT_RUN_AGITATED, ACT_RUN_STEALTH, ACT_IDLE_AIM_RELAXED, ACT_IDLE_AIM_STIMULATED, ACT_IDLE_AIM_AGITATED, ACT_IDLE_AIM_STEALTH, ACT_WALK_AIM_RELAXED, ACT_WALK_AIM_STIMULATED, ACT_WALK_AIM_AGITATED, ACT_WALK_AIM_STEALTH, ACT_RUN_AIM_RELAXED, ACT_RUN_AIM_STIMULATED, ACT_RUN_AIM_AGITATED, ACT_RUN_AIM_STEALTH, ACT_CROUCHIDLE_STIMULATED, ACT_CROUCHIDLE_AIM_STIMULATED, ACT_CROUCHIDLE_AGITATED, ACT_WALK_HURT, ACT_RUN_HURT, ACT_SPECIAL_ATTACK1, ACT_SPECIAL_ATTACK2, ACT_COMBAT_IDLE, ACT_WALK_SCARED, ACT_RUN_SCARED, ACT_VICTORY_DANCE, ACT_DIE_HEADSHOT, ACT_DIE_CHESTSHOT, ACT_DIE_GUTSHOT, ACT_DIE_BACKSHOT, ACT_FLINCH_HEAD, ACT_FLINCH_CHEST, ACT_FLINCH_STOMACH, ACT_FLINCH_LEFTARM, ACT_FLINCH_RIGHTARM, ACT_FLINCH_LEFTLEG, ACT_FLINCH_RIGHTLEG, ACT_FLINCH_PHYSICS, ACT_FLINCH_HEAD_BACK, ACT_FLINCH_HEAD_LEFT, ACT_FLINCH_HEAD_RIGHT, ACT_FLINCH_CHEST_BACK, ACT_FLINCH_STOMACH_BACK, ACT_FLINCH_CROUCH_FRONT, ACT_FLINCH_CROUCH_BACK, ACT_FLINCH_CROUCH_LEFT, ACT_FLINCH_CROUCH_RIGHT, ACT_IDLE_ON_FIRE, ACT_WALK_ON_FIRE, ACT_RUN_ON_FIRE, ACT_RAPPEL_LOOP, ACT_180_LEFT, ACT_180_RIGHT, ACT_90_LEFT, ACT_90_RIGHT, ACT_STEP_LEFT, ACT_STEP_RIGHT, ACT_STEP_BACK, ACT_STEP_FORE, ACT_GESTURE_RANGE_ATTACK1, ACT_GESTURE_RANGE_ATTACK2, ACT_GESTURE_MELEE_ATTACK1, ACT_GESTURE_MELEE_ATTACK2, ACT_GESTURE_RANGE_ATTACK1_LOW, ACT_GESTURE_RANGE_ATTACK2_LOW, ACT_MELEE_ATTACK_SWING_GESTURE, ACT_GESTURE_SMALL_FLINCH, ACT_GESTURE_BIG_FLINCH, ACT_GESTURE_FLINCH_BLAST, ACT_GESTURE_FLINCH_BLAST_SHOTGUN, ACT_GESTURE_FLINCH_BLAST_DAMAGED, ACT_GESTURE_FLINCH_BLAST_DAMAGED_SHOTGUN, ACT_GESTURE_FLINCH_HEAD, ACT_GESTURE_FLINCH_CHEST, ACT_GESTURE_FLINCH_STOMACH, ACT_GESTURE_FLINCH_LEFTARM, ACT_GESTURE_FLINCH_RIGHTARM, ACT_GESTURE_FLINCH_LEFTLEG, ACT_GESTURE_FLINCH_RIGHTLEG, ACT_GESTURE_TURN_LEFT, ACT_GESTURE_TURN_RIGHT, ACT_GESTURE_TURN_LEFT45, ACT_GESTURE_TURN_RIGHT45, ACT_GESTURE_TURN_LEFT90, ACT_GESTURE_TURN_RIGHT90, ACT_GESTURE_TURN_LEFT45_FLAT, ACT_GESTURE_TURN_RIGHT45_FLAT, ACT_GESTURE_TURN_LEFT90_FLAT, ACT_GESTURE_TURN_RIGHT90_FLAT, ACT_BARNACLE_HIT, ACT_BARNACLE_PULL, ACT_BARNACLE_CHOMP, ACT_BARNACLE_CHEW, ACT_DO_NOT_DISTURB, ACT_SPECIFIC_SEQUENCE, ACT_VM_DRAW, ACT_VM_HOLSTER, ACT_VM_IDLE, ACT_VM_FIDGET, ACT_VM_PULLBACK, ACT_VM_PULLBACK_HIGH, ACT_VM_PULLBACK_LOW, ACT_VM_THROW, ACT_VM_PULLPIN, ACT_VM_PRIMARYATTACK, ACT_VM_SECONDARYATTACK, ACT_VM_RELOAD, ACT_VM_DRYFIRE, ACT_VM_HITLEFT, ACT_VM_HITLEFT2, ACT_VM_HITRIGHT, ACT_VM_HITRIGHT2, ACT_VM_HITCENTER, ACT_VM_HITCENTER2, ACT_VM_MISSLEFT, ACT_VM_MISSLEFT2, ACT_VM_MISSRIGHT, ACT_VM_MISSRIGHT2, ACT_VM_MISSCENTER, ACT_VM_MISSCENTER2, ACT_VM_HAULBACK, ACT_VM_SWINGHARD, ACT_VM_SWINGMISS, ACT_VM_SWINGHIT, ACT_VM_IDLE_TO_LOWERED, ACT_VM_IDLE_LOWERED, ACT_VM_LOWERED_TO_IDLE, ACT_VM_RECOIL1, ACT_VM_RECOIL2, ACT_VM_RECOIL3, ACT_VM_PICKUP, ACT_VM_RELEASE, ACT_VM_ATTACH_SILENCER, ACT_VM_DETACH_SILENCER, ACT_VM_EMPTY_FIRE, ACT_VM_EMPTY_RELOAD, ACT_VM_EMPTY_DRAW, ACT_VM_EMPTY_IDLE, ACT_SLAM_STICKWALL_IDLE, ACT_SLAM_STICKWALL_ND_IDLE, ACT_SLAM_STICKWALL_ATTACH, ACT_SLAM_STICKWALL_ATTACH2, ACT_SLAM_STICKWALL_ND_ATTACH, ACT_SLAM_STICKWALL_ND_ATTACH2, ACT_SLAM_STICKWALL_DETONATE, ACT_SLAM_STICKWALL_DETONATOR_HOLSTER, ACT_SLAM_STICKWALL_DRAW, ACT_SLAM_STICKWALL_ND_DRAW, ACT_SLAM_STICKWALL_TO_THROW, ACT_SLAM_STICKWALL_TO_THROW_ND, ACT_SLAM_STICKWALL_TO_TRIPMINE_ND, ACT_SLAM_THROW_IDLE, ACT_SLAM_THROW_ND_IDLE, ACT_SLAM_THROW_THROW, ACT_SLAM_THROW_THROW2, ACT_SLAM_THROW_THROW_ND, ACT_SLAM_THROW_THROW_ND2, ACT_SLAM_THROW_DRAW, ACT_SLAM_THROW_ND_DRAW, ACT_SLAM_THROW_TO_STICKWALL, ACT_SLAM_THROW_TO_STICKWALL_ND, ACT_SLAM_THROW_DETONATE, ACT_SLAM_THROW_DETONATOR_HOLSTER, ACT_SLAM_THROW_TO_TRIPMINE_ND, ACT_SLAM_TRIPMINE_IDLE, ACT_SLAM_TRIPMINE_DRAW, ACT_SLAM_TRIPMINE_ATTACH, ACT_SLAM_TRIPMINE_ATTACH2, ACT_SLAM_TRIPMINE_TO_STICKWALL_ND, ACT_SLAM_TRIPMINE_TO_THROW_ND, ACT_SLAM_DETONATOR_IDLE, ACT_SLAM_DETONATOR_DRAW, ACT_SLAM_DETONATOR_DETONATE, ACT_SLAM_DETONATOR_HOLSTER, ACT_SLAM_DETONATOR_STICKWALL_DRAW, ACT_SLAM_DETONATOR_THROW_DRAW, ACT_SHOTGUN_RELOAD_START, ACT_SHOTGUN_RELOAD_FINISH, ACT_SHOTGUN_PUMP, ACT_SMG2_IDLE2, ACT_SMG2_FIRE2, ACT_SMG2_DRAW2, ACT_SMG2_RELOAD2, ACT_SMG2_DRYFIRE2, ACT_SMG2_TOAUTO, ACT_SMG2_TOBURST, ACT_PHYSCANNON_UPGRADE, ACT_RANGE_ATTACK_AR1, ACT_RANGE_ATTACK_AR2, ACT_RANGE_ATTACK_AR2_LOW, ACT_RANGE_ATTACK_AR2_GRENADE, ACT_RANGE_ATTACK_HMG1, ACT_RANGE_ATTACK_ML, ACT_RANGE_ATTACK_SMG1, ACT_RANGE_ATTACK_SMG1_LOW, ACT_RANGE_ATTACK_SMG2, ACT_RANGE_ATTACK_SHOTGUN, ACT_RANGE_ATTACK_SHOTGUN_LOW, ACT_RANGE_ATTACK_PISTOL, ACT_RANGE_ATTACK_PISTOL_LOW, ACT_RANGE_ATTACK_SLAM, ACT_RANGE_ATTACK_TRIPWIRE, ACT_RANGE_ATTACK_THROW, ACT_RANGE_ATTACK_SNIPER_RIFLE, ACT_RANGE_ATTACK_RPG, ACT_MELEE_ATTACK_SWING, ACT_RANGE_AIM_LOW, ACT_RANGE_AIM_SMG1_LOW, ACT_RANGE_AIM_PISTOL_LOW, ACT_RANGE_AIM_AR2_LOW, ACT_COVER_PISTOL_LOW, ACT_COVER_SMG1_LOW, ACT_GESTURE_RANGE_ATTACK_AR1, ACT_GESTURE_RANGE_ATTACK_AR2, ACT_GESTURE_RANGE_ATTACK_AR2_GRENADE, ACT_GESTURE_RANGE_ATTACK_HMG1, ACT_GESTURE_RANGE_ATTACK_ML, ACT_GESTURE_RANGE_ATTACK_SMG1, ACT_GESTURE_RANGE_ATTACK_SMG1_LOW, ACT_GESTURE_RANGE_ATTACK_SMG2, ACT_GESTURE_RANGE_ATTACK_SHOTGUN, ACT_GESTURE_RANGE_ATTACK_PISTOL, ACT_GESTURE_RANGE_ATTACK_PISTOL_LOW, ACT_GESTURE_RANGE_ATTACK_SLAM, ACT_GESTURE_RANGE_ATTACK_TRIPWIRE, ACT_GESTURE_RANGE_ATTACK_THROW, ACT_GESTURE_RANGE_ATTACK_SNIPER_RIFLE, ACT_GESTURE_MELEE_ATTACK_SWING, ACT_IDLE_RIFLE, ACT_IDLE_SMG1, ACT_IDLE_ANGRY_SMG1, ACT_IDLE_PISTOL, ACT_IDLE_ANGRY_PISTOL, ACT_IDLE_ANGRY_SHOTGUN, ACT_IDLE_STEALTH_PISTOL, ACT_IDLE_PACKAGE, ACT_WALK_PACKAGE, ACT_IDLE_SUITCASE, ACT_WALK_SUITCASE, ACT_IDLE_SMG1_RELAXED, ACT_IDLE_SMG1_STIMULATED, ACT_WALK_RIFLE_RELAXED, ACT_RUN_RIFLE_RELAXED, ACT_WALK_RIFLE_STIMULATED, ACT_RUN_RIFLE_STIMULATED, ACT_IDLE_AIM_RIFLE_STIMULATED, ACT_WALK_AIM_RIFLE_STIMULATED, ACT_RUN_AIM_RIFLE_STIMULATED, ACT_IDLE_SHOTGUN_RELAXED, ACT_IDLE_SHOTGUN_STIMULATED, ACT_IDLE_SHOTGUN_AGITATED, ACT_WALK_ANGRY, ACT_POLICE_HARASS1, ACT_POLICE_HARASS2, ACT_IDLE_MANNEDGUN, ACT_IDLE_MELEE, ACT_IDLE_ANGRY_MELEE, ACT_IDLE_RPG_RELAXED, ACT_IDLE_RPG, ACT_IDLE_ANGRY_RPG, ACT_COVER_LOW_RPG, ACT_WALK_RPG, ACT_RUN_RPG, ACT_WALK_CROUCH_RPG, ACT_RUN_CROUCH_RPG, ACT_WALK_RPG_RELAXED, ACT_RUN_RPG_RELAXED, ACT_WALK_RIFLE, ACT_WALK_AIM_RIFLE, ACT_WALK_CROUCH_RIFLE, ACT_WALK_CROUCH_AIM_RIFLE, ACT_RUN_RIFLE, ACT_RUN_AIM_RIFLE, ACT_RUN_CROUCH_RIFLE, ACT_RUN_CROUCH_AIM_RIFLE, ACT_RUN_STEALTH_PISTOL, ACT_WALK_AIM_SHOTGUN, ACT_RUN_AIM_SHOTGUN, ACT_WALK_PISTOL, ACT_RUN_PISTOL, ACT_WALK_AIM_PISTOL, ACT_RUN_AIM_PISTOL, ACT_WALK_STEALTH_PISTOL, ACT_WALK_AIM_STEALTH_PISTOL, ACT_RUN_AIM_STEALTH_PISTOL, ACT_RELOAD_PISTOL, ACT_RELOAD_PISTOL_LOW, ACT_RELOAD_SMG1, ACT_RELOAD_SMG1_LOW, ACT_RELOAD_SHOTGUN, ACT_RELOAD_SHOTGUN_LOW, ACT_GESTURE_RELOAD, ACT_GESTURE_RELOAD_PISTOL, ACT_GESTURE_RELOAD_SMG1, ACT_GESTURE_RELOAD_SHOTGUN, ACT_BUSY_LEAN_LEFT, ACT_BUSY_LEAN_LEFT_ENTRY, ACT_BUSY_LEAN_LEFT_EXIT, ACT_BUSY_LEAN_BACK, ACT_BUSY_LEAN_BACK_ENTRY, ACT_BUSY_LEAN_BACK_EXIT, ACT_BUSY_SIT_GROUND, ACT_BUSY_SIT_GROUND_ENTRY, ACT_BUSY_SIT_GROUND_EXIT, ACT_BUSY_SIT_CHAIR, ACT_BUSY_SIT_CHAIR_ENTRY, ACT_BUSY_SIT_CHAIR_EXIT, ACT_BUSY_STAND, ACT_BUSY_QUEUE, ACT_DUCK_DODGE, ACT_DIE_BARNACLE_SWALLOW, ACT_GESTURE_BARNACLE_STRANGLE, ACT_PHYSCANNON_DETACH, ACT_PHYSCANNON_ANIMATE, ACT_PHYSCANNON_ANIMATE_PRE, ACT_PHYSCANNON_ANIMATE_POST, ACT_DIE_FRONTSIDE, ACT_DIE_RIGHTSIDE, ACT_DIE_BACKSIDE, ACT_DIE_LEFTSIDE, ACT_DIE_CROUCH_FRONTSIDE, ACT_DIE_CROUCH_RIGHTSIDE, ACT_DIE_CROUCH_BACKSIDE, ACT_DIE_CROUCH_LEFTSIDE, ACT_OPEN_DOOR, ACT_DI_ALYX_ZOMBIE_MELEE, ACT_DI_ALYX_ZOMBIE_TORSO_MELEE, ACT_DI_ALYX_HEADCRAB_MELEE, ACT_DI_ALYX_ANTLION, ACT_DI_ALYX_ZOMBIE_SHOTGUN64, ACT_DI_ALYX_ZOMBIE_SHOTGUN26, ACT_READINESS_RELAXED_TO_STIMULATED, ACT_READINESS_RELAXED_TO_STIMULATED_WALK, ACT_READINESS_AGITATED_TO_STIMULATED, ACT_READINESS_STIMULATED_TO_RELAXED, ACT_READINESS_PISTOL_RELAXED_TO_STIMULATED, ACT_READINESS_PISTOL_RELAXED_TO_STIMULATED_WALK, ACT_READINESS_PISTOL_AGITATED_TO_STIMULATED, ACT_READINESS_PISTOL_STIMULATED_TO_RELAXED, ACT_IDLE_CARRY, ACT_WALK_CARRY, ACT_STARTDYING, ACT_DYINGLOOP, ACT_DYINGTODEAD, ACT_RIDE_MANNED_GUN, ACT_VM_SPRINT_ENTER, ACT_VM_SPRINT_IDLE, ACT_VM_SPRINT_LEAVE, ACT_FIRE_START, ACT_FIRE_LOOP, ACT_FIRE_END, ACT_CROUCHING_GRENADEIDLE, ACT_CROUCHING_GRENADEREADY, ACT_CROUCHING_PRIMARYATTACK, ACT_OVERLAY_GRENADEIDLE, ACT_OVERLAY_GRENADEREADY, ACT_OVERLAY_PRIMARYATTACK, ACT_OVERLAY_SHIELD_UP, ACT_OVERLAY_SHIELD_DOWN, ACT_OVERLAY_SHIELD_UP_IDLE, ACT_OVERLAY_SHIELD_ATTACK, ACT_OVERLAY_SHIELD_KNOCKBACK, ACT_SHIELD_UP, ACT_SHIELD_DOWN, ACT_SHIELD_UP_IDLE, ACT_SHIELD_ATTACK, ACT_SHIELD_KNOCKBACK, ACT_CROUCHING_SHIELD_UP, ACT_CROUCHING_SHIELD_DOWN, ACT_CROUCHING_SHIELD_UP_IDLE, ACT_CROUCHING_SHIELD_ATTACK, ACT_CROUCHING_SHIELD_KNOCKBACK, ACT_TURNRIGHT45, ACT_TURNLEFT45, ACT_TURN, ACT_OBJ_ASSEMBLING, ACT_OBJ_DISMANTLING, ACT_OBJ_STARTUP, ACT_OBJ_RUNNING, ACT_OBJ_IDLE, ACT_OBJ_PLACING, ACT_OBJ_DETERIORATING, ACT_OBJ_UPGRADING, ACT_DEPLOY, ACT_DEPLOY_IDLE, ACT_UNDEPLOY, ACT_CROSSBOW_DRAW_UNLOADED, ACT_GAUSS_SPINUP, ACT_GAUSS_SPINCYCLE, ACT_VM_PRIMARYATTACK_SILENCED, ACT_VM_RELOAD_SILENCED, ACT_VM_DRYFIRE_SILENCED, ACT_VM_IDLE_SILENCED, ACT_VM_DRAW_SILENCED, ACT_VM_IDLE_EMPTY_LEFT, ACT_VM_DRYFIRE_LEFT, ACT_VM_IS_DRAW, ACT_VM_IS_HOLSTER, ACT_VM_IS_IDLE, ACT_VM_IS_PRIMARYATTACK, ACT_PLAYER_IDLE_FIRE, ACT_PLAYER_CROUCH_FIRE, ACT_PLAYER_CROUCH_WALK_FIRE, ACT_PLAYER_WALK_FIRE, ACT_PLAYER_RUN_FIRE, ACT_IDLETORUN, ACT_RUNTOIDLE, ACT_VM_DRAW_DEPLOYED, ACT_HL2MP_IDLE_MELEE, ACT_HL2MP_RUN_MELEE, ACT_HL2MP_IDLE_CROUCH_MELEE, ACT_HL2MP_WALK_CROUCH_MELEE, ACT_HL2MP_GESTURE_RANGE_ATTACK_MELEE, ACT_HL2MP_GESTURE_RELOAD_MELEE, ACT_HL2MP_JUMP_MELEE, ACT_VM_FIZZLE, ACT_MP_STAND_IDLE, ACT_MP_CROUCH_IDLE, ACT_MP_CROUCH_DEPLOYED_IDLE, ACT_MP_CROUCH_DEPLOYED, ACT_MP_DEPLOYED_IDLE, ACT_MP_RUN, ACT_MP_WALK, ACT_MP_AIRWALK, ACT_MP_CROUCHWALK, ACT_MP_SPRINT, ACT_MP_JUMP, ACT_MP_JUMP_START, ACT_MP_JUMP_FLOAT, ACT_MP_JUMP_LAND, ACT_MP_JUMP_IMPACT_N, ACT_MP_JUMP_IMPACT_E, ACT_MP_JUMP_IMPACT_W, ACT_MP_JUMP_IMPACT_S, ACT_MP_JUMP_IMPACT_TOP, ACT_MP_DOUBLEJUMP, ACT_MP_SWIM, ACT_MP_DEPLOYED, ACT_MP_SWIM_DEPLOYED, ACT_MP_VCD, ACT_MP_ATTACK_STAND_PRIMARYFIRE, ACT_MP_ATTACK_STAND_PRIMARYFIRE_DEPLOYED, ACT_MP_ATTACK_STAND_SECONDARYFIRE, ACT_MP_ATTACK_STAND_GRENADE, ACT_MP_ATTACK_CROUCH_PRIMARYFIRE, ACT_MP_ATTACK_CROUCH_PRIMARYFIRE_DEPLOYED, ACT_MP_ATTACK_CROUCH_SECONDARYFIRE, ACT_MP_ATTACK_CROUCH_GRENADE, ACT_MP_ATTACK_SWIM_PRIMARYFIRE, ACT_MP_ATTACK_SWIM_SECONDARYFIRE, ACT_MP_ATTACK_SWIM_GRENADE, ACT_MP_ATTACK_AIRWALK_PRIMARYFIRE, ACT_MP_ATTACK_AIRWALK_SECONDARYFIRE, ACT_MP_ATTACK_AIRWALK_GRENADE, ACT_MP_RELOAD_STAND, ACT_MP_RELOAD_STAND_LOOP, ACT_MP_RELOAD_STAND_END, ACT_MP_RELOAD_CROUCH, ACT_MP_RELOAD_CROUCH_LOOP, ACT_MP_RELOAD_CROUCH_END, ACT_MP_RELOAD_SWIM, ACT_MP_RELOAD_SWIM_LOOP, ACT_MP_RELOAD_SWIM_END, ACT_MP_RELOAD_AIRWALK, ACT_MP_RELOAD_AIRWALK_LOOP, ACT_MP_RELOAD_AIRWALK_END, ACT_MP_ATTACK_STAND_PREFIRE, ACT_MP_ATTACK_STAND_POSTFIRE, ACT_MP_ATTACK_STAND_STARTFIRE, ACT_MP_ATTACK_CROUCH_PREFIRE, ACT_MP_ATTACK_CROUCH_POSTFIRE, ACT_MP_ATTACK_SWIM_PREFIRE, ACT_MP_ATTACK_SWIM_POSTFIRE, ACT_MP_STAND_PRIMARY, ACT_MP_CROUCH_PRIMARY, ACT_MP_RUN_PRIMARY, ACT_MP_WALK_PRIMARY, ACT_MP_AIRWALK_PRIMARY, ACT_MP_CROUCHWALK_PRIMARY, ACT_MP_JUMP_PRIMARY, ACT_MP_JUMP_START_PRIMARY, ACT_MP_JUMP_FLOAT_PRIMARY, ACT_MP_JUMP_LAND_PRIMARY, ACT_MP_SWIM_PRIMARY, ACT_MP_DEPLOYED_PRIMARY, ACT_MP_SWIM_DEPLOYED_PRIMARY, ACT_MP_ATTACK_STAND_PRIMARY, ACT_MP_ATTACK_STAND_PRIMARY_DEPLOYED, ACT_MP_ATTACK_CROUCH_PRIMARY, ACT_MP_ATTACK_CROUCH_PRIMARY_DEPLOYED, ACT_MP_ATTACK_SWIM_PRIMARY, ACT_MP_ATTACK_AIRWALK_PRIMARY, ACT_MP_RELOAD_STAND_PRIMARY, ACT_MP_RELOAD_STAND_PRIMARY_LOOP, ACT_MP_RELOAD_STAND_PRIMARY_END, ACT_MP_RELOAD_CROUCH_PRIMARY, ACT_MP_RELOAD_CROUCH_PRIMARY_LOOP, ACT_MP_RELOAD_CROUCH_PRIMARY_END, ACT_MP_RELOAD_SWIM_PRIMARY, ACT_MP_RELOAD_SWIM_PRIMARY_LOOP, ACT_MP_RELOAD_SWIM_PRIMARY_END, ACT_MP_RELOAD_AIRWALK_PRIMARY, ACT_MP_RELOAD_AIRWALK_PRIMARY_LOOP, ACT_MP_RELOAD_AIRWALK_PRIMARY_END, ACT_MP_ATTACK_STAND_GRENADE_PRIMARY, ACT_MP_ATTACK_CROUCH_GRENADE_PRIMARY, ACT_MP_ATTACK_SWIM_GRENADE_PRIMARY, ACT_MP_ATTACK_AIRWALK_GRENADE_PRIMARY, ACT_MP_STAND_SECONDARY, ACT_MP_CROUCH_SECONDARY, ACT_MP_RUN_SECONDARY, ACT_MP_WALK_SECONDARY, ACT_MP_AIRWALK_SECONDARY, ACT_MP_CROUCHWALK_SECONDARY, ACT_MP_JUMP_SECONDARY, ACT_MP_JUMP_START_SECONDARY, ACT_MP_JUMP_FLOAT_SECONDARY, ACT_MP_JUMP_LAND_SECONDARY, ACT_MP_SWIM_SECONDARY, ACT_MP_ATTACK_STAND_SECONDARY, ACT_MP_ATTACK_CROUCH_SECONDARY, ACT_MP_ATTACK_SWIM_SECONDARY, ACT_MP_ATTACK_AIRWALK_SECONDARY, ACT_MP_RELOAD_STAND_SECONDARY, ACT_MP_RELOAD_STAND_SECONDARY_LOOP, ACT_MP_RELOAD_STAND_SECONDARY_END, ACT_MP_RELOAD_CROUCH_SECONDARY, ACT_MP_RELOAD_CROUCH_SECONDARY_LOOP, ACT_MP_RELOAD_CROUCH_SECONDARY_END, ACT_MP_RELOAD_SWIM_SECONDARY, ACT_MP_RELOAD_SWIM_SECONDARY_LOOP, ACT_MP_RELOAD_SWIM_SECONDARY_END, ACT_MP_RELOAD_AIRWALK_SECONDARY, ACT_MP_RELOAD_AIRWALK_SECONDARY_LOOP, ACT_MP_RELOAD_AIRWALK_SECONDARY_END, ACT_MP_ATTACK_STAND_GRENADE_SECONDARY, ACT_MP_ATTACK_CROUCH_GRENADE_SECONDARY, ACT_MP_ATTACK_SWIM_GRENADE_SECONDARY, ACT_MP_ATTACK_AIRWALK_GRENADE_SECONDARY, ACT_MP_STAND_MELEE, ACT_MP_CROUCH_MELEE, ACT_MP_RUN_MELEE, ACT_MP_WALK_MELEE, ACT_MP_AIRWALK_MELEE, ACT_MP_CROUCHWALK_MELEE, ACT_MP_JUMP_MELEE, ACT_MP_JUMP_START_MELEE, ACT_MP_JUMP_FLOAT_MELEE, ACT_MP_JUMP_LAND_MELEE, ACT_MP_SWIM_MELEE, ACT_MP_ATTACK_STAND_MELEE, ACT_MP_ATTACK_STAND_MELEE_SECONDARY, ACT_MP_ATTACK_CROUCH_MELEE, ACT_MP_ATTACK_CROUCH_MELEE_SECONDARY, ACT_MP_ATTACK_SWIM_MELEE, ACT_MP_ATTACK_AIRWALK_MELEE, ACT_MP_ATTACK_STAND_GRENADE_MELEE, ACT_MP_ATTACK_CROUCH_GRENADE_MELEE, ACT_MP_ATTACK_SWIM_GRENADE_MELEE, ACT_MP_ATTACK_AIRWALK_GRENADE_MELEE, ACT_MP_STAND_ITEM1, ACT_MP_CROUCH_ITEM1, ACT_MP_RUN_ITEM1, ACT_MP_WALK_ITEM1, ACT_MP_AIRWALK_ITEM1, ACT_MP_CROUCHWALK_ITEM1, ACT_MP_JUMP_ITEM1, ACT_MP_JUMP_START_ITEM1, ACT_MP_JUMP_FLOAT_ITEM1, ACT_MP_JUMP_LAND_ITEM1, ACT_MP_SWIM_ITEM1, ACT_MP_ATTACK_STAND_ITEM1, ACT_MP_ATTACK_STAND_ITEM1_SECONDARY, ACT_MP_ATTACK_CROUCH_ITEM1, ACT_MP_ATTACK_CROUCH_ITEM1_SECONDARY, ACT_MP_ATTACK_SWIM_ITEM1, ACT_MP_ATTACK_AIRWALK_ITEM1, ACT_MP_STAND_ITEM2, ACT_MP_CROUCH_ITEM2, ACT_MP_RUN_ITEM2, ACT_MP_WALK_ITEM2, ACT_MP_AIRWALK_ITEM2, ACT_MP_CROUCHWALK_ITEM2, ACT_MP_JUMP_ITEM2, ACT_MP_JUMP_START_ITEM2, ACT_MP_JUMP_FLOAT_ITEM2, ACT_MP_JUMP_LAND_ITEM2, ACT_MP_SWIM_ITEM2, ACT_MP_ATTACK_STAND_ITEM2, ACT_MP_ATTACK_STAND_ITEM2_SECONDARY, ACT_MP_ATTACK_CROUCH_ITEM2, ACT_MP_ATTACK_CROUCH_ITEM2_SECONDARY, ACT_MP_ATTACK_SWIM_ITEM2, ACT_MP_ATTACK_AIRWALK_ITEM2, ACT_MP_GESTURE_FLINCH, ACT_MP_GESTURE_FLINCH_PRIMARY, ACT_MP_GESTURE_FLINCH_SECONDARY, ACT_MP_GESTURE_FLINCH_MELEE, ACT_MP_GESTURE_FLINCH_ITEM1, ACT_MP_GESTURE_FLINCH_ITEM2, ACT_MP_GESTURE_FLINCH_HEAD, ACT_MP_GESTURE_FLINCH_CHEST, ACT_MP_GESTURE_FLINCH_STOMACH, ACT_MP_GESTURE_FLINCH_LEFTARM, ACT_MP_GESTURE_FLINCH_RIGHTARM, ACT_MP_GESTURE_FLINCH_LEFTLEG, ACT_MP_GESTURE_FLINCH_RIGHTLEG, ACT_MP_GRENADE1_DRAW, ACT_MP_GRENADE1_IDLE, ACT_MP_GRENADE1_ATTACK, ACT_MP_GRENADE2_DRAW, ACT_MP_GRENADE2_IDLE, ACT_MP_GRENADE2_ATTACK, ACT_MP_PRIMARY_GRENADE1_DRAW, ACT_MP_PRIMARY_GRENADE1_IDLE, ACT_MP_PRIMARY_GRENADE1_ATTACK, ACT_MP_PRIMARY_GRENADE2_DRAW, ACT_MP_PRIMARY_GRENADE2_IDLE, ACT_MP_PRIMARY_GRENADE2_ATTACK, ACT_MP_SECONDARY_GRENADE1_DRAW, ACT_MP_SECONDARY_GRENADE1_IDLE, ACT_MP_SECONDARY_GRENADE1_ATTACK, ACT_MP_SECONDARY_GRENADE2_DRAW, ACT_MP_SECONDARY_GRENADE2_IDLE, ACT_MP_SECONDARY_GRENADE2_ATTACK, ACT_MP_MELEE_GRENADE1_DRAW, ACT_MP_MELEE_GRENADE1_IDLE, ACT_MP_MELEE_GRENADE1_ATTACK, ACT_MP_MELEE_GRENADE2_DRAW, ACT_MP_MELEE_GRENADE2_IDLE, ACT_MP_MELEE_GRENADE2_ATTACK, ACT_MP_ITEM1_GRENADE1_DRAW, ACT_MP_ITEM1_GRENADE1_IDLE, ACT_MP_ITEM1_GRENADE1_ATTACK, ACT_MP_ITEM1_GRENADE2_DRAW, ACT_MP_ITEM1_GRENADE2_IDLE, ACT_MP_ITEM1_GRENADE2_ATTACK, ACT_MP_ITEM2_GRENADE1_DRAW, ACT_MP_ITEM2_GRENADE1_IDLE, ACT_MP_ITEM2_GRENADE1_ATTACK, ACT_MP_ITEM2_GRENADE2_DRAW, ACT_MP_ITEM2_GRENADE2_IDLE, ACT_MP_ITEM2_GRENADE2_ATTACK, ACT_MP_STAND_BUILDING, ACT_MP_CROUCH_BUILDING, ACT_MP_RUN_BUILDING, ACT_MP_WALK_BUILDING, ACT_MP_AIRWALK_BUILDING, ACT_MP_CROUCHWALK_BUILDING, ACT_MP_JUMP_BUILDING, ACT_MP_JUMP_START_BUILDING, ACT_MP_JUMP_FLOAT_BUILDING, ACT_MP_JUMP_LAND_BUILDING, ACT_MP_SWIM_BUILDING, ACT_MP_ATTACK_STAND_BUILDING, ACT_MP_ATTACK_CROUCH_BUILDING, ACT_MP_ATTACK_SWIM_BUILDING, ACT_MP_ATTACK_AIRWALK_BUILDING, ACT_MP_ATTACK_STAND_GRENADE_BUILDING, ACT_MP_ATTACK_CROUCH_GRENADE_BUILDING, ACT_MP_ATTACK_SWIM_GRENADE_BUILDING, ACT_MP_ATTACK_AIRWALK_GRENADE_BUILDING, ACT_MP_STAND_PDA, ACT_MP_CROUCH_PDA, ACT_MP_RUN_PDA, ACT_MP_WALK_PDA, ACT_MP_AIRWALK_PDA, ACT_MP_CROUCHWALK_PDA, ACT_MP_JUMP_PDA, ACT_MP_JUMP_START_PDA, ACT_MP_JUMP_FLOAT_PDA, ACT_MP_JUMP_LAND_PDA, ACT_MP_SWIM_PDA, ACT_MP_ATTACK_STAND_PDA, ACT_MP_ATTACK_SWIM_PDA, ACT_MP_GESTURE_VC_HANDMOUTH, ACT_MP_GESTURE_VC_FINGERPOINT, ACT_MP_GESTURE_VC_FISTPUMP, ACT_MP_GESTURE_VC_THUMBSUP, ACT_MP_GESTURE_VC_NODYES, ACT_MP_GESTURE_VC_NODNO, ACT_MP_GESTURE_VC_HANDMOUTH_PRIMARY, ACT_MP_GESTURE_VC_FINGERPOINT_PRIMARY, ACT_MP_GESTURE_VC_FISTPUMP_PRIMARY, ACT_MP_GESTURE_VC_THUMBSUP_PRIMARY, ACT_MP_GESTURE_VC_NODYES_PRIMARY, ACT_MP_GESTURE_VC_NODNO_PRIMARY, ACT_MP_GESTURE_VC_HANDMOUTH_SECONDARY, ACT_MP_GESTURE_VC_FINGERPOINT_SECONDARY, ACT_MP_GESTURE_VC_FISTPUMP_SECONDARY, ACT_MP_GESTURE_VC_THUMBSUP_SECONDARY, ACT_MP_GESTURE_VC_NODYES_SECONDARY, ACT_MP_GESTURE_VC_NODNO_SECONDARY, ACT_MP_GESTURE_VC_HANDMOUTH_MELEE, ACT_MP_GESTURE_VC_FINGERPOINT_MELEE, ACT_MP_GESTURE_VC_FISTPUMP_MELEE, ACT_MP_GESTURE_VC_THUMBSUP_MELEE, ACT_MP_GESTURE_VC_NODYES_MELEE, ACT_MP_GESTURE_VC_NODNO_MELEE, ACT_MP_GESTURE_VC_HANDMOUTH_ITEM1, ACT_MP_GESTURE_VC_FINGERPOINT_ITEM1, ACT_MP_GESTURE_VC_FISTPUMP_ITEM1, ACT_MP_GESTURE_VC_THUMBSUP_ITEM1, ACT_MP_GESTURE_VC_NODYES_ITEM1, ACT_MP_GESTURE_VC_NODNO_ITEM1, ACT_MP_GESTURE_VC_HANDMOUTH_ITEM2, ACT_MP_GESTURE_VC_FINGERPOINT_ITEM2, ACT_MP_GESTURE_VC_FISTPUMP_ITEM2, ACT_MP_GESTURE_VC_THUMBSUP_ITEM2, ACT_MP_GESTURE_VC_NODYES_ITEM2, ACT_MP_GESTURE_VC_NODNO_ITEM2, ACT_MP_GESTURE_VC_HANDMOUTH_BUILDING, ACT_MP_GESTURE_VC_FINGERPOINT_BUILDING, ACT_MP_GESTURE_VC_FISTPUMP_BUILDING, ACT_MP_GESTURE_VC_THUMBSUP_BUILDING, ACT_MP_GESTURE_VC_NODYES_BUILDING, ACT_MP_GESTURE_VC_NODNO_BUILDING, ACT_MP_GESTURE_VC_HANDMOUTH_PDA, ACT_MP_GESTURE_VC_FINGERPOINT_PDA, ACT_MP_GESTURE_VC_FISTPUMP_PDA, ACT_MP_GESTURE_VC_THUMBSUP_PDA, ACT_MP_GESTURE_VC_NODYES_PDA, ACT_MP_GESTURE_VC_NODNO_PDA, ACT_VM_UNUSABLE, ACT_VM_UNUSABLE_TO_USABLE, ACT_VM_USABLE_TO_UNUSABLE, ACT_PRIMARY_VM_DRAW, ACT_PRIMARY_VM_HOLSTER, ACT_PRIMARY_VM_IDLE, ACT_PRIMARY_VM_PULLBACK, ACT_PRIMARY_VM_PRIMARYATTACK, ACT_PRIMARY_VM_SECONDARYATTACK, ACT_PRIMARY_VM_RELOAD, ACT_PRIMARY_VM_DRYFIRE, ACT_PRIMARY_VM_IDLE_TO_LOWERED, ACT_PRIMARY_VM_IDLE_LOWERED, ACT_PRIMARY_VM_LOWERED_TO_IDLE, ACT_SECONDARY_VM_DRAW, ACT_SECONDARY_VM_HOLSTER, ACT_SECONDARY_VM_IDLE, ACT_SECONDARY_VM_PULLBACK, ACT_SECONDARY_VM_PRIMARYATTACK, ACT_SECONDARY_VM_SECONDARYATTACK, ACT_SECONDARY_VM_RELOAD, ACT_SECONDARY_VM_DRYFIRE, ACT_SECONDARY_VM_IDLE_TO_LOWERED, ACT_SECONDARY_VM_IDLE_LOWERED, ACT_SECONDARY_VM_LOWERED_TO_IDLE, ACT_MELEE_VM_DRAW, ACT_MELEE_VM_HOLSTER, ACT_MELEE_VM_IDLE, ACT_MELEE_VM_PULLBACK, ACT_MELEE_VM_PRIMARYATTACK, ACT_MELEE_VM_SECONDARYATTACK, ACT_MELEE_VM_RELOAD, ACT_MELEE_VM_DRYFIRE, ACT_MELEE_VM_IDLE_TO_LOWERED, ACT_MELEE_VM_IDLE_LOWERED, ACT_MELEE_VM_LOWERED_TO_IDLE, ACT_PDA_VM_DRAW, ACT_PDA_VM_HOLSTER, ACT_PDA_VM_IDLE, ACT_PDA_VM_PULLBACK, ACT_PDA_VM_PRIMARYATTACK, ACT_PDA_VM_SECONDARYATTACK, ACT_PDA_VM_RELOAD, ACT_PDA_VM_DRYFIRE, ACT_PDA_VM_IDLE_TO_LOWERED, ACT_PDA_VM_IDLE_LOWERED, ACT_PDA_VM_LOWERED_TO_IDLE, ACT_ITEM1_VM_DRAW, ACT_ITEM1_VM_HOLSTER, ACT_ITEM1_VM_IDLE, ACT_ITEM1_VM_PULLBACK, ACT_ITEM1_VM_PRIMARYATTACK, ACT_ITEM1_VM_SECONDARYATTACK, ACT_ITEM1_VM_RELOAD, ACT_ITEM1_VM_DRYFIRE, ACT_ITEM1_VM_IDLE_TO_LOWERED, ACT_ITEM1_VM_IDLE_LOWERED, ACT_ITEM1_VM_LOWERED_TO_IDLE, ACT_ITEM2_VM_DRAW, ACT_ITEM2_VM_HOLSTER, ACT_ITEM2_VM_IDLE, ACT_ITEM2_VM_PULLBACK, ACT_ITEM2_VM_PRIMARYATTACK, ACT_ITEM2_VM_SECONDARYATTACK, ACT_ITEM2_VM_RELOAD, ACT_ITEM2_VM_DRYFIRE, ACT_ITEM2_VM_IDLE_TO_LOWERED, ACT_ITEM2_VM_IDLE_LOWERED, ACT_ITEM2_VM_LOWERED_TO_IDLE, ACT_RELOAD_SUCCEED, ACT_RELOAD_FAIL, ACT_WALK_AIM_AUTOGUN, ACT_RUN_AIM_AUTOGUN, ACT_IDLE_AUTOGUN, ACT_IDLE_AIM_AUTOGUN, ACT_RELOAD_AUTOGUN, ACT_CROUCH_IDLE_AUTOGUN, ACT_RANGE_ATTACK_AUTOGUN, ACT_JUMP_AUTOGUN, ACT_IDLE_AIM_PISTOL, ACT_WALK_AIM_DUAL, ACT_RUN_AIM_DUAL, ACT_IDLE_DUAL, ACT_IDLE_AIM_DUAL, ACT_RELOAD_DUAL, ACT_CROUCH_IDLE_DUAL, ACT_RANGE_ATTACK_DUAL, ACT_JUMP_DUAL, ACT_IDLE_SHOTGUN, ACT_IDLE_AIM_SHOTGUN, ACT_CROUCH_IDLE_SHOTGUN, ACT_JUMP_SHOTGUN, ACT_IDLE_AIM_RIFLE, ACT_RELOAD_RIFLE, ACT_CROUCH_IDLE_RIFLE, ACT_RANGE_ATTACK_RIFLE, ACT_JUMP_RIFLE, ACT_SLEEP, ACT_WAKE, ACT_FLICK_LEFT, ACT_FLICK_LEFT_MIDDLE, ACT_FLICK_RIGHT_MIDDLE, ACT_FLICK_RIGHT, ACT_SPINAROUND, ACT_PREP_TO_FIRE, ACT_FIRE, ACT_FIRE_RECOVER, ACT_SPRAY, ACT_PREP_EXPLODE, ACT_EXPLODE, ACT_DOTA_IDLE, ACT_DOTA_RUN, ACT_DOTA_ATTACK, ACT_DOTA_ATTACK_EVENT, ACT_DOTA_DIE, ACT_DOTA_FLINCH, ACT_DOTA_DISABLED, ACT_DOTA_CAST_ABILITY_1, ACT_DOTA_CAST_ABILITY_2, ACT_DOTA_CAST_ABILITY_3, ACT_DOTA_CAST_ABILITY_4, ACT_DOTA_OVERRIDE_ABILITY_1, ACT_DOTA_OVERRIDE_ABILITY_2, ACT_DOTA_OVERRIDE_ABILITY_3, ACT_DOTA_OVERRIDE_ABILITY_4, ACT_DOTA_CHANNEL_ABILITY_1, ACT_DOTA_CHANNEL_ABILITY_2, ACT_DOTA_CHANNEL_ABILITY_3, ACT_DOTA_CHANNEL_ABILITY_4, ACT_DOTA_CHANNEL_END_ABILITY_1, ACT_DOTA_CHANNEL_END_ABILITY_2, ACT_DOTA_CHANNEL_END_ABILITY_3, ACT_DOTA_CHANNEL_END_ABILITY_4, ACT_MP_RUN_SPEEDPAINT, ACT_MP_LONG_FALL, ACT_MP_TRACTORBEAM_FLOAT, ACT_MP_DEATH_CRUSH, ACT_MP_RUN_SPEEDPAINT_PRIMARY, ACT_MP_DROWNING_PRIMARY, ACT_MP_LONG_FALL_PRIMARY, ACT_MP_TRACTORBEAM_FLOAT_PRIMARY, ACT_MP_DEATH_CRUSH_PRIMARY, ACT_DIE_STAND, ACT_DIE_STAND_HEADSHOT, ACT_DIE_CROUCH, ACT_DIE_CROUCH_HEADSHOT, ACT_CSGO_NULL, ACT_CSGO_DEFUSE, ACT_CSGO_DEFUSE_WITH_KIT, ACT_CSGO_FLASHBANG_REACTION, ACT_CSGO_FIRE_PRIMARY, ACT_CSGO_FIRE_PRIMARY_OPT_1, ACT_CSGO_FIRE_PRIMARY_OPT_2, ACT_CSGO_FIRE_SECONDARY, ACT_CSGO_FIRE_SECONDARY_OPT_1, ACT_CSGO_FIRE_SECONDARY_OPT_2, ACT_CSGO_RELOAD, ACT_CSGO_RELOAD_START, ACT_CSGO_RELOAD_LOOP, ACT_CSGO_RELOAD_END, ACT_CSGO_OPERATE, ACT_CSGO_DEPLOY, ACT_CSGO_CATCH, ACT_CSGO_SILENCER_DETACH, ACT_CSGO_SILENCER_ATTACH, ACT_CSGO_TWITCH, ACT_CSGO_TWITCH_BUYZONE, ACT_CSGO_PLANT_BOMB, ACT_CSGO_IDLE_TURN_BALANCEADJUST, ACT_CSGO_IDLE_ADJUST_STOPPEDMOVING, ACT_CSGO_ALIVE_LOOP, ACT_CSGO_FLINCH, ACT_CSGO_FLINCH_HEAD, ACT_CSGO_FLINCH_MOLOTOV, ACT_CSGO_JUMP, ACT_CSGO_FALL, ACT_CSGO_CLIMB_LADDER, ACT_CSGO_LAND_LIGHT, ACT_CSGO_LAND_HEAVY, ACT_CSGO_EXIT_LADDER_TOP, ACT_CSGO_EXIT_LADDER_BOTTOM, };
32.83995
169
0.750009
xsoma