优化参数转换

This commit is contained in:
Ziyu
2025-11-29 10:38:50 +08:00
parent d05d5562c8
commit b1b245c03d
3 changed files with 3 additions and 3 deletions
+1
View File
@@ -20,6 +20,7 @@ cmake-build-*/
# msc
.clang-tidy
.cache/
# Prerequisites
*.d
+1 -2
View File
@@ -162,8 +162,7 @@ void Renderer::clearScreen() {
void Renderer::drawUIFilledRect(const engine::utils::Rect &rect, const engine::utils::FColor &color)
{
setDrawColorFloat(color.r, color.g, color.b, color.a);
SDL_FRect sdl_rect = {rect.position.x, rect.position.y, rect.size.x, rect.size.y};
if (!SDL_RenderFillRect(renderer_, &sdl_rect)) {
if (!SDL_RenderFillRect(renderer_, reinterpret_cast<const SDL_FRect*>(&rect))) {
spdlog::error("绘制填充矩形失败:{}", SDL_GetError());
}
setDrawColorFloat(0, 0, 0, 1.0f);
+1 -1
View File
@@ -49,7 +49,7 @@ void PlayerComponent::init() {
bool PlayerComponent::takeDamage(int damage) {
if (is_dead_ || !health_component_ || damage <= 0) {
spdlog::warn("玩家已死亡或却少必要组件,并未造成伤害。");
spdlog::warn("玩家已死亡或缺少必要组件,并未造成伤害。");
return false;
}