-
Notifications
You must be signed in to change notification settings - Fork 652
Closed
Description
Would you like to wrap any pointers with the class template “std::unique_ptr”?
Update candidates:
JoltPhysics/Jolt/Renderer/DebugRendererPlayback.cpp
Lines 49 to 61 in cb2cbee
DebugRenderer::Vertex *vertices = new DebugRenderer::Vertex [vertex_count]; inStream.ReadBytes(vertices, vertex_count * sizeof(DebugRenderer::Vertex)); uint32 index_count; inStream.Read(index_count); uint32 *indices = new uint32 [index_count]; inStream.ReadBytes(indices, index_count * sizeof(uint32)); mBatches.insert({ id, mRenderer.CreateTriangleBatch(vertices, vertex_count, indices, index_count) }); delete [] indices; delete [] vertices; JoltPhysics/TestFramework/Image/LoadTGA.cpp
Lines 79 to 103 in cb2cbee
uint8 *palette = new uint8 [pal_bytes]; inStream.read((char *)palette, pal_bytes); loaded = loaded && !inStream.fail(); // Convert pixel data to a surface surface = new SoftwareSurface(header.mWidth, header.mHeight, format); surface->Lock(ESurfaceLockMode::Write); uint8 *scan_line = new uint8 [scan_width]; for (int y = header.mHeight - 1; y >= 0; --y) { // Load one scan line inStream.read((char *)scan_line, scan_width); loaded = loaded && !inStream.fail(); // Copy one scan line uint8 *in_pixel = scan_line; uint8 *out_pixel = (uint8 *)surface->GetScanLine(y); for (int x = 0; x < header.mWidth; ++x, ++in_pixel, out_pixel += pixel_size) memcpy(out_pixel, palette + (*in_pixel - header.mColorMapFirstEntryIndex) * pixel_size, pixel_size); } surface->UnLock(); // Release temporaries delete [] palette; delete [] scan_line;
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels