Skip to content

Commit

Permalink
Compiler warnings removed.
Browse files Browse the repository at this point in the history
  • Loading branch information
tamlin-mike authored and Xottab-DUTY committed Jan 9, 2018
1 parent 9380c4f commit 276eb24
Show file tree
Hide file tree
Showing 12 changed files with 46 additions and 34 deletions.
2 changes: 1 addition & 1 deletion src/Layers/xrRender/HOM.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class CHOM
void Render_ZB();
// void Debug ();

void occlude(Fbox2& space) {}
void occlude(Fbox2& /*space*/) {}
void Disable();
void Enable();

Expand Down
6 changes: 3 additions & 3 deletions src/Layers/xrRender/LightTrack.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ class CROS_impl : public IRender_ObjectSpecific
virtual void force_mode(u32 mode) { MODE = mode; };
virtual float get_luminocity()
{
float result = _max(approximate.x, _max(approximate.y, approximate.z));
clamp(result, 0.f, 1.f);
return (result);
float result_ = _max(approximate.x, _max(approximate.y, approximate.z));
clamp(result_, 0.f, 1.f);
return (result_);
};
virtual float get_luminocity_hemi() { return get_hemi(); }
virtual float* get_luminocity_hemi_cube() { return hemi_cube_smooth; }
Expand Down
2 changes: 1 addition & 1 deletion src/Layers/xrRender/light.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class light : public IRender_Light, public SpatialBase
virtual void set_rotation(const Fvector& D, const Fvector& R);
virtual void set_cone(float angle);
virtual void set_range(float R);
virtual void set_virtual_size(float R){};
virtual void set_virtual_size(float /*R*/){};
virtual void set_color(const Fcolor& C) { color.set(C); }
virtual void set_color(float r, float g, float b) { color.set(r, g, b, 1); }
virtual void set_texture(LPCSTR name);
Expand Down
27 changes: 14 additions & 13 deletions src/Layers/xrRenderGL/glBufferUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ void CreateIndexBuffer(GLuint* pBuffer, const void* pData, UINT DataSize, bool b
return CreateBuffer(pBuffer, pData, DataSize, bImmutable, true);
}

GLsizei VertexSizeList[] =
const GLsizei VertexSizeList[] =
{
1, // D3DDECLTYPE_FLOAT1
2, // D3DDECLTYPE_FLOAT2
Expand All @@ -45,7 +45,7 @@ GLsizei VertexSizeList[] =
4 // D3DDECLTYPE_FLOAT16_4
};

GLenum VertexTypeList[] =
const GLenum VertexTypeList[] =
{
GL_FLOAT, // D3DDECLTYPE_FLOAT1
GL_FLOAT, // D3DDECLTYPE_FLOAT2
Expand All @@ -66,7 +66,7 @@ GLenum VertexTypeList[] =
GL_HALF_FLOAT // D3DDECLTYPE_FLOAT16_4
};

GLboolean VertexNormalizedList[] =
const GLboolean VertexNormalizedList[] =
{
GL_FALSE, // D3DDECLTYPE_FLOAT1
GL_FALSE, // D3DDECLTYPE_FLOAT2
Expand All @@ -87,7 +87,7 @@ GLboolean VertexNormalizedList[] =
GL_FALSE // D3DDECLTYPE_FLOAT16_4
};

GLsizei VertexTypeSizeList[] =
const GLsizei VertexTypeSizeList[] =
{
sizeof(GLfloat), // D3DDECLTYPE_FLOAT1
sizeof(GLfloat), // D3DDECLTYPE_FLOAT2
Expand All @@ -108,22 +108,22 @@ GLsizei VertexTypeSizeList[] =
sizeof(GLhalf) // D3DDECLTYPE_FLOAT16_4
};

GLuint VertexUsageList[] =
const GLuint VertexUsageList[] =
{
3, // D3DDECLUSAGE_POSITION
-1, // D3DDECLUSAGE_BLENDWEIGHT
-1, // D3DDECLUSAGE_BLENDINDICES
~0u, // D3DDECLUSAGE_BLENDWEIGHT
~0u, // D3DDECLUSAGE_BLENDINDICES
5, // D3DDECLUSAGE_NORMAL
-1, // D3DDECLUSAGE_PSIZE
~0u, // D3DDECLUSAGE_PSIZE
8, // D3DDECLUSAGE_TEXCOORD
4, // D3DDECLUSAGE_TANGENT
6, // D3DDECLUSAGE_BINORMAL
-1, // D3DDECLUSAGE_TESSFACTOR
-1, // D3DDECLUSAGE_POSITIONT
~0u, // D3DDECLUSAGE_TESSFACTOR
~0u, // D3DDECLUSAGE_POSITIONT
0, // D3DDECLUSAGE_COLOR
7, // D3DDECLUSAGE_FOG
-1, // D3DDECLUSAGE_DEPTH
-1, // D3DDECLUSAGE_SAMPLE
~0u, // D3DDECLUSAGE_DEPTH
~0u, // D3DDECLUSAGE_SAMPLE
};

