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

@@ -351,6 +351,7 @@ void MapPropertiesSystem::DrawGraphicsPopup(int current_map, int game_state) {
}
}
ImGui::PopStyleVar(2); // Pop the 2 style variables we pushed
ImGui::EndPopup();
}
}
@@ -394,6 +395,7 @@ void MapPropertiesSystem::DrawPalettesPopup(int current_map, int game_state, boo
show_custom_bg_color_editor = !show_custom_bg_color_editor;
}
ImGui::PopStyleVar(2); // Pop the 2 style variables we pushed
ImGui::EndPopup();
}
}
@@ -472,7 +474,7 @@ void MapPropertiesSystem::DrawPropertiesPopup(int current_map, bool& show_map_pr
}
HOVER_HINT("Open comprehensive properties editor");
ImGui::PopStyleVar(2);
ImGui::PopStyleVar(2); // Pop the 2 style variables we pushed
ImGui::EndPopup();
}
}
@@ -905,7 +907,7 @@ void MapPropertiesSystem::DrawViewPopup() {
}
HOVER_HINT("Toggle fullscreen canvas (F11)");
ImGui::PopStyleVar(2);
ImGui::PopStyleVar(2); // Pop the 2 style variables we pushed
ImGui::EndPopup();
}
}
@@ -939,7 +941,7 @@ void MapPropertiesSystem::DrawQuickAccessPopup() {
}
HOVER_HINT("Lock/unlock current map (Ctrl+L)");
ImGui::PopStyleVar(2);
ImGui::PopStyleVar(2); // Pop the 2 style variables we pushed
ImGui::EndPopup();
}
}

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,