diff options
author | Jesse Talavera-Greenberg <jesse@jesse.tg> | 2023-11-25 12:32:09 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-25 18:32:09 +0100 |
commit | 346dd4006ea1283136095d5c43f602324a095092 (patch) | |
tree | edf04631782bbfcdb48eac79b79aebb11b40f479 /src/frontend | |
parent | 651b0f680c4531558990a5beb0e638968009dc51 (diff) |
Move all core types into namespaces (#1886)
* Reorganize namespaces
- Most types are now moved into the `melonDS` namespace
- Only good chance to do this for a while, since a big refactor is next
* Fix the build
Diffstat (limited to 'src/frontend')
48 files changed, 101 insertions, 55 deletions
diff --git a/src/frontend/FrontendUtil.h b/src/frontend/FrontendUtil.h index 375769d..8d94b37 100644 --- a/src/frontend/FrontendUtil.h +++ b/src/frontend/FrontendUtil.h @@ -26,6 +26,7 @@ namespace Frontend
{
+using namespace melonDS;
enum ScreenLayout
{
diff --git a/src/frontend/Util_Audio.cpp b/src/frontend/Util_Audio.cpp index 278a5a0..4a1d089 100644 --- a/src/frontend/Util_Audio.cpp +++ b/src/frontend/Util_Audio.cpp @@ -27,6 +27,7 @@ #include "mic_blow.h" +using namespace melonDS; namespace Frontend { diff --git a/src/frontend/duckstation/gl/context.h b/src/frontend/duckstation/gl/context.h index 41d8a2c..06e0bc5 100644 --- a/src/frontend/duckstation/gl/context.h +++ b/src/frontend/duckstation/gl/context.h @@ -6,6 +6,7 @@ #include <vector> namespace GL { +using namespace melonDS; class Context { public: diff --git a/src/frontend/duckstation/gl/context_agl.h b/src/frontend/duckstation/gl/context_agl.h index 459bf2f..4ae5202 100644 --- a/src/frontend/duckstation/gl/context_agl.h +++ b/src/frontend/duckstation/gl/context_agl.h @@ -13,6 +13,7 @@ struct NSView; namespace GL { +using namespace melonDS; class ContextAGL final : public Context { public: diff --git a/src/frontend/duckstation/gl/context_wgl.cpp b/src/frontend/duckstation/gl/context_wgl.cpp index 03c18e8..09f994c 100644 --- a/src/frontend/duckstation/gl/context_wgl.cpp +++ b/src/frontend/duckstation/gl/context_wgl.cpp @@ -3,6 +3,7 @@ #include "../log.h" #include "../scoped_guard.h" #include "loader.h" +using namespace melonDS; Log_SetChannel(GL::ContextWGL); // TODO: get rid of this diff --git a/src/frontend/duckstation/gl/x11_window.h b/src/frontend/duckstation/gl/x11_window.h index aff38b7..e216a05 100644 --- a/src/frontend/duckstation/gl/x11_window.h +++ b/src/frontend/duckstation/gl/x11_window.h @@ -4,6 +4,7 @@ #include <X11/Xutil.h> namespace GL { +using namespace melonDS; class X11Window { public: diff --git a/src/frontend/duckstation/window_info.h b/src/frontend/duckstation/window_info.h index 44912ca..4352617 100644 --- a/src/frontend/duckstation/window_info.h +++ b/src/frontend/duckstation/window_info.h @@ -28,8 +28,8 @@ struct WindowInfo Type type = Type::Surfaceless; void* display_connection = nullptr; void* window_handle = nullptr; - u32 surface_width = 0; - u32 surface_height = 0; + melonDS::u32 surface_width = 0; + melonDS::u32 surface_height = 0; float surface_refresh_rate = 0.0f; float surface_scale = 1.0f; SurfaceFormat surface_format = SurfaceFormat::RGB8; diff --git a/src/frontend/mic_blow.h b/src/frontend/mic_blow.h index 20d5017..f8dbc10 100644 --- a/src/frontend/mic_blow.h +++ b/src/frontend/mic_blow.h @@ -19,7 +19,9 @@ #ifndef MIC_BLOW_H #define MIC_BLOW_H -const u16 mic_blow[] = +#include "types.h" + +const melonDS::u16 mic_blow[] = { 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFC, 0xFFFF, 0xFFFC, 0xFFFF, 0xFFFD, 0xFFFF, 0xFFFC, 0xFFFF, 0xFFFD, 0xFFFF, 0xFFFF, 0xFFFE, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFE, 0xFFFF, 0xFFFC, 0xFFFF, 0xFFFC, 0xFFFF, 0xFFFD, 0xFFFF, 0xFFFC, 0xFFFF, diff --git a/src/frontend/qt_sdl/ArchiveUtil.cpp b/src/frontend/qt_sdl/ArchiveUtil.cpp index 6f4b134..7d1eca9 100644 --- a/src/frontend/qt_sdl/ArchiveUtil.cpp +++ b/src/frontend/qt_sdl/ArchiveUtil.cpp @@ -19,6 +19,7 @@ #include "ArchiveUtil.h" #include "Platform.h" +using namespace melonDS; using Platform::Log; using Platform::LogLevel; diff --git a/src/frontend/qt_sdl/ArchiveUtil.h b/src/frontend/qt_sdl/ArchiveUtil.h index 14ff996..eaffb0d 100644 --- a/src/frontend/qt_sdl/ArchiveUtil.h +++ b/src/frontend/qt_sdl/ArchiveUtil.h @@ -35,6 +35,7 @@ namespace Archive { +using namespace melonDS; QVector<QString> ListArchive(QString path); s32 ExtractFileFromArchive(QString path, QString wantedFile, u8** filedata, u32* filesize); //QVector<QString> ExtractFileFromArchive(QString path, QString wantedFile, QByteArray *romBuffer); diff --git a/src/frontend/qt_sdl/AudioInOut.cpp b/src/frontend/qt_sdl/AudioInOut.cpp index 7faac9f..90708b2 100644 --- a/src/frontend/qt_sdl/AudioInOut.cpp +++ b/src/frontend/qt_sdl/AudioInOut.cpp @@ -28,6 +28,7 @@ #include "Input.h" #include "main.h" +using namespace melonDS; namespace AudioInOut { diff --git a/src/frontend/qt_sdl/AudioSettingsDialog.cpp b/src/frontend/qt_sdl/AudioSettingsDialog.cpp index 386519b..cb42e64 100644 --- a/src/frontend/qt_sdl/AudioSettingsDialog.cpp +++ b/src/frontend/qt_sdl/AudioSettingsDialog.cpp @@ -31,6 +31,7 @@ #include "ui_AudioSettingsDialog.h" +using namespace melonDS; AudioSettingsDialog* AudioSettingsDialog::currentDlg = nullptr; extern std::string EmuDirectory; diff --git a/src/frontend/qt_sdl/CLI.cpp b/src/frontend/qt_sdl/CLI.cpp index dce8ab6..299ce65 100644 --- a/src/frontend/qt_sdl/CLI.cpp +++ b/src/frontend/qt_sdl/CLI.cpp @@ -27,8 +27,8 @@ #include "CLI.h" #include "Platform.h" -using Platform::Log; -using Platform::LogLevel; +using melonDS::Platform::Log; +using melonDS::Platform::LogLevel; namespace CLI { diff --git a/src/frontend/qt_sdl/CameraManager.cpp b/src/frontend/qt_sdl/CameraManager.cpp index cc532ff..cc575d2 100644 --- a/src/frontend/qt_sdl/CameraManager.cpp +++ b/src/frontend/qt_sdl/CameraManager.cpp @@ -21,6 +21,7 @@ #include "CameraManager.h" #include "Config.h" +using namespace melonDS; #if QT_VERSION >= 0x060000 diff --git a/src/frontend/qt_sdl/CameraManager.h b/src/frontend/qt_sdl/CameraManager.h index 91e73fb..882b051 100644 --- a/src/frontend/qt_sdl/CameraManager.h +++ b/src/frontend/qt_sdl/CameraManager.h @@ -89,11 +89,11 @@ public: void setXFlip(bool flip); - void captureFrame(u32* frame, int width, int height, bool yuv); + void captureFrame(melonDS::u32* frame, int width, int height, bool yuv); - void feedFrame(u32* frame, int width, int height, bool yuv); - void feedFrame_UYVY(u32* frame, int width, int height); - void feedFrame_NV12(u8* planeY, u8* planeUV, int width, int height); + void feedFrame(melonDS::u32* frame, int width, int height, bool yuv); + void feedFrame_UYVY(melonDS::u32* frame, int width, int height); + void feedFrame_NV12(melonDS::u8* planeY, melonDS::u8* planeUV, int width, int height); signals: void camStartSignal(); @@ -120,15 +120,15 @@ private: int frameWidth, frameHeight; bool frameFormatYUV; - u32* frameBuffer; - u32* tempFrameBuffer; + melonDS::u32* frameBuffer; + melonDS::u32* tempFrameBuffer; QMutex frameMutex; bool xFlip; - void copyFrame_Straight(u32* src, int swidth, int sheight, u32* dst, int dwidth, int dheight, bool xflip, bool yuv); - void copyFrame_RGBtoYUV(u32* src, int swidth, int sheight, u32* dst, int dwidth, int dheight, bool xflip); - void copyFrame_YUVtoRGB(u32* src, int swidth, int sheight, u32* dst, int dwidth, int dheight, bool xflip); + void copyFrame_Straight(melonDS::u32* src, int swidth, int sheight, melonDS::u32* dst, int dwidth, int dheight, bool xflip, bool yuv); + void copyFrame_RGBtoYUV(melonDS::u32* src, int swidth, int sheight, melonDS::u32* dst, int dwidth, int dheight, bool xflip); + void copyFrame_YUVtoRGB(melonDS::u32* src, int swidth, int sheight, melonDS::u32* dst, int dwidth, int dheight, bool xflip); }; #endif // CAMERAMANAGER_H diff --git a/src/frontend/qt_sdl/CameraSettingsDialog.cpp b/src/frontend/qt_sdl/CameraSettingsDialog.cpp index 1da0318..cf40417 100644 --- a/src/frontend/qt_sdl/CameraSettingsDialog.cpp +++ b/src/frontend/qt_sdl/CameraSettingsDialog.cpp @@ -26,6 +26,7 @@ #include "CameraSettingsDialog.h" #include "ui_CameraSettingsDialog.h" +using namespace melonDS; CameraSettingsDialog* CameraSettingsDialog::currentDlg = nullptr; diff --git a/src/frontend/qt_sdl/CheatsDialog.cpp b/src/frontend/qt_sdl/CheatsDialog.cpp index ceaf803..df68723 100644 --- a/src/frontend/qt_sdl/CheatsDialog.cpp +++ b/src/frontend/qt_sdl/CheatsDialog.cpp @@ -29,6 +29,7 @@ #include "CheatsDialog.h" #include "ui_CheatsDialog.h" +using namespace melonDS; using Platform::Log; using Platform::LogLevel; diff --git a/src/frontend/qt_sdl/CheatsDialog.h b/src/frontend/qt_sdl/CheatsDialog.h index 8af75be..ab2ac30 100644 --- a/src/frontend/qt_sdl/CheatsDialog.h +++ b/src/frontend/qt_sdl/CheatsDialog.h @@ -27,8 +27,8 @@ #include "ARCodeFile.h" -Q_DECLARE_METATYPE(ARCodeList::iterator) -Q_DECLARE_METATYPE(ARCodeCatList::iterator) +Q_DECLARE_METATYPE(melonDS::ARCodeList::iterator) +Q_DECLARE_METATYPE(melonDS::ARCodeCatList::iterator) namespace Ui { class CheatsDialog; } class CheatsDialog; @@ -87,7 +87,7 @@ private slots: private: Ui::CheatsDialog* ui; - ARCodeFile* codeFile; + melonDS::ARCodeFile* codeFile; ARCodeChecker* codeChecker; }; diff --git a/src/frontend/qt_sdl/Config.cpp b/src/frontend/qt_sdl/Config.cpp index 9c6aff8..b6fca7d 100644 --- a/src/frontend/qt_sdl/Config.cpp +++ b/src/frontend/qt_sdl/Config.cpp @@ -26,6 +26,7 @@ namespace Config { +using namespace melonDS; int KeyMapping[12]; int JoyMapping[12]; diff --git a/src/frontend/qt_sdl/EmuSettingsDialog.cpp b/src/frontend/qt_sdl/EmuSettingsDialog.cpp index 48b380b..0a834a6 100644 --- a/src/frontend/qt_sdl/EmuSettingsDialog.cpp +++ b/src/frontend/qt_sdl/EmuSettingsDialog.cpp @@ -29,7 +29,8 @@ #include "EmuSettingsDialog.h" #include "ui_EmuSettingsDialog.h" -using namespace Platform; +using namespace melonDS::Platform; +using namespace melonDS; EmuSettingsDialog* EmuSettingsDialog::currentDlg = nullptr; diff --git a/src/frontend/qt_sdl/FirmwareSettingsDialog.cpp b/src/frontend/qt_sdl/FirmwareSettingsDialog.cpp index 5f76b08..1ec2e8c 100644 --- a/src/frontend/qt_sdl/FirmwareSettingsDialog.cpp +++ b/src/frontend/qt_sdl/FirmwareSettingsDialog.cpp @@ -24,6 +24,8 @@ #include "FirmwareSettingsDialog.h" #include "ui_FirmwareSettingsDialog.h" +using namespace melonDS::Platform; +namespace Platform = melonDS::Platform; FirmwareSettingsDialog* FirmwareSettingsDialog::currentDlg = nullptr; diff --git a/src/frontend/qt_sdl/Input.cpp b/src/frontend/qt_sdl/Input.cpp index 1d39a0f..c429cd3 100644 --- a/src/frontend/qt_sdl/Input.cpp +++ b/src/frontend/qt_sdl/Input.cpp @@ -22,6 +22,7 @@ #include "Input.h" #include "Config.h" +using namespace melonDS; namespace Input { diff --git a/src/frontend/qt_sdl/Input.h b/src/frontend/qt_sdl/Input.h index 04f7a1f..366c9c3 100644 --- a/src/frontend/qt_sdl/Input.h +++ b/src/frontend/qt_sdl/Input.h @@ -24,6 +24,7 @@ namespace Input { +using namespace melonDS; extern int JoystickID; extern SDL_Joystick* Joystick; diff --git a/src/frontend/qt_sdl/InputConfig/InputConfigDialog.cpp b/src/frontend/qt_sdl/InputConfig/InputConfigDialog.cpp index 6d651c9..02a76bb 100644 --- a/src/frontend/qt_sdl/InputConfig/InputConfigDialog.cpp +++ b/src/frontend/qt_sdl/InputConfig/InputConfigDialog.cpp @@ -32,6 +32,7 @@ #include "ui_InputConfigDialog.h" +using namespace melonDS; InputConfigDialog* InputConfigDialog::currentDlg = nullptr; const int dskeyorder[12] = {0, 1, 10, 11, 5, 4, 6, 7, 9, 8, 2, 3}; diff --git a/src/frontend/qt_sdl/InputConfig/MapButton.h b/src/frontend/qt_sdl/InputConfig/MapButton.h index b35cc1f..5d4fb3e 100644 --- a/src/frontend/qt_sdl/InputConfig/MapButton.h +++ b/src/frontend/qt_sdl/InputConfig/MapButton.h @@ -52,7 +52,7 @@ protected: { if (!isChecked()) return QPushButton::keyPressEvent(event); - Platform::Log(Platform::Debug, "KEY PRESSED = %08X %08X | %08X %08X %08X\n", event->key(), (int)event->modifiers(), event->nativeVirtualKey(), event->nativeModifiers(), event->nativeScanCode()); + Log(melonDS::Platform::Debug, "KEY PRESSED = %08X %08X | %08X %08X %08X\n", event->key(), (int)event->modifiers(), event->nativeVirtualKey(), event->nativeModifiers(), event->nativeScanCode()); int key = event->key(); int mod = event->modifiers(); diff --git a/src/frontend/qt_sdl/LAN_PCap.cpp b/src/frontend/qt_sdl/LAN_PCap.cpp index e1cbc11..4a1ebc3 100644 --- a/src/frontend/qt_sdl/LAN_PCap.cpp +++ b/src/frontend/qt_sdl/LAN_PCap.cpp @@ -41,6 +41,7 @@ #endif #endif +using namespace melonDS; using Platform::Log; using Platform::LogLevel; diff --git a/src/frontend/qt_sdl/LAN_PCap.h b/src/frontend/qt_sdl/LAN_PCap.h index fe6e000..2e03d66 100644 --- a/src/frontend/qt_sdl/LAN_PCap.h +++ b/src/frontend/qt_sdl/LAN_PCap.h @@ -24,6 +24,7 @@ namespace LAN_PCap { +using namespace melonDS; struct AdapterData { char DeviceName[128]; diff --git a/src/frontend/qt_sdl/LAN_Socket.cpp b/src/frontend/qt_sdl/LAN_Socket.cpp index e1c8663..e938af8 100644 --- a/src/frontend/qt_sdl/LAN_Socket.cpp +++ b/src/frontend/qt_sdl/LAN_Socket.cpp @@ -37,6 +37,7 @@ #include <time.h> #endif +using namespace melonDS; namespace LAN_Socket { diff --git a/src/frontend/qt_sdl/LAN_Socket.h b/src/frontend/qt_sdl/LAN_Socket.h index 9b97301..043e133 100644 --- a/src/frontend/qt_sdl/LAN_Socket.h +++ b/src/frontend/qt_sdl/LAN_Socket.h @@ -23,6 +23,7 @@ namespace LAN_Socket { +using namespace melonDS; // diff --git a/src/frontend/qt_sdl/LocalMP.cpp b/src/frontend/qt_sdl/LocalMP.cpp index 4b3a6a6..a0dfdf7 100644 --- a/src/frontend/qt_sdl/LocalMP.cpp +++ b/src/frontend/qt_sdl/LocalMP.cpp @@ -38,6 +38,9 @@ #include "LocalMP.h" #include "Platform.h" +using namespace melonDS; +using namespace melonDS::Platform; + using Platform::Log; using Platform::LogLevel; diff --git a/src/frontend/qt_sdl/LocalMP.h b/src/frontend/qt_sdl/LocalMP.h index 07c6f43..e7b4188 100644 --- a/src/frontend/qt_sdl/LocalMP.h +++ b/src/frontend/qt_sdl/LocalMP.h @@ -24,6 +24,7 @@ namespace LocalMP { +using namespace melonDS; bool Init(); void DeInit(); diff --git a/src/frontend/qt_sdl/OSD.cpp b/src/frontend/qt_sdl/OSD.cpp index 02ec158..25072df 100644 --- a/src/frontend/qt_sdl/OSD.cpp +++ b/src/frontend/qt_sdl/OSD.cpp @@ -32,6 +32,8 @@ #include "Config.h" +using namespace melonDS; + extern MainWindow* mainWindow; namespace OSD diff --git a/src/frontend/qt_sdl/OSD.h b/src/frontend/qt_sdl/OSD.h index b399fb4..64131d5 100644 --- a/src/frontend/qt_sdl/OSD.h +++ b/src/frontend/qt_sdl/OSD.h @@ -19,9 +19,12 @@ #ifndef OSD_H #define OSD_H +#include "types.h" + namespace OSD { +using namespace melonDS; bool Init(bool openGL); void DeInit(); diff --git a/src/frontend/qt_sdl/PathSettingsDialog.cpp b/src/frontend/qt_sdl/PathSettingsDialog.cpp index 1f1c35c..1d69853 100644 --- a/src/frontend/qt_sdl/PathSettingsDialog.cpp +++ b/src/frontend/qt_sdl/PathSettingsDialog.cpp @@ -27,6 +27,8 @@ #include "PathSettingsDialog.h" #include "ui_PathSettingsDialog.h" +using namespace melonDS::Platform; +namespace Platform = melonDS::Platform; PathSettingsDialog* PathSettingsDialog::currentDlg = nullptr; diff --git a/src/frontend/qt_sdl/Platform.cpp b/src/frontend/qt_sdl/Platform.cpp index df97590..c2e2f47 100644 --- a/src/frontend/qt_sdl/Platform.cpp +++ b/src/frontend/qt_sdl/Platform.cpp @@ -54,7 +54,7 @@ extern CameraManager* camManager[2]; void emuStop(); -namespace Platform +namespace melonDS::Platform { QSharedMemory* IPCBuffer = nullptr; diff --git a/src/frontend/qt_sdl/PowerManagement/PowerManagementDialog.cpp b/src/frontend/qt_sdl/PowerManagement/PowerManagementDialog.cpp index 1d69988..14ccd51 100644 --- a/src/frontend/qt_sdl/PowerManagement/PowerManagementDialog.cpp +++ b/src/frontend/qt_sdl/PowerManagement/PowerManagementDialog.cpp @@ -30,6 +30,8 @@ #include <QtDebug> +using namespace melonDS; + PowerManagementDialog* PowerManagementDialog::currentDlg = nullptr; PowerManagementDialog::PowerManagementDialog(QWidget* parent) : QDialog(parent), ui(new Ui::PowerManagementDialog) diff --git a/src/frontend/qt_sdl/PowerManagement/PowerManagementDialog.h b/src/frontend/qt_sdl/PowerManagement/PowerManagementDialog.h index 0302586..cd2954a 100644 --- a/src/frontend/qt_sdl/PowerManagement/PowerManagementDialog.h +++ b/src/frontend/qt_sdl/PowerManagement/PowerManagementDialog.h @@ -67,7 +67,7 @@ private: bool inited; bool oldDSBatteryLevel; - u8 oldDSiBatteryLevel; + melonDS::u8 oldDSiBatteryLevel; bool oldDSiBatteryCharging; void updateDSBatteryLevelControls(); diff --git a/src/frontend/qt_sdl/RAMInfoDialog.cpp b/src/frontend/qt_sdl/RAMInfoDialog.cpp index b13ff02..b58662c 100644 --- a/src/frontend/qt_sdl/RAMInfoDialog.cpp +++ b/src/frontend/qt_sdl/RAMInfoDialog.cpp @@ -21,6 +21,7 @@ #include "main.h" +using namespace melonDS; extern EmuThread* emuThread; s32 GetMainRAMValue(const u32& addr, const ramInfo_ByteType& byteType) diff --git a/src/frontend/qt_sdl/RAMInfoDialog.h b/src/frontend/qt_sdl/RAMInfoDialog.h index 33afd98..adc9b28 100644 --- a/src/frontend/qt_sdl/RAMInfoDialog.h +++ b/src/frontend/qt_sdl/RAMInfoDialog.h @@ -53,22 +53,22 @@ enum ramInfo_Previous }; -s32 GetMainRAMValue(const u32& addr, const ramInfo_ByteType& byteType); +melonDS::s32 GetMainRAMValue(const melonDS::u32& addr, const ramInfo_ByteType& byteType); struct ramInfo_RowData { - u32 Address; - s32 Value; - s32 Previous; + melonDS::u32 Address; + melonDS::s32 Value; + melonDS::s32 Previous; void Update(const ramInfo_ByteType& byteType) { Value = GetMainRAMValue(Address, byteType); } - void SetValue(const s32& value) + void SetValue(const melonDS::s32& value) { - NDS::MainRAM[Address&NDS::MainRAMMask] = (u32)value; + melonDS::NDS::MainRAM[Address&melonDS::NDS::MainRAMMask] = (melonDS::u32)value; Value = value; } }; @@ -99,7 +99,7 @@ public: currentDlg = nullptr; } - s32 SearchValue = 0; + melonDS::s32 SearchValue = 0; void ClearTableContents(); @@ -115,7 +115,7 @@ private slots: void OnSearchFinished(); void ShowRowsInTable(); - void SetProgressbarValue(const u32& value); + void SetProgressbarValue(const melonDS::u32& value); private: Ui::RAMInfoDialog* ui; @@ -132,7 +132,7 @@ public: explicit RAMSearchThread(RAMInfoDialog* dialog); ~RAMSearchThread() override; - void Start(const s32& searchValue, const ramInfoSTh_SearchMode& searchMode = ramInfoSTh_Default); + void Start(const melonDS::s32& searchValue, const ramInfoSTh_SearchMode& searchMode = ramInfoSTh_Default); void Start(const ramInfoSTh_SearchMode& searchMode); void SetSearchByteType(const ramInfo_ByteType& bytetype); @@ -148,14 +148,14 @@ private: bool SearchRunning = false; ramInfoSTh_SearchMode SearchMode; - s32 SearchValue; + melonDS::s32 SearchValue; ramInfo_ByteType SearchByteType = ramInfo_OneByte; std::vector<ramInfo_RowData>* RowDataVector = nullptr; void ClearTableContents(); signals: - void SetProgressbarValue(const u32& value); + void SetProgressbarValue(const melonDS::u32& value); }; #endif // RAMINFODIALOG_H diff --git a/src/frontend/qt_sdl/ROMInfoDialog.cpp b/src/frontend/qt_sdl/ROMInfoDialog.cpp index 34917d0..6a46b18 100644 --- a/src/frontend/qt_sdl/ROMInfoDialog.cpp +++ b/src/frontend/qt_sdl/ROMInfoDialog.cpp @@ -28,6 +28,8 @@ #include "Platform.h"
#include "Config.h"
+using namespace melonDS;
+
QString IntToHex(u64 num)
{
return ("0x" + QString::number(num, 16).toUpper());
diff --git a/src/frontend/qt_sdl/ROMInfoDialog.h b/src/frontend/qt_sdl/ROMInfoDialog.h index 630ac22..7316e98 100644 --- a/src/frontend/qt_sdl/ROMInfoDialog.h +++ b/src/frontend/qt_sdl/ROMInfoDialog.h @@ -69,7 +69,7 @@ private: QImage iconImage;
QTimeLine* iconTimeline;
- u32 animatedIconData[64][32*32] = {0};
+ melonDS::u32 animatedIconData[64][32*32] = {0};
std::vector<QPixmap> animatedIconImages;
std::vector<int> animatedSequence;
};
diff --git a/src/frontend/qt_sdl/ROMManager.cpp b/src/frontend/qt_sdl/ROMManager.cpp index 1c58055..9584c38 100644 --- a/src/frontend/qt_sdl/ROMManager.cpp +++ b/src/frontend/qt_sdl/ROMManager.cpp @@ -51,7 +51,8 @@ using std::string; using std::tie; using std::unique_ptr; using std::wstring_convert; -using namespace Platform; +using namespace melonDS; +using namespace melonDS::Platform; namespace ROMManager { diff --git a/src/frontend/qt_sdl/ROMManager.h b/src/frontend/qt_sdl/ROMManager.h index 6d95763..9228560 100644 --- a/src/frontend/qt_sdl/ROMManager.h +++ b/src/frontend/qt_sdl/ROMManager.h @@ -31,6 +31,7 @@ namespace ROMManager { +using namespace melonDS; extern SaveManager* NDSSave; extern SaveManager* GBASave; extern std::unique_ptr<SaveManager> FirmwareSave; diff --git a/src/frontend/qt_sdl/SaveManager.cpp b/src/frontend/qt_sdl/SaveManager.cpp index 78d4b0e..55279dc 100644 --- a/src/frontend/qt_sdl/SaveManager.cpp +++ b/src/frontend/qt_sdl/SaveManager.cpp @@ -22,7 +22,8 @@ #include "SaveManager.h" #include "Platform.h" -using namespace Platform; +using namespace melonDS; +using namespace melonDS::Platform; SaveManager::SaveManager(const std::string& path) : QThread() { diff --git a/src/frontend/qt_sdl/SaveManager.h b/src/frontend/qt_sdl/SaveManager.h index 6ffb4f8..d7132e6 100644 --- a/src/frontend/qt_sdl/SaveManager.h +++ b/src/frontend/qt_sdl/SaveManager.h @@ -41,31 +41,31 @@ public: std::string GetPath(); void SetPath(const std::string& path, bool reload); - void RequestFlush(const u8* savedata, u32 savelen, u32 writeoffset, u32 writelen); + void RequestFlush(const melonDS::u8* savedata, melonDS::u32 savelen, melonDS::u32 writeoffset, melonDS::u32 writelen); void CheckFlush(); bool NeedsFlush(); - void FlushSecondaryBuffer(u8* dst = nullptr, u32 dstLength = 0); + void FlushSecondaryBuffer(melonDS::u8* dst = nullptr, melonDS::u32 dstLength = 0); private: std::string Path; std::atomic_bool Running; - std::unique_ptr<u8[]> Buffer; - u32 Length; + std::unique_ptr<melonDS::u8[]> Buffer; + melonDS::u32 Length; bool FlushRequested; QMutex* SecondaryBufferLock; - std::unique_ptr<u8[]> SecondaryBuffer; - u32 SecondaryBufferLength; + std::unique_ptr<melonDS::u8[]> SecondaryBuffer; + melonDS::u32 SecondaryBufferLength; time_t TimeAtLastFlushRequest; // We keep versions in case the user closes the application before // a flush cycle is finished. - u32 PreviousFlushVersion; - u32 FlushVersion; + melonDS::u32 PreviousFlushVersion; + melonDS::u32 FlushVersion; }; #endif // SAVEMANAGER_H diff --git a/src/frontend/qt_sdl/TitleManagerDialog.cpp b/src/frontend/qt_sdl/TitleManagerDialog.cpp index eb6b594..eda1bbc 100644 --- a/src/frontend/qt_sdl/TitleManagerDialog.cpp +++ b/src/frontend/qt_sdl/TitleManagerDialog.cpp @@ -30,7 +30,8 @@ #include "ui_TitleManagerDialog.h" #include "ui_TitleImportDialog.h" -using namespace Platform; +using namespace melonDS; +using namespace melonDS::Platform; std::unique_ptr<DSi_NAND::NANDImage> TitleManagerDialog::nand = nullptr; TitleManagerDialog* TitleManagerDialog::currentDlg = nullptr; diff --git a/src/frontend/qt_sdl/TitleManagerDialog.h b/src/frontend/qt_sdl/TitleManagerDialog.h index 7209f96..2e392eb 100644 --- a/src/frontend/qt_sdl/TitleManagerDialog.h +++ b/src/frontend/qt_sdl/TitleManagerDialog.h @@ -46,10 +46,10 @@ class TitleManagerDialog : public QDialog Q_OBJECT public: - explicit TitleManagerDialog(QWidget* parent, DSi_NAND::NANDImage& image); + explicit TitleManagerDialog(QWidget* parent, melonDS::DSi_NAND::NANDImage& image); ~TitleManagerDialog(); - static std::unique_ptr<DSi_NAND::NANDImage> nand; + static std::unique_ptr<melonDS::DSi_NAND::NANDImage> nand; static bool openNAND(); static void closeNAND(); @@ -94,17 +94,17 @@ private slots: void onExportTitleData(); private: - DSi_NAND::NANDMount nandmount; + melonDS::DSi_NAND::NANDMount nandmount; Ui::TitleManagerDialog* ui; QString importAppPath; - DSi_TMD::TitleMetadata importTmdData; + melonDS::DSi_TMD::TitleMetadata importTmdData; bool importReadOnly; QAction* actImportTitleData[3]; QAction* actExportTitleData[3]; - void createTitleItem(u32 category, u32 titleid); + void createTitleItem(melonDS::u32 category, melonDS::u32 titleid); }; class TitleImportDialog : public QDialog @@ -112,7 +112,7 @@ class TitleImportDialog : public QDialog Q_OBJECT public: - explicit TitleImportDialog(QWidget* parent, QString& apppath, const DSi_TMD::TitleMetadata* tmd, bool& readonly, DSi_NAND::NANDMount& nand); + explicit TitleImportDialog(QWidget* parent, QString& apppath, const melonDS::DSi_TMD::TitleMetadata* tmd, bool& readonly, melonDS::DSi_NAND::NANDMount& nand); ~TitleImportDialog(); private slots: @@ -125,7 +125,7 @@ private slots: private: Ui::TitleImportDialog* ui; - DSi_NAND::NANDMount& nandmount; + melonDS::DSi_NAND::NANDMount& nandmount; QButtonGroup* grpTmdSource; @@ -133,10 +133,10 @@ private: QNetworkReply* netreply; QString& appPath; - const DSi_TMD::TitleMetadata* tmdData; + const melonDS::DSi_TMD::TitleMetadata* tmdData; bool& readOnly; - u32 titleid[2]; + melonDS::u32 titleid[2]; }; #endif // TITLEMANAGERDIALOG_H diff --git a/src/frontend/qt_sdl/main.cpp b/src/frontend/qt_sdl/main.cpp index b820b50..4286498 100644 --- a/src/frontend/qt_sdl/main.cpp +++ b/src/frontend/qt_sdl/main.cpp @@ -105,7 +105,7 @@ #include "CLI.h" // TODO: uniform variable spelling - +using namespace melonDS; const QString NdsRomMimeType = "application/x-nintendo-ds-rom"; const QStringList NdsRomExtensions { ".nds", ".srl", ".dsi", ".ids" }; @@ -163,7 +163,7 @@ EmuThread* emuThread; int autoScreenSizing = 0; int videoRenderer; -Melon::RenderSettings videoSettings; +RenderSettings videoSettings; bool videoSettingsDirty; CameraManager* camManager[2]; |