diff --git a/examples/core/core_world_screen.cpp b/examples/core/core_world_screen.cpp index 62b2a97e..32666633 100644 --- a/examples/core/core_world_screen.cpp +++ b/examples/core/core_world_screen.cpp @@ -42,7 +42,7 @@ int main() { camera.Update(); // Update camera // Calculate cube screen space position (with a little offset to be in top) - cubeScreenPosition = GetWorldToScreen((Vector3){cubePosition.x, cubePosition.y + 2.5f, cubePosition.z}, camera); + cubeScreenPosition = GetWorldToScreen(Vector3{cubePosition.x, cubePosition.y + 2.5f, cubePosition.z}, camera); //---------------------------------------------------------------------------------- // Draw diff --git a/examples/models/models_first_person_maze.cpp b/examples/models/models_first_person_maze.cpp index dbac4bbb..d3b473f2 100644 --- a/examples/models/models_first_person_maze.cpp +++ b/examples/models/models_first_person_maze.cpp @@ -25,7 +25,7 @@ int main(void) raylib::Image imMap("resources/cubicmap.png"); // Load cubicmap image (RAM) raylib::Texture cubicmap(imMap); // Convert image to texture to display (VRAM) - Mesh mesh = raylib::Mesh::Cubicmap(imMap, (Vector3){ 1.0f, 1.0f, 1.0f }); + Mesh mesh = raylib::Mesh::Cubicmap(imMap, Vector3{ 1.0f, 1.0f, 1.0f }); raylib::Model model(mesh); // NOTE: By default each cube is mapped to one part of texture atlas @@ -75,7 +75,7 @@ int main(void) { if ((mapPixels[y*cubicmap.width + x].r == 255) && // Collision: white pixel, only check R channel (playerPos.CheckCollisionCircle(playerRadius, - (Rectangle){ mapPosition.x - 0.5f + x*1.0f, mapPosition.z - 0.5f + y*1.0f, 1.0f, 1.0f }))) + Rectangle{ mapPosition.x - 0.5f + x*1.0f, mapPosition.z - 0.5f + y*1.0f, 1.0f, 1.0f }))) { // Collision detected, reset camera position camera.position = oldCamPos; @@ -97,7 +97,7 @@ int main(void) } camera.EndMode(); - cubicmap.Draw((Vector2){ static_cast(GetScreenWidth() - cubicmap.width*4 - 20), 20 }, 0.0f, 4.0f, WHITE); + cubicmap.Draw(Vector2{ static_cast(GetScreenWidth() - cubicmap.width*4 - 20), 20 }, 0.0f, 4.0f, WHITE); DrawRectangleLines(GetScreenWidth() - cubicmap.width*4 - 20, 20, cubicmap.width*4, cubicmap.height*4, GREEN); // Draw player position radar diff --git a/examples/physics/physics_demo.cpp b/examples/physics/physics_demo.cpp index 2a027d7c..de0397db 100644 --- a/examples/physics/physics_demo.cpp +++ b/examples/physics/physics_demo.cpp @@ -59,10 +59,10 @@ int main(void) if (needsReset) { - floor = physics.CreateBodyRectangle((Vector2){ screenWidth/2, screenHeight }, 500, 100, 10); + floor = physics.CreateBodyRectangle(Vector2{ screenWidth/2, screenHeight }, 500, 100, 10); floor->enabled = false; - circle = physics.CreateBodyCircle((Vector2){ screenWidth/2, screenHeight/2 }, 45, 10); + circle = physics.CreateBodyCircle(Vector2{ screenWidth/2, screenHeight/2 }, 45, 10); circle->enabled = false; needsReset = false; diff --git a/examples/text/text_font_loading.cpp b/examples/text/text_font_loading.cpp index 10d08780..c2cf4199 100644 --- a/examples/text/text_font_loading.cpp +++ b/examples/text/text_font_loading.cpp @@ -66,12 +66,12 @@ int main() { if (!useTtf) { - fontBm.DrawText(msg, (Vector2){ 20.0f, 100.0f }, fontBm.baseSize, 2, MAROON); + fontBm.DrawText(msg, Vector2{ 20.0f, 100.0f }, fontBm.baseSize, 2, MAROON); DrawText("Using BMFont (Angelcode) imported", 20, GetScreenHeight() - 30, 20, GRAY); } else { - fontTtf.DrawText(msg, (Vector2){ 20.0f, 100.0f }, fontTtf.baseSize, 2, LIME); + fontTtf.DrawText(msg, Vector2{ 20.0f, 100.0f }, fontTtf.baseSize, 2, LIME); DrawText("Using TTF font generated", 20, GetScreenHeight() - 30, 20, GRAY); } } diff --git a/include/Camera3D.hpp b/include/Camera3D.hpp index 820c0dd4..29705883 100644 --- a/include/Camera3D.hpp +++ b/include/Camera3D.hpp @@ -25,8 +25,8 @@ class Camera3D : public ::Camera3D { * @param projection Camera projection: CAMERA_PERSPECTIVE or CAMERA_ORTHOGRAPHIC */ Camera3D(::Vector3 position, - ::Vector3 target = (::Vector3){0.0f, 0.0f, 0.0f}, - ::Vector3 up = (::Vector3){0.0f, 1.0f, 0.0f}, + ::Vector3 target = ::Vector3{0.0f, 0.0f, 0.0f}, + ::Vector3 up = ::Vector3{0.0f, 1.0f, 0.0f}, float fovy = 0, int projection = CAMERA_PERSPECTIVE ) : ::Camera3D{position, target, up, fovy, projection} {} diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 1a1e0916..b314947a 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -5,7 +5,11 @@ set(CTEST_CUSTOM_TESTS_IGNORE pkg-config--static) # Executable add_executable(raylib_test raylib_test.cpp) -target_compile_options(raylib_test PRIVATE -Wall -Wextra -Wconversion -Wsign-conversion) +if (MSVC) + target_compile_options(raylib_test PRIVATE /Wall /W4) +else() + target_compile_options(raylib_test PRIVATE -Wall -Wextra -Wconversion -Wsign-conversion) +endif() target_link_libraries(raylib_test raylib-cpp raylib) # Test