Didn't even think of that. You're correct, if you use SetInt, and then GetFloat, you'll get the integer value back as a float, and not interpreted as one.
d3dx9_private.h should be useful as a reference, thanks for that.
If I shouldn't print the expected value, should I still print the returned value?
I'll get started on a v5 series soon. Thanks for the review.
On Tue, Feb 25, 2020 at 12:42 PM Matteo Bruni matteo.mystral@gmail.com wrote:
On Mon, Feb 17, 2020 at 10:22 PM Connor McAdams conmanx360@gmail.com wrote:
- f0->lpVtbl->SetFloat(f0, 5.0f);
- f0->lpVtbl->GetFloat(f0, &f0_ret);
- ok(f0_ret == 5.0f, "f0 is %f, expected %f.\n", f0_ret, 5.0f);
What happens if you call e.g. SetInt() here? Patch 2/6 suggests that it would "reinterpret" the value as a float rather than convert it (which is what happens in d3dx9 for example). Some quick testing suggests that d3d10 keeps the d3dx9 behavior, so the implementation should be updated accordingly. For reference you can look up set_number() in d3dx9_private.h.
Additional nitpicks: those calls could use an ok() check for the return value; don't print the expected value when it's obvious from the code + failed test line (like in this case).