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-02-12 17:06:24 +01:00
|
|
|
#ifndef __GUI_GFACTORY_H__
|
|
|
|
#include "gui\gfactory.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef __GUI_GFRAME_H__
|
|
|
|
#include "gui\gframe.h"
|
|
|
|
#endif
|
2001-01-15 23:02:25 +01:00
|
|
|
|
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
|
|
|
|
---- */
|
|
|
|
|
2001-02-12 17:06:24 +01:00
|
|
|
int CFrontEndStart::s_levelValues[]=
|
|
|
|
{
|
2001-02-12 20:40:01 +01:00
|
|
|
0,
|
|
|
|
1,
|
|
|
|
2,
|
|
|
|
3,
|
|
|
|
4,
|
|
|
|
5,
|
|
|
|
6,
|
|
|
|
7,
|
|
|
|
8,
|
|
|
|
9,
|
|
|
|
10,
|
|
|
|
11,
|
|
|
|
12,
|
|
|
|
13,
|
|
|
|
14,
|
|
|
|
15,
|
|
|
|
16,
|
|
|
|
17,
|
|
|
|
18,
|
|
|
|
19,
|
|
|
|
20,
|
|
|
|
21,
|
|
|
|
22,
|
|
|
|
23,
|
|
|
|
24,
|
|
|
|
25,
|
|
|
|
26,
|
|
|
|
27,
|
|
|
|
28,
|
|
|
|
29,
|
|
|
|
30,
|
|
|
|
31,
|
|
|
|
32,
|
|
|
|
33,
|
|
|
|
34,
|
|
|
|
35,
|
|
|
|
36,
|
|
|
|
37,
|
|
|
|
38,
|
|
|
|
39,
|
|
|
|
40,
|
|
|
|
41,
|
|
|
|
42,
|
|
|
|
43,
|
|
|
|
44,
|
|
|
|
45,
|
|
|
|
46,
|
|
|
|
47,
|
2001-02-12 17:15:37 +01:00
|
|
|
-1,
|
2001-02-12 17:06:24 +01:00
|
|
|
};
|
|
|
|
CGUITextReadout::TextReadoutData CFrontEndStart::s_levelReadoutText[]=
|
|
|
|
{
|
2001-02-12 20:40:01 +01:00
|
|
|
{ 0,STR__DEBUG__LEVEL_SELECT_C3L301},
|
|
|
|
{ 1,STR__DEBUG__LEVEL_SELECT_C3L302},
|
|
|
|
{ 2,STR__DEBUG__LEVEL_SELECT_C3L303},
|
|
|
|
{ 3,STR__DEBUG__LEVEL_SELECT_C3L304},
|
|
|
|
{ 4,STR__DEBUG__LEVEL_SELECT_C3L305},
|
|
|
|
{ 5,STR__DEBUG__LEVEL_SELECT_C3L306},
|
|
|
|
/*
|
|
|
|
{ 8,STR__DEBUG__LEVEL_SELECT_C3L401},
|
|
|
|
{ 9,STR__DEBUG__LEVEL_SELECT_C3L402},
|
|
|
|
{10,STR__DEBUG__LEVEL_SELECT_C3L403},
|
|
|
|
{11,STR__DEBUG__LEVEL_SELECT_C3L404},
|
|
|
|
{12,STR__DEBUG__LEVEL_SELECT_C3L405},
|
|
|
|
{13,STR__DEBUG__LEVEL_SELECT_C3L406},
|
|
|
|
{14,STR__DEBUG__LEVEL_SELECT_C3L407},
|
|
|
|
{15,STR__DEBUG__LEVEL_SELECT_C3L408},
|
|
|
|
|
|
|
|
{16,STR__DEBUG__LEVEL_SELECT_C4L101},
|
|
|
|
{17,STR__DEBUG__LEVEL_SELECT_C4L102},
|
|
|
|
{18,STR__DEBUG__LEVEL_SELECT_C4L103},
|
|
|
|
{19,STR__DEBUG__LEVEL_SELECT_C4L104},
|
|
|
|
{20,STR__DEBUG__LEVEL_SELECT_C4L105},
|
|
|
|
{21,STR__DEBUG__LEVEL_SELECT_C4L106},
|
|
|
|
{22,STR__DEBUG__LEVEL_SELECT_C4L107},
|
|
|
|
{23,STR__DEBUG__LEVEL_SELECT_C4L108},
|
|
|
|
|
|
|
|
{24,STR__DEBUG__LEVEL_SELECT_C4L201},
|
|
|
|
{25,STR__DEBUG__LEVEL_SELECT_C4L202},
|
|
|
|
{26,STR__DEBUG__LEVEL_SELECT_C4L203},
|
|
|
|
{27,STR__DEBUG__LEVEL_SELECT_C4L204},
|
|
|
|
{28,STR__DEBUG__LEVEL_SELECT_C4L205},
|
|
|
|
{29,STR__DEBUG__LEVEL_SELECT_C4L206},
|
|
|
|
{30,STR__DEBUG__LEVEL_SELECT_C4L207},
|
|
|
|
{31,STR__DEBUG__LEVEL_SELECT_C4L208},
|
|
|
|
*/
|
|
|
|
{6,STR__DEBUG__LEVEL_SELECT_C4L301},
|
|
|
|
{7,STR__DEBUG__LEVEL_SELECT_C4L302},
|
|
|
|
{8,STR__DEBUG__LEVEL_SELECT_C4L303},
|
|
|
|
{9,STR__DEBUG__LEVEL_SELECT_C4L304},
|
|
|
|
{10,STR__DEBUG__LEVEL_SELECT_C4L305},
|
|
|
|
{11,STR__DEBUG__LEVEL_SELECT_C4L306},
|
|
|
|
|
|
|
|
{12,STR__DEBUG__LEVEL_SELECT_C4L401},
|
|
|
|
{13,STR__DEBUG__LEVEL_SELECT_C4L402},
|
|
|
|
{14,STR__DEBUG__LEVEL_SELECT_C4L403},
|
|
|
|
{15,STR__DEBUG__LEVEL_SELECT_C4L404},
|
|
|
|
{16,STR__DEBUG__LEVEL_SELECT_C4L405},
|
|
|
|
{17,STR__DEBUG__LEVEL_SELECT_C4L406},
|
|
|
|
{18,STR__DEBUG__LEVEL_SELECT_C4L407},
|
2001-02-12 17:06:24 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
extern int s_globalLevelSelectThing;
|
|
|
|
|
|
|
|
|
2000-11-24 18:20:44 +01:00
|
|
|
/*----------------------------------------------------------------------
|
|
|
|
Function:
|
|
|
|
Purpose:
|
|
|
|
Params:
|
|
|
|
Returns:
|
|
|
|
---------------------------------------------------------------------- */
|
|
|
|
void CFrontEndStart::init()
|
|
|
|
{
|
2001-02-12 17:06:24 +01:00
|
|
|
m_guiFrame=new ("optionsframe") CGUIControlFrame();
|
|
|
|
m_guiFrame->init(NULL);
|
|
|
|
m_guiFrame->setObjectXYWH(50,40,412,100);
|
|
|
|
|
|
|
|
CGUIFactory::createCycleButtonFrame(m_guiFrame,
|
|
|
|
50,10,312,40,
|
|
|
|
STR__DEBUG__LEVEL_SELECT,
|
|
|
|
&m_level,s_levelValues,s_levelReadoutText);
|
|
|
|
|
|
|
|
CGUIFactory::createValueButtonFrame(m_guiFrame,
|
|
|
|
50,50,312,40,
|
|
|
|
STR__DEBUG__LEVEL_SELECT_START,
|
|
|
|
&m_startGame,true);
|
2000-11-24 18:20:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------
|
|
|
|
Function:
|
|
|
|
Purpose:
|
|
|
|
Params:
|
|
|
|
Returns:
|
|
|
|
---------------------------------------------------------------------- */
|
|
|
|
void CFrontEndStart::shutdown()
|
|
|
|
{
|
2001-02-12 17:06:24 +01:00
|
|
|
m_guiFrame->shutdown();
|
2000-11-24 18:20:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------
|
|
|
|
Function:
|
|
|
|
Purpose:
|
|
|
|
Params:
|
|
|
|
Returns:
|
|
|
|
---------------------------------------------------------------------- */
|
|
|
|
void CFrontEndStart::select()
|
|
|
|
{
|
2001-02-12 17:06:24 +01:00
|
|
|
m_guiFrame->select();
|
2000-11-24 18:20:44 +01:00
|
|
|
m_shuttingDown=false;
|
|
|
|
m_selectedSlot=NO_SLOT_SELECTED;
|
|
|
|
m_escapeToTitles=false;
|
|
|
|
CFader::setFadingIn();
|
2001-02-12 17:06:24 +01:00
|
|
|
m_startGame=false;
|
2000-11-24 18:20:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------
|
|
|
|
Function:
|
|
|
|
Purpose:
|
|
|
|
Params:
|
|
|
|
Returns:
|
|
|
|
---------------------------------------------------------------------- */
|
|
|
|
void CFrontEndStart::unselect()
|
|
|
|
{
|
2001-02-12 17:06:24 +01:00
|
|
|
m_guiFrame->unselect();
|
2000-11-24 18:20:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------
|
|
|
|
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
|
|
|
|
2001-02-12 17:06:24 +01:00
|
|
|
m_guiFrame->render();
|
2000-11-24 18:20:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------
|
|
|
|
Function:
|
|
|
|
Purpose:
|
|
|
|
Params:
|
|
|
|
Returns:
|
|
|
|
---------------------------------------------------------------------- */
|
|
|
|
void CFrontEndStart::think(int _frames)
|
|
|
|
{
|
2001-02-12 17:06:24 +01:00
|
|
|
if(!CFader::isFading())
|
|
|
|
{
|
|
|
|
m_guiFrame->think(_frames);
|
|
|
|
}
|
|
|
|
|
2000-11-24 18:20:44 +01:00
|
|
|
if(!m_shuttingDown)
|
|
|
|
{
|
2001-02-12 17:06:24 +01:00
|
|
|
if(/*m_selectedSlot!=NO_SLOT_SELECTED||
|
|
|
|
m_escapeToTitles||*/
|
|
|
|
m_startGame)
|
|
|
|
{
|
2001-02-12 17:26:09 +01:00
|
|
|
m_selectedSlot=0;
|
2000-11-24 18:20:44 +01:00
|
|
|
m_shuttingDown=true;
|
2001-02-12 17:06:24 +01:00
|
|
|
s_globalLevelSelectThing=m_level;
|
2000-11-24 18:20:44 +01:00
|
|
|
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 */
|