Skip to content

Commit 27e31ee

Browse files
committed
Update coding style
1 parent 7323fb3 commit 27e31ee

File tree

7 files changed

+31
-28
lines changed

7 files changed

+31
-28
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cmake_minimum_required(VERSION 3.11)
22
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
33
project (raylib_cpp
4-
VERSION 4.2.3
4+
VERSION 4.2.4
55
DESCRIPTION "raylib-cpp C++ Object Oriented Wrapper for raylib"
66
HOMEPAGE_URL "https://github.com/robloach/raylib-cpp"
77
LANGUAGES C CXX)

include/BoundingBox.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@ namespace raylib {
99
* Bounding box type
1010
*/
1111
class BoundingBox : public ::BoundingBox {
12-
public:
12+
public:
1313
/*
1414
* Set the bounding box to default: min (0, 0, 0) and max (0, 0, 0).
1515
*/
16-
BoundingBox() {
17-
set(::Vector3{ 0, 0, 0 }, ::Vector3{ 0, 0, 0 });
16+
BoundingBox() : ::BoundingBox{::Vector3{0, 0, 0}, ::Vector3{ 0, 0, 0 }} {
17+
// Nothing.
1818
}
1919

2020
/*
2121
* Copy a bounding box from another bounding box.
2222
*/
23-
BoundingBox(const ::BoundingBox& box) {
24-
set(box);
23+
BoundingBox(const ::BoundingBox& box) : ::BoundingBox{box.min, box.max} {
24+
// Nothing.
2525
}
2626

2727
/**
@@ -78,7 +78,7 @@ class BoundingBox : public ::BoundingBox {
7878
return GetRayCollisionBox(ray, *this);
7979
}
8080

81-
private:
81+
private:
8282
void set(const ::BoundingBox& box) {
8383
min = box.min;
8484
max = box.max;

include/Image.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ class Image : public ::Image {
1818
Image(void* data = nullptr,
1919
int width = 0,
2020
int height = 0,
21-
int mipmaps = 0,
22-
int format = 0) : ::Image{data, width, height, mipmaps, format} {
21+
int mipmaps = 1,
22+
int format = PIXELFORMAT_UNCOMPRESSED_R8G8B8A8) : ::Image{data, width, height, mipmaps, format} {
2323
// Nothing.
2424
}
2525

include/Model.hpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ namespace raylib {
1313
* Model type
1414
*/
1515
class Model : public ::Model {
16-
public:
16+
public:
1717
Model() {
18+
// Nothing.
1819
}
1920

2021
/*
@@ -47,12 +48,12 @@ class Model : public ::Model {
4748
Model(Model&& other) {
4849
set(other);
4950

50-
other.bones = nullptr;
51-
other.boneCount = 0;
5251
other.materials = nullptr;
5352
other.materialCount = 0;
5453
other.meshes = nullptr;
5554
other.meshCount = 0;
55+
other.bones = nullptr;
56+
other.boneCount = 0;
5657
other.bindPose = nullptr;
5758
}
5859

@@ -234,7 +235,7 @@ class Model : public ::Model {
234235
return IsReady();
235236
}
236237

237-
private:
238+
private:
238239
void set(const ::Model& model) {
239240
transform = model.transform;
240241

include/Texture.hpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,21 @@ namespace raylib {
1414
* Texture type
1515
*/
1616
class Texture : public ::Texture {
17-
public:
17+
public:
1818
/**
1919
* Default texture constructor.
2020
*/
21-
Texture() {
22-
set(::Texture{0, 0, 0, 0, 0});
21+
Texture() : ::Texture{0, 0, 0, 0, 0} {
22+
// Nothing.
2323
}
24-
25-
/**
24+
25+
/**
2626
* Move/Create a texture structure manually.
2727
*/
28-
Texture(unsigned int id, int width, int height, int mipmaps, int format) {
29-
set(::Texture{id, width, height, mipmaps, format});
28+
Texture(unsigned int id, int width, int height,
29+
int mipmaps = 1, int format = PIXELFORMAT_UNCOMPRESSED_R8G8B8A8)
30+
: ::Texture{id, width, height, mipmaps, format} {
31+
// Nothing.
3032
}
3133

3234
/**
@@ -309,7 +311,7 @@ class Texture : public ::Texture {
309311
return id != 0;
310312
}
311313

312-
private:
314+
private:
313315
void set(const ::Texture& texture) {
314316
id = texture.id;
315317
width = texture.width;

include/Window.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ namespace raylib {
1111
* Window and Graphics Device Functions.
1212
*/
1313
class Window {
14-
public:
15-
Window() {
16-
// need to create it manually with Init().
17-
}
18-
14+
public:
15+
Window() {
16+
// need to create it manually with Init().
17+
}
18+
1919
/**
2020
* Initialize window and OpenGL context.
2121
*/
@@ -38,7 +38,7 @@ class Window {
3838
*/
3939
void Init(int width = 800, int height = 450, const std::string& title = "raylib") {
4040
::InitWindow(width, height, title.c_str());
41-
if (!IsWindowReady()) {
41+
if (!IsWindowReady()) {
4242
throw RaylibException("Failed to create Window");
4343
}
4444
}

include/raymath.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ extern "C" {
1212
#define RAYMATH_STATIC_INLINE
1313
#endif
1414
#ifdef __GNUC__
15-
#pragma GCC diagnostic push // these throw a warning on visual studio, need to check if __GNUC__ is defined to use it.
15+
#pragma GCC diagnostic push // These throw a warnings on visual studio, need to check if __GNUC__ is defined to use it.
1616
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
1717
#endif
1818
#include "raymath.h" // NOLINT

0 commit comments

Comments
 (0)