PoolVector is gone, replaced by Vector
Typed `PoolTypeArray` types are now renamed `PackedTypeArray` and are sugar for `Vector<Type>`.
This commit is contained in:
committed by
Juan Linietsky
parent
fb8c93c10b
commit
3205a92ad8
@@ -408,17 +408,17 @@ int FileAccess::get_buffer(uint8_t *p_dst, int p_length) const {
|
||||
}
|
||||
|
||||
String FileAccess::get_as_utf8_string() const {
|
||||
PoolVector<uint8_t> sourcef;
|
||||
Vector<uint8_t> sourcef;
|
||||
int len = get_len();
|
||||
sourcef.resize(len + 1);
|
||||
|
||||
PoolVector<uint8_t>::Write w = sourcef.write();
|
||||
int r = get_buffer(w.ptr(), len);
|
||||
uint8_t *w = sourcef.ptrw();
|
||||
int r = get_buffer(w, len);
|
||||
ERR_FAIL_COND_V(r != len, String());
|
||||
w[len] = 0;
|
||||
|
||||
String s;
|
||||
if (s.parse_utf8((const char *)w.ptr())) {
|
||||
if (s.parse_utf8((const char *)w)) {
|
||||
return String();
|
||||
}
|
||||
return s;
|
||||
|
||||
@@ -46,7 +46,7 @@ void MainLoop::_bind_methods() {
|
||||
BIND_VMETHOD(MethodInfo("_initialize"));
|
||||
BIND_VMETHOD(MethodInfo(Variant::BOOL, "_iteration", PropertyInfo(Variant::REAL, "delta")));
|
||||
BIND_VMETHOD(MethodInfo(Variant::BOOL, "_idle", PropertyInfo(Variant::REAL, "delta")));
|
||||
BIND_VMETHOD(MethodInfo("_drop_files", PropertyInfo(Variant::POOL_STRING_ARRAY, "files"), PropertyInfo(Variant::INT, "from_screen")));
|
||||
BIND_VMETHOD(MethodInfo("_drop_files", PropertyInfo(Variant::PACKED_STRING_ARRAY, "files"), PropertyInfo(Variant::INT, "from_screen")));
|
||||
BIND_VMETHOD(MethodInfo("_finalize"));
|
||||
|
||||
BIND_VMETHOD(MethodInfo("_global_menu_action", PropertyInfo(Variant::NIL, "id"), PropertyInfo(Variant::NIL, "meta")));
|
||||
|
||||
+1
-1
@@ -143,7 +143,7 @@ T *memnew_arr_template(size_t p_elements, const char *p_descr = "") {
|
||||
if (p_elements == 0)
|
||||
return 0;
|
||||
/** overloading operator new[] cannot be done , because it may not return the real allocated address (it may pad the 'element count' before the actual array). Because of that, it must be done by hand. This is the
|
||||
same strategy used by std::vector, and the PoolVector class, so it should be safe.*/
|
||||
same strategy used by std::vector, and the Vector class, so it should be safe.*/
|
||||
|
||||
size_t len = sizeof(T) * p_elements;
|
||||
uint64_t *mem = (uint64_t *)Memory::alloc_static(len, true);
|
||||
|
||||
@@ -121,9 +121,9 @@ void MIDIDriver::receive_input_packet(uint64_t timestamp, uint8_t *data, uint32_
|
||||
id->parse_input_event(event);
|
||||
}
|
||||
|
||||
PoolStringArray MIDIDriver::get_connected_inputs() {
|
||||
PackedStringArray MIDIDriver::get_connected_inputs() {
|
||||
|
||||
PoolStringArray list;
|
||||
PackedStringArray list;
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ public:
|
||||
virtual Error open() = 0;
|
||||
virtual void close() = 0;
|
||||
|
||||
virtual PoolStringArray get_connected_inputs();
|
||||
virtual PackedStringArray get_connected_inputs();
|
||||
|
||||
static void receive_input_packet(uint64_t timestamp, uint8_t *data, uint32_t length);
|
||||
|
||||
|
||||
+2
-6
@@ -416,10 +416,6 @@ uint64_t OS::get_static_memory_usage() const {
|
||||
|
||||
return Memory::get_mem_usage();
|
||||
}
|
||||
uint64_t OS::get_dynamic_memory_usage() const {
|
||||
|
||||
return MemoryPool::total_memory;
|
||||
}
|
||||
|
||||
uint64_t OS::get_static_memory_peak_usage() const {
|
||||
|
||||
@@ -712,12 +708,12 @@ List<String> OS::get_restart_on_exit_arguments() const {
|
||||
return restart_commandline;
|
||||
}
|
||||
|
||||
PoolStringArray OS::get_connected_midi_inputs() {
|
||||
PackedStringArray OS::get_connected_midi_inputs() {
|
||||
|
||||
if (MIDIDriver::get_singleton())
|
||||
return MIDIDriver::get_singleton()->get_connected_inputs();
|
||||
|
||||
PoolStringArray list;
|
||||
PackedStringArray list;
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
+1
-2
@@ -185,7 +185,7 @@ public:
|
||||
virtual int get_audio_driver_count() const;
|
||||
virtual const char *get_audio_driver_name(int p_driver) const;
|
||||
|
||||
virtual PoolStringArray get_connected_midi_inputs();
|
||||
virtual PackedStringArray get_connected_midi_inputs();
|
||||
virtual void open_midi_inputs();
|
||||
virtual void close_midi_inputs();
|
||||
|
||||
@@ -390,7 +390,6 @@ public:
|
||||
|
||||
virtual uint64_t get_static_memory_usage() const;
|
||||
virtual uint64_t get_static_memory_peak_usage() const;
|
||||
virtual uint64_t get_dynamic_memory_usage() const;
|
||||
virtual uint64_t get_free_static_memory() const;
|
||||
|
||||
RenderThreadMode get_render_thread_mode() const { return _render_thread_mode; }
|
||||
|
||||
Reference in New Issue
Block a user