Skip to content

Commit

Permalink
Move types from FS.hpp to Types.hpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Xottab-DUTY committed Nov 5, 2017
1 parent 74095a5 commit b8aa409
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 43 deletions.
55 changes: 55 additions & 0 deletions src/editors/xrManagedApi/core/Types.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#pragma once

#include "xrCore/xrCore.h"

namespace XRay
{
namespace ManagedApi
{
namespace Core
{
using namespace System;
using System::Runtime::InteropServices::OutAttribute;
using System::Runtime::InteropServices::StructLayoutAttribute;
using System::Runtime::InteropServices::LayoutKind;
using System::Runtime::InteropServices::FieldOffsetAttribute;

[StructLayout(LayoutKind::Sequential, Size = sizeof(Fcolor))] public value struct ColorF
{
public:
float r, g, b, a;
};

[StructLayout(LayoutKind::Sequential, Size = sizeof(Fvector2))] public value struct Vector2F
{
float x, y;
};

[StructLayout(LayoutKind::Sequential, Size = sizeof(Fvector3))] public value struct Vector3F
{
float x, y, z;
};

//[FieldOffset(offsetof(Fvector4, x))]
[StructLayout(LayoutKind::Sequential, Size = sizeof(Fvector4))] public value struct Vector4F
{
float x, y, z, w;
};

[StructLayout(LayoutKind::Sequential, Size = sizeof(Ivector2))] public value struct Vector2I
{
int x, y;
};

[StructLayout(LayoutKind::Sequential, Size = sizeof(Ivector3))] public value struct Vector3I
{
int x, y, z;
};

[StructLayout(LayoutKind::Sequential, Size = sizeof(Ivector4))] public value struct Vector4I
{
int x, y, z, w;
};
}
}
}
44 changes: 1 addition & 43 deletions src/editors/xrManagedApi/core/fs/FS.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,56 +2,14 @@ class IReader;
class IWriter;

#include "xrCore/xrCore.h"
#include "Core/Types.hpp"

namespace XRay
{
namespace ManagedApi
{
namespace Core
{
using namespace System;
using System::Runtime::InteropServices::OutAttribute;
using System::Runtime::InteropServices::StructLayoutAttribute;
using System::Runtime::InteropServices::LayoutKind;
using System::Runtime::InteropServices::FieldOffsetAttribute;

[StructLayout(LayoutKind::Sequential, Size = sizeof(Fcolor))] public value struct ColorF
{
public:
float r, g, b, a;
};

[StructLayout(LayoutKind::Sequential, Size = sizeof(Fvector2))] public value struct Vector2F
{
float x, y;
};

[StructLayout(LayoutKind::Sequential, Size = sizeof(Fvector3))] public value struct Vector3F
{
float x, y, z;
};

//[FieldOffset(offsetof(Fvector4, x))]
[StructLayout(LayoutKind::Sequential, Size = sizeof(Fvector4))] public value struct Vector4F
{
float x, y, z, w;
};

[StructLayout(LayoutKind::Sequential, Size = sizeof(Ivector2))] public value struct Vector2I
{
int x, y;
};

[StructLayout(LayoutKind::Sequential, Size = sizeof(Ivector3))] public value struct Vector3I
{
int x, y, z;
};

[StructLayout(LayoutKind::Sequential, Size = sizeof(Ivector4))] public value struct Vector4I
{
int x, y, z, w;
};

public
ref class WriterBase abstract
{
Expand Down
1 change: 1 addition & 0 deletions src/editors/xrManagedApi/xrManagedApi.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@
<ClInclude Include="core\Core.hpp" />
<ClInclude Include="core\fs\FS.hpp" />
<ClInclude Include="core\PostProcessAnimator.hpp" />
<ClInclude Include="core\Types.hpp" />
<ClInclude Include="Pch.hpp" />
</ItemGroup>
<ItemGroup>
Expand Down
3 changes: 3 additions & 0 deletions src/editors/xrManagedApi/xrManagedApi.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
<ClInclude Include="core\PostProcessAnimator.hpp">
<Filter>core</Filter>
</ClInclude>
<ClInclude Include="core\Types.hpp">
<Filter>core</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="AssemblyInfo.cpp" />
Expand Down

0 comments on commit b8aa409

Please sign in to comment.