Cleaning up and making the debugger resize well

This commit is contained in:
Anonymus Raccoon
2020-02-16 22:54:43 +01:00
parent 2f1c53a92d
commit 74045c0d99
7 changed files with 141 additions and 214 deletions

View File

@@ -16,14 +16,17 @@
namespace ComSquare::Renderer
{
QtSFML::QtSFML(unsigned int h, unsigned int w) :
QtWindow(h, w), _sfWidget(nullptr)
{ }
_window(), _sfWidget(nullptr)
{
this->_window.resize(w, h);
}
void QtSFML::createWindow(SNES &snes, int maxFPS)
{
this->setWindowName(snes.cartridge->header.gameName);
this->_sfWidget = std::make_unique<QtFullSFML>(snes, &_frame, QPoint(0, 0), QSize(this->_width, this->_height), maxFPS);
this->_sfWidget->show();
this->_sfWidget = std::make_unique<QtFullSFML>(snes, &_window, QPoint(0, 0), QSize(this->_window.width(), this->_window.height()), maxFPS);
this->_sfWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
this->_window.show();
}
void QtSFML::putPixel(unsigned y, unsigned x, uint32_t rgba)
@@ -35,7 +38,7 @@ namespace ComSquare::Renderer
void QtSFML::setWindowName(std::string &newWindowName)
{
QtWindow::setWindowName(newWindowName);
this->_window.setWindowTitle((newWindowName + " - ComSquare").c_str());
}
QtFullSFML::QtFullSFML(SNES &snes, QWidget *parent, const QPoint &position, const QSize &size, int frameRate) :