mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Address a round of feedback
This commit is contained in:
parent
f32d0c2d69
commit
d95cd73c2c
3 changed files with 12 additions and 5 deletions
|
@ -88,18 +88,24 @@ private:
|
|||
bool ReplacedTexture::IsReady(double budget) {
|
||||
_assert_(vfs_ != nullptr);
|
||||
|
||||
double now = time_now_d();
|
||||
|
||||
switch (State()) {
|
||||
case ReplacementState::ACTIVE:
|
||||
case ReplacementState::NOT_FOUND:
|
||||
if (threadWaitable_) {
|
||||
if (!threadWaitable_->WaitFor(budget)) {
|
||||
lastUsed_ = now;
|
||||
return false;
|
||||
}
|
||||
// Successfully waited! Can get rid of it.
|
||||
threadWaitable_->WaitAndRelease();
|
||||
threadWaitable_ = nullptr;
|
||||
if (levelData_) {
|
||||
levelData_->lastUsed = now;
|
||||
}
|
||||
}
|
||||
lastUsed_ = time_now_d();
|
||||
lastUsed_ = now;
|
||||
return true;
|
||||
case ReplacementState::UNINITIALIZED:
|
||||
// _dbg_assert_(false);
|
||||
|
@ -112,7 +118,7 @@ bool ReplacedTexture::IsReady(double budget) {
|
|||
break;
|
||||
}
|
||||
|
||||
lastUsed_ = time_now_d();
|
||||
lastUsed_ = now;
|
||||
|
||||
// Let's not even start a new texture if we're already behind.
|
||||
if (budget < 0.0)
|
||||
|
|
|
@ -1514,7 +1514,7 @@ ReplacedTexture *TextureCacheCommon::FindReplacement(TexCacheEntry *entry, int &
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
if ((entry->status & TexCacheEntry::STATUS_VIDEO) && replacer_.AllowVideo()) {
|
||||
if ((entry->status & TexCacheEntry::STATUS_VIDEO) && !replacer_.AllowVideo()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
|
|
@ -216,8 +216,6 @@ bool TextureReplacer::LoadIniValues(IniFile &ini, bool isOverride) {
|
|||
|
||||
bool filenameWarning = false;
|
||||
if (ini.HasSection("hashes")) {
|
||||
aliases_.clear();
|
||||
|
||||
auto hashes = ini.GetOrCreateSection("hashes")->ToMap();
|
||||
// Format: hashname = filename.png
|
||||
bool checkFilenames = g_Config.bSaveNewTextures && !g_Config.bIgnoreTextureFilenames && !vfsIsZip_;
|
||||
|
@ -693,6 +691,9 @@ void TextureReplacer::NotifyTextureDecoded(const ReplacedTextureDecodeInfo &repl
|
|||
#endif
|
||||
if (slash != hashfile.npos) {
|
||||
// Does this ever happen?
|
||||
// Answer: An alias could be used to save a texture in a subfolder of newTextureDir_
|
||||
// (i.e. if you had the hash and purged out your pngs to redump them), although I guess this usage is probably uncommon. - unknown
|
||||
|
||||
// Create any directory structure as needed.
|
||||
task->saveDirectory = newTextureDir_ / hashfile.substr(0, slash);
|
||||
task->createSaveDirectory = true;
|
||||
|
|
Loading…
Add table
Reference in a new issue