From 6da394a4d0891ed30fbb08f4ec853f40699f7033 Mon Sep 17 00:00:00 2001 From: Stevoisiak Date: Fri, 14 Nov 2014 14:46:49 -0500 Subject: [PATCH] More formatting and consistency fixes --- Source/Core/Core/HW/DSP.h | 2 +- Source/Core/Core/HW/DSPHLE/UCodes/ROM.h | 2 +- Source/Core/Core/HW/DSPHLE/UCodes/UCodes.cpp | 2 +- Source/Core/DiscIO/BannerLoader.cpp | 4 ---- Source/Core/DiscIO/NANDContentLoader.cpp | 14 ++------------ Source/Core/DiscIO/VolumeWiiCrypted.cpp | 2 -- Source/Core/DolphinWX/Android/ButtonManager.h | 2 +- Source/Core/DolphinWX/ISOFile.cpp | 2 +- Source/Core/DolphinWX/Main.cpp | 2 +- Source/Core/VideoBackends/D3D/D3DBase.h | 8 ++++---- Source/Core/VideoBackends/D3D/D3DState.cpp | 6 ------ Source/Core/VideoBackends/D3D/D3DTexture.cpp | 18 ++++++++++++------ Source/Core/VideoBackends/D3D/PerfQuery.cpp | 8 -------- .../VideoBackends/D3D/VertexShaderCache.cpp | 6 ++++-- Source/Core/VideoBackends/D3D/VideoBackend.h | 2 +- .../VideoBackends/OGL/ProgramShaderCache.h | 2 +- .../VideoBackends/OGL/TextureConverter.cpp | 2 +- .../VideoBackends/Software/EfbInterface.cpp | 2 +- Source/Core/VideoCommon/VertexManagerBase.h | 2 +- 19 files changed, 33 insertions(+), 55 deletions(-) diff --git a/Source/Core/Core/HW/DSP.h b/Source/Core/Core/HW/DSP.h index 6051857113..888197ec1f 100644 --- a/Source/Core/Core/HW/DSP.h +++ b/Source/Core/Core/HW/DSP.h @@ -61,7 +61,7 @@ void Shutdown(); void RegisterMMIO(MMIO::Mapping* mmio, u32 base); -DSPEmulator *GetDSPEmulator(); +DSPEmulator* GetDSPEmulator(); void DoState(PointerWrap &p); diff --git a/Source/Core/Core/HW/DSPHLE/UCodes/ROM.h b/Source/Core/Core/HW/DSPHLE/UCodes/ROM.h index fc294c4aaf..b3828067f8 100644 --- a/Source/Core/Core/HW/DSPHLE/UCodes/ROM.h +++ b/Source/Core/Core/HW/DSPHLE/UCodes/ROM.h @@ -9,7 +9,7 @@ class ROMUCode : public UCodeInterface { public: - ROMUCode(DSPHLE *dsphle, u32 crc); + ROMUCode(DSPHLE* dsphle, u32 crc); virtual ~ROMUCode(); u32 GetUpdateMs() override; diff --git a/Source/Core/Core/HW/DSPHLE/UCodes/UCodes.cpp b/Source/Core/Core/HW/DSPHLE/UCodes/UCodes.cpp index 079a29d819..e39b39bd46 100644 --- a/Source/Core/Core/HW/DSPHLE/UCodes/UCodes.cpp +++ b/Source/Core/Core/HW/DSPHLE/UCodes/UCodes.cpp @@ -18,7 +18,7 @@ #include "Core/HW/DSPHLE/UCodes/UCodes.h" #include "Core/HW/DSPHLE/UCodes/Zelda.h" -UCodeInterface* UCodeFactory(u32 crc, DSPHLE *dsphle, bool wii) +UCodeInterface* UCodeFactory(u32 crc, DSPHLE* dsphle, bool wii) { switch (crc) { diff --git a/Source/Core/DiscIO/BannerLoader.cpp b/Source/Core/DiscIO/BannerLoader.cpp index 81d7ab2149..3dc989684a 100644 --- a/Source/Core/DiscIO/BannerLoader.cpp +++ b/Source/Core/DiscIO/BannerLoader.cpp @@ -19,13 +19,9 @@ class IVolume; IBannerLoader* CreateBannerLoader(DiscIO::IFileSystem& _rFileSystem, DiscIO::IVolume *pVolume) { if (IsVolumeWiiDisc(pVolume) || IsVolumeWadFile(pVolume)) - { return new CBannerLoaderWii(pVolume); - } if (_rFileSystem.IsValid()) - { return new CBannerLoaderGC(_rFileSystem, pVolume); - } return nullptr; } diff --git a/Source/Core/DiscIO/NANDContentLoader.cpp b/Source/Core/DiscIO/NANDContentLoader.cpp index be37fed1f4..26c93489a8 100644 --- a/Source/Core/DiscIO/NANDContentLoader.cpp +++ b/Source/Core/DiscIO/NANDContentLoader.cpp @@ -129,7 +129,7 @@ private: u8 m_TMDView[TMD_VIEW_SIZE]; u8 m_TMDHeader[TMD_HEADER_SIZE]; u32 m_TIKSize; - u8 *m_TIK; + u8* m_TIK; u8 m_Country; std::vector m_Content; @@ -267,19 +267,13 @@ bool CNANDContentLoader::Initialize(const std::string& _rName) rContent.m_pData = nullptr; if (rContent.m_Type & 0x8000) // shared app - { rContent.m_Filename = CSharedContent::AccessInstance().GetFilenameFromSHA1(rContent.m_SHA1Hash); - } else - { rContent.m_Filename = StringFromFormat("%s/%08x.app", m_Path.c_str(), rContent.m_ContentID); - } // Be graceful about incorrect tmds. if (File::Exists(rContent.m_Filename)) - { rContent.m_Size = (u32) File::GetSize(rContent.m_Filename); - } } delete [] pTMD; @@ -484,13 +478,9 @@ u64 CNANDContentManager::Install_WiiWAD(std::string &fileName) std::string APPFileName; if (Content.m_Type & 0x8000) //shared - { APPFileName = CSharedContent::AccessInstance().AddSharedContent(Content.m_SHA1Hash); - } else - { APPFileName = StringFromFormat("%s%08x.app", ContentPath.c_str(), Content.m_ContentID); - } if (!File::Exists(APPFileName)) { @@ -522,7 +512,7 @@ u64 CNANDContentManager::Install_WiiWAD(std::string &fileName) return TitleID; } -bool Add_Ticket(u64 TitleID, const u8 *p_tik, u32 tikSize) +bool Add_Ticket(u64 TitleID, const u8* p_tik, u32 tikSize) { std::string TicketFileName = Common::GetTicketFileName(TitleID); File::CreateFullPath(TicketFileName); diff --git a/Source/Core/DiscIO/VolumeWiiCrypted.cpp b/Source/Core/DiscIO/VolumeWiiCrypted.cpp index f756f88450..1406fc9c69 100644 --- a/Source/Core/DiscIO/VolumeWiiCrypted.cpp +++ b/Source/Core/DiscIO/VolumeWiiCrypted.cpp @@ -66,9 +66,7 @@ bool CVolumeWiiCrypted::Read(u64 _ReadOffset, u64 _Length, u8* _pBuffer) const // read current block if (!m_pReader->Read(m_VolumeOffset + m_dataOffset + Block * 0x8000, 0x8000, m_pBuffer)) - { return(false); - } if (m_LastDecryptedBlockOffset != Block) { diff --git a/Source/Core/DolphinWX/Android/ButtonManager.h b/Source/Core/DolphinWX/Android/ButtonManager.h index 15dfbedbb1..dffa19d437 100644 --- a/Source/Core/DolphinWX/Android/ButtonManager.h +++ b/Source/Core/DolphinWX/Android/ButtonManager.h @@ -98,7 +98,7 @@ namespace ButtonManager delete bind.second; _inputbinds.clear(); } - void AddBind(sBind *bind) { _inputbinds[std::make_pair(bind->_padID, bind->_buttontype)] = bind; } + void AddBind(sBind* bind) { _inputbinds[std::make_pair(bind->_padID, bind->_buttontype)] = bind; } void PressEvent(int button, int action); void AxisEvent(int axis, float value); bool ButtonValue(int padID, ButtonType button); diff --git a/Source/Core/DolphinWX/ISOFile.cpp b/Source/Core/DolphinWX/ISOFile.cpp index 41345ccdcb..5e21cd0f4f 100644 --- a/Source/Core/DolphinWX/ISOFile.cpp +++ b/Source/Core/DolphinWX/ISOFile.cpp @@ -113,7 +113,7 @@ GameListItem::GameListItem(const std::string& _rFileName) m_Valid = true; // Create a cache file only if we have an image. - // Wii isos create their images after you have generated the first savegame + // Wii ISOs create their images after you have generated the first savegame if (!m_pImage.empty()) SaveToCache(); } diff --git a/Source/Core/DolphinWX/Main.cpp b/Source/Core/DolphinWX/Main.cpp index 28be496fc2..7a6e781686 100644 --- a/Source/Core/DolphinWX/Main.cpp +++ b/Source/Core/DolphinWX/Main.cpp @@ -128,7 +128,7 @@ bool DolphinApp::Initialize(int& c, wxChar **v) return wxApp::Initialize(c, v); } -// The `main program' equivalent that creates the main window and return the main frame +// The 'main program' equivalent that creates the main window and return the main frame bool DolphinApp::OnInit() { diff --git a/Source/Core/VideoBackends/D3D/D3DBase.h b/Source/Core/VideoBackends/D3D/D3DBase.h index 2f9f15b623..05190bd5d4 100644 --- a/Source/Core/VideoBackends/D3D/D3DBase.h +++ b/Source/Core/VideoBackends/D3D/D3DBase.h @@ -61,7 +61,7 @@ unsigned int GetMaxTextureSize(); HRESULT SetFullscreenState(bool enable_fullscreen); HRESULT GetFullscreenState(bool* fullscreen_state); -// Ihis function will assign a name to the given resource. +// This function will assign a name to the given resource. // The DirectX debug layer will make it easier to identify resources that way, // e.g. when listing up all resources who have unreleased references. template @@ -76,11 +76,11 @@ void SetDebugObjectName(T resource, const char* name) } // namespace D3D -typedef HRESULT (WINAPI *CREATEDXGIFACTORY)(REFIID, void**); +typedef HRESULT (WINAPI* CREATEDXGIFACTORY)(REFIID, void**); extern CREATEDXGIFACTORY PCreateDXGIFactory; -typedef HRESULT (WINAPI *D3D11CREATEDEVICE)(IDXGIAdapter*, D3D_DRIVER_TYPE, HMODULE, UINT, CONST D3D_FEATURE_LEVEL*, UINT, UINT, ID3D11Device**, D3D_FEATURE_LEVEL*, ID3D11DeviceContext**); +typedef HRESULT (WINAPI* D3D11CREATEDEVICE)(IDXGIAdapter*, D3D_DRIVER_TYPE, HMODULE, UINT, CONST D3D_FEATURE_LEVEL*, UINT, UINT, ID3D11Device**, D3D_FEATURE_LEVEL*, ID3D11DeviceContext**); -typedef HRESULT (WINAPI *D3DREFLECT)(LPCVOID, SIZE_T, REFIID, void**); +typedef HRESULT (WINAPI* D3DREFLECT)(LPCVOID, SIZE_T, REFIID, void**); extern D3DREFLECT PD3DReflect; extern pD3DCompile PD3DCompile; diff --git a/Source/Core/VideoBackends/D3D/D3DState.cpp b/Source/Core/VideoBackends/D3D/D3DState.cpp index bf250c52d0..563f94cd9d 100644 --- a/Source/Core/VideoBackends/D3D/D3DState.cpp +++ b/Source/Core/VideoBackends/D3D/D3DState.cpp @@ -183,9 +183,7 @@ ID3D11BlendState* StateCache::Get(BlendState state) auto it = m_blend.find(state.packed); if (it != m_blend.end()) - { return it->second; - } D3D11_BLEND_DESC blenddc = CD3D11_BLEND_DESC(CD3D11_DEFAULT()); @@ -256,9 +254,7 @@ ID3D11RasterizerState* StateCache::Get(RasterizerState state) auto it = m_raster.find(state.packed); if (it != m_raster.end()) - { return it->second; - } D3D11_RASTERIZER_DESC rastdc = CD3D11_RASTERIZER_DESC(state.wireframe ? D3D11_FILL_WIREFRAME : D3D11_FILL_SOLID, state.cull_mode, @@ -279,9 +275,7 @@ ID3D11DepthStencilState* StateCache::Get(ZMode state) auto it = m_depth.find(state.hex); if (it != m_depth.end()) - { return it->second; - } D3D11_DEPTH_STENCIL_DESC depthdc = CD3D11_DEPTH_STENCIL_DESC(CD3D11_DEFAULT()); diff --git a/Source/Core/VideoBackends/D3D/D3DTexture.cpp b/Source/Core/VideoBackends/D3D/D3DTexture.cpp index d08c850187..e1c94d5974 100644 --- a/Source/Core/VideoBackends/D3D/D3DTexture.cpp +++ b/Source/Core/VideoBackends/D3D/D3DTexture.cpp @@ -43,9 +43,12 @@ D3DTexture2D* D3DTexture2D::Create(unsigned int width, unsigned int height, D3D1 HRESULT hr; D3D11_CPU_ACCESS_FLAG cpuflags; - if (usage == D3D11_USAGE_STAGING) cpuflags = (D3D11_CPU_ACCESS_FLAG)((int)D3D11_CPU_ACCESS_WRITE|(int)D3D11_CPU_ACCESS_READ); - else if (usage == D3D11_USAGE_DYNAMIC) cpuflags = D3D11_CPU_ACCESS_WRITE; - else cpuflags = (D3D11_CPU_ACCESS_FLAG)0; + if (usage == D3D11_USAGE_STAGING) + cpuflags = (D3D11_CPU_ACCESS_FLAG)((int)D3D11_CPU_ACCESS_WRITE|(int)D3D11_CPU_ACCESS_READ); + else if (usage == D3D11_USAGE_DYNAMIC) + cpuflags = D3D11_CPU_ACCESS_WRITE; + else + cpuflags = (D3D11_CPU_ACCESS_FLAG)0; D3D11_TEXTURE2D_DESC texdesc = CD3D11_TEXTURE2D_DESC(fmt, width, height, 1, levels, bind, usage, cpuflags); hr = D3D::device->CreateTexture2D(&texdesc, nullptr, &pTexture); if (FAILED(hr)) @@ -90,9 +93,12 @@ D3DTexture2D::D3DTexture2D(ID3D11Texture2D* texptr, D3D11_BIND_FLAG bind, D3D11_SHADER_RESOURCE_VIEW_DESC srv_desc = CD3D11_SHADER_RESOURCE_VIEW_DESC(srv_dim, srv_format); D3D11_DEPTH_STENCIL_VIEW_DESC dsv_desc = CD3D11_DEPTH_STENCIL_VIEW_DESC(dsv_dim, dsv_format); D3D11_RENDER_TARGET_VIEW_DESC rtv_desc = CD3D11_RENDER_TARGET_VIEW_DESC(rtv_dim, rtv_format); - if (bind & D3D11_BIND_SHADER_RESOURCE) D3D::device->CreateShaderResourceView(tex, &srv_desc, &srv); - if (bind & D3D11_BIND_RENDER_TARGET) D3D::device->CreateRenderTargetView(tex, &rtv_desc, &rtv); - if (bind & D3D11_BIND_DEPTH_STENCIL) D3D::device->CreateDepthStencilView(tex, &dsv_desc, &dsv); + if (bind & D3D11_BIND_SHADER_RESOURCE) + D3D::device->CreateShaderResourceView(tex, &srv_desc, &srv); + if (bind & D3D11_BIND_RENDER_TARGET) + D3D::device->CreateRenderTargetView(tex, &rtv_desc, &rtv); + if (bind & D3D11_BIND_DEPTH_STENCIL) + D3D::device->CreateDepthStencilView(tex, &dsv_desc, &dsv); tex->AddRef(); } diff --git a/Source/Core/VideoBackends/D3D/PerfQuery.cpp b/Source/Core/VideoBackends/D3D/PerfQuery.cpp index 61a501d640..d80d934c7c 100644 --- a/Source/Core/VideoBackends/D3D/PerfQuery.cpp +++ b/Source/Core/VideoBackends/D3D/PerfQuery.cpp @@ -72,21 +72,13 @@ u32 PerfQuery::GetQueryResult(PerfQueryType type) u32 result = 0; if (type == PQ_ZCOMP_INPUT_ZCOMPLOC || type == PQ_ZCOMP_OUTPUT_ZCOMPLOC) - { result = m_results[PQG_ZCOMP_ZCOMPLOC]; - } else if (type == PQ_ZCOMP_INPUT || type == PQ_ZCOMP_OUTPUT) - { result = m_results[PQG_ZCOMP]; - } else if (type == PQ_BLEND_INPUT) - { result = m_results[PQG_ZCOMP] + m_results[PQG_ZCOMP_ZCOMPLOC]; - } else if (type == PQ_EFB_COPY_CLOCKS) - { result = m_results[PQG_EFB_COPY_CLOCKS]; - } return result / 4; } diff --git a/Source/Core/VideoBackends/D3D/VertexShaderCache.cpp b/Source/Core/VideoBackends/D3D/VertexShaderCache.cpp index 4758d2e630..d565d50c03 100644 --- a/Source/Core/VideoBackends/D3D/VertexShaderCache.cpp +++ b/Source/Core/VideoBackends/D3D/VertexShaderCache.cpp @@ -125,7 +125,8 @@ void VertexShaderCache::Init() D3D::CompileVertexShader(simple_shader_code, &blob); D3D::device->CreateInputLayout(simpleelems, 2, blob->Data(), blob->Size(), &SimpleLayout); SimpleVertexShader = D3D::CreateVertexShaderFromByteCode(blob); - if (SimpleLayout == nullptr || SimpleVertexShader == nullptr) PanicAlert("Failed to create simple vertex shader or input layout at %s %d\n", __FILE__, __LINE__); + if (SimpleLayout == nullptr || SimpleVertexShader == nullptr) + PanicAlert("Failed to create simple vertex shader or input layout at %s %d\n", __FILE__, __LINE__); blob->Release(); D3D::SetDebugObjectName((ID3D11DeviceChild*)SimpleVertexShader, "simple vertex shader"); D3D::SetDebugObjectName((ID3D11DeviceChild*)SimpleLayout, "simple input layout"); @@ -133,7 +134,8 @@ void VertexShaderCache::Init() D3D::CompileVertexShader(clear_shader_code, &blob); D3D::device->CreateInputLayout(clearelems, 2, blob->Data(), blob->Size(), &ClearLayout); ClearVertexShader = D3D::CreateVertexShaderFromByteCode(blob); - if (ClearLayout == nullptr || ClearVertexShader == nullptr) PanicAlert("Failed to create clear vertex shader or input layout at %s %d\n", __FILE__, __LINE__); + if (ClearLayout == nullptr || ClearVertexShader == nullptr) + PanicAlert("Failed to create clear vertex shader or input layout at %s %d\n", __FILE__, __LINE__); blob->Release(); D3D::SetDebugObjectName((ID3D11DeviceChild*)ClearVertexShader, "clear vertex shader"); D3D::SetDebugObjectName((ID3D11DeviceChild*)ClearLayout, "clear input layout"); diff --git a/Source/Core/VideoBackends/D3D/VideoBackend.h b/Source/Core/VideoBackends/D3D/VideoBackend.h index d28f1b545f..862e8ca373 100644 --- a/Source/Core/VideoBackends/D3D/VideoBackend.h +++ b/Source/Core/VideoBackends/D3D/VideoBackend.h @@ -8,7 +8,7 @@ namespace DX11 class VideoBackend : public VideoBackendHardware { - bool Initialize(void *) override; + bool Initialize(void*) override; void Shutdown() override; std::string GetName() const override; diff --git a/Source/Core/VideoBackends/OGL/ProgramShaderCache.h b/Source/Core/VideoBackends/OGL/ProgramShaderCache.h index dd376142be..cab5107eea 100644 --- a/Source/Core/VideoBackends/OGL/ProgramShaderCache.h +++ b/Source/Core/VideoBackends/OGL/ProgramShaderCache.h @@ -52,7 +52,7 @@ struct SHADER glDeleteProgram(glprogid); glprogid = 0; } - GLuint glprogid; // opengl program id + GLuint glprogid; // OpenGL program id std::string strvprog, strpprog; diff --git a/Source/Core/VideoBackends/OGL/TextureConverter.cpp b/Source/Core/VideoBackends/OGL/TextureConverter.cpp index 0b7275eaa4..1404ec92eb 100644 --- a/Source/Core/VideoBackends/OGL/TextureConverter.cpp +++ b/Source/Core/VideoBackends/OGL/TextureConverter.cpp @@ -56,7 +56,7 @@ static void CreatePrograms() * * This shader doesn't really match what the GameCube does internally in the * copy pipeline. - * 1. It uses Opengl's built in filtering when yscaling, someone could work + * 1. It uses OpenGL's built in filtering when yscaling, someone could work * out how the copypipeline does it's filtering and implement it correctly * in this shader. * 2. Deflickering isn't implemented, a futher filtering over 3 lines. diff --git a/Source/Core/VideoBackends/Software/EfbInterface.cpp b/Source/Core/VideoBackends/Software/EfbInterface.cpp index fad9660c14..b3cd96acf3 100644 --- a/Source/Core/VideoBackends/Software/EfbInterface.cpp +++ b/Source/Core/VideoBackends/Software/EfbInterface.cpp @@ -553,7 +553,7 @@ namespace EfbInterface } } - // Like CopyToXFB, but we copy directly into the opengl color texture without going via GameCube main memory or doing a yuyv conversion + // Like CopyToXFB, but we copy directly into the OpenGL color texture without going via GameCube main memory or doing a yuyv conversion void BypassXFB(u8* texture, u32 fbWidth, u32 fbHeight, const EFBRectangle& sourceRc, float Gamma) { if (fbWidth*fbHeight > MAX_XFB_WIDTH*MAX_XFB_HEIGHT) diff --git a/Source/Core/VideoCommon/VertexManagerBase.h b/Source/Core/VideoCommon/VertexManagerBase.h index a363d0d336..604bf0a480 100644 --- a/Source/Core/VideoCommon/VertexManagerBase.h +++ b/Source/Core/VideoCommon/VertexManagerBase.h @@ -57,7 +57,7 @@ protected: private: static bool IsFlushed; - //virtual void Draw(u32 stride, bool alphapass) = 0; + // virtual void Draw(u32 stride, bool alphapass) = 0; // temp virtual void vFlush(bool useDstAlpha) = 0; };