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:
parent
42a515ba76
commit
530fb9ba3d
|
@ -14,6 +14,7 @@
|
|||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#include <memory.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
|
|
|
@ -92,7 +92,7 @@ public:
|
|||
// Store strings.
|
||||
void Do(std::string &x)
|
||||
{
|
||||
int stringLen = x.length() + 1;
|
||||
int stringLen = (int)x.length() + 1;
|
||||
Do(stringLen);
|
||||
|
||||
switch (mode)
|
||||
|
|
|
@ -104,7 +104,7 @@ void PatchFunctions()
|
|||
if (symbol > 0)
|
||||
{
|
||||
u32 HLEPatchValue = (1 & 0x3f) << 26;
|
||||
for (size_t addr = symbol->address; addr < symbol->address + symbol->size; addr += 4)
|
||||
for (u32 addr = symbol->address; addr < symbol->address + symbol->size; addr += 4)
|
||||
Memory::Write_U32(HLEPatchValue | i, addr);
|
||||
LOG(HLE,"Patching %s %08x", OSPatches[i].m_szPatchName, symbol->address);
|
||||
}
|
||||
|
|
|
@ -149,7 +149,7 @@ CWII_IPC_HLE_Device_FileIO::Read(u32 _CommandAddress)
|
|||
if (m_pFileHandle != NULL)
|
||||
{
|
||||
size_t readItems = fread(Memory::GetPointer(Address), 1, Size, m_pFileHandle);
|
||||
ReturnValue = readItems;
|
||||
ReturnValue = (u32)readItems;
|
||||
LOG(WII_IPC_FILEIO, "FileIO reads from %s (Addr=0x%08x Size=0x%x)", GetDeviceName().c_str(), Address, Size);
|
||||
}
|
||||
else
|
||||
|
|
|
@ -181,7 +181,7 @@ bool CompressFileToBlob(const char* infile, const char* outfile, u32 sub_type,
|
|||
callback("Files opened, ready to compress.", 0, arg);
|
||||
|
||||
fseek(inf, 0, SEEK_END);
|
||||
int insize = ftell(inf);
|
||||
s64 insize = ftell(inf);
|
||||
fseek(inf, 0, SEEK_SET);
|
||||
CompressedBlobHeader header;
|
||||
header.magic_cookie = kBlobCookie;
|
||||
|
|
|
@ -442,7 +442,7 @@ void CUCode_AX::MixAdd(short* _pBuffer, int _iSize)
|
|||
} // end of the _iSize loop
|
||||
// ============
|
||||
|
||||
if(gVolume) // allow us to turn this off in the debugger
|
||||
if (gVolume) // allow us to turn this off in the debugger
|
||||
{
|
||||
pb.mixer.volume_left = ADPCM_Vol(pb.mixer.volume_left, pb.mixer.unknown, pb.mixer_control);
|
||||
pb.mixer.volume_right = ADPCM_Vol(pb.mixer.volume_right, pb.mixer.unknown2, pb.mixer_control);
|
||||
|
@ -457,21 +457,21 @@ void CUCode_AX::MixAdd(short* _pBuffer, int _iSize)
|
|||
for (int i = 0; i < _iSize; i++)
|
||||
{
|
||||
// Clamp into 16-bit. Maybe we should add a volume compressor here.
|
||||
int left = templbuffer[i];
|
||||
int right = temprbuffer[i];
|
||||
int left = templbuffer[i] + _pBuffer[0];
|
||||
int right = temprbuffer[i] + _pBuffer[1];
|
||||
if (left < -32767) left = -32767;
|
||||
if (left > 32767) left = 32767;
|
||||
if (right < -32767) right = -32767;
|
||||
if (right > 32767) right = 32767;
|
||||
*_pBuffer++ += left;
|
||||
*_pBuffer++ += right;
|
||||
*_pBuffer++ = left;
|
||||
*_pBuffer++ = right;
|
||||
}
|
||||
|
||||
// write back out pbs
|
||||
WriteBackPBs(PBs, numberOfPBs);
|
||||
|
||||
// write logging data to debugger again after the update
|
||||
if(m_frame)
|
||||
if (m_frame)
|
||||
{
|
||||
CUCode_AX::Logging(_pBuffer, _iSize, 1);
|
||||
}
|
||||
|
|
|
@ -317,7 +317,6 @@
|
|||
AssemblerListingLocation="$(IntDir)\"
|
||||
WarningLevel="3"
|
||||
WarnAsError="false"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="3"
|
||||
ForcedIncludeFiles="stdafx.h"
|
||||
/>
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue