Fix HD tile default not used even when the tile found has failed the condition test
This commit is contained in:
parent
4081170646
commit
32185c5b59
1 changed files with 14 additions and 3 deletions
|
@ -332,9 +332,6 @@ HdPackTileInfo* HdNesPack::GetCachedMatchingTile(uint32_t x, uint32_t y, HdPpuTi
|
|||
HdPackTileInfo* HdNesPack::GetMatchingTile(uint32_t x, uint32_t y, HdPpuTileInfo* tile, bool* disableCache)
|
||||
{
|
||||
auto hdTile = _hdData->TileByKey.find(*tile);
|
||||
if(hdTile == _hdData->TileByKey.end()) {
|
||||
hdTile = _hdData->TileByKey.find(tile->GetKey(true));
|
||||
}
|
||||
|
||||
if(hdTile != _hdData->TileByKey.end()) {
|
||||
for(HdPackTileInfo* hdPackTile : hdTile->second) {
|
||||
|
@ -348,6 +345,20 @@ HdPackTileInfo* HdNesPack::GetMatchingTile(uint32_t x, uint32_t y, HdPpuTileInfo
|
|||
}
|
||||
}
|
||||
|
||||
//repeat with default if not found
|
||||
hdTile = _hdData->TileByKey.find(tile->GetKey(true));
|
||||
if (hdTile != _hdData->TileByKey.end()) {
|
||||
for (HdPackTileInfo* hdPackTile : hdTile->second) {
|
||||
if (disableCache != nullptr && hdPackTile->ForceDisableCache) {
|
||||
*disableCache = true;
|
||||
}
|
||||
|
||||
if (hdPackTile->MatchesCondition(_hdScreenInfo, x, y, tile)) {
|
||||
return hdPackTile;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue