Changed project structure.

This commit is contained in:
2024-01-14 09:38:57 -08:00
parent 7dcd903140
commit 039ab8cc0f
240 changed files with 696 additions and 573 deletions

View File

@@ -1,7 +0,0 @@
#pragma once
enum class Dock
{
NONE,
FILL
};

View File

@@ -355,18 +355,34 @@ namespace ehs
{
T* result = new T[--size];
T value = std::move(data[size]);
T popped = (T&&)data[size];
for (N i = 0; i < size; ++i)
result[i] = std::move(data[i]);
result[i] = (T&&)data[i];
delete[] data;
data = result;
return value;
return popped;
}
/// Will swap the value at the given index with the value at the end of the array and pops it.
/// @param [in] index The index of the value to swap with.
/// @returns The removed value.
T Pop(const N index)
{
if (!size)
return {};
N lastIndex = size - 1;
if (index < lastIndex)
Swap(index, lastIndex);
return Pop();
}
void Clear()
{
if (!data)

10
include/ehs/Dock.h Normal file
View File

@@ -0,0 +1,10 @@
#pragma once
namespace ehs
{
enum class Dock
{
NONE,
FILL
};
}

View File

@@ -7,7 +7,7 @@
#endif
#include "Types.h"
#include "system/OS.h"
#include "ehs/system/OS.h"
#include "Version.h"
#include "Str.h"

View File

@@ -3,8 +3,8 @@
#include "EHS.h"
#include "Vector.h"
#include "BaseObj.h"
#include "system/Mutex.h"
#include "system/Thread.h"
#include "ehs/system/Mutex.h"
#include "ehs/system/Thread.h"
namespace ehs
{

View File

@@ -1,6 +1,6 @@
#pragma once
#include "system/CPU.h"
#include "ehs/system/CPU.h"
#define EHS_LOW_WORD(x) *((int*)&x) + 1

View File

@@ -2,8 +2,8 @@
#include "EHS.h"
#include "BaseObj.h"
#include "system/Thread.h"
#include "system/Semaphore.h"
#include "ehs/system/Thread.h"
#include "ehs/system/Semaphore.h"
namespace ehs
{

View File

@@ -1,6 +1,6 @@
#pragma once
#include "system/OS.h"
#include "ehs/system/OS.h"
#define EHS_MAX_PATH 0x104
#define EHS_UINT_8_MAX 0xFF

View File

@@ -510,7 +510,7 @@ namespace ehs
}
/// Much like the stack it pops a value at the end of the vector.
/// @returns The removed data.
/// @returns The removed value.
T Pop()
{
T popped = {};
@@ -546,6 +546,22 @@ namespace ehs
return popped;
}
/// Will swap the value at the given index with the value at the end of the vector and pops it.
/// @param [in] index The index of the value to swap with.
/// @returns The removed value.
T Pop(const N index)
{
if (!size)
return {};
N lastIndex = size - 1;
if (index < lastIndex)
Swap(index, lastIndex);
return Pop();
}
/// Resizes the vector while keeping its alignment.
/// @param [in] newSize The size to change to.
void Resize(const N newSize)

View File

@@ -1,8 +1,8 @@
#pragma once
#include "EHS.h"
#include "BaseObj.h"
#include "Str.h"
#include "ehs/EHS.h"
#include "ehs/BaseObj.h"
#include "ehs/Str.h"
namespace ehs
{

View File

@@ -1,10 +1,10 @@
#pragma once
#include "EHS.h"
#include "Str.h"
#include "Vector.h"
#include "Array.h"
#include "Serializer.h"
#include "ehs/EHS.h"
#include "ehs/Str.h"
#include "ehs/Vector.h"
#include "ehs/Array.h"
#include "ehs/Serializer.h"
namespace ehs
{

View File

@@ -1,7 +1,7 @@
#pragma once
#include "EHS.h"
#include "Str.h"
#include "ehs/EHS.h"
#include "ehs/Str.h"
#define EHS_FE_NONE 0x00
#define EHS_FE_MODIFIED 0x01

View File

@@ -1,10 +1,10 @@
#pragma once
#include "EHS.h"
#include "Str.h"
#include "Vec2.h"
#include "Rect.h"
#include "hid/Input.h"
#include "ehs/EHS.h"
#include "ehs/Str.h"
#include "ehs/Vec2.h"
#include "ehs/Rect.h"
#include "ehs/io/hid/Input.h"
namespace ehs
{

View File

@@ -1,6 +1,6 @@
#pragma once
#include "EHS.h"
#include "ehs/EHS.h"
namespace ehs
{

View File

@@ -1,8 +1,8 @@
#pragma once
#include "Str.h"
#include "UTF.h"
#include "Array.h"
#include "ehs/Str.h"
#include "ehs/UTF.h"
#include "ehs/Array.h"
namespace ehs
{

View File

@@ -1,6 +1,6 @@
#pragma once
#include "EHS.h"
#include "ehs/EHS.h"
#if defined(EHS_OS_WINDOWS)
#include "File_W32.h"

View File

@@ -1,6 +1,6 @@
#pragma once
#include "EHS.h"
#include "ehs/EHS.h"
#include "BaseFileMonitor.h"
namespace ehs

View File

@@ -1,6 +1,6 @@
#pragma once
#include "EHS.h"
#include "ehs/EHS.h"
#include "BaseFileMonitor.h"
namespace ehs

View File

@@ -1,11 +1,11 @@
#pragma once
#include "EHS.h"
#include "Str.h"
#include "UTF.h"
#include "Vector.h"
#include "Array.h"
#include "Serializer.h"
#include "ehs/EHS.h"
#include "ehs/Str.h"
#include "ehs/UTF.h"
#include "ehs/Vector.h"
#include "ehs/Array.h"
#include "ehs/Serializer.h"
#include "BaseFile.h"
namespace ehs

View File

@@ -1,11 +1,11 @@
#pragma once
#include "EHS.h"
#include "Str.h"
#include "UTF.h"
#include "Vector.h"
#include "Array.h"
#include "Serializer.h"
#include "ehs/EHS.h"
#include "ehs/Str.h"
#include "ehs/UTF.h"
#include "ehs/Vector.h"
#include "ehs/Array.h"
#include "ehs/Serializer.h"
#include "BaseFile.h"
namespace ehs

View File

@@ -1,12 +1,12 @@
#pragma once
#include "EHS.h"
#include "Array.h"
#include "ehs/EHS.h"
#include "ehs/Array.h"
#include "Glyph.h"
#include "Anchor.h"
#include "img/Img.h"
#include "model/Mesh.h"
#include "ehs/Anchor.h"
#include "ehs/io/img/Img.h"
#include "ehs/io/model/Mesh.h"
namespace ehs
{

View File

@@ -1,9 +1,9 @@
#pragma once
#include "EHS.h"
#include "Vec2.h"
#include "Rect.h"
#include "Serializer.h"
#include "ehs/EHS.h"
#include "ehs/Vec2.h"
#include "ehs/Rect.h"
#include "ehs/Serializer.h"
namespace ehs
{

View File

@@ -1,9 +1,9 @@
#pragma once
#include "EHS.h"
#include "Str.h"
#include "Vector.h"
#include "Serializer.h"
#include "ehs/EHS.h"
#include "ehs/Str.h"
#include "ehs/Vector.h"
#include "ehs/Serializer.h"
#include "RIFF_Chunk.h"
namespace ehs

View File

@@ -1,8 +1,8 @@
#pragma once
#include "EHS.h"
#include "Str.h"
#include "Serializer.h"
#include "ehs/EHS.h"
#include "ehs/Str.h"
#include "ehs/Serializer.h"
namespace ehs
{

View File

@@ -1,6 +1,6 @@
#pragma once
#include "EHS.h"
#include "ehs/system/OS.h"
#if defined(EHS_OS_WINDOWS)
#include "Window_W32.h"

View File

@@ -1,9 +1,9 @@
#pragma once
#include "EHS.h"
#include "Array.h"
#include "Str.h"
#include "Vec4.h"
#include "ehs/EHS.h"
#include "ehs/Array.h"
#include "ehs/Str.h"
#include "ehs/Vec4.h"
#include "BaseWindow.h"
#include "HID/InputHandler.h"

View File

@@ -22,13 +22,23 @@ namespace ehs
Serializer<UInt_64> clipboard;
public:
~Window() override;
Window();
void Create_32(const Str_32& title, const Vec2_s32& pos, const Vec2_u32 scale) override;
Window(Window&& win) noexcept;
void Create_16(const Str_16& title, const Vec2_s32& pos, const Vec2_u32 scale) override;
Window(const Window& win);
void Create_8(const Str_8& title, const Vec2_s32& pos, const Vec2_u32 scale) override;
Window& operator=(Window&& win) noexcept;
Window& operator=(const Window& win);
void Create_32(const Str_32& title, const Vec2_s32& pos, Vec2_u32 scale) override;
void Create_16(const Str_16& title, const Vec2_s32& pos, Vec2_u32 scale) override;
void Create_8(const Str_8& title, const Vec2_s32& pos, Vec2_u32 scale) override;
void Close() override;
@@ -40,7 +50,7 @@ namespace ehs
void ShowCursor(bool toggle) override;
void ConstrainCursor(const bool constrain) override;
void ConstrainCursor(bool constrain) override;
void SetTitle_32(const Str_32& newTitle) override;
@@ -66,19 +76,19 @@ namespace ehs
void SetClipboard(Serializer<UInt_64> data) override;
void SetCursorImg(const CursorImg img) override;
void SetCursorImg(CursorImg img) override;
xcb_connection_t* GetServer();
private:
xcb_generic_event_t* RetrieveEvent();
xcb_atom_t RetrieveAtom(const bool create, const Str_8& name) const;
xcb_atom_t RetrieveAtom(bool create, const Str_8& name) const;
xcb_get_property_reply_t* RetrieveProp(const xcb_atom_t prop, const xcb_atom_t type) const;
xcb_get_property_reply_t* RetrieveProp(xcb_atom_t prop, xcb_atom_t type) const;
void QueryPrimaryDevices();
Str_8 QueryDeviceName(const UInt_16 id);
Str_8 QueryDeviceName(UInt_16 id);
};
}

View File

@@ -1,12 +1,12 @@
#pragma once
#include "Types.h"
#include "BaseObj.h"
#include "DataType.h"
#include "Str.h"
#include "Serializer.h"
#include "Vector.h"
#include "Array.h"
#include "ehs/Types.h"
#include "ehs/BaseObj.h"
#include "ehs/DataType.h"
#include "ehs/Str.h"
#include "ehs/Serializer.h"
#include "ehs/Vector.h"
#include "ehs/Array.h"
#include "AudioCodec.h"
namespace ehs

View File

@@ -1,8 +1,8 @@
#pragma once
#include "EHS.h"
#include "Str.h"
#include "io/File.h"
#include "ehs/EHS.h"
#include "ehs/Str.h"
#include "ehs/io/File.h"
namespace ehs
{

View File

@@ -1,6 +1,6 @@
#pragma once
#include "EHS.h"
#include "ehs/EHS.h"
#if defined(EHS_OS_WINDOWS)
#include "AudioDevice_W32.h"

View File

@@ -1,6 +1,6 @@
#pragma once
#include "EHS.h"
#include "ehs/EHS.h"
#include "BaseAudioDevice.h"
#include <alsa/asoundlib.h>

View File

@@ -1,6 +1,6 @@
#pragma once
#include "EHS.h"
#include "ehs/EHS.h"
#include "BaseAudioDevice.h"
#include <initguid.h>

View File

@@ -1,10 +1,10 @@
#pragma once
#include "EHS.h"
#include "Str.h"
#include "Vector.h"
#include "Array.h"
#include "DataType.h"
#include "ehs/EHS.h"
#include "ehs/Str.h"
#include "ehs/Vector.h"
#include "ehs/Array.h"
#include "ehs/DataType.h"
namespace ehs
{

View File

@@ -1,7 +1,7 @@
#pragma once
#include "EHS.h"
#include "Str.h"
#include "ehs/EHS.h"
#include "ehs/Str.h"
namespace ehs
{

View File

@@ -1,6 +1,6 @@
#pragma once
#include "EHS.h"
#include "ehs/EHS.h"
#include "Button.h"
namespace ehs

View File

@@ -1,6 +1,6 @@
#pragma once
#include "Array.h"
#include "ehs/Array.h"
#include "ButtonState.h"
#define EHS_HID_UNKNOWN 0

View File

@@ -1,7 +1,7 @@
#pragma once
#include "Array.h"
#include "Serializer.h"
#include "ehs/Array.h"
#include "ehs/Serializer.h"
#include "InputHandler.h"
namespace ehs

View File

@@ -1,6 +1,6 @@
#pragma once
#include "Array.h"
#include "ehs/Array.h"
#include "HID.h"
namespace ehs

View File

@@ -1,6 +1,6 @@
#pragma once
#include "Types.h"
#include "ehs/Types.h"
#include "Button.h"
#include "HID.h"

View File

@@ -1,7 +1,7 @@
#pragma once
#include "Types.h"
#include "Vec2.h"
#include "ehs/Types.h"
#include "ehs/Vec2.h"
#include "Button.h"
#include "HID.h"

View File

@@ -1,8 +1,8 @@
#pragma once
#include "Types.h"
#include "BaseObj.h"
#include "Str.h"
#include "ehs/Types.h"
#include "ehs/BaseObj.h"
#include "ehs/Str.h"
#include "ImgCodec.h"
namespace ehs

View File

@@ -1,8 +1,8 @@
#pragma once
#include "EHS.h"
#include "Str.h"
#include "io/File.h"
#include "ehs/EHS.h"
#include "ehs/Str.h"
#include "ehs/io/File.h"
namespace ehs
{

View File

@@ -1,7 +1,7 @@
#pragma once
#include "EHS.h"
#include "Serializer.h"
#include "ehs/EHS.h"
#include "ehs/Serializer.h"
#include "PNG_Chunk.h"
#include "Img.h"

View File

@@ -1,8 +1,8 @@
#pragma once
#include "EHS.h"
#include "Str.h"
#include "Serializer.h"
#include "ehs/EHS.h"
#include "ehs/Str.h"
#include "ehs/Serializer.h"
namespace ehs
{

View File

@@ -1,7 +1,7 @@
#pragma once
#include "EHS.h"
#include "Array.h"
#include "ehs/EHS.h"
#include "ehs/Array.h"
#include "KeyFrame.h"
namespace ehs

View File

@@ -1,8 +1,8 @@
#pragma once
#include "EHS.h"
#include "Str.h"
#include "Array.h"
#include "ehs/EHS.h"
#include "ehs/Str.h"
#include "ehs/Array.h"
#include "AnimBone.h"
namespace ehs

View File

@@ -1,8 +1,8 @@
#pragma once
#include "EHS.h"
#include "Quat.h"
#include "Mat4.h"
#include "ehs/EHS.h"
#include "ehs/Quat.h"
#include "ehs/Mat4.h"
namespace ehs
{

View File

@@ -1,10 +1,10 @@
#pragma once
#include "EHS.h"
#include "Array.h"
#include "Vec3.h"
#include "Quat.h"
#include "Mat4.h"
#include "ehs/EHS.h"
#include "ehs/Array.h"
#include "ehs/Vec3.h"
#include "ehs/Quat.h"
#include "ehs/Mat4.h"
#include "PropertyChange.h"
namespace ehs

View File

@@ -1,9 +1,9 @@
#pragma once
#include "EHS.h"
#include "Array.h"
#include "ehs/EHS.h"
#include "ehs/Array.h"
#include "Vertex.h"
#include "BaseObj.h"
#include "ehs/BaseObj.h"
namespace ehs
{
@@ -72,7 +72,7 @@ namespace ehs
void SetVertices(const Array<Vertex_f>& newVertices);
Array<Vertex_f> GetVertices() const;
const Array<Vertex_f>& GetVertices() const;
Array<Vertex_f>& GetVertices();
@@ -80,7 +80,7 @@ namespace ehs
bool HasIndices() const;
Array<UInt_32> GetIndices() const;
const Array<UInt_32>& GetIndices() const;
Array<UInt_32>& GetIndices();

View File

@@ -1,8 +1,8 @@
#pragma once
#include "EHS.h"
#include "Array.h"
#include "io/File.h"
#include "ehs/EHS.h"
#include "ehs/Array.h"
#include "ehs/io/File.h"
#include "Mesh.h"
#include "Bone.h"
#include "Animation.h"

View File

@@ -1,6 +1,6 @@
#pragma once
#include "EHS.h"
#include "ehs/EHS.h"
namespace ehs
{

View File

@@ -1,10 +1,10 @@
#pragma once
#include "EHS.h"
#include "Vec4.h"
#include "Vec3.h"
#include "Vec2.h"
#include "Color4.h"
#include "ehs/EHS.h"
#include "ehs/Vec4.h"
#include "ehs/Vec3.h"
#include "ehs/Vec2.h"
#include "ehs/Color4.h"
namespace ehs
{

View File

@@ -1,7 +1,7 @@
#pragma once
#include "EHS.h"
#include "Str.h"
#include "ehs/EHS.h"
#include "ehs/Str.h"
#include "Request.h"
#include "Response.h"

View File

@@ -1,7 +1,7 @@
#pragma once
#include "EHS.h"
#include "Str.h"
#include "ehs/EHS.h"
#include "ehs/Str.h"
#include "Socket.h"
namespace ehs

View File

@@ -1,11 +1,11 @@
#pragma once
#include "EHS.h"
#include "Log.h"
#include "BaseObj.h"
#include "Serializer.h"
#include "Vector.h"
#include "Array.h"
#include "ehs/EHS.h"
#include "ehs/Log.h"
#include "ehs/BaseObj.h"
#include "ehs/Serializer.h"
#include "ehs/Vector.h"
#include "ehs/Array.h"
#include "Socket.h"
#include "UDP.h"

View File

@@ -1,9 +1,9 @@
#pragma once
#include "EHS.h"
#include "Str.h"
#include "Array.h"
#include "Serializer.h"
#include "ehs/EHS.h"
#include "ehs/Str.h"
#include "ehs/Array.h"
#include "ehs/Serializer.h"
namespace ehs
{

View File

@@ -1,7 +1,7 @@
#pragma once
#include "EHS.h"
#include "Str.h"
#include "ehs/EHS.h"
#include "ehs/Str.h"
#include "Socket.h"
namespace ehs

View File

@@ -1,11 +1,11 @@
#pragma once
#include "EHS.h"
#include "Str.h"
#include "BaseObj.h"
#include "Vector.h"
#include "Serializer.h"
#include "io/socket/Socket.h"
#include "ehs/EHS.h"
#include "ehs/Str.h"
#include "ehs/BaseObj.h"
#include "ehs/Vector.h"
#include "ehs/Serializer.h"
#include "Socket.h"
#include "Utils.h"
#include "Fragments.h"

View File

@@ -1,7 +1,7 @@
#pragma once
#include "EHS.h"
#include "Serializer.h"
#include "ehs/EHS.h"
#include "ehs/Serializer.h"
#include "Utils.h"

View File

@@ -1,8 +1,8 @@
#pragma once
#include "EHS.h"
#include "Str.h"
#include "Serializer.h"
#include "ehs/EHS.h"
#include "ehs/Str.h"
#include "ehs/Serializer.h"
namespace ehs
{

View File

@@ -1,9 +1,9 @@
#pragma once
#include "EHS.h"
#include "Vector.h"
#include "Str.h"
#include "json/Json.h"
#include "ehs/EHS.h"
#include "ehs/Vector.h"
#include "ehs/Str.h"
#include "ehs/json/Json.h"
#include "Socket.h"
namespace ehs

View File

@@ -1,9 +1,9 @@
#pragma once
#include "EHS.h"
#include "Vector.h"
#include "Str.h"
#include "json/Json.h"
#include "ehs/EHS.h"
#include "ehs/Vector.h"
#include "ehs/Str.h"
#include "ehs/json/Json.h"
#include "Socket.h"
namespace ehs

View File

@@ -1,7 +1,7 @@
#pragma once
#include "EHS.h"
#include "Str.h"
#include "ehs/EHS.h"
#include "ehs/Str.h"
#include "TCP.h"
#include "Request.h"
#include "Response.h"

Some files were not shown because too many files have changed in this diff Show More