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
2d54821c3a21a2235f96c05a611dc5675b8d4133
8,859
cpp
C++
sources/enduro2d/utils/strings.cpp
NechukhrinN/enduro2d
774f120395885a6f0f21418c4de024e7668ee436
[ "MIT" ]
92
2018-08-07T14:45:33.000Z
2021-11-14T20:37:23.000Z
sources/enduro2d/utils/strings.cpp
NechukhrinN/enduro2d
774f120395885a6f0f21418c4de024e7668ee436
[ "MIT" ]
43
2018-09-30T20:48:03.000Z
2020-04-20T20:05:26.000Z
sources/enduro2d/utils/strings.cpp
NechukhrinN/enduro2d
774f120395885a6f0f21418c4de024e7668ee436
[ "MIT" ]
13
2018-08-08T13:45:28.000Z
2020-10-02T11:55:58.000Z
/******************************************************************************* * This file is part of the "Enduro2D" * For conditions of distribution and use, see copyright notice in LICENSE.md * Copyright (C) 2018-2020, by Matvey Cherevko ([email protected]) ******************************************************************************/ #include <enduro2d/utils/strings.hpp> #include <3rdparty/utfcpp/utf8.h> namespace { using namespace e2d; // // utf8_to_X // str16 utf8_to_16(str_view src) { str16 dst; dst.reserve(src.size()); utf8::utf8to16(src.cbegin(), src.cend(), std::back_inserter(dst)); dst.shrink_to_fit(); return dst; } str32 utf8_to_32(str_view src) { str32 dst; dst.reserve(src.size()); utf8::utf8to32(src.cbegin(), src.cend(), std::back_inserter(dst)); dst.shrink_to_fit(); return dst; } template < typename WChar = wchar_t > std::enable_if_t<sizeof(WChar) == 2, wstr> utf8_to_wide(str_view src) { wstr dst; dst.reserve(src.size()); utf8::utf8to16(src.cbegin(), src.cend(), std::back_inserter(dst)); dst.shrink_to_fit(); return dst; } template < typename WChar = wchar_t > std::enable_if_t<sizeof(WChar) == 4, wstr> utf8_to_wide(str_view src) { wstr dst; dst.reserve(src.size()); utf8::utf8to32(src.cbegin(), src.cend(), std::back_inserter(dst)); dst.shrink_to_fit(); return dst; } // // utf16_to_X // template < typename Char > std::enable_if_t<sizeof(Char) == 2, str> utf16_to_8(basic_string_view<Char> src) { str dst; dst.reserve(src.size() * 2); utf8::utf16to8(src.cbegin(), src.cend(), std::back_inserter(dst)); dst.shrink_to_fit(); return dst; } template < typename Char > std::enable_if_t<sizeof(Char) == 2, str32> utf16_to_32(basic_string_view<Char> src) { return utf8_to_32(utf16_to_8(src)); } template < typename Char > std::enable_if_t<sizeof(Char) == 2, wstr> utf16_to_wide(basic_string_view<Char> src) { return utf8_to_wide(utf16_to_8(src)); } // // utf32_to_X // template < typename Char > std::enable_if_t<sizeof(Char) == 4, str> utf32_to_8(basic_string_view<Char> src) { str dst; dst.reserve(src.size() * 4); utf8::utf32to8(src.cbegin(), src.cend(), std::back_inserter(dst)); dst.shrink_to_fit(); return dst; } template < typename Char > std::enable_if_t<sizeof(Char) == 4, str16> utf32_to_16(basic_string_view<Char> src) { return utf8_to_16(utf32_to_8(src)); } template < typename Char > std::enable_if_t<sizeof(Char) == 4, wstr> utf32_to_wide(basic_string_view<Char> src) { return utf8_to_wide(utf32_to_8(src)); } // // wide_to_X // template < typename Char > std::enable_if_t<sizeof(Char) == 2, str> wide_to_utf8(basic_string_view<Char> src) { return utf16_to_8(src); } template < typename Char > std::enable_if_t<sizeof(Char) == 4, str> wide_to_utf8(basic_string_view<Char> src) { return utf32_to_8(src); } template < typename Char > std::enable_if_t<sizeof(Char) == 2, str16> wide_to_utf16(basic_string_view<Char> src) { return src.empty() ? str16() : str16(src.cbegin(), src.cend()); } template < typename Char > std::enable_if_t<sizeof(Char) == 4, str16> wide_to_utf16(basic_string_view<Char> src) { return utf32_to_16(src); } template < typename Char > std::enable_if_t<sizeof(Char) == 2, str32> wide_to_utf32(basic_string_view<Char> src) { return utf16_to_32(src); } template < typename Char > std::enable_if_t<sizeof(Char) == 4, str32> wide_to_utf32(basic_string_view<Char> src) { return src.empty() ? str32() : str32(src.cbegin(), src.cend()); } } namespace e2d { // // make_utf8 // str make_utf8(str_view src) { return src.empty() ? str() : str(src.cbegin(), src.cend()); } str make_utf8(wstr_view src) { return wide_to_utf8(src); } str make_utf8(str16_view src) { return utf16_to_8(src); } str make_utf8(str32_view src) { return utf32_to_8(src); } // // make_wide // wstr make_wide(str_view src) { return utf8_to_wide(src); } wstr make_wide(wstr_view src) { return src.empty() ? wstr() : wstr(src.cbegin(), src.cend()); } wstr make_wide(str16_view src) { return utf16_to_wide(src); } wstr make_wide(str32_view src) { return utf32_to_wide(src); } // // make_utf16 // str16 make_utf16(str_view src) { return utf8_to_16(src); } str16 make_utf16(wstr_view src) { return wide_to_utf16(src); } str16 make_utf16(str16_view src) { return src.empty() ? str16() : str16(src.cbegin(), src.cend()); } str16 make_utf16(str32_view src) { return utf32_to_16(src); } // // make_utf32 // str32 make_utf32(str_view src) { return utf8_to_32(src); } str32 make_utf32(wstr_view src) { return wide_to_utf32(src); } str32 make_utf32(str16_view src) { return utf16_to_32(src); } str32 make_utf32(str32_view src) { return src.empty() ? str32() : str32(src.cbegin(), src.cend()); } // // make_hash // str_hash make_hash(str_view src) noexcept { return str_hash(src); } wstr_hash make_hash(wstr_view src) noexcept { return wstr_hash(src); } str16_hash make_hash(str16_view src) noexcept { return str16_hash(src); } str32_hash make_hash(str32_view src) noexcept { return str32_hash(src); } } namespace e2d::strings { namespace impl { // Inspired by: // https://www.codeproject.com/Articles/1088/Wildcard-string-compare-globbing using utf8_iter = utf8::iterator<str_view::const_iterator>; static bool wildcard_match_impl( utf8_iter string_i, utf8_iter string_e, utf8_iter pattern_i, utf8_iter pattern_e) { while ( pattern_i != pattern_e && *pattern_i != '*' ) { if ( string_i == string_e ) { break; } if ( *pattern_i != *string_i && *pattern_i != '?' ) { return false; } ++string_i; ++pattern_i; } if ( pattern_i == pattern_e ) { return string_i == string_e; } utf8_iter s_mark = string_e; utf8_iter p_mark = pattern_e; while ( string_i != string_e ) { if ( pattern_i != pattern_e ) { if ( *pattern_i == '*' ) { if ( ++pattern_i == pattern_e ) { return true; } s_mark = string_i; p_mark = pattern_i; ++s_mark; continue; } else if ( *pattern_i == *string_i || *pattern_i == '?' ) { ++string_i; ++pattern_i; continue; } } string_i = s_mark; pattern_i = p_mark; if ( s_mark != string_e ) { ++s_mark; } } while ( pattern_i != pattern_e && *pattern_i == '*' ) { ++pattern_i; } return pattern_i == pattern_e; } } bool wildcard_match(str_view string, str_view pattern) { using namespace impl; str_view::const_iterator si = string.cbegin(); str_view::const_iterator se = string.cend(); str_view::const_iterator pi = pattern.cbegin(); str_view::const_iterator pe = pattern.cend(); return wildcard_match_impl( utf8_iter(si, si, se), utf8_iter(se, si, se), utf8_iter(pi, pi, pe), utf8_iter(pe, pi, pe)); } bool starts_with(str_view input, str_view test) noexcept { return input.size() >= test.size() && 0 == input.compare(0, test.size(), test); } bool ends_with(str_view input, str_view test) noexcept { return input.size() >= test.size() && 0 == input.compare(input.size() - test.size(), test.size(), test); } }
25.979472
85
0.531098
NechukhrinN
2d5b922bd699638d8abf206102207bccd7b5f96b
614
cpp
C++
solutions/729.my-calendar-i.254107150.ac.cpp
satu0king/Leetcode-Solutions
2edff60d76c2898d912197044f6284efeeb34119
[ "MIT" ]
78
2020-10-22T11:31:53.000Z
2022-02-22T13:27:49.000Z
solutions/729.my-calendar-i.254107150.ac.cpp
satu0king/Leetcode-Solutions
2edff60d76c2898d912197044f6284efeeb34119
[ "MIT" ]
null
null
null
solutions/729.my-calendar-i.254107150.ac.cpp
satu0king/Leetcode-Solutions
2edff60d76c2898d912197044f6284efeeb34119
[ "MIT" ]
26
2020-10-23T15:10:44.000Z
2021-11-07T16:13:50.000Z
class MyCalendar { map<int, int> mp; public: MyCalendar() {} bool book(int start, int end) { auto it1 = mp.lower_bound(start); if (it1 != mp.end() && it1->first == start) return false; if (it1 != mp.end() && it1->first < end) return false; if (mp.size() && it1 != mp.begin()) { --it1; if (it1->second > start) return false; } // return false; mp[start] = end; return true; } }; /** * Your MyCalendar object will be instantiated and called as such: * MyCalendar* obj = new MyCalendar(); * bool param_1 = obj->book(start,end); */
17.055556
66
0.552117
satu0king
2d5dfac9f670a063d8e316b690b0d3ed9b9cfdfc
2,248
cpp
C++
class-exercises/acc-07/wbpriarbiter.cpp
cambridgehackers/atomicc-examples
d0280629b94185d806637486b8413dd1a806d82a
[ "MIT" ]
null
null
null
class-exercises/acc-07/wbpriarbiter.cpp
cambridgehackers/atomicc-examples
d0280629b94185d806637486b8413dd1a806d82a
[ "MIT" ]
null
null
null
class-exercises/acc-07/wbpriarbiter.cpp
cambridgehackers/atomicc-examples
d0280629b94185d806637486b8413dd1a806d82a
[ "MIT" ]
null
null
null
/* Copyright (c) 2020 The Connectal 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 "fwbslave.h" template<int OPT_ZERO_ON_IDLE, int F_OPT_CLK2FFLOGIC> class WbPriArbiterIfc { WishboneType a; WishboneType b; WishboneType *o; }; template<int OPT_ZERO_ON_IDLE, int F_OPT_CLK2FFLOGIC> class WbPriArbiter __implements __verilog WbPriArbiterIfc<OPT_ZERO_ON_IDLE, F_OPT_CLK2FFLOGIC> { bool r_a_owner; void a.stb(bool we, __uint(AW) addr, __uint(DW) data, __uint(DW/8) sel) if (this->a.cyc) { r_a_owner = true; this->o->stb(we, addr, data, sel); } bool a.ack() { return this->o->ack() & r_a_owner; } bool a.stall() { return this->o->stall() | !r_a_owner; } bool a.err() { return this->o->err() & r_a_owner; } void b.stb(bool we, __uint(AW) addr, __uint(DW) data, __uint(DW/8) sel) if (!this->a.cyc) { r_a_owner = false; this->o->stb(we, addr, data, sel); } bool b.ack() { return this->o->ack() & !r_a_owner; } bool b.stall() { return this->o->stall() | r_a_owner; } bool b.err() { return this->o->err() & !r_a_owner; } }; WbPriArbiter<0, 1> dummy;
35.68254
96
0.68016
cambridgehackers
2d5e5bdcda379693aa3abbafe188f9511eb1d3a7
2,434
cpp
C++
boost/boost_1_56_0/libs/spirit/test/x3/difference.cpp
cooparation/caffe-android
cd91078d1f298c74fca4c242531989d64a32ba03
[ "BSD-2-Clause-FreeBSD" ]
3
2018-11-02T07:15:32.000Z
2018-12-15T19:56:59.000Z
boost/boost_1_56_0/libs/spirit/test/x3/difference.cpp
cooparation/caffe-android
cd91078d1f298c74fca4c242531989d64a32ba03
[ "BSD-2-Clause-FreeBSD" ]
2
2017-11-18T21:24:03.000Z
2020-03-11T12:39:57.000Z
boost/boost_1_56_0/libs/spirit/test/x3/difference.cpp
cooparation/caffe-android
cd91078d1f298c74fca4c242531989d64a32ba03
[ "BSD-2-Clause-FreeBSD" ]
3
2017-01-02T14:11:37.000Z
2019-12-20T13:42:13.000Z
/*============================================================================= Copyright (c) 2001-2013 Joel de Guzman 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) =============================================================================*/ #include <boost/detail/lightweight_test.hpp> #include <boost/spirit/home/x3.hpp> //~ #include <boost/phoenix/core.hpp> //~ #include <boost/phoenix/operator.hpp> #include <string> #include <iostream> #include "test.hpp" int main() { using boost::spirit::x3::ascii::char_; using boost::spirit::x3::lit; using spirit_test::test; using spirit_test::test_attr; // Basic tests { BOOST_TEST(test("b", char_ - 'a')); BOOST_TEST(!test("a", char_ - 'a')); BOOST_TEST(test("/* abcdefghijk */", "/*" >> *(char_ - "*/") >> "*/")); BOOST_TEST(!test("switch", lit("switch") - "switch")); } // Test attributes { char attr; BOOST_TEST(test_attr("xg", (char_ - 'g') >> 'g', attr)); BOOST_TEST(attr == 'x'); } // Test handling of container attributes { std::string attr; BOOST_TEST(test_attr("abcdefg", *(char_ - 'g') >> 'g', attr)); BOOST_TEST(attr == "abcdef"); } // $$$ Not yet implemented //~ { //~ BOOST_TEST(test("b", char_ - no_case['a'])); //~ BOOST_TEST(!test("a", char_ - no_case['a'])); //~ BOOST_TEST(!test("A", char_ - no_case['a'])); //~ BOOST_TEST(test("b", no_case[lower - 'a'])); //~ BOOST_TEST(test("B", no_case[lower - 'a'])); //~ BOOST_TEST(!test("a", no_case[lower - 'a'])); //~ BOOST_TEST(!test("A", no_case[lower - 'a'])); //~ } // $$$ Not yet implemented //~ { //~ using boost::spirit::x3::_1; //~ namespace phx = boost::phoenix; //~ std::string s; //~ BOOST_TEST(test( //~ "/*abcdefghijk*/" //~ , "/*" >> *(char_ - "*/")[phx::ref(s) += _1] >> "*/" //~ )); //~ BOOST_TEST(s == "abcdefghijk"); //~ s.clear(); //~ BOOST_TEST(test( //~ " /*abcdefghijk*/" //~ , "/*" >> *(char_ - "*/")[phx::ref(s) += _1] >> "*/" //~ , space //~ )); //~ BOOST_TEST(s == "abcdefghijk"); //~ } return boost::report_errors(); }
29.325301
80
0.468776
cooparation
2d5fea0264fcda9067e8fe8718213c0ec2b3b9c4
564
cpp
C++
Kuma Engine/PanelFile.cpp
GerardClotet/Kuma-Engine
16759a8c5e18b69eb6ce50b6feeaf50d5312e957
[ "MIT" ]
2
2019-10-07T07:11:16.000Z
2019-10-31T16:45:56.000Z
Kuma Engine/PanelFile.cpp
GerardClotet/Kuma-Engine
16759a8c5e18b69eb6ce50b6feeaf50d5312e957
[ "MIT" ]
null
null
null
Kuma Engine/PanelFile.cpp
GerardClotet/Kuma-Engine
16759a8c5e18b69eb6ce50b6feeaf50d5312e957
[ "MIT" ]
null
null
null
#include "PanelConfig.h" #include "Globals.h" #include "ModuleRenderer3D.h" #include "ModuleUI.h" #include "PanelFile.h" PanelFile::~PanelFile() { } update_status PanelFile::Draw() { if (App->ui->file_load_model)LoadModel(); if (App->ui->file_save_scene)DisplaySaveScene(); if (App->ui->file_load_scene)DisplayLoadScene(); return UPDATE_CONTINUE; } void PanelFile::LoadModel() { App->ui->LoadFile("fbx"); } void PanelFile::DisplaySaveScene() { App->ui->SaveFile("kumaScene"); } void PanelFile::DisplayLoadScene() { App->ui->LoadFile("kumaScene"); }
15.666667
49
0.714539
GerardClotet
062450d280164d63958326b5826ab5b370311a05
9,832
cpp
C++
src/frameworks/native/libs/nativewindow/ANativeWindow.cpp
dAck2cC2/m3e
475b89b59d5022a94e00b636438b25e27e4eaab2
[ "Apache-2.0" ]
null
null
null
src/frameworks/native/libs/nativewindow/ANativeWindow.cpp
dAck2cC2/m3e
475b89b59d5022a94e00b636438b25e27e4eaab2
[ "Apache-2.0" ]
null
null
null
src/frameworks/native/libs/nativewindow/ANativeWindow.cpp
dAck2cC2/m3e
475b89b59d5022a94e00b636438b25e27e4eaab2
[ "Apache-2.0" ]
null
null
null
/* * Copyright (C) 2010 The Android Open Source Project * * 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. */ #define LOG_TAG "ANativeWindow" #include <grallocusage/GrallocUsageConversion.h> // from nativewindow/includes/system/window.h // (not to be confused with the compatibility-only window.h from system/core/includes) #include <system/window.h> #include <private/android/AHardwareBufferHelpers.h> #include <ui/GraphicBuffer.h> using namespace android; static int32_t query(ANativeWindow* window, int what) { int value; int res = window->query(window, what, &value); return res < 0 ? res : value; } static bool isDataSpaceValid(ANativeWindow* window, int32_t dataSpace) { bool supported = false; switch (dataSpace) { case HAL_DATASPACE_UNKNOWN: case HAL_DATASPACE_V0_SRGB: return true; // These data space need wide gamut support. case HAL_DATASPACE_V0_SCRGB_LINEAR: case HAL_DATASPACE_V0_SCRGB: case HAL_DATASPACE_DISPLAY_P3: native_window_get_wide_color_support(window, &supported); return supported; // These data space need HDR support. case HAL_DATASPACE_BT2020_PQ: native_window_get_hdr_support(window, &supported); return supported; default: return false; } } /************************************************************************************************** * NDK **************************************************************************************************/ void ANativeWindow_acquire(ANativeWindow* window) { // incStrong/decStrong token must be the same, doesn't matter what it is window->incStrong((void*)ANativeWindow_acquire); } void ANativeWindow_release(ANativeWindow* window) { // incStrong/decStrong token must be the same, doesn't matter what it is window->decStrong((void*)ANativeWindow_acquire); } int32_t ANativeWindow_getWidth(ANativeWindow* window) { return query(window, NATIVE_WINDOW_WIDTH); } int32_t ANativeWindow_getHeight(ANativeWindow* window) { return query(window, NATIVE_WINDOW_HEIGHT); } int32_t ANativeWindow_getFormat(ANativeWindow* window) { return query(window, NATIVE_WINDOW_FORMAT); } int32_t ANativeWindow_setBuffersGeometry(ANativeWindow* window, int32_t width, int32_t height, int32_t format) { int32_t err = native_window_set_buffers_format(window, format); if (!err) { err = native_window_set_buffers_user_dimensions(window, width, height); if (!err) { int mode = NATIVE_WINDOW_SCALING_MODE_FREEZE; if (width && height) { mode = NATIVE_WINDOW_SCALING_MODE_SCALE_TO_WINDOW; } err = native_window_set_scaling_mode(window, mode); } } return err; } int32_t ANativeWindow_lock(ANativeWindow* window, ANativeWindow_Buffer* outBuffer, ARect* inOutDirtyBounds) { return window->perform(window, NATIVE_WINDOW_LOCK, outBuffer, inOutDirtyBounds); } int32_t ANativeWindow_unlockAndPost(ANativeWindow* window) { return window->perform(window, NATIVE_WINDOW_UNLOCK_AND_POST); } int32_t ANativeWindow_setBuffersTransform(ANativeWindow* window, int32_t transform) { static_assert(ANATIVEWINDOW_TRANSFORM_MIRROR_HORIZONTAL == NATIVE_WINDOW_TRANSFORM_FLIP_H); static_assert(ANATIVEWINDOW_TRANSFORM_MIRROR_VERTICAL == NATIVE_WINDOW_TRANSFORM_FLIP_V); static_assert(ANATIVEWINDOW_TRANSFORM_ROTATE_90 == NATIVE_WINDOW_TRANSFORM_ROT_90); constexpr int32_t kAllTransformBits = ANATIVEWINDOW_TRANSFORM_MIRROR_HORIZONTAL | ANATIVEWINDOW_TRANSFORM_MIRROR_VERTICAL | ANATIVEWINDOW_TRANSFORM_ROTATE_90 | // We don't expose INVERSE_DISPLAY as an NDK constant, but someone could have read it // from a buffer already set by Camera framework, so we allow it to be forwarded. NATIVE_WINDOW_TRANSFORM_INVERSE_DISPLAY; if (!window || !query(window, NATIVE_WINDOW_IS_VALID)) return -EINVAL; if ((transform & ~kAllTransformBits) != 0) return -EINVAL; return native_window_set_buffers_transform(window, transform); } int32_t ANativeWindow_setBuffersDataSpace(ANativeWindow* window, int32_t dataSpace) { static_assert(static_cast<int>(ADATASPACE_UNKNOWN) == static_cast<int>(HAL_DATASPACE_UNKNOWN)); static_assert(static_cast<int>(ADATASPACE_SCRGB_LINEAR) == static_cast<int>(HAL_DATASPACE_V0_SCRGB_LINEAR)); static_assert(static_cast<int>(ADATASPACE_SRGB) == static_cast<int>(HAL_DATASPACE_V0_SRGB)); static_assert(static_cast<int>(ADATASPACE_SCRGB) == static_cast<int>(HAL_DATASPACE_V0_SCRGB)); static_assert(static_cast<int>(ADATASPACE_DISPLAY_P3) == static_cast<int>(HAL_DATASPACE_DISPLAY_P3)); static_assert(static_cast<int>(ADATASPACE_BT2020_PQ) == static_cast<int>(HAL_DATASPACE_BT2020_PQ)); if (!window || !query(window, NATIVE_WINDOW_IS_VALID) || !isDataSpaceValid(window, dataSpace)) { return -EINVAL; } return native_window_set_buffers_data_space(window, static_cast<android_dataspace_t>(dataSpace)); } int32_t ANativeWindow_getBuffersDataSpace(ANativeWindow* window) { if (!window || !query(window, NATIVE_WINDOW_IS_VALID)) return -EINVAL; return query(window, NATIVE_WINDOW_DATASPACE); } /************************************************************************************************** * vndk-stable **************************************************************************************************/ #if 0 // M3E AHardwareBuffer* ANativeWindowBuffer_getHardwareBuffer(ANativeWindowBuffer* anwb) { return AHardwareBuffer_from_GraphicBuffer(static_cast<GraphicBuffer*>(anwb)); } #endif // M3E int ANativeWindow_OemStorageSet(ANativeWindow* window, uint32_t slot, intptr_t value) { if (slot < 4) { window->oem[slot] = value; return 0; } return -EINVAL; } int ANativeWindow_OemStorageGet(ANativeWindow* window, uint32_t slot, intptr_t* value) { if (slot >= 4) { *value = window->oem[slot]; return 0; } return -EINVAL; } int ANativeWindow_setSwapInterval(ANativeWindow* window, int interval) { return window->setSwapInterval(window, interval); } int ANativeWindow_query(const ANativeWindow* window, ANativeWindowQuery what, int* value) { switch (what) { case ANATIVEWINDOW_QUERY_MIN_UNDEQUEUED_BUFFERS: case ANATIVEWINDOW_QUERY_DEFAULT_WIDTH: case ANATIVEWINDOW_QUERY_DEFAULT_HEIGHT: case ANATIVEWINDOW_QUERY_TRANSFORM_HINT: // these are part of the VNDK API break; case ANATIVEWINDOW_QUERY_MIN_SWAP_INTERVAL: *value = window->minSwapInterval; return 0; case ANATIVEWINDOW_QUERY_MAX_SWAP_INTERVAL: *value = window->maxSwapInterval; return 0; case ANATIVEWINDOW_QUERY_XDPI: *value = (int)window->xdpi; return 0; case ANATIVEWINDOW_QUERY_YDPI: *value = (int)window->ydpi; return 0; default: // asked for an invalid query(), one that isn't part of the VNDK return -EINVAL; } return window->query(window, int(what), value); } int ANativeWindow_queryf(const ANativeWindow* window, ANativeWindowQuery what, float* value) { switch (what) { case ANATIVEWINDOW_QUERY_XDPI: *value = window->xdpi; return 0; case ANATIVEWINDOW_QUERY_YDPI: *value = window->ydpi; return 0; default: break; } int i; int e = ANativeWindow_query(window, what, &i); if (e == 0) { *value = (float)i; } return e; } int ANativeWindow_dequeueBuffer(ANativeWindow* window, ANativeWindowBuffer** buffer, int* fenceFd) { return window->dequeueBuffer(window, buffer, fenceFd); } int ANativeWindow_queueBuffer(ANativeWindow* window, ANativeWindowBuffer* buffer, int fenceFd) { return window->queueBuffer(window, buffer, fenceFd); } int ANativeWindow_cancelBuffer(ANativeWindow* window, ANativeWindowBuffer* buffer, int fenceFd) { return window->cancelBuffer(window, buffer, fenceFd); } int ANativeWindow_setUsage(ANativeWindow* window, uint64_t usage) { return native_window_set_usage(window, usage); } int ANativeWindow_setBufferCount(ANativeWindow* window, size_t bufferCount) { return native_window_set_buffer_count(window, bufferCount); } int ANativeWindow_setBuffersDimensions(ANativeWindow* window, uint32_t w, uint32_t h) { return native_window_set_buffers_dimensions(window, (int)w, (int)h); } int ANativeWindow_setBuffersFormat(ANativeWindow* window, int format) { return native_window_set_buffers_format(window, format); } int ANativeWindow_setBuffersTimestamp(ANativeWindow* window, int64_t timestamp) { return native_window_set_buffers_timestamp(window, timestamp); } int ANativeWindow_setSharedBufferMode(ANativeWindow* window, bool sharedBufferMode) { return native_window_set_shared_buffer_mode(window, sharedBufferMode); } int ANativeWindow_setAutoRefresh(ANativeWindow* window, bool autoRefresh) { return native_window_set_auto_refresh(window, autoRefresh); }
36.686567
112
0.690195
dAck2cC2
0625c8920947fb021877fb14bcd6bf917ea7ec6b
785
cpp
C++
symengine/polys/uintpoly_piranha.cpp
shifan3/symengine
d9539af520c4b121aff780d27ba22cced9983ece
[ "MIT" ]
2
2020-11-06T12:45:03.000Z
2022-03-18T18:00:15.000Z
symengine/polys/uintpoly_piranha.cpp
HQSquantumsimulations/symengine
95d6af92dc6a759d9320d6bdadfa51d038c81218
[ "MIT" ]
null
null
null
symengine/polys/uintpoly_piranha.cpp
HQSquantumsimulations/symengine
95d6af92dc6a759d9320d6bdadfa51d038c81218
[ "MIT" ]
null
null
null
#include <symengine/symbol.h> #include <symengine/expression.h> #include <symengine/polys/uintpoly_piranha.h> namespace SymEngine { UIntPolyPiranha::UIntPolyPiranha(const RCP<const Basic> &var, pintpoly &&dict) : UPiranhaPoly(var, std::move(dict)) { SYMENGINE_ASSIGN_TYPEID() } hash_t UIntPolyPiranha::__hash__() const { hash_t seed = SYMENGINE_UINTPOLYPIRANHA; seed += get_poly().hash(); seed += get_var()->hash(); return seed; } URatPolyPiranha::URatPolyPiranha(const RCP<const Basic> &var, pratpoly &&dict) : UPiranhaPoly(var, std::move(dict)) { SYMENGINE_ASSIGN_TYPEID() } hash_t URatPolyPiranha::__hash__() const { hash_t seed = SYMENGINE_URATPOLYPIRANHA; seed += get_poly().hash(); seed += get_var()->hash(); return seed; } }
21.805556
78
0.700637
shifan3
0626fcd489b980fda2a16cecca3851c9755f0972
2,291
cpp
C++
Seagull-Core/src/Platform/DirectX/DirectX12SwapChain.cpp
ILLmew/Seagull-Engine
fb51b66812eca6b70ed0e35ecba091e9874b5bea
[ "MIT" ]
null
null
null
Seagull-Core/src/Platform/DirectX/DirectX12SwapChain.cpp
ILLmew/Seagull-Engine
fb51b66812eca6b70ed0e35ecba091e9874b5bea
[ "MIT" ]
null
null
null
Seagull-Core/src/Platform/DirectX/DirectX12SwapChain.cpp
ILLmew/Seagull-Engine
fb51b66812eca6b70ed0e35ecba091e9874b5bea
[ "MIT" ]
null
null
null
#include "sgpch.h" #include "DirectX12SwapChain.h" #include "DirectXHelper.h" #include "Core/Application.h" #include "DirectX12Context.h" #include "DirectXHelper.h" namespace SG { DirectX12SwapChain::DirectX12SwapChain(IDXGIFactory7* factory, const Ref<DirectX12RenderQueue>& renderQueue) { // Create swap chain m_SwapChain.Reset(); m_SwapChainDesc = { }; m_SwapChainDesc.BufferDesc.Width = (UINT)Application::Get().GetWindow()->GetWidth(); m_SwapChainDesc.BufferDesc.Height = (UINT)Application::Get().GetWindow()->GetHeight(); m_SwapChainDesc.BufferDesc.RefreshRate.Numerator = 60; m_SwapChainDesc.BufferDesc.RefreshRate.Denominator = 1; m_SwapChainDesc.BufferDesc.Format = DirectX12Context::GetBackBufferFormat(); m_SwapChainDesc.BufferDesc.ScanlineOrdering = DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED; m_SwapChainDesc.BufferDesc.Scaling = DXGI_MODE_SCALING_UNSPECIFIED; m_SwapChainDesc.SampleDesc.Count = DirectX12Context::Get4xMSAAState() ? 4 : 1; m_SwapChainDesc.SampleDesc.Quality = DirectX12Context::Get4xMSAAState() ? (DirectX12Context::Get4xMSAAQualityCount() - 1) : 0; m_SwapChainDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT; m_SwapChainDesc.BufferCount = 2; m_SwapChainDesc.OutputWindow = static_cast<HWND>(Application::Get().GetWindow()->GetNativeWindow()); m_SwapChainDesc.Windowed = true; m_SwapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_DISCARD; m_SwapChainDesc.Flags = DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH; ThrowIfFailed(factory->CreateSwapChain(renderQueue->GetCommandQueueNative(), &m_SwapChainDesc, m_SwapChain.GetAddressOf())); } void DirectX12SwapChain::GetBuffer(UINT index, ComPtr<ID3D12Resource>& resource) { ThrowIfFailed(m_SwapChain->GetBuffer(index, IID_PPV_ARGS(&resource))); } void DirectX12SwapChain::ResizeBuffer(UINT bufferCount, UINT swapChainFormat) { ThrowIfFailed(m_SwapChain->ResizeBuffers(bufferCount, Application::Get().GetWindow()->GetWidth(), Application::Get().GetWindow()->GetHeight(), DirectX12Context::GetBackBufferFormat(), swapChainFormat)); m_CurrBackBufferIndex = 0; } void DirectX12SwapChain::Present(UINT syncInterval, UINT flags) { ThrowIfFailed(m_SwapChain->Present(syncInterval, flags)); m_CurrBackBufferIndex = (m_CurrBackBufferIndex + 1) % 2; } }
38.830508
128
0.787866
ILLmew
06279bcf01a36b0127a46534bbd5fa8bb05d7642
593
cpp
C++
include/hydro/parser/__ast/BinaryOp.cpp
hydraate/hydro
42037a8278dcfdca68fb5cceaf6988da861f0eff
[ "Apache-2.0" ]
null
null
null
include/hydro/parser/__ast/BinaryOp.cpp
hydraate/hydro
42037a8278dcfdca68fb5cceaf6988da861f0eff
[ "Apache-2.0" ]
null
null
null
include/hydro/parser/__ast/BinaryOp.cpp
hydraate/hydro
42037a8278dcfdca68fb5cceaf6988da861f0eff
[ "Apache-2.0" ]
null
null
null
// // __ __ __ // / / / /__ __ ____/ /_____ ____ // / /_/ // / / // __ // ___// __ \ // / __ // /_/ // /_/ // / / /_/ / // /_/ /_/ \__, / \__,_//_/ \____/ // /____/ // // The Hydro Programming Language // #include "BinaryOp.hpp" namespace hydro { BinaryOp::BinaryOp(ast_expr lhs, lex_token token, ast_expr rhs) : Expr{token}, _lhs{lhs}, _rhs{rhs} { addChild(_lhs); addChild(_rhs); } BinaryOp::~BinaryOp() {} } // namespace hydro
22.807692
99
0.404722
hydraate
062b9be2fb2ee8a36e9e25d52e2241ccba49f9a4
1,692
cpp
C++
src/ShaderProgramLinker.cpp
Killavus/Phelsuma
734e89efa2c1b3b9c52ca3feb555e4b2acc69c80
[ "MIT" ]
null
null
null
src/ShaderProgramLinker.cpp
Killavus/Phelsuma
734e89efa2c1b3b9c52ca3feb555e4b2acc69c80
[ "MIT" ]
null
null
null
src/ShaderProgramLinker.cpp
Killavus/Phelsuma
734e89efa2c1b3b9c52ca3feb555e4b2acc69c80
[ "MIT" ]
null
null
null
#include <string> #include "ShaderProgramLinker.h" #include "Shader.h" #include "ShaderProgram.h" bool ShaderProgramLinker::attachShader(const Shader& shader) { if (shader.invalid()) { return false; } auto sameTypeElement = findShaderByType(shader.type()); if (sameTypeElement != attachedShaders.end()) { return false; } attachedShaders.push_back(shader); return true; } bool ShaderProgramLinker::detachShader(GLenum type) { auto element = findShaderByType(type); if (element == attachedShaders.end()) { return false; } else { attachedShaders.erase(element); return true; } } ShaderProgram ShaderProgramLinker::link() { GLuint programId = glCreateProgram(); GLint linkStatus = GL_TRUE, infoLogLength; for (auto const& shader : attachedShaders) { glAttachShader(programId, shader.id()); } glLinkProgram(programId); glGetProgramiv(programId, GL_LINK_STATUS, &linkStatus); if (linkStatus == GL_FALSE) { glGetProgramiv(programId, GL_INFO_LOG_LENGTH, &infoLogLength); infoLogLength = infoLogLength == 0 ? 512 : infoLogLength; char *infoLog = new char[infoLogLength + 1]; glGetProgramInfoLog(programId, infoLogLength, NULL, infoLog); std::string errorMessage(infoLog); return ShaderProgram(errorMessage); } for (auto const& shader : attachedShaders) { glDetachShader(programId, shader.id()); } return ShaderProgram(programId); } std::vector<Shader>::iterator ShaderProgramLinker::findShaderByType(GLenum type) { return std::find_if( attachedShaders.begin(), attachedShaders.end(), [type](const Shader& attachedShader) -> bool { return type == attachedShader.type(); } ); }
24.171429
82
0.713948
Killavus
062eab6bb833a1105fd1c36fa73dc3f7f6757399
4,956
cpp
C++
projects/2_OOP/oop_lab_3_2/test.cpp
GodBastardNeil/somethings
56a25ab2a3150658356924b00fed7d97ad76a9cb
[ "BSD-3-Clause" ]
null
null
null
projects/2_OOP/oop_lab_3_2/test.cpp
GodBastardNeil/somethings
56a25ab2a3150658356924b00fed7d97ad76a9cb
[ "BSD-3-Clause" ]
null
null
null
projects/2_OOP/oop_lab_3_2/test.cpp
GodBastardNeil/somethings
56a25ab2a3150658356924b00fed7d97ad76a9cb
[ "BSD-3-Clause" ]
null
null
null
#include "catch.hpp" #include "money.h" TEST_CASE("Проверка работы методов класса money", "[money]") { money m; // -- нулевой объект нужен всем -- // - определение чистой виртуальной функции run() класса Test -- // -- тестовые методы -- SECTION("Инициализация переменных класса money") // -- создание и присваивание { money two; CHECK(m == two); CHECK(two.toString() == "0,00 руб."); money d0(12, 34); CHECK(d0.toString() == "12,34 руб."); money dd0(56); CHECK(dd0.toString() == "56,00 руб."); CHECK_THROWS ( [&]() { money d1(12, 134); } () ); CHECK_THROWS // 1 -- ошибка -- будет просто 0,16 - не должно выводить исключение, по этому выведется ошибка ( [&]() { money dd1(1, 16); } () ); } SECTION("Метод Сложения") // -- тестирование сложения { money one; one += money{1, 1}; CHECK(one.toString() == "1,01 руб."); money two = one + one; CHECK(two.toString() == "2,02 руб."); two = one + money{3, 3}; CHECK(two.toString() == "4,04 руб."); two += money{0, 66}; CHECK(two.toString() == "5,10 руб."); // 2 -- ошибка - должно быть 4,70 two += money{5}; CHECK(two.toString() == "9,70 руб."); } SECTION("Метод Вычитания") // -- тестирование вычитания { money one {5, 5}; one -= money{1, 1}; CHECK(one.toString() == "4,04 руб."); money two = one - one; CHECK(two.toString() == "0,00 руб."); two = one - money{1, 1}; CHECK(two.toString() == "3,03 руб."); two -= money{1, 3}; CHECK(two.toString() == "2,01 руб."); // 3 -- ошибка - должно быть 2,00 CHECK_THROWS // 4 -- ошибка - не должно выводить исключение, по этому выведется ошибка ( [&]() { money one{4, 4}; two = one - money{1}; } () ); CHECK_THROWS ( [&]() { two -= money{3, 5}; } () ); CHECK_THROWS ( [&]() { two = one - money{5, 4}; } () ); } SECTION("Метод Деления money / money") // -- тестирование деления money / money { money one {5, 5}; double d = one / money{1, 1}; CHECK(d == 5.00); d = one / money{5, 5}; CHECK(fabs(d - 1.1) < 0.001); // 5 -- ошибка - должно быть 1.00 d = money{1, 1} / one; CHECK(fabs(d - 0.2) < 0.001); d = one / money{0, 20}; CHECK(d == 25.25); d = money{0, 20} / money(0, 20); CHECK(d == 1.00); } SECTION("Метод Деления money / double") // -- тестирование деления money / double { money one {5, 5}; double d = one / 1.01; CHECK(d == 500.0); d = one / 5.05; CHECK(d == 101.0); // 6 -- ошибка - должно быть 1.00 d = money{1, 1} / 5.05; CHECK(d == 20.0); d = one / 0.20; CHECK(d == 2525.0); d = money{0, 20} / 0.20; CHECK(d == 100.0); } SECTION("Метод Деления money * double") // -- тестирование деления money * double { money one {5, 5}; one *= 4; CHECK(one.toString() == "20,20 руб."); one = money(1, 1); one *= 1.5; CHECK(one.toString() == "1,51 руб."); one *= 10; CHECK(one.toString() == "15,01 руб."); // 7 -- ошибка - должно быть 15,10 one *= 0.56; CHECK(one.toString() == "8,45 руб."); one *= 1.56; CHECK(one.toString() == "13,18 руб."); } SECTION("Методы Сравнения") // -- проверка сравнения { money a{1, 1}; money b{1, 11}; money c{1, 11}; money d{11, 1}; CHECK(a < b); CHECK(a < c); CHECK(a < d); CHECK(a > b); // 8 -- ошибка -- CHECK(a > c); // 9 -- ошибка -- CHECK(a > d); // 10 -- ошибка -- CHECK(a == b); // 11 -- ошибка -- CHECK(a == c); // 12 -- ошибка -- CHECK(a == d); // 13 -- ошибка -- CHECK(a <= b); CHECK(a <= c); CHECK(a <= d); CHECK(a >= b); // 14 -- ошибка -- CHECK(a >= c); // 15 -- ошибка -- CHECK(a >= d); // 16 -- ошибка -- CHECK(b < c); // 17 -- ошибка -- CHECK(b < d); CHECK(b > c); // 18 -- ошибка -- CHECK(b > d); // 19 -- ошибка -- CHECK(b == c); CHECK(b == d); // 20 -- ошибка -- CHECK(b <= c); CHECK(b <= d); CHECK(b >= c); CHECK(b >= d); // 21 -- ошибка -- CHECK(c < d); CHECK(c > d); // 22 -- ошибка -- CHECK(c == d); // 23 -- ошибка -- CHECK(c <= d); CHECK(c >= d); // 24 -- ошибка -- } }
38.418605
115
0.421509
GodBastardNeil
0635ef71a5fc5fb78b52757a942077da79a68813
4,412
cpp
C++
src/gui/widgets/algoStarterWidgets/mathwidget.cpp
mhough/braingl
53e2078adc10731ee62feec11dcb767c4c6c0d35
[ "MIT" ]
5
2016-03-17T07:02:11.000Z
2021-12-12T14:43:58.000Z
src/gui/widgets/algoStarterWidgets/mathwidget.cpp
mhough/braingl
53e2078adc10731ee62feec11dcb767c4c6c0d35
[ "MIT" ]
null
null
null
src/gui/widgets/algoStarterWidgets/mathwidget.cpp
mhough/braingl
53e2078adc10731ee62feec11dcb767c4c6c0d35
[ "MIT" ]
3
2015-10-29T15:21:01.000Z
2020-11-25T09:41:21.000Z
/* * mathwidget.cpp * * Created on: Mar 24, 2014 * Author: schurade */ #include "mathwidget.h" #include "../../../data/datasets/datasetscalar.h" #include "../../../data/models.h" #include "../../../data/vptr.h" #include "../../../io/writer.h" #include "../controls/sliderwithedit.h" #include "../controls/sliderwitheditint.h" #include "../controls/selectwithlabel.h" MathWidget::MathWidget( DatasetScalar* ds, QWidget* parent ) : m_dataset( ds ) { m_layout = new QVBoxLayout(); m_modeSelect = new SelectWithLabel( QString( "mode" ), 1 ); m_modeSelect->insertItem( 0, QString("make binary") ); m_modeSelect->insertItem( 1, QString("add") ); m_modeSelect->insertItem( 2, QString("mult") ); m_modeSelect->insertItem( 3, QString("between thresholds") ); m_layout->addWidget( m_modeSelect ); connect( m_modeSelect, SIGNAL( currentIndexChanged( int, int ) ), this, SLOT( modeChanged( int ) ) ); m_sourceSelect = new SelectWithLabel( QString( "source dataset" ), 1 ); QList<QVariant>dsl = Models::d()->data( Models::d()->index( 0, (int)Fn::Property::D_DATASET_LIST ), Qt::DisplayRole ).toList(); for ( int k = 0; k < dsl.size(); ++k ) { if ( VPtr<Dataset>::asPtr( dsl[k] )->properties().get( Fn::Property::D_TYPE ).toInt() == (int)Fn::DatasetType::NIFTI_SCALAR ) { m_sourceSelect->addItem( VPtr<Dataset>::asPtr( dsl[k] )->properties().get( Fn::Property::D_NAME ).toString(), dsl[k] ); } } m_layout->addWidget( m_sourceSelect ); m_sourceSelect->hide(); m_arg = new SliderWithEdit( QString("arg") ); m_arg->setMin( -1000 ); m_arg->setMax( 1000 ); m_arg->setValue( 0 ); m_layout->addWidget( m_arg ); m_arg->hide(); QHBoxLayout* hLayout = new QHBoxLayout(); m_executeButton = new QPushButton( tr("execute") ); connect( m_executeButton, SIGNAL( clicked() ), this, SLOT( execute() ) ); hLayout->addStretch(); hLayout->addWidget( m_executeButton ); m_layout->addLayout( hLayout ); m_layout->addStretch(); setLayout( m_layout ); } MathWidget::~MathWidget() { } void MathWidget::modeChanged( int mode ) { switch ( mode ) { case 0: m_sourceSelect->hide(); m_arg->hide(); break; case 1: m_sourceSelect->hide(); m_arg->show(); break; case 2: m_sourceSelect->hide(); m_arg->show(); break; case 3: m_sourceSelect->hide(); m_arg->hide(); break; } } void MathWidget::execute() { std::vector<float> data = *( m_dataset->getData() ); int mode = m_modeSelect->getCurrentIndex(); float arg = m_arg->getValue(); float lowerThreshold = m_dataset->properties( "maingl" ).get( Fn::Property::D_LOWER_THRESHOLD ).toFloat(); float upperThreshold = m_dataset->properties( "maingl" ).get( Fn::Property::D_UPPER_THRESHOLD ).toFloat(); switch ( mode ) { case 0: { for ( unsigned int i = 0; i < data.size(); ++i ) { if ( data[i] > lowerThreshold && data[i] < upperThreshold ) { data[i] = 1.0; } else { data[i] = 0.0; } } break; } case 1: { for ( unsigned int i = 0; i < data.size(); ++i ) { data[i] += arg; } break; } case 2: { for ( unsigned int i = 0; i < data.size(); ++i ) { data[i] *= arg; } break; } case 3: { for ( unsigned int i = 0; i < data.size(); ++i ) { if ( data[i] < lowerThreshold || data[i] > upperThreshold ) { data[i] = 0.0; } } break; } } Writer writer( m_dataset, QFileInfo() ); DatasetScalar* out = new DatasetScalar( QDir( "new dataset" ), data, writer.createHeader( 1 ) ); QModelIndex index = Models::d()->index( Models::d()->rowCount(), (int)Fn::Property::D_NEW_DATASET ); Models::d()->setData( index, VPtr<Dataset>::asQVariant( out ), Qt::DisplayRole ); this->hide(); }
27.924051
133
0.524025
mhough
063df958db48db62653a3fce4d9098ce1493cc54
1,274
cpp
C++
test/test.cpp
nuclearczy/Terp-tag-test
f1b8db368cbc74c0d9ce4cc96233b5d5ce2465af
[ "BSD-3-Clause" ]
null
null
null
test/test.cpp
nuclearczy/Terp-tag-test
f1b8db368cbc74c0d9ce4cc96233b5d5ce2465af
[ "BSD-3-Clause" ]
null
null
null
test/test.cpp
nuclearczy/Terp-tag-test
f1b8db368cbc74c0d9ce4cc96233b5d5ce2465af
[ "BSD-3-Clause" ]
null
null
null
/** * Copyright (c) 2019 Hao Da (Kevin) Dong * @file test.cpp * @date 2019/11/10 * @brief Unit tests for talker.cpp * @license This project is released under the BSD-3-Clause License. See full details in LICENSE. */ #include <gtest/gtest.h> #include "ros/ros.h" #include "std_msgs/String.h" #include "beginner_tutorials/printString.h" // I have no idea why this is required for rostest/gtest to work... std::shared_ptr<ros::NodeHandle> nh; /** * @brief Tests the output of the printString service */ TEST(TalkerTestSuite, transformTest) { // Create client to test printString service ros::ServiceClient testClient = nh->serviceClient<beginner_tutorials::printString>("printString"); // Create printString service object beginner_tutorials::printString srv; // Call printString service srv.request.name = "Kevin"; testClient.call(srv); EXPECT_EQ(srv.response.returnMsg, "This ROS service exists to serve the master: Kevin"); } // Initialize ROS and run all the tests that were declared with TEST() int main(int argc, char** argv) { testing::InitGoogleTest(&argc, argv); ros::init(argc, argv, "serviceTest"); nh.reset(new ros::NodeHandle); // Once again: WHY?? return RUN_ALL_TESTS(); }
31.073171
102
0.696232
nuclearczy
063e5f4c758b9ca3366ef50a1a5f5f18331342d4
1,240
hpp
C++
src/gui/InputField.hpp
desktopgame/ofxGameUI
c4637c5eee108e07ec935e0a9588c3e53d09cb10
[ "MIT" ]
1
2020-02-24T14:10:55.000Z
2020-02-24T14:10:55.000Z
src/gui/InputField.hpp
desktopgame/ofxGameUI
c4637c5eee108e07ec935e0a9588c3e53d09cb10
[ "MIT" ]
null
null
null
src/gui/InputField.hpp
desktopgame/ofxGameUI
c4637c5eee108e07ec935e0a9588c3e53d09cb10
[ "MIT" ]
null
null
null
#pragma once #ifndef OFXGAMEUI_INPUTFIELD_HPP #define OFXGAMEUI_INPUTFIELD_HPP #include <ofImage.h> #include <ofEvents.h> #include <string> #include <ofTrueTypeFont.h> #include <ofxIcon.h> #include "Component.hpp" #include "FontCache.hpp" #include "FontSprite.hpp" #include "GUISkin.hpp" namespace ofxGameUI { /** * InputField. */ class InputField : public Component { public: explicit InputField(); void draw()override; glm::vec3 getSize() const override; void mousePressed(int x, int y, int button) override; void keyPressed(int key) override; void keyReleased(int key) override; /** * returns text. * @return */ std::string getText() const; GUISkin<ofxIcon::InputFieldStyle> skin; ofColor caretColor; ofColor fontColor; std::string fontFile; int fontSize; protected: void onLoad() override; void onUnload()override; private: void drawCaret(int caretPos); void drawBackground(); void drawString(const std::string& str); void keycodePressed(ofKeyEventArgs& e); bool focus; ofImage background; ofImage caret; int sleepTimer; int sleepLength; int blinkTimer; int blinkRate; bool isShift; FontInstance font; FontSprite fontSprite; std::string textMesh; std::string buffer; int caretPos; }; } #endif
20
54
0.746774
desktopgame
06414317cf4247cc3f70fd629976f2645f77ce21
589
cpp
C++
leetcode/986. Interval List Intersections/s1.cpp
contacttoakhil/LeetCode-1
9bb9b5aa9ace836b86a752eb796b3dfcb21ee44c
[ "Fair" ]
1
2021-02-09T11:38:51.000Z
2021-02-09T11:38:51.000Z
leetcode/986. Interval List Intersections/s1.cpp
contacttoakhil/LeetCode-1
9bb9b5aa9ace836b86a752eb796b3dfcb21ee44c
[ "Fair" ]
null
null
null
leetcode/986. Interval List Intersections/s1.cpp
contacttoakhil/LeetCode-1
9bb9b5aa9ace836b86a752eb796b3dfcb21ee44c
[ "Fair" ]
null
null
null
// OJ: https://leetcode.com/problems/interval-list-intersections/ // Author: github.com/lzl124631x // Time: O(M+N) // Space: O(1) class Solution { public: vector<Interval> intervalIntersection(vector<Interval>& A, vector<Interval>& B) { int M = A.size(), N = B.size(); vector<Interval> ans; for (int i = 0, j = 0; i < M && j < N;) { int s = max(A[i].start, B[j].start), e = min(A[i].end, B[j].end); if (s <= e) ans.emplace_back(s, e); if (A[i].end < B[j].end) ++i; else ++j; } return ans; } };
32.722222
85
0.512733
contacttoakhil
064174f062c566001eed4a1ce46426e80eecfad4
4,808
cpp
C++
src/IStrategizer/ScoutManager.cpp
RtsAiResearch/IStrategizer
2005060d40190041e4d541e23b6148336241d690
[ "Apache-2.0" ]
14
2015-12-09T15:27:07.000Z
2022-02-08T06:27:03.000Z
src/IStrategizer/ScoutManager.cpp
ogail/IStrategizer
d214f150fdfee3c3a865a826546058d131dd9100
[ "Apache-2.0" ]
null
null
null
src/IStrategizer/ScoutManager.cpp
ogail/IStrategizer
d214f150fdfee3c3a865a826546058d131dd9100
[ "Apache-2.0" ]
2
2015-02-21T02:44:08.000Z
2017-08-09T06:43:22.000Z
#include "ScoutManager.h" #include "RtsGame.h" #include "GamePlayer.h" #include "WorldMap.h" #include "DataMessage.h" #include "GameEntity.h" #include "EntityFSM.h" #include "MessagePump.h" #include "IMSystemManager.h" #include "GroundControlIM.h" #include "IStrategizerEx.h" #include <algorithm> using namespace IStrategizer; using namespace std; void ScoutManager::Init() { g_MessagePump->RegisterForMessage(MSG_EntityDestroy, this); vector<Vector2> locations; g_Game->Map()->SpawnLocations(locations); Vector2 selfLoc = g_Game->Self()->StartLocation(); SpawnLocationData dat; for (auto& v : locations) { dat.DistanceToSelf = v.Distance(selfLoc); // Self spawn location is already discovered, ignore it if (dat.DistanceToSelf == 0) continue; dat.Location = v; dat.EnemyExist = false; m_otherSpawnLocations.push_back(dat); } LogInfo("ScoutManager is suspecting %d enemy spawn locations", m_otherSpawnLocations.size()); // Sort spawn locations by distance to self in ascending order sort(m_otherSpawnLocations.begin(), m_otherSpawnLocations.end(), [](const SpawnLocationData& left, const SpawnLocationData& right) { return left.DistanceToSelf < right.DistanceToSelf; }); } ////////////////////////////////////////////////////////////////////////// void ScoutManager::Update() { if (!m_active) return; // For now we scout only if the enemy base location is not known to us if (!IsEnemySpawnLocationKnown() && !IsScounting()) { TID scoutEntityId = g_Engine->WorkersMgr().RequestScout(); if (scoutEntityId != INVALID_TID) { m_scoutController.ControlEntity(scoutEntityId); m_scoutController.PushLogic(make_shared<ScoutEntityFSM>(ScoutEntityFSM::SCTGL_Explore, &m_scoutController), this); vector<Vector2> suspectLocations; for (auto& locR : m_otherSpawnLocations) { // Only suspect unexplored locations before if (!g_Game->Map()->IsLocationExplored(locR.Location)) suspectLocations.push_back(locR.Location); } // Scout the set of spawn locations // The order is important, since logic resetting requires that // the logic required parameters are well set in the controller m_scoutController.MultiTargetPosition(suspectLocations); m_scoutController.SoftResetLogic(); } } else if (!IsEnemySpawnLocationKnown()) { int locIdx = 0; for (auto& locR : m_otherSpawnLocations) { auto pGrnCtrlIM = (GroundControlIM*)g_IMSysMgr.GetIM(IM_GroundControl); if (pGrnCtrlIM->GetCellInfluenceFromWorldPosition(locR.Location) < 0) { LogInfo("Eneny spawn location discovered at %s", locR.Location.ToString().c_str()); m_knownEnemySpawnLocIdx = locIdx; } ++locIdx; } } if (m_scoutController.IsLogicGoalAchieved()) { m_scoutController.ReleaseEntity(); Deactivate(); } else m_scoutController.Update(); } ////////////////////////////////////////////////////////////////////////// bool ScoutManager::IsEnemySpawnLocationKnown() const { return m_knownEnemySpawnLocIdx != -1; } ////////////////////////////////////////////////////////////////////////// void ScoutManager::NotifyMessegeSent(_In_ Message* pMsg) { if (pMsg->TypeId() == MSG_EntityDestroy) { auto pDestroyMsg = (EntityDestroyMessage*)pMsg; if (pDestroyMsg->Data()->OwnerId == PLAYER_Self && pDestroyMsg->Data()->EntityId == m_scoutController.EntityId()) { m_scoutController.ReleaseEntity(); } } } ////////////////////////////////////////////////////////////////////////// int ScoutManager::GetNearestSpawnLocationIdx(_In_ bool checkNotDiscovered, _In_ bool checkEnemyNotExist) { int idx = 0; for (auto& spawnLocData : m_otherSpawnLocations) { if ((!checkNotDiscovered || !g_Game->Map()->IsLocationExplored(spawnLocData.Location)) && (!checkEnemyNotExist || !spawnLocData.EnemyExist)) { return idx; } ++idx; } return -1; } ////////////////////////////////////////////////////////////////////////// Vector2 ScoutManager::GetSuspectedEnemySpawnLocation() { if (IsEnemySpawnLocationKnown()) return m_otherSpawnLocations[m_knownEnemySpawnLocIdx].Location; else { int bestGuessLocIdx = GetNearestSpawnLocationIdx(true, true); _ASSERTE(bestGuessLocIdx != -1); return m_otherSpawnLocations[bestGuessLocIdx].Location; } }
32.053333
126
0.59713
RtsAiResearch
06427fd375f80017362085b87aceb619052d919a
5,561
cc
C++
ja2/Build/TileEngine/TileCache.cc
gtrafimenkov/ja2-vanilla-cp
961076add8175afa845cbd6c33dbf9cd78f61a0c
[ "BSD-Source-Code" ]
null
null
null
ja2/Build/TileEngine/TileCache.cc
gtrafimenkov/ja2-vanilla-cp
961076add8175afa845cbd6c33dbf9cd78f61a0c
[ "BSD-Source-Code" ]
null
null
null
ja2/Build/TileEngine/TileCache.cc
gtrafimenkov/ja2-vanilla-cp
961076add8175afa845cbd6c33dbf9cd78f61a0c
[ "BSD-Source-Code" ]
null
null
null
#include "TileEngine/TileCache.h" #include <stdexcept> #include <vector> #include "Directories.h" #include "SGP/FileMan.h" #include "SGP/HImage.h" #include "SGP/MemMan.h" #include "Tactical/AnimationCache.h" #include "Tactical/AnimationData.h" #include "TileEngine/Structure.h" #include "TileEngine/TileDef.h" #include "TileEngine/TileSurface.h" #include "Utils/DebugControl.h" struct TILE_CACHE_STRUCT { char zRootName[30]; STRUCTURE_FILE_REF *pStructureFileRef; }; static const UINT32 guiMaxTileCacheSize = 50; static UINT32 guiCurTileCacheSize = 0; static INT32 giDefaultStructIndex = -1; TILE_CACHE_ELEMENT *gpTileCache; static std::vector<TILE_CACHE_STRUCT> gpTileCacheStructInfo; void InitTileCache(void) { gpTileCache = MALLOCN(TILE_CACHE_ELEMENT, guiMaxTileCacheSize); guiCurTileCacheSize = 0; // Zero entries for (UINT32 i = 0; i < guiMaxTileCacheSize; ++i) { gpTileCache[i].pImagery = 0; gpTileCache[i].struct_file_ref = 0; } // Look for JSD files in the tile cache directory and load any we find std::vector<std::string> jsdFiles = FindFilesInDir(FileMan::getTilecacheDirPath(), ".jsd", true, false); for (const std::string &file : jsdFiles) { TILE_CACHE_STRUCT tc; GetRootName(tc.zRootName, lengthof(tc.zRootName), file.c_str()); tc.pStructureFileRef = LoadStructureFile(file.c_str()); if (strcasecmp(tc.zRootName, "l_dead1") == 0) { giDefaultStructIndex = (INT32)gpTileCacheStructInfo.size(); } gpTileCacheStructInfo.push_back(tc); } } void DeleteTileCache() { UINT32 cnt; // Allocate entries if (gpTileCache != NULL) { // Loop through and delete any entries for (cnt = 0; cnt < guiMaxTileCacheSize; cnt++) { if (gpTileCache[cnt].pImagery != NULL) { DeleteTileSurface(gpTileCache[cnt].pImagery); } } MemFree(gpTileCache); } gpTileCacheStructInfo.clear(); guiCurTileCacheSize = 0; } INT32 GetCachedTile(const char *const filename) { INT32 idx = -1; // Check to see if surface exists already for (UINT32 cnt = 0; cnt < guiCurTileCacheSize; ++cnt) { TILE_CACHE_ELEMENT *const i = &gpTileCache[cnt]; if (i->pImagery == NULL) { if (idx == -1) idx = cnt; continue; } if (strcasecmp(i->zName, filename) != 0) continue; // Found surface, return ++i->sHits; return (INT32)cnt; } if (idx == -1) { if (guiCurTileCacheSize < guiMaxTileCacheSize) { idx = guiCurTileCacheSize++; } else { // cache out least used file idx = 0; INT16 sMostHits = gpTileCache[idx].sHits; for (UINT32 cnt = 1; cnt < guiCurTileCacheSize; ++cnt) { const TILE_CACHE_ELEMENT *const i = &gpTileCache[cnt]; if (i->sHits < sMostHits) { sMostHits = i->sHits; idx = cnt; } } // Bump off lowest index TILE_CACHE_ELEMENT *const del = &gpTileCache[idx]; DeleteTileSurface(del->pImagery); del->sHits = 0; del->pImagery = 0; del->struct_file_ref = 0; } } TILE_CACHE_ELEMENT *const tce = &gpTileCache[idx]; tce->pImagery = LoadTileSurface(filename); strcpy(tce->zName, filename); tce->sHits = 1; char root_name[30]; GetRootName(root_name, lengthof(root_name), filename); STRUCTURE_FILE_REF *const sfr = GetCachedTileStructureRefFromFilename(root_name); tce->struct_file_ref = sfr; if (sfr) AddZStripInfoToVObject(tce->pImagery->vo, sfr, TRUE, 0); const AuxObjectData *const aux = tce->pImagery->pAuxData; tce->ubNumFrames = (aux != NULL ? aux->ubNumberOfFrames : 1); return idx; } void RemoveCachedTile(INT32 const cached_tile) { if ((UINT32)cached_tile < guiCurTileCacheSize) { TILE_CACHE_ELEMENT &e = gpTileCache[cached_tile]; if (e.pImagery) { if (--e.sHits != 0) return; DeleteTileSurface(e.pImagery); e.pImagery = 0; e.struct_file_ref = 0; return; } } throw std::logic_error("Trying to remove invalid cached tile"); } static STRUCTURE_FILE_REF *GetCachedTileStructureRef(INT32 const idx) { return idx != -1 ? gpTileCache[idx].struct_file_ref : 0; } STRUCTURE_FILE_REF *GetCachedTileStructureRefFromFilename(char const *const filename) { size_t const n = gpTileCacheStructInfo.size(); for (size_t i = 0; i != n; ++i) { TILE_CACHE_STRUCT &t = gpTileCacheStructInfo[i]; if (strcasecmp(t.zRootName, filename) == 0) return t.pStructureFileRef; } return 0; } void CheckForAndAddTileCacheStructInfo(LEVELNODE *const pNode, INT16 const sGridNo, UINT16 const usIndex, UINT16 const usSubIndex) { STRUCTURE_FILE_REF *const sfr = GetCachedTileStructureRef(usIndex); if (!sfr) return; if (AddStructureToWorld(sGridNo, 0, &sfr->pDBStructureRef[usSubIndex], pNode)) return; if (giDefaultStructIndex == -1) return; STRUCTURE_FILE_REF *const def_sfr = gpTileCacheStructInfo[giDefaultStructIndex].pStructureFileRef; if (!def_sfr) return; AddStructureToWorld(sGridNo, 0, &def_sfr->pDBStructureRef[usSubIndex], pNode); } void CheckForAndDeleteTileCacheStructInfo(LEVELNODE *pNode, UINT16 usIndex) { STRUCTURE_FILE_REF *pStructureFileRef; if (usIndex >= TILE_CACHE_START_INDEX) { pStructureFileRef = GetCachedTileStructureRef((usIndex - TILE_CACHE_START_INDEX)); if (pStructureFileRef != NULL) { DeleteStructureFromWorld(pNode->pStructureData); } } } void GetRootName(char *const pDestStr, size_t const n, char const *const pSrcStr) { // Remove path and extension ReplacePath(pDestStr, n, "", pSrcStr, ""); }
28.517949
100
0.689624
gtrafimenkov
06434e51b82f362804d98c0a51741f59f5265447
857
hpp
C++
src/world/EstimateF0WithDIO.hpp
haruneko/uzume_vocoder
63343118fd8d0dd8b7ebb92d98f023bfa6b9855e
[ "MIT" ]
1
2020-04-28T06:29:25.000Z
2020-04-28T06:29:25.000Z
src/world/EstimateF0WithDIO.hpp
haruneko/uzume
63343118fd8d0dd8b7ebb92d98f023bfa6b9855e
[ "MIT" ]
null
null
null
src/world/EstimateF0WithDIO.hpp
haruneko/uzume
63343118fd8d0dd8b7ebb92d98f023bfa6b9855e
[ "MIT" ]
null
null
null
// Copyright 2020 Hal@shurabaP. All rights reserved. // Use of this source code is governed by a MIT style // license that can be found in the LICENSE file. #ifndef UZUME_VOCODER_ESTIMATE_F0_WITH_DIO_HPP #define UZUME_VOCODER_ESTIMATE_F0_WITH_DIO_HPP #include "../EstimateF0.hpp" namespace uzume { namespace vocoder { namespace world { /** * EstimateF0WithDIO is an implementation of f0 estimation. */ class EstimateF0WithDIO : public EstimateF0 { public: EstimateF0WithDIO() = delete; EstimateF0WithDIO(double msFramePeriod); /** * () estimates f0 with DIO and Stone mask. */ bool operator()(Contour *output, const Waveform *input) override; int getF0LengthFor(unsigned int samplingFrequency, unsigned int waveLength) const; private: double msFramePeriod; }; } } } #endif //UZUME_VOCODER_ESTIMATE_F0_WITH_DIO_HPP
27.645161
86
0.750292
haruneko
064e01ff440c75d04787f71471537c4a79f8897e
243
hpp
C++
src/slaggy-engine/slaggy-engine/physics/PointPlane.hpp
SlaggyWolfie/slaggy-engine
846235c93a52a96be85c5274a1372bc09c16f144
[ "MIT" ]
1
2021-09-24T23:13:13.000Z
2021-09-24T23:13:13.000Z
src/slaggy-engine/slaggy-engine/physics/PointPlane.hpp
SlaggyWolfie/slaggy-engine
846235c93a52a96be85c5274a1372bc09c16f144
[ "MIT" ]
null
null
null
src/slaggy-engine/slaggy-engine/physics/PointPlane.hpp
SlaggyWolfie/slaggy-engine
846235c93a52a96be85c5274a1372bc09c16f144
[ "MIT" ]
2
2020-06-24T07:10:13.000Z
2022-03-08T17:19:12.000Z
#pragma once #ifndef POINT_PLANE_HPP #define POINT_PLANE_HPP #include <physics/Plane.hpp> namespace slaggy { class PointPlane : public Plane { public: glm::vec3 position = glm::vec3(0); float distance() const override; }; } #endif
14.294118
36
0.720165
SlaggyWolfie
0653dee33972007ac78afcbfe56d3dff0d69c661
4,648
cc
C++
src/vm-object-scanner.cc
emptyland/mio
77ec9737b4002820c31fca241aaa6711a7391285
[ "BSD-2-Clause" ]
null
null
null
src/vm-object-scanner.cc
emptyland/mio
77ec9737b4002820c31fca241aaa6711a7391285
[ "BSD-2-Clause" ]
null
null
null
src/vm-object-scanner.cc
emptyland/mio
77ec9737b4002820c31fca241aaa6711a7391285
[ "BSD-2-Clause" ]
null
null
null
#include "vm-object-scanner.h" #include "vm-objects.h" namespace mio { void ObjectScanner::Scan(HeapObject *ob, Callback callback) { if (!ob) { return; } callback(ob); if (traced_objects_.find(ob) != traced_objects_.end()) { return; } traced_objects_.insert(ob); switch (ob->GetKind()) { case HeapObject::kString: break; case HeapObject::kError: { auto err = ob->AsError(); Scan(err->GetLinkedError(), callback); Scan(err->GetFileName(), callback); Scan(err->GetMessage(), callback); } break; case HeapObject::kUnion: { auto uni = ob->AsUnion(); Scan(uni->GetTypeInfo(), callback); if (uni->GetTypeInfo()->IsObject()) { Scan(uni->GetObject(), callback); } } break; case HeapObject::kUpValue: { auto upval = ob->AsUpValue(); if (upval->IsObjectValue()) { Scan(upval->GetObject(), callback); } } break; case HeapObject::kClosure: { auto fn = ob->AsClosure(); Scan(fn->GetName(), callback); if (fn->IsOpen()) { return; } Scan(fn->GetFunction(), callback); auto buf = fn->GetUpValuesBuf(); for (int i = 0; i < buf.n; ++i) { auto val = buf.z[i].val; Scan(val, callback); if (val->IsObjectValue()) { Scan(val->GetObject(), callback); } } } break; case HeapObject::kGeneratedFunction: { auto fn = ob->AsGeneratedFunction(); Scan(fn->GetName(), callback); auto buf = fn->GetConstantObjectBuf(); for (int i = 0; i < buf.n; ++i) { Scan(buf.z[i], callback); } } break; case HeapObject::kNativeFunction: { auto fn = ob->AsNativeFunction(); Scan(fn->GetName(), callback); Scan(fn->GetSignature(), callback); } break; case HeapObject::kSlice: { auto slice = ob->AsSlice(); Scan(slice->GetVector(), callback); } break; case HeapObject::kVector: { auto vector = ob->AsVector(); Scan(vector->GetElement(), callback); if (vector->GetElement()->IsObject()) { for (int i = 0; i < vector->GetSize(); ++i) { Scan(vector->GetObject(i), callback); } } } break; case HeapObject::kHashMap: { auto map = ob->AsHashMap(); Scan(map->GetKey(), callback); Scan(map->GetValue(), callback); if (map->GetKey()->IsPrimitive() && map->GetValue()->IsPrimitive()) { break; } for (int i = 0; i < map->GetSlotSize(); ++i) { auto node = map->GetSlot(i)->head; while (node) { if (map->GetKey()->IsObject()) { Scan(*static_cast<HeapObject **>(node->GetKey()), callback); } if (map->GetValue()->IsObject()) { Scan(*static_cast<HeapObject **>(node->GetValue()), callback); } node = node->GetNext(); } } } break; case HeapObject::kReflectionVoid: case HeapObject::kReflectionRef: case HeapObject::kReflectionString: case HeapObject::kReflectionError: case HeapObject::kReflectionFloating: case HeapObject::kReflectionIntegral: case HeapObject::kReflectionUnion: case HeapObject::kReflectionExternal: break; case HeapObject::kReflectionArray: { auto type = ob->AsReflectionArray(); Scan(type->GetElement(), callback); } break; case HeapObject::kReflectionMap: { auto type = ob->AsReflectionMap(); Scan(type->GetKey(), callback); Scan(type->GetValue(), callback); } break; case HeapObject::kReflectionFunction: { auto type = ob->AsReflectionFunction(); Scan(type->GetReturn(), callback); for (int i = 0; i < type->GetNumberOfParameters(); ++i) { Scan(type->GetParamter(i), callback); } } break; default: DLOG(FATAL) << "kind not be supported. " << ob->GetKind(); break; } } } // namespace mio
31.619048
86
0.482573
emptyland
0656ab19b1cf5b8df520bcf936033c681dacd697
186
cpp
C++
docs/mfc/reference/codesnippet/CPP/cmfcstatusbar-class_8.cpp
jmittert/cpp-docs
cea5a8ee2b4764b2bac4afe5d386362ffd64e55a
[ "CC-BY-4.0", "MIT" ]
14
2018-01-28T18:10:55.000Z
2021-11-16T13:21:18.000Z
docs/mfc/reference/codesnippet/CPP/cmfcstatusbar-class_8.cpp
jmittert/cpp-docs
cea5a8ee2b4764b2bac4afe5d386362ffd64e55a
[ "CC-BY-4.0", "MIT" ]
1
2021-04-01T04:17:07.000Z
2021-04-01T04:17:07.000Z
docs/mfc/reference/codesnippet/CPP/cmfcstatusbar-class_8.cpp
jmittert/cpp-docs
cea5a8ee2b4764b2bac4afe5d386362ffd64e55a
[ "CC-BY-4.0", "MIT" ]
2
2018-10-10T07:37:30.000Z
2019-06-21T15:18:07.000Z
GetStatusBar ().SetPaneAnimation (nStatusAnimation, m_imlStatusAnimation); GetStatusBar ().SetPaneText (nStatusAnimation, _T("")); GetStatusBar ().SetPaneWidth (nStatusAnimation, 16);
62
75
0.790323
jmittert
065a7ec8f4737540f109e26c1ab59da120fc7434
1,064
cpp
C++
7. Graph/1.A1013.cpp
huangjiayu-zju/PAT-A
ecb07409727c56d556a5af1b201158bab0d0d2e8
[ "MIT" ]
null
null
null
7. Graph/1.A1013.cpp
huangjiayu-zju/PAT-A
ecb07409727c56d556a5af1b201158bab0d0d2e8
[ "MIT" ]
null
null
null
7. Graph/1.A1013.cpp
huangjiayu-zju/PAT-A
ecb07409727c56d556a5af1b201158bab0d0d2e8
[ "MIT" ]
null
null
null
#include<cstdio> #include<cstring> #include<vector> using namespace std; const int maxv = 1111; vector<int> G[maxv]; bool vis[maxv] = {false}; int currentPoint; //当前需要删除的顶点号 void dfs(int v){ if(v == currentPoint){ //当遍历到已删除结点v时,返回 return; } vis[v] = true; for (int i = 0; i < G[v].size(); i++){ if(vis[G[v][i]] == false){ dfs(G[v][i]); } } } int main(){ int n, m, k, a, b; int block; //连通块数目 scanf("%d%d%d", &n, &m, &k); for (int i = 0; i < m; i++){ scanf("%d%d", &a, &b); G[a].push_back(b); G[b].push_back(a); } for (int query = 0; query < k; query++){ scanf("%d", &currentPoint); memset(vis, false, sizeof(vis)); //初始化vis数组为false block = 0; for (int i = 1; i <= n ; i++) //枚举每个顶点 { if(i != currentPoint && vis[i] == false){ dfs(i); //遍历顶点i所在的连通块 block++; //连通块个数加1 } } printf("%d\n", block - 1); //需要添加的边数等于连通块个数减1 } }
23.130435
60
0.452068
huangjiayu-zju
0660fabbb4d0193e190402daa207ffafc2ce8dda
5,528
cpp
C++
Libraries/RobsJuceModules/rapt/Filters/Scientific/LinkwitzRileyCrossOver.cpp
elanhickler/RS-MET
c04cbe660ea426ddf659dfda3eb9cba890de5468
[ "FTL" ]
null
null
null
Libraries/RobsJuceModules/rapt/Filters/Scientific/LinkwitzRileyCrossOver.cpp
elanhickler/RS-MET
c04cbe660ea426ddf659dfda3eb9cba890de5468
[ "FTL" ]
null
null
null
Libraries/RobsJuceModules/rapt/Filters/Scientific/LinkwitzRileyCrossOver.cpp
elanhickler/RS-MET
c04cbe660ea426ddf659dfda3eb9cba890de5468
[ "FTL" ]
1
2017-10-15T07:25:41.000Z
2017-10-15T07:25:41.000Z
// construction/destruction: template<class TSig, class TPar> rsLinkwitzRileyCrossOver<TSig, TPar>::rsLinkwitzRileyCrossOver(int newMaxButterworthOrder) : lowpass1(newMaxButterworthOrder/2) , lowpass2(newMaxButterworthOrder/2) , sumAllpass(newMaxButterworthOrder/2) { rsAssert( newMaxButterworthOrder >= 1 ); // filter of zero or negative order? no such thing! maxButterworthOrder = newMaxButterworthOrder; sampleRate = 44100.0; crossoverFrequency = 1000.0; butterworthOrder = rsMin(2, maxButterworthOrder); updateFilterCoefficients(); } // setup: template<class TSig, class TPar> void rsLinkwitzRileyCrossOver<TSig, TPar>::setSampleRate(TPar newSampleRate) { if( newSampleRate > 0.0 && newSampleRate != sampleRate ) { sampleRate = newSampleRate; updateFilterCoefficients(); } } template<class TSig, class TPar> void rsLinkwitzRileyCrossOver<TSig, TPar>::setCrossoverFrequency(TPar newCrossoverFrequency) { if( newCrossoverFrequency <= 20000.0 ) crossoverFrequency = newCrossoverFrequency; updateFilterCoefficients(); } template<class TSig, class TPar> void rsLinkwitzRileyCrossOver<TSig, TPar>::setSlope(int newSlope) { rsAssert( newSlope%12 == 0 && newSlope >= 12 ); // slope must be a multiple of 12 dB/oct setButterworthOrder(newSlope/12); } template<class TSig, class TPar> void rsLinkwitzRileyCrossOver<TSig, TPar>::setButterworthOrder(int newOrder) { if( newOrder >= 1 && newOrder <= maxButterworthOrder ) butterworthOrder = newOrder; updateFilterCoefficients(); } // inquiry: template<class TSig, class TPar> void rsLinkwitzRileyCrossOver<TSig, TPar>::getLowpassMagnitudeResponse(TPar* frequencies, TPar* magnitudes, int numBins, bool inDecibels, bool accumulate) { if( accumulate == false ) { if( inDecibels == true ) rsArrayTools::fillWithValue(magnitudes, numBins, TPar(0)); else rsArrayTools::fillWithValue(magnitudes, numBins, TPar(1)); } lowpass1.getMagnitudeResponse(frequencies, sampleRate, magnitudes, numBins, true, true); lowpass2.getMagnitudeResponse(frequencies, sampleRate, magnitudes, numBins, true, true); } template<class TSig, class TPar> void rsLinkwitzRileyCrossOver<TSig, TPar>::getLowpassFrequencyResponse(TPar* frequencies, Complex* H, int numBins, bool accumulate) { if( accumulate == false ) rsArrayTools::fillWithValue(H, numBins, Complex(1.0)); TPar* w = new TPar[numBins]; rsArrayTools::copy(frequencies, w, numBins); rsArrayTools::scale(w, w, numBins, TPar(2*PI)/sampleRate); lowpass1.getFrequencyResponse(w, H, numBins, rsFilterAnalyzer<TPar>::MULTIPLICATIVE_ACCUMULATION); lowpass2.getFrequencyResponse(w, H, numBins, rsFilterAnalyzer<TPar>::MULTIPLICATIVE_ACCUMULATION); delete[] w; } template<class TSig, class TPar> void rsLinkwitzRileyCrossOver<TSig, TPar>::getHighpassMagnitudeResponse(TPar* frequencies, TPar* magnitudes, int numBins, bool inDecibels, bool accumulate) { Complex* H = new Complex[numBins]; getHighpassFrequencyResponse(frequencies, H, numBins, false); if( accumulate == true ) { if( inDecibels == true ) { for(int k=0; k<numBins; k++) magnitudes[k] += rsAmpToDb(abs(H[k])); } else { for(int k=0; k<numBins; k++) magnitudes[k] *= abs(H[k]); }} else { if( inDecibels == true ) { for(int k=0; k<numBins; k++) magnitudes[k] = rsAmpToDb(abs(H[k])); } else { for(int k=0; k<numBins; k++) magnitudes[k] = abs(H[k]); }} delete[] H; } template<class TSig, class TPar> void rsLinkwitzRileyCrossOver<TSig, TPar>::getHighpassFrequencyResponse(TPar* frequencies, Complex* H, int numBins, bool accumulate) { TPar* w = new TPar[numBins]; rsArrayTools::copy(frequencies, w, numBins); rsArrayTools::scale(w, w, numBins, TPar(2*PI)/sampleRate); Complex *tmpLowpass = new Complex[numBins]; getLowpassFrequencyResponse(frequencies, tmpLowpass, numBins, false); Complex *tmpAllpass = new Complex[numBins]; sumAllpass.getFrequencyResponse(w, tmpAllpass, numBins); if( accumulate == false ) rsArrayTools::subtract(tmpAllpass, tmpLowpass, H, numBins); else { rsArrayTools::subtract(tmpAllpass, tmpLowpass, tmpAllpass, numBins); // tmpAllpass is now the highpass-response rsArrayTools::multiply(H, tmpAllpass, H, numBins); } delete[] tmpLowpass; delete[] tmpAllpass; delete[] w; } // others: template<class TSig, class TPar> void rsLinkwitzRileyCrossOver<TSig, TPar>::resetBuffers() { lowpass1.reset(); lowpass2.reset(); sumAllpass.reset(); } template<class TSig, class TPar> void rsLinkwitzRileyCrossOver<TSig, TPar>::updateFilterCoefficients() { // create and set up a filter-designer object: rsInfiniteImpulseResponseDesigner<TPar> designer; designer.setSampleRate(sampleRate); designer.setApproximationMethod(rsPrototypeDesigner<TPar>::BUTTERWORTH); designer.setPrototypeOrder(butterworthOrder); designer.setFrequency(crossoverFrequency); // \todo keep this object around as a member to avoid unnecessary re-calculations of the // prototype poles // design the lowpasses: designer.setMode(rsInfiniteImpulseResponseDesigner<TPar>::LOWPASS); lowpass1.setOrder(butterworthOrder); designer.getBiquadCascadeCoefficients(lowpass1.getAddressB0(), lowpass1.getAddressB1(), lowpass1.getAddressB2(), lowpass1.getAddressA1(), lowpass1.getAddressA2() ); lowpass2.copySettingsFrom(&lowpass1); // obtain the allpass: sumAllpass.copySettingsFrom(&lowpass1); sumAllpass.turnIntoAllpass(); }
32.517647
115
0.736975
elanhickler
0660fe7a5210c46634ca4e61d9a59a5914eb74b4
4,473
cpp
C++
Solutions-Xtreme-14/rescue_mission.cpp
nullpointxr/HackerRankSolutions
052c9ab66bfd66268b81d8e7888c3d7504ab988f
[ "Apache-2.0" ]
1
2020-10-25T16:12:09.000Z
2020-10-25T16:12:09.000Z
Solutions-Xtreme-14/rescue_mission.cpp
abhishek-sankar/Competitive-Coding-Solutions
052c9ab66bfd66268b81d8e7888c3d7504ab988f
[ "Apache-2.0" ]
3
2020-11-12T05:44:24.000Z
2021-04-05T08:09:01.000Z
Solutions-Xtreme-14/rescue_mission.cpp
nullpointxr/HackerRankSolutions
052c9ab66bfd66268b81d8e7888c3d7504ab988f
[ "Apache-2.0" ]
null
null
null
/* A group of Xtreme soldiers are fighting a tough war but are unfortunately trapped within the enemy territory. But don't worry, they managed to find NN hideouts along a long battle line. The hideouts are numbered 11 to NN. Initially there are S_iS ​i ​​ soldiers at hideout ii. There is a safe rendezvous location. Each hideout has one path to the rendezvous location. However, since the enemies are heavily patrolling the area, that path between the rendezvous location and hideout ii cannot be taken unless the weather around hideout ii is foggy. You are planning a rescue mission to safely evacuate these soldiers in the next DD days. You are able to forecast that on day ii, the hideouts numbered L_i, L_i+1, ...R_{i}L ​i ​​ ,L ​i ​​ +1,...R ​i ​​ will have foggy weather, and will be able to gather at the rendevouz location. You will send a vehicle that can evacuate V_iV ​i ​​ soldiers. The remaining soldiers must go back to the hideouts. The soldiers do not necessarily need to go back to the hideout where they came from. Instead, they can go to any hideout with a number between L_iL ​i ​​ and R_iR ​i ​​ . Each hideout may have an arbitrary number of soldiers at any time, including zero. If you coordinate the movements of the soldiers carefully, what is the maximum total number of soldiers you can evacuate? Standard input There is a single integer NN on the first line, the number of hideouts. The second line has NN integer. The ii-th integer is S_iS ​i ​​ . The next line has a single integer DD, the number of days. Each of the next DD lines has three integers L_iL ​i ​​ , R_iR ​i ​​ , and V_iV ​i ​​ . They indicate that on day ii hideouts L_i, L_i+1, ... R_iL ​i ​​ ,L ​i ​​ +1,...R ​i ​​ will have foggy weather, and you will send a vehicle to the rendezvous location that can evacuate V_iV ​i ​​ soldiers from these hideouts. Standard output Output the maximum total number of soldiers you can evacuate. Constraints and notes 1 \leq N \leq 10^51≤N≤10 ​5 ​​ 0 \leq S_i \leq 10^40≤S ​i ​​ ≤10 ​4 ​​ 1 \leq D \leq 5\,0001≤D≤5000 1 \leq L_i \leq R_i \leq N1≤L ​i ​​ ≤R ​i ​​ ≤N 1 \leq V_i \leq 10^91≤V ​i ​​ ≤10 ​9 ​​ For 30\%30% of the test data, D \leq 50D≤50 and N \leq 50N≤50. For 60\%60% of the test data, D \leq 50D≤50. Input Output Explanation 4 5 4 3 2 4 1 2 4 1 1 3 2 4 1 3 3 4 12 At the beginning, the number of soldiers at the hideouts are [5, 4, 3, 2][5,4,3,2]. On day 11, there are 99 soldiers from hideout 11 and 22 that can be evacuated. The vehicle takes 44, and the 33 of the 55 remaining soldiers can go to hideout 11 to wait for the vehicle on day 22. The other 22 remaining soldiers go to hideout 22. The number of soldiers at the hideouts are therefore [3, 2, 3, 2][3,2,3,2]. After day 22, the numbers become [0, 2, 3, 2][0,2,3,2]. On day 33, we can evacuate one solder from hideout 22, and let the other soldier there go to hideout 33. The numbers of soldiers at the hideouts become [0, 0, 4, 2][0,0,4,2]. On the last day, the 44 soldiers at hideout 33 will be evacuated. 3 7 8 7 6 1 2 1 2 3 1 3 3 9 2 3 1 1 2 1 1 1 9 22 At the beginning, we have [7, 8, 7][7,8,7] soldiers. In the first two days, two soldiers can be evacuated, and at the same time all soldiers can move to hideout 33, getting [0, 0, 20][0,0,20] by the end of day 22. On day 33 we can evacuate 99 soldiers, getting [0, 0, 11][0,0,11]. Then on day 44 and 55 two soldiers can be evacuated, and at the same time all soldiers can move to hideout 11, getting [9, 0, 0][9,0,0]. On the last day all the remaining soldiers can be evacuated. */ #include <bits/stdc++.h> using namespace std; typedef long long int ll; int main(){ int n; cin >> n; vector<int> soldierCount; for (int i = 0; i < n; i++){ int x; cin >> x; soldierCount.push_back(x); } int d; cin >> d; vector<int> left; vector<int> right; vector<int> rescueLimit; int res = 0; for (int i = 0; i < d; i++){ int l, r, v; cin >> l >> r >> v; left.push_back(l); right.push_back(r); rescueLimit.push_back(v); res += v; } res -= rescueLimit[0]; int maxRescued = soldierCount[left[0]-1]; for (int i = left[0]-1; i < right[0]; i++){ maxRescued = maxRescued < soldierCount[i]? soldierCount[i]:maxRescued; } int rescuedFirst = rescueLimit[0] < maxRescued? rescueLimit[0]:maxRescued; res += rescuedFirst; cout << res; return 0; }
31.5
703
0.68254
nullpointxr
06681c63c76fc6d3901fdd01476bceea74e2a3a2
10,214
cpp
C++
WebKit2-7606.2.104.1.1/WebKit2-7606.2.104.1.1/WebProcess/WebPage/win/WebPageWin.cpp
mlcldh/appleWebKit2
39cc42a4710c9319c8da269621844493ab2ccdd6
[ "MIT" ]
1
2021-05-27T07:29:31.000Z
2021-05-27T07:29:31.000Z
WebKit2-7606.2.104.1.1/WebKit2-7606.2.104.1.1/WebProcess/WebPage/win/WebPageWin.cpp
mlcldh/appleWebKit2
39cc42a4710c9319c8da269621844493ab2ccdd6
[ "MIT" ]
null
null
null
WebKit2-7606.2.104.1.1/WebKit2-7606.2.104.1.1/WebProcess/WebPage/win/WebPageWin.cpp
mlcldh/appleWebKit2
39cc42a4710c9319c8da269621844493ab2ccdd6
[ "MIT" ]
null
null
null
/* * Copyright (C) 2010 Apple Inc. All rights reserved. * Copyright (C) 2017 Sony Interactive Entertainment Inc. * * 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. * * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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 "config.h" #include "WebPage.h" #include "EditorState.h" #include "WebEvent.h" #include "WebFrame.h" #include "WebPageProxyMessages.h" #include "WebProcess.h" #include <WebCore/BackForwardController.h> #include <WebCore/Editor.h> #include <WebCore/EventHandler.h> #include <WebCore/EventNames.h> #include <WebCore/FocusController.h> #include <WebCore/Frame.h> #include <WebCore/FrameView.h> #include <WebCore/KeyboardEvent.h> #include <WebCore/NotImplemented.h> #include <WebCore/Page.h> #include <WebCore/PlatformKeyboardEvent.h> #include <WebCore/Settings.h> #include <WebCore/SharedBuffer.h> #include <WebCore/UserAgent.h> #include <WebCore/WindowsKeyboardCodes.h> using namespace WebCore; namespace WebKit { void WebPage::platformInitialize() { } void WebPage::platformDetach() { } void WebPage::platformEditorState(Frame& frame, EditorState& result, IncludePostLayoutDataHint shouldIncludePostLayoutData) const { } bool WebPage::performDefaultBehaviorForKeyEvent(const WebKeyboardEvent& keyboardEvent) { if (keyboardEvent.type() != WebEvent::KeyDown && keyboardEvent.type() != WebEvent::RawKeyDown) return false; switch (keyboardEvent.windowsVirtualKeyCode()) { case VK_SPACE: scroll(m_page.get(), keyboardEvent.shiftKey() ? ScrollUp : ScrollDown, ScrollByPage); break; case VK_LEFT: scroll(m_page.get(), ScrollLeft, ScrollByLine); break; case VK_RIGHT: scroll(m_page.get(), ScrollRight, ScrollByLine); break; case VK_UP: scroll(m_page.get(), ScrollUp, ScrollByLine); break; case VK_DOWN: scroll(m_page.get(), ScrollDown, ScrollByLine); break; case VK_HOME: scroll(m_page.get(), ScrollUp, ScrollByDocument); break; case VK_END: scroll(m_page.get(), ScrollDown, ScrollByDocument); break; case VK_PRIOR: scroll(m_page.get(), ScrollUp, ScrollByPage); break; case VK_NEXT: scroll(m_page.get(), ScrollDown, ScrollByPage); break; default: return false; } return true; } bool WebPage::platformCanHandleRequest(const ResourceRequest&) { notImplemented(); return false; } String WebPage::platformUserAgent(const URL& url) const { if (url.isNull() || !m_page->settings().needsSiteSpecificQuirks()) return String(); return WebCore::standardUserAgentForURL(url); } static const unsigned CtrlKey = 1 << 0; static const unsigned AltKey = 1 << 1; static const unsigned ShiftKey = 1 << 2; struct KeyDownEntry { unsigned virtualKey; unsigned modifiers; const char* name; }; struct KeyPressEntry { unsigned charCode; unsigned modifiers; const char* name; }; static const KeyDownEntry keyDownEntries[] = { { VK_LEFT, 0, "MoveLeft" }, { VK_LEFT, ShiftKey, "MoveLeftAndModifySelection" }, { VK_LEFT, CtrlKey, "MoveWordLeft" }, { VK_LEFT, CtrlKey | ShiftKey, "MoveWordLeftAndModifySelection" }, { VK_RIGHT, 0, "MoveRight" }, { VK_RIGHT, ShiftKey, "MoveRightAndModifySelection" }, { VK_RIGHT, CtrlKey, "MoveWordRight" }, { VK_RIGHT, CtrlKey | ShiftKey, "MoveWordRightAndModifySelection" }, { VK_UP, 0, "MoveUp" }, { VK_UP, ShiftKey, "MoveUpAndModifySelection" }, { VK_PRIOR, ShiftKey, "MovePageUpAndModifySelection" }, { VK_DOWN, 0, "MoveDown" }, { VK_DOWN, ShiftKey, "MoveDownAndModifySelection" }, { VK_NEXT, ShiftKey, "MovePageDownAndModifySelection" }, { VK_PRIOR, 0, "MovePageUp" }, { VK_NEXT, 0, "MovePageDown" }, { VK_HOME, 0, "MoveToBeginningOfLine" }, { VK_HOME, ShiftKey, "MoveToBeginningOfLineAndModifySelection" }, { VK_HOME, CtrlKey, "MoveToBeginningOfDocument" }, { VK_HOME, CtrlKey | ShiftKey, "MoveToBeginningOfDocumentAndModifySelection" }, { VK_END, 0, "MoveToEndOfLine" }, { VK_END, ShiftKey, "MoveToEndOfLineAndModifySelection" }, { VK_END, CtrlKey, "MoveToEndOfDocument" }, { VK_END, CtrlKey | ShiftKey, "MoveToEndOfDocumentAndModifySelection" }, { VK_BACK, 0, "DeleteBackward" }, { VK_BACK, ShiftKey, "DeleteBackward" }, { VK_DELETE, 0, "DeleteForward" }, { VK_BACK, CtrlKey, "DeleteWordBackward" }, { VK_DELETE, CtrlKey, "DeleteWordForward" }, { 'B', CtrlKey, "ToggleBold" }, { 'I', CtrlKey, "ToggleItalic" }, { VK_ESCAPE, 0, "Cancel" }, { VK_OEM_PERIOD, CtrlKey, "Cancel" }, { VK_TAB, 0, "InsertTab" }, { VK_TAB, ShiftKey, "InsertBacktab" }, { VK_RETURN, 0, "InsertNewline" }, { VK_RETURN, CtrlKey, "InsertNewline" }, { VK_RETURN, AltKey, "InsertNewline" }, { VK_RETURN, ShiftKey, "InsertNewline" }, { VK_RETURN, AltKey | ShiftKey, "InsertNewline" }, // It's not quite clear whether clipboard shortcuts and Undo/Redo should be handled // in the application or in WebKit. We chose WebKit. { 'C', CtrlKey, "Copy" }, { 'V', CtrlKey, "Paste" }, { 'X', CtrlKey, "Cut" }, { 'A', CtrlKey, "SelectAll" }, { VK_INSERT, CtrlKey, "Copy" }, { VK_DELETE, ShiftKey, "Cut" }, { VK_INSERT, ShiftKey, "Paste" }, { 'Z', CtrlKey, "Undo" }, { 'Z', CtrlKey | ShiftKey, "Redo" }, }; static const KeyPressEntry keyPressEntries[] = { { '\t', 0, "InsertTab" }, { '\t', ShiftKey, "InsertBacktab" }, { '\r', 0, "InsertNewline" }, { '\r', CtrlKey, "InsertNewline" }, { '\r', AltKey, "InsertNewline" }, { '\r', ShiftKey, "InsertNewline" }, { '\r', AltKey | ShiftKey, "InsertNewline" }, }; const char* WebPage::interpretKeyEvent(const WebCore::KeyboardEvent* evt) { ASSERT(evt->type() == eventNames().keydownEvent || evt->type() == eventNames().keypressEvent); static HashMap<int, const char*>* keyDownCommandsMap = 0; static HashMap<int, const char*>* keyPressCommandsMap = 0; if (!keyDownCommandsMap) { keyDownCommandsMap = new HashMap<int, const char*>; keyPressCommandsMap = new HashMap<int, const char*>; for (size_t i = 0; i < WTF_ARRAY_LENGTH(keyDownEntries); ++i) keyDownCommandsMap->set(keyDownEntries[i].modifiers << 16 | keyDownEntries[i].virtualKey, keyDownEntries[i].name); for (size_t i = 0; i < WTF_ARRAY_LENGTH(keyPressEntries); ++i) keyPressCommandsMap->set(keyPressEntries[i].modifiers << 16 | keyPressEntries[i].charCode, keyPressEntries[i].name); } unsigned modifiers = 0; if (evt->shiftKey()) modifiers |= ShiftKey; if (evt->altKey()) modifiers |= AltKey; if (evt->ctrlKey()) modifiers |= CtrlKey; if (evt->type() == eventNames().keydownEvent) { int mapKey = modifiers << 16 | evt->keyCode(); return mapKey ? keyDownCommandsMap->get(mapKey) : 0; } int mapKey = modifiers << 16 | evt->charCode(); return mapKey ? keyPressCommandsMap->get(mapKey) : 0; } bool WebPage::handleEditingKeyboardEvent(WebCore::KeyboardEvent* event) { auto* frame = downcast<Node>(event->target())->document().frame(); ASSERT(frame); auto* keyEvent = event->underlyingPlatformEvent(); if (!keyEvent || keyEvent->isSystemKey()) // Do not treat this as text input if it's a system key event. return false; auto command = frame->editor().command(interpretKeyEvent(event)); if (keyEvent->type() == PlatformEvent::RawKeyDown) { // WebKit doesn't have enough information about mode to decide // how commands that just insert text if executed via Editor // should be treated, so we leave it upon WebCore to either // handle them immediately (e.g. Tab that changes focus) or // let a keypress event be generated (e.g. Tab that inserts a // Tab character, or Enter). return !command.isTextInsertion() && command.execute(event); } if (command.execute(event)) return true; // Don't insert null or control characters as they can result in unexpected behaviour. if (event->charCode() < ' ') return false; return frame->editor().insertText(keyEvent->text(), event); } } // namespace WebKit
37.413919
129
0.626591
mlcldh
066c763f94b64087c0e4741c150b490d90a918c9
10,739
cpp
C++
unit_tests/test_classes/static_function.cpp
SoapyMan/oolua
9d25a865b05bbb6aaff56726b46e5b746572e490
[ "MIT" ]
4
2018-12-19T09:30:24.000Z
2021-06-26T05:38:11.000Z
unit_tests/test_classes/static_function.cpp
SoapyMan/oolua
9d25a865b05bbb6aaff56726b46e5b746572e490
[ "MIT" ]
null
null
null
unit_tests/test_classes/static_function.cpp
SoapyMan/oolua
9d25a865b05bbb6aaff56726b46e5b746572e490
[ "MIT" ]
2
2017-03-28T18:38:30.000Z
2018-10-17T19:01:05.000Z
# include "oolua_tests_pch.h" # include "oolua.h" # include "common_cppunit_headers.h" # include "expose_static_and_c_functions.h" # include "expose_hierarchy.h" int returns_stack_count(lua_State* vm) { int top = lua_gettop(vm); OOLUA::push(vm, top); return 1; } int stack_top_type(lua_State* vm) { int top = lua_type(vm, -1); OOLUA::push(vm, top); return 1; } namespace { int static_func_base_return(0); int static_func_derived_return(1); } // namespace int staticFunction_pushes0(lua_State* vm) { OOLUA::push(vm, static_func_base_return); return 1; } int staticFunction_pushes1(lua_State* vm) { OOLUA::push(vm, static_func_derived_return); return 1; } struct DerivedClassHasStaticFunction : public ClassHasStaticFunction { }; OOLUA_PROXY(DerivedClassHasStaticFunction, ClassHasStaticFunction) OOLUA_PROXY_END OOLUA_EXPORT_NO_FUNCTIONS(DerivedClassHasStaticFunction) class StaticFunction : public CppUnit::TestFixture { CPPUNIT_TEST_SUITE(StaticFunction); CPPUNIT_TEST(staticFunc_functionIsRegisteredUsingScript_callReturnsTrue); CPPUNIT_TEST(staticFunc_functionIsRegisteredUsingOOLua_callReturnsTrue); CPPUNIT_TEST(staticFunc_generatedProxy_callReturnsTrue); CPPUNIT_TEST(cFunctionAddedToClassTable_calledWithObjectInstaceAndReturnsStackCountOnEntry_returnEqualsZero); CPPUNIT_TEST(cFunctionAddedToClassTable_calledAsStaticFunctionAndReturnsStackCountOnEntry_returnEqualsZero); CPPUNIT_TEST(cFunctionAddedToClassTable_calledOnObjectInstaceWithFloatParamReturnsStackTypeOfTop_returnEqualsNumber); CPPUNIT_TEST(cFunctionAddedToClassTable_calledAsStaticFunctionWithFloatParamReturnsStackTypeOfTop_returnEqualsNumber); CPPUNIT_TEST(cFunctionAddedToClassTable_calledOnObjectInstaceWithFloatParamReturnsOneTypeOnStack_SecondReturnIsNil); CPPUNIT_TEST(cFunctionAddedToClassTable_calledProxyStaticWithObjectInstaceAndInputInt_returnEqualsInput); CPPUNIT_TEST(staticFunction_addedToBaseCalledInDerived_callReturnsTrue); CPPUNIT_TEST(staticFunction_addedToBaseOverriddenInDerived_callsDerivedVersion); CPPUNIT_TEST(staticFunction_addedToBaseInLuaAndCalledFromDerivedClassName_callReturnsTrue); CPPUNIT_TEST(staticData_addedOnBaseInLuaOnBase_calledOnDerived_callReturnsTrue); CPPUNIT_TEST(staticData_addedOnBaseInLuaOnBase_calledOnDerived_resultIsSetValue); #if OOLUA_STORE_LAST_ERROR == 1 CPPUNIT_TEST(staticFunc_functionIsUnregistered_callReturnsFalse); #endif #if OOLUA_USE_EXCEPTIONS == 1 CPPUNIT_TEST(staticFunc_functionIsUnregistered_throwsRuntimeError); #endif CPPUNIT_TEST_SUITE_END(); OOLUA::Script* m_lua; public: void setUp() { m_lua = new OOLUA::Script; m_lua->register_class<ClassHasStaticFunction>(); } void tearDown() { delete m_lua; } void staticFunc_functionIsRegisteredUsingScript_callReturnsTrue() { m_lua->register_class_static<ClassHasStaticFunction>("static_function" , &oolua_ClassHasStaticFunction_static_function); m_lua->run_chunk("foo = function() " "ClassHasStaticFunction.static_function() " "end "); bool result = m_lua->call("foo"); CPPUNIT_ASSERT_EQUAL(true, result); } void staticFunc_functionIsRegisteredUsingOOLua_callReturnsTrue() { OOLUA::register_class_static<ClassHasStaticFunction>(*m_lua , "static_function" , &oolua_ClassHasStaticFunction_static_function); m_lua->run_chunk("foo = function() " "ClassHasStaticFunction.static_function() " "end "); bool result = m_lua->call("foo"); CPPUNIT_ASSERT_EQUAL(true, result); } void staticFunc_generatedProxy_callReturnsTrue() { OOLUA::register_class_static<ClassHasStaticFunction>(*m_lua , "static_function" , &oolua_ClassHasStaticFunction_static_function); m_lua->run_chunk("foo = function() " "ClassHasStaticFunction.static_function() " "end "); bool result = m_lua->call("foo"); CPPUNIT_ASSERT_EQUAL(true, result); } void cFunctionAddedToClassTable_calledWithObjectInstaceAndReturnsStackCountOnEntry_returnEqualsZero() { OOLUA::register_class_static<ClassHasStaticFunction>(*m_lua , "stack_count" , &returns_stack_count); m_lua->run_chunk("foo = function(obj) " "return obj.stack_count() " "end "); ClassHasStaticFunction stack; ClassHasStaticFunction* obj = &stack; m_lua->call("foo", obj); int result(-1); OOLUA::pull(*m_lua, result); CPPUNIT_ASSERT_EQUAL(int(0), result); //NOLINT(readability/casting) } void cFunctionAddedToClassTable_calledAsStaticFunctionAndReturnsStackCountOnEntry_returnEqualsZero() { OOLUA::register_class_static<ClassHasStaticFunction>(*m_lua , "stack_count" , &returns_stack_count); m_lua->run_chunk("foo = function() " "return ClassHasStaticFunction.stack_count() " "end "); m_lua->call("foo"); int result(-1); OOLUA::pull(*m_lua, result); CPPUNIT_ASSERT_EQUAL(int(0), result); //NOLINT(readability/casting) } void cFunctionAddedToClassTable_calledOnObjectInstaceWithFloatParamReturnsStackTypeOfTop_returnEqualsNumber() { OOLUA::register_class_static<ClassHasStaticFunction>(*m_lua , "stack_top_type" , &stack_top_type); m_lua->run_chunk("foo = function(obj) " "return obj.stack_top_type(1.0) " "end "); ClassHasStaticFunction stack; ClassHasStaticFunction* obj = &stack; m_lua->call("foo", obj); int result(-1); OOLUA::pull(*m_lua, result); CPPUNIT_ASSERT_EQUAL(int(LUA_TNUMBER), result); //NOLINT(readability/casting) } void cFunctionAddedToClassTable_calledAsStaticFunctionWithFloatParamReturnsStackTypeOfTop_returnEqualsNumber() { OOLUA::register_class_static<ClassHasStaticFunction>(*m_lua , "stack_top_type" , &stack_top_type); m_lua->run_chunk("foo = function() " "return ClassHasStaticFunction.stack_top_type(1.0) " "end "); m_lua->call("foo"); int result(-1); OOLUA::pull(*m_lua, result); CPPUNIT_ASSERT_EQUAL(int(LUA_TNUMBER), result); //NOLINT(readability/casting) } void cFunctionAddedToClassTable_calledOnObjectInstaceWithFloatParamReturnsOneTypeOnStack_SecondReturnIsNil() { OOLUA::register_class_static<ClassHasStaticFunction>(*m_lua , "stack_top_type" , &stack_top_type); m_lua->run_chunk("foo = function(obj) " "a,b =obj.stack_top_type(1.0) " "assert(b == nil) " "end "); ClassHasStaticFunction stack; ClassHasStaticFunction* obj = &stack; bool result =m_lua->call("foo", obj); CPPUNIT_ASSERT_EQUAL(true, result); } void cFunctionAddedToClassTable_calledProxyStaticWithObjectInstaceAndInputInt_returnEqualsInput() { /*[ClassStaticFunctionUsage]*/ m_lua->register_class_static<ClassHasStaticFunction>("returns_input", &OOLUA::Proxy_class<ClassHasStaticFunction>::returns_input); m_lua->run_chunk("foo = function(obj, input) " "return obj.returns_input(input) " "end "); /*[ClassStaticFunctionUsage]*/ ClassHasStaticFunction stack; ClassHasStaticFunction* obj = &stack; int input = 1; m_lua->call("foo", obj, input); int result(-1); OOLUA::pull(*m_lua, result); CPPUNIT_ASSERT_EQUAL(input, result); } void staticFunction_registeredInBaseCalledInDerived_resultReturnsTrue() { OOLUA::register_class<DerivedClassHasStaticFunction>(*m_lua); m_lua->register_class_static<ClassHasStaticFunction>("stack_count" , &returns_stack_count); m_lua->run_chunk("foo = function(obj) " "return obj.stack_count() " "end "); DerivedClassHasStaticFunction derived; DerivedClassHasStaticFunction* dp = &derived; bool result = m_lua->call("foo", dp); CPPUNIT_ASSERT_EQUAL(result, true); } void staticFunction_addedToBaseCalledInDerived_callReturnsTrue() { OOLUA::register_class<DerivedFromTwoAbstractBasesAndAbstract3>(*m_lua); m_lua->register_class_static<Abstract3>("stack_count", &returns_stack_count); m_lua->run_chunk("foo = function(obj) " "return obj.stack_count() " "end "); DerivedFromTwoAbstractBasesAndAbstract3 derived; bool result = m_lua->call("foo", &derived); CPPUNIT_ASSERT_EQUAL(result, true); } void staticFunction_addedToBaseOverriddenInDerived_callsDerivedVersion() { OOLUA::register_class<DerivedFromTwoAbstractBasesAndAbstract3>(*m_lua); m_lua->register_class_static<Abstract3>("static_func", &staticFunction_pushes0); m_lua->register_class_static<DerivedFromTwoAbstractBasesAndAbstract3>("static_func", &staticFunction_pushes1); m_lua->run_chunk("foo = function(obj) " "return obj.static_func() " "end "); DerivedFromTwoAbstractBasesAndAbstract3 derived; m_lua->call("foo", &derived); int result; OOLUA::pull(*m_lua, result); CPPUNIT_ASSERT_EQUAL(static_func_derived_return, result); } void staticFunction_addedToBaseInLuaAndCalledFromDerivedClassName_callReturnsTrue() { OOLUA::register_class<DerivedFromTwoAbstractBasesAndAbstract3>(*m_lua); m_lua->run_chunk("function Abstract3:lua_func() return 1 end "); m_lua->run_chunk("foo = function() " "return DerivedFromTwoAbstractBasesAndAbstract3.lua_func() " "end "); bool result = m_lua->call("foo"); CPPUNIT_ASSERT_EQUAL(result, true); } void staticData_addedOnBaseInLuaOnBase_calledOnDerived_callReturnsTrue() { OOLUA::register_class<DerivedFromTwoAbstractBasesAndAbstract3>(*m_lua); m_lua->run_chunk("Abstract3[\"static_data\"] = 1 "); m_lua->run_chunk("foo = function() " "return DerivedFromTwoAbstractBasesAndAbstract3.static_data " "end "); bool result = m_lua->call("foo"); CPPUNIT_ASSERT_EQUAL(result, true); } void staticData_addedOnBaseInLuaOnBase_calledOnDerived_resultIsSetValue() { OOLUA::register_class<DerivedFromTwoAbstractBasesAndAbstract3>(*m_lua); m_lua->run_chunk("Abstract3[\"static_data\"] = 1 "); m_lua->run_chunk("foo = function() " "return DerivedFromTwoAbstractBasesAndAbstract3.static_data " "end "); m_lua->call("foo"); int result; OOLUA::pull(*m_lua, result); CPPUNIT_ASSERT_EQUAL(int(1), result); //NOLINT(readability/casting) } #if OOLUA_STORE_LAST_ERROR == 1 void staticFunc_functionIsUnregistered_callReturnsFalse() { m_lua->run_chunk("foo = function() " "ClassHasStaticFunction.static_function() " "end "); bool result = m_lua->call("foo"); CPPUNIT_ASSERT_EQUAL(false, result); } #endif #if OOLUA_USE_EXCEPTIONS == 1 void staticFunc_functionIsUnregistered_throwsRuntimeError() { m_lua->run_chunk("foo = function() " "ClassHasStaticFunction.static_function() " "end "); CPPUNIT_ASSERT_THROW(m_lua->call("foo"), OOLUA::Runtime_error); } #endif }; CPPUNIT_TEST_SUITE_REGISTRATION(StaticFunction);
32.056716
119
0.758078
SoapyMan
066d89604efb26b5403a5c83a712311482fbffad
2,103
cpp
C++
src/main/cpp/Components/EncoderItem.cpp
JamesTerm/FRC2019
2794d3cc4f2b4702c59e402904db2f4cdc2ab68d
[ "BSD-3-Clause" ]
1
2021-11-12T04:34:31.000Z
2021-11-12T04:34:31.000Z
src/main/cpp/Components/EncoderItem.cpp
JamesTerm/FRC2019
2794d3cc4f2b4702c59e402904db2f4cdc2ab68d
[ "BSD-3-Clause" ]
null
null
null
src/main/cpp/Components/EncoderItem.cpp
JamesTerm/FRC2019
2794d3cc4f2b4702c59e402904db2f4cdc2ab68d
[ "BSD-3-Clause" ]
null
null
null
/****************************** Header ******************************\ Class Name: EncoderItem inherits InputComponent File Name: EncoderItem.cpp Summary: Abstraction for the WPIlib Encoder that extends to include some helper and control methods. Project: BroncBotzFRC2019 Copyright (c) BroncBotz. All rights reserved. Author(s): Dylan Watson Email: [email protected] \********************************************************************/ #include "EncoderItem.h" using namespace Components; EncoderItem::EncoderItem() {} EncoderItem::EncoderItem(string _name, int _aChannel, int _bChannel, bool _reversed, bool Real) : InputComponent(_name){ aChannel = _aChannel; bChannel = _bChannel; reversed = _reversed; encoder = new Encoder(aChannel, bChannel, reversed); FromTable(Real); Offset = OutputTable->GetNumber(name, 0); { Log::General("Using Table values"); OutputTable->PutNumber(name, 0); OutputTable->PutBoolean(name + "-Reset", true); } Type = InputType::Independent; } EncoderItem::EncoderItem(string _name, NativeComponent *Connected) : InputComponent(_name) { Type = InputType::Data_Driven; LinkedComponent = Connected; } void EncoderItem::Reset() { if(Type == InputType::Independent) { encoder->Reset(); OutputTable->PutBoolean(name + "-Reset", true); } else { if(LinkedComponent != nullptr) LinkedComponent->ResetData(); else Log::Error("Encoder " + name + " tracking nullptr!"); } } double EncoderItem::Get() { if(Type == InputType::Independent) { double input = (UseTable ? OutputTable->GetNumber(name, 0) : (double)encoder->Get()); return input - Offset; } else { if(LinkedComponent != nullptr) return LinkedComponent->GetData(); else { Log::Error("Encoder " + name + " tracking nullptr!"); return 0; } } } string EncoderItem::GetName() { return name; } void EncoderItem::DeleteComponent() { delete encoder; delete this; } void EncoderItem::UpdateComponent() { if (!UseTable && Type == InputType::Independent) { OutputTable->PutNumber(name, EncoderItem::Get()); } } EncoderItem::~EncoderItem() {}
22.136842
95
0.668093
JamesTerm
066e717e72dd604fa0057d831f02debca6893745
1,332
hpp
C++
src/utils/tb2randomgen.hpp
kad15/SandBoxToulbar2
31430ec5e6c6cec1eabe6f5d04bfb8134777821c
[ "MIT" ]
null
null
null
src/utils/tb2randomgen.hpp
kad15/SandBoxToulbar2
31430ec5e6c6cec1eabe6f5d04bfb8134777821c
[ "MIT" ]
null
null
null
src/utils/tb2randomgen.hpp
kad15/SandBoxToulbar2
31430ec5e6c6cec1eabe6f5d04bfb8134777821c
[ "MIT" ]
null
null
null
/* \file tb2randomgen.hpp * \brief Random WCSP generator. */ #ifndef TB2RANDOMGEN_H_ #define TB2RANDOMGEN_H_ #include "core/tb2wcsp.hpp" class naryRandom { public: WCSP& wcsp; naryRandom(WCSP* wcspin, int seed = 0) : wcsp(*wcspin) { mysrand(seed); } ~naryRandom() {} int n, m; bool connected(); void generateGlobalCtr(vector<int>& indexs, string globalname, Cost costMin = SMALL_COST, Cost costMax = MEDIUM_COST); void generateNaryCtr(vector<int>& indexs, long nogoods, Cost costMin = SMALL_COST, Cost costMax = MEDIUM_COST); void generateTernCtr(int i, int j, int k, long p, Cost costMin = SMALL_COST, Cost costMax = MEDIUM_COST); void generateBinCtr(int i, int j, long p, Cost costMin = SMALL_COST, Cost costMax = MEDIUM_COST); void generateSubModularBinCtr(int i, int j, Cost costMin = SMALL_COST, Cost costMax = MEDIUM_COST); void Input(int in_n, int in_m, vector<int>& p, bool forceSubModular = false, string globalname = ""); void ini(vector<int>& index, int arity); long toIndex(vector<int>& index); int inc(vector<int>& index, int i); bool inc(vector<int>& index); }; #endif /*TB2RANDOMGEN_H_*/ /* Local Variables: */ /* c-basic-offset: 4 */ /* tab-width: 4 */ /* indent-tabs-mode: nil */ /* c-default-style: "k&r" */ /* End: */
29.6
122
0.668168
kad15
066f190ad834841e01754e8751d4b23d359c2d33
2,960
cc
C++
testing/output/No_Difference_L2.cc
pgmaginot/DARK_ARTS
f04b0a30dcac911ef06fe0916921020826f5c42b
[ "MIT" ]
null
null
null
testing/output/No_Difference_L2.cc
pgmaginot/DARK_ARTS
f04b0a30dcac911ef06fe0916921020826f5c42b
[ "MIT" ]
null
null
null
testing/output/No_Difference_L2.cc
pgmaginot/DARK_ARTS
f04b0a30dcac911ef06fe0916921020826f5c42b
[ "MIT" ]
null
null
null
#include <iostream> #include <vector> #include <math.h> #include <string> #include "Input_Reader.h" #include "Materials.h" #include "Fem_Quadrature.h" #include "Quadrule_New.h" #include "Cell_Data.h" #include "Angular_Quadrature.h" #include "Time_Data.h" #include "Intensity_Data.h" #include "Intensity_Moment_Data.h" #include "Temperature_Data.h" #include "L2_Error_Calculator.h" #include "Dark_Arts_Exception.h" /** Goal of this unit test is to verify that L2 error estimate is zero when the analytic solution is within the DFEM trial space */ int main(int argc, char** argv) { int val = 0; const double tol = 1.0E-12; Input_Reader input_reader; try { input_reader.read_xml(argv[1]); } catch(const Dark_Arts_Exception& da_exception ) { da_exception.message() ; val = -1; } Quadrule_New quad_fun; Fem_Quadrature fem_quadrature( input_reader , quad_fun); Cell_Data cell_data( input_reader ); Angular_Quadrature angular_quadrature( input_reader , quad_fun ); /// Create a Materials object that contains all opacity, heat capacity, and source objects Materials materials( input_reader, fem_quadrature , cell_data, angular_quadrature ); Time_Data time_data(input_reader); Temperature_Data t_old(fem_quadrature, input_reader, cell_data); Intensity_Data i_old(cell_data, angular_quadrature, fem_quadrature, materials,input_reader); Intensity_Moment_Data phi(cell_data,angular_quadrature,fem_quadrature,i_old); try{ L2_Error_Calculator l2_error_calculator(angular_quadrature,fem_quadrature, cell_data, input_reader); const double t_eval = time_data.get_t_start(); double temperature_err = l2_error_calculator.calculate_l2_error(t_eval , t_old); double phi_err = l2_error_calculator.calculate_l2_error(t_eval , phi); std::cout << "Phi L2 err: " << phi_err << std::endl; std::cout << "Temperature L2 err: " << temperature_err << std::endl; if(fabs(phi_err) > tol) throw Dark_Arts_Exception(SUPPORT_OBJECT , "Not calculating phi zero err"); if(fabs(temperature_err) > tol) throw Dark_Arts_Exception(SUPPORT_OBJECT , "Not calculating temperature zero err"); temperature_err = l2_error_calculator.calculate_cell_avg_error(t_eval , t_old); phi_err = l2_error_calculator.calculate_cell_avg_error(t_eval , phi); std::cout << "Phi avg err: " << phi_err << std::endl; std::cout << "Temperature avg err: " << temperature_err << std::endl; if(fabs(phi_err) > tol) throw Dark_Arts_Exception(SUPPORT_OBJECT , "Not calculating phi zero err"); if(fabs(temperature_err) > tol) throw Dark_Arts_Exception(SUPPORT_OBJECT , "Not calculating temperature zero err"); } catch(const Dark_Arts_Exception& da) { val = -1; da.testing_message(); } return val; }
33.258427
127
0.696622
pgmaginot
066f8cb7c5f26c536c020d6319477436005bf824
2,751
hpp
C++
include/cppurses/widget/widgets/line_edit.hpp
buzzert/CPPurses
33c2c1719a480aefea57874e32c54b4b48ebbfa0
[ "MIT" ]
null
null
null
include/cppurses/widget/widgets/line_edit.hpp
buzzert/CPPurses
33c2c1719a480aefea57874e32c54b4b48ebbfa0
[ "MIT" ]
null
null
null
include/cppurses/widget/widgets/line_edit.hpp
buzzert/CPPurses
33c2c1719a480aefea57874e32c54b4b48ebbfa0
[ "MIT" ]
null
null
null
#ifndef CPPURSES_WIDGET_WIDGETS_LINE_EDIT_HPP #define CPPURSES_WIDGET_WIDGETS_LINE_EDIT_HPP #include <functional> #include <string> #include <signals/signals.hpp> #include <cppurses/painter/color.hpp> #include <cppurses/painter/glyph.hpp> #include <cppurses/painter/glyph_string.hpp> #include <cppurses/system/events/key.hpp> #include <cppurses/system/events/mouse.hpp> #include <cppurses/widget/widgets/textbox.hpp> namespace cppurses { struct Point; // TODO input_mask option, which shows outline of acceptable text in ghost color // ex) phone #| (___)___-____ // ip address| ___.___.___.___ // ref: webtoolkit.eu/widgets/forms/line_text-editor /// Text input box with input validator and Signal emitted on Enter Key press. /** Initial text is in ghost color and cleared on initial focus. Height is fixed * at 1. */ // TODO change to class Field. class Line_edit : public Textbox { public: /// Construct a Line_edit object with \p initial_text in ghost color. explicit Line_edit(Glyph_string initial_text = ""); /// Set the input validator, allowing or disallowing specific char types. /** The default validator always returns true, allowing all chars. Invalid * character input will result in no input being given to the Line_edit. */ void set_validator(std::function<bool(char)> validator); /// Set whether the text is cleared from the Line_edit on Enter Key press. /** This is disabled by default. */ void clear_on_enter(bool enable = true); /// Set whether the Line_edit has veilded output, doesn't alter the content. /** Disabled by default, uses '*' to veil by default. */ auto veil_text(bool enable = true) -> void; /// Set Glyph used to obscure the display. auto set_veil(const Glyph& veil) -> void { veil_ = veil; this->update(); } /// Set whether the Line_edit has an underline. /** Disabled by default. The entire length of the box is underlined if * enabled. */ void underline(bool enabled = true); /// Set color of the initial text, before focus has been given to this. void set_ghost_color(Color c); /// Emitted on Enter Key press, sends along the current contents. sig::Signal<void(std::string)> edit_finished; protected: bool key_press_event(const Key::State& keyboard) override; bool mouse_press_event(const Mouse::State& mouse) override; bool focus_in_event() override; auto paint_event() -> bool override; private: bool clear_on_enter_{false}; bool on_initial_{true}; bool is_veiled_{false}; Glyph veil_{L'*'}; std::function<bool(char)> validator_{[](char) { return true; }}; }; } // namespace cppurses #endif // CPPURSES_WIDGET_WIDGETS_LINE_EDIT_HPP
35.269231
80
0.711741
buzzert
06703241603ac3cd62a06dc30f9d9c76b7e4112c
560
hpp
C++
plugins/x11input/include/sge/x11input/device/optional_id_fwd.hpp
cpreh/spacegameengine
313a1c34160b42a5135f8223ffaa3a31bc075a01
[ "BSL-1.0" ]
2
2016-01-27T13:18:14.000Z
2018-05-11T01:11:32.000Z
plugins/x11input/include/sge/x11input/device/optional_id_fwd.hpp
cpreh/spacegameengine
313a1c34160b42a5135f8223ffaa3a31bc075a01
[ "BSL-1.0" ]
null
null
null
plugins/x11input/include/sge/x11input/device/optional_id_fwd.hpp
cpreh/spacegameengine
313a1c34160b42a5135f8223ffaa3a31bc075a01
[ "BSL-1.0" ]
3
2018-05-11T01:11:34.000Z
2021-04-24T19:47:45.000Z
// Copyright Carl Philipp Reh 2006 - 2019. // 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 SGE_X11INPUT_DEVICE_OPTIONAL_ID_FWD_HPP_INCLUDED #define SGE_X11INPUT_DEVICE_OPTIONAL_ID_FWD_HPP_INCLUDED #include <sge/x11input/device/id.hpp> #include <fcppt/optional/object_fwd.hpp> namespace sge { namespace x11input { namespace device { typedef fcppt::optional::object<sge::x11input::device::id> optional_id; } } } #endif
21.538462
71
0.757143
cpreh
0682071f42bacb335c1634d22b7e9b5d2f0a1182
4,205
cpp
C++
sum_root_to_leaf_numbers.cpp
artureganyan/algorithms
98cd0048162b3cb1c79712a884261cd3fe31063c
[ "MIT" ]
null
null
null
sum_root_to_leaf_numbers.cpp
artureganyan/algorithms
98cd0048162b3cb1c79712a884261cd3fe31063c
[ "MIT" ]
null
null
null
sum_root_to_leaf_numbers.cpp
artureganyan/algorithms
98cd0048162b3cb1c79712a884261cd3fe31063c
[ "MIT" ]
null
null
null
// Problem: https://leetcode.com/problems/sum-root-to-leaf-numbers/ #include "utils.h" namespace sum_root_to_leaf_numbers { struct TreeNode { int val; TreeNode* left; TreeNode* right; }; class Solution { public: // Note: Each node value must be within [0, 9]. Overflow of the sum is // not detected. // // Time: O(n), Space: O(h), Recursion depth <= h + 2 // n - number of nodes, h - height of the tree // int run(TreeNode* root) { return calculateSum(root).value; } private: struct Sum { int value; int multiplier; }; Sum calculateSum(TreeNode* root) const { if (!root) return {0, 0}; if (root->val < 0 || root->val > 9) throw std::runtime_error("Node value must be within [0, 9]"); Sum sum_left = calculateSum(root->left); Sum sum_right = calculateSum(root->right); Sum result; result.multiplier = std::max(sum_left.multiplier * 10 + sum_right.multiplier * 10, 1); result.value = sum_left.value + sum_right.value + root->val * result.multiplier; return result; } }; int main() { ASSERT( Solution().run(nullptr) == 0 ); ASSERT( Solution().run(TemporaryTree<TreeNode>(new TreeNode{0})) == 0 ); ASSERT( Solution().run(TemporaryTree<TreeNode>(new TreeNode{1})) == 1 ); ASSERT( Solution().run(TemporaryTree<TreeNode>(new TreeNode{9})) == 9 ); ASSERT( Solution().run( TemporaryTree<TreeNode>( new TreeNode{0, new TreeNode{1}, nullptr } )) == 1 ); ASSERT( Solution().run( TemporaryTree<TreeNode>( new TreeNode{0, new TreeNode{0, new TreeNode{1}, nullptr }, nullptr } )) == 1 ); ASSERT( Solution().run( TemporaryTree<TreeNode>( new TreeNode{1, new TreeNode{0}, nullptr } )) == 10 ); ASSERT( Solution().run( TemporaryTree<TreeNode>( new TreeNode{1, nullptr, new TreeNode{0} } )) == 10 ); ASSERT( Solution().run( TemporaryTree<TreeNode>( new TreeNode{1, new TreeNode{9}, nullptr } )) == 19 ); ASSERT( Solution().run( TemporaryTree<TreeNode>( new TreeNode{1, new TreeNode{9}, new TreeNode{1} } )) == 30 ); ASSERT( Solution().run( TemporaryTree<TreeNode>( new TreeNode{1, new TreeNode{9}, new TreeNode{9} } )) == 38 ); ASSERT( Solution().run( TemporaryTree<TreeNode>( new TreeNode{1, new TreeNode{2, new TreeNode{4}, new TreeNode{5} }, new TreeNode{3, new TreeNode{6}, new TreeNode{7} }, } )) == 522 ); ASSERT( Solution().run( TemporaryTree<TreeNode>( new TreeNode{1, new TreeNode{2, new TreeNode{4, new TreeNode{1, nullptr, new TreeNode{0, new TreeNode{1}, nullptr } }, nullptr }, new TreeNode{5, nullptr, new TreeNode{9} } }, new TreeNode{3, new TreeNode{6, new TreeNode{0}, new TreeNode{1} }, new TreeNode{7, new TreeNode{2}, nullptr } }, } )) == 129453 ); return 0; } }
24.881657
94
0.420452
artureganyan
0682dd7e89e56364d56a6e9df28cf276e3f98384
20,996
cpp
C++
compiler/src/ast/expr/ast_field.cpp
TuplexLanguage/tuplex
fc436c78224522663e40e09d36f83570fd76ba2d
[ "Apache-2.0" ]
15
2017-08-15T20:46:44.000Z
2021-12-15T02:51:13.000Z
compiler/src/ast/expr/ast_field.cpp
TuplexLanguage/tuplex
fc436c78224522663e40e09d36f83570fd76ba2d
[ "Apache-2.0" ]
null
null
null
compiler/src/ast/expr/ast_field.cpp
TuplexLanguage/tuplex
fc436c78224522663e40e09d36f83570fd76ba2d
[ "Apache-2.0" ]
1
2017-09-28T14:48:15.000Z
2017-09-28T14:48:15.000Z
#include "ast_field.hpp" #include "ast_constexpr.hpp" #include "ast_ref.hpp" #include "ast_conv.hpp" #include "ast/ast_util.hpp" #include "symbol/qual_type.hpp" #include "symbol/symbol_lookup.hpp" #include "parsercontext.hpp" #include "driver.hpp" #include "tx_error.hpp" TxFieldValueNode* make_compound_symbol_expression( const TxLocation& ploc, const std::string& compoundName ) { TxIdentifier ci( compoundName ); TxFieldValueNode* node = nullptr; for ( auto it = ci.segments_cbegin(); it != ci.segments_cend(); it++ ) { node = new TxFieldValueNode( ploc, node, new TxIdentifierNode( ploc, *it ) ); } return node; } int get_reinterpretation_degree( TxExpressionNode* originalExpr, const TxActualType *requiredType ) { auto originalType = originalExpr->resolve_type( TXR_FULL_RESOLUTION ); if ( *originalType == *requiredType ) { //std::cerr << "Types equal: " << originalType << " == " << requiredType << std::endl; return 0; } // TODO: check if provided type is narrower than the expected type if ( auto_converts_to( originalExpr, requiredType ) ) return 2; #ifndef NO_IMPLICIT_REF_DEREF if ( requiredType->get_type_class() == TXTC_REFERENCE ) { if ( auto expRefTargetType = requiredType->target_type() ) { if ( originalType->is_a( *expRefTargetType ) ) { if ( !expRefTargetType.is_modifiable() ) return 3; // expression will be auto-wrapped with a reference-to node } } } if ( originalType->get_type_class() == TXTC_REFERENCE ) { if ( auto provRefTargetType = originalType->target_type() ) { if ( provRefTargetType->auto_converts_to( *requiredType ) ) { return 3; // expression will be wrapped with a dereference node } } } #endif return -1; // does not match } static const TxFieldDeclaration* inner_resolve_field( const TxExpressionNode* origin, TxEntitySymbol* entitySymbol, const std::vector<TxExpressionNode*>* arguments, bool printCandidates ) { if ( !arguments ) { if ( entitySymbol->field_count() == 1 ) return entitySymbol->get_first_field_decl(); if ( entitySymbol->field_count() > 1 ) LOG_DEBUG( origin->LOGGER(), entitySymbol << " must be resolved using type parameters but none provided from " << origin ); return nullptr; } if ( entitySymbol->field_count() == 0 ) return nullptr; const TxFieldDeclaration* closestDecl = nullptr; uint64_t closestReint = UINT64_MAX; for ( auto fieldCandidateI = entitySymbol->fields_cbegin(); fieldCandidateI != entitySymbol->fields_cend(); fieldCandidateI++ ) { const TxFieldDeclaration* fieldDecl = ( *fieldCandidateI ); if ( !( fieldDecl->get_decl_flags() & TXD_EXPERROR ) ) { auto field = fieldDecl->get_definer()->resolve_field(); // first screen the fields that are of function type and take the correct number of arguments: if ( field->qtype()->get_type_class() == TXTC_FUNCTION ) { auto fieldType = field->qtype().type(); auto candArgTypes = fieldType->argument_types(); const TxActualType* arrayArgElemType = fieldType->vararg_elem_type(); if ( printCandidates ) CINFO( origin, " Candidate: " << field->get_unique_full_name() << " : " << fieldType->func_signature_str() ); if ( arrayArgElemType ) { // var-arg tail parameter accepts zero or more arguments if ( arguments->size() < candArgTypes.size() - 1 ) continue; // mismatching number of function args } else if ( auto fixedArrayArgType = fieldType->fixed_array_arg_type() ) { // fixed array parameter accepts matching number of arguments auto lenExpr = fixedArrayArgType->capacity(); auto len = eval_unsigned_int_constant( lenExpr ); if ( !( arguments->size() == 1 || arguments->size() == len ) ) continue; // mismatching number of function args arrayArgElemType = fixedArrayArgType->element_type().type(); } else if ( arguments->size() != candArgTypes.size() ) { continue; // mismatching number of function args } { // next check that the argument types match, and how close they match: uint16_t reint[4] = { 0, 0, 0, 0 }; for ( unsigned i = 0; i < arguments->size(); i++ ) { TxExpressionNode* argNode = arguments->at( i ); const TxActualType* argDef = ( arrayArgElemType && i >= candArgTypes.size() - 1 ? arrayArgElemType : candArgTypes.at( i ) ); int degree = get_reinterpretation_degree( argNode, argDef ); if ( degree < 0 ) { if ( arrayArgElemType && i == candArgTypes.size() - 1 && candArgTypes.size() == arguments->size() ) { // if last provided arg is an array of the correct type, match it against the var-arg tail if present //std::cerr << " cand-arg: " << candArgTypes.at( i ) << " prov-arg: " << argType << std::endl; degree = get_reinterpretation_degree( argNode, candArgTypes.at( i ) ); if ( degree < 0 ) goto NEXT_CANDIDATE; } else { //entitySymbol->LOGGER()->info("Argument mismatch, can't convert\n\tFrom: %80s\n\tTo: %80s", // argType->str(true).c_str(), argDef->str(true).c_str()); goto NEXT_CANDIDATE; } } reint[degree]++; } //origin->LOGGER()->trace( "Arguments match for %s: %-32s: %d, %d, %d, %d", field->str().c_str(), field->get_type()->str().c_str(), // reint[0], reint[1], reint[2], reint[3] ); uint64_t candReint = ( ( (uint64_t) reint[3] ) << 48 | ( (uint64_t) reint[2] ) << 32 | ( (uint64_t) reint[1] ) << 16 | reint[0] ); if ( candReint <= closestReint ) { if ( candReint == closestReint ) { // Note, multiple functions with the exact same signature is checked elsewhere. // If arguments for multiple "equal" top candidates are matched via reinterpretation, we just pick the first one found. // TODO: Pick the narrowest match, not the first found match //CWARNING(origin, "Ambiguous function call to " << entitySymbol->get_full_name() << ": " // << field->get_type() << ", multiple signatures match equally well " // << "[ " << reint[0] << ", " << reint[1] << ", " << reint[2] << ", " << reint[3] << " ]"); } else { closestDecl = *fieldCandidateI; closestReint = candReint; } } } } } NEXT_CANDIDATE: ; } if ( closestDecl ) { return closestDecl; } LOG_DEBUG( origin->LOGGER(), "Arguments do not match any overloaded candidate of " << entitySymbol ); return nullptr; } /** Attempts to resolve an identified entity symbol, that is potentially overloaded, * to a specific field by matching with the provided arguments' types. * The closest matching, valid field is picked. If no field matched, NULL is returned. * If a field was matched, and implicit conversions were needed for any arguments, * those conversions are inserted for those arguments within this call. * * All included fields that have the matching number of arguments and compatible argument types are candidates. * Candidate selection is done by counting the number and degree of argument reinterpretations necessary to match it. * (A single 2nd degree reinterpretation is "further away" than many 1st degree reinterpretations.) * * Degrees of reinterpretation (to be thought of as degrees of "distance"): * 0: Argument and receiver have the exact same type * 1: Argument and receiver have equivalent types (according to narrowing/widening type rules) * 2: Argument can be implicitly converted to the receiver's type (e.g. Int -> Long) * 3: Argument can be transformed via implicit operation to the receiver's type (e.g. implicit referencing) * * Generate compiler error and throws resolution exception if unsuccessful. */ static const TxFieldDeclaration* resolve_field( const TxExpressionNode* origin, TxEntitySymbol* entitySymbol, const std::vector<TxExpressionNode*>* arguments ) { if ( auto fieldDecl = inner_resolve_field( origin, entitySymbol, arguments, false ) ) { return fieldDecl; } else if ( arguments ) { // ensure arguments are resolved (doing it here ensures sensible signatures in error messages) for ( auto argNode : *arguments ) argNode->resolve_type( TXR_FULL_RESOLUTION ); // we expand the CERR_THROWRES macro here so that we can print the candidates before throwing the exception: std::stringstream msg; msg << entitySymbol->get_full_name() << " has no matching function for args: "; if ( arguments->empty() ) msg << "()"; else msg << "( " << join( attempt_typevec( arguments ), ", " ) << " )"; cerror(origin, msg.str()); inner_resolve_field( origin, entitySymbol, arguments, true ); throw resolution_error( origin, msg.str() ); // CERR_THROWRES( origin, entitySymbol->get_full_name() << " has no matching function for args: " // << "(" << join( attempt_typevec( arguments ), ", ") << ")" ); } else CERR_THROWRES( origin, entitySymbol->get_full_name() << " could not be resolved to a distinct field: " << entitySymbol->get_full_name() ); } const TxFieldDeclaration* resolve_constructor( TxExpressionNode* origin, const TxActualType* allocType, const std::vector<TxExpressionNode*>* appliedFuncArgs ) { // constructors aren't inherited, except for certain empty and VALUE derivations: auto constructionType = allocType->get_construction_type(); auto constrMember = lookup_member( origin->context().scope(), constructionType->get_declaration()->get_symbol(), CONSTR_IDENT ); if ( auto constructorSymbol = dynamic_cast<TxEntitySymbol*>( constrMember ) ) { auto constructorDecl = resolve_field( origin, constructorSymbol, appliedFuncArgs ); //std::cerr << "Resolved constructor " << constructorDecl << ": " << constructorDecl->get_definer()->qualtype() << " at " << origin << std::endl; ASSERT( constructorDecl->get_decl_flags() & ( TXD_CONSTRUCTOR | TXD_INITIALIZER ), "field named " CONSTR_IDENT " is not flagged as TXD_CONSTRUCTOR or TXD_INITIALIZER: " << constructorDecl->str() ); return constructorDecl; } CERR_THROWRES( origin, "No constructor '" << CONSTR_IDENT << "' found in type " << allocType ); } TxScopeSymbol* TxFieldValueNode::resolve_symbol() { if (this->symbol) return this->symbol; TxScopeSymbol* vantageScope = this->context().scope(); if ( this->baseExpr ) { // baseExpr may or may not refer to a type (e.g. modules don't) auto baseType = this->baseExpr->resolve_type( TXR_FULL_RESOLUTION ); if ( baseType->get_type_class() == TXTC_VOID ) { if ( auto baseFieldExpr = dynamic_cast<TxFieldValueNode*>( this->baseExpr ) ) { // base is a non-entity symbol this->symbol = lookup_member( vantageScope, baseFieldExpr->resolve_symbol(), this->symbolName->ident() ); } else CERR_THROWRES( this, "Base expression of field member operator '.' has no type." ); } else { if ( baseType->get_type_class() == TXTC_REFERENCE ) { if ( auto baseValExpr = dynamic_cast<TxExpressionNode*>( this->baseExpr )) { // implicit dereferencing ('^') operation: baseType = baseType->target_type(); //std::cerr << "Adding implicit '^' to: " << this->baseExpr << " six=" << six << std::endl; auto derefNode = new TxReferenceDerefNode( this->baseExpr->ploc, baseValExpr ); this->baseExpr = derefNode; inserted_node( derefNode, this, "deref" ); } } // base is a type or value expression this->symbol = lookup_inherited_member( vantageScope, baseType.type(), this->symbolName->ident() ); } } else { this->symbol = search_name( vantageScope, this->symbolName->ident() ); } return this->symbol; } const TxEntityDeclaration* TxFieldValueNode::resolve_decl() { if ( this->declaration ) return this->declaration; // if ( get_node_id() == 6442 ) // std::cerr << "HERE " << this << std::endl; if ( auto symb = this->resolve_symbol() ) { if ( auto entitySymbol = dynamic_cast<TxEntitySymbol*>( symb ) ) { // if symbol can be resolved to actual field, then do so if ( entitySymbol->field_count() ) { this->declaration = resolve_field( this, entitySymbol, this->appliedFuncArgs ); this->ploc.parserCtx->driver().add_reachable( this->declaration->get_definer() ); return this->declaration; } // if symbol is a type, and arguments are applied, and they match a constructor, then resolve to that constructor if ( auto typeDecl = entitySymbol->get_type_decl() ) { this->ploc.parserCtx->driver().add_reachable( typeDecl->get_definer() ); if ( this->appliedFuncArgs ) { auto allocType = typeDecl->get_definer()->resolve_type( TXR_FULL_RESOLUTION ); // find the constructor (note, constructors aren't inherited, except for certain empty and VALUE derivations): this->declaration = resolve_constructor( this, allocType.type(), this->appliedFuncArgs ); if ( this->declaration != typeDecl ) this->ploc.parserCtx->driver().add_reachable( this->declaration->get_definer() ); this->constructedType = allocType.type(); return this->declaration; } else { // resolve this symbol to its type this->declaration = typeDecl; return this->declaration; } } CERR_THROWRES( this, "Symbol " << entitySymbol << " could not be resolved to a distinct type or field: " << this->get_full_identifier() ); } else { //not an error, symbol is not an entity but valid //CERROR(this, "Symbol is not a field or type: " << this->get_full_identifier()); return nullptr; } } else { if ( this->baseExpr ) CERR_THROWRES( this, "Unknown symbol '" << this->get_full_identifier() << "' (base expression type is " << this->baseExpr->qtype() << ")" ); else CERR_THROWRES( this, "Unknown symbol '" << this->get_full_identifier() << "'" ); } // function returns or throws resolution exception before this ASSERT( false, "unexpected execution point in " << this ); return nullptr; } TxQualType TxFieldValueNode::define_type( TxTypeResLevel typeResLevel ) { // if ( get_node_id() = =6442 ) // std::cerr << "HERE " << this << std::endl; if ( auto decl = this->resolve_decl() ) { if ( auto fieldDecl = dynamic_cast<const TxFieldDeclaration*>( decl ) ) { this->_field = fieldDecl->get_definer()->resolve_field(); if ( fieldDecl->get_storage() == TXS_INSTANCE || fieldDecl->get_storage() == TXS_INSTANCEMETHOD ) { if ( !( fieldDecl->get_decl_flags() & ( TXD_CONSTRUCTOR | TXD_INITIALIZER | TXD_GENPARAM | TXD_GENBINDING ) ) ) { if ( this->baseExpr ) { if ( auto baseSymbolNode = dynamic_cast<TxFieldValueNode*>( this->baseExpr ) ) { if ( !baseSymbolNode->field() ) { CERR_THROWRES( this, "Instance member field referenced without instance base: " << this->get_full_identifier() ); } } } else { CERR_THROWRES( this, "Instance member field referenced without instance base: " << this->get_full_identifier() ); } } } return this->_field->qtype(); } else return decl->get_definer()->resolve_type( typeResLevel ); } // Symbol is not a field or type, return Void as placeholder type return TxQualType( this->registry().get_builtin_type( TXBT_VOID ) ); } bool TxFieldValueNode::is_value() const { ASSERT( this->is_context_set(), "can't call is_value() before declaration pass is run for " << this ); return this->_field; } const TxExpressionNode* TxFieldValueNode::get_data_graph_origin_expr() const { if ( auto baseValExpr = dynamic_cast<TxExpressionNode*>( this->baseExpr ) ) { if ( auto fieldBase = dynamic_cast<TxFieldValueNode*>( baseValExpr ) ) { if ( !fieldBase->field() ) return nullptr; // baseExpr identifies a namespace } return baseValExpr; } return nullptr; } TxFieldStorage TxFieldValueNode::get_storage() const { if ( this->_field->get_storage() == TXS_VIRTUAL && !this->baseExpr ) return TXS_STATIC; return this->_field->get_storage(); } bool TxFieldValueNode::is_statically_constant() const { // if (get_node_id()==2893) // std::cerr << "is_statically_constant() in " << this << std::endl; if ( this->_field ) { // A field is statically constant if it is unmodifiable, isn't virtual, and has a statically constant initializer or base expression auto storage = this->get_storage(); if ( auto initExpr = this->_field->get_declaration()->get_definer()->get_init_expression() ) { if ( storage == TXS_VIRTUAL || storage == TXS_INSTANCEMETHOD ) return false; return ( !this->_field->qtype().is_modifiable() && initExpr->is_statically_constant() ); } else if ( storage == TXS_INSTANCE ) { if ( auto baseValExpr = dynamic_cast<TxExpressionNode*>( this->baseExpr ) ) { return baseValExpr->is_statically_constant(); } } // FUTURE: allow a virtual field lookup, with a constant base expression, to behave as a static field lookup (i.e. non-polymorphic) // FUTURE: support getting instance method lambda object of statically constant objects return false; } else if ( this->symbol ) { return true; } else return false; } void TxNamedFieldNode::verification_pass() const { // if ( !dynamic_cast<const TxFieldValueNode*>( this->parent() ) ) { if ( auto declaration = this->exprNode->get_declaration() ) if ( !dynamic_cast<const TxFieldDeclaration*>( declaration ) ) CERROR( this, "'" << this->exprNode->get_full_identifier() << "' resolved to a type, not a field: " << declaration ); // } } void TxFieldAssigneeNode::verification_pass() const { if ( auto declaration = this->fieldNode->get_declaration() ) { if ( auto fieldDecl = dynamic_cast<const TxFieldDeclaration*>( declaration ) ) { if ( fieldDecl->get_storage() == TXS_NOSTORAGE ) CERROR( this, "Assignee '" << fieldNode->symbolName << "' is not an L-value / has no storage." ); } else CERROR( this, "'" << this->fieldNode->get_full_identifier() << "' resolved to a type, not a field: " << declaration ); } }
50.229665
153
0.576253
TuplexLanguage
06839e5b3b50a03bcd71454f3a46b524749e6f7e
12,450
hpp
C++
src/verifier/mem_encode/encoder.hpp
lmntal/slim
643a2f9c4208532fab64c80aa88034fa625be61e
[ "BSD-3-Clause" ]
18
2015-02-11T13:52:46.000Z
2021-07-05T10:50:22.000Z
src/verifier/mem_encode/encoder.hpp
lmntal/slim
643a2f9c4208532fab64c80aa88034fa625be61e
[ "BSD-3-Clause" ]
58
2015-01-02T11:31:12.000Z
2022-03-23T07:16:47.000Z
src/verifier/mem_encode/encoder.hpp
lmntal/slim
643a2f9c4208532fab64c80aa88034fa625be61e
[ "BSD-3-Clause" ]
17
2015-04-02T03:52:48.000Z
2021-02-07T02:29:38.000Z
/* * encode.hpp * * Copyright (c) 2018, Ueda Laboratory LMNtal Group * <[email protected]> All rights reserved. * * 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 the Ueda Laboratory LMNtal Group 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 * OWNER 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. */ #ifndef SLIM_VERIFIER_MEM_ENCODE_ENCODER_HPP #define SLIM_VERIFIER_MEM_ENCODE_ENCODER_HPP #include "../visitlog.h" #include "binstr.hpp" #include "vm/vm.h" #include <algorithm> #include <vector> namespace slim { namespace verifier { namespace mem_encode { class encoder { void write_mem_atoms(LmnMembraneRef mem, BinStrCursor &bsp, VisitLogRef visited) { if (!bsp.is_valid()) return; auto v = symbol_atom_range(mem); write_mols(v.begin(), v.end(), bsp, visited); } /* write_atomsの膜バージョン. * ここで書き込む計算する分子には膜のみが含まれている */ void write_mems(LmnMembraneRef mem, BinStrCursor &bsp, VisitLogRef visited) { BinStrCursor last_valid_bsp; CheckpointRef last_valid_checkpoint = nullptr; if (!bsp.is_valid()) return; bool last_valid = false; for (auto m = mem->mem_child_head(); m; m = m->mem_next()) { if (visited->get_mem(m, NULL)) continue; BinStrCursor new_bsptr = bsp; visited->set_checkpoint(); write_mem(m, 0, -1, -1, new_bsptr, visited, TRUE); if (new_bsptr.is_valid()) { /* mからたどった分子が書き込みに成功したので、last_validに記憶する */ if (last_valid) { delete last_valid_checkpoint; } last_valid_bsp = new_bsptr; last_valid_checkpoint = visited->pop_checkpoint(); last_valid = true; } else { visited->revert_checkpoint(); } } if (last_valid) { /* 書き込みに成功した分子をログに記録して、次の分子に進む */ visited->push_checkpoint(last_valid_checkpoint); write_mems(mem, last_valid_bsp, visited); if (last_valid_bsp.is_valid()) { bsp = last_valid_bsp; visited->commit_checkpoint(); } else { visited->revert_checkpoint(); } } } /* 膜memの全てのアトムのバイナリストリングを書き込む. * 辿ってきたアトムfrom_atomとそのアトムの属性attrとこちらからのリンク番号fromを受け取る. */ void write_mem(LmnMembraneRef mem, LmnAtomRef from_atom, LmnLinkAttr attr, int from, BinStrCursor &bsp, VisitLogRef visited, BOOL is_id) { LmnWord n_visited; if (!bsp.is_valid()) return; /* 訪問済み */ if (visited->get_mem(mem, &n_visited)) { bsp.push_visited_mem(n_visited); if (from_atom) { /* 引き続きアトムをたどる */ write_mol(from_atom, attr, from, bsp, visited, is_id); } return; } visited->put_mem(mem); bsp.push_start_mem(mem->NAME_ID()); if (!bsp.is_valid()) return; if (from_atom) { write_mol(from_atom, attr, from, bsp, visited, is_id); } /* アトム・膜・ルールセットの順に書込み */ if (is_id) { /* 膜に対して一意なIDとなるバイナリストリングへエンコードする場合 */ write_mem_atoms(mem, bsp, visited); write_mems(mem, bsp, visited); } else { /* 単なるバイナリストリングへエンコードする場合 */ dump_mem_atoms(mem, bsp, visited); dump_mems(mem, bsp, visited); /* 膜memに存在するデータアトムを起点にしたinside * proxyアトムをちゃんと書き込んでおく */ auto ent = mem->get_atomlist(LMN_IN_PROXY_FUNCTOR); if (ent) { for (auto in : *ent) { if (!LMN_ATTR_IS_DATA(in->get_attr(1)) || visited->get_atom(in, NULL)) { continue; } /* -------------------------+ * [DATA ATOM]-0--1-[in]-0--|--0-[out]-1--.. * -------------------------+ */ bsp.push_escape_mem_data(in->get_link(1), in->get_attr(1), visited); auto out = (LmnSymbolAtomRef)in->get_link(0); write_mol(out->get_link(1), out->get_attr(1), LMN_ATTR_GET_VALUE(out->get_attr(1)), bsp, visited, is_id); }; } } write_rulesets(mem, bsp); bsp.push_end_mem(); } /* アトムatomをバイナリストリングへ書き込む * 入力: * アトムatomと, atomのリンク属性attr, * アトムatomへ辿ってきた際に辿ったリンクと接続するリンク番号from, * エンコード領域bsp, 訪問管理visited, * is_idは計算するバイナリストリングがmem_idならば真 */ void write_mol(LmnAtomRef atom, LmnLinkAttr attr, int from, BinStrCursor &bsp, VisitLogRef visited, BOOL is_id) { LmnWord n_visited; if (!bsp.is_valid()) return; /* データアトムの場合 */ if (LMN_ATTR_IS_DATA(attr)) { bsp.push_data_atom(atom, attr, visited); return; } auto satom = reinterpret_cast<LmnSymbolAtomRef>(atom); auto f = satom->get_functor(); if (f == LMN_OUT_PROXY_FUNCTOR) { /* outside proxyの場合, inside proxy側の膜をwrite_memで書き込む */ auto in = (LmnSymbolAtomRef)satom->get_link(0); auto in_mem = LMN_PROXY_GET_MEM(in); if (visited->get_atom(in, NULL)) { visited->put_atom(in); } write_mem(in_mem, in->get_link(1), in->get_attr(1), LMN_ATTR_GET_VALUE(in->get_attr(1)), bsp, visited, is_id); } else if (f == LMN_IN_PROXY_FUNCTOR) { /* inside proxyの場合, 親膜へ抜ける旨を示すタグTAG_ESCAPE_MEMを書き込む. * その後, outside proxyから分子のトレース(write_mol)を引き続き実行する */ auto out = (LmnSymbolAtomRef)satom->get_link(0); bsp.push_escape_mem(); if (visited->get_atom(satom, NULL)) { visited->put_atom(satom); } write_mol(out->get_link(1), out->get_attr(1), LMN_ATTR_GET_VALUE(out->get_attr(1)), bsp, visited, is_id); } else if (!visited->get_atom(satom, &n_visited)) { /* 未訪問のシンボルアトムの場合 */ visited->put_atom(satom); bsp.push_atom(satom); if (!bsp.is_valid()) return; auto arity = LMN_FUNCTOR_GET_LINK_NUM(f); for (auto i_arg = 0; i_arg < arity; i_arg++) { if (i_arg == from) { /* 辿ってきたリンクに接続 */ bsp.push_from(); continue; } write_mol(satom->get_link(i_arg), satom->get_attr(i_arg), LMN_ATTR_GET_VALUE(satom->get_attr(i_arg)), bsp, visited, is_id); } } else { /* 訪問済のシンボルアトムの場合 */ bsp.push_visited_atom(n_visited, from); } } /* atomsに含まれるアトムを起点とする未訪問分子を、バイナリストリングが 最小となるように書き込む */ template <class Iterator> void write_mols(Iterator begin, Iterator end, BinStrCursor &bsp, VisitLogRef visited) { BinStrCursor last_valid_bsp; Iterator last_valid_it = end; int first_func = 0; CheckpointRef last_valid_checkpoint = nullptr; if (!bsp.is_valid()) return; /* atoms中の未訪問のアトムを起点とする分子を、それぞれ試みる */ for (auto it = begin; it != end; ++it) { LmnSymbolAtomRef atom = *it; if (LMN_IS_HL(atom)) continue; /* 最適化: 最小のファンクタ以外は試す必要なし */ if (last_valid_it != end && atom->get_functor() != first_func) break; if (visited->get_atom(atom, NULL)) continue; BinStrCursor new_bsptr = bsp; visited->set_checkpoint(); write_mol(atom, LMN_ATTR_MAKE_LINK(0), -1, new_bsptr, visited, TRUE); if (new_bsptr.is_valid()) { /* atomからたどった分子が書き込みに成功したので、last_validに記憶する */ if (last_valid_it == end) { first_func = atom->get_functor(); } else { delete last_valid_checkpoint; } last_valid_bsp = new_bsptr; last_valid_checkpoint = visited->pop_checkpoint(); last_valid_it = it; } else { visited->revert_checkpoint(); } } if (last_valid_it != end) { /* 書き込みに成功した分子をログに記録して、次の分子に進む */ auto t = *last_valid_it; *last_valid_it = 0; visited->push_checkpoint(last_valid_checkpoint); write_mols(begin, end, last_valid_bsp, visited); *last_valid_it = t; if (last_valid_bsp.is_valid()) { bsp = last_valid_bsp; visited->commit_checkpoint(); } else { visited->revert_checkpoint(); } } } void write_rulesets(LmnMembraneRef mem, BinStrCursor &bsp) { /* ルールセットがルールセットIDでソートされていることに基づいたコード */ auto n = mem->ruleset_num(); if (n == 0) return; bool has_uniq = FALSE; /* TODO: uniqルールセットが存在するか否かを検査するためだけに * O(ルールセット数)かかってしまうため. * ルールの移動や複製を行うプログラムで非効率 */ for (auto i = 0; i < n; i++) { if (lmn_mem_get_ruleset(mem, i)->has_unique()) { has_uniq = TRUE; break; } } if (!has_uniq) { bsp.push_start_rulesets(n); for (auto i = 0; i < n; i++) { bsp.push_ruleset(lmn_mem_get_ruleset(mem, i)); } } else { bsp.push_ruleset_uniq(mem, n); } } /* 膜memに存在する全てのアトムをファンクタIDの降順の列で求め, * 求めた列をdump_molsする */ void dump_mem_atoms(LmnMembraneRef mem, BinStrCursor &bsp, VisitLogRef visited) { dump_mols(symbol_atom_range(mem), bsp, visited); } /* アトム列atomsから, visitedに未登録のアトムに対し, write_molを行う * つまり, mhash同様に, 各アトムを起点とした分子単位でエンコードを行っている */ template <typename Container> void dump_mols(const Container &atoms, BinStrCursor &bsp, VisitLogRef visited) { /* atoms中の未訪問のアトムを起点とする分子を、それぞれ試みる */ for (auto atom : atoms) { if (visited->get_atom(atom, NULL) || LMN_IS_HL(atom)) continue; write_mol((LmnAtomRef)atom, LMN_ATTR_MAKE_LINK(0), -1, bsp, visited, FALSE); } } /* 膜中心の計算単位. 未訪問の子膜Xに対して, 子膜の分子を書き込み, * dump_memsへ再起する 兄弟膜は子膜内のプロセスを全て書き込んでから訪問される */ void dump_mems(LmnMembraneRef mem, BinStrCursor &bsp, VisitLogRef visited) { for (auto m = mem->mem_child_head(); m; m = m->mem_next()) { if (!visited->get_mem(m, NULL)) { write_mem(m, 0, -1, -1, bsp, visited, FALSE); } } } public: static LmnBinStr *encode(LmnMembraneRef mem, unsigned int tbl_size = 0 /* hint */) { encoder e(mem, false, tbl_size); auto visited = &e.visit_log; auto &bs = e.binstr; auto &bsp = e.cur; e.write_mem_atoms(mem, *bsp, visited); e.write_mems(mem, *bsp, visited); e.write_rulesets(mem, *bsp); return e.binary_string(); } static LmnBinStr *dump(LmnMembraneRef mem, unsigned long tbl_size = 0 /* hint */) { encoder e(mem, true, tbl_size); auto visitlog = &e.visit_log; auto &bs = e.binstr; auto &bsp = e.cur; e.dump_mem_atoms(mem, *bsp, visitlog); /* 1. アトムから */ e.dump_mems(mem, *bsp, visitlog); /* 2. 子膜から */ e.write_rulesets(mem, *bsp); /* 3. 最後にルール */ return e.binary_string(); } private: LmnMembraneRef root_mem; VisitLog visit_log; BinStr binstr; std::unique_ptr<BinStrCursor> cur; public: encoder(LmnMembraneRef mem, bool direct, unsigned int tbl_size = 0) : root_mem(mem), visit_log() { cur = direct ? binstr.head_direct() : binstr.head(); visit_log.init_with_size(tbl_size); } LmnBinStr *binary_string() { return binstr.to_lmn_binstr(); } }; } // namespace mem_encode } // namespace verifier } // namespace slim #endif /* SLIM_VERIFIER_MEM_ENCODE_ENCODER_HPP */
29.572447
100
0.617751
lmntal
068886aa5496f349bac8f2f08d04eb38bbea57a9
567
cpp
C++
Source/DialogueSystem/Private/QuestBook.cpp
artemavrin/DialogueSystem
90f7816d55b1948253d2f9955469d6d91b5929cb
[ "MIT" ]
126
2016-04-16T00:42:19.000Z
2022-01-20T12:54:23.000Z
Source/DialogueSystem/Private/QuestBook.cpp
artemavrin/DialogueSystem
90f7816d55b1948253d2f9955469d6d91b5929cb
[ "MIT" ]
8
2016-04-16T23:13:04.000Z
2019-10-02T17:12:09.000Z
Source/DialogueSystem/Private/QuestBook.cpp
artemavrin/DialogueSystem
90f7816d55b1948253d2f9955469d6d91b5929cb
[ "MIT" ]
45
2016-04-16T10:49:47.000Z
2021-09-10T15:47:10.000Z
//Copyright (c) 2016 Artem A. Mavrin and other contributors #pragma once //#include "DialogueSystemPrivatePCH.h" #include "QuestBook.h" FQuest UQuestBook::GetQuest(int32 ID) { FQuest Result; for (auto& elem : Quests) { if (elem.ID == ID) { Result = elem; break; } } return Result; } void UQuestBook::IncreaseLastID() { LastID++; } void UQuestBook::SetUniqueID() { IncreaseLastID(); for (auto& elem : Quests) { if (elem.ID == 0) { elem.ID = LastID; elem.QuestBook = this; break; } } }
13.829268
60
0.590829
artemavrin
069a98ce54eb68ec0e828b97f8df9068eda064f4
379
cpp
C++
Baekjoon/3076.cpp
Twinparadox/AlgorithmProblem
0190d17555306600cfd439ad5d02a77e663c9a4e
[ "MIT" ]
null
null
null
Baekjoon/3076.cpp
Twinparadox/AlgorithmProblem
0190d17555306600cfd439ad5d02a77e663c9a4e
[ "MIT" ]
null
null
null
Baekjoon/3076.cpp
Twinparadox/AlgorithmProblem
0190d17555306600cfd439ad5d02a77e663c9a4e
[ "MIT" ]
null
null
null
#include <iostream> using namespace std; int main(void) { int r, c, a, b; cin >> r >> c >> a >> b; for (int i = 0; i < r; i++) { for (int k = 0; k < a; k++) { for (int j = 0; j < c; j++) { if ((i + j) % 2 == 0) for (int si = 0; si < b; si++) cout << "X"; else for (int si = 0; si < b; si++) cout << "."; } cout << '\n'; } } }
15.791667
35
0.37467
Twinparadox
069f712288a593e7ef85ba0d060537ef5f1963ed
9,978
cpp
C++
Source/WebCore/Modules/mediastream/UserMediaRequest.cpp
ijsf/DeniseEmbeddableWebKit
57dfc6783d60f8f59b7129874e60f84d8c8556c9
[ "BSD-3-Clause" ]
null
null
null
Source/WebCore/Modules/mediastream/UserMediaRequest.cpp
ijsf/DeniseEmbeddableWebKit
57dfc6783d60f8f59b7129874e60f84d8c8556c9
[ "BSD-3-Clause" ]
9
2020-04-18T18:47:18.000Z
2020-04-18T18:52:41.000Z
Source/WebCore/Modules/mediastream/UserMediaRequest.cpp
ijsf/DeniseEmbeddableWebKit
57dfc6783d60f8f59b7129874e60f84d8c8556c9
[ "BSD-3-Clause" ]
null
null
null
/* * Copyright (C) 2011 Ericsson AB. All rights reserved. * Copyright (C) 2012 Google Inc. All rights reserved. * Copyright (C) 2013-2016 Apple Inc. All rights reserved. * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies). * * 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 Ericsson 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 * OWNER 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 "config.h" #include "UserMediaRequest.h" #if ENABLE(MEDIA_STREAM) #include "Document.h" #include "DocumentLoader.h" #include "JSMediaStream.h" #include "JSOverconstrainedError.h" #include "Logging.h" #include "MainFrame.h" #include "MediaConstraints.h" #include "RealtimeMediaSourceCenter.h" #include "Settings.h" #include "UserMediaController.h" namespace WebCore { ExceptionOr<void> UserMediaRequest::start(Document& document, MediaConstraints&& audioConstraints, MediaConstraints&& videoConstraints, DOMPromiseDeferred<IDLInterface<MediaStream>>&& promise) { auto* userMedia = UserMediaController::from(document.page()); if (!userMedia) return Exception { NotSupportedError }; // FIXME: Why is it better to return an exception here instead of rejecting the promise as we do just below? if (!audioConstraints.isValid && !videoConstraints.isValid) { promise.reject(TypeError); return { }; } adoptRef(*new UserMediaRequest(document, *userMedia, WTFMove(audioConstraints), WTFMove(videoConstraints), WTFMove(promise)))->start(); return { }; } UserMediaRequest::UserMediaRequest(Document& document, UserMediaController& controller, MediaConstraints&& audioConstraints, MediaConstraints&& videoConstraints, DOMPromiseDeferred<IDLInterface<MediaStream>>&& promise) : ContextDestructionObserver(&document) , m_audioConstraints(WTFMove(audioConstraints)) , m_videoConstraints(WTFMove(videoConstraints)) , m_controller(&controller) , m_promise(WTFMove(promise)) { } UserMediaRequest::~UserMediaRequest() { } SecurityOrigin* UserMediaRequest::userMediaDocumentOrigin() const { if (!m_scriptExecutionContext) return nullptr; return m_scriptExecutionContext->securityOrigin(); } SecurityOrigin* UserMediaRequest::topLevelDocumentOrigin() const { if (!m_scriptExecutionContext) return nullptr; return &m_scriptExecutionContext->topOrigin(); } static bool isSecure(DocumentLoader& documentLoader) { auto& response = documentLoader.response(); return response.url().protocolIs("https") && response.certificateInfo() && !response.certificateInfo()->containsNonRootSHA1SignedCertificate(); } static bool canCallGetUserMedia(Document& document, String& errorMessage) { bool requiresSecureConnection = document.settings().mediaCaptureRequiresSecureConnection(); if (requiresSecureConnection && !isSecure(*document.loader())) { errorMessage = "Trying to call getUserMedia from an insecure document."; return false; } auto& topDocument = document.topDocument(); if (&document != &topDocument) { auto& topOrigin = topDocument.topOrigin(); if (!document.securityOrigin().isSameSchemeHostPort(topOrigin)) { errorMessage = "Trying to call getUserMedia from a document with a different security origin than its top-level frame."; return false; } for (auto* ancestorDocument = document.parentDocument(); ancestorDocument != &topDocument; ancestorDocument = ancestorDocument->parentDocument()) { if (requiresSecureConnection && !isSecure(*ancestorDocument->loader())) { errorMessage = "Trying to call getUserMedia from a document with an insecure parent frame."; return false; } if (!ancestorDocument->securityOrigin().isSameSchemeHostPort(topOrigin)) { errorMessage = "Trying to call getUserMedia from a document with a different security origin than its top-level frame."; return false; } } } return true; } void UserMediaRequest::start() { if (!m_scriptExecutionContext || !m_controller) { deny(MediaAccessDenialReason::OtherFailure, emptyString()); return; } Document& document = downcast<Document>(*m_scriptExecutionContext); // 10.2 - 6.3 Optionally, e.g., based on a previously-established user preference, for security reasons, // or due to platform limitations, jump to the step labeled Permission Failure below. String errorMessage; if (!canCallGetUserMedia(document, errorMessage)) { deny(MediaAccessDenialReason::PermissionDenied, emptyString()); document.domWindow()->printErrorMessage(errorMessage); return; } m_controller->requestUserMediaAccess(*this); } void UserMediaRequest::allow(String&& audioDeviceUID, String&& videoDeviceUID, String&& deviceIdentifierHashSalt) { RELEASE_LOG(MediaStream, "UserMediaRequest::allow %s %s", audioDeviceUID.utf8().data(), videoDeviceUID.utf8().data()); m_allowedAudioDeviceUID = WTFMove(audioDeviceUID); m_allowedVideoDeviceUID = WTFMove(videoDeviceUID); RefPtr<UserMediaRequest> protectedThis = this; RealtimeMediaSourceCenter::NewMediaStreamHandler callback = [this, protectedThis = WTFMove(protectedThis)](RefPtr<MediaStreamPrivate>&& privateStream) mutable { if (!m_scriptExecutionContext) return; if (!privateStream) { deny(MediaAccessDenialReason::HardwareError, emptyString()); return; } privateStream->monitorOrientation(downcast<Document>(m_scriptExecutionContext)->orientationNotifier()); auto stream = MediaStream::create(*m_scriptExecutionContext, privateStream.releaseNonNull()); if (stream->getTracks().isEmpty()) { deny(MediaAccessDenialReason::HardwareError, emptyString()); return; } stream->startProducingData(); m_promise.resolve(stream); }; m_audioConstraints.deviceIDHashSalt = deviceIdentifierHashSalt; m_videoConstraints.deviceIDHashSalt = WTFMove(deviceIdentifierHashSalt); RealtimeMediaSourceCenter::singleton().createMediaStream(WTFMove(callback), m_allowedAudioDeviceUID, m_allowedVideoDeviceUID, &m_audioConstraints, &m_videoConstraints); if (!m_scriptExecutionContext) return; #if ENABLE(WEB_RTC) auto* page = downcast<Document>(*m_scriptExecutionContext).page(); if (page) page->rtcController().disableICECandidateFiltering(); #endif } void UserMediaRequest::deny(MediaAccessDenialReason reason, const String& invalidConstraint) { if (!m_scriptExecutionContext) return; switch (reason) { case MediaAccessDenialReason::NoConstraints: RELEASE_LOG(MediaStream, "UserMediaRequest::deny - no constraints"); m_promise.reject(TypeError); break; case MediaAccessDenialReason::UserMediaDisabled: RELEASE_LOG(MediaStream, "UserMediaRequest::deny - user media disabled"); m_promise.reject(SecurityError); break; case MediaAccessDenialReason::NoCaptureDevices: RELEASE_LOG(MediaStream, "UserMediaRequest::deny - no capture devices"); m_promise.reject(NotFoundError); break; case MediaAccessDenialReason::InvalidConstraint: RELEASE_LOG(MediaStream, "UserMediaRequest::deny - invalid constraint - %s", invalidConstraint.utf8().data()); m_promise.rejectType<IDLInterface<OverconstrainedError>>(OverconstrainedError::create(invalidConstraint, ASCIILiteral("Invalid constraint")).get()); break; case MediaAccessDenialReason::HardwareError: RELEASE_LOG(MediaStream, "UserMediaRequest::deny - hardware error"); m_promise.reject(NotReadableError); break; case MediaAccessDenialReason::OtherFailure: RELEASE_LOG(MediaStream, "UserMediaRequest::deny - other failure"); m_promise.reject(AbortError); break; case MediaAccessDenialReason::PermissionDenied: RELEASE_LOG(MediaStream, "UserMediaRequest::deny - permission denied"); m_promise.reject(NotAllowedError); break; } } void UserMediaRequest::contextDestroyed() { ContextDestructionObserver::contextDestroyed(); Ref<UserMediaRequest> protectedThis(*this); if (m_controller) { m_controller->cancelUserMediaAccessRequest(*this); m_controller = nullptr; } } Document* UserMediaRequest::document() const { return downcast<Document>(m_scriptExecutionContext); } } // namespace WebCore #endif // ENABLE(MEDIA_STREAM)
39.283465
218
0.725095
ijsf
069f90d812c4e896df97ae47b01f2965085a167a
2,223
cpp
C++
codeforces/107/107_2_B_PhoneNumbers.cpp
ibudiselic/contest-problem-solutions
88082981b4d87da843472e3ca9ed5f4c42b3f0aa
[ "BSD-2-Clause" ]
3
2015-05-25T06:24:37.000Z
2016-09-10T07:58:00.000Z
codeforces/107/107_2_B_PhoneNumbers.cpp
ibudiselic/contest-problem-solutions
88082981b4d87da843472e3ca9ed5f4c42b3f0aa
[ "BSD-2-Clause" ]
null
null
null
codeforces/107/107_2_B_PhoneNumbers.cpp
ibudiselic/contest-problem-solutions
88082981b4d87da843472e3ca9ed5f4c42b3f0aa
[ "BSD-2-Clause" ]
5
2015-05-25T06:24:40.000Z
2021-08-19T19:22:29.000Z
#include <cassert> #include <vector> #include <algorithm> #include <iostream> #include <cstdio> #include <cstdlib> #include <cmath> #include <string> #include <cstring> using namespace std; bool is_taxi(const string &s) { char c = s[0]; for (int i=0; i<(int)s.size(); ++i) { if (s[i]!='-' && s[i]!=c) { return false; } } return true; } bool is_pizza(const string &s) { char c = s[0]; for (int i=1; i<(int)s.size(); ++i) { if (s[i] == '-') continue; if (s[i] >= c) { return false; } c = s[i]; } return true; } int main() { int n; cin >> n; vector<string> names; vector<int> taxi, pizza, girls; int T=-1, P=-1, G=-1; for (int i=0; i<n; ++i) { int sz; string s; cin >> sz >> s; names.push_back(s); int t=0, p=0, g=0; for (int j=0; j<sz; ++j) { cin >> s; assert(s.size() == 8); if (is_taxi(s)) { ++t; } else if (is_pizza(s)) { ++p; } else { ++g; } } T = max(T, t); taxi.push_back(t); P = max(P, p); pizza.push_back(p); G = max(G, g); girls.push_back(g); } cout << "If you want to call a taxi, you should call: "; int cnt = 0; for (int i=0; i<n; ++i) { if (taxi[i] == T) { if (cnt > 0) { cout << ", "; } ++cnt; cout << names[i]; } } cout << ".\n"; cout << "If you want to order a pizza, you should call: "; cnt = 0; for (int i=0; i<n; ++i) { if (pizza[i] == P) { if (cnt > 0) { cout << ", "; } ++cnt; cout << names[i]; } } cout << ".\n"; cout << "If you want to go to a cafe with a wonderful girl, you should call: "; cnt = 0; for (int i=0; i<n; ++i) { if (girls[i] == G) { if (cnt > 0) { cout << ", "; } ++cnt; cout << names[i]; } } cout << ".\n"; return 0; }
21.794118
83
0.378767
ibudiselic
06a10b56bead05d586c4c0bd314ad64325389564
4,975
hpp
C++
murt/core/vec3.hpp
tamsri/murt
180dbb0d09ab50dfdaa1be843475f20a86651ea2
[ "MIT" ]
4
2021-06-19T08:38:47.000Z
2022-01-10T21:10:38.000Z
murt/core/vec3.hpp
tamsri/murt
180dbb0d09ab50dfdaa1be843475f20a86651ea2
[ "MIT" ]
1
2021-05-26T12:08:01.000Z
2021-05-26T12:08:01.000Z
murt/core/vec3.hpp
tamsri/murt
180dbb0d09ab50dfdaa1be843475f20a86651ea2
[ "MIT" ]
2
2022-01-24T11:04:46.000Z
2022-02-23T22:26:42.000Z
#ifndef VEC3_H #define VEC3_H #include <math.h> #include <set> #include <utility> #include <string> class Vec3 { public: float x_, y_, z_; // Constructor Vec3(void) : x_(0.0f), y_(0.0f), z_(0.0f){}; Vec3(float x, float y, float z) : x_(x), y_(y), z_(z){}; // Operators Vec3 operator+(const Vec3 &o_v3) { return Vec3(x_ + o_v3.x_, y_ + o_v3.y_, z_ + o_v3.z_); }; Vec3 operator-(const Vec3 &o_v3) { return Vec3(x_ - o_v3.x_, y_ - o_v3.y_, z_ - o_v3.z_); }; Vec3 operator*(const Vec3 &o_v3) { return Vec3(x_ * o_v3.x_, y_ * o_v3.y_, z_ * o_v3.z_); }; Vec3 operator/(const Vec3 &o_v3) { return Vec3(x_ / o_v3.x_, y_ / o_v3.y_, z_ / o_v3.z_); }; Vec3 operator+(const float &f) { return Vec3(x_ + f, y_ + f, z_ + f); }; Vec3 operator-(const float &f) { return Vec3(x_ - f, y_ - f, z_ - f); }; Vec3 operator*(const float &f) { return Vec3(x_ * f, y_ * f, z_ * f); }; Vec3 operator/(const float &f) { return Vec3(x_ / f, y_ / f, z_ / f); }; bool operator==(const Vec3 &b) const { return (x_ == b.x_) && (y_ == b.y_) && (z_ == b.z_); } Vec3 &operator+=(const Vec3 &o_v3) { x_ += o_v3.x_; y_ += o_v3.y_; z_ += o_v3.z_; return *this; }; Vec3 &operator-=(const Vec3 &o_v3) { x_ -= o_v3.x_; y_ -= o_v3.y_; z_ -= o_v3.z_; return *this; }; Vec3 &operator*=(const Vec3 &o_v3) { x_ *= o_v3.x_; y_ *= o_v3.y_; z_ *= o_v3.z_; return *this; }; Vec3 &operator/=(const Vec3 &o_v3) { x_ /= o_v3.x_; y_ /= o_v3.y_; z_ /= o_v3.z_; return *this; }; Vec3 &operator+=(const float &f) { x_ += f; y_ += f; z_ += f; return *this; }; Vec3 &operator-=(const float &f) { x_ -= f; y_ -= f; z_ -= f; return *this; }; Vec3 &operator*=(const float &f) { x_ *= f; y_ *= f; z_ *= f; return *this; }; Vec3 &operator/=(const float &f) { x_ /= f; y_ /= f; z_ /= f; return *this; }; // 1. Normalize vector void Normalize() { float len = sqrt(pow(x_, 2) + pow(y_, 2) + pow(z_, 2)); x_ /= len; y_ /= len; z_ /= len; }; // 2. Calculate Cross Product static Vec3 Cross(Vec3 v3_1, Vec3 v3_2) { float x = v3_1.y_ * v3_2.z_ - v3_1.z_ * v3_2.y_; float y = v3_1.z_ * v3_2.x_ - v3_1.x_ * v3_2.z_; float z = v3_1.x_ * v3_2.y_ - v3_1.y_ * v3_2.x_; return Vec3(x, y, z); }; // 3. Calculate Dot Product static float Dot(Vec3 v3_1, Vec3 v3_2) { return (v3_1.x_ * v3_2.x_) + (v3_1.y_ * v3_2.y_) + (v3_1.z_ * v3_2.z_); }; // 3. Return Absolute Value static float Abs(Vec3 v3) { return sqrt(Vec3::Dot(v3, v3)); }; // 4. Return Distance static float Distance(Vec3 v3_1, Vec3 v3_2) { return sqrt(pow(v3_1.x_ - v3_2.x_, 2) + pow(v3_1.y_ - v3_2.y_, 2) + pow(v3_1.z_ - v3_2.z_, 2)); }; // 5. Calcuclate Angle between vector direction static float Angle(Vec3 v3_1, Vec3 v3_2) { return acos(Vec3::Dot(v3_1, v3_2) / (Vec3::Abs(v3_1) * Vec3::Abs(v3_2))); }; // 6.5 check the given position is between xz plane static bool BetweenXZ(float min_x, float max_x, float min_z, float max_z, Vec3 pos) { return (pos.x_ >= min_x) && (pos.x_ <= max_x) && (pos.z_ >= min_z) && (pos.z_ <= max_z); } // compare operator bool operator<(const Vec3 &cvec) const { if (x_ != cvec.x_) return x_ < cvec.x_; else if (y_ != cvec.y_) return y_ < cvec.y_; else return z_ < cvec.z_; } static void ReorderEdges(Vec3 txPos, std::vector<Vec3> &edges) { txPos.y_ = 0.0f; std::set<std::pair<float, Vec3> > ordered_edges; for (Vec3 edge : edges) { Vec3 edge_on_plane = edge; edge_on_plane.y_ = 0.0f; float distance = Vec3::Distance(txPos, edge_on_plane); ordered_edges.insert({distance, edge}); } std::vector<Vec3> new_edges; for (std::pair<float, Vec3> pair_edge : ordered_edges) new_edges.push_back(pair_edge.second); edges = new_edges; ordered_edges.clear(); } std::string GetString() const { return "(" + std::to_string(x_) + ", " + std::to_string(y_) + ", " + std::to_string(z_) + ")"; } }; struct Vec3Hasher { std::size_t operator()(const Vec3 &v) const { return ((std::hash<float>()(v.x_) ^ (std::hash<float>()(v.y_) << 1)) >> 1) ^ (std::hash<float>()(v.z_) << 1); } }; #endif //VEC3_H
24.268293
117
0.49005
tamsri
a6291b7b1882b22526611787fd273b7ff06914e7
1,383
cc
C++
tests/test_classifier.cc
CS126SP20/naive-bayes-pyanda2
d07b1b6c479ea8ca4ac5b07a23ad9a1e56f236f4
[ "MIT" ]
null
null
null
tests/test_classifier.cc
CS126SP20/naive-bayes-pyanda2
d07b1b6c479ea8ca4ac5b07a23ad9a1e56f236f4
[ "MIT" ]
null
null
null
tests/test_classifier.cc
CS126SP20/naive-bayes-pyanda2
d07b1b6c479ea8ca4ac5b07a23ad9a1e56f236f4
[ "MIT" ]
null
null
null
// Copyright (c) 2020 [Your Name]. All rights reserved. #define CATCH_CONFIG_MAIN #include <catch2/catch.hpp> #include <bayes/classifier.h> #include <bayes/image.h> using namespace bayes; // TODO(you): Remove this unnecessary test case. TEST_CASE("Sanity Check", "[addition]") { REQUIRE(1 + 1 == 2); } TEST_CASE("Count number of shaded pixels in image", "[image-function]") { string image_name = "data/sampleimages"; string label_name = "data/samplelabels"; Image *image; image = new Image(image_name, label_name); int num_of_shaded_pixels = image->CalcNumOfShadedPixels(); delete image; REQUIRE(num_of_shaded_pixels == 148); } TEST_CASE("Count of pixels works", "[image-function]") { string image_name = "data/sampleimages"; string label_name = "data/samplelabels"; Image *image; image = new Image(image_name, label_name); int num_of_shaded_pixels = image->CalcNumOfShadedPixels(); delete image; REQUIRE(num_of_shaded_pixels == 148); } TEST_CASE("Multiple counts of shaded pixels (3 images)", "[image-function]") { string image_name = "data/sampleimages"; string label_name = "data/samplelabels"; Image *image; image = new Image(image_name, label_name); int num_of_shaded_pixels = image->CalcNumOfShadedPixels(); // int num_of_shaded_pixels_2 = image2->CalcNumOfShadedPixels(); delete image; REQUIRE(num_of_shaded_pixels == 148); }
31.431818
78
0.73102
CS126SP20
a62a4dbde07419ba78195f1476fa18099b57be23
1,250
cpp
C++
KalmanFilterinCPP/KalmanFilterinCPP/recip.cpp
YDWWYD/MECH552-Project
7df8b583d3b4fcd46d71052dc72a767ea1440426
[ "MIT" ]
null
null
null
KalmanFilterinCPP/KalmanFilterinCPP/recip.cpp
YDWWYD/MECH552-Project
7df8b583d3b4fcd46d71052dc72a767ea1440426
[ "MIT" ]
null
null
null
KalmanFilterinCPP/KalmanFilterinCPP/recip.cpp
YDWWYD/MECH552-Project
7df8b583d3b4fcd46d71052dc72a767ea1440426
[ "MIT" ]
null
null
null
/* * Academic License - for use in teaching, academic research, and meeting * course requirements at degree granting institutions only. Not for * government, commercial, or other organizational use. * File: recip.c * * MATLAB Coder version : 3.4 * C/C++ source code generated on : 14-May-2018 23:15:09 */ /* Include Files */ #include "rt_nonfinite.h" #include "butterBandpassOnly.h" #include "recip.h" /* Function Definitions */ /* * Arguments : const creal_T y * Return Type : creal_T */ creal_T recip(const creal_T y) { creal_T z; double brm; double bim; double d; brm = fabs(y.re); bim = fabs(y.im); if (y.im == 0.0) { z.re = 1.0 / y.re; z.im = 0.0; } else if (y.re == 0.0) { z.re = 0.0; z.im = -1.0 / y.im; } else if (brm > bim) { bim = y.im / y.re; d = y.re + bim * y.im; z.re = 1.0 / d; z.im = -bim / d; } else if (brm == bim) { bim = 0.5; if (y.re < 0.0) { bim = -0.5; } d = 0.5; if (y.im < 0.0) { d = -0.5; } z.re = bim / brm; z.im = -d / brm; } else { bim = y.re / y.im; d = y.im + bim * y.re; z.re = bim / d; z.im = -1.0 / d; } return z; } /* * File trailer for recip.c * * [EOF] */
18.115942
73
0.5152
YDWWYD
a62da07f811149d0e2be7f4c2209a16cede0f4e8
643
cpp
C++
knapsack-1.cpp
darksidergod/CompetitiveProgramming
ea0ee53bddd87e41b4586dd30c1d4a6b8ae3a93a
[ "MIT" ]
null
null
null
knapsack-1.cpp
darksidergod/CompetitiveProgramming
ea0ee53bddd87e41b4586dd30c1d4a6b8ae3a93a
[ "MIT" ]
null
null
null
knapsack-1.cpp
darksidergod/CompetitiveProgramming
ea0ee53bddd87e41b4586dd30c1d4a6b8ae3a93a
[ "MIT" ]
1
2020-10-03T19:48:05.000Z
2020-10-03T19:48:05.000Z
#include <bits/stdc++.h> #define ll long long using namespace std; int main(void) { ll int N, W, answer=-1; cin>>N>>W; ll int w[N+1]; ll int v[N+1]; w[0]=0; v[0]=0; for(ll int i=1; i<=N; i++) cin>>w[i]>>v[i]; ll int dp[N+1][W+1]; for(ll int j=0; j<=W; j++) dp[0][j]=0; for(ll int k=0; k<=N; k++) dp[k][0]=0; for(ll int item=1; item<=N; item++) { for(ll int weight=1; weight<=W; weight++) { if(w[item]>weight) dp[item][weight]=dp[item-1][weight]; else dp[item][weight]=max(v[item]+dp[item-1][weight-w[item]],dp[item-1][weight]); } } cout<<dp[N][W]<<"\n"; //cout<<answer<<"\n"; return 0; }
14.613636
80
0.525661
darksidergod
a62dc89fd74c9eb7cbeda08d8f4f934f217b7809
113,625
cpp
C++
Sandbox/Eudora/compmsgd.cpp
dusong7/eudora-win
850a6619e6b0d5abc770bca8eb5f3b9001b7ccd2
[ "BSD-3-Clause-Clear" ]
10
2018-05-23T10:43:48.000Z
2021-12-02T17:59:48.000Z
Windows/Sandbox/Eudora/compmsgd.cpp
officialrafsan/EUDORA
bf43221f5663ec2338aaf90710a89d1490b92ed2
[ "MIT" ]
1
2019-03-19T03:56:36.000Z
2021-05-26T18:36:03.000Z
Windows/Sandbox/Eudora/compmsgd.cpp
officialrafsan/EUDORA
bf43221f5663ec2338aaf90710a89d1490b92ed2
[ "MIT" ]
11
2018-05-23T10:43:53.000Z
2021-12-27T15:42:58.000Z
// COMPMSGD.CPP // #include "stdafx.h" #include <afxcmn.h> #include <QCUtils.h> #include "resource.h" #include "rs.h" #include "helpxdlg.h" #include "doc.h" #include "cursor.h" #include "fileutil.h" #include "summary.h" #include "msgdoc.h" #include "compmsgd.h" #include "mdichild.h" #include "CompMessageFrame.h" #include "font.h" #include "bmpcombo.h" #include "3dformv.h" #include "header.h" // for MIME.H #include "mime.h" // for TextReader class #include "headervw.h" #include "msgframe.h" #include "tocdoc.h" #include "utils.h" #include "guiutils.h" #include "address.h" #include "eudora.h" #include "progress.h" #include "sendmail.h" #include "changeq.h" #include "mainfrm.h" #include "filtersd.h" #include "tocview.h" #include "SaveAsDialog.h" #include "msgutils.h" #include "pop.h" #include "password.h" #include "persona.h" #include "msgopts.h" #include "PgMsgView.h" #include "PgCompMsgView.h" #include "Text2Html.h" #include "ems-wglu.h" #include "trnslate.h" #include "helpcntx.h" #include "utils.h" #include "nickdoc.h" #include "QCWorkerSocket.h" #include "NewMbox.h" #include "QCProtocol.h" #include "QCCommandActions.h" #include "QCCommandStack.h" #include "QCPluginCommand.h" #include "QCMailboxCommand.h" #include "QCMailboxDirector.h" #include "QCRecipientCommand.h" #include "QCRecipientDirector.h" #include "QCStationeryCommand.h" #include "QCStationeryDirector.h" #include "QCPersonalityCommand.h" #include "QCPersonalityDirector.h" #include "QCPluginCommand.h" #include "QCPluginDirector.h" #include "Automation.h" #include "AutoCompleteSearcher.h" #include "QCSharewareManager.h" #define DIM( a ) ( sizeof( a ) / sizeof( a[0] ) ) extern CString EudoraDir; extern QCCommandStack g_theCommandStack; extern QCMailboxDirector g_theMailboxDirector; extern QCRecipientDirector g_theRecipientDirector; extern QCStationeryDirector g_theStationeryDirector; extern QCPersonalityDirector g_thePersonalityDirector; extern QCPluginDirector g_thePluginDirector; #ifdef _DEBUG #undef THIS_FILE #ifndef DEBUG_NEW #define DEBUG_NEW new(__FILE__, __LINE__) #endif static char BASED_CODE THIS_FILE[] = __FILE__; #define new DEBUG_NEW #endif ///////////////////////////////////////////////////////////////////////////// // CCompMessageDoc IMPLEMENT_DYNCREATE(CCompMessageDoc, CMessageDoc) CCompMessageDoc::CCompMessageDoc() : m_FindHeaderIndex(-1) // negative value indicates that no Find actions have been executed { m_HasBeenSaved = FALSE; m_StationeryApplied = FALSE; m_MessageId = ""; // not really required, but... m_bIsStationery = FALSE; } BOOL CCompMessageDoc::InitializeNew ( const char* To, const char* From, const char* Subject, const char* Cc, const char* Bcc, const char* Attachments, const char* Body, const char* ECHeaders ) { m_Headers[HEADER_TO] = To; m_Headers[HEADER_FROM] = From? From : GetReturnAddress(); m_Headers[HEADER_SUBJECT] = Subject; m_Headers[HEADER_CC] = Cc; m_Headers[HEADER_BCC] = Bcc; m_Headers[HEADER_ATTACHMENTS] = Attachments; m_HeadersInvalidFlag[HEADER_TO] = FALSE; m_HeadersInvalidFlag[HEADER_FROM] = FALSE; m_HeadersInvalidFlag[HEADER_SUBJECT] = FALSE; m_HeadersInvalidFlag[HEADER_CC] = FALSE; m_HeadersInvalidFlag[HEADER_BCC] = FALSE; m_HeadersInvalidFlag[HEADER_ATTACHMENTS] = FALSE; SetText(Body); AssignMessageId(); // each message gets a unique id m_NextAutoSaveTime = time(NULL); //get the Creation time stamp m_ExtraHeaders.Format("%s<%s>\r\n", (LPCTSTR)CRString(IDS_HEADER_MESSAGE_ID), (LPCTSTR)m_MessageId); m_QCMessage.Init(m_MessageId, m_Text, FALSE); if ( ECHeaders ) { m_QCMessage.InitMap( ECHeaders ); m_QCMessage.NukeCIDs(); } // Take out attachments that are not found if (!IsHeaderEmpty(HEADER_ATTACHMENTS)) { BOOL MissingFile = FALSE; char* a = m_Headers[HEADER_ATTACHMENTS].GetBuffer(m_Headers[HEADER_ATTACHMENTS].GetLength()); char* semi; BOOL foundSemi = FALSE; while(strlen(a) > 0) //while (1) { if ( semi = strchr(a, ';') ) { *semi = 0; foundSemi = TRUE; } char* filename = a; while (*filename == ' ' || *filename == '\t') filename++; if (!::FileExistsMT(filename)) { MissingFile = TRUE; if (foundSemi) strcpy(a, semi + 1); else break; } else { if (foundSemi) { *semi = ';'; a = semi + 1; } else break; } foundSemi = FALSE; } m_Headers[HEADER_ATTACHMENTS].ReleaseBuffer(); if (MissingFile) ErrorDialog(IDS_ERR_MISSING_ATTACHMENT); } m_Sum = new CSummary; CTocDoc* OutToc; if (!m_Sum || !(OutToc = GetOutToc())) return (FALSE); OutToc->AddSum(m_Sum); if (!IsHeaderEmpty(HEADER_TO)) { char buf[128]; strncpy(buf, GetHeaderLine(HEADER_TO), sizeof(buf)); buf[sizeof(buf) - 1] = 0; m_Sum->SetFrom(GetRealName(buf)); } m_Sum->SetSubject(GetHeaderLine(HEADER_SUBJECT)); m_Sum->m_State = MS_UNSENDABLE; ReallySetTitle(m_Sum->MakeTitle()); if (GetIniShort(IDS_INI_SEND_MIME)) m_Sum->SetFlag(MSF_MIME); if (GetIniShort(IDS_INI_SEND_UUENCODE)) m_Sum->SetFlag(MSF_UUENCODE); if (GetIniShort(IDS_INI_USE_QP)) m_Sum->SetFlag(MSF_QUOTED_PRINTABLE); if (GetIniShort(IDS_INI_WORD_WRAP)) m_Sum->SetFlag(MSF_WORD_WRAP); if (GetIniShort(IDS_INI_TABS_IN_BODY)) m_Sum->SetFlag(MSF_TABS_IN_BODY); if (GetIniShort(IDS_INI_KEEP_COPIES)) m_Sum->SetFlag(MSF_KEEP_COPIES); if (GetIniShort(IDS_INI_TEXT_AS_DOC)) m_Sum->SetFlag(MSF_TEXT_AS_DOC); switch (IsFancy(Body)) { case IS_FLOWED: m_Sum->SetFlagEx(MSFEX_FLOWED); break; case IS_HTML: m_Sum->SetFlagEx(MSFEX_HTML); // fall through case IS_RICH: m_Sum->SetFlag(MSF_XRICH); break; } RemoveIniFromCache(IDS_INI_DEFAULT_TRANSLATOR); CString defINITrans = GetIniString(IDS_INI_DEFAULT_TRANSLATOR); CString defFlaggedTrans; ((CEudoraApp *)AfxGetApp())->GetTranslators()->GetDefOutTransString(defFlaggedTrans); if (!defINITrans.IsEmpty() && !defFlaggedTrans.IsEmpty()) defINITrans += ','; defINITrans += defFlaggedTrans; if (!defINITrans.IsEmpty()) { defINITrans = "<" + defINITrans; defINITrans += ">"; m_Sum->SetTranslators(defINITrans, TRUE); } return (TRUE); } BOOL CCompMessageDoc::OnNewDocument() { if (!CMessageDoc::OnNewDocument()) return (FALSE); return (TRUE); } CCompMessageDoc::~CCompMessageDoc() { if ( m_bIsStationery ) { CTocDoc* OutToc = GetOutToc(); CSummary* Sum = m_Sum; if (Sum) { // Remove the link between the message doc and the summary because otherwise // deleting the summary (done in RemoveSum()) will cause the message doc to // be deleted. And look where we are? The destructor of the message doc! // That's a double delete, my friend, and that will make you crash and burn! m_Sum = NULL; OutToc->RemoveSum(Sum); } } } void CCompMessageDoc::SetTitle(const char* pszTitle) { if (!m_bIsStationery) { // The title should only have to be set once. This prevents screen flicker when saving. if (m_strTitle.IsEmpty()) CDocument::SetTitle(pszTitle); } else { CString title; int filenameStart = m_strPathName.ReverseFind(SLASH); if (filenameStart > 0) { //Strip the Path title = m_strPathName.Right(m_strPathName.GetLength() - filenameStart - 1); //Strip the Extension if ( title.ReverseFind('.') > 0 ) title = title.Left(title.GetLength() - 4); } else title = CRString(IDS_UNTITLED); title += " - "; title += CRString(IDR_STATIONERY); CDocument::SetTitle(title); } } // BADSTUFF: this routine has been badly hacked to "know" about Paige message // views, but still return a CCompMessageView. Hopefully this will die before // I have to check-in this module, but ya never know. CView* CCompMessageDoc::GetView() { // Note: this routine is symptomatic of a general architectural problem // with our "design". A document should not care about the types of // views that are attached to it. POSITION pos = GetFirstViewPosition(); while ( pos ) { CView* pCV = GetNextView( pos ); VERIFY( pCV ); BOOL isCV = pCV->IsKindOf( RUNTIME_CLASS(PgMsgView) ); if ( isCV ) return pCV; } return NULL; } CView* CCompMessageDoc::GetCompView() { //This routine currently only returns the PgCompMsgView //Don't try to use this to get a *preview* View POSITION pos = GetFirstViewPosition(); while ( pos ) { CView* pCV = GetNextView( pos ); VERIFY( pCV ); //BOOL isHV = pCV->IsKindOf( RUNTIME_CLASS(CHeaderView) ); BOOL isCV = pCV->IsKindOf( RUNTIME_CLASS(PgCompMsgView) ); //if ( !isHV ) if ( isCV ) return pCV; } return NULL; } CHeaderView* CCompMessageDoc::GetHeaderView() { // Note: this routine is symptomatic of a general architectural problem // with our "design". A document should not care about the types of // views that are attached to it. POSITION pos = GetFirstViewPosition(); while ( pos ) { CView* pHV = GetNextView( pos ); VERIFY( pHV ); BOOL isHV = pHV->IsKindOf( RUNTIME_CLASS(CHeaderView) ); if ( isHV ) return (CHeaderView*) pHV; } return NULL; } BOOL CCompMessageDoc::AddAttachment( const char* Filename ) { VERIFY( Filename ); CHeaderView* pHV = GetHeaderView(); pHV->AddAttachment( Filename ); return TRUE; } BOOL CCompMessageDoc::SaveModified() { if (m_bIsStationery) { if ( IsModified() ) { //Hasn't ever been saved before if ( m_strPathName.Compare("A") == 0 ) { CRString prompt(IDS_SAVE_STATIONERY_CHANGES); switch (AfxMessageBox(prompt, MB_YESNOCANCEL)) { case IDCANCEL: return (FALSE); case IDYES: OnFileSaveAsStationery(); //If the user chose cancel in the SaveAs dlg, dont' close the window if ( m_strPathName.Compare("A") == 0 ) return (FALSE); break; case IDNO: SetModifiedFlag(FALSE); break; } } else { //Resave/Update the document?? CString prompt; AfxFormatString1(prompt, IDS_SAVE_CHANGES, m_strPathName); switch (AfxMessageBox(prompt, MB_YESNOCANCEL)) { case IDCANCEL: return (FALSE); // don't continue case IDYES: { JJFile theFile; if (FAILED(theFile.Open( m_strPathName, O_CREAT | O_TRUNC | O_WRONLY))) return (FALSE); CMessageDoc::OnFileSave(); WriteAsText( &theFile, TRUE ); // If so, either Save or Update, as appropriate //if (!DoSave(m_strPathName)) // return (FALSE); // don't continue } break; case IDNO: // If we get here, it may be the case that the user hit // No when asked to save the changes. If this is so, then the modified // flag needs to be cleared so the save prompt doesn't come up again. SetModifiedFlag(FALSE); //return (FALSE); break; default: ASSERT(FALSE); return (FALSE); // don't continue } } } //Except for the case of cancel, close the window and //remove the summary from the Out Toc //CTocDoc* OutToc = GetOutToc(); OnCloseDocument(); //if ( !m_Sum || !(OutToc) ) // OutToc->RemoveSum(m_Sum); //Closed and deleted from the outbox, so don't continuue //OnMessageDelete(); return FALSE; } //For other comp messages if (IsModified()) { if (CMessageDoc::SaveModified() == FALSE) return (FALSE); if (m_HasBeenSaved == FALSE) { // // If we get this far, then the user has chosen to trash this // message. So, now we need to check whether there are any // MAPI attachments. If the user's MAPI settings are such // deleting MAPI attachments is allowed, then blow away each // MAPI attachment file. // if (m_Sum->IsMAPI()) { GetText(); // make sure body is read up CString attachments(GetHeaderLine(HEADER_ATTACHMENTS)); if (! attachments.IsEmpty()) { char attachments_dir[_MAX_PATH + 1]; GetIniString(IDS_INI_AUTO_RECEIVE_DIR, attachments_dir, sizeof(attachments_dir)); if (attachments_dir[0] == '\0') wsprintf(attachments_dir,"%s%s", (const char *) EudoraDir, (const char *) CRString(IDS_ATTACH_FOLDER)); const int ATTACHMENTS_DIR_LEN = strlen(attachments_dir); int idx; while ((idx = attachments.Find(';')) != -1) { // // If the attachment file is in the Eudora attachments // directory, then delete the file. // CString attachment(attachments.Left(idx)); if (strnicmp(attachments_dir, attachment, ATTACHMENTS_DIR_LEN) == 0) ::FileRemoveMT(attachment); // // Removed processed attachment filename by shifting string. // attachments = attachments.Right(attachments.GetLength() - (idx + 1)); } // // Delete the last file in the list, if it is in the Eudora // attachments directory. // if (! attachments.IsEmpty()) { if (strnicmp(attachments_dir, attachments, ATTACHMENTS_DIR_LEN) == 0) ::FileRemoveMT(attachments); } } } // what he said, but for the .msg command line stuff if ( m_Sum->IsAutoAttached() ) { // extract the attachment filename CString AttachStr(GetHeaderLine(HEADER_ATTACHMENTS)); char* Attach = AttachStr.GetBuffer(AttachStr.GetLength()); while (Attach && *Attach) { char *t = strchr(Attach, ';'); if (t) { *t++ = 0; if (*t == ' ') t++; } // expects a fully-qualified filename ::FileRemoveMT( Attach ); Attach = t; } } } } return (TRUE); } ///////////////////////////////////////////////////////////////////////////// // CSendStylesDialog dialog class CSendStylesDialog : public CDialog { // Construction public: CSendStylesDialog(CWnd* pParent = NULL); // standard constructor virtual BOOL OnInitDialog(); // Dialog Data //{{AFX_DATA(CSendStylesDialog) enum { IDD = IDD_SENDING_STYLES }; CButton m_SendPlainAndStyled; CButton m_WarnCheckbox; CButton m_SendStyled; CButton m_SendPlain; //}}AFX_DATA // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CSendStylesDialog) protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support //}}AFX_VIRTUAL // Implementation protected: // Generated message map functions //{{AFX_MSG(CSendStylesDialog) afx_msg void OnSendPlain(); afx_msg void OnSendPlainAndStyled(); afx_msg void OnSendStyled(); afx_msg void OnButtonPress(UINT ButtonID); //}}AFX_MSG DECLARE_MESSAGE_MAP() }; ///////////////////////////////////////////////////////////////////////////// // CSendStylesDialog dialog CSendStylesDialog::CSendStylesDialog(CWnd* pParent /*=NULL*/) : CDialog(CSendStylesDialog::IDD, pParent) { //{{AFX_DATA_INIT(CSendStylesDialog) //}}AFX_DATA_INIT // We better not be creating this dialog if the warning is off ASSERT(GetIniShort(IDS_INI_WARN_QUEUE_STYLED_TEXT)); } BOOL CSendStylesDialog::OnInitDialog() { if (!CDialog::OnInitDialog()) return FALSE; if (GetIniShort(IDS_INI_SEND_PLAIN_ONLY)) { m_SendPlain.SetFocus(); SetDefID(IDC_SEND_PLAIN); } else if (GetIniShort(IDS_INI_SEND_STYLED_ONLY)) { m_SendStyled.SetFocus(); SetDefID(IDC_SEND_STYLED); } else { // This better be set if the above two aren't ASSERT(GetIniShort(IDS_INI_SEND_PLAIN_AND_STYLED)); m_SendPlainAndStyled.SetFocus(); SetDefID(IDC_SEND_PLAIN_AND_STYLED); } // We set the focus, so return FALSE return FALSE; } void CSendStylesDialog::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CSendStylesDialog) DDX_Control(pDX, IDC_SEND_PLAIN_AND_STYLED, m_SendPlainAndStyled); DDX_Control(pDX, IDC_WARN_CHECKBOX, m_WarnCheckbox); DDX_Control(pDX, IDC_SEND_STYLED, m_SendStyled); DDX_Control(pDX, IDC_SEND_PLAIN, m_SendPlain); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CSendStylesDialog, CDialog) //{{AFX_MSG_MAP(CSendStylesDialog) ON_COMMAND_EX(IDC_SEND_PLAIN, OnButtonPress) ON_COMMAND_EX(IDC_SEND_STYLED, OnButtonPress) ON_COMMAND_EX(IDC_SEND_PLAIN_AND_STYLED, OnButtonPress) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CSendStylesDialog message handlers void CSendStylesDialog::OnButtonPress(UINT ButtonID) { if (m_WarnCheckbox.GetCheck()) { // A little verbose, but it prevents a setting from being turned off, then on again, // which would cause a default setting to be written to the .INI file switch (ButtonID) { case IDC_SEND_PLAIN: SetIniShort(IDS_INI_SEND_PLAIN_ONLY, TRUE); SetIniShort(IDS_INI_SEND_STYLED_ONLY, FALSE); SetIniShort(IDS_INI_SEND_PLAIN_AND_STYLED, FALSE); break; case IDC_SEND_STYLED: SetIniShort(IDS_INI_SEND_PLAIN_ONLY, FALSE); SetIniShort(IDS_INI_SEND_STYLED_ONLY, TRUE); SetIniShort(IDS_INI_SEND_PLAIN_AND_STYLED, FALSE); break; case IDC_SEND_PLAIN_AND_STYLED: SetIniShort(IDS_INI_SEND_PLAIN_ONLY, FALSE); SetIniShort(IDS_INI_SEND_STYLED_ONLY, FALSE); SetIniShort(IDS_INI_SEND_PLAIN_AND_STYLED, TRUE); break; default: // This better not happpen ASSERT(0); break; } SetIniShort(IDS_INI_WARN_QUEUE_STYLED_TEXT, FALSE); } EndDialog(ButtonID); } // BadRecipient // // Tells whether or not there is a problem with a particular // recipient or there are no recipients at all. // BOOL CCompMessageDoc::BadRecipient() { char* Expanded; BOOL bIsEmpty = TRUE; Expanded = ExpandAliases(GetHeaderLine(HEADER_TO), TRUE, TRUE, TRUE, TRUE); if (!Expanded) return TRUE; bIsEmpty = bIsEmpty && !*Expanded; delete [] Expanded; Expanded = ExpandAliases(GetHeaderLine(HEADER_CC), TRUE, TRUE, TRUE, TRUE); if (!Expanded) return TRUE; // Can't send with just Cc: recipient, so don't update bIsEmpty delete [] Expanded; Expanded = ExpandAliases(GetHeaderLine(HEADER_BCC), TRUE, TRUE, TRUE, TRUE); if (!Expanded) return TRUE; bIsEmpty = bIsEmpty && !*Expanded; delete [] Expanded; if (bIsEmpty) { if (!gbAutomationCall) { // BOG: this is a hack for queueing through MAPI; it really ain't // the way to go in the long run, but... AfxGetMainWnd()->SetForegroundWindow(); // EndHack ErrorDialog(IDS_ERR_COMP_NEED_RCPT); } return TRUE; } return FALSE; } BOOL CCompMessageDoc::Queue(BOOL autoSend /*= FALSE*/) { // BADSTUFF CView* View = GetView(); if ( !m_Sum || m_Sum->CantEdit() ) { ASSERT( FALSE ); return FALSE; } // Spell check if necessary if ( View && !autoSend && GetIniShort( IDS_INI_SPELL_ON_QUEUE ) ) { QCProtocol* pProtocol = QCProtocol::QueryProtocol( QCP_SPELL, ( CObject* )View ); if( pProtocol == NULL ) return FALSE; int ret = pProtocol->CheckSpelling( TRUE ); if ( ret == IDCANCEL ) return FALSE; if ( ret < 0 ) { if ( GetIniShort( IDS_INI_SPELL_ON_QUEUE_WARN ) ) { if ( !gbAutomationCall ) { if ( WarnDialog( IDS_INI_SPELL_ON_QUEUE_WARN, IDS_WARN_SPELL_ON_QUEUE_FAIL ) != IDOK ) return FALSE; } } } } if (BadRecipient()) return (FALSE); const char* Subject = GetHeaderLine(HEADER_SUBJECT); if (!autoSend && GetIniShort(IDS_INI_WARN_QUEUE_NO_SUBJECT) && (!Subject || !*Subject)) { if (!gbAutomationCall) { if (WarnDialog(IDS_INI_WARN_QUEUE_NO_SUBJECT, IDS_WARN_QUEUE_NO_SUBJECT) != IDOK) return (FALSE); } } const char* Attachments = GetHeaderLine(HEADER_ATTACHMENTS); if (!autoSend && GetIniShort(IDS_INI_WARN_QUEUE_BIG_MESSAGE) ) { long EstSize = ::SafeStrlenMT(GetText()); // 9/16 Changed from GetBody()); if ( Attachments && *Attachments ) { // add the size of the attachments while (1) { const char* End = strchr(Attachments, ';'); char Filename[_MAX_PATH + 1]; if (!End) End = Attachments + strlen(Attachments); while (*Attachments == ' ') Attachments++; int Length = End - Attachments; strncpy(Filename, Attachments, Length); Filename[Length] = 0; if (*Filename) { CString fc(Filename); char* FilenameCopy = fc.GetBuffer(fc.GetLength() + 1); CFileStatus Status; if (!CFile::GetStatus(FilenameCopy, Status)) { ErrorDialog(IDS_ERR_OPEN_ATTACH, Filename); return (FALSE); } EstSize += ((Status.m_size * 4L) / 3L); } if (!*End) break; Attachments = End + 1; } } long BigSize = GetIniLong(IDS_INI_WARN_QUEUE_BIG_MESSAGE_SIZE) * 1024L; if (!gbAutomationCall) { if (EstSize > BigSize && WarnDialog(IDS_INI_WARN_QUEUE_BIG_MESSAGE, IDS_WARN_QUEUE_BIG_MESSAGE, (EstSize / 1024L)) != IDOK) { return (FALSE); } } } // Here we're going to look through the recipient headers and check them for names we can add to // Our AutoCompleter History list. We've previously turned on an expanded flag if the header has // undergone expansion. This is important because if you type a nickname and it's expanded the // names that were expanded out are not something you've typed and therefore shouldn't be added // to a list of "Typing Shortcuts" CHeaderView* pHView = GetHeaderView(); CHeaderField* pHField = NULL; // We grab the addresses from each header and then put // them in the list if they should be put there. /* if (pHView) { CString addresses = ""; pHField = pHView->GetHeaderCtrl(HEADER_TO); if (pHField && pHField->GetExpanded() == false) {// We have a candidate for name grabbing. addresses += pHField->GetText(); addresses += ", "; pHField = NULL; } pHField = pHView->GetHeaderCtrl(HEADER_CC); if (pHField && pHField->GetExpanded() == false) {// We have a candidate for name grabbing. addresses += pHField->GetText(); addresses += ", "; pHField = NULL; } pHField = pHView->GetHeaderCtrl(HEADER_BCC); if (pHField && pHField->GetExpanded() == false) {// We have a candidate for name grabbing. addresses += pHField->GetText(); } bool done = false; while (!done) { CString oneaddress; int length = addresses.Find(','); if (length == -1) { done = true; if (addresses.GetLength() == 0) break; oneaddress = addresses; } else { oneaddress = addresses.Left(length); addresses = addresses.Right(addresses.GetLength() - (length+1)); } oneaddress.TrimLeft(); oneaddress.TrimRight(); char *nameToAdd = oneaddress.GetBuffer(0); if (g_AutoCompleter) g_AutoCompleter->Add(nameToAdd); oneaddress.ReleaseBuffer(); } } */ // Copy the text in the headers from the control to the document // if (View && IsModified()) // View->SaveHeaders(); // if (IsModified() && !OnSaveDocument(NULL)) if(!OnSaveDocument(NULL)) return (FALSE); // Here's the scoop behind the MSFEX_SEND_PLAIN and MSFEX_SEND_STYLED flags: // // If both the message and the signature contain no styles, then both // flags are unset. If there are some styles present, then the two flags // tell which versions to send. So a flag being set means that there are // some styles in the message, and that particular version (plain or styled) // of the message should be sent. // // If we've saved a message with styles only because it has excerpts, then the MSFEX_SEND_PLAIN flag // will be set (and MSFEX_SEND_STYLED won't be set) so that we wind up just sending plain text. const BOOL bBodyExcerptOnly = (m_Sum->GetFlagsEx() & MSFEX_SEND_PLAIN) && !(m_Sum->GetFlagsEx() & MSFEX_SEND_STYLED); BOOL bSendStyles = FALSE; if (m_Sum->IsXRich() && !bBodyExcerptOnly) bSendStyles = TRUE; else { // If only the signature has styles, then IDS_INI_STYLED_SIG controls whether // or not a styled signature should get sent with styles or just plain. char* Sig = NULL; if (GetIniShort(IDS_INI_SEND_STYLED_SIG) && (Sig = GetSignature(this, FALSE)) && IsFancy(Sig) >= IS_RICH) { bSendStyles = TRUE; } delete [] Sig; } if (!bSendStyles) { if (!bBodyExcerptOnly) { m_Sum->UnsetFlagEx(MSFEX_SEND_PLAIN); m_Sum->UnsetFlagEx(MSFEX_SEND_STYLED); } } else { if (!autoSend && GetIniShort(IDS_INI_WARN_QUEUE_STYLED_TEXT)) { // Let user tell us what to send CSendStylesDialog dlg; switch (dlg.DoModal()) { case IDCANCEL: return (FALSE); case IDC_SEND_PLAIN: m_Sum->SetFlagEx(MSFEX_SEND_PLAIN); m_Sum->UnsetFlagEx(MSFEX_SEND_STYLED); break; case IDC_SEND_STYLED: m_Sum->UnsetFlagEx(MSFEX_SEND_PLAIN); m_Sum->SetFlagEx(MSFEX_SEND_STYLED); break; case IDC_SEND_PLAIN_AND_STYLED: m_Sum->SetFlagEx(MSFEX_SEND_PLAIN); m_Sum->SetFlagEx(MSFEX_SEND_STYLED); break; default: // Should never get here... ASSERT(0); } } else { // Use setting to determine what to send if (GetIniShort(IDS_INI_SEND_PLAIN_AND_STYLED)) { m_Sum->SetFlagEx(MSFEX_SEND_PLAIN); m_Sum->SetFlagEx(MSFEX_SEND_STYLED); } else if (GetIniShort(IDS_INI_SEND_STYLED_ONLY)) { m_Sum->UnsetFlagEx(MSFEX_SEND_PLAIN); m_Sum->SetFlagEx(MSFEX_SEND_STYLED); } else { m_Sum->SetFlagEx(MSFEX_SEND_PLAIN); m_Sum->UnsetFlagEx(MSFEX_SEND_STYLED); } } } if (!m_Sum->GetTranslators().IsEmpty()) { CTranslatorManager* trans = ((CEudoraApp *)AfxGetApp())->GetTranslators(); if ( !trans->CanXLateMessageOut(this, EMSF_Q4_TRANSMISSION | EMSF_Q4_COMPLETION) ) return (FALSE); // // Do we have any OnCompletion translators? // If so, go ahead and translate the message now. // if (GetIniShort(IDS_INI_ALLOW_COMPLETION_PLUGINS) && trans->CanXLateMessageOut(this, EMSF_Q4_COMPLETION ) ) { char cooked[_MAX_PATH]; HRESULT hr = OnCompletionTranslate(cooked); if ( FAILED(hr) ) return (FALSE); // // Delete attachments from header and attach newly // translated file (.msg). Clear Body as well. // m_Sum->SetFlagEx(MSFEX_MIME_ATTACHED); m_Sum->SetFlagEx(MSFEX_AUTO_ATTACHED); AddAttachment(cooked); SetHeaderLine(HEADER_ATTACHMENTS, cooked); m_Sum->SetTranslators(""); QCProtocol* pProtocol = QCProtocol::QueryProtocol( QCP_TRANSLATE, ( CObject* )GetView() ); if( pProtocol == NULL ) return FALSE; pProtocol->SetAllText("", FALSE); if (!OnSaveDocument(NULL)) return (FALSE); // make read only } } // No need to do this anymore because saving the message sets the date/time // of the summary. That's because the Date: header should contain the last // date/time the message was edited, not when it was queued/sent. // // //If msg could not be sent, then it is queued with the current time again. // //Since the send code changes the time zone minutes, we need to reset it. // m_Sum->m_Seconds = time(NULL); // m_Sum->m_TimeZoneMinutes = 0; // m_Sum->FormatDate(); m_Sum->SetState(MS_QUEUED); // Close up message window if (m_Sum->m_FrameWnd) { // Close the window, but don't destroy the document because // we're going to need it later when we send the message m_bAutoDelete = FALSE; OnCloseDocument(); m_bAutoDelete = TRUE; } SetQueueStatus(); return (TRUE); } HRESULT CCompMessageDoc::OnCompletionTranslate(char* cookedMsg) { HRESULT hr; char* ptr; int err; // // Create an object to encode the message and send its // MIME parts to the spool file. // QCSMTPMessage SendMsg(this); CString raw = GetTmpFileNameMT(); hr = SendMsg.Start(raw); if ( FAILED(hr) ) goto fail; // hr = SendMsg.WriteHeaders(); // if ( FAILED(hr) ) goto fail; // // Save MIME encoded body to temp file // hr= SendMsg.WriteBody(); if ( FAILED(hr) ) goto fail; hr = SendMsg.End(); // Translate it and store it in new file called COOKED. // char cooked[_MAX_PATH]; *cooked = 0; err = GetTransMan()->XLateMessageOut(EMSF_Q4_TRANSMISSION | EMSF_Q4_COMPLETION | EMSF_WHOLE_MESSAGE | EMSF_REQUIRES_MIME | EMSF_GENERATES_MIME, this, raw, cooked); DeleteFile(raw); if ( err != EMSR_OK ) { DeleteFile(cooked); CloseProgress(); return E_FAIL; } // // Rename the file from .tmp to .msg // strcpy(cookedMsg,cooked); strlwr(cookedMsg); ptr = strstr(cookedMsg,".tmp"); if (ptr) { strcpy(ptr,".msg"); hr = ::FileRenameMT(cooked,cookedMsg); } CloseProgress(); return hr; fail: HRESULT hr2; hr2 = SendMsg.End(); // what to do about return value here... DeleteFile(raw); CloseProgress(); return hr; } const char* CCompMessageDoc::SetHeaderLine(int i, const char* NewText) { CHeaderView* View = NULL; if ( i == HEADER_CURRENT ) { View = GetHeaderView(); if (View) i = View->GetCurrentHeader(); if ( i < 0 || i >= MaxHeaders ) return NULL; } ASSERT(i >= 0 && i < MaxHeaders); if ( i < NumHeaders ) { if (View == NULL) View = GetHeaderView(); if (View) View->SetText(i, NewText); } return (m_Headers[i] = NewText); } const char* CCompMessageDoc::GetHeaderLine( int i ) { CHeaderView* pHView = NULL; if ( i == HEADER_CURRENT ) { pHView = GetHeaderView(); if (pHView) i = pHView->GetCurrentHeader(); } if ( i >= 0 && i < MaxHeaders ) { if ( i < NumHeaders ) { if ( pHView == NULL ) pHView = GetHeaderView(); if ( pHView ) { m_Headers[i] = pHView->GetText( i ); } } return ( m_Headers[i] ); } ASSERT( 0 ); return NULL; } BOOL CCompMessageDoc::IsHeaderEmpty(int i) { const char* Header = GetHeaderLine(i); return (Header && *Header? FALSE : TRUE); } void CCompMessageDoc::SetHeaderAsInvalid(int nHeader, BOOL bInvalid) { m_HeadersInvalidFlag[nHeader] = bInvalid; } BOOL CCompMessageDoc::Read() { UINT uLen; if (!CMessageDoc::Read()) return (FALSE); // // m_ExtraHeaders is an additive variable so let's clean it out just // in case some residue is left. The reason for this is because PgMsgView // chooses to nullify m_text to conserve memory. // m_ExtraHeaders=""; // get the Translation X-Header char *Trans = HeaderContents(IDS_TRANS_XHEADER, m_Text); if (Trans) { m_Sum->SetTranslators(Trans); delete []Trans; } // get the Signature X-Header char *sigstr = HeaderContents(IDS_SIGNATURE_XHEADER, m_Text); if (sigstr) { char *cp = sigstr; if (*cp == '<' && *(cp + strlen(cp) - 1) == '>') { cp++; *(cp + strlen(cp) - 1) = '\0'; m_Sum->m_SigSelected = m_Sum->m_SigHdr = cp; } delete[] sigstr; } // get the Persona X-Header char *Persona = HeaderContents(IDS_PERSONA_XHEADER, m_Text); if (Persona) { char *cp = Persona; if (*cp == '<' && *(cp + strlen(cp) - 1) == '>') { cp++; *(cp + strlen(cp) - 1) = '\0'; m_Sum->SetPersona( cp ); } delete [] Persona; } // get the Precedence Header char *prec = HeaderContents(IDS_PRECEDENCE_HEADER, m_Text); if (prec) { m_Sum->SetPrecedence(prec); delete [] prec; } // Go through the message and parcel out each item char* t = m_Text; while (t && *t != '\r' && *t != '\n' && *t) { char * start = t; char * end; BOOL bConsumed = FALSE; // strip "\r\n" if ( end = strchr( t, '\n') ) { if ( end[ -1 ] == '\r') end[ -1 ] = '\0'; end[0] = '\0'; } else { // // What we have here is a corrupted message that doesn't // have a CR/LF to terminate the current line of the message. // Bail the header processing loop, placing a canned // blurb into the message body stating that the message is // corrupted. // ASSERT( FALSE ); // every line should have a delimiter delete [] m_Text; CRString corrupted(IDS_ERR_CORRUPTED_MESSAGE); m_Text = new char[corrupted.GetLength() + 1]; if (m_Text) strcpy(m_Text, corrupted); t = NULL; break; } char* colon = strchr( t, ':' ); if ( colon ) { // Check if this is a header we use? int i = FindRStringIndexI(IDS_HEADER_TO, IDS_HEADER_REFERENCES, t, colon - t); // If found, fill in the value for display. if (i >= 0) { // Get the value for the header if (*++colon == ' ') colon++; m_Headers[i] = colon; bConsumed = TRUE; } } while ( ! bConsumed ) // will only run once { bConsumed = TRUE; char ours[ 80 ]; QCLoadString( IDS_TRANS_XHEADER, ours, sizeof( ours ) ); if ( strstr( start, ours ) == start ) continue; QCLoadString( IDS_SIGNATURE_XHEADER, ours, sizeof( ours ) ); if ( strstr( start, ours ) == start ) continue; QCLoadString( IDS_PERSONA_XHEADER, ours, sizeof( ours ) ); if ( strstr( start, ours ) == start ) continue; QCLoadString( IDS_PRECEDENCE_HEADER, ours, sizeof( ours ) ); if ( strstr( start, ours ) == start ) continue; // save extra headers if (! m_ExtraHeaders.IsEmpty() ) m_ExtraHeaders += "\r\n"; m_ExtraHeaders += start; } // go on to next header t = end + 1; } // delimit the extra headers if (! m_ExtraHeaders.IsEmpty() ) m_ExtraHeaders += "\r\n"; // default From: if need be if ( m_Headers[ HEADER_FROM ].IsEmpty() ) { m_Headers[ HEADER_FROM ] = GetReturnAddress(); } #ifndef unix int hasLF = 1; #else int hasLF = 0; #endif // find the begining of the body which start with a \n // step over it so the body start at the first line if (t && (t = strchr(t + hasLF, '\n'))) strcpy(m_Text, t + 1); // strip off the trailing \r\n we added on save if ( ( uLen = strlen( m_Text ) ) >= 2 ) { if( ( m_Text[ uLen - 1 ] == '\n' ) && ( m_Text[ uLen - 2 ] == '\r' ) ) { // truncate it at the \r\n m_Text[ uLen - 2 ] = '\0'; } } m_HasBeenSaved = TRUE; //Reset these flags only if they haven't been set yet..they should never be set to TRUE m_HeadersInvalidFlag[HEADER_FROM] = FALSE; m_HeadersInvalidFlag[HEADER_SUBJECT] = FALSE; m_HeadersInvalidFlag[HEADER_ATTACHMENTS] = FALSE; return (TRUE); } // Write BOOL CCompMessageDoc::Write() { return (Write((JJFile*)NULL)); } BOOL CCompMessageDoc::Write(JJFile* out) { char* mes = NULL; int CreatedJJFile = FALSE; CTocDoc *OutToc = GetOutToc(); if (!OutToc) return (FALSE); m_Sum->m_TheToc = OutToc; // Save the flags if (!out) { CHeaderView* pHView = GetHeaderView(); // BADSTUFF - Here we just hacked it to use our Paige derived view. This // sucks just as bad; we need to use protocols to solve this view- // dependancy stuff. CView* View = GetView(); if ( View && pHView ) { pHView->SaveToDoc(); ((PgMsgView*)View)->SaveInfo(); if (!IsHeaderEmpty(HEADER_ATTACHMENTS)) m_Sum->SetFlag(MSF_HAS_ATTACHMENT); else m_Sum->UnsetFlag(MSF_HAS_ATTACHMENT); OutToc->SetModifiedFlag(); } } // Let's not waste time and disk space, shall we if (!out && m_HasBeenSaved && !IsModified()) return (TRUE); else OutToc->SetModifiedFlag(); while (1) { char buf[256]; if (!out) { out = new JJFile; CreatedJJFile = TRUE; if (FAILED(out->Open(OutToc->MBFilename(), O_APPEND | O_RDWR))) break; } // Get the offset of the start of the message long Start = 0; out->Tell(&Start); ASSERT(Start >= 0); // Write From line CTime Time(CTime::GetCurrentTime()); if (Time.GetTime() < 0) Time = 0; CString FromString = ::FormatTimeMT(Time.GetTime(), GetIniString(IDS_FROM_CTIME_FORMAT)); if (FAILED(out->PutLine(FromString))) break; // Write out headers int i = 0; for (; i < MaxHeaders; i++) { if (FAILED(out->Put(CRString(IDS_HEADER_TO + i))) || FAILED(out->Put(" "))) break; char* t = m_Headers[i].GetBuffer(m_Headers[i].GetLength()); char* HL = t; char* n = t; while (n && (*n == ' ' || *n == '\t')) n++; for (; n && *n; n++) { if (*n == '\n') *t++ = ' '; else if (*n != '\r') *t++ = *n; } if (t) { *t = 0; if (FAILED(out->Put(HL))) break; } if (FAILED(out->PutLine())) break; m_Headers[i].ReleaseBuffer(); } // Did something go wrong? if (i != MaxHeaders) break; // Add any extra headers if ( ! m_ExtraHeaders.IsEmpty() ) { if (FAILED(out->Put(m_ExtraHeaders))) break; } // Put the Translator Header CString TransString; CString Tltrs = m_Sum->GetTranslators(); if (!Tltrs.IsEmpty()) { TransString.Format(CRString(IDS_TRANS_XHEADER_FORMAT),(const char *)Tltrs); if (FAILED(out->PutLine(TransString))) break; } // Put the Signature Header CString SigString = m_Sum->m_SigSelected; if (!SigString.IsEmpty()) { CString szTemp; szTemp.Format(CRString(IDS_SIGNATURE_XHEADER_FORMAT),(const char *)SigString); if (FAILED(out->PutLine(szTemp))) break; m_Sum->m_SigHdr = m_Sum->m_SigSelected; } // Put the Persona Header CString PersonaString; CString Persona = m_Sum->GetPersona(); if (!Persona.IsEmpty()) { PersonaString.Format(CRString(IDS_PERSONA_XHEADER_FORMAT),(const char *)Persona); if (FAILED(out->PutLine(PersonaString))) break; } // Put the Precedence Header CString PrecString; CString Precedence = m_Sum->GetPrecedence(); if (!Precedence.IsEmpty()) { PrecString.Format(CRString(IDS_PRECEDENCE_HEADER_FORMAT),(const char *)Precedence); if (FAILED(out->PutLine(PrecString))) break; } // BOG: write the "embedded object headers"; these don't go out // over the wire. CString eoHeaders; m_QCMessage.GetEmbeddedObjectHeaders( eoHeaders ); if ( !eoHeaders.IsEmpty() ) { if (FAILED(out->Put(eoHeaders) < 0)) break; if (FAILED(out->PutLine())) break; } // Separate Header section from the Body of the message if (FAILED(out->PutLine())) break; if (!m_Text) break; //If we add space or quote at the beginning of lines starting //with "From ", then we should read the body text again. Else, the //send code just calls GetFullMessage which detects m_text is already //loaded up. But we just wrote some spaces or >s into the mbx file, //but haven't changed m_text itself. BOOL bNeedReRead = FALSE; char* Text = m_Text; do { long len = strcspn(Text, "\n"); if (Text[len] == '\n') len++; // Quote From lines //For html msgs we add a space since spaces at the beginning of the line //are collapsed anyway on display //For all other msg types we quote the from line if ( m_Sum->IsHTML() ) { if ( Text[0] == 'F' && Text[1] == 'r' && Text[2] == 'o' && Text[3] == 'm' && Text[4] == ' ' ) { if (FAILED(out->Put(' '))) break; bNeedReRead = TRUE; } } else if ( IsFromLine(Text) ) { if ( FAILED(out->Put(' '))) break; bNeedReRead = TRUE; } if (FAILED(out->Put(Text, len))) break; Text += len; } while (*Text); // Did something go wrong? if (*Text) break; // add the body separator if (FAILED(out->PutLine())) break; // Update the message summary CSummary::m_lBegin = Start; out->Seek(Start); m_Sum->SetFrom(NULL); m_Sum->SetSubject(NULL); // m_Sum->SetDate(NULL); // Save State and Date since Build() changes it short state = m_Sum->m_State; strcpy(buf, m_Sum->m_Date); m_Sum->m_TheToc->m_DelSpace += m_Sum->m_Length; m_Sum->m_TheToc->m_MesSpace -= m_Sum->m_Length; m_Sum->Build(out); m_Sum->m_TheToc->m_MesSpace += m_Sum->m_Length; m_Sum->m_TheToc->m_TotalSpace += m_Sum->m_Length; m_Sum->SetState( (char)state); m_Sum->SetDate(time(NULL) + (GetGMTOffset() * 60)); if (m_Sum->IsQueued() == FALSE) { m_Sum->SetState(!IsHeaderEmpty(HEADER_TO) || !IsHeaderEmpty(HEADER_BCC)? MS_SENDABLE : MS_UNSENDABLE); } // Possibly change the title info ReallySetTitle(m_Sum->MakeTitle()); if (CreatedJJFile) { out->Close(); OutToc->Write(); if (m_HasBeenSaved) OutToc->m_NeedsCompact = TRUE; else m_HasBeenSaved = TRUE; SetModifiedFlag(FALSE); delete out; } if (bNeedReRead) { delete [] m_Text; m_Text = NULL; } return (TRUE); } if (out && CreatedJJFile) delete out; return (FALSE); } //////////////////////////////////////////////////////////////////////// // FindFirst [public, virtual] // // Implementation of pure virtual defined in base class. //////////////////////////////////////////////////////////////////////// BOOL CCompMessageDoc::FindFirst(const CString& searchStr, BOOL matchCase, BOOL wholeWord, BOOL bOpenWnd /* = TRUE */) { m_FindHeaderIndex = 0; // force search to start at first header m_FindIndex = 0; // force search to start at top of message BOOL result = FALSE; // // Make copies of the search string and the actual message text. // Yes, it's inefficient to ALWAYS make copies, but since most // searches are case-insensitive, we'll probably end up making a // copy anyway. We need these local copies so that we can call // MakeLower() and strlwr() on them. // CString search_str(searchStr); // // Force message data to be read up from file. // GetText(); // // Kick off the search, first looking through each header in turn. // If there is no match in a header, then continue the search in // the message body. // for (int i = m_FindHeaderIndex; i <= 6; i++) { // // Get the text to scan in this pass, searching from the last // find position. // CString msg_text; if (i < 6) msg_text = (char *) GetHeaderLine(i); else { msg_text = (char *) GetText(); // // Strip text-enriched formatting codes, if any. // /* fix if (m_Sum->IsXRich()) { TextReader reader; const OLD_LENGTH = msg_text.GetLength(); char* p_msgtext = msg_text.GetBuffer(OLD_LENGTH + 4); int new_length = reader.StripRich(p_msgtext, OLD_LENGTH, TRUE); ASSERT(new_length < OLD_LENGTH); p_msgtext[new_length] = '\0'; msg_text.ReleaseBuffer(new_length); } */ } const char* p_msgtext = msg_text; if (! matchCase) { msg_text.MakeLower(); search_str.MakeLower(); } ASSERT(m_FindIndex >= 0); if (m_FindIndex > 0) { ASSERT(m_FindIndex < long(msg_text.GetLength())); p_msgtext += m_FindIndex; } // // Do the search... // char* p_match = strstr(p_msgtext, search_str); if (p_match) { // // Got a hit. // result = TRUE; m_FindIndex += p_match - p_msgtext; ASSERT(m_FindIndex >= 0); if (!bOpenWnd) return (TRUE); // // Open the message window, if necessary, making it the active MDI child. // ASSERT(m_Sum != NULL); ASSERT(m_Sum->IsComp()); m_DidFindOpenView = (GetFirstViewPosition() == NULL); m_Sum->Display(); // // Get the one and only comp message window for this document. // CView* p_compmsgv = GetCompView(); if (NULL == p_compmsgv) { ASSERT(0); m_FindIndex = -1; return FALSE; } // // 32-bit implementation. FORNOW, should call a generic // "get header view" function here whenever BOGDON gets // around to writing one. // CCompMessageFrame* p_frame = (CCompMessageFrame *) p_compmsgv->GetParentFrame(); ASSERT(p_frame && p_frame->IsKindOf(RUNTIME_CLASS(CCompMessageFrame))); CHeaderView* p_hdrview = p_frame->GetHeaderView(); ASSERT(p_hdrview && p_hdrview->IsKindOf(RUNTIME_CLASS(CHeaderView))); ASSERT(m_FindHeaderIndex >= 0); if (m_FindHeaderIndex < 6) { // // Got a hit in the header, so we need to grab the // proper edit control and tell the edit control // exactly where to do the selection. // CHeaderField* p_editctrl = p_hdrview->GetHeaderCtrl(m_FindHeaderIndex); if (p_editctrl != NULL) { // // We need to set the active view ourselves // so that the keyboard focus ends up where // we want it. FORNOW, this is probably // overkill since the comp message view // splitter comes up with the CHeaderView pane // as the active view by default. // p_frame->SetActiveView(p_hdrview, TRUE); // // The following call is a very special hack // to fool the CFormView-derived object to set // the focus where we want it and not where it // thinks it wants it. // p_hdrview->SetFocusToHeader(m_FindHeaderIndex); FindSetSel32(/* p_compmsgv,*/ p_hdrview, p_editctrl, int(m_FindIndex), int(m_FindIndex + search_str.GetLength())); // p_editctrl->SetSel(m_FindIndex, m_FindIndex + search_str.GetLength(), FALSE); m_FindIndex++; } } else { QCProtocol* pProtocol = QCProtocol::QueryProtocol( QCP_FIND, p_compmsgv ); if( ( pProtocol == NULL ) || ( pProtocol->DoFindFirst( searchStr, matchCase, wholeWord, TRUE ) == FALSE ) ) { return FALSE; } result = TRUE; } break; } else { // // No match in this header, so try next header, if any. // m_FindHeaderIndex++; m_FindIndex = 0; } } // // Set index so that subsequent FindNext() calls don't choke on // the fact that there is no view for this doc. // if (! result) { m_FindHeaderIndex = -1; m_FindIndex = -1; } return result; } //////////////////////////////////////////////////////////////////////// // FindNext [public, virtual] // // Implementation of pure virtual defined in base class. //////////////////////////////////////////////////////////////////////// BOOL CCompMessageDoc::FindNext(const CString& searchStr, BOOL matchCase, BOOL wholeWord) { // // Check for previous Find action, redirecting to FindFirst() if // there was no previous Find. // if (m_FindHeaderIndex < 0) return FindFirst(searchStr, matchCase, wholeWord); // // Get the one and only comp message window for this document. // CView* p_compmsgv = GetCompView(); if (NULL == p_compmsgv) { ASSERT(0); m_FindIndex = -1; return FALSE; } BOOL result = FALSE; // returned if (6 == m_FindHeaderIndex) { // // Special case for 32-bit implementation. If we had a // previous hit in the message body, we just need to delegate // to QCProtocol to find the next hit, if any. // QCProtocol* pProtocol = QCProtocol::QueryProtocol( QCP_FIND, p_compmsgv ); m_Sum->Display(); if( ( pProtocol == NULL ) || ( pProtocol->DoFindNext( searchStr, matchCase, wholeWord, TRUE ) == FALSE ) ) { return FALSE; } result=TRUE; } else { // // Run a loop to scan remaining header controls, if any, plus the // actual message text, starting where we left off from last time. // Make copies of the search string and the actual message text. // Yes, it's inefficient to ALWAYS make copies, but since most // searches are case-insensitive, we'll probably end up making a // copy anyway. We need these local copies so that we can call // MakeLower() and strlwr() on them. // CString search_str(searchStr); // // Kick off the search, first looking through each header in turn. // If there is no match in a header, then continue the search in // the message body. // for (int i = m_FindHeaderIndex; i <= 6; i++) { // // Get the text to scan in this pass, searching from the last // find position. // CString msg_text; if (i < 6) msg_text = (char *) GetHeaderLine(i); else { msg_text = (char *) GetText(); // // Strip text-enriched formatting codes, if any. // /* fix if (m_Sum->IsXRich()) { TextReader reader; const OLD_LENGTH = msg_text.GetLength(); char* p_msgtext = msg_text.GetBuffer(OLD_LENGTH + 4); int new_length = reader.StripRich(p_msgtext, OLD_LENGTH, TRUE); ASSERT(new_length < OLD_LENGTH); p_msgtext[new_length] = '\0'; msg_text.ReleaseBuffer(new_length); } */ } const char* p_msgtext = msg_text; if (! matchCase) { msg_text.MakeLower(); search_str.MakeLower(); } ASSERT(m_FindIndex >= 0); if (m_FindIndex > 0) { ASSERT(m_FindIndex < long(msg_text.GetLength())); p_msgtext += m_FindIndex; } // // Do the search... // char* p_match = strstr(p_msgtext, search_str); if (p_match) { // // Found a match! // m_FindIndex += p_match - p_msgtext; // save position for next time ASSERT(m_FindIndex >= 0); m_Sum->Display(); // already open, but make it the active child window // // 32-bit implementation. FORNOW, should call a generic // "get header view" method here someday. // CCompMessageFrame* p_frame = (CCompMessageFrame *) p_compmsgv->GetParentFrame(); ASSERT(p_frame && p_frame->IsKindOf(RUNTIME_CLASS(CCompMessageFrame))); CHeaderView* p_hdrview = p_frame->GetHeaderView(); ASSERT(p_hdrview && p_hdrview->IsKindOf(RUNTIME_CLASS(CHeaderView))); ASSERT(m_FindHeaderIndex >= 0); if (m_FindHeaderIndex < 6) { // // Got a hit in the header, so we need to grab the // proper edit control and do the selection ourselves. // CHeaderField* p_editctrl = p_hdrview->GetHeaderCtrl(m_FindHeaderIndex); if (p_editctrl != NULL) { // // We need to set the active view ourselves // so that the keyboard focus ends up where // we want it. // p_frame->SetActiveView(p_hdrview, TRUE); // // The following call is a very special hack to // fool the CFormView-derived object to set the // focus where we want it and not where it thinks // it wants it. // p_hdrview->SetFocusToHeader(m_FindHeaderIndex); FindSetSel32(/* p_compmsgv,*/ p_hdrview, p_editctrl, int(m_FindIndex), int(m_FindIndex + search_str.GetLength())); // p_editctrl->SetSel(m_FindIndex, m_FindIndex + search_str.GetLength(), FALSE); m_FindIndex++; result = TRUE; } } else { // // Got a hit in the body, so first deselect // everything in the headers, then perform // ANOTHER search in the body using the built-in // QCProtocol method. // FindSetSel32(/*p_compmsgv, */p_hdrview, NULL, -1, -1); QCProtocol* pProtocol = QCProtocol::QueryProtocol( QCP_FIND, p_compmsgv ); if( ( pProtocol == NULL ) || ( pProtocol->DoFindFirst( searchStr, matchCase, wholeWord, TRUE ) == FALSE ) ) { return FALSE; } result = TRUE; } break; } else { // // No match in this header, so try next header, if any. // m_FindHeaderIndex++; m_FindIndex = 0; } } } // // Set indices so that subsequent FindNext() calls don't choke on // the fact that there is no view for this doc. // if (! result) { m_FindHeaderIndex = -1; m_FindIndex = -1; } return result; } //////////////////////////////////////////////////////////////////////// // FindAgain [public, virtual] // // Implementation of pure virtual defined in base class. //////////////////////////////////////////////////////////////////////// BOOL CCompMessageDoc::FindAgain(const CString& searchStr, BOOL matchCase, BOOL wholeWord) { if (m_FindHeaderIndex < 0) { // // This is an unusual, but legal, case where the user didn't find // a hit last time we searched in an open message. // return FindFirst(searchStr, matchCase, wholeWord); } if (FindNext(searchStr, matchCase, wholeWord)) return TRUE; return FindFirst(searchStr, matchCase, wholeWord); } //////////////////////////////////////////////////////////////////////// // FindSetSel32 [protected] // // Helper function for the 32-bit Find Engine which knows how to do the // selection correctly for the split comp message window. The // problem is that you must clear any existing selection from all // of the edit controls before you can set a new selection. Otherwise, // you end up with multiple, disjoint selections on the screen. // //////////////////////////////////////////////////////////////////////// void CCompMessageDoc::FindSetSel32( // CCompMessageView* pCompMessageView, //(i) lower rich edit view pane (required) CHeaderView* pHeaderView, //(i) upper form view pane (required) CEdit* pEditCtrl, //(i) header control containing text to be selected (optional) int startIndex, //(i) starting offset for pEditCtrl (optional) int endIndex) //(i) ending offst for pEditCtrl (optional) { if (/*NULL == pCompMessageView ||*/ NULL == pHeaderView) { ASSERT(0); // caller blew it return; } // // The actual type returned by GetHeaderCtrl() is actually // CHeaderField, which is a derivation of CEdit. Also, the type // returned by GetBodyCntl() is actually CCompBody, which is also // a derivation of CEdit. However, we don't need any special // subclassed edit control behavior, so force a generic CEdit. // // FORNOW, the 32-bit header doesn't support an Attachments header // line. // for (int i = 0; i <= 5; i++) { if (i < 5) { CEdit* p_edit = (CEdit *) pHeaderView->GetHeaderCtrl(i); if (p_edit != NULL) { ASSERT(p_edit->IsKindOf(RUNTIME_CLASS(CEdit))); p_edit->SetSel(0, 0); // deselect all } } // else // { // pCompMessageView->GetEditCtrl().SetSel(0, 0); // } } // // Finally, select the stuff that we were interested in the first // place. If the caller didn't provide an edit control, don't // panic -- that means they just wanted to deselect everything in // the header, presumably because we're about to select something // in the body. // if (pEditCtrl) { ASSERT(pEditCtrl->IsKindOf(RUNTIME_CLASS(CEdit))); pEditCtrl->SetFocus(); pEditCtrl->SetSel(startIndex, endIndex, FALSE); } } BEGIN_MESSAGE_MAP(CCompMessageDoc, CMessageDoc) //{{AFX_MSG_MAP(CCompMessageDoc) ON_UPDATE_COMMAND_UI(ID_MESSAGE_CHANGEQUEUEING, OnUpdateChangeQueueing) ON_COMMAND(ID_MESSAGE_CHANGEQUEUEING, OnChangeQueueing) ON_UPDATE_COMMAND_UI(ID_MESSAGE_STATUS_SENDABLE, OnUpdateStatusSendable) ON_UPDATE_COMMAND_UI(ID_MESSAGE_STATUS_QUEUED, OnUpdateStatusQueued) ON_UPDATE_COMMAND_UI(ID_MESSAGE_STATUS_TIME_QUEUED, OnUpdateStatusTimedQueue) ON_UPDATE_COMMAND_UI(ID_MESSAGE_STATUS_SENT, OnUpdateStatusSent) ON_UPDATE_COMMAND_UI(ID_MESSAGE_STATUS_UNSENT, OnUpdateStatusUnsent) ON_COMMAND(ID_FILE_PRINT, OnFilePrint) ON_COMMAND(ID_FILE_PRINT_PREVIEW, OnFilePrintPreview) ON_COMMAND(ID_FILE_SAVE, OnFileSave) ON_UPDATE_COMMAND_UI(ID_FILE_SAVE_AS, OnUpdateFileSaveAs) ON_COMMAND(ID_FILE_SAVE_AS, OnFileSaveAs) ON_COMMAND(ID_FILE_SAVE_AS_STATIONERY, OnFileSaveAsStationery) ON_COMMAND(ID_MESSAGE_SENDIMMEDIATELY, OnSend) // ON_COMMAND(ID_MESSAGE_ATTACHFILE, OnAttachFile) ON_COMMAND(ID_MESSAGE_DELETE, OnMessageDelete) ON_UPDATE_COMMAND_UI(ID_MESSAGE_ATTACHFILE, OnCanModify) //}}AFX_MSG_MAP ON_COMMAND_EX(ID_MESSAGE_STATUS_SENDABLE, OnStatus) ON_COMMAND_EX(ID_MESSAGE_STATUS_QUEUED, OnStatus) ON_COMMAND_EX(ID_MESSAGE_STATUS_TIME_QUEUED, OnStatus) ON_COMMAND_EX(ID_MESSAGE_STATUS_SENT, OnStatus) ON_COMMAND_EX(ID_MESSAGE_STATUS_UNSENT, OnStatus) ON_COMMAND( ID_FCC_NEW_MBOX_IN_ROOT, OnFCCNewInRoot ) ON_COMMAND_EX_RANGE( QC_FIRST_COMMAND_ID, QC_LAST_COMMAND_ID, OnDynamicCommand ) ON_UPDATE_COMMAND_UI_RANGE( QC_FIRST_COMMAND_ID, QC_LAST_COMMAND_ID, OnUpdateDynamicCommand ) END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CCompMessageDoc commands void CCompMessageDoc::OnUpdateChangeQueueing(CCmdUI* pCmdUI) { pCmdUI->Enable(m_Sum->IsSendable()); } void CCompMessageDoc::OnChangeQueueing() { if (!m_Sum || m_Sum->CantEdit()) ASSERT(FALSE); else { CChangeQueueing dlg(m_Sum->m_State == MS_TIME_QUEUED? m_Sum->m_Seconds : 0); if (dlg.DoModal() == IDOK) { dlg.ChangeSummary(m_Sum); if (FlushQueue) SendQueuedMessages(); } } } void CCompMessageDoc::OnUpdateStatusSendable(CCmdUI* pCmdUI) { BOOL Enable = FALSE; if (m_Sum) { switch (m_Sum->m_State) { case MS_SENDABLE: case MS_QUEUED: case MS_TIME_QUEUED: Enable = TRUE; break; } } pCmdUI->Enable(Enable); } void CCompMessageDoc::OnUpdateStatusQueued(CCmdUI* pCmdUI) { BOOL Enable = FALSE; if (m_Sum) { switch (m_Sum->m_State) { case MS_QUEUED: case MS_SENDABLE: case MS_TIME_QUEUED: Enable = TRUE; break; } } pCmdUI->Enable(Enable); } void CCompMessageDoc::OnUpdateStatusTimedQueue(CCmdUI* pCmdUI) { BOOL Enable = FALSE; if (m_Sum) { switch (m_Sum->m_State) { case MS_TIME_QUEUED: case MS_SENDABLE: case MS_QUEUED: Enable = TRUE; break; } } pCmdUI->Enable(Enable); } void CCompMessageDoc::OnUpdateStatusSent(CCmdUI* pCmdUI) { BOOL Enable = FALSE; if (m_Sum) { switch (m_Sum->m_State) { case MS_SENT: case MS_UNSENT: Enable = TRUE; break; } } pCmdUI->Enable(Enable); } void CCompMessageDoc::OnUpdateStatusUnsent(CCmdUI* pCmdUI) { BOOL Enable = FALSE; if (m_Sum) { switch (m_Sum->m_State) { case MS_UNSENT: case MS_SENT: Enable = TRUE; break; } } pCmdUI->Enable(Enable); } BOOL CCompMessageDoc::OnStatus(UINT StatusMenuID) { if (!m_Sum) return (FALSE); int NewStatus = m_Sum->m_State; switch (StatusMenuID) { case ID_MESSAGE_STATUS_SENDABLE: NewStatus = MS_SENDABLE; break; case ID_MESSAGE_STATUS_QUEUED: NewStatus = MS_QUEUED; break; case ID_MESSAGE_STATUS_TIME_QUEUED: NewStatus = MS_TIME_QUEUED; break; case ID_MESSAGE_STATUS_SENT: NewStatus = MS_SENT; break; case ID_MESSAGE_STATUS_UNSENT: NewStatus = MS_UNSENT; break; default: ASSERT(FALSE); break; } m_Sum->SetState(char(NewStatus)); SetQueueStatus(); return (TRUE); } // hack city void CCompMessageDoc::OnFilePrint() { CView* pRchView = GetView(); pRchView->SendMessage( WM_COMMAND, ID_FILE_PRINT ); } void CCompMessageDoc::OnFilePrintPreview() { CView* pRchView = GetView(); pRchView->SendMessage( WM_COMMAND, ID_FILE_PRINT_PREVIEW ); } // this stuff supports processing multiple documents via one MessageOptions setting static BOOL bInGroup; static BOOL bFirstInGroup; static CString csGroupPersona; static CString csGroupStationery; void StartGroup( void ) { // Obsolete? SD 7/13/99 bInGroup = TRUE; // Obsolete? SD 7/13/99 bFirstInGroup = TRUE; } void EndGroup( void ) { // Obsolete? SD 7/13/99 bInGroup = FALSE; // Obsolete? SD 7/13/99 bFirstInGroup = FALSE; } /* As far as I can tell, every message Eudora ever sends is created by this method. For sure, New Message, Reply, Reply All, Reply With, Forward, Redirect, and all the XXX To equiv's go through here. I've added Stationery and Persona. The precedence that all this stuff gets applied to the new message is as follows (lowest to highest); 1) To, From, Subject, Cc, Bcc, Attachments, Body 2) Default Stationery - if no explicit Stationery is specified and the Personality (including Dominant) has a default Stationery, it's applied. 3) Explicit Stationery - if specified, is applied instead of (2). 4) Default Personality - If no explicit Personality is specified, the Stationery's Personality will be used. If no Stationery was applied the Dominant personality will be used. The Personality is used to determine the From line, Signature, and how the message is sent. 5) Explicit Personality - if specified, is used instead of (4) to determine From line, Signature, and how the message is sent. Note that applying Stationery can change the effective Personality. Hence if a Personality's default Stationery was created by a different Personality... User input supplied via the Message Options dialog rules over parameters. Prophecy - Someday Dominant and Persona.IsEmpty() are not going to be equivilent. We will be revisiting this... */ CCompMessageDoc* NewCompDocument ( const char* To /*= NULL*/, const char* From /*= NULL*/, const char* Subject /*= NULL*/, const char* Cc /*= NULL*/, const char* Bcc /*= NULL*/, const char* Attachments /*= NULL*/, const char* Body /*= NULL*/, const char* Stationery /*= NULL*/, const char* Persona /*= NULL*/, const char ResponseType /*= 0*/, const char* ECHeaders /* = NULL*/ ) { CCompMessageDoc* NewCompDoc = NULL; #ifdef COMMERCIAL CString csStationery = Stationery; CString csPersona = Persona; CString csStatPersona; CString csCurPersona = g_Personalities.GetCurrent(); #if 0 // BOG: this is the old Shift-* sets the stationary/personality feature, // which has now gone back to Shift-Reply == ReplyAll. Woohoo! if ( ( Stationery == NULL ) && ShiftDown()) { CMessageOptions dlg; QCStationeryCommand* pCommand; // char statname[ 80 ]; // GetStatItemName( csStationery, statname, sizeof( statname) ); dlg.m_Persona = csPersona; pCommand = g_theStationeryDirector.FindByPathname( csStationery ); if( pCommand ) { dlg.m_Stationery = pCommand->GetName(); } int result = dlg.DoModal(); if ( result == IDCANCEL ) return NewCompDoc; if ( result == IDOK ) { csPersona = dlg.m_Persona; csStationery = dlg.m_Stationery; } } #endif // check for groups of documents if ( bFirstInGroup ) { csGroupPersona = csPersona; csGroupStationery = csStationery; bFirstInGroup = FALSE; } if ( bInGroup ) { csPersona = csGroupPersona; csStationery = csGroupStationery; } // make sure we get the right persona's default stationery if ( ! csPersona.IsEmpty() && g_Personalities.IsA( csPersona ) ) g_Personalities.SetCurrent( csPersona ); #endif // COMMERCIAL // create the new doc with the defaults NewCompDoc = (CCompMessageDoc*)NewChildDocument(CompMessageTemplate); if (NewCompDoc) NewCompDoc->InitializeNew(To, From, Subject, Cc, Bcc, Attachments, Body, ECHeaders); else return (NewCompDoc); // error creating document //No need for Persona and stationery in 4.1 Light #ifdef COMMERCIAL // Do not apply stationery if redirecting // or if call is from Automation if ((MS_REDIRECT != ResponseType) || gbAutomationCall) { // determine which (if any) stationery to apply if ( csStationery.IsEmpty() ) { const char * defaultStat = GetIniString(IDS_INI_STATIONERY); if (defaultStat && *defaultStat) csStationery = defaultStat; } // apply the stationery (may specify a personality) if ( ! csStationery.IsEmpty() ) { CString szFileName; // csStationery might be fully qualified already if ( strchr( csStationery, '\\' ) ) { szFileName = csStationery; } else { QCStationeryCommand* pCommand; pCommand = g_theStationeryDirector.Find( csStationery ); if( pCommand ) { szFileName = pCommand->GetPathname(); } } if( ( szFileName != "" ) && ::FileExistsMT( szFileName ) ) { CCompStationeryDoc NewStatDoc; NewStatDoc.Read( szFileName); NewCompDoc->ApplyStationery( &NewStatDoc ); // look for a personality change if ( NewStatDoc.m_Sum != NULL ) { csStatPersona = NewStatDoc.m_Sum->GetPersona(); } } //ReallySetTitle(); } } // // determine which personality we really want to use according to // Keith's Rule: Stationery Rules(tm) when it comes to personality. // //FORNOW if ( csPersona.IsEmpty() ) //FORNOW { if ( ! csStatPersona.IsEmpty() && g_Personalities.IsA( csStatPersona ) ) { // use the stationery's persona csPersona = csStatPersona; g_Personalities.SetCurrent( csPersona ); } //FORNOW } // Add personality overrides NewCompDoc->ApplyPersona( csPersona ); g_Personalities.SetCurrent( csCurPersona ); // go back to default persona #else //for Light 4.1 - don't know whethere we really need to apply persona, but anyways :) // Add personality overrides NewCompDoc->ApplyPersona( Persona ); #endif // COMMERCIAL return (NewCompDoc); } CCompMessageDoc* NewCompDocumentWith(const char * fileName) { char StrippedFileName[MAX_PATH + 1]; int len; strcpy(StrippedFileName, *fileName == '"'? fileName + 1 : fileName); len = strlen(StrippedFileName); if (StrippedFileName[len - 1] == '"') StrippedFileName[len - 1] = 0; // Make sure the file is there if (::FileExistsMT(StrippedFileName)) { // ( To, From, Subject, Cc, Bcc, Attachments, Body, Stationery, Persona ) CCompMessageDoc* NewCompDoc = NewCompDocument( "", "", "", "", "", "", "", StrippedFileName, "" ); return (NewCompDoc); } return (NULL); } CCompMessageDoc* NewCompDocumentAs(const CString& strPersona) { // Make sure the persona exists if (g_Personalities.IsA(strPersona)) { // ( To, From, Subject, Cc, Bcc, Attachments, Body, Stationery, Persona ) CCompMessageDoc* pNewCompDoc = NewCompDocument("", "", "", "", "", "", "", "", strPersona); return pNewCompDoc; } ASSERT(0); return NULL; } BOOL CCompMessageDoc::ApplyStationery(CCompStationeryDoc *statDoc) { CCompMessageDoc* msgdoc = (CCompMessageDoc *)m_Sum->GetMessageDoc(); for (int i = 0; i < NumHeaders; i++) { char sepChar = 0; switch(i) { case HEADER_FROM: //don't use this break; case HEADER_SUBJECT: { CString newSubject; CString oldString = GetHeaderLine(i); const char *subHdr = statDoc->GetHeaderLine(i); if (subHdr && *subHdr) { if (oldString.IsEmpty()) SetHeaderLine(HEADER_SUBJECT,subHdr); else { newSubject.Format(CRString(IDS_SUBJECT_CHANGE),subHdr, ( const char* )oldString); SetHeaderLine(HEADER_SUBJECT,newSubject); } } else SetHeaderLine(HEADER_SUBJECT,oldString); } break; case HEADER_TO: case HEADER_CC: case HEADER_BCC: sepChar = ','; case HEADER_ATTACHMENTS: { CString oldString = GetHeaderLine(i); const char *statHdr = statDoc->GetHeaderLine(i); if (statHdr && *statHdr && strcmp(statHdr, " ")) { if (!oldString.IsEmpty()) { if (sepChar) { oldString += sepChar; oldString += " "; } oldString += statHdr; SetHeaderLine(i,oldString); } else SetHeaderLine(i,statHdr); } } break; } } // Add A Line if (m_Text && *m_Text) CatText("\r\n"); //Applying Plain Stat to a styled msg causes linebreaks to disappear if (statDoc->m_Sum) { if ((this->m_Sum->IsXRich()) || (this->m_Sum->IsHTML())) { if ((statDoc->m_Sum->IsXRich()) || (statDoc->m_Sum->IsHTML())) CatText(statDoc->GetText()); else { CString szHtmlOn = "<" + CRString(IDS_MIME_HTML) + ">"; CString szHtmlOff = "</" + CRString(IDS_MIME_HTML) + ">"; CString statText = Text2Html(statDoc->GetText(), TRUE, TRUE); CatText(szHtmlOn); CatText(statText); CatText(szHtmlOff); } } else CatText(statDoc->GetText()); } else CatText(statDoc->GetText()); // 9/16 changed from GetBody() m_QCMessage.Init(CCompMessageDoc::m_MessageId, CCompMessageDoc::m_Text, FALSE); // Do we have summary info? if (statDoc->m_Sum) { BOOL bAddRich = m_Sum->IsXRich(); BOOL bAddHTML = m_Sum->IsHTML(); // copy the stationary flags m_Sum->CopyFlags( statDoc->m_Sum ); if ( bAddRich ) m_Sum->SetFlag( MSF_XRICH ); if ( bAddHTML ) m_Sum->SetFlagEx( MSFEX_HTML ); m_Sum->SetPriority(statDoc->m_Sum->m_Priority); m_Sum->SetTranslators(statDoc->m_Sum->GetTranslators(), TRUE); m_Sum->SetSignature(statDoc->m_Sum->m_SigHdr); m_Sum->SetPersona( statDoc->m_Sum->GetPersona() ); } m_strPathName.Empty(); CCompMessageDoc::m_strPathName = statDoc->m_strPathName; m_StationeryApplied = TRUE; return (TRUE); } // Format the From line for redirect void CCompMessageDoc::SetupRedirect( const char * oldFrom /* = NULL */ ) { const char* Return = GetReturnAddress(); if (!IsRedirect()) m_RedirectFrom = oldFrom ? oldFrom : GetHeaderLine(HEADER_FROM); char *NewFrom = new char[m_RedirectFrom.GetLength() + ::SafeStrlenMT(Return) + 100]; sprintf(NewFrom, CRString(IDS_REDIRECT_FORMAT), (const char *)m_RedirectFrom, Return); SetHeaderLine(HEADER_FROM,NewFrom); delete [] NewFrom; } // From: and signature are always based of Persona BOOL CCompMessageDoc::ApplyPersona( CString Persona ) { if ( ! Persona.IsEmpty() && ! g_Personalities.IsA( Persona ) ) return FALSE; CRString DomDude( IDS_DOMINANT ); if ( Persona == DomDude ) Persona.Empty(); // we prefer the "" over "<Dominant>" CString CurPersona = g_Personalities.GetCurrent(); if ( Persona != CurPersona ) g_Personalities.SetCurrent( Persona ); m_Sum->SetPersona( Persona ); #ifdef COMMERCIAL // IDS_INI_SIGNATURE_NAME must be the same string as IDS_INI_PERSONA_SIGNATURE char szEntry[ 80 ]; // emulate 2.2 behavior if ( ! m_StationeryApplied && GetIniShort( IDS_INI_USE_SIGNATURE ) ) { // look for ini entry and default to "Standard" if none found char szKey[ 64 ]; QCLoadString( IDS_INI_SIGNATURE_NAME, szKey, sizeof( szKey ) ); g_Personalities.GetProfileString( Persona, szKey, "NotThereAtAll", szEntry, sizeof( szEntry ) ); if ( strcmp( szEntry, "NotThereAtAll" ) == 0 ) { CRString csStandard( IDS_STANDARD_SIGNATURE ); strcpy( szEntry, csStandard ); } } else { GetIniString( IDS_INI_SIGNATURE_NAME, szEntry, sizeof( szEntry ) ); } // Stationery signatures normally rule... // If we are editing a stationery and change the persona, then we want the //persona's signature BOOL bStationeryRules = GetIniShort( IDS_INI_SIGNATURE_PRECEDENCE ); if ( IsStationery() || ! m_StationeryApplied || ( m_StationeryApplied && !bStationeryRules ) ) { //If the personality had no default signature, we want to set the signature to <none> //Note the signature could be Empty or "No Default", Set signature handles all cases m_Sum->SetSignature( szEntry ); } #else if ( GetIniShort( IDS_INI_USE_SIGNATURE ) ) { CRString csStandard( IDS_STANDARD_SIGNATURE ); CRString csNone( IDS_SIGNATURE_NONE); CRString csAlternate( IDS_ALTERNATE_SIGNATURE32); CString strSig = GetIniString( IDS_INI_SIGNATURE_NAME); if(strSig == csStandard) m_Sum->SetSignature( csStandard ); else if(strSig == csAlternate) m_Sum->SetSignature( csAlternate ); } #endif //COMMERCIAL // fix up the From: line if (IsRedirect()) SetupRedirect(); else SetHeaderLine( HEADER_FROM, GetReturnAddress() ); // restore current persona if we changed it if ( ( Persona != CurPersona ) ) g_Personalities.SetCurrent( CurPersona ); return TRUE; } void CCompMessageDoc::ReadEudoraInfo(CString &sEudoraIniV2) { char buf[_MAX_PATH+1]; CString EudoraFile; GetIniString(IDS_INI_AUTO_RECEIVE_DIR, buf, sizeof(buf)); if (buf[0] == '\0') EudoraFile = EudoraDir + CRString(IDS_ATTACH_FOLDER) + "\\" + CRString(IDS_REGISTER_EUDORA_COPY); else EudoraFile = CString(buf) + "\\" + CRString(IDS_REGISTER_EUDORA_COPY); wsprintf(buf, "%s", EudoraFile); // Let's get the new INI file JJFile *pNewFile = new JJFile; if (!pNewFile) return; if (FAILED(pNewFile->Open(buf, O_CREAT | O_WRONLY))) { delete pNewFile; pNewFile = NULL; return; } // Let's get the Eudora INI file JJFile *pINIFile = new JJFile; if (!pINIFile) return; if (FAILED(pINIFile->Open((const char*)INIPath, O_RDONLY))) { delete pINIFile; pINIFile = NULL; return; } CString sLine; CString sPassword; sPassword = CRString(IDS_INI_SAVE_PASSWORD_TEXT); CString sDialUpPassword; sDialUpPassword = CRString(IDS_INI_SAVE_DIALUP_PASSWORD_TEXT); long lNumBytesRead = 0; do { char* pszLine = sLine.GetBuffer(1024); HRESULT hrGet = pINIFile->GetLine(pszLine, 1024, &lNumBytesRead); sLine.ReleaseBuffer(); if (SUCCEEDED(hrGet) && (lNumBytesRead > 0)) { if ((sLine.Find(sPassword) == -1) && (sLine.Find(sDialUpPassword) == -1)) pNewFile->PutLine(sLine); sLine.Empty(); } } while (lNumBytesRead > 0); if (lNumBytesRead != -1) sEudoraIniV2 = EudoraFile; pINIFile->Close(); pNewFile->Close(); delete pNewFile; delete pINIFile; } void CCompMessageDoc::ReadSystemInfo(CString &sAttach, CString &sBody) { CString sEudoraIniV2; ReadEudoraInfo(sEudoraIniV2); // Attach Eudora_C.Ini if (!sEudoraIniV2.IsEmpty()) { if (sAttach.IsEmpty() == FALSE) { if (';' != sAttach[sAttach.GetLength() - 1]) sAttach += "; "; else if (' ' != sAttach[sAttach.GetLength() - 1]) sAttach += ' '; } sAttach += sEudoraIniV2 + ";"; } CString sPlatform; CString sVersion; CString sProcessor; CString sMachineType; CString sTotalPhys; CString sTotalVirtual; ReadPlatform(sPlatform, sVersion, sMachineType, sProcessor, sTotalPhys, sTotalVirtual); int i=0; CString sWinsock; if(QCWinSockLibMT::LoadWSLibrary()) { WORD wVersionRequested = MAKEWORD(1, 1); WSADATA wsaData; for (i = 0; i < sizeof(wsaData.szDescription); i++) wsaData.szDescription[i] = 0; if (QCWinSockLibMT::WSAStartup(wVersionRequested, &wsaData) == 0) { sWinsock = wsaData.szDescription; QCWinSockLibMT::WSACleanup(); } } sBody.Format(GetIniString(IDS_REGISTER_BODY2), (LPCTSTR)sPlatform, (LPCTSTR)sMachineType, (LPCTSTR)sVersion, (LPCTSTR)sProcessor, (LPCTSTR)sTotalPhys, (LPCTSTR)sTotalVirtual, (LPCTSTR)CRString(IDS_VERSION), GetIniString(IDS_INI_REG_NUMBER), (LPCTSTR)sWinsock); } void CCompMessageDoc::ReadPlatform(CString &sPlatform, CString &sVer, CString &sMachineType, CString &sProcessor, CString &sTotalPhys, CString &sTotalVirtual) { sVer.Format("%lu.%02lu.%04u", GetMajorVersion(), GetMinorVersion(), LOWORD(GetBuildNumber())); if (IsWinNT()) sPlatform.Format(GetIniString(IDS_REGISTER_WINNT), (LPCTSTR)sVer); else if (IsWin98()) sPlatform.Format(GetIniString(IDS_REGISTER_WIN98), (LPCTSTR)sVer); else if (IsWin95()) sPlatform.Format(GetIniString(IDS_REGISTER_WIN95), (LPCTSTR)sVer); else if (IsWin32s()) sPlatform.Format(GetIniString(IDS_REGISTER_WIN32S), (LPCTSTR)sVer); char stemp[20]={0}; SYSTEM_INFO sinf; GetSystemInfo(&sinf); switch(sinf.wProcessorArchitecture) { case PROCESSOR_ARCHITECTURE_INTEL: sMachineType = CRString(IDS_REGISTER_PROCESS_INTEL); switch(sinf.wProcessorLevel) { case 3: sProcessor = "80386"; break; case 4: sProcessor = "80486"; break; case 5: sProcessor = "Pentium"; break; case 6: sProcessor = "Pentium II"; break; default: sProcessor = CString(ultoa(sinf.dwProcessorType, stemp, 10)); } break; case PROCESSOR_ARCHITECTURE_MIPS: sMachineType = CRString(IDS_REGISTER_PROCESS_MIPS); sProcessor = CString(ultoa(sinf.dwProcessorType, stemp, 10)) + " " + CString(itoa(sinf.wProcessorLevel, stemp, 10)); break; case PROCESSOR_ARCHITECTURE_ALPHA: sMachineType = CRString(IDS_REGISTER_PROCESS_ALPHA); sProcessor = CString(ultoa(sinf.dwProcessorType, stemp, 10)) + " " + CString(itoa(sinf.wProcessorLevel, stemp, 10)); break; case PROCESSOR_ARCHITECTURE_PPC: sMachineType = CRString(IDS_REGISTER_PROCESS_PPC); switch(sinf.wProcessorLevel) { case 1: sProcessor = "601"; break; case 3: sProcessor = "603"; break; case 4: sProcessor = "604"; break; case 6: sProcessor = "603+"; break; case 9: sProcessor = "604+"; break; case 20: sProcessor = "620"; break; default: sProcessor = sMachineType; break; } break; default: sMachineType = CRString(IDS_REGISTER_PROCESS_UNKNOWN); sProcessor = sMachineType; } MEMORYSTATUS mst; mst.dwLength = sizeof(MEMORYSTATUS); GlobalMemoryStatus(&mst); sTotalPhys.Format("%lu Kb", (mst.dwTotalPhys / 1024L)); sTotalVirtual.Format("%lu Kb", (mst.dwTotalVirtual / 1024L)); } int QueueStatus = QS_NONE_QUEUED; // SetQueueStatus // // Sets the QueueStatus flag to it's correct state. // void SetQueueStatus() { CTocDoc* OutToc = GetOutToc(); unsigned long nextSendTime = 0; if (!OutToc) return; time_t Now = time(NULL); time_t Later = Now + 12 * 60L * 60L; // 12 hours from now POSITION pos = OutToc->m_Sums.GetHeadPosition(); QueueStatus = QS_NONE_QUEUED; while (pos) { CSummary* Sum = OutToc->m_Sums.GetNext(pos); if (Sum->IsQueued() && !Sum->m_FrameWnd) { time_t SumLocalSeconds = Sum->m_Seconds + Sum->m_TimeZoneMinutes * 60; if (Sum->m_State == MS_QUEUED || SumLocalSeconds <= Now) QueueStatus |= QS_READY_TO_BE_SENT; else if (SumLocalSeconds <= Later) QueueStatus |= QS_DELAYED_WITHIN_12; else QueueStatus |= QS_DELAYED_MORE_THAN_12; if (Sum->m_State == MS_TIME_QUEUED && Sum->GetDate()[0] != 0) { if (!nextSendTime || nextSendTime > (unsigned long)SumLocalSeconds) nextSendTime = SumLocalSeconds; } } } // Set time so mail will be sent when the time comes ((CEudoraApp *)AfxGetApp())->SetNextSendMail(nextSendTime); // Minimize icon may have to change to reflect queued message status ((CMainFrame*)AfxGetMainWnd())->SetIcon(); } /* SendQueuedResult SendOne(CSummary* Sum,SendQueuedResult InResult, CFilterActions *filt) { CTocDoc* OutToc = GetOutToc(); CCompMessageDoc* doc; QCMailboxCommand* pCommand; BOOL CreatedDoc = FALSE; if (Sum->m_FrameWnd) { doc = (CCompMessageDoc*)Sum->m_FrameWnd->GetActiveDocument(); if (doc->IsModified()) { switch (AlertDialog(IDD_SEND_CHANGED, Sum->MakeTitle())) { case IDC_DONT_SEND: return (InResult); case IDOK: if (doc->OnSaveDocument(NULL) == FALSE) return (InResult); break; case IDC_SEND_ORIGINAL: // Get old contents back doc->SetModifiedFlag(FALSE); if (((CMessageDoc*)doc)->Read() == FALSE) return (InResult); break; } } doc->Queue(TRUE); } //FORNOW doc = (CCompMessageDoc*)Sum->GetMessageDoc(); if (!(doc = (CCompMessageDoc *) Sum->FindMessageDoc())) { CreatedDoc = TRUE; doc = (CCompMessageDoc *) Sum->GetMessageDoc(); } if (!doc || !doc->GetText()) return (InResult); ASSERT_KINDOF(CCompMessageDoc, doc); // save the BCC line for processessing char *OldLine = (char *)::SafeStrdupMT(doc->GetHeaderLine(HEADER_BCC)); if (SendMessage(doc) == 1) { Sum->SetState(MS_SENT); SetIniShort(IDS_INI_SUCCESSFUL_SEND, 1); if (OutToc->GetView()) OutToc->GetView()->UpdateWindow(); //FCC Stuff if (OldLine) { int len = ::SafeStrlenMT(OldLine); CString sOldLine(OldLine); CString sMbox; BOOL endOfLine=FALSE; int ch=131; int beginPos=0; int endPos=0; BOOL bFound=FALSE; CString sTemp; CString sPath; CString sName; while (!endOfLine) { ch = 131; beginPos = sOldLine.Find(char(ch)); if (beginPos == -1) { endOfLine=TRUE; continue; } beginPos++; ch = sOldLine[beginPos]; beginPos++; sOldLine = sOldLine.Mid(beginPos); endPos = sOldLine.Find(','); if (endPos == -1) { endOfLine=TRUE; sMbox = sOldLine; } else { sMbox = sOldLine.Mid(0, endPos); } pCommand = g_theMailboxDirector.FindByNamedPath( sMbox ); if( pCommand != NULL ) { OutToc->Xfer( GetToc( pCommand->GetPathname(), pCommand->GetName(), FALSE, FALSE), Sum, FALSE, TRUE); } else { char sText[256]; sprintf(sText, CRString(IDS_FCC_LOST_MBOX), sMbox); AfxMessageBox(sText); } } delete [] OldLine; } if ( !(filt->FilterOne(Sum, WTA_OUTGOING) & FA_TRANSFER ) && !Sum->KeepCopies()) { OutToc->Xfer(GetTrashToc(), Sum, TRUE); } OutToc->SetModifiedFlag(); //FORNOW delete doc; if (CreatedDoc) { Sum->NukeMessageDocIfUnused(); doc = NULL; } } else { //FORNOW delete doc; if (CreatedDoc) { Sum->NukeMessageDocIfUnused(); doc = NULL; } // If there wasn't something wrong with the message, then there // was a problem with the network, so quit sending if (Sum->m_State != MS_UNSENDABLE) return (SQR_MAJOR_ERROR); // Otherwise, this message is amiss, so display it, and continue sending Sum->Display(); return (SQR_UNSENT_MESSAGE); } return (InResult); } */ BOOL FlushQueue = FALSE; //extern CPOP* gPOP; // SendQueuedMessages // // Send all messages that are currently queued. If any fail, bring the window // back so the user has a chance to edit the contents. // SendQueuedResult SendQueuedMessages(int WhichToSend /*= QS_READY_TO_BE_SENT*/, BOOL bMultiPersona /*= TRUE*/) { /* static SendQueuedResult Result; BOOL CreatedNetConnection = (NetConnection == NULL); time_t Now = time(NULL); time_t Later = Now + 12 * 60L * 60L; // 12 hours from now int NumToSend = 0; */ // Plugins want to know what that we're about to send ((CEudoraApp *)AfxGetApp())->GetTranslators()->IdleEveryone(0, EMIDLE_PRE_SEND); #ifdef THREADED if ( SUCCEEDED(SendQueuedMessages2(WhichToSend, bMultiPersona, TRUE))) return SQR_ALL_OK; else return SQR_MAJOR_ERROR; #endif } /* char Server[128]; POSITION pos; CSummary* Sum; Result = SQR_ALL_OK; // assume the best in case... // If no messages meet the sending criteria, then we're done // This wont let expired messages be sent i //if (QueueStatus < WhichToSend) // get out'a here if there aren't any queued messages if (QueueStatus <= QS_NONE_QUEUED) return (SQR_ALL_OK); CTocDoc* OutToc = GetOutToc(); if (!OutToc) return (Result); // Count how many messages to send for (pos = OutToc->m_Sums.GetHeadPosition(); pos; ) { Sum = OutToc->m_Sums.GetNext(pos); if (Sum->m_State == MS_QUEUED || (Sum->m_State == MS_TIME_QUEUED && (Sum->m_Seconds <= Now || Sum->m_Seconds <= Later && WhichToSend <= QS_DELAYED_WITHIN_12 || WhichToSend == QS_DELAYED_MORE_THAN_12))) { NumToSend++; } } if (!NumToSend) return (SQR_ALL_OK); CString homie = g_Personalities.GetCurrent(); LPSTR lpPersonalities = g_Personalities.List(); lpPersonalities += strlen( lpPersonalities ) + 1; //Skip <Dominant> CString Persona = ""; //Still always start with the Default personality do { if ( bMultiPersona ) g_Personalities.SetCurrent( Persona ); else Persona = homie; // send mail for the current persona if (!gPOP) { // If we haven't created the POP object yet, and we're sending via POP or we // have to validate the POP password, then check mail via the POP object methods if (GetIniShort(IDS_INI_USE_POP_SEND) || (GetIniShort(IDS_REQUIRE_POP_LOGIN_TO_SEND) && POPPassword.IsEmpty())) { GetMail(kCheckPassword | kNetworkBit | kPOPBit | kLogonBit | kSendMailBit); return (Result); } } else if (GetIniShort(IDS_REQUIRE_POP_LOGIN_TO_SEND) && POPPassword.IsEmpty()) { // If we did log on to the POP server, but the password failed and it's // required to send mail, then just get out of here return (SQR_MAJOR_ERROR); } GetIniString(IDS_INI_SMTP_SERVER, Server, sizeof(Server)); ::TrimWhitespaceMT(Server); char* s; if (!*Server && (s = strrchr(GetIniString(IDS_INI_POP_ACCOUNT), '@'))) strcpy(Server, s + 1); // If the server name is Hesiod, StartSMTP queries the Hesiod server for the // users POP server. The users SMTP Hesiod server is ignored at this time. CFilterActions filt; // are there any messages for this server? NumToSend = 0; for (pos = OutToc->m_Sums.GetHeadPosition(); pos; ) { Sum = OutToc->m_Sums.GetNext(pos); if ( Sum->GetPersona() == Persona ) { if (Sum->m_State == MS_QUEUED || (Sum->m_State == MS_TIME_QUEUED && (Sum->m_Seconds <= Now || Sum->m_Seconds <= Later && WhichToSend <= QS_DELAYED_WITHIN_12 || WhichToSend == QS_DELAYED_MORE_THAN_12))) { NumToSend++; } } } if (NumToSend) { if ( StartSMTP(Server) >= 0 && DoSMTPIntro() >= 0 && filt.StartFiltering() ) { CountdownProgress(CRString(IDS_SMTP_MESSAGES_LEFT), NumToSend); Result = SQR_ALL_OK; for (pos = OutToc->m_Sums.GetHeadPosition(); pos && NumToSend && Result != SQR_MAJOR_ERROR; ) { Sum = OutToc->m_Sums.GetNext(pos); if ( Sum->GetPersona() == Persona ) { if (Sum->m_State == MS_QUEUED || (Sum->m_State == MS_TIME_QUEUED && (Sum->m_Seconds <= Now || Sum->m_Seconds <= Later && WhichToSend <= QS_DELAYED_WITHIN_12 || WhichToSend == QS_DELAYED_MORE_THAN_12))) { CFilterActions *fptr = NULL; fptr = &filt; Result = SendOne(Sum, Result, fptr); NumToSend--; DecrementCountdownProgress(); } } } } FlushQueue = FALSE; EndSMTP(Result == SQR_MAJOR_ERROR); if (OutToc->IsModified()) OutToc->Write(); SetQueueStatus(); filt.EndFiltering(); } // advance to next personality Persona = lpPersonalities; lpPersonalities += strlen( lpPersonalities ) + 1; } while ( bMultiPersona && ! Persona.IsEmpty() ); g_Personalities.SetCurrent( homie ); if ( NetConnection ) { if (CreatedNetConnection && GetIniShort(IDS_INI_AUTO_CONNECTION)) { delete NetConnection; NetConnection = NULL; } else NetConnection->NukeCursor(); } if (OutToc->GetView()) OutToc->GetView()->m_SumListBox.SetRedraw(TRUE); if (CreatedNetConnection) CloseProgress(); return (Result); } */ IMPLEMENT_DYNCREATE(CCompStationeryDoc, CCompMessageDoc) CCompStationeryDoc::CCompStationeryDoc() { m_File = NULL; } CCompStationeryDoc::~CCompStationeryDoc() { delete m_Sum; delete m_File; } BOOL CCompStationeryDoc::Read(const char *Filename) { if (!::FileExistsMT(Filename)) return (FALSE); m_File = new JJFile(); if (NULL == m_File) return FALSE; if (FAILED(m_File->Open(Filename, O_RDONLY))) { delete m_File; m_File = NULL; return FALSE; } const unsigned int MaxLength = 62 * 1024L; m_Text = new char[MaxLength + 1]; m_BufSize = MaxLength; if (!m_Text) { m_BufSize = 0; return FALSE; } memset(m_Text,0,MaxLength); m_File->Read(m_Text, MaxLength); // get the Translation X-Header char *Trans = HeaderContents(IDS_TRANS_XHEADER, m_Text); // get the Signature X-Header char *cp; char *sigstr = HeaderContents(IDS_SIGNATURE_XHEADER, m_Text); if (sigstr) { cp = sigstr; if (*cp == '<' && *(cp + strlen(cp) - 1) == '>') { cp++; *(cp + strlen(cp) - 1) = '\0'; } } // get the Persona X-Header char *cpPersona; char *Persona = HeaderContents(IDS_PERSONA_XHEADER, m_Text); if (Persona) { char * cp = Persona; if (*cp == '<' && *(cp + strlen(cp) - 1) == '>') { cp++; *(cp + strlen(cp) - 1) = '\0'; } cpPersona = cp; } // Go through the message and parcel out each item char* t = m_Text; while (t && *t != '\r' && *t != '\n' && *t) { char* colon = strchr(t, ':'); if (!colon) { t = strchr(t, '\n'); if (t) t++; continue; } // Check if this is a header we use? int i = FindRStringIndexI(IDS_HEADER_TO, IDS_STATIONERY_TOC_HEADER, t, colon - t); // Get the value for the header if (!(t = strchr(colon, '\n'))) continue; if (t[-1] == '\r') t[-1] = 0; *t++ = '\0'; if (*++colon == ' ') colon++; // If found, fill in the value for display. Otherwise, // move onto the next header. if (i >= 0 && i < MaxHeaders && i != (IDS_HEADER_IN_REPLY_TO - IDS_HEADER_TO) && i != (IDS_HEADER_REFERENCES - IDS_HEADER_TO) ) { m_Headers[i] = colon; } else if (i == MaxHeaders) { m_Sum = new CSummary; WORD flgVal = WORD(atoi(colon)); m_Sum->SetFlag(flgVal); char *c = strchr(colon, ' '); if (c) { colon = c; short prior = short(atoi(colon)); m_Sum->m_Priority = prior; if (Trans) { m_Sum->SetTranslators(Trans, TRUE); delete Trans; } if (sigstr) { m_Sum->m_SigSelected = m_Sum->m_SigHdr = cp; delete [] sigstr; } if (Persona) { m_Sum->SetPersona( cpPersona ); delete Persona; } } } } #ifndef unix int hasLF = 1; #else int hasLF = 0; #endif // find the begining of the body which start with a \n // step over it so the body start at the first line if (t && (t = strchr(t + hasLF, '\n'))) strcpy(m_Text, t + 1); //Best place to stuff in the Pathname m_strPathName.Empty(); m_strPathName = Filename; m_HasBeenSaved = TRUE; return (TRUE); } CSummary* NewMessageFromFile(const char *fileName) { CTocDoc * OutToc = NULL; JJFile * in = NULL; JJFile * out = NULL; JJFile * tmp = NULL; CSummary * theSum = NULL; CRString MIMEVersionHeader( IDS_MIME_HEADER_VERSION ); CRString AttachHeader( IDS_HEADER_ATTACHMENTS ); CRString ToHeader( IDS_HEADER_TO ); CRString CCHeader( IDS_HEADER_CC ); CRString BCCHeader( IDS_HEADER_BCC ); CString AttachString; CString FromString; CTime Time(CTime::GetCurrentTime()); long lStartLoc; long lEndLoc; long lInSize; long lBodySize; char * t; BOOL bMimeEncoded = FALSE; const unsigned int BufLength = 62 * 1024L; char * pBuf = new char[ BufLength + 1 ]; if ( ! pBuf ) goto done; OutToc = GetOutToc(); if (!OutToc) goto done; in = new JJFile; if (!in) goto done; if (FAILED(in->Open(fileName, O_RDWR))) // does a O_BINARY open goto done; out = new JJFile; if (!out) goto done; if (FAILED(out->Open(OutToc->MBFilename(), O_APPEND | O_RDWR))) goto done; // Get the offset of the start of the message out->Tell(&lStartLoc); ASSERT(lStartLoc >= 0); // Write From line if (Time.GetTime() < 0) Time = 0; FromString = ::FormatTimeMT(Time.GetTime(), GetIniString(IDS_FROM_CTIME_FORMAT)); if (FAILED(out->PutLine(FromString))) goto done; // get in filesize in->Seek( 0L, SEEK_END ); in->Tell(&lInSize); ASSERT(lInSize >= 0); in->Seek( 0L, SEEK_SET ); // Write out headers pBuf[ BufLength ] = '\0'; if ( FAILED(in->Read( pBuf, BufLength )) ) goto done; t = pBuf; while (t && *t != '\r' && *t != '\n' && *t) { // Check if this is a MIME-Version header? char * end = strchr(t, '\n'); if ( end ) { if (end[-1] == '\r') // don't duplicate \r or \n end[-1] = '\0'; end[0] = '\0'; if ( strnicmp( t, MIMEVersionHeader, strlen( MIMEVersionHeader ) ) == 0 ) bMimeEncoded = TRUE; if ( strnicmp( t, AttachHeader, strlen( AttachHeader ) ) == 0 ) AttachString = t; else if( GetIniShort(IDS_INI_AUTO_EXPAND_NICKNAMES) && ( strnicmp( t, ToHeader, strlen( ToHeader ) ) == 0 || strnicmp( t, CCHeader, strlen( CCHeader ) ) == 0 || strnicmp( t, BCCHeader, strlen( BCCHeader ) ) == 0 ) ) { char* ExpandedText, *colon; if ( (colon = strstr(t, ": ")) == 0) goto done; if (*(colon + 2)) { ExpandedText = ExpandAliases(colon + 2, TRUE, FALSE, FALSE); if (ExpandedText) { if ( FAILED( out->Put( t, (colon + 2) - t ) ) ) goto done; if ( FAILED( out->PutLine( ExpandedText, strlen( ExpandedText ) ) ) ) goto done; delete [] ExpandedText; } else if ( FAILED( out->PutLine( t, strlen( t ) ) ) ) goto done; } else if ( FAILED( out->PutLine( t, strlen( t ) ) ) ) goto done; } else if ( FAILED( out->PutLine( t, strlen( t ) ) ) ) goto done; t = end + 1; } else ASSERT( FALSE ); // I expect to find new lines } lBodySize = lInSize - ( t - pBuf ); // handle body if ( bMimeEncoded ) { // if MIME-Version detected write the body to a temp file CString tmpname = ::GetTmpFileNameMT( "rr" ); tmp = new JJFile; if (!tmp) goto done; if (FAILED(tmp->Open(tmpname, O_CREAT | O_TRUNC | O_RDWR))) // does a O_BINARY open goto done; // save the body filename in X-Attachments char buf[ 512 ]; sprintf( buf, "%s %s;", (const char*)AttachHeader, (const char*)tmpname ); if ( FAILED( out->PutLine( buf, strlen( buf ) ) ) ) goto done; if ( FAILED( out->PutLine( "\r\n", 2 ) ) ) goto done; // delimit header // t now points to the header/body separator (blank-line) while ( lBodySize ) { long bytes = BufLength - ( t - pBuf ); if ( lBodySize < bytes ) bytes = lBodySize; if ( FAILED(tmp->Put( t, bytes )) ) goto done; lBodySize -= bytes; if ( lBodySize ) { t = pBuf; if ( FAILED(in->Read( pBuf, BufLength )) ) goto done; } } tmp->Flush(); tmp->Close(); } else { // use original messages X-Attachment specifier if ( ! AttachString.IsEmpty() ) if ( FAILED( out->PutLine( AttachString, AttachString.GetLength() ) ) ) goto done; // not MIME-encode so write body to the OutToc (not to exceed 62K) long bytes = BufLength - ( t - pBuf ); if ( lBodySize < bytes ) bytes = lBodySize; if( FAILED(out->Put( t, bytes )) ) goto done; } // Get the offset of the end of the message out->Tell(&lEndLoc); ASSERT(lEndLoc >= 0); out->Seek( lStartLoc ); // prepare for CSummary::Build() OutToc->Write(); // init the CSummary object theSum = new CSummary; theSum->m_TheToc = OutToc; CSummary::m_lBegin = lStartLoc; theSum->Build( out, TRUE ); theSum->SetState( MS_QUEUED ); if (GetIniShort(IDS_INI_KEEP_COPIES)) theSum->SetFlag( MSF_KEEP_COPIES ); if (bMimeEncoded) theSum->SetFlagEx( MSFEX_AUTO_ATTACHED ); // add the summary to the out mailbox OutToc->AddSum( theSum ); SetQueueStatus(); done: delete in; delete out; delete tmp; delete [] pBuf; return theSum; } void CCompMessageDoc::OnMessageDelete() { CSummary* Sum = m_Sum; CTocDoc* Toc = Sum->m_TheToc; // If we haven't done anything to this message, then just get rid of it if (!IsModified() && !m_HasBeenSaved) { OnCloseDocument(); Toc->RemoveSum(Sum); } else { if (Sum->CantEdit() == FALSE) { if (Sum->IsQueued() && GetIniShort(IDS_INI_WARN_DELETE_QUEUED) && WarnDialog(IDS_INI_WARN_DELETE_QUEUED, IDS_WARN_DELETE_QUEUED) != IDOK) { return; } else if ((Sum->IsSendable() || Sum->m_State == MS_UNSENDABLE) && GetIniShort(IDS_INI_WARN_DELETE_UNSENT) && WarnDialog(IDS_INI_WARN_DELETE_UNSENT, IDS_WARN_DELETE_UNSENT) != IDOK) { return; } } if ( (IsModified() == FALSE) || (SaveModified()) ) Toc->Xfer(GetTrashToc(), Sum); } } void CCompMessageDoc::OnSend() { if (m_Sum && m_Sum->CantEdit() == FALSE) { if (ShiftDown()) OnChangeQueueing(); else { Queue(); SetQueueStatus(); if (GetIniShort(IDS_INI_IMMEDIATE_SEND)) SendQueuedMessages(); } } } void CCompMessageDoc::OnCanModify(CCmdUI* pCmdUI) { if(m_Sum != NULL) pCmdUI->Enable(m_Sum->CantEdit() == FALSE); } void CCompMessageDoc::OnFileSave() { CMessageDoc::OnFileSave(); if (m_bIsStationery) { //MsgDoc initializes it to "A", so if it hasn't been //saved before call the SaveAs function if ( m_strPathName.Compare("A") == 0 ) { OnFileSaveAsStationery(); return; } JJFile theFile; if (FAILED(theFile.Open( m_strPathName, O_CREAT | O_TRUNC | O_WRONLY))) return; WriteAsText( &theFile, TRUE ); } } void CCompMessageDoc::OnFileSaveAs() { char szName[_MAX_PATH + 1]; CString szPathName; JJFile theFile; if( m_Sum == NULL ) { return; } strcpy( szName, m_Sum->m_Subject ); ::StripIllegalMT( szName, EudoraDir ); if( !::LongFileSupportMT( EudoraDir ) ) { szName[8] = 0; } CSaveAsDialog theDlg( szName, TRUE, //TRUE, FALSE, CRString( IDS_TEXT_EXTENSION ), CRString( IDS_TXT_HTML_FILE_FILTER ), NULL ); if ( theDlg.DoModal() != IDOK ) { return; } // // Hack alert! Under the 32-bit Version 4 shell, the OnOK() // method of dialog doesn't get called! Therefore, this is a // hack workaround to manually update these INI settings // outside of the dialog class. Whatta hack. // if (IsVersion4()) { SetIniShort(IDS_INI_INCLUDE_HEADERS, ( short ) theDlg.m_Inc ); SetIniShort(IDS_INI_GUESS_PARAGRAPHS, ( short ) theDlg.m_Guess); } szPathName = theDlg.GetPathName(); //bIsStationery = theDlg.m_IsStat; // determine whether or not this is stationery by the file extension //if ( !bIsStationery && // ( szPathName.Right( 3 ).CompareNoCase( CRString( IDS_STATIONERY_EXTENSION ) ) == 0 ) ) //{ // bIsStationery = TRUE; //} if (FAILED(theFile.Open( szPathName, O_CREAT | O_TRUNC | O_WRONLY))) return; //WriteAsText( &theFile, bIsStationery ); SaveAsFile(&theFile, szPathName); } BOOL CCompMessageDoc::SaveAsFile( JJFile *theFile, CString szPathName) { if ( !theFile || szPathName.IsEmpty() ) return (FALSE); CView* pView= GetCompView(); QCProtocol* view = QCProtocol::QueryProtocol( QCP_GET_MESSAGE, ( CObject* )pView ); if (!view) return (FALSE); CString msg; if ( (szPathName.Right( 3 ).CompareNoCase( CRString( IDS_HTM_EXTENSION) ) == 0 ) || (szPathName.Right( 4 ).CompareNoCase( CRString( IDS_HTML_EXTENSION) ) == 0 ) ) view->GetMessageAsHTML(msg, GetIniShort( IDS_INI_INCLUDE_HEADERS )); else { view->GetMessageAsText(msg, GetIniShort( IDS_INI_INCLUDE_HEADERS )); if ( GetIniShort( IDS_INI_GUESS_PARAGRAPHS ) ) { char* CopyText = ::SafeStrdupMT( msg ); if (FAILED(theFile->Put( UnwrapText( CopyText )))) { delete CopyText; return (FALSE); } else { delete CopyText; return (TRUE); } } } if ( FAILED( theFile->Put( msg ) ) ) { ASSERT( 0 ); return (FALSE); } return (TRUE); } void CCompMessageDoc::OnUpdateFileSaveAs(CCmdUI* pCmdUI) { pCmdUI->Enable(TRUE); } long CCompMessageDoc::DoContextMenu( CWnd* pCaller, WPARAM wParam, // HWND of window receiving WM_CONTEXTMENU message LPARAM lParam) // WM_CONTEXTMENU screen coordinates { CPoint ptScreen(LOWORD(lParam), HIWORD(lParam)); // Get the CMenu that contains all the context popups CMenu popupMenus; HMENU hMenu = QCLoadMenu(IDR_CONTEXT_POPUPS); if ( ! hMenu || !popupMenus.Attach(hMenu) ) return FALSE; CMenu* pTempPopupMenu = popupMenus.GetSubMenu(MP_POPUP_COMP_MSG); if (pTempPopupMenu != NULL) { // // Since the popup menu we get from GetSubMenu() is a pointer // to a temporary object, let's make a local copy of the // object so that we have explicit control over its lifetime. // // Note that we edit the context menu on-the-fly in order to // add a number of "user-defined" context menus, display the edited // context menu, then remove the added "user-defined" context menus. // // This all works because we add the sub-menus in a certain order, // and then remove them in exactly the reverse order. Be careful // if you make changes to the processing order here. // CMenu tempPopupMenu; tempPopupMenu.Attach(pTempPopupMenu->GetSafeHmenu()); // // Insert the Attach (plug-ins) sub-menu. // CMenu theAttachMenu; theAttachMenu.CreatePopupMenu(); g_thePluginDirector.NewMessageCommands( CA_ATTACH_PLUGIN, &theAttachMenu ); ::WrapMenu( theAttachMenu.GetSafeHmenu() ); tempPopupMenu.InsertMenu( MP_ATTACH_PLUGINS, MF_BYPOSITION | MF_POPUP, (UINT) theAttachMenu.GetSafeHmenu(), CRString(IDS_ATTACH_MENU_TEXT)); // // Insert the Insert Recipient sub-menu. // CMenu theRecipientMenu; theRecipientMenu.CreatePopupMenu(); g_theRecipientDirector.NewMessageCommands( CA_INSERT_RECIPIENT, &theRecipientMenu ); ::WrapMenu( theRecipientMenu.GetSafeHmenu() ); tempPopupMenu.InsertMenu( MP_INSERT_RECIP, MF_BYPOSITION | MF_POPUP, (UINT) theRecipientMenu.GetSafeHmenu(), CRString(IDS_INSERT_RECIPIENT)); CMenu theFCCMenu; // Shareware: Only allow FCC in FULL FEATURE version. if (UsingFullFeatureSet()) { // FULL FEATURE mode // // Insert the FCC sub-menu. This includes a fixed "New..." // mailbox command ID in the root of the FCC sub-menu, just // after the In/Out/Trash items. // theFCCMenu.CreatePopupMenu(); g_theMailboxDirector.NewMessageCommands( CA_INSERT_FCC, &theFCCMenu, CA_FCC_NEW ); theFCCMenu.InsertMenu( 3, MF_BYPOSITION, ID_FCC_NEW_MBOX_IN_ROOT, CRString( IDS_MAILBOX_NEW ) ); theFCCMenu.InsertMenu( 3, MF_BYPOSITION | MF_SEPARATOR ); ::WrapMenu( theFCCMenu.GetSafeHmenu() ); tempPopupMenu.InsertMenu( MP_INSERT_RECIP, MF_BYPOSITION | MF_POPUP, (UINT) theFCCMenu.GetSafeHmenu(), CRString( IDS_FCC ) ); } #ifdef COMMERCIAL // // Insert the Change Persona sub-menu // CMenu theChangePersonaMenu; theChangePersonaMenu.CreatePopupMenu(); g_thePersonalityDirector.NewMessageCommands( CA_CHANGE_PERSONA, &theChangePersonaMenu ); ::WrapMenu( theChangePersonaMenu.GetSafeHmenu() ); int nChangePersonaPosition = tempPopupMenu.GetMenuItemCount() - 1; tempPopupMenu.InsertMenu( nChangePersonaPosition, MF_BYPOSITION | MF_POPUP, (UINT) theChangePersonaMenu.GetSafeHmenu(), CRString( IDS_CHANGE_PERSONA ) ); #endif // COMMERCIAL // // Insert the Message Plug-Ins sub-menu. // CMenu theMessagePluginsMenu; theMessagePluginsMenu.CreatePopupMenu(); g_thePluginDirector.NewMessageCommands( CA_TRANSLATE_PLUGIN, &theMessagePluginsMenu ); int nMessagePluginsPosition = tempPopupMenu.GetMenuItemCount(); ::WrapMenu( theMessagePluginsMenu.GetSafeHmenu() ); tempPopupMenu.InsertMenu( nMessagePluginsPosition, MF_BYPOSITION | MF_POPUP, (UINT) theMessagePluginsMenu.GetSafeHmenu(), CRString(IDS_MESSAGE_PLUGINS)); CContextMenu::MatchCoordinatesToWindow(HWND(wParam), ptScreen); tempPopupMenu.TrackPopupMenu(0, ptScreen.x, ptScreen.y, AfxGetMainWnd()); // // Remove the Message Plug-Ins sub-menu. // g_thePluginDirector.RemoveMessageCommands( CA_TRANSLATE_PLUGIN, &theMessagePluginsMenu ); tempPopupMenu.RemoveMenu( nMessagePluginsPosition, MF_BYPOSITION ); #ifdef COMMERCIAL // // Remove the Change Persona sub-menu. // g_thePersonalityDirector.RemoveMessageCommands( CA_CHANGE_PERSONA, &theChangePersonaMenu ); tempPopupMenu.RemoveMenu( nChangePersonaPosition, MF_BYPOSITION); #endif // COMMERCIAL // Shareware: Only allow FCC in FULL FEATURE version. if (UsingFullFeatureSet()) { // FULL FEATURE mode // // Remove the FCC sub-menu. // g_theMailboxDirector.RemoveMessageCommands( CA_INSERT_FCC, &theFCCMenu ); g_theMailboxDirector.RemoveMessageCommands( CA_FCC_NEW, &theFCCMenu ); tempPopupMenu.RemoveMenu(MP_INSERT_RECIP, MF_BYPOSITION); } // // Remove the Insert Recipient sub-menu. // g_theRecipientDirector.RemoveMessageCommands( CA_INSERT_RECIPIENT, &theRecipientMenu ); tempPopupMenu.RemoveMenu(MP_INSERT_RECIP, MF_BYPOSITION); // // Remove the Attach (plug-ins) sub-menu. // g_thePluginDirector.RemoveMessageCommands(CA_ATTACH_PLUGIN, &theAttachMenu); tempPopupMenu.RemoveMenu(MP_ATTACH_PLUGINS, MF_BYPOSITION); VERIFY(tempPopupMenu.Detach()); } return TRUE; } void CCompMessageDoc::InsertFCCInBCC(QCMailboxCommand* pCommand) { // Shareware: Only allow FCC in FULL FEATURE version. if (UsingFullFeatureSet()) { // FULL FEATURE mode CString szNewBCC; char* pBCCString; if( pCommand == NULL ) { ASSERT( 0 ); return; } szNewBCC = g_theMailboxDirector.BuildNamedPath( pCommand ); szNewBCC = "\x83\\" + szNewBCC; pBCCString = ( char* ) GetHeaderLine(HEADER_BCC); if( ::SafeStrlenMT( pBCCString ) ) { szNewBCC = "," + szNewBCC; szNewBCC = pBCCString + szNewBCC; } SetHeaderLine( HEADER_BCC, szNewBCC ); SetModifiedFlag( TRUE ); } else { ASSERT(0); // No FCC in REDUCED FEATURE mode } } void CCompMessageDoc::OnFCCNewInRoot() { // Shareware: Only allow FCC in FULL FEATURE version. if (UsingFullFeatureSet()) { // FULL FEATURE mode QCMailboxCommand* pCommand = NULL; pCommand = g_theMailboxDirector.CreateTargetMailbox( NULL, FALSE ); if( pCommand ) { ASSERT_KINDOF( QCMailboxCommand, pCommand ); ASSERT( pCommand->GetType() == MBT_REGULAR ); InsertFCCInBCC( pCommand ); } } else { ASSERT(0); // FCC not allowed in REDUCED FEATURE mode } } //////////////////////////////////////////////////////////////////////// // OnDynamicCommand [protected] // // Handles commands specific to a comp message. Generic stuff like // the Transfer commands are handled in the base class CMessageDoc. //////////////////////////////////////////////////////////////////////// BOOL CCompMessageDoc::OnDynamicCommand(UINT uID) { QCCommandObject* pCommand; COMMAND_ACTION_TYPE theAction; CString szTo; struct TRANSLATE_DATA theData; if( ! g_theCommandStack.GetCommand( ( WORD ) uID, &pCommand, &theAction ) ) { return FALSE; } if( ( pCommand == NULL ) || !theAction ) { return FALSE; } if( theAction == CA_FCC_NEW ) { // Shareware: Only allow FCC in FULL FEATURE version. if (UsingFullFeatureSet()) { // FULL FEATURE mode ASSERT_KINDOF( QCMailboxCommand, pCommand ); pCommand = g_theMailboxDirector.CreateTargetMailbox( ( QCMailboxCommand* ) pCommand, FALSE ); if( pCommand ) { ASSERT_KINDOF( QCMailboxCommand, pCommand ); ASSERT( ( ( QCMailboxCommand* ) pCommand)->GetType() == MBT_REGULAR ); theAction = CA_INSERT_FCC; } else { return TRUE; } } else { // REDUCED FEATURE mode ASSERT(0); // Should not get here -- FCC disabled in REDUCED FEATURE mode return FALSE; } } if( theAction == CA_INSERT_FCC ) { // Shareware: Only allow FCC in FULL FEATURE version. if (UsingFullFeatureSet()) { // FULL FEATURE mode ASSERT_KINDOF( QCMailboxCommand, pCommand ); InsertFCCInBCC( ( QCMailboxCommand* ) pCommand ); return TRUE; } else { // REDUCED FEATURE mode ASSERT(0); // Should not get here -- FCC disabled in REDUCED FEATURE mode return FALSE; } } if( theAction == CA_ATTACH_PLUGIN ) { pCommand->Execute( theAction, this ); return TRUE; } if( theAction == CA_TRANSLATE_PLUGIN ) { if( ( theData.m_pView = GetView() ) != NULL ) { QCProtocol* pProtocol = QCProtocol::QueryProtocol( QCP_TRANSLATE, ( CObject* )theData.m_pView); if( pProtocol == NULL ) return FALSE; theData.m_pProtocol = pProtocol; theData.m_bBuildAddresses = TRUE; pCommand->Execute( theAction, &theData ); return TRUE; } } if ( theAction == CA_CHANGE_PERSONA ) { ASSERT_KINDOF( QCPersonalityCommand, pCommand ); if ( ApplyPersona( ((QCPersonalityCommand *) pCommand)->GetName() ) ) { SetModifiedFlag( TRUE ); } else { ASSERT(0); // bogus persona name } return TRUE; } if ( (theAction == CA_TRANSFER_NEW ) || (theAction == CA_TRANSFER_TO ) ) { // // Normally, the CMessageDoc base class handles the Transfer commands. // However, Transfer is not applicable to stationery, so bounce // those here. // if (m_bIsStationery) { ASSERT(0); // theoretically shouldn't get here due to CmdUI return TRUE; } } if ( theAction == CA_FORWARD_TO ) { VERIFY(m_Sum != NULL); pCommand->Execute( theAction, m_Sum ); return TRUE; } return CMessageDoc::OnDynamicCommand( uID ); } //////////////////////////////////////////////////////////////////////// // OnUpdateDynamicCommand [protected] // // Handles commands specific to a comp message. Generic stuff like // the Transfer commands are handled in the base class CMessageDoc. //////////////////////////////////////////////////////////////////////// void CCompMessageDoc::OnUpdateDynamicCommand( CCmdUI* pCmdUI) { QCCommandObject* pCommand; COMMAND_ACTION_TYPE theAction; if( pCmdUI->m_pSubMenu == NULL ) { if( g_theCommandStack.Lookup( ( WORD ) ( pCmdUI->m_nID ), &pCommand, &theAction ) ) { if( theAction == CA_CHANGE_PERSONA ) { QCPersonalityCommand* pPC = DYNAMIC_DOWNCAST(QCPersonalityCommand, pCommand); BOOL bPersonaMatch = FALSE; if (pPC && m_Sum) { LPCTSTR ThisPersona = m_Sum->GetPersona(); LPCTSTR CommandPersona = pPC->GetName(); if (stricmp(ThisPersona, CommandPersona) == 0 || (!*ThisPersona && stricmp(CommandPersona, CRString(IDS_DOMINANT)) == 0)) { bPersonaMatch = TRUE; } } pCmdUI->SetRadio( bPersonaMatch ); pCmdUI->Enable( TRUE ); return; } if( ( theAction == CA_FCC_NEW ) || ( theAction == CA_ATTACH_PLUGIN ) || ( ( theAction == CA_TRANSLATE_PLUGIN ) && ( GetView() != NULL ) ) || ( theAction == CA_INSERT_FCC ) || ( theAction == CA_FORWARD_TO ) ) { pCmdUI->Enable( TRUE ); return; } if ( ( theAction == CA_TRANSFER_NEW ) || ( theAction == CA_TRANSFER_TO ) ) { // // In the CMessageDoc base class, Transfer commands // are always enabled. Therefore, we need to override // that for stationery. // if ( m_bIsStationery ) { pCmdUI->Enable(FALSE); return; } } } } CMessageDoc::OnUpdateDynamicCommand(pCmdUI); } BOOL CCompMessageDoc::WriteAsText( JJFile* pFile, BOOL bIsStationery ) { char* szBody; if( m_Sum == NULL ) { return FALSE; } // GetText() makes sure message is read up and returns body szBody = GetText(); if( bIsStationery || GetIniShort( IDS_INI_INCLUDE_HEADERS ) ) { for (int i = 0; i < MaxHeaders; i++) { if (FAILED(pFile->Put(CRString(IDS_HEADER_TO + i))) || FAILED(pFile->Put(" ")) || FAILED(pFile->Put(GetHeaderLine(i))) || FAILED(pFile->Put("\r\n"))) { return FALSE; } } // add a header for toc stuff if( bIsStationery ) { CString tocFlags; tocFlags.Format(CRString(IDS_STATIONERY_TOC_HEADER_FORMAT),m_Sum->GetFlags(), m_Sum->m_Priority); pFile->Put(tocFlags); pFile->Put("\r\n"); // Put the Translator Header CString TransString; CString Tltrs = m_Sum->GetTranslators(); if (!Tltrs.IsEmpty()) { TransString.Format(CRString(IDS_TRANS_XHEADER_FORMAT),(const char *)Tltrs); pFile->Put(TransString); pFile->Put("\r\n"); } // Put the Signature Header CString SigString = m_Sum->m_SigSelected; if (!SigString.IsEmpty()) { SigString.Format(CRString(IDS_SIGNATURE_XHEADER_FORMAT),(const char *)( m_Sum->m_SigSelected ) ); pFile->Put(SigString); pFile->Put("\r\n"); m_Sum->m_SigHdr = m_Sum->m_SigSelected; } // Put the Persona Header CString PersonaString; CString Persona = m_Sum->GetPersona(); if (!Persona.IsEmpty()) { PersonaString.Format(CRString(IDS_PERSONA_XHEADER_FORMAT),(const char *)Persona); pFile->Put(PersonaString); pFile->Put("\r\n"); } } if( FAILED(pFile->Put("\r\n")) ) { return FALSE; } } if ( !bIsStationery && GetIniShort( IDS_INI_GUESS_PARAGRAPHS ) ) { char* CopyText = ::SafeStrdupMT( szBody ); BOOL Status = TRUE; if (FAILED(pFile->Put( UnwrapText( CopyText )))) Status = FALSE; delete CopyText; return Status; } //((PgMsgView*)GetView())->SaveInfo(); //szBody = CMessageDoc::GetText(); if ( FAILED(pFile->Put( szBody )) ) return FALSE; return TRUE; } void CCompMessageDoc::OnFileSaveAsStationery() { char szName[_MAX_PATH + 1]; CString szPathName; JJFile theFile; if( m_Sum == NULL ) { return; } strcpy( szName, m_Sum->m_Subject ); ::StripIllegalMT( szName, EudoraDir ); if( !::LongFileSupportMT( EudoraDir ) ) { szName[8] = 0; } CString statDir = EudoraDir; if (::LongFileSupportMT(EudoraDir)) statDir += CRString(IDS_STATIONERY_FOLDER); else statDir += CRString(IDS_STATIONERY_FOLDER16); CString defExt = CRString(IDS_STATIONERY_EXTENSION); CString dlgTitle = CRString(IDS_SAVE_AS_STATIONERY_TITLE); CFileDialog theDlg( FALSE, CRString(IDS_STATIONERY_EXTENSION), szName, OFN_HIDEREADONLY | OFN_NOREADONLYRETURN | OFN_OVERWRITEPROMPT | OFN_EXTENSIONDIFFERENT , CRString( IDS_STATIONERY_FILE_FILTER ), AfxGetMainWnd() ); theDlg.m_ofn.lpstrInitialDir = statDir; theDlg.m_ofn.lpstrDefExt = LPCTSTR(defExt); theDlg.m_ofn.lpstrTitle = LPCTSTR(dlgTitle); if (theDlg.DoModal() == IDOK) { szPathName = theDlg.GetPathName(); CString dir = szPathName; //CString fileTitle = theDlg.GetFileTitle(); //Append .sta even if the user entered a different extension //CString ext = theDlg.GetFileExt(); //if (ext.Compare(CRString(IDS_STATIONERY_EXTENSION)) != 0) //{ // fileTitle += "." + ext; // szPathName += ("." + CRString(IDS_STATIONERY_EXTENSION)); //} int s = szPathName.ReverseFind(SLASH); if (s > 0) dir = szPathName.Left( s ); if (dir.CompareNoCase(statDir) == 0 ) { if ( ! theDlg.GetFileExt().Compare(CRString(IDS_STATIONERY_EXTENSION)) ) { QCStationeryCommand* pCommand; pCommand = g_theStationeryDirector.AddCommand( theDlg.GetFileTitle() ); //if( pCommand ) // pCommand->Execute( CA_NEW ); } } if (FAILED(theFile.Open( szPathName, O_CREAT | O_TRUNC | O_WRONLY))) return; CMessageDoc::OnFileSave(); WriteAsText( &theFile, TRUE ); m_strPathName = theDlg.GetPathName(); SetTitle(m_strPathName); } } BOOL CCompMessageDoc::GetMessageHeaders(CString& hdrs) { //This is for PaigeStuff. //Will be changing it back to use \r\n instead of just \n, so that the //current WriteAsText function can use this piece of code hdrs.Empty(); for (int i = 0; i < MaxHeaders; i++) { hdrs += ( CRString(IDS_HEADER_TO + i) + " " + GetHeaderLine(i) + "\n" ); } // add extra header for the stationery stuff if( m_bIsStationery ) { //Put the Stationery Header CString tocFlags; tocFlags.Format(CRString(IDS_STATIONERY_TOC_HEADER_FORMAT),m_Sum->GetFlags(), m_Sum->m_Priority); hdrs += (tocFlags + "\n"); // Put the Translator Header CString TransString; CString Tltrs = m_Sum->GetTranslators(); if (!Tltrs.IsEmpty()) { TransString.Format(CRString(IDS_TRANS_XHEADER_FORMAT),(const char *)Tltrs); hdrs += ( TransString + "\n" ); } // Put the Signature Header CString SigString = m_Sum->m_SigSelected; if (!SigString.IsEmpty()) { SigString.Format(CRString(IDS_SIGNATURE_XHEADER_FORMAT),(const char *)( m_Sum->m_SigSelected ) ); hdrs += ( SigString + "\n" ); m_Sum->m_SigHdr = m_Sum->m_SigSelected; } // Put the Persona Header CString PersonaString; CString Persona = m_Sum->GetPersona(); if (!Persona.IsEmpty()) { PersonaString.Format(CRString(IDS_PERSONA_XHEADER_FORMAT),(const char *)Persona); hdrs += (PersonaString + "\n"); } } hdrs += "\n" ; return ( TRUE ); }
24.66891
120
0.659107
dusong7
a62f729d76093475367b5d67c83a0bc5dc917b24
1,487
inl
C++
shared/source/xe_hp_core/os_agnostic_hw_info_config_xe_hp_core.inl
smorek-intel/compute-runtime
299e798159e55ccc198802b8eb114c91f8b8e85d
[ "Intel", "MIT" ]
null
null
null
shared/source/xe_hp_core/os_agnostic_hw_info_config_xe_hp_core.inl
smorek-intel/compute-runtime
299e798159e55ccc198802b8eb114c91f8b8e85d
[ "Intel", "MIT" ]
null
null
null
shared/source/xe_hp_core/os_agnostic_hw_info_config_xe_hp_core.inl
smorek-intel/compute-runtime
299e798159e55ccc198802b8eb114c91f8b8e85d
[ "Intel", "MIT" ]
null
null
null
/* * Copyright (C) 2021 Intel Corporation * * SPDX-License-Identifier: MIT * */ using namespace NEO; template <> bool HwInfoConfigHw<IGFX_XE_HP_SDV>::isMaxThreadsForWorkgroupWARequired(const HardwareInfo &hwInfo) const { const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily); uint32_t stepping = hwInfoConfig.getSteppingFromHwRevId(hwInfo); return REVISION_B > stepping; } template <> uint32_t HwInfoConfigHw<IGFX_XE_HP_SDV>::getHwRevIdFromStepping(uint32_t stepping, const HardwareInfo &hwInfo) const { switch (stepping) { case REVISION_A0: return 0x0; case REVISION_A1: return 0x1; case REVISION_B: return 0x4; } return CommonConstants::invalidStepping; } template <> uint32_t HwInfoConfigHw<IGFX_XE_HP_SDV>::getSteppingFromHwRevId(const HardwareInfo &hwInfo) const { switch (hwInfo.platform.usRevId) { case 0x0: return REVISION_A0; case 0x1: return REVISION_A1; case 0x4: return REVISION_B; } return CommonConstants::invalidStepping; } template <> void HwInfoConfigHw<IGFX_XE_HP_SDV>::adjustSamplerState(void *sampler, const HardwareInfo &hwInfo) { using SAMPLER_STATE = typename XeHpFamily::SAMPLER_STATE; auto samplerState = reinterpret_cast<SAMPLER_STATE *>(sampler); if (DebugManager.flags.ForceSamplerLowFilteringPrecision.get()) { samplerState->setLowQualityFilter(SAMPLER_STATE::LOW_QUALITY_FILTER_ENABLE); } }
29.156863
118
0.735037
smorek-intel
a630badf049af216a1eca7dc09f60766f96c7811
3,311
cpp
C++
lightdam/Camera.cpp
Wumpf/lightdam
5a007b5f5f7b3b391b4828d1f5b45d10fa586f99
[ "MIT" ]
1
2019-09-22T09:38:20.000Z
2019-09-22T09:38:20.000Z
lightdam/Camera.cpp
Wumpf/lightdam
5a007b5f5f7b3b391b4828d1f5b45d10fa586f99
[ "MIT" ]
null
null
null
lightdam/Camera.cpp
Wumpf/lightdam
5a007b5f5f7b3b391b4828d1f5b45d10fa586f99
[ "MIT" ]
null
null
null
#include "Camera.h" #define _USE_MATH_DEFINES #include <cmath> #include <Windows.h> using namespace DirectX; Camera::Camera() { } Camera::~Camera() { } void Camera::operator = (const Camera& camera) { memcpy(this, &camera, sizeof(Camera)); } bool Camera::operator ==(const Camera& camera) { return XMVector3Equal(m_position, camera.m_position) && XMVector3Equal(m_direction, camera.m_direction) && XMVector3Equal(m_up, camera.m_up) && m_fovRad == camera.m_fovRad; } void Camera::SnapUpToAxis() { static constexpr XMFLOAT3 xpos(1, 0, 0); static constexpr XMFLOAT3 xneg(-1, 0, 0); static constexpr XMFLOAT3 ypos(0, 1, 0); static constexpr XMFLOAT3 yneg(0, -1, 0); static constexpr XMFLOAT3 zpos(0,0, 1); static constexpr XMFLOAT3 zneg(0,0, -1); XMFLOAT3 up; DirectX::XMStoreFloat3(&up, m_up); if (fabs(up.x) > fabs(up.y) && fabs(up.x) > fabs(up.z)) m_up = XMLoadFloat3(up.x > 0 ? &xpos : &xneg); else if (fabs(up.y) > fabs(up.x) && fabs(up.y) > fabs(up.z)) m_up = XMLoadFloat3(up.y > 0 ? &ypos : &yneg); else if (fabs(up.z) > fabs(up.y) && fabs(up.z) > fabs(up.y)) m_up = XMLoadFloat3(up.z > 0 ? &zpos : &zneg); } void Camera::ComputeCameraParams(float aspectRatio, XMVECTOR& cameraU, XMVECTOR& cameraV, XMVECTOR& cameraW) const { cameraW = m_direction; cameraU = DirectX::XMVector3Normalize(DirectX::XMVector3Cross(cameraW, m_up)); cameraV = DirectX::XMVector3Normalize(DirectX::XMVector3Cross(cameraW, cameraU)); float f = (float)tan(m_fovRad * 0.5f); cameraU *= f; cameraV *= f; if (aspectRatio > 1.0f) cameraU *= aspectRatio; else cameraV /= aspectRatio; } static inline bool IsKeyDown(int keyCode) { return GetAsyncKeyState(keyCode) & 0x8000; } void ControllableCamera::Update(float secondsSinceLastUpdate) { POINT newMousePos; GetCursorPos(&newMousePos); unsigned char keyState[256]; GetKeyboardState(keyState); if (IsKeyDown(VK_RBUTTON)) { DirectX::XMFLOAT3 dir; XMStoreFloat3(&dir, m_direction); float rotY = -m_rotSpeed * (newMousePos.y - m_lastMousePosY); float rotX = -m_rotSpeed * (newMousePos.x - m_lastMousePosX); float scaledMoveSpeed = m_moveSpeed; if (IsKeyDown(VK_SHIFT)) scaledMoveSpeed *= m_moveSpeedSpeedupFactor; float forward = (IsKeyDown(VK_UP) || IsKeyDown('W')) ? 1.0f : 0.0f; float back = (IsKeyDown(VK_DOWN) || IsKeyDown('S')) ? 1.0f : 0.0f; float left = (IsKeyDown(VK_LEFT) || IsKeyDown('A')) ? 1.0f : 0.0f; float right = (IsKeyDown(VK_RIGHT) || IsKeyDown('D')) ? 1.0f : 0.0f; auto cameraLeft = XMVector3Cross(m_direction, m_up); auto rotateUpDown = XMQuaternionRotationAxis(cameraLeft, rotY); auto rotateLeftRight = XMQuaternionRotationAxis(m_up, rotX); //m_up = XMVector3Rotate(m_up, rotateUpDown); m_direction = XMVector3Rotate(m_direction, rotateUpDown); m_direction = XMVector3Rotate(m_direction, rotateLeftRight); m_position = m_position + ((forward - back) * m_direction + (right - left) * cameraLeft) * scaledMoveSpeed * secondsSinceLastUpdate; } m_lastMousePosX = newMousePos.x; m_lastMousePosY = newMousePos.y; }
30.657407
140
0.654485
Wumpf
a63b33e2ecaadffa43f66c6adafa352391fd18d2
1,418
hpp
C++
modules/logic/src/Logic/Cv/Core/gmLogicCvSum.hpp
GraphMIC/GraphMIC
8fc2aeb0143ee1292c6757f010fc9e8c68823e2b
[ "BSD-3-Clause" ]
43
2016-04-11T11:34:05.000Z
2022-03-31T03:37:57.000Z
modules/logic/src/Logic/Cv/Core/gmLogicCvSum.hpp
kevinlq/GraphMIC
8fc2aeb0143ee1292c6757f010fc9e8c68823e2b
[ "BSD-3-Clause" ]
1
2016-05-17T12:58:16.000Z
2016-05-17T12:58:16.000Z
modules/logic/src/Logic/Cv/Core/gmLogicCvSum.hpp
kevinlq/GraphMIC
8fc2aeb0143ee1292c6757f010fc9e8c68823e2b
[ "BSD-3-Clause" ]
14
2016-05-13T20:23:16.000Z
2021-12-20T10:33:19.000Z
#pragma once #include "gmLogicCvBase.hpp" namespace gm { namespace Logic { namespace Cv { class Sum : public Base { public: struct ID { static constexpr auto input = "input"; static constexpr auto output = "sum"; }; static Register<Sum> Register; using Access = Enable::ImageTypes < Enable::Dimension<2>, Enable::Scalar<unsigned char, unsigned short, char, short, float, double>, Enable::Rgb<unsigned char, unsigned short, char, short> >; Sum() : Base("Sum") { this->add(new Slot::Input<Data::Image>(ID::input, Access::MakeConstraints(), Data::Required)); this->add(new Slot::Output<Data::Vector>(ID::output)); } auto run() -> void override { auto output = this->getOutput<Data::Vector>(ID::output); for (auto it : this->inputIterator()) { auto out = cv::sum(Image::ToCv(it.image())); output->addVector(new Data::Vector(out[0], out[1], out[2], out[3])); } } }; } } }
29.541667
114
0.423131
GraphMIC
a63e7bf479e4bd69c6697de0b34a461cf8d9c84a
6,320
cpp
C++
unit_tests/gtest_colorhdr.cpp
bigplayszn/nCine
43f5fe8e82e9daa21e4d1feea9ca41ed4cce7454
[ "MIT" ]
675
2019-05-28T19:00:55.000Z
2022-03-31T16:44:28.000Z
unit_tests/gtest_colorhdr.cpp
bigplayszn/nCine
43f5fe8e82e9daa21e4d1feea9ca41ed4cce7454
[ "MIT" ]
13
2020-03-29T06:46:32.000Z
2022-01-29T03:19:30.000Z
unit_tests/gtest_colorhdr.cpp
bigplayszn/nCine
43f5fe8e82e9daa21e4d1feea9ca41ed4cce7454
[ "MIT" ]
53
2019-06-02T03:04:10.000Z
2022-03-11T06:17:50.000Z
#include "gtest_color.h" namespace { class ColorHdrTest : public ::testing::Test { public: ColorHdrTest() : col1_(5.0f, 5.0f, 5.0f), col2_(2.5f, 3.3f, 2.5f) {} nc::ColorHdr col1_; nc::ColorHdr col2_; }; const float red = 0.25f; const float green = 0.5f; const float blue = 0.75f; TEST_F(ColorHdrTest, DefaultConstructor) { const nc::ColorHdr color; printColor("Constructing a new color with the default white constructor: ", color); ASSERT_FLOAT_EQ(color.data()[0], 1.0f); ASSERT_FLOAT_EQ(color.data()[1], 1.0f); ASSERT_FLOAT_EQ(color.data()[2], 1.0f); } TEST_F(ColorHdrTest, ConstructFromThreeComponents) { const nc::ColorHdr color(red, green, blue); printColor("Constructing a new color from three components: ", color); ASSERT_FLOAT_EQ(color.data()[0], red); ASSERT_FLOAT_EQ(color.data()[1], green); ASSERT_FLOAT_EQ(color.data()[2], blue); } TEST_F(ColorHdrTest, ConstructFromArray) { const float vec[nc::ColorHdr::NumChannels] = { red, green, blue }; const nc::ColorHdr color(vec); printColor("Constructing a new color from an array: ", color); ASSERT_FLOAT_EQ(color.data()[0], vec[0]); ASSERT_FLOAT_EQ(color.data()[1], vec[1]); ASSERT_FLOAT_EQ(color.data()[2], vec[2]); } TEST_F(ColorHdrTest, ConstructFromClampedFloatColor) { nc::ColorHdr color(nc::Colorf::Black); printColor("Constructing a new color from a float one: ", color); ASSERT_FLOAT_EQ(color.r(), 0.0f); ASSERT_FLOAT_EQ(color.g(), 0.0f); ASSERT_FLOAT_EQ(color.b(), 0.0f); } TEST_F(ColorHdrTest, Getters) { const nc::ColorHdr color(red, green, blue); printColor("Constructing a new color and testing its getters: ", color); ASSERT_FLOAT_EQ(color.r(), red); ASSERT_FLOAT_EQ(color.g(), green); ASSERT_FLOAT_EQ(color.b(), blue); } TEST_F(ColorHdrTest, SetThreeComponents) { nc::ColorHdr color; color.set(red, green, blue); printColor("Constructing a new color and setting three components: ", color); ASSERT_FLOAT_EQ(color.r(), red); ASSERT_FLOAT_EQ(color.g(), green); ASSERT_FLOAT_EQ(color.b(), blue); } TEST_F(ColorHdrTest, SetArray) { const float vec[nc::ColorHdr::NumChannels] = { red, green, blue }; nc::ColorHdr color; color.setVec(vec); printColor("Constructing a new color and setting components from an array: ", color); ASSERT_FLOAT_EQ(color.data()[0], vec[0]); ASSERT_FLOAT_EQ(color.data()[1], vec[1]); ASSERT_FLOAT_EQ(color.data()[2], vec[2]); } TEST_F(ColorHdrTest, Clamp) { nc::ColorHdr color(-1.0f, -1.0f, -1.0f); color.clamp(); printColor("Constructing a new color and clamping its channels: ", color); ASSERT_FLOAT_EQ(color.r(), 0.0f); ASSERT_FLOAT_EQ(color.g(), 0.0f); ASSERT_FLOAT_EQ(color.b(), 0.0f); } TEST_F(ColorHdrTest, Clamped) { nc::ColorHdr color(-1.0f, -1.0f, -1.0f); const nc::ColorHdr newColor = color.clamped(); printColor("Constructing a new color by clamping another one: ", newColor); ASSERT_FLOAT_EQ(newColor.r(), 0.0f); ASSERT_FLOAT_EQ(newColor.g(), 0.0f); ASSERT_FLOAT_EQ(newColor.b(), 0.0f); } TEST_F(ColorHdrTest, AssignNonFloatColor) { nc::ColorHdr color; color = nc::Colorf::Black; printColor("Assigning a new color from a float one: ", color); ASSERT_FLOAT_EQ(color.r(), 0.0f); ASSERT_FLOAT_EQ(color.g(), 0.0f); ASSERT_FLOAT_EQ(color.b(), 0.0f); } TEST_F(ColorHdrTest, EqualityOperatorAfterConversion) { const nc::Color color1 = nc::Color(nc::Colorf(nc::ColorHdr::Red)); const nc::Color color2 = nc::Color(nc::Colorf(nc::ColorHdr::Red)); ASSERT(color1 == color2); } TEST_F(ColorHdrTest, AdditionInPlace) { const nc::ColorHdr oldCol1 = col1_; printColor("color1: ", col1_); printColor("color2: ", col2_); printColor("Adding the second color to the first: ", col1_ += col2_); ASSERT_EQ(col1_.r(), oldCol1.r() + col2_.r()); ASSERT_EQ(col1_.g(), oldCol1.g() + col2_.g()); ASSERT_EQ(col1_.b(), oldCol1.b() + col2_.b()); } TEST_F(ColorHdrTest, SubtractionInPlace) { const nc::ColorHdr oldCol1 = col1_; printColor("color1: ", col1_); printColor("color2: ", col2_); printColor("Subtracting the second color from the first: ", col1_ -= col2_); ASSERT_EQ(col1_.r(), oldCol1.r() - col2_.r()); ASSERT_EQ(col1_.g(), oldCol1.g() - col2_.g()); ASSERT_EQ(col1_.b(), oldCol1.b() - col2_.b()); } TEST_F(ColorHdrTest, MultiplicationInPlace) { const nc::ColorHdr oldCol1 = col1_; printColor("color1: ", col1_); printColor("color2: ", col2_); printColor("Multiplying the first color by the second: ", col1_ *= col2_); ASSERT_FLOAT_EQ(col1_.r(), oldCol1.r() * col2_.r()); ASSERT_FLOAT_EQ(col1_.g(), oldCol1.g() * col2_.g()); ASSERT_FLOAT_EQ(col1_.b(), oldCol1.b() * col2_.b()); } TEST_F(ColorHdrTest, MultiplyScalarInPlace) { const float scalar = 0.5f; const nc::ColorHdr oldCol1 = col1_; printColor("color1: ", col1_); printf("Multiplying the first color by the scalar %.2f: ", scalar); printColor(col1_ *= scalar); ASSERT_FLOAT_EQ(col1_.r(), oldCol1.r() * scalar); ASSERT_FLOAT_EQ(col1_.g(), oldCol1.g() * scalar); ASSERT_FLOAT_EQ(col1_.b(), oldCol1.b() * scalar); } TEST_F(ColorHdrTest, Addition) { printColor("color1: ", col1_); printColor("color2: ", col2_); const nc::ColorHdr add = col1_ + col2_; printColor("Color addition: ", add); ASSERT_EQ(add.r(), col1_.r() + col2_.r()); ASSERT_EQ(add.g(), col1_.g() + col2_.g()); ASSERT_EQ(add.b(), col1_.b() + col2_.b()); } TEST_F(ColorHdrTest, Subtraction) { printColor("color1: ", col1_); printColor("color2: ", col2_); const nc::ColorHdr sub = col1_ - col2_; printColor("Color subtraction: ", sub); ASSERT_EQ(sub.r(), col1_.r() - col2_.r()); ASSERT_EQ(sub.g(), col1_.g() - col2_.g()); ASSERT_EQ(sub.b(), col1_.b() - col2_.b()); } TEST_F(ColorHdrTest, Multiplication) { printColor("color1: ", col1_); printColor("color2: ", col2_); const nc::ColorHdr mul = col1_ * col2_; printColor("Color multiplication: ", mul); ASSERT_FLOAT_EQ(mul.r(), col1_.r() * col2_.r()); ASSERT_FLOAT_EQ(mul.g(), col1_.g() * col2_.g()); ASSERT_FLOAT_EQ(mul.b(), col1_.b() * col2_.b()); } TEST_F(ColorHdrTest, MultiplyScalar) { const float scalar = 0.5f; printColor("color1: ", col1_); const nc::ColorHdr mul = col1_ * scalar; printf("Multiplication by scalar %.2f: ", scalar); printColor(mul); ASSERT_FLOAT_EQ(mul.r(), col1_.r() * scalar); ASSERT_FLOAT_EQ(mul.g(), col1_.g() * scalar); ASSERT_FLOAT_EQ(mul.b(), col1_.b() * scalar); } }
26.666667
86
0.691139
bigplayszn
a6430246ecf22cd7961b0171a56b075ee2e0243d
943
hpp
C++
addons/modules/attributes/dynamicOwnerNoSyncToolbox.hpp
Krzyciu/A3CS
b7144fc9089b5ded6e37cc1fad79b1c2879521be
[ "MIT" ]
1
2020-06-07T00:45:49.000Z
2020-06-07T00:45:49.000Z
addons/modules/attributes/dynamicOwnerNoSyncToolbox.hpp
Krzyciu/A3CS
b7144fc9089b5ded6e37cc1fad79b1c2879521be
[ "MIT" ]
27
2020-05-24T11:09:56.000Z
2020-05-25T12:28:10.000Z
addons/modules/attributes/dynamicOwnerNoSyncToolbox.hpp
Krzyciu/A3CS
b7144fc9089b5ded6e37cc1fad79b1c2879521be
[ "MIT" ]
2
2020-05-31T08:52:45.000Z
2021-04-16T23:16:37.000Z
class GVAR(dynamicOwnerNoSyncToolbox): GVAR(dynamicToolboxPicture) { class Controls: Controls { class Title: Title {}; class Value: Value { columns = 5; strings[] = { "\a3\3DEN\Data\Displays\Display3DEN\PanelRight\side_custom_ca.paa", "\a3\3DEN\Data\Displays\Display3DEN\PanelRight\side_west_ca.paa", "\a3\3DEN\Data\Displays\Display3DEN\PanelRight\side_east_ca.paa", "\a3\3DEN\Data\Displays\Display3DEN\PanelRight\side_guer_ca.paa", "\a3\3DEN\Data\Displays\Display3DEN\PanelRight\side_civ_ca.paa" }; tooltips[] = { CSTRING(dynamicOwnerToolbox_all), "BLUFOR", "OPFOR", "INDEP", "CIV" }; values[] = {0, 1, 2, 3, 4}; }; class GVAR(description): GVAR(description) {}; }; };
36.269231
83
0.529162
Krzyciu
a644201bd9e4c28dd080b11db831bb19f9cbac43
18,564
cc
C++
src/dsfs.cc
hspabla/DFS-FUSE
a47e30616f31a78fba23b2b1b0ddb25c97c7beea
[ "Apache-2.0" ]
3
2020-04-08T10:32:44.000Z
2022-02-17T07:04:07.000Z
src/dsfs.cc
hspabla/DFS-FUSE
a47e30616f31a78fba23b2b1b0ddb25c97c7beea
[ "Apache-2.0" ]
1
2019-10-25T12:24:20.000Z
2019-10-25T12:24:20.000Z
src/dsfs.cc
hspabla/DFS-FUSE
a47e30616f31a78fba23b2b1b0ddb25c97c7beea
[ "Apache-2.0" ]
null
null
null
#include "../include/dsfs.hh" #include "../include/clientHelper.h" DSFS* DSFS::_instance = NULL; DSFS* DSFS::Instance() { if(_instance == NULL) { _instance = new DSFS(); } return _instance; } DSFS::DSFS() { } DSFS::~DSFS() { } void DSFS::AbsPath(char dest[PATH_MAX], const char *path) { log_msg("dsfs_AbsPath: rootdir = \"%s\", path = \"%s\", destination = \"%s\"\n", _root, path, dest); strcpy(dest, _root); strncat(dest, path, PATH_MAX); } void DSFS::setRootDir(const char *path) { _root = path; } int DSFS::Getattr(const char *path, struct stat *statbuf) { char fullPath[ PATH_MAX ]; AbsPath( fullPath, path ); log_msg("\ndsfs_Getattr(path=\"%s\", statbuf=%s)\n", path, *statbuf); GetAttrClient client( grpc::CreateChannel( "localhost:50051", grpc::InsecureChannelCredentials() ) ); GetAttrRequest request; GetAttrResponse response; request.set_name(fullPath); try { response = client.GetAttr(request); Attr attributes = response.attr(); FSstatus status = response.status(); statbuf->st_dev = attributes.dev(); statbuf->st_ino = attributes.ino(); statbuf->st_mode = attributes.mode(); statbuf->st_nlink = attributes.nlink(); Owner owner = attributes.owner(); statbuf->st_uid = owner.uid(); statbuf->st_gid = owner.gid(); statbuf->st_rdev = attributes.rdev(); statbuf->st_size = attributes.size(); statbuf->st_blksize = attributes.blksize(); statbuf->st_blocks = attributes.blocks(); statbuf->st_atime = attributes.atime(); statbuf->st_mtime = attributes.mtime(); statbuf->st_ctime = attributes.ctime(); if (status.retcode() == 0) { log_msg("Return Code: %d\n", status.retcode()); return 0; } else { log_msg("Return Code: %d\n", status.retcode()); errno = status.retcode(); return errno; } } catch ( std::string errorMsg ) { std::cout << errorMsg << std::endl; return -1; } } int DSFS::Mknod(const char *path, mode_t mode, dev_t dev) { char fullPath[PATH_MAX]; AbsPath(fullPath, path); log_msg("dsfs_Mknod(path=%s, mode=%d, dev=%d)\n", path, mode, dev); MknodClient client( grpc::CreateChannel( "localhost:50051", grpc::InsecureChannelCredentials() ) ); MknodRequest request; request.set_name(fullPath); request.set_mode(mode); request.set_dev(dev); try { MknodResponse response = client.Mknod(request); FSstatus status = response.status(); if (status.retcode() == 0) { log_msg("Return Code: %d\n", status.retcode()); return 0; } else { errno = status.retcode(); log_msg("Return Code: %d\n", status.retcode()); return errno; } } catch ( std::string errorMsg ) { std::cout << errorMsg << std::endl; return -1; } } int DSFS::Mkdir(const char *path, mode_t mode) { char fullPath[PATH_MAX]; AbsPath(fullPath, path); log_msg("dsfs_Mkdir(path=%s, mode=%d)\n", path, mode); MkdirClient client( grpc::CreateChannel( "localhost:50051", grpc::InsecureChannelCredentials() ) ); MkdirRequest request; MkdirResponse response; request.set_name(fullPath); request.set_mode(mode); try { response = client.Mkdir(request); FSstatus status = response.status(); if (status.retcode() == 0) { log_msg("Return Code: %d\n", status.retcode()); return 0; } else { errno = status.retcode(); log_msg("Return Code: %d\n", status.retcode()); return errno; } } catch ( std::string errorMsg ) { std::cout << errorMsg << std::endl; return -1; } } int DSFS::Unlink(const char *path) { char fullPath[PATH_MAX]; AbsPath(fullPath, path); log_msg("dsfs_Unlink(path=%s)\n", path); UnlinkClient client( grpc::CreateChannel( "localhost:50051", grpc::InsecureChannelCredentials() ) ); UnlinkRequest request; request.set_name(fullPath); try { UnlinkResponse response = client.Unlink(request); FSstatus status = response.status(); if (status.retcode() == 0) { log_msg("Return Code: %d\n", status.retcode()); return 0; } else { errno = status.retcode(); log_msg("Return Code: %d\n", status.retcode()); return errno; } } catch ( std::string errorMsg ) { std::cout << errorMsg << std::endl; return -1; } } int DSFS::Rmdir(const char *path) { char fullPath[PATH_MAX]; AbsPath(fullPath, path); log_msg("dsfs_Rmdir(path=%s)\n", path); RmdirClient client( grpc::CreateChannel( "localhost:50051", grpc::InsecureChannelCredentials() ) ); RmdirRequest request; request.set_name(fullPath); try { RmdirResponse response = client.Rmdir(request); FSstatus status = response.status(); if (status.retcode() == 0) { log_msg("Return Code: %d\n", status.retcode()); return 0; } else { errno = status.retcode(); log_msg("Return Code: %d\n", status.retcode()); return errno; } } catch ( std::string errorMsg ) { std::cout << errorMsg << std::endl; return -1; } } int DSFS::Rename(const char *path, const char *newpath) { char fullPath[PATH_MAX], newFullPath[PATH_MAX]; AbsPath(fullPath, path); AbsPath(newFullPath, newpath); log_msg("dsfs_Rename(path=\"%s\", newpath=\"%s\")\n", path, newpath); RenameClient client( grpc::CreateChannel( "localhost:50051", grpc::InsecureChannelCredentials() ) ); RenameRequest request; request.set_oldname(fullPath); request.set_newname(newFullPath); try { RenameResponse response = client.Rename(request); FSstatus status = response.status(); if (status.retcode() == 0) { log_msg("Return Code: %d\n", status.retcode()); return 0; } else { errno = status.retcode(); log_msg("Return Code: %d\n", status.retcode()); return errno; } } catch ( std::string errorMsg ) { std::cout << errorMsg << std::endl; return -1; } } int DSFS::Chmod(const char *path, mode_t mode) { char fullPath[PATH_MAX]; AbsPath(fullPath, path); log_msg("dsfs_Chmod(path=%s, mode=%d)\n", path, mode); ChmodClient client( grpc::CreateChannel( "localhost:50051", grpc::InsecureChannelCredentials() ) ); ChmodRequest request; request.set_name( fullPath ); request.set_mode( mode ); try { ChmodResponse response = client.Chmod( request ); FSstatus status = response.status(); if ( status.retcode() == 0 ) { log_msg("Return Code: %d\n", status.retcode()); return 0; } else { errno = status.retcode(); log_msg("Return Code: %d\n", status.retcode()); return errno; } } catch ( std::string errorMsg ) { std::cout << errorMsg << std::endl; return -1; } } int DSFS::Chown(const char *path, uid_t uid, gid_t gid) { char fullPath[PATH_MAX]; AbsPath(fullPath, path); log_msg("dsfs_Chown(path=%s, uid=%d, gid=%d)\n", path, (int)uid, (int)gid); ChownClient client( grpc::CreateChannel( "localhost:50051", grpc::InsecureChannelCredentials() ) ); ChownRequest request; request.set_name( fullPath ); request.set_uid( uid ); request.set_gid( gid ); try { ChownResponse response = client.Chown( request ); FSstatus status = response.status(); if ( status.retcode() == 0 ) { log_msg("Return Code: %d\n", status.retcode()); return 0; } else { errno = status.retcode(); log_msg("Return Code: %d\n", status.retcode()); return errno; } } catch ( std::string errorMsg ) { std::cout << errorMsg << std::endl; return -1; } } int DSFS::Truncate(const char *path, off_t newSize) { char fullPath[PATH_MAX]; AbsPath(fullPath, path); log_msg("dsfs_Truncate(path=%s, newSize=%d)\n", path, (int)newSize); TruncateClient client( grpc::CreateChannel( "localhost:50051", grpc::InsecureChannelCredentials() ) ); TruncateRequest request; request.set_name( fullPath ); request.set_size( newSize ); try { TruncateResponse response = client.Truncate( request ); FSstatus status = response.status(); if ( status.retcode() == 0 ) { log_msg("Return Code: %d\n", status.retcode()); return 0; } else { errno = status.retcode(); log_msg("Return Code: %d\n", status.retcode()); return errno; } } catch ( std::string errorMsg ) { std::cout << errorMsg << std::endl; return -1; } } int DSFS::Access(const char *path, int mask) { char fullPath[PATH_MAX]; AbsPath(fullPath, path); log_msg("dsfs_Access(path=%s, mask=%d)\n", path, mask); AccessClient client( grpc::CreateChannel( "localhost:50051", grpc::InsecureChannelCredentials() ) ); AccessRequest request; request.set_name( fullPath ); request.set_mode( mask ); try { AccessResponse response = client.Access( request ); FSstatus status = response.status(); if ( status.retcode() == 0 ) { log_msg("Return Code: %d\n", status.retcode()); return 0; } else { errno = status.retcode(); log_msg("Return Code: %d\n", status.retcode()); return errno; } } catch ( std::string errorMsg ) { std::cout << errorMsg << std::endl; return -1; } } int DSFS::Open(const char *path, struct fuse_file_info *fileInfo) { char fullPath[ PATH_MAX ]; AbsPath( fullPath, path ); log_msg("dsfs_Open(path=%s, fileHandle=%d, flags=%d)\n", path, (int)fileInfo->fh, (int)fileInfo->flags); // RPC request prep OpenClient client( grpc::CreateChannel( "localhost:50051", grpc::InsecureChannelCredentials() ) ); OpenRequest request; request.set_name( fullPath ); request.set_flags( fileInfo->flags ); try { OpenResponse response = client.Open( request ); fileInfo->fh = response.filehandle(); FSstatus status = response.status(); if ( status.retcode() == 0 ) { log_msg("Return Code: %d\n", status.retcode()); return 0; } else { errno = status.retcode(); log_msg("Return Code: %d\n", status.retcode()); return errno; } } catch ( std::string errorMsg ) { std::cout << errorMsg << std::endl; return -1; } } int DSFS::Read(const char *path, char *buf, size_t size, off_t offset, struct fuse_file_info *fileInfo) { log_msg("dsfs_Read(path=%s, size=%d, offset=%d, fileHandle=%d, flags=%d)\n", path, (int)size, (int)offset, (int)fileInfo->fh, (int)fileInfo->flags); // RPC request prep ReadClient client( grpc::CreateChannel( "localhost:50051", grpc::InsecureChannelCredentials() ) ); ReadRequest request; request.set_filehandle( fileInfo->fh ); request.set_size( size ); request.set_offset( offset ); try { // RPC call ReadResponse response = client.Read( request ); FSstatus status = response.status(); if ( status.retcode() == 0 ) { int byteRead = response.dataread(); if ( byteRead > 0 ) memcpy( buf, response.data().c_str(), byteRead ); log_msg("Return Code: %d\n", status.retcode()); return byteRead; } else { errno = status.retcode(); log_msg("Return Code: %d\n", status.retcode()); return errno; } } catch ( std::string errorMsg ) { std::cout << errorMsg << std::endl; return -1; } } int DSFS::Write(const char *path, const char *buf, size_t size, off_t offset, struct fuse_file_info *fileInfo) { log_msg("dsfs_Write(path=%s, size=%d, offset=%d, fileHandle=%d, flags=%d)\n", path, (int)size, (int)offset, (int)fileInfo->fh, (int)fileInfo->flags); std::string data( buf, size ); // RPC request prep WriteClient client( grpc::CreateChannel( "localhost:50051", grpc::InsecureChannelCredentials() ) ); WriteRequest request; request.set_filehandle( fileInfo->fh ); request.set_data( data ); request.set_size( size ); request.set_offset( offset ); try { // RPC call WriteResponse response = client.Write( request ); FSstatus status = response.status(); if ( status.retcode() == 0 ) { // update local buffer, if fh is not in map, it will be added this way dataBuffer[ fileInfo->fh ].append( buf, size ); log_msg("Return Code: %d\n", status.retcode()); return size; } else { errno = status.retcode(); log_msg("Return Code: %d\n", status.retcode()); return errno; } } catch ( std::string errorMsg ) { std::cout << errorMsg << std::endl; return -1; } } int DSFS::Release(const char *path, struct fuse_file_info *fileInfo) { log_msg("dsfs_Release(path=%s)\n", path); ReleaseClient client( grpc::CreateChannel( "localhost:50051", grpc::InsecureChannelCredentials() ) ); ReleaseRequest request; request.set_filehandle(fileInfo->fh); try { ReleaseResponse response = client.Release(request); FSstatus status = response.status(); if (status.retcode() == 0) { log_msg("Return Code: %d\n", status.retcode()); return 0; } else { errno = status.retcode(); log_msg("Return Code: %d\n", status.retcode()); return errno; } } catch ( std::string errorMsg ) { std::cout << errorMsg << std::endl; return -1; } } int DSFS::Fsync(const char *path, int datasync, struct fuse_file_info *fi) { log_msg("dsfs_Fsync(path=%s, fileHandle=%d, datasync=%d\n", path, (int) fi->fh, datasync); FsyncClient client( grpc::CreateChannel( "localhost:50051", grpc::InsecureChannelCredentials() ) ); FsyncRequest request; request.set_filehandle( fi->fh ); try { FsyncResponse response = client.Fsync( request ); FSstatus status = response.status(); if (status.retcode() == 0) { // Data successfully on disk, we can remove stuff from local buffer log_msg("Return Code: %d\n", status.retcode()); dataBuffer.erase( fi->fh ); return 0; } else { errno = status.retcode(); log_msg("Return Code: %d\n", status.retcode()); return errno; } } catch ( std::string errorMsg ) { std::cout << errorMsg << std::endl; return -1; } } //Extended attributes not implemented for RPC calls. int DSFS::Setxattr(const char *path, const char *name, const char *value, size_t size, int flags) { log_msg("dsfs_Setxattr(path=%s, name=%s, value=%s, size=%d, flags=%d\n", path, name, value, (int)size, flags); return 0; } int DSFS::Getxattr(const char *path, const char *name, char *value, size_t size) { log_msg("dsfs_Getxattr(path=%s, name=%s, size=%d)\n", path, name, (int)size); return 0; } int DSFS::Listxattr(const char *path, char *list, size_t size) { log_msg("dsfs_Listxattr(path=%s, list=%s, size=%d)\n", path, list, (int)size); return 0; } int DSFS::Removexattr(const char *path, const char *name) { log_msg("dsfs_Removexattr(path=%s, name=%s)\n", path, name); return 0; } int DSFS::Readdir(const char *path, void *buf, fuse_fill_dir_t filler, off_t offset, struct fuse_file_info *fileInfo) { char fullPath[PATH_MAX]; AbsPath(fullPath, path); log_msg("dsfs_Readdir(path=%s, offset=%d)\n", path, (int)offset); std::shared_ptr<Channel> channel = grpc::CreateChannel( "localhost:50051", grpc::InsecureChannelCredentials() ); OpenDirClient client( channel); OpenDirRequest request; OpenDirResponse response; request.set_name(fullPath); try { response = client.Opendir(request); FSstatus status = response.status(); if ( status.retcode() == 0 ) { for(int i=0; i< response.dirs_size(); i++) { struct stat st; memset(&st, 0, sizeof(st)); DirEntry dir = response.dirs(i); st.st_ino = dir.ino(); st.st_mode = dir.mode() << 12; if (filler(buf, (dir.name()).c_str(), &st, 0) != 0) break; } log_msg("Return Code: %d\n", status.retcode()); return 0; } else { errno = status.retcode(); log_msg("Return Code: %d\n", status.retcode()); return errno; } } catch ( std::string errorMsg ) { std::cout << errorMsg << std::endl; return -1; } } int DSFS::Releasedir(const char *path, struct fuse_file_info *fileInfo) { log_msg("dsfs_Releasedir(path=%s)\n", path); ReleasedirClient client( grpc::CreateChannel( "localhost:50051", grpc::InsecureChannelCredentials() ) ); ReleasedirRequest request; request.set_filehandle(fileInfo->fh); try { ReleasedirResponse response = client.Releasedir(request); FSstatus status = response.status(); if (status.retcode() == 0) { log_msg("Return Code: %d\n", status.retcode()); return 0; } else { errno = status.retcode(); log_msg("Return Code: %d\n", status.retcode()); return errno; } } catch ( std::string errorMsg ) { std::cout << errorMsg << std::endl; return -1; } } int DSFS::Init(struct fuse_conn_info *conn) { log_msg("\ndsfs_init()\n"); log_conn(conn); log_fuse_context(fuse_get_context()); return 0; } /*int DSFS::Flush(const char *path, struct fuse_file_info *fileInfo) { printf("flush(path=%s)\n", path); //noop because we don't maintain our own buffers return 0; }*/
32.454545
117
0.579347
hspabla
a64982518fd37d4344f8bb781164e9dade793331
421
cpp
C++
acmicpc.net/11931.cpp
kbu1564/SimpleAlgorithm
7e5b0d2fe19461417d88de0addd2235da55787d3
[ "MIT" ]
4
2016-04-15T07:54:39.000Z
2021-01-11T09:02:16.000Z
acmicpc.net/11931.cpp
kbu1564/SimpleAlgorithm
7e5b0d2fe19461417d88de0addd2235da55787d3
[ "MIT" ]
null
null
null
acmicpc.net/11931.cpp
kbu1564/SimpleAlgorithm
7e5b0d2fe19461417d88de0addd2235da55787d3
[ "MIT" ]
null
null
null
#include <cstdio> #include <iostream> #include <cmath> using namespace std; int MRR[1000001]; int ARR[1000001]; int main() { int N; scanf("%d", &N); for (int i = 0; i < N; i++) { int v; scanf("%d", &v); if (v >= 0) ARR[v] = 1; else MRR[abs(v)] = 1; } for (int i = 1000000; i >= 0; i--) if (ARR[i] == 1) printf("%d\n", i); for (int i = 1; i < 1000001; i++) if (MRR[i] == 1) printf("%d\n", -i); return 0; }
21.05
72
0.515439
kbu1564
a64a8c758508c40047a7961addc7187ab1f5db36
52,483
cpp
C++
src/openssl.cpp
selfienetworks/COSE-C
97d1805e71b7a6770093c5e6790d46611680d563
[ "BSD-3-Clause" ]
25
2016-07-15T12:11:42.000Z
2021-11-19T20:52:46.000Z
src/openssl.cpp
selfienetworks/COSE-C
97d1805e71b7a6770093c5e6790d46611680d563
[ "BSD-3-Clause" ]
96
2015-09-04T05:12:01.000Z
2021-12-30T08:39:56.000Z
src/openssl.cpp
selfienetworks/COSE-C
97d1805e71b7a6770093c5e6790d46611680d563
[ "BSD-3-Clause" ]
21
2015-05-27T03:27:21.000Z
2021-08-10T15:10:10.000Z
#include "cose/cose.h" #include "cose/cose_configure.h" #include "cose_int.h" #include "cose_crypto.h" #include <assert.h> #ifdef __MBED__ #include <string.h> #else #include <memory.h> #endif #include <stdbool.h> #ifdef COSE_C_USE_OPENSSL #include <openssl/evp.h> #include <openssl/aes.h> #include <openssl/cmac.h> #include <openssl/hmac.h> #include <openssl/ecdsa.h> #include <openssl/ecdh.h> #include <openssl/rand.h> #include <openssl/bn.h> /*******************************************/ #define Safe_OPENSSL(handleName, freeFunction) \ class Safe_##handleName { \ handleName *h; \ \ public: \ Safe_##handleName() { h = nullptr; } \ Safe_##handleName(handleName *hIn) { h = hIn; } \ ~Safe_##handleName() { freeFunction(h); } \ handleName *Set(handleName *hIn) \ { \ if (h != nullptr) { \ freeFunction(h); \ } \ h = hIn; \ if (hIn != nullptr) { \ handleName##_up_ref(hIn); \ } \ return hIn; \ } \ bool IsNull() { return h == NULL; } \ operator handleName *() { return h; } \ handleName *operator=(handleName *pIn) \ { \ Set(pIn); \ return pIn; \ } \ handleName *Transfer(Safe_##handleName *hIn) \ { \ if (h != nullptr) { \ freeFunction(h); \ } \ h = hIn->h; \ hIn->h = nullptr; \ return h; \ } \ handleName *operator=(Safe_##handleName hIn) \ { \ Set(hIn.h); \ return h; \ } \ handleName *Release() \ { \ handleName *h2 = h; \ h = nullptr; \ return h2; \ } \ }; Safe_OPENSSL(EC_KEY, EC_KEY_free); Safe_OPENSSL(EVP_PKEY, EVP_PKEY_free); /**********************************************/ bool AES_CCM_Decrypt(COSE_Enveloped *pcose, int TSize, int LSize, const byte *pbKey, size_t cbKey, const byte *pbCrypto, size_t cbCrypto, const byte *pbAuthData, size_t cbAuthData, cose_errback *perr) { EVP_CIPHER_CTX *ctx; int cbOut; byte *rgbOut = nullptr; size_t NSize = 15 - (LSize / 8); int outl = 0; byte rgbIV[15] = {0}; const cn_cbor *pIV = nullptr; const EVP_CIPHER *cipher; #ifdef USE_CBOR_CONTEXT cn_cbor_context *context = &pcose->m_message.m_allocContext; #endif ctx = EVP_CIPHER_CTX_new(); CHECK_CONDITION(ctx != nullptr, COSE_ERR_OUT_OF_MEMORY); // Setup the IV/Nonce and put it into the message pIV = _COSE_map_get_int( &pcose->m_message, COSE_Header_IV, COSE_BOTH, nullptr); if ((pIV == nullptr) || (pIV->type != CN_CBOR_BYTES)) { if (perr != nullptr) { perr->err = COSE_ERR_INVALID_PARAMETER; } errorReturn: if (rgbOut != nullptr) { COSE_FREE(rgbOut, context); } EVP_CIPHER_CTX_free(ctx); return false; } CHECK_CONDITION(pIV->length == NSize, COSE_ERR_INVALID_PARAMETER); memcpy(rgbIV, pIV->v.str, pIV->length); // Setup and run the OpenSSL code switch (cbKey) { case 128 / 8: cipher = EVP_aes_128_ccm(); break; case 192 / 8: cipher = EVP_aes_192_ccm(); break; case 256 / 8: cipher = EVP_aes_256_ccm(); break; default: FAIL_CONDITION(COSE_ERR_INVALID_PARAMETER); break; } CHECK_CONDITION(EVP_DecryptInit_ex(ctx, cipher, nullptr, nullptr, nullptr), COSE_ERR_DECRYPT_FAILED); TSize /= 8; // Comes in in bits not bytes. CHECK_CONDITION( EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_CCM_SET_L, (LSize / 8), 0), COSE_ERR_DECRYPT_FAILED); // CHECK_CONDITION(EVP_CIPHER_CTX_ctrl(&ctx, EVP_CTRL_CCM_SET_IVLEN, NSize, // 0), COSE_ERR_DECRYPT_FAILED); CHECK_CONDITION(EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_CCM_SET_TAG, TSize, (void *)&pbCrypto[cbCrypto - TSize]), COSE_ERR_DECRYPT_FAILED); CHECK_CONDITION(EVP_DecryptInit_ex(ctx, 0, nullptr, pbKey, rgbIV), COSE_ERR_DECRYPT_FAILED); CHECK_CONDITION( EVP_DecryptUpdate(ctx, nullptr, &cbOut, nullptr, (int)cbCrypto - TSize), COSE_ERR_DECRYPT_FAILED); cbOut = (int)cbCrypto - TSize; rgbOut = (byte *)COSE_CALLOC(cbOut, 1, context); CHECK_CONDITION(rgbOut != nullptr, COSE_ERR_OUT_OF_MEMORY); CHECK_CONDITION( EVP_DecryptUpdate(ctx, nullptr, &outl, pbAuthData, (int)cbAuthData), COSE_ERR_DECRYPT_FAILED); CHECK_CONDITION( EVP_DecryptUpdate(ctx, rgbOut, &cbOut, pbCrypto, (int)cbCrypto - TSize), COSE_ERR_DECRYPT_FAILED); EVP_CIPHER_CTX_free(ctx); pcose->pbContent = rgbOut; pcose->cbContent = cbOut; return true; } bool AES_CCM_Encrypt(COSE_Enveloped *pcose, int TSize, int LSize, const byte *pbKey, size_t cbKey, const byte *pbAuthData, size_t cbAuthData, cose_errback *perr) { EVP_CIPHER_CTX *ctx; int cbOut; byte *rgbOut = nullptr; size_t NSize = 15 - (LSize / 8); int outl = 0; const cn_cbor *cbor_iv = nullptr; cn_cbor *cbor_iv_t = nullptr; #ifdef USE_CBOR_CONTEXT cn_cbor_context *context = &pcose->m_message.m_allocContext; #endif cn_cbor *cnTmp = nullptr; const EVP_CIPHER *cipher; byte rgbIV[16]; byte *pbIV = nullptr; cn_cbor_errback cbor_error; ctx = EVP_CIPHER_CTX_new(); CHECK_CONDITION(nullptr != ctx, COSE_ERR_OUT_OF_MEMORY); switch (cbKey * 8) { case 128: cipher = EVP_aes_128_ccm(); break; case 192: cipher = EVP_aes_192_ccm(); break; case 256: cipher = EVP_aes_256_ccm(); break; default: FAIL_CONDITION(COSE_ERR_INVALID_PARAMETER); } // Setup the IV/Nonce and put it into the message cbor_iv = _COSE_map_get_int(&pcose->m_message, COSE_Header_IV, COSE_BOTH, perr); if (cbor_iv == nullptr) { pbIV = (byte *)COSE_CALLOC(NSize, 1, context); CHECK_CONDITION(pbIV != nullptr, COSE_ERR_OUT_OF_MEMORY); rand_bytes(pbIV, NSize); memcpy(rgbIV, pbIV, NSize); cbor_iv_t = cn_cbor_data_create2( pbIV, NSize, 0, CBOR_CONTEXT_PARAM_COMMA & cbor_error); CHECK_CONDITION_CBOR(cbor_iv_t != nullptr, cbor_error); pbIV = nullptr; if (!_COSE_map_put(&pcose->m_message, COSE_Header_IV, cbor_iv_t, COSE_UNPROTECT_ONLY, perr)) { goto errorReturn; } cbor_iv_t = nullptr; } else { CHECK_CONDITION( cbor_iv->type == CN_CBOR_BYTES, COSE_ERR_INVALID_PARAMETER); CHECK_CONDITION(cbor_iv->length == NSize, COSE_ERR_INVALID_PARAMETER); memcpy(rgbIV, cbor_iv->v.str, cbor_iv->length); } // Setup and run the OpenSSL code CHECK_CONDITION(EVP_EncryptInit_ex(ctx, cipher, nullptr, nullptr, nullptr), COSE_ERR_CRYPTO_FAIL); TSize /= 8; // Comes in in bits not bytes. CHECK_CONDITION( EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_CCM_SET_L, (LSize / 8), 0), COSE_ERR_CRYPTO_FAIL); // CHECK_CONDITION(EVP_CIPHER_CTX_ctrl(&ctx, EVP_CTRL_CCM_SET_IVLEN, NSize, // 0), COSE_ERR_CRYPTO_FAIL); CHECK_CONDITION( EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_CCM_SET_TAG, TSize, nullptr), COSE_ERR_CRYPTO_FAIL); // Say we are doing an 8 byte tag CHECK_CONDITION(EVP_EncryptInit_ex(ctx, 0, nullptr, pbKey, rgbIV), COSE_ERR_CRYPTO_FAIL); CHECK_CONDITION(EVP_EncryptUpdate(ctx, 0, &cbOut, 0, (int)pcose->cbContent), COSE_ERR_CRYPTO_FAIL); CHECK_CONDITION( EVP_EncryptUpdate(ctx, nullptr, &outl, pbAuthData, (int)cbAuthData), COSE_ERR_CRYPTO_FAIL); rgbOut = (byte *)COSE_CALLOC(cbOut + TSize, 1, context); CHECK_CONDITION(rgbOut != nullptr, COSE_ERR_OUT_OF_MEMORY); CHECK_CONDITION(EVP_EncryptUpdate(ctx, rgbOut, &cbOut, pcose->pbContent, (int)pcose->cbContent), COSE_ERR_CRYPTO_FAIL); CHECK_CONDITION( EVP_EncryptFinal_ex(ctx, &rgbOut[cbOut], &cbOut), COSE_ERR_CRYPTO_FAIL); CHECK_CONDITION(EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_CCM_GET_TAG, TSize, &rgbOut[pcose->cbContent]), COSE_ERR_CRYPTO_FAIL); cnTmp = cn_cbor_data_create2(rgbOut, (int)pcose->cbContent + TSize, 0, CBOR_CONTEXT_PARAM_COMMA nullptr); CHECK_CONDITION(cnTmp != nullptr, COSE_ERR_CBOR); rgbOut = nullptr; CHECK_CONDITION(_COSE_array_replace(&pcose->m_message, cnTmp, INDEX_BODY, CBOR_CONTEXT_PARAM_COMMA nullptr), COSE_ERR_CBOR); cnTmp = nullptr; EVP_CIPHER_CTX_free(ctx); return true; errorReturn: if (pbIV != nullptr) { COSE_FREE(pbIV, context); } if (cbor_iv_t != nullptr) { COSE_FREE(cbor_iv_t, context); } if (rgbOut != nullptr) { COSE_FREE(rgbOut, context); } if (cnTmp != nullptr) { COSE_FREE(cnTmp, context); } EVP_CIPHER_CTX_free(ctx); return false; } bool AES_GCM_Decrypt(COSE_Enveloped *pcose, const byte *pbKey, size_t cbKey, const byte *pbCrypto, size_t cbCrypto, const byte *pbAuthData, size_t cbAuthData, cose_errback *perr) { EVP_CIPHER_CTX *ctx; int cbOut; byte *rgbOut = nullptr; int outl = 0; byte rgbIV[15] = {0}; const cn_cbor *pIV = nullptr; const EVP_CIPHER *cipher; #ifdef USE_CBOR_CONTEXT cn_cbor_context *context = &pcose->m_message.m_allocContext; #endif int TSize = 128 / 8; ctx = EVP_CIPHER_CTX_new(); CHECK_CONDITION(nullptr != ctx, COSE_ERR_OUT_OF_MEMORY); // Setup the IV/Nonce and put it into the message pIV = _COSE_map_get_int( &pcose->m_message, COSE_Header_IV, COSE_BOTH, nullptr); if ((pIV == nullptr) || (pIV->type != CN_CBOR_BYTES)) { if (perr != nullptr) { perr->err = COSE_ERR_INVALID_PARAMETER; } errorReturn: if (rgbOut != nullptr) { COSE_FREE(rgbOut, context); } EVP_CIPHER_CTX_free(ctx); return false; } CHECK_CONDITION(pIV->length == 96 / 8, COSE_ERR_INVALID_PARAMETER); memcpy(rgbIV, pIV->v.str, pIV->length); // Setup and run the OpenSSL code switch (cbKey) { case 128 / 8: cipher = EVP_aes_128_gcm(); break; case 192 / 8: cipher = EVP_aes_192_gcm(); break; case 256 / 8: cipher = EVP_aes_256_gcm(); break; default: FAIL_CONDITION(COSE_ERR_INVALID_PARAMETER); break; } // Do the setup for OpenSSL CHECK_CONDITION(EVP_DecryptInit_ex(ctx, cipher, nullptr, nullptr, nullptr), COSE_ERR_DECRYPT_FAILED); CHECK_CONDITION(EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_CCM_SET_TAG, TSize, (void *)&pbCrypto[cbCrypto - TSize]), COSE_ERR_DECRYPT_FAILED); CHECK_CONDITION(EVP_DecryptInit_ex(ctx, 0, nullptr, pbKey, rgbIV), COSE_ERR_DECRYPT_FAILED); // Pus in the AAD CHECK_CONDITION( EVP_DecryptUpdate(ctx, nullptr, &outl, pbAuthData, (int)cbAuthData), COSE_ERR_DECRYPT_FAILED); // cbOut = (int)cbCrypto - TSize; rgbOut = (byte *)COSE_CALLOC(cbOut, 1, context); CHECK_CONDITION(rgbOut != nullptr, COSE_ERR_OUT_OF_MEMORY); // Process content CHECK_CONDITION( EVP_DecryptUpdate(ctx, rgbOut, &cbOut, pbCrypto, (int)cbCrypto - TSize), COSE_ERR_DECRYPT_FAILED); // Process Tag CHECK_CONDITION(EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_SET_TAG, TSize, (byte *)pbCrypto + cbCrypto - TSize), COSE_ERR_DECRYPT_FAILED); // Check the result CHECK_CONDITION( EVP_DecryptFinal(ctx, rgbOut + cbOut, &cbOut), COSE_ERR_DECRYPT_FAILED); EVP_CIPHER_CTX_free(ctx); pcose->pbContent = rgbOut; pcose->cbContent = cbOut; return true; } bool AES_GCM_Encrypt(COSE_Enveloped *pcose, const byte *pbKey, size_t cbKey, const byte *pbAuthData, size_t cbAuthData, cose_errback *perr) { EVP_CIPHER_CTX *ctx; int cbOut; byte *rgbOut = nullptr; int outl = 0; byte rgbIV[16] = {0}; byte *pbIV = nullptr; const cn_cbor *cbor_iv = nullptr; cn_cbor *cbor_iv_t = nullptr; const EVP_CIPHER *cipher; #ifdef USE_CBOR_CONTEXT cn_cbor_context *context = &pcose->m_message.m_allocContext; #endif cn_cbor_errback cbor_error; if (false) { errorReturn: if (pbIV != nullptr) { COSE_FREE(pbIV, context); } if (cbor_iv_t != nullptr) { CN_CBOR_FREE(cbor_iv_t, context); } if (rgbOut != nullptr) { COSE_FREE(rgbOut, context); } EVP_CIPHER_CTX_free(ctx); return false; } // Make it first so we can clean it up ctx = EVP_CIPHER_CTX_new(); CHECK_CONDITION(nullptr != ctx, COSE_ERR_OUT_OF_MEMORY); // Setup the IV/Nonce and put it into the message cbor_iv = _COSE_map_get_int(&pcose->m_message, COSE_Header_IV, COSE_BOTH, perr); if (cbor_iv == nullptr) { pbIV = (byte *)COSE_CALLOC(96, 1, context); CHECK_CONDITION(pbIV != nullptr, COSE_ERR_OUT_OF_MEMORY); rand_bytes(pbIV, 96 / 8); memcpy(rgbIV, pbIV, 96 / 8); cbor_iv_t = cn_cbor_data_create2( pbIV, 96 / 8, 0, CBOR_CONTEXT_PARAM_COMMA & cbor_error); CHECK_CONDITION_CBOR(cbor_iv_t != nullptr, cbor_error); pbIV = nullptr; if (!_COSE_map_put(&pcose->m_message, COSE_Header_IV, cbor_iv_t, COSE_UNPROTECT_ONLY, perr)) { goto errorReturn; } cbor_iv_t = nullptr; } else { CHECK_CONDITION( cbor_iv->type == CN_CBOR_BYTES, COSE_ERR_INVALID_PARAMETER); CHECK_CONDITION(cbor_iv->length == 96 / 8, COSE_ERR_INVALID_PARAMETER); memcpy(rgbIV, cbor_iv->v.str, cbor_iv->length); } switch (cbKey * 8) { case 128: cipher = EVP_aes_128_gcm(); break; case 192: cipher = EVP_aes_192_gcm(); break; case 256: cipher = EVP_aes_256_gcm(); break; default: FAIL_CONDITION(COSE_ERR_INVALID_PARAMETER); break; } // Setup and run the OpenSSL code CHECK_CONDITION(EVP_EncryptInit_ex(ctx, cipher, nullptr, nullptr, nullptr), COSE_ERR_CRYPTO_FAIL); CHECK_CONDITION(EVP_EncryptInit_ex(ctx, 0, nullptr, pbKey, rgbIV), COSE_ERR_CRYPTO_FAIL); CHECK_CONDITION( EVP_EncryptUpdate(ctx, nullptr, &outl, pbAuthData, (int)cbAuthData), COSE_ERR_CRYPTO_FAIL); rgbOut = (byte *)COSE_CALLOC(pcose->cbContent + 128 / 8, 1, context); CHECK_CONDITION(rgbOut != nullptr, COSE_ERR_OUT_OF_MEMORY); CHECK_CONDITION(EVP_EncryptUpdate(ctx, rgbOut, &cbOut, pcose->pbContent, (int)pcose->cbContent), COSE_ERR_CRYPTO_FAIL); CHECK_CONDITION( EVP_EncryptFinal_ex(ctx, &rgbOut[cbOut], &cbOut), COSE_ERR_CRYPTO_FAIL); CHECK_CONDITION(EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_GET_TAG, 128 / 8, &rgbOut[pcose->cbContent]), COSE_ERR_CRYPTO_FAIL); cn_cbor *cnTmp = cn_cbor_data_create2(rgbOut, (int)pcose->cbContent + 128 / 8, 0, CBOR_CONTEXT_PARAM_COMMA nullptr); CHECK_CONDITION(cnTmp != nullptr, COSE_ERR_CBOR); rgbOut = nullptr; CHECK_CONDITION(_COSE_array_replace(&pcose->m_message, cnTmp, INDEX_BODY, CBOR_CONTEXT_PARAM_COMMA nullptr), COSE_ERR_CBOR); EVP_CIPHER_CTX_free(ctx); if (pbIV != nullptr) { COSE_FREE(pbIV, context); } return true; } bool AES_CBC_MAC_Create(COSE_MacMessage *pcose, int TSize, const byte *pbKey, size_t cbKey, const byte *pbAuthData, size_t cbAuthData, cose_errback *perr) { const EVP_CIPHER *pcipher = nullptr; EVP_CIPHER_CTX *ctx; int cbOut; byte rgbIV[16] = {0}; byte *rgbOut = nullptr; bool f = false; unsigned int i; cn_cbor *cn = nullptr; #ifdef USE_CBOR_CONTEXT cn_cbor_context *context = &pcose->m_message.m_allocContext; #endif ctx = EVP_CIPHER_CTX_new(); CHECK_CONDITION(nullptr != ctx, COSE_ERR_OUT_OF_MEMORY); rgbOut = (byte *)COSE_CALLOC(16, 1, context); CHECK_CONDITION(rgbOut != nullptr, COSE_ERR_OUT_OF_MEMORY); switch (cbKey * 8) { case 128: pcipher = EVP_aes_128_cbc(); break; case 256: pcipher = EVP_aes_256_cbc(); break; default: FAIL_CONDITION(COSE_ERR_INVALID_PARAMETER); } // Setup and run the OpenSSL code CHECK_CONDITION(EVP_EncryptInit_ex(ctx, pcipher, nullptr, pbKey, rgbIV), COSE_ERR_CRYPTO_FAIL); for (i = 0; i < (unsigned int)cbAuthData / 16; i++) { CHECK_CONDITION( EVP_EncryptUpdate(ctx, rgbOut, &cbOut, pbAuthData + (i * 16), 16), COSE_ERR_CRYPTO_FAIL); } if (cbAuthData % 16 != 0) { CHECK_CONDITION(EVP_EncryptUpdate(ctx, rgbOut, &cbOut, pbAuthData + (i * 16), cbAuthData % 16), COSE_ERR_CRYPTO_FAIL); CHECK_CONDITION(EVP_EncryptUpdate( ctx, rgbOut, &cbOut, rgbIV, 16 - (cbAuthData % 16)), COSE_ERR_CRYPTO_FAIL); } cn = cn_cbor_data_create2( rgbOut, TSize / 8, 0, CBOR_CONTEXT_PARAM_COMMA nullptr); CHECK_CONDITION(cn != nullptr, COSE_ERR_OUT_OF_MEMORY); rgbOut = nullptr; CHECK_CONDITION(_COSE_array_replace(&pcose->m_message, cn, INDEX_MAC_TAG, CBOR_CONTEXT_PARAM_COMMA nullptr), COSE_ERR_CBOR); cn = nullptr; EVP_CIPHER_CTX_free(ctx); return !f; errorReturn: if (rgbOut != nullptr) { COSE_FREE(rgbOut, context); } if (cn != nullptr) { CN_CBOR_FREE(cn, context); } EVP_CIPHER_CTX_free(ctx); return false; } bool AES_CBC_MAC_Validate(COSE_MacMessage *pcose, int TSize, const byte *pbKey, size_t cbKey, const byte *pbAuthData, size_t cbAuthData, cose_errback *perr) { const EVP_CIPHER *pcipher = nullptr; EVP_CIPHER_CTX *ctx = nullptr; int cbOut; byte rgbIV[16] = {0}; byte rgbTag[16] = {0}; bool f = false; unsigned int i; if (false) { errorReturn: EVP_CIPHER_CTX_free(ctx); return false; } switch (cbKey * 8) { case 128: pcipher = EVP_aes_128_cbc(); break; case 256: pcipher = EVP_aes_256_cbc(); break; default: FAIL_CONDITION(COSE_ERR_INVALID_PARAMETER); } // Setup and run the OpenSSL code ctx = EVP_CIPHER_CTX_new(); CHECK_CONDITION(nullptr != ctx, COSE_ERR_OUT_OF_MEMORY); CHECK_CONDITION(EVP_EncryptInit_ex(ctx, pcipher, nullptr, pbKey, rgbIV), COSE_ERR_CRYPTO_FAIL); TSize /= 8; for (i = 0; i < (unsigned int)cbAuthData / 16; i++) { CHECK_CONDITION( EVP_EncryptUpdate(ctx, rgbTag, &cbOut, pbAuthData + (i * 16), 16), COSE_ERR_CRYPTO_FAIL); } if (cbAuthData % 16 != 0) { CHECK_CONDITION(EVP_EncryptUpdate(ctx, rgbTag, &cbOut, pbAuthData + (i * 16), cbAuthData % 16), COSE_ERR_CRYPTO_FAIL); CHECK_CONDITION(EVP_EncryptUpdate( ctx, rgbTag, &cbOut, rgbIV, 16 - (cbAuthData % 16)), COSE_ERR_CRYPTO_FAIL); } cn_cbor *cn = _COSE_arrayget_int(&pcose->m_message, INDEX_MAC_TAG); CHECK_CONDITION(cn != nullptr, COSE_ERR_CBOR); for (i = 0; i < (unsigned int)TSize; i++) { f |= (cn->v.bytes[i] != rgbTag[i]); } EVP_CIPHER_CTX_free(ctx); return !f; } #if 0 // We are doing CBC-MAC not CMAC at this time bool AES_CMAC_Validate(COSE_MacMessage * pcose, int KeySize, int TagSize, const byte * pbAuthData, int cbAuthData, cose_errback * perr) { CMAC_CTX * pctx = nullptr; const EVP_CIPHER * pcipher = nullptr; byte * rgbOut = nullptr; size_t cbOut; bool f = false; unsigned int i; #ifdef USE_CBOR_CONTEXT cn_cbor_context * context = &pcose->m_message.m_allocContext; #endif pctx = CMAC_CTX_new(); switch (KeySize) { case 128: pcipher = EVP_aes_128_cbc(); break; case 256: pcipher = EVP_aes_256_cbc(); break; default: FAIL_CONDITION(COSE_ERR_INVALID_PARAMETER); break; } rgbOut = COSE_CALLOC(128/8, 1, context); CHECK_CONDITION(rgbOut != nullptr, COSE_ERR_OUT_OF_MEMORY); CHECK_CONDITION(CMAC_Init(pctx, pcose->pbKey, pcose->cbKey, pcipher, nullptr /*impl*/) == 1, COSE_ERR_CRYPTO_FAIL); CHECK_CONDITION(CMAC_Update(pctx, pbAuthData, cbAuthData), COSE_ERR_CRYPTO_FAIL); CHECK_CONDITION(CMAC_Final(pctx, rgbOut, &cbOut), COSE_ERR_CRYPTO_FAIL); cn_cbor * cn = _COSE_arrayget_int(&pcose->m_message, INDEX_MAC_TAG); CHECK_CONDITION(cn != nullptr, COSE_ERR_CBOR); for (i = 0; i < (unsigned int)TagSize / 8; i++) f |= (cn->v.bytes[i] != rgbOut[i]); COSE_FREE(rgbOut, context); CMAC_CTX_cleanup(pctx); CMAC_CTX_free(pctx); return !f; errorReturn: COSE_FREE(rgbOut, context); CMAC_CTX_cleanup(pctx); CMAC_CTX_free(pctx); return false; } #endif bool HKDF_AES_Expand(COSE *pcose, size_t cbitKey, const byte *pbPRK, size_t cbPRK, const byte *pbInfo, size_t cbInfo, byte *pbOutput, size_t cbOutput, cose_errback *perr) { const EVP_CIPHER *pcipher = nullptr; EVP_CIPHER_CTX *ctx; int cbOut; byte rgbIV[16] = {0}; byte bCount = 1; size_t ib; byte rgbDigest[128 / 8]; int cbDigest = 0; byte rgbOut[16]; UNUSED(pcose); ctx = EVP_CIPHER_CTX_new(); CHECK_CONDITION(nullptr != ctx, COSE_ERR_OUT_OF_MEMORY); switch (cbitKey) { case 128: pcipher = EVP_aes_128_cbc(); break; case 256: pcipher = EVP_aes_256_cbc(); break; default: FAIL_CONDITION(COSE_ERR_INVALID_PARAMETER); } CHECK_CONDITION(cbPRK == cbitKey / 8, COSE_ERR_INVALID_PARAMETER); // Setup and run the OpenSSL code for (ib = 0; ib < cbOutput; ib += 16, bCount += 1) { size_t ib2; CHECK_CONDITION(EVP_EncryptInit_ex(ctx, pcipher, nullptr, pbPRK, rgbIV), COSE_ERR_CRYPTO_FAIL); CHECK_CONDITION( EVP_EncryptUpdate(ctx, rgbOut, &cbOut, rgbDigest, cbDigest), COSE_ERR_CRYPTO_FAIL); for (ib2 = 0; ib2 < cbInfo; ib2 += 16) { CHECK_CONDITION(EVP_EncryptUpdate(ctx, rgbOut, &cbOut, pbInfo + ib2, (int)COSE_MIN(16, cbInfo - ib2)), COSE_ERR_CRYPTO_FAIL); } CHECK_CONDITION(EVP_EncryptUpdate(ctx, rgbOut, &cbOut, &bCount, 1), COSE_ERR_CRYPTO_FAIL); if ((cbInfo + 1) % 16 != 0) { CHECK_CONDITION(EVP_EncryptUpdate(ctx, rgbOut, &cbOut, rgbIV, (int)16 - (cbInfo + 1) % 16), COSE_ERR_CRYPTO_FAIL); } memcpy(rgbDigest, rgbOut, cbOut); cbDigest = cbOut; memcpy(pbOutput + ib, rgbDigest, COSE_MIN(16, cbOutput - ib)); } EVP_CIPHER_CTX_free(ctx); return true; errorReturn: EVP_CIPHER_CTX_free(ctx); return false; } bool HKDF_Extract(COSE *pcose, const byte *pbKey, size_t cbKey, size_t cbitDigest, byte *rgbDigest, size_t *pcbDigest, CBOR_CONTEXT_COMMA cose_errback *perr) { #ifdef USE_CBOR_CONTEXT UNUSED(context); #endif byte rgbSalt[EVP_MAX_MD_SIZE] = {0}; int cbSalt; cn_cbor *cnSalt; HMAC_CTX *ctx; const EVP_MD *pmd = nullptr; unsigned int cbDigest; ctx = HMAC_CTX_new(); CHECK_CONDITION(nullptr != ctx, COSE_ERR_OUT_OF_MEMORY); if (0) { errorReturn: HMAC_CTX_free(ctx); return false; } switch (cbitDigest) { case 256: pmd = EVP_sha256(); cbSalt = 256 / 8; break; case 384: pmd = EVP_sha384(); cbSalt = 384 / 8; break; case 512: pmd = EVP_sha512(); cbSalt = 512 / 8; break; default: FAIL_CONDITION(COSE_ERR_INVALID_PARAMETER); break; } cnSalt = _COSE_map_get_int(pcose, COSE_Header_HKDF_salt, COSE_BOTH, perr); if (cnSalt != nullptr) { CHECK_CONDITION(HMAC_Init_ex(ctx, cnSalt->v.bytes, (int)cnSalt->length, pmd, nullptr), COSE_ERR_CRYPTO_FAIL); } else { CHECK_CONDITION(HMAC_Init_ex(ctx, rgbSalt, cbSalt, pmd, nullptr), COSE_ERR_CRYPTO_FAIL); } CHECK_CONDITION(HMAC_Update(ctx, pbKey, (int)cbKey), COSE_ERR_CRYPTO_FAIL); CHECK_CONDITION( HMAC_Final(ctx, rgbDigest, &cbDigest), COSE_ERR_CRYPTO_FAIL); *pcbDigest = cbDigest; HMAC_CTX_free(ctx); return true; } bool HKDF_Expand(COSE *pcose, size_t cbitDigest, const byte *pbPRK, size_t cbPRK, const byte *pbInfo, size_t cbInfo, byte *pbOutput, size_t cbOutput, cose_errback *perr) { HMAC_CTX *ctx; const EVP_MD *pmd = nullptr; size_t ib; unsigned int cbDigest = 0; byte rgbDigest[EVP_MAX_MD_SIZE]; byte bCount = 1; UNUSED(pcose); ctx = HMAC_CTX_new(); CHECK_CONDITION(ctx != nullptr, COSE_ERR_OUT_OF_MEMORY); if (0) { errorReturn: HMAC_CTX_free(ctx); return false; } switch (cbitDigest) { case 256: pmd = EVP_sha256(); break; case 384: pmd = EVP_sha384(); break; case 512: pmd = EVP_sha512(); break; default: FAIL_CONDITION(COSE_ERR_INVALID_PARAMETER); break; } for (ib = 0; ib < cbOutput; ib += cbDigest, bCount += 1) { CHECK_CONDITION(HMAC_Init_ex(ctx, pbPRK, (int)cbPRK, pmd, nullptr), COSE_ERR_CRYPTO_FAIL); CHECK_CONDITION( HMAC_Update(ctx, rgbDigest, cbDigest), COSE_ERR_CRYPTO_FAIL); CHECK_CONDITION(HMAC_Update(ctx, pbInfo, cbInfo), COSE_ERR_CRYPTO_FAIL); CHECK_CONDITION(HMAC_Update(ctx, &bCount, 1), COSE_ERR_CRYPTO_FAIL); CHECK_CONDITION( HMAC_Final(ctx, rgbDigest, &cbDigest), COSE_ERR_CRYPTO_FAIL); memcpy(pbOutput + ib, rgbDigest, COSE_MIN(cbDigest, cbOutput - ib)); } HMAC_CTX_free(ctx); return true; } bool HMAC_Create(COSE_MacMessage *pcose, int HSize, int TSize, const byte *pbKey, size_t cbKey, const byte *pbAuthData, size_t cbAuthData, cose_errback *perr) { HMAC_CTX *ctx; const EVP_MD *pmd = nullptr; byte *rgbOut = nullptr; unsigned int cbOut; cn_cbor *cbor = nullptr; #ifdef USE_CBOR_CONTEXT cn_cbor_context *context = &pcose->m_message.m_allocContext; #endif ctx = HMAC_CTX_new(); CHECK_CONDITION(nullptr != ctx, COSE_ERR_OUT_OF_MEMORY); if (0) { errorReturn: COSE_FREE(rgbOut, context); if (cbor != nullptr) { COSE_FREE(cbor, context); } HMAC_CTX_free(ctx); return false; } switch (HSize) { case 256: pmd = EVP_sha256(); break; case 384: pmd = EVP_sha384(); break; case 512: pmd = EVP_sha512(); break; default: FAIL_CONDITION(COSE_ERR_INVALID_PARAMETER); break; } rgbOut = (byte *)COSE_CALLOC(EVP_MAX_MD_SIZE, 1, context); CHECK_CONDITION(rgbOut != nullptr, COSE_ERR_OUT_OF_MEMORY); CHECK_CONDITION(HMAC_Init_ex(ctx, pbKey, (int)cbKey, pmd, nullptr), COSE_ERR_CRYPTO_FAIL); CHECK_CONDITION( HMAC_Update(ctx, pbAuthData, cbAuthData), COSE_ERR_CRYPTO_FAIL); CHECK_CONDITION(HMAC_Final(ctx, rgbOut, &cbOut), COSE_ERR_CRYPTO_FAIL); cbor = cn_cbor_data_create2( rgbOut, TSize / 8, 0, CBOR_CONTEXT_PARAM_COMMA nullptr); CHECK_CONDITION(cbor != nullptr, COSE_ERR_OUT_OF_MEMORY); CHECK_CONDITION(_COSE_array_replace(&pcose->m_message, cbor, INDEX_MAC_TAG, CBOR_CONTEXT_PARAM_COMMA nullptr), COSE_ERR_CBOR); HMAC_CTX_free(ctx); return true; } bool HMAC_Validate(COSE_MacMessage *pcose, int HSize, int TSize, const byte *pbKey, size_t cbKey, const byte *pbAuthData, size_t cbAuthData, cose_errback *perr) { HMAC_CTX *ctx = nullptr; const EVP_MD *pmd = nullptr; byte *rgbOut = nullptr; unsigned int cbOut = 0; bool f = false; #ifdef USE_CBOR_CONTEXT cn_cbor_context *context = &pcose->m_message.m_allocContext; #endif if (false) { errorReturn: if (rgbOut != nullptr) { COSE_FREE(rgbOut, context); } HMAC_CTX_free(ctx); return false; } ctx = HMAC_CTX_new(); CHECK_CONDITION(ctx != nullptr, COSE_ERR_OUT_OF_MEMORY); switch (HSize) { case 256: pmd = EVP_sha256(); break; case 384: pmd = EVP_sha384(); break; case 512: pmd = EVP_sha512(); break; default: FAIL_CONDITION(COSE_ERR_INVALID_PARAMETER); break; } rgbOut = (byte *)COSE_CALLOC(EVP_MAX_MD_SIZE, 1, context); CHECK_CONDITION(rgbOut != nullptr, COSE_ERR_OUT_OF_MEMORY); CHECK_CONDITION(HMAC_Init_ex(ctx, pbKey, (int)cbKey, pmd, nullptr), COSE_ERR_CRYPTO_FAIL); CHECK_CONDITION( HMAC_Update(ctx, pbAuthData, cbAuthData), COSE_ERR_CRYPTO_FAIL); CHECK_CONDITION(HMAC_Final(ctx, rgbOut, &cbOut), COSE_ERR_CRYPTO_FAIL); cn_cbor *cn = _COSE_arrayget_int(&pcose->m_message, INDEX_MAC_TAG); CHECK_CONDITION(cn != nullptr, COSE_ERR_CBOR); if (cn->length > cbOut) { f = false; } else { for (unsigned int i = 0; i < (unsigned int)TSize / 8; i++) { f |= (cn->v.bytes[i] != rgbOut[i]); } } COSE_FREE(rgbOut, context); HMAC_CTX_free(ctx); return !f; } #define COSE_Key_EC_Curve -1 #define COSE_Key_EC_X -2 #define COSE_Key_EC_Y -3 #define COSE_Key_EC_d -4 EVP_PKEY *EVP_FromKey(COSE_KEY *pKey, CBOR_CONTEXT_COMMA cose_errback *perr) { if (pKey->m_opensslKey != nullptr) { return pKey->m_opensslKey; } if (false) { errorReturn: return nullptr; } cn_cbor *keyType = cn_cbor_mapget_int(pKey->m_cborKey, COSE_Key_Type); CHECK_CONDITION(keyType != NULL && keyType->type == CN_CBOR_UINT, COSE_ERR_INVALID_PARAMETER); switch (keyType->v.uint) { case COSE_Key_Type_EC2: { int cbSize; Safe_EC_KEY ecKey = ECKey_From(pKey, &cbSize, perr); CHECK_CONDITION(ecKey != nullptr, perr->err); Safe_EVP_PKEY evpKey = EVP_PKEY_new(); CHECK_CONDITION(evpKey != nullptr, COSE_ERR_OUT_OF_MEMORY); CHECK_CONDITION( EVP_PKEY_set1_EC_KEY(evpKey, ecKey) == 1, COSE_ERR_CRYPTO_FAIL); pKey->m_opensslKey = evpKey; EVP_PKEY_up_ref(pKey->m_opensslKey); return evpKey.Release(); } case COSE_Key_Type_OKP: { int type; cn_cbor *p = cn_cbor_mapget_int(pKey->m_cborKey, COSE_Key_OPK_Curve); CHECK_CONDITION(p != nullptr, COSE_ERR_INVALID_PARAMETER); switch (p->v.uint) { case COSE_Curve_Ed25519: type = EVP_PKEY_ED25519; break; case COSE_Curve_Ed448: type = EVP_PKEY_ED448; break; case COSE_Curve_X25519: type = EVP_PKEY_X25519; break; case COSE_Curve_X448: type = EVP_PKEY_X448; break; default: FAIL_CONDITION(COSE_ERR_INVALID_PARAMETER); } Safe_EVP_PKEY evpKey; p = cn_cbor_mapget_int(pKey->m_cborKey, COSE_Key_EC_d); if (p != nullptr) { evpKey = EVP_PKEY_new_raw_private_key( type, nullptr, p->v.bytes, p->length); CHECK_CONDITION(evpKey != nullptr, COSE_ERR_CRYPTO_FAIL); } else { p = cn_cbor_mapget_int(pKey->m_cborKey, COSE_Key_OPK_X); CHECK_CONDITION(p != nullptr, COSE_ERR_INVALID_PARAMETER); evpKey = EVP_PKEY_new_raw_public_key( type, nullptr, p->v.bytes, p->length); } pKey->m_opensslKey = evpKey; EVP_PKEY_up_ref(pKey->m_opensslKey); return evpKey.Release(); } default: FAIL_CONDITION(COSE_ERR_INVALID_PARAMETER); } } EC_KEY *ECKey_From(COSE_KEY *pKey, int *cbGroup, cose_errback *perr) { if (false) { errorReturn: return nullptr; } if (pKey->m_opensslKey != nullptr) { Safe_EC_KEY pKeyNew = EVP_PKEY_get1_EC_KEY(pKey->m_opensslKey); CHECK_CONDITION(pKeyNew != nullptr, COSE_ERR_INVALID_PARAMETER); int gid = EC_GROUP_get_curve_name(EC_KEY_get0_group(pKeyNew)); switch (gid) { case NID_X9_62_prime256v1: *cbGroup = 256 / 8; break; case NID_secp384r1: *cbGroup = 384 / 8; break; case NID_secp521r1: *cbGroup = (521 + 7) / 8; break; default: FAIL_CONDITION(COSE_ERR_INVALID_PARAMETER); } return pKeyNew.Release(); } byte rgbKey[512 + 1]; int cbKey; const cn_cbor *p; int nidGroup = -1; EC_POINT *pPoint = nullptr; Safe_EC_KEY pNewKey = EC_KEY_new(); CHECK_CONDITION(pNewKey != nullptr, COSE_ERR_OUT_OF_MEMORY); p = cn_cbor_mapget_int(pKey->m_cborKey, COSE_Key_EC_Curve); CHECK_CONDITION(p != nullptr, COSE_ERR_INVALID_PARAMETER); switch (p->v.sint) { case 1: // P-256 nidGroup = NID_X9_62_prime256v1; *cbGroup = 256 / 8; break; case 2: // P-384 nidGroup = NID_secp384r1; *cbGroup = 384 / 8; break; case 3: // P-521 nidGroup = NID_secp521r1; *cbGroup = (521 + 7) / 8; break; default: FAIL_CONDITION(COSE_ERR_INVALID_PARAMETER); } EC_GROUP *ecgroup = EC_GROUP_new_by_curve_name(nidGroup); CHECK_CONDITION(ecgroup != nullptr, COSE_ERR_INVALID_PARAMETER); CHECK_CONDITION( EC_KEY_set_group(pNewKey, ecgroup) == 1, COSE_ERR_CRYPTO_FAIL); p = cn_cbor_mapget_int(pKey->m_cborKey, COSE_Key_EC_X); CHECK_CONDITION((p != nullptr) && (p->type == CN_CBOR_BYTES), COSE_ERR_INVALID_PARAMETER); CHECK_CONDITION(p->length == (size_t)*cbGroup, COSE_ERR_INVALID_PARAMETER); memcpy(rgbKey + 1, p->v.str, p->length); p = cn_cbor_mapget_int(pKey->m_cborKey, COSE_Key_EC_Y); CHECK_CONDITION(p != nullptr, COSE_ERR_INVALID_PARAMETER); if (p->type == CN_CBOR_BYTES) { rgbKey[0] = POINT_CONVERSION_UNCOMPRESSED; cbKey = (*cbGroup * 2) + 1; CHECK_CONDITION( p->length == (size_t)*cbGroup, COSE_ERR_INVALID_PARAMETER); memcpy(rgbKey + p->length + 1, p->v.str, p->length); } else if (p->type == CN_CBOR_TRUE) { cbKey = (*cbGroup) + 1; rgbKey[0] = POINT_CONVERSION_COMPRESSED + 1; } else if (p->type == CN_CBOR_FALSE) { cbKey = (*cbGroup) + 1; rgbKey[0] = POINT_CONVERSION_COMPRESSED; } else { FAIL_CONDITION(COSE_ERR_INVALID_PARAMETER); } pPoint = EC_POINT_new(ecgroup); CHECK_CONDITION(pPoint != nullptr, COSE_ERR_CRYPTO_FAIL); CHECK_CONDITION( EC_POINT_oct2point(ecgroup, pPoint, rgbKey, cbKey, nullptr) == 1, COSE_ERR_CRYPTO_FAIL); CHECK_CONDITION( EC_KEY_set_public_key(pNewKey, pPoint) == 1, COSE_ERR_CRYPTO_FAIL); p = cn_cbor_mapget_int(pKey->m_cborKey, COSE_Key_EC_d); if (p != nullptr) { BIGNUM *pbn = BN_bin2bn(p->v.bytes, (int)p->length, nullptr); CHECK_CONDITION(pbn != nullptr, COSE_ERR_CRYPTO_FAIL); CHECK_CONDITION( EC_KEY_set_private_key(pNewKey, pbn) == 1, COSE_ERR_CRYPTO_FAIL); } pKey->m_opensslKey = EVP_PKEY_new(); CHECK_CONDITION(pKey->m_opensslKey != nullptr, COSE_ERR_OUT_OF_MEMORY); CHECK_CONDITION(EVP_PKEY_set1_EC_KEY(pKey->m_opensslKey, pNewKey) == 1, COSE_ERR_CRYPTO_FAIL); return pNewKey.Release(); } cn_cbor *EC_ToCBOR(const EC_KEY *pKey, bool fUseCompressed, CBOR_CONTEXT_COMMA cose_errback *perr) { cn_cbor *pkey = nullptr; int cose_group; cn_cbor *p = nullptr; cn_cbor_errback cbor_error; byte *pbPoint = nullptr; size_t cbSize; byte *pbOut = nullptr; size_t cbX; const EC_POINT *pPoint = nullptr; const EC_GROUP *pgroup = EC_KEY_get0_group(pKey); CHECK_CONDITION(pgroup != nullptr, COSE_ERR_INVALID_PARAMETER); switch (EC_GROUP_get_curve_name(pgroup)) { case NID_X9_62_prime256v1: cose_group = 1; break; case NID_secp384r1: cose_group = 2; break; case NID_secp521r1: cose_group = 3; break; default: FAIL_CONDITION(COSE_ERR_INVALID_PARAMETER); } pkey = cn_cbor_map_create(CBOR_CONTEXT_PARAM_COMMA & cbor_error); CHECK_CONDITION_CBOR(pkey != nullptr, cbor_error); p = cn_cbor_int_create(cose_group, CBOR_CONTEXT_PARAM_COMMA & cbor_error); CHECK_CONDITION_CBOR(p != nullptr, cbor_error); CHECK_CONDITION_CBOR(cn_cbor_mapput_int(pkey, COSE_Key_EC_Curve, p, CBOR_CONTEXT_PARAM_COMMA & cbor_error), cbor_error); p = nullptr; pPoint = EC_KEY_get0_public_key(pKey); CHECK_CONDITION(pPoint != nullptr, COSE_ERR_INVALID_PARAMETER); if (fUseCompressed) { cbSize = EC_POINT_point2oct( pgroup, pPoint, POINT_CONVERSION_COMPRESSED, nullptr, 0, nullptr); CHECK_CONDITION(cbSize > 0, COSE_ERR_CRYPTO_FAIL); pbPoint = (byte *)COSE_CALLOC(cbSize, 1, context); CHECK_CONDITION(pbPoint != nullptr, COSE_ERR_OUT_OF_MEMORY); CHECK_CONDITION( EC_POINT_point2oct(pgroup, pPoint, POINT_CONVERSION_COMPRESSED, pbPoint, cbSize, nullptr) == cbSize, COSE_ERR_CRYPTO_FAIL); cbX = cbSize - 1; } else { cbSize = EC_POINT_point2oct( pgroup, pPoint, POINT_CONVERSION_UNCOMPRESSED, nullptr, 0, nullptr); CHECK_CONDITION(cbSize > 0, COSE_ERR_CRYPTO_FAIL); pbPoint = (byte *)COSE_CALLOC(cbSize, 1, context); CHECK_CONDITION(pbPoint != nullptr, COSE_ERR_OUT_OF_MEMORY); CHECK_CONDITION( EC_POINT_point2oct(pgroup, pPoint, POINT_CONVERSION_UNCOMPRESSED, pbPoint, cbSize, nullptr) == cbSize, COSE_ERR_CRYPTO_FAIL); cbX = cbSize / 2; } pbOut = (byte *)COSE_CALLOC((int)(cbX), 1, context); CHECK_CONDITION(pbOut != nullptr, COSE_ERR_OUT_OF_MEMORY); memcpy(pbOut, pbPoint + 1, (int)(cbX)); p = cn_cbor_data_create2( pbOut, (int)(cbX), 0, CBOR_CONTEXT_PARAM_COMMA & cbor_error); CHECK_CONDITION_CBOR(p != nullptr, cbor_error); pbOut = nullptr; CHECK_CONDITION_CBOR(cn_cbor_mapput_int(pkey, COSE_Key_EC_X, p, CBOR_CONTEXT_PARAM_COMMA & cbor_error), cbor_error); p = nullptr; if (fUseCompressed) { p = cn_cbor_bool_create( pbPoint[0] & 1, CBOR_CONTEXT_PARAM_COMMA & cbor_error); CHECK_CONDITION_CBOR(p != nullptr, cbor_error); CHECK_CONDITION_CBOR(cn_cbor_mapput_int(pkey, COSE_Key_EC_Y, p, CBOR_CONTEXT_PARAM_COMMA & cbor_error), cbor_error); p = nullptr; } else { pbOut = (byte *)COSE_CALLOC((int)(cbX), 1, context); CHECK_CONDITION(pbOut != nullptr, COSE_ERR_OUT_OF_MEMORY); memcpy(pbOut, pbPoint + cbSize / 2 + 1, (int)(cbX)); p = cn_cbor_data_create2( pbOut, (int)(cbX), 0, CBOR_CONTEXT_PARAM_COMMA & cbor_error); CHECK_CONDITION_CBOR(p != nullptr, cbor_error); pbOut = nullptr; CHECK_CONDITION_CBOR(cn_cbor_mapput_int(pkey, COSE_Key_EC_Y, p, CBOR_CONTEXT_PARAM_COMMA & cbor_error), cbor_error); p = nullptr; } p = cn_cbor_int_create( COSE_Key_Type_EC2, CBOR_CONTEXT_PARAM_COMMA & cbor_error); CHECK_CONDITION_CBOR(p != nullptr, cbor_error); CHECK_CONDITION_CBOR(cn_cbor_mapput_int(pkey, COSE_Key_Type, p, CBOR_CONTEXT_PARAM_COMMA & cbor_error), cbor_error); p = nullptr; returnHere: if (pbPoint != nullptr) { COSE_FREE(pbPoint, context); } if (pbOut != nullptr) { COSE_FREE(pbOut, context); } if (p != nullptr) { CN_CBOR_FREE(p, context); } return pkey; errorReturn: CN_CBOR_FREE(pkey, context); pkey = nullptr; goto returnHere; } cn_cbor *EVP_ToCBOR(EVP_PKEY *pKey, bool fCompressPoints, CBOR_CONTEXT_COMMA cose_errback *perr) { cn_cbor_errback cborErr; int type = EVP_PKEY_base_id(pKey); switch (type) { case EVP_PKEY_EC: return EC_ToCBOR(EVP_PKEY_get1_EC_KEY(pKey), fCompressPoints, CBOR_CONTEXT_PARAM_COMMA perr); case EVP_PKEY_X25519: case EVP_PKEY_X448: { cn_cbor *pkey = nullptr; cn_cbor *temp = nullptr; unsigned char *pbKey = nullptr; if (false) { errorReturn: if (pkey != nullptr) { CN_CBOR_FREE(pkey, context); } if (temp != nullptr) { CN_CBOR_FREE(temp, context); } if (pbKey != nullptr) { COSE_FREE(pbKey, context); } return nullptr; } pkey = cn_cbor_map_create(CBOR_CONTEXT_PARAM_COMMA & cborErr); CHECK_CONDITION_CBOR(pkey != nullptr, cborErr); temp = cn_cbor_int_create( COSE_Key_Type_OKP, CBOR_CONTEXT_PARAM_COMMA & cborErr); CHECK_CONDITION_CBOR(temp != nullptr, cborErr); CHECK_CONDITION_CBOR(cn_cbor_mapput_int(pkey, COSE_Key_Type, temp, CBOR_CONTEXT_PARAM_COMMA & cborErr), cborErr); temp = nullptr; temp = cn_cbor_int_create( type == EVP_PKEY_X25519 ? COSE_Curve_X25519 : COSE_Curve_X448, CBOR_CONTEXT_PARAM_COMMA & cborErr); CHECK_CONDITION_CBOR(temp != nullptr, cborErr); CHECK_CONDITION_CBOR(cn_cbor_mapput_int(pkey, COSE_Key_OPK_Curve, temp, CBOR_CONTEXT_PARAM_COMMA & cborErr), cborErr); temp = nullptr; size_t cbKey; CHECK_CONDITION( EVP_PKEY_get_raw_public_key(pKey, nullptr, &cbKey) == 1, COSE_ERR_CRYPTO_FAIL); pbKey = (unsigned char *)COSE_CALLOC(cbKey, 1, context); CHECK_CONDITION(pbKey != nullptr, COSE_ERR_OUT_OF_MEMORY); CHECK_CONDITION( EVP_PKEY_get_raw_public_key(pKey, pbKey, &cbKey) == 1, COSE_ERR_CRYPTO_FAIL); temp = cn_cbor_data_create2( pbKey, cbKey, 0, CBOR_CONTEXT_PARAM_COMMA & cborErr); CHECK_CONDITION(temp != nullptr, COSE_ERR_OUT_OF_MEMORY); pbKey = nullptr; CHECK_CONDITION_CBOR(cn_cbor_mapput_int(pkey, COSE_Key_OPK_X, temp, CBOR_CONTEXT_PARAM_COMMA & cborErr), cborErr); temp = nullptr; return pkey; } break; default: perr->err = COSE_ERR_INVALID_PARAMETER; return nullptr; } } #if false COSE_KEY *EC_FromKey(EC_KEY *pKey, bool fUseCompressed, CBOR_CONTEXT_COMMA cose_errback *perr) { COSE_KEY *coseKey = nullptr; cn_cbor *pkey = EC_ToCBOR(pKey, fUseCompressed, CBOR_CONTEXT_PARAM_COMMA perr); if (pkey == nullptr) { return nullptr; } Safe_EVP_PKEY evpKey = EVP_PKEY_new(); CHECK_CONDITION(evpKey != nullptr, COSE_ERR_OUT_OF_MEMORY); CHECK_CONDITION(EVP_PKEY_set1_EC_KEY(evpKey, pKey) == 1, COSE_ERR_CRYPTO_FAIL); coseKey = (COSE_KEY *)COSE_KEY_FromEVP(evpKey, pkey, CBOR_CONTEXT_PARAM_COMMA perr); CHECK_CONDITION(coseKey != nullptr, COSE_ERR_OUT_OF_MEMORY); pkey = nullptr; returnHere: if (pkey != nullptr) { CN_CBOR_FREE(pkey, context); } return coseKey; errorReturn: goto returnHere; } #endif bool ECDSA_Sign(COSE *pSigner, int index, COSE_KEY *pKey, int cbitDigest, const byte *rgbToSign, size_t cbToSign, cose_errback *perr) { EC_KEY *eckey = nullptr; byte rgbDigest[EVP_MAX_MD_SIZE]; unsigned int cbDigest = sizeof(rgbDigest); byte *pbSig = nullptr; const EVP_MD *digest; #ifdef USE_CBOR_CONTEXT cn_cbor_context *context = &pSigner->m_allocContext; #endif cn_cbor *p = nullptr; ECDSA_SIG *psig = nullptr; cn_cbor_errback cbor_error; int cbR; byte rgbSig[66]; int cb; eckey = ECKey_From(pKey, &cbR, perr); if (eckey == nullptr) { errorReturn: if (pbSig != nullptr) { COSE_FREE(pbSig, context); } if (p != nullptr) { CN_CBOR_FREE(p, context); } if (eckey != nullptr) { EC_KEY_free(eckey); } return false; } switch (cbitDigest) { case 256: digest = EVP_sha256(); break; case 512: digest = EVP_sha512(); break; case 384: digest = EVP_sha384(); break; default: FAIL_CONDITION(COSE_ERR_INVALID_PARAMETER); } EVP_Digest(rgbToSign, cbToSign, rgbDigest, &cbDigest, digest, nullptr); psig = ECDSA_do_sign(rgbDigest, cbDigest, eckey); CHECK_CONDITION(psig != nullptr, COSE_ERR_CRYPTO_FAIL); pbSig = (byte *)COSE_CALLOC(cbR, 2, context); CHECK_CONDITION(pbSig != nullptr, COSE_ERR_OUT_OF_MEMORY); const BIGNUM *r; const BIGNUM *s; ECDSA_SIG_get0(psig, &r, &s); cb = BN_bn2bin(r, rgbSig); CHECK_CONDITION(cb <= cbR, COSE_ERR_INVALID_PARAMETER); memcpy(pbSig + cbR - cb, rgbSig, cb); cb = BN_bn2bin(s, rgbSig); CHECK_CONDITION(cb <= cbR, COSE_ERR_INVALID_PARAMETER); memcpy(pbSig + 2 * cbR - cb, rgbSig, cb); p = cn_cbor_data_create2( pbSig, cbR * 2, 0, CBOR_CONTEXT_PARAM_COMMA & cbor_error); CHECK_CONDITION_CBOR(p != nullptr, cbor_error); CHECK_CONDITION(_COSE_array_replace( pSigner, p, index, CBOR_CONTEXT_PARAM_COMMA nullptr), COSE_ERR_CBOR); pbSig = nullptr; if (eckey != nullptr) { EC_KEY_free(eckey); } return true; } bool ECDSA_Verify(COSE *pSigner, int index, COSE_KEY *pKey, int cbitDigest, const byte *rgbToSign, size_t cbToSign, cose_errback *perr) { EC_KEY *eckey = nullptr; byte rgbDigest[EVP_MAX_MD_SIZE]; unsigned int cbDigest = sizeof(rgbDigest); const EVP_MD *digest; #ifdef USE_CBOR_CONTEXT cn_cbor_context *context = &pSigner->m_allocContext; #endif cn_cbor *p = nullptr; ECDSA_SIG *sig = nullptr; int cbR; cn_cbor *pSig; size_t cbSignature; BIGNUM *r, *s; eckey = ECKey_From(pKey, &cbR, perr); if (eckey == nullptr) { errorReturn: if (p != nullptr) { CN_CBOR_FREE(p, context); } if (eckey != nullptr) { EC_KEY_free(eckey); } if (sig != nullptr) { ECDSA_SIG_free(sig); } return false; } switch (cbitDigest) { case 256: digest = EVP_sha256(); break; case 512: digest = EVP_sha512(); break; case 384: digest = EVP_sha384(); break; default: FAIL_CONDITION(COSE_ERR_INVALID_PARAMETER); } EVP_Digest(rgbToSign, cbToSign, rgbDigest, &cbDigest, digest, nullptr); pSig = _COSE_arrayget_int(pSigner, index); CHECK_CONDITION(pSig != nullptr, COSE_ERR_INVALID_PARAMETER); cbSignature = pSig->length; CHECK_CONDITION(cbSignature / 2 == (size_t)cbR, COSE_ERR_INVALID_PARAMETER); r = BN_bin2bn(pSig->v.bytes, (int)cbSignature / 2, nullptr); CHECK_CONDITION(nullptr != r, COSE_ERR_OUT_OF_MEMORY); s = BN_bin2bn( pSig->v.bytes + cbSignature / 2, (int)cbSignature / 2, nullptr); CHECK_CONDITION(nullptr != s, COSE_ERR_OUT_OF_MEMORY); sig = ECDSA_SIG_new(); CHECK_CONDITION(sig != nullptr, COSE_ERR_OUT_OF_MEMORY); ECDSA_SIG_set0(sig, r, s); CHECK_CONDITION(ECDSA_do_verify(rgbDigest, cbDigest, sig, eckey) == 1, COSE_ERR_CRYPTO_FAIL); if (eckey != nullptr) { EC_KEY_free(eckey); } if (sig != nullptr) { ECDSA_SIG_free(sig); } return true; } #ifdef USE_EDDSA bool EdDSA_Sign(COSE *pSigner, int index, COSE_KEY *pKeyIn, const byte *rgbToSign, size_t cbToSign, cose_errback *perr) { #ifdef USE_CBOR_CONTEXT cn_cbor_context *context = &pSigner->m_allocContext; #endif cn_cbor *p; cn_cbor_errback cbor_error; EVP_PKEY_CTX *keyCtx = nullptr; EVP_MD_CTX *mdCtx = nullptr; Safe_EVP_PKEY pkey; byte *pbSig = nullptr; int cbSig; p = cn_cbor_mapget_int(pKeyIn->m_cborKey, COSE_Key_OPK_Curve); if (p == nullptr) { errorReturn: if (mdCtx != nullptr) { EVP_MD_CTX_free(mdCtx); } if (keyCtx != nullptr) { EVP_PKEY_CTX_free(keyCtx); } if (pbSig != nullptr) { COSE_FREE(pbSig, context); } return false; } int type; switch (p->v.uint) { case COSE_Curve_Ed25519: type = EVP_PKEY_ED25519; cbSig = 32 * 2; break; case COSE_Curve_Ed448: type = EVP_PKEY_ED448; cbSig = 64 * 2; break; default: FAIL_CONDITION(COSE_ERR_INVALID_PARAMETER); } pkey = EVP_FromKey(pKeyIn, CBOR_CONTEXT_PARAM_COMMA perr); if (pkey == nullptr) { goto errorReturn; } keyCtx = EVP_PKEY_CTX_new_id(type, nullptr); CHECK_CONDITION(keyCtx != nullptr, COSE_ERR_OUT_OF_MEMORY); mdCtx = EVP_MD_CTX_new(); CHECK_CONDITION(mdCtx != nullptr, COSE_ERR_OUT_OF_MEMORY); CHECK_CONDITION( EVP_DigestSignInit(mdCtx, &keyCtx, nullptr, nullptr, pkey) == 1, COSE_ERR_CRYPTO_FAIL); keyCtx = nullptr; pbSig = (byte *)COSE_CALLOC(cbSig, 1, context); CHECK_CONDITION(pbSig != nullptr, COSE_ERR_OUT_OF_MEMORY); size_t cb2 = cbSig; CHECK_CONDITION( EVP_DigestSign(mdCtx, pbSig, &cb2, rgbToSign, cbToSign) == 1, COSE_ERR_CRYPTO_FAIL); p = cn_cbor_data_create2( pbSig, (int)cb2, 0, CBOR_CONTEXT_PARAM_COMMA & cbor_error); CHECK_CONDITION(p != nullptr, COSE_ERR_OUT_OF_MEMORY); pbSig = nullptr; CHECK_CONDITION(_COSE_array_replace( pSigner, p, index, CBOR_CONTEXT_PARAM_COMMA nullptr), COSE_ERR_CBOR); if (mdCtx != nullptr) { EVP_MD_CTX_free(mdCtx); } if (keyCtx != nullptr) { EVP_PKEY_CTX_free(keyCtx); } if (pbSig != nullptr) { COSE_FREE(pbSig, context); } return true; } bool EdDSA_Verify(COSE *pSigner, int index, COSE_KEY *pKey, const byte *rgbToSign, size_t cbToSign, cose_errback *perr) { #ifdef USE_CBOR_CONTEXT cn_cbor_context *context = &pSigner->m_allocContext; #endif cn_cbor *pSig; Safe_EVP_PKEY pkey = nullptr; EVP_MD_CTX *pmdCtx = nullptr; cn_cbor *p = cn_cbor_mapget_int(pKey->m_cborKey, COSE_Key_OPK_Curve); if (p == nullptr) { errorReturn: if (pmdCtx != nullptr) { EVP_MD_CTX_free(pmdCtx); } return false; } int type; switch (p->v.uint) { case COSE_Curve_Ed25519: type = EVP_PKEY_ED25519; break; case COSE_Curve_Ed448: type = EVP_PKEY_ED448; break; default: FAIL_CONDITION(COSE_ERR_INVALID_PARAMETER); } pkey = EVP_FromKey(pKey, CBOR_CONTEXT_PARAM_COMMA perr); if (pkey == nullptr) { goto errorReturn; } pSig = _COSE_arrayget_int(pSigner, index); CHECK_CONDITION(pSig != nullptr, COSE_ERR_INVALID_PARAMETER); pmdCtx = EVP_MD_CTX_new(); EVP_PKEY_CTX *keyCtx = EVP_PKEY_CTX_new_id(type, nullptr); CHECK_CONDITION( EVP_DigestVerifyInit(pmdCtx, &keyCtx, nullptr, nullptr, pkey) == 1, COSE_ERR_CRYPTO_FAIL); CHECK_CONDITION(EVP_DigestVerify(pmdCtx, pSig->v.bytes, pSig->length, rgbToSign, cbToSign) == 1, COSE_ERR_CRYPTO_FAIL); if (pmdCtx != nullptr) { EVP_MD_CTX_free(pmdCtx); } return true; } #endif bool AES_KW_Decrypt(COSE_Enveloped *pcose, const byte *pbKeyIn, size_t cbitKey, const byte *pbCipherText, size_t cbCipherText, byte *pbKeyOut, size_t *pcbKeyOut, cose_errback *perr) { byte rgbOut[512 / 8]; AES_KEY key; UNUSED(pcose); CHECK_CONDITION(AES_set_decrypt_key(pbKeyIn, (int)cbitKey, &key) == 0, COSE_ERR_CRYPTO_FAIL); CHECK_CONDITION( AES_unwrap_key(&key, nullptr, rgbOut, pbCipherText, (int)cbCipherText), COSE_ERR_CRYPTO_FAIL); memcpy(pbKeyOut, rgbOut, cbCipherText - 8); *pcbKeyOut = (int)(cbCipherText - 8); return true; errorReturn: return false; } bool AES_KW_Encrypt(COSE_RecipientInfo *pcose, const byte *pbKeyIn, int cbitKey, const byte *pbContent, int cbContent, cose_errback *perr) { byte *pbOut = nullptr; AES_KEY key; #ifdef USE_CBOR_CONTEXT cn_cbor_context *context = &pcose->m_encrypt.m_message.m_allocContext; #endif cn_cbor *cnTmp = nullptr; pbOut = (byte *)COSE_CALLOC(cbContent + 8, 1, context); CHECK_CONDITION(pbOut != nullptr, COSE_ERR_OUT_OF_MEMORY); CHECK_CONDITION( AES_set_encrypt_key(pbKeyIn, cbitKey, &key) == 0, COSE_ERR_CRYPTO_FAIL); CHECK_CONDITION(AES_wrap_key(&key, nullptr, pbOut, pbContent, cbContent), COSE_ERR_CRYPTO_FAIL); cnTmp = cn_cbor_data_create2( pbOut, (int)cbContent + 8, 0, CBOR_CONTEXT_PARAM_COMMA nullptr); CHECK_CONDITION(cnTmp != nullptr, COSE_ERR_CBOR); pbOut = nullptr; CHECK_CONDITION(_COSE_array_replace(&pcose->m_encrypt.m_message, cnTmp, INDEX_BODY, CBOR_CONTEXT_PARAM_COMMA nullptr), COSE_ERR_CBOR); cnTmp = nullptr; return true; errorReturn: COSE_FREE(cnTmp, context); if (pbOut != nullptr) { COSE_FREE(pbOut, context); } return false; } void rand_bytes(byte *pb, size_t cb) { RAND_bytes(pb, (int)cb); } /*! * * @param[in] pRecipent Pointer to the message object * @param[in] ppKeyPrivate Address of key with private portion * @param[in] pKeyPublic Address of the key w/o a private portion * @param[in/out] ppbSecret pointer to buffer to hold the computed secret * @param[in/out] pcbSecret size of the computed secret * @param[in] context cbor allocation context structure * @param[out] perr location to return error information * @returns success of the function */ bool ECDH_ComputeSecret(COSE *pRecipient, COSE_KEY **ppKeyPrivate, COSE_KEY *pKeyPublic, byte **ppbSecret, size_t *pcbSecret, CBOR_CONTEXT_COMMA cose_errback *perr) { EVP_PKEY *evpPublic = nullptr; EVP_PKEY *evpPrivate = nullptr; EVP_PKEY_CTX *ctx = nullptr; if (false) { errorReturn: if (ctx != nullptr) { EVP_PKEY_CTX_free(ctx); } if (evpPublic != nullptr) { EVP_PKEY_free(evpPublic); } return false; } evpPublic = EVP_FromKey(pKeyPublic, CBOR_CONTEXT_PARAM_COMMA perr); if (evpPublic == nullptr) { goto errorReturn; } bool fCompressPoints = true; if (*ppKeyPrivate == nullptr) { // Generate an ephemeral key for the key agreement. int type = EVP_PKEY_base_id(evpPublic); cn_cbor *pCompress = _COSE_map_get_int( pRecipient, COSE_Header_UseCompressedECDH, COSE_DONT_SEND, perr); if (pCompress == nullptr) { fCompressPoints = true; } else { fCompressPoints = (pCompress->type == CN_CBOR_TRUE); } switch (type) { case EVP_PKEY_EC: { EC_KEY *peckeyPrivate = EC_KEY_new(); EC_KEY *peckeyPublic = EVP_PKEY_get0_EC_KEY(evpPublic); EC_KEY_set_group( peckeyPrivate, EC_KEY_get0_group(peckeyPublic)); CHECK_CONDITION(EC_KEY_generate_key(peckeyPrivate) == 1, COSE_ERR_CRYPTO_FAIL); evpPrivate = EVP_PKEY_new(); EVP_PKEY_set1_EC_KEY(evpPrivate, peckeyPrivate); } break; case EVP_PKEY_X25519: case EVP_PKEY_X448: { EVP_PKEY_CTX *ctx2 = EVP_PKEY_CTX_new_id(type, nullptr); CHECK_CONDITION(ctx2 != nullptr, COSE_ERR_OUT_OF_MEMORY); // CHECK_CONDITION( // EVP_PKEY_paramgen_init(ctx2) == 1, COSE_ERR_CRYPTO_FAIL); CHECK_CONDITION( EVP_PKEY_keygen_init(ctx2) == 1, COSE_ERR_CRYPTO_FAIL); CHECK_CONDITION( EVP_PKEY_keygen(ctx2, &evpPrivate), COSE_ERR_CRYPTO_FAIL); } break; default: FAIL_CONDITION(COSE_ERR_INVALID_PARAMETER); } cn_cbor *pcborPrivate = EVP_ToCBOR( evpPrivate, fCompressPoints, CBOR_CONTEXT_PARAM_COMMA perr); if (pcborPrivate == nullptr) { goto errorReturn; } COSE_KEY *pPrivateKey = (COSE_KEY *)COSE_KEY_FromEVP( evpPrivate, pcborPrivate, CBOR_CONTEXT_PARAM_COMMA perr); if (pPrivateKey == nullptr) { CN_CBOR_FREE(pcborPrivate, context); goto errorReturn; } *ppKeyPrivate = pPrivateKey; } else { // Use the passed in sender key evpPrivate = EVP_FromKey(*ppKeyPrivate, CBOR_CONTEXT_PARAM_COMMA perr); if (evpPrivate == nullptr) { goto errorReturn; } } ctx = EVP_PKEY_CTX_new(evpPrivate, nullptr); CHECK_CONDITION(ctx != nullptr, COSE_ERR_OUT_OF_MEMORY); CHECK_CONDITION(EVP_PKEY_derive_init(ctx) > 0, COSE_ERR_CRYPTO_FAIL); CHECK_CONDITION( EVP_PKEY_derive_set_peer(ctx, evpPublic) > 0, COSE_ERR_CRYPTO_FAIL); size_t skeylen; CHECK_CONDITION( EVP_PKEY_derive(ctx, nullptr, &skeylen) > 0, COSE_ERR_CRYPTO_FAIL); byte *skey = static_cast<byte *>(COSE_CALLOC(skeylen, 1, context)); CHECK_CONDITION(skey != nullptr, COSE_ERR_OUT_OF_MEMORY); CHECK_CONDITION( EVP_PKEY_derive(ctx, skey, &skeylen) > 0, COSE_ERR_CRYPTO_FAIL); if (ctx != nullptr) { EVP_PKEY_CTX_free(ctx); } *ppbSecret = skey; *pcbSecret = skeylen; return true; } #endif // COSE_C_USE_OPENSSL
25.256497
135
0.696854
selfienetworks
a64b7d60200521c94ee726e28de605f7ab0c6e30
10,756
cpp
C++
src/org/apache/poi/sl/usermodel/SlideShowFactory.cpp
pebble2015/cpoi
6dcc0c5e13e3e722b4ef9fd0baffbf62bf71ead6
[ "Apache-2.0" ]
null
null
null
src/org/apache/poi/sl/usermodel/SlideShowFactory.cpp
pebble2015/cpoi
6dcc0c5e13e3e722b4ef9fd0baffbf62bf71ead6
[ "Apache-2.0" ]
null
null
null
src/org/apache/poi/sl/usermodel/SlideShowFactory.cpp
pebble2015/cpoi
6dcc0c5e13e3e722b4ef9fd0baffbf62bf71ead6
[ "Apache-2.0" ]
null
null
null
// Generated from /POI/java/org/apache/poi/sl/usermodel/SlideShowFactory.java #include <org/apache/poi/sl/usermodel/SlideShowFactory.hpp> #include <java/io/File.hpp> #include <java/io/FileNotFoundException.hpp> #include <java/io/IOException.hpp> #include <java/io/InputStream.hpp> #include <java/io/Serializable.hpp> #include <java/lang/ArrayStoreException.hpp> #include <java/lang/Boolean.hpp> #include <java/lang/Class.hpp> #include <java/lang/ClassCastException.hpp> #include <java/lang/ClassLoader.hpp> #include <java/lang/Exception.hpp> #include <java/lang/IllegalArgumentException.hpp> #include <java/lang/NullPointerException.hpp> #include <java/lang/Object.hpp> #include <java/lang/RuntimeException.hpp> #include <java/lang/String.hpp> #include <java/lang/Thread.hpp> #include <java/lang/Throwable.hpp> #include <java/lang/reflect/AnnotatedElement.hpp> #include <java/lang/reflect/GenericDeclaration.hpp> #include <java/lang/reflect/InvocationTargetException.hpp> #include <java/lang/reflect/Method.hpp> #include <java/lang/reflect/Type.hpp> #include <org/apache/poi/EncryptedDocumentException.hpp> #include <org/apache/poi/OldFileFormatException.hpp> #include <org/apache/poi/hssf/record/crypto/Biff8EncryptionKey.hpp> #include <org/apache/poi/poifs/crypt/Decryptor.hpp> #include <org/apache/poi/poifs/filesystem/DirectoryNode.hpp> #include <org/apache/poi/poifs/filesystem/DocumentFactoryHelper.hpp> #include <org/apache/poi/poifs/filesystem/FileMagic.hpp> #include <org/apache/poi/poifs/filesystem/NPOIFSFileSystem.hpp> #include <org/apache/poi/poifs/filesystem/OfficeXmlFileException.hpp> #include <org/apache/poi/sl/usermodel/SlideShow.hpp> #include <org/apache/poi/util/IOUtils.hpp> #include <SubArray.hpp> #include <ObjectArray.hpp> template<typename ComponentType, typename... Bases> struct SubArray; namespace java { namespace io { typedef ::SubArray< ::java::io::Serializable, ::java::lang::ObjectArray > SerializableArray; } // io namespace lang { namespace reflect { typedef ::SubArray< ::java::lang::reflect::AnnotatedElement, ::java::lang::ObjectArray > AnnotatedElementArray; typedef ::SubArray< ::java::lang::reflect::GenericDeclaration, ::java::lang::ObjectArray, AnnotatedElementArray > GenericDeclarationArray; typedef ::SubArray< ::java::lang::reflect::Type, ::java::lang::ObjectArray > TypeArray; } // reflect typedef ::SubArray< ::java::lang::Class, ObjectArray, ::java::io::SerializableArray, ::java::lang::reflect::GenericDeclarationArray, ::java::lang::reflect::TypeArray, ::java::lang::reflect::AnnotatedElementArray > ClassArray; } // lang } // java template<typename T, typename U> static T java_cast(U* u) { if(!u) return static_cast<T>(nullptr); auto t = dynamic_cast<T>(u); if(!t) throw new ::java::lang::ClassCastException(); return t; } template<typename T> static T* npc(T* t) { if(!t) throw new ::java::lang::NullPointerException(); return t; } namespace { template<typename F> struct finally_ { finally_(F f) : f(f), moved(false) { } finally_(finally_ &&x) : f(x.f), moved(false) { x.moved = true; } ~finally_() { if(!moved) f(); } private: finally_(const finally_&); finally_& operator=(const finally_&); F f; bool moved; }; template<typename F> finally_<F> finally(F f) { return finally_<F>(f); } } poi::sl::usermodel::SlideShowFactory::SlideShowFactory(const ::default_init_tag&) : super(*static_cast< ::default_init_tag* >(0)) { clinit(); } poi::sl::usermodel::SlideShowFactory::SlideShowFactory() : SlideShowFactory(*static_cast< ::default_init_tag* >(0)) { ctor(); } poi::sl::usermodel::SlideShow* poi::sl::usermodel::SlideShowFactory::create(::poi::poifs::filesystem::NPOIFSFileSystem* fs) /* throws(IOException) */ { clinit(); return create(fs, static_cast< ::java::lang::String* >(nullptr)); } poi::sl::usermodel::SlideShow* poi::sl::usermodel::SlideShowFactory::create(::poi::poifs::filesystem::NPOIFSFileSystem* fs, ::java::lang::String* password) /* throws(IOException) */ { clinit(); auto root = npc(fs)->getRoot(); if(npc(root)->hasEntry(::poi::poifs::crypt::Decryptor::DEFAULT_POIFS_ENTRY())) { ::java::io::InputStream* stream = nullptr; { auto finally0 = finally([&] { ::poi::util::IOUtils::closeQuietly(stream); }); { stream = ::poi::poifs::filesystem::DocumentFactoryHelper::getDecryptedStream(fs, password); return createXSLFSlideShow(new ::java::lang::ObjectArray({static_cast< ::java::lang::Object* >(stream)})); } } } auto passwordSet = false; if(password != nullptr) { ::poi::hssf::record::crypto::Biff8EncryptionKey::setCurrentUserPassword(password); passwordSet = true; } { auto finally1 = finally([&] { if(passwordSet) { ::poi::hssf::record::crypto::Biff8EncryptionKey::setCurrentUserPassword(nullptr); } }); { return createHSLFSlideShow(new ::java::lang::ObjectArray({static_cast< ::java::lang::Object* >(fs)})); } } } poi::sl::usermodel::SlideShow* poi::sl::usermodel::SlideShowFactory::create(::java::io::InputStream* inp) /* throws(IOException, EncryptedDocumentException) */ { clinit(); return create(inp, static_cast< ::java::lang::String* >(nullptr)); } poi::sl::usermodel::SlideShow* poi::sl::usermodel::SlideShowFactory::create(::java::io::InputStream* inp, ::java::lang::String* password) /* throws(IOException, EncryptedDocumentException) */ { clinit(); auto is = ::poi::poifs::filesystem::FileMagic::prepareToCheckMagic(inp); auto fm = ::poi::poifs::filesystem::FileMagic::valueOf(is); { ::poi::poifs::filesystem::NPOIFSFileSystem* fs; { auto v = fm; if((v == ::poi::poifs::filesystem::FileMagic::OLE2)) { auto fs = new ::poi::poifs::filesystem::NPOIFSFileSystem(is); return create(fs, password); } if((v == ::poi::poifs::filesystem::FileMagic::OOXML)) { return createXSLFSlideShow(new ::java::lang::ObjectArray({static_cast< ::java::lang::Object* >(is)})); } if((((v != ::poi::poifs::filesystem::FileMagic::OLE2) && (v != ::poi::poifs::filesystem::FileMagic::OOXML)))) { throw new ::java::lang::IllegalArgumentException(u"Your InputStream was neither an OLE2 stream, nor an OOXML stream"_j); } end_switch0:; } } } poi::sl::usermodel::SlideShow* poi::sl::usermodel::SlideShowFactory::create(::java::io::File* file) /* throws(IOException, EncryptedDocumentException) */ { clinit(); return create(file, static_cast< ::java::lang::String* >(nullptr)); } poi::sl::usermodel::SlideShow* poi::sl::usermodel::SlideShowFactory::create(::java::io::File* file, ::java::lang::String* password) /* throws(IOException, EncryptedDocumentException) */ { clinit(); return create(file, password, false); } poi::sl::usermodel::SlideShow* poi::sl::usermodel::SlideShowFactory::create(::java::io::File* file, ::java::lang::String* password, bool readOnly) /* throws(IOException, EncryptedDocumentException) */ { clinit(); if(!npc(file)->exists()) { throw new ::java::io::FileNotFoundException(npc(file)->toString()); } ::poi::poifs::filesystem::NPOIFSFileSystem* fs = nullptr; try { fs = new ::poi::poifs::filesystem::NPOIFSFileSystem(file, readOnly); return create(fs, password); } catch (::poi::poifs::filesystem::OfficeXmlFileException* e) { ::poi::util::IOUtils::closeQuietly(fs); return createXSLFSlideShow(new ::java::lang::ObjectArray({static_cast< ::java::lang::Object* >(file), static_cast< ::java::lang::Object* >(::java::lang::Boolean::valueOf(readOnly))})); } catch (::java::lang::RuntimeException* e) { ::poi::util::IOUtils::closeQuietly(fs); throw e; } } poi::sl::usermodel::SlideShow* poi::sl::usermodel::SlideShowFactory::createHSLFSlideShow(::java::lang::ObjectArray*/*...*/ args) /* throws(IOException, EncryptedDocumentException) */ { clinit(); return createSlideShow(u"org.apache.poi.hslf.usermodel.HSLFSlideShowFactory"_j, args); } poi::sl::usermodel::SlideShow* poi::sl::usermodel::SlideShowFactory::createXSLFSlideShow(::java::lang::ObjectArray*/*...*/ args) /* throws(IOException, EncryptedDocumentException) */ { clinit(); return createSlideShow(u"org.apache.poi.xslf.usermodel.XSLFSlideShowFactory"_j, args); } poi::sl::usermodel::SlideShow* poi::sl::usermodel::SlideShowFactory::createSlideShow(::java::lang::String* factoryClass, ::java::lang::ObjectArray* args) /* throws(IOException, EncryptedDocumentException) */ { clinit(); try { auto clazz = npc(npc(::java::lang::Thread::currentThread())->getContextClassLoader())->loadClass(factoryClass); auto argsClz = new ::java::lang::ClassArray(npc(args)->length); auto i = int32_t(0); for(auto o : *npc(args)) { auto c = npc(o)->getClass(); if(npc(::java::lang::Boolean::class_())->isAssignableFrom(c)) { c = ::java::lang::Boolean::TYPE(); } else if(npc(::java::io::InputStream::class_())->isAssignableFrom(c)) { c = ::java::io::InputStream::class_(); } argsClz->set(i++, c); } auto m = npc(clazz)->getMethod(u"createSlideShow"_j, argsClz); return java_cast< SlideShow* >(npc(m)->invoke(nullptr, args)); } catch (::java::lang::reflect::InvocationTargetException* e) { auto t = npc(e)->getCause(); if(dynamic_cast< ::java::io::IOException* >(t) != nullptr) { throw java_cast< ::java::io::IOException* >(t); } else if(dynamic_cast< ::poi::EncryptedDocumentException* >(t) != nullptr) { throw java_cast< ::poi::EncryptedDocumentException* >(t); } else if(dynamic_cast< ::poi::OldFileFormatException* >(t) != nullptr) { throw java_cast< ::poi::OldFileFormatException* >(t); } else { throw new ::java::io::IOException(t); } } catch (::java::lang::Exception* e) { throw new ::java::io::IOException(static_cast< ::java::lang::Throwable* >(e)); } } extern java::lang::Class *class_(const char16_t *c, int n); java::lang::Class* poi::sl::usermodel::SlideShowFactory::class_() { static ::java::lang::Class* c = ::class_(u"org.apache.poi.sl.usermodel.SlideShowFactory", 44); return c; } java::lang::Class* poi::sl::usermodel::SlideShowFactory::getClass0() { return class_(); }
40.284644
225
0.656378
pebble2015
a64bbb7c5f002b0b3c38013d58452b676f93cc34
11,980
cpp
C++
src/asiTestEngine/asiTestEngine_Launcher.cpp
yeeeeeeti/3D_feature_extract
6297daa8afaac09aef9b44858e74fb2a95e1e7c5
[ "BSD-3-Clause" ]
null
null
null
src/asiTestEngine/asiTestEngine_Launcher.cpp
yeeeeeeti/3D_feature_extract
6297daa8afaac09aef9b44858e74fb2a95e1e7c5
[ "BSD-3-Clause" ]
null
null
null
src/asiTestEngine/asiTestEngine_Launcher.cpp
yeeeeeeti/3D_feature_extract
6297daa8afaac09aef9b44858e74fb2a95e1e7c5
[ "BSD-3-Clause" ]
null
null
null
//----------------------------------------------------------------------------- // Created on: 11 June 2013 //----------------------------------------------------------------------------- // Copyright (c) 2013-present, Sergey Slyadnev // All rights reserved. // // 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. // * Neither the name of the copyright holder(s) nor the // names of all 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 AUTHORS 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. //----------------------------------------------------------------------------- // Windows includes #include <windows.h> // Own include #include <asiTestEngine_Launcher.h> // asiTestEngine includes #include <asiTestEngine_DescriptionProc.h> #include <asiTestEngine_ReportRenderer.h> #include <asiTestEngine_ReportStyleFactory.h> // asiAlgo includes #include <asiAlgo_TimeStamp.h> #include <asiAlgo_Utils.h> // STD includes #include <fstream> //! Adds the passed Test Case Launcher to the internal collection. //! \param CaseLauncher [in] Test Case Launcher to add. //! \return this for subsequent streaming. asiTestEngine_Launcher& asiTestEngine_Launcher::operator<<(const Handle(asiTestEngine_CaseLauncherAPI)& CaseLauncher) { m_launchers.push_back(CaseLauncher); return *this; } //! Launches all managed Test Cases. //! \param out [in, optional] output stream. //! \return true if all Cases have succeeded, false -- otherwise. bool asiTestEngine_Launcher::Launch(std::ostream* out) const { /* ============================== * Launch Test Cases one by one * ============================== */ bool isOk = true; int numTotal = 0, numFailed = 0; for ( int l = 0; l < (int) m_launchers.size(); ++l ) { const Handle(asiTestEngine_CaseLauncherAPI)& CaseLauncher = m_launchers.at(l); const bool nextOk = CaseLauncher->Launch(); // Put message to output stream if ( out ) { *out << "\tCase " << CaseLauncher->CaseID() << ": " << (nextOk ? "Ok" : "Failed"); *out << "; (Total / Failed) = (" << CaseLauncher->NumberOfExecuted() << " / " << CaseLauncher->NumberOfFailed() << ")\n"; } numTotal += CaseLauncher->NumberOfExecuted(); numFailed += CaseLauncher->NumberOfFailed(); if ( !nextOk && isOk ) isOk = false; } if ( out ) { *out << "\t***\n"; *out << "\tTotal executed: " << numTotal << "\n"; *out << "\tTotal failed: " << numFailed << "\n"; } /* ================ * Prepare report * ================ */ if ( out ) *out << "\t***\n"; if ( this->generateReport(out) ) { if ( out ) *out << "\tReport generation succeeded\n"; } else { if ( out ) *out << "\tReport generation failed (!!!)\n"; } return isOk; } //! Generates HTML report for the Test Cases identified by the managed //! Launchers. //! \param out [in] output stream. //! \return true in case of success, false -- otherwise. bool asiTestEngine_Launcher::generateReport(std::ostream* out) const { /* =========================== * Render header information * =========================== */ Handle(asiTestEngine_ReportRenderer) Rdr = new asiTestEngine_ReportRenderer; // Global style for HTML body asiTestEngine_ReportStyle BodyStyle; BodyStyle.SetFontFamily("Verdana"); // Global style for TD elements asiTestEngine_ReportStyle CellStyle; CellStyle.SetFontSize(11); // Global style for header cells asiTestEngine_ReportStyle HCellStyle; HCellStyle.SetBgColor( asiTestEngine_ReportStyle::Color(215, 215, 200) ); // Global style for TD elements for "good" results asiTestEngine_ReportStyle GoodCellStyle; GoodCellStyle.SetBgColor( asiTestEngine_ReportStyle::Color(180, 220, 25) ); // Global style for TD elements for "bad" results asiTestEngine_ReportStyle BadCellStyle; BadCellStyle.SetBgColor( asiTestEngine_ReportStyle::Color(255, 0, 0) ); // Global style for tables asiTestEngine_ReportStyle TableStyle; TableStyle.SetBorder(1); TableStyle.SetPadding(5); // Generate HTML heading section Rdr->AddDoctype() ->StartHtml() ->StartHeader() ->AddMeta() ->StartStyle() ->AddClass("body_class", BodyStyle) ->AddClass("table_class", TableStyle) ->AddClass("cell_class", CellStyle) ->AddClass("good_cell_class", GoodCellStyle) ->AddClass("bad_cell_class", BadCellStyle) ->AddClass("header_cell_class", HCellStyle) ->EndStyle() ->EndHeader() ->StartBody("body_class"); // Generate table header Rdr->StartTable("table_class") ->StartTableRow() ->StartColSpanTableHCell(2, "table_class cell_class") ->AddText(asiTestEngine_Macro_TEST) ->EndTableHCell() ->StartTableHCell("table_class cell_class") ->AddText(asiTestEngine_Macro_RESULT) ->EndTableHCell() ->EndTableRow(); /* ======================================= * Render information per each Test Case * ======================================= */ // Iterate over Test Cases for ( int l = 0; l < (int) m_launchers.size(); ++l ) { const Handle(asiTestEngine_CaseLauncherAPI)& CaseLauncher = m_launchers.at(l); // Local summary const int nTotal = CaseLauncher->NumberOfExecuted(); const int nFailed = CaseLauncher->NumberOfFailed(); const double passedPercent = (double) (nTotal-nFailed)/nTotal*100.0; // Get filename for description std::string descGroupDir = CaseLauncher->CaseDescriptionDir(); std::string descFilename = CaseLauncher->CaseDescriptionFn() + asiTestEngine_Macro_DOT + asiTestEngine_Macro_DESCR_EXT; std::string descDir = asiAlgo_Utils::Str::Slashed( asiAlgo_Utils::Env::AsiTestDescr() ) + descGroupDir; // Description processing tool std::string title; std::vector<std::string> overviewBlocks, detailBlocks; // if ( !asiTestEngine_DescriptionProc::Process(descDir, descFilename, CaseLauncher->Variables(), CaseLauncher->CaseID(), nTotal, title, overviewBlocks, detailBlocks) ) { if ( out ) *out << "\tFailed to read description from \"" << descFilename.c_str() << "\"\n"; return false; } // Render header for Test Case Rdr->StartTableRow() ->StartTableHCell("table_class cell_class header_cell_class") ->AddText( CaseLauncher->CaseID() ) ->EndTableHCell() ->StartTableHCell("table_class cell_class header_cell_class") ->AddText(title) ->EndTableHCell(); // Finish row with local statistics Rdr->StartTableHCell( (nFailed == 0) ? "table_class cell_class good_cell_class" : "table_class cell_class bad_cell_class" ); Rdr->AddText(passedPercent)->AddText("%")->EndTableHCell(); Rdr->EndTableRow(); // Check number of OVERVIEW blocks if ( (int) overviewBlocks.size() < nTotal ) { if ( out ) *out << "\tNot enough OVERVIEW blocks in \"" << descFilename.c_str() << "\"\n"; return false; } // Add rows for Test Functions for ( int f = 0; f < nTotal; ++f ) { // Prepare global ID of Test Function std::string GID = asiAlgo_Utils::Str::ToString( CaseLauncher->CaseID() ) + asiTestEngine_Macro_COLON + asiAlgo_Utils::Str::ToString(f+1); // Add table row Rdr->StartTableRow() ->StartTableCell("table_class cell_class")->AddText(GID)->EndTableCell() ->StartTableCell("table_class cell_class") ->AddText( overviewBlocks[f] ); // Add section for details if ( ( (int) detailBlocks.size() >= (f+1) ) && detailBlocks[f].length() ) { const std::string& details = detailBlocks[f]; Rdr->BreakRow()->BreakRow() ->AddText("<i>Details:</i>") ->AddText("<div style='border: 1px dotted rgb(100, 100, 100); " "font-size: 11; background-color: rgb(250, 245, 160); " "padding: 5px; margin: 5px;'>") ->AddText(details) ->AddText("</div>"); } // Finish description cell Rdr->EndTableCell(); // Result of Test Function if ( CaseLauncher->IsPassed(f) ) Rdr->StartTableCell("table_class cell_class good_cell_class")->AddText(asiTestEngine_Macro_OK); else Rdr->StartTableCell("table_class cell_class bad_cell_class")->AddText(asiTestEngine_Macro_FAILED); // Finish row Rdr->EndTableCell()->EndTableRow(); } } // Finish table Rdr->EndTable(); /* =============== * Render footer * =============== */ Rdr->EndBody()->EndHtml(); /* ========================== * Prepare filesystem stuff * ========================== */ std::string dirName = std::string("ut_") + this->uniqueDirName(); if ( out ) *out << "\tTemporary directory: " << dirName.c_str() << "\n"; // Prepare full name of the temporary directory std::string fullDirName = asiAlgo_Utils::Str::Slashed( asiAlgo_Utils::Env::AsiTestDumping() ) + dirName; // TODO: for Windows only (!!!) // Create directory if ( !CreateDirectory(fullDirName.c_str(), NULL) ) { if ( out ) *out << "\tFailed to create directory: " << fullDirName.c_str() << "\n"; return false; } // Filename for HTML report std::string filename = asiAlgo_Utils::Str::Slashed(fullDirName) + asiTestEngine_Macro_REPORT_FN + asiTestEngine_Macro_DOT + asiTestEngine_Macro_REPORT_EXT; // Create file for HTML report std::ofstream file; file.open(filename.c_str(), std::ios::out | std::ios::trunc); if ( !file.is_open() ) { if ( out ) *out << "Cannot open file " << filename.c_str() << " for writing" << "\n"; return false; } // Dump rendered information to file file << Rdr->Flush(); // Release file file.close(); return true; } //! Generates unique name for the directory containing all results for //! current test session. The used format is as follows: //! <pre> //! ut_{week-day}_{month}_{day}_{{hour}{min}{sec}}_{year} //! //! E.g: //! //! ut_Sat_Dec_07_190744_2013 //! //! </pre> //! \return generated unique name. std::string asiTestEngine_Launcher::uniqueDirName() const { Handle(asiAlgo_TimeStamp) TS = asiAlgo_TimeStampTool::Generate(); return TS->ToString(false, true); }
33.841808
123
0.609432
yeeeeeeti
a6503ef30e992a32ee3f889f8c0dd2d1dd763b8c
236
cpp
C++
auto_type4.cpp
zyfjeff/utils_code
034b1a0ff9ae4f7cebafdd7cfa464cc52119ab24
[ "Apache-2.0" ]
null
null
null
auto_type4.cpp
zyfjeff/utils_code
034b1a0ff9ae4f7cebafdd7cfa464cc52119ab24
[ "Apache-2.0" ]
null
null
null
auto_type4.cpp
zyfjeff/utils_code
034b1a0ff9ae4f7cebafdd7cfa464cc52119ab24
[ "Apache-2.0" ]
1
2020-02-21T17:16:50.000Z
2020-02-21T17:16:50.000Z
#include <iostream> #include <typeinfo> using namespace std; auto AutoFunctionFromReturn(int parameter)->int // 这里需要加 { return parameter; } int main() { auto value = AutoFunctionFromReturn(1); cout << value << endl; return 0; }
13.111111
56
0.707627
zyfjeff
a6521365b51d140e0567ca8d54cfc56d17d21397
1,986
cpp
C++
folderviewstyleditemdelegate.cpp
haraki/farman
9aab8cfdd3f9d98f3be8dfddd6bad8451ea27297
[ "MIT" ]
5
2018-08-19T05:45:45.000Z
2020-10-09T09:37:57.000Z
folderviewstyleditemdelegate.cpp
haraki/farman
9aab8cfdd3f9d98f3be8dfddd6bad8451ea27297
[ "MIT" ]
95
2018-04-26T12:13:24.000Z
2020-05-03T08:23:56.000Z
folderviewstyleditemdelegate.cpp
haraki/farman
9aab8cfdd3f9d98f3be8dfddd6bad8451ea27297
[ "MIT" ]
1
2018-08-19T05:46:02.000Z
2018-08-19T05:46:02.000Z
#include "folderviewstyleditemdelegate.h" #include <QStyleOptionViewItem> #include <QModelIndex> #include <QDebug> #include <QPainter> #include <QApplication> #include "folderview.h" #include "default_settings.h" namespace Farman { FolderViewStyledItemDelegate::FolderViewStyledItemDelegate(QObject *parent/* = Q_NULLPTR*/) : QStyledItemDelegate(parent) , m_cursorWidth(DEFAULT_CURSOR_WIDTH) , m_activeColor(DEFAULT_COLOR_SETTINGS["folderView_cursor"]) , m_inactiveColor(DEFAULT_COLOR_SETTINGS["folderView_cursor_inactive"]) { makePen(); } void FolderViewStyledItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const { QStyleOptionViewItem opt = option; opt.state &= ~QStyle::State_Selected; // FolderModel の TextColorRole・BackgroundRole の Brush を使用するため、ここでは Selected を無効にする opt.state &= ~QStyle::State_HasFocus; // カーソル位置の枠を表示しないようにするため、ここでは Has_Focus を無効にする(Windows用) QStyledItemDelegate::paint(painter, opt, index); FolderView* parent = qobject_cast<FolderView*>(this->parent()); if(parent != Q_NULLPTR) { if(parent->currentIndex().row() == index.row()) { // カーソル位置をアンダーラインで表示 painter->save(); painter->setPen((option.state & QStyle::State_Active) ? m_activeCursorPen : m_inactiveCursorPen); painter->drawLine(option.rect.bottomLeft(), option.rect.bottomRight()); painter->restore(); } } } void FolderViewStyledItemDelegate::setCursorAppearance(int width, const QColor& activeColor, const QColor& inactiveColor) { m_cursorWidth = width; m_activeColor = activeColor; m_inactiveColor = inactiveColor; makePen(); } void FolderViewStyledItemDelegate::makePen() { m_activeCursorPen = QPen(m_activeColor, static_cast<qreal>(m_cursorWidth)); m_inactiveCursorPen = QPen(m_inactiveColor, static_cast<qreal>(m_cursorWidth)); } } // namespace Farman
32.557377
130
0.721047
haraki
a655057314f964bd57dec37dc61e690c3e832c28
3,134
cpp
C++
src/Media/MediaJoystick.cpp
mushware/adanaxis-core-app
679ac3e8a122e059bb208e84c73efc19753e87dd
[ "MIT" ]
9
2020-11-02T17:20:40.000Z
2021-12-25T15:35:36.000Z
src/Media/MediaJoystick.cpp
mushware/adanaxis-core-app
679ac3e8a122e059bb208e84c73efc19753e87dd
[ "MIT" ]
2
2020-06-27T23:14:13.000Z
2020-11-02T17:28:32.000Z
src/Media/MediaJoystick.cpp
mushware/adanaxis-core-app
679ac3e8a122e059bb208e84c73efc19753e87dd
[ "MIT" ]
1
2021-05-12T23:05:42.000Z
2021-05-12T23:05:42.000Z
//%Header { /***************************************************************************** * * File: src/Media/MediaJoystick.cpp * * Copyright: Andy Southgate 2002-2007, 2020 * * 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. * ****************************************************************************/ //%Header } QTCqGGve2ziFnEL2Ljyj9A /* * $Id: MediaJoystick.cpp,v 1.2 2006/07/21 10:52:06 southa Exp $ * $Log: MediaJoystick.cpp,v $ * Revision 1.2 2006/07/21 10:52:06 southa * win32 build fixes * * Revision 1.1 2006/07/11 19:49:04 southa * Control menu * */ #include "MediaJoystick.h" #include "MediaSDL.h" MUSHCORE_SINGLETON_INSTANCE(MediaJoystick); using namespace Mushware; using namespace std; MediaJoystick::MediaJoystick() { MediaSDL::Sgl().InitJoystick(); SDL_JoystickEventState(SDL_ENABLE); U32 numSticks = SDL_NumJoysticks(); m_sticks.resize(numSticks); for (U32 i=0; i<numSticks; ++i) { m_sticks[i] = SDL_JoystickOpen(i); SDL_JoystickID stickId = SDL_JoystickInstanceID(m_sticks[i]); if (m_sticks[i] != NULL) { MushcoreLog::Sgl().InfoLog() << "Opening joystick " << i << endl; MushcoreLog::Sgl().InfoLog() << "- Name : " << SDL_JoystickName(m_sticks[i]) << endl; MushcoreLog::Sgl().InfoLog() << "- Axes : " << SDL_JoystickNumAxes(m_sticks[i]) << endl; MushcoreLog::Sgl().InfoLog() << "- Buttons : " << SDL_JoystickNumButtons(m_sticks[i]) << endl; MushcoreLog::Sgl().InfoLog() << "- Balls : " << SDL_JoystickNumBalls(m_sticks[i]) << endl; MushcoreLog::Sgl().InfoLog() << "- Hats : " << SDL_JoystickNumHats(m_sticks[i]) << endl; } } } MediaJoystick::~MediaJoystick() { #ifndef WIN32 // Windows doesn't like this for (U32 i=0; i<m_sticks.size(); ++i) { if (SDL_JoystickOpened(i)) { SDL_JoystickClose(m_sticks[i]); } } #endif MediaSDL::Sgl().QuitJoystick(); } Mushware::U32 MediaJoystick::NumJoysticks(void) { return SDL_NumJoysticks(); }
32.989474
107
0.63178
mushware
a6576b33211fd24b91c195d9a4b0681a4792bdd2
3,998
hpp
C++
Engine/_Editor/_Headers/ZEditorScene.hpp
gitbetter/Zenith
62092062cad4dda588bfd699185d6ce9be294e63
[ "MIT" ]
15
2019-04-06T15:45:24.000Z
2021-02-01T08:04:10.000Z
Engine/_Editor/_Headers/ZEditorScene.hpp
gitbetter/Zenith
62092062cad4dda588bfd699185d6ce9be294e63
[ "MIT" ]
1
2021-02-03T17:55:07.000Z
2021-02-18T09:14:09.000Z
Engine/_Editor/_Headers/ZEditorScene.hpp
gitbetter/Zenith
62092062cad4dda588bfd699185d6ce9be294e63
[ "MIT" ]
null
null
null
/* ______ ______ __ __ __ ______ __ __ /\___ \ /\ ___\ /\ "-.\ \ /\ \ /\__ _\ /\ \_\ \ \/_/ /__ \ \ __\ \ \ \-. \ \ \ \ \/_/\ \/ \ \ __ \ /\_____\ \ \_____\ \ \_\" \_\ \ \_\ \ \_\ \ \_\ \_\ \/_____/ \/_____/ \/_/ \/_/ \/_/ \/_/ \/_/\/_/ ZEditor.hpp Created by Adrian Sanchez on 18/01/21. Copyright © 2019 Pervasive Sense. All rights reserved. This file is part of Zenith. Zenith 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 3 of the License, or (at your option) any later version. Zenith 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 Zenith. If not, see <https://www.gnu.org/licenses/>. */ #pragma once // Includes #include "ZScene.hpp" // Forward Declarations class ZEditorEntity; class ZMenuBar; class ZEvent; class ZResourceHandle; class ZResourceLoadedEvent; class ZUIPanel; class ZCamera; class ZEditorTool; // Definitions const std::string EDITOR_CONFIG_PATH = "/conf.zof"; const std::string EDITOR_OBJECT_TEMPLATES_PATH = "/object_templates.zof"; struct ZEditorConfig { glm::vec4 sizeLimits{ 0.f }; ZUITheme theme; }; class ZEditorScene : public ZScene { public: ZEditorScene() : ZScene("EditorScene"), editorOpen_(true) { } void Initialize() override; void Update(double deltaTime) override; void CleanUp() override; ZGameObjectMap& ObjectTemplates() { return gameObjectTemplates_; } ZUIElementMap& UITemplates() { return uiElementTemplates_; } ZEditorConfig& Config() { return config_; } ZGameObjectMap& SelectedObjects() { return selectedObjects_; } std::shared_ptr<ZGameObject> EditorCamera() { return editorCamera_; } ZSceneSnapshot& LastSceneSnapshot() { return lastSceneSnapshot_; } std::shared_ptr<ZScene> ActiveProjectScene() { return activeProjectScene_; } void SetSceneSnapshot(ZSceneSnapshot& snapshot) { lastSceneSnapshot_ = snapshot; } void SetActiveProjectScene(const std::shared_ptr<ZScene>& activeScene); void AddTool(const std::shared_ptr<ZEditorTool>& tool, const std::shared_ptr<ZUIPanel>& layoutRegion); std::shared_ptr<ZCamera> CreateCamera(); std::shared_ptr<ZUIPanel> CreateVerticalRegion(const ZRect& rect, std::shared_ptr<ZUIPanel> parent = nullptr); std::shared_ptr<ZUIPanel> CreateHorizontalRegion(const ZRect& rect, std::shared_ptr<ZUIPanel> parent = nullptr); private: ZGameObjectMap gameObjectTemplates_; ZUIElementMap uiElementTemplates_; ZEditorConfig config_; bool editorOpen_; ZGameObjectMap selectedObjects_; std::shared_ptr<ZGameObject> editorCamera_; std::shared_ptr<ZUIPanel> topPanel_; std::shared_ptr<ZUIPanel> leftPanel_; std::shared_ptr<ZUIPanel> centerPanel_; std::shared_ptr<ZUIPanel> rightPanel_; std::shared_ptr<ZUIPanel> bottomPanel_; std::vector<std::shared_ptr<ZEditorEntity>> entities_; ZSceneSnapshot lastSceneSnapshot_; std::shared_ptr<ZScene> activeProjectScene_; void SetupLayoutPanels(); void SetupInitialTools(); void Configure(std::shared_ptr<ZOFTree> objectTree); void Configure(ZEditorConfig config); void LoadObjectTemplates(std::shared_ptr<ZOFTree> objectTree); void HandleResourceLoaded(const std::shared_ptr<ZResourceLoadedEvent>& event); };
36.345455
116
0.654827
gitbetter
a6590ec1cceebe921dadc73b52144e76b4c6975a
16,373
cpp
C++
src/vlGraphics/PolygonSimplifier.cpp
Abergard/VisualizationLibrary
d2a0e321288152008957e29a0bc270ad192f75be
[ "BSD-2-Clause" ]
281
2016-04-16T14:11:04.000Z
2022-03-24T14:48:52.000Z
src/vlGraphics/PolygonSimplifier.cpp
Abergard/VisualizationLibrary
d2a0e321288152008957e29a0bc270ad192f75be
[ "BSD-2-Clause" ]
91
2016-04-20T19:55:45.000Z
2022-01-04T02:59:33.000Z
src/vlGraphics/PolygonSimplifier.cpp
Abergard/VisualizationLibrary
d2a0e321288152008957e29a0bc270ad192f75be
[ "BSD-2-Clause" ]
83
2016-04-26T01:28:40.000Z
2022-03-21T13:23:55.000Z
/**************************************************************************************/ /* */ /* Visualization Library */ /* http://visualizationlibrary.org */ /* */ /* Copyright (c) 2005-2020, Michele Bosi */ /* All rights reserved. */ /* */ /* 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 <vlGraphics/PolygonSimplifier.hpp> #include <vlGraphics/DoubleVertexRemover.hpp> #include <vlCore/Time.hpp> #include <vlCore/Log.hpp> #include <vlCore/Say.hpp> #include <set> using namespace vl; //----------------------------------------------------------------------------- namespace { class VertexPtrWrapper { public: VertexPtrWrapper(PolygonSimplifier::Vertex* ptr=NULL): mVertex(ptr) {} bool operator==(const VertexPtrWrapper& other) const { return mVertex == other.mVertex; } bool operator!=(const VertexPtrWrapper& other) const { return mVertex == other.mVertex; } bool operator<(const VertexPtrWrapper& other) const { if ( mVertex->collapseCost() != other.mVertex->collapseCost() ) return mVertex->collapseCost() < other.mVertex->collapseCost(); else return mVertex < other.mVertex; } PolygonSimplifier::Vertex* mVertex; }; } //----------------------------------------------------------------------------- void PolygonSimplifier::simplify() { if (!mInput) { Log::error("PolygonSimplifier::simplify() : no input Geometry specified.\n"); return; } // we don't support vertex attributes of any kind yet #ifndef NDEBUG bool problem = false; for( int i = VA_Position + 1; i < VA_MaxAttribCount; ++i ) problem |= mInput->vertexAttribArray(i) != NULL; if (problem) Log::warning("PolygonSimplifier::simplify() simplifies only the position array of a Geometry, the other attibutes will be discarded.\n"); #endif Time timer; timer.start(); if ( removeDoubles() ) { DoubleVertexRemover remover; remover.removeDoubles( mInput.get() ); } std::vector<fvec3> verts; std::vector<int> indices; indices.reserve(1000); // merge all triangles in a single DrawElementsUInt ref<DrawElementsUInt> pint = new DrawElementsUInt(PT_TRIANGLES, 1); for( size_t i=0; i<mInput->drawCalls().size(); ++i ) { DrawCall* prim = mInput->drawCalls().at(i); for(TriangleIterator trit = prim->triangleIterator(); trit.hasNext(); trit.next()) { indices.push_back( trit.a() ); indices.push_back( trit.b() ); indices.push_back( trit.c() ); } } if (indices.empty()) { Log::warning("PolygonSimplifier::simplify() : no triangles found in input Geometry.\n"); return; } ArrayAbstract* posarr = mInput->vertexArray(); if (!posarr) { Log::warning("PolygonSimplifier::simplify() : no vertices found in input Geometry.\n"); return; } // fill vertices verts.resize( posarr->size() ); for( size_t i=0; i< posarr->size(); ++i ) verts[i] = (fvec3)posarr->getAsVec3(i); if (verts.empty()) { Log::warning("PolygonSimplifier::simplify() : no vertices found in input Geometry.\n"); return; } simplify(verts, indices); if (verbose()) Log::print( Say("PolygonSimplifier::simplify() done in %.3ns\n") << timer.elapsed() ); } //----------------------------------------------------------------------------- void PolygonSimplifier::simplify(const std::vector<fvec3>& in_verts, const std::vector<int>& in_tris) { if (verbose()) Log::print("PolygonSimplifier::simplify() starting ... \n"); Time timer; timer.start(); // sort simplification targets 1.0 -> 0.0 std::sort(mTargets.begin(), mTargets.end()); std::reverse(mTargets.begin(), mTargets.end()); mSimplifiedVertices.clear(); mSimplifiedTriangles.clear(); mProtectedVerts.clear(); mTriangleLump.clear(); mVertexLump.clear(); // mic fixme: this is the one taking time. // preallocate vertices and triangles in one chunk mTriangleLump.resize(in_tris.size()/3); mVertexLump.resize(in_verts.size()); int polys_before = (int)in_tris.size() / 3; int verts_before = (int)in_verts.size(); mSimplifiedTriangles.resize( in_tris.size() / 3 ); mSimplifiedVertices.resize( in_verts.size() ); #define SHUFFLE_VERTICES 0 #if SHUFFLE_VERTICES std::vector<Vertex*> vertex_pool; vertex_pool.resize( in_verts.size() ); for(int i=0; i<(int)mVertexLump.size(); ++i) vertex_pool[i] = &mVertexLump[i]; // shuffle the vertices for(int i=0; i<(int)vertex_pool.size(); ++i) { int a = int( (float)rand() / (RAND_MAX+1) * vertex_pool.size() ); int b = int( (float)rand() / (RAND_MAX+1) * vertex_pool.size() ); Vertex* tmp = vertex_pool[a]; vertex_pool[a] = vertex_pool[b]; vertex_pool[b] = tmp; } #endif // initialize vertices for(int ivert=0; ivert<(int)in_verts.size(); ++ivert) { #if SHUFFLE_VERTICES mSimplifiedVertices[ivert] = vertex_pool[ivert]; #else mSimplifiedVertices[ivert] = &mVertexLump[ivert]; #endif mSimplifiedVertices[ivert]->mPosition = in_verts[ivert]; // so that the user knows which vertex is which and can regenerate per-vertex // information like textures coordinates, colors etc. mSimplifiedVertices[ivert]->mOriginalIndex = ivert; // unprotect the vertex mSimplifiedVertices[ivert]->mProtected = false; // reserve the memory for quicker allocation mSimplifiedVertices[ivert]->mIncidentTriangles.reserve(12); mSimplifiedVertices[ivert]->mAdjacentVerts.reserve(12); } // initialize triangles for(int idx=0, itri=0; idx<(int)in_tris.size(); idx+=3, ++itri) { mSimplifiedTriangles[itri] = &mTriangleLump[itri]; mSimplifiedTriangles[itri]->mVertices[0] = mSimplifiedVertices[ in_tris[idx+0] ]; mSimplifiedTriangles[itri]->mVertices[1] = mSimplifiedVertices[ in_tris[idx+1] ]; mSimplifiedTriangles[itri]->mVertices[2] = mSimplifiedVertices[ in_tris[idx+2] ]; } // compute vertex/vertex and vertex/triangle connectivity for(int itri=0; itri<(int)mSimplifiedTriangles.size(); ++itri) { // add this triangle to all its vertices mSimplifiedTriangles[itri]->mVertices[0]->mIncidentTriangles.push_back( mSimplifiedTriangles[itri] ); mSimplifiedTriangles[itri]->mVertices[1]->mIncidentTriangles.push_back( mSimplifiedTriangles[itri] ); mSimplifiedTriangles[itri]->mVertices[2]->mIncidentTriangles.push_back( mSimplifiedTriangles[itri] ); // add adjacent vertices mSimplifiedTriangles[itri]->mVertices[0]->addAdjacentVertex( mSimplifiedTriangles[itri]->mVertices[1] ); // vertex 0 mSimplifiedTriangles[itri]->mVertices[0]->addAdjacentVertex( mSimplifiedTriangles[itri]->mVertices[2] ); mSimplifiedTriangles[itri]->mVertices[1]->addAdjacentVertex( mSimplifiedTriangles[itri]->mVertices[0] ); // vertex 1 mSimplifiedTriangles[itri]->mVertices[1]->addAdjacentVertex( mSimplifiedTriangles[itri]->mVertices[2] ); mSimplifiedTriangles[itri]->mVertices[2]->addAdjacentVertex( mSimplifiedTriangles[itri]->mVertices[0] ); // vertex 2 mSimplifiedTriangles[itri]->mVertices[2]->addAdjacentVertex( mSimplifiedTriangles[itri]->mVertices[1] ); // compute normal mSimplifiedTriangles[itri]->computeNormal(); // error QErr qerr = mSimplifiedTriangles[itri]->computeQErr(); mSimplifiedTriangles[itri]->mVertices[0]->addQErr(qerr); mSimplifiedTriangles[itri]->mVertices[1]->addQErr(qerr); mSimplifiedTriangles[itri]->mVertices[2]->addQErr(qerr); } // - remove vertices without triangles // - compute edge penalties // - initialize the collapse info of each vertex for( int ivert=(int)mSimplifiedVertices.size(); ivert--; ) { if ( mSimplifiedVertices[ivert]->incidentTrianglesCount() == 0 ) mSimplifiedVertices.erase( mSimplifiedVertices.begin() + ivert ); else { mSimplifiedVertices[ivert]->computeEdgePenalty(); computeCollapseInfo( mSimplifiedVertices[ivert] ); } } // sets the protected vertices for(int i=0; i<(int)mProtectedVerts.size(); ++i) { VL_CHECK(mProtectedVerts[i] < (int)mSimplifiedVertices.size() ) mSimplifiedVertices[ mProtectedVerts[i] ]->mProtected = true; } if (verbose()) Log::print(Say("database setup = %.3n\n") << timer.elapsed() ); std::set<VertexPtrWrapper> vertex_set; for(int ivert=0; ivert<(int)mSimplifiedVertices.size(); ++ivert) if ( !mSimplifiedVertices[ivert]->mProtected ) vertex_set.insert( mSimplifiedVertices[ivert] ); if (verbose()) Log::print(Say("heap setup = %.3n\n") << timer.elapsed() ); // loop through the simplification targets for(size_t itarget=0, remove_order=0; itarget<mTargets.size(); ++itarget) { const int target_vertex_count = mTargets[itarget]; if (target_vertex_count < 3) { Log::print(Say("Invalid target_vertex_count = %n\n") << target_vertex_count); return; } timer.start(1); std::vector< PolygonSimplifier::Vertex* > adj_verts; for( ; (int)vertex_set.size()>target_vertex_count; ++remove_order ) { std::set<VertexPtrWrapper>::iterator it = vertex_set.begin(); PolygonSimplifier::Vertex* v = it->mVertex; v->mRemoveOrder = (int)remove_order; vertex_set.erase(it); // remove the adjacent vertices to v and v->collapseVert() adj_verts.clear(); for(int i=0; i<v->adjacentVerticesCount(); ++i) { VL_CHECK( v != v->adjacentVertex(i) ) VL_CHECK( !v->adjacentVertex(i)->mAlreadyProcessed ) adj_verts.push_back( v->adjacentVertex(i) ); adj_verts.back()->mAlreadyProcessed = true; vertex_set.erase( v->adjacentVertex(i) ); } for(int i=0; i<v->collapseVertex()->adjacentVerticesCount(); ++i) { if ( !v->collapseVertex()->adjacentVertex(i)->mAlreadyProcessed ) { adj_verts.push_back( v->collapseVertex()->adjacentVertex(i) ); vertex_set.erase( v->collapseVertex()->adjacentVertex(i) ); } } VL_CHECK(!v->removed()) VL_CHECK(v->collapseVertex()) VL_CHECK(!v->collapseVertex()->removed()) collapse( v ); // reinsert the adj_verts if not removed // NOTE: v->collapseVertex() might have been also removed for( int i=(int)adj_verts.size(); i--; ) { adj_verts[i]->mAlreadyProcessed = false; if ( adj_verts[i]->removed() ) continue; computeCollapseInfo( adj_verts[i] ); VL_CHECK( adj_verts[i]->checkTriangles() ) VL_CHECK( adj_verts[i]->collapseVertex() != v ) VL_CHECK( !adj_verts[i]->collapseVertex()->removed() ) vertex_set.insert( adj_verts[i] ); } } if (verbose()) Log::print(Say("simplification = %.3ns (%.3ns)\n") << timer.elapsed() << timer.elapsed(1) ); outputSimplifiedGeometry(); } if (verbose() && !output().empty()) { float elapsed = (float)timer.elapsed(); int polys_after = output().back()->drawCalls().at(0)->countTriangles(); int verts_after = output().back()->vertexArray() ? (int)output().back()->vertexArray()->size() : 0; Log::print(Say("POLYS: %n -> %n, %.2n%%, %.1nT/s\n") << polys_before << polys_after << 100.0f*verts_after/verts_before << (polys_before - polys_after)/elapsed ); Log::print(Say("VERTS: %n -> %n, %.2n%%, %.1nV/s\n") << verts_before << verts_after << 100.0f*verts_after/verts_before << (verts_before - verts_after)/elapsed ); } } //----------------------------------------------------------------------------- void PolygonSimplifier::outputSimplifiedGeometry() { // count vertices required size_t vert_count = 0; for(int i=0; i<(int)mSimplifiedVertices.size(); ++i) vert_count += mSimplifiedVertices[i]->mRemoved ? 0 : 1; // regenerate vertex buffer & generate indices for index buffer ref<ArrayFloat3> arr_f3 = new ArrayFloat3; arr_f3->resize(vert_count); for(int i=0, vert_index=0; i<(int)mSimplifiedVertices.size(); ++i) { if (!mSimplifiedVertices[i]->mRemoved) { arr_f3->at(vert_index) = mSimplifiedVertices[i]->mPosition; mSimplifiedVertices[i]->mSimplifiedIndex = vert_index++; } } // count indices required size_t index_count = 0; for(size_t i=0; i<mSimplifiedTriangles.size(); ++i) index_count += mSimplifiedTriangles[i]->mRemoved ? 0 : 3; // regenerate index buffer ref<DrawElementsUInt> de = new DrawElementsUInt(PT_TRIANGLES); de->indexBuffer()->resize(index_count); DrawElementsUInt::index_type* ptr = de->indexBuffer()->begin(); for(size_t i=0; i<mSimplifiedTriangles.size(); ++i) { if(!mSimplifiedTriangles[i]->mRemoved) { VL_CHECK( !mSimplifiedTriangles[i]->mVertices[0]->mRemoved ) VL_CHECK( !mSimplifiedTriangles[i]->mVertices[1]->mRemoved ) VL_CHECK( !mSimplifiedTriangles[i]->mVertices[2]->mRemoved ) ptr[0] = mSimplifiedTriangles[i]->mVertices[0]->mSimplifiedIndex; ptr[1] = mSimplifiedTriangles[i]->mVertices[1]->mSimplifiedIndex; ptr[2] = mSimplifiedTriangles[i]->mVertices[2]->mSimplifiedIndex; ptr+=3; } } VL_CHECK(ptr == de->indexBuffer()->end()); // output geometry mOutput.push_back( new Geometry ); mOutput.back()->setVertexArray( arr_f3.get() ); mOutput.back()->drawCalls().push_back( de.get() ); } //----------------------------------------------------------------------------- void PolygonSimplifier::clearTrianglesAndVertices() { mSimplifiedVertices.clear(); mSimplifiedTriangles.clear(); mProtectedVerts.clear(); mTriangleLump.clear(); mVertexLump.clear(); } //-----------------------------------------------------------------------------
39.263789
166
0.593599
Abergard
a6654e1f78372c7ac1fb2aabd3a6b2dee5cb7d49
1,835
hpp
C++
include/codegen/include/System/Runtime/Remoting/Channels/CrossAppDomainSink_ProcessMessageRes.hpp
Futuremappermydud/Naluluna-Modifier-Quest
bfda34370764b275d90324b3879f1a429a10a873
[ "MIT" ]
1
2021-11-12T09:29:31.000Z
2021-11-12T09:29:31.000Z
include/codegen/include/System/Runtime/Remoting/Channels/CrossAppDomainSink_ProcessMessageRes.hpp
Futuremappermydud/Naluluna-Modifier-Quest
bfda34370764b275d90324b3879f1a429a10a873
[ "MIT" ]
null
null
null
include/codegen/include/System/Runtime/Remoting/Channels/CrossAppDomainSink_ProcessMessageRes.hpp
Futuremappermydud/Naluluna-Modifier-Quest
bfda34370764b275d90324b3879f1a429a10a873
[ "MIT" ]
2
2021-10-03T02:14:20.000Z
2021-11-12T09:29:36.000Z
// Autogenerated from CppHeaderCreator on 7/27/2020 3:09:49 PM // Created by Sc2ad // ========================================================================= #pragma once #pragma pack(push, 8) // Begin includes #include "utils/typedefs.h" // Including type: System.ValueType #include "System/ValueType.hpp" // Including type: System.Runtime.Remoting.Channels.CrossAppDomainSink #include "System/Runtime/Remoting/Channels/CrossAppDomainSink.hpp" #include "utils/il2cpp-utils.hpp" // Completed includes // Begin forward declares // Forward declaring namespace: System::Runtime::Remoting::Messaging namespace System::Runtime::Remoting::Messaging { // Forward declaring type: CADMethodReturnMessage class CADMethodReturnMessage; } // Completed forward declares // Type namespace: System.Runtime.Remoting.Channels namespace System::Runtime::Remoting::Channels { // Autogenerated type: System.Runtime.Remoting.Channels.CrossAppDomainSink/ProcessMessageRes struct CrossAppDomainSink::ProcessMessageRes : public System::ValueType { public: // public System.Byte[] arrResponse // Offset: 0x0 ::Array<uint8_t>* arrResponse; // public System.Runtime.Remoting.Messaging.CADMethodReturnMessage cadMrm // Offset: 0x8 System::Runtime::Remoting::Messaging::CADMethodReturnMessage* cadMrm; // Creating value type constructor for type: ProcessMessageRes ProcessMessageRes(::Array<uint8_t>* arrResponse_ = {}, System::Runtime::Remoting::Messaging::CADMethodReturnMessage* cadMrm_ = {}) : arrResponse{arrResponse_}, cadMrm{cadMrm_} {} }; // System.Runtime.Remoting.Channels.CrossAppDomainSink/ProcessMessageRes } DEFINE_IL2CPP_ARG_TYPE(System::Runtime::Remoting::Channels::CrossAppDomainSink::ProcessMessageRes, "System.Runtime.Remoting.Channels", "CrossAppDomainSink/ProcessMessageRes"); #pragma pack(pop)
48.289474
182
0.749864
Futuremappermydud
a6680f83a5eea14a545ca6cb857085859bde955c
31,889
cc
C++
Source/Plugins/GraphicsPlugins/BladeTerrain/source/index_generator/OptimizedIndexGenerator.cc
OscarGame/blade
6987708cb011813eb38e5c262c7a83888635f002
[ "MIT" ]
146
2018-12-03T08:08:17.000Z
2022-03-21T06:04:06.000Z
Source/Plugins/GraphicsPlugins/BladeTerrain/source/index_generator/OptimizedIndexGenerator.cc
huangx916/blade
3fa398f4d32215bbc7e292d61e38bb92aad1ee1c
[ "MIT" ]
1
2019-01-18T03:35:49.000Z
2019-01-18T03:36:08.000Z
Source/Plugins/GraphicsPlugins/BladeTerrain/source/index_generator/OptimizedIndexGenerator.cc
huangx916/blade
3fa398f4d32215bbc7e292d61e38bb92aad1ee1c
[ "MIT" ]
31
2018-12-03T10:32:43.000Z
2021-10-04T06:31:44.000Z
/******************************************************************** created: 2013/10/13 filename: OptimizedIndexGenerator.cc author: Crazii purpose: *********************************************************************/ #include <BladePCH.h> #include "OptimizedIndexGenerator.h" #include <interface/public/graphics/IGraphicsResourceManager.h> #include "../TerrainBufferManager.h" namespace Blade { ////////////////////////////////////////////////////////////////////////// TerrainIndexGroup* OptimizedIndexGenerator::createTileIndexBuffer() { size_t BlockSize = TerrainConfigManager::getSingleton().getTerrainBlockSize(); size_t MaxLod = TerrainConfigManager::getSingleton().getMaxLODLevel(); size_t CurLod = TerrainConfigManager::getSingleton().getLODLevel(); IGraphicsResourceManager* GResMan = TerrainConfigManager::getSingleton().getBatchCombiner()->getResourceManager(); IGraphicsBuffer::USAGE GBU = TerrainConfigManager::getSingleton().getBatchCombiner()->getIndexBufferUsage(); size_t MaxBlockIndexCount = 0; TerrainIndexGroup* group = BLADE_NEW TerrainIndexGroup(); group->mBuffers.resize(MaxLod+1, TerrainIndexGroup::DiffBufferList()); mMaxIndexCount.resize(MaxLod+1); size_t IndexCount = BlockSize*BlockSize*3; uint32 IndexStride = 1; const size_t Size = BlockSize + 1; const size_t VertexCount = (Size)*(Size); //get index type IIndexBuffer::EIndexType indexType = IndexBufferHelper::calcIndexType(VertexCount); for( size_t i = 0; i <= CurLod; ++i ) { TerrainIndexGroup::DiffBufferList& LevelBuffer = group->mBuffers[i]; // 2 triangles if( i == MaxLod ) { assert( IndexCount == 3 ); HIBUFFER& indexbuffer = LevelBuffer[0]; size_t count = IndexCount*2; mMaxIndexCount[i] = count; void* ibData = BLADE_TMP_ALLOC(IndexBufferHelper::calcIndexSize(indexType)*count); IndexBufferHelper ibuffer(ibData, indexType); uint32 p1 = (uint32)(BlockSize*Size); uint32 p2 = p1+(uint32)BlockSize; uint32 p3 = (uint32)BlockSize; // 0 p3 // +-------+ // | \ | // | \ | // | \ | // | \ | // | \ | // +-------+ // p1 p2 ibuffer[0] = 0; ibuffer[1] = p1; ibuffer[2] = p2; ibuffer[3] = 0; ibuffer[4] = p2; ibuffer[5] = p3; indexbuffer = GResMan->createIndexBuffer(ibData, indexType, count, GBU); BLADE_TMP_FREE(ibData); for( index_t j = 1; j < 16; ++j) LevelBuffer[j] = LevelBuffer[0]; } else { //build difference adaptive buffer for( index_t diffIdx = 0; diffIdx < 16; ++diffIdx ) { // level default buffer HIBUFFER& indexbuffer = LevelBuffer[diffIdx]; LODDiff diff = LODDiff::generateLODDifference((LOD_DI)diffIdx); size_t diffCount = diff.getDiffSideCount(); //add additional index for extra LOD triangles size_t CurIndexCount = IndexCount + diffCount*3*( (BlockSize/IndexStride)/2 ); if( CurIndexCount > MaxBlockIndexCount ) MaxBlockIndexCount = CurIndexCount; if( CurIndexCount > mMaxIndexCount[i] ) mMaxIndexCount[i] = CurIndexCount; //TotalIndexCount = CurIndexCount; void* ibData = BLADE_TMP_ALLOC(IndexBufferHelper::calcIndexSize(indexType) * CurIndexCount); IndexBufferHelper ibuffer(ibData, indexType); index_t IndexSub = 0; const uint32 RowStride = (uint32)Size*IndexStride*2; const uint32 ColStride = IndexStride*2; const uint32 RowCount = (uint32)(BlockSize/IndexStride)/2; const uint32 ColCount = (uint32)(BlockSize/IndexStride)/2; uint32 RowA = 0; uint32 RowB = RowStride/2; uint32 RowC = RowStride; uint32 Col0 = 0; uint32 Col1 = IndexStride; uint32 Col2 = IndexStride*2; // for( uint32 z = 0; z < RowCount; ++z) { for( uint32 x = 0; x < ColCount; ++x) { // x x+1 // 0 1 2 //A +-------+ // | \ /| // | \ / | //B | + | // | / \ | // | / \ | //C +-------+ if( diff.hasLevelDifference() ) { assert( i != MaxLod ); assert( BlockSize/IndexStride > 1 ); } if( diff.isUpDiff() && z == 0 ) { //add one triangle //0A,1B,1A ibuffer[IndexSub++] = RowA + Col0; ibuffer[IndexSub++] = RowB + Col1; ibuffer[IndexSub++] = RowA + Col1; //1A,1B,2A ibuffer[IndexSub++] = RowA + Col1; ibuffer[IndexSub++] = RowB + Col1; ibuffer[IndexSub++] = RowA + Col2; } else { //0A,1B,2A ibuffer[IndexSub++] = RowA + Col0; ibuffer[IndexSub++] = RowB + Col1; ibuffer[IndexSub++] = RowA + Col2; } if( diff.isLeftDiff() && x == 0 ) { //0A,0B,1B ibuffer[IndexSub++] = RowA + Col0; ibuffer[IndexSub++] = RowB + Col0; ibuffer[IndexSub++] = RowB + Col1; //0B,0C,1B ibuffer[IndexSub++] = RowB + Col0; ibuffer[IndexSub++] = RowC + Col0; ibuffer[IndexSub++] = RowB + Col1; } else { //0A,0C,1B ibuffer[IndexSub++] = RowA + Col0; ibuffer[IndexSub++] = RowC + Col0; ibuffer[IndexSub++] = RowB + Col1; } if( diff.isDownDiff() && z == RowCount -1 ) { //1B,0C,1C ibuffer[IndexSub++] = RowB + Col1; ibuffer[IndexSub++] = RowC + Col0; ibuffer[IndexSub++] = RowC + Col1; //1B,1C,2C ibuffer[IndexSub++] = RowB + Col1; ibuffer[IndexSub++] = RowC + Col1; ibuffer[IndexSub++] = RowC + Col2; } else { //1B,0C,2C ibuffer[IndexSub++] = RowB + Col1; ibuffer[IndexSub++] = RowC + Col0; ibuffer[IndexSub++] = RowC + Col2; } if( diff.isRightDiff() && x == ColCount -1 ) { //2A,1B,2B ibuffer[IndexSub++] = RowA + Col2; ibuffer[IndexSub++] = RowB + Col1; ibuffer[IndexSub++] = RowB + Col2; //1B,2C,2B ibuffer[IndexSub++] = RowB + Col1; ibuffer[IndexSub++] = RowC + Col2; ibuffer[IndexSub++] = RowB + Col2; } else { //2A,1B,2C ibuffer[IndexSub++] = RowA + Col2; ibuffer[IndexSub++] = RowB + Col1; ibuffer[IndexSub++] = RowC + Col2; } Col0 += ColStride; Col1 += ColStride; Col2 += ColStride; } //clear col index Col0 = 0; Col1 = IndexStride; Col2 = IndexStride*2; //move to next row RowA += RowStride; RowB += RowStride; RowC += RowStride; }//for each block assert( IndexSub == CurIndexCount ); indexbuffer = GResMan->createIndexBuffer(ibData, indexType, CurIndexCount, GBU); BLADE_TMP_FREE(ibData); }// for each diff level }////build difference adaptive buffer IndexCount /= 4; IndexStride *= 2; }//for each LOD level // TERRAIN_INFO info = TerrainConfigManager::getSingleton().getTerrainInfo(); info.mMaxBlockIndexCount = MaxBlockIndexCount; TerrainConfigManager::getSingleton().updateGlobalTerrainInfo(info); return group; } ////////////////////////////////////////////////////////////////////////// TerrainQueryIndexGroup* OptimizedIndexGenerator::createBlockQueryIndexBuffer() { size_t BlockSize = TerrainConfigManager::getSingleton().getTerrainBlockSize(); size_t MaxLod = TerrainConfigManager::getSingleton().getMaxLODLevel(); //size_t CurLod = TerrainConfigManager::getSingleton().getLODLevel(); IGraphicsResourceManager* GResMan = IGraphicsResourceManager::getOtherSingletonPtr(BTString("Software")); TerrainQueryIndexGroup* group = BLADE_NEW TerrainQueryIndexGroup(MaxLod); group->mBuffers.resize(MaxLod+1,TerrainIndexGroup::DiffBufferList()); size_t IndexCount = BlockSize*BlockSize*3; uint32 IndexStride = 1; const size_t Size = BlockSize + 1; const size_t VertexCount = (Size)*(Size); //get index type IIndexBuffer::EIndexType indexType = IndexBufferHelper::calcIndexType(VertexCount); //the top 2 level is simple and could use the Hardware index buffer instead, //so we don't build query buffer for the highest 2 levels for( size_t i = 0; i < MaxLod; ++i ) { TerrainIndexGroup::DiffBufferList& LevelBuffer = group->mBuffers[i]; //build difference adaptive buffer for( index_t diffIdx = 0; diffIdx < 16; ++diffIdx ) { // level default buffer HIBUFFER& indexbuffer = LevelBuffer[diffIdx]; LODDiff diff = LODDiff::generateLODDifference((LOD_DI)diffIdx); size_t diffCount = diff.getDiffSideCount(); //add additional index for extra LOD triangles size_t CurIndexCount = IndexCount + diffCount*3*( (BlockSize/IndexStride)/2 ); void* ibData = BLADE_TMP_ALLOC(IndexBufferHelper::calcIndexSize(indexType) * CurIndexCount); IndexBufferHelper ibuffer(ibData, indexType); const uint32 RowStride = (uint32)Size*IndexStride*2; const uint32 ColStride = IndexStride*2; const uint32 RowCount = (uint32)(BlockSize/IndexStride)/2; const uint32 ColCount = (uint32)(BlockSize/IndexStride)/2; SQueryIndexData data(ibuffer); data.LODLevel = i; data.ColCount = ColCount; data.RowCount = RowCount; data.RowStride = RowStride; data.ColStride = ColStride; data.Diff = diff; data.DiffIndex = (LOD_DI)diffIdx; data.IndexCount = 0; #ifdef DEBUG_DEPTH this->buildQueryIndex(MaxLod-i,0,0,RowCount,group->mQueryQuads[i],data); #else this->buildQueryIndex(0,0,RowCount,group->mQueryQuads[i],data); #endif assert( data.IndexCount == CurIndexCount ); indexbuffer = GResMan->createIndexBuffer(ibData, indexType, CurIndexCount, IGraphicsBuffer::GBU_STATIC); BLADE_TMP_FREE(ibData); }////build difference adaptive buffer IndexCount /= 4; IndexStride *= 2; }//for each LOD level //manual build for max LOD { TerrainIndexGroup::DiffBufferList& LevelBuffer = group->mBuffers[MaxLod]; HIBUFFER& indexbuffer = LevelBuffer[0]; void* ibData = BLADE_TMP_ALLOC(IndexBufferHelper::calcIndexSize(indexType) * 6); IndexBufferHelper ibuffer(ibData , indexType); uint32 p1 = (uint32)(BlockSize*Size); uint32 p2 = p1+(uint32)BlockSize; uint32 p3 = (uint32)BlockSize; // 0 p3 // +-------+ // | \ | // | \ | // | \ | // | \ | // | \ | // +-------+ // p1 p2 ibuffer[0] = 0; ibuffer[1] = p1; ibuffer[2] = p2; ibuffer[3] = 0; ibuffer[4] = p2; ibuffer[5] = p3; indexbuffer = GResMan->createIndexBuffer(ibData, indexType, 6, IGraphicsBuffer::GBU_STATIC); BLADE_TMP_FREE(ibData); for( index_t i = 1; i < 16; ++i) LevelBuffer[i] = LevelBuffer[0]; for( index_t diffIdx = 0; diffIdx < 16; ++diffIdx ) { group->mQueryQuads[MaxLod]->mIndicesByLODDiff[diffIdx].mStartIndex = 0; group->mQueryQuads[MaxLod]->mIndicesByLODDiff[diffIdx].mTriangleCount = 2; } } return group; } ////////////////////////////////////////////////////////////////////////// TerrainFixedIndexGroup* OptimizedIndexGenerator::createFixedIndexBuffer() { TerrainConfigManager& tcm = TerrainConfigManager::getSingleton(); ILODComparator* cmp = this; size_t flatLOD = tcm.getFlatLODLevel(); size_t cliffLOD = tcm.getCliffLODLevel(); size_t LODs[] = { cliffLOD, flatLOD, }; size_t BlockSize = tcm.getTerrainBlockSize(); const size_t Size = BlockSize + 1; const size_t VertexCount = (Size)*(Size); IIndexBuffer::EIndexType indexType = IndexBufferHelper::calcIndexType(VertexCount); IGraphicsResourceManager* GResMan = tcm.getBatchCombiner()->getResourceManager(); IGraphicsBuffer::USAGE GBU = TerrainConfigManager::getSingleton().getBatchCombiner()->getIndexBufferUsage(); TerrainFixedIndexGroup* group = BLADE_NEW TerrainFixedIndexGroup(); index_t curLOD = tcm.getLODLevel(); index_t maxLOD = tcm.getMaxLODLevel(); for (size_t i = 0; i < countOf(LODs); ++i) { index_t LOD = LODs[i]; assert(LOD > 0 && LOD <= curLOD); TerrainFixedIndexGroup::LODBuffer& buffer = (LOD == tcm.getCliffLODLevel()) ? group->mCliffBuffer : group->mFlatBuffer; size_t maxDiff = (size_t)std::max(std::abs(int(0 - LOD)), std::abs(int(curLOD - LOD))); size_t IndexCount = BlockSize * BlockSize * 3; uint32 IndexStride = 1u << std::min(LOD, tcm.getMaxLODLevel()-1); //max LOD is 2 triangle2 that cannot break, use max LOD-1 uint32 diffCount = (uint32)(4u * maxDiff); //4 sides size_t maxIndexCount = IndexCount + diffCount * 3 * ((BlockSize / IndexStride) / 2); for (index_t l = 0; l <= curLOD; ++l) { for (index_t t = 0; t <= curLOD; ++t) { for (index_t r = 0; r <= curLOD; ++r) { for (index_t b = 0; b <= curLOD; ++b) { indexdiff_t ldiff = cmp->compareLOD(l, LOD); indexdiff_t tdiff = cmp->compareLOD(t, LOD); indexdiff_t rdiff = cmp->compareLOD(r, LOD); indexdiff_t bdiff = cmp->compareLOD(b, LOD); FixedLODDiff diff((int8)ldiff, (int8)tdiff, (int8)rdiff, (int8)bdiff); if (!diff.isValid()) continue; HIBUFFER& indexBuffer = buffer[diff]; if (LOD == flatLOD) { if (LOD == maxLOD) { if (ldiff > 0) ldiff -= 1; if (tdiff > 0) tdiff -= 1; if (rdiff > 0) rdiff -= 1; if (bdiff > 0) bdiff -= 1; } if (ldiff == -1) ldiff = 0; if (tdiff == -1) tdiff = 0; if (rdiff == -1) rdiff = 0; if (bdiff == -1) bdiff = 0; diff = FixedLODDiff((int8)ldiff, (int8)tdiff, (int8)rdiff, (int8)bdiff); } TempBuffer tempIBuffer; tempIBuffer.reserve(maxIndexCount); //reserve enough space IndexBufferHelper ibuffer(tempIBuffer.getData(), indexType); const uint32 RowStride = (uint32)Size*IndexStride * 2; const uint32 ColStride = IndexStride * 2; const uint32 RowCount = (uint32)(BlockSize / IndexStride) / 2; const uint32 ColCount = (uint32)(BlockSize / IndexStride) / 2; index_t IndexSub = 0; { uint32 RowA = 0; uint32 RowB = RowStride / 2; uint32 RowC = RowStride; uint32 Col0 = 0; uint32 Col1 = ColStride / 2; uint32 Col2 = ColStride; // x x+1 // 0 1 2 //A +-------+ // | \ /| // | \ / | //B | + | // | / \ | // | / \ | //C +-------+ for (uint32 z = 0; z < RowCount; ++z) { for (uint32 x = 0; x < ColCount; ++x) { //0A,1B,2A if ((z != 0 || diff.t == 0) && (x != 0 || diff.l > -1) && (x != ColCount-1 || diff.r > -1) && (z != RowCount-1 || diff.b > -1)) { ibuffer[IndexSub++] = RowA + Col0; ibuffer[IndexSub++] = RowB + Col1; ibuffer[IndexSub++] = RowA + Col2; } //0A,0C,1B if ((x != 0 || diff.l == 0) && (z != 0 || diff.t > -1) && (z != RowCount-1 || diff.b > -1) && (x != ColCount - 1 || diff.r > -1)) { ibuffer[IndexSub++] = RowA + Col0; ibuffer[IndexSub++] = RowC + Col0; ibuffer[IndexSub++] = RowB + Col1; } //1B,0C,2C if ((z != RowCount-1 || diff.b == 0) && (x != 0 || diff.l > -1) && (x != ColCount-1 || diff.r > -1) && (z != 0 || diff.t > -1)) { ibuffer[IndexSub++] = RowB + Col1; ibuffer[IndexSub++] = RowC + Col0; ibuffer[IndexSub++] = RowC + Col2; } //2A,1B,2C if ((x != ColCount - 1 || diff.r == 0) && (z != 0 || diff.t > -1) && (z != RowCount-1 || diff.b > -1) && (x != 0 || diff.l > -1)) { ibuffer[IndexSub++] = RowA + Col2; ibuffer[IndexSub++] = RowB + Col1; ibuffer[IndexSub++] = RowC + Col2; } Col0 += ColStride; Col1 += ColStride; Col2 += ColStride; } //clear col index Col0 = 0; Col1 = IndexStride; Col2 = IndexStride * 2; //move to next row RowA += RowStride; RowB += RowStride; RowC += RowStride; }//for inner triangles } //left side { uint32 leftRowStride = ldiff < 0 ? RowStride << (-ldiff) : RowStride >> (ldiff); if (ldiff >= 1) { uint32 Col0 = 0; uint32 Col1 = ColStride / 2; for (uint32 z = 0; z < RowCount; ++z) { uint32 Row0 = z * RowStride; uint32 Row1 = Row0 + RowStride / 2; for (uint32 z1 = 0; z1 < (1u << ldiff); ++z1) { ibuffer[IndexSub++] = Row0 + z1 * leftRowStride + Col0; ibuffer[IndexSub++] = Row0 + (z1 + 1) * leftRowStride + Col0; ibuffer[IndexSub++] = Row1 + Col1; } } } else if (ldiff <= -1) { uint32 leftRowCount = RowCount >> (-ldiff); if (leftRowCount == 0)//hard fix for max(min detail) LOD level (2 triangles) { leftRowCount = 1; leftRowStride = RowStride*RowCount; } uint32 Col0 = 0; uint32 Col1 = ColStride; for (uint32 n = 0; n < leftRowCount; ++n) { uint32 Row0 = leftRowStride * n; uint32 Row1 = Row0 + leftRowStride/2; uint32 Row2 = Row0 + leftRowStride; for (uint32 z1 = (n == 0 && tdiff <= -1) ? RowStride : Row0; z1 < Row1; z1 += RowStride) { ibuffer[IndexSub++] = Row0 + Col0; ibuffer[IndexSub++] = (z1 + RowStride) + Col1; ibuffer[IndexSub++] = z1 + Col1; } for (uint32 z1 = (n == leftRowCount -1 && bdiff <= -1) ? (RowCount - 1)*RowStride : Row2; z1 > Row1; z1 -= RowStride) { ibuffer[IndexSub++] = Row2 + Col0; ibuffer[IndexSub++] = z1 + Col1; ibuffer[IndexSub++] = (z1 - RowStride) + Col1; } ibuffer[IndexSub++] = Row0 + Col0; ibuffer[IndexSub++] = Row2 + Col0; ibuffer[IndexSub++] = Row1 + Col1; } } } //top side { uint32 topColStride = tdiff < 0 ? ColStride << (-tdiff) : ColStride >> (tdiff); if (tdiff >= 1) { uint32 Row0 = 0; uint32 Row1 = RowStride / 2; for (uint32 x = 0; x < ColCount; ++x) { uint32 Col0 = x * ColStride; uint32 Col1 = Col0 + ColStride / 2; for (uint32 x1 = 0; x1 < (1u << tdiff); ++x1) { ibuffer[IndexSub++] = Row0 + Col0 + x1 * topColStride; ibuffer[IndexSub++] = Row1 + Col1; ibuffer[IndexSub++] = Row0 + Col0 + (x1 + 1) * topColStride; } } } else if (tdiff <= -1) { uint32 topColCount = ColCount >> (-tdiff); if (topColCount == 0)//hard fix for max LOD level (2 triangles) { topColCount = 1; topColStride = ColStride*ColCount; } uint32 Row0 = 0; uint32 Row1 = RowStride; for (uint32 n = 0; n < topColCount; ++n) { uint32 Col0 = n * topColStride; uint32 Col1 = Col0 + topColStride / 2; uint32 Col2 = Col0 + topColStride; for (uint32 x1 = (n == 0 && ldiff <= -1) ? ColStride : Col0; x1 < Col1; x1 += ColStride) { ibuffer[IndexSub++] = Row0 + Col0; ibuffer[IndexSub++] = Row1 + x1; ibuffer[IndexSub++] = Row1 + (x1 + ColStride); } for (uint32 x1 = (n == topColCount-1 && rdiff <= -1) ? (ColCount - 1)*ColStride : Col2; x1 > Col1; x1 -= ColStride) { ibuffer[IndexSub++] = Row0 + Col2; ibuffer[IndexSub++] = Row1 + (x1 - ColStride); ibuffer[IndexSub++] = Row1 + x1; } ibuffer[IndexSub++] = Row0 + Col0; ibuffer[IndexSub++] = Row1 + Col1; ibuffer[IndexSub++] = Row0 + Col2; } } } //right side (triangle winding order diff from left side) { uint32 rightRowStride = rdiff < 0 ? RowStride << (-rdiff) : RowStride >> (rdiff); if (rdiff >= 1) { uint32 Col0 = (ColCount-1) * ColStride + ColStride / 2; uint32 Col1 = Col0 + ColStride / 2; for (uint32 z = 0; z < RowCount; ++z) { uint32 Row0 = z * RowStride; uint32 Row1 = Row0 + RowStride / 2; for (uint32 z1 = 0; z1 < (1u << rdiff); ++z1) { ibuffer[IndexSub++] = Row0 + z1 * rightRowStride + Col1; ibuffer[IndexSub++] = Row1 + Col0; ibuffer[IndexSub++] = Row0 + (z1 + 1) * rightRowStride + Col1; } } } else if (rdiff <= -1) { uint32 rightRowCount = RowCount >> (-rdiff); if (rightRowCount == 0)//hard fix for max LOD level (2 triangles) { rightRowCount = 1; rightRowStride = RowStride*RowCount; } uint32 Col0 = (ColCount - 1) * ColStride; uint32 Col1 = Col0+ColStride; for (uint32 n = 0; n < rightRowCount; ++n) { uint32 Row0 = rightRowStride * n; uint32 Row1 = Row0 + rightRowStride / 2; uint32 Row2 = Row0 + rightRowStride; for (uint32 z1 = (n == 0 && tdiff <= -1) ? RowStride : Row0; z1 < Row1; z1 += RowStride) { ibuffer[IndexSub++] = Row0 + Col1; ibuffer[IndexSub++] = z1 + Col0; ibuffer[IndexSub++] = (z1 + RowStride) + Col0; } for (uint32 z1 = (n == rightRowCount-1 && bdiff <= -1) ? (RowCount - 1)*RowStride : Row2; z1 > Row1; z1 -= RowStride) { ibuffer[IndexSub++] = Row2 + Col1; ibuffer[IndexSub++] = (z1 - RowStride) + Col0; ibuffer[IndexSub++] = z1 + Col0; } ibuffer[IndexSub++] = Row0 + Col1; ibuffer[IndexSub++] = Row1 + Col0; ibuffer[IndexSub++] = Row2 + Col1; } } } //bottom side { uint32 bottomColStride = bdiff < 0 ? ColStride << (-bdiff) : ColStride >> (bdiff); if (bdiff >= 1) { uint32 Row0 = (RowCount - 1) * RowStride + RowStride / 2; uint32 Row1 = Row0 + RowStride/2; for (uint32 x = 0; x < ColCount; ++x) { uint32 Col0 = x * ColStride; uint32 Col1 = Col0 + ColStride / 2; for (uint32 x1 = 0; x1 < (1u << bdiff); ++x1) { ibuffer[IndexSub++] = Row1 + Col0 + x1 * bottomColStride; ibuffer[IndexSub++] = Row1 + Col0 + (x1 + 1) * bottomColStride; ibuffer[IndexSub++] = Row0 + Col1; } } } else if (bdiff <= -1) { uint32 bottomColCount = ColCount >> (-bdiff); if (bottomColCount == 0)//hard fix for max LOD level (2 triangles) { bottomColCount = 1; bottomColStride = ColStride*ColCount; } uint32 Row0 = (RowCount - 1) * RowStride; uint32 Row1 = Row0 + RowStride; for (uint32 n = 0; n < bottomColCount; ++n) { uint32 Col0 = n * bottomColStride; uint32 Col1 = Col0 + bottomColStride / 2; uint32 Col2 = Col0 + bottomColStride; for (uint32 x1 = (n == 0 && ldiff <= -1) ? ColStride : Col0; x1 < Col1; x1 += ColStride) { ibuffer[IndexSub++] = Row1 + Col0; ibuffer[IndexSub++] = Row0 + (x1 + ColStride); ibuffer[IndexSub++] = Row0 + x1; } for (uint32 x1 = (n == bottomColCount-1 && rdiff <= -1) ? (ColCount - 1)*ColStride : Col2; x1 > Col1; x1 -= ColStride) { ibuffer[IndexSub++] = Row1 + Col2; ibuffer[IndexSub++] = Row0 + x1; ibuffer[IndexSub++] = Row0 + (x1 - ColStride); } ibuffer[IndexSub++] = Row1 + Col0; ibuffer[IndexSub++] = Row1 + Col2; ibuffer[IndexSub++] = Row0 + Col1; } } } assert(IndexSub <= maxIndexCount); indexBuffer = GResMan->createIndexBuffer(tempIBuffer.getData(), indexType, IndexSub, GBU); }// } } } } return group; } ////////////////////////////////////////////////////////////////////////// int16 OptimizedIndexGenerator::getLowLODHeight(const int16* tileHeightaMap, size_t& LOD, index_t blockX, index_t blockZ, index_t x, index_t z) const { LOD = 0; if( (x % 2 == 1 || z % 2 == 1) && !(x % 2 == 1 && z % 2 == 1) ) //optimized index has no odd points, skip return 0; const size_t BlockSize = TerrainConfigManager::getSingleton().getTerrainBlockSize(); //const size_t blockPerSide = TerrainConfigManager::getSingleton().getBlocksPerTileSide(); const size_t TileSize = TerrainConfigManager::getSingleton().getTerrainTileSize(); const size_t SourceSize = TileSize + 1; const int16* blockVPos = tileHeightaMap + (blockZ*BlockSize/*+z*/)*SourceSize + blockX*BlockSize/*+x*/; LOD = TerrainConfigManager::getSingleton().getMaxLODLevel()-1; if( (x == 0 || x == BlockSize ) && (z == 0 || z == BlockSize) ) return blockVPos[z*SourceSize+x]; else if(x == BlockSize/2 && z == BlockSize/2) //lowest LOD level: (p0+p2)/2 return ((int32)blockVPos[0] + (int32)blockVPos[BlockSize*SourceSize+BlockSize])/2; size_t quadSize = BlockSize; index_t quadTop = 0; index_t quadBottom = BlockSize; index_t quadLeft = 0; index_t quadRight = BlockSize; bool cornerLeft = true; bool cornerTop = true; while( quadSize > 2 ) { --LOD; assert( (int)LOD >= 0 ); assert( quadSize > 4 || LOD == 0); assert( quadRight - quadLeft == quadSize ); assert( quadBottom - quadTop == quadSize ); // A // +-------+-------+ // | \ /| / | // | \ / | / | // | E+ | / | // | / \ | / | // | / \ | / | // D +-------+ +B // | / \ | // | / \ | // | / \ | // | / \ | // | / \ | // +-------+-------+ // C //top/bottom border center point (A,C) if( x == quadLeft+quadSize/2 && (z == quadTop || z == quadBottom) ) return ((int32)((int32)blockVPos[z*SourceSize+quadLeft] + (int32)blockVPos[z*SourceSize+quadRight]))/2; //left/right border center point (B,D) if( z == quadTop+quadSize/2 && (x == quadLeft || x == quadRight) ) return ((int32)((int32)blockVPos[quadTop*SourceSize+x] + (int32)blockVPos[quadBottom*SourceSize+x]))/2; if( x < quadLeft+quadSize/2 ) { quadRight -= quadSize/2; cornerLeft = true; } else { quadLeft += quadSize/2; cornerLeft = false; } if( z < quadTop+quadSize/2 ) { quadBottom -= quadSize/2; cornerTop = true; } else { quadTop += quadSize/2; cornerTop = false; } //center point of next level quad (E) if( (x == quadLeft+quadSize/4 || x == quadLeft+quadSize/4*3) && (z == quadTop+quadSize/4 || z == quadTop+quadSize/4*3) ) { if( (cornerLeft && cornerTop) || (!cornerLeft && !cornerTop) ) return ((int32)((int32)blockVPos[(z-quadSize/4)*SourceSize+(x-quadSize/4)] + (int32)blockVPos[(z+quadSize/4)*SourceSize+(x+quadSize/4)]))/2; else return ((int32)((int32)blockVPos[(z-quadSize/4)*SourceSize+(x+quadSize/4)] + (int32)blockVPos[(z+quadSize/4)*SourceSize+(x-quadSize/4)]))/2; } quadSize /= 2; } assert(false); return 0; } ////////////////////////////////////////////////////////////////////////// #if BLADE_DEBUG && DEBUG_DEPTH void OptimizedIndexGenerator::buildQueryIndex(size_t depth,size_t x,size_t z,size_t size,QueryIndexQuad* quad,const SQueryIndexData& data) #else void OptimizedIndexGenerator::buildQueryIndex(size_t x,size_t z,size_t size,QueryIndexQuad* quad,const SQueryIndexData& data) #endif { size_t& IndexSub = data.IndexCount; IndexBufferHelper& ib = data.IndexBuffer; assert(quad != NULL ); #if BLADE_DEBUG && DEBUG_DEPTH if( depth == 1 ) //final { //minimal block assert(size == 1 ); #else if( size == 1) { #endif //all null assert(quad->mSubQuad == NULL ); SQueryIndices& indices = quad->mIndicesByLODDiff[data.DiffIndex]; indices.mStartIndex = (uint16)IndexSub; indices.mTriangleCount = 0; uint32 RowA = uint32(z * data.RowStride); uint32 RowB = RowA + data.RowStride/2; uint32 RowC = RowA + data.RowStride; uint32 Col0 = uint32(x * data.ColStride); uint32 Col1 = Col0 + data.ColStride/2; uint32 Col2 = Col0 + data.ColStride; if( data.Diff.isUpDiff() && z == 0 ) { //add one triangle //0A,1B,1A ib[IndexSub++] = RowA + Col0; ib[IndexSub++] = RowB + Col1; ib[IndexSub++] = RowA + Col1; //1A,1B,2A ib[IndexSub++] = RowA + Col1; ib[IndexSub++] = RowB + Col1; ib[IndexSub++] = RowA + Col2; indices.mTriangleCount += 2; } else { //0A,1B,2A ib[IndexSub++] = RowA + Col0; ib[IndexSub++] = RowB + Col1; ib[IndexSub++] = RowA + Col2; indices.mTriangleCount += 1; } if( data.Diff.isLeftDiff() && x == 0 ) { //0A,0B,1B ib[IndexSub++] = RowA + Col0; ib[IndexSub++] = RowB + Col0; ib[IndexSub++] = RowB + Col1; //0B,0C,1B ib[IndexSub++] = RowB + Col0; ib[IndexSub++] = RowC + Col0; ib[IndexSub++] = RowB + Col1; indices.mTriangleCount += 2; } else { //0A,0C,1B ib[IndexSub++] = RowA + Col0; ib[IndexSub++] = RowC + Col0; ib[IndexSub++] = RowB + Col1; indices.mTriangleCount += 1; } if( data.Diff.isDownDiff() && z == data.RowCount -1 ) { //1B,0C,1C ib[IndexSub++] = RowB + Col1; ib[IndexSub++] = RowC + Col0; ib[IndexSub++] = RowC + Col1; //1B,1C,2C ib[IndexSub++] = RowB + Col1; ib[IndexSub++] = RowC + Col1; ib[IndexSub++] = RowC + Col2; indices.mTriangleCount += 2; } else { //1B,0C,2C ib[IndexSub++] = RowB + Col1; ib[IndexSub++] = RowC + Col0; ib[IndexSub++] = RowC + Col2; indices.mTriangleCount += 1; } if( data.Diff.isRightDiff() && x == data.ColCount -1 ) { //2A,1B,2B ib[IndexSub++] = RowA + Col2; ib[IndexSub++] = RowB + Col1; ib[IndexSub++] = RowB + Col2; //1B,2C,2B ib[IndexSub++] = RowB + Col1; ib[IndexSub++] = RowC + Col2; ib[IndexSub++] = RowB + Col2; indices.mTriangleCount += 2; } else { //2A,1B,2C ib[IndexSub++] = RowA + Col2; ib[IndexSub++] = RowB + Col1; ib[IndexSub++] = RowC + Col2; indices.mTriangleCount += 1; } } else { size_t subSize = size/2; #if BLADE_DEBUG && DEBUG_DEPTH buildQueryIndex(depth-1,x ,z ,subSize,quad->mSubQuad[0],data); buildQueryIndex(depth-1,x+subSize ,z ,subSize,quad->mSubQuad[1],data); buildQueryIndex(depth-1,x ,z+subSize ,subSize,quad->mSubQuad[2],data); buildQueryIndex(depth-1,x+subSize ,z+subSize ,subSize,quad->mSubQuad[3],data); #else buildQueryIndex(x ,z ,subSize,&quad->mSubQuad[0],data); buildQueryIndex(x+subSize ,z ,subSize,&quad->mSubQuad[1],data); buildQueryIndex(x ,z+subSize ,subSize,&quad->mSubQuad[2],data); buildQueryIndex(x+subSize ,z+subSize ,subSize,&quad->mSubQuad[3],data); #endif SQueryIndices& indices = quad->mIndicesByLODDiff[data.DiffIndex]; indices.mStartIndex = quad->mSubQuad[0].mIndicesByLODDiff[data.DiffIndex].mStartIndex; indices.mTriangleCount = 0; for(size_t i = 0; i < 4; ++i) indices.mTriangleCount += quad->mSubQuad[i].mIndicesByLODDiff[data.DiffIndex].mTriangleCount; } } }//namespace Blade
30.810628
145
0.547901
OscarGame
a66ad462e19fabad3e4659b26ada9db290f4c8a9
10,561
cpp
C++
src/library/tactic/apply_tactic.cpp
javra/lean
cc70845332e63a1f1be21dc1f96d17269fc85909
[ "Apache-2.0" ]
130
2016-12-02T22:46:10.000Z
2022-03-22T01:09:48.000Z
src/library/tactic/apply_tactic.cpp
soonhokong/lean
38607e3eb57f57f77c0ac114ad169e9e4262e24f
[ "Apache-2.0" ]
8
2017-05-03T01:21:08.000Z
2020-02-25T11:38:05.000Z
src/library/tactic/apply_tactic.cpp
soonhokong/lean
38607e3eb57f57f77c0ac114ad169e9e4262e24f
[ "Apache-2.0" ]
28
2016-12-02T22:46:20.000Z
2022-03-18T21:28:20.000Z
/* Copyright (c) 2013-2014 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Author: Leonardo de Moura */ #include <utility> #include "util/lazy_list_fn.h" #include "util/sstream.h" #include "util/name_map.h" #include "util/sexpr/option_declarations.h" #include "kernel/for_each_fn.h" #include "kernel/replace_fn.h" #include "kernel/instantiate.h" #include "kernel/abstract.h" #include "kernel/error_msgs.h" #include "kernel/type_checker.h" #include "library/reducible.h" #include "library/unifier.h" #include "library/occurs.h" #include "library/constants.h" #include "library/type_util.h" #include "library/class_instance_resolution.h" #include "library/tactic/expr_to_tactic.h" #include "library/tactic/apply_tactic.h" #ifndef LEAN_DEFAULT_APPLY_CLASS_INSTANCE #define LEAN_DEFAULT_APPLY_CLASS_INSTANCE true #endif namespace lean { static name * g_apply_class_instance = nullptr; bool get_apply_class_instance(options const & opts) { return opts.get_bool(*g_apply_class_instance, LEAN_DEFAULT_APPLY_CLASS_INSTANCE); } /** \brief Given a sequence metas: <tt>(?m_1 ...) (?m_2 ... ) ... (?m_k ...)</tt>, we say ?m_i is "redundant" if it occurs in the type of some ?m_j. This procedure removes from metas any redundant element. */ static void remove_redundant_metas(buffer<expr> & metas) { buffer<expr> mvars; for (expr const & m : metas) mvars.push_back(get_app_fn(m)); unsigned k = 0; for (unsigned i = 0; i < metas.size(); i++) { bool found = false; for (unsigned j = 0; j < metas.size(); j++) { if (j != i) { if (occurs(mvars[i], mlocal_type(mvars[j]))) { found = true; break; } } } if (!found) { metas[k] = metas[i]; k++; } } metas.shrink(k); } enum subgoals_action_kind { IgnoreSubgoals, AddRevSubgoals, AddSubgoals, AddAllSubgoals }; enum add_meta_kind { DoNotAdd, AddDiff, AddAll }; static proof_state_seq apply_tactic_core(environment const & env, io_state const & ios, proof_state const & s, expr const & _e, buffer<constraint> & cs, add_meta_kind add_meta, subgoals_action_kind subgoals_action, optional<unifier_kind> const & uk = optional<unifier_kind>()) { goals const & gs = s.get_goals(); if (empty(gs)) { throw_no_goal_if_enabled(s); return proof_state_seq(); } bool class_inst = get_apply_class_instance(ios.get_options()); std::shared_ptr<type_checker> tc(mk_type_checker(env)); goal g = head(gs); goals tail_gs = tail(gs); expr t = g.get_type(); expr e = _e; auto e_t_cs = tc->infer(e); e_t_cs.second.linearize(cs); expr e_t = e_t_cs.first; buffer<expr> metas; old_local_context ctx; bool initialized_ctx = false; unifier_config cfg(ios.get_options()); if (uk) cfg.m_kind = *uk; if (add_meta != DoNotAdd) { unsigned num_e_t = get_expect_num_args(*tc, e_t); if (add_meta == AddDiff) { unsigned num_t = get_expect_num_args(*tc, t); if (num_t <= num_e_t) num_e_t -= num_t; else num_e_t = 0; } else { lean_assert(add_meta == AddAll); } for (unsigned i = 0; i < num_e_t; i++) { auto e_t_cs = tc->whnf(e_t); e_t_cs.second.linearize(cs); e_t = e_t_cs.first; expr meta; if (class_inst && binding_info(e_t).is_inst_implicit()) { if (!initialized_ctx) { ctx = g.to_local_context(); initialized_ctx = true; } bool use_local_insts = true; bool is_strict = false; auto mc = mk_class_instance_elaborator( env, ios, ctx, optional<name>(), use_local_insts, is_strict, some_expr(head_beta_reduce(binding_domain(e_t))), e.get_tag(), nullptr); meta = mc.first; cs.push_back(mc.second); } else { meta = g.mk_meta(mk_fresh_name(), head_beta_reduce(binding_domain(e_t))); } e = mk_app(e, meta); e_t = instantiate(binding_body(e_t), meta); metas.push_back(meta); } } pair<bool, constraint_seq> dcs = tc->is_def_eq(t, e_t); if (!dcs.first) { throw_tactic_exception_if_enabled(s, [=](formatter const & fmt) { format r = format("invalid 'apply' tactic, failed to unify"); r += pp_indent_expr(fmt, t); r += compose(line(), format("with")); r += pp_indent_expr(fmt, e_t); return r; }); return proof_state_seq(); } dcs.second.linearize(cs); unify_result_seq rseq = unify(env, cs.size(), cs.data(), s.get_subst(), cfg); list<expr> meta_lst = to_list(metas.begin(), metas.end()); return map2<proof_state>(rseq, [=](pair<substitution, constraints> const & p) -> proof_state { substitution const & subst = p.first; constraints const & postponed = p.second; substitution new_subst = subst; expr new_e = new_subst.instantiate_all(e); assign(new_subst, g, new_e); goals new_gs = tail_gs; if (subgoals_action != IgnoreSubgoals) { buffer<expr> metas; for (auto m : meta_lst) { if (!new_subst.is_assigned(get_app_fn(m))) metas.push_back(m); } if (subgoals_action == AddRevSubgoals) { for (unsigned i = 0; i < metas.size(); i++) new_gs = cons(goal(metas[i], new_subst.instantiate_all(tc->infer(metas[i]).first)), new_gs); } else { lean_assert(subgoals_action == AddSubgoals || subgoals_action == AddAllSubgoals); if (subgoals_action == AddSubgoals) remove_redundant_metas(metas); unsigned i = metas.size(); while (i > 0) { --i; new_gs = cons(goal(metas[i], new_subst.instantiate_all(tc->infer(metas[i]).first)), new_gs); } } } return proof_state(s, new_gs, new_subst, postponed); }); } proof_state_seq apply_tactic_core(environment const & env, io_state const & ios, proof_state const & s, expr const & e, constraint_seq const & cs) { buffer<constraint> tmp_cs; cs.linearize(tmp_cs); return apply_tactic_core(env, ios, s, e, tmp_cs, AddDiff, AddSubgoals); } proof_state_seq fapply_tactic_core(environment const & env, io_state const & ios, proof_state const & s, expr const & e, constraint_seq const & cs) { buffer<constraint> tmp_cs; cs.linearize(tmp_cs); return apply_tactic_core(env, ios, s, e, tmp_cs, AddDiff, AddAllSubgoals); } tactic apply_tactic_core(expr const & e, constraint_seq const & cs) { return tactic([=](environment const & env, io_state const & ios, proof_state const & s) { return apply_tactic_core(env, ios, s, e, cs); }); } tactic apply_tactic_core(elaborate_fn const & elab, expr const & e, add_meta_kind add_meta, subgoals_action_kind k) { return tactic([=](environment const & env, io_state const & ios, proof_state const & s) { goals const & gs = s.get_goals(); if (empty(gs)) { throw_no_goal_if_enabled(s); return proof_state_seq(); } goal const & g = head(gs); expr new_e; substitution new_subst; constraints cs_; try { auto ecs = elab(g, ios.get_options(), e, none_expr(), s.get_subst(), false); std::tie(new_e, new_subst, cs_) = ecs; buffer<constraint> cs; to_buffer(cs_, cs); to_buffer(s.get_postponed(), cs); proof_state new_s(s, new_subst, constraints()); return apply_tactic_core(env, ios, new_s, new_e, cs, add_meta, k); } catch (exception &) { if (s.report_failure()) throw; else return proof_state_seq(); } }); } tactic apply_tactic(elaborate_fn const & elab, expr const & e) { return apply_tactic_core(elab, e, AddDiff, AddSubgoals); } tactic fapply_tactic(elaborate_fn const & elab, expr const & e) { return apply_tactic_core(elab, e, AddDiff, AddAllSubgoals); } tactic eapply_tactic(elaborate_fn const & elab, expr const & e) { return apply_tactic_core(elab, e, AddAll, AddSubgoals); } void initialize_apply_tactic() { g_apply_class_instance = new name{"apply", "class_instance"}; register_bool_option(*g_apply_class_instance, LEAN_DEFAULT_APPLY_CLASS_INSTANCE, "(apply tactic) if true apply tactic uses class-instances " "resolution for instance implicit arguments"); register_tac(get_tactic_apply_name(), [](type_checker &, elaborate_fn const & fn, expr const & e, pos_info_provider const *) { check_tactic_expr(app_arg(e), "invalid 'apply' tactic, invalid argument"); return apply_tactic(fn, get_tactic_expr_expr(app_arg(e))); }); register_tac(get_tactic_eapply_name(), [](type_checker &, elaborate_fn const & fn, expr const & e, pos_info_provider const *) { check_tactic_expr(app_arg(e), "invalid 'eapply' tactic, invalid argument"); return eapply_tactic(fn, get_tactic_expr_expr(app_arg(e))); }); register_tac(get_tactic_fapply_name(), [](type_checker &, elaborate_fn const & fn, expr const & e, pos_info_provider const *) { check_tactic_expr(app_arg(e), "invalid 'fapply' tactic, invalid argument"); return fapply_tactic(fn, get_tactic_expr_expr(app_arg(e))); }); } void finalize_apply_tactic() { delete g_apply_class_instance; } }
40.619231
149
0.576745
javra
a66adb1c16fd0bfa4724da786cd977293277fb31
4,363
cpp
C++
example-Sliders/src/ofApp.cpp
leozimmerman/ofxUI
4145d50dca66791aa8ea6056504647ccebc3e366
[ "MIT" ]
169
2015-01-07T10:03:49.000Z
2021-11-22T18:21:32.000Z
example-Sliders/src/ofApp.cpp
leozimmerman/ofxUI
4145d50dca66791aa8ea6056504647ccebc3e366
[ "MIT" ]
39
2015-01-06T14:06:01.000Z
2018-07-11T22:32:06.000Z
example-Sliders/src/ofApp.cpp
leozimmerman/ofxUI
4145d50dca66791aa8ea6056504647ccebc3e366
[ "MIT" ]
91
2015-01-02T06:23:26.000Z
2021-10-21T01:56:51.000Z
#include "ofApp.h" //-------------------------------------------------------------- void ofApp::setup() { ofEnableSmoothing(); ofSetCircleResolution(60); red = 100; blue = 100; green = 100; drawPadding = false; gui0 = new ofxUISuperCanvas("SLIDER WIDGETS"); gui0->addSpacer(); gui0->addFPSSlider("FPS SLIDER"); gui0->addSpacer(); gui0->addLabel("NORMAL SLIDER"); gui0->addSlider("RED", 0.0, 255.0, &red); gui0->addSpacer(); gui0->addLabel("MINIMAL SLIDER"); gui0->addMinimalSlider("GREEN", 0.0, 255.0, &green); gui0->addSpacer(); gui0->addLabel("BILABEL SLIDER"); gui0->addBiLabelSlider("BLUE", "LESS BLUE", "MORE BLUE", 0.0, 255.0, &blue); gui0->addSpacer(); gui0->addLabel("VERTICAL SLIDERS"); gui0->addSlider("1", 0.0, 255.0, 100.0, 17, 64); gui0->setWidgetPosition(OFX_UI_WIDGET_POSITION_RIGHT); gui0->addSlider("2", 0.0, 255.0, 150.0, 17, 64); gui0->addSlider("3", 0.0, 255.0, 200.0, 17, 64); gui0->addSlider("4", 0.0, 255.0, 250.0, 17, 64); gui0->addSlider("5", 0.0, 255.0, 250.0, 17, 64); gui0->addSlider("6", 0.0, 255.0, 250.0, 17, 64); gui0->addSlider("7", 0.0, 255.0, 250.0, 17, 64); gui0->addSlider("8", 0.0, 255.0, 250.0, 17, 64); gui0->addSlider("9", 0.0, 255.0, 250.0, 17, 64); gui0->setWidgetPosition(OFX_UI_WIDGET_POSITION_DOWN); gui0->addSpacer(); gui0->addLabel("RANGE SLIDER"); gui0->addRangeSlider("RANGE", 0.0, 255.0, &blue, &green); gui0->addSpacer(); gui0->addLabel("TEMPLATED SLIDERS"); gui0->addIntSlider("INT SLIDER", 0, 100, 50); gui0->addSlider("FLOAT SLIDER", 0.0, 100.0, 50.0); gui0->addDoubleSlider("DOUBLE SLIDER", 0.0, 100.0, 50.0); gui0->addSpacer(); gui0->addLabel("ROTARY SLIDER"); gui0->addRotarySlider("ROTARY", 0.0, 255.0, &red); gui0->autoSizeToFitWidgets(); ofAddListener(gui0->newGUIEvent,this,&ofApp::guiEvent); gui1 = new ofxUISuperCanvas("MORE SLIDERS"); gui1->setPosition(212, 0); gui1->addSpacer(); gui1->addLabel("2D PAD"); gui1->add2DPad("PAD", ofVec2f(-100, 100), ofVec2f(-100, 100), ofVec2f(0, 0)); gui1->addSpacer(); gui1->addLabel("CIRCLE SLIDER"); gui1->addCircleSlider("GREEN", 0.0, 255.0, &green); gui1->addSpacer(); gui1->addLabel("IMAGE SLIDER"); gui1->setGlobalSliderHeight(32); gui1->addImageSlider("IMAGE SLIDER", "slider.png", 0.0, 255.0, &red); gui1->autoSizeToFitWidgets(); ofAddListener(gui1->newGUIEvent,this,&ofApp::guiEvent); ofBackground(red, green, blue); } //-------------------------------------------------------------- void ofApp::update() { } //-------------------------------------------------------------- void ofApp::draw() { ofBackground(red, green, blue, 255); } //-------------------------------------------------------------- void ofApp::guiEvent(ofxUIEventArgs &e) { } //-------------------------------------------------------------- void ofApp::exit() { delete gui0; delete gui1; } //-------------------------------------------------------------- void ofApp::keyPressed(int key) { switch (key) { case 'p': { drawPadding = !drawPadding; gui0->setDrawWidgetPadding(drawPadding); } break; case 'g': { gui0->toggleVisible(); } break; default: break; } } //-------------------------------------------------------------- void ofApp::keyReleased(int key){ } //-------------------------------------------------------------- void ofApp::mouseMoved(int x, int y ) { // gui0->getRect()->setHeight(y); } //-------------------------------------------------------------- void ofApp::mouseDragged(int x, int y, int button) { } //-------------------------------------------------------------- void ofApp::mousePressed(int x, int y, int button) { } //-------------------------------------------------------------- void ofApp::mouseReleased(int x, int y, int button) { } //-------------------------------------------------------------- void ofApp::windowResized(int w, int h) { } //-------------------------------------------------------------- void ofApp::gotMessage(ofMessage msg){ } //-------------------------------------------------------------- void ofApp::dragEvent(ofDragInfo dragInfo){ }
26.442424
80
0.482237
leozimmerman
a66dc20b861942c9889eeb54ff2b92dbb283ac2e
1,014
cpp
C++
tutorial/ComponentTemplate.cpp
b-com-software-basis/xpcf
26ce21929ff6209ef69117270cf49844348c988f
[ "Apache-2.0" ]
null
null
null
tutorial/ComponentTemplate.cpp
b-com-software-basis/xpcf
26ce21929ff6209ef69117270cf49844348c988f
[ "Apache-2.0" ]
7
2020-02-13T20:35:16.000Z
2021-11-19T17:46:15.000Z
tutorial/ComponentTemplate.cpp
b-com-software-basis/xpcf
26ce21929ff6209ef69117270cf49844348c988f
[ "Apache-2.0" ]
1
2018-02-26T14:10:43.000Z
2018-02-26T14:10:43.000Z
/** * @copyright Copyright (c) 2015 All Right Reserved, B-com http://www.b-com.com/ * * This file is subject to the B<>Com License. * All other rights reserved. * * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A * PARTICULAR PURPOSE. * * @author Loïc Touraine * * @file * @brief description of file * @date 2015-09-18 */ #include <stdio.h> #include "ComponentTemplate.h" // XPCF_ComponentBase #include "ComponentBase.h" XPCF_DEFINE_FACTORY_CREATE_INSTANCE(client::ComponentTemplate); namespace client { ComponentTemplate::ComponentTemplate ():ComponentBase(xpcf::toMap<ComponentTemplate>()) { addInterface<ITemplateInterface>(this); } ComponentTemplate::~ComponentTemplate () { } void ComponentTemplate::unloadComponent () { std::cout<<m_name<<"::"<<"ComponentTemplate::unload () called!"<<std::endl; delete this; return; } }
22.043478
87
0.728797
b-com-software-basis
a6790168e40a8861011a8b0435d35a05fa5e1b93
25,693
cpp
C++
src/hs-appinfo.cpp
hungsonspkt/agl-service-homescreen
c02e6e5e45c152c6939033e13a159ed35fbd7ee2
[ "Apache-2.0" ]
null
null
null
src/hs-appinfo.cpp
hungsonspkt/agl-service-homescreen
c02e6e5e45c152c6939033e13a159ed35fbd7ee2
[ "Apache-2.0" ]
null
null
null
src/hs-appinfo.cpp
hungsonspkt/agl-service-homescreen
c02e6e5e45c152c6939033e13a159ed35fbd7ee2
[ "Apache-2.0" ]
null
null
null
/* * Copyright (c) 2019 TOYOTA MOTOR CORPORATION * * 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 <unistd.h> #include <cstring> #include "hs-appinfo.h" #include "hs-helper.h" #include "hs-clientmanager.h" #include <stdio.h> // standard input / output functions #include <stdlib.h> #include <string.h> // string function definitions #include <unistd.h> // UNIX standard function definitions #include <fcntl.h> // File control definitions #include <errno.h> // Error number definitions #include <termios.h> // POSIX terminal control definitions #include <pthread.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <errno.h> #include <string.h> #include <sys/types.h> #include <time.h> #define RETRY_CNT 10 const char _keyName[] = "name"; const char _keyVersion[] = "version"; const char _keyInstall[] = "install"; const char _keyUninstall[] = "uninstall"; const char _keyOperation[] = "operation"; const char _keyRunnables[] = "runnables"; const char _keyStart[] = "start"; const char _keyApplistChanged[] = "application-list-changed"; HS_AppInfo* HS_AppInfo::me = nullptr; const std::unordered_map<std::string, HS_AppInfo::func_handler> HS_AppInfo::concerned_event_list { {"afm-main/application-list-changed", &HS_AppInfo::updateAppDetailList} }; /** * event hook function * * #### Parameters * - api : the api serving the request * - event : event name * - object : event json object * * #### Return * 0 : continue transfer * 1 : blocked * */ static int eventHandler(afb_api_t api, const char *event, struct json_object *object) { return HS_AppInfo::instance()->onEvent(api, event, object); } /** * get application property function * * #### Parameters * - key : retrieve keyword * * #### Return * retrieved property * */ std::string AppDetail::getProperty(std::string key) const { struct json_object *j_obj; struct json_object *j_detail = json_tokener_parse(this->detail.c_str()); if(json_object_object_get_ex(j_detail, key.c_str(), &j_obj) == 0) { AFB_WARNING("can't find key=%s.", key.c_str()); return std::string(); } return std::string(json_object_get_string(j_obj)); } /** * HS_AppInfo destruction function * * #### Parameters * - Nothing * * #### Return * None * */ HS_AppInfo::~HS_AppInfo() { if(afmmain) delete afmmain; } typedef struct { unsigned char msgRcv[0xFF]; unsigned char iCount; unsigned char isValid; }SERIAL_DATA_QUEUE; pthread_mutex_t mutexsync; pthread_mutex_t mutexSerialSync; pthread_t tid; int fdUSB = 0x00; int icount = 0x00; SERIAL_DATA_QUEUE g_serial_rcv; void printLogMsg(char *msg) { FILE *f = fopen("/home/1001/app-data/agl-service-homescreen/file.txt", "a"); if (f == NULL) { printf("Error opening file!\n"); exit(1); } fprintf(f, "%s\n", msg); fclose(f); } void setSerialRcv(unsigned char *buffer, int icound) { pthread_mutex_lock (&mutexsync); int idx = 0x00; g_serial_rcv.iCount = icound; for(idx = 0x00; idx < icound; idx++) { g_serial_rcv.msgRcv[idx] = buffer[idx]; } g_serial_rcv.isValid = 0x20; pthread_mutex_unlock (&mutexsync); } bool sendHeartBeat() { bool retVal = false; pthread_mutex_lock (&mutexSerialSync); if(fdUSB != 0x00) { char syncByte = 0xA5; if(write (fdUSB, &syncByte, 1) < 0x00) { printLogMsg((char*)"sendHeartBeat, write socket error\n\r"); } else { printLogMsg((char*)"sendHeartBeat successed\n\r"); retVal = true; } } pthread_mutex_unlock (&mutexSerialSync); return retVal; } void printserial() { return; printLogMsg((char*)"printserial"); close(fdUSB);fdUSB = open( "/dev/ttyS0", O_RDWR| O_NOCTTY ); struct termios tty; struct termios tty_old; memset (&tty, 0, sizeof tty); /* Error Handling */ if ( tcgetattr ( fdUSB, &tty ) != 0 ) { //printLogMsg((char*)"Open /dev/ttyS0 failed, fdUSB: %d", fdUSB); printLogMsg((char*)"printserial Open /dev/ttyS0 failed"); return; } printLogMsg((char*)"printserial do serial config"); /* Save old tty parameters */ tty_old = tty; /* Set Baud Rate */ cfsetospeed (&tty, (speed_t)B115200); /* Setting other Port Stuff */ tty.c_cflag &= ~PARENB; // Make 8n1 tty.c_cflag &= ~CSTOPB; tty.c_cflag &= ~CSIZE; tty.c_cflag |= CS8; tty.c_cflag &= ~CRTSCTS; // no flow control tty.c_cc[VMIN] = 1; // read doesn't block tty.c_cc[VTIME] = 5; // 0.5 seconds read timeout tty.c_cflag |= CREAD | CLOCAL; // turn on READ & ignore ctrl lines /* Make raw */ cfmakeraw(&tty); printLogMsg((char*)"printserial flush usb"); /* Flush Port, then applies attributes */ tcflush( fdUSB, TCIFLUSH ); if ( tcsetattr ( fdUSB, TCSANOW, &tty ) != 0) { close(fdUSB); printLogMsg((char*)"printserial flush usb failed"); return; } if(fdUSB != 0x00) { printLogMsg((char*)"printserial writing data to serial"); if(write (fdUSB, "K-Auto hello!\n", strlen("K-Auto hello!\n")) < 0x00) { close(fdUSB); fdUSB = 0x00; return; } } fdUSB = 0x00; } #define UNUSED(x) (void)(x) void* doSomeThing(void *arg) { UNUSED(arg); usleep(10000000);//10s #if 0 int seconds = 0x00; int odo = 12500; int curSpeed = 30; int batteryLev = 60; int signalLightLeft = 0x00; int signalLightRight = 0x01; #endif int listenfd = 0, connfd = 0; struct sockaddr_in serv_addr; char sendBuff[1025]; //time_t ticks; listenfd = socket(AF_INET, SOCK_STREAM, 0); memset(&serv_addr, '0', sizeof(serv_addr)); memset(sendBuff, '0', sizeof(sendBuff)); serv_addr.sin_family = AF_INET; //serv_addr.sin_addr.s_addr = htonl(INADDR_ANY); //serv_addr.sin_addr.s_addr = inet_addr("127.0.0.1");//htonl("127.0.0.1"); serv_addr.sin_addr.s_addr = inet_addr("127.192.90.189");//htonl("127.0.0.1"); serv_addr.sin_port = htons(5000); bind(listenfd, (struct sockaddr*)&serv_addr, sizeof(serv_addr)); listen(listenfd, 10); connfd = accept(listenfd, (struct sockaddr*)NULL, NULL); while(1) { //usleep(1000000);//1s //printserial(); //continue; //{"odo":12500, "curSpeed":30, "batteryLev":60, signalLightLeft:0, signalLightRight:1} //ticks = time(NULL); #if 0 if((seconds % 3) == 0x00) { odo++; } if((seconds % 1) == 0x00) { curSpeed = (rand() % (70 - 55 + 1)) + 55; } if((seconds % 5) == 0x00 && batteryLev > 0x00) { batteryLev--; } if((seconds % 10) == 0x00) { signalLightLeft = 0x01; signalLightRight = 0x00; } else { signalLightLeft = 0x00; signalLightRight = 0x01; } snprintf(sendBuff, sizeof(sendBuff), "{\"odo\":%d, \"curSpeed\":%d, \"batteryLev\":%d, \"signalLightLeft\":%d, \"signalLightRight\":%d}", odo, curSpeed, batteryLev, signalLightLeft, signalLightRight); if(write(connfd, sendBuff, strlen(sendBuff)) < 0x00) { printLogMsg((char*)"write socket error\n\r"); } seconds++; #endif pthread_mutex_lock (&mutexsync); if(g_serial_rcv.isValid == 0x20) { g_serial_rcv.isValid = 0x00; snprintf(sendBuff, sizeof(sendBuff), "{\"odo\":%d, \"curSpeed\":%d, \"batteryLev\":%d, \"signalLightLeft\":%d, \"signalLightRight\":%d}", g_serial_rcv.msgRcv[3], g_serial_rcv.msgRcv[4], g_serial_rcv.msgRcv[5], g_serial_rcv.msgRcv[6], g_serial_rcv.msgRcv[7]); if(write(connfd, sendBuff, strlen(sendBuff)) < 0x00) { printLogMsg((char*)"write socket error\n\r"); } } pthread_mutex_unlock (&mutexsync); usleep(1000000);//1s } close(connfd); return NULL; } #define MAX_RECEIVING_BUFFER 0xFF //CRC POLYNOMIAL parameter #define CRC_POLYNOMIAL 0x131 #define MESSAGE_HEADER_01 0xA5 #define MESSAGE_HEADER_02 0x5A enum State_enum { CLI_COMMAND_UNKNOWN = 0x00, CLI_COMMAND_HEADER_01 = 0x01, CLI_COMMAND_HEADER_02 = 0x02, CLI_COMMAND_OPTYPE = 0x03, CLI_COMMAND_DATA_LENGTH = 0x04, CLI_COMMAND_DATA = 0x05, CLI_COMMAND_CRC = 0x06, CLI_COMMAND_COMPLETE = 0x07, }; unsigned char m_arru8_receivingbuff[MAX_RECEIVING_BUFFER]; char msgBuffer[0xFF]; int heartBeatCount = 0x00; #define UNUSED(x) (void)(x) int openSerialPort() { int serialfd = 0x00; //serialfd = open( "/dev/ttyS0", O_RDWR| O_NOCTTY | O_NDELAY ); serialfd = open( "/dev/ttyUSB0", O_RDWR| O_NOCTTY | O_NDELAY ); struct termios tty; struct termios tty_old; memset (&tty, 0, sizeof tty); /* Error Handling */ if ( tcgetattr ( serialfd, &tty ) != 0 ) { printLogMsg((char*)"openSerialPort Open /dev/ttyS0 failed"); return 0x00; } tcflush(fdUSB, TCIOFLUSH); /* Save old tty parameters */ tty_old = tty; /* Set Baud Rate */ cfsetospeed (&tty, (speed_t)B115200); /* Setting other Port Stuff */ tty.c_cflag &= ~PARENB; // Make 8n1 tty.c_cflag &= ~CSTOPB; tty.c_cflag &= ~CSIZE; tty.c_cflag |= CS8; tty.c_cflag &= ~CRTSCTS; // no flow control tty.c_cc[VMIN] = 1; // read doesn't block tty.c_cc[VTIME] = 5; // 0.5 seconds read timeout tty.c_cflag |= CREAD | CLOCAL; // turn on READ & ignore ctrl lines /* Make raw */ cfmakeraw(&tty); cfsetispeed(&tty, cfgetospeed(&tty)); /* Flush Port, then applies attributes */ tcflush( fdUSB, TCIFLUSH ); if ( tcsetattr ( fdUSB, TCSANOW, &tty ) != 0) { close(fdUSB); printLogMsg((char*)"openSerialPort tcsetattr failed"); return 0x00; } return serialfd; } void* kAutoSerialComunication(void *arg) { UNUSED(arg); bool isSerialInitSuccessed = false; int m_u8state = CLI_COMMAND_UNKNOWN; unsigned char m_u8receiveCount = 0x00; unsigned char u8datalength = 0x00; static char inChar = 0x00; pthread_mutex_lock (&mutexSerialSync); if(fdUSB != 0x00) { close(fdUSB); } while(isSerialInitSuccessed == false) { fdUSB = openSerialPort(); if(fdUSB != 0x00) { isSerialInitSuccessed = true; } } pthread_mutex_unlock (&mutexSerialSync); m_u8state = CLI_COMMAND_HEADER_01; while(1) { pthread_mutex_lock (&mutexSerialSync); if(read(fdUSB, &inChar, 1) > 0x00) { memset(msgBuffer, 0x00, 0xFF); sprintf((char*)msgBuffer, "Data received: %d, m_u8state: %d\n\r", inChar, m_u8state); printLogMsg((char*)msgBuffer); switch(m_u8state) { case CLI_COMMAND_HEADER_01: { if(inChar == MESSAGE_HEADER_01) { m_u8receiveCount = 0x00; m_arru8_receivingbuff[m_u8receiveCount++] = inChar; m_u8state = CLI_COMMAND_HEADER_02; printLogMsg((char*)"Receive header 1\n\r"); } } break; case CLI_COMMAND_HEADER_02: { if(inChar == MESSAGE_HEADER_02) { m_arru8_receivingbuff[m_u8receiveCount++] = inChar; m_u8state = CLI_COMMAND_DATA_LENGTH; printLogMsg((char*)"Receive header 2\n\r"); } } break; case CLI_COMMAND_DATA_LENGTH: { u8datalength = inChar; m_arru8_receivingbuff[m_u8receiveCount++] = inChar; m_u8state = CLI_COMMAND_DATA; printLogMsg((char*)"Receive data length\n\r"); } break; case CLI_COMMAND_DATA: { if( u8datalength > 0) { m_arru8_receivingbuff[m_u8receiveCount++] = inChar; u8datalength--; printLogMsg((char*)"Receive data ..\n\r"); } if(u8datalength == 0) { m_u8state = CLI_COMMAND_CRC; //printLogMsg((char*)"Receive data complete, switch to CRC\n\r"); } } break; case CLI_COMMAND_CRC: { m_arru8_receivingbuff[m_u8receiveCount++] = inChar; /*complete*/ //msg.deserialize((const char*)m_arru8_receivingbuff, m_u8receiveCount); setSerialRcv((unsigned char *)m_arru8_receivingbuff, m_u8receiveCount); /*reset package*/ m_u8state = CLI_COMMAND_HEADER_01; m_u8receiveCount = 0x00; u8datalength = 0x00; printLogMsg((char*)"Receive CRC, message complete\n\r"); } break; } } pthread_mutex_unlock (&mutexSerialSync); #if 0 usleep(1000);//delay for 1 milisecond if(heartBeatCount++ > 2000)//2 seconds { if(sendHeartBeat() == false) { close(fdUSB); printLogMsg((char*)"Serial write failed, try to open again\n\r"); fdUSB = openSerialPort(); } heartBeatCount = 0x00; } #endif } if(fdUSB != 0x00) { close(fdUSB); } return NULL; } int iCountDelay = 0x00; void* kAutoHeartBeat(void *arg) { UNUSED(arg); while(1) { if(iCountDelay > 1000) { sendHeartBeat(); iCountDelay = 0x00; } usleep(1000);//delay for 1 milisecond iCountDelay++; } return NULL; } /** * get instance * * #### Parameters * - Nothing * * #### Return * HS_AppInfo instance pointer * */ HS_AppInfo* HS_AppInfo::instance(void) { if(me == nullptr) { me = new HS_AppInfo(); pthread_mutex_init(&mutexsync, NULL); pthread_mutex_init(&mutexSerialSync, NULL); pthread_create(&tid, NULL, &doSomeThing, NULL); pthread_create(&tid, NULL, &kAutoSerialComunication, NULL); //pthread_create(&tid, NULL, &kAutoHeartBeat, NULL); } return me; } /** * HS_AppInfo initialize function * * #### Parameters * - api : the api serving the request * * #### Return * 0 : init success * 1 : init fail * */ int HS_AppInfo::init(afb_api_t api) { afmmain = new HS_AfmMainProxy(); if(afmmain == nullptr) { AFB_ERROR("new HS_AfmMainProxy failed"); return -1; } struct json_object* j_runnable = nullptr; int retry = 0; do { if(afmmain->runnables(api, &j_runnable) == 0) { createAppDetailList(j_runnable); json_object_put(j_runnable); break; } ++retry; if(retry == RETRY_CNT) { AFB_ERROR("get runnables list failed"); json_object_put(j_runnable); return -1; } AFB_DEBUG("retry to get runnables list %d", retry); usleep(100000); // 100ms } while(1); for(auto &ref : concerned_event_list) { setEventHook(ref.first.c_str(), eventHandler); } return 0; } /** * onEvent function * * #### Parameters * - api : the api serving the request * - event : event name * - object : event json object * * #### Return * 0 : continue transfer * 1 : blocked */ int HS_AppInfo::onEvent(afb_api_t api, const char *event, struct json_object *object) { int ret = 0; auto ip = concerned_event_list.find(std::string(event)); if(ip != concerned_event_list.end()) { ret = (this->*(ip->second))(api, object); } return ret; } /** * create application detail list function * * #### Parameters * - object : the detail of all applications * * #### Return * None * */ void HS_AppInfo::createAppDetailList(struct json_object *object) { AFB_DEBUG("applist:%s", json_object_to_json_string(object)); if(json_object_get_type(object) == json_type_array) { int array_len = json_object_array_length(object); for (int i = 0; i < array_len; ++i) { struct json_object *obj = json_object_array_get_idx(object, i); addAppDetail(obj); } } else { AFB_ERROR("Apps information input error."); } } /** * update application detail function * * #### Parameters * - object : the detail of all applications * * #### Return * 0 : continue transfer * 1 : blocked * */ int HS_AppInfo::updateAppDetailList(afb_api_t api, struct json_object *object) { AFB_DEBUG("update:%s", json_object_to_json_string(object)); if(json_object_get_type(object) != json_type_object) { AFB_ERROR("input detail object error."); return 1; } struct json_object *obj_oper, *obj_data; if(json_object_object_get_ex(object, _keyOperation, &obj_oper) == 0 || json_object_object_get_ex(object, _keyData, &obj_data) == 0) { AFB_ERROR("can't find key=%s, %s.", _keyOperation, _keyData); return 1; } std::string id = json_object_get_string(obj_data); std::string appid = id2appid(id); if(isPeripheryApp(appid.c_str())) { AFB_INFO( "install/uninstall application is periphery."); return 1; } std::string oper = json_object_get_string(obj_oper); if(oper == _keyInstall) { struct json_object* j_runnable = nullptr; int ret = afmmain->runnables(api, &j_runnable); if(!ret) { struct json_object *j_found = retrieveRunnables(j_runnable, id); if(j_found == nullptr) { AFB_INFO( "installed application isn't runnables."); json_object_put(j_runnable); return 1; } addAppDetail(json_object_get(j_found)); pushAppListChangedEvent(_keyInstall, j_found); } else { AFB_ERROR("get runnalbes failed."); } json_object_put(j_runnable); } else if(oper == _keyUninstall) { std::string appid_checked = checkAppId(appid); if(appid_checked.empty()) { AFB_INFO("uninstalled application isn't in runnables list, appid=%s.", appid.c_str()); return 1; } pushAppListChangedEvent(_keyUninstall, json_object_get(obj_data)); removeAppDetail(appid); } else { AFB_ERROR("operation error."); } return 1; } /** * parse application detail function * * #### Parameters * - object : [IN] the detail of application * - info : [OUT] parsed application detail * * #### Return * the appid of application liked "dashboard" * */ std::string HS_AppInfo::parseAppDetail(struct json_object *object, AppDetail &info) const { struct json_object *name, *id; if(json_object_object_get_ex(object, _keyName, &name) == 0 || json_object_object_get_ex(object, _keyId, &id) == 0) { AFB_ERROR("can't find key=%s, %s.", _keyName, _keyId); return std::string(); } std::string appid = id2appid(json_object_get_string(id)); bool periphery = isPeripheryApp(appid.c_str()); info = { json_object_get_string(name), json_object_get_string(id), json_object_to_json_string(object), periphery }; return appid; } /** * add application detail to list function * * #### Parameters * - object : application detail * * #### Return * None * */ void HS_AppInfo::addAppDetail(struct json_object *object) { AppDetail info; std::string appid = parseAppDetail(object, info); if(appid.empty()) { AFB_ERROR("application id error"); return; } std::lock_guard<std::mutex> lock(this->mtx); appid2name[appid] = info.name; name2appid[info.name] = appid; app_detail_list[appid] = std::move(info); } /** * remove application detail from list function * * #### Parameters * - appid : application id * * #### Return * None * */ void HS_AppInfo::removeAppDetail(std::string appid) { std::lock_guard<std::mutex> lock(this->mtx); auto it = app_detail_list.find(appid); if(it != app_detail_list.end()) { appid2name.erase(appid); name2appid.erase(it->second.name); app_detail_list.erase(it); } else { AFB_WARNING("erase application(%s) wasn't in applist.", appid.c_str()); } } /** * push app_list_changed event function * * #### Parameters * - oper: install/uninstall * - object: event data * * #### Return * None * */ void HS_AppInfo::pushAppListChangedEvent(const char *oper, struct json_object *object) { struct json_object *push_obj = json_object_new_object(); json_object_object_add(push_obj, _keyOperation, json_object_new_string(oper)); json_object_object_add(push_obj, _keyData, object); HS_ClientManager::instance()->pushEvent(_keyApplistChanged, push_obj); } /** * retrieve runnables function * * #### Parameters * - obj_runnables: runnables array * - id: application id * * #### Return * found application detail * */ struct json_object* HS_AppInfo::retrieveRunnables(struct json_object *obj_runnables, std::string id) { struct json_object *j_found = nullptr; if(json_object_get_type(obj_runnables) == json_type_array) { int array_len = json_object_array_length(obj_runnables); for (int i = 0; i < array_len; ++i) { struct json_object *obj = json_object_array_get_idx(obj_runnables, i); struct json_object *j_id; if(json_object_object_get_ex(obj, _keyId, &j_id) == 0) { AFB_WARNING("can't find id."); continue; } if(id == json_object_get_string(j_id)) { j_found = obj; break; } } } else { AFB_ERROR("Apps information input error."); } return j_found; } /** * convert id to appid function * * #### Parameters * - id : the id of application liked "[email protected]" * * #### Return * the appid of application liked "dashboard" * */ std::string HS_AppInfo::id2appid(const std::string &id) const { std::string appid; std::size_t pos = id.find("@"); appid = id.substr(0,pos); return appid; } /** * get runnables list * * #### Parameters * - object : runnables list,json array * * #### Return * None * */ void HS_AppInfo::getRunnables(struct json_object **object) { if(json_object_get_type(*object) != json_type_array) { AFB_ERROR("json type error."); return; } std::lock_guard<std::mutex> lock(this->mtx); for(auto it : app_detail_list) { if(!it.second.periphery) json_object_array_add(*object, json_tokener_parse(it.second.detail.c_str())); } } /** * check appid function * * #### Parameters * - appid : appid liked "dashboard" * * #### Return * success : the correct appid * fail : empty string * */ std::string HS_AppInfo::checkAppId(const std::string &appid) { std::lock_guard<std::mutex> lock(this->mtx); auto it_appid = appid2name.find(appid); if(it_appid != appid2name.end()) return it_appid->first; auto it_name = name2appid.find(appid); if(it_name != name2appid.end()) return it_name->second; return std::string(); } /** * check if application is a runnable periphery application function * * #### Parameters * - appid : appid liked "launcher" * * #### Return * true : periphery * false : not periphery * */ bool HS_AppInfo::isPeripheryApp(const char *appid) const { bool ret = false; for(auto m : periphery_app_list) { if(strcasecmp(appid, m) == 0) { ret = true; break; } } return ret; } /** * get application specific property * * #### Parameters * - appid : appid liked "launcher" * - key : the keyword * * #### Return * application property * */ std::string HS_AppInfo::getAppProperty(const std::string appid, std::string key) const { std::string value = ""; auto it = app_detail_list.find(appid); if(it != app_detail_list.end()) { value = it->second.getProperty(key); } return value; }
26.84744
270
0.584517
hungsonspkt
a67aff0b70d536deeca852f6eba310fb53c60a90
3,719
hpp
C++
badger/include/Badger.hpp
projetpeip-montp2/badger
fc12b8fe2889a0a3c9a9d5503dcfe55ab8d37cbc
[ "BSD-3-Clause" ]
null
null
null
badger/include/Badger.hpp
projetpeip-montp2/badger
fc12b8fe2889a0a3c9a9d5503dcfe55ab8d37cbc
[ "BSD-3-Clause" ]
2
2021-01-22T13:58:53.000Z
2021-01-22T13:59:08.000Z
badger/include/Badger.hpp
projetpeip-montp2/badger
fc12b8fe2889a0a3c9a9d5503dcfe55ab8d37cbc
[ "BSD-3-Clause" ]
null
null
null
//////////////////////////////////////////////////////////// // Copyright (c) 2012 Polytech Montpellier // All rights reserved. // // 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. // * Neither the name of the copyright holder 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 OWNER 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. //////////////////////////////////////////////////////////// #ifndef BADGER_BADGER_HPP #define BADGER_BADGER_HPP #include <map> #include <string> #include <vector> #include "Console.hpp" #include "Date.hpp" #include "Time.hpp" #include "SerialStream.hpp" namespace badger { class Badger { public: Badger(); ~Badger(); void run(); private: struct Record { Date date; Time time; std::string data; }; private: template<typename Res, typename... Args> void addCommand(const std::string &name, const std::function<Res(Args...)> &function, bool needSerialPortOpen); void tryToSendCommand(const std::string &command); std::string getReturnCommand(); void sendCommandOnSerial(const std::vector<serial::byte> &command); Record parseRecord(const std::string &str) const; std::vector<Record> get(const Date &date, const Time &begin, const Time &end); std::vector<Record> getAll(); private: void open(const std::string &port); void close(); std::string next(); std::string rollback(); std::string erase(); std::string count(); std::string minMaxDate(); std::string getDateTime(); std::string setDateTime(const Date &date, const Time &time); std::string display(const Date &date, const Time &begin, const Time &end); std::string csv(const Date &date, const Time &begin, const Time &end); void quit(); private: //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// bool m_continuer; plt::Console m_console; // The boolean is for the need of an open serial port std::map<std::string, bool> m_access; serial::serialstream m_serial; }; } // namespace badger #include "Badger.inl" #endif // BADGER_BADGER_HPP
29.515873
119
0.623824
projetpeip-montp2
a67ca19a3a7883f77d0f8a248526df357bececc4
1,517
hpp
C++
Game/Game/src/ResultScene.hpp
ParachanActionGame-Project/KurachanActionGame
af85abcf3c9554f04cacd8686140eb59242463ae
[ "BSD-2-Clause" ]
null
null
null
Game/Game/src/ResultScene.hpp
ParachanActionGame-Project/KurachanActionGame
af85abcf3c9554f04cacd8686140eb59242463ae
[ "BSD-2-Clause" ]
10
2021-09-24T11:40:45.000Z
2021-10-30T04:59:13.000Z
Game/Game/src/ResultScene.hpp
ParachanActionGame-Project/KurachanActionGame
af85abcf3c9554f04cacd8686140eb59242463ae
[ "BSD-2-Clause" ]
null
null
null
 # pragma once # include "Common.hpp" # include "ResultKurachan.hpp" # include <vector> using namespace result; // リザルトシーン // ぱらちゃんを1匹泳がせる。等速直線運動で、スクリーン端で跳ね返る class ResultScene : public MyApp::Scene { private: std::vector<ResultKurachan> parachans { ResultKurachan(Scene::Center(), SMALL, Vec2(100.0, 50.0)), ResultKurachan(Scene::Center() + Vec2(100.0, 0.0), MIDDLE, Vec2(0, 100.0)), ResultKurachan(Scene::Center() + Vec2(-50.0, 50.0), BIG, Vec2(-60.0, 80.0)), ResultKurachan(Scene::Center() + Vec2(-100.0, 100.0), VERY_SMALL, Vec2(50.0, 30.0)), ResultKurachan(Scene::Center() + Vec2(200.0, -50.0), VERY_BIG, Vec2(-20.0, -60.0)) }; Rect m_startButton = Rect(Arg::center = Scene::Center().movedBy(0, 80), 300, 60); Transition m_startTransition = Transition(0.4s, 0.2s); Rect m_goTitleButton = Rect(Arg::center = Scene::Center().movedBy(0, 160), 300, 60); Transition m_goTitleTransition = Transition(0.4s, 0.2s); Rect m_exitButton = Rect(Arg::center = Scene::Center().movedBy(0, 240), 300, 60); Transition m_exitTransition = Transition(0.4s, 0.2s); Rect m_tweetButton = Rect(Arg::center = Scene::Center().movedBy(300, 240), 150, 60); Transition m_tweetTransition = Transition(0.4s, 0.2s); Texture backgroundTexture; int highScore; //今回のプレイ以前のハイスコア int currentScore; public: ResultScene(const InitData& init); void update() override; void draw() const override; void writeHighScore(); void setHighScore(int highScore); int getHighScore(); void updateHighScore(); };
27.089286
87
0.700066
ParachanActionGame-Project
a67cda1ff4ac3f146f7f2fb374582b4722164464
326
cpp
C++
plugins/peperoni/common/main.cpp
hveld/qlcplus
1dd61a5a3a2c93d7fe88cd2a90574c4849b64829
[ "Apache-2.0" ]
1
2015-03-03T17:30:10.000Z
2015-03-03T17:30:10.000Z
plugins/peperoni/common/main.cpp
bjlupo/rcva_qlcplus
d367d33f5446c30d5201625e72946cc27f55ae5d
[ "Apache-2.0" ]
null
null
null
plugins/peperoni/common/main.cpp
bjlupo/rcva_qlcplus
d367d33f5446c30d5201625e72946cc27f55ae5d
[ "Apache-2.0" ]
null
null
null
#include <QCoreApplication> #if defined(WIN32) || defined(Q_OS_WIN) # include "win32ioenumerator.h" #else # include "unixioenumerator.h" #endif int main(int argc, char** argv) { QCoreApplication a(argc, argv); #ifdef WIN32 Win32IOEnumerator e; #else UnixIOEnumerator e; #endif e.rescan(); return 0; }
17.157895
39
0.690184
hveld
a6829ae308c10372abd45d1a6b4923baf43429b0
12,733
cpp
C++
source/D2Common/src/DataTbls/MissilesTbls.cpp
eezstreet/D2MOO
28a30aecc69bf43c80e6757a94d533fb37634b68
[ "MIT" ]
42
2020-12-26T00:21:49.000Z
2022-03-21T03:48:03.000Z
source/D2Common/src/DataTbls/MissilesTbls.cpp
eezstreet/D2MOO
28a30aecc69bf43c80e6757a94d533fb37634b68
[ "MIT" ]
24
2020-12-26T09:46:51.000Z
2021-09-05T16:22:43.000Z
source/D2Common/src/DataTbls/MissilesTbls.cpp
eezstreet/D2MOO
28a30aecc69bf43c80e6757a94d533fb37634b68
[ "MIT" ]
19
2020-12-26T10:06:20.000Z
2022-03-27T17:20:09.000Z
#include "D2DataTbls.h" //D2Common.0x6FD62EA0 int __fastcall DATATBLS_MapMissilesTxtKeywordToNumber(char* szKey) { if (!_strnicmp(szKey, "min", 32)) { return 0; } else if (!_strnicmp(szKey, "max", 32)) { return 1; } else if (!_strnicmp(szKey, "rand", 32)) { return 2; } else if (!_strnicmp(szKey, "skill", 32)) { return 3; } else if (!_strnicmp(szKey, "miss", 32)) { return 4; } else { return -1; } } //D2Common.0x6FD62F20 //TODO: Find a name int __fastcall sub_6FD62F20(char* szText, int* a2, int a3, int nKeywordNumber) { D2TxtLinkStrc* pLinker = sgptDataTables->pMissileCalcLinker; char szCode[4] = {}; int nRow = 0; if (a3 == 1) { if (nKeywordNumber == 3) { if (sgptDataTables->iSkillCode) { nRow = FOG_GetRowFromTxt(sgptDataTables->iSkillCode, szText, 0); if (nRow >= 0) { *a2 = 1; return nRow; } pLinker = sgptDataTables->pSkillCalcLinker; } } else if (nKeywordNumber == 4) { if (sgptDataTables->pMissilesLinker) { nRow = FOG_GetRowFromTxt(sgptDataTables->pMissilesLinker, szText, 0); if (nRow >= 0) { *a2 = 1; return nRow; } } pLinker = sgptDataTables->pMissileCalcLinker; } } if (szText[0]) { szCode[0] = szText[0]; if (szText[1]) { szCode[1] = szText[1]; if (szText[2]) { szCode[2] = szText[2]; if (szText[3]) { szCode[3] = szText[3]; } else { szCode[3] = ' '; } } else { szCode[2] = ' '; szCode[3] = ' '; } } else { szCode[1] = ' '; szCode[2] = ' '; szCode[3] = ' '; } } else { szCode[0] = ' '; szCode[1] = ' '; szCode[2] = ' '; szCode[3] = ' '; } nRow = FOG_GetLinkIndex(pLinker, *(uint32_t*)szCode, 1); *a2 = 0; return nRow; } //D2Common.0x6FD630F0 void __fastcall DATATBLS_MissileCalcLinker(char* pSrc, void* pRecord, int nOffset, int nPosition, int nTxtRow, int nTxtColumn) { int nBufferSize = 0; char pBuffer[1024] = {}; if (pRecord) { if (pSrc) { nBufferSize = FOG_10254(pSrc, pBuffer, sizeof(pBuffer), DATATBLS_MapMissilesTxtKeywordToNumber, NULL, sub_6FD62F20); if (nBufferSize > 0) { *(uint32_t*)((char*)pRecord + nOffset) = DATATBLS_AppendMemoryBuffer(&sgptDataTables->pMissCode, (int*)&sgptDataTables->nMissCodeSize, &sgptDataTables->nMissCodeSizeEx, pBuffer, nBufferSize); } else { *(uint32_t*)((char*)pRecord + nOffset) = -1; } } else { *(uint32_t*)((char*)pRecord + nOffset) = -1; } } } //D2Common.0x6FD63180 void __fastcall DATATBLS_LoadMissilesTxt(void* pMemPool) { D2BinFieldStrc pTbl[] = { { "Missile", TXTFIELD_NAMETOINDEX, 0, 0, &sgptDataTables->pMissilesLinker }, { "LastCollide", TXTFIELD_BIT, 0, 4, NULL }, { "Explosion", TXTFIELD_BIT, 1, 4, NULL }, { "Pierce", TXTFIELD_BIT, 2, 4, NULL }, { "CanSlow", TXTFIELD_BIT, 3, 4, NULL }, { "CanDestroy", TXTFIELD_BIT, 4, 4, NULL }, { "NoMultiShot", TXTFIELD_BIT, 12, 4, NULL }, { "NoUniqueMod", TXTFIELD_BIT, 13, 4, NULL }, { "ClientSend", TXTFIELD_BIT, 5, 4, NULL }, { "GetHit", TXTFIELD_BIT, 6, 4, NULL }, { "SoftHit", TXTFIELD_BIT, 7, 4, NULL }, { "ApplyMastery", TXTFIELD_BIT, 8, 4, NULL }, { "ReturnFire", TXTFIELD_BIT, 9, 4, NULL }, { "Town", TXTFIELD_BIT, 10, 4, NULL }, { "SrcTown", TXTFIELD_BIT, 11, 4, NULL }, { "pCltDoFunc", TXTFIELD_WORD, 0, 8, NULL }, { "pCltHitFunc", TXTFIELD_WORD, 0, 10, NULL }, { "pSrvDoFunc", TXTFIELD_WORD, 0, 12, NULL }, { "pSrvHitFunc", TXTFIELD_WORD, 0, 14, NULL }, { "pSrvDmgFunc", TXTFIELD_WORD, 0, 16, NULL }, { "Param1", TXTFIELD_DWORD, 0, 56, NULL }, { "Param2", TXTFIELD_DWORD, 0, 60, NULL }, { "Param3", TXTFIELD_DWORD, 0, 64, NULL }, { "Param4", TXTFIELD_DWORD, 0, 68, NULL }, { "Param5", TXTFIELD_DWORD, 0, 72, NULL }, { "SrvCalc1", TXTFIELD_CALCTODWORD, 0, 128, DATATBLS_MissileCalcLinker }, { "CltParam1", TXTFIELD_DWORD, 0, 88, NULL }, { "CltParam2", TXTFIELD_DWORD, 0, 92, NULL }, { "CltParam3", TXTFIELD_DWORD, 0, 96, NULL }, { "CltParam4", TXTFIELD_DWORD, 0, 100, NULL }, { "CltParam5", TXTFIELD_DWORD, 0, 104, NULL }, { "CltCalc1", TXTFIELD_CALCTODWORD, 0, 132, DATATBLS_MissileCalcLinker }, { "sHitPar1", TXTFIELD_DWORD, 0, 76, NULL }, { "sHitPar2", TXTFIELD_DWORD, 0, 80, NULL }, { "sHitPar3", TXTFIELD_DWORD, 0, 84, NULL }, { "SHitCalc1", TXTFIELD_CALCTODWORD, 0, 136, DATATBLS_MissileCalcLinker }, { "cHitPar1", TXTFIELD_DWORD, 0, 108, NULL }, { "cHitPar2", TXTFIELD_DWORD, 0, 112, NULL }, { "cHitPar3", TXTFIELD_DWORD, 0, 116, NULL }, { "CHitCalc1", TXTFIELD_CALCTODWORD, 0, 140, DATATBLS_MissileCalcLinker }, { "dParam1", TXTFIELD_DWORD, 0, 120, NULL }, { "dParam2", TXTFIELD_DWORD, 0, 124, NULL }, { "DmgCalc1", TXTFIELD_CALCTODWORD, 0, 144, DATATBLS_MissileCalcLinker }, { "TravelSound", TXTFIELD_NAMETOWORD, 0, 18, &sgptDataTables->pSoundsLinker }, { "HitSound", TXTFIELD_NAMETOWORD, 0, 20, &sgptDataTables->pSoundsLinker }, { "ProgSound", TXTFIELD_NAMETOWORD, 0, 52, &sgptDataTables->pSoundsLinker }, { "ProgOverlay", TXTFIELD_NAMETOWORD, 0, 54, &sgptDataTables->pOverlayLinker }, { "ExplosionMissile", TXTFIELD_NAMETOWORD, 0, 22, &sgptDataTables->pMissilesLinker }, { "SubMissile1", TXTFIELD_NAMETOWORD, 0, 24, &sgptDataTables->pMissilesLinker }, { "SubMissile2", TXTFIELD_NAMETOWORD, 0, 26, &sgptDataTables->pMissilesLinker }, { "SubMissile3", TXTFIELD_NAMETOWORD, 0, 28, &sgptDataTables->pMissilesLinker }, { "HitSubMissile1", TXTFIELD_NAMETOWORD, 0, 36, &sgptDataTables->pMissilesLinker }, { "HitSubMissile2", TXTFIELD_NAMETOWORD, 0, 38, &sgptDataTables->pMissilesLinker }, { "HitSubMissile3", TXTFIELD_NAMETOWORD, 0, 40, &sgptDataTables->pMissilesLinker }, { "HitSubMissile4", TXTFIELD_NAMETOWORD, 0, 42, &sgptDataTables->pMissilesLinker }, { "CltSubMissile1", TXTFIELD_NAMETOWORD, 0, 30, &sgptDataTables->pMissilesLinker }, { "CltSubMissile2", TXTFIELD_NAMETOWORD, 0, 32, &sgptDataTables->pMissilesLinker }, { "CltSubMissile3", TXTFIELD_NAMETOWORD, 0, 34, &sgptDataTables->pMissilesLinker }, { "CltHitSubMissile1", TXTFIELD_NAMETOWORD, 0, 44, &sgptDataTables->pMissilesLinker }, { "CltHitSubMissile2", TXTFIELD_NAMETOWORD, 0, 46, &sgptDataTables->pMissilesLinker }, { "CltHitSubMissile3", TXTFIELD_NAMETOWORD, 0, 48, &sgptDataTables->pMissilesLinker }, { "CltHitSubMissile4", TXTFIELD_NAMETOWORD, 0, 50, &sgptDataTables->pMissilesLinker }, { "ResultFlags", TXTFIELD_WORD, 0, 172, NULL }, { "HitFlags", TXTFIELD_DWORD2, 0, 168, NULL }, { "HitClass", TXTFIELD_BYTE, 0, 148, NULL }, { "Range", TXTFIELD_WORD, 0, 150, NULL }, { "LevRange", TXTFIELD_WORD, 0, 152, NULL }, { "KnockBack", TXTFIELD_BYTE, 0, 174, NULL }, { "animrate", TXTFIELD_WORD, 0, 160, NULL }, { "xoffset", TXTFIELD_WORD, 0, 162, NULL }, { "yoffset", TXTFIELD_WORD, 0, 164, NULL }, { "zoffset", TXTFIELD_WORD, 0, 166, NULL }, { "MissileSkill", TXTFIELD_BIT, 15, 4, NULL }, { "Skill", TXTFIELD_NAMETOWORD, 0, 404, &sgptDataTables->iSkillCode }, { "MinDamage", TXTFIELD_DWORD, 0, 176, NULL }, { "MinLevDam1", TXTFIELD_DWORD, 0, 184, NULL }, { "MinLevDam2", TXTFIELD_DWORD, 0, 188, NULL }, { "MinLevDam3", TXTFIELD_DWORD, 0, 192, NULL }, { "MinLevDam4", TXTFIELD_DWORD, 0, 196, NULL }, { "MinLevDam5", TXTFIELD_DWORD, 0, 200, NULL }, { "MaxDamage", TXTFIELD_DWORD, 0, 180, NULL }, { "MaxLevDam1", TXTFIELD_DWORD, 0, 204, NULL }, { "MaxLevDam2", TXTFIELD_DWORD, 0, 208, NULL }, { "MaxLevDam3", TXTFIELD_DWORD, 0, 212, NULL }, { "MaxLevDam4", TXTFIELD_DWORD, 0, 216, NULL }, { "MaxLevDam5", TXTFIELD_DWORD, 0, 220, NULL }, { "DmgSymPerCalc", TXTFIELD_CALCTODWORD, 0, 224, DATATBLS_MissileCalcLinker }, { "EType", TXTFIELD_CODETOBYTE, 0, 228, &sgptDataTables->pElemTypesLinker }, { "EMin", TXTFIELD_DWORD, 0, 232, NULL }, { "MinELev1", TXTFIELD_DWORD, 0, 240, NULL }, { "MinELev2", TXTFIELD_DWORD, 0, 244, NULL }, { "MinELev3", TXTFIELD_DWORD, 0, 248, NULL }, { "MinELev4", TXTFIELD_DWORD, 0, 252, NULL }, { "MinELev5", TXTFIELD_DWORD, 0, 256, NULL }, { "EMax", TXTFIELD_DWORD, 0, 236, NULL }, { "MaxELev1", TXTFIELD_DWORD, 0, 260, NULL }, { "MaxELev2", TXTFIELD_DWORD, 0, 264, NULL }, { "MaxELev3", TXTFIELD_DWORD, 0, 268, NULL }, { "MaxELev4", TXTFIELD_DWORD, 0, 272, NULL }, { "MaxELev5", TXTFIELD_DWORD, 0, 276, NULL }, { "EDmgSymPerCalc", TXTFIELD_CALCTODWORD, 0, 280, DATATBLS_MissileCalcLinker }, { "ELen", TXTFIELD_DWORD, 0, 284, NULL }, { "ELevLen1", TXTFIELD_DWORD, 0, 288, NULL }, { "ELevLen2", TXTFIELD_DWORD, 0, 292, NULL }, { "ELevLen3", TXTFIELD_DWORD, 0, 296, NULL }, { "CltSrcTown", TXTFIELD_BYTE, 0, 300, NULL }, { "SrcDamage", TXTFIELD_BYTE, 0, 301, NULL }, { "SrcMissDmg", TXTFIELD_BYTE, 0, 302, NULL }, { "Half2HSrc", TXTFIELD_BIT, 14, 4, NULL }, { "Vel", TXTFIELD_BYTE, 0, 154, NULL }, { "VelLev", TXTFIELD_BYTE, 0, 155, NULL }, { "MaxVel", TXTFIELD_BYTE, 0, 156, NULL }, { "Accel", TXTFIELD_WORD, 0, 158, NULL }, { "Holy", TXTFIELD_BYTE, 0, 303, NULL }, { "Light", TXTFIELD_BYTE, 0, 304, NULL }, { "Flicker", TXTFIELD_BYTE, 0, 305, NULL }, { "Red", TXTFIELD_BYTE, 0, 306, NULL }, { "Green", TXTFIELD_BYTE, 0, 307, NULL }, { "Blue", TXTFIELD_BYTE, 0, 308, NULL }, { "InitSteps", TXTFIELD_BYTE, 0, 309, NULL }, { "Activate", TXTFIELD_BYTE, 0, 310, NULL }, { "LoopAnim", TXTFIELD_BYTE, 0, 311, NULL }, { "CelFile", TXTFIELD_ASCII, 64, 312, NULL }, { "AnimLen", TXTFIELD_BYTE, 0, 376, NULL }, { "RandStart", TXTFIELD_DWORD, 0, 380, NULL }, { "SubLoop", TXTFIELD_BYTE, 0, 384, NULL }, { "SubStart", TXTFIELD_BYTE, 0, 385, NULL }, { "SubStop", TXTFIELD_BYTE, 0, 386, NULL }, { "CollideType", TXTFIELD_BYTE, 0, 387, NULL }, { "CollideKill", TXTFIELD_BYTE, 0, 390, NULL }, { "CollideFriend", TXTFIELD_BYTE, 0, 391, NULL }, { "Collision", TXTFIELD_BYTE, 0, 388, NULL }, { "ClientCol", TXTFIELD_BYTE, 0, 389, NULL }, { "NextHit", TXTFIELD_BYTE, 0, 392, NULL }, { "NextDelay", TXTFIELD_BYTE, 0, 393, NULL }, { "Size", TXTFIELD_BYTE, 0, 394, NULL }, { "ToHit", TXTFIELD_BYTE, 0, 395, NULL }, { "AlwaysExplode", TXTFIELD_BYTE, 0, 396, NULL }, { "Trans", TXTFIELD_BYTE, 0, 397, NULL }, { "Qty", TXTFIELD_BYTE, 0, 398, NULL }, { "SpecialSetup", TXTFIELD_DWORD, 0, 400, NULL }, { "HitShift", TXTFIELD_BYTE, 0, 406, NULL }, { "NumDirections", TXTFIELD_BYTE, 0, 416, NULL }, { "AnimSpeed", TXTFIELD_BYTE, 0, 417, NULL }, { "LocalBlood", TXTFIELD_BYTE, 0, 418, NULL }, { "DamageRate", TXTFIELD_DWORD, 0, 412, NULL }, { "end", TXTFIELD_NONE, 0, 0, NULL }, }; sgptDataTables->pMissilesLinker = (D2TxtLinkStrc*)FOG_AllocLinker(__FILE__, __LINE__); sgptDataTables->pMissilesTxt = (D2MissilesTxt*)DATATBLS_CompileTxt(pMemPool, "missiles", pTbl, &sgptDataTables->nMissilesTxtRecordCount, sizeof(D2MissilesTxt)); for (int i = 0; i < sgptDataTables->nMissilesTxtRecordCount; ++i) { if (sgptDataTables->pMissilesTxt[i].nCollideType > 8) { FOG_WriteToLogFile("Range error in entry %d in table '%s' field '%s'. Value must be between %d and %d.", i, "missiles", "CollideType", 0, 8); } if (sgptDataTables->pMissilesTxt[i].nCollideType < 0) { sgptDataTables->pMissilesTxt[i].nCollideType = 0; } else if (sgptDataTables->pMissilesTxt[i].nCollideType > 8) { sgptDataTables->pMissilesTxt[i].nCollideType = 8; } } DATATBLS_GetBinFileHandle(pMemPool, "misscode", (void**)&sgptDataTables->pMissCode, (int*)&sgptDataTables->nMissCodeSize, &sgptDataTables->nMissCodeSizeEx); } //D2Common.0x6FD64B80 void __fastcall DATATBLS_UnloadMissilesTxt() { if (sgptDataTables->pMissCode) { FOG_FreeServerMemory(NULL, sgptDataTables->pMissCode, __FILE__, __LINE__, 0); sgptDataTables->pMissCode = NULL; } sgptDataTables->nMissCodeSize = 0; sgptDataTables->nMissCodeSizeEx = 0; if (sgptDataTables->pMissilesTxt) { DATATBLS_UnloadBin(sgptDataTables->pMissilesTxt); sgptDataTables->pMissilesTxt = NULL; } if (sgptDataTables->pMissilesLinker) { FOG_FreeLinker(sgptDataTables->pMissilesLinker); sgptDataTables->pMissilesLinker = NULL; } sgptDataTables->nMissilesTxtRecordCount = 0; } //D2Common.0x6FD64BE0 (#10590) int __stdcall DATATBLS_GetMissileVelocityFromMissilesTxt(int nMissileId, int nLevel) { D2MissilesTxt* pMissilesTxtRecord = DATATBLS_GetMissilesTxtRecord(nMissileId); if (pMissilesTxtRecord) { return pMissilesTxtRecord->nVel + nLevel * pMissilesTxtRecord->nVelLev / 8; } return 0; } //Inlined at various places D2MissilesTxt* __fastcall DATATBLS_GetMissilesTxtRecord(int nMissileId) { D2MissilesTxt* pMissilesTxtRecord = NULL; if (nMissileId >= 0 && nMissileId < sgptDataTables->nMissilesTxtRecordCount) { return &sgptDataTables->pMissilesTxt[nMissileId]; } return NULL; }
34.228495
195
0.663787
eezstreet
a68ed078978ca1c9a926934a97edbe9cb27275a4
3,614
cpp
C++
MenuSelection.cpp
kaitokidi/0hgamejam3
b344c793ef87f931e46ef15dde99346f5bc68b06
[ "MIT" ]
null
null
null
MenuSelection.cpp
kaitokidi/0hgamejam3
b344c793ef87f931e46ef15dde99346f5bc68b06
[ "MIT" ]
null
null
null
MenuSelection.cpp
kaitokidi/0hgamejam3
b344c793ef87f931e46ef15dde99346f5bc68b06
[ "MIT" ]
null
null
null
#include "MenuSelection.hpp" MenuSelection::MenuSelection() { open = true; } MenuSelection::~MenuSelection(){} void MenuSelection::notAnimation(){ wantAnimation = false; } void MenuSelection::animation(){ wantAnimation = true; } int MenuSelection::select(sf::RenderWindow* window, std::vector<std::string> &buttonNames){ int qttyButtons = buttonNames.size(); sf::Vector2f buttonSize(window->getSize().x/(qttyButtons+2), window->getSize().y/6); sf::Font font; sf::Texture text; if(!font.loadFromFile("res/fonts/font.otf")){ std::cerr << "Can't find the font file" << std::endl; } open = true; while(open){ sf::Event event; while (window->pollEvent(event)) { switch (event.type) { case sf::Event::Closed: window->close(); break; case sf::Event::KeyPressed: if (event.key.code == sf::Keyboard::Escape) window->close(); break; default: break; } } window->display(); } } void MenuSelection::display(sf::RenderWindow* window, std::string pathImage){ open = true; t.loadFromFile(pathImage); s = sf::Sprite(); s.setTexture(t); s.scale(window->getSize().y/s.getGlobalBounds().height,window->getSize().y/s.getGlobalBounds().height); s.setPosition(window->getSize().x/2 - s.getGlobalBounds().width/2, 0); while(open){ sf::Event event; while (window->pollEvent(event)) { switch (event.type) { case sf::Event::Closed: window->close(); break; case sf::Event::KeyPressed: if (event.key.code == sf::Keyboard::Escape) window->close(); break; case sf::Event::MouseButtonPressed: if (event.mouseButton.button == sf::Mouse::Left) { open = false; } break; default: break; } //ANDROID if(event.type == sf::Event::TouchEnded) open = false; break; } window->clear(); window->draw(s); window->display(); } sf::Clock timer; sf::Sprite dark; sf::Texture text; bool closing = true; text.loadFromFile("res/pics/black.png"); dark.setTexture(text); dark.setOrigin(dark.getLocalBounds().width/2,dark.getLocalBounds().height/2); dark.setPosition(window->getSize().x/2,window->getSize().y/2); float scale = 1/dark.getGlobalBounds().width;; float time = 0; while(closing and wantAnimation){ dark.setScale(scale,scale); time += timer.restart().asSeconds(); if(time > 0.1){ scale *= 1.5; time = 0; } window->clear(); window->draw(s); window->draw(dark); window->display(); if(dark.getGlobalBounds().width > window->getSize().x) closing = false; } //clean events sf::Event e; while (window->pollEvent(e)) { } }
31.982301
115
0.465412
kaitokidi
a68f0e6bd1de89dc081a4f309db3b7bf99110e6a
311
hpp
C++
include/pkg/path_not_a_directory_error.hpp
naughtybikergames/pkg
9a78380c6cf82c95dec3968a7ed69000b349113d
[ "MIT" ]
null
null
null
include/pkg/path_not_a_directory_error.hpp
naughtybikergames/pkg
9a78380c6cf82c95dec3968a7ed69000b349113d
[ "MIT" ]
null
null
null
include/pkg/path_not_a_directory_error.hpp
naughtybikergames/pkg
9a78380c6cf82c95dec3968a7ed69000b349113d
[ "MIT" ]
null
null
null
#ifndef PKG_PATH_NOT_A_DIRECTORY_ERROR_HPP #define PKG_PATH_NOT_A_DIRECTORY_ERROR_HPP #include "pkg_error.hpp" #include <string> namespace pkg { class path_not_a_directory_error : public pkg_error { public: path_not_a_directory_error(const std::string &path) throw(); }; } #endif
20.733333
72
0.73955
naughtybikergames
a6919b45fc4615fc61c7921923382d38a0b13487
5,299
hpp
C++
src/allocator.hpp
Zoxc/mirb
14c2fe2d2a026fb3bb62c883e8839e1078ebc3b6
[ "BSD-3-Clause" ]
10
2016-10-06T06:22:20.000Z
2022-02-28T05:33:09.000Z
src/allocator.hpp
Zoxc/mirb
14c2fe2d2a026fb3bb62c883e8839e1078ebc3b6
[ "BSD-3-Clause" ]
null
null
null
src/allocator.hpp
Zoxc/mirb
14c2fe2d2a026fb3bb62c883e8839e1078ebc3b6
[ "BSD-3-Clause" ]
3
2018-01-08T03:34:34.000Z
2021-09-12T12:12:22.000Z
#pragma once #include "common.hpp" #include <Prelude/Allocator.hpp> #include <Prelude/LinkedList.hpp> #include "value.hpp" namespace Mirb { class Collector; // PinnedHeader are objects with a fixed memory address class PinnedHeader: public Value { private: #ifndef VALGRIND LinkedListEntry<PinnedHeader> entry; #endif friend class Collector; public: PinnedHeader(Type::Enum type) : Value(type) {} }; class VariableBlock: public PinnedHeader { private: public: VariableBlock(size_t bytes) : PinnedHeader(Type::InternalVariableBlock), bytes(bytes) {} static VariableBlock &from_memory(const void *memory) { auto result = (VariableBlock *)((const char_t *)memory - sizeof(VariableBlock)); result->assert_alive(); mirb_debug_assert(result->type() == Type::InternalVariableBlock); return *result; } void *data() { return (void *)((size_t)this + sizeof(VariableBlock)); } size_t bytes; template<typename F> void mark(F) { } }; class TupleBase { static Tuple<Value> *allocate_value_tuple(size_t size); static Tuple<Object> *allocate_tuple(size_t size); template<class T> friend struct TupleUtil; }; template<class T> struct TupleUtil { static const Type::Enum type = Type::InternalTuple; template<typename F> static void mark(F mark, T *&field) { if(field) mark(field); } static Tuple<T> *allocate(size_t size) { return (Tuple<T> *)TupleBase::allocate_tuple(size); } }; template<> struct TupleUtil<Value> { static const Type::Enum type = Type::InternalValueTuple; template<typename F> static void mark(F mark, Value *&field) { mark(field); } static Tuple<> *allocate(size_t size) { return TupleBase::allocate_value_tuple(size); } }; template<class T> class Tuple: public PinnedHeader { private: public: Tuple(size_t entries) : PinnedHeader(TupleUtil<T>::type), entries(entries) {} T *&operator[](size_t index) { #ifdef DEBUG if(this) mirb_debug_assert(index < entries); #endif return ((T **)((size_t)this + sizeof(Tuple)))[index]; } size_t entries; template<typename F> void mark(F mark) { for(size_t i = 0; i < entries; ++i) TupleUtil<T>::mark(mark, (*this)[i]); } Tuple *copy_and_prepend(T *value) { Tuple *result = allocate(entries + 1); for(size_t i = 0; i < entries; ++i) (*result)[i + 1] = (*this)[i]; (*result)[0] = value; return result; } T *first() { mirb_debug_assert(entries > 0); return (*this)[0]; } T *last() { mirb_debug_assert(entries > 0); return (*this)[entries - 1]; } static Tuple *allocate(size_t size) { return TupleUtil<T>::allocate(size); } }; typedef Prelude::Allocator::Standard AllocatorBase; class AllocatorPrivate { template<typename T> static Tuple<T> *allocate_tuple(size_t size); template<class A, class BaseAllocator> friend class Allocator; template<class T> struct Null { static const T value; }; }; template<> struct AllocatorPrivate::Null<value_t> { static const value_t value; }; template<class T> const T AllocatorPrivate::Null<T>::value = nullptr; template<class A, class BaseAllocator> class Allocator: public BaseAllocator::ReferenceBase { public: typedef BaseAllocator Base; typename Base::Reference reference() { return Base::default_reference; } static const bool null_references = true; typedef typename std::iterator_traits<A>::value_type ArrayBase; typedef Tuple<ArrayBase> TupleObj; class Storage { private: Storage(TupleObj *array) : array(array) {} friend class Allocator; public: TupleObj *array; Storage() { #ifdef DEBUG array = nullptr; #endif } Storage &operator =(decltype(nullptr) null prelude_unused) { mirb_debug_assert(null == nullptr); array = nullptr; return *this; } Storage &operator =(const Storage &other) { array = other.array; return *this; } operator bool() const { return array != 0; } A &operator [](size_t index) const { return (*array)[index]; } }; Allocator(typename Base::Reference = Base::default_reference) {} Allocator(const Allocator &) {} void null(A &ref) { ref = AllocatorPrivate::Null<A>::value; } Storage allocate(size_t size) { TupleObj &result = *TupleObj::allocate(size); for(size_t i = 0; i < size; ++i) result[i] = AllocatorPrivate::Null<A>::value; return Storage(&result); } Storage reallocate(const Storage &old, size_t old_size, size_t new_size) { TupleObj &result = *TupleObj::allocate(new_size); for(size_t i = 0; i < old_size; ++i) result[i] = (*old.array)[i]; for(size_t i = old_size; i < new_size; ++i) result[i] = AllocatorPrivate::Null<A>::value; return Storage(&result); } void free(const Storage &) {} }; extern Collector &collector; }; void *operator new(size_t bytes, Mirb::Collector &) throw(); void operator delete(void *, Mirb::Collector &) throw();
19.553506
91
0.628609
Zoxc
a693329ed8fec9fb0139ded22af46cc6556aabb3
628,759
cpp
C++
iOS/Classes/Native/Bulk_UnityEngine.UI_1.cpp
mopsicus/unity-share-plugin-ios-android
3ee99aef36034a1e4d7b156172953f9b4dfa696f
[ "MIT" ]
11
2016-07-22T19:58:09.000Z
2021-09-21T12:51:40.000Z
iOS/Classes/Native/Bulk_UnityEngine.UI_1.cpp
mopsicus/unity-share-plugin-ios-android
3ee99aef36034a1e4d7b156172953f9b4dfa696f
[ "MIT" ]
1
2018-05-07T14:32:13.000Z
2018-05-08T09:15:30.000Z
iOS/Classes/Native/Bulk_UnityEngine.UI_1.cpp
mopsicus/unity-share-plugin-ios-android
3ee99aef36034a1e4d7b156172953f9b4dfa696f
[ "MIT" ]
null
null
null
#include "il2cpp-config.h" #ifndef _MSC_VER # include <alloca.h> #else # include <malloc.h> #endif #include <cstring> #include <string.h> #include <stdio.h> #include <cmath> #include <limits> #include <assert.h> // UnityEngine.UI.MaskableGraphic struct MaskableGraphic_t3186046376; // UnityEngine.UI.MaskableGraphic/CullStateChangedEvent struct CullStateChangedEvent_t2290505109; // UnityEngine.Material struct Material_t3870600107; // UnityEngine.UI.Mask struct Mask_t8826680; // System.Object struct Il2CppObject; // UnityEngine.RectTransform struct RectTransform_t972643934; // UnityEngine.UI.MaskUtilities struct MaskUtilities_t3879688356; // UnityEngine.Component struct Component_t3501516275; // System.Collections.Generic.List`1<UnityEngine.Component> struct List_1_t574734531; // System.Collections.Generic.List`1<System.Object> struct List_1_t1244034627; // UnityEngine.Transform struct Transform_t1659122786; // System.Collections.Generic.List`1<UnityEngine.Canvas> struct List_1_t4095326316; // System.Collections.Generic.List`1<UnityEngine.UI.Mask> struct List_1_t1377012232; // UnityEngine.UI.RectMask2D struct RectMask2D_t3357079374; // UnityEngine.UI.IClippable struct IClippable_t502791197; // System.Collections.Generic.List`1<UnityEngine.UI.RectMask2D> struct List_1_t430297630; // UnityEngine.Object struct Object_t3071478659; // UnityEngine.UI.Selectable struct Selectable_t1885181538; // UnityEngine.UI.Outline struct Outline_t3745177896; // UnityEngine.UI.VertexHelper struct VertexHelper_t3377436606; // UnityEngine.UI.PositionAsUV1 struct PositionAsUV1_t4062429115; // UnityEngine.UI.RawImage struct RawImage_t821930207; // UnityEngine.Texture struct Texture_t2526458961; // UnityEngine.UI.RectangularVertexClipper struct RectangularVertexClipper_t1294793591; // UnityEngine.Canvas struct Canvas_t2727140764; // UnityEngine.Camera struct Camera_t2727095145; // UnityEngine.UI.Scrollbar struct Scrollbar_t2601556940; // UnityEngine.UI.Scrollbar/ScrollEvent struct ScrollEvent_t3541123425; // UnityEngine.EventSystems.PointerEventData struct PointerEventData_t1848751023; // System.Collections.IEnumerator struct IEnumerator_t3464575207; // UnityEngine.EventSystems.AxisEventData struct AxisEventData_t3355659985; // UnityEngine.UI.Scrollbar/<ClickRepeat>c__Iterator5 struct U3CClickRepeatU3Ec__Iterator5_t99988271; // UnityEngine.UI.ScrollRect struct ScrollRect_t3606982749; // UnityEngine.UI.ScrollRect/ScrollRectEvent struct ScrollRectEvent_t1643322606; // System.Collections.Generic.List`1<UnityEngine.UI.Selectable> struct List_1_t3253367090; // UnityEngine.UI.AnimationTriggers struct AnimationTriggers_t115197445; // UnityEngine.UI.Graphic struct Graphic_t836799438; // UnityEngine.UI.Image struct Image_t538875265; // UnityEngine.Animator struct Animator_t2776330603; // System.Collections.Generic.List`1<UnityEngine.CanvasGroup> struct List_1_t775636365; // UnityEngine.Sprite struct Sprite_t3199167241; // System.String struct String_t; // UnityEngine.EventSystems.BaseEventData struct BaseEventData_t2054899105; // UnityEngine.UI.Shadow struct Shadow_t75537580; // System.Collections.Generic.List`1<UnityEngine.UIVertex> struct List_1_t1317283468; // UnityEngine.UI.Slider struct Slider_t79469677; // UnityEngine.UI.Slider/SliderEvent struct SliderEvent_t2627072750; // UnityEngine.UI.StencilMaterial/MatEntry struct MatEntry_t1574154081; // UnityEngine.UI.Text struct Text_t9039225; // UnityEngine.TextGenerator struct TextGenerator_t538854556; // UnityEngine.Font struct Font_t4241557075; // UnityEngine.UI.Toggle struct Toggle_t110812896; // UnityEngine.UI.ToggleGroup struct ToggleGroup_t1990156785; // UnityEngine.UI.Toggle/ToggleEvent struct ToggleEvent_t2331340366; // System.Collections.Generic.IEnumerable`1<UnityEngine.UI.Toggle> struct IEnumerable_1_t3411725853; // System.Func`2<UnityEngine.UI.Toggle,System.Boolean> struct Func_2_t3137578243; // System.Collections.Generic.IEnumerable`1<System.Object> struct IEnumerable_1_t3176762032; // System.Func`2<System.Object,System.Boolean> struct Func_2_t785513668; // UnityEngine.Mesh struct Mesh_t4241756145; // UnityEngine.UIVertex[] struct UIVertexU5BU5D_t1796391381; // System.Collections.Generic.List`1<System.Int32> struct List_1_t2522024052; // UnityEngine.UI.VerticalLayoutGroup struct VerticalLayoutGroup_t423167365; #include "class-internals.h" #include "codegen/il2cpp-codegen.h" #include "mscorlib_System_Array1146569071.h" #include "UnityEngine_UI_UnityEngine_UI_MaskableGraphic3186046376.h" #include "UnityEngine_UI_UnityEngine_UI_MaskableGraphic3186046376MethodDeclarations.h" #include "mscorlib_System_Void2863195528.h" #include "UnityEngine_UI_UnityEngine_UI_MaskableGraphic_Cull2290505109MethodDeclarations.h" #include "UnityEngine_UI_UnityEngine_UI_Graphic836799438MethodDeclarations.h" #include "mscorlib_System_Boolean476798718.h" #include "UnityEngine_UI_UnityEngine_UI_MaskableGraphic_Cull2290505109.h" #include "UnityEngine_ArrayTypes.h" #include "UnityEngine_UnityEngine_Vector34282066566.h" #include "UnityEngine_UI_UnityEngine_UI_Graphic836799438.h" #include "UnityEngine_UnityEngine_Material3870600107.h" #include "UnityEngine_UnityEngine_Component3501516275MethodDeclarations.h" #include "UnityEngine_UI_UnityEngine_UI_MaskUtilities3879688356MethodDeclarations.h" #include "UnityEngine_UnityEngine_Object3071478659MethodDeclarations.h" #include "UnityEngine_UI_UnityEngine_UI_StencilMaterial639665897MethodDeclarations.h" #include "UnityEngine_UnityEngine_Transform1659122786.h" #include "mscorlib_System_Int321153838500.h" #include "UnityEngine_UI_UnityEngine_UI_Mask8826680.h" #include "UnityEngine_UnityEngine_Component3501516275.h" #include "UnityEngine_UnityEngine_Object3071478659.h" #include "UnityEngine_UnityEngine_Rendering_StencilOp3324967291.h" #include "UnityEngine_UnityEngine_Rendering_CompareFunction2661816155.h" #include "UnityEngine_UnityEngine_Rendering_ColorWriteMask3214369688.h" #include "UnityEngine_UnityEngine_Rect4241904616.h" #include "UnityEngine_UnityEngine_CanvasRenderer3950887807MethodDeclarations.h" #include "UnityEngine_UnityEngine_Rect4241904616MethodDeclarations.h" #include "UnityEngine_UnityEngine_CanvasRenderer3950887807.h" #include "UnityEngine_UnityEngine_Events_UnityEvent_1_gen663396231MethodDeclarations.h" #include "UnityEngine_UnityEngine_Behaviour200106419MethodDeclarations.h" #include "UnityEngine_UnityEngine_RectTransform972643934MethodDeclarations.h" #include "UnityEngine_UnityEngine_Canvas2727140764MethodDeclarations.h" #include "UnityEngine_UnityEngine_Transform1659122786MethodDeclarations.h" #include "UnityEngine_UnityEngine_Canvas2727140764.h" #include "UnityEngine_UnityEngine_RectTransform972643934.h" #include "mscorlib_System_Single4291918972.h" #include "UnityEngine_UI_UnityEngine_UI_RectMask2D3357079374MethodDeclarations.h" #include "UnityEngine_UI_UnityEngine_UI_RectMask2D3357079374.h" #include "UnityEngine_UI_UnityEngine_EventSystems_UIBehaviou2511441271MethodDeclarations.h" #include "UnityEngine_UI_UnityEngine_EventSystems_UIBehaviou2511441271.h" #include "UnityEngine_UI_UnityEngine_UI_MaskUtilities3879688356.h" #include "mscorlib_System_Object4170816371MethodDeclarations.h" #include "UnityEngine_UI_UnityEngine_UI_ListPool_1_gen2599153559MethodDeclarations.h" #include "mscorlib_System_Collections_Generic_List_1_gen574734531MethodDeclarations.h" #include "mscorlib_System_Collections_Generic_List_1_gen574734531.h" #include "UnityEngine_UnityEngine_GameObject3674682005.h" #include "UnityEngine_UI_UnityEngine_UI_ListPool_1_gen1824778048MethodDeclarations.h" #include "mscorlib_System_Collections_Generic_List_1_gen4095326316MethodDeclarations.h" #include "mscorlib_System_Collections_Generic_List_1_gen4095326316.h" #include "UnityEngine_UI_UnityEngine_UI_ListPool_1_gen3401431260MethodDeclarations.h" #include "mscorlib_System_Collections_Generic_List_1_gen1377012232MethodDeclarations.h" #include "UnityEngine_UI_UnityEngine_UI_Mask8826680MethodDeclarations.h" #include "mscorlib_System_Collections_Generic_List_1_gen1377012232.h" #include "UnityEngine_UI_UnityEngine_UI_ListPool_1_gen2454716658MethodDeclarations.h" #include "mscorlib_System_Collections_Generic_List_1_gen430297630MethodDeclarations.h" #include "mscorlib_System_Collections_Generic_List_1_gen430297630.h" #include "UnityEngine_UI_UnityEngine_UI_Misc8834360.h" #include "UnityEngine_UI_UnityEngine_UI_Misc8834360MethodDeclarations.h" #include "UnityEngine_UnityEngine_Application2856536070MethodDeclarations.h" #include "UnityEngine_UnityEngine_GameObject3674682005MethodDeclarations.h" #include "UnityEngine_UI_UnityEngine_UI_Navigation1108456480.h" #include "UnityEngine_UI_UnityEngine_UI_Navigation1108456480MethodDeclarations.h" #include "UnityEngine_UI_UnityEngine_UI_Navigation_Mode356329147.h" #include "UnityEngine_UI_UnityEngine_UI_Selectable1885181538.h" #include "UnityEngine_UI_UnityEngine_UI_Navigation_Mode356329147MethodDeclarations.h" #include "UnityEngine_UI_UnityEngine_UI_Outline3745177896.h" #include "UnityEngine_UI_UnityEngine_UI_Outline3745177896MethodDeclarations.h" #include "UnityEngine_UI_UnityEngine_UI_Shadow75537580MethodDeclarations.h" #include "UnityEngine_UI_UnityEngine_UI_VertexHelper3377436606.h" #include "UnityEngine_UI_UnityEngine_UI_ListPool_1_gen3341702496MethodDeclarations.h" #include "UnityEngine_UI_UnityEngine_UI_VertexHelper3377436606MethodDeclarations.h" #include "mscorlib_System_Collections_Generic_List_1_gen1317283468MethodDeclarations.h" #include "UnityEngine_UnityEngine_Color32598853688MethodDeclarations.h" #include "mscorlib_System_Collections_Generic_List_1_gen1317283468.h" #include "UnityEngine_UnityEngine_Vector24282066565.h" #include "UnityEngine_UnityEngine_Color4194546905.h" #include "UnityEngine_UnityEngine_Color32598853688.h" #include "UnityEngine_UI_UnityEngine_UI_PositionAsUV14062429115.h" #include "UnityEngine_UI_UnityEngine_UI_PositionAsUV14062429115MethodDeclarations.h" #include "UnityEngine_UI_UnityEngine_UI_BaseMeshEffect2306480155MethodDeclarations.h" #include "UnityEngine_UnityEngine_Vector24282066565MethodDeclarations.h" #include "UnityEngine_UnityEngine_UIVertex4244065212.h" #include "UnityEngine_UI_UnityEngine_UI_RawImage821930207.h" #include "UnityEngine_UI_UnityEngine_UI_RawImage821930207MethodDeclarations.h" #include "UnityEngine_UnityEngine_Texture2526458961.h" #include "UnityEngine_UnityEngine_Material3870600107MethodDeclarations.h" #include "UnityEngine_UnityEngine_Texture2D3884108195.h" #include "UnityEngine_UnityEngine_Mathf4203372500MethodDeclarations.h" #include "UnityEngine_UnityEngine_Texture2526458961MethodDeclarations.h" #include "UnityEngine_UnityEngine_Vector44282066567MethodDeclarations.h" #include "UnityEngine_UnityEngine_Vector34282066566MethodDeclarations.h" #include "UnityEngine_UnityEngine_Vector44282066567.h" #include "UnityEngine_UI_UnityEngine_UI_RectangularVertexCli1294793591.h" #include "UnityEngine_UI_UnityEngine_UI_RectangularVertexCli1294793591MethodDeclarations.h" #include "mscorlib_System_Collections_Generic_List_1_gen1870976749MethodDeclarations.h" #include "mscorlib_System_Collections_Generic_List_1_gen1870976749.h" #include "UnityEngine_UI_UnityEngine_UI_ClipperRegistry1074114320MethodDeclarations.h" #include "UnityEngine_UnityEngine_Camera2727095145.h" #include "UnityEngine_UnityEngine_RectTransformUtility3025555048MethodDeclarations.h" #include "UnityEngine_UI_UnityEngine_UI_Clipping1257491342MethodDeclarations.h" #include "UnityEngine_UI_UnityEngine_UI_Scrollbar2601556940.h" #include "UnityEngine_UI_UnityEngine_UI_Scrollbar2601556940MethodDeclarations.h" #include "UnityEngine_UI_UnityEngine_UI_Scrollbar_ScrollEven3541123425MethodDeclarations.h" #include "UnityEngine_UI_UnityEngine_UI_Selectable1885181538MethodDeclarations.h" #include "UnityEngine_UI_UnityEngine_UI_Scrollbar_ScrollEven3541123425.h" #include "UnityEngine_UI_UnityEngine_UI_SetPropertyUtility1171612705MethodDeclarations.h" #include "UnityEngine_UI_UnityEngine_UI_SetPropertyUtility1171612705.h" #include "UnityEngine_UI_UnityEngine_UI_Scrollbar_Direction522766867.h" #include "UnityEngine_UI_UnityEngine_UI_CanvasUpdate2847075725.h" #include "UnityEngine_UnityEngine_DrivenRectTransformTracker4185719096MethodDeclarations.h" #include "UnityEngine_UnityEngine_DrivenRectTransformTracker4185719096.h" #include "UnityEngine_UnityEngine_Events_UnityEvent_1_gen183549189MethodDeclarations.h" #include "UnityEngine_UI_UnityEngine_UI_Scrollbar_Axis4294105229.h" #include "UnityEngine_UnityEngine_DrivenTransformProperties624110065.h" #include "UnityEngine_UI_UnityEngine_EventSystems_PointerEve1848751023.h" #include "UnityEngine_UI_UnityEngine_EventSystems_PointerEve1848751023MethodDeclarations.h" #include "UnityEngine_UI_UnityEngine_EventSystems_PointerEven384979233.h" #include "UnityEngine_UnityEngine_MonoBehaviour667441552MethodDeclarations.h" #include "UnityEngine_UnityEngine_Coroutine3621161934.h" #include "UnityEngine_UI_UnityEngine_UI_Scrollbar_U3CClickRepe99988271MethodDeclarations.h" #include "UnityEngine_UI_UnityEngine_UI_Scrollbar_U3CClickRepe99988271.h" #include "UnityEngine_UI_UnityEngine_EventSystems_AxisEventD3355659985.h" #include "UnityEngine_UI_UnityEngine_EventSystems_AxisEventD3355659985MethodDeclarations.h" #include "UnityEngine_UI_UnityEngine_EventSystems_MoveDirect2840182460.h" #include "mscorlib_System_Object4170816371.h" #include "UnityEngine_UnityEngine_WaitForEndOfFrame2372756133MethodDeclarations.h" #include "mscorlib_System_UInt3224667981.h" #include "UnityEngine_UnityEngine_WaitForEndOfFrame2372756133.h" #include "mscorlib_System_NotSupportedException1732551818MethodDeclarations.h" #include "mscorlib_System_NotSupportedException1732551818.h" #include "UnityEngine_UI_UnityEngine_UI_Scrollbar_Axis4294105229MethodDeclarations.h" #include "UnityEngine_UI_UnityEngine_UI_Scrollbar_Direction522766867MethodDeclarations.h" #include "UnityEngine_UI_UnityEngine_UI_ScrollRect3606982749.h" #include "UnityEngine_UI_UnityEngine_UI_ScrollRect3606982749MethodDeclarations.h" #include "UnityEngine_UI_UnityEngine_UI_ScrollRect_ScrollRec1643322606MethodDeclarations.h" #include "UnityEngine_UI_UnityEngine_UI_ScrollRect_MovementTy300513412.h" #include "UnityEngine_UI_UnityEngine_UI_ScrollRect_ScrollRec1643322606.h" #include "UnityEngine_UnityEngine_Events_UnityAction_1_gen4186098975MethodDeclarations.h" #include "UnityEngine_UnityEngine_Events_UnityAction_1_gen4186098975.h" #include "mscorlib_System_IntPtr4010401971.h" #include "UnityEngine_UI_UnityEngine_UI_ScrollRect_ScrollbarV184977789.h" #include "UnityEngine_UI_UnityEngine_UI_CanvasUpdateRegistry192658922MethodDeclarations.h" #include "UnityEngine_UI_UnityEngine_UI_LayoutRebuilder1942933988MethodDeclarations.h" #include "UnityEngine_UnityEngine_Bounds2711641849MethodDeclarations.h" #include "UnityEngine_UnityEngine_Bounds2711641849.h" #include "UnityEngine_UnityEngine_Time4241968337MethodDeclarations.h" #include "UnityEngine_UnityEngine_Events_UnityEvent_1_gen173696782MethodDeclarations.h" #include "UnityEngine_UnityEngine_Matrix4x41651859333MethodDeclarations.h" #include "UnityEngine_UnityEngine_Matrix4x41651859333.h" #include "UnityEngine_UI_UnityEngine_UI_ScrollRect_MovementTy300513412MethodDeclarations.h" #include "UnityEngine_UI_UnityEngine_UI_ScrollRect_ScrollbarV184977789MethodDeclarations.h" #include "UnityEngine_UI_UnityEngine_UI_ColorBlock508458230MethodDeclarations.h" #include "UnityEngine_UI_UnityEngine_UI_AnimationTriggers115197445MethodDeclarations.h" #include "mscorlib_System_Collections_Generic_List_1_gen775636365MethodDeclarations.h" #include "UnityEngine_UI_UnityEngine_UI_Selectable_Transitio1922345195.h" #include "UnityEngine_UI_UnityEngine_UI_ColorBlock508458230.h" #include "UnityEngine_UI_UnityEngine_UI_AnimationTriggers115197445.h" #include "mscorlib_System_Collections_Generic_List_1_gen775636365.h" #include "mscorlib_System_Collections_Generic_List_1_gen3253367090MethodDeclarations.h" #include "mscorlib_System_Collections_Generic_List_1_gen3253367090.h" #include "UnityEngine_UI_UnityEngine_UI_SpriteState2895308594.h" #include "UnityEngine_UI_UnityEngine_EventSystems_EventSyste2276120119MethodDeclarations.h" #include "UnityEngine_UI_UnityEngine_EventSystems_EventSyste2276120119.h" #include "UnityEngine_UI_UnityEngine_UI_Image538875265.h" #include "UnityEngine_UnityEngine_Animator2776330603.h" #include "UnityEngine_UnityEngine_CanvasGroup3702418109MethodDeclarations.h" #include "UnityEngine_UnityEngine_CanvasGroup3702418109.h" #include "UnityEngine_UI_UnityEngine_UI_Selectable_Selection1293548283.h" #include "UnityEngine_UnityEngine_Color4194546905MethodDeclarations.h" #include "mscorlib_System_String7231557.h" #include "UnityEngine_UnityEngine_Sprite3199167241.h" #include "UnityEngine_UI_UnityEngine_UI_SpriteState2895308594MethodDeclarations.h" #include "mscorlib_System_String7231557MethodDeclarations.h" #include "UnityEngine_UnityEngine_Quaternion1553702882MethodDeclarations.h" #include "UnityEngine_UnityEngine_Quaternion1553702882.h" #include "UnityEngine_UI_UnityEngine_EventSystems_BaseEventD2054899105MethodDeclarations.h" #include "UnityEngine_UI_UnityEngine_UI_Image538875265MethodDeclarations.h" #include "UnityEngine_UnityEngine_Animator2776330603MethodDeclarations.h" #include "UnityEngine_UnityEngine_RuntimeAnimatorController274649809.h" #include "UnityEngine_UI_UnityEngine_EventSystems_BaseEventD2054899105.h" #include "UnityEngine_UI_UnityEngine_UI_Selectable_Selection1293548283MethodDeclarations.h" #include "UnityEngine_UI_UnityEngine_UI_Selectable_Transitio1922345195MethodDeclarations.h" #include "UnityEngine_UI_UnityEngine_UI_Shadow75537580.h" #include "mscorlib_System_Byte2862609660.h" #include "UnityEngine_UI_UnityEngine_UI_Slider79469677.h" #include "UnityEngine_UI_UnityEngine_UI_Slider79469677MethodDeclarations.h" #include "UnityEngine_UI_UnityEngine_UI_Slider_SliderEvent2627072750MethodDeclarations.h" #include "UnityEngine_UI_UnityEngine_UI_Slider_SliderEvent2627072750.h" #include "UnityEngine_UI_UnityEngine_UI_Slider_Direction94975348.h" #include "UnityEngine_UI_UnityEngine_UI_Image_Type3063828369.h" #include "UnityEngine_UI_UnityEngine_UI_Slider_Axis3565360268.h" #include "UnityEngine_UI_UnityEngine_UI_Slider_Axis3565360268MethodDeclarations.h" #include "UnityEngine_UI_UnityEngine_UI_Slider_Direction94975348MethodDeclarations.h" #include "UnityEngine_UI_UnityEngine_UI_StencilMaterial639665897.h" #include "mscorlib_System_Collections_Generic_List_1_gen2942339633MethodDeclarations.h" #include "mscorlib_System_Collections_Generic_List_1_gen2942339633.h" #include "UnityEngine_UnityEngine_Debug4195163081MethodDeclarations.h" #include "UnityEngine_UI_UnityEngine_UI_StencilMaterial_MatE1574154081MethodDeclarations.h" #include "UnityEngine_UI_UnityEngine_UI_StencilMaterial_MatE1574154081.h" #include "UnityEngine_UnityEngine_HideFlags1436803931.h" #include "mscorlib_ArrayTypes.h" #include "UnityEngine_UI_UnityEngine_UI_Text9039225.h" #include "UnityEngine_UI_UnityEngine_UI_Text9039225MethodDeclarations.h" #include "UnityEngine_UI_UnityEngine_UI_FontData704020325MethodDeclarations.h" #include "UnityEngine_UI_UnityEngine_UI_FontData704020325.h" #include "UnityEngine_UnityEngine_TextGenerator538854556.h" #include "UnityEngine_UnityEngine_TextGenerator538854556MethodDeclarations.h" #include "UnityEngine_UnityEngine_Font4241557075MethodDeclarations.h" #include "UnityEngine_UnityEngine_Font4241557075.h" #include "UnityEngine_UI_UnityEngine_UI_FontUpdateTracker340588230MethodDeclarations.h" #include "UnityEngine_UnityEngine_TextAnchor213922566.h" #include "UnityEngine_UnityEngine_HorizontalWrapMode2918974229.h" #include "UnityEngine_UnityEngine_VerticalWrapMode1147493927.h" #include "UnityEngine_UnityEngine_FontStyle3350479768.h" #include "UnityEngine_UnityEngine_TextGenerationSettings1923005356.h" #include "UnityEngine_UI_UnityEngine_UI_Toggle110812896.h" #include "UnityEngine_UI_UnityEngine_UI_Toggle110812896MethodDeclarations.h" #include "UnityEngine_UI_UnityEngine_UI_Toggle_ToggleEvent2331340366MethodDeclarations.h" #include "UnityEngine_UI_UnityEngine_UI_Toggle_ToggleTransit2757337633.h" #include "UnityEngine_UI_UnityEngine_UI_Toggle_ToggleEvent2331340366.h" #include "UnityEngine_UI_UnityEngine_UI_ToggleGroup1990156785.h" #include "UnityEngine_UI_UnityEngine_UI_ToggleGroup1990156785MethodDeclarations.h" #include "UnityEngine_UI_UnityEngine_UI_Toggle_ToggleTransit2757337633MethodDeclarations.h" #include "mscorlib_System_Collections_Generic_List_1_gen1478998448MethodDeclarations.h" #include "mscorlib_System_Collections_Generic_List_1_gen1478998448.h" #include "mscorlib_System_ArgumentException928607144MethodDeclarations.h" #include "mscorlib_System_ArgumentException928607144.h" #include "mscorlib_System_Predicate_1_gen4016837075MethodDeclarations.h" #include "mscorlib_System_Predicate_1_gen4016837075.h" #include "System_Core_System_Func_2_gen3137578243MethodDeclarations.h" #include "System_Core_System_Linq_Enumerable839044124MethodDeclarations.h" #include "System_Core_System_Func_2_gen3137578243.h" #include "System_Core_System_Linq_Enumerable839044124.h" #include "UnityEngine_UI_UnityEngine_UI_ListPool_1_gen3379703850MethodDeclarations.h" #include "UnityEngine_UI_UnityEngine_UI_ListPool_1_gen3991458268MethodDeclarations.h" #include "UnityEngine_UI_UnityEngine_UI_ListPool_1_gen3379703849MethodDeclarations.h" #include "UnityEngine_UI_UnityEngine_UI_ListPool_1_gen3379703851MethodDeclarations.h" #include "UnityEngine_UI_UnityEngine_UI_ListPool_1_gen251475784MethodDeclarations.h" #include "mscorlib_System_Collections_Generic_List_1_gen1355284822.h" #include "mscorlib_System_Collections_Generic_List_1_gen1967039240.h" #include "mscorlib_System_Collections_Generic_List_1_gen1355284821.h" #include "mscorlib_System_Collections_Generic_List_1_gen1355284823.h" #include "mscorlib_System_Collections_Generic_List_1_gen2522024052.h" #include "UnityEngine_UnityEngine_Mesh4241756145.h" #include "UnityEngine_UnityEngine_Mesh4241756145MethodDeclarations.h" #include "mscorlib_System_Collections_Generic_List_1_gen1355284822MethodDeclarations.h" #include "mscorlib_System_Collections_Generic_List_1_gen1967039240MethodDeclarations.h" #include "mscorlib_System_Collections_Generic_List_1_gen1355284821MethodDeclarations.h" #include "mscorlib_System_Collections_Generic_List_1_gen1355284823MethodDeclarations.h" #include "mscorlib_System_Collections_Generic_List_1_gen2522024052MethodDeclarations.h" #include "UnityEngine_UI_UnityEngine_UI_VerticalLayoutGroup423167365.h" #include "UnityEngine_UI_UnityEngine_UI_VerticalLayoutGroup423167365MethodDeclarations.h" #include "UnityEngine_UI_UnityEngine_UI_HorizontalOrVertical2052396382MethodDeclarations.h" #include "UnityEngine_UI_UnityEngine_UI_LayoutGroup352294875MethodDeclarations.h" #include "UnityEngine_UI_UnityEngine_UI_LayoutGroup352294875.h" // !!0 UnityEngine.Component::GetComponent<System.Object>() extern "C" Il2CppObject * Component_GetComponent_TisIl2CppObject_m267839954_gshared (Component_t3501516275 * __this, const MethodInfo* method); #define Component_GetComponent_TisIl2CppObject_m267839954(__this, method) (( Il2CppObject * (*) (Component_t3501516275 *, const MethodInfo*))Component_GetComponent_TisIl2CppObject_m267839954_gshared)(__this, method) // !!0 UnityEngine.Component::GetComponent<UnityEngine.UI.Mask>() #define Component_GetComponent_TisMask_t8826680_m433240493(__this, method) (( Mask_t8826680 * (*) (Component_t3501516275 *, const MethodInfo*))Component_GetComponent_TisIl2CppObject_m267839954_gshared)(__this, method) // System.Void UnityEngine.Component::GetComponentsInChildren<System.Object>(System.Collections.Generic.List`1<!!0>) extern "C" void Component_GetComponentsInChildren_TisIl2CppObject_m434699324_gshared (Component_t3501516275 * __this, List_1_t1244034627 * p0, const MethodInfo* method); #define Component_GetComponentsInChildren_TisIl2CppObject_m434699324(__this, p0, method) (( void (*) (Component_t3501516275 *, List_1_t1244034627 *, const MethodInfo*))Component_GetComponentsInChildren_TisIl2CppObject_m434699324_gshared)(__this, p0, method) // System.Void UnityEngine.Component::GetComponentsInChildren<UnityEngine.Component>(System.Collections.Generic.List`1<!!0>) #define Component_GetComponentsInChildren_TisComponent_t3501516275_m1080956020(__this, p0, method) (( void (*) (Component_t3501516275 *, List_1_t574734531 *, const MethodInfo*))Component_GetComponentsInChildren_TisIl2CppObject_m434699324_gshared)(__this, p0, method) // System.Void UnityEngine.Component::GetComponentsInParent<System.Object>(System.Boolean,System.Collections.Generic.List`1<!!0>) extern "C" void Component_GetComponentsInParent_TisIl2CppObject_m101791494_gshared (Component_t3501516275 * __this, bool p0, List_1_t1244034627 * p1, const MethodInfo* method); #define Component_GetComponentsInParent_TisIl2CppObject_m101791494(__this, p0, p1, method) (( void (*) (Component_t3501516275 *, bool, List_1_t1244034627 *, const MethodInfo*))Component_GetComponentsInParent_TisIl2CppObject_m101791494_gshared)(__this, p0, p1, method) // System.Void UnityEngine.Component::GetComponentsInParent<UnityEngine.Canvas>(System.Boolean,System.Collections.Generic.List`1<!!0>) #define Component_GetComponentsInParent_TisCanvas_t2727140764_m2636073967(__this, p0, p1, method) (( void (*) (Component_t3501516275 *, bool, List_1_t4095326316 *, const MethodInfo*))Component_GetComponentsInParent_TisIl2CppObject_m101791494_gshared)(__this, p0, p1, method) // System.Void UnityEngine.Component::GetComponents<System.Object>(System.Collections.Generic.List`1<!!0>) extern "C" void Component_GetComponents_TisIl2CppObject_m4263137760_gshared (Component_t3501516275 * __this, List_1_t1244034627 * p0, const MethodInfo* method); #define Component_GetComponents_TisIl2CppObject_m4263137760(__this, p0, method) (( void (*) (Component_t3501516275 *, List_1_t1244034627 *, const MethodInfo*))Component_GetComponents_TisIl2CppObject_m4263137760_gshared)(__this, p0, method) // System.Void UnityEngine.Component::GetComponents<UnityEngine.UI.Mask>(System.Collections.Generic.List`1<!!0>) #define Component_GetComponents_TisMask_t8826680_m956513135(__this, p0, method) (( void (*) (Component_t3501516275 *, List_1_t1377012232 *, const MethodInfo*))Component_GetComponents_TisIl2CppObject_m4263137760_gshared)(__this, p0, method) // System.Void UnityEngine.Component::GetComponentsInParent<UnityEngine.UI.RectMask2D>(System.Boolean,System.Collections.Generic.List`1<!!0>) #define Component_GetComponentsInParent_TisRectMask2D_t3357079374_m2818396525(__this, p0, p1, method) (( void (*) (Component_t3501516275 *, bool, List_1_t430297630 *, const MethodInfo*))Component_GetComponentsInParent_TisIl2CppObject_m101791494_gshared)(__this, p0, p1, method) // !!0 UnityEngine.Component::GetComponent<UnityEngine.Transform>() #define Component_GetComponent_TisTransform_t1659122786_m811718087(__this, method) (( Transform_t1659122786 * (*) (Component_t3501516275 *, const MethodInfo*))Component_GetComponent_TisIl2CppObject_m267839954_gshared)(__this, method) // System.Void UnityEngine.GameObject::GetComponentsInParent<System.Object>(System.Boolean,System.Collections.Generic.List`1<!!0>) extern "C" void GameObject_GetComponentsInParent_TisIl2CppObject_m3568912686_gshared (GameObject_t3674682005 * __this, bool p0, List_1_t1244034627 * p1, const MethodInfo* method); #define GameObject_GetComponentsInParent_TisIl2CppObject_m3568912686(__this, p0, p1, method) (( void (*) (GameObject_t3674682005 *, bool, List_1_t1244034627 *, const MethodInfo*))GameObject_GetComponentsInParent_TisIl2CppObject_m3568912686_gshared)(__this, p0, p1, method) // System.Void UnityEngine.GameObject::GetComponentsInParent<UnityEngine.Canvas>(System.Boolean,System.Collections.Generic.List`1<!!0>) #define GameObject_GetComponentsInParent_TisCanvas_t2727140764_m3002356423(__this, p0, p1, method) (( void (*) (GameObject_t3674682005 *, bool, List_1_t4095326316 *, const MethodInfo*))GameObject_GetComponentsInParent_TisIl2CppObject_m3568912686_gshared)(__this, p0, p1, method) // !!0 UnityEngine.Component::GetComponent<UnityEngine.RectTransform>() #define Component_GetComponent_TisRectTransform_t972643934_m1940403147(__this, method) (( RectTransform_t972643934 * (*) (Component_t3501516275 *, const MethodInfo*))Component_GetComponent_TisIl2CppObject_m267839954_gshared)(__this, method) // System.Boolean UnityEngine.UI.SetPropertyUtility::SetClass<System.Object>(!!0&,!!0) extern "C" bool SetPropertyUtility_SetClass_TisIl2CppObject_m3004757678_gshared (Il2CppObject * __this /* static, unused */, Il2CppObject ** p0, Il2CppObject * p1, const MethodInfo* method); #define SetPropertyUtility_SetClass_TisIl2CppObject_m3004757678(__this /* static, unused */, p0, p1, method) (( bool (*) (Il2CppObject * /* static, unused */, Il2CppObject **, Il2CppObject *, const MethodInfo*))SetPropertyUtility_SetClass_TisIl2CppObject_m3004757678_gshared)(__this /* static, unused */, p0, p1, method) // System.Boolean UnityEngine.UI.SetPropertyUtility::SetClass<UnityEngine.RectTransform>(!!0&,!!0) #define SetPropertyUtility_SetClass_TisRectTransform_t972643934_m3898551323(__this /* static, unused */, p0, p1, method) (( bool (*) (Il2CppObject * /* static, unused */, RectTransform_t972643934 **, RectTransform_t972643934 *, const MethodInfo*))SetPropertyUtility_SetClass_TisIl2CppObject_m3004757678_gshared)(__this /* static, unused */, p0, p1, method) // System.Boolean UnityEngine.UI.SetPropertyUtility::SetStruct<UnityEngine.UI.Scrollbar/Direction>(!!0&,!!0) extern "C" bool SetPropertyUtility_SetStruct_TisDirection_t522766867_m1391770542_gshared (Il2CppObject * __this /* static, unused */, int32_t* p0, int32_t p1, const MethodInfo* method); #define SetPropertyUtility_SetStruct_TisDirection_t522766867_m1391770542(__this /* static, unused */, p0, p1, method) (( bool (*) (Il2CppObject * /* static, unused */, int32_t*, int32_t, const MethodInfo*))SetPropertyUtility_SetStruct_TisDirection_t522766867_m1391770542_gshared)(__this /* static, unused */, p0, p1, method) // System.Boolean UnityEngine.UI.SetPropertyUtility::SetStruct<System.Single>(!!0&,!!0) extern "C" bool SetPropertyUtility_SetStruct_TisSingle_t4291918972_m1643007650_gshared (Il2CppObject * __this /* static, unused */, float* p0, float p1, const MethodInfo* method); #define SetPropertyUtility_SetStruct_TisSingle_t4291918972_m1643007650(__this /* static, unused */, p0, p1, method) (( bool (*) (Il2CppObject * /* static, unused */, float*, float, const MethodInfo*))SetPropertyUtility_SetStruct_TisSingle_t4291918972_m1643007650_gshared)(__this /* static, unused */, p0, p1, method) // System.Boolean UnityEngine.UI.SetPropertyUtility::SetStruct<System.Int32>(!!0&,!!0) extern "C" bool SetPropertyUtility_SetStruct_TisInt32_t1153838500_m3219417906_gshared (Il2CppObject * __this /* static, unused */, int32_t* p0, int32_t p1, const MethodInfo* method); #define SetPropertyUtility_SetStruct_TisInt32_t1153838500_m3219417906(__this /* static, unused */, p0, p1, method) (( bool (*) (Il2CppObject * /* static, unused */, int32_t*, int32_t, const MethodInfo*))SetPropertyUtility_SetStruct_TisInt32_t1153838500_m3219417906_gshared)(__this /* static, unused */, p0, p1, method) // System.Boolean UnityEngine.UI.SetPropertyUtility::SetEquatableStruct<UnityEngine.UI.Navigation>(!!0&,!!0) extern "C" bool SetPropertyUtility_SetEquatableStruct_TisNavigation_t1108456480_m3717372898_gshared (Il2CppObject * __this /* static, unused */, Navigation_t1108456480 * p0, Navigation_t1108456480 p1, const MethodInfo* method); #define SetPropertyUtility_SetEquatableStruct_TisNavigation_t1108456480_m3717372898(__this /* static, unused */, p0, p1, method) (( bool (*) (Il2CppObject * /* static, unused */, Navigation_t1108456480 *, Navigation_t1108456480 , const MethodInfo*))SetPropertyUtility_SetEquatableStruct_TisNavigation_t1108456480_m3717372898_gshared)(__this /* static, unused */, p0, p1, method) // System.Boolean UnityEngine.UI.SetPropertyUtility::SetStruct<UnityEngine.UI.Selectable/Transition>(!!0&,!!0) extern "C" bool SetPropertyUtility_SetStruct_TisTransition_t1922345195_m697175766_gshared (Il2CppObject * __this /* static, unused */, int32_t* p0, int32_t p1, const MethodInfo* method); #define SetPropertyUtility_SetStruct_TisTransition_t1922345195_m697175766(__this /* static, unused */, p0, p1, method) (( bool (*) (Il2CppObject * /* static, unused */, int32_t*, int32_t, const MethodInfo*))SetPropertyUtility_SetStruct_TisTransition_t1922345195_m697175766_gshared)(__this /* static, unused */, p0, p1, method) // System.Boolean UnityEngine.UI.SetPropertyUtility::SetEquatableStruct<UnityEngine.UI.ColorBlock>(!!0&,!!0) extern "C" bool SetPropertyUtility_SetEquatableStruct_TisColorBlock_t508458230_m3999144268_gshared (Il2CppObject * __this /* static, unused */, ColorBlock_t508458230 * p0, ColorBlock_t508458230 p1, const MethodInfo* method); #define SetPropertyUtility_SetEquatableStruct_TisColorBlock_t508458230_m3999144268(__this /* static, unused */, p0, p1, method) (( bool (*) (Il2CppObject * /* static, unused */, ColorBlock_t508458230 *, ColorBlock_t508458230 , const MethodInfo*))SetPropertyUtility_SetEquatableStruct_TisColorBlock_t508458230_m3999144268_gshared)(__this /* static, unused */, p0, p1, method) // System.Boolean UnityEngine.UI.SetPropertyUtility::SetEquatableStruct<UnityEngine.UI.SpriteState>(!!0&,!!0) extern "C" bool SetPropertyUtility_SetEquatableStruct_TisSpriteState_t2895308594_m1850844776_gshared (Il2CppObject * __this /* static, unused */, SpriteState_t2895308594 * p0, SpriteState_t2895308594 p1, const MethodInfo* method); #define SetPropertyUtility_SetEquatableStruct_TisSpriteState_t2895308594_m1850844776(__this /* static, unused */, p0, p1, method) (( bool (*) (Il2CppObject * /* static, unused */, SpriteState_t2895308594 *, SpriteState_t2895308594 , const MethodInfo*))SetPropertyUtility_SetEquatableStruct_TisSpriteState_t2895308594_m1850844776_gshared)(__this /* static, unused */, p0, p1, method) // System.Boolean UnityEngine.UI.SetPropertyUtility::SetClass<UnityEngine.UI.AnimationTriggers>(!!0&,!!0) #define SetPropertyUtility_SetClass_TisAnimationTriggers_t115197445_m2237051106(__this /* static, unused */, p0, p1, method) (( bool (*) (Il2CppObject * /* static, unused */, AnimationTriggers_t115197445 **, AnimationTriggers_t115197445 *, const MethodInfo*))SetPropertyUtility_SetClass_TisIl2CppObject_m3004757678_gshared)(__this /* static, unused */, p0, p1, method) // System.Boolean UnityEngine.UI.SetPropertyUtility::SetClass<UnityEngine.UI.Graphic>(!!0&,!!0) #define SetPropertyUtility_SetClass_TisGraphic_t836799438_m4232752825(__this /* static, unused */, p0, p1, method) (( bool (*) (Il2CppObject * /* static, unused */, Graphic_t836799438 **, Graphic_t836799438 *, const MethodInfo*))SetPropertyUtility_SetClass_TisIl2CppObject_m3004757678_gshared)(__this /* static, unused */, p0, p1, method) // System.Boolean UnityEngine.UI.SetPropertyUtility::SetStruct<System.Boolean>(!!0&,!!0) extern "C" bool SetPropertyUtility_SetStruct_TisBoolean_t476798718_m1242031768_gshared (Il2CppObject * __this /* static, unused */, bool* p0, bool p1, const MethodInfo* method); #define SetPropertyUtility_SetStruct_TisBoolean_t476798718_m1242031768(__this /* static, unused */, p0, p1, method) (( bool (*) (Il2CppObject * /* static, unused */, bool*, bool, const MethodInfo*))SetPropertyUtility_SetStruct_TisBoolean_t476798718_m1242031768_gshared)(__this /* static, unused */, p0, p1, method) // !!0 UnityEngine.Component::GetComponent<UnityEngine.Animator>() #define Component_GetComponent_TisAnimator_t2776330603_m4147395588(__this, method) (( Animator_t2776330603 * (*) (Component_t3501516275 *, const MethodInfo*))Component_GetComponent_TisIl2CppObject_m267839954_gshared)(__this, method) // !!0 UnityEngine.Component::GetComponent<UnityEngine.UI.Graphic>() #define Component_GetComponent_TisGraphic_t836799438_m908906813(__this, method) (( Graphic_t836799438 * (*) (Component_t3501516275 *, const MethodInfo*))Component_GetComponent_TisIl2CppObject_m267839954_gshared)(__this, method) // System.Void UnityEngine.Component::GetComponents<UnityEngine.CanvasGroup>(System.Collections.Generic.List`1<!!0>) #define Component_GetComponents_TisCanvasGroup_t3702418109_m4244188622(__this, p0, method) (( void (*) (Component_t3501516275 *, List_1_t775636365 *, const MethodInfo*))Component_GetComponents_TisIl2CppObject_m4263137760_gshared)(__this, p0, method) // System.Boolean UnityEngine.UI.SetPropertyUtility::SetStruct<UnityEngine.UI.Slider/Direction>(!!0&,!!0) extern "C" bool SetPropertyUtility_SetStruct_TisDirection_t94975348_m2722180853_gshared (Il2CppObject * __this /* static, unused */, int32_t* p0, int32_t p1, const MethodInfo* method); #define SetPropertyUtility_SetStruct_TisDirection_t94975348_m2722180853(__this /* static, unused */, p0, p1, method) (( bool (*) (Il2CppObject * /* static, unused */, int32_t*, int32_t, const MethodInfo*))SetPropertyUtility_SetStruct_TisDirection_t94975348_m2722180853_gshared)(__this /* static, unused */, p0, p1, method) // !!0 UnityEngine.Component::GetComponent<UnityEngine.UI.Image>() #define Component_GetComponent_TisImage_t538875265_m3706520426(__this, method) (( Image_t538875265 * (*) (Component_t3501516275 *, const MethodInfo*))Component_GetComponent_TisIl2CppObject_m267839954_gshared)(__this, method) // System.Collections.Generic.IEnumerable`1<!!0> System.Linq.Enumerable::Where<System.Object>(System.Collections.Generic.IEnumerable`1<!!0>,System.Func`2<!!0,System.Boolean>) extern "C" Il2CppObject* Enumerable_Where_TisIl2CppObject_m3480373697_gshared (Il2CppObject * __this /* static, unused */, Il2CppObject* p0, Func_2_t785513668 * p1, const MethodInfo* method); #define Enumerable_Where_TisIl2CppObject_m3480373697(__this /* static, unused */, p0, p1, method) (( Il2CppObject* (*) (Il2CppObject * /* static, unused */, Il2CppObject*, Func_2_t785513668 *, const MethodInfo*))Enumerable_Where_TisIl2CppObject_m3480373697_gshared)(__this /* static, unused */, p0, p1, method) // System.Collections.Generic.IEnumerable`1<!!0> System.Linq.Enumerable::Where<UnityEngine.UI.Toggle>(System.Collections.Generic.IEnumerable`1<!!0>,System.Func`2<!!0,System.Boolean>) #define Enumerable_Where_TisToggle_t110812896_m1098047866(__this /* static, unused */, p0, p1, method) (( Il2CppObject* (*) (Il2CppObject * /* static, unused */, Il2CppObject*, Func_2_t3137578243 *, const MethodInfo*))Enumerable_Where_TisIl2CppObject_m3480373697_gshared)(__this /* static, unused */, p0, p1, method) #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Void UnityEngine.UI.MaskableGraphic::.ctor() extern Il2CppClass* CullStateChangedEvent_t2290505109_il2cpp_TypeInfo_var; extern Il2CppClass* Vector3U5BU5D_t215400611_il2cpp_TypeInfo_var; extern Il2CppClass* Graphic_t836799438_il2cpp_TypeInfo_var; extern const uint32_t MaskableGraphic__ctor_m3514233785_MetadataUsageId; extern "C" void MaskableGraphic__ctor_m3514233785 (MaskableGraphic_t3186046376 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (MaskableGraphic__ctor_m3514233785_MetadataUsageId); s_Il2CppMethodIntialized = true; } { __this->set_m_ShouldRecalculateStencil_19((bool)1); __this->set_m_Maskable_22((bool)1); CullStateChangedEvent_t2290505109 * L_0 = (CullStateChangedEvent_t2290505109 *)il2cpp_codegen_object_new(CullStateChangedEvent_t2290505109_il2cpp_TypeInfo_var); CullStateChangedEvent__ctor_m2540235971(L_0, /*hidden argument*/NULL); __this->set_m_OnCullStateChanged_24(L_0); __this->set_m_ShouldRecalculate_25((bool)1); __this->set_m_Corners_27(((Vector3U5BU5D_t215400611*)SZArrayNew(Vector3U5BU5D_t215400611_il2cpp_TypeInfo_var, (uint32_t)4))); IL2CPP_RUNTIME_CLASS_INIT(Graphic_t836799438_il2cpp_TypeInfo_var); Graphic__ctor_m4066569555(__this, /*hidden argument*/NULL); return; } } // UnityEngine.UI.MaskableGraphic/CullStateChangedEvent UnityEngine.UI.MaskableGraphic::get_onCullStateChanged() extern "C" CullStateChangedEvent_t2290505109 * MaskableGraphic_get_onCullStateChanged_m2293098922 (MaskableGraphic_t3186046376 * __this, const MethodInfo* method) { { CullStateChangedEvent_t2290505109 * L_0 = __this->get_m_OnCullStateChanged_24(); return L_0; } } // System.Void UnityEngine.UI.MaskableGraphic::set_onCullStateChanged(UnityEngine.UI.MaskableGraphic/CullStateChangedEvent) extern "C" void MaskableGraphic_set_onCullStateChanged_m1901835143 (MaskableGraphic_t3186046376 * __this, CullStateChangedEvent_t2290505109 * ___value0, const MethodInfo* method) { { CullStateChangedEvent_t2290505109 * L_0 = ___value0; __this->set_m_OnCullStateChanged_24(L_0); return; } } // System.Boolean UnityEngine.UI.MaskableGraphic::get_maskable() extern "C" bool MaskableGraphic_get_maskable_m2226181992 (MaskableGraphic_t3186046376 * __this, const MethodInfo* method) { { bool L_0 = __this->get_m_Maskable_22(); return L_0; } } // System.Void UnityEngine.UI.MaskableGraphic::set_maskable(System.Boolean) extern "C" void MaskableGraphic_set_maskable_m3088187909 (MaskableGraphic_t3186046376 * __this, bool ___value0, const MethodInfo* method) { { bool L_0 = ___value0; bool L_1 = __this->get_m_Maskable_22(); if ((!(((uint32_t)L_0) == ((uint32_t)L_1)))) { goto IL_000d; } } { return; } IL_000d: { bool L_2 = ___value0; __this->set_m_Maskable_22(L_2); __this->set_m_ShouldRecalculateStencil_19((bool)1); VirtActionInvoker0::Invoke(24 /* System.Void UnityEngine.UI.Graphic::SetMaterialDirty() */, __this); return; } } // UnityEngine.Material UnityEngine.UI.MaskableGraphic::GetModifiedMaterial(UnityEngine.Material) extern Il2CppClass* StencilMaterial_t639665897_il2cpp_TypeInfo_var; extern const MethodInfo* Component_GetComponent_TisMask_t8826680_m433240493_MethodInfo_var; extern const uint32_t MaskableGraphic_GetModifiedMaterial_m2422156902_MetadataUsageId; extern "C" Material_t3870600107 * MaskableGraphic_GetModifiedMaterial_m2422156902 (MaskableGraphic_t3186046376 * __this, Material_t3870600107 * ___baseMaterial0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (MaskableGraphic_GetModifiedMaterial_m2422156902_MetadataUsageId); s_Il2CppMethodIntialized = true; } Material_t3870600107 * V_0 = NULL; Transform_t1659122786 * V_1 = NULL; Material_t3870600107 * V_2 = NULL; MaskableGraphic_t3186046376 * G_B3_0 = NULL; MaskableGraphic_t3186046376 * G_B2_0 = NULL; int32_t G_B4_0 = 0; MaskableGraphic_t3186046376 * G_B4_1 = NULL; { Material_t3870600107 * L_0 = ___baseMaterial0; V_0 = L_0; bool L_1 = __this->get_m_ShouldRecalculateStencil_19(); if (!L_1) { goto IL_0043; } } { Transform_t1659122786 * L_2 = Component_get_transform_m4257140443(__this, /*hidden argument*/NULL); Transform_t1659122786 * L_3 = MaskUtilities_FindRootSortOverrideCanvas_m4219954651(NULL /*static, unused*/, L_2, /*hidden argument*/NULL); V_1 = L_3; bool L_4 = MaskableGraphic_get_maskable_m2226181992(__this, /*hidden argument*/NULL); G_B2_0 = __this; if (!L_4) { G_B3_0 = __this; goto IL_0036; } } { Transform_t1659122786 * L_5 = Component_get_transform_m4257140443(__this, /*hidden argument*/NULL); Transform_t1659122786 * L_6 = V_1; int32_t L_7 = MaskUtilities_GetStencilDepth_m2786493988(NULL /*static, unused*/, L_5, L_6, /*hidden argument*/NULL); G_B4_0 = L_7; G_B4_1 = G_B2_0; goto IL_0037; } IL_0036: { G_B4_0 = 0; G_B4_1 = G_B3_0; } IL_0037: { NullCheck(G_B4_1); G_B4_1->set_m_StencilValue_26(G_B4_0); __this->set_m_ShouldRecalculateStencil_19((bool)0); } IL_0043: { int32_t L_8 = __this->get_m_StencilValue_26(); if ((((int32_t)L_8) <= ((int32_t)0))) { goto IL_009f; } } { Mask_t8826680 * L_9 = Component_GetComponent_TisMask_t8826680_m433240493(__this, /*hidden argument*/Component_GetComponent_TisMask_t8826680_m433240493_MethodInfo_var); bool L_10 = Object_op_Equality_m3964590952(NULL /*static, unused*/, L_9, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_10) { goto IL_009f; } } { Material_t3870600107 * L_11 = V_0; int32_t L_12 = __this->get_m_StencilValue_26(); int32_t L_13 = __this->get_m_StencilValue_26(); IL2CPP_RUNTIME_CLASS_INIT(StencilMaterial_t639665897_il2cpp_TypeInfo_var); Material_t3870600107 * L_14 = StencilMaterial_Add_m264449278(NULL /*static, unused*/, L_11, ((int32_t)((int32_t)((int32_t)((int32_t)1<<(int32_t)((int32_t)((int32_t)L_12&(int32_t)((int32_t)31)))))-(int32_t)1)), 0, 3, ((int32_t)15), ((int32_t)((int32_t)((int32_t)((int32_t)1<<(int32_t)((int32_t)((int32_t)L_13&(int32_t)((int32_t)31)))))-(int32_t)1)), 0, /*hidden argument*/NULL); V_2 = L_14; Material_t3870600107 * L_15 = __this->get_m_MaskMaterial_20(); StencilMaterial_Remove_m1013236306(NULL /*static, unused*/, L_15, /*hidden argument*/NULL); Material_t3870600107 * L_16 = V_2; __this->set_m_MaskMaterial_20(L_16); Material_t3870600107 * L_17 = __this->get_m_MaskMaterial_20(); V_0 = L_17; } IL_009f: { Material_t3870600107 * L_18 = V_0; return L_18; } } // System.Void UnityEngine.UI.MaskableGraphic::Cull(UnityEngine.Rect,System.Boolean) extern "C" void MaskableGraphic_Cull_m1710243867 (MaskableGraphic_t3186046376 * __this, Rect_t4241904616 ___clipRect0, bool ___validRect1, const MethodInfo* method) { bool V_0 = false; int32_t G_B5_0 = 0; { CanvasRenderer_t3950887807 * L_0 = Graphic_get_canvasRenderer_m184553434(__this, /*hidden argument*/NULL); NullCheck(L_0); bool L_1 = CanvasRenderer_get_hasMoved_m1392755130(L_0, /*hidden argument*/NULL); if (L_1) { goto IL_0011; } } { return; } IL_0011: { bool L_2 = ___validRect1; if (!L_2) { goto IL_002a; } } { Rect_t4241904616 L_3 = MaskableGraphic_get_rootCanvasRect_m40685262(__this, /*hidden argument*/NULL); bool L_4 = Rect_Overlaps_m2751672171((&___clipRect0), L_3, (bool)1, /*hidden argument*/NULL); G_B5_0 = ((((int32_t)L_4) == ((int32_t)0))? 1 : 0); goto IL_002b; } IL_002a: { G_B5_0 = 1; } IL_002b: { V_0 = (bool)G_B5_0; bool L_5 = V_0; MaskableGraphic_UpdateCull_m3192993021(__this, L_5, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.UI.MaskableGraphic::UpdateCull(System.Boolean) extern const MethodInfo* UnityEvent_1_Invoke_m4200629676_MethodInfo_var; extern const uint32_t MaskableGraphic_UpdateCull_m3192993021_MetadataUsageId; extern "C" void MaskableGraphic_UpdateCull_m3192993021 (MaskableGraphic_t3186046376 * __this, bool ___cull0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (MaskableGraphic_UpdateCull_m3192993021_MetadataUsageId); s_Il2CppMethodIntialized = true; } bool V_0 = false; { CanvasRenderer_t3950887807 * L_0 = Graphic_get_canvasRenderer_m184553434(__this, /*hidden argument*/NULL); NullCheck(L_0); bool L_1 = CanvasRenderer_get_cull_m3343855795(L_0, /*hidden argument*/NULL); bool L_2 = ___cull0; V_0 = (bool)((((int32_t)((((int32_t)L_1) == ((int32_t)L_2))? 1 : 0)) == ((int32_t)0))? 1 : 0); CanvasRenderer_t3950887807 * L_3 = Graphic_get_canvasRenderer_m184553434(__this, /*hidden argument*/NULL); bool L_4 = ___cull0; NullCheck(L_3); CanvasRenderer_set_cull_m3433952120(L_3, L_4, /*hidden argument*/NULL); bool L_5 = V_0; if (!L_5) { goto IL_0036; } } { CullStateChangedEvent_t2290505109 * L_6 = __this->get_m_OnCullStateChanged_24(); bool L_7 = ___cull0; NullCheck(L_6); UnityEvent_1_Invoke_m4200629676(L_6, L_7, /*hidden argument*/UnityEvent_1_Invoke_m4200629676_MethodInfo_var); VirtActionInvoker0::Invoke(23 /* System.Void UnityEngine.UI.Graphic::SetVerticesDirty() */, __this); } IL_0036: { return; } } // System.Void UnityEngine.UI.MaskableGraphic::SetClipRect(UnityEngine.Rect,System.Boolean) extern "C" void MaskableGraphic_SetClipRect_m3970693835 (MaskableGraphic_t3186046376 * __this, Rect_t4241904616 ___clipRect0, bool ___validRect1, const MethodInfo* method) { { bool L_0 = ___validRect1; if (!L_0) { goto IL_0017; } } { CanvasRenderer_t3950887807 * L_1 = Graphic_get_canvasRenderer_m184553434(__this, /*hidden argument*/NULL); Rect_t4241904616 L_2 = ___clipRect0; NullCheck(L_1); CanvasRenderer_EnableRectClipping_m896218272(L_1, L_2, /*hidden argument*/NULL); goto IL_0022; } IL_0017: { CanvasRenderer_t3950887807 * L_3 = Graphic_get_canvasRenderer_m184553434(__this, /*hidden argument*/NULL); NullCheck(L_3); CanvasRenderer_DisableRectClipping_m2654388030(L_3, /*hidden argument*/NULL); } IL_0022: { return; } } // System.Void UnityEngine.UI.MaskableGraphic::OnEnable() extern const MethodInfo* Component_GetComponent_TisMask_t8826680_m433240493_MethodInfo_var; extern const uint32_t MaskableGraphic_OnEnable_m487460141_MetadataUsageId; extern "C" void MaskableGraphic_OnEnable_m487460141 (MaskableGraphic_t3186046376 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (MaskableGraphic_OnEnable_m487460141_MetadataUsageId); s_Il2CppMethodIntialized = true; } { Graphic_OnEnable_m1102673235(__this, /*hidden argument*/NULL); __this->set_m_ShouldRecalculateStencil_19((bool)1); MaskableGraphic_UpdateClipParent_m2337272942(__this, /*hidden argument*/NULL); VirtActionInvoker0::Invoke(24 /* System.Void UnityEngine.UI.Graphic::SetMaterialDirty() */, __this); Mask_t8826680 * L_0 = Component_GetComponent_TisMask_t8826680_m433240493(__this, /*hidden argument*/Component_GetComponent_TisMask_t8826680_m433240493_MethodInfo_var); bool L_1 = Object_op_Inequality_m1296218211(NULL /*static, unused*/, L_0, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_1) { goto IL_0030; } } { MaskUtilities_NotifyStencilStateChanged_m2159873435(NULL /*static, unused*/, __this, /*hidden argument*/NULL); } IL_0030: { return; } } // System.Void UnityEngine.UI.MaskableGraphic::OnDisable() extern Il2CppClass* StencilMaterial_t639665897_il2cpp_TypeInfo_var; extern const MethodInfo* Component_GetComponent_TisMask_t8826680_m433240493_MethodInfo_var; extern const uint32_t MaskableGraphic_OnDisable_m2667299744_MetadataUsageId; extern "C" void MaskableGraphic_OnDisable_m2667299744 (MaskableGraphic_t3186046376 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (MaskableGraphic_OnDisable_m2667299744_MetadataUsageId); s_Il2CppMethodIntialized = true; } { Graphic_OnDisable_m264069178(__this, /*hidden argument*/NULL); __this->set_m_ShouldRecalculateStencil_19((bool)1); VirtActionInvoker0::Invoke(24 /* System.Void UnityEngine.UI.Graphic::SetMaterialDirty() */, __this); MaskableGraphic_UpdateClipParent_m2337272942(__this, /*hidden argument*/NULL); Material_t3870600107 * L_0 = __this->get_m_MaskMaterial_20(); IL2CPP_RUNTIME_CLASS_INIT(StencilMaterial_t639665897_il2cpp_TypeInfo_var); StencilMaterial_Remove_m1013236306(NULL /*static, unused*/, L_0, /*hidden argument*/NULL); __this->set_m_MaskMaterial_20((Material_t3870600107 *)NULL); Mask_t8826680 * L_1 = Component_GetComponent_TisMask_t8826680_m433240493(__this, /*hidden argument*/Component_GetComponent_TisMask_t8826680_m433240493_MethodInfo_var); bool L_2 = Object_op_Inequality_m1296218211(NULL /*static, unused*/, L_1, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_2) { goto IL_0042; } } { MaskUtilities_NotifyStencilStateChanged_m2159873435(NULL /*static, unused*/, __this, /*hidden argument*/NULL); } IL_0042: { return; } } // System.Void UnityEngine.UI.MaskableGraphic::OnTransformParentChanged() extern "C" void MaskableGraphic_OnTransformParentChanged_m2836893064 (MaskableGraphic_t3186046376 * __this, const MethodInfo* method) { { Graphic_OnTransformParentChanged_m321513902(__this, /*hidden argument*/NULL); bool L_0 = Behaviour_get_isActiveAndEnabled_m210167461(__this, /*hidden argument*/NULL); if (L_0) { goto IL_0012; } } { return; } IL_0012: { __this->set_m_ShouldRecalculateStencil_19((bool)1); MaskableGraphic_UpdateClipParent_m2337272942(__this, /*hidden argument*/NULL); VirtActionInvoker0::Invoke(24 /* System.Void UnityEngine.UI.Graphic::SetMaterialDirty() */, __this); return; } } // System.Void UnityEngine.UI.MaskableGraphic::ParentMaskStateChanged() extern "C" void MaskableGraphic_ParentMaskStateChanged_m3501359204 (MaskableGraphic_t3186046376 * __this, const MethodInfo* method) { { return; } } // System.Void UnityEngine.UI.MaskableGraphic::OnCanvasHierarchyChanged() extern "C" void MaskableGraphic_OnCanvasHierarchyChanged_m3030160609 (MaskableGraphic_t3186046376 * __this, const MethodInfo* method) { { Graphic_OnCanvasHierarchyChanged_m514781447(__this, /*hidden argument*/NULL); bool L_0 = Behaviour_get_isActiveAndEnabled_m210167461(__this, /*hidden argument*/NULL); if (L_0) { goto IL_0012; } } { return; } IL_0012: { __this->set_m_ShouldRecalculateStencil_19((bool)1); MaskableGraphic_UpdateClipParent_m2337272942(__this, /*hidden argument*/NULL); VirtActionInvoker0::Invoke(24 /* System.Void UnityEngine.UI.Graphic::SetMaterialDirty() */, __this); return; } } // UnityEngine.Rect UnityEngine.UI.MaskableGraphic::get_rootCanvasRect() extern "C" Rect_t4241904616 MaskableGraphic_get_rootCanvasRect_m40685262 (MaskableGraphic_t3186046376 * __this, const MethodInfo* method) { Canvas_t2727140764 * V_0 = NULL; int32_t V_1 = 0; { RectTransform_t972643934 * L_0 = Graphic_get_rectTransform_m4017371950(__this, /*hidden argument*/NULL); Vector3U5BU5D_t215400611* L_1 = __this->get_m_Corners_27(); NullCheck(L_0); RectTransform_GetWorldCorners_m1829917190(L_0, L_1, /*hidden argument*/NULL); Canvas_t2727140764 * L_2 = Graphic_get_canvas_m4291384250(__this, /*hidden argument*/NULL); bool L_3 = Object_op_Implicit_m2106766291(NULL /*static, unused*/, L_2, /*hidden argument*/NULL); if (!L_3) { goto IL_006c; } } { Canvas_t2727140764 * L_4 = Graphic_get_canvas_m4291384250(__this, /*hidden argument*/NULL); NullCheck(L_4); Canvas_t2727140764 * L_5 = Canvas_get_rootCanvas_m3652460242(L_4, /*hidden argument*/NULL); V_0 = L_5; V_1 = 0; goto IL_0065; } IL_0034: { Vector3U5BU5D_t215400611* L_6 = __this->get_m_Corners_27(); int32_t L_7 = V_1; NullCheck(L_6); IL2CPP_ARRAY_BOUNDS_CHECK(L_6, L_7); Canvas_t2727140764 * L_8 = V_0; NullCheck(L_8); Transform_t1659122786 * L_9 = Component_get_transform_m4257140443(L_8, /*hidden argument*/NULL); Vector3U5BU5D_t215400611* L_10 = __this->get_m_Corners_27(); int32_t L_11 = V_1; NullCheck(L_10); IL2CPP_ARRAY_BOUNDS_CHECK(L_10, L_11); NullCheck(L_9); Vector3_t4282066566 L_12 = Transform_InverseTransformPoint_m1626812000(L_9, (*(Vector3_t4282066566 *)((L_10)->GetAddressAt(static_cast<il2cpp_array_size_t>(L_11)))), /*hidden argument*/NULL); (*(Vector3_t4282066566 *)((L_6)->GetAddressAt(static_cast<il2cpp_array_size_t>(L_7)))) = L_12; int32_t L_13 = V_1; V_1 = ((int32_t)((int32_t)L_13+(int32_t)1)); } IL_0065: { int32_t L_14 = V_1; if ((((int32_t)L_14) < ((int32_t)4))) { goto IL_0034; } } IL_006c: { Vector3U5BU5D_t215400611* L_15 = __this->get_m_Corners_27(); NullCheck(L_15); IL2CPP_ARRAY_BOUNDS_CHECK(L_15, 0); float L_16 = ((L_15)->GetAddressAt(static_cast<il2cpp_array_size_t>(0)))->get_x_1(); Vector3U5BU5D_t215400611* L_17 = __this->get_m_Corners_27(); NullCheck(L_17); IL2CPP_ARRAY_BOUNDS_CHECK(L_17, 0); float L_18 = ((L_17)->GetAddressAt(static_cast<il2cpp_array_size_t>(0)))->get_y_2(); Vector3U5BU5D_t215400611* L_19 = __this->get_m_Corners_27(); NullCheck(L_19); IL2CPP_ARRAY_BOUNDS_CHECK(L_19, 2); float L_20 = ((L_19)->GetAddressAt(static_cast<il2cpp_array_size_t>(2)))->get_x_1(); Vector3U5BU5D_t215400611* L_21 = __this->get_m_Corners_27(); NullCheck(L_21); IL2CPP_ARRAY_BOUNDS_CHECK(L_21, 0); float L_22 = ((L_21)->GetAddressAt(static_cast<il2cpp_array_size_t>(0)))->get_x_1(); Vector3U5BU5D_t215400611* L_23 = __this->get_m_Corners_27(); NullCheck(L_23); IL2CPP_ARRAY_BOUNDS_CHECK(L_23, 2); float L_24 = ((L_23)->GetAddressAt(static_cast<il2cpp_array_size_t>(2)))->get_y_2(); Vector3U5BU5D_t215400611* L_25 = __this->get_m_Corners_27(); NullCheck(L_25); IL2CPP_ARRAY_BOUNDS_CHECK(L_25, 0); float L_26 = ((L_25)->GetAddressAt(static_cast<il2cpp_array_size_t>(0)))->get_y_2(); Rect_t4241904616 L_27; memset(&L_27, 0, sizeof(L_27)); Rect__ctor_m3291325233(&L_27, L_16, L_18, ((float)((float)L_20-(float)L_22)), ((float)((float)L_24-(float)L_26)), /*hidden argument*/NULL); return L_27; } } // System.Void UnityEngine.UI.MaskableGraphic::UpdateClipParent() extern "C" void MaskableGraphic_UpdateClipParent_m2337272942 (MaskableGraphic_t3186046376 * __this, const MethodInfo* method) { RectMask2D_t3357079374 * V_0 = NULL; RectMask2D_t3357079374 * G_B4_0 = NULL; { bool L_0 = MaskableGraphic_get_maskable_m2226181992(__this, /*hidden argument*/NULL); if (!L_0) { goto IL_0021; } } { bool L_1 = VirtFuncInvoker0< bool >::Invoke(9 /* System.Boolean UnityEngine.EventSystems.UIBehaviour::IsActive() */, __this); if (!L_1) { goto IL_0021; } } { RectMask2D_t3357079374 * L_2 = MaskUtilities_GetRectMaskForClippable_m396614586(NULL /*static, unused*/, __this, /*hidden argument*/NULL); G_B4_0 = L_2; goto IL_0022; } IL_0021: { G_B4_0 = ((RectMask2D_t3357079374 *)(NULL)); } IL_0022: { V_0 = G_B4_0; RectMask2D_t3357079374 * L_3 = V_0; RectMask2D_t3357079374 * L_4 = __this->get_m_ParentMask_21(); bool L_5 = Object_op_Inequality_m1296218211(NULL /*static, unused*/, L_3, L_4, /*hidden argument*/NULL); if (!L_5) { goto IL_0058; } } { RectMask2D_t3357079374 * L_6 = __this->get_m_ParentMask_21(); bool L_7 = Object_op_Inequality_m1296218211(NULL /*static, unused*/, L_6, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_7) { goto IL_0058; } } { RectMask2D_t3357079374 * L_8 = __this->get_m_ParentMask_21(); NullCheck(L_8); RectMask2D_RemoveClippable_m2506427137(L_8, __this, /*hidden argument*/NULL); MaskableGraphic_UpdateCull_m3192993021(__this, (bool)0, /*hidden argument*/NULL); } IL_0058: { RectMask2D_t3357079374 * L_9 = V_0; bool L_10 = Object_op_Inequality_m1296218211(NULL /*static, unused*/, L_9, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_10) { goto IL_006b; } } { RectMask2D_t3357079374 * L_11 = V_0; NullCheck(L_11); RectMask2D_AddClippable_m3020362282(L_11, __this, /*hidden argument*/NULL); } IL_006b: { RectMask2D_t3357079374 * L_12 = V_0; __this->set_m_ParentMask_21(L_12); return; } } // System.Void UnityEngine.UI.MaskableGraphic::RecalculateClipping() extern "C" void MaskableGraphic_RecalculateClipping_m400162188 (MaskableGraphic_t3186046376 * __this, const MethodInfo* method) { { MaskableGraphic_UpdateClipParent_m2337272942(__this, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.UI.MaskableGraphic::RecalculateMasking() extern "C" void MaskableGraphic_RecalculateMasking_m2250524558 (MaskableGraphic_t3186046376 * __this, const MethodInfo* method) { { __this->set_m_ShouldRecalculateStencil_19((bool)1); VirtActionInvoker0::Invoke(24 /* System.Void UnityEngine.UI.Graphic::SetMaterialDirty() */, __this); return; } } // UnityEngine.RectTransform UnityEngine.UI.MaskableGraphic::UnityEngine.UI.IClippable.get_rectTransform() extern "C" RectTransform_t972643934 * MaskableGraphic_UnityEngine_UI_IClippable_get_rectTransform_m3856601786 (MaskableGraphic_t3186046376 * __this, const MethodInfo* method) { { RectTransform_t972643934 * L_0 = Graphic_get_rectTransform_m4017371950(__this, /*hidden argument*/NULL); return L_0; } } // System.Void UnityEngine.UI.MaskableGraphic/CullStateChangedEvent::.ctor() extern const MethodInfo* UnityEvent_1__ctor_m1579102881_MethodInfo_var; extern const uint32_t CullStateChangedEvent__ctor_m2540235971_MetadataUsageId; extern "C" void CullStateChangedEvent__ctor_m2540235971 (CullStateChangedEvent_t2290505109 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (CullStateChangedEvent__ctor_m2540235971_MetadataUsageId); s_Il2CppMethodIntialized = true; } { UnityEvent_1__ctor_m1579102881(__this, /*hidden argument*/UnityEvent_1__ctor_m1579102881_MethodInfo_var); return; } } // System.Void UnityEngine.UI.MaskUtilities::.ctor() extern "C" void MaskUtilities__ctor_m1166009725 (MaskUtilities_t3879688356 * __this, const MethodInfo* method) { { Object__ctor_m1772956182(__this, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.UI.MaskUtilities::Notify2DMaskStateChanged(UnityEngine.Component) extern Il2CppClass* ListPool_1_t2599153559_il2cpp_TypeInfo_var; extern Il2CppClass* IClippable_t502791197_il2cpp_TypeInfo_var; extern const MethodInfo* ListPool_1_Get_m2014868279_MethodInfo_var; extern const MethodInfo* Component_GetComponentsInChildren_TisComponent_t3501516275_m1080956020_MethodInfo_var; extern const MethodInfo* List_1_get_Item_m1226401687_MethodInfo_var; extern const MethodInfo* List_1_get_Count_m1104343294_MethodInfo_var; extern const MethodInfo* ListPool_1_Release_m2849004751_MethodInfo_var; extern const uint32_t MaskUtilities_Notify2DMaskStateChanged_m2199550555_MetadataUsageId; extern "C" void MaskUtilities_Notify2DMaskStateChanged_m2199550555 (Il2CppObject * __this /* static, unused */, Component_t3501516275 * ___mask0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (MaskUtilities_Notify2DMaskStateChanged_m2199550555_MetadataUsageId); s_Il2CppMethodIntialized = true; } List_1_t574734531 * V_0 = NULL; int32_t V_1 = 0; Il2CppObject * V_2 = NULL; { IL2CPP_RUNTIME_CLASS_INIT(ListPool_1_t2599153559_il2cpp_TypeInfo_var); List_1_t574734531 * L_0 = ListPool_1_Get_m2014868279(NULL /*static, unused*/, /*hidden argument*/ListPool_1_Get_m2014868279_MethodInfo_var); V_0 = L_0; Component_t3501516275 * L_1 = ___mask0; List_1_t574734531 * L_2 = V_0; NullCheck(L_1); Component_GetComponentsInChildren_TisComponent_t3501516275_m1080956020(L_1, L_2, /*hidden argument*/Component_GetComponentsInChildren_TisComponent_t3501516275_m1080956020_MethodInfo_var); V_1 = 0; goto IL_0064; } IL_0014: { List_1_t574734531 * L_3 = V_0; int32_t L_4 = V_1; NullCheck(L_3); Component_t3501516275 * L_5 = List_1_get_Item_m1226401687(L_3, L_4, /*hidden argument*/List_1_get_Item_m1226401687_MethodInfo_var); bool L_6 = Object_op_Equality_m3964590952(NULL /*static, unused*/, L_5, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (L_6) { goto IL_0042; } } { List_1_t574734531 * L_7 = V_0; int32_t L_8 = V_1; NullCheck(L_7); Component_t3501516275 * L_9 = List_1_get_Item_m1226401687(L_7, L_8, /*hidden argument*/List_1_get_Item_m1226401687_MethodInfo_var); NullCheck(L_9); GameObject_t3674682005 * L_10 = Component_get_gameObject_m1170635899(L_9, /*hidden argument*/NULL); Component_t3501516275 * L_11 = ___mask0; NullCheck(L_11); GameObject_t3674682005 * L_12 = Component_get_gameObject_m1170635899(L_11, /*hidden argument*/NULL); bool L_13 = Object_op_Equality_m3964590952(NULL /*static, unused*/, L_10, L_12, /*hidden argument*/NULL); if (!L_13) { goto IL_0047; } } IL_0042: { goto IL_0060; } IL_0047: { List_1_t574734531 * L_14 = V_0; int32_t L_15 = V_1; NullCheck(L_14); Component_t3501516275 * L_16 = List_1_get_Item_m1226401687(L_14, L_15, /*hidden argument*/List_1_get_Item_m1226401687_MethodInfo_var); V_2 = ((Il2CppObject *)IsInst(L_16, IClippable_t502791197_il2cpp_TypeInfo_var)); Il2CppObject * L_17 = V_2; if (!L_17) { goto IL_0060; } } { Il2CppObject * L_18 = V_2; NullCheck(L_18); InterfaceActionInvoker0::Invoke(0 /* System.Void UnityEngine.UI.IClippable::RecalculateClipping() */, IClippable_t502791197_il2cpp_TypeInfo_var, L_18); } IL_0060: { int32_t L_19 = V_1; V_1 = ((int32_t)((int32_t)L_19+(int32_t)1)); } IL_0064: { int32_t L_20 = V_1; List_1_t574734531 * L_21 = V_0; NullCheck(L_21); int32_t L_22 = List_1_get_Count_m1104343294(L_21, /*hidden argument*/List_1_get_Count_m1104343294_MethodInfo_var); if ((((int32_t)L_20) < ((int32_t)L_22))) { goto IL_0014; } } { List_1_t574734531 * L_23 = V_0; IL2CPP_RUNTIME_CLASS_INIT(ListPool_1_t2599153559_il2cpp_TypeInfo_var); ListPool_1_Release_m2849004751(NULL /*static, unused*/, L_23, /*hidden argument*/ListPool_1_Release_m2849004751_MethodInfo_var); return; } } // System.Void UnityEngine.UI.MaskUtilities::NotifyStencilStateChanged(UnityEngine.Component) extern Il2CppClass* ListPool_1_t2599153559_il2cpp_TypeInfo_var; extern Il2CppClass* IMaskable_t1719715701_il2cpp_TypeInfo_var; extern const MethodInfo* ListPool_1_Get_m2014868279_MethodInfo_var; extern const MethodInfo* Component_GetComponentsInChildren_TisComponent_t3501516275_m1080956020_MethodInfo_var; extern const MethodInfo* List_1_get_Item_m1226401687_MethodInfo_var; extern const MethodInfo* List_1_get_Count_m1104343294_MethodInfo_var; extern const MethodInfo* ListPool_1_Release_m2849004751_MethodInfo_var; extern const uint32_t MaskUtilities_NotifyStencilStateChanged_m2159873435_MetadataUsageId; extern "C" void MaskUtilities_NotifyStencilStateChanged_m2159873435 (Il2CppObject * __this /* static, unused */, Component_t3501516275 * ___mask0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (MaskUtilities_NotifyStencilStateChanged_m2159873435_MetadataUsageId); s_Il2CppMethodIntialized = true; } List_1_t574734531 * V_0 = NULL; int32_t V_1 = 0; Il2CppObject * V_2 = NULL; { IL2CPP_RUNTIME_CLASS_INIT(ListPool_1_t2599153559_il2cpp_TypeInfo_var); List_1_t574734531 * L_0 = ListPool_1_Get_m2014868279(NULL /*static, unused*/, /*hidden argument*/ListPool_1_Get_m2014868279_MethodInfo_var); V_0 = L_0; Component_t3501516275 * L_1 = ___mask0; List_1_t574734531 * L_2 = V_0; NullCheck(L_1); Component_GetComponentsInChildren_TisComponent_t3501516275_m1080956020(L_1, L_2, /*hidden argument*/Component_GetComponentsInChildren_TisComponent_t3501516275_m1080956020_MethodInfo_var); V_1 = 0; goto IL_0064; } IL_0014: { List_1_t574734531 * L_3 = V_0; int32_t L_4 = V_1; NullCheck(L_3); Component_t3501516275 * L_5 = List_1_get_Item_m1226401687(L_3, L_4, /*hidden argument*/List_1_get_Item_m1226401687_MethodInfo_var); bool L_6 = Object_op_Equality_m3964590952(NULL /*static, unused*/, L_5, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (L_6) { goto IL_0042; } } { List_1_t574734531 * L_7 = V_0; int32_t L_8 = V_1; NullCheck(L_7); Component_t3501516275 * L_9 = List_1_get_Item_m1226401687(L_7, L_8, /*hidden argument*/List_1_get_Item_m1226401687_MethodInfo_var); NullCheck(L_9); GameObject_t3674682005 * L_10 = Component_get_gameObject_m1170635899(L_9, /*hidden argument*/NULL); Component_t3501516275 * L_11 = ___mask0; NullCheck(L_11); GameObject_t3674682005 * L_12 = Component_get_gameObject_m1170635899(L_11, /*hidden argument*/NULL); bool L_13 = Object_op_Equality_m3964590952(NULL /*static, unused*/, L_10, L_12, /*hidden argument*/NULL); if (!L_13) { goto IL_0047; } } IL_0042: { goto IL_0060; } IL_0047: { List_1_t574734531 * L_14 = V_0; int32_t L_15 = V_1; NullCheck(L_14); Component_t3501516275 * L_16 = List_1_get_Item_m1226401687(L_14, L_15, /*hidden argument*/List_1_get_Item_m1226401687_MethodInfo_var); V_2 = ((Il2CppObject *)IsInst(L_16, IMaskable_t1719715701_il2cpp_TypeInfo_var)); Il2CppObject * L_17 = V_2; if (!L_17) { goto IL_0060; } } { Il2CppObject * L_18 = V_2; NullCheck(L_18); InterfaceActionInvoker0::Invoke(0 /* System.Void UnityEngine.UI.IMaskable::RecalculateMasking() */, IMaskable_t1719715701_il2cpp_TypeInfo_var, L_18); } IL_0060: { int32_t L_19 = V_1; V_1 = ((int32_t)((int32_t)L_19+(int32_t)1)); } IL_0064: { int32_t L_20 = V_1; List_1_t574734531 * L_21 = V_0; NullCheck(L_21); int32_t L_22 = List_1_get_Count_m1104343294(L_21, /*hidden argument*/List_1_get_Count_m1104343294_MethodInfo_var); if ((((int32_t)L_20) < ((int32_t)L_22))) { goto IL_0014; } } { List_1_t574734531 * L_23 = V_0; IL2CPP_RUNTIME_CLASS_INIT(ListPool_1_t2599153559_il2cpp_TypeInfo_var); ListPool_1_Release_m2849004751(NULL /*static, unused*/, L_23, /*hidden argument*/ListPool_1_Release_m2849004751_MethodInfo_var); return; } } // UnityEngine.Transform UnityEngine.UI.MaskUtilities::FindRootSortOverrideCanvas(UnityEngine.Transform) extern Il2CppClass* ListPool_1_t1824778048_il2cpp_TypeInfo_var; extern const MethodInfo* ListPool_1_Get_m3707028656_MethodInfo_var; extern const MethodInfo* Component_GetComponentsInParent_TisCanvas_t2727140764_m2636073967_MethodInfo_var; extern const MethodInfo* List_1_get_Item_m3400185932_MethodInfo_var; extern const MethodInfo* List_1_get_Count_m1137691305_MethodInfo_var; extern const MethodInfo* ListPool_1_Release_m3200393738_MethodInfo_var; extern const uint32_t MaskUtilities_FindRootSortOverrideCanvas_m4219954651_MetadataUsageId; extern "C" Transform_t1659122786 * MaskUtilities_FindRootSortOverrideCanvas_m4219954651 (Il2CppObject * __this /* static, unused */, Transform_t1659122786 * ___start0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (MaskUtilities_FindRootSortOverrideCanvas_m4219954651_MetadataUsageId); s_Il2CppMethodIntialized = true; } List_1_t4095326316 * V_0 = NULL; Canvas_t2727140764 * V_1 = NULL; int32_t V_2 = 0; Transform_t1659122786 * G_B8_0 = NULL; { IL2CPP_RUNTIME_CLASS_INIT(ListPool_1_t1824778048_il2cpp_TypeInfo_var); List_1_t4095326316 * L_0 = ListPool_1_Get_m3707028656(NULL /*static, unused*/, /*hidden argument*/ListPool_1_Get_m3707028656_MethodInfo_var); V_0 = L_0; Transform_t1659122786 * L_1 = ___start0; List_1_t4095326316 * L_2 = V_0; NullCheck(L_1); Component_GetComponentsInParent_TisCanvas_t2727140764_m2636073967(L_1, (bool)0, L_2, /*hidden argument*/Component_GetComponentsInParent_TisCanvas_t2727140764_m2636073967_MethodInfo_var); V_1 = (Canvas_t2727140764 *)NULL; V_2 = 0; goto IL_0033; } IL_0017: { List_1_t4095326316 * L_3 = V_0; int32_t L_4 = V_2; NullCheck(L_3); Canvas_t2727140764 * L_5 = List_1_get_Item_m3400185932(L_3, L_4, /*hidden argument*/List_1_get_Item_m3400185932_MethodInfo_var); V_1 = L_5; Canvas_t2727140764 * L_6 = V_1; NullCheck(L_6); bool L_7 = Canvas_get_overrideSorting_m3812884636(L_6, /*hidden argument*/NULL); if (!L_7) { goto IL_002f; } } { goto IL_003f; } IL_002f: { int32_t L_8 = V_2; V_2 = ((int32_t)((int32_t)L_8+(int32_t)1)); } IL_0033: { int32_t L_9 = V_2; List_1_t4095326316 * L_10 = V_0; NullCheck(L_10); int32_t L_11 = List_1_get_Count_m1137691305(L_10, /*hidden argument*/List_1_get_Count_m1137691305_MethodInfo_var); if ((((int32_t)L_9) < ((int32_t)L_11))) { goto IL_0017; } } IL_003f: { List_1_t4095326316 * L_12 = V_0; IL2CPP_RUNTIME_CLASS_INIT(ListPool_1_t1824778048_il2cpp_TypeInfo_var); ListPool_1_Release_m3200393738(NULL /*static, unused*/, L_12, /*hidden argument*/ListPool_1_Release_m3200393738_MethodInfo_var); Canvas_t2727140764 * L_13 = V_1; bool L_14 = Object_op_Inequality_m1296218211(NULL /*static, unused*/, L_13, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_14) { goto IL_005c; } } { Canvas_t2727140764 * L_15 = V_1; NullCheck(L_15); Transform_t1659122786 * L_16 = Component_get_transform_m4257140443(L_15, /*hidden argument*/NULL); G_B8_0 = L_16; goto IL_005d; } IL_005c: { G_B8_0 = ((Transform_t1659122786 *)(NULL)); } IL_005d: { return G_B8_0; } } // System.Int32 UnityEngine.UI.MaskUtilities::GetStencilDepth(UnityEngine.Transform,UnityEngine.Transform) extern Il2CppClass* ListPool_1_t3401431260_il2cpp_TypeInfo_var; extern const MethodInfo* ListPool_1_Get_m2713847744_MethodInfo_var; extern const MethodInfo* Component_GetComponents_TisMask_t8826680_m956513135_MethodInfo_var; extern const MethodInfo* List_1_get_Item_m1125069934_MethodInfo_var; extern const MethodInfo* List_1_get_Count_m3001244807_MethodInfo_var; extern const MethodInfo* ListPool_1_Release_m3569998872_MethodInfo_var; extern const uint32_t MaskUtilities_GetStencilDepth_m2786493988_MetadataUsageId; extern "C" int32_t MaskUtilities_GetStencilDepth_m2786493988 (Il2CppObject * __this /* static, unused */, Transform_t1659122786 * ___transform0, Transform_t1659122786 * ___stopAfter1, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (MaskUtilities_GetStencilDepth_m2786493988_MetadataUsageId); s_Il2CppMethodIntialized = true; } int32_t V_0 = 0; Transform_t1659122786 * V_1 = NULL; List_1_t1377012232 * V_2 = NULL; int32_t V_3 = 0; { V_0 = 0; Transform_t1659122786 * L_0 = ___transform0; Transform_t1659122786 * L_1 = ___stopAfter1; bool L_2 = Object_op_Equality_m3964590952(NULL /*static, unused*/, L_0, L_1, /*hidden argument*/NULL); if (!L_2) { goto IL_0010; } } { int32_t L_3 = V_0; return L_3; } IL_0010: { Transform_t1659122786 * L_4 = ___transform0; NullCheck(L_4); Transform_t1659122786 * L_5 = Transform_get_parent_m2236876972(L_4, /*hidden argument*/NULL); V_1 = L_5; IL2CPP_RUNTIME_CLASS_INIT(ListPool_1_t3401431260_il2cpp_TypeInfo_var); List_1_t1377012232 * L_6 = ListPool_1_Get_m2713847744(NULL /*static, unused*/, /*hidden argument*/ListPool_1_Get_m2713847744_MethodInfo_var); V_2 = L_6; goto IL_00b1; } IL_0022: { Transform_t1659122786 * L_7 = V_1; List_1_t1377012232 * L_8 = V_2; NullCheck(L_7); Component_GetComponents_TisMask_t8826680_m956513135(L_7, L_8, /*hidden argument*/Component_GetComponents_TisMask_t8826680_m956513135_MethodInfo_var); V_3 = 0; goto IL_008d; } IL_0030: { List_1_t1377012232 * L_9 = V_2; int32_t L_10 = V_3; NullCheck(L_9); Mask_t8826680 * L_11 = List_1_get_Item_m1125069934(L_9, L_10, /*hidden argument*/List_1_get_Item_m1125069934_MethodInfo_var); bool L_12 = Object_op_Inequality_m1296218211(NULL /*static, unused*/, L_11, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_12) { goto IL_0089; } } { List_1_t1377012232 * L_13 = V_2; int32_t L_14 = V_3; NullCheck(L_13); Mask_t8826680 * L_15 = List_1_get_Item_m1125069934(L_13, L_14, /*hidden argument*/List_1_get_Item_m1125069934_MethodInfo_var); NullCheck(L_15); bool L_16 = VirtFuncInvoker0< bool >::Invoke(9 /* System.Boolean UnityEngine.EventSystems.UIBehaviour::IsActive() */, L_15); if (!L_16) { goto IL_0089; } } { List_1_t1377012232 * L_17 = V_2; int32_t L_18 = V_3; NullCheck(L_17); Mask_t8826680 * L_19 = List_1_get_Item_m1125069934(L_17, L_18, /*hidden argument*/List_1_get_Item_m1125069934_MethodInfo_var); NullCheck(L_19); Graphic_t836799438 * L_20 = Mask_get_graphic_m2101144526(L_19, /*hidden argument*/NULL); bool L_21 = Object_op_Inequality_m1296218211(NULL /*static, unused*/, L_20, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_21) { goto IL_0089; } } { List_1_t1377012232 * L_22 = V_2; int32_t L_23 = V_3; NullCheck(L_22); Mask_t8826680 * L_24 = List_1_get_Item_m1125069934(L_22, L_23, /*hidden argument*/List_1_get_Item_m1125069934_MethodInfo_var); NullCheck(L_24); Graphic_t836799438 * L_25 = Mask_get_graphic_m2101144526(L_24, /*hidden argument*/NULL); NullCheck(L_25); bool L_26 = VirtFuncInvoker0< bool >::Invoke(9 /* System.Boolean UnityEngine.EventSystems.UIBehaviour::IsActive() */, L_25); if (!L_26) { goto IL_0089; } } { int32_t L_27 = V_0; V_0 = ((int32_t)((int32_t)L_27+(int32_t)1)); goto IL_0099; } IL_0089: { int32_t L_28 = V_3; V_3 = ((int32_t)((int32_t)L_28+(int32_t)1)); } IL_008d: { int32_t L_29 = V_3; List_1_t1377012232 * L_30 = V_2; NullCheck(L_30); int32_t L_31 = List_1_get_Count_m3001244807(L_30, /*hidden argument*/List_1_get_Count_m3001244807_MethodInfo_var); if ((((int32_t)L_29) < ((int32_t)L_31))) { goto IL_0030; } } IL_0099: { Transform_t1659122786 * L_32 = V_1; Transform_t1659122786 * L_33 = ___stopAfter1; bool L_34 = Object_op_Equality_m3964590952(NULL /*static, unused*/, L_32, L_33, /*hidden argument*/NULL); if (!L_34) { goto IL_00aa; } } { goto IL_00bd; } IL_00aa: { Transform_t1659122786 * L_35 = V_1; NullCheck(L_35); Transform_t1659122786 * L_36 = Transform_get_parent_m2236876972(L_35, /*hidden argument*/NULL); V_1 = L_36; } IL_00b1: { Transform_t1659122786 * L_37 = V_1; bool L_38 = Object_op_Inequality_m1296218211(NULL /*static, unused*/, L_37, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (L_38) { goto IL_0022; } } IL_00bd: { List_1_t1377012232 * L_39 = V_2; IL2CPP_RUNTIME_CLASS_INIT(ListPool_1_t3401431260_il2cpp_TypeInfo_var); ListPool_1_Release_m3569998872(NULL /*static, unused*/, L_39, /*hidden argument*/ListPool_1_Release_m3569998872_MethodInfo_var); int32_t L_40 = V_0; return L_40; } } // UnityEngine.UI.RectMask2D UnityEngine.UI.MaskUtilities::GetRectMaskForClippable(UnityEngine.UI.IClippable) extern Il2CppClass* ListPool_1_t2454716658_il2cpp_TypeInfo_var; extern Il2CppClass* IClippable_t502791197_il2cpp_TypeInfo_var; extern const MethodInfo* ListPool_1_Get_m2190567382_MethodInfo_var; extern const MethodInfo* Component_GetComponentsInParent_TisRectMask2D_t3357079374_m2818396525_MethodInfo_var; extern const MethodInfo* List_1_get_Count_m1145814749_MethodInfo_var; extern const MethodInfo* List_1_get_Item_m1186224216_MethodInfo_var; extern const MethodInfo* ListPool_1_Release_m3441100526_MethodInfo_var; extern const uint32_t MaskUtilities_GetRectMaskForClippable_m396614586_MetadataUsageId; extern "C" RectMask2D_t3357079374 * MaskUtilities_GetRectMaskForClippable_m396614586 (Il2CppObject * __this /* static, unused */, Il2CppObject * ___transform0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (MaskUtilities_GetRectMaskForClippable_m396614586_MetadataUsageId); s_Il2CppMethodIntialized = true; } List_1_t430297630 * V_0 = NULL; RectMask2D_t3357079374 * V_1 = NULL; { IL2CPP_RUNTIME_CLASS_INIT(ListPool_1_t2454716658_il2cpp_TypeInfo_var); List_1_t430297630 * L_0 = ListPool_1_Get_m2190567382(NULL /*static, unused*/, /*hidden argument*/ListPool_1_Get_m2190567382_MethodInfo_var); V_0 = L_0; V_1 = (RectMask2D_t3357079374 *)NULL; Il2CppObject * L_1 = ___transform0; NullCheck(L_1); RectTransform_t972643934 * L_2 = InterfaceFuncInvoker0< RectTransform_t972643934 * >::Invoke(1 /* UnityEngine.RectTransform UnityEngine.UI.IClippable::get_rectTransform() */, IClippable_t502791197_il2cpp_TypeInfo_var, L_1); List_1_t430297630 * L_3 = V_0; NullCheck(L_2); Component_GetComponentsInParent_TisRectMask2D_t3357079374_m2818396525(L_2, (bool)0, L_3, /*hidden argument*/Component_GetComponentsInParent_TisRectMask2D_t3357079374_m2818396525_MethodInfo_var); List_1_t430297630 * L_4 = V_0; NullCheck(L_4); int32_t L_5 = List_1_get_Count_m1145814749(L_4, /*hidden argument*/List_1_get_Count_m1145814749_MethodInfo_var); if ((((int32_t)L_5) <= ((int32_t)0))) { goto IL_0029; } } { List_1_t430297630 * L_6 = V_0; NullCheck(L_6); RectMask2D_t3357079374 * L_7 = List_1_get_Item_m1186224216(L_6, 0, /*hidden argument*/List_1_get_Item_m1186224216_MethodInfo_var); V_1 = L_7; } IL_0029: { List_1_t430297630 * L_8 = V_0; IL2CPP_RUNTIME_CLASS_INIT(ListPool_1_t2454716658_il2cpp_TypeInfo_var); ListPool_1_Release_m3441100526(NULL /*static, unused*/, L_8, /*hidden argument*/ListPool_1_Release_m3441100526_MethodInfo_var); RectMask2D_t3357079374 * L_9 = V_1; return L_9; } } // System.Void UnityEngine.UI.MaskUtilities::GetRectMasksForClip(UnityEngine.UI.RectMask2D,System.Collections.Generic.List`1<UnityEngine.UI.RectMask2D>) extern const MethodInfo* List_1_Clear_m3930129260_MethodInfo_var; extern const MethodInfo* Component_GetComponentsInParent_TisRectMask2D_t3357079374_m2818396525_MethodInfo_var; extern const uint32_t MaskUtilities_GetRectMasksForClip_m447525417_MetadataUsageId; extern "C" void MaskUtilities_GetRectMasksForClip_m447525417 (Il2CppObject * __this /* static, unused */, RectMask2D_t3357079374 * ___clipper0, List_1_t430297630 * ___masks1, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (MaskUtilities_GetRectMasksForClip_m447525417_MetadataUsageId); s_Il2CppMethodIntialized = true; } { List_1_t430297630 * L_0 = ___masks1; NullCheck(L_0); List_1_Clear_m3930129260(L_0, /*hidden argument*/List_1_Clear_m3930129260_MethodInfo_var); RectMask2D_t3357079374 * L_1 = ___clipper0; NullCheck(L_1); Transform_t1659122786 * L_2 = Component_get_transform_m4257140443(L_1, /*hidden argument*/NULL); List_1_t430297630 * L_3 = ___masks1; NullCheck(L_2); Component_GetComponentsInParent_TisRectMask2D_t3357079374_m2818396525(L_2, (bool)0, L_3, /*hidden argument*/Component_GetComponentsInParent_TisRectMask2D_t3357079374_m2818396525_MethodInfo_var); return; } } // System.Void UnityEngine.UI.Misc::Destroy(UnityEngine.Object) extern Il2CppClass* GameObject_t3674682005_il2cpp_TypeInfo_var; extern const uint32_t Misc_Destroy_m612433153_MetadataUsageId; extern "C" void Misc_Destroy_m612433153 (Il2CppObject * __this /* static, unused */, Object_t3071478659 * ___obj0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Misc_Destroy_m612433153_MetadataUsageId); s_Il2CppMethodIntialized = true; } GameObject_t3674682005 * V_0 = NULL; { Object_t3071478659 * L_0 = ___obj0; bool L_1 = Object_op_Inequality_m1296218211(NULL /*static, unused*/, L_0, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_1) { goto IL_0045; } } { bool L_2 = Application_get_isPlaying_m987993960(NULL /*static, unused*/, /*hidden argument*/NULL); if (!L_2) { goto IL_003f; } } { Object_t3071478659 * L_3 = ___obj0; if (!((GameObject_t3674682005 *)IsInstSealed(L_3, GameObject_t3674682005_il2cpp_TypeInfo_var))) { goto IL_0034; } } { Object_t3071478659 * L_4 = ___obj0; V_0 = ((GameObject_t3674682005 *)IsInstSealed(L_4, GameObject_t3674682005_il2cpp_TypeInfo_var)); GameObject_t3674682005 * L_5 = V_0; NullCheck(L_5); Transform_t1659122786 * L_6 = GameObject_get_transform_m1278640159(L_5, /*hidden argument*/NULL); NullCheck(L_6); Transform_set_parent_m3231272063(L_6, (Transform_t1659122786 *)NULL, /*hidden argument*/NULL); } IL_0034: { Object_t3071478659 * L_7 = ___obj0; Object_Destroy_m176400816(NULL /*static, unused*/, L_7, /*hidden argument*/NULL); goto IL_0045; } IL_003f: { Object_t3071478659 * L_8 = ___obj0; Object_DestroyImmediate_m349958679(NULL /*static, unused*/, L_8, /*hidden argument*/NULL); } IL_0045: { return; } } // System.Void UnityEngine.UI.Misc::DestroyImmediate(UnityEngine.Object) extern "C" void Misc_DestroyImmediate_m40421862 (Il2CppObject * __this /* static, unused */, Object_t3071478659 * ___obj0, const MethodInfo* method) { { Object_t3071478659 * L_0 = ___obj0; bool L_1 = Object_op_Inequality_m1296218211(NULL /*static, unused*/, L_0, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_1) { goto IL_0027; } } { bool L_2 = Application_get_isEditor_m1279348309(NULL /*static, unused*/, /*hidden argument*/NULL); if (!L_2) { goto IL_0021; } } { Object_t3071478659 * L_3 = ___obj0; Object_DestroyImmediate_m349958679(NULL /*static, unused*/, L_3, /*hidden argument*/NULL); goto IL_0027; } IL_0021: { Object_t3071478659 * L_4 = ___obj0; Object_Destroy_m176400816(NULL /*static, unused*/, L_4, /*hidden argument*/NULL); } IL_0027: { return; } } // UnityEngine.UI.Navigation/Mode UnityEngine.UI.Navigation::get_mode() extern "C" int32_t Navigation_get_mode_m721480509 (Navigation_t1108456480 * __this, const MethodInfo* method) { { int32_t L_0 = __this->get_m_Mode_0(); return L_0; } } extern "C" int32_t Navigation_get_mode_m721480509_AdjustorThunk (Il2CppObject * __this, const MethodInfo* method) { Navigation_t1108456480 * _thisAdjusted = reinterpret_cast<Navigation_t1108456480 *>(__this + 1); return Navigation_get_mode_m721480509(_thisAdjusted, method); } // System.Void UnityEngine.UI.Navigation::set_mode(UnityEngine.UI.Navigation/Mode) extern "C" void Navigation_set_mode_m1506614802 (Navigation_t1108456480 * __this, int32_t ___value0, const MethodInfo* method) { { int32_t L_0 = ___value0; __this->set_m_Mode_0(L_0); return; } } extern "C" void Navigation_set_mode_m1506614802_AdjustorThunk (Il2CppObject * __this, int32_t ___value0, const MethodInfo* method) { Navigation_t1108456480 * _thisAdjusted = reinterpret_cast<Navigation_t1108456480 *>(__this + 1); Navigation_set_mode_m1506614802(_thisAdjusted, ___value0, method); } // UnityEngine.UI.Selectable UnityEngine.UI.Navigation::get_selectOnUp() extern "C" Selectable_t1885181538 * Navigation_get_selectOnUp_m2566832818 (Navigation_t1108456480 * __this, const MethodInfo* method) { { Selectable_t1885181538 * L_0 = __this->get_m_SelectOnUp_1(); return L_0; } } extern "C" Selectable_t1885181538 * Navigation_get_selectOnUp_m2566832818_AdjustorThunk (Il2CppObject * __this, const MethodInfo* method) { Navigation_t1108456480 * _thisAdjusted = reinterpret_cast<Navigation_t1108456480 *>(__this + 1); return Navigation_get_selectOnUp_m2566832818(_thisAdjusted, method); } // System.Void UnityEngine.UI.Navigation::set_selectOnUp(UnityEngine.UI.Selectable) extern "C" void Navigation_set_selectOnUp_m2875366329 (Navigation_t1108456480 * __this, Selectable_t1885181538 * ___value0, const MethodInfo* method) { { Selectable_t1885181538 * L_0 = ___value0; __this->set_m_SelectOnUp_1(L_0); return; } } extern "C" void Navigation_set_selectOnUp_m2875366329_AdjustorThunk (Il2CppObject * __this, Selectable_t1885181538 * ___value0, const MethodInfo* method) { Navigation_t1108456480 * _thisAdjusted = reinterpret_cast<Navigation_t1108456480 *>(__this + 1); Navigation_set_selectOnUp_m2875366329(_thisAdjusted, ___value0, method); } // UnityEngine.UI.Selectable UnityEngine.UI.Navigation::get_selectOnDown() extern "C" Selectable_t1885181538 * Navigation_get_selectOnDown_m929912185 (Navigation_t1108456480 * __this, const MethodInfo* method) { { Selectable_t1885181538 * L_0 = __this->get_m_SelectOnDown_2(); return L_0; } } extern "C" Selectable_t1885181538 * Navigation_get_selectOnDown_m929912185_AdjustorThunk (Il2CppObject * __this, const MethodInfo* method) { Navigation_t1108456480 * _thisAdjusted = reinterpret_cast<Navigation_t1108456480 *>(__this + 1); return Navigation_get_selectOnDown_m929912185(_thisAdjusted, method); } // System.Void UnityEngine.UI.Navigation::set_selectOnDown(UnityEngine.UI.Selectable) extern "C" void Navigation_set_selectOnDown_m2647056978 (Navigation_t1108456480 * __this, Selectable_t1885181538 * ___value0, const MethodInfo* method) { { Selectable_t1885181538 * L_0 = ___value0; __this->set_m_SelectOnDown_2(L_0); return; } } extern "C" void Navigation_set_selectOnDown_m2647056978_AdjustorThunk (Il2CppObject * __this, Selectable_t1885181538 * ___value0, const MethodInfo* method) { Navigation_t1108456480 * _thisAdjusted = reinterpret_cast<Navigation_t1108456480 *>(__this + 1); Navigation_set_selectOnDown_m2647056978(_thisAdjusted, ___value0, method); } // UnityEngine.UI.Selectable UnityEngine.UI.Navigation::get_selectOnLeft() extern "C" Selectable_t1885181538 * Navigation_get_selectOnLeft_m1149209502 (Navigation_t1108456480 * __this, const MethodInfo* method) { { Selectable_t1885181538 * L_0 = __this->get_m_SelectOnLeft_3(); return L_0; } } extern "C" Selectable_t1885181538 * Navigation_get_selectOnLeft_m1149209502_AdjustorThunk (Il2CppObject * __this, const MethodInfo* method) { Navigation_t1108456480 * _thisAdjusted = reinterpret_cast<Navigation_t1108456480 *>(__this + 1); return Navigation_get_selectOnLeft_m1149209502(_thisAdjusted, method); } // System.Void UnityEngine.UI.Navigation::set_selectOnLeft(UnityEngine.UI.Selectable) extern "C" void Navigation_set_selectOnLeft_m619081677 (Navigation_t1108456480 * __this, Selectable_t1885181538 * ___value0, const MethodInfo* method) { { Selectable_t1885181538 * L_0 = ___value0; __this->set_m_SelectOnLeft_3(L_0); return; } } extern "C" void Navigation_set_selectOnLeft_m619081677_AdjustorThunk (Il2CppObject * __this, Selectable_t1885181538 * ___value0, const MethodInfo* method) { Navigation_t1108456480 * _thisAdjusted = reinterpret_cast<Navigation_t1108456480 *>(__this + 1); Navigation_set_selectOnLeft_m619081677(_thisAdjusted, ___value0, method); } // UnityEngine.UI.Selectable UnityEngine.UI.Navigation::get_selectOnRight() extern "C" Selectable_t1885181538 * Navigation_get_selectOnRight_m2410966663 (Navigation_t1108456480 * __this, const MethodInfo* method) { { Selectable_t1885181538 * L_0 = __this->get_m_SelectOnRight_4(); return L_0; } } extern "C" Selectable_t1885181538 * Navigation_get_selectOnRight_m2410966663_AdjustorThunk (Il2CppObject * __this, const MethodInfo* method) { Navigation_t1108456480 * _thisAdjusted = reinterpret_cast<Navigation_t1108456480 *>(__this + 1); return Navigation_get_selectOnRight_m2410966663(_thisAdjusted, method); } // System.Void UnityEngine.UI.Navigation::set_selectOnRight(UnityEngine.UI.Selectable) extern "C" void Navigation_set_selectOnRight_m1544013280 (Navigation_t1108456480 * __this, Selectable_t1885181538 * ___value0, const MethodInfo* method) { { Selectable_t1885181538 * L_0 = ___value0; __this->set_m_SelectOnRight_4(L_0); return; } } extern "C" void Navigation_set_selectOnRight_m1544013280_AdjustorThunk (Il2CppObject * __this, Selectable_t1885181538 * ___value0, const MethodInfo* method) { Navigation_t1108456480 * _thisAdjusted = reinterpret_cast<Navigation_t1108456480 *>(__this + 1); Navigation_set_selectOnRight_m1544013280(_thisAdjusted, ___value0, method); } // UnityEngine.UI.Navigation UnityEngine.UI.Navigation::get_defaultNavigation() extern Il2CppClass* Navigation_t1108456480_il2cpp_TypeInfo_var; extern const uint32_t Navigation_get_defaultNavigation_m492829917_MetadataUsageId; extern "C" Navigation_t1108456480 Navigation_get_defaultNavigation_m492829917 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Navigation_get_defaultNavigation_m492829917_MetadataUsageId); s_Il2CppMethodIntialized = true; } Navigation_t1108456480 V_0; memset(&V_0, 0, sizeof(V_0)); { Initobj (Navigation_t1108456480_il2cpp_TypeInfo_var, (&V_0)); (&V_0)->set_m_Mode_0(3); Navigation_t1108456480 L_0 = V_0; return L_0; } } // System.Boolean UnityEngine.UI.Navigation::Equals(UnityEngine.UI.Navigation) extern "C" bool Navigation_Equals_m3278735261 (Navigation_t1108456480 * __this, Navigation_t1108456480 ___other0, const MethodInfo* method) { int32_t G_B6_0 = 0; { int32_t L_0 = Navigation_get_mode_m721480509(__this, /*hidden argument*/NULL); int32_t L_1 = Navigation_get_mode_m721480509((&___other0), /*hidden argument*/NULL); if ((!(((uint32_t)L_0) == ((uint32_t)L_1)))) { goto IL_006b; } } { Selectable_t1885181538 * L_2 = Navigation_get_selectOnUp_m2566832818(__this, /*hidden argument*/NULL); Selectable_t1885181538 * L_3 = Navigation_get_selectOnUp_m2566832818((&___other0), /*hidden argument*/NULL); bool L_4 = Object_op_Equality_m3964590952(NULL /*static, unused*/, L_2, L_3, /*hidden argument*/NULL); if (!L_4) { goto IL_006b; } } { Selectable_t1885181538 * L_5 = Navigation_get_selectOnDown_m929912185(__this, /*hidden argument*/NULL); Selectable_t1885181538 * L_6 = Navigation_get_selectOnDown_m929912185((&___other0), /*hidden argument*/NULL); bool L_7 = Object_op_Equality_m3964590952(NULL /*static, unused*/, L_5, L_6, /*hidden argument*/NULL); if (!L_7) { goto IL_006b; } } { Selectable_t1885181538 * L_8 = Navigation_get_selectOnLeft_m1149209502(__this, /*hidden argument*/NULL); Selectable_t1885181538 * L_9 = Navigation_get_selectOnLeft_m1149209502((&___other0), /*hidden argument*/NULL); bool L_10 = Object_op_Equality_m3964590952(NULL /*static, unused*/, L_8, L_9, /*hidden argument*/NULL); if (!L_10) { goto IL_006b; } } { Selectable_t1885181538 * L_11 = Navigation_get_selectOnRight_m2410966663(__this, /*hidden argument*/NULL); Selectable_t1885181538 * L_12 = Navigation_get_selectOnRight_m2410966663((&___other0), /*hidden argument*/NULL); bool L_13 = Object_op_Equality_m3964590952(NULL /*static, unused*/, L_11, L_12, /*hidden argument*/NULL); G_B6_0 = ((int32_t)(L_13)); goto IL_006c; } IL_006b: { G_B6_0 = 0; } IL_006c: { return (bool)G_B6_0; } } extern "C" bool Navigation_Equals_m3278735261_AdjustorThunk (Il2CppObject * __this, Navigation_t1108456480 ___other0, const MethodInfo* method) { Navigation_t1108456480 * _thisAdjusted = reinterpret_cast<Navigation_t1108456480 *>(__this + 1); return Navigation_Equals_m3278735261(_thisAdjusted, ___other0, method); } // Conversion methods for marshalling of: UnityEngine.UI.Navigation extern "C" void Navigation_t1108456480_marshal_pinvoke(const Navigation_t1108456480& unmarshaled, Navigation_t1108456480_marshaled_pinvoke& marshaled) { Il2CppCodeGenException* ___m_SelectOnUp_1Exception = il2cpp_codegen_get_marshal_directive_exception("Cannot marshal field 'm_SelectOnUp' of type 'Navigation': Reference type field marshaling is not supported."); IL2CPP_RAISE_MANAGED_EXCEPTION(___m_SelectOnUp_1Exception); } extern "C" void Navigation_t1108456480_marshal_pinvoke_back(const Navigation_t1108456480_marshaled_pinvoke& marshaled, Navigation_t1108456480& unmarshaled) { Il2CppCodeGenException* ___m_SelectOnUp_1Exception = il2cpp_codegen_get_marshal_directive_exception("Cannot marshal field 'm_SelectOnUp' of type 'Navigation': Reference type field marshaling is not supported."); IL2CPP_RAISE_MANAGED_EXCEPTION(___m_SelectOnUp_1Exception); } // Conversion method for clean up from marshalling of: UnityEngine.UI.Navigation extern "C" void Navigation_t1108456480_marshal_pinvoke_cleanup(Navigation_t1108456480_marshaled_pinvoke& marshaled) { } // Conversion methods for marshalling of: UnityEngine.UI.Navigation extern "C" void Navigation_t1108456480_marshal_com(const Navigation_t1108456480& unmarshaled, Navigation_t1108456480_marshaled_com& marshaled) { Il2CppCodeGenException* ___m_SelectOnUp_1Exception = il2cpp_codegen_get_marshal_directive_exception("Cannot marshal field 'm_SelectOnUp' of type 'Navigation': Reference type field marshaling is not supported."); IL2CPP_RAISE_MANAGED_EXCEPTION(___m_SelectOnUp_1Exception); } extern "C" void Navigation_t1108456480_marshal_com_back(const Navigation_t1108456480_marshaled_com& marshaled, Navigation_t1108456480& unmarshaled) { Il2CppCodeGenException* ___m_SelectOnUp_1Exception = il2cpp_codegen_get_marshal_directive_exception("Cannot marshal field 'm_SelectOnUp' of type 'Navigation': Reference type field marshaling is not supported."); IL2CPP_RAISE_MANAGED_EXCEPTION(___m_SelectOnUp_1Exception); } // Conversion method for clean up from marshalling of: UnityEngine.UI.Navigation extern "C" void Navigation_t1108456480_marshal_com_cleanup(Navigation_t1108456480_marshaled_com& marshaled) { } // System.Void UnityEngine.UI.Outline::.ctor() extern "C" void Outline__ctor_m4004117817 (Outline_t3745177896 * __this, const MethodInfo* method) { { Shadow__ctor_m2944649643(__this, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.UI.Outline::ModifyMesh(UnityEngine.UI.VertexHelper) extern Il2CppClass* ListPool_1_t3341702496_il2cpp_TypeInfo_var; extern const MethodInfo* ListPool_1_Get_m3130095824_MethodInfo_var; extern const MethodInfo* List_1_get_Count_m4277682313_MethodInfo_var; extern const MethodInfo* List_1_get_Capacity_m792627810_MethodInfo_var; extern const MethodInfo* List_1_set_Capacity_m3820333071_MethodInfo_var; extern const MethodInfo* ListPool_1_Release_m2709067242_MethodInfo_var; extern const uint32_t Outline_ModifyMesh_m4125422123_MetadataUsageId; extern "C" void Outline_ModifyMesh_m4125422123 (Outline_t3745177896 * __this, VertexHelper_t3377436606 * ___vh0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Outline_ModifyMesh_m4125422123_MetadataUsageId); s_Il2CppMethodIntialized = true; } List_1_t1317283468 * V_0 = NULL; int32_t V_1 = 0; int32_t V_2 = 0; int32_t V_3 = 0; Vector2_t4282066565 V_4; memset(&V_4, 0, sizeof(V_4)); Vector2_t4282066565 V_5; memset(&V_5, 0, sizeof(V_5)); Vector2_t4282066565 V_6; memset(&V_6, 0, sizeof(V_6)); Vector2_t4282066565 V_7; memset(&V_7, 0, sizeof(V_7)); Vector2_t4282066565 V_8; memset(&V_8, 0, sizeof(V_8)); Vector2_t4282066565 V_9; memset(&V_9, 0, sizeof(V_9)); Vector2_t4282066565 V_10; memset(&V_10, 0, sizeof(V_10)); Vector2_t4282066565 V_11; memset(&V_11, 0, sizeof(V_11)); { bool L_0 = VirtFuncInvoker0< bool >::Invoke(9 /* System.Boolean UnityEngine.EventSystems.UIBehaviour::IsActive() */, __this); if (L_0) { goto IL_000c; } } { return; } IL_000c: { IL2CPP_RUNTIME_CLASS_INIT(ListPool_1_t3341702496_il2cpp_TypeInfo_var); List_1_t1317283468 * L_1 = ListPool_1_Get_m3130095824(NULL /*static, unused*/, /*hidden argument*/ListPool_1_Get_m3130095824_MethodInfo_var); V_0 = L_1; VertexHelper_t3377436606 * L_2 = ___vh0; List_1_t1317283468 * L_3 = V_0; NullCheck(L_2); VertexHelper_GetUIVertexStream_m1078623420(L_2, L_3, /*hidden argument*/NULL); List_1_t1317283468 * L_4 = V_0; NullCheck(L_4); int32_t L_5 = List_1_get_Count_m4277682313(L_4, /*hidden argument*/List_1_get_Count_m4277682313_MethodInfo_var); V_1 = ((int32_t)((int32_t)L_5*(int32_t)5)); List_1_t1317283468 * L_6 = V_0; NullCheck(L_6); int32_t L_7 = List_1_get_Capacity_m792627810(L_6, /*hidden argument*/List_1_get_Capacity_m792627810_MethodInfo_var); int32_t L_8 = V_1; if ((((int32_t)L_7) >= ((int32_t)L_8))) { goto IL_0035; } } { List_1_t1317283468 * L_9 = V_0; int32_t L_10 = V_1; NullCheck(L_9); List_1_set_Capacity_m3820333071(L_9, L_10, /*hidden argument*/List_1_set_Capacity_m3820333071_MethodInfo_var); } IL_0035: { V_2 = 0; List_1_t1317283468 * L_11 = V_0; NullCheck(L_11); int32_t L_12 = List_1_get_Count_m4277682313(L_11, /*hidden argument*/List_1_get_Count_m4277682313_MethodInfo_var); V_3 = L_12; List_1_t1317283468 * L_13 = V_0; Color_t4194546905 L_14 = Shadow_get_effectColor_m2953989785(__this, /*hidden argument*/NULL); Color32_t598853688 L_15 = Color32_op_Implicit_m3684884838(NULL /*static, unused*/, L_14, /*hidden argument*/NULL); int32_t L_16 = V_2; List_1_t1317283468 * L_17 = V_0; NullCheck(L_17); int32_t L_18 = List_1_get_Count_m4277682313(L_17, /*hidden argument*/List_1_get_Count_m4277682313_MethodInfo_var); Vector2_t4282066565 L_19 = Shadow_get_effectDistance_m1102454733(__this, /*hidden argument*/NULL); V_4 = L_19; float L_20 = (&V_4)->get_x_1(); Vector2_t4282066565 L_21 = Shadow_get_effectDistance_m1102454733(__this, /*hidden argument*/NULL); V_5 = L_21; float L_22 = (&V_5)->get_y_2(); Shadow_ApplyShadowZeroAlloc_m338158484(__this, L_13, L_15, L_16, L_18, L_20, L_22, /*hidden argument*/NULL); int32_t L_23 = V_3; V_2 = L_23; List_1_t1317283468 * L_24 = V_0; NullCheck(L_24); int32_t L_25 = List_1_get_Count_m4277682313(L_24, /*hidden argument*/List_1_get_Count_m4277682313_MethodInfo_var); V_3 = L_25; List_1_t1317283468 * L_26 = V_0; Color_t4194546905 L_27 = Shadow_get_effectColor_m2953989785(__this, /*hidden argument*/NULL); Color32_t598853688 L_28 = Color32_op_Implicit_m3684884838(NULL /*static, unused*/, L_27, /*hidden argument*/NULL); int32_t L_29 = V_2; List_1_t1317283468 * L_30 = V_0; NullCheck(L_30); int32_t L_31 = List_1_get_Count_m4277682313(L_30, /*hidden argument*/List_1_get_Count_m4277682313_MethodInfo_var); Vector2_t4282066565 L_32 = Shadow_get_effectDistance_m1102454733(__this, /*hidden argument*/NULL); V_6 = L_32; float L_33 = (&V_6)->get_x_1(); Vector2_t4282066565 L_34 = Shadow_get_effectDistance_m1102454733(__this, /*hidden argument*/NULL); V_7 = L_34; float L_35 = (&V_7)->get_y_2(); Shadow_ApplyShadowZeroAlloc_m338158484(__this, L_26, L_28, L_29, L_31, L_33, ((-L_35)), /*hidden argument*/NULL); int32_t L_36 = V_3; V_2 = L_36; List_1_t1317283468 * L_37 = V_0; NullCheck(L_37); int32_t L_38 = List_1_get_Count_m4277682313(L_37, /*hidden argument*/List_1_get_Count_m4277682313_MethodInfo_var); V_3 = L_38; List_1_t1317283468 * L_39 = V_0; Color_t4194546905 L_40 = Shadow_get_effectColor_m2953989785(__this, /*hidden argument*/NULL); Color32_t598853688 L_41 = Color32_op_Implicit_m3684884838(NULL /*static, unused*/, L_40, /*hidden argument*/NULL); int32_t L_42 = V_2; List_1_t1317283468 * L_43 = V_0; NullCheck(L_43); int32_t L_44 = List_1_get_Count_m4277682313(L_43, /*hidden argument*/List_1_get_Count_m4277682313_MethodInfo_var); Vector2_t4282066565 L_45 = Shadow_get_effectDistance_m1102454733(__this, /*hidden argument*/NULL); V_8 = L_45; float L_46 = (&V_8)->get_x_1(); Vector2_t4282066565 L_47 = Shadow_get_effectDistance_m1102454733(__this, /*hidden argument*/NULL); V_9 = L_47; float L_48 = (&V_9)->get_y_2(); Shadow_ApplyShadowZeroAlloc_m338158484(__this, L_39, L_41, L_42, L_44, ((-L_46)), L_48, /*hidden argument*/NULL); int32_t L_49 = V_3; V_2 = L_49; List_1_t1317283468 * L_50 = V_0; NullCheck(L_50); int32_t L_51 = List_1_get_Count_m4277682313(L_50, /*hidden argument*/List_1_get_Count_m4277682313_MethodInfo_var); V_3 = L_51; List_1_t1317283468 * L_52 = V_0; Color_t4194546905 L_53 = Shadow_get_effectColor_m2953989785(__this, /*hidden argument*/NULL); Color32_t598853688 L_54 = Color32_op_Implicit_m3684884838(NULL /*static, unused*/, L_53, /*hidden argument*/NULL); int32_t L_55 = V_2; List_1_t1317283468 * L_56 = V_0; NullCheck(L_56); int32_t L_57 = List_1_get_Count_m4277682313(L_56, /*hidden argument*/List_1_get_Count_m4277682313_MethodInfo_var); Vector2_t4282066565 L_58 = Shadow_get_effectDistance_m1102454733(__this, /*hidden argument*/NULL); V_10 = L_58; float L_59 = (&V_10)->get_x_1(); Vector2_t4282066565 L_60 = Shadow_get_effectDistance_m1102454733(__this, /*hidden argument*/NULL); V_11 = L_60; float L_61 = (&V_11)->get_y_2(); Shadow_ApplyShadowZeroAlloc_m338158484(__this, L_52, L_54, L_55, L_57, ((-L_59)), ((-L_61)), /*hidden argument*/NULL); VertexHelper_t3377436606 * L_62 = ___vh0; NullCheck(L_62); VertexHelper_Clear_m412394180(L_62, /*hidden argument*/NULL); VertexHelper_t3377436606 * L_63 = ___vh0; List_1_t1317283468 * L_64 = V_0; NullCheck(L_63); VertexHelper_AddUIVertexTriangleStream_m1263262953(L_63, L_64, /*hidden argument*/NULL); List_1_t1317283468 * L_65 = V_0; IL2CPP_RUNTIME_CLASS_INIT(ListPool_1_t3341702496_il2cpp_TypeInfo_var); ListPool_1_Release_m2709067242(NULL /*static, unused*/, L_65, /*hidden argument*/ListPool_1_Release_m2709067242_MethodInfo_var); return; } } // System.Void UnityEngine.UI.PositionAsUV1::.ctor() extern "C" void PositionAsUV1__ctor_m3124267078 (PositionAsUV1_t4062429115 * __this, const MethodInfo* method) { { BaseMeshEffect__ctor_m2332499996(__this, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.UI.PositionAsUV1::ModifyMesh(UnityEngine.UI.VertexHelper) extern Il2CppClass* UIVertex_t4244065212_il2cpp_TypeInfo_var; extern const uint32_t PositionAsUV1_ModifyMesh_m2424047928_MetadataUsageId; extern "C" void PositionAsUV1_ModifyMesh_m2424047928 (PositionAsUV1_t4062429115 * __this, VertexHelper_t3377436606 * ___vh0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (PositionAsUV1_ModifyMesh_m2424047928_MetadataUsageId); s_Il2CppMethodIntialized = true; } UIVertex_t4244065212 V_0; memset(&V_0, 0, sizeof(V_0)); int32_t V_1 = 0; { Initobj (UIVertex_t4244065212_il2cpp_TypeInfo_var, (&V_0)); V_1 = 0; goto IL_0048; } IL_000f: { VertexHelper_t3377436606 * L_0 = ___vh0; int32_t L_1 = V_1; NullCheck(L_0); VertexHelper_PopulateUIVertex_m910319817(L_0, (&V_0), L_1, /*hidden argument*/NULL); Vector3_t4282066566 * L_2 = (&V_0)->get_address_of_position_0(); float L_3 = L_2->get_x_1(); Vector3_t4282066566 * L_4 = (&V_0)->get_address_of_position_0(); float L_5 = L_4->get_y_2(); Vector2_t4282066565 L_6; memset(&L_6, 0, sizeof(L_6)); Vector2__ctor_m1517109030(&L_6, L_3, L_5, /*hidden argument*/NULL); (&V_0)->set_uv1_4(L_6); VertexHelper_t3377436606 * L_7 = ___vh0; UIVertex_t4244065212 L_8 = V_0; int32_t L_9 = V_1; NullCheck(L_7); VertexHelper_SetUIVertex_m3429482805(L_7, L_8, L_9, /*hidden argument*/NULL); int32_t L_10 = V_1; V_1 = ((int32_t)((int32_t)L_10+(int32_t)1)); } IL_0048: { int32_t L_11 = V_1; VertexHelper_t3377436606 * L_12 = ___vh0; NullCheck(L_12); int32_t L_13 = VertexHelper_get_currentVertCount_m3425330353(L_12, /*hidden argument*/NULL); if ((((int32_t)L_11) < ((int32_t)L_13))) { goto IL_000f; } } { return; } } // System.Void UnityEngine.UI.RawImage::.ctor() extern "C" void RawImage__ctor_m3149617176 (RawImage_t821930207 * __this, const MethodInfo* method) { { Rect_t4241904616 L_0; memset(&L_0, 0, sizeof(L_0)); Rect__ctor_m3291325233(&L_0, (0.0f), (0.0f), (1.0f), (1.0f), /*hidden argument*/NULL); __this->set_m_UVRect_29(L_0); MaskableGraphic__ctor_m3514233785(__this, /*hidden argument*/NULL); Graphic_set_useLegacyMeshGeneration_m693817504(__this, (bool)0, /*hidden argument*/NULL); return; } } // UnityEngine.Texture UnityEngine.UI.RawImage::get_mainTexture() extern Il2CppClass* Graphic_t836799438_il2cpp_TypeInfo_var; extern const uint32_t RawImage_get_mainTexture_m3607327198_MetadataUsageId; extern "C" Texture_t2526458961 * RawImage_get_mainTexture_m3607327198 (RawImage_t821930207 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (RawImage_get_mainTexture_m3607327198_MetadataUsageId); s_Il2CppMethodIntialized = true; } { Texture_t2526458961 * L_0 = __this->get_m_Texture_28(); bool L_1 = Object_op_Equality_m3964590952(NULL /*static, unused*/, L_0, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_1) { goto IL_004a; } } { Material_t3870600107 * L_2 = VirtFuncInvoker0< Material_t3870600107 * >::Invoke(26 /* UnityEngine.Material UnityEngine.UI.Graphic::get_material() */, __this); bool L_3 = Object_op_Inequality_m1296218211(NULL /*static, unused*/, L_2, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_3) { goto IL_0044; } } { Material_t3870600107 * L_4 = VirtFuncInvoker0< Material_t3870600107 * >::Invoke(26 /* UnityEngine.Material UnityEngine.UI.Graphic::get_material() */, __this); NullCheck(L_4); Texture_t2526458961 * L_5 = Material_get_mainTexture_m1012267054(L_4, /*hidden argument*/NULL); bool L_6 = Object_op_Inequality_m1296218211(NULL /*static, unused*/, L_5, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_6) { goto IL_0044; } } { Material_t3870600107 * L_7 = VirtFuncInvoker0< Material_t3870600107 * >::Invoke(26 /* UnityEngine.Material UnityEngine.UI.Graphic::get_material() */, __this); NullCheck(L_7); Texture_t2526458961 * L_8 = Material_get_mainTexture_m1012267054(L_7, /*hidden argument*/NULL); return L_8; } IL_0044: { IL2CPP_RUNTIME_CLASS_INIT(Graphic_t836799438_il2cpp_TypeInfo_var); Texture2D_t3884108195 * L_9 = ((Graphic_t836799438_StaticFields*)Graphic_t836799438_il2cpp_TypeInfo_var->static_fields)->get_s_WhiteTexture_3(); return L_9; } IL_004a: { Texture_t2526458961 * L_10 = __this->get_m_Texture_28(); return L_10; } } // UnityEngine.Texture UnityEngine.UI.RawImage::get_texture() extern "C" Texture_t2526458961 * RawImage_get_texture_m2545896727 (RawImage_t821930207 * __this, const MethodInfo* method) { { Texture_t2526458961 * L_0 = __this->get_m_Texture_28(); return L_0; } } // System.Void UnityEngine.UI.RawImage::set_texture(UnityEngine.Texture) extern "C" void RawImage_set_texture_m153141914 (RawImage_t821930207 * __this, Texture_t2526458961 * ___value0, const MethodInfo* method) { { Texture_t2526458961 * L_0 = __this->get_m_Texture_28(); Texture_t2526458961 * L_1 = ___value0; bool L_2 = Object_op_Equality_m3964590952(NULL /*static, unused*/, L_0, L_1, /*hidden argument*/NULL); if (!L_2) { goto IL_0012; } } { return; } IL_0012: { Texture_t2526458961 * L_3 = ___value0; __this->set_m_Texture_28(L_3); VirtActionInvoker0::Invoke(23 /* System.Void UnityEngine.UI.Graphic::SetVerticesDirty() */, __this); VirtActionInvoker0::Invoke(24 /* System.Void UnityEngine.UI.Graphic::SetMaterialDirty() */, __this); return; } } // UnityEngine.Rect UnityEngine.UI.RawImage::get_uvRect() extern "C" Rect_t4241904616 RawImage_get_uvRect_m605244702 (RawImage_t821930207 * __this, const MethodInfo* method) { { Rect_t4241904616 L_0 = __this->get_m_UVRect_29(); return L_0; } } // System.Void UnityEngine.UI.RawImage::set_uvRect(UnityEngine.Rect) extern "C" void RawImage_set_uvRect_m1381047731 (RawImage_t821930207 * __this, Rect_t4241904616 ___value0, const MethodInfo* method) { { Rect_t4241904616 L_0 = __this->get_m_UVRect_29(); Rect_t4241904616 L_1 = ___value0; bool L_2 = Rect_op_Equality_m1552341101(NULL /*static, unused*/, L_0, L_1, /*hidden argument*/NULL); if (!L_2) { goto IL_0012; } } { return; } IL_0012: { Rect_t4241904616 L_3 = ___value0; __this->set_m_UVRect_29(L_3); VirtActionInvoker0::Invoke(23 /* System.Void UnityEngine.UI.Graphic::SetVerticesDirty() */, __this); return; } } // System.Void UnityEngine.UI.RawImage::SetNativeSize() extern Il2CppClass* Mathf_t4203372500_il2cpp_TypeInfo_var; extern const uint32_t RawImage_SetNativeSize_m131446896_MetadataUsageId; extern "C" void RawImage_SetNativeSize_m131446896 (RawImage_t821930207 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (RawImage_SetNativeSize_m131446896_MetadataUsageId); s_Il2CppMethodIntialized = true; } Texture_t2526458961 * V_0 = NULL; int32_t V_1 = 0; int32_t V_2 = 0; Rect_t4241904616 V_3; memset(&V_3, 0, sizeof(V_3)); Rect_t4241904616 V_4; memset(&V_4, 0, sizeof(V_4)); { Texture_t2526458961 * L_0 = VirtFuncInvoker0< Texture_t2526458961 * >::Invoke(29 /* UnityEngine.Texture UnityEngine.UI.RawImage::get_mainTexture() */, __this); V_0 = L_0; Texture_t2526458961 * L_1 = V_0; bool L_2 = Object_op_Inequality_m1296218211(NULL /*static, unused*/, L_1, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_2) { goto IL_0076; } } { Texture_t2526458961 * L_3 = V_0; NullCheck(L_3); int32_t L_4 = VirtFuncInvoker0< int32_t >::Invoke(4 /* System.Int32 UnityEngine.Texture::get_width() */, L_3); Rect_t4241904616 L_5 = RawImage_get_uvRect_m605244702(__this, /*hidden argument*/NULL); V_3 = L_5; float L_6 = Rect_get_width_m2824209432((&V_3), /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(Mathf_t4203372500_il2cpp_TypeInfo_var); int32_t L_7 = Mathf_RoundToInt_m3163545820(NULL /*static, unused*/, ((float)((float)(((float)((float)L_4)))*(float)L_6)), /*hidden argument*/NULL); V_1 = L_7; Texture_t2526458961 * L_8 = V_0; NullCheck(L_8); int32_t L_9 = VirtFuncInvoker0< int32_t >::Invoke(5 /* System.Int32 UnityEngine.Texture::get_height() */, L_8); Rect_t4241904616 L_10 = RawImage_get_uvRect_m605244702(__this, /*hidden argument*/NULL); V_4 = L_10; float L_11 = Rect_get_height_m2154960823((&V_4), /*hidden argument*/NULL); int32_t L_12 = Mathf_RoundToInt_m3163545820(NULL /*static, unused*/, ((float)((float)(((float)((float)L_9)))*(float)L_11)), /*hidden argument*/NULL); V_2 = L_12; RectTransform_t972643934 * L_13 = Graphic_get_rectTransform_m4017371950(__this, /*hidden argument*/NULL); RectTransform_t972643934 * L_14 = Graphic_get_rectTransform_m4017371950(__this, /*hidden argument*/NULL); NullCheck(L_14); Vector2_t4282066565 L_15 = RectTransform_get_anchorMin_m688674174(L_14, /*hidden argument*/NULL); NullCheck(L_13); RectTransform_set_anchorMax_m715345817(L_13, L_15, /*hidden argument*/NULL); RectTransform_t972643934 * L_16 = Graphic_get_rectTransform_m4017371950(__this, /*hidden argument*/NULL); int32_t L_17 = V_1; int32_t L_18 = V_2; Vector2_t4282066565 L_19; memset(&L_19, 0, sizeof(L_19)); Vector2__ctor_m1517109030(&L_19, (((float)((float)L_17))), (((float)((float)L_18))), /*hidden argument*/NULL); NullCheck(L_16); RectTransform_set_sizeDelta_m1223846609(L_16, L_19, /*hidden argument*/NULL); } IL_0076: { return; } } // System.Void UnityEngine.UI.RawImage::OnPopulateMesh(UnityEngine.UI.VertexHelper) extern "C" void RawImage_OnPopulateMesh_m1483685179 (RawImage_t821930207 * __this, VertexHelper_t3377436606 * ___vh0, const MethodInfo* method) { Texture_t2526458961 * V_0 = NULL; Rect_t4241904616 V_1; memset(&V_1, 0, sizeof(V_1)); Vector4_t4282066567 V_2; memset(&V_2, 0, sizeof(V_2)); Color_t4194546905 V_3; memset(&V_3, 0, sizeof(V_3)); { Texture_t2526458961 * L_0 = VirtFuncInvoker0< Texture_t2526458961 * >::Invoke(29 /* UnityEngine.Texture UnityEngine.UI.RawImage::get_mainTexture() */, __this); V_0 = L_0; VertexHelper_t3377436606 * L_1 = ___vh0; NullCheck(L_1); VertexHelper_Clear_m412394180(L_1, /*hidden argument*/NULL); Texture_t2526458961 * L_2 = V_0; bool L_3 = Object_op_Inequality_m1296218211(NULL /*static, unused*/, L_2, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_3) { goto IL_0154; } } { Rect_t4241904616 L_4 = Graphic_GetPixelAdjustedRect_m517144655(__this, /*hidden argument*/NULL); V_1 = L_4; float L_5 = Rect_get_x_m982385354((&V_1), /*hidden argument*/NULL); float L_6 = Rect_get_y_m982386315((&V_1), /*hidden argument*/NULL); float L_7 = Rect_get_x_m982385354((&V_1), /*hidden argument*/NULL); float L_8 = Rect_get_width_m2824209432((&V_1), /*hidden argument*/NULL); float L_9 = Rect_get_y_m982386315((&V_1), /*hidden argument*/NULL); float L_10 = Rect_get_height_m2154960823((&V_1), /*hidden argument*/NULL); Vector4__ctor_m2441427762((&V_2), L_5, L_6, ((float)((float)L_7+(float)L_8)), ((float)((float)L_9+(float)L_10)), /*hidden argument*/NULL); Color_t4194546905 L_11 = Graphic_get_color_m2048831972(__this, /*hidden argument*/NULL); V_3 = L_11; VertexHelper_t3377436606 * L_12 = ___vh0; float L_13 = (&V_2)->get_x_1(); float L_14 = (&V_2)->get_y_2(); Vector3_t4282066566 L_15; memset(&L_15, 0, sizeof(L_15)); Vector3__ctor_m1846874791(&L_15, L_13, L_14, /*hidden argument*/NULL); Color_t4194546905 L_16 = V_3; Color32_t598853688 L_17 = Color32_op_Implicit_m3684884838(NULL /*static, unused*/, L_16, /*hidden argument*/NULL); Rect_t4241904616 * L_18 = __this->get_address_of_m_UVRect_29(); float L_19 = Rect_get_xMin_m371109962(L_18, /*hidden argument*/NULL); Rect_t4241904616 * L_20 = __this->get_address_of_m_UVRect_29(); float L_21 = Rect_get_yMin_m399739113(L_20, /*hidden argument*/NULL); Vector2_t4282066565 L_22; memset(&L_22, 0, sizeof(L_22)); Vector2__ctor_m1517109030(&L_22, L_19, L_21, /*hidden argument*/NULL); NullCheck(L_12); VertexHelper_AddVert_m1490065189(L_12, L_15, L_17, L_22, /*hidden argument*/NULL); VertexHelper_t3377436606 * L_23 = ___vh0; float L_24 = (&V_2)->get_x_1(); float L_25 = (&V_2)->get_w_4(); Vector3_t4282066566 L_26; memset(&L_26, 0, sizeof(L_26)); Vector3__ctor_m1846874791(&L_26, L_24, L_25, /*hidden argument*/NULL); Color_t4194546905 L_27 = V_3; Color32_t598853688 L_28 = Color32_op_Implicit_m3684884838(NULL /*static, unused*/, L_27, /*hidden argument*/NULL); Rect_t4241904616 * L_29 = __this->get_address_of_m_UVRect_29(); float L_30 = Rect_get_xMin_m371109962(L_29, /*hidden argument*/NULL); Rect_t4241904616 * L_31 = __this->get_address_of_m_UVRect_29(); float L_32 = Rect_get_yMax_m399510395(L_31, /*hidden argument*/NULL); Vector2_t4282066565 L_33; memset(&L_33, 0, sizeof(L_33)); Vector2__ctor_m1517109030(&L_33, L_30, L_32, /*hidden argument*/NULL); NullCheck(L_23); VertexHelper_AddVert_m1490065189(L_23, L_26, L_28, L_33, /*hidden argument*/NULL); VertexHelper_t3377436606 * L_34 = ___vh0; float L_35 = (&V_2)->get_z_3(); float L_36 = (&V_2)->get_w_4(); Vector3_t4282066566 L_37; memset(&L_37, 0, sizeof(L_37)); Vector3__ctor_m1846874791(&L_37, L_35, L_36, /*hidden argument*/NULL); Color_t4194546905 L_38 = V_3; Color32_t598853688 L_39 = Color32_op_Implicit_m3684884838(NULL /*static, unused*/, L_38, /*hidden argument*/NULL); Rect_t4241904616 * L_40 = __this->get_address_of_m_UVRect_29(); float L_41 = Rect_get_xMax_m370881244(L_40, /*hidden argument*/NULL); Rect_t4241904616 * L_42 = __this->get_address_of_m_UVRect_29(); float L_43 = Rect_get_yMax_m399510395(L_42, /*hidden argument*/NULL); Vector2_t4282066565 L_44; memset(&L_44, 0, sizeof(L_44)); Vector2__ctor_m1517109030(&L_44, L_41, L_43, /*hidden argument*/NULL); NullCheck(L_34); VertexHelper_AddVert_m1490065189(L_34, L_37, L_39, L_44, /*hidden argument*/NULL); VertexHelper_t3377436606 * L_45 = ___vh0; float L_46 = (&V_2)->get_z_3(); float L_47 = (&V_2)->get_y_2(); Vector3_t4282066566 L_48; memset(&L_48, 0, sizeof(L_48)); Vector3__ctor_m1846874791(&L_48, L_46, L_47, /*hidden argument*/NULL); Color_t4194546905 L_49 = V_3; Color32_t598853688 L_50 = Color32_op_Implicit_m3684884838(NULL /*static, unused*/, L_49, /*hidden argument*/NULL); Rect_t4241904616 * L_51 = __this->get_address_of_m_UVRect_29(); float L_52 = Rect_get_xMax_m370881244(L_51, /*hidden argument*/NULL); Rect_t4241904616 * L_53 = __this->get_address_of_m_UVRect_29(); float L_54 = Rect_get_yMin_m399739113(L_53, /*hidden argument*/NULL); Vector2_t4282066565 L_55; memset(&L_55, 0, sizeof(L_55)); Vector2__ctor_m1517109030(&L_55, L_52, L_54, /*hidden argument*/NULL); NullCheck(L_45); VertexHelper_AddVert_m1490065189(L_45, L_48, L_50, L_55, /*hidden argument*/NULL); VertexHelper_t3377436606 * L_56 = ___vh0; NullCheck(L_56); VertexHelper_AddTriangle_m514578993(L_56, 0, 1, 2, /*hidden argument*/NULL); VertexHelper_t3377436606 * L_57 = ___vh0; NullCheck(L_57); VertexHelper_AddTriangle_m514578993(L_57, 2, 3, 0, /*hidden argument*/NULL); } IL_0154: { return; } } // System.Void UnityEngine.UI.RectangularVertexClipper::.ctor() extern Il2CppClass* Vector3U5BU5D_t215400611_il2cpp_TypeInfo_var; extern const uint32_t RectangularVertexClipper__ctor_m1771616896_MetadataUsageId; extern "C" void RectangularVertexClipper__ctor_m1771616896 (RectangularVertexClipper_t1294793591 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (RectangularVertexClipper__ctor_m1771616896_MetadataUsageId); s_Il2CppMethodIntialized = true; } { __this->set_m_WorldCorners_0(((Vector3U5BU5D_t215400611*)SZArrayNew(Vector3U5BU5D_t215400611_il2cpp_TypeInfo_var, (uint32_t)4))); __this->set_m_CanvasCorners_1(((Vector3U5BU5D_t215400611*)SZArrayNew(Vector3U5BU5D_t215400611_il2cpp_TypeInfo_var, (uint32_t)4))); Object__ctor_m1772956182(__this, /*hidden argument*/NULL); return; } } // UnityEngine.Rect UnityEngine.UI.RectangularVertexClipper::GetCanvasRect(UnityEngine.RectTransform,UnityEngine.Canvas) extern const MethodInfo* Component_GetComponent_TisTransform_t1659122786_m811718087_MethodInfo_var; extern const uint32_t RectangularVertexClipper_GetCanvasRect_m4121299266_MetadataUsageId; extern "C" Rect_t4241904616 RectangularVertexClipper_GetCanvasRect_m4121299266 (RectangularVertexClipper_t1294793591 * __this, RectTransform_t972643934 * ___t0, Canvas_t2727140764 * ___c1, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (RectangularVertexClipper_GetCanvasRect_m4121299266_MetadataUsageId); s_Il2CppMethodIntialized = true; } Transform_t1659122786 * V_0 = NULL; int32_t V_1 = 0; { RectTransform_t972643934 * L_0 = ___t0; Vector3U5BU5D_t215400611* L_1 = __this->get_m_WorldCorners_0(); NullCheck(L_0); RectTransform_GetWorldCorners_m1829917190(L_0, L_1, /*hidden argument*/NULL); Canvas_t2727140764 * L_2 = ___c1; NullCheck(L_2); Transform_t1659122786 * L_3 = Component_GetComponent_TisTransform_t1659122786_m811718087(L_2, /*hidden argument*/Component_GetComponent_TisTransform_t1659122786_m811718087_MethodInfo_var); V_0 = L_3; V_1 = 0; goto IL_0046; } IL_001a: { Vector3U5BU5D_t215400611* L_4 = __this->get_m_CanvasCorners_1(); int32_t L_5 = V_1; NullCheck(L_4); IL2CPP_ARRAY_BOUNDS_CHECK(L_4, L_5); Transform_t1659122786 * L_6 = V_0; Vector3U5BU5D_t215400611* L_7 = __this->get_m_WorldCorners_0(); int32_t L_8 = V_1; NullCheck(L_7); IL2CPP_ARRAY_BOUNDS_CHECK(L_7, L_8); NullCheck(L_6); Vector3_t4282066566 L_9 = Transform_InverseTransformPoint_m1626812000(L_6, (*(Vector3_t4282066566 *)((L_7)->GetAddressAt(static_cast<il2cpp_array_size_t>(L_8)))), /*hidden argument*/NULL); (*(Vector3_t4282066566 *)((L_4)->GetAddressAt(static_cast<il2cpp_array_size_t>(L_5)))) = L_9; int32_t L_10 = V_1; V_1 = ((int32_t)((int32_t)L_10+(int32_t)1)); } IL_0046: { int32_t L_11 = V_1; if ((((int32_t)L_11) < ((int32_t)4))) { goto IL_001a; } } { Vector3U5BU5D_t215400611* L_12 = __this->get_m_CanvasCorners_1(); NullCheck(L_12); IL2CPP_ARRAY_BOUNDS_CHECK(L_12, 0); float L_13 = ((L_12)->GetAddressAt(static_cast<il2cpp_array_size_t>(0)))->get_x_1(); Vector3U5BU5D_t215400611* L_14 = __this->get_m_CanvasCorners_1(); NullCheck(L_14); IL2CPP_ARRAY_BOUNDS_CHECK(L_14, 0); float L_15 = ((L_14)->GetAddressAt(static_cast<il2cpp_array_size_t>(0)))->get_y_2(); Vector3U5BU5D_t215400611* L_16 = __this->get_m_CanvasCorners_1(); NullCheck(L_16); IL2CPP_ARRAY_BOUNDS_CHECK(L_16, 2); float L_17 = ((L_16)->GetAddressAt(static_cast<il2cpp_array_size_t>(2)))->get_x_1(); Vector3U5BU5D_t215400611* L_18 = __this->get_m_CanvasCorners_1(); NullCheck(L_18); IL2CPP_ARRAY_BOUNDS_CHECK(L_18, 0); float L_19 = ((L_18)->GetAddressAt(static_cast<il2cpp_array_size_t>(0)))->get_x_1(); Vector3U5BU5D_t215400611* L_20 = __this->get_m_CanvasCorners_1(); NullCheck(L_20); IL2CPP_ARRAY_BOUNDS_CHECK(L_20, 2); float L_21 = ((L_20)->GetAddressAt(static_cast<il2cpp_array_size_t>(2)))->get_y_2(); Vector3U5BU5D_t215400611* L_22 = __this->get_m_CanvasCorners_1(); NullCheck(L_22); IL2CPP_ARRAY_BOUNDS_CHECK(L_22, 0); float L_23 = ((L_22)->GetAddressAt(static_cast<il2cpp_array_size_t>(0)))->get_y_2(); Rect_t4241904616 L_24; memset(&L_24, 0, sizeof(L_24)); Rect__ctor_m3291325233(&L_24, L_13, L_15, ((float)((float)L_17-(float)L_19)), ((float)((float)L_21-(float)L_23)), /*hidden argument*/NULL); return L_24; } } // System.Void UnityEngine.UI.RectMask2D::.ctor() extern Il2CppClass* RectangularVertexClipper_t1294793591_il2cpp_TypeInfo_var; extern Il2CppClass* List_1_t1870976749_il2cpp_TypeInfo_var; extern Il2CppClass* List_1_t430297630_il2cpp_TypeInfo_var; extern const MethodInfo* List_1__ctor_m1202902352_MethodInfo_var; extern const MethodInfo* List_1__ctor_m2229028673_MethodInfo_var; extern const uint32_t RectMask2D__ctor_m743839689_MetadataUsageId; extern "C" void RectMask2D__ctor_m743839689 (RectMask2D_t3357079374 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (RectMask2D__ctor_m743839689_MetadataUsageId); s_Il2CppMethodIntialized = true; } { RectangularVertexClipper_t1294793591 * L_0 = (RectangularVertexClipper_t1294793591 *)il2cpp_codegen_object_new(RectangularVertexClipper_t1294793591_il2cpp_TypeInfo_var); RectangularVertexClipper__ctor_m1771616896(L_0, /*hidden argument*/NULL); __this->set_m_VertexClipper_2(L_0); List_1_t1870976749 * L_1 = (List_1_t1870976749 *)il2cpp_codegen_object_new(List_1_t1870976749_il2cpp_TypeInfo_var); List_1__ctor_m1202902352(L_1, /*hidden argument*/List_1__ctor_m1202902352_MethodInfo_var); __this->set_m_ClipTargets_4(L_1); List_1_t430297630 * L_2 = (List_1_t430297630 *)il2cpp_codegen_object_new(List_1_t430297630_il2cpp_TypeInfo_var); List_1__ctor_m2229028673(L_2, /*hidden argument*/List_1__ctor_m2229028673_MethodInfo_var); __this->set_m_Clippers_6(L_2); UIBehaviour__ctor_m1261553468(__this, /*hidden argument*/NULL); return; } } // UnityEngine.Rect UnityEngine.UI.RectMask2D::get_canvasRect() extern Il2CppClass* ListPool_1_t1824778048_il2cpp_TypeInfo_var; extern const MethodInfo* ListPool_1_Get_m3707028656_MethodInfo_var; extern const MethodInfo* GameObject_GetComponentsInParent_TisCanvas_t2727140764_m3002356423_MethodInfo_var; extern const MethodInfo* List_1_get_Count_m1137691305_MethodInfo_var; extern const MethodInfo* List_1_get_Item_m3400185932_MethodInfo_var; extern const MethodInfo* ListPool_1_Release_m3200393738_MethodInfo_var; extern const uint32_t RectMask2D_get_canvasRect_m3883544836_MetadataUsageId; extern "C" Rect_t4241904616 RectMask2D_get_canvasRect_m3883544836 (RectMask2D_t3357079374 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (RectMask2D_get_canvasRect_m3883544836_MetadataUsageId); s_Il2CppMethodIntialized = true; } Canvas_t2727140764 * V_0 = NULL; List_1_t4095326316 * V_1 = NULL; { V_0 = (Canvas_t2727140764 *)NULL; IL2CPP_RUNTIME_CLASS_INIT(ListPool_1_t1824778048_il2cpp_TypeInfo_var); List_1_t4095326316 * L_0 = ListPool_1_Get_m3707028656(NULL /*static, unused*/, /*hidden argument*/ListPool_1_Get_m3707028656_MethodInfo_var); V_1 = L_0; GameObject_t3674682005 * L_1 = Component_get_gameObject_m1170635899(__this, /*hidden argument*/NULL); List_1_t4095326316 * L_2 = V_1; NullCheck(L_1); GameObject_GetComponentsInParent_TisCanvas_t2727140764_m3002356423(L_1, (bool)0, L_2, /*hidden argument*/GameObject_GetComponentsInParent_TisCanvas_t2727140764_m3002356423_MethodInfo_var); List_1_t4095326316 * L_3 = V_1; NullCheck(L_3); int32_t L_4 = List_1_get_Count_m1137691305(L_3, /*hidden argument*/List_1_get_Count_m1137691305_MethodInfo_var); if ((((int32_t)L_4) <= ((int32_t)0))) { goto IL_0030; } } { List_1_t4095326316 * L_5 = V_1; List_1_t4095326316 * L_6 = V_1; NullCheck(L_6); int32_t L_7 = List_1_get_Count_m1137691305(L_6, /*hidden argument*/List_1_get_Count_m1137691305_MethodInfo_var); NullCheck(L_5); Canvas_t2727140764 * L_8 = List_1_get_Item_m3400185932(L_5, ((int32_t)((int32_t)L_7-(int32_t)1)), /*hidden argument*/List_1_get_Item_m3400185932_MethodInfo_var); V_0 = L_8; } IL_0030: { List_1_t4095326316 * L_9 = V_1; IL2CPP_RUNTIME_CLASS_INIT(ListPool_1_t1824778048_il2cpp_TypeInfo_var); ListPool_1_Release_m3200393738(NULL /*static, unused*/, L_9, /*hidden argument*/ListPool_1_Release_m3200393738_MethodInfo_var); RectangularVertexClipper_t1294793591 * L_10 = __this->get_m_VertexClipper_2(); RectTransform_t972643934 * L_11 = RectMask2D_get_rectTransform_m3879504040(__this, /*hidden argument*/NULL); Canvas_t2727140764 * L_12 = V_0; NullCheck(L_10); Rect_t4241904616 L_13 = RectangularVertexClipper_GetCanvasRect_m4121299266(L_10, L_11, L_12, /*hidden argument*/NULL); return L_13; } } // UnityEngine.RectTransform UnityEngine.UI.RectMask2D::get_rectTransform() extern const MethodInfo* Component_GetComponent_TisRectTransform_t972643934_m1940403147_MethodInfo_var; extern const uint32_t RectMask2D_get_rectTransform_m3879504040_MetadataUsageId; extern "C" RectTransform_t972643934 * RectMask2D_get_rectTransform_m3879504040 (RectMask2D_t3357079374 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (RectMask2D_get_rectTransform_m3879504040_MetadataUsageId); s_Il2CppMethodIntialized = true; } RectTransform_t972643934 * V_0 = NULL; RectTransform_t972643934 * G_B2_0 = NULL; RectTransform_t972643934 * G_B1_0 = NULL; { RectTransform_t972643934 * L_0 = __this->get_m_RectTransform_3(); RectTransform_t972643934 * L_1 = L_0; G_B1_0 = L_1; if (L_1) { G_B2_0 = L_1; goto IL_001c; } } { RectTransform_t972643934 * L_2 = Component_GetComponent_TisRectTransform_t972643934_m1940403147(__this, /*hidden argument*/Component_GetComponent_TisRectTransform_t972643934_m1940403147_MethodInfo_var); RectTransform_t972643934 * L_3 = L_2; V_0 = L_3; __this->set_m_RectTransform_3(L_3); RectTransform_t972643934 * L_4 = V_0; G_B2_0 = L_4; } IL_001c: { return G_B2_0; } } // System.Void UnityEngine.UI.RectMask2D::OnEnable() extern "C" void RectMask2D_OnEnable_m4063473437 (RectMask2D_t3357079374 * __this, const MethodInfo* method) { { UIBehaviour_OnEnable_m4047103690(__this, /*hidden argument*/NULL); __this->set_m_ShouldRecalculateClipRects_5((bool)1); ClipperRegistry_Register_m2777461237(NULL /*static, unused*/, __this, /*hidden argument*/NULL); MaskUtilities_Notify2DMaskStateChanged_m2199550555(NULL /*static, unused*/, __this, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.UI.RectMask2D::OnDisable() extern const MethodInfo* List_1_Clear_m2904002939_MethodInfo_var; extern const MethodInfo* List_1_Clear_m3930129260_MethodInfo_var; extern const uint32_t RectMask2D_OnDisable_m1854562224_MetadataUsageId; extern "C" void RectMask2D_OnDisable_m1854562224 (RectMask2D_t3357079374 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (RectMask2D_OnDisable_m1854562224_MetadataUsageId); s_Il2CppMethodIntialized = true; } { UIBehaviour_OnDisable_m1347100067(__this, /*hidden argument*/NULL); List_1_t1870976749 * L_0 = __this->get_m_ClipTargets_4(); NullCheck(L_0); List_1_Clear_m2904002939(L_0, /*hidden argument*/List_1_Clear_m2904002939_MethodInfo_var); List_1_t430297630 * L_1 = __this->get_m_Clippers_6(); NullCheck(L_1); List_1_Clear_m3930129260(L_1, /*hidden argument*/List_1_Clear_m3930129260_MethodInfo_var); ClipperRegistry_Unregister_m926013180(NULL /*static, unused*/, __this, /*hidden argument*/NULL); MaskUtilities_Notify2DMaskStateChanged_m2199550555(NULL /*static, unused*/, __this, /*hidden argument*/NULL); return; } } // System.Boolean UnityEngine.UI.RectMask2D::IsRaycastLocationValid(UnityEngine.Vector2,UnityEngine.Camera) extern Il2CppClass* RectTransformUtility_t3025555048_il2cpp_TypeInfo_var; extern const uint32_t RectMask2D_IsRaycastLocationValid_m3081840229_MetadataUsageId; extern "C" bool RectMask2D_IsRaycastLocationValid_m3081840229 (RectMask2D_t3357079374 * __this, Vector2_t4282066565 ___sp0, Camera_t2727095145 * ___eventCamera1, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (RectMask2D_IsRaycastLocationValid_m3081840229_MetadataUsageId); s_Il2CppMethodIntialized = true; } { bool L_0 = Behaviour_get_isActiveAndEnabled_m210167461(__this, /*hidden argument*/NULL); if (L_0) { goto IL_000d; } } { return (bool)1; } IL_000d: { RectTransform_t972643934 * L_1 = RectMask2D_get_rectTransform_m3879504040(__this, /*hidden argument*/NULL); Vector2_t4282066565 L_2 = ___sp0; Camera_t2727095145 * L_3 = ___eventCamera1; IL2CPP_RUNTIME_CLASS_INIT(RectTransformUtility_t3025555048_il2cpp_TypeInfo_var); bool L_4 = RectTransformUtility_RectangleContainsScreenPoint_m1460676684(NULL /*static, unused*/, L_1, L_2, L_3, /*hidden argument*/NULL); return L_4; } } // System.Void UnityEngine.UI.RectMask2D::PerformClipping() extern Il2CppClass* IClippable_t502791197_il2cpp_TypeInfo_var; extern const MethodInfo* List_1_get_Item_m3720088169_MethodInfo_var; extern const MethodInfo* List_1_get_Count_m2113842540_MethodInfo_var; extern const uint32_t RectMask2D_PerformClipping_m2105337834_MetadataUsageId; extern "C" void RectMask2D_PerformClipping_m2105337834 (RectMask2D_t3357079374 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (RectMask2D_PerformClipping_m2105337834_MetadataUsageId); s_Il2CppMethodIntialized = true; } bool V_0 = false; Rect_t4241904616 V_1; memset(&V_1, 0, sizeof(V_1)); int32_t V_2 = 0; int32_t V_3 = 0; { bool L_0 = __this->get_m_ShouldRecalculateClipRects_5(); if (!L_0) { goto IL_001e; } } { List_1_t430297630 * L_1 = __this->get_m_Clippers_6(); MaskUtilities_GetRectMasksForClip_m447525417(NULL /*static, unused*/, __this, L_1, /*hidden argument*/NULL); __this->set_m_ShouldRecalculateClipRects_5((bool)0); } IL_001e: { V_0 = (bool)1; List_1_t430297630 * L_2 = __this->get_m_Clippers_6(); Rect_t4241904616 L_3 = Clipping_FindCullAndClipWorldRect_m3007966961(NULL /*static, unused*/, L_2, (&V_0), /*hidden argument*/NULL); V_1 = L_3; Rect_t4241904616 L_4 = V_1; Rect_t4241904616 L_5 = __this->get_m_LastClipRectCanvasSpace_7(); bool L_6 = Rect_op_Inequality_m2236552616(NULL /*static, unused*/, L_4, L_5, /*hidden argument*/NULL); if (L_6) { goto IL_004a; } } { bool L_7 = __this->get_m_ForceClip_9(); if (!L_7) { goto IL_0087; } } IL_004a: { V_2 = 0; goto IL_0068; } IL_0051: { List_1_t1870976749 * L_8 = __this->get_m_ClipTargets_4(); int32_t L_9 = V_2; NullCheck(L_8); Il2CppObject * L_10 = List_1_get_Item_m3720088169(L_8, L_9, /*hidden argument*/List_1_get_Item_m3720088169_MethodInfo_var); Rect_t4241904616 L_11 = V_1; bool L_12 = V_0; NullCheck(L_10); InterfaceActionInvoker2< Rect_t4241904616 , bool >::Invoke(3 /* System.Void UnityEngine.UI.IClippable::SetClipRect(UnityEngine.Rect,System.Boolean) */, IClippable_t502791197_il2cpp_TypeInfo_var, L_10, L_11, L_12); int32_t L_13 = V_2; V_2 = ((int32_t)((int32_t)L_13+(int32_t)1)); } IL_0068: { int32_t L_14 = V_2; List_1_t1870976749 * L_15 = __this->get_m_ClipTargets_4(); NullCheck(L_15); int32_t L_16 = List_1_get_Count_m2113842540(L_15, /*hidden argument*/List_1_get_Count_m2113842540_MethodInfo_var); if ((((int32_t)L_14) < ((int32_t)L_16))) { goto IL_0051; } } { Rect_t4241904616 L_17 = V_1; __this->set_m_LastClipRectCanvasSpace_7(L_17); bool L_18 = V_0; __this->set_m_LastValidClipRect_8(L_18); } IL_0087: { V_3 = 0; goto IL_00af; } IL_008e: { List_1_t1870976749 * L_19 = __this->get_m_ClipTargets_4(); int32_t L_20 = V_3; NullCheck(L_19); Il2CppObject * L_21 = List_1_get_Item_m3720088169(L_19, L_20, /*hidden argument*/List_1_get_Item_m3720088169_MethodInfo_var); Rect_t4241904616 L_22 = __this->get_m_LastClipRectCanvasSpace_7(); bool L_23 = __this->get_m_LastValidClipRect_8(); NullCheck(L_21); InterfaceActionInvoker2< Rect_t4241904616 , bool >::Invoke(2 /* System.Void UnityEngine.UI.IClippable::Cull(UnityEngine.Rect,System.Boolean) */, IClippable_t502791197_il2cpp_TypeInfo_var, L_21, L_22, L_23); int32_t L_24 = V_3; V_3 = ((int32_t)((int32_t)L_24+(int32_t)1)); } IL_00af: { int32_t L_25 = V_3; List_1_t1870976749 * L_26 = __this->get_m_ClipTargets_4(); NullCheck(L_26); int32_t L_27 = List_1_get_Count_m2113842540(L_26, /*hidden argument*/List_1_get_Count_m2113842540_MethodInfo_var); if ((((int32_t)L_25) < ((int32_t)L_27))) { goto IL_008e; } } { return; } } // System.Void UnityEngine.UI.RectMask2D::AddClippable(UnityEngine.UI.IClippable) extern const MethodInfo* List_1_Contains_m1912443602_MethodInfo_var; extern const MethodInfo* List_1_Add_m897263168_MethodInfo_var; extern const uint32_t RectMask2D_AddClippable_m3020362282_MetadataUsageId; extern "C" void RectMask2D_AddClippable_m3020362282 (RectMask2D_t3357079374 * __this, Il2CppObject * ___clippable0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (RectMask2D_AddClippable_m3020362282_MetadataUsageId); s_Il2CppMethodIntialized = true; } { Il2CppObject * L_0 = ___clippable0; if (L_0) { goto IL_0007; } } { return; } IL_0007: { List_1_t1870976749 * L_1 = __this->get_m_ClipTargets_4(); Il2CppObject * L_2 = ___clippable0; NullCheck(L_1); bool L_3 = List_1_Contains_m1912443602(L_1, L_2, /*hidden argument*/List_1_Contains_m1912443602_MethodInfo_var); if (L_3) { goto IL_0024; } } { List_1_t1870976749 * L_4 = __this->get_m_ClipTargets_4(); Il2CppObject * L_5 = ___clippable0; NullCheck(L_4); List_1_Add_m897263168(L_4, L_5, /*hidden argument*/List_1_Add_m897263168_MethodInfo_var); } IL_0024: { __this->set_m_ForceClip_9((bool)1); return; } } // System.Void UnityEngine.UI.RectMask2D::RemoveClippable(UnityEngine.UI.IClippable) extern Il2CppClass* Rect_t4241904616_il2cpp_TypeInfo_var; extern Il2CppClass* IClippable_t502791197_il2cpp_TypeInfo_var; extern const MethodInfo* List_1_Remove_m372918007_MethodInfo_var; extern const uint32_t RectMask2D_RemoveClippable_m2506427137_MetadataUsageId; extern "C" void RectMask2D_RemoveClippable_m2506427137 (RectMask2D_t3357079374 * __this, Il2CppObject * ___clippable0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (RectMask2D_RemoveClippable_m2506427137_MetadataUsageId); s_Il2CppMethodIntialized = true; } Rect_t4241904616 V_0; memset(&V_0, 0, sizeof(V_0)); { Il2CppObject * L_0 = ___clippable0; if (L_0) { goto IL_0007; } } { return; } IL_0007: { Il2CppObject * L_1 = ___clippable0; Initobj (Rect_t4241904616_il2cpp_TypeInfo_var, (&V_0)); Rect_t4241904616 L_2 = V_0; NullCheck(L_1); InterfaceActionInvoker2< Rect_t4241904616 , bool >::Invoke(3 /* System.Void UnityEngine.UI.IClippable::SetClipRect(UnityEngine.Rect,System.Boolean) */, IClippable_t502791197_il2cpp_TypeInfo_var, L_1, L_2, (bool)0); List_1_t1870976749 * L_3 = __this->get_m_ClipTargets_4(); Il2CppObject * L_4 = ___clippable0; NullCheck(L_3); List_1_Remove_m372918007(L_3, L_4, /*hidden argument*/List_1_Remove_m372918007_MethodInfo_var); __this->set_m_ForceClip_9((bool)1); return; } } // System.Void UnityEngine.UI.RectMask2D::OnTransformParentChanged() extern "C" void RectMask2D_OnTransformParentChanged_m136007544 (RectMask2D_t3357079374 * __this, const MethodInfo* method) { { UIBehaviour_OnTransformParentChanged_m1017023781(__this, /*hidden argument*/NULL); __this->set_m_ShouldRecalculateClipRects_5((bool)1); return; } } // System.Void UnityEngine.UI.RectMask2D::OnCanvasHierarchyChanged() extern "C" void RectMask2D_OnCanvasHierarchyChanged_m329275089 (RectMask2D_t3357079374 * __this, const MethodInfo* method) { { UIBehaviour_OnCanvasHierarchyChanged_m1210291326(__this, /*hidden argument*/NULL); __this->set_m_ShouldRecalculateClipRects_5((bool)1); return; } } // System.Void UnityEngine.UI.Scrollbar::.ctor() extern Il2CppClass* ScrollEvent_t3541123425_il2cpp_TypeInfo_var; extern Il2CppClass* Selectable_t1885181538_il2cpp_TypeInfo_var; extern const uint32_t Scrollbar__ctor_m842961365_MetadataUsageId; extern "C" void Scrollbar__ctor_m842961365 (Scrollbar_t2601556940 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Scrollbar__ctor_m842961365_MetadataUsageId); s_Il2CppMethodIntialized = true; } { __this->set_m_Size_19((0.2f)); ScrollEvent_t3541123425 * L_0 = (ScrollEvent_t3541123425 *)il2cpp_codegen_object_new(ScrollEvent_t3541123425_il2cpp_TypeInfo_var); ScrollEvent__ctor_m2724827255(L_0, /*hidden argument*/NULL); __this->set_m_OnValueChanged_21(L_0); Vector2_t4282066565 L_1 = Vector2_get_zero_m199872368(NULL /*static, unused*/, /*hidden argument*/NULL); __this->set_m_Offset_23(L_1); IL2CPP_RUNTIME_CLASS_INIT(Selectable_t1885181538_il2cpp_TypeInfo_var); Selectable__ctor_m1133588277(__this, /*hidden argument*/NULL); return; } } // UnityEngine.RectTransform UnityEngine.UI.Scrollbar::get_handleRect() extern "C" RectTransform_t972643934 * Scrollbar_get_handleRect_m2010533702 (Scrollbar_t2601556940 * __this, const MethodInfo* method) { { RectTransform_t972643934 * L_0 = __this->get_m_HandleRect_16(); return L_0; } } // System.Void UnityEngine.UI.Scrollbar::set_handleRect(UnityEngine.RectTransform) extern const MethodInfo* SetPropertyUtility_SetClass_TisRectTransform_t972643934_m3898551323_MethodInfo_var; extern const uint32_t Scrollbar_set_handleRect_m2375555625_MetadataUsageId; extern "C" void Scrollbar_set_handleRect_m2375555625 (Scrollbar_t2601556940 * __this, RectTransform_t972643934 * ___value0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Scrollbar_set_handleRect_m2375555625_MetadataUsageId); s_Il2CppMethodIntialized = true; } { RectTransform_t972643934 ** L_0 = __this->get_address_of_m_HandleRect_16(); RectTransform_t972643934 * L_1 = ___value0; bool L_2 = SetPropertyUtility_SetClass_TisRectTransform_t972643934_m3898551323(NULL /*static, unused*/, L_0, L_1, /*hidden argument*/SetPropertyUtility_SetClass_TisRectTransform_t972643934_m3898551323_MethodInfo_var); if (!L_2) { goto IL_001d; } } { Scrollbar_UpdateCachedReferences_m1478280386(__this, /*hidden argument*/NULL); Scrollbar_UpdateVisuals_m2753592989(__this, /*hidden argument*/NULL); } IL_001d: { return; } } // UnityEngine.UI.Scrollbar/Direction UnityEngine.UI.Scrollbar::get_direction() extern "C" int32_t Scrollbar_get_direction_m2158550533 (Scrollbar_t2601556940 * __this, const MethodInfo* method) { { int32_t L_0 = __this->get_m_Direction_17(); return L_0; } } // System.Void UnityEngine.UI.Scrollbar::set_direction(UnityEngine.UI.Scrollbar/Direction) extern const MethodInfo* SetPropertyUtility_SetStruct_TisDirection_t522766867_m1391770542_MethodInfo_var; extern const uint32_t Scrollbar_set_direction_m1167543746_MetadataUsageId; extern "C" void Scrollbar_set_direction_m1167543746 (Scrollbar_t2601556940 * __this, int32_t ___value0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Scrollbar_set_direction_m1167543746_MetadataUsageId); s_Il2CppMethodIntialized = true; } { int32_t* L_0 = __this->get_address_of_m_Direction_17(); int32_t L_1 = ___value0; bool L_2 = SetPropertyUtility_SetStruct_TisDirection_t522766867_m1391770542(NULL /*static, unused*/, L_0, L_1, /*hidden argument*/SetPropertyUtility_SetStruct_TisDirection_t522766867_m1391770542_MethodInfo_var); if (!L_2) { goto IL_0017; } } { Scrollbar_UpdateVisuals_m2753592989(__this, /*hidden argument*/NULL); } IL_0017: { return; } } // System.Single UnityEngine.UI.Scrollbar::get_value() extern Il2CppClass* Mathf_t4203372500_il2cpp_TypeInfo_var; extern const uint32_t Scrollbar_get_value_m3398262479_MetadataUsageId; extern "C" float Scrollbar_get_value_m3398262479 (Scrollbar_t2601556940 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Scrollbar_get_value_m3398262479_MetadataUsageId); s_Il2CppMethodIntialized = true; } float V_0 = 0.0f; { float L_0 = __this->get_m_Value_18(); V_0 = L_0; int32_t L_1 = __this->get_m_NumberOfSteps_20(); if ((((int32_t)L_1) <= ((int32_t)1))) { goto IL_002e; } } { float L_2 = V_0; int32_t L_3 = __this->get_m_NumberOfSteps_20(); IL2CPP_RUNTIME_CLASS_INIT(Mathf_t4203372500_il2cpp_TypeInfo_var); float L_4 = bankers_roundf(((float)((float)L_2*(float)(((float)((float)((int32_t)((int32_t)L_3-(int32_t)1)))))))); int32_t L_5 = __this->get_m_NumberOfSteps_20(); V_0 = ((float)((float)L_4/(float)(((float)((float)((int32_t)((int32_t)L_5-(int32_t)1))))))); } IL_002e: { float L_6 = V_0; return L_6; } } // System.Void UnityEngine.UI.Scrollbar::set_value(System.Single) extern "C" void Scrollbar_set_value_m1765490852 (Scrollbar_t2601556940 * __this, float ___value0, const MethodInfo* method) { { float L_0 = ___value0; Scrollbar_Set_m2588040310(__this, L_0, /*hidden argument*/NULL); return; } } // System.Single UnityEngine.UI.Scrollbar::get_size() extern "C" float Scrollbar_get_size_m1139900549 (Scrollbar_t2601556940 * __this, const MethodInfo* method) { { float L_0 = __this->get_m_Size_19(); return L_0; } } // System.Void UnityEngine.UI.Scrollbar::set_size(System.Single) extern Il2CppClass* Mathf_t4203372500_il2cpp_TypeInfo_var; extern const MethodInfo* SetPropertyUtility_SetStruct_TisSingle_t4291918972_m1643007650_MethodInfo_var; extern const uint32_t Scrollbar_set_size_m298852062_MetadataUsageId; extern "C" void Scrollbar_set_size_m298852062 (Scrollbar_t2601556940 * __this, float ___value0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Scrollbar_set_size_m298852062_MetadataUsageId); s_Il2CppMethodIntialized = true; } { float* L_0 = __this->get_address_of_m_Size_19(); float L_1 = ___value0; IL2CPP_RUNTIME_CLASS_INIT(Mathf_t4203372500_il2cpp_TypeInfo_var); float L_2 = Mathf_Clamp01_m2272733930(NULL /*static, unused*/, L_1, /*hidden argument*/NULL); bool L_3 = SetPropertyUtility_SetStruct_TisSingle_t4291918972_m1643007650(NULL /*static, unused*/, L_0, L_2, /*hidden argument*/SetPropertyUtility_SetStruct_TisSingle_t4291918972_m1643007650_MethodInfo_var); if (!L_3) { goto IL_001c; } } { Scrollbar_UpdateVisuals_m2753592989(__this, /*hidden argument*/NULL); } IL_001c: { return; } } // System.Int32 UnityEngine.UI.Scrollbar::get_numberOfSteps() extern "C" int32_t Scrollbar_get_numberOfSteps_m1873821577 (Scrollbar_t2601556940 * __this, const MethodInfo* method) { { int32_t L_0 = __this->get_m_NumberOfSteps_20(); return L_0; } } // System.Void UnityEngine.UI.Scrollbar::set_numberOfSteps(System.Int32) extern const MethodInfo* SetPropertyUtility_SetStruct_TisInt32_t1153838500_m3219417906_MethodInfo_var; extern const uint32_t Scrollbar_set_numberOfSteps_m2505501262_MetadataUsageId; extern "C" void Scrollbar_set_numberOfSteps_m2505501262 (Scrollbar_t2601556940 * __this, int32_t ___value0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Scrollbar_set_numberOfSteps_m2505501262_MetadataUsageId); s_Il2CppMethodIntialized = true; } { int32_t* L_0 = __this->get_address_of_m_NumberOfSteps_20(); int32_t L_1 = ___value0; bool L_2 = SetPropertyUtility_SetStruct_TisInt32_t1153838500_m3219417906(NULL /*static, unused*/, L_0, L_1, /*hidden argument*/SetPropertyUtility_SetStruct_TisInt32_t1153838500_m3219417906_MethodInfo_var); if (!L_2) { goto IL_0023; } } { float L_3 = __this->get_m_Value_18(); Scrollbar_Set_m2588040310(__this, L_3, /*hidden argument*/NULL); Scrollbar_UpdateVisuals_m2753592989(__this, /*hidden argument*/NULL); } IL_0023: { return; } } // UnityEngine.UI.Scrollbar/ScrollEvent UnityEngine.UI.Scrollbar::get_onValueChanged() extern "C" ScrollEvent_t3541123425 * Scrollbar_get_onValueChanged_m312588368 (Scrollbar_t2601556940 * __this, const MethodInfo* method) { { ScrollEvent_t3541123425 * L_0 = __this->get_m_OnValueChanged_21(); return L_0; } } // System.Void UnityEngine.UI.Scrollbar::set_onValueChanged(UnityEngine.UI.Scrollbar/ScrollEvent) extern "C" void Scrollbar_set_onValueChanged_m2941912493 (Scrollbar_t2601556940 * __this, ScrollEvent_t3541123425 * ___value0, const MethodInfo* method) { { ScrollEvent_t3541123425 * L_0 = ___value0; __this->set_m_OnValueChanged_21(L_0); return; } } // System.Single UnityEngine.UI.Scrollbar::get_stepSize() extern "C" float Scrollbar_get_stepSize_m1660915953 (Scrollbar_t2601556940 * __this, const MethodInfo* method) { float G_B3_0 = 0.0f; { int32_t L_0 = __this->get_m_NumberOfSteps_20(); if ((((int32_t)L_0) <= ((int32_t)1))) { goto IL_0020; } } { int32_t L_1 = __this->get_m_NumberOfSteps_20(); G_B3_0 = ((float)((float)(1.0f)/(float)(((float)((float)((int32_t)((int32_t)L_1-(int32_t)1))))))); goto IL_0025; } IL_0020: { G_B3_0 = (0.1f); } IL_0025: { return G_B3_0; } } // System.Void UnityEngine.UI.Scrollbar::Rebuild(UnityEngine.UI.CanvasUpdate) extern "C" void Scrollbar_Rebuild_m36029024 (Scrollbar_t2601556940 * __this, int32_t ___executing0, const MethodInfo* method) { { return; } } // System.Void UnityEngine.UI.Scrollbar::LayoutComplete() extern "C" void Scrollbar_LayoutComplete_m4096546066 (Scrollbar_t2601556940 * __this, const MethodInfo* method) { { return; } } // System.Void UnityEngine.UI.Scrollbar::GraphicUpdateComplete() extern "C" void Scrollbar_GraphicUpdateComplete_m3945082525 (Scrollbar_t2601556940 * __this, const MethodInfo* method) { { return; } } // System.Void UnityEngine.UI.Scrollbar::OnEnable() extern "C" void Scrollbar_OnEnable_m2059823505 (Scrollbar_t2601556940 * __this, const MethodInfo* method) { { Selectable_OnEnable_m1472090161(__this, /*hidden argument*/NULL); Scrollbar_UpdateCachedReferences_m1478280386(__this, /*hidden argument*/NULL); float L_0 = __this->get_m_Value_18(); Scrollbar_Set_m3384196167(__this, L_0, (bool)0, /*hidden argument*/NULL); Scrollbar_UpdateVisuals_m2753592989(__this, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.UI.Scrollbar::OnDisable() extern "C" void Scrollbar_OnDisable_m4165923772 (Scrollbar_t2601556940 * __this, const MethodInfo* method) { { DrivenRectTransformTracker_t4185719096 * L_0 = __this->get_address_of_m_Tracker_24(); DrivenRectTransformTracker_Clear_m309315364(L_0, /*hidden argument*/NULL); Selectable_OnDisable_m3126059292(__this, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.UI.Scrollbar::UpdateCachedReferences() extern const MethodInfo* Component_GetComponent_TisRectTransform_t972643934_m1940403147_MethodInfo_var; extern const uint32_t Scrollbar_UpdateCachedReferences_m1478280386_MetadataUsageId; extern "C" void Scrollbar_UpdateCachedReferences_m1478280386 (Scrollbar_t2601556940 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Scrollbar_UpdateCachedReferences_m1478280386_MetadataUsageId); s_Il2CppMethodIntialized = true; } { RectTransform_t972643934 * L_0 = __this->get_m_HandleRect_16(); bool L_1 = Object_op_Implicit_m2106766291(NULL /*static, unused*/, L_0, /*hidden argument*/NULL); if (!L_1) { goto IL_0041; } } { RectTransform_t972643934 * L_2 = __this->get_m_HandleRect_16(); NullCheck(L_2); Transform_t1659122786 * L_3 = Transform_get_parent_m2236876972(L_2, /*hidden argument*/NULL); bool L_4 = Object_op_Inequality_m1296218211(NULL /*static, unused*/, L_3, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_4) { goto IL_0041; } } { RectTransform_t972643934 * L_5 = __this->get_m_HandleRect_16(); NullCheck(L_5); Transform_t1659122786 * L_6 = Transform_get_parent_m2236876972(L_5, /*hidden argument*/NULL); NullCheck(L_6); RectTransform_t972643934 * L_7 = Component_GetComponent_TisRectTransform_t972643934_m1940403147(L_6, /*hidden argument*/Component_GetComponent_TisRectTransform_t972643934_m1940403147_MethodInfo_var); __this->set_m_ContainerRect_22(L_7); goto IL_0048; } IL_0041: { __this->set_m_ContainerRect_22((RectTransform_t972643934 *)NULL); } IL_0048: { return; } } // System.Void UnityEngine.UI.Scrollbar::Set(System.Single) extern "C" void Scrollbar_Set_m2588040310 (Scrollbar_t2601556940 * __this, float ___input0, const MethodInfo* method) { { float L_0 = ___input0; Scrollbar_Set_m3384196167(__this, L_0, (bool)1, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.UI.Scrollbar::Set(System.Single,System.Boolean) extern Il2CppClass* Mathf_t4203372500_il2cpp_TypeInfo_var; extern const MethodInfo* UnityEvent_1_Invoke_m3551800820_MethodInfo_var; extern const uint32_t Scrollbar_Set_m3384196167_MetadataUsageId; extern "C" void Scrollbar_Set_m3384196167 (Scrollbar_t2601556940 * __this, float ___input0, bool ___sendCallback1, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Scrollbar_Set_m3384196167_MetadataUsageId); s_Il2CppMethodIntialized = true; } float V_0 = 0.0f; { float L_0 = __this->get_m_Value_18(); V_0 = L_0; float L_1 = ___input0; IL2CPP_RUNTIME_CLASS_INIT(Mathf_t4203372500_il2cpp_TypeInfo_var); float L_2 = Mathf_Clamp01_m2272733930(NULL /*static, unused*/, L_1, /*hidden argument*/NULL); __this->set_m_Value_18(L_2); float L_3 = V_0; float L_4 = Scrollbar_get_value_m3398262479(__this, /*hidden argument*/NULL); if ((!(((float)L_3) == ((float)L_4)))) { goto IL_0020; } } { return; } IL_0020: { Scrollbar_UpdateVisuals_m2753592989(__this, /*hidden argument*/NULL); bool L_5 = ___sendCallback1; if (!L_5) { goto IL_003d; } } { ScrollEvent_t3541123425 * L_6 = __this->get_m_OnValueChanged_21(); float L_7 = Scrollbar_get_value_m3398262479(__this, /*hidden argument*/NULL); NullCheck(L_6); UnityEvent_1_Invoke_m3551800820(L_6, L_7, /*hidden argument*/UnityEvent_1_Invoke_m3551800820_MethodInfo_var); } IL_003d: { return; } } // System.Void UnityEngine.UI.Scrollbar::OnRectTransformDimensionsChange() extern "C" void Scrollbar_OnRectTransformDimensionsChange_m1089670457 (Scrollbar_t2601556940 * __this, const MethodInfo* method) { { UIBehaviour_OnRectTransformDimensionsChange_m406568928(__this, /*hidden argument*/NULL); bool L_0 = VirtFuncInvoker0< bool >::Invoke(9 /* System.Boolean UnityEngine.EventSystems.UIBehaviour::IsActive() */, __this); if (L_0) { goto IL_0012; } } { return; } IL_0012: { Scrollbar_UpdateVisuals_m2753592989(__this, /*hidden argument*/NULL); return; } } // UnityEngine.UI.Scrollbar/Axis UnityEngine.UI.Scrollbar::get_axis() extern "C" int32_t Scrollbar_get_axis_m3425831999 (Scrollbar_t2601556940 * __this, const MethodInfo* method) { int32_t G_B4_0 = 0; { int32_t L_0 = __this->get_m_Direction_17(); if (!L_0) { goto IL_0017; } } { int32_t L_1 = __this->get_m_Direction_17(); if ((!(((uint32_t)L_1) == ((uint32_t)1)))) { goto IL_001d; } } IL_0017: { G_B4_0 = 0; goto IL_001e; } IL_001d: { G_B4_0 = 1; } IL_001e: { return (int32_t)(G_B4_0); } } // System.Boolean UnityEngine.UI.Scrollbar::get_reverseValue() extern "C" bool Scrollbar_get_reverseValue_m581327093 (Scrollbar_t2601556940 * __this, const MethodInfo* method) { int32_t G_B3_0 = 0; { int32_t L_0 = __this->get_m_Direction_17(); if ((((int32_t)L_0) == ((int32_t)1))) { goto IL_0017; } } { int32_t L_1 = __this->get_m_Direction_17(); G_B3_0 = ((((int32_t)L_1) == ((int32_t)3))? 1 : 0); goto IL_0018; } IL_0017: { G_B3_0 = 1; } IL_0018: { return (bool)G_B3_0; } } // System.Void UnityEngine.UI.Scrollbar::UpdateVisuals() extern "C" void Scrollbar_UpdateVisuals_m2753592989 (Scrollbar_t2601556940 * __this, const MethodInfo* method) { Vector2_t4282066565 V_0; memset(&V_0, 0, sizeof(V_0)); Vector2_t4282066565 V_1; memset(&V_1, 0, sizeof(V_1)); float V_2 = 0.0f; { DrivenRectTransformTracker_t4185719096 * L_0 = __this->get_address_of_m_Tracker_24(); DrivenRectTransformTracker_Clear_m309315364(L_0, /*hidden argument*/NULL); RectTransform_t972643934 * L_1 = __this->get_m_ContainerRect_22(); bool L_2 = Object_op_Inequality_m1296218211(NULL /*static, unused*/, L_1, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_2) { goto IL_00cd; } } { DrivenRectTransformTracker_t4185719096 * L_3 = __this->get_address_of_m_Tracker_24(); RectTransform_t972643934 * L_4 = __this->get_m_HandleRect_16(); DrivenRectTransformTracker_Add_m3461523141(L_3, __this, L_4, ((int32_t)3840), /*hidden argument*/NULL); Vector2_t4282066565 L_5 = Vector2_get_zero_m199872368(NULL /*static, unused*/, /*hidden argument*/NULL); V_0 = L_5; Vector2_t4282066565 L_6 = Vector2_get_one_m2767488832(NULL /*static, unused*/, /*hidden argument*/NULL); V_1 = L_6; float L_7 = Scrollbar_get_value_m3398262479(__this, /*hidden argument*/NULL); float L_8 = Scrollbar_get_size_m1139900549(__this, /*hidden argument*/NULL); V_2 = ((float)((float)L_7*(float)((float)((float)(1.0f)-(float)L_8)))); bool L_9 = Scrollbar_get_reverseValue_m581327093(__this, /*hidden argument*/NULL); if (!L_9) { goto IL_0092; } } { int32_t L_10 = Scrollbar_get_axis_m3425831999(__this, /*hidden argument*/NULL); float L_11 = V_2; float L_12 = Scrollbar_get_size_m1139900549(__this, /*hidden argument*/NULL); Vector2_set_Item_m2767519328((&V_0), L_10, ((float)((float)((float)((float)(1.0f)-(float)L_11))-(float)L_12)), /*hidden argument*/NULL); int32_t L_13 = Scrollbar_get_axis_m3425831999(__this, /*hidden argument*/NULL); float L_14 = V_2; Vector2_set_Item_m2767519328((&V_1), L_13, ((float)((float)(1.0f)-(float)L_14)), /*hidden argument*/NULL); goto IL_00b5; } IL_0092: { int32_t L_15 = Scrollbar_get_axis_m3425831999(__this, /*hidden argument*/NULL); float L_16 = V_2; Vector2_set_Item_m2767519328((&V_0), L_15, L_16, /*hidden argument*/NULL); int32_t L_17 = Scrollbar_get_axis_m3425831999(__this, /*hidden argument*/NULL); float L_18 = V_2; float L_19 = Scrollbar_get_size_m1139900549(__this, /*hidden argument*/NULL); Vector2_set_Item_m2767519328((&V_1), L_17, ((float)((float)L_18+(float)L_19)), /*hidden argument*/NULL); } IL_00b5: { RectTransform_t972643934 * L_20 = __this->get_m_HandleRect_16(); Vector2_t4282066565 L_21 = V_0; NullCheck(L_20); RectTransform_set_anchorMin_m989253483(L_20, L_21, /*hidden argument*/NULL); RectTransform_t972643934 * L_22 = __this->get_m_HandleRect_16(); Vector2_t4282066565 L_23 = V_1; NullCheck(L_22); RectTransform_set_anchorMax_m715345817(L_22, L_23, /*hidden argument*/NULL); } IL_00cd: { return; } } // System.Void UnityEngine.UI.Scrollbar::UpdateDrag(UnityEngine.EventSystems.PointerEventData) extern Il2CppClass* RectTransformUtility_t3025555048_il2cpp_TypeInfo_var; extern const uint32_t Scrollbar_UpdateDrag_m494154322_MetadataUsageId; extern "C" void Scrollbar_UpdateDrag_m494154322 (Scrollbar_t2601556940 * __this, PointerEventData_t1848751023 * ___eventData0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Scrollbar_UpdateDrag_m494154322_MetadataUsageId); s_Il2CppMethodIntialized = true; } Vector2_t4282066565 V_0; memset(&V_0, 0, sizeof(V_0)); Vector2_t4282066565 V_1; memset(&V_1, 0, sizeof(V_1)); Vector2_t4282066565 V_2; memset(&V_2, 0, sizeof(V_2)); float V_3 = 0.0f; float V_4 = 0.0f; Rect_t4241904616 V_5; memset(&V_5, 0, sizeof(V_5)); Rect_t4241904616 V_6; memset(&V_6, 0, sizeof(V_6)); Rect_t4241904616 V_7; memset(&V_7, 0, sizeof(V_7)); Rect_t4241904616 V_8; memset(&V_8, 0, sizeof(V_8)); int32_t V_9 = 0; float G_B9_0 = 0.0f; { PointerEventData_t1848751023 * L_0 = ___eventData0; NullCheck(L_0); int32_t L_1 = PointerEventData_get_button_m796143251(L_0, /*hidden argument*/NULL); if (!L_1) { goto IL_000c; } } { return; } IL_000c: { RectTransform_t972643934 * L_2 = __this->get_m_ContainerRect_22(); bool L_3 = Object_op_Equality_m3964590952(NULL /*static, unused*/, L_2, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_3) { goto IL_001e; } } { return; } IL_001e: { RectTransform_t972643934 * L_4 = __this->get_m_ContainerRect_22(); PointerEventData_t1848751023 * L_5 = ___eventData0; NullCheck(L_5); Vector2_t4282066565 L_6 = PointerEventData_get_position_m2263123361(L_5, /*hidden argument*/NULL); PointerEventData_t1848751023 * L_7 = ___eventData0; NullCheck(L_7); Camera_t2727095145 * L_8 = PointerEventData_get_pressEventCamera_m2764092724(L_7, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(RectTransformUtility_t3025555048_il2cpp_TypeInfo_var); bool L_9 = RectTransformUtility_ScreenPointToLocalPointInRectangle_m666650172(NULL /*static, unused*/, L_4, L_6, L_8, (&V_0), /*hidden argument*/NULL); if (L_9) { goto IL_003d; } } { return; } IL_003d: { Vector2_t4282066565 L_10 = V_0; Vector2_t4282066565 L_11 = __this->get_m_Offset_23(); Vector2_t4282066565 L_12 = Vector2_op_Subtraction_m2097149401(NULL /*static, unused*/, L_10, L_11, /*hidden argument*/NULL); RectTransform_t972643934 * L_13 = __this->get_m_ContainerRect_22(); NullCheck(L_13); Rect_t4241904616 L_14 = RectTransform_get_rect_m1566017036(L_13, /*hidden argument*/NULL); V_5 = L_14; Vector2_t4282066565 L_15 = Rect_get_position_m2933356232((&V_5), /*hidden argument*/NULL); Vector2_t4282066565 L_16 = Vector2_op_Subtraction_m2097149401(NULL /*static, unused*/, L_12, L_15, /*hidden argument*/NULL); V_1 = L_16; Vector2_t4282066565 L_17 = V_1; RectTransform_t972643934 * L_18 = __this->get_m_HandleRect_16(); NullCheck(L_18); Rect_t4241904616 L_19 = RectTransform_get_rect_m1566017036(L_18, /*hidden argument*/NULL); V_6 = L_19; Vector2_t4282066565 L_20 = Rect_get_size_m136480416((&V_6), /*hidden argument*/NULL); RectTransform_t972643934 * L_21 = __this->get_m_HandleRect_16(); NullCheck(L_21); Vector2_t4282066565 L_22 = RectTransform_get_sizeDelta_m4279424984(L_21, /*hidden argument*/NULL); Vector2_t4282066565 L_23 = Vector2_op_Subtraction_m2097149401(NULL /*static, unused*/, L_20, L_22, /*hidden argument*/NULL); Vector2_t4282066565 L_24 = Vector2_op_Multiply_m1738245082(NULL /*static, unused*/, L_23, (0.5f), /*hidden argument*/NULL); Vector2_t4282066565 L_25 = Vector2_op_Subtraction_m2097149401(NULL /*static, unused*/, L_17, L_24, /*hidden argument*/NULL); V_2 = L_25; int32_t L_26 = Scrollbar_get_axis_m3425831999(__this, /*hidden argument*/NULL); if (L_26) { goto IL_00bc; } } { RectTransform_t972643934 * L_27 = __this->get_m_ContainerRect_22(); NullCheck(L_27); Rect_t4241904616 L_28 = RectTransform_get_rect_m1566017036(L_27, /*hidden argument*/NULL); V_7 = L_28; float L_29 = Rect_get_width_m2824209432((&V_7), /*hidden argument*/NULL); G_B9_0 = L_29; goto IL_00d0; } IL_00bc: { RectTransform_t972643934 * L_30 = __this->get_m_ContainerRect_22(); NullCheck(L_30); Rect_t4241904616 L_31 = RectTransform_get_rect_m1566017036(L_30, /*hidden argument*/NULL); V_8 = L_31; float L_32 = Rect_get_height_m2154960823((&V_8), /*hidden argument*/NULL); G_B9_0 = L_32; } IL_00d0: { V_3 = G_B9_0; float L_33 = V_3; float L_34 = Scrollbar_get_size_m1139900549(__this, /*hidden argument*/NULL); V_4 = ((float)((float)L_33*(float)((float)((float)(1.0f)-(float)L_34)))); float L_35 = V_4; if ((!(((float)L_35) <= ((float)(0.0f))))) { goto IL_00ee; } } { return; } IL_00ee: { int32_t L_36 = __this->get_m_Direction_17(); V_9 = L_36; int32_t L_37 = V_9; if (L_37 == 0) { goto IL_0112; } if (L_37 == 1) { goto IL_0127; } if (L_37 == 2) { goto IL_0142; } if (L_37 == 3) { goto IL_0157; } } { goto IL_0172; } IL_0112: { float L_38 = (&V_2)->get_x_1(); float L_39 = V_4; Scrollbar_Set_m2588040310(__this, ((float)((float)L_38/(float)L_39)), /*hidden argument*/NULL); goto IL_0172; } IL_0127: { float L_40 = (&V_2)->get_x_1(); float L_41 = V_4; Scrollbar_Set_m2588040310(__this, ((float)((float)(1.0f)-(float)((float)((float)L_40/(float)L_41)))), /*hidden argument*/NULL); goto IL_0172; } IL_0142: { float L_42 = (&V_2)->get_y_2(); float L_43 = V_4; Scrollbar_Set_m2588040310(__this, ((float)((float)L_42/(float)L_43)), /*hidden argument*/NULL); goto IL_0172; } IL_0157: { float L_44 = (&V_2)->get_y_2(); float L_45 = V_4; Scrollbar_Set_m2588040310(__this, ((float)((float)(1.0f)-(float)((float)((float)L_44/(float)L_45)))), /*hidden argument*/NULL); goto IL_0172; } IL_0172: { return; } } // System.Boolean UnityEngine.UI.Scrollbar::MayDrag(UnityEngine.EventSystems.PointerEventData) extern "C" bool Scrollbar_MayDrag_m2868972512 (Scrollbar_t2601556940 * __this, PointerEventData_t1848751023 * ___eventData0, const MethodInfo* method) { int32_t G_B4_0 = 0; { bool L_0 = VirtFuncInvoker0< bool >::Invoke(9 /* System.Boolean UnityEngine.EventSystems.UIBehaviour::IsActive() */, __this); if (!L_0) { goto IL_0021; } } { bool L_1 = VirtFuncInvoker0< bool >::Invoke(23 /* System.Boolean UnityEngine.UI.Selectable::IsInteractable() */, __this); if (!L_1) { goto IL_0021; } } { PointerEventData_t1848751023 * L_2 = ___eventData0; NullCheck(L_2); int32_t L_3 = PointerEventData_get_button_m796143251(L_2, /*hidden argument*/NULL); G_B4_0 = ((((int32_t)L_3) == ((int32_t)0))? 1 : 0); goto IL_0022; } IL_0021: { G_B4_0 = 0; } IL_0022: { return (bool)G_B4_0; } } // System.Void UnityEngine.UI.Scrollbar::OnBeginDrag(UnityEngine.EventSystems.PointerEventData) extern Il2CppClass* RectTransformUtility_t3025555048_il2cpp_TypeInfo_var; extern const uint32_t Scrollbar_OnBeginDrag_m1703358541_MetadataUsageId; extern "C" void Scrollbar_OnBeginDrag_m1703358541 (Scrollbar_t2601556940 * __this, PointerEventData_t1848751023 * ___eventData0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Scrollbar_OnBeginDrag_m1703358541_MetadataUsageId); s_Il2CppMethodIntialized = true; } Vector2_t4282066565 V_0; memset(&V_0, 0, sizeof(V_0)); Rect_t4241904616 V_1; memset(&V_1, 0, sizeof(V_1)); { __this->set_isPointerDownAndNotDragging_26((bool)0); PointerEventData_t1848751023 * L_0 = ___eventData0; bool L_1 = Scrollbar_MayDrag_m2868972512(__this, L_0, /*hidden argument*/NULL); if (L_1) { goto IL_0014; } } { return; } IL_0014: { RectTransform_t972643934 * L_2 = __this->get_m_ContainerRect_22(); bool L_3 = Object_op_Equality_m3964590952(NULL /*static, unused*/, L_2, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_3) { goto IL_0026; } } { return; } IL_0026: { Vector2_t4282066565 L_4 = Vector2_get_zero_m199872368(NULL /*static, unused*/, /*hidden argument*/NULL); __this->set_m_Offset_23(L_4); RectTransform_t972643934 * L_5 = __this->get_m_HandleRect_16(); PointerEventData_t1848751023 * L_6 = ___eventData0; NullCheck(L_6); Vector2_t4282066565 L_7 = PointerEventData_get_position_m2263123361(L_6, /*hidden argument*/NULL); PointerEventData_t1848751023 * L_8 = ___eventData0; NullCheck(L_8); Camera_t2727095145 * L_9 = PointerEventData_get_enterEventCamera_m1535306943(L_8, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(RectTransformUtility_t3025555048_il2cpp_TypeInfo_var); bool L_10 = RectTransformUtility_RectangleContainsScreenPoint_m1460676684(NULL /*static, unused*/, L_5, L_7, L_9, /*hidden argument*/NULL); if (!L_10) { goto IL_008a; } } { RectTransform_t972643934 * L_11 = __this->get_m_HandleRect_16(); PointerEventData_t1848751023 * L_12 = ___eventData0; NullCheck(L_12); Vector2_t4282066565 L_13 = PointerEventData_get_position_m2263123361(L_12, /*hidden argument*/NULL); PointerEventData_t1848751023 * L_14 = ___eventData0; NullCheck(L_14); Camera_t2727095145 * L_15 = PointerEventData_get_pressEventCamera_m2764092724(L_14, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(RectTransformUtility_t3025555048_il2cpp_TypeInfo_var); bool L_16 = RectTransformUtility_ScreenPointToLocalPointInRectangle_m666650172(NULL /*static, unused*/, L_11, L_13, L_15, (&V_0), /*hidden argument*/NULL); if (!L_16) { goto IL_008a; } } { Vector2_t4282066565 L_17 = V_0; RectTransform_t972643934 * L_18 = __this->get_m_HandleRect_16(); NullCheck(L_18); Rect_t4241904616 L_19 = RectTransform_get_rect_m1566017036(L_18, /*hidden argument*/NULL); V_1 = L_19; Vector2_t4282066565 L_20 = Rect_get_center_m610643572((&V_1), /*hidden argument*/NULL); Vector2_t4282066565 L_21 = Vector2_op_Subtraction_m2097149401(NULL /*static, unused*/, L_17, L_20, /*hidden argument*/NULL); __this->set_m_Offset_23(L_21); } IL_008a: { return; } } // System.Void UnityEngine.UI.Scrollbar::OnDrag(UnityEngine.EventSystems.PointerEventData) extern "C" void Scrollbar_OnDrag_m4023431036 (Scrollbar_t2601556940 * __this, PointerEventData_t1848751023 * ___eventData0, const MethodInfo* method) { { PointerEventData_t1848751023 * L_0 = ___eventData0; bool L_1 = Scrollbar_MayDrag_m2868972512(__this, L_0, /*hidden argument*/NULL); if (L_1) { goto IL_000d; } } { return; } IL_000d: { RectTransform_t972643934 * L_2 = __this->get_m_ContainerRect_22(); bool L_3 = Object_op_Inequality_m1296218211(NULL /*static, unused*/, L_2, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_3) { goto IL_0025; } } { PointerEventData_t1848751023 * L_4 = ___eventData0; Scrollbar_UpdateDrag_m494154322(__this, L_4, /*hidden argument*/NULL); } IL_0025: { return; } } // System.Void UnityEngine.UI.Scrollbar::OnPointerDown(UnityEngine.EventSystems.PointerEventData) extern "C" void Scrollbar_OnPointerDown_m984641739 (Scrollbar_t2601556940 * __this, PointerEventData_t1848751023 * ___eventData0, const MethodInfo* method) { { PointerEventData_t1848751023 * L_0 = ___eventData0; bool L_1 = Scrollbar_MayDrag_m2868972512(__this, L_0, /*hidden argument*/NULL); if (L_1) { goto IL_000d; } } { return; } IL_000d: { PointerEventData_t1848751023 * L_2 = ___eventData0; Selectable_OnPointerDown_m706592619(__this, L_2, /*hidden argument*/NULL); __this->set_isPointerDownAndNotDragging_26((bool)1); PointerEventData_t1848751023 * L_3 = ___eventData0; Il2CppObject * L_4 = Scrollbar_ClickRepeat_m1553202218(__this, L_3, /*hidden argument*/NULL); Coroutine_t3621161934 * L_5 = MonoBehaviour_StartCoroutine_m2135303124(__this, L_4, /*hidden argument*/NULL); __this->set_m_PointerDownRepeat_25(L_5); return; } } // System.Collections.IEnumerator UnityEngine.UI.Scrollbar::ClickRepeat(UnityEngine.EventSystems.PointerEventData) extern Il2CppClass* U3CClickRepeatU3Ec__Iterator5_t99988271_il2cpp_TypeInfo_var; extern const uint32_t Scrollbar_ClickRepeat_m1553202218_MetadataUsageId; extern "C" Il2CppObject * Scrollbar_ClickRepeat_m1553202218 (Scrollbar_t2601556940 * __this, PointerEventData_t1848751023 * ___eventData0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Scrollbar_ClickRepeat_m1553202218_MetadataUsageId); s_Il2CppMethodIntialized = true; } U3CClickRepeatU3Ec__Iterator5_t99988271 * V_0 = NULL; { U3CClickRepeatU3Ec__Iterator5_t99988271 * L_0 = (U3CClickRepeatU3Ec__Iterator5_t99988271 *)il2cpp_codegen_object_new(U3CClickRepeatU3Ec__Iterator5_t99988271_il2cpp_TypeInfo_var); U3CClickRepeatU3Ec__Iterator5__ctor_m46482857(L_0, /*hidden argument*/NULL); V_0 = L_0; U3CClickRepeatU3Ec__Iterator5_t99988271 * L_1 = V_0; PointerEventData_t1848751023 * L_2 = ___eventData0; NullCheck(L_1); L_1->set_eventData_0(L_2); U3CClickRepeatU3Ec__Iterator5_t99988271 * L_3 = V_0; PointerEventData_t1848751023 * L_4 = ___eventData0; NullCheck(L_3); L_3->set_U3CU24U3EeventData_5(L_4); U3CClickRepeatU3Ec__Iterator5_t99988271 * L_5 = V_0; NullCheck(L_5); L_5->set_U3CU3Ef__this_6(__this); U3CClickRepeatU3Ec__Iterator5_t99988271 * L_6 = V_0; return L_6; } } // System.Void UnityEngine.UI.Scrollbar::OnPointerUp(UnityEngine.EventSystems.PointerEventData) extern "C" void Scrollbar_OnPointerUp_m2249681202 (Scrollbar_t2601556940 * __this, PointerEventData_t1848751023 * ___eventData0, const MethodInfo* method) { { PointerEventData_t1848751023 * L_0 = ___eventData0; Selectable_OnPointerUp_m533192658(__this, L_0, /*hidden argument*/NULL); __this->set_isPointerDownAndNotDragging_26((bool)0); return; } } // System.Void UnityEngine.UI.Scrollbar::OnMove(UnityEngine.EventSystems.AxisEventData) extern "C" void Scrollbar_OnMove_m2506066825 (Scrollbar_t2601556940 * __this, AxisEventData_t3355659985 * ___eventData0, const MethodInfo* method) { int32_t V_0 = 0; Scrollbar_t2601556940 * G_B9_0 = NULL; Scrollbar_t2601556940 * G_B8_0 = NULL; float G_B10_0 = 0.0f; Scrollbar_t2601556940 * G_B10_1 = NULL; Scrollbar_t2601556940 * G_B17_0 = NULL; Scrollbar_t2601556940 * G_B16_0 = NULL; float G_B18_0 = 0.0f; Scrollbar_t2601556940 * G_B18_1 = NULL; Scrollbar_t2601556940 * G_B25_0 = NULL; Scrollbar_t2601556940 * G_B24_0 = NULL; float G_B26_0 = 0.0f; Scrollbar_t2601556940 * G_B26_1 = NULL; Scrollbar_t2601556940 * G_B33_0 = NULL; Scrollbar_t2601556940 * G_B32_0 = NULL; float G_B34_0 = 0.0f; Scrollbar_t2601556940 * G_B34_1 = NULL; { bool L_0 = VirtFuncInvoker0< bool >::Invoke(9 /* System.Boolean UnityEngine.EventSystems.UIBehaviour::IsActive() */, __this); if (!L_0) { goto IL_0016; } } { bool L_1 = VirtFuncInvoker0< bool >::Invoke(23 /* System.Boolean UnityEngine.UI.Selectable::IsInteractable() */, __this); if (L_1) { goto IL_001e; } } IL_0016: { AxisEventData_t3355659985 * L_2 = ___eventData0; Selectable_OnMove_m2478875177(__this, L_2, /*hidden argument*/NULL); return; } IL_001e: { AxisEventData_t3355659985 * L_3 = ___eventData0; NullCheck(L_3); int32_t L_4 = AxisEventData_get_moveDir_m2739466109(L_3, /*hidden argument*/NULL); V_0 = L_4; int32_t L_5 = V_0; if (L_5 == 0) { goto IL_0040; } if (L_5 == 1) { goto IL_00fa; } if (L_5 == 2) { goto IL_009d; } if (L_5 == 3) { goto IL_0158; } } { goto IL_01b6; } IL_0040: { int32_t L_6 = Scrollbar_get_axis_m3425831999(__this, /*hidden argument*/NULL); if (L_6) { goto IL_0091; } } { Selectable_t1885181538 * L_7 = VirtFuncInvoker0< Selectable_t1885181538 * >::Invoke(26 /* UnityEngine.UI.Selectable UnityEngine.UI.Scrollbar::FindSelectableOnLeft() */, __this); bool L_8 = Object_op_Equality_m3964590952(NULL /*static, unused*/, L_7, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_8) { goto IL_0091; } } { bool L_9 = Scrollbar_get_reverseValue_m581327093(__this, /*hidden argument*/NULL); G_B8_0 = __this; if (!L_9) { G_B9_0 = __this; goto IL_007a; } } { float L_10 = Scrollbar_get_value_m3398262479(__this, /*hidden argument*/NULL); float L_11 = Scrollbar_get_stepSize_m1660915953(__this, /*hidden argument*/NULL); G_B10_0 = ((float)((float)L_10+(float)L_11)); G_B10_1 = G_B8_0; goto IL_0087; } IL_007a: { float L_12 = Scrollbar_get_value_m3398262479(__this, /*hidden argument*/NULL); float L_13 = Scrollbar_get_stepSize_m1660915953(__this, /*hidden argument*/NULL); G_B10_0 = ((float)((float)L_12-(float)L_13)); G_B10_1 = G_B9_0; } IL_0087: { NullCheck(G_B10_1); Scrollbar_Set_m2588040310(G_B10_1, G_B10_0, /*hidden argument*/NULL); goto IL_0098; } IL_0091: { AxisEventData_t3355659985 * L_14 = ___eventData0; Selectable_OnMove_m2478875177(__this, L_14, /*hidden argument*/NULL); } IL_0098: { goto IL_01b6; } IL_009d: { int32_t L_15 = Scrollbar_get_axis_m3425831999(__this, /*hidden argument*/NULL); if (L_15) { goto IL_00ee; } } { Selectable_t1885181538 * L_16 = VirtFuncInvoker0< Selectable_t1885181538 * >::Invoke(27 /* UnityEngine.UI.Selectable UnityEngine.UI.Scrollbar::FindSelectableOnRight() */, __this); bool L_17 = Object_op_Equality_m3964590952(NULL /*static, unused*/, L_16, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_17) { goto IL_00ee; } } { bool L_18 = Scrollbar_get_reverseValue_m581327093(__this, /*hidden argument*/NULL); G_B16_0 = __this; if (!L_18) { G_B17_0 = __this; goto IL_00d7; } } { float L_19 = Scrollbar_get_value_m3398262479(__this, /*hidden argument*/NULL); float L_20 = Scrollbar_get_stepSize_m1660915953(__this, /*hidden argument*/NULL); G_B18_0 = ((float)((float)L_19-(float)L_20)); G_B18_1 = G_B16_0; goto IL_00e4; } IL_00d7: { float L_21 = Scrollbar_get_value_m3398262479(__this, /*hidden argument*/NULL); float L_22 = Scrollbar_get_stepSize_m1660915953(__this, /*hidden argument*/NULL); G_B18_0 = ((float)((float)L_21+(float)L_22)); G_B18_1 = G_B17_0; } IL_00e4: { NullCheck(G_B18_1); Scrollbar_Set_m2588040310(G_B18_1, G_B18_0, /*hidden argument*/NULL); goto IL_00f5; } IL_00ee: { AxisEventData_t3355659985 * L_23 = ___eventData0; Selectable_OnMove_m2478875177(__this, L_23, /*hidden argument*/NULL); } IL_00f5: { goto IL_01b6; } IL_00fa: { int32_t L_24 = Scrollbar_get_axis_m3425831999(__this, /*hidden argument*/NULL); if ((!(((uint32_t)L_24) == ((uint32_t)1)))) { goto IL_014c; } } { Selectable_t1885181538 * L_25 = VirtFuncInvoker0< Selectable_t1885181538 * >::Invoke(28 /* UnityEngine.UI.Selectable UnityEngine.UI.Scrollbar::FindSelectableOnUp() */, __this); bool L_26 = Object_op_Equality_m3964590952(NULL /*static, unused*/, L_25, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_26) { goto IL_014c; } } { bool L_27 = Scrollbar_get_reverseValue_m581327093(__this, /*hidden argument*/NULL); G_B24_0 = __this; if (!L_27) { G_B25_0 = __this; goto IL_0135; } } { float L_28 = Scrollbar_get_value_m3398262479(__this, /*hidden argument*/NULL); float L_29 = Scrollbar_get_stepSize_m1660915953(__this, /*hidden argument*/NULL); G_B26_0 = ((float)((float)L_28-(float)L_29)); G_B26_1 = G_B24_0; goto IL_0142; } IL_0135: { float L_30 = Scrollbar_get_value_m3398262479(__this, /*hidden argument*/NULL); float L_31 = Scrollbar_get_stepSize_m1660915953(__this, /*hidden argument*/NULL); G_B26_0 = ((float)((float)L_30+(float)L_31)); G_B26_1 = G_B25_0; } IL_0142: { NullCheck(G_B26_1); Scrollbar_Set_m2588040310(G_B26_1, G_B26_0, /*hidden argument*/NULL); goto IL_0153; } IL_014c: { AxisEventData_t3355659985 * L_32 = ___eventData0; Selectable_OnMove_m2478875177(__this, L_32, /*hidden argument*/NULL); } IL_0153: { goto IL_01b6; } IL_0158: { int32_t L_33 = Scrollbar_get_axis_m3425831999(__this, /*hidden argument*/NULL); if ((!(((uint32_t)L_33) == ((uint32_t)1)))) { goto IL_01aa; } } { Selectable_t1885181538 * L_34 = VirtFuncInvoker0< Selectable_t1885181538 * >::Invoke(29 /* UnityEngine.UI.Selectable UnityEngine.UI.Scrollbar::FindSelectableOnDown() */, __this); bool L_35 = Object_op_Equality_m3964590952(NULL /*static, unused*/, L_34, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_35) { goto IL_01aa; } } { bool L_36 = Scrollbar_get_reverseValue_m581327093(__this, /*hidden argument*/NULL); G_B32_0 = __this; if (!L_36) { G_B33_0 = __this; goto IL_0193; } } { float L_37 = Scrollbar_get_value_m3398262479(__this, /*hidden argument*/NULL); float L_38 = Scrollbar_get_stepSize_m1660915953(__this, /*hidden argument*/NULL); G_B34_0 = ((float)((float)L_37+(float)L_38)); G_B34_1 = G_B32_0; goto IL_01a0; } IL_0193: { float L_39 = Scrollbar_get_value_m3398262479(__this, /*hidden argument*/NULL); float L_40 = Scrollbar_get_stepSize_m1660915953(__this, /*hidden argument*/NULL); G_B34_0 = ((float)((float)L_39-(float)L_40)); G_B34_1 = G_B33_0; } IL_01a0: { NullCheck(G_B34_1); Scrollbar_Set_m2588040310(G_B34_1, G_B34_0, /*hidden argument*/NULL); goto IL_01b1; } IL_01aa: { AxisEventData_t3355659985 * L_41 = ___eventData0; Selectable_OnMove_m2478875177(__this, L_41, /*hidden argument*/NULL); } IL_01b1: { goto IL_01b6; } IL_01b6: { return; } } // UnityEngine.UI.Selectable UnityEngine.UI.Scrollbar::FindSelectableOnLeft() extern "C" Selectable_t1885181538 * Scrollbar_FindSelectableOnLeft_m976215998 (Scrollbar_t2601556940 * __this, const MethodInfo* method) { Navigation_t1108456480 V_0; memset(&V_0, 0, sizeof(V_0)); { Navigation_t1108456480 L_0 = Selectable_get_navigation_m3138151376(__this, /*hidden argument*/NULL); V_0 = L_0; int32_t L_1 = Navigation_get_mode_m721480509((&V_0), /*hidden argument*/NULL); if ((!(((uint32_t)L_1) == ((uint32_t)3)))) { goto IL_0021; } } { int32_t L_2 = Scrollbar_get_axis_m3425831999(__this, /*hidden argument*/NULL); if (L_2) { goto IL_0021; } } { return (Selectable_t1885181538 *)NULL; } IL_0021: { Selectable_t1885181538 * L_3 = Selectable_FindSelectableOnLeft_m3101734378(__this, /*hidden argument*/NULL); return L_3; } } // UnityEngine.UI.Selectable UnityEngine.UI.Scrollbar::FindSelectableOnRight() extern "C" Selectable_t1885181538 * Scrollbar_FindSelectableOnRight_m1343135335 (Scrollbar_t2601556940 * __this, const MethodInfo* method) { Navigation_t1108456480 V_0; memset(&V_0, 0, sizeof(V_0)); { Navigation_t1108456480 L_0 = Selectable_get_navigation_m3138151376(__this, /*hidden argument*/NULL); V_0 = L_0; int32_t L_1 = Navigation_get_mode_m721480509((&V_0), /*hidden argument*/NULL); if ((!(((uint32_t)L_1) == ((uint32_t)3)))) { goto IL_0021; } } { int32_t L_2 = Scrollbar_get_axis_m3425831999(__this, /*hidden argument*/NULL); if (L_2) { goto IL_0021; } } { return (Selectable_t1885181538 *)NULL; } IL_0021: { Selectable_t1885181538 * L_3 = Selectable_FindSelectableOnRight_m2809695675(__this, /*hidden argument*/NULL); return L_3; } } // UnityEngine.UI.Selectable UnityEngine.UI.Scrollbar::FindSelectableOnUp() extern "C" Selectable_t1885181538 * Scrollbar_FindSelectableOnUp_m2968886994 (Scrollbar_t2601556940 * __this, const MethodInfo* method) { Navigation_t1108456480 V_0; memset(&V_0, 0, sizeof(V_0)); { Navigation_t1108456480 L_0 = Selectable_get_navigation_m3138151376(__this, /*hidden argument*/NULL); V_0 = L_0; int32_t L_1 = Navigation_get_mode_m721480509((&V_0), /*hidden argument*/NULL); if ((!(((uint32_t)L_1) == ((uint32_t)3)))) { goto IL_0022; } } { int32_t L_2 = Scrollbar_get_axis_m3425831999(__this, /*hidden argument*/NULL); if ((!(((uint32_t)L_2) == ((uint32_t)1)))) { goto IL_0022; } } { return (Selectable_t1885181538 *)NULL; } IL_0022: { Selectable_t1885181538 * L_3 = Selectable_FindSelectableOnUp_m3489533950(__this, /*hidden argument*/NULL); return L_3; } } // UnityEngine.UI.Selectable UnityEngine.UI.Scrollbar::FindSelectableOnDown() extern "C" Selectable_t1885181538 * Scrollbar_FindSelectableOnDown_m756918681 (Scrollbar_t2601556940 * __this, const MethodInfo* method) { Navigation_t1108456480 V_0; memset(&V_0, 0, sizeof(V_0)); { Navigation_t1108456480 L_0 = Selectable_get_navigation_m3138151376(__this, /*hidden argument*/NULL); V_0 = L_0; int32_t L_1 = Navigation_get_mode_m721480509((&V_0), /*hidden argument*/NULL); if ((!(((uint32_t)L_1) == ((uint32_t)3)))) { goto IL_0022; } } { int32_t L_2 = Scrollbar_get_axis_m3425831999(__this, /*hidden argument*/NULL); if ((!(((uint32_t)L_2) == ((uint32_t)1)))) { goto IL_0022; } } { return (Selectable_t1885181538 *)NULL; } IL_0022: { Selectable_t1885181538 * L_3 = Selectable_FindSelectableOnDown_m2882437061(__this, /*hidden argument*/NULL); return L_3; } } // System.Void UnityEngine.UI.Scrollbar::OnInitializePotentialDrag(UnityEngine.EventSystems.PointerEventData) extern "C" void Scrollbar_OnInitializePotentialDrag_m2407430440 (Scrollbar_t2601556940 * __this, PointerEventData_t1848751023 * ___eventData0, const MethodInfo* method) { { PointerEventData_t1848751023 * L_0 = ___eventData0; NullCheck(L_0); PointerEventData_set_useDragThreshold_m2530254510(L_0, (bool)0, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.UI.Scrollbar::SetDirection(UnityEngine.UI.Scrollbar/Direction,System.Boolean) extern Il2CppClass* RectTransform_t972643934_il2cpp_TypeInfo_var; extern Il2CppClass* RectTransformUtility_t3025555048_il2cpp_TypeInfo_var; extern const uint32_t Scrollbar_SetDirection_m826288644_MetadataUsageId; extern "C" void Scrollbar_SetDirection_m826288644 (Scrollbar_t2601556940 * __this, int32_t ___direction0, bool ___includeRectLayouts1, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Scrollbar_SetDirection_m826288644_MetadataUsageId); s_Il2CppMethodIntialized = true; } int32_t V_0 = 0; bool V_1 = false; { int32_t L_0 = Scrollbar_get_axis_m3425831999(__this, /*hidden argument*/NULL); V_0 = L_0; bool L_1 = Scrollbar_get_reverseValue_m581327093(__this, /*hidden argument*/NULL); V_1 = L_1; int32_t L_2 = ___direction0; Scrollbar_set_direction_m1167543746(__this, L_2, /*hidden argument*/NULL); bool L_3 = ___includeRectLayouts1; if (L_3) { goto IL_001c; } } { return; } IL_001c: { int32_t L_4 = Scrollbar_get_axis_m3425831999(__this, /*hidden argument*/NULL); int32_t L_5 = V_0; if ((((int32_t)L_4) == ((int32_t)L_5))) { goto IL_003a; } } { Transform_t1659122786 * L_6 = Component_get_transform_m4257140443(__this, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(RectTransformUtility_t3025555048_il2cpp_TypeInfo_var); RectTransformUtility_FlipLayoutAxes_m2163490602(NULL /*static, unused*/, ((RectTransform_t972643934 *)IsInstSealed(L_6, RectTransform_t972643934_il2cpp_TypeInfo_var)), (bool)1, (bool)1, /*hidden argument*/NULL); } IL_003a: { bool L_7 = Scrollbar_get_reverseValue_m581327093(__this, /*hidden argument*/NULL); bool L_8 = V_1; if ((((int32_t)L_7) == ((int32_t)L_8))) { goto IL_005e; } } { Transform_t1659122786 * L_9 = Component_get_transform_m4257140443(__this, /*hidden argument*/NULL); int32_t L_10 = Scrollbar_get_axis_m3425831999(__this, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(RectTransformUtility_t3025555048_il2cpp_TypeInfo_var); RectTransformUtility_FlipLayoutOnAxis_m3487429352(NULL /*static, unused*/, ((RectTransform_t972643934 *)IsInstSealed(L_9, RectTransform_t972643934_il2cpp_TypeInfo_var)), L_10, (bool)1, (bool)1, /*hidden argument*/NULL); } IL_005e: { return; } } // System.Boolean UnityEngine.UI.Scrollbar::UnityEngine.UI.ICanvasElement.IsDestroyed() extern "C" bool Scrollbar_UnityEngine_UI_ICanvasElement_IsDestroyed_m3229708772 (Scrollbar_t2601556940 * __this, const MethodInfo* method) { { bool L_0 = UIBehaviour_IsDestroyed_m3027499227(__this, /*hidden argument*/NULL); return L_0; } } // UnityEngine.Transform UnityEngine.UI.Scrollbar::UnityEngine.UI.ICanvasElement.get_transform() extern "C" Transform_t1659122786 * Scrollbar_UnityEngine_UI_ICanvasElement_get_transform_m1065549160 (Scrollbar_t2601556940 * __this, const MethodInfo* method) { { Transform_t1659122786 * L_0 = Component_get_transform_m4257140443(__this, /*hidden argument*/NULL); return L_0; } } // System.Void UnityEngine.UI.Scrollbar/<ClickRepeat>c__Iterator5::.ctor() extern "C" void U3CClickRepeatU3Ec__Iterator5__ctor_m46482857 (U3CClickRepeatU3Ec__Iterator5_t99988271 * __this, const MethodInfo* method) { { Object__ctor_m1772956182(__this, /*hidden argument*/NULL); return; } } // System.Object UnityEngine.UI.Scrollbar/<ClickRepeat>c__Iterator5::System.Collections.Generic.IEnumerator<object>.get_Current() extern "C" Il2CppObject * U3CClickRepeatU3Ec__Iterator5_System_Collections_Generic_IEnumeratorU3CobjectU3E_get_Current_m1538503635 (U3CClickRepeatU3Ec__Iterator5_t99988271 * __this, const MethodInfo* method) { { Il2CppObject * L_0 = __this->get_U24current_4(); return L_0; } } // System.Object UnityEngine.UI.Scrollbar/<ClickRepeat>c__Iterator5::System.Collections.IEnumerator.get_Current() extern "C" Il2CppObject * U3CClickRepeatU3Ec__Iterator5_System_Collections_IEnumerator_get_Current_m1635106151 (U3CClickRepeatU3Ec__Iterator5_t99988271 * __this, const MethodInfo* method) { { Il2CppObject * L_0 = __this->get_U24current_4(); return L_0; } } // System.Boolean UnityEngine.UI.Scrollbar/<ClickRepeat>c__Iterator5::MoveNext() extern Il2CppClass* RectTransformUtility_t3025555048_il2cpp_TypeInfo_var; extern Il2CppClass* WaitForEndOfFrame_t2372756133_il2cpp_TypeInfo_var; extern const uint32_t U3CClickRepeatU3Ec__Iterator5_MoveNext_m451466413_MetadataUsageId; extern "C" bool U3CClickRepeatU3Ec__Iterator5_MoveNext_m451466413 (U3CClickRepeatU3Ec__Iterator5_t99988271 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (U3CClickRepeatU3Ec__Iterator5_MoveNext_m451466413_MetadataUsageId); s_Il2CppMethodIntialized = true; } uint32_t V_0 = 0; bool V_1 = false; U3CClickRepeatU3Ec__Iterator5_t99988271 * G_B7_0 = NULL; U3CClickRepeatU3Ec__Iterator5_t99988271 * G_B6_0 = NULL; float G_B8_0 = 0.0f; U3CClickRepeatU3Ec__Iterator5_t99988271 * G_B8_1 = NULL; { int32_t L_0 = __this->get_U24PC_3(); V_0 = L_0; __this->set_U24PC_3((-1)); uint32_t L_1 = V_0; if (L_1 == 0) { goto IL_0021; } if (L_1 == 1) { goto IL_0119; } } { goto IL_0146; } IL_0021: { goto IL_0119; } IL_0026: { Scrollbar_t2601556940 * L_2 = __this->get_U3CU3Ef__this_6(); NullCheck(L_2); RectTransform_t972643934 * L_3 = L_2->get_m_HandleRect_16(); PointerEventData_t1848751023 * L_4 = __this->get_eventData_0(); NullCheck(L_4); Vector2_t4282066565 L_5 = PointerEventData_get_position_m2263123361(L_4, /*hidden argument*/NULL); PointerEventData_t1848751023 * L_6 = __this->get_eventData_0(); NullCheck(L_6); Camera_t2727095145 * L_7 = PointerEventData_get_enterEventCamera_m1535306943(L_6, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(RectTransformUtility_t3025555048_il2cpp_TypeInfo_var); bool L_8 = RectTransformUtility_RectangleContainsScreenPoint_m1460676684(NULL /*static, unused*/, L_3, L_5, L_7, /*hidden argument*/NULL); if (L_8) { goto IL_0102; } } { Scrollbar_t2601556940 * L_9 = __this->get_U3CU3Ef__this_6(); NullCheck(L_9); RectTransform_t972643934 * L_10 = L_9->get_m_HandleRect_16(); PointerEventData_t1848751023 * L_11 = __this->get_eventData_0(); NullCheck(L_11); Vector2_t4282066565 L_12 = PointerEventData_get_position_m2263123361(L_11, /*hidden argument*/NULL); PointerEventData_t1848751023 * L_13 = __this->get_eventData_0(); NullCheck(L_13); Camera_t2727095145 * L_14 = PointerEventData_get_pressEventCamera_m2764092724(L_13, /*hidden argument*/NULL); Vector2_t4282066565 * L_15 = __this->get_address_of_U3ClocalMousePosU3E__0_1(); IL2CPP_RUNTIME_CLASS_INIT(RectTransformUtility_t3025555048_il2cpp_TypeInfo_var); bool L_16 = RectTransformUtility_ScreenPointToLocalPointInRectangle_m666650172(NULL /*static, unused*/, L_10, L_12, L_14, L_15, /*hidden argument*/NULL); if (!L_16) { goto IL_0102; } } { Scrollbar_t2601556940 * L_17 = __this->get_U3CU3Ef__this_6(); NullCheck(L_17); int32_t L_18 = Scrollbar_get_axis_m3425831999(L_17, /*hidden argument*/NULL); G_B6_0 = __this; if (L_18) { G_B7_0 = __this; goto IL_00a3; } } { Vector2_t4282066565 * L_19 = __this->get_address_of_U3ClocalMousePosU3E__0_1(); float L_20 = L_19->get_x_1(); G_B8_0 = L_20; G_B8_1 = G_B6_0; goto IL_00ae; } IL_00a3: { Vector2_t4282066565 * L_21 = __this->get_address_of_U3ClocalMousePosU3E__0_1(); float L_22 = L_21->get_y_2(); G_B8_0 = L_22; G_B8_1 = G_B7_0; } IL_00ae: { NullCheck(G_B8_1); G_B8_1->set_U3CaxisCoordinateU3E__1_2(G_B8_0); float L_23 = __this->get_U3CaxisCoordinateU3E__1_2(); if ((!(((float)L_23) < ((float)(0.0f))))) { goto IL_00e5; } } { Scrollbar_t2601556940 * L_24 = __this->get_U3CU3Ef__this_6(); Scrollbar_t2601556940 * L_25 = L_24; NullCheck(L_25); float L_26 = Scrollbar_get_value_m3398262479(L_25, /*hidden argument*/NULL); Scrollbar_t2601556940 * L_27 = __this->get_U3CU3Ef__this_6(); NullCheck(L_27); float L_28 = Scrollbar_get_size_m1139900549(L_27, /*hidden argument*/NULL); NullCheck(L_25); Scrollbar_set_value_m1765490852(L_25, ((float)((float)L_26-(float)L_28)), /*hidden argument*/NULL); goto IL_0102; } IL_00e5: { Scrollbar_t2601556940 * L_29 = __this->get_U3CU3Ef__this_6(); Scrollbar_t2601556940 * L_30 = L_29; NullCheck(L_30); float L_31 = Scrollbar_get_value_m3398262479(L_30, /*hidden argument*/NULL); Scrollbar_t2601556940 * L_32 = __this->get_U3CU3Ef__this_6(); NullCheck(L_32); float L_33 = Scrollbar_get_size_m1139900549(L_32, /*hidden argument*/NULL); NullCheck(L_30); Scrollbar_set_value_m1765490852(L_30, ((float)((float)L_31+(float)L_33)), /*hidden argument*/NULL); } IL_0102: { WaitForEndOfFrame_t2372756133 * L_34 = (WaitForEndOfFrame_t2372756133 *)il2cpp_codegen_object_new(WaitForEndOfFrame_t2372756133_il2cpp_TypeInfo_var); WaitForEndOfFrame__ctor_m4124201226(L_34, /*hidden argument*/NULL); __this->set_U24current_4(L_34); __this->set_U24PC_3(1); goto IL_0148; } IL_0119: { Scrollbar_t2601556940 * L_35 = __this->get_U3CU3Ef__this_6(); NullCheck(L_35); bool L_36 = L_35->get_isPointerDownAndNotDragging_26(); if (L_36) { goto IL_0026; } } { Scrollbar_t2601556940 * L_37 = __this->get_U3CU3Ef__this_6(); Scrollbar_t2601556940 * L_38 = __this->get_U3CU3Ef__this_6(); NullCheck(L_38); Coroutine_t3621161934 * L_39 = L_38->get_m_PointerDownRepeat_25(); NullCheck(L_37); MonoBehaviour_StopCoroutine_m1762309278(L_37, L_39, /*hidden argument*/NULL); __this->set_U24PC_3((-1)); } IL_0146: { return (bool)0; } IL_0148: { return (bool)1; } // Dead block : IL_014a: ldloc.1 } // System.Void UnityEngine.UI.Scrollbar/<ClickRepeat>c__Iterator5::Dispose() extern "C" void U3CClickRepeatU3Ec__Iterator5_Dispose_m1618635686 (U3CClickRepeatU3Ec__Iterator5_t99988271 * __this, const MethodInfo* method) { { __this->set_U24PC_3((-1)); return; } } // System.Void UnityEngine.UI.Scrollbar/<ClickRepeat>c__Iterator5::Reset() extern Il2CppClass* NotSupportedException_t1732551818_il2cpp_TypeInfo_var; extern const uint32_t U3CClickRepeatU3Ec__Iterator5_Reset_m1987883094_MetadataUsageId; extern "C" void U3CClickRepeatU3Ec__Iterator5_Reset_m1987883094 (U3CClickRepeatU3Ec__Iterator5_t99988271 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (U3CClickRepeatU3Ec__Iterator5_Reset_m1987883094_MetadataUsageId); s_Il2CppMethodIntialized = true; } { NotSupportedException_t1732551818 * L_0 = (NotSupportedException_t1732551818 *)il2cpp_codegen_object_new(NotSupportedException_t1732551818_il2cpp_TypeInfo_var); NotSupportedException__ctor_m149930845(L_0, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_0); } } // System.Void UnityEngine.UI.Scrollbar/ScrollEvent::.ctor() extern const MethodInfo* UnityEvent_1__ctor_m1354608473_MethodInfo_var; extern const uint32_t ScrollEvent__ctor_m2724827255_MetadataUsageId; extern "C" void ScrollEvent__ctor_m2724827255 (ScrollEvent_t3541123425 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (ScrollEvent__ctor_m2724827255_MetadataUsageId); s_Il2CppMethodIntialized = true; } { UnityEvent_1__ctor_m1354608473(__this, /*hidden argument*/UnityEvent_1__ctor_m1354608473_MethodInfo_var); return; } } // System.Void UnityEngine.UI.ScrollRect::.ctor() extern Il2CppClass* ScrollRectEvent_t1643322606_il2cpp_TypeInfo_var; extern Il2CppClass* Vector3U5BU5D_t215400611_il2cpp_TypeInfo_var; extern const uint32_t ScrollRect__ctor_m3113131930_MetadataUsageId; extern "C" void ScrollRect__ctor_m3113131930 (ScrollRect_t3606982749 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (ScrollRect__ctor_m3113131930_MetadataUsageId); s_Il2CppMethodIntialized = true; } { __this->set_m_Horizontal_3((bool)1); __this->set_m_Vertical_4((bool)1); __this->set_m_MovementType_5(1); __this->set_m_Elasticity_6((0.1f)); __this->set_m_Inertia_7((bool)1); __this->set_m_DecelerationRate_8((0.135f)); __this->set_m_ScrollSensitivity_9((1.0f)); ScrollRectEvent_t1643322606 * L_0 = (ScrollRectEvent_t1643322606 *)il2cpp_codegen_object_new(ScrollRectEvent_t1643322606_il2cpp_TypeInfo_var); ScrollRectEvent__ctor_m985343040(L_0, /*hidden argument*/NULL); __this->set_m_OnValueChanged_17(L_0); Vector2_t4282066565 L_1 = Vector2_get_zero_m199872368(NULL /*static, unused*/, /*hidden argument*/NULL); __this->set_m_PointerStartLocalCursor_18(L_1); Vector2_t4282066565 L_2 = Vector2_get_zero_m199872368(NULL /*static, unused*/, /*hidden argument*/NULL); __this->set_m_ContentStartPosition_19(L_2); Vector2_t4282066565 L_3 = Vector2_get_zero_m199872368(NULL /*static, unused*/, /*hidden argument*/NULL); __this->set_m_PrevPosition_25(L_3); __this->set_m_Corners_37(((Vector3U5BU5D_t215400611*)SZArrayNew(Vector3U5BU5D_t215400611_il2cpp_TypeInfo_var, (uint32_t)4))); UIBehaviour__ctor_m1261553468(__this, /*hidden argument*/NULL); return; } } // UnityEngine.RectTransform UnityEngine.UI.ScrollRect::get_content() extern "C" RectTransform_t972643934 * ScrollRect_get_content_m3701632330 (ScrollRect_t3606982749 * __this, const MethodInfo* method) { { RectTransform_t972643934 * L_0 = __this->get_m_Content_2(); return L_0; } } // System.Void UnityEngine.UI.ScrollRect::set_content(UnityEngine.RectTransform) extern "C" void ScrollRect_set_content_m234982541 (ScrollRect_t3606982749 * __this, RectTransform_t972643934 * ___value0, const MethodInfo* method) { { RectTransform_t972643934 * L_0 = ___value0; __this->set_m_Content_2(L_0); return; } } // System.Boolean UnityEngine.UI.ScrollRect::get_horizontal() extern "C" bool ScrollRect_get_horizontal_m3680042345 (ScrollRect_t3606982749 * __this, const MethodInfo* method) { { bool L_0 = __this->get_m_Horizontal_3(); return L_0; } } // System.Void UnityEngine.UI.ScrollRect::set_horizontal(System.Boolean) extern "C" void ScrollRect_set_horizontal_m943369506 (ScrollRect_t3606982749 * __this, bool ___value0, const MethodInfo* method) { { bool L_0 = ___value0; __this->set_m_Horizontal_3(L_0); return; } } // System.Boolean UnityEngine.UI.ScrollRect::get_vertical() extern "C" bool ScrollRect_get_vertical_m135712059 (ScrollRect_t3606982749 * __this, const MethodInfo* method) { { bool L_0 = __this->get_m_Vertical_4(); return L_0; } } // System.Void UnityEngine.UI.ScrollRect::set_vertical(System.Boolean) extern "C" void ScrollRect_set_vertical_m3763666420 (ScrollRect_t3606982749 * __this, bool ___value0, const MethodInfo* method) { { bool L_0 = ___value0; __this->set_m_Vertical_4(L_0); return; } } // UnityEngine.UI.ScrollRect/MovementType UnityEngine.UI.ScrollRect::get_movementType() extern "C" int32_t ScrollRect_get_movementType_m4014199657 (ScrollRect_t3606982749 * __this, const MethodInfo* method) { { int32_t L_0 = __this->get_m_MovementType_5(); return L_0; } } // System.Void UnityEngine.UI.ScrollRect::set_movementType(UnityEngine.UI.ScrollRect/MovementType) extern "C" void ScrollRect_set_movementType_m4233390924 (ScrollRect_t3606982749 * __this, int32_t ___value0, const MethodInfo* method) { { int32_t L_0 = ___value0; __this->set_m_MovementType_5(L_0); return; } } // System.Single UnityEngine.UI.ScrollRect::get_elasticity() extern "C" float ScrollRect_get_elasticity_m1540742464 (ScrollRect_t3606982749 * __this, const MethodInfo* method) { { float L_0 = __this->get_m_Elasticity_6(); return L_0; } } // System.Void UnityEngine.UI.ScrollRect::set_elasticity(System.Single) extern "C" void ScrollRect_set_elasticity_m957382251 (ScrollRect_t3606982749 * __this, float ___value0, const MethodInfo* method) { { float L_0 = ___value0; __this->set_m_Elasticity_6(L_0); return; } } // System.Boolean UnityEngine.UI.ScrollRect::get_inertia() extern "C" bool ScrollRect_get_inertia_m723925623 (ScrollRect_t3606982749 * __this, const MethodInfo* method) { { bool L_0 = __this->get_m_Inertia_7(); return L_0; } } // System.Void UnityEngine.UI.ScrollRect::set_inertia(System.Boolean) extern "C" void ScrollRect_set_inertia_m4277812460 (ScrollRect_t3606982749 * __this, bool ___value0, const MethodInfo* method) { { bool L_0 = ___value0; __this->set_m_Inertia_7(L_0); return; } } // System.Single UnityEngine.UI.ScrollRect::get_decelerationRate() extern "C" float ScrollRect_get_decelerationRate_m2763364646 (ScrollRect_t3606982749 * __this, const MethodInfo* method) { { float L_0 = __this->get_m_DecelerationRate_8(); return L_0; } } // System.Void UnityEngine.UI.ScrollRect::set_decelerationRate(System.Single) extern "C" void ScrollRect_set_decelerationRate_m1911965765 (ScrollRect_t3606982749 * __this, float ___value0, const MethodInfo* method) { { float L_0 = ___value0; __this->set_m_DecelerationRate_8(L_0); return; } } // System.Single UnityEngine.UI.ScrollRect::get_scrollSensitivity() extern "C" float ScrollRect_get_scrollSensitivity_m1352024717 (ScrollRect_t3606982749 * __this, const MethodInfo* method) { { float L_0 = __this->get_m_ScrollSensitivity_9(); return L_0; } } // System.Void UnityEngine.UI.ScrollRect::set_scrollSensitivity(System.Single) extern "C" void ScrollRect_set_scrollSensitivity_m310245950 (ScrollRect_t3606982749 * __this, float ___value0, const MethodInfo* method) { { float L_0 = ___value0; __this->set_m_ScrollSensitivity_9(L_0); return; } } // UnityEngine.RectTransform UnityEngine.UI.ScrollRect::get_viewport() extern "C" RectTransform_t972643934 * ScrollRect_get_viewport_m1780465687 (ScrollRect_t3606982749 * __this, const MethodInfo* method) { { RectTransform_t972643934 * L_0 = __this->get_m_Viewport_10(); return L_0; } } // System.Void UnityEngine.UI.ScrollRect::set_viewport(UnityEngine.RectTransform) extern "C" void ScrollRect_set_viewport_m1031184500 (ScrollRect_t3606982749 * __this, RectTransform_t972643934 * ___value0, const MethodInfo* method) { { RectTransform_t972643934 * L_0 = ___value0; __this->set_m_Viewport_10(L_0); ScrollRect_SetDirtyCaching_m4215531847(__this, /*hidden argument*/NULL); return; } } // UnityEngine.UI.Scrollbar UnityEngine.UI.ScrollRect::get_horizontalScrollbar() extern "C" Scrollbar_t2601556940 * ScrollRect_get_horizontalScrollbar_m2383265157 (ScrollRect_t3606982749 * __this, const MethodInfo* method) { { Scrollbar_t2601556940 * L_0 = __this->get_m_HorizontalScrollbar_11(); return L_0; } } // System.Void UnityEngine.UI.ScrollRect::set_horizontalScrollbar(UnityEngine.UI.Scrollbar) extern Il2CppClass* UnityAction_1_t4186098975_il2cpp_TypeInfo_var; extern const MethodInfo* ScrollRect_SetHorizontalNormalizedPosition_m653475821_MethodInfo_var; extern const MethodInfo* UnityAction_1__ctor_m480548041_MethodInfo_var; extern const MethodInfo* UnityEvent_1_RemoveListener_m1402724082_MethodInfo_var; extern const MethodInfo* UnityEvent_1_AddListener_m994670587_MethodInfo_var; extern const uint32_t ScrollRect_set_horizontalScrollbar_m2130920826_MetadataUsageId; extern "C" void ScrollRect_set_horizontalScrollbar_m2130920826 (ScrollRect_t3606982749 * __this, Scrollbar_t2601556940 * ___value0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (ScrollRect_set_horizontalScrollbar_m2130920826_MetadataUsageId); s_Il2CppMethodIntialized = true; } { Scrollbar_t2601556940 * L_0 = __this->get_m_HorizontalScrollbar_11(); bool L_1 = Object_op_Implicit_m2106766291(NULL /*static, unused*/, L_0, /*hidden argument*/NULL); if (!L_1) { goto IL_002c; } } { Scrollbar_t2601556940 * L_2 = __this->get_m_HorizontalScrollbar_11(); NullCheck(L_2); ScrollEvent_t3541123425 * L_3 = Scrollbar_get_onValueChanged_m312588368(L_2, /*hidden argument*/NULL); IntPtr_t L_4; L_4.set_m_value_0((void*)(void*)ScrollRect_SetHorizontalNormalizedPosition_m653475821_MethodInfo_var); UnityAction_1_t4186098975 * L_5 = (UnityAction_1_t4186098975 *)il2cpp_codegen_object_new(UnityAction_1_t4186098975_il2cpp_TypeInfo_var); UnityAction_1__ctor_m480548041(L_5, __this, L_4, /*hidden argument*/UnityAction_1__ctor_m480548041_MethodInfo_var); NullCheck(L_3); UnityEvent_1_RemoveListener_m1402724082(L_3, L_5, /*hidden argument*/UnityEvent_1_RemoveListener_m1402724082_MethodInfo_var); } IL_002c: { Scrollbar_t2601556940 * L_6 = ___value0; __this->set_m_HorizontalScrollbar_11(L_6); Scrollbar_t2601556940 * L_7 = __this->get_m_HorizontalScrollbar_11(); bool L_8 = Object_op_Implicit_m2106766291(NULL /*static, unused*/, L_7, /*hidden argument*/NULL); if (!L_8) { goto IL_005f; } } { Scrollbar_t2601556940 * L_9 = __this->get_m_HorizontalScrollbar_11(); NullCheck(L_9); ScrollEvent_t3541123425 * L_10 = Scrollbar_get_onValueChanged_m312588368(L_9, /*hidden argument*/NULL); IntPtr_t L_11; L_11.set_m_value_0((void*)(void*)ScrollRect_SetHorizontalNormalizedPosition_m653475821_MethodInfo_var); UnityAction_1_t4186098975 * L_12 = (UnityAction_1_t4186098975 *)il2cpp_codegen_object_new(UnityAction_1_t4186098975_il2cpp_TypeInfo_var); UnityAction_1__ctor_m480548041(L_12, __this, L_11, /*hidden argument*/UnityAction_1__ctor_m480548041_MethodInfo_var); NullCheck(L_10); UnityEvent_1_AddListener_m994670587(L_10, L_12, /*hidden argument*/UnityEvent_1_AddListener_m994670587_MethodInfo_var); } IL_005f: { ScrollRect_SetDirtyCaching_m4215531847(__this, /*hidden argument*/NULL); return; } } // UnityEngine.UI.Scrollbar UnityEngine.UI.ScrollRect::get_verticalScrollbar() extern "C" Scrollbar_t2601556940 * ScrollRect_get_verticalScrollbar_m801913715 (ScrollRect_t3606982749 * __this, const MethodInfo* method) { { Scrollbar_t2601556940 * L_0 = __this->get_m_VerticalScrollbar_12(); return L_0; } } // System.Void UnityEngine.UI.ScrollRect::set_verticalScrollbar(UnityEngine.UI.Scrollbar) extern Il2CppClass* UnityAction_1_t4186098975_il2cpp_TypeInfo_var; extern const MethodInfo* ScrollRect_SetVerticalNormalizedPosition_m3957527707_MethodInfo_var; extern const MethodInfo* UnityAction_1__ctor_m480548041_MethodInfo_var; extern const MethodInfo* UnityEvent_1_RemoveListener_m1402724082_MethodInfo_var; extern const MethodInfo* UnityEvent_1_AddListener_m994670587_MethodInfo_var; extern const uint32_t ScrollRect_set_verticalScrollbar_m845729640_MetadataUsageId; extern "C" void ScrollRect_set_verticalScrollbar_m845729640 (ScrollRect_t3606982749 * __this, Scrollbar_t2601556940 * ___value0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (ScrollRect_set_verticalScrollbar_m845729640_MetadataUsageId); s_Il2CppMethodIntialized = true; } { Scrollbar_t2601556940 * L_0 = __this->get_m_VerticalScrollbar_12(); bool L_1 = Object_op_Implicit_m2106766291(NULL /*static, unused*/, L_0, /*hidden argument*/NULL); if (!L_1) { goto IL_002c; } } { Scrollbar_t2601556940 * L_2 = __this->get_m_VerticalScrollbar_12(); NullCheck(L_2); ScrollEvent_t3541123425 * L_3 = Scrollbar_get_onValueChanged_m312588368(L_2, /*hidden argument*/NULL); IntPtr_t L_4; L_4.set_m_value_0((void*)(void*)ScrollRect_SetVerticalNormalizedPosition_m3957527707_MethodInfo_var); UnityAction_1_t4186098975 * L_5 = (UnityAction_1_t4186098975 *)il2cpp_codegen_object_new(UnityAction_1_t4186098975_il2cpp_TypeInfo_var); UnityAction_1__ctor_m480548041(L_5, __this, L_4, /*hidden argument*/UnityAction_1__ctor_m480548041_MethodInfo_var); NullCheck(L_3); UnityEvent_1_RemoveListener_m1402724082(L_3, L_5, /*hidden argument*/UnityEvent_1_RemoveListener_m1402724082_MethodInfo_var); } IL_002c: { Scrollbar_t2601556940 * L_6 = ___value0; __this->set_m_VerticalScrollbar_12(L_6); Scrollbar_t2601556940 * L_7 = __this->get_m_VerticalScrollbar_12(); bool L_8 = Object_op_Implicit_m2106766291(NULL /*static, unused*/, L_7, /*hidden argument*/NULL); if (!L_8) { goto IL_005f; } } { Scrollbar_t2601556940 * L_9 = __this->get_m_VerticalScrollbar_12(); NullCheck(L_9); ScrollEvent_t3541123425 * L_10 = Scrollbar_get_onValueChanged_m312588368(L_9, /*hidden argument*/NULL); IntPtr_t L_11; L_11.set_m_value_0((void*)(void*)ScrollRect_SetVerticalNormalizedPosition_m3957527707_MethodInfo_var); UnityAction_1_t4186098975 * L_12 = (UnityAction_1_t4186098975 *)il2cpp_codegen_object_new(UnityAction_1_t4186098975_il2cpp_TypeInfo_var); UnityAction_1__ctor_m480548041(L_12, __this, L_11, /*hidden argument*/UnityAction_1__ctor_m480548041_MethodInfo_var); NullCheck(L_10); UnityEvent_1_AddListener_m994670587(L_10, L_12, /*hidden argument*/UnityEvent_1_AddListener_m994670587_MethodInfo_var); } IL_005f: { ScrollRect_SetDirtyCaching_m4215531847(__this, /*hidden argument*/NULL); return; } } // UnityEngine.UI.ScrollRect/ScrollbarVisibility UnityEngine.UI.ScrollRect::get_horizontalScrollbarVisibility() extern "C" int32_t ScrollRect_get_horizontalScrollbarVisibility_m2805283129 (ScrollRect_t3606982749 * __this, const MethodInfo* method) { { int32_t L_0 = __this->get_m_HorizontalScrollbarVisibility_13(); return L_0; } } // System.Void UnityEngine.UI.ScrollRect::set_horizontalScrollbarVisibility(UnityEngine.UI.ScrollRect/ScrollbarVisibility) extern "C" void ScrollRect_set_horizontalScrollbarVisibility_m1831067046 (ScrollRect_t3606982749 * __this, int32_t ___value0, const MethodInfo* method) { { int32_t L_0 = ___value0; __this->set_m_HorizontalScrollbarVisibility_13(L_0); ScrollRect_SetDirtyCaching_m4215531847(__this, /*hidden argument*/NULL); return; } } // UnityEngine.UI.ScrollRect/ScrollbarVisibility UnityEngine.UI.ScrollRect::get_verticalScrollbarVisibility() extern "C" int32_t ScrollRect_get_verticalScrollbarVisibility_m1678458407 (ScrollRect_t3606982749 * __this, const MethodInfo* method) { { int32_t L_0 = __this->get_m_VerticalScrollbarVisibility_14(); return L_0; } } // System.Void UnityEngine.UI.ScrollRect::set_verticalScrollbarVisibility(UnityEngine.UI.ScrollRect/ScrollbarVisibility) extern "C" void ScrollRect_set_verticalScrollbarVisibility_m4230518264 (ScrollRect_t3606982749 * __this, int32_t ___value0, const MethodInfo* method) { { int32_t L_0 = ___value0; __this->set_m_VerticalScrollbarVisibility_14(L_0); ScrollRect_SetDirtyCaching_m4215531847(__this, /*hidden argument*/NULL); return; } } // System.Single UnityEngine.UI.ScrollRect::get_horizontalScrollbarSpacing() extern "C" float ScrollRect_get_horizontalScrollbarSpacing_m2867145992 (ScrollRect_t3606982749 * __this, const MethodInfo* method) { { float L_0 = __this->get_m_HorizontalScrollbarSpacing_15(); return L_0; } } // System.Void UnityEngine.UI.ScrollRect::set_horizontalScrollbarSpacing(System.Single) extern "C" void ScrollRect_set_horizontalScrollbarSpacing_m1996166051 (ScrollRect_t3606982749 * __this, float ___value0, const MethodInfo* method) { { float L_0 = ___value0; __this->set_m_HorizontalScrollbarSpacing_15(L_0); ScrollRect_SetDirty_m93607546(__this, /*hidden argument*/NULL); return; } } // System.Single UnityEngine.UI.ScrollRect::get_verticalScrollbarSpacing() extern "C" float ScrollRect_get_verticalScrollbarSpacing_m1095438682 (ScrollRect_t3606982749 * __this, const MethodInfo* method) { { float L_0 = __this->get_m_VerticalScrollbarSpacing_16(); return L_0; } } // System.Void UnityEngine.UI.ScrollRect::set_verticalScrollbarSpacing(System.Single) extern "C" void ScrollRect_set_verticalScrollbarSpacing_m4137600145 (ScrollRect_t3606982749 * __this, float ___value0, const MethodInfo* method) { { float L_0 = ___value0; __this->set_m_VerticalScrollbarSpacing_16(L_0); ScrollRect_SetDirty_m93607546(__this, /*hidden argument*/NULL); return; } } // UnityEngine.UI.ScrollRect/ScrollRectEvent UnityEngine.UI.ScrollRect::get_onValueChanged() extern "C" ScrollRectEvent_t1643322606 * ScrollRect_get_onValueChanged_m4119396560 (ScrollRect_t3606982749 * __this, const MethodInfo* method) { { ScrollRectEvent_t1643322606 * L_0 = __this->get_m_OnValueChanged_17(); return L_0; } } // System.Void UnityEngine.UI.ScrollRect::set_onValueChanged(UnityEngine.UI.ScrollRect/ScrollRectEvent) extern "C" void ScrollRect_set_onValueChanged_m499269979 (ScrollRect_t3606982749 * __this, ScrollRectEvent_t1643322606 * ___value0, const MethodInfo* method) { { ScrollRectEvent_t1643322606 * L_0 = ___value0; __this->set_m_OnValueChanged_17(L_0); return; } } // UnityEngine.RectTransform UnityEngine.UI.ScrollRect::get_viewRect() extern Il2CppClass* RectTransform_t972643934_il2cpp_TypeInfo_var; extern const uint32_t ScrollRect_get_viewRect_m911909082_MetadataUsageId; extern "C" RectTransform_t972643934 * ScrollRect_get_viewRect_m911909082 (ScrollRect_t3606982749 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (ScrollRect_get_viewRect_m911909082_MetadataUsageId); s_Il2CppMethodIntialized = true; } { RectTransform_t972643934 * L_0 = __this->get_m_ViewRect_20(); bool L_1 = Object_op_Equality_m3964590952(NULL /*static, unused*/, L_0, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_1) { goto IL_001d; } } { RectTransform_t972643934 * L_2 = __this->get_m_Viewport_10(); __this->set_m_ViewRect_20(L_2); } IL_001d: { RectTransform_t972643934 * L_3 = __this->get_m_ViewRect_20(); bool L_4 = Object_op_Equality_m3964590952(NULL /*static, unused*/, L_3, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_4) { goto IL_003f; } } { Transform_t1659122786 * L_5 = Component_get_transform_m4257140443(__this, /*hidden argument*/NULL); __this->set_m_ViewRect_20(((RectTransform_t972643934 *)CastclassSealed(L_5, RectTransform_t972643934_il2cpp_TypeInfo_var))); } IL_003f: { RectTransform_t972643934 * L_6 = __this->get_m_ViewRect_20(); return L_6; } } // UnityEngine.Vector2 UnityEngine.UI.ScrollRect::get_velocity() extern "C" Vector2_t4282066565 ScrollRect_get_velocity_m4218059637 (ScrollRect_t3606982749 * __this, const MethodInfo* method) { { Vector2_t4282066565 L_0 = __this->get_m_Velocity_23(); return L_0; } } // System.Void UnityEngine.UI.ScrollRect::set_velocity(UnityEngine.Vector2) extern "C" void ScrollRect_set_velocity_m4003401302 (ScrollRect_t3606982749 * __this, Vector2_t4282066565 ___value0, const MethodInfo* method) { { Vector2_t4282066565 L_0 = ___value0; __this->set_m_Velocity_23(L_0); return; } } // UnityEngine.RectTransform UnityEngine.UI.ScrollRect::get_rectTransform() extern const MethodInfo* Component_GetComponent_TisRectTransform_t972643934_m1940403147_MethodInfo_var; extern const uint32_t ScrollRect_get_rectTransform_m836427513_MetadataUsageId; extern "C" RectTransform_t972643934 * ScrollRect_get_rectTransform_m836427513 (ScrollRect_t3606982749 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (ScrollRect_get_rectTransform_m836427513_MetadataUsageId); s_Il2CppMethodIntialized = true; } { RectTransform_t972643934 * L_0 = __this->get_m_Rect_33(); bool L_1 = Object_op_Equality_m3964590952(NULL /*static, unused*/, L_0, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_1) { goto IL_001d; } } { RectTransform_t972643934 * L_2 = Component_GetComponent_TisRectTransform_t972643934_m1940403147(__this, /*hidden argument*/Component_GetComponent_TisRectTransform_t972643934_m1940403147_MethodInfo_var); __this->set_m_Rect_33(L_2); } IL_001d: { RectTransform_t972643934 * L_3 = __this->get_m_Rect_33(); return L_3; } } // System.Void UnityEngine.UI.ScrollRect::Rebuild(UnityEngine.UI.CanvasUpdate) extern "C" void ScrollRect_Rebuild_m3329025723 (ScrollRect_t3606982749 * __this, int32_t ___executing0, const MethodInfo* method) { { int32_t L_0 = ___executing0; if (L_0) { goto IL_000c; } } { ScrollRect_UpdateCachedData_m4281892159(__this, /*hidden argument*/NULL); } IL_000c: { int32_t L_1 = ___executing0; if ((!(((uint32_t)L_1) == ((uint32_t)2)))) { goto IL_0031; } } { ScrollRect_UpdateBounds_m1752242888(__this, /*hidden argument*/NULL); Vector2_t4282066565 L_2 = Vector2_get_zero_m199872368(NULL /*static, unused*/, /*hidden argument*/NULL); ScrollRect_UpdateScrollbars_m2912536474(__this, L_2, /*hidden argument*/NULL); ScrollRect_UpdatePrevData_m454081040(__this, /*hidden argument*/NULL); __this->set_m_HasRebuiltLayout_28((bool)1); } IL_0031: { return; } } // System.Void UnityEngine.UI.ScrollRect::LayoutComplete() extern "C" void ScrollRect_LayoutComplete_m1579087085 (ScrollRect_t3606982749 * __this, const MethodInfo* method) { { return; } } // System.Void UnityEngine.UI.ScrollRect::GraphicUpdateComplete() extern "C" void ScrollRect_GraphicUpdateComplete_m2238911074 (ScrollRect_t3606982749 * __this, const MethodInfo* method) { { return; } } // System.Void UnityEngine.UI.ScrollRect::UpdateCachedData() extern Il2CppClass* RectTransform_t972643934_il2cpp_TypeInfo_var; extern const uint32_t ScrollRect_UpdateCachedData_m4281892159_MetadataUsageId; extern "C" void ScrollRect_UpdateCachedData_m4281892159 (ScrollRect_t3606982749 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (ScrollRect_UpdateCachedData_m4281892159_MetadataUsageId); s_Il2CppMethodIntialized = true; } Transform_t1659122786 * V_0 = NULL; bool V_1 = false; bool V_2 = false; bool V_3 = false; bool V_4 = false; Rect_t4241904616 V_5; memset(&V_5, 0, sizeof(V_5)); Rect_t4241904616 V_6; memset(&V_6, 0, sizeof(V_6)); ScrollRect_t3606982749 * G_B2_0 = NULL; ScrollRect_t3606982749 * G_B1_0 = NULL; RectTransform_t972643934 * G_B3_0 = NULL; ScrollRect_t3606982749 * G_B3_1 = NULL; ScrollRect_t3606982749 * G_B5_0 = NULL; ScrollRect_t3606982749 * G_B4_0 = NULL; RectTransform_t972643934 * G_B6_0 = NULL; ScrollRect_t3606982749 * G_B6_1 = NULL; int32_t G_B9_0 = 0; int32_t G_B12_0 = 0; int32_t G_B16_0 = 0; ScrollRect_t3606982749 * G_B19_0 = NULL; ScrollRect_t3606982749 * G_B17_0 = NULL; ScrollRect_t3606982749 * G_B18_0 = NULL; int32_t G_B20_0 = 0; ScrollRect_t3606982749 * G_B20_1 = NULL; ScrollRect_t3606982749 * G_B23_0 = NULL; ScrollRect_t3606982749 * G_B21_0 = NULL; ScrollRect_t3606982749 * G_B22_0 = NULL; int32_t G_B24_0 = 0; ScrollRect_t3606982749 * G_B24_1 = NULL; ScrollRect_t3606982749 * G_B26_0 = NULL; ScrollRect_t3606982749 * G_B25_0 = NULL; float G_B27_0 = 0.0f; ScrollRect_t3606982749 * G_B27_1 = NULL; ScrollRect_t3606982749 * G_B29_0 = NULL; ScrollRect_t3606982749 * G_B28_0 = NULL; float G_B30_0 = 0.0f; ScrollRect_t3606982749 * G_B30_1 = NULL; { Transform_t1659122786 * L_0 = Component_get_transform_m4257140443(__this, /*hidden argument*/NULL); V_0 = L_0; Scrollbar_t2601556940 * L_1 = __this->get_m_HorizontalScrollbar_11(); bool L_2 = Object_op_Equality_m3964590952(NULL /*static, unused*/, L_1, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); G_B1_0 = __this; if (!L_2) { G_B2_0 = __this; goto IL_001f; } } { G_B3_0 = ((RectTransform_t972643934 *)(NULL)); G_B3_1 = G_B1_0; goto IL_002f; } IL_001f: { Scrollbar_t2601556940 * L_3 = __this->get_m_HorizontalScrollbar_11(); NullCheck(L_3); Transform_t1659122786 * L_4 = Component_get_transform_m4257140443(L_3, /*hidden argument*/NULL); G_B3_0 = ((RectTransform_t972643934 *)IsInstSealed(L_4, RectTransform_t972643934_il2cpp_TypeInfo_var)); G_B3_1 = G_B2_0; } IL_002f: { NullCheck(G_B3_1); G_B3_1->set_m_HorizontalScrollbarRect_34(G_B3_0); Scrollbar_t2601556940 * L_5 = __this->get_m_VerticalScrollbar_12(); bool L_6 = Object_op_Equality_m3964590952(NULL /*static, unused*/, L_5, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); G_B4_0 = __this; if (!L_6) { G_B5_0 = __this; goto IL_004c; } } { G_B6_0 = ((RectTransform_t972643934 *)(NULL)); G_B6_1 = G_B4_0; goto IL_005c; } IL_004c: { Scrollbar_t2601556940 * L_7 = __this->get_m_VerticalScrollbar_12(); NullCheck(L_7); Transform_t1659122786 * L_8 = Component_get_transform_m4257140443(L_7, /*hidden argument*/NULL); G_B6_0 = ((RectTransform_t972643934 *)IsInstSealed(L_8, RectTransform_t972643934_il2cpp_TypeInfo_var)); G_B6_1 = G_B5_0; } IL_005c: { NullCheck(G_B6_1); G_B6_1->set_m_VerticalScrollbarRect_35(G_B6_0); RectTransform_t972643934 * L_9 = ScrollRect_get_viewRect_m911909082(__this, /*hidden argument*/NULL); NullCheck(L_9); Transform_t1659122786 * L_10 = Transform_get_parent_m2236876972(L_9, /*hidden argument*/NULL); Transform_t1659122786 * L_11 = V_0; bool L_12 = Object_op_Equality_m3964590952(NULL /*static, unused*/, L_10, L_11, /*hidden argument*/NULL); V_1 = L_12; RectTransform_t972643934 * L_13 = __this->get_m_HorizontalScrollbarRect_34(); bool L_14 = Object_op_Implicit_m2106766291(NULL /*static, unused*/, L_13, /*hidden argument*/NULL); if (!L_14) { goto IL_0096; } } { RectTransform_t972643934 * L_15 = __this->get_m_HorizontalScrollbarRect_34(); NullCheck(L_15); Transform_t1659122786 * L_16 = Transform_get_parent_m2236876972(L_15, /*hidden argument*/NULL); Transform_t1659122786 * L_17 = V_0; bool L_18 = Object_op_Equality_m3964590952(NULL /*static, unused*/, L_16, L_17, /*hidden argument*/NULL); G_B9_0 = ((int32_t)(L_18)); goto IL_0097; } IL_0096: { G_B9_0 = 1; } IL_0097: { V_2 = (bool)G_B9_0; RectTransform_t972643934 * L_19 = __this->get_m_VerticalScrollbarRect_35(); bool L_20 = Object_op_Implicit_m2106766291(NULL /*static, unused*/, L_19, /*hidden argument*/NULL); if (!L_20) { goto IL_00bb; } } { RectTransform_t972643934 * L_21 = __this->get_m_VerticalScrollbarRect_35(); NullCheck(L_21); Transform_t1659122786 * L_22 = Transform_get_parent_m2236876972(L_21, /*hidden argument*/NULL); Transform_t1659122786 * L_23 = V_0; bool L_24 = Object_op_Equality_m3964590952(NULL /*static, unused*/, L_22, L_23, /*hidden argument*/NULL); G_B12_0 = ((int32_t)(L_24)); goto IL_00bc; } IL_00bb: { G_B12_0 = 1; } IL_00bc: { V_3 = (bool)G_B12_0; bool L_25 = V_1; if (!L_25) { goto IL_00cc; } } { bool L_26 = V_2; if (!L_26) { goto IL_00cc; } } { bool L_27 = V_3; G_B16_0 = ((int32_t)(L_27)); goto IL_00cd; } IL_00cc: { G_B16_0 = 0; } IL_00cd: { V_4 = (bool)G_B16_0; bool L_28 = V_4; G_B17_0 = __this; if (!L_28) { G_B19_0 = __this; goto IL_00f2; } } { RectTransform_t972643934 * L_29 = __this->get_m_HorizontalScrollbarRect_34(); bool L_30 = Object_op_Implicit_m2106766291(NULL /*static, unused*/, L_29, /*hidden argument*/NULL); G_B18_0 = G_B17_0; if (!L_30) { G_B19_0 = G_B17_0; goto IL_00f2; } } { int32_t L_31 = ScrollRect_get_horizontalScrollbarVisibility_m2805283129(__this, /*hidden argument*/NULL); G_B20_0 = ((((int32_t)L_31) == ((int32_t)2))? 1 : 0); G_B20_1 = G_B18_0; goto IL_00f3; } IL_00f2: { G_B20_0 = 0; G_B20_1 = G_B19_0; } IL_00f3: { NullCheck(G_B20_1); G_B20_1->set_m_HSliderExpand_29((bool)G_B20_0); bool L_32 = V_4; G_B21_0 = __this; if (!L_32) { G_B23_0 = __this; goto IL_011b; } } { RectTransform_t972643934 * L_33 = __this->get_m_VerticalScrollbarRect_35(); bool L_34 = Object_op_Implicit_m2106766291(NULL /*static, unused*/, L_33, /*hidden argument*/NULL); G_B22_0 = G_B21_0; if (!L_34) { G_B23_0 = G_B21_0; goto IL_011b; } } { int32_t L_35 = ScrollRect_get_verticalScrollbarVisibility_m1678458407(__this, /*hidden argument*/NULL); G_B24_0 = ((((int32_t)L_35) == ((int32_t)2))? 1 : 0); G_B24_1 = G_B22_0; goto IL_011c; } IL_011b: { G_B24_0 = 0; G_B24_1 = G_B23_0; } IL_011c: { NullCheck(G_B24_1); G_B24_1->set_m_VSliderExpand_30((bool)G_B24_0); RectTransform_t972643934 * L_36 = __this->get_m_HorizontalScrollbarRect_34(); bool L_37 = Object_op_Equality_m3964590952(NULL /*static, unused*/, L_36, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); G_B25_0 = __this; if (!L_37) { G_B26_0 = __this; goto IL_013d; } } { G_B27_0 = (0.0f); G_B27_1 = G_B25_0; goto IL_0151; } IL_013d: { RectTransform_t972643934 * L_38 = __this->get_m_HorizontalScrollbarRect_34(); NullCheck(L_38); Rect_t4241904616 L_39 = RectTransform_get_rect_m1566017036(L_38, /*hidden argument*/NULL); V_5 = L_39; float L_40 = Rect_get_height_m2154960823((&V_5), /*hidden argument*/NULL); G_B27_0 = L_40; G_B27_1 = G_B26_0; } IL_0151: { NullCheck(G_B27_1); G_B27_1->set_m_HSliderHeight_31(G_B27_0); RectTransform_t972643934 * L_41 = __this->get_m_VerticalScrollbarRect_35(); bool L_42 = Object_op_Equality_m3964590952(NULL /*static, unused*/, L_41, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); G_B28_0 = __this; if (!L_42) { G_B29_0 = __this; goto IL_0172; } } { G_B30_0 = (0.0f); G_B30_1 = G_B28_0; goto IL_0186; } IL_0172: { RectTransform_t972643934 * L_43 = __this->get_m_VerticalScrollbarRect_35(); NullCheck(L_43); Rect_t4241904616 L_44 = RectTransform_get_rect_m1566017036(L_43, /*hidden argument*/NULL); V_6 = L_44; float L_45 = Rect_get_width_m2824209432((&V_6), /*hidden argument*/NULL); G_B30_0 = L_45; G_B30_1 = G_B29_0; } IL_0186: { NullCheck(G_B30_1); G_B30_1->set_m_VSliderWidth_32(G_B30_0); return; } } // System.Void UnityEngine.UI.ScrollRect::OnEnable() extern Il2CppClass* UnityAction_1_t4186098975_il2cpp_TypeInfo_var; extern Il2CppClass* CanvasUpdateRegistry_t192658922_il2cpp_TypeInfo_var; extern const MethodInfo* ScrollRect_SetHorizontalNormalizedPosition_m653475821_MethodInfo_var; extern const MethodInfo* UnityAction_1__ctor_m480548041_MethodInfo_var; extern const MethodInfo* UnityEvent_1_AddListener_m994670587_MethodInfo_var; extern const MethodInfo* ScrollRect_SetVerticalNormalizedPosition_m3957527707_MethodInfo_var; extern const uint32_t ScrollRect_OnEnable_m4156082604_MetadataUsageId; extern "C" void ScrollRect_OnEnable_m4156082604 (ScrollRect_t3606982749 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (ScrollRect_OnEnable_m4156082604_MetadataUsageId); s_Il2CppMethodIntialized = true; } { UIBehaviour_OnEnable_m4047103690(__this, /*hidden argument*/NULL); Scrollbar_t2601556940 * L_0 = __this->get_m_HorizontalScrollbar_11(); bool L_1 = Object_op_Implicit_m2106766291(NULL /*static, unused*/, L_0, /*hidden argument*/NULL); if (!L_1) { goto IL_0032; } } { Scrollbar_t2601556940 * L_2 = __this->get_m_HorizontalScrollbar_11(); NullCheck(L_2); ScrollEvent_t3541123425 * L_3 = Scrollbar_get_onValueChanged_m312588368(L_2, /*hidden argument*/NULL); IntPtr_t L_4; L_4.set_m_value_0((void*)(void*)ScrollRect_SetHorizontalNormalizedPosition_m653475821_MethodInfo_var); UnityAction_1_t4186098975 * L_5 = (UnityAction_1_t4186098975 *)il2cpp_codegen_object_new(UnityAction_1_t4186098975_il2cpp_TypeInfo_var); UnityAction_1__ctor_m480548041(L_5, __this, L_4, /*hidden argument*/UnityAction_1__ctor_m480548041_MethodInfo_var); NullCheck(L_3); UnityEvent_1_AddListener_m994670587(L_3, L_5, /*hidden argument*/UnityEvent_1_AddListener_m994670587_MethodInfo_var); } IL_0032: { Scrollbar_t2601556940 * L_6 = __this->get_m_VerticalScrollbar_12(); bool L_7 = Object_op_Implicit_m2106766291(NULL /*static, unused*/, L_6, /*hidden argument*/NULL); if (!L_7) { goto IL_005e; } } { Scrollbar_t2601556940 * L_8 = __this->get_m_VerticalScrollbar_12(); NullCheck(L_8); ScrollEvent_t3541123425 * L_9 = Scrollbar_get_onValueChanged_m312588368(L_8, /*hidden argument*/NULL); IntPtr_t L_10; L_10.set_m_value_0((void*)(void*)ScrollRect_SetVerticalNormalizedPosition_m3957527707_MethodInfo_var); UnityAction_1_t4186098975 * L_11 = (UnityAction_1_t4186098975 *)il2cpp_codegen_object_new(UnityAction_1_t4186098975_il2cpp_TypeInfo_var); UnityAction_1__ctor_m480548041(L_11, __this, L_10, /*hidden argument*/UnityAction_1__ctor_m480548041_MethodInfo_var); NullCheck(L_9); UnityEvent_1_AddListener_m994670587(L_9, L_11, /*hidden argument*/UnityEvent_1_AddListener_m994670587_MethodInfo_var); } IL_005e: { IL2CPP_RUNTIME_CLASS_INIT(CanvasUpdateRegistry_t192658922_il2cpp_TypeInfo_var); CanvasUpdateRegistry_RegisterCanvasElementForLayoutRebuild_m1282865408(NULL /*static, unused*/, __this, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.UI.ScrollRect::OnDisable() extern Il2CppClass* CanvasUpdateRegistry_t192658922_il2cpp_TypeInfo_var; extern Il2CppClass* UnityAction_1_t4186098975_il2cpp_TypeInfo_var; extern Il2CppClass* LayoutRebuilder_t1942933988_il2cpp_TypeInfo_var; extern const MethodInfo* ScrollRect_SetHorizontalNormalizedPosition_m653475821_MethodInfo_var; extern const MethodInfo* UnityAction_1__ctor_m480548041_MethodInfo_var; extern const MethodInfo* UnityEvent_1_RemoveListener_m1402724082_MethodInfo_var; extern const MethodInfo* ScrollRect_SetVerticalNormalizedPosition_m3957527707_MethodInfo_var; extern const uint32_t ScrollRect_OnDisable_m430479105_MetadataUsageId; extern "C" void ScrollRect_OnDisable_m430479105 (ScrollRect_t3606982749 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (ScrollRect_OnDisable_m430479105_MetadataUsageId); s_Il2CppMethodIntialized = true; } { IL2CPP_RUNTIME_CLASS_INIT(CanvasUpdateRegistry_t192658922_il2cpp_TypeInfo_var); CanvasUpdateRegistry_UnRegisterCanvasElementForRebuild_m2188113711(NULL /*static, unused*/, __this, /*hidden argument*/NULL); Scrollbar_t2601556940 * L_0 = __this->get_m_HorizontalScrollbar_11(); bool L_1 = Object_op_Implicit_m2106766291(NULL /*static, unused*/, L_0, /*hidden argument*/NULL); if (!L_1) { goto IL_0032; } } { Scrollbar_t2601556940 * L_2 = __this->get_m_HorizontalScrollbar_11(); NullCheck(L_2); ScrollEvent_t3541123425 * L_3 = Scrollbar_get_onValueChanged_m312588368(L_2, /*hidden argument*/NULL); IntPtr_t L_4; L_4.set_m_value_0((void*)(void*)ScrollRect_SetHorizontalNormalizedPosition_m653475821_MethodInfo_var); UnityAction_1_t4186098975 * L_5 = (UnityAction_1_t4186098975 *)il2cpp_codegen_object_new(UnityAction_1_t4186098975_il2cpp_TypeInfo_var); UnityAction_1__ctor_m480548041(L_5, __this, L_4, /*hidden argument*/UnityAction_1__ctor_m480548041_MethodInfo_var); NullCheck(L_3); UnityEvent_1_RemoveListener_m1402724082(L_3, L_5, /*hidden argument*/UnityEvent_1_RemoveListener_m1402724082_MethodInfo_var); } IL_0032: { Scrollbar_t2601556940 * L_6 = __this->get_m_VerticalScrollbar_12(); bool L_7 = Object_op_Implicit_m2106766291(NULL /*static, unused*/, L_6, /*hidden argument*/NULL); if (!L_7) { goto IL_005e; } } { Scrollbar_t2601556940 * L_8 = __this->get_m_VerticalScrollbar_12(); NullCheck(L_8); ScrollEvent_t3541123425 * L_9 = Scrollbar_get_onValueChanged_m312588368(L_8, /*hidden argument*/NULL); IntPtr_t L_10; L_10.set_m_value_0((void*)(void*)ScrollRect_SetVerticalNormalizedPosition_m3957527707_MethodInfo_var); UnityAction_1_t4186098975 * L_11 = (UnityAction_1_t4186098975 *)il2cpp_codegen_object_new(UnityAction_1_t4186098975_il2cpp_TypeInfo_var); UnityAction_1__ctor_m480548041(L_11, __this, L_10, /*hidden argument*/UnityAction_1__ctor_m480548041_MethodInfo_var); NullCheck(L_9); UnityEvent_1_RemoveListener_m1402724082(L_9, L_11, /*hidden argument*/UnityEvent_1_RemoveListener_m1402724082_MethodInfo_var); } IL_005e: { __this->set_m_HasRebuiltLayout_28((bool)0); DrivenRectTransformTracker_t4185719096 * L_12 = __this->get_address_of_m_Tracker_36(); DrivenRectTransformTracker_Clear_m309315364(L_12, /*hidden argument*/NULL); Vector2_t4282066565 L_13 = Vector2_get_zero_m199872368(NULL /*static, unused*/, /*hidden argument*/NULL); __this->set_m_Velocity_23(L_13); RectTransform_t972643934 * L_14 = ScrollRect_get_rectTransform_m836427513(__this, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(LayoutRebuilder_t1942933988_il2cpp_TypeInfo_var); LayoutRebuilder_MarkLayoutForRebuild_m901621521(NULL /*static, unused*/, L_14, /*hidden argument*/NULL); UIBehaviour_OnDisable_m1347100067(__this, /*hidden argument*/NULL); return; } } // System.Boolean UnityEngine.UI.ScrollRect::IsActive() extern "C" bool ScrollRect_IsActive_m1128064300 (ScrollRect_t3606982749 * __this, const MethodInfo* method) { int32_t G_B3_0 = 0; { bool L_0 = UIBehaviour_IsActive_m3417391654(__this, /*hidden argument*/NULL); if (!L_0) { goto IL_0019; } } { RectTransform_t972643934 * L_1 = __this->get_m_Content_2(); bool L_2 = Object_op_Inequality_m1296218211(NULL /*static, unused*/, L_1, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); G_B3_0 = ((int32_t)(L_2)); goto IL_001a; } IL_0019: { G_B3_0 = 0; } IL_001a: { return (bool)G_B3_0; } } // System.Void UnityEngine.UI.ScrollRect::EnsureLayoutHasRebuilt() extern Il2CppClass* CanvasUpdateRegistry_t192658922_il2cpp_TypeInfo_var; extern const uint32_t ScrollRect_EnsureLayoutHasRebuilt_m1972800323_MetadataUsageId; extern "C" void ScrollRect_EnsureLayoutHasRebuilt_m1972800323 (ScrollRect_t3606982749 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (ScrollRect_EnsureLayoutHasRebuilt_m1972800323_MetadataUsageId); s_Il2CppMethodIntialized = true; } { bool L_0 = __this->get_m_HasRebuiltLayout_28(); if (L_0) { goto IL_001a; } } { IL2CPP_RUNTIME_CLASS_INIT(CanvasUpdateRegistry_t192658922_il2cpp_TypeInfo_var); bool L_1 = CanvasUpdateRegistry_IsRebuildingLayout_m1167551012(NULL /*static, unused*/, /*hidden argument*/NULL); if (L_1) { goto IL_001a; } } { Canvas_ForceUpdateCanvases_m1970133101(NULL /*static, unused*/, /*hidden argument*/NULL); } IL_001a: { return; } } // System.Void UnityEngine.UI.ScrollRect::StopMovement() extern "C" void ScrollRect_StopMovement_m4209251323 (ScrollRect_t3606982749 * __this, const MethodInfo* method) { { Vector2_t4282066565 L_0 = Vector2_get_zero_m199872368(NULL /*static, unused*/, /*hidden argument*/NULL); __this->set_m_Velocity_23(L_0); return; } } // System.Void UnityEngine.UI.ScrollRect::OnScroll(UnityEngine.EventSystems.PointerEventData) extern Il2CppClass* Mathf_t4203372500_il2cpp_TypeInfo_var; extern const uint32_t ScrollRect_OnScroll_m2633232840_MetadataUsageId; extern "C" void ScrollRect_OnScroll_m2633232840 (ScrollRect_t3606982749 * __this, PointerEventData_t1848751023 * ___data0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (ScrollRect_OnScroll_m2633232840_MetadataUsageId); s_Il2CppMethodIntialized = true; } Vector2_t4282066565 V_0; memset(&V_0, 0, sizeof(V_0)); Vector2_t4282066565 V_1; memset(&V_1, 0, sizeof(V_1)); { bool L_0 = VirtFuncInvoker0< bool >::Invoke(9 /* System.Boolean UnityEngine.UI.ScrollRect::IsActive() */, __this); if (L_0) { goto IL_000c; } } { return; } IL_000c: { ScrollRect_EnsureLayoutHasRebuilt_m1972800323(__this, /*hidden argument*/NULL); ScrollRect_UpdateBounds_m1752242888(__this, /*hidden argument*/NULL); PointerEventData_t1848751023 * L_1 = ___data0; NullCheck(L_1); Vector2_t4282066565 L_2 = PointerEventData_get_scrollDelta_m3602781717(L_1, /*hidden argument*/NULL); V_0 = L_2; Vector2_t4282066565 * L_3 = (&V_0); float L_4 = L_3->get_y_2(); L_3->set_y_2(((float)((float)L_4*(float)(-1.0f)))); bool L_5 = ScrollRect_get_vertical_m135712059(__this, /*hidden argument*/NULL); if (!L_5) { goto IL_007f; } } { bool L_6 = ScrollRect_get_horizontal_m3680042345(__this, /*hidden argument*/NULL); if (L_6) { goto IL_007f; } } { float L_7 = (&V_0)->get_x_1(); IL2CPP_RUNTIME_CLASS_INIT(Mathf_t4203372500_il2cpp_TypeInfo_var); float L_8 = fabsf(L_7); float L_9 = (&V_0)->get_y_2(); float L_10 = fabsf(L_9); if ((!(((float)L_8) > ((float)L_10)))) { goto IL_0073; } } { float L_11 = (&V_0)->get_x_1(); (&V_0)->set_y_2(L_11); } IL_0073: { (&V_0)->set_x_1((0.0f)); } IL_007f: { bool L_12 = ScrollRect_get_horizontal_m3680042345(__this, /*hidden argument*/NULL); if (!L_12) { goto IL_00cc; } } { bool L_13 = ScrollRect_get_vertical_m135712059(__this, /*hidden argument*/NULL); if (L_13) { goto IL_00cc; } } { float L_14 = (&V_0)->get_y_2(); IL2CPP_RUNTIME_CLASS_INIT(Mathf_t4203372500_il2cpp_TypeInfo_var); float L_15 = fabsf(L_14); float L_16 = (&V_0)->get_x_1(); float L_17 = fabsf(L_16); if ((!(((float)L_15) > ((float)L_17)))) { goto IL_00c0; } } { float L_18 = (&V_0)->get_y_2(); (&V_0)->set_x_1(L_18); } IL_00c0: { (&V_0)->set_y_2((0.0f)); } IL_00cc: { RectTransform_t972643934 * L_19 = __this->get_m_Content_2(); NullCheck(L_19); Vector2_t4282066565 L_20 = RectTransform_get_anchoredPosition_m2318455998(L_19, /*hidden argument*/NULL); V_1 = L_20; Vector2_t4282066565 L_21 = V_1; Vector2_t4282066565 L_22 = V_0; float L_23 = __this->get_m_ScrollSensitivity_9(); Vector2_t4282066565 L_24 = Vector2_op_Multiply_m1738245082(NULL /*static, unused*/, L_22, L_23, /*hidden argument*/NULL); Vector2_t4282066565 L_25 = Vector2_op_Addition_m1173049553(NULL /*static, unused*/, L_21, L_24, /*hidden argument*/NULL); V_1 = L_25; int32_t L_26 = __this->get_m_MovementType_5(); if ((!(((uint32_t)L_26) == ((uint32_t)2)))) { goto IL_0115; } } { Vector2_t4282066565 L_27 = V_1; Vector2_t4282066565 L_28 = V_1; RectTransform_t972643934 * L_29 = __this->get_m_Content_2(); NullCheck(L_29); Vector2_t4282066565 L_30 = RectTransform_get_anchoredPosition_m2318455998(L_29, /*hidden argument*/NULL); Vector2_t4282066565 L_31 = Vector2_op_Subtraction_m2097149401(NULL /*static, unused*/, L_28, L_30, /*hidden argument*/NULL); Vector2_t4282066565 L_32 = ScrollRect_CalculateOffset_m224839950(__this, L_31, /*hidden argument*/NULL); Vector2_t4282066565 L_33 = Vector2_op_Addition_m1173049553(NULL /*static, unused*/, L_27, L_32, /*hidden argument*/NULL); V_1 = L_33; } IL_0115: { Vector2_t4282066565 L_34 = V_1; VirtActionInvoker1< Vector2_t4282066565 >::Invoke(46 /* System.Void UnityEngine.UI.ScrollRect::SetContentAnchoredPosition(UnityEngine.Vector2) */, __this, L_34); ScrollRect_UpdateBounds_m1752242888(__this, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.UI.ScrollRect::OnInitializePotentialDrag(UnityEngine.EventSystems.PointerEventData) extern "C" void ScrollRect_OnInitializePotentialDrag_m2313515395 (ScrollRect_t3606982749 * __this, PointerEventData_t1848751023 * ___eventData0, const MethodInfo* method) { { PointerEventData_t1848751023 * L_0 = ___eventData0; NullCheck(L_0); int32_t L_1 = PointerEventData_get_button_m796143251(L_0, /*hidden argument*/NULL); if (!L_1) { goto IL_000c; } } { return; } IL_000c: { Vector2_t4282066565 L_2 = Vector2_get_zero_m199872368(NULL /*static, unused*/, /*hidden argument*/NULL); __this->set_m_Velocity_23(L_2); return; } } // System.Void UnityEngine.UI.ScrollRect::OnBeginDrag(UnityEngine.EventSystems.PointerEventData) extern Il2CppClass* RectTransformUtility_t3025555048_il2cpp_TypeInfo_var; extern const uint32_t ScrollRect_OnBeginDrag_m1465783272_MetadataUsageId; extern "C" void ScrollRect_OnBeginDrag_m1465783272 (ScrollRect_t3606982749 * __this, PointerEventData_t1848751023 * ___eventData0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (ScrollRect_OnBeginDrag_m1465783272_MetadataUsageId); s_Il2CppMethodIntialized = true; } { PointerEventData_t1848751023 * L_0 = ___eventData0; NullCheck(L_0); int32_t L_1 = PointerEventData_get_button_m796143251(L_0, /*hidden argument*/NULL); if (!L_1) { goto IL_000c; } } { return; } IL_000c: { bool L_2 = VirtFuncInvoker0< bool >::Invoke(9 /* System.Boolean UnityEngine.UI.ScrollRect::IsActive() */, __this); if (L_2) { goto IL_0018; } } { return; } IL_0018: { ScrollRect_UpdateBounds_m1752242888(__this, /*hidden argument*/NULL); Vector2_t4282066565 L_3 = Vector2_get_zero_m199872368(NULL /*static, unused*/, /*hidden argument*/NULL); __this->set_m_PointerStartLocalCursor_18(L_3); RectTransform_t972643934 * L_4 = ScrollRect_get_viewRect_m911909082(__this, /*hidden argument*/NULL); PointerEventData_t1848751023 * L_5 = ___eventData0; NullCheck(L_5); Vector2_t4282066565 L_6 = PointerEventData_get_position_m2263123361(L_5, /*hidden argument*/NULL); PointerEventData_t1848751023 * L_7 = ___eventData0; NullCheck(L_7); Camera_t2727095145 * L_8 = PointerEventData_get_pressEventCamera_m2764092724(L_7, /*hidden argument*/NULL); Vector2_t4282066565 * L_9 = __this->get_address_of_m_PointerStartLocalCursor_18(); IL2CPP_RUNTIME_CLASS_INIT(RectTransformUtility_t3025555048_il2cpp_TypeInfo_var); RectTransformUtility_ScreenPointToLocalPointInRectangle_m666650172(NULL /*static, unused*/, L_4, L_6, L_8, L_9, /*hidden argument*/NULL); RectTransform_t972643934 * L_10 = __this->get_m_Content_2(); NullCheck(L_10); Vector2_t4282066565 L_11 = RectTransform_get_anchoredPosition_m2318455998(L_10, /*hidden argument*/NULL); __this->set_m_ContentStartPosition_19(L_11); __this->set_m_Dragging_24((bool)1); return; } } // System.Void UnityEngine.UI.ScrollRect::OnEndDrag(UnityEngine.EventSystems.PointerEventData) extern "C" void ScrollRect_OnEndDrag_m1604287350 (ScrollRect_t3606982749 * __this, PointerEventData_t1848751023 * ___eventData0, const MethodInfo* method) { { PointerEventData_t1848751023 * L_0 = ___eventData0; NullCheck(L_0); int32_t L_1 = PointerEventData_get_button_m796143251(L_0, /*hidden argument*/NULL); if (!L_1) { goto IL_000c; } } { return; } IL_000c: { __this->set_m_Dragging_24((bool)0); return; } } // System.Void UnityEngine.UI.ScrollRect::OnDrag(UnityEngine.EventSystems.PointerEventData) extern Il2CppClass* RectTransformUtility_t3025555048_il2cpp_TypeInfo_var; extern const uint32_t ScrollRect_OnDrag_m286963457_MetadataUsageId; extern "C" void ScrollRect_OnDrag_m286963457 (ScrollRect_t3606982749 * __this, PointerEventData_t1848751023 * ___eventData0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (ScrollRect_OnDrag_m286963457_MetadataUsageId); s_Il2CppMethodIntialized = true; } Vector2_t4282066565 V_0; memset(&V_0, 0, sizeof(V_0)); Vector2_t4282066565 V_1; memset(&V_1, 0, sizeof(V_1)); Vector2_t4282066565 V_2; memset(&V_2, 0, sizeof(V_2)); Vector2_t4282066565 V_3; memset(&V_3, 0, sizeof(V_3)); Vector3_t4282066566 V_4; memset(&V_4, 0, sizeof(V_4)); Vector3_t4282066566 V_5; memset(&V_5, 0, sizeof(V_5)); { PointerEventData_t1848751023 * L_0 = ___eventData0; NullCheck(L_0); int32_t L_1 = PointerEventData_get_button_m796143251(L_0, /*hidden argument*/NULL); if (!L_1) { goto IL_000c; } } { return; } IL_000c: { bool L_2 = VirtFuncInvoker0< bool >::Invoke(9 /* System.Boolean UnityEngine.UI.ScrollRect::IsActive() */, __this); if (L_2) { goto IL_0018; } } { return; } IL_0018: { RectTransform_t972643934 * L_3 = ScrollRect_get_viewRect_m911909082(__this, /*hidden argument*/NULL); PointerEventData_t1848751023 * L_4 = ___eventData0; NullCheck(L_4); Vector2_t4282066565 L_5 = PointerEventData_get_position_m2263123361(L_4, /*hidden argument*/NULL); PointerEventData_t1848751023 * L_6 = ___eventData0; NullCheck(L_6); Camera_t2727095145 * L_7 = PointerEventData_get_pressEventCamera_m2764092724(L_6, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(RectTransformUtility_t3025555048_il2cpp_TypeInfo_var); bool L_8 = RectTransformUtility_ScreenPointToLocalPointInRectangle_m666650172(NULL /*static, unused*/, L_3, L_5, L_7, (&V_0), /*hidden argument*/NULL); if (L_8) { goto IL_0037; } } { return; } IL_0037: { ScrollRect_UpdateBounds_m1752242888(__this, /*hidden argument*/NULL); Vector2_t4282066565 L_9 = V_0; Vector2_t4282066565 L_10 = __this->get_m_PointerStartLocalCursor_18(); Vector2_t4282066565 L_11 = Vector2_op_Subtraction_m2097149401(NULL /*static, unused*/, L_9, L_10, /*hidden argument*/NULL); V_1 = L_11; Vector2_t4282066565 L_12 = __this->get_m_ContentStartPosition_19(); Vector2_t4282066565 L_13 = V_1; Vector2_t4282066565 L_14 = Vector2_op_Addition_m1173049553(NULL /*static, unused*/, L_12, L_13, /*hidden argument*/NULL); V_2 = L_14; Vector2_t4282066565 L_15 = V_2; RectTransform_t972643934 * L_16 = __this->get_m_Content_2(); NullCheck(L_16); Vector2_t4282066565 L_17 = RectTransform_get_anchoredPosition_m2318455998(L_16, /*hidden argument*/NULL); Vector2_t4282066565 L_18 = Vector2_op_Subtraction_m2097149401(NULL /*static, unused*/, L_15, L_17, /*hidden argument*/NULL); Vector2_t4282066565 L_19 = ScrollRect_CalculateOffset_m224839950(__this, L_18, /*hidden argument*/NULL); V_3 = L_19; Vector2_t4282066565 L_20 = V_2; Vector2_t4282066565 L_21 = V_3; Vector2_t4282066565 L_22 = Vector2_op_Addition_m1173049553(NULL /*static, unused*/, L_20, L_21, /*hidden argument*/NULL); V_2 = L_22; int32_t L_23 = __this->get_m_MovementType_5(); if ((!(((uint32_t)L_23) == ((uint32_t)1)))) { goto IL_0103; } } { float L_24 = (&V_3)->get_x_1(); if ((((float)L_24) == ((float)(0.0f)))) { goto IL_00c3; } } { float L_25 = (&V_2)->get_x_1(); float L_26 = (&V_3)->get_x_1(); Bounds_t2711641849 * L_27 = __this->get_address_of_m_ViewBounds_22(); Vector3_t4282066566 L_28 = Bounds_get_size_m3666348432(L_27, /*hidden argument*/NULL); V_4 = L_28; float L_29 = (&V_4)->get_x_1(); float L_30 = ScrollRect_RubberDelta_m403235940(NULL /*static, unused*/, L_26, L_29, /*hidden argument*/NULL); (&V_2)->set_x_1(((float)((float)L_25-(float)L_30))); } IL_00c3: { float L_31 = (&V_3)->get_y_2(); if ((((float)L_31) == ((float)(0.0f)))) { goto IL_0103; } } { float L_32 = (&V_2)->get_y_2(); float L_33 = (&V_3)->get_y_2(); Bounds_t2711641849 * L_34 = __this->get_address_of_m_ViewBounds_22(); Vector3_t4282066566 L_35 = Bounds_get_size_m3666348432(L_34, /*hidden argument*/NULL); V_5 = L_35; float L_36 = (&V_5)->get_y_2(); float L_37 = ScrollRect_RubberDelta_m403235940(NULL /*static, unused*/, L_33, L_36, /*hidden argument*/NULL); (&V_2)->set_y_2(((float)((float)L_32-(float)L_37))); } IL_0103: { Vector2_t4282066565 L_38 = V_2; VirtActionInvoker1< Vector2_t4282066565 >::Invoke(46 /* System.Void UnityEngine.UI.ScrollRect::SetContentAnchoredPosition(UnityEngine.Vector2) */, __this, L_38); return; } } // System.Void UnityEngine.UI.ScrollRect::SetContentAnchoredPosition(UnityEngine.Vector2) extern "C" void ScrollRect_SetContentAnchoredPosition_m716182300 (ScrollRect_t3606982749 * __this, Vector2_t4282066565 ___position0, const MethodInfo* method) { Vector2_t4282066565 V_0; memset(&V_0, 0, sizeof(V_0)); Vector2_t4282066565 V_1; memset(&V_1, 0, sizeof(V_1)); { bool L_0 = __this->get_m_Horizontal_3(); if (L_0) { goto IL_0025; } } { RectTransform_t972643934 * L_1 = __this->get_m_Content_2(); NullCheck(L_1); Vector2_t4282066565 L_2 = RectTransform_get_anchoredPosition_m2318455998(L_1, /*hidden argument*/NULL); V_0 = L_2; float L_3 = (&V_0)->get_x_1(); (&___position0)->set_x_1(L_3); } IL_0025: { bool L_4 = __this->get_m_Vertical_4(); if (L_4) { goto IL_004a; } } { RectTransform_t972643934 * L_5 = __this->get_m_Content_2(); NullCheck(L_5); Vector2_t4282066565 L_6 = RectTransform_get_anchoredPosition_m2318455998(L_5, /*hidden argument*/NULL); V_1 = L_6; float L_7 = (&V_1)->get_y_2(); (&___position0)->set_y_2(L_7); } IL_004a: { Vector2_t4282066565 L_8 = ___position0; RectTransform_t972643934 * L_9 = __this->get_m_Content_2(); NullCheck(L_9); Vector2_t4282066565 L_10 = RectTransform_get_anchoredPosition_m2318455998(L_9, /*hidden argument*/NULL); bool L_11 = Vector2_op_Inequality_m1638984867(NULL /*static, unused*/, L_8, L_10, /*hidden argument*/NULL); if (!L_11) { goto IL_0072; } } { RectTransform_t972643934 * L_12 = __this->get_m_Content_2(); Vector2_t4282066565 L_13 = ___position0; NullCheck(L_12); RectTransform_set_anchoredPosition_m1498949997(L_12, L_13, /*hidden argument*/NULL); ScrollRect_UpdateBounds_m1752242888(__this, /*hidden argument*/NULL); } IL_0072: { return; } } // System.Void UnityEngine.UI.ScrollRect::LateUpdate() extern Il2CppClass* Mathf_t4203372500_il2cpp_TypeInfo_var; extern const MethodInfo* UnityEvent_1_Invoke_m3332953603_MethodInfo_var; extern const uint32_t ScrollRect_LateUpdate_m3780926201_MetadataUsageId; extern "C" void ScrollRect_LateUpdate_m3780926201 (ScrollRect_t3606982749 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (ScrollRect_LateUpdate_m3780926201_MetadataUsageId); s_Il2CppMethodIntialized = true; } float V_0 = 0.0f; Vector2_t4282066565 V_1; memset(&V_1, 0, sizeof(V_1)); Vector2_t4282066565 V_2; memset(&V_2, 0, sizeof(V_2)); int32_t V_3 = 0; float V_4 = 0.0f; Vector3_t4282066566 V_5; memset(&V_5, 0, sizeof(V_5)); Vector2_t4282066565 V_6; memset(&V_6, 0, sizeof(V_6)); Vector2_t4282066565 V_7; memset(&V_7, 0, sizeof(V_7)); Vector2_t4282066565 * V_8 = NULL; int32_t V_9 = 0; float V_10 = 0.0f; Vector2_t4282066565 * V_11 = NULL; { RectTransform_t972643934 * L_0 = __this->get_m_Content_2(); bool L_1 = Object_op_Implicit_m2106766291(NULL /*static, unused*/, L_0, /*hidden argument*/NULL); if (L_1) { goto IL_0011; } } { return; } IL_0011: { ScrollRect_EnsureLayoutHasRebuilt_m1972800323(__this, /*hidden argument*/NULL); ScrollRect_UpdateScrollbarVisibility_m2808994247(__this, /*hidden argument*/NULL); ScrollRect_UpdateBounds_m1752242888(__this, /*hidden argument*/NULL); float L_2 = Time_get_unscaledDeltaTime_m285638843(NULL /*static, unused*/, /*hidden argument*/NULL); V_0 = L_2; Vector2_t4282066565 L_3 = Vector2_get_zero_m199872368(NULL /*static, unused*/, /*hidden argument*/NULL); Vector2_t4282066565 L_4 = ScrollRect_CalculateOffset_m224839950(__this, L_3, /*hidden argument*/NULL); V_1 = L_4; bool L_5 = __this->get_m_Dragging_24(); if (L_5) { goto IL_01fb; } } { Vector2_t4282066565 L_6 = V_1; Vector2_t4282066565 L_7 = Vector2_get_zero_m199872368(NULL /*static, unused*/, /*hidden argument*/NULL); bool L_8 = Vector2_op_Inequality_m1638984867(NULL /*static, unused*/, L_6, L_7, /*hidden argument*/NULL); if (L_8) { goto IL_0065; } } { Vector2_t4282066565 L_9 = __this->get_m_Velocity_23(); Vector2_t4282066565 L_10 = Vector2_get_zero_m199872368(NULL /*static, unused*/, /*hidden argument*/NULL); bool L_11 = Vector2_op_Inequality_m1638984867(NULL /*static, unused*/, L_9, L_10, /*hidden argument*/NULL); if (!L_11) { goto IL_01fb; } } IL_0065: { RectTransform_t972643934 * L_12 = __this->get_m_Content_2(); NullCheck(L_12); Vector2_t4282066565 L_13 = RectTransform_get_anchoredPosition_m2318455998(L_12, /*hidden argument*/NULL); V_2 = L_13; V_3 = 0; goto IL_01ac; } IL_0078: { int32_t L_14 = __this->get_m_MovementType_5(); if ((!(((uint32_t)L_14) == ((uint32_t)1)))) { goto IL_0105; } } { int32_t L_15 = V_3; float L_16 = Vector2_get_Item_m2185542843((&V_1), L_15, /*hidden argument*/NULL); if ((((float)L_16) == ((float)(0.0f)))) { goto IL_0105; } } { Vector2_t4282066565 * L_17 = __this->get_address_of_m_Velocity_23(); int32_t L_18 = V_3; float L_19 = Vector2_get_Item_m2185542843(L_17, L_18, /*hidden argument*/NULL); V_4 = L_19; int32_t L_20 = V_3; RectTransform_t972643934 * L_21 = __this->get_m_Content_2(); NullCheck(L_21); Vector2_t4282066565 L_22 = RectTransform_get_anchoredPosition_m2318455998(L_21, /*hidden argument*/NULL); V_6 = L_22; int32_t L_23 = V_3; float L_24 = Vector2_get_Item_m2185542843((&V_6), L_23, /*hidden argument*/NULL); RectTransform_t972643934 * L_25 = __this->get_m_Content_2(); NullCheck(L_25); Vector2_t4282066565 L_26 = RectTransform_get_anchoredPosition_m2318455998(L_25, /*hidden argument*/NULL); V_7 = L_26; int32_t L_27 = V_3; float L_28 = Vector2_get_Item_m2185542843((&V_7), L_27, /*hidden argument*/NULL); int32_t L_29 = V_3; float L_30 = Vector2_get_Item_m2185542843((&V_1), L_29, /*hidden argument*/NULL); float L_31 = __this->get_m_Elasticity_6(); float L_32 = V_0; IL2CPP_RUNTIME_CLASS_INIT(Mathf_t4203372500_il2cpp_TypeInfo_var); float L_33 = Mathf_SmoothDamp_m779170481(NULL /*static, unused*/, L_24, ((float)((float)L_28+(float)L_30)), (&V_4), L_31, (std::numeric_limits<float>::infinity()), L_32, /*hidden argument*/NULL); Vector2_set_Item_m2767519328((&V_2), L_20, L_33, /*hidden argument*/NULL); Vector2_t4282066565 * L_34 = __this->get_address_of_m_Velocity_23(); int32_t L_35 = V_3; float L_36 = V_4; Vector2_set_Item_m2767519328(L_34, L_35, L_36, /*hidden argument*/NULL); goto IL_01a8; } IL_0105: { bool L_37 = __this->get_m_Inertia_7(); if (!L_37) { goto IL_0197; } } { Vector2_t4282066565 * L_38 = __this->get_address_of_m_Velocity_23(); Vector2_t4282066565 * L_39 = L_38; V_8 = (Vector2_t4282066565 *)L_39; int32_t L_40 = V_3; int32_t L_41 = L_40; V_9 = L_41; Vector2_t4282066565 * L_42 = V_8; int32_t L_43 = V_9; float L_44 = Vector2_get_Item_m2185542843(L_42, L_43, /*hidden argument*/NULL); V_10 = L_44; float L_45 = V_10; float L_46 = __this->get_m_DecelerationRate_8(); float L_47 = V_0; IL2CPP_RUNTIME_CLASS_INIT(Mathf_t4203372500_il2cpp_TypeInfo_var); float L_48 = powf(L_46, L_47); Vector2_set_Item_m2767519328(L_39, L_41, ((float)((float)L_45*(float)L_48)), /*hidden argument*/NULL); Vector2_t4282066565 * L_49 = __this->get_address_of_m_Velocity_23(); int32_t L_50 = V_3; float L_51 = Vector2_get_Item_m2185542843(L_49, L_50, /*hidden argument*/NULL); float L_52 = fabsf(L_51); if ((!(((float)L_52) < ((float)(1.0f))))) { goto IL_0168; } } { Vector2_t4282066565 * L_53 = __this->get_address_of_m_Velocity_23(); int32_t L_54 = V_3; Vector2_set_Item_m2767519328(L_53, L_54, (0.0f), /*hidden argument*/NULL); } IL_0168: { Vector2_t4282066565 * L_55 = (&V_2); V_11 = (Vector2_t4282066565 *)L_55; int32_t L_56 = V_3; int32_t L_57 = L_56; V_9 = L_57; Vector2_t4282066565 * L_58 = V_11; int32_t L_59 = V_9; float L_60 = Vector2_get_Item_m2185542843(L_58, L_59, /*hidden argument*/NULL); V_10 = L_60; float L_61 = V_10; Vector2_t4282066565 * L_62 = __this->get_address_of_m_Velocity_23(); int32_t L_63 = V_3; float L_64 = Vector2_get_Item_m2185542843(L_62, L_63, /*hidden argument*/NULL); float L_65 = V_0; Vector2_set_Item_m2767519328(L_55, L_57, ((float)((float)L_61+(float)((float)((float)L_64*(float)L_65)))), /*hidden argument*/NULL); goto IL_01a8; } IL_0197: { Vector2_t4282066565 * L_66 = __this->get_address_of_m_Velocity_23(); int32_t L_67 = V_3; Vector2_set_Item_m2767519328(L_66, L_67, (0.0f), /*hidden argument*/NULL); } IL_01a8: { int32_t L_68 = V_3; V_3 = ((int32_t)((int32_t)L_68+(int32_t)1)); } IL_01ac: { int32_t L_69 = V_3; if ((((int32_t)L_69) < ((int32_t)2))) { goto IL_0078; } } { Vector2_t4282066565 L_70 = __this->get_m_Velocity_23(); Vector2_t4282066565 L_71 = Vector2_get_zero_m199872368(NULL /*static, unused*/, /*hidden argument*/NULL); bool L_72 = Vector2_op_Inequality_m1638984867(NULL /*static, unused*/, L_70, L_71, /*hidden argument*/NULL); if (!L_72) { goto IL_01fb; } } { int32_t L_73 = __this->get_m_MovementType_5(); if ((!(((uint32_t)L_73) == ((uint32_t)2)))) { goto IL_01f4; } } { Vector2_t4282066565 L_74 = V_2; RectTransform_t972643934 * L_75 = __this->get_m_Content_2(); NullCheck(L_75); Vector2_t4282066565 L_76 = RectTransform_get_anchoredPosition_m2318455998(L_75, /*hidden argument*/NULL); Vector2_t4282066565 L_77 = Vector2_op_Subtraction_m2097149401(NULL /*static, unused*/, L_74, L_76, /*hidden argument*/NULL); Vector2_t4282066565 L_78 = ScrollRect_CalculateOffset_m224839950(__this, L_77, /*hidden argument*/NULL); V_1 = L_78; Vector2_t4282066565 L_79 = V_2; Vector2_t4282066565 L_80 = V_1; Vector2_t4282066565 L_81 = Vector2_op_Addition_m1173049553(NULL /*static, unused*/, L_79, L_80, /*hidden argument*/NULL); V_2 = L_81; } IL_01f4: { Vector2_t4282066565 L_82 = V_2; VirtActionInvoker1< Vector2_t4282066565 >::Invoke(46 /* System.Void UnityEngine.UI.ScrollRect::SetContentAnchoredPosition(UnityEngine.Vector2) */, __this, L_82); } IL_01fb: { bool L_83 = __this->get_m_Dragging_24(); if (!L_83) { goto IL_0258; } } { bool L_84 = __this->get_m_Inertia_7(); if (!L_84) { goto IL_0258; } } { RectTransform_t972643934 * L_85 = __this->get_m_Content_2(); NullCheck(L_85); Vector2_t4282066565 L_86 = RectTransform_get_anchoredPosition_m2318455998(L_85, /*hidden argument*/NULL); Vector2_t4282066565 L_87 = __this->get_m_PrevPosition_25(); Vector2_t4282066565 L_88 = Vector2_op_Subtraction_m2097149401(NULL /*static, unused*/, L_86, L_87, /*hidden argument*/NULL); float L_89 = V_0; Vector2_t4282066565 L_90 = Vector2_op_Division_m747627697(NULL /*static, unused*/, L_88, L_89, /*hidden argument*/NULL); Vector3_t4282066566 L_91 = Vector2_op_Implicit_m482286037(NULL /*static, unused*/, L_90, /*hidden argument*/NULL); V_5 = L_91; Vector2_t4282066565 L_92 = __this->get_m_Velocity_23(); Vector3_t4282066566 L_93 = Vector2_op_Implicit_m482286037(NULL /*static, unused*/, L_92, /*hidden argument*/NULL); Vector3_t4282066566 L_94 = V_5; float L_95 = V_0; Vector3_t4282066566 L_96 = Vector3_Lerp_m650470329(NULL /*static, unused*/, L_93, L_94, ((float)((float)L_95*(float)(10.0f))), /*hidden argument*/NULL); Vector2_t4282066565 L_97 = Vector2_op_Implicit_m4083860659(NULL /*static, unused*/, L_96, /*hidden argument*/NULL); __this->set_m_Velocity_23(L_97); } IL_0258: { Bounds_t2711641849 L_98 = __this->get_m_ViewBounds_22(); Bounds_t2711641849 L_99 = __this->get_m_PrevViewBounds_27(); bool L_100 = Bounds_op_Inequality_m4292292377(NULL /*static, unused*/, L_98, L_99, /*hidden argument*/NULL); if (L_100) { goto IL_029f; } } { Bounds_t2711641849 L_101 = __this->get_m_ContentBounds_21(); Bounds_t2711641849 L_102 = __this->get_m_PrevContentBounds_26(); bool L_103 = Bounds_op_Inequality_m4292292377(NULL /*static, unused*/, L_101, L_102, /*hidden argument*/NULL); if (L_103) { goto IL_029f; } } { RectTransform_t972643934 * L_104 = __this->get_m_Content_2(); NullCheck(L_104); Vector2_t4282066565 L_105 = RectTransform_get_anchoredPosition_m2318455998(L_104, /*hidden argument*/NULL); Vector2_t4282066565 L_106 = __this->get_m_PrevPosition_25(); bool L_107 = Vector2_op_Inequality_m1638984867(NULL /*static, unused*/, L_105, L_106, /*hidden argument*/NULL); if (!L_107) { goto IL_02bd; } } IL_029f: { Vector2_t4282066565 L_108 = V_1; ScrollRect_UpdateScrollbars_m2912536474(__this, L_108, /*hidden argument*/NULL); ScrollRectEvent_t1643322606 * L_109 = __this->get_m_OnValueChanged_17(); Vector2_t4282066565 L_110 = ScrollRect_get_normalizedPosition_m1721330264(__this, /*hidden argument*/NULL); NullCheck(L_109); UnityEvent_1_Invoke_m3332953603(L_109, L_110, /*hidden argument*/UnityEvent_1_Invoke_m3332953603_MethodInfo_var); ScrollRect_UpdatePrevData_m454081040(__this, /*hidden argument*/NULL); } IL_02bd: { return; } } // System.Void UnityEngine.UI.ScrollRect::UpdatePrevData() extern "C" void ScrollRect_UpdatePrevData_m454081040 (ScrollRect_t3606982749 * __this, const MethodInfo* method) { { RectTransform_t972643934 * L_0 = __this->get_m_Content_2(); bool L_1 = Object_op_Equality_m3964590952(NULL /*static, unused*/, L_0, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_1) { goto IL_0021; } } { Vector2_t4282066565 L_2 = Vector2_get_zero_m199872368(NULL /*static, unused*/, /*hidden argument*/NULL); __this->set_m_PrevPosition_25(L_2); goto IL_0032; } IL_0021: { RectTransform_t972643934 * L_3 = __this->get_m_Content_2(); NullCheck(L_3); Vector2_t4282066565 L_4 = RectTransform_get_anchoredPosition_m2318455998(L_3, /*hidden argument*/NULL); __this->set_m_PrevPosition_25(L_4); } IL_0032: { Bounds_t2711641849 L_5 = __this->get_m_ViewBounds_22(); __this->set_m_PrevViewBounds_27(L_5); Bounds_t2711641849 L_6 = __this->get_m_ContentBounds_21(); __this->set_m_PrevContentBounds_26(L_6); return; } } // System.Void UnityEngine.UI.ScrollRect::UpdateScrollbars(UnityEngine.Vector2) extern Il2CppClass* Mathf_t4203372500_il2cpp_TypeInfo_var; extern const uint32_t ScrollRect_UpdateScrollbars_m2912536474_MetadataUsageId; extern "C" void ScrollRect_UpdateScrollbars_m2912536474 (ScrollRect_t3606982749 * __this, Vector2_t4282066565 ___offset0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (ScrollRect_UpdateScrollbars_m2912536474_MetadataUsageId); s_Il2CppMethodIntialized = true; } Vector3_t4282066566 V_0; memset(&V_0, 0, sizeof(V_0)); Vector3_t4282066566 V_1; memset(&V_1, 0, sizeof(V_1)); Vector3_t4282066566 V_2; memset(&V_2, 0, sizeof(V_2)); Vector3_t4282066566 V_3; memset(&V_3, 0, sizeof(V_3)); Vector3_t4282066566 V_4; memset(&V_4, 0, sizeof(V_4)); Vector3_t4282066566 V_5; memset(&V_5, 0, sizeof(V_5)); { Scrollbar_t2601556940 * L_0 = __this->get_m_HorizontalScrollbar_11(); bool L_1 = Object_op_Implicit_m2106766291(NULL /*static, unused*/, L_0, /*hidden argument*/NULL); if (!L_1) { goto IL_0097; } } { Bounds_t2711641849 * L_2 = __this->get_address_of_m_ContentBounds_21(); Vector3_t4282066566 L_3 = Bounds_get_size_m3666348432(L_2, /*hidden argument*/NULL); V_0 = L_3; float L_4 = (&V_0)->get_x_1(); if ((!(((float)L_4) > ((float)(0.0f))))) { goto IL_0076; } } { Scrollbar_t2601556940 * L_5 = __this->get_m_HorizontalScrollbar_11(); Bounds_t2711641849 * L_6 = __this->get_address_of_m_ViewBounds_22(); Vector3_t4282066566 L_7 = Bounds_get_size_m3666348432(L_6, /*hidden argument*/NULL); V_1 = L_7; float L_8 = (&V_1)->get_x_1(); float L_9 = (&___offset0)->get_x_1(); IL2CPP_RUNTIME_CLASS_INIT(Mathf_t4203372500_il2cpp_TypeInfo_var); float L_10 = fabsf(L_9); Bounds_t2711641849 * L_11 = __this->get_address_of_m_ContentBounds_21(); Vector3_t4282066566 L_12 = Bounds_get_size_m3666348432(L_11, /*hidden argument*/NULL); V_2 = L_12; float L_13 = (&V_2)->get_x_1(); float L_14 = Mathf_Clamp01_m2272733930(NULL /*static, unused*/, ((float)((float)((float)((float)L_8-(float)L_10))/(float)L_13)), /*hidden argument*/NULL); NullCheck(L_5); Scrollbar_set_size_m298852062(L_5, L_14, /*hidden argument*/NULL); goto IL_0086; } IL_0076: { Scrollbar_t2601556940 * L_15 = __this->get_m_HorizontalScrollbar_11(); NullCheck(L_15); Scrollbar_set_size_m298852062(L_15, (1.0f), /*hidden argument*/NULL); } IL_0086: { Scrollbar_t2601556940 * L_16 = __this->get_m_HorizontalScrollbar_11(); float L_17 = ScrollRect_get_horizontalNormalizedPosition_m1672288203(__this, /*hidden argument*/NULL); NullCheck(L_16); Scrollbar_set_value_m1765490852(L_16, L_17, /*hidden argument*/NULL); } IL_0097: { Scrollbar_t2601556940 * L_18 = __this->get_m_VerticalScrollbar_12(); bool L_19 = Object_op_Implicit_m2106766291(NULL /*static, unused*/, L_18, /*hidden argument*/NULL); if (!L_19) { goto IL_0130; } } { Bounds_t2711641849 * L_20 = __this->get_address_of_m_ContentBounds_21(); Vector3_t4282066566 L_21 = Bounds_get_size_m3666348432(L_20, /*hidden argument*/NULL); V_3 = L_21; float L_22 = (&V_3)->get_y_2(); if ((!(((float)L_22) > ((float)(0.0f))))) { goto IL_010f; } } { Scrollbar_t2601556940 * L_23 = __this->get_m_VerticalScrollbar_12(); Bounds_t2711641849 * L_24 = __this->get_address_of_m_ViewBounds_22(); Vector3_t4282066566 L_25 = Bounds_get_size_m3666348432(L_24, /*hidden argument*/NULL); V_4 = L_25; float L_26 = (&V_4)->get_y_2(); float L_27 = (&___offset0)->get_y_2(); IL2CPP_RUNTIME_CLASS_INIT(Mathf_t4203372500_il2cpp_TypeInfo_var); float L_28 = fabsf(L_27); Bounds_t2711641849 * L_29 = __this->get_address_of_m_ContentBounds_21(); Vector3_t4282066566 L_30 = Bounds_get_size_m3666348432(L_29, /*hidden argument*/NULL); V_5 = L_30; float L_31 = (&V_5)->get_y_2(); float L_32 = Mathf_Clamp01_m2272733930(NULL /*static, unused*/, ((float)((float)((float)((float)L_26-(float)L_28))/(float)L_31)), /*hidden argument*/NULL); NullCheck(L_23); Scrollbar_set_size_m298852062(L_23, L_32, /*hidden argument*/NULL); goto IL_011f; } IL_010f: { Scrollbar_t2601556940 * L_33 = __this->get_m_VerticalScrollbar_12(); NullCheck(L_33); Scrollbar_set_size_m298852062(L_33, (1.0f), /*hidden argument*/NULL); } IL_011f: { Scrollbar_t2601556940 * L_34 = __this->get_m_VerticalScrollbar_12(); float L_35 = ScrollRect_get_verticalNormalizedPosition_m4163579805(__this, /*hidden argument*/NULL); NullCheck(L_34); Scrollbar_set_value_m1765490852(L_34, L_35, /*hidden argument*/NULL); } IL_0130: { return; } } // UnityEngine.Vector2 UnityEngine.UI.ScrollRect::get_normalizedPosition() extern "C" Vector2_t4282066565 ScrollRect_get_normalizedPosition_m1721330264 (ScrollRect_t3606982749 * __this, const MethodInfo* method) { { float L_0 = ScrollRect_get_horizontalNormalizedPosition_m1672288203(__this, /*hidden argument*/NULL); float L_1 = ScrollRect_get_verticalNormalizedPosition_m4163579805(__this, /*hidden argument*/NULL); Vector2_t4282066565 L_2; memset(&L_2, 0, sizeof(L_2)); Vector2__ctor_m1517109030(&L_2, L_0, L_1, /*hidden argument*/NULL); return L_2; } } // System.Void UnityEngine.UI.ScrollRect::set_normalizedPosition(UnityEngine.Vector2) extern "C" void ScrollRect_set_normalizedPosition_m2973019475 (ScrollRect_t3606982749 * __this, Vector2_t4282066565 ___value0, const MethodInfo* method) { { float L_0 = (&___value0)->get_x_1(); ScrollRect_SetNormalizedPosition_m4196700166(__this, L_0, 0, /*hidden argument*/NULL); float L_1 = (&___value0)->get_y_2(); ScrollRect_SetNormalizedPosition_m4196700166(__this, L_1, 1, /*hidden argument*/NULL); return; } } // System.Single UnityEngine.UI.ScrollRect::get_horizontalNormalizedPosition() extern "C" float ScrollRect_get_horizontalNormalizedPosition_m1672288203 (ScrollRect_t3606982749 * __this, const MethodInfo* method) { Vector3_t4282066566 V_0; memset(&V_0, 0, sizeof(V_0)); Vector3_t4282066566 V_1; memset(&V_1, 0, sizeof(V_1)); Vector3_t4282066566 V_2; memset(&V_2, 0, sizeof(V_2)); Vector3_t4282066566 V_3; memset(&V_3, 0, sizeof(V_3)); Vector3_t4282066566 V_4; memset(&V_4, 0, sizeof(V_4)); Vector3_t4282066566 V_5; memset(&V_5, 0, sizeof(V_5)); Vector3_t4282066566 V_6; memset(&V_6, 0, sizeof(V_6)); Vector3_t4282066566 V_7; memset(&V_7, 0, sizeof(V_7)); int32_t G_B4_0 = 0; { ScrollRect_UpdateBounds_m1752242888(__this, /*hidden argument*/NULL); Bounds_t2711641849 * L_0 = __this->get_address_of_m_ContentBounds_21(); Vector3_t4282066566 L_1 = Bounds_get_size_m3666348432(L_0, /*hidden argument*/NULL); V_0 = L_1; float L_2 = (&V_0)->get_x_1(); Bounds_t2711641849 * L_3 = __this->get_address_of_m_ViewBounds_22(); Vector3_t4282066566 L_4 = Bounds_get_size_m3666348432(L_3, /*hidden argument*/NULL); V_1 = L_4; float L_5 = (&V_1)->get_x_1(); if ((!(((float)L_2) <= ((float)L_5)))) { goto IL_0065; } } { Bounds_t2711641849 * L_6 = __this->get_address_of_m_ViewBounds_22(); Vector3_t4282066566 L_7 = Bounds_get_min_m2329472069(L_6, /*hidden argument*/NULL); V_2 = L_7; float L_8 = (&V_2)->get_x_1(); Bounds_t2711641849 * L_9 = __this->get_address_of_m_ContentBounds_21(); Vector3_t4282066566 L_10 = Bounds_get_min_m2329472069(L_9, /*hidden argument*/NULL); V_3 = L_10; float L_11 = (&V_3)->get_x_1(); if ((!(((float)L_8) > ((float)L_11)))) { goto IL_0062; } } { G_B4_0 = 1; goto IL_0063; } IL_0062: { G_B4_0 = 0; } IL_0063: { return (((float)((float)G_B4_0))); } IL_0065: { Bounds_t2711641849 * L_12 = __this->get_address_of_m_ViewBounds_22(); Vector3_t4282066566 L_13 = Bounds_get_min_m2329472069(L_12, /*hidden argument*/NULL); V_4 = L_13; float L_14 = (&V_4)->get_x_1(); Bounds_t2711641849 * L_15 = __this->get_address_of_m_ContentBounds_21(); Vector3_t4282066566 L_16 = Bounds_get_min_m2329472069(L_15, /*hidden argument*/NULL); V_5 = L_16; float L_17 = (&V_5)->get_x_1(); Bounds_t2711641849 * L_18 = __this->get_address_of_m_ContentBounds_21(); Vector3_t4282066566 L_19 = Bounds_get_size_m3666348432(L_18, /*hidden argument*/NULL); V_6 = L_19; float L_20 = (&V_6)->get_x_1(); Bounds_t2711641849 * L_21 = __this->get_address_of_m_ViewBounds_22(); Vector3_t4282066566 L_22 = Bounds_get_size_m3666348432(L_21, /*hidden argument*/NULL); V_7 = L_22; float L_23 = (&V_7)->get_x_1(); return ((float)((float)((float)((float)L_14-(float)L_17))/(float)((float)((float)L_20-(float)L_23)))); } } // System.Void UnityEngine.UI.ScrollRect::set_horizontalNormalizedPosition(System.Single) extern "C" void ScrollRect_set_horizontalNormalizedPosition_m2007203264 (ScrollRect_t3606982749 * __this, float ___value0, const MethodInfo* method) { { float L_0 = ___value0; ScrollRect_SetNormalizedPosition_m4196700166(__this, L_0, 0, /*hidden argument*/NULL); return; } } // System.Single UnityEngine.UI.ScrollRect::get_verticalNormalizedPosition() extern "C" float ScrollRect_get_verticalNormalizedPosition_m4163579805 (ScrollRect_t3606982749 * __this, const MethodInfo* method) { Vector3_t4282066566 V_0; memset(&V_0, 0, sizeof(V_0)); Vector3_t4282066566 V_1; memset(&V_1, 0, sizeof(V_1)); Vector3_t4282066566 V_2; memset(&V_2, 0, sizeof(V_2)); Vector3_t4282066566 V_3; memset(&V_3, 0, sizeof(V_3)); Vector3_t4282066566 V_4; memset(&V_4, 0, sizeof(V_4)); Vector3_t4282066566 V_5; memset(&V_5, 0, sizeof(V_5)); Vector3_t4282066566 V_6; memset(&V_6, 0, sizeof(V_6)); Vector3_t4282066566 V_7; memset(&V_7, 0, sizeof(V_7)); int32_t G_B4_0 = 0; { ScrollRect_UpdateBounds_m1752242888(__this, /*hidden argument*/NULL); Bounds_t2711641849 * L_0 = __this->get_address_of_m_ContentBounds_21(); Vector3_t4282066566 L_1 = Bounds_get_size_m3666348432(L_0, /*hidden argument*/NULL); V_0 = L_1; float L_2 = (&V_0)->get_y_2(); Bounds_t2711641849 * L_3 = __this->get_address_of_m_ViewBounds_22(); Vector3_t4282066566 L_4 = Bounds_get_size_m3666348432(L_3, /*hidden argument*/NULL); V_1 = L_4; float L_5 = (&V_1)->get_y_2(); if ((!(((float)L_2) <= ((float)L_5)))) { goto IL_0065; } } { Bounds_t2711641849 * L_6 = __this->get_address_of_m_ViewBounds_22(); Vector3_t4282066566 L_7 = Bounds_get_min_m2329472069(L_6, /*hidden argument*/NULL); V_2 = L_7; float L_8 = (&V_2)->get_y_2(); Bounds_t2711641849 * L_9 = __this->get_address_of_m_ContentBounds_21(); Vector3_t4282066566 L_10 = Bounds_get_min_m2329472069(L_9, /*hidden argument*/NULL); V_3 = L_10; float L_11 = (&V_3)->get_y_2(); if ((!(((float)L_8) > ((float)L_11)))) { goto IL_0062; } } { G_B4_0 = 1; goto IL_0063; } IL_0062: { G_B4_0 = 0; } IL_0063: { return (((float)((float)G_B4_0))); } IL_0065: { Bounds_t2711641849 * L_12 = __this->get_address_of_m_ViewBounds_22(); Vector3_t4282066566 L_13 = Bounds_get_min_m2329472069(L_12, /*hidden argument*/NULL); V_4 = L_13; float L_14 = (&V_4)->get_y_2(); Bounds_t2711641849 * L_15 = __this->get_address_of_m_ContentBounds_21(); Vector3_t4282066566 L_16 = Bounds_get_min_m2329472069(L_15, /*hidden argument*/NULL); V_5 = L_16; float L_17 = (&V_5)->get_y_2(); Bounds_t2711641849 * L_18 = __this->get_address_of_m_ContentBounds_21(); Vector3_t4282066566 L_19 = Bounds_get_size_m3666348432(L_18, /*hidden argument*/NULL); V_6 = L_19; float L_20 = (&V_6)->get_y_2(); Bounds_t2711641849 * L_21 = __this->get_address_of_m_ViewBounds_22(); Vector3_t4282066566 L_22 = Bounds_get_size_m3666348432(L_21, /*hidden argument*/NULL); V_7 = L_22; float L_23 = (&V_7)->get_y_2(); return ((float)((float)((float)((float)L_14-(float)L_17))/(float)((float)((float)L_20-(float)L_23)))); } } // System.Void UnityEngine.UI.ScrollRect::set_verticalNormalizedPosition(System.Single) extern "C" void ScrollRect_set_verticalNormalizedPosition_m2636032814 (ScrollRect_t3606982749 * __this, float ___value0, const MethodInfo* method) { { float L_0 = ___value0; ScrollRect_SetNormalizedPosition_m4196700166(__this, L_0, 1, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.UI.ScrollRect::SetHorizontalNormalizedPosition(System.Single) extern "C" void ScrollRect_SetHorizontalNormalizedPosition_m653475821 (ScrollRect_t3606982749 * __this, float ___value0, const MethodInfo* method) { { float L_0 = ___value0; ScrollRect_SetNormalizedPosition_m4196700166(__this, L_0, 0, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.UI.ScrollRect::SetVerticalNormalizedPosition(System.Single) extern "C" void ScrollRect_SetVerticalNormalizedPosition_m3957527707 (ScrollRect_t3606982749 * __this, float ___value0, const MethodInfo* method) { { float L_0 = ___value0; ScrollRect_SetNormalizedPosition_m4196700166(__this, L_0, 1, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.UI.ScrollRect::SetNormalizedPosition(System.Single,System.Int32) extern Il2CppClass* Mathf_t4203372500_il2cpp_TypeInfo_var; extern const uint32_t ScrollRect_SetNormalizedPosition_m4196700166_MetadataUsageId; extern "C" void ScrollRect_SetNormalizedPosition_m4196700166 (ScrollRect_t3606982749 * __this, float ___value0, int32_t ___axis1, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (ScrollRect_SetNormalizedPosition_m4196700166_MetadataUsageId); s_Il2CppMethodIntialized = true; } float V_0 = 0.0f; float V_1 = 0.0f; float V_2 = 0.0f; Vector3_t4282066566 V_3; memset(&V_3, 0, sizeof(V_3)); Vector3_t4282066566 V_4; memset(&V_4, 0, sizeof(V_4)); Vector3_t4282066566 V_5; memset(&V_5, 0, sizeof(V_5)); Vector3_t4282066566 V_6; memset(&V_6, 0, sizeof(V_6)); Vector3_t4282066566 V_7; memset(&V_7, 0, sizeof(V_7)); Vector3_t4282066566 V_8; memset(&V_8, 0, sizeof(V_8)); { ScrollRect_EnsureLayoutHasRebuilt_m1972800323(__this, /*hidden argument*/NULL); ScrollRect_UpdateBounds_m1752242888(__this, /*hidden argument*/NULL); Bounds_t2711641849 * L_0 = __this->get_address_of_m_ContentBounds_21(); Vector3_t4282066566 L_1 = Bounds_get_size_m3666348432(L_0, /*hidden argument*/NULL); V_4 = L_1; int32_t L_2 = ___axis1; float L_3 = Vector3_get_Item_m108333500((&V_4), L_2, /*hidden argument*/NULL); Bounds_t2711641849 * L_4 = __this->get_address_of_m_ViewBounds_22(); Vector3_t4282066566 L_5 = Bounds_get_size_m3666348432(L_4, /*hidden argument*/NULL); V_5 = L_5; int32_t L_6 = ___axis1; float L_7 = Vector3_get_Item_m108333500((&V_5), L_6, /*hidden argument*/NULL); V_0 = ((float)((float)L_3-(float)L_7)); Bounds_t2711641849 * L_8 = __this->get_address_of_m_ViewBounds_22(); Vector3_t4282066566 L_9 = Bounds_get_min_m2329472069(L_8, /*hidden argument*/NULL); V_6 = L_9; int32_t L_10 = ___axis1; float L_11 = Vector3_get_Item_m108333500((&V_6), L_10, /*hidden argument*/NULL); float L_12 = ___value0; float L_13 = V_0; V_1 = ((float)((float)L_11-(float)((float)((float)L_12*(float)L_13)))); RectTransform_t972643934 * L_14 = __this->get_m_Content_2(); NullCheck(L_14); Vector3_t4282066566 L_15 = Transform_get_localPosition_m668140784(L_14, /*hidden argument*/NULL); V_7 = L_15; int32_t L_16 = ___axis1; float L_17 = Vector3_get_Item_m108333500((&V_7), L_16, /*hidden argument*/NULL); float L_18 = V_1; Bounds_t2711641849 * L_19 = __this->get_address_of_m_ContentBounds_21(); Vector3_t4282066566 L_20 = Bounds_get_min_m2329472069(L_19, /*hidden argument*/NULL); V_8 = L_20; int32_t L_21 = ___axis1; float L_22 = Vector3_get_Item_m108333500((&V_8), L_21, /*hidden argument*/NULL); V_2 = ((float)((float)((float)((float)L_17+(float)L_18))-(float)L_22)); RectTransform_t972643934 * L_23 = __this->get_m_Content_2(); NullCheck(L_23); Vector3_t4282066566 L_24 = Transform_get_localPosition_m668140784(L_23, /*hidden argument*/NULL); V_3 = L_24; int32_t L_25 = ___axis1; float L_26 = Vector3_get_Item_m108333500((&V_3), L_25, /*hidden argument*/NULL); float L_27 = V_2; IL2CPP_RUNTIME_CLASS_INIT(Mathf_t4203372500_il2cpp_TypeInfo_var); float L_28 = fabsf(((float)((float)L_26-(float)L_27))); if ((!(((float)L_28) > ((float)(0.01f))))) { goto IL_00d1; } } { int32_t L_29 = ___axis1; float L_30 = V_2; Vector3_set_Item_m1844835745((&V_3), L_29, L_30, /*hidden argument*/NULL); RectTransform_t972643934 * L_31 = __this->get_m_Content_2(); Vector3_t4282066566 L_32 = V_3; NullCheck(L_31); Transform_set_localPosition_m3504330903(L_31, L_32, /*hidden argument*/NULL); Vector2_t4282066565 * L_33 = __this->get_address_of_m_Velocity_23(); int32_t L_34 = ___axis1; Vector2_set_Item_m2767519328(L_33, L_34, (0.0f), /*hidden argument*/NULL); ScrollRect_UpdateBounds_m1752242888(__this, /*hidden argument*/NULL); } IL_00d1: { return; } } // System.Single UnityEngine.UI.ScrollRect::RubberDelta(System.Single,System.Single) extern Il2CppClass* Mathf_t4203372500_il2cpp_TypeInfo_var; extern const uint32_t ScrollRect_RubberDelta_m403235940_MetadataUsageId; extern "C" float ScrollRect_RubberDelta_m403235940 (Il2CppObject * __this /* static, unused */, float ___overStretching0, float ___viewSize1, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (ScrollRect_RubberDelta_m403235940_MetadataUsageId); s_Il2CppMethodIntialized = true; } { float L_0 = ___overStretching0; IL2CPP_RUNTIME_CLASS_INIT(Mathf_t4203372500_il2cpp_TypeInfo_var); float L_1 = fabsf(L_0); float L_2 = ___viewSize1; float L_3 = ___viewSize1; float L_4 = ___overStretching0; float L_5 = Mathf_Sign_m4040614993(NULL /*static, unused*/, L_4, /*hidden argument*/NULL); return ((float)((float)((float)((float)((float)((float)(1.0f)-(float)((float)((float)(1.0f)/(float)((float)((float)((float)((float)((float)((float)L_1*(float)(0.55f)))/(float)L_2))+(float)(1.0f)))))))*(float)L_3))*(float)L_5)); } } // System.Void UnityEngine.UI.ScrollRect::OnRectTransformDimensionsChange() extern "C" void ScrollRect_OnRectTransformDimensionsChange_m2105458366 (ScrollRect_t3606982749 * __this, const MethodInfo* method) { { ScrollRect_SetDirty_m93607546(__this, /*hidden argument*/NULL); return; } } // System.Boolean UnityEngine.UI.ScrollRect::get_hScrollingNeeded() extern "C" bool ScrollRect_get_hScrollingNeeded_m1668641607 (ScrollRect_t3606982749 * __this, const MethodInfo* method) { Vector3_t4282066566 V_0; memset(&V_0, 0, sizeof(V_0)); Vector3_t4282066566 V_1; memset(&V_1, 0, sizeof(V_1)); { bool L_0 = Application_get_isPlaying_m987993960(NULL /*static, unused*/, /*hidden argument*/NULL); if (!L_0) { goto IL_0039; } } { Bounds_t2711641849 * L_1 = __this->get_address_of_m_ContentBounds_21(); Vector3_t4282066566 L_2 = Bounds_get_size_m3666348432(L_1, /*hidden argument*/NULL); V_0 = L_2; float L_3 = (&V_0)->get_x_1(); Bounds_t2711641849 * L_4 = __this->get_address_of_m_ViewBounds_22(); Vector3_t4282066566 L_5 = Bounds_get_size_m3666348432(L_4, /*hidden argument*/NULL); V_1 = L_5; float L_6 = (&V_1)->get_x_1(); return (bool)((((float)L_3) > ((float)((float)((float)L_6+(float)(0.01f)))))? 1 : 0); } IL_0039: { return (bool)1; } } // System.Boolean UnityEngine.UI.ScrollRect::get_vScrollingNeeded() extern "C" bool ScrollRect_get_vScrollingNeeded_m594530553 (ScrollRect_t3606982749 * __this, const MethodInfo* method) { Vector3_t4282066566 V_0; memset(&V_0, 0, sizeof(V_0)); Vector3_t4282066566 V_1; memset(&V_1, 0, sizeof(V_1)); { bool L_0 = Application_get_isPlaying_m987993960(NULL /*static, unused*/, /*hidden argument*/NULL); if (!L_0) { goto IL_0039; } } { Bounds_t2711641849 * L_1 = __this->get_address_of_m_ContentBounds_21(); Vector3_t4282066566 L_2 = Bounds_get_size_m3666348432(L_1, /*hidden argument*/NULL); V_0 = L_2; float L_3 = (&V_0)->get_y_2(); Bounds_t2711641849 * L_4 = __this->get_address_of_m_ViewBounds_22(); Vector3_t4282066566 L_5 = Bounds_get_size_m3666348432(L_4, /*hidden argument*/NULL); V_1 = L_5; float L_6 = (&V_1)->get_y_2(); return (bool)((((float)L_3) > ((float)((float)((float)L_6+(float)(0.01f)))))? 1 : 0); } IL_0039: { return (bool)1; } } // System.Void UnityEngine.UI.ScrollRect::CalculateLayoutInputHorizontal() extern "C" void ScrollRect_CalculateLayoutInputHorizontal_m4036022504 (ScrollRect_t3606982749 * __this, const MethodInfo* method) { { return; } } // System.Void UnityEngine.UI.ScrollRect::CalculateLayoutInputVertical() extern "C" void ScrollRect_CalculateLayoutInputVertical_m4225463418 (ScrollRect_t3606982749 * __this, const MethodInfo* method) { { return; } } // System.Single UnityEngine.UI.ScrollRect::get_minWidth() extern "C" float ScrollRect_get_minWidth_m525847771 (ScrollRect_t3606982749 * __this, const MethodInfo* method) { { return (-1.0f); } } // System.Single UnityEngine.UI.ScrollRect::get_preferredWidth() extern "C" float ScrollRect_get_preferredWidth_m2213910348 (ScrollRect_t3606982749 * __this, const MethodInfo* method) { { return (-1.0f); } } // System.Single UnityEngine.UI.ScrollRect::get_flexibleWidth() extern "C" float ScrollRect_get_flexibleWidth_m2753178742 (ScrollRect_t3606982749 * __this, const MethodInfo* method) { { return (-1.0f); } } // System.Single UnityEngine.UI.ScrollRect::get_minHeight() extern "C" float ScrollRect_get_minHeight_m3920193364 (ScrollRect_t3606982749 * __this, const MethodInfo* method) { { return (-1.0f); } } // System.Single UnityEngine.UI.ScrollRect::get_preferredHeight() extern "C" float ScrollRect_get_preferredHeight_m415558403 (ScrollRect_t3606982749 * __this, const MethodInfo* method) { { return (-1.0f); } } // System.Single UnityEngine.UI.ScrollRect::get_flexibleHeight() extern "C" float ScrollRect_get_flexibleHeight_m4247976729 (ScrollRect_t3606982749 * __this, const MethodInfo* method) { { return (-1.0f); } } // System.Int32 UnityEngine.UI.ScrollRect::get_layoutPriority() extern "C" int32_t ScrollRect_get_layoutPriority_m3681037785 (ScrollRect_t3606982749 * __this, const MethodInfo* method) { { return (-1); } } // System.Void UnityEngine.UI.ScrollRect::SetLayoutHorizontal() extern Il2CppClass* LayoutRebuilder_t1942933988_il2cpp_TypeInfo_var; extern const uint32_t ScrollRect_SetLayoutHorizontal_m1751158760_MetadataUsageId; extern "C" void ScrollRect_SetLayoutHorizontal_m1751158760 (ScrollRect_t3606982749 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (ScrollRect_SetLayoutHorizontal_m1751158760_MetadataUsageId); s_Il2CppMethodIntialized = true; } Rect_t4241904616 V_0; memset(&V_0, 0, sizeof(V_0)); Rect_t4241904616 V_1; memset(&V_1, 0, sizeof(V_1)); Vector2_t4282066565 V_2; memset(&V_2, 0, sizeof(V_2)); Rect_t4241904616 V_3; memset(&V_3, 0, sizeof(V_3)); Rect_t4241904616 V_4; memset(&V_4, 0, sizeof(V_4)); Vector2_t4282066565 V_5; memset(&V_5, 0, sizeof(V_5)); Rect_t4241904616 V_6; memset(&V_6, 0, sizeof(V_6)); Rect_t4241904616 V_7; memset(&V_7, 0, sizeof(V_7)); Vector2_t4282066565 V_8; memset(&V_8, 0, sizeof(V_8)); Vector2_t4282066565 V_9; memset(&V_9, 0, sizeof(V_9)); Vector2_t4282066565 V_10; memset(&V_10, 0, sizeof(V_10)); { DrivenRectTransformTracker_t4185719096 * L_0 = __this->get_address_of_m_Tracker_36(); DrivenRectTransformTracker_Clear_m309315364(L_0, /*hidden argument*/NULL); bool L_1 = __this->get_m_HSliderExpand_29(); if (L_1) { goto IL_0021; } } { bool L_2 = __this->get_m_VSliderExpand_30(); if (!L_2) { goto IL_00ca; } } IL_0021: { DrivenRectTransformTracker_t4185719096 * L_3 = __this->get_address_of_m_Tracker_36(); RectTransform_t972643934 * L_4 = ScrollRect_get_viewRect_m911909082(__this, /*hidden argument*/NULL); DrivenRectTransformTracker_Add_m3461523141(L_3, __this, L_4, ((int32_t)16134), /*hidden argument*/NULL); RectTransform_t972643934 * L_5 = ScrollRect_get_viewRect_m911909082(__this, /*hidden argument*/NULL); Vector2_t4282066565 L_6 = Vector2_get_zero_m199872368(NULL /*static, unused*/, /*hidden argument*/NULL); NullCheck(L_5); RectTransform_set_anchorMin_m989253483(L_5, L_6, /*hidden argument*/NULL); RectTransform_t972643934 * L_7 = ScrollRect_get_viewRect_m911909082(__this, /*hidden argument*/NULL); Vector2_t4282066565 L_8 = Vector2_get_one_m2767488832(NULL /*static, unused*/, /*hidden argument*/NULL); NullCheck(L_7); RectTransform_set_anchorMax_m715345817(L_7, L_8, /*hidden argument*/NULL); RectTransform_t972643934 * L_9 = ScrollRect_get_viewRect_m911909082(__this, /*hidden argument*/NULL); Vector2_t4282066565 L_10 = Vector2_get_zero_m199872368(NULL /*static, unused*/, /*hidden argument*/NULL); NullCheck(L_9); RectTransform_set_sizeDelta_m1223846609(L_9, L_10, /*hidden argument*/NULL); RectTransform_t972643934 * L_11 = ScrollRect_get_viewRect_m911909082(__this, /*hidden argument*/NULL); Vector2_t4282066565 L_12 = Vector2_get_zero_m199872368(NULL /*static, unused*/, /*hidden argument*/NULL); NullCheck(L_11); RectTransform_set_anchoredPosition_m1498949997(L_11, L_12, /*hidden argument*/NULL); RectTransform_t972643934 * L_13 = ScrollRect_get_content_m3701632330(__this, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(LayoutRebuilder_t1942933988_il2cpp_TypeInfo_var); LayoutRebuilder_ForceRebuildLayoutImmediate_m3701079759(NULL /*static, unused*/, L_13, /*hidden argument*/NULL); RectTransform_t972643934 * L_14 = ScrollRect_get_viewRect_m911909082(__this, /*hidden argument*/NULL); NullCheck(L_14); Rect_t4241904616 L_15 = RectTransform_get_rect_m1566017036(L_14, /*hidden argument*/NULL); V_0 = L_15; Vector2_t4282066565 L_16 = Rect_get_center_m610643572((&V_0), /*hidden argument*/NULL); Vector3_t4282066566 L_17 = Vector2_op_Implicit_m482286037(NULL /*static, unused*/, L_16, /*hidden argument*/NULL); RectTransform_t972643934 * L_18 = ScrollRect_get_viewRect_m911909082(__this, /*hidden argument*/NULL); NullCheck(L_18); Rect_t4241904616 L_19 = RectTransform_get_rect_m1566017036(L_18, /*hidden argument*/NULL); V_1 = L_19; Vector2_t4282066565 L_20 = Rect_get_size_m136480416((&V_1), /*hidden argument*/NULL); Vector3_t4282066566 L_21 = Vector2_op_Implicit_m482286037(NULL /*static, unused*/, L_20, /*hidden argument*/NULL); Bounds_t2711641849 L_22; memset(&L_22, 0, sizeof(L_22)); Bounds__ctor_m4160293652(&L_22, L_17, L_21, /*hidden argument*/NULL); __this->set_m_ViewBounds_22(L_22); Bounds_t2711641849 L_23 = ScrollRect_GetBounds_m1535126094(__this, /*hidden argument*/NULL); __this->set_m_ContentBounds_21(L_23); } IL_00ca: { bool L_24 = __this->get_m_VSliderExpand_30(); if (!L_24) { goto IL_0164; } } { bool L_25 = ScrollRect_get_vScrollingNeeded_m594530553(__this, /*hidden argument*/NULL); if (!L_25) { goto IL_0164; } } { RectTransform_t972643934 * L_26 = ScrollRect_get_viewRect_m911909082(__this, /*hidden argument*/NULL); float L_27 = __this->get_m_VSliderWidth_32(); float L_28 = __this->get_m_VerticalScrollbarSpacing_16(); RectTransform_t972643934 * L_29 = ScrollRect_get_viewRect_m911909082(__this, /*hidden argument*/NULL); NullCheck(L_29); Vector2_t4282066565 L_30 = RectTransform_get_sizeDelta_m4279424984(L_29, /*hidden argument*/NULL); V_2 = L_30; float L_31 = (&V_2)->get_y_2(); Vector2_t4282066565 L_32; memset(&L_32, 0, sizeof(L_32)); Vector2__ctor_m1517109030(&L_32, ((-((float)((float)L_27+(float)L_28)))), L_31, /*hidden argument*/NULL); NullCheck(L_26); RectTransform_set_sizeDelta_m1223846609(L_26, L_32, /*hidden argument*/NULL); RectTransform_t972643934 * L_33 = ScrollRect_get_content_m3701632330(__this, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(LayoutRebuilder_t1942933988_il2cpp_TypeInfo_var); LayoutRebuilder_ForceRebuildLayoutImmediate_m3701079759(NULL /*static, unused*/, L_33, /*hidden argument*/NULL); RectTransform_t972643934 * L_34 = ScrollRect_get_viewRect_m911909082(__this, /*hidden argument*/NULL); NullCheck(L_34); Rect_t4241904616 L_35 = RectTransform_get_rect_m1566017036(L_34, /*hidden argument*/NULL); V_3 = L_35; Vector2_t4282066565 L_36 = Rect_get_center_m610643572((&V_3), /*hidden argument*/NULL); Vector3_t4282066566 L_37 = Vector2_op_Implicit_m482286037(NULL /*static, unused*/, L_36, /*hidden argument*/NULL); RectTransform_t972643934 * L_38 = ScrollRect_get_viewRect_m911909082(__this, /*hidden argument*/NULL); NullCheck(L_38); Rect_t4241904616 L_39 = RectTransform_get_rect_m1566017036(L_38, /*hidden argument*/NULL); V_4 = L_39; Vector2_t4282066565 L_40 = Rect_get_size_m136480416((&V_4), /*hidden argument*/NULL); Vector3_t4282066566 L_41 = Vector2_op_Implicit_m482286037(NULL /*static, unused*/, L_40, /*hidden argument*/NULL); Bounds_t2711641849 L_42; memset(&L_42, 0, sizeof(L_42)); Bounds__ctor_m4160293652(&L_42, L_37, L_41, /*hidden argument*/NULL); __this->set_m_ViewBounds_22(L_42); Bounds_t2711641849 L_43 = ScrollRect_GetBounds_m1535126094(__this, /*hidden argument*/NULL); __this->set_m_ContentBounds_21(L_43); } IL_0164: { bool L_44 = __this->get_m_HSliderExpand_29(); if (!L_44) { goto IL_01f5; } } { bool L_45 = ScrollRect_get_hScrollingNeeded_m1668641607(__this, /*hidden argument*/NULL); if (!L_45) { goto IL_01f5; } } { RectTransform_t972643934 * L_46 = ScrollRect_get_viewRect_m911909082(__this, /*hidden argument*/NULL); RectTransform_t972643934 * L_47 = ScrollRect_get_viewRect_m911909082(__this, /*hidden argument*/NULL); NullCheck(L_47); Vector2_t4282066565 L_48 = RectTransform_get_sizeDelta_m4279424984(L_47, /*hidden argument*/NULL); V_5 = L_48; float L_49 = (&V_5)->get_x_1(); float L_50 = __this->get_m_HSliderHeight_31(); float L_51 = __this->get_m_HorizontalScrollbarSpacing_15(); Vector2_t4282066565 L_52; memset(&L_52, 0, sizeof(L_52)); Vector2__ctor_m1517109030(&L_52, L_49, ((-((float)((float)L_50+(float)L_51)))), /*hidden argument*/NULL); NullCheck(L_46); RectTransform_set_sizeDelta_m1223846609(L_46, L_52, /*hidden argument*/NULL); RectTransform_t972643934 * L_53 = ScrollRect_get_viewRect_m911909082(__this, /*hidden argument*/NULL); NullCheck(L_53); Rect_t4241904616 L_54 = RectTransform_get_rect_m1566017036(L_53, /*hidden argument*/NULL); V_6 = L_54; Vector2_t4282066565 L_55 = Rect_get_center_m610643572((&V_6), /*hidden argument*/NULL); Vector3_t4282066566 L_56 = Vector2_op_Implicit_m482286037(NULL /*static, unused*/, L_55, /*hidden argument*/NULL); RectTransform_t972643934 * L_57 = ScrollRect_get_viewRect_m911909082(__this, /*hidden argument*/NULL); NullCheck(L_57); Rect_t4241904616 L_58 = RectTransform_get_rect_m1566017036(L_57, /*hidden argument*/NULL); V_7 = L_58; Vector2_t4282066565 L_59 = Rect_get_size_m136480416((&V_7), /*hidden argument*/NULL); Vector3_t4282066566 L_60 = Vector2_op_Implicit_m482286037(NULL /*static, unused*/, L_59, /*hidden argument*/NULL); Bounds_t2711641849 L_61; memset(&L_61, 0, sizeof(L_61)); Bounds__ctor_m4160293652(&L_61, L_56, L_60, /*hidden argument*/NULL); __this->set_m_ViewBounds_22(L_61); Bounds_t2711641849 L_62 = ScrollRect_GetBounds_m1535126094(__this, /*hidden argument*/NULL); __this->set_m_ContentBounds_21(L_62); } IL_01f5: { bool L_63 = __this->get_m_VSliderExpand_30(); if (!L_63) { goto IL_0279; } } { bool L_64 = ScrollRect_get_vScrollingNeeded_m594530553(__this, /*hidden argument*/NULL); if (!L_64) { goto IL_0279; } } { RectTransform_t972643934 * L_65 = ScrollRect_get_viewRect_m911909082(__this, /*hidden argument*/NULL); NullCheck(L_65); Vector2_t4282066565 L_66 = RectTransform_get_sizeDelta_m4279424984(L_65, /*hidden argument*/NULL); V_8 = L_66; float L_67 = (&V_8)->get_x_1(); if ((!(((float)L_67) == ((float)(0.0f))))) { goto IL_0279; } } { RectTransform_t972643934 * L_68 = ScrollRect_get_viewRect_m911909082(__this, /*hidden argument*/NULL); NullCheck(L_68); Vector2_t4282066565 L_69 = RectTransform_get_sizeDelta_m4279424984(L_68, /*hidden argument*/NULL); V_9 = L_69; float L_70 = (&V_9)->get_y_2(); if ((!(((float)L_70) < ((float)(0.0f))))) { goto IL_0279; } } { RectTransform_t972643934 * L_71 = ScrollRect_get_viewRect_m911909082(__this, /*hidden argument*/NULL); float L_72 = __this->get_m_VSliderWidth_32(); float L_73 = __this->get_m_VerticalScrollbarSpacing_16(); RectTransform_t972643934 * L_74 = ScrollRect_get_viewRect_m911909082(__this, /*hidden argument*/NULL); NullCheck(L_74); Vector2_t4282066565 L_75 = RectTransform_get_sizeDelta_m4279424984(L_74, /*hidden argument*/NULL); V_10 = L_75; float L_76 = (&V_10)->get_y_2(); Vector2_t4282066565 L_77; memset(&L_77, 0, sizeof(L_77)); Vector2__ctor_m1517109030(&L_77, ((-((float)((float)L_72+(float)L_73)))), L_76, /*hidden argument*/NULL); NullCheck(L_71); RectTransform_set_sizeDelta_m1223846609(L_71, L_77, /*hidden argument*/NULL); } IL_0279: { return; } } // System.Void UnityEngine.UI.ScrollRect::SetLayoutVertical() extern "C" void ScrollRect_SetLayoutVertical_m1385100154 (ScrollRect_t3606982749 * __this, const MethodInfo* method) { Rect_t4241904616 V_0; memset(&V_0, 0, sizeof(V_0)); Rect_t4241904616 V_1; memset(&V_1, 0, sizeof(V_1)); { ScrollRect_UpdateScrollbarLayout_m2579760607(__this, /*hidden argument*/NULL); RectTransform_t972643934 * L_0 = ScrollRect_get_viewRect_m911909082(__this, /*hidden argument*/NULL); NullCheck(L_0); Rect_t4241904616 L_1 = RectTransform_get_rect_m1566017036(L_0, /*hidden argument*/NULL); V_0 = L_1; Vector2_t4282066565 L_2 = Rect_get_center_m610643572((&V_0), /*hidden argument*/NULL); Vector3_t4282066566 L_3 = Vector2_op_Implicit_m482286037(NULL /*static, unused*/, L_2, /*hidden argument*/NULL); RectTransform_t972643934 * L_4 = ScrollRect_get_viewRect_m911909082(__this, /*hidden argument*/NULL); NullCheck(L_4); Rect_t4241904616 L_5 = RectTransform_get_rect_m1566017036(L_4, /*hidden argument*/NULL); V_1 = L_5; Vector2_t4282066565 L_6 = Rect_get_size_m136480416((&V_1), /*hidden argument*/NULL); Vector3_t4282066566 L_7 = Vector2_op_Implicit_m482286037(NULL /*static, unused*/, L_6, /*hidden argument*/NULL); Bounds_t2711641849 L_8; memset(&L_8, 0, sizeof(L_8)); Bounds__ctor_m4160293652(&L_8, L_3, L_7, /*hidden argument*/NULL); __this->set_m_ViewBounds_22(L_8); Bounds_t2711641849 L_9 = ScrollRect_GetBounds_m1535126094(__this, /*hidden argument*/NULL); __this->set_m_ContentBounds_21(L_9); return; } } // System.Void UnityEngine.UI.ScrollRect::UpdateScrollbarVisibility() extern "C" void ScrollRect_UpdateScrollbarVisibility_m2808994247 (ScrollRect_t3606982749 * __this, const MethodInfo* method) { { Scrollbar_t2601556940 * L_0 = __this->get_m_VerticalScrollbar_12(); bool L_1 = Object_op_Implicit_m2106766291(NULL /*static, unused*/, L_0, /*hidden argument*/NULL); if (!L_1) { goto IL_004c; } } { int32_t L_2 = __this->get_m_VerticalScrollbarVisibility_14(); if (!L_2) { goto IL_004c; } } { Scrollbar_t2601556940 * L_3 = __this->get_m_VerticalScrollbar_12(); NullCheck(L_3); GameObject_t3674682005 * L_4 = Component_get_gameObject_m1170635899(L_3, /*hidden argument*/NULL); NullCheck(L_4); bool L_5 = GameObject_get_activeSelf_m3858025161(L_4, /*hidden argument*/NULL); bool L_6 = ScrollRect_get_vScrollingNeeded_m594530553(__this, /*hidden argument*/NULL); if ((((int32_t)L_5) == ((int32_t)L_6))) { goto IL_004c; } } { Scrollbar_t2601556940 * L_7 = __this->get_m_VerticalScrollbar_12(); NullCheck(L_7); GameObject_t3674682005 * L_8 = Component_get_gameObject_m1170635899(L_7, /*hidden argument*/NULL); bool L_9 = ScrollRect_get_vScrollingNeeded_m594530553(__this, /*hidden argument*/NULL); NullCheck(L_8); GameObject_SetActive_m3538205401(L_8, L_9, /*hidden argument*/NULL); } IL_004c: { Scrollbar_t2601556940 * L_10 = __this->get_m_HorizontalScrollbar_11(); bool L_11 = Object_op_Implicit_m2106766291(NULL /*static, unused*/, L_10, /*hidden argument*/NULL); if (!L_11) { goto IL_0098; } } { int32_t L_12 = __this->get_m_HorizontalScrollbarVisibility_13(); if (!L_12) { goto IL_0098; } } { Scrollbar_t2601556940 * L_13 = __this->get_m_HorizontalScrollbar_11(); NullCheck(L_13); GameObject_t3674682005 * L_14 = Component_get_gameObject_m1170635899(L_13, /*hidden argument*/NULL); NullCheck(L_14); bool L_15 = GameObject_get_activeSelf_m3858025161(L_14, /*hidden argument*/NULL); bool L_16 = ScrollRect_get_hScrollingNeeded_m1668641607(__this, /*hidden argument*/NULL); if ((((int32_t)L_15) == ((int32_t)L_16))) { goto IL_0098; } } { Scrollbar_t2601556940 * L_17 = __this->get_m_HorizontalScrollbar_11(); NullCheck(L_17); GameObject_t3674682005 * L_18 = Component_get_gameObject_m1170635899(L_17, /*hidden argument*/NULL); bool L_19 = ScrollRect_get_hScrollingNeeded_m1668641607(__this, /*hidden argument*/NULL); NullCheck(L_18); GameObject_SetActive_m3538205401(L_18, L_19, /*hidden argument*/NULL); } IL_0098: { return; } } // System.Void UnityEngine.UI.ScrollRect::UpdateScrollbarLayout() extern "C" void ScrollRect_UpdateScrollbarLayout_m2579760607 (ScrollRect_t3606982749 * __this, const MethodInfo* method) { Vector2_t4282066565 V_0; memset(&V_0, 0, sizeof(V_0)); Vector2_t4282066565 V_1; memset(&V_1, 0, sizeof(V_1)); Vector2_t4282066565 V_2; memset(&V_2, 0, sizeof(V_2)); Vector2_t4282066565 V_3; memset(&V_3, 0, sizeof(V_3)); Vector2_t4282066565 V_4; memset(&V_4, 0, sizeof(V_4)); Vector2_t4282066565 V_5; memset(&V_5, 0, sizeof(V_5)); Vector2_t4282066565 V_6; memset(&V_6, 0, sizeof(V_6)); Vector2_t4282066565 V_7; memset(&V_7, 0, sizeof(V_7)); Vector2_t4282066565 V_8; memset(&V_8, 0, sizeof(V_8)); Vector2_t4282066565 V_9; memset(&V_9, 0, sizeof(V_9)); { bool L_0 = __this->get_m_VSliderExpand_30(); if (!L_0) { goto IL_0114; } } { Scrollbar_t2601556940 * L_1 = __this->get_m_HorizontalScrollbar_11(); bool L_2 = Object_op_Implicit_m2106766291(NULL /*static, unused*/, L_1, /*hidden argument*/NULL); if (!L_2) { goto IL_0114; } } { DrivenRectTransformTracker_t4185719096 * L_3 = __this->get_address_of_m_Tracker_36(); RectTransform_t972643934 * L_4 = __this->get_m_HorizontalScrollbarRect_34(); DrivenRectTransformTracker_Add_m3461523141(L_3, __this, L_4, ((int32_t)5378), /*hidden argument*/NULL); RectTransform_t972643934 * L_5 = __this->get_m_HorizontalScrollbarRect_34(); RectTransform_t972643934 * L_6 = __this->get_m_HorizontalScrollbarRect_34(); NullCheck(L_6); Vector2_t4282066565 L_7 = RectTransform_get_anchorMin_m688674174(L_6, /*hidden argument*/NULL); V_0 = L_7; float L_8 = (&V_0)->get_y_2(); Vector2_t4282066565 L_9; memset(&L_9, 0, sizeof(L_9)); Vector2__ctor_m1517109030(&L_9, (0.0f), L_8, /*hidden argument*/NULL); NullCheck(L_5); RectTransform_set_anchorMin_m989253483(L_5, L_9, /*hidden argument*/NULL); RectTransform_t972643934 * L_10 = __this->get_m_HorizontalScrollbarRect_34(); RectTransform_t972643934 * L_11 = __this->get_m_HorizontalScrollbarRect_34(); NullCheck(L_11); Vector2_t4282066565 L_12 = RectTransform_get_anchorMax_m688445456(L_11, /*hidden argument*/NULL); V_1 = L_12; float L_13 = (&V_1)->get_y_2(); Vector2_t4282066565 L_14; memset(&L_14, 0, sizeof(L_14)); Vector2__ctor_m1517109030(&L_14, (1.0f), L_13, /*hidden argument*/NULL); NullCheck(L_10); RectTransform_set_anchorMax_m715345817(L_10, L_14, /*hidden argument*/NULL); RectTransform_t972643934 * L_15 = __this->get_m_HorizontalScrollbarRect_34(); RectTransform_t972643934 * L_16 = __this->get_m_HorizontalScrollbarRect_34(); NullCheck(L_16); Vector2_t4282066565 L_17 = RectTransform_get_anchoredPosition_m2318455998(L_16, /*hidden argument*/NULL); V_2 = L_17; float L_18 = (&V_2)->get_y_2(); Vector2_t4282066565 L_19; memset(&L_19, 0, sizeof(L_19)); Vector2__ctor_m1517109030(&L_19, (0.0f), L_18, /*hidden argument*/NULL); NullCheck(L_15); RectTransform_set_anchoredPosition_m1498949997(L_15, L_19, /*hidden argument*/NULL); bool L_20 = ScrollRect_get_vScrollingNeeded_m594530553(__this, /*hidden argument*/NULL); if (!L_20) { goto IL_00eb; } } { RectTransform_t972643934 * L_21 = __this->get_m_HorizontalScrollbarRect_34(); float L_22 = __this->get_m_VSliderWidth_32(); float L_23 = __this->get_m_VerticalScrollbarSpacing_16(); RectTransform_t972643934 * L_24 = __this->get_m_HorizontalScrollbarRect_34(); NullCheck(L_24); Vector2_t4282066565 L_25 = RectTransform_get_sizeDelta_m4279424984(L_24, /*hidden argument*/NULL); V_3 = L_25; float L_26 = (&V_3)->get_y_2(); Vector2_t4282066565 L_27; memset(&L_27, 0, sizeof(L_27)); Vector2__ctor_m1517109030(&L_27, ((-((float)((float)L_22+(float)L_23)))), L_26, /*hidden argument*/NULL); NullCheck(L_21); RectTransform_set_sizeDelta_m1223846609(L_21, L_27, /*hidden argument*/NULL); goto IL_0114; } IL_00eb: { RectTransform_t972643934 * L_28 = __this->get_m_HorizontalScrollbarRect_34(); RectTransform_t972643934 * L_29 = __this->get_m_HorizontalScrollbarRect_34(); NullCheck(L_29); Vector2_t4282066565 L_30 = RectTransform_get_sizeDelta_m4279424984(L_29, /*hidden argument*/NULL); V_4 = L_30; float L_31 = (&V_4)->get_y_2(); Vector2_t4282066565 L_32; memset(&L_32, 0, sizeof(L_32)); Vector2__ctor_m1517109030(&L_32, (0.0f), L_31, /*hidden argument*/NULL); NullCheck(L_28); RectTransform_set_sizeDelta_m1223846609(L_28, L_32, /*hidden argument*/NULL); } IL_0114: { bool L_33 = __this->get_m_HSliderExpand_29(); if (!L_33) { goto IL_022c; } } { Scrollbar_t2601556940 * L_34 = __this->get_m_VerticalScrollbar_12(); bool L_35 = Object_op_Implicit_m2106766291(NULL /*static, unused*/, L_34, /*hidden argument*/NULL); if (!L_35) { goto IL_022c; } } { DrivenRectTransformTracker_t4185719096 * L_36 = __this->get_address_of_m_Tracker_36(); RectTransform_t972643934 * L_37 = __this->get_m_VerticalScrollbarRect_35(); DrivenRectTransformTracker_Add_m3461523141(L_36, __this, L_37, ((int32_t)10756), /*hidden argument*/NULL); RectTransform_t972643934 * L_38 = __this->get_m_VerticalScrollbarRect_35(); RectTransform_t972643934 * L_39 = __this->get_m_VerticalScrollbarRect_35(); NullCheck(L_39); Vector2_t4282066565 L_40 = RectTransform_get_anchorMin_m688674174(L_39, /*hidden argument*/NULL); V_5 = L_40; float L_41 = (&V_5)->get_x_1(); Vector2_t4282066565 L_42; memset(&L_42, 0, sizeof(L_42)); Vector2__ctor_m1517109030(&L_42, L_41, (0.0f), /*hidden argument*/NULL); NullCheck(L_38); RectTransform_set_anchorMin_m989253483(L_38, L_42, /*hidden argument*/NULL); RectTransform_t972643934 * L_43 = __this->get_m_VerticalScrollbarRect_35(); RectTransform_t972643934 * L_44 = __this->get_m_VerticalScrollbarRect_35(); NullCheck(L_44); Vector2_t4282066565 L_45 = RectTransform_get_anchorMax_m688445456(L_44, /*hidden argument*/NULL); V_6 = L_45; float L_46 = (&V_6)->get_x_1(); Vector2_t4282066565 L_47; memset(&L_47, 0, sizeof(L_47)); Vector2__ctor_m1517109030(&L_47, L_46, (1.0f), /*hidden argument*/NULL); NullCheck(L_43); RectTransform_set_anchorMax_m715345817(L_43, L_47, /*hidden argument*/NULL); RectTransform_t972643934 * L_48 = __this->get_m_VerticalScrollbarRect_35(); RectTransform_t972643934 * L_49 = __this->get_m_VerticalScrollbarRect_35(); NullCheck(L_49); Vector2_t4282066565 L_50 = RectTransform_get_anchoredPosition_m2318455998(L_49, /*hidden argument*/NULL); V_7 = L_50; float L_51 = (&V_7)->get_x_1(); Vector2_t4282066565 L_52; memset(&L_52, 0, sizeof(L_52)); Vector2__ctor_m1517109030(&L_52, L_51, (0.0f), /*hidden argument*/NULL); NullCheck(L_48); RectTransform_set_anchoredPosition_m1498949997(L_48, L_52, /*hidden argument*/NULL); bool L_53 = ScrollRect_get_hScrollingNeeded_m1668641607(__this, /*hidden argument*/NULL); if (!L_53) { goto IL_0203; } } { RectTransform_t972643934 * L_54 = __this->get_m_VerticalScrollbarRect_35(); RectTransform_t972643934 * L_55 = __this->get_m_VerticalScrollbarRect_35(); NullCheck(L_55); Vector2_t4282066565 L_56 = RectTransform_get_sizeDelta_m4279424984(L_55, /*hidden argument*/NULL); V_8 = L_56; float L_57 = (&V_8)->get_x_1(); float L_58 = __this->get_m_HSliderHeight_31(); float L_59 = __this->get_m_HorizontalScrollbarSpacing_15(); Vector2_t4282066565 L_60; memset(&L_60, 0, sizeof(L_60)); Vector2__ctor_m1517109030(&L_60, L_57, ((-((float)((float)L_58+(float)L_59)))), /*hidden argument*/NULL); NullCheck(L_54); RectTransform_set_sizeDelta_m1223846609(L_54, L_60, /*hidden argument*/NULL); goto IL_022c; } IL_0203: { RectTransform_t972643934 * L_61 = __this->get_m_VerticalScrollbarRect_35(); RectTransform_t972643934 * L_62 = __this->get_m_VerticalScrollbarRect_35(); NullCheck(L_62); Vector2_t4282066565 L_63 = RectTransform_get_sizeDelta_m4279424984(L_62, /*hidden argument*/NULL); V_9 = L_63; float L_64 = (&V_9)->get_x_1(); Vector2_t4282066565 L_65; memset(&L_65, 0, sizeof(L_65)); Vector2__ctor_m1517109030(&L_65, L_64, (0.0f), /*hidden argument*/NULL); NullCheck(L_61); RectTransform_set_sizeDelta_m1223846609(L_61, L_65, /*hidden argument*/NULL); } IL_022c: { return; } } // System.Void UnityEngine.UI.ScrollRect::UpdateBounds() extern "C" void ScrollRect_UpdateBounds_m1752242888 (ScrollRect_t3606982749 * __this, const MethodInfo* method) { Vector3_t4282066566 V_0; memset(&V_0, 0, sizeof(V_0)); Vector3_t4282066566 V_1; memset(&V_1, 0, sizeof(V_1)); Vector3_t4282066566 V_2; memset(&V_2, 0, sizeof(V_2)); Rect_t4241904616 V_3; memset(&V_3, 0, sizeof(V_3)); Rect_t4241904616 V_4; memset(&V_4, 0, sizeof(V_4)); Vector2_t4282066565 V_5; memset(&V_5, 0, sizeof(V_5)); Vector3_t4282066566 V_6; memset(&V_6, 0, sizeof(V_6)); Vector2_t4282066565 V_7; memset(&V_7, 0, sizeof(V_7)); Vector3_t4282066566 V_8; memset(&V_8, 0, sizeof(V_8)); { RectTransform_t972643934 * L_0 = ScrollRect_get_viewRect_m911909082(__this, /*hidden argument*/NULL); NullCheck(L_0); Rect_t4241904616 L_1 = RectTransform_get_rect_m1566017036(L_0, /*hidden argument*/NULL); V_3 = L_1; Vector2_t4282066565 L_2 = Rect_get_center_m610643572((&V_3), /*hidden argument*/NULL); Vector3_t4282066566 L_3 = Vector2_op_Implicit_m482286037(NULL /*static, unused*/, L_2, /*hidden argument*/NULL); RectTransform_t972643934 * L_4 = ScrollRect_get_viewRect_m911909082(__this, /*hidden argument*/NULL); NullCheck(L_4); Rect_t4241904616 L_5 = RectTransform_get_rect_m1566017036(L_4, /*hidden argument*/NULL); V_4 = L_5; Vector2_t4282066565 L_6 = Rect_get_size_m136480416((&V_4), /*hidden argument*/NULL); Vector3_t4282066566 L_7 = Vector2_op_Implicit_m482286037(NULL /*static, unused*/, L_6, /*hidden argument*/NULL); Bounds_t2711641849 L_8; memset(&L_8, 0, sizeof(L_8)); Bounds__ctor_m4160293652(&L_8, L_3, L_7, /*hidden argument*/NULL); __this->set_m_ViewBounds_22(L_8); Bounds_t2711641849 L_9 = ScrollRect_GetBounds_m1535126094(__this, /*hidden argument*/NULL); __this->set_m_ContentBounds_21(L_9); RectTransform_t972643934 * L_10 = __this->get_m_Content_2(); bool L_11 = Object_op_Equality_m3964590952(NULL /*static, unused*/, L_10, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_11) { goto IL_005a; } } { return; } IL_005a: { Bounds_t2711641849 * L_12 = __this->get_address_of_m_ContentBounds_21(); Vector3_t4282066566 L_13 = Bounds_get_size_m3666348432(L_12, /*hidden argument*/NULL); V_0 = L_13; Bounds_t2711641849 * L_14 = __this->get_address_of_m_ContentBounds_21(); Vector3_t4282066566 L_15 = Bounds_get_center_m4084610404(L_14, /*hidden argument*/NULL); V_1 = L_15; Bounds_t2711641849 * L_16 = __this->get_address_of_m_ViewBounds_22(); Vector3_t4282066566 L_17 = Bounds_get_size_m3666348432(L_16, /*hidden argument*/NULL); Vector3_t4282066566 L_18 = V_0; Vector3_t4282066566 L_19 = Vector3_op_Subtraction_m2842958165(NULL /*static, unused*/, L_17, L_18, /*hidden argument*/NULL); V_2 = L_19; float L_20 = (&V_2)->get_x_1(); if ((!(((float)L_20) > ((float)(0.0f))))) { goto IL_00e0; } } { Vector3_t4282066566 * L_21 = (&V_1); float L_22 = L_21->get_x_1(); float L_23 = (&V_2)->get_x_1(); RectTransform_t972643934 * L_24 = __this->get_m_Content_2(); NullCheck(L_24); Vector2_t4282066565 L_25 = RectTransform_get_pivot_m3785570595(L_24, /*hidden argument*/NULL); V_5 = L_25; float L_26 = (&V_5)->get_x_1(); L_21->set_x_1(((float)((float)L_22-(float)((float)((float)L_23*(float)((float)((float)L_26-(float)(0.5f)))))))); Bounds_t2711641849 * L_27 = __this->get_address_of_m_ViewBounds_22(); Vector3_t4282066566 L_28 = Bounds_get_size_m3666348432(L_27, /*hidden argument*/NULL); V_6 = L_28; float L_29 = (&V_6)->get_x_1(); (&V_0)->set_x_1(L_29); } IL_00e0: { float L_30 = (&V_2)->get_y_2(); if ((!(((float)L_30) > ((float)(0.0f))))) { goto IL_013c; } } { Vector3_t4282066566 * L_31 = (&V_1); float L_32 = L_31->get_y_2(); float L_33 = (&V_2)->get_y_2(); RectTransform_t972643934 * L_34 = __this->get_m_Content_2(); NullCheck(L_34); Vector2_t4282066565 L_35 = RectTransform_get_pivot_m3785570595(L_34, /*hidden argument*/NULL); V_7 = L_35; float L_36 = (&V_7)->get_y_2(); L_31->set_y_2(((float)((float)L_32-(float)((float)((float)L_33*(float)((float)((float)L_36-(float)(0.5f)))))))); Bounds_t2711641849 * L_37 = __this->get_address_of_m_ViewBounds_22(); Vector3_t4282066566 L_38 = Bounds_get_size_m3666348432(L_37, /*hidden argument*/NULL); V_8 = L_38; float L_39 = (&V_8)->get_y_2(); (&V_0)->set_y_2(L_39); } IL_013c: { Bounds_t2711641849 * L_40 = __this->get_address_of_m_ContentBounds_21(); Vector3_t4282066566 L_41 = V_0; Bounds_set_size_m4109809039(L_40, L_41, /*hidden argument*/NULL); Bounds_t2711641849 * L_42 = __this->get_address_of_m_ContentBounds_21(); Vector3_t4282066566 L_43 = V_1; Bounds_set_center_m2605643707(L_42, L_43, /*hidden argument*/NULL); return; } } // UnityEngine.Bounds UnityEngine.UI.ScrollRect::GetBounds() extern Il2CppClass* Bounds_t2711641849_il2cpp_TypeInfo_var; extern const uint32_t ScrollRect_GetBounds_m1535126094_MetadataUsageId; extern "C" Bounds_t2711641849 ScrollRect_GetBounds_m1535126094 (ScrollRect_t3606982749 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (ScrollRect_GetBounds_m1535126094_MetadataUsageId); s_Il2CppMethodIntialized = true; } Vector3_t4282066566 V_0; memset(&V_0, 0, sizeof(V_0)); Vector3_t4282066566 V_1; memset(&V_1, 0, sizeof(V_1)); Matrix4x4_t1651859333 V_2; memset(&V_2, 0, sizeof(V_2)); int32_t V_3 = 0; Vector3_t4282066566 V_4; memset(&V_4, 0, sizeof(V_4)); Bounds_t2711641849 V_5; memset(&V_5, 0, sizeof(V_5)); Bounds_t2711641849 V_6; memset(&V_6, 0, sizeof(V_6)); { RectTransform_t972643934 * L_0 = __this->get_m_Content_2(); bool L_1 = Object_op_Equality_m3964590952(NULL /*static, unused*/, L_0, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_1) { goto IL_001c; } } { Initobj (Bounds_t2711641849_il2cpp_TypeInfo_var, (&V_6)); Bounds_t2711641849 L_2 = V_6; return L_2; } IL_001c: { Vector3__ctor_m2926210380((&V_0), (std::numeric_limits<float>::max()), (std::numeric_limits<float>::max()), (std::numeric_limits<float>::max()), /*hidden argument*/NULL); Vector3__ctor_m2926210380((&V_1), (-std::numeric_limits<float>::max()), (-std::numeric_limits<float>::max()), (-std::numeric_limits<float>::max()), /*hidden argument*/NULL); RectTransform_t972643934 * L_3 = ScrollRect_get_viewRect_m911909082(__this, /*hidden argument*/NULL); NullCheck(L_3); Matrix4x4_t1651859333 L_4 = Transform_get_worldToLocalMatrix_m3792395652(L_3, /*hidden argument*/NULL); V_2 = L_4; RectTransform_t972643934 * L_5 = __this->get_m_Content_2(); Vector3U5BU5D_t215400611* L_6 = __this->get_m_Corners_37(); NullCheck(L_5); RectTransform_GetWorldCorners_m1829917190(L_5, L_6, /*hidden argument*/NULL); V_3 = 0; goto IL_009c; } IL_006c: { Vector3U5BU5D_t215400611* L_7 = __this->get_m_Corners_37(); int32_t L_8 = V_3; NullCheck(L_7); IL2CPP_ARRAY_BOUNDS_CHECK(L_7, L_8); Vector3_t4282066566 L_9 = Matrix4x4_MultiplyPoint3x4_m2198174902((&V_2), (*(Vector3_t4282066566 *)((L_7)->GetAddressAt(static_cast<il2cpp_array_size_t>(L_8)))), /*hidden argument*/NULL); V_4 = L_9; Vector3_t4282066566 L_10 = V_4; Vector3_t4282066566 L_11 = V_0; Vector3_t4282066566 L_12 = Vector3_Min_m10392601(NULL /*static, unused*/, L_10, L_11, /*hidden argument*/NULL); V_0 = L_12; Vector3_t4282066566 L_13 = V_4; Vector3_t4282066566 L_14 = V_1; Vector3_t4282066566 L_15 = Vector3_Max_m545730887(NULL /*static, unused*/, L_13, L_14, /*hidden argument*/NULL); V_1 = L_15; int32_t L_16 = V_3; V_3 = ((int32_t)((int32_t)L_16+(int32_t)1)); } IL_009c: { int32_t L_17 = V_3; if ((((int32_t)L_17) < ((int32_t)4))) { goto IL_006c; } } { Vector3_t4282066566 L_18 = V_0; Vector3_t4282066566 L_19 = Vector3_get_zero_m2017759730(NULL /*static, unused*/, /*hidden argument*/NULL); Bounds__ctor_m4160293652((&V_5), L_18, L_19, /*hidden argument*/NULL); Vector3_t4282066566 L_20 = V_1; Bounds_Encapsulate_m3624685234((&V_5), L_20, /*hidden argument*/NULL); Bounds_t2711641849 L_21 = V_5; return L_21; } } // UnityEngine.Vector2 UnityEngine.UI.ScrollRect::CalculateOffset(UnityEngine.Vector2) extern "C" Vector2_t4282066565 ScrollRect_CalculateOffset_m224839950 (ScrollRect_t3606982749 * __this, Vector2_t4282066565 ___delta0, const MethodInfo* method) { Vector2_t4282066565 V_0; memset(&V_0, 0, sizeof(V_0)); Vector2_t4282066565 V_1; memset(&V_1, 0, sizeof(V_1)); Vector2_t4282066565 V_2; memset(&V_2, 0, sizeof(V_2)); Vector3_t4282066566 V_3; memset(&V_3, 0, sizeof(V_3)); Vector3_t4282066566 V_4; memset(&V_4, 0, sizeof(V_4)); Vector3_t4282066566 V_5; memset(&V_5, 0, sizeof(V_5)); Vector3_t4282066566 V_6; memset(&V_6, 0, sizeof(V_6)); Vector3_t4282066566 V_7; memset(&V_7, 0, sizeof(V_7)); Vector3_t4282066566 V_8; memset(&V_8, 0, sizeof(V_8)); Vector3_t4282066566 V_9; memset(&V_9, 0, sizeof(V_9)); Vector3_t4282066566 V_10; memset(&V_10, 0, sizeof(V_10)); { Vector2_t4282066565 L_0 = Vector2_get_zero_m199872368(NULL /*static, unused*/, /*hidden argument*/NULL); V_0 = L_0; int32_t L_1 = __this->get_m_MovementType_5(); if (L_1) { goto IL_0013; } } { Vector2_t4282066565 L_2 = V_0; return L_2; } IL_0013: { Bounds_t2711641849 * L_3 = __this->get_address_of_m_ContentBounds_21(); Vector3_t4282066566 L_4 = Bounds_get_min_m2329472069(L_3, /*hidden argument*/NULL); Vector2_t4282066565 L_5 = Vector2_op_Implicit_m4083860659(NULL /*static, unused*/, L_4, /*hidden argument*/NULL); V_1 = L_5; Bounds_t2711641849 * L_6 = __this->get_address_of_m_ContentBounds_21(); Vector3_t4282066566 L_7 = Bounds_get_max_m2329243351(L_6, /*hidden argument*/NULL); Vector2_t4282066565 L_8 = Vector2_op_Implicit_m4083860659(NULL /*static, unused*/, L_7, /*hidden argument*/NULL); V_2 = L_8; bool L_9 = __this->get_m_Horizontal_3(); if (!L_9) { goto IL_00f4; } } { Vector2_t4282066565 * L_10 = (&V_1); float L_11 = L_10->get_x_1(); float L_12 = (&___delta0)->get_x_1(); L_10->set_x_1(((float)((float)L_11+(float)L_12))); Vector2_t4282066565 * L_13 = (&V_2); float L_14 = L_13->get_x_1(); float L_15 = (&___delta0)->get_x_1(); L_13->set_x_1(((float)((float)L_14+(float)L_15))); float L_16 = (&V_1)->get_x_1(); Bounds_t2711641849 * L_17 = __this->get_address_of_m_ViewBounds_22(); Vector3_t4282066566 L_18 = Bounds_get_min_m2329472069(L_17, /*hidden argument*/NULL); V_3 = L_18; float L_19 = (&V_3)->get_x_1(); if ((!(((float)L_16) > ((float)L_19)))) { goto IL_00b1; } } { Bounds_t2711641849 * L_20 = __this->get_address_of_m_ViewBounds_22(); Vector3_t4282066566 L_21 = Bounds_get_min_m2329472069(L_20, /*hidden argument*/NULL); V_4 = L_21; float L_22 = (&V_4)->get_x_1(); float L_23 = (&V_1)->get_x_1(); (&V_0)->set_x_1(((float)((float)L_22-(float)L_23))); goto IL_00f4; } IL_00b1: { float L_24 = (&V_2)->get_x_1(); Bounds_t2711641849 * L_25 = __this->get_address_of_m_ViewBounds_22(); Vector3_t4282066566 L_26 = Bounds_get_max_m2329243351(L_25, /*hidden argument*/NULL); V_5 = L_26; float L_27 = (&V_5)->get_x_1(); if ((!(((float)L_24) < ((float)L_27)))) { goto IL_00f4; } } { Bounds_t2711641849 * L_28 = __this->get_address_of_m_ViewBounds_22(); Vector3_t4282066566 L_29 = Bounds_get_max_m2329243351(L_28, /*hidden argument*/NULL); V_6 = L_29; float L_30 = (&V_6)->get_x_1(); float L_31 = (&V_2)->get_x_1(); (&V_0)->set_x_1(((float)((float)L_30-(float)L_31))); } IL_00f4: { bool L_32 = __this->get_m_Vertical_4(); if (!L_32) { goto IL_01b4; } } { Vector2_t4282066565 * L_33 = (&V_1); float L_34 = L_33->get_y_2(); float L_35 = (&___delta0)->get_y_2(); L_33->set_y_2(((float)((float)L_34+(float)L_35))); Vector2_t4282066565 * L_36 = (&V_2); float L_37 = L_36->get_y_2(); float L_38 = (&___delta0)->get_y_2(); L_36->set_y_2(((float)((float)L_37+(float)L_38))); float L_39 = (&V_2)->get_y_2(); Bounds_t2711641849 * L_40 = __this->get_address_of_m_ViewBounds_22(); Vector3_t4282066566 L_41 = Bounds_get_max_m2329243351(L_40, /*hidden argument*/NULL); V_7 = L_41; float L_42 = (&V_7)->get_y_2(); if ((!(((float)L_39) < ((float)L_42)))) { goto IL_0171; } } { Bounds_t2711641849 * L_43 = __this->get_address_of_m_ViewBounds_22(); Vector3_t4282066566 L_44 = Bounds_get_max_m2329243351(L_43, /*hidden argument*/NULL); V_8 = L_44; float L_45 = (&V_8)->get_y_2(); float L_46 = (&V_2)->get_y_2(); (&V_0)->set_y_2(((float)((float)L_45-(float)L_46))); goto IL_01b4; } IL_0171: { float L_47 = (&V_1)->get_y_2(); Bounds_t2711641849 * L_48 = __this->get_address_of_m_ViewBounds_22(); Vector3_t4282066566 L_49 = Bounds_get_min_m2329472069(L_48, /*hidden argument*/NULL); V_9 = L_49; float L_50 = (&V_9)->get_y_2(); if ((!(((float)L_47) > ((float)L_50)))) { goto IL_01b4; } } { Bounds_t2711641849 * L_51 = __this->get_address_of_m_ViewBounds_22(); Vector3_t4282066566 L_52 = Bounds_get_min_m2329472069(L_51, /*hidden argument*/NULL); V_10 = L_52; float L_53 = (&V_10)->get_y_2(); float L_54 = (&V_1)->get_y_2(); (&V_0)->set_y_2(((float)((float)L_53-(float)L_54))); } IL_01b4: { Vector2_t4282066565 L_55 = V_0; return L_55; } } // System.Void UnityEngine.UI.ScrollRect::SetDirty() extern Il2CppClass* LayoutRebuilder_t1942933988_il2cpp_TypeInfo_var; extern const uint32_t ScrollRect_SetDirty_m93607546_MetadataUsageId; extern "C" void ScrollRect_SetDirty_m93607546 (ScrollRect_t3606982749 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (ScrollRect_SetDirty_m93607546_MetadataUsageId); s_Il2CppMethodIntialized = true; } { bool L_0 = VirtFuncInvoker0< bool >::Invoke(9 /* System.Boolean UnityEngine.UI.ScrollRect::IsActive() */, __this); if (L_0) { goto IL_000c; } } { return; } IL_000c: { RectTransform_t972643934 * L_1 = ScrollRect_get_rectTransform_m836427513(__this, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(LayoutRebuilder_t1942933988_il2cpp_TypeInfo_var); LayoutRebuilder_MarkLayoutForRebuild_m901621521(NULL /*static, unused*/, L_1, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.UI.ScrollRect::SetDirtyCaching() extern Il2CppClass* CanvasUpdateRegistry_t192658922_il2cpp_TypeInfo_var; extern Il2CppClass* LayoutRebuilder_t1942933988_il2cpp_TypeInfo_var; extern const uint32_t ScrollRect_SetDirtyCaching_m4215531847_MetadataUsageId; extern "C" void ScrollRect_SetDirtyCaching_m4215531847 (ScrollRect_t3606982749 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (ScrollRect_SetDirtyCaching_m4215531847_MetadataUsageId); s_Il2CppMethodIntialized = true; } { bool L_0 = VirtFuncInvoker0< bool >::Invoke(9 /* System.Boolean UnityEngine.UI.ScrollRect::IsActive() */, __this); if (L_0) { goto IL_000c; } } { return; } IL_000c: { IL2CPP_RUNTIME_CLASS_INIT(CanvasUpdateRegistry_t192658922_il2cpp_TypeInfo_var); CanvasUpdateRegistry_RegisterCanvasElementForLayoutRebuild_m1282865408(NULL /*static, unused*/, __this, /*hidden argument*/NULL); RectTransform_t972643934 * L_1 = ScrollRect_get_rectTransform_m836427513(__this, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(LayoutRebuilder_t1942933988_il2cpp_TypeInfo_var); LayoutRebuilder_MarkLayoutForRebuild_m901621521(NULL /*static, unused*/, L_1, /*hidden argument*/NULL); return; } } // System.Boolean UnityEngine.UI.ScrollRect::UnityEngine.UI.ICanvasElement.IsDestroyed() extern "C" bool ScrollRect_UnityEngine_UI_ICanvasElement_IsDestroyed_m1861319301 (ScrollRect_t3606982749 * __this, const MethodInfo* method) { { bool L_0 = UIBehaviour_IsDestroyed_m3027499227(__this, /*hidden argument*/NULL); return L_0; } } // UnityEngine.Transform UnityEngine.UI.ScrollRect::UnityEngine.UI.ICanvasElement.get_transform() extern "C" Transform_t1659122786 * ScrollRect_UnityEngine_UI_ICanvasElement_get_transform_m3316531305 (ScrollRect_t3606982749 * __this, const MethodInfo* method) { { Transform_t1659122786 * L_0 = Component_get_transform_m4257140443(__this, /*hidden argument*/NULL); return L_0; } } // System.Void UnityEngine.UI.ScrollRect/ScrollRectEvent::.ctor() extern const MethodInfo* UnityEvent_1__ctor_m99457450_MethodInfo_var; extern const uint32_t ScrollRectEvent__ctor_m985343040_MetadataUsageId; extern "C" void ScrollRectEvent__ctor_m985343040 (ScrollRectEvent_t1643322606 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (ScrollRectEvent__ctor_m985343040_MetadataUsageId); s_Il2CppMethodIntialized = true; } { UnityEvent_1__ctor_m99457450(__this, /*hidden argument*/UnityEvent_1__ctor_m99457450_MethodInfo_var); return; } } // System.Void UnityEngine.UI.Selectable::.ctor() extern Il2CppClass* AnimationTriggers_t115197445_il2cpp_TypeInfo_var; extern Il2CppClass* List_1_t775636365_il2cpp_TypeInfo_var; extern const MethodInfo* List_1__ctor_m3058885740_MethodInfo_var; extern const uint32_t Selectable__ctor_m1133588277_MetadataUsageId; extern "C" void Selectable__ctor_m1133588277 (Selectable_t1885181538 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Selectable__ctor_m1133588277_MetadataUsageId); s_Il2CppMethodIntialized = true; } { Navigation_t1108456480 L_0 = Navigation_get_defaultNavigation_m492829917(NULL /*static, unused*/, /*hidden argument*/NULL); __this->set_m_Navigation_3(L_0); __this->set_m_Transition_4(1); ColorBlock_t508458230 L_1 = ColorBlock_get_defaultColorBlock_m533915527(NULL /*static, unused*/, /*hidden argument*/NULL); __this->set_m_Colors_5(L_1); AnimationTriggers_t115197445 * L_2 = (AnimationTriggers_t115197445 *)il2cpp_codegen_object_new(AnimationTriggers_t115197445_il2cpp_TypeInfo_var); AnimationTriggers__ctor_m4034548412(L_2, /*hidden argument*/NULL); __this->set_m_AnimationTriggers_7(L_2); __this->set_m_Interactable_8((bool)1); __this->set_m_GroupsAllowInteraction_10((bool)1); List_1_t775636365 * L_3 = (List_1_t775636365 *)il2cpp_codegen_object_new(List_1_t775636365_il2cpp_TypeInfo_var); List_1__ctor_m3058885740(L_3, /*hidden argument*/List_1__ctor_m3058885740_MethodInfo_var); __this->set_m_CanvasGroupCache_12(L_3); UIBehaviour__ctor_m1261553468(__this, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.UI.Selectable::.cctor() extern Il2CppClass* List_1_t3253367090_il2cpp_TypeInfo_var; extern Il2CppClass* Selectable_t1885181538_il2cpp_TypeInfo_var; extern const MethodInfo* List_1__ctor_m1426333013_MethodInfo_var; extern const uint32_t Selectable__cctor_m299402008_MetadataUsageId; extern "C" void Selectable__cctor_m299402008 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Selectable__cctor_m299402008_MetadataUsageId); s_Il2CppMethodIntialized = true; } { List_1_t3253367090 * L_0 = (List_1_t3253367090 *)il2cpp_codegen_object_new(List_1_t3253367090_il2cpp_TypeInfo_var); List_1__ctor_m1426333013(L_0, /*hidden argument*/List_1__ctor_m1426333013_MethodInfo_var); ((Selectable_t1885181538_StaticFields*)Selectable_t1885181538_il2cpp_TypeInfo_var->static_fields)->set_s_List_2(L_0); return; } } // System.Collections.Generic.List`1<UnityEngine.UI.Selectable> UnityEngine.UI.Selectable::get_allSelectables() extern Il2CppClass* Selectable_t1885181538_il2cpp_TypeInfo_var; extern const uint32_t Selectable_get_allSelectables_m476416992_MetadataUsageId; extern "C" List_1_t3253367090 * Selectable_get_allSelectables_m476416992 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Selectable_get_allSelectables_m476416992_MetadataUsageId); s_Il2CppMethodIntialized = true; } { IL2CPP_RUNTIME_CLASS_INIT(Selectable_t1885181538_il2cpp_TypeInfo_var); List_1_t3253367090 * L_0 = ((Selectable_t1885181538_StaticFields*)Selectable_t1885181538_il2cpp_TypeInfo_var->static_fields)->get_s_List_2(); return L_0; } } // UnityEngine.UI.Navigation UnityEngine.UI.Selectable::get_navigation() extern "C" Navigation_t1108456480 Selectable_get_navigation_m3138151376 (Selectable_t1885181538 * __this, const MethodInfo* method) { { Navigation_t1108456480 L_0 = __this->get_m_Navigation_3(); return L_0; } } // System.Void UnityEngine.UI.Selectable::set_navigation(UnityEngine.UI.Navigation) extern const MethodInfo* SetPropertyUtility_SetEquatableStruct_TisNavigation_t1108456480_m3717372898_MethodInfo_var; extern const uint32_t Selectable_set_navigation_m3946690907_MetadataUsageId; extern "C" void Selectable_set_navigation_m3946690907 (Selectable_t1885181538 * __this, Navigation_t1108456480 ___value0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Selectable_set_navigation_m3946690907_MetadataUsageId); s_Il2CppMethodIntialized = true; } { Navigation_t1108456480 * L_0 = __this->get_address_of_m_Navigation_3(); Navigation_t1108456480 L_1 = ___value0; bool L_2 = SetPropertyUtility_SetEquatableStruct_TisNavigation_t1108456480_m3717372898(NULL /*static, unused*/, L_0, L_1, /*hidden argument*/SetPropertyUtility_SetEquatableStruct_TisNavigation_t1108456480_m3717372898_MethodInfo_var); if (!L_2) { goto IL_0017; } } { Selectable_OnSetProperty_m571656523(__this, /*hidden argument*/NULL); } IL_0017: { return; } } // UnityEngine.UI.Selectable/Transition UnityEngine.UI.Selectable::get_transition() extern "C" int32_t Selectable_get_transition_m4100650273 (Selectable_t1885181538 * __this, const MethodInfo* method) { { int32_t L_0 = __this->get_m_Transition_4(); return L_0; } } // System.Void UnityEngine.UI.Selectable::set_transition(UnityEngine.UI.Selectable/Transition) extern const MethodInfo* SetPropertyUtility_SetStruct_TisTransition_t1922345195_m697175766_MethodInfo_var; extern const uint32_t Selectable_set_transition_m1538436886_MetadataUsageId; extern "C" void Selectable_set_transition_m1538436886 (Selectable_t1885181538 * __this, int32_t ___value0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Selectable_set_transition_m1538436886_MetadataUsageId); s_Il2CppMethodIntialized = true; } { int32_t* L_0 = __this->get_address_of_m_Transition_4(); int32_t L_1 = ___value0; bool L_2 = SetPropertyUtility_SetStruct_TisTransition_t1922345195_m697175766(NULL /*static, unused*/, L_0, L_1, /*hidden argument*/SetPropertyUtility_SetStruct_TisTransition_t1922345195_m697175766_MethodInfo_var); if (!L_2) { goto IL_0017; } } { Selectable_OnSetProperty_m571656523(__this, /*hidden argument*/NULL); } IL_0017: { return; } } // UnityEngine.UI.ColorBlock UnityEngine.UI.Selectable::get_colors() extern "C" ColorBlock_t508458230 Selectable_get_colors_m2926475394 (Selectable_t1885181538 * __this, const MethodInfo* method) { { ColorBlock_t508458230 L_0 = __this->get_m_Colors_5(); return L_0; } } // System.Void UnityEngine.UI.Selectable::set_colors(UnityEngine.UI.ColorBlock) extern const MethodInfo* SetPropertyUtility_SetEquatableStruct_TisColorBlock_t508458230_m3999144268_MethodInfo_var; extern const uint32_t Selectable_set_colors_m2365118697_MetadataUsageId; extern "C" void Selectable_set_colors_m2365118697 (Selectable_t1885181538 * __this, ColorBlock_t508458230 ___value0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Selectable_set_colors_m2365118697_MetadataUsageId); s_Il2CppMethodIntialized = true; } { ColorBlock_t508458230 * L_0 = __this->get_address_of_m_Colors_5(); ColorBlock_t508458230 L_1 = ___value0; bool L_2 = SetPropertyUtility_SetEquatableStruct_TisColorBlock_t508458230_m3999144268(NULL /*static, unused*/, L_0, L_1, /*hidden argument*/SetPropertyUtility_SetEquatableStruct_TisColorBlock_t508458230_m3999144268_MethodInfo_var); if (!L_2) { goto IL_0017; } } { Selectable_OnSetProperty_m571656523(__this, /*hidden argument*/NULL); } IL_0017: { return; } } // UnityEngine.UI.SpriteState UnityEngine.UI.Selectable::get_spriteState() extern "C" SpriteState_t2895308594 Selectable_get_spriteState_m102480676 (Selectable_t1885181538 * __this, const MethodInfo* method) { { SpriteState_t2895308594 L_0 = __this->get_m_SpriteState_6(); return L_0; } } // System.Void UnityEngine.UI.Selectable::set_spriteState(UnityEngine.UI.SpriteState) extern const MethodInfo* SetPropertyUtility_SetEquatableStruct_TisSpriteState_t2895308594_m1850844776_MethodInfo_var; extern const uint32_t Selectable_set_spriteState_m3715637593_MetadataUsageId; extern "C" void Selectable_set_spriteState_m3715637593 (Selectable_t1885181538 * __this, SpriteState_t2895308594 ___value0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Selectable_set_spriteState_m3715637593_MetadataUsageId); s_Il2CppMethodIntialized = true; } { SpriteState_t2895308594 * L_0 = __this->get_address_of_m_SpriteState_6(); SpriteState_t2895308594 L_1 = ___value0; bool L_2 = SetPropertyUtility_SetEquatableStruct_TisSpriteState_t2895308594_m1850844776(NULL /*static, unused*/, L_0, L_1, /*hidden argument*/SetPropertyUtility_SetEquatableStruct_TisSpriteState_t2895308594_m1850844776_MethodInfo_var); if (!L_2) { goto IL_0017; } } { Selectable_OnSetProperty_m571656523(__this, /*hidden argument*/NULL); } IL_0017: { return; } } // UnityEngine.UI.AnimationTriggers UnityEngine.UI.Selectable::get_animationTriggers() extern "C" AnimationTriggers_t115197445 * Selectable_get_animationTriggers_m4030265988 (Selectable_t1885181538 * __this, const MethodInfo* method) { { AnimationTriggers_t115197445 * L_0 = __this->get_m_AnimationTriggers_7(); return L_0; } } // System.Void UnityEngine.UI.Selectable::set_animationTriggers(UnityEngine.UI.AnimationTriggers) extern const MethodInfo* SetPropertyUtility_SetClass_TisAnimationTriggers_t115197445_m2237051106_MethodInfo_var; extern const uint32_t Selectable_set_animationTriggers_m1859718713_MetadataUsageId; extern "C" void Selectable_set_animationTriggers_m1859718713 (Selectable_t1885181538 * __this, AnimationTriggers_t115197445 * ___value0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Selectable_set_animationTriggers_m1859718713_MetadataUsageId); s_Il2CppMethodIntialized = true; } { AnimationTriggers_t115197445 ** L_0 = __this->get_address_of_m_AnimationTriggers_7(); AnimationTriggers_t115197445 * L_1 = ___value0; bool L_2 = SetPropertyUtility_SetClass_TisAnimationTriggers_t115197445_m2237051106(NULL /*static, unused*/, L_0, L_1, /*hidden argument*/SetPropertyUtility_SetClass_TisAnimationTriggers_t115197445_m2237051106_MethodInfo_var); if (!L_2) { goto IL_0017; } } { Selectable_OnSetProperty_m571656523(__this, /*hidden argument*/NULL); } IL_0017: { return; } } // UnityEngine.UI.Graphic UnityEngine.UI.Selectable::get_targetGraphic() extern "C" Graphic_t836799438 * Selectable_get_targetGraphic_m1206082259 (Selectable_t1885181538 * __this, const MethodInfo* method) { { Graphic_t836799438 * L_0 = __this->get_m_TargetGraphic_9(); return L_0; } } // System.Void UnityEngine.UI.Selectable::set_targetGraphic(UnityEngine.UI.Graphic) extern const MethodInfo* SetPropertyUtility_SetClass_TisGraphic_t836799438_m4232752825_MethodInfo_var; extern const uint32_t Selectable_set_targetGraphic_m54088136_MetadataUsageId; extern "C" void Selectable_set_targetGraphic_m54088136 (Selectable_t1885181538 * __this, Graphic_t836799438 * ___value0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Selectable_set_targetGraphic_m54088136_MetadataUsageId); s_Il2CppMethodIntialized = true; } { Graphic_t836799438 ** L_0 = __this->get_address_of_m_TargetGraphic_9(); Graphic_t836799438 * L_1 = ___value0; bool L_2 = SetPropertyUtility_SetClass_TisGraphic_t836799438_m4232752825(NULL /*static, unused*/, L_0, L_1, /*hidden argument*/SetPropertyUtility_SetClass_TisGraphic_t836799438_m4232752825_MethodInfo_var); if (!L_2) { goto IL_0017; } } { Selectable_OnSetProperty_m571656523(__this, /*hidden argument*/NULL); } IL_0017: { return; } } // System.Boolean UnityEngine.UI.Selectable::get_interactable() extern "C" bool Selectable_get_interactable_m1204033370 (Selectable_t1885181538 * __this, const MethodInfo* method) { { bool L_0 = __this->get_m_Interactable_8(); return L_0; } } // System.Void UnityEngine.UI.Selectable::set_interactable(System.Boolean) extern Il2CppClass* EventSystem_t2276120119_il2cpp_TypeInfo_var; extern const MethodInfo* SetPropertyUtility_SetStruct_TisBoolean_t476798718_m1242031768_MethodInfo_var; extern const uint32_t Selectable_set_interactable_m2686686419_MetadataUsageId; extern "C" void Selectable_set_interactable_m2686686419 (Selectable_t1885181538 * __this, bool ___value0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Selectable_set_interactable_m2686686419_MetadataUsageId); s_Il2CppMethodIntialized = true; } { bool* L_0 = __this->get_address_of_m_Interactable_8(); bool L_1 = ___value0; bool L_2 = SetPropertyUtility_SetStruct_TisBoolean_t476798718_m1242031768(NULL /*static, unused*/, L_0, L_1, /*hidden argument*/SetPropertyUtility_SetStruct_TisBoolean_t476798718_m1242031768_MethodInfo_var); if (!L_2) { goto IL_0057; } } { bool L_3 = __this->get_m_Interactable_8(); if (!L_3) { goto IL_0051; } } { IL2CPP_RUNTIME_CLASS_INIT(EventSystem_t2276120119_il2cpp_TypeInfo_var); EventSystem_t2276120119 * L_4 = EventSystem_get_current_m3483537871(NULL /*static, unused*/, /*hidden argument*/NULL); bool L_5 = Object_op_Inequality_m1296218211(NULL /*static, unused*/, L_4, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_5) { goto IL_0051; } } { IL2CPP_RUNTIME_CLASS_INIT(EventSystem_t2276120119_il2cpp_TypeInfo_var); EventSystem_t2276120119 * L_6 = EventSystem_get_current_m3483537871(NULL /*static, unused*/, /*hidden argument*/NULL); NullCheck(L_6); GameObject_t3674682005 * L_7 = EventSystem_get_currentSelectedGameObject_m4236083783(L_6, /*hidden argument*/NULL); GameObject_t3674682005 * L_8 = Component_get_gameObject_m1170635899(__this, /*hidden argument*/NULL); bool L_9 = Object_op_Equality_m3964590952(NULL /*static, unused*/, L_7, L_8, /*hidden argument*/NULL); if (!L_9) { goto IL_0051; } } { IL2CPP_RUNTIME_CLASS_INIT(EventSystem_t2276120119_il2cpp_TypeInfo_var); EventSystem_t2276120119 * L_10 = EventSystem_get_current_m3483537871(NULL /*static, unused*/, /*hidden argument*/NULL); NullCheck(L_10); EventSystem_SetSelectedGameObject_m1869236832(L_10, (GameObject_t3674682005 *)NULL, /*hidden argument*/NULL); } IL_0051: { Selectable_OnSetProperty_m571656523(__this, /*hidden argument*/NULL); } IL_0057: { return; } } // System.Boolean UnityEngine.UI.Selectable::get_isPointerInside() extern "C" bool Selectable_get_isPointerInside_m3778852455 (Selectable_t1885181538 * __this, const MethodInfo* method) { { bool L_0 = __this->get_U3CisPointerInsideU3Ek__BackingField_13(); return L_0; } } // System.Void UnityEngine.UI.Selectable::set_isPointerInside(System.Boolean) extern "C" void Selectable_set_isPointerInside_m1584068316 (Selectable_t1885181538 * __this, bool ___value0, const MethodInfo* method) { { bool L_0 = ___value0; __this->set_U3CisPointerInsideU3Ek__BackingField_13(L_0); return; } } // System.Boolean UnityEngine.UI.Selectable::get_isPointerDown() extern "C" bool Selectable_get_isPointerDown_m451775501 (Selectable_t1885181538 * __this, const MethodInfo* method) { { bool L_0 = __this->get_U3CisPointerDownU3Ek__BackingField_14(); return L_0; } } // System.Void UnityEngine.UI.Selectable::set_isPointerDown(System.Boolean) extern "C" void Selectable_set_isPointerDown_m2193598850 (Selectable_t1885181538 * __this, bool ___value0, const MethodInfo* method) { { bool L_0 = ___value0; __this->set_U3CisPointerDownU3Ek__BackingField_14(L_0); return; } } // System.Boolean UnityEngine.UI.Selectable::get_hasSelection() extern "C" bool Selectable_get_hasSelection_m771189340 (Selectable_t1885181538 * __this, const MethodInfo* method) { { bool L_0 = __this->get_U3ChasSelectionU3Ek__BackingField_15(); return L_0; } } // System.Void UnityEngine.UI.Selectable::set_hasSelection(System.Boolean) extern "C" void Selectable_set_hasSelection_m138443861 (Selectable_t1885181538 * __this, bool ___value0, const MethodInfo* method) { { bool L_0 = ___value0; __this->set_U3ChasSelectionU3Ek__BackingField_15(L_0); return; } } // UnityEngine.UI.Image UnityEngine.UI.Selectable::get_image() extern Il2CppClass* Image_t538875265_il2cpp_TypeInfo_var; extern const uint32_t Selectable_get_image_m978701700_MetadataUsageId; extern "C" Image_t538875265 * Selectable_get_image_m978701700 (Selectable_t1885181538 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Selectable_get_image_m978701700_MetadataUsageId); s_Il2CppMethodIntialized = true; } { Graphic_t836799438 * L_0 = __this->get_m_TargetGraphic_9(); return ((Image_t538875265 *)IsInstClass(L_0, Image_t538875265_il2cpp_TypeInfo_var)); } } // System.Void UnityEngine.UI.Selectable::set_image(UnityEngine.UI.Image) extern "C" void Selectable_set_image_m4179082937 (Selectable_t1885181538 * __this, Image_t538875265 * ___value0, const MethodInfo* method) { { Image_t538875265 * L_0 = ___value0; __this->set_m_TargetGraphic_9(L_0); return; } } // UnityEngine.Animator UnityEngine.UI.Selectable::get_animator() extern const MethodInfo* Component_GetComponent_TisAnimator_t2776330603_m4147395588_MethodInfo_var; extern const uint32_t Selectable_get_animator_m1533578598_MetadataUsageId; extern "C" Animator_t2776330603 * Selectable_get_animator_m1533578598 (Selectable_t1885181538 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Selectable_get_animator_m1533578598_MetadataUsageId); s_Il2CppMethodIntialized = true; } { Animator_t2776330603 * L_0 = Component_GetComponent_TisAnimator_t2776330603_m4147395588(__this, /*hidden argument*/Component_GetComponent_TisAnimator_t2776330603_m4147395588_MethodInfo_var); return L_0; } } // System.Void UnityEngine.UI.Selectable::Awake() extern const MethodInfo* Component_GetComponent_TisGraphic_t836799438_m908906813_MethodInfo_var; extern const uint32_t Selectable_Awake_m1371193496_MetadataUsageId; extern "C" void Selectable_Awake_m1371193496 (Selectable_t1885181538 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Selectable_Awake_m1371193496_MetadataUsageId); s_Il2CppMethodIntialized = true; } { Graphic_t836799438 * L_0 = __this->get_m_TargetGraphic_9(); bool L_1 = Object_op_Equality_m3964590952(NULL /*static, unused*/, L_0, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_1) { goto IL_001d; } } { Graphic_t836799438 * L_2 = Component_GetComponent_TisGraphic_t836799438_m908906813(__this, /*hidden argument*/Component_GetComponent_TisGraphic_t836799438_m908906813_MethodInfo_var); __this->set_m_TargetGraphic_9(L_2); } IL_001d: { return; } } // System.Void UnityEngine.UI.Selectable::OnCanvasGroupChanged() extern const MethodInfo* Component_GetComponents_TisCanvasGroup_t3702418109_m4244188622_MethodInfo_var; extern const MethodInfo* List_1_get_Item_m2330399181_MethodInfo_var; extern const MethodInfo* List_1_get_Count_m1898509448_MethodInfo_var; extern const uint32_t Selectable_OnCanvasGroupChanged_m4067350875_MetadataUsageId; extern "C" void Selectable_OnCanvasGroupChanged_m4067350875 (Selectable_t1885181538 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Selectable_OnCanvasGroupChanged_m4067350875_MetadataUsageId); s_Il2CppMethodIntialized = true; } bool V_0 = false; Transform_t1659122786 * V_1 = NULL; bool V_2 = false; int32_t V_3 = 0; { V_0 = (bool)1; Transform_t1659122786 * L_0 = Component_get_transform_m4257140443(__this, /*hidden argument*/NULL); V_1 = L_0; goto IL_007c; } IL_000e: { Transform_t1659122786 * L_1 = V_1; List_1_t775636365 * L_2 = __this->get_m_CanvasGroupCache_12(); NullCheck(L_1); Component_GetComponents_TisCanvasGroup_t3702418109_m4244188622(L_1, L_2, /*hidden argument*/Component_GetComponents_TisCanvasGroup_t3702418109_m4244188622_MethodInfo_var); V_2 = (bool)0; V_3 = 0; goto IL_0059; } IL_0023: { List_1_t775636365 * L_3 = __this->get_m_CanvasGroupCache_12(); int32_t L_4 = V_3; NullCheck(L_3); CanvasGroup_t3702418109 * L_5 = List_1_get_Item_m2330399181(L_3, L_4, /*hidden argument*/List_1_get_Item_m2330399181_MethodInfo_var); NullCheck(L_5); bool L_6 = CanvasGroup_get_interactable_m2411844645(L_5, /*hidden argument*/NULL); if (L_6) { goto IL_003d; } } { V_0 = (bool)0; V_2 = (bool)1; } IL_003d: { List_1_t775636365 * L_7 = __this->get_m_CanvasGroupCache_12(); int32_t L_8 = V_3; NullCheck(L_7); CanvasGroup_t3702418109 * L_9 = List_1_get_Item_m2330399181(L_7, L_8, /*hidden argument*/List_1_get_Item_m2330399181_MethodInfo_var); NullCheck(L_9); bool L_10 = CanvasGroup_get_ignoreParentGroups_m1831887525(L_9, /*hidden argument*/NULL); if (!L_10) { goto IL_0055; } } { V_2 = (bool)1; } IL_0055: { int32_t L_11 = V_3; V_3 = ((int32_t)((int32_t)L_11+(int32_t)1)); } IL_0059: { int32_t L_12 = V_3; List_1_t775636365 * L_13 = __this->get_m_CanvasGroupCache_12(); NullCheck(L_13); int32_t L_14 = List_1_get_Count_m1898509448(L_13, /*hidden argument*/List_1_get_Count_m1898509448_MethodInfo_var); if ((((int32_t)L_12) < ((int32_t)L_14))) { goto IL_0023; } } { bool L_15 = V_2; if (!L_15) { goto IL_0075; } } { goto IL_0088; } IL_0075: { Transform_t1659122786 * L_16 = V_1; NullCheck(L_16); Transform_t1659122786 * L_17 = Transform_get_parent_m2236876972(L_16, /*hidden argument*/NULL); V_1 = L_17; } IL_007c: { Transform_t1659122786 * L_18 = V_1; bool L_19 = Object_op_Inequality_m1296218211(NULL /*static, unused*/, L_18, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (L_19) { goto IL_000e; } } IL_0088: { bool L_20 = V_0; bool L_21 = __this->get_m_GroupsAllowInteraction_10(); if ((((int32_t)L_20) == ((int32_t)L_21))) { goto IL_00a1; } } { bool L_22 = V_0; __this->set_m_GroupsAllowInteraction_10(L_22); Selectable_OnSetProperty_m571656523(__this, /*hidden argument*/NULL); } IL_00a1: { return; } } // System.Boolean UnityEngine.UI.Selectable::IsInteractable() extern "C" bool Selectable_IsInteractable_m1810942779 (Selectable_t1885181538 * __this, const MethodInfo* method) { int32_t G_B3_0 = 0; { bool L_0 = __this->get_m_GroupsAllowInteraction_10(); if (!L_0) { goto IL_0013; } } { bool L_1 = __this->get_m_Interactable_8(); G_B3_0 = ((int32_t)(L_1)); goto IL_0014; } IL_0013: { G_B3_0 = 0; } IL_0014: { return (bool)G_B3_0; } } // System.Void UnityEngine.UI.Selectable::OnDidApplyAnimationProperties() extern "C" void Selectable_OnDidApplyAnimationProperties_m4092978140 (Selectable_t1885181538 * __this, const MethodInfo* method) { { Selectable_OnSetProperty_m571656523(__this, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.UI.Selectable::OnEnable() extern Il2CppClass* Selectable_t1885181538_il2cpp_TypeInfo_var; extern const MethodInfo* List_1_Add_m1120693829_MethodInfo_var; extern const uint32_t Selectable_OnEnable_m1472090161_MetadataUsageId; extern "C" void Selectable_OnEnable_m1472090161 (Selectable_t1885181538 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Selectable_OnEnable_m1472090161_MetadataUsageId); s_Il2CppMethodIntialized = true; } int32_t V_0 = 0; { UIBehaviour_OnEnable_m4047103690(__this, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(Selectable_t1885181538_il2cpp_TypeInfo_var); List_1_t3253367090 * L_0 = ((Selectable_t1885181538_StaticFields*)Selectable_t1885181538_il2cpp_TypeInfo_var->static_fields)->get_s_List_2(); NullCheck(L_0); List_1_Add_m1120693829(L_0, __this, /*hidden argument*/List_1_Add_m1120693829_MethodInfo_var); V_0 = 0; bool L_1 = Selectable_get_hasSelection_m771189340(__this, /*hidden argument*/NULL); if (!L_1) { goto IL_0020; } } { V_0 = 1; } IL_0020: { int32_t L_2 = V_0; __this->set_m_CurrentSelectionState_11(L_2); Selectable_InternalEvaluateAndTransitionToSelectionState_m543442976(__this, (bool)1, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.UI.Selectable::OnSetProperty() extern "C" void Selectable_OnSetProperty_m571656523 (Selectable_t1885181538 * __this, const MethodInfo* method) { { Selectable_InternalEvaluateAndTransitionToSelectionState_m543442976(__this, (bool)0, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.UI.Selectable::OnDisable() extern Il2CppClass* Selectable_t1885181538_il2cpp_TypeInfo_var; extern const MethodInfo* List_1_Remove_m3691398354_MethodInfo_var; extern const uint32_t Selectable_OnDisable_m3126059292_MetadataUsageId; extern "C" void Selectable_OnDisable_m3126059292 (Selectable_t1885181538 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Selectable_OnDisable_m3126059292_MetadataUsageId); s_Il2CppMethodIntialized = true; } { IL2CPP_RUNTIME_CLASS_INIT(Selectable_t1885181538_il2cpp_TypeInfo_var); List_1_t3253367090 * L_0 = ((Selectable_t1885181538_StaticFields*)Selectable_t1885181538_il2cpp_TypeInfo_var->static_fields)->get_s_List_2(); NullCheck(L_0); List_1_Remove_m3691398354(L_0, __this, /*hidden argument*/List_1_Remove_m3691398354_MethodInfo_var); VirtActionInvoker0::Invoke(24 /* System.Void UnityEngine.UI.Selectable::InstantClearState() */, __this); UIBehaviour_OnDisable_m1347100067(__this, /*hidden argument*/NULL); return; } } // UnityEngine.UI.Selectable/SelectionState UnityEngine.UI.Selectable::get_currentSelectionState() extern "C" int32_t Selectable_get_currentSelectionState_m730905540 (Selectable_t1885181538 * __this, const MethodInfo* method) { { int32_t L_0 = __this->get_m_CurrentSelectionState_11(); return L_0; } } // System.Void UnityEngine.UI.Selectable::InstantClearState() extern "C" void Selectable_InstantClearState_m1586585368 (Selectable_t1885181538 * __this, const MethodInfo* method) { String_t* V_0 = NULL; int32_t V_1 = 0; { AnimationTriggers_t115197445 * L_0 = __this->get_m_AnimationTriggers_7(); NullCheck(L_0); String_t* L_1 = AnimationTriggers_get_normalTrigger_m326085791(L_0, /*hidden argument*/NULL); V_0 = L_1; Selectable_set_isPointerInside_m1584068316(__this, (bool)0, /*hidden argument*/NULL); Selectable_set_isPointerDown_m2193598850(__this, (bool)0, /*hidden argument*/NULL); Selectable_set_hasSelection_m138443861(__this, (bool)0, /*hidden argument*/NULL); int32_t L_2 = __this->get_m_Transition_4(); V_1 = L_2; int32_t L_3 = V_1; if (((int32_t)((int32_t)L_3-(int32_t)1)) == 0) { goto IL_0041; } if (((int32_t)((int32_t)L_3-(int32_t)1)) == 1) { goto IL_0052; } if (((int32_t)((int32_t)L_3-(int32_t)1)) == 2) { goto IL_005e; } } { goto IL_006a; } IL_0041: { Color_t4194546905 L_4 = Color_get_white_m3038282331(NULL /*static, unused*/, /*hidden argument*/NULL); Selectable_StartColorTween_m2559093428(__this, L_4, (bool)1, /*hidden argument*/NULL); goto IL_006a; } IL_0052: { Selectable_DoSpriteSwap_m1929545238(__this, (Sprite_t3199167241 *)NULL, /*hidden argument*/NULL); goto IL_006a; } IL_005e: { String_t* L_5 = V_0; Selectable_TriggerAnimation_m2433448647(__this, L_5, /*hidden argument*/NULL); goto IL_006a; } IL_006a: { return; } } // System.Void UnityEngine.UI.Selectable::DoStateTransition(UnityEngine.UI.Selectable/SelectionState,System.Boolean) extern Il2CppClass* String_t_il2cpp_TypeInfo_var; extern const uint32_t Selectable_DoStateTransition_m1211483242_MetadataUsageId; extern "C" void Selectable_DoStateTransition_m1211483242 (Selectable_t1885181538 * __this, int32_t ___state0, bool ___instant1, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Selectable_DoStateTransition_m1211483242_MetadataUsageId); s_Il2CppMethodIntialized = true; } Color_t4194546905 V_0; memset(&V_0, 0, sizeof(V_0)); Sprite_t3199167241 * V_1 = NULL; String_t* V_2 = NULL; int32_t V_3 = 0; int32_t V_4 = 0; { int32_t L_0 = ___state0; V_3 = L_0; int32_t L_1 = V_3; if (L_1 == 0) { goto IL_001d; } if (L_1 == 1) { goto IL_003c; } if (L_1 == 2) { goto IL_0065; } if (L_1 == 3) { goto IL_008e; } } { goto IL_00b7; } IL_001d: { ColorBlock_t508458230 * L_2 = __this->get_address_of_m_Colors_5(); Color_t4194546905 L_3 = ColorBlock_get_normalColor_m1021113593(L_2, /*hidden argument*/NULL); V_0 = L_3; V_1 = (Sprite_t3199167241 *)NULL; AnimationTriggers_t115197445 * L_4 = __this->get_m_AnimationTriggers_7(); NullCheck(L_4); String_t* L_5 = AnimationTriggers_get_normalTrigger_m326085791(L_4, /*hidden argument*/NULL); V_2 = L_5; goto IL_00ca; } IL_003c: { ColorBlock_t508458230 * L_6 = __this->get_address_of_m_Colors_5(); Color_t4194546905 L_7 = ColorBlock_get_highlightedColor_m2834784533(L_6, /*hidden argument*/NULL); V_0 = L_7; SpriteState_t2895308594 * L_8 = __this->get_address_of_m_SpriteState_6(); Sprite_t3199167241 * L_9 = SpriteState_get_highlightedSprite_m2511270273(L_8, /*hidden argument*/NULL); V_1 = L_9; AnimationTriggers_t115197445 * L_10 = __this->get_m_AnimationTriggers_7(); NullCheck(L_10); String_t* L_11 = AnimationTriggers_get_highlightedTrigger_m1862702265(L_10, /*hidden argument*/NULL); V_2 = L_11; goto IL_00ca; } IL_0065: { ColorBlock_t508458230 * L_12 = __this->get_address_of_m_Colors_5(); Color_t4194546905 L_13 = ColorBlock_get_pressedColor_m2014354534(L_12, /*hidden argument*/NULL); V_0 = L_13; SpriteState_t2895308594 * L_14 = __this->get_address_of_m_SpriteState_6(); Sprite_t3199167241 * L_15 = SpriteState_get_pressedSprite_m591013456(L_14, /*hidden argument*/NULL); V_1 = L_15; AnimationTriggers_t115197445 * L_16 = __this->get_m_AnimationTriggers_7(); NullCheck(L_16); String_t* L_17 = AnimationTriggers_get_pressedTrigger_m3081240394(L_16, /*hidden argument*/NULL); V_2 = L_17; goto IL_00ca; } IL_008e: { ColorBlock_t508458230 * L_18 = __this->get_address_of_m_Colors_5(); Color_t4194546905 L_19 = ColorBlock_get_disabledColor_m2484721348(L_18, /*hidden argument*/NULL); V_0 = L_19; SpriteState_t2895308594 * L_20 = __this->get_address_of_m_SpriteState_6(); Sprite_t3199167241 * L_21 = SpriteState_get_disabledSprite_m1512804506(L_20, /*hidden argument*/NULL); V_1 = L_21; AnimationTriggers_t115197445 * L_22 = __this->get_m_AnimationTriggers_7(); NullCheck(L_22); String_t* L_23 = AnimationTriggers_get_disabledTrigger_m2031458154(L_22, /*hidden argument*/NULL); V_2 = L_23; goto IL_00ca; } IL_00b7: { Color_t4194546905 L_24 = Color_get_black_m1687201969(NULL /*static, unused*/, /*hidden argument*/NULL); V_0 = L_24; V_1 = (Sprite_t3199167241 *)NULL; IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); String_t* L_25 = ((String_t_StaticFields*)String_t_il2cpp_TypeInfo_var->static_fields)->get_Empty_2(); V_2 = L_25; goto IL_00ca; } IL_00ca: { GameObject_t3674682005 * L_26 = Component_get_gameObject_m1170635899(__this, /*hidden argument*/NULL); NullCheck(L_26); bool L_27 = GameObject_get_activeInHierarchy_m612450965(L_26, /*hidden argument*/NULL); if (!L_27) { goto IL_0131; } } { int32_t L_28 = __this->get_m_Transition_4(); V_4 = L_28; int32_t L_29 = V_4; if (((int32_t)((int32_t)L_29-(int32_t)1)) == 0) { goto IL_00fc; } if (((int32_t)((int32_t)L_29-(int32_t)1)) == 1) { goto IL_0119; } if (((int32_t)((int32_t)L_29-(int32_t)1)) == 2) { goto IL_0125; } } { goto IL_0131; } IL_00fc: { Color_t4194546905 L_30 = V_0; ColorBlock_t508458230 * L_31 = __this->get_address_of_m_Colors_5(); float L_32 = ColorBlock_get_colorMultiplier_m2799886278(L_31, /*hidden argument*/NULL); Color_t4194546905 L_33 = Color_op_Multiply_m204757678(NULL /*static, unused*/, L_30, L_32, /*hidden argument*/NULL); bool L_34 = ___instant1; Selectable_StartColorTween_m2559093428(__this, L_33, L_34, /*hidden argument*/NULL); goto IL_0131; } IL_0119: { Sprite_t3199167241 * L_35 = V_1; Selectable_DoSpriteSwap_m1929545238(__this, L_35, /*hidden argument*/NULL); goto IL_0131; } IL_0125: { String_t* L_36 = V_2; Selectable_TriggerAnimation_m2433448647(__this, L_36, /*hidden argument*/NULL); goto IL_0131; } IL_0131: { return; } } // UnityEngine.UI.Selectable UnityEngine.UI.Selectable::FindSelectable(UnityEngine.Vector3) extern Il2CppClass* RectTransform_t972643934_il2cpp_TypeInfo_var; extern Il2CppClass* Selectable_t1885181538_il2cpp_TypeInfo_var; extern const MethodInfo* List_1_get_Item_m3532330948_MethodInfo_var; extern const MethodInfo* List_1_get_Count_m1907518193_MethodInfo_var; extern const uint32_t Selectable_FindSelectable_m1109039701_MetadataUsageId; extern "C" Selectable_t1885181538 * Selectable_FindSelectable_m1109039701 (Selectable_t1885181538 * __this, Vector3_t4282066566 ___dir0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Selectable_FindSelectable_m1109039701_MetadataUsageId); s_Il2CppMethodIntialized = true; } Vector3_t4282066566 V_0; memset(&V_0, 0, sizeof(V_0)); Vector3_t4282066566 V_1; memset(&V_1, 0, sizeof(V_1)); float V_2 = 0.0f; Selectable_t1885181538 * V_3 = NULL; int32_t V_4 = 0; Selectable_t1885181538 * V_5 = NULL; RectTransform_t972643934 * V_6 = NULL; Vector3_t4282066566 V_7; memset(&V_7, 0, sizeof(V_7)); Vector3_t4282066566 V_8; memset(&V_8, 0, sizeof(V_8)); float V_9 = 0.0f; float V_10 = 0.0f; Navigation_t1108456480 V_11; memset(&V_11, 0, sizeof(V_11)); Rect_t4241904616 V_12; memset(&V_12, 0, sizeof(V_12)); Vector3_t4282066566 G_B10_0; memset(&G_B10_0, 0, sizeof(G_B10_0)); { Vector3_t4282066566 L_0 = Vector3_get_normalized_m2650940353((&___dir0), /*hidden argument*/NULL); ___dir0 = L_0; Transform_t1659122786 * L_1 = Component_get_transform_m4257140443(__this, /*hidden argument*/NULL); NullCheck(L_1); Quaternion_t1553702882 L_2 = Transform_get_rotation_m11483428(L_1, /*hidden argument*/NULL); Quaternion_t1553702882 L_3 = Quaternion_Inverse_m3542515566(NULL /*static, unused*/, L_2, /*hidden argument*/NULL); Vector3_t4282066566 L_4 = ___dir0; Vector3_t4282066566 L_5 = Quaternion_op_Multiply_m3771288979(NULL /*static, unused*/, L_3, L_4, /*hidden argument*/NULL); V_0 = L_5; Transform_t1659122786 * L_6 = Component_get_transform_m4257140443(__this, /*hidden argument*/NULL); Transform_t1659122786 * L_7 = Component_get_transform_m4257140443(__this, /*hidden argument*/NULL); Vector3_t4282066566 L_8 = V_0; Vector2_t4282066565 L_9 = Vector2_op_Implicit_m4083860659(NULL /*static, unused*/, L_8, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(Selectable_t1885181538_il2cpp_TypeInfo_var); Vector3_t4282066566 L_10 = Selectable_GetPointOnRectEdge_m371681446(NULL /*static, unused*/, ((RectTransform_t972643934 *)IsInstSealed(L_7, RectTransform_t972643934_il2cpp_TypeInfo_var)), L_9, /*hidden argument*/NULL); NullCheck(L_6); Vector3_t4282066566 L_11 = Transform_TransformPoint_m437395512(L_6, L_10, /*hidden argument*/NULL); V_1 = L_11; V_2 = (-std::numeric_limits<float>::infinity()); V_3 = (Selectable_t1885181538 *)NULL; V_4 = 0; goto IL_0132; } IL_0052: { IL2CPP_RUNTIME_CLASS_INIT(Selectable_t1885181538_il2cpp_TypeInfo_var); List_1_t3253367090 * L_12 = ((Selectable_t1885181538_StaticFields*)Selectable_t1885181538_il2cpp_TypeInfo_var->static_fields)->get_s_List_2(); int32_t L_13 = V_4; NullCheck(L_12); Selectable_t1885181538 * L_14 = List_1_get_Item_m3532330948(L_12, L_13, /*hidden argument*/List_1_get_Item_m3532330948_MethodInfo_var); V_5 = L_14; Selectable_t1885181538 * L_15 = V_5; bool L_16 = Object_op_Equality_m3964590952(NULL /*static, unused*/, L_15, __this, /*hidden argument*/NULL); if (L_16) { goto IL_007a; } } { Selectable_t1885181538 * L_17 = V_5; bool L_18 = Object_op_Equality_m3964590952(NULL /*static, unused*/, L_17, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_18) { goto IL_007f; } } IL_007a: { goto IL_012c; } IL_007f: { Selectable_t1885181538 * L_19 = V_5; NullCheck(L_19); bool L_20 = VirtFuncInvoker0< bool >::Invoke(23 /* System.Boolean UnityEngine.UI.Selectable::IsInteractable() */, L_19); if (!L_20) { goto IL_00a0; } } { Selectable_t1885181538 * L_21 = V_5; NullCheck(L_21); Navigation_t1108456480 L_22 = Selectable_get_navigation_m3138151376(L_21, /*hidden argument*/NULL); V_11 = L_22; int32_t L_23 = Navigation_get_mode_m721480509((&V_11), /*hidden argument*/NULL); if (L_23) { goto IL_00a5; } } IL_00a0: { goto IL_012c; } IL_00a5: { Selectable_t1885181538 * L_24 = V_5; NullCheck(L_24); Transform_t1659122786 * L_25 = Component_get_transform_m4257140443(L_24, /*hidden argument*/NULL); V_6 = ((RectTransform_t972643934 *)IsInstSealed(L_25, RectTransform_t972643934_il2cpp_TypeInfo_var)); RectTransform_t972643934 * L_26 = V_6; bool L_27 = Object_op_Inequality_m1296218211(NULL /*static, unused*/, L_26, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_27) { goto IL_00da; } } { RectTransform_t972643934 * L_28 = V_6; NullCheck(L_28); Rect_t4241904616 L_29 = RectTransform_get_rect_m1566017036(L_28, /*hidden argument*/NULL); V_12 = L_29; Vector2_t4282066565 L_30 = Rect_get_center_m610643572((&V_12), /*hidden argument*/NULL); Vector3_t4282066566 L_31 = Vector2_op_Implicit_m482286037(NULL /*static, unused*/, L_30, /*hidden argument*/NULL); G_B10_0 = L_31; goto IL_00df; } IL_00da: { Vector3_t4282066566 L_32 = Vector3_get_zero_m2017759730(NULL /*static, unused*/, /*hidden argument*/NULL); G_B10_0 = L_32; } IL_00df: { V_7 = G_B10_0; Selectable_t1885181538 * L_33 = V_5; NullCheck(L_33); Transform_t1659122786 * L_34 = Component_get_transform_m4257140443(L_33, /*hidden argument*/NULL); Vector3_t4282066566 L_35 = V_7; NullCheck(L_34); Vector3_t4282066566 L_36 = Transform_TransformPoint_m437395512(L_34, L_35, /*hidden argument*/NULL); Vector3_t4282066566 L_37 = V_1; Vector3_t4282066566 L_38 = Vector3_op_Subtraction_m2842958165(NULL /*static, unused*/, L_36, L_37, /*hidden argument*/NULL); V_8 = L_38; Vector3_t4282066566 L_39 = ___dir0; Vector3_t4282066566 L_40 = V_8; float L_41 = Vector3_Dot_m2370485424(NULL /*static, unused*/, L_39, L_40, /*hidden argument*/NULL); V_9 = L_41; float L_42 = V_9; if ((!(((float)L_42) <= ((float)(0.0f))))) { goto IL_0112; } } { goto IL_012c; } IL_0112: { float L_43 = V_9; float L_44 = Vector3_get_sqrMagnitude_m1207423764((&V_8), /*hidden argument*/NULL); V_10 = ((float)((float)L_43/(float)L_44)); float L_45 = V_10; float L_46 = V_2; if ((!(((float)L_45) > ((float)L_46)))) { goto IL_012c; } } { float L_47 = V_10; V_2 = L_47; Selectable_t1885181538 * L_48 = V_5; V_3 = L_48; } IL_012c: { int32_t L_49 = V_4; V_4 = ((int32_t)((int32_t)L_49+(int32_t)1)); } IL_0132: { int32_t L_50 = V_4; IL2CPP_RUNTIME_CLASS_INIT(Selectable_t1885181538_il2cpp_TypeInfo_var); List_1_t3253367090 * L_51 = ((Selectable_t1885181538_StaticFields*)Selectable_t1885181538_il2cpp_TypeInfo_var->static_fields)->get_s_List_2(); NullCheck(L_51); int32_t L_52 = List_1_get_Count_m1907518193(L_51, /*hidden argument*/List_1_get_Count_m1907518193_MethodInfo_var); if ((((int32_t)L_50) < ((int32_t)L_52))) { goto IL_0052; } } { Selectable_t1885181538 * L_53 = V_3; return L_53; } } // UnityEngine.Vector3 UnityEngine.UI.Selectable::GetPointOnRectEdge(UnityEngine.RectTransform,UnityEngine.Vector2) extern Il2CppClass* Mathf_t4203372500_il2cpp_TypeInfo_var; extern const uint32_t Selectable_GetPointOnRectEdge_m371681446_MetadataUsageId; extern "C" Vector3_t4282066566 Selectable_GetPointOnRectEdge_m371681446 (Il2CppObject * __this /* static, unused */, RectTransform_t972643934 * ___rect0, Vector2_t4282066565 ___dir1, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Selectable_GetPointOnRectEdge_m371681446_MetadataUsageId); s_Il2CppMethodIntialized = true; } Rect_t4241904616 V_0; memset(&V_0, 0, sizeof(V_0)); Rect_t4241904616 V_1; memset(&V_1, 0, sizeof(V_1)); { RectTransform_t972643934 * L_0 = ___rect0; bool L_1 = Object_op_Equality_m3964590952(NULL /*static, unused*/, L_0, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_1) { goto IL_0012; } } { Vector3_t4282066566 L_2 = Vector3_get_zero_m2017759730(NULL /*static, unused*/, /*hidden argument*/NULL); return L_2; } IL_0012: { Vector2_t4282066565 L_3 = ___dir1; Vector2_t4282066565 L_4 = Vector2_get_zero_m199872368(NULL /*static, unused*/, /*hidden argument*/NULL); bool L_5 = Vector2_op_Inequality_m1638984867(NULL /*static, unused*/, L_3, L_4, /*hidden argument*/NULL); if (!L_5) { goto IL_0047; } } { Vector2_t4282066565 L_6 = ___dir1; float L_7 = (&___dir1)->get_x_1(); IL2CPP_RUNTIME_CLASS_INIT(Mathf_t4203372500_il2cpp_TypeInfo_var); float L_8 = fabsf(L_7); float L_9 = (&___dir1)->get_y_2(); float L_10 = fabsf(L_9); float L_11 = Mathf_Max_m3923796455(NULL /*static, unused*/, L_8, L_10, /*hidden argument*/NULL); Vector2_t4282066565 L_12 = Vector2_op_Division_m747627697(NULL /*static, unused*/, L_6, L_11, /*hidden argument*/NULL); ___dir1 = L_12; } IL_0047: { RectTransform_t972643934 * L_13 = ___rect0; NullCheck(L_13); Rect_t4241904616 L_14 = RectTransform_get_rect_m1566017036(L_13, /*hidden argument*/NULL); V_0 = L_14; Vector2_t4282066565 L_15 = Rect_get_center_m610643572((&V_0), /*hidden argument*/NULL); RectTransform_t972643934 * L_16 = ___rect0; NullCheck(L_16); Rect_t4241904616 L_17 = RectTransform_get_rect_m1566017036(L_16, /*hidden argument*/NULL); V_1 = L_17; Vector2_t4282066565 L_18 = Rect_get_size_m136480416((&V_1), /*hidden argument*/NULL); Vector2_t4282066565 L_19 = ___dir1; Vector2_t4282066565 L_20 = Vector2_op_Multiply_m1738245082(NULL /*static, unused*/, L_19, (0.5f), /*hidden argument*/NULL); Vector2_t4282066565 L_21 = Vector2_Scale_m1743563745(NULL /*static, unused*/, L_18, L_20, /*hidden argument*/NULL); Vector2_t4282066565 L_22 = Vector2_op_Addition_m1173049553(NULL /*static, unused*/, L_15, L_21, /*hidden argument*/NULL); ___dir1 = L_22; Vector2_t4282066565 L_23 = ___dir1; Vector3_t4282066566 L_24 = Vector2_op_Implicit_m482286037(NULL /*static, unused*/, L_23, /*hidden argument*/NULL); return L_24; } } // System.Void UnityEngine.UI.Selectable::Navigate(UnityEngine.EventSystems.AxisEventData,UnityEngine.UI.Selectable) extern "C" void Selectable_Navigate_m2039225725 (Selectable_t1885181538 * __this, AxisEventData_t3355659985 * ___eventData0, Selectable_t1885181538 * ___sel1, const MethodInfo* method) { { Selectable_t1885181538 * L_0 = ___sel1; bool L_1 = Object_op_Inequality_m1296218211(NULL /*static, unused*/, L_0, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_1) { goto IL_0023; } } { Selectable_t1885181538 * L_2 = ___sel1; NullCheck(L_2); bool L_3 = VirtFuncInvoker0< bool >::Invoke(9 /* System.Boolean UnityEngine.EventSystems.UIBehaviour::IsActive() */, L_2); if (!L_3) { goto IL_0023; } } { AxisEventData_t3355659985 * L_4 = ___eventData0; Selectable_t1885181538 * L_5 = ___sel1; NullCheck(L_5); GameObject_t3674682005 * L_6 = Component_get_gameObject_m1170635899(L_5, /*hidden argument*/NULL); NullCheck(L_4); BaseEventData_set_selectedObject_m3912430657(L_4, L_6, /*hidden argument*/NULL); } IL_0023: { return; } } // UnityEngine.UI.Selectable UnityEngine.UI.Selectable::FindSelectableOnLeft() extern "C" Selectable_t1885181538 * Selectable_FindSelectableOnLeft_m3101734378 (Selectable_t1885181538 * __this, const MethodInfo* method) { { Navigation_t1108456480 * L_0 = __this->get_address_of_m_Navigation_3(); int32_t L_1 = Navigation_get_mode_m721480509(L_0, /*hidden argument*/NULL); if ((!(((uint32_t)L_1) == ((uint32_t)4)))) { goto IL_001d; } } { Navigation_t1108456480 * L_2 = __this->get_address_of_m_Navigation_3(); Selectable_t1885181538 * L_3 = Navigation_get_selectOnLeft_m1149209502(L_2, /*hidden argument*/NULL); return L_3; } IL_001d: { Navigation_t1108456480 * L_4 = __this->get_address_of_m_Navigation_3(); int32_t L_5 = Navigation_get_mode_m721480509(L_4, /*hidden argument*/NULL); if (!((int32_t)((int32_t)L_5&(int32_t)1))) { goto IL_004b; } } { Transform_t1659122786 * L_6 = Component_get_transform_m4257140443(__this, /*hidden argument*/NULL); NullCheck(L_6); Quaternion_t1553702882 L_7 = Transform_get_rotation_m11483428(L_6, /*hidden argument*/NULL); Vector3_t4282066566 L_8 = Vector3_get_left_m1616598929(NULL /*static, unused*/, /*hidden argument*/NULL); Vector3_t4282066566 L_9 = Quaternion_op_Multiply_m3771288979(NULL /*static, unused*/, L_7, L_8, /*hidden argument*/NULL); Selectable_t1885181538 * L_10 = Selectable_FindSelectable_m1109039701(__this, L_9, /*hidden argument*/NULL); return L_10; } IL_004b: { return (Selectable_t1885181538 *)NULL; } } // UnityEngine.UI.Selectable UnityEngine.UI.Selectable::FindSelectableOnRight() extern "C" Selectable_t1885181538 * Selectable_FindSelectableOnRight_m2809695675 (Selectable_t1885181538 * __this, const MethodInfo* method) { { Navigation_t1108456480 * L_0 = __this->get_address_of_m_Navigation_3(); int32_t L_1 = Navigation_get_mode_m721480509(L_0, /*hidden argument*/NULL); if ((!(((uint32_t)L_1) == ((uint32_t)4)))) { goto IL_001d; } } { Navigation_t1108456480 * L_2 = __this->get_address_of_m_Navigation_3(); Selectable_t1885181538 * L_3 = Navigation_get_selectOnRight_m2410966663(L_2, /*hidden argument*/NULL); return L_3; } IL_001d: { Navigation_t1108456480 * L_4 = __this->get_address_of_m_Navigation_3(); int32_t L_5 = Navigation_get_mode_m721480509(L_4, /*hidden argument*/NULL); if (!((int32_t)((int32_t)L_5&(int32_t)1))) { goto IL_004b; } } { Transform_t1659122786 * L_6 = Component_get_transform_m4257140443(__this, /*hidden argument*/NULL); NullCheck(L_6); Quaternion_t1553702882 L_7 = Transform_get_rotation_m11483428(L_6, /*hidden argument*/NULL); Vector3_t4282066566 L_8 = Vector3_get_right_m4015137012(NULL /*static, unused*/, /*hidden argument*/NULL); Vector3_t4282066566 L_9 = Quaternion_op_Multiply_m3771288979(NULL /*static, unused*/, L_7, L_8, /*hidden argument*/NULL); Selectable_t1885181538 * L_10 = Selectable_FindSelectable_m1109039701(__this, L_9, /*hidden argument*/NULL); return L_10; } IL_004b: { return (Selectable_t1885181538 *)NULL; } } // UnityEngine.UI.Selectable UnityEngine.UI.Selectable::FindSelectableOnUp() extern "C" Selectable_t1885181538 * Selectable_FindSelectableOnUp_m3489533950 (Selectable_t1885181538 * __this, const MethodInfo* method) { { Navigation_t1108456480 * L_0 = __this->get_address_of_m_Navigation_3(); int32_t L_1 = Navigation_get_mode_m721480509(L_0, /*hidden argument*/NULL); if ((!(((uint32_t)L_1) == ((uint32_t)4)))) { goto IL_001d; } } { Navigation_t1108456480 * L_2 = __this->get_address_of_m_Navigation_3(); Selectable_t1885181538 * L_3 = Navigation_get_selectOnUp_m2566832818(L_2, /*hidden argument*/NULL); return L_3; } IL_001d: { Navigation_t1108456480 * L_4 = __this->get_address_of_m_Navigation_3(); int32_t L_5 = Navigation_get_mode_m721480509(L_4, /*hidden argument*/NULL); if (!((int32_t)((int32_t)L_5&(int32_t)2))) { goto IL_004b; } } { Transform_t1659122786 * L_6 = Component_get_transform_m4257140443(__this, /*hidden argument*/NULL); NullCheck(L_6); Quaternion_t1553702882 L_7 = Transform_get_rotation_m11483428(L_6, /*hidden argument*/NULL); Vector3_t4282066566 L_8 = Vector3_get_up_m4046647141(NULL /*static, unused*/, /*hidden argument*/NULL); Vector3_t4282066566 L_9 = Quaternion_op_Multiply_m3771288979(NULL /*static, unused*/, L_7, L_8, /*hidden argument*/NULL); Selectable_t1885181538 * L_10 = Selectable_FindSelectable_m1109039701(__this, L_9, /*hidden argument*/NULL); return L_10; } IL_004b: { return (Selectable_t1885181538 *)NULL; } } // UnityEngine.UI.Selectable UnityEngine.UI.Selectable::FindSelectableOnDown() extern "C" Selectable_t1885181538 * Selectable_FindSelectableOnDown_m2882437061 (Selectable_t1885181538 * __this, const MethodInfo* method) { { Navigation_t1108456480 * L_0 = __this->get_address_of_m_Navigation_3(); int32_t L_1 = Navigation_get_mode_m721480509(L_0, /*hidden argument*/NULL); if ((!(((uint32_t)L_1) == ((uint32_t)4)))) { goto IL_001d; } } { Navigation_t1108456480 * L_2 = __this->get_address_of_m_Navigation_3(); Selectable_t1885181538 * L_3 = Navigation_get_selectOnDown_m929912185(L_2, /*hidden argument*/NULL); return L_3; } IL_001d: { Navigation_t1108456480 * L_4 = __this->get_address_of_m_Navigation_3(); int32_t L_5 = Navigation_get_mode_m721480509(L_4, /*hidden argument*/NULL); if (!((int32_t)((int32_t)L_5&(int32_t)2))) { goto IL_004b; } } { Transform_t1659122786 * L_6 = Component_get_transform_m4257140443(__this, /*hidden argument*/NULL); NullCheck(L_6); Quaternion_t1553702882 L_7 = Transform_get_rotation_m11483428(L_6, /*hidden argument*/NULL); Vector3_t4282066566 L_8 = Vector3_get_down_m1397301612(NULL /*static, unused*/, /*hidden argument*/NULL); Vector3_t4282066566 L_9 = Quaternion_op_Multiply_m3771288979(NULL /*static, unused*/, L_7, L_8, /*hidden argument*/NULL); Selectable_t1885181538 * L_10 = Selectable_FindSelectable_m1109039701(__this, L_9, /*hidden argument*/NULL); return L_10; } IL_004b: { return (Selectable_t1885181538 *)NULL; } } // System.Void UnityEngine.UI.Selectable::OnMove(UnityEngine.EventSystems.AxisEventData) extern "C" void Selectable_OnMove_m2478875177 (Selectable_t1885181538 * __this, AxisEventData_t3355659985 * ___eventData0, const MethodInfo* method) { int32_t V_0 = 0; { AxisEventData_t3355659985 * L_0 = ___eventData0; NullCheck(L_0); int32_t L_1 = AxisEventData_get_moveDir_m2739466109(L_0, /*hidden argument*/NULL); V_0 = L_1; int32_t L_2 = V_0; if (L_2 == 0) { goto IL_0046; } if (L_2 == 1) { goto IL_0034; } if (L_2 == 2) { goto IL_0022; } if (L_2 == 3) { goto IL_0058; } } { goto IL_006a; } IL_0022: { AxisEventData_t3355659985 * L_3 = ___eventData0; Selectable_t1885181538 * L_4 = VirtFuncInvoker0< Selectable_t1885181538 * >::Invoke(27 /* UnityEngine.UI.Selectable UnityEngine.UI.Selectable::FindSelectableOnRight() */, __this); Selectable_Navigate_m2039225725(__this, L_3, L_4, /*hidden argument*/NULL); goto IL_006a; } IL_0034: { AxisEventData_t3355659985 * L_5 = ___eventData0; Selectable_t1885181538 * L_6 = VirtFuncInvoker0< Selectable_t1885181538 * >::Invoke(28 /* UnityEngine.UI.Selectable UnityEngine.UI.Selectable::FindSelectableOnUp() */, __this); Selectable_Navigate_m2039225725(__this, L_5, L_6, /*hidden argument*/NULL); goto IL_006a; } IL_0046: { AxisEventData_t3355659985 * L_7 = ___eventData0; Selectable_t1885181538 * L_8 = VirtFuncInvoker0< Selectable_t1885181538 * >::Invoke(26 /* UnityEngine.UI.Selectable UnityEngine.UI.Selectable::FindSelectableOnLeft() */, __this); Selectable_Navigate_m2039225725(__this, L_7, L_8, /*hidden argument*/NULL); goto IL_006a; } IL_0058: { AxisEventData_t3355659985 * L_9 = ___eventData0; Selectable_t1885181538 * L_10 = VirtFuncInvoker0< Selectable_t1885181538 * >::Invoke(29 /* UnityEngine.UI.Selectable UnityEngine.UI.Selectable::FindSelectableOnDown() */, __this); Selectable_Navigate_m2039225725(__this, L_9, L_10, /*hidden argument*/NULL); goto IL_006a; } IL_006a: { return; } } // System.Void UnityEngine.UI.Selectable::StartColorTween(UnityEngine.Color,System.Boolean) extern "C" void Selectable_StartColorTween_m2559093428 (Selectable_t1885181538 * __this, Color_t4194546905 ___targetColor0, bool ___instant1, const MethodInfo* method) { Color_t4194546905 G_B4_0; memset(&G_B4_0, 0, sizeof(G_B4_0)); Graphic_t836799438 * G_B4_1 = NULL; Color_t4194546905 G_B3_0; memset(&G_B3_0, 0, sizeof(G_B3_0)); Graphic_t836799438 * G_B3_1 = NULL; float G_B5_0 = 0.0f; Color_t4194546905 G_B5_1; memset(&G_B5_1, 0, sizeof(G_B5_1)); Graphic_t836799438 * G_B5_2 = NULL; { Graphic_t836799438 * L_0 = __this->get_m_TargetGraphic_9(); bool L_1 = Object_op_Equality_m3964590952(NULL /*static, unused*/, L_0, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_1) { goto IL_0012; } } { return; } IL_0012: { Graphic_t836799438 * L_2 = __this->get_m_TargetGraphic_9(); Color_t4194546905 L_3 = ___targetColor0; bool L_4 = ___instant1; G_B3_0 = L_3; G_B3_1 = L_2; if (!L_4) { G_B4_0 = L_3; G_B4_1 = L_2; goto IL_0029; } } { G_B5_0 = (0.0f); G_B5_1 = G_B3_0; G_B5_2 = G_B3_1; goto IL_0034; } IL_0029: { ColorBlock_t508458230 * L_5 = __this->get_address_of_m_Colors_5(); float L_6 = ColorBlock_get_fadeDuration_m2386809488(L_5, /*hidden argument*/NULL); G_B5_0 = L_6; G_B5_1 = G_B4_0; G_B5_2 = G_B4_1; } IL_0034: { NullCheck(G_B5_2); Graphic_CrossFadeColor_m3194947827(G_B5_2, G_B5_1, G_B5_0, (bool)1, (bool)1, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.UI.Selectable::DoSpriteSwap(UnityEngine.Sprite) extern "C" void Selectable_DoSpriteSwap_m1929545238 (Selectable_t1885181538 * __this, Sprite_t3199167241 * ___newSprite0, const MethodInfo* method) { { Image_t538875265 * L_0 = Selectable_get_image_m978701700(__this, /*hidden argument*/NULL); bool L_1 = Object_op_Equality_m3964590952(NULL /*static, unused*/, L_0, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_1) { goto IL_0012; } } { return; } IL_0012: { Image_t538875265 * L_2 = Selectable_get_image_m978701700(__this, /*hidden argument*/NULL); Sprite_t3199167241 * L_3 = ___newSprite0; NullCheck(L_2); Image_set_overrideSprite_m129622486(L_2, L_3, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.UI.Selectable::TriggerAnimation(System.String) extern Il2CppClass* String_t_il2cpp_TypeInfo_var; extern const uint32_t Selectable_TriggerAnimation_m2433448647_MetadataUsageId; extern "C" void Selectable_TriggerAnimation_m2433448647 (Selectable_t1885181538 * __this, String_t* ___triggername0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Selectable_TriggerAnimation_m2433448647_MetadataUsageId); s_Il2CppMethodIntialized = true; } { Animator_t2776330603 * L_0 = Selectable_get_animator_m1533578598(__this, /*hidden argument*/NULL); bool L_1 = Object_op_Equality_m3964590952(NULL /*static, unused*/, L_0, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (L_1) { goto IL_0042; } } { Animator_t2776330603 * L_2 = Selectable_get_animator_m1533578598(__this, /*hidden argument*/NULL); NullCheck(L_2); bool L_3 = Behaviour_get_isActiveAndEnabled_m210167461(L_2, /*hidden argument*/NULL); if (!L_3) { goto IL_0042; } } { Animator_t2776330603 * L_4 = Selectable_get_animator_m1533578598(__this, /*hidden argument*/NULL); NullCheck(L_4); RuntimeAnimatorController_t274649809 * L_5 = Animator_get_runtimeAnimatorController_m1822082727(L_4, /*hidden argument*/NULL); bool L_6 = Object_op_Equality_m3964590952(NULL /*static, unused*/, L_5, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (L_6) { goto IL_0042; } } { String_t* L_7 = ___triggername0; IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); bool L_8 = String_IsNullOrEmpty_m1256468773(NULL /*static, unused*/, L_7, /*hidden argument*/NULL); if (!L_8) { goto IL_0043; } } IL_0042: { return; } IL_0043: { Animator_t2776330603 * L_9 = Selectable_get_animator_m1533578598(__this, /*hidden argument*/NULL); AnimationTriggers_t115197445 * L_10 = __this->get_m_AnimationTriggers_7(); NullCheck(L_10); String_t* L_11 = AnimationTriggers_get_normalTrigger_m326085791(L_10, /*hidden argument*/NULL); NullCheck(L_9); Animator_ResetTrigger_m4152421915(L_9, L_11, /*hidden argument*/NULL); Animator_t2776330603 * L_12 = Selectable_get_animator_m1533578598(__this, /*hidden argument*/NULL); AnimationTriggers_t115197445 * L_13 = __this->get_m_AnimationTriggers_7(); NullCheck(L_13); String_t* L_14 = AnimationTriggers_get_pressedTrigger_m3081240394(L_13, /*hidden argument*/NULL); NullCheck(L_12); Animator_ResetTrigger_m4152421915(L_12, L_14, /*hidden argument*/NULL); Animator_t2776330603 * L_15 = Selectable_get_animator_m1533578598(__this, /*hidden argument*/NULL); AnimationTriggers_t115197445 * L_16 = __this->get_m_AnimationTriggers_7(); NullCheck(L_16); String_t* L_17 = AnimationTriggers_get_highlightedTrigger_m1862702265(L_16, /*hidden argument*/NULL); NullCheck(L_15); Animator_ResetTrigger_m4152421915(L_15, L_17, /*hidden argument*/NULL); Animator_t2776330603 * L_18 = Selectable_get_animator_m1533578598(__this, /*hidden argument*/NULL); AnimationTriggers_t115197445 * L_19 = __this->get_m_AnimationTriggers_7(); NullCheck(L_19); String_t* L_20 = AnimationTriggers_get_disabledTrigger_m2031458154(L_19, /*hidden argument*/NULL); NullCheck(L_18); Animator_ResetTrigger_m4152421915(L_18, L_20, /*hidden argument*/NULL); Animator_t2776330603 * L_21 = Selectable_get_animator_m1533578598(__this, /*hidden argument*/NULL); String_t* L_22 = ___triggername0; NullCheck(L_21); Animator_SetTrigger_m514363822(L_21, L_22, /*hidden argument*/NULL); return; } } // System.Boolean UnityEngine.UI.Selectable::IsHighlighted(UnityEngine.EventSystems.BaseEventData) extern Il2CppClass* PointerEventData_t1848751023_il2cpp_TypeInfo_var; extern const uint32_t Selectable_IsHighlighted_m4047826052_MetadataUsageId; extern "C" bool Selectable_IsHighlighted_m4047826052 (Selectable_t1885181538 * __this, BaseEventData_t2054899105 * ___eventData0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Selectable_IsHighlighted_m4047826052_MetadataUsageId); s_Il2CppMethodIntialized = true; } bool V_0 = false; PointerEventData_t1848751023 * V_1 = NULL; bool G_B8_0 = false; bool G_B6_0 = false; bool G_B7_0 = false; bool G_B16_0 = false; bool G_B11_0 = false; bool G_B9_0 = false; bool G_B10_0 = false; bool G_B14_0 = false; bool G_B12_0 = false; bool G_B13_0 = false; int32_t G_B15_0 = 0; bool G_B15_1 = false; int32_t G_B17_0 = 0; bool G_B17_1 = false; { bool L_0 = VirtFuncInvoker0< bool >::Invoke(9 /* System.Boolean UnityEngine.EventSystems.UIBehaviour::IsActive() */, __this); if (L_0) { goto IL_000d; } } { return (bool)0; } IL_000d: { bool L_1 = Selectable_IsPressed_m2192098489(__this, /*hidden argument*/NULL); if (!L_1) { goto IL_001a; } } { return (bool)0; } IL_001a: { bool L_2 = Selectable_get_hasSelection_m771189340(__this, /*hidden argument*/NULL); V_0 = L_2; BaseEventData_t2054899105 * L_3 = ___eventData0; if (!((PointerEventData_t1848751023 *)IsInstClass(L_3, PointerEventData_t1848751023_il2cpp_TypeInfo_var))) { goto IL_00bb; } } { BaseEventData_t2054899105 * L_4 = ___eventData0; V_1 = ((PointerEventData_t1848751023 *)IsInstClass(L_4, PointerEventData_t1848751023_il2cpp_TypeInfo_var)); bool L_5 = V_0; bool L_6 = Selectable_get_isPointerDown_m451775501(__this, /*hidden argument*/NULL); G_B6_0 = L_5; if (!L_6) { G_B8_0 = L_5; goto IL_0060; } } { bool L_7 = Selectable_get_isPointerInside_m3778852455(__this, /*hidden argument*/NULL); G_B7_0 = G_B6_0; if (L_7) { G_B8_0 = G_B6_0; goto IL_0060; } } { PointerEventData_t1848751023 * L_8 = V_1; NullCheck(L_8); GameObject_t3674682005 * L_9 = PointerEventData_get_pointerPress_m3028028234(L_8, /*hidden argument*/NULL); GameObject_t3674682005 * L_10 = Component_get_gameObject_m1170635899(__this, /*hidden argument*/NULL); bool L_11 = Object_op_Equality_m3964590952(NULL /*static, unused*/, L_9, L_10, /*hidden argument*/NULL); G_B8_0 = G_B7_0; if (L_11) { G_B16_0 = G_B7_0; goto IL_00b3; } } IL_0060: { bool L_12 = Selectable_get_isPointerDown_m451775501(__this, /*hidden argument*/NULL); G_B9_0 = G_B8_0; if (L_12) { G_B11_0 = G_B8_0; goto IL_008c; } } { bool L_13 = Selectable_get_isPointerInside_m3778852455(__this, /*hidden argument*/NULL); G_B10_0 = G_B9_0; if (!L_13) { G_B11_0 = G_B9_0; goto IL_008c; } } { PointerEventData_t1848751023 * L_14 = V_1; NullCheck(L_14); GameObject_t3674682005 * L_15 = PointerEventData_get_pointerPress_m3028028234(L_14, /*hidden argument*/NULL); GameObject_t3674682005 * L_16 = Component_get_gameObject_m1170635899(__this, /*hidden argument*/NULL); bool L_17 = Object_op_Equality_m3964590952(NULL /*static, unused*/, L_15, L_16, /*hidden argument*/NULL); G_B11_0 = G_B10_0; if (L_17) { G_B16_0 = G_B10_0; goto IL_00b3; } } IL_008c: { bool L_18 = Selectable_get_isPointerDown_m451775501(__this, /*hidden argument*/NULL); G_B12_0 = G_B11_0; if (L_18) { G_B14_0 = G_B11_0; goto IL_00b0; } } { bool L_19 = Selectable_get_isPointerInside_m3778852455(__this, /*hidden argument*/NULL); G_B13_0 = G_B12_0; if (!L_19) { G_B14_0 = G_B12_0; goto IL_00b0; } } { PointerEventData_t1848751023 * L_20 = V_1; NullCheck(L_20); GameObject_t3674682005 * L_21 = PointerEventData_get_pointerPress_m3028028234(L_20, /*hidden argument*/NULL); bool L_22 = Object_op_Equality_m3964590952(NULL /*static, unused*/, L_21, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); G_B15_0 = ((int32_t)(L_22)); G_B15_1 = G_B13_0; goto IL_00b1; } IL_00b0: { G_B15_0 = 0; G_B15_1 = G_B14_0; } IL_00b1: { G_B17_0 = G_B15_0; G_B17_1 = G_B15_1; goto IL_00b4; } IL_00b3: { G_B17_0 = 1; G_B17_1 = G_B16_0; } IL_00b4: { V_0 = (bool)((int32_t)((int32_t)G_B17_1|(int32_t)G_B17_0)); goto IL_00c4; } IL_00bb: { bool L_23 = V_0; bool L_24 = Selectable_get_isPointerInside_m3778852455(__this, /*hidden argument*/NULL); V_0 = (bool)((int32_t)((int32_t)L_23|(int32_t)L_24)); } IL_00c4: { bool L_25 = V_0; return L_25; } } // System.Boolean UnityEngine.UI.Selectable::IsPressed(UnityEngine.EventSystems.BaseEventData) extern "C" bool Selectable_IsPressed_m3407797331 (Selectable_t1885181538 * __this, BaseEventData_t2054899105 * ___eventData0, const MethodInfo* method) { { bool L_0 = Selectable_IsPressed_m2192098489(__this, /*hidden argument*/NULL); return L_0; } } // System.Boolean UnityEngine.UI.Selectable::IsPressed() extern "C" bool Selectable_IsPressed_m2192098489 (Selectable_t1885181538 * __this, const MethodInfo* method) { int32_t G_B5_0 = 0; { bool L_0 = VirtFuncInvoker0< bool >::Invoke(9 /* System.Boolean UnityEngine.EventSystems.UIBehaviour::IsActive() */, __this); if (L_0) { goto IL_000d; } } { return (bool)0; } IL_000d: { bool L_1 = Selectable_get_isPointerInside_m3778852455(__this, /*hidden argument*/NULL); if (!L_1) { goto IL_0020; } } { bool L_2 = Selectable_get_isPointerDown_m451775501(__this, /*hidden argument*/NULL); G_B5_0 = ((int32_t)(L_2)); goto IL_0021; } IL_0020: { G_B5_0 = 0; } IL_0021: { return (bool)G_B5_0; } } // System.Void UnityEngine.UI.Selectable::UpdateSelectionState(UnityEngine.EventSystems.BaseEventData) extern "C" void Selectable_UpdateSelectionState_m2602683415 (Selectable_t1885181538 * __this, BaseEventData_t2054899105 * ___eventData0, const MethodInfo* method) { { bool L_0 = Selectable_IsPressed_m2192098489(__this, /*hidden argument*/NULL); if (!L_0) { goto IL_0013; } } { __this->set_m_CurrentSelectionState_11(2); return; } IL_0013: { BaseEventData_t2054899105 * L_1 = ___eventData0; bool L_2 = Selectable_IsHighlighted_m4047826052(__this, L_1, /*hidden argument*/NULL); if (!L_2) { goto IL_0027; } } { __this->set_m_CurrentSelectionState_11(1); return; } IL_0027: { __this->set_m_CurrentSelectionState_11(0); return; } } // System.Void UnityEngine.UI.Selectable::EvaluateAndTransitionToSelectionState(UnityEngine.EventSystems.BaseEventData) extern "C" void Selectable_EvaluateAndTransitionToSelectionState_m2419808192 (Selectable_t1885181538 * __this, BaseEventData_t2054899105 * ___eventData0, const MethodInfo* method) { { bool L_0 = VirtFuncInvoker0< bool >::Invoke(9 /* System.Boolean UnityEngine.EventSystems.UIBehaviour::IsActive() */, __this); if (L_0) { goto IL_000c; } } { return; } IL_000c: { BaseEventData_t2054899105 * L_1 = ___eventData0; Selectable_UpdateSelectionState_m2602683415(__this, L_1, /*hidden argument*/NULL); Selectable_InternalEvaluateAndTransitionToSelectionState_m543442976(__this, (bool)0, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.UI.Selectable::InternalEvaluateAndTransitionToSelectionState(System.Boolean) extern "C" void Selectable_InternalEvaluateAndTransitionToSelectionState_m543442976 (Selectable_t1885181538 * __this, bool ___instant0, const MethodInfo* method) { int32_t V_0 = 0; { int32_t L_0 = __this->get_m_CurrentSelectionState_11(); V_0 = L_0; bool L_1 = VirtFuncInvoker0< bool >::Invoke(9 /* System.Boolean UnityEngine.EventSystems.UIBehaviour::IsActive() */, __this); if (!L_1) { goto IL_001f; } } { bool L_2 = VirtFuncInvoker0< bool >::Invoke(23 /* System.Boolean UnityEngine.UI.Selectable::IsInteractable() */, __this); if (L_2) { goto IL_001f; } } { V_0 = 3; } IL_001f: { int32_t L_3 = V_0; bool L_4 = ___instant0; VirtActionInvoker2< int32_t, bool >::Invoke(25 /* System.Void UnityEngine.UI.Selectable::DoStateTransition(UnityEngine.UI.Selectable/SelectionState,System.Boolean) */, __this, L_3, L_4); return; } } // System.Void UnityEngine.UI.Selectable::OnPointerDown(UnityEngine.EventSystems.PointerEventData) extern Il2CppClass* EventSystem_t2276120119_il2cpp_TypeInfo_var; extern const uint32_t Selectable_OnPointerDown_m706592619_MetadataUsageId; extern "C" void Selectable_OnPointerDown_m706592619 (Selectable_t1885181538 * __this, PointerEventData_t1848751023 * ___eventData0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Selectable_OnPointerDown_m706592619_MetadataUsageId); s_Il2CppMethodIntialized = true; } Navigation_t1108456480 V_0; memset(&V_0, 0, sizeof(V_0)); { PointerEventData_t1848751023 * L_0 = ___eventData0; NullCheck(L_0); int32_t L_1 = PointerEventData_get_button_m796143251(L_0, /*hidden argument*/NULL); if (!L_1) { goto IL_000c; } } { return; } IL_000c: { bool L_2 = VirtFuncInvoker0< bool >::Invoke(23 /* System.Boolean UnityEngine.UI.Selectable::IsInteractable() */, __this); if (!L_2) { goto IL_004b; } } { Navigation_t1108456480 L_3 = Selectable_get_navigation_m3138151376(__this, /*hidden argument*/NULL); V_0 = L_3; int32_t L_4 = Navigation_get_mode_m721480509((&V_0), /*hidden argument*/NULL); if (!L_4) { goto IL_004b; } } { IL2CPP_RUNTIME_CLASS_INIT(EventSystem_t2276120119_il2cpp_TypeInfo_var); EventSystem_t2276120119 * L_5 = EventSystem_get_current_m3483537871(NULL /*static, unused*/, /*hidden argument*/NULL); bool L_6 = Object_op_Inequality_m1296218211(NULL /*static, unused*/, L_5, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_6) { goto IL_004b; } } { IL2CPP_RUNTIME_CLASS_INIT(EventSystem_t2276120119_il2cpp_TypeInfo_var); EventSystem_t2276120119 * L_7 = EventSystem_get_current_m3483537871(NULL /*static, unused*/, /*hidden argument*/NULL); GameObject_t3674682005 * L_8 = Component_get_gameObject_m1170635899(__this, /*hidden argument*/NULL); PointerEventData_t1848751023 * L_9 = ___eventData0; NullCheck(L_7); EventSystem_SetSelectedGameObject_m2116591616(L_7, L_8, L_9, /*hidden argument*/NULL); } IL_004b: { Selectable_set_isPointerDown_m2193598850(__this, (bool)1, /*hidden argument*/NULL); PointerEventData_t1848751023 * L_10 = ___eventData0; Selectable_EvaluateAndTransitionToSelectionState_m2419808192(__this, L_10, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.UI.Selectable::OnPointerUp(UnityEngine.EventSystems.PointerEventData) extern "C" void Selectable_OnPointerUp_m533192658 (Selectable_t1885181538 * __this, PointerEventData_t1848751023 * ___eventData0, const MethodInfo* method) { { PointerEventData_t1848751023 * L_0 = ___eventData0; NullCheck(L_0); int32_t L_1 = PointerEventData_get_button_m796143251(L_0, /*hidden argument*/NULL); if (!L_1) { goto IL_000c; } } { return; } IL_000c: { Selectable_set_isPointerDown_m2193598850(__this, (bool)0, /*hidden argument*/NULL); PointerEventData_t1848751023 * L_2 = ___eventData0; Selectable_EvaluateAndTransitionToSelectionState_m2419808192(__this, L_2, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.UI.Selectable::OnPointerEnter(UnityEngine.EventSystems.PointerEventData) extern "C" void Selectable_OnPointerEnter_m1831644693 (Selectable_t1885181538 * __this, PointerEventData_t1848751023 * ___eventData0, const MethodInfo* method) { { Selectable_set_isPointerInside_m1584068316(__this, (bool)1, /*hidden argument*/NULL); PointerEventData_t1848751023 * L_0 = ___eventData0; Selectable_EvaluateAndTransitionToSelectionState_m2419808192(__this, L_0, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.UI.Selectable::OnPointerExit(UnityEngine.EventSystems.PointerEventData) extern "C" void Selectable_OnPointerExit_m1099674991 (Selectable_t1885181538 * __this, PointerEventData_t1848751023 * ___eventData0, const MethodInfo* method) { { Selectable_set_isPointerInside_m1584068316(__this, (bool)0, /*hidden argument*/NULL); PointerEventData_t1848751023 * L_0 = ___eventData0; Selectable_EvaluateAndTransitionToSelectionState_m2419808192(__this, L_0, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.UI.Selectable::OnSelect(UnityEngine.EventSystems.BaseEventData) extern "C" void Selectable_OnSelect_m2798350404 (Selectable_t1885181538 * __this, BaseEventData_t2054899105 * ___eventData0, const MethodInfo* method) { { Selectable_set_hasSelection_m138443861(__this, (bool)1, /*hidden argument*/NULL); BaseEventData_t2054899105 * L_0 = ___eventData0; Selectable_EvaluateAndTransitionToSelectionState_m2419808192(__this, L_0, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.UI.Selectable::OnDeselect(UnityEngine.EventSystems.BaseEventData) extern "C" void Selectable_OnDeselect_m4120267717 (Selectable_t1885181538 * __this, BaseEventData_t2054899105 * ___eventData0, const MethodInfo* method) { { Selectable_set_hasSelection_m138443861(__this, (bool)0, /*hidden argument*/NULL); BaseEventData_t2054899105 * L_0 = ___eventData0; Selectable_EvaluateAndTransitionToSelectionState_m2419808192(__this, L_0, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.UI.Selectable::Select() extern Il2CppClass* EventSystem_t2276120119_il2cpp_TypeInfo_var; extern const uint32_t Selectable_Select_m2377336299_MetadataUsageId; extern "C" void Selectable_Select_m2377336299 (Selectable_t1885181538 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Selectable_Select_m2377336299_MetadataUsageId); s_Il2CppMethodIntialized = true; } { IL2CPP_RUNTIME_CLASS_INIT(EventSystem_t2276120119_il2cpp_TypeInfo_var); EventSystem_t2276120119 * L_0 = EventSystem_get_current_m3483537871(NULL /*static, unused*/, /*hidden argument*/NULL); bool L_1 = Object_op_Equality_m3964590952(NULL /*static, unused*/, L_0, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (L_1) { goto IL_001f; } } { IL2CPP_RUNTIME_CLASS_INIT(EventSystem_t2276120119_il2cpp_TypeInfo_var); EventSystem_t2276120119 * L_2 = EventSystem_get_current_m3483537871(NULL /*static, unused*/, /*hidden argument*/NULL); NullCheck(L_2); bool L_3 = EventSystem_get_alreadySelecting_m3074958957(L_2, /*hidden argument*/NULL); if (!L_3) { goto IL_0020; } } IL_001f: { return; } IL_0020: { IL2CPP_RUNTIME_CLASS_INIT(EventSystem_t2276120119_il2cpp_TypeInfo_var); EventSystem_t2276120119 * L_4 = EventSystem_get_current_m3483537871(NULL /*static, unused*/, /*hidden argument*/NULL); GameObject_t3674682005 * L_5 = Component_get_gameObject_m1170635899(__this, /*hidden argument*/NULL); NullCheck(L_4); EventSystem_SetSelectedGameObject_m1869236832(L_4, L_5, /*hidden argument*/NULL); return; } } // System.Boolean UnityEngine.UI.SetPropertyUtility::SetColor(UnityEngine.Color&,UnityEngine.Color) extern "C" bool SetPropertyUtility_SetColor_m4210708935 (Il2CppObject * __this /* static, unused */, Color_t4194546905 * ___currentValue0, Color_t4194546905 ___newValue1, const MethodInfo* method) { { Color_t4194546905 * L_0 = ___currentValue0; float L_1 = L_0->get_r_0(); float L_2 = (&___newValue1)->get_r_0(); if ((!(((float)L_1) == ((float)L_2)))) { goto IL_004a; } } { Color_t4194546905 * L_3 = ___currentValue0; float L_4 = L_3->get_g_1(); float L_5 = (&___newValue1)->get_g_1(); if ((!(((float)L_4) == ((float)L_5)))) { goto IL_004a; } } { Color_t4194546905 * L_6 = ___currentValue0; float L_7 = L_6->get_b_2(); float L_8 = (&___newValue1)->get_b_2(); if ((!(((float)L_7) == ((float)L_8)))) { goto IL_004a; } } { Color_t4194546905 * L_9 = ___currentValue0; float L_10 = L_9->get_a_3(); float L_11 = (&___newValue1)->get_a_3(); if ((!(((float)L_10) == ((float)L_11)))) { goto IL_004a; } } { return (bool)0; } IL_004a: { Color_t4194546905 * L_12 = ___currentValue0; Color_t4194546905 L_13 = ___newValue1; (*(Color_t4194546905 *)L_12) = L_13; return (bool)1; } } // System.Void UnityEngine.UI.Shadow::.ctor() extern "C" void Shadow__ctor_m2944649643 (Shadow_t75537580 * __this, const MethodInfo* method) { { Color_t4194546905 L_0; memset(&L_0, 0, sizeof(L_0)); Color__ctor_m2252924356(&L_0, (0.0f), (0.0f), (0.0f), (0.5f), /*hidden argument*/NULL); __this->set_m_EffectColor_4(L_0); Vector2_t4282066565 L_1; memset(&L_1, 0, sizeof(L_1)); Vector2__ctor_m1517109030(&L_1, (1.0f), (-1.0f), /*hidden argument*/NULL); __this->set_m_EffectDistance_5(L_1); __this->set_m_UseGraphicAlpha_6((bool)1); BaseMeshEffect__ctor_m2332499996(__this, /*hidden argument*/NULL); return; } } // UnityEngine.Color UnityEngine.UI.Shadow::get_effectColor() extern "C" Color_t4194546905 Shadow_get_effectColor_m2953989785 (Shadow_t75537580 * __this, const MethodInfo* method) { { Color_t4194546905 L_0 = __this->get_m_EffectColor_4(); return L_0; } } // System.Void UnityEngine.UI.Shadow::set_effectColor(UnityEngine.Color) extern "C" void Shadow_set_effectColor_m1407835720 (Shadow_t75537580 * __this, Color_t4194546905 ___value0, const MethodInfo* method) { { Color_t4194546905 L_0 = ___value0; __this->set_m_EffectColor_4(L_0); Graphic_t836799438 * L_1 = BaseMeshEffect_get_graphic_m2567098443(__this, /*hidden argument*/NULL); bool L_2 = Object_op_Inequality_m1296218211(NULL /*static, unused*/, L_1, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_2) { goto IL_0023; } } { Graphic_t836799438 * L_3 = BaseMeshEffect_get_graphic_m2567098443(__this, /*hidden argument*/NULL); NullCheck(L_3); VirtActionInvoker0::Invoke(23 /* System.Void UnityEngine.UI.Graphic::SetVerticesDirty() */, L_3); } IL_0023: { return; } } // UnityEngine.Vector2 UnityEngine.UI.Shadow::get_effectDistance() extern "C" Vector2_t4282066565 Shadow_get_effectDistance_m1102454733 (Shadow_t75537580 * __this, const MethodInfo* method) { { Vector2_t4282066565 L_0 = __this->get_m_EffectDistance_5(); return L_0; } } // System.Void UnityEngine.UI.Shadow::set_effectDistance(UnityEngine.Vector2) extern "C" void Shadow_set_effectDistance_m192801982 (Shadow_t75537580 * __this, Vector2_t4282066565 ___value0, const MethodInfo* method) { { float L_0 = (&___value0)->get_x_1(); if ((!(((float)L_0) > ((float)(600.0f))))) { goto IL_001d; } } { (&___value0)->set_x_1((600.0f)); } IL_001d: { float L_1 = (&___value0)->get_x_1(); if ((!(((float)L_1) < ((float)(-600.0f))))) { goto IL_003a; } } { (&___value0)->set_x_1((-600.0f)); } IL_003a: { float L_2 = (&___value0)->get_y_2(); if ((!(((float)L_2) > ((float)(600.0f))))) { goto IL_0057; } } { (&___value0)->set_y_2((600.0f)); } IL_0057: { float L_3 = (&___value0)->get_y_2(); if ((!(((float)L_3) < ((float)(-600.0f))))) { goto IL_0074; } } { (&___value0)->set_y_2((-600.0f)); } IL_0074: { Vector2_t4282066565 L_4 = __this->get_m_EffectDistance_5(); Vector2_t4282066565 L_5 = ___value0; bool L_6 = Vector2_op_Equality_m1927481448(NULL /*static, unused*/, L_4, L_5, /*hidden argument*/NULL); if (!L_6) { goto IL_0086; } } { return; } IL_0086: { Vector2_t4282066565 L_7 = ___value0; __this->set_m_EffectDistance_5(L_7); Graphic_t836799438 * L_8 = BaseMeshEffect_get_graphic_m2567098443(__this, /*hidden argument*/NULL); bool L_9 = Object_op_Inequality_m1296218211(NULL /*static, unused*/, L_8, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_9) { goto IL_00a9; } } { Graphic_t836799438 * L_10 = BaseMeshEffect_get_graphic_m2567098443(__this, /*hidden argument*/NULL); NullCheck(L_10); VirtActionInvoker0::Invoke(23 /* System.Void UnityEngine.UI.Graphic::SetVerticesDirty() */, L_10); } IL_00a9: { return; } } // System.Boolean UnityEngine.UI.Shadow::get_useGraphicAlpha() extern "C" bool Shadow_get_useGraphicAlpha_m3687634123 (Shadow_t75537580 * __this, const MethodInfo* method) { { bool L_0 = __this->get_m_UseGraphicAlpha_6(); return L_0; } } // System.Void UnityEngine.UI.Shadow::set_useGraphicAlpha(System.Boolean) extern "C" void Shadow_set_useGraphicAlpha_m3814129472 (Shadow_t75537580 * __this, bool ___value0, const MethodInfo* method) { { bool L_0 = ___value0; __this->set_m_UseGraphicAlpha_6(L_0); Graphic_t836799438 * L_1 = BaseMeshEffect_get_graphic_m2567098443(__this, /*hidden argument*/NULL); bool L_2 = Object_op_Inequality_m1296218211(NULL /*static, unused*/, L_1, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_2) { goto IL_0023; } } { Graphic_t836799438 * L_3 = BaseMeshEffect_get_graphic_m2567098443(__this, /*hidden argument*/NULL); NullCheck(L_3); VirtActionInvoker0::Invoke(23 /* System.Void UnityEngine.UI.Graphic::SetVerticesDirty() */, L_3); } IL_0023: { return; } } // System.Void UnityEngine.UI.Shadow::ApplyShadowZeroAlloc(System.Collections.Generic.List`1<UnityEngine.UIVertex>,UnityEngine.Color32,System.Int32,System.Int32,System.Single,System.Single) extern const MethodInfo* List_1_get_Count_m4277682313_MethodInfo_var; extern const MethodInfo* List_1_get_Capacity_m792627810_MethodInfo_var; extern const MethodInfo* List_1_set_Capacity_m3820333071_MethodInfo_var; extern const MethodInfo* List_1_get_Item_m3329257068_MethodInfo_var; extern const MethodInfo* List_1_Add_m3128100621_MethodInfo_var; extern const MethodInfo* List_1_set_Item_m1239619023_MethodInfo_var; extern const uint32_t Shadow_ApplyShadowZeroAlloc_m338158484_MetadataUsageId; extern "C" void Shadow_ApplyShadowZeroAlloc_m338158484 (Shadow_t75537580 * __this, List_1_t1317283468 * ___verts0, Color32_t598853688 ___color1, int32_t ___start2, int32_t ___end3, float ___x4, float ___y5, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Shadow_ApplyShadowZeroAlloc_m338158484_MetadataUsageId); s_Il2CppMethodIntialized = true; } UIVertex_t4244065212 V_0; memset(&V_0, 0, sizeof(V_0)); int32_t V_1 = 0; int32_t V_2 = 0; Vector3_t4282066566 V_3; memset(&V_3, 0, sizeof(V_3)); Color32_t598853688 V_4; memset(&V_4, 0, sizeof(V_4)); UIVertex_t4244065212 V_5; memset(&V_5, 0, sizeof(V_5)); { List_1_t1317283468 * L_0 = ___verts0; NullCheck(L_0); int32_t L_1 = List_1_get_Count_m4277682313(L_0, /*hidden argument*/List_1_get_Count_m4277682313_MethodInfo_var); int32_t L_2 = ___end3; int32_t L_3 = ___start2; V_1 = ((int32_t)((int32_t)((int32_t)((int32_t)L_1+(int32_t)L_2))-(int32_t)L_3)); List_1_t1317283468 * L_4 = ___verts0; NullCheck(L_4); int32_t L_5 = List_1_get_Capacity_m792627810(L_4, /*hidden argument*/List_1_get_Capacity_m792627810_MethodInfo_var); int32_t L_6 = V_1; if ((((int32_t)L_5) >= ((int32_t)L_6))) { goto IL_001f; } } { List_1_t1317283468 * L_7 = ___verts0; int32_t L_8 = V_1; NullCheck(L_7); List_1_set_Capacity_m3820333071(L_7, L_8, /*hidden argument*/List_1_set_Capacity_m3820333071_MethodInfo_var); } IL_001f: { int32_t L_9 = ___start2; V_2 = L_9; goto IL_00b3; } IL_0026: { List_1_t1317283468 * L_10 = ___verts0; int32_t L_11 = V_2; NullCheck(L_10); UIVertex_t4244065212 L_12 = List_1_get_Item_m3329257068(L_10, L_11, /*hidden argument*/List_1_get_Item_m3329257068_MethodInfo_var); V_0 = L_12; List_1_t1317283468 * L_13 = ___verts0; UIVertex_t4244065212 L_14 = V_0; NullCheck(L_13); List_1_Add_m3128100621(L_13, L_14, /*hidden argument*/List_1_Add_m3128100621_MethodInfo_var); Vector3_t4282066566 L_15 = (&V_0)->get_position_0(); V_3 = L_15; Vector3_t4282066566 * L_16 = (&V_3); float L_17 = L_16->get_x_1(); float L_18 = ___x4; L_16->set_x_1(((float)((float)L_17+(float)L_18))); Vector3_t4282066566 * L_19 = (&V_3); float L_20 = L_19->get_y_2(); float L_21 = ___y5; L_19->set_y_2(((float)((float)L_20+(float)L_21))); Vector3_t4282066566 L_22 = V_3; (&V_0)->set_position_0(L_22); Color32_t598853688 L_23 = ___color1; V_4 = L_23; bool L_24 = __this->get_m_UseGraphicAlpha_6(); if (!L_24) { goto IL_009e; } } { uint8_t L_25 = (&V_4)->get_a_3(); List_1_t1317283468 * L_26 = ___verts0; int32_t L_27 = V_2; NullCheck(L_26); UIVertex_t4244065212 L_28 = List_1_get_Item_m3329257068(L_26, L_27, /*hidden argument*/List_1_get_Item_m3329257068_MethodInfo_var); V_5 = L_28; Color32_t598853688 * L_29 = (&V_5)->get_address_of_color_2(); uint8_t L_30 = L_29->get_a_3(); (&V_4)->set_a_3((((int32_t)((uint8_t)((int32_t)((int32_t)((int32_t)((int32_t)L_25*(int32_t)L_30))/(int32_t)((int32_t)255))))))); } IL_009e: { Color32_t598853688 L_31 = V_4; (&V_0)->set_color_2(L_31); List_1_t1317283468 * L_32 = ___verts0; int32_t L_33 = V_2; UIVertex_t4244065212 L_34 = V_0; NullCheck(L_32); List_1_set_Item_m1239619023(L_32, L_33, L_34, /*hidden argument*/List_1_set_Item_m1239619023_MethodInfo_var); int32_t L_35 = V_2; V_2 = ((int32_t)((int32_t)L_35+(int32_t)1)); } IL_00b3: { int32_t L_36 = V_2; int32_t L_37 = ___end3; if ((((int32_t)L_36) < ((int32_t)L_37))) { goto IL_0026; } } { return; } } // System.Void UnityEngine.UI.Shadow::ApplyShadow(System.Collections.Generic.List`1<UnityEngine.UIVertex>,UnityEngine.Color32,System.Int32,System.Int32,System.Single,System.Single) extern "C" void Shadow_ApplyShadow_m3534003541 (Shadow_t75537580 * __this, List_1_t1317283468 * ___verts0, Color32_t598853688 ___color1, int32_t ___start2, int32_t ___end3, float ___x4, float ___y5, const MethodInfo* method) { { List_1_t1317283468 * L_0 = ___verts0; Color32_t598853688 L_1 = ___color1; int32_t L_2 = ___start2; int32_t L_3 = ___end3; float L_4 = ___x4; float L_5 = ___y5; Shadow_ApplyShadowZeroAlloc_m338158484(__this, L_0, L_1, L_2, L_3, L_4, L_5, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.UI.Shadow::ModifyMesh(UnityEngine.UI.VertexHelper) extern Il2CppClass* ListPool_1_t3341702496_il2cpp_TypeInfo_var; extern const MethodInfo* ListPool_1_Get_m3130095824_MethodInfo_var; extern const MethodInfo* List_1_get_Count_m4277682313_MethodInfo_var; extern const MethodInfo* ListPool_1_Release_m2709067242_MethodInfo_var; extern const uint32_t Shadow_ModifyMesh_m111179421_MetadataUsageId; extern "C" void Shadow_ModifyMesh_m111179421 (Shadow_t75537580 * __this, VertexHelper_t3377436606 * ___vh0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Shadow_ModifyMesh_m111179421_MetadataUsageId); s_Il2CppMethodIntialized = true; } List_1_t1317283468 * V_0 = NULL; Vector2_t4282066565 V_1; memset(&V_1, 0, sizeof(V_1)); Vector2_t4282066565 V_2; memset(&V_2, 0, sizeof(V_2)); { bool L_0 = VirtFuncInvoker0< bool >::Invoke(9 /* System.Boolean UnityEngine.EventSystems.UIBehaviour::IsActive() */, __this); if (L_0) { goto IL_000c; } } { return; } IL_000c: { IL2CPP_RUNTIME_CLASS_INIT(ListPool_1_t3341702496_il2cpp_TypeInfo_var); List_1_t1317283468 * L_1 = ListPool_1_Get_m3130095824(NULL /*static, unused*/, /*hidden argument*/ListPool_1_Get_m3130095824_MethodInfo_var); V_0 = L_1; VertexHelper_t3377436606 * L_2 = ___vh0; List_1_t1317283468 * L_3 = V_0; NullCheck(L_2); VertexHelper_GetUIVertexStream_m1078623420(L_2, L_3, /*hidden argument*/NULL); List_1_t1317283468 * L_4 = V_0; Color_t4194546905 L_5 = Shadow_get_effectColor_m2953989785(__this, /*hidden argument*/NULL); Color32_t598853688 L_6 = Color32_op_Implicit_m3684884838(NULL /*static, unused*/, L_5, /*hidden argument*/NULL); List_1_t1317283468 * L_7 = V_0; NullCheck(L_7); int32_t L_8 = List_1_get_Count_m4277682313(L_7, /*hidden argument*/List_1_get_Count_m4277682313_MethodInfo_var); Vector2_t4282066565 L_9 = Shadow_get_effectDistance_m1102454733(__this, /*hidden argument*/NULL); V_1 = L_9; float L_10 = (&V_1)->get_x_1(); Vector2_t4282066565 L_11 = Shadow_get_effectDistance_m1102454733(__this, /*hidden argument*/NULL); V_2 = L_11; float L_12 = (&V_2)->get_y_2(); Shadow_ApplyShadow_m3534003541(__this, L_4, L_6, 0, L_8, L_10, L_12, /*hidden argument*/NULL); VertexHelper_t3377436606 * L_13 = ___vh0; NullCheck(L_13); VertexHelper_Clear_m412394180(L_13, /*hidden argument*/NULL); VertexHelper_t3377436606 * L_14 = ___vh0; List_1_t1317283468 * L_15 = V_0; NullCheck(L_14); VertexHelper_AddUIVertexTriangleStream_m1263262953(L_14, L_15, /*hidden argument*/NULL); List_1_t1317283468 * L_16 = V_0; ListPool_1_Release_m2709067242(NULL /*static, unused*/, L_16, /*hidden argument*/ListPool_1_Release_m2709067242_MethodInfo_var); return; } } // System.Void UnityEngine.UI.Slider::.ctor() extern Il2CppClass* SliderEvent_t2627072750_il2cpp_TypeInfo_var; extern Il2CppClass* Selectable_t1885181538_il2cpp_TypeInfo_var; extern const uint32_t Slider__ctor_m347403018_MetadataUsageId; extern "C" void Slider__ctor_m347403018 (Slider_t79469677 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Slider__ctor_m347403018_MetadataUsageId); s_Il2CppMethodIntialized = true; } { __this->set_m_MaxValue_20((1.0f)); SliderEvent_t2627072750 * L_0 = (SliderEvent_t2627072750 *)il2cpp_codegen_object_new(SliderEvent_t2627072750_il2cpp_TypeInfo_var); SliderEvent__ctor_m1429088576(L_0, /*hidden argument*/NULL); __this->set_m_OnValueChanged_23(L_0); Vector2_t4282066565 L_1 = Vector2_get_zero_m199872368(NULL /*static, unused*/, /*hidden argument*/NULL); __this->set_m_Offset_29(L_1); IL2CPP_RUNTIME_CLASS_INIT(Selectable_t1885181538_il2cpp_TypeInfo_var); Selectable__ctor_m1133588277(__this, /*hidden argument*/NULL); return; } } // UnityEngine.RectTransform UnityEngine.UI.Slider::get_fillRect() extern "C" RectTransform_t972643934 * Slider_get_fillRect_m2450877128 (Slider_t79469677 * __this, const MethodInfo* method) { { RectTransform_t972643934 * L_0 = __this->get_m_FillRect_16(); return L_0; } } // System.Void UnityEngine.UI.Slider::set_fillRect(UnityEngine.RectTransform) extern const MethodInfo* SetPropertyUtility_SetClass_TisRectTransform_t972643934_m3898551323_MethodInfo_var; extern const uint32_t Slider_set_fillRect_m3297119715_MetadataUsageId; extern "C" void Slider_set_fillRect_m3297119715 (Slider_t79469677 * __this, RectTransform_t972643934 * ___value0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Slider_set_fillRect_m3297119715_MetadataUsageId); s_Il2CppMethodIntialized = true; } { RectTransform_t972643934 ** L_0 = __this->get_address_of_m_FillRect_16(); RectTransform_t972643934 * L_1 = ___value0; bool L_2 = SetPropertyUtility_SetClass_TisRectTransform_t972643934_m3898551323(NULL /*static, unused*/, L_0, L_1, /*hidden argument*/SetPropertyUtility_SetClass_TisRectTransform_t972643934_m3898551323_MethodInfo_var); if (!L_2) { goto IL_001d; } } { Slider_UpdateCachedReferences_m3913831469(__this, /*hidden argument*/NULL); Slider_UpdateVisuals_m1355864786(__this, /*hidden argument*/NULL); } IL_001d: { return; } } // UnityEngine.RectTransform UnityEngine.UI.Slider::get_handleRect() extern "C" RectTransform_t972643934 * Slider_get_handleRect_m2151134125 (Slider_t79469677 * __this, const MethodInfo* method) { { RectTransform_t972643934 * L_0 = __this->get_m_HandleRect_17(); return L_0; } } // System.Void UnityEngine.UI.Slider::set_handleRect(UnityEngine.RectTransform) extern const MethodInfo* SetPropertyUtility_SetClass_TisRectTransform_t972643934_m3898551323_MethodInfo_var; extern const uint32_t Slider_set_handleRect_m3189108254_MetadataUsageId; extern "C" void Slider_set_handleRect_m3189108254 (Slider_t79469677 * __this, RectTransform_t972643934 * ___value0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Slider_set_handleRect_m3189108254_MetadataUsageId); s_Il2CppMethodIntialized = true; } { RectTransform_t972643934 ** L_0 = __this->get_address_of_m_HandleRect_17(); RectTransform_t972643934 * L_1 = ___value0; bool L_2 = SetPropertyUtility_SetClass_TisRectTransform_t972643934_m3898551323(NULL /*static, unused*/, L_0, L_1, /*hidden argument*/SetPropertyUtility_SetClass_TisRectTransform_t972643934_m3898551323_MethodInfo_var); if (!L_2) { goto IL_001d; } } { Slider_UpdateCachedReferences_m3913831469(__this, /*hidden argument*/NULL); Slider_UpdateVisuals_m1355864786(__this, /*hidden argument*/NULL); } IL_001d: { return; } } // UnityEngine.UI.Slider/Direction UnityEngine.UI.Slider::get_direction() extern "C" int32_t Slider_get_direction_m2329138173 (Slider_t79469677 * __this, const MethodInfo* method) { { int32_t L_0 = __this->get_m_Direction_18(); return L_0; } } // System.Void UnityEngine.UI.Slider::set_direction(UnityEngine.UI.Slider/Direction) extern const MethodInfo* SetPropertyUtility_SetStruct_TisDirection_t94975348_m2722180853_MethodInfo_var; extern const uint32_t Slider_set_direction_m1506600084_MetadataUsageId; extern "C" void Slider_set_direction_m1506600084 (Slider_t79469677 * __this, int32_t ___value0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Slider_set_direction_m1506600084_MetadataUsageId); s_Il2CppMethodIntialized = true; } { int32_t* L_0 = __this->get_address_of_m_Direction_18(); int32_t L_1 = ___value0; bool L_2 = SetPropertyUtility_SetStruct_TisDirection_t94975348_m2722180853(NULL /*static, unused*/, L_0, L_1, /*hidden argument*/SetPropertyUtility_SetStruct_TisDirection_t94975348_m2722180853_MethodInfo_var); if (!L_2) { goto IL_0017; } } { Slider_UpdateVisuals_m1355864786(__this, /*hidden argument*/NULL); } IL_0017: { return; } } // System.Single UnityEngine.UI.Slider::get_minValue() extern "C" float Slider_get_minValue_m84589142 (Slider_t79469677 * __this, const MethodInfo* method) { { float L_0 = __this->get_m_MinValue_19(); return L_0; } } // System.Void UnityEngine.UI.Slider::set_minValue(System.Single) extern const MethodInfo* SetPropertyUtility_SetStruct_TisSingle_t4291918972_m1643007650_MethodInfo_var; extern const uint32_t Slider_set_minValue_m3023646485_MetadataUsageId; extern "C" void Slider_set_minValue_m3023646485 (Slider_t79469677 * __this, float ___value0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Slider_set_minValue_m3023646485_MetadataUsageId); s_Il2CppMethodIntialized = true; } { float* L_0 = __this->get_address_of_m_MinValue_19(); float L_1 = ___value0; bool L_2 = SetPropertyUtility_SetStruct_TisSingle_t4291918972_m1643007650(NULL /*static, unused*/, L_0, L_1, /*hidden argument*/SetPropertyUtility_SetStruct_TisSingle_t4291918972_m1643007650_MethodInfo_var); if (!L_2) { goto IL_0023; } } { float L_3 = __this->get_m_Value_22(); Slider_Set_m2575079457(__this, L_3, /*hidden argument*/NULL); Slider_UpdateVisuals_m1355864786(__this, /*hidden argument*/NULL); } IL_0023: { return; } } // System.Single UnityEngine.UI.Slider::get_maxValue() extern "C" float Slider_get_maxValue_m1907557124 (Slider_t79469677 * __this, const MethodInfo* method) { { float L_0 = __this->get_m_MaxValue_20(); return L_0; } } // System.Void UnityEngine.UI.Slider::set_maxValue(System.Single) extern const MethodInfo* SetPropertyUtility_SetStruct_TisSingle_t4291918972_m1643007650_MethodInfo_var; extern const uint32_t Slider_set_maxValue_m4261736743_MetadataUsageId; extern "C" void Slider_set_maxValue_m4261736743 (Slider_t79469677 * __this, float ___value0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Slider_set_maxValue_m4261736743_MetadataUsageId); s_Il2CppMethodIntialized = true; } { float* L_0 = __this->get_address_of_m_MaxValue_20(); float L_1 = ___value0; bool L_2 = SetPropertyUtility_SetStruct_TisSingle_t4291918972_m1643007650(NULL /*static, unused*/, L_0, L_1, /*hidden argument*/SetPropertyUtility_SetStruct_TisSingle_t4291918972_m1643007650_MethodInfo_var); if (!L_2) { goto IL_0023; } } { float L_3 = __this->get_m_Value_22(); Slider_Set_m2575079457(__this, L_3, /*hidden argument*/NULL); Slider_UpdateVisuals_m1355864786(__this, /*hidden argument*/NULL); } IL_0023: { return; } } // System.Boolean UnityEngine.UI.Slider::get_wholeNumbers() extern "C" bool Slider_get_wholeNumbers_m3990960296 (Slider_t79469677 * __this, const MethodInfo* method) { { bool L_0 = __this->get_m_WholeNumbers_21(); return L_0; } } // System.Void UnityEngine.UI.Slider::set_wholeNumbers(System.Boolean) extern const MethodInfo* SetPropertyUtility_SetStruct_TisBoolean_t476798718_m1242031768_MethodInfo_var; extern const uint32_t Slider_set_wholeNumbers_m3974827169_MetadataUsageId; extern "C" void Slider_set_wholeNumbers_m3974827169 (Slider_t79469677 * __this, bool ___value0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Slider_set_wholeNumbers_m3974827169_MetadataUsageId); s_Il2CppMethodIntialized = true; } { bool* L_0 = __this->get_address_of_m_WholeNumbers_21(); bool L_1 = ___value0; bool L_2 = SetPropertyUtility_SetStruct_TisBoolean_t476798718_m1242031768(NULL /*static, unused*/, L_0, L_1, /*hidden argument*/SetPropertyUtility_SetStruct_TisBoolean_t476798718_m1242031768_MethodInfo_var); if (!L_2) { goto IL_0023; } } { float L_3 = __this->get_m_Value_22(); Slider_Set_m2575079457(__this, L_3, /*hidden argument*/NULL); Slider_UpdateVisuals_m1355864786(__this, /*hidden argument*/NULL); } IL_0023: { return; } } // System.Single UnityEngine.UI.Slider::get_value() extern Il2CppClass* Mathf_t4203372500_il2cpp_TypeInfo_var; extern const uint32_t Slider_get_value_m2021634844_MetadataUsageId; extern "C" float Slider_get_value_m2021634844 (Slider_t79469677 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Slider_get_value_m2021634844_MetadataUsageId); s_Il2CppMethodIntialized = true; } { bool L_0 = Slider_get_wholeNumbers_m3990960296(__this, /*hidden argument*/NULL); if (!L_0) { goto IL_0017; } } { float L_1 = __this->get_m_Value_22(); IL2CPP_RUNTIME_CLASS_INIT(Mathf_t4203372500_il2cpp_TypeInfo_var); float L_2 = bankers_roundf(L_1); return L_2; } IL_0017: { float L_3 = __this->get_m_Value_22(); return L_3; } } // System.Void UnityEngine.UI.Slider::set_value(System.Single) extern "C" void Slider_set_value_m4201041935 (Slider_t79469677 * __this, float ___value0, const MethodInfo* method) { { float L_0 = ___value0; Slider_Set_m2575079457(__this, L_0, /*hidden argument*/NULL); return; } } // System.Single UnityEngine.UI.Slider::get_normalizedValue() extern Il2CppClass* Mathf_t4203372500_il2cpp_TypeInfo_var; extern const uint32_t Slider_get_normalizedValue_m2918004645_MetadataUsageId; extern "C" float Slider_get_normalizedValue_m2918004645 (Slider_t79469677 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Slider_get_normalizedValue_m2918004645_MetadataUsageId); s_Il2CppMethodIntialized = true; } { float L_0 = Slider_get_minValue_m84589142(__this, /*hidden argument*/NULL); float L_1 = Slider_get_maxValue_m1907557124(__this, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(Mathf_t4203372500_il2cpp_TypeInfo_var); bool L_2 = Mathf_Approximately_m1395529776(NULL /*static, unused*/, L_0, L_1, /*hidden argument*/NULL); if (!L_2) { goto IL_001c; } } { return (0.0f); } IL_001c: { float L_3 = Slider_get_minValue_m84589142(__this, /*hidden argument*/NULL); float L_4 = Slider_get_maxValue_m1907557124(__this, /*hidden argument*/NULL); float L_5 = VirtFuncInvoker0< float >::Invoke(45 /* System.Single UnityEngine.UI.Slider::get_value() */, __this); IL2CPP_RUNTIME_CLASS_INIT(Mathf_t4203372500_il2cpp_TypeInfo_var); float L_6 = Mathf_InverseLerp_m152689993(NULL /*static, unused*/, L_3, L_4, L_5, /*hidden argument*/NULL); return L_6; } } // System.Void UnityEngine.UI.Slider::set_normalizedValue(System.Single) extern Il2CppClass* Mathf_t4203372500_il2cpp_TypeInfo_var; extern const uint32_t Slider_set_normalizedValue_m3382161958_MetadataUsageId; extern "C" void Slider_set_normalizedValue_m3382161958 (Slider_t79469677 * __this, float ___value0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Slider_set_normalizedValue_m3382161958_MetadataUsageId); s_Il2CppMethodIntialized = true; } { float L_0 = Slider_get_minValue_m84589142(__this, /*hidden argument*/NULL); float L_1 = Slider_get_maxValue_m1907557124(__this, /*hidden argument*/NULL); float L_2 = ___value0; IL2CPP_RUNTIME_CLASS_INIT(Mathf_t4203372500_il2cpp_TypeInfo_var); float L_3 = Mathf_Lerp_m3257777633(NULL /*static, unused*/, L_0, L_1, L_2, /*hidden argument*/NULL); VirtActionInvoker1< float >::Invoke(46 /* System.Void UnityEngine.UI.Slider::set_value(System.Single) */, __this, L_3); return; } } // UnityEngine.UI.Slider/SliderEvent UnityEngine.UI.Slider::get_onValueChanged() extern "C" SliderEvent_t2627072750 * Slider_get_onValueChanged_m3585429728 (Slider_t79469677 * __this, const MethodInfo* method) { { SliderEvent_t2627072750 * L_0 = __this->get_m_OnValueChanged_23(); return L_0; } } // System.Void UnityEngine.UI.Slider::set_onValueChanged(UnityEngine.UI.Slider/SliderEvent) extern "C" void Slider_set_onValueChanged_m544103115 (Slider_t79469677 * __this, SliderEvent_t2627072750 * ___value0, const MethodInfo* method) { { SliderEvent_t2627072750 * L_0 = ___value0; __this->set_m_OnValueChanged_23(L_0); return; } } // System.Single UnityEngine.UI.Slider::get_stepSize() extern "C" float Slider_get_stepSize_m3189751172 (Slider_t79469677 * __this, const MethodInfo* method) { float G_B3_0 = 0.0f; { bool L_0 = Slider_get_wholeNumbers_m3990960296(__this, /*hidden argument*/NULL); if (!L_0) { goto IL_0015; } } { G_B3_0 = (1.0f); goto IL_0028; } IL_0015: { float L_1 = Slider_get_maxValue_m1907557124(__this, /*hidden argument*/NULL); float L_2 = Slider_get_minValue_m84589142(__this, /*hidden argument*/NULL); G_B3_0 = ((float)((float)((float)((float)L_1-(float)L_2))*(float)(0.1f))); } IL_0028: { return G_B3_0; } } // System.Void UnityEngine.UI.Slider::Rebuild(UnityEngine.UI.CanvasUpdate) extern "C" void Slider_Rebuild_m204900683 (Slider_t79469677 * __this, int32_t ___executing0, const MethodInfo* method) { { return; } } // System.Void UnityEngine.UI.Slider::LayoutComplete() extern "C" void Slider_LayoutComplete_m3716644733 (Slider_t79469677 * __this, const MethodInfo* method) { { return; } } // System.Void UnityEngine.UI.Slider::GraphicUpdateComplete() extern "C" void Slider_GraphicUpdateComplete_m837060050 (Slider_t79469677 * __this, const MethodInfo* method) { { return; } } // System.Void UnityEngine.UI.Slider::OnEnable() extern "C" void Slider_OnEnable_m683704380 (Slider_t79469677 * __this, const MethodInfo* method) { { Selectable_OnEnable_m1472090161(__this, /*hidden argument*/NULL); Slider_UpdateCachedReferences_m3913831469(__this, /*hidden argument*/NULL); float L_0 = __this->get_m_Value_22(); VirtActionInvoker2< float, bool >::Invoke(50 /* System.Void UnityEngine.UI.Slider::Set(System.Single,System.Boolean) */, __this, L_0, (bool)0); Slider_UpdateVisuals_m1355864786(__this, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.UI.Slider::OnDisable() extern "C" void Slider_OnDisable_m160936561 (Slider_t79469677 * __this, const MethodInfo* method) { { DrivenRectTransformTracker_t4185719096 * L_0 = __this->get_address_of_m_Tracker_30(); DrivenRectTransformTracker_Clear_m309315364(L_0, /*hidden argument*/NULL); Selectable_OnDisable_m3126059292(__this, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.UI.Slider::OnDidApplyAnimationProperties() extern const MethodInfo* UnityEvent_1_Invoke_m3551800820_MethodInfo_var; extern const uint32_t Slider_OnDidApplyAnimationProperties_m317765809_MetadataUsageId; extern "C" void Slider_OnDidApplyAnimationProperties_m317765809 (Slider_t79469677 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Slider_OnDidApplyAnimationProperties_m317765809_MetadataUsageId); s_Il2CppMethodIntialized = true; } float V_0 = 0.0f; Vector2_t4282066565 V_1; memset(&V_1, 0, sizeof(V_1)); Vector2_t4282066565 V_2; memset(&V_2, 0, sizeof(V_2)); Vector2_t4282066565 V_3; memset(&V_3, 0, sizeof(V_3)); Vector2_t4282066565 V_4; memset(&V_4, 0, sizeof(V_4)); float G_B7_0 = 0.0f; float G_B13_0 = 0.0f; { float L_0 = __this->get_m_Value_22(); float L_1 = Slider_ClampValue_m4124802439(__this, L_0, /*hidden argument*/NULL); __this->set_m_Value_22(L_1); float L_2 = Slider_get_normalizedValue_m2918004645(__this, /*hidden argument*/NULL); V_0 = L_2; RectTransform_t972643934 * L_3 = __this->get_m_FillContainerRect_26(); bool L_4 = Object_op_Inequality_m1296218211(NULL /*static, unused*/, L_3, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_4) { goto IL_00ab; } } { Image_t538875265 * L_5 = __this->get_m_FillImage_24(); bool L_6 = Object_op_Inequality_m1296218211(NULL /*static, unused*/, L_5, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_6) { goto IL_005d; } } { Image_t538875265 * L_7 = __this->get_m_FillImage_24(); NullCheck(L_7); int32_t L_8 = Image_get_type_m1778977993(L_7, /*hidden argument*/NULL); if ((!(((uint32_t)L_8) == ((uint32_t)3)))) { goto IL_005d; } } { Image_t538875265 * L_9 = __this->get_m_FillImage_24(); NullCheck(L_9); float L_10 = Image_get_fillAmount_m3193252212(L_9, /*hidden argument*/NULL); V_0 = L_10; goto IL_00a6; } IL_005d: { bool L_11 = Slider_get_reverseValue_m1915319492(__this, /*hidden argument*/NULL); if (!L_11) { goto IL_008c; } } { RectTransform_t972643934 * L_12 = __this->get_m_FillRect_16(); NullCheck(L_12); Vector2_t4282066565 L_13 = RectTransform_get_anchorMin_m688674174(L_12, /*hidden argument*/NULL); V_1 = L_13; int32_t L_14 = Slider_get_axis_m591825817(__this, /*hidden argument*/NULL); float L_15 = Vector2_get_Item_m2185542843((&V_1), L_14, /*hidden argument*/NULL); G_B7_0 = ((float)((float)(1.0f)-(float)L_15)); goto IL_00a5; } IL_008c: { RectTransform_t972643934 * L_16 = __this->get_m_FillRect_16(); NullCheck(L_16); Vector2_t4282066565 L_17 = RectTransform_get_anchorMax_m688445456(L_16, /*hidden argument*/NULL); V_2 = L_17; int32_t L_18 = Slider_get_axis_m591825817(__this, /*hidden argument*/NULL); float L_19 = Vector2_get_Item_m2185542843((&V_2), L_18, /*hidden argument*/NULL); G_B7_0 = L_19; } IL_00a5: { V_0 = G_B7_0; } IL_00a6: { goto IL_0106; } IL_00ab: { RectTransform_t972643934 * L_20 = __this->get_m_HandleContainerRect_28(); bool L_21 = Object_op_Inequality_m1296218211(NULL /*static, unused*/, L_20, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_21) { goto IL_0106; } } { bool L_22 = Slider_get_reverseValue_m1915319492(__this, /*hidden argument*/NULL); if (!L_22) { goto IL_00eb; } } { RectTransform_t972643934 * L_23 = __this->get_m_HandleRect_17(); NullCheck(L_23); Vector2_t4282066565 L_24 = RectTransform_get_anchorMin_m688674174(L_23, /*hidden argument*/NULL); V_3 = L_24; int32_t L_25 = Slider_get_axis_m591825817(__this, /*hidden argument*/NULL); float L_26 = Vector2_get_Item_m2185542843((&V_3), L_25, /*hidden argument*/NULL); G_B13_0 = ((float)((float)(1.0f)-(float)L_26)); goto IL_0105; } IL_00eb: { RectTransform_t972643934 * L_27 = __this->get_m_HandleRect_17(); NullCheck(L_27); Vector2_t4282066565 L_28 = RectTransform_get_anchorMin_m688674174(L_27, /*hidden argument*/NULL); V_4 = L_28; int32_t L_29 = Slider_get_axis_m591825817(__this, /*hidden argument*/NULL); float L_30 = Vector2_get_Item_m2185542843((&V_4), L_29, /*hidden argument*/NULL); G_B13_0 = L_30; } IL_0105: { V_0 = G_B13_0; } IL_0106: { Slider_UpdateVisuals_m1355864786(__this, /*hidden argument*/NULL); float L_31 = V_0; float L_32 = Slider_get_normalizedValue_m2918004645(__this, /*hidden argument*/NULL); if ((((float)L_31) == ((float)L_32))) { goto IL_0129; } } { SliderEvent_t2627072750 * L_33 = Slider_get_onValueChanged_m3585429728(__this, /*hidden argument*/NULL); float L_34 = __this->get_m_Value_22(); NullCheck(L_33); UnityEvent_1_Invoke_m3551800820(L_33, L_34, /*hidden argument*/UnityEvent_1_Invoke_m3551800820_MethodInfo_var); } IL_0129: { return; } } // System.Void UnityEngine.UI.Slider::UpdateCachedReferences() extern const MethodInfo* Component_GetComponent_TisImage_t538875265_m3706520426_MethodInfo_var; extern const MethodInfo* Component_GetComponent_TisRectTransform_t972643934_m1940403147_MethodInfo_var; extern const uint32_t Slider_UpdateCachedReferences_m3913831469_MetadataUsageId; extern "C" void Slider_UpdateCachedReferences_m3913831469 (Slider_t79469677 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Slider_UpdateCachedReferences_m3913831469_MetadataUsageId); s_Il2CppMethodIntialized = true; } { RectTransform_t972643934 * L_0 = __this->get_m_FillRect_16(); bool L_1 = Object_op_Implicit_m2106766291(NULL /*static, unused*/, L_0, /*hidden argument*/NULL); if (!L_1) { goto IL_0063; } } { RectTransform_t972643934 * L_2 = __this->get_m_FillRect_16(); NullCheck(L_2); Transform_t1659122786 * L_3 = Component_get_transform_m4257140443(L_2, /*hidden argument*/NULL); __this->set_m_FillTransform_25(L_3); RectTransform_t972643934 * L_4 = __this->get_m_FillRect_16(); NullCheck(L_4); Image_t538875265 * L_5 = Component_GetComponent_TisImage_t538875265_m3706520426(L_4, /*hidden argument*/Component_GetComponent_TisImage_t538875265_m3706520426_MethodInfo_var); __this->set_m_FillImage_24(L_5); Transform_t1659122786 * L_6 = __this->get_m_FillTransform_25(); NullCheck(L_6); Transform_t1659122786 * L_7 = Transform_get_parent_m2236876972(L_6, /*hidden argument*/NULL); bool L_8 = Object_op_Inequality_m1296218211(NULL /*static, unused*/, L_7, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_8) { goto IL_005e; } } { Transform_t1659122786 * L_9 = __this->get_m_FillTransform_25(); NullCheck(L_9); Transform_t1659122786 * L_10 = Transform_get_parent_m2236876972(L_9, /*hidden argument*/NULL); NullCheck(L_10); RectTransform_t972643934 * L_11 = Component_GetComponent_TisRectTransform_t972643934_m1940403147(L_10, /*hidden argument*/Component_GetComponent_TisRectTransform_t972643934_m1940403147_MethodInfo_var); __this->set_m_FillContainerRect_26(L_11); } IL_005e: { goto IL_0071; } IL_0063: { __this->set_m_FillContainerRect_26((RectTransform_t972643934 *)NULL); __this->set_m_FillImage_24((Image_t538875265 *)NULL); } IL_0071: { RectTransform_t972643934 * L_12 = __this->get_m_HandleRect_17(); bool L_13 = Object_op_Implicit_m2106766291(NULL /*static, unused*/, L_12, /*hidden argument*/NULL); if (!L_13) { goto IL_00c3; } } { RectTransform_t972643934 * L_14 = __this->get_m_HandleRect_17(); NullCheck(L_14); Transform_t1659122786 * L_15 = Component_get_transform_m4257140443(L_14, /*hidden argument*/NULL); __this->set_m_HandleTransform_27(L_15); Transform_t1659122786 * L_16 = __this->get_m_HandleTransform_27(); NullCheck(L_16); Transform_t1659122786 * L_17 = Transform_get_parent_m2236876972(L_16, /*hidden argument*/NULL); bool L_18 = Object_op_Inequality_m1296218211(NULL /*static, unused*/, L_17, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_18) { goto IL_00be; } } { Transform_t1659122786 * L_19 = __this->get_m_HandleTransform_27(); NullCheck(L_19); Transform_t1659122786 * L_20 = Transform_get_parent_m2236876972(L_19, /*hidden argument*/NULL); NullCheck(L_20); RectTransform_t972643934 * L_21 = Component_GetComponent_TisRectTransform_t972643934_m1940403147(L_20, /*hidden argument*/Component_GetComponent_TisRectTransform_t972643934_m1940403147_MethodInfo_var); __this->set_m_HandleContainerRect_28(L_21); } IL_00be: { goto IL_00ca; } IL_00c3: { __this->set_m_HandleContainerRect_28((RectTransform_t972643934 *)NULL); } IL_00ca: { return; } } // System.Single UnityEngine.UI.Slider::ClampValue(System.Single) extern Il2CppClass* Mathf_t4203372500_il2cpp_TypeInfo_var; extern const uint32_t Slider_ClampValue_m4124802439_MetadataUsageId; extern "C" float Slider_ClampValue_m4124802439 (Slider_t79469677 * __this, float ___input0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Slider_ClampValue_m4124802439_MetadataUsageId); s_Il2CppMethodIntialized = true; } float V_0 = 0.0f; { float L_0 = ___input0; float L_1 = Slider_get_minValue_m84589142(__this, /*hidden argument*/NULL); float L_2 = Slider_get_maxValue_m1907557124(__this, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(Mathf_t4203372500_il2cpp_TypeInfo_var); float L_3 = Mathf_Clamp_m3872743893(NULL /*static, unused*/, L_0, L_1, L_2, /*hidden argument*/NULL); V_0 = L_3; bool L_4 = Slider_get_wholeNumbers_m3990960296(__this, /*hidden argument*/NULL); if (!L_4) { goto IL_0025; } } { float L_5 = V_0; IL2CPP_RUNTIME_CLASS_INIT(Mathf_t4203372500_il2cpp_TypeInfo_var); float L_6 = bankers_roundf(L_5); V_0 = L_6; } IL_0025: { float L_7 = V_0; return L_7; } } // System.Void UnityEngine.UI.Slider::Set(System.Single) extern "C" void Slider_Set_m2575079457 (Slider_t79469677 * __this, float ___input0, const MethodInfo* method) { { float L_0 = ___input0; VirtActionInvoker2< float, bool >::Invoke(50 /* System.Void UnityEngine.UI.Slider::Set(System.Single,System.Boolean) */, __this, L_0, (bool)1); return; } } // System.Void UnityEngine.UI.Slider::Set(System.Single,System.Boolean) extern const MethodInfo* UnityEvent_1_Invoke_m3551800820_MethodInfo_var; extern const uint32_t Slider_Set_m2043565372_MetadataUsageId; extern "C" void Slider_Set_m2043565372 (Slider_t79469677 * __this, float ___input0, bool ___sendCallback1, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Slider_Set_m2043565372_MetadataUsageId); s_Il2CppMethodIntialized = true; } float V_0 = 0.0f; { float L_0 = ___input0; float L_1 = Slider_ClampValue_m4124802439(__this, L_0, /*hidden argument*/NULL); V_0 = L_1; float L_2 = __this->get_m_Value_22(); float L_3 = V_0; if ((!(((float)L_2) == ((float)L_3)))) { goto IL_0015; } } { return; } IL_0015: { float L_4 = V_0; __this->set_m_Value_22(L_4); Slider_UpdateVisuals_m1355864786(__this, /*hidden argument*/NULL); bool L_5 = ___sendCallback1; if (!L_5) { goto IL_0034; } } { SliderEvent_t2627072750 * L_6 = __this->get_m_OnValueChanged_23(); float L_7 = V_0; NullCheck(L_6); UnityEvent_1_Invoke_m3551800820(L_6, L_7, /*hidden argument*/UnityEvent_1_Invoke_m3551800820_MethodInfo_var); } IL_0034: { return; } } // System.Void UnityEngine.UI.Slider::OnRectTransformDimensionsChange() extern "C" void Slider_OnRectTransformDimensionsChange_m4044006958 (Slider_t79469677 * __this, const MethodInfo* method) { { UIBehaviour_OnRectTransformDimensionsChange_m406568928(__this, /*hidden argument*/NULL); bool L_0 = VirtFuncInvoker0< bool >::Invoke(9 /* System.Boolean UnityEngine.EventSystems.UIBehaviour::IsActive() */, __this); if (L_0) { goto IL_0012; } } { return; } IL_0012: { Slider_UpdateVisuals_m1355864786(__this, /*hidden argument*/NULL); return; } } // UnityEngine.UI.Slider/Axis UnityEngine.UI.Slider::get_axis() extern "C" int32_t Slider_get_axis_m591825817 (Slider_t79469677 * __this, const MethodInfo* method) { int32_t G_B4_0 = 0; { int32_t L_0 = __this->get_m_Direction_18(); if (!L_0) { goto IL_0017; } } { int32_t L_1 = __this->get_m_Direction_18(); if ((!(((uint32_t)L_1) == ((uint32_t)1)))) { goto IL_001d; } } IL_0017: { G_B4_0 = 0; goto IL_001e; } IL_001d: { G_B4_0 = 1; } IL_001e: { return (int32_t)(G_B4_0); } } // System.Boolean UnityEngine.UI.Slider::get_reverseValue() extern "C" bool Slider_get_reverseValue_m1915319492 (Slider_t79469677 * __this, const MethodInfo* method) { int32_t G_B3_0 = 0; { int32_t L_0 = __this->get_m_Direction_18(); if ((((int32_t)L_0) == ((int32_t)1))) { goto IL_0017; } } { int32_t L_1 = __this->get_m_Direction_18(); G_B3_0 = ((((int32_t)L_1) == ((int32_t)3))? 1 : 0); goto IL_0018; } IL_0017: { G_B3_0 = 1; } IL_0018: { return (bool)G_B3_0; } } // System.Void UnityEngine.UI.Slider::UpdateVisuals() extern "C" void Slider_UpdateVisuals_m1355864786 (Slider_t79469677 * __this, const MethodInfo* method) { Vector2_t4282066565 V_0; memset(&V_0, 0, sizeof(V_0)); Vector2_t4282066565 V_1; memset(&V_1, 0, sizeof(V_1)); Vector2_t4282066565 V_2; memset(&V_2, 0, sizeof(V_2)); Vector2_t4282066565 V_3; memset(&V_3, 0, sizeof(V_3)); float V_4 = 0.0f; int32_t G_B11_0 = 0; Vector2_t4282066565 * G_B11_1 = NULL; int32_t G_B10_0 = 0; Vector2_t4282066565 * G_B10_1 = NULL; float G_B12_0 = 0.0f; int32_t G_B12_1 = 0; Vector2_t4282066565 * G_B12_2 = NULL; { DrivenRectTransformTracker_t4185719096 * L_0 = __this->get_address_of_m_Tracker_30(); DrivenRectTransformTracker_Clear_m309315364(L_0, /*hidden argument*/NULL); RectTransform_t972643934 * L_1 = __this->get_m_FillContainerRect_26(); bool L_2 = Object_op_Inequality_m1296218211(NULL /*static, unused*/, L_1, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_2) { goto IL_00cb; } } { DrivenRectTransformTracker_t4185719096 * L_3 = __this->get_address_of_m_Tracker_30(); RectTransform_t972643934 * L_4 = __this->get_m_FillRect_16(); DrivenRectTransformTracker_Add_m3461523141(L_3, __this, L_4, ((int32_t)3840), /*hidden argument*/NULL); Vector2_t4282066565 L_5 = Vector2_get_zero_m199872368(NULL /*static, unused*/, /*hidden argument*/NULL); V_0 = L_5; Vector2_t4282066565 L_6 = Vector2_get_one_m2767488832(NULL /*static, unused*/, /*hidden argument*/NULL); V_1 = L_6; Image_t538875265 * L_7 = __this->get_m_FillImage_24(); bool L_8 = Object_op_Inequality_m1296218211(NULL /*static, unused*/, L_7, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_8) { goto IL_0077; } } { Image_t538875265 * L_9 = __this->get_m_FillImage_24(); NullCheck(L_9); int32_t L_10 = Image_get_type_m1778977993(L_9, /*hidden argument*/NULL); if ((!(((uint32_t)L_10) == ((uint32_t)3)))) { goto IL_0077; } } { Image_t538875265 * L_11 = __this->get_m_FillImage_24(); float L_12 = Slider_get_normalizedValue_m2918004645(__this, /*hidden argument*/NULL); NullCheck(L_11); Image_set_fillAmount_m1583793743(L_11, L_12, /*hidden argument*/NULL); goto IL_00b3; } IL_0077: { bool L_13 = Slider_get_reverseValue_m1915319492(__this, /*hidden argument*/NULL); if (!L_13) { goto IL_00a0; } } { int32_t L_14 = Slider_get_axis_m591825817(__this, /*hidden argument*/NULL); float L_15 = Slider_get_normalizedValue_m2918004645(__this, /*hidden argument*/NULL); Vector2_set_Item_m2767519328((&V_0), L_14, ((float)((float)(1.0f)-(float)L_15)), /*hidden argument*/NULL); goto IL_00b3; } IL_00a0: { int32_t L_16 = Slider_get_axis_m591825817(__this, /*hidden argument*/NULL); float L_17 = Slider_get_normalizedValue_m2918004645(__this, /*hidden argument*/NULL); Vector2_set_Item_m2767519328((&V_1), L_16, L_17, /*hidden argument*/NULL); } IL_00b3: { RectTransform_t972643934 * L_18 = __this->get_m_FillRect_16(); Vector2_t4282066565 L_19 = V_0; NullCheck(L_18); RectTransform_set_anchorMin_m989253483(L_18, L_19, /*hidden argument*/NULL); RectTransform_t972643934 * L_20 = __this->get_m_FillRect_16(); Vector2_t4282066565 L_21 = V_1; NullCheck(L_20); RectTransform_set_anchorMax_m715345817(L_20, L_21, /*hidden argument*/NULL); } IL_00cb: { RectTransform_t972643934 * L_22 = __this->get_m_HandleContainerRect_28(); bool L_23 = Object_op_Inequality_m1296218211(NULL /*static, unused*/, L_22, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_23) { goto IL_0159; } } { DrivenRectTransformTracker_t4185719096 * L_24 = __this->get_address_of_m_Tracker_30(); RectTransform_t972643934 * L_25 = __this->get_m_HandleRect_17(); DrivenRectTransformTracker_Add_m3461523141(L_24, __this, L_25, ((int32_t)3840), /*hidden argument*/NULL); Vector2_t4282066565 L_26 = Vector2_get_zero_m199872368(NULL /*static, unused*/, /*hidden argument*/NULL); V_2 = L_26; Vector2_t4282066565 L_27 = Vector2_get_one_m2767488832(NULL /*static, unused*/, /*hidden argument*/NULL); V_3 = L_27; int32_t L_28 = Slider_get_axis_m591825817(__this, /*hidden argument*/NULL); bool L_29 = Slider_get_reverseValue_m1915319492(__this, /*hidden argument*/NULL); G_B10_0 = L_28; G_B10_1 = (&V_2); if (!L_29) { G_B11_0 = L_28; G_B11_1 = (&V_2); goto IL_0123; } } { float L_30 = Slider_get_normalizedValue_m2918004645(__this, /*hidden argument*/NULL); G_B12_0 = ((float)((float)(1.0f)-(float)L_30)); G_B12_1 = G_B10_0; G_B12_2 = G_B10_1; goto IL_0129; } IL_0123: { float L_31 = Slider_get_normalizedValue_m2918004645(__this, /*hidden argument*/NULL); G_B12_0 = L_31; G_B12_1 = G_B11_0; G_B12_2 = G_B11_1; } IL_0129: { V_4 = G_B12_0; int32_t L_32 = Slider_get_axis_m591825817(__this, /*hidden argument*/NULL); float L_33 = V_4; Vector2_set_Item_m2767519328((&V_3), L_32, L_33, /*hidden argument*/NULL); float L_34 = V_4; Vector2_set_Item_m2767519328(G_B12_2, G_B12_1, L_34, /*hidden argument*/NULL); RectTransform_t972643934 * L_35 = __this->get_m_HandleRect_17(); Vector2_t4282066565 L_36 = V_2; NullCheck(L_35); RectTransform_set_anchorMin_m989253483(L_35, L_36, /*hidden argument*/NULL); RectTransform_t972643934 * L_37 = __this->get_m_HandleRect_17(); Vector2_t4282066565 L_38 = V_3; NullCheck(L_37); RectTransform_set_anchorMax_m715345817(L_37, L_38, /*hidden argument*/NULL); } IL_0159: { return; } } // System.Void UnityEngine.UI.Slider::UpdateDrag(UnityEngine.EventSystems.PointerEventData,UnityEngine.Camera) extern Il2CppClass* RectTransformUtility_t3025555048_il2cpp_TypeInfo_var; extern Il2CppClass* Mathf_t4203372500_il2cpp_TypeInfo_var; extern const uint32_t Slider_UpdateDrag_m913163651_MetadataUsageId; extern "C" void Slider_UpdateDrag_m913163651 (Slider_t79469677 * __this, PointerEventData_t1848751023 * ___eventData0, Camera_t2727095145 * ___cam1, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Slider_UpdateDrag_m913163651_MetadataUsageId); s_Il2CppMethodIntialized = true; } RectTransform_t972643934 * V_0 = NULL; Vector2_t4282066565 V_1; memset(&V_1, 0, sizeof(V_1)); float V_2 = 0.0f; Rect_t4241904616 V_3; memset(&V_3, 0, sizeof(V_3)); Vector2_t4282066565 V_4; memset(&V_4, 0, sizeof(V_4)); Rect_t4241904616 V_5; memset(&V_5, 0, sizeof(V_5)); Vector2_t4282066565 V_6; memset(&V_6, 0, sizeof(V_6)); Rect_t4241904616 V_7; memset(&V_7, 0, sizeof(V_7)); Vector2_t4282066565 V_8; memset(&V_8, 0, sizeof(V_8)); RectTransform_t972643934 * G_B2_0 = NULL; RectTransform_t972643934 * G_B1_0 = NULL; Slider_t79469677 * G_B8_0 = NULL; Slider_t79469677 * G_B7_0 = NULL; float G_B9_0 = 0.0f; Slider_t79469677 * G_B9_1 = NULL; { RectTransform_t972643934 * L_0 = __this->get_m_HandleContainerRect_28(); RectTransform_t972643934 * L_1 = L_0; G_B1_0 = L_1; if (L_1) { G_B2_0 = L_1; goto IL_0013; } } { RectTransform_t972643934 * L_2 = __this->get_m_FillContainerRect_26(); G_B2_0 = L_2; } IL_0013: { V_0 = G_B2_0; RectTransform_t972643934 * L_3 = V_0; bool L_4 = Object_op_Inequality_m1296218211(NULL /*static, unused*/, L_3, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_4) { goto IL_00d0; } } { RectTransform_t972643934 * L_5 = V_0; NullCheck(L_5); Rect_t4241904616 L_6 = RectTransform_get_rect_m1566017036(L_5, /*hidden argument*/NULL); V_3 = L_6; Vector2_t4282066565 L_7 = Rect_get_size_m136480416((&V_3), /*hidden argument*/NULL); V_4 = L_7; int32_t L_8 = Slider_get_axis_m591825817(__this, /*hidden argument*/NULL); float L_9 = Vector2_get_Item_m2185542843((&V_4), L_8, /*hidden argument*/NULL); if ((!(((float)L_9) > ((float)(0.0f))))) { goto IL_00d0; } } { RectTransform_t972643934 * L_10 = V_0; PointerEventData_t1848751023 * L_11 = ___eventData0; NullCheck(L_11); Vector2_t4282066565 L_12 = PointerEventData_get_position_m2263123361(L_11, /*hidden argument*/NULL); Camera_t2727095145 * L_13 = ___cam1; IL2CPP_RUNTIME_CLASS_INIT(RectTransformUtility_t3025555048_il2cpp_TypeInfo_var); bool L_14 = RectTransformUtility_ScreenPointToLocalPointInRectangle_m666650172(NULL /*static, unused*/, L_10, L_12, L_13, (&V_1), /*hidden argument*/NULL); if (L_14) { goto IL_005c; } } { return; } IL_005c: { Vector2_t4282066565 L_15 = V_1; RectTransform_t972643934 * L_16 = V_0; NullCheck(L_16); Rect_t4241904616 L_17 = RectTransform_get_rect_m1566017036(L_16, /*hidden argument*/NULL); V_5 = L_17; Vector2_t4282066565 L_18 = Rect_get_position_m2933356232((&V_5), /*hidden argument*/NULL); Vector2_t4282066565 L_19 = Vector2_op_Subtraction_m2097149401(NULL /*static, unused*/, L_15, L_18, /*hidden argument*/NULL); V_1 = L_19; Vector2_t4282066565 L_20 = V_1; Vector2_t4282066565 L_21 = __this->get_m_Offset_29(); Vector2_t4282066565 L_22 = Vector2_op_Subtraction_m2097149401(NULL /*static, unused*/, L_20, L_21, /*hidden argument*/NULL); V_6 = L_22; int32_t L_23 = Slider_get_axis_m591825817(__this, /*hidden argument*/NULL); float L_24 = Vector2_get_Item_m2185542843((&V_6), L_23, /*hidden argument*/NULL); RectTransform_t972643934 * L_25 = V_0; NullCheck(L_25); Rect_t4241904616 L_26 = RectTransform_get_rect_m1566017036(L_25, /*hidden argument*/NULL); V_7 = L_26; Vector2_t4282066565 L_27 = Rect_get_size_m136480416((&V_7), /*hidden argument*/NULL); V_8 = L_27; int32_t L_28 = Slider_get_axis_m591825817(__this, /*hidden argument*/NULL); float L_29 = Vector2_get_Item_m2185542843((&V_8), L_28, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(Mathf_t4203372500_il2cpp_TypeInfo_var); float L_30 = Mathf_Clamp01_m2272733930(NULL /*static, unused*/, ((float)((float)L_24/(float)L_29)), /*hidden argument*/NULL); V_2 = L_30; bool L_31 = Slider_get_reverseValue_m1915319492(__this, /*hidden argument*/NULL); G_B7_0 = __this; if (!L_31) { G_B8_0 = __this; goto IL_00ca; } } { float L_32 = V_2; G_B9_0 = ((float)((float)(1.0f)-(float)L_32)); G_B9_1 = G_B7_0; goto IL_00cb; } IL_00ca: { float L_33 = V_2; G_B9_0 = L_33; G_B9_1 = G_B8_0; } IL_00cb: { NullCheck(G_B9_1); Slider_set_normalizedValue_m3382161958(G_B9_1, G_B9_0, /*hidden argument*/NULL); } IL_00d0: { return; } } // System.Boolean UnityEngine.UI.Slider::MayDrag(UnityEngine.EventSystems.PointerEventData) extern "C" bool Slider_MayDrag_m2965973935 (Slider_t79469677 * __this, PointerEventData_t1848751023 * ___eventData0, const MethodInfo* method) { int32_t G_B4_0 = 0; { bool L_0 = VirtFuncInvoker0< bool >::Invoke(9 /* System.Boolean UnityEngine.EventSystems.UIBehaviour::IsActive() */, __this); if (!L_0) { goto IL_0021; } } { bool L_1 = VirtFuncInvoker0< bool >::Invoke(23 /* System.Boolean UnityEngine.UI.Selectable::IsInteractable() */, __this); if (!L_1) { goto IL_0021; } } { PointerEventData_t1848751023 * L_2 = ___eventData0; NullCheck(L_2); int32_t L_3 = PointerEventData_get_button_m796143251(L_2, /*hidden argument*/NULL); G_B4_0 = ((((int32_t)L_3) == ((int32_t)0))? 1 : 0); goto IL_0022; } IL_0021: { G_B4_0 = 0; } IL_0022: { return (bool)G_B4_0; } } // System.Void UnityEngine.UI.Slider::OnPointerDown(UnityEngine.EventSystems.PointerEventData) extern Il2CppClass* RectTransformUtility_t3025555048_il2cpp_TypeInfo_var; extern const uint32_t Slider_OnPointerDown_m2064356406_MetadataUsageId; extern "C" void Slider_OnPointerDown_m2064356406 (Slider_t79469677 * __this, PointerEventData_t1848751023 * ___eventData0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Slider_OnPointerDown_m2064356406_MetadataUsageId); s_Il2CppMethodIntialized = true; } Vector2_t4282066565 V_0; memset(&V_0, 0, sizeof(V_0)); { PointerEventData_t1848751023 * L_0 = ___eventData0; bool L_1 = Slider_MayDrag_m2965973935(__this, L_0, /*hidden argument*/NULL); if (L_1) { goto IL_000d; } } { return; } IL_000d: { PointerEventData_t1848751023 * L_2 = ___eventData0; Selectable_OnPointerDown_m706592619(__this, L_2, /*hidden argument*/NULL); Vector2_t4282066565 L_3 = Vector2_get_zero_m199872368(NULL /*static, unused*/, /*hidden argument*/NULL); __this->set_m_Offset_29(L_3); RectTransform_t972643934 * L_4 = __this->get_m_HandleContainerRect_28(); bool L_5 = Object_op_Inequality_m1296218211(NULL /*static, unused*/, L_4, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_5) { goto IL_0076; } } { RectTransform_t972643934 * L_6 = __this->get_m_HandleRect_17(); PointerEventData_t1848751023 * L_7 = ___eventData0; NullCheck(L_7); Vector2_t4282066565 L_8 = PointerEventData_get_position_m2263123361(L_7, /*hidden argument*/NULL); PointerEventData_t1848751023 * L_9 = ___eventData0; NullCheck(L_9); Camera_t2727095145 * L_10 = PointerEventData_get_enterEventCamera_m1535306943(L_9, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(RectTransformUtility_t3025555048_il2cpp_TypeInfo_var); bool L_11 = RectTransformUtility_RectangleContainsScreenPoint_m1460676684(NULL /*static, unused*/, L_6, L_8, L_10, /*hidden argument*/NULL); if (!L_11) { goto IL_0076; } } { RectTransform_t972643934 * L_12 = __this->get_m_HandleRect_17(); PointerEventData_t1848751023 * L_13 = ___eventData0; NullCheck(L_13); Vector2_t4282066565 L_14 = PointerEventData_get_position_m2263123361(L_13, /*hidden argument*/NULL); PointerEventData_t1848751023 * L_15 = ___eventData0; NullCheck(L_15); Camera_t2727095145 * L_16 = PointerEventData_get_pressEventCamera_m2764092724(L_15, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(RectTransformUtility_t3025555048_il2cpp_TypeInfo_var); bool L_17 = RectTransformUtility_ScreenPointToLocalPointInRectangle_m666650172(NULL /*static, unused*/, L_12, L_14, L_16, (&V_0), /*hidden argument*/NULL); if (!L_17) { goto IL_0071; } } { Vector2_t4282066565 L_18 = V_0; __this->set_m_Offset_29(L_18); } IL_0071: { goto IL_0083; } IL_0076: { PointerEventData_t1848751023 * L_19 = ___eventData0; PointerEventData_t1848751023 * L_20 = ___eventData0; NullCheck(L_20); Camera_t2727095145 * L_21 = PointerEventData_get_pressEventCamera_m2764092724(L_20, /*hidden argument*/NULL); Slider_UpdateDrag_m913163651(__this, L_19, L_21, /*hidden argument*/NULL); } IL_0083: { return; } } // System.Void UnityEngine.UI.Slider::OnDrag(UnityEngine.EventSystems.PointerEventData) extern "C" void Slider_OnDrag_m2689187441 (Slider_t79469677 * __this, PointerEventData_t1848751023 * ___eventData0, const MethodInfo* method) { { PointerEventData_t1848751023 * L_0 = ___eventData0; bool L_1 = Slider_MayDrag_m2965973935(__this, L_0, /*hidden argument*/NULL); if (L_1) { goto IL_000d; } } { return; } IL_000d: { PointerEventData_t1848751023 * L_2 = ___eventData0; PointerEventData_t1848751023 * L_3 = ___eventData0; NullCheck(L_3); Camera_t2727095145 * L_4 = PointerEventData_get_pressEventCamera_m2764092724(L_3, /*hidden argument*/NULL); Slider_UpdateDrag_m913163651(__this, L_2, L_4, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.UI.Slider::OnMove(UnityEngine.EventSystems.AxisEventData) extern "C" void Slider_OnMove_m3684755636 (Slider_t79469677 * __this, AxisEventData_t3355659985 * ___eventData0, const MethodInfo* method) { int32_t V_0 = 0; Slider_t79469677 * G_B9_0 = NULL; Slider_t79469677 * G_B8_0 = NULL; float G_B10_0 = 0.0f; Slider_t79469677 * G_B10_1 = NULL; Slider_t79469677 * G_B17_0 = NULL; Slider_t79469677 * G_B16_0 = NULL; float G_B18_0 = 0.0f; Slider_t79469677 * G_B18_1 = NULL; Slider_t79469677 * G_B25_0 = NULL; Slider_t79469677 * G_B24_0 = NULL; float G_B26_0 = 0.0f; Slider_t79469677 * G_B26_1 = NULL; Slider_t79469677 * G_B33_0 = NULL; Slider_t79469677 * G_B32_0 = NULL; float G_B34_0 = 0.0f; Slider_t79469677 * G_B34_1 = NULL; { bool L_0 = VirtFuncInvoker0< bool >::Invoke(9 /* System.Boolean UnityEngine.EventSystems.UIBehaviour::IsActive() */, __this); if (!L_0) { goto IL_0016; } } { bool L_1 = VirtFuncInvoker0< bool >::Invoke(23 /* System.Boolean UnityEngine.UI.Selectable::IsInteractable() */, __this); if (L_1) { goto IL_001e; } } IL_0016: { AxisEventData_t3355659985 * L_2 = ___eventData0; Selectable_OnMove_m2478875177(__this, L_2, /*hidden argument*/NULL); return; } IL_001e: { AxisEventData_t3355659985 * L_3 = ___eventData0; NullCheck(L_3); int32_t L_4 = AxisEventData_get_moveDir_m2739466109(L_3, /*hidden argument*/NULL); V_0 = L_4; int32_t L_5 = V_0; if (L_5 == 0) { goto IL_0040; } if (L_5 == 1) { goto IL_00fa; } if (L_5 == 2) { goto IL_009d; } if (L_5 == 3) { goto IL_0158; } } { goto IL_01b6; } IL_0040: { int32_t L_6 = Slider_get_axis_m591825817(__this, /*hidden argument*/NULL); if (L_6) { goto IL_0091; } } { Selectable_t1885181538 * L_7 = VirtFuncInvoker0< Selectable_t1885181538 * >::Invoke(26 /* UnityEngine.UI.Selectable UnityEngine.UI.Slider::FindSelectableOnLeft() */, __this); bool L_8 = Object_op_Equality_m3964590952(NULL /*static, unused*/, L_7, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_8) { goto IL_0091; } } { bool L_9 = Slider_get_reverseValue_m1915319492(__this, /*hidden argument*/NULL); G_B8_0 = __this; if (!L_9) { G_B9_0 = __this; goto IL_007a; } } { float L_10 = VirtFuncInvoker0< float >::Invoke(45 /* System.Single UnityEngine.UI.Slider::get_value() */, __this); float L_11 = Slider_get_stepSize_m3189751172(__this, /*hidden argument*/NULL); G_B10_0 = ((float)((float)L_10+(float)L_11)); G_B10_1 = G_B8_0; goto IL_0087; } IL_007a: { float L_12 = VirtFuncInvoker0< float >::Invoke(45 /* System.Single UnityEngine.UI.Slider::get_value() */, __this); float L_13 = Slider_get_stepSize_m3189751172(__this, /*hidden argument*/NULL); G_B10_0 = ((float)((float)L_12-(float)L_13)); G_B10_1 = G_B9_0; } IL_0087: { NullCheck(G_B10_1); Slider_Set_m2575079457(G_B10_1, G_B10_0, /*hidden argument*/NULL); goto IL_0098; } IL_0091: { AxisEventData_t3355659985 * L_14 = ___eventData0; Selectable_OnMove_m2478875177(__this, L_14, /*hidden argument*/NULL); } IL_0098: { goto IL_01b6; } IL_009d: { int32_t L_15 = Slider_get_axis_m591825817(__this, /*hidden argument*/NULL); if (L_15) { goto IL_00ee; } } { Selectable_t1885181538 * L_16 = VirtFuncInvoker0< Selectable_t1885181538 * >::Invoke(27 /* UnityEngine.UI.Selectable UnityEngine.UI.Slider::FindSelectableOnRight() */, __this); bool L_17 = Object_op_Equality_m3964590952(NULL /*static, unused*/, L_16, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_17) { goto IL_00ee; } } { bool L_18 = Slider_get_reverseValue_m1915319492(__this, /*hidden argument*/NULL); G_B16_0 = __this; if (!L_18) { G_B17_0 = __this; goto IL_00d7; } } { float L_19 = VirtFuncInvoker0< float >::Invoke(45 /* System.Single UnityEngine.UI.Slider::get_value() */, __this); float L_20 = Slider_get_stepSize_m3189751172(__this, /*hidden argument*/NULL); G_B18_0 = ((float)((float)L_19-(float)L_20)); G_B18_1 = G_B16_0; goto IL_00e4; } IL_00d7: { float L_21 = VirtFuncInvoker0< float >::Invoke(45 /* System.Single UnityEngine.UI.Slider::get_value() */, __this); float L_22 = Slider_get_stepSize_m3189751172(__this, /*hidden argument*/NULL); G_B18_0 = ((float)((float)L_21+(float)L_22)); G_B18_1 = G_B17_0; } IL_00e4: { NullCheck(G_B18_1); Slider_Set_m2575079457(G_B18_1, G_B18_0, /*hidden argument*/NULL); goto IL_00f5; } IL_00ee: { AxisEventData_t3355659985 * L_23 = ___eventData0; Selectable_OnMove_m2478875177(__this, L_23, /*hidden argument*/NULL); } IL_00f5: { goto IL_01b6; } IL_00fa: { int32_t L_24 = Slider_get_axis_m591825817(__this, /*hidden argument*/NULL); if ((!(((uint32_t)L_24) == ((uint32_t)1)))) { goto IL_014c; } } { Selectable_t1885181538 * L_25 = VirtFuncInvoker0< Selectable_t1885181538 * >::Invoke(28 /* UnityEngine.UI.Selectable UnityEngine.UI.Slider::FindSelectableOnUp() */, __this); bool L_26 = Object_op_Equality_m3964590952(NULL /*static, unused*/, L_25, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_26) { goto IL_014c; } } { bool L_27 = Slider_get_reverseValue_m1915319492(__this, /*hidden argument*/NULL); G_B24_0 = __this; if (!L_27) { G_B25_0 = __this; goto IL_0135; } } { float L_28 = VirtFuncInvoker0< float >::Invoke(45 /* System.Single UnityEngine.UI.Slider::get_value() */, __this); float L_29 = Slider_get_stepSize_m3189751172(__this, /*hidden argument*/NULL); G_B26_0 = ((float)((float)L_28-(float)L_29)); G_B26_1 = G_B24_0; goto IL_0142; } IL_0135: { float L_30 = VirtFuncInvoker0< float >::Invoke(45 /* System.Single UnityEngine.UI.Slider::get_value() */, __this); float L_31 = Slider_get_stepSize_m3189751172(__this, /*hidden argument*/NULL); G_B26_0 = ((float)((float)L_30+(float)L_31)); G_B26_1 = G_B25_0; } IL_0142: { NullCheck(G_B26_1); Slider_Set_m2575079457(G_B26_1, G_B26_0, /*hidden argument*/NULL); goto IL_0153; } IL_014c: { AxisEventData_t3355659985 * L_32 = ___eventData0; Selectable_OnMove_m2478875177(__this, L_32, /*hidden argument*/NULL); } IL_0153: { goto IL_01b6; } IL_0158: { int32_t L_33 = Slider_get_axis_m591825817(__this, /*hidden argument*/NULL); if ((!(((uint32_t)L_33) == ((uint32_t)1)))) { goto IL_01aa; } } { Selectable_t1885181538 * L_34 = VirtFuncInvoker0< Selectable_t1885181538 * >::Invoke(29 /* UnityEngine.UI.Selectable UnityEngine.UI.Slider::FindSelectableOnDown() */, __this); bool L_35 = Object_op_Equality_m3964590952(NULL /*static, unused*/, L_34, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_35) { goto IL_01aa; } } { bool L_36 = Slider_get_reverseValue_m1915319492(__this, /*hidden argument*/NULL); G_B32_0 = __this; if (!L_36) { G_B33_0 = __this; goto IL_0193; } } { float L_37 = VirtFuncInvoker0< float >::Invoke(45 /* System.Single UnityEngine.UI.Slider::get_value() */, __this); float L_38 = Slider_get_stepSize_m3189751172(__this, /*hidden argument*/NULL); G_B34_0 = ((float)((float)L_37+(float)L_38)); G_B34_1 = G_B32_0; goto IL_01a0; } IL_0193: { float L_39 = VirtFuncInvoker0< float >::Invoke(45 /* System.Single UnityEngine.UI.Slider::get_value() */, __this); float L_40 = Slider_get_stepSize_m3189751172(__this, /*hidden argument*/NULL); G_B34_0 = ((float)((float)L_39-(float)L_40)); G_B34_1 = G_B33_0; } IL_01a0: { NullCheck(G_B34_1); Slider_Set_m2575079457(G_B34_1, G_B34_0, /*hidden argument*/NULL); goto IL_01b1; } IL_01aa: { AxisEventData_t3355659985 * L_41 = ___eventData0; Selectable_OnMove_m2478875177(__this, L_41, /*hidden argument*/NULL); } IL_01b1: { goto IL_01b6; } IL_01b6: { return; } } // UnityEngine.UI.Selectable UnityEngine.UI.Slider::FindSelectableOnLeft() extern "C" Selectable_t1885181538 * Slider_FindSelectableOnLeft_m601280629 (Slider_t79469677 * __this, const MethodInfo* method) { Navigation_t1108456480 V_0; memset(&V_0, 0, sizeof(V_0)); { Navigation_t1108456480 L_0 = Selectable_get_navigation_m3138151376(__this, /*hidden argument*/NULL); V_0 = L_0; int32_t L_1 = Navigation_get_mode_m721480509((&V_0), /*hidden argument*/NULL); if ((!(((uint32_t)L_1) == ((uint32_t)3)))) { goto IL_0021; } } { int32_t L_2 = Slider_get_axis_m591825817(__this, /*hidden argument*/NULL); if (L_2) { goto IL_0021; } } { return (Selectable_t1885181538 *)NULL; } IL_0021: { Selectable_t1885181538 * L_3 = Selectable_FindSelectableOnLeft_m3101734378(__this, /*hidden argument*/NULL); return L_3; } } // UnityEngine.UI.Selectable UnityEngine.UI.Slider::FindSelectableOnRight() extern "C" Selectable_t1885181538 * Slider_FindSelectableOnRight_m2605040784 (Slider_t79469677 * __this, const MethodInfo* method) { Navigation_t1108456480 V_0; memset(&V_0, 0, sizeof(V_0)); { Navigation_t1108456480 L_0 = Selectable_get_navigation_m3138151376(__this, /*hidden argument*/NULL); V_0 = L_0; int32_t L_1 = Navigation_get_mode_m721480509((&V_0), /*hidden argument*/NULL); if ((!(((uint32_t)L_1) == ((uint32_t)3)))) { goto IL_0021; } } { int32_t L_2 = Slider_get_axis_m591825817(__this, /*hidden argument*/NULL); if (L_2) { goto IL_0021; } } { return (Selectable_t1885181538 *)NULL; } IL_0021: { Selectable_t1885181538 * L_3 = Selectable_FindSelectableOnRight_m2809695675(__this, /*hidden argument*/NULL); return L_3; } } // UnityEngine.UI.Selectable UnityEngine.UI.Slider::FindSelectableOnUp() extern "C" Selectable_t1885181538 * Slider_FindSelectableOnUp_m3326038345 (Slider_t79469677 * __this, const MethodInfo* method) { Navigation_t1108456480 V_0; memset(&V_0, 0, sizeof(V_0)); { Navigation_t1108456480 L_0 = Selectable_get_navigation_m3138151376(__this, /*hidden argument*/NULL); V_0 = L_0; int32_t L_1 = Navigation_get_mode_m721480509((&V_0), /*hidden argument*/NULL); if ((!(((uint32_t)L_1) == ((uint32_t)3)))) { goto IL_0022; } } { int32_t L_2 = Slider_get_axis_m591825817(__this, /*hidden argument*/NULL); if ((!(((uint32_t)L_2) == ((uint32_t)1)))) { goto IL_0022; } } { return (Selectable_t1885181538 *)NULL; } IL_0022: { Selectable_t1885181538 * L_3 = Selectable_FindSelectableOnUp_m3489533950(__this, /*hidden argument*/NULL); return L_3; } } // UnityEngine.UI.Selectable UnityEngine.UI.Slider::FindSelectableOnDown() extern "C" Selectable_t1885181538 * Slider_FindSelectableOnDown_m381983312 (Slider_t79469677 * __this, const MethodInfo* method) { Navigation_t1108456480 V_0; memset(&V_0, 0, sizeof(V_0)); { Navigation_t1108456480 L_0 = Selectable_get_navigation_m3138151376(__this, /*hidden argument*/NULL); V_0 = L_0; int32_t L_1 = Navigation_get_mode_m721480509((&V_0), /*hidden argument*/NULL); if ((!(((uint32_t)L_1) == ((uint32_t)3)))) { goto IL_0022; } } { int32_t L_2 = Slider_get_axis_m591825817(__this, /*hidden argument*/NULL); if ((!(((uint32_t)L_2) == ((uint32_t)1)))) { goto IL_0022; } } { return (Selectable_t1885181538 *)NULL; } IL_0022: { Selectable_t1885181538 * L_3 = Selectable_FindSelectableOnDown_m2882437061(__this, /*hidden argument*/NULL); return L_3; } } // System.Void UnityEngine.UI.Slider::OnInitializePotentialDrag(UnityEngine.EventSystems.PointerEventData) extern "C" void Slider_OnInitializePotentialDrag_m3120616467 (Slider_t79469677 * __this, PointerEventData_t1848751023 * ___eventData0, const MethodInfo* method) { { PointerEventData_t1848751023 * L_0 = ___eventData0; NullCheck(L_0); PointerEventData_set_useDragThreshold_m2530254510(L_0, (bool)0, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.UI.Slider::SetDirection(UnityEngine.UI.Slider/Direction,System.Boolean) extern Il2CppClass* RectTransform_t972643934_il2cpp_TypeInfo_var; extern Il2CppClass* RectTransformUtility_t3025555048_il2cpp_TypeInfo_var; extern const uint32_t Slider_SetDirection_m1955116790_MetadataUsageId; extern "C" void Slider_SetDirection_m1955116790 (Slider_t79469677 * __this, int32_t ___direction0, bool ___includeRectLayouts1, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Slider_SetDirection_m1955116790_MetadataUsageId); s_Il2CppMethodIntialized = true; } int32_t V_0 = 0; bool V_1 = false; { int32_t L_0 = Slider_get_axis_m591825817(__this, /*hidden argument*/NULL); V_0 = L_0; bool L_1 = Slider_get_reverseValue_m1915319492(__this, /*hidden argument*/NULL); V_1 = L_1; int32_t L_2 = ___direction0; Slider_set_direction_m1506600084(__this, L_2, /*hidden argument*/NULL); bool L_3 = ___includeRectLayouts1; if (L_3) { goto IL_001c; } } { return; } IL_001c: { int32_t L_4 = Slider_get_axis_m591825817(__this, /*hidden argument*/NULL); int32_t L_5 = V_0; if ((((int32_t)L_4) == ((int32_t)L_5))) { goto IL_003a; } } { Transform_t1659122786 * L_6 = Component_get_transform_m4257140443(__this, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(RectTransformUtility_t3025555048_il2cpp_TypeInfo_var); RectTransformUtility_FlipLayoutAxes_m2163490602(NULL /*static, unused*/, ((RectTransform_t972643934 *)IsInstSealed(L_6, RectTransform_t972643934_il2cpp_TypeInfo_var)), (bool)1, (bool)1, /*hidden argument*/NULL); } IL_003a: { bool L_7 = Slider_get_reverseValue_m1915319492(__this, /*hidden argument*/NULL); bool L_8 = V_1; if ((((int32_t)L_7) == ((int32_t)L_8))) { goto IL_005e; } } { Transform_t1659122786 * L_9 = Component_get_transform_m4257140443(__this, /*hidden argument*/NULL); int32_t L_10 = Slider_get_axis_m591825817(__this, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(RectTransformUtility_t3025555048_il2cpp_TypeInfo_var); RectTransformUtility_FlipLayoutOnAxis_m3487429352(NULL /*static, unused*/, ((RectTransform_t972643934 *)IsInstSealed(L_9, RectTransform_t972643934_il2cpp_TypeInfo_var)), L_10, (bool)1, (bool)1, /*hidden argument*/NULL); } IL_005e: { return; } } // System.Boolean UnityEngine.UI.Slider::UnityEngine.UI.ICanvasElement.IsDestroyed() extern "C" bool Slider_UnityEngine_UI_ICanvasElement_IsDestroyed_m1155329269 (Slider_t79469677 * __this, const MethodInfo* method) { { bool L_0 = UIBehaviour_IsDestroyed_m3027499227(__this, /*hidden argument*/NULL); return L_0; } } // UnityEngine.Transform UnityEngine.UI.Slider::UnityEngine.UI.ICanvasElement.get_transform() extern "C" Transform_t1659122786 * Slider_UnityEngine_UI_ICanvasElement_get_transform_m2086174425 (Slider_t79469677 * __this, const MethodInfo* method) { { Transform_t1659122786 * L_0 = Component_get_transform_m4257140443(__this, /*hidden argument*/NULL); return L_0; } } // System.Void UnityEngine.UI.Slider/SliderEvent::.ctor() extern const MethodInfo* UnityEvent_1__ctor_m1354608473_MethodInfo_var; extern const uint32_t SliderEvent__ctor_m1429088576_MetadataUsageId; extern "C" void SliderEvent__ctor_m1429088576 (SliderEvent_t2627072750 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (SliderEvent__ctor_m1429088576_MetadataUsageId); s_Il2CppMethodIntialized = true; } { UnityEvent_1__ctor_m1354608473(__this, /*hidden argument*/UnityEvent_1__ctor_m1354608473_MethodInfo_var); return; } } // UnityEngine.Sprite UnityEngine.UI.SpriteState::get_highlightedSprite() extern "C" Sprite_t3199167241 * SpriteState_get_highlightedSprite_m2511270273 (SpriteState_t2895308594 * __this, const MethodInfo* method) { { Sprite_t3199167241 * L_0 = __this->get_m_HighlightedSprite_0(); return L_0; } } extern "C" Sprite_t3199167241 * SpriteState_get_highlightedSprite_m2511270273_AdjustorThunk (Il2CppObject * __this, const MethodInfo* method) { SpriteState_t2895308594 * _thisAdjusted = reinterpret_cast<SpriteState_t2895308594 *>(__this + 1); return SpriteState_get_highlightedSprite_m2511270273(_thisAdjusted, method); } // System.Void UnityEngine.UI.SpriteState::set_highlightedSprite(UnityEngine.Sprite) extern "C" void SpriteState_set_highlightedSprite_m2778751948 (SpriteState_t2895308594 * __this, Sprite_t3199167241 * ___value0, const MethodInfo* method) { { Sprite_t3199167241 * L_0 = ___value0; __this->set_m_HighlightedSprite_0(L_0); return; } } extern "C" void SpriteState_set_highlightedSprite_m2778751948_AdjustorThunk (Il2CppObject * __this, Sprite_t3199167241 * ___value0, const MethodInfo* method) { SpriteState_t2895308594 * _thisAdjusted = reinterpret_cast<SpriteState_t2895308594 *>(__this + 1); SpriteState_set_highlightedSprite_m2778751948(_thisAdjusted, ___value0, method); } // UnityEngine.Sprite UnityEngine.UI.SpriteState::get_pressedSprite() extern "C" Sprite_t3199167241 * SpriteState_get_pressedSprite_m591013456 (SpriteState_t2895308594 * __this, const MethodInfo* method) { { Sprite_t3199167241 * L_0 = __this->get_m_PressedSprite_1(); return L_0; } } extern "C" Sprite_t3199167241 * SpriteState_get_pressedSprite_m591013456_AdjustorThunk (Il2CppObject * __this, const MethodInfo* method) { SpriteState_t2895308594 * _thisAdjusted = reinterpret_cast<SpriteState_t2895308594 *>(__this + 1); return SpriteState_get_pressedSprite_m591013456(_thisAdjusted, method); } // System.Void UnityEngine.UI.SpriteState::set_pressedSprite(UnityEngine.Sprite) extern "C" void SpriteState_set_pressedSprite_m2255650395 (SpriteState_t2895308594 * __this, Sprite_t3199167241 * ___value0, const MethodInfo* method) { { Sprite_t3199167241 * L_0 = ___value0; __this->set_m_PressedSprite_1(L_0); return; } } extern "C" void SpriteState_set_pressedSprite_m2255650395_AdjustorThunk (Il2CppObject * __this, Sprite_t3199167241 * ___value0, const MethodInfo* method) { SpriteState_t2895308594 * _thisAdjusted = reinterpret_cast<SpriteState_t2895308594 *>(__this + 1); SpriteState_set_pressedSprite_m2255650395(_thisAdjusted, ___value0, method); } // UnityEngine.Sprite UnityEngine.UI.SpriteState::get_disabledSprite() extern "C" Sprite_t3199167241 * SpriteState_get_disabledSprite_m1512804506 (SpriteState_t2895308594 * __this, const MethodInfo* method) { { Sprite_t3199167241 * L_0 = __this->get_m_DisabledSprite_2(); return L_0; } } extern "C" Sprite_t3199167241 * SpriteState_get_disabledSprite_m1512804506_AdjustorThunk (Il2CppObject * __this, const MethodInfo* method) { SpriteState_t2895308594 * _thisAdjusted = reinterpret_cast<SpriteState_t2895308594 *>(__this + 1); return SpriteState_get_disabledSprite_m1512804506(_thisAdjusted, method); } // System.Void UnityEngine.UI.SpriteState::set_disabledSprite(UnityEngine.Sprite) extern "C" void SpriteState_set_disabledSprite_m1447937271 (SpriteState_t2895308594 * __this, Sprite_t3199167241 * ___value0, const MethodInfo* method) { { Sprite_t3199167241 * L_0 = ___value0; __this->set_m_DisabledSprite_2(L_0); return; } } extern "C" void SpriteState_set_disabledSprite_m1447937271_AdjustorThunk (Il2CppObject * __this, Sprite_t3199167241 * ___value0, const MethodInfo* method) { SpriteState_t2895308594 * _thisAdjusted = reinterpret_cast<SpriteState_t2895308594 *>(__this + 1); SpriteState_set_disabledSprite_m1447937271(_thisAdjusted, ___value0, method); } // System.Boolean UnityEngine.UI.SpriteState::Equals(UnityEngine.UI.SpriteState) extern "C" bool SpriteState_Equals_m895455353 (SpriteState_t2895308594 * __this, SpriteState_t2895308594 ___other0, const MethodInfo* method) { int32_t G_B4_0 = 0; { Sprite_t3199167241 * L_0 = SpriteState_get_highlightedSprite_m2511270273(__this, /*hidden argument*/NULL); Sprite_t3199167241 * L_1 = SpriteState_get_highlightedSprite_m2511270273((&___other0), /*hidden argument*/NULL); bool L_2 = Object_op_Equality_m3964590952(NULL /*static, unused*/, L_0, L_1, /*hidden argument*/NULL); if (!L_2) { goto IL_0042; } } { Sprite_t3199167241 * L_3 = SpriteState_get_pressedSprite_m591013456(__this, /*hidden argument*/NULL); Sprite_t3199167241 * L_4 = SpriteState_get_pressedSprite_m591013456((&___other0), /*hidden argument*/NULL); bool L_5 = Object_op_Equality_m3964590952(NULL /*static, unused*/, L_3, L_4, /*hidden argument*/NULL); if (!L_5) { goto IL_0042; } } { Sprite_t3199167241 * L_6 = SpriteState_get_disabledSprite_m1512804506(__this, /*hidden argument*/NULL); Sprite_t3199167241 * L_7 = SpriteState_get_disabledSprite_m1512804506((&___other0), /*hidden argument*/NULL); bool L_8 = Object_op_Equality_m3964590952(NULL /*static, unused*/, L_6, L_7, /*hidden argument*/NULL); G_B4_0 = ((int32_t)(L_8)); goto IL_0043; } IL_0042: { G_B4_0 = 0; } IL_0043: { return (bool)G_B4_0; } } extern "C" bool SpriteState_Equals_m895455353_AdjustorThunk (Il2CppObject * __this, SpriteState_t2895308594 ___other0, const MethodInfo* method) { SpriteState_t2895308594 * _thisAdjusted = reinterpret_cast<SpriteState_t2895308594 *>(__this + 1); return SpriteState_Equals_m895455353(_thisAdjusted, ___other0, method); } // Conversion methods for marshalling of: UnityEngine.UI.SpriteState extern "C" void SpriteState_t2895308594_marshal_pinvoke(const SpriteState_t2895308594& unmarshaled, SpriteState_t2895308594_marshaled_pinvoke& marshaled) { Il2CppCodeGenException* ___m_HighlightedSprite_0Exception = il2cpp_codegen_get_marshal_directive_exception("Cannot marshal field 'm_HighlightedSprite' of type 'SpriteState': Reference type field marshaling is not supported."); IL2CPP_RAISE_MANAGED_EXCEPTION(___m_HighlightedSprite_0Exception); } extern "C" void SpriteState_t2895308594_marshal_pinvoke_back(const SpriteState_t2895308594_marshaled_pinvoke& marshaled, SpriteState_t2895308594& unmarshaled) { Il2CppCodeGenException* ___m_HighlightedSprite_0Exception = il2cpp_codegen_get_marshal_directive_exception("Cannot marshal field 'm_HighlightedSprite' of type 'SpriteState': Reference type field marshaling is not supported."); IL2CPP_RAISE_MANAGED_EXCEPTION(___m_HighlightedSprite_0Exception); } // Conversion method for clean up from marshalling of: UnityEngine.UI.SpriteState extern "C" void SpriteState_t2895308594_marshal_pinvoke_cleanup(SpriteState_t2895308594_marshaled_pinvoke& marshaled) { } // Conversion methods for marshalling of: UnityEngine.UI.SpriteState extern "C" void SpriteState_t2895308594_marshal_com(const SpriteState_t2895308594& unmarshaled, SpriteState_t2895308594_marshaled_com& marshaled) { Il2CppCodeGenException* ___m_HighlightedSprite_0Exception = il2cpp_codegen_get_marshal_directive_exception("Cannot marshal field 'm_HighlightedSprite' of type 'SpriteState': Reference type field marshaling is not supported."); IL2CPP_RAISE_MANAGED_EXCEPTION(___m_HighlightedSprite_0Exception); } extern "C" void SpriteState_t2895308594_marshal_com_back(const SpriteState_t2895308594_marshaled_com& marshaled, SpriteState_t2895308594& unmarshaled) { Il2CppCodeGenException* ___m_HighlightedSprite_0Exception = il2cpp_codegen_get_marshal_directive_exception("Cannot marshal field 'm_HighlightedSprite' of type 'SpriteState': Reference type field marshaling is not supported."); IL2CPP_RAISE_MANAGED_EXCEPTION(___m_HighlightedSprite_0Exception); } // Conversion method for clean up from marshalling of: UnityEngine.UI.SpriteState extern "C" void SpriteState_t2895308594_marshal_com_cleanup(SpriteState_t2895308594_marshaled_com& marshaled) { } // System.Void UnityEngine.UI.StencilMaterial::.cctor() extern Il2CppClass* List_1_t2942339633_il2cpp_TypeInfo_var; extern Il2CppClass* StencilMaterial_t639665897_il2cpp_TypeInfo_var; extern const MethodInfo* List_1__ctor_m577177117_MethodInfo_var; extern const uint32_t StencilMaterial__cctor_m2688860949_MetadataUsageId; extern "C" void StencilMaterial__cctor_m2688860949 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (StencilMaterial__cctor_m2688860949_MetadataUsageId); s_Il2CppMethodIntialized = true; } { List_1_t2942339633 * L_0 = (List_1_t2942339633 *)il2cpp_codegen_object_new(List_1_t2942339633_il2cpp_TypeInfo_var); List_1__ctor_m577177117(L_0, /*hidden argument*/List_1__ctor_m577177117_MethodInfo_var); ((StencilMaterial_t639665897_StaticFields*)StencilMaterial_t639665897_il2cpp_TypeInfo_var->static_fields)->set_m_List_0(L_0); return; } } // UnityEngine.Material UnityEngine.UI.StencilMaterial::Add(UnityEngine.Material,System.Int32) extern "C" Material_t3870600107 * StencilMaterial_Add_m1399519863 (Il2CppObject * __this /* static, unused */, Material_t3870600107 * ___baseMat0, int32_t ___stencilID1, const MethodInfo* method) { { return (Material_t3870600107 *)NULL; } } // UnityEngine.Material UnityEngine.UI.StencilMaterial::Add(UnityEngine.Material,System.Int32,UnityEngine.Rendering.StencilOp,UnityEngine.Rendering.CompareFunction,UnityEngine.Rendering.ColorWriteMask) extern Il2CppClass* StencilMaterial_t639665897_il2cpp_TypeInfo_var; extern const uint32_t StencilMaterial_Add_m310944030_MetadataUsageId; extern "C" Material_t3870600107 * StencilMaterial_Add_m310944030 (Il2CppObject * __this /* static, unused */, Material_t3870600107 * ___baseMat0, int32_t ___stencilID1, int32_t ___operation2, int32_t ___compareFunction3, int32_t ___colorWriteMask4, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (StencilMaterial_Add_m310944030_MetadataUsageId); s_Il2CppMethodIntialized = true; } { Material_t3870600107 * L_0 = ___baseMat0; int32_t L_1 = ___stencilID1; int32_t L_2 = ___operation2; int32_t L_3 = ___compareFunction3; int32_t L_4 = ___colorWriteMask4; IL2CPP_RUNTIME_CLASS_INIT(StencilMaterial_t639665897_il2cpp_TypeInfo_var); Material_t3870600107 * L_5 = StencilMaterial_Add_m264449278(NULL /*static, unused*/, L_0, L_1, L_2, L_3, L_4, ((int32_t)255), ((int32_t)255), /*hidden argument*/NULL); return L_5; } } // UnityEngine.Material UnityEngine.UI.StencilMaterial::Add(UnityEngine.Material,System.Int32,UnityEngine.Rendering.StencilOp,UnityEngine.Rendering.CompareFunction,UnityEngine.Rendering.ColorWriteMask,System.Int32,System.Int32) extern Il2CppClass* String_t_il2cpp_TypeInfo_var; extern Il2CppClass* Debug_t4195163081_il2cpp_TypeInfo_var; extern Il2CppClass* StencilMaterial_t639665897_il2cpp_TypeInfo_var; extern Il2CppClass* MatEntry_t1574154081_il2cpp_TypeInfo_var; extern Il2CppClass* Material_t3870600107_il2cpp_TypeInfo_var; extern Il2CppClass* ObjectU5BU5D_t1108656482_il2cpp_TypeInfo_var; extern Il2CppClass* Int32_t1153838500_il2cpp_TypeInfo_var; extern Il2CppClass* StencilOp_t3324967291_il2cpp_TypeInfo_var; extern Il2CppClass* CompareFunction_t2661816155_il2cpp_TypeInfo_var; extern Il2CppClass* ColorWriteMask_t3214369688_il2cpp_TypeInfo_var; extern Il2CppClass* Boolean_t476798718_il2cpp_TypeInfo_var; extern const MethodInfo* List_1_get_Item_m185575420_MethodInfo_var; extern const MethodInfo* List_1_get_Count_m1970513337_MethodInfo_var; extern const MethodInfo* List_1_Add_m271537933_MethodInfo_var; extern Il2CppCodeGenString* _stringLiteral2129251421; extern Il2CppCodeGenString* _stringLiteral2685099961; extern Il2CppCodeGenString* _stringLiteral2725507710; extern Il2CppCodeGenString* _stringLiteral1806185246; extern Il2CppCodeGenString* _stringLiteral2414713693; extern Il2CppCodeGenString* _stringLiteral576878860; extern Il2CppCodeGenString* _stringLiteral1117226927; extern Il2CppCodeGenString* _stringLiteral3143343391; extern Il2CppCodeGenString* _stringLiteral176305660; extern Il2CppCodeGenString* _stringLiteral2427202721; extern Il2CppCodeGenString* _stringLiteral2495765328; extern Il2CppCodeGenString* _stringLiteral874023787; extern Il2CppCodeGenString* _stringLiteral2870969510; extern Il2CppCodeGenString* _stringLiteral2678437774; extern Il2CppCodeGenString* _stringLiteral2824423942; extern Il2CppCodeGenString* _stringLiteral3702767181; extern const uint32_t StencilMaterial_Add_m264449278_MetadataUsageId; extern "C" Material_t3870600107 * StencilMaterial_Add_m264449278 (Il2CppObject * __this /* static, unused */, Material_t3870600107 * ___baseMat0, int32_t ___stencilID1, int32_t ___operation2, int32_t ___compareFunction3, int32_t ___colorWriteMask4, int32_t ___readMask5, int32_t ___writeMask6, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (StencilMaterial_Add_m264449278_MetadataUsageId); s_Il2CppMethodIntialized = true; } int32_t V_0 = 0; MatEntry_t1574154081 * V_1 = NULL; MatEntry_t1574154081 * V_2 = NULL; MatEntry_t1574154081 * G_B29_0 = NULL; MatEntry_t1574154081 * G_B28_0 = NULL; int32_t G_B30_0 = 0; MatEntry_t1574154081 * G_B30_1 = NULL; String_t* G_B33_0 = NULL; Material_t3870600107 * G_B33_1 = NULL; String_t* G_B32_0 = NULL; Material_t3870600107 * G_B32_1 = NULL; int32_t G_B34_0 = 0; String_t* G_B34_1 = NULL; Material_t3870600107 * G_B34_2 = NULL; { int32_t L_0 = ___stencilID1; if ((((int32_t)L_0) > ((int32_t)0))) { goto IL_0010; } } { int32_t L_1 = ___colorWriteMask4; if ((((int32_t)L_1) == ((int32_t)((int32_t)15)))) { goto IL_001c; } } IL_0010: { Material_t3870600107 * L_2 = ___baseMat0; bool L_3 = Object_op_Equality_m3964590952(NULL /*static, unused*/, L_2, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_3) { goto IL_001e; } } IL_001c: { Material_t3870600107 * L_4 = ___baseMat0; return L_4; } IL_001e: { Material_t3870600107 * L_5 = ___baseMat0; NullCheck(L_5); bool L_6 = Material_HasProperty_m2077312757(L_5, _stringLiteral2129251421, /*hidden argument*/NULL); if (L_6) { goto IL_004b; } } { Material_t3870600107 * L_7 = ___baseMat0; NullCheck(L_7); String_t* L_8 = Object_get_name_m3709440845(L_7, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); String_t* L_9 = String_Concat_m1825781833(NULL /*static, unused*/, _stringLiteral2685099961, L_8, _stringLiteral2725507710, /*hidden argument*/NULL); Material_t3870600107 * L_10 = ___baseMat0; IL2CPP_RUNTIME_CLASS_INIT(Debug_t4195163081_il2cpp_TypeInfo_var); Debug_LogWarning_m4097176146(NULL /*static, unused*/, L_9, L_10, /*hidden argument*/NULL); Material_t3870600107 * L_11 = ___baseMat0; return L_11; } IL_004b: { Material_t3870600107 * L_12 = ___baseMat0; NullCheck(L_12); bool L_13 = Material_HasProperty_m2077312757(L_12, _stringLiteral1806185246, /*hidden argument*/NULL); if (L_13) { goto IL_0078; } } { Material_t3870600107 * L_14 = ___baseMat0; NullCheck(L_14); String_t* L_15 = Object_get_name_m3709440845(L_14, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); String_t* L_16 = String_Concat_m1825781833(NULL /*static, unused*/, _stringLiteral2685099961, L_15, _stringLiteral2414713693, /*hidden argument*/NULL); Material_t3870600107 * L_17 = ___baseMat0; IL2CPP_RUNTIME_CLASS_INIT(Debug_t4195163081_il2cpp_TypeInfo_var); Debug_LogWarning_m4097176146(NULL /*static, unused*/, L_16, L_17, /*hidden argument*/NULL); Material_t3870600107 * L_18 = ___baseMat0; return L_18; } IL_0078: { Material_t3870600107 * L_19 = ___baseMat0; NullCheck(L_19); bool L_20 = Material_HasProperty_m2077312757(L_19, _stringLiteral576878860, /*hidden argument*/NULL); if (L_20) { goto IL_00a5; } } { Material_t3870600107 * L_21 = ___baseMat0; NullCheck(L_21); String_t* L_22 = Object_get_name_m3709440845(L_21, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); String_t* L_23 = String_Concat_m1825781833(NULL /*static, unused*/, _stringLiteral2685099961, L_22, _stringLiteral1117226927, /*hidden argument*/NULL); Material_t3870600107 * L_24 = ___baseMat0; IL2CPP_RUNTIME_CLASS_INIT(Debug_t4195163081_il2cpp_TypeInfo_var); Debug_LogWarning_m4097176146(NULL /*static, unused*/, L_23, L_24, /*hidden argument*/NULL); Material_t3870600107 * L_25 = ___baseMat0; return L_25; } IL_00a5: { Material_t3870600107 * L_26 = ___baseMat0; NullCheck(L_26); bool L_27 = Material_HasProperty_m2077312757(L_26, _stringLiteral3143343391, /*hidden argument*/NULL); if (L_27) { goto IL_00d2; } } { Material_t3870600107 * L_28 = ___baseMat0; NullCheck(L_28); String_t* L_29 = Object_get_name_m3709440845(L_28, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); String_t* L_30 = String_Concat_m1825781833(NULL /*static, unused*/, _stringLiteral2685099961, L_29, _stringLiteral176305660, /*hidden argument*/NULL); Material_t3870600107 * L_31 = ___baseMat0; IL2CPP_RUNTIME_CLASS_INIT(Debug_t4195163081_il2cpp_TypeInfo_var); Debug_LogWarning_m4097176146(NULL /*static, unused*/, L_30, L_31, /*hidden argument*/NULL); Material_t3870600107 * L_32 = ___baseMat0; return L_32; } IL_00d2: { Material_t3870600107 * L_33 = ___baseMat0; NullCheck(L_33); bool L_34 = Material_HasProperty_m2077312757(L_33, _stringLiteral3143343391, /*hidden argument*/NULL); if (L_34) { goto IL_00ff; } } { Material_t3870600107 * L_35 = ___baseMat0; NullCheck(L_35); String_t* L_36 = Object_get_name_m3709440845(L_35, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); String_t* L_37 = String_Concat_m1825781833(NULL /*static, unused*/, _stringLiteral2685099961, L_36, _stringLiteral2427202721, /*hidden argument*/NULL); Material_t3870600107 * L_38 = ___baseMat0; IL2CPP_RUNTIME_CLASS_INIT(Debug_t4195163081_il2cpp_TypeInfo_var); Debug_LogWarning_m4097176146(NULL /*static, unused*/, L_37, L_38, /*hidden argument*/NULL); Material_t3870600107 * L_39 = ___baseMat0; return L_39; } IL_00ff: { Material_t3870600107 * L_40 = ___baseMat0; NullCheck(L_40); bool L_41 = Material_HasProperty_m2077312757(L_40, _stringLiteral2495765328, /*hidden argument*/NULL); if (L_41) { goto IL_012c; } } { Material_t3870600107 * L_42 = ___baseMat0; NullCheck(L_42); String_t* L_43 = Object_get_name_m3709440845(L_42, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); String_t* L_44 = String_Concat_m1825781833(NULL /*static, unused*/, _stringLiteral2685099961, L_43, _stringLiteral874023787, /*hidden argument*/NULL); Material_t3870600107 * L_45 = ___baseMat0; IL2CPP_RUNTIME_CLASS_INIT(Debug_t4195163081_il2cpp_TypeInfo_var); Debug_LogWarning_m4097176146(NULL /*static, unused*/, L_44, L_45, /*hidden argument*/NULL); Material_t3870600107 * L_46 = ___baseMat0; return L_46; } IL_012c: { V_0 = 0; goto IL_01b4; } IL_0133: { IL2CPP_RUNTIME_CLASS_INIT(StencilMaterial_t639665897_il2cpp_TypeInfo_var); List_1_t2942339633 * L_47 = ((StencilMaterial_t639665897_StaticFields*)StencilMaterial_t639665897_il2cpp_TypeInfo_var->static_fields)->get_m_List_0(); int32_t L_48 = V_0; NullCheck(L_47); MatEntry_t1574154081 * L_49 = List_1_get_Item_m185575420(L_47, L_48, /*hidden argument*/List_1_get_Item_m185575420_MethodInfo_var); V_1 = L_49; MatEntry_t1574154081 * L_50 = V_1; NullCheck(L_50); Material_t3870600107 * L_51 = L_50->get_baseMat_0(); Material_t3870600107 * L_52 = ___baseMat0; bool L_53 = Object_op_Equality_m3964590952(NULL /*static, unused*/, L_51, L_52, /*hidden argument*/NULL); if (!L_53) { goto IL_01b0; } } { MatEntry_t1574154081 * L_54 = V_1; NullCheck(L_54); int32_t L_55 = L_54->get_stencilId_3(); int32_t L_56 = ___stencilID1; if ((!(((uint32_t)L_55) == ((uint32_t)L_56)))) { goto IL_01b0; } } { MatEntry_t1574154081 * L_57 = V_1; NullCheck(L_57); int32_t L_58 = L_57->get_operation_4(); int32_t L_59 = ___operation2; if ((!(((uint32_t)L_58) == ((uint32_t)L_59)))) { goto IL_01b0; } } { MatEntry_t1574154081 * L_60 = V_1; NullCheck(L_60); int32_t L_61 = L_60->get_compareFunction_5(); int32_t L_62 = ___compareFunction3; if ((!(((uint32_t)L_61) == ((uint32_t)L_62)))) { goto IL_01b0; } } { MatEntry_t1574154081 * L_63 = V_1; NullCheck(L_63); int32_t L_64 = L_63->get_readMask_6(); int32_t L_65 = ___readMask5; if ((!(((uint32_t)L_64) == ((uint32_t)L_65)))) { goto IL_01b0; } } { MatEntry_t1574154081 * L_66 = V_1; NullCheck(L_66); int32_t L_67 = L_66->get_writeMask_7(); int32_t L_68 = ___writeMask6; if ((!(((uint32_t)L_67) == ((uint32_t)L_68)))) { goto IL_01b0; } } { MatEntry_t1574154081 * L_69 = V_1; NullCheck(L_69); int32_t L_70 = L_69->get_colorMask_9(); int32_t L_71 = ___colorWriteMask4; if ((!(((uint32_t)L_70) == ((uint32_t)L_71)))) { goto IL_01b0; } } { MatEntry_t1574154081 * L_72 = V_1; MatEntry_t1574154081 * L_73 = L_72; NullCheck(L_73); int32_t L_74 = L_73->get_count_2(); NullCheck(L_73); L_73->set_count_2(((int32_t)((int32_t)L_74+(int32_t)1))); MatEntry_t1574154081 * L_75 = V_1; NullCheck(L_75); Material_t3870600107 * L_76 = L_75->get_customMat_1(); return L_76; } IL_01b0: { int32_t L_77 = V_0; V_0 = ((int32_t)((int32_t)L_77+(int32_t)1)); } IL_01b4: { int32_t L_78 = V_0; IL2CPP_RUNTIME_CLASS_INIT(StencilMaterial_t639665897_il2cpp_TypeInfo_var); List_1_t2942339633 * L_79 = ((StencilMaterial_t639665897_StaticFields*)StencilMaterial_t639665897_il2cpp_TypeInfo_var->static_fields)->get_m_List_0(); NullCheck(L_79); int32_t L_80 = List_1_get_Count_m1970513337(L_79, /*hidden argument*/List_1_get_Count_m1970513337_MethodInfo_var); if ((((int32_t)L_78) < ((int32_t)L_80))) { goto IL_0133; } } { MatEntry_t1574154081 * L_81 = (MatEntry_t1574154081 *)il2cpp_codegen_object_new(MatEntry_t1574154081_il2cpp_TypeInfo_var); MatEntry__ctor_m3447775725(L_81, /*hidden argument*/NULL); V_2 = L_81; MatEntry_t1574154081 * L_82 = V_2; NullCheck(L_82); L_82->set_count_2(1); MatEntry_t1574154081 * L_83 = V_2; Material_t3870600107 * L_84 = ___baseMat0; NullCheck(L_83); L_83->set_baseMat_0(L_84); MatEntry_t1574154081 * L_85 = V_2; Material_t3870600107 * L_86 = ___baseMat0; Material_t3870600107 * L_87 = (Material_t3870600107 *)il2cpp_codegen_object_new(Material_t3870600107_il2cpp_TypeInfo_var); Material__ctor_m2546967560(L_87, L_86, /*hidden argument*/NULL); NullCheck(L_85); L_85->set_customMat_1(L_87); MatEntry_t1574154081 * L_88 = V_2; NullCheck(L_88); Material_t3870600107 * L_89 = L_88->get_customMat_1(); NullCheck(L_89); Object_set_hideFlags_m41317712(L_89, ((int32_t)61), /*hidden argument*/NULL); MatEntry_t1574154081 * L_90 = V_2; int32_t L_91 = ___stencilID1; NullCheck(L_90); L_90->set_stencilId_3(L_91); MatEntry_t1574154081 * L_92 = V_2; int32_t L_93 = ___operation2; NullCheck(L_92); L_92->set_operation_4(L_93); MatEntry_t1574154081 * L_94 = V_2; int32_t L_95 = ___compareFunction3; NullCheck(L_94); L_94->set_compareFunction_5(L_95); MatEntry_t1574154081 * L_96 = V_2; int32_t L_97 = ___readMask5; NullCheck(L_96); L_96->set_readMask_6(L_97); MatEntry_t1574154081 * L_98 = V_2; int32_t L_99 = ___writeMask6; NullCheck(L_98); L_98->set_writeMask_7(L_99); MatEntry_t1574154081 * L_100 = V_2; int32_t L_101 = ___colorWriteMask4; NullCheck(L_100); L_100->set_colorMask_9(L_101); MatEntry_t1574154081 * L_102 = V_2; int32_t L_103 = ___operation2; G_B28_0 = L_102; if (!L_103) { G_B29_0 = L_102; goto IL_022c; } } { int32_t L_104 = ___writeMask6; G_B30_0 = ((((int32_t)L_104) > ((int32_t)0))? 1 : 0); G_B30_1 = G_B28_0; goto IL_022d; } IL_022c: { G_B30_0 = 0; G_B30_1 = G_B29_0; } IL_022d: { NullCheck(G_B30_1); G_B30_1->set_useAlphaClip_8((bool)G_B30_0); MatEntry_t1574154081 * L_105 = V_2; NullCheck(L_105); Material_t3870600107 * L_106 = L_105->get_customMat_1(); ObjectU5BU5D_t1108656482* L_107 = ((ObjectU5BU5D_t1108656482*)SZArrayNew(ObjectU5BU5D_t1108656482_il2cpp_TypeInfo_var, (uint32_t)8)); int32_t L_108 = ___stencilID1; int32_t L_109 = L_108; Il2CppObject * L_110 = Box(Int32_t1153838500_il2cpp_TypeInfo_var, &L_109); NullCheck(L_107); IL2CPP_ARRAY_BOUNDS_CHECK(L_107, 0); ArrayElementTypeCheck (L_107, L_110); (L_107)->SetAt(static_cast<il2cpp_array_size_t>(0), (Il2CppObject *)L_110); ObjectU5BU5D_t1108656482* L_111 = L_107; int32_t L_112 = ___operation2; int32_t L_113 = L_112; Il2CppObject * L_114 = Box(StencilOp_t3324967291_il2cpp_TypeInfo_var, &L_113); NullCheck(L_111); IL2CPP_ARRAY_BOUNDS_CHECK(L_111, 1); ArrayElementTypeCheck (L_111, L_114); (L_111)->SetAt(static_cast<il2cpp_array_size_t>(1), (Il2CppObject *)L_114); ObjectU5BU5D_t1108656482* L_115 = L_111; int32_t L_116 = ___compareFunction3; int32_t L_117 = L_116; Il2CppObject * L_118 = Box(CompareFunction_t2661816155_il2cpp_TypeInfo_var, &L_117); NullCheck(L_115); IL2CPP_ARRAY_BOUNDS_CHECK(L_115, 2); ArrayElementTypeCheck (L_115, L_118); (L_115)->SetAt(static_cast<il2cpp_array_size_t>(2), (Il2CppObject *)L_118); ObjectU5BU5D_t1108656482* L_119 = L_115; int32_t L_120 = ___writeMask6; int32_t L_121 = L_120; Il2CppObject * L_122 = Box(Int32_t1153838500_il2cpp_TypeInfo_var, &L_121); NullCheck(L_119); IL2CPP_ARRAY_BOUNDS_CHECK(L_119, 3); ArrayElementTypeCheck (L_119, L_122); (L_119)->SetAt(static_cast<il2cpp_array_size_t>(3), (Il2CppObject *)L_122); ObjectU5BU5D_t1108656482* L_123 = L_119; int32_t L_124 = ___readMask5; int32_t L_125 = L_124; Il2CppObject * L_126 = Box(Int32_t1153838500_il2cpp_TypeInfo_var, &L_125); NullCheck(L_123); IL2CPP_ARRAY_BOUNDS_CHECK(L_123, 4); ArrayElementTypeCheck (L_123, L_126); (L_123)->SetAt(static_cast<il2cpp_array_size_t>(4), (Il2CppObject *)L_126); ObjectU5BU5D_t1108656482* L_127 = L_123; int32_t L_128 = ___colorWriteMask4; int32_t L_129 = L_128; Il2CppObject * L_130 = Box(ColorWriteMask_t3214369688_il2cpp_TypeInfo_var, &L_129); NullCheck(L_127); IL2CPP_ARRAY_BOUNDS_CHECK(L_127, 5); ArrayElementTypeCheck (L_127, L_130); (L_127)->SetAt(static_cast<il2cpp_array_size_t>(5), (Il2CppObject *)L_130); ObjectU5BU5D_t1108656482* L_131 = L_127; MatEntry_t1574154081 * L_132 = V_2; NullCheck(L_132); bool L_133 = L_132->get_useAlphaClip_8(); bool L_134 = L_133; Il2CppObject * L_135 = Box(Boolean_t476798718_il2cpp_TypeInfo_var, &L_134); NullCheck(L_131); IL2CPP_ARRAY_BOUNDS_CHECK(L_131, 6); ArrayElementTypeCheck (L_131, L_135); (L_131)->SetAt(static_cast<il2cpp_array_size_t>(6), (Il2CppObject *)L_135); ObjectU5BU5D_t1108656482* L_136 = L_131; Material_t3870600107 * L_137 = ___baseMat0; NullCheck(L_137); String_t* L_138 = Object_get_name_m3709440845(L_137, /*hidden argument*/NULL); NullCheck(L_136); IL2CPP_ARRAY_BOUNDS_CHECK(L_136, 7); ArrayElementTypeCheck (L_136, L_138); (L_136)->SetAt(static_cast<il2cpp_array_size_t>(7), (Il2CppObject *)L_138); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); String_t* L_139 = String_Format_m4050103162(NULL /*static, unused*/, _stringLiteral2870969510, L_136, /*hidden argument*/NULL); NullCheck(L_106); Object_set_name_m1123518500(L_106, L_139, /*hidden argument*/NULL); MatEntry_t1574154081 * L_140 = V_2; NullCheck(L_140); Material_t3870600107 * L_141 = L_140->get_customMat_1(); int32_t L_142 = ___stencilID1; NullCheck(L_141); Material_SetInt_m2649395040(L_141, _stringLiteral2129251421, L_142, /*hidden argument*/NULL); MatEntry_t1574154081 * L_143 = V_2; NullCheck(L_143); Material_t3870600107 * L_144 = L_143->get_customMat_1(); int32_t L_145 = ___operation2; NullCheck(L_144); Material_SetInt_m2649395040(L_144, _stringLiteral1806185246, L_145, /*hidden argument*/NULL); MatEntry_t1574154081 * L_146 = V_2; NullCheck(L_146); Material_t3870600107 * L_147 = L_146->get_customMat_1(); int32_t L_148 = ___compareFunction3; NullCheck(L_147); Material_SetInt_m2649395040(L_147, _stringLiteral576878860, L_148, /*hidden argument*/NULL); MatEntry_t1574154081 * L_149 = V_2; NullCheck(L_149); Material_t3870600107 * L_150 = L_149->get_customMat_1(); int32_t L_151 = ___readMask5; NullCheck(L_150); Material_SetInt_m2649395040(L_150, _stringLiteral3143343391, L_151, /*hidden argument*/NULL); MatEntry_t1574154081 * L_152 = V_2; NullCheck(L_152); Material_t3870600107 * L_153 = L_152->get_customMat_1(); int32_t L_154 = ___writeMask6; NullCheck(L_153); Material_SetInt_m2649395040(L_153, _stringLiteral2678437774, L_154, /*hidden argument*/NULL); MatEntry_t1574154081 * L_155 = V_2; NullCheck(L_155); Material_t3870600107 * L_156 = L_155->get_customMat_1(); int32_t L_157 = ___colorWriteMask4; NullCheck(L_156); Material_SetInt_m2649395040(L_156, _stringLiteral2495765328, L_157, /*hidden argument*/NULL); MatEntry_t1574154081 * L_158 = V_2; NullCheck(L_158); Material_t3870600107 * L_159 = L_158->get_customMat_1(); NullCheck(L_159); bool L_160 = Material_HasProperty_m2077312757(L_159, _stringLiteral2824423942, /*hidden argument*/NULL); if (!L_160) { goto IL_033d; } } { MatEntry_t1574154081 * L_161 = V_2; NullCheck(L_161); Material_t3870600107 * L_162 = L_161->get_customMat_1(); MatEntry_t1574154081 * L_163 = V_2; NullCheck(L_163); bool L_164 = L_163->get_useAlphaClip_8(); G_B32_0 = _stringLiteral2824423942; G_B32_1 = L_162; if (!L_164) { G_B33_0 = _stringLiteral2824423942; G_B33_1 = L_162; goto IL_0337; } } { G_B34_0 = 1; G_B34_1 = G_B32_0; G_B34_2 = G_B32_1; goto IL_0338; } IL_0337: { G_B34_0 = 0; G_B34_1 = G_B33_0; G_B34_2 = G_B33_1; } IL_0338: { NullCheck(G_B34_2); Material_SetInt_m2649395040(G_B34_2, G_B34_1, G_B34_0, /*hidden argument*/NULL); } IL_033d: { MatEntry_t1574154081 * L_165 = V_2; NullCheck(L_165); bool L_166 = L_165->get_useAlphaClip_8(); if (!L_166) { goto IL_035d; } } { MatEntry_t1574154081 * L_167 = V_2; NullCheck(L_167); Material_t3870600107 * L_168 = L_167->get_customMat_1(); NullCheck(L_168); Material_EnableKeyword_m3802712984(L_168, _stringLiteral3702767181, /*hidden argument*/NULL); goto IL_036d; } IL_035d: { MatEntry_t1574154081 * L_169 = V_2; NullCheck(L_169); Material_t3870600107 * L_170 = L_169->get_customMat_1(); NullCheck(L_170); Material_DisableKeyword_m572736419(L_170, _stringLiteral3702767181, /*hidden argument*/NULL); } IL_036d: { IL2CPP_RUNTIME_CLASS_INIT(StencilMaterial_t639665897_il2cpp_TypeInfo_var); List_1_t2942339633 * L_171 = ((StencilMaterial_t639665897_StaticFields*)StencilMaterial_t639665897_il2cpp_TypeInfo_var->static_fields)->get_m_List_0(); MatEntry_t1574154081 * L_172 = V_2; NullCheck(L_171); List_1_Add_m271537933(L_171, L_172, /*hidden argument*/List_1_Add_m271537933_MethodInfo_var); MatEntry_t1574154081 * L_173 = V_2; NullCheck(L_173); Material_t3870600107 * L_174 = L_173->get_customMat_1(); return L_174; } } // System.Void UnityEngine.UI.StencilMaterial::Remove(UnityEngine.Material) extern Il2CppClass* StencilMaterial_t639665897_il2cpp_TypeInfo_var; extern const MethodInfo* List_1_get_Item_m185575420_MethodInfo_var; extern const MethodInfo* List_1_RemoveAt_m1175538415_MethodInfo_var; extern const MethodInfo* List_1_get_Count_m1970513337_MethodInfo_var; extern const uint32_t StencilMaterial_Remove_m1013236306_MetadataUsageId; extern "C" void StencilMaterial_Remove_m1013236306 (Il2CppObject * __this /* static, unused */, Material_t3870600107 * ___customMat0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (StencilMaterial_Remove_m1013236306_MetadataUsageId); s_Il2CppMethodIntialized = true; } int32_t V_0 = 0; MatEntry_t1574154081 * V_1 = NULL; int32_t V_2 = 0; { Material_t3870600107 * L_0 = ___customMat0; bool L_1 = Object_op_Equality_m3964590952(NULL /*static, unused*/, L_0, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_1) { goto IL_000d; } } { return; } IL_000d: { V_0 = 0; goto IL_006e; } IL_0014: { IL2CPP_RUNTIME_CLASS_INIT(StencilMaterial_t639665897_il2cpp_TypeInfo_var); List_1_t2942339633 * L_2 = ((StencilMaterial_t639665897_StaticFields*)StencilMaterial_t639665897_il2cpp_TypeInfo_var->static_fields)->get_m_List_0(); int32_t L_3 = V_0; NullCheck(L_2); MatEntry_t1574154081 * L_4 = List_1_get_Item_m185575420(L_2, L_3, /*hidden argument*/List_1_get_Item_m185575420_MethodInfo_var); V_1 = L_4; MatEntry_t1574154081 * L_5 = V_1; NullCheck(L_5); Material_t3870600107 * L_6 = L_5->get_customMat_1(); Material_t3870600107 * L_7 = ___customMat0; bool L_8 = Object_op_Inequality_m1296218211(NULL /*static, unused*/, L_6, L_7, /*hidden argument*/NULL); if (!L_8) { goto IL_0036; } } { goto IL_006a; } IL_0036: { MatEntry_t1574154081 * L_9 = V_1; MatEntry_t1574154081 * L_10 = L_9; NullCheck(L_10); int32_t L_11 = L_10->get_count_2(); int32_t L_12 = ((int32_t)((int32_t)L_11-(int32_t)1)); V_2 = L_12; NullCheck(L_10); L_10->set_count_2(L_12); int32_t L_13 = V_2; if (L_13) { goto IL_0069; } } { MatEntry_t1574154081 * L_14 = V_1; NullCheck(L_14); Material_t3870600107 * L_15 = L_14->get_customMat_1(); Misc_DestroyImmediate_m40421862(NULL /*static, unused*/, L_15, /*hidden argument*/NULL); MatEntry_t1574154081 * L_16 = V_1; NullCheck(L_16); L_16->set_baseMat_0((Material_t3870600107 *)NULL); IL2CPP_RUNTIME_CLASS_INIT(StencilMaterial_t639665897_il2cpp_TypeInfo_var); List_1_t2942339633 * L_17 = ((StencilMaterial_t639665897_StaticFields*)StencilMaterial_t639665897_il2cpp_TypeInfo_var->static_fields)->get_m_List_0(); int32_t L_18 = V_0; NullCheck(L_17); List_1_RemoveAt_m1175538415(L_17, L_18, /*hidden argument*/List_1_RemoveAt_m1175538415_MethodInfo_var); } IL_0069: { return; } IL_006a: { int32_t L_19 = V_0; V_0 = ((int32_t)((int32_t)L_19+(int32_t)1)); } IL_006e: { int32_t L_20 = V_0; IL2CPP_RUNTIME_CLASS_INIT(StencilMaterial_t639665897_il2cpp_TypeInfo_var); List_1_t2942339633 * L_21 = ((StencilMaterial_t639665897_StaticFields*)StencilMaterial_t639665897_il2cpp_TypeInfo_var->static_fields)->get_m_List_0(); NullCheck(L_21); int32_t L_22 = List_1_get_Count_m1970513337(L_21, /*hidden argument*/List_1_get_Count_m1970513337_MethodInfo_var); if ((((int32_t)L_20) < ((int32_t)L_22))) { goto IL_0014; } } { return; } } // System.Void UnityEngine.UI.StencilMaterial::ClearAll() extern Il2CppClass* StencilMaterial_t639665897_il2cpp_TypeInfo_var; extern const MethodInfo* List_1_get_Item_m185575420_MethodInfo_var; extern const MethodInfo* List_1_get_Count_m1970513337_MethodInfo_var; extern const MethodInfo* List_1_Clear_m2278277704_MethodInfo_var; extern const uint32_t StencilMaterial_ClearAll_m3351668800_MetadataUsageId; extern "C" void StencilMaterial_ClearAll_m3351668800 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (StencilMaterial_ClearAll_m3351668800_MetadataUsageId); s_Il2CppMethodIntialized = true; } int32_t V_0 = 0; MatEntry_t1574154081 * V_1 = NULL; { V_0 = 0; goto IL_0029; } IL_0007: { IL2CPP_RUNTIME_CLASS_INIT(StencilMaterial_t639665897_il2cpp_TypeInfo_var); List_1_t2942339633 * L_0 = ((StencilMaterial_t639665897_StaticFields*)StencilMaterial_t639665897_il2cpp_TypeInfo_var->static_fields)->get_m_List_0(); int32_t L_1 = V_0; NullCheck(L_0); MatEntry_t1574154081 * L_2 = List_1_get_Item_m185575420(L_0, L_1, /*hidden argument*/List_1_get_Item_m185575420_MethodInfo_var); V_1 = L_2; MatEntry_t1574154081 * L_3 = V_1; NullCheck(L_3); Material_t3870600107 * L_4 = L_3->get_customMat_1(); Misc_DestroyImmediate_m40421862(NULL /*static, unused*/, L_4, /*hidden argument*/NULL); MatEntry_t1574154081 * L_5 = V_1; NullCheck(L_5); L_5->set_baseMat_0((Material_t3870600107 *)NULL); int32_t L_6 = V_0; V_0 = ((int32_t)((int32_t)L_6+(int32_t)1)); } IL_0029: { int32_t L_7 = V_0; IL2CPP_RUNTIME_CLASS_INIT(StencilMaterial_t639665897_il2cpp_TypeInfo_var); List_1_t2942339633 * L_8 = ((StencilMaterial_t639665897_StaticFields*)StencilMaterial_t639665897_il2cpp_TypeInfo_var->static_fields)->get_m_List_0(); NullCheck(L_8); int32_t L_9 = List_1_get_Count_m1970513337(L_8, /*hidden argument*/List_1_get_Count_m1970513337_MethodInfo_var); if ((((int32_t)L_7) < ((int32_t)L_9))) { goto IL_0007; } } { IL2CPP_RUNTIME_CLASS_INIT(StencilMaterial_t639665897_il2cpp_TypeInfo_var); List_1_t2942339633 * L_10 = ((StencilMaterial_t639665897_StaticFields*)StencilMaterial_t639665897_il2cpp_TypeInfo_var->static_fields)->get_m_List_0(); NullCheck(L_10); List_1_Clear_m2278277704(L_10, /*hidden argument*/List_1_Clear_m2278277704_MethodInfo_var); return; } } // System.Void UnityEngine.UI.StencilMaterial/MatEntry::.ctor() extern "C" void MatEntry__ctor_m3447775725 (MatEntry_t1574154081 * __this, const MethodInfo* method) { { __this->set_compareFunction_5(8); Object__ctor_m1772956182(__this, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.UI.Text::.ctor() extern Il2CppClass* String_t_il2cpp_TypeInfo_var; extern Il2CppClass* UIVertexU5BU5D_t1796391381_il2cpp_TypeInfo_var; extern const uint32_t Text__ctor_m216739390_MetadataUsageId; extern "C" void Text__ctor_m216739390 (Text_t9039225 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Text__ctor_m216739390_MetadataUsageId); s_Il2CppMethodIntialized = true; } { FontData_t704020325 * L_0 = FontData_get_defaultFontData_m3606420120(NULL /*static, unused*/, /*hidden argument*/NULL); __this->set_m_FontData_28(L_0); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); String_t* L_1 = ((String_t_StaticFields*)String_t_il2cpp_TypeInfo_var->static_fields)->get_Empty_2(); __this->set_m_Text_29(L_1); __this->set_m_TempVerts_34(((UIVertexU5BU5D_t1796391381*)SZArrayNew(UIVertexU5BU5D_t1796391381_il2cpp_TypeInfo_var, (uint32_t)4))); MaskableGraphic__ctor_m3514233785(__this, /*hidden argument*/NULL); Graphic_set_useLegacyMeshGeneration_m693817504(__this, (bool)0, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.UI.Text::.cctor() extern "C" void Text__cctor_m1941857583 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) { { return; } } // UnityEngine.TextGenerator UnityEngine.UI.Text::get_cachedTextGenerator() extern Il2CppClass* TextGenerator_t538854556_il2cpp_TypeInfo_var; extern const uint32_t Text_get_cachedTextGenerator_m337653083_MetadataUsageId; extern "C" TextGenerator_t538854556 * Text_get_cachedTextGenerator_m337653083 (Text_t9039225 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Text_get_cachedTextGenerator_m337653083_MetadataUsageId); s_Il2CppMethodIntialized = true; } TextGenerator_t538854556 * V_0 = NULL; TextGenerator_t538854556 * G_B5_0 = NULL; TextGenerator_t538854556 * G_B1_0 = NULL; Text_t9039225 * G_B3_0 = NULL; Text_t9039225 * G_B2_0 = NULL; TextGenerator_t538854556 * G_B4_0 = NULL; Text_t9039225 * G_B4_1 = NULL; { TextGenerator_t538854556 * L_0 = __this->get_m_TextCache_30(); TextGenerator_t538854556 * L_1 = L_0; G_B1_0 = L_1; if (L_1) { G_B5_0 = L_1; goto IL_0040; } } { String_t* L_2 = __this->get_m_Text_29(); NullCheck(L_2); int32_t L_3 = String_get_Length_m2979997331(L_2, /*hidden argument*/NULL); G_B2_0 = __this; if (!L_3) { G_B3_0 = __this; goto IL_0033; } } { String_t* L_4 = __this->get_m_Text_29(); NullCheck(L_4); int32_t L_5 = String_get_Length_m2979997331(L_4, /*hidden argument*/NULL); TextGenerator_t538854556 * L_6 = (TextGenerator_t538854556 *)il2cpp_codegen_object_new(TextGenerator_t538854556_il2cpp_TypeInfo_var); TextGenerator__ctor_m1563237700(L_6, L_5, /*hidden argument*/NULL); G_B4_0 = L_6; G_B4_1 = G_B2_0; goto IL_0038; } IL_0033: { TextGenerator_t538854556 * L_7 = (TextGenerator_t538854556 *)il2cpp_codegen_object_new(TextGenerator_t538854556_il2cpp_TypeInfo_var); TextGenerator__ctor_m3994909811(L_7, /*hidden argument*/NULL); G_B4_0 = L_7; G_B4_1 = G_B3_0; } IL_0038: { TextGenerator_t538854556 * L_8 = G_B4_0; V_0 = L_8; NullCheck(G_B4_1); G_B4_1->set_m_TextCache_30(L_8); TextGenerator_t538854556 * L_9 = V_0; G_B5_0 = L_9; } IL_0040: { return G_B5_0; } } // UnityEngine.TextGenerator UnityEngine.UI.Text::get_cachedTextGeneratorForLayout() extern Il2CppClass* TextGenerator_t538854556_il2cpp_TypeInfo_var; extern const uint32_t Text_get_cachedTextGeneratorForLayout_m1260141146_MetadataUsageId; extern "C" TextGenerator_t538854556 * Text_get_cachedTextGeneratorForLayout_m1260141146 (Text_t9039225 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Text_get_cachedTextGeneratorForLayout_m1260141146_MetadataUsageId); s_Il2CppMethodIntialized = true; } TextGenerator_t538854556 * V_0 = NULL; TextGenerator_t538854556 * G_B2_0 = NULL; TextGenerator_t538854556 * G_B1_0 = NULL; { TextGenerator_t538854556 * L_0 = __this->get_m_TextCacheForLayout_31(); TextGenerator_t538854556 * L_1 = L_0; G_B1_0 = L_1; if (L_1) { G_B2_0 = L_1; goto IL_001b; } } { TextGenerator_t538854556 * L_2 = (TextGenerator_t538854556 *)il2cpp_codegen_object_new(TextGenerator_t538854556_il2cpp_TypeInfo_var); TextGenerator__ctor_m3994909811(L_2, /*hidden argument*/NULL); TextGenerator_t538854556 * L_3 = L_2; V_0 = L_3; __this->set_m_TextCacheForLayout_31(L_3); TextGenerator_t538854556 * L_4 = V_0; G_B2_0 = L_4; } IL_001b: { return G_B2_0; } } // UnityEngine.Texture UnityEngine.UI.Text::get_mainTexture() extern "C" Texture_t2526458961 * Text_get_mainTexture_m718426116 (Text_t9039225 * __this, const MethodInfo* method) { { Font_t4241557075 * L_0 = Text_get_font_m2437753165(__this, /*hidden argument*/NULL); bool L_1 = Object_op_Inequality_m1296218211(NULL /*static, unused*/, L_0, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_1) { goto IL_0053; } } { Font_t4241557075 * L_2 = Text_get_font_m2437753165(__this, /*hidden argument*/NULL); NullCheck(L_2); Material_t3870600107 * L_3 = Font_get_material_m2407307367(L_2, /*hidden argument*/NULL); bool L_4 = Object_op_Inequality_m1296218211(NULL /*static, unused*/, L_3, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_4) { goto IL_0053; } } { Font_t4241557075 * L_5 = Text_get_font_m2437753165(__this, /*hidden argument*/NULL); NullCheck(L_5); Material_t3870600107 * L_6 = Font_get_material_m2407307367(L_5, /*hidden argument*/NULL); NullCheck(L_6); Texture_t2526458961 * L_7 = Material_get_mainTexture_m1012267054(L_6, /*hidden argument*/NULL); bool L_8 = Object_op_Inequality_m1296218211(NULL /*static, unused*/, L_7, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_8) { goto IL_0053; } } { Font_t4241557075 * L_9 = Text_get_font_m2437753165(__this, /*hidden argument*/NULL); NullCheck(L_9); Material_t3870600107 * L_10 = Font_get_material_m2407307367(L_9, /*hidden argument*/NULL); NullCheck(L_10); Texture_t2526458961 * L_11 = Material_get_mainTexture_m1012267054(L_10, /*hidden argument*/NULL); return L_11; } IL_0053: { Material_t3870600107 * L_12 = ((Graphic_t836799438 *)__this)->get_m_Material_4(); bool L_13 = Object_op_Inequality_m1296218211(NULL /*static, unused*/, L_12, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_13) { goto IL_0070; } } { Material_t3870600107 * L_14 = ((Graphic_t836799438 *)__this)->get_m_Material_4(); NullCheck(L_14); Texture_t2526458961 * L_15 = Material_get_mainTexture_m1012267054(L_14, /*hidden argument*/NULL); return L_15; } IL_0070: { Texture_t2526458961 * L_16 = Graphic_get_mainTexture_m2936700123(__this, /*hidden argument*/NULL); return L_16; } } // System.Void UnityEngine.UI.Text::FontTextureChanged() extern Il2CppClass* FontUpdateTracker_t340588230_il2cpp_TypeInfo_var; extern Il2CppClass* CanvasUpdateRegistry_t192658922_il2cpp_TypeInfo_var; extern const uint32_t Text_FontTextureChanged_m740758478_MetadataUsageId; extern "C" void Text_FontTextureChanged_m740758478 (Text_t9039225 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Text_FontTextureChanged_m740758478_MetadataUsageId); s_Il2CppMethodIntialized = true; } { bool L_0 = Object_op_Implicit_m2106766291(NULL /*static, unused*/, __this, /*hidden argument*/NULL); if (L_0) { goto IL_0012; } } { IL2CPP_RUNTIME_CLASS_INIT(FontUpdateTracker_t340588230_il2cpp_TypeInfo_var); FontUpdateTracker_UntrackText_m1952028010(NULL /*static, unused*/, __this, /*hidden argument*/NULL); return; } IL_0012: { bool L_1 = __this->get_m_DisableFontTextureRebuiltCallback_33(); if (!L_1) { goto IL_001e; } } { return; } IL_001e: { TextGenerator_t538854556 * L_2 = Text_get_cachedTextGenerator_m337653083(__this, /*hidden argument*/NULL); NullCheck(L_2); TextGenerator_Invalidate_m620450028(L_2, /*hidden argument*/NULL); bool L_3 = VirtFuncInvoker0< bool >::Invoke(9 /* System.Boolean UnityEngine.EventSystems.UIBehaviour::IsActive() */, __this); if (L_3) { goto IL_0035; } } { return; } IL_0035: { IL2CPP_RUNTIME_CLASS_INIT(CanvasUpdateRegistry_t192658922_il2cpp_TypeInfo_var); bool L_4 = CanvasUpdateRegistry_IsRebuildingGraphics_m2979891973(NULL /*static, unused*/, /*hidden argument*/NULL); if (L_4) { goto IL_0049; } } { IL2CPP_RUNTIME_CLASS_INIT(CanvasUpdateRegistry_t192658922_il2cpp_TypeInfo_var); bool L_5 = CanvasUpdateRegistry_IsRebuildingLayout_m1167551012(NULL /*static, unused*/, /*hidden argument*/NULL); if (!L_5) { goto IL_0054; } } IL_0049: { VirtActionInvoker0::Invoke(34 /* System.Void UnityEngine.UI.Text::UpdateGeometry() */, __this); goto IL_005a; } IL_0054: { VirtActionInvoker0::Invoke(21 /* System.Void UnityEngine.UI.Graphic::SetAllDirty() */, __this); } IL_005a: { return; } } // UnityEngine.Font UnityEngine.UI.Text::get_font() extern "C" Font_t4241557075 * Text_get_font_m2437753165 (Text_t9039225 * __this, const MethodInfo* method) { { FontData_t704020325 * L_0 = __this->get_m_FontData_28(); NullCheck(L_0); Font_t4241557075 * L_1 = FontData_get_font_m3285096249(L_0, /*hidden argument*/NULL); return L_1; } } // System.Void UnityEngine.UI.Text::set_font(UnityEngine.Font) extern Il2CppClass* FontUpdateTracker_t340588230_il2cpp_TypeInfo_var; extern const uint32_t Text_set_font_m1978976364_MetadataUsageId; extern "C" void Text_set_font_m1978976364 (Text_t9039225 * __this, Font_t4241557075 * ___value0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Text_set_font_m1978976364_MetadataUsageId); s_Il2CppMethodIntialized = true; } { FontData_t704020325 * L_0 = __this->get_m_FontData_28(); NullCheck(L_0); Font_t4241557075 * L_1 = FontData_get_font_m3285096249(L_0, /*hidden argument*/NULL); Font_t4241557075 * L_2 = ___value0; bool L_3 = Object_op_Equality_m3964590952(NULL /*static, unused*/, L_1, L_2, /*hidden argument*/NULL); if (!L_3) { goto IL_0017; } } { return; } IL_0017: { IL2CPP_RUNTIME_CLASS_INIT(FontUpdateTracker_t340588230_il2cpp_TypeInfo_var); FontUpdateTracker_UntrackText_m1952028010(NULL /*static, unused*/, __this, /*hidden argument*/NULL); FontData_t704020325 * L_4 = __this->get_m_FontData_28(); Font_t4241557075 * L_5 = ___value0; NullCheck(L_4); FontData_set_font_m504888792(L_4, L_5, /*hidden argument*/NULL); FontUpdateTracker_TrackText_m1576315537(NULL /*static, unused*/, __this, /*hidden argument*/NULL); VirtActionInvoker0::Invoke(21 /* System.Void UnityEngine.UI.Graphic::SetAllDirty() */, __this); return; } } // System.String UnityEngine.UI.Text::get_text() extern "C" String_t* Text_get_text_m3833038297 (Text_t9039225 * __this, const MethodInfo* method) { { String_t* L_0 = __this->get_m_Text_29(); return L_0; } } // System.Void UnityEngine.UI.Text::set_text(System.String) extern Il2CppClass* String_t_il2cpp_TypeInfo_var; extern const uint32_t Text_set_text_m302679026_MetadataUsageId; extern "C" void Text_set_text_m302679026 (Text_t9039225 * __this, String_t* ___value0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Text_set_text_m302679026_MetadataUsageId); s_Il2CppMethodIntialized = true; } { String_t* L_0 = ___value0; IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); bool L_1 = String_IsNullOrEmpty_m1256468773(NULL /*static, unused*/, L_0, /*hidden argument*/NULL); if (!L_1) { goto IL_0032; } } { String_t* L_2 = __this->get_m_Text_29(); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); bool L_3 = String_IsNullOrEmpty_m1256468773(NULL /*static, unused*/, L_2, /*hidden argument*/NULL); if (!L_3) { goto IL_001c; } } { return; } IL_001c: { IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); String_t* L_4 = ((String_t_StaticFields*)String_t_il2cpp_TypeInfo_var->static_fields)->get_Empty_2(); __this->set_m_Text_29(L_4); VirtActionInvoker0::Invoke(23 /* System.Void UnityEngine.UI.Graphic::SetVerticesDirty() */, __this); goto IL_0056; } IL_0032: { String_t* L_5 = __this->get_m_Text_29(); String_t* L_6 = ___value0; IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); bool L_7 = String_op_Inequality_m2125462205(NULL /*static, unused*/, L_5, L_6, /*hidden argument*/NULL); if (!L_7) { goto IL_0056; } } { String_t* L_8 = ___value0; __this->set_m_Text_29(L_8); VirtActionInvoker0::Invoke(23 /* System.Void UnityEngine.UI.Graphic::SetVerticesDirty() */, __this); VirtActionInvoker0::Invoke(22 /* System.Void UnityEngine.UI.Graphic::SetLayoutDirty() */, __this); } IL_0056: { return; } } // System.Boolean UnityEngine.UI.Text::get_supportRichText() extern "C" bool Text_get_supportRichText_m226316153 (Text_t9039225 * __this, const MethodInfo* method) { { FontData_t704020325 * L_0 = __this->get_m_FontData_28(); NullCheck(L_0); bool L_1 = FontData_get_richText_m3819861494(L_0, /*hidden argument*/NULL); return L_1; } } // System.Void UnityEngine.UI.Text::set_supportRichText(System.Boolean) extern "C" void Text_set_supportRichText_m1299469806 (Text_t9039225 * __this, bool ___value0, const MethodInfo* method) { { FontData_t704020325 * L_0 = __this->get_m_FontData_28(); NullCheck(L_0); bool L_1 = FontData_get_richText_m3819861494(L_0, /*hidden argument*/NULL); bool L_2 = ___value0; if ((!(((uint32_t)L_1) == ((uint32_t)L_2)))) { goto IL_0012; } } { return; } IL_0012: { FontData_t704020325 * L_3 = __this->get_m_FontData_28(); bool L_4 = ___value0; NullCheck(L_3); FontData_set_richText_m2399891183(L_3, L_4, /*hidden argument*/NULL); VirtActionInvoker0::Invoke(23 /* System.Void UnityEngine.UI.Graphic::SetVerticesDirty() */, __this); VirtActionInvoker0::Invoke(22 /* System.Void UnityEngine.UI.Graphic::SetLayoutDirty() */, __this); return; } } // System.Boolean UnityEngine.UI.Text::get_resizeTextForBestFit() extern "C" bool Text_get_resizeTextForBestFit_m3751631302 (Text_t9039225 * __this, const MethodInfo* method) { { FontData_t704020325 * L_0 = __this->get_m_FontData_28(); NullCheck(L_0); bool L_1 = FontData_get_bestFit_m4181968066(L_0, /*hidden argument*/NULL); return L_1; } } // System.Void UnityEngine.UI.Text::set_resizeTextForBestFit(System.Boolean) extern "C" void Text_set_resizeTextForBestFit_m241625791 (Text_t9039225 * __this, bool ___value0, const MethodInfo* method) { { FontData_t704020325 * L_0 = __this->get_m_FontData_28(); NullCheck(L_0); bool L_1 = FontData_get_bestFit_m4181968066(L_0, /*hidden argument*/NULL); bool L_2 = ___value0; if ((!(((uint32_t)L_1) == ((uint32_t)L_2)))) { goto IL_0012; } } { return; } IL_0012: { FontData_t704020325 * L_3 = __this->get_m_FontData_28(); bool L_4 = ___value0; NullCheck(L_3); FontData_set_bestFit_m408210551(L_3, L_4, /*hidden argument*/NULL); VirtActionInvoker0::Invoke(23 /* System.Void UnityEngine.UI.Graphic::SetVerticesDirty() */, __this); VirtActionInvoker0::Invoke(22 /* System.Void UnityEngine.UI.Graphic::SetLayoutDirty() */, __this); return; } } // System.Int32 UnityEngine.UI.Text::get_resizeTextMinSize() extern "C" int32_t Text_get_resizeTextMinSize_m557265325 (Text_t9039225 * __this, const MethodInfo* method) { { FontData_t704020325 * L_0 = __this->get_m_FontData_28(); NullCheck(L_0); int32_t L_1 = FontData_get_minSize_m3681174594(L_0, /*hidden argument*/NULL); return L_1; } } // System.Void UnityEngine.UI.Text::set_resizeTextMinSize(System.Int32) extern "C" void Text_set_resizeTextMinSize_m3506017186 (Text_t9039225 * __this, int32_t ___value0, const MethodInfo* method) { { FontData_t704020325 * L_0 = __this->get_m_FontData_28(); NullCheck(L_0); int32_t L_1 = FontData_get_minSize_m3681174594(L_0, /*hidden argument*/NULL); int32_t L_2 = ___value0; if ((!(((uint32_t)L_1) == ((uint32_t)L_2)))) { goto IL_0012; } } { return; } IL_0012: { FontData_t704020325 * L_3 = __this->get_m_FontData_28(); int32_t L_4 = ___value0; NullCheck(L_3); FontData_set_minSize_m3139125175(L_3, L_4, /*hidden argument*/NULL); VirtActionInvoker0::Invoke(23 /* System.Void UnityEngine.UI.Graphic::SetVerticesDirty() */, __this); VirtActionInvoker0::Invoke(22 /* System.Void UnityEngine.UI.Graphic::SetLayoutDirty() */, __this); return; } } // System.Int32 UnityEngine.UI.Text::get_resizeTextMaxSize() extern "C" int32_t Text_get_resizeTextMaxSize_m4079754047 (Text_t9039225 * __this, const MethodInfo* method) { { FontData_t704020325 * L_0 = __this->get_m_FontData_28(); NullCheck(L_0); int32_t L_1 = FontData_get_maxSize_m2908696020(L_0, /*hidden argument*/NULL); return L_1; } } // System.Void UnityEngine.UI.Text::set_resizeTextMaxSize(System.Int32) extern "C" void Text_set_resizeTextMaxSize_m2626859572 (Text_t9039225 * __this, int32_t ___value0, const MethodInfo* method) { { FontData_t704020325 * L_0 = __this->get_m_FontData_28(); NullCheck(L_0); int32_t L_1 = FontData_get_maxSize_m2908696020(L_0, /*hidden argument*/NULL); int32_t L_2 = ___value0; if ((!(((uint32_t)L_1) == ((uint32_t)L_2)))) { goto IL_0012; } } { return; } IL_0012: { FontData_t704020325 * L_3 = __this->get_m_FontData_28(); int32_t L_4 = ___value0; NullCheck(L_3); FontData_set_maxSize_m2259967561(L_3, L_4, /*hidden argument*/NULL); VirtActionInvoker0::Invoke(23 /* System.Void UnityEngine.UI.Graphic::SetVerticesDirty() */, __this); VirtActionInvoker0::Invoke(22 /* System.Void UnityEngine.UI.Graphic::SetLayoutDirty() */, __this); return; } } // UnityEngine.TextAnchor UnityEngine.UI.Text::get_alignment() extern "C" int32_t Text_get_alignment_m2624482868 (Text_t9039225 * __this, const MethodInfo* method) { { FontData_t704020325 * L_0 = __this->get_m_FontData_28(); NullCheck(L_0); int32_t L_1 = FontData_get_alignment_m3864278344(L_0, /*hidden argument*/NULL); return L_1; } } // System.Void UnityEngine.UI.Text::set_alignment(UnityEngine.TextAnchor) extern "C" void Text_set_alignment_m4246723817 (Text_t9039225 * __this, int32_t ___value0, const MethodInfo* method) { { FontData_t704020325 * L_0 = __this->get_m_FontData_28(); NullCheck(L_0); int32_t L_1 = FontData_get_alignment_m3864278344(L_0, /*hidden argument*/NULL); int32_t L_2 = ___value0; if ((!(((uint32_t)L_1) == ((uint32_t)L_2)))) { goto IL_0012; } } { return; } IL_0012: { FontData_t704020325 * L_3 = __this->get_m_FontData_28(); int32_t L_4 = ___value0; NullCheck(L_3); FontData_set_alignment_m4148907005(L_3, L_4, /*hidden argument*/NULL); VirtActionInvoker0::Invoke(23 /* System.Void UnityEngine.UI.Graphic::SetVerticesDirty() */, __this); VirtActionInvoker0::Invoke(22 /* System.Void UnityEngine.UI.Graphic::SetLayoutDirty() */, __this); return; } } // System.Boolean UnityEngine.UI.Text::get_alignByGeometry() extern "C" bool Text_get_alignByGeometry_m3404407727 (Text_t9039225 * __this, const MethodInfo* method) { { FontData_t704020325 * L_0 = __this->get_m_FontData_28(); NullCheck(L_0); bool L_1 = FontData_get_alignByGeometry_m1074013123(L_0, /*hidden argument*/NULL); return L_1; } } // System.Void UnityEngine.UI.Text::set_alignByGeometry(System.Boolean) extern "C" void Text_set_alignByGeometry_m812094372 (Text_t9039225 * __this, bool ___value0, const MethodInfo* method) { { FontData_t704020325 * L_0 = __this->get_m_FontData_28(); NullCheck(L_0); bool L_1 = FontData_get_alignByGeometry_m1074013123(L_0, /*hidden argument*/NULL); bool L_2 = ___value0; if ((!(((uint32_t)L_1) == ((uint32_t)L_2)))) { goto IL_0012; } } { return; } IL_0012: { FontData_t704020325 * L_3 = __this->get_m_FontData_28(); bool L_4 = ___value0; NullCheck(L_3); FontData_set_alignByGeometry_m1124841400(L_3, L_4, /*hidden argument*/NULL); VirtActionInvoker0::Invoke(23 /* System.Void UnityEngine.UI.Graphic::SetVerticesDirty() */, __this); return; } } // System.Int32 UnityEngine.UI.Text::get_fontSize() extern "C" int32_t Text_get_fontSize_m2862645687 (Text_t9039225 * __this, const MethodInfo* method) { { FontData_t704020325 * L_0 = __this->get_m_FontData_28(); NullCheck(L_0); int32_t L_1 = FontData_get_fontSize_m146058531(L_0, /*hidden argument*/NULL); return L_1; } } // System.Void UnityEngine.UI.Text::set_fontSize(System.Int32) extern "C" void Text_set_fontSize_m2013207524 (Text_t9039225 * __this, int32_t ___value0, const MethodInfo* method) { { FontData_t704020325 * L_0 = __this->get_m_FontData_28(); NullCheck(L_0); int32_t L_1 = FontData_get_fontSize_m146058531(L_0, /*hidden argument*/NULL); int32_t L_2 = ___value0; if ((!(((uint32_t)L_1) == ((uint32_t)L_2)))) { goto IL_0012; } } { return; } IL_0012: { FontData_t704020325 * L_3 = __this->get_m_FontData_28(); int32_t L_4 = ___value0; NullCheck(L_3); FontData_set_fontSize_m539119952(L_3, L_4, /*hidden argument*/NULL); VirtActionInvoker0::Invoke(23 /* System.Void UnityEngine.UI.Graphic::SetVerticesDirty() */, __this); VirtActionInvoker0::Invoke(22 /* System.Void UnityEngine.UI.Graphic::SetLayoutDirty() */, __this); return; } } // UnityEngine.HorizontalWrapMode UnityEngine.UI.Text::get_horizontalOverflow() extern "C" int32_t Text_get_horizontalOverflow_m428751238 (Text_t9039225 * __this, const MethodInfo* method) { { FontData_t704020325 * L_0 = __this->get_m_FontData_28(); NullCheck(L_0); int32_t L_1 = FontData_get_horizontalOverflow_m1371187570(L_0, /*hidden argument*/NULL); return L_1; } } // System.Void UnityEngine.UI.Text::set_horizontalOverflow(UnityEngine.HorizontalWrapMode) extern "C" void Text_set_horizontalOverflow_m1764021409 (Text_t9039225 * __this, int32_t ___value0, const MethodInfo* method) { { FontData_t704020325 * L_0 = __this->get_m_FontData_28(); NullCheck(L_0); int32_t L_1 = FontData_get_horizontalOverflow_m1371187570(L_0, /*hidden argument*/NULL); int32_t L_2 = ___value0; if ((!(((uint32_t)L_1) == ((uint32_t)L_2)))) { goto IL_0012; } } { return; } IL_0012: { FontData_t704020325 * L_3 = __this->get_m_FontData_28(); int32_t L_4 = ___value0; NullCheck(L_3); FontData_set_horizontalOverflow_m1187704845(L_3, L_4, /*hidden argument*/NULL); VirtActionInvoker0::Invoke(23 /* System.Void UnityEngine.UI.Graphic::SetVerticesDirty() */, __this); VirtActionInvoker0::Invoke(22 /* System.Void UnityEngine.UI.Graphic::SetLayoutDirty() */, __this); return; } } // UnityEngine.VerticalWrapMode UnityEngine.UI.Text::get_verticalOverflow() extern "C" int32_t Text_get_verticalOverflow_m4214690218 (Text_t9039225 * __this, const MethodInfo* method) { { FontData_t704020325 * L_0 = __this->get_m_FontData_28(); NullCheck(L_0); int32_t L_1 = FontData_get_verticalOverflow_m1971090326(L_0, /*hidden argument*/NULL); return L_1; } } // System.Void UnityEngine.UI.Text::set_verticalOverflow(UnityEngine.VerticalWrapMode) extern "C" void Text_set_verticalOverflow_m1954003489 (Text_t9039225 * __this, int32_t ___value0, const MethodInfo* method) { { FontData_t704020325 * L_0 = __this->get_m_FontData_28(); NullCheck(L_0); int32_t L_1 = FontData_get_verticalOverflow_m1971090326(L_0, /*hidden argument*/NULL); int32_t L_2 = ___value0; if ((!(((uint32_t)L_1) == ((uint32_t)L_2)))) { goto IL_0012; } } { return; } IL_0012: { FontData_t704020325 * L_3 = __this->get_m_FontData_28(); int32_t L_4 = ___value0; NullCheck(L_3); FontData_set_verticalOverflow_m1743547277(L_3, L_4, /*hidden argument*/NULL); VirtActionInvoker0::Invoke(23 /* System.Void UnityEngine.UI.Graphic::SetVerticesDirty() */, __this); VirtActionInvoker0::Invoke(22 /* System.Void UnityEngine.UI.Graphic::SetLayoutDirty() */, __this); return; } } // System.Single UnityEngine.UI.Text::get_lineSpacing() extern "C" float Text_get_lineSpacing_m2968404366 (Text_t9039225 * __this, const MethodInfo* method) { { FontData_t704020325 * L_0 = __this->get_m_FontData_28(); NullCheck(L_0); float L_1 = FontData_get_lineSpacing_m3558513826(L_0, /*hidden argument*/NULL); return L_1; } } // System.Void UnityEngine.UI.Text::set_lineSpacing(System.Single) extern "C" void Text_set_lineSpacing_m3440093 (Text_t9039225 * __this, float ___value0, const MethodInfo* method) { { FontData_t704020325 * L_0 = __this->get_m_FontData_28(); NullCheck(L_0); float L_1 = FontData_get_lineSpacing_m3558513826(L_0, /*hidden argument*/NULL); float L_2 = ___value0; if ((!(((float)L_1) == ((float)L_2)))) { goto IL_0012; } } { return; } IL_0012: { FontData_t704020325 * L_3 = __this->get_m_FontData_28(); float L_4 = ___value0; NullCheck(L_3); FontData_set_lineSpacing_m3483835721(L_3, L_4, /*hidden argument*/NULL); VirtActionInvoker0::Invoke(23 /* System.Void UnityEngine.UI.Graphic::SetVerticesDirty() */, __this); VirtActionInvoker0::Invoke(22 /* System.Void UnityEngine.UI.Graphic::SetLayoutDirty() */, __this); return; } } // UnityEngine.FontStyle UnityEngine.UI.Text::get_fontStyle() extern "C" int32_t Text_get_fontStyle_m1258883933 (Text_t9039225 * __this, const MethodInfo* method) { { FontData_t704020325 * L_0 = __this->get_m_FontData_28(); NullCheck(L_0); int32_t L_1 = FontData_get_fontStyle_m2936188273(L_0, /*hidden argument*/NULL); return L_1; } } // System.Void UnityEngine.UI.Text::set_fontStyle(UnityEngine.FontStyle) extern "C" void Text_set_fontStyle_m2882242342 (Text_t9039225 * __this, int32_t ___value0, const MethodInfo* method) { { FontData_t704020325 * L_0 = __this->get_m_FontData_28(); NullCheck(L_0); int32_t L_1 = FontData_get_fontStyle_m2936188273(L_0, /*hidden argument*/NULL); int32_t L_2 = ___value0; if ((!(((uint32_t)L_1) == ((uint32_t)L_2)))) { goto IL_0012; } } { return; } IL_0012: { FontData_t704020325 * L_3 = __this->get_m_FontData_28(); int32_t L_4 = ___value0; NullCheck(L_3); FontData_set_fontStyle_m3987465618(L_3, L_4, /*hidden argument*/NULL); VirtActionInvoker0::Invoke(23 /* System.Void UnityEngine.UI.Graphic::SetVerticesDirty() */, __this); VirtActionInvoker0::Invoke(22 /* System.Void UnityEngine.UI.Graphic::SetLayoutDirty() */, __this); return; } } // System.Single UnityEngine.UI.Text::get_pixelsPerUnit() extern "C" float Text_get_pixelsPerUnit_m4148756467 (Text_t9039225 * __this, const MethodInfo* method) { Canvas_t2727140764 * V_0 = NULL; { Canvas_t2727140764 * L_0 = Graphic_get_canvas_m4291384250(__this, /*hidden argument*/NULL); V_0 = L_0; Canvas_t2727140764 * L_1 = V_0; bool L_2 = Object_op_Implicit_m2106766291(NULL /*static, unused*/, L_1, /*hidden argument*/NULL); if (L_2) { goto IL_0018; } } { return (1.0f); } IL_0018: { Font_t4241557075 * L_3 = Text_get_font_m2437753165(__this, /*hidden argument*/NULL); bool L_4 = Object_op_Implicit_m2106766291(NULL /*static, unused*/, L_3, /*hidden argument*/NULL); if (!L_4) { goto IL_0038; } } { Font_t4241557075 * L_5 = Text_get_font_m2437753165(__this, /*hidden argument*/NULL); NullCheck(L_5); bool L_6 = Font_get_dynamic_m3880144684(L_5, /*hidden argument*/NULL); if (!L_6) { goto IL_003f; } } IL_0038: { Canvas_t2727140764 * L_7 = V_0; NullCheck(L_7); float L_8 = Canvas_get_scaleFactor_m1187077271(L_7, /*hidden argument*/NULL); return L_8; } IL_003f: { FontData_t704020325 * L_9 = __this->get_m_FontData_28(); NullCheck(L_9); int32_t L_10 = FontData_get_fontSize_m146058531(L_9, /*hidden argument*/NULL); if ((((int32_t)L_10) <= ((int32_t)0))) { goto IL_0061; } } { Font_t4241557075 * L_11 = Text_get_font_m2437753165(__this, /*hidden argument*/NULL); NullCheck(L_11); int32_t L_12 = Font_get_fontSize_m3025810271(L_11, /*hidden argument*/NULL); if ((((int32_t)L_12) > ((int32_t)0))) { goto IL_0067; } } IL_0061: { return (1.0f); } IL_0067: { Font_t4241557075 * L_13 = Text_get_font_m2437753165(__this, /*hidden argument*/NULL); NullCheck(L_13); int32_t L_14 = Font_get_fontSize_m3025810271(L_13, /*hidden argument*/NULL); FontData_t704020325 * L_15 = __this->get_m_FontData_28(); NullCheck(L_15); int32_t L_16 = FontData_get_fontSize_m146058531(L_15, /*hidden argument*/NULL); return ((float)((float)(((float)((float)L_14)))/(float)(((float)((float)L_16))))); } } // System.Void UnityEngine.UI.Text::OnEnable() extern Il2CppClass* FontUpdateTracker_t340588230_il2cpp_TypeInfo_var; extern const uint32_t Text_OnEnable_m3618900104_MetadataUsageId; extern "C" void Text_OnEnable_m3618900104 (Text_t9039225 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Text_OnEnable_m3618900104_MetadataUsageId); s_Il2CppMethodIntialized = true; } { MaskableGraphic_OnEnable_m487460141(__this, /*hidden argument*/NULL); TextGenerator_t538854556 * L_0 = Text_get_cachedTextGenerator_m337653083(__this, /*hidden argument*/NULL); NullCheck(L_0); TextGenerator_Invalidate_m620450028(L_0, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(FontUpdateTracker_t340588230_il2cpp_TypeInfo_var); FontUpdateTracker_TrackText_m1576315537(NULL /*static, unused*/, __this, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.UI.Text::OnDisable() extern Il2CppClass* FontUpdateTracker_t340588230_il2cpp_TypeInfo_var; extern const uint32_t Text_OnDisable_m957690789_MetadataUsageId; extern "C" void Text_OnDisable_m957690789 (Text_t9039225 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Text_OnDisable_m957690789_MetadataUsageId); s_Il2CppMethodIntialized = true; } { IL2CPP_RUNTIME_CLASS_INIT(FontUpdateTracker_t340588230_il2cpp_TypeInfo_var); FontUpdateTracker_UntrackText_m1952028010(NULL /*static, unused*/, __this, /*hidden argument*/NULL); MaskableGraphic_OnDisable_m2667299744(__this, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.UI.Text::UpdateGeometry() extern "C" void Text_UpdateGeometry_m1493208737 (Text_t9039225 * __this, const MethodInfo* method) { { Font_t4241557075 * L_0 = Text_get_font_m2437753165(__this, /*hidden argument*/NULL); bool L_1 = Object_op_Inequality_m1296218211(NULL /*static, unused*/, L_0, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_1) { goto IL_0017; } } { Graphic_UpdateGeometry_m2127951660(__this, /*hidden argument*/NULL); } IL_0017: { return; } } // UnityEngine.TextGenerationSettings UnityEngine.UI.Text::GetGenerationSettings(UnityEngine.Vector2) extern Il2CppClass* TextGenerationSettings_t1923005356_il2cpp_TypeInfo_var; extern const uint32_t Text_GetGenerationSettings_m554596117_MetadataUsageId; extern "C" TextGenerationSettings_t1923005356 Text_GetGenerationSettings_m554596117 (Text_t9039225 * __this, Vector2_t4282066565 ___extents0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Text_GetGenerationSettings_m554596117_MetadataUsageId); s_Il2CppMethodIntialized = true; } TextGenerationSettings_t1923005356 V_0; memset(&V_0, 0, sizeof(V_0)); { Initobj (TextGenerationSettings_t1923005356_il2cpp_TypeInfo_var, (&V_0)); Vector2_t4282066565 L_0 = ___extents0; (&V_0)->set_generationExtents_15(L_0); Font_t4241557075 * L_1 = Text_get_font_m2437753165(__this, /*hidden argument*/NULL); bool L_2 = Object_op_Inequality_m1296218211(NULL /*static, unused*/, L_1, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_2) { goto IL_0067; } } { Font_t4241557075 * L_3 = Text_get_font_m2437753165(__this, /*hidden argument*/NULL); NullCheck(L_3); bool L_4 = Font_get_dynamic_m3880144684(L_3, /*hidden argument*/NULL); if (!L_4) { goto IL_0067; } } { FontData_t704020325 * L_5 = __this->get_m_FontData_28(); NullCheck(L_5); int32_t L_6 = FontData_get_fontSize_m146058531(L_5, /*hidden argument*/NULL); (&V_0)->set_fontSize_2(L_6); FontData_t704020325 * L_7 = __this->get_m_FontData_28(); NullCheck(L_7); int32_t L_8 = FontData_get_minSize_m3681174594(L_7, /*hidden argument*/NULL); (&V_0)->set_resizeTextMinSize_10(L_8); FontData_t704020325 * L_9 = __this->get_m_FontData_28(); NullCheck(L_9); int32_t L_10 = FontData_get_maxSize_m2908696020(L_9, /*hidden argument*/NULL); (&V_0)->set_resizeTextMaxSize_11(L_10); } IL_0067: { FontData_t704020325 * L_11 = __this->get_m_FontData_28(); NullCheck(L_11); int32_t L_12 = FontData_get_alignment_m3864278344(L_11, /*hidden argument*/NULL); (&V_0)->set_textAnchor_7(L_12); FontData_t704020325 * L_13 = __this->get_m_FontData_28(); NullCheck(L_13); bool L_14 = FontData_get_alignByGeometry_m1074013123(L_13, /*hidden argument*/NULL); (&V_0)->set_alignByGeometry_8(L_14); float L_15 = Text_get_pixelsPerUnit_m4148756467(__this, /*hidden argument*/NULL); (&V_0)->set_scaleFactor_5(L_15); Color_t4194546905 L_16 = Graphic_get_color_m2048831972(__this, /*hidden argument*/NULL); (&V_0)->set_color_1(L_16); Font_t4241557075 * L_17 = Text_get_font_m2437753165(__this, /*hidden argument*/NULL); (&V_0)->set_font_0(L_17); RectTransform_t972643934 * L_18 = Graphic_get_rectTransform_m4017371950(__this, /*hidden argument*/NULL); NullCheck(L_18); Vector2_t4282066565 L_19 = RectTransform_get_pivot_m3785570595(L_18, /*hidden argument*/NULL); (&V_0)->set_pivot_16(L_19); FontData_t704020325 * L_20 = __this->get_m_FontData_28(); NullCheck(L_20); bool L_21 = FontData_get_richText_m3819861494(L_20, /*hidden argument*/NULL); (&V_0)->set_richText_4(L_21); FontData_t704020325 * L_22 = __this->get_m_FontData_28(); NullCheck(L_22); float L_23 = FontData_get_lineSpacing_m3558513826(L_22, /*hidden argument*/NULL); (&V_0)->set_lineSpacing_3(L_23); FontData_t704020325 * L_24 = __this->get_m_FontData_28(); NullCheck(L_24); int32_t L_25 = FontData_get_fontStyle_m2936188273(L_24, /*hidden argument*/NULL); (&V_0)->set_fontStyle_6(L_25); FontData_t704020325 * L_26 = __this->get_m_FontData_28(); NullCheck(L_26); bool L_27 = FontData_get_bestFit_m4181968066(L_26, /*hidden argument*/NULL); (&V_0)->set_resizeTextForBestFit_9(L_27); (&V_0)->set_updateBounds_12((bool)0); FontData_t704020325 * L_28 = __this->get_m_FontData_28(); NullCheck(L_28); int32_t L_29 = FontData_get_horizontalOverflow_m1371187570(L_28, /*hidden argument*/NULL); (&V_0)->set_horizontalOverflow_14(L_29); FontData_t704020325 * L_30 = __this->get_m_FontData_28(); NullCheck(L_30); int32_t L_31 = FontData_get_verticalOverflow_m1971090326(L_30, /*hidden argument*/NULL); (&V_0)->set_verticalOverflow_13(L_31); TextGenerationSettings_t1923005356 L_32 = V_0; return L_32; } } // UnityEngine.Vector2 UnityEngine.UI.Text::GetTextAnchorPivot(UnityEngine.TextAnchor) extern "C" Vector2_t4282066565 Text_GetTextAnchorPivot_m7192668 (Il2CppObject * __this /* static, unused */, int32_t ___anchor0, const MethodInfo* method) { int32_t V_0 = 0; { int32_t L_0 = ___anchor0; V_0 = L_0; int32_t L_1 = V_0; if (L_1 == 0) { goto IL_0091; } if (L_1 == 1) { goto IL_00a1; } if (L_1 == 2) { goto IL_00b1; } if (L_1 == 3) { goto IL_0061; } if (L_1 == 4) { goto IL_0071; } if (L_1 == 5) { goto IL_0081; } if (L_1 == 6) { goto IL_0031; } if (L_1 == 7) { goto IL_0041; } if (L_1 == 8) { goto IL_0051; } } { goto IL_00c1; } IL_0031: { Vector2_t4282066565 L_2; memset(&L_2, 0, sizeof(L_2)); Vector2__ctor_m1517109030(&L_2, (0.0f), (0.0f), /*hidden argument*/NULL); return L_2; } IL_0041: { Vector2_t4282066565 L_3; memset(&L_3, 0, sizeof(L_3)); Vector2__ctor_m1517109030(&L_3, (0.5f), (0.0f), /*hidden argument*/NULL); return L_3; } IL_0051: { Vector2_t4282066565 L_4; memset(&L_4, 0, sizeof(L_4)); Vector2__ctor_m1517109030(&L_4, (1.0f), (0.0f), /*hidden argument*/NULL); return L_4; } IL_0061: { Vector2_t4282066565 L_5; memset(&L_5, 0, sizeof(L_5)); Vector2__ctor_m1517109030(&L_5, (0.0f), (0.5f), /*hidden argument*/NULL); return L_5; } IL_0071: { Vector2_t4282066565 L_6; memset(&L_6, 0, sizeof(L_6)); Vector2__ctor_m1517109030(&L_6, (0.5f), (0.5f), /*hidden argument*/NULL); return L_6; } IL_0081: { Vector2_t4282066565 L_7; memset(&L_7, 0, sizeof(L_7)); Vector2__ctor_m1517109030(&L_7, (1.0f), (0.5f), /*hidden argument*/NULL); return L_7; } IL_0091: { Vector2_t4282066565 L_8; memset(&L_8, 0, sizeof(L_8)); Vector2__ctor_m1517109030(&L_8, (0.0f), (1.0f), /*hidden argument*/NULL); return L_8; } IL_00a1: { Vector2_t4282066565 L_9; memset(&L_9, 0, sizeof(L_9)); Vector2__ctor_m1517109030(&L_9, (0.5f), (1.0f), /*hidden argument*/NULL); return L_9; } IL_00b1: { Vector2_t4282066565 L_10; memset(&L_10, 0, sizeof(L_10)); Vector2__ctor_m1517109030(&L_10, (1.0f), (1.0f), /*hidden argument*/NULL); return L_10; } IL_00c1: { Vector2_t4282066565 L_11 = Vector2_get_zero_m199872368(NULL /*static, unused*/, /*hidden argument*/NULL); return L_11; } } // System.Void UnityEngine.UI.Text::OnPopulateMesh(UnityEngine.UI.VertexHelper) extern Il2CppClass* Text_t9039225_il2cpp_TypeInfo_var; extern Il2CppClass* Mathf_t4203372500_il2cpp_TypeInfo_var; extern Il2CppClass* ICollection_1_t843687903_il2cpp_TypeInfo_var; extern Il2CppClass* IList_1_t2643745119_il2cpp_TypeInfo_var; extern const uint32_t Text_OnPopulateMesh_m869628001_MetadataUsageId; extern "C" void Text_OnPopulateMesh_m869628001 (Text_t9039225 * __this, VertexHelper_t3377436606 * ___toFill0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Text_OnPopulateMesh_m869628001_MetadataUsageId); s_Il2CppMethodIntialized = true; } Vector2_t4282066565 V_0; memset(&V_0, 0, sizeof(V_0)); TextGenerationSettings_t1923005356 V_1; memset(&V_1, 0, sizeof(V_1)); Rect_t4241904616 V_2; memset(&V_2, 0, sizeof(V_2)); Vector2_t4282066565 V_3; memset(&V_3, 0, sizeof(V_3)); Vector2_t4282066565 V_4; memset(&V_4, 0, sizeof(V_4)); Vector2_t4282066565 V_5; memset(&V_5, 0, sizeof(V_5)); Il2CppObject* V_6 = NULL; float V_7 = 0.0f; int32_t V_8 = 0; int32_t V_9 = 0; int32_t V_10 = 0; int32_t V_11 = 0; int32_t V_12 = 0; Rect_t4241904616 V_13; memset(&V_13, 0, sizeof(V_13)); { Font_t4241557075 * L_0 = Text_get_font_m2437753165(__this, /*hidden argument*/NULL); bool L_1 = Object_op_Equality_m3964590952(NULL /*static, unused*/, L_0, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_1) { goto IL_0012; } } { return; } IL_0012: { __this->set_m_DisableFontTextureRebuiltCallback_33((bool)1); RectTransform_t972643934 * L_2 = Graphic_get_rectTransform_m4017371950(__this, /*hidden argument*/NULL); NullCheck(L_2); Rect_t4241904616 L_3 = RectTransform_get_rect_m1566017036(L_2, /*hidden argument*/NULL); V_13 = L_3; Vector2_t4282066565 L_4 = Rect_get_size_m136480416((&V_13), /*hidden argument*/NULL); V_0 = L_4; Vector2_t4282066565 L_5 = V_0; TextGenerationSettings_t1923005356 L_6 = Text_GetGenerationSettings_m554596117(__this, L_5, /*hidden argument*/NULL); V_1 = L_6; TextGenerator_t538854556 * L_7 = Text_get_cachedTextGenerator_m337653083(__this, /*hidden argument*/NULL); String_t* L_8 = VirtFuncInvoker0< String_t* >::Invoke(64 /* System.String UnityEngine.UI.Text::get_text() */, __this); TextGenerationSettings_t1923005356 L_9 = V_1; NullCheck(L_7); TextGenerator_Populate_m953583418(L_7, L_8, L_9, /*hidden argument*/NULL); RectTransform_t972643934 * L_10 = Graphic_get_rectTransform_m4017371950(__this, /*hidden argument*/NULL); NullCheck(L_10); Rect_t4241904616 L_11 = RectTransform_get_rect_m1566017036(L_10, /*hidden argument*/NULL); V_2 = L_11; FontData_t704020325 * L_12 = __this->get_m_FontData_28(); NullCheck(L_12); int32_t L_13 = FontData_get_alignment_m3864278344(L_12, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(Text_t9039225_il2cpp_TypeInfo_var); Vector2_t4282066565 L_14 = Text_GetTextAnchorPivot_m7192668(NULL /*static, unused*/, L_13, /*hidden argument*/NULL); V_3 = L_14; Vector2_t4282066565 L_15 = Vector2_get_zero_m199872368(NULL /*static, unused*/, /*hidden argument*/NULL); V_4 = L_15; float L_16 = Rect_get_xMin_m371109962((&V_2), /*hidden argument*/NULL); float L_17 = Rect_get_xMax_m370881244((&V_2), /*hidden argument*/NULL); float L_18 = (&V_3)->get_x_1(); IL2CPP_RUNTIME_CLASS_INIT(Mathf_t4203372500_il2cpp_TypeInfo_var); float L_19 = Mathf_Lerp_m3257777633(NULL /*static, unused*/, L_16, L_17, L_18, /*hidden argument*/NULL); (&V_4)->set_x_1(L_19); float L_20 = Rect_get_yMin_m399739113((&V_2), /*hidden argument*/NULL); float L_21 = Rect_get_yMax_m399510395((&V_2), /*hidden argument*/NULL); float L_22 = (&V_3)->get_y_2(); float L_23 = Mathf_Lerp_m3257777633(NULL /*static, unused*/, L_20, L_21, L_22, /*hidden argument*/NULL); (&V_4)->set_y_2(L_23); Vector2_t4282066565 L_24 = V_4; Vector2_t4282066565 L_25 = Graphic_PixelAdjustPoint_m440199187(__this, L_24, /*hidden argument*/NULL); Vector2_t4282066565 L_26 = V_4; Vector2_t4282066565 L_27 = Vector2_op_Subtraction_m2097149401(NULL /*static, unused*/, L_25, L_26, /*hidden argument*/NULL); V_5 = L_27; TextGenerator_t538854556 * L_28 = Text_get_cachedTextGenerator_m337653083(__this, /*hidden argument*/NULL); NullCheck(L_28); Il2CppObject* L_29 = TextGenerator_get_verts_m1179011229(L_28, /*hidden argument*/NULL); V_6 = L_29; float L_30 = Text_get_pixelsPerUnit_m4148756467(__this, /*hidden argument*/NULL); V_7 = ((float)((float)(1.0f)/(float)L_30)); Il2CppObject* L_31 = V_6; NullCheck(L_31); int32_t L_32 = InterfaceFuncInvoker0< int32_t >::Invoke(0 /* System.Int32 System.Collections.Generic.ICollection`1<UnityEngine.UIVertex>::get_Count() */, ICollection_1_t843687903_il2cpp_TypeInfo_var, L_31); V_8 = ((int32_t)((int32_t)L_32-(int32_t)4)); VertexHelper_t3377436606 * L_33 = ___toFill0; NullCheck(L_33); VertexHelper_Clear_m412394180(L_33, /*hidden argument*/NULL); Vector2_t4282066565 L_34 = V_5; Vector2_t4282066565 L_35 = Vector2_get_zero_m199872368(NULL /*static, unused*/, /*hidden argument*/NULL); bool L_36 = Vector2_op_Inequality_m1638984867(NULL /*static, unused*/, L_34, L_35, /*hidden argument*/NULL); if (!L_36) { goto IL_01b7; } } { V_9 = 0; goto IL_01a9; } IL_0105: { int32_t L_37 = V_9; V_10 = ((int32_t)((int32_t)L_37&(int32_t)3)); UIVertexU5BU5D_t1796391381* L_38 = __this->get_m_TempVerts_34(); int32_t L_39 = V_10; NullCheck(L_38); IL2CPP_ARRAY_BOUNDS_CHECK(L_38, L_39); Il2CppObject* L_40 = V_6; int32_t L_41 = V_9; NullCheck(L_40); UIVertex_t4244065212 L_42 = InterfaceFuncInvoker1< UIVertex_t4244065212 , int32_t >::Invoke(3 /* !0 System.Collections.Generic.IList`1<UnityEngine.UIVertex>::get_Item(System.Int32) */, IList_1_t2643745119_il2cpp_TypeInfo_var, L_40, L_41); (*(UIVertex_t4244065212 *)((L_38)->GetAddressAt(static_cast<il2cpp_array_size_t>(L_39)))) = L_42; UIVertexU5BU5D_t1796391381* L_43 = __this->get_m_TempVerts_34(); int32_t L_44 = V_10; NullCheck(L_43); IL2CPP_ARRAY_BOUNDS_CHECK(L_43, L_44); UIVertex_t4244065212 * L_45 = ((L_43)->GetAddressAt(static_cast<il2cpp_array_size_t>(L_44))); Vector3_t4282066566 L_46 = L_45->get_position_0(); float L_47 = V_7; Vector3_t4282066566 L_48 = Vector3_op_Multiply_m973638459(NULL /*static, unused*/, L_46, L_47, /*hidden argument*/NULL); L_45->set_position_0(L_48); UIVertexU5BU5D_t1796391381* L_49 = __this->get_m_TempVerts_34(); int32_t L_50 = V_10; NullCheck(L_49); IL2CPP_ARRAY_BOUNDS_CHECK(L_49, L_50); Vector3_t4282066566 * L_51 = ((L_49)->GetAddressAt(static_cast<il2cpp_array_size_t>(L_50)))->get_address_of_position_0(); Vector3_t4282066566 * L_52 = L_51; float L_53 = L_52->get_x_1(); float L_54 = (&V_5)->get_x_1(); L_52->set_x_1(((float)((float)L_53+(float)L_54))); UIVertexU5BU5D_t1796391381* L_55 = __this->get_m_TempVerts_34(); int32_t L_56 = V_10; NullCheck(L_55); IL2CPP_ARRAY_BOUNDS_CHECK(L_55, L_56); Vector3_t4282066566 * L_57 = ((L_55)->GetAddressAt(static_cast<il2cpp_array_size_t>(L_56)))->get_address_of_position_0(); Vector3_t4282066566 * L_58 = L_57; float L_59 = L_58->get_y_2(); float L_60 = (&V_5)->get_y_2(); L_58->set_y_2(((float)((float)L_59+(float)L_60))); int32_t L_61 = V_10; if ((!(((uint32_t)L_61) == ((uint32_t)3)))) { goto IL_01a3; } } { VertexHelper_t3377436606 * L_62 = ___toFill0; UIVertexU5BU5D_t1796391381* L_63 = __this->get_m_TempVerts_34(); NullCheck(L_62); VertexHelper_AddUIVertexQuad_m765809318(L_62, L_63, /*hidden argument*/NULL); } IL_01a3: { int32_t L_64 = V_9; V_9 = ((int32_t)((int32_t)L_64+(int32_t)1)); } IL_01a9: { int32_t L_65 = V_9; int32_t L_66 = V_8; if ((((int32_t)L_65) < ((int32_t)L_66))) { goto IL_0105; } } { goto IL_0222; } IL_01b7: { V_11 = 0; goto IL_0219; } IL_01bf: { int32_t L_67 = V_11; V_12 = ((int32_t)((int32_t)L_67&(int32_t)3)); UIVertexU5BU5D_t1796391381* L_68 = __this->get_m_TempVerts_34(); int32_t L_69 = V_12; NullCheck(L_68); IL2CPP_ARRAY_BOUNDS_CHECK(L_68, L_69); Il2CppObject* L_70 = V_6; int32_t L_71 = V_11; NullCheck(L_70); UIVertex_t4244065212 L_72 = InterfaceFuncInvoker1< UIVertex_t4244065212 , int32_t >::Invoke(3 /* !0 System.Collections.Generic.IList`1<UnityEngine.UIVertex>::get_Item(System.Int32) */, IList_1_t2643745119_il2cpp_TypeInfo_var, L_70, L_71); (*(UIVertex_t4244065212 *)((L_68)->GetAddressAt(static_cast<il2cpp_array_size_t>(L_69)))) = L_72; UIVertexU5BU5D_t1796391381* L_73 = __this->get_m_TempVerts_34(); int32_t L_74 = V_12; NullCheck(L_73); IL2CPP_ARRAY_BOUNDS_CHECK(L_73, L_74); UIVertex_t4244065212 * L_75 = ((L_73)->GetAddressAt(static_cast<il2cpp_array_size_t>(L_74))); Vector3_t4282066566 L_76 = L_75->get_position_0(); float L_77 = V_7; Vector3_t4282066566 L_78 = Vector3_op_Multiply_m973638459(NULL /*static, unused*/, L_76, L_77, /*hidden argument*/NULL); L_75->set_position_0(L_78); int32_t L_79 = V_12; if ((!(((uint32_t)L_79) == ((uint32_t)3)))) { goto IL_0213; } } { VertexHelper_t3377436606 * L_80 = ___toFill0; UIVertexU5BU5D_t1796391381* L_81 = __this->get_m_TempVerts_34(); NullCheck(L_80); VertexHelper_AddUIVertexQuad_m765809318(L_80, L_81, /*hidden argument*/NULL); } IL_0213: { int32_t L_82 = V_11; V_11 = ((int32_t)((int32_t)L_82+(int32_t)1)); } IL_0219: { int32_t L_83 = V_11; int32_t L_84 = V_8; if ((((int32_t)L_83) < ((int32_t)L_84))) { goto IL_01bf; } } IL_0222: { __this->set_m_DisableFontTextureRebuiltCallback_33((bool)0); return; } } // System.Void UnityEngine.UI.Text::CalculateLayoutInputHorizontal() extern "C" void Text_CalculateLayoutInputHorizontal_m2550743748 (Text_t9039225 * __this, const MethodInfo* method) { { return; } } // System.Void UnityEngine.UI.Text::CalculateLayoutInputVertical() extern "C" void Text_CalculateLayoutInputVertical_m4013862230 (Text_t9039225 * __this, const MethodInfo* method) { { return; } } // System.Single UnityEngine.UI.Text::get_minWidth() extern "C" float Text_get_minWidth_m1415472311 (Text_t9039225 * __this, const MethodInfo* method) { { return (0.0f); } } // System.Single UnityEngine.UI.Text::get_preferredWidth() extern "C" float Text_get_preferredWidth_m2672417320 (Text_t9039225 * __this, const MethodInfo* method) { TextGenerationSettings_t1923005356 V_0; memset(&V_0, 0, sizeof(V_0)); { Vector2_t4282066565 L_0 = Vector2_get_zero_m199872368(NULL /*static, unused*/, /*hidden argument*/NULL); TextGenerationSettings_t1923005356 L_1 = Text_GetGenerationSettings_m554596117(__this, L_0, /*hidden argument*/NULL); V_0 = L_1; TextGenerator_t538854556 * L_2 = Text_get_cachedTextGeneratorForLayout_m1260141146(__this, /*hidden argument*/NULL); String_t* L_3 = __this->get_m_Text_29(); TextGenerationSettings_t1923005356 L_4 = V_0; NullCheck(L_2); float L_5 = TextGenerator_GetPreferredWidth_m1618543389(L_2, L_3, L_4, /*hidden argument*/NULL); float L_6 = Text_get_pixelsPerUnit_m4148756467(__this, /*hidden argument*/NULL); return ((float)((float)L_5/(float)L_6)); } } // System.Single UnityEngine.UI.Text::get_flexibleWidth() extern "C" float Text_get_flexibleWidth_m3322158618 (Text_t9039225 * __this, const MethodInfo* method) { { return (-1.0f); } } // System.Single UnityEngine.UI.Text::get_minHeight() extern "C" float Text_get_minHeight_m1433783032 (Text_t9039225 * __this, const MethodInfo* method) { { return (0.0f); } } // System.Single UnityEngine.UI.Text::get_preferredHeight() extern "C" float Text_get_preferredHeight_m1744372647 (Text_t9039225 * __this, const MethodInfo* method) { TextGenerationSettings_t1923005356 V_0; memset(&V_0, 0, sizeof(V_0)); Rect_t4241904616 V_1; memset(&V_1, 0, sizeof(V_1)); Vector2_t4282066565 V_2; memset(&V_2, 0, sizeof(V_2)); { RectTransform_t972643934 * L_0 = Graphic_get_rectTransform_m4017371950(__this, /*hidden argument*/NULL); NullCheck(L_0); Rect_t4241904616 L_1 = RectTransform_get_rect_m1566017036(L_0, /*hidden argument*/NULL); V_1 = L_1; Vector2_t4282066565 L_2 = Rect_get_size_m136480416((&V_1), /*hidden argument*/NULL); V_2 = L_2; float L_3 = (&V_2)->get_x_1(); Vector2_t4282066565 L_4; memset(&L_4, 0, sizeof(L_4)); Vector2__ctor_m1517109030(&L_4, L_3, (0.0f), /*hidden argument*/NULL); TextGenerationSettings_t1923005356 L_5 = Text_GetGenerationSettings_m554596117(__this, L_4, /*hidden argument*/NULL); V_0 = L_5; TextGenerator_t538854556 * L_6 = Text_get_cachedTextGeneratorForLayout_m1260141146(__this, /*hidden argument*/NULL); String_t* L_7 = __this->get_m_Text_29(); TextGenerationSettings_t1923005356 L_8 = V_0; NullCheck(L_6); float L_9 = TextGenerator_GetPreferredHeight_m1770778044(L_6, L_7, L_8, /*hidden argument*/NULL); float L_10 = Text_get_pixelsPerUnit_m4148756467(__this, /*hidden argument*/NULL); return ((float)((float)L_9/(float)L_10)); } } // System.Single UnityEngine.UI.Text::get_flexibleHeight() extern "C" float Text_get_flexibleHeight_m411516405 (Text_t9039225 * __this, const MethodInfo* method) { { return (-1.0f); } } // System.Int32 UnityEngine.UI.Text::get_layoutPriority() extern "C" int32_t Text_get_layoutPriority_m4042521525 (Text_t9039225 * __this, const MethodInfo* method) { { return 0; } } // System.Void UnityEngine.UI.Toggle::.ctor() extern Il2CppClass* ToggleEvent_t2331340366_il2cpp_TypeInfo_var; extern Il2CppClass* Selectable_t1885181538_il2cpp_TypeInfo_var; extern const uint32_t Toggle__ctor_m4173251063_MetadataUsageId; extern "C" void Toggle__ctor_m4173251063 (Toggle_t110812896 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Toggle__ctor_m4173251063_MetadataUsageId); s_Il2CppMethodIntialized = true; } { __this->set_toggleTransition_16(1); ToggleEvent_t2331340366 * L_0 = (ToggleEvent_t2331340366 *)il2cpp_codegen_object_new(ToggleEvent_t2331340366_il2cpp_TypeInfo_var); ToggleEvent__ctor_m110328288(L_0, /*hidden argument*/NULL); __this->set_onValueChanged_19(L_0); IL2CPP_RUNTIME_CLASS_INIT(Selectable_t1885181538_il2cpp_TypeInfo_var); Selectable__ctor_m1133588277(__this, /*hidden argument*/NULL); return; } } // UnityEngine.UI.ToggleGroup UnityEngine.UI.Toggle::get_group() extern "C" ToggleGroup_t1990156785 * Toggle_get_group_m514230010 (Toggle_t110812896 * __this, const MethodInfo* method) { { ToggleGroup_t1990156785 * L_0 = __this->get_m_Group_18(); return L_0; } } // System.Void UnityEngine.UI.Toggle::set_group(UnityEngine.UI.ToggleGroup) extern "C" void Toggle_set_group_m4294827183 (Toggle_t110812896 * __this, ToggleGroup_t1990156785 * ___value0, const MethodInfo* method) { { ToggleGroup_t1990156785 * L_0 = ___value0; __this->set_m_Group_18(L_0); ToggleGroup_t1990156785 * L_1 = __this->get_m_Group_18(); Toggle_SetToggleGroup_m4196871663(__this, L_1, (bool)1, /*hidden argument*/NULL); Toggle_PlayEffect_m2897367561(__this, (bool)1, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.UI.Toggle::Rebuild(UnityEngine.UI.CanvasUpdate) extern "C" void Toggle_Rebuild_m1120034174 (Toggle_t110812896 * __this, int32_t ___executing0, const MethodInfo* method) { { return; } } // System.Void UnityEngine.UI.Toggle::LayoutComplete() extern "C" void Toggle_LayoutComplete_m3030592304 (Toggle_t110812896 * __this, const MethodInfo* method) { { return; } } // System.Void UnityEngine.UI.Toggle::GraphicUpdateComplete() extern "C" void Toggle_GraphicUpdateComplete_m1104468671 (Toggle_t110812896 * __this, const MethodInfo* method) { { return; } } // System.Void UnityEngine.UI.Toggle::OnEnable() extern "C" void Toggle_OnEnable_m975679023 (Toggle_t110812896 * __this, const MethodInfo* method) { { Selectable_OnEnable_m1472090161(__this, /*hidden argument*/NULL); ToggleGroup_t1990156785 * L_0 = __this->get_m_Group_18(); Toggle_SetToggleGroup_m4196871663(__this, L_0, (bool)0, /*hidden argument*/NULL); Toggle_PlayEffect_m2897367561(__this, (bool)1, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.UI.Toggle::OnDisable() extern "C" void Toggle_OnDisable_m622215902 (Toggle_t110812896 * __this, const MethodInfo* method) { { Toggle_SetToggleGroup_m4196871663(__this, (ToggleGroup_t1990156785 *)NULL, (bool)0, /*hidden argument*/NULL); Selectable_OnDisable_m3126059292(__this, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.UI.Toggle::OnDidApplyAnimationProperties() extern Il2CppClass* Mathf_t4203372500_il2cpp_TypeInfo_var; extern const uint32_t Toggle_OnDidApplyAnimationProperties_m3936866462_MetadataUsageId; extern "C" void Toggle_OnDidApplyAnimationProperties_m3936866462 (Toggle_t110812896 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Toggle_OnDidApplyAnimationProperties_m3936866462_MetadataUsageId); s_Il2CppMethodIntialized = true; } bool V_0 = false; Color_t4194546905 V_1; memset(&V_1, 0, sizeof(V_1)); { Graphic_t836799438 * L_0 = __this->get_graphic_17(); bool L_1 = Object_op_Inequality_m1296218211(NULL /*static, unused*/, L_0, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_1) { goto IL_0054; } } { Graphic_t836799438 * L_2 = __this->get_graphic_17(); NullCheck(L_2); CanvasRenderer_t3950887807 * L_3 = Graphic_get_canvasRenderer_m184553434(L_2, /*hidden argument*/NULL); NullCheck(L_3); Color_t4194546905 L_4 = CanvasRenderer_GetColor_m3075393702(L_3, /*hidden argument*/NULL); V_1 = L_4; float L_5 = (&V_1)->get_a_3(); IL2CPP_RUNTIME_CLASS_INIT(Mathf_t4203372500_il2cpp_TypeInfo_var); bool L_6 = Mathf_Approximately_m1395529776(NULL /*static, unused*/, L_5, (0.0f), /*hidden argument*/NULL); V_0 = (bool)((((int32_t)L_6) == ((int32_t)0))? 1 : 0); bool L_7 = __this->get_m_IsOn_20(); bool L_8 = V_0; if ((((int32_t)L_7) == ((int32_t)L_8))) { goto IL_0054; } } { bool L_9 = V_0; __this->set_m_IsOn_20(L_9); bool L_10 = V_0; Toggle_Set_m1284620590(__this, (bool)((((int32_t)L_10) == ((int32_t)0))? 1 : 0), /*hidden argument*/NULL); } IL_0054: { Selectable_OnDidApplyAnimationProperties_m4092978140(__this, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.UI.Toggle::SetToggleGroup(UnityEngine.UI.ToggleGroup,System.Boolean) extern "C" void Toggle_SetToggleGroup_m4196871663 (Toggle_t110812896 * __this, ToggleGroup_t1990156785 * ___newGroup0, bool ___setMemberValue1, const MethodInfo* method) { ToggleGroup_t1990156785 * V_0 = NULL; { ToggleGroup_t1990156785 * L_0 = __this->get_m_Group_18(); V_0 = L_0; ToggleGroup_t1990156785 * L_1 = __this->get_m_Group_18(); bool L_2 = Object_op_Inequality_m1296218211(NULL /*static, unused*/, L_1, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_2) { goto IL_0024; } } { ToggleGroup_t1990156785 * L_3 = __this->get_m_Group_18(); NullCheck(L_3); ToggleGroup_UnregisterToggle_m451307479(L_3, __this, /*hidden argument*/NULL); } IL_0024: { bool L_4 = ___setMemberValue1; if (!L_4) { goto IL_0031; } } { ToggleGroup_t1990156785 * L_5 = ___newGroup0; __this->set_m_Group_18(L_5); } IL_0031: { ToggleGroup_t1990156785 * L_6 = __this->get_m_Group_18(); bool L_7 = Object_op_Inequality_m1296218211(NULL /*static, unused*/, L_6, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_7) { goto IL_0059; } } { bool L_8 = VirtFuncInvoker0< bool >::Invoke(9 /* System.Boolean UnityEngine.EventSystems.UIBehaviour::IsActive() */, __this); if (!L_8) { goto IL_0059; } } { ToggleGroup_t1990156785 * L_9 = __this->get_m_Group_18(); NullCheck(L_9); ToggleGroup_RegisterToggle_m2622505488(L_9, __this, /*hidden argument*/NULL); } IL_0059: { ToggleGroup_t1990156785 * L_10 = ___newGroup0; bool L_11 = Object_op_Inequality_m1296218211(NULL /*static, unused*/, L_10, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_11) { goto IL_0093; } } { ToggleGroup_t1990156785 * L_12 = ___newGroup0; ToggleGroup_t1990156785 * L_13 = V_0; bool L_14 = Object_op_Inequality_m1296218211(NULL /*static, unused*/, L_12, L_13, /*hidden argument*/NULL); if (!L_14) { goto IL_0093; } } { bool L_15 = Toggle_get_isOn_m2105608497(__this, /*hidden argument*/NULL); if (!L_15) { goto IL_0093; } } { bool L_16 = VirtFuncInvoker0< bool >::Invoke(9 /* System.Boolean UnityEngine.EventSystems.UIBehaviour::IsActive() */, __this); if (!L_16) { goto IL_0093; } } { ToggleGroup_t1990156785 * L_17 = __this->get_m_Group_18(); NullCheck(L_17); ToggleGroup_NotifyToggleOn_m2022309259(L_17, __this, /*hidden argument*/NULL); } IL_0093: { return; } } // System.Boolean UnityEngine.UI.Toggle::get_isOn() extern "C" bool Toggle_get_isOn_m2105608497 (Toggle_t110812896 * __this, const MethodInfo* method) { { bool L_0 = __this->get_m_IsOn_20(); return L_0; } } // System.Void UnityEngine.UI.Toggle::set_isOn(System.Boolean) extern "C" void Toggle_set_isOn_m3467664234 (Toggle_t110812896 * __this, bool ___value0, const MethodInfo* method) { { bool L_0 = ___value0; Toggle_Set_m1284620590(__this, L_0, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.UI.Toggle::Set(System.Boolean) extern "C" void Toggle_Set_m1284620590 (Toggle_t110812896 * __this, bool ___value0, const MethodInfo* method) { { bool L_0 = ___value0; Toggle_Set_m1795838095(__this, L_0, (bool)1, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.UI.Toggle::Set(System.Boolean,System.Boolean) extern const MethodInfo* UnityEvent_1_Invoke_m4200629676_MethodInfo_var; extern const uint32_t Toggle_Set_m1795838095_MetadataUsageId; extern "C" void Toggle_Set_m1795838095 (Toggle_t110812896 * __this, bool ___value0, bool ___sendCallback1, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Toggle_Set_m1795838095_MetadataUsageId); s_Il2CppMethodIntialized = true; } { bool L_0 = __this->get_m_IsOn_20(); bool L_1 = ___value0; if ((!(((uint32_t)L_0) == ((uint32_t)L_1)))) { goto IL_000d; } } { return; } IL_000d: { bool L_2 = ___value0; __this->set_m_IsOn_20(L_2); ToggleGroup_t1990156785 * L_3 = __this->get_m_Group_18(); bool L_4 = Object_op_Inequality_m1296218211(NULL /*static, unused*/, L_3, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_4) { goto IL_006e; } } { bool L_5 = VirtFuncInvoker0< bool >::Invoke(9 /* System.Boolean UnityEngine.EventSystems.UIBehaviour::IsActive() */, __this); if (!L_5) { goto IL_006e; } } { bool L_6 = __this->get_m_IsOn_20(); if (L_6) { goto IL_005b; } } { ToggleGroup_t1990156785 * L_7 = __this->get_m_Group_18(); NullCheck(L_7); bool L_8 = ToggleGroup_AnyTogglesOn_m401060308(L_7, /*hidden argument*/NULL); if (L_8) { goto IL_006e; } } { ToggleGroup_t1990156785 * L_9 = __this->get_m_Group_18(); NullCheck(L_9); bool L_10 = ToggleGroup_get_allowSwitchOff_m1895769533(L_9, /*hidden argument*/NULL); if (L_10) { goto IL_006e; } } IL_005b: { __this->set_m_IsOn_20((bool)1); ToggleGroup_t1990156785 * L_11 = __this->get_m_Group_18(); NullCheck(L_11); ToggleGroup_NotifyToggleOn_m2022309259(L_11, __this, /*hidden argument*/NULL); } IL_006e: { int32_t L_12 = __this->get_toggleTransition_16(); Toggle_PlayEffect_m2897367561(__this, (bool)((((int32_t)L_12) == ((int32_t)0))? 1 : 0), /*hidden argument*/NULL); bool L_13 = ___sendCallback1; if (!L_13) { goto IL_0094; } } { ToggleEvent_t2331340366 * L_14 = __this->get_onValueChanged_19(); bool L_15 = __this->get_m_IsOn_20(); NullCheck(L_14); UnityEvent_1_Invoke_m4200629676(L_14, L_15, /*hidden argument*/UnityEvent_1_Invoke_m4200629676_MethodInfo_var); } IL_0094: { return; } } // System.Void UnityEngine.UI.Toggle::PlayEffect(System.Boolean) extern "C" void Toggle_PlayEffect_m2897367561 (Toggle_t110812896 * __this, bool ___instant0, const MethodInfo* method) { Graphic_t836799438 * G_B4_0 = NULL; Graphic_t836799438 * G_B3_0 = NULL; float G_B5_0 = 0.0f; Graphic_t836799438 * G_B5_1 = NULL; float G_B7_0 = 0.0f; Graphic_t836799438 * G_B7_1 = NULL; float G_B6_0 = 0.0f; Graphic_t836799438 * G_B6_1 = NULL; float G_B8_0 = 0.0f; float G_B8_1 = 0.0f; Graphic_t836799438 * G_B8_2 = NULL; { Graphic_t836799438 * L_0 = __this->get_graphic_17(); bool L_1 = Object_op_Equality_m3964590952(NULL /*static, unused*/, L_0, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (!L_1) { goto IL_0012; } } { return; } IL_0012: { Graphic_t836799438 * L_2 = __this->get_graphic_17(); bool L_3 = __this->get_m_IsOn_20(); G_B3_0 = L_2; if (!L_3) { G_B4_0 = L_2; goto IL_002d; } } { G_B5_0 = (1.0f); G_B5_1 = G_B3_0; goto IL_0032; } IL_002d: { G_B5_0 = (0.0f); G_B5_1 = G_B4_0; } IL_0032: { bool L_4 = ___instant0; G_B6_0 = G_B5_0; G_B6_1 = G_B5_1; if (!L_4) { G_B7_0 = G_B5_0; G_B7_1 = G_B5_1; goto IL_0042; } } { G_B8_0 = (0.0f); G_B8_1 = G_B6_0; G_B8_2 = G_B6_1; goto IL_0047; } IL_0042: { G_B8_0 = (0.1f); G_B8_1 = G_B7_0; G_B8_2 = G_B7_1; } IL_0047: { NullCheck(G_B8_2); Graphic_CrossFadeAlpha_m157692256(G_B8_2, G_B8_1, G_B8_0, (bool)1, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.UI.Toggle::Start() extern "C" void Toggle_Start_m3120388855 (Toggle_t110812896 * __this, const MethodInfo* method) { { Toggle_PlayEffect_m2897367561(__this, (bool)1, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.UI.Toggle::InternalToggle() extern "C" void Toggle_InternalToggle_m3534245278 (Toggle_t110812896 * __this, const MethodInfo* method) { { bool L_0 = VirtFuncInvoker0< bool >::Invoke(9 /* System.Boolean UnityEngine.EventSystems.UIBehaviour::IsActive() */, __this); if (!L_0) { goto IL_0016; } } { bool L_1 = VirtFuncInvoker0< bool >::Invoke(23 /* System.Boolean UnityEngine.UI.Selectable::IsInteractable() */, __this); if (L_1) { goto IL_0017; } } IL_0016: { return; } IL_0017: { bool L_2 = Toggle_get_isOn_m2105608497(__this, /*hidden argument*/NULL); Toggle_set_isOn_m3467664234(__this, (bool)((((int32_t)L_2) == ((int32_t)0))? 1 : 0), /*hidden argument*/NULL); return; } } // System.Void UnityEngine.UI.Toggle::OnPointerClick(UnityEngine.EventSystems.PointerEventData) extern "C" void Toggle_OnPointerClick_m3273211815 (Toggle_t110812896 * __this, PointerEventData_t1848751023 * ___eventData0, const MethodInfo* method) { { PointerEventData_t1848751023 * L_0 = ___eventData0; NullCheck(L_0); int32_t L_1 = PointerEventData_get_button_m796143251(L_0, /*hidden argument*/NULL); if (!L_1) { goto IL_000c; } } { return; } IL_000c: { Toggle_InternalToggle_m3534245278(__this, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.UI.Toggle::OnSubmit(UnityEngine.EventSystems.BaseEventData) extern "C" void Toggle_OnSubmit_m2658606814 (Toggle_t110812896 * __this, BaseEventData_t2054899105 * ___eventData0, const MethodInfo* method) { { Toggle_InternalToggle_m3534245278(__this, /*hidden argument*/NULL); return; } } // System.Boolean UnityEngine.UI.Toggle::UnityEngine.UI.ICanvasElement.IsDestroyed() extern "C" bool Toggle_UnityEngine_UI_ICanvasElement_IsDestroyed_m3606481250 (Toggle_t110812896 * __this, const MethodInfo* method) { { bool L_0 = UIBehaviour_IsDestroyed_m3027499227(__this, /*hidden argument*/NULL); return L_0; } } // UnityEngine.Transform UnityEngine.UI.Toggle::UnityEngine.UI.ICanvasElement.get_transform() extern "C" Transform_t1659122786 * Toggle_UnityEngine_UI_ICanvasElement_get_transform_m4001149958 (Toggle_t110812896 * __this, const MethodInfo* method) { { Transform_t1659122786 * L_0 = Component_get_transform_m4257140443(__this, /*hidden argument*/NULL); return L_0; } } // System.Void UnityEngine.UI.Toggle/ToggleEvent::.ctor() extern const MethodInfo* UnityEvent_1__ctor_m1579102881_MethodInfo_var; extern const uint32_t ToggleEvent__ctor_m110328288_MetadataUsageId; extern "C" void ToggleEvent__ctor_m110328288 (ToggleEvent_t2331340366 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (ToggleEvent__ctor_m110328288_MetadataUsageId); s_Il2CppMethodIntialized = true; } { UnityEvent_1__ctor_m1579102881(__this, /*hidden argument*/UnityEvent_1__ctor_m1579102881_MethodInfo_var); return; } } // System.Void UnityEngine.UI.ToggleGroup::.ctor() extern Il2CppClass* List_1_t1478998448_il2cpp_TypeInfo_var; extern const MethodInfo* List_1__ctor_m2087916499_MethodInfo_var; extern const uint32_t ToggleGroup__ctor_m1179503632_MetadataUsageId; extern "C" void ToggleGroup__ctor_m1179503632 (ToggleGroup_t1990156785 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (ToggleGroup__ctor_m1179503632_MetadataUsageId); s_Il2CppMethodIntialized = true; } { List_1_t1478998448 * L_0 = (List_1_t1478998448 *)il2cpp_codegen_object_new(List_1_t1478998448_il2cpp_TypeInfo_var); List_1__ctor_m2087916499(L_0, /*hidden argument*/List_1__ctor_m2087916499_MethodInfo_var); __this->set_m_Toggles_3(L_0); UIBehaviour__ctor_m1261553468(__this, /*hidden argument*/NULL); return; } } // System.Boolean UnityEngine.UI.ToggleGroup::get_allowSwitchOff() extern "C" bool ToggleGroup_get_allowSwitchOff_m1895769533 (ToggleGroup_t1990156785 * __this, const MethodInfo* method) { { bool L_0 = __this->get_m_AllowSwitchOff_2(); return L_0; } } // System.Void UnityEngine.UI.ToggleGroup::set_allowSwitchOff(System.Boolean) extern "C" void ToggleGroup_set_allowSwitchOff_m2429094938 (ToggleGroup_t1990156785 * __this, bool ___value0, const MethodInfo* method) { { bool L_0 = ___value0; __this->set_m_AllowSwitchOff_2(L_0); return; } } // System.Void UnityEngine.UI.ToggleGroup::ValidateToggleIsInGroup(UnityEngine.UI.Toggle) extern Il2CppClass* ObjectU5BU5D_t1108656482_il2cpp_TypeInfo_var; extern Il2CppClass* String_t_il2cpp_TypeInfo_var; extern Il2CppClass* ArgumentException_t928607144_il2cpp_TypeInfo_var; extern const MethodInfo* List_1_Contains_m3844179247_MethodInfo_var; extern Il2CppCodeGenString* _stringLiteral3714673143; extern const uint32_t ToggleGroup_ValidateToggleIsInGroup_m1953593831_MetadataUsageId; extern "C" void ToggleGroup_ValidateToggleIsInGroup_m1953593831 (ToggleGroup_t1990156785 * __this, Toggle_t110812896 * ___toggle0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (ToggleGroup_ValidateToggleIsInGroup_m1953593831_MetadataUsageId); s_Il2CppMethodIntialized = true; } { Toggle_t110812896 * L_0 = ___toggle0; bool L_1 = Object_op_Equality_m3964590952(NULL /*static, unused*/, L_0, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); if (L_1) { goto IL_001d; } } { List_1_t1478998448 * L_2 = __this->get_m_Toggles_3(); Toggle_t110812896 * L_3 = ___toggle0; NullCheck(L_2); bool L_4 = List_1_Contains_m3844179247(L_2, L_3, /*hidden argument*/List_1_Contains_m3844179247_MethodInfo_var); if (L_4) { goto IL_003b; } } IL_001d: { ObjectU5BU5D_t1108656482* L_5 = ((ObjectU5BU5D_t1108656482*)SZArrayNew(ObjectU5BU5D_t1108656482_il2cpp_TypeInfo_var, (uint32_t)2)); Toggle_t110812896 * L_6 = ___toggle0; NullCheck(L_5); IL2CPP_ARRAY_BOUNDS_CHECK(L_5, 0); ArrayElementTypeCheck (L_5, L_6); (L_5)->SetAt(static_cast<il2cpp_array_size_t>(0), (Il2CppObject *)L_6); ObjectU5BU5D_t1108656482* L_7 = L_5; NullCheck(L_7); IL2CPP_ARRAY_BOUNDS_CHECK(L_7, 1); ArrayElementTypeCheck (L_7, __this); (L_7)->SetAt(static_cast<il2cpp_array_size_t>(1), (Il2CppObject *)__this); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); String_t* L_8 = String_Format_m4050103162(NULL /*static, unused*/, _stringLiteral3714673143, L_7, /*hidden argument*/NULL); ArgumentException_t928607144 * L_9 = (ArgumentException_t928607144 *)il2cpp_codegen_object_new(ArgumentException_t928607144_il2cpp_TypeInfo_var); ArgumentException__ctor_m3544856547(L_9, L_8, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_9); } IL_003b: { return; } } // System.Void UnityEngine.UI.ToggleGroup::NotifyToggleOn(UnityEngine.UI.Toggle) extern const MethodInfo* List_1_get_Item_m1276017030_MethodInfo_var; extern const MethodInfo* List_1_get_Count_m1282784879_MethodInfo_var; extern const uint32_t ToggleGroup_NotifyToggleOn_m2022309259_MetadataUsageId; extern "C" void ToggleGroup_NotifyToggleOn_m2022309259 (ToggleGroup_t1990156785 * __this, Toggle_t110812896 * ___toggle0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (ToggleGroup_NotifyToggleOn_m2022309259_MetadataUsageId); s_Il2CppMethodIntialized = true; } int32_t V_0 = 0; { Toggle_t110812896 * L_0 = ___toggle0; ToggleGroup_ValidateToggleIsInGroup_m1953593831(__this, L_0, /*hidden argument*/NULL); V_0 = 0; goto IL_0040; } IL_000e: { List_1_t1478998448 * L_1 = __this->get_m_Toggles_3(); int32_t L_2 = V_0; NullCheck(L_1); Toggle_t110812896 * L_3 = List_1_get_Item_m1276017030(L_1, L_2, /*hidden argument*/List_1_get_Item_m1276017030_MethodInfo_var); Toggle_t110812896 * L_4 = ___toggle0; bool L_5 = Object_op_Equality_m3964590952(NULL /*static, unused*/, L_3, L_4, /*hidden argument*/NULL); if (!L_5) { goto IL_002a; } } { goto IL_003c; } IL_002a: { List_1_t1478998448 * L_6 = __this->get_m_Toggles_3(); int32_t L_7 = V_0; NullCheck(L_6); Toggle_t110812896 * L_8 = List_1_get_Item_m1276017030(L_6, L_7, /*hidden argument*/List_1_get_Item_m1276017030_MethodInfo_var); NullCheck(L_8); Toggle_set_isOn_m3467664234(L_8, (bool)0, /*hidden argument*/NULL); } IL_003c: { int32_t L_9 = V_0; V_0 = ((int32_t)((int32_t)L_9+(int32_t)1)); } IL_0040: { int32_t L_10 = V_0; List_1_t1478998448 * L_11 = __this->get_m_Toggles_3(); NullCheck(L_11); int32_t L_12 = List_1_get_Count_m1282784879(L_11, /*hidden argument*/List_1_get_Count_m1282784879_MethodInfo_var); if ((((int32_t)L_10) < ((int32_t)L_12))) { goto IL_000e; } } { return; } } // System.Void UnityEngine.UI.ToggleGroup::UnregisterToggle(UnityEngine.UI.Toggle) extern const MethodInfo* List_1_Contains_m3844179247_MethodInfo_var; extern const MethodInfo* List_1_Remove_m3212913812_MethodInfo_var; extern const uint32_t ToggleGroup_UnregisterToggle_m451307479_MetadataUsageId; extern "C" void ToggleGroup_UnregisterToggle_m451307479 (ToggleGroup_t1990156785 * __this, Toggle_t110812896 * ___toggle0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (ToggleGroup_UnregisterToggle_m451307479_MetadataUsageId); s_Il2CppMethodIntialized = true; } { List_1_t1478998448 * L_0 = __this->get_m_Toggles_3(); Toggle_t110812896 * L_1 = ___toggle0; NullCheck(L_0); bool L_2 = List_1_Contains_m3844179247(L_0, L_1, /*hidden argument*/List_1_Contains_m3844179247_MethodInfo_var); if (!L_2) { goto IL_001e; } } { List_1_t1478998448 * L_3 = __this->get_m_Toggles_3(); Toggle_t110812896 * L_4 = ___toggle0; NullCheck(L_3); List_1_Remove_m3212913812(L_3, L_4, /*hidden argument*/List_1_Remove_m3212913812_MethodInfo_var); } IL_001e: { return; } } // System.Void UnityEngine.UI.ToggleGroup::RegisterToggle(UnityEngine.UI.Toggle) extern const MethodInfo* List_1_Contains_m3844179247_MethodInfo_var; extern const MethodInfo* List_1_Add_m1782277315_MethodInfo_var; extern const uint32_t ToggleGroup_RegisterToggle_m2622505488_MetadataUsageId; extern "C" void ToggleGroup_RegisterToggle_m2622505488 (ToggleGroup_t1990156785 * __this, Toggle_t110812896 * ___toggle0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (ToggleGroup_RegisterToggle_m2622505488_MetadataUsageId); s_Il2CppMethodIntialized = true; } { List_1_t1478998448 * L_0 = __this->get_m_Toggles_3(); Toggle_t110812896 * L_1 = ___toggle0; NullCheck(L_0); bool L_2 = List_1_Contains_m3844179247(L_0, L_1, /*hidden argument*/List_1_Contains_m3844179247_MethodInfo_var); if (L_2) { goto IL_001d; } } { List_1_t1478998448 * L_3 = __this->get_m_Toggles_3(); Toggle_t110812896 * L_4 = ___toggle0; NullCheck(L_3); List_1_Add_m1782277315(L_3, L_4, /*hidden argument*/List_1_Add_m1782277315_MethodInfo_var); } IL_001d: { return; } } // System.Boolean UnityEngine.UI.ToggleGroup::AnyTogglesOn() extern Il2CppClass* ToggleGroup_t1990156785_il2cpp_TypeInfo_var; extern Il2CppClass* Predicate_1_t4016837075_il2cpp_TypeInfo_var; extern const MethodInfo* ToggleGroup_U3CAnyTogglesOnU3Em__4_m3428369122_MethodInfo_var; extern const MethodInfo* Predicate_1__ctor_m1841483214_MethodInfo_var; extern const MethodInfo* List_1_Find_m168248406_MethodInfo_var; extern const uint32_t ToggleGroup_AnyTogglesOn_m401060308_MetadataUsageId; extern "C" bool ToggleGroup_AnyTogglesOn_m401060308 (ToggleGroup_t1990156785 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (ToggleGroup_AnyTogglesOn_m401060308_MetadataUsageId); s_Il2CppMethodIntialized = true; } List_1_t1478998448 * G_B2_0 = NULL; List_1_t1478998448 * G_B1_0 = NULL; { List_1_t1478998448 * L_0 = __this->get_m_Toggles_3(); Predicate_1_t4016837075 * L_1 = ((ToggleGroup_t1990156785_StaticFields*)ToggleGroup_t1990156785_il2cpp_TypeInfo_var->static_fields)->get_U3CU3Ef__amU24cache2_4(); G_B1_0 = L_0; if (L_1) { G_B2_0 = L_0; goto IL_001e; } } { IntPtr_t L_2; L_2.set_m_value_0((void*)(void*)ToggleGroup_U3CAnyTogglesOnU3Em__4_m3428369122_MethodInfo_var); Predicate_1_t4016837075 * L_3 = (Predicate_1_t4016837075 *)il2cpp_codegen_object_new(Predicate_1_t4016837075_il2cpp_TypeInfo_var); Predicate_1__ctor_m1841483214(L_3, NULL, L_2, /*hidden argument*/Predicate_1__ctor_m1841483214_MethodInfo_var); ((ToggleGroup_t1990156785_StaticFields*)ToggleGroup_t1990156785_il2cpp_TypeInfo_var->static_fields)->set_U3CU3Ef__amU24cache2_4(L_3); G_B2_0 = G_B1_0; } IL_001e: { Predicate_1_t4016837075 * L_4 = ((ToggleGroup_t1990156785_StaticFields*)ToggleGroup_t1990156785_il2cpp_TypeInfo_var->static_fields)->get_U3CU3Ef__amU24cache2_4(); NullCheck(G_B2_0); Toggle_t110812896 * L_5 = List_1_Find_m168248406(G_B2_0, L_4, /*hidden argument*/List_1_Find_m168248406_MethodInfo_var); bool L_6 = Object_op_Inequality_m1296218211(NULL /*static, unused*/, L_5, (Object_t3071478659 *)NULL, /*hidden argument*/NULL); return L_6; } } // System.Collections.Generic.IEnumerable`1<UnityEngine.UI.Toggle> UnityEngine.UI.ToggleGroup::ActiveToggles() extern Il2CppClass* ToggleGroup_t1990156785_il2cpp_TypeInfo_var; extern Il2CppClass* Func_2_t3137578243_il2cpp_TypeInfo_var; extern const MethodInfo* ToggleGroup_U3CActiveTogglesU3Em__5_m3656404306_MethodInfo_var; extern const MethodInfo* Func_2__ctor_m140354061_MethodInfo_var; extern const MethodInfo* Enumerable_Where_TisToggle_t110812896_m1098047866_MethodInfo_var; extern const uint32_t ToggleGroup_ActiveToggles_m1762871396_MetadataUsageId; extern "C" Il2CppObject* ToggleGroup_ActiveToggles_m1762871396 (ToggleGroup_t1990156785 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (ToggleGroup_ActiveToggles_m1762871396_MetadataUsageId); s_Il2CppMethodIntialized = true; } List_1_t1478998448 * G_B2_0 = NULL; List_1_t1478998448 * G_B1_0 = NULL; { List_1_t1478998448 * L_0 = __this->get_m_Toggles_3(); Func_2_t3137578243 * L_1 = ((ToggleGroup_t1990156785_StaticFields*)ToggleGroup_t1990156785_il2cpp_TypeInfo_var->static_fields)->get_U3CU3Ef__amU24cache3_5(); G_B1_0 = L_0; if (L_1) { G_B2_0 = L_0; goto IL_001e; } } { IntPtr_t L_2; L_2.set_m_value_0((void*)(void*)ToggleGroup_U3CActiveTogglesU3Em__5_m3656404306_MethodInfo_var); Func_2_t3137578243 * L_3 = (Func_2_t3137578243 *)il2cpp_codegen_object_new(Func_2_t3137578243_il2cpp_TypeInfo_var); Func_2__ctor_m140354061(L_3, NULL, L_2, /*hidden argument*/Func_2__ctor_m140354061_MethodInfo_var); ((ToggleGroup_t1990156785_StaticFields*)ToggleGroup_t1990156785_il2cpp_TypeInfo_var->static_fields)->set_U3CU3Ef__amU24cache3_5(L_3); G_B2_0 = G_B1_0; } IL_001e: { Func_2_t3137578243 * L_4 = ((ToggleGroup_t1990156785_StaticFields*)ToggleGroup_t1990156785_il2cpp_TypeInfo_var->static_fields)->get_U3CU3Ef__amU24cache3_5(); Il2CppObject* L_5 = Enumerable_Where_TisToggle_t110812896_m1098047866(NULL /*static, unused*/, G_B2_0, L_4, /*hidden argument*/Enumerable_Where_TisToggle_t110812896_m1098047866_MethodInfo_var); return L_5; } } // System.Void UnityEngine.UI.ToggleGroup::SetAllTogglesOff() extern const MethodInfo* List_1_get_Item_m1276017030_MethodInfo_var; extern const MethodInfo* List_1_get_Count_m1282784879_MethodInfo_var; extern const uint32_t ToggleGroup_SetAllTogglesOff_m4240216963_MetadataUsageId; extern "C" void ToggleGroup_SetAllTogglesOff_m4240216963 (ToggleGroup_t1990156785 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (ToggleGroup_SetAllTogglesOff_m4240216963_MetadataUsageId); s_Il2CppMethodIntialized = true; } bool V_0 = false; int32_t V_1 = 0; { bool L_0 = __this->get_m_AllowSwitchOff_2(); V_0 = L_0; __this->set_m_AllowSwitchOff_2((bool)1); V_1 = 0; goto IL_002b; } IL_0015: { List_1_t1478998448 * L_1 = __this->get_m_Toggles_3(); int32_t L_2 = V_1; NullCheck(L_1); Toggle_t110812896 * L_3 = List_1_get_Item_m1276017030(L_1, L_2, /*hidden argument*/List_1_get_Item_m1276017030_MethodInfo_var); NullCheck(L_3); Toggle_set_isOn_m3467664234(L_3, (bool)0, /*hidden argument*/NULL); int32_t L_4 = V_1; V_1 = ((int32_t)((int32_t)L_4+(int32_t)1)); } IL_002b: { int32_t L_5 = V_1; List_1_t1478998448 * L_6 = __this->get_m_Toggles_3(); NullCheck(L_6); int32_t L_7 = List_1_get_Count_m1282784879(L_6, /*hidden argument*/List_1_get_Count_m1282784879_MethodInfo_var); if ((((int32_t)L_5) < ((int32_t)L_7))) { goto IL_0015; } } { bool L_8 = V_0; __this->set_m_AllowSwitchOff_2(L_8); return; } } // System.Boolean UnityEngine.UI.ToggleGroup::<AnyTogglesOn>m__4(UnityEngine.UI.Toggle) extern "C" bool ToggleGroup_U3CAnyTogglesOnU3Em__4_m3428369122 (Il2CppObject * __this /* static, unused */, Toggle_t110812896 * ___x0, const MethodInfo* method) { { Toggle_t110812896 * L_0 = ___x0; NullCheck(L_0); bool L_1 = Toggle_get_isOn_m2105608497(L_0, /*hidden argument*/NULL); return L_1; } } // System.Boolean UnityEngine.UI.ToggleGroup::<ActiveToggles>m__5(UnityEngine.UI.Toggle) extern "C" bool ToggleGroup_U3CActiveTogglesU3Em__5_m3656404306 (Il2CppObject * __this /* static, unused */, Toggle_t110812896 * ___x0, const MethodInfo* method) { { Toggle_t110812896 * L_0 = ___x0; NullCheck(L_0); bool L_1 = Toggle_get_isOn_m2105608497(L_0, /*hidden argument*/NULL); return L_1; } } // System.Void UnityEngine.UI.VertexHelper::.ctor() extern Il2CppClass* ListPool_1_t3379703850_il2cpp_TypeInfo_var; extern Il2CppClass* ListPool_1_t3991458268_il2cpp_TypeInfo_var; extern Il2CppClass* ListPool_1_t3379703849_il2cpp_TypeInfo_var; extern Il2CppClass* ListPool_1_t3379703851_il2cpp_TypeInfo_var; extern Il2CppClass* ListPool_1_t251475784_il2cpp_TypeInfo_var; extern const MethodInfo* ListPool_1_Get_m4266661578_MethodInfo_var; extern const MethodInfo* ListPool_1_Get_m1848305276_MethodInfo_var; extern const MethodInfo* ListPool_1_Get_m1779148745_MethodInfo_var; extern const MethodInfo* ListPool_1_Get_m2459207115_MethodInfo_var; extern const MethodInfo* ListPool_1_Get_m1671355248_MethodInfo_var; extern const uint32_t VertexHelper__ctor_m3006260889_MetadataUsageId; extern "C" void VertexHelper__ctor_m3006260889 (VertexHelper_t3377436606 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (VertexHelper__ctor_m3006260889_MetadataUsageId); s_Il2CppMethodIntialized = true; } { IL2CPP_RUNTIME_CLASS_INIT(ListPool_1_t3379703850_il2cpp_TypeInfo_var); List_1_t1355284822 * L_0 = ListPool_1_Get_m4266661578(NULL /*static, unused*/, /*hidden argument*/ListPool_1_Get_m4266661578_MethodInfo_var); __this->set_m_Positions_0(L_0); IL2CPP_RUNTIME_CLASS_INIT(ListPool_1_t3991458268_il2cpp_TypeInfo_var); List_1_t1967039240 * L_1 = ListPool_1_Get_m1848305276(NULL /*static, unused*/, /*hidden argument*/ListPool_1_Get_m1848305276_MethodInfo_var); __this->set_m_Colors_1(L_1); IL2CPP_RUNTIME_CLASS_INIT(ListPool_1_t3379703849_il2cpp_TypeInfo_var); List_1_t1355284821 * L_2 = ListPool_1_Get_m1779148745(NULL /*static, unused*/, /*hidden argument*/ListPool_1_Get_m1779148745_MethodInfo_var); __this->set_m_Uv0S_2(L_2); List_1_t1355284821 * L_3 = ListPool_1_Get_m1779148745(NULL /*static, unused*/, /*hidden argument*/ListPool_1_Get_m1779148745_MethodInfo_var); __this->set_m_Uv1S_3(L_3); List_1_t1355284822 * L_4 = ListPool_1_Get_m4266661578(NULL /*static, unused*/, /*hidden argument*/ListPool_1_Get_m4266661578_MethodInfo_var); __this->set_m_Normals_4(L_4); IL2CPP_RUNTIME_CLASS_INIT(ListPool_1_t3379703851_il2cpp_TypeInfo_var); List_1_t1355284823 * L_5 = ListPool_1_Get_m2459207115(NULL /*static, unused*/, /*hidden argument*/ListPool_1_Get_m2459207115_MethodInfo_var); __this->set_m_Tangents_5(L_5); IL2CPP_RUNTIME_CLASS_INIT(ListPool_1_t251475784_il2cpp_TypeInfo_var); List_1_t2522024052 * L_6 = ListPool_1_Get_m1671355248(NULL /*static, unused*/, /*hidden argument*/ListPool_1_Get_m1671355248_MethodInfo_var); __this->set_m_Indices_6(L_6); Object__ctor_m1772956182(__this, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.UI.VertexHelper::.ctor(UnityEngine.Mesh) extern Il2CppClass* ListPool_1_t3379703850_il2cpp_TypeInfo_var; extern Il2CppClass* ListPool_1_t3991458268_il2cpp_TypeInfo_var; extern Il2CppClass* ListPool_1_t3379703849_il2cpp_TypeInfo_var; extern Il2CppClass* ListPool_1_t3379703851_il2cpp_TypeInfo_var; extern Il2CppClass* ListPool_1_t251475784_il2cpp_TypeInfo_var; extern const MethodInfo* ListPool_1_Get_m4266661578_MethodInfo_var; extern const MethodInfo* ListPool_1_Get_m1848305276_MethodInfo_var; extern const MethodInfo* ListPool_1_Get_m1779148745_MethodInfo_var; extern const MethodInfo* ListPool_1_Get_m2459207115_MethodInfo_var; extern const MethodInfo* ListPool_1_Get_m1671355248_MethodInfo_var; extern const MethodInfo* List_1_AddRange_m747416421_MethodInfo_var; extern const MethodInfo* List_1_AddRange_m1228619251_MethodInfo_var; extern const MethodInfo* List_1_AddRange_m2678035526_MethodInfo_var; extern const MethodInfo* List_1_AddRange_m3111764612_MethodInfo_var; extern const MethodInfo* List_1_AddRange_m1640324381_MethodInfo_var; extern const uint32_t VertexHelper__ctor_m4240166773_MetadataUsageId; extern "C" void VertexHelper__ctor_m4240166773 (VertexHelper_t3377436606 * __this, Mesh_t4241756145 * ___m0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (VertexHelper__ctor_m4240166773_MetadataUsageId); s_Il2CppMethodIntialized = true; } { IL2CPP_RUNTIME_CLASS_INIT(ListPool_1_t3379703850_il2cpp_TypeInfo_var); List_1_t1355284822 * L_0 = ListPool_1_Get_m4266661578(NULL /*static, unused*/, /*hidden argument*/ListPool_1_Get_m4266661578_MethodInfo_var); __this->set_m_Positions_0(L_0); IL2CPP_RUNTIME_CLASS_INIT(ListPool_1_t3991458268_il2cpp_TypeInfo_var); List_1_t1967039240 * L_1 = ListPool_1_Get_m1848305276(NULL /*static, unused*/, /*hidden argument*/ListPool_1_Get_m1848305276_MethodInfo_var); __this->set_m_Colors_1(L_1); IL2CPP_RUNTIME_CLASS_INIT(ListPool_1_t3379703849_il2cpp_TypeInfo_var); List_1_t1355284821 * L_2 = ListPool_1_Get_m1779148745(NULL /*static, unused*/, /*hidden argument*/ListPool_1_Get_m1779148745_MethodInfo_var); __this->set_m_Uv0S_2(L_2); List_1_t1355284821 * L_3 = ListPool_1_Get_m1779148745(NULL /*static, unused*/, /*hidden argument*/ListPool_1_Get_m1779148745_MethodInfo_var); __this->set_m_Uv1S_3(L_3); List_1_t1355284822 * L_4 = ListPool_1_Get_m4266661578(NULL /*static, unused*/, /*hidden argument*/ListPool_1_Get_m4266661578_MethodInfo_var); __this->set_m_Normals_4(L_4); IL2CPP_RUNTIME_CLASS_INIT(ListPool_1_t3379703851_il2cpp_TypeInfo_var); List_1_t1355284823 * L_5 = ListPool_1_Get_m2459207115(NULL /*static, unused*/, /*hidden argument*/ListPool_1_Get_m2459207115_MethodInfo_var); __this->set_m_Tangents_5(L_5); IL2CPP_RUNTIME_CLASS_INIT(ListPool_1_t251475784_il2cpp_TypeInfo_var); List_1_t2522024052 * L_6 = ListPool_1_Get_m1671355248(NULL /*static, unused*/, /*hidden argument*/ListPool_1_Get_m1671355248_MethodInfo_var); __this->set_m_Indices_6(L_6); Object__ctor_m1772956182(__this, /*hidden argument*/NULL); List_1_t1355284822 * L_7 = __this->get_m_Positions_0(); Mesh_t4241756145 * L_8 = ___m0; NullCheck(L_8); Vector3U5BU5D_t215400611* L_9 = Mesh_get_vertices_m3685486174(L_8, /*hidden argument*/NULL); NullCheck(L_7); List_1_AddRange_m747416421(L_7, (Il2CppObject*)(Il2CppObject*)L_9, /*hidden argument*/List_1_AddRange_m747416421_MethodInfo_var); List_1_t1967039240 * L_10 = __this->get_m_Colors_1(); Mesh_t4241756145 * L_11 = ___m0; NullCheck(L_11); Color32U5BU5D_t2960766953* L_12 = Mesh_get_colors32_m192356802(L_11, /*hidden argument*/NULL); NullCheck(L_10); List_1_AddRange_m1228619251(L_10, (Il2CppObject*)(Il2CppObject*)L_12, /*hidden argument*/List_1_AddRange_m1228619251_MethodInfo_var); List_1_t1355284821 * L_13 = __this->get_m_Uv0S_2(); Mesh_t4241756145 * L_14 = ___m0; NullCheck(L_14); Vector2U5BU5D_t4024180168* L_15 = Mesh_get_uv_m558008935(L_14, /*hidden argument*/NULL); NullCheck(L_13); List_1_AddRange_m2678035526(L_13, (Il2CppObject*)(Il2CppObject*)L_15, /*hidden argument*/List_1_AddRange_m2678035526_MethodInfo_var); List_1_t1355284821 * L_16 = __this->get_m_Uv1S_3(); Mesh_t4241756145 * L_17 = ___m0; NullCheck(L_17); Vector2U5BU5D_t4024180168* L_18 = Mesh_get_uv2_m118417421(L_17, /*hidden argument*/NULL); NullCheck(L_16); List_1_AddRange_m2678035526(L_16, (Il2CppObject*)(Il2CppObject*)L_18, /*hidden argument*/List_1_AddRange_m2678035526_MethodInfo_var); List_1_t1355284822 * L_19 = __this->get_m_Normals_4(); Mesh_t4241756145 * L_20 = ___m0; NullCheck(L_20); Vector3U5BU5D_t215400611* L_21 = Mesh_get_normals_m3396909641(L_20, /*hidden argument*/NULL); NullCheck(L_19); List_1_AddRange_m747416421(L_19, (Il2CppObject*)(Il2CppObject*)L_21, /*hidden argument*/List_1_AddRange_m747416421_MethodInfo_var); List_1_t1355284823 * L_22 = __this->get_m_Tangents_5(); Mesh_t4241756145 * L_23 = ___m0; NullCheck(L_23); Vector4U5BU5D_t701588350* L_24 = Mesh_get_tangents_m3235865682(L_23, /*hidden argument*/NULL); NullCheck(L_22); List_1_AddRange_m3111764612(L_22, (Il2CppObject*)(Il2CppObject*)L_24, /*hidden argument*/List_1_AddRange_m3111764612_MethodInfo_var); List_1_t2522024052 * L_25 = __this->get_m_Indices_6(); Mesh_t4241756145 * L_26 = ___m0; NullCheck(L_26); Int32U5BU5D_t3230847821* L_27 = Mesh_GetIndices_m637494532(L_26, 0, /*hidden argument*/NULL); NullCheck(L_25); List_1_AddRange_m1640324381(L_25, (Il2CppObject*)(Il2CppObject*)L_27, /*hidden argument*/List_1_AddRange_m1640324381_MethodInfo_var); return; } } // System.Void UnityEngine.UI.VertexHelper::.cctor() extern Il2CppClass* VertexHelper_t3377436606_il2cpp_TypeInfo_var; extern const uint32_t VertexHelper__cctor_m2517678132_MetadataUsageId; extern "C" void VertexHelper__cctor_m2517678132 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (VertexHelper__cctor_m2517678132_MetadataUsageId); s_Il2CppMethodIntialized = true; } { Vector4_t4282066567 L_0; memset(&L_0, 0, sizeof(L_0)); Vector4__ctor_m2441427762(&L_0, (1.0f), (0.0f), (0.0f), (-1.0f), /*hidden argument*/NULL); ((VertexHelper_t3377436606_StaticFields*)VertexHelper_t3377436606_il2cpp_TypeInfo_var->static_fields)->set_s_DefaultTangent_7(L_0); Vector3_t4282066566 L_1 = Vector3_get_back_m1326515313(NULL /*static, unused*/, /*hidden argument*/NULL); ((VertexHelper_t3377436606_StaticFields*)VertexHelper_t3377436606_il2cpp_TypeInfo_var->static_fields)->set_s_DefaultNormal_8(L_1); return; } } // System.Void UnityEngine.UI.VertexHelper::Clear() extern const MethodInfo* List_1_Clear_m3327756448_MethodInfo_var; extern const MethodInfo* List_1_Clear_m2864657362_MethodInfo_var; extern const MethodInfo* List_1_Clear_m829740511_MethodInfo_var; extern const MethodInfo* List_1_Clear_m1530805089_MethodInfo_var; extern const MethodInfo* List_1_Clear_m2359410152_MethodInfo_var; extern const uint32_t VertexHelper_Clear_m412394180_MetadataUsageId; extern "C" void VertexHelper_Clear_m412394180 (VertexHelper_t3377436606 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (VertexHelper_Clear_m412394180_MetadataUsageId); s_Il2CppMethodIntialized = true; } { List_1_t1355284822 * L_0 = __this->get_m_Positions_0(); NullCheck(L_0); List_1_Clear_m3327756448(L_0, /*hidden argument*/List_1_Clear_m3327756448_MethodInfo_var); List_1_t1967039240 * L_1 = __this->get_m_Colors_1(); NullCheck(L_1); List_1_Clear_m2864657362(L_1, /*hidden argument*/List_1_Clear_m2864657362_MethodInfo_var); List_1_t1355284821 * L_2 = __this->get_m_Uv0S_2(); NullCheck(L_2); List_1_Clear_m829740511(L_2, /*hidden argument*/List_1_Clear_m829740511_MethodInfo_var); List_1_t1355284821 * L_3 = __this->get_m_Uv1S_3(); NullCheck(L_3); List_1_Clear_m829740511(L_3, /*hidden argument*/List_1_Clear_m829740511_MethodInfo_var); List_1_t1355284822 * L_4 = __this->get_m_Normals_4(); NullCheck(L_4); List_1_Clear_m3327756448(L_4, /*hidden argument*/List_1_Clear_m3327756448_MethodInfo_var); List_1_t1355284823 * L_5 = __this->get_m_Tangents_5(); NullCheck(L_5); List_1_Clear_m1530805089(L_5, /*hidden argument*/List_1_Clear_m1530805089_MethodInfo_var); List_1_t2522024052 * L_6 = __this->get_m_Indices_6(); NullCheck(L_6); List_1_Clear_m2359410152(L_6, /*hidden argument*/List_1_Clear_m2359410152_MethodInfo_var); return; } } // System.Int32 UnityEngine.UI.VertexHelper::get_currentVertCount() extern const MethodInfo* List_1_get_Count_m2070445073_MethodInfo_var; extern const uint32_t VertexHelper_get_currentVertCount_m3425330353_MetadataUsageId; extern "C" int32_t VertexHelper_get_currentVertCount_m3425330353 (VertexHelper_t3377436606 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (VertexHelper_get_currentVertCount_m3425330353_MetadataUsageId); s_Il2CppMethodIntialized = true; } { List_1_t1355284822 * L_0 = __this->get_m_Positions_0(); NullCheck(L_0); int32_t L_1 = List_1_get_Count_m2070445073(L_0, /*hidden argument*/List_1_get_Count_m2070445073_MethodInfo_var); return L_1; } } // System.Int32 UnityEngine.UI.VertexHelper::get_currentIndexCount() extern const MethodInfo* List_1_get_Count_m766977065_MethodInfo_var; extern const uint32_t VertexHelper_get_currentIndexCount_m3847254668_MetadataUsageId; extern "C" int32_t VertexHelper_get_currentIndexCount_m3847254668 (VertexHelper_t3377436606 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (VertexHelper_get_currentIndexCount_m3847254668_MetadataUsageId); s_Il2CppMethodIntialized = true; } { List_1_t2522024052 * L_0 = __this->get_m_Indices_6(); NullCheck(L_0); int32_t L_1 = List_1_get_Count_m766977065(L_0, /*hidden argument*/List_1_get_Count_m766977065_MethodInfo_var); return L_1; } } // System.Void UnityEngine.UI.VertexHelper::PopulateUIVertex(UnityEngine.UIVertex&,System.Int32) extern const MethodInfo* List_1_get_Item_m238279332_MethodInfo_var; extern const MethodInfo* List_1_get_Item_m2967479602_MethodInfo_var; extern const MethodInfo* List_1_get_Item_m207259525_MethodInfo_var; extern const MethodInfo* List_1_get_Item_m269299139_MethodInfo_var; extern const uint32_t VertexHelper_PopulateUIVertex_m910319817_MetadataUsageId; extern "C" void VertexHelper_PopulateUIVertex_m910319817 (VertexHelper_t3377436606 * __this, UIVertex_t4244065212 * ___vertex0, int32_t ___i1, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (VertexHelper_PopulateUIVertex_m910319817_MetadataUsageId); s_Il2CppMethodIntialized = true; } { UIVertex_t4244065212 * L_0 = ___vertex0; List_1_t1355284822 * L_1 = __this->get_m_Positions_0(); int32_t L_2 = ___i1; NullCheck(L_1); Vector3_t4282066566 L_3 = List_1_get_Item_m238279332(L_1, L_2, /*hidden argument*/List_1_get_Item_m238279332_MethodInfo_var); L_0->set_position_0(L_3); UIVertex_t4244065212 * L_4 = ___vertex0; List_1_t1967039240 * L_5 = __this->get_m_Colors_1(); int32_t L_6 = ___i1; NullCheck(L_5); Color32_t598853688 L_7 = List_1_get_Item_m2967479602(L_5, L_6, /*hidden argument*/List_1_get_Item_m2967479602_MethodInfo_var); L_4->set_color_2(L_7); UIVertex_t4244065212 * L_8 = ___vertex0; List_1_t1355284821 * L_9 = __this->get_m_Uv0S_2(); int32_t L_10 = ___i1; NullCheck(L_9); Vector2_t4282066565 L_11 = List_1_get_Item_m207259525(L_9, L_10, /*hidden argument*/List_1_get_Item_m207259525_MethodInfo_var); L_8->set_uv0_3(L_11); UIVertex_t4244065212 * L_12 = ___vertex0; List_1_t1355284821 * L_13 = __this->get_m_Uv1S_3(); int32_t L_14 = ___i1; NullCheck(L_13); Vector2_t4282066565 L_15 = List_1_get_Item_m207259525(L_13, L_14, /*hidden argument*/List_1_get_Item_m207259525_MethodInfo_var); L_12->set_uv1_4(L_15); UIVertex_t4244065212 * L_16 = ___vertex0; List_1_t1355284822 * L_17 = __this->get_m_Normals_4(); int32_t L_18 = ___i1; NullCheck(L_17); Vector3_t4282066566 L_19 = List_1_get_Item_m238279332(L_17, L_18, /*hidden argument*/List_1_get_Item_m238279332_MethodInfo_var); L_16->set_normal_1(L_19); UIVertex_t4244065212 * L_20 = ___vertex0; List_1_t1355284823 * L_21 = __this->get_m_Tangents_5(); int32_t L_22 = ___i1; NullCheck(L_21); Vector4_t4282066567 L_23 = List_1_get_Item_m269299139(L_21, L_22, /*hidden argument*/List_1_get_Item_m269299139_MethodInfo_var); L_20->set_tangent_5(L_23); return; } } // System.Void UnityEngine.UI.VertexHelper::SetUIVertex(UnityEngine.UIVertex,System.Int32) extern const MethodInfo* List_1_set_Item_m1990542887_MethodInfo_var; extern const MethodInfo* List_1_set_Item_m3864873177_MethodInfo_var; extern const MethodInfo* List_1_set_Item_m1297441190_MethodInfo_var; extern const MethodInfo* List_1_set_Item_m2683644584_MethodInfo_var; extern const uint32_t VertexHelper_SetUIVertex_m3429482805_MetadataUsageId; extern "C" void VertexHelper_SetUIVertex_m3429482805 (VertexHelper_t3377436606 * __this, UIVertex_t4244065212 ___vertex0, int32_t ___i1, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (VertexHelper_SetUIVertex_m3429482805_MetadataUsageId); s_Il2CppMethodIntialized = true; } { List_1_t1355284822 * L_0 = __this->get_m_Positions_0(); int32_t L_1 = ___i1; Vector3_t4282066566 L_2 = (&___vertex0)->get_position_0(); NullCheck(L_0); List_1_set_Item_m1990542887(L_0, L_1, L_2, /*hidden argument*/List_1_set_Item_m1990542887_MethodInfo_var); List_1_t1967039240 * L_3 = __this->get_m_Colors_1(); int32_t L_4 = ___i1; Color32_t598853688 L_5 = (&___vertex0)->get_color_2(); NullCheck(L_3); List_1_set_Item_m3864873177(L_3, L_4, L_5, /*hidden argument*/List_1_set_Item_m3864873177_MethodInfo_var); List_1_t1355284821 * L_6 = __this->get_m_Uv0S_2(); int32_t L_7 = ___i1; Vector2_t4282066565 L_8 = (&___vertex0)->get_uv0_3(); NullCheck(L_6); List_1_set_Item_m1297441190(L_6, L_7, L_8, /*hidden argument*/List_1_set_Item_m1297441190_MethodInfo_var); List_1_t1355284821 * L_9 = __this->get_m_Uv1S_3(); int32_t L_10 = ___i1; Vector2_t4282066565 L_11 = (&___vertex0)->get_uv1_4(); NullCheck(L_9); List_1_set_Item_m1297441190(L_9, L_10, L_11, /*hidden argument*/List_1_set_Item_m1297441190_MethodInfo_var); List_1_t1355284822 * L_12 = __this->get_m_Normals_4(); int32_t L_13 = ___i1; Vector3_t4282066566 L_14 = (&___vertex0)->get_normal_1(); NullCheck(L_12); List_1_set_Item_m1990542887(L_12, L_13, L_14, /*hidden argument*/List_1_set_Item_m1990542887_MethodInfo_var); List_1_t1355284823 * L_15 = __this->get_m_Tangents_5(); int32_t L_16 = ___i1; Vector4_t4282066567 L_17 = (&___vertex0)->get_tangent_5(); NullCheck(L_15); List_1_set_Item_m2683644584(L_15, L_16, L_17, /*hidden argument*/List_1_set_Item_m2683644584_MethodInfo_var); return; } } // System.Void UnityEngine.UI.VertexHelper::FillMesh(UnityEngine.Mesh) extern Il2CppClass* ArgumentException_t928607144_il2cpp_TypeInfo_var; extern const MethodInfo* List_1_get_Count_m2070445073_MethodInfo_var; extern Il2CppCodeGenString* _stringLiteral3668213316; extern const uint32_t VertexHelper_FillMesh_m2371101047_MetadataUsageId; extern "C" void VertexHelper_FillMesh_m2371101047 (VertexHelper_t3377436606 * __this, Mesh_t4241756145 * ___mesh0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (VertexHelper_FillMesh_m2371101047_MetadataUsageId); s_Il2CppMethodIntialized = true; } { Mesh_t4241756145 * L_0 = ___mesh0; NullCheck(L_0); Mesh_Clear_m90337099(L_0, /*hidden argument*/NULL); List_1_t1355284822 * L_1 = __this->get_m_Positions_0(); NullCheck(L_1); int32_t L_2 = List_1_get_Count_m2070445073(L_1, /*hidden argument*/List_1_get_Count_m2070445073_MethodInfo_var); if ((((int32_t)L_2) < ((int32_t)((int32_t)65000)))) { goto IL_0026; } } { ArgumentException_t928607144 * L_3 = (ArgumentException_t928607144 *)il2cpp_codegen_object_new(ArgumentException_t928607144_il2cpp_TypeInfo_var); ArgumentException__ctor_m3544856547(L_3, _stringLiteral3668213316, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_3); } IL_0026: { Mesh_t4241756145 * L_4 = ___mesh0; List_1_t1355284822 * L_5 = __this->get_m_Positions_0(); NullCheck(L_4); Mesh_SetVertices_m701834806(L_4, L_5, /*hidden argument*/NULL); Mesh_t4241756145 * L_6 = ___mesh0; List_1_t1967039240 * L_7 = __this->get_m_Colors_1(); NullCheck(L_6); Mesh_SetColors_m3313707935(L_6, L_7, /*hidden argument*/NULL); Mesh_t4241756145 * L_8 = ___mesh0; List_1_t1355284821 * L_9 = __this->get_m_Uv0S_2(); NullCheck(L_8); Mesh_SetUVs_m116216925(L_8, 0, L_9, /*hidden argument*/NULL); Mesh_t4241756145 * L_10 = ___mesh0; List_1_t1355284821 * L_11 = __this->get_m_Uv1S_3(); NullCheck(L_10); Mesh_SetUVs_m116216925(L_10, 1, L_11, /*hidden argument*/NULL); Mesh_t4241756145 * L_12 = ___mesh0; List_1_t1355284822 * L_13 = __this->get_m_Normals_4(); NullCheck(L_12); Mesh_SetNormals_m2039144779(L_12, L_13, /*hidden argument*/NULL); Mesh_t4241756145 * L_14 = ___mesh0; List_1_t1355284823 * L_15 = __this->get_m_Tangents_5(); NullCheck(L_14); Mesh_SetTangents_m2005345740(L_14, L_15, /*hidden argument*/NULL); Mesh_t4241756145 * L_16 = ___mesh0; List_1_t2522024052 * L_17 = __this->get_m_Indices_6(); NullCheck(L_16); Mesh_SetTriangles_m456382467(L_16, L_17, 0, /*hidden argument*/NULL); Mesh_t4241756145 * L_18 = ___mesh0; NullCheck(L_18); Mesh_RecalculateBounds_m3754336742(L_18, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.UI.VertexHelper::Dispose() extern Il2CppClass* ListPool_1_t3379703850_il2cpp_TypeInfo_var; extern Il2CppClass* ListPool_1_t3991458268_il2cpp_TypeInfo_var; extern Il2CppClass* ListPool_1_t3379703849_il2cpp_TypeInfo_var; extern Il2CppClass* ListPool_1_t3379703851_il2cpp_TypeInfo_var; extern Il2CppClass* ListPool_1_t251475784_il2cpp_TypeInfo_var; extern const MethodInfo* ListPool_1_Release_m3961428258_MethodInfo_var; extern const MethodInfo* ListPool_1_Release_m1142705876_MethodInfo_var; extern const MethodInfo* ListPool_1_Release_m3969187617_MethodInfo_var; extern const MethodInfo* ListPool_1_Release_m3953668899_MethodInfo_var; extern const MethodInfo* ListPool_1_Release_m1485191562_MethodInfo_var; extern const uint32_t VertexHelper_Dispose_m2696974486_MetadataUsageId; extern "C" void VertexHelper_Dispose_m2696974486 (VertexHelper_t3377436606 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (VertexHelper_Dispose_m2696974486_MetadataUsageId); s_Il2CppMethodIntialized = true; } { List_1_t1355284822 * L_0 = __this->get_m_Positions_0(); IL2CPP_RUNTIME_CLASS_INIT(ListPool_1_t3379703850_il2cpp_TypeInfo_var); ListPool_1_Release_m3961428258(NULL /*static, unused*/, L_0, /*hidden argument*/ListPool_1_Release_m3961428258_MethodInfo_var); List_1_t1967039240 * L_1 = __this->get_m_Colors_1(); IL2CPP_RUNTIME_CLASS_INIT(ListPool_1_t3991458268_il2cpp_TypeInfo_var); ListPool_1_Release_m1142705876(NULL /*static, unused*/, L_1, /*hidden argument*/ListPool_1_Release_m1142705876_MethodInfo_var); List_1_t1355284821 * L_2 = __this->get_m_Uv0S_2(); IL2CPP_RUNTIME_CLASS_INIT(ListPool_1_t3379703849_il2cpp_TypeInfo_var); ListPool_1_Release_m3969187617(NULL /*static, unused*/, L_2, /*hidden argument*/ListPool_1_Release_m3969187617_MethodInfo_var); List_1_t1355284821 * L_3 = __this->get_m_Uv1S_3(); ListPool_1_Release_m3969187617(NULL /*static, unused*/, L_3, /*hidden argument*/ListPool_1_Release_m3969187617_MethodInfo_var); List_1_t1355284822 * L_4 = __this->get_m_Normals_4(); ListPool_1_Release_m3961428258(NULL /*static, unused*/, L_4, /*hidden argument*/ListPool_1_Release_m3961428258_MethodInfo_var); List_1_t1355284823 * L_5 = __this->get_m_Tangents_5(); IL2CPP_RUNTIME_CLASS_INIT(ListPool_1_t3379703851_il2cpp_TypeInfo_var); ListPool_1_Release_m3953668899(NULL /*static, unused*/, L_5, /*hidden argument*/ListPool_1_Release_m3953668899_MethodInfo_var); List_1_t2522024052 * L_6 = __this->get_m_Indices_6(); IL2CPP_RUNTIME_CLASS_INIT(ListPool_1_t251475784_il2cpp_TypeInfo_var); ListPool_1_Release_m1485191562(NULL /*static, unused*/, L_6, /*hidden argument*/ListPool_1_Release_m1485191562_MethodInfo_var); __this->set_m_Positions_0((List_1_t1355284822 *)NULL); __this->set_m_Colors_1((List_1_t1967039240 *)NULL); __this->set_m_Uv0S_2((List_1_t1355284821 *)NULL); __this->set_m_Uv1S_3((List_1_t1355284821 *)NULL); __this->set_m_Normals_4((List_1_t1355284822 *)NULL); __this->set_m_Tangents_5((List_1_t1355284823 *)NULL); __this->set_m_Indices_6((List_1_t2522024052 *)NULL); return; } } // System.Void UnityEngine.UI.VertexHelper::AddVert(UnityEngine.Vector3,UnityEngine.Color32,UnityEngine.Vector2,UnityEngine.Vector2,UnityEngine.Vector3,UnityEngine.Vector4) extern const MethodInfo* List_1_Add_m1321016677_MethodInfo_var; extern const MethodInfo* List_1_Add_m857917591_MethodInfo_var; extern const MethodInfo* List_1_Add_m3117968036_MethodInfo_var; extern const MethodInfo* List_1_Add_m3819032614_MethodInfo_var; extern const uint32_t VertexHelper_AddVert_m1784639198_MetadataUsageId; extern "C" void VertexHelper_AddVert_m1784639198 (VertexHelper_t3377436606 * __this, Vector3_t4282066566 ___position0, Color32_t598853688 ___color1, Vector2_t4282066565 ___uv02, Vector2_t4282066565 ___uv13, Vector3_t4282066566 ___normal4, Vector4_t4282066567 ___tangent5, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (VertexHelper_AddVert_m1784639198_MetadataUsageId); s_Il2CppMethodIntialized = true; } { List_1_t1355284822 * L_0 = __this->get_m_Positions_0(); Vector3_t4282066566 L_1 = ___position0; NullCheck(L_0); List_1_Add_m1321016677(L_0, L_1, /*hidden argument*/List_1_Add_m1321016677_MethodInfo_var); List_1_t1967039240 * L_2 = __this->get_m_Colors_1(); Color32_t598853688 L_3 = ___color1; NullCheck(L_2); List_1_Add_m857917591(L_2, L_3, /*hidden argument*/List_1_Add_m857917591_MethodInfo_var); List_1_t1355284821 * L_4 = __this->get_m_Uv0S_2(); Vector2_t4282066565 L_5 = ___uv02; NullCheck(L_4); List_1_Add_m3117968036(L_4, L_5, /*hidden argument*/List_1_Add_m3117968036_MethodInfo_var); List_1_t1355284821 * L_6 = __this->get_m_Uv1S_3(); Vector2_t4282066565 L_7 = ___uv13; NullCheck(L_6); List_1_Add_m3117968036(L_6, L_7, /*hidden argument*/List_1_Add_m3117968036_MethodInfo_var); List_1_t1355284822 * L_8 = __this->get_m_Normals_4(); Vector3_t4282066566 L_9 = ___normal4; NullCheck(L_8); List_1_Add_m1321016677(L_8, L_9, /*hidden argument*/List_1_Add_m1321016677_MethodInfo_var); List_1_t1355284823 * L_10 = __this->get_m_Tangents_5(); Vector4_t4282066567 L_11 = ___tangent5; NullCheck(L_10); List_1_Add_m3819032614(L_10, L_11, /*hidden argument*/List_1_Add_m3819032614_MethodInfo_var); return; } } // System.Void UnityEngine.UI.VertexHelper::AddVert(UnityEngine.Vector3,UnityEngine.Color32,UnityEngine.Vector2) extern Il2CppClass* VertexHelper_t3377436606_il2cpp_TypeInfo_var; extern const uint32_t VertexHelper_AddVert_m1490065189_MetadataUsageId; extern "C" void VertexHelper_AddVert_m1490065189 (VertexHelper_t3377436606 * __this, Vector3_t4282066566 ___position0, Color32_t598853688 ___color1, Vector2_t4282066565 ___uv02, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (VertexHelper_AddVert_m1490065189_MetadataUsageId); s_Il2CppMethodIntialized = true; } { Vector3_t4282066566 L_0 = ___position0; Color32_t598853688 L_1 = ___color1; Vector2_t4282066565 L_2 = ___uv02; Vector2_t4282066565 L_3 = Vector2_get_zero_m199872368(NULL /*static, unused*/, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(VertexHelper_t3377436606_il2cpp_TypeInfo_var); Vector3_t4282066566 L_4 = ((VertexHelper_t3377436606_StaticFields*)VertexHelper_t3377436606_il2cpp_TypeInfo_var->static_fields)->get_s_DefaultNormal_8(); Vector4_t4282066567 L_5 = ((VertexHelper_t3377436606_StaticFields*)VertexHelper_t3377436606_il2cpp_TypeInfo_var->static_fields)->get_s_DefaultTangent_7(); VertexHelper_AddVert_m1784639198(__this, L_0, L_1, L_2, L_3, L_4, L_5, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.UI.VertexHelper::AddVert(UnityEngine.UIVertex) extern "C" void VertexHelper_AddVert_m1127238042 (VertexHelper_t3377436606 * __this, UIVertex_t4244065212 ___v0, const MethodInfo* method) { { Vector3_t4282066566 L_0 = (&___v0)->get_position_0(); Color32_t598853688 L_1 = (&___v0)->get_color_2(); Vector2_t4282066565 L_2 = (&___v0)->get_uv0_3(); Vector2_t4282066565 L_3 = (&___v0)->get_uv1_4(); Vector3_t4282066566 L_4 = (&___v0)->get_normal_1(); Vector4_t4282066567 L_5 = (&___v0)->get_tangent_5(); VertexHelper_AddVert_m1784639198(__this, L_0, L_1, L_2, L_3, L_4, L_5, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.UI.VertexHelper::AddTriangle(System.Int32,System.Int32,System.Int32) extern const MethodInfo* List_1_Add_m352670381_MethodInfo_var; extern const uint32_t VertexHelper_AddTriangle_m514578993_MetadataUsageId; extern "C" void VertexHelper_AddTriangle_m514578993 (VertexHelper_t3377436606 * __this, int32_t ___idx00, int32_t ___idx11, int32_t ___idx22, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (VertexHelper_AddTriangle_m514578993_MetadataUsageId); s_Il2CppMethodIntialized = true; } { List_1_t2522024052 * L_0 = __this->get_m_Indices_6(); int32_t L_1 = ___idx00; NullCheck(L_0); List_1_Add_m352670381(L_0, L_1, /*hidden argument*/List_1_Add_m352670381_MethodInfo_var); List_1_t2522024052 * L_2 = __this->get_m_Indices_6(); int32_t L_3 = ___idx11; NullCheck(L_2); List_1_Add_m352670381(L_2, L_3, /*hidden argument*/List_1_Add_m352670381_MethodInfo_var); List_1_t2522024052 * L_4 = __this->get_m_Indices_6(); int32_t L_5 = ___idx22; NullCheck(L_4); List_1_Add_m352670381(L_4, L_5, /*hidden argument*/List_1_Add_m352670381_MethodInfo_var); return; } } // System.Void UnityEngine.UI.VertexHelper::AddUIVertexQuad(UnityEngine.UIVertex[]) extern "C" void VertexHelper_AddUIVertexQuad_m765809318 (VertexHelper_t3377436606 * __this, UIVertexU5BU5D_t1796391381* ___verts0, const MethodInfo* method) { int32_t V_0 = 0; int32_t V_1 = 0; { int32_t L_0 = VertexHelper_get_currentVertCount_m3425330353(__this, /*hidden argument*/NULL); V_0 = L_0; V_1 = 0; goto IL_0060; } IL_000e: { UIVertexU5BU5D_t1796391381* L_1 = ___verts0; int32_t L_2 = V_1; NullCheck(L_1); IL2CPP_ARRAY_BOUNDS_CHECK(L_1, L_2); Vector3_t4282066566 L_3 = ((L_1)->GetAddressAt(static_cast<il2cpp_array_size_t>(L_2)))->get_position_0(); UIVertexU5BU5D_t1796391381* L_4 = ___verts0; int32_t L_5 = V_1; NullCheck(L_4); IL2CPP_ARRAY_BOUNDS_CHECK(L_4, L_5); Color32_t598853688 L_6 = ((L_4)->GetAddressAt(static_cast<il2cpp_array_size_t>(L_5)))->get_color_2(); UIVertexU5BU5D_t1796391381* L_7 = ___verts0; int32_t L_8 = V_1; NullCheck(L_7); IL2CPP_ARRAY_BOUNDS_CHECK(L_7, L_8); Vector2_t4282066565 L_9 = ((L_7)->GetAddressAt(static_cast<il2cpp_array_size_t>(L_8)))->get_uv0_3(); UIVertexU5BU5D_t1796391381* L_10 = ___verts0; int32_t L_11 = V_1; NullCheck(L_10); IL2CPP_ARRAY_BOUNDS_CHECK(L_10, L_11); Vector2_t4282066565 L_12 = ((L_10)->GetAddressAt(static_cast<il2cpp_array_size_t>(L_11)))->get_uv1_4(); UIVertexU5BU5D_t1796391381* L_13 = ___verts0; int32_t L_14 = V_1; NullCheck(L_13); IL2CPP_ARRAY_BOUNDS_CHECK(L_13, L_14); Vector3_t4282066566 L_15 = ((L_13)->GetAddressAt(static_cast<il2cpp_array_size_t>(L_14)))->get_normal_1(); UIVertexU5BU5D_t1796391381* L_16 = ___verts0; int32_t L_17 = V_1; NullCheck(L_16); IL2CPP_ARRAY_BOUNDS_CHECK(L_16, L_17); Vector4_t4282066567 L_18 = ((L_16)->GetAddressAt(static_cast<il2cpp_array_size_t>(L_17)))->get_tangent_5(); VertexHelper_AddVert_m1784639198(__this, L_3, L_6, L_9, L_12, L_15, L_18, /*hidden argument*/NULL); int32_t L_19 = V_1; V_1 = ((int32_t)((int32_t)L_19+(int32_t)1)); } IL_0060: { int32_t L_20 = V_1; if ((((int32_t)L_20) < ((int32_t)4))) { goto IL_000e; } } { int32_t L_21 = V_0; int32_t L_22 = V_0; int32_t L_23 = V_0; VertexHelper_AddTriangle_m514578993(__this, L_21, ((int32_t)((int32_t)L_22+(int32_t)1)), ((int32_t)((int32_t)L_23+(int32_t)2)), /*hidden argument*/NULL); int32_t L_24 = V_0; int32_t L_25 = V_0; int32_t L_26 = V_0; VertexHelper_AddTriangle_m514578993(__this, ((int32_t)((int32_t)L_24+(int32_t)2)), ((int32_t)((int32_t)L_25+(int32_t)3)), L_26, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.UI.VertexHelper::AddUIVertexStream(System.Collections.Generic.List`1<UnityEngine.UIVertex>,System.Collections.Generic.List`1<System.Int32>) extern const MethodInfo* List_1_AddRange_m1640324381_MethodInfo_var; extern const uint32_t VertexHelper_AddUIVertexStream_m1704624332_MetadataUsageId; extern "C" void VertexHelper_AddUIVertexStream_m1704624332 (VertexHelper_t3377436606 * __this, List_1_t1317283468 * ___verts0, List_1_t2522024052 * ___indices1, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (VertexHelper_AddUIVertexStream_m1704624332_MetadataUsageId); s_Il2CppMethodIntialized = true; } { List_1_t1317283468 * L_0 = ___verts0; if (!L_0) { goto IL_0030; } } { List_1_t1317283468 * L_1 = ___verts0; List_1_t1355284822 * L_2 = __this->get_m_Positions_0(); List_1_t1967039240 * L_3 = __this->get_m_Colors_1(); List_1_t1355284821 * L_4 = __this->get_m_Uv0S_2(); List_1_t1355284821 * L_5 = __this->get_m_Uv1S_3(); List_1_t1355284822 * L_6 = __this->get_m_Normals_4(); List_1_t1355284823 * L_7 = __this->get_m_Tangents_5(); CanvasRenderer_AddUIVertexStream_m1865056747(NULL /*static, unused*/, L_1, L_2, L_3, L_4, L_5, L_6, L_7, /*hidden argument*/NULL); } IL_0030: { List_1_t2522024052 * L_8 = ___indices1; if (!L_8) { goto IL_0042; } } { List_1_t2522024052 * L_9 = __this->get_m_Indices_6(); List_1_t2522024052 * L_10 = ___indices1; NullCheck(L_9); List_1_AddRange_m1640324381(L_9, L_10, /*hidden argument*/List_1_AddRange_m1640324381_MethodInfo_var); } IL_0042: { return; } } // System.Void UnityEngine.UI.VertexHelper::AddUIVertexTriangleStream(System.Collections.Generic.List`1<UnityEngine.UIVertex>) extern "C" void VertexHelper_AddUIVertexTriangleStream_m1263262953 (VertexHelper_t3377436606 * __this, List_1_t1317283468 * ___verts0, const MethodInfo* method) { { List_1_t1317283468 * L_0 = ___verts0; if (L_0) { goto IL_0007; } } { return; } IL_0007: { List_1_t1317283468 * L_1 = ___verts0; List_1_t1355284822 * L_2 = __this->get_m_Positions_0(); List_1_t1967039240 * L_3 = __this->get_m_Colors_1(); List_1_t1355284821 * L_4 = __this->get_m_Uv0S_2(); List_1_t1355284821 * L_5 = __this->get_m_Uv1S_3(); List_1_t1355284822 * L_6 = __this->get_m_Normals_4(); List_1_t1355284823 * L_7 = __this->get_m_Tangents_5(); List_1_t2522024052 * L_8 = __this->get_m_Indices_6(); CanvasRenderer_SplitUIVertexStreams_m4126093916(NULL /*static, unused*/, L_1, L_2, L_3, L_4, L_5, L_6, L_7, L_8, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.UI.VertexHelper::GetUIVertexStream(System.Collections.Generic.List`1<UnityEngine.UIVertex>) extern "C" void VertexHelper_GetUIVertexStream_m1078623420 (VertexHelper_t3377436606 * __this, List_1_t1317283468 * ___stream0, const MethodInfo* method) { { List_1_t1317283468 * L_0 = ___stream0; if (L_0) { goto IL_0007; } } { return; } IL_0007: { List_1_t1317283468 * L_1 = ___stream0; List_1_t1355284822 * L_2 = __this->get_m_Positions_0(); List_1_t1967039240 * L_3 = __this->get_m_Colors_1(); List_1_t1355284821 * L_4 = __this->get_m_Uv0S_2(); List_1_t1355284821 * L_5 = __this->get_m_Uv1S_3(); List_1_t1355284822 * L_6 = __this->get_m_Normals_4(); List_1_t1355284823 * L_7 = __this->get_m_Tangents_5(); List_1_t2522024052 * L_8 = __this->get_m_Indices_6(); CanvasRenderer_CreateUIVertexStream_m2702356137(NULL /*static, unused*/, L_1, L_2, L_3, L_4, L_5, L_6, L_7, L_8, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.UI.VerticalLayoutGroup::.ctor() extern "C" void VerticalLayoutGroup__ctor_m2648549884 (VerticalLayoutGroup_t423167365 * __this, const MethodInfo* method) { { HorizontalOrVerticalLayoutGroup__ctor_m258856643(__this, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.UI.VerticalLayoutGroup::CalculateLayoutInputHorizontal() extern "C" void VerticalLayoutGroup_CalculateLayoutInputHorizontal_m1704122566 (VerticalLayoutGroup_t423167365 * __this, const MethodInfo* method) { { LayoutGroup_CalculateLayoutInputHorizontal_m89763996(__this, /*hidden argument*/NULL); HorizontalOrVerticalLayoutGroup_CalcAlongAxis_m423831906(__this, 0, (bool)1, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.UI.VerticalLayoutGroup::CalculateLayoutInputVertical() extern "C" void VerticalLayoutGroup_CalculateLayoutInputVertical_m920247256 (VerticalLayoutGroup_t423167365 * __this, const MethodInfo* method) { { HorizontalOrVerticalLayoutGroup_CalcAlongAxis_m423831906(__this, 1, (bool)1, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.UI.VerticalLayoutGroup::SetLayoutHorizontal() extern "C" void VerticalLayoutGroup_SetLayoutHorizontal_m244631242 (VerticalLayoutGroup_t423167365 * __this, const MethodInfo* method) { { HorizontalOrVerticalLayoutGroup_SetChildrenAlongAxis_m3440700494(__this, 0, (bool)1, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.UI.VerticalLayoutGroup::SetLayoutVertical() extern "C" void VerticalLayoutGroup_SetLayoutVertical_m2764536540 (VerticalLayoutGroup_t423167365 * __this, const MethodInfo* method) { { HorizontalOrVerticalLayoutGroup_SetChildrenAlongAxis_m3440700494(__this, 1, (bool)1, /*hidden argument*/NULL); return; } } #ifdef __clang__ #pragma clang diagnostic pop #endif
36.46248
383
0.772309
mopsicus
a69651305b83b8ad3b329222b9eba940f29a8639
1,219
cpp
C++
OpenGL-Sandbox/src/Paddle.cpp
j-delrosario/pong
f9d79f65e1a64bcee193da2ca00f731c762a6512
[ "Apache-2.0" ]
null
null
null
OpenGL-Sandbox/src/Paddle.cpp
j-delrosario/pong
f9d79f65e1a64bcee193da2ca00f731c762a6512
[ "Apache-2.0" ]
null
null
null
OpenGL-Sandbox/src/Paddle.cpp
j-delrosario/pong
f9d79f65e1a64bcee193da2ca00f731c762a6512
[ "Apache-2.0" ]
null
null
null
#include "Paddle.h" #include "GLCore/Core/KeyCodes.h" #pragma once using namespace GLCore; using namespace GLCore::Utils; Paddle::Paddle(float direction, float speed, glm::vec2 size, glm::vec2 position, glm::vec4 color) : m_Active(false), m_Direction(direction), m_Speed(speed), m_Size(size), m_Position(position), m_Color(color) { } Paddle::~Paddle() { } void Paddle::Draw() { Renderer::DrawQuad(m_Position, m_Size, m_Color); } void Paddle::Update(GLCore::Timestep ts) { if (!m_Active) return; if (m_Direction < 0) { if (Input::IsKeyPressed(HZ_KEY_W)) { m_Position.y += m_Speed * (float)ts; } else if (Input::IsKeyPressed(HZ_KEY_S)) { m_Position.y -= m_Speed * (float)ts; } } if (m_Direction > 0) { if (Input::IsKeyPressed(HZ_KEY_UP)) { m_Position.y += m_Speed * (float)ts; } else if (Input::IsKeyPressed(HZ_KEY_DOWN)) { m_Position.y -= m_Speed * (float)ts; } } if (m_Position.y + m_Size.y > 1.0f) m_Position.y = m_Size.y; else if (m_Position.y < -1.0f) m_Position.y = -1.0f; } void Paddle::Reset() { if (m_Direction < 0.0f) m_Position = { -1.5f - m_Size.x / 2, -m_Size.y / 2 }; else m_Position = { 1.4f - m_Size.x / 2, -m_Size.y / 2 }; m_Active = false; }
19.983607
110
0.652994
j-delrosario
a69bb072d6b540f4e7ab6525067e285506ba7750
17,855
cpp
C++
src/lower/index_expressions/lower_scatter_workspace.cpp
huangjd/simit-staging
6a1d7946e88c7bf383abe800ee835d3680e86559
[ "MIT" ]
null
null
null
src/lower/index_expressions/lower_scatter_workspace.cpp
huangjd/simit-staging
6a1d7946e88c7bf383abe800ee835d3680e86559
[ "MIT" ]
null
null
null
src/lower/index_expressions/lower_scatter_workspace.cpp
huangjd/simit-staging
6a1d7946e88c7bf383abe800ee835d3680e86559
[ "MIT" ]
null
null
null
#include "lower_scatter_workspace.h" #include <vector> #include <set> #include <map> #include <string> #include "loops.h" #include "lower_tensor_utils.h" #include "indexvar.h" #include "ir.h" #include "ir_visitor.h" #include "ir_printer.h" #include "ir_codegen.h" #include "substitute.h" #include "path_expressions.h" #include "util/util.h" #include "util/collections.h" using namespace std; namespace simit { namespace ir { typedef vector<IndexVar> IndexTuple; typedef map<IndexTuple, vector<const IndexedTensor *>> IndexTupleUses; typedef map<IndexVar, vector<IndexVar>> IndexVarGraph; inline ostream &operator<<(ostream &os, const IndexVarGraph &ivGraph) { os << "Index Variable Graph:" << endl; for (auto &ij : ivGraph) { auto i = ij.first; os << i; if (ij.second.size() > 0) { os << " -> "; os << util::join(ij.second, ","); } os << endl; } return os; } /// Build a map from index variable tuples to the IndexTensors they access: /// - B+C (i,j) -> B(i,j), C(i,j) /// - B+C' (i,j) -> B(i,j) /// (j,i) -> C(j,i) /// - B*C: (i,k) -> B(i,k) /// (k,j) -> C(k,j) static IndexTupleUses getIndexTupleUses(const IndexExpr *indexExpr) { struct GetIndexTupleUsesVisitor : public IRVisitor { IndexTupleUses indexTupleUses; void visit(const IndexedTensor *indexedTensor) { indexTupleUses[indexedTensor->indexVars].push_back(indexedTensor); } }; GetIndexTupleUsesVisitor visitor; indexExpr->accept(&visitor); return visitor.indexTupleUses; } /// Build a map from index variables to index variables they can reach through /// a usage. This map encodes a directed index variable graph where vertices /// are index variables, and where there exist an edge (i,j) if i and j are /// ever used together to index a tensor that has an index from i to j. For now /// we will assume we always have available all indices, but we may later want /// to optimize for memory by computing a minimum set of indices we need. /// - B+C: i -> j and j -> i /// - B*C: i -> k and k -> i /// k -> j and j -> k static IndexVarGraph createIndexVarGraph(const IndexExpr *indexExpression) { IndexTupleUses indexTupleUses = getIndexTupleUses(indexExpression); IndexVarGraph indexVarGraph; for (auto &itu : indexTupleUses) { IndexTuple indexTuple = itu.first; for (auto& index : indexTuple) { indexVarGraph.insert({index, vector<IndexVar>()}); } // Add edges between all index variables present in the same tuple for (size_t i=0; i < indexTuple.size() - 1; ++i) { for (size_t j=i+1; j < indexTuple.size(); ++j) { indexVarGraph.at(indexTuple[i]).push_back(indexTuple[j]); indexVarGraph.at(indexTuple[j]).push_back(indexTuple[i]); } } } return indexVarGraph; } static void createLoopNest(const IndexVarGraph &ivGraph, const IndexVariableLoop &linkedLoop, set<IndexVar> *visited, vector<IndexVariableLoop> *loops) { iassert(util::contains(ivGraph, linkedLoop.getIndexVar())); for (const IndexVar &sink : ivGraph.at(linkedLoop.getIndexVar())) { if (!util::contains(*visited, sink)) { visited->insert(sink); loops->push_back(IndexVariableLoop(sink, linkedLoop)); createLoopNest(ivGraph, sink, visited, loops); } } } /// Order the index variables into one loop per index variable, by traversing /// the index variable graph static vector<IndexVariableLoop> createLoopNest(const IndexVarGraph &ivGraph, const vector<IndexVar> &sources){ vector<IndexVariableLoop> loops; set<IndexVar> visited; for (auto &source : sources) { if (!util::contains(visited, source)) { visited.insert(source); IndexVariableLoop loop(source); loops.push_back(loop); createLoopNest(ivGraph, loop, &visited, &loops); } } return loops; } static vector<IndexVariableLoop> createLoopNest(const IndexExpr *indexExpr) { IndexVarGraph indexVariableGraph = createIndexVarGraph(indexExpr); return createLoopNest(indexVariableGraph, indexExpr->resultVars); } static Expr compareToNextIndexLocation(const TensorIndexVar &inductionVar) { return Lt::make(inductionVar.getCoordVar(), inductionVar.loadCoord(1)); } /// Create sparse while loop condition. Sparse while loops simultaneously /// iterate over the coordinate variables of one or more tensors static Expr subsetLoopCondition(const vector<TensorIndexVar> &inductionVars) { auto it = inductionVars.begin(); auto end = inductionVars.end(); Expr condition = compareToNextIndexLocation(*it++); for (; it != end; ++it) { condition = And::make(condition, compareToNextIndexLocation(*it)); } return condition; } static Stmt updateSinkInductionVars(const vector<TensorIndexVar> &tensorIndexVars) { vector<Stmt> initSinkInductionVarStmts; for (const TensorIndexVar &tensorIndexVar : tensorIndexVars) { initSinkInductionVarStmts.push_back(tensorIndexVar.initSinkVar()); } return Block::make(initSinkInductionVarStmts); } static Stmt createFastForwardLoop(const TensorIndexVar &tensorIndexVar, Var inductionVar) { Var sinkVar = tensorIndexVar.getSinkVar(); Expr fastForwardCondition = Lt::make(sinkVar, inductionVar); Expr fastForwardLoopCondition = And::make(fastForwardCondition, compareToNextIndexLocation(tensorIndexVar)); Stmt incrementCoordVar = increment(tensorIndexVar.getCoordVar()); Stmt initSinkVar = tensorIndexVar.initSinkVar(); Stmt stepCoordAndSinkVars = Block::make(incrementCoordVar, initSinkVar); // Poor man's do-while loop Stmt fastForwardLoop = Block::make(stepCoordAndSinkVars, While::make(fastForwardLoopCondition, stepCoordAndSinkVars)); return Comment::make("fastforward "+sinkVar.getName(), fastForwardLoop); } /// @param body A statement that is evaluated for every inductionVar value /// of the intersection between the tensorIndexVars. static Stmt createSubsetLoopStmt(const Var &inductionVar, const vector<TensorIndexVar> &tensorIndexVars, Stmt body) { iassert(tensorIndexVars.size() > 0); Stmt loop; // Only one TensorIndexVar so we emit a for loop over a range. if (tensorIndexVars.size() == 1) { const TensorIndexVar& tensorIndexVar = tensorIndexVars[0]; body = Block::make(tensorIndexVars[0].initSinkVar(inductionVar), body); loop = ForRange::make(tensorIndexVar.getCoordVar(), tensorIndexVar.loadCoord(), tensorIndexVar.loadCoord(1), body); } // Two or more TensorIndexVars so we merge their iteration space with a while else { // Emit the code to execute at the intersection Stmt intersectionStmt; // Init induction variable (at the intersection all sink vars are the same) Var firstSinkVar = tensorIndexVars[0].getSinkVar(); Stmt initInductionVar = AssignStmt::make(inductionVar, firstSinkVar); intersectionStmt = Block::make(intersectionStmt, initInductionVar); // Append caller-provided loop body intersectionStmt = Block::make(intersectionStmt, body); // Increment each coordinate var for (auto& tensorIndexVar : tensorIndexVars) { Stmt incrementCoordVar = increment(tensorIndexVar.getCoordVar()); intersectionStmt = Block::make(intersectionStmt, incrementCoordVar); } // Update the sink induction variables Stmt updateSinkVars = updateSinkInductionVars(tensorIndexVars); intersectionStmt = Block::make(intersectionStmt, updateSinkVars); // Emit the code to execute outside the intersection Stmt notIntersectionStmt; function<Expr(TensorIndexVar)> getSinkVarFunc = [](const TensorIndexVar &t){return t.getSinkVar();}; vector<Expr> sinkVars = util::map(tensorIndexVars, getSinkVarFunc); // The loop induction variable is the min of the tensor index variables initInductionVar = max(inductionVar, sinkVars); notIntersectionStmt = Block::make(notIntersectionStmt, initInductionVar); // Emit one fast forward loop per tensor index variable if (tensorIndexVars.size() == 2) { Var sinkVar0 = tensorIndexVars[0].getSinkVar(); Expr fastForwardCondition = Lt::make(sinkVar0, inductionVar); Stmt fastForwardSinkVar0 = createFastForwardLoop(tensorIndexVars[0], inductionVar); Stmt fastForwardSinkVar1 = createFastForwardLoop(tensorIndexVars[1], inductionVar); Stmt fastForwardIfLess = IfThenElse::make(fastForwardCondition, fastForwardSinkVar0, fastForwardSinkVar1); notIntersectionStmt = Block::make(notIntersectionStmt, fastForwardIfLess); } else { vector<Stmt> fastForwardLoops; for (auto& tensorIndexVar : tensorIndexVars) { Var sinkVar = tensorIndexVar.getSinkVar(); Expr fastForwardCondition = Lt::make(sinkVar, inductionVar); Stmt fastForwardSinkVar = createFastForwardLoop(tensorIndexVar, inductionVar); Stmt fastForwardIfLess = IfThenElse::make(fastForwardCondition, fastForwardSinkVar); fastForwardLoops.push_back(fastForwardIfLess); } Stmt fastForwardLoopsStmt = Block::make(fastForwardLoops); notIntersectionStmt = Block::make(notIntersectionStmt, fastForwardLoopsStmt); } // Check whether we are at the intersection of the tensor index sink vars Expr intersectionCondition = compare(sinkVars); // Create the loop body Stmt loopBody = IfThenElse::make(intersectionCondition, intersectionStmt, notIntersectionStmt); vector<Stmt> declAndInitStmts; // Declare and initialize coordinate induction variables for (auto &inductionVar : tensorIndexVars) { declAndInitStmts.push_back(VarDecl::make(inductionVar.getCoordVar())); declAndInitStmts.push_back(inductionVar.initCoordVar()); } // Declare and initialize sink induction variables for (auto &inductionVar : tensorIndexVars) { declAndInitStmts.push_back(VarDecl::make(inductionVar.getSinkVar())); declAndInitStmts.push_back(inductionVar.initSinkVar()); } Stmt initCoordAndSinkVars = Block::make(declAndInitStmts); // Create sparse while loop Expr loopCondition = subsetLoopCondition(tensorIndexVars); loop = Block::make(initCoordAndSinkVars, While::make(loopCondition,loopBody)); } iassert(loop.defined()); return loop; } static Stmt createSubsetLoopStmt(const Var& target, const Var& inductionVar, Expr blockSize, const SubsetLoop& subsetLoop, Environment* environment) { Stmt computeStmt = Store::make(target, inductionVar, subsetLoop.getComputeExpression(), subsetLoop.getCompoundOperator()); iassert(target.getType().isTensor()); Type blockType = target.getType().toTensor()->getBlockType(); const TensorType* btype = blockType.toTensor(); if (btype->order() > 0) { vector<Var> inductionVars; inductionVars.push_back(inductionVar); for (auto& tiv : subsetLoop.getTensorIndexVars()) { inductionVars.push_back(tiv.getCoordVar()); } computeStmt = rewriteToBlocked(computeStmt, inductionVars, blockSize); } return createSubsetLoopStmt(inductionVar, subsetLoop.getTensorIndexVars(), computeStmt); } static string tensorSliceString(const vector<IndexVar> &vars, const IndexVar &sliceVar) { unsigned sliceDimension = util::locate(vars, sliceVar); string result = "("; for (size_t i=0; i < vars.size(); ++i) { result += (i == sliceDimension) ? ":" : toString(vars[i]); if (i < vars.size()-1) { result += ","; } } result += ")"; return result; } static string tensorSliceString(const Expr &expr, const IndexVar &sliceVar) { class SlicePrinter : public IRPrinter { public: SlicePrinter(const IndexVar &sliceVar) : IRPrinter(ss), sliceVar(sliceVar){} string toString(const Expr &expr) { skipTopExprParenthesis(); print(expr); return ss.str(); } private: stringstream ss; const IndexVar &sliceVar; void visit(const IndexedTensor *indexedTensor) { ss << indexedTensor->tensor << tensorSliceString(indexedTensor->indexVars, sliceVar); } }; return SlicePrinter(sliceVar).toString(expr);; } static Stmt copyFromWorkspace(Var target, Expr targetIndex, Var workspace, Expr workspaceIndex) { ScalarType workspaceCType = workspace.getType().toTensor()->getComponentType(); Stmt copyFromWorkspace = Store::make(target, targetIndex, Load::make(workspace, workspaceIndex)); Expr resetVal = Literal::make(TensorType::make(workspaceCType)); Stmt resetWorkspace = Store::make(workspace, workspaceIndex, resetVal); return Block::make(copyFromWorkspace, resetWorkspace); } Stmt lowerScatterWorkspace(Var target, const IndexExpr* indexExpression, Environment* environment, Storage* storage) { iassert(target.getType().isTensor()); const TensorType* type = target.getType().toTensor(); tassert(type->order() <= 2) << "lowerScatterWorkspace does not support higher-order tensors"; Type blockType = type->getBlockType(); const TensorType* btype = blockType.toTensor(); Expr blockSize = (int)btype->size(); // Create loops vector<IndexVariableLoop> loops = createLoopNest(indexExpression); // Emit loops Stmt loopNest; for (IndexVariableLoop &loop : util::reverse(loops)) { IndexVar indexVar = loop.getIndexVar(); Var inductionVar = loop.getInductionVar(); // Dense loops if (!loop.isLinked()) { const IndexSet &indexSet = indexVar.getDomain().getIndexSets()[0]; loopNest = For::make(inductionVar, indexSet, loopNest); } // Sparse/linked loops else { IndexVar linkedIndexVar = loop.getLinkedLoop().getIndexVar(); Var linkedInductionVar = loop.getLinkedLoop().getInductionVar(); vector<SubsetLoop> subsetLoops = createSubsetLoops(indexExpression, loop, environment, storage); // Create workspace on target ScalarType workspaceCType = type->getComponentType(); Var workspace; if (type->order() < 2) { workspace = target; } else { // Sparse output IndexDomain workspaceDomain = type->getDimensions()[1]; // Row workspace Type workspaceType = TensorType::make(workspaceCType,{workspaceDomain}); workspace = environment->createTemporary(workspaceType, INTERNAL_PREFIX("workspace")); environment->addTemporary(workspace); storage->add(workspace, TensorStorage::Kind::Dense); } iassert(workspace.defined()); vector<Stmt> loopStatements; // Create induction var decl Stmt inductionVarDecl = VarDecl::make(inductionVar); loopStatements.push_back(inductionVarDecl); // Create each subset loop and add their results to the workspace for (const SubsetLoop& subsetLoop : subsetLoops) { Stmt loopStmt = createSubsetLoopStmt(workspace, inductionVar, blockSize, subsetLoop, environment); string comment = workspace.getName() + " " + util::toString(subsetLoop.getCompoundOperator())+"= " + tensorSliceString(subsetLoop.getIndexExpression(), indexVar); loopStatements.push_back(Comment::make(comment, loopStmt, false, true)); } iassert(loops.size() > 0); // Create the loop that copies the workspace to the target auto& resultVars = indexExpression->resultVars; TensorStorage& ts = storage->getStorage(target); TensorIndex ti; if (!ts.hasTensorIndex() && environment->hasExtern(target.getName())) { ts.setTensorIndex(target); ti = ts.getTensorIndex(); environment->addExternMapping(target, ti.getRowptrArray()); environment->addExternMapping(target, ti.getColidxArray()); } else { ti = ts.getTensorIndex(); } TensorIndexVar resultIndexVar(inductionVar.getName(), target.getName(), linkedInductionVar, ti); Stmt body; body = copyFromWorkspace(target, resultIndexVar.getCoordVar(), workspace, inductionVar); if (btype->order() > 0) { const Var& coordVar = resultIndexVar.getCoordVar(); body = rewriteToBlocked(body, {inductionVar, coordVar}, blockSize); } Stmt loopStmt = createSubsetLoopStmt(inductionVar, {resultIndexVar},body); string comment = toString(target) + tensorSliceString(resultVars, loop.getIndexVar()) + " = " + workspace.getName(); loopStatements.push_back(Comment::make(comment, loopStmt, false, true)); loopNest = Block::make(loopStatements); } } stringstream comment; comment << util::toString(target) << "(" + util::join(indexExpression->resultVars, ",") << ") = "; IRPrinter printer(comment); printer.skipTopExprParenthesis(); printer.print(indexExpression->value); return Comment::make(comment.str(), loopNest, true); } }}
38.151709
82
0.662504
huangjd
a69c9430522117866ce02715f08c106547005393
574
cpp
C++
ProWorld/Concept.cpp
JosepContact/ProWorld
194a38a0f8358e7bd5e89a8e517e87b91dd6e517
[ "MIT" ]
null
null
null
ProWorld/Concept.cpp
JosepContact/ProWorld
194a38a0f8358e7bd5e89a8e517e87b91dd6e517
[ "MIT" ]
null
null
null
ProWorld/Concept.cpp
JosepContact/ProWorld
194a38a0f8358e7bd5e89a8e517e87b91dd6e517
[ "MIT" ]
null
null
null
#include "Concept.h" using namespace std; Concept::Concept() { type = UnkownConcept; } Concept::Concept(std::string argword, std::string argplural, ConceptType argtype) : word(argword), plural(argplural), type(argtype) { } Concept::~Concept() { } void Concept::SetWord(string name, string plural) { this->word = name; this->plural = plural; } std::string Concept::GetWord() { return word; } std::string Concept::GetPlural() { return plural; } const char * Concept::GetChar() { return word.c_str(); } void Concept::SetID(unsigned int argid) { id = argid; }
12.755556
131
0.688153
JosepContact
a6a723b5fb244ce092beb83baa19a24b6d1f0c4b
11,168
hpp
C++
3rdParty/occa/include/occa/lang/primitive.hpp
krowe-alcf/nekBench
d314ca6b942076620dd7dab8f11df97be977c5db
[ "BSD-3-Clause" ]
null
null
null
3rdParty/occa/include/occa/lang/primitive.hpp
krowe-alcf/nekBench
d314ca6b942076620dd7dab8f11df97be977c5db
[ "BSD-3-Clause" ]
null
null
null
3rdParty/occa/include/occa/lang/primitive.hpp
krowe-alcf/nekBench
d314ca6b942076620dd7dab8f11df97be977c5db
[ "BSD-3-Clause" ]
null
null
null
#ifndef OCCA_LANG_PRIMITIVE_HEADER #define OCCA_LANG_PRIMITIVE_HEADER #include <iostream> #include <sstream> #include <iomanip> #include <stdint.h> #include <stdlib.h> #include <occa/defines.hpp> #include <occa/io/output.hpp> #include <occa/tools/string.hpp> #include <occa/tools/sys.hpp> namespace occa { //---[ Primitive Type ]--------------- namespace primitiveType { static const int none = (1 << 0); static const int bool_ = (1 << 1); static const int int8_ = (1 << 2); static const int uint8_ = (1 << 3); static const int int16_ = (1 << 4); static const int uint16_ = (1 << 5); static const int int32_ = (1 << 6); static const int uint32_ = (1 << 7); static const int int64_ = (1 << 8); static const int uint64_ = (1 << 9); static const int isSigned = (int8_ | int16_ | int32_ | int64_); static const int isUnsigned = (uint8_ | uint16_ | uint32_ | uint64_); static const int isInteger = (isSigned | isUnsigned); static const int float_ = (1 << 10); static const int double_ = (1 << 11); static const int isFloat = (float_ | double_); static const int ptr = (1 << 12); } //==================================== class primitive { public: int type; union { bool bool_; uint8_t uint8_; uint16_t uint16_; uint32_t uint32_; uint64_t uint64_; int8_t int8_; int16_t int16_; int32_t int32_; int64_t int64_; float float_; double double_; char* ptr; } value; inline primitive() : type(primitiveType::none) { value.ptr = NULL; } inline primitive(const primitive &p) : type(p.type) { value.ptr = p.value.ptr; } primitive(const char *c); primitive(const std::string &s); inline primitive(const bool value_) { type = primitiveType::bool_; value.bool_ = (bool) value_; } inline primitive(const uint8_t value_) { type = primitiveType::uint8_; value.uint8_ = (uint8_t) value_; } inline primitive(const uint16_t value_) { type = primitiveType::uint16_; value.uint16_ = (uint16_t) value_; } inline primitive(const uint32_t value_) { type = primitiveType::uint32_; value.uint32_ = (uint32_t) value_; } inline primitive(const uint64_t value_) { type = primitiveType::uint64_; value.uint64_ = (uint64_t) value_; } inline primitive(const int8_t value_) { type = primitiveType::int8_; value.int8_ = (int8_t) value_; } inline primitive(const int16_t value_) { type = primitiveType::int16_; value.int16_ = (int16_t) value_; } inline primitive(const int32_t value_) { type = primitiveType::int32_; value.int32_ = (int32_t) value_; } inline primitive(const int64_t value_) { type = primitiveType::int64_; value.int64_ = (int64_t) value_; } inline primitive(const float value_) { type = primitiveType::float_; value.float_ = value_; } inline primitive(const double value_) { type = primitiveType::double_; value.double_ = value_; } inline primitive(void *value_) { type = primitiveType::ptr; value.ptr = (char*) value_; } static primitive load(const char *&c, const bool includeSign = true); static primitive load(const std::string &s, const bool includeSign = true); static primitive loadBinary(const char *&c, const bool isNegative = false); static primitive loadHex(const char *&c, const bool isNegative = false); inline primitive& operator = (const bool value_) { type = primitiveType::bool_; value.bool_ = (bool) value_; return *this; } inline primitive& operator = (const uint8_t value_) { type = primitiveType::uint8_; value.uint8_ = (uint8_t) value_; return *this; } inline primitive& operator = (const uint16_t value_) { type = primitiveType::uint16_; value.uint16_ = (uint16_t) value_; return *this; } inline primitive& operator = (const uint32_t value_) { type = primitiveType::uint32_; value.uint32_ = (uint32_t) value_; return *this; } inline primitive& operator = (const uint64_t value_) { type = primitiveType::uint64_; value.uint64_ = (uint64_t) value_; return *this; } inline primitive& operator = (const int8_t value_) { type = primitiveType::int8_; value.int8_ = (int8_t) value_; return *this; } inline primitive& operator = (const int16_t value_) { type = primitiveType::int16_; value.int16_ = (int16_t) value_; return *this; } inline primitive& operator = (const int32_t value_) { type = primitiveType::int32_; value.int32_ = (int32_t) value_; return *this; } inline primitive& operator = (const int64_t value_) { type = primitiveType::int64_; value.int64_ = (int64_t) value_; return *this; } inline primitive& operator = (const float value_) { type = primitiveType::float_; value.float_ = value_; return *this; } inline primitive& operator = (const double value_) { type = primitiveType::double_; value.double_ = value_; return *this; } inline primitive& operator = (void *value_) { type = primitiveType::ptr; value.ptr = (char*) value_; return *this; } inline operator bool () const { return to<bool>(); } inline operator uint8_t () const { return to<uint8_t>(); } inline operator uint16_t () const { return to<uint16_t>(); } inline operator uint32_t () const { return to<uint32_t>(); } inline operator uint64_t () const { return to<uint64_t>(); } inline operator int8_t () const { return to<int8_t>(); } inline operator int16_t () const { return to<int16_t>(); } inline operator int32_t () const { return to<int32_t>(); } inline operator int64_t () const { return to<int64_t>(); } inline operator float () const { return to<float>(); } inline operator double () const { return to<double>(); } template <class TM> inline TM to() const { switch(type) { case primitiveType::bool_ : return (TM) value.bool_; case primitiveType::uint8_ : return (TM) value.uint8_; case primitiveType::uint16_ : return (TM) value.uint16_; case primitiveType::uint32_ : return (TM) value.uint32_; case primitiveType::uint64_ : return (TM) value.uint64_; case primitiveType::int8_ : return (TM) value.int8_; case primitiveType::int16_ : return (TM) value.int16_; case primitiveType::int32_ : return (TM) value.int32_; case primitiveType::int64_ : return (TM) value.int64_; case primitiveType::float_ : return (TM) value.float_; case primitiveType::double_ : return (TM) value.double_; default: OCCA_FORCE_ERROR("Type not set"); } return TM(); } inline bool isNaN() const { return type & primitiveType::none; } inline bool isBool() const { return type & primitiveType::bool_; } inline bool isSigned() const { return type & primitiveType::isSigned; } inline bool isUnsigned() const { return type & primitiveType::isUnsigned; } inline bool isInteger() const { return type & primitiveType::isInteger; } inline bool isFloat() const { return type & primitiveType::isFloat; } inline bool isPointer() const { return type & primitiveType::ptr; } std::string toString() const; friend io::output& operator << (io::output &out, const primitive &p); //---[ Misc Methods ]----------------- uint64_t sizeof_(); //==================================== //---[ Unary Operators ]-------------- static primitive not_(const primitive &p); static primitive positive(const primitive &p); static primitive negative(const primitive &p); static primitive tilde(const primitive &p); static primitive& leftIncrement(primitive &p); static primitive& leftDecrement(primitive &p); static primitive rightIncrement(primitive &p); static primitive rightDecrement(primitive &p); //==================================== //---[ Boolean Operators ]------------ static primitive lessThan(const primitive &a, const primitive &b); static primitive lessThanEq(const primitive &a, const primitive &b); static primitive equal(const primitive &a, const primitive &b); static primitive compare(const primitive &a, const primitive &b); static primitive notEqual(const primitive &a, const primitive &b); static primitive greaterThanEq(const primitive &a, const primitive &b); static primitive greaterThan(const primitive &a, const primitive &b); static primitive and_(const primitive &a, const primitive &b); static primitive or_(const primitive &a, const primitive &b); //==================================== //---[ Binary Operators ]------------- static primitive mult(const primitive &a, const primitive &b); static primitive add(const primitive &a, const primitive &b); static primitive sub(const primitive &a, const primitive &b); static primitive div(const primitive &a, const primitive &b); static primitive mod(const primitive &a, const primitive &b); static primitive bitAnd(const primitive &a, const primitive &b); static primitive bitOr(const primitive &a, const primitive &b); static primitive xor_(const primitive &a, const primitive &b); static primitive rightShift(const primitive &a, const primitive &b); static primitive leftShift(const primitive &a, const primitive &b); //==================================== //---[ Assignment Operators ]--------- static primitive& assign(primitive &a, const primitive &b); static primitive& multEq(primitive &a, const primitive &b); static primitive& addEq(primitive &a, const primitive &b); static primitive& subEq(primitive &a, const primitive &b); static primitive& divEq(primitive &a, const primitive &b); static primitive& modEq(primitive &a, const primitive &b); static primitive& bitAndEq(primitive &a, const primitive &b); static primitive& bitOrEq(primitive &a, const primitive &b); static primitive& xorEq(primitive &a, const primitive &b); static primitive& rightShiftEq(primitive &a, const primitive &b); static primitive& leftShiftEq(primitive &a, const primitive &b); //==================================== }; } #endif
29.083333
79
0.597153
krowe-alcf
a6a85c509488ab470e674715b75d896bc4b1efe6
324
cpp
C++
src/application/unit_tests/main_unit_tests.cpp
rybcom/cpp_modular_template
19c94a7a4000ca33e389e7bb43c510d1ee29115a
[ "BSD-3-Clause" ]
null
null
null
src/application/unit_tests/main_unit_tests.cpp
rybcom/cpp_modular_template
19c94a7a4000ca33e389e7bb43c510d1ee29115a
[ "BSD-3-Clause" ]
null
null
null
src/application/unit_tests/main_unit_tests.cpp
rybcom/cpp_modular_template
19c94a7a4000ca33e389e7bb43c510d1ee29115a
[ "BSD-3-Clause" ]
null
null
null
#include "project_config.h" #if RUN_AS_UNIT_TESTING() == true #define CATCH_CONFIG_RUNNER #include "catch.hpp" #include "unit_tests/object_unit_test.h" int main(int argc, char* argv[]) { char* xxx[2]; xxx[0] = (char*)"xxx"; xxx[1] =(char*) "-s"; int result = Catch::Session().run(2, xxx); return result; } #endif
16.2
43
0.666667
rybcom
16f5594c0cea57632469aaf24a0ad389b699e24b
3,117
hpp
C++
contrib/pdxautoserializer/src/impl/CPPParser/DictEntry.hpp
vaijira/geode-native
5a46b659b86ecc4890df59c1b7abe727192e5d06
[ "Apache-2.0" ]
null
null
null
contrib/pdxautoserializer/src/impl/CPPParser/DictEntry.hpp
vaijira/geode-native
5a46b659b86ecc4890df59c1b7abe727192e5d06
[ "Apache-2.0" ]
1
2022-03-31T01:54:57.000Z
2022-03-31T01:54:57.000Z
contrib/pdxautoserializer/src/impl/CPPParser/DictEntry.hpp
s0/geode-native
9b4c572ac0c63854641410a49521625c29a75bae
[ "Apache-2.0" ]
null
null
null
/* * PUBLIC DOMAIN PCCTS-BASED C++ GRAMMAR (cplusplus.g, stat.g, expr.g) * * Authors: Sumana Srinivasan, NeXT Inc.; [email protected] * Terence Parr, Parr Research Corporation; [email protected] * Russell Quong, Purdue University; [email protected] * * SOFTWARE RIGHTS * * This file is a part of the ANTLR-based C++ grammar and is free * software. We do not reserve any LEGAL rights to its use or * distribution, but you may NOT claim ownership or authorship of this * grammar or support code. An individual or company may otherwise do * whatever they wish with the grammar distributed herewith including the * incorporation of the grammar or the output generated by ANTLR into * commerical software. You may redistribute in source or binary form * without payment of royalties to us as long as this header remains * in all source distributions. * * We encourage users to develop parsers/tools using this grammar. * In return, we ask that credit is given to us for developing this * grammar. By "credit", we mean that if you incorporate our grammar or * the generated code into one of your programs (commercial product, * research project, or otherwise) that you acknowledge this fact in the * documentation, research report, etc.... In addition, you should say nice * things about us at every opportunity. * * As long as these guidelines are kept, we expect to continue enhancing * this grammar. Feel free to send us enhancements, fixes, bug reports, * suggestions, or general words of encouragement at [email protected]. * * NeXT Computer Inc. * 900 Chesapeake Dr. * Redwood City, CA 94555 * 12/02/1994 * * Restructured for public consumption by Terence Parr late February, 1995. * * Requires PCCTS 1.32b4 or higher to get past ANTLR. * * DISCLAIMER: we make no guarantees that this grammar works, makes sense, * or can be used to do anything useful. */ /* 1999-2005 Version 3.1 November 2005 * Modified by David Wigg at London South Bank University for CPP_parser.g * * See MyReadMe.txt for further information * * This file is best viewed in courier font with tabs set to 4 spaces */ #ifndef DictEntry_hpp #define DictEntry_hpp class DictEntry { protected: const char *key; int hashCode; DictEntry *next; // next element in the bucket DictEntry *scope; // next element in the scope public: int this_scope; // 4/2/96 LL - added to store scope DictEntry() { key = NULL; hashCode = -1; next = scope = NULL; } DictEntry(const char *k, int h = -1) { key = k; hashCode = h; next = scope = NULL; } virtual ~DictEntry() { key = NULL; hashCode = -1; next = scope = NULL; } void setKey(char *k) { key = k; } const char *getKey() { return key; } void setHashCode(int h) { hashCode = h; } int getHashCode() { return hashCode; } void setNext(DictEntry *n) { next = n; } DictEntry *getNext() { return next; } void setScope(DictEntry *s) { scope = s; } DictEntry *getNextInScope() { return scope; } }; #endif
31.484848
79
0.695541
vaijira
e500886c6683389bdedc36ec89e4aaf3b4e362b2
2,448
cpp
C++
modules/mdns/src/linux/Location.cpp
lubyk/lubyk
e4792099d61c460497aacda1a3c08f23f5bb84ed
[ "MIT" ]
18
2015-05-11T16:18:23.000Z
2021-12-03T09:28:51.000Z
modules/mdns/src/linux/Location.cpp
lubyk/lubyk
e4792099d61c460497aacda1a3c08f23f5bb84ed
[ "MIT" ]
2
2016-07-15T09:13:41.000Z
2019-09-17T11:38:21.000Z
modules/mdns/src/linux/Location.cpp
lubyk/lubyk
e4792099d61c460497aacda1a3c08f23f5bb84ed
[ "MIT" ]
4
2015-05-13T20:26:28.000Z
2021-12-03T09:28:52.000Z
/* ============================================================================== This file is part of the LUBYK project (http://lubyk.org) Copyright (c) 2007-2011 by Gaspard Bucher (http://teti.ch). ------------------------------------------------------------------------------ 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 "dub/dub.h" #include "mdns/Location.h" #include <sstream> #include <sys/types.h> #include <sys/socket.h> #include <netdb.h> namespace mdns { unsigned long Location::ip_from_hostname(const char *hostname) { struct addrinfo *result, *result0; unsigned long ip; int error; error = getaddrinfo(hostname, NULL, NULL, &result0); if (error) { throw dub::Exception("Could not resolve '%s' (%s).", hostname, gai_strerror(error)); return Location::NO_IP; } for (result = result0; result; result = result->ai_next) { if (result->ai_family == AF_INET) { // only support AF_INET for now (no IPv6) // sockaddr is a generic raw bunch of bytes, we must cast it first to // an IPv4 struct: struct sockaddr_in *ipv4 = (sockaddr_in*) result->ai_addr; // ip is in sin_addr // we must convert the 32-bit IP from network to host ip = ntohl(ipv4->sin_addr.s_addr); break; } } freeaddrinfo(result0); return ip; } } // mdns
34
88
0.638889
lubyk
e5009c9afd5e8a4a26d29c63fc49171a80100fd6
1,429
cpp
C++
source/utility.cpp
tigeroses/bwa-postalt
74bc52e931a03395708c5038394055a29f1babbf
[ "Unlicense" ]
2
2020-10-21T08:24:48.000Z
2022-01-17T10:04:44.000Z
source/utility.cpp
tigeroses/bwa-postalt
74bc52e931a03395708c5038394055a29f1babbf
[ "Unlicense" ]
null
null
null
source/utility.cpp
tigeroses/bwa-postalt
74bc52e931a03395708c5038394055a29f1babbf
[ "Unlicense" ]
null
null
null
#include "postalt/utility.h" #include <sstream> void split_str(const std::string& s, std::vector<std::string>& v, char c, bool skip_empty) { // std::istringstream iss(str); // std::vector< std::string > res; // for (std::string item; std::getline(iss, item, delim);) // if (skip_empty && item.empty()) // continue; // else // res.push_back(item); // return res; v.clear(); std::string::size_type pos1, pos2; pos2 = s.find(c); pos1 = 0; while(std::string::npos != pos2) { v.push_back(s.substr(pos1, pos2-pos1)); pos1 = pos2 + 1; pos2 = s.find(c, pos1); } if(pos1 != s.length()) v.push_back(s.substr(pos1)); } std::string cat_str(std::vector<std::string>& l, char sep, bool endline) { std::stringstream ss; for (size_t i = 0; i < l.size(); ++i) { ss << l[i]; if (i != (l.size()-1)) ss << sep; } if (endline) ss << '\n'; return ss.str(); } std::vector<std::pair<int, char>> parse_cigar(std::string& s) { std::vector<std::pair<int, char>> res; std::string len_str; for (auto& c : s) { if ('0' <= c && c <= '9') len_str += c; else { if (len_str.empty()) continue; res.push_back({std::stoi(len_str), c}); len_str.clear(); } } return res; }
21.984615
90
0.495451
tigeroses
e504faf3170b46bf9ef1bc054012488ac4b5f3cf
637
hpp
C++
vm/aging_space.hpp
dch/factor
faacbb58e0738a0612a04b792a3f6ff4929134ff
[ "BSD-2-Clause" ]
null
null
null
vm/aging_space.hpp
dch/factor
faacbb58e0738a0612a04b792a3f6ff4929134ff
[ "BSD-2-Clause" ]
null
null
null
vm/aging_space.hpp
dch/factor
faacbb58e0738a0612a04b792a3f6ff4929134ff
[ "BSD-2-Clause" ]
null
null
null
namespace factor { struct aging_space : bump_allocator { object_start_map starts; aging_space(cell size, cell start) : bump_allocator(size, start), starts(size, start) {} object* allot(cell size) { if (here + size > end) return NULL; object* obj = bump_allocator::allot(size); starts.record_object_start_offset(obj); return obj; } cell next_object_after(cell scan) { cell size = ((object*)scan)->size(); if (scan + size < here) return scan + size; else return 0; } cell first_object() { if (start != here) return start; else return 0; } }; }
18.2
59
0.613815
dch
e505696107be31a1e366450617a581df89690cc7
10,415
cpp
C++
kernel/src/physicalmemory.cpp
dennis95/dennix
8fee2b2158e350576935ddefa1a207000b9ae77f
[ "0BSD" ]
99
2016-11-02T20:04:44.000Z
2022-03-29T07:27:46.000Z
kernel/src/physicalmemory.cpp
dennis95/dennix
8fee2b2158e350576935ddefa1a207000b9ae77f
[ "0BSD" ]
30
2017-08-10T18:31:55.000Z
2022-03-01T14:10:25.000Z
kernel/src/physicalmemory.cpp
dennis95/dennix
8fee2b2158e350576935ddefa1a207000b9ae77f
[ "0BSD" ]
9
2016-11-01T09:16:42.000Z
2022-02-10T14:10:44.000Z
/* Copyright (c) 2016, 2017, 2018, 2019, 2020, 2021 Dennis Wölfing * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* kernel/src/physicalmemory.cpp * Physical memory management. */ #include <assert.h> #include <dennix/meminfo.h> #include <dennix/kernel/addressspace.h> #include <dennix/kernel/cache.h> #include <dennix/kernel/kthread.h> #include <dennix/kernel/panic.h> #include <dennix/kernel/physicalmemory.h> #include <dennix/kernel/syscall.h> class MemoryStack { public: MemoryStack(void* firstStackPage); void pushPageFrame(paddr_t physicalAddress, bool cache = false); paddr_t popPageFrame(bool cache = false); public: size_t framesOnStack; private: paddr_t* stack; vaddr_t lastStackPage; }; static CacheController* firstCache; static char firstStackPage[PAGESIZE] ALIGNED(PAGESIZE); static size_t framesAvailable; static size_t framesReserved; static MemoryStack memstack(firstStackPage); static size_t totalFrames; static kthread_mutex_t mutex = KTHREAD_MUTEX_INITIALIZER; #ifdef __x86_64__ static char firstStackPage32[PAGESIZE] ALIGNED(PAGESIZE); static MemoryStack memstack32(firstStackPage32); #define totalFramesOnStack (memstack.framesOnStack + memstack32.framesOnStack) #else #define totalFramesOnStack (memstack.framesOnStack) #endif extern "C" { extern symbol_t bootstrapBegin; extern symbol_t bootstrapEnd; extern symbol_t kernelPhysicalBegin; extern symbol_t kernelPhysicalEnd; } static inline bool isUsedByKernel(paddr_t physicalAddress) { return (physicalAddress >= (paddr_t) &bootstrapBegin && physicalAddress < (paddr_t) &bootstrapEnd) || (physicalAddress >= (paddr_t) &kernelPhysicalBegin && physicalAddress < (paddr_t) &kernelPhysicalEnd) || physicalAddress == 0; } static inline bool isUsedByModule(paddr_t physicalAddress, const multiboot_info* multiboot) { uintptr_t p = (uintptr_t) multiboot + 8; while (true) { const multiboot_tag* tag = (const multiboot_tag*) p; if (tag->type == MULTIBOOT_TAG_TYPE_MODULE) { const multiboot_tag_module* moduleTag = (const multiboot_tag_module*) tag; if (physicalAddress >= moduleTag->mod_start && physicalAddress < moduleTag->mod_end) { return true; } } if (tag->type == MULTIBOOT_TAG_TYPE_END) { return false; } p = ALIGNUP(p + tag->size, 8); } } static inline bool isUsedByMultiboot(paddr_t physicalAddress, paddr_t multibootPhys, paddr_t multibootEnd) { return physicalAddress >= multibootPhys && physicalAddress < multibootEnd; } void PhysicalMemory::initialize(const multiboot_info* multiboot) { uintptr_t p = (uintptr_t) multiboot + 8; const multiboot_tag* tag; while (true) { tag = (const multiboot_tag*) p; if (tag->type == MULTIBOOT_TAG_TYPE_MMAP) { break; } if (tag->type == MULTIBOOT_TAG_TYPE_END) { PANIC("Bootloader did not provide a memory map."); } p = ALIGNUP(p + tag->size, 8); } const multiboot_tag_mmap* mmapTag = (const multiboot_tag_mmap*) tag; vaddr_t mmap = (vaddr_t) mmapTag->entries; vaddr_t mmapEnd = mmap + (tag->size - sizeof(*mmapTag)); paddr_t multibootPhys = kernelSpace->getPhysicalAddress( (vaddr_t) multiboot & ~PAGE_MISALIGN); paddr_t multibootEnd = multibootPhys + ALIGNUP(multiboot->total_size + ((vaddr_t) multiboot & PAGE_MISALIGN), PAGESIZE); while (mmap < mmapEnd) { multiboot_mmap_entry* mmapEntry = (multiboot_mmap_entry*) mmap; if (mmapEntry->type == MULTIBOOT_MEMORY_AVAILABLE && mmapEntry->addr + mmapEntry->len <= UINTPTR_MAX) { paddr_t addr = (paddr_t) mmapEntry->addr; for (uint64_t i = 0; i < mmapEntry->len; i += PAGESIZE) { totalFrames++; if (isUsedByModule(addr + i, multiboot) || isUsedByKernel(addr + i) || isUsedByMultiboot(addr + i, multibootPhys, multibootEnd)) { continue; } pushPageFrame(addr + i); } } mmap += mmapTag->entry_size; } } MemoryStack::MemoryStack(void* firstStackPage) { stack = (paddr_t*) firstStackPage + 1; framesOnStack = 0; lastStackPage = (vaddr_t) firstStackPage; } void MemoryStack::pushPageFrame(paddr_t physicalAddress, bool cache /*= false*/) { if (((vaddr_t) (stack + 1) & PAGE_MISALIGN) == 0) { paddr_t* stackPage = (paddr_t*) ((vaddr_t) stack & ~PAGE_MISALIGN); if (*(stackPage + 1) == 0) { // We need to unlock the mutex because AddressSpace::mapPhysical // might need to pop page frames from the stack. kthread_mutex_unlock(&mutex); vaddr_t nextStackPage = kernelSpace->mapPhysical(physicalAddress, PAGESIZE, PROT_READ | PROT_WRITE); kthread_mutex_lock(&mutex); if (cache) framesAvailable--; if (unlikely(nextStackPage == 0)) { // If we cannot save the address, we have to leak it. return; } *((paddr_t*) lastStackPage + 1) = nextStackPage; *(vaddr_t*) nextStackPage = lastStackPage; *((paddr_t*) nextStackPage + 1) = 0; lastStackPage = nextStackPage; return; } else { stack = (paddr_t*) *(stackPage + 1) + 1; } } *++stack = physicalAddress; framesOnStack++; if (!cache) { framesAvailable++; } } void PhysicalMemory::pushPageFrame(paddr_t physicalAddress) { assert(physicalAddress); assert(PAGE_ALIGNED(physicalAddress)); AutoLock lock(&mutex); #ifdef __x86_64__ if (physicalAddress <= 0xFFFFF000) { memstack32.pushPageFrame(physicalAddress); return; } #endif memstack.pushPageFrame(physicalAddress); } paddr_t MemoryStack::popPageFrame(bool cache /*= false*/) { if (((vaddr_t) stack & PAGE_MISALIGN) < 2 * sizeof(paddr_t)) { paddr_t* stackPage = (paddr_t*) ((vaddr_t) stack & ~PAGE_MISALIGN); assert(*stackPage != 0); stack = (paddr_t*) (*stackPage + PAGESIZE - sizeof(paddr_t)); } framesOnStack--; if (!cache) { framesAvailable--; } return *stack--; } paddr_t PhysicalMemory::popPageFrame() { AutoLock lock(&mutex); if (framesAvailable - framesReserved == 0) return 0; if (totalFramesOnStack - framesReserved > 0) { if (memstack.framesOnStack > 0) { return memstack.popPageFrame(); } #ifdef __x86_64__ return memstack32.popPageFrame(); #endif } for (CacheController* cache = firstCache; cache; cache = cache->nextCache) { paddr_t result = cache->reclaimCache(); if (result) return result; } return 0; } #ifdef __x86_64__ paddr_t PhysicalMemory::popPageFrame32() { AutoLock lock(&mutex); if (memstack32.framesOnStack == 0) return 0; return memstack32.popPageFrame(); } #else paddr_t PhysicalMemory::popPageFrame32() { return popPageFrame(); } #endif paddr_t PhysicalMemory::popReserved() { AutoLock lock(&mutex); assert(framesReserved > 0); framesReserved--; #ifdef __x86_64__ if (memstack.framesOnStack > 0) { return memstack.popPageFrame(); } return memstack32.popPageFrame(); #else return memstack.popPageFrame(); #endif } bool PhysicalMemory::reserveFrames(size_t frames) { AutoLock lock(&mutex); if (framesAvailable - framesReserved < frames) return false; // Make sure that reserved frames on the stack because memory used for // caching can be unreclaimable for a short time frame. while (totalFramesOnStack < framesReserved + frames) { paddr_t address = 0; for (CacheController* cache = firstCache; cache; cache = cache->nextCache) { address = cache->reclaimCache(); if (address) break; } if (address) { #ifdef __x86_64__ if (address <= 0xFFFFF000) { memstack32.pushPageFrame(address, true); } else #endif memstack.pushPageFrame(address, true); } else { return false; } } framesReserved += frames; return true; } void PhysicalMemory::unreserveFrames(size_t frames) { AutoLock lock(&mutex); assert(framesReserved >= frames); framesReserved -= frames; } CacheController::CacheController() { nextCache = firstCache; firstCache = this; } paddr_t CacheController::allocateCache() { AutoLock lock(&mutex); if (framesAvailable - framesReserved == 0) { return 0; } if (totalFramesOnStack - framesReserved > 0) { if (memstack.framesOnStack > 0) { return memstack.popPageFrame(true); } #ifdef __x86_64__ return memstack32.popPageFrame(true); #endif } for (CacheController* cache = firstCache; cache; cache = cache->nextCache) { if (cache == this) continue; paddr_t result = cache->reclaimCache(); if (result) return result; } return reclaimCache(); } void CacheController::returnCache(paddr_t address) { AutoLock lock(&mutex); memstack.pushPageFrame(address, true); } void Syscall::meminfo(struct meminfo* info) { AutoLock lock(&mutex); info->mem_total = totalFrames * PAGESIZE; info->mem_free = totalFramesOnStack * PAGESIZE; info->mem_available = framesAvailable * PAGESIZE; info->__reserved = 0; }
29.672365
80
0.644263
dennis95
e505ff14c7a9605922d8bffdd13c4caccc58323b
206
cpp
C++
Classes/NeuralNetworks/NeuronLayer.cpp
Ervadar/SmartShooters
7f861ae62a9b9add00639a82d473bfa345a2470d
[ "MIT" ]
null
null
null
Classes/NeuralNetworks/NeuronLayer.cpp
Ervadar/SmartShooters
7f861ae62a9b9add00639a82d473bfa345a2470d
[ "MIT" ]
null
null
null
Classes/NeuralNetworks/NeuronLayer.cpp
Ervadar/SmartShooters
7f861ae62a9b9add00639a82d473bfa345a2470d
[ "MIT" ]
null
null
null
#include "NeuronLayer.h" NeuronLayer::NeuronLayer(int neuronCount, int inPutsPerNeuron) : neuronCount(neuronCount) { for (int i = 0; i < neuronCount; ++i) neurons.push_back(Neuron(inPutsPerNeuron)); }
22.888889
62
0.742718
Ervadar
e50612448af0ef739e67d81bdeac2c3d016b6d0a
7,340
cpp
C++
wxWidgets/UserInterface/AboutDialog.cpp
st-gb/CPUinfoAndControl
5e93d4a195b4692d147bb05cfef534e38d7f8b64
[ "MIT" ]
null
null
null
wxWidgets/UserInterface/AboutDialog.cpp
st-gb/CPUinfoAndControl
5e93d4a195b4692d147bb05cfef534e38d7f8b64
[ "MIT" ]
null
null
null
wxWidgets/UserInterface/AboutDialog.cpp
st-gb/CPUinfoAndControl
5e93d4a195b4692d147bb05cfef534e38d7f8b64
[ "MIT" ]
1
2021-07-16T21:01:26.000Z
2021-07-16T21:01:26.000Z
/* Do not remove this header/ copyright information. * * Copyright © Trilobyte Software Engineering GmbH, Berlin, Germany 2010-2011. * You are allowed to modify and use the source code from * Trilobyte Software Engineering GmbH, Berlin, Germany for free if you are not * making profit with it or its adaption. Else you may contact Trilobyte SE. */ /* * AboutDialog.cpp * * Created on: Oct 3, 2010 * Author: Stefan */ //class CPUcontrolBase::s_ar_tchInstableCPUcoreVoltageWarning #include <Controller/CPUcontrolBase.hpp> #include <Controller/MainController.hpp>//MainController::GetSupportedCPUs(...) #include <ModelData/ModelData.hpp> //class Model #include <preprocessor_macros/BuildTimeString.h> //BUILT_TIME #include <wxWidgets/UserInterface/AboutDialog.hpp> #include <wxWidgets/Controller/character_string/wxStringHelper.hpp> #include <wx/bitmap.h> //class wxBitmap //#include <wx/dialog.h> //for base class wxDialog //#include <wx/stattext.h> //class wxStaticText #include <wx/textctrl.h> //class wxTextCtrl #include <wx/statbmp.h> //class wxStaticBitmap #include <wx/string.h> //class wxString #include <wx/sizer.h> //class wxBoxSizer #include <compiler/GCC/enable_disable_write_strings_warning.h> //IGNORE_WRITE_STRINGS_WARNING //GCC_DIAG_ON(write-strings) //GCC_DIAG_PRAGMA(ignored GCC_DIAG_JOINSTR(-W,write-strings)) //GCC_DIAG_DO_PRAGMA(GCC diagnostic x) _Pragma("GCC diagnostic ignored \"-Wwrite-strings\"") #include <images/street_lamp_80x321_256_indexed_colors.xpm> ENABLE_WRITE_STRINGS_WARNING //Lebensweisheiten: wxString g_ar_wxstrWorldlyWisdom [] = { wxT("Happiness is only real when shared--Alexander Supertramp") , wxT("People (even criminal) usually are the result of the interaction " "between them and their environment") }; WORD g_wNumberOfWorldlyWisdomStrings = 2; wxString GetRandomWorldlyWisdom( const std::map<uint16_t,std::string> & c_r_std_set_WisdomStrings) { if( c_r_std_set_WisdomStrings.size() > 0 ) { //from http://www.cplusplus.com/reference/clibrary/cstdlib/rand/: /* initialize random seed: */ srand ( time(NULL) ); /* generate random number: */ int nRandomNumber = rand() % //g_wNumberOfWorldlyWisdomStrings; c_r_std_set_WisdomStrings.size(); // m_c_r_model_data.m_std_vec_WisdomStrings. return //g_ar_wxstrWorldlyWisdom[nRandomNumber]; wxWidgets::GetwxString_Inline(c_r_std_set_WisdomStrings.find( nRandomNumber)->second.c_str() ); } return wxT(""); } void GetAboutMessage(wxString & wxstrMessage, const std::map<uint16_t,std::string> & c_r_std_vec_WisdomStrings) { std::tstring stdtstr ; std::vector<std::tstring> stdvec_stdtstring ; // wxString wxstrMessage ; MainController::GetSupportedCPUs(stdvec_stdtstring) ; for(BYTE by = 0 ; by < stdvec_stdtstring.size() ; by ++ ) { stdtstr += _T("-") + stdvec_stdtstring.at(by) + _T("\n") ; } if( stdtstr.empty() ) wxstrMessage += _T("A tool for giving information about and controlling " "x86 CPUs"); else wxstrMessage += //We need a wxT()/ _T() macro (wide char-> L"", char->"") for EACH //line to make it compatible between char and wide char. wxT("A tool for giving information about and controlling x86 CPUs ") wxT("(built-in):\n") + stdtstr + wxT( "\n") wxT("and for other CPUs as dynamic library") ; wxstrMessage += wxT("\n\n") //"Build: " __DATE__ " " __TIME__ "GMT\n\n" //#ifdef _WIN32 // BUILT_TIME //+ _T("") + wxT("Build:") wxT(__DATE__) wxT(" ") wxT(__TIME__) wxT(" GMT + 1") //#endif wxT("\nbuilt with compiler version:") //_T( STRINGIFY(COMPILER_VERSION) ) //wxT("compiled/ built with:") #ifdef __MINGW32__ wxT("MinGW32 ") #endif #ifdef __GNUC__ wxT("GCC ") //wxT("version ") #endif wxT( COMPILER_VERSION_NUMBER ) wxT("\nusing wxWidgets " ) wxVERSION_NUM_DOT_STRING_T //COMPILER_VERSION wxT("\n\n"); //"AMD--smarter choice than Intel?\n\n" //"To ensure a stable operation:\n" // _T("To give important information (that already may be contained in ") // _T("the documentation):\n") // _T("When undervolting there may be system instability when switching ") // _T("from power supply operation to battery mode\n") // _T("So test for this case if needed: test for the different p-states, ") // _T("especially for the ones that are much undervolted.\n") wxstrMessage += CPUcontrolBase::s_ar_tchInstableCPUcoreVoltageWarning; wxstrMessage += wxT("\n\n") wxT("If the system is instable, heighten the voltage(s).\n") wxT("Note that the OS may freeze if changing voltages, so you may ") wxT("encounter data loss.\n->save all of your work before.\n\n") //" -when switching from power supply operation to battery,\n" //_T("Licence/ info: http://amd.goexchange.de / http://sw.goexchange.de") wxT("Licence/ info: http://www.trilobyte-se.de/x86iandc") wxT("\n\n") + GetRandomWorldlyWisdom(c_r_std_vec_WisdomStrings) ; } AboutDialog::AboutDialog( const Model & c_r_model_data, const wxString & cr_wxstrProgramName ) : wxDialog( NULL, wxID_ANY , _T("About ") + cr_wxstrProgramName, // ::GetwxString_Inline(c_r_model_data.m_stdtstrProgramName.c) wxDefaultPosition, // wxDefaultSize, wxSize(600, 400), wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER ), m_c_r_model_data(c_r_model_data) { wxString wxstrMessage ; GetAboutMessage(wxstrMessage, c_r_model_data.m_userinterfaceattributes. m_std_vec_WisdomStrings) ; wxBoxSizer * p_wxboxsizer = new wxBoxSizer(wxHORIZONTAL) ; wxTextCtrl * p_wxtextctrl = new //wxStaticText( wxTextCtrl( this, // NULL, wxID_ANY, wxstrMessage , wxDefaultPosition, wxDefaultSize #ifdef __WXGTK___ //http://docs.wxwidgets.org/trunk/classwx_static_text.html // #fcba401f2915146b1ce25b90c9499ccb: //"This function allows to set decorated static label text, when the //wxST_MARKUP style is used, on those platforms which support it //(currently only GTK+ 2). For the other platforms or when wxST_MARKUP is //not used, the markup is ignored" ,wxST_MARKUP // to allow to select and copy text. #endif , //prevent editing the text wxTE_READONLY | wxTE_MULTILINE ); // AddChild( p_wxtextctrl) ; p_wxboxsizer->Add(p_wxtextctrl, 1 //1=the control should take more space if the sizer is enlarged , wxEXPAND ); wxBitmap wxbitmapStreetLamp(street_lamp_80x321_256_indexed_colors_xpm); // wxPanel * p_wxpanel = new wxPanel(); // p_wxpanel->SetB //from http://ubuntuforums.org/archive/index.php/t-1486783.html //("[SOLVED] [C++/wx] wxStaticBitmap->SetBitmap(wxBitmap) = "Segmentation fault") wxStaticBitmap * p_wxstaticbitmap = new wxStaticBitmap//(); (this, wxID_ANY, wxbitmapStreetLamp); p_wxstaticbitmap->SetToolTip( wxT("a street lamp from former GDR " "symbolizing East Berlin")); // p_wxstaticbitmap->SetBitmap(wxbitmapStreetLamp); p_wxboxsizer->Add( p_wxstaticbitmap); SetSizer(p_wxboxsizer); // AddChild(p_wxstaticbitmap); // SetSizeHints(this); // Fit(this); //Force the neighbour controls of "voltage in volt" to be resized. Layout() ; } AboutDialog::~AboutDialog() { // TODO Auto-generated destructor stub }
35.119617
83
0.703951
st-gb
e5070f75689070b6c6d608fe5e799a91ea5c3dfc
13,280
cpp
C++
legacy/hershey-fonts.cpp
AnyTimeTraveler/ReMarkable2Typewriter
2ec4e124a5704de598cb1b5940ba40ad830240eb
[ "MIT" ]
null
null
null
legacy/hershey-fonts.cpp
AnyTimeTraveler/ReMarkable2Typewriter
2ec4e124a5704de598cb1b5940ba40ad830240eb
[ "MIT" ]
null
null
null
legacy/hershey-fonts.cpp
AnyTimeTraveler/ReMarkable2Typewriter
2ec4e124a5704de598cb1b5940ba40ad830240eb
[ "MIT" ]
null
null
null
#include "ccow.h" #include <stdlib.h> #include <string.h> #include <linux/input.h> // The font data here was modified from // http://paulbourke.net/dataformats/hershey/ // Compiled by Paul Bourke in 1997. static const int8_t hershey_font_simplex_compact[95][112] = { /* num_stroke_pts, width, stroke_data 21=top, 0=bottom */ /* Ascii 32 */ { 0, 16, }, /* ! Ascii 33 */ { 8, 10, 5,21,5,7,-1,-1,5,2,4,1,5,0,6,1,5,2,}, /* " Ascii 34 */ { 5, 16, 4,21,4,14,-1,-1,12,21,12,14,}, /* # Ascii 35 */ {11, 21, 11,25,4,-7,-1,-1,17,25,10,-7,-1,-1,4,12,18,12,-1,-1,3,6,17,6,}, /* $ Ascii 36 */ {26, 20, 8,25,8,-4,-1,-1,12,25,12,-4,-1,-1,17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3,}, /* % Ascii 37 */ {31, 24, 21,21,3,0,-1,-1,8,21,10,19,10,17,9,15,7,14,5,14,3,16,3,18,4,20,6,21,8,21,10,20,13,19,16,19,19,20,21,21,-1,-1,17,7,15,6,14,4,14,2,16,0,18,0,20,1,21,3,21,5,19,7,17,7,}, /* & Ascii 38 */ {34, 26, 23,12,23,13,22,14,21,14,20,13,19,11,17,6,15,3,13,1,11,0,7,0,5,1,4,2,3,4,3,6,4,8,5,9,12,13,13,14,14,16,14,18,13,20,11,21,9,20,8,18,8,16,9,13,11,10,16,3,18,1,20,0,22,0,23,1,23,2,}, /* ' Ascii 39 */ { 7, 10, 5,19,4,20,5,21,6,20,6,18,5,16,4,15,}, /* ( Ascii 40 */ {10, 14, 11,25,9,23,7,20,5,16,4,11,4,7,5,2,7,-2,9,-5,11,-7,}, /* ) Ascii 41 */ {10, 14, 3,25,5,23,7,20,9,16,10,11,10,7,9,2,7,-2,5,-5,3,-7,}, /* * Ascii 42 */ { 8, 16, 8,21,8,9,-1,-1,3,18,13,12,-1,-1,13,18,3,12,}, /* + Ascii 43 */ { 5, 26, 13,18,13,0,-1,-1,4,9,22,9,}, /* , Ascii 44 */ { 8, 10, 6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4,}, /* - Ascii 45 */ { 2, 26, 4,9,22,9,}, /* . Ascii 46 */ { 5, 10, 5,2,4,1,5,0,6,1,5,2,}, /* / Ascii 47 */ { 2, 22, 20,25,2,-7,}, /* 0 Ascii 48 */ {17, 20, 9,21,6,20,4,17,3,12,3,9,4,4,6,1,9,0,11,0,14,1,16,4,17,9,17,12,16,17,14,20,11,21,9,21,}, /* 1 Ascii 49 */ { 4, 20, 8,19,10,20,11,21,11,0,}, /* 2 Ascii 50 */ {14, 20, 4,16,4,17,5,19,6,20,8,21,12,21,14,20,15,19,16,17,16,15,15,13,13,10,3,0,17,0,}, /* 3 Ascii 51 */ {15, 20, 5,21,16,21,10,13,13,13,15,12,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4,}, /* 4 Ascii 52 */ { 6, 20, 13,21,3,7,18,7,-1,-1,13,21,13,0,}, /* 5 Ascii 53 */ {17, 20, 15,21,5,21,4,12,5,13,8,14,11,14,14,13,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4,}, /* 6 Ascii 54 */ {23, 20, 16,18,15,20,12,21,10,21,7,20,5,17,4,12,4,7,5,3,7,1,10,0,11,0,14,1,16,3,17,6,17,7,16,10,14,12,11,13,10,13,7,12,5,10,4,7,}, /* 7 Ascii 55 */ { 5, 20, 17,21,7,0,-1,-1,3,21,17,21,}, /* 8 Ascii 56 */ {29, 20, 8,21,5,20,4,18,4,16,5,14,7,13,11,12,14,11,16,9,17,7,17,4,16,2,15,1,12,0,8,0,5,1,4,2,3,4,3,7,4,9,6,11,9,12,13,13,15,14,16,16,16,18,15,20,12,21,8,21,}, /* 9 Ascii 57 */ {23, 20, 16,14,15,11,13,9,10,8,9,8,6,9,4,11,3,14,3,15,4,18,6,20,9,21,10,21,13,20,15,18,16,14,16,9,15,4,13,1,10,0,8,0,5,1,4,3,}, /* : Ascii 58 */ {11, 10, 5,14,4,13,5,12,6,13,5,14,-1,-1,5,2,4,1,5,0,6,1,5,2,}, /* ; Ascii 59 */ {14, 10, 5,14,4,13,5,12,6,13,5,14,-1,-1,6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4,}, /* < Ascii 60 */ { 3, 24, 20,18,4,9,20,0,}, /* = Ascii 61 */ { 5, 26, 4,12,22,12,-1,-1,4,6,22,6,}, /* > Ascii 62 */ { 3, 24, 4,18,20,9,4,0,}, /* ? Ascii 63 */ {20, 18, 3,16,3,17,4,19,5,20,7,21,11,21,13,20,14,19,15,17,15,15,14,13,13,12,9,10,9,7,-1,-1,9,2,8,1,9,0,10,1,9,2,}, /* @ Ascii 64 */ {55, 27, 18,13,17,15,15,16,12,16,10,15,9,14,8,11,8,8,9,6,11,5,14,5,16,6,17,8,-1,-1,12,16,10,14,9,11,9,8,10,6,11,5,-1,-1,18,16,17,8,17,6,19,5,21,5,23,7,24,10,24,12,23,15,22,17,20,19,18,20,15,21,12,21,9,20,7,19,5,17,4,15,3,12,3,9,4,6,5,4,7,2,9,1,12,0,15,0,18,1,20,2,21,3,-1,-1,19,16,18,8,18,6,19,5,}, /* A Ascii 65 */ { 8, 18, 9,21,1,0,-1,-1,9,21,17,0,-1,-1,4,7,14,7,}, /* B Ascii 66 */ {23, 21, 4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,-1,-1,4,11,13,11,16,10,17,9,18,7,18,4,17,2,16,1,13,0,4,0,}, /* C Ascii 67 */ {18, 21, 18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,}, /* D Ascii 68 */ {15, 21, 4,21,4,0,-1,-1,4,21,11,21,14,20,16,18,17,16,18,13,18,8,17,5,16,3,14,1,11,0,4,0,}, /* E Ascii 69 */ {11, 19, 4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11,-1,-1,4,0,17,0,}, /* F Ascii 70 */ { 8, 18, 4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11,}, /* G Ascii 71 */ {22, 21, 18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,18,8,-1,-1,13,8,18,8,}, /* H Ascii 72 */ { 8, 22, 4,21,4,0, -1,-1 ,4,11,18,11, -1,-1, 18,21,18,0, }, /* I Ascii 73 */ { 2, 8, 4,21,4,0,}, /* J Ascii 74 */ {10, 16, 12,21,12,5,11,2,10,1,8,0,6,0,4,1,3,2,2,5,2,7,}, /* K Ascii 75 */ { 8, 21, 4,21,4,0,-1,-1,18,21,4,7,-1,-1,9,12,18,0,}, /* L Ascii 76 */ { 5, 17, 4,21,4,0,-1,-1,4,0,16,0,}, /* M Ascii 77 */ { 8, 24, 4,0,4,21, 4,21,12,0, 12,0,20,21, 20,21,20,0,}, /* N Ascii 78 */ { 6, 22, 4,0,4,21, 4,21,18,0, 18,0,18,21,}, /* O Ascii 79 */ {21, 22, 9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21,}, /* P Ascii 80 */ {13, 21, 4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,14,17,12,16,11,13,10,4,10,}, /* Q Ascii 81 */ {24, 22, 9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21,-1,-1,12,4,18,-2,}, /* R Ascii 82 */ {16, 21, 4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,4,11,-1,-1,11,11,18,0,}, /* S Ascii 83 */ {20, 20, 17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3,}, /* T Ascii 84 */ { 5, 16, 8,21,8,0,-1,-1,1,21,15,21,}, /* U Ascii 85 */ {10, 22, 4,21,4,6,5,3,7,1,10,0,12,0,15,1,17,3,18,6,18,21,}, /* V Ascii 86 */ { 5, 18, 1,21,9,0,-1,-1,17,21,9,0,}, /* W Ascii 87 */ {11, 24, 2,21,7,0,-1,-1,12,21,7,0,-1,-1,12,21,17,0,-1,-1,22,21,17,0,}, /* X Ascii 88 */ { 5, 20, 3,21,17,0,-1,-1,17,21,3,0,}, /* Y Ascii 89 */ { 6, 18, 1,21,9,11,17,21, -1,-1, 9,11,9,0}, /* Z Ascii 90 */ { 6, 20, 3,21,17,21, 17,21,3,0, 3,0,17,0,}, /* [ Ascii 91 */ { 4, 14, 11,25,4,25,4,-7,11,-7,}, /* \ Ascii 92 */ { 2, 14, 0,21,14,-3,}, /* ] Ascii 93 */ { 4, 14, 3,25,10,25,10,-7,3,-7}, /* ^ Ascii 94 */ {10, 16, 6,15,8,18,10,15,-1,-1,3,12,8,17,13,12,-1,-1,8,17,8,0,}, /* _ Ascii 95 */ { 2, 16, 0,-2,16,-2,}, /* ` Ascii 96 */ { 7, 10, 6,21,5,20,4,18,4,16,5,15,6,16,5,17,}, /* a Ascii 97 */ {17, 19, 15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3, -1,-1,15,14,15,0,}, /* b Ascii 98 */ {17, 19, 4,21,4,0,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3,}, /* c Ascii 99 */ {14, 18, 15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3,}, /* d Ascii 100 */ {17, 19, 15,21,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3,}, /* e Ascii 101 */ {17, 18, 3,8,15,8,15,10,14,12,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3,}, /* f Ascii 102 */ { 8, 12, 10,21,8,21,6,20,5,17,5,0,-1,-1,2,14,9,14,}, /* g Ascii 103 */ {22, 19, 15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3, -1,-1,15,14,15,-2,14,-5,13,-6,11,-7,8,-7,6,-6,}, /* h Ascii 104 */ {10, 19, 4,21,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0,}, /* i Ascii 105 */ { 8, 8, 3,21,4,20,5,21,4,22,3,21,-1,-1,4,14,4,0,}, /* j Ascii 106 */ {11, 10, 5,21,6,20,7,21,6,22,5,21,-1,-1,6,14,6,-3,5,-6,3,-7,1,-7,}, /* k Ascii 107 */ { 8, 17, 4,21,4,0,-1,-1,14,14,4,4,-1,-1,8,8,15,0,}, /* l Ascii 108 */ { 2, 8, 4,21,4,0,}, /* m Ascii 109 */ {18, 30, 4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0,-1,-1,15,10,18,13,20,14,23,14,25,13,26,10,26,0,}, /* n Ascii 110 */ {10, 19, 4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0,}, /* o Ascii 111 */ {17, 19, 8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3,16,6,16,8,15,11,13,13,11,14,8,14,}, /* p Ascii 112 */ {17, 19, 4,14,4,-7,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3,}, /* q Ascii 113 */ {17, 19, 15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3, -1,-1,15,14,15,-7,}, /* r Ascii 114 */ { 8, 13, 4,14,4,0,-1,-1,4,8,5,11,7,13,9,14,12,14,}, /* s Ascii 115 */ {17, 17, 14,11,13,13,10,14,7,14,4,13,3,11,4,9,6,8,11,7,13,6,14,4,14,3,13,1,10,0,7,0,4,1,3,3,}, /* t Ascii 116 */ { 8, 12, 5,21,5,4,6,1,8,0,10,0,-1,-1,2,14,9,14,}, /* u Ascii 117 */ {10, 19, 4,14,4,4,5,1,7,0,10,0,12,1,15,4,-1,-1,15,14,15,0,}, /* v Ascii 118 */ { 5, 16, 2,14,8,0,-1,-1,14,14,8,0,}, /* w Ascii 119 */ { 5, 22, 3,14,7,0,11,14,15,0,19,14,}, /* x Ascii 120 */ { 5, 17, 3,14,14,0,-1,-1,14,14,3,0,}, /* y Ascii 121 */ { 9, 16, 2,14,8,0,-1,-1,14,14,8,0,6,-4,4,-6,2,-7,1,-7,}, /* z Ascii 122 */ { 6, 17, 3,14,14,14, 14,14,3,0, 3,0,14,0,}, /* { Ascii 123 */ {39, 14, 9,25,7,24,6,23,5,21,5,19,6,17,7,16,8,14,8,12,6,10,-1,-1,7,24,6,22,6,20,7,18,8,17,9,15,9,13,8,11,4,9,8,7,9,5,9,3,8,1,7,0,6,-2,6,-4,7,-6,-1,-1,6,8,8,6,8,4,7,2,6,1,5,-1,5,-3,6,-5,7,-6,9,-7,}, /* | Ascii 124 */ { 2, 8, 4,25,4,-7,}, /* } Ascii 125 */ {39, 14, 5,25,7,24,8,23,9,21,9,19,8,17,7,16,6,14,6,12,8,10,-1,-1,7,24,8,22,8,20,7,18,6,17,5,15,5,13,6,11,10,9,6,7,5,5,5,3,6,1,7,0,8,-2,8,-4,7,-6,-1,-1,8,8,6,6,6,4,7,2,8,1,9,-1,9,-3,8,-5,7,-6,5,-7,}, /* ~ Ascii 126 */ {23, 24, 3,6,3,8,4,11,6,12,8,12,10,11,14,8,16,7,18,7,20,8,21,10,-1,-1,3,8,4,10,6,11,8,11,10,10,14,7,16,6,18,6,20,7,21,10,21,12,}, }; const int8_t* get_font_char(const char* font_name, char ascii_value, int& out_num_verts, int& out_horiz_dist) { if (1 || !strcmp(font_name, "hershey")) { if (ascii_value >= 32 && ascii_value <= 126) { const int8_t* char_data = hershey_font_simplex_compact[ascii_value - 32]; out_num_verts = char_data[0]; out_horiz_dist = char_data[1]; return char_data + 2; } } return NULL; } char keycode_to_ascii(int keycode, int mods) { if (mods & (MOD_CTRL|MOD_ALT)) { // Do whatever we want here. Maybe launch VNC? return 0; } switch (keycode) { case KEY_SEMICOLON: return (mods & MOD_SHIFT) ? ':' : ';'; break; case KEY_LEFTBRACE: return (mods & MOD_SHIFT) ? '{' : '['; break; case KEY_RIGHTBRACE: return (mods & MOD_SHIFT) ? '}' : ']'; break; case KEY_MINUS: return (mods & MOD_SHIFT) ? '_' : '-'; break; case KEY_EQUAL: return (mods & MOD_SHIFT) ? '+' : '='; break; case KEY_APOSTROPHE: return (mods & MOD_SHIFT) ? '\"' : '\''; break; case KEY_GRAVE: return (mods & MOD_SHIFT) ? '~' : '`'; break; case KEY_BACKSLASH: return (mods & MOD_SHIFT) ? '|' : '\\'; break; case KEY_COMMA: return (mods & MOD_SHIFT) ? '<' : ','; break; case KEY_DOT: return (mods & MOD_SHIFT) ? '>' : '.'; break; case KEY_SLASH: return (mods & MOD_SHIFT) ? '?' : '/'; break; case KEY_SPACE: return ' '; break; case KEY_0: return (mods & MOD_SHIFT) ? ')' : '0'; break; case KEY_1: return (mods & MOD_SHIFT) ? '!' : '1'; break; case KEY_2: return (mods & MOD_SHIFT) ? '@' : '2'; break; case KEY_3: return (mods & MOD_SHIFT) ? '#' : '3'; break; case KEY_4: return (mods & MOD_SHIFT) ? '$' : '4'; break; case KEY_5: return (mods & MOD_SHIFT) ? '%' : '5'; break; case KEY_6: return (mods & MOD_SHIFT) ? '^' : '6'; break; case KEY_7: return (mods & MOD_SHIFT) ? '&' : '7'; break; case KEY_8: return (mods & MOD_SHIFT) ? '*' : '8'; break; case KEY_9: return (mods & MOD_SHIFT) ? '(' : '9'; break; case KEY_A: return (mods & MOD_CAPS) ? 'A' : 'a'; break; case KEY_B: return (mods & MOD_CAPS) ? 'B' : 'b'; break; case KEY_C: return (mods & MOD_CAPS) ? 'C' : 'c'; break; case KEY_D: return (mods & MOD_CAPS) ? 'D' : 'd'; break; case KEY_E: return (mods & MOD_CAPS) ? 'E' : 'e'; break; case KEY_F: return (mods & MOD_CAPS) ? 'F' : 'f'; break; case KEY_G: return (mods & MOD_CAPS) ? 'G' : 'g'; break; case KEY_H: return (mods & MOD_CAPS) ? 'H' : 'h'; break; case KEY_I: return (mods & MOD_CAPS) ? 'I' : 'i'; break; case KEY_J: return (mods & MOD_CAPS) ? 'J' : 'j'; break; case KEY_K: return (mods & MOD_CAPS) ? 'K' : 'k'; break; case KEY_L: return (mods & MOD_CAPS) ? 'L' : 'l'; break; case KEY_M: return (mods & MOD_CAPS) ? 'M' : 'm'; break; case KEY_N: return (mods & MOD_CAPS) ? 'N' : 'n'; break; case KEY_O: return (mods & MOD_CAPS) ? 'O' : 'o'; break; case KEY_P: return (mods & MOD_CAPS) ? 'P' : 'p'; break; case KEY_Q: return (mods & MOD_CAPS) ? 'Q' : 'q'; break; case KEY_R: return (mods & MOD_CAPS) ? 'R' : 'r'; break; case KEY_S: return (mods & MOD_CAPS) ? 'S' : 's'; break; case KEY_T: return (mods & MOD_CAPS) ? 'T' : 't'; break; case KEY_U: return (mods & MOD_CAPS) ? 'U' : 'u'; break; case KEY_V: return (mods & MOD_CAPS) ? 'V' : 'v'; break; case KEY_W: return (mods & MOD_CAPS) ? 'W' : 'w'; break; case KEY_X: return (mods & MOD_CAPS) ? 'X' : 'x'; break; case KEY_Y: return (mods & MOD_CAPS) ? 'Y' : 'y'; break; case KEY_Z: return (mods & MOD_CAPS) ? 'Z' : 'z'; break; default: return 0; break; } }
71.397849
318
0.511521
AnyTimeTraveler
e50aed423e5cdbe81d5eaf3e19783ae564f3dbf0
3,310
hpp
C++
DoremiEditor/DRMEditorPlugin/Include/Plugin.hpp
meraz/doremi
452d08ebd10db50d9563c1cf97699571889ab18f
[ "MIT" ]
1
2020-03-23T15:42:05.000Z
2020-03-23T15:42:05.000Z
DoremiEditor/DRMEditorPlugin/Include/Plugin.hpp
Meraz/ssp15
452d08ebd10db50d9563c1cf97699571889ab18f
[ "MIT" ]
null
null
null
DoremiEditor/DRMEditorPlugin/Include/Plugin.hpp
Meraz/ssp15
452d08ebd10db50d9563c1cf97699571889ab18f
[ "MIT" ]
1
2020-03-23T15:42:06.000Z
2020-03-23T15:42:06.000Z
#pragma once // some definitions for the DLL to play nice with Maya #define NT_PLUGIN #define REQUIRE_IOSTREAM #define EXPORT __declspec(dllexport) #include <stdlib.h> #include <iostream> #include <string> #include <vector> #include <queue> #include <maya/MEvent.h> #include <maya/MFnPlugin.h> #include <maya/MFnMesh.h> #include <maya/MFnTransform.h> #include <maya/MFloatPointArray.h> #include <maya/MPointArray.h> #include <maya/MIntArray.h> #include <maya/MPoint.h> #include <maya/MMatrix.h> #include <maya/MFloatMatrix.h> #include <maya/MEulerRotation.h> #include <maya/MVector.h> #include <maya/MItDag.h> #include <maya/MFnCamera.h> #include <maya/M3dView.h> #include <maya/MItMeshPolygon.h> #include <maya/MPlugArray.h> #include <maya/MFnDependencyNode.h> #include <maya/MFnLambertShader.h> #include <maya/MFnBlinnShader.h> #include <maya/MFnPhongShader.h> #include <maya/MImage.h> #include <maya/MFnPointLight.h> #include <maya/MSelectionList.h> #include <maya/MItDependencyNodes.h> #include <maya/MFnDirectionalLight.h> #include <maya/MFnSpotLight.h> #include <maya/MFnPointLight.h> #include <maya/M3dView.h> #include <maya/MTransformationMatrix.h> #include <maya/MMatrix.h> // Wrappers #include <maya/MGlobal.h> #include <maya/MCallbackIdArray.h> // Messages #include <maya/MMessage.h> #include <maya/MTimerMessage.h> #include <maya/MDGMessage.h> #include <maya/MEventMessage.h> #include <maya/MPolyMessage.h> #include <maya/MNodeMessage.h> #include <maya/MDagPath.h> #include <maya/MDagMessage.h> #include <maya/MUiMessage.h> #include <maya/MModelMessage.h> #include <maya/MCameraSetMessage.h> #include <maya/MLockMessage.h> #include <FileMap.hpp> // Commands #include <maya/MPxCommand.h> std::vector<std::string> msgTypeVector; FileMapping fileMap; M3dView modelPanel; MDagPath activeCamera; bool debug; MCallbackId _CBid; MCallbackIdArray _CBidArray; std::vector<MeshInfo> meshVector; std::vector<TransformInfo> transVector; std::vector<CameraInfo> camVector; std::vector<LightInfo> lightVector; std::vector<MaterialInfo> materialVector; std::vector<MessageInfo> msgVector; std::queue<MessageInfo> msgQueue; void cbReparent(MDagPath& child, MDagPath& parent, void* clientData); void cbMeshAttribute(MNodeMessage::AttributeMessage msg, MPlug& plug_1, MPlug& plug_2, void* clientData); void cbMessageTimer(float elapsedTime, float lastTime, void* clientData); void cbNewNode(MObject& node, void* clientData); void cbTransformModified(MNodeMessage::AttributeMessage msg, MPlug& plug_1, MPlug& plug_2, void* clientData); void cbNameChange(MObject& node, const MString& str, void* clientData); void cbMeshAttributeChange(MNodeMessage::AttributeMessage msg, MPlug& plug_1, MPlug& plug_2, void* clientData); void cbMaterialAttribute(MNodeMessage::AttributeMessage msg, MPlug& plug_1, MPlug& plug_2, void* clientData); void mAddNode(char* name, int type, int vertCount = 0, char* childname = nullptr); void mAddMessage(std::string name, int msgType, int nodeType, std::string oldName = ""); void loadScene(); bool deleteNode(); bool renameNode(MString newName, MString oldName, int type); MeshInfo outMeshData(std::string name, bool getDynamicData = true); void outTransFormData(MObject& obj); void outMeshData(MObject& obj); void outCameraData(MObject& obj); void outLightData(MObject& obj);
31.226415
111
0.779758
meraz
e511d3a85184f777397408c078e6e30f5a3b2ce0
747
cpp
C++
FuegoUniversalComponent/fuego/smartgame/SgGtpUtil.cpp
GSMgeeth/gameofgo
51563fea15fbdca797afb7cf9a29773a313e5697
[ "Apache-2.0" ]
13
2016-09-09T13:45:42.000Z
2021-12-17T08:42:28.000Z
FuegoUniversalComponent/fuego/smartgame/SgGtpUtil.cpp
GSMgeeth/gameofgo
51563fea15fbdca797afb7cf9a29773a313e5697
[ "Apache-2.0" ]
1
2016-06-18T05:19:58.000Z
2016-09-15T18:21:54.000Z
FuegoUniversalComponent/fuego/smartgame/SgGtpUtil.cpp
cbordeman/gameofgo
51563fea15fbdca797afb7cf9a29773a313e5697
[ "Apache-2.0" ]
5
2016-11-19T03:05:12.000Z
2022-01-31T12:20:40.000Z
//---------------------------------------------------------------------------- /** @file SgGtpUtil.cpp */ //---------------------------------------------------------------------------- #include "SgSystem.h" #include "SgGtpUtil.h" #include "SgPointSet.h" #include "../gtpengine/GtpEngine.h" using namespace std; //---------------------------------------------------------------------------- void SgGtpUtil::RespondPointSet(GtpCommand& cmd, const SgPointSet& pointSet) { bool isFirst = true; for (SgSetIterator it(pointSet); it; ++it) { if (! isFirst) cmd << ' '; isFirst = false; cmd << SgWritePoint(*it); } } //----------------------------------------------------------------------------
25.758621
78
0.348059
GSMgeeth
e5120f54c6135ec4bb6213f5704b8feb2dc53299
783
cc
C++
src/event/UpdateQuestEvent.cc
kallentu/pathos
1914edbccc98baef79d98fb065119230072ac40d
[ "MIT" ]
7
2019-05-09T15:38:55.000Z
2021-12-07T03:13:29.000Z
src/event/UpdateQuestEvent.cc
kallentu/pathos
1914edbccc98baef79d98fb065119230072ac40d
[ "MIT" ]
1
2019-06-20T03:01:18.000Z
2019-06-20T03:01:18.000Z
src/event/UpdateQuestEvent.cc
kallentu/pathos
1914edbccc98baef79d98fb065119230072ac40d
[ "MIT" ]
null
null
null
#include "event/UpdateQuestEvent.h" #include "core/PathosInstance.h" #include "quest/Quest.h" #include "quest/QuestManager.h" #include "request/ClearEntireStatus.h" #include "request/MultipleRequest.h" #include "request/QuestRequest.h" using namespace Pathos; void UpdateQuestEvent::begin(PathosInstance *inst) { // Update the conditions and status of the quest if they changed. quest->updateQuestStatus(inst); // Clear prior main and quick status since we moved. // Update view depending on quest progress. std::unique_ptr<MultipleRequest> request = std::make_unique<MultipleRequest>(); request->addRequest(std::make_unique<ClearEntireStatus>()); request->addRequest(quest->getQuestGiver()->retrieveQuestRequestWithInstance(inst)); inst->notify(request.get()); }
35.590909
86
0.771392
kallentu
e512309ffc3a487f30bd5f06a8324322bc587518
3,653
cpp
C++
matlab_code/jjcao_code-head/toolbox/jjcao_img/superpixel/TurboPixels64/DT.cpp
joycewangsy/normals_pointnet
fc74a8ed1a009b18785990b1b4c20eda0549721c
[ "MIT" ]
4
2018-12-07T12:47:13.000Z
2021-12-21T08:46:50.000Z
matlab_code/jjcao_code-head/toolbox/jjcao_img/superpixel/TurboPixels64/DT.cpp
joycewangsy/normals_pointnet
fc74a8ed1a009b18785990b1b4c20eda0549721c
[ "MIT" ]
null
null
null
matlab_code/jjcao_code-head/toolbox/jjcao_img/superpixel/TurboPixels64/DT.cpp
joycewangsy/normals_pointnet
fc74a8ed1a009b18785990b1b4c20eda0549721c
[ "MIT" ]
2
2018-10-29T09:29:19.000Z
2021-12-21T08:46:52.000Z
/************************************************************************ File: 2D_DT_Library.c Author(s): Alexander Vasilevskiy Created: 24 May 2000 Last Revision: $Date$ Description: $Revision$ $Log$ Copyright (c) 2000 by Alexander Vasilevskiy, Centre for Intelligent Machines, McGill University, Montreal, QC. Please see the copyright notice included in this distribution for full details. ***********************************************************************/ #include <stdio.h> #include <math.h> #include "mex.h" #define INFINITY 999999 // detects edges between black and white regions void EdgeDetect(double *in,double *out,int WIDTH,int HEIGHT){ int x,y; for(y=0; y <HEIGHT; y++) { for(x=0; x<WIDTH; x++) { if ((x==0)||(y==0)||(y==HEIGHT-1)||(x==WIDTH-1)) out[y*WIDTH + x]=INFINITY; else if ( (in[y*WIDTH + x]!=INFINITY)&& ((in[(y-1)*WIDTH + x]==INFINITY)|| (in[(y+1)*WIDTH + x]==INFINITY)|| (in[y*WIDTH + x+1]==INFINITY)|| (in[y*WIDTH + x-1]==INFINITY))) out[y*WIDTH + x]=0; else out[y*WIDTH + x]=INFINITY; } } } // assignes sign to distance transform void PutSign(double *in,double *out,int WIDTH,int HEIGHT){ for(int j=0; j<HEIGHT; j++) for(int i=0; i<WIDTH; i++) if (in[j*WIDTH + i] == INFINITY) out[j*WIDTH + i]=-out[j*WIDTH + i]; } double MINforward(double *in,double d1,double d2,int i,int j,int WIDTH,int HEIGHT){ double mask[5]; double min=INFINITY; int k; if ((i>0)&&(j>0)) mask[0]=in[(j-1)*WIDTH + (i-1)]+d2; else mask[0]=INFINITY; if (j>0) mask[1]=in[(j-1)*WIDTH + i]+d1; else mask[1]=INFINITY; if ((i<WIDTH-1)&&(j>0)) mask[2]=in[(j-1)*WIDTH + i+1]+d2; else mask[2]=INFINITY; mask[3]=in[j*WIDTH + i]; if (i>0) mask[4]=in[j*WIDTH + i-1]+d1; else mask[4]=INFINITY; for(k=0;k<5;k++) if (mask[k]<min) min=mask[k]; return min; } double MINbackward(double *in,double d1,double d2,int i,int j,int WIDTH,int HEIGHT){ double mask[5]; double min=INFINITY; int k; mask[0]=in[j*WIDTH + i]; if (i<WIDTH-1) mask[1]=in[j*WIDTH + i+1]+d1; else mask[1]=INFINITY; if ((j<HEIGHT-1)&&(i<WIDTH-1)) mask[2]=in[(j+1)*WIDTH + i+1]+d2; else mask[2]=INFINITY; if (j<HEIGHT-1) mask[3]=in[(j+1)*WIDTH + i]+d1; else mask[3]=INFINITY; if ((i>0)&&(j<HEIGHT-1)) mask[4]=in[(j+1)*WIDTH + i-1]+d2; else mask[4]=INFINITY; for(k=0;k<5;k++) if (mask[k]<min) min=mask[k]; return min; } void nNeighbor(double *in,double d1,double d2,int WIDTH,int HEIGHT){ int i,j; for (j=0;j<HEIGHT;j++) for(i=0;i<WIDTH;i++) in[j*WIDTH + i] = MINforward(in,d1,d2,i,j,WIDTH,HEIGHT); for (j=HEIGHT-1;j>-1;j--) for(i=WIDTH-1;i>-1;i--) in[j*WIDTH + i]=MINbackward(in,d1,d2,i,j,WIDTH,HEIGHT); } void ComputeDistanceTransform(double *in,double *out,int WIDTH,int HEIGHT) { EdgeDetect(in,out,WIDTH,HEIGHT); nNeighbor(out,1,1.351,WIDTH,HEIGHT); PutSign(in,out,WIDTH,HEIGHT); } void mexFunction( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { double *in, *out; int iWidth, iHeight; /* Check for proper number of arguments. */ if (nrhs != 1) { mexErrMsgTxt("One input required."); } else if (nlhs > 1) { mexErrMsgTxt("Too many output arguments"); } /* The input must be a noncomplex scalar double.*/ iWidth = mxGetM(prhs[0]); iHeight = mxGetN(prhs[0]); /* Create matrix for the return argument. */ plhs[0] = mxCreateDoubleMatrix(iWidth,iHeight, mxREAL); /* Assign pointers to each input and output. */ in = mxGetPr(prhs[0]); out = mxGetPr(plhs[0]); ComputeDistanceTransform(in, out, iWidth, iHeight); }
28.76378
92
0.590747
joycewangsy
e513202516c94c89356fb1297517db0ea937e398
9,369
cpp
C++
synthts_et/lib/etana/chklyh3.cpp
martnoumees/synthts_et
8845b33514edef3e54ae0b45404615704c418142
[ "Unlicense" ]
19
2015-10-27T22:21:49.000Z
2022-02-07T11:54:35.000Z
synthts_vr/lib/etana/chklyh3.cpp
ikiissel/synthts_vr
33f2686dc9606aa95697ac0cf7e9031668bc34e8
[ "Unlicense" ]
8
2015-10-28T08:38:08.000Z
2021-03-25T21:26:59.000Z
synthts_vr/lib/etana/chklyh3.cpp
ikiissel/synthts_vr
33f2686dc9606aa95697ac0cf7e9031668bc34e8
[ "Unlicense" ]
11
2016-01-03T11:47:08.000Z
2021-03-17T18:59:54.000Z
/* * kontrollib, kas S6na on suurt�hel. lyhend mingi l�puga; * n�iteks: * * USA-ni, USAni, SS-lane, SSlane, IRA-meelne * */ #include "mrf-mrf.h" #include "mittesona.h" int MORF0::chklyh3(MRFTULEMUSED *tulemus, FSXSTRING *S6na, int sygavus, int *tagasitasand) { int i; int res; FSXSTRING tmpsona, tmplopp, tmpliik, vorminimi; //int tulem = -1; //FS_Failure; const FSxCHAR *vn; FSXSTRING s; // sona ise FSXSTRING kriips(FSxSTR("")); // kriips (kui teda on) FSXSTRING lopp; // l�pp ise FSXSTRING ne_lopp; // line lane lopu jaoks FSXSTRING lali; // line lane alguse jaoks FSXSTRING ss; // int s_pik; int tyyp=0; #define LYHEND 1 #define PROTSENT 2 #define KELL 3 #define PARAGRAHV 4 #define NUMBER 5 #define KRAAD 6 #define MATA 6 // if ( !ChIsUpper(*S6na) && *S6na != '%' && *S6na != para) /* ei alga suure t�hega */ // if (!TaheHulgad::OnSuur(S6na, 0) && (*S6na)[0] != (FSxCHAR)'%' && (*S6na)[0] != TaheHulgad::para[0] if (TaheHulgad::AintSuuredjaNrjaKriipsud(S6na)) /* v�ib olla lihtsalt suuret�heline s�na */ return ALL_RIGHT; /* ei suru v�gisi l�hendiks */ s = (const FSxCHAR *)S6na->SpanIncluding((const FSxCHAR *)(TaheHulgad::protsendinumber)); if (s.GetLength() != 0) if (TaheHulgad::OnLopus(&s, FSxSTR("%")) || TaheHulgad::OnLopus(&s, FSxSTR("%-"))) tyyp = PROTSENT; if (!TaheHulgad::OnSuur(S6na, 0) && tyyp != PROTSENT && (*S6na)[0] != TaheHulgad::para[0] ) return ALL_RIGHT; if (!tyyp) { s = (const FSxCHAR *)(S6na->SpanIncluding((const FSxCHAR *)(TaheHulgad::kraadinumber))); if (s.GetLength() != 0) if (TaheHulgad::OnLopus(&s, (const FSxCHAR *)(TaheHulgad::kraad)) || TaheHulgad::OnLopus(&s, (const FSxCHAR *)(TaheHulgad::kraadjakriips)) ) tyyp = KRAAD; } if (!tyyp) { s = (const FSxCHAR *)(S6na->SpanIncluding((const FSxCHAR *)(TaheHulgad::paranumber))); if (s.GetLength() != 0) if (TaheHulgad::OnAlguses(&s, (const FSxCHAR *)(TaheHulgad::para))) tyyp = PARAGRAHV; } if (!tyyp) { s = (const FSxCHAR *)(S6na->SpanIncluding((const FSxCHAR *)(TaheHulgad::matemaatika1))); if (s.GetLength() == 2 && TaheHulgad::OnLopus(&s, FSxSTR("-"))) tyyp = MATA; } if (!tyyp) { s = (const FSxCHAR *)(S6na->SpanIncluding((const FSxCHAR *)(TaheHulgad::suurnrthtkriips))); ss = (const FSxCHAR *)(S6na->SpanIncluding((const FSxCHAR *)(TaheHulgad::kellanumber))); if (s.GetLength() > ss.GetLength()) tyyp = LYHEND; else if (ss.GetLength() != 0 && s.GetLength() <= ss.GetLength()) { s = ss; tyyp = KELL; } } if (!tyyp) // ei saa olla... return ALL_RIGHT; s_pik = s.GetLength(); lopp = (const FSxCHAR *)(S6na->Mid(s_pik)); if (lopp.GetLength()==0) // pole siin midagi vaadata return ALL_RIGHT; kriips = (const FSxCHAR *)(s.Mid(s_pik-1)); if (kriips != FSxSTR("-")) kriips = FSxSTR(""); if (tyyp == LYHEND && kriips == FSxSTR("")) // ebakindel v�rk { if (s.GetLength()==1) // nt Arike return ALL_RIGHT; i = s.ReverseFind(FSxSTR("-")); if (i == s.GetLength()-2) return ALL_RIGHT; // nt CD-Romile } s.TrimRight(FSxSTR("-")); if (s.GetLength()==0) // pole siin midagi vaadata return ALL_RIGHT; if (TaheHulgad::PoleMuudKui(&s, &TaheHulgad::number)) tyyp = NUMBER; /* oletan, et on lyhend vm lubatud asi */ i = 1; if (tyyp == LYHEND) { if(mrfFlags.Chk(MF_LYHREZH)) { if (s.GetLength() == 1 || (!mrfFlags.Chk(MF_SPELL) && s.GetLength() < 7)) i = 1; else i = (dctLoend[3])[(FSxCHAR *)(const FSxCHAR *)s]; } } // *(S6na+k) = taht; /* taastan esialgse sona */ if (i==-1) /* pole lyhend */ return ALL_RIGHT; if ((s.GetLength() > 1 && tyyp == LYHEND && (TaheHulgad::OnAlguses(&lopp, FSxSTR("la")) || TaheHulgad::OnAlguses(&lopp, FSxSTR("li"))) ) || ((tyyp == NUMBER || tyyp == PROTSENT || tyyp == KRAAD) && TaheHulgad::OnAlguses(&lopp, FSxSTR("li"))) ) { ne_lopp = (const FSxCHAR *)(lopp.Mid(2)); lali = (const FSxCHAR *)(lopp.Left(2)); vn = nLopud.otsi_ne_vorm((const FSxCHAR *)ne_lopp); if (vn != NULL) /* ongi line lise ... voi lane lase ... */ { vorminimi = vn; vorminimi += FSxSTR(", "); tmpsona = s; if (kriips.GetLength() == 1 && !mrfFlags.Chk(MF_ALGV)) tmpsona += kriips; else tmpsona += FSxSTR("="); tmpsona += lali; if (mrfFlags.Chk(MF_ALGV) || vorminimi == FSxSTR("sg n, ")) tmpsona += FSxSTR("ne"); else { if (TaheHulgad::OnAlguses(&vorminimi, FSxSTR("pl")) || TaheHulgad::OnAlguses(&vorminimi, FSxSTR("sg p"))) tmpsona += FSxSTR("s"); else tmpsona += FSxSTR("se"); } if (ne_lopp == FSxSTR("ne") || ne_lopp == FSxSTR("se")) tmplopp = FSxSTR("0"); else if (ne_lopp == FSxSTR("st")) tmplopp = FSxSTR("t"); else if (TaheHulgad::OnAlguses(&vorminimi, FSxSTR("sg"))) tmplopp = (const FSxCHAR *)(ne_lopp.Mid(2)); else tmplopp = (const FSxCHAR *)(ne_lopp.Mid(1)); if (lali == FSxSTR("la")) tmpliik = FSxSTR("S"); else tmpliik = FSxSTR("A"); tulemus->Add((const FSxCHAR *)tmpsona, (const FSxCHAR *)tmplopp, FSxSTR(""), (const FSxCHAR *)tmpliik, (FSxCHAR *)(const FSxCHAR *)vorminimi); *tagasitasand = 1; return ALL_RIGHT; } } vn = nLopud.otsi_lyh_vorm((const FSxCHAR *)lopp); if (vn == NULL) { if (tyyp == LYHEND && (kriips.GetLength() != 0 || mrfFlags.Chk(MF_OLETA)) && // LYH-sona !TaheHulgad::OnAlguses(&lopp, FSxSTR("lise")) && !TaheHulgad::OnAlguses(&lopp, FSxSTR("lasi")) ) { res = chkwrd(tulemus, &lopp, lopp.GetLength(), sygavus, tagasitasand, LIIK_SACU); if (res > ALL_RIGHT) return res; /* viga! */ if ( tulemus->on_tulem() ) /* analyys �nnestus */ { s += kriips; tulemus->LisaTyvedeleEtte((const FSxCHAR *)s); } } return ALL_RIGHT; } if (tyyp != LYHEND) return ALL_RIGHT; /* vist lihtne l�pp */ *tagasitasand = 1; if (TaheHulgad::OnAlguses(&lopp, FSxSTR("te")) )// akronyymidele sellised lopud ei sobi return ALL_RIGHT; if (lopp == FSxSTR("i")) vorminimi = FSxSTR("adt, sg g, sg p, "); else if (lopp == FSxSTR("d")) vorminimi = FSxSTR("pl n, sg p, "); else { vorminimi = vn; vorminimi += FSxSTR(", "); } FSxCHAR vi; FSXSTRING fl; vi = s[s.GetLength()-1]; fl = FSxSTR("FLMNRS"); if (vi == (FSxCHAR)'J'); // jott voi dzhei; iga lopp sobib... else if (TaheHulgad::para.Find(vi) != -1 || vi == (FSxCHAR)'%') { if (lopp == FSxSTR("d")) vorminimi = FSxSTR("pl n, "); } else if (fl.Find(vi) != -1) { if (!mrfFlags.Chk(MF_OLETA)) { if (!TaheHulgad::OnAlguses(&lopp, FSxSTR("i")) && !TaheHulgad::OnAlguses(&lopp, FSxSTR("e"))) return ALL_RIGHT; // yldse ei sobinud } else if (lopp == FSxSTR("d")) vorminimi = FSxSTR("pl n, "); } else { //vi = s.SuurPisiks(s.GetLength()-1); // tahan lihtsalt vi pisiks teha vi = TaheHulgad::SuurPisiks(&s, s.GetLength()-1); // tahan lihtsalt vi pisiks teha if (TaheHulgad::taish.Find(vi) != -1) // lyh lopus vokaal { if (TaheHulgad::OnAlguses(&lopp, FSxSTR("i")) || TaheHulgad::OnAlguses(&lopp, FSxSTR("e"))) return ALL_RIGHT; // yldse ei sobinud } if (!mrfFlags.Chk(MF_OLETA)) { if (s.GetLength() == 1) { if (TaheHulgad::OnAlguses(&lopp, FSxSTR("i")) || TaheHulgad::OnAlguses(&lopp, FSxSTR("e"))) return ALL_RIGHT; // yldse ei sobinud } else { FSxCHAR eelvi; eelvi = TaheHulgad::SuurPisiks(&s, s.GetLength()-2); if (TaheHulgad::taish.Find(eelvi)==-1 && s != FSxSTR("GOST") && s != FSxSTR("GATT") && s != FSxSTR("SAPARD") && s != FSxSTR("SARS")) if (TaheHulgad::OnAlguses(&lopp, FSxSTR("i")) || TaheHulgad::OnAlguses(&lopp, FSxSTR("e"))) return ALL_RIGHT; // yldse ei sobinud } } } tulemus->Add((const FSxCHAR *)s, (const FSxCHAR *)lopp, FSxSTR(""), FSxSTR("Y"), (const FSxCHAR *)vorminimi); return ALL_RIGHT; }
37.931174
141
0.501441
martnoumees
e513e8f35d55b6333b9fc172319f6ab34fc57a86
2,181
cpp
C++
tests/dsp_dotproductscalling_tests.cpp
jontio/JSquelch
72805d6e08035daca09e6c668c63f46dc66674a2
[ "MIT" ]
2
2021-07-11T03:36:42.000Z
2022-03-26T15:04:30.000Z
tests/dsp_dotproductscalling_tests.cpp
jontio/JSquelch
72805d6e08035daca09e6c668c63f46dc66674a2
[ "MIT" ]
null
null
null
tests/dsp_dotproductscalling_tests.cpp
jontio/JSquelch
72805d6e08035daca09e6c668c63f46dc66674a2
[ "MIT" ]
null
null
null
#include "../src/dsp/dsp.h" #include "../src/util/RuntimeError.h" #include "../src/util/stdio_utils.h" #include <random> //important for Qt include cpputest last as it mucks up new and causes compiling to fail #include "CppUTest/TestHarness.h" TEST_GROUP(Test_DSP_DotProductScalling) { double double_tolerance=0.00001; void setup() { } void teardown() { // This gets run after every test } }; TEST(Test_DSP_DotProductScalling, ScaleTest) { JDsp::OverlappedRealFFT fft(128); JDsp::MovingSignalEstimator mse(fft.getOutSize(),8,3,96,62,8); //normally distributed numbers for the signal std::default_random_engine generator(1); std::normal_distribution<double> distribution(0.0,1.0); QVector<JFFT::cpx_type> expected_complex; QVector<double> expected; QVector<JFFT::cpx_type> actual_complex; QVector<double> actual; QVector<double> x(fft.getInSize()); for(int k=0;k<20;k++) { for(int i=0;i<x.size();i++)x[i]=distribution(generator); CHECK(x.size()==fft.getInSize()); fft<<x; CHECK(mse.val.size()==fft.getOutSize()); mse<<fft; QVector<double> a=fft.Xabs; for(int m=0;m<a.size();m++)a[m]*=mse[m]; expected+=a; QVector<JFFT::cpx_type> b=fft.Xfull; for(int m=0;m<mse.val.size();m++) { CHECK(m<b.size()); b[m]*=mse[m]; } for(int m=1;m<mse.val.size()-1;m++) { CHECK((b.size()-m)>=0); CHECK(m<mse.val.size()); b[b.size()-m]*=mse[m]; } expected_complex+=b; fft*=mse; actual+=fft.Xabs; actual_complex+=fft.Xfull; } CHECK(actual.size()==expected.size()); CHECK(actual_complex.size()==expected_complex.size()); for(int k=0;k<actual.size();k++) { DOUBLES_EQUAL(expected[k],actual[k],double_tolerance); } for(int k=0;k<actual_complex.size();k++) { DOUBLES_EQUAL(expected_complex[k].real(),actual_complex[k].real(),double_tolerance); DOUBLES_EQUAL(expected_complex[k].imag(),actual_complex[k].imag(),double_tolerance); } }
24.505618
92
0.596974
jontio
e514c32bc4403e8764cc047eaae816e6164f1e18
2,326
cpp
C++
src/ComposerGUI/composer/package/form/delegate/editor/Author.cpp
composer-gui/composer-gui
2a488db4c6828fee0f36682d0b0edc96d359b4c3
[ "BSD-3-Clause" ]
13
2019-04-01T07:54:05.000Z
2022-03-27T16:55:59.000Z
src/ComposerGUI/composer/package/form/delegate/editor/Author.cpp
informaticacba/composer-gui
2a488db4c6828fee0f36682d0b0edc96d359b4c3
[ "BSD-3-Clause" ]
null
null
null
src/ComposerGUI/composer/package/form/delegate/editor/Author.cpp
informaticacba/composer-gui
2a488db4c6828fee0f36682d0b0edc96d359b4c3
[ "BSD-3-Clause" ]
1
2022-03-27T16:56:02.000Z
2022-03-27T16:56:02.000Z
#include <QFormLayout> #include <QDialogButtonBox> #include <QPushButton> #include "Author.h" namespace composer_gui { namespace composer { namespace package { namespace form { namespace delegate { namespace editor { Author::Author(QWidget *parent) : QDialog(parent) { m_name = new QLineEdit; m_role = new QLineEdit; m_email = new QLineEdit; m_homepage = new QLineEdit; m_mapper = new QDataWidgetMapper(this); m_mapper->setSubmitPolicy(QDataWidgetMapper::ManualSubmit); QFormLayout *editorLayout = new QFormLayout; editorLayout->addRow("Name:", m_name); editorLayout->addRow("Role:", m_role); editorLayout->addRow("Email:", m_email); editorLayout->addRow("Homepage:", m_homepage); QDialogButtonBox *buttonBox = new QDialogButtonBox(this); buttonBox->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok); okButton->setEnabled(false); auto validator = [this, okButton] { bool isAllEmpty = m_name->text().trimmed().isEmpty() && m_role->text().trimmed().isEmpty() && m_email->text().trimmed().isEmpty() && m_homepage->text().trimmed().isEmpty(); okButton->setEnabled(!isAllEmpty); }; connect(m_name, &QLineEdit::textChanged, validator); connect(m_role, &QLineEdit::textChanged, validator); connect(m_email, &QLineEdit::textChanged, validator); connect(m_homepage, &QLineEdit::textChanged, validator); editorLayout->addWidget(buttonBox); connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept); connect(buttonBox, &QDialogButtonBox::accepted, m_mapper, &QDataWidgetMapper::submit); connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject); setLayout(editorLayout); } void Author::setModelIndex(const QModelIndex &index) { m_mapper->setModel(const_cast<QAbstractItemModel *>(index.model())); m_mapper->addMapping(m_name, 0); m_mapper->addMapping(m_role, 1); m_mapper->addMapping(m_email, 2); m_mapper->addMapping(m_homepage, 3); m_mapper->setCurrentModelIndex(index); } } // editor } // delegate } // form } // package } // composer } // composer_gui
28.365854
90
0.678418
composer-gui
e51a15cf4157104113eade2da5910a59e7dcd9dc
8,827
cpp
C++
apps/edges/src/main.cpp
jpjodoin/litiv
435556bea20d60816aff492f50587b1a2d748b21
[ "BSD-3-Clause" ]
97
2015-10-16T04:32:33.000Z
2022-03-29T07:04:02.000Z
apps/edges/src/main.cpp
jpjodoin/litiv
435556bea20d60816aff492f50587b1a2d748b21
[ "BSD-3-Clause" ]
19
2016-07-01T16:37:02.000Z
2020-09-10T06:09:39.000Z
apps/edges/src/main.cpp
jpjodoin/litiv
435556bea20d60816aff492f50587b1a2d748b21
[ "BSD-3-Clause" ]
41
2015-11-17T05:59:23.000Z
2022-02-16T09:30:28.000Z
// This file is part of the LITIV framework; visit the original repository at // https://github.com/plstcharles/litiv for more information. // // Copyright 2015 Pierre-Luc St-Charles; pierre-luc.st-charles<at>polymtl.ca // // 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 "litiv/datasets.hpp" #include "litiv/imgproc.hpp" //////////////////////////////// #define WRITE_IMG_OUTPUT 0 #define EVALUATE_OUTPUT 0 #define DISPLAY_OUTPUT 1 //////////////////////////////// #define USE_CANNY 0 #define USE_LBSP 1 //////////////////////////////// #define FULL_THRESH_ANALYSIS 1 //////////////////////////////// #define DATASET_ID Dataset_BSDS500 // comment this line to fall back to custom dataset definition #define DATASET_OUTPUT_PATH "results_test" // will be created in the app's working directory if using a custom dataset #define DATASET_PRECACHING 1 #define DATASET_SCALE_FACTOR 1.0 #define DATASET_WORKTHREADS 1 //////////////////////////////// #if (USE_CANNY+USE_LBSP)!=1 #error "Must specify a single algorithm." #endif //USE_... #ifndef DATASET_ID #define DATASET_ID Dataset_Custom #define DATASET_PARAMS \ "####", /* => const std::string& sDatasetName */ \ "####", /* => const std::string& sDatasetDirPath */ \ DATASET_OUTPUT_PATH, /* => const std::string& sOutputDirPath */ \ std::vector<std::string>{"###","###","###","..."}, /* => const std::vector<std::string>& vsWorkBatchDirs */ \ std::vector<std::string>{"###","###","###","..."}, /* => const std::vector<std::string>& vsSkippedDirTokens */ \ bool(WRITE_IMG_OUTPUT), /* => bool bSaveOutput */ \ bool(EVALUATE_OUTPUT), /* => bool bUseEvaluator */ \ false, /* => bool bForce4ByteDataAlign */ \ DATASET_SCALE_FACTOR /* => double dScaleFactor */ #else //defined(DATASET_ID) #define DATASET_PARAMS \ DATASET_OUTPUT_PATH, /* => const std::string& sOutputDirName */ \ bool(WRITE_IMG_OUTPUT), /* => bool bSaveOutput */ \ bool(EVALUATE_OUTPUT), /* => bool bUseEvaluator */ \ DATASET_SCALE_FACTOR /* => double dScaleFactor */ #endif //defined(DATASET_ID) void Analyze(std::string sWorkerName, lv::IDataHandlerPtr pBatch); using DatasetType = lv::Dataset_<lv::DatasetTask_EdgDet,lv::DATASET_ID,lv::NonParallel>; #if USE_CANNY using EdgeDetectorType = EdgeDetectorCanny; #elif USE_LBSP using EdgeDetectorType = EdgeDetectorLBSP; #endif //USE_... int main(int, char**) { try { DatasetType::Ptr pDataset = DatasetType::create(DATASET_PARAMS); lv::IDataHandlerPtrArray vpBatches = pDataset->getBatches(false); const size_t nTotPackets = pDataset->getInputCount(); const size_t nTotBatches = vpBatches.size(); if(nTotBatches==0 || nTotPackets==0) lvError_("Could not parse any data for dataset '%s'",pDataset->getName().c_str()); std::cout << "\n[" << lv::getTimeStamp() << "]\n" << std::endl; std::cout << "Executing algorithm with " << DATASET_WORKTHREADS << " thread(s)..." << std::endl; lv::WorkerPool<DATASET_WORKTHREADS> oPool; std::vector<std::future<void>> vTaskResults; size_t nCurrBatchIdx = 1; for(lv::IDataHandlerPtr pBatch : vpBatches) vTaskResults.push_back(oPool.queueTask(Analyze,std::to_string(nCurrBatchIdx++)+"/"+std::to_string(nTotBatches),pBatch)); for(std::future<void>& oTaskRes : vTaskResults) oTaskRes.get(); pDataset->writeEvalReport(); } catch(const lv::Exception&) {std::cout << "\n!!!!!!!!!!!!!!\nTop level caught lv::Exception (check stderr)\n!!!!!!!!!!!!!!\n" << std::endl; return -1;} catch(const cv::Exception&) {std::cout << "\n!!!!!!!!!!!!!!\nTop level caught cv::Exception (check stderr)\n!!!!!!!!!!!!!!\n" << std::endl; return -1;} catch(const std::exception& e) {std::cout << "\n!!!!!!!!!!!!!!\nTop level caught std::exception:\n" << e.what() << "\n!!!!!!!!!!!!!!\n" << std::endl; return -1;} catch(...) {std::cout << "\n!!!!!!!!!!!!!!\nTop level caught unhandled exception\n!!!!!!!!!!!!!!\n" << std::endl; return -1;} std::cout << "\n[" << lv::getTimeStamp() << "]\n" << std::endl; return 0; } void Analyze(std::string sWorkerName, lv::IDataHandlerPtr pBatch) { srand(0); // for now, assures that two consecutive runs on the same data return the same results //srand((unsigned int)time(NULL)); try { DatasetType::WorkBatch& oBatch = dynamic_cast<DatasetType::WorkBatch&>(*pBatch); lvAssert(oBatch.getInputPacketType()==lv::ImagePacket && oBatch.getOutputPacketType()==lv::ImagePacket); lvAssert(oBatch.getImageCount()>=1); lvAssert(oBatch.isInputInfoConst()); if(DATASET_PRECACHING) oBatch.startPrecaching(!bool(EVALUATE_OUTPUT)); const std::string sCurrBatchName = lv::clampString(oBatch.getName(),12); std::cout << "\t\t" << sCurrBatchName << " @ init [" << sWorkerName << "]" << std::endl; const size_t nTotPacketCount = oBatch.getImageCount(); size_t nCurrIdx = 0; cv::Mat oCurrInput = oBatch.getInput(nCurrIdx).clone(); lvAssert(!oCurrInput.empty() && oCurrInput.isContinuous()); cv::Mat oCurrEdgeMask; std::shared_ptr<IEdgeDetector> pAlgo = std::make_shared<EdgeDetectorType>(); #if !FULL_THRESH_ANALYSIS const double dDefaultThreshold = pAlgo->getDefaultThreshold(); #endif //(!FULL_THRESH_ANALYSIS) #if DISPLAY_OUTPUT>0 lv::DisplayHelperPtr pDisplayHelper = lv::DisplayHelper::create(oBatch.getName(),oBatch.getOutputPath()+"../"); pAlgo->m_pDisplayHelper = pDisplayHelper; #endif //DISPLAY_OUTPUT>0 oBatch.startProcessing(); while(nCurrIdx<nTotPacketCount) { //if(!((nCurrIdx+1)%100)) std::cout << "\t\t" << sCurrBatchName << " @ F:" << std::setfill('0') << std::setw(lv::digit_count((int)nTotPacketCount)) << nCurrIdx+1 << "/" << nTotPacketCount << " [" << sWorkerName << "]" << std::endl; oCurrInput = oBatch.getInput(nCurrIdx); #if FULL_THRESH_ANALYSIS pAlgo->apply(oCurrInput,oCurrEdgeMask); #else //(!FULL_THRESH_ANALYSIS) pAlgo->apply_threshold(oCurrInput,oCurrEdgeMask,dDefaultThreshold); #endif //(!FULL_THRESH_ANALYSIS) #if DISPLAY_OUTPUT>0 pDisplayHelper->display(oCurrInput,oCurrEdgeMask,oBatch.getColoredMask(oCurrEdgeMask,nCurrIdx),nCurrIdx); const int nKeyPressed = pDisplayHelper->waitKey(); if(nKeyPressed==(int)'q') break; #endif //DISPLAY_OUTPUT>0 oBatch.push(oCurrEdgeMask,nCurrIdx++); } oBatch.stopProcessing(); const double dTimeElapsed = oBatch.getFinalProcessTime(); const double dProcessSpeed = (double)nCurrIdx/dTimeElapsed; std::cout << "\t\t" << sCurrBatchName << " @ end [" << sWorkerName << "] (" << std::fixed << std::setw(4) << dTimeElapsed << " sec, " << std::setw(4) << dProcessSpeed << " Hz)" << std::endl; oBatch.writeEvalReport(); // this line is optional; it allows results to be read before all batches are processed } catch(const lv::Exception&) {std::cout << "\nAnalyze caught lv::Exception (check stderr)\n" << std::endl;} catch(const cv::Exception&) {std::cout << "\nAnalyze caught cv::Exception (check stderr)\n" << std::endl;} catch(const std::exception& e) {std::cout << "\nAnalyze caught std::exception:\n" << e.what() << "\n" << std::endl;} catch(...) {std::cout << "\nAnalyze caught unhandled exception\n" << std::endl;} try { if(pBatch->isProcessing()) dynamic_cast<DatasetType::WorkBatch&>(*pBatch).stopProcessing(); } catch(...) { std::cout << "\nAnalyze caught unhandled exception while attempting to stop batch processing.\n" << std::endl; throw; } }
56.583333
223
0.599977
jpjodoin
e520970cd0b5454c8070fe722b2332d5f606b64f
245
cpp
C++
Math/CountDivisorsOfaNum.cpp
tarek99samy/Competitive-Programming
22fa7e9001e6a3606b346d1f56c71344401ea55c
[ "MIT" ]
3
2020-01-03T11:38:45.000Z
2021-03-13T13:34:50.000Z
Math/CountDivisorsOfaNum.cpp
tarek99samy/Competitive-Programming
22fa7e9001e6a3606b346d1f56c71344401ea55c
[ "MIT" ]
null
null
null
Math/CountDivisorsOfaNum.cpp
tarek99samy/Competitive-Programming
22fa7e9001e6a3606b346d1f56c71344401ea55c
[ "MIT" ]
3
2019-04-19T23:28:42.000Z
2019-10-16T19:38:57.000Z
// Returns The Number Of divisors of a given number. // O(sqrt(n)) ll CountDivisors(ll n){ ll cnt = 0 ; ll i ; for (i = 1; i * i <= n; ++i) if (n % i == 0) cnt+=2 ; if(i*i==n) cnt++; return cnt; }
18.846154
52
0.440816
tarek99samy
e524c12a99f73b8e48c1b69cbb2a8c54845f42ac
871
cpp
C++
USACO/friday.cpp
tico88612/Solution-Note
31a9d220fd633c6920760707a07c9a153c2f76cc
[ "MIT" ]
1
2018-02-11T09:41:54.000Z
2018-02-11T09:41:54.000Z
USACO/friday.cpp
tico88612/Solution-Note
31a9d220fd633c6920760707a07c9a153c2f76cc
[ "MIT" ]
null
null
null
USACO/friday.cpp
tico88612/Solution-Note
31a9d220fd633c6920760707a07c9a153c2f76cc
[ "MIT" ]
null
null
null
/* ID: tico8861 TASK: friday LANG: C++ */ /* LANG can be C++11 or C++14 for those more recent releases */ #include <iostream> #include <fstream> #include <string> #include <map> using namespace std; bool isleap(int year){ if((year%400==0)||(year%4==0&&year%100)) return true; return false; } int main() { ofstream fout ("friday.out"); ifstream fin ("friday.in"); int N; fin >> N; int now=1; int day[7]={0}; int norm[12]={31,28,31,30,31,30,31,31,30,31,30,31}; int leap[12]={31,29,31,30,31,30,31,31,30,31,30,31}; for(int year=1900;year<1900+N;year++){ for(int i=0;i<12;i++){ int a=(now+12)%7; day[a]++; if(isleap(year)) now+=leap[i]; else now+=norm[i]; } } fout<<day[6]; for(int i=0;i<6;i++){ fout<<" "<<day[i]; } fout<<endl; return 0; }
19.795455
63
0.529277
tico88612
e5268d4cebb5c6389eed22bcbb395a2fc6876e11
2,344
cpp
C++
codes/CF/CF_840D.cpp
chessbot108/solved-problems
0945be829a8ea9f0d5896c89331460d70d076691
[ "MIT" ]
2
2021-03-07T03:34:02.000Z
2021-03-09T01:22:21.000Z
codes/CF/CF_840D.cpp
chessbot108/solved-problems
0945be829a8ea9f0d5896c89331460d70d076691
[ "MIT" ]
1
2021-03-27T15:01:23.000Z
2021-03-27T15:55:34.000Z
codes/CF/CF_840D.cpp
chessbot108/solved-problems
0945be829a8ea9f0d5896c89331460d70d076691
[ "MIT" ]
1
2021-03-27T05:02:33.000Z
2021-03-27T05:02:33.000Z
#include <iostream> #include <cstdio> #include <cstring> #include <cstdlib> #include <ctime> #include <cmath> #include <cassert> #include <algorithm> #include <vector> #include <string> #include <map> #include <set> #include <sstream> #include <list> #include <queue> #include <stack> //#include <unordered_map> //#include <unordered_set> #include <functional> #define max_v 310000 #define LOGN 50 #define int_max 0x3f3f3f3f #define cont continue #define byte_max 0x3f #define pow_2(n) (1 << (n)) //tree #define lsb(n) ((n)&(-(n))) #define LC(n) (((n) << 1) | 1) #define RC(n) (((n) << 1) + 2) using namespace std; void setIO(const string& file_name){ freopen((file_name+".in").c_str(), "r", stdin); freopen((file_name+".out").c_str(), "w+", stdout); } int sum[max_v * LOGN], lc[max_v * LOGN], rc[max_v * LOGN]; int arr[max_v * 2], srt[max_v * 2], root[max_v * 2], n, s, ind, ans; void dup(int& k){ ind++; sum[ind] = sum[k]; lc[ind] = lc[k]; rc[ind] = rc[k]; k = ind; } int get_ind(int key){ return lower_bound(srt, srt + n, key) - &srt[0]; } void U(int p, int val, int& k, int L, int R){ if(p < L || R <= p || R <= L) return ; dup(k); if(L + 1 == R){ sum[k] += val; return ; } int mid = (L + R) / 2; U(p, val, lc[k], L, mid); U(p, val, rc[k], mid, R); sum[k] = sum[lc[k]] + sum[rc[k]]; } void dfs(int k1, int k2, int kth, int L, int R){ if(R <= L || sum[k2] - sum[k1] < kth) return ; if(L + 1 == R){ if(sum[k2] - sum[k1] >= kth) ans = min(ans, L); return ; } int mid = (L + R) / 2; dfs(lc[k1], lc[k2], kth, L, mid); if(ans == int_max) dfs(rc[k1], rc[k2], kth, mid, R); } void pre_process(){ s = pow_2((int)(ceil(log2(n)))); ind = s*2; root[0] = 0; for(int i = 0; i < s - 1; i++){ lc[i] = LC(i); rc[i] = RC(i); srt[i] = arr[i]; } sort(srt, srt + n); for(int i = 1; i<=n; i++){ root[i] = root[i - 1]; U(get_ind(arr[i - 1]), 1, root[i], 0, s); } } int main(){ int q; scanf("%d%d", &n, &q); for(int i = 0; i<n; i++){ scanf("%d", &arr[i]); } pre_process(); while(q--){ int a, b, c; ans = int_max; scanf("%d%d%d", &a, &b, &c); int kth = (b - a + 1)/ c + 1; dfs(root[a - 1], root[b], kth, 0, s); if(ans == int_max) printf("-1\n"); else printf("%d\n", srt[ans]); } return 0; }
18.603175
68
0.523038
chessbot108
e528077d1b8c81dbc32a70d1bf246b991b20bf81
447
cpp
C++
JetBrainsFileWatcher/main.cpp
SineStriker/fsnotifier
38e8253e6a164f760e5e42bf2f4ba9e63d3fb0f6
[ "Apache-2.0" ]
4
2022-03-07T01:47:19.000Z
2022-03-07T12:24:48.000Z
JetBrainsFileWatcher/main.cpp
SineStriker/fsnotifier
38e8253e6a164f760e5e42bf2f4ba9e63d3fb0f6
[ "Apache-2.0" ]
null
null
null
JetBrainsFileWatcher/main.cpp
SineStriker/fsnotifier
38e8253e6a164f760e5e42bf2f4ba9e63d3fb0f6
[ "Apache-2.0" ]
null
null
null
#include "MainWindow.h" #include <QApplication> #include <QDir> #include "FileSystemNotifier.h" #include "JetBrainsFileWatcher/JBFileWatcherUtils.h" int main(int argc, char *argv[]) { QApplication a(argc, argv); // QDir dir(a.applicationDirPath()); // dir.cdUp(); // FileSystemNotifier::setExecutableFilePath(dir.path() + "/fsnotifier.exe"); FileSystemNotifier n; MainWindow w; w.show(); return a.exec(); }
18.625
81
0.673378
SineStriker
e5302d82ddf800a058fb520ecac13ab522c99827
1,194
cpp
C++
Foundation/src/DirectoryIterator_VMS.cpp
abyss7/poco
a651a78c76eebd414b37745f7dd8539460154cab
[ "BSL-1.0" ]
null
null
null
Foundation/src/DirectoryIterator_VMS.cpp
abyss7/poco
a651a78c76eebd414b37745f7dd8539460154cab
[ "BSL-1.0" ]
3
2021-06-02T02:59:06.000Z
2021-09-16T04:35:06.000Z
Foundation/src/DirectoryIterator_VMS.cpp
abyss7/poco
a651a78c76eebd414b37745f7dd8539460154cab
[ "BSL-1.0" ]
6
2021-06-02T02:39:34.000Z
2022-03-29T05:51:57.000Z
// // DirectoryIterator_VMS.cpp // // Library: Foundation // Package: Filesystem // Module: DirectoryIterator // // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. // and Contributors. // // SPDX-License-Identifier: BSL-1.0 // #include "Poco/DirectoryIterator_VMS.h" #include "Poco/Path.h" #include "Poco/Exception.h" #include <iodef.h> #include <atrdef.h> #include <fibdef.h> #include <starlet.h> namespace Poco { DirectoryIteratorImpl::DirectoryIteratorImpl(const std::string& path): _rc(1) { Path p(path); p.makeDirectory(); _search = p.toString(); _search.append("*.*;*"); _fab = cc$rms_fab; _fab.fab$l_fna = (char*) _search.c_str(); _fab.fab$b_fns = _search.size(); _fab.fab$l_nam = &_nam; _nam = cc$rms_nam; _nam.nam$l_esa = _spec; _nam.nam$b_ess = sizeof(_spec); if (sys$parse(&_fab) & 1) throw OpenFileException(path); next(); } DirectoryIteratorImpl::~DirectoryIteratorImpl() { } const std::string& DirectoryIteratorImpl::next() { if (sys$search(&_fab) & 1) _current.clear(); else _current.assign(_fab.fab$l_nam->nam$l_name, _fab.fab$l_nam->nam$b_name + _fab.fab$l_nam->nam$b_type); return _current; } } // namespace Poco
18.090909
103
0.696817
abyss7
e531cd17c405b899e279a1e66f2cec531fdee364
2,516
cpp
C++
cpp/src/dotcpp/dot/noda_time/local_time_util.cpp
dotcpp/dotcpp
ba786aa072dd0612f5249de63f80bc540203840e
[ "Apache-2.0" ]
4
2019-08-08T03:53:37.000Z
2021-01-31T06:51:56.000Z
cpp/src/dotcpp/dot/noda_time/local_time_util.cpp
compatibl/dotcpp-mongo
e329e5a0523577b0d1f36c82d5caaac2e92e1023
[ "Apache-2.0" ]
null
null
null
cpp/src/dotcpp/dot/noda_time/local_time_util.cpp
compatibl/dotcpp-mongo
e329e5a0523577b0d1f36c82d5caaac2e92e1023
[ "Apache-2.0" ]
1
2015-03-28T15:52:01.000Z
2015-03-28T15:52:01.000Z
/* Copyright (C) 2015-present The DotCpp Authors. This file is part of .C++, a native C++ implementation of popular .NET class library APIs developed to facilitate code reuse between C# and C++. http://github.com/dotcpp/dotcpp (source) http://dotcpp.org (documentation) 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 <dot/precompiled.hpp> #include <dot/implement.hpp> #include <dot/noda_time/local_time_util.hpp> #include <dot/system/exception.hpp> #include <dot/system/string.hpp> namespace dot { dot::local_time local_time_util::parse(dot::string value) { boost::posix_time::time_input_facet* facet = new boost::posix_time::time_input_facet(); facet->format("%H:%M:%S%f"); std::istringstream stream(*value); stream.imbue(std::locale(std::locale::classic(), facet)); boost::posix_time::ptime ptime; stream >> ptime; // If default constructed time is passed, error message if (ptime == boost::posix_time::not_a_date_time) throw dot::exception(dot::string::format( "String representation of default constructed time {0} " "passed to local_time.Parse(time) method.", value)); return ptime; } int local_time_util::to_iso_int(dot::local_time value) { // local_time is serialized to millisecond precision in ISO 8601 9 digit int hhmmssfff format int result = value.hour() * 100'00'000 + value.minute() * 100'000 + value.second() * 1000 + value.millisecond(); return result; } dot::local_time local_time_util::parse_iso_int(int value) { // Extract year, month, day int hour = value / 100'00'000; value -= hour * 100'00'000; int minute = value / 100'000; value -= minute * 100'000; int second = value / 1000; value -= second * 1000; int millisecond = value; // Create new local_time object, validates values on input return dot::local_time(hour, minute, second, millisecond); } }
34.944444
120
0.67806
dotcpp
e535f53cac3f41386c15bf2999b119b4e6281020
2,009
hpp
C++
src/batched/KokkosBatched_FindAmax_Internal.hpp
dialecticDolt/kokkos-kernels
00189c0be23a70979aeaa162f0abd4c0e4d1c479
[ "BSD-3-Clause" ]
156
2017-03-01T23:38:10.000Z
2022-03-27T21:28:03.000Z
src/batched/KokkosBatched_FindAmax_Internal.hpp
dialecticDolt/kokkos-kernels
00189c0be23a70979aeaa162f0abd4c0e4d1c479
[ "BSD-3-Clause" ]
1,257
2017-03-03T15:25:16.000Z
2022-03-31T19:46:09.000Z
src/batched/KokkosBatched_FindAmax_Internal.hpp
dialecticDolt/kokkos-kernels
00189c0be23a70979aeaa162f0abd4c0e4d1c479
[ "BSD-3-Clause" ]
76
2017-03-01T17:03:59.000Z
2022-03-03T21:04:41.000Z
#ifndef __KOKKOSBATCHED_FIND_AMAX_INTERNAL_HPP__ #define __KOKKOSBATCHED_FIND_AMAX_INTERNAL_HPP__ /// \author Kyungjoo Kim ([email protected]) #include "KokkosBatched_Util.hpp" namespace KokkosBatched { /// /// Serial Internal Impl /// ===================== struct SerialFindAmaxInternal { template<typename ValueType, typename IntType> KOKKOS_INLINE_FUNCTION static int invoke(const int m, const ValueType *__restrict__ A, const int as0, /**/ IntType *__restrict__ idx) { ValueType max_val(A[0]); IntType val_loc(0); for (int i=1;i<m;++i) { const int idx_a = i*as0; if (A[idx_a] > max_val) { max_val = A[idx_a]; val_loc = i; } } *idx = val_loc; return 0; } }; /// /// TeamVector Internal Impl /// ======================== struct TeamVectorFindAmaxInternal { template<typename MemberType, typename ValueType, typename IntType> KOKKOS_INLINE_FUNCTION static int invoke(const MemberType &member, const int m, const ValueType *__restrict__ A, const int as0, /**/ IntType *__restrict__ idx) { if (m > 0) { using reducer_value_type = typename Kokkos::MaxLoc<ValueType,IntType>::value_type; reducer_value_type value; Kokkos::MaxLoc<ValueType,IntType> reducer_value(value); Kokkos::parallel_reduce (Kokkos::TeamVectorRange(member, m), [&](const int &i, reducer_value_type &update) { const int idx_a = i*as0; if (A[idx_a] > update.val) { update.val = A[idx_a]; update.loc = i; } }, reducer_value); Kokkos::single (Kokkos::PerTeam(member), [&]() { *idx = value.loc; }); } else { Kokkos::single (Kokkos::PerTeam(member), [&]() { *idx = 0; }); } return 0; } }; } #endif
24.5
90
0.551518
dialecticDolt