Skip to content

Commit

Permalink
Fixes small typos and grammar correction
Browse files Browse the repository at this point in the history
  • Loading branch information
Anshul7sp1 committed Mar 12, 2021
1 parent adf233e commit 91181c2
Show file tree
Hide file tree
Showing 98 changed files with 198 additions and 197 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Ability to convert visual shaders to text-based shaders.
- See the [complete list of new functions](https://github.com/godotengine/godot/pull/26164).
- Improved visual scripting.
- Visual scripting now uses an unified graph where all functions are represented.
- Visual scripting now uses a unified graph where all functions are represented.
- Nodes can now be edited directly in the graph.
- Support for fuzzy searching.
- The `tool` mode can now be enabled in visual scripts.
Expand Down Expand Up @@ -900,7 +900,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Removed many debugging prints in the console.
- Export templates now display an error dialog if no project was found when starting.
- DynamicFont oversampling is now enabled by default.
- Nodes' internal logic now consistently use internal physics processing.
- Nodes' internal logic now consistently uses internal physics processing.
- Allow attaching and clearing scripts on multiple nodes at once.
- Default values are no longer saved in scene and resource files.
- The selection rectangle of 2D nodes is now hidden when not pertinent (no more rectangle for collision shapes).
Expand Down
2 changes: 1 addition & 1 deletion SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ if selected_platform in platform_list:
if not (f[0] in ARGUMENTS): # allow command line to override platform flags
env[f[0]] = f[1]

# Must happen after the flags definition, so that they can be used by platform detect
# Must happen after the flags' definition, so that they can be used by platform detect
detect.configure(env)

# Set our C and C++ standard requirements.
Expand Down
2 changes: 1 addition & 1 deletion core/config/project_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ Error ProjectSettings::_setup(const String &p_path, const String &p_main_pack, b

if (exec_path != "") {
// We do several tests sequentially until one succeeds to find a PCK,
// and if so we attempt loading it at the end.
// and if so, we attempt loading it at the end.

// Attempt with PCK bundled into executable.
bool found = _load_resource_pack(exec_path);
Expand Down
4 changes: 2 additions & 2 deletions core/core_bind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1377,9 +1377,9 @@ Vector<String> _File::get_csv_line(const String &p_delim) const {
return f->get_csv_line(p_delim);
}

/**< use this for files WRITTEN in _big_ endian machines (ie, amiga/mac)
/**< use this for files WRITTEN in _big_ endian machines (i.e. amiga/mac)
* It's not about the current CPU type but file formats.
* this flags get reset to false (little endian) on each open
* These flags get reset to false (little endian) on each open
*/

void _File::set_endian_swap(bool p_swap) {
Expand Down
4 changes: 2 additions & 2 deletions core/crypto/crypto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,15 @@ void Crypto::load_default_certificates(String p_path) {

PackedByteArray Crypto::hmac_digest(HashingContext::HashType p_hash_type, PackedByteArray p_key, PackedByteArray p_msg) {
Ref<HMACContext> ctx = Ref<HMACContext>(HMACContext::create());
ERR_FAIL_COND_V_MSG(ctx.is_null(), PackedByteArray(), "HMAC is not available witout mbedtls module.");
ERR_FAIL_COND_V_MSG(ctx.is_null(), PackedByteArray(), "HMAC is not available without mbedtls module.");
Error err = ctx->start(p_hash_type, p_key);
ERR_FAIL_COND_V(err != OK, PackedByteArray());
err = ctx->update(p_msg);
ERR_FAIL_COND_V(err != OK, PackedByteArray());
return ctx->finish();
}

// Compares two HMACS for equality without leaking timing information in order to prevent timing attakcs.
// Compares two HMACS for equality without leaking timing information in order to prevent timing attacks.
// @see: https://paragonie.com/blog/2015/11/preventing-timing-attacks-on-string-comparison-with-double-hmac-strategy
bool Crypto::constant_time_compare(PackedByteArray p_trusted, PackedByteArray p_received) {
const uint8_t *t = p_trusted.ptr();
Expand Down
2 changes: 1 addition & 1 deletion core/debugger/engine_debugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ void EngineDebugger::deinitialize() {
singleton = nullptr;
}

// Clear profilers/captuers/protocol handlers.
// Clear profilers/captures/protocol handlers.
profilers.clear();
captures.clear();
protocols.clear();
Expand Down
4 changes: 2 additions & 2 deletions core/input/input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ void Input::warp_mouse_position(const Vector2 &p_to) {

Point2i Input::warp_mouse_motion(const Ref<InputEventMouseMotion> &p_motion, const Rect2 &p_rect) {
// The relative distance reported for the next event after a warp is in the boundaries of the
// size of the rect on that axis, but it may be greater, in which case there's not problem as fmod()
// size of the rect on that axis, but it may be greater, in which case there's no problem as fmod()
// will warp it, but if the pointer has moved in the opposite direction between the pointer relocation
// and the subsequent event, the reported relative distance will be less than the size of the rect
// and thus fmod() will be disabled for handling the situation.
Expand Down Expand Up @@ -779,7 +779,7 @@ bool Input::is_emulating_touch_from_mouse() const {
return emulate_touch_from_mouse;
}

// Calling this whenever the game window is focused helps unstucking the "touch mouse"
// Calling this whenever the game window is focused helps unsticking the "touch mouse"
// if the OS or its abstraction class hasn't properly reported that touch pointers raised
void Input::ensure_touch_mouse_raised() {
if (mouse_from_touch_index != -1) {
Expand Down
1 change: 1 addition & 0 deletions core/input/input_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,7 @@ const OrderedHashMap<String, List<Ref<InputEvent>>> &InputMap::get_builtins() {
inputs.push_back(InputEventKey::create_reference(KEY_E | KEY_MASK_CTRL));
inputs.push_back(InputEventKey::create_reference(KEY_RIGHT | KEY_MASK_CMD));
default_builtin_cache.insert("ui_text_caret_line_end.OSX", inputs);

// Text Caret Movement Page Up/Down

inputs = List<Ref<InputEvent>>();
Expand Down
6 changes: 3 additions & 3 deletions core/io/compression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ int Compression::decompress(uint8_t *p_dst, int p_dst_max_size, const uint8_t *p
}

/**
This will handle both Gzip and Deflat streams. It will automatically allocate the output buffer into the provided p_dst_vect Vector.
This is required for compressed data who's final uncompressed size is unknown, as is the case for HTTP response bodies.
This will handle both Gzip and Deflate streams. It will automatically allocate the output buffer into the provided p_dst_vect Vector.
This is required for compressed data whose final uncompressed size is unknown, as is the case for HTTP response bodies.
This is much slower however than using Compression::decompress because it may result in multiple full copies of the output buffer.
*/
int Compression::decompress_dynamic(Vector<uint8_t> *p_dst_vect, int p_max_dst_size, const uint8_t *p_src, int p_src_size, Mode p_mode) {
Expand Down Expand Up @@ -248,7 +248,7 @@ int Compression::decompress_dynamic(Vector<uint8_t> *p_dst_vect, int p_max_dst_s

out_mark += gzip_chunk;

// Encorce max output size
// Enforce max output size
if (p_max_dst_size > -1 && strm.total_out > (uint64_t)p_max_dst_size) {
(void)inflateEnd(&strm);
p_dst_vect->resize(0);
Expand Down
8 changes: 4 additions & 4 deletions core/io/multiplayer_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ _FORCE_INLINE_ bool _should_call_local(MultiplayerAPI::RPCMode mode, bool is_mas
// Do nothing.
} break;
case MultiplayerAPI::RPC_MODE_REMOTE: {
// Do nothing also. Remote cannot produce a local call.
// Do nothing. Remote cannot produce a local call.
} break;
case MultiplayerAPI::RPC_MODE_MASTERSYNC: {
if (is_master) {
Expand Down Expand Up @@ -675,7 +675,7 @@ Error MultiplayerAPI::_encode_and_compress_variant(const Variant &p_variant, uin
return err;
}
if (r_buffer) {
// The first byte is not used by the marshaling, so store the type
// The first byte is not used by the marshalling, so store the type
// so we know how to decompress and decode this variant.
r_buffer[0] = p_variant.get_type();
}
Expand Down Expand Up @@ -791,7 +791,7 @@ void MultiplayerAPI::_send_rpc(Node *p_from, int p_to, bool p_unreliable, bool p
packet_cache.resize(m_amount);

// Encode meta.
// The meta is composed by a single byte that contains (starting from the least segnificant bit):
// The meta is composed by a single byte that contains (starting from the least significant bit):
// - `NetworkCommands` in the first three bits.
// - `NetworkNodeIdCompression` in the next 2 bits.
// - `NetworkNameIdCompression` in the next 1 bit.
Expand Down Expand Up @@ -830,7 +830,7 @@ void MultiplayerAPI::_send_rpc(Node *p_from, int p_to, bool p_unreliable, bool p
ofs += 4;
}
} else {
// The targets doesn't know the node yet, so we need to use 32 bits int.
// The targets don't know the node yet, so we need to use 32 bits int.
node_id_compression = NETWORK_NODE_ID_COMPRESSION_32;
MAKE_ROOM(ofs + 4);
encode_uint32(psc->id, &(packet_cache.write[ofs]));
Expand Down
2 changes: 1 addition & 1 deletion core/io/packet_peer_udp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ Error PacketPeerUDP::connect_to_host(const IP_Address &p_host, int p_port) {

// I see no reason why we should get ERR_BUSY (wouldblock/eagain) here.
// This is UDP, so connect is only used to tell the OS to which socket
// it shuold deliver packets when multiple are bound on the same address/port.
// it should deliver packets when multiple are bound on the same address/port.
if (err != OK) {
close();
ERR_FAIL_V_MSG(FAILED, "Unable to connect");
Expand Down
2 changes: 1 addition & 1 deletion core/io/resource_format_binary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1245,7 +1245,7 @@ Error ResourceFormatLoaderBinary::rename_dependencies(const String &p_path, cons
String ResourceFormatLoaderBinary::get_resource_type(const String &p_path) const {
FileAccess *f = FileAccess::open(p_path, FileAccess::READ);
if (!f) {
return ""; //could not rwead
return ""; //could not read
}

ResourceLoaderBinary loader;
Expand Down
6 changes: 3 additions & 3 deletions core/io/resource_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ void ResourceLoader::_thread_load_function(void *p_userdata) {
load_task.loader_id = Thread::get_caller_id();

if (load_task.semaphore) {
//this is an actual thread, so wait for Ok fom semaphore
//this is an actual thread, so wait for Ok from semaphore
thread_load_semaphore->wait(); //wait until its ok to start loading
}
load_task.resource = _load(load_task.remapped_path, load_task.remapped_path != load_task.local_path ? load_task.local_path : String(), load_task.type_hint, load_task.cache_mode, &load_task.error, load_task.use_sub_threads, &load_task.progress);
Expand Down Expand Up @@ -443,7 +443,7 @@ RES ResourceLoader::load_threaded_get(const String &p_path, Error *r_error) {

ThreadLoadTask &load_task = thread_load_tasks[local_path];

//semaphore still exists, meaning its still loading, request poll
//semaphore still exists, meaning it's still loading, request poll
Semaphore *semaphore = load_task.semaphore;
if (semaphore) {
load_task.poll_requests++;
Expand All @@ -452,7 +452,7 @@ RES ResourceLoader::load_threaded_get(const String &p_path, Error *r_error) {
// As we got a semaphore, this means we are going to have to wait
// until the sub-resource is done loading
//
// As this thread will become 'blocked' we should "echange" its
// As this thread will become 'blocked' we should "exchange" its
// active status with a waiting one, to ensure load continues.
//
// This ensures loading is never blocked and that is also within
Expand Down
2 changes: 1 addition & 1 deletion core/io/translation_loader_po.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ RES TranslationLoaderPO::load_translation(FileAccess *f, Error *r_error) {
l = l.substr(1, l.length());
// Find final quote, ignoring escaped ones (\").
// The escape_next logic is necessary to properly parse things like \\"
// where the blackslash is the one being escaped, not the quote.
// where the backslash is the one being escaped, not the quote.
int end_pos = -1;
bool escape_next = false;
for (int i = 0; i < l.length(); i++) {
Expand Down
2 changes: 1 addition & 1 deletion core/io/xml_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ void XMLParser::_bind_methods() {
}

Error XMLParser::read() {
// if not end reached, parse the node
// if end not reached, parse the node
if (P && (P - data) < (int64_t)length - 1 && *P != 0) {
_parse_current_node();
return OK;
Expand Down
6 changes: 3 additions & 3 deletions core/math/basis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ bool Basis::is_symmetric() const {

Basis Basis::diagonalize() {
//NOTE: only implemented for symmetric matrices
//with the Jacobi iterative method method
//with the Jacobi iterative method
#ifdef MATH_CHECKS
ERR_FAIL_COND_V(!is_symmetric(), Basis());
#endif
Expand Down Expand Up @@ -317,7 +317,7 @@ Vector3 Basis::rotref_posscale_decomposition(Basis &rotref) const {
// Multiplies the matrix from left by the rotation matrix: M -> R.M
// Note that this does *not* rotate the matrix itself.
//
// The main use of Basis is as Transform.basis, which is used a the transformation matrix
// The main use of Basis is as Transform.basis, which is used by the transformation matrix
// of 3D object. Rotate here refers to rotation of the object (which is R * (*this)),
// not the matrix itself (which is R * (*this) * R.transposed()).
Basis Basis::rotated(const Vector3 &p_axis, real_t p_phi) const {
Expand Down Expand Up @@ -881,7 +881,7 @@ void Basis::get_axis_angle(Vector3 &r_axis, real_t &r_angle) const {
if ((Math::abs(elements[1][0] - elements[0][1]) < epsilon) && (Math::abs(elements[2][0] - elements[0][2]) < epsilon) && (Math::abs(elements[2][1] - elements[1][2]) < epsilon)) {
// singularity found
// first check for identity matrix which must have +1 for all terms
// in leading diagonaland zero in other terms
// in leading diagonal and zero in other terms
if ((Math::abs(elements[1][0] + elements[0][1]) < epsilon2) && (Math::abs(elements[2][0] + elements[0][2]) < epsilon2) && (Math::abs(elements[2][1] + elements[1][2]) < epsilon2) && (Math::abs(elements[0][0] + elements[1][1] + elements[2][2] - 3) < epsilon2)) {
// this singularity is identity matrix so angle = 0
r_axis = Vector3(0, 1, 0);
Expand Down
2 changes: 1 addition & 1 deletion core/math/expression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -978,7 +978,7 @@ Expression::ENode *Expression::_parse_expression() {
}
}

/* Reduce the set set of expressions and place them in an operator tree, respecting precedence */
/* Reduce the set of expressions and place them in an operator tree, respecting precedence */

while (expression.size() > 1) {
int next_op = -1;
Expand Down
6 changes: 3 additions & 3 deletions core/math/geometry_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ struct _AtlasWorkRectResult {
void Geometry2D::make_atlas(const Vector<Size2i> &p_rects, Vector<Point2i> &r_result, Size2i &r_size) {
// Super simple, almost brute force scanline stacking fitter.
// It's pretty basic for now, but it tries to make sure that the aspect ratio of the
// resulting atlas is somehow square. This is necessary because video cards have limits.
// On texture size (usually 2048 or 4096), so the more square a texture, the more chances.
// It will work in every hardware.
// resulting atlas is somehow square. This is necessary because video cards have limits
// on texture size (usually 2048 or 4096), so the squarer a texture, the more the chances
// that it will work in every hardware.
// For example, it will prioritize a 1024x1024 atlas (works everywhere) instead of a
// 256x8192 atlas (won't work anywhere).

Expand Down
2 changes: 1 addition & 1 deletion core/math/quick_hull.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ Error QuickHull::build(const Vector<Vector3> &p_points, Geometry3D::MeshData &r_
for (Map<Edge, FaceConnect>::Element *E = lit_edges.front(); E; E = E->next()) {
FaceConnect &fc = E->get();
if (fc.left && fc.right) {
continue; //edge is uninteresting, not on horizont
continue; //edge is uninteresting, not on horizon
}

//create new face!
Expand Down
2 changes: 1 addition & 1 deletion core/math/triangulate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ bool Triangulate::snip(const Vector<Vector2> &p_contour, int u, int v, int w, in

// It can happen that the triangulation ends up with three aligned vertices to deal with.
// In this scenario, making the check below strict may reject the possibility of
// forming a last triangle with these aligned vertices, preventing the triangulatiom
// forming a last triangle with these aligned vertices, preventing the triangulation
// from completing.
// To avoid that we allow zero-area triangles if all else failed.
float threshold = relaxed ? -CMP_EPSILON : CMP_EPSILON;
Expand Down
8 changes: 4 additions & 4 deletions core/object/object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ void Object::get_property_list(List<PropertyInfo> *p_list, bool p_reversed) cons

_get_property_listv(p_list, p_reversed);

if (!is_class("Script")) { // can still be set, but this is for userfriendlyness
if (!is_class("Script")) { // can still be set, but this is for user-friendliness
p_list->push_back(PropertyInfo(Variant::OBJECT, "script", PROPERTY_HINT_RESOURCE_TYPE, "Script", PROPERTY_USAGE_DEFAULT));
}
if (!metadata.is_empty()) {
Expand Down Expand Up @@ -1671,7 +1671,7 @@ Variant::Type Object::get_static_property_type_indexed(const Vector<StringName>

for (int i = 1; i < p_path.size(); i++) {
if (check.get_type() == Variant::OBJECT || check.get_type() == Variant::DICTIONARY || check.get_type() == Variant::ARRAY) {
// We cannot be sure about the type of properties this types can have
// We cannot be sure about the type of properties this type can have
if (r_valid) {
*r_valid = false;
}
Expand Down Expand Up @@ -1719,10 +1719,10 @@ void *Object::get_script_instance_binding(int p_script_language_index) {
ERR_FAIL_INDEX_V(p_script_language_index, MAX_SCRIPT_INSTANCE_BINDINGS, nullptr);
#endif

//it's up to the script language to make this thread safe, if the function is called twice due to threads being out of syncro
//it's up to the script language to make this thread safe, if the function is called twice due to threads being out of sync
//just return the same pointer.
//if you want to put a big lock in the entire function and keep allocated pointers in a map or something, feel free to do it
//as it should not really affect performance much (won't be called too often), as in far most caes the condition below will be false afterwards
//as it should not really affect performance much (won't be called too often), as in far most cases the condition below will be false afterwards

if (!_script_instance_bindings[p_script_language_index]) {
void *script_data = ScriptServer::get_language(p_script_language_index)->alloc_instance_binding_data(this);
Expand Down
2 changes: 1 addition & 1 deletion core/os/pool_allocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ void PoolAllocator::compact_up(int p_from) {
for (int i = entry_count - 1; i >= p_from; i--) {
Entry &entry = entry_array[entry_indices[i]];

/* determine hole size to nextious entry */
/* determine hole size for next entry */

int hole_size = next_entry_end_pos - (entry.pos + aligned(entry.len));

Expand Down
2 changes: 1 addition & 1 deletion core/string/compressed_translation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ struct _PHashTranslationCmp {

void PHashTranslation::generate(const Ref<Translation> &p_from) {
// This method compresses a Translation instance.
// Right now it doesn't handle context or plurals, so Translation subclasses using plurals or context (i.e TranslationPO) shouldn't be compressed.
// Right now, it doesn't handle context or plurals, so Translation subclasses using plurals or context (i.e TranslationPO) shouldn't be compressed.
#ifdef TOOLS_ENABLED
List<StringName> keys;
p_from->get_message_list(&keys);
Expand Down
2 changes: 1 addition & 1 deletion core/string/translation_po.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ int TranslationPO::_get_plural_index(int p_n) const {
void TranslationPO::_cache_plural_tests(const String &p_plural_rule) {
// Some examples of p_plural_rule passed in can have the form:
// "n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5" (Arabic)
// "n >= 2" (French) // When evaluating the last, esp careful with this one.
// "n >= 2" (French) // When evaluating the last, especially careful with this one.
// "n != 1" (English)
int first_ques_mark = p_plural_rule.find("?");
if (first_ques_mark == -1) {
Expand Down
4 changes: 2 additions & 2 deletions core/string/ustring.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1764,7 +1764,7 @@ bool String::parse_utf8(const char *p_utf8, int p_len) {

if (skip) {
_UNICERROR("no space left");
return true; //not enough spac
return true; //not enough space
}
}

Expand Down Expand Up @@ -4480,7 +4480,7 @@ String String::sprintf(const Array &values, bool *error) const {
for (; *self; self++) {
const char32_t c = *self;

if (in_format) { // We have % - lets see what else we get.
if (in_format) { // We have % - let's see what else we get.
switch (c) {
case '%': { // Replace %% with %
formatted += chr(c);
Expand Down
2 changes: 1 addition & 1 deletion core/variant/array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ uint32_t Array::hash() const {

void Array::_assign(const Array &p_array) {
if (_p->typed.type != Variant::OBJECT && _p->typed.type == p_array._p->typed.type) {
//same type or untyped, just reference, shuold be fine
//same type or untyped, just reference, should be fine
_ref(p_array);
} else if (_p->typed.type == Variant::NIL) { //from typed to untyped, must copy, but this is cheap anyway
_p->array = p_array._p->array;
Expand Down
Loading

0 comments on commit 91181c2

Please sign in to comment.