You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2026-01-05 19:31:35 +00:00
-Added google play services (needed for some stuff)
-Added new screen resizing options, stretch_2d is removed, new much more flexible ones. -Fixed bug in viewport (can create more instances in 3d-in-2d demo now) -Can set android permissions and screen sizes manually in the export settings -Changed export templates extension to .tpz (too many people unzipped the manually..) -File dialog now ensures that the proper extension is used (will not allow to save without it) -Fixed bug that made collision exceptions not work in 2D
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include "io/marshalls.h"
|
||||
#include "io/base64.h"
|
||||
#include "core/globals.h"
|
||||
#include "io/file_access_encrypted.h"
|
||||
|
||||
_ResourceLoader *_ResourceLoader::singleton=NULL;
|
||||
|
||||
@@ -812,6 +813,44 @@ _Geometry::_Geometry() {
|
||||
///////////////////////// FILE
|
||||
|
||||
|
||||
|
||||
Error _File::open_encrypted(const String& p_path, int p_mode_flags,const Vector<uint8_t>& p_key) {
|
||||
|
||||
Error err = open(p_path,p_mode_flags);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
FileAccessEncrypted *fae = memnew( FileAccessEncrypted );
|
||||
err = fae->open_and_parse(f,p_key,(p_mode_flags==WRITE)?FileAccessEncrypted::MODE_WRITE_AES256:FileAccessEncrypted::MODE_READ);
|
||||
if (err) {
|
||||
memdelete(fae);
|
||||
close();
|
||||
return err;
|
||||
}
|
||||
f=fae;
|
||||
return OK;
|
||||
}
|
||||
|
||||
Error _File::open_encrypted_pass(const String& p_path, int p_mode_flags,const String& p_pass) {
|
||||
|
||||
Error err = open(p_path,p_mode_flags);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
FileAccessEncrypted *fae = memnew( FileAccessEncrypted );
|
||||
err = fae->open_and_parse_password(f,p_pass,(p_mode_flags==WRITE)?FileAccessEncrypted::MODE_WRITE_AES256:FileAccessEncrypted::MODE_READ);
|
||||
if (err) {
|
||||
memdelete(fae);
|
||||
close();
|
||||
return err;
|
||||
}
|
||||
|
||||
f=fae;
|
||||
return OK;
|
||||
|
||||
}
|
||||
|
||||
|
||||
Error _File::open(const String& p_path, int p_mode_flags) {
|
||||
|
||||
close();
|
||||
@@ -1113,6 +1152,10 @@ Variant _File::get_var() const {
|
||||
|
||||
void _File::_bind_methods() {
|
||||
|
||||
|
||||
ObjectTypeDB::bind_method(_MD("open_encrypted","path","mode_flags","key"),&_File::open_encrypted);
|
||||
ObjectTypeDB::bind_method(_MD("open_encrypted_with_pass","path","mode_flags","pass"),&_File::open_encrypted_pass);
|
||||
|
||||
ObjectTypeDB::bind_method(_MD("open","path","flags"),&_File::open);
|
||||
ObjectTypeDB::bind_method(_MD("close"),&_File::close);
|
||||
ObjectTypeDB::bind_method(_MD("is_open"),&_File::is_open);
|
||||
|
||||
Reference in New Issue
Block a user