diff options
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/gdscript/gd_functions.cpp | 15 | ||||
| -rw-r--r-- | modules/gdscript/gd_functions.h | 1 | ||||
| -rw-r--r-- | modules/gdscript/gd_pretty_print.cpp | 34 | ||||
| -rw-r--r-- | modules/gdscript/gd_pretty_print.h | 40 | ||||
| -rw-r--r-- | modules/gdscript/register_types.cpp | 39 | ||||
| -rw-r--r-- | modules/ik/ik.cpp | 2 | ||||
| -rw-r--r-- | modules/ik/ik.h | 4 | ||||
| -rw-r--r-- | modules/register_module_types.h | 28 |
8 files changed, 75 insertions, 88 deletions
diff --git a/modules/gdscript/gd_functions.cpp b/modules/gdscript/gd_functions.cpp index 90528614b3..ec66841662 100644 --- a/modules/gdscript/gd_functions.cpp +++ b/modules/gdscript/gd_functions.cpp @@ -87,6 +87,7 @@ const char *GDFunctions::get_func_name(Function p_func) { "funcref", "convert", "typeof", + "type_exists", "str", "print", "printt", @@ -532,6 +533,12 @@ void GDFunctions::call(Function p_func,const Variant **p_args,int p_arg_count,Va r_ret = p_args[0]->get_type(); } break; + case TYPE_EXISTS: { + + VALIDATE_ARG_COUNT(1); + r_ret = ObjectTypeDB::type_exists(*p_args[0]); + + } break; case TEXT_STR: { String str; @@ -1126,6 +1133,7 @@ bool GDFunctions::is_deterministic(Function p_func) { case LOGIC_NEAREST_PO2: case TYPE_CONVERT: case TYPE_OF: + case TYPE_EXISTS: case TEXT_STR: case COLOR8: // enable for debug only, otherwise not desirable - case GEN_RANGE: @@ -1389,6 +1397,13 @@ MethodInfo GDFunctions::get_info(Function p_func) { return mi; } break; + case TYPE_EXISTS: { + + MethodInfo mi("type_exists",PropertyInfo(Variant::STRING,"type")); + mi.return_val.type=Variant::BOOL; + return mi; + + } break; case TEXT_STR: { MethodInfo mi("str",PropertyInfo(Variant::NIL,"what"),PropertyInfo(Variant::NIL,"...")); diff --git a/modules/gdscript/gd_functions.h b/modules/gdscript/gd_functions.h index 8c88472567..c78956fe20 100644 --- a/modules/gdscript/gd_functions.h +++ b/modules/gdscript/gd_functions.h @@ -81,6 +81,7 @@ public: FUNC_FUNCREF, TYPE_CONVERT, TYPE_OF, + TYPE_EXISTS, TEXT_STR, TEXT_PRINT, TEXT_PRINT_TABBED, diff --git a/modules/gdscript/gd_pretty_print.cpp b/modules/gdscript/gd_pretty_print.cpp deleted file mode 100644 index cca3cd3984..0000000000 --- a/modules/gdscript/gd_pretty_print.cpp +++ /dev/null @@ -1,34 +0,0 @@ -/*************************************************************************/ -/* gd_pretty_print.cpp */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* */ -/* 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. */ -/*************************************************************************/ -#include "gd_pretty_print.h" - -GDPrettyPrint::GDPrettyPrint() { - - -} diff --git a/modules/gdscript/gd_pretty_print.h b/modules/gdscript/gd_pretty_print.h deleted file mode 100644 index 0106d873d9..0000000000 --- a/modules/gdscript/gd_pretty_print.h +++ /dev/null @@ -1,40 +0,0 @@ -/*************************************************************************/ -/* gd_pretty_print.h */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* */ -/* 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 GD_PRETTY_PRINT_H -#define GD_PRETTY_PRINT_H - - - - -class GDPrettyPrint { -public: - GDPrettyPrint(); -}; - -#endif // GD_PRETTY_PRINT_H diff --git a/modules/gdscript/register_types.cpp b/modules/gdscript/register_types.cpp index 2aea494f39..6aa53f03ef 100644 --- a/modules/gdscript/register_types.cpp +++ b/modules/gdscript/register_types.cpp @@ -1,14 +1,31 @@ -/*************************************************/ -/* register_script_types.cpp */ -/*************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/*************************************************/ -/* Source code within this file is: */ -/* (c) 2007-2016 Juan Linietsky, Ariel Manzur */ -/* All Rights Reserved. */ -/*************************************************/ - +/*************************************************************************/ +/* register_types.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* 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. */ +/*************************************************************************/ #include "register_types.h" #include "gd_script.h" diff --git a/modules/ik/ik.cpp b/modules/ik/ik.cpp index 6c383fdb55..172e16459e 100644 --- a/modules/ik/ik.cpp +++ b/modules/ik/ik.cpp @@ -1,12 +1,12 @@ /*************************************************************************/ /* ik.cpp */ +/* Copyright (c) 2016 Sergey Lapin <slapinid@gmail.com> */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* This file is Copyright (c) 2016 Sergey Lapin <slapinid@gmail.com> */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/ik/ik.h b/modules/ik/ik.h index 9daddb229d..b57d69b026 100644 --- a/modules/ik/ik.h +++ b/modules/ik/ik.h @@ -1,12 +1,12 @@ /*************************************************************************/ -/* ik.h */ +/* ik.h */ +/* Copyright (c) 2016 Sergey Lapin <slapinid@gmail.com> */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* This file is (c) 2016 Sergey Lapin <slapinid@gmail.com> */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/register_module_types.h b/modules/register_module_types.h index 3cc0422d80..683ce7c6b8 100644 --- a/modules/register_module_types.h +++ b/modules/register_module_types.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* register_module_types.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* 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 REGISTER_MODULE_TYPES_H #define REGISTER_MODULE_TYPES_H |