Skip to content

Commit

Permalink
- fixed several scale related floating point conversion warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
coelckers committed Jun 15, 2022
1 parent 431c47c commit 355219d
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/doomdata.h
Expand Up @@ -373,7 +373,7 @@ struct FMapThing
double Gravity;
double Alpha;
uint32_t fillcolor;
DVector2 Scale;
FVector2 Scale;
double Health;
int score;
int16_t pitch;
Expand Down
2 changes: 1 addition & 1 deletion src/gamedata/d_dehacked.cpp
Expand Up @@ -1193,7 +1193,7 @@ static int PatchThing (int thingy)
}
else if (stricmp (Line1, "Scale") == 0)
{
info->Scale.Y = info->Scale.X = clamp(atof (Line2), 1./65536, 256.);
info->Scale.Y = info->Scale.X = clamp((float)atof (Line2), 1.f/65536, 256.f);
}
else if (stricmp (Line1, "Decal") == 0)
{
Expand Down
2 changes: 1 addition & 1 deletion src/intermission/intermission.cpp
Expand Up @@ -670,7 +670,7 @@ void DIntermissionScreenCast::Drawer ()
// draw the current frame in the middle of the screen
if (caststate != NULL)
{
DVector2 castscale = DVector2(mDefaults->Scale.X, mDefaults->Scale.Y);
FVector2 castscale = mDefaults->Scale;

int castsprite = caststate->sprite;

Expand Down
6 changes: 3 additions & 3 deletions src/maploader/udmf.cpp
Expand Up @@ -737,15 +737,15 @@ class UDMFParser : public UDMFParserBase
break;

case NAME_ScaleX:
th->Scale.X = CheckFloat(key);
th->Scale.X = (float)CheckFloat(key);
break;

case NAME_ScaleY:
th->Scale.Y = CheckFloat(key);
th->Scale.Y = (float)CheckFloat(key);
break;

case NAME_Scale:
th->Scale.X = th->Scale.Y = CheckFloat(key);
th->Scale.X = th->Scale.Y = (float)CheckFloat(key);
break;

case NAME_FriendlySeeBlocks:
Expand Down
4 changes: 2 additions & 2 deletions src/playsim/p_acs.cpp
Expand Up @@ -4245,11 +4245,11 @@ void DLevelScript::DoSetActorProperty (AActor *actor, int property, int value)
break;

case APROP_ScaleX:
actor->Scale.X = ACSToDouble(value);
actor->Scale.X = (float)ACSToDouble(value);
break;

case APROP_ScaleY:
actor->Scale.Y = ACSToDouble(value);
actor->Scale.Y = (float)ACSToDouble(value);
break;

case APROP_Mass:
Expand Down
6 changes: 3 additions & 3 deletions src/r_data/sprites.cpp
Expand Up @@ -651,7 +651,7 @@ void R_InitSkins (void)
}
else if (0 == stricmp (key, "scale"))
{
Skins[i].Scale.X = clamp(atof (sc.String), 1./65536, 256.);
Skins[i].Scale.X = clamp((float)atof (sc.String), 1.f/65536, 256.f);
Skins[i].Scale.Y = Skins[i].Scale.X;
}
else if (0 == stricmp (key, "game"))
Expand Down Expand Up @@ -1000,7 +1000,7 @@ void R_InitSprites ()
auto type = GetDefaultByType(PlayerClasses[0].Type);
Skins[i].range0start = type->IntVar(NAME_ColorRangeStart);
Skins[i].range0end = type->IntVar(NAME_ColorRangeEnd);
Skins[i].Scale = DVector2(type->Scale.X, type->Scale.Y);
Skins[i].Scale = type->Scale;
}

R_InitSpriteDefs ();
Expand All @@ -1019,7 +1019,7 @@ void R_InitSprites ()
Skins[i].Face = face == NAME_None? "STF" : face.GetChars();
Skins[i].range0start = basetype->IntVar(NAME_ColorRangeStart);
Skins[i].range0end = basetype->IntVar(NAME_ColorRangeEnd);
Skins[i].Scale = DVector2(basetype->Scale.X, basetype->Scale.Y);
Skins[i].Scale = basetype->Scale;
Skins[i].sprite = basetype->SpawnState->sprite;
Skins[i].namespc = ns_global;

Expand Down
2 changes: 1 addition & 1 deletion src/r_data/sprites.h
Expand Up @@ -55,7 +55,7 @@ class FPlayerSkin
uint8_t range0start = 0;
uint8_t range0end = 0;
bool othergame = 0; // [GRB]
DVector2 Scale = { 1, 1 };
FVector2 Scale = { 1, 1 };
int sprite = 0;
int crouchsprite = 0;
int namespc = 0; // namespace for this skin
Expand Down

0 comments on commit 355219d

Please sign in to comment.