Refactor CMake and enhance API documentation for YAZE

- Updated CMakeLists.txt to set a minimum required version of 3.5 and removed older policy settings for improved compatibility.
- Enhanced yaze.h and zelda.h with detailed documentation, including versioning information and API descriptions, to improve clarity for developers.
- Added new functions for version compatibility checks and improved error handling in the YAZE API.
- Refactored existing structures and enums for better readability and maintainability, ensuring a more consistent coding style.
This commit is contained in:
scawful
2025-09-25 12:00:03 -04:00
parent 4c6342cb73
commit 77ceb0256b
6 changed files with 1139 additions and 238 deletions

View File

@@ -13,7 +13,11 @@ ImVec4 ConvertSnesColorToImVec4(const gfx::SnesColor& color) {
}
gfx::SnesColor ConvertImVec4ToSnesColor(const ImVec4& color) {
return gfx::SnesColor(color.x, color.y, color.z);
// Convert from float (0.0-1.0) to uint8_t (0-255)
uint8_t r = static_cast<uint8_t>(color.x * 255.0f);
uint8_t g = static_cast<uint8_t>(color.y * 255.0f);
uint8_t b = static_cast<uint8_t>(color.z * 255.0f);
return gfx::SnesColor(r, g, b);
}
IMGUI_API bool SnesColorButton(absl::string_view id, gfx::SnesColor& color,