Remove D3DXMath dependency (#686)

  • Konuyu Başlatan Konuyu Başlatan twostars
  • Başlangıç tarihi Başlangıç tarihi
  • Öne çıkan
T

twostars

Remove D3DXMath dependency (#686)

* Replace D3DXMath library behaviour with Wine-reimplemented logic.
Using something like DirectXMath or GLM is a little bit much for the extent of what's actually used. We'd only ever really get any useful performance benefit out of it in very niche external cases, but as-is, the copying and in GLM's case, additional transposing, doesn't really make the benefits all that worth it (even when they're mostly optimised out in release builds).

We can just let the compiler optimise it with the configured instruction set for now; it does a more than sufficient job of it.

* Decouple math types (__Vector2, __Vector3, __Vector3, __Quaternion, __Matrix44) from their D3DX types.
For the most part this just meant consistently using these types externally, though there's a few operators that we needed to implement that were used from the base struct (and really, we should just implement the full set of them, but whatever). Additionally, a few operators implemented for using the type as the right operand -- these I just swapped so it was the left operand.

The "big" one was __Matrix44 - this is passed to GetTransform() & SetTransform(), so we add toD3D() to cast appropriately for that. It's forward declared, so it should be fine to share with the server which won't know anything about that type.

* Remove __Matrix44's anonymous union; this is a non-standard extension which one of the compilers (can't remember if it was GCC or Clang) doesn't particularly like. This is the perfect chance to just reference it consistently so it's a nonissue in the future.

* Replace _D3DLIGHT9 with __D3DLight9 for nicer __Vector3 support. Add toD3D() to cast appropriately back to SetLight(), GetLight().

Github Commit Görüntüle...
See Commints...

..
 

Similar threads

K
Cevaplar
0
Görüntüleme
38
kenner2
K
T
Cevaplar
0
Görüntüleme
24
twostars
T
T
Cevaplar
0
Görüntüleme
22
twostars
T
T
Cevaplar
0
Görüntüleme
17
twostars
T
T
Cevaplar
0
Görüntüleme
39
twostars
T
Geri
Üst