(Xbox 1) Minor changes to RetroLaunch

This commit is contained in:
twinaphex 2012-07-23 10:15:17 +02:00
parent 772ff6005f
commit c79dbebc90
3 changed files with 2 additions and 37 deletions

View File

@ -26,19 +26,8 @@
#include <list> #include <list>
#include <vector> #include <vector>
#include <algorithm> #include <algorithm>
#ifdef _XBOX #include <xtl.h>
#include <xtl.h> #include <xgraphics.h>
#include <xgraphics.h>
#else
#pragma comment(lib,"d3d8.lib")
#pragma comment(lib,"d3dx8.lib")
#pragma comment(lib,"DxErr8.lib")
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <d3d8.h>
#include <d3dx8.h>
#include <dxerr8.h>
#endif
using namespace std; using namespace std;

View File

@ -201,12 +201,7 @@ bool CSurface::Render(int x, int y, dword w, dword h)
g_video.m_pD3DDevice->SetTexture(0, m_pTexture); g_video.m_pD3DDevice->SetTexture(0, m_pTexture);
g_video.m_pD3DDevice->SetStreamSource(0, m_pVertexBuffer, sizeof(CustomVertex)); g_video.m_pD3DDevice->SetStreamSource(0, m_pVertexBuffer, sizeof(CustomVertex));
g_video.m_pD3DDevice->SetVertexShader(D3DFVF_CUSTOMVERTEX); g_video.m_pD3DDevice->SetVertexShader(D3DFVF_CUSTOMVERTEX);
#ifdef _XBOX
g_video.m_pD3DDevice->DrawPrimitive(D3DPT_QUADLIST, 0, 1); g_video.m_pD3DDevice->DrawPrimitive(D3DPT_QUADLIST, 0, 1);
#else
//FIXME: vertices order !
g_video.m_pD3DDevice->DrawPrimitive(D3DPT_TRIANGLELIST, 0, 2);
#endif
return true; return true;
} }

View File

@ -59,30 +59,13 @@ bool CVideo::Create(HWND hDeviceWindow, bool bWindowed)
} }
} }
#ifdef _XBOX
g_hResult = m_pD3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, NULL, g_hResult = m_pD3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, NULL,
D3DCREATE_HARDWARE_VERTEXPROCESSING, D3DCREATE_HARDWARE_VERTEXPROCESSING,
&d3dpp, &m_pD3DDevice); &d3dpp, &m_pD3DDevice);
#else //WIN32
D3DDISPLAYMODE d3ddm;
g_hResult = m_pD3D->GetAdapterDisplayMode( D3DADAPTER_DEFAULT, &d3ddm );
d3dpp.BackBufferFormat = d3ddm.Format;
d3dpp.Windowed = bWindowed;
d3dpp.hDeviceWindow = hDeviceWindow;
g_hResult = m_pD3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hDeviceWindow,
D3DCREATE_HARDWARE_VERTEXPROCESSING,
&d3dpp, &m_pD3DDevice);
#endif //#ifdef _XBOX
if (FAILED(g_hResult)) if (FAILED(g_hResult))
{ {
g_debug.Print("Error: D3DCreate(), CreateDevice()"); g_debug.Print("Error: D3DCreate(), CreateDevice()");
#ifndef _XBOX
DXTrace(__FILE__, __LINE__, g_hResult, "D3DCreate(), CreateDevice()", TRUE);
#endif
return false; return false;
} }
// use an orthogonal matrix for the projection matrix // use an orthogonal matrix for the projection matrix
@ -114,10 +97,8 @@ void CVideo::BeginRender()
1.0f, 0); 1.0f, 0);
m_pD3DDevice->BeginScene(); m_pD3DDevice->BeginScene();
#ifdef _XBOX
m_pD3DDevice->SetFlickerFilter(g_iniFile.m_currentIniEntry.dwFlickerFilter); m_pD3DDevice->SetFlickerFilter(g_iniFile.m_currentIniEntry.dwFlickerFilter);
m_pD3DDevice->SetSoftDisplayFilter(g_iniFile.m_currentIniEntry.bSoftDisplayFilter); m_pD3DDevice->SetSoftDisplayFilter(g_iniFile.m_currentIniEntry.bSoftDisplayFilter);
#endif
} }
void CVideo::EndRender() void CVideo::EndRender()