SBSPSS/source/frontend/start.cpp

199 lines
4.1 KiB
C++
Raw Normal View History

2000-11-24 18:20:44 +01:00
/*=========================================================================
start.cpp
Author: PKG
Created:
Project: Spongebob
Purpose:
Copyright (c) 2000 Climax Development Ltd
===========================================================================*/
/*----------------------------------------------------------------------
Includes
-------- */
#include "frontend\start.h"
#ifndef __GFX_SPRBANK_H__
#include "gfx\sprbank.h"
#endif
#ifndef __LOCALE_TEXTDBASE_H__
#include "locale\textdbase.h"
#endif
#ifndef __GFX_FADER_H__
#include "gfx\fader.h"
#endif
#ifndef __PRIM_HEADER__
#include "gfx\prim.h"
#endif
2001-01-15 23:02:25 +01:00
#include "gfx\font.h"
2000-11-24 18:20:44 +01:00
/* Std Lib
------- */
/* Data
---- */
#ifndef __SPR_FRONTEND_H__
#include <frontend.h>
#endif
/*----------------------------------------------------------------------
Tyepdefs && Defines
------------------- */
/*----------------------------------------------------------------------
Structure defintions
-------------------- */
/*----------------------------------------------------------------------
Function Prototypes
------------------- */
/*----------------------------------------------------------------------
Vars
---- */
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
2001-01-15 23:02:25 +01:00
FontBank *s_smallFont;
2000-11-24 18:20:44 +01:00
void CFrontEndStart::init()
{
2001-01-15 23:02:25 +01:00
s_smallFont=new ("Start SmallFont") FontBank();
s_smallFont->initialise(&standardFont);
s_smallFont->setJustification(FontBank::JUST_CENTRE);
s_smallFont->setOt(5);
2000-11-24 18:20:44 +01:00
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CFrontEndStart::shutdown()
{
2001-01-15 23:02:25 +01:00
s_smallFont->dump(); delete s_smallFont;
2000-11-24 18:20:44 +01:00
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CFrontEndStart::select()
{
m_shuttingDown=false;
m_selectedSlot=NO_SLOT_SELECTED;
m_escapeToTitles=false;
CFader::setFadingIn();
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CFrontEndStart::unselect()
{
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CFrontEndStart::render()
{
POLY_G4 *g4;
g4=GetPrimG4();
setXYWH(g4,0,0,512,256);
setRGB0(g4,50, 0, 0);
setRGB1(g4, 0, 0,50);
setRGB2(g4, 0,50, 0);
setRGB3(g4,50, 0,50);
2001-01-05 22:26:29 +01:00
AddPrimToList(g4,MAX_OT-1);
2001-01-15 23:02:25 +01:00
if(!CFader::isFading())
{
s_smallFont->print(256,120,"Press START to enter game scene");
}
2000-11-24 18:20:44 +01:00
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
2000-11-24 21:33:35 +01:00
#ifndef __PAD_PADS_H__
#include "pad\pads.h"
#endif
2000-11-24 18:20:44 +01:00
void CFrontEndStart::think(int _frames)
{
if(!m_shuttingDown)
{
2000-11-24 21:33:35 +01:00
/////////// PKG
if(PadGetDown(0)&PAD_START)
{
m_selectedSlot=0;
}
/////////// PKG
2000-11-24 18:20:44 +01:00
if(m_selectedSlot!=NO_SLOT_SELECTED||
m_escapeToTitles)
{
m_shuttingDown=true;
CFader::setFadingOut();
}
}
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
int CFrontEndStart::isReadyToExit()
{
return !CFader::isFading()&&m_shuttingDown;
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
CFrontEndScene::FrontEndMode CFrontEndStart::getNextMode()
{
2000-11-24 21:33:35 +01:00
if(m_selectedSlot==NO_SLOT_SELECTED)
2000-11-24 18:20:44 +01:00
{
2000-11-24 21:33:35 +01:00
return CFrontEndScene::MODE__MAIN_TITLES;
2000-11-24 18:20:44 +01:00
}
else
{
2000-11-24 21:33:35 +01:00
return CFrontEndScene::MODE__EXIT_TO_GAME;
2000-11-24 18:20:44 +01:00
}
}
/*===========================================================================
end */