Merge pull request #48296 from akien-mga/3.x-cherrypicks
This commit is contained in:
commit
0c14d10522
102 changed files with 348 additions and 340 deletions
|
@ -35,7 +35,6 @@
|
|||
#include "core/io/image_loader.h"
|
||||
#include "core/io/resource_loader.h"
|
||||
#include "core/math/math_funcs.h"
|
||||
#include "core/os/copymem.h"
|
||||
#include "core/print_string.h"
|
||||
|
||||
#include "thirdparty/misc/hq2x.h"
|
||||
|
@ -1369,7 +1368,7 @@ void Image::shrink_x2() {
|
|||
PoolVector<uint8_t>::Write w = new_img.write();
|
||||
PoolVector<uint8_t>::Read r = data.read();
|
||||
|
||||
copymem(w.ptr(), &r[ofs], new_size);
|
||||
memcpy(w.ptr(), &r[ofs], new_size);
|
||||
}
|
||||
|
||||
width = MAX(width / 2, 1);
|
||||
|
@ -1593,7 +1592,7 @@ void Image::create(int p_width, int p_height, bool p_use_mipmaps, Format p_forma
|
|||
data.resize(size);
|
||||
{
|
||||
PoolVector<uint8_t>::Write w = data.write();
|
||||
zeromem(w.ptr(), size);
|
||||
memset(w.ptr(), 0, size);
|
||||
}
|
||||
|
||||
width = p_width;
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
#include "compression.h"
|
||||
|
||||
#include "core/io/zip_io.h"
|
||||
#include "core/os/copymem.h"
|
||||
#include "core/project_settings.h"
|
||||
|
||||
#include "thirdparty/misc/fastlz.h"
|
||||
|
@ -46,8 +45,8 @@ int Compression::compress(uint8_t *p_dst, const uint8_t *p_src, int p_src_size,
|
|||
|
||||
if (p_src_size < 16) {
|
||||
uint8_t src[16];
|
||||
zeromem(&src[p_src_size], 16 - p_src_size);
|
||||
copymem(src, p_src, p_src_size);
|
||||
memset(&src[p_src_size], 0, 16 - p_src_size);
|
||||
memcpy(src, p_src, p_src_size);
|
||||
return fastlz_compress(src, 16, p_dst);
|
||||
} else {
|
||||
return fastlz_compress(p_src, p_src_size, p_dst);
|
||||
|
@ -142,7 +141,7 @@ int Compression::decompress(uint8_t *p_dst, int p_dst_max_size, const uint8_t *p
|
|||
if (p_dst_max_size < 16) {
|
||||
uint8_t dst[16];
|
||||
ret_size = fastlz_decompress(p_src, p_src_size, dst, 16);
|
||||
copymem(p_dst, dst, p_dst_max_size);
|
||||
memcpy(p_dst, dst, p_dst_max_size);
|
||||
} else {
|
||||
ret_size = fastlz_decompress(p_src, p_src_size, p_dst, p_dst_max_size);
|
||||
}
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
#include "file_access_encrypted.h"
|
||||
|
||||
#include "core/crypto/crypto_core.h"
|
||||
#include "core/os/copymem.h"
|
||||
#include "core/print_string.h"
|
||||
#include "core/variant.h"
|
||||
|
||||
|
@ -137,7 +136,7 @@ void FileAccessEncrypted::close() {
|
|||
ERR_FAIL_COND(CryptoCore::md5(data.ptr(), data.size(), hash) != OK); // Bug?
|
||||
|
||||
compressed.resize(len);
|
||||
zeromem(compressed.ptrw(), len);
|
||||
memset(compressed.ptrw(), 0, len);
|
||||
for (int i = 0; i < data.size(); i++) {
|
||||
compressed.write[i] = data[i];
|
||||
}
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
#include "file_access_memory.h"
|
||||
|
||||
#include "core/map.h"
|
||||
#include "core/os/copymem.h"
|
||||
#include "core/os/dir_access.h"
|
||||
#include "core/project_settings.h"
|
||||
|
||||
|
@ -161,7 +160,7 @@ int FileAccessMemory::get_buffer(uint8_t *p_dst, int p_length) const {
|
|||
WARN_PRINT("Reading less data than requested");
|
||||
};
|
||||
|
||||
copymem(p_dst, &data[pos], read);
|
||||
memcpy(p_dst, &data[pos], read);
|
||||
pos += p_length;
|
||||
|
||||
return read;
|
||||
|
@ -191,7 +190,7 @@ void FileAccessMemory::store_buffer(const uint8_t *p_src, int p_length) {
|
|||
WARN_PRINT("Writing less data than requested");
|
||||
}
|
||||
|
||||
copymem(&data[pos], p_src, write);
|
||||
memcpy(&data[pos], p_src, write);
|
||||
pos += p_length;
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
|
||||
#include "file_access_zip.h"
|
||||
|
||||
#include "core/os/copymem.h"
|
||||
#include "core/os/file_access.h"
|
||||
|
||||
ZipArchive *ZipArchive::instance = NULL;
|
||||
|
@ -133,7 +132,7 @@ unzFile ZipArchive::get_file_handle(String p_file) const {
|
|||
ERR_FAIL_COND_V_MSG(!f, NULL, "Cannot open file '" + packages[file.package].filename + "'.");
|
||||
|
||||
zlib_filefunc_def io;
|
||||
zeromem(&io, sizeof(io));
|
||||
memset(&io, 0, sizeof(io));
|
||||
|
||||
io.opaque = f;
|
||||
io.zopen_file = godot_open;
|
||||
|
|
|
@ -662,7 +662,7 @@ PoolByteArray HTTPClient::read_response_body_chunk() {
|
|||
|
||||
ret.resize(chunk.size() - 2);
|
||||
PoolByteArray::Write w = ret.write();
|
||||
copymem(w.ptr(), chunk.ptr(), chunk.size() - 2);
|
||||
memcpy(w.ptr(), chunk.ptr(), chunk.size() - 2);
|
||||
chunk.clear();
|
||||
}
|
||||
|
||||
|
|
|
@ -765,7 +765,7 @@ static void _encode_string(const String &p_string, uint8_t *&buf, int &r_len) {
|
|||
if (buf) {
|
||||
encode_uint32(utf8.length(), buf);
|
||||
buf += 4;
|
||||
copymem(buf, utf8.get_data(), utf8.length());
|
||||
memcpy(buf, utf8.get_data(), utf8.length());
|
||||
buf += utf8.length();
|
||||
}
|
||||
|
||||
|
@ -918,7 +918,7 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo
|
|||
if (buf) {
|
||||
encode_uint32(utf8.length(), buf);
|
||||
buf += 4;
|
||||
copymem(buf, utf8.get_data(), utf8.length());
|
||||
memcpy(buf, utf8.get_data(), utf8.length());
|
||||
buf += pad + utf8.length();
|
||||
}
|
||||
|
||||
|
@ -975,7 +975,7 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo
|
|||
for (int i = 0; i < 3; i++) {
|
||||
for (int j = 0; j < 2; j++) {
|
||||
|
||||
copymem(&buf[(i * 2 + j) * 4], &val.elements[i][j], sizeof(float));
|
||||
memcpy(&buf[(i * 2 + j) * 4], &val.elements[i][j], sizeof(float));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1031,7 +1031,7 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo
|
|||
for (int i = 0; i < 3; i++) {
|
||||
for (int j = 0; j < 3; j++) {
|
||||
|
||||
copymem(&buf[(i * 3 + j) * 4], &val.elements[i][j], sizeof(float));
|
||||
memcpy(&buf[(i * 3 + j) * 4], &val.elements[i][j], sizeof(float));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1046,7 +1046,7 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo
|
|||
for (int i = 0; i < 3; i++) {
|
||||
for (int j = 0; j < 3; j++) {
|
||||
|
||||
copymem(&buf[(i * 3 + j) * 4], &val.basis.elements[i][j], sizeof(float));
|
||||
memcpy(&buf[(i * 3 + j) * 4], &val.basis.elements[i][j], sizeof(float));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1162,7 +1162,7 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo
|
|||
if (buf) {
|
||||
encode_uint32(utf8.length()+1,buf);
|
||||
buf+=4;
|
||||
copymem(buf,utf8.get_data(),utf8.length()+1);
|
||||
memcpy(buf,utf8.get_data(),utf8.length()+1);
|
||||
}
|
||||
|
||||
r_len+=4+utf8.length()+1;
|
||||
|
@ -1217,7 +1217,7 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo
|
|||
encode_uint32(datalen, buf);
|
||||
buf += 4;
|
||||
PoolVector<uint8_t>::Read r = data.read();
|
||||
copymem(buf, &r[0], datalen * datasize);
|
||||
memcpy(buf, &r[0], datalen * datasize);
|
||||
buf += datalen * datasize;
|
||||
}
|
||||
|
||||
|
@ -1282,7 +1282,7 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo
|
|||
if (buf) {
|
||||
encode_uint32(utf8.length() + 1, buf);
|
||||
buf += 4;
|
||||
copymem(buf, utf8.get_data(), utf8.length() + 1);
|
||||
memcpy(buf, utf8.get_data(), utf8.length() + 1);
|
||||
buf += utf8.length() + 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -444,7 +444,7 @@ Error StreamPeerBuffer::put_data(const uint8_t *p_data, int p_bytes) {
|
|||
}
|
||||
|
||||
PoolVector<uint8_t>::Write w = data.write();
|
||||
copymem(&w[pointer], p_data, p_bytes);
|
||||
memcpy(&w[pointer], p_data, p_bytes);
|
||||
|
||||
pointer += p_bytes;
|
||||
return OK;
|
||||
|
@ -479,7 +479,7 @@ Error StreamPeerBuffer::get_partial_data(uint8_t *p_buffer, int p_bytes, int &r_
|
|||
}
|
||||
|
||||
PoolVector<uint8_t>::Read r = data.read();
|
||||
copymem(p_buffer, r.ptr() + pointer, r_received);
|
||||
memcpy(p_buffer, r.ptr() + pointer, r_received);
|
||||
|
||||
pointer += r_received;
|
||||
// FIXME: return what? OK or ERR_*
|
||||
|
|
|
@ -477,7 +477,7 @@ Error XMLParser::open_buffer(const Vector<uint8_t> &p_buffer) {
|
|||
|
||||
length = p_buffer.size();
|
||||
data = memnew_arr(char, length + 1);
|
||||
copymem(data, p_buffer.ptr(), length);
|
||||
memcpy(data, p_buffer.ptr(), length);
|
||||
data[length] = 0;
|
||||
P = data;
|
||||
return OK;
|
||||
|
|
|
@ -30,8 +30,6 @@
|
|||
|
||||
#include "zip_io.h"
|
||||
|
||||
#include "core/os/copymem.h"
|
||||
|
||||
void *zipio_open(void *data, const char *p_fname, int mode) {
|
||||
|
||||
FileAccess *&f = *(FileAccess **)data;
|
||||
|
@ -112,7 +110,7 @@ int zipio_testerror(voidpf opaque, voidpf stream) {
|
|||
voidpf zipio_alloc(voidpf opaque, uInt items, uInt size) {
|
||||
|
||||
voidpf ptr = memalloc(items * size);
|
||||
zeromem(ptr, items * size);
|
||||
memset(ptr, 0, items * size);
|
||||
return ptr;
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
#define LOCAL_VECTOR_H
|
||||
|
||||
#include "core/error_macros.h"
|
||||
#include "core/os/copymem.h"
|
||||
#include "core/os/memory.h"
|
||||
#include "core/sort_array.h"
|
||||
#include "core/vector.h"
|
||||
|
@ -215,7 +214,7 @@ public:
|
|||
Vector<T> ret;
|
||||
ret.resize(size());
|
||||
T *w = ret.ptrw();
|
||||
copymem(w, data, sizeof(T) * count);
|
||||
memcpy(w, data, sizeof(T) * count);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -223,7 +222,7 @@ public:
|
|||
Vector<uint8_t> ret;
|
||||
ret.resize(count * sizeof(T));
|
||||
uint8_t *w = ret.ptrw();
|
||||
copymem(w, data, sizeof(T) * count);
|
||||
memcpy(w, data, sizeof(T) * count);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
#include "basis.h"
|
||||
|
||||
#include "core/math/math_funcs.h"
|
||||
#include "core/os/copymem.h"
|
||||
#include "core/print_string.h"
|
||||
|
||||
#define cofac(row1, col1, row2, col2) \
|
||||
|
|
|
@ -135,7 +135,7 @@ public:
|
|||
if (depth > threshold) {
|
||||
if (aux_stack.empty()) {
|
||||
aux_stack.resize(ALLOCA_STACK_SIZE * 2);
|
||||
copymem(aux_stack.ptr(), stack, get_alloca_stacksize());
|
||||
memcpy(aux_stack.ptr(), stack, get_alloca_stacksize());
|
||||
} else {
|
||||
aux_stack.resize(aux_stack.size() * 2);
|
||||
}
|
||||
|
|
|
@ -180,8 +180,7 @@ Vector3 Face3::get_median_point() const {
|
|||
}
|
||||
|
||||
real_t Face3::get_area() const {
|
||||
|
||||
return vec3_cross(vertex[0] - vertex[1], vertex[0] - vertex[2]).length();
|
||||
return vec3_cross(vertex[0] - vertex[1], vertex[0] - vertex[2]).length() * 0.5;
|
||||
}
|
||||
|
||||
ClockDirection Face3::get_clock_dir() const {
|
||||
|
|
|
@ -1239,7 +1239,7 @@ Vector<Geometry::PackRectsResult> Geometry::partial_pack_rects(const Vector<Vect
|
|||
|
||||
Vector<stbrp_node> nodes;
|
||||
nodes.resize(p_atlas_size.width);
|
||||
zeromem(nodes.ptrw(), sizeof(stbrp_node) * nodes.size());
|
||||
memset(nodes.ptrw(), 0, sizeof(stbrp_node) * nodes.size());
|
||||
|
||||
stbrp_context context;
|
||||
stbrp_init_target(&context, p_atlas_size.width, p_atlas_size.height, nodes.ptrw(), p_atlas_size.width);
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
#include "transform.h"
|
||||
|
||||
#include "core/math/math_funcs.h"
|
||||
#include "core/os/copymem.h"
|
||||
#include "core/print_string.h"
|
||||
|
||||
void Transform::affine_invert() {
|
||||
|
|
|
@ -33,7 +33,6 @@
|
|||
|
||||
#include "core/hashfuncs.h"
|
||||
#include "core/math/math_funcs.h"
|
||||
#include "core/os/copymem.h"
|
||||
#include "core/os/memory.h"
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,50 +0,0 @@
|
|||
/*************************************************************************/
|
||||
/* copymem.h */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
/* "Software"), to deal in the Software without restriction, including */
|
||||
/* without limitation the rights to use, copy, modify, merge, publish, */
|
||||
/* distribute, sublicense, and/or sell copies of the Software, and to */
|
||||
/* permit persons to whom the Software is furnished to do so, subject 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 COPYMEM_H
|
||||
#define COPYMEM_H
|
||||
|
||||
#include "core/typedefs.h"
|
||||
|
||||
#ifdef PLATFORM_COPYMEM
|
||||
|
||||
#include "platform_copymem.h" // included from platform/<current_platform>/platform_copymem.h"
|
||||
|
||||
#else
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#define copymem(to, from, count) memcpy(to, from, count)
|
||||
#define zeromem(to, count) memset(to, 0, count)
|
||||
#define movemem(to, from, count) memmove(to, from, count)
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -32,7 +32,6 @@
|
|||
#define INPUT_EVENT_H
|
||||
|
||||
#include "core/math/transform_2d.h"
|
||||
#include "core/os/copymem.h"
|
||||
#include "core/resource.h"
|
||||
#include "core/typedefs.h"
|
||||
#include "core/ustring.h"
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
#include "memory.h"
|
||||
|
||||
#include "core/error_macros.h"
|
||||
#include "core/os/copymem.h"
|
||||
#include "core/safe_refcount.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
|
|
@ -336,7 +336,7 @@ Error PackedDataContainer::pack(const Variant &p_data) {
|
|||
datalen = tmpdata.size();
|
||||
data.resize(tmpdata.size());
|
||||
PoolVector<uint8_t>::Write w = data.write();
|
||||
copymem(w.ptr(), tmpdata.ptr(), tmpdata.size());
|
||||
memcpy(w.ptr(), tmpdata.ptr(), tmpdata.size());
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
#include "pool_allocator.h"
|
||||
|
||||
#include "core/error_macros.h"
|
||||
#include "core/os/copymem.h"
|
||||
#include "core/os/memory.h"
|
||||
#include "core/os/os.h"
|
||||
#include "core/print_string.h"
|
||||
|
@ -42,7 +41,7 @@
|
|||
do { \
|
||||
void *_dst = &((unsigned char *)pool)[m_to_pos]; \
|
||||
void *_src = &((unsigned char *)pool)[(m_entry).pos]; \
|
||||
movemem(_dst, _src, aligned((m_entry).len)); \
|
||||
memmove(_dst, _src, aligned((m_entry).len)); \
|
||||
(m_entry).pos = m_to_pos; \
|
||||
} while (0);
|
||||
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
#ifndef POOL_VECTOR_H
|
||||
#define POOL_VECTOR_H
|
||||
|
||||
#include "core/os/copymem.h"
|
||||
#include "core/os/memory.h"
|
||||
#include "core/os/mutex.h"
|
||||
#include "core/os/rw_lock.h"
|
||||
|
|
|
@ -329,7 +329,7 @@ struct _VariantCall {
|
|||
size_t len = charstr.length();
|
||||
retval.resize(len);
|
||||
PoolByteArray::Write w = retval.write();
|
||||
copymem(w.ptr(), charstr.ptr(), len);
|
||||
memcpy(w.ptr(), charstr.ptr(), len);
|
||||
w.release();
|
||||
|
||||
r_ret = retval;
|
||||
|
@ -348,7 +348,7 @@ struct _VariantCall {
|
|||
size_t len = charstr.length();
|
||||
retval.resize(len);
|
||||
PoolByteArray::Write w = retval.write();
|
||||
copymem(w.ptr(), charstr.ptr(), len);
|
||||
memcpy(w.ptr(), charstr.ptr(), len);
|
||||
w.release();
|
||||
|
||||
r_ret = retval;
|
||||
|
@ -366,7 +366,7 @@ struct _VariantCall {
|
|||
size_t len = s->length() * sizeof(wchar_t);
|
||||
retval.resize(len);
|
||||
PoolByteArray::Write w = retval.write();
|
||||
copymem(w.ptr(), s->ptr(), len);
|
||||
memcpy(w.ptr(), s->ptr(), len);
|
||||
w.release();
|
||||
|
||||
r_ret = retval;
|
||||
|
@ -585,7 +585,7 @@ struct _VariantCall {
|
|||
PoolByteArray::Read r = ba->read();
|
||||
CharString cs;
|
||||
cs.resize(ba->size() + 1);
|
||||
copymem(cs.ptrw(), r.ptr(), ba->size());
|
||||
memcpy(cs.ptrw(), r.ptr(), ba->size());
|
||||
cs[ba->size()] = 0;
|
||||
|
||||
s = cs.get_data();
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="Area" inherits="CollisionObject" version="3.4">
|
||||
<brief_description>
|
||||
General-purpose area node for detection and 3D physics influence.
|
||||
3D area for detection and physics and audio influence.
|
||||
</brief_description>
|
||||
<description>
|
||||
3D area that detects [CollisionObject] nodes overlapping, entering, or exiting. Can also alter or override local physics parameters (gravity, damping).
|
||||
3D area that detects [CollisionObject] nodes overlapping, entering, or exiting. Can also alter or override local physics parameters (gravity, damping) and route audio to custom audio buses.
|
||||
</description>
|
||||
<tutorials>
|
||||
<link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/125</link>
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="Area2D" inherits="CollisionObject2D" version="3.4">
|
||||
<brief_description>
|
||||
2D area for detection and 2D physics influence.
|
||||
2D area for detection and physics and audio influence.
|
||||
</brief_description>
|
||||
<description>
|
||||
2D area that detects [CollisionObject2D] nodes overlapping, entering, or exiting. Can also alter or override local physics parameters (gravity, damping).
|
||||
2D area that detects [CollisionObject2D] nodes overlapping, entering, or exiting. Can also alter or override local physics parameters (gravity, damping) and route audio to a custom audio bus.
|
||||
</description>
|
||||
<tutorials>
|
||||
<link title="Using Area2D">https://docs.godotengine.org/en/3.3/tutorials/physics/using_area_2d.html</link>
|
||||
|
|
|
@ -97,6 +97,16 @@
|
|||
Will regenerate normal maps for the [ArrayMesh].
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_blend_shape_name">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="index" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="name" type="String">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="surface_find_by_name" qualifiers="const">
|
||||
<return type="int">
|
||||
</return>
|
||||
|
|
|
@ -212,6 +212,16 @@
|
|||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_bone_name">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="bone_idx" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="name" type="String">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_bone_parent">
|
||||
<return type="void">
|
||||
</return>
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
<argument index="0" name="anim" type="String">
|
||||
</argument>
|
||||
<description>
|
||||
If [code]true[/code], the given animation will loop.
|
||||
Returns [code]true[/code] if the given animation is configured to loop when it finishes playing. Otherwise, returns [code]false[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_animation_names" qualifiers="const">
|
||||
|
|
|
@ -308,8 +308,6 @@
|
|||
</theme_item>
|
||||
<theme_item name="label_valign_fg" type="int" default="0">
|
||||
</theme_item>
|
||||
<theme_item name="panel" type="StyleBox">
|
||||
</theme_item>
|
||||
<theme_item name="tab_bg" type="StyleBox">
|
||||
The style of an inactive tab.
|
||||
</theme_item>
|
||||
|
|
|
@ -70,7 +70,7 @@ OSStatus AudioDriverCoreAudio::output_device_address_cb(AudioObjectID inObjectID
|
|||
|
||||
Error AudioDriverCoreAudio::init() {
|
||||
AudioComponentDescription desc;
|
||||
zeromem(&desc, sizeof(desc));
|
||||
memset(&desc, 0, sizeof(desc));
|
||||
desc.componentType = kAudioUnitType_Output;
|
||||
#ifdef OSX_ENABLED
|
||||
desc.componentSubType = kAudioUnitSubType_HALOutput;
|
||||
|
@ -97,7 +97,7 @@ Error AudioDriverCoreAudio::init() {
|
|||
|
||||
AudioStreamBasicDescription strdesc;
|
||||
|
||||
zeromem(&strdesc, sizeof(strdesc));
|
||||
memset(&strdesc, 0, sizeof(strdesc));
|
||||
UInt32 size = sizeof(strdesc);
|
||||
result = AudioUnitGetProperty(audio_unit, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Output, kOutputBus, &strdesc, &size);
|
||||
ERR_FAIL_COND_V(result != noErr, FAILED);
|
||||
|
@ -118,7 +118,7 @@ Error AudioDriverCoreAudio::init() {
|
|||
|
||||
mix_rate = GLOBAL_GET("audio/mix_rate");
|
||||
|
||||
zeromem(&strdesc, sizeof(strdesc));
|
||||
memset(&strdesc, 0, sizeof(strdesc));
|
||||
strdesc.mFormatID = kAudioFormatLinearPCM;
|
||||
strdesc.mFormatFlags = kLinearPCMFormatFlagIsSignedInteger | kLinearPCMFormatFlagIsPacked;
|
||||
strdesc.mChannelsPerFrame = channels;
|
||||
|
@ -148,7 +148,7 @@ Error AudioDriverCoreAudio::init() {
|
|||
print_verbose("CoreAudio: audio buffer frames: " + itos(buffer_frames) + " calculated latency: " + itos(buffer_frames * 1000 / mix_rate) + "ms");
|
||||
|
||||
AURenderCallbackStruct callback;
|
||||
zeromem(&callback, sizeof(AURenderCallbackStruct));
|
||||
memset(&callback, 0, sizeof(AURenderCallbackStruct));
|
||||
callback.inputProc = &AudioDriverCoreAudio::output_callback;
|
||||
callback.inputProcRefCon = this;
|
||||
result = AudioUnitSetProperty(audio_unit, kAudioUnitProperty_SetRenderCallback, kAudioUnitScope_Input, kOutputBus, &callback, sizeof(callback));
|
||||
|
@ -174,7 +174,7 @@ OSStatus AudioDriverCoreAudio::output_callback(void *inRefCon,
|
|||
if (!ad->active || !ad->try_lock()) {
|
||||
for (unsigned int i = 0; i < ioData->mNumberBuffers; i++) {
|
||||
AudioBuffer *abuf = &ioData->mBuffers[i];
|
||||
zeromem(abuf->mData, abuf->mDataByteSize);
|
||||
memset(abuf->mData, 0, abuf->mDataByteSize);
|
||||
};
|
||||
return 0;
|
||||
};
|
||||
|
@ -298,7 +298,7 @@ void AudioDriverCoreAudio::finish() {
|
|||
lock();
|
||||
|
||||
AURenderCallbackStruct callback;
|
||||
zeromem(&callback, sizeof(AURenderCallbackStruct));
|
||||
memset(&callback, 0, sizeof(AURenderCallbackStruct));
|
||||
result = AudioUnitSetProperty(audio_unit, kAudioUnitProperty_SetRenderCallback, kAudioUnitScope_Input, kOutputBus, &callback, sizeof(callback));
|
||||
if (result != noErr) {
|
||||
ERR_PRINT("AudioUnitSetProperty failed");
|
||||
|
@ -342,7 +342,7 @@ void AudioDriverCoreAudio::finish() {
|
|||
|
||||
Error AudioDriverCoreAudio::capture_init() {
|
||||
AudioComponentDescription desc;
|
||||
zeromem(&desc, sizeof(desc));
|
||||
memset(&desc, 0, sizeof(desc));
|
||||
desc.componentType = kAudioUnitType_Output;
|
||||
#ifdef OSX_ENABLED
|
||||
desc.componentSubType = kAudioUnitSubType_HALOutput;
|
||||
|
@ -388,7 +388,7 @@ Error AudioDriverCoreAudio::capture_init() {
|
|||
#endif
|
||||
|
||||
AudioStreamBasicDescription strdesc;
|
||||
zeromem(&strdesc, sizeof(strdesc));
|
||||
memset(&strdesc, 0, sizeof(strdesc));
|
||||
size = sizeof(strdesc);
|
||||
result = AudioUnitGetProperty(input_unit, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Output, kInputBus, &strdesc, &size);
|
||||
ERR_FAIL_COND_V(result != noErr, FAILED);
|
||||
|
@ -410,7 +410,7 @@ Error AudioDriverCoreAudio::capture_init() {
|
|||
|
||||
mix_rate = GLOBAL_GET("audio/mix_rate");
|
||||
|
||||
zeromem(&strdesc, sizeof(strdesc));
|
||||
memset(&strdesc, 0, sizeof(strdesc));
|
||||
strdesc.mFormatID = kAudioFormatLinearPCM;
|
||||
strdesc.mFormatFlags = kLinearPCMFormatFlagIsSignedInteger | kLinearPCMFormatFlagIsPacked;
|
||||
strdesc.mChannelsPerFrame = capture_channels;
|
||||
|
@ -424,7 +424,7 @@ Error AudioDriverCoreAudio::capture_init() {
|
|||
ERR_FAIL_COND_V(result != noErr, FAILED);
|
||||
|
||||
AURenderCallbackStruct callback;
|
||||
zeromem(&callback, sizeof(AURenderCallbackStruct));
|
||||
memset(&callback, 0, sizeof(AURenderCallbackStruct));
|
||||
callback.inputProc = &AudioDriverCoreAudio::input_callback;
|
||||
callback.inputProcRefCon = this;
|
||||
result = AudioUnitSetProperty(input_unit, kAudioOutputUnitProperty_SetInputCallback, kAudioUnitScope_Global, kInputBus, &callback, sizeof(callback));
|
||||
|
@ -441,7 +441,7 @@ void AudioDriverCoreAudio::capture_finish() {
|
|||
lock();
|
||||
|
||||
AURenderCallbackStruct callback;
|
||||
zeromem(&callback, sizeof(AURenderCallbackStruct));
|
||||
memset(&callback, 0, sizeof(AURenderCallbackStruct));
|
||||
OSStatus result = AudioUnitSetProperty(input_unit, kAudioOutputUnitProperty_SetInputCallback, kAudioUnitScope_Global, 0, &callback, sizeof(callback));
|
||||
if (result != noErr) {
|
||||
ERR_PRINT("AudioUnitSetProperty failed");
|
||||
|
|
|
@ -1558,7 +1558,7 @@ void RasterizerSceneGLES2::_setup_geometry(RenderList::Element *p_element, Raste
|
|||
|
||||
size_t transform_buffer_offset = i * 12;
|
||||
|
||||
copymem(&buffer[transform_buffer_offset], row, sizeof(row));
|
||||
memcpy(&buffer[transform_buffer_offset], row, sizeof(row));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3401,7 +3401,7 @@ void RasterizerStorageGLES2::multimesh_set_as_bulk_array(RID p_multimesh, const
|
|||
|
||||
PoolVector<float>::Read r = p_array.read();
|
||||
ERR_FAIL_COND(!r.ptr());
|
||||
copymem(multimesh->data.ptrw(), r.ptr(), dsize * sizeof(float));
|
||||
memcpy(multimesh->data.ptrw(), r.ptr(), dsize * sizeof(float));
|
||||
|
||||
multimesh->dirty_data = true;
|
||||
multimesh->dirty_aabb = true;
|
||||
|
@ -4466,7 +4466,7 @@ void RasterizerStorageGLES2::lightmap_capture_set_octree(RID p_capture, const Po
|
|||
if (p_octree.size()) {
|
||||
PoolVector<LightmapCaptureOctree>::Write w = capture->octree.write();
|
||||
PoolVector<uint8_t>::Read r = p_octree.read();
|
||||
copymem(w.ptr(), r.ptr(), p_octree.size());
|
||||
memcpy(w.ptr(), r.ptr(), p_octree.size());
|
||||
}
|
||||
capture->instance_change_notify(true, false);
|
||||
}
|
||||
|
@ -4483,7 +4483,7 @@ PoolVector<uint8_t> RasterizerStorageGLES2::lightmap_capture_get_octree(RID p_ca
|
|||
{
|
||||
PoolVector<LightmapCaptureOctree>::Read r = capture->octree.read();
|
||||
PoolVector<uint8_t>::Write w = ret.write();
|
||||
copymem(w.ptr(), r.ptr(), ret.size());
|
||||
memcpy(w.ptr(), r.ptr(), ret.size());
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
|
|
@ -2912,7 +2912,7 @@ void RasterizerSceneGLES3::_setup_lights(RID *p_light_cull_result, int p_light_c
|
|||
}
|
||||
|
||||
li->light_index = state.omni_light_count;
|
||||
copymem(&state.omni_array_tmp[li->light_index * state.ubo_light_size], &ubo_data, state.ubo_light_size);
|
||||
memcpy(&state.omni_array_tmp[li->light_index * state.ubo_light_size], &ubo_data, state.ubo_light_size);
|
||||
state.omni_light_count++;
|
||||
|
||||
} break;
|
||||
|
@ -2995,7 +2995,7 @@ void RasterizerSceneGLES3::_setup_lights(RID *p_light_cull_result, int p_light_c
|
|||
}
|
||||
|
||||
li->light_index = state.spot_light_count;
|
||||
copymem(&state.spot_array_tmp[li->light_index * state.ubo_light_size], &ubo_data, state.ubo_light_size);
|
||||
memcpy(&state.spot_array_tmp[li->light_index * state.ubo_light_size], &ubo_data, state.ubo_light_size);
|
||||
state.spot_light_count++;
|
||||
} break;
|
||||
}
|
||||
|
@ -3096,7 +3096,7 @@ void RasterizerSceneGLES3::_setup_reflections(RID *p_reflection_probe_cull_resul
|
|||
store_transform(proj, reflection_ubo.local_matrix);
|
||||
|
||||
rpi->reflection_index = state.reflection_probe_count;
|
||||
copymem(&state.reflection_array_tmp[rpi->reflection_index * sizeof(ReflectionProbeDataUBO)], &reflection_ubo, sizeof(ReflectionProbeDataUBO));
|
||||
memcpy(&state.reflection_array_tmp[rpi->reflection_index * sizeof(ReflectionProbeDataUBO)], &reflection_ubo, sizeof(ReflectionProbeDataUBO));
|
||||
state.reflection_probe_count++;
|
||||
}
|
||||
|
||||
|
|
|
@ -3273,37 +3273,37 @@ _FORCE_INLINE_ static void _fill_std140_ubo_empty(ShaderLanguage::DataType type,
|
|||
case ShaderLanguage::TYPE_INT:
|
||||
case ShaderLanguage::TYPE_UINT:
|
||||
case ShaderLanguage::TYPE_FLOAT: {
|
||||
zeromem(data, 4);
|
||||
memset(data, 0, 4);
|
||||
} break;
|
||||
case ShaderLanguage::TYPE_BVEC2:
|
||||
case ShaderLanguage::TYPE_IVEC2:
|
||||
case ShaderLanguage::TYPE_UVEC2:
|
||||
case ShaderLanguage::TYPE_VEC2: {
|
||||
zeromem(data, 8);
|
||||
memset(data, 0, 8);
|
||||
} break;
|
||||
case ShaderLanguage::TYPE_BVEC3:
|
||||
case ShaderLanguage::TYPE_IVEC3:
|
||||
case ShaderLanguage::TYPE_UVEC3:
|
||||
case ShaderLanguage::TYPE_VEC3: {
|
||||
zeromem(data, 12);
|
||||
memset(data, 0, 12);
|
||||
} break;
|
||||
case ShaderLanguage::TYPE_BVEC4:
|
||||
case ShaderLanguage::TYPE_IVEC4:
|
||||
case ShaderLanguage::TYPE_UVEC4:
|
||||
case ShaderLanguage::TYPE_VEC4: {
|
||||
|
||||
zeromem(data, 16);
|
||||
memset(data, 0, 16);
|
||||
} break;
|
||||
case ShaderLanguage::TYPE_MAT2: {
|
||||
|
||||
zeromem(data, 32);
|
||||
memset(data, 0, 32);
|
||||
} break;
|
||||
case ShaderLanguage::TYPE_MAT3: {
|
||||
|
||||
zeromem(data, 48);
|
||||
memset(data, 0, 48);
|
||||
} break;
|
||||
case ShaderLanguage::TYPE_MAT4: {
|
||||
zeromem(data, 64);
|
||||
memset(data, 0, 64);
|
||||
} break;
|
||||
|
||||
default: {
|
||||
|
@ -4099,7 +4099,7 @@ PoolVector<uint8_t> RasterizerStorageGLES3::mesh_surface_get_array(RID p_mesh, i
|
|||
ERR_FAIL_NULL_V(data, PoolVector<uint8_t>());
|
||||
{
|
||||
PoolVector<uint8_t>::Write w = ret.write();
|
||||
copymem(w.ptr(), data, surface->array_byte_size);
|
||||
memcpy(w.ptr(), data, surface->array_byte_size);
|
||||
}
|
||||
glUnmapBuffer(GL_ARRAY_BUFFER);
|
||||
#endif
|
||||
|
@ -4131,7 +4131,7 @@ PoolVector<uint8_t> RasterizerStorageGLES3::mesh_surface_get_index_array(RID p_m
|
|||
ERR_FAIL_NULL_V(data, PoolVector<uint8_t>());
|
||||
{
|
||||
PoolVector<uint8_t>::Write w = ret.write();
|
||||
copymem(w.ptr(), data, surface->index_array_byte_size);
|
||||
memcpy(w.ptr(), data, surface->index_array_byte_size);
|
||||
}
|
||||
glUnmapBuffer(GL_ELEMENT_ARRAY_BUFFER);
|
||||
#endif
|
||||
|
@ -4193,7 +4193,7 @@ Vector<PoolVector<uint8_t> > RasterizerStorageGLES3::mesh_surface_get_blend_shap
|
|||
ERR_FAIL_COND_V(!data, Vector<PoolVector<uint8_t> >());
|
||||
{
|
||||
PoolVector<uint8_t>::Write w = ret.write();
|
||||
copymem(w.ptr(), data, mesh->surfaces[p_surface]->array_byte_size);
|
||||
memcpy(w.ptr(), data, mesh->surfaces[p_surface]->array_byte_size);
|
||||
}
|
||||
glUnmapBuffer(GL_ELEMENT_ARRAY_BUFFER);
|
||||
#endif
|
||||
|
@ -5060,7 +5060,7 @@ void RasterizerStorageGLES3::multimesh_set_as_bulk_array(RID p_multimesh, const
|
|||
ERR_FAIL_COND(dsize != p_array.size());
|
||||
|
||||
PoolVector<float>::Read r = p_array.read();
|
||||
copymem(multimesh->data.ptrw(), r.ptr(), dsize * sizeof(float));
|
||||
memcpy(multimesh->data.ptrw(), r.ptr(), dsize * sizeof(float));
|
||||
|
||||
multimesh->dirty_data = true;
|
||||
multimesh->dirty_aabb = true;
|
||||
|
@ -6321,7 +6321,7 @@ void RasterizerStorageGLES3::lightmap_capture_set_octree(RID p_capture, const Po
|
|||
if (p_octree.size()) {
|
||||
PoolVector<LightmapCaptureOctree>::Write w = capture->octree.write();
|
||||
PoolVector<uint8_t>::Read r = p_octree.read();
|
||||
copymem(w.ptr(), r.ptr(), p_octree.size());
|
||||
memcpy(w.ptr(), r.ptr(), p_octree.size());
|
||||
}
|
||||
capture->instance_change_notify(true, false);
|
||||
}
|
||||
|
@ -6338,7 +6338,7 @@ PoolVector<uint8_t> RasterizerStorageGLES3::lightmap_capture_get_octree(RID p_ca
|
|||
{
|
||||
PoolVector<LightmapCaptureOctree>::Read r = capture->octree.read();
|
||||
PoolVector<uint8_t>::Write w = ret.write();
|
||||
copymem(w.ptr(), r.ptr(), ret.size());
|
||||
memcpy(w.ptr(), r.ptr(), ret.size());
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
|
|
@ -93,7 +93,7 @@ PoolVector<uint8_t> ImageLoaderPNG::lossless_pack_png(const Ref<Image> &p_image)
|
|||
{
|
||||
// must be closed before call to image_to_png
|
||||
PoolVector<uint8_t>::Write writer = out_buffer.write();
|
||||
copymem(writer.ptr(), "PNG ", 4);
|
||||
memcpy(writer.ptr(), "PNG ", 4);
|
||||
}
|
||||
|
||||
Error err = PNGDriverCommon::image_to_png(p_image, out_buffer);
|
||||
|
|
|
@ -60,7 +60,7 @@ static bool check_error(const png_image &image) {
|
|||
|
||||
Error png_to_image(const uint8_t *p_source, size_t p_size, bool p_force_linear, Ref<Image> p_image) {
|
||||
png_image png_img;
|
||||
zeromem(&png_img, sizeof(png_img));
|
||||
memset(&png_img, 0, sizeof(png_img));
|
||||
png_img.version = PNG_IMAGE_VERSION;
|
||||
|
||||
// fetch image properties
|
||||
|
@ -133,7 +133,7 @@ Error image_to_png(const Ref<Image> &p_image, PoolVector<uint8_t> &p_buffer) {
|
|||
ERR_FAIL_COND_V(source_image->is_compressed(), FAILED);
|
||||
|
||||
png_image png_img;
|
||||
zeromem(&png_img, sizeof(png_img));
|
||||
memset(&png_img, 0, sizeof(png_img));
|
||||
png_img.version = PNG_IMAGE_VERSION;
|
||||
png_img.width = source_image->get_width();
|
||||
png_img.height = source_image->get_height();
|
||||
|
|
|
@ -107,7 +107,7 @@ size_t NetSocketPosix::_set_addr_storage(struct sockaddr_storage *p_addr, const
|
|||
addr6->sin6_family = AF_INET6;
|
||||
addr6->sin6_port = htons(p_port);
|
||||
if (p_ip.is_valid()) {
|
||||
copymem(&addr6->sin6_addr.s6_addr, p_ip.get_ipv6(), 16);
|
||||
memcpy(&addr6->sin6_addr.s6_addr, p_ip.get_ipv6(), 16);
|
||||
} else {
|
||||
addr6->sin6_addr = in6addr_any;
|
||||
}
|
||||
|
@ -122,7 +122,7 @@ size_t NetSocketPosix::_set_addr_storage(struct sockaddr_storage *p_addr, const
|
|||
addr4->sin_port = htons(p_port); // short, network byte order
|
||||
|
||||
if (p_ip.is_valid()) {
|
||||
copymem(&addr4->sin_addr.s_addr, p_ip.get_ipv4(), 4);
|
||||
memcpy(&addr4->sin_addr.s_addr, p_ip.get_ipv4(), 4);
|
||||
} else {
|
||||
addr4->sin_addr.s_addr = INADDR_ANY;
|
||||
}
|
||||
|
@ -266,13 +266,13 @@ _FORCE_INLINE_ Error NetSocketPosix::_change_multicast_group(IP_Address p_ip, St
|
|||
ERR_FAIL_COND_V(!if_ip.is_valid(), ERR_INVALID_PARAMETER);
|
||||
struct ip_mreq greq;
|
||||
int sock_opt = p_add ? IP_ADD_MEMBERSHIP : IP_DROP_MEMBERSHIP;
|
||||
copymem(&greq.imr_multiaddr, p_ip.get_ipv4(), 4);
|
||||
copymem(&greq.imr_interface, if_ip.get_ipv4(), 4);
|
||||
memcpy(&greq.imr_multiaddr, p_ip.get_ipv4(), 4);
|
||||
memcpy(&greq.imr_interface, if_ip.get_ipv4(), 4);
|
||||
ret = setsockopt(_sock, level, sock_opt, (const char *)&greq, sizeof(greq));
|
||||
} else {
|
||||
struct ipv6_mreq greq;
|
||||
int sock_opt = p_add ? IPV6_ADD_MEMBERSHIP : IPV6_DROP_MEMBERSHIP;
|
||||
copymem(&greq.ipv6mr_multiaddr, p_ip.get_ipv6(), 16);
|
||||
memcpy(&greq.ipv6mr_multiaddr, p_ip.get_ipv6(), 16);
|
||||
greq.ipv6mr_interface = if_v6id;
|
||||
ret = setsockopt(_sock, level, sock_opt, (const char *)&greq, sizeof(greq));
|
||||
}
|
||||
|
@ -452,7 +452,7 @@ Error NetSocketPosix::poll(PollType p_type, int p_timeout) const {
|
|||
FD_ZERO(&wr);
|
||||
FD_ZERO(&ex);
|
||||
FD_SET(_sock, &ex);
|
||||
struct timeval timeout = { p_timeout, 0 };
|
||||
struct timeval timeout = { p_timeout / 1000, (p_timeout % 1000) * 1000 };
|
||||
// For blocking operation, pass NULL timeout pointer to select.
|
||||
struct timeval *tp = NULL;
|
||||
if (p_timeout >= 0) {
|
||||
|
|
|
@ -127,7 +127,7 @@ void EditorHelpSearch::_notification(int p_what) {
|
|||
if (search->work()) {
|
||||
// Search done.
|
||||
|
||||
// Only point to the perfect match if it's a new search, and not just reopening a old one.
|
||||
// Only point to the match if it's a new search, and not just reopening a old one.
|
||||
if (!old_search)
|
||||
results_tree->ensure_cursor_is_visible();
|
||||
else
|
||||
|
@ -321,6 +321,7 @@ bool EditorHelpSearch::Runner::_phase_match_classes_init() {
|
|||
iterator_doc = EditorHelp::get_doc_data()->class_list.front();
|
||||
matches.clear();
|
||||
matched_item = NULL;
|
||||
match_highest_score = 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -444,15 +445,20 @@ bool EditorHelpSearch::Runner::_match_string(const String &p_term, const String
|
|||
}
|
||||
|
||||
void EditorHelpSearch::Runner::_match_item(TreeItem *p_item, const String &p_text) {
|
||||
float inverse_length = 1.f / float(p_text.length());
|
||||
|
||||
if (!matched_item) {
|
||||
if (search_flags & SEARCH_CASE_SENSITIVE) {
|
||||
if (p_text.casecmp_to(term) == 0)
|
||||
matched_item = p_item;
|
||||
} else {
|
||||
if (p_text.nocasecmp_to(term) == 0)
|
||||
matched_item = p_item;
|
||||
}
|
||||
// Favor types where search term is a substring close to the start of the type.
|
||||
float w = 0.5f;
|
||||
int pos = p_text.findn(term);
|
||||
float score = (pos > -1) ? 1.0f - w * MIN(1, 3 * pos * inverse_length) : MAX(0.f, .9f - w);
|
||||
|
||||
// Favor shorter items: they resemble the search term more.
|
||||
w = 0.1f;
|
||||
score *= (1 - w) + w * (term.length() * inverse_length);
|
||||
|
||||
if (match_highest_score == 0 || score > match_highest_score) {
|
||||
matched_item = p_item;
|
||||
match_highest_score = score;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -125,6 +125,7 @@ class EditorHelpSearch::Runner : public Reference {
|
|||
TreeItem *root_item;
|
||||
Map<String, TreeItem *> class_items;
|
||||
TreeItem *matched_item;
|
||||
float match_highest_score = 0;
|
||||
|
||||
bool _is_class_disabled_by_feature_profile(const StringName &p_class);
|
||||
|
||||
|
|
|
@ -2216,11 +2216,10 @@ void EditorInspector::_notification(int p_what) {
|
|||
|
||||
if (p_what == NOTIFICATION_READY) {
|
||||
EditorFeatureProfileManager::get_singleton()->connect("current_feature_profile_changed", this, "_feature_profile_changed");
|
||||
_update_inspector_bg();
|
||||
}
|
||||
|
||||
if (p_what == NOTIFICATION_ENTER_TREE) {
|
||||
|
||||
_update_inspector_bg();
|
||||
if (!sub_inspector) {
|
||||
get_tree()->connect("node_removed", this, "_node_removed");
|
||||
}
|
||||
|
|
|
@ -1024,14 +1024,23 @@ void EditorNode::save_resource_as(const Ref<Resource> &p_resource, const String
|
|||
file->clear_filters();
|
||||
|
||||
List<String> preferred;
|
||||
for (int i = 0; i < extensions.size(); i++) {
|
||||
|
||||
if (p_resource->is_class("Script") && (extensions[i] == "tres" || extensions[i] == "res" || extensions[i] == "xml")) {
|
||||
for (List<String>::Element *E = extensions.front(); E; E = E->next()) {
|
||||
if (p_resource->is_class("Script") && (E->get() == "tres" || E->get() == "res")) {
|
||||
//this serves no purpose and confused people
|
||||
continue;
|
||||
}
|
||||
file->add_filter("*." + extensions[i] + " ; " + extensions[i].to_upper());
|
||||
preferred.push_back(extensions[i]);
|
||||
file->add_filter("*." + E->get() + " ; " + E->get().to_upper());
|
||||
preferred.push_back(E->get());
|
||||
}
|
||||
// Lowest priority extension
|
||||
List<String>::Element *res_element = preferred.find("res");
|
||||
if (res_element) {
|
||||
preferred.move_to_back(res_element);
|
||||
}
|
||||
// Highest priority extension
|
||||
List<String>::Element *tres_element = preferred.find("tres");
|
||||
if (tres_element) {
|
||||
preferred.move_to_front(tres_element);
|
||||
}
|
||||
|
||||
if (p_at_path != String()) {
|
||||
|
|
|
@ -396,7 +396,7 @@ void ParticlesEditor::_generate_emission_points() {
|
|||
|
||||
{
|
||||
PoolVector<uint8_t>::Write iw = point_img.write();
|
||||
zeromem(iw.ptr(), w * h * 3 * sizeof(float));
|
||||
memset(iw.ptr(), 0, w * h * 3 * sizeof(float));
|
||||
PoolVector<Vector3>::Read r = points.read();
|
||||
float *wf = (float *)iw.ptr();
|
||||
for (int i = 0; i < point_count; i++) {
|
||||
|
@ -426,7 +426,7 @@ void ParticlesEditor::_generate_emission_points() {
|
|||
|
||||
{
|
||||
PoolVector<uint8_t>::Write iw = point_img2.write();
|
||||
zeromem(iw.ptr(), w * h * 3 * sizeof(float));
|
||||
memset(iw.ptr(), 0, w * h * 3 * sizeof(float));
|
||||
PoolVector<Vector3>::Read r = normals.read();
|
||||
float *wf = (float *)iw.ptr();
|
||||
for (int i = 0; i < point_count; i++) {
|
||||
|
|
|
@ -225,6 +225,14 @@ String ScriptCreateDialog::_validate_path(const String &p_path, bool p_file_must
|
|||
return "";
|
||||
}
|
||||
|
||||
String ScriptCreateDialog::_get_class_name() const {
|
||||
if (has_named_classes) {
|
||||
return class_name->get_text();
|
||||
} else {
|
||||
return ProjectSettings::get_singleton()->localize_path(file_path->get_text()).get_file().get_basename();
|
||||
}
|
||||
}
|
||||
|
||||
void ScriptCreateDialog::_class_name_changed(const String &p_name) {
|
||||
|
||||
if (_validate_class(class_name->get_text())) {
|
||||
|
@ -278,14 +286,7 @@ void ScriptCreateDialog::ok_pressed() {
|
|||
}
|
||||
|
||||
void ScriptCreateDialog::_create_new() {
|
||||
|
||||
String cname_param;
|
||||
|
||||
if (has_named_classes) {
|
||||
cname_param = class_name->get_text();
|
||||
} else {
|
||||
cname_param = ProjectSettings::get_singleton()->localize_path(file_path->get_text()).get_file().get_basename();
|
||||
}
|
||||
String cname_param = _get_class_name();
|
||||
|
||||
Ref<Script> scr;
|
||||
if (script_template != "") {
|
||||
|
@ -690,6 +691,10 @@ void ScriptCreateDialog::_update_dialog() {
|
|||
|
||||
builtin_warning_label->set_visible(is_built_in);
|
||||
|
||||
// Check if the script name is the same as the parent class.
|
||||
// This warning isn't relevant if the script is built-in.
|
||||
script_name_warning_label->set_visible(!is_built_in && _get_class_name() == parent_name->get_text());
|
||||
|
||||
if (is_built_in) {
|
||||
get_ok()->set_text(TTR("Create"));
|
||||
parent_name->set_editable(true);
|
||||
|
@ -775,6 +780,14 @@ ScriptCreateDialog::ScriptCreateDialog() {
|
|||
builtin_warning_label->set_autowrap(true);
|
||||
builtin_warning_label->hide();
|
||||
|
||||
script_name_warning_label = memnew(Label);
|
||||
script_name_warning_label->set_text(
|
||||
TTR("Warning: Having the script name be the same as a built-in type is usually not desired."));
|
||||
vb->add_child(script_name_warning_label);
|
||||
script_name_warning_label->add_color_override("font_color", Color(1, 0.85, 0.4));
|
||||
script_name_warning_label->set_autowrap(true);
|
||||
script_name_warning_label->hide();
|
||||
|
||||
status_panel = memnew(PanelContainer);
|
||||
status_panel->set_h_size_flags(Control::SIZE_FILL);
|
||||
status_panel->add_child(vb);
|
||||
|
|
|
@ -49,6 +49,7 @@ class ScriptCreateDialog : public ConfirmationDialog {
|
|||
Label *error_label;
|
||||
Label *path_error_label;
|
||||
Label *builtin_warning_label;
|
||||
Label *script_name_warning_label;
|
||||
PanelContainer *status_panel;
|
||||
LineEdit *parent_name;
|
||||
Button *parent_browse_button;
|
||||
|
@ -109,6 +110,7 @@ class ScriptCreateDialog : public ConfirmationDialog {
|
|||
bool _validate_parent(const String &p_string);
|
||||
bool _validate_class(const String &p_string);
|
||||
String _validate_path(const String &p_path, bool p_file_must_exist);
|
||||
String _get_class_name() const;
|
||||
void _class_name_changed(const String &p_name);
|
||||
void _parent_name_changed(const String &p_parent);
|
||||
void _template_changed(int p_template = 0);
|
||||
|
|
|
@ -1832,7 +1832,6 @@ CSGBrush *CSGPolygon::_build_brush() {
|
|||
|
||||
path_cache->connect("tree_exited", this, "_path_exited");
|
||||
path_cache->connect("curve_changed", this, "_path_changed");
|
||||
path_cache = NULL;
|
||||
}
|
||||
curve = path->get_curve();
|
||||
if (curve.is_null()) {
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
/*************************************************************************/
|
||||
|
||||
#include "denoise_wrapper.h"
|
||||
#include "core/os/copymem.h"
|
||||
#include "core/os/memory.h"
|
||||
#include "thirdparty/oidn/include/OpenImageDenoise/oidn.h"
|
||||
#include <stdio.h>
|
||||
|
|
|
@ -581,7 +581,7 @@ Error NetworkedMultiplayerENet::put_packet(const uint8_t *p_buffer, int p_buffer
|
|||
ENetPacket *packet = enet_packet_create(NULL, p_buffer_size + 8, packet_flags);
|
||||
encode_uint32(unique_id, &packet->data[0]); // Source ID
|
||||
encode_uint32(target_peer, &packet->data[4]); // Dest ID
|
||||
copymem(&packet->data[8], p_buffer, p_buffer_size);
|
||||
memcpy(&packet->data[8], p_buffer, p_buffer_size);
|
||||
|
||||
if (server) {
|
||||
|
||||
|
@ -705,7 +705,7 @@ size_t NetworkedMultiplayerENet::enet_compress(void *context, const ENetBuffer *
|
|||
while (total) {
|
||||
for (size_t i = 0; i < inBufferCount; i++) {
|
||||
int to_copy = MIN(total, int(inBuffers[i].dataLength));
|
||||
copymem(&enet->src_compressor_mem.write[ofs], inBuffers[i].data, to_copy);
|
||||
memcpy(&enet->src_compressor_mem.write[ofs], inBuffers[i].data, to_copy);
|
||||
ofs += to_copy;
|
||||
total -= to_copy;
|
||||
}
|
||||
|
@ -740,7 +740,7 @@ size_t NetworkedMultiplayerENet::enet_compress(void *context, const ENetBuffer *
|
|||
if (ret > int(outLimit))
|
||||
return 0; // Do not bother
|
||||
|
||||
copymem(outData, enet->dst_compressor_mem.ptr(), ret);
|
||||
memcpy(outData, enet->dst_compressor_mem.ptr(), ret);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
#include "image_compress_etc.h"
|
||||
|
||||
#include "core/image.h"
|
||||
#include "core/os/copymem.h"
|
||||
#include "core/os/os.h"
|
||||
#include "core/print_string.h"
|
||||
|
||||
|
|
|
@ -94,8 +94,8 @@ struct NativeScriptDesc {
|
|||
base_native_type(),
|
||||
documentation(),
|
||||
type_tag(NULL) {
|
||||
zeromem(&create_func, sizeof(godot_instance_create_func));
|
||||
zeromem(&destroy_func, sizeof(godot_instance_destroy_func));
|
||||
memset(&create_func, 0, sizeof(godot_instance_create_func));
|
||||
memset(&destroy_func, 0, sizeof(godot_instance_destroy_func));
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
#include "gdscript_language_protocol.h"
|
||||
|
||||
#include "core/io/json.h"
|
||||
#include "core/os/copymem.h"
|
||||
#include "core/project_settings.h"
|
||||
#include "editor/editor_log.h"
|
||||
#include "editor/editor_node.h"
|
||||
|
|
|
@ -967,7 +967,7 @@ void LightmapperCPU::_post_process(uint32_t p_idx, void *r_output) {
|
|||
PoolByteArray data;
|
||||
data.resize(data_size);
|
||||
PoolByteArray::Write w = data.write();
|
||||
copymem(w.ptr(), output, data_size);
|
||||
memcpy(w.ptr(), output, data_size);
|
||||
current_image->create(size.x, size.y, false, Image::FORMAT_RGBF, data);
|
||||
}
|
||||
|
||||
|
@ -976,7 +976,7 @@ void LightmapperCPU::_post_process(uint32_t p_idx, void *r_output) {
|
|||
PoolByteArray denoised_data = denoised_image->get_data();
|
||||
denoised_image.unref();
|
||||
PoolByteArray::Read r = denoised_data.read();
|
||||
copymem(output, r.ptr(), data_size);
|
||||
memcpy(output, r.ptr(), data_size);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1074,7 +1074,7 @@ void LightmapperCPU::_fix_seams(const LocalVector<UVSeam> &p_seams, Vector3 *r_l
|
|||
LocalVector<Vector3> extra_buffer;
|
||||
extra_buffer.resize(p_size.x * p_size.y);
|
||||
|
||||
copymem(extra_buffer.ptr(), r_lightmap, p_size.x * p_size.y * sizeof(Vector3));
|
||||
memcpy(extra_buffer.ptr(), r_lightmap, p_size.x * p_size.y * sizeof(Vector3));
|
||||
|
||||
Vector3 *read_ptr = extra_buffer.ptr();
|
||||
Vector3 *write_ptr = r_lightmap;
|
||||
|
@ -1084,7 +1084,7 @@ void LightmapperCPU::_fix_seams(const LocalVector<UVSeam> &p_seams, Vector3 *r_l
|
|||
_fix_seam(p_seams[j].edge0[0], p_seams[j].edge0[1], p_seams[j].edge1[0], p_seams[j].edge1[1], read_ptr, write_ptr, p_size);
|
||||
_fix_seam(p_seams[j].edge1[0], p_seams[j].edge1[1], p_seams[j].edge0[0], p_seams[j].edge0[1], read_ptr, write_ptr, p_size);
|
||||
}
|
||||
copymem(read_ptr, write_ptr, p_size.x * p_size.y * sizeof(Vector3));
|
||||
memcpy(read_ptr, write_ptr, p_size.x * p_size.y * sizeof(Vector3));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -352,7 +352,7 @@ Vector<uint8_t> CryptoMbedTLS::sign(HashingContext::HashType p_hash_type, Vector
|
|||
int ret = mbedtls_pk_sign(&(key->pkey), type, p_hash.ptr(), size, buf, &sig_size, mbedtls_ctr_drbg_random, &ctr_drbg);
|
||||
ERR_FAIL_COND_V_MSG(ret, out, "Error while signing: " + itos(ret));
|
||||
out.resize(sig_size);
|
||||
copymem(out.ptrw(), buf, sig_size);
|
||||
memcpy(out.ptrw(), buf, sig_size);
|
||||
return out;
|
||||
}
|
||||
|
||||
|
@ -375,7 +375,7 @@ Vector<uint8_t> CryptoMbedTLS::encrypt(Ref<CryptoKey> p_key, Vector<uint8_t> p_p
|
|||
int ret = mbedtls_pk_encrypt(&(key->pkey), p_plaintext.ptr(), p_plaintext.size(), buf, &size, sizeof(buf), mbedtls_ctr_drbg_random, &ctr_drbg);
|
||||
ERR_FAIL_COND_V_MSG(ret, out, "Error while encrypting: " + itos(ret));
|
||||
out.resize(size);
|
||||
copymem(out.ptrw(), buf, size);
|
||||
memcpy(out.ptrw(), buf, size);
|
||||
return out;
|
||||
}
|
||||
|
||||
|
@ -389,6 +389,6 @@ Vector<uint8_t> CryptoMbedTLS::decrypt(Ref<CryptoKey> p_key, Vector<uint8_t> p_c
|
|||
int ret = mbedtls_pk_decrypt(&(key->pkey), p_ciphertext.ptr(), p_ciphertext.size(), buf, &size, sizeof(buf), mbedtls_ctr_drbg_random, &ctr_drbg);
|
||||
ERR_FAIL_COND_V_MSG(ret, out, "Error while decrypting: " + itos(ret));
|
||||
out.resize(size);
|
||||
copymem(out.ptrw(), buf, size);
|
||||
memcpy(out.ptrw(), buf, size);
|
||||
return out;
|
||||
}
|
||||
|
|
|
@ -72,7 +72,7 @@ int PacketPeerMbedDTLS::bio_recv(void *ctx, unsigned char *buf, size_t len) {
|
|||
if (err != OK) {
|
||||
return MBEDTLS_ERR_SSL_INTERNAL_ERROR;
|
||||
}
|
||||
copymem(buf, buffer, buffer_size);
|
||||
memcpy(buf, buffer, buffer_size);
|
||||
return buffer_size;
|
||||
}
|
||||
|
||||
|
@ -88,8 +88,8 @@ int PacketPeerMbedDTLS::_set_cookie() {
|
|||
uint8_t client_id[18];
|
||||
IP_Address addr = base->get_packet_address();
|
||||
uint16_t port = base->get_packet_port();
|
||||
copymem(client_id, addr.get_ipv6(), 16);
|
||||
copymem(&client_id[16], (uint8_t *)&port, 2);
|
||||
memcpy(client_id, addr.get_ipv6(), 16);
|
||||
memcpy(&client_id[16], (uint8_t *)&port, 2);
|
||||
return mbedtls_ssl_set_client_transport_id(ssl_ctx->get_context(), client_id, 18);
|
||||
}
|
||||
|
||||
|
|
|
@ -181,7 +181,7 @@ PoolVector<uint8_t> AudioStreamMP3::get_data() const {
|
|||
vdata.resize(data_len);
|
||||
{
|
||||
PoolVector<uint8_t>::Write w = vdata.write();
|
||||
copymem(w.ptr(), data, data_len);
|
||||
memcpy(w.ptr(), data, data_len);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ static void _compress_pvrtc4(Image *p_img) {
|
|||
img->get_mipmap_offset_size_and_dimensions(i, ofs, size, w, h);
|
||||
Javelin::RgbaBitmap bm(w, h);
|
||||
void *dst = (void *)bm.GetData();
|
||||
copymem(dst, &r[ofs], size);
|
||||
memcpy(dst, &r[ofs], size);
|
||||
Javelin::ColorRgba<unsigned char> *dp = bm.GetData();
|
||||
for (int j = 0; j < size / 4; j++) {
|
||||
// Red and blue colors are swapped.
|
||||
|
|
|
@ -133,10 +133,10 @@ void LightmapRaycasterEmbree::add_mesh(const Vector<Vector3> &p_vertices, const
|
|||
ERR_FAIL_COND(!p_normals.empty() && vertex_count != p_normals.size());
|
||||
|
||||
Vector3 *embree_vertices = (Vector3 *)rtcSetNewGeometryBuffer(embree_mesh, RTC_BUFFER_TYPE_VERTEX, 0, RTC_FORMAT_FLOAT3, sizeof(Vector3), vertex_count);
|
||||
copymem(embree_vertices, p_vertices.ptr(), sizeof(Vector3) * vertex_count);
|
||||
memcpy(embree_vertices, p_vertices.ptr(), sizeof(Vector3) * vertex_count);
|
||||
|
||||
Vector2 *embree_light_uvs = (Vector2 *)rtcSetNewGeometryBuffer(embree_mesh, RTC_BUFFER_TYPE_VERTEX_ATTRIBUTE, 0, RTC_FORMAT_FLOAT2, sizeof(Vector2), vertex_count);
|
||||
copymem(embree_light_uvs, p_uv2s.ptr(), sizeof(Vector2) * vertex_count);
|
||||
memcpy(embree_light_uvs, p_uv2s.ptr(), sizeof(Vector2) * vertex_count);
|
||||
|
||||
uint32_t *embree_triangles = (uint32_t *)rtcSetNewGeometryBuffer(embree_mesh, RTC_BUFFER_TYPE_INDEX, 0, RTC_FORMAT_UINT3, sizeof(uint32_t) * 3, vertex_count / 3);
|
||||
for (int i = 0; i < vertex_count; i++) {
|
||||
|
@ -145,7 +145,7 @@ void LightmapRaycasterEmbree::add_mesh(const Vector<Vector3> &p_vertices, const
|
|||
|
||||
if (!p_normals.empty()) {
|
||||
Vector3 *embree_normals = (Vector3 *)rtcSetNewGeometryBuffer(embree_mesh, RTC_BUFFER_TYPE_VERTEX_ATTRIBUTE, 1, RTC_FORMAT_FLOAT3, sizeof(Vector3), vertex_count);
|
||||
copymem(embree_normals, p_normals.ptr(), sizeof(Vector3) * vertex_count);
|
||||
memcpy(embree_normals, p_normals.ptr(), sizeof(Vector3) * vertex_count);
|
||||
}
|
||||
|
||||
rtcCommitGeometry(embree_mesh);
|
||||
|
|
|
@ -233,7 +233,7 @@ PoolVector<uint8_t> AudioStreamOGGVorbis::get_data() const {
|
|||
vdata.resize(data_len);
|
||||
{
|
||||
PoolVector<uint8_t>::Write w = vdata.write();
|
||||
copymem(w.ptr(), data, data_len);
|
||||
memcpy(w.ptr(), data, data_len);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -226,7 +226,7 @@ void VideoStreamPlaybackTheora::set_file(const String &p_file) {
|
|||
/* identify the codec: try theora */
|
||||
if (!theora_p && th_decode_headerin(&ti, &tc, &ts, &op) >= 0) {
|
||||
/* it is theora */
|
||||
copymem(&to, &test, sizeof(test));
|
||||
memcpy(&to, &test, sizeof(test));
|
||||
theora_p = 1;
|
||||
} else if (!vorbis_p && vorbis_synthesis_headerin(&vi, &vc, &op) >= 0) {
|
||||
|
||||
|
@ -240,7 +240,7 @@ void VideoStreamPlaybackTheora::set_file(const String &p_file) {
|
|||
|
||||
audio_track_skip--;
|
||||
} else {
|
||||
copymem(&vo, &test, sizeof(test));
|
||||
memcpy(&vo, &test, sizeof(test));
|
||||
vorbis_p = 1;
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -1680,7 +1680,7 @@ Variant VisualScriptInstance::_call_internal(const StringName &p_method, void *p
|
|||
state->flow_stack_pos = flow_stack_pos;
|
||||
state->stack.resize(p_stack_size);
|
||||
state->pass = p_pass;
|
||||
copymem(state->stack.ptrw(), p_stack, p_stack_size);
|
||||
memcpy(state->stack.ptrw(), p_stack, p_stack_size);
|
||||
//step 2, run away, return directly
|
||||
r_error.error = Variant::CallError::CALL_OK;
|
||||
|
||||
|
@ -1960,7 +1960,7 @@ Variant VisualScriptInstance::call(const StringName &p_method, const Variant **p
|
|||
sequence_bits[i] = false; //all starts as false
|
||||
}
|
||||
|
||||
zeromem(pass_stack, f->pass_stack_size * sizeof(int));
|
||||
memset(pass_stack, 0, f->pass_stack_size * sizeof(int));
|
||||
|
||||
Map<int, VisualScriptNodeInstance *>::Element *E = instances.find(f->node);
|
||||
if (!E) {
|
||||
|
|
|
@ -69,7 +69,7 @@ static PoolVector<uint8_t> _webp_lossy_pack(const Ref<Image> &p_image, float p_q
|
|||
w[1] = 'E';
|
||||
w[2] = 'B';
|
||||
w[3] = 'P';
|
||||
copymem(&w[4], dst_buff, dst_size);
|
||||
memcpy(&w[4], dst_buff, dst_size);
|
||||
free(dst_buff);
|
||||
w.release();
|
||||
return dst;
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
#ifndef PACKET_BUFFER_H
|
||||
#define PACKET_BUFFER_H
|
||||
|
||||
#include "core/os/copymem.h"
|
||||
#include "core/ring_buffer.h"
|
||||
|
||||
template <class T>
|
||||
|
@ -67,7 +66,7 @@ public:
|
|||
if (p_info) {
|
||||
_Packet p;
|
||||
p.size = p_size;
|
||||
copymem(&p.info, p_info, sizeof(T));
|
||||
memcpy(&p.info, p_info, sizeof(T));
|
||||
_packets.write(p);
|
||||
}
|
||||
|
||||
|
@ -87,7 +86,7 @@ public:
|
|||
ERR_FAIL_COND_V(p_bytes < (int)p.size, ERR_OUT_OF_MEMORY);
|
||||
|
||||
r_read = p.size;
|
||||
copymem(r_info, &p.info, sizeof(T));
|
||||
memcpy(r_info, &p.info, sizeof(T));
|
||||
_payload.read(r_payload, p.size);
|
||||
return OK;
|
||||
}
|
||||
|
|
|
@ -193,10 +193,10 @@ PoolVector<uint8_t> WebSocketMultiplayerPeer::_make_pkt(uint8_t p_type, int32_t
|
|||
out.resize(PROTO_SIZE + p_data_size);
|
||||
|
||||
PoolVector<uint8_t>::Write w = out.write();
|
||||
copymem(&w[0], &p_type, 1);
|
||||
copymem(&w[1], &p_from, 4);
|
||||
copymem(&w[5], &p_to, 4);
|
||||
copymem(&w[PROTO_SIZE], p_data, p_data_size);
|
||||
memcpy(&w[0], &p_type, 1);
|
||||
memcpy(&w[1], &p_from, 4);
|
||||
memcpy(&w[5], &p_to, 4);
|
||||
memcpy(&w[PROTO_SIZE], p_data, p_data_size);
|
||||
|
||||
return out;
|
||||
}
|
||||
|
@ -235,7 +235,7 @@ void WebSocketMultiplayerPeer::_store_pkt(int32_t p_source, int32_t p_dest, cons
|
|||
packet.size = p_data_size;
|
||||
packet.source = p_source;
|
||||
packet.destination = p_dest;
|
||||
copymem(packet.data, &p_data[PROTO_SIZE], p_data_size);
|
||||
memcpy(packet.data, &p_data[PROTO_SIZE], p_data_size);
|
||||
_incoming_packets.push_back(packet);
|
||||
emit_signal("peer_packet", p_source);
|
||||
}
|
||||
|
@ -290,9 +290,9 @@ void WebSocketMultiplayerPeer::_process_multiplayer(Ref<WebSocketPeer> p_peer, u
|
|||
uint8_t type = 0;
|
||||
uint32_t from = 0;
|
||||
int32_t to = 0;
|
||||
copymem(&type, in_buffer, 1);
|
||||
copymem(&from, &in_buffer[1], 4);
|
||||
copymem(&to, &in_buffer[5], 4);
|
||||
memcpy(&type, in_buffer, 1);
|
||||
memcpy(&from, &in_buffer[1], 4);
|
||||
memcpy(&to, &in_buffer[5], 4);
|
||||
|
||||
if (is_server()) { // Server can resend
|
||||
|
||||
|
@ -328,7 +328,7 @@ void WebSocketMultiplayerPeer::_process_multiplayer(Ref<WebSocketPeer> p_peer, u
|
|||
// System message
|
||||
ERR_FAIL_COND(data_size < 4);
|
||||
int id = 0;
|
||||
copymem(&id, &in_buffer[PROTO_SIZE], 4);
|
||||
memcpy(&id, &in_buffer[PROTO_SIZE], 4);
|
||||
|
||||
switch (type) {
|
||||
|
||||
|
|
|
@ -72,10 +72,8 @@ const GodotWebXR = {
|
|||
// enabled or disabled. When using the WebXR API Emulator, this
|
||||
// gets picked up automatically, however, in the Oculus Browser
|
||||
// on the Quest, we need to pause and resume the main loop.
|
||||
Browser.pauseAsyncCallbacks();
|
||||
Browser.mainLoop.pause();
|
||||
window.setTimeout(function () {
|
||||
Browser.resumeAsyncCallbacks();
|
||||
Browser.mainLoop.resume();
|
||||
}, 0);
|
||||
},
|
||||
|
|
|
@ -2662,7 +2662,7 @@ public:
|
|||
continue;
|
||||
r_command_line_flags.resize(base + 4 + length);
|
||||
encode_uint32(length, &r_command_line_flags.write[base]);
|
||||
copymem(&r_command_line_flags.write[base + 4], command_line_argument.ptr(), length);
|
||||
memcpy(&r_command_line_flags.write[base + 4], command_line_argument.ptr(), length);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ ext.versions = [
|
|||
compileSdk : 29,
|
||||
minSdk : 18,
|
||||
targetSdk : 29,
|
||||
buildTools : '30.0.1',
|
||||
buildTools : '30.0.3',
|
||||
supportCoreUtils : '1.0.0',
|
||||
kotlinVersion : '1.4.10',
|
||||
v4Support : '1.0.0',
|
||||
|
|
|
@ -211,7 +211,7 @@ PoolByteArray HTTPClient::read_response_body_chunk() {
|
|||
}
|
||||
chunk.resize(read);
|
||||
PoolByteArray::Write w = chunk.write();
|
||||
copymem(&w[0], response_buffer.ptr(), read);
|
||||
memcpy(&w[0], response_buffer.ptr(), read);
|
||||
return chunk;
|
||||
}
|
||||
|
||||
|
|
|
@ -192,7 +192,7 @@ void _rgba8_to_packbits_encode(int p_ch, int p_size, PoolVector<uint8_t> &p_sour
|
|||
if ((p_source.read()[(i + 1) * 4 + p_ch] == cur) && (p_source.read()[(i + 2) * 4 + p_ch] == cur)) {
|
||||
if (buf_size > 0) {
|
||||
result.write[res_size++] = (uint8_t)(buf_size - 1);
|
||||
copymem(&result.write[res_size], &buf, buf_size);
|
||||
memcpy(&result.write[res_size], &buf, buf_size);
|
||||
res_size += buf_size;
|
||||
buf_size = 0;
|
||||
}
|
||||
|
@ -218,7 +218,7 @@ void _rgba8_to_packbits_encode(int p_ch, int p_size, PoolVector<uint8_t> &p_sour
|
|||
buf[buf_size++] = cur;
|
||||
if (buf_size == 128) {
|
||||
result.write[res_size++] = (uint8_t)(buf_size - 1);
|
||||
copymem(&result.write[res_size], &buf, buf_size);
|
||||
memcpy(&result.write[res_size], &buf, buf_size);
|
||||
res_size += buf_size;
|
||||
buf_size = 0;
|
||||
}
|
||||
|
@ -226,7 +226,7 @@ void _rgba8_to_packbits_encode(int p_ch, int p_size, PoolVector<uint8_t> &p_sour
|
|||
} else {
|
||||
buf[buf_size++] = cur;
|
||||
result.write[res_size++] = (uint8_t)(buf_size - 1);
|
||||
copymem(&result.write[res_size], &buf, buf_size);
|
||||
memcpy(&result.write[res_size], &buf, buf_size);
|
||||
res_size += buf_size;
|
||||
buf_size = 0;
|
||||
}
|
||||
|
@ -236,7 +236,7 @@ void _rgba8_to_packbits_encode(int p_ch, int p_size, PoolVector<uint8_t> &p_sour
|
|||
|
||||
int ofs = p_dest.size();
|
||||
p_dest.resize(p_dest.size() + res_size);
|
||||
copymem(&p_dest.write[ofs], result.ptr(), res_size);
|
||||
memcpy(&p_dest.write[ofs], result.ptr(), res_size);
|
||||
}
|
||||
|
||||
void EditorExportPlatformOSX::_make_icon(const Ref<Image> &p_icon, Vector<uint8_t> &p_data) {
|
||||
|
@ -296,7 +296,7 @@ void EditorExportPlatformOSX::_make_icon(const Ref<Image> &p_icon, Vector<uint8_
|
|||
memdelete(f);
|
||||
len += 8;
|
||||
len = BSWAP32(len);
|
||||
copymem(&data.write[ofs], icon_infos[i].name, 4);
|
||||
memcpy(&data.write[ofs], icon_infos[i].name, 4);
|
||||
encode_uint32(len, &data.write[ofs + 4]);
|
||||
|
||||
// Clean up generated file.
|
||||
|
@ -316,7 +316,7 @@ void EditorExportPlatformOSX::_make_icon(const Ref<Image> &p_icon, Vector<uint8_
|
|||
|
||||
int len = data.size() - ofs;
|
||||
len = BSWAP32(len);
|
||||
copymem(&data.write[ofs], icon_infos[i].name, 4);
|
||||
memcpy(&data.write[ofs], icon_infos[i].name, 4);
|
||||
encode_uint32(len, &data.write[ofs + 4]);
|
||||
}
|
||||
|
||||
|
@ -331,7 +331,7 @@ void EditorExportPlatformOSX::_make_icon(const Ref<Image> &p_icon, Vector<uint8_
|
|||
}
|
||||
len += 8;
|
||||
len = BSWAP32(len);
|
||||
copymem(&data.write[ofs], icon_infos[i].mask_name, 4);
|
||||
memcpy(&data.write[ofs], icon_infos[i].mask_name, 4);
|
||||
encode_uint32(len, &data.write[ofs + 4]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1347,7 +1347,7 @@ public:
|
|||
int base = clf.size();
|
||||
clf.resize(base + 4 + txt.length());
|
||||
encode_uint32(txt.length(), &clf.write[base]);
|
||||
copymem(&clf.write[base + 4], txt.ptr(), txt.length());
|
||||
memcpy(&clf.write[base + 4], txt.ptr(), txt.length());
|
||||
print_line(itos(i) + " param: " + cl[i]);
|
||||
}
|
||||
|
||||
|
|
|
@ -646,6 +646,11 @@ void Area2D::_bind_methods() {
|
|||
ADD_SIGNAL(MethodInfo("area_entered", PropertyInfo(Variant::OBJECT, "area", PROPERTY_HINT_RESOURCE_TYPE, "Area2D")));
|
||||
ADD_SIGNAL(MethodInfo("area_exited", PropertyInfo(Variant::OBJECT, "area", PROPERTY_HINT_RESOURCE_TYPE, "Area2D")));
|
||||
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "monitoring"), "set_monitoring", "is_monitoring");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "monitorable"), "set_monitorable", "is_monitorable");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "priority", PROPERTY_HINT_RANGE, "0,128,1"), "set_priority", "get_priority");
|
||||
|
||||
ADD_GROUP("Physics Overrides", "");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "space_override", PROPERTY_HINT_ENUM, "Disabled,Combine,Combine-Replace,Replace,Replace-Combine"), "set_space_override_mode", "get_space_override_mode");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "gravity_point"), "set_gravity_is_point", "is_gravity_a_point");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "gravity_distance_scale", PROPERTY_HINT_EXP_RANGE, "0,1024,0.001,or_greater"), "set_gravity_distance_scale", "get_gravity_distance_scale");
|
||||
|
@ -653,9 +658,7 @@ void Area2D::_bind_methods() {
|
|||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "gravity", PROPERTY_HINT_RANGE, "-1024,1024,0.001"), "set_gravity", "get_gravity");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "linear_damp", PROPERTY_HINT_RANGE, "0,100,0.001,or_greater"), "set_linear_damp", "get_linear_damp");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "angular_damp", PROPERTY_HINT_RANGE, "0,100,0.001,or_greater"), "set_angular_damp", "get_angular_damp");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "priority", PROPERTY_HINT_RANGE, "0,128,1"), "set_priority", "get_priority");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "monitoring"), "set_monitoring", "is_monitoring");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "monitorable"), "set_monitorable", "is_monitorable");
|
||||
|
||||
ADD_GROUP("Collision", "collision_");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "collision_layer", PROPERTY_HINT_LAYERS_2D_PHYSICS), "set_collision_layer", "get_collision_layer");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "collision_mask", PROPERTY_HINT_LAYERS_2D_PHYSICS), "set_collision_mask", "get_collision_mask");
|
||||
|
|
|
@ -55,7 +55,7 @@ void CPUParticles2D::set_amount(int p_amount) {
|
|||
|
||||
// each particle must be set to false
|
||||
// zeroing the data also prevents uninitialized memory being sent to GPU
|
||||
zeromem(static_cast<void *>(&w[0]), p_amount * sizeof(Particle));
|
||||
memset(static_cast<void *>(&w[0]), 0, p_amount * sizeof(Particle));
|
||||
// cast to prevent compiler warning .. note this relies on Particle not containing any complex types.
|
||||
// an alternative is to use some zero method per item but the generated code will be far less efficient.
|
||||
}
|
||||
|
@ -1041,7 +1041,7 @@ void CPUParticles2D::_update_particle_data_buffer() {
|
|||
ptr[12] = r[idx].custom[3];
|
||||
|
||||
} else {
|
||||
zeromem(ptr, sizeof(float) * 13);
|
||||
memset(ptr, 0, sizeof(float) * 13);
|
||||
}
|
||||
|
||||
ptr += 13;
|
||||
|
@ -1143,7 +1143,7 @@ void CPUParticles2D::_notification(int p_what) {
|
|||
ptr[7] = t.elements[2][1];
|
||||
|
||||
} else {
|
||||
zeromem(ptr, sizeof(float) * 8);
|
||||
memset(ptr, 0, sizeof(float) * 8);
|
||||
}
|
||||
|
||||
ptr += 13;
|
||||
|
|
|
@ -692,6 +692,11 @@ void Area::_bind_methods() {
|
|||
ADD_SIGNAL(MethodInfo("area_entered", PropertyInfo(Variant::OBJECT, "area", PROPERTY_HINT_RESOURCE_TYPE, "Area")));
|
||||
ADD_SIGNAL(MethodInfo("area_exited", PropertyInfo(Variant::OBJECT, "area", PROPERTY_HINT_RESOURCE_TYPE, "Area")));
|
||||
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "monitoring"), "set_monitoring", "is_monitoring");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "monitorable"), "set_monitorable", "is_monitorable");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "priority", PROPERTY_HINT_RANGE, "0,128,1"), "set_priority", "get_priority");
|
||||
|
||||
ADD_GROUP("Physics Overrides", "");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "space_override", PROPERTY_HINT_ENUM, "Disabled,Combine,Combine-Replace,Replace,Replace-Combine"), "set_space_override_mode", "get_space_override_mode");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "gravity_point"), "set_gravity_is_point", "is_gravity_a_point");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "gravity_distance_scale", PROPERTY_HINT_EXP_RANGE, "0,1024,0.001,or_greater"), "set_gravity_distance_scale", "get_gravity_distance_scale");
|
||||
|
@ -699,15 +704,15 @@ void Area::_bind_methods() {
|
|||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "gravity", PROPERTY_HINT_RANGE, "-1024,1024,0.01"), "set_gravity", "get_gravity");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "linear_damp", PROPERTY_HINT_RANGE, "0,100,0.001,or_greater"), "set_linear_damp", "get_linear_damp");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "angular_damp", PROPERTY_HINT_RANGE, "0,100,0.001,or_greater"), "set_angular_damp", "get_angular_damp");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "priority", PROPERTY_HINT_RANGE, "0,128,1"), "set_priority", "get_priority");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "monitoring"), "set_monitoring", "is_monitoring");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "monitorable"), "set_monitorable", "is_monitorable");
|
||||
|
||||
ADD_GROUP("Collision", "collision_");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "collision_layer", PROPERTY_HINT_LAYERS_3D_PHYSICS), "set_collision_layer", "get_collision_layer");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "collision_mask", PROPERTY_HINT_LAYERS_3D_PHYSICS), "set_collision_mask", "get_collision_mask");
|
||||
|
||||
ADD_GROUP("Audio Bus", "audio_bus_");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "audio_bus_override"), "set_audio_bus_override", "is_overriding_audio_bus");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::STRING, "audio_bus_name", PROPERTY_HINT_ENUM, ""), "set_audio_bus", "get_audio_bus");
|
||||
|
||||
ADD_GROUP("Reverb Bus", "reverb_bus_");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "reverb_bus_enable"), "set_use_reverb_bus", "is_using_reverb_bus");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::STRING, "reverb_bus_name", PROPERTY_HINT_ENUM, ""), "set_reverb_bus", "get_reverb_bus");
|
||||
|
|
|
@ -1095,7 +1095,7 @@ void CPUParticles::_update_particle_data_buffer() {
|
|||
ptr[10] = t.basis.elements[2][2];
|
||||
ptr[11] = t.origin.z;
|
||||
} else {
|
||||
zeromem(ptr, sizeof(float) * 12);
|
||||
memset(ptr, 0, sizeof(float) * 12);
|
||||
}
|
||||
|
||||
Color c = r[idx].color;
|
||||
|
@ -1204,7 +1204,7 @@ void CPUParticles::_notification(int p_what) {
|
|||
ptr[10] = t.basis.elements[2][2];
|
||||
ptr[11] = t.origin.z;
|
||||
} else {
|
||||
zeromem(ptr, sizeof(float) * 12);
|
||||
memset(ptr, 0, sizeof(float) * 12);
|
||||
}
|
||||
|
||||
ptr += 17;
|
||||
|
|
|
@ -2127,7 +2127,7 @@ bool PhysicalBone::_set(const StringName &p_name, const Variant &p_value) {
|
|||
}
|
||||
|
||||
if (joint_data) {
|
||||
if (joint_data->_set(p_name, p_value)) {
|
||||
if (joint_data->_set(p_name, p_value, joint)) {
|
||||
#ifdef TOOLS_ENABLED
|
||||
if (get_gizmo().is_valid())
|
||||
get_gizmo()->redraw();
|
||||
|
|
|
@ -394,7 +394,7 @@ public:
|
|||
virtual JointType get_joint_type() { return JOINT_TYPE_NONE; }
|
||||
|
||||
/// "j" is used to set the parameter inside the PhysicsServer
|
||||
virtual bool _set(const StringName &p_name, const Variant &p_value, RID j = RID());
|
||||
virtual bool _set(const StringName &p_name, const Variant &p_value, RID j);
|
||||
virtual bool _get(const StringName &p_name, Variant &r_ret) const;
|
||||
virtual void _get_property_list(List<PropertyInfo> *p_list) const;
|
||||
|
||||
|
@ -404,7 +404,7 @@ public:
|
|||
struct PinJointData : public JointData {
|
||||
virtual JointType get_joint_type() { return JOINT_TYPE_PIN; }
|
||||
|
||||
virtual bool _set(const StringName &p_name, const Variant &p_value, RID j = RID());
|
||||
virtual bool _set(const StringName &p_name, const Variant &p_value, RID j);
|
||||
virtual bool _get(const StringName &p_name, Variant &r_ret) const;
|
||||
virtual void _get_property_list(List<PropertyInfo> *p_list) const;
|
||||
|
||||
|
@ -421,7 +421,7 @@ public:
|
|||
struct ConeJointData : public JointData {
|
||||
virtual JointType get_joint_type() { return JOINT_TYPE_CONE; }
|
||||
|
||||
virtual bool _set(const StringName &p_name, const Variant &p_value, RID j = RID());
|
||||
virtual bool _set(const StringName &p_name, const Variant &p_value, RID j);
|
||||
virtual bool _get(const StringName &p_name, Variant &r_ret) const;
|
||||
virtual void _get_property_list(List<PropertyInfo> *p_list) const;
|
||||
|
||||
|
@ -442,7 +442,7 @@ public:
|
|||
struct HingeJointData : public JointData {
|
||||
virtual JointType get_joint_type() { return JOINT_TYPE_HINGE; }
|
||||
|
||||
virtual bool _set(const StringName &p_name, const Variant &p_value, RID j = RID());
|
||||
virtual bool _set(const StringName &p_name, const Variant &p_value, RID j);
|
||||
virtual bool _get(const StringName &p_name, Variant &r_ret) const;
|
||||
virtual void _get_property_list(List<PropertyInfo> *p_list) const;
|
||||
|
||||
|
@ -465,7 +465,7 @@ public:
|
|||
struct SliderJointData : public JointData {
|
||||
virtual JointType get_joint_type() { return JOINT_TYPE_SLIDER; }
|
||||
|
||||
virtual bool _set(const StringName &p_name, const Variant &p_value, RID j = RID());
|
||||
virtual bool _set(const StringName &p_name, const Variant &p_value, RID j);
|
||||
virtual bool _get(const StringName &p_name, Variant &r_ret) const;
|
||||
virtual void _get_property_list(List<PropertyInfo> *p_list) const;
|
||||
|
||||
|
@ -543,7 +543,7 @@ public:
|
|||
|
||||
virtual JointType get_joint_type() { return JOINT_TYPE_6DOF; }
|
||||
|
||||
virtual bool _set(const StringName &p_name, const Variant &p_value, RID j = RID());
|
||||
virtual bool _set(const StringName &p_name, const Variant &p_value, RID j);
|
||||
virtual bool _get(const StringName &p_name, Variant &r_ret) const;
|
||||
virtual void _get_property_list(List<PropertyInfo> *p_list) const;
|
||||
|
||||
|
|
|
@ -383,7 +383,7 @@ void RayCast::_update_debug_shape() {
|
|||
int array_size = sizeof(Vector3) * verts.size();
|
||||
byte_array.resize(array_size);
|
||||
PoolByteArray::Write w = byte_array.write();
|
||||
copymem(w.ptr(), verts.ptr(), array_size);
|
||||
memcpy(w.ptr(), verts.ptr(), array_size);
|
||||
|
||||
VS::get_singleton()->mesh_surface_update_region(mesh->get_rid(), 0, 0, byte_array);
|
||||
}
|
||||
|
|
|
@ -440,6 +440,18 @@ String Skeleton::get_bone_name(int p_bone) const {
|
|||
return bones[p_bone].name;
|
||||
}
|
||||
|
||||
void Skeleton::set_bone_name(int p_bone, const String &p_name) {
|
||||
ERR_FAIL_INDEX(p_bone, bones.size());
|
||||
|
||||
for (int i = 0; i < bones.size(); i++) {
|
||||
if (i != p_bone) {
|
||||
ERR_FAIL_COND(bones[i].name == p_name);
|
||||
}
|
||||
}
|
||||
|
||||
bones.write[p_bone].name = p_name;
|
||||
}
|
||||
|
||||
bool Skeleton::is_bone_parent_of(int p_bone, int p_parent_bone_id) const {
|
||||
|
||||
int parent_of_bone = get_bone_parent(p_bone);
|
||||
|
@ -855,6 +867,7 @@ void Skeleton::_bind_methods() {
|
|||
ClassDB::bind_method(D_METHOD("add_bone", "name"), &Skeleton::add_bone);
|
||||
ClassDB::bind_method(D_METHOD("find_bone", "name"), &Skeleton::find_bone);
|
||||
ClassDB::bind_method(D_METHOD("get_bone_name", "bone_idx"), &Skeleton::get_bone_name);
|
||||
ClassDB::bind_method(D_METHOD("set_bone_name", "bone_idx", "name"), &Skeleton::set_bone_name);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_bone_parent", "bone_idx"), &Skeleton::get_bone_parent);
|
||||
ClassDB::bind_method(D_METHOD("set_bone_parent", "bone_idx", "parent_idx"), &Skeleton::set_bone_parent);
|
||||
|
|
|
@ -161,6 +161,7 @@ public:
|
|||
void add_bone(const String &p_name);
|
||||
int find_bone(const String &p_name) const;
|
||||
String get_bone_name(int p_bone) const;
|
||||
void set_bone_name(int p_bone, const String &p_name);
|
||||
|
||||
bool is_bone_parent_of(int p_bone_id, int p_parent_bone_id) const;
|
||||
|
||||
|
|
|
@ -81,11 +81,11 @@ void SoftBodyVisualServerHandler::commit_changes() {
|
|||
}
|
||||
|
||||
void SoftBodyVisualServerHandler::set_vertex(int p_vertex_id, const void *p_vector3) {
|
||||
copymem(&write_buffer[p_vertex_id * stride + offset_vertices], p_vector3, sizeof(float) * 3);
|
||||
memcpy(&write_buffer[p_vertex_id * stride + offset_vertices], p_vector3, sizeof(float) * 3);
|
||||
}
|
||||
|
||||
void SoftBodyVisualServerHandler::set_normal(int p_vertex_id, const void *p_vector3) {
|
||||
copymem(&write_buffer[p_vertex_id * stride + offset_normal], p_vector3, sizeof(float) * 3);
|
||||
memcpy(&write_buffer[p_vertex_id * stride + offset_normal], p_vector3, sizeof(float) * 3);
|
||||
}
|
||||
|
||||
void SoftBodyVisualServerHandler::set_aabb(const AABB &p_aabb) {
|
||||
|
|
|
@ -587,13 +587,13 @@ void Sprite3D::_draw() {
|
|||
}
|
||||
|
||||
float v_uv[2] = { uvs[i].x, uvs[i].y };
|
||||
copymem(&write_buffer[i * mesh_stride + mesh_surface_offsets[VS::ARRAY_TEX_UV]], v_uv, 8);
|
||||
memcpy(&write_buffer[i * mesh_stride + mesh_surface_offsets[VS::ARRAY_TEX_UV]], v_uv, 8);
|
||||
|
||||
float v_vertex[3] = { vtx.x, vtx.y, vtx.z };
|
||||
copymem(&write_buffer[i * mesh_stride + mesh_surface_offsets[VS::ARRAY_VERTEX]], &v_vertex, sizeof(float) * 3);
|
||||
copymem(&write_buffer[i * mesh_stride + mesh_surface_offsets[VS::ARRAY_NORMAL]], v_normal, 4);
|
||||
copymem(&write_buffer[i * mesh_stride + mesh_surface_offsets[VS::ARRAY_TANGENT]], v_tangent, 4);
|
||||
copymem(&write_buffer[i * mesh_stride + mesh_surface_offsets[VS::ARRAY_COLOR]], v_color, 4);
|
||||
memcpy(&write_buffer[i * mesh_stride + mesh_surface_offsets[VS::ARRAY_VERTEX]], &v_vertex, sizeof(float) * 3);
|
||||
memcpy(&write_buffer[i * mesh_stride + mesh_surface_offsets[VS::ARRAY_NORMAL]], v_normal, 4);
|
||||
memcpy(&write_buffer[i * mesh_stride + mesh_surface_offsets[VS::ARRAY_TANGENT]], v_tangent, 4);
|
||||
memcpy(&write_buffer[i * mesh_stride + mesh_surface_offsets[VS::ARRAY_COLOR]], v_color, 4);
|
||||
}
|
||||
|
||||
write_buffer.release();
|
||||
|
@ -949,13 +949,13 @@ void AnimatedSprite3D::_draw() {
|
|||
}
|
||||
|
||||
float v_uv[2] = { uvs[i].x, uvs[i].y };
|
||||
copymem(&write_buffer[i * mesh_stride + mesh_surface_offsets[VS::ARRAY_TEX_UV]], v_uv, 8);
|
||||
memcpy(&write_buffer[i * mesh_stride + mesh_surface_offsets[VS::ARRAY_TEX_UV]], v_uv, 8);
|
||||
|
||||
float v_vertex[3] = { vtx.x, vtx.y, vtx.z };
|
||||
copymem(&write_buffer[i * mesh_stride + mesh_surface_offsets[VS::ARRAY_VERTEX]], &v_vertex, sizeof(float) * 3);
|
||||
copymem(&write_buffer[i * mesh_stride + mesh_surface_offsets[VS::ARRAY_NORMAL]], v_normal, 4);
|
||||
copymem(&write_buffer[i * mesh_stride + mesh_surface_offsets[VS::ARRAY_TANGENT]], v_tangent, 4);
|
||||
copymem(&write_buffer[i * mesh_stride + mesh_surface_offsets[VS::ARRAY_COLOR]], v_color, 4);
|
||||
memcpy(&write_buffer[i * mesh_stride + mesh_surface_offsets[VS::ARRAY_VERTEX]], &v_vertex, sizeof(float) * 3);
|
||||
memcpy(&write_buffer[i * mesh_stride + mesh_surface_offsets[VS::ARRAY_NORMAL]], v_normal, 4);
|
||||
memcpy(&write_buffer[i * mesh_stride + mesh_surface_offsets[VS::ARRAY_TANGENT]], v_tangent, 4);
|
||||
memcpy(&write_buffer[i * mesh_stride + mesh_surface_offsets[VS::ARRAY_COLOR]], v_color, 4);
|
||||
}
|
||||
|
||||
write_buffer.release();
|
||||
|
|
|
@ -731,7 +731,7 @@ void VoxelLightBaker::_check_init_light() {
|
|||
leaf_voxel_count = 0;
|
||||
_fixup_plot(0, 0); //pre fixup, so normal, albedo, emission, etc. work for lighting.
|
||||
bake_light.resize(bake_cells.size());
|
||||
//zeromem(bake_light.ptrw(), bake_light.size() * sizeof(Light));
|
||||
//memset(bake_light.ptrw(), 0, bake_light.size() * sizeof(Light));
|
||||
first_leaf = -1;
|
||||
_init_light_plot(0, 0, 0, 0, 0, CHILD_EMPTY);
|
||||
}
|
||||
|
@ -1596,7 +1596,7 @@ PoolVector<uint8_t> VoxelLightBaker::create_capture_octree(int p_subdiv) {
|
|||
ret.resize(ret_bytes);
|
||||
{
|
||||
PoolVector<uint8_t>::Write w = ret.write();
|
||||
copymem(w.ptr(), octree.ptr(), ret_bytes);
|
||||
memcpy(w.ptr(), octree.ptr(), ret_bytes);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
|
|
@ -1643,7 +1643,7 @@ void TextEdit::_notification(int p_what) {
|
|||
|
||||
completion_rect.position.x = cursor_pos.x - completion_base_width - icon_area_width - csb_offset.x;
|
||||
|
||||
if (ajdusted_cursor_y + row_height + total_height > get_size().height) {
|
||||
if (ajdusted_cursor_y + row_height + total_height > get_size().height && ajdusted_cursor_y > total_height) {
|
||||
// Completion panel above the cursor line
|
||||
completion_rect.position.y = ajdusted_cursor_y - total_height;
|
||||
} else {
|
||||
|
|
|
@ -2520,35 +2520,27 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) {
|
|||
if (from && p_event->is_pressed()) {
|
||||
Control *next = NULL;
|
||||
|
||||
Input *input = Input::get_singleton();
|
||||
|
||||
if (p_event->is_action_pressed("ui_focus_next") && input->is_action_just_pressed("ui_focus_next")) {
|
||||
|
||||
if (p_event->is_action_pressed("ui_focus_next", true)) {
|
||||
next = from->find_next_valid_focus();
|
||||
}
|
||||
|
||||
if (p_event->is_action_pressed("ui_focus_prev") && input->is_action_just_pressed("ui_focus_prev")) {
|
||||
|
||||
if (p_event->is_action_pressed("ui_focus_prev", true)) {
|
||||
next = from->find_prev_valid_focus();
|
||||
}
|
||||
|
||||
if (!mods && p_event->is_action_pressed("ui_up") && input->is_action_just_pressed("ui_up")) {
|
||||
|
||||
if (!mods && p_event->is_action_pressed("ui_up", true)) {
|
||||
next = from->_get_focus_neighbour(MARGIN_TOP);
|
||||
}
|
||||
|
||||
if (!mods && p_event->is_action_pressed("ui_left") && input->is_action_just_pressed("ui_left")) {
|
||||
|
||||
if (!mods && p_event->is_action_pressed("ui_left", true)) {
|
||||
next = from->_get_focus_neighbour(MARGIN_LEFT);
|
||||
}
|
||||
|
||||
if (!mods && p_event->is_action_pressed("ui_right") && input->is_action_just_pressed("ui_right")) {
|
||||
|
||||
if (!mods && p_event->is_action_pressed("ui_right", true)) {
|
||||
next = from->_get_focus_neighbour(MARGIN_RIGHT);
|
||||
}
|
||||
|
||||
if (!mods && p_event->is_action_pressed("ui_down") && input->is_action_just_pressed("ui_down")) {
|
||||
|
||||
if (!mods && p_event->is_action_pressed("ui_down", true)) {
|
||||
next = from->_get_focus_neighbour(MARGIN_BOTTOM);
|
||||
}
|
||||
|
||||
|
|
|
@ -493,9 +493,9 @@ void AudioStreamSample::set_data(const PoolVector<uint8_t> &p_data) {
|
|||
PoolVector<uint8_t>::Read r = p_data.read();
|
||||
int alloc_len = datalen + DATA_PAD * 2;
|
||||
data = AudioServer::get_singleton()->audio_data_alloc(alloc_len); //alloc with some padding for interpolation
|
||||
zeromem(data, alloc_len);
|
||||
memset(data, 0, alloc_len);
|
||||
uint8_t *dataptr = (uint8_t *)data;
|
||||
copymem(dataptr + DATA_PAD, r.ptr(), datalen);
|
||||
memcpy(dataptr + DATA_PAD, r.ptr(), datalen);
|
||||
data_bytes = datalen;
|
||||
}
|
||||
|
||||
|
@ -511,7 +511,7 @@ PoolVector<uint8_t> AudioStreamSample::get_data() const {
|
|||
|
||||
PoolVector<uint8_t>::Write w = pv.write();
|
||||
uint8_t *dataptr = (uint8_t *)data;
|
||||
copymem(w.ptr(), dataptr + DATA_PAD, data_bytes);
|
||||
memcpy(w.ptr(), dataptr + DATA_PAD, data_bytes);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ void BitMap::create(const Size2 &p_size) {
|
|||
width = p_size.width;
|
||||
height = p_size.height;
|
||||
bitmask.resize(((width * height) / 8) + 1);
|
||||
zeromem(bitmask.ptrw(), bitmask.size());
|
||||
memset(bitmask.ptrw(), 0, bitmask.size());
|
||||
}
|
||||
|
||||
void BitMap::create_from_image_alpha(const Ref<Image> &p_image, float p_threshold) {
|
||||
|
|
|
@ -754,7 +754,6 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
|
|||
theme->set_stylebox("tab_fg", "Tabs", sb_expand(make_stylebox(tab_current_png, 4, 3, 4, 1, 16, 3, 16, 2), 2, 2, 2, 2));
|
||||
theme->set_stylebox("tab_bg", "Tabs", sb_expand(make_stylebox(tab_behind_png, 5, 4, 5, 1, 16, 5, 16, 2), 3, 3, 3, 3));
|
||||
theme->set_stylebox("tab_disabled", "Tabs", sb_expand(make_stylebox(tab_disabled_png, 5, 5, 5, 1, 16, 6, 16, 4), 3, 0, 3, 3));
|
||||
theme->set_stylebox("panel", "Tabs", tc_sb);
|
||||
theme->set_stylebox("button_pressed", "Tabs", make_stylebox(button_pressed_png, 4, 4, 4, 4));
|
||||
theme->set_stylebox("button", "Tabs", make_stylebox(button_normal_png, 4, 4, 4, 4));
|
||||
|
||||
|
|
|
@ -918,6 +918,23 @@ StringName ArrayMesh::get_blend_shape_name(int p_index) const {
|
|||
ERR_FAIL_INDEX_V(p_index, blend_shapes.size(), StringName());
|
||||
return blend_shapes[p_index];
|
||||
}
|
||||
|
||||
void ArrayMesh::set_blend_shape_name(int p_index, const StringName &p_name) {
|
||||
ERR_FAIL_INDEX(p_index, blend_shapes.size());
|
||||
|
||||
StringName name = p_name;
|
||||
int found = blend_shapes.find(name);
|
||||
if (found != -1 && found != p_index) {
|
||||
int count = 2;
|
||||
do {
|
||||
name = String(p_name) + " " + itos(count);
|
||||
count++;
|
||||
} while (blend_shapes.find(name) != -1);
|
||||
}
|
||||
|
||||
blend_shapes.write[p_index] = name;
|
||||
}
|
||||
|
||||
void ArrayMesh::clear_blend_shapes() {
|
||||
|
||||
ERR_FAIL_COND_MSG(surfaces.size(), "Can't set shape key count if surfaces are already created.");
|
||||
|
@ -1439,6 +1456,7 @@ void ArrayMesh::_bind_methods() {
|
|||
ClassDB::bind_method(D_METHOD("add_blend_shape", "name"), &ArrayMesh::add_blend_shape);
|
||||
ClassDB::bind_method(D_METHOD("get_blend_shape_count"), &ArrayMesh::get_blend_shape_count);
|
||||
ClassDB::bind_method(D_METHOD("get_blend_shape_name", "index"), &ArrayMesh::get_blend_shape_name);
|
||||
ClassDB::bind_method(D_METHOD("set_blend_shape_name", "index", "name"), &ArrayMesh::set_blend_shape_name);
|
||||
ClassDB::bind_method(D_METHOD("clear_blend_shapes"), &ArrayMesh::clear_blend_shapes);
|
||||
ClassDB::bind_method(D_METHOD("set_blend_shape_mode", "mode"), &ArrayMesh::set_blend_shape_mode);
|
||||
ClassDB::bind_method(D_METHOD("get_blend_shape_mode"), &ArrayMesh::get_blend_shape_mode);
|
||||
|
|
|
@ -129,6 +129,7 @@ public:
|
|||
virtual Ref<Material> surface_get_material(int p_idx) const = 0;
|
||||
virtual int get_blend_shape_count() const = 0;
|
||||
virtual StringName get_blend_shape_name(int p_index) const = 0;
|
||||
virtual void set_blend_shape_name(int p_index, const StringName &p_name) = 0;
|
||||
|
||||
PoolVector<Face3> get_faces() const;
|
||||
Ref<TriangleMesh> generate_triangle_mesh() const;
|
||||
|
@ -195,6 +196,7 @@ public:
|
|||
void add_blend_shape(const StringName &p_name);
|
||||
int get_blend_shape_count() const;
|
||||
StringName get_blend_shape_name(int p_index) const;
|
||||
void set_blend_shape_name(int p_index, const StringName &p_name);
|
||||
void clear_blend_shapes();
|
||||
|
||||
void set_blend_shape_mode(BlendShapeMode p_mode);
|
||||
|
|
|
@ -177,6 +177,9 @@ StringName PrimitiveMesh::get_blend_shape_name(int p_index) const {
|
|||
return StringName();
|
||||
}
|
||||
|
||||
void PrimitiveMesh::set_blend_shape_name(int p_index, const StringName &p_name) {
|
||||
}
|
||||
|
||||
AABB PrimitiveMesh::get_aabb() const {
|
||||
if (pending_request) {
|
||||
_update();
|
||||
|
|
|
@ -76,6 +76,7 @@ public:
|
|||
virtual Ref<Material> surface_get_material(int p_idx) const;
|
||||
virtual int get_blend_shape_count() const;
|
||||
virtual StringName get_blend_shape_name(int p_index) const;
|
||||
virtual void set_blend_shape_name(int p_index, const StringName &p_name);
|
||||
virtual AABB get_aabb() const;
|
||||
virtual RID get_rid() const;
|
||||
|
||||
|
|
|
@ -630,7 +630,7 @@ Error StreamTexture::_load_data(const String &p_path, int &tw, int &th, int &tw_
|
|||
PoolVector<uint8_t> id = mipmap_images[i]->get_data();
|
||||
int len = id.size();
|
||||
PoolVector<uint8_t>::Read r = id.read();
|
||||
copymem(&w[ofs], r.ptr(), len);
|
||||
memcpy(&w[ofs], r.ptr(), len);
|
||||
ofs += len;
|
||||
}
|
||||
}
|
||||
|
@ -699,7 +699,7 @@ Error StreamTexture::_load_data(const String &p_path, int &tw, int &th, int &tw_
|
|||
int expected = total_size - ofs;
|
||||
if (bytes < expected) {
|
||||
//this is a compatibility workaround for older format, which saved less mipmaps2. It is still recommended the image is reimported.
|
||||
zeromem(w.ptr() + bytes, (expected - bytes));
|
||||
memset(w.ptr() + bytes, 0, (expected - bytes));
|
||||
} else if (bytes != expected) {
|
||||
ERR_FAIL_V(ERR_FILE_CORRUPT);
|
||||
}
|
||||
|
@ -2328,7 +2328,7 @@ Error TextureLayered::load(const String &p_path) {
|
|||
PoolVector<uint8_t> id = mipmap_images[i]->get_data();
|
||||
int len = id.size();
|
||||
PoolVector<uint8_t>::Read r = id.read();
|
||||
copymem(&w[ofs], r.ptr(), len);
|
||||
memcpy(&w[ofs], r.ptr(), len);
|
||||
ofs += len;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1146,7 +1146,7 @@ void *AudioServer::audio_data_alloc(uint32_t p_data_len, const uint8_t *p_from_d
|
|||
void *ad = memalloc(p_data_len);
|
||||
ERR_FAIL_COND_V(!ad, NULL);
|
||||
if (p_from_data) {
|
||||
copymem(ad, p_from_data, p_data_len);
|
||||
memcpy(ad, p_from_data, p_data_len);
|
||||
}
|
||||
|
||||
audio_data_lock.lock();
|
||||
|
|
|
@ -89,7 +89,7 @@ AreaPair2DSW::~AreaPair2DSW() {
|
|||
if (area->has_monitor_callback())
|
||||
area->remove_body_from_query(body, body_shape, area_shape);
|
||||
}
|
||||
body->remove_constraint(this);
|
||||
body->remove_constraint(this, 0);
|
||||
area->remove_constraint(this);
|
||||
}
|
||||
|
||||
|
|
|
@ -576,16 +576,13 @@ void Body2DSW::integrate_velocities(real_t p_step) {
|
|||
}
|
||||
|
||||
void Body2DSW::wakeup_neighbours() {
|
||||
|
||||
for (Map<Constraint2DSW *, int>::Element *E = constraint_map.front(); E; E = E->next()) {
|
||||
|
||||
const Constraint2DSW *c = E->key();
|
||||
for (List<Pair<Constraint2DSW *, int> >::Element *E = constraint_list.front(); E; E = E->next()) {
|
||||
const Constraint2DSW *c = E->get().first;
|
||||
Body2DSW **n = c->get_body_ptr();
|
||||
int bc = c->get_body_count();
|
||||
|
||||
for (int i = 0; i < bc; i++) {
|
||||
|
||||
if (i == E->get())
|
||||
if (i == E->get().second)
|
||||
continue;
|
||||
Body2DSW *b = n[i];
|
||||
if (b->mode != Physics2DServer::BODY_MODE_RIGID)
|
||||
|
|
|
@ -33,6 +33,8 @@
|
|||
|
||||
#include "area_2d_sw.h"
|
||||
#include "collision_object_2d_sw.h"
|
||||
#include "core/list.h"
|
||||
#include "core/pair.h"
|
||||
#include "core/vset.h"
|
||||
|
||||
class Constraint2DSW;
|
||||
|
@ -84,7 +86,7 @@ class Body2DSW : public CollisionObject2DSW {
|
|||
virtual void _shapes_changed();
|
||||
Transform2D new_transform;
|
||||
|
||||
Map<Constraint2DSW *, int> constraint_map;
|
||||
List<Pair<Constraint2DSW *, int> > constraint_list;
|
||||
|
||||
struct AreaCMP {
|
||||
|
||||
|
@ -180,10 +182,10 @@ public:
|
|||
_FORCE_INLINE_ Body2DSW *get_island_list_next() const { return island_list_next; }
|
||||
_FORCE_INLINE_ void set_island_list_next(Body2DSW *p_next) { island_list_next = p_next; }
|
||||
|
||||
_FORCE_INLINE_ void add_constraint(Constraint2DSW *p_constraint, int p_pos) { constraint_map[p_constraint] = p_pos; }
|
||||
_FORCE_INLINE_ void remove_constraint(Constraint2DSW *p_constraint) { constraint_map.erase(p_constraint); }
|
||||
const Map<Constraint2DSW *, int> &get_constraint_map() const { return constraint_map; }
|
||||
_FORCE_INLINE_ void clear_constraint_map() { constraint_map.clear(); }
|
||||
_FORCE_INLINE_ void add_constraint(Constraint2DSW *p_constraint, int p_pos) { constraint_list.push_back({ p_constraint, p_pos }); }
|
||||
_FORCE_INLINE_ void remove_constraint(Constraint2DSW *p_constraint, int p_pos) { constraint_list.erase({ p_constraint, p_pos }); }
|
||||
const List<Pair<Constraint2DSW *, int> > &get_constraint_list() const { return constraint_list; }
|
||||
_FORCE_INLINE_ void clear_constraint_list() { constraint_list.clear(); }
|
||||
|
||||
_FORCE_INLINE_ void set_omit_force_integration(bool p_omit_force_integration) { omit_force_integration = p_omit_force_integration; }
|
||||
_FORCE_INLINE_ bool get_omit_force_integration() const { return omit_force_integration; }
|
||||
|
|
|
@ -516,7 +516,6 @@ BodyPair2DSW::BodyPair2DSW(Body2DSW *p_A, int p_shape_A, Body2DSW *p_B, int p_sh
|
|||
}
|
||||
|
||||
BodyPair2DSW::~BodyPair2DSW() {
|
||||
|
||||
A->remove_constraint(this);
|
||||
B->remove_constraint(this);
|
||||
A->remove_constraint(this, 0);
|
||||
B->remove_constraint(this, 1);
|
||||
}
|
||||
|
|
|
@ -204,11 +204,12 @@ PinJoint2DSW::PinJoint2DSW(const Vector2 &p_pos, Body2DSW *p_body_a, Body2DSW *p
|
|||
}
|
||||
|
||||
PinJoint2DSW::~PinJoint2DSW() {
|
||||
|
||||
if (A)
|
||||
A->remove_constraint(this);
|
||||
if (B)
|
||||
B->remove_constraint(this);
|
||||
if (A) {
|
||||
A->remove_constraint(this, 0);
|
||||
}
|
||||
if (B) {
|
||||
B->remove_constraint(this, 1);
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////
|
||||
|
@ -350,9 +351,8 @@ GrooveJoint2DSW::GrooveJoint2DSW(const Vector2 &p_a_groove1, const Vector2 &p_a_
|
|||
}
|
||||
|
||||
GrooveJoint2DSW::~GrooveJoint2DSW() {
|
||||
|
||||
A->remove_constraint(this);
|
||||
B->remove_constraint(this);
|
||||
A->remove_constraint(this, 0);
|
||||
B->remove_constraint(this, 1);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////
|
||||
|
@ -463,7 +463,6 @@ DampedSpringJoint2DSW::DampedSpringJoint2DSW(const Vector2 &p_anchor_a, const Ve
|
|||
}
|
||||
|
||||
DampedSpringJoint2DSW::~DampedSpringJoint2DSW() {
|
||||
|
||||
A->remove_constraint(this);
|
||||
B->remove_constraint(this);
|
||||
A->remove_constraint(this, 0);
|
||||
B->remove_constraint(this, 1);
|
||||
}
|
||||
|
|
|
@ -598,7 +598,7 @@ void Physics2DServerSW::body_set_space(RID p_body, RID p_space) {
|
|||
if (body->get_space() == space)
|
||||
return; //pointless
|
||||
|
||||
body->clear_constraint_map();
|
||||
body->clear_constraint_list();
|
||||
body->set_space(space);
|
||||
};
|
||||
|
||||
|
|
|
@ -37,9 +37,8 @@ void Step2DSW::_populate_island(Body2DSW *p_body, Body2DSW **p_island, Constrain
|
|||
p_body->set_island_next(*p_island);
|
||||
*p_island = p_body;
|
||||
|
||||
for (Map<Constraint2DSW *, int>::Element *E = p_body->get_constraint_map().front(); E; E = E->next()) {
|
||||
|
||||
Constraint2DSW *c = (Constraint2DSW *)E->key();
|
||||
for (const List<Pair<Constraint2DSW *, int> >::Element *E = p_body->get_constraint_list().front(); E; E = E->next()) {
|
||||
Constraint2DSW *c = (Constraint2DSW *)E->get().first;
|
||||
if (c->get_island_step() == _step)
|
||||
continue; //already processed
|
||||
c->set_island_step(_step);
|
||||
|
@ -47,7 +46,7 @@ void Step2DSW::_populate_island(Body2DSW *p_body, Body2DSW **p_island, Constrain
|
|||
*p_constraint_island = c;
|
||||
|
||||
for (int i = 0; i < c->get_body_count(); i++) {
|
||||
if (i == E->get())
|
||||
if (i == E->get().second)
|
||||
continue;
|
||||
Body2DSW *b = c->get_body_ptr()[i];
|
||||
if (b->get_island_step() == _step || b->get_mode() == Physics2DServer::BODY_MODE_STATIC || b->get_mode() == Physics2DServer::BODY_MODE_KINEMATIC)
|
||||
|
|
|
@ -1272,7 +1272,7 @@ _FORCE_INLINE_ static void _light_capture_sample_octree(const RasterizerStorage:
|
|||
|
||||
Vector3 color[2][8];
|
||||
float alpha[2][8];
|
||||
zeromem(alpha, sizeof(float) * 2 * 8);
|
||||
memset(alpha, 0, sizeof(float) * 2 * 8);
|
||||
|
||||
//find cell at given level first
|
||||
|
||||
|
@ -2573,7 +2573,7 @@ void VisualServerScene::_setup_gi_probe(Instance *p_instance) {
|
|||
size /= size_divisor;
|
||||
mipmap.resize(size);
|
||||
PoolVector<uint8_t>::Write w = mipmap.write();
|
||||
zeromem(w.ptr(), size);
|
||||
memset(w.ptr(), 0, size);
|
||||
w.release();
|
||||
|
||||
probe->dynamic.mipmaps_3d.push_back(mipmap);
|
||||
|
@ -3154,7 +3154,7 @@ void VisualServerScene::_bake_gi_probe(Instance *p_gi_probe) {
|
|||
const InstanceGIProbeData::CompBlockS3TC &b = mmr[i];
|
||||
|
||||
uint8_t *blockptr = &mmw[b.offset * 16];
|
||||
copymem(blockptr, b.alpha, 8); //copy alpha part, which is precomputed
|
||||
memcpy(blockptr, b.alpha, 8); //copy alpha part, which is precomputed
|
||||
|
||||
Vector3 colors[16];
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue