diff options
Diffstat (limited to 'editor')
-rw-r--r-- | editor/doc/doc_data.cpp | 2 | ||||
-rw-r--r-- | editor/editor_asset_installer.cpp | 2 | ||||
-rw-r--r-- | editor/editor_profiler.cpp | 2 | ||||
-rw-r--r-- | editor/editor_settings.cpp | 2 | ||||
-rw-r--r-- | editor/export_template_manager.cpp | 4 | ||||
-rw-r--r-- | editor/fileserver/editor_file_server.cpp | 3 | ||||
-rw-r--r-- | editor/import/editor_scene_importer_gltf.cpp | 18 | ||||
-rw-r--r-- | editor/plugins/navigation_mesh_generator.cpp | 4 | ||||
-rw-r--r-- | editor/project_manager.cpp | 2 |
9 files changed, 20 insertions, 19 deletions
diff --git a/editor/doc/doc_data.cpp b/editor/doc/doc_data.cpp index a44830ef80..3a72f8e569 100644 --- a/editor/doc/doc_data.cpp +++ b/editor/doc/doc_data.cpp @@ -1115,7 +1115,7 @@ Error DocData::load_compressed(const uint8_t *p_data, int p_compressed_size, int Vector<uint8_t> data; data.resize(p_uncompressed_size); - Compression::decompress(data.ptr(), p_uncompressed_size, p_data, p_compressed_size, Compression::MODE_DEFLATE); + Compression::decompress(data.ptrw(), p_uncompressed_size, p_data, p_compressed_size, Compression::MODE_DEFLATE); class_list.clear(); Ref<XMLParser> parser = memnew(XMLParser); diff --git a/editor/editor_asset_installer.cpp b/editor/editor_asset_installer.cpp index 1aac697ffd..94108a52fc 100644 --- a/editor/editor_asset_installer.cpp +++ b/editor/editor_asset_installer.cpp @@ -268,7 +268,7 @@ void EditorAssetInstaller::ok_pressed() { //read unzOpenCurrentFile(pkg); - unzReadCurrentFile(pkg, data.ptr(), data.size()); + unzReadCurrentFile(pkg, data.ptrw(), data.size()); unzCloseCurrentFile(pkg); FileAccess *f = FileAccess::open(path, FileAccess::WRITE); diff --git a/editor/editor_profiler.cpp b/editor/editor_profiler.cpp index faf49ffd41..5d81fc6ea4 100644 --- a/editor/editor_profiler.cpp +++ b/editor/editor_profiler.cpp @@ -221,7 +221,7 @@ void EditorProfiler::_update_plot() { Vector<int> columnv; columnv.resize(h * 4); - int *column = columnv.ptr(); + int *column = columnv.ptrw(); Map<StringName, int> plot_prev; //Map<StringName,int> plot_max; diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index 582bb977b8..8bec8854ca 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -1388,7 +1388,7 @@ EditorSettings::EditorSettings() { Vector<uint8_t> data; data.resize(etl->uncomp_size); - Compression::decompress(data.ptr(), etl->uncomp_size, etl->data, etl->comp_size, Compression::MODE_DEFLATE); + Compression::decompress(data.ptrw(), etl->uncomp_size, etl->data, etl->comp_size, Compression::MODE_DEFLATE); FileAccessMemory *fa = memnew(FileAccessMemory); fa->open_custom(data.ptr(), data.size()); diff --git a/editor/export_template_manager.cpp b/editor/export_template_manager.cpp index d208bbe662..2aad4774b0 100644 --- a/editor/export_template_manager.cpp +++ b/editor/export_template_manager.cpp @@ -207,7 +207,7 @@ void ExportTemplateManager::_install_from_file(const String &p_file) { //read unzOpenCurrentFile(pkg); - ret = unzReadCurrentFile(pkg, data.ptr(), data.size()); + ret = unzReadCurrentFile(pkg, data.ptrw(), data.size()); unzCloseCurrentFile(pkg); String data_str; @@ -277,7 +277,7 @@ void ExportTemplateManager::_install_from_file(const String &p_file) { //read unzOpenCurrentFile(pkg); - unzReadCurrentFile(pkg, data.ptr(), data.size()); + unzReadCurrentFile(pkg, data.ptrw(), data.size()); unzCloseCurrentFile(pkg); print_line(fname); diff --git a/editor/fileserver/editor_file_server.cpp b/editor/fileserver/editor_file_server.cpp index fccf7c323c..ad035b48f3 100644 --- a/editor/fileserver/editor_file_server.cpp +++ b/editor/fileserver/editor_file_server.cpp @@ -31,7 +31,6 @@ #include "../editor_settings.h" #include "io/marshalls.h" -#include "io/marshalls.h" //#define DEBUG_PRINT(m_p) print_line(m_p) #define DEBUG_TIME(m_what) printf("MS: %s - %lu\n", m_what, OS::get_singleton()->get_ticks_usec()); @@ -240,7 +239,7 @@ void EditorFileServer::_subthread_start(void *s) { cd->files[id]->seek(offset); Vector<uint8_t> buf; buf.resize(blocklen); - int read = cd->files[id]->get_buffer(buf.ptr(), blocklen); + int read = cd->files[id]->get_buffer(buf.ptrw(), blocklen); ERR_CONTINUE(read < 0); print_line("GET BLOCK - offset: " + itos(offset) + ", blocklen: " + itos(blocklen)); diff --git a/editor/import/editor_scene_importer_gltf.cpp b/editor/import/editor_scene_importer_gltf.cpp index 397bb6ad68..f704d97373 100644 --- a/editor/import/editor_scene_importer_gltf.cpp +++ b/editor/import/editor_scene_importer_gltf.cpp @@ -29,7 +29,7 @@ Error EditorSceneImporterGLTF::_parse_json(const String &p_path, GLTFState &stat Vector<uint8_t> array; array.resize(f->get_len()); - f->get_buffer(array.ptr(), array.size()); + f->get_buffer(array.ptrw(), array.size()); String text; text.parse_utf8((const char *)array.ptr(), array.size()); @@ -65,7 +65,7 @@ Error EditorSceneImporterGLTF::_parse_glb(const String &p_path, GLTFState &state ERR_FAIL_COND_V(chunk_type != 0x4E4F534A, ERR_PARSE_ERROR); //JSON Vector<uint8_t> json_data; json_data.resize(chunk_length); - uint32_t len = f->get_buffer(json_data.ptr(), chunk_length); + uint32_t len = f->get_buffer(json_data.ptrw(), chunk_length); ERR_FAIL_COND_V(len != chunk_length, ERR_FILE_CORRUPT); String text; @@ -94,7 +94,7 @@ Error EditorSceneImporterGLTF::_parse_glb(const String &p_path, GLTFState &state ERR_FAIL_COND_V(chunk_type != 0x004E4942, ERR_PARSE_ERROR); //BIN state.glb_data.resize(chunk_length); - len = f->get_buffer(state.glb_data.ptr(), chunk_length); + len = f->get_buffer(state.glb_data.ptrw(), chunk_length); ERR_FAIL_COND_V(len != chunk_length, ERR_FILE_CORRUPT); return OK; @@ -467,9 +467,10 @@ Error EditorSceneImporterGLTF::_decode_buffer_view(GLTFState &state, int p_buffe uint32_t offset = bv.byte_offset + byte_offset; Vector<uint8_t> buffer = state.buffers[bv.buffer]; //copy on write, so no performance hit + const uint8_t *bufptr = buffer.ptr(); //use to debug - print_line("type " + _get_type_name(type) + " component type: " + _get_component_type_name(component_type) + " stride: " + itos(stride) + " amount " + itos(count)); + //print_line("type " + _get_type_name(type) + " component type: " + _get_component_type_name(component_type) + " stride: " + itos(stride) + " amount " + itos(count)); print_line("accessor offset" + itos(byte_offset) + " view offset: " + itos(bv.byte_offset) + " total buffer len: " + itos(buffer.size()) + " view len " + itos(bv.byte_length)); int buffer_end = (stride * (count - 1)) + element_size; @@ -481,7 +482,7 @@ Error EditorSceneImporterGLTF::_decode_buffer_view(GLTFState &state, int p_buffe for (int i = 0; i < count; i++) { - const uint8_t *src = &buffer[offset + i * stride]; + const uint8_t *src = &bufptr[offset + i * stride]; for (int j = 0; j < component_count; j++) { @@ -605,7 +606,7 @@ Vector<double> EditorSceneImporterGLTF::_decode_accessor(GLTFState &state, int p Vector<double> dst_buffer; dst_buffer.resize(component_count * a.count); - double *dst = dst_buffer.ptr(); + double *dst = dst_buffer.ptrw(); if (a.buffer_view >= 0) { @@ -628,13 +629,13 @@ Vector<double> EditorSceneImporterGLTF::_decode_accessor(GLTFState &state, int p indices.resize(a.sparse_count); int indices_component_size = _get_component_type_size(a.sparse_indices_component_type); - Error err = _decode_buffer_view(state, a.sparse_indices_buffer_view, indices.ptr(), 0, 0, indices_component_size, a.sparse_count, TYPE_SCALAR, 1, a.sparse_indices_component_type, indices_component_size, false, a.sparse_indices_byte_offset, false); + Error err = _decode_buffer_view(state, a.sparse_indices_buffer_view, indices.ptrw(), 0, 0, indices_component_size, a.sparse_count, TYPE_SCALAR, 1, a.sparse_indices_component_type, indices_component_size, false, a.sparse_indices_byte_offset, false); if (err != OK) return Vector<double>(); Vector<double> data; data.resize(component_count * a.sparse_count); - err = _decode_buffer_view(state, a.sparse_values_buffer_view, data.ptr(), skip_every, skip_bytes, element_size, a.sparse_count, a.type, component_count, a.component_type, component_size, a.normalized, a.sparse_values_byte_offset, p_for_vertex); + err = _decode_buffer_view(state, a.sparse_values_buffer_view, data.ptrw(), skip_every, skip_bytes, element_size, a.sparse_count, a.type, component_count, a.component_type, component_size, a.normalized, a.sparse_values_byte_offset, p_for_vertex); if (err != OK) return Vector<double>(); @@ -813,6 +814,7 @@ Error EditorSceneImporterGLTF::_parse_meshes(GLTFState &state) { Array meshes = state.json["meshes"]; for (int i = 0; i < meshes.size(); i++) { + print_line("on mesh: " + itos(i)); Dictionary d = meshes[i]; GLTFMesh mesh; diff --git a/editor/plugins/navigation_mesh_generator.cpp b/editor/plugins/navigation_mesh_generator.cpp index 5d50e9c855..005a132e22 100644 --- a/editor/plugins/navigation_mesh_generator.cpp +++ b/editor/plugins/navigation_mesh_generator.cpp @@ -189,8 +189,8 @@ void NavigationMeshGenerator::_build_recast_navigation_mesh(Ref<NavigationMesh> ERR_FAIL_COND(tri_areas.size() == 0); - memset(tri_areas.ptr(), 0, ntris * sizeof(unsigned char)); - rcMarkWalkableTriangles(&ctx, cfg.walkableSlopeAngle, verts, nverts, tris, ntris, tri_areas.ptr()); + memset(tri_areas.ptrw(), 0, ntris * sizeof(unsigned char)); + rcMarkWalkableTriangles(&ctx, cfg.walkableSlopeAngle, verts, nverts, tris, ntris, tri_areas.ptrw()); ERR_FAIL_COND(!rcRasterizeTriangles(&ctx, verts, nverts, tris, tri_areas.ptr(), ntris, *hf, cfg.walkableClimb)); } diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index 16b85121ef..46c47d8656 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -383,7 +383,7 @@ private: //read unzOpenCurrentFile(pkg); - unzReadCurrentFile(pkg, data.ptr(), data.size()); + unzReadCurrentFile(pkg, data.ptrw(), data.size()); unzCloseCurrentFile(pkg); FileAccess *f = FileAccess::open(dir.plus_file(path), FileAccess::WRITE); |