From f9ee42e7e6aba67728fde3eaba18fbf66753c157 Mon Sep 17 00:00:00 2001 From: Dana Olson Date: Thu, 23 Oct 2014 12:47:13 -0400 Subject: [PATCH 01/32] new default project icon --- .../icons/icon_default_project_icon.png | Bin 3621 -> 2713 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/tools/editor/icons/icon_default_project_icon.png b/tools/editor/icons/icon_default_project_icon.png index 3e991fcc291bf1ab2860b60b083f48a3bc536da7..e87a49bd289ba763bcaa1538d8aecf6138efa537 100644 GIT binary patch delta 2642 zcmZ1~GgEYe3O`$tx4R1i1A{BWnt&qd=@S*@IXT7nm8BO8xztYdRIle^^mK6yskrqv zIyPYPP02bX`**M+N!CUuSK496PF@WW5Oa%&lBef?HG%&1e5`v`TPJQ^)?Y>?`Vfa|>7N z)~xbiTIj^u9Vh*%e$q}Rk9)Vct-5*p54TD7YiqrKRJ7YcUE*lXI)mIhCg1k@GuJ=6 z`Y*|(rQciSz|<#=+Mx~VXFqQ(zq8_SOP#?I!%zJ3?CQafe!tr?D^co2J-q&Y%dC$d9>q_SRrj6L{g%DX_vZcU z6|!o%{Ao7tJUlOyW?#8k_<3{vm8X3^XT9wI)-y-!;W=_to#ljJhj9yk~wY5Q^ArUid%DitM)UrCA_Ao7k}FlW@x08u4G}#JrxnM^?%>9X&TAn^C#7*_TyyMv-Nrv^?LByiMEr72b=> z2mO*SX>#;+c=%iWz@t=!#smf5MGc2@T5hK)R_0jq)$+KVsz3JsWs!$)zN=AqNBH^r zLvPOTFeDUTlsj>{UmlFsdV8)lwq3RuW=@X-MyqlTW` zqbGFh=U;l=Z92((S@Pp&G7-Ga9*;guh^{;G{;pZxxr3{p+b5n%R2Ou(t*AdI_6_H! zr>%nTFK3JTt(MFU-~VlHz48ssIjqVO(>)x%9u$8aR-Qy?zQpqXu|3H7 zSE0>%*7dy~y!|Jsghzbeka<_1H8y+ld*fa=WnqKIg^y33J^ebY;;{q2=U?V}xi&Rl zwvsz5xU&=DvW%WYzMPQ0bp0-Y$d@_yH*dOhQ}O?Kn?wPHetZ`0(1{8v+XFz0^7L4I~1B zgP9pLG&LPvU0F9>y7}YNhrBtv%gmD=-oHKfx$wU)FE4Mn{Z@d3WyOjW4M8jCRKGJb zl+oi~_vgaKUo3mJS1UfceE)ub@N&PzOYayMN=nNfKRVjIV(r@27&YgY-*UXZPDx*? zTrSM7wz|3glewph(y8)i3=COWSr;zZq#xOJp||aqTgV$-_tH{Rh6Oe0d{VdP9kMXo zSrwiX*UZjPwtKG1p7RrK$=da5+)!E+b3VTIL$Qq3&9>yT&J07}Tc>Y7ry`$xZpa54~ z+eW#?jFYc!+{Kd77PsJMCm%yVXlQHK-lvT9-)}xwUl5`dSpGZEg{k)XrRM3vlUMBi zz&mNCXWic#N2_!5Y+rwNtY2qRx@I3+Oy;YG!=~H!hlhtRe)Yo1!g}V+mh*P@ji*j| znQXIdO?%;bWOG#cZ^0BJ$*k;b&$mBM$*x$tmUZ$;7KT56zb)SIw@);;nQuG$^L2NR ze*Am%gjf3FRjasu{`{F>G;_kq6o!Ul+mK0!PHC_In;qddE%#^(IZ9ywr4nKALEG+xZUM{BWS$kZB$Njyh zySUz-|MKGZZQVaF&7THnvD*E<^v_5B+r9k~b=wayOwc;z=J-^7b>4=MXqOXS>B*OD zTb~`@wPL>PG`Y52`}R6yB`+^v%05u?<mO|MP1vzm zvM=22La>Fxq{#JOc_(aJD(C$6yTRi^MZJk1TqnF>Np@roa=rQ4uu<87@5=#`3*Cji zQeQ;)Uhb+n^|s}%h1;n|QQ8|M-39#(JTlG79!q?Q<)5H+s_o5N<_DgiKRo_~ZoTqN zVRJ(Hg`2(#5&{|_j;tj&&nQIXa1=E^Pl^0;D^*yFl`GW4`+~*%7|BWU29FC5r^%?U zEzf*e*Hf}>!PD9HO1_i0w|O*WZWsQj9a37wm41`sNWd5u-EUF!Hruj+g8W7 z2gN?>d|ceRzjSA;jIVB%NK>2sOsM3UuTkkb?YIUMXi|&*wu3LcWmA}g&}sk+g#bNn=G4-vQ1WJ znLL}ZY#GZJ5kHqD0ds#VH^$$*W5c;R%Jh}3!$#LDa?4IH&~=gBcv{4D`? b|KmO8O0y>~VxGsqz`)??>gTe~DWM4fLXiX+ delta 3584 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 Date: Thu, 19 Mar 2015 10:31:36 +0530 Subject: [PATCH 02/32] Fix Javascript build. --- .gitignore | 3 + drivers/etc1/rg_etc1.cpp | 7 ++ platform/javascript/detect.py | 132 +++++++++++++++++----------------- 3 files changed, 78 insertions(+), 64 deletions(-) diff --git a/.gitignore b/.gitignore index 09fac62297..07af81a6c8 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,9 @@ tools/editor/editor_icons.cpp make.bat log.txt +# Javascript specific +*.bc + # Android specific platform/android/java/local.properties platform/android/java/project.properties diff --git a/drivers/etc1/rg_etc1.cpp b/drivers/etc1/rg_etc1.cpp index cad9af8830..28502191da 100644 --- a/drivers/etc1/rg_etc1.cpp +++ b/drivers/etc1/rg_etc1.cpp @@ -24,6 +24,9 @@ namespace rg_etc1 { + inline long labs(long val) { + return val < 0 ? -val : val; + } inline int intabs(int val) { @@ -1915,7 +1918,11 @@ done: int v = etc1_decode_value(diff, inten, selector, packed_c); uint err = intabs(v - color); //printf("err: %d - %u = %u\n",v,color,err); + #ifdef JAVASCRIPT_ENABLED + if (err < best_error || best_error == cUINT32_MAX) + #else if (err < best_error) + #endif { best_error = err; best_packed_c = packed_c; diff --git a/platform/javascript/detect.py b/platform/javascript/detect.py index 845b2e3395..2067e19230 100644 --- a/platform/javascript/detect.py +++ b/platform/javascript/detect.py @@ -3,91 +3,95 @@ import sys import string def is_active(): - return True - + return True + def get_name(): - return "JavaScript" + return "JavaScript" def can_build(): - import os - if (not os.environ.has_key("EMSCRIPTEN_ROOT")): - return False - return True + import os + if (not os.environ.has_key("EMSCRIPTEN_ROOT")): + return False + return True def get_opts(): - return [ - ['compress','Compress JS Executable','no'] - ] + return [ + ['compress','Compress JS Executable','no'] + ] def get_flags(): - return [ - ('lua', 'no'), - ('tools', 'no'), - ('nedmalloc', 'no'), - ('theora', 'no'), - ('tools', 'no'), - ('nedmalloc', 'no'), - ('vorbis', 'no'), - ('musepack', 'no'), - ('squirrel', 'no'), - ('squish', 'no'), - ('speex', 'no'), - ('old_scenes', 'no'), -# ('default_gui_theme', 'no'), + return [ + ('lua', 'no'), + ('tools', 'no'), + ('nedmalloc', 'no'), + ('theora', 'no'), + ('tools', 'no'), + ('nedmalloc', 'no'), + ('vorbis', 'no'), + ('musepack', 'no'), + ('squirrel', 'no'), + ('squish', 'no'), + ('speex', 'no'), + ('old_scenes', 'no'), +# ('default_gui_theme', 'no'), - #('builtin_zlib', 'no'), - ] + #('builtin_zlib', 'no'), + ] def configure(env): + env.Append(CPPPATH=['#platform/javascript']) + em_path=os.environ["EMSCRIPTEN_ROOT"] - env.Append(CPPPATH=['#platform/javascript']) - - em_path=os.environ["EMSCRIPTEN_ROOT"] - - env['ENV']['PATH'] = em_path+":"+env['ENV']['PATH'] + env['ENV']['PATH'] = em_path+":"+env['ENV']['PATH'] - env['CC'] = em_path+'/emcc' - env['CXX'] = em_path+'/emcc' - env['AR'] = em_path+"/emar" - env['RANLIB'] = em_path+"/emranlib" + env['CC'] = em_path+'/emcc' + env['CXX'] = em_path+'/emcc' + #env['AR'] = em_path+"/emar" + env['AR'] = em_path+"/emcc" + env['ARFLAGS'] = "-o" -# env.Append(LIBS=['c','m','stdc++','log','GLESv1_CM','GLESv2']) +# env['RANLIB'] = em_path+"/emranlib" + env['RANLIB'] = em_path + "/emcc" + env['OBJSUFFIX'] = '.bc' + env['LIBSUFFIX'] = '.bc' + env['CCCOM'] = "$CC -o $TARGET $CFLAGS $CCFLAGS $_CCCOMCOM $SOURCES" + env['CXXCOM'] = "$CC -o $TARGET $CFLAGS $CCFLAGS $_CCCOMCOM $SOURCES" -# env["LINKFLAGS"]= string.split(" -g --sysroot="+ld_sysroot+" -Wl,--no-undefined -Wl,-z,noexecstack ") +# env.Append(LIBS=['c','m','stdc++','log','GLESv1_CM','GLESv2']) - if (env["target"]=="release"): +# env["LINKFLAGS"]= string.split(" -g --sysroot="+ld_sysroot+" -Wl,--no-undefined -Wl,-z,noexecstack ") - env.Append(CCFLAGS=['-O2']) - - elif (env["target"]=="release_debug"): - - env.Append(CCFLAGS=['-O2','-DDEBUG_ENABLED']) - - elif (env["target"]=="debug"): - env.Append(CCFLAGS=['-D_DEBUG', '-Wall', '-O2', '-DDEBUG_ENABLED']) - env.Append(CPPFLAGS=['-DDEBUG_MEMORY_ALLOC']) - - env.Append(CPPFLAGS=["-fno-exceptions",'-DNO_SAFE_CAST','-fno-rtti']) - env.Append(CPPFLAGS=['-DJAVASCRIPT_ENABLED', '-DUNIX_ENABLED', '-DNO_FCNTL','-DMPC_FIXED_POINT','-DTYPED_METHOD_BIND','-DNO_THREADS']) - env.Append(CPPFLAGS=['-DGLES2_ENABLED']) - env.Append(CPPFLAGS=['-DGLES_NO_CLIENT_ARRAYS']) - env.Append(CPPFLAGS=['-s','ASM_JS=1']) - env.Append(CPPFLAGS=['-s','FULL_ES2=1']) -# env.Append(CPPFLAGS=['-DANDROID_ENABLED', '-DUNIX_ENABLED','-DMPC_FIXED_POINT']) - if (env["compress"]=="yes"): - lzma_binpath = em_path+"/third_party/lzma.js/lzma-native" - lzma_decoder = em_path+"/third_party/lzma.js/lzma-decoder.js" - lzma_dec = "LZMA.decompress" - - env.Append(LINKFLAGS=['--compression',lzma_binpath+","+lzma_decoder+","+lzma_dec]) - - env.Append(LINKFLAGS=['-s','ASM_JS=1']) - env.Append(LINKFLAGS=['-O2']) + if (env["target"]=="release"): + env.Append(CCFLAGS=['-O2']) + elif (env["target"]=="release_debug"): + env.Append(CCFLAGS=['-O2','-DDEBUG_ENABLED']) + elif (env["target"]=="debug"): + env.Append(CCFLAGS=['-D_DEBUG', '-Wall', '-O2', '-DDEBUG_ENABLED']) + #env.Append(CCFLAGS=['-D_DEBUG', '-Wall', '-g4', '-DDEBUG_ENABLED']) + env.Append(CPPFLAGS=['-DDEBUG_MEMORY_ALLOC']) + env.Append(CPPFLAGS=["-fno-exceptions",'-DNO_SAFE_CAST','-fno-rtti']) + env.Append(CPPFLAGS=['-DJAVASCRIPT_ENABLED', '-DUNIX_ENABLED', '-DNO_FCNTL','-DMPC_FIXED_POINT','-DTYPED_METHOD_BIND','-DNO_THREADS']) + env.Append(CPPFLAGS=['-DGLES2_ENABLED']) + env.Append(CPPFLAGS=['-DGLES_NO_CLIENT_ARRAYS']) + env.Append(CPPFLAGS=['-s','ASM_JS=1']) + env.Append(CPPFLAGS=['-s','FULL_ES2=1']) +# env.Append(CPPFLAGS=['-DANDROID_ENABLED', '-DUNIX_ENABLED','-DMPC_FIXED_POINT']) + if (env["compress"]=="yes"): + lzma_binpath = em_path+"/third_party/lzma.js/lzma-native" + lzma_decoder = em_path+"/third_party/lzma.js/lzma-decoder.js" + lzma_dec = "LZMA.decompress" + env.Append(LINKFLAGS=['--compression',lzma_binpath+","+lzma_decoder+","+lzma_dec]) + env.Append(LINKFLAGS=['-s','ASM_JS=1']) + env.Append(LINKFLAGS=['-O2']) + #env.Append(LINKFLAGS=['-g4']) + + #print "CCCOM is:", env.subst('$CCCOM') + #print "P: ", env['p'], " Platofrm: ", env['platform'] From 743b3157bc4912ec98aae21f0b864ee738c09105 Mon Sep 17 00:00:00 2001 From: "V.VamsiKrishna" Date: Thu, 19 Mar 2015 10:35:24 +0530 Subject: [PATCH 03/32] Fix for newer gcc. Picked from GoogleCode --- drivers/etc1/rg_etc1.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/etc1/rg_etc1.cpp b/drivers/etc1/rg_etc1.cpp index 28502191da..7eb1427d7a 100644 --- a/drivers/etc1/rg_etc1.cpp +++ b/drivers/etc1/rg_etc1.cpp @@ -1916,7 +1916,7 @@ done: for (uint packed_c = 0; packed_c < limit; packed_c++) { int v = etc1_decode_value(diff, inten, selector, packed_c); - uint err = intabs(v - color); + uint err = labs(v - static_cast(color)); //printf("err: %d - %u = %u\n",v,color,err); #ifdef JAVASCRIPT_ENABLED if (err < best_error || best_error == cUINT32_MAX) From 72895ddecf01e3559014669937df6c0b0adcca5f Mon Sep 17 00:00:00 2001 From: "V.VamsiKrishna" Date: Fri, 20 Mar 2015 07:47:06 +0530 Subject: [PATCH 04/32] Replacing spaces with tabs --- platform/javascript/detect.py | 136 +++++++++++++++++----------------- 1 file changed, 68 insertions(+), 68 deletions(-) diff --git a/platform/javascript/detect.py b/platform/javascript/detect.py index 2067e19230..3123367ff0 100644 --- a/platform/javascript/detect.py +++ b/platform/javascript/detect.py @@ -3,95 +3,95 @@ import sys import string def is_active(): - return True - + return True + def get_name(): - return "JavaScript" + return "JavaScript" def can_build(): - import os - if (not os.environ.has_key("EMSCRIPTEN_ROOT")): - return False - return True + import os + if (not os.environ.has_key("EMSCRIPTEN_ROOT")): + return False + return True def get_opts(): - return [ - ['compress','Compress JS Executable','no'] - ] + return [ + ['compress','Compress JS Executable','no'] + ] def get_flags(): - return [ - ('lua', 'no'), - ('tools', 'no'), - ('nedmalloc', 'no'), - ('theora', 'no'), - ('tools', 'no'), - ('nedmalloc', 'no'), - ('vorbis', 'no'), - ('musepack', 'no'), - ('squirrel', 'no'), - ('squish', 'no'), - ('speex', 'no'), - ('old_scenes', 'no'), -# ('default_gui_theme', 'no'), + return [ + ('lua', 'no'), + ('tools', 'no'), + ('nedmalloc', 'no'), + ('theora', 'no'), + ('tools', 'no'), + ('nedmalloc', 'no'), + ('vorbis', 'no'), + ('musepack', 'no'), + ('squirrel', 'no'), + ('squish', 'no'), + ('speex', 'no'), + ('old_scenes', 'no'), +# ('default_gui_theme', 'no'), - #('builtin_zlib', 'no'), - ] + #('builtin_zlib', 'no'), + ] def configure(env): - env.Append(CPPPATH=['#platform/javascript']) + env.Append(CPPPATH=['#platform/javascript']) - em_path=os.environ["EMSCRIPTEN_ROOT"] + em_path=os.environ["EMSCRIPTEN_ROOT"] - env['ENV']['PATH'] = em_path+":"+env['ENV']['PATH'] + env['ENV']['PATH'] = em_path+":"+env['ENV']['PATH'] - env['CC'] = em_path+'/emcc' - env['CXX'] = em_path+'/emcc' - #env['AR'] = em_path+"/emar" - env['AR'] = em_path+"/emcc" - env['ARFLAGS'] = "-o" + env['CC'] = em_path+'/emcc' + env['CXX'] = em_path+'/emcc' + #env['AR'] = em_path+"/emar" + env['AR'] = em_path+"/emcc" + env['ARFLAGS'] = "-o" -# env['RANLIB'] = em_path+"/emranlib" - env['RANLIB'] = em_path + "/emcc" - env['OBJSUFFIX'] = '.bc' - env['LIBSUFFIX'] = '.bc' - env['CCCOM'] = "$CC -o $TARGET $CFLAGS $CCFLAGS $_CCCOMCOM $SOURCES" - env['CXXCOM'] = "$CC -o $TARGET $CFLAGS $CCFLAGS $_CCCOMCOM $SOURCES" +# env['RANLIB'] = em_path+"/emranlib" + env['RANLIB'] = em_path + "/emcc" + env['OBJSUFFIX'] = '.bc' + env['LIBSUFFIX'] = '.bc' + env['CCCOM'] = "$CC -o $TARGET $CFLAGS $CCFLAGS $_CCCOMCOM $SOURCES" + env['CXXCOM'] = "$CC -o $TARGET $CFLAGS $CCFLAGS $_CCCOMCOM $SOURCES" -# env.Append(LIBS=['c','m','stdc++','log','GLESv1_CM','GLESv2']) +# env.Append(LIBS=['c','m','stdc++','log','GLESv1_CM','GLESv2']) -# env["LINKFLAGS"]= string.split(" -g --sysroot="+ld_sysroot+" -Wl,--no-undefined -Wl,-z,noexecstack ") +# env["LINKFLAGS"]= string.split(" -g --sysroot="+ld_sysroot+" -Wl,--no-undefined -Wl,-z,noexecstack ") - if (env["target"]=="release"): - env.Append(CCFLAGS=['-O2']) - elif (env["target"]=="release_debug"): - env.Append(CCFLAGS=['-O2','-DDEBUG_ENABLED']) - elif (env["target"]=="debug"): - env.Append(CCFLAGS=['-D_DEBUG', '-Wall', '-O2', '-DDEBUG_ENABLED']) - #env.Append(CCFLAGS=['-D_DEBUG', '-Wall', '-g4', '-DDEBUG_ENABLED']) - env.Append(CPPFLAGS=['-DDEBUG_MEMORY_ALLOC']) + if (env["target"]=="release"): + env.Append(CCFLAGS=['-O2']) + elif (env["target"]=="release_debug"): + env.Append(CCFLAGS=['-O2','-DDEBUG_ENABLED']) + elif (env["target"]=="debug"): + env.Append(CCFLAGS=['-D_DEBUG', '-Wall', '-O2', '-DDEBUG_ENABLED']) + #env.Append(CCFLAGS=['-D_DEBUG', '-Wall', '-g4', '-DDEBUG_ENABLED']) + env.Append(CPPFLAGS=['-DDEBUG_MEMORY_ALLOC']) - env.Append(CPPFLAGS=["-fno-exceptions",'-DNO_SAFE_CAST','-fno-rtti']) - env.Append(CPPFLAGS=['-DJAVASCRIPT_ENABLED', '-DUNIX_ENABLED', '-DNO_FCNTL','-DMPC_FIXED_POINT','-DTYPED_METHOD_BIND','-DNO_THREADS']) - env.Append(CPPFLAGS=['-DGLES2_ENABLED']) - env.Append(CPPFLAGS=['-DGLES_NO_CLIENT_ARRAYS']) - env.Append(CPPFLAGS=['-s','ASM_JS=1']) - env.Append(CPPFLAGS=['-s','FULL_ES2=1']) -# env.Append(CPPFLAGS=['-DANDROID_ENABLED', '-DUNIX_ENABLED','-DMPC_FIXED_POINT']) - if (env["compress"]=="yes"): - lzma_binpath = em_path+"/third_party/lzma.js/lzma-native" - lzma_decoder = em_path+"/third_party/lzma.js/lzma-decoder.js" - lzma_dec = "LZMA.decompress" - env.Append(LINKFLAGS=['--compression',lzma_binpath+","+lzma_decoder+","+lzma_dec]) + env.Append(CPPFLAGS=["-fno-exceptions",'-DNO_SAFE_CAST','-fno-rtti']) + env.Append(CPPFLAGS=['-DJAVASCRIPT_ENABLED', '-DUNIX_ENABLED', '-DNO_FCNTL','-DMPC_FIXED_POINT','-DTYPED_METHOD_BIND','-DNO_THREADS']) + env.Append(CPPFLAGS=['-DGLES2_ENABLED']) + env.Append(CPPFLAGS=['-DGLES_NO_CLIENT_ARRAYS']) + env.Append(CPPFLAGS=['-s','ASM_JS=1']) + env.Append(CPPFLAGS=['-s','FULL_ES2=1']) +# env.Append(CPPFLAGS=['-DANDROID_ENABLED', '-DUNIX_ENABLED','-DMPC_FIXED_POINT']) + if (env["compress"]=="yes"): + lzma_binpath = em_path+"/third_party/lzma.js/lzma-native" + lzma_decoder = em_path+"/third_party/lzma.js/lzma-decoder.js" + lzma_dec = "LZMA.decompress" + env.Append(LINKFLAGS=['--compression',lzma_binpath+","+lzma_decoder+","+lzma_dec]) - env.Append(LINKFLAGS=['-s','ASM_JS=1']) - env.Append(LINKFLAGS=['-O2']) - #env.Append(LINKFLAGS=['-g4']) - - #print "CCCOM is:", env.subst('$CCCOM') - #print "P: ", env['p'], " Platofrm: ", env['platform'] + env.Append(LINKFLAGS=['-s','ASM_JS=1']) + env.Append(LINKFLAGS=['-O2']) + #env.Append(LINKFLAGS=['-g4']) + + #print "CCCOM is:", env.subst('$CCCOM') + #print "P: ", env['p'], " Platofrm: ", env['platform'] From 41b729ccff74e5a9154bee7db0d36ffd74641eae Mon Sep 17 00:00:00 2001 From: "V.VamsiKrishna" Date: Fri, 20 Mar 2015 10:18:13 +0530 Subject: [PATCH 05/32] Removing etc1 from build for javascript platform. Based on inputs from reduz 1) Made etc1 optional driver and default yes. 2) Reverted the hack in rg_etc1.cpp 3) Disabled etc1 for javascript plaform. --- SConstruct | 1 + drivers/etc1/rg_etc1.cpp | 4 ---- platform/javascript/detect.py | 1 + 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/SConstruct b/SConstruct index 2dc9fa1e70..50acd3884d 100644 --- a/SConstruct +++ b/SConstruct @@ -111,6 +111,7 @@ opts.Add('jpg','JPG Image loader support (yes/no)','yes') opts.Add('webp','WEBP Image loader support (yes/no)','yes') opts.Add('dds','DDS Texture loader support (yes/no)','yes') opts.Add('pvr','PVR (PowerVR) Texture loader support (yes/no)','yes') +opts.Add('etc1','etc1 Texture compression support (yes/no)','yes') opts.Add('builtin_zlib','Use built-in zlib (yes/no)','yes') opts.Add('openssl','Use OpenSSL (yes/no/builtin)','no') opts.Add('musepack','Musepack Audio (yes/no)','yes') diff --git a/drivers/etc1/rg_etc1.cpp b/drivers/etc1/rg_etc1.cpp index 7eb1427d7a..d2959da386 100644 --- a/drivers/etc1/rg_etc1.cpp +++ b/drivers/etc1/rg_etc1.cpp @@ -1918,11 +1918,7 @@ done: int v = etc1_decode_value(diff, inten, selector, packed_c); uint err = labs(v - static_cast(color)); //printf("err: %d - %u = %u\n",v,color,err); - #ifdef JAVASCRIPT_ENABLED - if (err < best_error || best_error == cUINT32_MAX) - #else if (err < best_error) - #endif { best_error = err; best_packed_c = packed_c; diff --git a/platform/javascript/detect.py b/platform/javascript/detect.py index 3123367ff0..947a637fb9 100644 --- a/platform/javascript/detect.py +++ b/platform/javascript/detect.py @@ -36,6 +36,7 @@ def get_flags(): ('squish', 'no'), ('speex', 'no'), ('old_scenes', 'no'), + ('etc1', 'no'), # ('default_gui_theme', 'no'), #('builtin_zlib', 'no'), From d3280f91a13da6c106f95c289c095714c638d201 Mon Sep 17 00:00:00 2001 From: "V.VamsiKrishna" Date: Fri, 20 Mar 2015 11:06:28 +0530 Subject: [PATCH 06/32] Missed some things in prev commit. --- SConstruct | 2 ++ drivers/etc1/SCsub | 3 ++- drivers/register_driver_types.cpp | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/SConstruct b/SConstruct index 50acd3884d..42c803e81e 100644 --- a/SConstruct +++ b/SConstruct @@ -308,6 +308,8 @@ if selected_platform in platform_list: if (env['colored']=='yes'): methods.colored(sys,env) + if (env['etc1']=='yes'): + env.Append(CPPFLAGS=['-DETC1_ENABLED']) Export('env') diff --git a/drivers/etc1/SCsub b/drivers/etc1/SCsub index 152dc3f4d0..251c3ffb86 100644 --- a/drivers/etc1/SCsub +++ b/drivers/etc1/SCsub @@ -6,7 +6,8 @@ etc_sources = [ "etc1/rg_etc1.cpp" ] -env.drivers_sources+=etc_sources +if (env["etc1"] != "no"): + env.drivers_sources+=etc_sources #env.add_source_files(env.drivers_sources, etc_sources) diff --git a/drivers/register_driver_types.cpp b/drivers/register_driver_types.cpp index e4bb1a343a..e730171fbb 100644 --- a/drivers/register_driver_types.cpp +++ b/drivers/register_driver_types.cpp @@ -222,7 +222,10 @@ void register_driver_types() { #endif #endif +#ifdef ETC1_ENABLED _register_etc1_compress_func(); +#endif + initialize_chibi(); } From 9965e93f7eb7297490de597cc8ed8e18b4ba2872 Mon Sep 17 00:00:00 2001 From: "V.VamsiKrishna" Date: Fri, 20 Mar 2015 11:12:13 +0530 Subject: [PATCH 07/32] Revert "Removing etc1 from build for javascript platform." This reverts commit 41b729ccff74e5a9154bee7db0d36ffd74641eae. --- SConstruct | 1 - drivers/etc1/rg_etc1.cpp | 4 ++++ platform/javascript/detect.py | 1 - 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/SConstruct b/SConstruct index 42c803e81e..cb32c0b5ff 100644 --- a/SConstruct +++ b/SConstruct @@ -111,7 +111,6 @@ opts.Add('jpg','JPG Image loader support (yes/no)','yes') opts.Add('webp','WEBP Image loader support (yes/no)','yes') opts.Add('dds','DDS Texture loader support (yes/no)','yes') opts.Add('pvr','PVR (PowerVR) Texture loader support (yes/no)','yes') -opts.Add('etc1','etc1 Texture compression support (yes/no)','yes') opts.Add('builtin_zlib','Use built-in zlib (yes/no)','yes') opts.Add('openssl','Use OpenSSL (yes/no/builtin)','no') opts.Add('musepack','Musepack Audio (yes/no)','yes') diff --git a/drivers/etc1/rg_etc1.cpp b/drivers/etc1/rg_etc1.cpp index d2959da386..7eb1427d7a 100644 --- a/drivers/etc1/rg_etc1.cpp +++ b/drivers/etc1/rg_etc1.cpp @@ -1918,7 +1918,11 @@ done: int v = etc1_decode_value(diff, inten, selector, packed_c); uint err = labs(v - static_cast(color)); //printf("err: %d - %u = %u\n",v,color,err); + #ifdef JAVASCRIPT_ENABLED + if (err < best_error || best_error == cUINT32_MAX) + #else if (err < best_error) + #endif { best_error = err; best_packed_c = packed_c; diff --git a/platform/javascript/detect.py b/platform/javascript/detect.py index 947a637fb9..3123367ff0 100644 --- a/platform/javascript/detect.py +++ b/platform/javascript/detect.py @@ -36,7 +36,6 @@ def get_flags(): ('squish', 'no'), ('speex', 'no'), ('old_scenes', 'no'), - ('etc1', 'no'), # ('default_gui_theme', 'no'), #('builtin_zlib', 'no'), From 2e59788aa9be6dab49e06588fcb1cf812e55a0cf Mon Sep 17 00:00:00 2001 From: "V.VamsiKrishna" Date: Fri, 20 Mar 2015 11:12:59 +0530 Subject: [PATCH 08/32] Revert "Missed some things in prev commit." This reverts commit d3280f91a13da6c106f95c289c095714c638d201. --- SConstruct | 2 -- drivers/etc1/SCsub | 3 +-- drivers/register_driver_types.cpp | 3 --- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/SConstruct b/SConstruct index cb32c0b5ff..2dc9fa1e70 100644 --- a/SConstruct +++ b/SConstruct @@ -307,8 +307,6 @@ if selected_platform in platform_list: if (env['colored']=='yes'): methods.colored(sys,env) - if (env['etc1']=='yes'): - env.Append(CPPFLAGS=['-DETC1_ENABLED']) Export('env') diff --git a/drivers/etc1/SCsub b/drivers/etc1/SCsub index 251c3ffb86..152dc3f4d0 100644 --- a/drivers/etc1/SCsub +++ b/drivers/etc1/SCsub @@ -6,8 +6,7 @@ etc_sources = [ "etc1/rg_etc1.cpp" ] -if (env["etc1"] != "no"): - env.drivers_sources+=etc_sources +env.drivers_sources+=etc_sources #env.add_source_files(env.drivers_sources, etc_sources) diff --git a/drivers/register_driver_types.cpp b/drivers/register_driver_types.cpp index e730171fbb..e4bb1a343a 100644 --- a/drivers/register_driver_types.cpp +++ b/drivers/register_driver_types.cpp @@ -222,10 +222,7 @@ void register_driver_types() { #endif #endif -#ifdef ETC1_ENABLED _register_etc1_compress_func(); -#endif - initialize_chibi(); } From eb3c88b3ddbe27826f634912b048589dff435847 Mon Sep 17 00:00:00 2001 From: "V.VamsiKrishna" Date: Fri, 20 Mar 2015 11:47:56 +0530 Subject: [PATCH 09/32] Revert "Revert "Removing etc1 from build for javascript platform."" This reverts commit 9965e93f7eb7297490de597cc8ed8e18b4ba2872. --- SConstruct | 1 + drivers/etc1/rg_etc1.cpp | 4 ---- platform/javascript/detect.py | 1 + 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/SConstruct b/SConstruct index 2dc9fa1e70..50acd3884d 100644 --- a/SConstruct +++ b/SConstruct @@ -111,6 +111,7 @@ opts.Add('jpg','JPG Image loader support (yes/no)','yes') opts.Add('webp','WEBP Image loader support (yes/no)','yes') opts.Add('dds','DDS Texture loader support (yes/no)','yes') opts.Add('pvr','PVR (PowerVR) Texture loader support (yes/no)','yes') +opts.Add('etc1','etc1 Texture compression support (yes/no)','yes') opts.Add('builtin_zlib','Use built-in zlib (yes/no)','yes') opts.Add('openssl','Use OpenSSL (yes/no/builtin)','no') opts.Add('musepack','Musepack Audio (yes/no)','yes') diff --git a/drivers/etc1/rg_etc1.cpp b/drivers/etc1/rg_etc1.cpp index 7eb1427d7a..d2959da386 100644 --- a/drivers/etc1/rg_etc1.cpp +++ b/drivers/etc1/rg_etc1.cpp @@ -1918,11 +1918,7 @@ done: int v = etc1_decode_value(diff, inten, selector, packed_c); uint err = labs(v - static_cast(color)); //printf("err: %d - %u = %u\n",v,color,err); - #ifdef JAVASCRIPT_ENABLED - if (err < best_error || best_error == cUINT32_MAX) - #else if (err < best_error) - #endif { best_error = err; best_packed_c = packed_c; diff --git a/platform/javascript/detect.py b/platform/javascript/detect.py index 3123367ff0..947a637fb9 100644 --- a/platform/javascript/detect.py +++ b/platform/javascript/detect.py @@ -36,6 +36,7 @@ def get_flags(): ('squish', 'no'), ('speex', 'no'), ('old_scenes', 'no'), + ('etc1', 'no'), # ('default_gui_theme', 'no'), #('builtin_zlib', 'no'), From beab10ab9b18c8081ad85d2a59ce23e943f835b0 Mon Sep 17 00:00:00 2001 From: "V.VamsiKrishna" Date: Fri, 20 Mar 2015 11:48:21 +0530 Subject: [PATCH 10/32] Revert "Revert "Missed some things in prev commit."" This reverts commit 2e59788aa9be6dab49e06588fcb1cf812e55a0cf. --- SConstruct | 2 ++ drivers/etc1/SCsub | 3 ++- drivers/register_driver_types.cpp | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/SConstruct b/SConstruct index 50acd3884d..42c803e81e 100644 --- a/SConstruct +++ b/SConstruct @@ -308,6 +308,8 @@ if selected_platform in platform_list: if (env['colored']=='yes'): methods.colored(sys,env) + if (env['etc1']=='yes'): + env.Append(CPPFLAGS=['-DETC1_ENABLED']) Export('env') diff --git a/drivers/etc1/SCsub b/drivers/etc1/SCsub index 152dc3f4d0..251c3ffb86 100644 --- a/drivers/etc1/SCsub +++ b/drivers/etc1/SCsub @@ -6,7 +6,8 @@ etc_sources = [ "etc1/rg_etc1.cpp" ] -env.drivers_sources+=etc_sources +if (env["etc1"] != "no"): + env.drivers_sources+=etc_sources #env.add_source_files(env.drivers_sources, etc_sources) diff --git a/drivers/register_driver_types.cpp b/drivers/register_driver_types.cpp index e4bb1a343a..e730171fbb 100644 --- a/drivers/register_driver_types.cpp +++ b/drivers/register_driver_types.cpp @@ -222,7 +222,10 @@ void register_driver_types() { #endif #endif +#ifdef ETC1_ENABLED _register_etc1_compress_func(); +#endif + initialize_chibi(); } From 372fa5277c43d152ab75d7e15d2e0a59fd79fd3c Mon Sep 17 00:00:00 2001 From: "V.VamsiKrishna" Date: Sat, 21 Mar 2015 10:12:25 +0530 Subject: [PATCH 11/32] Fix for canvas_draw_polygon on webgl. --- drivers/gles2/rasterizer_gles2.cpp | 112 +++++++++++++++++++++++++---- drivers/gles2/rasterizer_gles2.h | 3 + 2 files changed, 101 insertions(+), 14 deletions(-) diff --git a/drivers/gles2/rasterizer_gles2.cpp b/drivers/gles2/rasterizer_gles2.cpp index a21b0775e9..0774b03190 100644 --- a/drivers/gles2/rasterizer_gles2.cpp +++ b/drivers/gles2/rasterizer_gles2.cpp @@ -91,6 +91,10 @@ static RasterizerGLES2* _singleton = NULL; +#ifdef GLES_NO_CLIENT_ARRAYS +static float GlobalVertexBuffer[MAX_POLYGON_VERTICES * 8] = {0}; +#endif + static const GLenum prim_type[]={GL_POINTS,GL_LINES,GL_TRIANGLES,GL_TRIANGLE_FAN}; _FORCE_INLINE_ static void _set_color_attrib(const Color& p_color) { @@ -8337,20 +8341,22 @@ void RasterizerGLES2::canvas_draw_primitive(const Vector& p_points, cons void RasterizerGLES2::canvas_draw_polygon(int p_vertex_count, const int* p_indices, const Vector2* p_vertices, const Vector2* p_uvs, const Color* p_colors,const RID& p_texture,bool p_singlecolor) { - bool do_colors=false; + bool do_colors=false; + Color m; + if (p_singlecolor) { + m = *p_colors; + m.a*=canvas_opacity; + _set_color_attrib(m); + } else if (!p_colors) { + m = Color(1, 1, 1, canvas_opacity); + _set_color_attrib(m); + } else + do_colors=true; - if (p_singlecolor) { - Color m = *p_colors; - m.a*=canvas_opacity; - _set_color_attrib(m); - } else if (!p_colors) { - _set_color_attrib( Color(1,1,1,canvas_opacity)); - } else - do_colors=true; + Texture *texture = _bind_canvas_texture(p_texture); - Texture *texture = _bind_canvas_texture(p_texture); - - glEnableVertexAttribArray(VS::ARRAY_VERTEX); +#ifndef GLES_NO_CLIENT_ARRAYS + glEnableVertexAttribArray(VS::ARRAY_VERTEX); glVertexAttribPointer( VS::ARRAY_VERTEX, 2 ,GL_FLOAT, false, sizeof(Vector2), p_vertices ); if (do_colors) { @@ -8380,11 +8386,78 @@ void RasterizerGLES2::canvas_draw_polygon(int p_vertex_count, const int* p_indic }; glDrawElements(GL_TRIANGLES, p_vertex_count, GL_UNSIGNED_SHORT, _draw_poly_indices ); #endif - //glDrawElements(GL_TRIANGLES, p_vertex_count, GL_UNSIGNED_INT, p_indices ); } else { glDrawArrays(GL_TRIANGLES,0,p_vertex_count); } + +#else //WebGL specific impl. + glBindBuffer(GL_ARRAY_BUFFER, gui_quad_buffer); + float *b = GlobalVertexBuffer; + int ofs = 0; + if(p_vertex_count > MAX_POLYGON_VERTICES){ + print_line("Too many vertices to render"); + return; + } + glEnableVertexAttribArray(VS::ARRAY_VERTEX); + glVertexAttribPointer( VS::ARRAY_VERTEX, 2 ,GL_FLOAT, false, sizeof(float)*2, ((float*)0)+ofs ); + for(int i=0;i _max_draw_poly_indices); + static uint16_t _draw_poly_indices[_max_draw_poly_indices]; + for (int i=0; iprint("ind: %d ", p_indices[i]); + }; + + //copy the data to GPU. + glBufferSubData(GL_ELEMENT_ARRAY_BUFFER, 0, p_vertex_count * sizeof(uint16_t), &_draw_poly_indices[0]); + + //draw the triangles. + glDrawElements(GL_TRIANGLES, p_vertex_count, GL_UNSIGNED_SHORT, 0); + + glBindBuffer(GL_ARRAY_BUFFER, 0); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); +#endif + _rinfo.ci_draw_commands++; }; @@ -10579,10 +10652,21 @@ void RasterizerGLES2::init() { glGenBuffers(1,&gui_quad_buffer); glBindBuffer(GL_ARRAY_BUFFER,gui_quad_buffer); - glBufferData(GL_ARRAY_BUFFER,128,NULL,GL_DYNAMIC_DRAW); +#ifdef GLES_NO_CLIENT_ARRAYS //WebGL specific implementation. + glBufferData(GL_ARRAY_BUFFER, 8 * MAX_POLYGON_VERTICES,NULL,GL_DYNAMIC_DRAW); +#else + glBufferData(GL_ARRAY_BUFFER,128,NULL,GL_DYNAMIC_DRAW); +#endif glBindBuffer(GL_ARRAY_BUFFER,0); //unbind +#ifdef GLES_NO_CLIENT_ARRAYS //webgl indices buffer + glGenBuffers(1, &indices_buffer); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, indices_buffer); + glBufferData(GL_ELEMENT_ARRAY_BUFFER, 16*1024, NULL, GL_DYNAMIC_DRAW); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);// unbind +#endif + using_canvas_bg=false; _update_framebuffer(); DEBUG_TEST_ERROR("Initializing"); diff --git a/drivers/gles2/rasterizer_gles2.h b/drivers/gles2/rasterizer_gles2.h index b7895ad82e..f59260ace6 100644 --- a/drivers/gles2/rasterizer_gles2.h +++ b/drivers/gles2/rasterizer_gles2.h @@ -31,6 +31,8 @@ #include "servers/visual/rasterizer.h" +#define MAX_POLYGON_VERTICES 4096 //used for WebGL canvas_draw_polygon call. + #ifdef GLES2_ENABLED #include "image.h" @@ -828,6 +830,7 @@ class RasterizerGLES2 : public Rasterizer { GLuint base_framebuffer; GLuint gui_quad_buffer; + GLuint indices_buffer; From 4fa71a6ee0ea72289d9e647eb0aeea59cf8a7192 Mon Sep 17 00:00:00 2001 From: "V.VamsiKrishna" Date: Sat, 21 Mar 2015 22:25:48 +0530 Subject: [PATCH 12/32] Removing Print statement effects perf. --- drivers/gles2/rasterizer_gles2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gles2/rasterizer_gles2.cpp b/drivers/gles2/rasterizer_gles2.cpp index 0774b03190..22aecec0b7 100644 --- a/drivers/gles2/rasterizer_gles2.cpp +++ b/drivers/gles2/rasterizer_gles2.cpp @@ -8445,7 +8445,7 @@ void RasterizerGLES2::canvas_draw_polygon(int p_vertex_count, const int* p_indic static uint16_t _draw_poly_indices[_max_draw_poly_indices]; for (int i=0; iprint("ind: %d ", p_indices[i]); + //OS::get_singleton()->print("ind: %d ", p_indices[i]); }; //copy the data to GPU. From 21eb3b2a83fd59f6d667688c95b4a198b3b6f689 Mon Sep 17 00:00:00 2001 From: Nathan Warden Date: Mon, 23 Mar 2015 00:08:07 -0500 Subject: [PATCH 13/32] Camel casing being capitalized only happens in the inspector now. --- core/ustring.cpp | 21 +++++++++++++++++++++ core/ustring.h | 1 + tools/editor/property_editor.cpp | 2 +- 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/core/ustring.cpp b/core/ustring.cpp index 09d3d95b68..edb5da2bd2 100644 --- a/core/ustring.cpp +++ b/core/ustring.cpp @@ -498,6 +498,27 @@ String String::capitalize() const { return cap; } + +String String::camelcase_to_underscore() const { + const CharType * cstr = c_str(); + String newString; + const char A = 'A', Z = 'Z'; + int startIndex = 0; + + for ( int i = 1; i < this->size()-1; i++ ) { + bool isCapital = cstr[i] >= A && cstr[i] <= Z; + + if ( isCapital ) { + newString += "_" + this->substr(startIndex, i-startIndex); + startIndex = i; + } + } + + newString += "_" + this->substr(startIndex, this->size()-startIndex); + + return newString; +} + int String::get_slice_count(String p_splitter) const{ if (empty()) diff --git a/core/ustring.h b/core/ustring.h index d4b854ea76..f9f47d69c9 100644 --- a/core/ustring.h +++ b/core/ustring.h @@ -149,6 +149,7 @@ public: static double to_double(const CharType* p_str, const CharType **r_end=NULL); static int64_t to_int(const CharType* p_str,int p_len=-1); String capitalize() const; + String camelcase_to_underscore() const; int get_slice_count(String p_splitter) const; String get_slice(String p_splitter,int p_slice) const; diff --git a/tools/editor/property_editor.cpp b/tools/editor/property_editor.cpp index 078a177ca1..3fd713c5b0 100644 --- a/tools/editor/property_editor.cpp +++ b/tools/editor/property_editor.cpp @@ -2258,7 +2258,7 @@ void PropertyEditor::update_tree() { } if (capitalize_paths) - item->set_text( 0, name.capitalize() ); + item->set_text( 0, name.camelcase_to_underscore().capitalize() ); else item->set_text( 0, name ); From 4b3b5eba86d89e65e751b9e9b8e901a17f8e35ef Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Thu, 19 Mar 2015 23:53:54 +0000 Subject: [PATCH 14/32] Use Vector for storing areas --- core/vector.h | 9 +++++++++ servers/physics/body_sw.h | 9 ++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/core/vector.h b/core/vector.h index 90a9bf715b..d6453a3b83 100644 --- a/core/vector.h +++ b/core/vector.h @@ -149,7 +149,16 @@ public: sort_custom<_DefaultComparator >(); } + void ordered_insert(const T& p_val) { + int i; + for (i=0; iget_self() < p_cmp.area->get_self() ; } + _FORCE_INLINE_ bool operator==(const AreaCMP& p_cmp) const { return area->get_self() == p_cmp.area->get_self();} + _FORCE_INLINE_ bool operator<(const AreaCMP a) const { return area->get_priority() < a.area->get_priority();} _FORCE_INLINE_ AreaCMP() {} _FORCE_INLINE_ AreaCMP(AreaSW *p_area) { area=p_area;} }; - - VSet areas; + Vector areas; struct Contact { @@ -134,8 +134,7 @@ public: void set_force_integration_callback(ObjectID p_id,const StringName& p_method,const Variant& p_udata=Variant()); - - _FORCE_INLINE_ void add_area(AreaSW *p_area) { areas.insert(AreaCMP(p_area)); } + _FORCE_INLINE_ void add_area(AreaSW *p_area) { areas.ordered_insert(AreaCMP(p_area)); } _FORCE_INLINE_ void remove_area(AreaSW *p_area) { areas.erase(AreaCMP(p_area)); } _FORCE_INLINE_ void set_max_contacts_reported(int p_size) { contacts.resize(p_size); contact_count=0; if (mode==PhysicsServer::BODY_MODE_KINEMATIC && p_size) set_active(true);} From 18a1403fcf3ea8907001178ba413bd8b10da815b Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Fri, 20 Mar 2015 03:38:12 +0000 Subject: [PATCH 15/32] Implement combine mode for area --- servers/physics/body_sw.cpp | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/servers/physics/body_sw.cpp b/servers/physics/body_sw.cpp index c7c20a8bd1..9638e8a3b3 100644 --- a/servers/physics/body_sw.cpp +++ b/servers/physics/body_sw.cpp @@ -358,10 +358,10 @@ void BodySW::_compute_area_gravity(const AreaSW *p_area) { if (p_area->is_gravity_point()) { - gravity = (p_area->get_transform().xform(p_area->get_gravity_vector()) - get_transform().get_origin()).normalized() * p_area->get_gravity(); + gravity += (p_area->get_transform().xform(p_area->get_gravity_vector()) - get_transform().get_origin()).normalized() * p_area->get_gravity(); } else { - gravity = p_area->get_gravity_vector() * p_area->get_gravity(); + gravity += p_area->get_gravity_vector() * p_area->get_gravity(); } } @@ -371,23 +371,28 @@ void BodySW::integrate_forces(real_t p_step) { if (mode==PhysicsServer::BODY_MODE_STATIC) return; - AreaSW *current_area = get_space()->get_default_area(); - ERR_FAIL_COND(!current_area); + AreaSW *def_area = get_space()->get_default_area(); + ERR_FAIL_COND(!def_area); - int prio = current_area->get_priority(); int ac = areas.size(); + bool replace = false; + gravity=Vector3(0,0,0); if (ac) { const AreaCMP *aa = &areas[0]; - for(int i=0;iget_priority() > prio) { - current_area=aa[i].area; - prio=current_area->get_priority(); + density = aa[ac-1].area->get_density(); + for(int i=ac-1;i>=0;i--) { + _compute_area_gravity(aa[i].area); + if (aa[i].area->get_space_override_mode() == PhysicsServer::AREA_SPACE_OVERRIDE_REPLACE) { + replace = true; + break; } } + } else { + density=def_area->get_density(); + } + if( !replace ) { + _compute_area_gravity(def_area); } - - _compute_area_gravity(current_area); - density=current_area->get_density(); Vector3 motion; bool do_motion=false; @@ -455,7 +460,7 @@ void BodySW::integrate_forces(real_t p_step) { } - current_area=NULL; // clear the area, so it is set in the next frame + def_area=NULL; // clear the area, so it is set in the next frame contact_count=0; } From 600bae34bd4a2d57a1c8c7b108b873846b26830e Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Tue, 24 Mar 2015 04:05:56 +0000 Subject: [PATCH 16/32] Re-sort Area array during integration step --- servers/physics/body_sw.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/servers/physics/body_sw.cpp b/servers/physics/body_sw.cpp index 9638e8a3b3..5682ad8498 100644 --- a/servers/physics/body_sw.cpp +++ b/servers/physics/body_sw.cpp @@ -378,6 +378,7 @@ void BodySW::integrate_forces(real_t p_step) { bool replace = false; gravity=Vector3(0,0,0); if (ac) { + areas.sort(); const AreaCMP *aa = &areas[0]; density = aa[ac-1].area->get_density(); for(int i=ac-1;i>=0;i--) { From 1515de217e666a77e4ad3bee8421e718cc6b4330 Mon Sep 17 00:00:00 2001 From: sanikoyes Date: Wed, 25 Mar 2015 10:57:35 +0800 Subject: [PATCH 17/32] Sort sample lists by name(more readable) --- tools/editor/plugins/sample_library_editor_plugin.cpp | 1 + tools/editor/plugins/sample_player_editor_plugin.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/tools/editor/plugins/sample_library_editor_plugin.cpp b/tools/editor/plugins/sample_library_editor_plugin.cpp index 41c84f6e2c..96d72595ab 100644 --- a/tools/editor/plugins/sample_library_editor_plugin.cpp +++ b/tools/editor/plugins/sample_library_editor_plugin.cpp @@ -235,6 +235,7 @@ void SampleLibraryEditor::_update_library() { List names; sample_library->get_sample_list(&names); + names.sort_custom(); for(List::Element *E=names.front();E;E=E->next()) { diff --git a/tools/editor/plugins/sample_player_editor_plugin.cpp b/tools/editor/plugins/sample_player_editor_plugin.cpp index 405107889c..2e31467dc7 100644 --- a/tools/editor/plugins/sample_player_editor_plugin.cpp +++ b/tools/editor/plugins/sample_player_editor_plugin.cpp @@ -94,6 +94,7 @@ void SamplePlayerEditor::_update_sample_library() { List samplenames; sl->get_sample_list(&samplenames); + samplenames.sort_custom(); for(List::Element *E=samplenames.front();E;E=E->next()) { samples->add_item(E->get()); } From 042ead0e5d0ef8112b189a2ce70d89d1ef83ca02 Mon Sep 17 00:00:00 2001 From: sanikoyes Date: Wed, 25 Mar 2015 10:58:22 +0800 Subject: [PATCH 18/32] add missing WM_RBUTTONDBLCLK message --- platform/windows/os_windows.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index 414c250bd4..93275b3d54 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -423,6 +423,7 @@ LRESULT OS_Windows::WndProc(HWND hWnd,UINT uMsg, WPARAM wParam, LPARAM lParam) { case WM_RBUTTONUP: case WM_MOUSEWHEEL: case WM_LBUTTONDBLCLK: + case WM_RBUTTONDBLCLK: /*case WM_XBUTTONDOWN: case WM_XBUTTONUP: */{ @@ -476,6 +477,12 @@ LRESULT OS_Windows::WndProc(HWND hWnd,UINT uMsg, WPARAM wParam, LPARAM lParam) { mb.button_index=1; mb.doubleclick = true; } break; + case WM_RBUTTONDBLCLK: { + + mb.pressed=true; + mb.button_index=2; + mb.doubleclick = true; + } break; case WM_MOUSEWHEEL: { mb.pressed=true; @@ -2045,7 +2052,7 @@ String OS_Windows::get_executable_path() const { wchar_t bufname[4096]; GetModuleFileNameW(NULL,bufname,4096); String s= bufname; - print_line("EXEC PATHPó: "+s); + print_line("EXEC PATHP¨®: "+s); return s; } From 97f34a1dd6b472318df80d801f80f8d5eecd9e99 Mon Sep 17 00:00:00 2001 From: sanikoyes Date: Wed, 25 Mar 2015 11:01:12 +0800 Subject: [PATCH 19/32] Add seed/get_inst function for GDScript seed -> Math::seed get_inst -> ObjectDB::get_instance --- modules/gdscript/gd_functions.cpp | 34 +++++++++++++++++++++++++++++++ modules/gdscript/gd_functions.h | 2 ++ 2 files changed, 36 insertions(+) diff --git a/modules/gdscript/gd_functions.cpp b/modules/gdscript/gd_functions.cpp index f37b2f645a..ddc791d14c 100644 --- a/modules/gdscript/gd_functions.cpp +++ b/modules/gdscript/gd_functions.cpp @@ -71,6 +71,7 @@ const char *GDFunctions::get_func_name(Function p_func) { "randi", "randf", "rand_range", + "seed", "rand_seed", "deg2rad", "rad2deg", @@ -97,6 +98,7 @@ const char *GDFunctions::get_func_name(Function p_func) { "dict2inst", "hash", "print_stack", + "get_inst", }; return _names[p_func]; @@ -328,6 +330,13 @@ void GDFunctions::call(Function p_func,const Variant **p_args,int p_arg_count,Va VALIDATE_ARG_NUM(1); r_ret=Math::random(*p_args[0],*p_args[1]); } break; + case MATH_SEED: { + VALIDATE_ARG_COUNT(1); + VALIDATE_ARG_NUM(0); + uint32_t seed=*p_args[0]; + Math::seed(seed); + r_ret=Variant(); + } break; case MATH_RANDSEED: { VALIDATE_ARG_COUNT(1); VALIDATE_ARG_NUM(0); @@ -895,6 +904,20 @@ void GDFunctions::call(Function p_func,const Variant **p_args,int p_arg_count,Va }; } break; + case GET_INST: { + + VALIDATE_ARG_COUNT(1); + if (p_args[0]->get_type()!=Variant::INT && p_args[0]->get_type()!=Variant::REAL) { + r_error.error=Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.argument=0; + r_ret=Variant(); + break; + } + + uint32_t id=*p_args[0]; + r_ret=ObjectDB::get_instance(id); + + } break; case FUNC_MAX: { ERR_FAIL_V(); @@ -1130,6 +1153,11 @@ MethodInfo GDFunctions::get_info(Function p_func) { mi.return_val.type=Variant::REAL; return mi; } break; + case MATH_SEED: { + MethodInfo mi("seed",PropertyInfo(Variant::REAL,"seed")); + mi.return_val.type=Variant::NIL; + return mi; + } break; case MATH_RANDSEED: { MethodInfo mi("rand_seed",PropertyInfo(Variant::REAL,"seed")); mi.return_val.type=Variant::ARRAY; @@ -1288,6 +1316,12 @@ MethodInfo GDFunctions::get_info(Function p_func) { return mi; } break; + case GET_INST: { + MethodInfo mi("get_info",PropertyInfo(Variant::INT,"instance_id")); + mi.return_val.type=Variant::OBJECT; + return mi; + } break; + case FUNC_MAX: { ERR_FAIL_V(MethodInfo()); diff --git a/modules/gdscript/gd_functions.h b/modules/gdscript/gd_functions.h index 05ff6a2e73..4fbfe99228 100644 --- a/modules/gdscript/gd_functions.h +++ b/modules/gdscript/gd_functions.h @@ -67,6 +67,7 @@ public: MATH_RAND, MATH_RANDF, MATH_RANDOM, + MATH_SEED, MATH_RANDSEED, MATH_DEG2RAD, MATH_RAD2DEG, @@ -93,6 +94,7 @@ public: DICT2INST, HASH, PRINT_STACK, + GET_INST, FUNC_MAX }; From 103ab3bd1a1974655766dc42768f6e603b237c1a Mon Sep 17 00:00:00 2001 From: yg2f Date: Wed, 25 Mar 2015 16:27:55 +0100 Subject: [PATCH 20/32] fixes_3d_spot_attenuation --- scene/3d/light.cpp | 2 +- scene/3d/light.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scene/3d/light.cpp b/scene/3d/light.cpp index 15e77e5378..037350f99a 100644 --- a/scene/3d/light.cpp +++ b/scene/3d/light.cpp @@ -669,7 +669,7 @@ void SpotLight::_bind_methods() { ADD_PROPERTYI( PropertyInfo( Variant::REAL, "params/attenuation", PROPERTY_HINT_EXP_EASING, "attenuation"), _SCS("set_parameter"), _SCS("get_parameter"), PARAM_ATTENUATION ); ADD_PROPERTYI( PropertyInfo( Variant::REAL, "params/spot_angle", PROPERTY_HINT_RANGE, "0.01,89.9,0.01"), _SCS("set_parameter"), _SCS("get_parameter"), PARAM_SPOT_ANGLE ); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "params/spot_attenuation", PROPERTY_HINT_EXP_EASING, "attenuation"), _SCS("set_parameter"), _SCS("get_parameter"), PARAM_SPOT_ATTENUATION ); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "params/spot_attenuation", PROPERTY_HINT_EXP_EASING, "spot_attenuation"), _SCS("set_parameter"), _SCS("get_parameter"), PARAM_SPOT_ATTENUATION ); } diff --git a/scene/3d/light.h b/scene/3d/light.h index 6fb57a269b..5b10a4d816 100644 --- a/scene/3d/light.h +++ b/scene/3d/light.h @@ -49,7 +49,7 @@ public: PARAM_ENERGY=VisualServer::LIGHT_PARAM_ENERGY, PARAM_ATTENUATION=VisualServer::LIGHT_PARAM_ATTENUATION, PARAM_SPOT_ANGLE=VisualServer::LIGHT_PARAM_SPOT_ANGLE, - PARAM_SPOT_ATTENUATION=VisualServer::LIGHT_PARAM_ATTENUATION, + PARAM_SPOT_ATTENUATION=VisualServer::LIGHT_PARAM_SPOT_ATTENUATION, PARAM_SHADOW_DARKENING=VisualServer::LIGHT_PARAM_SHADOW_DARKENING, PARAM_SHADOW_Z_OFFSET=VisualServer::LIGHT_PARAM_SHADOW_Z_OFFSET, PARAM_SHADOW_Z_SLOPE_SCALE=VisualServer::LIGHT_PARAM_SHADOW_Z_SLOPE_SCALE, From 303ce0ea3278fb370728b077621268431a2bedb0 Mon Sep 17 00:00:00 2001 From: yg2f Date: Thu, 26 Mar 2015 15:45:53 +0100 Subject: [PATCH 21/32] makes_editorhelp_uses_editor_settings_bg_color This fixes issue #332 by using the "text_editor/background_color" editor setting as background color for the EditorHelp. --- tools/editor/editor_help.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/editor/editor_help.cpp b/tools/editor/editor_help.cpp index 2283a2df14..7deb136470 100644 --- a/tools/editor/editor_help.cpp +++ b/tools/editor/editor_help.cpp @@ -1390,7 +1390,9 @@ EditorHelp::EditorHelp(EditorNode *p_editor) { { PanelContainer *pc = memnew( PanelContainer ); - pc->add_style_override("panel",get_stylebox("normal","TextEdit")); + Ref style( memnew( StyleBoxFlat ) ); + style->set_bg_color( EditorSettings::get_singleton()->get("text_editor/background_color") ); + pc->add_style_override("panel", style); //get_stylebox("normal","TextEdit")); h_split->add_child(pc); class_desc = memnew( RichTextLabel ); pc->add_child(class_desc); From 3c67e22c3d0028df31e060ea28fb9f96b9f65cdf Mon Sep 17 00:00:00 2001 From: yg2f Date: Sat, 28 Mar 2015 18:34:28 +0100 Subject: [PATCH 22/32] add : bool Object.is_queued_for_deletion() `object.is_queued_for_deletion()` return true if the object was `object.queue_free()` or `SceneTree.queue_delete(object)`. --- core/object.cpp | 7 +++++++ core/object.h | 4 +++- scene/main/scene_main_loop.cpp | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/core/object.cpp b/core/object.cpp index 2b83f728d1..f71521a0ff 100644 --- a/core/object.cpp +++ b/core/object.cpp @@ -1503,6 +1503,8 @@ void Object::_bind_methods() { ObjectTypeDB::bind_method(_MD("XL_MESSAGE","message"),&Object::XL_MESSAGE); ObjectTypeDB::bind_method(_MD("tr","message"),&Object::tr); + ObjectTypeDB::bind_method(_MD("is_queued_for_deletion"),&Object::is_queued_for_deletion); + ADD_SIGNAL( MethodInfo("script_changed")); BIND_VMETHOD( MethodInfo("_notification",PropertyInfo(Variant::INT,"what")) ); @@ -1566,6 +1568,10 @@ void Object::get_translatable_strings(List *p_strings) const { } +bool Object::is_queued_for_deletion() const { + return _is_queued_for_deletion; +} + #ifdef TOOLS_ENABLED void Object::set_edited(bool p_edited) { @@ -1587,6 +1593,7 @@ Object::Object() { _instance_ID=0; _instance_ID = ObjectDB::add_instance(this); _can_translate=true; + _is_queued_for_deletion=false; script_instance=NULL; #ifdef TOOLS_ENABLED diff --git a/core/object.h b/core/object.h index eb885f5d20..849bfc8510 100644 --- a/core/object.h +++ b/core/object.h @@ -397,7 +397,6 @@ friend void postinitialize_handler(Object*); protected: - virtual bool _use_builtin_script() const { return false; } virtual void _initialize_typev() { initialize_type(); } virtual bool _setv(const StringName& p_name,const Variant &p_property) { return false; }; @@ -589,6 +588,9 @@ public: StringName XL_MESSAGE(const StringName& p_message) const; //translate message (internationalization) StringName tr(const StringName& p_message) const; //translate message (alternative) + bool _is_queued_for_deletion; // set to true by SceneTree::queue_delete(), and returned by + bool is_queued_for_deletion() const; + _FORCE_INLINE_ void set_message_translation(bool p_enable) { _can_translate=p_enable; } _FORCE_INLINE_ bool can_translate_messages() const { return _can_translate; } Object(); diff --git a/scene/main/scene_main_loop.cpp b/scene/main/scene_main_loop.cpp index ed3e419359..8e2dc93288 100644 --- a/scene/main/scene_main_loop.cpp +++ b/scene/main/scene_main_loop.cpp @@ -850,6 +850,7 @@ void SceneTree::queue_delete(Object *p_object) { _THREAD_SAFE_METHOD_ ERR_FAIL_NULL(p_object); + p_object->_is_queued_for_deletion = true; delete_queue.push_back(p_object->get_instance_ID()); } From 9cca88eb9261587875cc944a23811c9f1e62f492 Mon Sep 17 00:00:00 2001 From: UsernameIsAReservedWord Date: Sat, 28 Mar 2015 18:42:01 +0100 Subject: [PATCH 23/32] Update object.h --- core/object.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/object.h b/core/object.h index 849bfc8510..0bd3d09c21 100644 --- a/core/object.h +++ b/core/object.h @@ -588,7 +588,7 @@ public: StringName XL_MESSAGE(const StringName& p_message) const; //translate message (internationalization) StringName tr(const StringName& p_message) const; //translate message (alternative) - bool _is_queued_for_deletion; // set to true by SceneTree::queue_delete(), and returned by + bool _is_queued_for_deletion; // set to true by SceneTree::queue_delete() bool is_queued_for_deletion() const; _FORCE_INLINE_ void set_message_translation(bool p_enable) { _can_translate=p_enable; } From 73ff3ac2180f73610392831d437dd0a1862b8dd8 Mon Sep 17 00:00:00 2001 From: mostafahassan Date: Tue, 31 Mar 2015 21:34:50 +0200 Subject: [PATCH 24/32] (Fix) script will not be able to extend itself --- modules/gdscript/gd_script.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/gdscript/gd_script.cpp b/modules/gdscript/gd_script.cpp index 06c746c4fb..f13b51c008 100644 --- a/modules/gdscript/gd_script.cpp +++ b/modules/gdscript/gd_script.cpp @@ -1689,7 +1689,7 @@ bool GDScript::_update_exports() { } - if (c->extends_used && String(c->extends_file)!="") { + if (c->extends_used && String(c->extends_file)!="" && String(c->extends_file) != get_path()) { String path = c->extends_file; if (path.is_rel_path()) { From 78d734873d27d855e01d574a6dd3a6380b2fa5ec Mon Sep 17 00:00:00 2001 From: mostafahassan Date: Tue, 31 Mar 2015 22:49:11 +0200 Subject: [PATCH 25/32] Fixed crash when trying to add keypoints and deleting them while holding mouse button down. --- tools/editor/plugins/shader_graph_editor_plugin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/editor/plugins/shader_graph_editor_plugin.cpp b/tools/editor/plugins/shader_graph_editor_plugin.cpp index 508e8b4cba..e829c06e6f 100644 --- a/tools/editor/plugins/shader_graph_editor_plugin.cpp +++ b/tools/editor/plugins/shader_graph_editor_plugin.cpp @@ -376,7 +376,7 @@ void GraphCurveMapEdit::_input_event(const InputEvent& p_event) { update(); } - if (p_event.type==InputEvent::MOUSE_MOTION && grabbing) { + if (p_event.type==InputEvent::MOUSE_MOTION && grabbing && grabbed != -1) { Point2 p = Vector2(p_event.mouse_button.x,p_event.mouse_button.y)/get_size(); p.y=1.0-p.y; From 7ea3482c38a1d18af687aa6a08d7dea9f346a2e9 Mon Sep 17 00:00:00 2001 From: yg2f Date: Wed, 1 Apr 2015 17:04:41 +0200 Subject: [PATCH 26/32] add scons extra suffix option makes it possible to add a custom extra suffix to the base filename of all generated binary files. example : scons p=windows extra_suffix=yourBranchName or scons p=windows bits=32 extra_suffix=v20150401_1642 or scons p=windows extra_suffix=msvc2010_git20150401 --- SConstruct | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/SConstruct b/SConstruct index 2dc9fa1e70..922dc64fe3 100644 --- a/SConstruct +++ b/SConstruct @@ -121,6 +121,7 @@ opts.Add("LINKFLAGS", "Custom flags for the linker"); opts.Add('disable_3d', 'Disable 3D nodes for smaller executable (yes/no)', "no") opts.Add('disable_advanced_gui', 'Disable advance 3D gui nodes and behaviors (yes/no)', "no") opts.Add('colored', 'Enable colored output for the compilation (yes/no)', 'no') +opts.Add('extra_suffix', 'Custom extra suffix added to the base filename of all generated binary files.', '') # add platform specific options @@ -176,6 +177,9 @@ if selected_platform in platform_list: env = env_base.Clone() env.extra_suffix="" + + if env["extra_suffix"] != '' : + env.extra_suffix += '.'+env["extra_suffix"] CCFLAGS = env.get('CCFLAGS', '') env['CCFLAGS'] = '' From aa929bc1f10566e05762ed8cdbd6e44f5b560085 Mon Sep 17 00:00:00 2001 From: Franklin Sobrinho Date: Thu, 2 Apr 2015 15:32:37 -0300 Subject: [PATCH 27/32] fix_issue_#1594 --- tools/editor/plugins/mesh_editor_plugin.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/editor/plugins/mesh_editor_plugin.cpp b/tools/editor/plugins/mesh_editor_plugin.cpp index a3884f9be4..753146e040 100644 --- a/tools/editor/plugins/mesh_editor_plugin.cpp +++ b/tools/editor/plugins/mesh_editor_plugin.cpp @@ -32,8 +32,6 @@ void MeshInstanceEditor::_menu_option(int p_option) { Ref mesh = node->get_mesh(); if (mesh.is_null()) { - err_dialog->set_text("Mesh is empty!"); - err_dialog->popup_centered(Size2(100,50)); return; } From 68c2a959dd8516823f9f501bed1ac23197e892d2 Mon Sep 17 00:00:00 2001 From: TheoXD Date: Fri, 3 Apr 2015 14:42:05 +0200 Subject: [PATCH 28/32] Bullet shower demo crashed because of dynamic casting in the code for object picking. Making sure the object has an ID greater than 0 before typecasting solves it. --- scene/main/viewport.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index ee400ae6d5..f0c71da153 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -406,7 +406,7 @@ void Viewport::_notification(int p_what) { int rc = ss2d->intersect_point(point,res,64,Set(),0xFFFFFFFF,0xFFFFFFFF); for(int i=0;icast_to(); if (co) { From f77349a4c2735daec9402f71a16e531b06fdddef Mon Sep 17 00:00:00 2001 From: Franklin Sobrinho Date: Fri, 3 Apr 2015 10:28:30 -0300 Subject: [PATCH 29/32] Better fix --- tools/editor/plugins/mesh_editor_plugin.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/editor/plugins/mesh_editor_plugin.cpp b/tools/editor/plugins/mesh_editor_plugin.cpp index 753146e040..f8c75e1cf5 100644 --- a/tools/editor/plugins/mesh_editor_plugin.cpp +++ b/tools/editor/plugins/mesh_editor_plugin.cpp @@ -32,6 +32,8 @@ void MeshInstanceEditor::_menu_option(int p_option) { Ref mesh = node->get_mesh(); if (mesh.is_null()) { + err_dialog->set_text("Mesh is empty!"); + err_dialog->popup_centered(Size2(100,80)); return; } @@ -238,6 +240,9 @@ MeshInstanceEditor::MeshInstanceEditor() { add_child(outline_dialog); outline_dialog->connect("confirmed",this,"_create_outline_mesh"); + err_dialog = memnew( AcceptDialog ); + add_child(err_dialog); + } From af368b7e1accb27afdd958af59ef515413590823 Mon Sep 17 00:00:00 2001 From: hurikhan Date: Fri, 3 Apr 2015 15:00:55 -0400 Subject: [PATCH 30/32] set screen parameter names for gdscript --- core/bind/core_bind.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index 5839467388..439855fbb7 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -709,13 +709,13 @@ void _OS::_bind_methods() { ObjectTypeDB::bind_method(_MD("get_screen_count"),&_OS::get_screen_count); ObjectTypeDB::bind_method(_MD("get_current_screen"),&_OS::get_current_screen); - ObjectTypeDB::bind_method(_MD("set_current_screen"),&_OS::set_current_screen); - ObjectTypeDB::bind_method(_MD("get_screen_position"),&_OS::get_screen_position,DEFVAL(0)); - ObjectTypeDB::bind_method(_MD("get_screen_size"),&_OS::get_screen_size,DEFVAL(0)); + ObjectTypeDB::bind_method(_MD("set_current_screen","screen"),&_OS::set_current_screen); + ObjectTypeDB::bind_method(_MD("get_screen_position","screen"),&_OS::get_screen_position,DEFVAL(0)); + ObjectTypeDB::bind_method(_MD("get_screen_size","screen"),&_OS::get_screen_size,DEFVAL(0)); ObjectTypeDB::bind_method(_MD("get_window_position"),&_OS::get_window_position); - ObjectTypeDB::bind_method(_MD("set_window_position"),&_OS::set_window_position); + ObjectTypeDB::bind_method(_MD("set_window_position","position"),&_OS::set_window_position); ObjectTypeDB::bind_method(_MD("get_window_size"),&_OS::get_window_size); - ObjectTypeDB::bind_method(_MD("set_window_size"),&_OS::set_window_size); + ObjectTypeDB::bind_method(_MD("set_window_size","size"),&_OS::set_window_size); ObjectTypeDB::bind_method(_MD("set_window_fullscreen","enabled"),&_OS::set_window_fullscreen); ObjectTypeDB::bind_method(_MD("is_window_fullscreen"),&_OS::is_window_fullscreen); ObjectTypeDB::bind_method(_MD("set_window_resizable","enabled"),&_OS::set_window_resizable); From 7a2698bb44021b7b51a85f2dee3c722f33924ead Mon Sep 17 00:00:00 2001 From: Martho42 Date: Sat, 4 Apr 2015 17:03:56 -0700 Subject: [PATCH 31/32] Fixes the accelerometer Resolves the issue of the accelerometer behaving differently across devices with landscape as default and devices with portrait as default. --- .../java/src/com/android/godot/Godot.java | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/platform/android/java/src/com/android/godot/Godot.java b/platform/android/java/src/com/android/godot/Godot.java index 1fd37c98cd..2abb4cec53 100644 --- a/platform/android/java/src/com/android/godot/Godot.java +++ b/platform/android/java/src/com/android/godot/Godot.java @@ -571,9 +571,24 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC } @Override public void onSensorChanged(SensorEvent event) { - float x = event.values[0]; - float y = event.values[1]; - float z = event.values[2]; + Display display = ((WindowManager) getSystemService(WINDOW_SERVICE)).getDefaultDisplay(); + int displayRotation = display.getRotation(); + + float[] adjustedValues = new float[3]; + final int axisSwap[][] = { + { 1, -1, 0, 1 }, // ROTATION_0 + {-1, -1, 1, 0 }, // ROTATION_90 + {-1, 1, 0, 1 }, // ROTATION_180 + { 1, 1, 1, 0 } }; // ROTATION_270 + + final int[] as = axisSwap[displayRotation]; + adjustedValues[0] = (float)as[0] * event.values[ as[2] ]; + adjustedValues[1] = (float)as[1] * event.values[ as[3] ]; + adjustedValues[2] = event.values[2]; + + float x = adjustedValues[0]; + float y = adjustedValues[1]; + float z = adjustedValues[2]; GodotLib.accelerometer(x,y,z); } From fcbf473d0d64a84780d91e04fc4b9fc052ede296 Mon Sep 17 00:00:00 2001 From: yg2f Date: Mon, 6 Apr 2015 13:57:31 +0200 Subject: [PATCH 32/32] fix printraw to make it actually print raw --- modules/gdscript/gd_functions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/gdscript/gd_functions.cpp b/modules/gdscript/gd_functions.cpp index f37b2f645a..ce2cb14643 100644 --- a/modules/gdscript/gd_functions.cpp +++ b/modules/gdscript/gd_functions.cpp @@ -575,7 +575,7 @@ void GDFunctions::call(Function p_func,const Variant **p_args,int p_arg_count,Va } //str+="\n"; - OS::get_singleton()->print("%s\n",str.utf8().get_data()); + OS::get_singleton()->print("%s",str.utf8().get_data()); r_ret=Variant(); } break;