Assorted warning fixes, small mixer improvement when both DTK and HLE audio are used

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1100 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hrydgard
2008-11-09 13:17:17 +00:00
parent 42a515ba76
commit 530fb9ba3d
11 changed files with 24 additions and 29 deletions

View File

@ -664,8 +664,8 @@ void OpenGL_Update()
{
MValueX = 1.0f / Max;
MValueY = 1.0f / Max;
nXoff = (nBackbufferWidth - (640 * MValueX)) / 2;
nYoff = (nBackbufferHeight - (480 * MValueY)) / 2;
nXoff = (int)((nBackbufferWidth - (640 * MValueX)) / 2);
nYoff = (int)((nBackbufferHeight - (480 * MValueY)) / 2);
}
// tell the debugger

View File

@ -68,13 +68,8 @@ NativeVertexFormat::~NativeVertexFormat()
inline GLuint VarToGL(VarType t)
{
switch (t) {
case VAR_BYTE: return GL_BYTE;
case VAR_UNSIGNED_BYTE: return GL_UNSIGNED_BYTE;
case VAR_SHORT: return GL_SHORT;
case VAR_UNSIGNED_SHORT: return GL_UNSIGNED_SHORT;
case VAR_FLOAT: return GL_FLOAT;
}
static const GLuint lookup[5] = {GL_BYTE, GL_UNSIGNED_BYTE, GL_SHORT, GL_UNSIGNED_SHORT, GL_FLOAT};
return lookup[t];
return 0;
}

View File

@ -232,7 +232,7 @@ TextureMngr::TCacheEntry* TextureMngr::Load(int texstage, u32 address, int width
/*if (width == entry.w && height==entry.h && format==entry.fmt)
{
LPDIRECT3DTEXTURE9 tex = entry.texture;
int bs = TexDecoder_GetBlockWidthInTexels(format)-1; //TexelSizeInNibbles(format)*width*height/16;
int bs = TexDecoder_GetBlockWidthInTexels(format)-1;
int expandedWidth = (width+bs) & (~bs);
D3DFORMAT dfmt = TexDecoder_Decode(temp,ptr,expandedWidth,height,format, tlutaddr, tlutfmt);
ReplaceTexture2D(tex,temp,width,height,expandedWidth,dfmt);
@ -247,7 +247,7 @@ TextureMngr::TCacheEntry* TextureMngr::Load(int texstage, u32 address, int width
}
}
int bs = TexDecoder_GetBlockWidthInTexels(format) - 1; //TexelSizeInNibbles(format)*width*height/16;
int bs = TexDecoder_GetBlockWidthInTexels(format) - 1;
int expandedWidth = (width + bs) & (~bs);
PC_TexFormat dfmt = TexDecoder_Decode(temp, ptr, expandedWidth, height, format, tlutaddr, tlutfmt);
@ -261,9 +261,9 @@ TextureMngr::TCacheEntry* TextureMngr::Load(int texstage, u32 address, int width
((u32 *)ptr)[entry.hashoffset] = entry.hash;
entry.addr = address;
entry.isRenderTarget=false;
entry.isNonPow2 = ((width&(width-1)) || (height&(height-1)));
entry.isRenderTarget = false;
entry.isNonPow2 = ((width & (width - 1)) || (height & (height - 1)));
glGenTextures(1, (GLuint *)&entry.texture);
GLenum target = entry.isNonPow2 ? GL_TEXTURE_RECTANGLE_ARB : GL_TEXTURE_2D;
@ -307,7 +307,7 @@ TextureMngr::TCacheEntry* TextureMngr::Load(int texstage, u32 address, int width
}
INCSTAT(stats.numTexturesCreated);
SETSTAT(stats.numTexturesAlive,textures.size());
SETSTAT(stats.numTexturesAlive, textures.size());
//glEnable(entry.isNonPow2?GL_TEXTURE_RECTANGLE_ARB:GL_TEXTURE_2D);

View File

@ -367,7 +367,7 @@ void VertexLoader::CompileVertexTranslator()
break;
}
}
if (j == 8 && !((m_NativeFmt->m_components&VB_HAS_TEXMTXIDXALL) & (VB_HAS_TEXMTXIDXALL<<(i+1)))) // no more tex coords and tex matrices, so exit loop
if (j == 8 && !((m_NativeFmt->m_components & VB_HAS_TEXMTXIDXALL) & (VB_HAS_TEXMTXIDXALL << (i + 1)))) // no more tex coords and tex matrices, so exit loop
break;
}
}
@ -379,7 +379,8 @@ void VertexLoader::CompileVertexTranslator()
PortableVertexDeclaration vtx_decl;
// TODO - merge all the below into the ifs and stuff above.
// Also merge ComputeVertexSize into the result.
int m_components = m_NativeFmt->m_components;
const TVtxAttr &vtx_attr = m_VtxAttr;
@ -445,7 +446,6 @@ void VertexLoader::CompileVertexTranslator()
// TextureCoord
for (int i = 0; i < 8; i++) {
if (tc[i] != NOT_PRESENT || (m_components & (VB_HAS_TEXMTXIDX0 << i))) {
// TODO : More potential disalignment!
if (m_components & (VB_HAS_TEXMTXIDX0 << i)) {
if (tc[i] != NOT_PRESENT) {
vtx_decl.texcoord_offset[i] = offset;