diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | bin/tests/test_string.cpp | 340 | ||||
-rw-r--r-- | core/ustring.cpp | 296 | ||||
-rw-r--r-- | core/ustring.h | 8 | ||||
-rw-r--r-- | core/variant_op.cpp | 14 | ||||
-rw-r--r-- | demos/3d/platformer/stage.xml | 369 |
6 files changed, 1007 insertions, 21 deletions
diff --git a/.gitignore b/.gitignore index 571af848ac..8892580de9 100644 --- a/.gitignore +++ b/.gitignore @@ -20,6 +20,7 @@ tools/editor/doc_data_compressed.h tools/editor/editor_icons.cpp -fpic .fscache +log.txt # Android specific platform/android/java/local.properties diff --git a/bin/tests/test_string.cpp b/bin/tests/test_string.cpp index 66238b066d..4aaddd8ac1 100644 --- a/bin/tests/test_string.cpp +++ b/bin/tests/test_string.cpp @@ -487,7 +487,7 @@ struct test_27_data { bool test_27() { - OS::get_singleton()->print("\n\nTest 26: begins_with\n"); + OS::get_singleton()->print("\n\nTest 27: begins_with\n"); test_27_data tc[] = { {"res://foobar", "res://", true}, {"res", "res://", false}, @@ -504,11 +504,348 @@ bool test_27() { } if (!state) { OS::get_singleton()->print("\n\t Failure on:\n\t\tstring: ", tc[i].data, "\n\t\tbegin: ", tc[i].begin, "\n\t\texpected: ", tc[i].expected ? "true" : "false", "\n"); + break; } }; return state; }; + +bool test_28() { + + OS::get_singleton()->print("\n\nTest 28: sprintf\n"); + + bool success, state = true; + char output_format[] = "\tTest:\t%ls => %ls (%s)\n"; + String format, output; + Array args; + + // %% + format = "fish %% frog"; + args.clear(); + output = format.sprintf(args); + success = (output == String("fish % frog")); + OS::get_singleton()->print(output_format, format.c_str(), output.c_str(), success ? "OK" : "FAIL"); + if (!success) state = false; + + //////// INTS + + // Int + format = "fish %d frog"; + args.clear(); + args.push_back(5); + output = format.sprintf(args); + success = (output == String("fish 5 frog")); + OS::get_singleton()->print(output_format, format.c_str(), output.c_str(), success ? "OK" : "FAIL"); + if (!success) state = false; + + // Int left padded with zeroes. + format = "fish %05d frog"; + args.clear(); + args.push_back(5); + output = format.sprintf(args); + success = (output == String("fish 00005 frog")); + OS::get_singleton()->print(output_format, format.c_str(), output.c_str(), success ? "OK" : "FAIL"); + if (!success) state = false; + + // Int left padded with spaces. + format = "fish %5d frog"; + args.clear(); + args.push_back(5); + output = format.sprintf(args); + success = (output == String("fish 5 frog")); + OS::get_singleton()->print(output_format, format.c_str(), output.c_str(), success ? "OK" : "FAIL"); + if (!success) state = false; + + // Int right padded with spaces. + format = "fish %-5d frog"; + args.clear(); + args.push_back(5); + output = format.sprintf(args); + success = (output == String("fish 5 frog")); + OS::get_singleton()->print(output_format, format.c_str(), output.c_str(), success ? "OK" : "FAIL"); + if (!success) state = false; + + // Int with sign (positive). + format = "fish %+d frog"; + args.clear(); + args.push_back(5); + output = format.sprintf(args); + success = (output == String("fish +5 frog")); + OS::get_singleton()->print(output_format, format.c_str(), output.c_str(), success ? "OK" : "FAIL"); + if (!success) state = false; + + // Negative int. + format = "fish %d frog"; + args.clear(); + args.push_back(-5); + output = format.sprintf(args); + success = (output == String("fish -5 frog")); + OS::get_singleton()->print(output_format, format.c_str(), output.c_str(), success ? "OK" : "FAIL"); + if (!success) state = false; + + // Hex (lower) + format = "fish %x frog"; + args.clear(); + args.push_back(45); + output = format.sprintf(args); + success = (output == String("fish 2d frog")); + OS::get_singleton()->print(output_format, format.c_str(), output.c_str(), success ? "OK" : "FAIL"); + if (!success) state = false; + + // Hex (upper) + format = "fish %X frog"; + args.clear(); + args.push_back(45); + output = format.sprintf(args); + success = (output == String("fish 2D frog")); + OS::get_singleton()->print(output_format, format.c_str(), output.c_str(), success ? "OK" : "FAIL"); + if (!success) state = false; + + // Octal + format = "fish %o frog"; + args.clear(); + args.push_back(99); + output = format.sprintf(args); + success = (output == String("fish 143 frog")); + OS::get_singleton()->print(output_format, format.c_str(), output.c_str(), success ? "OK" : "FAIL"); + if (!success) state = false; + + ////// REALS + + // Real + format = "fish %f frog"; + args.clear(); + args.push_back(99.99); + output = format.sprintf(args); + success = (output == String("fish 99.990000 frog")); + OS::get_singleton()->print(output_format, format.c_str(), output.c_str(), success ? "OK" : "FAIL"); + if (!success) state = false; + + // Real left-padded + format = "fish %11f frog"; + args.clear(); + args.push_back(99.99); + output = format.sprintf(args); + success = (output == String("fish 99.990000 frog")); + OS::get_singleton()->print(output_format, format.c_str(), output.c_str(), success ? "OK" : "FAIL"); + if (!success) state = false; + + // Real right-padded + format = "fish %-11f frog"; + args.clear(); + args.push_back(99.99); + output = format.sprintf(args); + success = (output == String("fish 99.990000 frog")); + OS::get_singleton()->print(output_format, format.c_str(), output.c_str(), success ? "OK" : "FAIL"); + if (!success) state = false; + + // Real given int. + format = "fish %f frog"; + args.clear(); + args.push_back(99); + output = format.sprintf(args); + success = (output == String("fish 99.000000 frog")); + OS::get_singleton()->print(output_format, format.c_str(), output.c_str(), success ? "OK" : "FAIL"); + if (!success) state = false; + + // Real with sign (positive). + format = "fish %+f frog"; + args.clear(); + args.push_back(99.99); + output = format.sprintf(args); + success = (output == String("fish +99.990000 frog")); + OS::get_singleton()->print(output_format, format.c_str(), output.c_str(), success ? "OK" : "FAIL"); + if (!success) state = false; + + // Real with 1 decimals. + format = "fish %.1f frog"; + args.clear(); + args.push_back(99.99); + output = format.sprintf(args); + success = (output == String("fish 100.0 frog")); + OS::get_singleton()->print(output_format, format.c_str(), output.c_str(), success ? "OK" : "FAIL"); + if (!success) state = false; + + // Real with 12 decimals. + format = "fish %.12f frog"; + args.clear(); + args.push_back(99.99); + output = format.sprintf(args); + success = (output == String("fish 99.990000000000 frog")); + OS::get_singleton()->print(output_format, format.c_str(), output.c_str(), success ? "OK" : "FAIL"); + if (!success) state = false; + + // Real with no decimals. + format = "fish %.f frog"; + args.clear(); + args.push_back(99.99); + output = format.sprintf(args); + success = (output == String("fish 100 frog")); + OS::get_singleton()->print(output_format, format.c_str(), output.c_str(), success ? "OK" : "FAIL"); + if (!success) state = false; + + /////// Strings. + + // String + format = "fish %s frog"; + args.clear(); + args.push_back("cheese"); + output = format.sprintf(args); + success = (output == String("fish cheese frog")); + OS::get_singleton()->print(output_format, format.c_str(), output.c_str(), success ? "OK" : "FAIL"); + if (!success) state = false; + + // String left-padded + format = "fish %10s frog"; + args.clear(); + args.push_back("cheese"); + output = format.sprintf(args); + success = (output == String("fish cheese frog")); + OS::get_singleton()->print(output_format, format.c_str(), output.c_str(), success ? "OK" : "FAIL"); + if (!success) state = false; + + // String right-padded + format = "fish %-10s frog"; + args.clear(); + args.push_back("cheese"); + output = format.sprintf(args); + success = (output == String("fish cheese frog")); + OS::get_singleton()->print(output_format, format.c_str(), output.c_str(), success ? "OK" : "FAIL"); + if (!success) state = false; + + ///// Characters + + // Character as string. + format = "fish %c frog"; + args.clear(); + args.push_back("A"); + output = format.sprintf(args); + success = (output == String("fish A frog")); + OS::get_singleton()->print(output_format, format.c_str(), output.c_str(), success ? "OK" : "FAIL"); + if (!success) state = false; + + // Character as int. + format = "fish %c frog"; + args.clear(); + args.push_back(65); + output = format.sprintf(args); + success = (output == String("fish A frog")); + OS::get_singleton()->print(output_format, format.c_str(), output.c_str(), success ? "OK" : "FAIL"); + if (!success) state = false; + + ///// Dynamic width + + // String dynamic width + format = "fish %*s frog"; + args.clear(); + args.push_back(10); + args.push_back("cheese"); + output = format.sprintf(args); + success = (output == String("fish cheese frog")); + OS::get_singleton()->print(output_format, format.c_str(), output.c_str(), success ? "OK" : "FAIL"); + if (!success) state = false; + + // Int dynamic width + format = "fish %*d frog"; + args.clear(); + args.push_back(10); + args.push_back(99); + output = format.sprintf(args); + success = (output == String("fish 99 frog")); + OS::get_singleton()->print(output_format, format.c_str(), output.c_str(), success ? "OK" : "FAIL"); + if (!success) state = false; + + // Float dynamic width + format = "fish %*.*f frog"; + args.clear(); + args.push_back(10); + args.push_back(3); + args.push_back(99.99); + output = format.sprintf(args); + success = (output == String("fish 99.990 frog")); + OS::get_singleton()->print(output_format, format.c_str(), output.c_str(), success ? "OK" : "FAIL"); + if (!success) state = false; + + ///// Errors + + // More formats than arguments. + format = "fish %s %s frog"; + args.clear(); + args.push_back("cheese"); + output = format.sprintf(args); + success = (output == ""); + OS::get_singleton()->print(output_format, format.c_str(), output.c_str(), success ? "OK" : "FAIL"); + if (!success) state = false; + + // More arguments than formats. + format = "fish %s frog"; + args.clear(); + args.push_back("hello"); + args.push_back("cheese"); + output = format.sprintf(args); + success = (output == ""); + OS::get_singleton()->print(output_format, format.c_str(), output.c_str(), success ? "OK" : "FAIL"); + if (!success) state = false; + + // Incomplete format. + format = "fish %10"; + args.clear(); + args.push_back("cheese"); + output = format.sprintf(args); + success = (output == ""); + OS::get_singleton()->print(output_format, format.c_str(), output.c_str(), success ? "OK" : "FAIL"); + if (!success) state = false; + + // Bad character in format string + format = "fish %&f frog"; + args.clear(); + args.push_back("cheese"); + output = format.sprintf(args); + success = (output == ""); + OS::get_singleton()->print(output_format, format.c_str(), output.c_str(), success ? "OK" : "FAIL"); + if (!success) state = false; + + // Too many decimals. + format = "fish %2.2.2f frog"; + args.clear(); + args.push_back(99.99); + output = format.sprintf(args); + success = (output == ""); + OS::get_singleton()->print(output_format, format.c_str(), output.c_str(), success ? "OK" : "FAIL"); + if (!success) state = false; + + // * not a number + format = "fish %*f frog"; + args.clear(); + args.push_back("cheese"); + args.push_back(99.99); + output = format.sprintf(args); + success = (output == ""); + OS::get_singleton()->print(output_format, format.c_str(), output.c_str(), success ? "OK" : "FAIL"); + if (!success) state = false; + + // Character too long. + format = "fish %c frog"; + args.clear(); + args.push_back("sc"); + output = format.sprintf(args); + success = (output == ""); + OS::get_singleton()->print(output_format, format.c_str(), output.c_str(), success ? "OK" : "FAIL"); + if (!success) state = false; + + // Character bad type. + format = "fish %c frog"; + args.clear(); + args.push_back(Array()); + output = format.sprintf(args); + success = (output == ""); + OS::get_singleton()->print(output_format, format.c_str(), output.c_str(), success ? "OK" : "FAIL"); + if (!success) state = false; + + return state; +} + typedef bool (*TestFunc)(void); TestFunc test_funcs[] = { @@ -540,6 +877,7 @@ TestFunc test_funcs[] = { test_25, test_26, test_27, + test_28, 0 }; diff --git a/core/ustring.cpp b/core/ustring.cpp index 581cc29440..476ab3f936 100644 --- a/core/ustring.cpp +++ b/core/ustring.cpp @@ -34,6 +34,7 @@ #include "io/md5.h" #include "ucaps.h" #include "color.h" +#include "variant.h" #define MAX_DIGITS 6 #define UPPERCASE(m_c) (((m_c)>='a' && (m_c)<='z')?((m_c)-('a'-'A')):(m_c)) #define LOWERCASE(m_c) (((m_c)>='A' && (m_c)<='Z')?((m_c)+('a'-'A')):(m_c)) @@ -981,7 +982,7 @@ String String::num(double p_num,int p_decimals) { } -String String::num_int64(int64_t p_num) { +String String::num_int64(int64_t p_num, int base, bool capitalize_hex) { bool sign=p_num<0; int64_t num=ABS(p_num); @@ -990,7 +991,7 @@ String String::num_int64(int64_t p_num) { int chars=0; do { - n/=10; + n/=base; chars++; } while(n); @@ -1002,8 +1003,15 @@ String String::num_int64(int64_t p_num) { c[chars]=0; n=num; do { - c[--chars]='0'+(n%10); - n/=10; + int mod = n%base; + if (mod >= 10) { + char a = (capitalize_hex ? 'A' : 'a'); + c[--chars]=a+(mod - 10); + } else { + c[--chars]='0'+mod; + } + + n/=base; } while(n); if (sign) @@ -3518,4 +3526,284 @@ String rtoss(double p_val) { return String::num_scientific(p_val); } +// Right-pad with a character. +String String::rpad(int min_length, const String& character) const { + String s = *this; + int padding = min_length - s.length(); + if (padding > 0) { + for (int i = 0; i < padding; i++) s = s + character; + } + + return s; +} +// Left-pad with a character. +String String::lpad(int min_length, const String& character) const { + String s = *this; + int padding = min_length - s.length(); + if (padding > 0) { + for (int i = 0; i < padding; i++) s = character + s; + } + + return s; +} + +// sprintf is implemented in GDScript via: +// "fish %s pie" % "frog" +// "fish %s %d pie" % ["frog", 12] +String String::sprintf(const Array& values) const { + + String formatted; + CharType* self = (CharType*)c_str(); + int num_items = values.size(); + bool in_format = false; + int value_index = 0; + int min_chars; + int min_decimals; + bool in_decimals; + bool pad_with_zeroes; + bool left_justified; + bool show_sign; + + + for (; *self; self++) { + const CharType c = *self; + + if (in_format) { // We have % - lets see what else we get. + switch (c) { + case '%': { // Replace %% with % + formatted += chr(c); + in_format = false; + break; + } + case 'd': // Integer (signed) + case 'o': // Octal + case 'x': // Hexadecimal (lowercase) + case 'X': { // Hexadecimal (uppercase) + if (value_index >= values.size()) { + ERR_EXPLAIN("not enough arguments for format string"); + ERR_FAIL_V(""); + } + + if (!values[value_index].is_num()) { + ERR_EXPLAIN("a number is required"); + ERR_FAIL_V(""); + } + + int64_t value = values[value_index]; + int base; + bool capitalize = false; + switch (c) { + case 'd': base = 10; break; + case 'o': base = 8; break; + case 'x': base = 16; break; + case 'X': base = 16; capitalize = true; break; + } + // Get basic number. + String str = String::num_int64(value, base, capitalize); + + // Sign. + if (show_sign && value >= 0) { + str = str.insert(0, "+"); + } + + // Padding. + String pad_char = pad_with_zeroes ? String("0") : String(" "); + if (left_justified) { + str = str.rpad(min_chars, pad_char); + } else { + str = str.lpad(min_chars, pad_char); + } + + formatted += str; + ++value_index; + in_format = false; + + break; + } + case 'f': { // Float + if (value_index >= values.size()) { + ERR_EXPLAIN("not enough arguments for format string"); + ERR_FAIL_V(""); + } + + if (!values[value_index].is_num()) { + ERR_EXPLAIN("a number is required"); + ERR_FAIL_V(""); + } + + double value = values[value_index]; + String str = String::num(value, min_decimals); + + // Pad decimals out. + str = str.pad_decimals(min_decimals); + + // Show sign + if (show_sign && value >= 0) { + str = str.insert(0, "+"); + } + + // Padding + if (left_justified) { + str = str.rpad(min_chars); + } else { + str = str.lpad(min_chars); + } + + formatted += str; + ++value_index; + in_format = false; + + break; + } + case 's': { // String + if (value_index >= values.size()) { + ERR_EXPLAIN("not enough arguments for format string"); + ERR_FAIL_V(""); + } + + String str = values[value_index]; + // Padding. + if (left_justified) { + str = str.rpad(min_chars); + } else { + str = str.lpad(min_chars); + } + + formatted += str; + ++value_index; + in_format = false; + break; + } + case 'c': { + if (value_index >= values.size()) { + ERR_EXPLAIN("not enough arguments for format string"); + ERR_FAIL_V(""); + } + + // Convert to character. + String str; + if (values[value_index].is_num()) { + int value = values[value_index]; + if (value < 0) { + ERR_EXPLAIN("unsigned byte integer is lower than maximum") + ERR_FAIL_V(""); + } else if (value > 255) { + ERR_EXPLAIN("unsigned byte integer is greater than maximum") + ERR_FAIL_V(""); + } + str = chr(values[value_index]); + } else if (values[value_index].get_type() == Variant::STRING) { + str = values[value_index]; + if (str.length() != 1) { + ERR_EXPLAIN("%c requires number or single-character string"); + ERR_FAIL_V(""); + } + } else { + ERR_EXPLAIN("%c requires number or single-character string"); + ERR_FAIL_V(""); + } + + // Padding. + if (left_justified) { + str = str.rpad(min_chars); + } else { + str = str.lpad(min_chars); + } + formatted += str; + ++value_index; + in_format = false; + break; + } + case '-': { // Left justify + left_justified = true; + break; + } + case '+': { // Show + if positive. + show_sign = true; + break; + } + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': { + int n = c - '0'; + if (in_decimals) { + min_decimals *= 10; + min_decimals += n; + } else { + if (c == '0' && min_chars == 0) { + pad_with_zeroes = true; + } else { + min_chars *= 10; + min_chars += n; + } + } + break; + } + case '.': { // Float separtor. + if (in_decimals) { + ERR_EXPLAIN("too many decimal points in format"); + ERR_FAIL_V(""); + } + in_decimals = true; + min_decimals = 0; // We want to add the value manually. + break; + } + + case '*': { // Dyanmic width, based on value. + if (value_index >= values.size()) { + ERR_EXPLAIN("not enough arguments for format string"); + ERR_FAIL_V(""); + } + + if (!values[value_index].is_num()) { + ERR_EXPLAIN("* wants number"); + ERR_FAIL_V(""); + } + + int size = values[value_index]; + + if (in_decimals) { + min_decimals = size; + } else { + min_chars = size; + } + + ++value_index; + break; + } + + default: { + ERR_EXPLAIN("unsupported format character"); + ERR_FAIL_V(""); + } + } + } else { // Not in format string. + switch (c) { + case '%': + in_format = true; + // Back to defaults: + min_chars = 0; + min_decimals = 6; + pad_with_zeroes = false; + left_justified = false; + show_sign = false; + in_decimals = false; + break; + default: + formatted += chr(c); + } + } + } + + if (in_format) { + ERR_EXPLAIN("incomplete format"); + ERR_FAIL_V(""); + } + + if (value_index != values.size()) { + ERR_EXPLAIN("not all arguments converted during string formatting"); + ERR_FAIL_V(""); + } + + return formatted; +} diff --git a/core/ustring.h b/core/ustring.h index e1d6761742..af5ffb7c35 100644 --- a/core/ustring.h +++ b/core/ustring.h @@ -31,6 +31,7 @@ #include "typedefs.h" #include "vector.h" +#include "array.h" /** @author red <red@killy> @@ -127,10 +128,13 @@ public: String insert(int p_at_pos,String p_string) const; String pad_decimals(int p_digits) const; String pad_zeros(int p_digits) const; + String lpad(int min_length,const String& character=" ") const; + String rpad(int min_length,const String& character=" ") const; + String sprintf(const Array& values) const; static String num(double p_num,int p_decimals=-1); static String num_scientific(double p_num); static String num_real(double p_num); - static String num_int64(int64_t p_num); + static String num_int64(int64_t p_num,int base=10,bool capitalize_hex=false); static String chr(CharType p_char); static String md5(const uint8_t *p_md5); bool is_numeric() const; @@ -203,7 +207,7 @@ public: String xml_unescape() const; String c_escape() const; String c_unescape() const; - + String percent_encode() const; String percent_decode() const; diff --git a/core/variant_op.cpp b/core/variant_op.cpp index fbb5e2631d..21bbc8c7ee 100644 --- a/core/variant_op.cpp +++ b/core/variant_op.cpp @@ -736,6 +736,20 @@ void Variant::evaluate(const Operator& p_op, const Variant& p_a, const Variant& } #endif _RETURN( p_a._data._int % p_b._data._int ); + + } else if (p_a.type==STRING) { + const String *str=reinterpret_cast<const String*>(p_a._data._mem); + + if (p_b.type==ARRAY) { + // e.g. "frog %s %d" % ["fish", 12] + const Array *arr=reinterpret_cast<const Array*>(p_b._data._mem); + _RETURN(str->sprintf(*arr)); + } else { + // e.g. "frog %d" % 12 + Array arr; + arr.push_back(p_b); + _RETURN(str->sprintf(arr)); + } } r_valid=false; diff --git a/demos/3d/platformer/stage.xml b/demos/3d/platformer/stage.xml index f3a5caffa9..37a11068c9 100644 --- a/demos/3d/platformer/stage.xml +++ b/demos/3d/platformer/stage.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> -<resource_file type="PackedScene" subresource_count="7" version="1.0" version_name="Godot Engine v1.0.3917-beta1"> +<resource_file type="PackedScene" subresource_count="7" version="1.0" version_name="Godot Engine v1.0.stable.custom_build"> <ext_resource path="res://sb.cube" type="CubeMap"></ext_resource> <ext_resource path="res://tiles.res" type="MeshLibrary"></ext_resource> <ext_resource path="res://enemy.scn" type="PackedScene"></ext_resource> - <ext_resource path="res://coin.scn" type="PackedScene"></ext_resource> <ext_resource path="res://player.xml" type="PackedScene"></ext_resource> + <ext_resource path="res://coin.scn" type="PackedScene"></ext_resource> <resource type="Environment" path="local://1"> <bool name="ambient_light/enabled"> True </bool> <color name="ambient_light/color"> 0, 0.409429, 0.596681, 1 </color> @@ -29,8 +29,9 @@ <real name="dof_blur/begin"> 100 </real> <real name="dof_blur/range"> 10 </real> <bool name="hdr/enabled"> True </bool> + <int name="hdr/tonemapper"> 0 </int> <real name="hdr/exposure"> 0.4 </real> - <real name="hdr/scalar"> 1 </real> + <real name="hdr/white"> 1 </real> <real name="hdr/glow_treshold"> 0.9 </real> <real name="hdr/glow_scale"> 0.5 </real> <real name="hdr/min_luminance"> 0.4 </real> @@ -52,11 +53,12 @@ <main_resource> <dictionary name="_bundled" shared="false"> <string> "names" </string> - <string_array len="92"> + <string_array len="94"> <string> "world" </string> <string> "Spatial" </string> <string> "_import_path" </string> <string> "_import_transform" </string> + <string> "visibility/visible" </string> <string> "__meta__" </string> <string> "GridMap" </string> <string> "theme/theme" </string> @@ -73,6 +75,7 @@ <string> "transform/local" </string> <string> "layers" </string> <string> "params/enabled" </string> + <string> "params/editor_only" </string> <string> "params/bake_mode" </string> <string> "params/energy" </string> <string> "colors/diffuse" </string> @@ -153,9 +156,10 @@ <string> "node_count" </string> <int> 55 </int> <string> "variants" </string> - <array len="79" shared="false"> + <array len="82" shared="false"> <node_path> "" </node_path> <transform> 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 </transform> + <bool> True </bool> <dictionary shared="false"> <string> "__editor_plugin_states__" </string> <dictionary shared="false"> @@ -174,23 +178,27 @@ </dictionary> <string> "3D" </string> <dictionary shared="false"> + <string> "deflight_rot_y" </string> + <real> 0.628319 </real> <string> "zfar" </string> <real> 500 </real> <string> "fov" </string> - <real> 400 </real> + <real> 179 </real> <string> "viewports" </string> <array len="4" shared="false"> <dictionary shared="false"> <string> "distance" </string> - <real> 0.261354 </real> + <real> 9.009935 </real> <string> "x_rot" </string> <real> 0.458294 </real> <string> "y_rot" </string> <real> -1.2 </real> - <string> "use_orthogonal" </string> - <bool> False </bool> + <string> "listener" </string> + <bool> True </bool> <string> "use_environment" </string> <bool> False </bool> + <string> "use_orthogonal" </string> + <bool> False </bool> <string> "pos" </string> <vector3> 13.4535, 5.75047, 13.8175 </vector3> </dictionary> @@ -201,10 +209,12 @@ <real> 0 </real> <string> "y_rot" </string> <real> 0 </real> - <string> "use_orthogonal" </string> + <string> "listener" </string> <bool> False </bool> <string> "use_environment" </string> <bool> False </bool> + <string> "use_orthogonal" </string> + <bool> False </bool> <string> "pos" </string> <vector3> 0, 0, 0 </vector3> </dictionary> @@ -215,10 +225,12 @@ <real> 0 </real> <string> "y_rot" </string> <real> 0 </real> - <string> "use_orthogonal" </string> + <string> "listener" </string> <bool> False </bool> <string> "use_environment" </string> <bool> False </bool> + <string> "use_orthogonal" </string> + <bool> False </bool> <string> "pos" </string> <vector3> 0, 0, 0 </vector3> </dictionary> @@ -229,10 +241,12 @@ <real> 0 </real> <string> "y_rot" </string> <real> 0 </real> - <string> "use_orthogonal" </string> + <string> "listener" </string> <bool> False </bool> <string> "use_environment" </string> <bool> False </bool> + <string> "use_orthogonal" </string> + <bool> False </bool> <string> "pos" </string> <vector3> 0, 0, 0 </vector3> </dictionary> @@ -241,12 +255,18 @@ <int> 1 </int> <string> "default_light" </string> <bool> False </bool> + <string> "ambient_light_color" </string> + <color> 0.15, 0.15, 0.15, 1 </color> <string> "show_grid" </string> <bool> True </bool> <string> "show_origin" </string> <bool> True </bool> <string> "znear" </string> <real> 0.1 </real> + <string> "default_srgb" </string> + <bool> False </bool> + <string> "deflight_rot_x" </string> + <real> 0.942478 </real> </dictionary> </dictionary> <string> "__editor_run_settings__" </string> @@ -263,7 +283,6 @@ <bool> False </bool> <real> 2 </real> <int> 4 </int> - <bool> True </bool> <real> 1.001 </real> <dictionary shared="false"> <string> "cells" </string> @@ -295,6 +314,112 @@ </dictionary> <resource resource_type="PackedScene" path="res://coin.scn"> </resource> <transform> 1, 0, 0, 0, 1, 0, 0, 0, 1, 18.5311, 2.85075, 5.24675 </transform> + <dictionary shared="false"> + <string> "__editor_plugin_states__" </string> + <dictionary shared="false"> + <string> "Script" </string> + <dictionary shared="false"> + <string> "current" </string> + <int> 0 </int> + <string> "sources" </string> + <array len="1" shared="false"> + <string> "res://coin.gd" </string> + </array> + </dictionary> + <string> "2D" </string> + <dictionary shared="false"> + <string> "zoom" </string> + <real> 1 </real> + <string> "ofs" </string> + <vector2> 1, 1 </vector2> + </dictionary> + <string> "3D" </string> + <dictionary shared="false"> + <string> "fov" </string> + <real> 400 </real> + <string> "zfar" </string> + <real> 500 </real> + <string> "viewports" </string> + <array len="4" shared="false"> + <dictionary shared="false"> + <string> "distance" </string> + <real> 1.361845 </real> + <string> "x_rot" </string> + <real> 0.0125 </real> + <string> "y_rot" </string> + <real> 12.050008 </real> + <string> "use_orthogonal" </string> + <bool> False </bool> + <string> "use_environment" </string> + <bool> False </bool> + <string> "pos" </string> + <vector3> -0.00892573, 0.51052, -0.216081 </vector3> + </dictionary> + <dictionary shared="false"> + <string> "distance" </string> + <real> 4 </real> + <string> "x_rot" </string> + <real> 0 </real> + <string> "y_rot" </string> + <real> 0 </real> + <string> "use_orthogonal" </string> + <bool> False </bool> + <string> "use_environment" </string> + <bool> False </bool> + <string> "pos" </string> + <vector3> 0, 0, 0 </vector3> + </dictionary> + <dictionary shared="false"> + <string> "distance" </string> + <real> 4 </real> + <string> "x_rot" </string> + <real> 0 </real> + <string> "y_rot" </string> + <real> 0 </real> + <string> "use_orthogonal" </string> + <bool> False </bool> + <string> "use_environment" </string> + <bool> False </bool> + <string> "pos" </string> + <vector3> 0, 0, 0 </vector3> + </dictionary> + <dictionary shared="false"> + <string> "distance" </string> + <real> 4 </real> + <string> "x_rot" </string> + <real> 0 </real> + <string> "y_rot" </string> + <real> 0 </real> + <string> "use_orthogonal" </string> + <bool> False </bool> + <string> "use_environment" </string> + <bool> False </bool> + <string> "pos" </string> + <vector3> 0, 0, 0 </vector3> + </dictionary> + </array> + <string> "viewport_mode" </string> + <int> 1 </int> + <string> "default_light" </string> + <bool> True </bool> + <string> "show_grid" </string> + <bool> True </bool> + <string> "znear" </string> + <real> 0.1 </real> + <string> "show_origin" </string> + <bool> True </bool> + </dictionary> + </dictionary> + <string> "__editor_run_settings__" </string> + <dictionary shared="false"> + <string> "custom_args" </string> + <string> "-l $scene" </string> + <string> "run_mode" </string> + <int> 0 </int> + </dictionary> + <string> "__editor_plugin_screen__" </string> + <string> "3D" </string> + </dictionary> <transform> 1, 0, 0, 0, 1, 0, 0, 0, 1, 18.5311, 2.85075, 7.24675 </transform> <transform> 1, 0, 0, 0, 1, 0, 0, 0, 1, 20.5311, 2.85075, 5.24675 </transform> <transform> 1, 0, 0, 0, 1, 0, 0, 0, 1, 20.5311, 2.85075, 7.24675 </transform> @@ -340,14 +465,230 @@ <transform> 1, 0, 0, 0, 1, 0, 0, 0, 1, 51.5614, 4.60515, 25.1836 </transform> <resource resource_type="PackedScene" path="res://enemy.scn"> </resource> <transform> 1, 0, 0, 0, 1, 0, 0, 0, 1, 18.3062, 5.40827, 5.96938 </transform> + <dictionary shared="false"> + <string> "__editor_plugin_states__" </string> + <dictionary shared="false"> + <string> "Script" </string> + <dictionary shared="false"> + <string> "current" </string> + <int> 0 </int> + <string> "sources" </string> + <array len="2" shared="false"> + <string> "res://enemy.gd" </string> + <string> "res://player.gd" </string> + </array> + </dictionary> + <string> "2D" </string> + <dictionary shared="false"> + <string> "zoom" </string> + <real> 1 </real> + <string> "ofs" </string> + <vector2> 1, 1 </vector2> + </dictionary> + <string> "3D" </string> + <dictionary shared="false"> + <string> "fov" </string> + <real> 400 </real> + <string> "zfar" </string> + <real> 500 </real> + <string> "viewports" </string> + <array len="4" shared="false"> + <dictionary shared="false"> + <string> "distance" </string> + <real> 7.403724 </real> + <string> "x_rot" </string> + <real> 0.25 </real> + <string> "y_rot" </string> + <real> 3.312502 </real> + <string> "use_orthogonal" </string> + <bool> False </bool> + <string> "use_environment" </string> + <bool> False </bool> + <string> "pos" </string> + <vector3> 0.898236, 0.953557, 0.742913 </vector3> + </dictionary> + <dictionary shared="false"> + <string> "distance" </string> + <real> 4 </real> + <string> "x_rot" </string> + <real> 0 </real> + <string> "y_rot" </string> + <real> 0 </real> + <string> "use_orthogonal" </string> + <bool> False </bool> + <string> "use_environment" </string> + <bool> False </bool> + <string> "pos" </string> + <vector3> 0, 0, 0 </vector3> + </dictionary> + <dictionary shared="false"> + <string> "distance" </string> + <real> 4 </real> + <string> "x_rot" </string> + <real> 0 </real> + <string> "y_rot" </string> + <real> 0 </real> + <string> "use_orthogonal" </string> + <bool> False </bool> + <string> "use_environment" </string> + <bool> False </bool> + <string> "pos" </string> + <vector3> 0, 0, 0 </vector3> + </dictionary> + <dictionary shared="false"> + <string> "distance" </string> + <real> 4 </real> + <string> "x_rot" </string> + <real> 0 </real> + <string> "y_rot" </string> + <real> 0 </real> + <string> "use_orthogonal" </string> + <bool> False </bool> + <string> "use_environment" </string> + <bool> False </bool> + <string> "pos" </string> + <vector3> 0, 0, 0 </vector3> + </dictionary> + </array> + <string> "viewport_mode" </string> + <int> 1 </int> + <string> "default_light" </string> + <bool> True </bool> + <string> "show_grid" </string> + <bool> True </bool> + <string> "znear" </string> + <real> 0.1 </real> + <string> "show_origin" </string> + <bool> True </bool> + </dictionary> + </dictionary> + <string> "__editor_run_settings__" </string> + <dictionary shared="false"> + <string> "custom_args" </string> + <string> "-l $scene" </string> + <string> "run_mode" </string> + <int> 0 </int> + </dictionary> + <string> "__editor_plugin_screen__" </string> + <string> "Script" </string> + </dictionary> <transform> 1, 0, 0, 0, 1, 0, 0, 0, 1, 64.1292, 5.40827, 17.1396 </transform> <transform> 1, 0, 0, 0, 1, 0, 0, 0, 1, 64.1292, 5.40827, 32.6128 </transform> <transform> 1, 0, 0, 0, 1, 0, 0, 0, 1, 55.5702, 5.40827, 32.6128 </transform> <resource resource_type="PackedScene" path="res://player.xml"> </resource> <transform> 0.0160676, 0, -0.999871, 0, 1, 0, 0.999871, 0, 0.0160676, 8.50167, 4.15811, 15.9334 </transform> + <dictionary shared="false"> + <string> "__editor_plugin_states__" </string> + <dictionary shared="false"> + <string> "Script" </string> + <dictionary shared="false"> + <string> "current" </string> + <int> 1 </int> + <string> "sources" </string> + <array len="2" shared="false"> + <string> "res://follow_camera.gd" </string> + <string> "res://player.gd" </string> + </array> + </dictionary> + <string> "2D" </string> + <dictionary shared="false"> + <string> "pixel_snap" </string> + <bool> False </bool> + <string> "zoom" </string> + <real> 1 </real> + <string> "ofs" </string> + <vector2> -241, -19 </vector2> + </dictionary> + <string> "3D" </string> + <dictionary shared="false"> + <string> "fov" </string> + <real> 400 </real> + <string> "zfar" </string> + <real> 500 </real> + <string> "viewports" </string> + <array len="4" shared="false"> + <dictionary shared="false"> + <string> "distance" </string> + <real> 2.161076 </real> + <string> "x_rot" </string> + <real> 0.520797 </real> + <string> "y_rot" </string> + <real> 26.741669 </real> + <string> "use_orthogonal" </string> + <bool> False </bool> + <string> "use_environment" </string> + <bool> False </bool> + <string> "pos" </string> + <vector3> -0.415811, 0.486899, 0.089334 </vector3> + </dictionary> + <dictionary shared="false"> + <string> "distance" </string> + <real> 4 </real> + <string> "x_rot" </string> + <real> 0 </real> + <string> "y_rot" </string> + <real> 0 </real> + <string> "use_orthogonal" </string> + <bool> False </bool> + <string> "use_environment" </string> + <bool> False </bool> + <string> "pos" </string> + <vector3> 0, 0, 0 </vector3> + </dictionary> + <dictionary shared="false"> + <string> "distance" </string> + <real> 4 </real> + <string> "x_rot" </string> + <real> 0 </real> + <string> "y_rot" </string> + <real> 0 </real> + <string> "use_orthogonal" </string> + <bool> False </bool> + <string> "use_environment" </string> + <bool> False </bool> + <string> "pos" </string> + <vector3> 0, 0, 0 </vector3> + </dictionary> + <dictionary shared="false"> + <string> "distance" </string> + <real> 4 </real> + <string> "x_rot" </string> + <real> 0 </real> + <string> "y_rot" </string> + <real> 0 </real> + <string> "use_orthogonal" </string> + <bool> False </bool> + <string> "use_environment" </string> + <bool> False </bool> + <string> "pos" </string> + <vector3> 0, 0, 0 </vector3> + </dictionary> + </array> + <string> "viewport_mode" </string> + <int> 1 </int> + <string> "default_light" </string> + <bool> True </bool> + <string> "show_grid" </string> + <bool> True </bool> + <string> "znear" </string> + <real> 0.1 </real> + <string> "show_origin" </string> + <bool> True </bool> + </dictionary> + </dictionary> + <string> "__editor_run_settings__" </string> + <dictionary shared="false"> + <string> "custom_args" </string> + <string> "-l $scene" </string> + <string> "run_mode" </string> + <int> 0 </int> + </dictionary> + <string> "__editor_plugin_screen__" </string> + <string> "3D" </string> + </dictionary> </array> <string> "nodes" </string> - <int_array len="569"> -1, -1, 1, 0, -1, 3, 2, 0, 3, 1, 4, 2, 0, 0, 0, 5, 5, -1, 13, 2, 0, 3, 1, 6, 3, 7, 4, 8, 4, 9, 5, 10, 6, 11, 7, 12, 7, 13, 7, 14, 8, 15, 9, 4, 10, 0, 0, 0, 16, 16, -1, 21, 2, 0, 3, 1, 17, 11, 18, 12, 19, 7, 20, 13, 21, 14, 22, 15, 23, 15, 24, 7, 25, 16, 26, 17, 27, 18, 28, 19, 29, 20, 30, 21, 31, 13, 32, 22, 33, 23, 34, 24, 35, 5, 0, 0, 0, 37, 36, -1, 3, 2, 0, 3, 1, 36, 25, 0, 0, 0, 39, 38, -1, 2, 2, 0, 4, 26, 0, 4, 0, 41, 40, 27, 1, 17, 28, 0, 4, 0, 41, 42, 27, 1, 17, 29, 0, 4, 0, 41, 43, 27, 1, 17, 30, 0, 4, 0, 41, 44, 27, 1, 17, 31, 0, 4, 0, 41, 45, 27, 1, 17, 32, 0, 4, 0, 41, 46, 27, 1, 17, 33, 0, 4, 0, 41, 47, 27, 1, 17, 34, 0, 4, 0, 41, 48, 27, 1, 17, 35, 0, 4, 0, 41, 49, 27, 1, 17, 36, 0, 4, 0, 41, 50, 27, 1, 17, 37, 0, 4, 0, 41, 51, 27, 1, 17, 38, 0, 4, 0, 41, 52, 27, 1, 17, 39, 0, 4, 0, 41, 53, 27, 1, 17, 40, 0, 4, 0, 41, 54, 27, 1, 17, 41, 0, 4, 0, 41, 55, 27, 1, 17, 42, 0, 4, 0, 41, 56, 27, 1, 17, 43, 0, 4, 0, 41, 57, 27, 1, 17, 44, 0, 4, 0, 41, 58, 27, 1, 17, 45, 0, 4, 0, 41, 59, 27, 1, 17, 46, 0, 4, 0, 41, 60, 27, 1, 17, 47, 0, 4, 0, 41, 61, 27, 1, 17, 48, 0, 4, 0, 41, 62, 27, 1, 17, 49, 0, 4, 0, 41, 63, 27, 1, 17, 50, 0, 4, 0, 41, 64, 27, 1, 17, 51, 0, 4, 0, 41, 65, 27, 1, 17, 52, 0, 4, 0, 41, 66, 27, 1, 17, 53, 0, 4, 0, 41, 67, 27, 1, 17, 54, 0, 4, 0, 41, 68, 27, 1, 17, 55, 0, 4, 0, 41, 69, 27, 1, 17, 56, 0, 4, 0, 41, 70, 27, 1, 17, 57, 0, 4, 0, 41, 71, 27, 1, 17, 58, 0, 4, 0, 41, 72, 27, 1, 17, 59, 0, 4, 0, 41, 73, 27, 1, 17, 60, 0, 4, 0, 41, 74, 27, 1, 17, 61, 0, 4, 0, 41, 75, 27, 1, 17, 62, 0, 4, 0, 41, 76, 27, 1, 17, 63, 0, 4, 0, 41, 77, 27, 1, 17, 64, 0, 4, 0, 41, 78, 27, 1, 17, 65, 0, 4, 0, 41, 79, 27, 1, 17, 66, 0, 4, 0, 41, 80, 27, 1, 17, 67, 0, 4, 0, 41, 81, 27, 1, 17, 68, 0, 4, 0, 41, 82, 27, 1, 17, 69, 0, 4, 0, 41, 83, 27, 1, 17, 70, 0, 4, 0, 41, 84, 27, 1, 17, 71, 0, 0, 0, 39, 85, -1, 1, 2, 0, 0, 49, 0, 87, 86, 72, 1, 17, 73, 0, 49, 0, 87, 88, 72, 1, 17, 74, 0, 49, 0, 87, 89, 72, 1, 17, 75, 0, 49, 0, 87, 90, 72, 1, 17, 76, 0, 0, 0, 87, 91, 77, 1, 17, 78, 0 </int_array> + <int_array len="873"> -1, -1, 1, 0, -1, 4, 2, 0, 3, 1, 4, 2, 5, 3, 0, 0, 0, 6, 6, -1, 14, 2, 0, 3, 1, 4, 2, 7, 4, 8, 5, 9, 5, 10, 6, 11, 7, 12, 2, 13, 2, 14, 2, 15, 8, 16, 9, 5, 10, 0, 0, 0, 17, 17, -1, 23, 2, 0, 3, 1, 18, 11, 4, 2, 19, 12, 20, 2, 21, 5, 22, 13, 23, 14, 24, 15, 25, 15, 26, 2, 27, 16, 28, 17, 29, 18, 30, 19, 31, 20, 32, 21, 33, 13, 34, 22, 35, 23, 36, 24, 37, 6, 0, 0, 0, 39, 38, -1, 4, 2, 0, 3, 1, 4, 2, 38, 25, 0, 0, 0, 41, 40, -1, 2, 2, 0, 5, 26, 0, 4, 0, 43, 42, 27, 4, 2, 0, 3, 1, 18, 28, 5, 29, 0, 4, 0, 43, 44, 27, 4, 2, 0, 3, 1, 18, 30, 5, 29, 0, 4, 0, 43, 45, 27, 4, 2, 0, 3, 1, 18, 31, 5, 29, 0, 4, 0, 43, 46, 27, 4, 2, 0, 3, 1, 18, 32, 5, 29, 0, 4, 0, 43, 47, 27, 4, 2, 0, 3, 1, 18, 33, 5, 29, 0, 4, 0, 43, 48, 27, 4, 2, 0, 3, 1, 18, 34, 5, 29, 0, 4, 0, 43, 49, 27, 4, 2, 0, 3, 1, 18, 35, 5, 29, 0, 4, 0, 43, 50, 27, 4, 2, 0, 3, 1, 18, 36, 5, 29, 0, 4, 0, 43, 51, 27, 4, 2, 0, 3, 1, 18, 37, 5, 29, 0, 4, 0, 43, 52, 27, 4, 2, 0, 3, 1, 18, 38, 5, 29, 0, 4, 0, 43, 53, 27, 4, 2, 0, 3, 1, 18, 39, 5, 29, 0, 4, 0, 43, 54, 27, 4, 2, 0, 3, 1, 18, 40, 5, 29, 0, 4, 0, 43, 55, 27, 4, 2, 0, 3, 1, 18, 41, 5, 29, 0, 4, 0, 43, 56, 27, 4, 2, 0, 3, 1, 18, 42, 5, 29, 0, 4, 0, 43, 57, 27, 4, 2, 0, 3, 1, 18, 43, 5, 29, 0, 4, 0, 43, 58, 27, 4, 2, 0, 3, 1, 18, 44, 5, 29, 0, 4, 0, 43, 59, 27, 4, 2, 0, 3, 1, 18, 45, 5, 29, 0, 4, 0, 43, 60, 27, 4, 2, 0, 3, 1, 18, 46, 5, 29, 0, 4, 0, 43, 61, 27, 4, 2, 0, 3, 1, 18, 47, 5, 29, 0, 4, 0, 43, 62, 27, 4, 2, 0, 3, 1, 18, 48, 5, 29, 0, 4, 0, 43, 63, 27, 4, 2, 0, 3, 1, 18, 49, 5, 29, 0, 4, 0, 43, 64, 27, 4, 2, 0, 3, 1, 18, 50, 5, 29, 0, 4, 0, 43, 65, 27, 4, 2, 0, 3, 1, 18, 51, 5, 29, 0, 4, 0, 43, 66, 27, 4, 2, 0, 3, 1, 18, 52, 5, 29, 0, 4, 0, 43, 67, 27, 4, 2, 0, 3, 1, 18, 53, 5, 29, 0, 4, 0, 43, 68, 27, 4, 2, 0, 3, 1, 18, 54, 5, 29, 0, 4, 0, 43, 69, 27, 4, 2, 0, 3, 1, 18, 55, 5, 29, 0, 4, 0, 43, 70, 27, 4, 2, 0, 3, 1, 18, 56, 5, 29, 0, 4, 0, 43, 71, 27, 4, 2, 0, 3, 1, 18, 57, 5, 29, 0, 4, 0, 43, 72, 27, 4, 2, 0, 3, 1, 18, 58, 5, 29, 0, 4, 0, 43, 73, 27, 4, 2, 0, 3, 1, 18, 59, 5, 29, 0, 4, 0, 43, 74, 27, 4, 2, 0, 3, 1, 18, 60, 5, 29, 0, 4, 0, 43, 75, 27, 4, 2, 0, 3, 1, 18, 61, 5, 29, 0, 4, 0, 43, 76, 27, 4, 2, 0, 3, 1, 18, 62, 5, 29, 0, 4, 0, 43, 77, 27, 4, 2, 0, 3, 1, 18, 63, 5, 29, 0, 4, 0, 43, 78, 27, 4, 2, 0, 3, 1, 18, 64, 5, 29, 0, 4, 0, 43, 79, 27, 4, 2, 0, 3, 1, 18, 65, 5, 29, 0, 4, 0, 43, 80, 27, 4, 2, 0, 3, 1, 18, 66, 5, 29, 0, 4, 0, 43, 81, 27, 4, 2, 0, 3, 1, 18, 67, 5, 29, 0, 4, 0, 43, 82, 27, 4, 2, 0, 3, 1, 18, 68, 5, 29, 0, 4, 0, 43, 83, 27, 4, 2, 0, 3, 1, 18, 69, 5, 29, 0, 4, 0, 43, 84, 27, 4, 2, 0, 3, 1, 18, 70, 5, 29, 0, 4, 0, 43, 85, 27, 4, 2, 0, 3, 1, 18, 71, 5, 29, 0, 4, 0, 43, 86, 27, 4, 2, 0, 3, 1, 18, 72, 5, 29, 0, 0, 0, 41, 87, -1, 1, 2, 0, 0, 49, 0, 89, 88, 73, 4, 2, 0, 3, 1, 18, 74, 5, 75, 0, 49, 0, 89, 90, 73, 4, 2, 0, 3, 1, 18, 76, 5, 75, 0, 49, 0, 89, 91, 73, 4, 2, 0, 3, 1, 18, 77, 5, 75, 0, 49, 0, 89, 92, 73, 4, 2, 0, 3, 1, 18, 78, 5, 75, 0, 0, 0, 89, 93, 79, 4, 2, 0, 3, 1, 18, 80, 5, 81, 0 </int_array> <string> "conns" </string> <int_array len="0"> </int_array> </dictionary> |