SBSPSS/source/backend/gameover.cpp

156 lines
3.2 KiB
C++
Raw Normal View History

2001-01-11 20:40:55 +01:00
/*=========================================================================
gameover.cpp
Author: PKG
Created:
Project: Spongebob
2001-01-11 23:06:59 +01:00
Purpose: Game Over scene. Shown when out of contiunes or player chooses
not to continue any longer
2001-01-11 20:40:55 +01:00
Copyright (c) 2001 Climax Development Ltd
===========================================================================*/
/*----------------------------------------------------------------------
Includes
-------- */
#include "backend\gameover.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
---- */
CGameOverScene GameOverScene;
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CGameOverScene::init()
{
m_font=new ("game over font") FontBank();
m_font->initialise(&standardFont);
m_font->setJustification(FontBank::JUST_CENTRE);
2001-04-24 18:18:42 +02:00
m_font->setOt(5);
2001-01-11 20:40:55 +01:00
m_readyToExit=false;
2001-01-11 23:06:59 +01:00
CFader::setFadingIn(CFader::BLACK_FADE);
2001-01-11 20:40:55 +01:00
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CGameOverScene::shutdown()
{
m_font->dump(); delete m_font;
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CGameOverScene::render()
{
POLY_F4 *f4;
f4=GetPrimF4();
setXYWH(f4,0,0,512,256);
setRGB0(f4,0,0,0);
2001-04-24 18:18:42 +02:00
AddPrimToList(f4,10);
2001-01-11 20:40:55 +01:00
m_font->setColour(255,255,255);
m_font->print(256,100,STR__BACKEND__GAME_OVER);
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CGameOverScene::think(int _frames)
{
2001-01-11 23:06:59 +01:00
if(!CFader::isFading()&&!m_readyToExit)
2001-01-11 20:40:55 +01:00
{
if(PadGetDown(0)&(PAD_CROSS|PAD_START))
{
m_readyToExit=true;
2001-01-11 23:06:59 +01:00
CFader::setFadingOut(CFader::BLACK_FADE);
2001-01-11 20:40:55 +01:00
GameState::setNextScene(&FrontEndScene);
}
}
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
int CGameOverScene::readyToShutdown()
{
return m_readyToExit&&!CFader::isFading();
}
/*===========================================================================
end */