mirror of
https://github.com/devinacker/bsnes-plus.git
synced 2024-05-15 02:39:51 -04:00
fix up a few long-standing display quirks:
- don't clear the display when toggling fullscreen - clear the overscan area when disabling overscan (for PAL window sizes) - always actively draw to the display even when no cart is loaded, rather than relying on the blank canvas widget to always get drawn correctly - properly clear some video drivers' buffer (e.g. OpenGL) on startup
This commit is contained in:
parent
f924b82771
commit
a632b50acc
|
@ -43,6 +43,7 @@ public:
|
|||
iheight = max(height, iheight);
|
||||
if(buffer) delete[] buffer;
|
||||
buffer = new uint32_t[iwidth * iheight];
|
||||
clear();
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, gltexture);
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, iwidth);
|
||||
|
|
|
@ -50,6 +50,7 @@ public:
|
|||
SDL_SWSURFACE, iwidth, iheight, 32,
|
||||
0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000
|
||||
);
|
||||
clear();
|
||||
}
|
||||
|
||||
bool lock(uint32_t *&data, unsigned &pitch, unsigned width, unsigned height) {
|
||||
|
|
|
@ -102,10 +102,12 @@ void PPU::scanline() {
|
|||
}
|
||||
|
||||
void PPU::render_scanline() {
|
||||
if(framecounter) return;
|
||||
if(line >= 1 && line < (!overscan() ? 225 : 240)) {
|
||||
if(framecounter) return;
|
||||
render_line_oam_rto();
|
||||
render_line();
|
||||
} else if(line >= 1 && line < 240) {
|
||||
render_line_clear();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -144,6 +144,8 @@ void PPU::frame() {
|
|||
oam.frame();
|
||||
|
||||
display.interlace = regs.interlace;
|
||||
if (display.overscan && !regs.overscan)
|
||||
memset(output + 225 * 1024, 0, 15 * 1024 * sizeof(uint16));
|
||||
display.overscan = regs.overscan;
|
||||
}
|
||||
|
||||
|
|
|
@ -724,9 +724,7 @@ void CanvasObject::mouseMoveEvent(QMouseEvent *event) {
|
|||
//custom video render and mouse capture functionality
|
||||
|
||||
QPaintEngine* CanvasWidget::paintEngine() const {
|
||||
if(SNES::cartridge.loaded()) {
|
||||
video.refresh();
|
||||
}
|
||||
video.refresh();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -104,7 +104,7 @@ void Utility::modifySystemState(system_state_t systemState) {
|
|||
|
||||
if(!application.power) unacquireMouse();
|
||||
|
||||
// don't let widget updates temporarily draw a parent widget over an external rendering contex
|
||||
// don't let widget updates temporarily draw a parent widget over an external rendering context
|
||||
// (only applies when the system is powered on)
|
||||
mainWindow->canvas->setUpdatesEnabled(!application.power || video.cap("QWidget"));
|
||||
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
void Utility::updateFullscreenState() {
|
||||
video.clear();
|
||||
|
||||
if(config().video.isFullscreen == false) {
|
||||
config().video.context = &config().video.windowed;
|
||||
mainWindow->showNormal();
|
||||
|
|
Loading…
Reference in a new issue