More formatting and consistency fixes

This commit is contained in:
Stevoisiak 2014-11-14 14:46:49 -05:00 committed by Stevoisiak
parent 60e9301f40
commit 6da394a4d0
19 changed files with 33 additions and 55 deletions

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

@ -267,20 +267,14 @@ 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;
return true;
@ -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))
{

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

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

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

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