1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-06-25 22:09:35 +00:00

Fix warnings from compiler and static code analizer.

This commit is contained in:
Sergey Lipskiy 2018-05-06 15:28:07 +07:00
parent bb697c3c28
commit 10710f96ac
12 changed files with 19 additions and 19 deletions

View File

@ -17,7 +17,8 @@ using namespace graphics;
RDRAMtoColorBuffer::RDRAMtoColorBuffer()
: m_pCurBuffer(nullptr)
, m_pTexture(nullptr) {
, m_pTexture(nullptr)
, m_pbuf(nullptr) {
}
RDRAMtoColorBuffer & RDRAMtoColorBuffer::get()

View File

@ -84,9 +84,6 @@ bool CombinerProgramImpl::getBinaryForm(std::vector<char> & _buffer)
std::vector<char> binary(binaryLength);
if (binary.size() == 0)
return false;
GLenum binaryFormat;
glGetProgramBinary(GLuint(m_program), binaryLength, &binaryLength, &binaryFormat, binary.data());
if (opengl::Utils::isGLError())

View File

@ -28,7 +28,7 @@ void ColorBufferReaderWithBufferStorage::_initBuffers()
m_curIndex = 0;
// Initialize Pixel Buffer Objects
for (int index = 0; index < m_numPBO; ++index) {
for (u32 index = 0; index < m_numPBO; ++index) {
m_bindBuffer->bind(Parameter(GL_PIXEL_PACK_BUFFER), ObjectHandle(m_PBO[index]));
m_fence[index] = 0;
glBufferStorage(GL_PIXEL_PACK_BUFFER, m_pTexture->textureBytes, nullptr, GL_MAP_READ_BIT | GL_MAP_PERSISTENT_BIT | GL_MAP_COHERENT_BIT);
@ -42,7 +42,7 @@ void ColorBufferReaderWithBufferStorage::_destroyBuffers()
{
glDeleteBuffers(m_numPBO, m_PBO);
for (int index = 0; index < m_numPBO; ++index) {
for (u32 index = 0; index < m_numPBO; ++index) {
m_PBO[index] = 0;
glDeleteSync(m_fence[index]);
}

View File

@ -22,7 +22,7 @@ void ColorBufferReaderWithPixelBuffer::_destroyBuffers()
{
glDeleteBuffers(m_numPBO, m_PBO);
for(int index = 0; index < m_numPBO; ++index)
for (u32 index = 0; index < m_numPBO; ++index)
m_PBO[index] = 0;
}

View File

@ -17,6 +17,7 @@
using namespace opengl;
ContextImpl::ContextImpl()
: m_clampMode(graphics::ClampMode::ClippingEnabled)
{
initGLFunctions();
}

View File

@ -30,7 +30,7 @@ NoiseTexture::NoiseTexture()
, m_currTex(0)
, m_prevTex(0)
{
for (u32 i = 0; i < m_prevTex; ++i)
for (u32 i = 0; i < NOISE_TEX_NUM; ++i)
m_pTexture[i] = nullptr;
}

View File

@ -13,6 +13,7 @@ using namespace graphics;
PaletteTexture::PaletteTexture()
: m_pTexture(nullptr)
, m_pbuf(nullptr)
, m_paletteCRC256(0)
{
}

View File

@ -23,6 +23,8 @@ TexrectDrawer::TexrectDrawer()
, m_Z(0)
, m_max_lrx(0)
, m_max_lry(0)
, m_stepY(0.0f)
, m_stepX(0.0f)
, m_scissor(gDPScissor())
, m_pTexture(nullptr)
, m_pBuffer(nullptr)

View File

@ -976,7 +976,7 @@ void TextureCache::_loadDepthTexture(CachedTexture * _pTexture, u16* _pDest)
u32 size = _pTexture->realWidth * _pTexture->realHeight;
std::vector<f32> pDestFloat(size);
for (u32 i = 0; i < size; ++i)
pDestFloat[i] = _pDest[i] / 65535.0;
pDestFloat[i] = _pDest[i] / 65535.0f;
Context::InitTextureParams params;
params.handle = _pTexture->name;
@ -1322,7 +1322,7 @@ void TextureCache::activateTexture(u32 _t, CachedTexture *_pTexture)
params.minFilter = textureParameters::FILTER_NEAREST;
params.magFilter = textureParameters::FILTER_NEAREST;
}
} else if (bUseBilinear && config.generalEmulation.enableLOD != 0 && bUseLOD) { // Apply standard bilinear to first tile of mipmap texture
} else if (bUseBilinear && config.generalEmulation.enableLOD != 0) { // Apply standard bilinear to first tile of mipmap texture
params.minFilter = textureParameters::FILTER_LINEAR;
params.magFilter = textureParameters::FILTER_LINEAR;
} else { // Don't use texture filter. Texture will be filtered by filter shader

View File

@ -212,11 +212,10 @@ void T3DUX_LoadObject(u32 pstate, u32 pvtx, u32 ptri, u32 pcol)
void RunT3DUX()
{
u32 pstate;
do {
while (true) {
u32 addr = RSP.PC[RSP.PCi] >> 2;
const u32 pgstate = ((u32*)RDRAM)[addr++];
pstate = ((u32*)RDRAM)[addr++];
const u32 pstate = ((u32*)RDRAM)[addr++];
const u32 pvtx = ((u32*)RDRAM)[addr++];
const u32 ptri = ((u32*)RDRAM)[addr++];
const u32 pcol = ((u32*)RDRAM)[addr++];
@ -230,5 +229,5 @@ void RunT3DUX()
T3DUX_LoadObject(pstate, pvtx, ptri, pcol);
// Go to the next instruction
RSP.PC[RSP.PCi] += 24;
} while (pstate != 0);
};
}

View File

@ -132,11 +132,10 @@ void Turbo3D_LoadObject(u32 pstate, u32 pvtx, u32 ptri)
void RunTurbo3D()
{
u32 pstate;
do {
while (true) {
u32 addr = RSP.PC[RSP.PCi] >> 2;
const u32 pgstate = ((u32*)RDRAM)[addr++];
pstate = ((u32*)RDRAM)[addr++];
const u32 pstate = ((u32*)RDRAM)[addr++];
const u32 pvtx = ((u32*)RDRAM)[addr++];
const u32 ptri = ((u32*)RDRAM)[addr];
if (pstate == 0) {
@ -148,5 +147,5 @@ void RunTurbo3D()
Turbo3D_LoadObject(pstate, pvtx, ptri);
// Go to the next instruction
RSP.PC[RSP.PCi] += 16;
} while (pstate != 0);
};
}

View File

@ -226,7 +226,7 @@ void ZSort_XFMLight( u32 _w0, u32 _w1 )
gSP.lookat.xyz[i][X] = (f32)(((s8*)DMEM)[(addr+8)^3]);
gSP.lookat.xyz[i][Y] = (f32)(((s8*)DMEM)[(addr+9)^3]);
gSP.lookat.xyz[i][Z] = (f32)(((s8*)DMEM)[(addr+10)^3]);
gSP.lookatEnable = (i == 0) || (i == 1 && gSP.lookat.xyz[i][X] != 0 && gSP.lookat.xyz[i][Y] != 0);
gSP.lookatEnable = (i == 0) || (gSP.lookat.xyz[i][X] != 0 && gSP.lookat.xyz[i][Y] != 0);
addr += 24;
}
}