This commit is contained in:
Mikulas Florek 2018-02-12 17:02:10 +01:00
parent 77b041cf99
commit 621ad75493
67 changed files with 111 additions and 133 deletions

View file

@ -313,7 +313,6 @@ function linkPhysX()
configuration { "x64", "linux-*" }
libdirs {"../external/physx/lib/linux64_gcc5", "../external/physx/dll/linux64_gcc5"}
links {"PhysX3CHECKED_x64", "PhysX3CommonCHECKED_x64", "PhysX3CharacterKinematicCHECKED_x64", "PhysX3CookingCHECKED_x64" }
configuration { "Debug" }
links { "PhysX3ExtensionsDEBUG", "PhysXVisualDebuggerSDKDEBUG" }
@ -321,7 +320,7 @@ function linkPhysX()
links { "PhysX3ExtensionsCHECKED", "PhysXVisualDebuggerSDKCHECKED" }
configuration { "RelWithDebInfo" }
links { "PhysX3ExtensionsCHECKED", "PhysXVisualDebuggerSDKCHECKED" }
configuration {}
end
end

View file

@ -326,4 +326,4 @@ void EditorIcons::destroy(EditorIcons& icons)
}
} // !namespace Lumix
} // namespace Lumix

View file

@ -1231,4 +1231,4 @@ void Gizmo::destroy(Gizmo& gizmo)
}
} // !namespace Lumix
} // namespace Lumix

View file

@ -52,4 +52,4 @@ public:
};
} // !namespace Lumix
} // namespace Lumix

View file

@ -359,4 +359,4 @@ private:
};
} // ~namespace Lumix
} // namespace Lumix

View file

@ -18,7 +18,7 @@ public:
m_allocation_count = 0;
}
virtual ~BaseProxyAllocator() { ASSERT(m_allocation_count == 0); }
~BaseProxyAllocator() { ASSERT(m_allocation_count == 0); }
void* allocate_aligned(size_t size, size_t align) override

View file

@ -39,6 +39,8 @@ namespace Lumix
public:
explicit BinaryArray(IAllocator& allocator);
BinaryArray(const BinaryArray& rhs) = delete;
void operator =(const BinaryArray& rhs) = delete;
~BinaryArray();
Accessor operator[](int index);
@ -59,8 +61,6 @@ namespace Lumix
private:
void grow(int capacity);
BinaryArray(const BinaryArray& rhs);
void operator =(const BinaryArray& rhs);
private:
IAllocator& m_allocator;

View file

@ -291,4 +291,4 @@ namespace Lumix
}
} // !namespace Lumix
} // namespace Lumix

View file

@ -1,8 +1,8 @@
#pragma once
#include "engine/lumix.h"
#include "engine/array.h"
#include "engine/lumix.h"
namespace Lumix
@ -96,4 +96,4 @@ namespace Lumix
read(&v, sizeof(v));
return v != 0;
}
} // !namespace Lumix
} // namespace Lumix

View file

@ -1,8 +1,8 @@
#pragma once
#include "engine/lumix.h"
#include "engine/iallocator.h"
#include "engine/lumix.h"
#include "engine/mt/sync.h"
@ -55,7 +55,7 @@ public:
public:
explicit Allocator(IAllocator& source);
virtual ~Allocator();
~Allocator();
void* allocate(size_t size) override;
void deallocate(void* ptr) override;

View file

@ -221,7 +221,8 @@ StackNode* StackTree::record()
--ptr;
return insertChildren(node->m_next, ptr, stack);
}
else if (node->m_first_child)
if (node->m_first_child)
{
--ptr;
node = node->m_first_child;

View file

@ -75,4 +75,4 @@ namespace Lumix
#endif
} // ~namespace Lumix
} // namespace Lumix

View file

@ -1,8 +1,8 @@
#pragma once
#include "engine/lumix.h"
#include "engine/iallocator.h"
#include "engine/lumix.h"
namespace Lumix
@ -11,9 +11,6 @@ namespace Lumix
class LUMIX_ENGINE_API DefaultAllocator LUMIX_FINAL : public IAllocator
{
public:
DefaultAllocator() {}
~DefaultAllocator() {}
void* allocate(size_t n) override;
void deallocate(void* p) override;
void* reallocate(void* ptr, size_t size) override;
@ -23,4 +20,4 @@ public:
};
} // ~namespace Lumix
} // namespace Lumix

