Aniso filter setting working in GL, some code moving around, spelling fixes

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1341 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hrydgard
2008-11-30 14:15:34 +00:00
parent 9ed23af1c2
commit c541f3c335
21 changed files with 1037 additions and 853 deletions

View File

@ -268,7 +268,7 @@ void BPWritten(int addr, int changes, int newval)
}
if (changes & 0x18)
SetColorMask();
Renderer::SetColorMask();
}
break;
@ -342,7 +342,7 @@ void BPWritten(int addr, int changes, int newval)
if (changes) {
VertexManager::Flush();
((u32*)&bpmem)[addr] = newval;
SetScissorRect();
Renderer::SetScissorRect();
}
break;
@ -352,7 +352,7 @@ void BPWritten(int addr, int changes, int newval)
if (changes) {
VertexManager::Flush();
((u32*)&bpmem)[addr] = newval;
if (!SetScissorRect()) {
if (!Renderer::SetScissorRect()) {
if (addr == BPMEM_SCISSORBR )
ERROR_LOG("bad scissor!\n");
}
@ -447,7 +447,7 @@ void BPWritten(int addr, int changes, int newval)
PE_copy.Hex = bpmem.triggerEFBCopy;
if (PE_copy.copy_to_xfb == 0) {
if(g_Config.bEBFToTextureDisable) {
if(g_Config.bEFBToTextureDisable) {
glViewport(rc.left,rc.bottom,rc.right,rc.top);
glScissor(rc.left,rc.bottom,rc.right,rc.top);
}
@ -521,7 +521,7 @@ void BPWritten(int addr, int changes, int newval)
((bpmem.clearZValue>>8)&0xff)*(1/255.0f),
((bpmem.clearZValue>>16)&0xff)*(1/255.0f), 0);
glClear(GL_COLOR_BUFFER_BIT);
SetColorMask();
Renderer::SetColorMask();
GL_REPORT_ERRORD();
}
@ -531,7 +531,7 @@ void BPWritten(int addr, int changes, int newval)
glDrawBuffers(2, s_drawbuffers);
}
SetScissorRect(); // reset the scissor rect
Renderer::SetScissorRect(); // reset the scissor rect
}
}
break;
@ -732,70 +732,6 @@ void BPWritten(int addr, int changes, int newval)
}
}
void SetColorMask()
{
if (bpmem.blendmode.alphaupdate && bpmem.blendmode.colorupdate)
glColorMask(GL_TRUE,GL_TRUE,GL_TRUE,GL_TRUE);
else if (bpmem.blendmode.alphaupdate)
glColorMask(GL_FALSE,GL_FALSE,GL_FALSE,GL_TRUE);
else if (bpmem.blendmode.colorupdate)
glColorMask(GL_TRUE,GL_TRUE,GL_TRUE,GL_FALSE);
}
// =======================================================================================
// Call browser: OpcodeDecoding.cpp ExecuteDisplayList > Decode() > LoadBPReg()
// case 0x52 > SetScissorRect()
// ---------------
// This function handles the OpenGL glScissor() function
// ---------------
// bpmem.scissorTL.x, y = 342x342
// bpmem.scissorBR.x, y = 981x821
// Renderer::GetTargetHeight() = the fixed ini file setting
// ---------------
bool SetScissorRect()
{
int xoff = bpmem.scissorOffset.x * 2 - 342;
int yoff = bpmem.scissorOffset.y * 2 - 342;
float rc_left = bpmem.scissorTL.x - xoff - 342; // left = 0
rc_left *= MValueX;
if (rc_left < 0) rc_left = 0;
float rc_top = bpmem.scissorTL.y - yoff - 342; // right = 0
rc_top *= MValueY;
if (rc_top < 0) rc_top = 0;
float rc_right = bpmem.scissorBR.x - xoff - 342; // right = 640
rc_right *= MValueX;
if (rc_right > 640 * MValueX) rc_right = 640 * MValueX;
float rc_bottom = bpmem.scissorBR.y - yoff - 342; // bottom = 480
rc_bottom *= MValueY;
if (rc_bottom > 480 * MValueY) rc_bottom = 480 * MValueY;
/*__Log("Scissor: lt=(%d,%d), rb=(%d,%d,%i), off=(%d,%d)\n",
rc_left, rc_top,
rc_right, rc_bottom, Renderer::GetTargetHeight(),
xoff, yoff
);*/
if (rc_right >= rc_left && rc_bottom >= rc_top )
{
glScissor(
(int)rc_left, // x = 0
Renderer::GetTargetHeight()-(int)(rc_bottom), // y = 0
(int)(rc_right-rc_left), // y = 0
(int)(rc_bottom-rc_top) // y = 0
);
return true;
}
return false;
}
// Call browser: OpcodeDecoding.cpp ExecuteDisplayList > Decode() > LoadBPReg()
void LoadBPReg(u32 value0)
{