GLsizei GetDeclVertexSize(const D3DVERTEXELEMENT9* decl)
Expand All @@ -145,6 +145,7 @@ void ConvertVertexDeclaration(const D3DVERTEXELEMENT9* dxdecl, SDeclaration* dec
{
RCache.set_Format(decl);

// XXX: tamlin: use 'stride', or drop it.
GLsizei stride = GetDeclVertexSize(dxdecl);
for (int i = 0; i < MAXD3DDECLLENGTH; ++i)
{
Expand Down Expand Up @@ -279,4 +280,4 @@ u32 GetDeclLength(const D3DVERTEXELEMENT9 *decl)
return element - decl;
}

};
} // namespace glBufferUtils
4 changes: 2 additions & 2 deletions src/Layers/xrRenderGL/glHW.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ void free_render_mode_list () {}

CHW HW;

void CALLBACK OnDebugCallback(GLenum source, GLenum type, GLuint id, GLenum severity,
GLsizei length, const GLchar* message, const void* userParam)
void CALLBACK OnDebugCallback(GLenum /*source*/, GLenum /*type*/, GLuint id, GLenum severity,
GLsizei /*length*/, const GLchar* message, const void* /*userParam*/)
{
if (severity != GL_DEBUG_SEVERITY_NOTIFICATION)
Log(message, id);
Expand Down
6 changes: 6 additions & 0 deletions src/Layers/xrRenderGL/glR_Backend_Runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ ICF void CBackend::set_PS(GLuint _ps, LPCSTR _n)
{
if (ps != _ps)
{
#ifdef RBackend_PGO
string_path name;
#endif
PGO(glGetObjectLabel(GL_PROGRAM, _ps, sizeof(name), nullptr, name));
PGO(Msg("PGO:Pshader:%d,%s", _ps, _n ? _n : name));
stat.ps++;
Expand All @@ -86,7 +88,9 @@ ICF void CBackend::set_GS(GLuint _gs, LPCSTR _n)
{
if (gs != _gs)
{
#ifdef RBackend_PGO
string_path name;
#endif
PGO(glGetObjectLabel(GL_PROGRAM, _ps, sizeof(name), nullptr, name));
PGO(Msg("PGO:Gshader:%d,%s", _ps, _n ? _n : name));
// TODO: OGL: Get statistics for G Shader change
Expand All @@ -103,7 +107,9 @@ ICF void CBackend::set_VS(GLuint _vs, LPCSTR _n)
{
if (vs != _vs)
{
#ifdef RBackend_PGO
string_path name;
#endif
PGO(glGetObjectLabel(GL_PROGRAM, _vs, sizeof(name), nullptr, name));
PGO(Msg("PGO:Vshader:%d,%s", _vs, _n ? _n : name));
stat.vs++;
Expand Down
20 changes: 12 additions & 8 deletions src/Layers/xrRenderGL/glSH_RT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ void CRT::create (LPCSTR Name, u32 w, u32 h, D3DFORMAT f, u32 SampleCount )
CHK_GL(glGetIntegerv(GL_MAX_FRAMEBUFFER_HEIGHT, &max_height));

// Check width-and-height of render target surface
if (w>max_width) return;
if (h>max_height) return;
// XXX: While seemingly silly, assert w/h are positive?
if (w>u32(max_width)) return;
if (h>u32(max_height)) return;

RImplementation.Resources->Evict();

Expand All @@ -58,23 +59,26 @@ void CRT::create (LPCSTR Name, u32 w, u32 h, D3DFORMAT f, u32 SampleCount )
pZRT = pRT;
}

void CRT::destroy ()
void CRT::destroy()
{
if (pTexture._get()) {
pTexture->surface_set(target, 0);
pTexture = NULL;
}
CHK_GL(glDeleteTextures(1, &pRT));
}
void CRT::reset_begin ()

void CRT::reset_begin()
{
destroy ();
}
void CRT::reset_end ()

void CRT::reset_end()
{
create (*cName,dwWidth,dwHeight,fmt);
create(*cName,dwWidth,dwHeight,fmt);
}
void resptrcode_crt::create(LPCSTR Name, u32 w, u32 h, D3DFORMAT f, u32 SampleCount)

void resptrcode_crt::create(LPCSTR Name, u32 w, u32 h, D3DFORMAT f, u32 /*SampleCount*/)
{
_set (RImplementation.Resources->_CreateRT(Name,w,h,f));
_set(RImplementation.Resources->_CreateRT(Name,w,h,f));
}
2 changes: 1 addition & 1 deletion src/Layers/xrRenderPC_GL/gl_rendertarget.h
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ class CRenderTarget : public IRender_Target
dbg_lines.back().P1 = P1;
dbg_lines.back().color = c;
}
IC void dbg_addplane (Fplane& P0, u32 c) {
IC void dbg_addplane(Fplane& P0, u32 /*c*/) {
dbg_planes.push_back(P0);
}
#else
Expand Down
1 change: 1 addition & 0 deletions src/Layers/xrRenderPC_GL/gl_rendertarget_phase_combine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ void CRenderTarget::phase_combine ()

// Fill vertex buffer
v_aa* pv = (v_aa*) RCache.Vertex.Lock (4,g_aa_AA->vb_stride,Offset);
// XXX: tamlin: The following four lines are almost 300 columns wide! FIX!
pv->p.set(EPS, float(_h+EPS), EPS,1.f); pv->uv0.set(p0.x, p1.y);pv->uv1.set(p0.x-ddw,p1.y-ddh);pv->uv2.set(p0.x+ddw,p1.y+ddh);pv->uv3.set(p0.x+ddw,p1.y-ddh);pv->uv4.set(p0.x-ddw,p1.y+ddh);pv->uv5.set(p0.x-ddw,p1.y,p1.y,p0.x+ddw);pv->uv6.set(p0.x,p1.y-ddh,p1.y+ddh,p0.x);pv++;
pv->p.set(EPS, EPS, EPS,1.f); pv->uv0.set(p0.x, p0.y);pv->uv1.set(p0.x-ddw,p0.y-ddh);pv->uv2.set(p0.x+ddw,p0.y+ddh);pv->uv3.set(p0.x+ddw,p0.y-ddh);pv->uv4.set(p0.x-ddw,p0.y+ddh);pv->uv5.set(p0.x-ddw,p0.y,p0.y,p0.x+ddw);pv->uv6.set(p0.x,p0.y-ddh,p0.y+ddh,p0.x);pv++;
pv->p.set(float(_w+EPS),float(_h+EPS), EPS,1.f); pv->uv0.set(p1.x, p1.y);pv->uv1.set(p1.x-ddw,p1.y-ddh);pv->uv2.set(p1.x+ddw,p1.y+ddh);pv->uv3.set(p1.x+ddw,p1.y-ddh);pv->uv4.set(p1.x-ddw,p1.y+ddh);pv->uv5.set(p1.x-ddw,p1.y,p1.y,p1.x+ddw);pv->uv6.set(p1.x,p1.y-ddh,p1.y+ddh,p1.x);pv++;
Expand Down
2 changes: 1 addition & 1 deletion src/Layers/xrRenderPC_GL/rgl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ static class cl_sun_shafts_intensity : public R_constant_setup

static class cl_alpha_ref : public R_constant_setup
{
virtual void setup (R_constant* C)
virtual void setup (R_constant* /*C*/)
{
// TODO: OGL: Implement AlphaRef.
//StateManager.BindAlphaRef(C);
Expand Down
2 changes: 1 addition & 1 deletion src/Layers/xrRenderPC_R2/r2_rendertarget.h
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ class CRenderTarget : public IRender_Target
dbg_addline(p3, p7, color);
dbg_addline(p4, p8, color);
}
IC void dbg_addplane(Fplane& P0, u32 c) { dbg_planes.push_back(P0); }
IC void dbg_addplane(Fplane& P0, u32 /*c*/) { dbg_planes.push_back(P0); }
#else
IC void dbg_addline(Fvector& P0, Fvector& P1, u32 c) {}
IC void dbg_addplane(Fplane& P0, u32 c) {}
Expand Down
6 changes: 3 additions & 3 deletions src/xrCore/_fbox2.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ class _box2
max.set(_max);
return *this;
};
IC SelfRef set(T x1, T y1, T x2, T y2)
IC SelfRef set(T x1_, T y1_, T x2_, T y2_)
{
min.set(x1, y1);
max.set(x2, y2);
min.set(x1_, y1_);
max.set(x2_, y2_);
return *this;
};
IC SelfRef set(SelfCRef b)
Expand Down

0 comments on commit 276eb24

Please sign in to comment.