View file

@ -1716,4 +1716,4 @@ void Engine::destroy(Engine* engine, IAllocator& allocator)
}
} // ~namespace Lumix
} // namespace Lumix

View file

@ -89,4 +89,4 @@ protected:
};
} // ~namespace Lumix
} // namespace Lumix

View file

@ -101,4 +101,4 @@ namespace Lumix
i32 m_pool_index;
i32 m_pool[chunk_size];
};
} // ~namespace Lumix
} // namespace Lumix

View file

@ -129,4 +129,4 @@ namespace Lumix
return LUMIX_NEW(m_allocator, DiskFile)(fallthrough, *this, m_allocator);
}
} // namespace FS
} // ~namespace Lumix
} // namespace Lumix

View file

@ -1,7 +1,7 @@
#pragma once
#include "engine/lumix.h"
#include "engine/fs/ifile_device.h"
#include "engine/lumix.h"
namespace Lumix
{
@ -27,5 +27,5 @@ namespace Lumix
char m_base_path[MAX_PATH_LENGTH];
char m_name[20];
};
} // ~namespace FS
} // ~namespace Lumix
} // namespace FS
} // namespace Lumix

View file

@ -1,6 +1,6 @@
#include "engine/fs/file_events_device.h"
#include "engine/iallocator.h"
#include "engine/fs/file_system.h"
#include "engine/iallocator.h"
#include "engine/path.h"
#ifdef FILE_EVENT_DEVICE
@ -23,7 +23,7 @@ namespace Lumix
}
virtual ~EventsFile()
~EventsFile()
{
m_file.release();
}
@ -141,6 +141,6 @@ namespace Lumix
return LUMIX_NEW(m_allocator, EventsFile)(*child, *this, OnEvent);
}
} // namespace FS
} // ~namespace Lumix
} // namespace Lumix
#endif //FILE_EVENT_DEVICE

View file

@ -3,10 +3,9 @@
#define FILE_EVENT_DEVICE
#ifdef FILE_EVENT_DEVICE
#include "engine/lumix.h"
#include "engine/fs/ifile_device.h"
#include "engine/delegate.h"
#include "engine/fs/ifile_device.h"
#include "engine/lumix.h"
namespace Lumix
{
@ -59,6 +58,6 @@ namespace Lumix
IAllocator& m_allocator;
};
} // namespace FS
} // ~namespace Lumix
} // namespace Lumix
#endif //FILE_EVENT_DEVICE

View file

@ -219,11 +219,8 @@ public:
{
return prev;
}
else
{
prev->release();
return nullptr;
}
prev->release();
return nullptr;
}
return nullptr;
}

View file

@ -130,5 +130,5 @@ public:
};
} // ~namespace FS
} // ~namespace Lumix
} // namespace FS
} // namespace Lumix

View file

@ -1,6 +1,6 @@
#include "engine/fs/file_system.h"
#include "engine/fs/memory_file_device.h"
#include "engine/iallocator.h"
#include "engine/fs/file_system.h"
#include "engine/math_utils.h"
#include "engine/string.h"
@ -177,5 +177,5 @@ namespace Lumix
{
return LUMIX_NEW(m_allocator, MemoryFile)(child, *this, m_allocator);
}
} // ~namespace FS
} // ~namespace Lumix
} // namespace FS
} // namespace Lumix

View file

@ -1,7 +1,7 @@
#pragma once
#include "engine/lumix.h"
#include "engine/fs/ifile_device.h"
#include "engine/lumix.h"
namespace Lumix
{
@ -24,5 +24,5 @@ namespace Lumix
private:
IAllocator& m_allocator;
};
} // ~namespace FS
} // ~namespace Lumix
} // namespace FS
} // namespace Lumix

View file

@ -1,7 +1,7 @@
#pragma once
#include "engine/lumix.h"
#include "engine/fs/file_system.h"
#include "engine/lumix.h"
namespace Lumix
{
@ -40,5 +40,5 @@ namespace Lumix
private:
void* m_handle;
};
} // ~namespace FS
} // ~namespace Lumix
} // namespace FS
} // namespace Lumix

