mirror of https://github.com/stella-emu/stella.git
Clear intermediate texture before blitting.
This commit is contained in:
parent
f6eb86b9bb
commit
e3dc861932
|
@ -23,6 +23,7 @@
|
||||||
"tuple": "cpp",
|
"tuple": "cpp",
|
||||||
"utility": "cpp",
|
"utility": "cpp",
|
||||||
"*.tcc": "cpp",
|
"*.tcc": "cpp",
|
||||||
"functional": "cpp"
|
"functional": "cpp",
|
||||||
|
"iomanip": "cpp"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -106,6 +106,8 @@ void HqBlitter::blitToIntermediate()
|
||||||
SDL_Rect r = mySrcRect;
|
SDL_Rect r = mySrcRect;
|
||||||
r.x = r.y = 0;
|
r.x = r.y = 0;
|
||||||
|
|
||||||
|
SDL_UpdateTexture(myIntermediateTexture, nullptr, myBlankBuffer.get(), 4 * myIntermediateRect.w);
|
||||||
|
|
||||||
SDL_SetRenderTarget(myFB.renderer(), myIntermediateTexture);
|
SDL_SetRenderTarget(myFB.renderer(), myIntermediateTexture);
|
||||||
SDL_RenderCopy(myFB.renderer(), mySrcTexture, &r, &myIntermediateRect);
|
SDL_RenderCopy(myFB.renderer(), mySrcTexture, &r, &myIntermediateRect);
|
||||||
|
|
||||||
|
@ -138,6 +140,9 @@ void HqBlitter::recreateTexturesIfNecessary()
|
||||||
mySrcTexture = SDL_CreateTexture(myFB.renderer(), myFB.pixelFormat().format,
|
mySrcTexture = SDL_CreateTexture(myFB.renderer(), myFB.pixelFormat().format,
|
||||||
texAccess, mySrcRect.w, mySrcRect.h);
|
texAccess, mySrcRect.w, mySrcRect.h);
|
||||||
|
|
||||||
|
myBlankBuffer = make_unique<uInt32[]>(4 * myIntermediateRect.w * myIntermediateRect.h);
|
||||||
|
memset(myBlankBuffer.get(), 0, 4 * myIntermediateRect.w * myIntermediateRect.h);
|
||||||
|
|
||||||
SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, myAttributes.smoothing ? "1" : "0");
|
SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, myAttributes.smoothing ? "1" : "0");
|
||||||
|
|
||||||
myIntermediateTexture = SDL_CreateTexture(myFB.renderer(), myFB.pixelFormat().format,
|
myIntermediateTexture = SDL_CreateTexture(myFB.renderer(), myFB.pixelFormat().format,
|
||||||
|
|
|
@ -54,6 +54,7 @@ class HqBlitter : public Blitter {
|
||||||
bool myRecreateTextures;
|
bool myRecreateTextures;
|
||||||
|
|
||||||
SDL_Surface* myStaticData;
|
SDL_Surface* myStaticData;
|
||||||
|
unique_ptr<uInt32[]> myBlankBuffer;
|
||||||
|
|
||||||
FrameBufferSDL2& myFB;
|
FrameBufferSDL2& myFB;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue