From 04653742243e4bb6452108cfd0fef2f4afd8f23b Mon Sep 17 00:00:00 2001 From: rtk0c Date: Mon, 6 Sep 2021 00:15:35 -0700 Subject: Fix all compile errors, remove OperateIOProxy requirement from DataStream api --- core/src/Utils/Vector.hpp | 50 +++++++++++++++++++++++++++++++++-------------- 1 file changed, 35 insertions(+), 15 deletions(-) (limited to 'core/src/Utils/Vector.hpp') diff --git a/core/src/Utils/Vector.hpp b/core/src/Utils/Vector.hpp index 3d4d251..4d3f3b3 100644 --- a/core/src/Utils/Vector.hpp +++ b/core/src/Utils/Vector.hpp @@ -1,5 +1,7 @@ #pragma once +#include "Utils/IO/DataStream.hpp" + template struct Vec2 { @@ -15,11 +17,16 @@ struct Vec2 }; } - template - void OperateIOProxy(TProxy& proxy) + void ReadFromDataStream(InputDataStream& stream) { - proxy.Value(x); - proxy.Value(y); + stream.Value(x); + stream.Value(y); + } + + void WriteToDataStream(OutputDataStream& stream) const + { + stream.Value(x); + stream.Value(y); } friend constexpr bool operator==(const Vec2& a, const Vec2& b) = default; @@ -55,12 +62,18 @@ struct Vec3 }; } - template - void OperateIOProxy(TProxy& proxy) + void ReadFromDataStream(InputDataStream& stream) + { + stream.Value(x); + stream.Value(y); + stream.Value(z); + } + + void WriteToDataStream(OutputDataStream& stream) const { - proxy.Value(x); - proxy.Value(y); - proxy.Value(z); + stream.Value(x); + stream.Value(y); + stream.Value(z); } friend constexpr bool operator==(const Vec3& a, const Vec3& b) = default; @@ -98,13 +111,20 @@ struct Vec4 }; } - template - void OperateIOProxy(TProxy& proxy) + void ReadFromDataStream(InputDataStream& stream) + { + stream.Value(x); + stream.Value(y); + stream.Value(z); + stream.Value(w); + } + + void WriteToDataStream(OutputDataStream& stream) const { - proxy.Value(x); - proxy.Value(y); - proxy.Value(z); - proxy.Value(w); + stream.Value(x); + stream.Value(y); + stream.Value(z); + stream.Value(w); } friend constexpr bool operator==(const Vec4& a, const Vec4& b) = default; -- cgit v1.2.3-70-g09d2