Correct use of lround to the llmath ll_round

Isolate new function FSComInitialize to only be used on Windows.
meow-7.2.2
Beq 2017-07-04 23:14:06 +01:00
parent 41661b03a8
commit f7cff11024
2 changed files with 4 additions and 3 deletions

View File

@ -1198,7 +1198,7 @@ bool LLFloaterBvhPreview::validateLoopIn(const LLSD& data)
// <FS:Sei> FIRE-17277: Allow entering Loop In/Loop Out as frames
// <FS:Beq> FIRE-21330: (additional cleanup) make loop out round to an integer
// getChild<LLUICtrl>("loop_in_frames")->setValue(LLSD(loop_in_value / 100.f * (F32)mNumFrames));
getChild<LLUICtrl>("loop_in_frames")->setValue(LLSD(lround(loop_in_value / 100.f * (F32)mNumFrames)));
getChild<LLUICtrl>("loop_in_frames")->setValue(LLSD(ll_round(loop_in_value / 100.f * (F32)mNumFrames)));
// </FS:Beq>
// </FS:Sei>
return true;
@ -1232,7 +1232,7 @@ bool LLFloaterBvhPreview::validateLoopOut(const LLSD& data)
// <FS:Sei> FIRE-17277: Allow entering Loop In/Loop Out as frames
// <FS:Beq> FIRE-21330: (additional cleanup) make loop out round to an integer
// getChild<LLUICtrl>("loop_out_frames")->setValue(LLSD(loop_out_value / 100.f * (F32)mNumFrames));
getChild<LLUICtrl>("loop_out_frames")->setValue(LLSD(lround(loop_out_value / 100.f * (F32)mNumFrames)));
getChild<LLUICtrl>("loop_out_frames")->setValue(LLSD(ll_round(loop_out_value / 100.f * (F32)mNumFrames)));
// </FS:Beq>
// </FS:Sei>
return true;

View File

@ -37,6 +37,7 @@ using namespace std;
unsigned char static_unique_id[] = {0,0,0,0,0,0};
bool static has_static_unique_id = false;
#if LL_WINDOWS
class FSComInitialize
{
HRESULT mHR;
@ -54,7 +55,7 @@ public:
CoUninitialize();
}
};
#endif
// get an unique machine id.
// NOT THREAD SAFE - do before setting up threads.
// MAC Address doesn't work for Windows 7 since the first returned hardware MAC address changes with each reboot, Go figure??