summaryrefslogtreecommitdiff
path: root/libcghEx.cpp
diff options
context:
space:
mode:
authorGravatar chirs241097@gmail.com <chirs241097@gmail.com@c17bf020-1265-9734-9302-a83f62007ddb> 2014-04-08 13:41:35 +0000
committerGravatar chirs241097@gmail.com <chirs241097@gmail.com@c17bf020-1265-9734-9302-a83f62007ddb> 2014-04-08 13:41:35 +0000
commit5351512258182e69786d3be915eab524919a1309 (patch)
treeecd583b2ab68051e8eb97f370326344fe6754d17 /libcghEx.cpp
parent46885d250e3bbaaf838d88102cac94b2bb11112b (diff)
downloadbullet-lab-remix-5351512258182e69786d3be915eab524919a1309.tar.xz
Port player preference menu, pause menu and return to title menu
to the new menu code base. Add shake effect to player preference menu. Make effects faster... Press esc in a menu will select back/exit now. Add several background transfers. Fix possible memory leaks in HangUpText. Remove some commented statements.
Diffstat (limited to 'libcghEx.cpp')
-rw-r--r--libcghEx.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/libcghEx.cpp b/libcghEx.cpp
index 860b322..78aeb02 100644
--- a/libcghEx.cpp
+++ b/libcghEx.cpp
@@ -80,6 +80,7 @@ bool HangUpText::Active(){return TFont&&!done;}
void HangUpText::Init(const char *Font,const char *_Text,double _tlim,double _alim,double _dlim,DWORD _color)
{
TFont=new hgeFont(Font);
+ TFont->SetScale(0.8);
strcpy(Text,_Text);
Limit=_tlim;alim=_alim;dlim=_dlim;TFont->SetColor(_color);
Progresser.Init(0,dlim,Limit);Progalpha.Init(0,255,Limit/2);
@@ -99,8 +100,13 @@ void HangUpText::Process(double DT)
Progalpha.Init(255,0,Limit/2);
Progalpha.Launch();
}
- if (Progalpha.GetA()>Progalpha.GetB()&&Progresser.GetElapsed()>=Limit)return (void)(done=true);
+ if (Progalpha.GetA()>Progalpha.GetB()&&Progresser.GetElapsed()>=Limit)
+ {
+ delete TFont;TFont=0;
+ return (void)(done=true);
+ }
Progalpha.Update(DT);
+ if(!TFont)return;
TFont->SetColor(SETA(TFont->GetColor(),Progalpha.GetValue()));
TFont->printf(Position.x,Position.y,HGETEXT_CENTER,Text);
}