Compare commits
40 Commits
4.3
...
2.0.1-stab
Author | SHA1 | Date | |
---|---|---|---|
![]() |
53aa9cd51a | ||
![]() |
706d576f7b | ||
![]() |
226e0a7f4f | ||
![]() |
c44060bb82 | ||
![]() |
4fee5f3915 | ||
![]() |
e69c9021b5 | ||
![]() |
edb3716da7 | ||
![]() |
1bdd5d24cb | ||
![]() |
a1a1c0b9f6 | ||
![]() |
450a7a9120 | ||
![]() |
c850fa7331 | ||
![]() |
afd75013f9 | ||
![]() |
848c7378fd | ||
![]() |
4b2fcabb74 | ||
![]() |
cb7693c533 | ||
![]() |
7fea990b1b | ||
![]() |
95e46e6eac | ||
![]() |
bea8e1654e | ||
![]() |
cafcdb015d | ||
![]() |
459b914d9c | ||
![]() |
9ed3d21d5a | ||
![]() |
82d06b0027 | ||
![]() |
e0a66b6e56 | ||
![]() |
186b82c350 | ||
![]() |
1af2e1101d | ||
![]() |
a55f41e3d9 | ||
![]() |
439e29ea95 | ||
![]() |
f5e8e89f50 | ||
![]() |
f619b05751 | ||
![]() |
aa94ff6dae | ||
![]() |
ee5c250b63 | ||
![]() |
e4d367e7a1 | ||
![]() |
45a0bbe56e | ||
![]() |
d86b12a397 | ||
![]() |
f0ba9c7e78 | ||
![]() |
61f17fb1bb | ||
![]() |
a43af20f31 | ||
![]() |
7ba92ae9eb | ||
![]() |
b05c27a27f | ||
![]() |
e30cbc3b36 |
@@ -41,7 +41,11 @@
|
||||
#define _MKSTR(m_x) _STR(m_x)
|
||||
#endif
|
||||
// have to include version.h for this to work, include it in the .cpp not the .h
|
||||
#ifdef VERSION_PATCH
|
||||
#define VERSION_MKSTRING _MKSTR(VERSION_MAJOR)"." _MKSTR(VERSION_MINOR)"." _MKSTR(VERSION_PATCH)"." _MKSTR(VERSION_STATUS)"." _MKSTR(VERSION_REVISION)
|
||||
#else
|
||||
#define VERSION_MKSTRING _MKSTR(VERSION_MAJOR)"." _MKSTR(VERSION_MINOR)"." _MKSTR(VERSION_STATUS)"." _MKSTR(VERSION_REVISION)
|
||||
#endif // VERSION_PATCH
|
||||
#define VERSION_FULL_NAME _MKSTR(VERSION_NAME)" v" VERSION_MKSTRING
|
||||
|
||||
|
||||
@@ -154,6 +158,23 @@ inline void __swap_tmpl(T &x, T &y ) {
|
||||
((m_hex>='A' && m_hex<='F')?(10+m_hex-'A'):\
|
||||
((m_hex>='a' && m_hex<='f')?(10+m_hex-'a'):0)))
|
||||
|
||||
// Macro to check whether we are compiled by clang
|
||||
// and we have a specific builtin
|
||||
#if defined(__llvm__) && defined(__has_builtin)
|
||||
#define _llvm_has_builtin(x) __has_builtin(x)
|
||||
#else
|
||||
#define _llvm_has_builtin(x) 0
|
||||
#endif
|
||||
|
||||
#if (defined(__GNUC__) && (__GNUC__ >= 5)) || _llvm_has_builtin(__builtin_mul_overflow)
|
||||
# define _mul_overflow __builtin_mul_overflow
|
||||
#endif
|
||||
|
||||
#if (defined(__GNUC__) && (__GNUC__ >= 5)) || _llvm_has_builtin(__builtin_add_overflow)
|
||||
# define _add_overflow __builtin_add_overflow
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -167,6 +188,19 @@ static _FORCE_INLINE_ unsigned int nearest_power_of_2(unsigned int x) {
|
||||
x |= x >> 4;
|
||||
x |= x >> 8;
|
||||
x |= x >> 16;
|
||||
|
||||
return ++x;
|
||||
}
|
||||
|
||||
template<class T>
|
||||
static _FORCE_INLINE_ T nearest_power_of_2_templated(T x) {
|
||||
|
||||
--x;
|
||||
// If the compiler is smart, it unrolls this loop
|
||||
// If its dumb, this is a bit slow.
|
||||
for (size_t i = 0; i < sizeof(T); i++)
|
||||
x |= x >> (1 << i);
|
||||
|
||||
return ++x;
|
||||
}
|
||||
|
||||
|
@@ -1115,6 +1115,21 @@ void Variant::reference(const Variant& p_variant) {
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
void Variant::zero() {
|
||||
switch(type) {
|
||||
case NIL: break;
|
||||
case BOOL: this->_data._bool = false; break;
|
||||
case INT: this->_data._int = 0; break;
|
||||
case REAL: this->_data._real = 0; break;
|
||||
case VECTOR2: *reinterpret_cast<Vector2*>(this->_data._mem) = Vector2(); break;
|
||||
case RECT2: *reinterpret_cast<Rect2*>(this->_data._mem) = Rect2(); break;
|
||||
case VECTOR3: *reinterpret_cast<Vector3*>(this->_data._mem) = Vector3(); break;
|
||||
case PLANE: *reinterpret_cast<Plane*>(this->_data._mem) = Plane(); break;
|
||||
case QUAT: *reinterpret_cast<Quat*>(this->_data._mem) = Quat(); break;
|
||||
case COLOR: *reinterpret_cast<Color*>(this->_data._mem) = Color(); break;
|
||||
default: this->clear(); break;
|
||||
}
|
||||
}
|
||||
void Variant::clear() {
|
||||
|
||||
|
@@ -372,6 +372,8 @@ public:
|
||||
return res;
|
||||
}
|
||||
|
||||
void zero();
|
||||
static void blend(const Variant& a, const Variant& b, float c,Variant &r_dst);
|
||||
static void interpolate(const Variant& a, const Variant& b, float c,Variant &r_dst);
|
||||
|
||||
struct CallError {
|
||||
|
@@ -3431,6 +3431,59 @@ Variant Variant::iter_get(const Variant& r_iter,bool &r_valid) const {
|
||||
|
||||
}
|
||||
|
||||
void Variant::blend(const Variant& a, const Variant& b, float c, Variant &r_dst) {
|
||||
if (a.type!=b.type) {
|
||||
if(a.is_num() && b.is_num()) {
|
||||
real_t va=a;
|
||||
real_t vb=b;
|
||||
r_dst=va + vb * c;
|
||||
} else {
|
||||
r_dst=a;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
switch(a.type) {
|
||||
case NIL: { r_dst=Variant(); } return;
|
||||
case INT:{
|
||||
int va=a._data._int;
|
||||
int vb=b._data._int;
|
||||
r_dst=int(va + vb * c + 0.5);
|
||||
} return;
|
||||
case REAL:{
|
||||
double ra=a._data._real;
|
||||
double rb=b._data._real;
|
||||
r_dst=ra + rb * c;
|
||||
} return;
|
||||
case VECTOR2:{ r_dst=*reinterpret_cast<const Vector2*>(a._data._mem)+*reinterpret_cast<const Vector2*>(b._data._mem)*c; } return;
|
||||
case RECT2:{
|
||||
const Rect2 *ra = reinterpret_cast<const Rect2*>(a._data._mem);
|
||||
const Rect2 *rb = reinterpret_cast<const Rect2*>(b._data._mem);
|
||||
r_dst=Rect2(ra->pos + rb->pos * c, ra->size + rb->size * c);
|
||||
} return;
|
||||
case VECTOR3:{ r_dst=*reinterpret_cast<const Vector2*>(a._data._mem)+*reinterpret_cast<const Vector2*>(b._data._mem)*c; } return;
|
||||
case _AABB:{
|
||||
const AABB *ra = reinterpret_cast<const AABB*>(a._data._mem);
|
||||
const AABB *rb = reinterpret_cast<const AABB*>(b._data._mem);
|
||||
r_dst=AABB(ra->pos + rb->pos * c, ra->size + rb->size * c);
|
||||
} return;
|
||||
case COLOR:{
|
||||
const Color *ca = reinterpret_cast<const Color*>(a._data._mem);
|
||||
const Color *cb = reinterpret_cast<const Color*>(b._data._mem);
|
||||
float r = ca->r + cb->r * c;
|
||||
float g = ca->g + cb->g * c;
|
||||
float b = ca->b + cb->b * c;
|
||||
float a = ca->a + cb->a * c;
|
||||
r = r > 1.0 ? 1.0 : r;
|
||||
g = g > 1.0 ? 1.0 : g;
|
||||
b = b > 1.0 ? 1.0 : b;
|
||||
a = a > 1.0 ? 1.0 : a;
|
||||
r_dst=Color(r, g, b, a);
|
||||
} return;
|
||||
default:{ r_dst = c<0.5 ? a : b; } return;
|
||||
}
|
||||
}
|
||||
|
||||
void Variant::interpolate(const Variant& a, const Variant& b, float c,Variant &r_dst) {
|
||||
|
||||
if (a.type!=b.type) {
|
||||
|
@@ -68,11 +68,26 @@ class Vector {
|
||||
return reinterpret_cast<T*>(_ptr);
|
||||
|
||||
}
|
||||
|
||||
_FORCE_INLINE_ int _get_alloc_size(int p_elements) const {
|
||||
|
||||
return nearest_power_of_2(p_elements*sizeof(T)+sizeof(SafeRefCount)+sizeof(int));
|
||||
}
|
||||
|
||||
_FORCE_INLINE_ size_t _get_alloc_size(size_t p_elements) const {
|
||||
return nearest_power_of_2_templated(p_elements*sizeof(T)+sizeof(SafeRefCount)+sizeof(int));
|
||||
}
|
||||
|
||||
_FORCE_INLINE_ bool _get_alloc_size_checked(size_t p_elements, size_t *out) const {
|
||||
#if defined(_add_overflow) && defined(_mul_overflow)
|
||||
size_t o;
|
||||
size_t p;
|
||||
if (_mul_overflow(p_elements, sizeof(T), &o)) return false;
|
||||
if (_add_overflow(o, sizeof(SafeRefCount)+sizeof(int), &p)) return false;
|
||||
*out = nearest_power_of_2_templated(p);
|
||||
return true;
|
||||
#else
|
||||
// Speed is more important than correctness here, do the operations unchecked
|
||||
// and hope the best
|
||||
*out = _get_alloc_size(p_elements);
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
||||
void _unref(void *p_data);
|
||||
|
||||
@@ -257,19 +272,21 @@ Error Vector<T>::resize(int p_size) {
|
||||
// possibly changing size, copy on write
|
||||
_copy_on_write();
|
||||
|
||||
size_t alloc_size;
|
||||
ERR_FAIL_COND_V(!_get_alloc_size_checked(p_size, &alloc_size), ERR_OUT_OF_MEMORY);
|
||||
|
||||
if (p_size>size()) {
|
||||
|
||||
if (size()==0) {
|
||||
// alloc from scratch
|
||||
void* ptr=memalloc(_get_alloc_size(p_size));
|
||||
void* ptr=memalloc(alloc_size);
|
||||
ERR_FAIL_COND_V( !ptr ,ERR_OUT_OF_MEMORY);
|
||||
_ptr=(T*)((uint8_t*)ptr+sizeof(int)+sizeof(SafeRefCount));
|
||||
_get_refcount()->init(); // init refcount
|
||||
*_get_size()=0; // init size (currently, none)
|
||||
|
||||
} else {
|
||||
|
||||
void *_ptrnew = (T*)memrealloc((uint8_t*)_ptr-sizeof(int)-sizeof(SafeRefCount),_get_alloc_size(p_size));
|
||||
void *_ptrnew = (T*)memrealloc((uint8_t*)_ptr-sizeof(int)-sizeof(SafeRefCount), alloc_size);
|
||||
ERR_FAIL_COND_V( !_ptrnew ,ERR_OUT_OF_MEMORY);
|
||||
_ptr=(T*)((uint8_t*)_ptrnew+sizeof(int)+sizeof(SafeRefCount));
|
||||
}
|
||||
@@ -293,7 +310,7 @@ Error Vector<T>::resize(int p_size) {
|
||||
t->~T();
|
||||
}
|
||||
|
||||
void *_ptrnew = (T*)memrealloc((uint8_t*)_ptr-sizeof(int)-sizeof(SafeRefCount),_get_alloc_size(p_size));
|
||||
void *_ptrnew = (T*)memrealloc((uint8_t*)_ptr-sizeof(int)-sizeof(SafeRefCount), alloc_size);
|
||||
ERR_FAIL_COND_V( !_ptrnew ,ERR_OUT_OF_MEMORY);
|
||||
|
||||
_ptr=(T*)((uint8_t*)_ptrnew+sizeof(int)+sizeof(SafeRefCount));
|
||||
|
Before Width: | Height: | Size: 523 KiB After Width: | Height: | Size: 302 KiB |
Before Width: | Height: | Size: 2.3 MiB |
BIN
demos/2d/normalmaps/normal.jpg
Normal file
After Width: | Height: | Size: 490 KiB |
Before Width: | Height: | Size: 2.2 MiB |
Before Width: | Height: | Size: 241 KiB After Width: | Height: | Size: 259 KiB |
Before Width: | Height: | Size: 952 KiB |
BIN
demos/2d/screen_space_shaders/art/forest.jpg
Normal file
After Width: | Height: | Size: 307 KiB |
Before Width: | Height: | Size: 1.1 MiB |
BIN
demos/2d/screen_space_shaders/art/mountains.jpg
Normal file
After Width: | Height: | Size: 210 KiB |
Before Width: | Height: | Size: 906 KiB |
BIN
demos/2d/screen_space_shaders/art/platformer.jpg
Normal file
After Width: | Height: | Size: 114 KiB |
Before Width: | Height: | Size: 43 KiB |
@@ -6,7 +6,7 @@ icon="res://icon.png"
|
||||
|
||||
[display]
|
||||
|
||||
width=780
|
||||
width=800
|
||||
height=600
|
||||
stretch_mode="2d"
|
||||
stretch_aspect="keep"
|
||||
|
@@ -292,8 +292,11 @@ Error DirAccessUnix::rename(String p_path,String p_new_path) {
|
||||
}
|
||||
Error DirAccessUnix::remove(String p_path) {
|
||||
|
||||
p_path=fix_path(p_path);
|
||||
|
||||
if (p_path.is_rel_path())
|
||||
p_path=get_current_dir().plus_file(p_path);
|
||||
else
|
||||
p_path=fix_path(p_path);
|
||||
|
||||
struct stat flags;
|
||||
if ((stat(p_path.utf8().get_data(),&flags)!=0))
|
||||
return FAILED;
|
||||
|
@@ -48,7 +48,12 @@ void* MemoryPoolStaticMalloc::alloc(size_t p_bytes,const char *p_description) {
|
||||
|
||||
#else
|
||||
|
||||
int total = p_bytes + DEFAULT_ALIGNMENT;
|
||||
size_t total;
|
||||
#if defined(_add_overflow)
|
||||
if (_add_overflow(p_bytes, DEFAULT_ALIGNMENT, &total)) return NULL;
|
||||
#else
|
||||
total = p_bytes + DEFAULT_ALIGNMENT;
|
||||
#endif
|
||||
uint8_t* ptr = (uint8_t*)_alloc(total, p_description);
|
||||
ERR_FAIL_COND_V( !ptr, ptr );
|
||||
int ofs = (DEFAULT_ALIGNMENT - ((uintptr_t)ptr & (DEFAULT_ALIGNMENT - 1)));
|
||||
@@ -64,11 +69,18 @@ void* MemoryPoolStaticMalloc::_alloc(size_t p_bytes,const char *p_description) {
|
||||
MutexLock lock(mutex);
|
||||
|
||||
#ifdef DEBUG_MEMORY_ENABLED
|
||||
void *mem=malloc(p_bytes+sizeof(RingPtr)); /// add for size and ringlist
|
||||
|
||||
size_t total;
|
||||
#if defined(_add_overflow)
|
||||
if (_add_overflow(p_bytes, sizeof(RingPtr), &total)) return NULL;
|
||||
#else
|
||||
total = p_bytes + sizeof(RingPtr);
|
||||
#endif
|
||||
void *mem=malloc(total); /// add for size and ringlist
|
||||
|
||||
if (!mem) {
|
||||
printf("**ERROR: out of memory while allocating %i bytes by %s?\n",(int) p_bytes, p_description);
|
||||
printf("**ERROR: memory usage is %i\n", (int)get_total_usage());
|
||||
printf("**ERROR: out of memory while allocating %lu bytes by %s?\n", (unsigned long) p_bytes, p_description);
|
||||
printf("**ERROR: memory usage is %lu\n", (unsigned long) get_total_usage());
|
||||
};
|
||||
|
||||
ERR_FAIL_COND_V(!mem,0); //out of memory, or unreasonable request
|
||||
@@ -129,7 +141,12 @@ void* MemoryPoolStaticMalloc::realloc(void *p_memory,size_t p_bytes) {
|
||||
if (!p_memory)
|
||||
return alloc(p_bytes);
|
||||
|
||||
int total = p_bytes + DEFAULT_ALIGNMENT;
|
||||
size_t total;
|
||||
#if defined(_add_overflow)
|
||||
if (_add_overflow(p_bytes, DEFAULT_ALIGNMENT, &total)) return NULL;
|
||||
#else
|
||||
total = p_bytes + DEFAULT_ALIGNMENT;
|
||||
#endif
|
||||
uint8_t* mem = (uint8_t*)p_memory;
|
||||
int ofs = *(mem-1);
|
||||
mem = mem - ofs;
|
||||
|
@@ -310,8 +310,11 @@ Error DirAccessWindows::rename(String p_path,String p_new_path) {
|
||||
|
||||
Error DirAccessWindows::remove(String p_path) {
|
||||
|
||||
p_path=fix_path(p_path);
|
||||
|
||||
if (p_path.is_rel_path())
|
||||
p_path=get_current_dir().plus_file(p_path);
|
||||
else
|
||||
p_path=fix_path(p_path);
|
||||
|
||||
printf("erasing %s\n",p_path.utf8().get_data());
|
||||
//WIN32_FILE_ATTRIBUTE_DATA fileInfo;
|
||||
//DWORD fileAttr = GetFileAttributesExW(p_path.c_str(), GetFileExInfoStandard, &fileInfo);
|
||||
|
BIN
godot_icon.png
Before Width: | Height: | Size: 12 KiB |
133
godot_icon.svg
@@ -1,133 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="1024"
|
||||
height="1024"
|
||||
id="svg3030"
|
||||
version="1.1"
|
||||
inkscape:version="0.48.4 r9939"
|
||||
sodipodi:docname="godot_icon.svg">
|
||||
<defs
|
||||
id="defs3032" />
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="0.24748737"
|
||||
inkscape:cx="340.91041"
|
||||
inkscape:cy="224.06536"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
inkscape:window-width="1366"
|
||||
inkscape:window-height="748"
|
||||
inkscape:window-x="-2"
|
||||
inkscape:window-y="-3"
|
||||
inkscape:window-maximized="1" />
|
||||
<metadata
|
||||
id="metadata3035">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(0,-28.362183)">
|
||||
<rect
|
||||
style="fill:#a39f9f;fill-opacity:1;fill-rule:nonzero;stroke:none"
|
||||
id="rect4009"
|
||||
width="990"
|
||||
height="990"
|
||||
x="20"
|
||||
y="47.362183"
|
||||
ry="187.81349" />
|
||||
<path
|
||||
style="fill:#ffffff;fill-opacity:1;stroke:none"
|
||||
d="m 116.99388,715.36604 43.13957,-74.51381 75.99672,-171.42666 271.088,-13.63746 282.06373,14.1696 138.45065,255.56931 -25.0756,66.96734 -376.12685,53.39482 -367.70391,-40.32222 z"
|
||||
id="path3239"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cccccccccc" />
|
||||
<g
|
||||
id="g3412"
|
||||
transform="matrix(12.995388,0,0,-12.995388,898.37246,704.73082)">
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
d="m 0,0 0,-3.942 c 0,-0.39 -0.25,-0.734 -0.621,-0.852 L -6.835,-6.8 c -0.273,-0.091 -0.57,-0.042 -0.8,0.128 -0.232,0.168 -0.37,0.437 -0.37,0.721 l 0,4.305 -5.818,-1.108 0,-4.381 c 0,-0.447 -0.332,-0.824 -0.775,-0.885 l -8.41,-1.152 c -0.039,-0.003 -0.081,-0.008 -0.121,-0.008 -0.214,0 -0.424,0.078 -0.588,0.22 -0.195,0.172 -0.306,0.416 -0.306,0.676 l 0,4.638 -4.341,-0.018 0,-10e-4 -0.318,10e-4 -0.319,-10e-4 0,10e-4 -4.34,0.018 0,-4.638 c 0,-0.26 -0.112,-0.504 -0.307,-0.676 -0.164,-0.142 -0.374,-0.22 -0.587,-0.22 -0.041,0 -0.082,0.005 -0.123,0.008 l -8.41,1.152 c -0.442,0.061 -0.774,0.438 -0.774,0.885 l 0,4.381 -5.819,1.108 0,-4.305 c 0,-0.284 -0.137,-0.553 -0.368,-0.721 -0.232,-0.17 -0.529,-0.219 -0.802,-0.128 l -6.215,2.006 c -0.369,0.118 -0.619,0.462 -0.619,0.852 l 0,3.942 -3.837,1.29 c -0.19,-0.811 -0.295,-1.642 -0.295,-2.481 0,-10.301 14.512,-18.252 32.448,-18.309 l 0.022,0 0.023,0 c 17.936,0.057 32.448,8.008 32.448,18.309 0,0.766 -0.088,1.521 -0.247,2.266 L 0,0 z"
|
||||
style="fill:#478cbf;fill-opacity:1;fill-rule:nonzero;stroke:none"
|
||||
id="path3414" />
|
||||
</g>
|
||||
<g
|
||||
id="g3416"
|
||||
transform="matrix(12.995388,0,0,-12.995388,140.10982,467.34929)">
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
d="m 0,0 0,-16.047 2.163,-0.729 c 0.364,-0.122 0.61,-0.462 0.61,-0.847 l 0,-3.936 4.426,-1.428 0,4.154 c 0,0.27 0.118,0.52 0.323,0.689 0.206,0.172 0.474,0.241 0.739,0.192 l 7.608,-1.452 c 0.422,-0.079 0.728,-0.448 0.728,-0.877 l 0,-4.338 6.62,-0.904 0,4.509 c 0,0.241 0.096,0.467 0.264,0.635 0.167,0.166 0.394,0.259 0.633,0.259 l 0.002,0 5.551,-0.022 5.549,0.022 c 0.245,-10e-4 0.468,-0.093 0.635,-0.259 0.169,-0.168 0.264,-0.394 0.264,-0.635 l 0,-4.509 6.621,0.904 0,4.338 c 0,0.429 0.304,0.798 0.726,0.877 l 7.609,1.452 c 0.262,0.049 0.533,-0.02 0.738,-0.192 0.205,-0.169 0.325,-0.419 0.325,-0.689 l 0,-4.154 4.425,1.428 0,3.936 c 0,0.385 0.245,0.725 0.609,0.847 l 1.475,0.497 0,16.279 0.04,0 c 1.437,1.834 2.767,3.767 4.042,5.828 -1.694,2.883 -3.768,5.459 -5.986,7.846 -2.057,-1.035 -4.055,-2.208 -5.942,-3.456 -0.944,0.938 -2.008,1.706 -3.052,2.509 -1.027,0.824 -2.183,1.428 -3.281,2.132 0.327,2.433 0.489,4.828 0.554,7.327 -2.831,1.424 -5.85,2.369 -8.903,3.047 -1.219,-2.048 -2.334,-4.267 -3.304,-6.436 -1.152,0.192 -2.309,0.264 -3.467,0.277 l 0,0.002 c -0.008,0 -0.015,-0.002 -0.022,-0.002 -0.008,0 -0.015,0.002 -0.022,0.002 l 0,-0.002 c -1.16,-0.013 -2.316,-0.085 -3.468,-0.277 -0.97,2.169 -2.084,4.388 -3.305,6.436 C 19.475,24.555 16.456,23.61 13.626,22.186 13.69,19.687 13.852,17.292 14.18,14.859 13.081,14.155 11.925,13.551 10.898,12.727 9.855,11.924 8.79,11.156 7.846,10.218 5.958,11.466 3.961,12.639 1.904,13.674 -0.314,11.287 -2.388,8.711 -4.082,5.828 -2.807,3.767 -1.477,1.834 -0.04,0 L 0,0 z"
|
||||
style="fill:#478cbf;fill-opacity:1;fill-rule:nonzero;stroke:none"
|
||||
id="path3418" />
|
||||
</g>
|
||||
<g
|
||||
id="g3420"
|
||||
transform="matrix(12.995388,0,0,-12.995388,411.4457,567.42812)">
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
d="m 0,0 c 0,-3.611 -2.926,-6.537 -6.537,-6.537 -3.608,0 -6.535,2.926 -6.535,6.537 0,3.609 2.927,6.533 6.535,6.533 C -2.926,6.533 0,3.609 0,0"
|
||||
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
|
||||
id="path3422" />
|
||||
</g>
|
||||
<g
|
||||
id="g3424"
|
||||
transform="matrix(12.995388,0,0,-12.995388,391.00655,572.46636)">
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
d="m 0,0 c 0,-2.396 -1.941,-4.337 -4.339,-4.337 -2.396,0 -4.339,1.941 -4.339,4.337 0,2.396 1.943,4.339 4.339,4.339 C -1.941,4.339 0,2.396 0,0"
|
||||
style="fill:#414042;fill-opacity:1;fill-rule:nonzero;stroke:none"
|
||||
id="path3426" />
|
||||
</g>
|
||||
<g
|
||||
id="g3428"
|
||||
transform="matrix(12.995388,0,0,-12.995388,526.30933,660.10985)">
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
d="m 0,0 c -1.162,0 -2.104,0.856 -2.104,1.912 l 0,6.018 c 0,1.054 0.942,1.912 2.104,1.912 1.162,0 2.106,-0.858 2.106,-1.912 l 0,-6.018 C 2.106,0.856 1.162,0 0,0"
|
||||
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
|
||||
id="path3430" />
|
||||
</g>
|
||||
<g
|
||||
id="g3432"
|
||||
transform="matrix(12.995388,0,0,-12.995388,641.18731,567.42812)">
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
d="m 0,0 c 0,-3.611 2.926,-6.537 6.537,-6.537 3.609,0 6.535,2.926 6.535,6.537 0,3.609 -2.926,6.533 -6.535,6.533 C 2.926,6.533 0,3.609 0,0"
|
||||
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
|
||||
id="path3434" />
|
||||
</g>
|
||||
<g
|
||||
id="g3436"
|
||||
transform="matrix(12.995388,0,0,-12.995388,661.63165,572.46636)">
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
d="m 0,0 c 0,-2.396 1.941,-4.337 4.336,-4.337 2.398,0 4.339,1.941 4.339,4.337 0,2.396 -1.941,4.339 -4.339,4.339 C 1.941,4.339 0,2.396 0,0"
|
||||
style="fill:#414042;fill-opacity:1;fill-rule:nonzero;stroke:none"
|
||||
id="path3438" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 7.1 KiB |
132
icon.svg
Normal file
@@ -0,0 +1,132 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="1024"
|
||||
height="1024"
|
||||
id="svg3030"
|
||||
version="1.1"
|
||||
inkscape:version="0.91 r13725"
|
||||
sodipodi:docname="icon.svg"
|
||||
inkscape:export-filename="/home/akien/Projects/godot/godot.git/icon.png"
|
||||
inkscape:export-xdpi="22.5"
|
||||
inkscape:export-ydpi="22.5">
|
||||
<defs
|
||||
id="defs3032" />
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="0.35"
|
||||
inkscape:cx="-560.15123"
|
||||
inkscape:cy="190.62119"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1015"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-maximized="1" />
|
||||
<metadata
|
||||
id="metadata3035">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(0,-28.362183)">
|
||||
<g
|
||||
id="g4149"
|
||||
transform="matrix(1.0688992,0,0,1.1334985,-45.061194,-81.689066)">
|
||||
<path
|
||||
sodipodi:nodetypes="cccccccccc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path3239"
|
||||
d="m 116.99388,715.36604 43.13957,-74.51381 75.99672,-171.42666 271.088,-13.63746 282.06373,14.1696 138.45065,255.56931 -25.0756,66.96734 -376.12685,53.39482 -367.70391,-40.32222 z"
|
||||
style="fill:#ffffff;fill-opacity:1;stroke:none" />
|
||||
<g
|
||||
transform="matrix(12.995388,0,0,-12.995388,898.37246,704.73082)"
|
||||
id="g3412">
|
||||
<path
|
||||
id="path3414"
|
||||
style="fill:#478cbf;fill-opacity:1;fill-rule:nonzero;stroke:none"
|
||||
d="m 0,0 0,-3.942 c 0,-0.39 -0.25,-0.734 -0.621,-0.852 L -6.835,-6.8 c -0.273,-0.091 -0.57,-0.042 -0.8,0.128 -0.232,0.168 -0.37,0.437 -0.37,0.721 l 0,4.305 -5.818,-1.108 0,-4.381 c 0,-0.447 -0.332,-0.824 -0.775,-0.885 l -8.41,-1.152 c -0.039,-0.003 -0.081,-0.008 -0.121,-0.008 -0.214,0 -0.424,0.078 -0.588,0.22 -0.195,0.172 -0.306,0.416 -0.306,0.676 l 0,4.638 -4.341,-0.018 0,-10e-4 -0.318,10e-4 -0.319,-10e-4 0,10e-4 -4.34,0.018 0,-4.638 c 0,-0.26 -0.112,-0.504 -0.307,-0.676 -0.164,-0.142 -0.374,-0.22 -0.587,-0.22 -0.041,0 -0.082,0.005 -0.123,0.008 l -8.41,1.152 c -0.442,0.061 -0.774,0.438 -0.774,0.885 l 0,4.381 -5.819,1.108 0,-4.305 c 0,-0.284 -0.137,-0.553 -0.368,-0.721 -0.232,-0.17 -0.529,-0.219 -0.802,-0.128 l -6.215,2.006 c -0.369,0.118 -0.619,0.462 -0.619,0.852 l 0,3.942 -3.837,1.29 c -0.19,-0.811 -0.295,-1.642 -0.295,-2.481 0,-10.301 14.512,-18.252 32.448,-18.309 l 0.022,0 0.023,0 c 17.936,0.057 32.448,8.008 32.448,18.309 0,0.766 -0.088,1.521 -0.247,2.266 L 0,0 Z"
|
||||
inkscape:connector-curvature="0" />
|
||||
</g>
|
||||
<g
|
||||
transform="matrix(12.995388,0,0,-12.995388,140.10982,467.34929)"
|
||||
id="g3416">
|
||||
<path
|
||||
id="path3418"
|
||||
style="fill:#478cbf;fill-opacity:1;fill-rule:nonzero;stroke:none"
|
||||
d="m 0,0 0,-16.047 2.163,-0.729 c 0.364,-0.122 0.61,-0.462 0.61,-0.847 l 0,-3.936 4.426,-1.428 0,4.154 c 0,0.27 0.118,0.52 0.323,0.689 0.206,0.172 0.474,0.241 0.739,0.192 l 7.608,-1.452 c 0.422,-0.079 0.728,-0.448 0.728,-0.877 l 0,-4.338 6.62,-0.904 0,4.509 c 0,0.241 0.096,0.467 0.264,0.635 0.167,0.166 0.394,0.259 0.633,0.259 l 0.002,0 5.551,-0.022 5.549,0.022 c 0.245,-10e-4 0.468,-0.093 0.635,-0.259 0.169,-0.168 0.264,-0.394 0.264,-0.635 l 0,-4.509 6.621,0.904 0,4.338 c 0,0.429 0.304,0.798 0.726,0.877 l 7.609,1.452 c 0.262,0.049 0.533,-0.02 0.738,-0.192 0.205,-0.169 0.325,-0.419 0.325,-0.689 l 0,-4.154 4.425,1.428 0,3.936 c 0,0.385 0.245,0.725 0.609,0.847 l 1.475,0.497 0,16.279 0.04,0 c 1.437,1.834 2.767,3.767 4.042,5.828 -1.694,2.883 -3.768,5.459 -5.986,7.846 -2.057,-1.035 -4.055,-2.208 -5.942,-3.456 -0.944,0.938 -2.008,1.706 -3.052,2.509 -1.027,0.824 -2.183,1.428 -3.281,2.132 0.327,2.433 0.489,4.828 0.554,7.327 -2.831,1.424 -5.85,2.369 -8.903,3.047 -1.219,-2.048 -2.334,-4.267 -3.304,-6.436 -1.152,0.192 -2.309,0.264 -3.467,0.277 l 0,0.002 c -0.008,0 -0.015,-0.002 -0.022,-0.002 -0.008,0 -0.015,0.002 -0.022,0.002 l 0,-0.002 c -1.16,-0.013 -2.316,-0.085 -3.468,-0.277 -0.97,2.169 -2.084,4.388 -3.305,6.436 C 19.475,24.555 16.456,23.61 13.626,22.186 13.69,19.687 13.852,17.292 14.18,14.859 13.081,14.155 11.925,13.551 10.898,12.727 9.855,11.924 8.79,11.156 7.846,10.218 5.958,11.466 3.961,12.639 1.904,13.674 -0.314,11.287 -2.388,8.711 -4.082,5.828 -2.807,3.767 -1.477,1.834 -0.04,0 L 0,0 Z"
|
||||
inkscape:connector-curvature="0" />
|
||||
</g>
|
||||
<g
|
||||
transform="matrix(12.995388,0,0,-12.995388,411.4457,567.42812)"
|
||||
id="g3420">
|
||||
<path
|
||||
id="path3422"
|
||||
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
|
||||
d="m 0,0 c 0,-3.611 -2.926,-6.537 -6.537,-6.537 -3.608,0 -6.535,2.926 -6.535,6.537 0,3.609 2.927,6.533 6.535,6.533 C -2.926,6.533 0,3.609 0,0"
|
||||
inkscape:connector-curvature="0" />
|
||||
</g>
|
||||
<g
|
||||
transform="matrix(12.995388,0,0,-12.995388,391.00655,572.46636)"
|
||||
id="g3424">
|
||||
<path
|
||||
id="path3426"
|
||||
style="fill:#414042;fill-opacity:1;fill-rule:nonzero;stroke:none"
|
||||
d="m 0,0 c 0,-2.396 -1.941,-4.337 -4.339,-4.337 -2.396,0 -4.339,1.941 -4.339,4.337 0,2.396 1.943,4.339 4.339,4.339 C -1.941,4.339 0,2.396 0,0"
|
||||
inkscape:connector-curvature="0" />
|
||||
</g>
|
||||
<g
|
||||
transform="matrix(12.995388,0,0,-12.995388,526.30933,660.10985)"
|
||||
id="g3428">
|
||||
<path
|
||||
id="path3430"
|
||||
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
|
||||
d="m 0,0 c -1.162,0 -2.104,0.856 -2.104,1.912 l 0,6.018 c 0,1.054 0.942,1.912 2.104,1.912 1.162,0 2.106,-0.858 2.106,-1.912 l 0,-6.018 C 2.106,0.856 1.162,0 0,0"
|
||||
inkscape:connector-curvature="0" />
|
||||
</g>
|
||||
<g
|
||||
transform="matrix(12.995388,0,0,-12.995388,641.18731,567.42812)"
|
||||
id="g3432">
|
||||
<path
|
||||
id="path3434"
|
||||
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
|
||||
d="m 0,0 c 0,-3.611 2.926,-6.537 6.537,-6.537 3.609,0 6.535,2.926 6.535,6.537 0,3.609 -2.926,6.533 -6.535,6.533 C 2.926,6.533 0,3.609 0,0"
|
||||
inkscape:connector-curvature="0" />
|
||||
</g>
|
||||
<g
|
||||
transform="matrix(12.995388,0,0,-12.995388,661.63165,572.46636)"
|
||||
id="g3436">
|
||||
<path
|
||||
id="path3438"
|
||||
style="fill:#414042;fill-opacity:1;fill-rule:nonzero;stroke:none"
|
||||
d="m 0,0 c 0,-2.396 1.941,-4.337 4.336,-4.337 2.398,0 4.339,1.941 4.339,4.337 0,2.396 -1.941,4.339 -4.339,4.339 C 1.941,4.339 0,2.396 0,0"
|
||||
inkscape:connector-curvature="0" />
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 7.3 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
@@ -173,6 +173,7 @@ void InputDefault::joy_connection_changed(int p_idx, bool p_connected, String p_
|
||||
for (int i=0; i < map_db.size(); i++) {
|
||||
if (js.uid == map_db[i].uid) {
|
||||
mapping = i;
|
||||
js.name = map_db[i].name;
|
||||
//printf("found mapping\n");
|
||||
};
|
||||
};
|
||||
@@ -487,6 +488,7 @@ static const char *s_ControllerMappings [] =
|
||||
"030000006f0e00001304000000010000,Generic X-Box pad,x:b2,a:b0,b:b1,y:b3,back:b6,guide:b8,start:b7,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:a2,rightshoulder:b5,righttrigger:a5,leftstick:b9,rightstick:b10,leftx:a0,lefty:a1,rightx:a3,righty:a4,",
|
||||
"030000006f0e00001e01000011010000,Rock Candy Gamepad for PS3,a:b1,b:b2,x:b0,y:b3,back:b8,start:b9,guide:b12,leftshoulder:b4,rightshoulder:b5,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,",
|
||||
"030000006f0e00001f01000000010000,Generic X-Box pad,x:b2,a:b0,b:b1,y:b3,back:b6,guide:b8,start:b7,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:a2,rightshoulder:b5,righttrigger:a5,leftstick:b9,rightstick:b10,leftx:a0,lefty:a1,rightx:a3,righty:a4,",
|
||||
"030000006f0e00002801000011010000,PDP Rock Candy Wireless Controller for PS3,leftx:a0,lefty:a1,dpdown:h0.4,rightstick:b11,rightshoulder:b5,rightx:a2,start:b9,righty:a3,dpleft:h0.8,lefttrigger:b6,x:b0,dpup:h0.1,back:b8,leftstick:b10,leftshoulder:b4,y:b3,a:b1,dpright:h0.2,righttrigger:b7,b:b2,",
|
||||
"030000006f0e00003001000001010000,EA Sports PS3 Controller,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,",
|
||||
"03000000790000000600000010010000,DragonRise Inc. Generic USB Joystick,x:b3,a:b2,b:b1,y:b0,back:b8,start:b9,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a3,righty:a4,",
|
||||
"03000000790000001100000010010000,RetroLink Saturn Classic Controller,x:b3,a:b0,b:b1,y:b4,back:b5,guide:b2,start:b8,leftshoulder:b6,rightshoulder:b7,leftx:a0,lefty:a1,",
|
||||
@@ -501,9 +503,11 @@ static const char *s_ControllerMappings [] =
|
||||
"03000000c9110000f055000011010000,HJC Game GAMEPAD,platform:Linux,x:b2,a:b0,b:b1,y:b3,back:b4,back:b8,start:b9,dpleft:h0.8,dpdown:h0.0,dpdown:h0.4,dpright:h0.0,dpright:h0.2,dpup:h0.0,dpup:h0.1,leftshoulder:h0.0,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,",
|
||||
"03000000de280000ff11000001000000,Valve Streaming Gamepad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,",
|
||||
"03000000f0250000c183000010010000,Goodbetterbest Ltd USB Controller,x:b0,a:b1,b:b2,y:b3,back:b8,guide:b12,start:b9,dpleft:h0.8,dpdown:h0.0,dpdown:h0.4,dpright:h0.0,dpright:h0.2,dpup:h0.0,dpup:h0.1,leftshoulder:h0.0,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,",
|
||||
"03000000fd0500002a26000000010000,3dfx InterAct HammerHead FX,leftx:a0,lefty:a1,dpdown:h0.4,rightstick:b5,rightshoulder:b7,rightx:a2,start:b11,righty:a3,dpleft:h0.8,lefttrigger:b8,x:b0,dpup:h0.1,back:b10,leftstick:b2,leftshoulder:b6,y:b1,a:b3,dpright:h0.2,righttrigger:b9,b:b4,",
|
||||
"03000000ff1100003133000010010000,PC Game Controller,a:b2,b:b1,y:b0,x:b3,start:b9,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,",
|
||||
"05000000362800000100000002010000,OUYA Game Controller,a:b0,b:b3,dpdown:b9,dpleft:b10,dpright:b11,dpup:b8,guide:b14,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,x:b1,y:b2,",
|
||||
"05000000362800000100000003010000,OUYA Game Controller,a:b0,b:b3,dpdown:b9,dpleft:b10,dpright:b11,dpup:b8,guide:b14,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,x:b1,y:b2,",
|
||||
"05000000362800000100000002010000,OUYA Game Controller,leftx:a0,lefty:a1,dpdown:b9,rightstick:b7,rightshoulder:b5,rightx:a3,start:b16,righty:a4,dpleft:b10,lefttrigger:b12,x:b1,dpup:b8,back:b14,leftstick:b6,leftshoulder:b4,y:b2,a:b0,dpright:b11,righttrigger:b13,b:b3,",
|
||||
"05000000362800000100000003010000,OUYA Game Controller,leftx:a0,lefty:a1,dpdown:b9,rightstick:b7,rightshoulder:b5,rightx:a3,start:b16,righty:a4,dpleft:b10,lefttrigger:b12,x:b1,dpup:b8,back:b14,leftstick:b6,leftshoulder:b4,y:b2,a:b0,dpright:b11,righttrigger:b13,b:b3,",
|
||||
"05000000362800000100000004010000,OUYA Game Controller,leftx:a0,lefty:a1,dpdown:b9,rightstick:b7,rightshoulder:b5,rightx:a3,start:b16,righty:a4,dpleft:b10,lefttrigger:b12,x:b1,dpup:b8,back:b14,leftstick:b6,leftshoulder:b4,y:b2,a:b0,dpright:b11,righttrigger:b13,b:b3,",
|
||||
"0500000047532047616d657061640000,GameStop Gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,",
|
||||
"050000004c050000c405000000010000,PS4 Controller (Bluetooth),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,",
|
||||
"050000007e0500003003000001000000,Nintendo Wii U Pro Controller,a:b0,b:b1,x:b3,y:b2,back:b8,start:b9,guide:b10,leftshoulder:b4,rightshoulder:b5,leftstick:b11,rightstick:b12,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,dpup:b13,dpleft:b15,dpdown:b14,dpright:b16,",
|
||||
@@ -513,7 +517,12 @@ static const char *s_ControllerMappings [] =
|
||||
|
||||
#if defined(__ANDROID__)
|
||||
"Default Android Gamepad,Default Controller,leftx:a0,lefty:a1,dpdown:h0.4,rightstick:b8,rightshoulder:b10,rightx:a2,start:b6,righty:a3,dpleft:h0.8,lefttrigger:a4,x:b2,dpup:h0.1,back:b4,leftstick:b7,leftshoulder:b9,y:b3,a:b0,dpright:h0.2,righttrigger:a5,b:b1,",
|
||||
"47656e6572696320582d426f78207061,Logitech F-310,leftx:a0,lefty:a1,dpdown:h0.4,rightstick:b8,rightshoulder:b10,rightx:a2,start:b6,righty:a3,dpleft:h0.8,lefttrigger:a5,x:b2,dpup:h0.1,leftstick:b7,leftshoulder:b9,y:b3,a:b0,dpright:h0.2,righttrigger:a4,b:b1,",
|
||||
"484f524920434f2e2c4c544420205041,Hori Gem Pad 3,leftx:a0,lefty:a1,dpdown:h0.4,rightstick:b6,rightshoulder:b18,rightx:a2,start:b16,righty:a3,dpleft:h0.8,lefttrigger:b9,x:b0,dpup:h0.1,back:b15,leftstick:b4,leftshoulder:b3,y:b2,a:b1,dpright:h0.2,righttrigger:b10,b:b17,",
|
||||
"4d6963726f736f667420582d426f7820,Microsoft X-Box 360 pad,leftx:a0,lefty:a1,dpdown:h0.4,rightstick:b8,rightshoulder:b10,rightx:a2,start:b6,righty:a3,dpleft:h0.8,lefttrigger:a4,x:b2,dpup:h0.1,leftstick:b7,leftshoulder:b9,y:b3,a:b0,dpright:h0.2,righttrigger:a5,b:b1,",
|
||||
"4e564944494120436f72706f72617469,NVIDIA Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,",
|
||||
"532e542e442e20496e74657261637420,3dfx InterAct HammerHead FX,leftx:a0,lefty:a1,dpdown:h0.4,rightstick:b25,rightshoulder:b27,rightx:a2,start:b31,righty:a3,dpleft:h0.8,lefttrigger:b28,x:b20,dpup:h0.1,back:b30,leftstick:b22,leftshoulder:b26,y:b21,a:b23,dpright:h0.2,righttrigger:b29,b:b24,",
|
||||
"506572666f726d616e63652044657369,PDP Rock Candy Wireless Controller for PS3,leftx:a0,lefty:a1,dpdown:h0.4,rightstick:b6,rightshoulder:b18,rightx:a2,start:b16,righty:a3,dpleft:h0.8,lefttrigger:b9,x:b0,dpup:h0.1,back:h0.2,leftstick:b4,leftshoulder:b3,y:b2,a:b1,dpright:h0.2,righttrigger:b10,b:b17,",
|
||||
#endif
|
||||
|
||||
#ifdef JAVASCRIPT_ENABLED
|
||||
@@ -818,6 +827,7 @@ void InputDefault::parse_mapping(String p_mapping) {
|
||||
uid.resize(17);
|
||||
|
||||
mapping.uid = entry[0];
|
||||
mapping.name = entry[1];
|
||||
|
||||
int idx = 1;
|
||||
while (++idx < entry.size()) {
|
||||
|
@@ -102,6 +102,7 @@ private:
|
||||
struct JoyDeviceMapping {
|
||||
|
||||
String uid;
|
||||
String name;
|
||||
Map<int,JoyEvent> buttons;
|
||||
Map<int,JoyEvent> axis;
|
||||
JoyEvent hat[HAT_MAX];
|
||||
|
@@ -1011,6 +1011,7 @@ bool Main::start() {
|
||||
bool noquit=false;
|
||||
bool convert_old=false;
|
||||
bool export_debug=false;
|
||||
bool project_manager_request = false;
|
||||
List<String> args = OS::get_singleton()->get_cmdline_args();
|
||||
for (int i=0;i<args.size();i++) {
|
||||
//parameters that do not have an argument to the right
|
||||
@@ -1022,6 +1023,8 @@ bool Main::start() {
|
||||
convert_old=true;
|
||||
} else if (args[i]=="-editor" || args[i]=="-e") {
|
||||
editor=true;
|
||||
} else if (args[i] == "-pm" || args[i] == "-project_manager") {
|
||||
project_manager_request = true;
|
||||
} else if (args[i].length() && args[i][0] != '-' && game_path == "") {
|
||||
game_path=args[i];
|
||||
}
|
||||
@@ -1255,7 +1258,7 @@ bool Main::start() {
|
||||
}
|
||||
|
||||
|
||||
if (game_path!="") {
|
||||
if (game_path!="" && !project_manager_request) {
|
||||
|
||||
String local_game_path=game_path.replace("\\","/");
|
||||
|
||||
@@ -1462,7 +1465,7 @@ bool Main::start() {
|
||||
};
|
||||
}
|
||||
*/
|
||||
if (script=="" && test=="" && game_path=="" && !editor) {
|
||||
if (project_manager_request || (script=="" && test=="" && game_path=="" && !editor)) {
|
||||
|
||||
ProjectManager *pmanager = memnew( ProjectManager );
|
||||
sml->get_root()->add_child(pmanager);
|
||||
|
@@ -1096,6 +1096,8 @@ def update_version():
|
||||
f.write("#define VERSION_NAME "+str(version.name)+"\n")
|
||||
f.write("#define VERSION_MAJOR "+str(version.major)+"\n")
|
||||
f.write("#define VERSION_MINOR "+str(version.minor)+"\n")
|
||||
if (hasattr(version, 'patch')):
|
||||
f.write("#define VERSION_PATCH "+str(version.patch)+"\n")
|
||||
f.write("#define VERSION_REVISION "+str(rev)+"\n")
|
||||
f.write("#define VERSION_STATUS "+str(version.status)+"\n")
|
||||
import datetime
|
||||
|
@@ -1790,7 +1790,7 @@ void GDParser::_parse_block(BlockNode *p_block,bool p_static) {
|
||||
p_block->sub_blocks.push_back(cf_for->body);
|
||||
|
||||
if (!_enter_indent_block(cf_for->body)) {
|
||||
_set_error("Expected indented block after 'while'");
|
||||
_set_error("Expected indented block after 'for'");
|
||||
p_block->end_line=tokenizer->get_token_line();
|
||||
return;
|
||||
}
|
||||
|
@@ -59,7 +59,7 @@ for x in env.android_dependencies:
|
||||
gradle_java_dirs_text=""
|
||||
|
||||
for x in env.android_java_dirs:
|
||||
gradle_java_dirs_text+=",'"+x+"'"
|
||||
gradle_java_dirs_text+=",'"+x.replace("\\","/")+"'"
|
||||
|
||||
|
||||
gradle_res_dirs_text=""
|
||||
|
@@ -1493,6 +1493,16 @@ void EditorExportPlatformAndroid::_device_poll_thread(void *ud) {
|
||||
OS::get_singleton()->delay_usec(3000000);
|
||||
}
|
||||
|
||||
if (EditorSettings::get_singleton()->get("android/shutdown_adb_on_exit")) {
|
||||
String adb=EditorSettings::get_singleton()->get("android/adb");
|
||||
if (!FileAccess::exists(adb)) {
|
||||
return; //adb not configured
|
||||
}
|
||||
|
||||
List<String> args;
|
||||
args.push_back("kill-server");
|
||||
OS::get_singleton()->execute(adb,args,true);
|
||||
};
|
||||
}
|
||||
|
||||
Error EditorExportPlatformAndroid::run(int p_device, int p_flags) {
|
||||
|
@@ -183,12 +183,12 @@ size_t DirAccessFlash::get_space_left() {
|
||||
|
||||
Error DirAccessFlash::rename(String p_from, String p_to) {
|
||||
|
||||
return FAILED;
|
||||
ERR_FAIL_V(ERR_UNAVAILABLE);
|
||||
};
|
||||
|
||||
Error DirAccessFlash::remove(String p_name) {
|
||||
|
||||
return FAILED;
|
||||
ERR_FAIL_V(ERR_UNAVAILABLE);
|
||||
};
|
||||
|
||||
extern char* psp_drive;
|
||||
|
@@ -74,6 +74,15 @@ static void _glut_skey(bool pressed,int key) {
|
||||
case GLUT_KEY_INSERT: ev.key.scancode=KEY_INSERT; break;
|
||||
}
|
||||
|
||||
if (pressed) {
|
||||
if (os->skey_pressed[key])
|
||||
ev.key.echo = true;
|
||||
else
|
||||
os->skey_pressed[key] = true;
|
||||
}
|
||||
else {
|
||||
os->skey_pressed[key] = false;
|
||||
}
|
||||
|
||||
uint32_t m = glutGetModifiers();
|
||||
ev.key.mod.alt=(m&GLUT_ACTIVE_ALT)!=0;
|
||||
@@ -107,6 +116,16 @@ static void _glut_key(bool pressed,unsigned char key) {
|
||||
default: {
|
||||
ev.key.unicode=key;
|
||||
}
|
||||
|
||||
if (pressed) {
|
||||
if (os->key_pressed[key])
|
||||
ev.key.echo = true;
|
||||
else
|
||||
os->key_pressed[key] = true;
|
||||
}
|
||||
else {
|
||||
os->key_pressed[key] = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@@ -693,7 +693,11 @@ OS_JavaScript::OS_JavaScript(GFXInitFunc p_gfx_init_func,void*p_gfx_init_ud, Ope
|
||||
|
||||
time_to_save_sync=-1;
|
||||
|
||||
|
||||
for (int i = 0; i < 256; i++) {
|
||||
key_pressed[i] = false;
|
||||
if (i < 121)
|
||||
skey_pressed[i] = false;
|
||||
}
|
||||
}
|
||||
|
||||
OS_JavaScript::~OS_JavaScript() {
|
||||
|
@@ -56,10 +56,12 @@ public:
|
||||
Point2 pos;
|
||||
};
|
||||
|
||||
bool skey_pressed[121];
|
||||
bool key_pressed[256];
|
||||
|
||||
private:
|
||||
|
||||
Vector<TouchPos> touch;
|
||||
|
||||
Point2 last_mouse;
|
||||
unsigned int last_id;
|
||||
GFXInitFunc gfx_init_func;
|
||||
|
@@ -297,8 +297,11 @@ Error DirAccessOSX::rename(String p_path,String p_new_path) {
|
||||
}
|
||||
Error DirAccessOSX::remove(String p_path) {
|
||||
|
||||
p_path=fix_path(p_path);
|
||||
|
||||
if (p_path.is_rel_path())
|
||||
p_path=get_current_dir().plus_file(p_path);
|
||||
else
|
||||
p_path=fix_path(p_path);
|
||||
|
||||
struct stat flags;
|
||||
if ((stat(p_path.utf8().get_data(),&flags)!=0))
|
||||
return FAILED;
|
||||
|
@@ -28,7 +28,6 @@ def get_flags():
|
||||
|
||||
return [
|
||||
('builtin_zlib', 'no'),
|
||||
('theora','no'), #use builtin openssl
|
||||
]
|
||||
|
||||
|
||||
|
@@ -49,13 +49,11 @@ private:
|
||||
JOYSTICKS_MAX = 16,
|
||||
MAX_ABS = 63,
|
||||
MAX_KEY = 767, // Hack because <linux/input.h> can't be included here
|
||||
BT_MISC = 256,
|
||||
HAT_MAX = 4,
|
||||
};
|
||||
|
||||
struct Joystick {
|
||||
InputDefault::JoyAxis curr_axis[MAX_ABS];
|
||||
int key_map[MAX_KEY - BT_MISC];
|
||||
int key_map[MAX_KEY];
|
||||
int abs_map[MAX_ABS];
|
||||
int dpad;
|
||||
int fd;
|
||||
|
@@ -188,13 +188,15 @@ bool Sprite::is_region() const{
|
||||
|
||||
void Sprite::set_region_rect(const Rect2& p_region_rect) {
|
||||
|
||||
bool changed=region_rect!=p_region_rect;
|
||||
if (region_rect==p_region_rect)
|
||||
return;
|
||||
|
||||
region_rect=p_region_rect;
|
||||
if (region && changed) {
|
||||
update();
|
||||
|
||||
if (region)
|
||||
item_rect_changed();
|
||||
_change_notify("region_rect");
|
||||
}
|
||||
|
||||
_change_notify("region_rect");
|
||||
}
|
||||
|
||||
Rect2 Sprite::get_region_rect() const {
|
||||
|
@@ -607,20 +607,21 @@ float AnimationTreePlayer::_process_node(const StringName& p_node,AnimationNode
|
||||
Blend3Node *bn = static_cast<Blend3Node*>(nb);
|
||||
|
||||
float rem;
|
||||
|
||||
if (bn->value==0) {
|
||||
rem = _process_node(bn->inputs[1].node,r_prev_anim,p_weight,p_time,switched,p_seek,p_filter,p_reverse_weight);
|
||||
} else if (bn->value>0) {
|
||||
|
||||
rem = _process_node(bn->inputs[1].node,r_prev_anim,p_weight*(1.0-bn->value),p_time,switched,p_seek,p_filter,p_reverse_weight*(1.0-bn->value));
|
||||
_process_node(bn->inputs[2].node,r_prev_anim,p_weight*bn->value,p_time,switched,p_seek,p_filter,p_reverse_weight*bn->value);
|
||||
|
||||
float blend, lower_blend, upper_blend;
|
||||
if (bn->value < 0) {
|
||||
lower_blend = -bn->value;
|
||||
blend = 1.0 - lower_blend;
|
||||
upper_blend = 0;
|
||||
} else {
|
||||
|
||||
rem = _process_node(bn->inputs[1].node,r_prev_anim,p_weight*(1.0+bn->value),p_time,switched,p_seek,p_filter,p_reverse_weight*(1.0+bn->value));
|
||||
_process_node(bn->inputs[0].node,r_prev_anim,p_weight*-bn->value,p_time,switched,p_seek,p_filter,p_reverse_weight*-bn->value);
|
||||
lower_blend = 0;
|
||||
blend = 1.0 - bn->value;
|
||||
upper_blend = bn->value;
|
||||
}
|
||||
|
||||
rem = _process_node(bn->inputs[1].node,r_prev_anim,p_weight*blend,p_time,switched,p_seek,p_filter,p_reverse_weight*blend);
|
||||
_process_node(bn->inputs[2].node,r_prev_anim,p_weight*upper_blend,p_time,switched,p_seek,p_filter,p_reverse_weight*upper_blend);
|
||||
_process_node(bn->inputs[0].node,r_prev_anim,p_weight*lower_blend,p_time,switched,p_seek,p_filter,p_reverse_weight*lower_blend);
|
||||
|
||||
return rem;
|
||||
} break;
|
||||
case NODE_BLEND4: {
|
||||
@@ -768,6 +769,10 @@ void AnimationTreePlayer::_process_animation(float p_delta) {
|
||||
t.scale.x=0;
|
||||
t.scale.y=0;
|
||||
t.scale.z=0;
|
||||
|
||||
Variant value = t.node->get(t.property);
|
||||
value.zero();
|
||||
t.node->set(t.property, value);
|
||||
}
|
||||
|
||||
|
||||
@@ -777,11 +782,9 @@ void AnimationTreePlayer::_process_animation(float p_delta) {
|
||||
Quat empty_rot;
|
||||
|
||||
|
||||
int total = 0;
|
||||
while(anim_list) {
|
||||
|
||||
if (!anim_list->animation.is_null() && !anim_list->skip) {
|
||||
++total;
|
||||
//check if animation is meaningful
|
||||
Animation *a = anim_list->animation.operator->();
|
||||
|
||||
@@ -816,8 +819,9 @@ void AnimationTreePlayer::_process_animation(float p_delta) {
|
||||
case Animation::TYPE_VALUE: { ///< Set a value in a property, can be interpolated.
|
||||
|
||||
if (a->value_track_is_continuous(tr.local_track)) {
|
||||
Variant value = a->value_track_interpolate(tr.local_track,anim_list->time);
|
||||
tr.track->node->set(tr.track->property,value);
|
||||
Variant blended, value = a->value_track_interpolate(tr.local_track,anim_list->time);
|
||||
Variant::blend(tr.track->node->get(tr.track->property),value,blend,blended);
|
||||
tr.track->node->set(tr.track->property,blended);
|
||||
} else {
|
||||
|
||||
List<int> indices;
|
||||
|
@@ -847,7 +847,7 @@ void TextEdit::_notification(int p_what) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool completion_below = false;
|
||||
if (completion_active) {
|
||||
// code completion box
|
||||
Ref<StyleBox> csb = get_stylebox("completion");
|
||||
@@ -878,11 +878,12 @@ void TextEdit::_notification(int p_what) {
|
||||
}
|
||||
|
||||
int th = h + csb->get_minimum_size().y;
|
||||
|
||||
if (cursor_pos.y+get_row_height()+th > get_size().height) {
|
||||
completion_rect.pos.y=cursor_pos.y-th;
|
||||
} else {
|
||||
completion_rect.pos.y=cursor_pos.y+get_row_height()+csb->get_offset().y;
|
||||
|
||||
completion_below = true;
|
||||
}
|
||||
|
||||
if (cursor_pos.x-nofs+w+scrollw > get_size().width) {
|
||||
@@ -930,8 +931,24 @@ void TextEdit::_notification(int p_what) {
|
||||
completion_line_ofs=line_from;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// check to see if the hint should be drawn
|
||||
bool show_hint = false;
|
||||
if (completion_hint!="") {
|
||||
if (completion_active) {
|
||||
if (completion_below && !callhint_below) {
|
||||
show_hint = true;
|
||||
}
|
||||
else if (!completion_below && callhint_below) {
|
||||
show_hint = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
show_hint = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (show_hint) {
|
||||
|
||||
Ref<StyleBox> sb = get_stylebox("panel","TooltipPanel");
|
||||
Ref<Font> font = cache.font;
|
||||
@@ -967,7 +984,15 @@ void TextEdit::_notification(int p_what) {
|
||||
}
|
||||
|
||||
|
||||
Point2 hint_ofs = Vector2(completion_hint_offset,cursor_pos.y-minsize.y);
|
||||
Point2 hint_ofs = Vector2(completion_hint_offset,cursor_pos.y) + callhint_offset;
|
||||
|
||||
if (callhint_below) {
|
||||
hint_ofs.y += get_row_height() + sb->get_offset().y;
|
||||
}
|
||||
else {
|
||||
hint_ofs.y -= minsize.y + sb->get_offset().y;
|
||||
}
|
||||
|
||||
draw_style_box(sb,Rect2(hint_ofs,minsize));
|
||||
|
||||
spacing=0;
|
||||
|
@@ -231,6 +231,9 @@ class TextEdit : public Control {
|
||||
|
||||
bool next_operation_is_complex;
|
||||
|
||||
bool callhint_below;
|
||||
Vector2 callhint_offset;
|
||||
|
||||
int get_visible_rows() const;
|
||||
|
||||
int get_char_count();
|
||||
@@ -326,6 +329,10 @@ public:
|
||||
brace_matching_enabled=p_enabled;
|
||||
update();
|
||||
}
|
||||
inline void set_callhint_settings(bool below, Vector2 offset) {
|
||||
callhint_below = below;
|
||||
callhint_offset = offset;
|
||||
}
|
||||
void set_auto_indent(bool p_auto_indent);
|
||||
|
||||
void cursor_set_column(int p_col, bool p_adjust_viewport=true);
|
||||
|
@@ -1803,6 +1803,7 @@ void Viewport::_gui_input_event(InputEvent p_event) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (gui.drag_data.get_type()==Variant::NIL && over && !gui.modal_stack.empty()) {
|
||||
|
||||
Control *top = gui.modal_stack.back()->get();
|
||||
@@ -1836,7 +1837,7 @@ void Viewport::_gui_input_event(InputEvent p_event) {
|
||||
}
|
||||
|
||||
|
||||
Matrix32 localizer = over->get_canvas_transform().affine_inverse();
|
||||
Matrix32 localizer = over->get_global_transform_with_canvas().affine_inverse();
|
||||
Size2 pos = localizer.xform(mpos);
|
||||
Vector2 speed = localizer.basis_xform(Point2(p_event.mouse_motion.speed_x,p_event.mouse_motion.speed_y));
|
||||
Vector2 rel = localizer.basis_xform(Point2(p_event.mouse_motion.relative_x,p_event.mouse_motion.relative_y));
|
||||
@@ -1871,7 +1872,7 @@ void Viewport::_gui_input_event(InputEvent p_event) {
|
||||
}
|
||||
|
||||
|
||||
pos = gui.focus_inv_xform.xform(pos);
|
||||
//pos = gui.focus_inv_xform.xform(pos);
|
||||
|
||||
|
||||
p_event.mouse_motion.x = pos.x;
|
||||
|
@@ -568,6 +568,12 @@ void CodeTextEditor::_on_settings_change() {
|
||||
);
|
||||
|
||||
enable_complete_timer = EDITOR_DEF("text_editor/enable_code_completion_delay",true);
|
||||
|
||||
// call hint settings
|
||||
text_editor->set_callhint_settings(
|
||||
EDITOR_DEF("text_editor/put_callhint_tooltip_below_current_line", true),
|
||||
EDITOR_DEF("text_editor/callhint_tooltip_offset", Vector2())
|
||||
);
|
||||
}
|
||||
|
||||
void CodeTextEditor::_text_changed_idle_timeout() {
|
||||
|
@@ -405,29 +405,98 @@ void EditorHelpIndex::select_class(const String& p_class) {
|
||||
class_list->ensure_cursor_is_visible();
|
||||
}
|
||||
|
||||
void EditorHelpIndex::popup() {
|
||||
|
||||
popup_centered_ratio(0.6);
|
||||
|
||||
search_box->set_text("");
|
||||
_update_class_list();
|
||||
}
|
||||
|
||||
void EditorHelpIndex::_notification(int p_what) {
|
||||
|
||||
if (p_what==NOTIFICATION_ENTER_TREE) {
|
||||
|
||||
class_list->clear();
|
||||
tree_item_map.clear();
|
||||
TreeItem *root = class_list->create_item();
|
||||
class_list->set_hide_root(true);
|
||||
_update_class_list();
|
||||
|
||||
connect("confirmed",this,"_tree_item_selected");
|
||||
|
||||
} else if (p_what==NOTIFICATION_POST_POPUP) {
|
||||
|
||||
for(Map<String,DocData::ClassDoc>::Element *E=EditorHelp::get_doc_data()->class_list.front();E;E=E->next()) {
|
||||
search_box->call_deferred("grab_focus");
|
||||
}
|
||||
}
|
||||
|
||||
void EditorHelpIndex::_text_changed(const String& p_text) {
|
||||
|
||||
_update_class_list();
|
||||
}
|
||||
|
||||
void EditorHelpIndex::_update_class_list() {
|
||||
|
||||
class_list->clear();
|
||||
tree_item_map.clear();
|
||||
TreeItem *root = class_list->create_item();
|
||||
class_list->set_hide_root(true);
|
||||
|
||||
String filter = search_box->get_text().strip_edges();
|
||||
String to_select = "";
|
||||
|
||||
for(Map<String,DocData::ClassDoc>::Element *E=EditorHelp::get_doc_data()->class_list.front();E;E=E->next()) {
|
||||
|
||||
if (filter == "") {
|
||||
add_type(E->key(),tree_item_map,root);
|
||||
}
|
||||
} else {
|
||||
|
||||
bool found = false;
|
||||
String type = E->key();
|
||||
|
||||
while(type != "") {
|
||||
if (type.findn(filter)!=-1) {
|
||||
|
||||
if (to_select.empty()) {
|
||||
to_select = type;
|
||||
}
|
||||
|
||||
found=true;
|
||||
break;
|
||||
}
|
||||
|
||||
type = EditorHelp::get_doc_data()->class_list[type].inherits;
|
||||
}
|
||||
|
||||
if (found) {
|
||||
add_type(E->key(),tree_item_map,root);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (tree_item_map.has(filter)) {
|
||||
select_class(filter);
|
||||
} else if (to_select != "") {
|
||||
select_class(to_select);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void EditorHelpIndex::_sbox_input(const InputEvent& p_ie) {
|
||||
|
||||
if (p_ie.type==InputEvent::KEY && (
|
||||
p_ie.key.scancode == KEY_UP ||
|
||||
p_ie.key.scancode == KEY_DOWN ||
|
||||
p_ie.key.scancode == KEY_PAGEUP ||
|
||||
p_ie.key.scancode == KEY_PAGEDOWN ) ) {
|
||||
|
||||
class_list->call("_input_event",p_ie);
|
||||
search_box->accept_event();
|
||||
}
|
||||
}
|
||||
|
||||
void EditorHelpIndex::_bind_methods() {
|
||||
|
||||
ObjectTypeDB::bind_method("_tree_item_selected",&EditorHelpIndex::_tree_item_selected);
|
||||
ObjectTypeDB::bind_method("_text_changed",&EditorHelpIndex::_text_changed);
|
||||
ObjectTypeDB::bind_method("_sbox_input",&EditorHelpIndex::_sbox_input);
|
||||
ObjectTypeDB::bind_method("select_class",&EditorHelpIndex::select_class);
|
||||
ADD_SIGNAL( MethodInfo("open_class"));
|
||||
}
|
||||
@@ -436,19 +505,25 @@ void EditorHelpIndex::_bind_methods() {
|
||||
|
||||
EditorHelpIndex::EditorHelpIndex() {
|
||||
|
||||
|
||||
VBoxContainer *vbc = memnew( VBoxContainer );
|
||||
add_child(vbc);
|
||||
set_child_rect(vbc);
|
||||
|
||||
search_box = memnew( LineEdit );
|
||||
vbc->add_margin_child("Search:", search_box);
|
||||
search_box->set_h_size_flags(SIZE_EXPAND_FILL);
|
||||
|
||||
register_text_enter(search_box);
|
||||
|
||||
search_box->connect("text_changed", this, "_text_changed");
|
||||
search_box->connect("input_event", this, "_sbox_input");
|
||||
|
||||
class_list = memnew( Tree );
|
||||
vbc->add_margin_child("Class List: ",class_list,true);
|
||||
vbc->add_margin_child("Class List: ", class_list, true);
|
||||
class_list->set_v_size_flags(SIZE_EXPAND_FILL);
|
||||
|
||||
|
||||
class_list->connect("item_activated",this,"_tree_item_selected");
|
||||
|
||||
|
||||
get_ok()->set_text("Open");
|
||||
}
|
||||
|
||||
@@ -650,14 +725,64 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) {
|
||||
class_desc->add_text("Inherits: ");
|
||||
class_desc->pop();
|
||||
class_desc->pop();
|
||||
|
||||
String inherits = cd.inherits;
|
||||
|
||||
class_desc->push_font(doc_font);
|
||||
_add_type(cd.inherits);
|
||||
|
||||
while (inherits != "") {
|
||||
_add_type(inherits);
|
||||
|
||||
inherits = doc->class_list[inherits].inherits;
|
||||
|
||||
if (inherits != "") {
|
||||
class_desc->add_text(" , ");
|
||||
}
|
||||
}
|
||||
|
||||
class_desc->pop();
|
||||
class_desc->add_newline();
|
||||
class_desc->add_newline();
|
||||
|
||||
}
|
||||
|
||||
if (ObjectTypeDB::type_exists(cd.name)) {
|
||||
|
||||
bool found = false;
|
||||
bool prev = false;
|
||||
|
||||
for (Map<String,DocData::ClassDoc>::Element *E=doc->class_list.front();E;E=E->next()) {
|
||||
|
||||
if (E->get().inherits == cd.name) {
|
||||
|
||||
if (!found) {
|
||||
class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/keyword_color"));
|
||||
class_desc->push_font(doc_title_font);
|
||||
class_desc->add_text("Inherited by: ");
|
||||
class_desc->pop();
|
||||
class_desc->pop();
|
||||
|
||||
found = true;
|
||||
class_desc->push_font(doc_font);
|
||||
}
|
||||
|
||||
if (prev) {
|
||||
|
||||
class_desc->add_text(" , ");
|
||||
prev = false;
|
||||
}
|
||||
|
||||
_add_type(E->get().name);
|
||||
prev = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (found)
|
||||
class_desc->pop();
|
||||
|
||||
class_desc->add_newline();
|
||||
}
|
||||
|
||||
class_desc->add_newline();
|
||||
|
||||
if (cd.brief_description!="") {
|
||||
|
||||
class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/keyword_color"));
|
||||
|
@@ -77,11 +77,16 @@ public:
|
||||
class EditorHelpIndex : public ConfirmationDialog {
|
||||
OBJ_TYPE( EditorHelpIndex, ConfirmationDialog );
|
||||
|
||||
|
||||
LineEdit *search_box;
|
||||
Tree *class_list;
|
||||
HashMap<String,TreeItem*> tree_item_map;
|
||||
|
||||
void _tree_item_selected();
|
||||
void _text_changed(const String& p_text);
|
||||
void _sbox_input(const InputEvent& p_ie);
|
||||
|
||||
void _update_class_list();
|
||||
|
||||
void add_type(const String& p_type,HashMap<String,TreeItem*>& p_types,TreeItem *p_root);
|
||||
protected:
|
||||
|
||||
@@ -92,6 +97,8 @@ public:
|
||||
|
||||
void select_class(const String& p_class);
|
||||
|
||||
void popup();
|
||||
|
||||
EditorHelpIndex();
|
||||
};
|
||||
|
||||
|
@@ -980,11 +980,6 @@ void EditorNode::_save_scene(String p_file) {
|
||||
|
||||
editor_data.apply_changes_in_editors();
|
||||
|
||||
if (editor_plugin_screen) {
|
||||
scene->set_meta("__editor_plugin_screen__",editor_plugin_screen->get_name());
|
||||
}
|
||||
|
||||
|
||||
_set_scene_metadata(p_file);
|
||||
|
||||
|
||||
@@ -2671,8 +2666,9 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) {
|
||||
String exec = OS::get_singleton()->get_executable_path();
|
||||
|
||||
List<String> args;
|
||||
args.push_back ( "-path" );
|
||||
args.push_back (exec.get_base_dir() );
|
||||
//args.push_back ( "-path" );
|
||||
//args.push_back (exec.get_base_dir() );
|
||||
args.push_back("-pm");
|
||||
|
||||
OS::ProcessID pid=0;
|
||||
Error err = OS::get_singleton()->execute(exec,args,false,&pid);
|
||||
@@ -3597,26 +3593,12 @@ Error EditorNode::load_scene(const String& p_scene, bool p_ignore_broken_deps,bo
|
||||
*/
|
||||
editor_data.set_edited_scene_import_metadata( sdata->get_import_metadata() );
|
||||
|
||||
|
||||
// editor_data.get_undo_redo().clear_history();
|
||||
saved_version=editor_data.get_undo_redo().get_version();
|
||||
_update_title();
|
||||
_update_scene_tabs();
|
||||
_add_to_recent_scenes(lpath);
|
||||
|
||||
if (new_scene->has_meta("__editor_plugin_screen__")) {
|
||||
|
||||
String editor = new_scene->get_meta("__editor_plugin_screen__");
|
||||
|
||||
for(int i=0;i<editor_table.size();i++) {
|
||||
|
||||
if (editor_table[i]->get_name()==editor) {
|
||||
_editor_select(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
prev_scene->set_disabled(previous_scenes.size()==0);
|
||||
opening_prev=false;
|
||||
|
||||
@@ -4539,7 +4521,7 @@ void EditorNode::_scene_tab_closed(int p_tab) {
|
||||
}
|
||||
else {
|
||||
_remove_scene(p_tab);
|
||||
//_update_scene_tabs();
|
||||
_update_scene_tabs();
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -564,13 +564,29 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
|
||||
set("resources/save_compressed_resources",true);
|
||||
set("resources/auto_reload_modified_images",true);
|
||||
|
||||
if (p_extra_config.is_valid() && p_extra_config->has_section("init_projects") && p_extra_config->has_section_key("init_projects", "list")) {
|
||||
if (p_extra_config.is_valid()) {
|
||||
|
||||
Vector<String> list = p_extra_config->get_value("init_projects", "list");
|
||||
for (int i=0; i<list.size(); i++) {
|
||||
if (p_extra_config->has_section("init_projects") && p_extra_config->has_section_key("init_projects", "list")) {
|
||||
|
||||
String name = list[i].replace("/", "::");
|
||||
set("projects/"+name, list[i]);
|
||||
Vector<String> list = p_extra_config->get_value("init_projects", "list");
|
||||
for (int i=0; i<list.size(); i++) {
|
||||
|
||||
String name = list[i].replace("/", "::");
|
||||
set("projects/"+name, list[i]);
|
||||
};
|
||||
};
|
||||
|
||||
if (p_extra_config->has_section("presets")) {
|
||||
|
||||
List<String> keys;
|
||||
p_extra_config->get_section_keys("presets", &keys);
|
||||
|
||||
for (List<String>::Element *E=keys.front();E;E=E->next()) {
|
||||
|
||||
String key = E->get();
|
||||
Variant val = p_extra_config->get_value("presets", key);
|
||||
set(key, val);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
@@ -971,7 +971,7 @@ void ScriptEditor::_menu_option(int p_option) {
|
||||
}
|
||||
}
|
||||
|
||||
help_index->popup_centered_ratio(0.6);
|
||||
help_index->popup();
|
||||
|
||||
if (current!="") {
|
||||
help_index->call_deferred("select_class",current);
|
||||
@@ -1928,6 +1928,9 @@ void ScriptEditor::edit(const Ref<Script>& p_script) {
|
||||
ste->set_edited_script(p_script);
|
||||
ste->get_text_edit()->set_tooltip_request_func(this,"_get_debug_tooltip",ste);
|
||||
ste->get_text_edit()->set_auto_brace_completion(EditorSettings::get_singleton()->get("text_editor/auto_brace_complete"));
|
||||
ste->get_text_edit()->set_callhint_settings(
|
||||
EditorSettings::get_singleton()->get("text_editor/put_callhint_tooltip_below_current_line"),
|
||||
EditorSettings::get_singleton()->get("text_editor/callhint_tooltip_offset"));
|
||||
tab_container->add_child(ste);
|
||||
_go_to_tab(tab_container->get_tab_count()-1);
|
||||
|
||||
|
@@ -60,6 +60,8 @@ void ProjectSettings::_notification(int p_what) {
|
||||
|
||||
if (p_what==NOTIFICATION_ENTER_TREE) {
|
||||
|
||||
globals_editor->edit(Globals::get_singleton());
|
||||
|
||||
search_button->set_icon(get_icon("Zoom","EditorIcons"));
|
||||
clear_button->set_icon(get_icon("Close","EditorIcons"));
|
||||
|
||||
@@ -566,8 +568,7 @@ void ProjectSettings::popup_project_settings() {
|
||||
|
||||
//popup_centered(Size2(500,400));
|
||||
popup_centered_ratio();
|
||||
globals_editor->edit(NULL);
|
||||
globals_editor->edit(Globals::get_singleton());
|
||||
globals_editor->update_category_list();
|
||||
_update_translations();
|
||||
_update_autoload();
|
||||
}
|
||||
@@ -604,37 +605,45 @@ void ProjectSettings::_item_add() {
|
||||
case 3: value=""; break;
|
||||
}
|
||||
|
||||
String catname = category->get_text();
|
||||
String catname = category->get_text().strip_edges();
|
||||
/*if (!catname.is_valid_identifier()) {
|
||||
message->set_text("Invalid Category.\nValid characters: a-z,A-Z,0-9 or _");
|
||||
message->popup_centered(Size2(300,100));
|
||||
return;
|
||||
}*/
|
||||
|
||||
String propname = property->get_text();
|
||||
String propname = property->get_text().strip_edges();
|
||||
/*if (!propname.is_valid_identifier()) {
|
||||
message->set_text("Invalid Property.\nValid characters: a-z,A-Z,0-9 or _");
|
||||
message->popup_centered(Size2(300,100));
|
||||
return;
|
||||
}*/
|
||||
|
||||
String name = catname+"/"+propname;
|
||||
String name = catname!="" ? catname+"/"+propname : propname;
|
||||
|
||||
Globals::get_singleton()->set(name,value);
|
||||
globals_editor->edit(NULL);
|
||||
globals_editor->edit(Globals::get_singleton());
|
||||
|
||||
globals_editor->set_current_section(catname);
|
||||
globals_editor->update_category_list();
|
||||
|
||||
_settings_changed();
|
||||
}
|
||||
|
||||
void ProjectSettings::_item_del() {
|
||||
|
||||
String catname = category->get_text();
|
||||
String catname = category->get_text().strip_edges();
|
||||
//ERR_FAIL_COND(!catname.is_valid_identifier());
|
||||
String propname = property->get_text();
|
||||
String propname = property->get_text().strip_edges();
|
||||
//ERR_FAIL_COND(!propname.is_valid_identifier());
|
||||
|
||||
String name = catname+"/"+propname;
|
||||
Globals::get_singleton()->set(name,Variant());
|
||||
globals_editor->get_property_editor()->update_tree();
|
||||
String name = catname!="" ? catname+"/"+propname : propname;
|
||||
|
||||
Globals::get_singleton()->set(name,Variant());
|
||||
|
||||
globals_editor->set_current_section(catname);
|
||||
globals_editor->update_category_list();
|
||||
|
||||
_settings_changed();
|
||||
}
|
||||
|
||||
void ProjectSettings::_action_adds(String) {
|
||||
|
@@ -3840,14 +3840,34 @@ void SectionedPropertyEditor::_section_selected(int p_which) {
|
||||
filter->set_section( sections->get_item_metadata(p_which) );
|
||||
}
|
||||
|
||||
void SectionedPropertyEditor::set_current_section(const String& p_section) {
|
||||
|
||||
int section_idx = sections->find_metadata(p_section);
|
||||
|
||||
if (section_idx==sections->get_current())
|
||||
return;
|
||||
|
||||
if (section_idx!=-1) {
|
||||
sections->select(section_idx);
|
||||
_section_selected(section_idx);
|
||||
} else if (sections->get_item_count()) {
|
||||
sections->select(0);
|
||||
_section_selected(0);
|
||||
}
|
||||
}
|
||||
|
||||
String SectionedPropertyEditor::get_current_section() const {
|
||||
|
||||
return sections->get_item_metadata( sections->get_current() );
|
||||
if (sections->get_current()!=-1)
|
||||
return sections->get_item_metadata( sections->get_current() );
|
||||
else
|
||||
return "";
|
||||
}
|
||||
|
||||
String SectionedPropertyEditor::get_full_item_path(const String& p_item) {
|
||||
|
||||
String base = sections->get_item_metadata( sections->get_current() );
|
||||
String base = get_current_section();
|
||||
|
||||
if (base!="")
|
||||
return base+"/"+p_item;
|
||||
else
|
||||
@@ -3856,17 +3876,44 @@ String SectionedPropertyEditor::get_full_item_path(const String& p_item) {
|
||||
|
||||
void SectionedPropertyEditor::edit(Object* p_object) {
|
||||
|
||||
List<PropertyInfo> pinfo;
|
||||
if (p_object)
|
||||
p_object->get_property_list(&pinfo);
|
||||
if (p_object) {
|
||||
obj=p_object->get_instance_ID();
|
||||
update_category_list();
|
||||
} else {
|
||||
sections->clear();
|
||||
}
|
||||
|
||||
filter->set_edited(p_object);
|
||||
editor->edit(filter);
|
||||
|
||||
sections->select(0);
|
||||
_section_selected(0);
|
||||
|
||||
}
|
||||
|
||||
void SectionedPropertyEditor::update_category_list() {
|
||||
|
||||
String selected_category=get_current_section();
|
||||
sections->clear();
|
||||
|
||||
Object *o = ObjectDB::get_instance(obj);
|
||||
|
||||
if (!o)
|
||||
return;
|
||||
|
||||
List<PropertyInfo> pinfo;
|
||||
o->get_property_list(&pinfo);
|
||||
|
||||
Set<String> existing_sections;
|
||||
for (List<PropertyInfo>::Element *E=pinfo.front();E;E=E->next()) {
|
||||
|
||||
PropertyInfo pi=E->get();
|
||||
|
||||
if (pi.usage&PROPERTY_USAGE_CATEGORY)
|
||||
continue;
|
||||
else if ( !(pi.usage&PROPERTY_USAGE_EDITOR) )
|
||||
continue;
|
||||
|
||||
if (pi.name.find(":")!=-1 || pi.name=="script/script")
|
||||
continue;
|
||||
int sp = pi.name.find("/");
|
||||
@@ -3885,19 +3932,9 @@ void SectionedPropertyEditor::edit(Object* p_object) {
|
||||
sections->set_item_metadata(sections->get_item_count()-1,"");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
//sections->sort_items_by_text();
|
||||
|
||||
|
||||
filter->set_edited(p_object);
|
||||
editor->edit(filter);
|
||||
|
||||
sections->select(0);
|
||||
_section_selected(0);
|
||||
|
||||
set_current_section(selected_category);
|
||||
}
|
||||
|
||||
PropertyEditor *SectionedPropertyEditor::get_property_editor() {
|
||||
|
@@ -257,6 +257,9 @@ class SectionedPropertyEditor : public HBoxContainer {
|
||||
|
||||
|
||||
OBJ_TYPE(SectionedPropertyEditor,HBoxContainer);
|
||||
|
||||
ObjectID obj;
|
||||
|
||||
ItemList *sections;
|
||||
SectionedPropertyEditorFilter *filter;
|
||||
PropertyEditor *editor;
|
||||
@@ -270,8 +273,12 @@ public:
|
||||
PropertyEditor *get_property_editor();
|
||||
void edit(Object* p_object);
|
||||
String get_full_item_path(const String& p_item);
|
||||
|
||||
void set_current_section(const String& p_section);
|
||||
String get_current_section() const;
|
||||
|
||||
void update_category_list();
|
||||
|
||||
SectionedPropertyEditor();
|
||||
~SectionedPropertyEditor();
|
||||
};
|
||||
|
Before Width: | Height: | Size: 5.4 KiB |
Before Width: | Height: | Size: 7.1 KiB |
Before Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 73 KiB |
Before Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 25 KiB |
@@ -1,7 +1,5 @@
|
||||
convert -resize 32x32 ../../godot_icon.svg icon32.ico
|
||||
convert -resize 32x32 ../../godot_icon.svg icon32.icns
|
||||
for s in 16 24 32 64 96 128 256; do convert -resize ${s}x$s ../../godot_icon.svg icon$s.png; done
|
||||
convert -resize 32x32 ../../icon.svg icon32.ico
|
||||
convert -resize 32x32 ../../icon.svg icon32.icns
|
||||
for s in 16 24 32 64 96 128 256; do convert -resize ${s}x$s ../../icon.svg icon$s.png; done
|
||||
zip icons.zip icon*.png
|
||||
rm icon*.png
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 8.9 KiB |
@@ -2,7 +2,5 @@ short_name="godot"
|
||||
name="Godot Engine"
|
||||
major=2
|
||||
minor=0
|
||||
patch=1
|
||||
status="stable"
|
||||
|
||||
|
||||
|
||||
|