Update to latest versions of libraries

Update to use Raylib 4.2.0.
Update to use Raygui 3.2.
Update to use Catch 3.3.2.
This commit is contained in:
Stephen Seo 2023-03-06 20:12:09 +09:00
parent ca97d8b257
commit b523a6c93e
9 changed files with 23636 additions and 17807 deletions

View file

@ -76,8 +76,8 @@ target_include_directories(TrianglesLib PUBLIC
if(CMAKE_BUILD_TYPE MATCHES "Debug") if(CMAKE_BUILD_TYPE MATCHES "Debug")
set(Triangles_UNIT_TEST_SOURCES set(Triangles_UNIT_TEST_SOURCES
src/unittest/test_main.cpp
src/unittest/test_helpers.cpp src/unittest/test_helpers.cpp
third_party/catch/catch_amalgamated.cpp
) )
add_executable(UnitTest_Triangles ${Triangles_UNIT_TEST_SOURCES}) add_executable(UnitTest_Triangles ${Triangles_UNIT_TEST_SOURCES})

View file

@ -85,7 +85,7 @@ namespace Tri {
GuiPanel({(800 - SHOW_HELP_WIDTH) / 2.0f, GuiPanel({(800 - SHOW_HELP_WIDTH) / 2.0f,
(600 - SHOW_HELP_HEIGHT) / 2.0f, (600 - SHOW_HELP_HEIGHT) / 2.0f,
SHOW_HELP_WIDTH, SHOW_HELP_WIDTH,
SHOW_HELP_HEIGHT}); SHOW_HELP_HEIGHT}, nullptr);
GuiLabel({4.0f + (800 - SHOW_HELP_WIDTH) / 2.0f, GuiLabel({4.0f + (800 - SHOW_HELP_WIDTH) / 2.0f,
4.0f + (600 - SHOW_HELP_HEIGHT) / 2.0f, 4.0f + (600 - SHOW_HELP_HEIGHT) / 2.0f,
SHOW_HELP_WIDTH - 8.0f, SHOW_HELP_WIDTH - 8.0f,
@ -101,6 +101,7 @@ namespace Tri {
auto &colorArray = state->get_color(); auto &colorArray = state->get_color();
Color color = GuiColorPicker( Color color = GuiColorPicker(
{8.0f, 32.0f, 206.0f, 240.0f}, {8.0f, 32.0f, 206.0f, 240.0f},
nullptr,
{(unsigned char)(colorArray[0] * 255.0f), {(unsigned char)(colorArray[0] * 255.0f),
(unsigned char)(colorArray[1] * 255.0f), (unsigned char)(colorArray[1] * 255.0f),
(unsigned char)(colorArray[2] * 255.0f), (unsigned char)(colorArray[2] * 255.0f),
@ -127,6 +128,7 @@ namespace Tri {
auto &colorArray = state->get_bg_color(); auto &colorArray = state->get_bg_color();
Color color = GuiColorPicker( Color color = GuiColorPicker(
{254.0f, 32.0f, 206.0f, 240.0f}, {254.0f, 32.0f, 206.0f, 240.0f},
nullptr,
{(unsigned char)(colorArray[0] * 255.0f), {(unsigned char)(colorArray[0] * 255.0f),
(unsigned char)(colorArray[1] * 255.0f), (unsigned char)(colorArray[1] * 255.0f),
(unsigned char)(colorArray[2] * 255.0f), (unsigned char)(colorArray[2] * 255.0f),
@ -267,6 +269,7 @@ namespace Tri {
auto &colorArray = state->get_selected_tri_color(); auto &colorArray = state->get_selected_tri_color();
Color color = GuiColorPicker( Color color = GuiColorPicker(
{504.0f, 32.0f, 206.0f, 240.0f}, {504.0f, 32.0f, 206.0f, 240.0f},
nullptr,
{(unsigned char)(colorArray[0] * 255.0f), {(unsigned char)(colorArray[0] * 255.0f),
(unsigned char)(colorArray[1] * 255.0f), (unsigned char)(colorArray[1] * 255.0f),
(unsigned char)(colorArray[2] * 255.0f), (unsigned char)(colorArray[2] * 255.0f),

View file

@ -204,7 +204,7 @@ void Tri::State::handle_events() {
} }
} else if(flags.test(F_COPY_COLOR_MODE)) { } else if(flags.test(F_COPY_COLOR_MODE)) {
check_draw_cache(); check_draw_cache();
Image drawImage = GetTextureData(drawCache.texture); Image drawImage = LoadImageFromTexture(drawCache.texture);
Color *colors = LoadImageColors(drawImage); Color *colors = LoadImageColors(drawImage);
int mx = GetMouseX(); int mx = GetMouseX();
int my = GetMouseY(); int my = GetMouseY();
@ -416,7 +416,7 @@ bool Tri::State::do_save() {
draw_to_target(&saveTexture); draw_to_target(&saveTexture);
Image saveImage = GetTextureData(saveTexture.texture); Image saveImage = LoadImageFromTexture(saveTexture.texture);
UnloadRenderTexture(saveTexture); UnloadRenderTexture(saveTexture);
if(ExportImage(saveImage, saveFilenameBuffer.data())) { if(ExportImage(saveImage, saveFilenameBuffer.data())) {
#ifndef NDEBUG #ifndef NDEBUG

View file

@ -1,4 +1,4 @@
#include "catch.hpp" #include "catch_amalgamated.hpp"
#include "helpers.hpp" #include "helpers.hpp"
#include "triangle.hpp" #include "triangle.hpp"

View file

@ -1,2 +0,0 @@
#define CATCH_CONFIG_MAIN
#include "catch.hpp"

File diff suppressed because it is too large Load diff

10655
third_party/catch/catch_amalgamated.cpp vendored Normal file

File diff suppressed because it is too large Load diff

12972
third_party/catch/catch_amalgamated.hpp vendored Normal file

File diff suppressed because it is too large Load diff

2
third_party/raygui vendored

@ -1 +1 @@
Subproject commit 6b216626ec8486b98ec38ae307bfb2cf32f9efcc Subproject commit 4e2a878e715c4aafa6ad7bd58d851221503c6e60