mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user