blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 3 264 | content_id stringlengths 40 40 | detected_licenses listlengths 0 85 | license_type stringclasses 2
values | repo_name stringlengths 5 140 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 986
values | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 3.89k 681M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 23
values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 145
values | src_encoding stringclasses 34
values | language stringclasses 1
value | is_vendor bool 1
class | is_generated bool 2
classes | length_bytes int64 3 10.4M | extension stringclasses 122
values | content stringlengths 3 10.4M | authors listlengths 1 1 | author_id stringlengths 0 158 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
72b7925040bf28812d4c0b869605289ace443197 | fad392b7b1533103a0ddcc18e059fcd2e85c0fda | /build/px4_msgs/rosidl_typesupport_cpp/px4_msgs/msg/estimator_status__type_support.cpp | afc41a9830112142d4efe52cfaca64a2e49078a4 | [] | no_license | adamdai/px4_ros_com_ros2 | bee6ef27559a3a157d10c250a45818a5c75f2eff | bcd7a1bd13c318d69994a64215f256b9ec7ae2bb | refs/heads/master | 2023-07-24T18:09:24.817561 | 2021-08-23T21:47:18 | 2021-08-23T21:47:18 | 399,255,215 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,184 | cpp | // generated from rosidl_typesupport_cpp/resource/idl__type_support.cpp.em
// with input from px4_msgs:msg/EstimatorStatus.idl
// generated code does not contain a copyright notice
#include "cstddef"
#include "rosidl_generator_c/message_type_support_struct.h"
#include "px4_msgs/msg/estimator_status__struct.hpp"
#include "rosidl_typesupport_cpp/message_type_support.hpp"
#include "rosidl_typesupport_cpp/visibility_control.h"
#include "px4_msgs/msg/estimator_status__rosidl_typesupport_fastrtps_cpp.hpp"
namespace rosidl_typesupport_cpp
{
template<>
ROSIDL_TYPESUPPORT_CPP_PUBLIC
const rosidl_message_type_support_t *
get_message_type_support_handle<px4_msgs::msg::EstimatorStatus>()
{
return ROSIDL_TYPESUPPORT_INTERFACE__MESSAGE_SYMBOL_NAME(rosidl_typesupport_fastrtps_cpp, px4_msgs, msg, EstimatorStatus)();
}
#ifdef __cplusplus
extern "C"
{
#endif
ROSIDL_TYPESUPPORT_CPP_PUBLIC
const rosidl_message_type_support_t *
ROSIDL_TYPESUPPORT_INTERFACE__MESSAGE_SYMBOL_NAME(rosidl_typesupport_cpp, px4_msgs, msg, EstimatorStatus)() {
return get_message_type_support_handle<px4_msgs::msg::EstimatorStatus>();
}
#ifdef __cplusplus
}
#endif
} // namespace rosidl_typesupport_cpp
| [
"adamdai97@gmail.com"
] | adamdai97@gmail.com |
fdc71676cb683d3f799734cbce94f994c2c8d11a | 9ed65d06644977f0873e2880ec654cd9988ac5f0 | /Tetris_Assignment/Tetris_Assignment/Sound.h | a3cf33c663b9154d4a7597d1f82ea6f2a5c21188 | [] | no_license | rNdm74/CPlusPlus | 72ddc37f1b217e7472d8ad3c119741b69660b555 | 2e762b08eee58d5ec6d48e0497345ff5b250dc70 | refs/heads/master | 2021-01-22T16:45:14.141887 | 2013-11-10T10:57:25 | 2013-11-10T10:57:25 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 254 | h | #pragma once
using namespace System::Media;
using namespace System::Resources;
ref class Sound
{
private:
SoundPlayer^ player;
ResourceManager^ rManager;
public:
bool Play;
public:
Sound(ResourceManager^ rm);
void play(System::String^ file);
};
| [
"rndm@windowslive.com"
] | rndm@windowslive.com |
6dadd8a5d892cdefef9e0d1a9cfce40a0212d29a | 2898223584a244abedec2740accea93e803f9c53 | /FileText/FileText/widget.cpp | bf28b0f04b9e59d03310b921b86560f46848fe72 | [] | no_license | oobiliuoo/QtCode | 4a767bbf661a94816e7f733e43bc90aeed41a993 | 9600278071c41b9c65d1fe55cf254232b00d2429 | refs/heads/main | 2023-06-09T06:58:21.953477 | 2021-07-01T15:43:39 | 2021-07-01T15:43:39 | 377,562,169 | 1 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 3,496 | cpp | #include "widget.h"
#include "ui_widget.h"
#include <QFile>
#include <QFileDialog>
#include <QMessageBox>
// 文件流
// 文本流 数据流(二进制格式)
#include <QTextStream> // 操作基础数据类型: int,string...
#include <QDataStream> // QImage、QPoint、QRect
#include <QDebug>
Widget::Widget(QWidget *parent) :
QWidget(parent),
ui(new Ui::Widget)
{
ui->setupUi(this);
#if 0
connect(ui->btnOpenFile,&QPushButton::clicked,this,[=](){
QString filename = QFileDialog::getOpenFileName(this,"open file","/home/biliu");
if(filename.isEmpty())
{
QMessageBox::warning(this,"warning","select file failed");
return;
}
ui->filepath->setText(filename);
// 创建文件对象
// 默认读取文件格式 utf-8
QFile file(filename);
// 指定打开方式
bool isok = file.open(QFile::ReadOnly);
if(isok == false)
{
QMessageBox::critical(this,"error","open file failed");
return;
}
// 读文件
QByteArray array = file.readAll();
// 显示到文本框
ui->textEdit->setText(array);
// 写文件
// file.write(QString("aaa").toUtf8());
// char buf[128];
// file.wirte(buf,strlen(128));
// file.write(buf);
// 关闭文件
file.close();
});
#endif
connect(ui->btnOpenFile,&QPushButton::clicked,this,[=](){
QString filename = QFileDialog::getOpenFileName(this,"open file","/home/biliu");
if(filename.isEmpty())
{
QMessageBox::warning(this,"warning","select file failed");
return;
}
ui->filepath->setText(filename);
// 创建文件对象
// 默认读取文件格式 utf-8
QFile file(filename);
// 指定打开方式
bool isok = file.open(QFile::ReadOnly);
if(isok == false)
{
QMessageBox::critical(this,"error","open file failed");
return;
}
// 创建流对象
QTextStream stream(&file); // 设置IO设备给流对象
// stream.setCodec("utf8");
// 读文件
QString array = stream.readAll();
// 显示到文本框
ui->textEdit->setText(array);
// 写文件
// file.write(QString("aaa").toUtf8());
// char buf[128];
// file.wirte(buf,strlen(128));
// file.write(buf);
// 关闭文件
file.close();
#if 0
QFile f("text.txt");
f.open(QFile::WriteOnly);
QTextStream qts(&f);
// 写文件
qts<<QString("你好啊") << 123456;
f.close();
QString text;
f.open(QFile::ReadOnly);
qts.setDevice(&f);
qts>>text;
qDebug() << text.toUtf8().data();
#endif
QFile f("text.txt");
f.open(QFile::WriteOnly);
QDataStream ds(&f);
// 写文件
ds<<QString("你好啊") << 123456;
f.close();
// 注意:读取顺序要一致
QString text;
int number;
f.open(QFile::ReadOnly);
ds.setDevice(&f);
ds>>text>>number;
qDebug() << text.toUtf8().data()<<number;
#if 0
// 特殊用法
QImage img("xxx.jpg");
QByteArray aaa;
QDataStream sss(&aaa,QIODevice::ReadWrite);
sss<<img;
#endif
});
}
Widget::~Widget()
{
delete ui;
}
| [
"biliu819@163.com"
] | biliu819@163.com |
8524179c71d09259afc5b3dd599dfeed9cf702ee | 44a87947d68f9b03aa49e3a730a82f896d11f02d | /src/util.cpp | 8a80f9b351579dfd6babf1e6ce48af289bf1d515 | [
"MIT"
] | permissive | gamacoin2017/newgamacoin | 9df4bd0e3a7bcf2c1120b78b786c92d792a66908 | ba87ed439ec33f7ca66c3b2f52d6baa0aa38b5ec | refs/heads/master | 2021-09-01T03:41:47.638587 | 2017-12-24T15:08:35 | 2017-12-24T15:08:35 | 115,270,317 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 43,213 | cpp | // Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef WIN32
// for posix_fallocate
#ifdef __linux__
#define _POSIX_C_SOURCE 200112L
#endif
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/resource.h>
#endif
#include "util.h"
#include "sync.h"
#include "version.h"
#include "ui_interface.h"
#include <boost/algorithm/string/join.hpp>
#include <boost/algorithm/string/case_conv.hpp> // for to_lower()
#include <boost/algorithm/string/predicate.hpp> // for startswith() and endswith()
// Work around clang compilation problem in Boost 1.46:
// /usr/include/boost/program_options/detail/config_file.hpp:163:17: error: call to function 'to_internal' that is neither visible in the template definition nor found by argument-dependent lookup
// See also: http://stackoverflow.com/questions/10020179/compilation-fail-in-boost-librairies-program-options
// http://clang.debian.net/status.php?version=3.0&key=CANNOT_FIND_FUNCTION
namespace boost {
namespace program_options {
std::string to_internal(const std::string&);
}
}
#include <boost/program_options/detail/config_file.hpp>
#include <boost/program_options/parsers.hpp>
#include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp>
#include <boost/foreach.hpp>
#include <boost/thread.hpp>
#include <openssl/crypto.h>
#include <openssl/rand.h>
#include <stdarg.h>
#ifdef WIN32
#ifdef _MSC_VER
#pragma warning(disable:4786)
#pragma warning(disable:4804)
#pragma warning(disable:4805)
#pragma warning(disable:4717)
#endif
#ifdef _WIN32_WINNT
#undef _WIN32_WINNT
#endif
#define _WIN32_WINNT 0x0501
#ifdef _WIN32_IE
#undef _WIN32_IE
#endif
#define _WIN32_IE 0x0501
#define WIN32_LEAN_AND_MEAN 1
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <io.h> /* for _commit */
#include "shlobj.h"
#elif defined(__linux__)
# include <sys/prctl.h>
#endif
using namespace std;
map<string, string> mapArgs;
map<string, vector<string> > mapMultiArgs;
bool fDebug = false;
bool fDebugNet = false;
bool fPrintToConsole = false;
bool fPrintToDebugger = false;
bool fDaemon = false;
bool fServer = false;
bool fCommandLine = false;
string strMiscWarning;
bool fTestNet = false;
bool fBloomFilters = true;
bool fNoListen = false;
bool fLogTimestamps = false;
CMedianFilter<int64> vTimeOffsets(200,0);
volatile bool fReopenDebugLog = false;
bool fCachedPath[2] = {false, false};
// Init OpenSSL library multithreading support
static CCriticalSection** ppmutexOpenSSL;
void locking_callback(int mode, int i, const char* file, int line)
{
if (mode & CRYPTO_LOCK) {
ENTER_CRITICAL_SECTION(*ppmutexOpenSSL[i]);
} else {
LEAVE_CRITICAL_SECTION(*ppmutexOpenSSL[i]);
}
}
LockedPageManager LockedPageManager::instance;
// Init
class CInit
{
public:
CInit()
{
// Init OpenSSL library multithreading support
ppmutexOpenSSL = (CCriticalSection**)OPENSSL_malloc(CRYPTO_num_locks() * sizeof(CCriticalSection*));
for (int i = 0; i < CRYPTO_num_locks(); i++)
ppmutexOpenSSL[i] = new CCriticalSection();
CRYPTO_set_locking_callback(locking_callback);
#ifdef WIN32
// Seed random number generator with screen scrape and other hardware sources
RAND_screen();
#endif
// Seed random number generator with performance counter
RandAddSeed();
}
~CInit()
{
// Shutdown OpenSSL library multithreading support
CRYPTO_set_locking_callback(NULL);
for (int i = 0; i < CRYPTO_num_locks(); i++)
delete ppmutexOpenSSL[i];
OPENSSL_free(ppmutexOpenSSL);
}
}
instance_of_cinit;
void RandAddSeed()
{
// Seed with CPU performance counter
int64 nCounter = GetPerformanceCounter();
RAND_add(&nCounter, sizeof(nCounter), 1.5);
memset(&nCounter, 0, sizeof(nCounter));
}
void RandAddSeedPerfmon()
{
RandAddSeed();
// This can take up to 2 seconds, so only do it every 10 minutes
static int64 nLastPerfmon;
if (GetTime() < nLastPerfmon + 10 * 60)
return;
nLastPerfmon = GetTime();
#ifdef WIN32
// Don't need this on Linux, OpenSSL automatically uses /dev/urandom
// Seed with the entire set of perfmon data
unsigned char pdata[250000];
memset(pdata, 0, sizeof(pdata));
unsigned long nSize = sizeof(pdata);
long ret = RegQueryValueExA(HKEY_PERFORMANCE_DATA, "Global", NULL, NULL, pdata, &nSize);
RegCloseKey(HKEY_PERFORMANCE_DATA);
if (ret == ERROR_SUCCESS)
{
RAND_add(pdata, nSize, nSize/100.0);
OPENSSL_cleanse(pdata, nSize);
printf("RandAddSeed() %lu bytes\n", nSize);
}
#endif
}
uint64 GetRand(uint64 nMax)
{
if (nMax == 0)
return 0;
// The range of the random source must be a multiple of the modulus
// to give every possible output value an equal possibility
uint64 nRange = (std::numeric_limits<uint64>::max() / nMax) * nMax;
uint64 nRand = 0;
do
RAND_bytes((unsigned char*)&nRand, sizeof(nRand));
while (nRand >= nRange);
return (nRand % nMax);
}
int GetRandInt(int nMax)
{
return GetRand(nMax);
}
uint256 GetRandHash()
{
uint256 hash;
RAND_bytes((unsigned char*)&hash, sizeof(hash));
return hash;
}
//
// OutputDebugStringF (aka printf -- there is a #define that we really
// should get rid of one day) has been broken a couple of times now
// by well-meaning people adding mutexes in the most straightforward way.
// It breaks because it may be called by global destructors during shutdown.
// Since the order of destruction of static/global objects is undefined,
// defining a mutex as a global object doesn't work (the mutex gets
// destroyed, and then some later destructor calls OutputDebugStringF,
// maybe indirectly, and you get a core dump at shutdown trying to lock
// the mutex).
static boost::once_flag debugPrintInitFlag = BOOST_ONCE_INIT;
// We use boost::call_once() to make sure these are initialized in
// in a thread-safe manner the first time it is called:
static FILE* fileout = NULL;
static boost::mutex* mutexDebugLog = NULL;
static void DebugPrintInit()
{
assert(fileout == NULL);
assert(mutexDebugLog == NULL);
boost::filesystem::path pathDebug = GetDataDir() / "debug.log";
fileout = fopen(pathDebug.string().c_str(), "a");
if (fileout) setbuf(fileout, NULL); // unbuffered
mutexDebugLog = new boost::mutex();
}
int OutputDebugStringF(const char* pszFormat, ...)
{
int ret = 0; // Returns total number of characters written
if (fPrintToConsole)
{
// print to console
va_list arg_ptr;
va_start(arg_ptr, pszFormat);
ret += vprintf(pszFormat, arg_ptr);
va_end(arg_ptr);
}
else if (!fPrintToDebugger)
{
static bool fStartedNewLine = true;
boost::call_once(&DebugPrintInit, debugPrintInitFlag);
if (fileout == NULL)
return ret;
boost::mutex::scoped_lock scoped_lock(*mutexDebugLog);
// reopen the log file, if requested
if (fReopenDebugLog) {
fReopenDebugLog = false;
boost::filesystem::path pathDebug = GetDataDir() / "debug.log";
if (freopen(pathDebug.string().c_str(),"a",fileout) != NULL)
setbuf(fileout, NULL); // unbuffered
}
// Debug print useful for profiling
if (fLogTimestamps && fStartedNewLine)
ret += fprintf(fileout, "%s ", DateTimeStrFormat("%Y-%m-%d %H:%M:%S", GetTime()).c_str());
if (pszFormat[strlen(pszFormat) - 1] == '\n')
fStartedNewLine = true;
else
fStartedNewLine = false;
va_list arg_ptr;
va_start(arg_ptr, pszFormat);
ret += vfprintf(fileout, pszFormat, arg_ptr);
va_end(arg_ptr);
}
#ifdef WIN32
if (fPrintToDebugger)
{
static CCriticalSection cs_OutputDebugStringF;
// accumulate and output a line at a time
{
LOCK(cs_OutputDebugStringF);
static std::string buffer;
va_list arg_ptr;
va_start(arg_ptr, pszFormat);
buffer += vstrprintf(pszFormat, arg_ptr);
va_end(arg_ptr);
int line_start = 0, line_end;
while((line_end = buffer.find('\n', line_start)) != -1)
{
OutputDebugStringA(buffer.substr(line_start, line_end - line_start).c_str());
line_start = line_end + 1;
ret += line_end-line_start;
}
buffer.erase(0, line_start);
}
}
#endif
return ret;
}
string vstrprintf(const char *format, va_list ap)
{
char buffer[50000];
char* p = buffer;
int limit = sizeof(buffer);
int ret;
loop
{
va_list arg_ptr;
va_copy(arg_ptr, ap);
#ifdef WIN32
ret = _vsnprintf(p, limit, format, arg_ptr);
#else
ret = vsnprintf(p, limit, format, arg_ptr);
#endif
va_end(arg_ptr);
if (ret >= 0 && ret < limit)
break;
if (p != buffer)
delete[] p;
limit *= 2;
p = new char[limit];
if (p == NULL)
throw std::bad_alloc();
}
string str(p, p+ret);
if (p != buffer)
delete[] p;
return str;
}
string real_strprintf(const char *format, int dummy, ...)
{
va_list arg_ptr;
va_start(arg_ptr, dummy);
string str = vstrprintf(format, arg_ptr);
va_end(arg_ptr);
return str;
}
string real_strprintf(const std::string &format, int dummy, ...)
{
va_list arg_ptr;
va_start(arg_ptr, dummy);
string str = vstrprintf(format.c_str(), arg_ptr);
va_end(arg_ptr);
return str;
}
bool error(const char *format, ...)
{
va_list arg_ptr;
va_start(arg_ptr, format);
std::string str = vstrprintf(format, arg_ptr);
va_end(arg_ptr);
printf("ERROR: %s\n", str.c_str());
return false;
}
void ParseString(const string& str, char c, vector<string>& v)
{
if (str.empty())
return;
string::size_type i1 = 0;
string::size_type i2;
loop
{
i2 = str.find(c, i1);
if (i2 == str.npos)
{
v.push_back(str.substr(i1));
return;
}
v.push_back(str.substr(i1, i2-i1));
i1 = i2+1;
}
}
string FormatMoney(int64 n, bool fPlus)
{
// Note: not using straight sprintf here because we do NOT want
// localized number formatting.
int64 n_abs = (n > 0 ? n : -n);
int64 quotient = n_abs/COIN;
int64 remainder = n_abs%COIN;
string str = strprintf("%"PRI64d".%08"PRI64d, quotient, remainder);
// Right-trim excess zeros before the decimal point:
int nTrim = 0;
for (int i = str.size()-1; (str[i] == '0' && isdigit(str[i-2])); --i)
++nTrim;
if (nTrim)
str.erase(str.size()-nTrim, nTrim);
if (n < 0)
str.insert((unsigned int)0, 1, '-');
else if (fPlus && n > 0)
str.insert((unsigned int)0, 1, '+');
return str;
}
bool ParseMoney(const string& str, int64& nRet)
{
return ParseMoney(str.c_str(), nRet);
}
bool ParseMoney(const char* pszIn, int64& nRet)
{
string strWhole;
int64 nUnits = 0;
const char* p = pszIn;
while (isspace(*p))
p++;
for (; *p; p++)
{
if (*p == '.')
{
p++;
int64 nMult = CENT*10;
while (isdigit(*p) && (nMult > 0))
{
nUnits += nMult * (*p++ - '0');
nMult /= 10;
}
break;
}
if (isspace(*p))
break;
if (!isdigit(*p))
return false;
strWhole.insert(strWhole.end(), *p);
}
for (; *p; p++)
if (!isspace(*p))
return false;
if (strWhole.size() > 10) // guard against 63 bit overflow
return false;
if (nUnits < 0 || nUnits > COIN)
return false;
int64 nWhole = atoi64(strWhole);
int64 nValue = nWhole*COIN + nUnits;
nRet = nValue;
return true;
}
// safeChars chosen to allow simple messages/URLs/email addresses, but avoid anything
// even possibly remotely dangerous like & or >
static string safeChars("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890 .,;_/:?@");
string SanitizeString(const string& str)
{
string strResult;
for (std::string::size_type i = 0; i < str.size(); i++)
{
if (safeChars.find(str[i]) != std::string::npos)
strResult.push_back(str[i]);
}
return strResult;
}
static const signed char phexdigit[256] =
{ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
0,1,2,3,4,5,6,7,8,9,-1,-1,-1,-1,-1,-1,
-1,0xa,0xb,0xc,0xd,0xe,0xf,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,0xa,0xb,0xc,0xd,0xe,0xf,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, };
bool IsHex(const string& str)
{
BOOST_FOREACH(unsigned char c, str)
{
if (phexdigit[c] < 0)
return false;
}
return (str.size() > 0) && (str.size()%2 == 0);
}
vector<unsigned char> ParseHex(const char* psz)
{
// convert hex dump to vector
vector<unsigned char> vch;
loop
{
while (isspace(*psz))
psz++;
signed char c = phexdigit[(unsigned char)*psz++];
if (c == (signed char)-1)
break;
unsigned char n = (c << 4);
c = phexdigit[(unsigned char)*psz++];
if (c == (signed char)-1)
break;
n |= c;
vch.push_back(n);
}
return vch;
}
vector<unsigned char> ParseHex(const string& str)
{
return ParseHex(str.c_str());
}
static void InterpretNegativeSetting(string name, map<string, string>& mapSettingsRet)
{
// interpret -nofoo as -foo=0 (and -nofoo=0 as -foo=1) as long as -foo not set
if (name.find("-no") == 0)
{
std::string positive("-");
positive.append(name.begin()+3, name.end());
if (mapSettingsRet.count(positive) == 0)
{
bool value = !GetBoolArg(name);
mapSettingsRet[positive] = (value ? "1" : "0");
}
}
}
void ParseParameters(int argc, const char* const argv[])
{
mapArgs.clear();
mapMultiArgs.clear();
for (int i = 1; i < argc; i++)
{
std::string str(argv[i]);
std::string strValue;
size_t is_index = str.find('=');
if (is_index != std::string::npos)
{
strValue = str.substr(is_index+1);
str = str.substr(0, is_index);
}
#ifdef WIN32
boost::to_lower(str);
if (boost::algorithm::starts_with(str, "/"))
str = "-" + str.substr(1);
#endif
if (str[0] != '-')
break;
mapArgs[str] = strValue;
mapMultiArgs[str].push_back(strValue);
}
// New 0.6 features:
BOOST_FOREACH(const PAIRTYPE(string,string)& entry, mapArgs)
{
string name = entry.first;
// interpret --foo as -foo (as long as both are not set)
if (name.find("--") == 0)
{
std::string singleDash(name.begin()+1, name.end());
if (mapArgs.count(singleDash) == 0)
mapArgs[singleDash] = entry.second;
name = singleDash;
}
// interpret -nofoo as -foo=0 (and -nofoo=0 as -foo=1) as long as -foo not set
InterpretNegativeSetting(name, mapArgs);
}
}
std::string GetArg(const std::string& strArg, const std::string& strDefault)
{
if (mapArgs.count(strArg))
return mapArgs[strArg];
return strDefault;
}
int64 GetArg(const std::string& strArg, int64 nDefault)
{
if (mapArgs.count(strArg))
return atoi64(mapArgs[strArg]);
return nDefault;
}
bool GetBoolArg(const std::string& strArg, bool fDefault)
{
if (mapArgs.count(strArg))
{
if (mapArgs[strArg].empty())
return true;
return (atoi(mapArgs[strArg]) != 0);
}
return fDefault;
}
bool SoftSetArg(const std::string& strArg, const std::string& strValue)
{
if (mapArgs.count(strArg))
return false;
mapArgs[strArg] = strValue;
return true;
}
bool SoftSetBoolArg(const std::string& strArg, bool fValue)
{
if (fValue)
return SoftSetArg(strArg, std::string("1"));
else
return SoftSetArg(strArg, std::string("0"));
}
string EncodeBase64(const unsigned char* pch, size_t len)
{
static const char *pbase64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
string strRet="";
strRet.reserve((len+2)/3*4);
int mode=0, left=0;
const unsigned char *pchEnd = pch+len;
while (pch<pchEnd)
{
int enc = *(pch++);
switch (mode)
{
case 0: // we have no bits
strRet += pbase64[enc >> 2];
left = (enc & 3) << 4;
mode = 1;
break;
case 1: // we have two bits
strRet += pbase64[left | (enc >> 4)];
left = (enc & 15) << 2;
mode = 2;
break;
case 2: // we have four bits
strRet += pbase64[left | (enc >> 6)];
strRet += pbase64[enc & 63];
mode = 0;
break;
}
}
if (mode)
{
strRet += pbase64[left];
strRet += '=';
if (mode == 1)
strRet += '=';
}
return strRet;
}
string EncodeBase64(const string& str)
{
return EncodeBase64((const unsigned char*)str.c_str(), str.size());
}
vector<unsigned char> DecodeBase64(const char* p, bool* pfInvalid)
{
static const int decode64_table[256] =
{
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1,
-1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28,
29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
49, 50, 51, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
};
if (pfInvalid)
*pfInvalid = false;
vector<unsigned char> vchRet;
vchRet.reserve(strlen(p)*3/4);
int mode = 0;
int left = 0;
while (1)
{
int dec = decode64_table[(unsigned char)*p];
if (dec == -1) break;
p++;
switch (mode)
{
case 0: // we have no bits and get 6
left = dec;
mode = 1;
break;
case 1: // we have 6 bits and keep 4
vchRet.push_back((left<<2) | (dec>>4));
left = dec & 15;
mode = 2;
break;
case 2: // we have 4 bits and get 6, we keep 2
vchRet.push_back((left<<4) | (dec>>2));
left = dec & 3;
mode = 3;
break;
case 3: // we have 2 bits and get 6
vchRet.push_back((left<<6) | dec);
mode = 0;
break;
}
}
if (pfInvalid)
switch (mode)
{
case 0: // 4n base64 characters processed: ok
break;
case 1: // 4n+1 base64 character processed: impossible
*pfInvalid = true;
break;
case 2: // 4n+2 base64 characters processed: require '=='
if (left || p[0] != '=' || p[1] != '=' || decode64_table[(unsigned char)p[2]] != -1)
*pfInvalid = true;
break;
case 3: // 4n+3 base64 characters processed: require '='
if (left || p[0] != '=' || decode64_table[(unsigned char)p[1]] != -1)
*pfInvalid = true;
break;
}
return vchRet;
}
string DecodeBase64(const string& str)
{
vector<unsigned char> vchRet = DecodeBase64(str.c_str());
return string((const char*)&vchRet[0], vchRet.size());
}
string EncodeBase32(const unsigned char* pch, size_t len)
{
static const char *pbase32 = "abcdefghijklmnopqrstuvwxyz234567";
string strRet="";
strRet.reserve((len+4)/5*8);
int mode=0, left=0;
const unsigned char *pchEnd = pch+len;
while (pch<pchEnd)
{
int enc = *(pch++);
switch (mode)
{
case 0: // we have no bits
strRet += pbase32[enc >> 3];
left = (enc & 7) << 2;
mode = 1;
break;
case 1: // we have three bits
strRet += pbase32[left | (enc >> 6)];
strRet += pbase32[(enc >> 1) & 31];
left = (enc & 1) << 4;
mode = 2;
break;
case 2: // we have one bit
strRet += pbase32[left | (enc >> 4)];
left = (enc & 15) << 1;
mode = 3;
break;
case 3: // we have four bits
strRet += pbase32[left | (enc >> 7)];
strRet += pbase32[(enc >> 2) & 31];
left = (enc & 3) << 3;
mode = 4;
break;
case 4: // we have two bits
strRet += pbase32[left | (enc >> 5)];
strRet += pbase32[enc & 31];
mode = 0;
}
}
static const int nPadding[5] = {0, 6, 4, 3, 1};
if (mode)
{
strRet += pbase32[left];
for (int n=0; n<nPadding[mode]; n++)
strRet += '=';
}
return strRet;
}
string EncodeBase32(const string& str)
{
return EncodeBase32((const unsigned char*)str.c_str(), str.size());
}
vector<unsigned char> DecodeBase32(const char* p, bool* pfInvalid)
{
static const int decode32_table[256] =
{
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, -1, -1, -1, -1,
-1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 0, 1, 2,
3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
23, 24, 25, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
};
if (pfInvalid)
*pfInvalid = false;
vector<unsigned char> vchRet;
vchRet.reserve((strlen(p))*5/8);
int mode = 0;
int left = 0;
while (1)
{
int dec = decode32_table[(unsigned char)*p];
if (dec == -1) break;
p++;
switch (mode)
{
case 0: // we have no bits and get 5
left = dec;
mode = 1;
break;
case 1: // we have 5 bits and keep 2
vchRet.push_back((left<<3) | (dec>>2));
left = dec & 3;
mode = 2;
break;
case 2: // we have 2 bits and keep 7
left = left << 5 | dec;
mode = 3;
break;
case 3: // we have 7 bits and keep 4
vchRet.push_back((left<<1) | (dec>>4));
left = dec & 15;
mode = 4;
break;
case 4: // we have 4 bits, and keep 1
vchRet.push_back((left<<4) | (dec>>1));
left = dec & 1;
mode = 5;
break;
case 5: // we have 1 bit, and keep 6
left = left << 5 | dec;
mode = 6;
break;
case 6: // we have 6 bits, and keep 3
vchRet.push_back((left<<2) | (dec>>3));
left = dec & 7;
mode = 7;
break;
case 7: // we have 3 bits, and keep 0
vchRet.push_back((left<<5) | dec);
mode = 0;
break;
}
}
if (pfInvalid)
switch (mode)
{
case 0: // 8n base32 characters processed: ok
break;
case 1: // 8n+1 base32 characters processed: impossible
case 3: // +3
case 6: // +6
*pfInvalid = true;
break;
case 2: // 8n+2 base32 characters processed: require '======'
if (left || p[0] != '=' || p[1] != '=' || p[2] != '=' || p[3] != '=' || p[4] != '=' || p[5] != '=' || decode32_table[(unsigned char)p[6]] != -1)
*pfInvalid = true;
break;
case 4: // 8n+4 base32 characters processed: require '===='
if (left || p[0] != '=' || p[1] != '=' || p[2] != '=' || p[3] != '=' || decode32_table[(unsigned char)p[4]] != -1)
*pfInvalid = true;
break;
case 5: // 8n+5 base32 characters processed: require '==='
if (left || p[0] != '=' || p[1] != '=' || p[2] != '=' || decode32_table[(unsigned char)p[3]] != -1)
*pfInvalid = true;
break;
case 7: // 8n+7 base32 characters processed: require '='
if (left || p[0] != '=' || decode32_table[(unsigned char)p[1]] != -1)
*pfInvalid = true;
break;
}
return vchRet;
}
string DecodeBase32(const string& str)
{
vector<unsigned char> vchRet = DecodeBase32(str.c_str());
return string((const char*)&vchRet[0], vchRet.size());
}
bool WildcardMatch(const char* psz, const char* mask)
{
loop
{
switch (*mask)
{
case '\0':
return (*psz == '\0');
case '*':
return WildcardMatch(psz, mask+1) || (*psz && WildcardMatch(psz+1, mask));
case '?':
if (*psz == '\0')
return false;
break;
default:
if (*psz != *mask)
return false;
break;
}
psz++;
mask++;
}
}
bool WildcardMatch(const string& str, const string& mask)
{
return WildcardMatch(str.c_str(), mask.c_str());
}
static std::string FormatException(std::exception* pex, const char* pszThread)
{
#ifdef WIN32
char pszModule[MAX_PATH] = "";
GetModuleFileNameA(NULL, pszModule, sizeof(pszModule));
#else
const char* pszModule = "gamacoin";
#endif
if (pex)
return strprintf(
"EXCEPTION: %s \n%s \n%s in %s \n", typeid(*pex).name(), pex->what(), pszModule, pszThread);
else
return strprintf(
"UNKNOWN EXCEPTION \n%s in %s \n", pszModule, pszThread);
}
void LogException(std::exception* pex, const char* pszThread)
{
std::string message = FormatException(pex, pszThread);
printf("\n%s", message.c_str());
}
void PrintException(std::exception* pex, const char* pszThread)
{
std::string message = FormatException(pex, pszThread);
printf("\n\n************************\n%s\n", message.c_str());
fprintf(stderr, "\n\n************************\n%s\n", message.c_str());
strMiscWarning = message;
throw;
}
void PrintExceptionContinue(std::exception* pex, const char* pszThread)
{
std::string message = FormatException(pex, pszThread);
printf("\n\n************************\n%s\n", message.c_str());
fprintf(stderr, "\n\n************************\n%s\n", message.c_str());
strMiscWarning = message;
}
boost::filesystem::path GetDefaultDataDir()
{
namespace fs = boost::filesystem;
// Windows < Vista: C:\Documents and Settings\Username\Application Data\Bitcoin
// Windows >= Vista: C:\Users\Username\AppData\Roaming\Bitcoin
// Mac: ~/Library/Application Support/Bitcoin
// Unix: ~/.bitcoin
#ifdef WIN32
// Windows
return GetSpecialFolderPath(CSIDL_APPDATA) / "Gamacoin";
#else
fs::path pathRet;
char* pszHome = getenv("HOME");
if (pszHome == NULL || strlen(pszHome) == 0)
pathRet = fs::path("/");
else
pathRet = fs::path(pszHome);
#ifdef MAC_OSX
// Mac
pathRet /= "Library/Application Support";
fs::create_directory(pathRet);
return pathRet / "Gamacoin";
#else
// Unix
return pathRet / ".gamacoin";
#endif
#endif
}
const boost::filesystem::path &GetDataDir(bool fNetSpecific)
{
namespace fs = boost::filesystem;
static fs::path pathCached[2];
static CCriticalSection csPathCached;
fs::path &path = pathCached[fNetSpecific];
// This can be called during exceptions by printf, so we cache the
// value so we don't have to do memory allocations after that.
if (fCachedPath[fNetSpecific])
return path;
LOCK(csPathCached);
if (mapArgs.count("-datadir")) {
path = fs::system_complete(mapArgs["-datadir"]);
if (!fs::is_directory(path)) {
path = "";
return path;
}
} else {
path = GetDefaultDataDir();
}
if (fNetSpecific && GetBoolArg("-testnet", false))
path /= "testnet3";
fs::create_directories(path);
fCachedPath[fNetSpecific] = true;
return path;
}
boost::filesystem::path GetConfigFile()
{
boost::filesystem::path pathConfigFile(GetArg("-conf", "gamacoin.conf"));
if (!pathConfigFile.is_complete()) pathConfigFile = GetDataDir(false) / pathConfigFile;
return pathConfigFile;
}
void ReadConfigFile(map<string, string>& mapSettingsRet,
map<string, vector<string> >& mapMultiSettingsRet)
{
boost::filesystem::ifstream streamConfig(GetConfigFile());
if (!streamConfig.good())
return; // No bitcoin.conf file is OK
// clear path cache after loading config file
fCachedPath[0] = fCachedPath[1] = false;
set<string> setOptions;
setOptions.insert("*");
for (boost::program_options::detail::config_file_iterator it(streamConfig, setOptions), end; it != end; ++it)
{
// Don't overwrite existing settings so command line settings override bitcoin.conf
string strKey = string("-") + it->string_key;
if (mapSettingsRet.count(strKey) == 0)
{
mapSettingsRet[strKey] = it->value[0];
// interpret nofoo=1 as foo=0 (and nofoo=0 as foo=1) as long as foo not set)
InterpretNegativeSetting(strKey, mapSettingsRet);
}
mapMultiSettingsRet[strKey].push_back(it->value[0]);
}
}
boost::filesystem::path GetPidFile()
{
boost::filesystem::path pathPidFile(GetArg("-pid", "gamacoind.pid"));
if (!pathPidFile.is_complete()) pathPidFile = GetDataDir() / pathPidFile;
return pathPidFile;
}
#ifndef WIN32
void CreatePidFile(const boost::filesystem::path &path, pid_t pid)
{
FILE* file = fopen(path.string().c_str(), "w");
if (file)
{
fprintf(file, "%d\n", pid);
fclose(file);
}
}
#endif
bool RenameOver(boost::filesystem::path src, boost::filesystem::path dest)
{
#ifdef WIN32
return MoveFileExA(src.string().c_str(), dest.string().c_str(),
MOVEFILE_REPLACE_EXISTING);
#else
int rc = std::rename(src.string().c_str(), dest.string().c_str());
return (rc == 0);
#endif /* WIN32 */
}
void FileCommit(FILE *fileout)
{
fflush(fileout); // harmless if redundantly called
#ifdef WIN32
_commit(_fileno(fileout));
#else
#if defined(__linux__) || defined(__NetBSD__)
fdatasync(fileno(fileout));
#elif defined(__APPLE__) && defined(F_FULLFSYNC)
fcntl(fileno(fileout), F_FULLFSYNC, 0);
#else
fsync(fileno(fileout));
#endif
#endif
}
int GetFilesize(FILE* file)
{
int nSavePos = ftell(file);
int nFilesize = -1;
if (fseek(file, 0, SEEK_END) == 0)
nFilesize = ftell(file);
fseek(file, nSavePos, SEEK_SET);
return nFilesize;
}
bool TruncateFile(FILE *file, unsigned int length) {
#if defined(WIN32)
return _chsize(_fileno(file), length) == 0;
#else
return ftruncate(fileno(file), length) == 0;
#endif
}
// this function tries to raise the file descriptor limit to the requested number.
// It returns the actual file descriptor limit (which may be more or less than nMinFD)
int RaiseFileDescriptorLimit(int nMinFD) {
#if defined(WIN32)
return 2048;
#else
struct rlimit limitFD;
if (getrlimit(RLIMIT_NOFILE, &limitFD) != -1) {
if (limitFD.rlim_cur < (rlim_t)nMinFD) {
limitFD.rlim_cur = nMinFD;
if (limitFD.rlim_cur > limitFD.rlim_max)
limitFD.rlim_cur = limitFD.rlim_max;
setrlimit(RLIMIT_NOFILE, &limitFD);
getrlimit(RLIMIT_NOFILE, &limitFD);
}
return limitFD.rlim_cur;
}
return nMinFD; // getrlimit failed, assume it's fine
#endif
}
// this function tries to make a particular range of a file allocated (corresponding to disk space)
// it is advisory, and the range specified in the arguments will never contain live data
void AllocateFileRange(FILE *file, unsigned int offset, unsigned int length) {
#if defined(WIN32)
// Windows-specific version
HANDLE hFile = (HANDLE)_get_osfhandle(_fileno(file));
LARGE_INTEGER nFileSize;
int64 nEndPos = (int64)offset + length;
nFileSize.u.LowPart = nEndPos & 0xFFFFFFFF;
nFileSize.u.HighPart = nEndPos >> 32;
SetFilePointerEx(hFile, nFileSize, 0, FILE_BEGIN);
SetEndOfFile(hFile);
#elif defined(MAC_OSX)
// OSX specific version
fstore_t fst;
fst.fst_flags = F_ALLOCATECONTIG;
fst.fst_posmode = F_PEOFPOSMODE;
fst.fst_offset = 0;
fst.fst_length = (off_t)offset + length;
fst.fst_bytesalloc = 0;
if (fcntl(fileno(file), F_PREALLOCATE, &fst) == -1) {
fst.fst_flags = F_ALLOCATEALL;
fcntl(fileno(file), F_PREALLOCATE, &fst);
}
ftruncate(fileno(file), fst.fst_length);
#elif defined(__linux__)
// Version using posix_fallocate
off_t nEndPos = (off_t)offset + length;
posix_fallocate(fileno(file), 0, nEndPos);
#else
// Fallback version
// TODO: just write one byte per block
static const char buf[65536] = {};
fseek(file, offset, SEEK_SET);
while (length > 0) {
unsigned int now = 65536;
if (length < now)
now = length;
fwrite(buf, 1, now, file); // allowed to fail; this function is advisory anyway
length -= now;
}
#endif
}
void ShrinkDebugFile()
{
// Scroll debug.log if it's getting too big
boost::filesystem::path pathLog = GetDataDir() / "debug.log";
FILE* file = fopen(pathLog.string().c_str(), "r");
if (file && GetFilesize(file) > 10 * 1000000)
{
// Restart the file with some of the end
char pch[200000];
fseek(file, -sizeof(pch), SEEK_END);
int nBytes = fread(pch, 1, sizeof(pch), file);
fclose(file);
file = fopen(pathLog.string().c_str(), "w");
if (file)
{
fwrite(pch, 1, nBytes, file);
fclose(file);
}
}
else if(file != NULL)
fclose(file);
}
//
// "Never go to sea with two chronometers; take one or three."
// Our three time sources are:
// - System clock
// - Median of other nodes clocks
// - The user (asking the user to fix the system clock if the first two disagree)
//
static int64 nMockTime = 0; // For unit testing
int64 GetTime()
{
if (nMockTime) return nMockTime;
return time(NULL);
}
void SetMockTime(int64 nMockTimeIn)
{
nMockTime = nMockTimeIn;
}
static int64 nTimeOffset = 0;
int64 GetTimeOffset()
{
return nTimeOffset;
}
int64 GetAdjustedTime()
{
return GetTime() + GetTimeOffset();
}
void AddTimeData(const CNetAddr& ip, int64 nTime)
{
int64 nOffsetSample = nTime - GetTime();
// Ignore duplicates
static set<CNetAddr> setKnown;
if (!setKnown.insert(ip).second)
return;
// Add data
vTimeOffsets.input(nOffsetSample);
printf("Added time data, samples %d, offset %+"PRI64d" (%+"PRI64d" minutes)\n", vTimeOffsets.size(), nOffsetSample, nOffsetSample/60);
if (vTimeOffsets.size() >= 5 && vTimeOffsets.size() % 2 == 1)
{
int64 nMedian = vTimeOffsets.median();
std::vector<int64> vSorted = vTimeOffsets.sorted();
// Only let other nodes change our time by so much
if (abs64(nMedian) < 35 * 60) // Gamacoin: changed maximum adjust to 35 mins to avoid letting peers change our time too much in case of an attack.
{
nTimeOffset = nMedian;
}
else
{
nTimeOffset = 0;
static bool fDone;
if (!fDone)
{
// If nobody has a time different than ours but within 5 minutes of ours, give a warning
bool fMatch = false;
BOOST_FOREACH(int64 nOffset, vSorted)
if (nOffset != 0 && abs64(nOffset) < 5 * 60)
fMatch = true;
if (!fMatch)
{
fDone = true;
string strMessage = _("Warning: Please check that your computer's date and time are correct! If your clock is wrong Gamacoin will not work properly.");
strMiscWarning = strMessage;
printf("*** %s\n", strMessage.c_str());
uiInterface.ThreadSafeMessageBox(strMessage, "", CClientUIInterface::MSG_WARNING);
}
}
}
if (fDebug) {
BOOST_FOREACH(int64 n, vSorted)
printf("%+"PRI64d" ", n);
printf("| ");
}
printf("nTimeOffset = %+"PRI64d" (%+"PRI64d" minutes)\n", nTimeOffset, nTimeOffset/60);
}
}
uint32_t insecure_rand_Rz = 11;
uint32_t insecure_rand_Rw = 11;
void seed_insecure_rand(bool fDeterministic)
{
//The seed values have some unlikely fixed points which we avoid.
if(fDeterministic)
{
insecure_rand_Rz = insecure_rand_Rw = 11;
} else {
uint32_t tmp;
do {
RAND_bytes((unsigned char*)&tmp, 4);
} while(tmp == 0 || tmp == 0x9068ffffU);
insecure_rand_Rz = tmp;
do {
RAND_bytes((unsigned char*)&tmp, 4);
} while(tmp == 0 || tmp == 0x464fffffU);
insecure_rand_Rw = tmp;
}
}
string FormatVersion(int nVersion)
{
if (nVersion%100 == 0)
return strprintf("%d.%d.%d", nVersion/1000000, (nVersion/10000)%100, (nVersion/100)%100);
else
return strprintf("%d.%d.%d.%d", nVersion/1000000, (nVersion/10000)%100, (nVersion/100)%100, nVersion%100);
}
string FormatFullVersion()
{
return CLIENT_BUILD;
}
// Format the subversion field according to BIP 14 spec (https://en.bitcoin.it/wiki/BIP_0014)
std::string FormatSubVersion(const std::string& name, int nClientVersion, const std::vector<std::string>& comments)
{
std::ostringstream ss;
ss << "/";
ss << name << ":" << FormatVersion(nClientVersion);
if (!comments.empty())
ss << "(" << boost::algorithm::join(comments, "; ") << ")";
ss << "/";
return ss.str();
}
#ifdef WIN32
boost::filesystem::path GetSpecialFolderPath(int nFolder, bool fCreate)
{
namespace fs = boost::filesystem;
char pszPath[MAX_PATH] = "";
if(SHGetSpecialFolderPathA(NULL, pszPath, nFolder, fCreate))
{
return fs::path(pszPath);
}
printf("SHGetSpecialFolderPathA() failed, could not obtain requested path.\n");
return fs::path("");
}
#endif
boost::filesystem::path GetTempPath() {
#if BOOST_FILESYSTEM_VERSION == 3
return boost::filesystem::temp_directory_path();
#else
// TODO: remove when we don't support filesystem v2 anymore
boost::filesystem::path path;
#ifdef WIN32
char pszPath[MAX_PATH] = "";
if (GetTempPathA(MAX_PATH, pszPath))
path = boost::filesystem::path(pszPath);
#else
path = boost::filesystem::path("/tmp");
#endif
if (path.empty() || !boost::filesystem::is_directory(path)) {
printf("GetTempPath(): failed to find temp path\n");
return boost::filesystem::path("");
}
return path;
#endif
}
void runCommand(std::string strCommand)
{
int nErr = ::system(strCommand.c_str());
if (nErr)
printf("runCommand error: system(%s) returned %d\n", strCommand.c_str(), nErr);
}
void RenameThread(const char* name)
{
#if defined(PR_SET_NAME)
// Only the first 15 characters are used (16 - NUL terminator)
::prctl(PR_SET_NAME, name, 0, 0, 0);
#elif 0 && (defined(__FreeBSD__) || defined(__OpenBSD__))
// TODO: This is currently disabled because it needs to be verified to work
// on FreeBSD or OpenBSD first. When verified the '0 &&' part can be
// removed.
pthread_set_name_np(pthread_self(), name);
#elif defined(MAC_OSX) && defined(__MAC_OS_X_VERSION_MAX_ALLOWED)
// pthread_setname_np is XCode 10.6-and-later
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1060
pthread_setname_np(name);
#endif
#else
// Prevent warnings for unused parameters...
(void)name;
#endif
}
bool NewThread(void(*pfn)(void*), void* parg)
{
try
{
boost::thread(pfn, parg); // thread detaches when out of scope
} catch(boost::thread_resource_error &e) {
printf("Error creating thread: %s\n", e.what());
return false;
}
return true;
}
| [
"aboutyou2017@gmail.com"
] | aboutyou2017@gmail.com |
205f0896547443da454ebf90d13adfd052568470 | 1aa079f1846edaafda5625b5d61564e86576b6c8 | /02_keywords_and_specificators/02_06_decltype_and_declval/02_06_02_decltype_auto_return_type_deduction .cpp | 26e2316694228e7507a9b0bfa495d9f428d1ca7f | [
"MIT"
] | permissive | pavelkumbrasev/cpp-courses | 8cb9bfe2747652366073119d984e7e6e436b74ce | e6176c956645330fe96a9861250280c1e063d393 | refs/heads/master | 2023-07-19T02:33:54.061680 | 2021-08-24T13:39:41 | 2021-08-24T13:39:41 | 399,446,497 | 0 | 0 | MIT | 2021-08-24T11:53:27 | 2021-08-24T11:53:27 | null | UTF-8 | C++ | false | false | 428 | cpp | // differencies between decltype and auto return types deduction
// since C++14
int x = 1;
decltype(auto) func0() { return x; } // returns int
decltype(auto) func1() { return (x); } // returns int&
// decltype(auto) void_func0() {} // compile-time error
// Possible but is not used much in real code.
template<class T, class U>
auto add(T t, U u) -> decltype(auto) { return t + u; } // returns the type of operator+(T, U)
| [
"noreply@github.com"
] | pavelkumbrasev.noreply@github.com |
38d2b651017ad017fe8e549c07357a9f542636b7 | 0065cefdd3a4f163e92c6499c4f36feb584d99b7 | /rogue/cheat/sdk/SDK/UMG_parameters.h | eab82d8ea1137a4d1d4ab70dd241657bcb37b68a | [] | no_license | YMY1666527646/Rogue_Company_hack | ecd8461fc6b25a0adca1a6ef09ee57e59181bc84 | 2a19c81c5bf25b6e245084c073ad7af895a696e4 | refs/heads/main | 2023-08-20T06:07:14.660871 | 2021-10-21T20:33:53 | 2021-10-21T20:33:53 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 306,780 | h | #pragma once
// Name: roguecompany, Version: 425
/*!!DEFINE!!*/
/*!!HELPER_DEF!!*/
/*!!HELPER_INC!!*/
#ifdef _MSC_VER
#pragma pack(push, 0x01)
#endif
namespace CG
{
//---------------------------------------------------------------------------
// Parameters
//---------------------------------------------------------------------------
// Function UMG.Widget.SetVisibility
struct UWidget_SetVisibility_Params
{
UMG_ESlateVisibility InVisibility; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Widget.SetUserFocus
struct UWidget_SetUserFocus_Params
{
class APlayerController* PlayerController; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Widget.SetToolTipText
struct UWidget_SetToolTipText_Params
{
struct FText InToolTipText; // 0x0000(0x0018) (ConstParm, Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
};
// Function UMG.Widget.SetToolTip
struct UWidget_SetToolTip_Params
{
class UWidget* Widget; // 0x0000(0x0008) (Parm, ZeroConstructor, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Widget.SetRenderTranslation
struct UWidget_SetRenderTranslation_Params
{
struct FVector2D Translation; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Widget.SetRenderTransformPivot
struct UWidget_SetRenderTransformPivot_Params
{
struct FVector2D Pivot; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Widget.SetRenderTransformAngle
struct UWidget_SetRenderTransformAngle_Params
{
float Angle; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Widget.SetRenderTransform
struct UWidget_SetRenderTransform_Params
{
struct FWidgetTransform InTransform; // 0x0000(0x001C) (Parm, NoDestructor, NativeAccessSpecifierPublic)
};
// Function UMG.Widget.SetRenderShear
struct UWidget_SetRenderShear_Params
{
struct FVector2D Shear; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Widget.SetRenderScale
struct UWidget_SetRenderScale_Params
{
struct FVector2D Scale; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Widget.SetRenderOpacity
struct UWidget_SetRenderOpacity_Params
{
float InOpacity; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Widget.SetNavigationRuleExplicit
struct UWidget_SetNavigationRuleExplicit_Params
{
SlateCore_EUINavigation Direction; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class UWidget* InWidget; // 0x0008(0x0008) (Parm, ZeroConstructor, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Widget.SetNavigationRuleCustomBoundary
struct UWidget_SetNavigationRuleCustomBoundary_Params
{
SlateCore_EUINavigation Direction; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FScriptDelegate InCustomDelegate; // 0x0004(0x0010) (Parm, ZeroConstructor, NoDestructor, NativeAccessSpecifierPublic)
};
// Function UMG.Widget.SetNavigationRuleCustom
struct UWidget_SetNavigationRuleCustom_Params
{
SlateCore_EUINavigation Direction; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FScriptDelegate InCustomDelegate; // 0x0004(0x0010) (Parm, ZeroConstructor, NoDestructor, NativeAccessSpecifierPublic)
};
// Function UMG.Widget.SetNavigationRuleBase
struct UWidget_SetNavigationRuleBase_Params
{
SlateCore_EUINavigation Direction; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
SlateCore_EUINavigationRule Rule; // 0x0001(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Widget.SetNavigationRule
struct UWidget_SetNavigationRule_Params
{
SlateCore_EUINavigation Direction; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
SlateCore_EUINavigationRule Rule; // 0x0001(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FName WidgetToFocus; // 0x0004(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Widget.SetKeyboardFocus
struct UWidget_SetKeyboardFocus_Params
{
};
// Function UMG.Widget.SetIsEnabled
struct UWidget_SetIsEnabled_Params
{
bool bInIsEnabled; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Widget.SetFocus
struct UWidget_SetFocus_Params
{
};
// Function UMG.Widget.SetCursor
struct UWidget_SetCursor_Params
{
TEnumAsByte<CoreUObject_EMouseCursor> InCursor; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Widget.SetClipping
struct UWidget_SetClipping_Params
{
SlateCore_EWidgetClipping InClipping; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Widget.SetAllowRenderInterpolation
struct UWidget_SetAllowRenderInterpolation_Params
{
bool bInAllowInterpolation; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Widget.SetAllNavigationRules
struct UWidget_SetAllNavigationRules_Params
{
SlateCore_EUINavigationRule Rule; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FName WidgetToFocus; // 0x0004(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Widget.ResetCursor
struct UWidget_ResetCursor_Params
{
};
// Function UMG.Widget.RemoveFromParent
struct UWidget_RemoveFromParent_Params
{
};
// DelegateFunction UMG.Widget.OnReply__DelegateSignature
struct UWidget_OnReply__DelegateSignature_Params
{
struct FEventReply ReturnValue; // 0x0000(0x00C0) (Parm, OutParm, ReturnParm, NativeAccessSpecifierPublic)
};
// DelegateFunction UMG.Widget.OnPointerEvent__DelegateSignature
struct UWidget_OnPointerEvent__DelegateSignature_Params
{
struct FGeometry MyGeometry; // 0x0000(0x0058) (Parm, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
struct FPointerEvent MouseEvent; // 0x0058(0x0070) (ConstParm, Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
struct FEventReply ReturnValue; // 0x00C8(0x00C0) (Parm, OutParm, ReturnParm, NativeAccessSpecifierPublic)
};
// Function UMG.Widget.IsVisible
struct UWidget_IsVisible_Params
{
bool ReturnValue; // 0x0000(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Widget.IsHovered
struct UWidget_IsHovered_Params
{
bool ReturnValue; // 0x0000(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Widget.InvalidateLayoutAndVolatility
struct UWidget_InvalidateLayoutAndVolatility_Params
{
};
// Function UMG.Widget.HasUserFocusedDescendants
struct UWidget_HasUserFocusedDescendants_Params
{
class APlayerController* PlayerController; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool ReturnValue; // 0x0008(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Widget.HasUserFocus
struct UWidget_HasUserFocus_Params
{
class APlayerController* PlayerController; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool ReturnValue; // 0x0008(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Widget.HasMouseCaptureByUser
struct UWidget_HasMouseCaptureByUser_Params
{
int UserIndex; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
int PointerIndex; // 0x0004(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool ReturnValue; // 0x0008(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Widget.HasMouseCapture
struct UWidget_HasMouseCapture_Params
{
bool ReturnValue; // 0x0000(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Widget.HasKeyboardFocus
struct UWidget_HasKeyboardFocus_Params
{
bool ReturnValue; // 0x0000(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Widget.HasFocusedDescendants
struct UWidget_HasFocusedDescendants_Params
{
bool ReturnValue; // 0x0000(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Widget.HasAnyUserFocus
struct UWidget_HasAnyUserFocus_Params
{
bool ReturnValue; // 0x0000(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// DelegateFunction UMG.Widget.GetWidget__DelegateSignature
struct UWidget_GetWidget__DelegateSignature_Params
{
class UWidget* ReturnValue; // 0x0000(0x0008) (ExportObject, Parm, OutParm, ZeroConstructor, ReturnParm, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Widget.GetVisibility
struct UWidget_GetVisibility_Params
{
UMG_ESlateVisibility ReturnValue; // 0x0000(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Widget.GetTickSpaceGeometry
struct UWidget_GetTickSpaceGeometry_Params
{
struct FGeometry ReturnValue; // 0x0000(0x0058) (ConstParm, Parm, OutParm, ReturnParm, ReferenceParm, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
};
// DelegateFunction UMG.Widget.GetText__DelegateSignature
struct UWidget_GetText__DelegateSignature_Params
{
struct FText ReturnValue; // 0x0000(0x0018) (Parm, OutParm, ReturnParm, NativeAccessSpecifierPublic)
};
// DelegateFunction UMG.Widget.GetSlateVisibility__DelegateSignature
struct UWidget_GetSlateVisibility__DelegateSignature_Params
{
UMG_ESlateVisibility ReturnValue; // 0x0000(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// DelegateFunction UMG.Widget.GetSlateColor__DelegateSignature
struct UWidget_GetSlateColor__DelegateSignature_Params
{
struct FSlateColor ReturnValue; // 0x0000(0x0028) (Parm, OutParm, ReturnParm, NativeAccessSpecifierPublic)
};
// DelegateFunction UMG.Widget.GetSlateBrush__DelegateSignature
struct UWidget_GetSlateBrush__DelegateSignature_Params
{
struct FSlateBrush ReturnValue; // 0x0000(0x0088) (Parm, OutParm, ReturnParm, NativeAccessSpecifierPublic)
};
// Function UMG.Widget.GetRenderTransformAngle
struct UWidget_GetRenderTransformAngle_Params
{
float ReturnValue; // 0x0000(0x0004) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Widget.GetRenderOpacity
struct UWidget_GetRenderOpacity_Params
{
float ReturnValue; // 0x0000(0x0004) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Widget.GetParent
struct UWidget_GetParent_Params
{
class UPanelWidget* ReturnValue; // 0x0000(0x0008) (ExportObject, Parm, OutParm, ZeroConstructor, ReturnParm, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Widget.GetPaintSpaceGeometry
struct UWidget_GetPaintSpaceGeometry_Params
{
struct FGeometry ReturnValue; // 0x0000(0x0058) (ConstParm, Parm, OutParm, ReturnParm, ReferenceParm, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
};
// Function UMG.Widget.GetOwningPlayer
struct UWidget_GetOwningPlayer_Params
{
class APlayerController* ReturnValue; // 0x0000(0x0008) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Widget.GetOwningLocalPlayer
struct UWidget_GetOwningLocalPlayer_Params
{
class ULocalPlayer* ReturnValue; // 0x0000(0x0008) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// DelegateFunction UMG.Widget.GetMouseCursor__DelegateSignature
struct UWidget_GetMouseCursor__DelegateSignature_Params
{
TEnumAsByte<CoreUObject_EMouseCursor> ReturnValue; // 0x0000(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// DelegateFunction UMG.Widget.GetLinearColor__DelegateSignature
struct UWidget_GetLinearColor__DelegateSignature_Params
{
struct FLinearColor ReturnValue; // 0x0000(0x0010) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Widget.GetIsEnabled
struct UWidget_GetIsEnabled_Params
{
bool ReturnValue; // 0x0000(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// DelegateFunction UMG.Widget.GetInt32__DelegateSignature
struct UWidget_GetInt32__DelegateSignature_Params
{
int ReturnValue; // 0x0000(0x0004) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Widget.GetGameInstance
struct UWidget_GetGameInstance_Params
{
class UGameInstance* ReturnValue; // 0x0000(0x0008) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// DelegateFunction UMG.Widget.GetFloat__DelegateSignature
struct UWidget_GetFloat__DelegateSignature_Params
{
float ReturnValue; // 0x0000(0x0004) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Widget.GetDesiredSize
struct UWidget_GetDesiredSize_Params
{
struct FVector2D ReturnValue; // 0x0000(0x0008) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Widget.GetClipping
struct UWidget_GetClipping_Params
{
SlateCore_EWidgetClipping ReturnValue; // 0x0000(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// DelegateFunction UMG.Widget.GetCheckBoxState__DelegateSignature
struct UWidget_GetCheckBoxState__DelegateSignature_Params
{
SlateCore_ECheckBoxState ReturnValue; // 0x0000(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Widget.GetCachedGeometry
struct UWidget_GetCachedGeometry_Params
{
struct FGeometry ReturnValue; // 0x0000(0x0058) (ConstParm, Parm, OutParm, ReturnParm, ReferenceParm, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
};
// DelegateFunction UMG.Widget.GetBool__DelegateSignature
struct UWidget_GetBool__DelegateSignature_Params
{
bool ReturnValue; // 0x0000(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// DelegateFunction UMG.Widget.GenerateWidgetForString__DelegateSignature
struct UWidget_GenerateWidgetForString__DelegateSignature_Params
{
struct FString Item; // 0x0000(0x0010) (Parm, ZeroConstructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class UWidget* ReturnValue; // 0x0010(0x0008) (ExportObject, Parm, OutParm, ZeroConstructor, ReturnParm, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// DelegateFunction UMG.Widget.GenerateWidgetForObject__DelegateSignature
struct UWidget_GenerateWidgetForObject__DelegateSignature_Params
{
class UObject* Item; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class UWidget* ReturnValue; // 0x0008(0x0008) (ExportObject, Parm, OutParm, ZeroConstructor, ReturnParm, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Widget.ForceVolatile
struct UWidget_ForceVolatile_Params
{
bool bForce; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Widget.ForceLayoutPrepass
struct UWidget_ForceLayoutPrepass_Params
{
};
// Function UMG.Image.SetOpacity
struct UImage_SetOpacity_Params
{
float InOpacity; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Image.SetColorAndOpacity
struct UImage_SetColorAndOpacity_Params
{
struct FLinearColor InColorAndOpacity; // 0x0000(0x0010) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Image.SetBrushTintColor
struct UImage_SetBrushTintColor_Params
{
struct FSlateColor TintColor; // 0x0000(0x0028) (Parm, NativeAccessSpecifierPublic)
};
// Function UMG.Image.SetBrushSize
struct UImage_SetBrushSize_Params
{
struct FVector2D DesiredSize; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Image.SetBrushResourceObject
struct UImage_SetBrushResourceObject_Params
{
class UObject* ResourceObject; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Image.SetBrushFromTextureDynamic
struct UImage_SetBrushFromTextureDynamic_Params
{
class UTexture2DDynamic* Texture; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool bMatchSize; // 0x0008(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Image.SetBrushFromTexture
struct UImage_SetBrushFromTexture_Params
{
class UTexture2D* Texture; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool bMatchSize; // 0x0008(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Image.SetBrushFromSoftTexture
struct UImage_SetBrushFromSoftTexture_Params
{
bool bMatchSize; // 0x0028(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Image.SetBrushFromSoftPath
struct UImage_SetBrushFromSoftPath_Params
{
struct FSoftObjectPath SoftPath; // 0x0000(0x0018) (ConstParm, Parm, OutParm, ZeroConstructor, ReferenceParm, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool bMatchSize; // 0x0018(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Image.SetBrushFromSoftMaterial
struct UImage_SetBrushFromSoftMaterial_Params
{
};
// Function UMG.Image.SetBrushFromMaterial
struct UImage_SetBrushFromMaterial_Params
{
class UMaterialInterface* Material; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Image.SetBrushFromAtlasInterface
struct UImage_SetBrushFromAtlasInterface_Params
{
bool bMatchSize; // 0x0010(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Image.SetBrushFromAsset
struct UImage_SetBrushFromAsset_Params
{
class USlateBrushAsset* Asset; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Image.SetBrush
struct UImage_SetBrush_Params
{
struct FSlateBrush InBrush; // 0x0000(0x0088) (ConstParm, Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
};
// Function UMG.Image.GetDynamicMaterial
struct UImage_GetDynamicMaterial_Params
{
class UMaterialInstanceDynamic* ReturnValue; // 0x0000(0x0008) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.PanelWidget.RemoveChildAt
struct UPanelWidget_RemoveChildAt_Params
{
int Index; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool ReturnValue; // 0x0004(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.PanelWidget.RemoveChild
struct UPanelWidget_RemoveChild_Params
{
class UWidget* Content; // 0x0000(0x0008) (Parm, ZeroConstructor, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool ReturnValue; // 0x0008(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.PanelWidget.HasChild
struct UPanelWidget_HasChild_Params
{
class UWidget* Content; // 0x0000(0x0008) (Parm, ZeroConstructor, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool ReturnValue; // 0x0008(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.PanelWidget.HasAnyChildren
struct UPanelWidget_HasAnyChildren_Params
{
bool ReturnValue; // 0x0000(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.PanelWidget.GetChildrenCount
struct UPanelWidget_GetChildrenCount_Params
{
int ReturnValue; // 0x0000(0x0004) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.PanelWidget.GetChildIndex
struct UPanelWidget_GetChildIndex_Params
{
class UWidget* Content; // 0x0000(0x0008) (ConstParm, Parm, ZeroConstructor, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
int ReturnValue; // 0x0008(0x0004) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.PanelWidget.GetChildAt
struct UPanelWidget_GetChildAt_Params
{
int Index; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class UWidget* ReturnValue; // 0x0008(0x0008) (ExportObject, Parm, OutParm, ZeroConstructor, ReturnParm, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.PanelWidget.GetAllChildren
struct UPanelWidget_GetAllChildren_Params
{
TArray<class UWidget*> ReturnValue; // 0x0000(0x0010) (ExportObject, Parm, OutParm, ZeroConstructor, ReturnParm, ContainsInstancedReference, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.PanelWidget.ClearChildren
struct UPanelWidget_ClearChildren_Params
{
};
// Function UMG.PanelWidget.AddChild
struct UPanelWidget_AddChild_Params
{
class UWidget* Content; // 0x0000(0x0008) (Parm, ZeroConstructor, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class UPanelSlot* ReturnValue; // 0x0008(0x0008) (ExportObject, Parm, OutParm, ZeroConstructor, ReturnParm, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.CanvasPanel.AddChildToCanvas
struct UCanvasPanel_AddChildToCanvas_Params
{
class UWidget* Content; // 0x0000(0x0008) (Parm, ZeroConstructor, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class UCanvasPanelSlot* ReturnValue; // 0x0008(0x0008) (ExportObject, Parm, OutParm, ZeroConstructor, ReturnParm, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UMGSequencePlayer.SetUserTag
struct UUMGSequencePlayer_SetUserTag_Params
{
struct FName InUserTag; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UMGSequencePlayer.GetUserTag
struct UUMGSequencePlayer_GetUserTag_Params
{
struct FName ReturnValue; // 0x0000(0x0008) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.UnregisterInputComponent
struct UUserWidget_UnregisterInputComponent_Params
{
};
// Function UMG.UserWidget.UnbindFromAnimationStarted
struct UUserWidget_UnbindFromAnimationStarted_Params
{
class UWidgetAnimation* Animation; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FScriptDelegate Delegate; // 0x0008(0x0010) (Parm, ZeroConstructor, NoDestructor, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.UnbindFromAnimationFinished
struct UUserWidget_UnbindFromAnimationFinished_Params
{
class UWidgetAnimation* Animation; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FScriptDelegate Delegate; // 0x0008(0x0010) (Parm, ZeroConstructor, NoDestructor, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.UnbindAllFromAnimationStarted
struct UUserWidget_UnbindAllFromAnimationStarted_Params
{
class UWidgetAnimation* Animation; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.UnbindAllFromAnimationFinished
struct UUserWidget_UnbindAllFromAnimationFinished_Params
{
class UWidgetAnimation* Animation; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.Tick
struct UUserWidget_Tick_Params
{
struct FGeometry MyGeometry; // 0x0000(0x0058) (Parm, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
float InDeltaTime; // 0x0058(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.StopListeningForInputAction
struct UUserWidget_StopListeningForInputAction_Params
{
struct FName ActionName; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
TEnumAsByte<Engine_EInputEvent> EventType; // 0x0008(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.StopListeningForAllInputActions
struct UUserWidget_StopListeningForAllInputActions_Params
{
};
// Function UMG.UserWidget.StopAnimationsAndLatentActions
struct UUserWidget_StopAnimationsAndLatentActions_Params
{
};
// Function UMG.UserWidget.StopAnimation
struct UUserWidget_StopAnimation_Params
{
class UWidgetAnimation* InAnimation; // 0x0000(0x0008) (ConstParm, Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.StopAllAnimations
struct UUserWidget_StopAllAnimations_Params
{
};
// Function UMG.UserWidget.SetZOrderInViewport
struct UUserWidget_SetZOrderInViewport_Params
{
int ZOrder; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, AdvancedDisplay, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.SetPositionInViewport
struct UUserWidget_SetPositionInViewport_Params
{
struct FVector2D Position; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool bRemoveDPIScale; // 0x0008(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.SetPlaybackSpeed
struct UUserWidget_SetPlaybackSpeed_Params
{
class UWidgetAnimation* InAnimation; // 0x0000(0x0008) (ConstParm, Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
float PlaybackSpeed; // 0x0008(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.SetPadding
struct UUserWidget_SetPadding_Params
{
struct FMargin InPadding; // 0x0000(0x0010) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.SetOwningPlayer
struct UUserWidget_SetOwningPlayer_Params
{
class APlayerController* LocalPlayerController; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.SetNumLoopsToPlay
struct UUserWidget_SetNumLoopsToPlay_Params
{
class UWidgetAnimation* InAnimation; // 0x0000(0x0008) (ConstParm, Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
int NumLoopsToPlay; // 0x0008(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.SetInputActionPriority
struct UUserWidget_SetInputActionPriority_Params
{
int NewPriority; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.SetInputActionBlocking
struct UUserWidget_SetInputActionBlocking_Params
{
bool bShouldBlock; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.SetForegroundColor
struct UUserWidget_SetForegroundColor_Params
{
struct FSlateColor InForegroundColor; // 0x0000(0x0028) (Parm, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.SetDesiredSizeInViewport
struct UUserWidget_SetDesiredSizeInViewport_Params
{
struct FVector2D Size; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.SetColorAndOpacity
struct UUserWidget_SetColorAndOpacity_Params
{
struct FLinearColor InColorAndOpacity; // 0x0000(0x0010) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.SetAnchorsInViewport
struct UUserWidget_SetAnchorsInViewport_Params
{
struct FAnchors Anchors; // 0x0000(0x0010) (Parm, NoDestructor, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.SetAlignmentInViewport
struct UUserWidget_SetAlignmentInViewport_Params
{
struct FVector2D Alignment; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.ReverseAnimation
struct UUserWidget_ReverseAnimation_Params
{
class UWidgetAnimation* InAnimation; // 0x0000(0x0008) (ConstParm, Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.RemoveFromViewport
struct UUserWidget_RemoveFromViewport_Params
{
};
// Function UMG.UserWidget.RegisterInputComponent
struct UUserWidget_RegisterInputComponent_Params
{
};
// Function UMG.UserWidget.PreConstruct
struct UUserWidget_PreConstruct_Params
{
bool IsDesignTime; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.PlaySound
struct UUserWidget_PlaySound_Params
{
class USoundBase* SoundToPlay; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.PlayAnimationTimeRange
struct UUserWidget_PlayAnimationTimeRange_Params
{
class UWidgetAnimation* InAnimation; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
float StartAtTime; // 0x0008(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
float EndAtTime; // 0x000C(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
int NumLoopsToPlay; // 0x0010(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
TEnumAsByte<UMG_EUMGSequencePlayMode> PlayMode; // 0x0014(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
float PlaybackSpeed; // 0x0018(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool bRestoreState; // 0x001C(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class UUMGSequencePlayer* ReturnValue; // 0x0020(0x0008) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.PlayAnimationReverse
struct UUserWidget_PlayAnimationReverse_Params
{
class UWidgetAnimation* InAnimation; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
float PlaybackSpeed; // 0x0008(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool bRestoreState; // 0x000C(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class UUMGSequencePlayer* ReturnValue; // 0x0010(0x0008) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.PlayAnimationForward
struct UUserWidget_PlayAnimationForward_Params
{
class UWidgetAnimation* InAnimation; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
float PlaybackSpeed; // 0x0008(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool bRestoreState; // 0x000C(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class UUMGSequencePlayer* ReturnValue; // 0x0010(0x0008) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.PlayAnimation
struct UUserWidget_PlayAnimation_Params
{
class UWidgetAnimation* InAnimation; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
float StartAtTime; // 0x0008(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
int NumLoopsToPlay; // 0x000C(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
TEnumAsByte<UMG_EUMGSequencePlayMode> PlayMode; // 0x0010(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
float PlaybackSpeed; // 0x0014(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool bRestoreState; // 0x0018(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool bEvaluateFirstFrame; // 0x0019(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class UUMGSequencePlayer* ReturnValue; // 0x0020(0x0008) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.PauseAnimation
struct UUserWidget_PauseAnimation_Params
{
class UWidgetAnimation* InAnimation; // 0x0000(0x0008) (ConstParm, Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
float ReturnValue; // 0x0008(0x0004) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.OnTouchStarted
struct UUserWidget_OnTouchStarted_Params
{
struct FGeometry MyGeometry; // 0x0000(0x0058) (Parm, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
struct FPointerEvent InTouchEvent; // 0x0058(0x0070) (ConstParm, Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
struct FEventReply ReturnValue; // 0x00C8(0x00C0) (Parm, OutParm, ReturnParm, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.OnTouchMoved
struct UUserWidget_OnTouchMoved_Params
{
struct FGeometry MyGeometry; // 0x0000(0x0058) (Parm, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
struct FPointerEvent InTouchEvent; // 0x0058(0x0070) (ConstParm, Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
struct FEventReply ReturnValue; // 0x00C8(0x00C0) (Parm, OutParm, ReturnParm, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.OnTouchGesture
struct UUserWidget_OnTouchGesture_Params
{
struct FGeometry MyGeometry; // 0x0000(0x0058) (Parm, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
struct FPointerEvent GestureEvent; // 0x0058(0x0070) (ConstParm, Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
struct FEventReply ReturnValue; // 0x00C8(0x00C0) (Parm, OutParm, ReturnParm, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.OnTouchForceChanged
struct UUserWidget_OnTouchForceChanged_Params
{
struct FGeometry MyGeometry; // 0x0000(0x0058) (Parm, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
struct FPointerEvent InTouchEvent; // 0x0058(0x0070) (ConstParm, Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
struct FEventReply ReturnValue; // 0x00C8(0x00C0) (Parm, OutParm, ReturnParm, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.OnTouchEnded
struct UUserWidget_OnTouchEnded_Params
{
struct FGeometry MyGeometry; // 0x0000(0x0058) (Parm, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
struct FPointerEvent InTouchEvent; // 0x0058(0x0070) (ConstParm, Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
struct FEventReply ReturnValue; // 0x00C8(0x00C0) (Parm, OutParm, ReturnParm, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.OnRemovedFromFocusPath
struct UUserWidget_OnRemovedFromFocusPath_Params
{
struct FFocusEvent InFocusEvent; // 0x0000(0x0008) (Parm, NoDestructor, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.OnPreviewMouseButtonDown
struct UUserWidget_OnPreviewMouseButtonDown_Params
{
struct FGeometry MyGeometry; // 0x0000(0x0058) (Parm, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
struct FPointerEvent MouseEvent; // 0x0058(0x0070) (ConstParm, Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
struct FEventReply ReturnValue; // 0x00C8(0x00C0) (Parm, OutParm, ReturnParm, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.OnPreviewKeyDown
struct UUserWidget_OnPreviewKeyDown_Params
{
struct FGeometry MyGeometry; // 0x0000(0x0058) (Parm, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
struct FKeyEvent InKeyEvent; // 0x0058(0x0038) (Parm, NativeAccessSpecifierPublic)
struct FEventReply ReturnValue; // 0x0090(0x00C0) (Parm, OutParm, ReturnParm, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.OnPaint
struct UUserWidget_OnPaint_Params
{
struct FPaintContext Context; // 0x0000(0x0030) (Parm, OutParm, ReferenceParm, NoDestructor, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.OnMouseWheel
struct UUserWidget_OnMouseWheel_Params
{
struct FGeometry MyGeometry; // 0x0000(0x0058) (Parm, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
struct FPointerEvent MouseEvent; // 0x0058(0x0070) (ConstParm, Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
struct FEventReply ReturnValue; // 0x00C8(0x00C0) (Parm, OutParm, ReturnParm, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.OnMouseMove
struct UUserWidget_OnMouseMove_Params
{
struct FGeometry MyGeometry; // 0x0000(0x0058) (Parm, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
struct FPointerEvent MouseEvent; // 0x0058(0x0070) (ConstParm, Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
struct FEventReply ReturnValue; // 0x00C8(0x00C0) (Parm, OutParm, ReturnParm, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.OnMouseLeave
struct UUserWidget_OnMouseLeave_Params
{
struct FPointerEvent MouseEvent; // 0x0000(0x0070) (ConstParm, Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.OnMouseEnter
struct UUserWidget_OnMouseEnter_Params
{
struct FGeometry MyGeometry; // 0x0000(0x0058) (Parm, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
struct FPointerEvent MouseEvent; // 0x0058(0x0070) (ConstParm, Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.OnMouseCaptureLost
struct UUserWidget_OnMouseCaptureLost_Params
{
};
// Function UMG.UserWidget.OnMouseButtonUp
struct UUserWidget_OnMouseButtonUp_Params
{
struct FGeometry MyGeometry; // 0x0000(0x0058) (Parm, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
struct FPointerEvent MouseEvent; // 0x0058(0x0070) (ConstParm, Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
struct FEventReply ReturnValue; // 0x00C8(0x00C0) (Parm, OutParm, ReturnParm, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.OnMouseButtonDown
struct UUserWidget_OnMouseButtonDown_Params
{
struct FGeometry MyGeometry; // 0x0000(0x0058) (Parm, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
struct FPointerEvent MouseEvent; // 0x0058(0x0070) (ConstParm, Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
struct FEventReply ReturnValue; // 0x00C8(0x00C0) (Parm, OutParm, ReturnParm, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.OnMouseButtonDoubleClick
struct UUserWidget_OnMouseButtonDoubleClick_Params
{
struct FGeometry InMyGeometry; // 0x0000(0x0058) (Parm, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
struct FPointerEvent InMouseEvent; // 0x0058(0x0070) (ConstParm, Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
struct FEventReply ReturnValue; // 0x00C8(0x00C0) (Parm, OutParm, ReturnParm, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.OnMotionDetected
struct UUserWidget_OnMotionDetected_Params
{
struct FGeometry MyGeometry; // 0x0000(0x0058) (Parm, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
struct FMotionEvent InMotionEvent; // 0x0058(0x0048) (Parm, NativeAccessSpecifierPublic)
struct FEventReply ReturnValue; // 0x00A0(0x00C0) (Parm, OutParm, ReturnParm, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.OnKeyUp
struct UUserWidget_OnKeyUp_Params
{
struct FGeometry MyGeometry; // 0x0000(0x0058) (Parm, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
struct FKeyEvent InKeyEvent; // 0x0058(0x0038) (Parm, NativeAccessSpecifierPublic)
struct FEventReply ReturnValue; // 0x0090(0x00C0) (Parm, OutParm, ReturnParm, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.OnKeyDown
struct UUserWidget_OnKeyDown_Params
{
struct FGeometry MyGeometry; // 0x0000(0x0058) (Parm, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
struct FKeyEvent InKeyEvent; // 0x0058(0x0038) (Parm, NativeAccessSpecifierPublic)
struct FEventReply ReturnValue; // 0x0090(0x00C0) (Parm, OutParm, ReturnParm, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.OnKeyChar
struct UUserWidget_OnKeyChar_Params
{
struct FGeometry MyGeometry; // 0x0000(0x0058) (Parm, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
struct FCharacterEvent InCharacterEvent; // 0x0058(0x0020) (Parm, NativeAccessSpecifierPublic)
struct FEventReply ReturnValue; // 0x0078(0x00C0) (Parm, OutParm, ReturnParm, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.OnInitialized
struct UUserWidget_OnInitialized_Params
{
};
// Function UMG.UserWidget.OnFocusReceived
struct UUserWidget_OnFocusReceived_Params
{
struct FGeometry MyGeometry; // 0x0000(0x0058) (Parm, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
struct FFocusEvent InFocusEvent; // 0x0058(0x0008) (Parm, NoDestructor, NativeAccessSpecifierPublic)
struct FEventReply ReturnValue; // 0x0060(0x00C0) (Parm, OutParm, ReturnParm, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.OnFocusLost
struct UUserWidget_OnFocusLost_Params
{
struct FFocusEvent InFocusEvent; // 0x0000(0x0008) (Parm, NoDestructor, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.OnDrop
struct UUserWidget_OnDrop_Params
{
struct FGeometry MyGeometry; // 0x0000(0x0058) (Parm, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
struct FPointerEvent PointerEvent; // 0x0058(0x0070) (Parm, NativeAccessSpecifierPublic)
class UDragDropOperation* Operation; // 0x00C8(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool ReturnValue; // 0x00D0(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.OnDragOver
struct UUserWidget_OnDragOver_Params
{
struct FGeometry MyGeometry; // 0x0000(0x0058) (Parm, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
struct FPointerEvent PointerEvent; // 0x0058(0x0070) (Parm, NativeAccessSpecifierPublic)
class UDragDropOperation* Operation; // 0x00C8(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool ReturnValue; // 0x00D0(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.OnDragLeave
struct UUserWidget_OnDragLeave_Params
{
struct FPointerEvent PointerEvent; // 0x0000(0x0070) (Parm, NativeAccessSpecifierPublic)
class UDragDropOperation* Operation; // 0x0070(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.OnDragEnter
struct UUserWidget_OnDragEnter_Params
{
struct FGeometry MyGeometry; // 0x0000(0x0058) (Parm, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
struct FPointerEvent PointerEvent; // 0x0058(0x0070) (Parm, NativeAccessSpecifierPublic)
class UDragDropOperation* Operation; // 0x00C8(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.OnDragDetected
struct UUserWidget_OnDragDetected_Params
{
struct FGeometry MyGeometry; // 0x0000(0x0058) (Parm, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
struct FPointerEvent PointerEvent; // 0x0058(0x0070) (ConstParm, Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
class UDragDropOperation* Operation; // 0x00C8(0x0008) (Parm, OutParm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.OnDragCancelled
struct UUserWidget_OnDragCancelled_Params
{
struct FPointerEvent PointerEvent; // 0x0000(0x0070) (ConstParm, Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
class UDragDropOperation* Operation; // 0x0070(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.OnAnimationStarted
struct UUserWidget_OnAnimationStarted_Params
{
class UWidgetAnimation* Animation; // 0x0000(0x0008) (ConstParm, Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.OnAnimationFinished
struct UUserWidget_OnAnimationFinished_Params
{
class UWidgetAnimation* Animation; // 0x0000(0x0008) (ConstParm, Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.OnAnalogValueChanged
struct UUserWidget_OnAnalogValueChanged_Params
{
struct FGeometry MyGeometry; // 0x0000(0x0058) (Parm, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
struct FAnalogInputEvent InAnalogInputEvent; // 0x0058(0x0040) (Parm, NativeAccessSpecifierPublic)
struct FEventReply ReturnValue; // 0x0098(0x00C0) (Parm, OutParm, ReturnParm, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.OnAddedToFocusPath
struct UUserWidget_OnAddedToFocusPath_Params
{
struct FFocusEvent InFocusEvent; // 0x0000(0x0008) (Parm, NoDestructor, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.ListenForInputAction
struct UUserWidget_ListenForInputAction_Params
{
struct FName ActionName; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
TEnumAsByte<Engine_EInputEvent> EventType; // 0x0008(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool bConsume; // 0x0009(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FScriptDelegate Callback; // 0x000C(0x0010) (Parm, ZeroConstructor, NoDestructor, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.IsPlayingAnimation
struct UUserWidget_IsPlayingAnimation_Params
{
bool ReturnValue; // 0x0000(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.IsListeningForInputAction
struct UUserWidget_IsListeningForInputAction_Params
{
struct FName ActionName; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool ReturnValue; // 0x0008(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.IsInViewport
struct UUserWidget_IsInViewport_Params
{
bool ReturnValue; // 0x0000(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.IsInteractable
struct UUserWidget_IsInteractable_Params
{
bool ReturnValue; // 0x0000(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.IsAnyAnimationPlaying
struct UUserWidget_IsAnyAnimationPlaying_Params
{
bool ReturnValue; // 0x0000(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.IsAnimationPlayingForward
struct UUserWidget_IsAnimationPlayingForward_Params
{
class UWidgetAnimation* InAnimation; // 0x0000(0x0008) (ConstParm, Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool ReturnValue; // 0x0008(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.IsAnimationPlaying
struct UUserWidget_IsAnimationPlaying_Params
{
class UWidgetAnimation* InAnimation; // 0x0000(0x0008) (ConstParm, Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool ReturnValue; // 0x0008(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.GetOwningPlayerPawn
struct UUserWidget_GetOwningPlayerPawn_Params
{
class APawn* ReturnValue; // 0x0000(0x0008) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.GetIsVisible
struct UUserWidget_GetIsVisible_Params
{
bool ReturnValue; // 0x0000(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.GetAnimationCurrentTime
struct UUserWidget_GetAnimationCurrentTime_Params
{
class UWidgetAnimation* InAnimation; // 0x0000(0x0008) (ConstParm, Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
float ReturnValue; // 0x0008(0x0004) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.GetAnchorsInViewport
struct UUserWidget_GetAnchorsInViewport_Params
{
struct FAnchors ReturnValue; // 0x0000(0x0010) (Parm, OutParm, ReturnParm, NoDestructor, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.GetAlignmentInViewport
struct UUserWidget_GetAlignmentInViewport_Params
{
struct FVector2D ReturnValue; // 0x0000(0x0008) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.Destruct
struct UUserWidget_Destruct_Params
{
};
// Function UMG.UserWidget.Construct
struct UUserWidget_Construct_Params
{
};
// Function UMG.UserWidget.CancelLatentActions
struct UUserWidget_CancelLatentActions_Params
{
};
// Function UMG.UserWidget.BindToAnimationStarted
struct UUserWidget_BindToAnimationStarted_Params
{
class UWidgetAnimation* Animation; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FScriptDelegate Delegate; // 0x0008(0x0010) (Parm, ZeroConstructor, NoDestructor, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.BindToAnimationFinished
struct UUserWidget_BindToAnimationFinished_Params
{
class UWidgetAnimation* Animation; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FScriptDelegate Delegate; // 0x0008(0x0010) (Parm, ZeroConstructor, NoDestructor, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.BindToAnimationEvent
struct UUserWidget_BindToAnimationEvent_Params
{
class UWidgetAnimation* Animation; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FScriptDelegate Delegate; // 0x0008(0x0010) (Parm, ZeroConstructor, NoDestructor, NativeAccessSpecifierPublic)
UMG_EWidgetAnimationEvent AnimationEvent; // 0x0018(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FName UserTag; // 0x001C(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.AddToViewport
struct UUserWidget_AddToViewport_Params
{
int ZOrder; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, AdvancedDisplay, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UserWidget.AddToPlayerScreen
struct UUserWidget_AddToPlayerScreen_Params
{
int ZOrder; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, AdvancedDisplay, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool ReturnValue; // 0x0004(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ContentWidget.SetContent
struct UContentWidget_SetContent_Params
{
class UWidget* Content; // 0x0000(0x0008) (Parm, ZeroConstructor, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class UPanelSlot* ReturnValue; // 0x0008(0x0008) (ExportObject, Parm, OutParm, ZeroConstructor, ReturnParm, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ContentWidget.GetContentSlot
struct UContentWidget_GetContentSlot_Params
{
class UPanelSlot* ReturnValue; // 0x0000(0x0008) (ExportObject, Parm, OutParm, ZeroConstructor, ReturnParm, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ContentWidget.GetContent
struct UContentWidget_GetContent_Params
{
class UWidget* ReturnValue; // 0x0000(0x0008) (ExportObject, Parm, OutParm, ZeroConstructor, ReturnParm, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.EditableTextBox.SetText
struct UEditableTextBox_SetText_Params
{
struct FText InText; // 0x0000(0x0018) (Parm, NativeAccessSpecifierPublic)
};
// Function UMG.EditableTextBox.SetJustification
struct UEditableTextBox_SetJustification_Params
{
TEnumAsByte<Slate_ETextJustify> InJustification; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.EditableTextBox.SetIsReadOnly
struct UEditableTextBox_SetIsReadOnly_Params
{
bool bReadOnly; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.EditableTextBox.SetIsPassword
struct UEditableTextBox_SetIsPassword_Params
{
bool bIsPassword; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.EditableTextBox.SetHintText
struct UEditableTextBox_SetHintText_Params
{
struct FText InText; // 0x0000(0x0018) (Parm, NativeAccessSpecifierPublic)
};
// Function UMG.EditableTextBox.SetError
struct UEditableTextBox_SetError_Params
{
struct FText InError; // 0x0000(0x0018) (Parm, NativeAccessSpecifierPublic)
};
// DelegateFunction UMG.EditableTextBox.OnEditableTextBoxCommittedEvent__DelegateSignature
struct UEditableTextBox_OnEditableTextBoxCommittedEvent__DelegateSignature_Params
{
struct FText Text; // 0x0000(0x0018) (ConstParm, Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
TEnumAsByte<SlateCore_ETextCommit> CommitMethod; // 0x0018(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// DelegateFunction UMG.EditableTextBox.OnEditableTextBoxChangedEvent__DelegateSignature
struct UEditableTextBox_OnEditableTextBoxChangedEvent__DelegateSignature_Params
{
struct FText Text; // 0x0000(0x0018) (ConstParm, Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
};
// Function UMG.EditableTextBox.HasError
struct UEditableTextBox_HasError_Params
{
bool ReturnValue; // 0x0000(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.EditableTextBox.GetText
struct UEditableTextBox_GetText_Params
{
struct FText ReturnValue; // 0x0000(0x0018) (Parm, OutParm, ReturnParm, NativeAccessSpecifierPublic)
};
// Function UMG.EditableTextBox.ClearError
struct UEditableTextBox_ClearError_Params
{
};
// Function UMG.Border.SetVerticalAlignment
struct UBorder_SetVerticalAlignment_Params
{
TEnumAsByte<SlateCore_EVerticalAlignment> InVerticalAlignment; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Border.SetPadding
struct UBorder_SetPadding_Params
{
struct FMargin InPadding; // 0x0000(0x0010) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
};
// Function UMG.Border.SetHorizontalAlignment
struct UBorder_SetHorizontalAlignment_Params
{
TEnumAsByte<SlateCore_EHorizontalAlignment> InHorizontalAlignment; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Border.SetDesiredSizeScale
struct UBorder_SetDesiredSizeScale_Params
{
struct FVector2D InScale; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Border.SetContentColorAndOpacity
struct UBorder_SetContentColorAndOpacity_Params
{
struct FLinearColor InContentColorAndOpacity; // 0x0000(0x0010) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Border.SetBrushFromTexture
struct UBorder_SetBrushFromTexture_Params
{
class UTexture2D* Texture; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Border.SetBrushFromMaterial
struct UBorder_SetBrushFromMaterial_Params
{
class UMaterialInterface* Material; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Border.SetBrushFromAsset
struct UBorder_SetBrushFromAsset_Params
{
class USlateBrushAsset* Asset; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Border.SetBrushColor
struct UBorder_SetBrushColor_Params
{
struct FLinearColor InBrushColor; // 0x0000(0x0010) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Border.SetBrush
struct UBorder_SetBrush_Params
{
struct FSlateBrush InBrush; // 0x0000(0x0088) (ConstParm, Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
};
// Function UMG.Border.GetDynamicMaterial
struct UBorder_GetDynamicMaterial_Params
{
class UMaterialInstanceDynamic* ReturnValue; // 0x0000(0x0008) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ScrollBox.SetWheelScrollMultiplier
struct UScrollBox_SetWheelScrollMultiplier_Params
{
float NewWheelScrollMultiplier; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ScrollBox.SetScrollOffset
struct UScrollBox_SetScrollOffset_Params
{
float NewScrollOffset; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ScrollBox.SetScrollBarVisibility
struct UScrollBox_SetScrollBarVisibility_Params
{
UMG_ESlateVisibility NewScrollBarVisibility; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ScrollBox.SetScrollbarThickness
struct UScrollBox_SetScrollbarThickness_Params
{
struct FVector2D NewScrollbarThickness; // 0x0000(0x0008) (ConstParm, Parm, OutParm, ZeroConstructor, ReferenceParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ScrollBox.SetScrollbarPadding
struct UScrollBox_SetScrollbarPadding_Params
{
struct FMargin NewScrollbarPadding; // 0x0000(0x0010) (ConstParm, Parm, OutParm, ZeroConstructor, ReferenceParm, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
};
// Function UMG.ScrollBox.SetOrientation
struct UScrollBox_SetOrientation_Params
{
TEnumAsByte<SlateCore_EOrientation> NewOrientation; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ScrollBox.SetConsumeMouseWheel
struct UScrollBox_SetConsumeMouseWheel_Params
{
SlateCore_EConsumeMouseWheel NewConsumeMouseWheel; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ScrollBox.SetAnimateWheelScrolling
struct UScrollBox_SetAnimateWheelScrolling_Params
{
bool bShouldAnimateWheelScrolling; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ScrollBox.SetAlwaysShowScrollbar
struct UScrollBox_SetAlwaysShowScrollbar_Params
{
bool NewAlwaysShowScrollbar; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ScrollBox.SetAllowOverscroll
struct UScrollBox_SetAllowOverscroll_Params
{
bool NewAllowOverscroll; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ScrollBox.ScrollWidgetIntoView
struct UScrollBox_ScrollWidgetIntoView_Params
{
class UWidget* WidgetToFind; // 0x0000(0x0008) (Parm, ZeroConstructor, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool AnimateScroll; // 0x0008(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
Slate_EDescendantScrollDestination ScrollDestination; // 0x0009(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
float Padding; // 0x000C(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ScrollBox.ScrollToStart
struct UScrollBox_ScrollToStart_Params
{
};
// Function UMG.ScrollBox.ScrollToEnd
struct UScrollBox_ScrollToEnd_Params
{
};
// Function UMG.ScrollBox.GetViewOffsetFraction
struct UScrollBox_GetViewOffsetFraction_Params
{
float ReturnValue; // 0x0000(0x0004) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ScrollBox.GetScrollOffsetOfEnd
struct UScrollBox_GetScrollOffsetOfEnd_Params
{
float ReturnValue; // 0x0000(0x0004) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ScrollBox.GetScrollOffset
struct UScrollBox_GetScrollOffset_Params
{
float ReturnValue; // 0x0000(0x0004) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ScrollBox.EndInertialScrolling
struct UScrollBox_EndInertialScrolling_Params
{
};
// Function UMG.GridPanel.SetRowFill
struct UGridPanel_SetRowFill_Params
{
int ColumnIndex; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
float Coefficient; // 0x0004(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.GridPanel.SetColumnFill
struct UGridPanel_SetColumnFill_Params
{
int ColumnIndex; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
float Coefficient; // 0x0004(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.GridPanel.AddChildToGrid
struct UGridPanel_AddChildToGrid_Params
{
class UWidget* Content; // 0x0000(0x0008) (Parm, ZeroConstructor, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
int InRow; // 0x0008(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
int InColumn; // 0x000C(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class UGridSlot* ReturnValue; // 0x0010(0x0008) (ExportObject, Parm, OutParm, ZeroConstructor, ReturnParm, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.VerticalBox.AddChildToVerticalBox
struct UVerticalBox_AddChildToVerticalBox_Params
{
class UWidget* Content; // 0x0000(0x0008) (Parm, ZeroConstructor, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class UVerticalBoxSlot* ReturnValue; // 0x0008(0x0008) (ExportObject, Parm, OutParm, ZeroConstructor, ReturnParm, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ListViewBase.SetWheelScrollMultiplier
struct UListViewBase_SetWheelScrollMultiplier_Params
{
float NewWheelScrollMultiplier; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ListViewBase.SetScrollOffset
struct UListViewBase_SetScrollOffset_Params
{
float InScrollOffset; // 0x0000(0x0004) (ConstParm, Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ListViewBase.SetScrollBarVisibility
struct UListViewBase_SetScrollBarVisibility_Params
{
UMG_ESlateVisibility InVisibility; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ListViewBase.ScrollToTop
struct UListViewBase_ScrollToTop_Params
{
};
// Function UMG.ListViewBase.ScrollToBottom
struct UListViewBase_ScrollToBottom_Params
{
};
// Function UMG.ListViewBase.RequestRefresh
struct UListViewBase_RequestRefresh_Params
{
};
// Function UMG.ListViewBase.RegenerateAllEntries
struct UListViewBase_RegenerateAllEntries_Params
{
};
// Function UMG.ListViewBase.GetDisplayedEntryWidgets
struct UListViewBase_GetDisplayedEntryWidgets_Params
{
TArray<class UUserWidget*> ReturnValue; // 0x0000(0x0010) (ConstParm, ExportObject, Parm, OutParm, ZeroConstructor, ReturnParm, ReferenceParm, ContainsInstancedReference, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ListView.SetSelectionMode
struct UListView_SetSelectionMode_Params
{
TEnumAsByte<Slate_ESelectionMode> SelectionMode; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ListView.SetSelectedIndex
struct UListView_SetSelectedIndex_Params
{
int Index; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ListView.ScrollIndexIntoView
struct UListView_ScrollIndexIntoView_Params
{
int Index; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ListView.RemoveItem
struct UListView_RemoveItem_Params
{
class UObject* Item; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ListView.NavigateToIndex
struct UListView_NavigateToIndex_Params
{
int Index; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ListView.IsRefreshPending
struct UListView_IsRefreshPending_Params
{
bool ReturnValue; // 0x0000(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ListView.GetNumItems
struct UListView_GetNumItems_Params
{
int ReturnValue; // 0x0000(0x0004) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ListView.GetListItems
struct UListView_GetListItems_Params
{
TArray<class UObject*> ReturnValue; // 0x0000(0x0010) (ConstParm, Parm, OutParm, ZeroConstructor, ReturnParm, ReferenceParm, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ListView.GetItemAt
struct UListView_GetItemAt_Params
{
int Index; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class UObject* ReturnValue; // 0x0008(0x0008) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ListView.GetIndexForItem
struct UListView_GetIndexForItem_Params
{
class UObject* Item; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
int ReturnValue; // 0x0008(0x0004) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ListView.ClearListItems
struct UListView_ClearListItems_Params
{
};
// Function UMG.ListView.BP_SetSelectedItem
struct UListView_BP_SetSelectedItem_Params
{
class UObject* Item; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ListView.BP_SetListItems
struct UListView_BP_SetListItems_Params
{
TArray<class UObject*> InListItems; // 0x0000(0x0010) (ConstParm, Parm, OutParm, ZeroConstructor, ReferenceParm, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ListView.BP_SetItemSelection
struct UListView_BP_SetItemSelection_Params
{
class UObject* Item; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool bSelected; // 0x0008(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ListView.BP_ScrollItemIntoView
struct UListView_BP_ScrollItemIntoView_Params
{
class UObject* Item; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ListView.BP_NavigateToItem
struct UListView_BP_NavigateToItem_Params
{
class UObject* Item; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ListView.BP_IsItemVisible
struct UListView_BP_IsItemVisible_Params
{
class UObject* Item; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool ReturnValue; // 0x0008(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ListView.BP_GetSelectedItems
struct UListView_BP_GetSelectedItems_Params
{
TArray<class UObject*> Items; // 0x0000(0x0010) (Parm, OutParm, ZeroConstructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool ReturnValue; // 0x0010(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ListView.BP_GetSelectedItem
struct UListView_BP_GetSelectedItem_Params
{
class UObject* ReturnValue; // 0x0000(0x0008) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ListView.BP_GetNumItemsSelected
struct UListView_BP_GetNumItemsSelected_Params
{
int ReturnValue; // 0x0000(0x0004) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ListView.BP_ClearSelection
struct UListView_BP_ClearSelection_Params
{
};
// Function UMG.ListView.BP_CancelScrollIntoView
struct UListView_BP_CancelScrollIntoView_Params
{
};
// Function UMG.ListView.AddItem
struct UListView_AddItem_Params
{
class UObject* Item; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.TreeView.SetItemExpansion
struct UTreeView_SetItemExpansion_Params
{
class UObject* Item; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool bExpandItem; // 0x0008(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.TreeView.ExpandAll
struct UTreeView_ExpandAll_Params
{
};
// Function UMG.TreeView.CollapseAll
struct UTreeView_CollapseAll_Params
{
};
// Function UMG.AsyncTaskDownloadImage.DownloadImage
struct UAsyncTaskDownloadImage_DownloadImage_Params
{
struct FString URL; // 0x0000(0x0010) (Parm, ZeroConstructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class UAsyncTaskDownloadImage* ReturnValue; // 0x0010(0x0008) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.BackgroundBlur.SetVerticalAlignment
struct UBackgroundBlur_SetVerticalAlignment_Params
{
TEnumAsByte<SlateCore_EVerticalAlignment> InVerticalAlignment; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.BackgroundBlur.SetPadding
struct UBackgroundBlur_SetPadding_Params
{
struct FMargin InPadding; // 0x0000(0x0010) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
};
// Function UMG.BackgroundBlur.SetLowQualityFallbackBrush
struct UBackgroundBlur_SetLowQualityFallbackBrush_Params
{
struct FSlateBrush InBrush; // 0x0000(0x0088) (ConstParm, Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
};
// Function UMG.BackgroundBlur.SetHorizontalAlignment
struct UBackgroundBlur_SetHorizontalAlignment_Params
{
TEnumAsByte<SlateCore_EHorizontalAlignment> InHorizontalAlignment; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.BackgroundBlur.SetBlurStrength
struct UBackgroundBlur_SetBlurStrength_Params
{
float InStrength; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.BackgroundBlur.SetBlurRadius
struct UBackgroundBlur_SetBlurRadius_Params
{
int InBlurRadius; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.BackgroundBlur.SetApplyAlphaToBlur
struct UBackgroundBlur_SetApplyAlphaToBlur_Params
{
bool bInApplyAlphaToBlur; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.BackgroundBlurSlot.SetVerticalAlignment
struct UBackgroundBlurSlot_SetVerticalAlignment_Params
{
TEnumAsByte<SlateCore_EVerticalAlignment> InVerticalAlignment; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.BackgroundBlurSlot.SetPadding
struct UBackgroundBlurSlot_SetPadding_Params
{
struct FMargin InPadding; // 0x0000(0x0010) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
};
// Function UMG.BackgroundBlurSlot.SetHorizontalAlignment
struct UBackgroundBlurSlot_SetHorizontalAlignment_Params
{
TEnumAsByte<SlateCore_EHorizontalAlignment> InHorizontalAlignment; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.BoolBinding.GetValue
struct UBoolBinding_GetValue_Params
{
bool ReturnValue; // 0x0000(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.BorderSlot.SetVerticalAlignment
struct UBorderSlot_SetVerticalAlignment_Params
{
TEnumAsByte<SlateCore_EVerticalAlignment> InVerticalAlignment; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.BorderSlot.SetPadding
struct UBorderSlot_SetPadding_Params
{
struct FMargin InPadding; // 0x0000(0x0010) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
};
// Function UMG.BorderSlot.SetHorizontalAlignment
struct UBorderSlot_SetHorizontalAlignment_Params
{
TEnumAsByte<SlateCore_EHorizontalAlignment> InHorizontalAlignment; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.BrushBinding.GetValue
struct UBrushBinding_GetValue_Params
{
struct FSlateBrush ReturnValue; // 0x0000(0x0088) (Parm, OutParm, ReturnParm, NativeAccessSpecifierPublic)
};
// Function UMG.Button.SetTouchMethod
struct UButton_SetTouchMethod_Params
{
TEnumAsByte<SlateCore_EButtonTouchMethod> InTouchMethod; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Button.SetStyle
struct UButton_SetStyle_Params
{
struct FButtonStyle InStyle; // 0x0000(0x0278) (ConstParm, Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
};
// Function UMG.Button.SetPressMethod
struct UButton_SetPressMethod_Params
{
TEnumAsByte<SlateCore_EButtonPressMethod> InPressMethod; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Button.SetColorAndOpacity
struct UButton_SetColorAndOpacity_Params
{
struct FLinearColor InColorAndOpacity; // 0x0000(0x0010) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Button.SetClickMethod
struct UButton_SetClickMethod_Params
{
TEnumAsByte<SlateCore_EButtonClickMethod> InClickMethod; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Button.SetBackgroundColor
struct UButton_SetBackgroundColor_Params
{
struct FLinearColor InBackgroundColor; // 0x0000(0x0010) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Button.IsPressed
struct UButton_IsPressed_Params
{
bool ReturnValue; // 0x0000(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ButtonSlot.SetVerticalAlignment
struct UButtonSlot_SetVerticalAlignment_Params
{
TEnumAsByte<SlateCore_EVerticalAlignment> InVerticalAlignment; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ButtonSlot.SetPadding
struct UButtonSlot_SetPadding_Params
{
struct FMargin InPadding; // 0x0000(0x0010) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
};
// Function UMG.ButtonSlot.SetHorizontalAlignment
struct UButtonSlot_SetHorizontalAlignment_Params
{
TEnumAsByte<SlateCore_EHorizontalAlignment> InHorizontalAlignment; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.CanvasPanelSlot.SetZOrder
struct UCanvasPanelSlot_SetZOrder_Params
{
int InZOrder; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.CanvasPanelSlot.SetSize
struct UCanvasPanelSlot_SetSize_Params
{
struct FVector2D InSize; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.CanvasPanelSlot.SetPosition
struct UCanvasPanelSlot_SetPosition_Params
{
struct FVector2D InPosition; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.CanvasPanelSlot.SetOffsets
struct UCanvasPanelSlot_SetOffsets_Params
{
struct FMargin InOffset; // 0x0000(0x0010) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
};
// Function UMG.CanvasPanelSlot.SetMinimum
struct UCanvasPanelSlot_SetMinimum_Params
{
struct FVector2D InMinimumAnchors; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.CanvasPanelSlot.SetMaximum
struct UCanvasPanelSlot_SetMaximum_Params
{
struct FVector2D InMaximumAnchors; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.CanvasPanelSlot.SetLayout
struct UCanvasPanelSlot_SetLayout_Params
{
struct FAnchorData InLayoutData; // 0x0000(0x0028) (ConstParm, Parm, OutParm, ReferenceParm, NoDestructor, NativeAccessSpecifierPublic)
};
// Function UMG.CanvasPanelSlot.SetAutoSize
struct UCanvasPanelSlot_SetAutoSize_Params
{
bool InbAutoSize; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.CanvasPanelSlot.SetAnchors
struct UCanvasPanelSlot_SetAnchors_Params
{
struct FAnchors InAnchors; // 0x0000(0x0010) (Parm, NoDestructor, NativeAccessSpecifierPublic)
};
// Function UMG.CanvasPanelSlot.SetAlignment
struct UCanvasPanelSlot_SetAlignment_Params
{
struct FVector2D InAlignment; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.CanvasPanelSlot.GetZOrder
struct UCanvasPanelSlot_GetZOrder_Params
{
int ReturnValue; // 0x0000(0x0004) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.CanvasPanelSlot.GetSize
struct UCanvasPanelSlot_GetSize_Params
{
struct FVector2D ReturnValue; // 0x0000(0x0008) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.CanvasPanelSlot.GetPosition
struct UCanvasPanelSlot_GetPosition_Params
{
struct FVector2D ReturnValue; // 0x0000(0x0008) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.CanvasPanelSlot.GetOffsets
struct UCanvasPanelSlot_GetOffsets_Params
{
struct FMargin ReturnValue; // 0x0000(0x0010) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
};
// Function UMG.CanvasPanelSlot.GetLayout
struct UCanvasPanelSlot_GetLayout_Params
{
struct FAnchorData ReturnValue; // 0x0000(0x0028) (Parm, OutParm, ReturnParm, NoDestructor, NativeAccessSpecifierPublic)
};
// Function UMG.CanvasPanelSlot.GetAutoSize
struct UCanvasPanelSlot_GetAutoSize_Params
{
bool ReturnValue; // 0x0000(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.CanvasPanelSlot.GetAnchors
struct UCanvasPanelSlot_GetAnchors_Params
{
struct FAnchors ReturnValue; // 0x0000(0x0010) (Parm, OutParm, ReturnParm, NoDestructor, NativeAccessSpecifierPublic)
};
// Function UMG.CanvasPanelSlot.GetAlignment
struct UCanvasPanelSlot_GetAlignment_Params
{
struct FVector2D ReturnValue; // 0x0000(0x0008) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.CheckBox.SetIsChecked
struct UCheckBox_SetIsChecked_Params
{
bool InIsChecked; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.CheckBox.SetCheckedState
struct UCheckBox_SetCheckedState_Params
{
SlateCore_ECheckBoxState InCheckedState; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.CheckBox.IsPressed
struct UCheckBox_IsPressed_Params
{
bool ReturnValue; // 0x0000(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.CheckBox.IsChecked
struct UCheckBox_IsChecked_Params
{
bool ReturnValue; // 0x0000(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.CheckBox.GetCheckedState
struct UCheckBox_GetCheckedState_Params
{
SlateCore_ECheckBoxState ReturnValue; // 0x0000(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.CheckedStateBinding.GetValue
struct UCheckedStateBinding_GetValue_Params
{
SlateCore_ECheckBoxState ReturnValue; // 0x0000(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.CircularThrobber.SetRadius
struct UCircularThrobber_SetRadius_Params
{
float InRadius; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.CircularThrobber.SetPeriod
struct UCircularThrobber_SetPeriod_Params
{
float InPeriod; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.CircularThrobber.SetNumberOfPieces
struct UCircularThrobber_SetNumberOfPieces_Params
{
int InNumberOfPieces; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ColorBinding.GetSlateValue
struct UColorBinding_GetSlateValue_Params
{
struct FSlateColor ReturnValue; // 0x0000(0x0028) (Parm, OutParm, ReturnParm, NativeAccessSpecifierPublic)
};
// Function UMG.ColorBinding.GetLinearValue
struct UColorBinding_GetLinearValue_Params
{
struct FLinearColor ReturnValue; // 0x0000(0x0010) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ComboBoxString.SetSelectedOption
struct UComboBoxString_SetSelectedOption_Params
{
struct FString Option; // 0x0000(0x0010) (Parm, ZeroConstructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ComboBoxString.SetSelectedIndex
struct UComboBoxString_SetSelectedIndex_Params
{
int Index; // 0x0000(0x0004) (ConstParm, Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ComboBoxString.RemoveOption
struct UComboBoxString_RemoveOption_Params
{
struct FString Option; // 0x0000(0x0010) (Parm, ZeroConstructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool ReturnValue; // 0x0010(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ComboBoxString.RefreshOptions
struct UComboBoxString_RefreshOptions_Params
{
};
// DelegateFunction UMG.ComboBoxString.OnSelectionChangedEvent__DelegateSignature
struct UComboBoxString_OnSelectionChangedEvent__DelegateSignature_Params
{
struct FString SelectedItem; // 0x0000(0x0010) (Parm, ZeroConstructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
TEnumAsByte<SlateCore_ESelectInfo> SelectionType; // 0x0010(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// DelegateFunction UMG.ComboBoxString.OnOpeningEvent__DelegateSignature
struct UComboBoxString_OnOpeningEvent__DelegateSignature_Params
{
};
// DelegateFunction UMG.ComboBoxString.OnClosingEvent__DelegateSignature
struct UComboBoxString_OnClosingEvent__DelegateSignature_Params
{
};
// Function UMG.ComboBoxString.IsOpen
struct UComboBoxString_IsOpen_Params
{
bool ReturnValue; // 0x0000(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ComboBoxString.GetSelectedOption
struct UComboBoxString_GetSelectedOption_Params
{
struct FString ReturnValue; // 0x0000(0x0010) (Parm, OutParm, ZeroConstructor, ReturnParm, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ComboBoxString.GetSelectedIndex
struct UComboBoxString_GetSelectedIndex_Params
{
int ReturnValue; // 0x0000(0x0004) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ComboBoxString.GetOptionCount
struct UComboBoxString_GetOptionCount_Params
{
int ReturnValue; // 0x0000(0x0004) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ComboBoxString.GetOptionAtIndex
struct UComboBoxString_GetOptionAtIndex_Params
{
int Index; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FString ReturnValue; // 0x0008(0x0010) (Parm, OutParm, ZeroConstructor, ReturnParm, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ComboBoxString.FindOptionIndex
struct UComboBoxString_FindOptionIndex_Params
{
struct FString Option; // 0x0000(0x0010) (Parm, ZeroConstructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
int ReturnValue; // 0x0010(0x0004) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ComboBoxString.ClearSelection
struct UComboBoxString_ClearSelection_Params
{
};
// Function UMG.ComboBoxString.ClearOptions
struct UComboBoxString_ClearOptions_Params
{
};
// Function UMG.ComboBoxString.AddOption
struct UComboBoxString_AddOption_Params
{
struct FString Option; // 0x0000(0x0010) (Parm, ZeroConstructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.DragDropOperation.Drop
struct UDragDropOperation_Drop_Params
{
struct FPointerEvent PointerEvent; // 0x0000(0x0070) (ConstParm, Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
};
// Function UMG.DragDropOperation.Dragged
struct UDragDropOperation_Dragged_Params
{
struct FPointerEvent PointerEvent; // 0x0000(0x0070) (ConstParm, Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
};
// Function UMG.DragDropOperation.DragCancelled
struct UDragDropOperation_DragCancelled_Params
{
struct FPointerEvent PointerEvent; // 0x0000(0x0070) (ConstParm, Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
};
// Function UMG.DynamicEntryBoxBase.SetEntrySpacing
struct UDynamicEntryBoxBase_SetEntrySpacing_Params
{
struct FVector2D InEntrySpacing; // 0x0000(0x0008) (ConstParm, Parm, OutParm, ZeroConstructor, ReferenceParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.DynamicEntryBoxBase.GetNumEntries
struct UDynamicEntryBoxBase_GetNumEntries_Params
{
int ReturnValue; // 0x0000(0x0004) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.DynamicEntryBoxBase.GetAllEntries
struct UDynamicEntryBoxBase_GetAllEntries_Params
{
TArray<class UUserWidget*> ReturnValue; // 0x0000(0x0010) (ConstParm, ExportObject, Parm, OutParm, ZeroConstructor, ReturnParm, ReferenceParm, ContainsInstancedReference, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.DynamicEntryBox.Reset
struct UDynamicEntryBox_Reset_Params
{
bool bDeleteWidgets; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.DynamicEntryBox.RemoveEntry
struct UDynamicEntryBox_RemoveEntry_Params
{
class UUserWidget* EntryWidget; // 0x0000(0x0008) (Parm, ZeroConstructor, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.DynamicEntryBox.BP_CreateEntryOfClass
struct UDynamicEntryBox_BP_CreateEntryOfClass_Params
{
class UClass* EntryClass; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, UObjectWrapper, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class UUserWidget* ReturnValue; // 0x0008(0x0008) (ExportObject, Parm, OutParm, ZeroConstructor, ReturnParm, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.DynamicEntryBox.BP_CreateEntry
struct UDynamicEntryBox_BP_CreateEntry_Params
{
class UUserWidget* ReturnValue; // 0x0000(0x0008) (ExportObject, Parm, OutParm, ZeroConstructor, ReturnParm, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.EditableText.SetText
struct UEditableText_SetText_Params
{
struct FText InText; // 0x0000(0x0018) (Parm, NativeAccessSpecifierPublic)
};
// Function UMG.EditableText.SetJustification
struct UEditableText_SetJustification_Params
{
TEnumAsByte<Slate_ETextJustify> InJustification; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.EditableText.SetIsReadOnly
struct UEditableText_SetIsReadOnly_Params
{
bool InbIsReadyOnly; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.EditableText.SetIsPassword
struct UEditableText_SetIsPassword_Params
{
bool InbIsPassword; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.EditableText.SetHintText
struct UEditableText_SetHintText_Params
{
struct FText InHintText; // 0x0000(0x0018) (Parm, NativeAccessSpecifierPublic)
};
// DelegateFunction UMG.EditableText.OnEditableTextCommittedEvent__DelegateSignature
struct UEditableText_OnEditableTextCommittedEvent__DelegateSignature_Params
{
struct FText Text; // 0x0000(0x0018) (ConstParm, Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
TEnumAsByte<SlateCore_ETextCommit> CommitMethod; // 0x0018(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// DelegateFunction UMG.EditableText.OnEditableTextChangedEvent__DelegateSignature
struct UEditableText_OnEditableTextChangedEvent__DelegateSignature_Params
{
struct FText Text; // 0x0000(0x0018) (ConstParm, Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
};
// Function UMG.EditableText.GetText
struct UEditableText_GetText_Params
{
struct FText ReturnValue; // 0x0000(0x0018) (Parm, OutParm, ReturnParm, NativeAccessSpecifierPublic)
};
// Function UMG.ExpandableArea.SetIsExpanded_Animated
struct UExpandableArea_SetIsExpanded_Animated_Params
{
bool IsExpanded; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ExpandableArea.SetIsExpanded
struct UExpandableArea_SetIsExpanded_Params
{
bool IsExpanded; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ExpandableArea.GetIsExpanded
struct UExpandableArea_GetIsExpanded_Params
{
bool ReturnValue; // 0x0000(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.FloatBinding.GetValue
struct UFloatBinding_GetValue_Params
{
float ReturnValue; // 0x0000(0x0004) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.GridSlot.SetVerticalAlignment
struct UGridSlot_SetVerticalAlignment_Params
{
TEnumAsByte<SlateCore_EVerticalAlignment> InVerticalAlignment; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.GridSlot.SetRowSpan
struct UGridSlot_SetRowSpan_Params
{
int InRowSpan; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.GridSlot.SetRow
struct UGridSlot_SetRow_Params
{
int InRow; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.GridSlot.SetPadding
struct UGridSlot_SetPadding_Params
{
struct FMargin InPadding; // 0x0000(0x0010) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
};
// Function UMG.GridSlot.SetNudge
struct UGridSlot_SetNudge_Params
{
struct FVector2D InNudge; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.GridSlot.SetLayer
struct UGridSlot_SetLayer_Params
{
int InLayer; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.GridSlot.SetHorizontalAlignment
struct UGridSlot_SetHorizontalAlignment_Params
{
TEnumAsByte<SlateCore_EHorizontalAlignment> InHorizontalAlignment; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.GridSlot.SetColumnSpan
struct UGridSlot_SetColumnSpan_Params
{
int InColumnSpan; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.GridSlot.SetColumn
struct UGridSlot_SetColumn_Params
{
int InColumn; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.HorizontalBox.AddChildToHorizontalBox
struct UHorizontalBox_AddChildToHorizontalBox_Params
{
class UWidget* Content; // 0x0000(0x0008) (Parm, ZeroConstructor, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class UHorizontalBoxSlot* ReturnValue; // 0x0008(0x0008) (ExportObject, Parm, OutParm, ZeroConstructor, ReturnParm, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.HorizontalBoxSlot.SetVerticalAlignment
struct UHorizontalBoxSlot_SetVerticalAlignment_Params
{
TEnumAsByte<SlateCore_EVerticalAlignment> InVerticalAlignment; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.HorizontalBoxSlot.SetSize
struct UHorizontalBoxSlot_SetSize_Params
{
struct FSlateChildSize InSize; // 0x0000(0x0008) (Parm, NoDestructor, NativeAccessSpecifierPublic)
};
// Function UMG.HorizontalBoxSlot.SetPadding
struct UHorizontalBoxSlot_SetPadding_Params
{
struct FMargin InPadding; // 0x0000(0x0010) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
};
// Function UMG.HorizontalBoxSlot.SetHorizontalAlignment
struct UHorizontalBoxSlot_SetHorizontalAlignment_Params
{
TEnumAsByte<SlateCore_EHorizontalAlignment> InHorizontalAlignment; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.InputKeySelector.SetTextBlockVisibility
struct UInputKeySelector_SetTextBlockVisibility_Params
{
UMG_ESlateVisibility InVisibility; // 0x0000(0x0001) (ConstParm, Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.InputKeySelector.SetSelectedKey
struct UInputKeySelector_SetSelectedKey_Params
{
struct FInputChord InSelectedKey; // 0x0000(0x0020) (ConstParm, Parm, OutParm, ReferenceParm, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.InputKeySelector.SetNoKeySpecifiedText
struct UInputKeySelector_SetNoKeySpecifiedText_Params
{
struct FText InNoKeySpecifiedText; // 0x0000(0x0018) (Parm, NativeAccessSpecifierPublic)
};
// Function UMG.InputKeySelector.SetKeySelectionText
struct UInputKeySelector_SetKeySelectionText_Params
{
struct FText InKeySelectionText; // 0x0000(0x0018) (Parm, NativeAccessSpecifierPublic)
};
// Function UMG.InputKeySelector.SetEscapeKeys
struct UInputKeySelector_SetEscapeKeys_Params
{
TArray<struct FKey> InKeys; // 0x0000(0x0010) (ConstParm, Parm, OutParm, ZeroConstructor, ReferenceParm, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.InputKeySelector.SetAllowModifierKeys
struct UInputKeySelector_SetAllowModifierKeys_Params
{
bool bInAllowModifierKeys; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.InputKeySelector.SetAllowGamepadKeys
struct UInputKeySelector_SetAllowGamepadKeys_Params
{
bool bInAllowGamepadKeys; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// DelegateFunction UMG.InputKeySelector.OnKeySelected__DelegateSignature
struct UInputKeySelector_OnKeySelected__DelegateSignature_Params
{
struct FInputChord SelectedKey; // 0x0000(0x0020) (Parm, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// DelegateFunction UMG.InputKeySelector.OnIsSelectingKeyChanged__DelegateSignature
struct UInputKeySelector_OnIsSelectingKeyChanged__DelegateSignature_Params
{
};
// Function UMG.InputKeySelector.GetIsSelectingKey
struct UInputKeySelector_GetIsSelectingKey_Params
{
bool ReturnValue; // 0x0000(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Int32Binding.GetValue
struct UInt32Binding_GetValue_Params
{
int ReturnValue; // 0x0000(0x0004) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.InvalidationBox.SetCanCache
struct UInvalidationBox_SetCanCache_Params
{
bool CanCache; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.InvalidationBox.InvalidateCache
struct UInvalidationBox_InvalidateCache_Params
{
};
// Function UMG.InvalidationBox.GetCanCache
struct UInvalidationBox_GetCanCache_Params
{
bool ReturnValue; // 0x0000(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UserListEntry.BP_OnItemSelectionChanged
struct UUserListEntry_BP_OnItemSelectionChanged_Params
{
bool bIsSelected; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UserListEntry.BP_OnItemExpansionChanged
struct UUserListEntry_BP_OnItemExpansionChanged_Params
{
bool bIsExpanded; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UserListEntry.BP_OnEntryReleased
struct UUserListEntry_BP_OnEntryReleased_Params
{
};
// Function UMG.UserListEntryLibrary.IsListItemSelected
struct UUserListEntryLibrary_IsListItemSelected_Params
{
bool ReturnValue; // 0x0010(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UserListEntryLibrary.IsListItemExpanded
struct UUserListEntryLibrary_IsListItemExpanded_Params
{
bool ReturnValue; // 0x0010(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UserListEntryLibrary.GetOwningListView
struct UUserListEntryLibrary_GetOwningListView_Params
{
class UListViewBase* ReturnValue; // 0x0010(0x0008) (ExportObject, Parm, OutParm, ZeroConstructor, ReturnParm, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UserObjectListEntry.OnListItemObjectSet
struct UUserObjectListEntry_OnListItemObjectSet_Params
{
class UObject* ListItemObject; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UserObjectListEntryLibrary.GetListItemObject
struct UUserObjectListEntryLibrary_GetListItemObject_Params
{
class UObject* ReturnValue; // 0x0010(0x0008) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.MenuAnchor.ToggleOpen
struct UMenuAnchor_ToggleOpen_Params
{
bool bFocusOnOpen; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.MenuAnchor.ShouldOpenDueToClick
struct UMenuAnchor_ShouldOpenDueToClick_Params
{
bool ReturnValue; // 0x0000(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.MenuAnchor.SetPlacement
struct UMenuAnchor_SetPlacement_Params
{
TEnumAsByte<SlateCore_EMenuPlacement> InPlacement; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.MenuAnchor.Open
struct UMenuAnchor_Open_Params
{
bool bFocusMenu; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.MenuAnchor.IsOpen
struct UMenuAnchor_IsOpen_Params
{
bool ReturnValue; // 0x0000(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.MenuAnchor.HasOpenSubMenus
struct UMenuAnchor_HasOpenSubMenus_Params
{
bool ReturnValue; // 0x0000(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.MenuAnchor.GetMenuPosition
struct UMenuAnchor_GetMenuPosition_Params
{
struct FVector2D ReturnValue; // 0x0000(0x0008) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.MenuAnchor.FitInWindow
struct UMenuAnchor_FitInWindow_Params
{
bool bFit; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.MenuAnchor.Close
struct UMenuAnchor_Close_Params
{
};
// Function UMG.MouseCursorBinding.GetValue
struct UMouseCursorBinding_GetValue_Params
{
TEnumAsByte<CoreUObject_EMouseCursor> ReturnValue; // 0x0000(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.TextLayoutWidget.SetJustification
struct UTextLayoutWidget_SetJustification_Params
{
TEnumAsByte<Slate_ETextJustify> InJustification; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.MultiLineEditableText.SetWidgetStyle
struct UMultiLineEditableText_SetWidgetStyle_Params
{
struct FTextBlockStyle InWidgetStyle; // 0x0000(0x0268) (ConstParm, Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
};
// Function UMG.MultiLineEditableText.SetText
struct UMultiLineEditableText_SetText_Params
{
struct FText InText; // 0x0000(0x0018) (Parm, NativeAccessSpecifierPublic)
};
// Function UMG.MultiLineEditableText.SetIsReadOnly
struct UMultiLineEditableText_SetIsReadOnly_Params
{
bool bReadOnly; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.MultiLineEditableText.SetHintText
struct UMultiLineEditableText_SetHintText_Params
{
struct FText InHintText; // 0x0000(0x0018) (Parm, NativeAccessSpecifierPublic)
};
// DelegateFunction UMG.MultiLineEditableText.OnMultiLineEditableTextCommittedEvent__DelegateSignature
struct UMultiLineEditableText_OnMultiLineEditableTextCommittedEvent__DelegateSignature_Params
{
struct FText Text; // 0x0000(0x0018) (ConstParm, Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
TEnumAsByte<SlateCore_ETextCommit> CommitMethod; // 0x0018(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// DelegateFunction UMG.MultiLineEditableText.OnMultiLineEditableTextChangedEvent__DelegateSignature
struct UMultiLineEditableText_OnMultiLineEditableTextChangedEvent__DelegateSignature_Params
{
struct FText Text; // 0x0000(0x0018) (ConstParm, Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
};
// Function UMG.MultiLineEditableText.GetText
struct UMultiLineEditableText_GetText_Params
{
struct FText ReturnValue; // 0x0000(0x0018) (Parm, OutParm, ReturnParm, NativeAccessSpecifierPublic)
};
// Function UMG.MultiLineEditableText.GetHintText
struct UMultiLineEditableText_GetHintText_Params
{
struct FText ReturnValue; // 0x0000(0x0018) (Parm, OutParm, ReturnParm, NativeAccessSpecifierPublic)
};
// Function UMG.MultiLineEditableTextBox.SetTextStyle
struct UMultiLineEditableTextBox_SetTextStyle_Params
{
struct FTextBlockStyle InTextStyle; // 0x0000(0x0268) (ConstParm, Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
};
// Function UMG.MultiLineEditableTextBox.SetText
struct UMultiLineEditableTextBox_SetText_Params
{
struct FText InText; // 0x0000(0x0018) (Parm, NativeAccessSpecifierPublic)
};
// Function UMG.MultiLineEditableTextBox.SetIsReadOnly
struct UMultiLineEditableTextBox_SetIsReadOnly_Params
{
bool bReadOnly; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.MultiLineEditableTextBox.SetHintText
struct UMultiLineEditableTextBox_SetHintText_Params
{
struct FText InHintText; // 0x0000(0x0018) (Parm, NativeAccessSpecifierPublic)
};
// Function UMG.MultiLineEditableTextBox.SetError
struct UMultiLineEditableTextBox_SetError_Params
{
struct FText InError; // 0x0000(0x0018) (Parm, NativeAccessSpecifierPublic)
};
// DelegateFunction UMG.MultiLineEditableTextBox.OnMultiLineEditableTextBoxCommittedEvent__DelegateSignature
struct UMultiLineEditableTextBox_OnMultiLineEditableTextBoxCommittedEvent__DelegateSignature_Params
{
struct FText Text; // 0x0000(0x0018) (ConstParm, Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
TEnumAsByte<SlateCore_ETextCommit> CommitMethod; // 0x0018(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// DelegateFunction UMG.MultiLineEditableTextBox.OnMultiLineEditableTextBoxChangedEvent__DelegateSignature
struct UMultiLineEditableTextBox_OnMultiLineEditableTextBoxChangedEvent__DelegateSignature_Params
{
struct FText Text; // 0x0000(0x0018) (ConstParm, Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
};
// Function UMG.MultiLineEditableTextBox.GetText
struct UMultiLineEditableTextBox_GetText_Params
{
struct FText ReturnValue; // 0x0000(0x0018) (Parm, OutParm, ReturnParm, NativeAccessSpecifierPublic)
};
// Function UMG.MultiLineEditableTextBox.GetHintText
struct UMultiLineEditableTextBox_GetHintText_Params
{
struct FText ReturnValue; // 0x0000(0x0018) (Parm, OutParm, ReturnParm, NativeAccessSpecifierPublic)
};
// Function UMG.Overlay.AddChildToOverlay
struct UOverlay_AddChildToOverlay_Params
{
class UWidget* Content; // 0x0000(0x0008) (Parm, ZeroConstructor, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class UOverlaySlot* ReturnValue; // 0x0008(0x0008) (ExportObject, Parm, OutParm, ZeroConstructor, ReturnParm, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.OverlaySlot.SetVerticalAlignment
struct UOverlaySlot_SetVerticalAlignment_Params
{
TEnumAsByte<SlateCore_EVerticalAlignment> InVerticalAlignment; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.OverlaySlot.SetPadding
struct UOverlaySlot_SetPadding_Params
{
struct FMargin InPadding; // 0x0000(0x0010) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
};
// Function UMG.OverlaySlot.SetHorizontalAlignment
struct UOverlaySlot_SetHorizontalAlignment_Params
{
TEnumAsByte<SlateCore_EHorizontalAlignment> InHorizontalAlignment; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ProgressBar.SetPercent
struct UProgressBar_SetPercent_Params
{
float InPercent; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ProgressBar.SetIsMarquee
struct UProgressBar_SetIsMarquee_Params
{
bool InbIsMarquee; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ProgressBar.SetFillColorAndOpacity
struct UProgressBar_SetFillColorAndOpacity_Params
{
struct FLinearColor InColor; // 0x0000(0x0010) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.RetainerBox.SetTextureParameter
struct URetainerBox_SetTextureParameter_Params
{
struct FName TextureParameter; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.RetainerBox.SetRetainedRendering
struct URetainerBox_SetRetainedRendering_Params
{
bool bEnableRetainedRendering; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.RetainerBox.SetRenderingPhase
struct URetainerBox_SetRenderingPhase_Params
{
int RenderPhase; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
int TotalPhases; // 0x0004(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.RetainerBox.SetEffectMaterial
struct URetainerBox_SetEffectMaterial_Params
{
class UMaterialInterface* EffectMaterial; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.RetainerBox.RequestRender
struct URetainerBox_RequestRender_Params
{
};
// Function UMG.RetainerBox.GetEffectMaterial
struct URetainerBox_GetEffectMaterial_Params
{
class UMaterialInstanceDynamic* ReturnValue; // 0x0000(0x0008) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.RichTextBlock.SetTextStyleSet
struct URichTextBlock_SetTextStyleSet_Params
{
class UDataTable* NewTextStyleSet; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.RichTextBlock.SetText
struct URichTextBlock_SetText_Params
{
struct FText InText; // 0x0000(0x0018) (ConstParm, Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
};
// Function UMG.RichTextBlock.SetMinDesiredWidth
struct URichTextBlock_SetMinDesiredWidth_Params
{
float InMinDesiredWidth; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.RichTextBlock.SetDefaultTextStyle
struct URichTextBlock_SetDefaultTextStyle_Params
{
struct FTextBlockStyle InDefaultTextStyle; // 0x0000(0x0268) (ConstParm, Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
};
// Function UMG.RichTextBlock.SetDefaultStrikeBrush
struct URichTextBlock_SetDefaultStrikeBrush_Params
{
struct FSlateBrush InStrikeBrush; // 0x0000(0x0088) (Parm, OutParm, NativeAccessSpecifierPublic)
};
// Function UMG.RichTextBlock.SetDefaultShadowOffset
struct URichTextBlock_SetDefaultShadowOffset_Params
{
struct FVector2D InShadowOffset; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.RichTextBlock.SetDefaultShadowColorAndOpacity
struct URichTextBlock_SetDefaultShadowColorAndOpacity_Params
{
struct FLinearColor InShadowColorAndOpacity; // 0x0000(0x0010) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.RichTextBlock.SetDefaultFont
struct URichTextBlock_SetDefaultFont_Params
{
struct FSlateFontInfo InFontInfo; // 0x0000(0x0050) (Parm, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.RichTextBlock.SetDefaultColorAndOpacity
struct URichTextBlock_SetDefaultColorAndOpacity_Params
{
struct FSlateColor InColorAndOpacity; // 0x0000(0x0028) (Parm, NativeAccessSpecifierPublic)
};
// Function UMG.RichTextBlock.SetAutoWrapText
struct URichTextBlock_SetAutoWrapText_Params
{
bool InAutoTextWrap; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.RichTextBlock.GetText
struct URichTextBlock_GetText_Params
{
struct FText ReturnValue; // 0x0000(0x0018) (Parm, OutParm, ReturnParm, NativeAccessSpecifierPublic)
};
// Function UMG.RichTextBlock.GetDecoratorByClass
struct URichTextBlock_GetDecoratorByClass_Params
{
class UClass* DecoratorClass; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, UObjectWrapper, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class URichTextBlockDecorator* ReturnValue; // 0x0008(0x0008) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.RichTextBlock.ClearAllDefaultStyleOverrides
struct URichTextBlock_ClearAllDefaultStyleOverrides_Params
{
};
// Function UMG.SafeZone.SetSidesToPad
struct USafeZone_SetSidesToPad_Params
{
bool InPadLeft; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool InPadRight; // 0x0001(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool InPadTop; // 0x0002(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool InPadBottom; // 0x0003(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ScaleBox.SetUserSpecifiedScale
struct UScaleBox_SetUserSpecifiedScale_Params
{
float InUserSpecifiedScale; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ScaleBox.SetStretchDirection
struct UScaleBox_SetStretchDirection_Params
{
TEnumAsByte<Slate_EStretchDirection> InStretchDirection; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ScaleBox.SetStretch
struct UScaleBox_SetStretch_Params
{
TEnumAsByte<Slate_EStretch> InStretch; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ScaleBox.SetIgnoreInheritedScale
struct UScaleBox_SetIgnoreInheritedScale_Params
{
bool bInIgnoreInheritedScale; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ScaleBoxSlot.SetVerticalAlignment
struct UScaleBoxSlot_SetVerticalAlignment_Params
{
TEnumAsByte<SlateCore_EVerticalAlignment> InVerticalAlignment; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ScaleBoxSlot.SetPadding
struct UScaleBoxSlot_SetPadding_Params
{
struct FMargin InPadding; // 0x0000(0x0010) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
};
// Function UMG.ScaleBoxSlot.SetHorizontalAlignment
struct UScaleBoxSlot_SetHorizontalAlignment_Params
{
TEnumAsByte<SlateCore_EHorizontalAlignment> InHorizontalAlignment; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ScrollBar.SetState
struct UScrollBar_SetState_Params
{
float InOffsetFraction; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
float InThumbSizeFraction; // 0x0004(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ScrollBoxSlot.SetVerticalAlignment
struct UScrollBoxSlot_SetVerticalAlignment_Params
{
TEnumAsByte<SlateCore_EVerticalAlignment> InVerticalAlignment; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.ScrollBoxSlot.SetPadding
struct UScrollBoxSlot_SetPadding_Params
{
struct FMargin InPadding; // 0x0000(0x0010) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
};
// Function UMG.ScrollBoxSlot.SetHorizontalAlignment
struct UScrollBoxSlot_SetHorizontalAlignment_Params
{
TEnumAsByte<SlateCore_EHorizontalAlignment> InHorizontalAlignment; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.SizeBox.SetWidthOverride
struct USizeBox_SetWidthOverride_Params
{
float InWidthOverride; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.SizeBox.SetMinDesiredWidth
struct USizeBox_SetMinDesiredWidth_Params
{
float InMinDesiredWidth; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.SizeBox.SetMinDesiredHeight
struct USizeBox_SetMinDesiredHeight_Params
{
float InMinDesiredHeight; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.SizeBox.SetMinAspectRatio
struct USizeBox_SetMinAspectRatio_Params
{
float InMinAspectRatio; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.SizeBox.SetMaxDesiredWidth
struct USizeBox_SetMaxDesiredWidth_Params
{
float InMaxDesiredWidth; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.SizeBox.SetMaxDesiredHeight
struct USizeBox_SetMaxDesiredHeight_Params
{
float InMaxDesiredHeight; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.SizeBox.SetMaxAspectRatio
struct USizeBox_SetMaxAspectRatio_Params
{
float InMaxAspectRatio; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.SizeBox.SetHeightOverride
struct USizeBox_SetHeightOverride_Params
{
float InHeightOverride; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.SizeBox.ClearWidthOverride
struct USizeBox_ClearWidthOverride_Params
{
};
// Function UMG.SizeBox.ClearMinDesiredWidth
struct USizeBox_ClearMinDesiredWidth_Params
{
};
// Function UMG.SizeBox.ClearMinDesiredHeight
struct USizeBox_ClearMinDesiredHeight_Params
{
};
// Function UMG.SizeBox.ClearMinAspectRatio
struct USizeBox_ClearMinAspectRatio_Params
{
};
// Function UMG.SizeBox.ClearMaxDesiredWidth
struct USizeBox_ClearMaxDesiredWidth_Params
{
};
// Function UMG.SizeBox.ClearMaxDesiredHeight
struct USizeBox_ClearMaxDesiredHeight_Params
{
};
// Function UMG.SizeBox.ClearMaxAspectRatio
struct USizeBox_ClearMaxAspectRatio_Params
{
};
// Function UMG.SizeBox.ClearHeightOverride
struct USizeBox_ClearHeightOverride_Params
{
};
// Function UMG.SizeBoxSlot.SetVerticalAlignment
struct USizeBoxSlot_SetVerticalAlignment_Params
{
TEnumAsByte<SlateCore_EVerticalAlignment> InVerticalAlignment; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.SizeBoxSlot.SetPadding
struct USizeBoxSlot_SetPadding_Params
{
struct FMargin InPadding; // 0x0000(0x0010) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
};
// Function UMG.SizeBoxSlot.SetHorizontalAlignment
struct USizeBoxSlot_SetHorizontalAlignment_Params
{
TEnumAsByte<SlateCore_EHorizontalAlignment> InHorizontalAlignment; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.SlateBlueprintLibrary.TransformVectorLocalToAbsolute
struct USlateBlueprintLibrary_TransformVectorLocalToAbsolute_Params
{
struct FGeometry Geometry; // 0x0000(0x0058) (ConstParm, Parm, OutParm, ReferenceParm, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
struct FVector2D LocalVector; // 0x0058(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FVector2D ReturnValue; // 0x0060(0x0008) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.SlateBlueprintLibrary.TransformVectorAbsoluteToLocal
struct USlateBlueprintLibrary_TransformVectorAbsoluteToLocal_Params
{
struct FGeometry Geometry; // 0x0000(0x0058) (ConstParm, Parm, OutParm, ReferenceParm, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
struct FVector2D AbsoluteVector; // 0x0058(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FVector2D ReturnValue; // 0x0060(0x0008) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.SlateBlueprintLibrary.TransformScalarLocalToAbsolute
struct USlateBlueprintLibrary_TransformScalarLocalToAbsolute_Params
{
struct FGeometry Geometry; // 0x0000(0x0058) (ConstParm, Parm, OutParm, ReferenceParm, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
float LocalScalar; // 0x0058(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
float ReturnValue; // 0x005C(0x0004) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.SlateBlueprintLibrary.TransformScalarAbsoluteToLocal
struct USlateBlueprintLibrary_TransformScalarAbsoluteToLocal_Params
{
struct FGeometry Geometry; // 0x0000(0x0058) (ConstParm, Parm, OutParm, ReferenceParm, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
float AbsoluteScalar; // 0x0058(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
float ReturnValue; // 0x005C(0x0004) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.SlateBlueprintLibrary.ScreenToWidgetLocal
struct USlateBlueprintLibrary_ScreenToWidgetLocal_Params
{
class UObject* WorldContextObject; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FGeometry Geometry; // 0x0008(0x0058) (ConstParm, Parm, OutParm, ReferenceParm, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
struct FVector2D ScreenPosition; // 0x0060(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FVector2D LocalCoordinate; // 0x0068(0x0008) (Parm, OutParm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool bIncludeWindowPosition; // 0x0070(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.SlateBlueprintLibrary.ScreenToWidgetAbsolute
struct USlateBlueprintLibrary_ScreenToWidgetAbsolute_Params
{
class UObject* WorldContextObject; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FVector2D ScreenPosition; // 0x0008(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FVector2D AbsoluteCoordinate; // 0x0010(0x0008) (Parm, OutParm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool bIncludeWindowPosition; // 0x0018(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.SlateBlueprintLibrary.ScreenToViewport
struct USlateBlueprintLibrary_ScreenToViewport_Params
{
class UObject* WorldContextObject; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FVector2D ScreenPosition; // 0x0008(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FVector2D ViewportPosition; // 0x0010(0x0008) (Parm, OutParm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.SlateBlueprintLibrary.LocalToViewport
struct USlateBlueprintLibrary_LocalToViewport_Params
{
class UObject* WorldContextObject; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FGeometry Geometry; // 0x0008(0x0058) (ConstParm, Parm, OutParm, ReferenceParm, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
struct FVector2D LocalCoordinate; // 0x0060(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FVector2D PixelPosition; // 0x0068(0x0008) (Parm, OutParm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FVector2D ViewportPosition; // 0x0070(0x0008) (Parm, OutParm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.SlateBlueprintLibrary.LocalToAbsolute
struct USlateBlueprintLibrary_LocalToAbsolute_Params
{
struct FGeometry Geometry; // 0x0000(0x0058) (ConstParm, Parm, OutParm, ReferenceParm, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
struct FVector2D LocalCoordinate; // 0x0058(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FVector2D ReturnValue; // 0x0060(0x0008) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.SlateBlueprintLibrary.IsUnderLocation
struct USlateBlueprintLibrary_IsUnderLocation_Params
{
struct FGeometry Geometry; // 0x0000(0x0058) (ConstParm, Parm, OutParm, ReferenceParm, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
struct FVector2D AbsoluteCoordinate; // 0x0058(0x0008) (ConstParm, Parm, OutParm, ZeroConstructor, ReferenceParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool ReturnValue; // 0x0060(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.SlateBlueprintLibrary.GetLocalTopLeft
struct USlateBlueprintLibrary_GetLocalTopLeft_Params
{
struct FGeometry Geometry; // 0x0000(0x0058) (ConstParm, Parm, OutParm, ReferenceParm, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
struct FVector2D ReturnValue; // 0x0058(0x0008) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.SlateBlueprintLibrary.GetLocalSize
struct USlateBlueprintLibrary_GetLocalSize_Params
{
struct FGeometry Geometry; // 0x0000(0x0058) (ConstParm, Parm, OutParm, ReferenceParm, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
struct FVector2D ReturnValue; // 0x0058(0x0008) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.SlateBlueprintLibrary.GetAbsoluteSize
struct USlateBlueprintLibrary_GetAbsoluteSize_Params
{
struct FGeometry Geometry; // 0x0000(0x0058) (ConstParm, Parm, OutParm, ReferenceParm, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
struct FVector2D ReturnValue; // 0x0058(0x0008) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.SlateBlueprintLibrary.EqualEqual_SlateBrush
struct USlateBlueprintLibrary_EqualEqual_SlateBrush_Params
{
struct FSlateBrush A; // 0x0000(0x0088) (ConstParm, Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
struct FSlateBrush B; // 0x0088(0x0088) (ConstParm, Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
bool ReturnValue; // 0x0110(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.SlateBlueprintLibrary.AbsoluteToViewport
struct USlateBlueprintLibrary_AbsoluteToViewport_Params
{
class UObject* WorldContextObject; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FVector2D AbsoluteDesktopCoordinate; // 0x0008(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FVector2D PixelPosition; // 0x0010(0x0008) (Parm, OutParm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FVector2D ViewportPosition; // 0x0018(0x0008) (Parm, OutParm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.SlateBlueprintLibrary.AbsoluteToLocal
struct USlateBlueprintLibrary_AbsoluteToLocal_Params
{
struct FGeometry Geometry; // 0x0000(0x0058) (ConstParm, Parm, OutParm, ReferenceParm, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
struct FVector2D AbsoluteCoordinate; // 0x0058(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FVector2D ReturnValue; // 0x0060(0x0008) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Slider.SetValue
struct USlider_SetValue_Params
{
float InValue; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Slider.SetStepSize
struct USlider_SetStepSize_Params
{
float InValue; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Slider.SetSliderHandleColor
struct USlider_SetSliderHandleColor_Params
{
struct FLinearColor InValue; // 0x0000(0x0010) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Slider.SetSliderBarColor
struct USlider_SetSliderBarColor_Params
{
struct FLinearColor InValue; // 0x0000(0x0010) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Slider.SetMinValue
struct USlider_SetMinValue_Params
{
float InValue; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Slider.SetMaxValue
struct USlider_SetMaxValue_Params
{
float InValue; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Slider.SetLocked
struct USlider_SetLocked_Params
{
bool InValue; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Slider.SetIndentHandle
struct USlider_SetIndentHandle_Params
{
bool InValue; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Slider.GetValue
struct USlider_GetValue_Params
{
float ReturnValue; // 0x0000(0x0004) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Slider.GetNormalizedValue
struct USlider_GetNormalizedValue_Params
{
float ReturnValue; // 0x0000(0x0004) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Spacer.SetSize
struct USpacer_SetSize_Params
{
struct FVector2D InSize; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.SpinBox.SetValue
struct USpinBox_SetValue_Params
{
float NewValue; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.SpinBox.SetMinValue
struct USpinBox_SetMinValue_Params
{
float NewValue; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.SpinBox.SetMinSliderValue
struct USpinBox_SetMinSliderValue_Params
{
float NewValue; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.SpinBox.SetMinFractionalDigits
struct USpinBox_SetMinFractionalDigits_Params
{
int NewValue; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.SpinBox.SetMaxValue
struct USpinBox_SetMaxValue_Params
{
float NewValue; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.SpinBox.SetMaxSliderValue
struct USpinBox_SetMaxSliderValue_Params
{
float NewValue; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.SpinBox.SetMaxFractionalDigits
struct USpinBox_SetMaxFractionalDigits_Params
{
int NewValue; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.SpinBox.SetForegroundColor
struct USpinBox_SetForegroundColor_Params
{
struct FSlateColor InForegroundColor; // 0x0000(0x0028) (Parm, NativeAccessSpecifierPublic)
};
// Function UMG.SpinBox.SetDelta
struct USpinBox_SetDelta_Params
{
float NewValue; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.SpinBox.SetAlwaysUsesDeltaSnap
struct USpinBox_SetAlwaysUsesDeltaSnap_Params
{
bool bNewValue; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// DelegateFunction UMG.SpinBox.OnSpinBoxValueCommittedEvent__DelegateSignature
struct USpinBox_OnSpinBoxValueCommittedEvent__DelegateSignature_Params
{
float InValue; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
TEnumAsByte<SlateCore_ETextCommit> CommitMethod; // 0x0004(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// DelegateFunction UMG.SpinBox.OnSpinBoxValueChangedEvent__DelegateSignature
struct USpinBox_OnSpinBoxValueChangedEvent__DelegateSignature_Params
{
float InValue; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// DelegateFunction UMG.SpinBox.OnSpinBoxBeginSliderMovement__DelegateSignature
struct USpinBox_OnSpinBoxBeginSliderMovement__DelegateSignature_Params
{
};
// Function UMG.SpinBox.GetValue
struct USpinBox_GetValue_Params
{
float ReturnValue; // 0x0000(0x0004) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.SpinBox.GetMinValue
struct USpinBox_GetMinValue_Params
{
float ReturnValue; // 0x0000(0x0004) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.SpinBox.GetMinSliderValue
struct USpinBox_GetMinSliderValue_Params
{
float ReturnValue; // 0x0000(0x0004) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.SpinBox.GetMinFractionalDigits
struct USpinBox_GetMinFractionalDigits_Params
{
int ReturnValue; // 0x0000(0x0004) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.SpinBox.GetMaxValue
struct USpinBox_GetMaxValue_Params
{
float ReturnValue; // 0x0000(0x0004) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.SpinBox.GetMaxSliderValue
struct USpinBox_GetMaxSliderValue_Params
{
float ReturnValue; // 0x0000(0x0004) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.SpinBox.GetMaxFractionalDigits
struct USpinBox_GetMaxFractionalDigits_Params
{
int ReturnValue; // 0x0000(0x0004) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.SpinBox.GetDelta
struct USpinBox_GetDelta_Params
{
float ReturnValue; // 0x0000(0x0004) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.SpinBox.GetAlwaysUsesDeltaSnap
struct USpinBox_GetAlwaysUsesDeltaSnap_Params
{
bool ReturnValue; // 0x0000(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.SpinBox.ClearMinValue
struct USpinBox_ClearMinValue_Params
{
};
// Function UMG.SpinBox.ClearMinSliderValue
struct USpinBox_ClearMinSliderValue_Params
{
};
// Function UMG.SpinBox.ClearMaxValue
struct USpinBox_ClearMaxValue_Params
{
};
// Function UMG.SpinBox.ClearMaxSliderValue
struct USpinBox_ClearMaxSliderValue_Params
{
};
// Function UMG.TextBinding.GetTextValue
struct UTextBinding_GetTextValue_Params
{
struct FText ReturnValue; // 0x0000(0x0018) (Parm, OutParm, ReturnParm, NativeAccessSpecifierPublic)
};
// Function UMG.TextBinding.GetStringValue
struct UTextBinding_GetStringValue_Params
{
struct FString ReturnValue; // 0x0000(0x0010) (Parm, OutParm, ZeroConstructor, ReturnParm, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.TextBlock.SetText
struct UTextBlock_SetText_Params
{
struct FText InText; // 0x0000(0x0018) (Parm, NativeAccessSpecifierPublic)
};
// Function UMG.TextBlock.SetStrikeBrush
struct UTextBlock_SetStrikeBrush_Params
{
struct FSlateBrush InStrikeBrush; // 0x0000(0x0088) (Parm, NativeAccessSpecifierPublic)
};
// Function UMG.TextBlock.SetShadowOffset
struct UTextBlock_SetShadowOffset_Params
{
struct FVector2D InShadowOffset; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.TextBlock.SetShadowColorAndOpacity
struct UTextBlock_SetShadowColorAndOpacity_Params
{
struct FLinearColor InShadowColorAndOpacity; // 0x0000(0x0010) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.TextBlock.SetOpacity
struct UTextBlock_SetOpacity_Params
{
float InOpacity; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.TextBlock.SetMinDesiredWidth
struct UTextBlock_SetMinDesiredWidth_Params
{
float InMinDesiredWidth; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.TextBlock.SetFont
struct UTextBlock_SetFont_Params
{
struct FSlateFontInfo InFontInfo; // 0x0000(0x0050) (Parm, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.TextBlock.SetColorAndOpacity
struct UTextBlock_SetColorAndOpacity_Params
{
struct FSlateColor InColorAndOpacity; // 0x0000(0x0028) (Parm, NativeAccessSpecifierPublic)
};
// Function UMG.TextBlock.SetAutoWrapText
struct UTextBlock_SetAutoWrapText_Params
{
bool InAutoTextWrap; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.TextBlock.GetText
struct UTextBlock_GetText_Params
{
struct FText ReturnValue; // 0x0000(0x0018) (Parm, OutParm, ReturnParm, NativeAccessSpecifierPublic)
};
// Function UMG.TextBlock.GetDynamicOutlineMaterial
struct UTextBlock_GetDynamicOutlineMaterial_Params
{
class UMaterialInstanceDynamic* ReturnValue; // 0x0000(0x0008) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.TextBlock.GetDynamicFontMaterial
struct UTextBlock_GetDynamicFontMaterial_Params
{
class UMaterialInstanceDynamic* ReturnValue; // 0x0000(0x0008) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Throbber.SetNumberOfPieces
struct UThrobber_SetNumberOfPieces_Params
{
int InNumberOfPieces; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Throbber.SetAnimateVertically
struct UThrobber_SetAnimateVertically_Params
{
bool bInAnimateVertically; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Throbber.SetAnimateOpacity
struct UThrobber_SetAnimateOpacity_Params
{
bool bInAnimateOpacity; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Throbber.SetAnimateHorizontally
struct UThrobber_SetAnimateHorizontally_Params
{
bool bInAnimateHorizontally; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.TileView.SetEntryWidth
struct UTileView_SetEntryWidth_Params
{
float NewWidth; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.TileView.SetEntryHeight
struct UTileView_SetEntryHeight_Params
{
float NewHeight; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UniformGridPanel.SetSlotPadding
struct UUniformGridPanel_SetSlotPadding_Params
{
struct FMargin InSlotPadding; // 0x0000(0x0010) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
};
// Function UMG.UniformGridPanel.SetMinDesiredSlotWidth
struct UUniformGridPanel_SetMinDesiredSlotWidth_Params
{
float InMinDesiredSlotWidth; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UniformGridPanel.SetMinDesiredSlotHeight
struct UUniformGridPanel_SetMinDesiredSlotHeight_Params
{
float InMinDesiredSlotHeight; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UniformGridPanel.AddChildToUniformGrid
struct UUniformGridPanel_AddChildToUniformGrid_Params
{
class UWidget* Content; // 0x0000(0x0008) (Parm, ZeroConstructor, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
int InRow; // 0x0008(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
int InColumn; // 0x000C(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class UUniformGridSlot* ReturnValue; // 0x0010(0x0008) (ExportObject, Parm, OutParm, ZeroConstructor, ReturnParm, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UniformGridSlot.SetVerticalAlignment
struct UUniformGridSlot_SetVerticalAlignment_Params
{
TEnumAsByte<SlateCore_EVerticalAlignment> InVerticalAlignment; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UniformGridSlot.SetRow
struct UUniformGridSlot_SetRow_Params
{
int InRow; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UniformGridSlot.SetHorizontalAlignment
struct UUniformGridSlot_SetHorizontalAlignment_Params
{
TEnumAsByte<SlateCore_EHorizontalAlignment> InHorizontalAlignment; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.UniformGridSlot.SetColumn
struct UUniformGridSlot_SetColumn_Params
{
int InColumn; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.VerticalBoxSlot.SetVerticalAlignment
struct UVerticalBoxSlot_SetVerticalAlignment_Params
{
TEnumAsByte<SlateCore_EVerticalAlignment> InVerticalAlignment; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.VerticalBoxSlot.SetSize
struct UVerticalBoxSlot_SetSize_Params
{
struct FSlateChildSize InSize; // 0x0000(0x0008) (Parm, NoDestructor, NativeAccessSpecifierPublic)
};
// Function UMG.VerticalBoxSlot.SetPadding
struct UVerticalBoxSlot_SetPadding_Params
{
struct FMargin InPadding; // 0x0000(0x0010) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
};
// Function UMG.VerticalBoxSlot.SetHorizontalAlignment
struct UVerticalBoxSlot_SetHorizontalAlignment_Params
{
TEnumAsByte<SlateCore_EHorizontalAlignment> InHorizontalAlignment; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Viewport.Spawn
struct UViewport_Spawn_Params
{
class UClass* ActorClass; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, UObjectWrapper, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class AActor* ReturnValue; // 0x0008(0x0008) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Viewport.SetViewRotation
struct UViewport_SetViewRotation_Params
{
struct FRotator Rotation; // 0x0000(0x000C) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
};
// Function UMG.Viewport.SetViewLocation
struct UViewport_SetViewLocation_Params
{
struct FVector Location; // 0x0000(0x000C) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Viewport.GetViewRotation
struct UViewport_GetViewRotation_Params
{
struct FRotator ReturnValue; // 0x0000(0x000C) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
};
// Function UMG.Viewport.GetViewportWorld
struct UViewport_GetViewportWorld_Params
{
class UWorld* ReturnValue; // 0x0000(0x0008) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.Viewport.GetViewLocation
struct UViewport_GetViewLocation_Params
{
struct FVector ReturnValue; // 0x0000(0x000C) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.VisibilityBinding.GetValue
struct UVisibilityBinding_GetValue_Params
{
UMG_ESlateVisibility ReturnValue; // 0x0000(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetAnimation.UnbindFromAnimationStarted
struct UWidgetAnimation_UnbindFromAnimationStarted_Params
{
class UUserWidget* Widget; // 0x0000(0x0008) (Parm, ZeroConstructor, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FScriptDelegate Delegate; // 0x0008(0x0010) (Parm, ZeroConstructor, NoDestructor, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetAnimation.UnbindFromAnimationFinished
struct UWidgetAnimation_UnbindFromAnimationFinished_Params
{
class UUserWidget* Widget; // 0x0000(0x0008) (Parm, ZeroConstructor, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FScriptDelegate Delegate; // 0x0008(0x0010) (Parm, ZeroConstructor, NoDestructor, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetAnimation.UnbindAllFromAnimationStarted
struct UWidgetAnimation_UnbindAllFromAnimationStarted_Params
{
class UUserWidget* Widget; // 0x0000(0x0008) (Parm, ZeroConstructor, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetAnimation.UnbindAllFromAnimationFinished
struct UWidgetAnimation_UnbindAllFromAnimationFinished_Params
{
class UUserWidget* Widget; // 0x0000(0x0008) (Parm, ZeroConstructor, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetAnimation.GetStartTime
struct UWidgetAnimation_GetStartTime_Params
{
float ReturnValue; // 0x0000(0x0004) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetAnimation.GetEndTime
struct UWidgetAnimation_GetEndTime_Params
{
float ReturnValue; // 0x0000(0x0004) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetAnimation.BindToAnimationStarted
struct UWidgetAnimation_BindToAnimationStarted_Params
{
class UUserWidget* Widget; // 0x0000(0x0008) (Parm, ZeroConstructor, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FScriptDelegate Delegate; // 0x0008(0x0010) (Parm, ZeroConstructor, NoDestructor, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetAnimation.BindToAnimationFinished
struct UWidgetAnimation_BindToAnimationFinished_Params
{
class UUserWidget* Widget; // 0x0000(0x0008) (Parm, ZeroConstructor, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FScriptDelegate Delegate; // 0x0008(0x0010) (Parm, ZeroConstructor, NoDestructor, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetAnimationPlayCallbackProxy.CreatePlayAnimationTimeRangeProxyObject
struct UWidgetAnimationPlayCallbackProxy_CreatePlayAnimationTimeRangeProxyObject_Params
{
class UUMGSequencePlayer* Result; // 0x0000(0x0008) (Parm, OutParm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class UUserWidget* Widget; // 0x0008(0x0008) (Parm, ZeroConstructor, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class UWidgetAnimation* InAnimation; // 0x0010(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
float StartAtTime; // 0x0018(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
float EndAtTime; // 0x001C(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
int NumLoopsToPlay; // 0x0020(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
TEnumAsByte<UMG_EUMGSequencePlayMode> PlayMode; // 0x0024(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
float PlaybackSpeed; // 0x0028(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class UWidgetAnimationPlayCallbackProxy* ReturnValue; // 0x0030(0x0008) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetAnimationPlayCallbackProxy.CreatePlayAnimationProxyObject
struct UWidgetAnimationPlayCallbackProxy_CreatePlayAnimationProxyObject_Params
{
class UUMGSequencePlayer* Result; // 0x0000(0x0008) (Parm, OutParm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class UUserWidget* Widget; // 0x0008(0x0008) (Parm, ZeroConstructor, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class UWidgetAnimation* InAnimation; // 0x0010(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
float StartAtTime; // 0x0018(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
int NumLoopsToPlay; // 0x001C(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
TEnumAsByte<UMG_EUMGSequencePlayMode> PlayMode; // 0x0020(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
float PlaybackSpeed; // 0x0024(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class UWidgetAnimationPlayCallbackProxy* ReturnValue; // 0x0028(0x0008) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetBinding.GetValue
struct UWidgetBinding_GetValue_Params
{
class UWidget* ReturnValue; // 0x0000(0x0008) (ExportObject, Parm, OutParm, ZeroConstructor, ReturnParm, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetBlueprintLibrary.UnlockMouse
struct UWidgetBlueprintLibrary_UnlockMouse_Params
{
struct FEventReply Reply; // 0x0000(0x00C0) (Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
struct FEventReply ReturnValue; // 0x00C0(0x00C0) (Parm, OutParm, ReturnParm, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetBlueprintLibrary.Unhandled
struct UWidgetBlueprintLibrary_Unhandled_Params
{
struct FEventReply ReturnValue; // 0x0000(0x00C0) (Parm, OutParm, ReturnParm, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetBlueprintLibrary.SetWindowTitleBarState
struct UWidgetBlueprintLibrary_SetWindowTitleBarState_Params
{
class UWidget* TitleBarContent; // 0x0000(0x0008) (Parm, ZeroConstructor, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
Engine_EWindowTitleBarMode Mode; // 0x0008(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool bTitleBarDragEnabled; // 0x0009(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool bWindowButtonsVisible; // 0x000A(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool bTitleBarVisible; // 0x000B(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetBlueprintLibrary.SetWindowTitleBarOnCloseClickedDelegate
struct UWidgetBlueprintLibrary_SetWindowTitleBarOnCloseClickedDelegate_Params
{
struct FScriptDelegate Delegate; // 0x0000(0x0010) (Parm, ZeroConstructor, NoDestructor, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetBlueprintLibrary.SetWindowTitleBarCloseButtonActive
struct UWidgetBlueprintLibrary_SetWindowTitleBarCloseButtonActive_Params
{
bool bActive; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetBlueprintLibrary.SetUserFocus
struct UWidgetBlueprintLibrary_SetUserFocus_Params
{
struct FEventReply Reply; // 0x0000(0x00C0) (Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
class UWidget* FocusWidget; // 0x00C0(0x0008) (Parm, ZeroConstructor, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool bInAllUsers; // 0x00C8(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FEventReply ReturnValue; // 0x00D0(0x00C0) (Parm, OutParm, ReturnParm, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetBlueprintLibrary.SetMousePosition
struct UWidgetBlueprintLibrary_SetMousePosition_Params
{
struct FEventReply Reply; // 0x0000(0x00C0) (Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
struct FVector2D NewMousePosition; // 0x00C0(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FEventReply ReturnValue; // 0x00C8(0x00C0) (Parm, OutParm, ReturnParm, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetBlueprintLibrary.SetInputMode_UIOnlyEx
struct UWidgetBlueprintLibrary_SetInputMode_UIOnlyEx_Params
{
class APlayerController* PlayerController; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class UWidget* InWidgetToFocus; // 0x0008(0x0008) (Parm, ZeroConstructor, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
Engine_EMouseLockMode InMouseLockMode; // 0x0010(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetBlueprintLibrary.SetInputMode_UIOnly
struct UWidgetBlueprintLibrary_SetInputMode_UIOnly_Params
{
class APlayerController* Target; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class UWidget* InWidgetToFocus; // 0x0008(0x0008) (Parm, ZeroConstructor, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool bLockMouseToViewport; // 0x0010(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetBlueprintLibrary.SetInputMode_GameOnly
struct UWidgetBlueprintLibrary_SetInputMode_GameOnly_Params
{
class APlayerController* PlayerController; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetBlueprintLibrary.SetInputMode_GameAndUIEx
struct UWidgetBlueprintLibrary_SetInputMode_GameAndUIEx_Params
{
class APlayerController* PlayerController; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class UWidget* InWidgetToFocus; // 0x0008(0x0008) (Parm, ZeroConstructor, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
Engine_EMouseLockMode InMouseLockMode; // 0x0010(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool bHideCursorDuringCapture; // 0x0011(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetBlueprintLibrary.SetInputMode_GameAndUI
struct UWidgetBlueprintLibrary_SetInputMode_GameAndUI_Params
{
class APlayerController* Target; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class UWidget* InWidgetToFocus; // 0x0008(0x0008) (Parm, ZeroConstructor, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool bLockMouseToViewport; // 0x0010(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool bHideCursorDuringCapture; // 0x0011(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetBlueprintLibrary.SetHardwareCursor
struct UWidgetBlueprintLibrary_SetHardwareCursor_Params
{
class UObject* WorldContextObject; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
TEnumAsByte<CoreUObject_EMouseCursor> CursorShape; // 0x0008(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FName CursorName; // 0x000C(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FVector2D HotSpot; // 0x0014(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool ReturnValue; // 0x001C(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetBlueprintLibrary.SetFocusToGameViewport
struct UWidgetBlueprintLibrary_SetFocusToGameViewport_Params
{
};
// Function UMG.WidgetBlueprintLibrary.SetColorVisionDeficiencyType
struct UWidgetBlueprintLibrary_SetColorVisionDeficiencyType_Params
{
SlateCore_EColorVisionDeficiency Type; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
float Severity; // 0x0004(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool CorrectDeficiency; // 0x0008(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool ShowCorrectionWithDeficiency; // 0x0009(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, AdvancedDisplay, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetBlueprintLibrary.SetBrushResourceToTexture
struct UWidgetBlueprintLibrary_SetBrushResourceToTexture_Params
{
struct FSlateBrush Brush; // 0x0000(0x0088) (Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
class UTexture2D* Texture; // 0x0088(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetBlueprintLibrary.SetBrushResourceToMaterial
struct UWidgetBlueprintLibrary_SetBrushResourceToMaterial_Params
{
struct FSlateBrush Brush; // 0x0000(0x0088) (Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
class UMaterialInterface* Material; // 0x0088(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetBlueprintLibrary.RestorePreviousWindowTitleBarState
struct UWidgetBlueprintLibrary_RestorePreviousWindowTitleBarState_Params
{
};
// Function UMG.WidgetBlueprintLibrary.ReleaseMouseCapture
struct UWidgetBlueprintLibrary_ReleaseMouseCapture_Params
{
struct FEventReply Reply; // 0x0000(0x00C0) (Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
struct FEventReply ReturnValue; // 0x00C0(0x00C0) (Parm, OutParm, ReturnParm, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetBlueprintLibrary.ReleaseJoystickCapture
struct UWidgetBlueprintLibrary_ReleaseJoystickCapture_Params
{
struct FEventReply Reply; // 0x0000(0x00C0) (Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
bool bInAllJoysticks; // 0x00C0(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FEventReply ReturnValue; // 0x00C8(0x00C0) (Parm, OutParm, ReturnParm, NativeAccessSpecifierPublic)
};
// DelegateFunction UMG.WidgetBlueprintLibrary.OnGameWindowCloseButtonClickedDelegate__DelegateSignature
struct UWidgetBlueprintLibrary_OnGameWindowCloseButtonClickedDelegate__DelegateSignature_Params
{
};
// Function UMG.WidgetBlueprintLibrary.NoResourceBrush
struct UWidgetBlueprintLibrary_NoResourceBrush_Params
{
struct FSlateBrush ReturnValue; // 0x0000(0x0088) (Parm, OutParm, ReturnParm, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetBlueprintLibrary.MakeBrushFromTexture
struct UWidgetBlueprintLibrary_MakeBrushFromTexture_Params
{
class UTexture2D* Texture; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
int Width; // 0x0008(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
int Height; // 0x000C(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FSlateBrush ReturnValue; // 0x0010(0x0088) (Parm, OutParm, ReturnParm, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetBlueprintLibrary.MakeBrushFromMaterial
struct UWidgetBlueprintLibrary_MakeBrushFromMaterial_Params
{
class UMaterialInterface* Material; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
int Width; // 0x0008(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
int Height; // 0x000C(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FSlateBrush ReturnValue; // 0x0010(0x0088) (Parm, OutParm, ReturnParm, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetBlueprintLibrary.MakeBrushFromAsset
struct UWidgetBlueprintLibrary_MakeBrushFromAsset_Params
{
class USlateBrushAsset* BrushAsset; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FSlateBrush ReturnValue; // 0x0008(0x0088) (Parm, OutParm, ReturnParm, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetBlueprintLibrary.LockMouse
struct UWidgetBlueprintLibrary_LockMouse_Params
{
struct FEventReply Reply; // 0x0000(0x00C0) (Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
class UWidget* CapturingWidget; // 0x00C0(0x0008) (Parm, ZeroConstructor, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FEventReply ReturnValue; // 0x00C8(0x00C0) (Parm, OutParm, ReturnParm, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetBlueprintLibrary.IsDragDropping
struct UWidgetBlueprintLibrary_IsDragDropping_Params
{
bool ReturnValue; // 0x0000(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetBlueprintLibrary.Handled
struct UWidgetBlueprintLibrary_Handled_Params
{
struct FEventReply ReturnValue; // 0x0000(0x00C0) (Parm, OutParm, ReturnParm, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetBlueprintLibrary.GetSafeZonePadding
struct UWidgetBlueprintLibrary_GetSafeZonePadding_Params
{
class UObject* WorldContextObject; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FVector4 SafePadding; // 0x0010(0x0010) (Parm, OutParm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FVector2D SafePaddingScale; // 0x0020(0x0008) (Parm, OutParm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FVector4 SpillOverPadding; // 0x0030(0x0010) (Parm, OutParm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetBlueprintLibrary.GetKeyEventFromAnalogInputEvent
struct UWidgetBlueprintLibrary_GetKeyEventFromAnalogInputEvent_Params
{
struct FAnalogInputEvent Event; // 0x0000(0x0040) (ConstParm, Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
struct FKeyEvent ReturnValue; // 0x0040(0x0038) (Parm, OutParm, ReturnParm, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetBlueprintLibrary.GetInputEventFromPointerEvent
struct UWidgetBlueprintLibrary_GetInputEventFromPointerEvent_Params
{
struct FPointerEvent Event; // 0x0000(0x0070) (ConstParm, Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
struct FInputEvent ReturnValue; // 0x0070(0x0018) (Parm, OutParm, ReturnParm, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetBlueprintLibrary.GetInputEventFromNavigationEvent
struct UWidgetBlueprintLibrary_GetInputEventFromNavigationEvent_Params
{
struct FNavigationEvent Event; // 0x0000(0x0020) (ConstParm, Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
struct FInputEvent ReturnValue; // 0x0020(0x0018) (Parm, OutParm, ReturnParm, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetBlueprintLibrary.GetInputEventFromKeyEvent
struct UWidgetBlueprintLibrary_GetInputEventFromKeyEvent_Params
{
struct FKeyEvent Event; // 0x0000(0x0038) (ConstParm, Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
struct FInputEvent ReturnValue; // 0x0038(0x0018) (Parm, OutParm, ReturnParm, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetBlueprintLibrary.GetInputEventFromCharacterEvent
struct UWidgetBlueprintLibrary_GetInputEventFromCharacterEvent_Params
{
struct FCharacterEvent Event; // 0x0000(0x0020) (ConstParm, Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
struct FInputEvent ReturnValue; // 0x0020(0x0018) (Parm, OutParm, ReturnParm, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetBlueprintLibrary.GetDynamicMaterial
struct UWidgetBlueprintLibrary_GetDynamicMaterial_Params
{
struct FSlateBrush Brush; // 0x0000(0x0088) (Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
class UMaterialInstanceDynamic* ReturnValue; // 0x0088(0x0008) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetBlueprintLibrary.GetDragDroppingContent
struct UWidgetBlueprintLibrary_GetDragDroppingContent_Params
{
class UDragDropOperation* ReturnValue; // 0x0000(0x0008) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetBlueprintLibrary.GetBrushResourceAsTexture2D
struct UWidgetBlueprintLibrary_GetBrushResourceAsTexture2D_Params
{
struct FSlateBrush Brush; // 0x0000(0x0088) (ConstParm, Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
class UTexture2D* ReturnValue; // 0x0088(0x0008) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetBlueprintLibrary.GetBrushResourceAsMaterial
struct UWidgetBlueprintLibrary_GetBrushResourceAsMaterial_Params
{
struct FSlateBrush Brush; // 0x0000(0x0088) (ConstParm, Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
class UMaterialInterface* ReturnValue; // 0x0088(0x0008) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetBlueprintLibrary.GetBrushResource
struct UWidgetBlueprintLibrary_GetBrushResource_Params
{
struct FSlateBrush Brush; // 0x0000(0x0088) (ConstParm, Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
class UObject* ReturnValue; // 0x0088(0x0008) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetBlueprintLibrary.GetAllWidgetsWithInterface
struct UWidgetBlueprintLibrary_GetAllWidgetsWithInterface_Params
{
class UObject* WorldContextObject; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
TArray<class UUserWidget*> FoundWidgets; // 0x0008(0x0010) (Parm, OutParm, ZeroConstructor, ContainsInstancedReference, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class UClass* Interface; // 0x0018(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, UObjectWrapper, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool TopLevelOnly; // 0x0020(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetBlueprintLibrary.GetAllWidgetsOfClass
struct UWidgetBlueprintLibrary_GetAllWidgetsOfClass_Params
{
class UObject* WorldContextObject; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
TArray<class UUserWidget*> FoundWidgets; // 0x0008(0x0010) (Parm, OutParm, ZeroConstructor, ContainsInstancedReference, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class UClass* WidgetClass; // 0x0018(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, UObjectWrapper, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool TopLevelOnly; // 0x0020(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetBlueprintLibrary.EndDragDrop
struct UWidgetBlueprintLibrary_EndDragDrop_Params
{
struct FEventReply Reply; // 0x0000(0x00C0) (Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
struct FEventReply ReturnValue; // 0x00C0(0x00C0) (Parm, OutParm, ReturnParm, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetBlueprintLibrary.DrawTextFormatted
struct UWidgetBlueprintLibrary_DrawTextFormatted_Params
{
struct FPaintContext Context; // 0x0000(0x0030) (Parm, OutParm, ReferenceParm, NoDestructor, NativeAccessSpecifierPublic)
struct FText Text; // 0x0030(0x0018) (ConstParm, Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
struct FVector2D Position; // 0x0048(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class UFont* Font; // 0x0050(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
int FontSize; // 0x0058(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FName FontTypeFace; // 0x005C(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FLinearColor Tint; // 0x0064(0x0010) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetBlueprintLibrary.DrawText
struct UWidgetBlueprintLibrary_DrawText_Params
{
struct FPaintContext Context; // 0x0000(0x0030) (Parm, OutParm, ReferenceParm, NoDestructor, NativeAccessSpecifierPublic)
struct FString inString; // 0x0030(0x0010) (Parm, ZeroConstructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FVector2D Position; // 0x0040(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FLinearColor Tint; // 0x0048(0x0010) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetBlueprintLibrary.DrawLines
struct UWidgetBlueprintLibrary_DrawLines_Params
{
struct FPaintContext Context; // 0x0000(0x0030) (Parm, OutParm, ReferenceParm, NoDestructor, NativeAccessSpecifierPublic)
TArray<struct FVector2D> Points; // 0x0030(0x0010) (ConstParm, Parm, OutParm, ZeroConstructor, ReferenceParm, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FLinearColor Tint; // 0x0040(0x0010) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool bAntiAlias; // 0x0050(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, AdvancedDisplay, HasGetValueTypeHash, NativeAccessSpecifierPublic)
float Thickness; // 0x0054(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, AdvancedDisplay, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetBlueprintLibrary.DrawLine
struct UWidgetBlueprintLibrary_DrawLine_Params
{
struct FPaintContext Context; // 0x0000(0x0030) (Parm, OutParm, ReferenceParm, NoDestructor, NativeAccessSpecifierPublic)
struct FVector2D PositionA; // 0x0030(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FVector2D PositionB; // 0x0038(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FLinearColor Tint; // 0x0040(0x0010) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool bAntiAlias; // 0x0050(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, AdvancedDisplay, HasGetValueTypeHash, NativeAccessSpecifierPublic)
float Thickness; // 0x0054(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, AdvancedDisplay, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetBlueprintLibrary.DrawBox
struct UWidgetBlueprintLibrary_DrawBox_Params
{
struct FPaintContext Context; // 0x0000(0x0030) (Parm, OutParm, ReferenceParm, NoDestructor, NativeAccessSpecifierPublic)
struct FVector2D Position; // 0x0030(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FVector2D Size; // 0x0038(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class USlateBrushAsset* Brush; // 0x0040(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FLinearColor Tint; // 0x0048(0x0010) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetBlueprintLibrary.DismissAllMenus
struct UWidgetBlueprintLibrary_DismissAllMenus_Params
{
};
// Function UMG.WidgetBlueprintLibrary.DetectDragIfPressed
struct UWidgetBlueprintLibrary_DetectDragIfPressed_Params
{
struct FPointerEvent PointerEvent; // 0x0000(0x0070) (ConstParm, Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
class UWidget* WidgetDetectingDrag; // 0x0070(0x0008) (Parm, ZeroConstructor, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FKey DragKey; // 0x0078(0x0018) (Parm, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FEventReply ReturnValue; // 0x0090(0x00C0) (Parm, OutParm, ReturnParm, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetBlueprintLibrary.DetectDrag
struct UWidgetBlueprintLibrary_DetectDrag_Params
{
struct FEventReply Reply; // 0x0000(0x00C0) (Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
class UWidget* WidgetDetectingDrag; // 0x00C0(0x0008) (Parm, ZeroConstructor, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FKey DragKey; // 0x00C8(0x0018) (Parm, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FEventReply ReturnValue; // 0x00E0(0x00C0) (Parm, OutParm, ReturnParm, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetBlueprintLibrary.CreateDragDropOperation
struct UWidgetBlueprintLibrary_CreateDragDropOperation_Params
{
class UClass* OperationClass; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, UObjectWrapper, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class UDragDropOperation* ReturnValue; // 0x0008(0x0008) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetBlueprintLibrary.Create
struct UWidgetBlueprintLibrary_Create_Params
{
class UObject* WorldContextObject; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class UClass* WidgetType; // 0x0008(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, UObjectWrapper, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class APlayerController* OwningPlayer; // 0x0010(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class UUserWidget* ReturnValue; // 0x0018(0x0008) (ExportObject, Parm, OutParm, ZeroConstructor, ReturnParm, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetBlueprintLibrary.ClearUserFocus
struct UWidgetBlueprintLibrary_ClearUserFocus_Params
{
struct FEventReply Reply; // 0x0000(0x00C0) (Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
bool bInAllUsers; // 0x00C0(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FEventReply ReturnValue; // 0x00C8(0x00C0) (Parm, OutParm, ReturnParm, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetBlueprintLibrary.CaptureMouse
struct UWidgetBlueprintLibrary_CaptureMouse_Params
{
struct FEventReply Reply; // 0x0000(0x00C0) (Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
class UWidget* CapturingWidget; // 0x00C0(0x0008) (Parm, ZeroConstructor, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FEventReply ReturnValue; // 0x00C8(0x00C0) (Parm, OutParm, ReturnParm, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetBlueprintLibrary.CaptureJoystick
struct UWidgetBlueprintLibrary_CaptureJoystick_Params
{
struct FEventReply Reply; // 0x0000(0x00C0) (Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
class UWidget* CapturingWidget; // 0x00C0(0x0008) (Parm, ZeroConstructor, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool bInAllJoysticks; // 0x00C8(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FEventReply ReturnValue; // 0x00D0(0x00C0) (Parm, OutParm, ReturnParm, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetBlueprintLibrary.CancelDragDrop
struct UWidgetBlueprintLibrary_CancelDragDrop_Params
{
};
// Function UMG.WidgetComponent.SetWindowVisibility
struct UWidgetComponent_SetWindowVisibility_Params
{
UMG_EWindowVisibility InVisibility; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetComponent.SetWindowFocusable
struct UWidgetComponent_SetWindowFocusable_Params
{
bool bInWindowFocusable; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetComponent.SetWidgetSpace
struct UWidgetComponent_SetWidgetSpace_Params
{
UMG_EWidgetSpace NewSpace; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetComponent.SetWidget
struct UWidgetComponent_SetWidget_Params
{
class UUserWidget* Widget; // 0x0000(0x0008) (Parm, ZeroConstructor, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetComponent.SetTwoSided
struct UWidgetComponent_SetTwoSided_Params
{
bool bWantTwoSided; // 0x0000(0x0001) (ConstParm, Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetComponent.SetTintColorAndOpacity
struct UWidgetComponent_SetTintColorAndOpacity_Params
{
struct FLinearColor NewTintColorAndOpacity; // 0x0000(0x0010) (ConstParm, Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetComponent.SetTickWhenOffscreen
struct UWidgetComponent_SetTickWhenOffscreen_Params
{
bool bWantTickWhenOffscreen; // 0x0000(0x0001) (ConstParm, Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetComponent.SetRedrawTime
struct UWidgetComponent_SetRedrawTime_Params
{
float InRedrawTime; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetComponent.SetPivot
struct UWidgetComponent_SetPivot_Params
{
struct FVector2D InPivot; // 0x0000(0x0008) (ConstParm, Parm, OutParm, ZeroConstructor, ReferenceParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetComponent.SetOwnerPlayer
struct UWidgetComponent_SetOwnerPlayer_Params
{
class ULocalPlayer* LocalPlayer; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetComponent.SetManuallyRedraw
struct UWidgetComponent_SetManuallyRedraw_Params
{
bool bUseManualRedraw; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetComponent.SetGeometryMode
struct UWidgetComponent_SetGeometryMode_Params
{
UMG_EWidgetGeometryMode InGeometryMode; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetComponent.SetDrawSize
struct UWidgetComponent_SetDrawSize_Params
{
struct FVector2D Size; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetComponent.SetDrawAtDesiredSize
struct UWidgetComponent_SetDrawAtDesiredSize_Params
{
bool bInDrawAtDesiredSize; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetComponent.SetCylinderArcAngle
struct UWidgetComponent_SetCylinderArcAngle_Params
{
float InCylinderArcAngle; // 0x0000(0x0004) (ConstParm, Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetComponent.SetBackgroundColor
struct UWidgetComponent_SetBackgroundColor_Params
{
struct FLinearColor NewBackgroundColor; // 0x0000(0x0010) (ConstParm, Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetComponent.RequestRedraw
struct UWidgetComponent_RequestRedraw_Params
{
};
// Function UMG.WidgetComponent.GetWindowVisiblility
struct UWidgetComponent_GetWindowVisiblility_Params
{
UMG_EWindowVisibility ReturnValue; // 0x0000(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetComponent.GetWindowFocusable
struct UWidgetComponent_GetWindowFocusable_Params
{
bool ReturnValue; // 0x0000(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetComponent.GetWidgetSpace
struct UWidgetComponent_GetWidgetSpace_Params
{
UMG_EWidgetSpace ReturnValue; // 0x0000(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetComponent.GetUserWidgetObject
struct UWidgetComponent_GetUserWidgetObject_Params
{
class UUserWidget* ReturnValue; // 0x0000(0x0008) (ExportObject, Parm, OutParm, ZeroConstructor, ReturnParm, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetComponent.GetTwoSided
struct UWidgetComponent_GetTwoSided_Params
{
bool ReturnValue; // 0x0000(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetComponent.GetTickWhenOffscreen
struct UWidgetComponent_GetTickWhenOffscreen_Params
{
bool ReturnValue; // 0x0000(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetComponent.GetRenderTarget
struct UWidgetComponent_GetRenderTarget_Params
{
class UTextureRenderTarget2D* ReturnValue; // 0x0000(0x0008) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetComponent.GetRedrawTime
struct UWidgetComponent_GetRedrawTime_Params
{
float ReturnValue; // 0x0000(0x0004) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetComponent.GetPivot
struct UWidgetComponent_GetPivot_Params
{
struct FVector2D ReturnValue; // 0x0000(0x0008) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetComponent.GetOwnerPlayer
struct UWidgetComponent_GetOwnerPlayer_Params
{
class ULocalPlayer* ReturnValue; // 0x0000(0x0008) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetComponent.GetMaterialInstance
struct UWidgetComponent_GetMaterialInstance_Params
{
class UMaterialInstanceDynamic* ReturnValue; // 0x0000(0x0008) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetComponent.GetManuallyRedraw
struct UWidgetComponent_GetManuallyRedraw_Params
{
bool ReturnValue; // 0x0000(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetComponent.GetGeometryMode
struct UWidgetComponent_GetGeometryMode_Params
{
UMG_EWidgetGeometryMode ReturnValue; // 0x0000(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetComponent.GetDrawSize
struct UWidgetComponent_GetDrawSize_Params
{
struct FVector2D ReturnValue; // 0x0000(0x0008) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetComponent.GetDrawAtDesiredSize
struct UWidgetComponent_GetDrawAtDesiredSize_Params
{
bool ReturnValue; // 0x0000(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetComponent.GetCylinderArcAngle
struct UWidgetComponent_GetCylinderArcAngle_Params
{
float ReturnValue; // 0x0000(0x0004) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetComponent.GetCurrentDrawSize
struct UWidgetComponent_GetCurrentDrawSize_Params
{
struct FVector2D ReturnValue; // 0x0000(0x0008) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetInteractionComponent.SetFocus
struct UWidgetInteractionComponent_SetFocus_Params
{
class UWidget* FocusWidget; // 0x0000(0x0008) (Parm, ZeroConstructor, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetInteractionComponent.SetCustomHitResult
struct UWidgetInteractionComponent_SetCustomHitResult_Params
{
struct FHitResult HitResult; // 0x0000(0x0088) (ConstParm, Parm, OutParm, ReferenceParm, IsPlainOldData, NoDestructor, ContainsInstancedReference, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetInteractionComponent.SendKeyChar
struct UWidgetInteractionComponent_SendKeyChar_Params
{
struct FString Characters; // 0x0000(0x0010) (Parm, ZeroConstructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool bRepeat; // 0x0010(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool ReturnValue; // 0x0011(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetInteractionComponent.ScrollWheel
struct UWidgetInteractionComponent_ScrollWheel_Params
{
float ScrollDelta; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetInteractionComponent.ReleasePointerKey
struct UWidgetInteractionComponent_ReleasePointerKey_Params
{
struct FKey Key; // 0x0000(0x0018) (Parm, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetInteractionComponent.ReleaseKey
struct UWidgetInteractionComponent_ReleaseKey_Params
{
struct FKey Key; // 0x0000(0x0018) (Parm, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool ReturnValue; // 0x0018(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetInteractionComponent.PressPointerKey
struct UWidgetInteractionComponent_PressPointerKey_Params
{
struct FKey Key; // 0x0000(0x0018) (Parm, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetInteractionComponent.PressKey
struct UWidgetInteractionComponent_PressKey_Params
{
struct FKey Key; // 0x0000(0x0018) (Parm, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool bRepeat; // 0x0018(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool ReturnValue; // 0x0019(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetInteractionComponent.PressAndReleaseKey
struct UWidgetInteractionComponent_PressAndReleaseKey_Params
{
struct FKey Key; // 0x0000(0x0018) (Parm, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool ReturnValue; // 0x0018(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetInteractionComponent.IsOverInteractableWidget
struct UWidgetInteractionComponent_IsOverInteractableWidget_Params
{
bool ReturnValue; // 0x0000(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetInteractionComponent.IsOverHitTestVisibleWidget
struct UWidgetInteractionComponent_IsOverHitTestVisibleWidget_Params
{
bool ReturnValue; // 0x0000(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetInteractionComponent.IsOverFocusableWidget
struct UWidgetInteractionComponent_IsOverFocusableWidget_Params
{
bool ReturnValue; // 0x0000(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetInteractionComponent.GetLastHitResult
struct UWidgetInteractionComponent_GetLastHitResult_Params
{
struct FHitResult ReturnValue; // 0x0000(0x0088) (ConstParm, Parm, OutParm, ReturnParm, ReferenceParm, IsPlainOldData, NoDestructor, ContainsInstancedReference, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetInteractionComponent.GetHoveredWidgetComponent
struct UWidgetInteractionComponent_GetHoveredWidgetComponent_Params
{
class UWidgetComponent* ReturnValue; // 0x0000(0x0008) (ExportObject, Parm, OutParm, ZeroConstructor, ReturnParm, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetInteractionComponent.Get2DHitLocation
struct UWidgetInteractionComponent_Get2DHitLocation_Params
{
struct FVector2D ReturnValue; // 0x0000(0x0008) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetLayoutLibrary.SlotAsWrapBoxSlot
struct UWidgetLayoutLibrary_SlotAsWrapBoxSlot_Params
{
class UWidget* Widget; // 0x0000(0x0008) (Parm, ZeroConstructor, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class UWrapBoxSlot* ReturnValue; // 0x0008(0x0008) (ExportObject, Parm, OutParm, ZeroConstructor, ReturnParm, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetLayoutLibrary.SlotAsWidgetSwitcherSlot
struct UWidgetLayoutLibrary_SlotAsWidgetSwitcherSlot_Params
{
class UWidget* Widget; // 0x0000(0x0008) (Parm, ZeroConstructor, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class UWidgetSwitcherSlot* ReturnValue; // 0x0008(0x0008) (ExportObject, Parm, OutParm, ZeroConstructor, ReturnParm, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetLayoutLibrary.SlotAsVerticalBoxSlot
struct UWidgetLayoutLibrary_SlotAsVerticalBoxSlot_Params
{
class UWidget* Widget; // 0x0000(0x0008) (Parm, ZeroConstructor, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class UVerticalBoxSlot* ReturnValue; // 0x0008(0x0008) (ExportObject, Parm, OutParm, ZeroConstructor, ReturnParm, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetLayoutLibrary.SlotAsUniformGridSlot
struct UWidgetLayoutLibrary_SlotAsUniformGridSlot_Params
{
class UWidget* Widget; // 0x0000(0x0008) (Parm, ZeroConstructor, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class UUniformGridSlot* ReturnValue; // 0x0008(0x0008) (ExportObject, Parm, OutParm, ZeroConstructor, ReturnParm, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetLayoutLibrary.SlotAsSizeBoxSlot
struct UWidgetLayoutLibrary_SlotAsSizeBoxSlot_Params
{
class UWidget* Widget; // 0x0000(0x0008) (Parm, ZeroConstructor, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class USizeBoxSlot* ReturnValue; // 0x0008(0x0008) (ExportObject, Parm, OutParm, ZeroConstructor, ReturnParm, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetLayoutLibrary.SlotAsScrollBoxSlot
struct UWidgetLayoutLibrary_SlotAsScrollBoxSlot_Params
{
class UWidget* Widget; // 0x0000(0x0008) (Parm, ZeroConstructor, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class UScrollBoxSlot* ReturnValue; // 0x0008(0x0008) (ExportObject, Parm, OutParm, ZeroConstructor, ReturnParm, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetLayoutLibrary.SlotAsScaleBoxSlot
struct UWidgetLayoutLibrary_SlotAsScaleBoxSlot_Params
{
class UWidget* Widget; // 0x0000(0x0008) (Parm, ZeroConstructor, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class UScaleBoxSlot* ReturnValue; // 0x0008(0x0008) (ExportObject, Parm, OutParm, ZeroConstructor, ReturnParm, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetLayoutLibrary.SlotAsSafeBoxSlot
struct UWidgetLayoutLibrary_SlotAsSafeBoxSlot_Params
{
class UWidget* Widget; // 0x0000(0x0008) (Parm, ZeroConstructor, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class USafeZoneSlot* ReturnValue; // 0x0008(0x0008) (ExportObject, Parm, OutParm, ZeroConstructor, ReturnParm, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetLayoutLibrary.SlotAsOverlaySlot
struct UWidgetLayoutLibrary_SlotAsOverlaySlot_Params
{
class UWidget* Widget; // 0x0000(0x0008) (Parm, ZeroConstructor, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class UOverlaySlot* ReturnValue; // 0x0008(0x0008) (ExportObject, Parm, OutParm, ZeroConstructor, ReturnParm, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetLayoutLibrary.SlotAsHorizontalBoxSlot
struct UWidgetLayoutLibrary_SlotAsHorizontalBoxSlot_Params
{
class UWidget* Widget; // 0x0000(0x0008) (Parm, ZeroConstructor, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class UHorizontalBoxSlot* ReturnValue; // 0x0008(0x0008) (ExportObject, Parm, OutParm, ZeroConstructor, ReturnParm, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetLayoutLibrary.SlotAsGridSlot
struct UWidgetLayoutLibrary_SlotAsGridSlot_Params
{
class UWidget* Widget; // 0x0000(0x0008) (Parm, ZeroConstructor, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class UGridSlot* ReturnValue; // 0x0008(0x0008) (ExportObject, Parm, OutParm, ZeroConstructor, ReturnParm, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetLayoutLibrary.SlotAsCanvasSlot
struct UWidgetLayoutLibrary_SlotAsCanvasSlot_Params
{
class UWidget* Widget; // 0x0000(0x0008) (Parm, ZeroConstructor, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class UCanvasPanelSlot* ReturnValue; // 0x0008(0x0008) (ExportObject, Parm, OutParm, ZeroConstructor, ReturnParm, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetLayoutLibrary.SlotAsBorderSlot
struct UWidgetLayoutLibrary_SlotAsBorderSlot_Params
{
class UWidget* Widget; // 0x0000(0x0008) (Parm, ZeroConstructor, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class UBorderSlot* ReturnValue; // 0x0008(0x0008) (ExportObject, Parm, OutParm, ZeroConstructor, ReturnParm, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetLayoutLibrary.RemoveAllWidgets
struct UWidgetLayoutLibrary_RemoveAllWidgets_Params
{
class UObject* WorldContextObject; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetLayoutLibrary.ProjectWorldLocationToWidgetPosition
struct UWidgetLayoutLibrary_ProjectWorldLocationToWidgetPosition_Params
{
class APlayerController* PlayerController; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FVector WorldLocation; // 0x0008(0x000C) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FVector2D ScreenPosition; // 0x0014(0x0008) (Parm, OutParm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool bPlayerViewportRelative; // 0x001C(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool ReturnValue; // 0x001D(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetLayoutLibrary.GetViewportWidgetGeometry
struct UWidgetLayoutLibrary_GetViewportWidgetGeometry_Params
{
class UObject* WorldContextObject; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FGeometry ReturnValue; // 0x0008(0x0058) (Parm, OutParm, ReturnParm, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetLayoutLibrary.GetViewportSize
struct UWidgetLayoutLibrary_GetViewportSize_Params
{
class UObject* WorldContextObject; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FVector2D ReturnValue; // 0x0008(0x0008) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetLayoutLibrary.GetViewportScale
struct UWidgetLayoutLibrary_GetViewportScale_Params
{
class UObject* WorldContextObject; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
float ReturnValue; // 0x0008(0x0004) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetLayoutLibrary.GetPlayerScreenWidgetGeometry
struct UWidgetLayoutLibrary_GetPlayerScreenWidgetGeometry_Params
{
class APlayerController* PlayerController; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FGeometry ReturnValue; // 0x0008(0x0058) (Parm, OutParm, ReturnParm, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetLayoutLibrary.GetMousePositionScaledByDPI
struct UWidgetLayoutLibrary_GetMousePositionScaledByDPI_Params
{
class APlayerController* Player; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
float LocationX; // 0x0008(0x0004) (Parm, OutParm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
float LocationY; // 0x000C(0x0004) (Parm, OutParm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool ReturnValue; // 0x0010(0x0001) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetLayoutLibrary.GetMousePositionOnViewport
struct UWidgetLayoutLibrary_GetMousePositionOnViewport_Params
{
class UObject* WorldContextObject; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FVector2D ReturnValue; // 0x0008(0x0008) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetLayoutLibrary.GetMousePositionOnPlatform
struct UWidgetLayoutLibrary_GetMousePositionOnPlatform_Params
{
struct FVector2D ReturnValue; // 0x0000(0x0008) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetSwitcher.SetActiveWidgetIndex
struct UWidgetSwitcher_SetActiveWidgetIndex_Params
{
int Index; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetSwitcher.SetActiveWidget
struct UWidgetSwitcher_SetActiveWidget_Params
{
class UWidget* Widget; // 0x0000(0x0008) (Parm, ZeroConstructor, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetSwitcher.GetWidgetAtIndex
struct UWidgetSwitcher_GetWidgetAtIndex_Params
{
int Index; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class UWidget* ReturnValue; // 0x0008(0x0008) (ExportObject, Parm, OutParm, ZeroConstructor, ReturnParm, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetSwitcher.GetNumWidgets
struct UWidgetSwitcher_GetNumWidgets_Params
{
int ReturnValue; // 0x0000(0x0004) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetSwitcher.GetActiveWidgetIndex
struct UWidgetSwitcher_GetActiveWidgetIndex_Params
{
int ReturnValue; // 0x0000(0x0004) (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetSwitcher.GetActiveWidget
struct UWidgetSwitcher_GetActiveWidget_Params
{
class UWidget* ReturnValue; // 0x0000(0x0008) (ExportObject, Parm, OutParm, ZeroConstructor, ReturnParm, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetSwitcherSlot.SetVerticalAlignment
struct UWidgetSwitcherSlot_SetVerticalAlignment_Params
{
TEnumAsByte<SlateCore_EVerticalAlignment> InVerticalAlignment; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetSwitcherSlot.SetPadding
struct UWidgetSwitcherSlot_SetPadding_Params
{
struct FMargin InPadding; // 0x0000(0x0010) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
};
// Function UMG.WidgetSwitcherSlot.SetHorizontalAlignment
struct UWidgetSwitcherSlot_SetHorizontalAlignment_Params
{
TEnumAsByte<SlateCore_EHorizontalAlignment> InHorizontalAlignment; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WindowTitleBarArea.SetVerticalAlignment
struct UWindowTitleBarArea_SetVerticalAlignment_Params
{
TEnumAsByte<SlateCore_EVerticalAlignment> InVerticalAlignment; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WindowTitleBarArea.SetPadding
struct UWindowTitleBarArea_SetPadding_Params
{
struct FMargin InPadding; // 0x0000(0x0010) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
};
// Function UMG.WindowTitleBarArea.SetHorizontalAlignment
struct UWindowTitleBarArea_SetHorizontalAlignment_Params
{
TEnumAsByte<SlateCore_EHorizontalAlignment> InHorizontalAlignment; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WindowTitleBarAreaSlot.SetVerticalAlignment
struct UWindowTitleBarAreaSlot_SetVerticalAlignment_Params
{
TEnumAsByte<SlateCore_EVerticalAlignment> InVerticalAlignment; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WindowTitleBarAreaSlot.SetPadding
struct UWindowTitleBarAreaSlot_SetPadding_Params
{
struct FMargin InPadding; // 0x0000(0x0010) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
};
// Function UMG.WindowTitleBarAreaSlot.SetHorizontalAlignment
struct UWindowTitleBarAreaSlot_SetHorizontalAlignment_Params
{
TEnumAsByte<SlateCore_EHorizontalAlignment> InHorizontalAlignment; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WrapBox.SetInnerSlotPadding
struct UWrapBox_SetInnerSlotPadding_Params
{
struct FVector2D InPadding; // 0x0000(0x0008) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WrapBox.AddChildToWrapBox
struct UWrapBox_AddChildToWrapBox_Params
{
class UWidget* Content; // 0x0000(0x0008) (Parm, ZeroConstructor, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class UWrapBoxSlot* ReturnValue; // 0x0008(0x0008) (ExportObject, Parm, OutParm, ZeroConstructor, ReturnParm, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WrapBoxSlot.SetVerticalAlignment
struct UWrapBoxSlot_SetVerticalAlignment_Params
{
TEnumAsByte<SlateCore_EVerticalAlignment> InVerticalAlignment; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WrapBoxSlot.SetPadding
struct UWrapBoxSlot_SetPadding_Params
{
struct FMargin InPadding; // 0x0000(0x0010) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
};
// Function UMG.WrapBoxSlot.SetHorizontalAlignment
struct UWrapBoxSlot_SetHorizontalAlignment_Params
{
TEnumAsByte<SlateCore_EHorizontalAlignment> InHorizontalAlignment; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WrapBoxSlot.SetFillSpanWhenLessThan
struct UWrapBoxSlot_SetFillSpanWhenLessThan_Params
{
float InFillSpanWhenLessThan; // 0x0000(0x0004) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function UMG.WrapBoxSlot.SetFillEmptySpace
struct UWrapBoxSlot_SetFillEmptySpace_Params
{
bool InbFillEmptySpace; // 0x0000(0x0001) (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
}
#ifdef _MSC_VER
#pragma pack(pop)
#endif
| [
"51001754+dmitrysolovev@users.noreply.github.com"
] | 51001754+dmitrysolovev@users.noreply.github.com |
0be4584e29b6b2c240a8c79db97913e7a5891ad9 | 1578f090a72c54c851eb19a751a2920792644409 | /hashset.hpp | 503cd8e41b4e30403a6738363ae190e34336dcab | [] | no_license | patrickdgr81/SpellcheckerC-- | c6aac42416dc136a1555565044e2e38320bf7d3c | 84424204104de16d312f7971578b5161c7e68623 | refs/heads/master | 2021-01-25T12:20:37.848954 | 2014-01-03T22:34:23 | 2014-01-03T22:34:23 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,512 | hpp | /**
* \file hashset.hpp
* \brief Declares the hashset template.
*
* \Author: Lu Wenhao, Wang Xiaotian (wlu-xwang)
*/
#ifndef HASHSET_HPP
#define HASHSET_HPP 1
#include "abstractset.hpp"
#include <cstddef>
#include <list>
#include <iostream>
/// The number of buckets we decide to start with.
static const size_t STARTING_BUCKETS = 17;
/// The max load factor for the hash table.
static const double MAX_LOAD = 0.9;
/**
* \class HashSet
*
* \brief
* A set class template using hash tables.
*/
template <typename T>
class HashSet: public AbstractSet<T> {
public:
/**
* \brief Default constructor
* \details constructor initializes the hashset and sets the number
* of buckets to starting size
*/
HashSet();
/**
* \brief Default destructor
*/
~HashSet();
/**
* \brief how many elements are in hashtable
*/
size_t size() const override;
/**
* \brief insert T into hashtable
* \details inserts type T into hashtable, if bucket has something in
* it, still add to that bucket using separate chaining
*/
void insert(const T&) override;
/**
* \brief check if T is in hashtable
*/
bool exists(const T&) const override;
/**
* \brief Some debugging outputs
*/
std::ostream& showStatistics(std::ostream& out) const;
/**
* \brief returns number of buckets in hashtable
*/
size_t buckets() const;
/**
* \brief returns number of times the hashtable has resized
*/
size_t reallocations() const;
/**
* \brief returns number of collisions
*/
size_t collisions() const;
/**
* \brief returns number of times the hashtable has resized
*/
size_t maximal() const;
typedef typename std::list<T>::iterator bucket_it;
private:
/// Private copy constructor
HashSet(const HashSet& orig);
/// Private assignment operator
HashSet& operator=(const HashSet& rhs);
/// Copy the HashSet into a bigger HashSet
void resizeAndCopy();
std::list<T>* buckets_;
size_t numBuckets_;///number of buckets
size_t size_;///number of items stored in hash table
size_t reallocations_;///number of times hash table has resized
size_t collisions_;///number of times inserted in nonempty bucket
size_t maximal_;///largest number of elements in single bucket
};
#include "hashset-private.hpp"
#endif // PREDICTOR_HPP
| [
"patricklu00@hotmail.com"
] | patricklu00@hotmail.com |
4ee1bd1d41dc881990c275066081718c942a9f8e | ca72686ff29bfa25c440449bc672fceb927326a3 | /advanced/homework_9b/homework_9b.cpp | 2a51d5b219daef09020898287d0171b3d6e7ba6b | [
"MIT"
] | permissive | runt1m33rr0r/cpp-stuff | 1ea05acac3a320330a4e9be33538044dd03c589b | 0a98d8d618a8226e7e2a63b262ef8fe3ec43e185 | refs/heads/master | 2021-06-22T05:24:38.831066 | 2019-06-01T08:00:53 | 2019-06-01T08:00:53 | 109,747,935 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,368 | cpp | #include "pch.h"
// Александър Янков F87134
#include <iostream>
#include <vector>
#include <limits>
#include <unordered_set>
using namespace std;
typedef vector<vector<unsigned>> Graph;
const unsigned MAX_VALUE = numeric_limits<unsigned>::max();
unsigned minSum;
unsigned curSum;
vector<unsigned> used;
vector<unsigned> cycle;
vector<unsigned> minCycle;
Graph graph;
struct Edge
{
unsigned from;
unsigned to;
unsigned weight;
Edge(unsigned from, unsigned to, unsigned weight) :
from(from), to(to), weight(weight) {}
};
void PrintCycle(unsigned nodesCount)
{
if (minSum == MAX_VALUE)
{
cout << "-1";
return;
}
cout << "1 ";
for (size_t i = 0; i < nodesCount - 1; i++)
{
cout << minCycle[i] + 1 << " ";
}
}
void Hamilton(unsigned i, unsigned level)
{
size_t k;
if ((0 == i) && (level > 0))
{
if (level == graph.size())
{
minSum = curSum;
for (k = 0; k < graph.size(); k++)
{
minCycle[k] = cycle[k];
}
}
return;
}
if (used[i])
{
return;
}
used[i] = 1;
for (k = 0; k < graph.size(); k++)
{
if (graph[i][k] && k != i)
{
cycle[level] = k;
curSum += graph[i][k];
if (curSum < minSum)
{
Hamilton(k, level + 1);
}
curSum -= graph[i][k];
}
}
used[i] = 0;
}
void Reset()
{
used = vector<unsigned>(graph.size());
fill(used.begin(), used.end(), 0);
cycle = vector<unsigned>(graph.size());
cycle[0] = 1;
minCycle = vector<unsigned>(graph.size());
minSum = MAX_VALUE;
curSum = 0;
}
void BuildGraph(Graph& graph, const vector<Edge>& edges, unsigned nodesCount)
{
graph.resize(nodesCount);
for (size_t i = 0; i < graph.size(); i++)
{
graph[i].resize(nodesCount);
fill(graph[i].begin(), graph[i].end(), 0);
}
for (auto edge : edges)
{
graph[edge.from - 1][edge.to - 1] = edge.weight;
graph[edge.to - 1][edge.from - 1] = edge.weight;
}
}
int main()
{
unsigned edgesCount = 0;
while (cin >> edgesCount)
{
unordered_set<unsigned> nodes;
vector<Edge> edges;
for (size_t i = 0; i < edgesCount; i++)
{
unsigned from = 0;
unsigned to = 0;
unsigned weight = 0;
cin >> from >> to >> weight;
nodes.insert(from);
nodes.insert(to);
edges.emplace_back(Edge(from, to, weight));
}
BuildGraph(graph, edges, nodes.size());
Reset();
Hamilton(0, 0);
PrintCycle(graph.size());
cout << endl;
}
return 0;
} | [
"19938633+runt1m33rr0r@users.noreply.github.com"
] | 19938633+runt1m33rr0r@users.noreply.github.com |
2333783c189a7b8542c18617c5328fa43ad372b2 | 48298469e7d828ab1aa54a419701c23afeeadce1 | /Server/Item/ItemTable.h | 14916dd6a1b4ca8e345bb5267d4313bb44433386 | [] | no_license | brock7/TianLong | c39fccb3fd2aa0ad42c9c4183d67a843ab2ce9c2 | 8142f9ccb118e76a5cd0a8b168bcf25e58e0be8b | refs/heads/master | 2021-01-10T14:19:19.850859 | 2016-02-20T13:58:55 | 2016-02-20T13:58:55 | 52,155,393 | 5 | 3 | null | null | null | null | GB18030 | C++ | false | false | 7,362 | h | /********************************************************************
创建日期: 2005年11月2日
创建时间: 16:54
文件名称: ItemTable.h
文件路径: d:\Prj\Server\Server\Item\ItemTable.h
文件功能: 物品基础数据表操作
修改纪录:
*********************************************************************/
#ifndef _ITEM_TABLE_H_
#define _ITEM_TABLE_H_
#include "ItemTypes.h"
#include "Type.h"
#include "GameStruct_Item.h"
#include "GameDefine2.h"
#define SELF_CONS(x) x(){memset(this,0,sizeof(x));}
#define DEFAULT_CONS(theClass,parentClass) theClass(){memset(this,0,sizeof(theClass)); parentClass();}
//装备都有的基础属性
struct EQUIP_TB
{
SELF_CONS(EQUIP_TB);
INT m_IndexID;
_ITEM_TYPE m_ItemType;
BYTE m_EquipPoint; //装配点
CHAR m_RulerID; //规则编号
BYTE m_ReqLevel; //需要等级
INT m_MaxDur; //最大耐久
UINT m_BasePrice; //售出价格
INT m_RepaireLevel; //修理价格
INT m_PhysicAttack; //物理攻击
INT m_MagicAttack; //魔法攻击
INT m_PhysicDefense; //物理防御
INT m_MagicDefense; //魔法防御
INT m_AttackSpeed; //攻击速度
INT m_Miss; //闪避
BYTE m_CanRepaireTimes; //可修理次数
BYTE m_MaxGem; //最大镶嵌
INT m_EquipSetNum; //套装编号
INT m_EquipSetMaxNum; //最大套装数目
};
//掉落包结构
struct DROP_BOX_TB {
SELF_CONS(DROP_BOX_TB);
UINT m_DropBoxId; //DropBox的编号表
INT m_DropValue; //DropBox价值,参与掉落计算
_ITEM_TYPE m_DropItem[MAX_DROPBOX_CARRAGE]; //DropBox携带物品表
INT m_Quality[MAX_DROPBOX_CARRAGE]; //物品品质表
};
//物品质量段结构体
struct ITEM_QUALITY_TB {
SELF_CONS(ITEM_QUALITY_TB)
UINT m_ItemLevel;
INT m_Quality[MAX_ITEM_TABLE_QUALITYS];
};
struct MINMAX_VALUE
{
SELF_CONS(MINMAX_VALUE)
INT m_minValue;
INT m_maxValue;
};
enum MINMAX_TYPE
{
VT_MIN,
VT_MAX
};
//物品数值段结构体
struct ITEM_VALUE_TB
{
SELF_CONS(ITEM_VALUE_TB)
UINT m_ValueType;
MINMAX_VALUE m_Values[MAX_ITEM_TABLE_VALUES];
};
//普通装备表
struct COMMON_EQUIP_TB :public EQUIP_TB
{
DEFAULT_CONS(COMMON_EQUIP_TB,EQUIP_TB);
INT m_Job; //职业属性
};
//蓝色装备表
struct BLUE_EQUIP_TB:public EQUIP_TB
{
DEFAULT_CONS(BLUE_EQUIP_TB,EQUIP_TB);
INT m_Job; //职业属性
INT m_AttrRate[IATTRIBUTE_NUMBER]; //属性随机概率
};
//绿色装备表
struct GREEN_EQUIP_TB :public EQUIP_TB
{
DEFAULT_CONS(GREEN_EQUIP_TB,EQUIP_TB);
INT m_Job; //职业属性
_ITEM_ATTR m_Attr[MAX_GREEN_ITEM_EXT_ATTR]; //绿色装备附加属性
};
//怪物掉落包结构体
struct MONSTER_DROPBOX_TB
{
SELF_CONS(MONSTER_DROPBOX_TB);
UINT m_MonsterId;
UINT m_MonsterValue;
UINT m_DropType;
MONSTER_DROPBOXS m_DropBoxs;
};
//宝石表结构体
struct GEMINFO_TB
{
GEMINFO_TB()
{
m_nTableIndex = 0;
m_ResourceID = 0;
m_nRulerID = 0;
m_nPrice = 0;
m_ItemType.CleanUp();
m_GenAttr.CleanUp();
}
UINT m_nTableIndex;;
_ITEM_TYPE m_ItemType;
WORD m_ResourceID;
CHAR m_nRulerID;
UINT m_nPrice;
_ITEM_ATTR m_GenAttr;
};
//普通物品表结构体
struct COMMITEM_INFO_TB
{
COMMITEM_INFO_TB()
{
m_nTableIndex = 0;
m_nLevel = 0;
m_nBasePrice = 0;
m_nLayedNum = 0;
m_nScriptID = 0;
m_nSkillID = 0;
m_nRulerID = 0;
m_bCosSelf = FALSE;
m_nReqSkill = -1;
m_nReqSkillLevel = -1;
m_TargetType = 0;
m_ItemType.CleanUp();
}
INT m_nTableIndex;
_ITEM_TYPE m_ItemType;
INT m_nLevel;
UINT m_nBasePrice;
CHAR m_nRulerID; //规则ID
INT m_nLayedNum; //叠放数量
INT m_nScriptID;
INT m_nSkillID;
BOOL m_bCosSelf;
INT m_nReqSkill;
INT m_nReqSkillLevel;
BYTE m_TargetType;
};
//藏宝图结构体
struct STORE_MAP_INFO_TB
{
STORE_MAP_INFO_TB()
{
m_nTableIndex = 0;
m_ItemType.CleanUp();
m_ResourceID = 0;
m_nRulerID = 0;
m_nLevel = 0;
m_nBasePrice = 0;
m_xPos = -1.0f;
m_zPos = -1.0f;
m_SceneID = -1;
m_GrowPointType = -1;
}
INT m_nTableIndex;;
_ITEM_TYPE m_ItemType;
WORD m_ResourceID;
CHAR m_nRulerID;
INT m_nLevel;
UINT m_nBasePrice;
FLOAT m_xPos;
FLOAT m_zPos;
INT m_SceneID;
INT m_GrowPointType;
INT m_ScriptID;
};
//掉落衰减表结构体
struct DROP_ATT_TB
{
SELF_CONS(DROP_ATT_TB);
INT m_DeltaLevel;
FLOAT m_AttValue;
};
//装备集合结构体
struct EQUIP_SET_TB
{
SELF_CONS(EQUIP_SET_TB);
INT m_nEquipSetSerial;
INT m_nAttrCount;
_ITEM_ATTR m_ItemAttr[MAX_ITEM_SET_ATTR];
};
//物品规则结构体
struct ITEM_RULER_TB :public _ITEM_RULER{
SELF_CONS(ITEM_RULER_TB);
INT m_RulerIndex;
};
/*
*物品相关表资源数据类
*/
class ItemTable
{
public:
ItemTable() ;
~ItemTable() ;
VOID CleanUp( ) ;
BOOL Init();
public:
MONSTER_DROPBOX_TB* GetMonsterDropTB(INT iMonsterType);
DROP_BOX_TB* GetDropBoxTB(INT iDropBox);
GREEN_EQUIP_TB* GetGreenItemTB(UINT itemSerial);
COMMON_EQUIP_TB* GetWhiteItemTB(UINT itemSerial);
BLUE_EQUIP_TB* GetBlueItemTB(UINT itemSerial);
ITEM_QUALITY_TB* GetItemQualityTB(INT ItemLevel);
MINMAX_VALUE GetItemValue(ITEM_ATTRIBUTE iAtt,INT QualityLevel);
DROP_ATT_TB* GetDropAttTB(INT iDeltaLevel);
GEMINFO_TB* GetGemInfoTB(UINT itemSerial);
COMMITEM_INFO_TB* GetCommItemInfoTB(UINT itemSerial);
EQUIP_SET_TB* GetEquipSetTB(INT EquipSetSerial);
ITEM_RULER_TB* GetRuleValueByID(INT& iIndex);
STORE_MAP_INFO_TB* GetStoreMapTB(UINT itemSerial);;
protected:
VOID InitWhiteItemTable();
VOID InitGreenItemTable();
VOID InitBlueItemTable();
VOID InitGoldenItemTable();
VOID InitDropBoxTable();
VOID InitMonsterDropBoxTable();
VOID InitItemLevelTable();
VOID InitItemValueTable();
VOID InitGemInfoTable();
VOID InitCommItemInfoTable();
VOID InitDropAttTable();
VOID InitEquipSetAttrTable();
VOID InitItemRulerTable();
VOID InitStoreMapTable();
private:
UINT m_nCommonItemCount;
COMMON_EQUIP_TB* m_pCommonEquipTableData;
UINT m_nGreenItemCount;
GREEN_EQUIP_TB* m_pGreenEquipTableData;
UINT m_nBlueItemCount;
BLUE_EQUIP_TB* m_pBlueEquipTableData;
UINT m_nGoldenItemCount;
UINT m_nDropBoxCount;
DROP_BOX_TB* m_pDropBoxTableData;
UINT m_nMonsterDropBoxCount;
MONSTER_DROPBOX_TB* m_pMonsterDropTableData;
UINT m_nItemLevelCount;
ITEM_QUALITY_TB* m_pItemQualityData;
UINT m_nValueCount;
ITEM_VALUE_TB* m_pItemValueData;
UINT m_nGemCount;
GEMINFO_TB* m_pGemInfoData;
UINT m_nCommItemCount;
COMMITEM_INFO_TB* m_pCommItemInfoData;
UINT m_nDropAttCount;
DROP_ATT_TB* m_pDropAttData;
UINT m_nEquipSetCount;
EQUIP_SET_TB* m_pEquipSetData;
UINT m_nItemRulerCount;
INT m_nHashOffSet;
ITEM_RULER_TB* m_pItemRulerData;
UINT m_nStoreMapCount;
STORE_MAP_INFO_TB* m_pStoreMapData;
};
BYTE GetItemTileMax(_ITEM_TYPE& it);
extern ItemTable g_ItemTable ;
#endif
| [
"xiaowave@gmail.com"
] | xiaowave@gmail.com |
e19cc89781a12a28fdb5acd1fa654efc91d2dd53 | fbc6fa2ae9e939c800a03d5527f1e28ef13354ca | /types/var_types.cpp | 6f1f9f2e3df28f689f80416bdfc5757539e7874f | [] | no_license | tolber01/Math-interpreter | f05a8e3e7e10ccca59252aa410e3c768771b5aba | 56f3010d483df43f48f6a3569c5a7015c8942928 | refs/heads/master | 2023-02-12T11:10:17.104758 | 2021-01-10T20:28:34 | 2021-01-10T20:28:34 | 328,471,497 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 10,687 | cpp | #include "../execution/context.hpp"
#include "../parsing/parser.hpp"
using namespace std;
// ==== GenericValue implementation ====
GenericValue::GenericValue(ValueType object_type) :
type(object_type)
{}
GenericValue* GenericValue::clone() { return new GenericValue(*this); }
// ==== RationalNumber implementation ====
const string RationalNumber::REG_EXP_STR = R"((?:-?\d+\s*/\s*\d+|-?\d+))";
const regex RationalNumber::REG_EXP = regex(RationalNumber::REG_EXP_STR);
bool RationalNumber::is_correct_str(std::string str_num)
{
str_num = trim(str_num);
smatch number_match;
if (!regex_match(str_num, number_match, REG_EXP))
return false;
string::size_type slash_pos = str_num.find('/');
int numerator, denominator;
if (slash_pos == string::npos)
{
try
{
numerator = stoi(str_num);
}
catch (invalid_argument& e) { return false; }
return true;
}
else
{
try
{
numerator = stoi(str_num.substr(0, slash_pos));
denominator = stoi(str_num.substr(slash_pos + 1));
if (denominator == 0)
throw invalid_argument("Zero division error");
}
catch (invalid_argument& e) { return false; }
return true;
}
}
void RationalNumber::simplify()
{
for (int d = 2; d <= denominator; d++)
while (numerator % d == 0 && denominator % d == 0)
{
numerator /= d;
denominator /= d;
}
}
RationalNumber::RationalNumber(string str_num) :
GenericValue(RATIONAL_NUMBER)
{
str_num = trim(str_num);
string::size_type slash_pos = str_num.find('/');
if (slash_pos != string::npos)
{
numerator = stoi(str_num.substr(0, slash_pos));
denominator = stoi(str_num.substr(slash_pos + 1));
}
else
{
numerator = stoi(str_num);
denominator = 1;
}
simplify();
}
RationalNumber::RationalNumber() :
GenericValue(RATIONAL_NUMBER), numerator(0), denominator(1)
{}
RationalNumber::RationalNumber(int num, int den) :
GenericValue(RATIONAL_NUMBER), numerator(num), denominator(den)
{
simplify();
}
RationalNumber::RationalNumber(const RationalNumber& other) :
GenericValue(RATIONAL_NUMBER), numerator(other.numerator), denominator(other.denominator)
{}
GenericValue* RationalNumber::clone() { return new RationalNumber(*this); }
RationalNumber& RationalNumber::operator=(const RationalNumber& other)
{
numerator = other.numerator;
denominator = other.denominator;
return *this;
}
string RationalNumber::to_string() const
{
if (denominator == 1)
return std::to_string(numerator);
else
return std::to_string(numerator) + "/" + std::to_string(denominator);
}
RationalNumber RationalNumber::operator+(const RationalNumber& other) const
{
return RationalNumber(
numerator*other.denominator + denominator*other.numerator,
denominator*other.denominator);
}
RationalNumber RationalNumber::operator-() const
{
return RationalNumber(-numerator, denominator);
}
RationalNumber RationalNumber::operator-(const RationalNumber& other) const
{
return *this + (-other);
}
RationalNumber RationalNumber::operator*(const RationalNumber& other) const
{
return RationalNumber(numerator*other.numerator, denominator*other.denominator);
}
RationalNumber RationalNumber::operator/(const RationalNumber& other) const
{
return RationalNumber(numerator*other.denominator, denominator*other.numerator);
}
// ==== Matrix implementation ====
const regex Matrix::ROW_REG_EXP = regex(
"(?:" + RationalNumber::REG_EXP_STR + "\\s*)+"
);
const regex Matrix::REG_EXP = regex(
"\\[\\s*(?:(?:" + RationalNumber::REG_EXP_STR + "\\s+)*" + RationalNumber::REG_EXP_STR + "\\s*;\\s*)*(?:"
+ RationalNumber::REG_EXP_STR + "\\s+)*" + RationalNumber::REG_EXP_STR + "\\s*\\]"
);
bool Matrix::is_correct_str(string str_matrix)
{
str_matrix = trim(str_matrix);
cmatch matrix_match_result;
if (!regex_match(str_matrix.c_str(), matrix_match_result, Matrix::REG_EXP))
return false;
else
{
smatch rows_match, columns_match, elements_match;
if (!regex_search(str_matrix, rows_match, Matrix::ROW_REG_EXP))
return false;
string row = rows_match[0];
int columns_number = 0, c;
while (regex_search(row, columns_match, RationalNumber::REG_EXP))
{
if (!RationalNumber::is_correct_str(columns_match[0]))
return false;
columns_number++;
row = columns_match.suffix().str();
}
str_matrix = rows_match.suffix().str();
while (regex_search(str_matrix, rows_match, Matrix::ROW_REG_EXP))
{
row = rows_match[0];
c = 0;
while (regex_search(row, columns_match, RationalNumber::REG_EXP))
{
if (!RationalNumber::is_correct_str(columns_match[0]))
return false;
c++;
row = columns_match.suffix().str();
}
if (c != columns_number)
return false;
str_matrix = rows_match.suffix().str();
}
return true;
}
}
Matrix::Matrix(string str_matrix) :
GenericValue(MATRIX)
{
string str_copy = str_matrix, row;
str_matrix = trim(str_matrix);
smatch elements_match, columns_match, rows_match;
regex_search(str_copy, rows_match, Matrix::ROW_REG_EXP);
row = rows_match[0];
cols_ = 0, rows_ = 1;
while (regex_search(row, columns_match, RationalNumber::REG_EXP))
{
cols_++;
row = columns_match.suffix().str();
}
str_copy = rows_match.suffix().str();
while (regex_search(str_copy, rows_match, Matrix::ROW_REG_EXP))
{
rows_++;
str_copy = rows_match.suffix().str();
}
contents = new RationalNumber*[rows_];
contents[0] = new RationalNumber[rows_ * cols_];
for (int i = 1; i != rows_; i++)
contents[i] = contents[i - 1] + cols_;
int k = 0;
while (regex_search(str_matrix, elements_match, RationalNumber::REG_EXP))
{
contents[k / cols_][k % cols_] = RationalNumber(elements_match[0].str());
str_matrix = elements_match.suffix().str();
k++;
}
}
Matrix::Matrix(int rows, int cols) :
GenericValue(MATRIX), contents(nullptr), rows_(rows), cols_(cols)
{
contents = new RationalNumber*[rows_];
contents[0] = new RationalNumber[rows_ * cols_];
for (int i = 1; i != rows_; i++)
contents[i] = contents[i - 1] + cols_;
}
Matrix::Matrix() :
GenericValue(MATRIX), contents(nullptr), rows_(0), cols_(0)
{}
Matrix::Matrix(const Matrix& other) :
GenericValue(MATRIX)
{
rows_ = other.rows_;
cols_ = other.cols_;
contents = new RationalNumber*[rows_];
contents[0] = new RationalNumber[rows_ * cols_];
for (int i = 1; i != rows_; i++)
contents[i] = contents[i - 1] + cols_;
for (int i = 0; i != rows_; i++)
for (int j = 0; j != cols_; j++)
contents[i][j] = other.contents[i][j];
}
void Matrix::clear()
{
if (contents != nullptr) { delete [] contents[0]; delete [] contents; }
contents = nullptr;
rows_ = 0;
cols_ = 0;
}
Matrix::~Matrix()
{
clear();
}
GenericValue* Matrix::clone() { return new Matrix(*this); }
Matrix& Matrix::operator=(const Matrix& other)
{
if (this != &other)
{
clear();
rows_ = other.rows_;
cols_ = other.rows_;
contents = new RationalNumber*[rows_];
contents[0] = new RationalNumber[rows_ * cols_];
for (int i = 1; i != rows_; i++)
contents[i] = contents[i - 1] + cols_;
for (int i = 0; i != rows_; i++)
for (int j = 0; j != cols_; j++)
contents[i][j] = other.contents[i][j];
}
return *this;
}
void Matrix::transpose()
{
int new_rows = cols_, new_cols = rows_;
auto new_contents = new RationalNumber*[new_rows];
new_contents[0] = new RationalNumber[new_rows * new_cols];
for (int i = 1; i != new_rows; i++)
new_contents[i] = new_contents[i - 1] + new_cols;
for (int i = 0; i != new_rows; i++)
for (int j = 0; j != new_cols; j++)
new_contents[i][j] = contents[j][i];
clear();
contents = new_contents;
rows_ = new_rows;
cols_ = new_cols;
}
Matrix Matrix::operator+(const Matrix& other) const
{
Matrix result(rows_, cols_);
for (int i = 0; i != rows_; i++)
for (int j = 0; j != cols_; j++)
result.contents[i][j] = contents[i][j] + other.contents[i][j];
return result;
}
Matrix Matrix::operator-() const
{
Matrix result(rows_, cols_);
for (int i = 0; i != rows_; i++)
for (int j = 0; j != cols_; j++)
result.contents[i][j] = -contents[i][j];
return result;
}
Matrix Matrix::operator-(const Matrix& other) const
{
Matrix result(rows_, cols_);
for (int i = 0; i != rows_; i++)
for (int j = 0; j != cols_; j++)
result.contents[i][j] = contents[i][j] - other.contents[i][j];
return result;
}
Matrix Matrix::operator*(const Matrix& other) const
{
Matrix result(rows_, other.cols_);
for (int i = 0; i != rows_; i++)
for (int j = 0; j != other.cols_; j++)
{
RationalNumber element(0, 1);
for (int k = 0; k != cols_; k++)
element = element + contents[i][k] * other.contents[k][j];
result.contents[i][j] = element;
}
return result;
}
Matrix Matrix::operator*(const RationalNumber& multiplier) const
{
Matrix result(rows_, cols_);
for (int i = 0; i != result.rows_; i++)
for (int j = 0; j != result.cols_; j++)
result.contents[i][j] = multiplier * contents[i][j];
return result;
}
Matrix operator*(const RationalNumber& multiplier, const Matrix& m)
{
Matrix result(m.rows_, m.cols_);
for (int i = 0; i != result.rows_; i++)
for (int j = 0; j != result.cols_; j++)
result.contents[i][j] = multiplier * m.contents[i][j];
return result;
}
std::string Matrix::to_string() const
{
if (contents == nullptr || rows_ == 0 || cols_ == 0)
return "( Empty matrix )";
else
{
string result = "(\n";
for (int i = 0; i != rows_; i++)
{
result += "\t";
for (int j = 0; j < cols_; j++)
result += contents[i][j].to_string() + " ";
result += "\n";
}
result += ")";
return result;
}
}
| [
"ov4.t@yandex.ru"
] | ov4.t@yandex.ru |
f65d6ff2b7a2b3e56230d821bc5c4126ef04d613 | 794539b862b4a2ca802bd60073ac75d1e64978f8 | /Litvinov group/semester 1/06.HW/6.4/main.cpp | 6d84ce57ecdd96e6180c5480e7393a92dbc9eb61 | [] | no_license | katerina-kamkova/SPbU-homework | 30d4470da75c4c3f9898b6ab54f0e6909c9b888b | 5abcc1a1d16f3d9f71e6a007cb5d7fd52fcc77d6 | refs/heads/master | 2022-10-11T05:44:13.241813 | 2020-06-07T22:34:56 | 2020-06-07T22:34:56 | 207,313,661 | 1 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 242 | cpp | #include "6.4.h"
#include <iostream>
using namespace std;
int main()
{
Notebook *notebook = createNotebook();
input(notebook);
mergeSort(notebook, menu());
print(notebook);
deleteNotebook(notebook);
return 0;
}
| [
"katerina.kamkova@mail.ru"
] | katerina.kamkova@mail.ru |
fa039dac33aad182abb3a7aeaa7ea8686ad3d7a6 | a50b999e867ba4128e2d496896e41a7827398281 | /06/format.hpp | f21b602cd6a2b62fcdc4df69e19525faf3458ae6 | [] | no_license | apetrov1232/msu_cpp_autumn_2020 | e865b79d86e83c626cacc9904ec815dd0d442b07 | df140aca3bcf7967d33bd67d1d431dca8d75f36a | refs/heads/main | 2023-01-20T20:22:33.430470 | 2020-12-02T09:30:11 | 2020-12-02T09:30:11 | 303,362,911 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 910 | hpp | #pragma once
#include <iostream>
#include <sstream>
class ErrorFormat: public std::exception
{
public:
virtual const char* what() const noexcept{
return "Error with function Format";
}
};
class IncorrectUsingBrackets: public ErrorFormat
{
public:
virtual const char* what() const noexcept override{
return "{} is used incorrect";
}
};
class WrongValueInBrackets: public ErrorFormat
{
public:
virtual const char* what() const noexcept override{
return "Value don't fit to {}";
}
};
template <typename T>
std::string process(const std::string& s, const int i, const T& t);
template <typename T, typename... ArgsT>
std::string process(const std::string& s, const int i, const T& t, const ArgsT&... args);
template <typename... ArgsT>
std::string format(const std::string& s, const ArgsT&... args);
#include "format.tpp"
| [
"noreply@github.com"
] | apetrov1232.noreply@github.com |
12ea3ba74dc1963c42081578dee4e722f7039f74 | 900cd0ef9e6b6f3739f7dcf4098feda1845f9a44 | /PEA_ETAP1/ResultCostMatrix.h | fafd43de1de455052b5ea06e4caa270d7593d50d | [] | no_license | Marta-mART/PEA_1 | c774da75f0433a53069aefeb1a2fe95b5c77de10 | af83a527f0c5c8f4142183775ffc12f496556361 | refs/heads/master | 2020-05-01T02:13:58.068045 | 2019-03-22T21:59:33 | 2019-03-22T21:59:33 | 177,214,170 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 576 | h | //
// Created by sergio on 18.10.18.
//
#ifndef PEA_ETAP1_RESULTINGCOSTMATRIX_H
#define PEA_ETAP1_RESULTINGCOSTMATRIX_H
#include "Graph.h"
class ResultCostMatrix {
private:
int vertices_amount;
int **memory;
public:
ResultCostMatrix();
ResultCostMatrix(Graph& graph);
ResultCostMatrix(const ResultCostMatrix & rcm);
~ResultCostMatrix();
ResultCostMatrix & operator=(const ResultCostMatrix& rs);
int reduceMatrix();
void removeVertix(int from, int to);
int getCost(int from, int to);
};
#endif //PEA_ETAP1_RESULTINGCOSTMATRIX_H
| [
"noreply@github.com"
] | Marta-mART.noreply@github.com |
0408d2159b0ea76899e37de7a795457631fc5f92 | e870e51caf43430c2bf7369a46deef02a61b36ad | /CppBehaviourTree/src/Attack.cpp | 41e5af3529c68ed2b325bafcb3192d990b7b7c59 | [] | no_license | maxi-jp/CppBehaviourTree | 14367ed6b494e4df12a22ed24d83abedc7a5de63 | 52d4d772839479107e18616345b3bbb16db4c4ea | refs/heads/master | 2021-06-26T02:17:17.698319 | 2020-10-12T21:50:46 | 2020-10-12T21:50:46 | 158,011,095 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 444 | cpp | #include "Attack.h"
#include "Bot.h"
#include "World.h"
Attack::Attack() : Task()
{
}
Attack::~Attack()
{
}
void Attack::Reset()
{
}
void Attack::Tick(Bot* bot, World* world)
{
if (bot->GetCurrentEnemy() != 0)
{
if (bot->GetCurrentEnemy()->IsAlive())
{
// there is an enemy bot and it is alive
// make the damage!
bot->GetCurrentEnemy()->Damage(bot->GetDamage());
Succeed();
}
else
Fail();
}
else
Fail();
}
| [
"juventudperdia@gmail.com"
] | juventudperdia@gmail.com |
92ff9ad1d9f001b9396b5c14e7de8b39f6c66b1a | 0eff74b05b60098333ad66cf801bdd93becc9ea4 | /second/download/collectd/gumtree/collectd_old_hunk_643.cpp | 57c20dbec889fefa62a73164d0fe3cbe4c57409f | [] | no_license | niuxu18/logTracker-old | 97543445ea7e414ed40bdc681239365d33418975 | f2b060f13a0295387fe02187543db124916eb446 | refs/heads/master | 2021-09-13T21:39:37.686481 | 2017-12-11T03:36:34 | 2017-12-11T03:36:34 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,462 | cpp |
#include "collectd.h"
#include "common.h"
#include "plugin.h"
#include "utils_parse_option.h"
#include "utils_cmd_putnotif.h"
#define print_to_socket(fh, ...) \
do { \
if (fprintf (fh, __VA_ARGS__) < 0) { \
char errbuf[1024]; \
WARNING ("handle_putnotif: failed to write to socket #%i: %s", \
fileno (fh), sstrerror (errno, errbuf, sizeof (errbuf))); \
return -1; \
} \
fflush(fh); \
} while (0)
static int set_option_severity (notification_t *n, const char *value)
{
if (strcasecmp (value, "Failure") == 0)
n->severity = NOTIF_FAILURE;
else if (strcasecmp (value, "Warning") == 0)
n->severity = NOTIF_WARNING;
else if (strcasecmp (value, "Okay") == 0)
n->severity = NOTIF_OKAY;
else
return (-1);
return (0);
} /* int set_option_severity */
static int set_option_time (notification_t *n, const char *value)
{
char *endptr = NULL;
double tmp;
errno = 0;
tmp = strtod (value, &endptr);
if ((errno != 0) /* Overflow */
|| (endptr == value) /* Invalid string */
|| (endptr == NULL) /* This should not happen */
|| (*endptr != 0)) /* Trailing chars */
return (-1);
n->time = DOUBLE_TO_CDTIME_T (tmp);
return (0);
} /* int set_option_time */
static int set_option (notification_t *n, const char *option, const char *value)
{
if ((n == NULL) || (option == NULL) || (value == NULL))
return (-1);
DEBUG ("utils_cmd_putnotif: set_option (option = %s, value = %s);",
option, value);
/* Add a meta option in the form: <type>:<key> */
if (option[0] != '\0' && option[1] == ':') {
/* Refuse empty key */
if (option[2] == '\0')
return (1);
if (option[0] == 's')
return plugin_notification_meta_add_string (n, option + 2, value);
else
return (1);
}
if (strcasecmp ("severity", option) == 0)
return (set_option_severity (n, value));
else if (strcasecmp ("time", option) == 0)
return (set_option_time (n, value));
else if (strcasecmp ("message", option) == 0)
sstrncpy (n->message, value, sizeof (n->message));
else if (strcasecmp ("host", option) == 0)
sstrncpy (n->host, value, sizeof (n->host));
else if (strcasecmp ("plugin", option) == 0)
sstrncpy (n->plugin, value, sizeof (n->plugin));
else if (strcasecmp ("plugin_instance", option) == 0)
sstrncpy (n->plugin_instance, value, sizeof (n->plugin_instance));
else if (strcasecmp ("type", option) == 0)
sstrncpy (n->type, value, sizeof (n->type));
else if (strcasecmp ("type_instance", option) == 0)
sstrncpy (n->type_instance, value, sizeof (n->type_instance));
else
return (1);
return (0);
} /* int set_option */
int handle_putnotif (FILE *fh, char *buffer)
{
char *command;
notification_t n = { 0 };
int status;
if ((fh == NULL) || (buffer == NULL))
return (-1);
DEBUG ("utils_cmd_putnotif: handle_putnotif (fh = %p, buffer = %s);",
(void *) fh, buffer);
command = NULL;
status = parse_string (&buffer, &command);
if (status != 0)
{
print_to_socket (fh, "-1 Cannot parse command.\n");
return (-1);
}
assert (command != NULL);
if (strcasecmp ("PUTNOTIF", command) != 0)
{
print_to_socket (fh, "-1 Unexpected command: `%s'.\n", command);
return (-1);
}
status = 0;
while (*buffer != 0)
{
char *key;
char *value;
status = parse_option (&buffer, &key, &value);
if (status != 0)
{
print_to_socket (fh, "-1 Malformed option.\n");
break;
}
status = set_option (&n, key, value);
if (status != 0)
{
print_to_socket (fh, "-1 Error parsing option `%s'\n", key);
break;
}
} /* for (i) */
/* Check for required fields and complain if anything is missing. */
if ((status == 0) && (n.severity == 0))
{
print_to_socket (fh, "-1 Option `severity' missing.\n");
status = -1;
}
if ((status == 0) && (n.time == 0))
{
print_to_socket (fh, "-1 Option `time' missing.\n");
status = -1;
}
if ((status == 0) && (strlen (n.message) == 0))
{
print_to_socket (fh, "-1 No message or message of length 0 given.\n");
status = -1;
}
/* If status is still zero the notification is fine and we can finally
* dispatch it. */
if (status == 0)
{
plugin_dispatch_notification (&n);
print_to_socket (fh, "0 Success\n");
}
return (0);
} /* int handle_putnotif */
/* vim: set shiftwidth=2 softtabstop=2 tabstop=8 : */
| [
"993273596@qq.com"
] | 993273596@qq.com |
10c234dde6d090fbdee2c119808725f0e5464e64 | 9bf03a25cc3c1e439ad8f8a1e829f336b8cb9e17 | /URI/c++/BEE - 2697.cpp | 9dcc8378c488c1630ae24211218b9080fcca0aae | [] | no_license | leonardorodriguesds/codes | 793b9a5c6a426b78959f4fc3b48246df4ca1bc4a | 4fdd17ff932d4a44fbb52c6b150f07f74d68d3ac | refs/heads/master | 2023-09-04T13:06:54.742366 | 2023-08-19T23:39:50 | 2023-08-19T23:39:50 | 143,721,913 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,349 | cpp | #include <bits/stdc++.h>
using namespace std;
#define ALFA 256
#define MOD 1000000007
#define INF 0x3f3f3f3f
#define INFLL 0x3f3f3f3f3f3f3f3f
#define EPS (1e-9)
#define PI 3.141592653589793238462643383279502884
#define all(a) a.begin(), a.end()
#define fill(t,v) memset(t, v, sizeof(t))
#define sz(a) ((int)(a.size()))
#define LOG2(X) ((unsigned) (8*sizeof(unsigned long long) - __builtin_clzll((X)) - 1))
#define ispow2(v) ((int(v) & (int(v) - 1)) == 0)
#define scanf2(a, b) (scanf("%d %d", &a, &b))
#define scanf3(a, b, c) (scanf("%d %d %d", &a, &b, &c))
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ii> vii;
typedef vector<pair<int, ii>> vpii;
typedef vector<string> vs;
typedef priority_queue<int, vector<int>, greater<int>> pqi;
typedef vector<pqi> vpqi;
void segmentTree(int node, int b, int e, vi& notas, vi& sumSegmentTree, vi& maxSegmentTree, vi& minSegmentTree) {
if (b == e) {
sumSegmentTree[node] = maxSegmentTree[node] = minSegmentTree[node] = notas[b];
} else {
int mid = (b + e) >> 1, l = node << 1, r = node << 1 | 1;
segmentTree(l, b, mid, notas, sumSegmentTree, maxSegmentTree, minSegmentTree);
segmentTree(r, mid + 1, e, notas, sumSegmentTree, maxSegmentTree, minSegmentTree);
int min_value = min(minSegmentTree[l], minSegmentTree[r]), max_value = max(maxSegmentTree[l], maxSegmentTree[r]);
minSegmentTree[node] = min_value, maxSegmentTree[node] = max_value, sumSegmentTree[node] = (sumSegmentTree[l] + sumSegmentTree[r]);
}
}
array<int, 3> queryUtils(int node, int b, int e, int L, int R, vi& sumSegmentTree, vi& maxSegmentTree, vi& minSegmentTree) {
if (b >= L && e <= R) {
return {sumSegmentTree[node], maxSegmentTree[node], minSegmentTree[node]};
}
if (b > R || e < L) {
return {0, -INF, INF};
}
int mid = (b + e) >> 1, l = node << 1, r = node << 1 | 1;
array<int, 3> left = queryUtils(l, b, mid, L, R, sumSegmentTree, maxSegmentTree, minSegmentTree);
array<int, 3> right = queryUtils(r, mid + 1, e, L, R, sumSegmentTree, maxSegmentTree, minSegmentTree);
return {(left[0] + right[0]), max(left[1], right[1]), min(left[2], right[2])};
}
int query(int n, int i, int j, vi& sumSegmentTree, vi& maxSegmentTree, vi& minSegmentTree) {
array<int, 3> ans = queryUtils(1, 0, n - 1, min(i, j), max(i, j), sumSegmentTree, maxSegmentTree, minSegmentTree);
return ans[0] - ans[1] - ans[2];
}
void init_problem(int n, int b) {
vi notas(n, 0);
for(int i = 0; i < n; i++) {
int x;
cin >> x;
notas[i] = x;
}
int x = (int)(ceil(log2(n)));
int max_size = 2*(int)pow(2, x) - 1;
vi sumSegmentTree(max_size, 0);
vi maxSegmentTree(max_size, -INF);
vi minSegmentTree(max_size, INF);
segmentTree(1, 0, n - 1, notas, sumSegmentTree, maxSegmentTree, minSegmentTree);
ll res = 0;
for(int i = 0; i <= n - b; i++) {
res += query(n, i, i + b - 1, sumSegmentTree, maxSegmentTree, minSegmentTree);
}
cout << res << endl;
}
int main() {
ios_base::sync_with_stdio(false);
int n, b;
while(cin >> n >> b) {
init_problem(n, b);
}
return 0;
} | [
"leoonardodf@gmail.com"
] | leoonardodf@gmail.com |
43b70d6b685a7432ee2979ed82bc2a33418c3847 | 00332281a2e92b01327e437ffe20370ec8e13ea4 | /dev/floyd_speak/parts/immer-master/test/map/generic.ipp | 033e10cb67a9a433e7b6de5986ef5299086700e0 | [
"MIT",
"LGPL-3.0-only",
"LGPL-2.1-or-later",
"LGPL-3.0-or-later"
] | permissive | PavelVozenilek/floyd | 78dd79b0376f6c819a0d9cf4ba47ffa79ade47c9 | debc34005bb85000f78d08aa979bcf6a2dad4fb0 | refs/heads/master | 2020-06-13T17:20:14.470042 | 2019-06-19T11:33:48 | 2019-06-19T11:33:48 | 194,729,571 | 0 | 0 | MIT | 2019-07-01T19:10:33 | 2019-07-01T19:10:33 | null | UTF-8 | C++ | false | false | 7,556 | ipp | //
// immer - immutable data structures for C++
// Copyright (C) 2016, 2017 Juan Pedro Bolivar Puente
//
// This file is part of immer.
//
// immer 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.
//
// immer 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 immer. If not, see <http://www.gnu.org/licenses/>.
//
#ifndef MAP_T
#error "define the map template to use in MAP_T"
#include <immer/map.hpp>
#define MAP_T ::immer::map
#endif
#include <immer/algorithm.hpp>
#include "test/util.hpp"
#include "test/dada.hpp"
#include <catch.hpp>
#include <unordered_set>
#include <random>
template <typename T=unsigned>
auto make_generator()
{
auto engine = std::default_random_engine{42};
auto dist = std::uniform_int_distribution<T>{};
return std::bind(dist, engine);
}
struct conflictor
{
unsigned v1;
unsigned v2;
bool operator== (const conflictor& x) const
{ return v1 == x.v1 && v2 == x.v2; }
};
struct hash_conflictor
{
std::size_t operator() (const conflictor& x) const
{ return x.v1; }
};
auto make_values_with_collisions(unsigned n)
{
auto gen = make_generator();
auto vals = std::vector<std::pair<conflictor, unsigned>>{};
auto vals_ = std::unordered_set<conflictor, hash_conflictor>{};
auto i = 0u;
generate_n(back_inserter(vals), n, [&] {
auto newv = conflictor{};
do {
newv = { unsigned(gen() % (n / 2)), gen() };
} while (!vals_.insert(newv).second);
return std::pair<conflictor, unsigned>{newv, i++};
});
return vals;
}
auto make_test_map(unsigned n)
{
auto s = MAP_T<unsigned, unsigned>{};
for (auto i = 0u; i < n; ++i)
s = s.insert({i, i});
return s;
}
auto make_test_map(const std::vector<std::pair<conflictor, unsigned>>& vals)
{
auto s = MAP_T<conflictor, unsigned, hash_conflictor>{};
for (auto&& v : vals)
s = s.insert(v);
return s;
}
TEST_CASE("instantiation")
{
SECTION("default")
{
auto v = MAP_T<int, int>{};
CHECK(v.size() == 0u);
}
}
TEST_CASE("basic insertion")
{
auto v1 = MAP_T<int, int>{};
CHECK(v1.count(42) == 0);
auto v2 = v1.insert({42, {}});
CHECK(v1.count(42) == 0);
CHECK(v2.count(42) == 1);
auto v3 = v2.insert({42, {}});
CHECK(v1.count(42) == 0);
CHECK(v2.count(42) == 1);
CHECK(v3.count(42) == 1);
}
TEST_CASE("accessor")
{
const auto n = 666u;
auto v = make_test_map(n);
CHECK(v[0] == 0);
CHECK(v[42] == 42);
CHECK(v[665] == 665);
CHECK(v[666] == 0);
CHECK(v[1234] == 0);
}
TEST_CASE("at")
{
const auto n = 666u;
auto v = make_test_map(n);
CHECK(v.at(0) == 0);
CHECK(v.at(42) == 42);
CHECK(v.at(665) == 665);
CHECK_THROWS_AS(v.at(666), std::out_of_range);
CHECK_THROWS_AS(v.at(1234), std::out_of_range);
}
TEST_CASE("find")
{
const auto n = 666u;
auto v = make_test_map(n);
CHECK(*v.find(0) == 0);
CHECK(*v.find(42) == 42);
CHECK(*v.find(665) == 665);
CHECK(v.find(666) == nullptr);
CHECK(v.find(1234) == nullptr);
}
TEST_CASE("equals and setting")
{
const auto n = 666u;
auto v = make_test_map(n);
CHECK(v == v);
CHECK(v != v.insert({1234, 42}));
CHECK(v != v.erase(32));
CHECK(v == v.insert({1234, 42}).erase(1234));
CHECK(v == v.erase(32).insert({32, 32}));
CHECK(v.set(1234, 42) == v.insert({1234, 42}));
CHECK(v.update(1234, [] (auto&& x) { return x + 1; }) ==
v.set(1234, 1));
CHECK(v.update(42, [] (auto&& x) { return x + 1; }) ==
v.set(42, 43));
}
TEST_CASE("iterator")
{
const auto N = 666u;
auto v = make_test_map(N);
SECTION("empty set")
{
auto s = MAP_T<unsigned, unsigned>{};
CHECK(s.begin() == s.end());
}
SECTION("works with range loop")
{
auto seen = std::unordered_set<unsigned>{};
for (const auto& x : v)
CHECK(seen.insert(x.first).second);
CHECK(seen.size() == v.size());
}
SECTION("iterator and collisions")
{
auto vals = make_values_with_collisions(N);
auto s = make_test_map(vals);
auto seen = std::unordered_set<conflictor, hash_conflictor>{};
for (const auto& x : s)
CHECK(seen.insert(x.first).second);
CHECK(seen.size() == s.size());
}
}
TEST_CASE("accumulate")
{
const auto n = 666u;
auto v = make_test_map(n);
auto expected_n =
[] (auto n) {
return n * (n - 1) / 2;
};
SECTION("sum collection")
{
auto acc = [] (unsigned acc, const std::pair<unsigned, unsigned>& x) {
return acc + x.first + x.second;
};
auto sum = immer::accumulate(v, 0u, acc);
CHECK(sum == 2 * expected_n(v.size()));
}
SECTION("sum collisions") {
auto vals = make_values_with_collisions(n);
auto s = make_test_map(vals);
auto acc = [] (unsigned r, std::pair<conflictor, unsigned> x) {
return r + x.first.v1 + x.first.v2 + x.second;
};
auto sum1 = std::accumulate(vals.begin(), vals.end(), 0u, acc);
auto sum2 = immer::accumulate(s, 0u, acc);
CHECK(sum1 == sum2);
}
}
TEST_CASE("update a lot")
{
auto v = make_test_map(666u);
for (decltype(v.size()) i = 0; i < v.size(); ++i) {
v = v.update(i, [] (auto&& x) { return x + 1; });
CHECK(v[i] == i+1);
}
}
TEST_CASE("exception safety")
{
constexpr auto n = 2666u;
using dadaist_map_t = typename dadaist_wrapper<MAP_T<unsigned, unsigned>>::type;
using dadaist_conflictor_map_t = typename dadaist_wrapper<MAP_T<conflictor, unsigned, hash_conflictor>>::type;
SECTION("update collisions")
{
auto v = dadaist_map_t{};
auto d = dadaism{};
for (auto i = 0u; i < n; ++i)
v = v.set(i, i);
for (auto i = 0u; i < v.size();) {
try {
auto s = d.next();
v = v.update(i, [] (auto x) { return x + 1; });
++i;
} catch (dada_error) {}
for (auto i : test_irange(0u, i))
CHECK(v.at(i) == i + 1);
for (auto i : test_irange(i, n))
CHECK(v.at(i) == i);
}
CHECK(d.happenings > 0);
IMMER_TRACE_E(d.happenings);
}
SECTION("update collisisions")
{
auto vals = make_values_with_collisions(n);
auto v = dadaist_conflictor_map_t{};
auto d = dadaism{};
for (auto i = 0u; i < n; ++i)
v = v.insert(vals[i]);
for (auto i = 0u; i < v.size();) {
try {
auto s = d.next();
v = v.update(vals[i].first, [] (auto x) { return x + 1; });
++i;
} catch (dada_error) {}
for (auto i : test_irange(0u, i))
CHECK(v.at(vals[i].first) == vals[i].second + 1);
for (auto i : test_irange(i, n))
CHECK(v.at(vals[i].first) == vals[i].second);
}
CHECK(d.happenings > 0);
IMMER_TRACE_E(d.happenings);
}
}
| [
"marcus.zetterquist@gmail.com"
] | marcus.zetterquist@gmail.com |
4c0a5503e0314df40b562a9423773143a6fef763 | 879fc5574b6dd2c683b4c12e39ba51e44e6dc942 | /src/lib/math/discretegaussiangenerator.cpp | e86e2fdec706cf31d06c8e34cc4f0ca0fa615a91 | [
"MIT"
] | permissive | carlzhangweiwen/gazelle_mpc | a48072cf296dd106ee0dd8d010e728d579f2f522 | 45818ccf6375100a8fe2680f44f37d713380aa5c | refs/heads/master | 2020-09-24T13:38:33.186719 | 2019-12-06T02:15:48 | 2019-12-06T02:15:48 | 225,770,500 | 0 | 0 | MIT | 2019-12-04T03:25:50 | 2019-12-04T03:25:49 | null | UTF-8 | C++ | false | false | 4,402 | cpp | /*
* @file discretegaussiangenerator.cpp This code provides generation of gaussian distibutions of discrete values.
* Discrete uniform generator relies on the built-in C++ generator for 32-bit unsigned integers defined in <random>.
* @author TPOC: palisade@njit.edu
*
* @copyright Copyright (c) 2017, New Jersey Institute of Technology (NJIT)
* 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.
* 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 <utils/backend.h>
#include "discretegaussiangenerator.h"
// #include <iostream>
namespace lbcrypto {
DiscreteGaussianGenerator::DiscreteGaussianGenerator(double std) : DistributionGenerator() {
m_std = std;
m_vals.clear();
//weightDiscreteGaussian
double acc = 1e-15;
double variance = m_std * m_std;
int fin = (int)ceil(m_std * sqrt(-2 * log(acc)));
//this value of fin (M) corresponds to the limit for double precision
// usually the bound of m_std * M is used, where M = 20 .. 40 - see DG14 for details
// M = 20 corresponds to 1e-87
//double mr = 20; // see DG14 for details
//int fin = (int)ceil(m_std * mr);
double cusum = 1.0;
for (si32 x = 1; x <= fin; x++) {
cusum = cusum + 2 * exp(-x * x / (variance * 2));
}
m_a = 1 / cusum;
//fin = (int)ceil(sqrt(-2 * variance * log(acc))); //not needed - same as above
double temp;
for (si32 i = 1; i <= fin; i++) {
temp = m_a * exp(-((double)(i * i) / (2 * variance)));
m_vals.push_back(temp);
}
// take cumulative summation
for (ui32 i = 1; i < m_vals.size(); i++) {
m_vals[i] += m_vals[i - 1];
}
// for (ui32 i = 0; i<m_vals.size(); i++) {
// std::cout << m_vals[i] << std::endl;
// }
//std::cout<<m_a<<std::endl;
}
ui32 DiscreteGaussianGenerator::FindInVector(const std::vector<double> &S, double search) const {
//STL binary search implementation
auto lower = std::lower_bound(S.begin(), S.end(), search);
if (lower != S.end())
return lower - S.begin();
else
throw std::runtime_error("DGG Inversion Sampling. FindInVector value not found: " + std::to_string(search));
}
uv64 DiscreteGaussianGenerator::GenerateVector(const ui32 size, const ui64 &modulus) const {
//we need to use the binary uniform generator rathen than regular continuous distribution; see DG14 for details
std::uniform_real_distribution<double> distribution(0.0, 1.0);
uv64 ans(size);
auto& prng = get_prng();
for (ui32 i = 0; i < size; i++) {
double seed = distribution(prng) - 0.5;
if (std::abs(seed) <= m_a / 2) {
ans[i] = ui64(0);
} else{
ui32 val = FindInVector(m_vals, (std::abs(seed) - m_a / 2));
if (seed > 0) {
ans[i] = ui64(val+1);
} else {
ans[i] = ui64(modulus-val-1);
}
}
}
return ans;
}
} // namespace lbcrypto
| [
"chiraag@mit.edu"
] | chiraag@mit.edu |
0ba83e4cc88b2dfe9fe9e1873ed01c76b97f3eab | 1fc7a6ff8d4f93c9716a2074c71911f192745d95 | /imagelib/cos/COSTimer.cpp | f0ce447eadd45dfd04a3b848d2896a0e0309ebcc | [] | no_license | playbar/gllearn | 14dc6e671f5161cac768884771e2a6401a5ed5b7 | 19e20ffd681eadff2559f13a42af12763b00b03e | refs/heads/master | 2021-12-06T05:15:10.299208 | 2021-11-09T11:00:46 | 2021-11-09T11:00:46 | 180,532,777 | 0 | 2 | null | 2020-10-13T12:55:49 | 2019-04-10T08:04:15 | C++ | UTF-8 | C++ | false | false | 1,435 | cpp | #include <COSTimer.h>
#include <std_os.h>
#include <time.h>
#include <cerrno>
#define HAS_NANO_SLEEP 1
uint
COSTimer::
sleep(uint secs)
{
#if OS_UNIX
// TODO: use nanosleep or clock_nanosleep (linux)
int remain = sleep((uint) secs);
return remain;
#else
std::cerr << "COSTimer::sleep: Unimplemented" << std::endl;
return 0;
#endif
}
uint
COSTimer::
msleep(uint msecs)
{
return micro_sleep(msecs);
}
// sleep for n millionths of a second
uint
COSTimer::
micro_sleep(uint msecs)
{
#if HAS_NANO_SLEEP
struct timespec tv;
tv.tv_sec = msecs / 1000000;
tv.tv_nsec = 1000*(msecs % 1000000);
(void) nanosleep(&tv, NULL);
return 0;
#elif OS_UNIX
if (msecs <= 0)
return 0;
struct timeval tv;
tv.tv_sec = msecs / 1000000;
tv.tv_usec = msecs % 1000000;
select(1, 0, 0, 0, &tv);
return 0;
#else
std::cerr << "COSTimer::micro_sleep: Unimplemented" << std::endl;
return 0;
#endif
}
// sleep for n thousanths of a second
uint
COSTimer::
milli_sleep(uint msecs)
{
#if HAS_NANO_SLEEP
struct timespec tv;
tv.tv_sec = msecs / 1000;
tv.tv_nsec = 1000000*(msecs % 1000);
(void) nanosleep(&tv, NULL);
return 0;
#elif OS_UNIX
if (msecs <= 0)
return 0;
struct timeval tv;
tv.tv_sec = msecs / 1000;
tv.tv_usec = 1000*(msecs % 1000);
select(1, 0, 0, 0, &tv);
return 0;
#else
std::cerr << "COSTimer::milli_sleep: Unimplemented" << std::endl;
return 0;
#endif
}
| [
"hgl868@126.com"
] | hgl868@126.com |
5ae0c343374141ee147b5133e7e6f58dac65345d | eee200906478fc3c244ca551d398eb05fb2ed6ae | /gui_alian/BmpResource.cpp | f6f6e03f9a03e9888978d9cfd0ce0f3154c82242 | [] | no_license | laizl123/gitskill | c4f9f95933e5a5bbcedad6e67a248708bf992924 | fada7ee6318c3c2b8607be675b30634d9d73390e | refs/heads/master | 2020-12-02T12:47:22.587871 | 2017-07-10T09:02:24 | 2017-07-10T09:02:24 | 96,595,912 | 0 | 0 | null | null | null | null | WINDOWS-1252 | C++ | false | false | 2,882 | cpp | // BmpResoure.cpp: implementation of the CBmpResource class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "resource.h"
#include "BmpResource.h"
CBitmap CBmpResource::m_bmpIEAddpage;
// LAMP
CBitmap CBmpResource::m_bmpLampWait;
CBitmap CBmpResource::m_bmpLampPark;
CBitmap CBmpResource::m_bmpLampTalk;
CBitmap CBmpResource::m_bmpLampHold;
CBitmap CBmpResource::m_bmpLampOutdial;
CBitmap CBmpResource::m_bmpLampProcess;
CBitmap CBmpResource::m_bmpLampIncomingcall;
CBitmap CBmpResource::m_bmpLampIncomingcallWink;
// add by lh.wang date:2012.12.25
CBitmap CBmpResource::m_bmpLampConference;
// end add
// NET
CBitmap CBmpResource::m_bmpNetVerybad;
CBitmap CBmpResource::m_bmpNetGood;
CBitmap CBmpResource::m_bmpNetBusy;
CBitmap CBmpResource::m_bmpNetBad;
// title
CBitmap CBmpResource::m_bmpTitleFillBG;
CBitmap CBmpResource::m_bmpToolbarFillBG;
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CBmpResource::CBmpResource()
{
}
CBmpResource::~CBmpResource()
{
}
// ¶Áȡλͼ
void CBmpResource::LoadBitmapResource()
{
m_bmpIEAddpage.LoadBitmap(IDB_BMP_IEADDPAGE);
// LAMP
m_bmpLampWait.LoadBitmap(IDB_BMP_LAMP_WAIT);
m_bmpLampPark.LoadBitmap(IDB_BMP_LAMP_PARK);
m_bmpLampTalk.LoadBitmap(IDB_BMP_LAMP_TALK);
m_bmpLampHold.LoadBitmap(IDB_BMP_LAMP_HOLD);
m_bmpLampOutdial.LoadBitmap(IDB_BMP_LAMP_OUTDIAL);
m_bmpLampProcess.LoadBitmap(IDB_BMP_LAMP_PROCESS);
m_bmpLampIncomingcall.LoadBitmap(IDB_BMP_LAMP_INCOMINGCALL);
m_bmpLampIncomingcallWink.LoadBitmap(IDB_BMP_LAMP_INCOMINGCALL_WINK);
// add by lh.wang date:2012.12.25
m_bmpLampConference.LoadBitmap(IDB_BMP_LAMP_CONFERENCE);
// end add
// NET
m_bmpNetVerybad.LoadBitmap(IDB_BMP_NET_VERYBAD);
m_bmpNetGood.LoadBitmap(IDB_BMP_NET_GOOD);
m_bmpNetBusy.LoadBitmap(IDB_BMP_NET_BUSY);
m_bmpNetBad.LoadBitmap(IDB_BMP_NET_BAD);
// title
m_bmpTitleFillBG.LoadBitmap(IDB_BMP_TITLE_FILL_BG);
m_bmpToolbarFillBG.LoadBitmap(IDB_BMP_TOOLBAR_FILL_BG);
}
// ÊÍ·Åλͼ
void CBmpResource::ReleaseBitmapResource()
{
m_bmpIEAddpage.DeleteObject();
// LAMP
m_bmpLampWait.DeleteObject();
m_bmpLampPark.DeleteObject();
m_bmpLampTalk.DeleteObject();
m_bmpLampHold.DeleteObject();
m_bmpLampOutdial.DeleteObject();
m_bmpLampProcess.DeleteObject();
m_bmpLampIncomingcall.DeleteObject();
m_bmpLampIncomingcallWink.DeleteObject();
// add by lh.wang date:2012.12.25
m_bmpLampConference.DeleteObject();
// end add
// NET
m_bmpNetVerybad.DeleteObject();
m_bmpNetGood.DeleteObject();
m_bmpNetBusy.DeleteObject();
m_bmpNetBad.DeleteObject();
// title
m_bmpTitleFillBG.DeleteObject();
m_bmpToolbarFillBG.DeleteObject();
}
| [
"825663610@qq.com"
] | 825663610@qq.com |
de6fb5fb05eec2b207e70007ed393caef5bbafad | fb71d4f3b9817a10566209aefdd7200da23615c0 | /src/ofApp.h | 8312938b5ee10c717fcabad7f8adc25566553af9 | [] | no_license | yuyurigi/usagi_circlePacking | 441dd3a2099e2887f4c16d37058f63bdecf5500c | b14ab4e61d54f0560ccadc3761da9351612bc8b5 | refs/heads/master | 2022-12-17T22:38:17.307739 | 2020-09-15T12:37:51 | 2020-09-15T12:37:51 | 295,715,672 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 823 | h | #pragma once
#include "ofMain.h"
class ofApp : public ofBaseApp{
public:
void setup();
void update();
void draw();
void keyPressed(int key);
void keyReleased(int key);
void mouseMoved(int x, int y );
void mouseDragged(int x, int y, int button);
void mousePressed(int x, int y, int button);
void mouseReleased(int x, int y, int button);
void windowResized(int w, int h);
void dragEvent(ofDragInfo dragInfo);
void gotMessage(ofMessage msg);
ofColor readBackground(float x, float y);
ofImage myPhoto;
ofImage myPhoto2;
ofImage myImage;
unsigned char * pixelsOrigin;
unsigned char * pixels;
int width;
int height;
int maxWidth;
int centerX;
int centerY;
float dist;
bool onePixelLeft;
ofColor myc;
};
| [
"noreply@github.com"
] | yuyurigi.noreply@github.com |
c897f324b8d7cc79b3debd14e454e5849d1a005d | 15241b6d3d26379904dfdd2882cd79e2c0fa7c13 | /src/SmallFBX/sfbxModel.cpp | b6cfd31566af5834cab6ac57f2d326ced537cde0 | [
"MIT"
] | permissive | JiangKevin/SmallFBX | c6aa45fe11344e9943b924de2594f2d15240fa87 | 3feb94d7892395af5c70730f3fb0b8498a23682f | refs/heads/master | 2023-03-27T12:32:49.458596 | 2021-03-25T12:38:03 | 2021-03-25T12:38:03 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 17,411 | cpp | #include "pch.h"
#include "sfbxInternal.h"
#include "sfbxModel.h"
#include "sfbxGeometry.h"
#include "sfbxMaterial.h"
namespace sfbx {
ObjectClass NodeAttribute::getClass() const { return ObjectClass::NodeAttribute; }
ObjectSubClass NullAttribute::getSubClass() const { return ObjectSubClass::Null; }
ObjectSubClass RootAttribute::getSubClass() const { return ObjectSubClass::Root; }
ObjectSubClass LimbNodeAttribute::getSubClass() const { return ObjectSubClass::LimbNode; }
ObjectSubClass LightAttribute::getSubClass() const { return ObjectSubClass::Light; }
ObjectSubClass CameraAttribute::getSubClass() const { return ObjectSubClass::Camera; }
ObjectClass Model::getClass() const { return ObjectClass::Model; }
void Model::importFBXObjects()
{
super::importFBXObjects();
auto n = getNode();
if (!n)
return;
EnumerateProperties(n, [this](Node* p) {
auto get_int = [p]() -> int {
if (GetPropertyCount(p) == 5)
return GetPropertyValue<int32>(p, 4);
#ifdef sfbxEnableLegacyFormatSupport
else if (GetPropertyCount(p) == 4) {
return GetPropertyValue<int32>(p, 3);
}
#endif
return 0;
};
auto get_float3 = [p]() -> float3 {
if (GetPropertyCount(p) == 7) {
return float3{
(float)GetPropertyValue<float64>(p, 4),
(float)GetPropertyValue<float64>(p, 5),
(float)GetPropertyValue<float64>(p, 6),
};
}
#ifdef sfbxEnableLegacyFormatSupport
else if (GetPropertyCount(p) == 6) {
return float3{
(float)GetPropertyValue<float64>(p, 3),
(float)GetPropertyValue<float64>(p, 4),
(float)GetPropertyValue<float64>(p, 5),
};
}
#endif
return {};
};
auto pname = GetPropertyString(p);
if (pname == sfbxS_Visibility) {
m_visibility = GetPropertyValue<bool>(p, 4);
}
else if (pname == sfbxS_LclTranslation)
m_position = get_float3();
else if (pname == sfbxS_RotationOrder)
m_rotation_order = (RotationOrder)get_int();
else if (pname == sfbxS_PreRotation)
m_pre_rotation = get_float3();
else if (pname == sfbxS_PostRotation)
m_post_rotation = get_float3();
else if (pname == sfbxS_LclRotation)
m_rotation = get_float3();
else if (pname == sfbxS_LclScale)
m_scale = get_float3();
});
}
#define sfbxVector3d(V) (float64)V.x, (float64)V.y, (float64)V.z
void Model::exportFBXObjects()
{
super::exportFBXObjects();
auto n = getNode();
if (!n)
return;
// version
n->createChild(sfbxS_Version, sfbxI_ModelVersion);
auto properties = n->createChild(sfbxS_Properties70);
// attribute
properties->createChild(sfbxS_P, "DefaultAttributeIndex", "int", "Integer", "", 0);
// position
if (m_position != float3::zero())
properties->createChild(sfbxS_P,
sfbxS_LclTranslation, sfbxS_LclTranslation, sfbxS_Empty, sfbxS_A, sfbxVector3d(m_position));
// rotation
if (m_pre_rotation != float3::zero() || m_post_rotation != float3::zero() || m_rotation != float3::zero()) {
// rotation active
properties->createChild(sfbxS_P,
sfbxS_RotationActive, sfbxS_bool, sfbxS_Empty, sfbxS_Empty, (int32)1);
// rotation order
if (m_rotation_order != RotationOrder::XYZ)
properties->createChild(sfbxS_P,
sfbxS_RotationOrder, sfbxS_RotationOrder, sfbxS_Empty, sfbxS_A, (int32)m_rotation_order);
// pre-rotation
if (m_pre_rotation != float3::zero())
properties->createChild(sfbxS_P,
sfbxS_PreRotation, sfbxS_Vector3D, sfbxS_Vector, sfbxS_Empty, sfbxVector3d(m_pre_rotation));
// post-rotation
if (m_post_rotation != float3::zero())
properties->createChild(sfbxS_P,
sfbxS_PostRotation, sfbxS_Vector3D, sfbxS_Vector, sfbxS_Empty, sfbxVector3d(m_post_rotation));
// rotation
if (m_rotation != float3::zero())
properties->createChild(sfbxS_P,
sfbxS_LclRotation, sfbxS_LclRotation, sfbxS_Empty, sfbxS_A, sfbxVector3d(m_rotation));
}
// scale
if (m_scale!= float3::one())
properties->createChild(sfbxS_P,
sfbxS_LclScale, sfbxS_LclScale, sfbxS_Empty, sfbxS_A, sfbxVector3d(m_scale));
}
void Model::addChild(Object* v)
{
super::addChild(v);
if (auto model = as<Model>(v))
m_child_models.push_back(model);
}
void Model::eraseChild(Object* v)
{
super::eraseChild(v);
if (auto model = as<Model>(v))
erase(m_child_models, model);
}
void Model::addParent(Object* v)
{
super::addParent(v);
if (auto model = as<Model>(v))
m_parent_model = model;
}
void Model::eraseParent(Object* v)
{
super::eraseParent(v);
if (v == m_parent_model)
m_parent_model = nullptr;
}
Model* Model::getParentModel() const { return m_parent_model; }
bool Model::getVisibility() const { return m_visibility; }
RotationOrder Model::getRotationOrder() const { return m_rotation_order; }
float3 Model::getPosition() const { return m_position; }
float3 Model::getPreRotation() const { return m_pre_rotation; }
float3 Model::getRotation() const { return m_rotation; }
float3 Model::getPostRotation() const { return m_post_rotation; }
float3 Model::getScale() const { return m_scale; }
void Model::updateMatrices() const
{
if (m_matrix_dirty) {
// scale
float4x4 r = scale44(m_scale);
// rotation
if (m_post_rotation != float3::zero())
r *= transpose(to_mat4x4(rotate_euler(m_rotation_order, m_post_rotation * DegToRad)));
if (m_rotation != float3::zero())
r *= transpose(to_mat4x4(rotate_euler(m_rotation_order, m_rotation * DegToRad)));
if (m_pre_rotation != float3::zero())
r *= transpose(to_mat4x4(rotate_euler(m_rotation_order, m_pre_rotation * DegToRad)));
// translation
(float3&)r[3] = m_position;
m_matrix_local = r;
m_matrix_global = m_matrix_local;
if (m_parent_model)
m_matrix_global *= m_parent_model->getGlobalMatrix();
m_matrix_dirty = false;
}
}
float4x4 Model::getLocalMatrix() const
{
updateMatrices();
return m_matrix_local;
}
float4x4 Model::getGlobalMatrix() const
{
updateMatrices();
return m_matrix_global;
}
std::string Model::getPath() const
{
if (m_id == 0)
return{};
std::string ret;
if (m_parent_model)
ret += m_parent_model->getPath();
ret += "/";
ret += getName();
return ret;
}
void Model::setVisibility(bool v) { m_visibility = v; }
void Model::setRotationOrder(RotationOrder v) { m_rotation_order = v; }
void Model::propagateDirty()
{
if (!m_matrix_dirty) {
m_matrix_dirty = true;
for (auto c : m_child_models)
c->propagateDirty();
}
}
#define MarkDirty(V, A) if (A != V) { V = A; propagateDirty(); }
void Model::setPosition(float3 v) { MarkDirty(m_position, v); }
void Model::setPreRotation(float3 v) { MarkDirty(m_pre_rotation, v); }
void Model::setRotation(float3 v) { MarkDirty(m_rotation, v); }
void Model::setPostRotation(float3 v) { MarkDirty(m_post_rotation, v); }
void Model::setScale(float3 v) { MarkDirty(m_scale, v); }
#undef MarkDirty
ObjectSubClass Null::getSubClass() const { return ObjectSubClass::Null; }
void Null::exportFBXObjects()
{
if (!m_attr)
m_attr = createChild<NullAttribute>();
super::exportFBXObjects();
}
void NullAttribute::exportFBXObjects()
{
super::exportFBXObjects();
getNode()->createChild(sfbxS_TypeFlags, sfbxS_Null);
}
void Null::addChild(Object* v)
{
super::addChild(v);
if (auto attr = as<NullAttribute>(v))
m_attr = attr;
}
void Null::eraseChild(Object* v)
{
super::eraseChild(v);
if (v == m_attr)
m_attr = nullptr;
}
ObjectSubClass Root::getSubClass() const { return ObjectSubClass::Root; }
void Root::exportFBXObjects()
{
if (!m_attr)
m_attr = createChild<RootAttribute>();
super::exportFBXObjects();
}
void RootAttribute::exportFBXObjects()
{
super::exportFBXObjects();
getNode()->createChild(sfbxS_TypeFlags, sfbxS_Null, sfbxS_Skeleton, sfbxS_Root);
}
void Root::addChild(Object* v)
{
super::addChild(v);
if (auto attr = as<RootAttribute>(v))
m_attr = attr;
}
void Root::eraseChild(Object* v)
{
super::eraseChild(v);
if (v == m_attr)
m_attr = nullptr;
}
ObjectSubClass LimbNode::getSubClass() const { return ObjectSubClass::LimbNode; }
void LimbNode::exportFBXObjects()
{
if (!m_attr)
m_attr = createChild<LimbNodeAttribute>();
super::exportFBXObjects();
}
void LimbNodeAttribute::exportFBXObjects()
{
super::exportFBXObjects();
getNode()->createChild(sfbxS_TypeFlags, sfbxS_Skeleton);
}
void LimbNode::addChild(Object* v)
{
super::addChild(v);
if (auto attr = as<LimbNodeAttribute>(v))
m_attr = attr;
}
void LimbNode::eraseChild(Object* v)
{
super::eraseChild(v);
if (v == m_attr)
m_attr = nullptr;
}
ObjectSubClass Mesh::getSubClass() const { return ObjectSubClass::Mesh; }
void Mesh::importFBXObjects()
{
super::importFBXObjects();
#ifdef sfbxEnableLegacyFormatSupport
// in old fbx, Model::Mesh has geometry data (Geometry::Mesh does not exist)
auto n = getNode();
if (n->findChild(sfbxS_Vertices)) {
getGeometry()->setNode(n);
}
#endif
}
void Mesh::addChild(Object* v)
{
super::addChild(v);
if (auto geom = as<GeomMesh>(v))
m_geom = geom;
else if (auto material = as<Material>(v))
m_materials.push_back(material);
}
void Mesh::eraseChild(Object* v)
{
super::eraseChild(v);
if (v == m_geom)
m_geom = nullptr;
else if (auto material = as<Material>(v))
erase(m_materials, material);
}
GeomMesh* Mesh::getGeometry()
{
if (!m_geom)
m_geom = createChild<GeomMesh>(getName());
return m_geom;
}
span<Material*> Mesh::getMaterials() const
{
return make_span(m_materials);
}
ObjectSubClass Light::getSubClass() const { return ObjectSubClass::Light; }
void Light::importFBXObjects()
{
super::importFBXObjects();
}
void LightAttribute::importFBXObjects()
{
super::importFBXObjects();
auto light = as<Light>(getParent());
if (!light)
return;
EnumerateProperties(getNode(), [light](Node* p) {
auto name = GetPropertyString(p, 0);
if (name == sfbxS_LightType)
light->m_light_type = (LightType)GetPropertyValue<int32>(p, 4);
else if (name == sfbxS_Color)
light->m_color = float3{
(float32)GetPropertyValue<float64>(p, 4),
(float32)GetPropertyValue<float64>(p, 5),
(float32)GetPropertyValue<float64>(p, 6)};
else if (name == sfbxS_Intensity)
light->m_intensity = (float32)GetPropertyValue<float64>(p, 4);
else if (name == sfbxS_InnerAngle)
light->m_inner_angle = (float32)GetPropertyValue<float64>(p, 4);
else if (name == sfbxS_OuterAngle)
light->m_outer_angle = (float32)GetPropertyValue<float64>(p, 4);
});
}
void Light::exportFBXObjects()
{
if (!m_attr)
m_attr = createChild<LightAttribute>();
super::exportFBXObjects();
}
void LightAttribute::exportFBXObjects()
{
super::exportFBXObjects();
auto light = as<Light>(getParent());
if (!light)
return;
auto color = light->m_color;
auto props = getNode()->createChild(sfbxS_Properties70);
props->createChild(sfbxS_P, sfbxS_LightType, sfbxS_enum, "", "", (int32)light->m_light_type);
props->createChild(sfbxS_P, sfbxS_Color, sfbxS_Color, "", "A", (float64)color.x, (float64)color.y, (float64)color.z);
props->createChild(sfbxS_P, sfbxS_Intensity, sfbxS_Number, "", "A", (float64)light->m_intensity);
if (light->m_light_type == LightType::Spot) {
props->createChild(sfbxS_P, sfbxS_InnerAngle, sfbxS_Number, "", "A", (float64)light->m_inner_angle);
props->createChild(sfbxS_P, sfbxS_OuterAngle, sfbxS_Number, "", "A", (float64)light->m_outer_angle);
}
}
void Light::addChild(Object* v)
{
super::addChild(v);
if (auto attr = as<LightAttribute>(v))
m_attr = attr;
}
void Light::eraseChild(Object* v)
{
super::eraseChild(v);
if (v == m_attr)
m_attr = nullptr;
}
LightType Light::getLightType() const { return m_light_type; }
float3 Light::getColor() const { return m_color; }
float Light::getIntensity() const { return m_intensity; }
float Light::getInnerAngle() const { return m_inner_angle; }
float Light::getOuterAngle() const { return m_outer_angle; }
void Light::setLightType(LightType v) { m_light_type = v; }
void Light::setColor(float3 v) { m_color = v; }
void Light::setIntensity(float v) { m_intensity = v; }
void Light::setInnerAngle(float v) { m_inner_angle = v; }
void Light::setOuterAngle(float v) { m_outer_angle = v; }
ObjectSubClass Camera::getSubClass() const { return ObjectSubClass::Camera; }
void Camera::importFBXObjects()
{
super::importFBXObjects();
}
void CameraAttribute::importFBXObjects()
{
super::importFBXObjects();
auto cam = as<Camera>(getParent());
if (!cam)
return;
EnumerateProperties(getNode(), [cam](Node* p) {
auto name = GetPropertyString(p, 0);
if (name == sfbxS_CameraProjectionType)
cam->m_camera_type = (CameraType)GetPropertyValue<int32>(p, 4);
else if (name == sfbxS_FocalLength)
cam->m_focal_length = (float32)GetPropertyValue<float64>(p, 4);
else if (name == sfbxS_FilmWidth)
cam->m_film_size.x = (float32)GetPropertyValue<float64>(p, 4) * InchToMillimeter;
else if (name == sfbxS_FilmHeight)
cam->m_film_size.y = (float32)GetPropertyValue<float64>(p, 4) * InchToMillimeter;
else if (name == sfbxS_FilmOffsetX)
cam->m_film_offset.x = (float32)GetPropertyValue<float64>(p, 4) * InchToMillimeter;
else if (name == sfbxS_FilmOffsetY)
cam->m_film_offset.y = (float32)GetPropertyValue<float64>(p, 4) * InchToMillimeter;
else if (name == sfbxS_NearPlane)
cam->m_near_plane = (float32)GetPropertyValue<float64>(p, 4);
else if (name == sfbxS_FarPlane)
cam->m_far_plane = (float32)GetPropertyValue<float64>(p, 4);
});
}
void Camera::exportFBXObjects()
{
if (!m_attr)
m_attr = createChild<CameraAttribute>();
super::exportFBXObjects();
}
void CameraAttribute::exportFBXObjects()
{
super::exportFBXObjects();
auto cam = as<Camera>(getParent());
if (!cam)
return;
auto props = getNode()->createChild(sfbxS_Properties70);
props->createChild(sfbxS_P, sfbxS_CameraProjectionType, sfbxS_enum, "", "", (int32)cam->m_camera_type);
props->createChild(sfbxS_P, sfbxS_FocalLength, sfbxS_Number, "", "A", (float64)cam->m_focal_length);
props->createChild(sfbxS_P, sfbxS_FilmWidth, sfbxS_Number, "", "A", (float64)cam->m_film_size.x * MillimeterToInch);
props->createChild(sfbxS_P, sfbxS_FilmHeight, sfbxS_Number, "", "A", (float64)cam->m_film_size.y * MillimeterToInch);
if (cam->m_film_offset.x != 0.0f)
props->createChild(sfbxS_P, sfbxS_FilmOffsetX, sfbxS_Number, "", "A", (float64)cam->m_film_offset.x * MillimeterToInch);
if (cam->m_film_offset.y != 0.0f)
props->createChild(sfbxS_P, sfbxS_FilmOffsetY, sfbxS_Number, "", "A", (float64)cam->m_film_offset.y * MillimeterToInch);
props->createChild(sfbxS_P, sfbxS_NearPlane, sfbxS_Number, "", "A", (float64)cam->m_near_plane);
props->createChild(sfbxS_P, sfbxS_FarPlane, sfbxS_Number, "", "A", (float64)cam->m_far_plane);
}
void Camera::addChild(Object* v)
{
super::addChild(v);
if (auto attr = as<CameraAttribute>(v))
m_attr = attr;
}
void Camera::eraseChild(Object* v)
{
super::eraseChild(v);
if (v == m_attr)
m_attr = nullptr;
}
CameraType Camera::getCameraType() const { return m_camera_type; }
float Camera::getFocalLength() const { return m_focal_length; }
float2 Camera::getFilmSize() const { return m_film_size; }
float2 Camera::getFilmOffset() const { return m_film_offset; }
float2 Camera::getFildOfView() const
{
return float2{
compute_fov(m_film_size.x, m_focal_length),
compute_fov(m_film_size.y, m_focal_length),
};
}
float2 Camera::getAspectSize() const { return m_aspect; }
float Camera::getAspectRatio() const
{
return m_film_size.x / m_film_size.y;
}
float Camera::getNearPlane() const { return m_near_plane; }
float Camera::getFarPlane() const { return m_far_plane; }
void Camera::setCameraType(CameraType v) { m_camera_type = v; }
void Camera::setFocalLength(float v) { m_focal_length = v; }
void Camera::setFilmSize(float2 v) { m_film_size = v; }
void Camera::setFilmShift(float2 v) { m_film_offset = v; }
void Camera::setAspectSize(float2 v) { m_aspect = v; }
void Camera::setNearPlane(float v) { m_near_plane = v; }
void Camera::setFarPlane(float v) { m_far_plane = v; }
} // namespace sfbx
| [
"saint.skr@gmail.com"
] | saint.skr@gmail.com |
94972761961c4872ab90c4f795381827e6d4bcd1 | 74837c92508b3190f8639564eaa7fa4388679f1d | /wrspice/devlib/bsim4.8.0/b4trun.cc | c9d5739f623a18b719eb0e6dad6edbf7c47720bb | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | frankhoff/xictools | 35d49a88433901cc9cb88b1cfd3e8bf16ddba71c | 9ff0aa58a5f5137f8a9e374a809a1cb84bab04fb | refs/heads/master | 2023-03-21T13:05:38.481014 | 2022-09-18T21:51:41 | 2022-09-18T21:51:41 | 197,598,973 | 1 | 0 | null | 2019-07-18T14:07:13 | 2019-07-18T14:07:13 | null | UTF-8 | C++ | false | false | 4,710 | cc |
/*========================================================================*
* *
* Distributed by Whiteley Research Inc., Sunnyvale, California, USA *
* http://wrcad.com *
* Copyright (C) 2017 Whiteley Research Inc., all rights reserved. *
* Author: Stephen R. Whiteley, except as indicated. *
* *
* As fully as possible recognizing licensing terms and conditions *
* imposed by earlier work from which this work was derived, if any, *
* this work is released under the Apache License, Version 2.0 (the *
* "License"). You may not use this file except in compliance with *
* the License, and compliance with inherited licenses which are *
* specified in a sub-header below this one if applicable. A copy *
* of the License is provided with this distribution, or you may *
* obtain a copy of the License at *
* *
* http://www.apache.org/licenses/LICENSE-2.0 *
* *
* See the License for the specific language governing permissions *
* and limitations under the License. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, *
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES *
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON- *
* INFRINGEMENT. IN NO EVENT SHALL WHITELEY RESEARCH INCORPORATED *
* OR STEPHEN R. WHITELEY BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE *
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
* *
*========================================================================*
* XicTools Integrated Circuit Design System *
* *
* WRspice Circuit Simulation and Analysis Tool: Device Library *
* *
*========================================================================*
$Id:$
*========================================================================*/
/**** BSIM4.8.0 Released by Navid Paydavosi 11/01/2013 ****/
/**********
* Copyright 2006 Regents of the University of California. All rights reserved.
* File: b4trunc.c of BSIM4.8.0.
* Author: 2000 Weidong Liu
* Authors: 2001- Xuemei Xi, Mohan Dunga, Ali Niknejad, Chenming Hu.
* Authors: 2006- Mohan Dunga, Ali Niknejad, Chenming Hu
* Authors: 2007- Mohan Dunga, Wenwei Yang, Ali Niknejad, Chenming Hu
* Project Director: Prof. Chenming Hu.
**********/
#include "b4defs.h"
#define BSIM4nextModel next()
#define BSIM4nextInstance next()
#define BSIM4instances inst()
#define CKTterr(a, b, c) (b)->terr(a, c)
int
BSIM4dev::trunc(sGENmodel *genmod, sCKT *ckt, double *timeStep)
{
sBSIM4model *model = static_cast<sBSIM4model*>(genmod);
sBSIM4instance *here;
#ifdef STEPDEBUG
double debugtemp;
#endif /* STEPDEBUG */
for (; model != NULL; model = model->BSIM4nextModel)
{
for (here = model->BSIM4instances; here != NULL;
here = here->BSIM4nextInstance)
{
#ifdef STEPDEBUG
debugtemp = *timeStep;
#endif /* STEPDEBUG */
CKTterr(here->BSIM4qb,ckt,timeStep);
CKTterr(here->BSIM4qg,ckt,timeStep);
CKTterr(here->BSIM4qd,ckt,timeStep);
if (here->BSIM4trnqsMod)
CKTterr(here->BSIM4qcdump,ckt,timeStep);
if (here->BSIM4rbodyMod)
{
CKTterr(here->BSIM4qbs,ckt,timeStep);
CKTterr(here->BSIM4qbd,ckt,timeStep);
}
if (here->BSIM4rgateMod == 3)
CKTterr(here->BSIM4qgmid,ckt,timeStep);
#ifdef STEPDEBUG
if(debugtemp != *timeStep)
{
printf("device %s reduces step from %g to %g\n",
here->BSIM4name,debugtemp,*timeStep);
}
#endif /* STEPDEBUG */
}
}
return(OK);
}
| [
"stevew@wrcad.com"
] | stevew@wrcad.com |
53424323746bf3783d7e0a80818b4726e6963815 | c9304af7790d66f71073e38e6899040f3da1917a | /c_plus_plus/white_belt/week2/capital_guide.cpp | 107a9221cd401f1da4dca100a26d4a4698849bf0 | [
"MIT"
] | permissive | raventid/coursera_learning | b086ac474be00f24af8c75ce5eada09f7ca6d39d | 9cd62324b91d2a35af413dd4442867e160e7a4ea | refs/heads/master | 2023-07-11T04:07:41.034279 | 2023-07-02T19:22:49 | 2023-07-02T19:22:49 | 78,435,867 | 1 | 0 | MIT | 2022-06-06T21:08:01 | 2017-01-09T14:25:07 | Assembly | UTF-8 | C++ | false | false | 3,151 | cpp | #include <iostream>
#include <string>
#include <map>
// Реализуйте справочник столиц стран.
// На вход программе поступают следующие запросы:
// CHANGE_CAPITAL country new_capital — изменение столицы страны country на new_capital,
// либо добавление такой страны с такой столицей, если раньше её не было.
// RENAME old_country_name new_country_name — переименование страны из old_country_name
// в new_country_name.
// ABOUT country — вывод столицы страны country.
// DUMP — вывод столиц всех стран.
int main() {
int n;
std::cin >> n;
std::map<std::string, std::string> capitals;
// dispatch loop:
for(int i = 0; i < n; i++) {
std::string command;
std::string country;
std::string capital;
std::string new_capital;
std::cin >> command;
if (command == "CHANGE_CAPITAL") {
std::cin >> country;
std::cin >> new_capital;
// Country didn't exist before
if(capitals.count(country) == 0) {
std::cout
<< "Introduce new country "
<< country
<< " with capital "
<< new_capital;
capitals[country] = new_capital;
} else if(capitals[country] == new_capital) {
std::cout << "Country " << country << " hasn't changed its capital";
} else if(capitals[country] != new_capital) {
std::cout
<< "Country "
<< country
<< " has changed its capital from "
<< capitals[country]
<< " to "
<< new_capital;
capitals[country] = new_capital;
}
std::cout << std::endl;
}
if (command == "RENAME") {
std::string old_country_name, new_country_name;
std::cin >> old_country_name;
std::cin >> new_country_name;
if(capitals.count(new_country_name) || !capitals.count(old_country_name)) {
std::cout << "Incorrect rename, skip";
} else {
std::cout
<< "Country "
<< old_country_name
<< " with capital "
<< capitals[old_country_name]
<< " has been renamed to "
<< new_country_name;
capitals[new_country_name] = capitals[old_country_name];
capitals.erase(old_country_name);
}
std::cout << std::endl;
}
if (command == "ABOUT") {
std::string country;
std::cin >> country;
if(capitals.count(country)) {
std::cout
<< "Country "
<< country
<< " has capital "
<< capitals[country];
} else {
std::cout << "Country " << country << " doesn't exist";
}
std::cout << std::endl;
}
if (command == "DUMP") {
if (capitals.empty()) {
std::cout << "There are no countries in the world";
} else {
for(const auto& pair : capitals) {
std::cout << pair.first << "/" << pair.second << " ";
}
}
std::cout << std::endl;
}
}
return 0;
}
| [
"julian.kulesh@kupibilet.ru"
] | julian.kulesh@kupibilet.ru |
9f1e04b3aeee66d572adff54709d4a5288aaab57 | c0f8fa65755d822bc6e4c71afdcc6c13075d7565 | /src/protocol.cpp | 49232ed14035dcc707c6d4231f5f486bc8c094cb | [
"MIT"
] | permissive | MNodelab/Nodelab | de42b49e7f10597df2d7b3abf0c935535170fabb | 96a4508f57cc73d4826ab04cde6896fa598c902b | refs/heads/master | 2020-03-22T08:10:39.187698 | 2018-07-04T19:30:04 | 2018-07-04T19:30:04 | 139,750,021 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 7,900 | cpp | // Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2015 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "protocol.h"
#include "util.h"
#include "utilstrencodings.h"
#ifndef WIN32
# include <arpa/inet.h>
#endif
namespace NetMsgType {
const char *VERSION="version";
const char *VERACK="verack";
const char *ADDR="addr";
const char *INV="inv";
const char *GETDATA="getdata";
const char *MERKLEBLOCK="merkleblock";
const char *GETBLOCKS="getblocks";
const char *GETHEADERS="getheaders";
const char *TX="tx";
const char *HEADERS="headers";
const char *BLOCK="block";
const char *GETADDR="getaddr";
const char *MEMPOOL="mempool";
const char *PING="ping";
const char *PONG="pong";
const char *ALERT="alert";
const char *NOTFOUND="notfound";
const char *FILTERLOAD="filterload";
const char *FILTERADD="filteradd";
const char *FILTERCLEAR="filterclear";
const char *REJECT="reject";
const char *SENDHEADERS="sendheaders";
// NodeLab message types
const char *TXLOCKREQUEST="ix";
const char *TXLOCKVOTE="txlvote";
const char *SPORK="spork";
const char *GETSPORKS="getsporks";
const char *MASTERNODEPAYMENTVOTE="mnw";
const char *MASTERNODEPAYMENTBLOCK="mnwb";
const char *MASTERNODEPAYMENTSYNC="mnget";
const char *MNBUDGETSYNC="mnvs"; // depreciated since 12.1
const char *MNBUDGETVOTE="mvote"; // depreciated since 12.1
const char *MNBUDGETPROPOSAL="mprop"; // depreciated since 12.1
const char *MNBUDGETFINAL="fbs"; // depreciated since 12.1
const char *MNBUDGETFINALVOTE="fbvote"; // depreciated since 12.1
const char *MNQUORUM="mn quorum"; // not implemented
const char *MNANNOUNCE="mnb";
const char *MNPING="mnp";
const char *DSACCEPT="dsa";
const char *DSVIN="dsi";
const char *DSFINALTX="dsf";
const char *DSSIGNFINALTX="dss";
const char *DSCOMPLETE="dsc";
const char *DSSTATUSUPDATE="dssu";
const char *DSTX="dstx";
const char *DSQUEUE="dsq";
const char *DSEG="dseg";
const char *SYNCSTATUSCOUNT="ssc";
const char *MNGOVERNANCESYNC="govsync";
const char *MNGOVERNANCEOBJECT="govobj";
const char *MNGOVERNANCEOBJECTVOTE="govobjvote";
const char *MNVERIFY="mnv";
};
static const char* ppszTypeName[] =
{
"ERROR", // Should never occur
NetMsgType::TX,
NetMsgType::BLOCK,
"filtered block", // Should never occur
// NodeLab message types
// NOTE: include non-implmented here, we must keep this list in sync with enum in protocol.h
NetMsgType::TXLOCKREQUEST,
NetMsgType::TXLOCKVOTE,
NetMsgType::SPORK,
NetMsgType::MASTERNODEPAYMENTVOTE,
NetMsgType::MASTERNODEPAYMENTBLOCK, // reusing, was MNSCANERROR previousely, was NOT used in 12.0, we need this for inv
NetMsgType::MNBUDGETVOTE, // depreciated since 12.1
NetMsgType::MNBUDGETPROPOSAL, // depreciated since 12.1
NetMsgType::MNBUDGETFINAL, // depreciated since 12.1
NetMsgType::MNBUDGETFINALVOTE, // depreciated since 12.1
NetMsgType::MNQUORUM, // not implemented
NetMsgType::MNANNOUNCE,
NetMsgType::MNPING,
NetMsgType::DSTX,
NetMsgType::MNGOVERNANCEOBJECT,
NetMsgType::MNGOVERNANCEOBJECTVOTE,
NetMsgType::MNVERIFY,
};
/** All known message types. Keep this in the same order as the list of
* messages above and in protocol.h.
*/
const static std::string allNetMessageTypes[] = {
NetMsgType::VERSION,
NetMsgType::VERACK,
NetMsgType::ADDR,
NetMsgType::INV,
NetMsgType::GETDATA,
NetMsgType::MERKLEBLOCK,
NetMsgType::GETBLOCKS,
NetMsgType::GETHEADERS,
NetMsgType::TX,
NetMsgType::HEADERS,
NetMsgType::BLOCK,
NetMsgType::GETADDR,
NetMsgType::MEMPOOL,
NetMsgType::PING,
NetMsgType::PONG,
NetMsgType::ALERT,
NetMsgType::NOTFOUND,
NetMsgType::FILTERLOAD,
NetMsgType::FILTERADD,
NetMsgType::FILTERCLEAR,
NetMsgType::REJECT,
NetMsgType::SENDHEADERS,
// NodeLab message types
// NOTE: do NOT include non-implmented here, we want them to be "Unknown command" in ProcessMessage()
NetMsgType::TXLOCKREQUEST,
NetMsgType::TXLOCKVOTE,
NetMsgType::SPORK,
NetMsgType::GETSPORKS,
NetMsgType::MASTERNODEPAYMENTVOTE,
// NetMsgType::MASTERNODEPAYMENTBLOCK, // there is no message for this, only inventory
NetMsgType::MASTERNODEPAYMENTSYNC,
NetMsgType::MNANNOUNCE,
NetMsgType::MNPING,
NetMsgType::DSACCEPT,
NetMsgType::DSVIN,
NetMsgType::DSFINALTX,
NetMsgType::DSSIGNFINALTX,
NetMsgType::DSCOMPLETE,
NetMsgType::DSSTATUSUPDATE,
NetMsgType::DSTX,
NetMsgType::DSQUEUE,
NetMsgType::DSEG,
NetMsgType::SYNCSTATUSCOUNT,
NetMsgType::MNGOVERNANCESYNC,
NetMsgType::MNGOVERNANCEOBJECT,
NetMsgType::MNGOVERNANCEOBJECTVOTE,
NetMsgType::MNVERIFY,
};
const static std::vector<std::string> allNetMessageTypesVec(allNetMessageTypes, allNetMessageTypes+ARRAYLEN(allNetMessageTypes));
CMessageHeader::CMessageHeader(const MessageStartChars& pchMessageStartIn)
{
memcpy(pchMessageStart, pchMessageStartIn, MESSAGE_START_SIZE);
memset(pchCommand, 0, sizeof(pchCommand));
nMessageSize = -1;
nChecksum = 0;
}
CMessageHeader::CMessageHeader(const MessageStartChars& pchMessageStartIn, const char* pszCommand, unsigned int nMessageSizeIn)
{
memcpy(pchMessageStart, pchMessageStartIn, MESSAGE_START_SIZE);
memset(pchCommand, 0, sizeof(pchCommand));
strncpy(pchCommand, pszCommand, COMMAND_SIZE);
nMessageSize = nMessageSizeIn;
nChecksum = 0;
}
std::string CMessageHeader::GetCommand() const
{
return std::string(pchCommand, pchCommand + strnlen(pchCommand, COMMAND_SIZE));
}
bool CMessageHeader::IsValid(const MessageStartChars& pchMessageStartIn) const
{
// Check start string
if (memcmp(pchMessageStart, pchMessageStartIn, MESSAGE_START_SIZE) != 0)
return false;
// Check the command string for errors
for (const char* p1 = pchCommand; p1 < pchCommand + COMMAND_SIZE; p1++)
{
if (*p1 == 0)
{
// Must be all zeros after the first zero
for (; p1 < pchCommand + COMMAND_SIZE; p1++)
if (*p1 != 0)
return false;
}
else if (*p1 < ' ' || *p1 > 0x7E)
return false;
}
// Message size
if (nMessageSize > MAX_SIZE)
{
LogPrintf("CMessageHeader::IsValid(): (%s, %u bytes) nMessageSize > MAX_SIZE\n", GetCommand(), nMessageSize);
return false;
}
return true;
}
CAddress::CAddress() : CService()
{
Init();
}
CAddress::CAddress(CService ipIn, uint64_t nServicesIn) : CService(ipIn)
{
Init();
nServices = nServicesIn;
}
void CAddress::Init()
{
nServices = NODE_NETWORK;
nTime = 100000000;
}
CInv::CInv()
{
type = 0;
hash.SetNull();
}
CInv::CInv(int typeIn, const uint256& hashIn)
{
type = typeIn;
hash = hashIn;
}
CInv::CInv(const std::string& strType, const uint256& hashIn)
{
unsigned int i;
for (i = 1; i < ARRAYLEN(ppszTypeName); i++)
{
if (strType == ppszTypeName[i])
{
type = i;
break;
}
}
if (i == ARRAYLEN(ppszTypeName))
throw std::out_of_range(strprintf("CInv::CInv(string, uint256): unknown type '%s'", strType));
hash = hashIn;
}
bool operator<(const CInv& a, const CInv& b)
{
return (a.type < b.type || (a.type == b.type && a.hash < b.hash));
}
bool CInv::IsKnownType() const
{
return (type >= 1 && type < (int)ARRAYLEN(ppszTypeName));
}
const char* CInv::GetCommand() const
{
if (!IsKnownType())
throw std::out_of_range(strprintf("CInv::GetCommand(): type=%d unknown type", type));
return ppszTypeName[type];
}
std::string CInv::ToString() const
{
return strprintf("%s %s", GetCommand(), hash.ToString());
}
const std::vector<std::string> &getAllNetMessageTypes()
{
return allNetMessageTypesVec;
}
| [
"mnlab@gmail.com"
] | mnlab@gmail.com |
682a79f51b9225367e99ccc19bae5646d9127779 | 775a3fc6e96d50b2f2782d92be72bdc6170f22b7 | /Arcade/The Core/37-first-reverse-try.cpp | 54650e5edfe2b6accd7b67ed7562c3dad1dbaaa7 | [] | no_license | son2005/CoFi | 3f9e4ef1778c6e246199cae7a69bbb0b08e2567f | d76ba175f240d0018f879a636c0c91fc413e0d6f | refs/heads/master | 2021-06-02T14:01:06.322261 | 2021-02-06T16:03:31 | 2021-02-06T16:03:31 | 94,472,532 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 226 | cpp | // https://codefights.com/arcade/code-arcade/list-forest-edge/ND8nghbndTNKPP4Tb
std::vector<int> firstReverseTry(std::vector<int> arr) {
if(arr.size() > 1)
std::swap(arr[0], arr[arr.size() - 1]);
return arr;
}
| [
"tranbaoson2005@gmail.com"
] | tranbaoson2005@gmail.com |
33d2df06c0e8f4b7545b753e594109b9cf35b93b | 1707d093ec4428361d928b242ae4b15b39aee69c | /gears/meta/utility.hpp | 652e9b5d7e9a446f16bf20214f4d571d77bb2a15 | [
"MIT"
] | permissive | chai51/Gears | 15ccc2ced613bc43fc6434cf876b47a88585e333 | ce65bf135057939c19710286f772a874504efeb4 | refs/heads/master | 2020-12-06T00:07:06.645480 | 2014-10-06T10:29:12 | 2014-10-06T10:29:12 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,506 | hpp | // The MIT License (MIT)
// Copyright (c) 2012-2014 Danny Y., Rapptz
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
// the Software, and to permit persons to whom the Software is furnished to do so,
// subject 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.
#ifndef GEARS_META_UTILITY_HPP
#define GEARS_META_UTILITY_HPP
#include <type_traits>
namespace gears {
namespace meta {
/**
* @ingroup meta
* @brief Returns a non-const lvalue reference as a const lvalue reference.
*
* @param t lvalue reference to turn to const lvalue reference.
* @return const lvalue reference.
*/
template<typename T>
constexpr const T& as_const(T& t) {
return t;
}
template<typename T>
constexpr T&& cforward(typename std::remove_reference<T>::type& t) noexcept {
return static_cast<T&&>(t);
}
/**
* @ingroup meta
* @brief constexpr enabled alternative to `std::forward`.
*
* @param t variable to forward
* @tparam T Type of parameter being forwarded.
* @return `static_cast<T&&>(t)`.
*/
template<typename T>
constexpr T&& cforward(typename std::remove_reference<T>::type&& t) noexcept {
static_assert(!std::is_lvalue_reference<T>(), "error");
return static_cast<T&&>(t);
}
/**
* @ingroup meta
* @brief constexpr enabled alternative to `std::move`.
*
* @param t variable to move
* @tparam T Type of parameter being enabled to be moved.
* @return `static_cast<RemoveRef<T>&&>(t)`.
*/
template<typename T>
constexpr typename std::remove_reference<T>::type&& cmove(T&& t) noexcept {
return static_cast<typename std::remove_reference<T>::type&&>(t);
}
} // meta
} // gears
#endif // GEARS_META_UTILITY_HPP
| [
"rapptz@gmail.com"
] | rapptz@gmail.com |
1eca96dafb078224b50cdc0fdcf73ce9641b9eb6 | 3886504fcbb5d7b12397998592cbafb874c470eb | /sdk/include/inspurcloud/oss/model/PostVodPlaylistRequest.h | 77d2ed7b844466a8224ee3aaa8e747224eaeaae6 | [
"Apache-2.0"
] | permissive | OpenInspur/inspur-oss-cpp-sdk | 1c9ff9c4de58f42db780a165059862bf52a2be8b | a0932232aaf46aab7c5a2079f72d80cc5d634ba2 | refs/heads/master | 2022-12-04T15:14:11.657799 | 2020-08-13T03:29:37 | 2020-08-13T03:29:37 | 286,946,985 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 905 | h | #pragma once
#include <inspurcloud/oss/Export.h>
#include <inspurcloud/oss/OssRequest.h>
#include <inspurcloud/oss/Types.h>
#include <inspurcloud/oss/model/ObjectMetaData.h>
#include <inspurcloud/oss/http/HttpType.h>
namespace InspurCloud
{
namespace OSS
{
class INSPURCLOUD_OSS_EXPORT PostVodPlaylistRequest : public LiveChannelRequest
{
public:
PostVodPlaylistRequest(const std::string& bucket, const std::string& channelName,
const std::string& playList, uint64_t startTime, uint64_t endTime);
void setPlayList(const std::string& playList);
void setStartTime(uint64_t startTime);
void setEndTime(uint64_t endTime);
protected:
virtual ParameterCollection specialParameters() const;
virtual int validate() const;
private:
std::string playList_;
uint64_t startTime_;
uint64_t endTime_;
};
}
}
| [
"wangtengfei@inspur.com"
] | wangtengfei@inspur.com |
8875a4571748919ee9c5222c025dd1d2e7062231 | 8dc84558f0058d90dfc4955e905dab1b22d12c08 | /third_party/pdfium/core/fpdfapi/parser/cpdf_syntax_parser.cpp | 245617dca1f29e9765022db714fc84c6dc6460b0 | [
"LGPL-2.0-or-later",
"GPL-1.0-or-later",
"MIT",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference",
"BSD-3-Clause"
] | permissive | meniossin/src | 42a95cc6c4a9c71d43d62bc4311224ca1fd61e03 | 44f73f7e76119e5ab415d4593ac66485e65d700a | refs/heads/master | 2022-12-16T20:17:03.747113 | 2020-09-03T10:43:12 | 2020-09-03T10:43:12 | 263,710,168 | 1 | 0 | BSD-3-Clause | 2020-05-13T18:20:09 | 2020-05-13T18:20:08 | null | UTF-8 | C++ | false | false | 20,682 | cpp | // Copyright 2016 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
#include "core/fpdfapi/parser/cpdf_syntax_parser.h"
#include <algorithm>
#include <sstream>
#include <utility>
#include <vector>
#include "core/fpdfapi/cpdf_modulemgr.h"
#include "core/fpdfapi/parser/cpdf_array.h"
#include "core/fpdfapi/parser/cpdf_boolean.h"
#include "core/fpdfapi/parser/cpdf_crypto_handler.h"
#include "core/fpdfapi/parser/cpdf_dictionary.h"
#include "core/fpdfapi/parser/cpdf_name.h"
#include "core/fpdfapi/parser/cpdf_null.h"
#include "core/fpdfapi/parser/cpdf_number.h"
#include "core/fpdfapi/parser/cpdf_read_validator.h"
#include "core/fpdfapi/parser/cpdf_reference.h"
#include "core/fpdfapi/parser/cpdf_stream.h"
#include "core/fpdfapi/parser/cpdf_string.h"
#include "core/fpdfapi/parser/fpdf_parser_decode.h"
#include "core/fpdfapi/parser/fpdf_parser_utility.h"
#include "core/fxcrt/autorestorer.h"
#include "core/fxcrt/cfx_binarybuf.h"
#include "core/fxcrt/fx_extension.h"
#include "third_party/base/numerics/safe_math.h"
#include "third_party/base/ptr_util.h"
namespace {
enum class ReadStatus { Normal, Backslash, Octal, FinishOctal, CarriageReturn };
} // namespace
// static
int CPDF_SyntaxParser::s_CurrentRecursionDepth = 0;
CPDF_SyntaxParser::CPDF_SyntaxParser() = default;
CPDF_SyntaxParser::~CPDF_SyntaxParser() = default;
bool CPDF_SyntaxParser::GetCharAt(FX_FILESIZE pos, uint8_t& ch) {
AutoRestorer<FX_FILESIZE> save_pos(&m_Pos);
m_Pos = pos;
return GetNextChar(ch);
}
bool CPDF_SyntaxParser::ReadBlockAt(FX_FILESIZE read_pos) {
if (read_pos >= m_FileLen)
return false;
size_t read_size = CPDF_ModuleMgr::kFileBufSize;
FX_SAFE_FILESIZE safe_end = read_pos;
safe_end += read_size;
if (!safe_end.IsValid() || safe_end.ValueOrDie() > m_FileLen)
read_size = m_FileLen - read_pos;
m_pFileBuf.resize(read_size);
if (!m_pFileAccess->ReadBlock(m_pFileBuf.data(), read_pos, read_size)) {
m_pFileBuf.clear();
return false;
}
m_BufOffset = read_pos;
return true;
}
bool CPDF_SyntaxParser::GetNextChar(uint8_t& ch) {
FX_FILESIZE pos = m_Pos + m_HeaderOffset;
if (pos >= m_FileLen)
return false;
if (!IsPositionRead(pos) && !ReadBlockAt(pos))
return false;
ch = m_pFileBuf[pos - m_BufOffset];
m_Pos++;
return true;
}
bool CPDF_SyntaxParser::GetCharAtBackward(FX_FILESIZE pos, uint8_t* ch) {
pos += m_HeaderOffset;
if (pos >= m_FileLen)
return false;
if (!IsPositionRead(pos)) {
FX_FILESIZE block_start = 0;
if (pos >= CPDF_ModuleMgr::kFileBufSize)
block_start = pos - CPDF_ModuleMgr::kFileBufSize + 1;
if (!ReadBlockAt(block_start) || !IsPositionRead(pos))
return false;
}
*ch = m_pFileBuf[pos - m_BufOffset];
return true;
}
bool CPDF_SyntaxParser::ReadBlock(uint8_t* pBuf, uint32_t size) {
if (!m_pFileAccess->ReadBlock(pBuf, m_Pos + m_HeaderOffset, size))
return false;
m_Pos += size;
return true;
}
void CPDF_SyntaxParser::GetNextWordInternal(bool* bIsNumber) {
m_WordSize = 0;
if (bIsNumber)
*bIsNumber = true;
ToNextWord();
uint8_t ch;
if (!GetNextChar(ch))
return;
if (PDFCharIsDelimiter(ch)) {
if (bIsNumber)
*bIsNumber = false;
m_WordBuffer[m_WordSize++] = ch;
if (ch == '/') {
while (1) {
if (!GetNextChar(ch))
return;
if (!PDFCharIsOther(ch) && !PDFCharIsNumeric(ch)) {
m_Pos--;
return;
}
if (m_WordSize < sizeof(m_WordBuffer) - 1)
m_WordBuffer[m_WordSize++] = ch;
}
} else if (ch == '<') {
if (!GetNextChar(ch))
return;
if (ch == '<')
m_WordBuffer[m_WordSize++] = ch;
else
m_Pos--;
} else if (ch == '>') {
if (!GetNextChar(ch))
return;
if (ch == '>')
m_WordBuffer[m_WordSize++] = ch;
else
m_Pos--;
}
return;
}
while (1) {
if (m_WordSize < sizeof(m_WordBuffer) - 1)
m_WordBuffer[m_WordSize++] = ch;
if (!PDFCharIsNumeric(ch)) {
if (bIsNumber)
*bIsNumber = false;
}
if (!GetNextChar(ch))
return;
if (PDFCharIsDelimiter(ch) || PDFCharIsWhitespace(ch)) {
m_Pos--;
break;
}
}
}
ByteString CPDF_SyntaxParser::ReadString() {
uint8_t ch;
if (!GetNextChar(ch))
return ByteString();
std::ostringstream buf;
int32_t parlevel = 0;
ReadStatus status = ReadStatus::Normal;
int32_t iEscCode = 0;
while (1) {
switch (status) {
case ReadStatus::Normal:
if (ch == ')') {
if (parlevel == 0)
return ByteString(buf);
parlevel--;
} else if (ch == '(') {
parlevel++;
}
if (ch == '\\')
status = ReadStatus::Backslash;
else
buf << static_cast<char>(ch);
break;
case ReadStatus::Backslash:
if (ch >= '0' && ch <= '7') {
iEscCode = FXSYS_DecimalCharToInt(static_cast<wchar_t>(ch));
status = ReadStatus::Octal;
break;
}
if (ch == '\r') {
status = ReadStatus::CarriageReturn;
break;
}
if (ch == 'n') {
buf << '\n';
} else if (ch == 'r') {
buf << '\r';
} else if (ch == 't') {
buf << '\t';
} else if (ch == 'b') {
buf << '\b';
} else if (ch == 'f') {
buf << '\f';
} else if (ch != '\n') {
buf << static_cast<char>(ch);
}
status = ReadStatus::Normal;
break;
case ReadStatus::Octal:
if (ch >= '0' && ch <= '7') {
iEscCode =
iEscCode * 8 + FXSYS_DecimalCharToInt(static_cast<wchar_t>(ch));
status = ReadStatus::FinishOctal;
} else {
buf << static_cast<char>(iEscCode);
status = ReadStatus::Normal;
continue;
}
break;
case ReadStatus::FinishOctal:
status = ReadStatus::Normal;
if (ch >= '0' && ch <= '7') {
iEscCode =
iEscCode * 8 + FXSYS_DecimalCharToInt(static_cast<wchar_t>(ch));
buf << static_cast<char>(iEscCode);
} else {
buf << static_cast<char>(iEscCode);
continue;
}
break;
case ReadStatus::CarriageReturn:
status = ReadStatus::Normal;
if (ch != '\n')
continue;
break;
}
if (!GetNextChar(ch))
break;
}
GetNextChar(ch);
return ByteString(buf);
}
ByteString CPDF_SyntaxParser::ReadHexString() {
uint8_t ch;
if (!GetNextChar(ch))
return ByteString();
std::ostringstream buf;
bool bFirst = true;
uint8_t code = 0;
while (1) {
if (ch == '>')
break;
if (std::isxdigit(ch)) {
int val = FXSYS_HexCharToInt(ch);
if (bFirst) {
code = val * 16;
} else {
code += val;
buf << static_cast<char>(code);
}
bFirst = !bFirst;
}
if (!GetNextChar(ch))
break;
}
if (!bFirst)
buf << static_cast<char>(code);
return ByteString(buf);
}
void CPDF_SyntaxParser::ToNextLine() {
uint8_t ch;
while (GetNextChar(ch)) {
if (ch == '\n')
break;
if (ch == '\r') {
GetNextChar(ch);
if (ch != '\n')
--m_Pos;
break;
}
}
}
void CPDF_SyntaxParser::ToNextWord() {
uint8_t ch;
if (!GetNextChar(ch))
return;
while (1) {
while (PDFCharIsWhitespace(ch)) {
if (!GetNextChar(ch))
return;
}
if (ch != '%')
break;
while (1) {
if (!GetNextChar(ch))
return;
if (PDFCharIsLineEnding(ch))
break;
}
}
m_Pos--;
}
ByteString CPDF_SyntaxParser::GetNextWord(bool* bIsNumber) {
const CPDF_ReadValidator::Session read_session(GetValidator().Get());
GetNextWordInternal(bIsNumber);
ByteString ret;
if (!GetValidator()->has_read_problems())
ret = ByteString(m_WordBuffer, m_WordSize);
return ret;
}
ByteString CPDF_SyntaxParser::PeekNextWord(bool* bIsNumber) {
AutoRestorer<FX_FILESIZE> save_pos(&m_Pos);
return GetNextWord(bIsNumber);
}
ByteString CPDF_SyntaxParser::GetKeyword() {
return GetNextWord(nullptr);
}
std::unique_ptr<CPDF_Object> CPDF_SyntaxParser::GetObjectBody(
CPDF_IndirectObjectHolder* pObjList) {
const CPDF_ReadValidator::Session read_session(GetValidator().Get());
auto result = GetObjectBodyInternal(pObjList, ParseType::kLoose);
if (GetValidator()->has_read_problems())
return nullptr;
return result;
}
std::unique_ptr<CPDF_Object> CPDF_SyntaxParser::GetObjectBodyInternal(
CPDF_IndirectObjectHolder* pObjList,
ParseType parse_type) {
AutoRestorer<int> restorer(&s_CurrentRecursionDepth);
if (++s_CurrentRecursionDepth > kParserMaxRecursionDepth)
return nullptr;
FX_FILESIZE SavedObjPos = m_Pos;
bool bIsNumber;
ByteString word = GetNextWord(&bIsNumber);
if (word.GetLength() == 0)
return nullptr;
if (bIsNumber) {
FX_FILESIZE SavedPos = m_Pos;
ByteString nextword = GetNextWord(&bIsNumber);
if (bIsNumber) {
ByteString nextword2 = GetNextWord(nullptr);
if (nextword2 == "R") {
uint32_t refnum = FXSYS_atoui(word.c_str());
if (refnum == CPDF_Object::kInvalidObjNum)
return nullptr;
return pdfium::MakeUnique<CPDF_Reference>(pObjList, refnum);
}
}
m_Pos = SavedPos;
return pdfium::MakeUnique<CPDF_Number>(word.AsStringView());
}
if (word == "true" || word == "false")
return pdfium::MakeUnique<CPDF_Boolean>(word == "true");
if (word == "null")
return pdfium::MakeUnique<CPDF_Null>();
if (word == "(") {
ByteString str = ReadString();
return pdfium::MakeUnique<CPDF_String>(m_pPool, str, false);
}
if (word == "<") {
ByteString str = ReadHexString();
return pdfium::MakeUnique<CPDF_String>(m_pPool, str, true);
}
if (word == "[") {
auto pArray = pdfium::MakeUnique<CPDF_Array>();
while (std::unique_ptr<CPDF_Object> pObj =
GetObjectBodyInternal(pObjList, ParseType::kLoose)) {
pArray->Add(std::move(pObj));
}
return (parse_type == ParseType::kLoose || m_WordBuffer[0] == ']')
? std::move(pArray)
: nullptr;
}
if (word[0] == '/') {
return pdfium::MakeUnique<CPDF_Name>(
m_pPool,
PDF_NameDecode(ByteStringView(m_WordBuffer + 1, m_WordSize - 1)));
}
if (word == "<<") {
std::unique_ptr<CPDF_Dictionary> pDict =
pdfium::MakeUnique<CPDF_Dictionary>(m_pPool);
while (1) {
ByteString word = GetNextWord(nullptr);
if (word.IsEmpty())
return nullptr;
FX_FILESIZE SavedPos = m_Pos - word.GetLength();
if (word == ">>")
break;
if (word == "endobj") {
m_Pos = SavedPos;
break;
}
if (word[0] != '/')
continue;
ByteString key = PDF_NameDecode(word.AsStringView());
if (key.IsEmpty() && parse_type == ParseType::kLoose)
continue;
std::unique_ptr<CPDF_Object> pObj =
GetObjectBodyInternal(pObjList, ParseType::kLoose);
if (!pObj) {
if (parse_type == ParseType::kLoose)
continue;
ToNextLine();
return nullptr;
}
if (!key.IsEmpty()) {
ByteString keyNoSlash(key.raw_str() + 1, key.GetLength() - 1);
pDict->SetFor(keyNoSlash, std::move(pObj));
}
}
FX_FILESIZE SavedPos = m_Pos;
ByteString nextword = GetNextWord(nullptr);
if (nextword != "stream") {
m_Pos = SavedPos;
return std::move(pDict);
}
return ReadStream(std::move(pDict));
}
if (word == ">>")
m_Pos = SavedObjPos;
return nullptr;
}
std::unique_ptr<CPDF_Object> CPDF_SyntaxParser::GetIndirectObject(
CPDF_IndirectObjectHolder* pObjList,
ParseType parse_type) {
const CPDF_ReadValidator::Session read_session(GetValidator().Get());
const FX_FILESIZE saved_pos = GetPos();
bool is_number = false;
ByteString word = GetNextWord(&is_number);
if (!is_number || word.IsEmpty()) {
SetPos(saved_pos);
return nullptr;
}
const uint32_t parser_objnum = FXSYS_atoui(word.c_str());
word = GetNextWord(&is_number);
if (!is_number || word.IsEmpty()) {
SetPos(saved_pos);
return nullptr;
}
const uint32_t parser_gennum = FXSYS_atoui(word.c_str());
if (GetKeyword() != "obj") {
SetPos(saved_pos);
return nullptr;
}
std::unique_ptr<CPDF_Object> pObj =
GetObjectBodyInternal(pObjList, parse_type);
if (pObj) {
pObj->SetObjNum(parser_objnum);
pObj->SetGenNum(parser_gennum);
}
return GetValidator()->has_read_problems() ? nullptr : std::move(pObj);
}
unsigned int CPDF_SyntaxParser::ReadEOLMarkers(FX_FILESIZE pos) {
unsigned char byte1 = 0;
unsigned char byte2 = 0;
GetCharAt(pos, byte1);
GetCharAt(pos + 1, byte2);
if (byte1 == '\r' && byte2 == '\n')
return 2;
if (byte1 == '\r' || byte1 == '\n')
return 1;
return 0;
}
std::unique_ptr<CPDF_Stream> CPDF_SyntaxParser::ReadStream(
std::unique_ptr<CPDF_Dictionary> pDict) {
const CPDF_Number* pLenObj = ToNumber(pDict->GetDirectObjectFor("Length"));
FX_FILESIZE len = pLenObj ? pLenObj->GetInteger() : -1;
// Locate the start of stream.
ToNextLine();
FX_FILESIZE streamStartPos = m_Pos;
const ByteStringView kEndStreamStr("endstream");
const ByteStringView kEndObjStr("endobj");
bool bSearchForKeyword = true;
if (len >= 0) {
pdfium::base::CheckedNumeric<FX_FILESIZE> pos = m_Pos;
pos += len;
if (pos.IsValid() && pos.ValueOrDie() < m_FileLen)
m_Pos = pos.ValueOrDie();
m_Pos += ReadEOLMarkers(m_Pos);
memset(m_WordBuffer, 0, kEndStreamStr.GetLength() + 1);
GetNextWordInternal(nullptr);
// Earlier version of PDF specification doesn't require EOL marker before
// 'endstream' keyword. If keyword 'endstream' follows the bytes in
// specified length, it signals the end of stream.
if (memcmp(m_WordBuffer, kEndStreamStr.raw_str(),
kEndStreamStr.GetLength()) == 0) {
bSearchForKeyword = false;
}
}
if (bSearchForKeyword) {
// If len is not available, len needs to be calculated
// by searching the keywords "endstream" or "endobj".
m_Pos = streamStartPos;
FX_FILESIZE endStreamOffset = 0;
while (endStreamOffset >= 0) {
endStreamOffset = FindTag(kEndStreamStr, 0);
// Can't find "endstream".
if (endStreamOffset < 0)
break;
// Stop searching when "endstream" is found.
if (IsWholeWord(m_Pos - kEndStreamStr.GetLength(), m_FileLen,
kEndStreamStr, true)) {
endStreamOffset = m_Pos - streamStartPos - kEndStreamStr.GetLength();
break;
}
}
m_Pos = streamStartPos;
FX_FILESIZE endObjOffset = 0;
while (endObjOffset >= 0) {
endObjOffset = FindTag(kEndObjStr, 0);
// Can't find "endobj".
if (endObjOffset < 0)
break;
// Stop searching when "endobj" is found.
if (IsWholeWord(m_Pos - kEndObjStr.GetLength(), m_FileLen, kEndObjStr,
true)) {
endObjOffset = m_Pos - streamStartPos - kEndObjStr.GetLength();
break;
}
}
// Can't find "endstream" or "endobj".
if (endStreamOffset < 0 && endObjOffset < 0)
return nullptr;
if (endStreamOffset < 0 && endObjOffset >= 0) {
// Correct the position of end stream.
endStreamOffset = endObjOffset;
} else if (endStreamOffset >= 0 && endObjOffset < 0) {
// Correct the position of end obj.
endObjOffset = endStreamOffset;
} else if (endStreamOffset > endObjOffset) {
endStreamOffset = endObjOffset;
}
len = endStreamOffset;
int numMarkers = ReadEOLMarkers(streamStartPos + endStreamOffset - 2);
if (numMarkers == 2) {
len -= 2;
} else {
numMarkers = ReadEOLMarkers(streamStartPos + endStreamOffset - 1);
if (numMarkers == 1) {
len -= 1;
}
}
if (len < 0)
return nullptr;
pDict->SetNewFor<CPDF_Number>("Length", static_cast<int>(len));
}
m_Pos = streamStartPos;
// Read up to the end of the buffer. Note, we allow zero length streams as
// we need to pass them through when we are importing pages into a new
// document.
len = std::min(len, m_FileLen - m_Pos - m_HeaderOffset);
if (len < 0)
return nullptr;
std::unique_ptr<uint8_t, FxFreeDeleter> pData;
if (len > 0) {
pData.reset(FX_Alloc(uint8_t, len));
ReadBlock(pData.get(), len);
}
auto pStream =
pdfium::MakeUnique<CPDF_Stream>(std::move(pData), len, std::move(pDict));
streamStartPos = m_Pos;
memset(m_WordBuffer, 0, kEndObjStr.GetLength() + 1);
GetNextWordInternal(nullptr);
int numMarkers = ReadEOLMarkers(m_Pos);
if (m_WordSize == static_cast<unsigned int>(kEndObjStr.GetLength()) &&
numMarkers != 0 &&
memcmp(m_WordBuffer, kEndObjStr.raw_str(), kEndObjStr.GetLength()) == 0) {
m_Pos = streamStartPos;
}
return pStream;
}
void CPDF_SyntaxParser::InitParser(
const RetainPtr<IFX_SeekableReadStream>& pFileAccess,
uint32_t HeaderOffset) {
ASSERT(pFileAccess);
return InitParserWithValidator(
pdfium::MakeRetain<CPDF_ReadValidator>(pFileAccess, nullptr),
HeaderOffset);
}
void CPDF_SyntaxParser::InitParserWithValidator(
const RetainPtr<CPDF_ReadValidator>& validator,
uint32_t HeaderOffset) {
ASSERT(validator);
m_pFileBuf.clear();
m_HeaderOffset = HeaderOffset;
m_FileLen = validator->GetSize();
m_Pos = 0;
m_pFileAccess = validator;
m_BufOffset = 0;
}
uint32_t CPDF_SyntaxParser::GetDirectNum() {
bool bIsNumber;
GetNextWordInternal(&bIsNumber);
if (!bIsNumber)
return 0;
m_WordBuffer[m_WordSize] = 0;
return FXSYS_atoui(reinterpret_cast<const char*>(m_WordBuffer));
}
bool CPDF_SyntaxParser::IsWholeWord(FX_FILESIZE startpos,
FX_FILESIZE limit,
const ByteStringView& tag,
bool checkKeyword) {
const uint32_t taglen = tag.GetLength();
bool bCheckLeft = !PDFCharIsDelimiter(tag[0]) && !PDFCharIsWhitespace(tag[0]);
bool bCheckRight = !PDFCharIsDelimiter(tag[taglen - 1]) &&
!PDFCharIsWhitespace(tag[taglen - 1]);
uint8_t ch;
if (bCheckRight && startpos + (int32_t)taglen <= limit &&
GetCharAt(startpos + (int32_t)taglen, ch)) {
if (PDFCharIsNumeric(ch) || PDFCharIsOther(ch) ||
(checkKeyword && PDFCharIsDelimiter(ch))) {
return false;
}
}
if (bCheckLeft && startpos > 0 && GetCharAt(startpos - 1, ch)) {
if (PDFCharIsNumeric(ch) || PDFCharIsOther(ch) ||
(checkKeyword && PDFCharIsDelimiter(ch))) {
return false;
}
}
return true;
}
bool CPDF_SyntaxParser::BackwardsSearchToWord(const ByteStringView& tag,
FX_FILESIZE limit) {
int32_t taglen = tag.GetLength();
if (taglen == 0)
return false;
FX_FILESIZE pos = m_Pos;
int32_t offset = taglen - 1;
while (1) {
if (limit && pos <= m_Pos - limit)
return false;
uint8_t byte;
if (!GetCharAtBackward(pos, &byte))
return false;
if (byte == tag[offset]) {
offset--;
if (offset >= 0) {
pos--;
continue;
}
if (IsWholeWord(pos, limit, tag, false)) {
m_Pos = pos;
return true;
}
}
offset = byte == tag[taglen - 1] ? taglen - 2 : taglen - 1;
pos--;
if (pos < 0)
return false;
}
}
FX_FILESIZE CPDF_SyntaxParser::FindTag(const ByteStringView& tag,
FX_FILESIZE limit) {
int32_t taglen = tag.GetLength();
int32_t match = 0;
limit += m_Pos;
FX_FILESIZE startpos = m_Pos;
while (1) {
uint8_t ch;
if (!GetNextChar(ch))
return -1;
if (ch == tag[match]) {
match++;
if (match == taglen)
return m_Pos - startpos - taglen;
} else {
match = ch == tag[0] ? 1 : 0;
}
if (limit && m_Pos == limit)
return -1;
}
return -1;
}
RetainPtr<IFX_SeekableReadStream> CPDF_SyntaxParser::GetFileAccess() const {
return m_pFileAccess;
}
bool CPDF_SyntaxParser::IsPositionRead(FX_FILESIZE pos) const {
return m_BufOffset <= pos &&
pos < static_cast<FX_FILESIZE>(m_BufOffset + m_pFileBuf.size());
}
| [
"arnaud@geometry.ee"
] | arnaud@geometry.ee |
7e77c55428f5ebc5b214b741cc9f932e1beba19d | 9250c1e4685b1bfb689325f2a3c58e933e738791 | /src/libs/fortD/irregAnalysis/Mall.h | bb547584ee1452be7c7f6114f77f606b5180108b | [] | no_license | canliture/DSystem | a58ba3ca867b16a69cd0e35125aeb66f20641f96 | 7810a6423ae4435d336374195743e1f0cec94b0c | refs/heads/master | 2023-03-15T22:54:11.021114 | 2020-11-17T18:08:36 | 2020-11-17T18:08:36 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,294 | h | /* $Id: Mall.h,v 1.3 1997/03/11 14:28:32 carr Exp $ */
/******************************************************************************/
/* Copyright (c) 1990, 1991, 1992, 1993, 1994 Rice University */
/* All Rights Reserved */
/******************************************************************************/
#ifndef Mall_h
#define Mall_h
/**********************************************************************
* class Mall
*/
/**********************************************************************
* Revision History:
* $Log: Mall.h,v $
* Revision 1.3 1997/03/11 14:28:32 carr
* newly checked in as revision 1.3
*
* Revision 1.3 94/03/21 13:02:26 patton
* fixed comment problem
*
* Revision 1.2 94/02/27 20:14:37 reinhard
* Added value-based distributions.
* Make CC happy.
* See /home/reinhard/rn/zzzgroup_src/libs/fort_d/irreg files for details.
*
* Revision 1.3 1994/02/27 19:44:05 reinhard
* Tweaks to make CC happy.
*
* Revision 1.2 1994/01/18 19:49:45 reinhard
* Updated include paths according to Makefile change.
* Handle value-based distributions.
*
* Revision 1.1 1993/09/25 15:39:09 reinhard
* Initial revision
*
*/
#ifndef context_h
#include <libs/support/database/context.h>
#endif
#ifndef FortTextTree_h
#include <libs/frontEnd/fortTextTree/FortTextTree.h>
#endif
//#ifndef Str_ht_h
//#include <Str_ht.h>
//#endif
#ifndef forttypes_h
#include <libs/frontEnd/ast/forttypes.h>
#endif
/*-------------------- EXTERNAL DECLARATIONS ----------------*/
class IrrSymTab;
class NamedGenericTable;
/*------------------- TYPES ---------------------------------*/
// The different types to be allocated dynamically
typedef int MallType;
// The different extensions for newly created variables
enum ExtType { TypeIndex, // "i$type", "f$type"
WorkArray, // "i$wrk"
WorkArraySize, // "i$wrk_size"
Index, // "x$ind"
Size, // "x$size"
NewSizeTemp // "$newsize"
};
/*------------------- CONSTANTS -----------------------------*/
// Based on include/fort/forttypes.h
static const int MallType_cnt = TYPE_LOGICAL + 2;
extern const char *MallType_names[];
extern const char *MallType_prefix_strs[];
extern const char MallType_prefixes[];
extern const int MallType_asts[];
extern const char *Ext_names[];
/**********************************************************************
* class Mall_entry declaration
*/
class Mall_entry
{
public:
Mall_entry(const char *my_name, // Constructor
const char *my_index_id,
const char *my_size_id,
int my_type);
~Mall_entry(); // Destructor
// Access functions
const char *getName() const { return name; }
const char *getIndex_id() const { return index_id; }
const char *getSize_id() const { return size_id; }
int getType() const { return type; }
private:
const char *index_id; // "x$ind"
const char *name; // "x"
const char *size_id; // "x$size"
int type; // "1" = Integer
};
/**********************************************************************
* class Mall declaration
*/
class Mall
{
public:
Mall(); // Constructor
~Mall(); // Destructor
// Access functions
AST_INDEX getRoot_node() const { return root_node; }
void convert(FortTree my_ft, FortTextTree my_ftt,
IrrSymTab *my_st = NULL);
private:
Boolean check_module (); // (Type-)check module
void find_init_calls(); // Find initialization calls
void find_alloc_calls(); // Find allocation calls
Mall_entry *gen_alloc(int type, // Generate alloc
const char *name,
AST_INDEX size_node,
AST_INDEX &stmt_node);
void find_resize_calls(); // Find resizing calls
void convert_refs(); // Convert references
void delete_decls(); // Delete extra declarations
int prefix2type(char prefix); // Map prefix to type
Boolean is_mall_call(AST_INDEX node,
const char *pattern, int arg_cnt,
int &type, AST_INDEX &args_list);
// Private fields
NamedGenericTable *dyn_arrs; // Set of dynamic arrays
AST_INDEX free_node; // Node for deallocation calls
FortTree ft; // Fortran tree
FortTextTree ftt; // Text/structure of FortTree
AST_INDEX init_node[MallType_cnt]; // Node for init calls
const char *new_size_temp_name; // "$newsize"
Boolean own_st; // We have our own st
AST_INDEX root_node; // Root of program AST
IrrSymTab *st; // Access to symbol table info
const char *type_ident_name[MallType_cnt]; // "i$type"
const char *wrk_ident_name[MallType_cnt]; // "i$wrk"
AST_INDEX wrk_ident_node[MallType_cnt]; // "i$wrk"
const char *wrk_size_name[MallType_cnt]; // "i$wrk_size"
AST_INDEX wrk_size_node[MallType_cnt]; // "i$wrk_size"
};
typedef Mall *Mall_ptr;
// IrrSymTab.h included at end (instead of beginning) to avoid dep cycle
//#ifndef IrrSymTab_h
//#include <libs/fort_d/irreg/IrrSymTab.h>
//#endif
#endif
| [
"carr"
] | carr |
b54c87d8d8f77497a9b678d9a84a735d2189ad8f | ae25fa735ec1e5c0aa002cc22e1658376972d17c | /src/server/server-entry.hpp | b257ee0bbb8bdc3bb04d4628da0110418cbde0d7 | [
"BSD-3-Clause"
] | permissive | TailinZhou/non_iid_dml | 889917f48f990cfe628ab45b9d3f6f39131d4981 | ddc3111a355f62877cafbbba03998f203d1350e5 | refs/heads/master | 2023-01-02T12:16:04.996046 | 2020-10-22T19:18:41 | 2020-10-22T19:18:41 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,825 | hpp | #ifndef __server_entry_hpp__
#define __server_entry_hpp__
/*
* Copyright (c) 2016, Anonymous Institution.
* 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 University 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
* HOLDERS 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 <boost/shared_ptr.hpp>
#include "common/router-handler.hpp"
using std::string;
using std::vector;
using std::cerr;
using std::cout;
using std::endl;
using boost::shared_ptr;
class ServerThreadEntry {
uint channel_id;
uint num_channels;
uint process_id;
uint num_processes;
boost::shared_ptr<zmq::context_t> zmq_ctx;
GeePsConfig config;
public:
ServerThreadEntry(
uint channel_id, uint num_channels,
uint process_id, uint num_processes,
boost::shared_ptr<zmq::context_t> zmq_ctx,
const GeePsConfig& config) :
channel_id(channel_id), num_channels(num_channels),
process_id(process_id), num_processes(num_processes),
zmq_ctx(zmq_ctx),
config(config) {
}
void operator()() {
server_entry(
channel_id, num_channels, process_id, num_processes, zmq_ctx, config);
}
private:
void server_entry(
uint channel_id, uint num_channels,
uint process_id, uint num_processes,
shared_ptr<zmq::context_t> zmq_ctx,
const GeePsConfig& config);
};
#endif // defined __server_entry_hpp__
| [
"kevhsieh@microsoft.com"
] | kevhsieh@microsoft.com |
c913eef20571352bfc7b249e358de27161c09ade | b206579e4098b2cfa376f7cc34743717c63f7cf3 | /Direct3DGame/33_SCAExport_1/SMatrixExporter.cpp | 011c523b50c0e7ce764b23101a7fbf65b4e9af1b | [] | no_license | seoaplo/02_Direct3DGame | b4c1a751e72517dec06b1052830e7f27a69afebb | 88d4615ecc3bac7ffdce86ca4391104064567ca1 | refs/heads/master | 2021-11-28T05:07:04.367958 | 2021-09-05T13:50:56 | 2021-09-05T13:50:56 | 201,198,261 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,349 | cpp | #include "SMatrixExporter.h"
void SMatrixExporter::Convert()
{
m_MatrixManager.Release();
SAExporter::CreateMaterialList();
m_MatrixManager.SetSize(g_iNodeMaxNum);
for (auto& pNode : SAExporter::g_NodeList)
{
int iMaterialNum = SAExporter::FindMaterial(pNode.first);
m_MatrixManager.AddObject(pNode.first, g_Scene, g_Interval, pNode.second, iMaterialNum);
}
}
bool SMatrixExporter::Export()
{
m_pStream = nullptr;
_wfopen_s(&m_pStream, m_filename.c_str(), _T("wb"));
if (m_pStream == nullptr) return false;
ExportHeader(m_pStream);
m_MatrixManager.ExportObject(m_pStream);
fclose(m_pStream);
MessageBox(GetActiveWindow(), m_filename.c_str(),
_T("Succeed!"), MB_OK);
return true;
}
bool SMatrixExporter::Release()
{
SAExporter::Release();
m_MatrixManager.Release();
return true;
}
void SMatrixExporter::ExportHeader(FILE* pStream)
{
if (m_pStream == nullptr) return;
g_Scene.iNumMaterials = g_MaterialManager.m_MaterialList.size();
g_Scene.iNumObjects = m_MatrixManager.m_ObjectList.size();
_ftprintf(m_pStream, _T("%s"), _T("MatrixExporter100"));
_ftprintf(m_pStream, _T("\n%s %d %d %d %d %d"),
L"#HEADERINFO",
g_Scene.iFirstFrame,
g_Scene.iLastFrame,
g_Scene.iFrameSpeed,
g_Scene.iTickPerFrame,
g_Scene.iNumObjects);
}
SMatrixExporter::SMatrixExporter()
{
}
SMatrixExporter::~SMatrixExporter()
{
}
| [
"seoxx@naver.com"
] | seoxx@naver.com |
c7d28dbd791f6436164bc305858645b5b24e29ca | 0358887bf64831f158c278a5c0cce18e94751d1a | /gardenDrone/Pumps.ino | 07a4448a1cd89ca503ac880ea02cc105fad017dc | [] | no_license | disgustipated/GardenDrone | fb16663a5b50467af2e09a0ad49bd35e4e2b8a6d | c073e0ef5c78363c1177d449d0cd5aed58ec0cdf | refs/heads/master | 2023-06-21T15:15:33.748703 | 2021-07-24T18:02:43 | 2021-07-24T18:02:43 | 387,055,282 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 768 | ino | void pumpRunning()
{
//should the pump be running
currMillis = millis();
if ((digitalRead(PUMP_ACTIVATE_PIN) == LOW) && (currMillis > (deviceActivateStart + ACTIVATE_DURATION))){
stopPump();
}
}
void activatePump()
{
deviceActivateStart = millis();
server.send(200,"text/plain", "OK");
Serial.print("Activating deviceActivateStart = ");
Serial.println(deviceActivateStart);
Serial.println(deviceActivateStart + ACTIVATE_DURATION);
digitalWrite(PUMP_ACTIVATE_PIN, LOW); //reversed these to prevent relay from going on during a reboot
digitalWrite(WIFI_INFO_LED_PIN,LOW);
}
void stopPump()
{
Serial.println("Stopping pump");
digitalWrite(PUMP_ACTIVATE_PIN, HIGH);
digitalWrite(WIFI_INFO_LED_PIN,HIGH);
}
| [
"disgustipated@erasethis.net"
] | disgustipated@erasethis.net |
2d180d7a193643eb4d3c904b499920e72168c38e | 092f83af8daf07844bef4f5c61b1ca7d298488b8 | /bins/binary_to_cpp/src/binary_to_cpp.cpp | 91a5468dfee37876ab100a2bec0d1dd5aa1d50c8 | [
"MIT"
] | permissive | tiaanl/red5 | 1fd0d1ab0f86f8f70fc27d8b7b072d1eb1e956ad | ea7593b38f61f64f8aeb7d58854106bd58c05736 | refs/heads/main | 2023-01-07T05:11:57.569662 | 2020-11-14T19:19:46 | 2020-11-14T19:19:46 | 305,490,400 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,332 | cpp | #include <spdlog/spdlog.h>
#include <filesystem>
#include <fstream>
#include <iostream>
namespace fs = std::filesystem;
int main(int argc, char** argv) {
if (argc < 3) {
std::cout << "USAGE: " << argv[0] << " <binary-file> <cpp-file>";
return 0;
}
fs::path binaryPath{argv[1]};
fs::path cppPath{argv[2]};
spdlog::info("Converting {} to {}", binaryPath.string(), cppPath.string());
std::vector<char> buffer;
{
std::ifstream stream{binaryPath, std::ios::binary};
stream.seekg(0, std::ios::end);
auto fileSize = stream.tellg();
stream.seekg(0);
buffer.resize(fileSize);
stream.read(buffer.data(), buffer.size());
}
if (buffer.empty()) {
spdlog::error("Could not read file or file is empty: {}", binaryPath.string());
return 1;
}
std::string name{fs::path{cppPath}.replace_extension("").filename().string()};
std::replace(std::begin(name), std::end(name), '-', '_');
{
std::ofstream stream{cppPath, std::ios::binary};
stream << "extern const unsigned char " << name << "[];\n";
stream << "const unsigned char " << name << "[] = {";
for (char ch : buffer) {
stream << "0x" << std::hex << std::setw(2) << std::setfill('0')
<< static_cast<uint16_t>(static_cast<uint8_t>(ch)) << ",";
}
stream << "};";
}
return 0;
}
| [
"tiaanl@gmail.com"
] | tiaanl@gmail.com |
77b5e308536e733a4ca74ca385e817e69007a081 | 3635df8d74077ff1d51e468f545d21a7a73a584e | /Anima/OS/TimerFactory.h | f999ff4c3d51b24deb050bfe6b3c6aa75ae2e960 | [] | no_license | edamiani/Anima-Engine | 2615ee632b10e35dceb82b902661acd988aa9396 | 14b99b71bf5ea5c4b19d08037ca56298a36f6288 | refs/heads/master | 2021-12-14T10:38:18.883495 | 2021-12-02T20:08:08 | 2021-12-02T20:08:08 | 18,024,642 | 4 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 518 | h | #ifndef __AE_OS_TIMER_FACTORY__
#define __AE_OS_TIMER_FACTORY__
#include "Anima/Types.h"
namespace AE
{
namespace OS
{
class Timer;
class TimerPeriodic;
class TimerSimple;
class TimerListener;
class TimerFactory
{
public:
TimerFactory() {}
virtual ~TimerFactory() {}
virtual AE::OS::TimerPeriodic* createTimerPeriodic(AE::ulong startInterval, AE::ulong periodicInterval, AE::OS::TimerListener *timerListener) = 0;
virtual AE::OS::TimerSimple* createTimerSimple() = 0;
};
}
}
#endif
| [
"edamiani@gmail.com"
] | edamiani@gmail.com |
bb24fa8ae0a07072edfc58258c2ce26ff1329b7a | a05443c2b5c3b0dae53a860cc67e36bb47d92868 | /MyProjectGit/2020-09-20_DomaskaEkzamen_1599922752/GameDigits/GameDigits.h | 87457fbf3acf12a09892dd084dcd082cb9484f19 | [] | no_license | novice-bicycle-mechanic/training-project | 24bb582b3f685e67f481159084531579f961266e | 0191be0d7627538abd9aff356a1730f91506d400 | refs/heads/master | 2022-12-18T22:33:30.334349 | 2020-09-23T17:14:29 | 2020-09-23T17:14:29 | 254,652,160 | 1 | 0 | null | null | null | null | WINDOWS-1251 | C++ | false | false | 9,304 | h | // GameDigits.h
#pragma once
#include <iostream>
#include <conio.h>
#include "GameDigits_Table.h"
// КЛАСС Игра Цифры
class GameDigits {
private:
Table table;
public:
// КОНСТРУКТОР по умолчанию
GameDigits(){}
// МЕТОД ведения игры
void go() {
// ключ на удаление сочетающихся цифр
bool deleteCombinedDigits = false;
// ключ на показ/скрытие справки
bool showHelp{ true };
// ключ на показ/скрытие правил игры
bool showRulesGame{ true };
char byte1char = 0; // первый байт кода символа / нажатия клавиши
char byte2char = 0; // второй байт кода символа / нажатия клавиши
enum keysC { // коды нажатий клавиш (byte1char)
NL = 10, Enter = 13, ESC = 27, SPACE = 32
};
enum keys0 { // коды нажатий клавиш (byte2char, byte1char == 0)
F1 = 59, F2, F3, F4, F5, F6, F7, F8
};
enum keysN32 { // коды нажатий клавиш (byte2char и byte1char == N32 == -32)
N32 = -32, UP = 72, LEFT = 75, RIGHT = 77, DOWN = 80,
CTRL_LEFT = 115, CTRL_RIGHT = 116, CTRL_UP = -115, CTRL_DOWN = -111
};
do
{
system("cls");
if (showHelp) help();
if (showRulesGame) rulesGame();
std::cout << table << std::endl;
// обработка нажатий клавиш
byte1char = _getch();
if (_kbhit()) byte2char = _getch();
// нажато Esc - выход из игры
if (byte1char == keysC::ESC) break;
// Проверка ключа удаления
// сочетающихся цифр
else if (deleteCombinedDigits) {
// если нажато Enter - удалить
// выделенные сочетающиеся цифры
// и, при необходимости, сжать таблицу
if (byte1char == keysC::Enter) {
table.getCaptureDigit().deletingCombinedDigits();
table.getPathToCapturedDigit().removeMarkPath();
}
else {
// иначе обнулить ключ
deleteCombinedDigits = false;
// и снять выделение сочетаемой цифры и пути до нее
table.getCaptureDigit().deselectCombinedDigit();
table.getPathToCapturedDigit().removeMarkPath();
}
}
// нажата стрелка "вверх"
// - сдвиг курсора ВВЕРХ
if ((byte1char == keysN32::N32)
&& (byte2char == keysN32::UP)
) {
table.getCursor().shiftUp();
}
// нажата стрелка "вниз"
// - сдвиг курсора ВНИЗ
else if ((byte1char == keysN32::N32)
&& (byte2char == keysN32::DOWN)
) {
table.getCursor().shiftDown();
}
// нажата стрелка "влево"
// - сдвиг курсора ВЛЕВО
else if ((byte1char == keysN32::N32)
&& (byte2char == keysN32::LEFT)
) {
table.getCursor().shiftLeft();
}
// нажата стрелка "вправо"
// - сдвиг курсора ВПРАВО
else if ((byte1char == keysN32::N32)
&& (byte2char == keysN32::RIGHT)
) {
table.getCursor().shiftRight();
}
// нажаты Ctrl+Right (Right - стрелка "вправо")
// - захват сочетающейся цифры СПРАВА
else if ((byte1char == keysN32::N32)
&& (byte2char == keysN32::CTRL_RIGHT)
) {
deleteCombinedDigits =
table.getCaptureDigit().captureDigitRight();
if (deleteCombinedDigits) {
table.getPathToCapturedDigit().setMarkPath();
}
}
// нажаты Ctrl+Left (Left - стрелка "влево")
// - захват сочетающейся цифры СЛЕВА
else if ((byte1char == keysN32::N32)
&& (byte2char == keysN32::CTRL_LEFT)
) {
deleteCombinedDigits =
table.getCaptureDigit().captureDigitLeft();
if (deleteCombinedDigits) {
table.getPathToCapturedDigit().setMarkPath();
}
}
// нажаты Ctrl+Down (Down - стрелка "вниз")
// - захват сочетающейся цифры СНИЗУ
else if ((byte1char == keysN32::N32)
&& (byte2char == keysN32::CTRL_DOWN)
) {
deleteCombinedDigits =
table.getCaptureDigit().captureDigitDown();
if (deleteCombinedDigits) {
table.getPathToCapturedDigit().setMarkPath();
}
}
// нажаты Ctrl+Up (Up - стрелка "вверх")
// - захват сочетающейся цифры СВЕРХУ
else if ((byte1char == keysN32::N32)
&& (byte2char == keysN32::CTRL_UP)
) {
deleteCombinedDigits =
table.getCaptureDigit().captureDigitUp();
if (deleteCombinedDigits) {
table.getPathToCapturedDigit().setMarkPath();
}
}
// нажата F1 - показ / скрытие справки
else if ((byte1char == 0)
&& (byte2char == keys0::F1)
) {
showHelp = !showHelp;
}
// нажата F2 - показ / скрытие правил игры
else if ((byte1char == 0)
&& (byte2char == keys0::F2)
) {
showRulesGame = !showRulesGame;
}
// нажата F4 - трансформация таблицы
else if ((byte1char == 0)
&& (byte2char == keys0::F4)
) {
table.transformTable();
}
} while (true);
}
// МЕТОД вывода на экран справки
void help() const {
std::cout
<< " Игра \"Цифры\" - удали все цифры!\n"
<< " Удаляются пары сочетающихся цифр - равных или суммой равных 10\n"
<< " [Esc]-выход из программы [F1]-показать/скрыть справку\n"
<< " [F2]-показать/скрыть правила игры\n"
<< " Стрелки: [Вправо],[Влево],[Вверх],[Вниз]-движение курсора\n"
<< " [Ctrl]+[Стрелка]-захват сочетающейся цифры в направлении стрелки\n"
<< " после [Ctrl]+[Стрелка] - [Enter]-удалить выделенные цифры\n"
<< " - любое другое нажатие - отмена захвата\n"
<< " [F4]-трансформация таблицы - дописание оставшихся цифр в конец\n"
<< std::endl;
}
// МЕТОД вывода на экран правил игры
void rulesGame() const {
std::cout
<< " Правила игры\n"
<< " 1.На листе бумаги пишутся цифры чисел от 1 по 19, кроме 10\n"
<< " (1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19),\n"
<< " в таблицу шириной 9 цифр:\n"
<< " 123456789\n"
<< " 111213141\n"
<< " 516171819\n"
<< "\n"
<< " 2.Находятся и стираются пары ближайших соседних сочетаемых цифр.\n"
<< " Ближайшими соседними цифрами относительно рассматриваемой являются:\n"
<< " 1) граничащие слева, справа, сверху, снизу;\n"
<< " 2) ближайшие, расположенные слева, справа, сверху, снизу\n"
<< " и разделенные только стертыми цифрами.\n"
<< " Также ближайшими соседними цифрами являются последняя нестертая\n"
<< " цифра строки и первая нестертая цифра следующей строки (вариант\n"
<< " соседства слева - справа).\n"
<< " Цифры сочетаются, если:\n"
<< " 1) они равны (1=1, 2=2, 3=3, 4=4, 5=5, 6=6, 7=7, 8=8, 9=9);\n"
<< " 2) сумма цифр равна 10 (1+9, 2+8, 3+7, 4+6, 5+5).\n"
<< "\n"
<< " 3.Когда все пары сочетаемых цифр стерты, оставшиеся нестертые\n"
<< " цифры дописываются в таблицу (шириной 9 цифр), сразу после\n"
<< " последней имеющейся ранее цифры. И игра продолжается дальше.\n"
<< " Пример:\n"
<< " до добавления:\n"
<< " _234567__\n"
<< " ____1314_\n"
<< " 5_617181_\n"
<< " после добавления:\n"
<< " _234567__\n"
<< " ____1314_\n"
<< " 5_617181_\n"
<< " 234567131\n"
<< " 45617181\n"
<< "\n"
<< " 4.Цель игры - стереть все цифры.\n"
<< std::endl;
}
};
// Конец КЛАССА Игра Цифры
| [
"noreply@github.com"
] | novice-bicycle-mechanic.noreply@github.com |
335af772765766a62b3e4b4873525e247df283cb | 04d392d79a7bacc69952398403773756bfacc1f1 | /PackingGeneration/Core/Headers/Types.h | 799ff028386785d8723c1bfb2f6956f5c7252b91 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | Tontonis/packing-generation | 2e93ee28fac1506a5ca44841102778112acbb717 | e3ba06d3581461763247baf9744e9c175eafae23 | refs/heads/master | 2021-01-20T04:39:56.530770 | 2017-03-29T15:05:39 | 2017-03-29T15:05:39 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,009 | h | // Copyright (c) 2013 Vasili Baranau
// Distributed under the MIT software license
// See the accompanying file License.txt or http://opensource.org/licenses/MIT
#ifndef Core_Headers_Types_h
#define Core_Headers_Types_h
#include <boost/array.hpp>
// TODO: Move to Core namespace and Constants.h
const int DIMENSIONS = 3;
// Use typedef instead of #define, as they may lead to better compiler checks
namespace Core
{
#ifdef SINGLE_PRECISION
typedef float FLOAT_TYPE;
#else
typedef double FLOAT_TYPE;
#endif
typedef int INT_TYPE;
struct Axis
{
enum Type
{
X = 0,
Y = 1,
Z = 2
};
};
typedef boost::array<int, DIMENSIONS> DiscreteSpatialVector;
typedef boost::array<FLOAT_TYPE, DIMENSIONS> SpatialVector;
// NOTE: the types below are not so fundamental. May be move somewhere?
template<class T>
struct Nullable
{
T value;
bool hasValue;
};
}
#endif /* Core_Headers_Types_h */
| [
"bas1l@mail.ru"
] | bas1l@mail.ru |
9291014448ae323b4b5bc6bfa4be705f3e2d2209 | 8ff9ac12d33c773349654fcd5296392b090dfe87 | /main.cpp | 4b4f0b7f6b6b5d90091dbdc381a0b2ce36fba7f3 | [] | no_license | mostafa-hussein/A-star-algorithm | f17402571afbb4ed28bc6c7ee646db182ecd0987 | 8e72cb78c73281ecb12de50e24e888a035ffc436 | refs/heads/master | 2022-04-01T23:53:53.112035 | 2020-02-07T22:00:39 | 2020-02-07T22:00:39 | 111,221,833 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 14,939 | cpp | #include <stdlib.h>
#include <iostream>
#include <stdio.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <string.h>
#include <arpa/inet.h>
// #include <unistd.h>
#define PORT 4000
using namespace std;
struct link
{
int id;
int f;
int g;
int h;
int x;
int y;
link* next;
link* prev;
link* parent;
};
class linklist
{
private:
link * first;
link * end;
public:
int count;
linklist()
{
first = NULL;
end =NULL;
count=0;
}
link* get (int id)
{
link* current=first;
while (current!=NULL) {
if (current->id == id) {
return current;
}
current = current->next;
break;
}
}
void getpath(int path[][3])
{
int c=0;
link* current=first;
path[0][0]=c;
while(current !=NULL )
{
path[0][0]= ++c ;
path[c][0]=current->x;
path[c][1]=current->y;
cout<<path[c][0]<<"\t"<<path[c][1]<<endl;
current=current->parent;
}
}
void check1 (int child[][5]) //open list 3
{
for (int i = 1; i <=child[0][0] ; ++i) {
link* current = first;
while (current!=NULL)
{
if( child[i][0]==current->x && child[i][1]==current->y && current->f < child[i][2] )
child[i][3]=0;
else
child[i][3]=1;
current=current->next;
}
}
}
void check2 (int child[][5]) //closed list 4
{
for (int i = 1; i <=child[0][0] ; ++i) {
link* current = first;
while (current!=NULL)
{
if( child[i][0]==current->x && child[i][1]==current->y && current->f <child[i][2] )
child[i][4]=0;
else
child[i][4]=1;
current=current->next;
}
}
}
void additem(int g,int h,int x,int y,link* p)
{
count++;
if ( first == NULL && end==NULL )
{
link* newlink = new link;
newlink->id= count;
newlink->x = x;
newlink->y = y;
newlink->g = g;
newlink->h = h;
newlink->parent=p;
newlink->f=g+h;
newlink->next = NULL;
newlink->prev=NULL;
first = newlink;
end=newlink;
}
else
{
int d=g+h;
if (d <= first->f )
{
link* newlink = new link;
newlink->id= count;
newlink->g = g;
newlink->h = h;
newlink->parent=p;
newlink->x = x;
newlink->y = y;
newlink->f=g+h;
newlink->next=first;
newlink->prev=NULL;
first->prev=newlink;
first =newlink;
}
else if ( d >= end->f )
{
link* newlink = new link;
newlink->id= count;
newlink->g = g;
newlink->h = h;
newlink->parent=p;
newlink->x = x;
newlink->y = y;
newlink->f=g+h;
newlink->next=NULL;
newlink->prev=end;
end->next=newlink;
end=newlink;
}
else
{
link* current = first;
while( current != NULL )
{
if( d<current->f || (d==current->f && g<=current->g))
{
link* newlink = new link;
newlink->id= count;
newlink->g = g;
newlink->h = h;
newlink->parent=p;
newlink->x = x;
newlink->y = y;
newlink->f=g+h;
newlink->next=current;
newlink->prev=current->prev;
current->prev->next=newlink;
current->prev=newlink;
break;
}
if( d==current->f && g>current->g)
{
current=current->next;
link* newlink = new link;
newlink->id= count;
newlink->g = g;
newlink->parent=p;
newlink->x = x;
newlink->y = y;
newlink->h = h;
newlink->f=g+h;
newlink->next=current;
newlink->prev=current->prev;
current->prev->next=newlink;
current->prev=newlink;
break;
}
current = current->next;
}
}
}
arrange();
}
void display()
{
link* current = first;
while( current != NULL )
{
cout<<current <<"\t"<<current->id<<"\t"<< current->f<<"\t" <<current->x <<"\t"<<current->y <<"\t"<<current->parent <<endl;
current = current->next;
}
}
void arrange()
{
link* current = first;
for(int i=0 ; i<count ; i++)
{
current->id=i+1;
current = current->next;
}
}
void remove(int i)
{
if (count==1)
{
first=end=NULL;
}
else if (i==1)
{
first=first->next;
first->prev=NULL;
}
else if (i==count)
{
end=end->prev;
end->next=NULL;
}
else
{
link* current = first;
while( current != NULL )
{
if(i==current->id)
{
current->prev->next=current->next;
current->next->prev=current->prev;
break;
}
current = current->next;
}
}
count--;
this->arrange();
}
};
void display(int path[][3],char path_letter[],int startx, int starty,int goalx,int goaly,int staticop[][2],int dynamicop[][2],int sizex,
int sizey,int n_of_st,int n_of_dy);
void sethuristic (int huristic[][6],int goalx, int goaly,int staticop[][2],int n_of_st);
int dist(int sx,int sy,int gx , int gy);
void genrate (int px, int py ,int child[][5]);
void path_convereter(int path[][3],char tmp[]);
void a_star (int startx, int starty,int goalx,int goaly,int staticop[][2],int dynamicop[][2],int sizex,
int sizey,int path[][3],int n_of_st,int n_of_dy);
void setprob (int n_hist ,int history[][2] ,int size ,int prob [][3]);
int main()
{
int startx=0 , starty=4 , goalx=5 , goaly=5;
int sizex=6;
int sizey=6;
int n_of_st=2;
int n_of_dy=2;
int staticop[2][2]={{0,5},{1,5}};
int dynamicop[2][2]={{0,5},{1,5}};
int path[50][3];
a_star(startx,starty,goalx,goaly,staticop,dynamicop,sizex,sizey,path,n_of_st,n_of_dy);
char path_letter[path[0][0]];
path_convereter(path,path_letter);
display(path,path_letter,startx,starty,goalx,goaly,staticop,dynamicop,sizex,sizey,n_of_st,n_of_dy);
for (int i = 1; i <=path[0][0] ; ++i) {
cout<<path[i][0]<<"\t"<<path[i][1]<<endl;
}
return 0;
}
void setprob (int n_hist ,int history[][2] ,int size ,int prob [][3])
{
}
void a_star (int startx, int starty,int goalx,int goaly,int staticop[][2],int dynamicop[][2],int sizex,
int sizey,int path[][3],int n_of_st,int n_of_dy)
{
const int x=6,y=6;
bool solved= 0;
int child[x-1][y-1];
linklist openlist,closedlist;
int huristic [x][y];
sethuristic(huristic,goalx,goaly,staticop,n_of_st);
openlist.additem(0,huristic[startx][starty],startx,starty,NULL);
int c=1;
while (openlist.count>0 && !solved && c)
{
//c--;
openlist.arrange();
link* node=openlist.get(1);
openlist.remove(1);
genrate(node->x,node->y,child);
for (int i = 1; i <= child[0][0] ; ++i)
{
if(child[i][0]==goalx && child[i][1]==goaly)
{
cout<<"Goal reached \n";
solved=1;
break;
}
child[i][2]=node->g+1+huristic[child[i][0]][child[i][1]];
openlist.check1(child);
closedlist.check2(child);
}
for (int i = 1; i <= child[0][0] ; ++i)
{
if(child[i][3]==1 && child[i][4]==1)
openlist.additem(node->g+1,huristic[child[i][0]][child[i][1]],child[i][0],child[i][1],node);
}
closedlist.additem(node->g,node->h,node->x,node->y,node->parent);
cout <<"openlist \n";
openlist.display();
cout <<"closedlist \n";
closedlist.display();
}
openlist.getpath(path);
}
void path_convereter(int path[][3],char tmp[])
{
int count=-1;
for (int i = path[0][0]; i >0; --i)
{
count++;
if(path[i][0]==path[i-1][0] && path[i-1][1]-path[i][1]>0)
tmp[count]='r';
if(path[i][0]==path[i-1][0] && path[i-1][1]-path[i][1]<0)
tmp[count]='l';
if(path[i][1]==path[i-1][1] && path[i-1][0]-path[i][0]>0)
tmp[count]='d';
if(path[i][1]==path[i-1][1] && path[i-1][0]-path[i][0]<0)
tmp[count]='u';
}
tmp[count]='G';
}
void genrate (int px, int py ,int child[][5])
{
int id;
for (int i = 0; i <5 ; ++i)
for (int j = 0; j <5 ; ++j)
child[i][j]=1;
child[0][0]=0;
if(px+1>=0 && px+1 <=5) {
id=++child[0][0];
child[id][0] = px + 1;
child[id][1] = py;
}
if(px-1>=0 && px-1 <=5) {
id=++child[0][0];
child[id][0] = px - 1;
child[id][1] = py;
}
if(py+1>=0 && py+1 <=5) {
id=++child[0][0];
child[id][0] = px;
child[id][1] = py+1;
}
if(py-1>=0 && py-1 <=5) {
id=++child[0][0];
child[id][0] = px;
child[id][1] = py-1;
}
}
void sethuristic (int huristic[][6],int goalx, int goaly,int staticop[][2],int n_of_st)
{
for (int i = 0; i <6 ; ++i) {
for (int j = 0; j <6; ++j) {
huristic[i][j]=dist(i,j,goalx,goaly)+10;
}
}
huristic[goalx][goaly]=0;
for (int k = 0; k <n_of_st; ++k) {
huristic[staticop[k][0]][staticop[k][1]]=1000;
}
/*for (int i = 0; i < 6; ++i) {
for (int j = 0; j < 6 ; ++j) {
cout<<huristic[i][j]<<"\t";
}
cout<<endl;
}*/
}
int dist(int sx,int sy,int gx , int gy)
{
return abs(gy-sy)+abs(gx-sx);
}
void display(int path[][3],char path_letter[],int startx, int starty,int goalx,int goaly,int staticop[][2],int dynamicop[][2],int sizex,
int sizey,int n_of_st,int n_of_dy)
{
char map[6][6];
for (int i = 0; i <sizex; ++i)
for (int j = 0; j <sizey; ++j)
map[i][j]='-';
for (int i =path[0][0]; i >0 ; --i)
map[path[i][0]][path[i][1]]='*';
for (int i =0; i <n_of_st ; ++i)
map[staticop[i][0]][staticop[i][1]]='#';
map[startx][starty]='S';
map[goalx][goaly]='G';
cout<<"Path from the start to goal \n";
for (int i = 0; i <sizex; ++i) {
for (int j = 0; j < sizey; ++j)
cout << map[i][j] << "\t";
cout << endl;
}
cout<<"Full path in letters ---->";
for (int j = 0; j < path[0][0]; ++j)
cout<<path_letter[j];
for (int i = 0; i <sizex; ++i)
for (int j = 0; j <sizey; ++j)
map[i][j]='-';
map[startx][starty]='S';
map[goalx][goaly]='G';
int t=0;
for (int i =path[0][0]; i >0 ; --i)
{
map[path[i][0]][path[i][1]] = path_letter[t];
t++;
}
for (int i =0; i <n_of_st ; ++i)
map[staticop[i][0]][staticop[i][1]]='#';
cout<<"\npath from the start to goal wirh direcions \n";
for (int i = 0; i <sizex; ++i) {
for (int j = 0; j < sizey; ++j)
cout << map[i][j] << "\t";
cout << endl;
}
}
| [
"eng.mostafa_2005@aun.edu.eg"
] | eng.mostafa_2005@aun.edu.eg |
6d468b7bcd4628cb86e5f8bc1cf20f8a0f919d56 | e3e0769670f50de27467a8f99f409f61acf313d2 | /inc/lexer.hpp | 5db617f37e6c42a3586fdbe59a866933f8877f9e | [] | no_license | anko9801/ArowCompiler | c0387d6b13a09621f42aa8a3fc00c1881c438ede | 40e574c8817d925a08da440a5bbcc87bf6a5a5a2 | refs/heads/master | 2021-10-14T07:11:30.333625 | 2019-02-02T06:37:17 | 2019-02-02T06:37:17 | 155,954,392 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,641 | hpp | #ifndef LEXER_HPP
#define LEXER_HPP
#include<cstdio>
#include<cstdlib>
#include<fstream>
#include<list>
#include<string>
#include<vector>
#include"APP.hpp"
/**
* トークン種別
*/
enum TokenType{
TOK_IDENTIFIER, //識別子
TOK_DIGIT, //数字
TOK_FLOAT,
TOK_STRING,
TOK_TRUTH,
TOK_IMPORT,
TOK_SYMBOL, //記号
TOK_TYPE, //型
TOK_IF,
TOK_WHILE,
TOK_FOR,
TOK_MATCH,
TOK_ASYNC,
TOK_AWAIT,
TOK_RETURN, //RETURN
TOK_CAST,
TOK_NL,
TOK_EOF //EOF
};
/**
*個別トークン格納クラス
*/
typedef class Token{
public:
private:
std::string TokenString;
TokenType Type;
std::string DataType;
int Number;
bool Bool;
int Line;
std::string Filename;
public:
Token(std::string string, TokenType type, int line, std::string filename)
: TokenString(string), Type(type), Line(line), Filename(filename) {
if (type == TOK_DIGIT || type == TOK_FLOAT) {
if (string[0] == '0' && string[1] == 'b') {
string.erase(string.begin(), string.begin() + 2);
Number = strtol(string.c_str(), NULL, 2);
}else{
Number = atof(string.c_str());
}
}else{
Number = 0x7fffffff;
}
if (type == TOK_TRUTH)
Bool = true;
else
Bool = false;
};
~Token() {};
TokenType getTokenType() {return Type;};
std::string getTokenDataType() {return DataType;};
std::string getTokenString() {return TokenString;};
int getNumberValue() {return Number;};
bool getBoolValue() {return Bool;}
bool setLine(int line) {Line = line;return true;}
int getLine() {return Line;}
std::string getFile() {return Filename;}
}Token;
/**
* 切り出したToken格納用クラス
*/
class TokenStream{
public:
private:
std::vector<Token*> Tokens;
int CurIndex;
protected:
public:
TokenStream():CurIndex(0) {}
~TokenStream();
bool ungetToken(int Times=1);
bool getNextToken();
bool pushToken(Token *token) {
Tokens.push_back(token);
return true;
}
Token getToken();
TokenType getCurType() {return Tokens[CurIndex]->getTokenType();}
std::string getCurDataType() {return Tokens[CurIndex]->getTokenDataType();}
std::string getCurString() {return Tokens[CurIndex]->getTokenString();}
int getCurNumVal() {return Tokens[CurIndex]->getNumberValue();}
bool getCurBoolVal() {return Tokens[CurIndex]->getBoolValue();}
bool printTokens();
int getCurIndex() {return CurIndex;}
int getLine() {return Tokens[CurIndex]->getLine()+1;}
std::string getFile() {return Tokens[CurIndex]->getFile();}
bool applyTokenIndex(int index) {CurIndex = index;return true;}
private:
protected:
};
TokenStream *LexicalAnalysis(std::string input_filename);
#endif
| [
"daiusa3@icloud.com"
] | daiusa3@icloud.com |
6a894f97da48c1566c538a8d02ecc19ea1f23b98 | ce7a67334e51fbfbecc46a04300de04695506d7e | /Sources/Internal/Network/Base/IPAddress.h | 4044b5fc3a26a15175041fa5cd76eb87420d0452 | [] | no_license | dava-bot/dava.framework | 2b2cd60d419fe3948a48da2ae43142ff24016ee2 | 295c279990b7302be8e7f91eb0899399c118b825 | refs/heads/development | 2020-12-24T19:18:09.877267 | 2015-03-13T15:07:03 | 2015-03-13T15:07:03 | 32,009,964 | 4 | 0 | null | 2015-03-11T09:48:13 | 2015-03-11T09:48:12 | null | UTF-8 | C++ | false | false | 3,563 | h | /*==================================================================================
Copyright(c) 2008, binaryzebra
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 binaryzebra 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 binaryzebra 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 binaryzebra 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 __DAVAENGINE_IPADDRESS_H__
#define __DAVAENGINE_IPADDRESS_H__
#include <libuv/uv.h>
#include <Base/BaseTypes.h>
namespace DAVA
{
namespace Net
{
/*
Class IPAddress represents IPv4 address.
IPAddress can be constructed from 32-bit integer or from string.
Requirements on string IPAddress should be constructed from:
- must be in the form XXX.XXX.XXX.XXX with no more than 3 decimal digits in a group
- each group can contain only decimal numbers from 0 to 255 with no starting zeros
Also address can be converted to string.
IPAddress accepts and returns numeric parameters in host byte order
*/
class IPAddress
{
public:
IPAddress(uint32 address = 0);
IPAddress(const char8* address);
uint32 ToUInt() const;
bool IsUnspecified() const;
bool IsMulticast() const;
bool ToString(char8* buffer, size_t size) const;
String ToString() const;
static IPAddress FromString(const char8* addr);
friend bool operator == (const IPAddress& left, const IPAddress& right);
private:
uint32 addr;
};
//////////////////////////////////////////////////////////////////////////
inline IPAddress::IPAddress(uint32 address) : addr(htonl(address))
{
}
inline uint32 IPAddress::ToUInt() const
{
return ntohl(addr);
}
inline bool IPAddress::IsUnspecified() const
{
return 0 == addr;
}
inline bool IPAddress::IsMulticast() const
{
return 0xE0000000 == (ToUInt() & 0xF0000000);
}
inline bool operator == (const IPAddress& left, const IPAddress& right)
{
return left.addr == right.addr;
}
inline bool operator < (const IPAddress& left, const IPAddress& right)
{
return left.ToUInt() < right.ToUInt();
}
} // namespace Net
} // namespace DAVA
#endif // __DAVAENGINE_IPADDRESS_H__
| [
"m_lazarev@wargaming.net"
] | m_lazarev@wargaming.net |
5c491d44347635876491e06678f089a27542a728 | 6d70bf6047e59bb02406885d0497cce3722808cd | /RosalindProblems/problem4/Problem4Solver.cpp | fa404d8a604da006af5b5dee1e47afb7e3823239 | [] | no_license | dteixeira/rosalind-problems | 2d83b7ff5a297bf81b12764d07bc22ae38af8c2f | 95cb89a239ebd58fed338c8b4431e0d658401a7c | refs/heads/master | 2021-05-26T12:17:03.316589 | 2013-09-03T14:58:45 | 2013-09-03T14:58:45 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,762 | cpp | #include "Problem4Solver.h"
Problem4Solver::Problem4Solver() : ISolver("problem4/")
{
}
Problem4Solver::~Problem4Solver()
{
}
bool Problem4Solver::solve()
{
if(!reader_->isFileOpen() || !writer_->isFileOpen())
return false;
else
{
// Read input data.
int nBytes = static_cast<int>(reader_->getFileSize());
std::unique_ptr<char[]> buffer(new char[nBytes * sizeof(char)]);
reader_->read(buffer.get(), nBytes);
reader_->closeFile();
std::stringstream sstream(std::string(buffer.get(), nBytes));
int nMonths = 0;
int nPairs = 0;
sstream >> nMonths >> nPairs;
// Compute the solution.
monthPairs_ = std::unique_ptr<long long[]>(new long long[nMonths + 1]);
std::fill(monthPairs_.get(), monthPairs_.get() + nMonths + 1, 0);
monthPairs_[1] = 1;
monthPairs_[2] = 1;
long long result = fibonacciSolveRecursive(nMonths, nPairs);
// Write answer.
std::array<char, 128> toWrite;
sprintf(toWrite.data(), "%lld", result);
writer_->write(toWrite.data(), strlen(toWrite.data()));
writer_->closeFile();
return true;
}
}
long long Problem4Solver::fibonacciSolveRecursive(int nMonths, int& nPairs)
{
if(!monthPairs_[nMonths])
{
if(!monthPairs_[nMonths - 1])
monthPairs_[nMonths - 1] = fibonacciSolveRecursive(nMonths - 1, nPairs);
if(!monthPairs_[nMonths - 2])
monthPairs_[nMonths - 2] = fibonacciSolveRecursive(nMonths - 2, nPairs);
monthPairs_[nMonths] = monthPairs_[nMonths - 1] + monthPairs_[nMonths - 2] * nPairs;
}
return monthPairs_[nMonths];
}
std::string Problem4Solver::getName()
{
return "Problem 4";
} | [
"diogo.andre.teixeira@gmail.com"
] | diogo.andre.teixeira@gmail.com |
b72559f772610976e6852902d550c5e582d29f0a | c1c4fd5ec7ff66bdac98297977674340e12ea79f | /tsinghua/inherited.cpp | a06780ae1f91d5ff1f63ce96cf03ba55a5f29b61 | [] | no_license | multicgu/cpp | 99822e78dd0fd0e0166b7aa704fb536b1854113e | 1331fbc975f27814acdfab6a6bb0266fc0a9da7e | refs/heads/master | 2021-01-10T06:54:34.863617 | 2016-04-11T07:01:06 | 2016-04-11T07:01:06 | 46,668,727 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 995 | cpp | #include<iostream>
using namespace std;
class point {
public:
void initpoint(float x, float y) {
this->x = x;
this->y = y;
}
void move(float offx,float offy) {
x += offx;
y += offy;
}
float getX() const {return x;}
float getY() const {return y;}
private:
float x,y;
};
//class rectangle: public point {
class rectangle: private point {
public:
void initrectangle(float x,float y,float w,float h) {
initpoint(x,y);
this->w = w;
this->h = h;
}
void move(float offx,float offy) {
point::move(offx,offy);
};
float getX() const {return point::getX();}
float getY() const {return point::getY();}
float getW() const {return w;}
float getH() const {return h;}
private:
float w,h;
};
int main() {
rectangle rect;
rect.initrectangle(2,3,20,10);
rect.move(3,2);
cout << "The data of rect(x,y,w,h)" << endl;
cout << rect.getX() << endl;
cout << rect.getY() << endl;
cout << rect.getW() << endl;
cout << rect.getH() << endl;
return 0;
}
| [
"root@multic.(none)"
] | root@multic.(none) |
be16e82ce1c2266ebdbcf45b9409e81ea4a1f24f | 14e18690460ab3fbfdaa24190838c4643dce0089 | /src/usDotx/us_usx_frame.h | b206d4357a08700c8c2c74fb120b94e10219a678 | [] | no_license | MrBigDog/MyProject | e864265b3e299bf6b3b05e3af33cbfcfd7d043ea | a0326b0d5f4c56cd8d269b3efbb61b402d61430c | refs/heads/master | 2021-09-10T21:56:22.886786 | 2018-04-03T01:10:57 | 2018-04-03T01:10:57 | 113,719,751 | 3 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,272 | h | ///////////////////////////////////////////////////////////////////////////
//
// This source file is part of Uniscope Virtual Globe
// Copyright (c) 2008-2009 by The Uniscope Team . All Rights Reserved
//
///////////////////////////////////////////////////////////////////////////
//
// Filename: us_usx_frame.h
// Author : Uniscope Team
// Modifier: Uniscope Team
// Created :
// Purpose : usx_frame class
// Reference :
//
///////////////////////////////////////////////////////////////////////////
#ifndef _US_USX_FRAME_H_
#define _US_USX_FRAME_H_
#include <usDotx/Export.h>
#include <usUtil/us_matrix4.h>
#include <usUtil/us_common_file.h>
namespace uniscope_globe
{
class usx_mesh;
class usx_animation;
class USDOTX_EXPORT usx_frame
{
public:
usx_frame(void);
virtual ~usx_frame(void);
usx_frame* find_frame(cpstr frame_name);
void reset(void);
void update_hierarchy(matrix4<double> in_mat);
usx_frame* clone(void);
public:
ustring m_name;
matrix4<double> m_original_mat;
matrix4<double> m_transform_mat;
matrix4<double> m_combined_mat;
usx_frame* m_frame_parent;
usx_frame* m_frame_sibling;
usx_frame* m_frame_first_child;
usx_animation* m_animation;
usx_mesh* m_mesh;
};
}
#endif // _US_USX_FRAME_H_ | [
"635669462@qq.com"
] | 635669462@qq.com |
4db4ff7665a6118e3c6952df9b614bcfea709d64 | 39d5249686d1b7c2fca9bc33be0c0f6949378bba | /test_ice_cpp/src/server.cpp | d906b2d406a2d4b16c14ae24ce12477db71d9d1b | [] | no_license | marcinlos/rozprochy | 1896526dd9dce89d3cc43fc26c9ecede2015d643 | 32cdc88552778a69ed5def499213b2c50e515f65 | refs/heads/master | 2021-01-22T13:57:27.657818 | 2014-09-06T14:21:09 | 2014-09-06T14:21:09 | 8,122,196 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,068 | cpp | #include <iostream>
#include <string>
#include <Ice/Ice.h>
#include "generated/Printer.h"
class PrinterI: public rozprochy::iiice::test::Printer
{
virtual void print(const std::string& text, const Ice::Current&)
{
std::cout << text << std::endl;
}
};
int main(int argc, char* argv[])
{
int status = 0;
Ice::CommunicatorPtr ic;
try
{
ic = Ice::initialize(argc, argv);
Ice::ObjectAdapterPtr adapter = ic->createObjectAdapterWithEndpoints(
"SimplePrinterAdapter", "default -p 10000");
Ice::ObjectPtr object = new PrinterI;
adapter->add(object, ic->stringToIdentity("SimplePrinter"));
adapter->activate();
ic->waitForShutdown();
}
catch (const Ice::Exception& e)
{
std::cerr << e << std::endl;
status = 1;
}
if (ic)
{
try
{
ic->destroy();
}
catch (const Ice::Exception& e)
{
std::cerr << e << std::endl;
status = 1;
}
}
return status;
}
| [
"losiu99@gazeta.pl"
] | losiu99@gazeta.pl |
27720b11794a0bc03d554e694835d489bc0638b0 | a2111a80faf35749d74a533e123d9da9da108214 | /raw/pmsb13/pmsb13-data-20130530/sources/6ndbc4zuiueuaiyv/2013-04-11T09-43-51.121+0200/sandbox/my_sandbox/apps/index_a2/index_a2.cpp | 13251213075b53f175b72a84513f756b54c797a4 | [
"MIT"
] | permissive | bkahlert/seqan-research | f2c550d539f511825842a60f6b994c1f0a3934c2 | 21945be863855077eec7cbdb51c3450afcf560a3 | refs/heads/master | 2022-12-24T13:05:48.828734 | 2015-07-01T01:56:22 | 2015-07-01T01:56:22 | 21,610,669 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 666 | cpp | #include <seqan/sequence.h>
#include <seqan/index.h>
using namespace seqan;
int main()
{
String<Dna5> genome = "ACGTACGTACGTN";
Index<String<Dna5>, IndexEsa<> > esaIndex(genome);
Finder<Index<String<Dna5>, IndexEsa<> > > esaFinder(esaIndex);
// String<char> text = "This is the first example";
// Index<String<char>, FMIndex<> > index(text);
/*
find(esaFinder, "ACGT"); // first occurrence of "ACGT"
position(esaFinder); // -> 0
find(esaFinder, "ACGT"); // second occurrence of "ACGT"
position(esaFinder); // -> 4
find(esaFinder, "ACGT"); // third occurrence of "ACGT"
position(esaFinder); // -> 8
*/
return 0;
}
| [
"mail@bkahlert.com"
] | mail@bkahlert.com |
56995fb31c5eac52ff855b3354364f79babcba83 | dd80a584130ef1a0333429ba76c1cee0eb40df73 | /dalvik/vm/mterp/c/OP_ADD_LONG_2ADDR.cpp | 4ae71bb66dad0f7b65d72deb81d36a3c7a1c63a1 | [
"LicenseRef-scancode-generic-cla",
"Apache-2.0",
"MIT"
] | permissive | karunmatharu/Android-4.4-Pay-by-Data | 466f4e169ede13c5835424c78e8c30ce58f885c1 | fcb778e92d4aad525ef7a995660580f948d40bc9 | refs/heads/master | 2021-03-24T13:33:01.721868 | 2017-02-18T17:48:49 | 2017-02-18T17:48:49 | 81,847,777 | 0 | 2 | MIT | 2020-03-09T00:02:12 | 2017-02-13T16:47:00 | null | UTF-8 | C++ | false | false | 62 | cpp | HANDLE_OP_X_LONG_2ADDR(OP_ADD_LONG_2ADDR, "add", +, 0)
OP_END
| [
"karun.matharu@gmail.com"
] | karun.matharu@gmail.com |
963dc43da22f6caf70f34a40c07092cfcc737a9c | ecbf53ba2ed807597173f35a52a4a0d191ae4669 | /src/PID.cpp | 508b0d433968acb3b020538dd2afb11788138f32 | [] | no_license | tigeryu8900/PID-controller | 90bcc8711af7655c1219fb73dd5f949c842a2a5a | 85d430d86c81d2b63c3f93107b52bc790dd8ffcf | refs/heads/master | 2020-06-14T04:32:26.337396 | 2019-07-04T22:31:51 | 2019-07-04T22:31:51 | 194,901,033 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,687 | cpp | //
// Created by tiger on 7/2/2019.
//
#include "PID.h"
namespace PID {
int64_t PID::nanos() {
return std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::time_point_cast<std::chrono::nanoseconds>(
(std::chrono::high_resolution_clock::now())).time_since_epoch()).count();
}
PID::PID(double setPoint, kpid_t kpid, double clampingLimit = -1, double cutoffFrequency = -1) :
_setPoint(setPoint), _kpid(kpid), _clampingLimit(clampingLimit), _lpf(cutoffFrequency) {
_startTime = _previousTime = nanos();
std::this_thread::sleep_for(std::chrono::milliseconds(2));
}
/*
double PID::next(double input) {
// std::cout << "input: " << input << std::endl;
if (_lpf.getCutOffFrequency() > 0) input = _lpf.update(input);
static double previousInput = input;
int64_t currentTime = nanos();
_integral += static_cast<double>(currentTime - _previousTime) * input;
double p = _setPoint - input;
double i = _setPoint - _integral / static_cast<double>(currentTime - _previousTime);
double d = (input - previousInput) * (_setPoint - (input + previousInput) / 2);
// std::cout << "input: " << input << " time lapse: " << currentTime - _previousTime << " p: " << p << " i: " << i << " d: " << d << std::endl;
// std::cout << "_setPoint: " << _setPoint << " _integral: " <<_integral << " elapsed time: " <<
// static_cast<double>(currentTime - _previousTime) << std::endl;
previousInput = input;
_previousTime = currentTime;
return p * _kpid.p + ((_clampingLimit > 0 && std::abs(i) > _clampingLimit) ? 0 : (i * _kpid.i)) + d * _kpid.d;
}
*/
double PID::next(double input) {
static double previousInput = input;
int64_t now = nanos();
/*Compute all the working error variables*/
double error = _setPoint - input;
double dInput = (input - previousInput);
_integral += (_kpid.i * error) - _kpid.p * dInput;
// if(outputSum > outMax) outputSum= outMax;
// else if(outputSum < outMin) outputSum= outMin;
/*Add Proportional on Error, if P_ON_E is specified*/
double output = _kpid.p * error + _integral - _kpid.d * dInput;
// if(output > outMax) output = outMax;
// else if(output < outMin) output = outMin;
/*Remember some variables for next time*/
previousInput = input;
_previousTime = now;
return output;
}
void PID::setkP(double value) {
_kpid.p = value;
}
void PID::setkI(double value) {
_kpid.i = value;
}
void PID::setkD(double value) {
_kpid.d = value;
}
void PID::setkpid(kpid_t value) {
_kpid = value;
}
kpid_t PID::getkpid() {
return _kpid;
}
void PID::setValue(double value) {
_setPoint = value;
}
double PID::getValue() {
return _setPoint;
}
} // namespace PID
| [
"tigeryu8900@gmail.com"
] | tigeryu8900@gmail.com |
6ab19ec82680188dc5204e705eb3c8751c0fa08e | 07c2844a6fd38fc39a109fd4577ddc99a19087ba | /Peta_ITB/garis.cpp | 4479e237e04c7bc6eb231115dd5e5a7757531f78 | [] | no_license | n4de4k/Grafika_Komputer | c1a089a3c0932585936126537eb0011dd6521f4c | c9704ccc11f17419d60c6728290b9111c8e90522 | refs/heads/master | 2021-09-09T04:07:06.889557 | 2018-03-13T18:27:30 | 2018-03-13T18:27:30 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,790 | cpp | #ifndef GARIS
#define GARIS
#include "./titik.cpp"
#include <utility>
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <fcntl.h>
#include <linux/fb.h>
#include <sys/mman.h>
#include <sys/ioctl.h>
using namespace std;
class Garis {
public :
Garis() {
}
Garis(Titik p, Titik q) {
(this->awal).setX(p.getX());
(this->awal).setY(p.getY());
(this->akhir).setX(q.getX());
(this->akhir).setY(q.getY());
}
Titik getAwal() {
return this->awal;
}
Titik getAkhir() {
return this->akhir;
}
void setAwal(Titik awal) {
this->awal = awal;
}
void setAkhir(Titik akhir) {
this->akhir = akhir;
}
pair<float, float> makeLine() {
float x1 = awal.getX() * 1.0;
float y1 = awal.getY() * 1.0;
float x2 = akhir.getX() * 1.0;
float y2 = akhir.getY() * 1.0;
float a,b;
if(x2 - x1 == 0){
a = 0;
b = 0;
} else {
a = (y2 - y1) / (x2 - x1);
b = y1 - (x1 * (y2 - y1) / (x2 - x1));
}
return make_pair(a, b);
}
void print(int divx, int divy, int r, int g, int b){
int fbfd = 0;
struct fb_var_screeninfo vinfo;
struct fb_fix_screeninfo finfo;
long int screensize = 0;
char *fbp = 0;
int x = 0, y = 0, timer = 0;
long int location = 0;
int maxY;
// Open the file for reading and writing
fbfd = open("/dev/fb0", O_RDWR);
if (fbfd == -1) {
perror("Error: cannot open framebuffer device");
exit(1);
}
//printf("The framebuffer device was opened successfully.\n");
// Get fixed screen information
if (ioctl(fbfd, FBIOGET_FSCREENINFO, &finfo) == -1) {
perror("Error reading fixed information");
exit(2);
}
// Get variable screen information
if (ioctl(fbfd, FBIOGET_VSCREENINFO, &vinfo) == -1) {
perror("Error reading variable information");
exit(3);
}
//printf("%dx%d, %dbpp\n", vinfo.xres, vinfo.yres, vinfo.bits_per_pixel);
// Figure out the size of the screen in bytes
screensize = vinfo.xres * vinfo.yres * vinfo.bits_per_pixel / 8;
// Map the device to memory
fbp = (char *)mmap(0, screensize, PROT_READ | PROT_WRITE, MAP_SHARED, fbfd, 0);
if (*fbp == -1) {
perror("Error: failed to map framebuffer device to memory");
exit(4);
}
int x0 = awal.getX();
int y0 = awal.getY();
int x1 = akhir.getX();
int y1 = akhir.getY();
int dx = abs(x1-x0), sx = x0<x1 ? 1 : -1;
int dy = abs(y1-y0), sy = y0<y1 ? 1 : -1;
int err = (dx>dy ? dx : -dy)/2, e2;
x0 += divx;
y0 += divy;
x1 += divx;
y1 += divy;
for(;;){
location = (x0+vinfo.xoffset) * (vinfo.bits_per_pixel/8) +
(y0+vinfo.yoffset) * finfo.line_length;
if(y0 > 10 && y0 < vinfo.yres -10 && x0 > 5 && x0 < vinfo.xres){ // escape seg fault
*(fbp + location) = b; // Some blue
*(fbp + location + 1) = g; // A little green
*(fbp + location + 2) = r; // A lot of red
*(fbp + location + 3) = 0; // No transparency
}
if (x0==x1 && y0==y1) break;
e2 = err;
if (e2 >-dx) { err -= dy; x0 += sx; }
if (e2 < dy) { err += dx; y0 += sy; }
}
munmap(fbp, screensize);
close(fbfd);
}
void rotate(float degree, Titik topLeft, Titik bottomRight) {
awal.rotate(degree, topLeft.getX(), topLeft.getY(), bottomRight.getX(), bottomRight.getY());
akhir.rotate(degree, topLeft.getX(), topLeft.getY(), bottomRight.getX(), bottomRight.getY());;
}
void scale(float scale, Titik topLeft, Titik bottomRight) {
awal.scale(scale, topLeft.getX(), topLeft.getY(), bottomRight.getX(), bottomRight.getY());
akhir.scale(scale, topLeft.getX(), topLeft.getY(), bottomRight.getX(), bottomRight.getY());
}
void scaleByTitik(float scale, Titik P) {
awal.scaleByTitik(scale, P);
akhir.scaleByTitik(scale, P);
}
void move(int h, int v, Titik topLeft, Titik bottomRight) {
awal.move(h,v,topLeft.getX(), topLeft.getY(), bottomRight.getX(), bottomRight.getY());
akhir.move(h,v,topLeft.getX(), topLeft.getY(), bottomRight.getX(), bottomRight.getY());
}
void geser(int x, int y){
awal.geser(x, y);
akhir.geser(x, y);
}
private :
Titik awal;
Titik akhir;
};
#endif | [
"leo112071@gmail.com"
] | leo112071@gmail.com |
59eca04ab9660a42342d828404b0ac38ddd43f56 | 2999c075c4e39d2f6d84e2281c90e8d925c800ee | /R-Type/ClientFinal/ClientFinal/GraphicalElem.h | 6d437b8b2996065404b6aaaf0432316a4cd53101 | [] | no_license | lelabo-m/R-Type | b69c31aae2c3451a508059e5980c8e3b5fb572a3 | 68933e5b979b6ae3ef0d9d2bc1b066212cc58391 | refs/heads/master | 2021-09-28T02:48:51.492494 | 2015-04-25T22:03:01 | 2015-04-25T22:03:01 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 673 | h | #ifndef GRAPHICALELEM_H_
#define GRAPHICALELEM_H_
#include "Vector2D.h"
#include "SFMLanimatedSprite.h"
class GraphicalElem
{
public:
GraphicalElem(const std::string& name, size_t classid, size_t id, size_t x, size_t y, size_t v);
const std::string& Name() const;
size_t Id() const;
size_t ClassId() const;
Vector2D& Position();
size_t Velocity() const;
size_t Animation() const;
SFMLanimation* GetAnimation();
void Play(size_t, bool loop = true);
void Draw();
private:
bool _loop;
std::string _name;
size_t _classid;
size_t _id;
Vector2D _pos;
size_t _velocity;
SFMLanimation* _animation;
};
#endif /* !GRAPHICALELEM_H_*/ | [
"christopher.millon@outlook.com"
] | christopher.millon@outlook.com |
b7f2bb12a4b7722b4d96271dacf71b881042a3a5 | 191bf92db1a9f6df7c30e37a8f0a14d1c220a3bd | /POSSPEW.cpp | 98d2d1eadcfa3c2d38e6dbf6bf935b4bc95984d4 | [] | no_license | doomsday861/Allofit | 958fa379296e1a4c9a78b25ab0fd7c222bb1f81a | 94d644e52a64ff2949ea731c569478e721fc71bf | refs/heads/master | 2023-01-04T12:35:10.447467 | 2022-12-28T09:30:18 | 2022-12-28T09:30:18 | 250,110,669 | 0 | 1 | null | 2021-01-11T09:20:21 | 2020-03-25T22:59:54 | C++ | UTF-8 | C++ | false | false | 1,439 | cpp | /**
* posspew codechef
**/
#include<bits/stdc++.h>
#define ll long long
#define testcase ll t;cin>>t;while(t--)
#define pb push_back
#define fi first
#define se second
#define vll vector<ll>
#define for0(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define for1(i, n) for (ll i = 1; i <= (ll)(n); ++i)
#define run ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl '\n'
#define bend(x) x.begin(),x.end()
using namespace std;
int main()
{
run
testcase{
ll n,k;
cin>>n>>k;
vll v(n);
ll sum =0;
for0(i,n)
{
cin>>v[i];
sum+=v[i];
}
if(sum==0)
{
cout<<0<<endl;
continue;
}
vll left(n,0);
vll right(n,0);
vll time(n,INT_MAX);
if(v[0]!=0)
left[0] = 1;
for1(i,2*n)
{
if(v[i%n]!=0)
{
left[i%n] = 0;
}
else
{
left[i%n] = left[(i-1)%n]+1;
}
}
if(v[n-1]!=0)
right[n-1] = 1;
for(ll i = 2*n-1;i>=0;i--)
{
if(v[i%n]!=0)
{
right[i%n] = 0;
}
else
{
right[i%n] = right[(i+1)%n]+1;
}
}
for0(i,n)
time[i] = min(right[i],left[i]);
// for(auto x:time)
// cout<<x<<" ";
// cout<<endl;
for0(i,n)
{
//cout<<k-time[i]<<" ";
sum += 2* max(0LL,k-time[i]);
}
cout<<sum<<endl;
}
return 0;
}
| [
"kartikeyasrivastava861@gmail.com"
] | kartikeyasrivastava861@gmail.com |
d428ae608e9bb7d8da194c3ef93e21e7d551e5cd | fa39a27d0915c551735418f69704bfc024b9cc49 | /C++/C++PrimerPlus/11/1/vector.h | 4dc1d3ee40c796612a631b4df0abac97d93e6248 | [] | no_license | fenneishi/learningCode | 99c125fa554079a9799fb7893d8d665b04cd7581 | cc95ac44d74e285065ad1cea84e057ba5f6c56d2 | refs/heads/master | 2020-04-29T11:50:54.746482 | 2019-03-17T15:05:23 | 2019-03-17T15:05:23 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,641 | h | #ifndef VECTOR_H_
#define VECTOR_H_
#include <iostream>
#include <fstream>
namespace VECTOR
{
class Vector
{
public:
enum Mode{RECT,POL};//RECT for rectangle,POL for Polar modes;
private:
Mode _mode;//RECT or POL
double _x;
double _y;
double _mag;//length
double _ang;//direction in degrees
//private methods for setting values
void _set_x();
void _set_y();
void _set_mag();
void _set_ang();
public:
// construct
Vector():_x(0),_y(0),_mag(0),_ang(0),_mode(RECT){};
Vector(double a,double b,Mode mode=RECT);
void reset(double a,double b,Mode mode=RECT);
// get Value
double getX()const{return _x;}
double getY()const{return _y;}
double getmag()const{return _mag;}
double getang()const{return _ang;}
// change mode
void toPOL(){_mode=POL;}
void toRECT(){_mode=RECT;}
// overload operator
Vector operator+(const Vector & v) const{return Vector(_x+v._x,_y+v._y);}
Vector operator-(const Vector & v) const{return Vector(_x-v._x,_y+v._y);}
Vector operator-() const{return Vector(-_x,-_y);};
Vector operator*(int num) const{return Vector(_x*num,_y*num);};
friend Vector operator*(int num,const Vector &v){return Vector(v._x*num,v._y*num);};
friend std::ostream & operator<<(std::ostream & os,const Vector & v);
friend std::ofstream & operator<<(std::ofstream & os,const Vector & v);
// destruct
~Vector(){};
};
} // VECTOR
# endif | [
"fenneishi@163.com"
] | fenneishi@163.com |
e25dd31be51ffbcda0be81d6de5d118cb75357e6 | 3a79a5211d34468f88e41cb9b9ca6110dcad6d26 | /Engine/include/Engine/Engine.h | 00c74cd1f1dde614886030b1451bc59d448a8988 | [
"MIT"
] | permissive | vazgriz/VoxelGameOld | 6e84c8fd50b452f29c5d5ec6398c41afe3f75744 | 28b85445dc64606aecd840c977fb0557008e37a0 | refs/heads/master | 2022-12-05T16:23:00.499974 | 2020-08-20T22:21:26 | 2020-08-20T22:21:26 | 233,920,335 | 7 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,034 | h | #pragma once
#include "Engine/Buffer.h"
#include "Engine/Camera.h"
#include "Engine/Clock.h"
#include "Engine/Mesh.h"
#include "Engine/Graphics.h"
#include "Engine/Image.h"
#include "Engine/Input.h"
#include "Engine/MemoryManager.h"
#include "Engine/Mesh.h"
#include "Engine/RenderGraph/RenderGraph.h"
#include "Engine/System.h"
#include "Engine/Window.h"
#include "FreeListAllocator.h"
namespace VoxelEngine {
class RenderGraph;
class Engine {
public:
Engine();
~Engine();
Graphics& getGraphics() { return *m_graphics; }
SystemGroup& getUpdateGroup() { return *m_updateGroup; }
RenderGraph& renderGraph() { return *m_renderGraph; }
void run();
void addWindow(Window& window);
void setRenderGraph(RenderGraph& renderGraph);
private:
Window* m_window;
RenderGraph* m_renderGraph;
std::unique_ptr<SystemGroup> m_updateGroup;
std::unique_ptr<Clock> m_updateClock;
std::unique_ptr<Graphics> m_graphics;
};
} | [
"contact@ryan-vazquez.dev"
] | contact@ryan-vazquez.dev |
51b772f1362e56a179e5ced790a0101e8417fea9 | 3714880a44d422dcfd4d9043f3abc1518b9fd823 | /src/bot/modules/AI/AIAnswer.cpp | de06700ff54fa907cde764fb8d4d88fe09b29e6c | [
"MIT"
] | permissive | fkrauthan/IrcBot | b17880a6b309ef780e234aa4b4c460ee3732d47f | 63620a12f1873a0865bb2d63f81434a6fd950c5d | refs/heads/master | 2021-01-20T05:31:16.121399 | 2014-05-23T20:21:33 | 2014-05-23T20:21:33 | 5,297,924 | 2 | 0 | null | 2012-08-04T20:37:20 | 2012-08-04T19:09:15 | C++ | UTF-8 | C++ | false | false | 2,040 | cpp | /*
* AIAnswer.cpp
*
* Created on: 13.07.2011
* Author: fkrauthan
*/
#include "AIAnswer.h"
#include <libbase/StringUtils/StringUtils.h>
#include <ticpp/ticpp.h>
#include <cstdlib>
AIAnswer::AIAnswer(ticpp::Element* node) {
mCategory = node->GetAttribute("name");
ticpp::Element* answers = node->FirstChildElement("answers", false);
if(answers) {
ticpp::Iterator<ticpp::Node> child;
for(child = child.begin(answers); child!=child.end(); ++child) {
mAnswers.push_back((*child).ToElement()->GetText());
}
}
ticpp::Element* categories = node->FirstChildElement("categories", false);
if(categories) {
ticpp::Iterator<ticpp::Node> child;
for(child = child.begin(categories); child!=child.end(); ++child) {
AIAnswer* tmpAnswer = new AIAnswer((*child).ToElement());
mChilds[tmpAnswer->getCategory()] = tmpAnswer;
}
}
}
AIAnswer::~AIAnswer() {
cleanUpAll();
}
const std::string& AIAnswer::getCategory() {
return mCategory;
}
std::string AIAnswer::getAnswer(const std::string category, std::map<std::string, std::string> params) {
if(category == "") {
int pos = std::rand() % mAnswers.size();
std::string ret = mAnswers[pos];
std::map<std::string, std::string>::iterator iter;
for(iter=params.begin(); iter!=params.end(); ++iter) {
ret = Base::StringUtils::replaceAll(ret, iter->first, iter->second);
}
return ret;
}
else {
size_t pos = category.find_first_of('/');
std::map<std::string, AIAnswer*>::iterator iter;
if(pos == std::string::npos) {
iter = mChilds.find(category);
}
else {
iter = mChilds.find(category.substr(0, pos));
}
if(iter != mChilds.end()) {
if(pos == std::string::npos) {
return iter->second->getAnswer("", params);
}
else {
return iter->second->getAnswer(category.substr(pos+1), params);
}
}
return "";
}
}
void AIAnswer::cleanUpAll() {
std::map<std::string, AIAnswer*>::iterator iter;
for(iter=mChilds.begin(); iter!=mChilds.end(); ++iter) {
delete iter->second;
}
mChilds.clear();
mAnswers.clear();
}
| [
"mail@fkrauthan.de"
] | mail@fkrauthan.de |
8a4cf5b7da86fa5335d7a9ca59622dd477c472d3 | 3594d75edecb33d285b1dfed6107ee960d440657 | /base/i18n/streaming_utf8_validator_perftest.cc | 18b91ab9273b1218a94d6bc68a7024021fd5a603 | [
"BSD-3-Clause"
] | permissive | Lynskylate/chromium-base-bazel | fa3f87822e56446ff2228ad4402d6c075681e805 | e68247d002809f0359e28ee7fc6c5c33de93ce9d | refs/heads/master | 2022-04-29T03:13:18.519535 | 2018-11-20T01:11:12 | 2018-11-20T01:11:12 | 259,334,137 | 1 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 8,636 | cc | // Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// All data that is passed through a WebSocket with type "Text" needs to be
// validated as UTF8. Since this is done on the IO thread, it needs to be
// reasonably fast.
// We are only interested in the performance on valid UTF8. Invalid UTF8 will
// result in a connection failure, so is unlikely to become a source of
// performance issues.
#include "base/i18n/streaming_utf8_validator.h"
#include <stddef.h>
#include <string>
#include "base/bind.h"
#include "base/callback.h"
#include "base/macros.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/test/perf_time_logger.h"
#include "gtest/gtest.h"
namespace base {
namespace {
// We want to test ranges of valid UTF-8 sequences. These ranges are inclusive.
// They are intended to be large enough that the validator needs to do
// meaningful work while being in some sense "realistic" (eg. control characters
// are not included).
const char kOneByteSeqRangeStart[] = " "; // U+0020
const char kOneByteSeqRangeEnd[] = "~"; // U+007E
const char kTwoByteSeqRangeStart[] = "\xc2\xa0"; // U+00A0 non-breaking space
const char kTwoByteSeqRangeEnd[] = "\xc9\x8f"; // U+024F small y with stroke
const char kThreeByteSeqRangeStart[] = "\xe3\x81\x82"; // U+3042 Hiragana "a"
const char kThreeByteSeqRangeEnd[] = "\xe9\xbf\x83"; // U+9FC3 "to blink"
const char kFourByteSeqRangeStart[] = "\xf0\xa0\x80\x8b"; // U+2000B
const char kFourByteSeqRangeEnd[] = "\xf0\xaa\x9a\xb2"; // U+2A6B2
// The different lengths of strings to test.
const size_t kTestLengths[] = {1, 32, 256, 32768, 1 << 20};
// Simplest possible byte-at-a-time validator, to provide a baseline
// for comparison. This is only tried on 1-byte UTF-8 sequences, as
// the results will not be meaningful with sequences containing
// top-bit-set bytes.
bool IsString7Bit(const std::string& s) {
for (std::string::const_iterator it = s.begin(); it != s.end(); ++it) {
if (*it & 0x80)
return false;
}
return true;
}
// Assumes that |previous| is a valid UTF-8 sequence, and attempts to return
// the next one. Is just barely smart enough to iterate through the ranges
// defined about.
std::string NextUtf8Sequence(const std::string& previous) {
DCHECK(StreamingUtf8Validator::Validate(previous));
std::string next = previous;
for (int i = static_cast<int>(previous.length() - 1); i >= 0; --i) {
// All bytes in a UTF-8 sequence except the first one are
// constrained to the range 0x80 to 0xbf, inclusive. When we
// increment past 0xbf, we carry into the previous byte.
if (i > 0 && next[i] == '\xbf') {
next[i] = '\x80';
continue; // carry
}
++next[i];
break; // no carry
}
DCHECK(StreamingUtf8Validator::Validate(next))
<< "Result \"" << next << "\" failed validation";
return next;
}
typedef bool (*TestTargetType)(const std::string&);
// Run fuction |target| over |test_string| |times| times, and report the results
// using |description|.
bool RunTest(const std::string& description,
TestTargetType target,
const std::string& test_string,
int times) {
base::PerfTimeLogger timer(description.c_str());
bool result = true;
for (int i = 0; i < times; ++i) {
result = target(test_string) && result;
}
timer.Done();
return result;
}
// Construct a string by repeating |input| enough times to equal or exceed
// |length|.
std::string ConstructRepeatedTestString(const std::string& input,
size_t length) {
std::string output = input;
while (output.length() * 2 < length) {
output += output;
}
if (output.length() < length) {
output += ConstructRepeatedTestString(input, length - output.length());
}
return output;
}
// Construct a string by expanding the range of UTF-8 sequences
// between |input_start| and |input_end|, inclusive, and then
// repeating the resulting string until it equals or exceeds |length|
// bytes. |input_start| and |input_end| must be valid UTF-8
// sequences.
std::string ConstructRangedTestString(const std::string& input_start,
const std::string& input_end,
size_t length) {
std::string output = input_start;
std::string input = input_start;
while (output.length() < length && input != input_end) {
input = NextUtf8Sequence(input);
output += input;
}
if (output.length() < length) {
output = ConstructRepeatedTestString(output, length);
}
return output;
}
struct TestFunctionDescription {
TestTargetType function;
const char* function_name;
};
bool IsStringUTF8(const std::string& str) {
return base::IsStringUTF8(base::StringPiece(str));
}
// IsString7Bit is intentionally placed last so it can be excluded easily.
const TestFunctionDescription kTestFunctions[] = {
{&StreamingUtf8Validator::Validate, "StreamingUtf8Validator"},
{&IsStringUTF8, "IsStringUTF8"}, {&IsString7Bit, "IsString7Bit"}};
// Construct a test string from |construct_test_string| for each of the lengths
// in |kTestLengths| in turn. For each string, run each test in |test_functions|
// for a number of iterations such that the total number of bytes validated
// is around 16MB.
void RunSomeTests(
const char format[],
base::Callback<std::string(size_t length)> construct_test_string,
const TestFunctionDescription* test_functions,
size_t test_count) {
for (size_t i = 0; i < arraysize(kTestLengths); ++i) {
const size_t length = kTestLengths[i];
const std::string test_string = construct_test_string.Run(length);
const int real_length = static_cast<int>(test_string.length());
const int times = (1 << 24) / real_length;
for (size_t test_index = 0; test_index < test_count; ++test_index) {
EXPECT_TRUE(RunTest(StringPrintf(format,
test_functions[test_index].function_name,
real_length,
times),
test_functions[test_index].function,
test_string,
times));
}
}
}
TEST(StreamingUtf8ValidatorPerfTest, OneByteRepeated) {
RunSomeTests("%s: bytes=1 repeated length=%d repeat=%d",
base::Bind(ConstructRepeatedTestString, kOneByteSeqRangeStart),
kTestFunctions,
3);
}
TEST(StreamingUtf8ValidatorPerfTest, OneByteRange) {
RunSomeTests("%s: bytes=1 ranged length=%d repeat=%d",
base::Bind(ConstructRangedTestString,
kOneByteSeqRangeStart,
kOneByteSeqRangeEnd),
kTestFunctions,
3);
}
TEST(StreamingUtf8ValidatorPerfTest, TwoByteRepeated) {
RunSomeTests("%s: bytes=2 repeated length=%d repeat=%d",
base::Bind(ConstructRepeatedTestString, kTwoByteSeqRangeStart),
kTestFunctions,
2);
}
TEST(StreamingUtf8ValidatorPerfTest, TwoByteRange) {
RunSomeTests("%s: bytes=2 ranged length=%d repeat=%d",
base::Bind(ConstructRangedTestString,
kTwoByteSeqRangeStart,
kTwoByteSeqRangeEnd),
kTestFunctions,
2);
}
TEST(StreamingUtf8ValidatorPerfTest, ThreeByteRepeated) {
RunSomeTests(
"%s: bytes=3 repeated length=%d repeat=%d",
base::Bind(ConstructRepeatedTestString, kThreeByteSeqRangeStart),
kTestFunctions,
2);
}
TEST(StreamingUtf8ValidatorPerfTest, ThreeByteRange) {
RunSomeTests("%s: bytes=3 ranged length=%d repeat=%d",
base::Bind(ConstructRangedTestString,
kThreeByteSeqRangeStart,
kThreeByteSeqRangeEnd),
kTestFunctions,
2);
}
TEST(StreamingUtf8ValidatorPerfTest, FourByteRepeated) {
RunSomeTests("%s: bytes=4 repeated length=%d repeat=%d",
base::Bind(ConstructRepeatedTestString, kFourByteSeqRangeStart),
kTestFunctions,
2);
}
TEST(StreamingUtf8ValidatorPerfTest, FourByteRange) {
RunSomeTests("%s: bytes=4 ranged length=%d repeat=%d",
base::Bind(ConstructRangedTestString,
kFourByteSeqRangeStart,
kFourByteSeqRangeEnd),
kTestFunctions,
2);
}
} // namespace
} // namespace base
| [
"damian@pecke.tt"
] | damian@pecke.tt |
835d159b110fda71848983153e3cf6b828f3dc0d | ecdd55ef7ea5ad5e07603daa9224afe2df47c29b | /src/qt/blockbrowser.h | 5593f894860bf4848663d81832ac4d7751e6ddc3 | [
"MIT"
] | permissive | compounddev/Compound-Coin | b9deb393e94b00df8a0608eca787e5e3c4b6a449 | 698e0c3fc31f3c24c5726f4ff46b636fde3a3e95 | refs/heads/master | 2021-09-04T15:12:39.626639 | 2017-10-05T03:21:38 | 2017-10-05T03:21:38 | 105,627,488 | 22 | 18 | MIT | 2018-01-08T13:05:08 | 2017-10-03T07:59:46 | C++ | UTF-8 | C++ | false | false | 1,293 | h | #ifndef BLOCKBROWSER_H
#define BLOCKBROWSER_H
#include "clientmodel.h"
#include "main.h"
#include "wallet.h"
#include "base58.h"
#include <QWidget>
#include <QDir>
#include <QFile>
#include <QProcess>
#include <QTime>
#include <QTimer>
#include <QStringList>
#include <QMap>
#include <QSettings>
#include <QSlider>
std::string getBlockHash(int);
std::string getBlockMerkle(int);
int getBlockNonce(int);
int getBlocknBits(int);
int getBlockTime(int);
double getBlockHardness(int);
double getBlockMint(int);
double getTxTotalValue(std::string);
double getTxFees(std::string);
std::string getInputs(std::string);
std::string getOutputs(std::string);
int64_t getInputValue(CTransaction, CScript);
int blocksInPastHours(int);
double convertCoins(int64_t);
bool addnode(std::string);
const CBlockIndex* getBlockIndex(int);
int getBlockHashrate(int);
namespace Ui {
class BlockBrowser;
}
class ClientModel;
class BlockBrowser : public QWidget
{
Q_OBJECT
public:
explicit BlockBrowser(QWidget *parent = 0);
~BlockBrowser();
void setModel(ClientModel *model);
public slots:
void blockClicked();
void txClicked();
void updateExplorer(bool);
private slots:
private:
Ui::BlockBrowser *ui;
ClientModel *model;
};
#endif // BLOCKBROWSER_H
| [
"32350979+compoundev@users.noreply.github.com"
] | 32350979+compoundev@users.noreply.github.com |
7bbca215e0f1d7109c1bb98b93fc236090dd47f5 | 2af29f0c2676c57191678f1a2f0244c364f81fa1 | /Source/sn/TileTerrain.cpp | c44e8cd065027e17bbc00292d33b51ffbb628969 | [
"MIT"
] | permissive | kochol/kge | 7c313c0c68242e7d9eee1f4a7dd97fd60038f63e | 9ffee7ab7f56481383d8f152cfa0434e2f9103c1 | refs/heads/master | 2020-04-26T11:28:25.158808 | 2018-06-30T07:26:07 | 2018-06-30T07:26:07 | 4,322,408 | 10 | 1 | null | 2014-05-29T20:47:11 | 2012-05-14T10:11:55 | C | UTF-8 | C++ | false | false | 65,270 | cpp | // File name: TileTerrain.cpp
// Des: This is a tile based terrain class good for strategic games
// Date: 22/11/1387
// Programmers: Ali Akbar Mohammadi (Kochol)
#include <stdio.h>
#include "../../Include/sn/TileTerrain.h"
#include "../../Include/gfx/Renderer.h"
#include "../../Include/gfx/MeshManager.h"
#include "../../Include/core/mem_fun.h"
#include "../../Include/sn/Light.h"
//#include "../../Include/io/File.h"
#include <queue>
typedef std::map<kge::u32, kge::sn::DecalData*> MapDecalData;
namespace kge
{
namespace sn
{
//------------------------------------------------------------------------------------
// Constructor
//------------------------------------------------------------------------------------
TileTerrain::TileTerrain() :
m_pIndices(NULL), m_fWidth(1.0f), m_fHeight(1.0f),
m_iNumVerts(0), m_iNumIndices(0), m_iNumCols(0), m_iNumRows(0),
m_fXOffset(-0.5f), m_fYOffset(-0.5f), m_pTileTexture(NULL),
m_pTextureID(NULL), m_pDTM(NULL), m_pTiles(NULL), m_pBlendTiles(NULL),
m_iNumColspp(0), m_iNumRowspp(0), m_pTilesTemp(NULL), m_pTextureBlend(NULL),
m_pTiles2(NULL), m_bWater(false), m_bCaustics(false), m_ppCausticsTextures(NULL),
m_iCurrentCaustic(0), m_pCausticsTimer(NULL), m_pBlendMap(NULL), m_pVshader(NULL),
m_pPshader(NULL), m_pMesh(NULL), m_pPos(NULL), m_pNorTexColor(NULL), m_bPosChanged(false),
m_bNorTexChanged(false), m_bReceiveShadow(false), m_pShadowShaderCode(NULL),
m_pShadowMatrix(NULL), m_pNormalMapTileTexture(NULL), m_pNormalVerts(NULL),
m_shDecalWVP(0), m_shDecalAlpha(0), m_bTileTerrain2(false)
{
m_eNodeType = ENT_TileTerrain;
m_pAABB = NULL;
m_cNormal[0].c = 0x00ff0000;
m_cNormal[1].c = 0x0000ff00;
m_cNormal[2].c = 0x000000ff;
m_cNormal[3].c = 0x00ffffff;
m_pMaterial = KGE_NEW(gfx::Material)();
const char chv[] = "float4x4 matViewProjection;\n"\
"struct VS_INPUT \n"\
"{\n"\
" float4 Position : POSITION0;\n"\
" float2 Texcoord : TEXCOORD0;\n"\
"};\n"\
"struct VS_OUTPUT \n"\
"{\n"\
" float4 Position : POSITION0;\n"\
" float2 Texcoord : TEXCOORD0; \n"\
"};\n"\
"VS_OUTPUT main( VS_INPUT Input )\n"\
"{\n"\
" VS_OUTPUT Output;\n"\
" Output.Position = mul( Input.Position, matViewProjection );\n"\
" Output.Texcoord = Input.Texcoord;\n"\
" return( Output );\n"\
"}";
const char chp[] = "float fAlpha;"\
"sampler2D baseMap;\n"\
"struct PS_INPUT \n"\
"{\n"\
" float2 Texcoord : TEXCOORD0;\n"\
"};\n"\
"float4 main( PS_INPUT Input ) : COLOR0\n"\
"{\n"\
" float4 c = tex2D( baseMap, Input.Texcoord );\n"\
" c.a *= fAlpha;\n"\
" return c;\n"\
"}";
m_pVSdecal = gfx::Renderer::GetSingletonPtr()->
CreateVertexShaderFromString(chv, "main", gfx::ESV_VS2);
m_shDecalWVP = m_pVSdecal->GetConstatnt("matViewProjection");
m_pPSdecal = gfx::Renderer::GetSingletonPtr()->
CreatePixelShaderFromString(chp, "main", gfx::ESV_PS2);
m_shDecalAlpha = m_pPSdecal->GetConstatnt("fAlpha");
m_pDecalFun = core::mem_fun(this, &TileTerrain::SetDecalShaderParams);
} // Constructor
//------------------------------------------------------------------------------------
// Destructor
//------------------------------------------------------------------------------------
TileTerrain::~TileTerrain()
{
m_vTerrainData.clear();
KGE_DELETE_ARRAY(m_pTiles);
KGE_DELETE_ARRAY(m_pTiles2);
KGE_DELETE_ARRAY(m_pTilesTemp);
KGE_DELETE_ARRAY(m_pBlendTiles);
KGE_DELETE_ARRAY(m_pNormalVerts);
KGE_DELETE(m_pMaterial, Material);
KGE_DELETE(m_pCausticsTimer, Timer);
KGE_DELETE(m_pMesh, Mesh);
KGE_DELETE_CLASS_ARRAY(m_pAABB, AABB, GetAABBcount());
} // Destructor
//------------------------------------------------------------------------------------
// Karhayee ke Ghabl az render bayad anjam shvad. Mesle colision detection.
//------------------------------------------------------------------------------------
void TileTerrain::PreRender(float elapsedTime)
{
if (m_pParent)
*m_pFinalMat = (*m_pParent->GetFinalMatrix()) * (*m_pAbsMat);
else
*m_pFinalMat = *m_pAbsMat;
if (m_bVis)
{
if (m_bPosChanged)
{
m_pMesh->m_pvbPosition->SetData(m_pPos, 0, m_iNumVerts);
m_bPosChanged = false;
}
if (m_bNorTexChanged)
{
m_pMesh->m_pvbNormalTexcoord->SetData(m_pNorTexColor, 0, m_iNumVerts);
if (m_pNormalMapTileTexture || m_pMaterial[0].ppTexture[1])
m_pMesh->m_pvbTangentBinormal->SetData(m_pMesh->m_pTangentBinormal, 0, m_iNumVerts);
m_bNorTexChanged = false;
}
if ( !m_bAutoCulling)
{
for (int i = 0; i < GetAABBcount(); i++)
{
m_vVisibleParts.push_back(i);
}
}
else
{
m_vVisibleParts.clear();
const math::Frustum* pFrus = m_pSnMan->GetActiveCamera()->GetFrustum();
for (int i = 0; i < GetAABBcount(); i++)
{
if (pFrus->Collision(&m_pAABB[i]) != math::ECT_Out )
{
m_vVisibleParts.push_back(i);
///m_pSnMan->m_pSceneAABB->AddAABB(&m_pAABB[i]);
}
}
}
// Check for caustics
if (m_bCaustics)
{
if (m_pCausticsTimer->NextFrame())
{
m_iCurrentCaustic++;
if (m_iCurrentCaustic >= m_iNumCausticsTextures)
m_iCurrentCaustic = 0;
}
}
m_pSnMan->RegNode(this);
}
} // PreRender
//------------------------------------------------------------------------------------
// Render the terrain
//------------------------------------------------------------------------------------
void TileTerrain::Render()
{
// Set decals data
MapDecalData::iterator it;
for (it = m_mDecalBufferData.begin(); it != m_mDecalBufferData.end(); it++)
{
it->second->VertexBuffer->SetData(it->second->Vertices, 0, it->second->vbOffset);
}
m_pRenderer->SetTransForm(m_pFinalMat);
m_pRenderer->SetMaterial(m_pMaterial);
if (!m_bTileTerrain2)
{
m_pVshader->PreRender();
m_pVshader->Render();
m_pPshader->Render();
// Set textures
m_pRenderer->SetTexture(m_pTileTexture->GetTexture());
m_pRenderer->SetTexture(m_pBlendMap, 1);
m_pRenderer->SetTexture(m_pTextureID, 2);
m_pRenderer->SetTexture(m_pTextureBlend, 3);
m_pRenderer->SetTextureParams(gfx::ETP_Point, 3);
}
if (m_bCaustics)
m_pRenderer->SetTexture(m_ppCausticsTextures[m_iCurrentCaustic], 4);
if(m_pNormalMapTileTexture)
{
m_pRenderer->SetTexture(m_pNormalMapTileTexture->GetTexture(), 5);
}
if (m_pMaterial[0].ppTexture[1])
m_pRenderer->SetTexture(m_pMaterial[0].ppTexture[1], 5);
m_pRenderer->SetVertexDec(m_pMesh->m_pVertexDec);
m_pRenderer->SetVertexBuffer(m_pMesh->m_pvbPosition);
m_pRenderer->SetVertexBuffer(m_pMesh->m_pvbNormalTexcoord, 1);
m_pRenderer->SetVertexBuffer(m_pMesh->m_pvbTangentBinormal, 2);
m_pRenderer->SetIndexBuffer(m_pMesh->m_pIndexBuffer);
if (!m_bTileTerrain2)
{
const size_t m_vVisiblePartsSize = m_vVisibleParts.size();
for (size_t i = 0; i < m_vVisiblePartsSize; ++i)
{
m_pRenderer->DrawTriangleList(m_iNumVerts, 1536, m_pMesh->m_pVertexDec, 0, m_vVisibleParts[i] * 1536);
}
m_pRenderer->SetTextureParams(gfx::ETP_Anisotropic, 3);
}
#ifdef DEBUG
// for (int i = 0; i < m_iNumUparts * m_iNumVparts; i++)
// {
// m_pAABB[i].DebugRender();
// }
//m_pRenderer->Disable(gfx::ERF_Lighting);
//m_pRenderer->SetTexture(MAXID);
//m_pRenderer->DrawLineList(m_pNormalVerts, m_iNumVerts * 2, 0, 0);
//m_pRenderer->Enable(gfx::ERF_Lighting);
#endif // DEBUG
} // Render
//------------------------------------------------------------------------------------
// Karhaee ke bad az render bayad anjam beshe.
//------------------------------------------------------------------------------------
void TileTerrain::PostRender()
{
} // PostRender
//------------------------------------------------------------------------------------
// Ezafe kardane effect be hamin gereh.
//------------------------------------------------------------------------------------
bool TileTerrain::AddEffect ( efx::EffectType p, efx::Effect** ppOut )
{
return false;
} // AddEffect
//------------------------------------------------------------------------------------
// Draw the node with/without its Materials and Transforms.
//------------------------------------------------------------------------------------
void TileTerrain::Draw( bool WithMaterial , bool WithTransform, bool bPosition , bool bNormalTexcoord , bool bTangentBinormal )
{
} // Draw
//------------------------------------------------------------------------------------
// Creates a tile based terrain with the given size
//------------------------------------------------------------------------------------
void TileTerrain::ReCreate(int numCols, int numRows, float MinHeight, float MaxHeight)
{
if (!m_bTileTerrain2)
{
if (!m_pTileTexture)
{
io::Logger::Log("You have to assign a TileTexture to init this terrain.", io::ELM_Error);
return;
}
// Create the TextureID
int tx, ty, mip;
tx = gfx::Texture::GetPowerOf2Size(numCols, mip);
ty = gfx::Texture::GetPowerOf2Size(numRows, mip);
if (m_pTextureID)
m_pTextureID->DecRef();
int handle = Device::GetSingletonPtr()->GetTextureManager()->Add(NULL, NULL, "TextureID");
m_pTextureID = Device::GetSingletonPtr()->GetTextureManager()->GetResource(handle);
m_pTextureID->CreateTexture(tx, ty, gfx::ETF_A32B32G32R32F, 1);
m_iTextureIDSizeX = tx;
m_iTextureIDSizeY = ty;
float* f = KGE_NEW_ARRAY(float, tx * ty * 4);
int cfcf = tx * 4;
float cc = 0.0f, ccy = 0.0f;
for (int r = 0; r < numRows; r++)
{
cc = 0.0f;
for (int c = 0; c < numCols; c++)
{
f[r * cfcf + c * 4] = cc;
f[r * cfcf + c * 4 + 1] = ccy;
f[r * cfcf + c * 4 + 2] = 0;
f[r * cfcf + c * 4 + 3] = 0;
cc += m_pTileTexture->GetU() - 4.0f * m_pTileTexture->GetdU();
}
ccy += m_pTileTexture->GetV() - 4.0f * m_pTileTexture->GetdV();
}
io::Logger::Log(io::ELM_Warning, "TextureID %f %f", m_pTileTexture->GetU(), m_pTileTexture->GetV());
m_pTextureID->SetData((u8*)f, tx * ty * 4 * 4);
KGE_DELETE_ARRAY(f);
// Create texture blend
if (m_pTextureBlend)
m_pTextureBlend->DecRef();
handle = Device::GetSingletonPtr()->GetTextureManager()->Add(NULL, NULL, "TextureBlend");
m_pTextureBlend = Device::GetSingletonPtr()->GetTextureManager()->GetResource(handle);
m_pTextureBlend->CreateTexture(tx, ty, gfx::ETF_A8, 1);
u8* temp = KGE_NEW_ARRAY(u8, tx * ty);
memset(temp, 255, tx * ty);
m_pTextureBlend->SetData(temp, tx * ty);
KGE_DELETE_ARRAY(temp);
// Create tile data holders.
KGE_DELETE_ARRAY(m_pTiles);
KGE_DELETE_ARRAY(m_pTiles2);
KGE_DELETE_ARRAY(m_pTilesTemp);
KGE_DELETE_ARRAY(m_pBlendTiles);
m_pTiles = KGE_NEW_ARRAY(int, numCols * numRows);
m_pTiles2 = KGE_NEW_ARRAY(int, numCols * numRows);
m_pTilesTemp = KGE_NEW_ARRAY(int, numCols * numRows);
m_pBlendTiles = KGE_NEW_ARRAY(u8 , numCols * numRows);
}
// Clear the memory
m_vTerrainData.clear();
KGE_DELETE_ARRAY(m_pPos);
KGE_DELETE_ARRAY(m_pNorTexColor);
KGE_DELETE_ARRAY(m_pIndices);
KGE_DELETE(m_pMesh, Mesh);
KGE_DELETE_CLASS_ARRAY(m_pAABB, AABB, GetAABBcount());
m_iNumCols = numCols;
m_iNumRows = numRows;
m_iNumColspp = numCols + 1;
m_iNumRowspp = numRows + 1;
m_iNumVerts = (numRows + 1) * (numCols + 1);
m_iNumIndices = numRows * numCols * 6;
bool bRand = false;
float DHeight = MaxHeight - MinHeight;
printf("%f\t%f\t%f\n", DHeight, MaxHeight, MinHeight);
if (DHeight > 0.0f)
{
bRand = true;
}
int k = 0;
int index= 0;
m_pPos = KGE_NEW_ARRAY(gfx::Vertex3, m_iNumVerts);
m_pNorTexColor = KGE_NEW_ARRAY(gfx::VertexNTC, m_iNumVerts);
m_pMesh = KGE_NEW(sn::Mesh)();
for (int i = 0; i <= numRows; i++)
{
for (int j = 0; j <= numCols; j++)
{
// Create terrain data
TileTerrainData t;
if (bRand)
{
t.Height = (float)(rand() % 101) / 100.0f * DHeight + MinHeight;
}
else
t.Height = MinHeight;
t.TileID = 0;
m_vTerrainData.push_back(t);
// Create vectors
m_pPos[index].X = j * m_fWidth + m_fXOffset ;
m_pPos[index].Y = t.Height;
m_pPos[index].Z = i * m_fHeight + m_fYOffset;
m_pNorTexColor[index].tex.X = (float)j;
m_pNorTexColor[index].tex.Y = (float)i;
m_pNorTexColor[index].Color = 0xffffffff;
index++;
} // for j
} // for i
// Create Indexes and split the terrain.
int iu, iv;
iu = ceil((float)numCols / 16.0f);
iv = ceil((float)numRows / 16.0f);
m_iNumUparts = iu;
m_iNumVparts = iv;
m_pAABB = KGE_NEW_CLASS_ARRAY(math::AABB, iu * iv);
m_pIndices = KGE_NEW_ARRAY(u32, m_iNumIndices);
k = 0;
int numColspp = numCols + 1;
for (int v = 0; v < iv; v++)
{
for (int u = 0; u < iu; u++)
{
for (int i = v * 16; i < (v + 1) * 16; i++)
{
if (i >= numRows)
break;
for (int j = u * 16; j < (u + 1) * 16; j++)
{
if (j >= numCols)
break;
m_pIndices[k ] = (i * numColspp + j) + 1;
m_pIndices[k + 1] = (i * numColspp + j);
m_pIndices[k + 2] = ((i + 1) * numColspp + j);
m_pIndices[k + 3] = (i * numColspp + j) + 1;
m_pIndices[k + 4] = ((i + 1) * numColspp + j);
m_pIndices[k + 5] = ((i + 1) * numColspp + j) + 1;
m_pAABB[v * iu + u].AddInternalPoint(&m_pPos[m_pIndices[k ]]);
m_pAABB[v * iu + u].AddInternalPoint(&m_pPos[m_pIndices[k + 1]]);
m_pAABB[v * iu + u].AddInternalPoint(&m_pPos[m_pIndices[k + 2]]);
m_pAABB[v * iu + u].AddInternalPoint(&m_pPos[m_pIndices[k + 5]]);
k += 6;
} // for j
} // for i
} // for u
} // for v
// Create shader
if (m_pVshader)
{
m_pVshader->DecRef();
m_pVshader = NULL;
}
if (m_pPshader)
{
m_pPshader->DecRef();
m_pPshader = NULL;
}
core::String VertexShaderCode,
PixelShaderCode;
CreateShaderCode(VertexShaderCode, PixelShaderCode);
m_pVshader = gfx::Renderer::GetSingletonPtr()->CreateVertexShaderFromString
(VertexShaderCode.ToCharPointer(), "main", gfx::ESV_VS3);
m_pPshader = gfx::Renderer::GetSingletonPtr()->CreatePixelShaderFromString
(PixelShaderCode.ToCharPointer(), "main", gfx::ESV_PS3);
m_pVshader->ConnectOnPreRender(core::mem_fun(this, &TileTerrain::SetShaderParams));
m_shLit = m_pVshader->GetConstatnt("DirLit");
m_shWVP = m_pVshader->GetConstatnt("matViewProjection");
m_shView = m_pVshader->GetConstatnt("matView");
m_shfvEyePosition = m_pVshader->GetConstatnt("fvEyePosition");
if (m_bReceiveShadow)
m_shShadowMat = m_pVshader->GetConstatnt("matLight");
// Calculate Normals
#ifdef DEBUG
KGE_DELETE_ARRAY(m_pNormalVerts);
m_pNormalVerts = KGE_NEW_ARRAY(gfx::Vertex3C, m_iNumVerts * 2);
#endif // DEBUG
gfx::RecalculateNormals_Smooth32<gfx::VertexNTC>(m_pPos, m_pNorTexColor, m_iNumVerts, m_pIndices, m_iNumIndices);
// Create Mesh
m_pMesh->m_pPos = m_pPos;
m_pMesh->m_pNorTexColor = m_pNorTexColor;
m_pMesh->m_sName = "Tile Terrain Mesh";
m_pMesh->m_pIndices32 = m_pIndices;
m_pMesh->m_NumVerts = m_iNumVerts;
m_pMesh->m_NumIndices = m_iNumIndices;
m_pMesh->m_pRenderer = m_pRenderer;
m_pMesh->m_pVertexDec = m_pRenderer->GetVertexDec(gfx::EVT_P0NTC1BT2);
if (m_pNormalMapTileTexture || m_pMaterial[0].ppTexture[1])
m_pMesh->PrepareBuffers(true, true);
else
m_pMesh->PrepareBuffers(false, true);
m_pRenderer->SetTextureParams(gfx::ETP_Point, 1);
m_pRenderer->SetTextureParams(gfx::ETP_Mirror, 1);
m_pRenderer->SetTextureParams(gfx::ETP_Anisotropic, 4);
m_pRenderer->SetTextureParams(gfx::ETP_Anisotropic, 5);
// Create Normal lines for debug.
for (int i = 0; i <= numRows; i++)
{
for (int j = 0; j <= numCols; j++)
{
//m_vTerrainData[i * numCols + j].LeftNormal->set( m_pVertices[(i * numColspp + j)].Nor.X
// ,m_pVertices[(i * numColspp + j)].Nor.Y
// ,m_pVertices[(i * numColspp + j)].Nor.Z);
//m_vTerrainData[i * numCols + j].RightNormal->set(m_pVertices[((i + 1) * numCols + j) + 1].Nor.X
// ,m_pVertices[((i + 1) * numCols + j) + 1].Nor.Y
// ,m_pVertices[((i + 1) * numCols + j) + 1].Nor.Z);
#ifdef DEBUG
m_pNormalVerts[(i * numColspp + j) * 2 ].c = m_cNormal[0];
m_pNormalVerts[(i * numColspp + j) * 2 ].pos = m_pPos[(i * numColspp + j)];
m_pNormalVerts[(i * numColspp + j) * 2 + 1].c = m_cNormal[0];
m_pNormalVerts[(i * numColspp + j) * 2 + 1].pos = m_pPos[(i * numColspp + j)] + m_pNorTexColor[(i * numColspp + j)].Nor;
#endif // DEBUG
}
}
if (m_pDTM)
m_pDTM->Init(this);
} // ReCreate
//------------------------------------------------------------------------------------
// Sets the tile texture
//------------------------------------------------------------------------------------
void TileTerrain::SetTileTexture(gfx::TileTexture * pTileTex)
{
pTileTex->AddRef();
m_pTileTexture = pTileTex;
} // SetTileTexture
//------------------------------------------------------------------------------------
// Sets the tile in the terrain.
//------------------------------------------------------------------------------------
void TileTerrain::SetTile(int Col, int Row, u32 TileID)
{
if (Col < 0 || Col >= m_iNumCols ||
Row < 0 || Row >= m_iNumRows)
return;
if (TileID < 0 || TileID >= m_pTileTexture->GetTileCount())
return;
math::Vector v = m_pTileTexture->GetTile(TileID)->GetTile(Col, Row);
float f[4];
f[0] = (float)(Col * m_pTileTexture->GetU()) - v.x;
f[1] = (float)(Row * m_pTileTexture->GetV()) - v.y;
f[2] = 0;
f[3] = 0;
m_pTextureID->SetData(Col, Row, 1, 1, (u8*)f, 16);
m_pTiles[Row * m_iNumCols + Col] = TileID;
m_pTiles2[Row * m_iNumCols + Col] = -1;
m_pBlendTiles[Row * m_iNumCols + Col] = 255;
m_pTextureBlend->SetData(Col, Row, 1, 1 , &m_pBlendTiles[Row * m_iNumCols + Col], 1);
} // SetTile
void TileTerrain::SetTile( int Col, int Row, int TileID, int TileID2 )
{
if (Col < 0 || Col >= m_iNumCols ||
Row < 0 || Row >= m_iNumRows)
return;
if (TileID < 0 || TileID >= m_pTileTexture->GetTileCount())
return;
if (TileID == TileID2)
return;
math::Vector v = m_pTileTexture->GetTile(TileID)->GetTile(Col, Row);
math::Vector v2;
float f[4];
f[0] = (float)(Col * m_pTileTexture->GetU()) - v.x;
f[1] = (float)(Row * m_pTileTexture->GetV()) - v.y;
if (TileID2 >= 0)
{
v2 = m_pTileTexture->GetTile(TileID2)->GetTile(Col, Row);
f[2] = (float)(Col * m_pTileTexture->GetU()) - v2.x;
f[3] = (float)(Row * m_pTileTexture->GetV()) - v2.y;
}
else
{
f[2] = 0;
f[3] = 0;
}
m_pTextureID->SetData(Col, Row, 1, 1, (u8*)f, 16);
m_pTiles[Row * m_iNumCols + Col] = TileID;
m_pTiles2[Row * m_iNumCols + Col] = TileID2;
}
//------------------------------------------------------------------------------------
// Sets the tiles in the terrain.
//------------------------------------------------------------------------------------
void TileTerrain::SetTiles(u32 tileID)
{
if (tileID < 0 || tileID >= m_pTileTexture->GetTileCount())
return;
float* data = KGE_NEW_ARRAY(float, 4 * m_iNumRows * m_iNumCols);
int c = 0;
for (int i = 0; i < m_iNumRows; ++i)
{
for (int j = 0; j < m_iNumCols; ++j)
{
math::Vector v = m_pTileTexture->GetTile(tileID)->GetTile(j, i);
data[c] = (j * m_pTileTexture->GetU()) - v.x;
data[c + 1] = (i * m_pTileTexture->GetV()) - v.y;
data[c + 2] = 0;
data[c + 3] = 0;
m_pTiles[i * m_iNumCols + j] = tileID;
m_pTiles2[i * m_iNumCols + j] = -1;
m_pBlendTiles[i * m_iNumCols + j] = 255;
c += 4;
}
}
m_pTextureID->SetData(0, 0, m_iNumRows, m_iNumCols, (u8*)data, 16 * m_iNumRows * m_iNumCols);
m_pTextureBlend->SetData(0, 0, m_iNumRows, m_iNumCols , m_pBlendTiles, m_iNumRows * m_iNumCols);
KGE_DELETE_ARRAY(data);
}
//------------------------------------------------------------------------------------
// Blend the tile stored in the given position and their same tiles attached to it.
//------------------------------------------------------------------------------------
void TileTerrain::Blend( int Col, int Row )
{
if (Col < 0 || Col >= m_iNumCols ||
Row < 0 || Row >= m_iNumRows)
return;
int tile = m_pTiles[Row * m_iNumCols + Col];
memset(m_pTilesTemp, 0, m_iNumCols * m_iNumRows * 4);
Flood_Fill(Col, Row, tile);
for (int r = 1; r < m_iNumRows - 1; r++)
{
for (int c = 1; c < m_iNumCols - 1; c++)
{
if (m_pTilesTemp[r * m_iNumCols + c] == 0)
{
int i = 0;
if (m_pTilesTemp[r * m_iNumCols + c + 1] == 2)
i++;
if (m_pTilesTemp[r * m_iNumCols + c - 1] == 2)
i++;
if (m_pTilesTemp[(r + 1) * m_iNumCols + c] == 2)
i++;
if (m_pTilesTemp[(r - 1) * m_iNumCols + c] == 2)
i++;
if (i > 1)
{
m_pTilesTemp[r * m_iNumCols + c] = 3;
}
}
}
}
for (int r = 1; r < m_iNumRows - 1; r++)
{
for (int c = 1; c < m_iNumCols - 1; c++)
{
u32 t = 0;
if (m_pTilesTemp[r * m_iNumCols + c] == 2 ||
m_pTilesTemp[r * m_iNumCols + c] == 3)
{
if (m_pBlendTiles[r * m_iNumCols + c] == 255)
{
if (m_pTiles[(r - 1) * m_iNumCols + c - 1] == tile)
t |= 1;
if (m_pTiles[(r - 1) * m_iNumCols + c] == tile)
t |= 2;
if (m_pTiles[(r - 1) * m_iNumCols + c + 1] == tile)
t |= 4;
if (m_pTiles[r * m_iNumCols + c - 1] == tile)
t |= 8;
if (m_pTiles[r * m_iNumCols + c + 1] == tile)
t |= 16;
if (m_pTiles[(r + 1) * m_iNumCols + c - 1] == tile)
t |= 32;
if (m_pTiles[(r + 1) * m_iNumCols + c] == tile)
t |= 64;
if (m_pTiles[(r + 1) * m_iNumCols + c + 1] == tile)
t |= 128;
printf("%d\n", t);
if (t == 128)
m_pBlendTiles[r * m_iNumCols + c] = 0; // 0
else if (t == 224 || t == 96 || t == 192 || t == 64)
m_pBlendTiles[r * m_iNumCols + c] = 13; // 1
else if (t == 32)
m_pBlendTiles[r * m_iNumCols + c] = 26; // 2
else if (t == 10 || t == 14 || t == 11 || t == 15 || t == 42 || t == 46 || t == 43 || t == 47)
m_pBlendTiles[r * m_iNumCols + c] = 39; // 3
else if (t == 20 || t == 16 || t == 144 || t == 148)
m_pBlendTiles[r * m_iNumCols + c] = 53; // 4
else if (t == 255 || t == 254 || t == 251 || t == 223 || t == 127 || t == 250 || t == 222 || t == 126 || t == 219 || t == 123 || t == 95 || t == 90 || t == 91 || t == 94 || t == 122 || t == 218)
m_pBlendTiles[r * m_iNumCols + c] = 64; // 5 (12,13,14)
else if (t == 9 || t == 8 || t == 40 || t == 41)
m_pBlendTiles[r * m_iNumCols + c] = 77; // 6
else if (t == 72 || t == 73 || t == 104 || t == 200 || t == 105 || t == 201 || t == 232 || t == 233)
m_pBlendTiles[r * m_iNumCols + c] = 90; // 7
else if (t == 4)
m_pBlendTiles[r * m_iNumCols + c] = 104; // 8
else if (t == 3 || t == 6 || t == 2 || t == 7)
m_pBlendTiles[r * m_iNumCols + c] = 115; // 9
else if (t == 1)
m_pBlendTiles[r * m_iNumCols + c] = 128; // 10
else if (t == 18 || t == 19 || t == 22 || t == 146 || t == 23 || t == 150 || t == 147 || t == 151)
m_pBlendTiles[r * m_iNumCols + c] = 141; // 11
else if (t == 80 || t == 208 || t == 112 || t == 240 || t == 84 || t == 212 || t == 116 || t == 244)
m_pBlendTiles[r * m_iNumCols + c] = 192; // 15
m_pTextureBlend->SetData(c, r, 1, 1 , &m_pBlendTiles[r * m_iNumCols + c], 1);
SetTile(c, r, m_pTiles[r*m_iNumCols+c], tile);
}
else if (m_pTilesTemp[r * m_iNumCols + c] == 2)
{
SetTile(c, r, tile, m_pTiles2[r*m_iNumCols+c]);
}
}
}
}
// m_pTextureBlend->SetData(0, 0, m_iNumCols, m_iNumRows ,m_pBlendTiles, m_iNumCols * m_iNumRows);
} // Blend
//------------------------------------------------------------------------------------
// Fill the terrain with the given tile ID
//------------------------------------------------------------------------------------
void TileTerrain::Fill( int Col, int Row, int TileID )
{
if (TileID < 0 || TileID >= m_pTileTexture->GetTileCount())
return;
int tile = m_pTiles[Row * m_iNumCols + Col];
Flood_Fill(Col, Row, tile, TileID);
} // Fill
//------------------------------------------------------------------------------------
// This function is for blending
//------------------------------------------------------------------------------------
void TileTerrain::Flood_Fill( int Col, int Row, int TileID )
{
if (Col < 0 || Col >= m_iNumCols || Row < 0 || Row >= m_iNumRows)
return;
if (m_pTiles[Row * m_iNumCols + Col] != TileID)
return;
if (m_pTilesTemp[Row * m_iNumCols + Col] != 0)
return;
std::queue<int> qc, qr;
qc.push(Col);
qr.push(Row);
m_pTilesTemp[Row * m_iNumCols + Col] = 1;
int c,r;
while (!qc.empty())
{
c = qc.front();
r = qr.front();
qc.pop();
qr.pop();
if (c > 0)
{
if (m_pTiles[r * m_iNumCols + c - 1] == TileID &&
m_pBlendTiles[r * m_iNumCols + c - 1] == 255 &&
m_pTilesTemp[r * m_iNumCols + c - 1] == 0)
{
m_pTilesTemp[r * m_iNumCols + c - 1] = 1;
qc.push(c - 1);
qr.push(r);
}
else if (m_pTiles[r * m_iNumCols + c - 1] != TileID &&
m_pTilesTemp[r * m_iNumCols + c - 1] == 0)
{
m_pTilesTemp[r * m_iNumCols + c - 1] = 2;
}
}
if (c < m_iNumCols - 1)
{
if (m_pTiles[r * m_iNumCols + c + 1] == TileID &&
m_pBlendTiles[r * m_iNumCols + c + 1] == 255 &&
m_pTilesTemp[r * m_iNumCols + c + 1] == 0)
{
m_pTilesTemp[r * m_iNumCols + c + 1] = 1;
qc.push(c + 1);
qr.push(r);
}
else if (m_pTiles[r * m_iNumCols + c + 1] != TileID &&
m_pTilesTemp[r * m_iNumCols + c + 1] == 0)
{
m_pTilesTemp[r * m_iNumCols + c + 1] = 2;
}
}
if (r > 0)
{
if (m_pTiles[(r - 1) * m_iNumCols + c] == TileID &&
m_pBlendTiles[(r - 1) * m_iNumCols + c] == 255 &&
m_pTilesTemp[(r - 1) * m_iNumCols + c] == 0)
{
m_pTilesTemp[(r - 1) * m_iNumCols + c] = 1;
qc.push(c);
qr.push(r - 1);
}
else if (m_pTiles[(r - 1) * m_iNumCols + c] != TileID &&
m_pTilesTemp[(r - 1) * m_iNumCols + c] == 0)
{
m_pTilesTemp[(r - 1) * m_iNumCols + c] = 2;
}
}
if (r < m_iNumRows - 1)
{
if (m_pTiles[(r + 1) * m_iNumCols + c] == TileID &&
m_pBlendTiles[(r + 1) * m_iNumCols + c] == 255 &&
m_pTilesTemp[(r + 1) * m_iNumCols + c] == 0)
{
m_pTilesTemp[(r + 1) * m_iNumCols + c] = 1;
qc.push(c);
qr.push(r + 1);
}
else if (m_pTiles[(r + 1) * m_iNumCols + c] != TileID &&
m_pTilesTemp[(r + 1) * m_iNumCols + c] == 0)
{
m_pTilesTemp[(r + 1) * m_iNumCols + c] = 2;
}
}
}
} // Flood_Fill ( BLEND )
//------------------------------------------------------------------------------------
// This function is for filling
//------------------------------------------------------------------------------------
void TileTerrain::Flood_Fill( int Col, int Row, int ReplaceID, int TileID )
{
if (Col < 0 || Col >= m_iNumCols || Row < 0 || Row >= m_iNumRows)
return;
if (m_pTiles[Row * m_iNumCols + Col] != ReplaceID)
return;
if (m_pTiles[Row * m_iNumCols + Col] == TileID)
return;
std::queue<int> qc, qr;
qc.push(Col);
qr.push(Row);
SetTile(Col, Row, TileID);
int c,r;
while (!qc.empty())
{
c = qc.front();
r = qr.front();
qc.pop();
qr.pop();
if (c > 0)
{
if (m_pTiles[r * m_iNumCols + c - 1] == ReplaceID)
{
SetTile(c - 1, r, TileID);
qc.push(c - 1);
qr.push(r);
}
}
if (c < m_iNumCols - 1)
{
if (m_pTiles[r * m_iNumCols + c + 1] == ReplaceID)
{
SetTile(c + 1, r, TileID);
qc.push(c + 1);
qr.push(r);
}
}
if (r > 0)
{
if (m_pTiles[(r - 1) * m_iNumCols + c] == ReplaceID)
{
SetTile(c, r - 1, TileID);
qc.push(c);
qr.push(r - 1);
}
}
if (r < m_iNumRows - 1)
{
if (m_pTiles[(r + 1) * m_iNumCols + c] == ReplaceID)
{
SetTile(c, r + 1, TileID);
qc.push(c);
qr.push(r + 1);
}
}
}
} // Flood_Fill ( FILL )
//------------------------------------------------------------------------------------
// Returns the terrain height at the given grid position
//------------------------------------------------------------------------------------
float TileTerrain::GetHeight( float x, float z )
{
float c = (x - m_fXOffset) / m_fWidth;
float d = (z - m_fYOffset) / m_fHeight;
int col = (int)c;
int row = (int)d;
float A = m_pPos[row * m_iNumColspp + col].Y;
float B = m_pPos[row * m_iNumColspp + col + 1].Y;
float C = m_pPos[(row + 1) * m_iNumColspp + col].Y;
float D = m_pPos[(row + 1) * m_iNumColspp + col + 1].Y;
float s = c - (float)col;
float t = d - (float)row;
if (t < 1.0f - s)
{
float uy = B - A;
float vy = C - A;
return A + s * uy + t * vy;
}
else
{
float uy = C - D;
float vy = B - D;
return D + (1.0f - s) * uy + (1.0f - t) * vy;
}
} // GetHeight
//------------------------------------------------------------------------------------
// Sets the terrain height by the index id.
//------------------------------------------------------------------------------------
void TileTerrain::SetHeight( int IndexID, float h )
{
m_bPosChanged = true;
m_pPos[m_pIndices[IndexID]].Y = h;
math::Vector2I v = GetTileByFaceID(IndexID / 3);
// Update AABBs
int tu = v.x / 16;
int tv = v.y / 16;
m_pAABB[tv * m_iNumUparts + tu].AddY(h);
} // SetHeight( index ID )
//------------------------------------------------------------------------------------
// Sets the terrain height by the tile position.
//------------------------------------------------------------------------------------
void TileTerrain::SetHeight( int Col, int Row, float h )
{
if (Col < 0 || Col >= m_iNumCols ||
Row < 0 || Row >= m_iNumRows)
return;
m_bPosChanged = true;
m_pPos[Row * m_iNumColspp + Col].Y = h;
m_pPos[Row * m_iNumColspp + Col + 1].Y = h;
m_pPos[(Row + 1) * m_iNumColspp + Col].Y = h;
m_pPos[(Row + 1) * m_iNumColspp + Col + 1].Y = h;
// Update AABBs
int tu = Col / 16;
int tv = Row / 16;
int mu = Col % 16;
int mv = Row % 16;
m_pAABB[tv * m_iNumUparts + tu].AddY(h);
if ((mu == 15 || mu == 0))
{
if (mu == 0 && tu != 0)
mu = -1;
else if (mu == 15 && tu != m_iNumUparts - 1)
mu = 1;
else
mu = -2;
}
else
mu = -2;
if ((mv == 15 || mv == 0))
{
if (mv == 0 && tv != 0)
mv = -1;
else if (mv == 15 && tv != m_iNumVparts - 1)
mv = 1;
else
mv = -2;
}
else
mv = -2;
if (mu != -2)
{
m_pAABB[tv * m_iNumUparts + tu + mu].AddY(h);
}
if (mv != -2)
{
m_pAABB[(tv + mv) * m_iNumUparts + tu].AddY(h);
}
} // SetHeight ( Col, Row )
//------------------------------------------------------------------------------------
// Sets the terrain color by the index id.
//------------------------------------------------------------------------------------
void TileTerrain::SetVertexColor( int IndexID, gfx::Color c )
{
m_bNorTexChanged = true;
m_pNorTexColor[m_pIndices[IndexID]].Color = c.c;
} // SetVertexColor
//------------------------------------------------------------------------------------
// Sets the terrain color by the tile position.
//------------------------------------------------------------------------------------
void TileTerrain::SetVertexColor( int Col, int Row, gfx::Color c )
{
if (Col < 0 || Col >= m_iNumCols ||
Row < 0 || Row >= m_iNumRows)
return;
m_bNorTexChanged = true;
m_pNorTexColor[Row * m_iNumColspp + Col].Color = c.c;
m_pNorTexColor[Row * m_iNumColspp + Col + 1].Color = c.c;
m_pNorTexColor[(Row + 1) * m_iNumColspp + Col].Color = c.c;
m_pNorTexColor[(Row + 1) * m_iNumColspp + Col + 1].Color = c.c;
} // SetVertexColor
//------------------------------------------------------------------------------------
// Adds the terrain height by the index id.
//------------------------------------------------------------------------------------
void TileTerrain::SetHeightAdd( int IndexID, float h )
{
m_bPosChanged = true;
m_pPos[m_pIndices[IndexID]].Y += h;
math::Vector2I v = GetTileByFaceID(IndexID / 3);
// Update AABBs
int tu = v.x / 16;
int tv = v.y / 16;
m_pAABB[tv * m_iNumUparts + tu].AddY(m_pPos[m_pIndices[IndexID]].Y);
} // SetHeightAdd
//------------------------------------------------------------------------------------
// Adds the terrain height by the tile position.
//------------------------------------------------------------------------------------
void TileTerrain::SetHeightAdd( int Col, int Row, float h )
{
if (Col < 0 || Col >= m_iNumCols ||
Row < 0 || Row >= m_iNumRows)
return;
m_bPosChanged = true;
m_pPos[Row * m_iNumColspp + Col].Y += h;
m_pPos[Row * m_iNumColspp + Col + 1].Y += h;
m_pPos[(Row + 1) * m_iNumColspp + Col].Y += h;
m_pPos[(Row + 1) * m_iNumColspp + Col + 1].Y += h;
// Update AABBs
int tu = Col / 16;
int tv = Row / 16;
int mu = Col % 16;
int mv = Row % 16;
m_pAABB[tv * m_iNumUparts + tu].AddY(m_pPos[Row * m_iNumColspp + Col].Y);
m_pAABB[tv * m_iNumUparts + tu].AddY(m_pPos[Row * m_iNumColspp + Col + 1].Y);
m_pAABB[tv * m_iNumUparts + tu].AddY(m_pPos[(Row + 1) * m_iNumColspp + Col].Y);
m_pAABB[tv * m_iNumUparts + tu].AddY(m_pPos[(Row + 1) * m_iNumColspp + Col + 1].Y);
if ((mu == 15 || mu == 0))
{
if (mu == 0 && tu != 0)
mu = -1;
else if (mu == 15 && tu != m_iNumUparts - 1)
mu = 1;
else
mu = -2;
}
else
mu = -2;
if ((mv == 15 || mv == 0))
{
if (mv == 0 && tv != 0)
mv = -1;
else if (mv == 15 && tv != m_iNumVparts - 1)
mv = 1;
else
mv = -2;
}
else
mv = -2;
if (mu != -2)
{
if (mu == -1)
{
m_pAABB[tv * m_iNumUparts + tu + mu].AddY(m_pPos[Row * m_iNumColspp + Col].Y);
m_pAABB[tv * m_iNumUparts + tu + mu].AddY(m_pPos[(Row + 1) * m_iNumColspp + Col].Y);
}
else
{
m_pAABB[tv * m_iNumUparts + tu + mu].AddY(m_pPos[Row * m_iNumColspp + Col + 1].Y);
m_pAABB[tv * m_iNumUparts + tu + mu].AddY(m_pPos[(Row + 1) * m_iNumColspp + Col + 1].Y);
}
}
if (mv != -2)
{
if (mv == -1)
{
m_pAABB[(tv + mv) * m_iNumUparts + tu].AddY(m_pPos[Row * m_iNumColspp + Col].Y);
m_pAABB[(tv + mv) * m_iNumUparts + tu].AddY(m_pPos[Row * m_iNumColspp + Col + 1].Y);
}
else
{
m_pAABB[(tv + mv) * m_iNumUparts + tu].AddY(m_pPos[(Row + 1) * m_iNumColspp + Col].Y);
m_pAABB[(tv + mv) * m_iNumUparts + tu].AddY(m_pPos[(Row + 1) * m_iNumColspp + Col + 1].Y);
}
}
} // SetHeightAdd ( Col, Row )
//------------------------------------------------------------------------------------
// Gets the column number and row number by Face index.
//------------------------------------------------------------------------------------
math::Vector2I TileTerrain::GetTileByFaceID( int FaceID )
{
math::Vector2I v;
v.y = m_pNorTexColor[m_pIndices[FaceID * 3]].tex.Y;
v.x = m_pNorTexColor[m_pIndices[FaceID * 3]].tex.X - 1;
return v;
} // GetTileByFaceID
//------------------------------------------------------------------------------------
// Returns the DynamicTriangleMesh pointer and send updates to it if needed.
//------------------------------------------------------------------------------------
void TileTerrain::SetDynamicTriangleMesh( ph::DynamicTriangleMesh* pDTM )
{
if (m_pDTM)
m_pDTM->DecRef();
m_pDTM = pDTM;
m_pDTM->AddRef();
} // SetDynamicTriangleMesh
//------------------------------------------------------------------------------------
// Recalculate the terrain normals
//------------------------------------------------------------------------------------
void TileTerrain::UpdateNormals()
{
m_bNorTexChanged = true;
gfx::RecalculateNormals_Smooth32<gfx::VertexNTC>(m_pPos, m_pNorTexColor, m_iNumVerts, m_pIndices, m_iNumIndices);
if (m_pNormalMapTileTexture || m_pMaterial[0].ppTexture[1])
{
gfx::CalcBinormalsTangents32(m_pPos, m_pNorTexColor, m_pMesh->m_pTangentBinormal, m_iNumVerts, m_pIndices, m_iNumIndices);
}
} // UpdateNormals
//------------------------------------------------------------------------------------
// Create a decal and return its pointer.
//------------------------------------------------------------------------------------
Decal* TileTerrain::CreateDecal(int sizeX, int sizeY, gfx::Texture* pTex)
{
if (sizeX >= m_iNumRows || sizeY >= m_iNumCols)
{
const int newSizeX = sizeX >= m_iNumRows ? m_iNumRows - 1 : sizeX;
const int newSizeY = sizeY >= m_iNumCols ? m_iNumCols - 1 : sizeY;
io::Logger::Log(io::ELM_Warning, "Decal size (%d, %d) is bigger than terrain, size reduced to (%d, %d).",
sizeX, sizeY, newSizeX, newSizeY);
return this->CreateDecal(newSizeX, newSizeY, pTex);
}
// Find a place in vertex buffer for this decal texture
MapDecalData::iterator it = m_mDecalBufferData.find(pTex->GetHandle());
DecalData * pDecalData = NULL;
// not found
if (it == m_mDecalBufferData.end())
{
pDecalData = KGE_NEW(DecalData);
pDecalData->vbOffset = 0;
pDecalData->ibOffset = 0;
pDecalData->vbSizeTotal = 1600;
pDecalData->ibSizeTotal = 6000;
pDecalData->VertexBuffer = m_pRenderer->CreateVertexBuffer(NULL, 1600, gfx::EVT_V3T, true);
pDecalData->IndexBuffer = m_pRenderer->CreateIndexBuffer(NULL, 5400, gfx::EIBT_16Bit, true);
pDecalData->Vertices = KGE_NEW_ARRAY(gfx::Vertex3T, 1600);
m_mDecalBufferData.insert(MapDecalData::value_type(pTex->GetHandle(), pDecalData));
}
// found
else
{
pDecalData = it->second;
}
// Check for empty space
bool bEmptyFound = false;
RemovedDecal rd = {0};
rd.VertexSize = (sizeX + 2) * (sizeY + 2);
for (size_t i = 0; i < pDecalData->Space.size(); i++)
{
if (pDecalData->Space[i].VertexSize == rd.VertexSize)
{
rd.ibOffset = pDecalData->Space[i].ibOffset;
rd.vbOffset = pDecalData->Space[i].vbOffset;
pDecalData->Space.erase(pDecalData->Space.begin() + i);
bEmptyFound = true;
break;
}
}
if (!bEmptyFound)
{
// check if vertex buffer is full
if (rd.VertexSize + pDecalData->vbOffset >= pDecalData->vbSizeTotal)
{
// we need to expand our vertex buffer
while (rd.VertexSize + pDecalData->vbOffset >= pDecalData->vbSizeTotal)
{
pDecalData->vbSizeTotal += 1600;
}
KGE_DELETE(pDecalData->VertexBuffer, HardwareBuffer);
pDecalData->VertexBuffer = m_pRenderer->CreateVertexBuffer(NULL, pDecalData->vbSizeTotal, gfx::EVT_V3T, true);
gfx::Vertex3T* pNewVertices = KGE_NEW_ARRAY(gfx::Vertex3T, pDecalData->vbSizeTotal);
memcpy(pNewVertices, pDecalData->Vertices, pDecalData->vbOffset * sizeof(gfx::Vertex3T));
KGE_DELETE_ARRAY(pDecalData->Vertices);
pDecalData->Vertices = pNewVertices;
// SetDecals
for (size_t i = 0; i < pDecalData->Decals.size(); i++)
{
pDecalData->Decals[i]->m_pVertices = &pNewVertices[pDecalData->Decals[i]->m_iVbOffset];
}
}
// check if index buffer is full
if ((sizeX + 1) * (sizeY + 1) * 6 + pDecalData->ibOffset >= pDecalData->ibSizeTotal)
{
while ((sizeX + 1) * (sizeY + 1) * 6 + pDecalData->ibOffset >= pDecalData->ibSizeTotal)
{
pDecalData->ibSizeTotal += 6000;
}
KGE_DELETE(pDecalData->IndexBuffer, HardwareBuffer);
pDecalData->IndexBuffer = m_pRenderer->CreateIndexBuffer(NULL, pDecalData->ibSizeTotal, gfx::EIBT_16Bit, true);
u16* pTemp = KGE_NEW_ARRAY(u16, pDecalData->ibSizeTotal);
// SetIndex
for (size_t i = 0; i < pDecalData->Decals.size(); i++)
{
memcpy(&pTemp[pDecalData->Decals[i]->m_iIbOffset], pDecalData->Decals[i]->m_pIndices, pDecalData->Decals[i]->m_iICount * 2);
}
pDecalData->IndexBuffer->SetData(pTemp, 0, pDecalData->ibOffset);
KGE_DELETE_ARRAY(pTemp);
}
rd.ibOffset = pDecalData->ibOffset;
rd.vbOffset = pDecalData->vbOffset;
}
Decal* pDecal = KGE_NEW(Decal)();
gfx::Vertex3T* pVerts = &pDecalData->Vertices[rd.vbOffset];
pDecal->m_ppVertexBuffer = &pDecalData->VertexBuffer;
pDecal->m_ppIndexBuffer = &pDecalData->IndexBuffer;
pDecal->m_iIbOffset = rd.ibOffset;
pDecal->m_iVbOffset = rd.vbOffset;
pDecal->m_pTerrain = this;
pDecal->m_iIndex = pTex->GetHandle();
int iOffset = rd.vbOffset;
if (!bEmptyFound)
pDecalData->vbOffset += rd.VertexSize;
u16* pIndices = KGE_NEW_ARRAY(u16, (sizeX + 1) * (sizeY + 1) * 6);
float fU = 1.0f / (float)sizeX;
float fV = 1.0f / (float)sizeY;
int sizeXpp = sizeX + 1;
int sizeXp2 = sizeX + 2;
int sizeYpp = sizeY + 1;
for (int y = 0; y < sizeY + 2; y++)
{
for (int x = 0; x < sizeXp2; x++)
{
pVerts[y * sizeXp2 + x].pos.X = x * m_fWidth;
pVerts[y * sizeXp2 + x].pos.Z = y * m_fHeight;
pVerts[y * sizeXp2 + x].pos.Y = 0.0f;
pVerts[y * sizeXp2 + x].tex.X = x * fU;
pVerts[y * sizeXp2 + x].tex.Y = y * fV;
} // for x
} // for y
int k = 0;
for (int y = 0; y < sizeYpp; y++)
{
for (int x = 0; x < sizeXpp; x++)
{
pIndices[k ] = (y * sizeXp2 + x) + 1 + iOffset;
pIndices[k + 1] = (y * sizeXp2 + x) + iOffset;
pIndices[k + 2] = ((y + 1) * sizeXp2 + x) + iOffset;
pIndices[k + 3] = (y * sizeXp2 + x) + 1 + iOffset;
pIndices[k + 4] = ((y + 1) * sizeXp2 + x) + iOffset;
pIndices[k + 5] = ((y + 1) * sizeXp2 + x) + 1 + iOffset;
k += 6;
} // for x
} // for y
pDecal->m_eVertexType = gfx::EVT_V3T;
pDecal->m_pIndices = pIndices;
pDecal->m_pMaterial
->ppTexture[0] = pTex;
pDecal->m_pMaterial
->Alpha = true;
pDecal->m_pVertices = pVerts;
pDecal->m_iVCount = sizeXp2 * (sizeY + 2);
pDecal->m_iICount = sizeXpp * sizeYpp * 6;
pDecal->m_iSizeX = sizeX;
pDecal->m_iSizeY = sizeY;
pDecal->m_fU = fU;
pDecal->m_fV = fV;
gfx::ShaderInstance* si = KGE_NEW(gfx::ShaderInstance)();
si->m_pVertexShader = m_pVSdecal;
si->m_pPixelShader = m_pPSdecal;
si->m_pFun = m_pDecalFun;
si->m_pUserData = (void*)pDecal;
pDecal->m_pMaterial
->shader = si;
// Set indexes to index buffer
pDecalData->IndexBuffer->SetData(pIndices,
rd.ibOffset, pDecal->m_iICount);
if (!bEmptyFound)
pDecalData->ibOffset += pDecal->m_iICount;
m_pVSdecal->AddRef();
m_pPSdecal->AddRef();
m_pSnMan->AddSceneNode(pDecal, ENT_Decal);
pDecalData->Decals.push_back(pDecal);
return pDecal;
} // CreateDecal
//------------------------------------------------------------------------------------
// Sets the decal on position
//------------------------------------------------------------------------------------
void TileTerrain::SetDecal( float fx, float fy, Decal* pDecal )
{
int ix = (int)(fx / m_fWidth);
int iy = (int)(fy / m_fHeight);
if (ix < 0 || ix > m_iNumCols - pDecal->m_iSizeX - 1 || iy < 0 || iy > m_iNumRows - pDecal->m_iSizeY - 1)
return;
float fu = (fx / m_fHeight) - ix;
float fv = (fy / m_fHeight) - iy;
fu /= pDecal->m_iSizeX;
fv /= pDecal->m_iSizeY;
pDecal->GetAbsoluteMatrix()->_41 = ix * m_fWidth + m_fXOffset;
pDecal->GetAbsoluteMatrix()->_43 = iy * m_fHeight + m_fYOffset;
for (int y = 0; y < pDecal->m_iSizeY + 2; y++)
{
for (int x = 0; x < pDecal->m_iSizeX + 2; x++)
{
pDecal->m_pVertices[y * (pDecal->m_iSizeX + 2) + x].pos.Y
= m_pPos[(iy + y) * m_iNumColspp + ix + x].Y + 0.05f;
pDecal->m_pVertices[y * (pDecal->m_iSizeX + 2) + x].tex.X = x * pDecal->m_fU - fu;
pDecal->m_pVertices[y * (pDecal->m_iSizeX + 2) + x].tex.Y = y * pDecal->m_fV - fv;
} // for x
} // for y
pDecal->m_bPosChanged = true;
} // SetDecal
//------------------------------------------------------------------------------------
// Creates the terrain shader code
//------------------------------------------------------------------------------------
void TileTerrain::CreateShaderCode(core::String &VertexCode, core::String &PixelCode)
{
// Create vertex shader
VertexCode = "float4x4 matViewProjection;\n"\
"float4x4 matView;\n"\
"float3 DirLit;\n"\
"float3 fvEyePosition;\n";
if (m_bReceiveShadow)
{
VertexCode += "float4x4 matLight;\n";
}
VertexCode += "struct VS_INPUT\n"\
"{\n"\
"float4 Position : POSITION0;\n"\
"float3 Normal : NORMAL;\n"\
"float2 Texcoord : TEXCOORD0;\n"\
"float4 color : COLOR0;\n";
if (m_pNormalMapTileTexture)
{
VertexCode += " float3 Binormal : BINORMAL0;\n"\
" float3 Tangent : TANGENT0;\n";
}
VertexCode += "};\n"\
"struct VS_OUTPUT \n"\
"{\n"\
"float4 Position : POSITION0;\n"\
"float2 Texcoord : TEXCOORD0;\n"\
"float Height: TEXCOORD2;\n"\
"float4 color : COLOR0;\n";
if (m_bReceiveShadow)
{
VertexCode += " float4 ProjTex: TEXCOORD3;\n";
}
if (m_pNormalMapTileTexture)
{
VertexCode += "float3 ViewDirection : TEXCOORD4;\n"\
" float3 LightDirection: TEXCOORD5;\n";
}
else
{
VertexCode += "float Lit: TEXCOORD1;\n";
}
VertexCode += "};\n"\
"VS_OUTPUT main( VS_INPUT Input )\n"\
"{\n"\
"VS_OUTPUT Output;\n"\
"Output.Position = mul( Input.Position, matViewProjection );\n"\
"Output.Texcoord = Input.Texcoord;\n"\
"Output.Height = Input.Position.y / 25.0;\n"\
"Output.color = Input.color;\n";
if (m_bReceiveShadow)
{
VertexCode += "Output.ProjTex = mul( Input.Position, matLight );\n";
}
if (m_pNormalMapTileTexture)
{
VertexCode += "float3 fvObjectPosition = mul( Input.Position, matView ).xyz;\n"\
"float3 fvNormal = mul( float4(Input.Normal, 1.0), matView ).xyz;\n"\
"float3 fvBinormal = mul( float4(Input.Binormal, 1.0), matView ).xyz;\n"\
"float3 fvTangent = mul( float4(Input.Tangent, 1.0), matView ).xyz;\n"\
"float3 fvViewDirection = fvEyePosition - fvObjectPosition;\n"\
"Output.ViewDirection.x = dot( fvTangent, fvViewDirection );\n"\
"Output.ViewDirection.y = dot( fvBinormal, fvViewDirection );\n"\
"Output.ViewDirection.z = dot( fvNormal, fvViewDirection );\n"\
"Output.LightDirection.x = dot( fvTangent, DirLit );\n"\
"Output.LightDirection.y = dot( fvBinormal, DirLit );\n"\
"Output.LightDirection.z = dot( fvNormal, DirLit );\n";
}
else
{
VertexCode += "Output.Lit = 0.5 * dot(DirLit, Input.Normal) + 0.5;\n";
}
VertexCode += "return( Output );\n"\
"}";
// Create pixel shader
PixelCode = "sampler2D baseMap;\n"\
"sampler2D BlendMap;\n"\
"sampler2D TextureID;\n"\
"sampler2D TextureBlend;\n"\
"sampler2D TextureUnder;\n";
if (m_bReceiveShadow)
{
PixelCode += m_pShadowShaderCode;
}
if (m_pNormalMapTileTexture)
{
PixelCode += "sampler2D bumpMap;\n";
}
PixelCode += "struct PS_INPUT \n"\
"{\n"\
" float2 Texcoord : TEXCOORD0;\n"\
" float Height: TEXCOORD2;\n"\
" float4 color : COLOR0;\n";
if (m_bReceiveShadow)
{
PixelCode += " float4 ProjTex: TEXCOORD3;\n";
}
if (m_pNormalMapTileTexture)
{
PixelCode += "float3 ViewDirection : TEXCOORD4;\n"\
" float3 LightDirection: TEXCOORD5;\n";
}
else
{
PixelCode += "float Lit: TEXCOORD1;\n";
}
PixelCode += "};\n"\
"float4 main( PS_INPUT Input ) : COLOR0\n"\
"{\n";
// if want under water coloring
if (m_bWater)
{
PixelCode += " float4 c1 = float4(";
PixelCode += m_cStart.c[0];
PixelCode += ", ";
PixelCode += m_cStart.c[1];
PixelCode += ", ";
PixelCode += m_cStart.c[2];
PixelCode += ", 1);\n"\
" float4 c2 = float4(";
PixelCode += m_cEnd.c[0];
PixelCode += ", ";
PixelCode += m_cEnd.c[1];
PixelCode += ", ";
PixelCode += m_cEnd.c[2];
PixelCode += ", 1);\n";
}
PixelCode += " float2 m[16] = \n"\
" {\n"\
" float2(0.0, 0.0),\n"\
" float2(0.25, 0.0),\n"\
" float2(0.5, 0.0),\n"\
" float2(0.75, 0.0),\n"\
" float2(0.0, 0.25),\n"\
" float2(0.25, 0.25),\n"\
" float2(0.5, 0.25),\n"\
" float2(0.75, 0.25),\n"\
" float2(0.0, 0.5),\n"\
" float2(0.25, 0.5),\n"\
" float2(0.5, 0.5),\n"\
" float2(0.75, 0.5),\n"\
" float2(0.0, 0.75),\n"\
" float2(0.25, 0.75),\n"\
" float2(0.5, 0.75),\n"\
" float2(0.75, 0.75)\n"\
" };\n"\
" float4 d = tex2D( TextureID, Input.Texcoord * float2( ";
// Set the texture ID size
PixelCode += (float)(1.0f / (float)m_iTextureIDSizeX);
PixelCode += " , ";
PixelCode += (float)(1.0f / (float)m_iTextureIDSizeY);
PixelCode += " ) );\n"\
" float4 b = tex2D( TextureBlend, Input.Texcoord * float2( ";
PixelCode += (float)(1.0f / (float)m_iTextureIDSizeX);
PixelCode += " , ";
PixelCode += (float)(1.0f / (float)m_iTextureIDSizeY);
PixelCode += " ) );\n"\
" float2 z = Input.Texcoord * float2( ";
// Sets the tile texture size
PixelCode += m_pTileTexture->GetU();
PixelCode += " , ";
PixelCode += m_pTileTexture->GetV();
PixelCode += " ) ;\n"\
" float2 tex;\n"\
" tex.x = z.x - d.r;\n"\
" tex.y = z.y - d.g;\n";
// Normal map
if (m_pNormalMapTileTexture)
{
PixelCode += "float4 fvSpecular = {0.5188, 0.5065, 0.3195, 1};\n"\
"float3 fvLightDirection = normalize( Input.LightDirection );\n"\
"float3 fvNormal = tex2D( bumpMap, tex ).wyz;\n";
}
PixelCode += " float4 c;\n"\
" if (b.a < 0.9)\n"\
" {\n"\
" float2 t = m[b.a * 20];\n"\
" float2 s = (int2)(Input.Texcoord) * 0.25;\n"\
" float4 a = tex2D( BlendMap, Input.Texcoord * 0.25 - s + t );\n"\
" t.x = z.x - d.b;\n"\
" t.y = z.y - d.a;\n"\
" c = (1 - a.r) * tex2D( baseMap, tex) + a.r * tex2D( baseMap, t);\n";
if (m_pNormalMapTileTexture)
{
// blend normals
PixelCode += "fvNormal.xy = (1 - a.r) * fvNormal.xy + a.r * tex2D( bumpMap, t ).wy;\n";
}
PixelCode += " }\n"\
" else\n"\
" c = tex2D( baseMap, tex);\n";
// Calc normal map
if (m_pNormalMapTileTexture)
{
PixelCode += "fvNormal = normalize( ( fvNormal * 2.0f ) - 1.0f );\n"\
"float fNDotL = max(0.25, dot( fvNormal, fvLightDirection )) + 0.2; \n"\
"float3 fvReflection = normalize( ( ( 2.0f * fvNormal ) * ( fNDotL ) ) - fvLightDirection ); \n"\
"float3 fvViewDirection = normalize( Input.ViewDirection );\n"\
"float fRDotV = max( 0.0f, dot( fvReflection, fvViewDirection ) );\n";
}
io::Logger::Log(io::ELM_Warning, "%d b", m_bCaustics);
if (m_bWater || m_bCaustics)
{
PixelCode += " float4 col = float4(1, 1, 1, 1);\n"\
" if (Input.Height < 0.0)\n"\
" {\n"\
" Input.Height *= -1.0;\n";
if (m_bWater)
{
PixelCode += " col = lerp(c1, c2, Input.Height);\n";
}
if (m_bCaustics)
{
PixelCode += " float4 under = tex2D(TextureUnder, Input.Texcoord * 0.1);\n";
if (m_bWater)
PixelCode += " col += under / ((Input.Height * 0.2 + 1.5) );\n";
else
PixelCode += " col = under / ((Input.Height * 0.2 + 1.5) * 0.5);\n";
}
PixelCode += " }\n";
}
if (m_bReceiveShadow)
{
PixelCode += "Input.ProjTex.xy /= Input.ProjTex.w;\n"\
"Input.ProjTex.x = 0.5f * Input.ProjTex.x + 0.5f;\n"\
"Input.ProjTex.y = -0.5f * Input.ProjTex.y + 0.5f;\n";
}
if (m_bReceiveShadow && m_pNormalMapTileTexture)
{
PixelCode += "float shad = GetShadow(Input.ProjTex.xy);\n"\
"float4 spec = float4(0,0,0,0);\n"\
"if (shad > 0.8f)\n"\
"spec = c.a * fvSpecular * pow( fRDotV, 10 /*fSpecularPower*/ );\n";
}
PixelCode += " float4 dd = ";
if (m_bWater || m_bCaustics)
{
PixelCode += "col * ";
}
if (m_bReceiveShadow && !m_pNormalMapTileTexture)
{
PixelCode += "GetShadow(Input.ProjTex.xy) * ";
}
if (m_pNormalMapTileTexture && !m_bReceiveShadow)
{
PixelCode += "c * fNDotL * Input.color * float4(0.9863, 0.9850, 0.9850, 1.0) + fvSpecular * pow( fRDotV, 25 /*fSpecularPower*/ ); \n";
}
else if (m_pNormalMapTileTexture && m_bReceiveShadow)
{
PixelCode += "c * fNDotL * Input.color * float4(0.9863, 0.9850, 0.9850, 1.0) * shad + spec ; \n";
}
else
{
PixelCode += "c * Input.Lit * Input.color; \n";
}
PixelCode += " dd.a = Input.Height * 0.05;\n"\
" return dd;\n"\
"}\n";
io::Logger::Log(VertexCode.ToCharPointer());
io::Logger::Log(PixelCode.ToCharPointer());
//io::File f;
//f.Open("e:/ter1ps.txt", true);
//f.write((void*)PixelCode.ToCharPointer(), PixelCode.GetLenght() / 2);
//f.write((void*)(PixelCode.ToCharPointer() + PixelCode.GetLenght() / 2), PixelCode.GetLenght() / 2);
//f.Open("e:/ter1vs.txt", true);
//f.write((void*)VertexCode.ToCharPointer(), VertexCode.GetLenght());
} // CreateShaderCode
//------------------------------------------------------------------------------------
// Enables the under water vertex coloring effect.
//------------------------------------------------------------------------------------
void TileTerrain::EnableWater( bool Enable,
const gfx::Colorf& cStart /*= gfx::Colorf(255, 255, 255)*/,
const gfx::Colorf& cEnd /*= gfx::Colorf(0, 229, 255)*/ )
{
m_bWater = Enable;
m_cStart = cStart;
m_cEnd = cEnd;
} // EnableWater
//------------------------------------------------------------------------------------
// Enable and sets the caustics textures.
//------------------------------------------------------------------------------------
void TileTerrain::SetCaustics( gfx::Texture** ppTextures, int TexturesCount, int speed /*= 100*/ )
{
if (TexturesCount <= 0)
{
m_bCaustics = false;
KGE_DELETE(m_pCausticsTimer, Timer);
return;
}
if (!m_pCausticsTimer)
m_pCausticsTimer = KGE_NEW(core::Timer)();
m_bCaustics = true;
m_iCurrentCaustic = 0;
m_ppCausticsTextures = ppTextures;
m_iNumCausticsTextures = TexturesCount;
m_pCausticsTimer->Interval = speed;
} // SetCaustics
//------------------------------------------------------------------------------------
// Sets the shader params
//------------------------------------------------------------------------------------
void TileTerrain::SetShaderParams()
{
// Get lights
Light* pLit = m_pSnMan->GetNearestLight(math::Vector());
math::Vector dir = pLit->GetLightData()->Direction;
//dir.Negate();
//dir.Normalize();
//io::Logger::Log(io::ELM_Warning, "dir=%f %f %f", dir.x, dir.y, dir.z);
m_pVshader->SetConstant(m_shLit, &dir.x, 3);
// GET WVP
math::Matrix mat = m_pRenderer->GetTransForm(kge::gfx::ETM_Projection) *
m_pRenderer->GetTransForm(kge::gfx::ETM_View) * (*m_pFinalMat);
m_pVshader->SetConstant(m_shWVP, mat.m_fMat, 16);
if (m_bReceiveShadow)
m_pVshader->SetConstant(m_shShadowMat, m_pShadowMatrix->m_fMat, 16);
if (m_shView)
m_pVshader->SetConstant(m_shView, m_pSnMan->GetActiveCamera()->GetViewMatrix().m_fMat, 16);
if (m_pNormalMapTileTexture || m_pMaterial[0].ppTexture[1] )
{
kge::sn::SceneNode* pCam = m_pSnMan->GetActiveCamera();
math::Vector vp = pCam->GetPosition();
mat.Identity();
mat.Inverse();
mat.TransFormVec2(dir);
mat.TransFormVec2(vp);
dir.Normalize();
m_pVshader->SetConstant(m_shLit, &dir.x, 3);
mat.Identity();
//m_pVshader->SetConstant(m_shView, mat.m_fMat, 16);
//vp.Normalize();
//vp = vp * 100.0f;
//(0, 0, 0);//(-mat._14, -mat._24, -mat._34);//
m_pVshader->SetConstant(m_shfvEyePosition, &vp.x, 3);
}
userSetShaderParams();
} // SetShaderParams
//------------------------------------------------------------------------------------
// Create an array of Y position vertices and return
//------------------------------------------------------------------------------------
void TileTerrain::GetYs(float* h)
{
for( int i = 0; i < m_iNumVerts; i++ )
h[i] = m_pPos[i].Y;
} // GetYs
//------------------------------------------------------------------------------------
// Sets the heights
//------------------------------------------------------------------------------------
void TileTerrain::SetYs( float* pHeights )
{
m_bPosChanged = true;
for (int i = 0; i < m_iNumUparts * m_iNumVparts; i++)
{
m_pAABB[i].ResetY();
}
int u, v;
for( int i = 0; i < m_iNumVerts; i++ )
{
m_pPos[i].Y = pHeights[i];
u = (m_pNorTexColor[i].tex.X ) / 16;
v = (m_pNorTexColor[i].tex.Y ) / 16;
if (u >= m_iNumUparts)
u--;
if (v >= m_iNumVparts)
v--;
m_pAABB[v * m_iNumUparts + u].AddY(pHeights[i]);
}
} // SetYs
//------------------------------------------------------------------------------------
// Returns the tile count if you pass the NULL and set them otherwise
//------------------------------------------------------------------------------------
int TileTerrain::GetTiles(int *pTiles1, int* pTiles2)
{
int tilescount = m_iNumCols * m_iNumRows;
if (!pTiles1 || !pTiles2)
return tilescount;
memcpy(pTiles1, m_pTiles, sizeof(int) * tilescount);
memcpy(pTiles2, m_pTiles2, sizeof(int) * tilescount);
return tilescount;
} // GetTiles
//------------------------------------------------------------------------------------
// Sets the tiles
//------------------------------------------------------------------------------------
void TileTerrain::SetTiles(int *pTiles1, int* pTiles2)
{
for (int j = 0; j < m_iNumRows; j++)
{
for (int i = 0; i < m_iNumCols; i++)
{
SetTile(i, j, pTiles1[j * m_iNumCols + i], pTiles2[j * m_iNumCols + i]);
} // for i
} // for j
} // SetTiles
//------------------------------------------------------------------------------------
// Returns blend map size if you pass NULL and set the pointer otherwise
//------------------------------------------------------------------------------------
int TileTerrain::GetBlendMap(u8* pBlendMap)
{
int tilescount = m_iNumCols * m_iNumRows;
if (!pBlendMap)
return tilescount;
memcpy(pBlendMap, m_pBlendTiles, tilescount);
return tilescount;
} // GetBlendMap
//------------------------------------------------------------------------------------
// Sets the blend map
//------------------------------------------------------------------------------------
void TileTerrain::SetBlendMap(u8* pBlendMap)
{
int tilescount = m_iNumCols * m_iNumRows;
memcpy(m_pBlendTiles, pBlendMap, tilescount);
m_pTextureBlend->SetData(0, 0, m_iNumCols, m_iNumRows ,m_pBlendTiles, tilescount);
} // SetBlendMap
//------------------------------------------------------------------------------------
// Copy the vertex colors to the pointer
//------------------------------------------------------------------------------------
void TileTerrain::GetVertexColors(ul32* pVertexColor)
{
for (int i = 0; i < m_iNumVerts; i++)
{
pVertexColor[i] = m_pNorTexColor[i].Color;
}
} // GetVertexColors
//------------------------------------------------------------------------------------
// Copy the vertex colors from the pointer
//------------------------------------------------------------------------------------
void TileTerrain::SetVertexColors(ul32* pVertexColor)
{
m_bNorTexChanged = true;
for (int i = 0; i < m_iNumVerts; i++)
{
m_pNorTexColor[i].Color = pVertexColor[i];
}
} // SetVertexColors
void TileTerrain::ReceiveShadow( const char* Code, math::Matrix* shadowmat )
{
if ( Code && shadowmat)
{
m_bReceiveShadow = true;
m_pShadowShaderCode = Code;
m_pShadowMatrix = shadowmat;
}
else
{
m_bReceiveShadow = false;
m_pShadowShaderCode = 0;
m_pShadowMatrix = 0;
}
} // ReceiveShadow
void TileTerrain::SetDecalShaderParams( gfx::ShaderInstance* pSI )
{
math::Matrix mat = m_pRenderer->GetTransForm(gfx::ETM_Projection)
* m_pRenderer->GetTransForm(gfx::ETM_View)
* *((Decal*)(pSI->m_pUserData))->GetAbsoluteMatrix();
pSI->m_pVertexShader->SetConstant(m_shDecalWVP, mat.m_fMat, 16);
float f = ((Decal*)(pSI->m_pUserData))->m_alpha;
pSI->m_pPixelShader->SetConstant(m_shDecalAlpha, &f, 1);
} // SetDecalShaderParams
void TileTerrain::SetNormalMapTileTexture( gfx::TileTexture * pTileTex )
{
m_pNormalMapTileTexture = pTileTex;
}
//------------------------------------------------------------------------------------
// Smooths the tile height
//------------------------------------------------------------------------------------
void TileTerrain::Smooth( int Col, int Row )
{
SmoothOneNode(Col, Row);
SmoothOneNode(Col + 1, Row);
SmoothOneNode(Col, Row + 1);
SmoothOneNode(Col + 1, Row + 1);
} // Smooth
//------------------------------------------------------------------------------------
// Smooths one node height
//------------------------------------------------------------------------------------
void TileTerrain::SmoothOneNode( int Col, int Row )
{
if (Col < 1 || Col > m_iNumCols - 1 ||
Row < 1 || Row > m_iNumRows - 1)
return;
m_bPosChanged = true;
float h =
m_pPos[Row * m_iNumColspp + Col].Y +
m_pPos[Row * m_iNumColspp + Col + 1].Y +
m_pPos[(Row + 1) * m_iNumColspp + Col].Y +
m_pPos[(Row + 1) * m_iNumColspp + Col + 1].Y +
m_pPos[Row * m_iNumColspp + Col - 1].Y +
m_pPos[(Row - 1) * m_iNumColspp + Col - 1].Y +
m_pPos[(Row + 1) * m_iNumColspp + Col - 1].Y +
m_pPos[(Row - 1) * m_iNumColspp + Col + 1].Y +
m_pPos[(Row - 1) * m_iNumColspp + Col].Y ;
m_pPos[Row * m_iNumColspp + Col].Y = h / 9.0f;
} // SmoothOneNode
//------------------------------------------------------------------------------------
// Empty space in vertex buffer
//------------------------------------------------------------------------------------
void TileTerrain::RemoveDecal( Decal* pDecal )
{
// Find a place in vertex buffer for this decal texture
MapDecalData::iterator it = m_mDecalBufferData.find(pDecal->m_iIndex);
// found
if (it != m_mDecalBufferData.end())
{
RemovedDecal rd;
rd.VertexSize = pDecal->m_iVCount;
rd.vbOffset = pDecal->m_iVbOffset;
rd.ibOffset = pDecal->m_iIbOffset;
it->second->Space.push_back(rd);
for (size_t i = 0; i < it->second->Decals.size(); i++)
{
if (it->second->Decals[i] == pDecal)
{
it->second->Decals.erase(it->second->Decals.begin() + i);
break;
}
}
}
} // RemoveDecal
//------------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------------
void TileTerrain::OnLost()
{
} // OnLost
//------------------------------------------------------------------------------------
// Refills vertex and index buffers after reseting device
//------------------------------------------------------------------------------------
void TileTerrain::OnReset()
{
if (m_pMesh)
m_pMesh->RefillBuffers();
UpdateNormals();
// Refill decals index buffer
size_t arraySize = 6000;
u16* pTemp = KGE_NEW_ARRAY(u16, arraySize);
for (MapDecalData::iterator it = m_mDecalBufferData.begin(), it_end = m_mDecalBufferData.end();
it != it_end; ++it)
{
DecalData* pDecalData = it->second;
if (pDecalData->ibSizeTotal > arraySize)
{
KGE_DELETE_ARRAY(pTemp);
arraySize = pDecalData->ibSizeTotal;
pTemp = KGE_NEW_ARRAY(u16, arraySize);
}
for (size_t i = 0, size = pDecalData->Decals.size(); i < size; ++i)
{
memcpy(
&pTemp[pDecalData->Decals[i]->m_iIbOffset],
pDecalData->Decals[i]->m_pIndices,
pDecalData->Decals[i]->m_iICount * 2);
}
pDecalData->IndexBuffer->SetData(pTemp, 0, pDecalData->ibOffset);
}
KGE_DELETE_ARRAY(pTemp);
//
m_pRenderer->SetTextureParams(gfx::ETP_Point, 1);
m_pRenderer->SetTextureParams(gfx::ETP_Mirror, 1);
m_pRenderer->SetTextureParams(gfx::ETP_Anisotropic, 4);
m_pRenderer->SetTextureParams(gfx::ETP_Anisotropic, 5);
} // OnReset
//------------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------------
void TileTerrain::RecreateShaders()
{
// Create shader
if (m_pVshader)
{
m_pVshader->DecRef();
m_pVshader = NULL;
}
if (m_pPshader)
{
m_pPshader->DecRef();
m_pPshader = NULL;
}
core::String VertexShaderCode;
core::String PixelShaderCode;
CreateShaderCode(VertexShaderCode, PixelShaderCode);
m_pVshader = gfx::Renderer::GetSingletonPtr()->CreateVertexShaderFromString
(VertexShaderCode.ToCharPointer(), "main", gfx::ESV_VS3);
m_pPshader = gfx::Renderer::GetSingletonPtr()->CreatePixelShaderFromString
(PixelShaderCode.ToCharPointer(), "main", gfx::ESV_PS3);
m_pVshader->ConnectOnPreRender(core::mem_fun(this, &TileTerrain::SetShaderParams));
m_shLit = m_pVshader->GetConstatnt("DirLit");
m_shWVP = m_pVshader->GetConstatnt("matViewProjection");
m_shView = m_pVshader->GetConstatnt("matView");
m_shfvEyePosition = m_pVshader->GetConstatnt("fvEyePosition");
if (m_bReceiveShadow)
m_shShadowMat = m_pVshader->GetConstatnt("matLight");
m_pRenderer->SetTextureParams(gfx::ETP_Point, 1);
m_pRenderer->SetTextureParams(gfx::ETP_Mirror, 1);
m_pRenderer->SetTextureParams(gfx::ETP_Anisotropic, 4);
m_pRenderer->SetTextureParams(gfx::ETP_Anisotropic, 5);
} // RecreateShaders
} // sn
} // kge
| [
"kocholsoft@yahoo.com"
] | kocholsoft@yahoo.com |
9ca217555f87e4f509cbcd406830ada1ce0dab81 | 808b3a49735d93a33802b86e122df29ffb61209e | /programmers/소수찾기.c++ | ccdd67502fb41d19e46a876d2a595848fe44492a | [] | no_license | KingJoo/programmers | 0deb1a9c5c615d0583f8142cd395d33186c3c255 | e51b2dadebdc75d10b07ea567775784e2ffa3cb8 | refs/heads/master | 2023-08-12T03:40:43.243599 | 2021-09-28T11:20:25 | 2021-09-28T11:20:25 | 410,730,410 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 315 | #include <string>
#include <vector>
#include <cmath>
using namespace std;
int solution(int n) {
vector<bool> a(n+1,0);
int c=0;
for(int i=2;i<=sqrt(n);i++)
if(!a[i])
for(int j=i+i;j<=n;j+=i)
a[j]=1;
for(int i=2;i<=n;i++)
if(!a[i]) c++;
return c;
} | [
"jkangju@gmail.com"
] | jkangju@gmail.com | |
9ff19b232d3bf6ad5bf9234d7d33857c8aee3df1 | a939dc2d3b64280fcc8874faa5bce93614bfaaae | /P1/main.cpp | 10726381569a9625e929cf1f38cde6c523fbd075 | [] | no_license | muscraziest/VC | c5174f55451fb11046104a088958d45770a5675a | 3d84b04ad46b7081c08430c9c2b3bbdb4ac1f208 | refs/heads/master | 2021-01-13T05:06:35.570580 | 2017-02-07T19:49:55 | 2017-02-07T19:49:55 | 81,247,235 | 0 | 0 | null | null | null | null | ISO-8859-1 | C++ | false | false | 13,861 | cpp | #include <stdio.h>
#include <opencv2/opencv.hpp>
#include <vector>
using namespace cv;
using namespace std;
/****************************************************************************************
Funciones auxiliares
****************************************************************************************/
//Funcion que lee una imagen desde un archivo y devuelve el objeto Mat donde se almacena
Mat leerImagen(string nombreArchivo, int flagColor = 1){
//Leemos la imagen con la función imread
Mat imagen = imread(nombreArchivo,flagColor);
//Comprobamos si se ha leído la imagen correctamente
if(!imagen.data)
cout << "Lectura incorrecta. La matriz esta vacía." << endl;
return imagen;
}
//Función que muestra una imagen por pantalla
void mostrarImagen(string nombreVentana, Mat &imagen, int tipoVentana = 1){
//Comprobamos que la imagen no esté vacía
if(imagen.data){
namedWindow(nombreVentana,tipoVentana);
//Mostramos la imagen con la función imshow
imshow(nombreVentana,imagen);
}
else
cout << "La imagen no se cargó correctamente." << endl;
}
//Función que muestra varias imágenes. Combina varias imágenes en una sola
void mostrarImagenes(string nombreVentana, vector<Mat> &imagenes){
//Primero calculamos el total de filas y columnas para la imagen que será la unión de todas las imágenes que queramos mostrar
int colCollage = 0;
int filCollage = 0;
int numColumnas = 0;
for(int i=0; i < imagenes.size(); ++i){
//Cambiamos la codificación del color de algunas imágenes para evitar fallos al hacer el collage
if (imagenes[i].channels() < 3) cvtColor(imagenes[i], imagenes[i], CV_GRAY2RGB);
//Sumamos las columnas
colCollage += imagenes[i].cols;
//Calculamos el máximo número de filas necesarias
if (imagenes[i].rows > filCollage) filCollage = imagenes[i].rows;
}
//Creamos la imagen con las dimensiones calculadas y todos los píxeles a 0
Mat collage = Mat::zeros(filCollage, colCollage, CV_8UC3);
Rect roi;
Mat imroi;
//Unimos todas las imágenes
for(int i=0; i < imagenes.size(); ++i){
roi = Rect(numColumnas, 0, imagenes[i].cols, imagenes[i].rows);
numColumnas += imagenes[i].cols;
imroi = Mat(collage,roi);
imagenes[i].copyTo(imroi);
}
//Mostramos la imagen resultante
mostrarImagen(nombreVentana,collage);
}
//Función para reajustar el rango de una matriz al rango [0,255] para poder mostrar correctamente las frecuencias altas
Mat reajustarRango(Mat imagen){
Mat canales_imagen[3];
Mat imagen_ajustada;
Mat canales_ajustada[3];
//Si la imagen es 1C
if(imagen.channels() == 1){
float min = 0;
float max = 255;
//Calculamos el rango en el que se mueven los valores de la imagen
for(int i=0; i < imagen.rows; ++i){
for(int j=0; j < imagen.cols; ++j){
if(imagen.at<float>(i,j) < min) min = imagen.at<float>(i,j);
if(imagen.at<float>(i,j) > max) max = imagen.at<float>(i,j);
}
}
imagen.copyTo(imagen_ajustada);
for(int i=0; i < imagen_ajustada.rows; ++i)
for(int j=0; j < imagen_ajustada.cols; ++j)
imagen_ajustada.at<float>(i,j) = 1.0*(imagen_ajustada.at<float>(i,j)-min)/(max-min)*255.0;
}
//Si la imagen es 3C
else if(imagen.channels() == 3){
split(imagen,canales_imagen);
for(int i=0; i < 3; ++i)
canales_ajustada[i] = reajustarRango(canales_imagen[i]);
merge(canales_ajustada,3,imagen_ajustada);
}
else
cout << "Número de canales no válido." << endl;
return imagen_ajustada;
}
/****************************************************************************************
APARTADO A: CONVOLUCIÓN
****************************************************************************************/
//Función para calcular el vector máscara
Mat calcularVectorMascara(float sigma){
/*Primero calculamos el numero de pixeles que tendrá el vector máscara: a*2+1 para obtener una máscara de orden impar
Utilizamos round para redondear los números que muestreemos del intervalo [-3sigma, 3sigma], el cual utilizamos para
quedarnos con la parte significativa de la gaussiana.
*/
int longitud = round(3*sigma)*2+1;
int centro = (longitud-1)/2; //elemento del centro del vector
//Calculamos el tamaño del paso de muestreo, teniendo en cuenta que el mayor peso lo va a tener el pixel central
//con el valor f(0)
float paso=6*sigma/(longitud-1);
//Creamos la imagen que contendrá los valores muestreados
Mat mascara = Mat(1,longitud,CV_32F);
//Cargamos los valores en la máscara
for(int i=0; i <=centro; ++i){
mascara.at<float>(0,i) = exp(-0.5*(-paso*(centro-1))*(-paso*(centro-1))/(sigma*sigma));
mascara.at<float>(0,longitud-i-1) = exp(-0.5*(paso*(centro-i))*(paso*(centro-i))/(sigma*sigma));
}
//Dividimos por la suma de todos para que los elementos sumen 1
float suma = 0.0;
for(int i=0; i < mascara.cols; ++i)
suma += mascara.at<float>(0,i);
mascara = mascara /suma;
return mascara;
}
//Función para calcular un vector preparado para hacer la convolución sin problemas en los píxeles cercanos a los bordes
Mat calcularVectorOrlado(const Mat &senal, Mat &mascara, int cond_contorno){
//Añadimos a cada lado del vector (longitud_senal -1)/2 píxeles, porque es el máximo número de píxeles que sobrarían
//al situar la máscara en la esquina.
Mat copia_senal;
//Trabajamos con vectores fila
if(senal.rows == 1)
copia_senal = senal;
else if(senal.cols == 1)
copia_senal = senal.t();
else
cout << "El vector senal no es vector fila o columna." << endl;
int pixel_copia = copia_senal.cols;
int pixel_extra = mascara.cols-1; //número de píxeles necesarios para orlar
int cols_vector_orlado = pixel_copia + pixel_extra;
Mat vectorOrlado = Mat(1,cols_vector_orlado, senal.type());
int ini_copia, fin_copia; //posiciones donde comienza la copia del vector, centrada
ini_copia = pixel_extra/2;
fin_copia = pixel_copia+ini_copia;
//Copiamos señal centrado en vectorAuxiliar
for(int i=ini_copia; i < fin_copia; ++i)
vectorOrlado.at<float>(0,i) = copia_senal.at<float>(0,i-ini_copia);
//Ahora rellenamos los vectores de orlado. Hacemos el modo espejo.
for(int i=0; i < ini_copia; ++i){
vectorOrlado.at<float>(0,ini_copia-i-1) = cond_contorno*vectorOrlado.at<float>(0,ini_copia+i);
vectorOrlado.at<float>(0,fin_copia+i) = cond_contorno * vectorOrlado.at<float>(0,fin_copia-i-1);
}
return vectorOrlado;
}
//Función para calcular la convolución de un vector señal 1D con un canal
Mat calcularConvolucion1D1C(const Mat &senal, Mat &mascara, int cond_contorno){
//Orlamos el vector para prepararlo para la convolución
Mat copiaOrlada = calcularVectorOrlado(senal, mascara, cond_contorno);
Mat segmentoCopiaOrlada;
Mat convolucion = Mat(1,senal.cols, senal.type());
int ini_copia, fin_copia, long_lado_orla;
//Calculamos el rango de píxeles a los que tenemos que aplicar la convolución, excluyen los vectores de orla
ini_copia = (mascara.cols-1)/2;
fin_copia = ini_copia + senal.cols;
long_lado_orla = (mascara.cols-1)/2;
for(int i=ini_copia; i < fin_copia; ++i){
//Aplicamos la convolución a cada píxel seleccionado el segmento con el que convolucionamos
segmentoCopiaOrlada = copiaOrlada.colRange(i-long_lado_orla, i+long_lado_orla+1);
convolucion.at<float>(0,i-ini_copia) = mascara.dot(segmentoCopiaOrlada);
}
return convolucion;
}
//Función para calcular la convolución de una imagen 2D con un sólo canal
Mat calcularConvolucion2D1C(Mat &imagen, float sigma, int cond_bordes){
//Calculamos el vector máscara
Mat mascara = calcularVectorMascara(sigma);
Mat convolucion = Mat(imagen.rows, imagen.cols, imagen.type());
//Convolución por filas
for(int i=0; i < imagen.rows; ++i)
calcularConvolucion1D1C(imagen.row(i),mascara,cond_bordes).copyTo(convolucion.row(i));
//Convolución por columnas
convolucion = convolucion.t();//Trasponemos para poder operar como si fuesen filas
for(int i=0; i < convolucion.rows; ++i)
calcularConvolucion1D1C(convolucion.row(i),mascara,cond_bordes).copyTo(convolucion.row(i));
convolucion = convolucion.t();//Deshacemos la trasposición
return convolucion;
}
//Función para calcular la convolución de una imagen 1C o 3C
Mat calcularConvolucion2D(Mat &imagen, float sigma, int cond_bordes){
Mat convolucion;
Mat canales[3];
Mat canalesConvolucion[2];
//Si la imagen es 1C
if(imagen.channels() == 1)
return calcularConvolucion2D1C(imagen, sigma, cond_bordes);
//Si la imagen es 3C
else if (imagen.channels() == 3){
split(imagen,canales);
for(int i=0; i < 3; ++i)
canalesConvolucion[i] = calcularConvolucion2D1C(canales[i],sigma,cond_bordes);
merge(canalesConvolucion,3,convolucion);
}
else
cout << "Numero de canales no válido. " << endl;
return convolucion;
}
/****************************************************************************************
APARTADO B: IMÁGENES HÍBRIDAS
****************************************************************************************/
//Función para calcular una imagen híbrida a partir de dos imágenes dadas
Mat calcularHibrida(Mat &imagen1, Mat &imagen2, float sigma1, float sigma2, Mat &bajas_frec, Mat &altas_frec){
bajas_frec = calcularConvolucion2D(imagen1,sigma1,0);
altas_frec = imagen2 - calcularConvolucion2D(imagen2,sigma2,0);
return bajas_frec + altas_frec;
}
//Función para mostrar la imagen híbrida junto con las frecuencias altas y bajas
void mostrarHibrida(Mat &imagen_hibrida, Mat &bajas_frec, Mat &altas_frec,string nombreVentana){
//Reajustamos el rango de las imágenes
imagen_hibrida = reajustarRango(imagen_hibrida);
altas_frec = reajustarRango(altas_frec);
//Hacemos la conversión para mostrar las imágenes
if(imagen_hibrida.channels()==3){
imagen_hibrida.convertTo(imagen_hibrida,CV_8UC3);
altas_frec.convertTo(altas_frec,CV_8UC3);
bajas_frec.convertTo(bajas_frec,CV_8UC3);
}
else if(imagen_hibrida.channels() == 1){
imagen_hibrida.convertTo(imagen_hibrida,CV_8U);
altas_frec.convertTo(altas_frec,CV_8U);
bajas_frec.convertTo(bajas_frec,CV_8U);
}
else
cout << "Número de canales no válido." << endl;
vector<Mat> imagenes;
imagenes.push_back(altas_frec);
imagenes.push_back(imagen_hibrida);
imagenes.push_back(bajas_frec);
mostrarImagenes(nombreVentana, imagenes);
}
/****************************************************************************************
APARTADO C: PIRÁMIDE GAUSSIANA
****************************************************************************************/
//Función que submuestrea una imagen tomando solo las columnas y filas impares
Mat submuestrear1C(const Mat &imagen){
Mat submuestreado = Mat(imagen.rows/2, imagen.cols/2, imagen.type());
for(int i=0; i < submuestreado.rows; ++i)
for(int j=0; j < submuestreado.cols; ++j)
submuestreado.at<float>(i,j) = imagen.at<float>(i*2+1,j*2+1);
return submuestreado;
}
//Función que calcula una pirámide Gaussiana
void calcularPiramideGauss(Mat &imagen, vector<Mat> &piramide, int niveles){
Mat canales_imagen[3];
Mat canales_nivel[3];
vector<Mat> canales_piramide[3];
//Reajustamos el rango de la imagen
imagen = reajustarRango(imagen);
//Si la imagen es 1C
if(imagen.channels() == 1){
piramide.push_back(imagen);
for(int i=0; i < niveles-1; ++i){
piramide.push_back(submuestrear1C(calcularConvolucion2D1C(piramide.at(i),1.5,0)));
}
}
//Si la imagen es 3C
else if(imagen.channels() == 3){
piramide.resize(niveles);
split(imagen,canales_imagen);
for(int i=0; i < 3; ++i)
calcularPiramideGauss(canales_imagen[i],canales_piramide[i],niveles);
for(int i=0; i < niveles; ++i){
for(int j=0; j < 3; ++j)
canales_nivel[j] = canales_piramide[j].at(i);
merge(canales_nivel,3,piramide.at(i));
}
}
else
cout << "Numero de canales no valido." << endl;
}
//Función para mostrar una pirámide gaussiana
void mostrarPiramide(vector<Mat> piramide, string nombreVentana){
if(piramide.at(0).channels() == 3){
for(int i=0; i < piramide.size(); ++i)
piramide.at(i).convertTo(piramide.at(i),CV_8UC3);
}
else if(piramide.at(0).channels() == 1){
for(int i=0; i < piramide.size(); ++i)
piramide.at(i).convertTo(piramide.at(i),CV_8U);
}
else
cout << "Numero de canales no valido." << endl;
mostrarImagenes(nombreVentana,piramide);
}
/****************************************************************************************
MAIN
****************************************************************************************/
int main(int argc, char** argv){
Mat dog = imread("./imagenes/dog.bmp");
Mat bird = imread("./imagenes/bird.bmp");
Mat plane = imread("./imagenes/plane.bmp");
dog.convertTo(dog, CV_32F);
bird.convertTo(bird, CV_32FC3);
plane.convertTo(plane, CV_32FC3);
;
Mat dog2 = calcularConvolucion2D(dog,3,0);
Mat dog3 = calcularConvolucion2D(dog,10,0);
dog.convertTo(dog,CV_8U);
dog2.convertTo(dog2,CV_8U);
dog3.convertTo(dog3,CV_8U);
vector<Mat> apartadoA;
apartadoA.push_back(dog);
apartadoA.push_back(dog2);
apartadoA.push_back(dog3);
Mat altas, bajas;
Mat hibrida = calcularHibrida(bird,plane,19.0,1.0,bajas,altas);
int niveles = 6;
vector<Mat> piramide;
calcularPiramideGauss(hibrida,piramide,niveles);
cout << "Apartado A. Convolución de una imagen para distintos valores de sigma (3.0,10.0)." << endl;
mostrarImagenes("Apartado A: convolucion",apartadoA);
cout << "Pulse una tecla para continuar..." << endl;
waitKey(0);
destroyAllWindows();
cout << "Apartado B. Hibridacion entre un pájaro y un avión." << endl;
mostrarHibrida(hibrida,altas,bajas,"Apartado B: imagenes hibridas");
cout << "Pulse una tecla para continuar..." << endl;
waitKey(0);
destroyAllWindows();
cout << "Apartado C. Piramide Gaussiana." << endl;
mostrarPiramide(piramide,"Apartado C: piramide gaussiana");
cout << "Pulse una tecla para continuar..." << endl;
waitKey(0);
destroyAllWindows();
return 0;
} | [
"noreply@github.com"
] | muscraziest.noreply@github.com |
9af3b06fe5324a6aa75560787e5184480dd56b71 | dd1393cef959982b09bbdbc08180f963f7ecaec6 | /PrimeEngine/PrimeEngine-Core/Graphics/BasicWindow.cpp | 6429f67d268602f8e7848bd97e6dc87e4edc6f6d | [] | no_license | TomasMonkevic/PrimeEngine | 5926d34c04daf32df90aae789cada8fcc3f4df0f | bd143c14151b84f2e2e39f21b93f24189b83909e | refs/heads/master | 2022-09-25T07:38:36.647152 | 2020-02-24T10:20:00 | 2020-02-24T10:20:00 | 198,994,960 | 3 | 0 | null | 2020-02-21T20:51:05 | 2019-07-26T10:08:10 | C | UTF-8 | C++ | false | false | 764 | cpp | #pragma once
#include <Graphics/BasicWindow.h>
#include <Graphics/OpenGL.h>
namespace PrimeEngine
{
namespace Graphics
{
void BasicWindow::Clear() {
GlCall(glClearColor(_color[0], _color[1], _color[2], _color[3]));
GlCall(glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT));
}
void BasicWindow::SetSize(int width, int height) {
_width = width;
_height = height;
}
Math::Vector2 BasicWindow::GetSize() const {
return Math::Vector2((float)_width, (float)_height);
}
void BasicWindow::SetColor(const Color& color) {
_color = color;
}
const Color& BasicWindow::GetColor() const {
return _color;
}
}
} | [
"tomas.monkevic@sbdigital.lt"
] | tomas.monkevic@sbdigital.lt |
21658c31c1b0d97b3e83d1b625470ee824ccd26d | 7aa5b7134c72245d67654930f9f773c14d542bb2 | /luis/learning_image_transport/src/backup/my_subscriber-1.cpp | ba36cde99cc18a0474ed1cb734ed0b816c4f6f19 | [
"BSD-3-Clause"
] | permissive | shantanu-vyas/crw-cmu | 2b226552e39db0906e231e85c8a086ebcb380255 | db2fe823665dbd53f25e78fa12bc49f57d4b63aa | refs/heads/master | 2021-01-19T18:07:29.549792 | 2013-08-12T19:26:16 | 2013-08-12T19:26:16 | 11,484,469 | 3 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,625 | cpp | /*
* File: my_subscriber.cpp
* Author: pototo
*
* Created on July 28, 2011, 9:56 PM
*
* This program recognizes the water in front of the boat by using ground
* plane detection techniques already available. This will look for the pixels
* from the boat, and go up the image until it finds the vector plane the repre-
* sents the water
*/
#include <ros/ros.h>
#include <image_transport/image_transport.h>
#include <opencv/cv.h>
#include <opencv/highgui.h>
#include <opencv/ml.h>
#include <cv_bridge/CvBridge.h>
//access the elements of a picture
template<class T> class Image
{
private:
IplImage* imgp;
public:
Image(IplImage* img=0) {imgp=img;}
~Image(){imgp=0;}
void operator=(IplImage* img) {imgp=img;}
inline T* operator[](const int rowIndx)
{
return ((T *)(imgp->imageData + rowIndx*imgp->widthStep));
}
};
void imageCallback(const sensor_msgs::ImageConstPtr& msg)
{
sensor_msgs::CvBridge bridge;
try
{
cvShowImage("view", bridge.imgMsgToCv(msg, "bgr8"));
}
catch (sensor_msgs::CvBridgeException& e)
{
ROS_ERROR("Could not convert from '%s' to 'bgr8'.", msg->encoding.c_str());
}
}
int main(int argc, char **argv)
{
ros::init(argc, argv, "image_listener");
ros::NodeHandle nh;
ros::Rate loop_rate(1);
cvNamedWindow("view");
//while(nh.ok())
//{
ROS_INFO("getting image");
cvStartWindowThread();
image_transport::ImageTransport it(nh);
image_transport::Subscriber sub = it.subscribe("camera/image", 1, imageCallback);
ros::spin();
cvDestroyWindow("view");
loop_rate.sleep();
//}
return 0;
}
| [
"shantanusvyas@gmail.com"
] | shantanusvyas@gmail.com |
5ccdcc0ea0c157023af3144ae8b48960d4b357aa | fc6d89e1b89a6fc32a4c2c50d0edd211398a3946 | /002._SimpleLed/002._SimpleLed.ino | a056b17b94925da9337dd2ce6f8337322a587f48 | [] | no_license | Axolodev/LearningArduino | 86f7d0dcddb5c4b2faae16c56b2eb1b8d2634e33 | fdd073dd819def825b43d8ed0cd9bb64b88b74a0 | refs/heads/master | 2023-01-27T21:04:21.987226 | 2017-10-21T18:06:16 | 2017-10-21T18:06:16 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 403 | ino | unsigned int ledPin = 10;
unsigned int delayTime = 1000;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(ledPin, OUTPUT);
}
int getDelayTime(){
return random (300, 1000);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(ledPin, HIGH);
delay(getDelayTime());
digitalWrite(ledPin, LOW);
delay(getDelayTime());
}
| [
"rroberto.rruiz@gmail.com"
] | rroberto.rruiz@gmail.com |
455a6d0a8b669b7ad731ea63fae165769bf62191 | 398f882bb7a394f21fde53f0b160f981b61a7aff | /Tarea1/Collector.cpp | 18a7f15bf4b7d0cbed06c8ff6325c8bbd7c08f18 | [] | no_license | AkionGarro/ITCR.Datos2.Tarea1 | 62aac0cbc057db3f5c7f7a34f1b9c473063aa43f | 8b4209e01db47205e861e00e4116fb4582184226 | refs/heads/main | 2023-03-26T20:02:53.511901 | 2021-03-18T18:11:21 | 2021-03-18T18:11:21 | 343,580,393 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,395 | cpp | //
// Created by garroakion on 1/3/21.
//
#include "Collector.h"
#include "Node.h"
//---------------------Singlethon Implementation--------------------------
Collector* Collector::collector_= nullptr;
Collector *Collector::GetInstance()
{
if(collector_==nullptr){
collector_ = new Collector();
}
return collector_;
}
//------------------------------Constructor--------------------------------
Collector::Collector() {
head = NULL;
}
//------------------------------Methods--------------------------------
void Collector::add_node(Node *n) {
if (head == NULL) {
head = n;
} else {
setHead(n);
}
}
Node *Collector::setHead(Node *head) {
head->setNext(this->head);
this->head = head;
}
Node * Collector::getHead() {
return head;
}
void Collector::collectorStatus() {
if(this->head==NULL){
cout<<"Collector: [ ]"<<endl;
cout<<""<<endl;
}else{
Node *tmp = Collector::GetInstance()->getHead();
cout<< "Collector: [";
while(tmp->getNext()!= nullptr){
cout<<tmp->getValue()<<"->";
tmp = tmp->getNext();
}
cout<<tmp->getValue()<<"] \n\n";
cout<<""<<endl;
}
}
void Collector::deleteNode(Node *nodeDelete) {
int top = Collector::size(Collector::GetInstance());
Node *current = Collector::GetInstance()->getHead();
Node *previous = new Node();
previous = NULL;
for (int i = 0; i < top; i++) {
if (Collector::GetInstance()->getHead()==nodeDelete && previous == NULL) {
current = current->getNext();
Collector::GetInstance()->head = current;
cout<<"Se elimino el nodo del collector y se agrego a la lista"<<endl;
break;
}
if (current != nodeDelete && current->getNext() == nullptr) {
cout << "No se encuentra el nodo"<<endl;
}
if (current == nodeDelete) {
previous->setNext(current->getNext());
cout<<"Se elimino el nodo del collector y se agrego a la lista"<<endl;
} else {
previous = current;
current = current->getNext();
}
}
return;
}
int Collector::size(Collector *collector) {
int i = 0;
Node *ptr = collector->getHead();
while (ptr != nullptr) {
ptr = ptr->getNext();
i++;
}
return i;
}
| [
"carloscamp1008@estudiantec.cr"
] | carloscamp1008@estudiantec.cr |
e157e610553414c3b6f3556d420d8ad680fcc4df | 95c7d2fc604d1b9b5860c7bfa5f4b02d3d60dcb2 | /Dissertation/SignificantHeight_AppCode.cpp | ce575ab9ce140df6276d47d93c0b5e1c55d807e3 | [] | no_license | Mikhail42/disser_work | f6bb5ade85ca55fe4be656e105c69a220e12d750 | d481afebfd86ccf748b5aef5f2ae58b84ab98ced | refs/heads/master | 2020-05-30T12:18:39.728247 | 2013-08-20T20:21:39 | 2013-08-20T20:21:39 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 13,773 | cpp | //============================================================================
// Name : SignificantHeight.cpp
// Author : Konstantin Kuznetsov
// Version :
// Copyright :
// Description : Anomalous waves, Ansi-style
//============================================================================
#include <iostream>
#include <ipp.h>
#include <fstream>
#include <cmath>
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
using namespace std;
class Waves
{
private:
Ipp32f* wavesHeight;
unsigned int* wavesPeriod;
unsigned int* wavesIndex;
unsigned int wavesCount;
unsigned int firstMinPeak;
Ipp32f bdysh;
public:
Waves(unsigned int waveCount = 1){
wavesHeight = ippsMalloc_32f(waveCount);
wavesIndex = new unsigned int[waveCount];
wavesPeriod = new unsigned int[waveCount];
wavesCount = waveCount;
}
~Waves(){
ippsFree(wavesHeight);
delete(wavesPeriod);
delete(wavesIndex);
}
Waves(Ipp32f* x, unsigned int len, bool isCorrecting = false){
IppStatus st;
bdysh = 0;
/**define average wave line*/
Ipp32f tmp=0;
st = ippsMean_32f(x,len,&tmp,ippAlgHintFast);
st = ippsSubC_32f_I(tmp,x,len);
/**define average wave line done*/
/**define max and min peaks****/
unsigned int maxPeaksCount = 0;
unsigned int minPeaksCount = 0;
unsigned int* maxPeaksId = new unsigned int[len/2];
unsigned int* minPeaksId = new unsigned int[len/2];
for(unsigned int i=0;i<len/2;i++)
{
maxPeaksId[i]=0;
minPeaksId[i]=0;
}
//st = ippsSet_32u(0, maxPeaksId,len/2);
//st = ippsSet_32u(0, minPeaksId,len/2);
for(unsigned int i=0;i<len;i++)
{
/*if((x[i]>0)&&(maxPeaksId[minPeaksCount]==0))
minPeaksId[minPeaksCount] = i;*/
if((x[i]>=0)&&(maxPeaksId[maxPeaksCount]==0))
maxPeaksId[maxPeaksCount] = i;
else if((x[i]>=0)&&(x[i]>x[maxPeaksId[maxPeaksCount]]))
maxPeaksId[maxPeaksCount] = i;
else if((x[i]<0)&&(maxPeaksId[maxPeaksCount]!=0))
maxPeaksCount++;
}
for(unsigned int i=0;i<len;i++)
{
//cout<<"x["<<i<<"]="<<x[i]<<"meanPeaksId["<<minPeaksCount<<"]="<<minPeaksId[minPeaksCount]<<endl;
if((x[i]<0)&&(minPeaksId[minPeaksCount]==0))
minPeaksId[minPeaksCount] = i;
else if((x[i]<0)&&(x[i]<x[minPeaksId[minPeaksCount]]))
minPeaksId[minPeaksCount] = i;
else if((x[i]>=0)&&(minPeaksId[minPeaksCount]!=0))
minPeaksCount++;
}
/**define max and min peaks done****/
unsigned int waveCount=maxPeaksCount;
/*if(maxPeaksCount<minPeaksCount)
waveCount = minPeaksCount;*/
//cout<<"maxPeaksCount="<<maxPeaksCount<<" minPeaksCount="<<minPeaksCount<<endl;
wavesHeight = ippsMalloc_32f(waveCount);
wavesIndex = new unsigned int[waveCount];
wavesPeriod = new unsigned int[waveCount];
wavesCount = waveCount;
int wvPeriodTmp=0;
if((minPeaksId[0]<maxPeaksId[0])&&(minPeaksId[0]!=0)){
//cout<<"minPeaksId "<<waveCount<<" ";
//cout<<minPeaksId[0]<<endl;
for(unsigned int i=0;i<waveCount; i++){
//wavesHeight[i] = max(abs(x[maxPeaksId[i]] - x[minPeaksId[i]]),abs(x[maxPeaksId[i]] - x[minPeaksId[i+1]]));
wavesHeight[i] = x[maxPeaksId[i]] - x[minPeaksId[i]];
//wavesHeight[i] = x[maxPeaksId[i]] - x[minPeaksId[i]];
//wavesHeight[i] = 2*x[maxPeaksId[i]];
//wavesHeight[i] = (abs(x[maxPeaksId[i]] - x[minPeaksId[i]])+abs(x[maxPeaksId[i]] - x[minPeaksId[i+1]]))/2;
//wavesHeight[i] = abs(x[maxPeaksId[i]] - x[minPeaksId[i]]);
wvPeriodTmp = (maxPeaksId[i+1] - minPeaksId[i]);
if(wvPeriodTmp<-500)
wvPeriodTmp=wavesPeriod[i-1];
//wvPeriodTmp = 2*(maxPeaksId[i] - minPeaksId[i]);
//if(wvPeriodTmp<0) wvPeriodTmp=(-1)*wvPeriodTmp;
wavesPeriod[i] = wvPeriodTmp;
wavesIndex[i] = maxPeaksId[i];
/*cout<<"x[maxPeaksId["<<i<<"]]="<<x[maxPeaksId[i]]<<"\t";
cout<<"x[minPeaksId["<<i<<"]]="<<x[minPeaksId[i]]<<"\t";
cout<<"maxPeaksId["<<i<<"]="<<maxPeaksId[i]<<"\t";
cout<<"minPeaksId["<<i<<"]="<<minPeaksId[i]<<"\t";
cout<<"waveHeight["<<i<<"]="<<wavesHeight[i]<<endl;*/
}
}
/*else if((minPeaksId[0]<maxPeaksId[0])&&(minPeaksId[0]==0)){
cout<<"minPeakId=0"<<waveCount<<endl;
wavesHeight[0] = x[maxPeaksId[1]]-bdysh;//iz predydushego
wavesPeriod[0] = maxPeaksId[1]*2;//primerno
wavesIndex[0] = maxPeaksId[1];
for(unsigned int i=1;i<waveCount; i++){
//wavesHeight[i-1] = max(abs(x[maxPeaksId[i]] - x[minPeaksId[i-1]]),abs(x[maxPeaksId[i]] - x[minPeaksId[i]]));
//wavesHeight[i-1] = x[maxPeaksId[i]] - x[minPeaksId[i-1]];
wavesHeight[i] = x[maxPeaksId[i]] - x[minPeaksId[i-1]];
//wavesHeight[i-1] = (abs()+abs(x[maxPeaksId[i]] - x[minPeaksId[i]]))/2;
//wavesHeight[i-1] = 2*x[maxPeaksId[i]];
//wvPeriodTmp = minPeaksId[i+1] - minPeaksId[i];
wvPeriodTmp = 2*(maxPeaksId[i] - minPeaksId[i]);
//if(wvPeriodTmp<0) wvPeriodTmp=(-1)*wvPeriodTmp;
wavesPeriod[i] = wvPeriodTmp;
wavesIndex[i] = maxPeaksId[i];
/*cout<<"x[maxPeaksId["<<i<<"]]="<<x[maxPeaksId[i]]<<"\t";
cout<<"x[minPeaksId["<<i<<"]]="<<x[minPeaksId[i]]<<"\t";
cout<<"maxPeaksId["<<i<<"]="<<maxPeaksId[i]<<"\t";
cout<<"minPeaksId["<<i<<"]="<<minPeaksId[i]<<"\t";
cout<<"waveHeight["<<i<<"]="<<wavesHeight[i]<<endl;
}
}*/
else if((minPeaksId[0]>maxPeaksId[0]))//1 and 2
{
//cout<<"maxPeaksId "<<waveCount<<" ";
//cout<<maxPeaksId[0]<<endl;
wavesHeight[0] = 2*x[maxPeaksId[0]]-bdysh;//iz predydushego
wavesPeriod[0] = maxPeaksId[0]*2;//primerno
wavesIndex[0] = maxPeaksId[0];
for(unsigned int i=1;i<waveCount; i++){
//wavesHeight[i-1] = max(abs(x[maxPeaksId[i]] - x[minPeaksId[i-1]]),abs(x[maxPeaksId[i]] - x[minPeaksId[i]]));
//wavesHeight[i-1] = x[maxPeaksId[i]] - x[minPeaksId[i-1]];
wavesHeight[i] = x[maxPeaksId[i]] - x[minPeaksId[i-1]];
//wavesHeight[i-1] = (abs()+abs(x[maxPeaksId[i]] - x[minPeaksId[i]]))/2;
//wavesHeight[i-1] = 2*x[maxPeaksId[i]];
wvPeriodTmp = maxPeaksId[i+1] - maxPeaksId[i];
if(wvPeriodTmp<-500)
wvPeriodTmp=wavesPeriod[i-1];
//wvPeriodTmp = 2*(maxPeaksId[i] - minPeaksId[i-1]);
//if(wvPeriodTmp<0) wvPeriodTmp=(-1)*wvPeriodTmp;
wavesPeriod[i] = wvPeriodTmp;
wavesIndex[i] = maxPeaksId[i];
/*cout<<"x[maxPeaksId["<<i<<"]]="<<x[maxPeaksId[i]]<<"\t";
cout<<"x[minPeaksId["<<i<<"]]="<<x[minPeaksId[i]]<<"\t";
cout<<"maxPeaksId["<<i<<"]="<<maxPeaksId[i]<<"\t";
cout<<"minPeaksId["<<i<<"]="<<minPeaksId[i]<<"\t";
cout<<"waveHeight["<<i<<"]="<<wavesHeight[i]<<endl;*/
}
}
else{
cout<<"Errrr"<<endl;
for(unsigned int i=1;i<waveCount; i++){
//wavesHeight[i-1] = max(abs(x[maxPeaksId[i]] - x[minPeaksId[i-1]]),abs(x[maxPeaksId[i]] - x[minPeaksId[i]]));
//wavesHeight[i-1] = x[maxPeaksId[i]] - x[minPeaksId[i-1]];
wavesHeight[i-1] = x[maxPeaksId[i]] - x[minPeaksId[i-1]];
//wavesHeight[i-1] = (abs()+abs(x[maxPeaksId[i]] - x[minPeaksId[i]]))/2;
//wavesHeight[i-1] = 2*x[maxPeaksId[i]];
//wvPeriodTmp = minPeaksId[i+1] - minPeaksId[i];
wvPeriodTmp = 2*(maxPeaksId[i] - minPeaksId[i]);
//if(wvPeriodTmp<0) wvPeriodTmp=(-1)*wvPeriodTmp;
wavesPeriod[i-1] = wvPeriodTmp;
wavesIndex[i-1] = maxPeaksId[i];
/*cout<<"x[maxPeaksId["<<i<<"]]="<<x[maxPeaksId[i]]<<"\t";
cout<<"x[minPeaksId["<<i<<"]]="<<x[minPeaksId[i]]<<"\t";
cout<<"maxPeaksId["<<i<<"]="<<maxPeaksId[i]<<"\t";
cout<<"minPeaksId["<<i<<"]="<<minPeaksId[i]<<"\t";
cout<<"waveHeight["<<i<<"]="<<wavesHeight[i]<<endl;*/
}
}
/*for(unsigned int i=0;i<waveCount; i++){
wavesHeight[i] = max(abs(x[maxPeaksId[i]] - x[minPeaksId[i]]),abs(x[maxPeaksId[i]] - x[minPeaksId[i+1]]));
wvPeriodTmp = maxPeaksId[i] - minPeaksId[i];
//if(wvPeriodTmp<0) wvPeriodTmp=(-1)*wvPeriodTmp;
wavesPeriod[i] = wvPeriodTmp;
wavesIndex[i] = maxPeaksId[i];
/*cout<<"x[maxPeaksId["<<i<<"]]="<<x[maxPeaksId[i]]<<"\t";
cout<<"x[minPeaksId["<<i<<"]]="<<x[minPeaksId[i]]<<"\t";
cout<<"maxPeaksId["<<i<<"]="<<maxPeaksId[i]<<"\t";
cout<<"minPeaksId["<<i<<"]="<<minPeaksId[i]<<"\t";
cout<<"waveHeight["<<i<<"]="<<wavesHeight[i]<<endl;
}*/
delete(maxPeaksId);
delete(minPeaksId);
if(isCorrecting == true){
}
}
unsigned int getLastMinPeak(){
return 0;
}
double getSignHeight(){
Ipp32f signHeight;
Ipp32f* waveHeightSort = ippsMalloc_32f(wavesCount);
ippsCopy_32f(wavesHeight, waveHeightSort, wavesCount);
ippsSortDescend_32f_I(waveHeightSort,wavesCount);
ippsMean_32f(waveHeightSort,wavesCount/3,&signHeight,ippAlgHintAccurate);
ippsFree(waveHeightSort);
return (double)signHeight;
}
double getMeanHeight(){
Ipp32f meanHeight;
ippsMean_32f(wavesHeight, wavesCount, &meanHeight,ippAlgHintAccurate);
return (double)meanHeight;
}
double getMeanPeriod(){
//Ipp32f meanPeriod=0;
unsigned int sumT=0;
//ippsMean_32f((Ipp32f*)wavesPeriod, wavesCount, &meanPeriod,ippAlgHintAccurate);
for(unsigned int i=0;i<wavesCount;i++){
sumT+=wavesPeriod[i];
}
return sumT/wavesCount;
}
void getIndexesOfAnomWaves(unsigned int* indexesAnom, double* coeffMass, unsigned int& lenAnomWaves, const double coeff=2){
Ipp32f signHeight = getSignHeight();
/*for(unsigned int i = 0; i<wavesCount; i++){
if(wavesHeight[i]>(coeff*signHeight))
lenAnomWaves++;
}*/
lenAnomWaves = 0;
for(unsigned int i = 0; i<wavesCount; i++){
if(wavesHeight[i]>(coeff*signHeight)){
indexesAnom[lenAnomWaves] = wavesIndex[i];
coeffMass[lenAnomWaves] = wavesHeight[i]/signHeight;
lenAnomWaves++;
}
}
}
unsigned int getWaveNum(){
return wavesCount;
}
void printHeights(){
for(unsigned int i=0; i<wavesCount; i++){
cout<<"wavesHeight["<<i<<"] = "<<wavesHeight[i]<<endl;
}
}
void printIndexes(){
for(unsigned int i=0; i<wavesCount; i++){
cout<<"wavesIndexs["<<i<<"] = "<<wavesIndex[i]<<endl;
}
}
void printPeriods(){
for(unsigned int i=0; i<wavesCount; i++){
cout<<"wavesPeriod["<<i<<"] = "<<wavesPeriod[i]<<endl;
}
}
Ipp32f getHeight(unsigned int ind){
return wavesHeight[ind];
}
unsigned int getPeriod(unsigned int ind){
return wavesPeriod[ind];
}
unsigned int getIndex(unsigned int ind){
return wavesIndex[ind];
}
};
int main(int argc, char* argv[]) {
if(argc!=4)
{
cout<<"Wrong input parameters!\n";
cout<<"Usage: ./waveHeights infile.txt OutHeights SingHeights"<<endl;
cout<<"file OutHeights consists of:"<<endl;
cout<<"#1waveHeights #2waveIndex #3wavePeriods #4waveHeights/Hs #5waveHeights/Hmean #6waveHeights/Tmean"<<endl;
return 1;
}
float datain;
//timeMeter tm;//time checker, shows how mush time executes some code blocks
//const char* filename="/home/konst/ProjCPP/SignificantHeight/sinTest.txt";
//const char* filename="/media/KONST_500GB/anomWaves/Vzmorie#24_2007-07-14_1sec.txt";
const char* filename=argv[1];
const char* filenameOutHeights=argv[2];
const char* filenameSingHeights=argv[3];
//const char* filename="c:/Work/anomWaves/Vzmorie/modelRowRayl.txt";
//const char* filenameOutHeights="c:/Work/anomWaves/Vzmorie/modelRowOutHeights.txt";
//const char* filenameSingHeights="c:/Work/anomWaves/Vzmorie/modelRowSignHeights.txt";
FILE*in=NULL;
FILE*outHeight=NULL;
FILE*outSignHeight=NULL;
in=fopen(filename,"r");
if(in==NULL)
{
printf("no input files\n");
return 1;
}
unsigned int cnt=0;
cout<<"scaning..."<<endl;
while(fscanf(in,"%f",&datain)!=EOF)
{
cnt++;
}
fclose(in);
unsigned int len=cnt; // length of input vector
/****************************************/
Ipp32f* ost=ippsMalloc_32f(len);//input vector
/****loading file******/
in=fopen(filename,"r");
cnt=0;
cout<<"reading..."<<endl;
while(fscanf(in,"%f",&datain)!=EOF)
{
ost[cnt]=datain;
cnt++;
}
fclose(in);
cout<<len<<" values read"<<endl;
/****loading done******/
unsigned int otrLenght = 20*60*1;
unsigned int start, end = 0;
Ipp32f* rowTmp = ippsMalloc_32f(otrLenght);
/*unsigned int* anomWaves = new unsigned int[len/10];
unsigned int lenAnomWaves = 0;*/
outHeight=fopen(filenameOutHeights,"w");
outSignHeight=fopen(filenameSingHeights,"w");
if(outHeight==NULL)
{
printf("Could not open file %s for write\n",filenameOutHeights);
return 1;
}
/*Waves wv(ost,len);
*/
//unsigned int* anomWavesTMP = new unsigned int[otrLenght/10];
//unsigned int lenAnomWavesTMP = 0;
unsigned int wavesNum = 0;
double Hs=0;
double Hmean=0;
double Tmean=1;
//double* coeffMass = new double[otrLenght/10];
for(unsigned int i=0;i<len/otrLenght;i++){
start = i*otrLenght; end = start+otrLenght;
for(unsigned int j=start;j<end;j++){
rowTmp[j-start] = ost[j];
}
Waves* wv = new Waves(rowTmp,otrLenght);
//printf("Sizeof waves wv = %d\n",sizeof(&wv));
//wv.printIndexes();
//wv.printPeriods();
//cout<<"wave num"<<wv.getWaveNum()<<endl;
wavesNum = wv->getWaveNum();
Hs = wv->getSignHeight();
Hmean = wv->getMeanHeight();
Tmean = wv->getMeanPeriod();
fprintf(outSignHeight,"%8.12f\n",Hs);
for(unsigned int i=0; i<wavesNum; i++){
fprintf(outHeight,"%8.12f\t%d\t%d\t%8.12f\t%8.12f\t%8.12f\n",wv->getHeight(i),start+1+wv->getIndex(i),wv->getPeriod(i),wv->getHeight(i)/Hs,wv->getHeight(i)/Hmean,wv->getPeriod(i)/Tmean);
}
delete wv;
//wv.getIndexesOfAnomWaves(anomWavesTMP, coeffMass, lenAnomWavesTMP,atof(argv[4]));
//for(unsigned int k=0; k<lenAnomWavesTMP; k++){
// fprintf(outAnom,"%d\t%d\t%f\n",i,start+1+anomWavesTMP[k], coeffMass[k]);
//}
}
fclose(outHeight);
fclose(outSignHeight);
ippsFree(ost);
ippsFree(rowTmp);
/*Waves wv(ost,len);
unsigned int* anomWaves = new unsigned int[wv.getWaveNum()/5];
unsigned int lenAnom=0;
//signHeight(ost,swh,len);
cout<<"Significat wave heights "<<wv.getSignHeight()<<endl;
wv.getIndexesOfAnomWaves(anomWaves,lenAnom,1);
for(unsigned int i=0; i<lenAnom; i++){
cout<<"anomWaves "<<anomWaves[i]<<endl;
}
wv.printHeights();
wv.printIndexes();
wv.printPeriods();*/
return 0;
}
| [
"kost.kuznetsov@gmail.com"
] | kost.kuznetsov@gmail.com |
8d0981eacafa86785cf2d84b40ea68cdf0964a2b | 5a7fe0ecaa45bcc169cba4c622c694e2ebab4164 | /Assignment_2_2.cpp | 9cd940ecf8147d6562dbc3325f67cc28c4822036 | [] | no_license | bipulkmr-crypto/data_structures_1 | de48514b323f2d99cfc2587f36ad5601b28bdd17 | ed976be5e51fd1c5b2918d421132c052473884a1 | refs/heads/master | 2023-06-07T06:36:41.634531 | 2021-05-27T11:04:06 | 2021-05-27T11:04:06 | 382,251,172 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,013 | cpp | // // this is linear recursion wilh time complexity of O(n)
// //The depth of the tree is n and width is 1
// //the disadvantange is the time taken is comparitively more than the iterative version of the solution and there is also change of stack overflow in case of normal compiler
// //advantage is that some complex problems like NP hard problems can be solved easily by reccursion and it is more intuitive and easier to understand
// //space complexity is o(n) as we know the space complexity is directly proportional to the depth of the reccursive tree
// //time complexity is also O(n)
// #include <bits/stdc++.h>
// using namespace std;
// int mini = INT_MAX;
// int n;
// int arr[10001];
// int mx = INT_MIN;
// bool good(int x)
// {
// int val = sqrt(x);
// return ((val * val) == x);
// }
// void solve(int pos)
// {
// if (pos >= n)
// return;
// else
// {
// if (good(arr[pos]))
// {
// mini = min(arr[pos], mini);
// mx = max(arr[pos], mx);
// }
// solve(pos + 1);
// }
// }
// int main()
// {
// cin >> n;
// int i;
// for (i = 0; i < n; i++)
// cin >> arr[i];
// solve(0);
// cout << mini << " " << mx << endl;
// }
#include <bits/stdc++.h>
using namespace std;
int mini = INT_MAX;
int n;
int arr[10001];
int mx = INT_MIN;
// int sum = 1;
int solve(int n, int p)
{
if (p < n)
{
return 0;
}
else if (n < 2)
{
return n;
}
else
{
if (n % p == 0)
{
return (p + solve(n / p, p + 1));
}
else
{
return (solve(n, p + 1));
}
}
}
int main()
{
cin >> n;
int i;
for (i = 0; i < n; i++)
{
cin >> arr[i];
}
for (i = 0; i < n; i++)
{
int sum = solve(arr[i], 2);
if (sum == arr[i])
{
mini = min(arr[i], mini);
mx = max(arr[i], mx);
}
}
cout << mini << " " << mx << endl;
} | [
"bipul1707@gmail.com"
] | bipul1707@gmail.com |
f9c06ff05f318e36a6607f91895e15cb71f92562 | a1a8b69b2a24fd86e4d260c8c5d4a039b7c06286 | /build/iOS/Preview/include/Uno.Time.DeviceTimeZone.h | b5446e1cc969a33f5772e97b09e8245e94ef73c3 | [] | no_license | epireve/hikr-tute | df0af11d1cfbdf6e874372b019d30ab0541c09b7 | 545501fba7044b4cc927baea2edec0674769e22c | refs/heads/master | 2021-09-02T13:54:05.359975 | 2018-01-03T01:21:31 | 2018-01-03T01:21:31 | 115,536,756 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,462 | h | // This file was generated based on /usr/local/share/uno/Packages/UnoCore/1.4.3/Source/Uno/Time/Timezones/DeviceTimeZone.uno.
// WARNING: Changes might be lost if you edit this file directly.
#pragma once
#include <Uno.Time.DateTimeZone.h>
namespace g{namespace Uno{namespace Time{struct DeviceTimeZone;}}}
namespace g{namespace Uno{namespace Time{struct LocalDateTime;}}}
namespace g{namespace Uno{namespace Time{struct Offset;}}}
namespace g{
namespace Uno{
namespace Time{
// public sealed class DeviceTimeZone :5
// {
::g::Uno::Time::DateTimeZone_type* DeviceTimeZone_typeof();
void DeviceTimeZone__ctor_1_fn(DeviceTimeZone* __this);
void DeviceTimeZone__ctor_2_fn(DeviceTimeZone* __this, uString* id1);
void DeviceTimeZone__EqualsImpl_fn(DeviceTimeZone* __this, ::g::Uno::Time::DateTimeZone* other, bool* __retval);
void DeviceTimeZone__GetHashCode_fn(DeviceTimeZone* __this, int* __retval);
void DeviceTimeZone__GetUtcOffset_fn(DeviceTimeZone* __this, ::g::Uno::Time::LocalDateTime* dateTime, ::g::Uno::Time::Offset* __retval);
void DeviceTimeZone__New1_fn(DeviceTimeZone** __retval);
void DeviceTimeZone__New2_fn(uString* id1, DeviceTimeZone** __retval);
void DeviceTimeZone__ToString_fn(DeviceTimeZone* __this, uString** __retval);
struct DeviceTimeZone : ::g::Uno::Time::DateTimeZone
{
void ctor_1();
void ctor_2(uString* id1);
static DeviceTimeZone* New1();
static DeviceTimeZone* New2(uString* id1);
};
// }
}}} // ::g::Uno::Time
| [
"i@firdaus.my"
] | i@firdaus.my |
42dd9d127d70c942c5b0bcb1a7694b29b13147e0 | 6aeccfb60568a360d2d143e0271f0def40747d73 | /sandbox/la/libs/la/test/swizzle4_fail4.cpp | d0a974f1f379db33485ea939cc7818d533ead425 | [] | no_license | ttyang/sandbox | 1066b324a13813cb1113beca75cdaf518e952276 | e1d6fde18ced644bb63e231829b2fe0664e51fac | refs/heads/trunk | 2021-01-19T17:17:47.452557 | 2013-06-07T14:19:55 | 2013-06-07T14:19:55 | 13,488,698 | 1 | 3 | null | 2023-03-20T11:52:19 | 2013-10-11T03:08:51 | C++ | UTF-8 | C++ | false | false | 662 | cpp | //Copyright (c) 2008-2009 Emil Dotchevski and Reverge Studios, Inc.
//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/la/sw.hpp>
#include <boost/la/custom/swizzle_4.hpp>
template <int D> struct vec { };
namespace
boost
{
namespace
la
{
template <int D>
struct
vector_traits< vec<D> >
{
typedef int scalar_type;
static int const dim=D;
template <int I> static int r( vec<D> const & );
template <int I> static int & w( vec<D> & );
};
}
}
int
main()
{
using namespace boost::la;
vec<3>()|XXXW;
return 1;
}
| [
"emil@revergestudios.com"
] | emil@revergestudios.com |
0390c516a45bfe69bca073b8682cbcf16e17b22c | 0af0afeec875bc69cd9113080c15402fa4f29812 | /Arduino/Libraries/ros_lib/marti_nav_msgs/TeleopState.h | 7633e18fa2be593cda6a73bff0516dfd73883e76 | [] | no_license | TerradynamicsLab/terrain_treadmill | b44a62a5bf4f87744d97cc4c3b1254f87aa925e8 | 71e23bb274cc429f1a46cb2bd267d4082a51a5d0 | refs/heads/master | 2023-04-09T19:24:04.484695 | 2021-12-17T18:02:44 | 2021-12-17T18:02:44 | 398,670,744 | 0 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 2,746 | h | #ifndef _ROS_marti_nav_msgs_TeleopState_h
#define _ROS_marti_nav_msgs_TeleopState_h
#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#include "ros/msg.h"
#include "std_msgs/Header.h"
namespace marti_nav_msgs
{
class TeleopState : public ros::Msg
{
public:
std_msgs::Header header;
uint8_t teleopSignals_length;
int32_t st_teleopSignals;
int32_t * teleopSignals;
TeleopState():
header(),
teleopSignals_length(0), teleopSignals(NULL)
{
}
virtual int serialize(unsigned char *outbuffer) const
{
int offset = 0;
offset += this->header.serialize(outbuffer + offset);
*(outbuffer + offset++) = teleopSignals_length;
*(outbuffer + offset++) = 0;
*(outbuffer + offset++) = 0;
*(outbuffer + offset++) = 0;
for( uint8_t i = 0; i < teleopSignals_length; i++){
union {
int32_t real;
uint32_t base;
} u_teleopSignalsi;
u_teleopSignalsi.real = this->teleopSignals[i];
*(outbuffer + offset + 0) = (u_teleopSignalsi.base >> (8 * 0)) & 0xFF;
*(outbuffer + offset + 1) = (u_teleopSignalsi.base >> (8 * 1)) & 0xFF;
*(outbuffer + offset + 2) = (u_teleopSignalsi.base >> (8 * 2)) & 0xFF;
*(outbuffer + offset + 3) = (u_teleopSignalsi.base >> (8 * 3)) & 0xFF;
offset += sizeof(this->teleopSignals[i]);
}
return offset;
}
virtual int deserialize(unsigned char *inbuffer)
{
int offset = 0;
offset += this->header.deserialize(inbuffer + offset);
uint8_t teleopSignals_lengthT = *(inbuffer + offset++);
if(teleopSignals_lengthT > teleopSignals_length)
this->teleopSignals = (int32_t*)realloc(this->teleopSignals, teleopSignals_lengthT * sizeof(int32_t));
offset += 3;
teleopSignals_length = teleopSignals_lengthT;
for( uint8_t i = 0; i < teleopSignals_length; i++){
union {
int32_t real;
uint32_t base;
} u_st_teleopSignals;
u_st_teleopSignals.base = 0;
u_st_teleopSignals.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
u_st_teleopSignals.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
u_st_teleopSignals.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
u_st_teleopSignals.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
this->st_teleopSignals = u_st_teleopSignals.real;
offset += sizeof(this->st_teleopSignals);
memcpy( &(this->teleopSignals[i]), &(this->st_teleopSignals), sizeof(int32_t));
}
return offset;
}
const char * getType(){ return "marti_nav_msgs/TeleopState"; };
const char * getMD5(){ return "7af42bf9109e393cbfb4bd740df95c1e"; };
};
}
#endif | [
"ratan.othayoth@gmail.com"
] | ratan.othayoth@gmail.com |
4f436d45a57e7a30a8154ad390deb2058e3c1ec3 | e33c83c67754a38d6f2cd6c6799b1e1c30876318 | /Test/Queue.cpp | 7a6ae2776128661e9e439d377ef936ab080541e0 | [] | no_license | CasperTheCat/LZ4-DLL | 560dcc2bceded9909fef504f45f73915fbefab5e | 97c0e542e14547805cb01302fcceec2216e4765f | refs/heads/master | 2021-01-18T10:18:07.493526 | 2015-09-27T10:07:17 | 2015-09-27T10:07:17 | 43,233,275 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,516 | cpp | #include "Queue.h"
PathQueue::PathQueue()
{
// Default Constructor
back = nullptr;
arbiter = new QueueItem(path("NULL"), nullptr);
itemCount = 0;
}
PathQueue::~PathQueue()
{
while (itemCount != 0)
{
pop();
}
// Last move
free(arbiter);
}
// Push to forward
void PathQueue::push(path _path)
{
QueueItem* temp;
if (itemCount == 0)
{
temp = new QueueItem(_path, nullptr);
}
else
{
temp = new QueueItem(_path, arbiter->next);
}
arbiter->next = temp;
if (back == nullptr) back = temp;
itemCount++;
}
// Pop Element off
void PathQueue::pop()
{
if (back != nullptr) free(back);
// Relocate Back Node
auto temp = arbiter;
for (auto i = 0; i < itemCount - 1; ++i) // Move to 1 back from end
{
temp = temp->next;
}
// Set Back
if (temp != arbiter) back = temp;
else back = nullptr;
--itemCount;
}
path PathQueue::accPop()
{
auto retVal = back->data;
if (back != nullptr) free(back);
// Relocate Back Node
auto temp = arbiter;
for (auto i = 0; i < itemCount - 1; ++i) // Move to 1 back from end
{
temp = temp->next;
}
// Set Back
if (temp != arbiter) back = temp;
else back = nullptr;
--itemCount;
return retVal;
}
// Access Last Item
path PathQueue::access() const
{
if (back == nullptr) return path("NULLPTR_T");
return back->data;
}
unsigned long int PathQueue::size() const
{
return itemCount;
}
PathQueue::QueueItem::QueueItem(path _path, QueueItem *nextNode)
{
next = nextNode;
data = _path;
}
PathQueue::QueueItem::~QueueItem()
{
// Do Nothing
}
| [
"zsmyna@gmail.com"
] | zsmyna@gmail.com |
ead82ce9274524cde7edb79e395d2c6833ebb3ea | 1a79c0b96269ba602a58f955c9161a3250000cd5 | /160324.Geekband_Homework4/test.cpp | 30d1653ad642e8c7520abb712127fd473f6a3bd9 | [] | no_license | weiweikong/Program_Practice | 4f1b31a81694f2bc768124cc7cf7d29b33802216 | d475652be31e1927481c3b91374868ca670471b0 | refs/heads/master | 2021-01-21T13:03:13.379462 | 2016-04-23T11:41:14 | 2016-04-23T11:41:14 | 53,239,701 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,498 | cpp | #include <iostream>
using namespace std;
static void print_object(const char *name, void *this_, size_t size) {
void **ugly = reinterpret_cast<void**>(this_);
size_t i;
printf("created %s at address %p of size %zu\n", name, this_, size);
for(i = 0 ; i < size / sizeof(void*) ; i++) {
printf(" pointer[%zu] == %p\n", i, ugly[i]);
}
}
class A {
public:
int id;
A(): id(1) {
printf("A: yay, my address is %p, my size is %zu, and my id is %d!\n",
this, sizeof(*this), this->id);
print_object(__FUNCTION__, this, sizeof(*this));
}
virtual void print() {
printf("I am A(%d)\n", id);
}
virtual void print2(){
printf("I am print2() from A\n");
}
};
class B {
public:
int age;
B(): age(2) {
printf("B: yay, my address is %p, my size is %zu, and my age is %d!\n",
this, sizeof(*this), this->age);
print_object(__FUNCTION__, this, sizeof(*this));
}
virtual void print() {
printf("I am B(%d)\n", age);
}
};
class C: public A, public B {
public:
int mode;
C(): mode(4) {
printf("C: yay, my address is %p, my size is %zu, my id, age and mode are %d, %d, %d!\n",
this, sizeof(*this), this->id, this->age, this->mode);
print_object(__FUNCTION__, this, sizeof(*this));
}
virtual void print() {
printf("I am C(%d, %d, %d)\n", id, age, mode);
}
virtual void print2(){
printf("I am print2() from C\n");
}
};
int main(int argc, char* argv[])
{
//A a;
//B b;
C c;
typedef void(*Fun)(void);
Fun pFun = nullptr;
long *cAsLong = (long *)&c;
cout << "C vtable ptr: "<<&cAsLong[0]<<endl;
long **cVtable = (long **)&c;
cout << "[0] C vtable: " << &cVtable[0][0] <<endl;
cout << "[1] C vtable: " << &cVtable[0][1] <<endl;
cout << "[2] C vtable: " << &cVtable[0][2] <<endl;
cout << "[3] C vtable: " << &cVtable[0][3] <<endl;
cout << "[4] C vtable: " << &cVtable[0][4] <<endl;
/* for (int i = 0; (Fun)cVtable[0][i] != NULL; i++)
{
pFun = (Fun)cVtable[0][i];
cout << " [" << i << "] ";
pFun();
}*/
cout << "[0]" << endl;
pFun = (Fun)cVtable[0][0];
pFun();
cout << "[1]" << endl;
pFun = (Fun)cVtable[0][1];
pFun();
cout << "[2]" << endl;
cout << *((int *) &cVtable[0][2]) << endl;
//pFun();
//cout << "[3]" << endl;
//pFun = (Fun)cVtable[0][3];
//pFun();
cout << "[4]" << endl;
pFun = (Fun)cVtable[0][4];
pFun();
return 0;
} | [
"kongww.nudt@gmail.com"
] | kongww.nudt@gmail.com |
4abd27deb62c872daadce18dfe1cb2b52d759322 | 477ee5b551232fd3bc784a3fab6e77ea36c4f18c | /SoundBoard/Engine/explosion.cpp | 620eca07fe21e777748dc50f8dd4f5e87f6359b2 | [] | no_license | beastpuncher/GameLibrariesProject | 3160d05c77cd8e532aaab67af95735fe68075202 | 7934af9343eed07c5e53451a398bf844bce21249 | refs/heads/master | 2021-06-02T10:30:48.519337 | 2020-01-22T05:05:12 | 2020-01-22T05:05:12 | 142,481,323 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,104 | cpp | #include "explosion.h"
#include "spriteComponent.h"
#include "animationComponent.h"
#include "audioSystems.h"
void Explosion::Create(const Vector2D & position)
{
m_transform.position = position;
m_transform.scale = Vector2D(2.0f, 2.0f);
SpriteComponent* spriteComponent = AddComponent<SpriteComponent>();
spriteComponent->Create("", Vector2D(0.5, 0.5f));
AnimationComponent* animationComponent = AddComponent<AnimationComponent>();
std::vector<std::string> textureNames = { "enemy-explosion01.png","enemy-explosion02.png","enemy-explosion03.png","enemy-explosion04.png","enemy-explosion05.png" };
animationComponent->Create(textureNames, 1.0f / 10.0f, AnimationComponent::ePlayback::ONE_TIME_DESTROY);
AudioSystems::Instance()->AddSound("hit1", "enemy-hit01.wav");
AudioSystems::Instance()->AddSound("hit2", "enemy-hit02.wav");
float select = 0;
select = Math::GetRandomRange(0.0f, 1.0f);
if (select <= 0.5f)
{
AudioSystems::Instance()->PlaySound("hit1", false);
}
else
{
AudioSystems::Instance()->PlaySound("hit2", false);
}
}
void Explosion::Update()
{
Entity::Update();
}
| [
"beastpuncher@gmail.com"
] | beastpuncher@gmail.com |
e59d7646dd27b51c687861721683fb756e1634b5 | a6af28b2551fa2dad84060ae6b99fbc3a0ef9a2a | /VK cup/round 3/A/C.cpp | d848fa7d1a38dedcf8a79819d2df1bdffa7f7864 | [] | no_license | blueyeq/codeforces | 894f8e11ce5d44b37df62238178b68ef06d78206 | 9cdc04bbb3cbafbfd92a604b373d1d3e3b11b3bd | refs/heads/master | 2016-09-06T04:54:00.474306 | 2013-07-20T15:42:39 | 2013-07-20T15:42:39 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,057 | cpp | #include <stdio.h>
#include <cstring>
#include <string>
#include <vector>
#include <algorithm>
#define MP make_pair
#define PB push_back
using namespace std;
const int MAXN = 100010;
vector< pair<int, int> > ans, a;
int h[MAXN], typ[MAXN];
int main()
{
// freopen("C.in", "r", stdin);
int n;
while(scanf("%d", &n) != EOF)
{
int Min(10000000);
for(int i = 1; i <= n; ++i)
{
scanf("%d", &h[i]);
Min = min(Min, h[i]);
}
ans.clear();
for(int i = 1; i <= Min; ++i)
ans.PB(MP(1, n));
for(int i = 1; i <= n; ++i)
h[i] -= Min;
for(int i = 1; i <= n; ++i)
{
while(h[i] == 0 && i <= n) ++i;
if(i > n) break;
a.clear();
a.PB(MP(h[i], i));
int Max(h[i]), lt(i);
typ[i] = 1;
while(h[i] <= h[i + 1] && i + 1 <= n)
{
// printf("---%d %d %d\n", i, h[i], h[i + 1]);
a.PB(MP(h[i + 1], i + 1));
Max = h[i + 1];
typ[i + 1] = 1;
++i;
}
// printf("%d ** %d\n", lt, i);
int rt = min(n, i);
while(h[i] >= h[i + 1] && i + 1 <= n && h[i + 1] > 0)
{
a.PB(MP(Max - h[i + 1], i + 1));
typ[i + 1] = -1;
++i;
}
sort(a.begin(), a.end());
vector< pair<int, int> > ::iterator it;
int hh = 0;
for(it = a.begin(); it != a.end(); ++it)
{
for(; hh < it->first; ++hh)
ans.PB(MP(lt, rt));
// printf("++%d %d\n", it->first, it->second);
int id = it->second;
if(typ[id] == -1) ++rt;
if(typ[id] == 1) ++lt;
}
}
printf("%d\n", ans.size());
for(int i = 0; i < ans.size(); ++i)
printf("%d %d\n", ans[i].first, ans[i].second);
}
return 0;
}
| [
"hnu0314@126.com"
] | hnu0314@126.com |
39de637f5ec07880e55bd9341055544f742d2374 | 5555bc68f5b54d9cb9a9ab0558b0b1e80fb5421a | /src/miner/simpleminer_protocol_defs.h | 77a2980f5cc5e98681735d1575f05cbb4054f799 | [
"MIT"
] | permissive | monero-classic-project/monero-classic | f039006b8e79299417e25d04fddcd24d366c67dc | a88ce4e38055aa43749f1f2ab066a8ce99c75534 | refs/heads/master | 2021-05-01T12:05:35.046668 | 2018-02-10T22:12:51 | 2018-02-10T22:12:51 | 121,058,016 | 5 | 4 | null | null | null | null | UTF-8 | C++ | false | false | 3,518 | h | // Copyright (c) 2018, The Monero Classic Developers.
// Portions Copyright (c) 2012-2013, The CryptoNote Developers.
//
// 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 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 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.
#pragma once
#include "cryptonote_protocol/cryptonote_protocol_defs.h"
#include "cryptonote_core/cryptonote_basic.h"
#include "crypto/hash.h"
#include "net/rpc_method_name.h"
namespace mining
{
//-----------------------------------------------
#define CORE_RPC_STATUS_OK "OK"
struct job_details
{
std::string blob;
std::string target;
std::string job_id;
BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE(blob)
KV_SERIALIZE(target)
KV_SERIALIZE(job_id)
END_KV_SERIALIZE_MAP()
};
struct COMMAND_RPC_LOGIN
{
RPC_METHOD_NAME("login");
struct request
{
std::string login;
std::string pass;
std::string agent;
BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE(login)
KV_SERIALIZE(pass)
KV_SERIALIZE(agent)
END_KV_SERIALIZE_MAP()
};
struct response
{
std::string status;
std::string id;
job_details job;
BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE(status)
KV_SERIALIZE(id)
KV_SERIALIZE(job)
END_KV_SERIALIZE_MAP()
};
};
struct COMMAND_RPC_GETJOB
{
RPC_METHOD_NAME("getjob");
struct request
{
std::string id;
BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE(id)
END_KV_SERIALIZE_MAP()
};
typedef job_details response;
};
struct COMMAND_RPC_SUBMITSHARE
{
RPC_METHOD_NAME("submit");
struct request
{
std::string id;
std::string nonce;
std::string result;
std::string job_id;
BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE(id)
KV_SERIALIZE(nonce)
KV_SERIALIZE(result)
KV_SERIALIZE(job_id)
END_KV_SERIALIZE_MAP()
};
struct response
{
std::string status;
BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE(status)
END_KV_SERIALIZE_MAP()
};
};
}
| [
"xmrc-dev@protonmail.com"
] | xmrc-dev@protonmail.com |
f6e25cdf751b96397fc6321a203655031a90a397 | 33dd9dff76072ea1b4014c618c8ad365ac477e07 | /五子棋/Wu.h | a1f7aa26a9285790c9751975aeadf3fc76ab6b72 | [] | no_license | gaoshaozhen/workspace | 8d04d690568ffbe01f6d3025c0deebf41d2a6991 | 313a84d78ee25a517c9e2fa8b0285b5a4a99709e | refs/heads/master | 2020-07-14T01:22:26.326546 | 2017-05-20T11:49:43 | 2017-05-20T11:49:43 | 66,636,679 | 0 | 0 | null | null | null | null | WINDOWS-1252 | C++ | false | false | 1,205 | h | #include<iostream>
using namespace std;
class A
{
public:
void fun();
void Ren();
void jushi();
void computer(int a[15][15]);
int panduan(int x,int y,int sum);
private:
int c,d;
int luozi[15][15],com[15][15];
const char outstr[11][4]={"©°","©Ð","©´","©À","©à","©È","©¸","©Ø","©¼","¡ð","¡ñ"};
int a[15][15]= {{0,1,1,1,1,1,1,1,1,1,1,1,1,1,2},
{3,4,4,4,4,4,4,4,4,4,4,4,4,4,5},
{3,4,4,4,4,4,4,4,4,4,4,4,4,4,5},
{3,4,4,4,4,4,4,4,4,4,4,4,4,4,5},
{3,4,4,4,4,4,4,4,4,4,4,4,4,4,5},
{3,4,4,4,4,4,4,4,4,4,4,4,4,4,5},
{3,4,4,4,4,4,4,4,4,4,4,4,4,4,5},
{3,4,4,4,4,4,4,4,4,4,4,4,4,4,5},
{3,4,4,4,4,4,4,4,4,4,4,4,4,4,5},
{3,4,4,4,4,4,4,4,4,4,4,4,4,4,5},
{3,4,4,4,4,4,4,4,4,4,4,4,4,4,5},
{3,4,4,4,4,4,4,4,4,4,4,4,4,4,5},
{3,4,4,4,4,4,4,4,4,4,4,4,4,4,5},
{3,4,4,4,4,4,4,4,4,4,4,4,4,4,5},
{6,7,7,7,7,7,7,7,7,7,7,7,7,7,8}};
};
| [
"2456071896@qq.com"
] | 2456071896@qq.com |
fa9dd8660713280d612cf42cd7191e37d7b891c7 | b2d9ae1a439a43bb53b06b798618a3cebd371c83 | /original/RPG volumes/RPG vol. 5/rpg.cpp | 0c7eeb067e6c88ebba0b75be64eafdc416834dbd | [] | no_license | kingnobody8/fs.thelastunicorn | 60484f3d74130b70986bd96d4941076def6289f8 | 9959d3a037397f84478e0b273594332e35ee803e | refs/heads/master | 2021-01-20T20:52:40.318756 | 2018-11-24T19:05:14 | 2018-11-24T19:05:14 | 60,742,515 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 198,615 | cpp | //The headers
#include "SDL/SDL.h"
#include "SDL/SDL_image.h"
#include "SDL/SDL_ttf.h"
#include "SDL/SDL_mixer.h"
#include <string>
#include <sstream>
//Screen attributes
const int SCREEN_WIDTH = 640;
const int SCREEN_HEIGHT = 480;
const int SCREEN_BPP = 32;
//the frame rate
int FRAMES_PER_SECOND = 30;
//what is the type of screen being shown
//show title screen
bool title_screen = true;
bool text_screen = false;
bool gameplay = false;
bool gameplay_text = false;
bool boss = false;
bool boss_text = false;
bool end = false;
bool credits = false;
//the outcomes
bool win = false;
bool lose = false;
//which battle is being fought
int battle = 0;
//the music that will be played
Mix_Music *dark_winds = NULL;
Mix_Music *battle_theme = NULL;
//the beats per minute for the songs
int dark_winds_bpms = 120;
int battle_theme_bpms = 300;
// which enemies are shown on screen
bool bad1 = true;
bool bad2 = true;
bool bad3 = true;
bool bad4 = true;
bool bad5 = true;
bool bad6 = true;
// the arrow location
int arx = 15;
int ary = 350;
//what arrow to show
bool right = true;
bool left = false;
//the characters locations
int char1x = 75, char1y = 85;
int char2x = 75, char2y = 165;
int char3x = 75, char3y = 245;
//the enemy locations
int ene1x, ene1y;
int ene2x, ene2y;
int ene3x, ene3y;
int ene4x, ene4y;
int ene5x, ene5y;
int ene6x, ene6y;
//the final boss location
int bossx, bossy;
// the character health integers
int player1_health = 400;
int player1_total_health = 400;
int player1_magic = 20;
int player1_total_magic = 20;
int player2_health = 500;
int player2_total_health = 500;
int player2_magic = 50;
int player2_total_magic = 50;
int player3_health = 800;
int player3_total_health = 800;
int player3_magic = 30;
int player3_total_magic = 30;
//the enemy health integers
int enemy1_health = 500;
int enemy2_health = 500;
int enemy3_health = 500;
int enemy4_health = 500;
int enemy5_health = 500;
int enemy6_health = 500;
//enemy types attack power
//the final boss health
int boss_health;
//the players attack and magic power
int player1_attack_power = 1;
int player1_magic_power = 1;
int player2_attack_power = 1;
int player2_magic_power = 1;
int player3_attack_power = 1;
int player3_magic_power = 1;
//the enemy attack power
int enemy1_attack = 1;
int enemy2_attack = 1;
int enemy3_attack = 1;
int enemy4_attack = 1;
int enemy5_attack = 1;
int enemy6_attack = 1;
//the values of magic
int rage_magic = 10;
int power_magic = 10;
int burn_magic = 10;
int freeze_magic = 8;
int protect_magic = 5;
int taunt_magic = 2;
//the mulitpliers
int rage = 5;
int limit1_power = 0;
int limit2_power = 0;
int limit3_power = 0;
int burn = 3;
int freeze = 3;
//the counter for power x2
int power_counter = 0;
//the players counts of items
int player1_item1_count = 5;
int player1_item2_count = 5;
int player1_item3_count = 5;
int player2_item1_count = 5;
int player2_item2_count = 5;
int player2_item3_count = 5;
int player3_item1_count = 5;
int player3_item2_count = 5;
int player3_item3_count = 5;
//the values of items
int spirit = 50;
int hi_spirit = 100;
int ether = 10;
int hi_ether = 20;
//make the character selection, the primary selection, sub selection, and target selection
int choose1 = 0;
int choose2 = 0;
int choose3 = 0;
int choose4 = 0;
//make an array for each character to hold their selections
int player1_array[3] = {0};
int player2_array[3] = {0};
int player3_array[3] = {0};
//check whether or not the sub selection can even be accessed
bool play1m = true;
bool play2m = true;
bool play3m = true;
bool play1i = true;
bool play2i = true;
bool play3i = true;
//check whether or not a part of the magic sub selection can be used
bool play1m1 = true;
bool play1m2 = true;
bool play2m1 = true;
bool play2m2 = true;
bool play3m1 = true;
bool play3m2 = true;
//check whether or not a part of the item sub selection can be used
bool play1i1 = true;
bool play1i2 = true;
bool play1i3 = true;
bool play2i1 = true;
bool play2i2 = true;
bool play2i3 = true;
bool play3i1 = true;
bool play3i2 = true;
bool play3i3 = true;
//if enemies are weaker against certain magic
//The surfaces
SDL_Surface *screen = NULL;
SDL_Surface *title_screen_background = NULL;
SDL_Surface *start_button_on = NULL;
SDL_Surface *start_button_off = NULL;
SDL_Surface *direction_button_on = NULL;
SDL_Surface *direction_button_off = NULL;
SDL_Surface *text_background = NULL;
SDL_Surface *background = NULL;
SDL_Surface *sky = NULL;
SDL_Surface *command_background = NULL;
SDL_Surface *character_background = NULL;
SDL_Surface *arrow_right = NULL;
SDL_Surface *arrow_left = NULL;
SDL_Surface *health_counter = NULL;
SDL_Surface *magic_counter = NULL;
SDL_Surface *attack_background = NULL;
SDL_Surface *magic_background = NULL;
SDL_Surface *item_background = NULL;
SDL_Surface *magic_sub_selection = NULL;
SDL_Surface *item_sub_selection = NULL;
//the characters
SDL_Surface *character1 = NULL;
SDL_Surface *enemy1 = NULL;
//The text that will be displayed
//character 1 attributes
SDL_Surface *character1_name = NULL;
SDL_Surface *character1_health = NULL;
SDL_Surface *character1_total_health = NULL;
SDL_Surface *character1_magic = NULL;
SDL_Surface *character1_total_magic = NULL;
//character 2 attributes
SDL_Surface *character2_name = NULL;
SDL_Surface *character2_health = NULL;
SDL_Surface *character2_total_health = NULL;
SDL_Surface *character2_magic = NULL;
SDL_Surface *character2_total_magic = NULL;
//character 3 attributes
SDL_Surface *character3_name = NULL;
SDL_Surface *character3_health = NULL;
SDL_Surface *character3_total_health = NULL;
SDL_Surface *character3_magic = NULL;
SDL_Surface *character3_total_magic = NULL;
// primary selection attributes
SDL_Surface *attack_text = NULL;
SDL_Surface *magic_text = NULL;
SDL_Surface *item_text = NULL;
//sub selection attributes
//knight magic selection
SDL_Surface *rage_text = NULL;
SDL_Surface *hitx2_text = NULL;
SDL_Surface *limit_text = NULL;
//dark mage magic selection
SDL_Surface *fire_text = NULL;
SDL_Surface *ice_text = NULL;
//ninja magic selection
SDL_Surface *protect_text = NULL;
SDL_Surface *taunt_text = NULL;
//item sub selection options
SDL_Surface *player1_spirits_text = NULL;
SDL_Surface *player1_hi_spirits_text = NULL;
SDL_Surface *player1_lazarus_text = NULL;
SDL_Surface *player2_ether_text = NULL;
SDL_Surface *player2_hi_ether_text = NULL;
SDL_Surface *player2_lazarus_text = NULL;
SDL_Surface *player3_hi_spirits_text = NULL;
SDL_Surface *player3_hi_ether_text = NULL;
SDL_Surface *player3_lazarus_text = NULL;
//the enemy health text
SDL_Surface *enemy1_health_text = NULL;
SDL_Surface *enemy2_health_text = NULL;
SDL_Surface *enemy3_health_text = NULL;
SDL_Surface *enemy4_health_text = NULL;
SDL_Surface *enemy5_health_text = NULL;
SDL_Surface *enemy6_health_text = NULL;
//warning messages
SDL_Surface *item_warning = NULL;
SDL_Surface *magic_warning = NULL;
SDL_Surface *cheese1 = NULL;
SDL_Surface *cheese2 = NULL;
SDL_Surface *cheese3 = NULL;
SDL_Surface *cheese4 = NULL;
//The event structure that will be used
SDL_Event event;
//The font that's going to be used
TTF_Font *font = NULL;
TTF_Font *font_small = NULL;
//The color of the font
SDL_Color textColor = { 0, 0, 0 };
SDL_Color alertColor = {197, 16, 26};
SDL_Color introColor = {255, 255, 255};
//the intro text
SDL_Surface *text1 = NULL;
SDL_Surface *text2 = NULL;
SDL_Surface *text3 = NULL;
SDL_Surface *text4 = NULL;
SDL_Surface *text5 = NULL;
SDL_Surface *text6 = NULL;
SDL_Surface *text7 = NULL;
SDL_Surface *text8 = NULL;
SDL_Surface *text9 = NULL;
SDL_Surface *text10 = NULL;
SDL_Surface *text11 = NULL;
SDL_Surface *text12 = NULL;
SDL_Surface *text13 = NULL;
SDL_Surface *text14 = NULL;
SDL_Surface *text15 = NULL;
//The timer
class Timer
{
private:
//The clock time when the timer started
int startTicks;
//The ticks stored when the timer was paused
int pausedTicks;
//The timer status
bool paused;
bool started;
public:
//Initializes variables
Timer();
//The various clock actions
void start();
void stop();
void pause();
void unpause();
//Gets the timer's time
int get_ticks();
//Checks the status of the timer
bool is_started();
bool is_paused();
};
SDL_Surface *load_image( std::string filename )
{
//The image that's loaded
SDL_Surface* loadedImage = NULL;
//The optimized image that will be used
SDL_Surface* optimizedImage = NULL;
//Load the image
loadedImage = IMG_Load( filename.c_str() );
//If the image loaded
if( loadedImage != NULL )
{
//Create an optimized image
optimizedImage = SDL_DisplayFormat( loadedImage );
//Free the old image
SDL_FreeSurface( loadedImage );
//If the image was optimized just fine
if( optimizedImage != NULL )
{
//Map the color key
Uint32 colorkey = SDL_MapRGB( optimizedImage->format, 255, 0, 255 );
//Set all pixels of color R 0, G 0xFF, B 0xFF to be transparent
SDL_SetColorKey( optimizedImage, SDL_SRCCOLORKEY, colorkey );
}
}
//Return the optimized image
return optimizedImage;
}
void apply_surface( int x, int y, SDL_Surface* source, SDL_Surface* destination )
{
//Temporary rectangle to hold the offsets
SDL_Rect offset;
//Get the offsets
offset.x = x;
offset.y = y;
//Blit the surface
SDL_BlitSurface( source, NULL, destination, &offset );
}
bool init()
{
//Initialize all SDL subsystems
if( SDL_Init( SDL_INIT_EVERYTHING ) == -1 )
{
return false;
}
//Set up the screen
screen = SDL_SetVideoMode( SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_BPP, SDL_SWSURFACE );
//If there was an error in setting up the screen
if( screen == NULL )
{
return false;
}
//Initialize SDL_ttf
if( TTF_Init() == -1 )
{
return false;
}
//Initialize SDL_mixer
if( Mix_OpenAudio( 22050, MIX_DEFAULT_FORMAT, 2, 4096 ) == -1 )
{
return false;
}
//Set the window caption
SDL_WM_SetCaption( "THE LAST UNICORN", NULL );
//If everything initialized fine
return true;
}
bool load_files()
{
//Load the music
dark_winds = Mix_LoadMUS( "Dark Winds.wav" );
battle_theme = Mix_LoadMUS( "Battle Theme.wav" );
//If there was a problem loading the music
if( dark_winds == NULL )
{
return false;
}
if( battle_theme == NULL )
{
return false;
}
//Load the image
background = load_image( "background.png" );
command_background = load_image( "command_background.png" );
character_background = load_image( "character_background.png" );
arrow_right = load_image( "arrow_right.png" );
arrow_left = load_image( "arrow_left.png" );
health_counter = load_image( "health_counter.png" );
magic_counter = load_image( "magic_counter.png" );
attack_background = load_image( "attack_background.png" );
magic_background = load_image( "magic_background.png" );
item_background = load_image( "item_background.png" );
magic_sub_selection = load_image( "magic_sub_selection.png" );
item_sub_selection = load_image( "item_sub_selection.png" );
character1 = load_image( "mario.png" );
enemy1 = load_image( "flower.png" );
sky = load_image( "sky1.png" );
start_button_on = load_image( "start_button_on.png" );
start_button_off = load_image( "start_button_off.png" );
direction_button_on = load_image( "directions_button_on.png" );
direction_button_off = load_image( "directions_button_off.png" );
text_background = load_image( "text_background.png" );
//Open the font
font = TTF_OpenFont( "tnr.ttf", 22 );
font_small = TTF_OpenFont( "tnr.ttf", 15 );
//If there was an error in loading the font
if( font == NULL )
{
return false;
}
if( font_small == NULL )
{
return false;
}
//If there was an error in loading the image
if( start_button_on == NULL )
{
return false;
}
if( start_button_off == NULL )
{
return false;
}
if( direction_button_on == NULL )
{
return false;
}
if( direction_button_off == NULL )
{
return false;
}
if( background == NULL )
{
return false;
}
if( command_background == NULL )
{
return false;
}
if( character_background == NULL )
{
return false;
}
if( arrow_right == NULL )
{
return false;
}
if( arrow_left == NULL )
{
return false;
}
if( health_counter == NULL )
{
return false;
}
if( magic_counter == NULL )
{
return false;
}
if( attack_background == NULL )
{
return false;
}
if( magic_background == NULL )
{
return false;
}
if( item_background == NULL )
{
return false;
}
if( magic_sub_selection == NULL )
{
return false;
}
if( item_sub_selection == NULL )
{
return false;
}
if ( character1 == NULL )
{
return false;
}
if ( enemy1 == NULL )
{
return false;
}
if ( sky == NULL )
{
return false;
}
if ( text_background == NULL )
{
return false;
}
//If everything loaded fine
return true;
}
void clean_up()
{
//Free the music
Mix_FreeMusic( dark_winds );
Mix_FreeMusic( battle_theme );
//Quit SDL_mixer
Mix_CloseAudio();
//Free the surface
SDL_FreeSurface( background );
SDL_FreeSurface( command_background );
SDL_FreeSurface( character_background );
SDL_FreeSurface( arrow_right );
SDL_FreeSurface( arrow_left );
SDL_FreeSurface( health_counter );
SDL_FreeSurface( magic_counter );
SDL_FreeSurface( attack_background );
SDL_FreeSurface( magic_background );
SDL_FreeSurface( item_background );
SDL_FreeSurface( magic_sub_selection );
SDL_FreeSurface( item_sub_selection );
SDL_FreeSurface( character1 );
SDL_FreeSurface( enemy1 );
SDL_FreeSurface( sky );
SDL_FreeSurface( start_button_on );
SDL_FreeSurface( start_button_off );
SDL_FreeSurface( direction_button_on );
SDL_FreeSurface( direction_button_off );
SDL_FreeSurface( text_background );
//Close the font that was used
TTF_CloseFont( font );
//Quit SDL_ttf
TTF_Quit();
//Quit SDL
SDL_Quit();
}
Timer::Timer()
{
//Initialize the variables
startTicks = 0;
pausedTicks = 0;
paused = false;
started = false;
}
void Timer::start()
{
//Start the timer
started = true;
//Unpause the timer
paused = false;
//Get the current clock time
startTicks = SDL_GetTicks();
}
void Timer::stop()
{
//Stop the timer
started = false;
//Unpause the timer
paused = false;
}
void Timer::pause()
{
//If the timer is running and isn't already paused
if( ( started == true ) && ( paused == false ) )
{
//Pause the timer
paused = true;
//Calculate the paused ticks
pausedTicks = SDL_GetTicks() - startTicks;
}
}
void Timer::unpause()
{
//If the timer is paused
if( paused == true )
{
//Unpause the timer
paused = false;
//Reset the starting ticks
startTicks = SDL_GetTicks() - pausedTicks;
//Reset the paused ticks
pausedTicks = 0;
}
}
int Timer::get_ticks()
{
//If the timer is running
if( started == true )
{
//If the timer is paused
if( paused == true )
{
//Return the number of ticks when the timer was paused
return pausedTicks;
}
else
{
//Return the current time minus the start time
return SDL_GetTicks() - startTicks;
}
}
//If the timer isn't running
return 0;
}
bool Timer::is_started()
{
return started;
}
bool Timer::is_paused()
{
return paused;
}
int main( int argc, char* args[] )
{
//Make sure the program waits for a quit
bool quit = false;
bool running = true;
bool start_button = true;
//the offsets of the sky background
float bgX = 0, bgY = 0;
//The frame rate regulator
Timer fps;
//the bpm for the title screen
Timer title_time;
//the timer for the intro text
Timer intro_text;
//make factors to make the correct selection boxes appear when appropriate
bool attack_box = false;
bool magic_box = false;
bool item_box = false;
bool magic_sub_box = false;
bool item_sub_box = false;
//have the choose selection perform actions in the correct order
int order1 = 0;
int order2 = 0;
int order3 = 0;
int player1_selection;
int player2_selection;
int player3_selection;
//variables for use during gameplay
int point;
int enemy_random;
int text_counter = 0;
//Initialize
if( init() == false )
{
return 1;
}
//Load the files
if( load_files() == false )
{
return 1;
}
while(quit == false)
{
while(title_screen == true)
{
//If there is no music playing
if( Mix_PlayingMusic() == 0 )
{
title_time.start();
//Play the music
if( Mix_PlayMusic( dark_winds, -1 ) == 1 )
{
return 1;
}
}
//While there's an event to handle
while( SDL_PollEvent( &event ) )
{
//If a key was pressed
if( event.type == SDL_KEYDOWN )
{
switch ( event.key.keysym.sym )
{
case SDLK_UP:
{
if( start_button == true)
{start_button = false; break;}
else if(start_button == false)
{start_button = true; break;}
}
case SDLK_DOWN:
{
if( start_button == true)
{start_button = false; break;}
else if(start_button == false)
{start_button = true; break;}
}
case SDLK_a:
{
if(start_button == true)
{
if( (2000*title_time.get_ticks())%3 > 0 )
{SDL_Delay(1000*(3-((2000*title_time.get_ticks())%3)));}
Mix_HaltMusic();
title_screen = false;
gameplay = true;
break;
}
}
case SDLK_RETURN:
{
if(start_button == true)
{
title_screen = false;
text_screen = true;
break;
}
}
case SDLK_SPACE:
{
if(start_button == true)
{
if( Mix_PlayingMusic() != 0 )
{
//Pause the music
Mix_HaltMusic();
}
title_screen = false;
text_screen = true;
break;
}
}
default:
{break;}
}
}
//If the user has Xed out the window
if( event.type == SDL_QUIT )
{
//Quit the program
title_screen = false;
}
apply_surface(0, 0, text_background, screen);
if(start_button == true)
{
apply_surface(220, 220, start_button_on, screen );
apply_surface(120, 350, direction_button_off, screen ); break;
}
else
{
apply_surface(220, 220, start_button_off, screen );
apply_surface(120, 350, direction_button_on, screen ); break;
}
}
//Update the screen
if( SDL_Flip( screen ) == -1 )
{
return 1;
}
//Cap the frame rate
if( fps.get_ticks() < 1000 / FRAMES_PER_SECOND )
{
SDL_Delay( ( 1000 / FRAMES_PER_SECOND ) - fps.get_ticks() );
}
}
while (text_screen == true)
{
intro_text.start();
bool texting = true;
while(texting == true)
{
//If there is no music playing
if( Mix_PlayingMusic() == 0 )
{
title_time.start();
//Play the music
if( Mix_PlayMusic( dark_winds, -1 ) == 1 )
{
return 1;
}
}
apply_surface(0, 0, text_background, screen);
apply_surface(50, 40, text1, screen);
apply_surface(50, 70, text2, screen);
apply_surface(50, 100, text3, screen);
apply_surface(50, 130, text4, screen);
apply_surface(50, 160, text5, screen);
apply_surface(50, 190, text6, screen);
apply_surface(50, 220, text7, screen);
apply_surface(50, 250, text8, screen);
apply_surface(50, 280, text9, screen);
apply_surface(50, 310, text10, screen);
apply_surface(50, 340, text11, screen);
apply_surface(50, 370, text12, screen);
apply_surface(50, 400, text13, screen);
apply_surface(50, 430, text14, screen);
apply_surface(400, 430, text15, screen);
while( SDL_PollEvent( &event ) )
{
//If a key was pressed
if( event.type == SDL_KEYDOWN )
{
switch ( event.key.keysym.sym )
{
case SDLK_a:
{
texting = false;
gameplay = true;
}
default:
{
texting = false;
gameplay = true;
}
}
}
//If the user has Xed out the window
if( event.type == SDL_QUIT )
{
//Quit the program
texting = false;
}
}
//Update the screen
if( SDL_Flip( screen ) == -1 )
{
return 1;
}
//Cap the frame rate
if( fps.get_ticks() < 1000 / FRAMES_PER_SECOND )
{
SDL_Delay( ( 1000 / FRAMES_PER_SECOND ) - fps.get_ticks() );
}
if(intro_text.get_ticks() > 1000)
{ text1 = TTF_RenderText_Solid( font, "In the far away land of Canadia, evil dwells among the citizens.", introColor );}
if(intro_text.get_ticks() > 5000)
text2 = TTF_RenderText_Solid( font, "The immortal Dark Overlord and his armies have wrought havoc ", introColor );
if(intro_text.get_ticks() > 5000)
text3 = TTF_RenderText_Solid( font, "upon the land, while on the path to kill The Duke of Canadia.", introColor );
if(intro_text.get_ticks() > 12000)
text4 = TTF_RenderText_Solid( font, "The Duke has lost nearly all control of his dominion and ", introColor );
if(intro_text.get_ticks() > 12000)
text5 = TTF_RenderText_Solid( font, "The Overlord's armies have surrounded his castle.", introColor );
if(intro_text.get_ticks() > 17000)
text6 = TTF_RenderText_Solid( font, "Prophecy foretold of the Overlord's only weakness,", introColor );
if(intro_text.get_ticks() > 21000)
text7 = TTF_RenderText_Solid( font, "the horn of a unicorn.", introColor );
if(intro_text.get_ticks() > 23000)
text8 = TTF_RenderText_Solid( font, "However, the unicorns have been extinct for some time, ", introColor );
if(intro_text.get_ticks() > 27000)
text9 = TTF_RenderText_Solid( font, "all were killed in the early days of the Dark Overlord.", introColor );
if(intro_text.get_ticks() > 31000)
text10 = TTF_RenderText_Solid( font, "In the final battle, the last of The Duke's armies were defeated. ", introColor );
if(intro_text.get_ticks() > 35000)
text11 = TTF_RenderText_Solid( font, "The Duke and his leading generals fled.", introColor );
if(intro_text.get_ticks() > 38000)
text12 = TTF_RenderText_Solid( font, "Out of desperation, The Duke sent two of his most noble men", introColor );
if(intro_text.get_ticks() > 41000)
text13 = TTF_RenderText_Solid( font, "to the past in search of a unicorn horn. ", introColor );
if(intro_text.get_ticks() > 44000)
text14 = TTF_RenderText_Solid( font, "This is their last hope...", introColor );
if(intro_text.get_ticks() > 46000)
text15 = TTF_RenderText_Solid( font, "Click to Continue", introColor );
}
Mix_HaltMusic();
text_screen = false;
break;
}
while(gameplay == true)
{
if( Mix_PlayingMusic() == 0 )
{
title_time.start();
//Play the music
if( Mix_PlayMusic( battle_theme, -1 ) == 1 )
{
return 1;
}
}
//Start the frame timer
fps.start();
//Apply the surface to the screen
apply_surface(bgX, bgY, sky, screen );
apply_surface( bgX + background->w, bgY, sky, screen );
apply_surface( 0, 0, background, screen );
apply_surface( 0, 330, command_background, screen );
apply_surface( 50, 345, character_background, screen);
apply_surface( 50, 385, character_background, screen);
apply_surface( 50, 425, character_background, screen);
apply_surface( 170, 345, health_counter, screen);
apply_surface( 220, 345, magic_counter, screen);
//While there's an event to handle
while( SDL_PollEvent( &event ) )
{
//If a key was pressed
if( event.type == SDL_KEYDOWN )
{
switch ( event.key.keysym.sym )
{
case SDLK_UP:
{
//this is for selecting characters, primaries, and sub
if( ary != 350 && ary > 350)
{
if(arx != 15 && ary != 350)
{
ary = ary - 40; break;
}
else if(order1 == 0)
{
ary = ary - 40; break;
}
else if(arx == 15 && order1 == 1 && order2 == 0)
{
if(ary == 390)
{ary = 430; break;}
else if(ary == 430)
{ary = 390; break;}
}
else if(arx == 15 && order1 == 2 && order2 == 0)
{
ary = 350; break;
}
else if (arx == 15 && order1 == 3 && order2 == 0)
{
ary = 350; break;
}
else if(arx == 15 && order1 != 0 && order2 != 0)
{
break;
}
}
else if( ary == 350)
{
if(order1 == 0)
{
ary = 430; break;
}
else if(arx != 15)
{
ary = 430; break;
}
else if(arx == 15 && order1 == 2 && order2 == 0)
{
if(ary == 350)
{ary = 430; break;}
else
{break;}
}
else if(arx == 15 && order1 == 3 && order2 == 0)
{
if(ary == 350)
{ary = 390; break;}
else
{ary = 430; break;}
}
else if (arx == 15 && order1 != 0 && order2 != 0)
{
break;
}
}
// this is for selecting who will receive the action
else if(ary < 350 && arx != 140)
{
//for characters
if(arx == 15)
{ary = ary - 80; break;}
//for first row bad guys if they are all present
if(arx == 435 && bad1 == true && bad2 == true && bad3 == true)
{
if(ary == 110)
{ary = 270; break;}
else
{ary = ary - 80; break;}
}
//for second row bad guys if they are all present
if(arx == 540 && bad4 == true && bad5 == true && bad6 == true)
{
if(ary == 110)
{ary = 270; break;}
else
{ary = ary - 80; break;}
}
//for first row depending on which ones are present
else if(arx == 435)
{
if(ary == 110)
{
if(bad3 == false)
{
if(bad2 == false)
{break;}
else
{ary = 190; break;}
}
else
{ary = 270; break;}
}
if(ary == 190)
{
if(bad1 == false)
{
if(bad3 == false)
{break;}
else
{ary = 270; break;}
}
else
{ary = 110; break;}
}
if(ary == 270)
{
if(bad2 == false)
{
if(bad1 == false)
{break;}
else
{ary = 110; break;}
}
else
{ary = 190; break;}
}
}
//for the second row depending on which ones are present
else if(arx == 540)
{
if(ary == 110)
{
if(bad6 == false)
{
if(bad5 == false)
{break;}
else
{ary = 190; break;}
}
else
{ary = 270; break;}
}
if(ary == 190)
{
if(bad4 == false)
{
if(bad6 == false)
{break;}
else
{ary = 270; break;}
}
else
{ary = 110; break;}
}
if(ary == 270)
{
if(bad5 == false)
{
if(bad4 == false)
{break;}
else
{ary = 110; break;}
}
else
{ary = 190; break;}
}
}
}
else if(arx == 140)
{
if(ary == 110)
{ary = 270;break;}
else
{ary = ary - 80; break;}
}
else
{break;}
}
case SDLK_DOWN:
{
//this is for selecting a character, primary, or sub
if( ary >= 350 && ary != 430)
{
if(arx != 15 && ary != 430)
{
ary = ary + 40; break;
}
else if(order1 == 0)
{
ary = ary + 40; break;
}
else if(arx == 15 && order1 == 1 && order2 == 0)
{
ary = 430; break;
}
else if(arx == 15 && order1 == 2 && order2 == 0)
{
ary = 430; break;
}
else if (arx == 15 && order1 == 3 && order2 == 0)
{
if(ary == 390)
{ary = 350; break;}
else if(ary == 350)
{ ary = 390; break;}
}
else if(arx == 15 && order1 != 0 && order2 != 0)
{
break;
}
}
else if( ary == 430)
{
if(order1 == 0)
{
ary = 350; break;
}
else if(arx != 15)
{
ary = 350; break;
}
else if(arx == 15 && order1 ==1 && order2 == 0)
{
ary = 390; break;
}
else if(arx == 15 && order1 == 2 && order2 == 0)
{
ary = 350; break;
}
else if (arx == 15 && order1 != 0 && order2 != 0)
{
break;
}
}
//this is for selecting who will receive the action
else if(ary < 350 && arx != 140)
{
//for characters
if(arx == 15)
{ary = ary + 80; break;}
//for first row bad guys if they are all present
if(arx == 435 && bad1 == true && bad2 == true && bad3 == true)
{
if(ary == 270)
{ary = 110; break;}
else
{ary = ary + 80; break;}
}
//for second row bad guys if they are all present
if(arx == 540 && bad4 == true && bad5 == true && bad6 == true)
{
if(ary == 270)
{ary = 110; break;}
else
{ary = ary + 80; break;}
}
//for first row depending on which ones are present
else if(arx == 435)
{
if(ary == 110)
{
if(bad2 == false)
{
if(bad3 == false)
{break;}
else
{ary = 270; break;}
}
else
{ary = 190; break;}
}
if(ary == 190)
{
if(bad3 == false)
{
if(bad1 == false)
{break;}
else
{ary = 110; break;}
}
else
{ary = 270; break;}
}
if(ary == 270)
{
if(bad1 == false)
{
if(bad2 == false)
{break;}
else
{ary = 190; break;}
}
else
{ary = 110; break;}
}
}
//for the second row depending on which ones are present
else if(arx == 540)
{
if(ary == 110)
{
if(bad5 == false)
{
if(bad6 == false)
{break;}
else
{ary = 270; break;}
}
else
{ary = 190; break;}
}
if(ary == 190)
{
if(bad6 == false)
{
if(bad4 == false)
{break;}
else
{ary = 110; break;}
}
else
{ary = 270; break;}
}
if(ary == 270)
{
if(bad4 == false)
{
if(bad5 == false)
{break;}
else
{ary = 190; break;}
}
else
{ary = 110; break;}
}
}
}
else if(arx == 140)
{
if(ary == 270)
{ary = 110;break;}
else
{ary = ary + 80; break;}
}
else
{break;}
}
case SDLK_RIGHT:
{
//moving from first row to second row
if(ary < 350 && arx == 435)
{
if(ary == 110)
{
if(bad4 == true)
{arx = 540; ary = 110; break;}
else if(bad5 == true)
{arx = 540; ary = 190; break;}
else if(bad6 == true)
{arx = 540; ary = 270; break;}
else
{break;}
}
if(ary == 190)
{
if(bad5 == true)
{arx = 540; ary = 190; break;}
else if(bad4 == true)
{arx = 540; ary = 110; break;}
else if(bad6 == true)
{arx = 540; ary = 270; break;}
else
{break;}
}
if(ary == 270)
{
if(bad6 == true)
{arx = 540; ary = 270; break;}
else if(bad5 == true)
{arx = 540; ary = 190; break;}
else if(bad4 == true)
{arx = 540; ary = 110; break;}
else
{break;}
}
}
//moving from the characters to the first or second row
else if(ary < 350 && arx == 140)
{
//if the first row is all there
if(bad1 == true && bad2 == true && bad3 == true)
{arx = 435; right = true; left = false; break;}
//if the any are missing from the front row
else
{
if(ary == 110)
{
if(bad1 == false)
{
if(bad2 == false)
{
if(bad3 == false)
{
if(bad4 == false)
{
if(bad5 == false)
{
arx = 540; ary = 270; right = true; left = false; break;
}
else
{arx = 540; ary = 190; right = true; left = false; break;}
}
else
{ arx = 540; ary = 110; right = true; left = false; break;}
}
else
{arx = 435; ary = 270; right = true; left = false; break;}
}
else
{arx = 435; ary = 190; right = true; left = false; break;}
}
else
{arx = 435; ary = 110; right = true; left = false; break;}
}
if(ary == 190)
{
if(bad2 == false)
{
if(bad1 == false)
{
if(bad3 == false)
{
if(bad5 == false)
{
if(bad4 == false)
{
arx = 540; ary = 270; right = true; left = false; break;
}
else
{
arx = 540; ary = 110; right = true; left = false; break;
}
}
else
{ arx = 540; ary = 190; right = true; left = false; break;}
}
else
{arx = 435; ary = 270; right = true; left = false; break;}
}
else
{arx = 435; ary = 110; right = true; left = false; break;}
}
else
{arx = 435; ary = 190; right = true; left = false; break;}
}
if(ary == 270)
{
if(bad3 == false)
{
if(bad2 == false)
{
if(bad1 == false)
{
if(bad6 == false)
{
if(bad5 == false)
{
arx = 540; ary = 110; right = true; left = false; break;
}
else
{
arx = 540; ary = 190; right = true; left = false; break;
}
}
else
{ arx = 540; ary = 270; right = true; left = false; break;}
}
else
{arx = 435; ary = 110; right = true; left = false; break;}
}
else
{arx = 435; ary = 190; right = true; left = false; break;}
}
else
{arx = 435; ary = 270; right = true; left = false; break;}
}
}
}
else
{break;}
}
case SDLK_LEFT:
{
if(ary < 350 && arx == 540)
{
if(ary == 110)
{
if(bad1 == true)
{arx = 435; ary = 110; break;}
else if(bad2 == true)
{arx = 435; ary = 190; break;}
else if(bad3 == true)
{arx = 435; ary = 270; break;}
else
{arx = 140; right = false; left = true; break;}
}
if(ary == 190)
{
if(bad2 == true)
{arx = 435; ary = 190; break;}
else if(bad1 == true)
{arx = 435; ary = 110; break;}
else if(bad3 == true)
{arx = 435; ary = 270; break;}
else
{arx = 140; right = false; left = true; break;}
}
if(ary == 270)
{
if(bad3 == true)
{arx = 435; ary = 270; break;}
else if(bad2 == true)
{arx = 435; ary = 190; break;}
else if(bad1 == true)
{arx = 435; ary = 110; break;}
else
{arx = 140; right = false; left = true; break;}
}
}
else if( ary < 350 && arx == 435)
{ arx = 140; right = false; left = true; break;}
else
{break;}
}
case SDLK_a:
{
// check first for target selection
if( ary < 350 )
{
if( arx == 140 && ary == 110)
{choose4 = 1;}
else if( arx == 140 && ary == 190)
{choose4 = 2;}
else if( arx == 140 && ary == 270)
{choose4 = 3;}
else if( arx == 435 && ary == 110)
{choose4 = 4;}
else if( arx == 435 && ary == 190)
{choose4 = 5;}
else if( arx == 435 && ary == 270)
{choose4 = 6;}
else if( arx == 540 && ary == 110)
{choose4 = 7;}
else if( arx == 540 && ary == 190)
{choose4 = 8;}
else if( arx == 540 && ary == 270)
{choose4 = 9;}
if (choose1 == 1)
{
player1_array[0] = choose2;
player1_array[1] = choose3;
player1_array[2] = choose4;
}
else if (choose1 == 2)
{
player2_array[0] = choose2;
player2_array[1] = choose3;
player2_array[2] = choose4;
}
else if (choose1 == 3)
{
player3_array[0] = choose2;
player3_array[1] = choose3;
player3_array[2] = choose4;
}
if(order1==0)
{
order1 = choose1;
if(order1 == 1)
{arx = 15; ary = 390;}
else
{arx = 15; ary = 350;}
right = true; left = false;
choose1 = 0;
choose2 = 0;
choose3 = 0;
choose4 = 0;
}
else if(order2==0)
{
order2 = choose1;
if(order1 == 1 && order2 == 2)
{arx = 15; ary = 430;}
else if(order1 == 1 && order2 == 3)
{arx = 15; ary = 390;}
else if(order1 == 2 && order2 == 1)
{arx = 15; ary = 430;}
else if(order1 == 3 && order2 == 1)
{arx = 15; ary = 390;}
else
{arx = 15; ary = 350;}
right = true; left = false;
choose1 = 0;
choose2 = 0;
choose3 = 0;
choose4 = 0;
}
else if(order3==0)
{
order3 = choose1;
// -------------------------------------------------------------------------------XXXXIJDLFIJASODFIJOSIJOJS------------------------------------
// this is where the control switches from the player and then the program takes over and
// then shows animations, then sends control back to player.
//this is if player1 is the first selection
if(order1 == 1)
{
char1x = 65;
//the animations for player1 will go right here
//if the primary choice is attack then find the target and calculate the results
if(player1_array[0] == 1)
{
if(player1_array[2] == 1)
{
if(player1_attack_power*50 >= player1_health)
{player1_health = 0;}
else
{player1_health = player1_health - (player1_attack_power*50);}
}
else if(player1_array[2] == 2)
{
if(player1_attack_power*50 >= player2_health)
{player2_health = 0;}
else
{player2_health = player2_health - (player1_attack_power*50);}
}
else if(player1_array[2] == 3)
{
if(player1_attack_power*50 >= player3_health)
{player3_health = 0;}
else
{player3_health = player3_health - (player1_attack_power*50);}
}
else if(player1_array[2] == 4)
{
if(player1_attack_power*50 >= enemy1_health)
{enemy1_health = 0; bad1 = false;}
else
{enemy1_health = enemy1_health - (player1_attack_power*50);}
}
else if(player1_array[2] == 5)
{
if(player1_attack_power*50 >= enemy2_health)
{enemy2_health = 0; bad2 = false;}
else
{enemy2_health = enemy2_health - (player1_attack_power*50);}
}
else if(player1_array[2] == 6)
{
if(player1_attack_power*50 >= enemy3_health)
{enemy3_health = 0; bad3 = false;}
else
{enemy3_health = enemy3_health - (player1_attack_power*50);}
}
else if(player1_array[2] == 7)
{
if(player1_attack_power*50 >= enemy4_health)
{enemy4_health = 0; bad4 = false;}
else
{enemy4_health = enemy4_health - (player1_attack_power*50);}
}
else if(player1_array[2] == 8)
{
if(player1_attack_power*50 >= enemy5_health)
{enemy5_health = 0; bad5 = false;}
else
enemy5_health = enemy5_health - (player1_attack_power*50);}
else if(player1_array[2] == 9)
{
if(player1_attack_power*50 >= enemy6_health)
{enemy6_health = 0; bad6 = false;}
else
{enemy6_health = enemy6_health - (player1_attack_power*50);}
}
}
//if the primary choice is magic, then find which magic, and then which target then calculate the results
else if(player1_array[0] == 2)
{
//if the magic sub selection is Rage
if(player1_array[1] == 1)
{
player1_magic = player1_magic - rage_magic;
if(player1_array[2] == 1)
{
if(player1_attack_power*50*rage >= player1_health)
{player1_health = 0;}
else
{player1_health = player1_health -(player1_attack_power*50*rage);}
}
else if(player1_array[2] == 2)
{
if(player1_attack_power*50*rage >= player2_health)
{player2_health = 0;}
else
{player2_health = player2_health -(player1_attack_power*50*rage);}
}
else if(player1_array[2] == 3)
{
if(player1_attack_power*50*rage >= player3_health)
{player3_health = 0;}
else
{player3_health = player3_health -(player1_attack_power*50*rage);}
}
else if(player1_array[2] == 4)
{
if(player1_attack_power*50*rage >= enemy1_health)
{enemy1_health = 0; bad1 = false;}
else
{enemy1_health = enemy1_health -(player1_attack_power*50*rage);}
}
else if(player1_array[2] == 5)
{
if(player1_attack_power*50*rage >= enemy2_health)
{enemy2_health = 0; bad2 = false;}
else
{enemy2_health = enemy2_health -(player1_attack_power*50*rage);}
}
else if(player1_array[2] == 6)
{
if(player1_attack_power*50*rage >= enemy3_health)
{enemy3_health = 0; bad3 = false;}
else
{enemy3_health = enemy3_health -(player1_attack_power*50*rage);}
}
else if(player1_array[2] == 7)
{
if(player1_attack_power*50*rage >= enemy4_health)
{enemy4_health = 0; bad4 = false;}
else
{enemy4_health = enemy4_health -(player1_attack_power*50*rage);}
}
else if(player1_array[2] == 8)
{
if(player1_attack_power*50*rage >= enemy1_health)
{enemy5_health = 0; bad5 = false;}
else
{enemy5_health = enemy5_health -(player1_attack_power*50*rage);}
}
else if(player1_array[2] == 9)
{
if(player1_attack_power*50*rage >= enemy1_health)
{enemy6_health = 0; bad6 = false;}
else
{enemy6_health = enemy6_health -(player1_attack_power*50*rage);}
}
}
//if the magic sub selection is Power X2
else if(player1_array[1] == 2)
{
player1_magic = player1_magic - power_magic;
if(player1_array[2] == 1)
{
if(player1_attack_power > 10)
{}
else
{player1_attack_power = player1_attack_power*2;}
}
else if(player1_array[2] == 2)
{
if(player2_attack_power > 10)
{}
else
{player2_attack_power = player2_attack_power*2;}
}
else if(player1_array[2] == 3)
{
if(player3_attack_power > 10)
{}
else
{player3_attack_power = player3_attack_power*2;}
}
else if(player1_array[2] == 4)
{}
else if(player1_array[2] == 5)
{}
else if(player1_array[2] == 6)
{}
else if(player1_array[2] == 7)
{}
else if(player1_array[2] == 8)
{}
else if(player1_array[2] == 9)
{}
}
//if the magic sub selection is LIMIT
else if(player1_array[1] == 3)
{
limit1_power = player1_magic;
player1_magic = 0;
if(player1_array[2] == 1)
{
if(player1_health <= limit1_power*player1_attack_power*player1_magic_power)
{player1_health = 0;}
else
{player1_health = player1_health - (limit1_power*player1_attack_power*player1_magic_power);}
}
else if(player1_array[2] == 2)
{
if(player2_health <= limit1_power*player1_attack_power*player1_magic_power)
{player2_health = 0;}
else
{player2_health = player2_health - (limit1_power*player1_attack_power*player1_magic_power);}
}
else if(player1_array[2] == 3)
{
if(player3_health <= limit1_power*player1_attack_power*player1_magic_power)
{player3_health = 0;}
else
{player3_health = player3_health - (limit1_power*player1_attack_power*player1_magic_power);}
}
else if(player1_array[2] == 4)
{
if(enemy1_health <= limit1_power*player1_attack_power*player1_magic_power)
{enemy1_health = 0; bad1 = false;}
else
{enemy1_health = enemy1_health - (limit1_power*player1_attack_power*player1_magic_power);}
}
else if(player1_array[2] == 5)
{
if(enemy2_health <= limit1_power*player1_attack_power*player1_magic_power)
{enemy2_health = 0; bad2 = false;}
else
{enemy2_health = enemy2_health - (limit1_power*player1_attack_power*player1_magic_power);}
}
else if(player1_array[2] == 6)
{
if(enemy3_health <= limit1_power*player1_attack_power*player1_magic_power)
{enemy3_health = 0; bad3 = false;}
else
{enemy3_health = enemy3_health - (limit1_power*player1_attack_power*player1_magic_power);}
}
else if(player1_array[2] == 7)
{
if(enemy4_health <= limit1_power*player1_attack_power*player1_magic_power)
{enemy4_health = 0; bad4 = false;}
else
{enemy4_health = enemy4_health - (limit1_power*player1_attack_power*player1_magic_power);}
}
else if(player1_array[2] == 8)
{
if(enemy5_health <= limit1_power*player1_attack_power*player1_magic_power)
{enemy5_health = 0; bad5 = false;}
else
{enemy5_health = enemy5_health - (limit1_power*player1_attack_power*player1_magic_power);}
}
else if(player1_array[2] == 9)
{
if(enemy6_health <= limit1_power*player1_attack_power*player1_magic_power)
{enemy6_health = 0; bad6 = false;}
else
{enemy6_health = enemy6_health - (limit1_power*player1_attack_power*player1_magic_power);}
}
}
}
//if the primary selection is items, then find which item, and then which target then calculate the results
else if(player1_array[0] == 3)
{
//if the item sub selection is spirit
if(player1_array[1] == 1)
{
player1_item1_count = player1_item1_count - 1;
if(player1_array[2] == 1)
{
if(player1_health+spirit > player1_total_health)
{player1_health = player1_total_health;}
else
{player1_health = player1_health + spirit;}
}
else if(player1_array[2] == 2)
{
if(player2_health+spirit > player2_total_health)
{player2_health = player2_total_health;}
else
{player2_health = player2_health + spirit;}
}
else if(player1_array[2] == 3)
{
if(player3_health+spirit > player3_total_health)
{player3_health = player3_total_health;}
else
{player3_health = player3_health + spirit;}
}
else if(player1_array[2] == 4)
{enemy1_health = enemy1_health + spirit;}
else if(player1_array[2] == 5)
{enemy2_health = enemy2_health + spirit;}
else if(player1_array[2] == 6)
{enemy3_health = enemy3_health + spirit;}
else if(player1_array[2] == 7)
{enemy4_health = enemy4_health + spirit;}
else if(player1_array[2] == 8)
{enemy5_health = enemy5_health + spirit;}
else if(player1_array[2] == 9)
{enemy6_health = enemy6_health + spirit;}
}
//if the item sub selection is hi-spirit
if(player1_array[1] == 2)
{
player1_item2_count = player1_item2_count - 1;
if(player1_array[2] == 1)
{
if(player1_health+hi_spirit > player1_total_health)
{player1_health = player1_total_health;}
else
{player1_health = player1_health + hi_spirit;}
}
else if(player1_array[2] == 2)
{
if(player2_health+hi_spirit > player2_total_health)
{player2_health = player2_total_health;}
else
{player2_health = player2_health + hi_spirit;}
}
else if(player1_array[2] == 3)
{
if(player3_health+hi_spirit > player3_total_health)
{player3_health = player3_total_health;}
else
{player3_health = player3_health + hi_spirit;}
}
else if(player1_array[2] == 4)
{enemy1_health = enemy1_health + hi_spirit;}
else if(player1_array[2] == 5)
{enemy2_health = enemy2_health + hi_spirit;}
else if(player1_array[2] == 6)
{enemy3_health = enemy3_health + hi_spirit;}
else if(player1_array[2] == 7)
{enemy4_health = enemy4_health + hi_spirit;}
else if(player1_array[2] == 8)
{enemy5_health = enemy5_health + hi_spirit;}
else if(player1_array[2] == 9)
{enemy6_health = enemy6_health + hi_spirit;}
}
//if the item sub selection is lazarus
if(player1_array[1] ==3)
{
player1_item3_count = player1_item3_count - 1;
if(player1_array[2] == 1)
{
if(player1_health == 0)
{player1_health = player1_total_health;}
else
{}
}
else if(player1_array[2] == 2)
{
if(player2_health = 0)
{player2_health = player2_total_health;}
else
{}
}
else if(player1_array[2] == 3)
{
if(player3_health = 0)
{player3_health = player3_total_health;}
else
{}
}
else if(player1_array[2] == 4)
{}
else if(player1_array[2] == 5)
{}
else if(player1_array[2] == 6)
{}
else if(player1_array[2] == 7)
{}
else if(player1_array[2] == 8)
{}
else if(player1_array[2] == 9)
{}
}
}
//now the first two enemies do their thing and this is where enemy animations 1 & 2 go
//insert enemy1 animation
if(bad1 == true)
{
enemy_random = 1 + rand() % 3;
if(enemy_random == 1)
{
if(enemy1_attack*30 > player1_health)
{player1_health = 0;}
else
{player1_health = player1_health - enemy1_attack*30;}
}
else if(enemy_random == 2)
{
if(enemy1_attack*30 > player2_health)
{player2_health = 0;}
else
{player2_health = player2_health - enemy1_attack*30;}
}
else if(enemy_random == 3)
{
if(enemy1_attack*30 > player3_health)
{player3_health = 0;}
else
{player3_health = player3_health - enemy1_attack*30;}
}
}
if(bad2 == true)
{
enemy_random = 1 + rand() % 3;
if(enemy_random == 1)
{
if(enemy1_attack*30 > player1_health)
{player1_health = 0;}
else
{player1_health = player1_health - enemy1_attack*30;}
}
else if(enemy_random == 2)
{
if(enemy1_attack*30 > player2_health)
{player2_health = 0;}
else
{player2_health = player2_health - enemy1_attack*30;}
}
else if(enemy_random == 3)
{
if(enemy1_attack*30 > player3_health)
{player3_health = 0;}
else
{player3_health = player3_health - enemy1_attack*30;}
}
//insert enemy2 animation
}
if( order2 == 2)
{
char2x = 65;
//the animations will go right here
//if the primary choice is attack then find the target and calculate the results
if(player2_array[0] == 1)
{
if(player2_array[2] == 1)
{
if(player2_attack_power*30 >= player1_health)
{player1_health = 0;}
else
{player1_health = player1_health - (player2_attack_power*30);}
}
else if(player2_array[2] == 2)
{
if(player2_attack_power*30 >= player2_health)
{player2_health = 0;}
else
{player2_health = player2_health - (player2_attack_power*30);}
}
else if(player2_array[2] == 3)
{
if(player2_attack_power*30 >= player3_health)
{player3_health = 0;}
else
{player3_health = player3_health - (player2_attack_power*30);}
}
else if(player2_array[2] == 4)
{
if(player2_attack_power*30 >= enemy1_health)
{enemy1_health = 0; bad1 = false;}
else
{enemy1_health = enemy1_health - (player2_attack_power*30);}
}
else if(player2_array[2] == 5)
{
if(player2_attack_power*30 >= enemy2_health)
{enemy2_health = 0; bad2 = false;}
else
{enemy2_health = enemy2_health - (player2_attack_power*30);}
}
else if(player2_array[2] == 6)
{
if(player2_attack_power*30 >= enemy3_health)
{enemy3_health = 0; bad3 = false;}
else
{enemy3_health = enemy3_health - (player2_attack_power*30);}
}
else if(player2_array[2] == 7)
{
if(player2_attack_power*30 >= enemy4_health)
{enemy4_health = 0; bad4 = false;}
else
{enemy4_health = enemy4_health - (player2_attack_power*30);}
}
else if(player2_array[2] == 8)
{
if(player2_attack_power*30 >= enemy5_health)
{enemy5_health = 0; bad5 = false;}
else
enemy5_health = enemy5_health - (player2_attack_power*30);}
else if(player2_array[2] == 9)
{
if(player2_attack_power*30 >= enemy6_health)
{enemy6_health = 0; bad6 = false;}
else
{enemy6_health = enemy6_health - (player2_attack_power*30);}
}
}
//if the primary choice is magic, then find which magic, and then which target then calculate the results
else if(player2_array[0] == 2)
{
//if the magic sub selection is Burn
if(player2_array[1] == 1)
{
player2_magic = player2_magic - burn_magic;
if(player2_array[2] == 1)
{
if(player2_magic_power*50 >= player1_health)
{player1_health = 0;}
else
{player1_health = player1_health - (player2_magic_power*50);}
}
else if(player2_array[2] == 2)
{
if(player2_magic_power*50 >= player2_health)
{player2_health = 0;}
else
{player2_health = player2_health - (player2_magic_power*50);}
}
else if(player2_array[2] == 3)
{
if(player2_magic_power*50 >= player3_health)
{player3_health = 0;}
else
{player3_health = player3_health - (player2_magic_power*50);}
}
else if(player2_array[2] == 4)
{
if(player2_magic_power*50*burn >= enemy1_health)
{enemy1_health = 0; bad1 = false;}
else
{enemy1_health = enemy1_health - (player2_magic_power*50*burn);}
}
else if(player2_array[2] == 5)
{
if(player2_magic_power*50 >= enemy2_health)
{enemy2_health = 0; bad2 = false;}
else
{enemy2_health = enemy2_health - (player2_magic_power*50);}
}
else if(player2_array[2] == 6)
{
if(player2_magic_power*50 >= enemy3_health)
{enemy3_health = 0; bad3 = false;}
else
{enemy3_health = enemy3_health - (player2_magic_power*50);}
}
else if(player2_array[2] == 7)
{
if(player2_magic_power*50*burn >= enemy4_health)
{enemy4_health = 0; bad4 = false;}
else
{enemy4_health = enemy4_health - (player2_magic_power*50*burn);}
}
else if(player2_array[2] == 8)
{
if(player2_magic_power*50 >= enemy5_health)
{enemy5_health = 0; bad5 = false;}
else
enemy5_health = enemy5_health - (player2_magic_power*50);}
else if(player2_array[2] == 9)
{
if(player2_magic_power*50 >= enemy6_health)
{enemy6_health = 0; bad6 = false;}
else
{enemy6_health = enemy6_health - (player2_magic_power*50);}
}
}
//if the magic sub selection is Freeze
else if(player2_array[1] == 2)
{
player2_magic = player2_magic - 10;
if(player2_array[2] == 1)
{
if(player2_magic_power*50 >= player1_health)
{player1_health = 0;}
else
{player1_health = player1_health - (player2_magic_power*50);}
}
else if(player2_array[2] == 2)
{
if(player2_magic_power*50 >= player2_health)
{player2_health = 0;}
else
{player2_health = player2_health - (player2_magic_power*50);}
}
else if(player2_array[2] == 3)
{
if(player2_magic_power*50 >= player3_health)
{player3_health = 0;}
else
{player3_health = player3_health - (player2_magic_power*50);}
}
else if(player2_array[2] == 4)
{
if(player2_magic_power*50 >= enemy1_health)
{enemy1_health = 0; bad1 = false;}
else
{enemy1_health = enemy1_health - (player2_magic_power*50);}
}
else if(player2_array[2] == 5)
{
if(player2_magic_power*50*freeze >= enemy2_health)
{enemy2_health = 0; bad2 = false;}
else
{enemy2_health = enemy2_health - (player2_magic_power*50*freeze);}
}
else if(player2_array[2] == 6)
{
if(player2_magic_power*50 >= enemy3_health)
{enemy3_health = 0; bad3 = false;}
else
{enemy3_health = enemy3_health - (player2_magic_power*50);}
}
else if(player2_array[2] == 7)
{
if(player2_magic_power*50 >= enemy4_health)
{enemy4_health = 0; bad4 = false;}
else
{enemy4_health = enemy4_health - (player2_magic_power*50);}
}
else if(player2_array[2] == 8)
{
if(player2_magic_power*50*freeze >= enemy5_health)
{enemy5_health = 0; bad5 = false;}
else
enemy5_health = enemy5_health - (player2_magic_power*50*freeze);}
else if(player2_array[2] == 9)
{
if(player2_magic_power*50 >= enemy6_health)
{enemy6_health = 0; bad6 = false;}
else
{enemy6_health = enemy6_health - (player2_magic_power*50);}
}
}
//if the magic sub selection is LIMIT
else if(player2_array[1] == 3)
{
limit2_power = player2_magic;
player2_magic = 0;
if(player2_array[2] == 1)
{
if(player1_health <= limit2_power*player2_attack_power*player2_magic_power)
{player1_health = 0;}
else
{player1_health = player1_health - (limit2_power*player2_attack_power*player2_magic_power);}
}
else if(player2_array[2] == 2)
{
if(player2_health <= limit2_power*player2_attack_power*player2_magic_power)
{player2_health = 0;}
else
{player2_health = player2_health - (limit2_power*player2_attack_power*player2_magic_power);}
}
else if(player2_array[2] == 3)
{
if(player3_health <= limit2_power*player2_attack_power*player2_magic_power)
{player3_health = 0;}
else
{player3_health = player3_health - (limit2_power*player2_attack_power*player2_magic_power);}
}
else if(player2_array[2] == 4)
{
if(enemy1_health <= limit2_power*player2_attack_power*player2_magic_power)
{enemy1_health = 0; bad1 = false;}
else
{enemy1_health = enemy1_health - (limit2_power*player2_attack_power*player2_magic_power);}
}
else if(player2_array[2] == 5)
{
if(enemy2_health <= limit2_power*player2_attack_power*player2_magic_power)
{enemy2_health = 0; bad2 = false;}
else
{enemy2_health = enemy2_health - (limit2_power*player2_attack_power*player2_magic_power);}
}
else if(player2_array[2] == 6)
{
if(enemy3_health <= limit2_power*player2_attack_power*player2_magic_power)
{enemy3_health = 0; bad3 = false;}
else
{enemy3_health = enemy3_health - (limit2_power*player2_attack_power*player2_magic_power);}
}
else if(player2_array[2] == 7)
{
if(enemy4_health <= limit2_power*player2_attack_power*player2_magic_power)
{enemy4_health = 0; bad4 = false;}
else
{enemy4_health = enemy4_health - (limit2_power*player2_attack_power*player2_magic_power);}
}
else if(player2_array[2] == 8)
{
if(enemy5_health <= limit2_power*player2_attack_power*player2_magic_power)
{enemy5_health = 0; bad5 = false;}
else
{enemy5_health = enemy5_health - (limit2_power*player2_attack_power*player2_magic_power);}
}
else if(player2_array[2] == 9)
{
if(enemy6_health <= limit2_power*player2_attack_power*player2_magic_power)
{enemy6_health = 0; bad6 = false;}
else
{enemy6_health = enemy6_health - (limit2_power*player2_attack_power*player2_magic_power);}
}
}
}
//if the primary selection is items, then find which item, and then which target then calculate the results
else if(player2_array[0] == 3)
{
//if the item sub selection is ether
if(player2_array[1] == 1)
{
player2_item1_count = player2_item1_count - 1;
if(player2_array[2] == 1)
{
if(player1_magic+ether > player1_total_magic)
{player1_magic = player1_total_magic;}
else
{player1_magic = player1_magic + ether;}
}
else if(player2_array[2] == 2)
{
if(player2_magic+ether > player2_total_magic)
{player2_magic = player2_total_magic;}
else
{player2_magic = player2_magic + ether;}
}
else if(player2_array[2] == 3)
{
if(player3_magic+ether > player3_total_magic)
{player3_magic = player3_total_magic;}
else
{player3_magic = player3_magic + ether;}
}
else if(player2_array[2] == 4)
{}
else if(player2_array[2] == 5)
{}
else if(player2_array[2] == 6)
{}
else if(player2_array[2] == 7)
{}
else if(player2_array[2] == 8)
{}
else if(player2_array[2] == 9)
{}
}
//if the item sub selection is hi-ether
if(player2_array[1] == 2)
{
player2_item2_count = player1_item2_count - 1;
if(player2_array[2] == 1)
{
if(player1_health+hi_ether > player1_total_health)
{player1_health = player1_total_health;}
else
{player1_health = player1_health + hi_ether;}
}
else if(player2_array[2] == 2)
{
if(player2_health+hi_ether > player2_total_health)
{player2_health = player2_total_health;}
else
{player2_health = player2_health + hi_ether;}
}
else if(player2_array[2] == 3)
{
if(player3_health+hi_ether > player3_total_health)
{player3_health = player3_total_health;}
else
{player3_health = player3_health + hi_ether;}
}
else if(player2_array[2] == 4)
{enemy1_health = enemy1_health + hi_spirit;}
else if(player2_array[2] == 5)
{enemy2_health = enemy2_health + hi_spirit;}
else if(player2_array[2] == 6)
{enemy3_health = enemy3_health + hi_spirit;}
else if(player2_array[2] == 7)
{enemy4_health = enemy4_health + hi_spirit;}
else if(player2_array[2] == 8)
{enemy5_health = enemy5_health + hi_spirit;}
else if(player2_array[2] == 9)
{enemy6_health = enemy6_health + hi_spirit;}
}
//if the item sub selection is lazarus
if(player2_array[1] ==3)
{
player2_item3_count = player2_item3_count - 1;
if(player2_array[2] == 1)
{
if(player1_health == 0)
{player1_health = player1_total_health;}
else
{}
}
else if(player2_array[2] == 2)
{
if(player2_health == 0)
{player2_health = player2_total_health;}
else
{}
}
else if(player2_array[2] == 3)
{
if(player3_health == 0)
{player3_health = player3_total_health;}
else
{}
}
else if(player2_array[2] == 4)
{}
else if(player2_array[2] == 5)
{}
else if(player2_array[2] == 6)
{}
else if(player2_array[2] == 7)
{}
else if(player2_array[2] == 8)
{}
else if(player2_array[2] == 9)
{}
}
}
//now the now enemies 3 and 4 attack
//insert enemy1 animation
if(bad3 == true)
{
enemy_random = 1 + rand() % 3;
if(enemy_random == 1)
{
if(enemy1_attack*30 > player1_health)
{player1_health = 0;}
else
{player1_health = player1_health - enemy1_attack*30;}
}
else if(enemy_random == 2)
{
if(enemy1_attack*30 > player2_health)
{player2_health = 0;}
else
{player2_health = player2_health - enemy1_attack*30;}
}
else if(enemy_random == 3)
{
if(enemy1_attack*30 > player3_health)
{player3_health = 0;}
else
{player3_health = player3_health - enemy1_attack*30;}
}
//insert enemy3 animations
}
if(bad4 == true)
{
enemy_random = 1 + rand() % 3;
if(enemy_random == 1)
{
if(enemy1_attack*30 > player1_health)
{player1_health = 0;}
else
{player1_health = player1_health - enemy1_attack*30;}
}
else if(enemy_random == 2)
{
if(enemy1_attack*30 > player2_health)
{player2_health = 0;}
else
{player2_health = player2_health - enemy1_attack*30;}
}
else if(enemy_random == 3)
{
if(enemy1_attack*30 > player3_health)
{player3_health = 0;}
else
{player3_health = player3_health - enemy1_attack*30;}
}
//insert enemy4 animation
}
//now do the third persons actions
if(order3 == 3)
{
char3x = 65;
//the animations will go right here
//if the primary choice is attack then find the target and calculate the results
if(player3_array[0] == 1)
{
if(player3_array[2] == 1)
{
if(player3_attack_power*40 >= player1_health)
{player1_health = 0;}
else
{player1_health = player1_health - (player3_attack_power*40);}
}
else if(player3_array[2] == 2)
{
if(player3_attack_power*40 >= player2_health)
{player2_health = 0;}
else
{player2_health = player2_health - (player3_attack_power*40);}
}
else if(player3_array[2] == 3)
{
if(player3_attack_power*40 >= player3_health)
{player3_health = 0;}
else
{player3_health = player3_health - (player3_attack_power*40);}
}
else if(player3_array[2] == 4)
{
if(player3_attack_power*40 >= enemy1_health)
{enemy1_health = 0; bad1 = false;}
else
{enemy1_health = enemy1_health - (player3_attack_power*40);}
}
else if(player3_array[2] == 5)
{
if(player3_attack_power*40 >= enemy2_health)
{enemy2_health = 0; bad2 = false;}
else
{enemy2_health = enemy2_health - (player3_attack_power*40);}
}
else if(player3_array[2] == 6)
{
if(player3_attack_power*40 >= enemy3_health)
{enemy3_health = 0; bad3 = false;}
else
{enemy3_health = enemy3_health - (player3_attack_power*40);}
}
else if(player3_array[2] == 7)
{
if(player3_attack_power*40 >= enemy4_health)
{enemy4_health = 0; bad4 = false;}
else
{enemy4_health = enemy4_health - (player3_attack_power*40);}
}
else if(player3_array[2] == 8)
{
if(player3_attack_power*40 >= enemy5_health)
{enemy5_health = 0; bad5 = false;}
else
enemy5_health = enemy5_health - (player3_attack_power*40);}
else if(player3_array[2] == 9)
{
if(player3_attack_power*40 >= enemy6_health)
{enemy6_health = 0; bad6 = false;}
else
{enemy6_health = enemy6_health - (player3_attack_power*40);}
}
}
//if the primary choice is magic, then find which magic, and then which target then calculate the results
else if(player3_array[0] == 2)
{
//if the magic sub selection is Protect
if(player3_array[1] == 1)
{
player3_magic = player3_magic - protect_magic;
}
//if the magic sub selection is Taunt
else if(player3_array[1] == 2)
{
player3_magic = player3_magic - taunt_magic;
}
//if the magic sub selection is LIMIT
else if(player3_array[1] == 3)
{
limit3_power = player3_magic;
player3_magic = 0;
if(player3_array[2] == 1)
{
if(player1_health <= limit3_power*player3_attack_power*player3_magic_power)
{player1_health = 0;}
else
{player1_health = player1_health - (limit3_power*player3_attack_power*player3_magic_power);}
}
else if(player3_array[2] == 2)
{
if(player2_health <= limit3_power*player3_attack_power*player3_magic_power)
{player2_health = 0;}
else
{player2_health = player2_health - (limit3_power*player3_attack_power*player3_magic_power);}
}
else if(player3_array[2] == 3)
{
if(player3_health <= limit3_power*player3_attack_power*player3_magic_power)
{player3_health = 0;}
else
{player3_health = player3_health - (limit3_power*player3_attack_power*player3_magic_power);}
}
else if(player3_array[2] == 4)
{
if(enemy1_health <= limit3_power*player3_attack_power*player3_magic_power)
{enemy1_health = 0; bad1 = false;}
else
{enemy1_health = enemy1_health - (limit3_power*player3_attack_power*player3_magic_power);}
}
else if(player3_array[2] == 5)
{
if(enemy2_health <= limit3_power*player3_attack_power*player3_magic_power)
{enemy2_health = 0; bad2 = false;}
else
{enemy2_health = enemy2_health - (limit3_power*player3_attack_power*player3_magic_power);}
}
else if(player3_array[2] == 6)
{
if(enemy3_health <= limit3_power*player3_attack_power*player3_magic_power)
{enemy3_health = 0; bad3 = false;}
else
{enemy3_health = enemy3_health - (limit3_power*player3_attack_power*player3_magic_power);}
}
else if(player3_array[2] == 7)
{
if(enemy4_health <= limit3_power*player3_attack_power*player3_magic_power)
{enemy4_health = 0; bad4 = false;}
else
{enemy4_health = enemy4_health - (limit3_power*player3_attack_power*player3_magic_power);}
}
else if(player3_array[2] == 8)
{
if(enemy5_health <= limit3_power*player3_attack_power*player3_magic_power)
{enemy5_health = 0; bad5 = false;}
else
{enemy5_health = enemy5_health - (limit3_power*player3_attack_power*player3_magic_power);}
}
else if(player3_array[2] == 9)
{
if(enemy6_health <= limit3_power*player3_attack_power*player3_magic_power)
{enemy6_health = 0; bad6 = false;}
else
{enemy6_health = enemy6_health - (limit3_power*player3_attack_power*player3_magic_power);}
}
}
}
//if the primary selection is items, then find which item, and then which target then calculate the results
else if(player3_array[0] == 3)
{
//if the item sub selection is hi-spirit
if(player3_array[1] == 1)
{
player3_item1_count = player3_item1_count - 1;
if(player3_array[2] == 1)
{
if(player1_health+hi_spirit > player1_total_health)
{player1_health = player1_total_health;}
else
{player1_health = player1_health + hi_spirit;}
}
else if(player3_array[2] == 2)
{
if(player2_health+hi_spirit > player2_total_health)
{player2_health = player2_total_health;}
else
{player2_health = player2_health + hi_spirit;}
}
else if(player3_array[2] == 3)
{
if(player3_health+hi_spirit > player3_total_health)
{player3_health = player3_total_health;}
else
{player3_health = player3_health + hi_spirit;}
}
else if(player3_array[2] == 4)
{enemy1_health = enemy1_health + hi_spirit;}
else if(player3_array[2] == 5)
{enemy2_health = enemy2_health + hi_spirit;}
else if(player3_array[2] == 6)
{enemy3_health = enemy3_health + hi_spirit;}
else if(player3_array[2] == 7)
{enemy4_health = enemy4_health + hi_spirit;}
else if(player3_array[2] == 8)
{enemy5_health = enemy5_health + hi_spirit;}
else if(player3_array[2] == 9)
{enemy6_health = enemy6_health + hi_spirit;}
}
//use this for the hi-ether
if(player3_array[1] == 2)
{
player3_item2_count = player3_item2_count - 1;
if(player3_array[2] == 1)
{
if(player1_magic+hi_ether > player1_total_magic)
{player1_magic = player1_total_magic;}
else
{player1_magic = player1_magic + hi_ether;}
}
else if(player3_array[2] == 2)
{
if(player2_magic+hi_ether > player2_total_magic)
{player2_magic = player2_total_magic;}
else
{player2_magic = player2_magic + hi_ether;}
}
else if(player3_array[2] == 3)
{
if(player3_magic+hi_ether > player3_total_magic)
{player3_magic = player3_total_magic;}
else
{player3_magic = player3_magic + hi_ether;}
}
else if(player3_array[2] == 4)
{}
else if(player3_array[2] == 5)
{}
else if(player3_array[2] == 6)
{}
else if(player3_array[2] == 7)
{}
else if(player3_array[2] == 8)
{}
else if(player3_array[2] == 9)
{}
}
//if the item sub selection is lazarus
if(player3_array[1] ==3)
{
player3_item3_count = player3_item3_count - 1;
if(player3_array[2] == 1)
{
if(player1_health == 0)
{player1_health = player1_total_health;}
else
{}
}
else if(player3_array[2] == 2)
{
if(player2_health = 0)
{player2_health = player2_total_health;}
else
{}
}
else if(player3_array[2] == 3)
{
if(player3_health = 0)
{player3_health = player3_total_health;}
else
{}
}
else if(player3_array[2] == 4)
{}
else if(player3_array[2] == 5)
{}
else if(player3_array[2] == 6)
{}
else if(player3_array[2] == 7)
{}
else if(player3_array[2] == 8)
{}
else if(player3_array[2] == 9)
{}
}
}
//now have the last group of enemies attack
if(bad5 == true)
{
enemy_random = 1 + rand() % 3;
if(enemy_random == 1)
{
if(enemy1_attack*30 > player1_health)
{player1_health = 0;}
else
{player1_health = player1_health - enemy1_attack*30;}
}
else if(enemy_random == 2)
{
if(enemy1_attack*30 > player2_health)
{player2_health = 0;}
else
{player2_health = player2_health - enemy1_attack*30;}
}
else if(enemy_random == 3)
{
if(enemy1_attack*30 > player3_health)
{player3_health = 0;}
else
{player3_health = player3_health - enemy1_attack*30;}
}
}
if(bad6 == true)
{
enemy_random = 1 + rand() % 3;
if(enemy_random == 1)
{
if(enemy1_attack*30 > player1_health)
{player1_health = 0;}
else
{player1_health = player1_health - enemy1_attack*30;}
}
else if(enemy_random == 2)
{
if(enemy1_attack*30 > player2_health)
{player2_health = 0;}
else
{player2_health = player2_health - enemy1_attack*30;}
}
else if(enemy_random == 3)
{
if(enemy1_attack*30 > player3_health)
{player3_health = 0;}
else
{player3_health = player3_health - enemy1_attack*30;}
}
}
else if(order2 == 3)
{
char3x = 65;
//the animations will go right here
//if the primary choice is attack then find the target and calculate the results
if(player3_array[0] == 1)
{
if(player3_array[2] == 1)
{
if(player3_attack_power*40 > player1_health)
{player1_health = 0;}
else
{player1_health = player1_health - (player3_attack_power*40);}
}
else if(player3_array[2] == 2)
{
if(player3_attack_power*40 > player2_health)
{player2_health = 0;}
else
{player2_health = player2_health - (player3_attack_power*40);}
}
else if(player3_array[2] == 3)
{
if(player3_attack_power*40 > player3_health)
{player3_health = 0;}
else
{player3_health = player3_health - (player3_attack_power*40);}
}
else if(player3_array[2] == 4)
{
if(player3_attack_power*40 > enemy1_health)
{enemy1_health = 0;}
else
{enemy1_health = enemy1_health - (player3_attack_power*40);}
}
else if(player3_array[2] == 5)
{
if(player3_attack_power*40 > enemy2_health)
{enemy2_health = 0;}
else
{enemy2_health = enemy2_health - (player3_attack_power*40);}
}
else if(player3_array[2] == 6)
{
if(player3_attack_power*40 > enemy3_health)
{enemy3_health = 0;}
else
{enemy3_health = enemy3_health - (player3_attack_power*40);}
}
else if(player3_array[2] == 7)
{
if(player3_attack_power*40 > enemy4_health)
{enemy4_health = 0;}
else
{enemy4_health = enemy4_health - (player3_attack_power*40);}
}
else if(player3_array[2] == 8)
{
if(player3_attack_power*40 > enemy5_health)
{enemy5_health = 0;}
else
enemy5_health = enemy5_health - (player3_attack_power*40);}
else if(player3_array[2] == 9)
{
if(player3_attack_power*40 > enemy6_health)
{enemy6_health = 0;}
else
{enemy6_health = enemy6_health - (player3_attack_power*40);}
}
}
//if the primary choice is magic, then find which magic, and then which target then calculate the results
else if(player3_array[0] == 2)
{
//if the magic sub selection is Protect
if(player3_array[1] == 1)
{
player3_magic = player3_magic - protect_magic;
}
//if the magic sub selection is Taunt
else if(player2_array[1] == 2)
{
player2_magic = player2_magic - taunt_magic;
}
//if the magic sub selection is LIMIT
else if(player2_array[1] == 3)
{
limit3_power = player3_magic;
player3_magic = 0;
if(player3_array[2] == 1)
{
if(player1_health < limit3_power*player3_attack_power*player3_magic_power)
{player1_health = 0;}
else
{player1_health = player1_health - (limit3_power*player3_attack_power*player3_magic_power);}
}
else if(player2_array[2] == 2)
{
if(player2_health < limit3_power*player3_attack_power*player3_magic_power)
{player2_health = 0;}
else
{player2_health = player2_health - (limit3_power*player3_attack_power*player3_magic_power);}
}
else if(player2_array[2] == 3)
{
if(player3_health < limit3_power*player3_attack_power*player3_magic_power)
{player3_health = 0;}
else
{player3_health = player3_health - (limit3_power*player3_attack_power*player3_magic_power);}
}
else if(player2_array[2] == 4)
{
if(enemy1_health < limit3_power*player3_attack_power*player3_magic_power)
{enemy1_health = 0;}
else
{enemy1_health = enemy1_health - (limit3_power*player3_attack_power*player3_magic_power);}
}
else if(player2_array[2] == 5)
{
if(enemy2_health < limit3_power*player3_attack_power*player3_magic_power)
{enemy2_health = 0;}
else
{enemy2_health = enemy2_health - (limit3_power*player3_attack_power*player3_magic_power);}
}
else if(player2_array[2] == 6)
{
if(enemy3_health < limit3_power*player3_attack_power*player3_magic_power)
{enemy3_health = 0;}
else
{enemy3_health = enemy3_health - (limit3_power*player3_attack_power*player3_magic_power);}
}
else if(player2_array[2] == 7)
{
if(enemy4_health < limit3_power*player3_attack_power*player3_magic_power)
{enemy4_health = 0;}
else
{enemy4_health = enemy4_health - (limit3_power*player3_attack_power*player3_magic_power);}
}
else if(player2_array[2] == 8)
{
if(enemy5_health < limit3_power*player3_attack_power*player3_magic_power)
{enemy5_health = 0;}
else
{enemy5_health = enemy5_health - (limit3_power*player3_attack_power*player3_magic_power);}
}
else if(player2_array[2] == 9)
{
if(enemy6_health < limit3_power*player3_attack_power*player3_magic_power)
{enemy6_health = 0;}
else
{enemy6_health = enemy6_health - (limit3_power*player3_attack_power*player3_magic_power);}
}
}
}
//if the primary selection is items, then find which item, and then which target then calculate the results
else if(player3_array[0] == 3)
{
//if the item sub selection is hi-spirit
if(player3_array[1] == 1)
{
player3_item1_count = player3_item1_count - 1;
if(player3_array[2] == 1)
{
if(player1_health+hi_spirit > player1_total_health)
{player1_health = player1_total_health;}
else
{player1_health = player1_health + hi_spirit;}
}
else if(player3_array[2] == 2)
{
if(player2_health+hi_spirit > player2_total_health)
{player2_health = player2_total_health;}
else
{player2_health = player2_health + hi_spirit;}
}
else if(player3_array[2] == 3)
{
if(player3_health+hi_spirit > player3_total_health)
{player3_health = player3_total_health;}
else
{player3_health = player3_health + hi_spirit;}
}
else if(player3_array[2] == 4)
{enemy1_health = enemy1_health + hi_spirit;}
else if(player3_array[2] == 5)
{enemy2_health = enemy2_health + hi_spirit;}
else if(player3_array[2] == 6)
{enemy3_health = enemy3_health + hi_spirit;}
else if(player3_array[2] == 7)
{enemy4_health = enemy4_health + hi_spirit;}
else if(player3_array[2] == 8)
{enemy5_health = enemy5_health + hi_spirit;}
else if(player3_array[2] == 9)
{enemy6_health = enemy6_health + hi_spirit;}
}
//use this for the hi-ether
if(player3_array[1] == 2)
{
player3_item2_count = player3_item2_count - 1;
if(player3_array[2] == 1)
{
if(player1_magic+hi_ether > player1_total_magic)
{player1_magic = player1_total_magic;}
else
{player1_magic = player1_magic + hi_ether;}
}
else if(player3_array[2] == 2)
{
if(player2_magic+hi_ether > player2_total_magic)
{player2_magic = player2_total_magic;}
else
{player2_magic = player2_magic + hi_ether;}
}
else if(player3_array[2] == 3)
{
if(player3_magic+hi_ether > player3_total_magic)
{player3_magic = player3_total_magic;}
else
{player3_magic = player3_magic + hi_ether;}
}
else if(player3_array[2] == 4)
{}
else if(player3_array[2] == 5)
{}
else if(player3_array[2] == 6)
{}
else if(player3_array[2] == 7)
{}
else if(player3_array[2] == 8)
{}
else if(player3_array[2] == 9)
{}
}
//if the item sub selection is lazarus
if(player3_array[1] ==3)
{
player3_item3_count = player3_item3_count - 1;
if(player3_array[2] == 1)
{
if(player1_health == 0)
{player1_health = player1_total_health;}
else
{}
}
else if(player3_array[2] == 2)
{
if(player2_health = 0)
{player2_health = player2_total_health;}
else
{}
}
else if(player3_array[2] == 3)
{
}
else if(player2_array[2] == 4)
{}
else if(player2_array[2] == 5)
{}
else if(player2_array[2] == 6)
{}
else if(player2_array[2] == 7)
{}
else if(player2_array[2] == 8)
{}
else if(player2_array[2] == 9)
{}
}
}
}
//now reset all of the original values
arx = 15; ary = 350;
order1 = 0;
order2 = 0;
order3 = 0;
player1_array[0] = 0;
player1_array[1] = 0;
player1_array[2] = 0;
player2_array[0] = 0;
player2_array[1] = 0;
player2_array[2] = 0;
player2_array[0] = 0;
player2_array[1] = 0;
player2_array[2] = 0;
}
}
else if(order2 == 3)
{}
}
if(order1 == 2)
{}
if(order1 == 3)
{}
right = true; left = false;
choose1 = 0;
choose2 = 0;
choose3 = 0;
choose4 = 0;
if(bad1 == false && bad2 == false && bad3 == false && bad4 == false && bad5 == false && bad6 == false)
{win = true;}
if(player1_health == 0 && player2_health == 0 && player3_health == 0)
{lose = true;}
if(win == true)
{
Mix_HaltMusic();
//use the beats per minute for the music here
//this is when the characters run across the screen
battle = battle + 1;
}
if(lose == true)
{
//this is where the screen fades to black and then resets to the same battle
}
}
}
//check second for sub selection
else if(arx == 445)
{
if( ary == 350 )
{
if(choose2 == 2)
{
choose3 = 1;
if(bad1 == false)
{
if(bad2 == false)
{
if(bad3 == false)
{
if(bad4 == false)
{
if(bad5 == false)
{
arx = 540; ary = 270; right = true; left = false; break;
}
else
{
arx = 540; ary = 190; right = true; left = false; break;
}
}
else
{ arx = 540; ary = 110; right = true; left = false; break;}
}
else
{arx = 435; ary = 270; right = true; left = false; break;}
}
else
{arx = 435; ary = 190; right = true; left = false; break;}
}
else
{arx = 435; ary = 110; right = true; left = false; break;}
}
else if(choose2 == 3)
{
choose3 = 1;
arx = 140; ary = 110; right = false; left = true; break;
}
}
else if( ary == 390 )
{
if(choose2 == 2)
{
choose3 = 2;
if(bad1 == false)
{
if(bad2 == false)
{
if(bad3 == false)
{
if(bad4 == false)
{
if(bad5 == false)
{
arx = 540; ary = 270; right = true; left = false; break;
}
else
{
arx = 540; ary = 190; right = true; left = false; break;
}
}
else
{ arx = 540; ary = 110; right = true; left = false; break;}
}
else
{arx = 435; ary = 270; right = true; left = false; break;}
}
else
{arx = 435; ary = 190; right = true; left = false; break;}
}
else
{arx = 435; ary = 110; right = true; left = false; break;}
}
else if(choose2 == 3)
{
choose3 = 2;
arx = 140; ary = 110; right = false; left = true; break;
}
}
else if( ary == 430 )
{
if(choose2 == 2)
{
choose3 = 3;
if(bad1 == false)
{
if(bad2 == false)
{
if(bad3 == false)
{
if(bad4 == false)
{
if(bad5 == false)
{
arx = 540; ary = 270; right = true; left = false; break;
}
else
{
arx = 540; ary = 190; right = true; left = false; break;
}
}
else
{ arx = 540; ary = 110; right = true; left = false; break;}
}
else
{arx = 435; ary = 270; right = true; left = false; break;}
}
else
{arx = 435; ary = 190; right = true; left = false; break;}
}
else
{arx = 435; ary = 110; right = true; left = false; break;}
}
else if(choose2 == 3)
{
choose3 = 3;
arx = 140; ary = 110; right = false; left = true; break;
}
}
else
{break;}
}
// check third for primary selection
else if(arx == 280)
{
//this one is the attack one, it is special because it has no sub selection
if( ary == 350 )
{
choose2 = 1;
if(bad1 == false)
{
if(bad2 == false)
{
if(bad3 == false)
{
if(bad4 == false)
{
if(bad5 == false)
{
arx = 540; ary = 270; right = true; left = false; break;
}
else
{
arx = 540; ary = 190; right = true; left = false; break;
}
}
else
{ arx = 540; ary = 110; right = true; left = false; break;}
}
else
{arx = 435; ary = 270; right = true; left = false; break;}
}
else
{arx = 435; ary = 190; right = true; left = false; break;}
}
else
{arx = 435; ary = 110; right = true; left = false; break;}
}
// now back to the other options
else if( ary == 390 )
{choose2 = 2; arx = 445; ary = 350; break;}
else if( ary == 430 )
{
if(choose1 == 1)
{
if(play1i == false)
{break;}
else
{choose2 = 3; arx = 445; ary = 350; break;}
}
else if(choose1 == 2)
{
if(play2i == false)
{break;}
else
{choose2 = 3; arx = 445; ary = 350; break;}
}
else if(choose1 == 3)
{
if(play3i == false)
{break;}
else
{choose2 = 3; arx = 445; ary = 350; break;}
}
}
else
{break;}
}
// check last for character selection
else if(arx == 15)
{
if( ary == 350 )
{ choose1 = 1; ary = 350; arx = 280; break;}
if( ary == 390 )
{ choose1 = 2; ary = 350; arx = 280; break;}
if( ary == 430 )
{choose1 = 3; ary = 350; arx = 280; break;}
else
{break;}
}
else
{break;}
}
case SDLK_s:
{
//go back and undo sub selection
if(ary < 350 && choose3 == 0)
{arx = 280; ary = 350; choose2 = 0; right = true; left = false; break;}
if(ary < 350 && choose3 == 1)
{arx = 445; ary = 350; choose3 = 0; right = true; left = false; break;}
if(ary < 350 && choose3 == 2)
{arx = 445; ary = 390; choose3 = 0; right = true; left = false; break;}
if(ary < 350 && choose3 == 3)
{arx = 445; ary = 430; choose3 = 0; right = true; left = false; break;}
//go back and undo primary selection
if( arx == 445 && choose2 == 1)
{ arx = 280; ary = 350; choose2 = 0; break;}
if( arx == 445 && choose2 == 2)
{ arx = 280; ary = 390; choose2 = 0; break;}
if( arx == 445 && choose2 == 3)
{ arx = 280; ary = 430; choose2 = 0; break;}
//go back and undo character selection
if( arx == 280 && choose1 == 1)
{ arx = 15; ary = 350; choose1 = 0; break;}
if( arx == 280 && choose1 == 2)
{ arx = 15; ary = 390; choose1 = 0; break;}
if( arx == 280 && choose1 == 3)
{ arx = 15; ary = 430; choose1 = 0; break;}
else{break;}
}
case SDLK_d:
{
break;
}
case SDLK_f:
{
bad1 = false;
bad2 = false;
bad3 = false;
bad4 = false;
bad5 = false;
bad6 = true;
}
default:
{break;}
}
}
//If the user has Xed out the window
if( event.type == SDL_QUIT )
{
//Quit the program
gameplay = false;
}
}
//Scroll background
bgX -= .25;
//If the background has gone too far
if( bgX <= -background->w )
{
//Reset the offset
bgX = 0;
}
//show or don't show the primary and sub selections
if ( choose1 != 0)
{
//render background
apply_surface( 320, 345, attack_background, screen);
apply_surface( 320, 385, magic_background, screen);
apply_surface( 320, 425, item_background, screen);
//apply primary selection text
apply_surface( 325, 352, attack_text, screen );
apply_surface( 325, 392, magic_text, screen );
apply_surface( 325, 432, item_text, screen );
if (choose2 == 2 )
{
apply_surface( 500, 345, magic_sub_selection, screen);
apply_surface( 500, 385, magic_sub_selection, screen);
apply_surface( 500, 425, magic_sub_selection, screen);
//now set the text for which character is selected
if( choose1 == 1 && choose2 == 2)
{
apply_surface( 505, 350, rage_text, screen );
apply_surface( 505, 390, hitx2_text, screen );
apply_surface( 505, 430, limit_text, screen );
}
if ( choose1 == 2 && choose2 == 2)
{
apply_surface( 505, 350, fire_text, screen );
apply_surface( 505, 390, ice_text, screen );
apply_surface( 505, 430, limit_text, screen );
}
if ( choose1 == 3 && choose2 == 2)
{
apply_surface( 505, 350, protect_text, screen );
apply_surface( 505, 390, taunt_text, screen );
apply_surface( 505, 430, limit_text, screen );
}
}
if (choose2 == 3)
{
if(choose1 == 1)
{
if(play1i == true)
{
if(play1i1 == true)
{
apply_surface( 500, 345, item_sub_selection, screen);
apply_surface( 505, 350, player1_spirits_text, screen);
}
if(play1i2 == true)
{
apply_surface( 500, 385, item_sub_selection, screen);
apply_surface( 505, 390, player1_hi_spirits_text, screen);
}
if(play1i3 == true)
{
apply_surface( 500, 425, item_sub_selection, screen);
apply_surface( 505, 430, player1_lazarus_text, screen);
}
}
}
else if(choose1 == 2)
{
if(choose2 == 3 && play2i == true)
{
if(play2i1 == true)
{
apply_surface( 500, 345, item_sub_selection, screen);
apply_surface( 505, 350, player2_ether_text, screen);
}
if(play2i2 == true)
{
apply_surface( 500, 385, item_sub_selection, screen);
apply_surface( 505, 390, player2_hi_ether_text, screen);
}
if(play2i3 == true)
{
apply_surface( 500, 425, item_sub_selection, screen);
apply_surface( 505, 430, player2_lazarus_text, screen);
}
}
}
else if(choose1 == 3)
{
if(choose2 == 3 && play3i == true)
{
if(play3i1 == true)
{
apply_surface( 500, 345, item_sub_selection, screen);
apply_surface( 505, 350, player3_hi_spirits_text, screen);
}
if(play3i2 == true)
{
apply_surface( 500, 385, item_sub_selection, screen);
apply_surface( 505, 390, player3_hi_ether_text, screen);
}
if(play3i3 == true)
{
apply_surface( 500, 425, item_sub_selection, screen);
apply_surface( 505, 430, player3_lazarus_text, screen);
}
}
}
}
}
// show the characters
apply_surface( char1x, char1y, character1, screen);
apply_surface( char2x, char2y, character1, screen);
apply_surface( char3x, char3y, character1, screen);
// place the characters depending on which one is selected
if ( ary == 350 && arx == 15)
{
char1x = 65;
char2x = 15;
char3x = 15;
}
if ( ary == 390 && arx == 15)
{
char1x = 15;
char2x = 65;
char3x = 15;
}
if ( ary == 430 && arx == 15)
{
char1x = 15;
char2x = 15;
char3x = 65;
}
// show the enemies
if(bad1 == true)
{
apply_surface( 440, 85, enemy1, screen);
apply_surface( 420, 140, enemy1_health_text, screen);
}
if(bad2 == true)
{
apply_surface( 440, 165, enemy1, screen);
apply_surface( 420, 220, enemy2_health_text, screen);
}
if(bad3 == true)
{
apply_surface( 440, 245, enemy1, screen);
apply_surface( 420, 300, enemy3_health_text, screen);
}
if(bad4 == true)
{
apply_surface( 550, 85, enemy1, screen);
apply_surface( 530, 140, enemy4_health_text, screen);
}
if(bad5 == true)
{
apply_surface( 550, 165, enemy1, screen);
apply_surface( 530, 220, enemy5_health_text, screen);
}
if(bad6 == true)
{
apply_surface( 550, 248, enemy1, screen);
apply_surface( 530, 300, enemy6_health_text, screen);
}
// show the arrow
if ( right == true )
{apply_surface( arx, ary, arrow_right, screen);}
if ( left == true)
{apply_surface(arx, ary, arrow_left, screen);}
//see the choices
if( running == true )
{
//The timer's time as a string
std::stringstream ch1;
std::stringstream ch2;
std::stringstream ch3;
std::stringstream ch4;
//Convert the timer's time to a string
ch1 << "Choose1 is: " << choose1;
ch2 << "Choose2 is: " << choose2;
ch3 << "Choose3 is: " << choose3;
ch4 << "player1 a[1] is: " << player3_array[1];
//Render the time surface
cheese1 = TTF_RenderText_Solid( font, ch1.str().c_str(), textColor );
cheese2 = TTF_RenderText_Solid( font, ch2.str().c_str(), textColor );
cheese3 = TTF_RenderText_Solid( font, ch3.str().c_str(), textColor );
cheese4 = TTF_RenderText_Solid( font, ch4.str().c_str(), textColor );
//Apply the time surface
apply_surface( 250, 150,cheese1, screen );
apply_surface( 250, 170, cheese2, screen );
apply_surface( 250, 190, cheese3, screen );
apply_surface( 250, 210, cheese4, screen );
//Free the time surface
SDL_FreeSurface( cheese1 );
SDL_FreeSurface( cheese2 );
SDL_FreeSurface( cheese3 );
SDL_FreeSurface( cheese4 );
}
//----------------------------------------------------------------------------
//the players health and magic has a string
std::stringstream play1h;
std::stringstream play1th;
std::stringstream play1m;
std::stringstream play1tm;
std::stringstream play2h;
std::stringstream play2th;
std::stringstream play2m;
std::stringstream play2tm;
std::stringstream play3h;
std::stringstream play3th;
std::stringstream play3m;
std::stringstream play3tm;
//the players particular items as a string
std::stringstream play1item1;
std::stringstream play1item2;
std::stringstream play1item3;
std::stringstream play2item1;
std::stringstream play2item2;
std::stringstream play2item3;
std::stringstream play3item1;
std::stringstream play3item2;
std::stringstream play3item3;
//the enemy health as a string
std::stringstream enemy1ph;
std::stringstream enemy2ph;
std::stringstream enemy3ph;
std::stringstream enemy4ph;
std::stringstream enemy5ph;
std::stringstream enemy6ph;
//convert the player attributes to string
play1h << player1_health;
play1th << player1_total_health;
play1m << player1_magic;
play1tm << player1_total_magic;
play2h << player2_health;
play2th << player2_total_health;
play2m << player2_magic;
play2tm << player2_total_magic;
play3h << player3_health;
play3th << player3_total_health;
play3m << player3_magic;
play3tm << player3_total_magic;
//convert the enemy health
enemy1ph << enemy1_health;
enemy2ph << enemy2_health;
enemy3ph << enemy3_health;
enemy4ph << enemy4_health;
enemy5ph << enemy5_health;
enemy6ph << enemy6_health;
//convert to string
enemy1_health_text = TTF_RenderText_Solid( font_small, enemy1ph.str().c_str(), textColor );
enemy2_health_text = TTF_RenderText_Solid( font_small, enemy2ph.str().c_str(), textColor );
enemy3_health_text = TTF_RenderText_Solid( font_small, enemy3ph.str().c_str(), textColor );
enemy4_health_text = TTF_RenderText_Solid( font_small, enemy4ph.str().c_str(), textColor );
enemy5_health_text = TTF_RenderText_Solid( font_small, enemy5ph.str().c_str(), textColor );
enemy6_health_text = TTF_RenderText_Solid( font_small, enemy6ph.str().c_str(), textColor );
//convert the players items and numbers into a string
play1item1 << "SPIRIT[" << player1_item1_count << "]";
play1item2 << "HI-SPIRIT[" << player1_item2_count << "]";
play1item3 << "LAZARUS[" << player1_item3_count << "]";
play2item1 << "ETHER[" << player2_item1_count << "]";
play2item2 << "HI-ETHER[" << player2_item2_count << "]";
play2item3 << "LAZARUS[" << player2_item3_count << "]";
play3item1 << "HI-SPIRIT[" << player3_item1_count << "]";
play3item2 << "HI-ETHER[" << player3_item2_count << "]";
play3item3 << "LAZARUS[" << player3_item3_count << "]";
//Render the text
//character1 attributes text
character1_health = TTF_RenderText_Solid( font_small, play1h.str().c_str(), textColor );
character1_total_health = TTF_RenderText_Solid( font_small, play1th.str().c_str(), textColor );
character1_magic = TTF_RenderText_Solid( font_small, play1m.str().c_str(), textColor );
character1_total_magic = TTF_RenderText_Solid( font_small, play1tm.str().c_str(), textColor );
//character2 attributes text
character2_health = TTF_RenderText_Solid( font_small, play2h.str().c_str(), textColor );
character2_total_health = TTF_RenderText_Solid( font_small, play2th.str().c_str(), textColor );
character2_magic = TTF_RenderText_Solid( font_small, play2m.str().c_str(), textColor );
character2_total_magic = TTF_RenderText_Solid( font_small, play2tm.str().c_str(), textColor );
//character3 attributes text
character3_health = TTF_RenderText_Solid( font_small, play3h.str().c_str(), textColor );
character3_total_health = TTF_RenderText_Solid( font_small, play3th.str().c_str(), textColor );
character3_magic = TTF_RenderText_Solid( font_small, play3m.str().c_str(), textColor );
character3_total_magic = TTF_RenderText_Solid( font_small, play3tm.str().c_str(), textColor );
//primary selection text
attack_text = TTF_RenderText_Solid( font, "ATTACK", textColor );
magic_text = TTF_RenderText_Solid( font, "MAGIC", textColor );
item_text = TTF_RenderText_Solid( font, "ITEM", textColor );
//character names text
character1_name = TTF_RenderText_Solid( font, "BECKETT", textColor );
character2_name = TTF_RenderText_Solid( font, "SAMSON", textColor );
character3_name = TTF_RenderText_Solid( font, "CHEERIO", textColor );
//character 1 magic text
rage_text = TTF_RenderText_Solid( font, "RAGE", textColor );
hitx2_text = TTF_RenderText_Solid( font, "POWER X2", textColor );
limit_text = TTF_RenderText_Solid( font, "LIMIT", textColor );
//character2 magic text
fire_text = TTF_RenderText_Solid( font, "BURN", textColor );
ice_text = TTF_RenderText_Solid( font, "FREEZE", textColor );
//character3 magic text
protect_text = TTF_RenderText_Solid( font, "GUARD", textColor );
taunt_text = TTF_RenderText_Solid( font, "TAUNT", textColor );
//the names of items
player1_spirits_text = TTF_RenderText_Solid( font, play1item1.str().c_str(), textColor );
player1_hi_spirits_text = TTF_RenderText_Solid( font, play1item2.str().c_str(), textColor );
player1_lazarus_text = TTF_RenderText_Solid( font, play1item3.str().c_str(), textColor );
player2_ether_text = TTF_RenderText_Solid( font, play2item1.str().c_str(), textColor );
player2_hi_ether_text = TTF_RenderText_Solid( font, play2item2.str().c_str(), textColor );
player2_lazarus_text = TTF_RenderText_Solid( font, play2item3.str().c_str(), textColor );
player3_hi_spirits_text = TTF_RenderText_Solid( font, play3item1.str().c_str(), textColor );
player3_hi_ether_text = TTF_RenderText_Solid( font, play3item2.str().c_str(), textColor );
player3_lazarus_text = TTF_RenderText_Solid( font, play3item3.str().c_str(), textColor );
//the warning messages
item_warning = TTF_RenderText_Solid( font, "NO ITEMS", textColor );
magic_warning = TTF_RenderText_Solid( font, "NO MAGIC POINTS", textColor );
//apply character 1 text
apply_surface( 183, 347, character1_health, screen );
apply_surface( 183, 367, character1_total_health, screen );
apply_surface( 237, 347, character1_magic, screen );
apply_surface( 237, 367, character1_total_magic, screen );
apply_surface( 60, 355, character1_name, screen );
//apply character 2 text
apply_surface( 183, 387, character2_health, screen );
apply_surface( 183, 407, character2_total_health, screen );
apply_surface( 237, 387, character2_magic, screen );
apply_surface( 237, 407, character2_total_magic, screen );
apply_surface( 60, 395, character2_name, screen );
//apply character 3 text
apply_surface( 183, 427, character3_health, screen );
apply_surface( 183, 447, character3_total_health, screen );
apply_surface( 237, 427, character3_magic, screen );
apply_surface( 237, 447, character3_total_magic, screen );
apply_surface( 60, 435, character3_name, screen );
//Update the screen
if( SDL_Flip( screen ) == -1 )
{
return 1;
}
//Cap the frame rate
if( fps.get_ticks() < 1000 / FRAMES_PER_SECOND )
{
SDL_Delay( ( 1000 / FRAMES_PER_SECOND ) - fps.get_ticks() );
}
}
while(gameplay_text == true)
{
if( Mix_PlayingMusic() == 0 )
{
title_time.start();
//Play the music
if( Mix_PlayMusic( battle_theme, -1 ) == 1 )
{
return 1;
}
}
//While there's an event to handle
while( SDL_PollEvent( &event ) )
{
//If a key was pressed
if( event.type == SDL_KEYDOWN )
{
switch ( event.key.keysym.sym )
{
case SDLK_a:
{
text_counter = text_counter + 1; break;
}
default:
{break;}
}
}
}
//Apply the surface to the screen
apply_surface(bgX, bgY, sky, screen );
apply_surface( bgX + background->w, bgY, sky, screen );
apply_surface( 0, 0, background, screen );
apply_surface( 0, 330, command_background, screen );
apply_surface( 50, 345, character_background, screen);
apply_surface( 50, 385, character_background, screen);
apply_surface( 50, 425, character_background, screen);
apply_surface( 170, 345, health_counter, screen);
apply_surface( 220, 345, magic_counter, screen);
}
while(boss == true)
{break;}
while(boss_text == true)
{break;}
while(end == true)
{break;}
while(credits == true)
{break;}
break;
}
//Free the surface and quit SDL
clean_up();
return 0;
}
| [
"danielth101@gmail.com"
] | danielth101@gmail.com |
339a69a11c75ee48df5c8def6e615c9e46ae3e00 | 7bc7bb2d06c77eb10669310775e30b64e15ba9a6 | /Common/Math/algebraic_geometry.h | a8f28416ccee633259a93097e273d9dbb0142a5d | [] | no_license | WYAN86/APA_QT_Assistant | b0686f33e22621e389f1c6deb7bfebff5c6b86a1 | 84b35221816722a3680786fa2965f94c1e72ff12 | refs/heads/master | 2023-01-15T23:20:23.416763 | 2020-11-24T06:27:16 | 2020-11-24T06:27:16 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,078 | h | /*****************************************************************************/
/* FILE NAME: algebraic_geometry.h COPYRIGHT (c) Motovis 2019 */
/* All Rights Reserved */
/* DESCRIPTION: the algebraic geometry aclculate method */
/*****************************************************************************/
/* REV AUTHOR DATE DESCRIPTION OF CHANGE */
/* --- ----------- ---------------- --------------------- */
/* 1.0 Guohua Zhu January 16 2019 Initial Version */
/*****************************************************************************/
#ifndef MATH_ALGEBRAIC_GEOMETRY_H_
#define MATH_ALGEBRAIC_GEOMETRY_H_
#include <QMainWindow>
#include "math.h"
#include "./Common/Utils/Inc/property.h"
#include "./Common/Math/vector_2d.h"
#include "./Common/Math/solve_equation.h"
#include "./Common/Configure/Configs/vehilce_config.h"
typedef struct _Line
{
Vector2d Point;
float Angle;
}Line;
typedef struct _Circle
{
Vector2d Center;
float Radius;
}Circle;
class AlgebraicGeometry {
public:
AlgebraicGeometry();
virtual ~AlgebraicGeometry();
//二次方程求解
float QuadraticEquation(float a,float b,float c);
float QuadraticEquationMin(float a,float b,float c);
//过一点的直线方程
float LinearAlgebra(Line l,float x);
//已知系数的直线方程
float LinearAlgebraCoefficient(float a,float b,float x);
// 已知圆上两点和半径,算两点间的弧长
float ArcLength(Vector2d a,Vector2d b,float r);
/************************************************************************/
// 已知圆的半径,求与圆和直线相切圆的坐标位置
void Tangent_CCL(Line l,Circle cl,Circle *cr);
void Tangent_CCL_Up(Line l,Circle cl,Circle *cr);
// 已知竖直直线和圆 ,以及相切圆的半径,求与它们相切圆的坐标
void Tangent_CCL_VerticalLine(Line l,Circle cl,Circle *cr,Vector2d *lp,Vector2d *rp);
// 已知线段和圆心,求相切圆的半径
void Tangent_CL(Line l,Circle *c,Vector2d *p);
// 已知两圆心位置,求与两圆相切直线的切点位置
void Tangent_CLC(Circle cl,Circle cr,Line *lm,Vector2d *ll,Vector2d *lr);
void Tangent_CLC_Up(Circle cl,Circle cr,Line *lm,Vector2d *ll,Vector2d *lr);
// 已知两条直线,求与两直线相切的圆的坐标和半径,以及切点的坐标
void Tangent_LLC(Line l_1,Line l_2,Circle *c,Vector2d *lp,Vector2d *rp);
// 已知直线和圆的半径,求解与直线相切的圆的圆心,并保证圆上的某点与固定点的距离为余量值(垂直泊车)
void Tanget_LC_Margin(Line l,Vector2d p,float margin,Circle *c,Vector2d *t_p);
// 已知库边沿,左圆,求与左圆相切且留有余量的圆
void Tanget_CC_Margin(Circle cl,Vector2d p,float margin,Circle *cr,Line *t_l);
// 两圆相交求交点
void Intersection_CC(Circle c1,Circle c2,Vector2d *p1,Vector2d *p2);
private:
SolveEquation _solve_equation;
};
#endif /* MATH_ALGEBRAIC_GEOMETRY_H_ */
| [
"zgh_email@163.com"
] | zgh_email@163.com |
0db6e97cc9341c975fd73fc028b332bd63221bf4 | 7a2d06a51583b6766c79e0048bacb549891a4afd | /prova/prova.cpp | 7cc11df5b4520cc7fdb0a1256ef8139bbd2bf846 | [] | no_license | evancason/Prova-1 | a2c3cbf77e5d2cbd0b6bf750d47cd18d6c1f20ee | 83ffe920bfb22060fc7de02fe25124412547ec53 | refs/heads/master | 2023-01-12T18:40:52.901113 | 2020-11-12T13:19:00 | 2020-11-12T13:19:00 | 304,327,185 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 74 | cpp | #include<iostream>
using namespace std;
int main(){
cout<< "prova";
} | [
"evan.cason@studenti.unitn.it"
] | evan.cason@studenti.unitn.it |
64ba039cebf82a27ff86b24f232c1d7c4d5e943d | 51635684d03e47ebad12b8872ff469b83f36aa52 | /external/gcc-12.1.0/libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/26701.cc | 562be765236ae1a9226606e69ebfeef6e1780a5e | [
"LGPL-2.1-only",
"GPL-3.0-only",
"GCC-exception-3.1",
"GPL-2.0-only",
"LGPL-3.0-only",
"LGPL-2.0-or-later",
"Zlib",
"LicenseRef-scancode-public-domain"
] | permissive | zhmu/ananas | 8fb48ddfe3582f85ff39184fc7a3c58725fe731a | 30850c1639f03bccbfb2f2b03361792cc8fae52e | refs/heads/master | 2022-06-25T10:44:46.256604 | 2022-06-12T17:04:40 | 2022-06-12T17:04:40 | 30,108,381 | 59 | 8 | Zlib | 2021-09-26T17:30:30 | 2015-01-31T09:44:33 | C | UTF-8 | C++ | false | false | 1,747 | cc | // { dg-require-namedlocale "en_GB.ISO8859-1" }
// 2010-01-06 Paolo Carlini <paolo.carlini@oracle.com>
// Copyright (C) 2010-2022 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 22.2.5.1.1 time_get members
#include <locale>
#include <sstream>
#include <testsuite_hooks.h>
// libstdc++/26701
void test01()
{
using namespace std;
typedef istreambuf_iterator<wchar_t> iterator_type;
locale loc_en = locale(ISO_8859(1,en_GB));
tm tm0 = __gnu_test::test_tm(0, 0, 0, 0, 0, 0, 0, 0, 0);
iterator_type end;
wistringstream iss;
iss.imbue(loc_en);
const time_get<wchar_t>& tg = use_facet<time_get<wchar_t> >(iss.getloc());
const ios_base::iostate good = ios_base::goodbit;
ios_base::iostate errorstate = good;
iss.str(L"01/02/2003");
iterator_type is_it0(iss);
errorstate = good;
tg.get_date(is_it0, end, iss, errorstate, &tm0);
VERIFY( errorstate == ios_base::eofbit );
VERIFY( tm0.tm_year + 1900 == 2003 );
VERIFY( tm0.tm_mon + 1 == 2 );
VERIFY( tm0.tm_mday == 1 );
}
int main()
{
test01();
return 0;
}
| [
"rink@rink.nu"
] | rink@rink.nu |
3ae2c4bdd0d24571ff92a230f64aeffae033a6ea | a3d6556180e74af7b555f8d47d3fea55b94bcbda | /chrome/browser/ash/printing/usb_printer_util_unittest.cc | 3095e9bb003023629f30a20a19a7f503e406d300 | [
"BSD-3-Clause"
] | permissive | chromium/chromium | aaa9eda10115b50b0616d2f1aed5ef35d1d779d6 | a401d6cf4f7bf0e2d2e964c512ebb923c3d8832c | refs/heads/main | 2023-08-24T00:35:12.585945 | 2023-08-23T22:01:11 | 2023-08-23T22:01:11 | 120,360,765 | 17,408 | 7,102 | BSD-3-Clause | 2023-09-10T23:44:27 | 2018-02-05T20:55:32 | null | UTF-8 | C++ | false | false | 2,317 | cc | // Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/ash/printing/usb_printer_util.h"
#include "services/device/public/mojom/usb_device.mojom.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace ash {
namespace {
using device::mojom::UsbDeviceInfo;
using testing::HasSubstr;
TEST(UsbPrinterUtilTest, UsbDeviceToPrinterWithValidSerialNumber) {
UsbDeviceInfo device_info;
device_info.vendor_id = 1;
device_info.product_id = 2;
device_info.serial_number = u"12345";
PrinterDetector::DetectedPrinter entry;
EXPECT_TRUE(UsbDeviceToPrinter(device_info, &entry));
EXPECT_THAT(entry.printer.uri().GetNormalized(), HasSubstr("?serial=12345"));
}
TEST(UsbPrinterUtilTest, UsbDeviceToPrinterWithNoSerialNumber) {
UsbDeviceInfo device_info;
device_info.vendor_id = 1;
device_info.product_id = 2;
PrinterDetector::DetectedPrinter entry;
EXPECT_TRUE(UsbDeviceToPrinter(device_info, &entry));
// If the device_info does not specify a serial number, the URI should get
// created with the character '?'.
EXPECT_THAT(entry.printer.uri().GetNormalized(), HasSubstr("?serial=?"));
}
TEST(UsbPrinterUtilTest, UsbDeviceToPrinterWithEmptySerialNumber) {
UsbDeviceInfo device_info;
device_info.vendor_id = 1;
device_info.product_id = 2;
device_info.serial_number = u"";
PrinterDetector::DetectedPrinter entry;
EXPECT_TRUE(UsbDeviceToPrinter(device_info, &entry));
// If the device_info specifies an empty serial number, the URI should get
// created with the character '?'.
EXPECT_THAT(entry.printer.uri().GetNormalized(), HasSubstr("?serial=?"));
}
TEST(UsbPrinterUtilTest, GuessEffectiveMakeAndModelDuplicatedManufacturer) {
UsbDeviceInfo device_info;
device_info.manufacturer_name = u"bixolon";
device_info.product_name = u"bixolon abc-123";
EXPECT_EQ(GuessEffectiveMakeAndModel(device_info), "bixolon abc-123");
}
TEST(UsbPrinterUtilTest, GuessEffectiveMakeAndModel) {
UsbDeviceInfo device_info;
device_info.manufacturer_name = u"bixolon";
device_info.product_name = u"abc-123";
EXPECT_EQ(GuessEffectiveMakeAndModel(device_info), "bixolon abc-123");
}
} // namespace
} // namespace ash
| [
"chromium-scoped@luci-project-accounts.iam.gserviceaccount.com"
] | chromium-scoped@luci-project-accounts.iam.gserviceaccount.com |
54db88024ac503ab113a767f14cccab94635af71 | 7dcbe5e26c611d3587d6b15dffa65cbe18fc513a | /main/include/eudaq/EventSynchronisationBase.hh | f4df4ebe91e60955114bf6a840408dd578b903eb | [] | no_license | RPeschke/eudaq | 383e8de0406be9e54421b94a4456324687cfd11e | d16c707a5dc9b6fc8f8206173384a1bcc3f83b42 | refs/heads/master | 2021-01-16T23:22:20.658501 | 2014-03-17T17:02:19 | 2014-03-17T17:02:19 | 14,400,924 | 0 | 0 | null | 2017-02-15T11:19:10 | 2013-11-14T16:42:09 | C++ | UTF-8 | C++ | false | false | 3,025 | hh | #ifndef EventSynchronisationBase_h__
#define EventSynchronisationBase_h__
#include "eudaq/DetectorEvent.hh"
#include "eudaq/FileSerializer.hh"
#include <memory>
#include <queue>
// base class for all Synchronization Plugins
// it is desired to be as modular es possible with this approach.
// first step is to separate the events from different Producers.
// then it will be recombined to a new event
// for future use it should be possible to check an entire block of data to be sync.
// the Idea is that one has for example every 1000 events a sync event and one only writes data to disc if all 1000 events are
// correct.
// The Idea is that the user can define a condition that need to be true to define if an event is sync or not
namespace eudaq{
class DLLEXPORT SyncBase {
public:
typedef std::queue<std::shared_ptr<eudaq::Event>> eventqueue_t ;
// virtual int isSynchron();
// virtual bool AddNextEventToQueue();
int AddDetectorElementToProducerQueue(int fileIndex,std::shared_ptr<eudaq::DetectorEvent> dev );
virtual bool SyncFirstEvent();
virtual bool SyncNEvents(size_t N);
virtual bool getNextEvent( std::shared_ptr<eudaq::DetectorEvent> & ev);
// virtual bool SynEvents(FileDeserializer & des, int ver, std::shared_ptr<eudaq::Event> & ev);
// virtual int extractCorrect_event(std::shared_ptr<eudaq::Event> tlu_event,eudaq::eventqueue_t& event_queue,std::shared_ptr<eudaq::Event> &outputEvent);
virtual bool compareTLUwithEventQueue(std::shared_ptr<eudaq::Event>& tlu_event,SyncBase::eventqueue_t& event_queue);
virtual bool compareTLUwithEventQueues(std::shared_ptr<eudaq::Event>& tlu_event);
void storeCurrentOrder();
bool Event_Queue_Is_Empty();
bool SubEventQueueIsEmpty(int i);
void event_queue_pop();
void event_queue_pop_TLU_event();
void makeDetectorEvent();
void clearDetectorQueue();
/** The empty destructor. Need to add it to make it virtual.
*/
virtual ~SyncBase() {}
SyncBase();
void addBOREEvent(int fileIndex,const eudaq::DetectorEvent& BOREvent);
void PrepareForEvents();
protected:
eventqueue_t& getQueuefromId(unsigned producerID);
eventqueue_t& getQueuefromId(unsigned fileIndex,unsigned eventIndex);
eventqueue_t& getFirstTLUQueue();
unsigned getUniqueID(unsigned fileIndex,unsigned eventIndex);
unsigned getTLU_UniqueID(unsigned fileIndex);
std::map<unsigned,size_t> m_ProducerId2Eventqueue;
size_t m_registertProducer;
std::vector<size_t> m_EventsProFileReader;
/* This vector saves for each producer an event queue */
std::vector<eventqueue_t> m_ProducerEventQueue;
std::queue<std::shared_ptr<eudaq::DetectorEvent>> m_DetectorEventQueue;
// int m_ver;
int m_TLUs_found;
//int handleEventSync(int syncFlag, eudaq::eventqueue_t& producer_queue);
// bool m_queueStatus;
//long lastAsyncEvent_,currentEvent_;
bool isAsync_;
size_t NumberOfEventsToSync_;
unsigned long long longTimeDiff_;
};
}//namespace eudaq
#endif // EventSynchronisationBase_h__
| [
"Richard.Peschke@desy.de"
] | Richard.Peschke@desy.de |
6c2d84c43d89f5cbb3a3a3418a60301c2290290c | 3cf9e141cc8fee9d490224741297d3eca3f5feff | /C++ Benchmark Programs/Benchmark Files 1/classtester/autogen-sources/source-16194.cpp | c13c0245e7fc7f5d80764cfc3ec09f3685647e24 | [] | no_license | TeamVault/tauCFI | e0ac60b8106fc1bb9874adc515fc01672b775123 | e677d8cc7acd0b1dd0ac0212ff8362fcd4178c10 | refs/heads/master | 2023-05-30T20:57:13.450360 | 2021-06-14T09:10:24 | 2021-06-14T09:10:24 | 154,563,655 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 3,080 | cpp | struct c0;
void __attribute__ ((noinline)) tester0(c0* p);
struct c0
{
bool active0;
c0() : active0(true) {}
virtual ~c0()
{
tester0(this);
active0 = false;
}
virtual void f0(){}
};
void __attribute__ ((noinline)) tester0(c0* p)
{
p->f0();
}
struct c1;
void __attribute__ ((noinline)) tester1(c1* p);
struct c1 : virtual c0
{
bool active1;
c1() : active1(true) {}
virtual ~c1()
{
tester1(this);
c0 *p0_0 = (c0*)(c1*)(this);
tester0(p0_0);
active1 = false;
}
virtual void f1(){}
};
void __attribute__ ((noinline)) tester1(c1* p)
{
p->f1();
if (p->active0)
p->f0();
}
struct c2;
void __attribute__ ((noinline)) tester2(c2* p);
struct c2 : virtual c0
{
bool active2;
c2() : active2(true) {}
virtual ~c2()
{
tester2(this);
c0 *p0_0 = (c0*)(c2*)(this);
tester0(p0_0);
active2 = false;
}
virtual void f2(){}
};
void __attribute__ ((noinline)) tester2(c2* p)
{
p->f2();
if (p->active0)
p->f0();
}
struct c3;
void __attribute__ ((noinline)) tester3(c3* p);
struct c3 : virtual c2, virtual c0
{
bool active3;
c3() : active3(true) {}
virtual ~c3()
{
tester3(this);
c0 *p0_0 = (c0*)(c2*)(c3*)(this);
tester0(p0_0);
c0 *p0_1 = (c0*)(c3*)(this);
tester0(p0_1);
c2 *p2_0 = (c2*)(c3*)(this);
tester2(p2_0);
active3 = false;
}
virtual void f3(){}
};
void __attribute__ ((noinline)) tester3(c3* p)
{
p->f3();
if (p->active0)
p->f0();
if (p->active2)
p->f2();
}
struct c4;
void __attribute__ ((noinline)) tester4(c4* p);
struct c4 : c3, virtual c0, virtual c2
{
bool active4;
c4() : active4(true) {}
virtual ~c4()
{
tester4(this);
c0 *p0_0 = (c0*)(c2*)(c3*)(c4*)(this);
tester0(p0_0);
c0 *p0_1 = (c0*)(c3*)(c4*)(this);
tester0(p0_1);
c0 *p0_2 = (c0*)(c4*)(this);
tester0(p0_2);
c0 *p0_3 = (c0*)(c2*)(c4*)(this);
tester0(p0_3);
c2 *p2_0 = (c2*)(c3*)(c4*)(this);
tester2(p2_0);
c2 *p2_1 = (c2*)(c4*)(this);
tester2(p2_1);
c3 *p3_0 = (c3*)(c4*)(this);
tester3(p3_0);
active4 = false;
}
virtual void f4(){}
};
void __attribute__ ((noinline)) tester4(c4* p)
{
p->f4();
if (p->active3)
p->f3();
if (p->active0)
p->f0();
if (p->active2)
p->f2();
}
int __attribute__ ((noinline)) inc(int v) {return ++v;}
int main()
{
c0* ptrs0[25];
ptrs0[0] = (c0*)(new c0());
ptrs0[1] = (c0*)(c1*)(new c1());
ptrs0[2] = (c0*)(c2*)(new c2());
ptrs0[3] = (c0*)(c2*)(c3*)(new c3());
ptrs0[4] = (c0*)(c3*)(new c3());
ptrs0[5] = (c0*)(c2*)(c3*)(c4*)(new c4());
ptrs0[6] = (c0*)(c3*)(c4*)(new c4());
ptrs0[7] = (c0*)(c4*)(new c4());
ptrs0[8] = (c0*)(c2*)(c4*)(new c4());
for (int i=0;i<9;i=inc(i))
{
tester0(ptrs0[i]);
delete ptrs0[i];
}
c1* ptrs1[25];
ptrs1[0] = (c1*)(new c1());
for (int i=0;i<1;i=inc(i))
{
tester1(ptrs1[i]);
delete ptrs1[i];
}
c2* ptrs2[25];
ptrs2[0] = (c2*)(new c2());
ptrs2[1] = (c2*)(c3*)(new c3());
ptrs2[2] = (c2*)(c3*)(c4*)(new c4());
ptrs2[3] = (c2*)(c4*)(new c4());
for (int i=0;i<4;i=inc(i))
{
tester2(ptrs2[i]);
delete ptrs2[i];
}
c3* ptrs3[25];
ptrs3[0] = (c3*)(new c3());
ptrs3[1] = (c3*)(c4*)(new c4());
for (int i=0;i<2;i=inc(i))
{
tester3(ptrs3[i]);
delete ptrs3[i];
}
c4* ptrs4[25];
ptrs4[0] = (c4*)(new c4());
for (int i=0;i<1;i=inc(i))
{
tester4(ptrs4[i]);
delete ptrs4[i];
}
return 0;
}
| [
"ga72foq@mytum.de"
] | ga72foq@mytum.de |
3e5bae94db45e29289716c04de8628c9bfe8c48b | dd6fee79066e2dfa74371bd82c87a563dc0c47fd | /OJ/CDOJ/D - Jumping Hero.cpp | c5b5e2036491c1f1a7e5385a56359016395f0be1 | [] | no_license | mzry1992/workspace | 404c31df66a3b15a60dc0f07fff397bf50bcc1dc | 9a181419f0d7224e37baa729feaf3bb656544420 | refs/heads/master | 2021-01-19T12:39:17.854501 | 2012-12-24T11:13:22 | 2012-12-24T11:13:22 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,003 | cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <deque>
using namespace std;
const int step[4][2] = {{-1,0},{1,0},{0,-1},{0,1}};
int n,m;
int map[500][500];
int sx,sy,tx,ty;
struct bfsnode
{
int x,y;
int step;
int m,n;
int jx,jy;
}now,updata;
deque<bfsnode> Q;
bool visit[310][310][7][7];
bfsnode getnode(int x,int y,int step,int m,int n,int jx,int jy)
{
bfsnode res;
res.x = x;
res.y = y;
res.step = step;
res.m = m;
res.n = n;
res.jx = jx;
res.jy = jy;
return res;
}
int BFS()
{
memset(visit,false,sizeof(visit));
Q.clear();
Q.push_back(getnode(sx,sy,0,0,0,0,0));
visit[sx][sy][0][0] = true;
while (!Q.empty())
{
now = Q.front();
Q.pop_front();
if (now.x == tx && now.y == ty) return now.step;
if (now.m == 0)
{
for (int i = 0;i < 4;i++)
{
int x,y;
x = now.x+step[i][0];
y = now.y+step[i][1];
if (x >= 0 && x < n && y >= 0 && y < m)
if (map[x][y] > 0)
{
updata.x = x;
updata.y = y;
updata.step = now.step+1;
if (map[x][y] == 1)
{
updata.n = updata.m = 0;
updata.jx = updata.jy = 0;
}
else
{
updata.m = map[x][y]/10;
updata.n = map[x][y]%10;
updata.jx = x;
updata.jy = y;
}
if (visit[updata.x][updata.y][updata.m][updata.n] == false)
{
visit[updata.x][updata.y][updata.m][updata.n] = true;
Q.push_back(updata);
}
}
}
}
else
{
for (int i = 0;i < 4;i++)
{
int x,y;
x = now.x+now.n*step[i][0];
y = now.y+now.n*step[i][1];
if (x >= 0 && x < n && y >= 0 && y < m)
if (map[x][y] > 0)
{
updata.x = x;
updata.y = y;
updata.step = now.step+1;
if (map[x][y] == 1 || (updata.jx == x && updata.jy == y))
{
if (now.m == 1)
{
updata.n = updata.m = 0;
updata.jx = updata.jy = 0;
}
else
{
updata.n = now.n;
updata.m = now.m-1;
}
}
else
{
updata.m = map[x][y]/10;
updata.n = map[x][y]%10;
updata.jx = x;
updata.jy = y;
}
if (visit[updata.x][updata.y][updata.m][updata.n] == false)
{
visit[updata.x][updata.y][updata.m][updata.n] = true;
Q.push_back(updata);
}
}
}
}
}
return -1;
}
int main()
{
int t;
scanf("%d",&t);
for (int ft = 1;ft <= t;ft++)
{
if (ft > 1) printf("\n");
scanf("%d%d",&n,&m);
for (int i = 0;i < n;i++)
for (int j = 0;j < m;j++)
scanf("%d",&map[i][j]);
scanf("%d%d",&sx,&sy);
scanf("%d%d",&tx,&ty);
int res = BFS();
if (res == -1)
printf("IMPOSSIBLE\n");
else
printf("%d\n",res);
}
}
| [
"muziriyun@gmail.com"
] | muziriyun@gmail.com |
f668d3cdab38272bc03924a7eed0e753490728d2 | 71b7c008356b48483bdd5536f29be5c258143123 | /src/ten.cpp | 5e9ae8ec2b5ca19ec39ac8caaec51a539e40493b | [
"MIT"
] | permissive | mirkomorati/hello_ROS | ecbe933f61196330da88ba63d2509cc9cbe2c1d4 | 1d5f00d5ffc5a5e229229e579e6fb7c22d355dd5 | refs/heads/master | 2020-03-09T20:40:57.826023 | 2018-04-10T21:29:44 | 2018-04-10T21:29:44 | 128,991,035 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,066 | cpp | /*
* Copyright (C) 2008, Morgan Quigley and Willow Garage, Inc.
*
* 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 names of Stanford University or Willow Garage, Inc. 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.
*/
// %Tag(FULLTEXT)%
#include "ros/ros.h"
#include "std_msgs/String.h"
/**
* This tutorial demonstrates simple receipt of messages over the ROS system.
*/
// %Tag(CALLBACK)%
void chatterCallback(const std_msgs::String::ConstPtr& msg)
{
ROS_INFO("I heard: [%s]", msg->data.c_str());
}
// %EndTag(CALLBACK)%
int main(int argc, char **argv)
{
/**
* The ros::init() function needs to see argc and argv so that it can perform
* any ROS arguments and name remapping that were provided at the command line.
* For programmatic remappings you can use a different version of init() which takes
* remappings directly, but for most command-line programs, passing argc and argv is
* the easiest way to do it. The third argument to init() is the name of the node.
*
* You must call one of the versions of ros::init() before using any other
* part of the ROS system.
*/
ros::init(argc, argv, "ten");
/**
* NodeHandle is the main access point to communications with the ROS system.
* The first NodeHandle constructed will fully initialize this node, and the last
* NodeHandle destructed will close down the node.
*/
ros::NodeHandle n;
/**
* The subscribe() call is how you tell ROS that you want to receive messages
* on a given topic. This invokes a call to the ROS
* master node, which keeps a registry of who is publishing and who
* is subscribing. Messages are passed to a callback function, here
* called chatterCallback. subscribe() returns a Subscriber object that you
* must hold on to until you want to unsubscribe. When all copies of the Subscriber
* object go out of scope, this callback will automatically be unsubscribed from
* this topic.
*
* The second parameter to the subscribe() function is the size of the message
* queue. If messages are arriving faster than they are being processed, this
* is the number of messages that will be buffered up before beginning to throw
* away the oldest ones.
*/
// %Tag(SUBSCRIBER)%
ros::Subscriber sub = n.subscribe("filtered", 1000, chatterCallback);
// %EndTag(SUBSCRIBER)%
/**
* ros::spin() will enter a loop, pumping callbacks. With this version, all
* callbacks will be called from within this thread (the main one). ros::spin()
* will exit when Ctrl-C is pressed, or the node is shutdown by the master.
*/
// %Tag(SPIN)%
ros::spin();
// %EndTag(SPIN)%
return 0;
}
// %EndTag(FULLTEXT)%
| [
"mirkomorati@gmail.com"
] | mirkomorati@gmail.com |
257de65b92bd436c0c00908c5d3fb532c80e95c6 | b67254073122c1a325bf6dcb42a0bd0fae1684ca | /Graph.cpp | a336e2e89d59065790c8e5da6857945888ba7cc7 | [] | no_license | TomasovszkiAdrian/prog1 | 1b486118596b2a1980df6421c4fb201452053fe0 | 5368d1e06eed65caba993be9a03029f594f61598 | refs/heads/main | 2023-04-18T13:23:33.668188 | 2021-05-05T13:55:08 | 2021-05-05T13:55:08 | 337,106,625 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 6,851 | cpp | #include "Graph.h"
#include <map>
namespace Graph_lib {
inline pair<double,double> line_intersect(Point p1, Point p2, Point p3, Point p4, bool& parallel)
{
double x1 = p1.x;
double x2 = p2.x;
double x3 = p3.x;
double x4 = p4.x;
double y1 = p1.y;
double y2 = p2.y;
double y3 = p3.y;
double y4 = p4.y;
double denom = ((y4 - y3)*(x2-x1) - (x4-x3)*(y2-y1));
if (denom == 0){
parallel= true;
return pair<double,double>(0,0);
}
parallel = false;
return pair<double,double>( ((x4-x3)*(y1-y3) - (y4-y3)*(x1-x3))/denom,
((x2-x1)*(y1-y3) - (y2-y1)*(x1-x3))/denom);
}
bool line_segment_intersect(Point p1, Point p2, Point p3, Point p4, Point& intersection){
bool parallel;
pair<double,double> u = line_intersect(p1,p2,p3,p4,parallel);
if (parallel || u.first < 0 || u.first > 1 || u.second < 0 || u.second > 1) return false;
intersection.x = p1.x + u.first*(p2.x - p1.x);
intersection.y = p1.y + u.first*(p2.y - p1.y);
return true;
}
//class Shape's functions
void Shape::draw_lines() const
{
if (color().visibility() && 1<points.size())
for(int i = 1; i < points.size(); ++i)
fl_line(points[i-1].x, points[i-1].y, points[i].x, points[i].y);
}
void Shape::move(int dx, int dy)
{
for(int i = 0; i < points.size(); ++i){
points[i].x += dx;
points[i].y += dy;
}
}
void arc::draw_lines() const{
if (color ().visibility()){
fl_color(color().as_int());
fl_arc(point(0).x,point(0).y,w+w,h+h,s,e);
}
}
void Shape::draw() const
{
Fl_Color oldc = fl_color();
fl_color(lcolor.as_int());
fl_line_style(ls.style(), ls.width());
draw_lines();
fl_color(oldc);
fl_line_style(0);
}
void Lines::draw_lines() const
{
if (color().visibility())
for (int i = 1; i < number_of_points(); i+=2)
fl_line(point(i-1).x, point(i-1).y, point(i).x, point(i).y);
}
void Open_polyline::draw_lines() const
{
if (fill_color().visibility()) {
fl_color(fill_color().as_int());
fl_begin_complex_polygon();
for(int i=0; i<number_of_points(); ++i){
fl_vertex(point(i).x, point(i).y);
}
fl_end_complex_polygon();
fl_color(color().as_int());
}
if (color().visibility())
Shape::draw_lines();
}
void Closed_polyline::draw_lines() const
{
Open_polyline::draw_lines();
if (color().visibility())
fl_line(point(number_of_points()-1).x, point(number_of_points()-1).y, point(0).x, point(0).y);
}
void Polygon::add(Point p)
{
int np = number_of_points();
if (1<np) {
if (p==point(np-1)) error("Ugyanaz mint az előző pont");
bool parallel;
line_intersect(point(np-1),p,point(np-2),point(np-1),parallel);
if (parallel)
error("két poligon pont ugyanazon a vonalon");
}
for (int i = 1; i<np-1; ++i) {
Point ignore(0,0);
if (line_segment_intersect(point(np-1),p,point(i-1),point(i),ignore))
error("kereszteződés");
}
Closed_polyline::add(p);
}
void Polygon::draw_lines() const
{
if (number_of_points() < 3) error("kevesebb mint 3 pont");
Closed_polyline::draw_lines();
}
void Rectangle::draw_lines() const
{
if (fill_color().visibility()){
fl_color(fill_color().as_int());
fl_rectf(point(0).x, point(0).y, w, h);
fl_color(color().as_int());
}
if (color().visibility()){
fl_color(color().as_int());
fl_rect(point(0).x, point(0).y, w, h);
}
}
void Text::draw_lines() const
{
int ofnt = fl_font();
int osz = fl_size();
fl_font(fnt.as_int(), fnt_sz);
fl_draw(lab.c_str(), point(0).x, point(0).y);
fl_font(ofnt, osz);
}
void Circle::draw_lines() const
{
if (fill_color().visibility()){
fl_color(fill_color().as_int());
fl_pie(point(0).x, point(0).y, r+r-1, r+r-1, 0, 360);
fl_color(color().as_int());
}
if (color().visibility()){
fl_color(color().as_int());
fl_arc(point(0).x, point(0).y, r+r, r+r, 0, 360);
}
}
void draw_mark(Point x, char c){
static const int dx = 4;
static const int dy = 4;
string m(1,c);
fl_draw(m.c_str(), x.x-dx,x.y-dy);
}
void Marked_polyline::draw_lines() const
{
Open_polyline::draw_lines();
for( int i = 0; i < number_of_points(); ++i)
draw_mark(point(i), mark[i%mark.size()]);
}
std::map<string,Suffix::Encoding> suffix_map;
int init_suffix_map()
{
suffix_map["jpg"] = Suffix::jpg;
suffix_map["JPG"] = Suffix::jpg;
suffix_map["jpeg"] = Suffix::jpg;
suffix_map["JPEG"] = Suffix::jpg;
suffix_map["gif"] = Suffix::gif;
suffix_map["GIF"] = Suffix::gif;
suffix_map["bmp"] = Suffix::bmp;
suffix_map["BMP"] = Suffix::bmp;
return 0;
}
Suffix::Encoding get_encoding(const string& s)
{
static int x = init_suffix_map();
string::const_iterator p = find(s.begin(),s.end(),'.');
if (p==s.end()) return Suffix::none;
string suf(p+1,s.end());
return suffix_map[suf];
}
bool can_open(const string& s){
ifstream ff(s.c_str());
return ff.is_open();
}
Image::Image(Point xy, string s, Suffix::Encoding e)
:w(0), h(0), fn(xy,"")
{
add(xy);
if (!can_open(s)){
fn.set_label("Nem nyithato a file!");
p = new Bad_image(30,20);
return;
}
if (e == Suffix::none) e = get_encoding(s);
switch(e){
case Suffix::jpg:
p = new Fl_JPEG_Image(s.c_str());
break;
case Suffix::gif:
p = new Fl_GIF_Image(s.c_str());
break;
default:
fn.set_label("Nem tamogatott formatum!");
p = new Bad_image(30,20);
}
}
void Image::draw_lines() const
{
if (fn.label() != "") fn.draw_lines();
if (w && h){
p->draw(point(0).x, point(0).y, w, h, cx, cy);
}
else {
p->draw(point(0).x, point(0).y);
}
}
Function::Function(Fct f, double r1, double r2, Point xy, int count, double xscale, double yscale){
if (r2-r1<=0) error ("Rossz range!");
if (count<=0) error ("Rossz count!");
double dist = (r2-r1)/count;
double r = r1;
for (int i = 0; i < count; ++i){
add(Point(xy.x+int(r*xscale), xy.y-int(f(r)*yscale)));
r += dist;
}
}
Axis::Axis(Orientation d, Point xy, int length, int n, string lab )
:label(Point(0,0), lab)
{
if (length < 0) error ("Rossz tengely méret.");
switch (d){
case Axis::x:
{
Shape::add(xy);
Shape::add(Point(xy.x+length, xy.y));
if (1<n){
int dist = length/n;
int x = xy.x+dist;
for (int i = 0; i < n; ++i){
notches.add(Point(x, xy.y), Point(x, xy.y-5));
x += dist;
}
}
label.move(length/3, xy.y+20);
break;
}
case Axis::y:
{
Shape::add(xy);
Shape::add(Point(xy.x, xy.y-length));
if (1<n){
int dist = length/n;
int y = xy.y-dist;
for (int i = 0; i < n; ++i){
notches.add(Point(xy.x, y), Point(xy.x+5, y));
y -= dist;
}
}
label.move(xy.x-10, xy.y-length-10);
break;
}
case Axis::z:
error("Nincs z!");
}
}
void Axis::draw_lines() const
{
Shape::draw_lines();
notches.draw();
label.draw();
}
void Axis::set_color(Color c)
{
Shape::set_color(c);
notches.set_color(c);
label.set_color(c);
}
void Axis::move(int dx, int dy)
{
Shape::move(dx, dy);
notches.move(dx, dy);
label.move(dx, dy);
}
} //end Graph | [
"noreply@github.com"
] | TomasovszkiAdrian.noreply@github.com |
e6e93c21e7f51ff1138e70e35ab9a254be2870f6 | 803c6439a86c56dc1cd1d219974bd2bef4b02d0a | /08SignedDivMul/Main.cpp | d9951c439b18c6edb7087f08eba65533eec17f77 | [] | no_license | BennyFranco/assemblycourse | fc715b05efd3e4470c3d02b975e5dff397659236 | 69c17b8e4ef1431122d752222dcc9155777ca26b | refs/heads/master | 2020-04-24T06:17:02.825418 | 2019-08-06T00:57:24 | 2019-08-06T00:57:24 | 171,759,868 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 283 | cpp | #include <iostream>
extern "C" int IntegerMulDiv(int a, int b, int* prod, int* quo, int* rem);
int main()
{
int a = 21, b = 9;
int prod = 0, quo = 0, rem = 0;
int rv = IntegerMulDiv(a, b, &prod, &quo, &rem);
std::cout << "rv: " << rv << std::endl;
return 0;
} | [
"bennyfranco@icloud.com"
] | bennyfranco@icloud.com |
ab6431669206362af4d49da497a1e04735502889 | ee5e1b1cbbf060c723afb9a38538421e1acd974e | /coci16prosjecni.cpp | ad6b216568b2b1b2ee22f860939a44f242753689 | [
"MIT"
] | permissive | CaQtiml/Problem-Solved | b7730958faac9e0a334b3b05c2a4ba64deca024d | ab258ba2f130cd474f931d457fd62dafd8df5cf0 | refs/heads/master | 2021-07-19T18:37:06.604780 | 2020-05-02T07:50:28 | 2020-05-02T07:50:28 | 152,826,085 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 489 | cpp | #include "bits/stdc++.h"
using namespace std;
int mat[105][105];
int arr[105];
int main()
{
int n;
cin >> n;
for(int i=1;i<n;i++) arr[i]=i;
arr[n]=(n*(n-1))-(((n-1)*(n))/2);
for(int i=1;i<=n;i++)
{
for(int j=1;j<=n;j++)
{
mat[i][j]=arr[i]*100000;
}
}
for(int i=1;i<=n;i++)
{
for(int j=1;j<=n;j++)
{
mat[i][j]+=arr[j];
}
}
for(int i=1;i<=n;i++)
{
for(int j=1;j<=n;j++)
{
cout << mat[i][j] << " ";
}
cout << "\n";
}
} | [
"noreply@github.com"
] | CaQtiml.noreply@github.com |
fac616f5aa63814b25452c179185ff0a87c9568c | f7890dc82e706d3a122c7224a0adab15682eb0c5 | /src/devices/rtc/ds3231.h | c1cc15c31b9480650ee5aa506477c613347dced8 | [] | no_license | Elemeants/MonitoringStations | 0f6a6116d71d05523cc635b5575066f5eb664e61 | 4c55e8fc58140e4d2c5bbb2ccc020e5e89b378ee | refs/heads/master | 2023-02-19T21:04:32.805482 | 2021-01-13T17:12:30 | 2021-01-13T17:12:30 | 316,584,090 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,698 | h | /*
DS3231.h - Header file for the DS3231 Real-Time Clock
Version: 1.0.1
(c) 2014 Korneliusz Jarzebski
www.jarzebski.pl
This program is free software: you can redistribute it and/or modify
it under the terms of the version 3 GNU General Public License as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef DS3231_h
#define DS3231_h
#include "device_interface.h"
#define DS3231_ADDRESS (0x68)
#define DS3231_REG_TIME (0x00)
#define DS3231_REG_ALARM_1 (0x07)
#define DS3231_REG_ALARM_2 (0x0B)
#define DS3231_REG_CONTROL (0x0E)
#define DS3231_REG_STATUS (0x0F)
#define DS3231_REG_TEMPERATURE (0x11)
#ifndef RTCDATETIME_STRUCT_H
#define RTCDATETIME_STRUCT_H
struct RTCDateTime
{
uint16_t year;
uint8_t month;
uint8_t day;
uint8_t hour;
uint8_t minute;
uint8_t second;
uint8_t dayOfWeek;
uint32_t unixtime;
};
struct RTCAlarmTime
{
uint8_t day;
uint8_t hour;
uint8_t minute;
uint8_t second;
};
#endif
typedef enum
{
DS3231_1HZ = 0x00,
DS3231_4096HZ = 0x01,
DS3231_8192HZ = 0x02,
DS3231_32768HZ = 0x03
} DS3231_sqw_t;
typedef enum
{
DS3231_EVERY_SECOND = 0b00001111,
DS3231_MATCH_S = 0b00001110,
DS3231_MATCH_M_S = 0b00001100,
DS3231_MATCH_H_M_S = 0b00001000,
DS3231_MATCH_DT_H_M_S = 0b00000000,
DS3231_MATCH_DY_H_M_S = 0b00010000
} DS3231_alarm1_t;
typedef enum
{
DS3231_EVERY_MINUTE = 0b00001110,
DS3231_MATCH_M = 0b00001100,
DS3231_MATCH_H_M = 0b00001000,
DS3231_MATCH_DT_H_M = 0b00000000,
DS3231_MATCH_DY_H_M = 0b00010000
} DS3231_alarm2_t;
class DS3231 : public IRTCI2c
{
public:
DS3231() { setAddress(DS3231_ADDRESS); }
bool begin(uint8_t addr);
void adjustRtc(const char *date, const char *time)
{
setDateTime(date, time);
}
void adjustRtc(uint16_t year, uint8_t month, uint8_t day, uint8_t week,
uint8_t hour, uint8_t minute, uint8_t second)
{
setDateTime(year, month, day, hour, minute, second);
}
DateTime toDateTime() {
return DateTime(t.year, t.month, t.day, t.hour, t.minute, t.second, 0);
}
void update() { getDateTime(); }
void setDateTime(uint16_t year, uint8_t month, uint8_t day, uint8_t hour, uint8_t minute, uint8_t second);
void setDateTime(uint32_t t);
void setDateTime(const char *date, const char *time);
RTCDateTime getDateTime(void);
uint8_t isReady(void);
DS3231_sqw_t getOutput(void);
void setOutput(DS3231_sqw_t mode);
void enableOutput(bool enabled);
bool isOutput(void);
void enable32kHz(bool enabled);
bool is32kHz(void);
void forceConversion(void);
float readTemperature(void);
void setAlarm1(uint8_t dydw, uint8_t hour, uint8_t minute, uint8_t second, DS3231_alarm1_t mode, bool armed = true);
RTCAlarmTime getAlarm1(void);
DS3231_alarm1_t getAlarmType1(void);
bool isAlarm1(bool clear = true);
void armAlarm1(bool armed);
bool isArmed1(void);
void clearAlarm1(void);
void setAlarm2(uint8_t dydw, uint8_t hour, uint8_t minute, DS3231_alarm2_t mode, bool armed = true);
RTCAlarmTime getAlarm2(void);
DS3231_alarm2_t getAlarmType2(void);
bool isAlarm2(bool clear = true);
void armAlarm2(bool armed);
bool isArmed2(void);
void clearAlarm2(void);
void setBattery(bool timeBattery, bool squareBattery);
char *dateFormat(const char *dateFormat, RTCDateTime dt);
char *dateFormat(const char *dateFormat, RTCAlarmTime dt);
private:
RTCDateTime t;
const char *strDayOfWeek(uint8_t dayOfWeek);
const char *strMonth(uint8_t month);
const char *strAmPm(uint8_t hour, bool uppercase);
const char *strDaySufix(uint8_t day);
uint8_t hour12(uint8_t hour24);
uint8_t bcd2dec(uint8_t bcd);
uint8_t dec2bcd(uint8_t dec);
long time2long(uint16_t days, uint8_t hours, uint8_t minutes, uint8_t seconds);
uint16_t date2days(uint16_t year, uint8_t month, uint8_t day);
uint8_t daysInMonth(uint16_t year, uint8_t month);
uint16_t dayInYear(uint16_t year, uint8_t month, uint8_t day);
bool isLeapYear(uint16_t year);
uint8_t dow(uint16_t y, uint8_t m, uint8_t d);
uint32_t unixtime(void);
uint8_t conv2d(const char *p);
void writeRegister8(uint8_t reg, uint8_t value);
uint8_t readRegister8(uint8_t reg);
};
#endif | [
"jpolanco@getinsoft.com"
] | jpolanco@getinsoft.com |
8941dd4bc5c44ecea99d09758ac4f1ab23a291c6 | b5ca0a2ce47fdb4306bbdffcb995eb7e6eac1b23 | /30DaysofCode/Day 5 Loops/CPP/Day5.cpp | 095d065564d94c5dc2f3446e507f0b9e8c9be04b | [] | no_license | rsoemardja/HackerRank | ac257a66c3649534197b223b8ab55011d84fb9e1 | 97d28d648a85a16fbe6a5d6ae72ff6503a063ffc | refs/heads/master | 2022-04-14T22:46:03.412359 | 2020-04-03T07:44:04 | 2020-04-03T07:44:04 | 217,687,370 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 577 | cpp | #include <map>
#include <set>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <bitset>
#include <cstdio>
#include <limits>
#include <vector>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <fstream>
#include <numeric>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <unordered_map>
using namespace std;
int main() {
int n, x;
cin >> n;
for (x = 1; x <= 10; x++) {
int result = n * x;
cout << n << " x " << x << " = " << << endl
}
return 0;
} | [
"rsoemardja@gmail.com"
] | rsoemardja@gmail.com |
bdb0de35f924789ced10ef8a3f497ae726ce5d49 | 487fd495fec491acb04453255c870808d037f889 | /src/blob_uint256.h | ea39f721452d196be20b2299726dd0a47efcf509 | [
"MIT"
] | permissive | TechDude2u/GSAcoin | 58b94eba767f6e17c8a88bcf0ee3b4cea719657a | c0a64da39501a52f25e709368a869d743f77221d | refs/heads/main | 2023-08-08T04:03:42.198250 | 2021-09-21T16:27:42 | 2021-09-21T16:27:42 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,109 | h | // Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2014 The Bitcoin developers
// Copyright (c) 2014-2015 The Dash developers
// Copyright (c) 2015-2018 The PIVX developers
// Copyright (c) 2021 The GLOBALSMARTASSET Core Developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef PIVX_BLOB_UINT256_H
#define PIVX_BLOB_UINT256_H
#include <assert.h>
#include <cstring>
#include <stdexcept>
#include <stdint.h>
#include <string>
#include <vector>
/** Template base class for fixed-sized opaque blobs. */
template<unsigned int BITS>
class base_blob
{
public:
// todo: make this protected
enum { WIDTH=BITS/8 };
uint8_t data[WIDTH];
base_blob()
{
SetNull();
}
explicit base_blob(const std::vector<unsigned char>& vch);
bool IsNull() const
{
for (int i = 0; i < WIDTH; i++)
if (data[i] != 0)
return false;
return true;
}
void SetNull()
{
memset(data, 0, sizeof(data));
}
friend inline bool operator==(const base_blob& a, const base_blob& b) { return memcmp(a.data, b.data, sizeof(a.data)) == 0; }
friend inline bool operator!=(const base_blob& a, const base_blob& b) { return memcmp(a.data, b.data, sizeof(a.data)) != 0; }
friend inline bool operator<(const base_blob& a, const base_blob& b) { return memcmp(a.data, b.data, sizeof(a.data)) < 0; }
std::string GetHex() const;
void SetHex(const char* psz);
void SetHex(const std::string& str);
std::string ToString() const;
unsigned char* begin()
{
return &data[0];
}
unsigned char* end()
{
return &data[WIDTH];
}
const unsigned char* begin() const
{
return &data[0];
}
const unsigned char* end() const
{
return &data[WIDTH];
}
unsigned int size() const
{
return sizeof(data);
}
uint64_t GetUint64(int pos) const
{
const uint8_t* ptr = data + pos * 8;
return ((uint64_t)ptr[0]) | \
((uint64_t)ptr[1]) << 8 | \
((uint64_t)ptr[2]) << 16 | \
((uint64_t)ptr[3]) << 24 | \
((uint64_t)ptr[4]) << 32 | \
((uint64_t)ptr[5]) << 40 | \
((uint64_t)ptr[6]) << 48 | \
((uint64_t)ptr[7]) << 56;
}
template<typename Stream>
void Serialize(Stream& s) const
{
s.write((char*)data, sizeof(data));
}
template<typename Stream>
void Unserialize(Stream& s)
{
s.read((char*)data, sizeof(data));
}
};
/** 88-bit opaque blob.
*/
class blob88 : public base_blob<88> {
public:
blob88() {}
blob88(const base_blob<88>& b) : base_blob<88>(b) {}
explicit blob88(const std::vector<unsigned char>& vch) : base_blob<88>(vch) {}
};
/** 160-bit opaque blob.
* @note This type is called uint160 for historical reasons only. It is an opaque
* blob of 160 bits and has no integer operations.
*/
class blob_uint160 : public base_blob<160> {
public:
blob_uint160() {}
blob_uint160(const base_blob<160>& b) : base_blob<160>(b) {}
explicit blob_uint160(const std::vector<unsigned char>& vch) : base_blob<160>(vch) {}
};
/** 256-bit opaque blob.
* @note This type is called uint256 for historical reasons only. It is an
* opaque blob of 256 bits and has no integer operations. Use arith_uint256 if
* those are required.
*/
class blob_uint256 : public base_blob<256> {
public:
blob_uint256() {}
blob_uint256(const base_blob<256>& b) : base_blob<256>(b) {}
explicit blob_uint256(const std::vector<unsigned char>& vch) : base_blob<256>(vch) {}
/** A cheap hash function that just returns 64 bits from the result, it can be
* used when the contents are considered uniformly random. It is not appropriate
* when the value can easily be influenced from outside as e.g. a network adversary could
* provide values to trigger worst-case behavior.
* @note The result of this function is not stable between little and big endian.
*/
uint64_t GetCheapHash() const
{
uint64_t result;
memcpy((void*)&result, (void*)data, 8);
return result;
}
};
/* uint256 from const char *.
* This is a separate function because the constructor uint256(const char*) can result
* in dangerously catching uint256(0).
*/
inline blob_uint256 blob_uint256S(const char *str)
{
blob_uint256 rv;
rv.SetHex(str);
return rv;
}
/* uint256 from std::string.
* This is a separate function because the constructor uint256(const std::string &str) can result
* in dangerously catching uint256(0) via std::string(const char*).
*/
inline blob_uint256 blob_uint256S(const std::string& str)
{
return blob_uint256S(str.c_str());
}
/** constant uint256 instances */
const blob_uint256 BLOB_UINT256_ZERO = blob_uint256();
const blob_uint256 BLOB_UINT256_ONE = blob_uint256S("0000000000000000000000000000000000000000000000000000000000000001");
#endif // PIVX_BLOB_UINT256_H
| [
"gsasset24@gmail.com"
] | gsasset24@gmail.com |
f19be2c8a5f0fd076d477e90babf5db3f80e12e8 | 2f659427568d868d4325ee4204f6cabaac3cf8be | /PVSupport/Sources/PVSupport/Audio/CARingBuffer/CARingBuffer.cpp | 8758cabeb91d77b7dcc7f16bc71e5de3a6d99ae5 | [
"BSD-2-Clause"
] | permissive | thalter/Provenance | 5e45d0c73fd9a7c2f506372b4d7686b0fe212493 | edee9ab6167c292ea1aa305364e4d67605fa3593 | refs/heads/develop | 2022-11-06T23:20:38.478801 | 2022-11-05T14:11:04 | 2022-11-05T14:11:04 | 230,656,209 | 0 | 0 | NOASSERTION | 2019-12-29T17:54:04 | 2019-12-28T19:34:27 | null | UTF-8 | C++ | false | false | 11,129 | cpp | /*
File: CARingBuffer.cpp
Abstract: CARingBuffer.h
Version: 1.1
Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
Inc. ("Apple") in consideration of your agreement to the following
terms, and your use, installation, modification or redistribution of
this Apple software constitutes acceptance of these terms. If you do
not agree with these terms, please do not use, install, modify or
redistribute this Apple software.
In consideration of your agreement to abide by the following terms, and
subject to these terms, Apple grants you a personal, non-exclusive
license, under Apple's copyrights in this original Apple software (the
"Apple Software"), to use, reproduce, modify and redistribute the Apple
Software, with or without modifications, in source and/or binary forms;
provided that if you redistribute the Apple Software in its entirety and
without modifications, you must retain this notice and the following
text and disclaimers in all such redistributions of the Apple Software.
Neither the name, trademarks, service marks or logos of Apple Inc. may
be used to endorse or promote products derived from the Apple Software
without specific prior written permission from Apple. Except as
expressly stated in this notice, no other rights or licenses, express or
implied, are granted by Apple herein, including but not limited to any
patent rights that may be infringed by your derivative works or by other
works in which the Apple Software may be incorporated.
The Apple Software is provided by Apple on an "AS IS" basis. APPLE
MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Copyright (C) 2014 Apple Inc. All Rights Reserved.
*/
#include "CARingBuffer.h"
#include "CABitOperations.h"
#include "CAAutoDisposer.h"
//#include "CAAtomic.h"
#if DEBUG
#define CALOG printf
#else
#define CALOG
#endif
#include <stdlib.h>
#include <string.h>
#include <algorithm>
#include <libkern/OSAtomic.h>
CARingBuffer::CARingBuffer() :
mBuffers(NULL), mNumberChannels(0), mCapacityFrames(0), mCapacityBytes(0)
{
}
CARingBuffer::~CARingBuffer()
{
Deallocate();
}
void CARingBuffer::Allocate(int nChannels, UInt32 bytesPerFrame, UInt32 capacityFrames)
{
Deallocate();
capacityFrames = NextPowerOfTwo(capacityFrames);
mNumberChannels = nChannels;
mBytesPerFrame = bytesPerFrame;
mCapacityFrames = capacityFrames;
mCapacityFramesMask = capacityFrames - 1;
mCapacityBytes = bytesPerFrame * capacityFrames;
// put everything in one memory allocation, first the pointers, then the deinterleaved channels
UInt32 allocSize = (mCapacityBytes + sizeof(Byte *)) * nChannels;
Byte *p = (Byte *)CA_malloc(allocSize);
memset(p, 0, allocSize);
mBuffers = (Byte **)p;
p += nChannels * sizeof(Byte *);
for (int i = 0; i < nChannels; ++i) {
mBuffers[i] = p;
p += mCapacityBytes;
}
for (UInt32 i = 0; i<kGeneralRingTimeBoundsQueueSize; ++i)
{
mTimeBoundsQueue[i].mStartTime = 0;
mTimeBoundsQueue[i].mEndTime = 0;
mTimeBoundsQueue[i].mUpdateCounter = 0;
}
mTimeBoundsQueuePtr = 0;
}
void CARingBuffer::Deallocate()
{
if (mBuffers) {
free(mBuffers);
mBuffers = NULL;
}
mNumberChannels = 0;
mCapacityBytes = 0;
mCapacityFrames = 0;
}
inline void ZeroRange(Byte **buffers, int nchannels, int offset, int nbytes)
{
while (--nchannels >= 0) {
memset(*buffers + offset, 0, nbytes);
++buffers;
}
}
inline void StoreABL(Byte **buffers, int destOffset, const AudioBufferList *abl, int srcOffset, int nbytes)
{
int nchannels = abl->mNumberBuffers;
const AudioBuffer *src = abl->mBuffers;
while (--nchannels >= 0) {
if (srcOffset > (int)src->mDataByteSize) continue;
memcpy(*buffers + destOffset, (Byte *)src->mData + srcOffset, std::min(nbytes, (int)src->mDataByteSize - srcOffset));
++buffers;
++src;
}
}
inline void FetchABL(AudioBufferList *abl, int destOffset, Byte **buffers, int srcOffset, int nbytes)
{
int nchannels = abl->mNumberBuffers;
AudioBuffer *dest = abl->mBuffers;
while (--nchannels >= 0) {
if (destOffset > (int)dest->mDataByteSize) continue;
memcpy((Byte *)dest->mData + destOffset, *buffers + srcOffset, std::min(nbytes, (int)dest->mDataByteSize - destOffset));
++buffers;
++dest;
}
}
inline void ZeroABL(AudioBufferList *abl, int destOffset, int nbytes)
{
int nBuffers = abl->mNumberBuffers;
AudioBuffer *dest = abl->mBuffers;
while (--nBuffers >= 0) {
if (destOffset > (int)dest->mDataByteSize) continue;
memset((Byte *)dest->mData + destOffset, 0, std::min(nbytes, (int)dest->mDataByteSize - destOffset));
++dest;
}
}
CARingBufferError CARingBuffer::Store(const AudioBufferList *abl, UInt32 framesToWrite, SampleTime startWrite)
{
if (framesToWrite == 0) {
CALOG("no frames to write\n");
return kCARingBufferError_OK;
}
if (framesToWrite > mCapacityFrames) {
CALOG("no frames to write\n");
return kCARingBufferError_TooMuch; // too big!
}
SampleTime endWrite = startWrite + framesToWrite;
if (startWrite < EndTime()) {
CALOG("// going backwards, throw everything out\n");
// going backwards, throw everything out
SetTimeBounds(startWrite, startWrite);
} else if (endWrite - StartTime() <= mCapacityFrames) {
CALOG("//the buffer has not yet wrapped and will not need to\n");
// the buffer has not yet wrapped and will not need to
} else {
// advance the start time past the region we are about to overwrite
SampleTime newStart = endWrite - mCapacityFrames; // one buffer of time behind where we're writing
SampleTime newEnd = std::max(newStart, EndTime());
SetTimeBounds(newStart, newEnd);
CALOG("// advance the start time past the region we are about to overwrite\n");
}
// write the new frames
Byte **buffers = mBuffers;
int nchannels = mNumberChannels;
int offset0, offset1, nbytes;
SampleTime curEnd = EndTime();
if (startWrite > curEnd) {
// we are skipping some samples, so zero the range we are skipping
offset0 = FrameOffset(curEnd);
offset1 = FrameOffset(startWrite);
if (offset0 < offset1)
ZeroRange(buffers, nchannels, offset0, offset1 - offset0);
else {
ZeroRange(buffers, nchannels, offset0, mCapacityBytes - offset0);
ZeroRange(buffers, nchannels, 0, offset1);
}
offset0 = offset1;
} else {
offset0 = FrameOffset(startWrite);
}
offset1 = FrameOffset(endWrite);
if (offset0 < offset1)
StoreABL(buffers, offset0, abl, 0, offset1 - offset0);
else {
nbytes = mCapacityBytes - offset0;
StoreABL(buffers, offset0, abl, 0, nbytes);
StoreABL(buffers, 0, abl, nbytes, offset1);
}
// now update the end time
SetTimeBounds(StartTime(), endWrite);
return kCARingBufferError_OK; // success
}
#include <atomic>
void CARingBuffer::SetTimeBounds(SampleTime startTime, SampleTime endTime)
{
UInt32 nextPtr = mTimeBoundsQueuePtr + 1;
UInt32 index = nextPtr & kGeneralRingTimeBoundsQueueMask;
mTimeBoundsQueue[index].mStartTime = startTime;
mTimeBoundsQueue[index].mEndTime = endTime;
mTimeBoundsQueue[index].mUpdateCounter = nextPtr;
// std::atomic_compare_exchange_strong((volatile int32_t *)&mTimeBoundsQueuePtr, mTimeBoundsQueuePtr, mTimeBoundsQueuePtr + 1);
OSAtomicCompareAndSwap32Barrier(mTimeBoundsQueuePtr, mTimeBoundsQueuePtr + 1, (volatile int32_t *)&mTimeBoundsQueuePtr);
// CAAtomicCompareAndSwap32Barrier(mTimeBoundsQueuePtr, mTimeBoundsQueuePtr + 1, (SInt32*)&mTimeBoundsQueuePtr);
}
CARingBufferError CARingBuffer::GetTimeBounds(SampleTime &startTime, SampleTime &endTime)
{
for (int i=0; i<8; ++i) // fail after a few tries.
{
UInt32 curPtr = mTimeBoundsQueuePtr;
UInt32 index = curPtr & kGeneralRingTimeBoundsQueueMask;
CARingBuffer::TimeBounds* bounds = mTimeBoundsQueue + index;
startTime = bounds->mStartTime;
endTime = bounds->mEndTime;
UInt32 newPtr = bounds->mUpdateCounter;
if (newPtr == curPtr)
return kCARingBufferError_OK;
}
return kCARingBufferError_CPUOverload;
}
CARingBufferError CARingBuffer::ClipTimeBounds(SampleTime& startRead, SampleTime& endRead)
{
SampleTime startTime, endTime;
CARingBufferError err = GetTimeBounds(startTime, endTime);
if (err) return err;
if (startRead > endTime || endRead < startTime) {
if (startRead > endTime) {
CALOG("!! startRead is too big by %lli\n", startRead - endTime);
}
if(endTime < startTime) {
CALOG("!! endRead is too small by %lli\n", startTime - endRead);
}
endRead = startRead;
return kCARingBufferError_OK;
}
startRead = std::max(startRead, startTime);
endRead = std::min(endRead, endTime);
endRead = std::max(endRead, startRead);
return kCARingBufferError_OK; // success
}
CARingBufferError CARingBuffer::Fetch(AudioBufferList *abl, UInt32 nFrames, SampleTime startRead)
{
if (nFrames == 0) {
CALOG("Fetch zero frames\n");
return kCARingBufferError_OK;
}
startRead = std::max(0LL, startRead);
SampleTime endRead = startRead + nFrames;
SampleTime startRead0 = startRead;
SampleTime endRead0 = endRead;
CARingBufferError err = ClipTimeBounds(startRead, endRead);
if (err) {
assert("Fetch ClipTimeBounds erred\n");
CALOG("Fetch ClipTimeBounds erred\n");
return err;
}
if (startRead == endRead) {
CALOG("Fetch start == end!\n");
ZeroABL(abl, 0, nFrames * mBytesPerFrame);
return kCARingBufferError_OK;
}
SInt32 byteSize = (SInt32)((endRead - startRead) * mBytesPerFrame);
SInt32 destStartByteOffset = std::max((SInt32)0, (SInt32)((startRead - startRead0) * mBytesPerFrame));
if (destStartByteOffset > 0) {
ZeroABL(abl, 0, std::min((SInt32)(nFrames * mBytesPerFrame), destStartByteOffset));
}
SInt32 destEndSize = std::max((SInt32)0, (SInt32)(endRead0 - endRead));
if (destEndSize > 0) {
ZeroABL(abl, destStartByteOffset + byteSize, destEndSize * mBytesPerFrame);
}
Byte **buffers = mBuffers;
int offset0 = FrameOffset(startRead);
int offset1 = FrameOffset(endRead);
int nbytes;
if (offset0 < offset1) {
nbytes = offset1 - offset0;
FetchABL(abl, destStartByteOffset, buffers, offset0, nbytes);
} else {
nbytes = mCapacityBytes - offset0;
FetchABL(abl, destStartByteOffset, buffers, offset0, nbytes);
FetchABL(abl, destStartByteOffset + nbytes, buffers, 0, offset1);
nbytes += offset1;
}
int nchannels = abl->mNumberBuffers;
AudioBuffer *dest = abl->mBuffers;
while (--nchannels >= 0)
{
dest->mDataByteSize = nbytes;
dest++;
}
CALOG("Fetch normal return\n");
return noErr;
}
| [
"mail@joemattiello.com"
] | mail@joemattiello.com |
7dc9782f0ee8720fc897f2ad2410f2f621420e17 | 8977511cbdf127e3773db9ce7e91ee6b29fd052e | /src/sst/core/paramsInfo.h | 359aedc2fc8e1d4fcaa9042b4a3b6b8b262afd31 | [
"BSD-3-Clause"
] | permissive | AlecGrover/sst-core | 823cdfe0433de79ec7c99e72e9141983699b90b3 | 3d5607f75f8912107246af8c38bc70c85e67915e | refs/heads/master | 2020-04-30T06:15:02.252739 | 2019-03-09T14:48:10 | 2019-03-09T14:48:10 | 176,646,664 | 0 | 0 | NOASSERTION | 2019-03-20T03:36:13 | 2019-03-20T03:36:12 | null | UTF-8 | C++ | false | false | 2,263 | h | #ifndef SST_CORE_PARAMS_INFO_H
#define SST_CORE_PARAMS_INFO_H
#include <vector>
#include <string>
#include <sst/core/params.h>
#include <sst/core/elibase.h>
#include <sst/core/oldELI.h>
namespace SST {
namespace ELI {
template <class T, class Enable=void>
struct GetParams {
static const std::vector<SST::ElementInfoParam>& get() {
static std::vector<SST::ElementInfoParam> var = { };
return var;
}
};
template <class T>
struct GetParams<T,
typename MethodDetect<decltype(T::ELI_getParams())>::type> {
static const std::vector<SST::ElementInfoParam>& get() {
return T::ELI_getParams();
}
};
class ProvidesParams {
public:
const std::vector<ElementInfoParam>& getValidParams() const {
return params_;
}
void toString(std::ostream& os) const;
template <class XMLNode> void outputXML(XMLNode* node) const {
// Build the Element to Represent the Component
int idx = 0;
for (const ElementInfoParam& param : params_){;
// Build the Element to Represent the Parameter
auto* XMLParameterElement = new XMLNode("Parameter");
XMLParameterElement->SetAttribute("Index", idx);
XMLParameterElement->SetAttribute("Name", param.name);
XMLParameterElement->SetAttribute("Description", param.description ? param.description : "none");
XMLParameterElement->SetAttribute("Default", param.defaultValue ? param.defaultValue : "none");
node->LinkEndChild(XMLParameterElement);
++idx;
}
}
const Params::KeySet_t& getParamNames() const {
return allowedKeys;
}
protected:
template <class T> ProvidesParams(T* UNUSED(t)) :
params_(GetParams<T>::get())
{
init();
}
template <class U> ProvidesParams(OldELITag& UNUSED(tag), U* u)
{
auto *p = u->params;
while (NULL != p && NULL != p->name) {
params_.emplace_back(*p);
p++;
}
init();
}
private:
void init();
Params::KeySet_t allowedKeys;
std::vector<ElementInfoParam> params_;
};
}
}
#define SST_ELI_DOCUMENT_PARAMS(...) \
static const std::vector<SST::ElementInfoParam>& ELI_getParams() { \
static std::vector<SST::ElementInfoParam> var = { __VA_ARGS__ } ; \
return var; \
}
#endif
| [
"jjwilke@sandia.gov"
] | jjwilke@sandia.gov |
02c90c66a3aa95bdaf701043068c35e02b9c40de | d2d6aae454fd2042c39127e65fce4362aba67d97 | /build/Android/Release/EventApp/app/src/main/include/_root.EventApp_FuseElementsElement_Alignment_Property.h | 61cffe5eb56417ad196c656d2c9552f194f942f7 | [] | no_license | Medbeji/Eventy | de88386ff9826b411b243d7719b22ff5493f18f5 | 521261bca5b00ba879e14a2992e6980b225c50d4 | refs/heads/master | 2021-01-23T00:34:16.273411 | 2017-09-24T21:16:34 | 2017-09-24T21:16:34 | 92,812,809 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,001 | h | // This file was generated based on '.uno/ux11/EventApp.unoproj.g.uno'.
// WARNING: Changes might be lost if you edit this file directly.
#pragma once
#include <Fuse.Elements.Alignment.h>
#include <Uno.UX.Property-1.h>
namespace g{namespace Fuse{namespace Elements{struct Element;}}}
namespace g{namespace Uno{namespace UX{struct PropertyObject;}}}
namespace g{namespace Uno{namespace UX{struct Selector;}}}
namespace g{struct EventApp_FuseElementsElement_Alignment_Property;}
namespace g{
// internal sealed class EventApp_FuseElementsElement_Alignment_Property :28
// {
::g::Uno::UX::Property1_type* EventApp_FuseElementsElement_Alignment_Property_typeof();
void EventApp_FuseElementsElement_Alignment_Property__ctor_2_fn(EventApp_FuseElementsElement_Alignment_Property* __this, ::g::Fuse::Elements::Element* obj, ::g::Uno::UX::Selector* name);
void EventApp_FuseElementsElement_Alignment_Property__Get_fn(EventApp_FuseElementsElement_Alignment_Property* __this, int* __retval);
void EventApp_FuseElementsElement_Alignment_Property__New1_fn(::g::Fuse::Elements::Element* obj, ::g::Uno::UX::Selector* name, EventApp_FuseElementsElement_Alignment_Property** __retval);
void EventApp_FuseElementsElement_Alignment_Property__get_Object_fn(EventApp_FuseElementsElement_Alignment_Property* __this, ::g::Uno::UX::PropertyObject** __retval);
void EventApp_FuseElementsElement_Alignment_Property__Set_fn(EventApp_FuseElementsElement_Alignment_Property* __this, int* v, uObject* origin);
void EventApp_FuseElementsElement_Alignment_Property__get_SupportsOriginSetter_fn(EventApp_FuseElementsElement_Alignment_Property* __this, bool* __retval);
struct EventApp_FuseElementsElement_Alignment_Property : ::g::Uno::UX::Property1
{
uWeak< ::g::Fuse::Elements::Element*> _obj;
void ctor_2(::g::Fuse::Elements::Element* obj, ::g::Uno::UX::Selector name);
static EventApp_FuseElementsElement_Alignment_Property* New1(::g::Fuse::Elements::Element* obj, ::g::Uno::UX::Selector name);
};
// }
} // ::g
| [
"medbeji@MacBook-Pro-de-MedBeji.local"
] | medbeji@MacBook-Pro-de-MedBeji.local |
5cbfc9aa50d8bcb4fd4a233ee7c16620212e6206 | 7d493004e366ffb85cb10d80c317761f759f7cd2 | /DM2231_Base_Framework/App/Source/Scene3D/AmmoPickup.cpp | 399e5343d98b18c74361aa9618fda227339fbb5a | [] | no_license | Strigon009/SP3 | 6ad0205df86bb88f457c5e47a6a435211c9ba0d2 | 2dbae6d52bdf9d4f3dcf8f171d917dbfea108a97 | refs/heads/master | 2022-12-04T06:06:46.189635 | 2020-08-26T09:03:29 | 2020-08-26T09:03:29 | 287,884,271 | 0 | 1 | null | 2020-08-19T02:54:52 | 2020-08-16T06:03:37 | C++ | UTF-8 | C++ | false | false | 6,576 | cpp | /**
CAmmoPickup
By: Toh Da Jun
Date: Apr 2020
*/
#include "AmmoPickup.h"
#include "System/LoadOBJ.h"
#include <iostream>
using namespace std;
/**
@brief Default Constructor
*/
CAmmoPickup::CAmmoPickup(void)
: cGroundMap(NULL)
, cPlayer3D(NULL)
, iAddAmmo(30)
{
// Set the default position to the origin
vec3Position = glm::vec3(0.0f, 0.5f, 0.0f);
}
/**
@brief Constructor with vectors
@param vec3Position A const glm::vec3 variable which contains the position of the camera
@param vec3Front A const glm::vec3 variable which contains the up direction of the camera
@param yaw A const float variable which contains the yaw of the camera
@param pitch A const float variable which contains the pitch of the camera
*/
CAmmoPickup::CAmmoPickup(const glm::vec3 vec3Position,
const glm::vec3 vec3Front,
const float fYaw,
const float fPitch)
: cGroundMap(NULL)
{
// Set the default position to the origin
this->vec3Position = vec3Position;
}
/**
@brief Destructor
*/
CAmmoPickup::~CAmmoPickup(void)
{
if (cGroundMap)
{
// We set it to NULL only since it was declared somewhere else
cGroundMap = NULL;
}
cPlayer3D = NULL;
// Delete the rendering objects in the graphics card
glDeleteVertexArrays(1, &VAO);
glDeleteBuffers(1, &VBO);
}
/**
@brief Initialise this class instance
@return true is successfully initialised this class instance, else false
*/
bool CAmmoPickup::Init(void)
{
// Check if the shader is ready
if (!cShader)
{
cout << "CAmmoPickup::Init(): The shader is not available for this class instance." << endl;
return false;
}
// Call the parent's Init()
CEntity3D::Init();
// Initialise the cPlayer3D
cPlayer3D = CPlayer3D::GetInstance();
// Set the type
SetType(CEntity3D::TYPE::AMMO_PICKUP);
std::vector<glm::vec3> vertices;
std::vector <glm::vec2> uvs;
std::vector<glm::vec3> normals;
vec3Scale = glm::vec3(1, 1, 1);
vec3ColliderScale = glm::vec3(1, 1.5f, 1);
std::string file_path = "OBJ/AmmoCrate.obj";
bool success = LoadOBJ(file_path.c_str(), vertices, uvs, normals);
if (!success)
return NULL;
std::vector <Vertex> vertex_buffer_data;
std::vector <GLuint> index_buffer_data;
IndexVBO(vertices, uvs, normals, index_buffer_data, vertex_buffer_data);
glGenVertexArrays(1, &VAO);
glBindVertexArray(VAO);
glGenBuffers(1, &VBO);
glGenBuffers(1, &IBO);
glBindBuffer(GL_ARRAY_BUFFER, VBO);
glBufferData(GL_ARRAY_BUFFER, vertex_buffer_data.size() * sizeof(Vertex), &vertex_buffer_data[0], GL_STATIC_DRAW);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, IBO);
glBufferData(GL_ELEMENT_ARRAY_BUFFER, index_buffer_data.size() * sizeof(GLuint), &index_buffer_data[0], GL_STATIC_DRAW);
index_buffer_size = index_buffer_data.size();
// load and create a texture
iTextureID = LoadTexture("Image/AmmoCrate.tga");
if (iTextureID == 0)
{
cout << "Unable to load Image/AmmoCrate.tga" << endl; // Change file
return false;
}
return true;
}
/**
@brief Set model
@param model A glm::mat4 variable containing the model for this class instance
*/
void CAmmoPickup::SetModel(glm::mat4 model)
{
this->model = model;
}
/**
@brief Set view
@param view A glm::mat4 variable containing the model for this class instance
*/
void CAmmoPickup::SetView(glm::mat4 view)
{
this->view = view;
}
/**
@brief Set projection
@param projection A glm::mat4 variable containing the model for this class instance
*/
void CAmmoPickup::SetProjection(glm::mat4 projection)
{
this->projection = projection;
}
/**
@brief Update this class instance
*/
void CAmmoPickup::Update(const double dElapsedTime)
{
vec3ColliderScale = vec3Scale;
}
/**
@brief Activate the CCollider for this class instance
@param cLineShader A Shader* variable which stores a shader which renders lines
*/
void CAmmoPickup::ActivateCollider(Shader* cLineShader)
{
// Create a new CCollider
cCollider = new CCollider();
// Set the colour of the CCollider to Blue
cCollider->vec4Colour = glm::vec4(0.0f, 0.0f, 1.0f, 1.0f);
// Initialise the cCollider
cCollider->Init();
// Set a shader to it
cCollider->SetLineShader(cLineShader);
}
/**
@brief PreRender Set up the OpenGL display environment before rendering
*/
void CAmmoPickup::PreRender(void)
{
// Draw this as last
glDepthFunc(GL_LEQUAL); // change depth function so depth test passes when values are equal to depth buffer's content
}
/**
@brief Render Render this instance
@param cShader A Shader* variable which contains the Shader to use in this class instance
*/
void CAmmoPickup::Render(void)
{
// If the shader is in this class, then do not render
if (!cShader)
{
cout << "CAmmoPickup::Render(): The shader is not available for this class instance." << endl;
return;
}
// Activate shader
cShader->use();
// bind textures on corresponding texture units
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, iTextureID);
//int angle = 90;
// create transformations
model = glm::mat4(1.0f); // make sure to initialize matrix to identity matrix first
//model = glm::rotate(model, glm::radians(90.f), glm::vec3(0.0f, 1.0f, 0.0f));
model = glm::translate(model, vec3Position);
model = glm::scale(model, vec3Scale);
// note: currently we set the projection matrix each frame, but since the projection
// matrix rarely changes it's often best practice to set it outside the main loop only once.
cShader->setMat4("projection", projection);
cShader->setMat4("view", view);
cShader->setMat4("model", model);
//// render boxes
//glBindVertexArray(VAO);
//glDrawArrays(GL_TRIANGLES, 0, 36);
glBindVertexArray(VAO);
//glDrawArrays(GL_TRIANGLES, 0, 36);
glEnableVertexAttribArray(0);
glEnableVertexAttribArray(1);
glBindBuffer(GL_ARRAY_BUFFER, VBO);
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, sizeof(Vertex), (void*)0);
glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, sizeof(Vertex), (void*)(sizeof(glm::vec3)));
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, IBO);
glDrawElements(GL_TRIANGLES, index_buffer_size, GL_UNSIGNED_INT, 0);
glDisableVertexAttribArray(1);
glDisableVertexAttribArray(0);
// Render the CCollider if needed
if ((cCollider) && (cCollider->bIsDisplayed))
{
cCollider->model = model;
cCollider->view = view;
cCollider->projection = projection;
cCollider->Render();
}
}
/**
@brief PostRender Set up the OpenGL display environment after rendering.
*/
void CAmmoPickup::PostRender(void)
{
glDepthFunc(GL_LESS); // set depth function back to default
}
void CAmmoPickup::SetAddAmmo(const int iAddAmmo)
{
this->iAddAmmo = iAddAmmo;
}
int CAmmoPickup::GetAddAmmo(void) const
{
return iAddAmmo;
} | [
"42129076+Strigon009@users.noreply.github.com"
] | 42129076+Strigon009@users.noreply.github.com |
37efe374fe7ea5e2b0ba6b0a2ff0c6f55a31dba5 | ac7c2e64fa66ec7aecc9cf810cb2bf013fd412c0 | /Baruch_C++/Level_5/Section_3_5/Ex_3_5_3/Shape.hpp | 0cc41c14f69c0a04887578ea4befbc81ca698d14 | [] | no_license | mistletoe999/cpp-samples | e7219fcf7dbfe5ddc81cb527f08cd9d55149774a | 7b5cb634c70d3de476c0d43e15f7a045458dc925 | refs/heads/master | 2020-12-25T15:40:30.402680 | 2015-06-23T04:32:50 | 2015-06-23T04:32:50 | 40,014,976 | 0 | 1 | null | 2015-07-31T16:43:13 | 2015-07-31T16:43:10 | C++ | UTF-8 | C++ | false | false | 923 | hpp | // Shape.hpp: Contains the definition for Shape class
// Shape class is the Base class for Point, Line and Circle classes
// EDIT: Destructor changed to virtual function
#ifndef SHAPE_HPP_
#define SHAPE_HPP_
#include <iostream>
#include <string>
#include <sstream>
#include <stdlib.h>
using namespace std;
namespace KAPIL
{
namespace CAD
{
class Shape {
private:
int m_id; // ID number for the shape. Generated Randomly
public:
// Constructors
Shape(); // Default Constructor
Shape(const Shape& shape); // Copy Constructor
// Destructor
virtual ~Shape(); // Virtual Destructor
// Other member Functions
int ID(); // Getter function for m_id
virtual string ToString() const; // Gives a string representation of the Shape as ID: 123"
// Operators
Shape& operator=(const Shape& source); // Assignment Operator
};
}
}
#endif // SHAPE_HPP_ | [
"kapil12@outlook.com"
] | kapil12@outlook.com |
dd91772e559bbe16d51bb0c3949e753e1c4acd46 | dba6bd79d088be92e21795d7fc97f9da01c2cc6c | /io.cpp | 935d09461db846992c7aee917045d7b0e0220567 | [
"MIT"
] | permissive | MahirSez/CSE-Fest-AI-Contest-2019 | 4c4ccc63eed5144a609030a0f471d6d2fa2feb52 | 439de04f0015934b1537b856b3a167bb06e8c871 | refs/heads/master | 2020-04-19T22:11:12.589555 | 2019-01-31T05:57:56 | 2019-01-31T05:57:56 | 168,462,477 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 834 | cpp | #include<bits/stdc++.h>
using namespace std;
const int DIM = 8;
string s[DIM][DIM];
char me;
bool readFile()
{
ifstream in;
in.open("shared_file.txt");
char now;
in >> now;
if (now!=me) return false;
for (int i = 0; i < DIM; i++) {
for (int j = 0; j < DIM; j++) {
in >> s[i][j];
}
}
in.close();
return true;
}
void makeMove(int x, int y)
{
ofstream out;
out.open("shared_file.txt");
out << 0 << "\n";
out << x << " " << y << "\n";
out.close();
}
int main(int argc, char *argv[])
{
me = argv[1][0];
cout << "started as " << me << endl;
while (true) {
if (readFile()==false) continue;
int x, y;
cin>>x>>y;
makeMove(x, y);
}
return 0;
}
| [
"mahirsezan@hmail.com"
] | mahirsezan@hmail.com |
ae80a134b3b7001db7672f38da76bbb293cd5c27 | baf801be3841c8ee9e8f2af0845ac214fbdc3104 | /228-summaryRanges.cpp | 8e8bfcf00794fa6844abcc92f60a8304ef35f681 | [] | no_license | lizuoyue/LeetCode | c81cfb5e1890bca1e82c26bfd1c43f0b7674380f | 2dcaba5b0718508f18c6aa260498cbfe18d17467 | refs/heads/master | 2021-01-22T22:35:15.663141 | 2018-11-06T15:13:41 | 2018-11-06T15:13:41 | 85,556,902 | 1 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 632 | cpp | class Solution {
public:
vector<string> summaryRanges(vector<int> &num) {
string s;
vector<string> result;
int l = 0, r = 0;
for (int i = 0; i < num.size(); ++i) {
if ((r + 1) < num.size()) {
if ((num[r + 1] - num[r]) == 1) {
++r;
} else {
if (l == r) {
s = to_string(num[l]);
} else {
s = to_string(num[l]) + "->" + to_string(num[r]);
}
++r;
l = r;
result.push_back(s);
}
} else {
if (l == r) {
s = to_string(num[l]);
} else {
s = to_string(num[l]) + "->" + to_string(num[r]);
}
result.push_back(s);
}
}
return result;
}
}; | [
"li.zuoyue@foxmail.com"
] | li.zuoyue@foxmail.com |
379baefd9fe04779aa7b9f0f512b6bc591119a59 | 0757a28db8864314bf597aa13ff6af548ac310a5 | /lmyunit/compile_bench/MFinanceNumBaseData_char____de_MFinanceNumBaseData_3/test.cpp | 0c9ec37946f6136923cc03516f209fbc618ce1f9 | [] | no_license | greshem/lmyunit | 25a3f6fc7b7d04d8b3e5bdab5406003d68fd4ca6 | a5036c67b36e4e58472bd91fbfdd7d1c29018687 | refs/heads/master | 2021-07-11T01:01:45.599991 | 2017-10-08T12:36:30 | 2017-10-08T12:36:30 | 106,174,697 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 426 | cpp | #include <lmyunit/unitlib.h>
class MFinanceNumBaseData_char__SubClass: public MFinanceNumBaseData<char>
{
public:
MFinanceNumBaseData_char__SubClass():MFinanceNumBaseData<char>(){}
};//MFinanceNumBaseData_char__SubClass
int main(int argc, char *argv[])
{
MFinanceNumBaseData_char__SubClass *financenumbasedata = new MFinanceNumBaseData_char__SubClass();
delete(financenumbasedata); //target call
return 0;
}
| [
"qianzhongjie@gmail.com"
] | qianzhongjie@gmail.com |
2e33a091ddd92b49f6dccb0ab1878dcd5e10caa1 | 19722c52c50fea2a09527df4eb0a535681dd3c52 | /common.cpp | 64d3165fd0c33ffdd66ae305dcdc22b8a3ed29d5 | [] | no_license | junbujianwpl/LeetcodePro | 70d3b5229ee3bb1a0104e0c85083140e2e27b065 | 2f105d1513a03ca7e54030173f01ae893ae587c4 | refs/heads/master | 2021-01-21T03:21:04.031509 | 2019-03-03T15:04:30 | 2019-03-03T15:04:30 | 101,892,369 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 406 | cpp | #include "common.h"
int print_list_node(ListNode *head)
{
int ret=0;
while(head){
++ret;
cout<<head->val<<" ";
head=head->next;
}
cout<<endl;
return ret;
}
ListNode *make_list(vector<int> v)
{
ListNode dummy(-1),*cur=&dummy;
for(auto i:v){
ListNode* p=new ListNode(i);
cur->next=p;
cur=cur->next;
}
return dummy.next;
}
| [
"476461917@qq.com"
] | 476461917@qq.com |
916007e8955233c0e8cef4eb3c1c38afce51f9d0 | 5e8d200078e64b97e3bbd1e61f83cb5bae99ab6e | /main/source/src/core/pack/task/operation/ReplicateTask.fwd.hh | 50a80ec2c81baf9c85d9798f07854396900e923d | [] | no_license | MedicaicloudLink/Rosetta | 3ee2d79d48b31bd8ca898036ad32fe910c9a7a28 | 01affdf77abb773ed375b83cdbbf58439edd8719 | refs/heads/master | 2020-12-07T17:52:01.350906 | 2020-01-10T08:24:09 | 2020-01-10T08:24:09 | 232,757,729 | 2 | 6 | null | null | null | null | UTF-8 | C++ | false | false | 1,692 | hh | // -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
// vi: set ts=2 noet:
//
// (c) Copyright Rosetta Commons Member Institutions.
// (c) This file is part of the Rosetta software suite and is made available under license.
// (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
// (c) For more information, see http://www.rosettacommons.org. Questions about this can be
// (c) addressed to University of Washington CoMotion, email: license@uw.edu.
/// @file core/pack/task/operation/ReplicateTask.fwd.hh
/// @brief forward declaration for ReplicateTask
/// @author Ben Stranges (stranges@unc.edu)
#ifndef INCLUDED_core_pack_task_operation_ReplicateTask_fwd_hh
#define INCLUDED_core_pack_task_operation_ReplicateTask_fwd_hh
// utility headers
#include <utility/pointer/access_ptr.hh>
#include <utility/pointer/owning_ptr.hh>
namespace core {
namespace pack {
namespace task {
namespace operation {
/// @brief forward declaration for ReplicateTask
class ReplicateTask;
/// @brief ReplicateTask owning pointer
typedef utility::pointer::shared_ptr< ReplicateTask > ReplicateTaskOP;
/// @brief ReplicateTask const owning pointer
typedef utility::pointer::shared_ptr< ReplicateTask const > ReplicateTaskCOP;
/// @brief ReplicateTask owning pointer
typedef utility::pointer::weak_ptr< ReplicateTask > ReplicateTaskAP;
/// @brief ReplicateTask const owning pointer
typedef utility::pointer::weak_ptr< ReplicateTask const > ReplicateTaskCAP;
} // namespace operation
} // namespace task
} // namespace pack
} // namespace core
#endif /* INCLUDED_core_pack_task_operation_ReplicateTask_FWD_HH */
| [
"36790013+MedicaicloudLink@users.noreply.github.com"
] | 36790013+MedicaicloudLink@users.noreply.github.com |
3d93a091acefb2c5a01aa7237d4928190c3b1cd4 | 9efc64802f275b85372b4c9db2c9569a1978808b | /PT07Z.cpp | 483bf0123f581d1e8b20233a0c5a954810e26039 | [] | no_license | trailblazerakash/SPOJ | 58e56f2ceb631897f056fd7e3484684bd5600507 | 9a8d463c9e4e89a04454abf34ff7338221aea210 | refs/heads/master | 2020-12-26T04:05:04.058746 | 2015-10-22T11:59:04 | 2015-10-22T11:59:04 | 44,742,234 | 0 | 0 | null | 2015-10-22T11:56:17 | 2015-10-22T11:56:15 | C++ | UTF-8 | C++ | false | false | 2,262 | cpp | // AC , ALGO : Graph Theory : BFS on an unweighted, undirected tree.
/* Idea :
1. Run a bfs from root S ( assumed node 1 ) to find the farthest node u. Now new S = u.
2. Again run a bfs from the farthest node u and find a new farthest node v.
3. The path from the node u and v is the longest path in this tree.
*/
/* Some Helpful Links :
http://www.cplusplus.com/reference/queue/queue/
http://www.cplusplus.com/reference/vector/vector/
http://www.cplusplus.com/reference/climits/
https://en.wikipedia.org/wiki/Breadth-first_search
*/
// For any clarifications, contact me at : osinha6792@gmail.com
#include<cstdio>
#include<climits>
#include<vector>
#include<queue>
#define MAX 10100
// Fast I/P Starts here
#define get getchar_unlocked
inline int inp( )
{
int n = 0 , s = 1 ;
char p = get( ) ;
if( p == '-' )
s = -1 ;
while( ( p < '0' || p > '9' ) && p != EOF && p != '-' )
p = get( ) ;
if( p == '-' )
s = -1 , p = get( ) ;
while( p >= '0' && p <= '9' )
{
n = ( n << 3 ) + ( n << 1 ) + ( p - '0' ) ;
p = get( ) ;
}
return n * s ;
}
// Fast I/P Ends here
using namespace std ;
struct node
{
int color , pre , dist ;
} ;
int d , n ;
vector< node > vec(MAX) ;
vector< int > adj[MAX] ;
inline int bfs( int S )
{
int i , a , b , last ;
for( i = 1 ; i <= n ; i++ )
{
if( i == S )
continue ;
vec[i].color = vec[i].pre = 0 ;
vec[i].dist = INT_MAX ;
}
vec[S].color = 1 ;
vec[S].pre = 0 ;
vec[S].dist = 0 ;
queue< int > q ;
q.push( S ) ;
while( !q.empty( ) )
{
a = q.front( ) ;
q.pop( ) ;
last = adj[a].end( ) - adj[a].begin( ) ;
for( i = 0 ; i < last ; i++ )
{
b = adj[a][i] ;
if( vec[b].color == 0 )
{
vec[b].color = 1 ;
vec[b].pre = a ;
vec[b].dist = vec[a].dist + 1 ;
q.push( b ) ;
}
}
vec[a].color = 2 ;
}
for( i = 1 , d = 0 ; i <= n ; i++ )
{
if( vec[i].dist > d )
{
d = vec[i].dist ;
S = i ;
}
}
return S ;
}
int main( )
{
int i , u , v , s ;
n = inp( ) ;
for( i = 1 ; i <= n ; i++ )
{
u = inp( ) ;
v = inp( ) ;
adj[u].push_back( v ) ;
adj[v].push_back( u ) ;
}
s = bfs( 1 ) ;
s = bfs( s ) ;
printf("%d\n",d) ;
return 0 ;
}
| [
"osinha6792@gmail.com"
] | osinha6792@gmail.com |
5bebf0e615fcf465228aaed2606e66921d4a214c | 6b2a8dd202fdce77c971c412717e305e1caaac51 | /solutions_5738606668808192_0/C++/vovanhuy22000/C.cpp | 9e2f2401827aa410f6b55ee4051bdff1773b3abc | [] | no_license | alexandraback/datacollection | 0bc67a9ace00abbc843f4912562f3a064992e0e9 | 076a7bc7693f3abf07bfdbdac838cb4ef65ccfcf | refs/heads/master | 2021-01-24T18:27:24.417992 | 2017-05-23T09:23:38 | 2017-05-23T09:23:38 | 84,313,442 | 2 | 4 | null | null | null | null | UTF-8 | C++ | false | false | 1,200 | cpp | #include <iostream>
#include <set>
#include <time.h>
#include <stdio.h>
#include <fstream>
using namespace std;
void factor(int a[], int base, int num, int n){
for(int i = n - 1; i >= 0; i--){
a[i] = num % base;
num = num/base;
}
}
template<typename T>
void display(T a[], int n){
for(int i = 0; i < n; i++){
cout<<a[i];
}
}
int main(){
// clock_t tStart = clock();
/* Do your stuff here */
ofstream fout("C.out");
int t; cin>>t;
for(int test = 0; test < t; test++){
int N, J;
cin>>N>>J;
fout<<"Case #"<<test+1<<":"<<endl;
int a[N/2-1];
for(int i = 0; i < J; i++){
factor(a, 2, i, N/2-1);
char s[N];
s[0] = '1';
for(int k = 1; k <= N/2-1; k++){
s[2*k-1] = s[2*k] = (char)(a[k-1]+48);
}
s[N-1] = '1';
for(int k = 0; k < N; k++){
fout<<s[k];
}
fout<<" "<<3<<" "<<4<<" "<<5<<" "<<6<<" "<<7
<<" "<<8<<" "<<9<<" "<<10<<" "<<11<<endl;
}
}
// printf("Time taken: %.2fs\n", (double)(clock() - tStart)/CLOCKS_PER_SEC);
}
| [
"alexandra1.back@gmail.com"
] | alexandra1.back@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.