Skip to content

Commit

Permalink
refactor: 不再使用 Magpie.Core 命名空间
Browse files Browse the repository at this point in the history
  • Loading branch information
Blinue committed Dec 16, 2024
1 parent 7e5e85c commit 4ec0f30
Show file tree
Hide file tree
Showing 131 changed files with 210 additions and 235 deletions.
2 changes: 1 addition & 1 deletion src/Magpie.Core/BackendDescriptorStore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include "BackendDescriptorStore.h"
#include "Logger.h"

namespace Magpie::Core {
namespace Magpie {

ID3D11ShaderResourceView* BackendDescriptorStore::GetShaderResourceView(ID3D11Texture2D* texture) noexcept {
if (auto it = _srvMap.find(texture); it != _srvMap.end()) {
Expand Down
2 changes: 1 addition & 1 deletion src/Magpie.Core/BackendDescriptorStore.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once
#include <parallel_hashmap/phmap.h>

namespace Magpie::Core {
namespace Magpie {

class BackendDescriptorStore {
public:
Expand Down
2 changes: 1 addition & 1 deletion src/Magpie.Core/CursorDrawer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

using namespace DirectX;

namespace Magpie::Core {
namespace Magpie {

struct VertexPositionTexture {
VertexPositionTexture() = default;
Expand Down
2 changes: 1 addition & 1 deletion src/Magpie.Core/CursorDrawer.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include <parallel_hashmap/phmap.h>
#include "ScalingOptions.h"

namespace Magpie::Core {
namespace Magpie {

class DeviceResources;

Expand Down
2 changes: 1 addition & 1 deletion src/Magpie.Core/CursorManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "Renderer.h"
#include <dwmapi.h>

namespace Magpie::Core {
namespace Magpie {

// 将源窗口的光标位置映射到缩放后的光标位置。当光标位于源窗口之外,与源窗口的距离不会缩放。
// 对于光标,第一个像素映射到第一个像素,最后一个像素映射到最后一个像素,因此光标区域的缩放
Expand Down
2 changes: 1 addition & 1 deletion src/Magpie.Core/CursorManager.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

namespace Magpie::Core {
namespace Magpie {

class CursorManager {
public:
Expand Down
2 changes: 1 addition & 1 deletion src/Magpie.Core/DesktopDuplicationFrameSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "DirectXHelper.h"
#include "SmallVector.h"

namespace Magpie::Core {
namespace Magpie {

static winrt::com_ptr<IDXGIOutput1> FindMonitor(IDXGIAdapter1* adapter, HMONITOR hMonitor) noexcept {
winrt::com_ptr<IDXGIOutput> output;
Expand Down
2 changes: 1 addition & 1 deletion src/Magpie.Core/DesktopDuplicationFrameSource.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "Win32Helper.h"
#include "SmallVector.h"

namespace Magpie::Core {
namespace Magpie {

class DesktopDuplicationFrameSource final : public FrameSourceBase {
public:
Expand Down
2 changes: 1 addition & 1 deletion src/Magpie.Core/DeviceResources.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "DirectXHelper.h"
#include "ScalingWindow.h"

namespace Magpie::Core {
namespace Magpie {

bool DeviceResources::Initialize() noexcept {
#ifdef _DEBUG
Expand Down
2 changes: 1 addition & 1 deletion src/Magpie.Core/DeviceResources.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once
#include <parallel_hashmap/phmap.h>

namespace Magpie::Core {
namespace Magpie {

class DeviceResources {
public:
Expand Down
2 changes: 1 addition & 1 deletion src/Magpie.Core/DirectXHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "Logger.h"
#include "StrHelper.h"

namespace Magpie::Core {
namespace Magpie {

bool DirectXHelper::CompileComputeShader(
std::string_view hlsl,
Expand Down
2 changes: 1 addition & 1 deletion src/Magpie.Core/DirectXHelper.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

namespace Magpie::Core {
namespace Magpie {

struct DirectXHelper {
static bool CompileComputeShader(
Expand Down
2 changes: 1 addition & 1 deletion src/Magpie.Core/DwmSharedSurfaceFrameSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "DirectXHelper.h"
#include "DeviceResources.h"

namespace Magpie::Core {
namespace Magpie {

using DwmGetDxSharedSurfaceFunc = BOOL(
HWND hWnd,
Expand Down
2 changes: 1 addition & 1 deletion src/Magpie.Core/DwmSharedSurfaceFrameSource.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once
#include "FrameSourceBase.h"

namespace Magpie::Core {
namespace Magpie {

class DwmSharedSurfaceFrameSource final : public FrameSourceBase {
public:
Expand Down
4 changes: 2 additions & 2 deletions src/Magpie.Core/EffectCacheManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ struct serializer<
ar& size;
HRESULT hr = D3DCreateBlob(size, blob.put());
if (FAILED(hr)) {
Magpie::Core::Logger::Get().ComError("D3DCreateBlob 失败", hr);
Magpie::Logger::Get().ComError("D3DCreateBlob 失败", hr);
throw new std::exception();
}

Expand All @@ -46,7 +46,7 @@ struct serializer<

}

namespace Magpie::Core {
namespace Magpie {

template<typename Archive>
void serialize(Archive& ar, EffectParameterDesc& o) {
Expand Down
2 changes: 1 addition & 1 deletion src/Magpie.Core/EffectCacheManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "EffectDesc.h"
#include <parallel_hashmap/phmap.h>

namespace Magpie::Core {
namespace Magpie {

class EffectCacheManager {
public:
Expand Down
2 changes: 1 addition & 1 deletion src/Magpie.Core/EffectCompiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "Win32Helper.h"
#include "EffectDesc.h"

namespace Magpie::Core {
namespace Magpie {

// 当前 MagpieFX 版本
static constexpr uint32_t MAGPIE_FX_VERSION = 4;
Expand Down
2 changes: 1 addition & 1 deletion src/Magpie.Core/EffectDrawer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#pragma warning(push)
#pragma pop_macro("_UNICODE")

namespace Magpie::Core {
namespace Magpie {

static SIZE CalcOutputSize(
const std::pair<std::string, std::string>& outputSizeExpr,
Expand Down
2 changes: 1 addition & 1 deletion src/Magpie.Core/EffectDrawer.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "SmallVector.h"
#include "EffectHelper.h"

namespace Magpie::Core {
namespace Magpie {

struct EffectOption;
class DeviceResources;
Expand Down
2 changes: 1 addition & 1 deletion src/Magpie.Core/EffectHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include <dxgi.h>
#include <cstdint>

namespace Magpie::Core {
namespace Magpie {

struct EffectHelper {
struct EffectIntermediateTextureFormatDesc {
Expand Down
2 changes: 1 addition & 1 deletion src/Magpie.Core/EffectsProfiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include "EffectsProfiler.h"
#include "DeviceResources.h"

namespace Magpie::Core {
namespace Magpie {

void EffectsProfiler::Start(ID3D11Device* d3dDevice, uint32_t passCount) {
assert(_passQueries.empty());
Expand Down
2 changes: 1 addition & 1 deletion src/Magpie.Core/EffectsProfiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include "SmallVector.h"
#include "Win32Helper.h"

namespace Magpie::Core {
namespace Magpie {

class DeviceResources;

Expand Down
2 changes: 1 addition & 1 deletion src/Magpie.Core/ExclModeHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "Logger.h"
#include <shellapi.h>

namespace Magpie::Core {
namespace Magpie {

// 模拟 D3D 独占全屏模式,以起到免打扰的效果
// SHQueryUserNotificationState 通常被用来检测是否有 D3D 游戏独占全屏,以确定是否应该向用户推送通知/弹窗
Expand Down
2 changes: 1 addition & 1 deletion src/Magpie.Core/ExclModeHelper.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once
#include "Win32Helper.h"

namespace Magpie::Core {
namespace Magpie {

struct ExclModeHelper {
static wil::unique_mutex_nothrow EnterExclMode() noexcept;
Expand Down
2 changes: 1 addition & 1 deletion src/Magpie.Core/FastHasher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "Logger.h"
#include "StrHelper.h"

namespace Magpie::Core {
namespace Magpie {

////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
Expand Down
2 changes: 1 addition & 1 deletion src/Magpie.Core/FastHasher.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

namespace Magpie::Core {
namespace Magpie {

struct FastHasher {
static uint64_t HashData(std::span<const BYTE> data) noexcept;
Expand Down
2 changes: 1 addition & 1 deletion src/Magpie.Core/FrameSourceBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "BackendDescriptorStore.h"
#include <dwmapi.h>

namespace Magpie::Core {
namespace Magpie {

static constexpr uint16_t INITIAL_CHECK_COUNT = 16;
static constexpr uint16_t INITIAL_SKIP_COUNT = 1;
Expand Down
2 changes: 1 addition & 1 deletion src/Magpie.Core/FrameSourceBase.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

namespace Magpie::Core {
namespace Magpie {

class DeviceResources;
class BackendDescriptorStore;
Expand Down
2 changes: 1 addition & 1 deletion src/Magpie.Core/GDIFrameSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "DeviceResources.h"
#include "ScalingWindow.h"

namespace Magpie::Core {
namespace Magpie {

bool GDIFrameSource::_Initialize() noexcept {
if (!_CalcSrcRect()) {
Expand Down
2 changes: 1 addition & 1 deletion src/Magpie.Core/GDIFrameSource.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once
#include "FrameSourceBase.h"

namespace Magpie::Core {
namespace Magpie {

class GDIFrameSource final : public FrameSourceBase {
public:
Expand Down
2 changes: 1 addition & 1 deletion src/Magpie.Core/GraphicsCaptureFrameSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ using namespace Windows::Graphics::DirectX;
using namespace Windows::Graphics::DirectX::Direct3D11;
}

namespace Magpie::Core {
namespace Magpie {

bool GraphicsCaptureFrameSource::_Initialize() noexcept {
ID3D11Device5* d3dDevice = _deviceResources->GetD3DDevice();
Expand Down
2 changes: 1 addition & 1 deletion src/Magpie.Core/GraphicsCaptureFrameSource.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <Windows.Graphics.Capture.Interop.h>
#include <ShlObj.h>

namespace Magpie::Core {
namespace Magpie {

// 使用 Window Runtime 的 Windows.Graphics.Capture API 抓取窗口
// 见 https://docs.microsoft.com/en-us/windows/uwp/audio-video-camera/screen-capture
Expand Down
2 changes: 1 addition & 1 deletion src/Magpie.Core/ImGuiBackend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "shaders/ImGuiImplVS.h"
#include "shaders/ImGuiImplPS.h"

namespace Magpie::Core {
namespace Magpie {

struct VERTEX_CONSTANT_BUFFER {
float mvp[4][4];
Expand Down
2 changes: 1 addition & 1 deletion src/Magpie.Core/ImGuiBackend.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once
#include <imgui.h>

namespace Magpie::Core {
namespace Magpie {

class DeviceResources;

Expand Down
2 changes: 1 addition & 1 deletion src/Magpie.Core/ImGuiFontsCacheManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ struct serializer<

}

namespace Magpie::Core {
namespace Magpie {

// 缓存版本
// 当缓存文件结构有更改时更新它,使旧缓存失效
Expand Down
2 changes: 1 addition & 1 deletion src/Magpie.Core/ImGuiFontsCacheManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include <imgui.h>
#include <parallel_hashmap/phmap.h>

namespace Magpie::Core {
namespace Magpie {

class ImGuiFontsCacheManager {
public:
Expand Down
4 changes: 2 additions & 2 deletions src/Magpie.Core/ImGuiHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ static void UnpackAccumulativeOffsetsIntoRanges(
outRanges[0] = 0;
}

const ImWchar* Magpie::Core::ImGuiHelper::GetGlyphRangesChineseSimplifiedOfficial() noexcept {
const ImWchar* Magpie::ImGuiHelper::GetGlyphRangesChineseSimplifiedOfficial() noexcept {
// 存储了通用规范汉字表中的一级字表(3500字)以及其他一些常用字。
// 来自 https://zh.wiktionary.org/wiki/Appendix:%E9%80%9A%E7%94%A8%E8%A7%84%E8%8C%83%E6%B1%89%E5%AD%97%E8%A1%A8
// 由 CJKCharacterSetForImGui 生成,它位于 tools 文件夹中。
Expand Down Expand Up @@ -93,7 +93,7 @@ const ImWchar* Magpie::Core::ImGuiHelper::GetGlyphRangesChineseSimplifiedOfficia
}

// 来自 https://github.com/flyinghead/flycast/blob/541544292a3d051839672ffa7bd4524a3e1c1c51/core/rend/gui_util.cpp#L523
const ImWchar* Magpie::Core::ImGuiHelper::GetGlyphRangesChineseTraditionalOfficial() noexcept {
const ImWchar* Magpie::ImGuiHelper::GetGlyphRangesChineseTraditionalOfficial() noexcept {
// Store all official characters for Traditional Chinese.
// Sourced from https://https://en.wikipedia.org/wiki/List_of_Graphemes_of_Commonly-Used_Chinese_Characters
// (Stored as accumulative offsets from the initial unicode codepoint 0x4E00. This encoding is designed to helps us compact the source code size.)
Expand Down
2 changes: 1 addition & 1 deletion src/Magpie.Core/ImGuiHelper.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once
#include <imgui.h>

namespace Magpie::Core {
namespace Magpie {

struct ImGuiHelper {
static const ImWchar* GetGlyphRangesChineseSimplifiedOfficial() noexcept;
Expand Down
2 changes: 1 addition & 1 deletion src/Magpie.Core/ImGuiImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "ScalingWindow.h"
#include "CursorManager.h"

namespace Magpie::Core {
namespace Magpie {

ImGuiImpl::~ImGuiImpl() noexcept {
if (ImGui::GetCurrentContext()) {
Expand Down
2 changes: 1 addition & 1 deletion src/Magpie.Core/ImGuiImpl.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once
#include "ImGuiBackend.h"

namespace Magpie::Core {
namespace Magpie {

class DeviceResources;

Expand Down
2 changes: 1 addition & 1 deletion src/Magpie.Core/Logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <spdlog/sinks/rotating_file_sink.h>
#include <fmt/printf.h>

namespace Magpie::Core {
namespace Magpie {

bool Logger::Initialize(
spdlog::level::level_enum logLevel,
Expand Down
2 changes: 1 addition & 1 deletion src/Magpie.Core/OverlayDrawer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

using namespace std::chrono;

namespace Magpie::Core {
namespace Magpie {

static const char* COLOR_INDICATOR = "";
static const wchar_t COLOR_INDICATOR_W = L'';
Expand Down
Loading

0 comments on commit 4ec0f30

Please sign in to comment.