summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorXTra.KrazzY <XTra.KrazzY@gmail.com>2009-03-08 18:45:39 +0000
committerXTra.KrazzY <XTra.KrazzY@gmail.com>2009-03-08 18:45:39 +0000
commitc7a45ecf95d3b989b83b87ddaa43524aa962fa89 (patch)
treeb0a593a3ae0f948006321338560bb3815266bfc2 /Source
parentfeb670044e05b5db309fa0dfafe9b34a9c7bf7f5 (diff)
D3D scissoring, skip texture stages and some warning fixes.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2616 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source')
-rw-r--r--Source/Plugins/Plugin_VideoDX9/Src/Render.cpp13
-rw-r--r--Source/Plugins/Plugin_VideoDX9/Src/VertexManager.cpp7
-rw-r--r--Source/Plugins/Plugin_VideoDX9/Src/VertexShaderCache.cpp3
3 files changed, 14 insertions, 9 deletions
diff --git a/Source/Plugins/Plugin_VideoDX9/Src/Render.cpp b/Source/Plugins/Plugin_VideoDX9/Src/Render.cpp
index 7851b02195..017ddf3bb7 100644
--- a/Source/Plugins/Plugin_VideoDX9/Src/Render.cpp
+++ b/Source/Plugins/Plugin_VideoDX9/Src/Render.cpp
@@ -339,8 +339,14 @@ void Renderer::SetViewport(float* _Viewport)
void Renderer::SetScissorRect()
{
- /*
- RECT rc = {0,0,0,0}; // FIXX
+ int xoff = bpmem.scissorOffset.x * 2 - 342;
+ int yoff = bpmem.scissorOffset.y * 2 - 342;
+ RECT rc;
+ rc.left = (int)((float)bpmem.scissorTL.x - xoff - 342);
+ rc.top = (int)((float)bpmem.scissorTL.y - yoff - 342);
+ rc.right = (int)((float)bpmem.scissorBR.x - xoff - 341);
+ rc.bottom = (int)((float)bpmem.scissorBR.y - yoff - 341);
+
rc.left = (int)(rc.left * xScale);
rc.top = (int)(rc.top * yScale);
rc.right = (int)(rc.right * xScale);
@@ -348,7 +354,7 @@ void Renderer::SetScissorRect()
if (rc.right >= rc.left && rc.bottom >= rc.top)
D3D::dev->SetScissorRect(&rc);
else
- g_VideoInitialize.pLog("SCISSOR ERROR", FALSE);*/
+ g_VideoInitialize.pLog("SCISSOR ERROR", FALSE);
}
/*
@@ -456,6 +462,7 @@ void Renderer::SetSamplerState(DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD Va
}
}
+
// Called from VertexShaderManager
void UpdateViewport()
{
diff --git a/Source/Plugins/Plugin_VideoDX9/Src/VertexManager.cpp b/Source/Plugins/Plugin_VideoDX9/Src/VertexManager.cpp
index 6fb7691ebf..7fc09a62c7 100644
--- a/Source/Plugins/Plugin_VideoDX9/Src/VertexManager.cpp
+++ b/Source/Plugins/Plugin_VideoDX9/Src/VertexManager.cpp
@@ -199,8 +199,7 @@ void Flush()
u32 nonpow2tex = 0;
for (int i = 0; i < 8; i++)
{
- // if (usedtextures & (1 << i)) {
- {
+ if (usedtextures & (1 << i)) {
FourTexUnits &tex = bpmem.tex[i >> 2];
TextureCache::TCacheEntry* tentry = TextureCache::Load(i,
(tex.texImage3[i&3].image_base/* & 0x1FFFFF*/) << 5,
@@ -235,11 +234,11 @@ void Flush()
{
PixelShaderCache::SetShader(); // TODO(ector): only do this if shader has changed
VertexShaderCache::SetShader(g_nativeVertexFmt->m_components); // TODO(ector): only do this if shader has changed
-
+
// set global constants
VertexShaderManager::SetConstants(false);
PixelShaderManager::SetConstants();
-
+
int stride = g_nativeVertexFmt->GetVertexStride();
g_nativeVertexFmt->SetupVertexPointers();
if (collection != C_POINTS)
diff --git a/Source/Plugins/Plugin_VideoDX9/Src/VertexShaderCache.cpp b/Source/Plugins/Plugin_VideoDX9/Src/VertexShaderCache.cpp
index 90f9b3e2bb..9ac69fb39d 100644
--- a/Source/Plugins/Plugin_VideoDX9/Src/VertexShaderCache.cpp
+++ b/Source/Plugins/Plugin_VideoDX9/Src/VertexShaderCache.cpp
@@ -44,7 +44,6 @@ void SetVSConstant4fv(int const_number, const float *f)
D3D::dev->SetVertexShaderConstantF(const_number, f, 1);
}
-
void VertexShaderCache::Init()
{
@@ -88,7 +87,7 @@ void VertexShaderCache::SetShader(u32 components)
bool HLSL = false;
const char *code = GenerateVertexShader(components, false);
- LPDIRECT3DVERTEXSHADER9 shader = HLSL ? D3D::CompileVertexShader(code, strlen(code), false) : CompileCgShader(code);
+ LPDIRECT3DVERTEXSHADER9 shader = HLSL ? D3D::CompileVertexShader(code, (int)strlen(code), false) : CompileCgShader(code);
if (shader)
{
// Make an entry in the table