View file

@ -59,7 +59,7 @@ public:
size_t pos() override { return m_local_offset; }
private:
virtual ~PackFile() = default;
~PackFile() = default;
PackFileDevice::PackFileInfo m_file;
PackFileDevice& m_device;

View file

@ -1,7 +1,7 @@
#pragma once
#include "engine/lumix.h"
#include "engine/fs/ifile_device.h"
#include "engine/lumix.h"
struct mf_resource;

View file

@ -1,7 +1,7 @@
#include "engine/fs/os_file.h"
#include "engine/win/simple_win.h"
#include "engine/string.h"
#include "engine/lumix.h"
#include "engine/string.h"
#include "engine/win/simple_win.h"
namespace Lumix

View file

@ -114,9 +114,8 @@ bool Frustum::isSphereInside(const Vec3& center, float radius) const
t = f4Add(t, f4Mul(cz, pz));
t = f4Add(t, pd);
t = f4Sub(t, f4Splat(-radius));
if (f4MoveMask(t)) return false;
return true;
return f4MoveMask(t) == 0;
}

View file

@ -1,8 +1,8 @@
#pragma once
#include "engine/lumix.h"
#include "engine/iallocator.h"
#include "engine/lumix.h"
#include "engine/math_utils.h"
#include "engine/string.h"
@ -662,10 +662,7 @@ namespace Lumix
return m_sentinel;
}
else
{
return next;
}
return next;
}
node_type* _find(const key_type& key) const

View file

@ -22,6 +22,8 @@ class LUMIX_ENGINE_API JsonSerializer
{
public:
JsonSerializer(FS::IFile& file, const Path& path);
void operator=(const JsonSerializer&) = delete;
JsonSerializer(const JsonSerializer&) = delete;
void serialize(const char* label, Entity value);
void serialize(const char* label, u32 value);
@ -50,10 +52,6 @@ class LUMIX_ENGINE_API JsonSerializer
void writeString(const char* str);
void writeBlockComma();
private:
void operator=(const JsonSerializer&) = delete;
JsonSerializer(const JsonSerializer&) = delete;
private:
bool m_is_first_in_block;
FS::IFile& m_file;
@ -65,6 +63,8 @@ class LUMIX_ENGINE_API JsonDeserializer
friend class ErrorProxy;
public:
JsonDeserializer(FS::IFile& file, const Path& path, IAllocator& allocator);
void operator=(const JsonDeserializer&) = delete;
JsonDeserializer(const JsonDeserializer&) = delete;
~JsonDeserializer();
void deserialize(const char* label, Entity& value, Entity default_value);
@ -108,10 +108,6 @@ private:
float tokenToFloat();
void expectToken(char expected_token);
private:
void operator=(const JsonDeserializer&) = delete;
JsonDeserializer(const JsonDeserializer&) = delete;
private:
bool m_is_first_in_block;
FS::IFile& m_file;

View file

@ -87,4 +87,4 @@ LogProxy& LogProxy::operator<<(const Path& path)
}
} // ~namespace Lumix
} // namespace Lumix

View file

@ -63,4 +63,4 @@ namespace Lumix
extern Log LUMIX_ENGINE_API g_log_error;
} // ~namespace Lumix
} // namespace Lumix

View file

@ -264,5 +264,5 @@ float randFloat(float from, float to)
}
} // ~namespace Math
} // ~namespace Lumix
} // namespace Math
} // namespace Lumix

View file

@ -385,4 +385,4 @@ void Matrix::setIdentity()
}
} // !namespace Lumix
} // namespace Lumix

View file

@ -373,4 +373,4 @@ LUMIX_ALIGN_BEGIN(16) struct LUMIX_ENGINE_API Matrix
} LUMIX_ALIGN_END(16);
} // !namespace Lumix
} // namespace Lumix

View file

@ -68,7 +68,6 @@ struct Tuple<Head, Tail...> : Tuple<Tail...>
template <typename... Types>
auto makeTuple(Types... types)
{
using R = Tuple<Types...>;
return Tuple<Types...>(types...);
}

View file

@ -18,5 +18,5 @@ LUMIX_ENGINE_API bool compareAndExchange64(i64 volatile* dest, i64 exchange, i64
LUMIX_ENGINE_API void memoryBarrier();
} // ~namespace MT
} // ~namespace Lumix
} // namespace MT
} // namespace Lumix

View file

@ -202,5 +202,5 @@ namespace Lumix
volatile bool m_aborted;
MT::Semaphore m_data_signal;
};
} // ~namespace MT
} // ~namespace Lumix
} // namespace MT
} // namespace Lumix

View file

@ -95,9 +95,10 @@ public:
}
~SpinLock() { m_mutex.unlock(); }
SpinLock(const SpinLock&) = delete;
void operator=(const SpinLock&) = delete;
private:
SpinLock(const SpinLock&);
void operator=(const SpinLock&);
SpinMutex& m_mutex;
};

View file

@ -19,5 +19,5 @@ namespace Lumix
MT::Event m_event;
T data;
};
} // ~namespace MT
} // ~namespace Lumix
} // namespace MT
} // namespace Lumix

View file

@ -53,5 +53,5 @@ LUMIX_ENGINE_API void memoryBarrier()
}
} // ~namespace MT
} // ~namespace Lumix
} // namespace MT
} // namespace Lumix

View file

@ -124,11 +124,8 @@ namespace Lumix
m_paths.insert(hash, internal);
return internal;
}
else
{
++m_paths.at(index)->m_ref_count;
return m_paths.at(index);
}
++m_paths.at(index)->m_ref_count;
return m_paths.at(index);
}

View file

@ -1,11 +1,11 @@
#include "engine/plugin_manager.h"
#include "engine/array.h"
#include "engine/log.h"
#include "engine/profiler.h"
#include "engine/system.h"
#include "engine/debug/debug.h"
#include "engine/engine.h"
#include "engine/iplugin.h"
#include "engine/log.h"
#include "engine/plugin_manager.h"
#include "engine/profiler.h"
#include "engine/system.h"
namespace Lumix
@ -92,7 +92,7 @@ class PluginManagerImpl LUMIX_FINAL : public PluginManager
return m_plugins[i];
}
}
return 0;
return nullptr;
}
@ -194,4 +194,4 @@ void PluginManager::destroy(PluginManager* manager)
}
} // ~namespace Lumix
} // namespace Lumix

View file

@ -37,4 +37,4 @@ namespace Lumix
};
} // ~namespace Lumix
} // namespace Lumix

View file

@ -1,9 +1,9 @@
#include "profiler.h"
#include "engine/hash_map.h"
#include "engine/log.h"
#include "engine/timer.h"
#include "engine/mt/sync.h"
#include "engine/mt/thread.h"
#include "profiler.h"
namespace Lumix

View file

@ -80,17 +80,14 @@ Vec3 Quat::toEuler() const
return Vec3(
-Math::PI * 0.5f, 0.0f, -atan2f(2.0f * (x * z - w * y), 1.0f - 2.0f * (y * y + z * z)));
}
else if (check > 0.995f)
if (check > 0.995f)
{
return Vec3(
Math::PI * 0.5f, 0.0f, atan2f(2.0f * (x * z - w * y), 1.0f - 2.0f * (y * y + z * z)));
}
else
{
return Vec3(asinf(check),
atan2f(2.0f * (x * z + w * y), 1.0f - 2.0f * (x * x + y * y)),
atan2f(2.0f * (x * y + w * z), 1.0f - 2.0f * (x * x + z * z)));
}
return Vec3(asinf(check),
atan2f(2.0f * (x * z + w * y), 1.0f - 2.0f * (x * x + y * y)),
atan2f(2.0f * (x * y + w * z), 1.0f - 2.0f * (x * x + z * z)));
}
@ -202,4 +199,4 @@ Matrix Quat::toMatrix() const
}
} // !namespace Lumix
} // namespace Lumix

View file

@ -1,11 +1,11 @@
#pragma once
#include "engine/lumix.h"
#include "engine/blob.h"
#include "engine/lumix.h"
#include "engine/metaprogramming.h"
#include "engine/resource.h"
#include "engine/universe/component.h"
#include "engine/metaprogramming.h"
#define LUMIX_PROP_FULL(Scene, Getter, Setter) \

View file

@ -195,4 +195,4 @@ void Resource::onStateChanged(State old_state, State new_state, Resource&)
}
} // ~namespace Lumix
} // namespace Lumix

View file

@ -1,8 +1,8 @@
#pragma once
#include "engine/fs/file_system.h"
#include "engine/delegate_list.h"
#include "engine/fs/file_system.h"
#include "engine/path.h"

View file

@ -821,7 +821,7 @@ bool toCString(u32 value, char* output, int length)
return false;
}
static bool increment(char* output, char* end, bool is_space_after)
static bool increment(const char* output, char* end, bool is_space_after)
{
char carry = 1;
char* c = end;
@ -954,4 +954,4 @@ bool startsWith(const char* str, const char* prefix)
}
} // ~namespace Lumix
} // namespace Lumix

View file

@ -47,4 +47,4 @@ namespace Lumix
const char* m_name;
Timer* m_timer;
};
} // !namespace Lumix
} // namespace Lumix

View file

@ -42,4 +42,4 @@ struct LUMIX_ENGINE_API ComponentUID final
};
} // ~namespace Lumix
} // namespace Lumix

View file

@ -366,7 +366,6 @@ void Universe::destroyEntity(Entity entity)
{
if ((mask & ((u64)1 << i)) != 0)
{
ComponentType type = {i};
auto original_mask = mask;
IScene* scene = m_component_type_map[i].scene;
auto destroy_method = m_component_type_map[i].destroy;

View file

@ -3,11 +3,11 @@
#include "engine/array.h"
#include "engine/delegate_list.h"
#include "engine/iplugin.h"
#include "engine/lumix.h"
#include "engine/matrix.h"
#include "engine/quat.h"
#include "engine/string.h"
#include "engine/iplugin.h"
namespace Lumix
@ -193,4 +193,4 @@ private:
};
} // !namespace Lumix
} // namespace Lumix

View file

@ -471,4 +471,4 @@ inline void lerp(const Vec2& op1, const Vec2& op2, Vec2* out, float t)
}
} // !namespace Lumix
} // namespace Lumix

View file

@ -81,4 +81,4 @@ void Timer::destroy(Timer* timer)
}
} // ~namespace Lumix
} // namespace Lumix

View file

@ -273,4 +273,4 @@ public:
};
} // !namespace Lumix
} // namespace Lumix

View file

@ -44,4 +44,4 @@ namespace Lumix
virtual void insert(const InputSpheres& spheres, const Array<Entity>& model_instances) = 0;
virtual const Sphere& getSphere(Entity model_instance) = 0;
};
} // ~namespace Lux
} // namespace Lux

View file

@ -887,4 +887,4 @@ bool Material::load(FS::IFile& file)
}
} // ~namespace Lumix
} // namespace Lumix

View file

@ -134,4 +134,4 @@ private:
int m_layers_count;
};
} // ~namespace Lumix
} // namespace Lumix

View file

@ -920,4 +920,4 @@ void Model::unload()
}
} // ~namespace Lumix
} // namespace Lumix

View file

@ -3625,4 +3625,4 @@ void Pipeline::registerLuaAPI(lua_State* L)
}
} // ~namespace Lumix
} // namespace Lumix

View file

@ -37,4 +37,4 @@ struct LUMIX_RENDERER_API Pose
};
} // ~namespace Lumix
} // namespace Lumix

View file

@ -109,8 +109,8 @@ struct BoneProperty : Reflection::IEnumProperty
}
int getEnumValueIndex(ComponentUID cmp, int value) const { return value; }
int getEnumValue(ComponentUID cmp, int index) const { return index; }
int getEnumValueIndex(ComponentUID cmp, int value) const override { return value; }
int getEnumValue(ComponentUID cmp, int index) const override { return index; }
int getEnumCount(ComponentUID cmp) const override

View file

@ -63,5 +63,5 @@ class LUMIX_RENDERER_API Renderer : public IPlugin
};
} // !namespace Lumix
} // namespace Lumix

View file

@ -162,4 +162,4 @@ private:
bool load(FS::IFile& file) override;
};
} // ~namespace Lumix
} // namespace Lumix