Skip to content

Commit f865785

Browse files
committed
v5.0.1
1 parent 7f5f189 commit f865785

File tree

7 files changed

+47
-5
lines changed

7 files changed

+47
-5
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 5.0.0
4+
VERSION 5.0.1
55
DESCRIPTION "raylib-cpp C++ Object Oriented Wrapper for raylib"
66
HOMEPAGE_URL "https://github.com/robloach/raylib-cpp"
77
LANGUAGES C CXX

clib.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "raylib-cpp",
3-
"version": "5.0.0-alpha1",
3+
"version": "5.0.1",
44
"repo": "RobLoach/raylib-cpp",
55
"description": "raylib-cpp: C++ Object-Oriented Wrapper for raylib",
66
"homepage": "https://github.com/robloach/raylib-cpp",

examples/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ if (NOT raylib_FOUND)
1616
raylib
1717
GIT_REPOSITORY https://github.com/raysan5/raylib.git
1818
GIT_TAG ae50bfa2cc569c0f8d5bc4315d39db64005b1b08
19+
GIT_SHALLOW 1
1920
)
2021
FetchContent_GetProperties(raylib)
2122
if (NOT raylib_POPULATED) # Have we downloaded raylib yet?

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "raylib-cpp",
3-
"version": "5.0.0-alpha1",
3+
"version": "5.0.1",
44
"description": "raylib-cpp: C++ Object-Oriented Wrapper for raylib",
55
"main": "index.js",
66
"private": true,

projects/CMake/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ if (NOT raylib_FOUND)
99
raylib
1010
GIT_REPOSITORY https://github.com/raysan5/raylib.git
1111
GIT_TAG 5.0
12+
GIT_SHALLOW 1
1213
)
1314
FetchContent_MakeAvailable(raylib)
1415
endif()
@@ -20,7 +21,7 @@ if (NOT raylib_cpp_FOUND)
2021
FetchContent_Declare(
2122
raylib_cpp
2223
GIT_REPOSITORY https://github.com/RobLoach/raylib-cpp.git
23-
GIT_TAG v5.0.0
24+
GIT_TAG v5.0.1
2425
)
2526
FetchContent_MakeAvailable(raylib_cpp)
2627
endif()

tests/raylib-assert.h

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,19 @@ extern "C" {
188188
*/
189189
#define AssertColorSame(...) RAYLIB_ASSERT_VA_SELECT(AssertColorSame, __VA_ARGS__)
190190

191+
/**
192+
* Assert whether two Vector2s are the same.
193+
*
194+
* @param vector1 The first Vector2 to check.
195+
* @param vector2 The second Vector2 to check.
196+
* @param message (Optional) The message to provide on failed assertions.
197+
* @param p1 (Optional) The first parameter in the message.
198+
* @param p2 (Optional) The second parameter in the message.
199+
* @param p3 (Optional) The third parameter in the message.
200+
* @param p4 (Optional) The fourth parameter in the message.
201+
*/
202+
#define AssertVector2Same(...) RAYLIB_ASSERT_VA_SELECT(AssertVector2Same, __VA_ARGS__)
203+
191204
// Assert()
192205
#ifdef RAYLIB_ASSERT_NDEBUG
193206
#define Assert_0()
@@ -345,6 +358,31 @@ extern "C" {
345358
#define AssertColorSame_7(color1, color2, message, p1, p2, p3, p4) AssertColorSame_3(color1, color2, RAYLIB_ASSERT_TEXTFORMAT(message, p1, p2, p3, p4))
346359
#endif
347360

361+
// AssertVector2Same()
362+
#ifdef RAYLIB_ASSERT_NDEBUG
363+
#define AssertVector2Same_0()
364+
#define AssertVector2Same_1(vector)
365+
#define AssertVector2Same_2(vector1, vector2)
366+
#define AssertVector2Same_3(vector1, vector2, message)
367+
#define AssertVector2Same_4(vector1, vector2, message, p1)
368+
#define AssertVector2Same_5(vector1, vector2, message, p1, p2)
369+
#define AssertVector2Same_6(vector1, vector2, message, p1, p2, p3)
370+
#define AssertVector2Same_7(vector1, vector2, message, p1, p2, p3, p4)
371+
#else
372+
#define AssertVector2Same_0() AssertFail_1("Vectors not provided to AssertVector2Same()")
373+
#define AssertVector2Same_1(vector) AssertFail_1("Expected two vectors for AssertVector2Same()")
374+
#define AssertVector2Same_2(vector1, vector2) AssertVector2Same_5(vector1, vector2, "AssertVector2Same(%s, %s) - vectors do not match", #vector1, #vector2)
375+
#define AssertVector2Same_3(vector1, vector2, message) do { \
376+
if (vector1.x != vector2.x || vector1.y != vector2.y) { \
377+
AssertFail_1(message); \
378+
}\
379+
} while (0)
380+
#define AssertVector2Same_4(vector1, vector2, message, p1) AssertVector2Same_3(vector1, vector2, RAYLIB_ASSERT_TEXTFORMAT(message, p1))
381+
#define AssertVector2Same_5(vector1, vector2, message, p1, p2) AssertVector2Same_3(vector1, vector2, RAYLIB_ASSERT_TEXTFORMAT(message, p1, p2))
382+
#define AssertVector2Same_6(vector1, vector2, message, p1, p2, p3) AssertVector2Same_3(vector1, vector2, RAYLIB_ASSERT_TEXTFORMAT(message, p1, p2, p3))
383+
#define AssertVector2Same_7(vector1, vector2, message, p1, p2, p3, p4) AssertVector2Same_3(vector1, vector2, RAYLIB_ASSERT_TEXTFORMAT(message, p1, p2, p3, p4))
384+
#endif
385+
348386
#ifdef __cplusplus
349387
}
350388
#endif

tests/raylib_cpp_test.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,13 @@ int main(int argc, char *argv[]) {
2727
AssertEqual(position.x, 310);
2828
AssertEqual(raylib::Window::IsReady(), false);
2929

30-
raylib::Vector2 size{50,50};
30+
raylib::Vector2 size{50, 100};
3131
raylib::Vector2 halfsize = size / 2.0f;
3232

3333
AssertEqual(size.x, 50);
34+
AssertEqual(size.y, 100);
3435
AssertEqual(halfsize.x, 25);
36+
AssertEqual(halfsize.y, 50);
3537

3638
raylib::Vector2 doublesize = size * 2.0f;
3739
AssertEqual(size.x, 50);

0 commit comments

Comments
 (0)