优化参数转换
This commit is contained in:
@@ -20,6 +20,7 @@ cmake-build-*/
|
||||
|
||||
# msc
|
||||
.clang-tidy
|
||||
.cache/
|
||||
|
||||
# Prerequisites
|
||||
*.d
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user