mirror of
https://github.com/SourMesen/Mesen2.git
synced 2024-06-22 22:22:51 -04:00
NES: HD Packs - Fixed display issues (transparency, missing tiles)
This commit is contained in:
parent
90ae21e1ac
commit
ace23978f7
|
@ -318,7 +318,7 @@ public:
|
|||
uint32_t* pngData = Bitmap->PixelData.data();
|
||||
|
||||
HdTileData.resize(Width * Height);
|
||||
if(Bitmap->PixelData.size() >= bitmapOffset + (Height * Bitmap->Width) + Width) {
|
||||
if(Bitmap->PixelData.size() >= bitmapOffset + ((Height - 1) * Bitmap->Width) + Width) {
|
||||
for(uint32_t y = 0; y < Height; y++) {
|
||||
memcpy(HdTileData.data() + (y * Width), pngData + bitmapOffset, Width * sizeof(uint32_t));
|
||||
bitmapOffset += Bitmap->Width;
|
||||
|
|
|
@ -156,6 +156,10 @@ void HdNesPack::OnLineStart(HdPpuPixelInfo &lineFirstPixel, uint8_t y)
|
|||
for(int layer = 0; layer < 4; layer++) {
|
||||
for(int i = 0; i < _activeBgCount[layer]; i++) {
|
||||
HdBgConfig& cfg = _bgConfig[layer * HdNesPack::PriorityLevelsPerLayer + i];
|
||||
if(cfg.BackgroundIndex < 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
HdBackgroundInfo& bgInfo = _hdData->Backgrounds[cfg.BackgroundIndex];
|
||||
bgInfo.Data->Init();
|
||||
|
||||
|
|
|
@ -237,6 +237,7 @@ bool HdPackLoader::ProcessImgTag(string src)
|
|||
MessageManager::Log("[HDPack] Error loading HDPack: PNG file " + src + " could not be read.");
|
||||
return false;
|
||||
}
|
||||
bitmapInfo.PngName = src;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -138,7 +138,7 @@ int PNGHelper::DecodePNG(vector<T>& out_image, unsigned long& image_width, unsig
|
|||
|
||||
out_image.resize(out_size / sizeof(T));
|
||||
|
||||
if((r = spng_decode_image(ctx, (unsigned char*)out_image.data(), out_size, fmt, 0))) {
|
||||
if((r = spng_decode_image(ctx, (unsigned char*)out_image.data(), out_size, fmt, SPNG_DECODE_TRNS))) {
|
||||
spng_ctx_free(ctx);
|
||||
return r;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue