This commit is contained in:
Paul 2000-11-24 17:30:49 +00:00
parent 36925da8e6
commit 40abc1e120
10 changed files with 294 additions and 16 deletions

View File

@ -51,11 +51,13 @@ CD_FILESYS_LIB := CMXBoot
fileio_src := fileio \
$($(FILE_SYSTEM)_FILESYS_SRC)
frontend_src := demomode \
frontend_src := credits \
demomode \
frontend \
scrollbg \
maintitl \
options
options \
scrollbg \
start
game_src := game

171
source/frontend/credits.cpp Normal file
View File

@ -0,0 +1,171 @@
/*=========================================================================
credits.cpp
Author: PKG
Created:
Project: Spongebob
Purpose:
Copyright (c) 2000 Climax Development Ltd
===========================================================================*/
/*----------------------------------------------------------------------
Includes
-------- */
#include "frontend\credits.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
#ifndef __PAD_PADS_H__
#include "pad\pads.h"
#endif
/* Std Lib
------- */
/* Data
---- */
#ifndef __SPR_FRONTEND_H__
#include <frontend.h>
#endif
/*----------------------------------------------------------------------
Tyepdefs && Defines
------------------- */
/*----------------------------------------------------------------------
Structure defintions
-------------------- */
/*----------------------------------------------------------------------
Function Prototypes
------------------- */
/*----------------------------------------------------------------------
Vars
---- */
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CFrontEndCredits::init()
{
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CFrontEndCredits::shutdown()
{
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CFrontEndCredits::select()
{
m_shuttingDown=false;
CFader::setFadingIn();
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CFrontEndCredits::unselect()
{
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CFrontEndCredits::render()
{
POLY_G4 *g4;
g4=GetPrimG4();
setXYWH(g4,0,0,512,256);
setRGB0(g4,99,50,50);
setRGB1(g4,50,50,99);
setRGB2(g4,50,99,50);
setRGB3(g4,99,50,99);
AddPrimToList(g4,1001);
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CFrontEndCredits::think(int _frames)
{
if(!m_shuttingDown)
{
if(PadGetDown(0)&(PAD_CROSS|PAD_START))
{
m_shuttingDown=true;
CFader::setFadingOut();
}
}
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
int CFrontEndCredits::isReadyToExit()
{
return !CFader::isFading()&&m_shuttingDown;
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
CFrontEndScene::FrontEndMode CFrontEndCredits::getNextMode()
{
return CFrontEndScene::MODE__MAIN_TITLES;
}
/*===========================================================================
end */

70
source/frontend/credits.h Normal file
View File

@ -0,0 +1,70 @@
/*=========================================================================
credits.h
Author: PKG
Created:
Project: Spongebob
Purpose:
Copyright (c) 2000 Climax Development Ltd
===========================================================================*/
#ifndef __FRONTEND_CREDITS_H__
#define __FRONTEND_CREDITS_H__
/*----------------------------------------------------------------------
Includes
-------- */
#ifndef __FRONTEND_FRONTEND_H__
#include "frontend\frontend.h"
#endif
/* Std Lib
------- */
/*----------------------------------------------------------------------
Tyepdefs && Defines
------------------- */
/*----------------------------------------------------------------------
Structure defintions
-------------------- */
class CFrontEndCredits : public CFrontEndMode
{
public:
void init();
void shutdown();
void select();
void unselect();
void render();
void think(int _frames);
int isReadyToExit();
CFrontEndScene::FrontEndMode getNextMode();
private:
int m_shuttingDown;
};
/*----------------------------------------------------------------------
Globals
------- */
/*----------------------------------------------------------------------
Functions
--------- */
/*---------------------------------------------------------------------- */
#endif /* __FRONTEND_CREDITS_H__ */
/*===========================================================================
end */

View File

@ -133,7 +133,6 @@ void CFrontEndDemoMode::unselect()
void CFrontEndDemoMode::render()
{
sFrameHdr *fh;
POLY_FT4 *ft4;
// Game logo/title
fh=m_sprites->getFrameHeader(FRM__SBLOGO);

View File

@ -18,10 +18,6 @@
Includes
-------- */
#ifndef __PRIM_HEADER__
#include "gfx\prim.h"
#endif
#ifndef __FRONTEND_FRONTEND_H__
#include "frontend\frontend.h"
#endif

View File

@ -30,10 +30,18 @@
#include "frontend\options.h"
#endif
#ifndef __FRONTEND_START_H__
#include "frontend\start.h"
#endif
#ifndef __FRONTEND_DEMOMODE_H__
#include "frontend\demomode.h"
#endif
#ifndef __FRONTEND_CREDITS_H__
#include "frontend\credits.h"
#endif
/* Std Lib
------- */
@ -59,14 +67,17 @@
static CFrontEndMainTitles s_frontEndModeMainTitles;
static CFrontEndOptions s_frontEndModeOptions;
static CFrontEndStart s_frontEndStart;
static CFrontEndDemoMode s_frontEndDemoMode;
static CFrontEndCredits s_frontEndCredits;
CFrontEndMode *CFrontEndScene::s_modeCodes[]=
{
&s_frontEndModeMainTitles, // MODE__MAIN_TITLES
&s_frontEndModeOptions, // MODE__GAME_OPTIONS
NULL, // MODE__CHOOSE_SLOT
&s_frontEndStart, // MODE__CHOOSE_SLOT
&s_frontEndDemoMode, // MODE__DEMO
&s_frontEndCredits, // MODE__CREDITS
NULL, // MODE__NONE
};

View File

@ -43,6 +43,7 @@ public:
MODE__GAME_OPTIONS,
MODE__CHOOSE_SLOT,
MODE__DEMO,
MODE__CREDITS,
MODE__NONE,
} FrontEndMode;

View File

@ -125,7 +125,7 @@ void CFrontEndMainTitles::init()
CGUIFactory::createValueButtonFrame(m_mainMenu,
50,40,200,20,
STR__FRONTEND__CREDITS,
&m_gotoOptionsFlag,true);
&m_gotoCreditsFlag,true);
}
/*----------------------------------------------------------------------
@ -155,6 +155,7 @@ void CFrontEndMainTitles::select()
m_startGameFlag=false;
m_gotoOptionsFlag=false;
m_gotoCreditsFlag=false;
m_demoTimeout=0;
@ -269,13 +270,18 @@ rsr=(rsr+(_frames*rspeed))&4095;
if(m_startGameFlag)
{
CFader::setFadingOut();
m_mode=MODE__START_GAME;
m_mode=MODE__GOTO_CHOOSE_SLOT;
}
else if(m_gotoOptionsFlag)
{
CFader::setFadingOut();
m_mode=MODE__GOTO_OPTIONS;
}
else if(m_gotoCreditsFlag)
{
CFader::setFadingOut();
m_mode=MODE__GOTO_CREDITS;
}
break;
default:
@ -309,7 +315,7 @@ rsr=(rsr+(_frames*rspeed))&4095;
---------------------------------------------------------------------- */
int CFrontEndMainTitles::isReadyToExit()
{
return !CFader::isFading()&&(m_mode==MODE__START_GAME||m_mode==MODE__GOTO_OPTIONS||m_mode==MODE__GOTO_DEMO);
return !CFader::isFading()&&(m_mode==MODE__GOTO_CHOOSE_SLOT||m_mode==MODE__GOTO_OPTIONS||m_mode==MODE__GOTO_DEMO||m_mode==MODE__GOTO_CREDITS);
}
@ -331,8 +337,8 @@ CFrontEndScene::FrontEndMode CFrontEndMainTitles::getNextMode()
ASSERT(0);
break;
case MODE__START_GAME:
ret=CFrontEndScene::MODE__MAIN_TITLES;//MODE__CHOOSE_SLOT;
case MODE__GOTO_CHOOSE_SLOT:
ret=CFrontEndScene::MODE__CHOOSE_SLOT;
break;
case MODE__GOTO_OPTIONS:
@ -342,6 +348,10 @@ CFrontEndScene::FrontEndMode CFrontEndMainTitles::getNextMode()
case MODE__GOTO_DEMO:
ret=CFrontEndScene::MODE__DEMO;
break;
case MODE__GOTO_CREDITS:
ret=CFrontEndScene::MODE__CREDITS;
break;
}
return ret;

View File

@ -77,10 +77,11 @@ private:
{
MODE__PRESS_START,
MODE__SELECT_OPTION,
MODE__START_GAME,
MODE__GOTO_CHOOSE_SLOT,
MODE__GOTO_OPTIONS,
MODE__GOTO_DEMO,
MODE__GOTO_CREDITS,
};
enum
@ -102,6 +103,7 @@ private:
int m_startGameFlag;
int m_gotoOptionsFlag;
int m_gotoCreditsFlag;
int m_demoTimeout;

View File

@ -125,6 +125,14 @@ SOURCE=..\..\..\source\fileio\pcfile.h
# PROP Default_Filter ""
# Begin Source File
SOURCE=..\..\..\source\frontend\credits.cpp
# End Source File
# Begin Source File
SOURCE=..\..\..\source\frontend\credits.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\frontend\demomode.cpp
# End Source File
# Begin Source File
@ -163,6 +171,14 @@ SOURCE=..\..\..\source\frontend\scrollbg.cpp
SOURCE=..\..\..\source\frontend\scrollbg.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\frontend\start.cpp
# End Source File
# Begin Source File
SOURCE=..\..\..\source\frontend\start.h
# End Source File
# End Group
# Begin Group "game"