diff --git a/external/assimp/lib/linux64_gmake/debug/libassimp.so b/external/assimp/lib/linux64_gmake/debug/libassimp.so new file mode 100755 index 0000000000..0bb0941142 Binary files /dev/null and b/external/assimp/lib/linux64_gmake/debug/libassimp.so differ diff --git a/external/assimp/lib/linux64_gmake/release/libassimp.so b/external/assimp/lib/linux64_gmake/release/libassimp.so new file mode 100755 index 0000000000..8937a2f57a Binary files /dev/null and b/external/assimp/lib/linux64_gmake/release/libassimp.so differ diff --git a/projects/genie.lua b/projects/genie.lua index 1f84454cad..41d04d5d4a 100644 --- a/projects/genie.lua +++ b/projects/genie.lua @@ -366,6 +366,10 @@ project "editor" linkLib("assimp") includedirs { "../src", "../external/lua/include", "../external/bgfx/include", "../external/assimp/include", "../external/crnlib/include" } + configuration "not windows" + excludes { "../src/editor/pc/*"} + configuration {} + useLua() defaultConfigurations() diff --git a/src/editor/studio_app.cpp b/src/editor/studio_app.cpp index 5f33b73088..eb976077b0 100644 --- a/src/editor/studio_app.cpp +++ b/src/editor/studio_app.cpp @@ -5,6 +5,7 @@ #include "engine/core/command_line_parser.h" #include "engine/core/crc32.h" #include "engine/core/default_allocator.h" +#include "engine/core/fixed_array.h" #include "engine/core/fs/file_system.h" #include "engine/core/fs/os_file.h" #include "engine/core/input_system.h" @@ -1253,7 +1254,7 @@ class StudioAppImpl : public StudioApp Lumix::uint64 offset; Lumix::uint64 size; - typedef char Path[Lumix::MAX_PATH_LENGTH]; + using Path = Lumix::FixedArray; }; #pragma pack() @@ -1283,16 +1284,16 @@ class StudioAppImpl : public StudioApp auto& out_path = paths.emplace(); if(dir_path[0] == '.') { - Lumix::copyString(out_path, Lumix::lengthOf(out_path), normalized_path); + Lumix::copyString(out_path.data(), out_path.size(), normalized_path); } else { - Lumix::copyString(out_path, Lumix::lengthOf(out_path), dir_path); - Lumix::catString(out_path, Lumix::lengthOf(out_path), normalized_path); + Lumix::copyString(out_path.data(), out_path.size(), dir_path); + Lumix::catString(out_path.data(), out_path.size(), normalized_path); } auto& out_info = infos.emplace(); - out_info.hash = Lumix::crc32(out_path); - out_info.size = PlatformInterface::getFileSize(out_path); + out_info.hash = Lumix::crc32(out_path.data()); + out_info.size = PlatformInterface::getFileSize(out_path.data()); out_info.offset = ~0UL; } } @@ -1339,11 +1340,11 @@ class StudioAppImpl : public StudioApp for (auto& path : paths) { Lumix::FS::OsFile src; - size_t src_size = PlatformInterface::getFileSize(path); - if (!src.open(path, Lumix::FS::Mode::OPEN_AND_READ, m_allocator)) + size_t src_size = PlatformInterface::getFileSize(path.data()); + if (!src.open(path.data(), Lumix::FS::Mode::OPEN_AND_READ, m_allocator)) { file.close(); - Lumix::g_log_error.log("Editor") << "Could not open " << path; + Lumix::g_log_error.log("Editor") << "Could not open " << path.data(); return; } Lumix::uint8 buf[4096]; @@ -1353,7 +1354,7 @@ class StudioAppImpl : public StudioApp if (!src.read(buf, batch_size)) { file.close(); - Lumix::g_log_error.log("Editor") << "Could not read " << path; + Lumix::g_log_error.log("Editor") << "Could not read " << path.data(); return; } file.write(buf, batch_size); diff --git a/src/engine/core/fixed_array.h b/src/engine/core/fixed_array.h new file mode 100644 index 0000000000..af2efcd44b --- /dev/null +++ b/src/engine/core/fixed_array.h @@ -0,0 +1,27 @@ +#pragma once + +namespace Lumix +{ + +template class FixedArray +{ +public: + static_assert(Size > 0, "Size must be positive"); + + const T& operator[](int index) const { return m_data[index]; } + + T& operator[](int index) { return m_data[index]; } + + const T* begin() const { return m_data; } + + const T* end() const { return m_data + Size; } + + T* data() { return m_data; } + + int size() const { return Size; } + +private: + T m_data[Size]; +}; + +} // ~namespace Lumix