mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-18 11:19:10 +00:00
Merge pull request #373 from Hoikas/linking-perf
Low-Hanging Linking Performance
This commit is contained in:
@ -1279,19 +1279,28 @@ void plClient::IProgressMgrCallbackProc(plOperationProgress * progress)
|
|||||||
|
|
||||||
// Increments the taskbar progress [Windows 7+]
|
// Increments the taskbar progress [Windows 7+]
|
||||||
#ifdef HS_BUILD_FOR_WIN32
|
#ifdef HS_BUILD_FOR_WIN32
|
||||||
if (gTaskbarList)
|
if (gTaskbarList && fInstance->GetWindowHandle())
|
||||||
{
|
{
|
||||||
HWND hwnd = fInstance->GetWindowHandle(); // lazy
|
static TBPFLAG lastState = TBPF_NOPROGRESS;
|
||||||
|
TBPFLAG myState;
|
||||||
|
|
||||||
|
// So, calling making these kernel calls is kind of SLOW. So, let's
|
||||||
|
// hide that behind a userland check--this helps linking go faster!
|
||||||
if (progress->IsAborting())
|
if (progress->IsAborting())
|
||||||
// We'll assume this is fatal
|
myState = TBPF_ERROR;
|
||||||
gTaskbarList->SetProgressState(hwnd, TBPF_ERROR);
|
|
||||||
else if (progress->IsLastUpdate())
|
else if (progress->IsLastUpdate())
|
||||||
gTaskbarList->SetProgressState(hwnd, TBPF_NOPROGRESS);
|
myState = TBPF_NOPROGRESS;
|
||||||
else if (progress->GetMax() == 0.f)
|
else if (progress->GetMax() == 0.f)
|
||||||
gTaskbarList->SetProgressState(hwnd, TBPF_INDETERMINATE);
|
myState = TBPF_INDETERMINATE;
|
||||||
else
|
else
|
||||||
// This will set TBPF_NORMAL for us
|
myState = TBPF_NORMAL;
|
||||||
gTaskbarList->SetProgressValue(hwnd, (ULONGLONG)progress->GetProgress(), (ULONGLONG)progress->GetMax());
|
|
||||||
|
if (myState == TBPF_NORMAL)
|
||||||
|
// This sets us to TBPF_NORMAL
|
||||||
|
gTaskbarList->SetProgressValue(fInstance->GetWindowHandle(), (ULONGLONG)progress->GetProgress(), (ULONGLONG)progress->GetMax());
|
||||||
|
else if (myState != lastState)
|
||||||
|
gTaskbarList->SetProgressState(fInstance->GetWindowHandle(), myState);
|
||||||
|
lastState = myState;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -204,16 +204,6 @@ plKey &plKey::operator=( const plKey &rhs )
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool plKey::operator==( const plKey &rhs ) const
|
|
||||||
{
|
|
||||||
return fKeyData == rhs.fKeyData;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool plKey::operator==( const plKeyData *rhs ) const
|
|
||||||
{
|
|
||||||
return fKeyData == rhs;
|
|
||||||
}
|
|
||||||
|
|
||||||
plKeyData *plKey::operator->() const
|
plKeyData *plKey::operator->() const
|
||||||
{
|
{
|
||||||
return fKeyData;
|
return fKeyData;
|
||||||
|
@ -67,8 +67,8 @@ public:
|
|||||||
~plKey();
|
~plKey();
|
||||||
plKey& operator=(const plKey& rhs);
|
plKey& operator=(const plKey& rhs);
|
||||||
|
|
||||||
bool operator==(const plKey& rhs) const;
|
bool operator==(const plKey& rhs) const { return fKeyData == rhs.fKeyData; }
|
||||||
bool operator==(const plKeyData* rhs) const;
|
bool operator==(const plKeyData* rhs) const { return fKeyData == rhs; }
|
||||||
bool operator!=(const plKey& rhs) const { return !(*this == rhs); }
|
bool operator!=(const plKey& rhs) const { return !(*this == rhs); }
|
||||||
bool operator!=(const plKeyData* rhs) const { return !(*this == rhs); }
|
bool operator!=(const plKeyData* rhs) const { return !(*this == rhs); }
|
||||||
|
|
||||||
|
@ -169,9 +169,11 @@ bool plRegistryKeyList::SetKeyUnused(plKeyImp* key, LoadStatus& loadStatusChange
|
|||||||
// Fixed Keys use ID == 0
|
// Fixed Keys use ID == 0
|
||||||
if (id == 0)
|
if (id == 0)
|
||||||
hsAssert(key->GetUoid().GetLocation() == plLocation::kGlobalFixedLoc, "key id == 0 but not fixed?");
|
hsAssert(key->GetUoid().GetLocation() == plLocation::kGlobalFixedLoc, "key id == 0 but not fixed?");
|
||||||
else if (id < fKeys.size()) {
|
|
||||||
if (fKeys[id]->GetUoid().GetObjectID() == id)
|
// Recall that vectors are index zero but normal object IDs are index one...
|
||||||
foundKey = fKeys[id];
|
else if (id <= fKeys.size()) {
|
||||||
|
if (fKeys[id-1]->GetUoid().GetObjectID() == id)
|
||||||
|
foundKey = fKeys[id-1];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Last chance: do a slow name search for that key.
|
// Last chance: do a slow name search for that key.
|
||||||
|
Reference in New Issue
Block a user