Skip to content

Commit

Permalink
Silence some Wfloat-conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
past-due committed Mar 26, 2024
1 parent 1c8efdd commit a2b9105
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions lib/ivis_opengl/pielighting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ namespace {
BoundingBox getLightBoundingBox(const LIGHT& light)
{
glm::vec3 center = light.position;
center.z *= -1.;
center.z *= -1.f;
float range = light.range;
glm::vec3 horizontal(1.0, 0., 0.);
glm::vec3 vertical(0.0, 1.0, 0.);
glm::vec3 forward(0.0, 0., 1.0f);
glm::vec3 horizontal(1.0f, 0.f, 0.f);
glm::vec3 vertical(0.f, 1.0f, 0.f);
glm::vec3 forward(0.f, 0.f, 1.0f);

return BoundingBox{
center - horizontal * range - vertical * range - forward * range,
Expand Down
2 changes: 1 addition & 1 deletion src/droid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ void addDroidDeathAnimationEffect(DROID *psDroid)
{
// FIXME: change when adding submarines to the game
// modifiedModelMatrix *= glm::translate(glm::vec3(0.f, -world_coord(1) / 2.3f, 0.f));
position.y += (world_coord(1) / 2.3f);
position.y += static_cast<int>(world_coord(1) / 2.3f);
}

EFFECT_TYPE type = DROID_ANIMEVENT_DYING_NORMAL;
Expand Down
2 changes: 1 addition & 1 deletion src/hci/quickchat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ class WzQuickChatButton : public W_BUTTON
lastWidgetWidth = width();

int textX0 = xPos + QuickChatButtonHorizontalPadding;
int textY0 = yPos + (h - wzMessageText.lineSize()) / 2 - float(wzMessageText.aboveBase());
int textY0 = static_cast<int>(yPos + (h - wzMessageText.lineSize()) / 2 - float(wzMessageText.aboveBase()));

int maxTextDisplayableWidth = w - (QuickChatButtonHorizontalPadding * 2);
isTruncated = maxTextDisplayableWidth < wzMessageText.width();
Expand Down
2 changes: 1 addition & 1 deletion src/shadowcascades.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void calculateShadowCascades(const iView *player, float terrainDistance, const g

float pitch = UNDEG(-player->r.x);

float adjustedZFar = (pow((1.57f - pitch) / 1.57f, 0.9f) * 4000.f) + 2000.f + terrainDistance;
float adjustedZFar = static_cast<float>((pow((1.57f - pitch) / 1.57f, 0.9f) * 4000.f) + 2000.f + terrainDistance);

std::vector<float> cascadeSplits(SHADOW_MAP_CASCADE_COUNT, 0.f);

Expand Down

0 comments on commit a2b9105

Please sign in to comment.