aboutsummaryrefslogtreecommitdiff
path: root/background.h
diff options
context:
space:
mode:
authorGravatar chirs241097@gmail.com <chirs241097@gmail.com@c17bf020-1265-9734-9302-a83f62007ddb> 2014-03-02 02:58:08 +0000
committerGravatar chirs241097@gmail.com <chirs241097@gmail.com@c17bf020-1265-9734-9302-a83f62007ddb> 2014-03-02 02:58:08 +0000
commiteaa6a19cd0537c0bb8d57d743f894f58c62d378a (patch)
tree403f3c0cec90dbcae398c0dfb5fb7fe270897ba0 /background.h
parentaed99b27218aaf0068d04c24ba938e405c73c80f (diff)
downloadbullet-lab-remix-eaa6a19cd0537c0bb8d57d743f894f58c62d378a.tar.xz
New interface for background class, other minor level changes.
Diffstat (limited to 'background.h')
-rw-r--r--background.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/background.h b/background.h
index 1a69789..728f005 100644
--- a/background.h
+++ b/background.h
@@ -474,6 +474,7 @@ private:
DWORD alpha,alim;
bool onfadein,onfadeout;
int fadebreak;
+ double scale;
void DoFadeIn()
{
if (LOWFPS)fadebreak+=17;else ++fadebreak;
@@ -490,9 +491,9 @@ private:
else if (alpha<0x2)alpha=0;else alpha-=0x2;
if (!alpha)onfadeout=false;
}
- void RenderCenterAt(vector2d a)
+ void RenderCenterAt(vector2d a,double scl)
{
- vector2d s=vector2d(hge->Texture_GetWidth(quad.tex,true),hge->Texture_GetHeight(quad.tex,true));
+ vector2d s=vector2d(hge->Texture_GetWidth(quad.tex,true)*scl,hge->Texture_GetHeight(quad.tex,true)*scl);
for(int i=0;i<4;++i)quad.v[i].col=SETA(0xFFFFFF,alpha);
quad.v[0].x=a.x-s.x/2.0f;quad.v[0].y=a.y-s.y/2.0f;
quad.v[1].x=a.x+s.x/2.0f;quad.v[1].y=a.y-s.y/2.0f;
@@ -502,10 +503,11 @@ private:
}
public:
bool active(){return alpha;}
+ void SetScale(double _scl){scale=_scl;}
void Init(const char *tx,arMode _Mode,DWORD _alim)
{
quad.tex=hge->Texture_Load(tx);alim=_alim;
- Mode=_Mode;
+ Mode=_Mode;scale=1;
quad.v[0].tx=0,quad.v[0].ty=0;
quad.v[1].tx=1,quad.v[1].ty=0;
quad.v[2].tx=1,quad.v[2].ty=1;
@@ -518,14 +520,14 @@ public:
switch(Mode)
{
case Centered:
- RenderCenterAt(vector2d(400,300));
+ RenderCenterAt(vector2d(400,300),scale);
break;
case Tiled:
{
- vector2d s=vector2d(hge->Texture_GetWidth(quad.tex,true),hge->Texture_GetHeight(quad.tex,true));
+ vector2d s=vector2d(hge->Texture_GetWidth(quad.tex,true)*scale,hge->Texture_GetHeight(quad.tex,true)*scale);
for(int i=0;i*s.x<=800;++i)
for(int j=0;j*s.y<=600;++j)
- RenderCenterAt(vector2d(s.x/2+i*s.x,s.y/2+j*s.y));
+ RenderCenterAt(vector2d(s.x/2+i*s.x,s.y/2+j*s.y),scale);
}
break;
case Stretched: