Browse code

Move muldiv7 to SSEQPlayer's common.h.

(Basically I was using the same function in 2 files and why do that when I could make it a common thing.)

Naram Qashat authored on 2021/04/07 23:52:06
Showing 3 changed files
... ...
@@ -129,6 +129,11 @@ template<std::size_t N> inline bool VerifyHeader(std::int8_t (&arr)[N], const st
129 129
 	return arrHeader == header;
130 130
 }
131 131
 
132
+inline std::int32_t muldiv7(std::int32_t val, std::uint8_t mul)
133
+{
134
+	return mul == 127 ? val : ((val * mul) >> 7);
135
+}
136
+
132 137
 /*
133 138
  * The remaining functions in this file come from the FeOS Sound System source code.
134 139
  */
... ...
@@ -231,11 +231,6 @@ static inline void ProgressSetPosImmediate(HWND hDlg, int nIDDlgItem, int nPos)
231 231
 	}
232 232
 }
233 233
 
234
-static inline std::int32_t muldiv7(std::int32_t val, std::uint8_t mul)
235
-{
236
-	return mul == 127 ? val : ((val * mul) >> 7);
237
-}
238
-
239 234
 void XSFConfig_NCSF::RefreshSoundView()
240 235
 {
241 236
 	auto player = this->soundViewData->player;
... ...
@@ -156,11 +156,6 @@ bool XSFPlayer_NCSF::Load()
156 156
 	return XSFPlayer::Load();
157 157
 }
158 158
 
159
-static inline std::int32_t muldiv7(std::int32_t val, std::uint8_t mul)
160
-{
161
-	return mul == 127 ? val : ((val * mul) >> 7);
162
-}
163
-
164 159
 void XSFPlayer_NCSF::GenerateSamples(std::vector<std::uint8_t> &buf, unsigned offset, unsigned samples)
165 160
 {
166 161
 	unsigned long mute = this->mutes.to_ulong();