Переглянути джерело

Stop including <lol/msg> and <lol/base/assert.h> automatically.

legacy
Sam Hocevar 4 роки тому
джерело
коміт
9090b5a4e2
50 змінених файлів з 146 додано та 135 видалено
  1. +2
    -1
      doc/samples/benchmark/half.cpp
  2. +1
    -0
      doc/samples/benchmark/real.cpp
  3. +2
    -1
      doc/samples/benchmark/vector.cpp
  4. +3
    -4
      doc/samples/benchsuite.cpp
  5. +2
    -4
      doc/samples/bluenoise.cpp
  6. +1
    -3
      doc/samples/math/pi.cpp
  7. +6
    -9
      doc/samples/physics/lolphysics.h
  8. +1
    -3
      doc/samples/simplex.cpp
  9. +2
    -3
      doc/tutorial/16_movie.cpp
  10. +1
    -0
      doc/tutorial/17_net.cpp
  11. +2
    -1
      src/application/application.cpp
  12. +2
    -1
      src/application/egl-app.cpp
  13. +2
    -1
      src/application/sdl-app.cpp
  14. +2
    -1
      src/audio/audio.cpp
  15. +2
    -1
      src/audio/sample.cpp
  16. +2
    -1
      src/base/assert.cpp
  17. +4
    -2
      src/easymesh/easymeshbuild.h
  18. +1
    -1
      src/easymesh/easymeshinternal.cpp
  19. +1
    -1
      src/easymesh/easymeshprimitive.cpp
  20. +3
    -1
      src/easymesh/easymeshrender.cpp
  21. +1
    -1
      src/easymesh/easymeshrender.h
  22. +5
    -6
      src/engine/entity.cpp
  23. +2
    -0
      src/engine/ticker.cpp
  24. +1
    -0
      src/gpu/debug.cpp
  25. +2
    -1
      src/gpu/framebuffer.cpp
  26. +2
    -2
      src/gpu/indexbuffer.cpp
  27. +9
    -9
      src/gpu/lolfx.cpp
  28. +1
    -0
      src/gpu/renderer.cpp
  29. +2
    -0
      src/gpu/shader.cpp
  30. +3
    -2
      src/gpu/vertexbuffer.cpp
  31. +3
    -4
      src/image/codec/dummy-image.cpp
  32. +1
    -0
      src/image/codec/imlib2-image.cpp
  33. +2
    -1
      src/image/codec/sdl-image.cpp
  34. +1
    -0
      src/image/combine.cpp
  35. +2
    -1
      src/image/image.cpp
  36. +1
    -0
      src/image/movie.cpp
  37. +2
    -1
      src/image/pixel.cpp
  38. +2
    -1
      src/image/resource.cpp
  39. +0
    -2
      src/lol/base/all.h
  40. +3
    -4
      src/lol/gpu/vertexbuffer.h
  41. +37
    -37
      src/lolua/baselua.h
  42. +1
    -0
      src/mesh/mesh.cpp
  43. +1
    -1
      src/mesh/primitivemesh.cpp
  44. +1
    -0
      src/net/http.cpp
  45. +9
    -6
      src/scene.cpp
  46. +2
    -12
      src/scene.h
  47. +3
    -2
      src/sys/file.cpp
  48. +1
    -0
      src/sys/init.cpp
  49. +2
    -1
      src/ui/gui.cpp
  50. +2
    -2
      src/ui/sdl-input.cpp

+ 2
- 1
doc/samples/benchmark/half.cpp Переглянути файл

@@ -1,7 +1,7 @@
//
// Lol Engine — Benchmark program
//
// Copyright © 2005—2018 Sam Hocevar <sam@hocevar.net>
// Copyright © 2005—2020 Sam Hocevar <sam@hocevar.net>
//
// This program is free software. It comes without any warranty, to
// the extent permitted by applicable law. You can redistribute it
@@ -17,6 +17,7 @@
#include <cstdio>

#include <lol/engine.h>
#include <lol/msg>

using namespace lol;



+ 1
- 0
doc/samples/benchmark/real.cpp Переглянути файл

@@ -17,6 +17,7 @@
#include <cstdio>

#include <lol/engine.h>
#include <lol/msg>
#include <lol/real>

using namespace lol;


+ 2
- 1
doc/samples/benchmark/vector.cpp Переглянути файл

@@ -1,7 +1,7 @@
//
// Lol Engine — Benchmark program
//
// Copyright © 2005—2018 Sam Hocevar <sam@hocevar.net>
// Copyright © 2005—2020 Sam Hocevar <sam@hocevar.net>
//
// This program is free software. It comes without any warranty, to
// the extent permitted by applicable law. You can redistribute it
@@ -17,6 +17,7 @@
#include <cstdio>

#include <lol/engine.h>
#include <lol/msg>

using namespace lol;



+ 3
- 4
doc/samples/benchsuite.cpp Переглянути файл

@@ -1,7 +1,7 @@
//
// Lol Engine — Benchmark program
//
// Copyright © 2005—2015 Sam Hocevar <sam@hocevar.net>
// Copyright © 2005—2020 Sam Hocevar <sam@hocevar.net>
//
// This program is free software. It comes without any warranty, to
// the extent permitted by applicable law. You can redistribute it
@@ -17,6 +17,7 @@
#include <cstdio>

#include <lol/engine.h>
#include <lol/msg>

using namespace lol;

@@ -24,10 +25,8 @@ void bench_real(int mode);
void bench_matrix(int mode);
void bench_half(int mode);

