From 6a2d12ce277b41b085778b132711842defe2090d Mon Sep 17 00:00:00 2001 From: Kamil Chojnowski Date: Thu, 10 Oct 2019 01:47:34 +0200 Subject: [PATCH] Add default copy constructors to Color and Position classes --- src/client/position.h | 2 ++ src/framework/util/color.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/client/position.h b/src/client/position.h index a8a49f0a..9dae7ed3 100644 --- a/src/client/position.h +++ b/src/client/position.h @@ -36,6 +36,8 @@ public: Position() : x(65535), y(65535), z(255) { } Position(uint16 x, uint16 y, uint8 z) : x(x), y(y), z(z) { } + Position(const Position &position) = default; + Position translatedToDirection(Otc::Direction direction) { Position pos = *this; switch(direction) { diff --git a/src/framework/util/color.h b/src/framework/util/color.h index c888d16e..882ad2c1 100644 --- a/src/framework/util/color.h +++ b/src/framework/util/color.h @@ -39,6 +39,8 @@ public: Color(float r, float g, float b, float a = 1.0f) : m_r(r), m_g(g), m_b(b), m_a(a) { } Color(const std::string& coltext); + Color(const Color &color) = default; + uint8 a() const { return m_a*255.0f; } uint8 b() const { return m_b*255.0f; } uint8 g() const { return m_g*255.0f; }