Skip to content

Commit

Permalink
remove misleading comment
Browse files Browse the repository at this point in the history
  • Loading branch information
DubbleClick committed Aug 31, 2024
1 parent d7fcbb7 commit ad85885
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions GWToolboxdll/Widgets/Minimap/GameWorldRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,16 +144,16 @@ namespace {
poly.vb = nullptr;
return false;
}
void* mem_loc = nullptr;
// map the vertex buffer memory and write vertices to it.

// map the vertex buffer memory and write vertices to it.
void* mem_loc = nullptr;
res = poly.vb->Lock(0, vertices.size() * sizeof(D3DVertex), &mem_loc, D3DLOCK_DISCARD);
if (!(res == S_OK && mem_loc)) {
if (res != S_OK || !mem_loc) {
poly.vb->Release();
poly.vb = nullptr;
return false;
}
// this should avoid an invalid memcpy, if locking fails for some reason

memcpy(mem_loc, vertices.data(), vertices.size() * sizeof(D3DVertex));
poly.vb->Unlock();
return true;
Expand Down

0 comments on commit ad85885

Please sign in to comment.