int main(int argc, char **argv)
int main(int, char **)
{
UNUSED(argc, argv);

msg::info("-----------------------\n");
msg::info(" High precision floats\n");
msg::info("-----------------------\n");


+ 2
- 4
doc/samples/bluenoise.cpp Переглянути файл

@@ -1,7 +1,7 @@
//
// bluenoise — create a N×N blue noise kernel
//
// Copyright © 2016—2017 Sam Hocevar <sam@hocevar.net>
// Copyright © 2016—2020 Sam Hocevar <sam@hocevar.net>
//
// This program is free software. It comes without any warranty, to
// the extent permitted by applicable law. You can redistribute it
@@ -18,10 +18,8 @@

using namespace lol;

int main(int argc, char **argv)
int main(int, char **)
{
UNUSED(argc, argv);

ivec2 const size(64);
auto const &kernel = image::kernel::blue_noise(size, ivec2(8));



+ 1
- 3
doc/samples/math/pi.cpp Переглянути файл

@@ -22,10 +22,8 @@

using lol::real;

int main(int argc, char **argv)
int main(int, char **)
{
UNUSED(argc, argv);

std::cout << std::setprecision(150);
std::cout << " 0: " << real::R_0() << '\n';
std::cout << " 1: " << real::R_1() << '\n';


+ 6
- 9
doc/samples/physics/lolphysics.h Переглянути файл

@@ -14,6 +14,7 @@
#pragma once

#include <cstring>
#include <cassert>
#include <vector>

#include <btBulletDynamicsCommon.h>
@@ -152,10 +153,8 @@ public:
{
}

virtual btScalar addSingleResult(btCollisionWorld::LocalRayResult& rayResult,bool normalInWorldSpace)
virtual btScalar addSingleResult(btCollisionWorld::LocalRayResult &, bool)
{
UNUSED(rayResult);
UNUSED(normalInWorldSpace);
return .0f;
}
};
@@ -194,7 +193,7 @@ public:
}
default:
{
ASSERT(0, "Raycast not handled");
assert(false); // Raycast not handled
}
}

@@ -226,7 +225,7 @@ public:
}
default:
{
ASSERT(0, "Raycast not handled");
assert(false); // Raycast not handled
}
}
}
@@ -264,10 +263,8 @@ private:
m_dynamics_world->setGravity(LOL2BT_VEC3(NewGravity * LOL2BT_UNIT));
}

void CustomSetWorldLimit(vec3 const &NewWorldMin, vec3 const &NewWorldMax)
void CustomSetWorldLimit(vec3 const &, vec3 const &)
{
UNUSED(NewWorldMin);
UNUSED(NewWorldMax);
}

void CustomSetTimestep(float NewTimestep) { }
@@ -371,7 +368,7 @@ private:
}
default:
{
ASSERT(0, "Physic type does not exist.");
assert(false); // Physic type does not exist
}
}



+ 1
- 3
doc/samples/simplex.cpp Переглянути файл

@@ -25,10 +25,8 @@ ivec2 const size(1280 * 1, 720 * 1);
float const zoom = 0.03f / 1;
int const octaves = 1;

