Revert font overhaul. Back to non-replacing fonts.
This commit is contained in:
parent
4475dc97ba
commit
f776ab126b
39 changed files with 507 additions and 680 deletions
|
|
@ -27,6 +27,7 @@ Class SWWMTitleStuff : EventHandler
|
|||
ui int rss;
|
||||
ui int stopinit_t;
|
||||
bool bFadeIn;
|
||||
ui Font mSmallFont, mBigFont;
|
||||
|
||||
private ui int GetUIRandom()
|
||||
{
|
||||
|
|
@ -137,6 +138,8 @@ Class SWWMTitleStuff : EventHandler
|
|||
|
||||
override void RenderUnderlay( RenderEvent e )
|
||||
{
|
||||
if ( !mSmallFont ) mSmallFont = Font.GetFont('TewiFont');
|
||||
if ( !mBigFont ) mBigFont = Font.GetFont('TewiFontOutline');
|
||||
if ( !camtex ) camtex = TexMan.CheckForTexture("LOGOFADE",TexMan.Type_Any);
|
||||
Screen.DrawTexture(camtex,false,0,0);
|
||||
if ( !tex[2] ) tex[2] = TexMan.CheckForTexture("graphics/tempbg.png",TexMan.Type_Any);
|
||||
|
|
@ -189,7 +192,7 @@ Class SWWMTitleStuff : EventHandler
|
|||
lastlang = language;
|
||||
lastlogo = swwm_oldlogo;
|
||||
// estimate scroll length
|
||||
double llen = smallfont.StringWidth(scrolls[sline]);
|
||||
double llen = mSmallFont.StringWidth(scrolls[sline]);
|
||||
double soffset = 40*((titletimer+e.FracTic)/GameTicRate-sbase);
|
||||
if ( soffset > llen+ss.x )
|
||||
{
|
||||
|
|
@ -213,15 +216,15 @@ Class SWWMTitleStuff : EventHandler
|
|||
alf = max(0,1.-abs((ss.x/2)-xx)/(ss.x/2))**.5;
|
||||
alf *= .2*trl;
|
||||
double xxofs = 5*sin(15*i+120*(titletimer+e.FracTic)/GameTicRate-90.*(1.-trl))-16*(1.-trl);
|
||||
Screen.DrawChar(smallfont,Font.CR_BLUE,xx-xxofs,yy,ch,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alf,DTA_LegacyRenderStyle,STYLE_Add);
|
||||
Screen.DrawChar(mSmallFont,Font.CR_BLUE,xx-xxofs,yy,ch,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alf,DTA_LegacyRenderStyle,STYLE_Add);
|
||||
}
|
||||
double yy = (ss.y-35)+10*sin(15*i+160*(titletimer+e.FracTic)/GameTicRate);
|
||||
alf = max(0,1.-abs((ss.x/2)-xx)/(ss.x/2))**.5;
|
||||
double xxofs = 5*sin(15*i+120*(titletimer+e.FracTic)/GameTicRate);
|
||||
Color c = Color(int(127.5+127.5*sin(10*i+80*(titletimer+e.FracTic)/GameTicRate)),0,0);
|
||||
Screen.DrawChar(smallfont,Font.CR_SAPPHIRE,xx-xxofs,yy,ch,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alf);
|
||||
Screen.DrawChar(mSmallFont,Font.CR_SAPPHIRE,xx-xxofs,yy,ch,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alf);
|
||||
}
|
||||
xx += smallfont.GetCharWidth(ch)+smallfont.GetDefaultKerning();
|
||||
xx += mSmallFont.GetCharWidth(ch)+mSmallFont.GetDefaultKerning();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -242,14 +245,14 @@ Class SWWMTitleStuff : EventHandler
|
|||
String str = StringTable.Localize("$SWWM_TITLEPRESENTS");
|
||||
alf = clamp(((titletimer+e.FracTic)/GameTicRate)-10,0.,1.);
|
||||
alf *= 1.-clamp(((titletimer+e.FracTic)/GameTicRate)-16,0.,1.);
|
||||
Screen.DrawText(smallfont,Font.CR_WHITE,(ss.x-smallfont.StringWidth(str))/2,(ss.y-smallfont.GetHeight())/2,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alf);
|
||||
Screen.DrawText(mSmallFont,Font.CR_WHITE,(ss.x-mSmallFont.StringWidth(str))/2,(ss.y-mSmallFont.GetHeight())/2,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alf);
|
||||
if ( bFadeIn ) Screen.Dim("Black",1.-clamp(((titletimer+e.FracTic)/GameTicRate)-22,0.,1.),0,0,Screen.GetWidth(),Screen.GetHeight());
|
||||
else
|
||||
{
|
||||
str = StringTable.Localize("$SWWM_TITLEMODBY");
|
||||
alf = clamp(((titletimer+e.FracTic)/GameTicRate)-18,0.,1.);
|
||||
alf *= 1.-clamp(((titletimer+e.FracTic)/GameTicRate)-24,0.,1.);
|
||||
Screen.DrawText(smallfont,Font.CR_WHITE,(ss.x-smallfont.StringWidth(str))/2,(ss.y-smallfont.GetHeight())/2,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alf);
|
||||
Screen.DrawText(mSmallFont,Font.CR_WHITE,(ss.x-mSmallFont.StringWidth(str))/2,(ss.y-mSmallFont.GetHeight())/2,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alf);
|
||||
}
|
||||
tsize = TexMan.GetScaledSize(tex[1]);
|
||||
sar = tsize.x/tsize.y;
|
||||
|
|
@ -270,23 +273,23 @@ Class SWWMTitleStuff : EventHandler
|
|||
double alf = clamp(((titletimer+e.FracTic)/GameTicRate)-1,0.,1.);
|
||||
alf *= 1.-clamp(((titletimer+e.FracTic)/GameTicRate)-4,0.,1.);
|
||||
String str = StringTable.Localize("$SWWM_TITLEPRESENTSA");
|
||||
Screen.DrawText(smallfont,Font.CR_FIRE,(Screen.GetWidth()-smallfont.StringWidth(str)*CleanXFac)/2,(Screen.GetHeight()/2)-(smallfont.GetHeight()*CleanYFac),str,DTA_CleanNoMove,true,DTA_Alpha,alf);
|
||||
Screen.DrawText(mSmallFont,Font.CR_FIRE,(Screen.GetWidth()-mSmallFont.StringWidth(str)*CleanXFac)/2,(Screen.GetHeight()/2)-(mSmallFont.GetHeight()*CleanYFac),str,DTA_CleanNoMove,true,DTA_Alpha,alf);
|
||||
str = StringTable.Localize("$SWWM_TITLEPRESENTSB");
|
||||
Screen.DrawText(smallfont,Font.CR_WHITE,(Screen.GetWidth()-smallfont.StringWidth(str)*CleanXFac)/2,(Screen.GetHeight()/2),str,DTA_CleanNoMove,true,DTA_Alpha,alf);
|
||||
Screen.DrawText(mSmallFont,Font.CR_WHITE,(Screen.GetWidth()-mSmallFont.StringWidth(str)*CleanXFac)/2,(Screen.GetHeight()/2),str,DTA_CleanNoMove,true,DTA_Alpha,alf);
|
||||
alf = clamp(((titletimer+e.FracTic)/GameTicRate)-5,0.,1.);
|
||||
alf *= 1.-clamp(((titletimer+e.FracTic)/GameTicRate)-8,0.,1.);
|
||||
str = StringTable.Localize("$SWWM_TITLEMODBYA");
|
||||
Screen.DrawText(smallfont,Font.CR_WHITE,(Screen.GetWidth()-smallfont.StringWidth(str)*CleanXFac)/2,(Screen.GetHeight()/2)-(smallfont.GetHeight()*CleanYFac),str,DTA_CleanNoMove,true,DTA_Alpha,alf);
|
||||
Screen.DrawText(mSmallFont,Font.CR_WHITE,(Screen.GetWidth()-mSmallFont.StringWidth(str)*CleanXFac)/2,(Screen.GetHeight()/2)-(mSmallFont.GetHeight()*CleanYFac),str,DTA_CleanNoMove,true,DTA_Alpha,alf);
|
||||
str = StringTable.Localize("$SWWM_TITLEMODBYB");
|
||||
Screen.DrawText(smallfont,Font.CR_FIRE,(Screen.GetWidth()-smallfont.StringWidth(str)*CleanXFac)/2,(Screen.GetHeight()/2),str,DTA_CleanNoMove,true,DTA_Alpha,alf);
|
||||
Screen.DrawText(mSmallFont,Font.CR_FIRE,(Screen.GetWidth()-mSmallFont.StringWidth(str)*CleanXFac)/2,(Screen.GetHeight()/2),str,DTA_CleanNoMove,true,DTA_Alpha,alf);
|
||||
alf = clamp(((titletimer+e.FracTic)/GameTicRate)-10,0.,1.);
|
||||
alf *= 1.-clamp(((titletimer+e.FracTic)/GameTicRate)-21,0.,1.);
|
||||
str = StringTable.Localize("$SWWM_TITLEINTROA");
|
||||
Screen.DrawText(smallfont,Font.CR_WHITE,(Screen.GetWidth()-smallfont.StringWidth(str)*CleanXFac)/2,(Screen.GetHeight()/2)-(smallfont.GetHeight()*CleanYFac*3)/2,str,DTA_CleanNoMove,true,DTA_Alpha,alf);
|
||||
Screen.DrawText(mSmallFont,Font.CR_WHITE,(Screen.GetWidth()-mSmallFont.StringWidth(str)*CleanXFac)/2,(Screen.GetHeight()/2)-(mSmallFont.GetHeight()*CleanYFac*3)/2,str,DTA_CleanNoMove,true,DTA_Alpha,alf);
|
||||
str = StringTable.Localize("$SWWM_TITLEINTROB");
|
||||
Screen.DrawText(smallfont,Font.CR_WHITE,(Screen.GetWidth()-smallfont.StringWidth(str)*CleanXFac)/2,(Screen.GetHeight()/2)-(smallfont.GetHeight()*CleanYFac)/2,str,DTA_CleanNoMove,true,DTA_Alpha,alf);
|
||||
Screen.DrawText(mSmallFont,Font.CR_WHITE,(Screen.GetWidth()-mSmallFont.StringWidth(str)*CleanXFac)/2,(Screen.GetHeight()/2)-(mSmallFont.GetHeight()*CleanYFac)/2,str,DTA_CleanNoMove,true,DTA_Alpha,alf);
|
||||
str = StringTable.Localize("$SWWM_TITLEINTROC");
|
||||
Screen.DrawText(smallfont,Font.CR_WHITE,(Screen.GetWidth()-smallfont.StringWidth(str)*CleanXFac)/2,(Screen.GetHeight()/2)+(smallfont.GetHeight()*CleanYFac)/2,str,DTA_CleanNoMove,true,DTA_Alpha,alf);
|
||||
Screen.DrawText(mSmallFont,Font.CR_WHITE,(Screen.GetWidth()-mSmallFont.StringWidth(str)*CleanXFac)/2,(Screen.GetHeight()/2)+(mSmallFont.GetHeight()*CleanYFac)/2,str,DTA_CleanNoMove,true,DTA_Alpha,alf);
|
||||
double ar = Screen.GetAspectRatio();
|
||||
Vector2 tsize = TexMan.GetScaledSize(tex[4]);
|
||||
double sar = tsize.x/tsize.y;
|
||||
|
|
@ -318,11 +321,11 @@ Class SWWMTitleStuff : EventHandler
|
|||
Screen.DrawTexture(tex[4],false,(vsize.x-tsize.x)/2,(vsize.y-tsize.y)/2,DTA_VirtualWidthF,vsize.x,DTA_VirtualHeightF,vsize.y,DTA_KeepRatio,true,DTA_Alpha,alf);
|
||||
}
|
||||
double scl = Screen.GetHeight()/vsize.y;
|
||||
double tscl1 = max(.5,(floor((Screen.GetHeight()*4.)/vsize.y)+3.)/2.);
|
||||
double tscl1 = max(1.,floor((Screen.GetHeight()*4.)/vsize.y)+3.);
|
||||
str = "CODENAME";
|
||||
alf = clamp(((titletimer+e.FracTic)/GameTicRate)-22,0.,1.);
|
||||
Screen.DrawText(BigFont,Font.CR_SAPPHIRE,int(Screen.GetWidth()-tscl1*BigFont.StringWidth(str))/2,int(Screen.GetHeight()-(scl*400+BigFont.GetHeight()*tscl1))/2,str,DTA_ScaleX,tscl1,DTA_ScaleY,tscl1,DTA_Alpha,alf);
|
||||
double tscl2 = max(.5,floor((Screen.GetHeight()*4.)/vsize.y)/2.);
|
||||
Screen.DrawText(mBigFont,Font.CR_SAPPHIRE,int(Screen.GetWidth()-tscl1*mBigFont.StringWidth(str))/2,int(Screen.GetHeight()-(scl*400+mBigFont.GetHeight()*tscl1))/2,str,DTA_ScaleX,tscl1,DTA_ScaleY,tscl1,DTA_Alpha,alf);
|
||||
double tscl2 = max(1.,floor((Screen.GetHeight()*4.)/vsize.y));
|
||||
if ( !stitle || (lastlang2 != language) )
|
||||
{
|
||||
Array<String> done;
|
||||
|
|
@ -349,7 +352,7 @@ Class SWWMTitleStuff : EventHandler
|
|||
}
|
||||
else c.SetString("1");
|
||||
if ( stitle ) stitle.Destroy();
|
||||
stitle = BigFont.BreakLines(StringTable.Localize("$SWWM_TITLESUB"..which),int.max);
|
||||
stitle = mBigFont.BreakLines(StringTable.Localize("$SWWM_TITLESUB"..which),int.max);
|
||||
}
|
||||
lastlang2 = language;
|
||||
alf = clamp(((titletimer+e.FracTic)/GameTicRate)-27,0.,1.);
|
||||
|
|
@ -357,9 +360,9 @@ Class SWWMTitleStuff : EventHandler
|
|||
double yy = int(Screen.GetHeight()+(scl*360+(1.-alf)*80*tscl2))/2;
|
||||
for ( int i=0; i<stitle.Count(); i++ )
|
||||
{
|
||||
xx = int(Screen.GetWidth()-tscl2*BigFont.StringWidth(stitle.StringAt(i)))/2;
|
||||
Screen.DrawText(BigFont,Font.CR_SAPPHIRE,xx,yy,stitle.StringAt(i),DTA_ScaleX,tscl2,DTA_ScaleY,tscl2,DTA_Alpha,alf);
|
||||
yy += int(tscl2*BigFont.GetHeight());
|
||||
xx = int(Screen.GetWidth()-tscl2*mBigFont.StringWidth(stitle.StringAt(i)))/2;
|
||||
Screen.DrawText(mBigFont,Font.CR_SAPPHIRE,xx,yy,stitle.StringAt(i),DTA_ScaleX,tscl2,DTA_ScaleY,tscl2,DTA_Alpha,alf);
|
||||
yy += int(tscl2*mBigFont.GetHeight());
|
||||
}
|
||||
if ( (((titletimer+e.FracTic)/GameTicRate) >= 23.) && (((titletimer+e.FracTic)/GameTicRate) < 25.6) )
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue