Skip to content

Commit

Permalink
v5.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
RobLoach committed Jan 22, 2024
1 parent 7f5f189 commit f865785
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.11)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
project (raylib_cpp
VERSION 5.0.0
VERSION 5.0.1
DESCRIPTION "raylib-cpp C++ Object Oriented Wrapper for raylib"
HOMEPAGE_URL "https://github.com/robloach/raylib-cpp"
LANGUAGES C CXX
Expand Down
2 changes: 1 addition & 1 deletion clib.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "raylib-cpp",
"version": "5.0.0-alpha1",
"version": "5.0.1",
"repo": "RobLoach/raylib-cpp",
"description": "raylib-cpp: C++ Object-Oriented Wrapper for raylib",
"homepage": "https://github.com/robloach/raylib-cpp",
Expand Down
1 change: 1 addition & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ if (NOT raylib_FOUND)
raylib
GIT_REPOSITORY https://github.com/raysan5/raylib.git
GIT_TAG ae50bfa2cc569c0f8d5bc4315d39db64005b1b08
GIT_SHALLOW 1
)
FetchContent_GetProperties(raylib)
if (NOT raylib_POPULATED) # Have we downloaded raylib yet?
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "raylib-cpp",
"version": "5.0.0-alpha1",
"version": "5.0.1",
"description": "raylib-cpp: C++ Object-Oriented Wrapper for raylib",
"main": "index.js",
"private": true,
Expand Down
3 changes: 2 additions & 1 deletion projects/CMake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ if (NOT raylib_FOUND)
raylib
GIT_REPOSITORY https://github.com/raysan5/raylib.git
GIT_TAG 5.0
GIT_SHALLOW 1
)
FetchContent_MakeAvailable(raylib)
endif()
Expand All @@ -20,7 +21,7 @@ if (NOT raylib_cpp_FOUND)
FetchContent_Declare(
raylib_cpp
GIT_REPOSITORY https://github.com/RobLoach/raylib-cpp.git
GIT_TAG v5.0.0
GIT_TAG v5.0.1
)
FetchContent_MakeAvailable(raylib_cpp)
endif()
Expand Down
38 changes: 38 additions & 0 deletions tests/raylib-assert.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,19 @@ extern "C" {
*/
#define AssertColorSame(...) RAYLIB_ASSERT_VA_SELECT(AssertColorSame, __VA_ARGS__)

/**
* Assert whether two Vector2s are the same.
*
* @param vector1 The first Vector2 to check.
* @param vector2 The second Vector2 to check.
* @param message (Optional) The message to provide on failed assertions.
* @param p1 (Optional) The first parameter in the message.
* @param p2 (Optional) The second parameter in the message.
* @param p3 (Optional) The third parameter in the message.
* @param p4 (Optional) The fourth parameter in the message.
*/
#define AssertVector2Same(...) RAYLIB_ASSERT_VA_SELECT(AssertVector2Same, __VA_ARGS__)

// Assert()
#ifdef RAYLIB_ASSERT_NDEBUG
#define Assert_0()
Expand Down Expand Up @@ -345,6 +358,31 @@ extern "C" {
#define AssertColorSame_7(color1, color2, message, p1, p2, p3, p4) AssertColorSame_3(color1, color2, RAYLIB_ASSERT_TEXTFORMAT(message, p1, p2, p3, p4))
#endif

// AssertVector2Same()
#ifdef RAYLIB_ASSERT_NDEBUG
#define AssertVector2Same_0()
#define AssertVector2Same_1(vector)
#define AssertVector2Same_2(vector1, vector2)
#define AssertVector2Same_3(vector1, vector2, message)
#define AssertVector2Same_4(vector1, vector2, message, p1)
#define AssertVector2Same_5(vector1, vector2, message, p1, p2)
#define AssertVector2Same_6(vector1, vector2, message, p1, p2, p3)
#define AssertVector2Same_7(vector1, vector2, message, p1, p2, p3, p4)
#else
#define AssertVector2Same_0() AssertFail_1("Vectors not provided to AssertVector2Same()")
#define AssertVector2Same_1(vector) AssertFail_1("Expected two vectors for AssertVector2Same()")
#define AssertVector2Same_2(vector1, vector2) AssertVector2Same_5(vector1, vector2, "AssertVector2Same(%s, %s) - vectors do not match", #vector1, #vector2)
#define AssertVector2Same_3(vector1, vector2, message) do { \
if (vector1.x != vector2.x || vector1.y != vector2.y) { \
AssertFail_1(message); \
}\
} while (0)
#define AssertVector2Same_4(vector1, vector2, message, p1) AssertVector2Same_3(vector1, vector2, RAYLIB_ASSERT_TEXTFORMAT(message, p1))
#define AssertVector2Same_5(vector1, vector2, message, p1, p2) AssertVector2Same_3(vector1, vector2, RAYLIB_ASSERT_TEXTFORMAT(message, p1, p2))
#define AssertVector2Same_6(vector1, vector2, message, p1, p2, p3) AssertVector2Same_3(vector1, vector2, RAYLIB_ASSERT_TEXTFORMAT(message, p1, p2, p3))
#define AssertVector2Same_7(vector1, vector2, message, p1, p2, p3, p4) AssertVector2Same_3(vector1, vector2, RAYLIB_ASSERT_TEXTFORMAT(message, p1, p2, p3, p4))
#endif

#ifdef __cplusplus
}
#endif
Expand Down
4 changes: 3 additions & 1 deletion tests/raylib_cpp_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@ int main(int argc, char *argv[]) {
AssertEqual(position.x, 310);
AssertEqual(raylib::Window::IsReady(), false);

raylib::Vector2 size{50,50};
raylib::Vector2 size{50, 100};
raylib::Vector2 halfsize = size / 2.0f;

AssertEqual(size.x, 50);
AssertEqual(size.y, 100);
AssertEqual(halfsize.x, 25);
AssertEqual(halfsize.y, 50);

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

0 comments on commit f865785

Please sign in to comment.