mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
cleanup + some eolz
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5842 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -284,7 +284,7 @@ int CD3DFont::DrawTextScaled(float x, float y, float size, float spacing, u32 dw
|
||||
float sizeratio = size / (float)m_LineHeight;
|
||||
|
||||
// translate starting positions
|
||||
float sx = x * scalex - 1.f;
|
||||
float sx = x * scalex - 1.f;
|
||||
float sy = 1.f - y * scaley;
|
||||
char c;
|
||||
|
||||
@ -355,7 +355,7 @@ int CD3DFont::DrawTextScaled(float x, float y, float size, float spacing, u32 dw
|
||||
v[4] = v[2];
|
||||
v[5] = v[1];
|
||||
|
||||
memcpy(pVertices, v, 6*sizeof(FONT2DVERTEX));
|
||||
memcpy(pVertices, v, 6*sizeof(FONT2DVERTEX));
|
||||
|
||||
pVertices+=6;
|
||||
dwNumTriangles += 2;
|
||||
@ -416,7 +416,7 @@ ID3D11Buffer* clearvb = NULL;
|
||||
|
||||
typedef struct { float x,y,z,u,v; } STQVertex;
|
||||
typedef struct { float x,y,z,u,v; } STSQVertex;
|
||||
typedef struct { float x,y,z; u32 col;} ClearVertex;
|
||||
typedef struct { float x,y,z; u32 col; } ClearVertex;
|
||||
|
||||
void InitUtils()
|
||||
{
|
||||
@ -496,7 +496,7 @@ void drawShadedTexQuad(ID3D11ShaderResourceView* texture,
|
||||
D3D::context->IASetInputLayout(layout);
|
||||
D3D::context->IASetVertexBuffers(0, 1, &stqvb, &stride, &offset);
|
||||
D3D::context->PSSetSamplers(0, 1, &stqsamplerstate);
|
||||
D3D::context->PSSetShader(PShader, NULL, 0);
|
||||
D3D::context->PSSetShader(PShader, NULL, 0);
|
||||
D3D::context->PSSetShaderResources(0, 1, &texture);
|
||||
D3D::context->VSSetShader(Vshader, NULL, 0);
|
||||
D3D::stateman->Apply();
|
||||
|
@ -361,4 +361,4 @@ void StateManager::Apply()
|
||||
else ERROR_LOG(VIDEO, "Tried to apply without rasterizer state!");
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
@ -140,13 +140,13 @@ bool Init()
|
||||
|
||||
CreateDeviceObjects();
|
||||
|
||||
IndexGenerator::Start(TIBuffer,LIBuffer,PIBuffer);
|
||||
IndexGenerator::Start(TIBuffer,LIBuffer,PIBuffer);
|
||||
return true;
|
||||
}
|
||||
|
||||
void ResetBuffer()
|
||||
{
|
||||
s_pCurBufferPointer = LocalVBuffer;
|
||||
s_pCurBufferPointer = LocalVBuffer;
|
||||
}
|
||||
|
||||
void Shutdown()
|
||||
@ -163,12 +163,12 @@ void AddIndices(int _primitive, int _numVertices)
|
||||
{
|
||||
switch (_primitive)
|
||||
{
|
||||
case GX_DRAW_QUADS: IndexGenerator::AddQuads(_numVertices); break;
|
||||
case GX_DRAW_QUADS: IndexGenerator::AddQuads(_numVertices); break;
|
||||
case GX_DRAW_TRIANGLES: IndexGenerator::AddList(_numVertices); break;
|
||||
case GX_DRAW_TRIANGLE_STRIP: IndexGenerator::AddStrip(_numVertices); break;
|
||||
case GX_DRAW_TRIANGLE_FAN: IndexGenerator::AddFan(_numVertices); break;
|
||||
case GX_DRAW_LINE_STRIP: IndexGenerator::AddLineStrip(_numVertices); break;
|
||||
case GX_DRAW_LINES: IndexGenerator::AddLineList(_numVertices); break;
|
||||
case GX_DRAW_LINES: IndexGenerator::AddLineList(_numVertices); break;
|
||||
case GX_DRAW_POINTS: IndexGenerator::AddPoints(_numVertices); break;
|
||||
}
|
||||
}
|
||||
@ -225,7 +225,7 @@ void AddVertices(int _primitive, int _numVertices)
|
||||
IndexGenerator::Start(TIBuffer,LIBuffer,PIBuffer);
|
||||
Flushed=false;
|
||||
}
|
||||
lastPrimitive = _primitive;
|
||||
lastPrimitive = _primitive;
|
||||
ADDSTAT(stats.thisFrame.numPrims, _numVertices);
|
||||
INCSTAT(stats.thisFrame.numPrimitiveJoins);
|
||||
AddIndices(_primitive, _numVertices);
|
||||
@ -244,7 +244,7 @@ inline void Draw(unsigned int stride, bool alphapass)
|
||||
}
|
||||
|
||||
UINT bufoffset = 0;
|
||||
UINT bufstride = (UINT)stride;
|
||||
UINT bufstride = stride;
|
||||
|
||||
if (!alphapass) gfxstate->ApplyState();
|
||||
else gfxstate->AlphaPass();
|
||||
@ -361,7 +361,7 @@ void Flush()
|
||||
|
||||
Draw(stride, false);
|
||||
|
||||
if (bpmem.dstalpha.enable && bpmem.blendmode.alphaupdate)
|
||||
if (bpmem.dstalpha.enable && bpmem.blendmode.alphaupdate)
|
||||
{
|
||||
DWORD write = 0;
|
||||
if (!PixelShaderCache::SetShader(true))
|
||||
|
@ -92,16 +92,6 @@ bool IsD3D()
|
||||
return true;
|
||||
}
|
||||
|
||||
bool IsD3D9()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IsD3D11()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// This is used for the functions right below here which use wxwidgets
|
||||
#if defined(HAVE_WX) && HAVE_WX
|
||||
WXDLLIMPEXP_BASE void wxSetInstance(HINSTANCE hInst);
|
||||
@ -128,7 +118,7 @@ void DllDebugger(HWND _hParent, bool Show)
|
||||
return true;
|
||||
}
|
||||
};
|
||||
IMPLEMENT_APP_NO_MAIN(wxDLLApp)
|
||||
IMPLEMENT_APP_NO_MAIN(wxDLLApp)
|
||||
WXDLLIMPEXP_BASE void wxSetInstance(HINSTANCE hInst);
|
||||
#endif
|
||||
|
||||
@ -173,7 +163,7 @@ void UpdateFPSDisplay(const char* text)
|
||||
{
|
||||
char temp[512];
|
||||
sprintf_s(temp, 512, "SVN R%i: DX11: %s", SVN_REV, text);
|
||||
SetWindowTextA(EmuWindow::GetWnd(), temp);
|
||||
SetWindowTextA(EmuWindow::GetWnd(), temp);
|
||||
}
|
||||
|
||||
void GetDllInfo(PLUGIN_INFO* _PluginInfo)
|
||||
@ -220,9 +210,9 @@ void Initialize(void* init)
|
||||
g_VideoInitialize.pPeekMessages = &Callback_PeekMessages;
|
||||
g_VideoInitialize.pUpdateFPSDisplay = &UpdateFPSDisplay;
|
||||
|
||||
_pVideoInitialize->pPeekMessages = g_VideoInitialize.pPeekMessages;
|
||||
_pVideoInitialize->pUpdateFPSDisplay = g_VideoInitialize.pUpdateFPSDisplay;
|
||||
_pVideoInitialize->pWindowHandle = g_VideoInitialize.pWindowHandle;
|
||||
_pVideoInitialize->pPeekMessages = g_VideoInitialize.pPeekMessages;
|
||||
_pVideoInitialize->pUpdateFPSDisplay = g_VideoInitialize.pUpdateFPSDisplay;
|
||||
_pVideoInitialize->pWindowHandle = g_VideoInitialize.pWindowHandle;
|
||||
|
||||
OSD::AddMessage("Dolphin Direct3D 11 Video Plugin.", 5000);
|
||||
s_PluginInitialized = true;
|
||||
@ -244,8 +234,8 @@ void Video_Prepare()
|
||||
VertexShaderManager::Init();
|
||||
PixelShaderCache::Init();
|
||||
PixelShaderManager::Init();
|
||||
CommandProcessor::Init();
|
||||
PixelEngine::Init();
|
||||
CommandProcessor::Init();
|
||||
PixelEngine::Init();
|
||||
D3D::InitUtils();
|
||||
|
||||
// tell the host that the window is ready
|
||||
@ -339,14 +329,14 @@ void VideoFifo_CheckSwapRequestAt(u32 xfbAddr, u32 fbWidth, u32 fbHeight)
|
||||
if (addrRangesOverlap(aLower, aUpper, bLower, bUpper))
|
||||
VideoFifo_CheckSwapRequest();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Run from the CPU thread (from VideoInterface.cpp)
|
||||
void Video_BeginField(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight)
|
||||
{
|
||||
if (s_PluginInitialized && g_ActiveConfig.bUseXFB)
|
||||
{
|
||||
{
|
||||
if (g_VideoInitialize.bOnThread)
|
||||
{
|
||||
while (Common::AtomicLoadAcquire(s_swapRequested) && !s_FifoShuttingDown)
|
||||
@ -354,7 +344,7 @@ void Video_BeginField(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight)
|
||||
Common::YieldCPU();
|
||||
}
|
||||
else
|
||||
VideoFifo_CheckSwapRequest();
|
||||
VideoFifo_CheckSwapRequest();
|
||||
s_beginFieldArgs.xfbAddr = xfbAddr;
|
||||
s_beginFieldArgs.field = field;
|
||||
s_beginFieldArgs.fbWidth = fbWidth;
|
||||
@ -373,11 +363,6 @@ void Video_AddMessage(const char* pstr, u32 milliseconds)
|
||||
OSD::AddMessage(pstr, milliseconds);
|
||||
}
|
||||
|
||||
HRESULT ScreenShot(const char* filename)
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void Video_Screenshot(const char* _szFilename)
|
||||
{
|
||||
Renderer::SetScreenshot(_szFilename);
|
||||
@ -430,37 +415,37 @@ u32 Video_AccessEFB(EFBAccessType type, u32 x, u32 y, u32 InputData)
|
||||
|
||||
void Video_CommandProcessorRead16(u16& _rReturnValue, const u32 _Address)
|
||||
{
|
||||
CommandProcessor::Read16(_rReturnValue, _Address);
|
||||
CommandProcessor::Read16(_rReturnValue, _Address);
|
||||
}
|
||||
|
||||
void Video_CommandProcessorWrite16(const u16 _Data, const u32 _Address)
|
||||
{
|
||||
CommandProcessor::Write16(_Data, _Address);
|
||||
CommandProcessor::Write16(_Data, _Address);
|
||||
}
|
||||
|
||||
void Video_PixelEngineRead16(u16& _rReturnValue, const u32 _Address)
|
||||
{
|
||||
PixelEngine::Read16(_rReturnValue, _Address);
|
||||
PixelEngine::Read16(_rReturnValue, _Address);
|
||||
}
|
||||
|
||||
void Video_PixelEngineWrite16(const u16 _Data, const u32 _Address)
|
||||
{
|
||||
PixelEngine::Write16(_Data, _Address);
|
||||
PixelEngine::Write16(_Data, _Address);
|
||||
}
|
||||
|
||||
void Video_PixelEngineWrite32(const u32 _Data, const u32 _Address)
|
||||
{
|
||||
PixelEngine::Write32(_Data, _Address);
|
||||
PixelEngine::Write32(_Data, _Address);
|
||||
}
|
||||
|
||||
inline void Video_GatherPipeBursted(void)
|
||||
{
|
||||
CommandProcessor::GatherPipeBursted();
|
||||
CommandProcessor::GatherPipeBursted();
|
||||
}
|
||||
|
||||
void Video_WaitForFrameFinish(void)
|
||||
{
|
||||
CommandProcessor::WaitForFrameFinish();
|
||||
CommandProcessor::WaitForFrameFinish();
|
||||
}
|
||||
|
||||
bool Video_IsFifoBusy(void)
|
||||
|
Reference in New Issue
Block a user