Hooked up OpenGL linear filtering enable function to Qt video config checkbox.
This commit is contained in:
parent
ce2afe23e1
commit
1c0d999033
|
@ -7,6 +7,7 @@
|
|||
#include "Qt/dface.h"
|
||||
#include "Qt/config.h"
|
||||
#include "Qt/fceuWrapper.h"
|
||||
#include "Qt/ConsoleWindow.h"
|
||||
#include "Qt/ConsoleVideoConf.h"
|
||||
|
||||
//----------------------------------------------------
|
||||
|
@ -42,6 +43,8 @@ ConsoleVideoConfDialog_t::ConsoleVideoConfDialog_t(QWidget *parent)
|
|||
|
||||
setCheckBoxFromProperty( gl_LF_chkBox , "SDL.OpenGLip");
|
||||
|
||||
connect(gl_LF_chkBox , SIGNAL(stateChanged(int)), this, SLOT(openGL_linearFilterChanged(int)) );
|
||||
|
||||
main_vbox->addWidget( gl_LF_chkBox );
|
||||
|
||||
// Region Select
|
||||
|
@ -164,6 +167,21 @@ void ConsoleVideoConfDialog_t::setComboBoxFromProperty( QComboBox *cbx, const c
|
|||
}
|
||||
}
|
||||
//----------------------------------------------------
|
||||
void ConsoleVideoConfDialog_t::openGL_linearFilterChanged( int value )
|
||||
{
|
||||
bool opt = (value != Qt::Unchecked);
|
||||
g_config->setOption("SDL.OpenGLip", opt );
|
||||
g_config->save ();
|
||||
|
||||
if ( consoleWindow != NULL )
|
||||
{
|
||||
if ( consoleWindow->viewport_GL )
|
||||
{
|
||||
consoleWindow->viewport_GL->setLinearFilterEnable( opt );
|
||||
}
|
||||
}
|
||||
}
|
||||
//----------------------------------------------------
|
||||
void ConsoleVideoConfDialog_t::use_new_PPU_changed( int value )
|
||||
{
|
||||
//printf("Value:%i \n", value );
|
||||
|
|
|
@ -46,6 +46,7 @@ class ConsoleVideoConfDialog_t : public QDialog
|
|||
void closeWindow(void);
|
||||
|
||||
private slots:
|
||||
void openGL_linearFilterChanged( int value );
|
||||
void use_new_PPU_changed( int value );
|
||||
void frameskip_changed( int value );
|
||||
void useSpriteLimitChanged( int value );
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include <QScreen>
|
||||
|
||||
#include "Qt/nes_shm.h"
|
||||
#include "Qt/fceuWrapper.h"
|
||||
#include "Qt/ConsoleViewerGL.h"
|
||||
|
||||
extern unsigned int gui_draw_area_width;
|
||||
|
@ -38,6 +39,14 @@ ConsoleViewGL_t::ConsoleViewGL_t(QWidget *parent)
|
|||
{
|
||||
memset( localBuf, 0, localBufSize );
|
||||
}
|
||||
|
||||
if ( g_config )
|
||||
{
|
||||
int opt;
|
||||
g_config->getOption("SDL.OpenGLip", &opt );
|
||||
|
||||
linearFilter = (opt) ? true : false;
|
||||
}
|
||||
}
|
||||
|
||||
ConsoleViewGL_t::~ConsoleViewGL_t(void)
|
||||
|
@ -122,6 +131,13 @@ void ConsoleViewGL_t::resizeGL(int w, int h)
|
|||
buildTextures();
|
||||
}
|
||||
|
||||
void ConsoleViewGL_t::setLinearFilterEnable( bool ena )
|
||||
{
|
||||
linearFilter = ena;
|
||||
|
||||
buildTextures();
|
||||
}
|
||||
|
||||
void ConsoleViewGL_t::transfer2LocalBuffer(void)
|
||||
{
|
||||
memcpy( localBuf, nes_shm->pixbuf, localBufSize );
|
||||
|
|
|
@ -20,6 +20,8 @@ class ConsoleViewGL_t : public QOpenGLWidget, protected QOpenGLFunctions
|
|||
|
||||
void transfer2LocalBuffer(void);
|
||||
|
||||
void setLinearFilterEnable( bool ena );
|
||||
|
||||
protected:
|
||||
void initializeGL(void);
|
||||
void resizeGL(int w, int h);
|
||||
|
|
|
@ -221,7 +221,7 @@ InitConfig()
|
|||
|
||||
// OpenGL options
|
||||
config->addOption("opengl", "SDL.OpenGL", 1);
|
||||
config->addOption("openglip", "SDL.OpenGLip", 1);
|
||||
config->addOption("openglip", "SDL.OpenGLip", 0);
|
||||
config->addOption("SDL.SpecialFilter", 0);
|
||||
config->addOption("SDL.SpecialFX", 0);
|
||||
config->addOption("SDL.Vsync", 1);
|
||||
|
|
Loading…
Reference in New Issue