Fix two typos from previous commit
Also cleanup comments on variant types.
This commit is contained in:
parent
98a3296702
commit
c3baf5eb3c
@ -506,21 +506,21 @@ static _GlobalConstant _global_constants[] = {
|
||||
{ "TYPE_TRANSFORM2D", Variant::TRANSFORM2D },
|
||||
{ "TYPE_PLANE", Variant::PLANE },
|
||||
{ "TYPE_QUAT", Variant::QUAT }, // 10
|
||||
{ "TYPE_RECT3", Variant::RECT3 }, //sorry naming convention fail :( not like it's used often
|
||||
{ "TYPE_RECT3", Variant::RECT3 },
|
||||
{ "TYPE_BASIS", Variant::BASIS },
|
||||
{ "TYPE_TRANSFORM", Variant::TRANSFORM },
|
||||
{ "TYPE_COLOR", Variant::COLOR },
|
||||
{ "TYPE_NODE_PATH", Variant::NODE_PATH },
|
||||
{ "TYPE_NODE_PATH", Variant::NODE_PATH }, // 15
|
||||
{ "TYPE_RID", Variant::_RID },
|
||||
{ "TYPE_OBJECT", Variant::OBJECT },
|
||||
{ "TYPE_INPUT_EVENT", Variant::INPUT_EVENT },
|
||||
{ "TYPE_DICTIONARY", Variant::DICTIONARY }, // 20
|
||||
{ "TYPE_ARRAY", Variant::ARRAY },
|
||||
{ "TYPE_DICTIONARY", Variant::DICTIONARY },
|
||||
{ "TYPE_ARRAY", Variant::ARRAY }, // 20
|
||||
{ "TYPE_RAW_ARRAY", Variant::POOL_BYTE_ARRAY },
|
||||
{ "TYPE_INT_ARRAY", Variant::POOL_INT_ARRAY },
|
||||
{ "TYPE_REAL_ARRAY", Variant::POOL_REAL_ARRAY },
|
||||
{ "TYPE_STRING_ARRAY", Variant::POOL_STRING_ARRAY }, // 25
|
||||
{ "TYPE_VECTOR2_ARRAY", Variant::POOL_VECTOR2_ARRAY },
|
||||
{ "TYPE_STRING_ARRAY", Variant::POOL_STRING_ARRAY },
|
||||
{ "TYPE_VECTOR2_ARRAY", Variant::POOL_VECTOR2_ARRAY }, // 25
|
||||
{ "TYPE_VECTOR3_ARRAY", Variant::POOL_VECTOR3_ARRAY },
|
||||
{ "TYPE_COLOR_ARRAY", Variant::POOL_COLOR_ARRAY },
|
||||
{ "TYPE_MAX", Variant::VARIANT_MAX },
|
||||
|
@ -1960,7 +1960,7 @@ void Image::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("get_mipmap_offset", "mipmap"), &Image::get_mipmap_offset);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("resize_to_po2", "square"), &Image::resize_to_po2, DEFVAL("false"));
|
||||
ClassDB::bind_method(D_METHOD("resize", "width", "height", "interpolation"), &Image::resize_to_po2, DEFVAL(INTERPOLATE_BILINEAR));
|
||||
ClassDB::bind_method(D_METHOD("resize", "width", "height", "interpolation"), &Image::resize, DEFVAL(INTERPOLATE_BILINEAR));
|
||||
ClassDB::bind_method(D_METHOD("shrink_x2"), &Image::shrink_x2);
|
||||
ClassDB::bind_method(D_METHOD("expand_x2_hq2x"), &Image::expand_x2_hq2x);
|
||||
|
||||
|
@ -49,7 +49,7 @@ enum {
|
||||
VARIANT_VECTOR3 = 12,
|
||||
VARIANT_PLANE = 13,
|
||||
VARIANT_QUAT = 14,
|
||||
VARIANT_AABB = 15,
|
||||
VARIANT_RECT3 = 15,
|
||||
VARIANT_MATRIX3 = 16,
|
||||
VARIANT_TRANSFORM = 17,
|
||||
VARIANT_MATRIX32 = 18,
|
||||
@ -188,7 +188,7 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant &r_v) {
|
||||
r_v = v;
|
||||
|
||||
} break;
|
||||
case VARIANT_AABB: {
|
||||
case VARIANT_RECT3: {
|
||||
|
||||
Rect3 v;
|
||||
v.pos.x = f->get_real();
|
||||
@ -1332,7 +1332,7 @@ void ResourceFormatSaverBinaryInstance::write_variant(const Variant &p_property,
|
||||
} break;
|
||||
case Variant::RECT3: {
|
||||
|
||||
f->store_32(VARIANT_AABB);
|
||||
f->store_32(VARIANT_RECT3);
|
||||
Rect3 val = p_property;
|
||||
f->store_real(val.pos.x);
|
||||
f->store_real(val.pos.y);
|
||||
|
@ -91,13 +91,13 @@ public:
|
||||
TRANSFORM2D,
|
||||
PLANE,
|
||||
QUAT, // 10
|
||||
RECT3, //sorry naming convention fail :( not like it's used often
|
||||
RECT3,
|
||||
BASIS,
|
||||
TRANSFORM,
|
||||
|
||||
// misc types
|
||||
COLOR,
|
||||
NODE_PATH,
|
||||
NODE_PATH, // 15
|
||||
_RID,
|
||||
OBJECT,
|
||||
INPUT_EVENT,
|
||||
|
@ -1303,7 +1303,7 @@ void Variant::set(const Variant &p_index, const Variant &p_value, bool *r_valid)
|
||||
}
|
||||
}
|
||||
|
||||
} break;
|
||||
} break; // 10
|
||||
case RECT3: {
|
||||
|
||||
if (p_value.type != Variant::VECTOR3)
|
||||
@ -1328,7 +1328,7 @@ void Variant::set(const Variant &p_index, const Variant &p_value, bool *r_valid)
|
||||
return;
|
||||
}
|
||||
}
|
||||
} break; //sorry naming convention fail :( not like it's used often // 10
|
||||
} break;
|
||||
case BASIS: {
|
||||
|
||||
if (p_value.type != Variant::VECTOR3)
|
||||
@ -1896,13 +1896,13 @@ void Variant::set(const Variant &p_index, const Variant &p_value, bool *r_valid)
|
||||
dic->operator[](p_index) = p_value;
|
||||
valid = true; //always valid, i guess? should this really be ok?
|
||||
return;
|
||||
} break; // 20
|
||||
DEFAULT_OP_ARRAY_CMD(ARRAY, Array, ;, (*arr)[index] = p_value; return )
|
||||
} break;
|
||||
DEFAULT_OP_ARRAY_CMD(ARRAY, Array, ;, (*arr)[index] = p_value; return ) // 20
|
||||
DEFAULT_OP_DVECTOR_SET(POOL_BYTE_ARRAY, uint8_t, p_value.type != Variant::REAL && p_value.type != Variant::INT)
|
||||
DEFAULT_OP_DVECTOR_SET(POOL_INT_ARRAY, int, p_value.type != Variant::REAL && p_value.type != Variant::INT)
|
||||
DEFAULT_OP_DVECTOR_SET(POOL_REAL_ARRAY, real_t, p_value.type != Variant::REAL && p_value.type != Variant::INT)
|
||||
DEFAULT_OP_DVECTOR_SET(POOL_STRING_ARRAY, String, p_value.type != Variant::STRING) // 25
|
||||
DEFAULT_OP_DVECTOR_SET(POOL_VECTOR2_ARRAY, Vector2, p_value.type != Variant::VECTOR2)
|
||||
DEFAULT_OP_DVECTOR_SET(POOL_STRING_ARRAY, String, p_value.type != Variant::STRING)
|
||||
DEFAULT_OP_DVECTOR_SET(POOL_VECTOR2_ARRAY, Vector2, p_value.type != Variant::VECTOR2) // 25
|
||||
DEFAULT_OP_DVECTOR_SET(POOL_VECTOR3_ARRAY, Vector3, p_value.type != Variant::VECTOR3)
|
||||
DEFAULT_OP_DVECTOR_SET(POOL_COLOR_ARRAY, Color, p_value.type != Variant::COLOR)
|
||||
default: return;
|
||||
@ -2103,7 +2103,7 @@ Variant Variant::get(const Variant &p_index, bool *r_valid) const {
|
||||
}
|
||||
}
|
||||
|
||||
} break;
|
||||
} break; // 10
|
||||
case RECT3: {
|
||||
|
||||
if (p_index.get_type() == Variant::STRING) {
|
||||
@ -2122,7 +2122,7 @@ Variant Variant::get(const Variant &p_index, bool *r_valid) const {
|
||||
return v->size + v->pos;
|
||||
}
|
||||
}
|
||||
} break; //sorry naming convention fail :( not like it's used often // 10
|
||||
} break;
|
||||
case BASIS: {
|
||||
|
||||
if (p_index.get_type() == Variant::INT || p_index.get_type() == Variant::REAL) {
|
||||
@ -2498,13 +2498,13 @@ Variant Variant::get(const Variant &p_index, bool *r_valid) const {
|
||||
valid = true;
|
||||
return *res;
|
||||
}
|
||||
} break; // 20
|
||||
DEFAULT_OP_ARRAY_CMD(ARRAY, const Array, ;, return (*arr)[index])
|
||||
} break;
|
||||
DEFAULT_OP_ARRAY_CMD(ARRAY, const Array, ;, return (*arr)[index]) // 20
|
||||
DEFAULT_OP_DVECTOR_GET(POOL_BYTE_ARRAY, uint8_t)
|
||||
DEFAULT_OP_DVECTOR_GET(POOL_INT_ARRAY, int)
|
||||
DEFAULT_OP_DVECTOR_GET(POOL_REAL_ARRAY, real_t)
|
||||
DEFAULT_OP_DVECTOR_GET(POOL_STRING_ARRAY, String)
|
||||
DEFAULT_OP_DVECTOR_GET(POOL_VECTOR2_ARRAY, Vector2)
|
||||
DEFAULT_OP_DVECTOR_GET(POOL_VECTOR2_ARRAY, Vector2) // 25
|
||||
DEFAULT_OP_DVECTOR_GET(POOL_VECTOR3_ARRAY, Vector3)
|
||||
DEFAULT_OP_DVECTOR_GET(POOL_COLOR_ARRAY, Color)
|
||||
default: return Variant();
|
||||
@ -2768,12 +2768,12 @@ void Variant::get_property_list(List<PropertyInfo> *p_list) const {
|
||||
p_list->push_back(PropertyInfo(Variant::REAL, "z"));
|
||||
p_list->push_back(PropertyInfo(Variant::REAL, "w"));
|
||||
|
||||
} break;
|
||||
} break; // 10
|
||||
case RECT3: {
|
||||
p_list->push_back(PropertyInfo(Variant::VECTOR3, "pos"));
|
||||
p_list->push_back(PropertyInfo(Variant::VECTOR3, "size"));
|
||||
p_list->push_back(PropertyInfo(Variant::VECTOR3, "end"));
|
||||
} break; //sorry naming convention fail :( not like it's used often // 10
|
||||
} break;
|
||||
case BASIS: {
|
||||
|
||||
p_list->push_back(PropertyInfo(Variant::VECTOR3, "x"));
|
||||
@ -2921,12 +2921,13 @@ void Variant::get_property_list(List<PropertyInfo> *p_list) const {
|
||||
p_list->push_back(PropertyInfo(Variant::STRING, E->get()));
|
||||
}
|
||||
}
|
||||
} break; // 20
|
||||
case ARRAY:
|
||||
} break;
|
||||
case ARRAY: // 20
|
||||
case POOL_BYTE_ARRAY:
|
||||
case POOL_INT_ARRAY:
|
||||
case POOL_REAL_ARRAY:
|
||||
case POOL_STRING_ARRAY:
|
||||
case POOL_VECTOR2_ARRAY: // 25
|
||||
case POOL_VECTOR3_ARRAY:
|
||||
case POOL_COLOR_ARRAY: {
|
||||
|
||||
|
@ -504,39 +504,7 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream,
|
||||
return OK;
|
||||
|
||||
} else if (token.type == TK_IDENTIFIER) {
|
||||
/*
|
||||
VECTOR2, // 5
|
||||
RECT2,
|
||||
VECTOR3,
|
||||
MATRIX32,
|
||||
PLANE,
|
||||
QUAT, // 10
|
||||
_AABB, //sorry naming convention fail :( not like it's used often
|
||||
MATRIX3,
|
||||
TRANSFORM,
|
||||
|
||||
// misc types
|
||||
COLOR,
|
||||
IMAGE, // 15
|
||||
NODE_PATH,
|
||||
_RID,
|
||||
OBJECT,
|
||||
INPUT_EVENT,
|
||||
DICTIONARY, // 20
|
||||
ARRAY,
|
||||
|
||||
// arrays
|
||||
RAW_ARRAY,
|
||||
INT_ARRAY,
|
||||
REAL_ARRAY,
|
||||
STRING_ARRAY, // 25
|
||||
VECTOR2_ARRAY,
|
||||
VECTOR3_ARRAY,
|
||||
COLOR_ARRAY,
|
||||
|
||||
VARIANT_MAX
|
||||
|
||||
*/
|
||||
String id = token.value;
|
||||
if (id == "true")
|
||||
value = true;
|
||||
@ -1243,40 +1211,6 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream,
|
||||
return ERR_PARSE_ERROR;
|
||||
}
|
||||
|
||||
/*
|
||||
VECTOR2, // 5
|
||||
RECT2,
|
||||
VECTOR3,
|
||||
MATRIX32,
|
||||
PLANE,
|
||||
QUAT, // 10
|
||||
_AABB, //sorry naming convention fail :( not like it's used often
|
||||
MATRIX3,
|
||||
TRANSFORM,
|
||||
|
||||
// misc types
|
||||
COLOR,
|
||||
IMAGE, // 15
|
||||
NODE_PATH,
|
||||
_RID,
|
||||
OBJECT,
|
||||
INPUT_EVENT,
|
||||
DICTIONARY, // 20
|
||||
ARRAY,
|
||||
|
||||
// arrays
|
||||
RAW_ARRAY,
|
||||
INT_ARRAY,
|
||||
REAL_ARRAY,
|
||||
STRING_ARRAY, // 25
|
||||
VECTOR2_ARRAY,
|
||||
VECTOR3_ARRAY,
|
||||
COLOR_ARRAY,
|
||||
|
||||
VARIANT_MAX
|
||||
|
||||
*/
|
||||
|
||||
return OK;
|
||||
|
||||
} else if (token.type == TK_NUMBER) {
|
||||
|
@ -295,8 +295,8 @@ void DocData::generate(bool p_basic_types) {
|
||||
case Variant::REAL:
|
||||
//keep it
|
||||
break;
|
||||
case Variant::STRING: // 15
|
||||
case Variant::NODE_PATH: // 15
|
||||
case Variant::STRING:
|
||||
case Variant::NODE_PATH:
|
||||
default_arg_text = "\"" + default_arg_text + "\"";
|
||||
break;
|
||||
case Variant::TRANSFORM:
|
||||
@ -307,19 +307,19 @@ void DocData::generate(bool p_basic_types) {
|
||||
default_arg_text = Variant::get_type_name(default_arg.get_type()) + "(" + default_arg_text + ")";
|
||||
break;
|
||||
|
||||
case Variant::RECT3: //sorry naming convention fail :( not like it's used often // 10
|
||||
case Variant::RECT3:
|
||||
case Variant::COLOR:
|
||||
case Variant::PLANE:
|
||||
case Variant::POOL_BYTE_ARRAY:
|
||||
case Variant::POOL_INT_ARRAY:
|
||||
case Variant::POOL_REAL_ARRAY:
|
||||
case Variant::POOL_STRING_ARRAY: //25
|
||||
case Variant::POOL_STRING_ARRAY:
|
||||
case Variant::POOL_VECTOR2_ARRAY:
|
||||
case Variant::POOL_VECTOR3_ARRAY:
|
||||
case Variant::POOL_COLOR_ARRAY:
|
||||
default_arg_text = Variant::get_type_name(default_arg.get_type()) + "(" + default_arg_text + ")";
|
||||
break;
|
||||
case Variant::VECTOR2: // 5
|
||||
case Variant::VECTOR2:
|
||||
case Variant::RECT2:
|
||||
case Variant::VECTOR3:
|
||||
case Variant::QUAT:
|
||||
@ -332,7 +332,7 @@ void DocData::generate(bool p_basic_types) {
|
||||
break;
|
||||
}
|
||||
case Variant::INPUT_EVENT:
|
||||
case Variant::DICTIONARY: // 20
|
||||
case Variant::DICTIONARY:
|
||||
case Variant::ARRAY:
|
||||
case Variant::_RID:
|
||||
|
||||
|
@ -165,8 +165,8 @@ void DocDump::dump(const String &p_file) {
|
||||
case Variant::REAL:
|
||||
//keep it
|
||||
break;
|
||||
case Variant::STRING: // 15
|
||||
case Variant::NODE_PATH: // 15
|
||||
case Variant::STRING:
|
||||
case Variant::NODE_PATH:
|
||||
default_arg_text = "\"" + default_arg_text + "\"";
|
||||
break;
|
||||
case Variant::TRANSFORM:
|
||||
@ -177,25 +177,25 @@ void DocDump::dump(const String &p_file) {
|
||||
default_arg_text = Variant::get_type_name(default_arg.get_type()) + "(" + default_arg_text + ")";
|
||||
break;
|
||||
|
||||
case Variant::VECTOR2: // 5
|
||||
case Variant::VECTOR2:
|
||||
case Variant::RECT2:
|
||||
case Variant::VECTOR3:
|
||||
case Variant::PLANE:
|
||||
case Variant::QUAT:
|
||||
case Variant::RECT3: //sorry naming convention fail :( not like it's used often // 10
|
||||
case Variant::RECT3:
|
||||
case Variant::BASIS:
|
||||
case Variant::COLOR:
|
||||
case Variant::POOL_BYTE_ARRAY:
|
||||
case Variant::POOL_INT_ARRAY:
|
||||
case Variant::POOL_REAL_ARRAY:
|
||||
case Variant::POOL_STRING_ARRAY: //25
|
||||
case Variant::POOL_STRING_ARRAY:
|
||||
case Variant::POOL_VECTOR3_ARRAY:
|
||||
case Variant::POOL_COLOR_ARRAY:
|
||||
default_arg_text = Variant::get_type_name(default_arg.get_type()) + "(" + default_arg_text + ")";
|
||||
break;
|
||||
case Variant::OBJECT:
|
||||
case Variant::INPUT_EVENT:
|
||||
case Variant::DICTIONARY: // 20
|
||||
case Variant::DICTIONARY:
|
||||
case Variant::ARRAY:
|
||||
case Variant::_RID:
|
||||
|
||||
|
@ -62,7 +62,7 @@ typedef enum godot_variant_type {
|
||||
GODOT_VARIANT_TYPE_TRANSFORM2D,
|
||||
GODOT_VARIANT_TYPE_PLANE,
|
||||
GODOT_VARIANT_TYPE_QUAT, // 10
|
||||
GODOT_VARIANT_TYPE_RECT3, //sorry naming convention fail :( not like it's used often
|
||||
GODOT_VARIANT_TYPE_RECT3,
|
||||
GODOT_VARIANT_TYPE_BASIS,
|
||||
GODOT_VARIANT_TYPE_TRANSFORM,
|
||||
|
||||
|
@ -30,7 +30,7 @@
|
||||
#ifndef BIT_MASK_H
|
||||
#define BIT_MASK_H
|
||||
|
||||
#include "image.h" 0
|
||||
#include "image.h"
|
||||
#include "io/resource_loader.h"
|
||||
#include "resource.h"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user