Fix integer vector mul/div operators and bindings.

* Vector2i and Vector3i mul/div by a float results in Vector2 and Vector3 respectively.
* Create specializations to allow proper bindings.

This fixes #44408 and supersedes #44441 and keeps the same rule of int <op> float returnig float, like with scalars.
This commit is contained in:
reduz
2022-02-03 22:16:58 +01:00
committed by Rémi Verschelde
parent fd0d2dcabf
commit 8c7268664d
9 changed files with 188 additions and 46 deletions

View File

@@ -140,4 +140,16 @@ struct AudioFrame {
_ALWAYS_INLINE_ AudioFrame() {}
};
_ALWAYS_INLINE_ AudioFrame operator*(float p_scalar, const AudioFrame &p_frame) {
return AudioFrame(p_frame.l * p_scalar, p_frame.r * p_scalar);
}
_ALWAYS_INLINE_ AudioFrame operator*(int32_t p_scalar, const AudioFrame &p_frame) {
return AudioFrame(p_frame.l * p_scalar, p_frame.r * p_scalar);
}
_ALWAYS_INLINE_ AudioFrame operator*(int64_t p_scalar, const AudioFrame &p_frame) {
return AudioFrame(p_frame.l * p_scalar, p_frame.r * p_scalar);
}
#endif // AUDIO_FRAME_H