mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-04 16:32:39 +00:00
Put extern variable in dedicated namespace
This commit is contained in:
parent
dda7d5ca3a
commit
f4239c5b63
@ -26,7 +26,9 @@
|
||||
#include "common/discord_rpc_handler.h"
|
||||
#endif
|
||||
|
||||
bool isGameRunning = false;
|
||||
namespace QtExternal {
|
||||
static bool isGameRunning = false;
|
||||
}
|
||||
|
||||
MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent), ui(new Ui::MainWindow) {
|
||||
ui->setupUi(this);
|
||||
@ -554,7 +556,9 @@ void MainWindow::CreateConnects() {
|
||||
}
|
||||
|
||||
void MainWindow::StartGame() {
|
||||
isGameRunning = true;
|
||||
using namespace QtExternal;
|
||||
QtExternal::isGameRunning = true;
|
||||
|
||||
BackgroundMusicPlayer::getInstance().stopMusic();
|
||||
QString gamePath = "";
|
||||
int table_mode = Config::getTableMode();
|
||||
|
@ -22,7 +22,10 @@
|
||||
#include "main_window_ui.h"
|
||||
#include "pkg_viewer.h"
|
||||
|
||||
extern bool isGameRunning;
|
||||
namespace QtExternal {
|
||||
extern bool isGameRunning;
|
||||
}
|
||||
|
||||
class GameListFrame;
|
||||
|
||||
class MainWindow : public QMainWindow {
|
||||
|
@ -376,11 +376,12 @@ void SettingsDialog::OnCursorStateChanged(s16 index) {
|
||||
}
|
||||
|
||||
void SettingsDialog::GammaSliderChange(int value) {
|
||||
using namespace QtExternal;
|
||||
float Gammafloat = static_cast<float>((value / 1000.0f));
|
||||
ui->GammaLabel->setText(QString::number(Gammafloat, 'f', 3));
|
||||
|
||||
// presenter crashes if game is running, set isGameRunning to off when stop game is implemented
|
||||
if (isGameRunning) {
|
||||
// GetGammaRef crashes if no game is running, set isGameRunning to false when MainWindow::StopGame is implemented
|
||||
if (QtExternal::isGameRunning) {
|
||||
presenter->GetGammaRef() = Gammafloat;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user