This commit is contained in:
parent
fb00ee0996
commit
81bbe06d73
@ -69,6 +69,7 @@ void CScrollyBackground::init()
|
||||
setSpeed(DEFAULT_X_SPEED,DEFAULT_Y_SPEED);
|
||||
setSpeedScale(DEFAULT_SPEED_SCALE);
|
||||
setOt(DEFAULT_OT);
|
||||
setFrame(FRM__BG1);
|
||||
}
|
||||
|
||||
|
||||
@ -96,7 +97,7 @@ void CScrollyBackground::render()
|
||||
sFrameHdr *fh;
|
||||
int x,y,w,h;
|
||||
|
||||
fh=m_sprites->getFrameHeader(FRM__BG1);
|
||||
fh=m_sprites->getFrameHeader(m_frame);
|
||||
w=fh->W;
|
||||
h=fh->H;
|
||||
y=(m_yOff>>m_speedScale)-h;
|
||||
@ -126,7 +127,7 @@ void CScrollyBackground::think(int _frames)
|
||||
{
|
||||
sFrameHdr *fh;
|
||||
|
||||
fh=m_sprites->getFrameHeader(FRM__BG1);
|
||||
fh=m_sprites->getFrameHeader(m_frame);
|
||||
|
||||
m_xOff=(m_xOff+(_frames*m_xSpeed))%(fh->W<<m_speedScale);
|
||||
m_yOff=(m_yOff+(_frames*m_ySpeed))%(fh->H<<m_speedScale);
|
||||
|
@ -40,6 +40,7 @@ public:
|
||||
void setSpeed(int _xSpeed,int _ySpeed) {m_xSpeed=_xSpeed;m_ySpeed=_ySpeed;}
|
||||
void setSpeedScale(int _speedScale) {m_speedScale=_speedScale;}
|
||||
void setOt(int _ot) {m_ot=_ot;}
|
||||
void setFrame(int _frame) {m_frame=_frame;}
|
||||
|
||||
|
||||
private:
|
||||
@ -56,6 +57,7 @@ private:
|
||||
int m_xSpeed,m_ySpeed;
|
||||
int m_speedScale;
|
||||
int m_ot;
|
||||
int m_frame;
|
||||
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user