2000-11-09 21:29:28 +01:00
|
|
|
/*=========================================================================
|
|
|
|
|
|
|
|
scrollbg.h
|
|
|
|
|
|
|
|
Author: PKG
|
|
|
|
Created:
|
|
|
|
Project: Spongebob
|
2000-11-13 18:03:20 +01:00
|
|
|
Purpose: Scrolling tiled background class
|
2000-11-09 21:29:28 +01:00
|
|
|
|
|
|
|
Copyright (c) 2000 Climax Development Ltd
|
|
|
|
|
|
|
|
===========================================================================*/
|
|
|
|
|
|
|
|
#ifndef __FRONTEND_SCROLLBG_H__
|
|
|
|
#define __FRONTEND_SCROLLBG_H__
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------
|
|
|
|
Includes
|
|
|
|
-------- */
|
|
|
|
|
2001-01-05 01:17:57 +01:00
|
|
|
#ifndef __PRIM_HEADER__
|
|
|
|
#include "gfx\prim.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2000-11-09 21:29:28 +01:00
|
|
|
/* Std Lib
|
|
|
|
------- */
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------
|
|
|
|
Tyepdefs && Defines
|
|
|
|
------------------- */
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------
|
|
|
|
Structure defintions
|
|
|
|
-------------------- */
|
|
|
|
|
|
|
|
class CScrollyBackground
|
|
|
|
{
|
|
|
|
public:
|
2001-06-08 18:13:22 +02:00
|
|
|
typedef enum
|
|
|
|
{
|
2001-06-11 01:20:13 +02:00
|
|
|
DRAWMODE_NORMAL=0,
|
2001-06-08 20:30:39 +02:00
|
|
|
DRAWMODE_ADDITIVE=1,
|
|
|
|
DRAWMODE_SUBTRACTIVE=2,
|
2001-06-08 18:13:22 +02:00
|
|
|
}DRAWMODE;
|
|
|
|
|
2001-06-08 20:26:09 +02:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
NORMAL_SCALE=256,
|
|
|
|
};
|
|
|
|
|
2000-11-09 21:29:28 +01:00
|
|
|
void init();
|
|
|
|
void shutdown();
|
|
|
|
void render();
|
|
|
|
void think(int _frames);
|
|
|
|
|
2000-11-13 18:03:20 +01:00
|
|
|
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;}
|
2001-01-03 17:13:59 +01:00
|
|
|
void setFrame(int _frame) {m_frame=_frame;}
|
2001-06-08 18:13:22 +02:00
|
|
|
void setTheDrawMode(DRAWMODE _drawMode) {m_drawMode=_drawMode;}
|
|
|
|
void setColour(u8 _r,u8 _g,u8 _b) {m_r=_r;m_g=_g;m_b=_b;}
|
2001-06-08 20:26:09 +02:00
|
|
|
void setScale(int _scale) {m_scale=_scale;}
|
2000-11-13 18:03:20 +01:00
|
|
|
|
2000-11-09 21:29:28 +01:00
|
|
|
private:
|
2000-11-13 18:03:20 +01:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
DEFAULT_X_SPEED=-2,
|
|
|
|
DEFAULT_Y_SPEED=-3,
|
|
|
|
DEFAULT_SPEED_SCALE=2,
|
2001-01-05 01:17:57 +01:00
|
|
|
DEFAULT_OT=MAX_OT-1,
|
2000-11-13 18:03:20 +01:00
|
|
|
};
|
|
|
|
|
2000-11-09 21:29:28 +01:00
|
|
|
class SpriteBank *m_sprites;
|
|
|
|
int m_xOff,m_yOff;
|
2000-11-13 18:03:20 +01:00
|
|
|
int m_xSpeed,m_ySpeed;
|
|
|
|
int m_speedScale;
|
|
|
|
int m_ot;
|
2001-01-03 17:13:59 +01:00
|
|
|
int m_frame;
|
2001-06-08 18:13:22 +02:00
|
|
|
DRAWMODE m_drawMode;
|
|
|
|
u8 m_r,m_g,m_b;
|
2001-06-08 20:26:09 +02:00
|
|
|
int m_scale;
|
2000-11-09 21:29:28 +01:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------
|
|
|
|
Globals
|
|
|
|
------- */
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------
|
|
|
|
Functions
|
|
|
|
--------- */
|
|
|
|
|
|
|
|
/*---------------------------------------------------------------------- */
|
|
|
|
|
|
|
|
#endif /* __FRONTEND_SCROLLBG_H__ */
|
|
|
|
|
|
|
|
/*===========================================================================
|
|
|
|
end */
|