diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/cscript/godot_c.h | 2 | ||||
-rw-r--r-- | modules/dds/texture_loader_dds.cpp | 14 | ||||
-rw-r--r-- | modules/enet/SCsub | 4 | ||||
-rw-r--r-- | modules/enet/networked_multiplayer_enet.cpp | 33 | ||||
-rw-r--r-- | modules/enet/networked_multiplayer_enet.h | 2 | ||||
-rw-r--r-- | modules/gdscript/gd_compiler.cpp | 4 | ||||
-rw-r--r-- | modules/gdscript/gd_editor.cpp | 2 | ||||
-rw-r--r-- | modules/gdscript/gd_parser.cpp | 8 | ||||
-rw-r--r-- | modules/gdscript/gd_script.cpp | 4 | ||||
-rw-r--r-- | modules/stb_vorbis/audio_stream_ogg_vorbis.cpp | 2 | ||||
-rw-r--r-- | modules/visual_script/visual_script.cpp | 2 | ||||
-rw-r--r-- | modules/visual_script/visual_script_expression.cpp | 2 |
12 files changed, 47 insertions, 32 deletions
diff --git a/modules/cscript/godot_c.h b/modules/cscript/godot_c.h index e38de1e489..58acbf8bf9 100644 --- a/modules/cscript/godot_c.h +++ b/modules/cscript/godot_c.h @@ -491,7 +491,7 @@ godot_variant GDAPI godot_instance_get(godot_instance p_instance, char *p_prop); #define GODOT_PROPERTY_HINT_RANGE 1 ///< hint_text = "min,max,step,slider; //slider is optional" #define GODOT_PROPERTY_HINT_EXP_RANGE 2 ///< hint_text = "min,max,step", exponential edit #define GODOT_PROPERTY_HINT_ENUM 3 ///< hint_text= "val1,val2,val3,etc" -#define GODOT_PROPERTY_HINT_EXP_EASING 4 /// exponential easing funciton (Math::ease) +#define GODOT_PROPERTY_HINT_EXP_EASING 4 /// exponential easing function (Math::ease) #define GODOT_PROPERTY_HINT_LENGTH 5 ///< hint_text= "length" (as integer) #define GODOT_PROPERTY_HINT_SPRITE_FRAME 6 #define GODOT_PROPERTY_HINT_KEY_ACCEL 7 ///< hint_text= "length" (as integer) diff --git a/modules/dds/texture_loader_dds.cpp b/modules/dds/texture_loader_dds.cpp index 9c976179fa..ac981d2b1a 100644 --- a/modules/dds/texture_loader_dds.cpp +++ b/modules/dds/texture_loader_dds.cpp @@ -253,13 +253,13 @@ RES ResourceFormatDDS::load(const String &p_path, const String &p_original_path, uint32_t size = pitch * height; ERR_FAIL_COND_V(size != width * height * info.block_size, RES()); - uint8_t pallete[256 * 4]; - f->get_buffer(pallete, 256 * 4); + uint8_t palette[256 * 4]; + f->get_buffer(palette, 256 * 4); int colsize = 3; for (int i = 0; i < 256; i++) { - if (pallete[i * 4 + 3] < 255) + if (palette[i * 4 + 3] < 255) colsize = 4; } @@ -281,11 +281,11 @@ RES ResourceFormatDDS::load(const String &p_path, const String &p_original_path, int dst_ofs = size + i * colsize; int src_ofs = i * 4; - wb[dst_ofs + 0] = pallete[src_ofs + 2]; - wb[dst_ofs + 1] = pallete[src_ofs + 1]; - wb[dst_ofs + 2] = pallete[src_ofs + 0]; + wb[dst_ofs + 0] = palette[src_ofs + 2]; + wb[dst_ofs + 1] = palette[src_ofs + 1]; + wb[dst_ofs + 2] = palette[src_ofs + 0]; if (colsize == 4) - wb[dst_ofs + 3] = pallete[src_ofs + 3]; + wb[dst_ofs + 3] = palette[src_ofs + 3]; } wb = PoolVector<uint8_t>::Write(); diff --git a/modules/enet/SCsub b/modules/enet/SCsub index fb22d1cff0..42a933a66d 100644 --- a/modules/enet/SCsub +++ b/modules/enet/SCsub @@ -10,6 +10,7 @@ env_enet = env_modules.Clone() if (env['builtin_enet'] != 'no'): thirdparty_dir = "#thirdparty/enet/" thirdparty_sources = [ + "godot.cpp", "callbacks.c", "compress.c", "host.c", @@ -17,12 +18,11 @@ if (env['builtin_enet'] != 'no'): "packet.c", "peer.c", "protocol.c", - "unix.c", - "win32.c", ] thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] env_enet.add_source_files(env.modules_sources, thirdparty_sources) env_enet.Append(CPPPATH=[thirdparty_dir]) + env_enet.Append(CPPFLAGS=["-DGODOT_ENET"]) env_enet.add_source_files(env.modules_sources, "*.cpp") diff --git a/modules/enet/networked_multiplayer_enet.cpp b/modules/enet/networked_multiplayer_enet.cpp index 2dfb0b4a6a..13760b33aa 100644 --- a/modules/enet/networked_multiplayer_enet.cpp +++ b/modules/enet/networked_multiplayer_enet.cpp @@ -53,8 +53,21 @@ Error NetworkedMultiplayerENet::create_server(int p_port, int p_max_clients, int ERR_FAIL_COND_V(active, ERR_ALREADY_IN_USE); ENetAddress address; - address.host = bind_ip; +#ifdef GODOT_ENET + if (bind_ip.is_wildcard()) { + address.wildcard = 1; + } else { + enet_address_set_ip(&address, bind_ip.get_ipv6(), 16); + } +#else + if (bind_ip.is_wildcard()) { + address.host = 0; + } else { + ERR_FAIL_COND_V(!bind_ip.is_ipv4(), ERR_INVALID_PARAMETER); + address.host = *(uint32_t *)bind_ip.get_ipv4(); + } +#endif address.port = p_port; host = enet_host_create(&address /* the address to bind the server host to */, @@ -76,7 +89,6 @@ Error NetworkedMultiplayerENet::create_server(int p_port, int p_max_clients, int Error NetworkedMultiplayerENet::create_client(const IP_Address &p_ip, int p_port, int p_in_bandwidth, int p_out_bandwidth) { ERR_FAIL_COND_V(active, ERR_ALREADY_IN_USE); - ERR_FAIL_COND_V(!p_ip.is_ipv4(), ERR_INVALID_PARAMETER); host = enet_host_create(NULL /* create a client host */, 1 /* only allow 1 outgoing connection */, @@ -89,7 +101,12 @@ Error NetworkedMultiplayerENet::create_client(const IP_Address &p_ip, int p_port _setup_compressor(); ENetAddress address; - address.host = *((uint32_t *)p_ip.get_ipv4()); +#ifdef GODOT_ENET + enet_address_set_ip(&address, p_ip.get_ipv6(), 16); +#else + ERR_FAIL_COND_V(!p_ip.is_ipv4(), ERR_INVALID_PARAMETER); + address.host = *(uint32_t *)p_ip.get_ipv4(); +#endif address.port = p_port; //enet_address_set_host (& address, "localhost"); @@ -146,9 +163,6 @@ void NetworkedMultiplayerENet::poll() { break; } - IP_Address ip; - ip.set_ipv4((uint8_t *)&(event.peer->address.host)); - int *new_id = memnew(int); *new_id = event.data; @@ -657,7 +671,7 @@ NetworkedMultiplayerENet::NetworkedMultiplayerENet() { enet_compressor.decompress = enet_decompress; enet_compressor.destroy = enet_compressor_destroy; - bind_ip = ENET_HOST_ANY; + bind_ip = IP_Address("*"); } NetworkedMultiplayerENet::~NetworkedMultiplayerENet() { @@ -668,6 +682,7 @@ NetworkedMultiplayerENet::~NetworkedMultiplayerENet() { // sets IP for ENet to bind when using create_server // if no IP is set, then ENet bind to ENET_HOST_ANY void NetworkedMultiplayerENet::set_bind_ip(const IP_Address &p_ip) { - ERR_FAIL_COND(!p_ip.is_ipv4()); - bind_ip = *(uint32_t *)p_ip.get_ipv4(); + ERR_FAIL_COND(!p_ip.is_valid() && !p_ip.is_wildcard()); + + bind_ip = p_ip; } diff --git a/modules/enet/networked_multiplayer_enet.h b/modules/enet/networked_multiplayer_enet.h index 4b632adcc5..deddf4ecc7 100644 --- a/modules/enet/networked_multiplayer_enet.h +++ b/modules/enet/networked_multiplayer_enet.h @@ -100,7 +100,7 @@ private: static void enet_compressor_destroy(void *context); void _setup_compressor(); - enet_uint32 bind_ip; + IP_Address bind_ip; protected: static void _bind_methods(); diff --git a/modules/gdscript/gd_compiler.cpp b/modules/gdscript/gd_compiler.cpp index 3f8c710674..245f44887c 100644 --- a/modules/gdscript/gd_compiler.cpp +++ b/modules/gdscript/gd_compiler.cpp @@ -1539,7 +1539,7 @@ Error GDCompiler::_parse_function(GDScript *p_script, const GDParser::ClassNode signature += "::0"; } - //funciton and class + //function and class if (p_class->name) { signature += "::" + String(p_class->name) + "." + String(func_name); @@ -1660,7 +1660,7 @@ Error GDCompiler::_parse_class(GDScript *p_script, GDScript *p_owner, const GDPa String sub = p_class->extends_class[i]; if (script->subclasses.has(sub)) { - Ref<Script> subclass = script->subclasses[sub]; //avoid reference from dissapearing + Ref<Script> subclass = script->subclasses[sub]; //avoid reference from disappearing script = subclass; } else { diff --git a/modules/gdscript/gd_editor.cpp b/modules/gdscript/gd_editor.cpp index 702876ecdc..1499f167c4 100644 --- a/modules/gdscript/gd_editor.cpp +++ b/modules/gdscript/gd_editor.cpp @@ -1070,7 +1070,7 @@ static bool _guess_identifier_type(GDCompletionContext &context, int p_line, con //return _guess_expression_type(context,context._class->variables[i].expression,context._class->variables[i].line,r_type); } - //try to guess from assignment in construtor or _ready + //try to guess from assignment in constructor or _ready if (_guess_identifier_from_assignment_in_function(context, p_line + 1, p_identifier, "_ready", r_type)) return true; if (_guess_identifier_from_assignment_in_function(context, p_line + 1, p_identifier, "_enter_tree", r_type)) diff --git a/modules/gdscript/gd_parser.cpp b/modules/gdscript/gd_parser.cpp index b37181bf3f..1540bb51f8 100644 --- a/modules/gdscript/gd_parser.cpp +++ b/modules/gdscript/gd_parser.cpp @@ -1021,7 +1021,7 @@ GDParser::Node *GDParser::_parse_expression(Node *p_parent, bool p_static, bool OperatorNode::Operator op; bool valid = true; -//assign, if allowed is only alowed on the first operator +//assign, if allowed is only allowed on the first operator #define _VALIDATE_ASSIGN \ if (!p_allow_assign) { \ _set_error("Unexpected assign."); \ @@ -1253,7 +1253,7 @@ GDParser::Node *GDParser::_parse_expression(Node *p_parent, bool p_static, bool // this is not invalid and can really appear // but it becomes invalid anyway because no binary op // can be followed by an unary op in a valid combination, - // due to how precedence works, unaries will always dissapear first + // due to how precedence works, unaries will always disappear first _set_error("Unexpected two consecutive operators after ternary if."); return NULL; @@ -1263,7 +1263,7 @@ GDParser::Node *GDParser::_parse_expression(Node *p_parent, bool p_static, bool // this is not invalid and can really appear // but it becomes invalid anyway because no binary op // can be followed by an unary op in a valid combination, - // due to how precedence works, unaries will always dissapear first + // due to how precedence works, unaries will always disappear first _set_error("Unexpected two consecutive operators after ternary else."); return NULL; @@ -1300,7 +1300,7 @@ GDParser::Node *GDParser::_parse_expression(Node *p_parent, bool p_static, bool // this is not invalid and can really appear // but it becomes invalid anyway because no binary op // can be followed by an unary op in a valid combination, - // due to how precedence works, unaries will always dissapear first + // due to how precedence works, unaries will always disappear first _set_error("Unexpected two consecutive operators."); return NULL; diff --git a/modules/gdscript/gd_script.cpp b/modules/gdscript/gd_script.cpp index e1cc75acfc..9aafe41a0c 100644 --- a/modules/gdscript/gd_script.cpp +++ b/modules/gdscript/gd_script.cpp @@ -532,7 +532,7 @@ bool GDScript::_update_exports() { } } } else { - //print_line("unchaged is "+get_path()); + //print_line("unchanged is "+get_path()); } if (base_cache.is_valid()) { @@ -1271,7 +1271,7 @@ void GDInstance::call_multilevel_reversed(const StringName &p_method, const Vari void GDInstance::notification(int p_notification) { - //notification is not virutal, it gets called at ALL levels just like in C. + //notification is not virtual, it gets called at ALL levels just like in C. Variant value = p_notification; const Variant *args[1] = { &value }; diff --git a/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp b/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp index 884eb905fa..1c6e7e461d 100644 --- a/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp +++ b/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp @@ -180,7 +180,7 @@ void AudioStreamOGGVorbis::set_data(const PoolVector<uint8_t> &p_data) { //does this work? (it's less mem..) //decode_mem_size = ogg_alloc.alloc_buffer_length_in_bytes + info.setup_memory_required + info.temp_memory_required + info.max_frame_size; - //print_line("succeded "+itos(ogg_alloc.alloc_buffer_length_in_bytes)+" setup "+itos(info.setup_memory_required)+" setup temp "+itos(info.setup_temp_memory_required)+" temp "+itos(info.temp_memory_required)+" maxframe"+itos(info.max_frame_size)); + //print_line("succeeded "+itos(ogg_alloc.alloc_buffer_length_in_bytes)+" setup "+itos(info.setup_memory_required)+" setup temp "+itos(info.setup_temp_memory_required)+" temp "+itos(info.temp_memory_required)+" maxframe"+itos(info.max_frame_size)); length = stb_vorbis_stream_length_in_seconds(ogg_stream); stb_vorbis_close(ogg_stream); diff --git a/modules/visual_script/visual_script.cpp b/modules/visual_script/visual_script.cpp index 2b884c34fb..610309afca 100644 --- a/modules/visual_script/visual_script.cpp +++ b/modules/visual_script/visual_script.cpp @@ -1489,7 +1489,7 @@ Variant VisualScriptInstance::_call_internal(const StringName &p_method, void *p VSDEBUG("WORKING MEM: " + itos(node->working_mem_idx)); if (current_node_id == f->node) { - //if function node, set up function arguments from begining of stack + //if function node, set up function arguments from beginning of stack for (int i = 0; i < f->argument_count; i++) { input_args[i] = &variant_stack[i]; diff --git a/modules/visual_script/visual_script_expression.cpp b/modules/visual_script/visual_script_expression.cpp index 741b422848..96864b4bf6 100644 --- a/modules/visual_script/visual_script_expression.cpp +++ b/modules/visual_script/visual_script_expression.cpp @@ -1180,7 +1180,7 @@ VisualScriptExpression::ENode *VisualScriptExpression::_parse_expression() { // this is not invalid and can really appear // but it becomes invalid anyway because no binary op // can be followed by an unary op in a valid combination, - // due to how precedence works, unaries will always dissapear first + // due to how precedence works, unaries will always disappear first _set_error("Unexpected two consecutive operators."); return NULL; |