Browse Source

base: a few minor style tweaks.

legacy
Sam Hocevar sam 11 years ago
parent
commit
95369e26db
6 changed files with 14 additions and 19 deletions
  1. +1
    -1
      src/entity.cpp
  2. +1
    -1
      src/gpu/shader.cpp
  3. +6
    -6
      src/gpu/vertexbuffer.cpp
  4. +2
    -2
      src/lol/gpu/vertexbuffer.h
  5. +1
    -1
      src/platform/sdl/sdlinput.cpp
  6. +3
    -8
      src/tileset.cpp

+ 1
- 1
src/entity.cpp View File

@@ -52,7 +52,7 @@ char const *Entity::GetName()

void Entity::TickGame(float seconds)
{
(void)seconds;
UNUSED(seconds);
#if !LOL_RELEASE
if (m_tickstate != STATE_PRETICK_GAME)
Log::Error("invalid entity game tick\n");


+ 1
- 1
src/gpu/shader.cpp View File

@@ -163,7 +163,7 @@ Shader *Shader::Create(char const *lolfx)
void Shader::Destroy(Shader *shader)
{
/* XXX: do nothing! the shader should remain in cache */
(void)shader;
UNUSED(shader);
}

Shader::Shader(char const *vert, char const *frag)


+ 6
- 6
src/gpu/vertexbuffer.cpp View File

@@ -239,27 +239,27 @@ void VertexDeclaration::DrawIndexedElements(MeshPrimitive type, int vbase,
{
case MeshPrimitive::Triangles:
/* FIXME: ignores most of the arguments! */
(void)vbase; (void)vskip; (void)vcount; (void)skip;
UNUSED(vbase, vskip, vcount, skip);
glDrawElements(GL_TRIANGLES, count, GL_UNSIGNED_SHORT, 0);
break;
case MeshPrimitive::TriangleStrips:
/* FIXME: ignores most of the arguments! */
(void)vbase; (void)vskip; (void)vcount; (void)skip;
UNUSED(vbase, vskip, vcount, skip);
glDrawElements(GL_TRIANGLE_STRIP, count, GL_UNSIGNED_SHORT, 0);
break;
case MeshPrimitive::TriangleFans:
/* FIXME: ignores most of the arguments! */
(void)vbase; (void)vskip; (void)vcount; (void)skip;
UNUSED(vbase, vskip, vcount, skip);
glDrawElements(GL_TRIANGLE_FAN, count, GL_UNSIGNED_SHORT, 0);
break;
case MeshPrimitive::Points:
/* FIXME: ignores most of the arguments! */
(void)vbase; (void)vskip; (void)vcount; (void)skip;
UNUSED(vbase, vskip, vcount, skip);
glDrawElements(GL_POINTS, count, GL_UNSIGNED_SHORT, 0);
break;
case MeshPrimitive::Lines:
/* FIXME: ignores most of the arguments! */
(void)vbase; (void)vskip; (void)vcount; (void)skip;
UNUSED(vbase, vskip, vcount, skip);
glDrawElements(GL_LINES, count, GL_UNSIGNED_SHORT, 0);
break;
}
@@ -645,7 +645,7 @@ void *VertexBuffer::Lock(size_t offset, size_t size)
return ret;
#else
/* FIXME: is there a way to use "size"? */
(void)size;
UNUSED(size);
return m_data->m_memory + offset;
#endif
}


+ 2
- 2
src/lol/gpu/vertexbuffer.h View File

@@ -158,7 +158,7 @@ protected:
};

#define LOL_TYPE(T) \
static uint8_t GetType(T *x) { (void)x; return Type##T; }
static uint8_t GetType(T *x) { UNUSED(x); return Type##T; }

LOL_TYPE(void)
LOL_TYPE(half) LOL_TYPE(f16vec2) LOL_TYPE(f16vec3) LOL_TYPE(f16vec4)
@@ -191,7 +191,7 @@ private:
template<>
inline void VertexStreamBase::AddStream<void>(int n, VertexUsage usage)
{
(void)usage;
UNUSED(usage);
m_streams[n].size = 0;
}



+ 1
- 1
src/platform/sdl/sdlinput.cpp View File

@@ -201,7 +201,7 @@ void SdlInputData::Tick(float seconds)
if (keystate[i])
Input::KeyPressed(i, seconds);
#else
(void)seconds;
UNUSED(seconds);
#endif
#endif
}


+ 3
- 8
src/tileset.cpp View File

@@ -67,8 +67,6 @@ TileSet::TileSet(char const *path)
: m_data(new TileSetData())
{
Init(path);

m_drawgroup = DRAWGROUP_BEFORE;
}

TileSet::TileSet(char const *path, ivec2 size, ivec2 count)
@@ -85,8 +83,7 @@ TileSet::TileSet(char const *path, ivec2 size, ivec2 count)
{
if (size.x <= 0 || size.y <= 0)
size = ivec2(32, 32);
count = ivec2(max(1, m_data->m_image_size.x / size.x),
max(1, m_data->m_image_size.y / size.y));
count = max(ivec2(1, 1), m_data->m_image_size / size);
}

for (int j = 0; j < count.y; ++j)
@@ -95,8 +92,6 @@ TileSet::TileSet(char const *path, ivec2 size, ivec2 count)
AddTile(ibox2(size * ivec2(i, j),
size * ivec2(i + 1, j + 1)));
}

m_drawgroup = DRAWGROUP_BEFORE;
}

void TileSet::Init(char const *path)
@@ -108,6 +103,8 @@ void TileSet::Init(char const *path)
m_data->m_image_size = m_data->m_image->GetSize();
m_data->m_texture_size = ivec2(PotUp(m_data->m_image_size.x),
PotUp(m_data->m_image_size.y));

m_drawgroup = DRAWGROUP_BEFORE;
}

int TileSet::AddTile(ibox2 rect)
@@ -194,8 +191,6 @@ int TileSet::GetTileCount() const

ivec2 TileSet::GetTileSize(int tileid) const
{
(void)tileid;

ibox2 const &box = m_data->m_tiles[tileid].m1;
return box.B - box.A;
}


Loading…
Cancel
Save