Replaced type "DWORD" by "u32", except where "DWORD" is used to access the Windows API.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@429 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Maarten ter Huurne
2008-09-01 22:48:56 +00:00
parent f3f17b4a19
commit 1154027808
14 changed files with 39 additions and 42 deletions

View File

@ -5,7 +5,7 @@ namespace D3D
{
LPDIRECT3DTEXTURE9 CreateTexture2D(const u8* buffer, const int width, const int height,const int pitch, D3DFORMAT fmt)
{
DWORD *pBuffer = (DWORD *)buffer;
u32* pBuffer = (u32*)buffer;
LPDIRECT3DTEXTURE9 pTexture;
// crazy bitmagic
@ -26,15 +26,15 @@ namespace D3D
D3DLOCKED_RECT Lock;
pTexture->LockRect(level, &Lock, NULL, 0 );
DWORD* pIn = pBuffer;
u32* pIn = pBuffer;
switch(fmt)
{
case D3DFMT_A8R8G8B8:
{
for (int y = 0; y < height; y++)
{
DWORD* pBits = (DWORD*)((u8*)Lock.pBits + (y * Lock.Pitch));
memcpy(pBits,pIn, width * 4);
u32* pBits = (u32*)((u8*)Lock.pBits + (y * Lock.Pitch));
memcpy(pBits, pIn, width * 4);
pIn += pitch;
}
}
@ -49,18 +49,18 @@ namespace D3D
void ReplaceTexture2D(LPDIRECT3DTEXTURE9 pTexture, const u8* buffer, const int width, const int height,const int pitch, D3DFORMAT fmt)
{
DWORD *pBuffer = (DWORD *)buffer;
int level=0;
u32* pBuffer = (u32*)buffer;
int level = 0;
D3DLOCKED_RECT Lock;
pTexture->LockRect(level, &Lock, NULL, 0 );
DWORD* pIn = pBuffer;
u32* pIn = pBuffer;
switch(fmt)
{
case D3DFMT_A8R8G8B8:
{
for (int y = 0; y < height; y++)
{
DWORD* pBits = (DWORD*)((u8*)Lock.pBits + (y * Lock.Pitch));
u32* pBits = (u32*)((u8*)Lock.pBits + (y * Lock.Pitch));
memcpy(pBits,pIn, width*4);
pIn += pitch;
}

View File

@ -9,17 +9,17 @@ namespace D3D
CD3DFont font;
#define MAX_NUM_VERTICES 50*6
struct FONT2DVERTEX {
float x,y,z;
float rhw;
int color;
float tu, tv;
struct FONT2DVERTEX {
float x,y,z;
float rhw;
u32 color;
float tu, tv;
};
#define D3DFVF_FONT2DVERTEX (D3DFVF_XYZRHW|D3DFVF_DIFFUSE|D3DFVF_TEX1)
#define D3DFVF_FONT3DVERTEX (D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_NORMAL|D3DFVF_TEX1)
inline FONT2DVERTEX InitFont2DVertex( float x, float y, DWORD color, float tu, float tv )
inline FONT2DVERTEX InitFont2DVertex( float x, float y, u32 color, float tu, float tv )
{
FONT2DVERTEX v; v.x=x; v.y=y; v.z=0; v.rhw=1.0f; v.color = color; v.tu = tu; v.tv = tv;
return v;
@ -236,7 +236,7 @@ namespace D3D
}
}
int CD3DFont::DrawTextScaled( float x, float y, float fXScale, float fYScale, float spacing, int dwColor, const char* strText, bool center )
int CD3DFont::DrawTextScaled( float x, float y, float fXScale, float fYScale, float spacing, u32 dwColor, const char* strText, bool center )
{
SaveRenderStates();
SetRenderStates();
@ -356,10 +356,10 @@ namespace D3D
return S_OK;
}
void quad2d(float x1, float y1, float x2, float y2, DWORD color, float u1, float v1, float u2, float v2)
void quad2d(float x1, float y1, float x2, float y2, u32 color, float u1, float v1, float u2, float v2)
{
SaveRenderStates();
struct Q2DVertex { float x,y,z,rhw; int color; float u, v; } coords[4] = {
struct Q2DVertex { float x,y,z,rhw; u32 color; float u, v; } coords[4] = {
{x1-0.5f, y1-0.5f, 0, 1, color, u1, v1},
{x2-0.5f, y1-0.5f, 0, 1, color, u2, v1},
{x2-0.5f, y2-0.5f, 0, 1, color, u2, v2},

View File

@ -30,7 +30,7 @@ namespace D3D
int Shutdown();
int DrawTextScaled( float x, float y,
float fXScale, float fYScale,
float spacing, int dwColor,
float spacing, u32 dwColor,
const char* strText, bool center=true );
@ -40,5 +40,5 @@ namespace D3D
extern CD3DFont font;
void quad2d(float x1, float y1, float x2, float y2, DWORD color, float u1=0, float v1=0, float u2=1, float v2=1);
void quad2d(float x1, float y1, float x2, float y2, u32 color, float u1=0, float v1=0, float u2=1, float v2=1);
}

View File

@ -251,7 +251,7 @@ void Decode(void)
u32 Cmd2 = g_pDataReader->Read32();
int dwTransferSize = ((Cmd2>>16)&15) + 1;
DWORD dwAddress = Cmd2 & 0xFFFF;
u32 dwAddress = Cmd2 & 0xFFFF;
static u32 pData[16];
for (int i=0; i<dwTransferSize; i++)
pData[i] = g_pDataReader->Read32();

View File

@ -80,7 +80,7 @@ void TextureCache::Cleanup()
}
}
void TextureCache::Load(int stage, DWORD address, int width, int height, int format, int tlutaddr, int tlutfmt)
void TextureCache::Load(int stage, u32 address, int width, int height, int format, int tlutaddr, int tlutfmt)
{
if (address == 0)
return;
@ -195,7 +195,7 @@ void TextureCache::Load(int stage, DWORD address, int width, int height, int for
}
void TextureCache::CopyEFBToRenderTarget(DWORD address, RECT *source)
void TextureCache::CopyEFBToRenderTarget(u32 address, RECT *source)
{
TexCache::iterator iter;
LPDIRECT3DTEXTURE9 tex;

View File

@ -30,7 +30,7 @@ class TextureCache
};
typedef std::map<DWORD,TCacheEntry> TexCache;
typedef std::map<u32,TCacheEntry> TexCache;
static u8 *temp;
static TexCache textures;
@ -40,8 +40,8 @@ public:
static void Cleanup();
static void Shutdown();
static void Invalidate();
static void Load(int stage, DWORD address, int width, int height, int format, int tlutaddr, int tlutfmt);
static void CopyEFBToRenderTarget(DWORD address, RECT *source);
static void Load(int stage, u32 address, int width, int height, int format, int tlutaddr, int tlutfmt);
static void CopyEFBToRenderTarget(u32 address, RECT *source);
};
#endif

View File

@ -202,7 +202,7 @@ void Video_Shutdown(void)
DeInit();
}
void Video_UpdateXFB(u8* /*_pXFB*/, DWORD /*_dwWidth*/, DWORD /*_dwHeight*/)
void Video_UpdateXFB(u8* /*_pXFB*/, u32 /*_dwWidth*/, u32 /*_dwHeight*/)
{
/*
ConvertXFB(tempBuffer, _pXFB, _dwWidth, _dwHeight);