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-08-03 23:04:12 +02:00
|
|
|
#ifndef __HAZARD_HCHECK_H__
|
|
|
|
#include "hazard\hcheck.h"
|
|
|
|
#endif
|
|
|
|
|
2001-04-03 23:28:56 +02:00
|
|
|
/*****************************************************************************/
|
|
|
|
struct sLvlTab
|
|
|
|
{
|
2001-06-22 22:06:39 +02:00
|
|
|
u16 Chapter,Level;
|
2001-08-08 20:46:51 +02:00
|
|
|
s8 SBFacing;
|
2001-06-22 22:06:39 +02:00
|
|
|
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[];
|
|
|
|
|
2001-07-11 21:02:00 +02:00
|
|
|
/*****************************************************************************/
|
|
|
|
struct sTileStore
|
|
|
|
{
|
|
|
|
u16 X,Y;
|
|
|
|
sTileMapElem Tile;
|
|
|
|
u8 Col;
|
|
|
|
};
|
|
|
|
|
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-07-23 21:26:37 +02:00
|
|
|
void setCameraCentre(DVECTOR const &_pos) {MapPos=_pos;}
|
2001-05-16 21:06:47 +02:00
|
|
|
static DVECTOR const &getCameraPos() {return MapPos;}
|
|
|
|
static DVECTOR const &getPlayerSpawnPos() {return s_playerSpawnPos;}
|
2001-08-08 20:46:51 +02:00
|
|
|
static int getPlayerStartFacing() {return s_playerFacing;}
|
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-08-21 16:44:16 +02:00
|
|
|
void destroyMapArea(DVECTOR const &Pos,int ColT=COLLISION_TYPE_DESTRUCTABLE_WALL);
|
|
|
|
void destroyMapTile(DVECTOR const &Pos,int ColT=COLLISION_TYPE_DESTRUCTABLE_FLOOR);
|
2001-05-01 14:20:47 +02:00
|
|
|
|
2001-07-11 20:15:41 +02:00
|
|
|
void reverseMapConveyor();
|
2001-06-06 22:23:44 +02:00
|
|
|
|
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;}
|
2001-08-15 16:14:13 +02:00
|
|
|
|
|
|
|
DVECTOR const &getMapSize() {return(MapSize);}
|
|
|
|
int getMapWidth() {return(MapSize.vx);}
|
|
|
|
int getMapHeight() {return(MapSize.vy);}
|
|
|
|
|
|
|
|
DVECTOR const &getMapSize16() {return(MapSize16);}
|
|
|
|
int getMapWidth16() {return(MapSize16.vx);}
|
|
|
|
int getMapHeight16() {return(MapSize16.vy);}
|
2001-05-04 21:34:09 +02:00
|
|
|
|
2001-05-16 21:06:47 +02:00
|
|
|
bool GetNextLevel(int &Lvl);
|
2001-08-17 14:42:05 +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-08-03 23:04:12 +02:00
|
|
|
static CNpcCheckpointHazard *getCurrentCheckpoint() {return( m_checkpoint );}
|
|
|
|
static void setCurrentCheckpoint( CNpcCheckpointHazard *newCheckpoint ) {m_checkpoint = newCheckpoint;}
|
|
|
|
|
2001-08-06 15:04:29 +02:00
|
|
|
static void DisplayLoadingScreen(int LevelNo=-1);
|
2001-04-03 23:28:56 +02:00
|
|
|
|
2001-05-16 21:06:47 +02:00
|
|
|
private:
|
|
|
|
void initLayers();
|
|
|
|
void initThings(int _respawningLevel);
|
|
|
|
|
|
|
|
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;
|
2001-08-08 20:46:51 +02:00
|
|
|
static int s_playerFacing;
|
2001-05-16 21:06:47 +02:00
|
|
|
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;
|
|
|
|
|
2001-07-28 18:45:46 +02:00
|
|
|
u8 *m_RGBMap;
|
|
|
|
u8 *m_RGBTable;
|
|
|
|
|
2001-05-16 21:06:47 +02:00
|
|
|
static u8 m_isBossRespawn;
|
|
|
|
static s32 m_bossHealth;
|
|
|
|
|
2001-08-15 16:14:13 +02:00
|
|
|
DVECTOR MapSize,MapSize16;
|
2001-08-03 23:04:12 +02:00
|
|
|
static CNpcCheckpointHazard *m_checkpoint;
|
|
|
|
|
2001-07-11 21:02:00 +02:00
|
|
|
// Level Repair stuff
|
|
|
|
void CreateTileStore();
|
|
|
|
void ApplyTileStore();
|
|
|
|
int m_TileStoreCount;
|
|
|
|
sTileStore *m_TileStore;
|
2000-12-06 23:52:00 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
#endif
|