@@ -47,12 +47,12 @@ static int _get_pad(int p_alignment, int p_n) {
47
47
}
48
48
49
49
void PCKPacker::_bind_methods () {
50
- ClassDB::bind_method (D_METHOD (" pck_start" , " pck_name " , " alignment" , " key" , " encrypt_directory" ), &PCKPacker::pck_start, DEFVAL (32 ), DEFVAL (" 0000000000000000000000000000000000000000000000000000000000000000" ), DEFVAL (false ));
50
+ ClassDB::bind_method (D_METHOD (" pck_start" , " pck_path " , " alignment" , " key" , " encrypt_directory" ), &PCKPacker::pck_start, DEFVAL (32 ), DEFVAL (" 0000000000000000000000000000000000000000000000000000000000000000" ), DEFVAL (false ));
51
51
ClassDB::bind_method (D_METHOD (" add_file" , " pck_path" , " source_path" , " encrypt" ), &PCKPacker::add_file, DEFVAL (false ));
52
52
ClassDB::bind_method (D_METHOD (" flush" , " verbose" ), &PCKPacker::flush, DEFVAL (false ));
53
53
}
54
54
55
- Error PCKPacker::pck_start (const String &p_file , int p_alignment, const String &p_key, bool p_encrypt_directory) {
55
+ Error PCKPacker::pck_start (const String &p_pck_path , int p_alignment, const String &p_key, bool p_encrypt_directory) {
56
56
ERR_FAIL_COND_V_MSG ((p_key.is_empty () || !p_key.is_valid_hex_number (false ) || p_key.length () != 64 ), ERR_CANT_CREATE, " Invalid Encryption Key (must be 64 characters long)." );
57
57
ERR_FAIL_COND_V_MSG (p_alignment <= 0 , ERR_CANT_CREATE, " Invalid alignment, must be greater then 0." );
58
58
@@ -83,8 +83,8 @@ Error PCKPacker::pck_start(const String &p_file, int p_alignment, const String &
83
83
}
84
84
enc_dir = p_encrypt_directory;
85
85
86
- file = FileAccess::open (p_file , FileAccess::WRITE);
87
- ERR_FAIL_COND_V_MSG (file.is_null (), ERR_CANT_CREATE, " Can't open file to write: " + String (p_file ) + " ." );
86
+ file = FileAccess::open (p_pck_path , FileAccess::WRITE);
87
+ ERR_FAIL_COND_V_MSG (file.is_null (), ERR_CANT_CREATE, " Can't open file to write: " + String (p_pck_path ) + " ." );
88
88
89
89
alignment = p_alignment;
90
90
@@ -106,7 +106,7 @@ Error PCKPacker::pck_start(const String &p_file, int p_alignment, const String &
106
106
return OK;
107
107
}
108
108
109
- Error PCKPacker::add_file (const String &p_file , const String &p_src, bool p_encrypt) {
109
+ Error PCKPacker::add_file (const String &p_pck_path , const String &p_src, bool p_encrypt) {
110
110
ERR_FAIL_COND_V_MSG (file.is_null (), ERR_INVALID_PARAMETER, " File must be opened before use." );
111
111
112
112
Ref<FileAccess> f = FileAccess::open (p_src, FileAccess::READ);
@@ -117,7 +117,7 @@ Error PCKPacker::add_file(const String &p_file, const String &p_src, bool p_encr
117
117
File pf;
118
118
// Simplify path here and on every 'files' access so that paths that have extra '/'
119
119
// symbols in them still match to the MD5 hash for the saved path.
120
- pf.path = p_file .simplify_path ();
120
+ pf.path = p_pck_path .simplify_path ();
121
121
pf.src_path = p_src;
122
122
pf.ofs = ofs;
123
123
pf.size = f->get_length ();
0 commit comments