mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-05-29 22:42:39 +00:00
D3D9: Offset vertices used to copy textures by 0.5.
I __think__ this is the actually correct way to do it, but not sure. Someone please have a look at this... Not sure if this changes anything anyway, since we're using scissor rects to clip this stuff anyway... Maybe the screen edges weren't cleaned properly before though. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7063 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
1339c06d6e
commit
f7d757b46e
3 changed files with 23 additions and 18 deletions
|
@ -434,13 +434,15 @@ void drawShadedTexSubQuad(IDirect3DTexture9 *texture,
|
|||
|
||||
// Fills a certain area of the current render target with the specified color
|
||||
// Z buffer disabled; destination coordinates normalized to (-1;1)
|
||||
void drawColorQuad(u32 Color, float x1, float y1, float x2, float y2)
|
||||
void drawColorQuad(int DestWidth, int DestHeight, u32 Color, float x1, float y1, float x2, float y2)
|
||||
{
|
||||
float dw = 1.f / (float)DestWidth;
|
||||
float dh = 1.f / (float)DestHeight;
|
||||
struct CQVertex { float x, y, z, rhw; u32 col; } coords[4] = {
|
||||
{ x1, y2, 0.f, 1.f, Color },
|
||||
{ x2, y2, 0.f, 1.f, Color },
|
||||
{ x1, y1, 0.f, 1.f, Color },
|
||||
{ x2, y1, 0.f, 1.f, Color },
|
||||
{ x1-dw, y2+dh, 0.f, 1.f, Color },
|
||||
{ x2-dw, y2+dh, 0.f, 1.f, Color },
|
||||
{ x1-dw, y1+dh, 0.f, 1.f, Color },
|
||||
{ x2-dw, y1+dh, 0.f, 1.f, Color },
|
||||
};
|
||||
dev->SetVertexShader(VertexShaderCache::GetClearVertexShader());
|
||||
dev->SetPixelShader(PixelShaderCache::GetClearProgram());
|
||||
|
@ -449,13 +451,15 @@ void drawColorQuad(u32 Color, float x1, float y1, float x2, float y2)
|
|||
RestoreShaders();
|
||||
}
|
||||
|
||||
void drawClearQuad(u32 Color,float z,IDirect3DPixelShader9 *PShader,IDirect3DVertexShader9 *Vshader)
|
||||
void drawClearQuad(int DestWidth, int DestHeight, u32 Color, float z, IDirect3DPixelShader9 *PShader, IDirect3DVertexShader9 *Vshader)
|
||||
{
|
||||
float dw = 1.f / (float)DestWidth;
|
||||
float dh = 1.f / (float)DestHeight;
|
||||
struct Q2DVertex { float x,y,z,rhw;u32 color;} coords[4] = {
|
||||
{-1.0f, 1.0f, z, 1.0f, Color},
|
||||
{ 1.0f, 1.0f, z, 1.0f, Color},
|
||||
{ 1.0f, -1.0f, z, 1.0f, Color},
|
||||
{-1.0f, -1.0f, z, 1.0f, Color}
|
||||
{-1.0f-dw, 1.0f+dh, z, 1.0f, Color},
|
||||
{ 1.0f-dw, 1.0f+dh, z, 1.0f, Color},
|
||||
{ 1.0f-dw, -1.0f+dh, z, 1.0f, Color},
|
||||
{-1.0f-dw, -1.0f+dh, z, 1.0f, Color}
|
||||
};
|
||||
dev->SetVertexShader(Vshader);
|
||||
dev->SetPixelShader(PShader);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue