Adapt code to use MSTimeF().

This commit is contained in:
Mari the Deer 2022-04-29 16:40:57 +02:00
commit 1cf4ce0d08
8 changed files with 28 additions and 35 deletions

View file

@ -113,13 +113,13 @@ Class SWWMAchievementMenu : GenericMenu
{
str = StringTable.Localize("$SWWM_AC_COMPLETE1");
xx = (Screen.GetWidth()-newsmallfont.StringWidth(str)*CleanXFac_1)/2;
Screen.DrawText(newsmallfont,Font.CR_FIRE,xx,yy,str,DTA_CleanNoMove_1,true,DTA_ColorOverlay,Color(int(64+64*sin(MSTime()/3.6)),255,255,255));
Screen.DrawText(newsmallfont,Font.CR_FIRE,xx,yy,str,DTA_CleanNoMove_1,true,DTA_ColorOverlay,Color(int(64+64*sin(MSTimeF()/3.6)),255,255,255));
yy += newsmallfont.GetHeight()*CleanYFac_1;
// spanish hotfix needed
int gnd = players[consoleplayer].GetGender();
str = String.Format(StringTable.Localize("$SWWM_AC_COMPLETE2"),(gnd==1)?"a":"");
xx = (Screen.GetWidth()-newsmallfont.StringWidth(str)*CleanXFac_1)/2;
Screen.DrawText(newsmallfont,Font.CR_FIRE,xx,yy,str,DTA_CleanNoMove_1,true,DTA_ColorOverlay,Color(int(64+64*sin(MSTime()/3.6)),255,255,255));
Screen.DrawText(newsmallfont,Font.CR_FIRE,xx,yy,str,DTA_CleanNoMove_1,true,DTA_ColorOverlay,Color(int(64+64*sin(MSTimeF()/3.6)),255,255,255));
return;
}
String str1 = StringTable.Localize("$SWWM_AC_UNLOCKED");

View file

@ -282,7 +282,7 @@ Class SWWMMainMenu : SWWMCleanMenu
{
TextureID demotex, gradtex;
double demopos;
transient uint prevms;
double prevms;
Font mSmallFont;
private TextureID GetDemoTex()
@ -321,14 +321,14 @@ Class SWWMMainMenu : SWWMCleanMenu
mSmallFont = Font.GetFont('TewiFont');
demotex = GetDemoTex();
demopos = 120;
prevms = MSTime();
prevms = MSTimeF();
}
override void OnReturn()
{
demotex = GetDemoTex();
demopos = 120;
prevms = MSTime();
prevms = MSTimeF();
}
private int GetMenuYOffset()
@ -339,7 +339,7 @@ Class SWWMMainMenu : SWWMCleanMenu
override void Drawer()
{
double frametime = (MSTime()-prevms)/1000.;
double frametime = (MSTimeF()-prevms)/1000.;
double theta;
// naive, but whatever
if ( swwm_oldlogo ) theta = clamp(2.*frametime,0.,1.);
@ -371,7 +371,7 @@ Class SWWMMainMenu : SWWMCleanMenu
yy = CleanHeight_1-height;
Screen.Dim("Black",.75,int(xx*CleanXFac_1),int(yy*CleanYFac_1),int(width*CleanXFac_1),int(height*CleanYFac_1));
Screen.DrawText(mSmallFont,Font.CR_GOLD,(xx+4)*CleanXFac_1,(yy+2)*CleanYFac_1,str,DTA_CleanNoMove_1,true);
prevms = MSTime();
prevms = MSTimeF();
}
override bool MouseEvent( int type, int x, int y )

View file

@ -150,7 +150,7 @@ Class SWWMTitleStuff : EventHandler
Screen.Dim("Black",1.,0,0,Screen.GetWidth(),Screen.GetHeight());
if ( titletimer < -20 )
{
rss = int(MSTime()*(GameTicRate/1000.));
rss = int(MSTimeF()*(GameTicRate/1000.));
Vector2 ofs = (RandomShiver(),RandomShiver())*clamp((80+titletimer+e.FracTic)/50.,0.,1.);
tsize = TexMan.GetScaledSize(tex[3]);
ofs *= tsize.y/10.;