Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Review Arena::RenderObjectsPass #12

Closed
Tracked by #20
ForNeVeR opened this issue Jun 24, 2023 · 0 comments · Fixed by #66
Closed
Tracked by #20

Review Arena::RenderObjectsPass #12

ForNeVeR opened this issue Jun 24, 2023 · 0 comments · Fixed by #66
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@ForNeVeR
Copy link
Owner

ForNeVeR commented Jun 24, 2023

See // TODO[#12]: in the original code, there was a call

Direct3D.d3dd.SetStreamSource(0, Shadow.vertices, 0)

Which seemingly calculated the size of vertex type instance under the covers:

// (decompiled)
if (streamData != null)
  num = streamData.TypeSize;
// ISSUE: cast to a function pointer type
// ISSUE: function pointer call
int resultCode = __calli((__FnPtr<int (int, uint, IDirect3DVertexBuffer9*, uint, uint)>) *(int*) (*(int*) this.m_lpUM + 400))((uint) this.m_lpUM, (uint) streamNumber, lpUm, (uint) offsetInBytes, num);

But now, there's another call:

Direct3D.d3dd.SetStreamSource(0, Shadow.vertices, 0, Shadow.vertices.Description.SizeInBytes);

Is this SizeInBytes size of one vertex item or the whole buffer?

@ForNeVeR ForNeVeR added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Jun 24, 2023
KeterSCP added a commit to KeterSCP/bloodmasters that referenced this issue Jul 24, 2023
KeterSCP added a commit to KeterSCP/bloodmasters that referenced this issue Jul 24, 2023
ForNeVeR added a commit to KeterSCP/bloodmasters that referenced this issue Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant