diff --git a/include/AudioStream.hpp b/include/AudioStream.hpp index 6991d97..c52f275 100644 --- a/include/AudioStream.hpp +++ b/include/AudioStream.hpp @@ -32,13 +32,6 @@ namespace raylib { Close(); } - inline void set(::AudioStream stream) { - sampleRate = stream.sampleRate; - sampleSize = stream.sampleSize; - channels = stream.channels; - buffer = stream.buffer; - } - GETTERSETTER(unsigned int,SampleRate,sampleRate) GETTERSETTER(unsigned int,SampleSize,sampleSize) GETTERSETTER(unsigned int,Channels,channels) @@ -139,6 +132,14 @@ namespace raylib { return *this; } + protected: + inline void set(::AudioStream stream) { + sampleRate = stream.sampleRate; + sampleSize = stream.sampleSize; + channels = stream.channels; + buffer = stream.buffer; + } + }; } diff --git a/include/BoundingBox.hpp b/include/BoundingBox.hpp index f910175..de0e234 100644 --- a/include/BoundingBox.hpp +++ b/include/BoundingBox.hpp @@ -24,10 +24,6 @@ namespace raylib { min = Min; max = Max; }; - inline void set(::BoundingBox box) { - min = box.min; - max = box.max; - } GETTERSETTER(::Vector3,Min,min) GETTERSETTER(::Vector3,Max,max) @@ -58,6 +54,12 @@ namespace raylib { inline bool CheckCollision(::Ray ray) { return CheckCollisionRayBox(ray, *this); } + + protected: + inline void set(::BoundingBox box) { + min = box.min; + max = box.max; + } }; } diff --git a/include/Camera2D.hpp b/include/Camera2D.hpp index 77c1305..15a3dca 100644 --- a/include/Camera2D.hpp +++ b/include/Camera2D.hpp @@ -22,20 +22,6 @@ namespace raylib { zoom = zoomValue; }; - inline void set(const ::Camera2D& camera) { - offset = camera.offset; - target = camera.target; - rotation = camera.rotation; - zoom = camera.zoom; - } - - inline void set(const Camera2D& camera) { - offset = camera.offset; - target = camera.target; - rotation = camera.rotation; - zoom = camera.zoom; - } - inline Camera2D& BeginMode2D() { ::BeginMode2D(*this); return *this; @@ -69,6 +55,20 @@ namespace raylib { inline Vector2 GetScreenToWorld2D(Vector2 position) { return ::GetScreenToWorld2D(position, *this); } + protected: + inline void set(const ::Camera2D& camera) { + offset = camera.offset; + target = camera.target; + rotation = camera.rotation; + zoom = camera.zoom; + } + + inline void set(const Camera2D& camera) { + offset = camera.offset; + target = camera.target; + rotation = camera.rotation; + zoom = camera.zoom; + } }; } diff --git a/include/Camera3D.hpp b/include/Camera3D.hpp index b8a8dd2..22cdf39 100644 --- a/include/Camera3D.hpp +++ b/include/Camera3D.hpp @@ -41,22 +41,6 @@ namespace raylib { return *this; } - inline void set(const ::Camera3D& camera) { - position = camera.position; - target = camera.target; - up = camera.up; - fovy = camera.fovy; - type = camera.type; - } - - inline void set(const Camera3D& camera) { - position = camera.position; - target = camera.target; - up = camera.up; - fovy = camera.fovy; - type = camera.type; - } - Camera3D& BeginMode3D() { ::BeginMode3D(*this); return *this; @@ -117,6 +101,23 @@ namespace raylib { ::DrawBillboardRec(*this, texture, sourceRec, center, size, tint); return *this; } + + protected: + inline void set(const ::Camera3D& camera) { + position = camera.position; + target = camera.target; + up = camera.up; + fovy = camera.fovy; + type = camera.type; + } + + inline void set(const Camera3D& camera) { + position = camera.position; + target = camera.target; + up = camera.up; + fovy = camera.fovy; + type = camera.type; + } }; typedef Camera3D Camera; diff --git a/include/Color.hpp b/include/Color.hpp index 1430a7b..603fc61 100644 --- a/include/Color.hpp +++ b/include/Color.hpp @@ -49,20 +49,6 @@ namespace raylib { set(::ColorFromNormalized(normalized)); } - inline void set(const ::Color& color) { - r = color.r; - g = color.g; - b = color.b; - a = color.a; - } - - inline void set(const Color& color) { - r = color.r; - g = color.g; - b = color.b; - a = color.a; - } - static Color LightGray; static Color Gray; static Color DarkGray; @@ -205,6 +191,21 @@ namespace raylib { return *this; } + protected: + inline void set(const ::Color& color) { + r = color.r; + g = color.g; + b = color.b; + a = color.a; + } + + inline void set(const Color& color) { + r = color.r; + g = color.g; + b = color.b; + a = color.a; + } + }; inline Color Color::LightGray = ::LIGHTGRAY; diff --git a/include/Font.hpp b/include/Font.hpp index 975e37d..8acb512 100644 --- a/include/Font.hpp +++ b/include/Font.hpp @@ -44,22 +44,6 @@ namespace raylib { UnloadFont(*this); } - void set(const ::Font font) { - baseSize = font.baseSize; - charsCount = font.charsCount; - texture = font.texture; - recs = font.recs; - chars = font.chars; - } - - void set(const Font& font) { - baseSize = font.baseSize; - charsCount = font.charsCount; - texture = font.texture; - recs = font.recs; - chars = font.chars; - } - GETTERSETTER(int,BaseSize,baseSize) GETTERSETTER(int,CharsCount,charsCount) GETTERSETTER(Texture2D,Texture,texture) @@ -96,6 +80,23 @@ namespace raylib { inline int GetGlyphIndex(int character) { return ::GetGlyphIndex(*this, character); } + + protected: + void set(const ::Font font) { + baseSize = font.baseSize; + charsCount = font.charsCount; + texture = font.texture; + recs = font.recs; + chars = font.chars; + } + + void set(const Font& font) { + baseSize = font.baseSize; + charsCount = font.charsCount; + texture = font.texture; + recs = font.recs; + chars = font.chars; + } }; } diff --git a/include/Gamepad.hpp b/include/Gamepad.hpp index 9b00611..14bd8db 100644 --- a/include/Gamepad.hpp +++ b/include/Gamepad.hpp @@ -21,10 +21,6 @@ namespace raylib { } int number; - inline void set(int gamepadNumber) { - number = gamepadNumber; - } - GETTERSETTER(int,Number,number) Gamepad& operator=(const Gamepad& gamepad) { @@ -32,6 +28,11 @@ namespace raylib { return *this; } + Gamepad& operator=(int gamepadNumber) { + set(gamepadNumber); + return *this; + } + operator int() const { return number; } inline bool IsAvailable() { @@ -69,6 +70,11 @@ namespace raylib { inline float GetAxisMovement(int axis) { return ::GetGamepadAxisMovement(number, axis); } + + protected: + inline void set(int gamepadNumber) { + number = gamepadNumber; + } }; } diff --git a/include/Image.hpp b/include/Image.hpp index 859d4df..a8a79e9 100644 --- a/include/Image.hpp +++ b/include/Image.hpp @@ -93,14 +93,6 @@ namespace raylib { return *this; } - inline void set(::Image image) { - data = image.data; - width = image.width; - height = image.height; - mipmaps = image.mipmaps; - format = image.format; - } - void Load(const std::string& fileName) { set(::LoadImage(fileName.c_str())); } @@ -329,6 +321,15 @@ namespace raylib { inline operator Texture2D() { return ::LoadTextureFromImage(*this); } + + protected: + inline void set(::Image image) { + data = image.data; + width = image.width; + height = image.height; + mipmaps = image.mipmaps; + format = image.format; + } }; } diff --git a/include/Material.hpp b/include/Material.hpp index 22ad699..a422957 100644 --- a/include/Material.hpp +++ b/include/Material.hpp @@ -26,12 +26,6 @@ namespace raylib { Unload(); } - inline void set(::Material material) { - shader = material.shader; - maps = material.maps; - params = material.params; - } - GETTERSETTER(::Shader,Shader,shader) Material& operator=(const ::Material& material) { @@ -53,6 +47,13 @@ namespace raylib { return *this; } + protected: + inline void set(::Material material) { + shader = material.shader; + maps = material.maps; + params = material.params; + } + }; } diff --git a/include/Matrix.hpp b/include/Matrix.hpp index 3b54aab..daa2774 100644 --- a/include/Matrix.hpp +++ b/include/Matrix.hpp @@ -43,25 +43,6 @@ namespace raylib { m15 = M15; }; - inline void set(::Matrix mat) { - m0 = mat.m0; - m1 = mat.m1; - m2 = mat.m2; - m3 = mat.m3; - m4 = mat.m4; - m5 = mat.m5; - m6 = mat.m6; - m7 = mat.m7; - m8 = mat.m8; - m9 = mat.m9; - m10 = mat.m10; - m11 = mat.m11; - m12 = mat.m12; - m13 = mat.m13; - m14 = mat.m14; - m15 = mat.m15; - } - GETTERSETTER(float,M0,m0) GETTERSETTER(float,M1,m1) GETTERSETTER(float,M2,m2) @@ -205,6 +186,27 @@ namespace raylib { return ToFloatV(); } #endif + protected: + + + inline void set(::Matrix mat) { + m0 = mat.m0; + m1 = mat.m1; + m2 = mat.m2; + m3 = mat.m3; + m4 = mat.m4; + m5 = mat.m5; + m6 = mat.m6; + m7 = mat.m7; + m8 = mat.m8; + m9 = mat.m9; + m10 = mat.m10; + m11 = mat.m11; + m12 = mat.m12; + m13 = mat.m13; + m14 = mat.m14; + m15 = mat.m15; + } }; } diff --git a/include/Mesh.hpp b/include/Mesh.hpp index 64d09b1..9db1ffd 100644 --- a/include/Mesh.hpp +++ b/include/Mesh.hpp @@ -26,24 +26,6 @@ namespace raylib { triangleCount = TriangleCount; }; - inline void set(::Mesh mesh) { - vertexCount = mesh.vertexCount; - triangleCount = mesh.triangleCount; - vertices = mesh.vertices; - texcoords = mesh.texcoords; - texcoords2 = mesh.texcoords2; - normals = mesh.normals; - tangents = mesh.tangents; - colors = mesh.colors; - indices = mesh.indices; - animVertices = mesh.animVertices; - animNormals = mesh.animNormals; - boneIds = mesh.boneIds; - boneWeights = mesh.boneWeights; - vaoId = mesh.vaoId; - vboId = mesh.vboId; - } - GETTERSETTER(int,VertexCount,vertexCount) GETTERSETTER(int,TriangleCount,triangleCount) @@ -98,6 +80,25 @@ namespace raylib { operator raylib::Model() { return LoadModelFrom(); } + + protected: + inline void set(::Mesh mesh) { + vertexCount = mesh.vertexCount; + triangleCount = mesh.triangleCount; + vertices = mesh.vertices; + texcoords = mesh.texcoords; + texcoords2 = mesh.texcoords2; + normals = mesh.normals; + tangents = mesh.tangents; + colors = mesh.colors; + indices = mesh.indices; + animVertices = mesh.animVertices; + animNormals = mesh.animNormals; + boneIds = mesh.boneIds; + boneWeights = mesh.boneWeights; + vaoId = mesh.vaoId; + vboId = mesh.vboId; + } }; } diff --git a/include/Model.hpp b/include/Model.hpp index 1e589d5..43f96d6 100644 --- a/include/Model.hpp +++ b/include/Model.hpp @@ -31,20 +31,6 @@ namespace raylib { Unload(); } - inline void set(::Model model) { - transform = model.transform; - - meshCount = model.meshCount; - meshes = model.meshes; - - materialCount = model.materialCount; - materials = model.materials; - meshMaterial = model.meshMaterial; - boneCount = model.boneCount; - bones = model.bones; - bindPose = model.bindPose; - } - GETTERSETTER(::Matrix,Transform,transform) GETTERSETTER(int,MeshCount,meshCount) GETTERSETTER(int,MaterialCount,materialCount) @@ -80,6 +66,21 @@ namespace raylib { inline bool IsModelAnimationValid(::ModelAnimation anim) { return ::IsModelAnimationValid(*this, anim); } + + protected: + inline void set(::Model model) { + transform = model.transform; + + meshCount = model.meshCount; + meshes = model.meshes; + + materialCount = model.materialCount; + materials = model.materials; + meshMaterial = model.meshMaterial; + boneCount = model.boneCount; + bones = model.bones; + bindPose = model.bindPose; + } }; } diff --git a/include/ModelAnimation.hpp b/include/ModelAnimation.hpp index db261af..16c4c55 100644 --- a/include/ModelAnimation.hpp +++ b/include/ModelAnimation.hpp @@ -23,13 +23,6 @@ namespace raylib { Unload(); } - inline void set(::ModelAnimation model) { - boneCount = model.boneCount; - bones = model.bones; - frameCount = model.frameCount; - framePoses = model.framePoses; - } - GETTERSETTER(int,BoneCount,boneCount) GETTERSETTER(::BoneInfo*,Bones,bones) GETTERSETTER(int,FrameCount,frameCount) @@ -61,6 +54,14 @@ namespace raylib { inline bool IsModelAnimationValid(::Model model) { return ::IsModelAnimationValid(model, *this); } + + protected: + inline void set(::ModelAnimation model) { + boneCount = model.boneCount; + bones = model.bones; + frameCount = model.frameCount; + framePoses = model.framePoses; + } }; } diff --git a/include/Music.hpp b/include/Music.hpp index e4191c7..ca09105 100644 --- a/include/Music.hpp +++ b/include/Music.hpp @@ -26,14 +26,6 @@ namespace raylib { Unload(); } - inline void set(::Music music) { - ctxType = music.ctxType; - ctxData = music.ctxData; - looping = music.looping; - sampleCount = music.sampleCount; - stream = music.stream; - } - GETTERSETTER(int,CtxType,ctxType) GETTERSETTER(bool,Looping,looping) GETTERSETTER(unsigned int,SampleCount,sampleCount) @@ -93,7 +85,14 @@ namespace raylib { return ::GetMusicTimePlayed(*this); } - + protected: + inline void set(::Music music) { + ctxType = music.ctxType; + ctxData = music.ctxData; + looping = music.looping; + sampleCount = music.sampleCount; + stream = music.stream; + } }; } diff --git a/include/Ray.hpp b/include/Ray.hpp index 1a5cf18..bc4e30d 100644 --- a/include/Ray.hpp +++ b/include/Ray.hpp @@ -29,11 +29,6 @@ namespace raylib { set(GetMouseRay(mousePosition, camera)); } - inline void set(::Ray ray) { - position = ray.position; - direction = ray.direction; - } - Ray& operator=(const ::Ray& ray) { set(ray); return *this; @@ -75,6 +70,12 @@ namespace raylib { inline RayHitInfo GetCollisionGround(float groundHeight) { return GetCollisionRayGround(*this, groundHeight); } + + protected: + inline void set(::Ray ray) { + position = ray.position; + direction = ray.direction; + } }; } diff --git a/include/RayHitInfo.hpp b/include/RayHitInfo.hpp index f3e1584..291220f 100644 --- a/include/RayHitInfo.hpp +++ b/include/RayHitInfo.hpp @@ -35,17 +35,18 @@ namespace raylib { return *this; } + GETTERSETTER(bool,Hit,hit) + GETTERSETTER(float,Distance,distance) + GETTERSETTER(::Vector3,Position,position) + GETTERSETTER(::Vector3,Normal,normal) + + protected: inline void set(::RayHitInfo ray) { hit = ray.hit; distance = ray.distance; position = ray.position; normal = ray.normal; } - - GETTERSETTER(bool,Hit,hit) - GETTERSETTER(float,Distance,distance) - GETTERSETTER(::Vector3,Position,position) - GETTERSETTER(::Vector3,Normal,normal) }; } diff --git a/include/Rectangle.hpp b/include/Rectangle.hpp index 7c6b822..ebb62da 100644 --- a/include/Rectangle.hpp +++ b/include/Rectangle.hpp @@ -25,13 +25,6 @@ namespace raylib { height = Height; }; - inline void set(::Rectangle rect) { - x = rect.x; - y = rect.y; - width = rect.width; - height = rect.height; - } - GETTERSETTER(float,X,x) GETTERSETTER(float,Y,y) GETTERSETTER(float,Width,width) @@ -101,6 +94,14 @@ namespace raylib { inline bool CheckCollision(::Vector2 point) { return ::CheckCollisionPointRec(point, *this); } + + protected: + inline void set(::Rectangle rect) { + x = rect.x; + y = rect.y; + width = rect.width; + height = rect.height; + } }; } diff --git a/include/RenderTexture2D.hpp b/include/RenderTexture2D.hpp index 566d545..686a0a4 100644 --- a/include/RenderTexture2D.hpp +++ b/include/RenderTexture2D.hpp @@ -24,12 +24,6 @@ namespace raylib { set(LoadRenderTexture(width, height)); } - inline void set(::RenderTexture2D renderTexture) { - id = renderTexture.id; - texture = renderTexture.texture; - depth = renderTexture.depth; - } - GETTERSETTER(unsigned int,Id,id) GETTERSETTER(Texture2D,Texture,texture) GETTERSETTER(Texture2D,Depth,depth) @@ -61,6 +55,13 @@ namespace raylib { ::EndTextureMode(); return *this; } + + protected: + inline void set(::RenderTexture2D renderTexture) { + id = renderTexture.id; + texture = renderTexture.texture; + depth = renderTexture.depth; + } }; typedef RenderTexture2D RenderTexture; } diff --git a/include/Shader.hpp b/include/Shader.hpp index d48e036..7bc3949 100644 --- a/include/Shader.hpp +++ b/include/Shader.hpp @@ -27,11 +27,6 @@ namespace raylib { set(GetShaderDefault()); } - inline void set(::Shader shader) { - id = shader.id; - locs = shader.locs; - } - GETTERSETTER(unsigned int,Id,id) GETTERSETTER(int*,Locs,locs) @@ -75,6 +70,12 @@ namespace raylib { inline int GetLocation(const std::string& uniformName) { return ::GetShaderLocation(*this, uniformName.c_str()); } + + protected: + inline void set(::Shader shader) { + id = shader.id; + locs = shader.locs; + } }; } diff --git a/include/Sound.hpp b/include/Sound.hpp index 51b1cfc..11d6342 100644 --- a/include/Sound.hpp +++ b/include/Sound.hpp @@ -32,11 +32,6 @@ namespace raylib { Unload(); } - inline void set(::Sound sound) { - sampleCount = sound.sampleCount; - stream = sound.stream; - } - GETTERSETTER(unsigned int,SampleCount,sampleCount) GETTERSETTER(::AudioStream,Stream,stream) @@ -99,6 +94,11 @@ namespace raylib { return *this; } + protected: + inline void set(::Sound sound) { + sampleCount = sound.sampleCount; + stream = sound.stream; + } }; } diff --git a/include/Texture2D.hpp b/include/Texture2D.hpp index 25c6246..46deb86 100644 --- a/include/Texture2D.hpp +++ b/include/Texture2D.hpp @@ -34,14 +34,6 @@ namespace raylib { Unload(); }; - inline void set(::Texture2D texture) { - id = texture.id; - width = texture.width; - height = texture.height; - mipmaps = texture.mipmaps; - format = texture.format; - } - GETTERSETTER(unsigned int,Id,id) GETTERSETTER(int,Width,width) GETTERSETTER(int,Height,height) @@ -155,6 +147,15 @@ namespace raylib { static int GetPixelDataSize(int width, int height, int format) { return ::GetPixelDataSize(width, height, format); } + + protected: + inline void set(::Texture2D texture) { + id = texture.id; + width = texture.width; + height = texture.height; + mipmaps = texture.mipmaps; + format = texture.format; + } }; // Create the Texture2D aliases. diff --git a/include/Vector2.hpp b/include/Vector2.hpp index 1b5cc8d..0b197a0 100644 --- a/include/Vector2.hpp +++ b/include/Vector2.hpp @@ -28,10 +28,6 @@ namespace raylib { x = X; y = Y; }; - inline void set(::Vector2 vec) { - x = vec.x; - y = vec.y; - } GETTERSETTER(float,X,x) GETTERSETTER(float,Y,y) @@ -227,6 +223,12 @@ namespace raylib { ::DrawPoly(*this, sides, radius, rotation, color); return *this; } + + protected: + inline void set(::Vector2 vec) { + x = vec.x; + y = vec.y; + } }; } diff --git a/include/Vector3.hpp b/include/Vector3.hpp index 5ffc6dd..f124a2c 100644 --- a/include/Vector3.hpp +++ b/include/Vector3.hpp @@ -32,11 +32,6 @@ namespace raylib { Vector3(::Color color) { set(ColorToHSV(color)); } - inline void set(::Vector3 vec) { - x = vec.x; - y = vec.y; - z = vec.z; - } GETTERSETTER(float,X,x) GETTERSETTER(float,Y,y) @@ -299,6 +294,13 @@ namespace raylib { inline bool CheckCollision(float radiusA, Vector3 centerB, float radiusB) { return CheckCollisionSpheres(*this, radiusA, centerB, radiusB); } + + protected: + inline void set(::Vector3 vec) { + x = vec.x; + y = vec.y; + z = vec.z; + } }; } diff --git a/include/Vector4.hpp b/include/Vector4.hpp index 3a3946c..a1f3bf2 100644 --- a/include/Vector4.hpp +++ b/include/Vector4.hpp @@ -35,13 +35,6 @@ namespace raylib { set(ColorNormalize(color)); } - inline void set(::Vector4 vec4) { - x = vec4.x; - y = vec4.y; - z = vec4.z; - w = vec4.w; - } - GETTERSETTER(float,X,x) GETTERSETTER(float,Y,y) GETTERSETTER(float,Z,z) @@ -152,6 +145,14 @@ namespace raylib { inline Color ColorFromNormalized() { return ::ColorFromNormalized(*this); } + + protected: + inline void set(::Vector4 vec4) { + x = vec4.x; + y = vec4.y; + z = vec4.z; + w = vec4.w; + } }; // Alias the Vector4 as Quaternion. diff --git a/include/Wave.hpp b/include/Wave.hpp index b7ed9a8..08e82f5 100644 --- a/include/Wave.hpp +++ b/include/Wave.hpp @@ -33,14 +33,6 @@ namespace raylib { Unload(); } - inline void set(::Wave wave) { - sampleCount = wave.sampleCount; - sampleRate = wave.sampleRate; - sampleSize = wave.sampleSize; - channels = wave.channels; - data = wave.data; - } - GETTERSETTER(unsigned int, SampleCount, sampleCount) GETTERSETTER(unsigned int, SampleRate, sampleRate) GETTERSETTER(unsigned int, SampleSize, sampleSize) @@ -94,6 +86,15 @@ namespace raylib { inline float* GetWaveData() { return ::GetWaveData(*this); } + + protected: + inline void set(::Wave wave) { + sampleCount = wave.sampleCount; + sampleRate = wave.sampleRate; + sampleSize = wave.sampleSize; + channels = wave.channels; + data = wave.data; + } }; }