1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-04 10:03:36 +00:00

Fix errors found by code analizer.

This commit is contained in:
Sergey Lipskiy 2014-09-30 17:09:40 +07:00
parent 7548922cfd
commit 6bf0302f19
4 changed files with 9 additions and 10 deletions

View File

@ -834,7 +834,7 @@ void RDRAMtoFrameBuffer::CopyFromRDRAM( u32 _address, bool _bUseAlpha)
r = ((col >> 11)&31)<<3;
g = ((col >> 6)&31)<<3;
b = ((col >> 1)&31)<<3;
a = col&1 > 0 ? 0xff : 0;
a = (col&1) > 0 ? 0xff : 0;
//*(dst++) = RGBA5551_RGBA8888(c);
dst[x + y*width] = (a<<24)|(b<<16)|(g<<8)|r;
}

12
gSP.cpp
View File

@ -568,14 +568,14 @@ void gSPLookAt( u32 l )
{
}
void gSPVertex( u32 v, u32 n, u32 v0 )
void gSPVertex( u32 a, u32 n, u32 v0 )
{
//flush batched triangles:
#ifdef __TRIBUFFER_OPT
gSPFlushTriangles();
#endif
u32 address = RSP_SegmentToPhysical( v );
u32 address = RSP_SegmentToPhysical(a);
if ((address + sizeof( Vertex ) * n) > RDRAMSize)
return;
@ -648,14 +648,14 @@ void gSPVertex( u32 v, u32 n, u32 v0 )
}
}
void gSPCIVertex( u32 v, u32 n, u32 v0 )
void gSPCIVertex( u32 a, u32 n, u32 v0 )
{
#ifdef __TRIBUFFER_OPT
gSPFlushTriangles();
#endif
u32 address = RSP_SegmentToPhysical( v );
u32 address = RSP_SegmentToPhysical( a );
if ((address + sizeof( PDVertex ) * n) > RDRAMSize)
return;
@ -731,10 +731,10 @@ void gSPCIVertex( u32 v, u32 n, u32 v0 )
}
}
void gSPDMAVertex( u32 v, u32 n, u32 v0 )
void gSPDMAVertex( u32 a, u32 n, u32 v0 )
{
u32 address = gSP.DMAOffsets.vtx + RSP_SegmentToPhysical( v );
u32 address = gSP.DMAOffsets.vtx + RSP_SegmentToPhysical(a);
if ((address + 10 * n) > RDRAMSize)
return;

View File

@ -41,6 +41,6 @@ extern ptr_VidExt_GL_SetAttribute CoreVideo_GL_SetAttribute;
extern ptr_VidExt_GL_GetAttribute CoreVideo_GL_GetAttribute;
extern ptr_VidExt_GL_SwapBuffers CoreVideo_GL_SwapBuffers;
extern void (*renderCallback)();
extern void(*renderCallback)(int);
#endif // GLIDEN64_MUPENPLUS_H

View File

@ -25,7 +25,7 @@ ptr_VidExt_GL_SetAttribute CoreVideo_GL_SetAttribute = NULL;
ptr_VidExt_GL_GetAttribute CoreVideo_GL_GetAttribute = NULL;
ptr_VidExt_GL_SwapBuffers CoreVideo_GL_SwapBuffers = NULL;
void (*renderCallback)() = NULL;
void(*renderCallback)(int) = NULL;
m64p_error PluginAPI::PluginStartup(m64p_dynlib_handle _CoreLibHandle)
{
@ -91,7 +91,6 @@ m64p_error PluginAPI::PluginGetVersion(
void PluginAPI::SetRenderingCallback(void (*callback)(int))
{
static void (*renderCallback)(int) = NULL;
renderCallback = callback;
}