- fixed several scale related floating point conversion warnings.

This commit is contained in:
Christoph Oelckers 2022-06-15 22:15:36 +02:00
parent 431c47c957
commit 355219d614
7 changed files with 12 additions and 12 deletions

View file

@ -373,7 +373,7 @@ struct FMapThing
double Gravity; double Gravity;
double Alpha; double Alpha;
uint32_t fillcolor; uint32_t fillcolor;
DVector2 Scale; FVector2 Scale;
double Health; double Health;
int score; int score;
int16_t pitch; int16_t pitch;

View file

@ -1193,7 +1193,7 @@ static int PatchThing (int thingy)
} }
else if (stricmp (Line1, "Scale") == 0) 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) else if (stricmp (Line1, "Decal") == 0)
{ {

View file

@ -670,7 +670,7 @@ void DIntermissionScreenCast::Drawer ()
// draw the current frame in the middle of the screen // draw the current frame in the middle of the screen
if (caststate != NULL) if (caststate != NULL)
{ {
DVector2 castscale = DVector2(mDefaults->Scale.X, mDefaults->Scale.Y); FVector2 castscale = mDefaults->Scale;
int castsprite = caststate->sprite; int castsprite = caststate->sprite;

View file

@ -737,15 +737,15 @@ public:
break; break;
case NAME_ScaleX: case NAME_ScaleX:
th->Scale.X = CheckFloat(key); th->Scale.X = (float)CheckFloat(key);
break; break;
case NAME_ScaleY: case NAME_ScaleY:
th->Scale.Y = CheckFloat(key); th->Scale.Y = (float)CheckFloat(key);
break; break;
case NAME_Scale: case NAME_Scale:
th->Scale.X = th->Scale.Y = CheckFloat(key); th->Scale.X = th->Scale.Y = (float)CheckFloat(key);
break; break;
case NAME_FriendlySeeBlocks: case NAME_FriendlySeeBlocks:

View file

@ -4245,11 +4245,11 @@ void DLevelScript::DoSetActorProperty (AActor *actor, int property, int value)
break; break;
case APROP_ScaleX: case APROP_ScaleX:
actor->Scale.X = ACSToDouble(value); actor->Scale.X = (float)ACSToDouble(value);
break; break;
case APROP_ScaleY: case APROP_ScaleY:
actor->Scale.Y = ACSToDouble(value); actor->Scale.Y = (float)ACSToDouble(value);
break; break;
case APROP_Mass: case APROP_Mass:

View file

@ -651,7 +651,7 @@ void R_InitSkins (void)
} }
else if (0 == stricmp (key, "scale")) 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; Skins[i].Scale.Y = Skins[i].Scale.X;
} }
else if (0 == stricmp (key, "game")) else if (0 == stricmp (key, "game"))
@ -1000,7 +1000,7 @@ void R_InitSprites ()
auto type = GetDefaultByType(PlayerClasses[0].Type); auto type = GetDefaultByType(PlayerClasses[0].Type);
Skins[i].range0start = type->IntVar(NAME_ColorRangeStart); Skins[i].range0start = type->IntVar(NAME_ColorRangeStart);
Skins[i].range0end = type->IntVar(NAME_ColorRangeEnd); Skins[i].range0end = type->IntVar(NAME_ColorRangeEnd);
Skins[i].Scale = DVector2(type->Scale.X, type->Scale.Y); Skins[i].Scale = type->Scale;
} }
R_InitSpriteDefs (); R_InitSpriteDefs ();
@ -1019,7 +1019,7 @@ void R_InitSprites ()
Skins[i].Face = face == NAME_None? "STF" : face.GetChars(); Skins[i].Face = face == NAME_None? "STF" : face.GetChars();
Skins[i].range0start = basetype->IntVar(NAME_ColorRangeStart); Skins[i].range0start = basetype->IntVar(NAME_ColorRangeStart);
Skins[i].range0end = basetype->IntVar(NAME_ColorRangeEnd); 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].sprite = basetype->SpawnState->sprite;
Skins[i].namespc = ns_global; Skins[i].namespc = ns_global;

View file

@ -55,7 +55,7 @@ public:
uint8_t range0start = 0; uint8_t range0start = 0;
uint8_t range0end = 0; uint8_t range0end = 0;
bool othergame = 0; // [GRB] bool othergame = 0; // [GRB]
DVector2 Scale = { 1, 1 }; FVector2 Scale = { 1, 1 };
int sprite = 0; int sprite = 0;
int crouchsprite = 0; int crouchsprite = 0;
int namespc = 0; // namespace for this skin int namespc = 0; // namespace for this skin