one hundred percent correct scaling in GL plugin now, or at least it should be. report problems as they come

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@242 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Sonicadvance1 2008-08-18 09:15:05 +00:00
parent af7e0404ca
commit e0b3e32860
2 changed files with 12 additions and 3 deletions

View File

@ -602,6 +602,13 @@ void LoadBPReg(u32 value0)
((u32*)&bpmem)[opcode] = newval;
TRectangle rc = {
(int)(bpmem.copyTexSrcXY.x),
(int)(bpmem.copyTexSrcXY.y),
(int)((bpmem.copyTexSrcXY.x + bpmem.copyTexSrcWH.x)),
(int)((bpmem.copyTexSrcXY.y + bpmem.copyTexSrcWH.y))
};
//Need another rc here to get it to scale.
TRectangle multirc = {
(int)(bpmem.copyTexSrcXY.x * MValue),
(int)(bpmem.copyTexSrcXY.y * MValue),
(int)((bpmem.copyTexSrcXY.x * MValue + bpmem.copyTexSrcWH.x * MValue)),
@ -619,7 +626,7 @@ void LoadBPReg(u32 value0)
}
else {
// EFB to XFB
Renderer::Swap(rc);
Renderer::Swap(multirc);
g_VideoInitialize.pCopiedToXFB();
}
@ -633,8 +640,8 @@ void LoadBPReg(u32 value0)
glViewport(0, 0, Renderer::GetTargetWidth(), Renderer::GetTargetHeight());
// if copied to texture, set the dimensions to the source copy dims, otherwise, clear the entire buffer
if( PE_copy.copy_to_xfb == 0 )
glScissor(rc.left * MValue, (Renderer::GetTargetHeight()-rc.bottom * MValue),
(rc.right * MValue - rc.left * MValue), (rc.bottom * MValue-rc.top * MValue));
glScissor(multirc.left, (Renderer::GetTargetHeight() - multirc.bottom),
(multirc.right - multirc.left), (multirc.bottom - multirc.top));
VertexShaderMngr::SetViewportChanged();
// since clear operations use the source rectangle, have to do regular renders (glClear clears the entire buffer)

View File

@ -318,6 +318,8 @@ void TextureMngr::CopyRenderTargetToTexture(u32 address, bool bFromZBuffer, bool
entry.frameCount = frameCount;
int mult = bScaleByHalf?2:1;
// int wmulti = (abs(source->right-source->left)/mult+7)&~7;
//int hmulti = (abs(source->bottom-source->top)/mult+7)&~7;
int w = (abs(source->right-source->left)/mult+7)&~7;
int h = (abs(source->bottom-source->top)/mult+7)&~7;