Skip to content

Commit

Permalink
Merge pull request #1582 from Stevoisiak/newImprovedFormatting
Browse files Browse the repository at this point in the history
More formatting and consistency fixes
  • Loading branch information
lioncash committed Nov 25, 2014
2 parents dcdd4e5 + 6da394a commit aa92797
Show file tree
Hide file tree
Showing 19 changed files with 33 additions and 55 deletions.
2 changes: 1 addition & 1 deletion Source/Core/Core/HW/DSP.h
Expand Up @@ -61,7 +61,7 @@ void Shutdown();

void RegisterMMIO(MMIO::Mapping* mmio, u32 base);

DSPEmulator *GetDSPEmulator();
DSPEmulator* GetDSPEmulator();

void DoState(PointerWrap &p);

Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/HW/DSPHLE/UCodes/ROM.h
Expand Up @@ -9,7 +9,7 @@
class ROMUCode : public UCodeInterface
{
public:
ROMUCode(DSPHLE *dsphle, u32 crc);
ROMUCode(DSPHLE* dsphle, u32 crc);
virtual ~ROMUCode();
u32 GetUpdateMs() override;

Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/HW/DSPHLE/UCodes/UCodes.cpp
Expand Up @@ -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)
{
Expand Down
4 changes: 0 additions & 4 deletions Source/Core/DiscIO/BannerLoader.cpp
Expand Up @@ -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;
}
Expand Down
14 changes: 2 additions & 12 deletions Source/Core/DiscIO/NANDContentLoader.cpp
Expand Up @@ -129,7 +129,7 @@ class CNANDContentLoader : public INANDContentLoader
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<SNANDContent> m_Content;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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))
{
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions Source/Core/DiscIO/VolumeWiiCrypted.cpp
Expand Up @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/DolphinWX/Android/ButtonManager.h
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/DolphinWX/ISOFile.cpp
Expand Up @@ -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();
}
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/DolphinWX/Main.cpp
Expand Up @@ -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()
{
Expand Down
8 changes: 4 additions & 4 deletions Source/Core/VideoBackends/D3D/D3DBase.h
Expand Up @@ -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 <typename T>
Expand All @@ -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;

Expand Down
6 changes: 0 additions & 6 deletions Source/Core/VideoBackends/D3D/D3DState.cpp
Expand Up @@ -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());

Expand Down Expand Up @@ -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,
Expand All @@ -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());

Expand Down
18 changes: 12 additions & 6 deletions Source/Core/VideoBackends/D3D/D3DTexture.cpp
Expand Up @@ -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))
Expand Down Expand Up @@ -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();
}

Expand Down
8 changes: 0 additions & 8 deletions Source/Core/VideoBackends/D3D/PerfQuery.cpp
Expand Up @@ -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;
}
Expand Down
6 changes: 4 additions & 2 deletions Source/Core/VideoBackends/D3D/VertexShaderCache.cpp
Expand Up @@ -125,15 +125,17 @@ 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");

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");
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/VideoBackends/D3D/VideoBackend.h
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/VideoBackends/OGL/ProgramShaderCache.h
Expand Up @@ -52,7 +52,7 @@ struct SHADER
glDeleteProgram(glprogid);
glprogid = 0;
}
GLuint glprogid; // opengl program id
GLuint glprogid; // OpenGL program id

std::string strvprog, strpprog;

Expand Down
2 changes: 1 addition & 1 deletion Source/Core/VideoBackends/OGL/TextureConverter.cpp
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/VideoBackends/Software/EfbInterface.cpp
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/VideoCommon/VertexManagerBase.h
Expand Up @@ -57,7 +57,7 @@ class VertexManager
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;
};
Expand Down

0 comments on commit aa92797

Please sign in to comment.