From 44e39867b1f8daf0c096ad786238b4c3c203cee3 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Sat, 19 Aug 2017 13:44:32 +0200 Subject: [PATCH] Fix approximately 80 billion compilation warnings. --- doc/samples/math/poly.cpp | 23 ++------------- src/audio/audio.cpp | 4 +-- src/debug/lines.cpp | 4 --- src/easymesh/csgbsp.cpp | 8 ++---- src/easymesh/easymeshlua.cpp | 5 ++-- src/eglapp.cpp | 2 ++ src/emitter.cpp | 2 +- src/engine/entity.cpp | 2 +- src/font.cpp | 2 +- src/image/color/cie1931.cpp | 2 ++ src/image/filter/median.cpp | 6 ++-- src/image/movie.cpp | 8 ++++-- src/lol/math/matrix.h | 34 ++++++++++++++-------- src/lol/math/transform.h | 17 +++++++++++ src/lol/math/vector.h | 23 +++++++++++++++ src/lolimgui.cpp | 4 ++- src/lolua/baselua.cpp | 2 +- src/math/geometry.cpp | 6 ++-- src/math/vector.cpp | 56 ------------------------------------ src/mesh/mesh.cpp | 4 ++- src/mesh/primitivemesh.cpp | 3 ++ src/scene.cpp | 8 ++++-- src/scene.h | 2 +- src/sprite.cpp | 2 +- src/sys/file.cpp | 12 ++++++-- src/tileset.cpp | 10 +++---- src/video.cpp | 2 ++ 27 files changed, 125 insertions(+), 128 deletions(-) diff --git a/doc/samples/math/poly.cpp b/doc/samples/math/poly.cpp index 4404f27b..a7eead7d 100644 --- a/doc/samples/math/poly.cpp +++ b/doc/samples/math/poly.cpp @@ -1,7 +1,7 @@ // -// Lol Engine — Sample math program: check trigonometric functions +// Lol Engine — Sample math program: polynomials // -// Copyright © 2005—2011 Sam Hocevar +// Copyright © 2005—2017 Sam Hocevar // // This program is free software. It comes without any warranty, to // the extent permitted by applicable law. You can redistribute it @@ -20,28 +20,11 @@ using namespace lol; -mat4 multiply_copy(mat4 m1, mat4 m2, mat4 m3) -{ - return m1 * m2 * m3; -} - -mat4 multiply_ref(mat4 const &m1, mat4 const &m2, mat4 const &m3) -{ - return m1 * m2 * m3; -} - int main(int argc, char **argv) { UNUSED(argc, argv); - mat4 a = mat4::rotate(0.1f, vec3(1.f, 1.f, 0.f)); - mat4 b = mat4::rotate(0.1f, vec3(0.f, 0.f, 1.f)); - mat4 m = mat4(1.f); - - for (int i = 0; i < 40000000; ++i) - //m = multiply_copy(a, m, b); - m = multiply_ref(a, m, b); - m.printf(); + polynomial> p; return EXIT_SUCCESS; } diff --git a/src/audio/audio.cpp b/src/audio/audio.cpp index 709ea2b9..1e1ce4db 100644 --- a/src/audio/audio.cpp +++ b/src/audio/audio.cpp @@ -64,9 +64,9 @@ void audio::set_channels(int channels) void audio::set_volume(int channel, int volume) { #if defined LOL_USE_SDL_MIXER - Mix_Volume(channel,volume); + Mix_Volume(channel, volume); #else - UNUSED(channel); + UNUSED(channel, volume); #endif } diff --git a/src/debug/lines.cpp b/src/debug/lines.cpp index c7d8defa..fcec5a71 100644 --- a/src/debug/lines.cpp +++ b/src/debug/lines.cpp @@ -220,7 +220,6 @@ void Debug::DrawBox(vec2 a, vec2 b, mat2 transform, DCD data) v[2] = b; v[3] = vec2(b.x, a.y); - int i = 0; Debug::DrawLine((transform * v[0]).xy, (transform * v[1]).xy, data); Debug::DrawLine((transform * v[1]).xy, (transform * v[2]).xy, data); Debug::DrawLine((transform * v[2]).xy, (transform * v[3]).xy, data); @@ -253,7 +252,6 @@ void Debug::DrawCircle(vec2 a, vec2 s, DCD data) //-- void Debug::DrawCircle(vec3 a, vec3 x, vec3 y, DCD data) { - Scene& scene = Scene::GetScene(); float size = F_PI * 2.f * lol::max(length(x), length(y)); int segment_nb = lol::max(1, (int)((size * .25f) / data.m_segment_size)); for (int i = 0; i < segment_nb; i++) @@ -272,7 +270,6 @@ void Debug::DrawCircle(vec3 a, vec3 x, vec3 y, DCD data) //-- void Debug::DrawCircle(vec2 a, vec2 x, vec2 y, DCD data) { - Scene& scene = Scene::GetScene(); float size = F_PI * 2.f * lol::max(length(x), length(y)); int segment_nb = lol::max(1, (int)((size * .25f) / data.m_segment_size)); for (int i = 0; i < segment_nb; i++) @@ -318,7 +315,6 @@ void Debug::DrawCapsule(vec3 a, float s, vec3 h, DCD data) //-- void Debug::DrawCapsule(vec3 a, vec3 x, vec3 y, vec3 z, vec3 h, DCD data) { - Scene& scene = Scene::GetScene(); float size = F_PI * 2.f * lol::max(length(x), length(y)); int segment_nb = lol::max(1, (int)((size * .25f) / data.m_segment_size)); for (int i = -1; i < 2; i += 2) diff --git a/src/easymesh/csgbsp.cpp b/src/easymesh/csgbsp.cpp index 46f57337..58d7b25c 100644 --- a/src/easymesh/csgbsp.cpp +++ b/src/easymesh/csgbsp.cpp @@ -97,7 +97,6 @@ void CsgBsp::AddTriangleToTree(int const &tri_idx, vec3 const &tri_p0, vec3 cons { //there are two intersections, no more. vec3 isec_v[2] = { vec3(.0f), vec3(.0f) }; - int isec_i[2] = { 0, 0 }; int isec_base = 0; int isec_idx = 0; @@ -108,7 +107,7 @@ void CsgBsp::AddTriangleToTree(int const &tri_idx, vec3 const &tri_p0, vec3 cons if (TestRayVsPlane(v[i], v[(i + 1) % 3], m_tree[leaf_idx].m_origin, m_tree[leaf_idx].m_normal, isec_v[isec_idx])) - isec_i[isec_idx++] = i; + ++isec_idx; else isec_base = i; } @@ -274,7 +273,6 @@ int CsgBsp::TestTriangleToTree(vec3 const &tri_p0, vec3 const &tri_p1, vec3 cons int isec_i[2] = { 0, 0 }; int new_v_idx[2] = { 0, 0 }; int isec_base = 0; - int isec_idx = 0; int i = 0; for (; i < m_tree[leaf_idx].m_tri_list.count(); i++) @@ -351,11 +349,11 @@ int CsgBsp::TestTriangleToTree(vec3 const &tri_p0, vec3 const &tri_p1, vec3 cons int v_idx0 = (isec_base == 1)?(1):(0); int v_idx1 = (isec_base == 1)?(0):(1); + int tri_to_remove = tri_to_process.count() - 1; +#if 0 //Leaf_type is the type for the triangle that is alone on its side. int leaf_type = res_side[(isec_base + 2) % 3]; - int tri_to_remove = tri_to_process.count() - 1; -#if 0 if (m_tree[leaf_idx].m_leaves[leaf_type] == LEAF_CURRENT && tri_to_process.last().m1.last() == 1) tri_list.push(leaf_type, t[(isec_base + 2) % 3], new_v_idx[v_idx1], new_v_idx[v_idx0]); diff --git a/src/easymesh/easymeshlua.cpp b/src/easymesh/easymeshlua.cpp index 3c932b47..7df4cc71 100644 --- a/src/easymesh/easymeshlua.cpp +++ b/src/easymesh/easymeshlua.cpp @@ -187,17 +187,18 @@ const LuaObjectLibrary* EasyMeshLuaObject::GetLib() } //----------------------------------------------------------------------------- -bool EasyMesh::Compile(char const *command, bool Execute) +bool EasyMesh::Compile(char const *command, bool execute) { bool res = false; // FIXME: make this work again + UNUSED(command, execute); #if 0 EasyMeshCompiler mc(*this); BD()->Enable(MeshBuildOperation::CommandRecording); if ((res = mc.ParseString(command))) { BD()->Disable(MeshBuildOperation::CommandRecording); - if (Execute) + if (execute) ExecuteCmdStack(); } #endif diff --git a/src/eglapp.cpp b/src/eglapp.cpp index 569c074f..3fc212ba 100644 --- a/src/eglapp.cpp +++ b/src/eglapp.cpp @@ -259,6 +259,8 @@ EglApp::EglApp(char const *title, ivec2 res, float fps) : Ticker::Setup(fps); Video::Setup((ivec2)data->screen_size); audio::init(); +#else + UNUSED(title, res, fps); #endif } diff --git a/src/emitter.cpp b/src/emitter.cpp index 4976efef..644e965c 100644 --- a/src/emitter.cpp +++ b/src/emitter.cpp @@ -70,7 +70,7 @@ void Emitter::TickDraw(float seconds, Scene &scene) for (int i = 0; i < data->nparticles; i++) scene.AddTile(data->tileset, data->particles[i], - data->positions[i], 0, vec2(1.0f), 0.0f); + data->positions[i], vec2(1.0f), 0.0f); } void Emitter::AddParticle(int id, vec3 pos, vec3 vel) diff --git a/src/engine/entity.cpp b/src/engine/entity.cpp index cd7b6fc2..caa07239 100644 --- a/src/engine/entity.cpp +++ b/src/engine/entity.cpp @@ -69,7 +69,7 @@ void Entity::TickGame(float seconds) void Entity::TickDraw(float seconds, Scene &scene) { - (void)seconds; + UNUSED(seconds, scene); #if !LOL_BUILD_RELEASE if (m_tickstate != STATE_PRETICK_DRAW) msg::error("invalid entity draw tick\n"); diff --git a/src/font.cpp b/src/font.cpp index 86361272..353d822a 100644 --- a/src/font.cpp +++ b/src/font.cpp @@ -89,7 +89,7 @@ void Font::Print(Scene &scene, vec3 pos, char const *str, vec2 scale, float spac break; default: if (ch != ' ') - scene.AddTile(data->tileset, ch & 255, pos, 0, scale, 0.0f); + scene.AddTile(data->tileset, ch & 255, pos, scale, 0.0f); pos.x += data->size.x * scale.x; break; } diff --git a/src/image/color/cie1931.cpp b/src/image/color/cie1931.cpp index 423203c2..3045d751 100644 --- a/src/image/color/cie1931.cpp +++ b/src/image/color/cie1931.cpp @@ -320,6 +320,7 @@ static float cie_1931_xyz[] = /* CIE 1964 Colorimetric Observer, aka. 10º Observer * for wavelengths 360 to 830. */ +#if 0 static float cie_1964_xyz[] = { /* 360 — 399 nm */ @@ -571,6 +572,7 @@ static float cie_1964_xyz[] = 1.747e-06f, 7.074e-07f, 0.0000000f, 1.647e-06f, 6.675e-07f, 0.0000000f, 1.553e-06f, 6.297e-07f, 0.0000000f, }; +#endif vec3 Color::WavelengthToCIExyY(float nm) { diff --git a/src/image/filter/median.cpp b/src/image/filter/median.cpp index 5f27109f..cf7a2a1a 100644 --- a/src/image/filter/median.cpp +++ b/src/image/filter/median.cpp @@ -152,7 +152,7 @@ image image::Median(ivec2 ksize) const return ret; } -image image::Median(array2d const &kernel) const +image image::Median(array2d const &ker) const { ivec2 const isize = size(); image tmp = *this; @@ -166,7 +166,7 @@ image image::Median(array2d const &kernel) const else #endif { - ivec2 const ksize = kernel.size(); + ivec2 const ksize = ker.size(); array2d list(ksize); vec4 *srcp = tmp.lock(); @@ -207,7 +207,7 @@ image image::Median(array2d const &kernel) const for (int j = 0; j < ksize.y; ++j) for (int i = 0; i < ksize.x; ++i) { - float d = kernel[i][j] / + float d = ker[i][j] / (1e-10f + distance(median, list[i][j])); s1 += list[i][j] * d; s2 += d; diff --git a/src/image/movie.cpp b/src/image/movie.cpp index 5c536d3c..29b00eb6 100644 --- a/src/image/movie.cpp +++ b/src/image/movie.cpp @@ -99,9 +99,11 @@ bool movie::open_file(char const *filename) msg::error("could not write header: %s\n", ERROR_TO_STRING(ret)); return false; } -#endif - return true; +#else + UNUSED(filename); + return false; +#endif } bool movie::push_image(image &im) @@ -144,6 +146,8 @@ bool movie::push_image(image &im) return false; } } +#else + UNUSED(im); #endif return true; diff --git a/src/lol/math/matrix.h b/src/lol/math/matrix.h index b502aba7..30cd790f 100644 --- a/src/lol/math/matrix.h +++ b/src/lol/math/matrix.h @@ -63,6 +63,10 @@ struct LOL_ATTR_NODISCARD mat_t inline vec_t& operator[](size_t n) { return m_data[n]; } inline vec_t const& operator[](size_t n) const { return m_data[n]; } + template + friend std::ostream &operator<<(std::ostream &stream, + mat_t const &m); + private: vec_t m_data[COLS]; }; @@ -131,10 +135,6 @@ struct LOL_ATTR_NODISCARD mat_t void printf() const; String tostring() const; - template - friend std::ostream &operator<<(std::ostream &stream, - mat_t const &m); - static const mat_t identity; private: @@ -262,10 +262,6 @@ struct LOL_ATTR_NODISCARD mat_t void printf() const; String tostring() const; - template - friend std::ostream &operator<<(std::ostream &stream, - mat_t const &m); - static const mat_t identity; private: @@ -442,10 +438,6 @@ struct LOL_ATTR_NODISCARD mat_t void printf() const; String tostring() const; - template - friend std::ostream &operator<<(std::ostream &stream, - mat_t const &m); - static const mat_t identity; private: @@ -463,6 +455,24 @@ static_assert(sizeof(f16mat4) == 32, "sizeof(f16mat4) == 32"); static_assert(sizeof(mat4) == 64, "sizeof(mat4) == 64"); static_assert(sizeof(dmat4) == 128, "sizeof(dmat4) == 128"); +/* + * stdstream method implementations + */ + +template +std::ostream &operator<<(std::ostream &stream, + mat_t const &m) +{ + for (int y = 0; y < ROWS; ++y) + { + stream << (y == 0 ? "(" : ", "); + for (int x = 0; x < COLS; ++x) + stream << (x == 0 ? "(" : ", ") << m[x][y]; + stream << ")"; + } + return stream << ")"; +} + /* * Transpose any matrix */ diff --git a/src/lol/math/transform.h b/src/lol/math/transform.h index 6f153f77..d7b69afa 100644 --- a/src/lol/math/transform.h +++ b/src/lol/math/transform.h @@ -321,6 +321,23 @@ struct LOL_ATTR_NODISCARD sqt_t T s; }; +/* + * stdstream method implementations + */ + +template +std::ostream &operator<<(std::ostream &stream, cmplx_t const &c) +{ + return stream << "(" << c.x << ", " << c.y << ")"; +} + +template +std::ostream &operator<<(std::ostream &stream, quat_t const &q) +{ + return stream << "(" << q.w << ", " << q.x << ", " + << q.y << ", " << q.z << ")"; +} + /* * Common operations on transforms */ diff --git a/src/lol/math/vector.h b/src/lol/math/vector.h index 7e75221a..82393766 100644 --- a/src/lol/math/vector.h +++ b/src/lol/math/vector.h @@ -1017,6 +1017,29 @@ static_assert(sizeof(f16vec4) == 8, "sizeof(f16vec4) == 8"); static_assert(sizeof(vec4) == 16, "sizeof(vec4) == 16"); static_assert(sizeof(dvec4) == 32, "sizeof(dvec4) == 32"); +/* + * stdstream method implementations + */ + +template +std::ostream &operator<<(std::ostream &stream, vec_t const &v) +{ + return stream << "(" << v.x << ", " << v.y << ")"; +} + +template +std::ostream &operator<<(std::ostream &stream, vec_t const &v) +{ + return stream << "(" << v.x << ", " << v.y << ", " << v.z << ")"; +} + +template +std::ostream &operator<<(std::ostream &stream, vec_t const &v) +{ + return stream << "(" << v.x << ", " << v.y << ", " + << v.z << ", " << v.w << ")"; +} + /* * vec_t *(scalar, vec_t) */ diff --git a/src/lolimgui.cpp b/src/lolimgui.cpp index ca9d9006..718b86a2 100644 --- a/src/lolimgui.cpp +++ b/src/lolimgui.cpp @@ -346,6 +346,8 @@ void LolImGui::TickDraw(float seconds, Scene &scene) } void PrimitiveLolImGui::Render(Scene& scene, PrimitiveSource* primitive) { + UNUSED(scene, primitive); + ImGuiIO& io = ImGui::GetIO(); if (io.Fonts->TexID) ImGui::Render(); @@ -416,7 +418,7 @@ void LolImGui::RenderDrawListsMethod(ImDrawData* draw_data) for (int n = 0; n < draw_data->CmdListsCount; n++) { const ImDrawList* cmd_list = draw_data->CmdLists[n]; - const unsigned char* vtx_buffer = (const unsigned char*)&cmd_list->VtxBuffer.front(); + /*const unsigned char* vtx_buffer = (const unsigned char*)&cmd_list->VtxBuffer.front();*/ //Register uniforms m_shader->SetUniform(m_ortho, ortho); diff --git a/src/lolua/baselua.cpp b/src/lolua/baselua.cpp index faffef0f..082d85c2 100644 --- a/src/lolua/baselua.cpp +++ b/src/lolua/baselua.cpp @@ -151,7 +151,7 @@ void Loader::StoreObject(lua_State* l, Object* obj) //----------------------------------------------------------------------------- bool Loader::ExecLuaFile(String const &lua) { - const char* c = lua_pushstring(m_lua_state, lua.C()); + lua_pushstring(m_lua_state, lua.C()); int status = LuaBaseData::LuaDoFile(m_lua_state); return status == 0; } diff --git a/src/math/geometry.cpp b/src/math/geometry.cpp index 69dde6f9..2568328a 100644 --- a/src/math/geometry.cpp +++ b/src/math/geometry.cpp @@ -123,7 +123,7 @@ namespace lol //We first need to find two points intersecting, no matter on which triangle. for (int i = 0; i < 2 && isecIdx < 2; i++) { - int found_isec = -1; + /*int found_isec = -1;*/ for (int j = 0; j < 3 && isecIdx < 2; j++) { int pIdx = j + i * 3; @@ -150,7 +150,7 @@ namespace lol //if it's the second intersection, we need it to be different from the first one. (isecIdx == 1 && length(isec[0] - isec[1]) > TestEpsilon::Get())) { - found_isec = i; + /*found_isec = i;*/ isecIdx++; } } @@ -172,11 +172,9 @@ namespace lol vec3 &isec_p) { vec3 rayD0 = ray_p01 - ray_p00; - float rayS0 = length(rayD0); vec3 rayD0N = normalize(rayD0); vec3 rayD1 = ray_p11 - ray_p10; - float rayS1 = length(rayD1); vec3 rayD1N = normalize(rayD1); vec3 rayP0P1 = ray_p10 - ray_p00; diff --git a/src/math/vector.cpp b/src/math/vector.cpp index 580355b4..9bc06991 100644 --- a/src/math/vector.cpp +++ b/src/math/vector.cpp @@ -92,61 +92,5 @@ template<> String mat4::tostring() const p[0][3], p[1][3], p[2][3], p[3][3]); } -template<> std::ostream &operator<<(std::ostream &stream, ivec2 const &v) -{ - return stream << "(" << v.x << ", " << v.y << ")"; -} - -template<> std::ostream &operator<<(std::ostream &stream, ivec3 const &v) -{ - return stream << "(" << v.x << ", " << v.y << ", " << v.z << ")"; -} - -template<> std::ostream &operator<<(std::ostream &stream, ivec4 const &v) -{ - return stream << "(" << v.x << ", " << v.y << ", " - << v.z << ", " << v.w << ")"; -} - -template<> std::ostream &operator<<(std::ostream &stream, vec2 const &v) -{ - return stream << "(" << v.x << ", " << v.y << ")"; -} - -template<> std::ostream &operator<<(std::ostream &stream, cmplx const &v) -{ - return stream << "(" << v.x << ", " << v.y << ")"; -} - -template<> std::ostream &operator<<(std::ostream &stream, vec3 const &v) -{ - return stream << "(" << v.x << ", " << v.y << ", " << v.z << ")"; -} - -template<> std::ostream &operator<<(std::ostream &stream, vec4 const &v) -{ - return stream << "(" << v.x << ", " << v.y << ", " - << v.z << ", " << v.w << ")"; -} - -template<> std::ostream &operator<<(std::ostream &stream, quat const &v) -{ - return stream << "(" << v.x << ", " << v.y << ", " - << v.z << ", " << v.w << ")"; -} - -template<> std::ostream &operator<<(std::ostream &stream, mat4 const &m) -{ - stream << "((" << m[0][0] << ", " << m[1][0] - << ", " << m[2][0] << ", " << m[3][0] << "), "; - stream << "(" << m[0][1] << ", " << m[1][1] - << ", " << m[2][1] << ", " << m[3][1] << "), "; - stream << "(" << m[0][2] << ", " << m[1][2] - << ", " << m[2][2] << ", " << m[3][2] << "), "; - stream << "(" << m[0][3] << ", " << m[1][3] - << ", " << m[2][3] << ", " << m[3][3] << "))"; - return stream; -} - } /* namespace lol */ diff --git a/src/mesh/mesh.cpp b/src/mesh/mesh.cpp index f861e3f7..95c994f3 100644 --- a/src/mesh/mesh.cpp +++ b/src/mesh/mesh.cpp @@ -132,11 +132,13 @@ void SubMesh::Render() attribs[j] = m_shader->GetAttribLocation(usage, usages[usage_index]++); } - vertex_count = m_vbos[i]->GetSize() / m_vdecl->GetStream(i).GetSize(); + vertex_count += m_vbos[i]->GetSize() / m_vdecl->GetStream(i).GetSize(); m_vdecl->SetStream(m_vbos[i], attribs); } + UNUSED(vertex_count); + for (int i = 0; i < m_textures.count(); ++i) { // TODO: might be good to cache this diff --git a/src/mesh/primitivemesh.cpp b/src/mesh/primitivemesh.cpp index aeee7435..737afa15 100644 --- a/src/mesh/primitivemesh.cpp +++ b/src/mesh/primitivemesh.cpp @@ -39,6 +39,9 @@ void PrimitiveMesh::Render(Scene& scene, PrimitiveSource* primitive) ShaderUniform u_model, u_modelview, u_normalmat, uni_tex, uni_texsize; ShaderAttrib a_pos, a_tex; + /* FIXME: ignored for now */ + UNUSED(primitive); + { /* If this primitive uses a new shader, update attributes */ if (m_submesh->GetShader() != shader) diff --git a/src/scene.cpp b/src/scene.cpp index c33adef5..e48be37f 100644 --- a/src/scene.cpp +++ b/src/scene.cpp @@ -58,6 +58,8 @@ static inline void gpu_marker(char const *message) #if LOL_USE_GLEW if (GLEW_GREMEDY_string_marker) glStringMarkerGREMEDY(0, message); +#else + UNUSED(message); #endif } @@ -498,7 +500,7 @@ void Scene::ReleaseAllPrimitiveRenderers(uintptr_t key) } //----------------------------------------------------------------------------- -void Scene::AddTile(TileSet *tileset, int id, vec3 pos, int o, vec2 scale, float radians) +void Scene::AddTile(TileSet *tileset, int id, vec3 pos, vec2 scale, float radians) { ASSERT(id < tileset->GetTileCount()); @@ -582,7 +584,7 @@ void Scene::DisableDisplay() static bool do_pp = true; -void Scene::pre_render(float seconds) +void Scene::pre_render(float) { gpu_marker("Pre Render"); @@ -615,7 +617,7 @@ void Scene::render(float seconds) render_lines(seconds); } -void Scene::post_render(float seconds) +void Scene::post_render(float) { gpu_marker("Post Render"); diff --git a/src/scene.h b/src/scene.h index dd0ec6e4..58867e5e 100644 --- a/src/scene.h +++ b/src/scene.h @@ -230,7 +230,7 @@ public: /* FIXME: this should be deprecated -- it doesn't really match * the architecture we want to build */ - void AddTile(TileSet *tileset, int id, vec3 pos, int o, vec2 scale, float radians); + void AddTile(TileSet *tileset, int id, vec3 pos, vec2 scale, float radians); void AddTile(TileSet *tileset, int id, mat4 model); public: diff --git a/src/sprite.cpp b/src/sprite.cpp index 2a6e7f99..550356b2 100644 --- a/src/sprite.cpp +++ b/src/sprite.cpp @@ -46,7 +46,7 @@ void Sprite::TickDraw(float seconds, Scene &scene) { Entity::TickDraw(seconds, scene); - scene.AddTile(data->tileset, data->id, m_position, 0, vec2(1.0f), 0.0f); + scene.AddTile(data->tileset, data->id, m_position, vec2(1.0f), 0.0f); } Sprite::~Sprite() diff --git a/src/sys/file.cpp b/src/sys/file.cpp index 182dd9a4..29a756e2 100644 --- a/src/sys/file.cpp +++ b/src/sys/file.cpp @@ -25,6 +25,10 @@ # include #endif +#if defined HAVE_UNISTD_H +# include +#endif + #include #include @@ -60,6 +64,7 @@ class FileData case StreamType::StdOut: m_fd = stdout; break; case StreamType::StdErr: m_fd = stderr; break; #endif + default: break; } } @@ -352,6 +357,8 @@ class DirectoryData void Open(String const &directory, FileAccess mode) { + UNUSED(mode); /* FIXME */ + m_type = StreamType::File; #if __ANDROID__ /* FIXME: not implemented */ @@ -540,6 +547,7 @@ bool Directory::GetContent(array* files, array* directories) { array sfiles, sdirectories; bool found_some = m_data->GetContentList(&sfiles, &sdirectories); + UNUSED(found_some); if (directories) for (int i = 0; i < sdirectories.count(); i++) @@ -608,8 +616,8 @@ bool Directory::SetCurrent(String directory) String result = directory; result.replace('/', '\\', true); return !!SetCurrentDirectory(result.C()); -#elif HAVE_STDIO_H - /* FIXME: not implemented */ +#elif HAVE_UNISTD_H + chdir(directory.C()); #endif return false; } diff --git a/src/tileset.cpp b/src/tileset.cpp index 0f5aa981..eac4f1e9 100644 --- a/src/tileset.cpp +++ b/src/tileset.cpp @@ -46,21 +46,21 @@ protected: */ TileSet::TileSet(char const *path) - : m_tileset_data(new TileSetData()), - m_palette(nullptr), - TextureImage(path) + : TextureImage(path), + m_tileset_data(new TileSetData()), + m_palette(nullptr) { } TileSet::TileSet(char const *path, Image* image) - : TextureImage(path, image), + : TextureImage(path, image), m_tileset_data(new TileSetData()), m_palette(nullptr) { } TileSet::TileSet(char const *path, Image* image, array& tiles) - : TextureImage(path, image), + : TextureImage(path, image), m_tileset_data(new TileSetData()), m_palette(nullptr) { diff --git a/src/video.cpp b/src/video.cpp index 89f41077..2398c4e9 100644 --- a/src/video.cpp +++ b/src/video.cpp @@ -121,6 +121,8 @@ void Video::Capture(uint32_t *buffer) buffer[j * width + i] = buffer[(height - j - 1) * width + i]; buffer[(height - j - 1) * width + i] = tmp; } +#else + UNUSED(buffer); #endif }