More fog emulation groundwork both in OpenGL and DX9. Needs more fog format researching.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@586 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
a5488ccf58
commit
7c3f715f19
|
@ -39,6 +39,7 @@
|
|||
#define BPMEM_CLEARBBOX2 0x56 // TODO(ector): add something that watches bboxes
|
||||
#define BPMEM_TEXMODE0_1 0x80
|
||||
#define BPMEM_TEXMODE0_2 0xA0
|
||||
#define BPMEM_FOGRANGE 0xE8
|
||||
#define BPMEM_FOGPARAM0 0xEE
|
||||
#define BPMEM_FOGBMAGNITUDE 0xEF
|
||||
#define BPMEM_FOGBEXPONENT 0xF0
|
||||
|
|
|
@ -311,6 +311,14 @@ void BPWritten(int addr, int changes, int newval)
|
|||
}
|
||||
break;
|
||||
|
||||
case BPMEM_FOGRANGE:
|
||||
if(changes) {
|
||||
// TODO(XK): Fog range format
|
||||
//Renderer::SetRenderState(D3DRS_FOGSTART, ...
|
||||
//Renderer::SetRenderState(D3DRS_FOGEND, ...
|
||||
}
|
||||
break;
|
||||
|
||||
case BPMEM_FOGPARAM0:
|
||||
{
|
||||
// u32 fogATemp = bpmem.fog.a<<12;
|
||||
|
@ -341,11 +349,7 @@ void BPWritten(int addr, int changes, int newval)
|
|||
/// u32 fogCTemp = bpmem.fog.c_proj_fsel.cShifted12 << 12;
|
||||
// float fogC = *(float*)(&fogCTemp);
|
||||
|
||||
if(bpmem.fog.c_proj_fsel.fsel > 0 && !bFog) {
|
||||
Renderer::SetRenderState(D3DRS_FOGENABLE, true);
|
||||
bFog = true;
|
||||
}
|
||||
|
||||
|
||||
//printf("%f %f magnitude: %x\n", bpmem.fog.a.GetA(),bpmem.fog.c_proj_fsel.GetC(), bpmem.fog.b_magnitude);
|
||||
switch(bpmem.fog.c_proj_fsel.fsel)
|
||||
{
|
||||
|
@ -373,6 +377,12 @@ void BPWritten(int addr, int changes, int newval)
|
|||
PanicAlert("Non-Emulated Fog selection %d\n", bpmem.fog.c_proj_fsel.fsel);
|
||||
break;
|
||||
}
|
||||
|
||||
if(bpmem.fog.c_proj_fsel.fsel > 0 && !bFog) {
|
||||
Renderer::SetRenderState(D3DRS_FOGENABLE, true);
|
||||
bFog = true;
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
@ -256,6 +256,14 @@ void BPWritten(int addr, int changes, int newval)
|
|||
}
|
||||
break;
|
||||
|
||||
case BPMEM_FOGRANGE:
|
||||
if(changes) {
|
||||
// TODO(XK): Fog range format
|
||||
//glFogi(GL_FOG_START, ...
|
||||
//glFogi(GL_FOG_END, ...
|
||||
}
|
||||
break;
|
||||
|
||||
case BPMEM_FOGPARAM0:
|
||||
case BPMEM_FOGBEXPONENT:
|
||||
case BPMEM_FOGBMAGNITUDE:
|
||||
|
|
Loading…
Reference in New Issue