int main(int argc, char **argv)
int main(int, char **)
{
UNUSED(argc, argv);

srand(time(nullptr));

/* Create an image */


+ 2
- 3
doc/tutorial/16_movie.cpp Переглянути файл

@@ -15,14 +15,13 @@
#endif

#include <lol/engine.h>
#include <lol/msg>
#include <lol/vector>
#include <lol/noise>
#include <lol/image/movie.h>

int main(int argc, char **argv)
int main(int, char **)
{
UNUSED(argc, argv);

lol::ivec2 size(256, 256);

lol::movie movie(size);


+ 1
- 0
doc/tutorial/17_net.cpp Переглянути файл

@@ -15,6 +15,7 @@
#endif

#include <lol/engine.h>
#include <lol/msg>

class demo : public lol::entity
{


+ 2
- 1
src/application/application.cpp Переглянути файл

@@ -1,7 +1,7 @@
//
// Lol Engine
//
// Copyright © 2010—2019 Sam Hocevar <sam@hocevar.net>
// Copyright © 2010—2020 Sam Hocevar <sam@hocevar.net>
//
// Lol Engine is free software. It comes without any warranty, to
// the extent permitted by applicable law. You can redistribute it
@@ -11,6 +11,7 @@
//

#include <lol/engine-internal.h>
#include <../legacy/lol/base/assert.h>

#if HAVE_EMSCRIPTEN_H
# include <emscripten.h>


+ 2
- 1
src/application/egl-app.cpp Переглянути файл

@@ -1,7 +1,7 @@
//
// Lol Engine
//
// Copyright © 2010—2016 Sam Hocevar <sam@hocevar.net>
// Copyright © 2010—2020 Sam Hocevar <sam@hocevar.net>
//
// Lol Engine is free software. It comes without any warranty, to
// the extent permitted by applicable law. You can redistribute it
@@ -11,6 +11,7 @@
//

#include <lol/engine-internal.h>
#include <lol/msg>

#if defined LOL_USE_EGL && !defined __ANDROID__
# if defined HAVE_BCM_HOST_H


+ 2
- 1
src/application/sdl-app.cpp Переглянути файл

@@ -11,6 +11,7 @@
//

#include <lol/engine-internal.h>
#include <lol/msg>

#if LOL_USE_SDL
# if HAVE_SDL2_SDL_H
@@ -155,7 +156,7 @@ const char* SceneDisplay::GetPhysicalName(int index)
*/
sdl::app::app(char const *title, ivec2 res, float fps)
{
UNUSED(title);
(void)title;
#if LOL_USE_SDL
ivec2 window_size = res;
ivec2 screen_size = res;


+ 2
- 1
src/audio/audio.cpp Переглянути файл

@@ -1,7 +1,7 @@
//
// Lol Engine
//
// Copyright © 2010—2019 Sam Hocevar <sam@hocevar.net>
// Copyright © 2010—2020 Sam Hocevar <sam@hocevar.net>
//
// Lol Engine is free software. It comes without any warranty, to
// the extent permitted by applicable law. You can redistribute it
@@ -11,6 +11,7 @@
//

#include <lol/engine-internal.h>
#include <lol/msg>

#include <array>
#include <unordered_set>


+ 2
- 1
src/audio/sample.cpp Переглянути файл

@@ -1,7 +1,7 @@
//
// Lol Engine
//
// Copyright © 2010—2019 Sam Hocevar <sam@hocevar.net>
// Copyright © 2010—2020 Sam Hocevar <sam@hocevar.net>
//
// Lol Engine is free software. It comes without any warranty, to
// the extent permitted by applicable law. You can redistribute it
@@ -11,6 +11,7 @@
//

#include <lol/engine-internal.h>
#include <lol/msg>

#include <cstdlib>
#include <cstdio>


+ 2
- 1
src/base/assert.cpp Переглянути файл

@@ -1,7 +1,7 @@
//
// Lol Engine
//
// Copyright © 2010—2019 Sam Hocevar <sam@hocevar.net>
// Copyright © 2010—2020 Sam Hocevar <sam@hocevar.net>
//
// Lol Engine is free software. It comes without any warranty, to
// the extent permitted by applicable law. You can redistribute it
@@ -11,6 +11,7 @@
//

#include <lol/engine-internal.h>
#include <../legacy/lol/base/assert.h>

#if HAVE_CXXABI_H
# include <cxxabi.h>


+ 4
- 2
src/easymesh/easymeshbuild.h Переглянути файл

@@ -338,7 +338,8 @@ public:
{
/* unused for now, but will be if new BuildType are added. */
TexCoordBuildType tcbt = GetTexCoordBuildType(mt);
UNUSED(tcbt);
(void)tcbt;

if (mt == MeshType::Quad)
{
// There's nothin' else than QuadDefault
@@ -428,7 +429,8 @@ public:
else
{
TexCoordBuildType tcbt = GetTexCoordBuildType2(mt);
UNUSED(tcbt);
(void)tcbt;

if (mt == MeshType::Quad)
{
// There's nothin' else than QuadDefault


+ 1
- 1
src/easymesh/easymeshinternal.cpp Переглянути файл

@@ -280,7 +280,7 @@ void EasyMesh::VerticesSeparate()
//-----------------------------------------------------------------------------
void EasyMesh::ComputeTexCoord(float uv_scale, int uv_offset)
{
UNUSED(uv_scale, uv_offset);
(void)uv_scale; (void)uv_offset;
#if 0
VertexDictionnary vert_dict;
easy_array<int> tri_list;


+ 1
- 1
src/easymesh/easymeshprimitive.cpp Переглянути файл

@@ -922,7 +922,7 @@ void EasyMesh::AppendCog(int nbsides, float h, float d10, float d20,
j, j, j, j, \
k, j, j, k \
}; \
UNUSED(q);
(void)q;
int m[] = { /* The top and bottom faces */
0, 2, 3, 1,
7, 9, 8, 6,


+ 3
- 1
src/easymesh/easymeshrender.cpp Переглянути файл

@@ -13,6 +13,7 @@
//

#include <lol/engine-internal.h>
#include <../legacy/lol/base/assert.h>

namespace lol
{
@@ -179,7 +180,8 @@ void DefaultShaderData::StoreUniformNames()
//-----------------------------------------------------------------------------
void DefaultShaderData::SetupDefaultData(bool with_UV)
{
UNUSED(with_UV);
(void)with_UV;

for (int i = 0; i < 7; i++)
AddUniform(DefaultUniforms[i]);
}


+ 1
- 1
src/easymesh/easymeshrender.h Переглянути файл

@@ -87,7 +87,7 @@ public:
ShaderUniform const *GetUniform(std::string const &uniform);
ShaderAttrib const *GetAttribute(VertexUsage usage, int index);
//--
virtual void SetupShaderDatas(mat4 const &model) { UNUSED(model); }
virtual void SetupShaderDatas(mat4 const &) { }
//--

protected:


+ 5
- 6
src/engine/entity.cpp Переглянути файл

@@ -1,7 +1,7 @@
//
// Lol Engine
//
// Copyright © 2010—2019 Sam Hocevar <sam@hocevar.net>
// Copyright © 2010—2020 Sam Hocevar <sam@hocevar.net>
//
// Lol Engine is free software. It comes without any warranty, to
// the extent permitted by applicable law. You can redistribute it
@@ -11,6 +11,7 @@
//

#include <lol/engine-internal.h>
#include <lol/msg>

#include <cstdlib>

@@ -46,9 +47,8 @@ std::string entity::GetName() const
return "<entity>";
}

void entity::tick_game(float seconds)
void entity::tick_game(float)
{
UNUSED(seconds);
#if !LOL_BUILD_RELEASE
if (m_tickstate != tickable::state::pre_game)
msg::error("invalid entity game tick\n");
@@ -56,9 +56,8 @@ void entity::tick_game(float seconds)
#endif
}

void entity::tick_draw(float seconds, Scene &scene)
void entity::tick_draw(float, Scene &)
{
UNUSED(seconds, scene);
#if !LOL_BUILD_RELEASE
if (m_tickstate != tickable::state::pre_draw)
msg::error("invalid entity draw tick\n");
@@ -66,5 +65,5 @@ void entity::tick_draw(float seconds, Scene &scene)
#endif
}

} /* namespace lol */
} // namespace lol


+ 2
- 0
src/engine/ticker.cpp Переглянути файл

@@ -11,6 +11,8 @@
//

#include <lol/engine-internal.h>
#include <lol/msg>
#include <../legacy/lol/base/assert.h>

#include <unordered_set> // std::unordered_set
#include <cstdlib>


+ 1
- 0
src/gpu/debug.cpp Переглянути файл

@@ -11,6 +11,7 @@
//

#include <lol/engine-internal.h>
#include <../legacy/lol/base/assert.h>

#include "lolgl.h"



+ 2
- 1
src/gpu/framebuffer.cpp Переглянути файл

@@ -1,7 +1,7 @@
//
// Lol Engine
//
// Copyright © 2010—2019 Sam Hocevar <sam@hocevar.net>
// Copyright © 2010—2020 Sam Hocevar <sam@hocevar.net>
//
// Lol Engine is free software. It comes without any warranty, to
// the extent permitted by applicable law. You can redistribute it
@@ -11,6 +11,7 @@
//

#include <lol/engine-internal.h>
#include <../legacy/lol/base/assert.h>

// FIXME: fine-tune this define
#if defined LOL_USE_GLEW || defined HAVE_GL_2X || defined HAVE_GLES_2X


+ 2
- 2
src/gpu/indexbuffer.cpp Переглянути файл

@@ -1,7 +1,7 @@
//
// Lol Engine
//
// Copyright © 2010—2017 Sam Hocevar <sam@hocevar.net>
// Copyright © 2010—2020 Sam Hocevar <sam@hocevar.net>
//
// Lol Engine is free software. It comes without any warranty, to
// the extent permitted by applicable law. You can redistribute it
@@ -69,7 +69,7 @@ void *IndexBuffer::lock(size_t offset, size_t size)
if (!m_data->m_size)
return nullptr;

UNUSED(size);
(void)size;
return m_data->m_memory + offset;
}



+ 9
- 9
src/gpu/lolfx.cpp Переглянути файл

@@ -1,11 +1,13 @@
//
// Lol Engine
// Lol Engine
//
// Copyright: (c) 2010-2013 Sam Hocevar <sam@hocevar.net>
// This program is free software; you can redistribute it and/or
// modify it under the terms of the Do What The Fuck You Want To
// Public License, Version 2, as published by Sam Hocevar. See
// http://www.wtfpl.net/ for more details.
// Copyright © 2010—2020 Sam Hocevar <sam@hocevar.net>
//
// Lol Engine is free software. It comes without any warranty, to
// the extent permitted by applicable law. You can redistribute it
// and/or modify it under the terms of the Do What the Fuck You Want
// to Public License, Version 2, as published by the WTFPL Task Force.
// See http://www.wtfpl.net/ for more details.
//

//
@@ -29,10 +31,8 @@ LolFx::LolFx()
;
}

bool LolFx::Compile(char const *command)
bool LolFx::Compile(char const *)
{
UNUSED(command);

return false;
}



+ 1
- 0
src/gpu/renderer.cpp Переглянути файл

@@ -11,6 +11,7 @@
//

#include <lol/engine-internal.h>
#include <lol/msg>

#include <cstdlib>



+ 2
- 0
src/gpu/shader.cpp Переглянути файл

@@ -11,7 +11,9 @@
//

#include <lol/engine-internal.h>
#include <lol/msg>
#include <lol/pegtl>
#include <../legacy/lol/base/assert.h>

#include <string>
#include <memory>


+ 3
- 2
src/gpu/vertexbuffer.cpp Переглянути файл

@@ -1,7 +1,7 @@
//
// Lol Engine
//
// Copyright © 2010—2019 Sam Hocevar <sam@hocevar.net>
// Copyright © 2010—2020 Sam Hocevar <sam@hocevar.net>
//
// Lol Engine is free software. It comes without any warranty, to
// the extent permitted by applicable law. You can redistribute it
@@ -11,6 +11,7 @@
//

#include <lol/engine-internal.h>
#include <lol/msg>

#include "lolgl.h"

@@ -382,7 +383,7 @@ void *VertexBuffer::lock(size_t offset, size_t size)
return nullptr;

/* FIXME: is there a way to use "size"? */
UNUSED(size);
(void)size;
return m_data->m_memory + offset;
}



+ 3
- 4
src/image/codec/dummy-image.cpp Переглянути файл

@@ -1,7 +1,7 @@
//
// Lol Engine
//
// Copyright © 2010—2018 Sam Hocevar <sam@hocevar.net>
// Copyright © 2010—2020 Sam Hocevar <sam@hocevar.net>
//
// Lol Engine is free software. It comes without any warranty, to
// the extent permitted by applicable law. You can redistribute it
@@ -11,6 +11,7 @@
//

#include <lol/engine-internal.h>
#include <../legacy/lol/base/assert.h>

#include <string>

@@ -60,10 +61,8 @@ ResourceCodecData* DummyImageCodec::Load(std::string const &path)
return data;
}

bool DummyImageCodec::Save(std::string const &path, ResourceCodecData* data)
bool DummyImageCodec::Save(std::string const &, ResourceCodecData *)
{
UNUSED(path, data);

return false;
}



+ 1
- 0
src/image/codec/imlib2-image.cpp Переглянути файл

@@ -11,6 +11,7 @@
//

#include <lol/engine-internal.h>
#include <lol/msg>

#if defined LOL_USE_IMLIB2



+ 2
- 1
src/image/codec/sdl-image.cpp Переглянути файл

@@ -1,7 +1,7 @@
//
// Lol Engine
//
// Copyright © 2010—2019 Sam Hocevar <sam@hocevar.net>
// Copyright © 2010—2020 Sam Hocevar <sam@hocevar.net>
//
// Lol Engine is free software. It comes without any warranty, to
// the extent permitted by applicable law. You can redistribute it
@@ -11,6 +11,7 @@
//

#include <lol/engine-internal.h>
#include <lol/msg>

#if LOL_USE_SDL_IMAGE



+ 1
- 0
src/image/combine.cpp Переглянути файл

@@ -11,6 +11,7 @@
//

#include <lol/engine-internal.h>
#include <../legacy/lol/base/assert.h>

/*
* Image merge operations: merge, min/max, overlay, screen, multiply,


+ 2
- 1
src/image/image.cpp Переглянути файл

@@ -1,7 +1,7 @@
//
// Lol Engine
//
// Copyright © 2010—2018 Sam Hocevar <sam@hocevar.net>
// Copyright © 2010—2020 Sam Hocevar <sam@hocevar.net>
//
// Lol Engine is free software. It comes without any warranty, to
// the extent permitted by applicable law. You can redistribute it
@@ -11,6 +11,7 @@
//

#include <lol/engine-internal.h>
#include <../legacy/lol/base/assert.h>

#include "image-private.h"



+ 1
- 0
src/image/movie.cpp Переглянути файл

@@ -11,6 +11,7 @@
//

#include <lol/engine-internal.h>
#include <../legacy/lol/base/assert.h>
#include <lol/image/movie.h>

#if LOL_USE_FFMPEG


+ 2
- 1
src/image/pixel.cpp Переглянути файл

@@ -1,7 +1,7 @@
//
// Lol Engine
//
// Copyright © 2004—2019 Sam Hocevar <sam@hocevar.net>
// Copyright © 2004—2020 Sam Hocevar <sam@hocevar.net>
//
// Lol Engine is free software. It comes without any warranty, to
// the extent permitted by applicable law. You can redistribute it
@@ -11,6 +11,7 @@
//

#include <lol/engine-internal.h>
#include <../legacy/lol/base/assert.h>

#include "image-private.h"



+ 2
- 1
src/image/resource.cpp Переглянути файл

@@ -2,7 +2,7 @@
// Lol Engine
//
// Copyright © 2010—2020 Sam Hocevar <sam@hocevar.net>
// Copyright © 2016—2017 Benjamin “Touky” Huet <huet.benjamin@gmail.com>
// © 2016—2017 Benjamin “Touky” Huet <huet.benjamin@gmail.com>
//
// Lol Engine is free software. It comes without any warranty, to
// the extent permitted by applicable law. You can redistribute it
@@ -12,6 +12,7 @@
//

#include <lol/engine-internal.h>
#include <lol/msg>

#include "resource-private.h"



+ 0
- 2
src/lol/base/all.h Переглянути файл

@@ -13,10 +13,8 @@
#pragma once

#include <lol/utils>
#include <lol/msg>

#include <../legacy/lol/base/types.h>
#include <../legacy/lol/base/assert.h>
#include <../legacy/lol/base/avl_tree.h>
#include <lol/base/enum.h>


+ 3
- 4
src/lol/gpu/vertexbuffer.h Переглянути файл

@@ -129,7 +129,7 @@ public:
protected:

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

__T(void)
__T(half) __T(f16vec2) __T(f16vec3) __T(f16vec4)
@@ -158,11 +158,10 @@ private:
static VertexStreamBase const Empty;
};

/* Specialise this template for "void" to act as a NOP */
// Specialise this template for "void" to act as a NOP
template<>
inline void VertexStreamBase::AddStream<void>(int n, VertexUsage usage)
inline void VertexStreamBase::AddStream<void>(int n, VertexUsage)
{
UNUSED(usage);
m_streams[n].size = 0;
}



+ 37
- 37
src/lolua/baselua.h Переглянути файл

@@ -19,6 +19,8 @@ extern "C" {
#include "3rdparty/lua/lauxlib.h"
}

#include <../legacy/lol/base/assert.h>

#include <vector> // std::vector
#include <string> // std::string
#include <cstdlib> // tolower
@@ -111,10 +113,8 @@ public:
public:
Object() { }
virtual ~Object() { }
static Object* New(lua_State* l, int arg_nb)
static Object* New(lua_State*, int)
{
UNUSED(l);
UNUSED(arg_nb);
ASSERT(false);
return nullptr;
}
@@ -243,17 +243,17 @@ protected:
template <typename TLuaClass> static int Store(lua_State * l);
template <typename TLuaClass> static int Del(lua_State * l);
//-------------------------------------------------------------------------
template <typename TLuaClass> static int ToString(lua_State* l) { UNUSED(l); ASSERT(false); return 0; }
template <typename TLuaClass> static int OpAdd(lua_State* l) { UNUSED(l); ASSERT(false); return 0; }
template <typename TLuaClass> static int OpSubstract(lua_State* l) { UNUSED(l); ASSERT(false); return 0; }
template <typename TLuaClass> static int OpMultiply(lua_State* l) { UNUSED(l); ASSERT(false); return 0; }
template <typename TLuaClass> static int OpDivide(lua_State* l) { UNUSED(l); ASSERT(false); return 0; }
template <typename TLuaClass> static int OpModulo(lua_State* l) { UNUSED(l); ASSERT(false); return 0; }
template <typename TLuaClass> static int OpUnaryNeg(lua_State* l) { UNUSED(l); ASSERT(false); return 0; }
template <typename TLuaClass> static int OpConcat(lua_State* l) { UNUSED(l); ASSERT(false); return 0; }
template <typename TLuaClass> static int CmpEqual(lua_State* l) { UNUSED(l); ASSERT(false); return 0; }
template <typename TLuaClass> static int CmpLessThan(lua_State* l) { UNUSED(l); ASSERT(false); return 0; }
template <typename TLuaClass> static int CmpLessEqual(lua_State* l) { UNUSED(l); ASSERT(false); return 0; }
template <typename TLuaClass> static int ToString(lua_State*) { ASSERT(false); return 0; }
template <typename TLuaClass> static int OpAdd(lua_State*) { ASSERT(false); return 0; }
template <typename TLuaClass> static int OpSubstract(lua_State*) { ASSERT(false); return 0; }
template <typename TLuaClass> static int OpMultiply(lua_State*) { ASSERT(false); return 0; }
template <typename TLuaClass> static int OpDivide(lua_State*) { ASSERT(false); return 0; }
template <typename TLuaClass> static int OpModulo(lua_State*) { ASSERT(false); return 0; }
template <typename TLuaClass> static int OpUnaryNeg(lua_State*) { ASSERT(false); return 0; }
template <typename TLuaClass> static int OpConcat(lua_State*) { ASSERT(false); return 0; }
template <typename TLuaClass> static int CmpEqual(lua_State*) { ASSERT(false); return 0; }
template <typename TLuaClass> static int CmpLessThan(lua_State*) { ASSERT(false); return 0; }
template <typename TLuaClass> static int CmpLessEqual(lua_State*) { ASSERT(false); return 0; }
};

//-----------------------------------------------------------------------------
@@ -385,8 +385,8 @@ protected:
#define INNER_ERROR "Your type is not implemented. For pointers, use LuaPtr<MyType>()"
template<typename T> T InnerDefault() { return T(0); }
template<typename T> bool InnerIsValid() { ASSERT(false, INNER_ERROR); return false; }
template<typename T> T InnerGet(T value) { UNUSED(value); ASSERT(false, INNER_ERROR); return InnerDefault<T>(); }
template<typename T> int InnerPush(T value) { UNUSED(value); ASSERT(false, INNER_ERROR); return 0; }
template<typename T> T InnerGet(T) { ASSERT(false, INNER_ERROR); return InnerDefault<T>(); }
template<typename T> int InnerPush(T) { ASSERT(false, INNER_ERROR); return 0; }

#ifndef INNER_SAFE_ENUM
// Gets the value for the given enum type.
@@ -505,16 +505,16 @@ private:
#ifndef REGION_STACK_VAR

#ifndef STACK_BOOL
template<> inline bool Stack::InnerIsValid<bool>() { return lua_isboolean(m_state, m_index); }
template<> inline bool Stack::InnerGet<bool>(bool value) { UNUSED(value); return !!lua_toboolean(m_state, m_index++); }
template<> inline bool Stack::InnerIsValid<bool>() { return lua_isboolean(m_state, m_index); }
template<> inline bool Stack::InnerGet<bool>(bool) { return !!lua_toboolean(m_state, m_index++); }
template<> inline int Stack::InnerPush<bool>(bool value) { lua_pushboolean(m_state, value); return 1; }
#endif // STACK_BOOL

//-----------------------------------------------------------------------------
#ifndef STACK_CHAR_CONST
template<> inline bool Stack::InnerIsValid<char const*>() { return !!lua_isstring(m_state, m_index); }
template<> inline char const* Stack::InnerGet<char const*>(char const* value) { UNUSED(value); return lua_tostring(m_state, m_index++); }
template<> inline int Stack::InnerPush<char const*>(char const* value) { lua_pushstring(m_state, value); return 1; }
template<> inline bool Stack::InnerIsValid<char const*>() { return !!lua_isstring(m_state, m_index); }
template<> inline char const* Stack::InnerGet<char const*>(char const *) { return lua_tostring(m_state, m_index++); }
template<> inline int Stack::InnerPush<char const*>(char const* value) { lua_pushstring(m_state, value); return 1; }
#endif // STACK_CHAR_CONST

//-----------------------------------------------------------------------------
@@ -527,9 +527,9 @@ template<> inline int Stack::InnerPush<std::string>(std::string value) {

//-----------------------------------------------------------------------------
#ifndef STACK_STRING
template<> inline bool Stack::InnerIsValid<double>() { return !!lua_isnumber(m_state, m_index); }
template<> inline double Stack::InnerGet<double>(double value) { UNUSED(value); return lua_tonumber(m_state, m_index++); }
template<> inline int Stack::InnerPush<double>(double value) { lua_pushnumber(m_state, value); return 1; }
template<> inline bool Stack::InnerIsValid<double>() { return !!lua_isnumber(m_state, m_index); }
template<> inline double Stack::InnerGet<double>(double) { return lua_tonumber(m_state, m_index++); }
template<> inline int Stack::InnerPush<double>(double value) { lua_pushnumber(m_state, value); return 1; }
#endif //STACK_STRING

//-----------------------------------------------------------------------------
@@ -541,30 +541,30 @@ template<> inline int Stack::InnerPush<float>(float value) { return InnerPush<d

//-----------------------------------------------------------------------------
#ifndef STACK_INT64
template<> inline bool Stack::InnerIsValid<int64_t>() { return !!lua_isnumber(m_state, m_index); }
template<> inline int64_t Stack::InnerGet<int64_t>(int64_t value) { UNUSED(value); return lua_tointeger(m_state, m_index++); }
template<> inline int Stack::InnerPush<int64_t>(int64_t value) { lua_pushinteger(m_state, value); return 1; }
template<> inline bool Stack::InnerIsValid<int64_t>() { return !!lua_isnumber(m_state, m_index); }
template<> inline int64_t Stack::InnerGet<int64_t>(int64_t) { return lua_tointeger(m_state, m_index++); }
template<> inline int Stack::InnerPush<int64_t>(int64_t value) { lua_pushinteger(m_state, value); return 1; }
#endif //STACK_INT64

//-----------------------------------------------------------------------------
#ifndef STACK_UINT64
template<> inline bool Stack::InnerIsValid<uint64_t>() { return !!lua_isnumber(m_state, m_index); }
template<> inline uint64_t Stack::InnerGet<uint64_t>(uint64_t value) { UNUSED(value); return (uint64_t)lua_tointeger(m_state, m_index++); }
template<> inline int Stack::InnerPush<uint64_t>(uint64_t value) { lua_pushinteger(m_state, (lua_Unsigned)value); return 1; }
template<> inline bool Stack::InnerIsValid<uint64_t>() { return !!lua_isnumber(m_state, m_index); }
template<> inline uint64_t Stack::InnerGet<uint64_t>(uint64_t) { return (uint64_t)lua_tointeger(m_state, m_index++); }
template<> inline int Stack::InnerPush<uint64_t>(uint64_t value) { lua_pushinteger(m_state, (lua_Unsigned)value); return 1; }
#endif //STACK_UINT64

//-----------------------------------------------------------------------------
#ifndef STACK_INT32
template<> inline bool Stack::InnerIsValid<int32_t>() { return !!lua_isnumber(m_state, m_index); }
template<> inline int32_t Stack::InnerGet<int32_t>(int32_t value) { UNUSED(value); return (int32_t)lua_tointeger(m_state, m_index++); }
template<> inline int Stack::InnerPush<int32_t>(int32_t value) { lua_pushinteger(m_state, (lua_Integer)value); return 1; }
template<> inline bool Stack::InnerIsValid<int32_t>() { return !!lua_isnumber(m_state, m_index); }
template<> inline int32_t Stack::InnerGet<int32_t>(int32_t) { return (int32_t)lua_tointeger(m_state, m_index++); }
template<> inline int Stack::InnerPush<int32_t>(int32_t value) { lua_pushinteger(m_state, (lua_Integer)value); return 1; }
#endif // STACK_INT32

//-----------------------------------------------------------------------------
#ifndef STACK_UINT32
template<> inline bool Stack::InnerIsValid<uint32_t>() { return !!lua_isnumber(m_state, m_index); }
template<> inline uint32_t Stack::InnerGet<uint32_t>(uint32_t value) { UNUSED(value); return (uint32_t)(lua_Unsigned)lua_tointeger(m_state, m_index++); }
template<> inline int Stack::InnerPush<uint32_t>(uint32_t value) { lua_pushinteger(m_state, (lua_Unsigned)value); return 1; }
template<> inline bool Stack::InnerIsValid<uint32_t>() { return !!lua_isnumber(m_state, m_index); }
template<> inline uint32_t Stack::InnerGet<uint32_t>(uint32_t) { return (uint32_t)(lua_Unsigned)lua_tointeger(m_state, m_index++); }
template<> inline int Stack::InnerPush<uint32_t>(uint32_t value) { lua_pushinteger(m_state, (lua_Unsigned)value); return 1; }
#endif //STACK_UINT32

//-----------------------------------------------------------------------------
@@ -625,7 +625,7 @@ protected:
static void Release(lua_State* l, Loader* loader);
static void StoreObject(lua_State* l, Object* obj);
//Virtual Store lua object ------------------------------------------------
virtual void Store(Object* obj) { UNUSED(obj); }
virtual void Store(Object*) { }

private:
lua_State* m_lua_state;


+ 1
- 0
src/mesh/mesh.cpp Переглянути файл

@@ -11,6 +11,7 @@
//

#include <lol/engine-internal.h>
#include <../legacy/lol/base/assert.h>

#include <memory> // std::shared_ptr
#include <tuple> // std::make_tuple


+ 1
- 1
src/mesh/primitivemesh.cpp Переглянути файл

@@ -43,7 +43,7 @@ void PrimitiveMesh::Render(Scene& scene, std::shared_ptr<PrimitiveSource> primit
ShaderAttrib a_pos, a_tex;

/* FIXME: ignored for now */
UNUSED(primitive);
(void)primitive;

{
/* If this primitive uses a new shader, update attributes */


+ 1
- 0
src/net/http.cpp Переглянути файл

@@ -11,6 +11,7 @@
//

#include <lol/engine-internal.h>
#include <lol/msg>

#if LOL_USE_OPENSSL
# define CPPHTTPLIB_OPENSSL_SUPPORT 1


+ 9
- 6
src/scene.cpp Переглянути файл

@@ -12,6 +12,7 @@
//

#include <lol/engine-internal.h>
#include <../legacy/lol/base/assert.h>

#include <map>
#include <vector>
@@ -50,7 +51,7 @@ static inline void gpu_marker(char const *message)
if (GLEW_GREMEDY_string_marker)
glStringMarkerGREMEDY(0, message);
#else
UNUSED(message);
(void)message;
#endif
}

@@ -94,12 +95,12 @@ void SceneDisplay::Disable()
* Primitive implementation class
*/

void PrimitiveSource::Render(Scene& scene) { UNUSED(scene); }
void PrimitiveSource::Render(Scene &)
{
}

void PrimitiveRenderer::Render(Scene& scene, std::shared_ptr<PrimitiveSource> primitive)
void PrimitiveRenderer::Render(Scene &, std::shared_ptr<PrimitiveSource>)
{
UNUSED(scene);
UNUSED(primitive);
}

/*
@@ -713,8 +714,10 @@ void Scene::render_lines(float seconds)
std::vector<std::array<vec4,4>> buff;
buff.resize(linecount);
int real_linecount = 0;

mat4 const inv_view_proj = inverse(GetCamera()->GetProjection() * GetCamera()->GetView());
UNUSED(inv_view_proj);
(void)inv_view_proj;

for (size_t i = 0; i < linecount; i++)
{
if (m_line_api.m_lines[i].mask & m_line_api.m_debug_mask)


+ 2
- 12
src/scene.h Переглянути файл

@@ -81,10 +81,10 @@ public:
virtual ~SceneDisplay() { }

/* pos/size/... methods */
virtual void set_resolution(ivec2 resolution) { UNUSED(resolution); }
virtual void set_resolution(ivec2) { }
virtual ivec2 resolution() const { return ivec2(0); }

virtual void SetPosition(ivec2 position) { UNUSED(position); }
virtual void SetPosition(ivec2) { }

/* TODO: Should that be there or in Video ? */
static void Add(SceneDisplay* display);
@@ -152,7 +152,6 @@ public:
template <typename T>
int HasPrimitiveSource(T* key)
{
ASSERT(key);
return HasPrimitiveSource(_KEY_IDX);
}
/* Add a primitive sources linked to the given entity
@@ -160,7 +159,6 @@ public:
template <typename T>
int AddPrimitiveSource(T* key, std::shared_ptr<class PrimitiveSource> source)
{
ASSERT(key);
return AddPrimitiveSource(_KEY_IDX, source);
}
/* Update the primitive source at index linked to the given entity
@@ -169,21 +167,18 @@ public:
template <typename T>
void SetPrimitiveSource(int index, T* key, std::shared_ptr<class PrimitiveSource> source)
{
ASSERT(key);
SetPrimitiveSource(index, _KEY_IDX, source);
}
/* Remove primitive source at index set to the given entity */
template <typename T>
void ReleasePrimitiveSource(int index, T* key)
{
ASSERT(key);
ReleasePrimitiveSource(index, _KEY_IDX);
}
/* Remove all primitive source set to the given entity */
template <typename T>
void ReleaseAllPrimitiveSources(T* key)
{
ASSERT(key);
ReleaseAllPrimitiveSources(_KEY_IDX);
}

@@ -200,7 +195,6 @@ public:
template <typename T>
int HasPrimitiveRenderer(T* key)
{
ASSERT(key);
return HasPrimitiveRenderer(_KEY_IDX);
}
/* Add a primitive renderer linked to the given entity
@@ -209,7 +203,6 @@ public:
template <typename T>
void AddPrimitiveRenderer(T* key, std::shared_ptr<class PrimitiveRenderer> renderer)
{
ASSERT(key);
AddPrimitiveRenderer(_KEY_IDX, renderer);
}
/* Update the primitive renderer linked to the given entity
@@ -218,21 +211,18 @@ public:
template <typename T>
void SetPrimitiveRenderer(int index, T* key, std::shared_ptr<class PrimitiveRenderer> renderer)
{
ASSERT(key && renderer);
SetPrimitiveRenderer(index, _KEY_IDX, renderer);
}
/* Remove primitive renderer at index set to the given entity */
template <typename T>
void ReleasePrimitiveRenderer(int index, T* key)
{
ASSERT(key);
ReleasePrimitiveRenderer(index, _KEY_IDX);
}
/* Remove all primitive renderer set to the given entity */
template <typename T>
void ReleaseAllPrimitiveRenderers(T* key)
{
ASSERT(key);
ReleaseAllPrimitiveRenderers(_KEY_IDX);
}
/* ============================== */


+ 3
- 2
src/sys/file.cpp Переглянути файл

@@ -350,7 +350,7 @@ class DirectoryData

void Open(std::string const &directory, FileAccess mode)
{
UNUSED(mode); /* FIXME */
(void)mode; /* FIXME */

m_type = StreamType::File;
#if __ANDROID__
@@ -541,8 +541,9 @@ bool Directory::GetContent(std::vector<std::string>* files,
std::vector<Directory>* directories)
{
std::vector<std::string> sfiles, sdirectories;

bool found_some = m_data->GetContentList(&sfiles, &sdirectories);
UNUSED(found_some);
(void)found_some;

if (directories)
for (auto const &sdir : sdirectories)


+ 1
- 0
src/sys/init.cpp Переглянути файл

@@ -11,6 +11,7 @@
//

#include <lol/engine-internal.h>
#include <lol/msg>

#include <vector> // std::vector
#include <string> // std::string


+ 2
- 1
src/ui/gui.cpp Переглянути файл

@@ -12,6 +12,7 @@
//

#include <lol/engine-internal.h>
#include <../legacy/lol/base/assert.h>

#include <cstdio>
#include <string>
@@ -292,7 +293,7 @@ bool gui::release_draw()

void gui::primitive::Render(Scene& scene, std::shared_ptr<PrimitiveSource> prim)
{
UNUSED(scene, prim);
(void)scene; (void)prim;

ImGui::Render();
ImGui::EndFrame();


+ 2
- 2
src/ui/sdl-input.cpp Переглянути файл

@@ -140,7 +140,7 @@ void SdlInput::tick(float seconds)
{
#if LOL_USE_SDL
/* FIXME: maybe we should make use of this? */
UNUSED(seconds);
(void)seconds;

auto keyboard = input::keyboard();
auto mouse = input::mouse();
@@ -313,7 +313,7 @@ void SdlInput::tick(float seconds)
m_prev_mouse_pos = mouse_pos;

#else
UNUSED(seconds);
(void)seconds;
#endif //LOL_USE_SDL
}



Завантаження…
Відмінити
Зберегти