This commit is contained in:
Paul 2001-04-24 16:15:04 +00:00
parent ae8a75ec62
commit 9f05488753
2 changed files with 226 additions and 0 deletions

155
source/map/map.cpp Normal file
View File

@ -0,0 +1,155 @@
/*=========================================================================
map.cpp
Author: PKG
Created:
Project: Spongebob
Purpose:
Copyright (c) 2001 Climax Development Ltd
===========================================================================*/
/*----------------------------------------------------------------------
Includes
-------- */
#include "backend\map.h"
#ifndef __GFX_FONT_H__
#include "gfx\font.h"
#endif
#ifndef __PAD_PADS_H__
#include "pad\pads.h"
#endif
#ifndef __PRIM_HEADER__
#include "gfx\prim.h"
#endif
#ifndef __FRONTEND_FRONTEND_H__
#include "frontend\frontend.h"
#endif
#ifndef __GFX_FADER_H__
#include "gfx\fader.h"
#endif
/* Std Lib
------- */
/* Data
---- */
#ifndef __STRING_ENUMS__
#include <trans.h>
#endif
/*----------------------------------------------------------------------
Tyepdefs && Defines
------------------- */
/*----------------------------------------------------------------------
Structure defintions
-------------------- */
/*----------------------------------------------------------------------
Function Prototypes
------------------- */
/*----------------------------------------------------------------------
Vars
---- */
CMapScene MapScene;
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CMapScene::init()
{
m_font=new ("game over font") FontBank();
m_font->initialise(&standardFont);
m_font->setJustification(FontBank::JUST_CENTRE);
m_font->setOt(10);
m_readyToExit=false;
CFader::setFadingIn(CFader::BLACK_FADE);
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CMapScene::shutdown()
{
m_font->dump(); delete m_font;
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CMapScene::render()
{
POLY_F4 *f4;
f4=GetPrimF4();
setXYWH(f4,0,0,512,256);
setRGB0(f4,0,0,0);
AddPrimToList(f4,20);
m_font->setColour(255,255,255);
m_font->print(256,100,"MAP SCREEN!!!");
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CMapScene::think(int _frames)
{
if(!CFader::isFading()&&!m_readyToExit)
{
if(PadGetDown(0)&(PAD_CROSS|PAD_START))
{
m_readyToExit=true;
CFader::setFadingOut(CFader::BLACK_FADE);
GameState::setNextScene(&FrontEndScene);
}
}
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
int CMapScene::readyToShutdown()
{
return m_readyToExit&&!CFader::isFading();
}
/*===========================================================================
end */

71
source/map/map.h Normal file
View File

@ -0,0 +1,71 @@
/*=========================================================================
map.h
Author: PKG
Created:
Project: Spongebob
Purpose:
Copyright (c) 2001 Climax Development Ltd
===========================================================================*/
#ifndef __MAP_MAP_H__
#define __MAP_MAP_H__
/*----------------------------------------------------------------------
Includes
-------- */
#ifndef __SYSTEM_GSTATE_H__
#include "system\gstate.h"
#endif
/* Std Lib
------- */
/*----------------------------------------------------------------------
Tyepdefs && Defines
------------------- */
/*----------------------------------------------------------------------
Structure defintions
-------------------- */
class CMapScene: public CScene
{
public:
void init();
void shutdown();
void render();
void think(int _frames);
int readyToShutdown();
char *getSceneName() {return"Map";}
private:
class FontBank *m_font;
int m_readyToExit;
};
/*----------------------------------------------------------------------
Globals
------- */
extern CMapScene MapScene;
/*----------------------------------------------------------------------
Functions
--------- */
/*---------------------------------------------------------------------- */
#endif /* __MAP_MAP_H__ */
/*===========================================================================
end */