SBSPSS/source/level/level.h

120 lines
3.5 KiB
C
Raw Normal View History

2000-12-06 23:52:00 +01:00
/*******************/
/*** Level Class ***/
/*******************/
#ifndef __LEVEL_LEVEL_H__
#define __LEVEL_LEVEL_H__
2001-06-22 22:06:39 +02:00
#ifndef __FMA_FMA_H__
#include "fma\fma.h"
#endif
2001-01-16 17:20:45 +01:00
#include "system\global.h"
2001-02-02 20:16:49 +01:00
#include "level/layertile.h"
#include "level/layercollision.h"
2000-12-06 23:52:00 +01:00
2001-04-03 23:28:56 +02:00
/*****************************************************************************/
struct sLvlTab
{
2001-06-22 22:06:39 +02:00
u16 Chapter,Level;
u8 totalSpatCount;
FileEquate LevelFilename,TexFilename;
int songId;
u16 ChapterLoadingText,LevelLoadingText;
CFmaScene::FMA_SCRIPT_NUMBER FMAToFollow;
2001-04-03 23:28:56 +02:00
};
2001-05-16 21:06:47 +02:00
/*****************************************************************************/
extern int s_globalLevelSelectThing;
extern sLvlTab LvlTable[];
2000-12-06 23:52:00 +01:00
/*****************************************************************************/
2001-02-02 20:16:49 +01:00
class CLayer;
2000-12-06 23:52:00 +01:00
class CLevel
{
public:
2001-04-03 23:28:56 +02:00
CLevel();
2000-12-07 16:56:20 +01:00
// Scene Handlers
2001-05-16 21:06:47 +02:00
void init(int LevelNo);
void shutdown();
void render();
void think(int _frames);
2000-12-07 16:56:20 +01:00
2001-05-16 21:06:47 +02:00
void setCameraCentre(DVECTOR _pos) {MapPos=_pos;}
static DVECTOR const &getCameraPos() {return MapPos;}
static DVECTOR const &getPlayerSpawnPos() {return s_playerSpawnPos;}
2001-05-03 00:49:59 +02:00
2001-06-22 22:06:39 +02:00
static int getCurrentChapter() {return LvlTable[s_globalLevelSelectThing].Chapter;}
static int getCurrentChapterLevel() {return LvlTable[s_globalLevelSelectThing].Level;}
static int getTotalSpatCount() {return LvlTable[s_globalLevelSelectThing].totalSpatCount;}
static int getChapterLoadingText() {return LvlTable[s_globalLevelSelectThing].ChapterLoadingText;}
static int getLevelLoadingText() {return LvlTable[s_globalLevelSelectThing].LevelLoadingText;}
static CFmaScene::FMA_SCRIPT_NUMBER getFMAToFollow() {return LvlTable[s_globalLevelSelectThing].FMAToFollow;}
2001-05-03 00:49:59 +02:00
2001-05-16 21:06:47 +02:00
void destroyMapArea(DVECTOR const &Pos);
void destroyMapTile(DVECTOR const &Pos);
2001-05-01 14:20:47 +02:00
2001-06-06 22:23:44 +02:00
void reverseMapConveyor(DVECTOR const &Pos);
2001-05-16 21:06:47 +02:00
int getActorCount() {return ActorCount;}
sThingActor **getActorList() {return ActorList;}
int getPlatformCount() {return PlatformCount;}
sThingPlatform **getPlatformList() {return PlatformList;}
int getHazardCount() {return HazardCount;}
sThingHazard **getHazardList() {return HazardList;}
2001-01-15 23:19:34 +01:00
2001-05-16 21:06:47 +02:00
CLayerCollision *getCollisionLayer() {return CollisionLayer;}
DVECTOR getMapSize();
2001-05-04 21:34:09 +02:00
2001-05-16 21:06:47 +02:00
bool GetNextLevel(int &Lvl);
2001-05-04 21:34:09 +02:00
2001-05-16 21:06:47 +02:00
void respawnLevel();
static sLevelHdr *getLevelHdr() {return(LevelHdr);}
2001-05-04 23:58:41 +02:00
2001-05-16 21:06:47 +02:00
static u8 getIsBossRespawn() {return m_isBossRespawn;}
static s32 getBossHealth() {return m_bossHealth;}
static void setIsBossRespawn( u8 newIsBossRespawn) {m_isBossRespawn=newIsBossRespawn;}
static void setBossHealth( s32 newBossHealth ) {m_bossHealth=newBossHealth;}
2001-05-04 21:34:09 +02:00
2001-04-03 23:28:56 +02:00
2001-05-16 21:06:47 +02:00
private:
void initLayers();
void initThings(int _respawningLevel);
void DisplayLoadingScreen(sLvlTab *lvlTab);
2000-12-07 16:56:20 +01:00
2001-05-16 21:06:47 +02:00
static sLevelHdr *LevelHdr;
2000-12-12 21:56:51 +01:00
2001-05-16 21:06:47 +02:00
static DVECTOR MapPos;
static DVECTOR s_playerSpawnPos;
TPAGE_DESC m_levelTPage;
2001-02-09 18:01:04 +01:00
2000-12-08 15:48:50 +01:00
// Tile Layers
2001-05-16 21:06:47 +02:00
CLayerTile *TileLayers[CLayerTile::LAYER_TILE_TYPE_MAX];
2001-04-03 23:28:56 +02:00
2001-02-02 20:16:49 +01:00
// Collision
2001-05-16 21:06:47 +02:00
CLayerCollision *CollisionLayer;
2001-04-03 23:28:56 +02:00
2001-04-02 02:17:48 +02:00
// Things
2001-05-16 21:06:47 +02:00
int ActorCount;
sThingActor **ActorList;
int ItemCount;
sThingItem *ItemList;
int PlatformCount;
sThingPlatform **PlatformList;
int TriggerCount;
sThingTrigger *TriggerList;
int FXCount;
sThingFX *FXList;
int HazardCount;
sThingHazard **HazardList;
static u8 m_isBossRespawn;
static s32 m_bossHealth;
2001-05-04 23:58:41 +02:00
2000-12-06 23:52:00 +01:00
};
/*****************************************************************************/
#endif