mirror of
https://github.com/godotengine/godot.git
synced 2025-10-21 08:53:35 +00:00
PoolVector is gone, replaced by Vector
Typed `PoolTypeArray` types are now renamed `PackedTypeArray` and are sugar for `Vector<Type>`.
This commit is contained in:
parent
fb8c93c10b
commit
3205a92ad8
406 changed files with 5314 additions and 8271 deletions
|
@ -428,22 +428,22 @@ ScriptLanguage *PluginScript::get_language() const {
|
|||
|
||||
Error PluginScript::load_source_code(const String &p_path) {
|
||||
|
||||
PoolVector<uint8_t> sourcef;
|
||||
Vector<uint8_t> sourcef;
|
||||
Error err;
|
||||
FileAccess *f = FileAccess::open(p_path, FileAccess::READ, &err);
|
||||
ERR_FAIL_COND_V_MSG(err, err, "Cannot open file '" + p_path + "'.");
|
||||
|
||||
int len = f->get_len();
|
||||
sourcef.resize(len + 1);
|
||||
PoolVector<uint8_t>::Write w = sourcef.write();
|
||||
int r = f->get_buffer(w.ptr(), len);
|
||||
uint8_t *w = sourcef.ptrw();
|
||||
int r = f->get_buffer(w, len);
|
||||
f->close();
|
||||
memdelete(f);
|
||||
ERR_FAIL_COND_V(r != len, ERR_CANT_OPEN);
|
||||
w[len] = 0;
|
||||
|
||||
String s;
|
||||
if (s.parse_utf8((const char *)w.ptr())) {
|
||||
if (s.parse_utf8((const char *)w)) {
|
||||
ERR_FAIL_V_MSG(ERR_INVALID_DATA, "Script '" + p_path + "' contains invalid unicode (UTF-8), so it was not loaded. Please ensure that scripts are saved in valid UTF-8 unicode.");
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue