From 1497dccd63a84b7ee2b229b1ad9c5c02718f2a78 Mon Sep 17 00:00:00 2001 From: chai Date: Tue, 19 Mar 2019 23:06:27 +0800 Subject: *rename --- .../libs/asura-lib-utils/exceptions/exception.cpp | 47 +++++ source/libs/asura-lib-utils/exceptions/exception.h | 43 ++++ .../filesystem/binding/data_buffer.binding.cpp | 68 ++++++ .../asura-lib-utils/filesystem/data_buffer.cpp | 29 +++ .../libs/asura-lib-utils/filesystem/data_buffer.h | 45 ++++ .../asura-lib-utils/filesystem/decoded_data.cpp | 20 ++ .../libs/asura-lib-utils/filesystem/decoded_data.h | 42 ++++ .../libs/asura-lib-utils/filesystem/reloadable.h | 27 +++ .../filesystem/resource_manager.cpp | 0 .../asura-lib-utils/filesystem/resource_manager.h | 44 ++++ source/libs/asura-lib-utils/math/curve.cpp | 0 source/libs/asura-lib-utils/math/curve.h | 0 source/libs/asura-lib-utils/math/functions.cpp | 0 source/libs/asura-lib-utils/math/functions.h | 0 source/libs/asura-lib-utils/math/matrix44.cpp | 0 source/libs/asura-lib-utils/math/matrix44.h | 24 +++ source/libs/asura-lib-utils/math/ranged_value.cpp | 0 source/libs/asura-lib-utils/math/ranged_value.h | 0 source/libs/asura-lib-utils/math/rect.hpp | 32 +++ source/libs/asura-lib-utils/math/rect.inl | 19 ++ source/libs/asura-lib-utils/math/transform.cpp | 0 source/libs/asura-lib-utils/math/transform.h | 30 +++ source/libs/asura-lib-utils/math/vector2.hpp | 70 ++++++ source/libs/asura-lib-utils/math/vector2.inl | 114 ++++++++++ source/libs/asura-lib-utils/math/vector3.hpp | 233 ++++++++++++++++++++ source/libs/asura-lib-utils/math/vector3.inl | 145 +++++++++++++ source/libs/asura-lib-utils/math/vector4.h | 234 +++++++++++++++++++++ source/libs/asura-lib-utils/math/vector4.inl | 152 +++++++++++++ source/libs/asura-lib-utils/module.h | 32 +++ source/libs/asura-lib-utils/scripting/luax.hpp | 13 ++ source/libs/asura-lib-utils/scripting/portable.hpp | 22 ++ source/libs/asura-lib-utils/scripting/portable.inl | 0 source/libs/asura-lib-utils/type.h | 70 ++++++ source/libs/asura-lib-utils/utils.h | 0 source/libs/asura-lib-utils/utils_module.cpp | 20 ++ source/libs/asura-lib-utils/utils_module.h | 24 +++ 36 files changed, 1599 insertions(+) create mode 100644 source/libs/asura-lib-utils/exceptions/exception.cpp create mode 100644 source/libs/asura-lib-utils/exceptions/exception.h create mode 100644 source/libs/asura-lib-utils/filesystem/binding/data_buffer.binding.cpp create mode 100644 source/libs/asura-lib-utils/filesystem/data_buffer.cpp create mode 100644 source/libs/asura-lib-utils/filesystem/data_buffer.h create mode 100644 source/libs/asura-lib-utils/filesystem/decoded_data.cpp create mode 100644 source/libs/asura-lib-utils/filesystem/decoded_data.h create mode 100644 source/libs/asura-lib-utils/filesystem/reloadable.h create mode 100644 source/libs/asura-lib-utils/filesystem/resource_manager.cpp create mode 100644 source/libs/asura-lib-utils/filesystem/resource_manager.h create mode 100644 source/libs/asura-lib-utils/math/curve.cpp create mode 100644 source/libs/asura-lib-utils/math/curve.h create mode 100644 source/libs/asura-lib-utils/math/functions.cpp create mode 100644 source/libs/asura-lib-utils/math/functions.h create mode 100644 source/libs/asura-lib-utils/math/matrix44.cpp create mode 100644 source/libs/asura-lib-utils/math/matrix44.h create mode 100644 source/libs/asura-lib-utils/math/ranged_value.cpp create mode 100644 source/libs/asura-lib-utils/math/ranged_value.h create mode 100644 source/libs/asura-lib-utils/math/rect.hpp create mode 100644 source/libs/asura-lib-utils/math/rect.inl create mode 100644 source/libs/asura-lib-utils/math/transform.cpp create mode 100644 source/libs/asura-lib-utils/math/transform.h create mode 100644 source/libs/asura-lib-utils/math/vector2.hpp create mode 100644 source/libs/asura-lib-utils/math/vector2.inl create mode 100644 source/libs/asura-lib-utils/math/vector3.hpp create mode 100644 source/libs/asura-lib-utils/math/vector3.inl create mode 100644 source/libs/asura-lib-utils/math/vector4.h create mode 100644 source/libs/asura-lib-utils/math/vector4.inl create mode 100644 source/libs/asura-lib-utils/module.h create mode 100644 source/libs/asura-lib-utils/scripting/luax.hpp create mode 100644 source/libs/asura-lib-utils/scripting/portable.hpp create mode 100644 source/libs/asura-lib-utils/scripting/portable.inl create mode 100644 source/libs/asura-lib-utils/type.h create mode 100644 source/libs/asura-lib-utils/utils.h create mode 100644 source/libs/asura-lib-utils/utils_module.cpp create mode 100644 source/libs/asura-lib-utils/utils_module.h (limited to 'source/libs/asura-lib-utils') diff --git a/source/libs/asura-lib-utils/exceptions/exception.cpp b/source/libs/asura-lib-utils/exceptions/exception.cpp new file mode 100644 index 0000000..dbb36ca --- /dev/null +++ b/source/libs/asura-lib-utils/exceptions/exception.cpp @@ -0,0 +1,47 @@ +#include "Exception.h" + +#include +#include + +namespace AsuraEngine +{ + + Exception::Exception(const char *fmt, ...) + { + va_list args; + int size_buffer = 256, size_out; + char *buffer; + while (true) + { + buffer = new char[size_buffer]; + memset(buffer, 0, size_buffer); + + va_start(args, fmt); + size_out = vsnprintf(buffer, size_buffer, fmt, args); + va_end(args); + + // see http://perfec.to/vsnprintf/pasprintf.c + // if size_out ... + // == -1 --> output was truncated + // == size_buffer --> output was truncated + // == size_buffer-1 --> ambiguous, /may/ have been truncated + // > size_buffer --> output was truncated, and size_out + // bytes would have been written + if (size_out == size_buffer || size_out == -1 || size_out == size_buffer - 1) + size_buffer *= 2; + else if (size_out > size_buffer) + size_buffer = size_out + 2; // to avoid the ambiguous case + else + break; + + delete[] buffer; + } + message = std::string(buffer); + delete[] buffer; + } + + Exception::~Exception() throw() + { + } + +} diff --git a/source/libs/asura-lib-utils/exceptions/exception.h b/source/libs/asura-lib-utils/exceptions/exception.h new file mode 100644 index 0000000..bed8a9a --- /dev/null +++ b/source/libs/asura-lib-utils/exceptions/exception.h @@ -0,0 +1,43 @@ +#ifndef __ASURA_ENGINE_EXCEPTION_H__ +#define __ASURA_ENGINE_EXCEPTION_H__ + +#include + +namespace AsuraEngine +{ + + /** + * A convenient vararg-enabled exception class. + **/ + class Exception : public std::exception + { + public: + + /** + * Creates a new Exception according to printf-rules. + * + * See: http://www.cplusplus.com/reference/clibrary/cstdio/printf/ + * + * @param fmt The format string (see printf). + **/ + Exception(const char *fmt, ...); + virtual ~Exception() throw(); + + /** + * Returns a string containing reason for the exception. + * @return A description of the exception. + **/ + inline virtual const char *what() const throw() + { + return message.c_str(); + } + + private: + + std::string message; + + }; // Exception + +} + +#endif \ No newline at end of file diff --git a/source/libs/asura-lib-utils/filesystem/binding/data_buffer.binding.cpp b/source/libs/asura-lib-utils/filesystem/binding/data_buffer.binding.cpp new file mode 100644 index 0000000..a9113a7 --- /dev/null +++ b/source/libs/asura-lib-utils/filesystem/binding/data_buffer.binding.cpp @@ -0,0 +1,68 @@ +#include "../data_buffer.h" + +using namespace Luax; + +namespace AsuraEngine +{ + namespace Filesystem + { + + LUAX_REGISTRY(DataBuffer) + { + luaL_Reg f[] = { + { "New", _New }, + { "SetContent", _SetContent }, + { "GetContent", _GetContent }, + { "GetContentLength", _GetContentLength }, + {0, 0} + }; + + state.RegisterMethods(f); + } + + LUAX_POSTPROCESS(DataBuffer) + { + + } + + LUAX_IMPL_METHOD(DataBuffer, _New) + { + + } + + // SetContent(dataBuffer, lString) + LUAX_IMPL_METHOD(DataBuffer, _SetContent) + { + LUAX_SETUP(L, "US"); + // params: + // 1: data buffer + // 2: lstring + + DataBuffer* self = state.GetLuaUserdata(1); + size_t size = 0; + const char* str = lua_tolstring(L, 2, &size); + void* data = new char[size]; + memcpy(data, str, size); + self->SetContent(data, size); + return 0; + } + + LUAX_IMPL_METHOD(DataBuffer, _GetContent) + { + LUAX_SETUP(L, "U"); + + DataBuffer* self = state.GetLuaUserdata(1); + lua_pushlstring(L, (const char*)self->data, self->size); + return 1; + } + + LUAX_IMPL_METHOD(DataBuffer, _GetContentLength) + { + LUAX_SETUP(L, "U"); + DataBuffer* self = state.GetLuaUserdata(1); + lua_pushinteger(L, self->size); + return 1; + } + + } +} \ No newline at end of file diff --git a/source/libs/asura-lib-utils/filesystem/data_buffer.cpp b/source/libs/asura-lib-utils/filesystem/data_buffer.cpp new file mode 100644 index 0000000..629dc92 --- /dev/null +++ b/source/libs/asura-lib-utils/filesystem/data_buffer.cpp @@ -0,0 +1,29 @@ +#include "data_buffer.h" + +namespace AsuraEngine +{ + namespace Filesystem + { + + DataBuffer::DataBuffer(const void* data, std::size_t size) + { + this->data = (const byte*)data; + this->size = size; + } + + DataBuffer::~DataBuffer() + { + delete[] data; + } + + void DataBuffer::SetContent(const void* data, std::size_t siez) + { + if (this->data != nullptr) + delete[] this->data; + + this->data = (const byte*)data; + this->size = size; + } + + } +} \ No newline at end of file diff --git a/source/libs/asura-lib-utils/filesystem/data_buffer.h b/source/libs/asura-lib-utils/filesystem/data_buffer.h new file mode 100644 index 0000000..4b013ed --- /dev/null +++ b/source/libs/asura-lib-utils/filesystem/data_buffer.h @@ -0,0 +1,45 @@ +#ifndef __ASURA_ENGINE_DATABUFFER_H__ +#define __ASURA_ENGINE_DATABUFFER_H__ + +#include + +#include "../scripting/Luax.hpp" +#include "../scripting/portable.hpp" + +namespace AsuraEngine +{ + namespace Filesystem + { + + /// + /// 对内存数据的封装,所有的数据使用Data buffer包装,不直接使用const void*。通过resource manager读取。 + /// + class DataBuffer ASURA_FINAL + : public Scripting::Portable + { + public: + + DataBuffer(const void* data, std::size_t size); + + ~DataBuffer(); + + void SetContent(const void* data, std::size_t siez); + + const byte* data; + size_t size; + + //---------------------------------------------------------------------------------------------------------- + + LUAX_DECL_FACTORY(DataBuffer); + + LUAX_DECL_METHOD(_New); + LUAX_DECL_METHOD(_SetContent); + LUAX_DECL_METHOD(_GetContent); + LUAX_DECL_METHOD(_GetContentLength); + + }; + + } +} + +#endif \ No newline at end of file diff --git a/source/libs/asura-lib-utils/filesystem/decoded_data.cpp b/source/libs/asura-lib-utils/filesystem/decoded_data.cpp new file mode 100644 index 0000000..125c652 --- /dev/null +++ b/source/libs/asura-lib-utils/filesystem/decoded_data.cpp @@ -0,0 +1,20 @@ +#include "DecodedData.h" +#include "Exceptions/Exception.h" + +namespace AsuraEngine +{ + namespace Filesystem + { + + DecodedData::DecodedData(const DataBuffer* databuffer) + { + Decode(databuffer); + } + + DecodedData::~DecodedData() + { + + } + + } +} diff --git a/source/libs/asura-lib-utils/filesystem/decoded_data.h b/source/libs/asura-lib-utils/filesystem/decoded_data.h new file mode 100644 index 0000000..49b5815 --- /dev/null +++ b/source/libs/asura-lib-utils/filesystem/decoded_data.h @@ -0,0 +1,42 @@ +#ifndef __ASURA_ENGINE_DATA_H__ +#define __ASURA_ENGINE_DATA_H__ + +#include + +#include "../scripting/portable.hpp" + +#include "data_buffer.h" + +namespace AsuraEngine +{ + namespace Filesystem + { + + /// + /// 可以在另一个线程构建的data继承此类。如图片数据、音频数据等,可以在另一个线程中解析原文件,生成内部数据格式,如像素 + /// 等。 + /// + ASURA_ABSTRACT class DecodedData + { + public: + + /// + /// 从内存中构建data,可以放在另一个线程里面,从资源管理系统里面加载。 + /// + DecodedData(const DataBuffer& databuffer); + + virtual ~DecodedData(); + + protected: + + /// + /// 解码内存中的数据。 + /// + virtual void Decode(const DataBuffer& buffer) = 0; + + }; + + } +} + +#endif \ No newline at end of file diff --git a/source/libs/asura-lib-utils/filesystem/reloadable.h b/source/libs/asura-lib-utils/filesystem/reloadable.h new file mode 100644 index 0000000..7c4ea52 --- /dev/null +++ b/source/libs/asura-lib-utils/filesystem/reloadable.h @@ -0,0 +1,27 @@ +#ifndef __ASURA_ENGINE_RELOADABLE_H__ +#define __ASURA_ENGINE_RELOADABLE_H__ + +#include "../scripting/portable.hpp" + +namespace AsuraEngine +{ + namespace Filesystem + { + + /// + /// 可以重新构建的数据结构。比如图片、音频这种,从外部数据可以直接构建,可以在编辑器内重新构建,适用于不改变handle的资源。 + /// + ASURA_ABSTRACT class Reloadable + { + public: + Reloadable(); + virtual ~Reloadable(); + + // 继承Reloadable的需要提供一个load方法 + + }; + + } +} + +#endif \ No newline at end of file diff --git a/source/libs/asura-lib-utils/filesystem/resource_manager.cpp b/source/libs/asura-lib-utils/filesystem/resource_manager.cpp new file mode 100644 index 0000000..e69de29 diff --git a/source/libs/asura-lib-utils/filesystem/resource_manager.h b/source/libs/asura-lib-utils/filesystem/resource_manager.h new file mode 100644 index 0000000..c5d8f06 --- /dev/null +++ b/source/libs/asura-lib-utils/filesystem/resource_manager.h @@ -0,0 +1,44 @@ +#ifndef __ASURA_ENGINE_RESOURCE_MANAGER_H__ +#define __ASURA_ENGINE_RESOURCE_MANAGER_H__ + +#include + +#include "../scripting/portable.hpp" +#include "data_buffer.h" + +namespace AsuraEngine +{ + namespace Filesystem + { + + /// + /// 资源管理,负责加载、存储资源,指定根目录等。 + /// + class ResourceManager ASURA_FINAL + { + public: + + ResourceManager(); + ~ResourceManager(); + + /// + /// 装载根目录 + /// + void Mount(const std::string& root); + + /// + /// 读取文件并返回一个data buffer,注意如果要确保正确回收内存,在调用处使用unique_ptr + /// + DataBuffer* LoadFile(const std::string& path); + + /// + /// 保存data buffer里的数据 + /// + void SaveFile(const std::string& path, const DataBuffer* buffer); + + }; + + } +} + +#endif \ No newline at end of file diff --git a/source/libs/asura-lib-utils/math/curve.cpp b/source/libs/asura-lib-utils/math/curve.cpp new file mode 100644 index 0000000..e69de29 diff --git a/source/libs/asura-lib-utils/math/curve.h b/source/libs/asura-lib-utils/math/curve.h new file mode 100644 index 0000000..e69de29 diff --git a/source/libs/asura-lib-utils/math/functions.cpp b/source/libs/asura-lib-utils/math/functions.cpp new file mode 100644 index 0000000..e69de29 diff --git a/source/libs/asura-lib-utils/math/functions.h b/source/libs/asura-lib-utils/math/functions.h new file mode 100644 index 0000000..e69de29 diff --git a/source/libs/asura-lib-utils/math/matrix44.cpp b/source/libs/asura-lib-utils/math/matrix44.cpp new file mode 100644 index 0000000..e69de29 diff --git a/source/libs/asura-lib-utils/math/matrix44.h b/source/libs/asura-lib-utils/math/matrix44.h new file mode 100644 index 0000000..4ab3c0b --- /dev/null +++ b/source/libs/asura-lib-utils/math/matrix44.h @@ -0,0 +1,24 @@ +#ifndef __ASURA_ENGINE_MATRIX44_H__ +#define __ASURA_ENGINE_MATRIX44_H__ + +namespace AsuraEngine +{ + namespace Math + { + + /// + /// 4x4矩阵 + /// + class Matrix44 + { + public: + + private: + + + }; + + } +} + +#endif \ No newline at end of file diff --git a/source/libs/asura-lib-utils/math/ranged_value.cpp b/source/libs/asura-lib-utils/math/ranged_value.cpp new file mode 100644 index 0000000..e69de29 diff --git a/source/libs/asura-lib-utils/math/ranged_value.h b/source/libs/asura-lib-utils/math/ranged_value.h new file mode 100644 index 0000000..e69de29 diff --git a/source/libs/asura-lib-utils/math/rect.hpp b/source/libs/asura-lib-utils/math/rect.hpp new file mode 100644 index 0000000..f635007 --- /dev/null +++ b/source/libs/asura-lib-utils/math/rect.hpp @@ -0,0 +1,32 @@ +#ifndef __ASURA_ENGINE_RECT_H__ +#define __ASURA_ENGINE_RECT_H__ + +namespace AsuraEngine +{ + namespace Math + { + + template + struct Rect + { + public: + Rect(); + ~Rect(T x, T y, T w, T h); + + template + explicit Rect(const Rect& rect); + + T x, y, w, h; + }; + +#include "Rect.inl" + + // Define the most common types + typedef Rect Recti; + typedef Rect Rectu; + typedef Rect Rectf; + + } +} + +#endif \ No newline at end of file diff --git a/source/libs/asura-lib-utils/math/rect.inl b/source/libs/asura-lib-utils/math/rect.inl new file mode 100644 index 0000000..891a3f8 --- /dev/null +++ b/source/libs/asura-lib-utils/math/rect.inl @@ -0,0 +1,19 @@ +template +inline Rect::Rect() + : x(0) + , y(0) + , w(0) + , h(0) +{ + +} + +template +inline Rect::Rect(T X, T Y, T W, T H) + : x(X) + , y(Y) + , w(W) + , h(H) +{ + +} diff --git a/source/libs/asura-lib-utils/math/transform.cpp b/source/libs/asura-lib-utils/math/transform.cpp new file mode 100644 index 0000000..e69de29 diff --git a/source/libs/asura-lib-utils/math/transform.h b/source/libs/asura-lib-utils/math/transform.h new file mode 100644 index 0000000..be4c850 --- /dev/null +++ b/source/libs/asura-lib-utils/math/transform.h @@ -0,0 +1,30 @@ +#ifndef __ASURA_ENGINE_TRANSFORM_H__ +#define __ASURA_ENGINE_TRANSFORM_H__ + +#include "../scripting/portable.hpp" + +namespace AsuraEngine +{ + namespace Math + { + + class Transform + { + public: + + void Set(float x, float y, float sx, float sy, float ox, float oy, float r); + + void LoadIdentity(); + + void Move(float dx = 0, float dy = 0); + void Rotate(float r); + void Scale(float sx, float sy); + + float m[16]; //4x4 matrix + + }; + + } +} + +#endif \ No newline at end of file diff --git a/source/libs/asura-lib-utils/math/vector2.hpp b/source/libs/asura-lib-utils/math/vector2.hpp new file mode 100644 index 0000000..df78255 --- /dev/null +++ b/source/libs/asura-lib-utils/math/vector2.hpp @@ -0,0 +1,70 @@ +#ifndef __ASURA_ENGINE_VECTOR2_H__ +#define __ASURA_ENGINE_VECTOR2_H__ + +namespace AsuraEngine +{ + namespace Math + { + template + class Vector2 + { + public: + Vector2(); + Vector2(T X, T Y); + + template + explicit Vector2(const Vector2& vector); + + Set(T X, T Y); + + T x; ///< X coordinate of the vector + T y; ///< Y coordinate of the vector + }; + + template + Vector2 operator -(const Vector2& right); + + template + Vector2& operator +=(Vector2& left, const Vector2& right); + + template + Vector2& operator -=(Vector2& left, const Vector2& right); + + template + Vector2 operator +(const Vector2& left, const Vector2& right); + + template + Vector2 operator -(const Vector2& left, const Vector2& right); + + template + Vector2 operator *(const Vector2& left, T right); + + template + Vector2 operator *(T left, const Vector2& right); + + template + Vector2& operator *=(Vector2& left, T right); + + template + Vector2 operator /(const Vector2& left, T right); + + template + Vector2& operator /=(Vector2& left, T right); + + template + bool operator ==(const Vector2& left, const Vector2& right); + + template + bool operator !=(const Vector2& left, const Vector2& right); + +#include "Vector2.inl" + + // Define the most common types + typedef Vector2 Vector2i; + typedef Vector2 Vector2u; + typedef Vector2 Vector2f; + + } +} + +#endif \ No newline at end of file diff --git a/source/libs/asura-lib-utils/math/vector2.inl b/source/libs/asura-lib-utils/math/vector2.inl new file mode 100644 index 0000000..9e131a7 --- /dev/null +++ b/source/libs/asura-lib-utils/math/vector2.inl @@ -0,0 +1,114 @@ +template +inline Vector2::Vector2() : + x(0), + y(0) +{ + +} + +template +inline Vector2::Vector2(T X, T Y) : + x(X), + y(Y) +{ + +} + +template +template +inline Vector2::Vector2(const Vector2& vector) : + x(static_cast(vector.x)), + y(static_cast(vector.y)) +{ +} + +template +inline Vector2::Set(T X, T Y) +{ + x = X; + y = Y; +} + +template +inline Vector2 operator -(const Vector2& right) +{ + return Vector2(-right.x, -right.y); +} + +template +inline Vector2& operator +=(Vector2& left, const Vector2& right) +{ + left.x += right.x; + left.y += right.y; + + return left; +} + +template +inline Vector2& operator -=(Vector2& left, const Vector2& right) +{ + left.x -= right.x; + left.y -= right.y; + + return left; +} + +template +inline Vector2 operator +(const Vector2& left, const Vector2& right) +{ + return Vector2(left.x + right.x, left.y + right.y); +} + +template +inline Vector2 operator -(const Vector2& left, const Vector2& right) +{ + return Vector2(left.x - right.x, left.y - right.y); +} + +template +inline Vector2 operator *(const Vector2& left, T right) +{ + return Vector2(left.x * right, left.y * right); +} + +template +inline Vector2 operator *(T left, const Vector2& right) +{ + return Vector2(right.x * left, right.y * left); +} + +template +inline Vector2& operator *=(Vector2& left, T right) +{ + left.x *= right; + left.y *= right; + + return left; +} + +template +inline Vector2 operator /(const Vector2& left, T right) +{ + return Vector2(left.x / right, left.y / right); +} + +template +inline Vector2& operator /=(Vector2& left, T right) +{ + left.x /= right; + left.y /= right; + + return left; +} + +template +inline bool operator ==(const Vector2& left, const Vector2& right) +{ + return (left.x == right.x) && (left.y == right.y); +} + +template +inline bool operator !=(const Vector2& left, const Vector2& right) +{ + return (left.x != right.x) || (left.y != right.y); +} diff --git a/source/libs/asura-lib-utils/math/vector3.hpp b/source/libs/asura-lib-utils/math/vector3.hpp new file mode 100644 index 0000000..2b23406 --- /dev/null +++ b/source/libs/asura-lib-utils/math/vector3.hpp @@ -0,0 +1,233 @@ +#ifndef __ASURA_ENGINE_VECTOR3_H__ +#define __ASURA_ENGINE_VECTOR3_H__ + +namespace AsuraEngine +{ + namespace Math + { + template + class Vector3 + { + public: + + //////////////////////////////////////////////////////////// + /// \brief Default constructor + /// + /// Creates a Vector3(0, 0, 0). + /// + //////////////////////////////////////////////////////////// + Vector3(); + + //////////////////////////////////////////////////////////// + /// \brief Construct the vector from its coordinates + /// + /// \param X X coordinate + /// \param Y Y coordinate + /// \param Z Z coordinate + /// + //////////////////////////////////////////////////////////// + Vector3(T X, T Y, T Z); + + //////////////////////////////////////////////////////////// + /// \brief Construct the vector from another type of vector + /// + /// This constructor doesn't replace the copy constructor, + /// it's called only when U != T. + /// A call to this constructor will fail to compile if U + /// is not convertible to T. + /// + /// \param vector Vector to convert + /// + //////////////////////////////////////////////////////////// + template + explicit Vector3(const Vector3& vector); + + //////////////////////////////////////////////////////////// + // Member data + //////////////////////////////////////////////////////////// + T x; ///< X coordinate of the vector + T y; ///< Y coordinate of the vector + T z; ///< Z coordinate of the vector + }; + + //////////////////////////////////////////////////////////// + /// \relates Vector3 + /// \brief Overload of unary operator - + /// + /// \param left Vector to negate + /// + /// \return Memberwise opposite of the vector + /// + //////////////////////////////////////////////////////////// + template + Vector3 operator -(const Vector3& left); + + //////////////////////////////////////////////////////////// + /// \relates Vector3 + /// \brief Overload of binary operator += + /// + /// This operator performs a memberwise addition of both vectors, + /// and assigns the result to \a left. + /// + /// \param left Left operand (a vector) + /// \param right Right operand (a vector) + /// + /// \return Reference to \a left + /// + //////////////////////////////////////////////////////////// + template + Vector3& operator +=(Vector3& left, const Vector3& right); + + //////////////////////////////////////////////////////////// + /// \relates Vector3 + /// \brief Overload of binary operator -= + /// + /// This operator performs a memberwise subtraction of both vectors, + /// and assigns the result to \a left. + /// + /// \param left Left operand (a vector) + /// \param right Right operand (a vector) + /// + /// \return Reference to \a left + /// + //////////////////////////////////////////////////////////// + template + Vector3& operator -=(Vector3& left, const Vector3& right); + + //////////////////////////////////////////////////////////// + /// \relates Vector3 + /// \brief Overload of binary operator + + /// + /// \param left Left operand (a vector) + /// \param right Right operand (a vector) + /// + /// \return Memberwise addition of both vectors + /// + //////////////////////////////////////////////////////////// + template + Vector3 operator +(const Vector3& left, const Vector3& right); + + //////////////////////////////////////////////////////////// + /// \relates Vector3 + /// \brief Overload of binary operator - + /// + /// \param left Left operand (a vector) + /// \param right Right operand (a vector) + /// + /// \return Memberwise subtraction of both vectors + /// + //////////////////////////////////////////////////////////// + template + Vector3 operator -(const Vector3& left, const Vector3& right); + + //////////////////////////////////////////////////////////// + /// \relates Vector3 + /// \brief Overload of binary operator * + /// + /// \param left Left operand (a vector) + /// \param right Right operand (a scalar value) + /// + /// \return Memberwise multiplication by \a right + /// + //////////////////////////////////////////////////////////// + template + Vector3 operator *(const Vector3& left, T right); + + //////////////////////////////////////////////////////////// + /// \relates Vector3 + /// \brief Overload of binary operator * + /// + /// \param left Left operand (a scalar value) + /// \param right Right operand (a vector) + /// + /// \return Memberwise multiplication by \a left + /// + //////////////////////////////////////////////////////////// + template + Vector3 operator *(T left, const Vector3& right); + + //////////////////////////////////////////////////////////// + /// \relates Vector3 + /// \brief Overload of binary operator *= + /// + /// This operator performs a memberwise multiplication by \a right, + /// and assigns the result to \a left. + /// + /// \param left Left operand (a vector) + /// \param right Right operand (a scalar value) + /// + /// \return Reference to \a left + /// + //////////////////////////////////////////////////////////// + template + Vector3& operator *=(Vector3& left, T right); + + //////////////////////////////////////////////////////////// + /// \relates Vector3 + /// \brief Overload of binary operator / + /// + /// \param left Left operand (a vector) + /// \param right Right operand (a scalar value) + /// + /// \return Memberwise division by \a right + /// + //////////////////////////////////////////////////////////// + template + Vector3 operator /(const Vector3& left, T right); + + //////////////////////////////////////////////////////////// + /// \relates Vector3 + /// \brief Overload of binary operator /= + /// + /// This operator performs a memberwise division by \a right, + /// and assigns the result to \a left. + /// + /// \param left Left operand (a vector) + /// \param right Right operand (a scalar value) + /// + /// \return Reference to \a left + /// + //////////////////////////////////////////////////////////// + template + Vector3& operator /=(Vector3& left, T right); + + //////////////////////////////////////////////////////////// + /// \relates Vector3 + /// \brief Overload of binary operator == + /// + /// This operator compares strict equality between two vectors. + /// + /// \param left Left operand (a vector) + /// \param right Right operand (a vector) + /// + /// \return True if \a left is equal to \a right + /// + //////////////////////////////////////////////////////////// + template + bool operator ==(const Vector3& left, const Vector3& right); + + //////////////////////////////////////////////////////////// + /// \relates Vector3 + /// \brief Overload of binary operator != + /// + /// This operator compares strict difference between two vectors. + /// + /// \param left Left operand (a vector) + /// \param right Right operand (a vector) + /// + /// \return True if \a left is not equal to \a right + /// + //////////////////////////////////////////////////////////// + template + bool operator !=(const Vector3& left, const Vector3& right); + +#include "Vector3.inl" + + // Define the most common types + typedef Vector3 Vector3i; + typedef Vector3 Vector3f; + + } +} + +#endif \ No newline at end of file diff --git a/source/libs/asura-lib-utils/math/vector3.inl b/source/libs/asura-lib-utils/math/vector3.inl new file mode 100644 index 0000000..3a2aa93 --- /dev/null +++ b/source/libs/asura-lib-utils/math/vector3.inl @@ -0,0 +1,145 @@ + + +//////////////////////////////////////////////////////////// +template +inline Vector3::Vector3() : + x(0), + y(0), + z(0) +{ + +} + + +//////////////////////////////////////////////////////////// +template +inline Vector3::Vector3(T X, T Y, T Z) : + x(X), + y(Y), + z(Z) +{ + +} + + +//////////////////////////////////////////////////////////// +template +template +inline Vector3::Vector3(const Vector3& vector) : + x(static_cast(vector.x)), + y(static_cast(vector.y)), + z(static_cast(vector.z)) +{ +} + + +//////////////////////////////////////////////////////////// +template +inline Vector3 operator -(const Vector3& left) +{ + return Vector3(-left.x, -left.y, -left.z); +} + + +//////////////////////////////////////////////////////////// +template +inline Vector3& operator +=(Vector3& left, const Vector3& right) +{ + left.x += right.x; + left.y += right.y; + left.z += right.z; + + return left; +} + + +//////////////////////////////////////////////////////////// +template +inline Vector3& operator -=(Vector3& left, const Vector3& right) +{ + left.x -= right.x; + left.y -= right.y; + left.z -= right.z; + + return left; +} + + +//////////////////////////////////////////////////////////// +template +inline Vector3 operator +(const Vector3& left, const Vector3& right) +{ + return Vector3(left.x + right.x, left.y + right.y, left.z + right.z); +} + + +//////////////////////////////////////////////////////////// +template +inline Vector3 operator -(const Vector3& left, const Vector3& right) +{ + return Vector3(left.x - right.x, left.y - right.y, left.z - right.z); +} + + +//////////////////////////////////////////////////////////// +template +inline Vector3 operator *(const Vector3& left, T right) +{ + return Vector3(left.x * right, left.y * right, left.z * right); +} + + +//////////////////////////////////////////////////////////// +template +inline Vector3 operator *(T left, const Vector3& right) +{ + return Vector3(right.x * left, right.y * left, right.z * left); +} + + +//////////////////////////////////////////////////////////// +template +inline Vector3& operator *=(Vector3& left, T right) +{ + left.x *= right; + left.y *= right; + left.z *= right; + + return left; +} + + +//////////////////////////////////////////////////////////// +template +inline Vector3 operator /(const Vector3& left, T right) +{ + return Vector3(left.x / right, left.y / right, left.z / right); +} + + +//////////////////////////////////////////////////////////// +template +inline Vector3& operator /=(Vector3& left, T right) +{ + left.x /= right; + left.y /= right; + left.z /= right; + + return left; +} + + +//////////////////////////////////////////////////////////// +template +inline bool operator ==(const Vector3& left, const Vector3& right) +{ + return (left.x == right.x) && (left.y == right.y) && (left.z == right.z); +} + + +//////////////////////////////////////////////////////////// +template +inline bool operator !=(const Vector3& left, const Vector3& right) +{ + return (left.x != right.x) || (left.y != right.y) || (left.z != right.z); +} diff --git a/source/libs/asura-lib-utils/math/vector4.h b/source/libs/asura-lib-utils/math/vector4.h new file mode 100644 index 0000000..13a9d8a --- /dev/null +++ b/source/libs/asura-lib-utils/math/vector4.h @@ -0,0 +1,234 @@ +#ifndef __ASURA_ENGINE_VECTOR4_H__ +#define __ASURA_ENGINE_VECTOR4_H__ + +namespace AsuraEngine +{ + namespace Math + { + template + class Vector4 + { + public: + + //////////////////////////////////////////////////////////// + /// \brief Default constructor + /// + /// Creates a Vector4(0, 0, 0). + /// + //////////////////////////////////////////////////////////// + Vector4(); + + //////////////////////////////////////////////////////////// + /// \brief Construct the vector from its coordinates + /// + /// \param X X coordinate + /// \param Y Y coordinate + /// \param Z Z coordinate + /// + //////////////////////////////////////////////////////////// + Vector4(T X, T Y, T Z, T W); + + //////////////////////////////////////////////////////////// + /// \brief Construct the vector from another type of vector + /// + /// This constructor doesn't replace the copy constructor, + /// it's called only when U != T. + /// A call to this constructor will fail to compile if U + /// is not convertible to T. + /// + /// \param vector Vector to convert + /// + //////////////////////////////////////////////////////////// + template + explicit Vector4(const Vector4& vector); + + //////////////////////////////////////////////////////////// + // Member data + //////////////////////////////////////////////////////////// + T x; ///< X coordinate of the vector + T y; ///< Y coordinate of the vector + T z; ///< Z coordinate of the vector + T w; ///< W coordinate of the vector + }; + + //////////////////////////////////////////////////////////// + /// \relates Vector4 + /// \brief Overload of unary operator - + /// + /// \param left Vector to negate + /// + /// \return Memberwise opposite of the vector + /// + //////////////////////////////////////////////////////////// + template + Vector4 operator -(const Vector4& left); + + //////////////////////////////////////////////////////////// + /// \relates Vector4 + /// \brief Overload of binary operator += + /// + /// This operator performs a memberwise addition of both vectors, + /// and assigns the result to \a left. + /// + /// \param left Left operand (a vector) + /// \param right Right operand (a vector) + /// + /// \return Reference to \a left + /// + //////////////////////////////////////////////////////////// + template + Vector4& operator +=(Vector4& left, const Vector4& right); + + //////////////////////////////////////////////////////////// + /// \relates Vector4 + /// \brief Overload of binary operator -= + /// + /// This operator performs a memberwise subtraction of both vectors, + /// and assigns the result to \a left. + /// + /// \param left Left operand (a vector) + /// \param right Right operand (a vector) + /// + /// \return Reference to \a left + /// + //////////////////////////////////////////////////////////// + template + Vector4& operator -=(Vector4& left, const Vector4& right); + + //////////////////////////////////////////////////////////// + /// \relates Vector4 + /// \brief Overload of binary operator + + /// + /// \param left Left operand (a vector) + /// \param right Right operand (a vector) + /// + /// \return Memberwise addition of both vectors + /// + //////////////////////////////////////////////////////////// + template + Vector4 operator +(const Vector4& left, const Vector4& right); + + //////////////////////////////////////////////////////////// + /// \relates Vector4 + /// \brief Overload of binary operator - + /// + /// \param left Left operand (a vector) + /// \param right Right operand (a vector) + /// + /// \return Memberwise subtraction of both vectors + /// + //////////////////////////////////////////////////////////// + template + Vector4 operator -(const Vector4& left, const Vector4& right); + + //////////////////////////////////////////////////////////// + /// \relates Vector4 + /// \brief Overload of binary operator * + /// + /// \param left Left operand (a vector) + /// \param right Right operand (a scalar value) + /// + /// \return Memberwise multiplication by \a right + /// + //////////////////////////////////////////////////////////// + template + Vector4 operator *(const Vector4& left, T right); + + //////////////////////////////////////////////////////////// + /// \relates Vector4 + /// \brief Overload of binary operator * + /// + /// \param left Left operand (a scalar value) + /// \param right Right operand (a vector) + /// + /// \return Memberwise multiplication by \a left + /// + //////////////////////////////////////////////////////////// + template + Vector4 operator *(T left, const Vector4& right); + + //////////////////////////////////////////////////////////// + /// \relates Vector4 + /// \brief Overload of binary operator *= + /// + /// This operator performs a memberwise multiplication by \a right, + /// and assigns the result to \a left. + /// + /// \param left Left operand (a vector) + /// \param right Right operand (a scalar value) + /// + /// \return Reference to \a left + /// + //////////////////////////////////////////////////////////// + template + Vector4& operator *=(Vector4& left, T right); + + //////////////////////////////////////////////////////////// + /// \relates Vector4 + /// \brief Overload of binary operator / + /// + /// \param left Left operand (a vector) + /// \param right Right operand (a scalar value) + /// + /// \return Memberwise division by \a right + /// + //////////////////////////////////////////////////////////// + template + Vector4 operator /(const Vector4& left, T right); + + //////////////////////////////////////////////////////////// + /// \relates Vector4 + /// \brief Overload of binary operator /= + /// + /// This operator performs a memberwise division by \a right, + /// and assigns the result to \a left. + /// + /// \param left Left operand (a vector) + /// \param right Right operand (a scalar value) + /// + /// \return Reference to \a left + /// + //////////////////////////////////////////////////////////// + template + Vector4& operator /=(Vector4& left, T right); + + //////////////////////////////////////////////////////////// + /// \relates Vector4 + /// \brief Overload of binary operator == + /// + /// This operator compares strict equality between two vectors. + /// + /// \param left Left operand (a vector) + /// \param right Right operand (a vector) + /// + /// \return True if \a left is equal to \a right + /// + //////////////////////////////////////////////////////////// + template + bool operator ==(const Vector4& left, const Vector4& right); + + //////////////////////////////////////////////////////////// + /// \relates Vector4 + /// \brief Overload of binary operator != + /// + /// This operator compares strict difference between two vectors. + /// + /// \param left Left operand (a vector) + /// \param right Right operand (a vector) + /// + /// \return True if \a left is not equal to \a right + /// + //////////////////////////////////////////////////////////// + template + bool operator !=(const Vector4& left, const Vector4& right); + +#include "Vector4.inl" + + // Define the most common types + typedef Vector4 Vector4i; + typedef Vector4 Vector4f; + + } +} + +#endif \ No newline at end of file diff --git a/source/libs/asura-lib-utils/math/vector4.inl b/source/libs/asura-lib-utils/math/vector4.inl new file mode 100644 index 0000000..025bfcc --- /dev/null +++ b/source/libs/asura-lib-utils/math/vector4.inl @@ -0,0 +1,152 @@ + + +//////////////////////////////////////////////////////////// +template +inline Vector4::Vector4() : + x(0), + y(0), + z(0), + w(0) +{ + +} + + +//////////////////////////////////////////////////////////// +template +inline Vector4::Vector4(T X, T Y, T Z) : + x(X), + y(Y), + z(Z), + w(0) +{ + +} + + +//////////////////////////////////////////////////////////// +template +template +inline Vector4::Vector4(const Vector4& vector) : + x(static_cast(vector.x)), + y(static_cast(vector.y)), + z(static_cast(vector.z)) + w(static_cast(vector.w)) +{ +} + + +//////////////////////////////////////////////////////////// +template +inline Vector4 operator -(const Vector4& left) +{ + return Vector4(-left.x, -left.y, -left.z, -left.w); +} + + +//////////////////////////////////////////////////////////// +template +inline Vector4& operator +=(Vector4& left, const Vector4& right) +{ + left.x += right.x; + left.y += right.y; + left.z += right.z; + left.w += right.w; + + return left; +} + + +//////////////////////////////////////////////////////////// +template +inline Vector4& operator -=(Vector4& left, const Vector4& right) +{ + left.x -= right.x; + left.y -= right.y; + left.z -= right.z; + left.w -= right.w; + + return left; +} + + +//////////////////////////////////////////////////////////// +template +inline Vector4 operator +(const Vector4& left, const Vector4& right) +{ + return Vector4(left.x + right.x, left.y + right.y, left.z + right.z, left.w + right.w); +} + + +//////////////////////////////////////////////////////////// +template +inline Vector4 operator -(const Vector4& left, const Vector4& right) +{ + return Vector4(left.x - right.x, left.y - right.y, left.z - right.z, left.w - right.w); +} + + +//////////////////////////////////////////////////////////// +template +inline Vector4 operator *(const Vector4& left, T right) +{ + return Vector4(left.x * right, left.y * right, left.z * right, left.w * right); +} + + +//////////////////////////////////////////////////////////// +template +inline Vector4 operator *(T left, const Vector4& right) +{ + return Vector4(right.x * left, right.y * left, right.z * left, right.w * left); +} + + +//////////////////////////////////////////////////////////// +template +inline Vector4& operator *=(Vector4& left, T right) +{ + left.x *= right; + left.y *= right; + left.z *= right; + left.w *= right; + + return left; +} + + +//////////////////////////////////////////////////////////// +template +inline Vector4 operator /(const Vector4& left, T right) +{ + return Vector4(left.x / right, left.y / right, left.z / right, left.w / right); +} + + +//////////////////////////////////////////////////////////// +template +inline Vector4& operator /=(Vector4& left, T right) +{ + left.x /= right; + left.y /= right; + left.z /= right; + left.w /= right; + + return left; +} + + +//////////////////////////////////////////////////////////// +template +inline bool operator ==(const Vector4& left, const Vector4& right) +{ + return (left.x == right.x) && (left.y == right.y) && (left.z == right.z) && (left.w == right.w); +} + + +//////////////////////////////////////////////////////////// +template +inline bool operator !=(const Vector4& left, const Vector4& right) +{ + return (left.x != right.x) || (left.y != right.y) || (left.z != right.z) || (left.w != right.w); +} diff --git a/source/libs/asura-lib-utils/module.h b/source/libs/asura-lib-utils/module.h new file mode 100644 index 0000000..b22c68c --- /dev/null +++ b/source/libs/asura-lib-utils/module.h @@ -0,0 +1,32 @@ +#ifndef __ASURA_MODULE_H__ +#define __ASURA_MODULE_H__ + +#include "type.h" +#include "scripting/portable.hpp" + +namespace AsuraEngine +{ + + /// + /// Asura libs 需要继承此类,以开启注册。在模块队列中按顺序添加这些模块,然后顺序调用Initialize和Finalize方法来初始化和 + /// 关闭这些模块。 + /// + ASURA_ABSTRACT class Module + { + public: + + /// + /// 初始化模块。 + /// + virtual void Initialize(Luax::LuaxState& state) = 0; + + /// + /// 关闭模块。 + /// + virtual void Finalize(Luax::LuaxState& state) = 0; + + }; + +} + +#endif \ No newline at end of file diff --git a/source/libs/asura-lib-utils/scripting/luax.hpp b/source/libs/asura-lib-utils/scripting/luax.hpp new file mode 100644 index 0000000..cca26e2 --- /dev/null +++ b/source/libs/asura-lib-utils/scripting/luax.hpp @@ -0,0 +1,13 @@ +#ifndef __ASURA_ENGINE_LUAX_H__ +#define __ASURA_ENGINE_LUAX_H__ + +/// +/// Scripting with Lua. +/// +extern "C" { +#include +#include +} +#include + +#endif \ No newline at end of file diff --git a/source/libs/asura-lib-utils/scripting/portable.hpp b/source/libs/asura-lib-utils/scripting/portable.hpp new file mode 100644 index 0000000..7f780d1 --- /dev/null +++ b/source/libs/asura-lib-utils/scripting/portable.hpp @@ -0,0 +1,22 @@ +#ifndef __ASURA_ENGINE_PORTABLE_H__ +#define __ASURA_ENGINE_PORTABLE_H__ + +#include "../type.h" + +#include "Luax.hpp" + +namespace AsuraEngine +{ + namespace Scripting + { + + /// + /// 要注册给lua的native类需要继承此模板。 + /// + template + using Portable = Luax::LuaxNativeClass; + + } +} + +#endif \ No newline at end of file diff --git a/source/libs/asura-lib-utils/scripting/portable.inl b/source/libs/asura-lib-utils/scripting/portable.inl new file mode 100644 index 0000000..e69de29 diff --git a/source/libs/asura-lib-utils/type.h b/source/libs/asura-lib-utils/type.h new file mode 100644 index 0000000..25b52fe --- /dev/null +++ b/source/libs/asura-lib-utils/type.h @@ -0,0 +1,70 @@ +#ifndef __ASURA_UTILS_TYPE_H__ +#define __ASURA_UTILS_TYPE_H__ + +#include +#include + +namespace AsuraEngine +{ + + //---------------------------------------------------------------------------------------------------------------- + + typedef int8_t int8; + typedef uint8_t uint8; + typedef uint8 byte; + typedef int16_t int16; + typedef uint16_t uint16; + typedef int32_t int32; + typedef uint32_t uint32; + typedef int64_t int64; + typedef uint64_t uint64; + + typedef uint32_t uint; + typedef int32_t sint; + + typedef std::size_t size_t; + + //---------------------------------------------------------------------------------------------------------------- + +#ifndef ASSERT + #ifdef NDEBUG + #define ASSERT(x) { false ? (void)(x) : (void)0; } + #else + #ifdef _WIN32 + #define ASURA_DEBUG_BREAK() __debugbreak() + #else + #define ASURA_DEBUG_BREAK() raise(SIGTRAP) + #endif + #define ASSERT(x) do { const volatile bool asura_assert_b____ = !(x); if(asura_assert_b____) ASURA_DEBUG_BREAK(); } while (false) + #endif +#endif + + //---------------------------------------------------------------------------------------------------------------- + +#ifdef _WIN32 + #define ASURA_FINAL final + #define ASURA_LIBRARY_EXPORT __declspec(dllexport) + #define ASURA_LIBRARY_IMPORT __declspec(dllimport) + #define ASURA_FORCE_INLINE __forceinline + #define ASURA_RESTRICT __restrict + #define ASURA_ATTRIBUTE_USED + #define ASURA_ABSTRACT + #define ASURA_API ASURA_LIBRARY_EXPORT +#else + #define ASURA_FINAL final + #define ASURA_LIBRARY_EXPORT __attribute__((visibility("default"))) + #define ASURA_LIBRARY_IMPORT + #define ASURA_FORCE_INLINE __attribute__((always_inline)) inline + #define ASURA_RESTRICT __restrict__ + #define ASURA_ATTRIBUTE_USED __attribute__((used)) + #define ASURA_ABSTRACT + #define ASURA_API ASURA_LIBRARY_EXPORT +#endif + + //---------------------------------------------------------------------------------------------------------------- + +#define ASURA_SDL_HOST 1 + +} // namespace AsuraEngine + +#endif // __ASURA_CONFIG_H__ \ No newline at end of file diff --git a/source/libs/asura-lib-utils/utils.h b/source/libs/asura-lib-utils/utils.h new file mode 100644 index 0000000..e69de29 diff --git a/source/libs/asura-lib-utils/utils_module.cpp b/source/libs/asura-lib-utils/utils_module.cpp new file mode 100644 index 0000000..7fe3612 --- /dev/null +++ b/source/libs/asura-lib-utils/utils_module.cpp @@ -0,0 +1,20 @@ +#include "utils_module.h" +#include "./filesystem/data_buffer.h" + +using namespace AsuraEngine::Filesystem; + +namespace AsuraEngine +{ + + void UtilsModule::Initialize(Luax::LuaxState& state) + { + LUAX_REGISTER_FACTORY(state, DataBuffer); + + } + + void UtilsModule::Finalize(Luax::LuaxState& state) + { + + } + +} \ No newline at end of file diff --git a/source/libs/asura-lib-utils/utils_module.h b/source/libs/asura-lib-utils/utils_module.h new file mode 100644 index 0000000..0b5d076 --- /dev/null +++ b/source/libs/asura-lib-utils/utils_module.h @@ -0,0 +1,24 @@ +#ifndef __ASURA_LIBS_UTIL_MODULE_H__ +#define __ASURA_LIBS_UTIL_MODULE_H__ + +#include "module.h" + +namespace AsuraEngine +{ + + /// + /// Asura公用模块 + /// + class UtilsModule : public Module + { + public: + + void Initialize(Luax::LuaxState& state) override; + + void Finalize(Luax::LuaxState& state) override; + + }; + +} + +#endif \ No newline at end of file -- cgit v1.1-26-g67d0