Merge pull request #1582 from Stevoisiak/newImprovedFormatting

More formatting and consistency fixes
This commit is contained in:
Lioncash 2014-11-25 12:41:32 -05:00
commit aa92797f93
19 changed files with 33 additions and 55 deletions

View File

@ -61,7 +61,7 @@ void Shutdown();
void RegisterMMIO(MMIO::Mapping* mmio, u32 base);
DSPEmulator *GetDSPEmulator();
DSPEmulator* GetDSPEmulator();
void DoState(PointerWrap &p);

View File

@ -9,7 +9,7 @@
class ROMUCode : public UCodeInterface
{
public:
ROMUCode(DSPHLE *dsphle, u32 crc);
ROMUCode(DSPHLE* dsphle, u32 crc);
virtual ~ROMUCode();
u32 GetUpdateMs() override;

View File

@ -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)
{

View File

@ -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;
}

View File

@ -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<SNANDContent> 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);

View File

@ -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)
{

View File

@ -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);

View File

@ -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();
}

View File

@ -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()
{

View File

@ -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>
@ -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;

View File

@ -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());

View File

@ -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();
}

View File

@ -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;
}

View File

@ -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");

View File

@ -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;

View File

@ -52,7 +52,7 @@ struct SHADER
glDeleteProgram(glprogid);
glprogid = 0;
}
GLuint glprogid; // opengl program id
GLuint glprogid; // OpenGL program id
std::string strvprog, strpprog;

View File

@ -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.

View File

@ -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)

View File

@ -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;
};