2000-09-12 01:52:04 +02:00
|
|
|
/*=========================================================================
|
|
|
|
|
|
|
|
paul.cpp
|
|
|
|
|
|
|
|
Author: PKG
|
|
|
|
Created:
|
|
|
|
Project: Spongebob
|
|
|
|
Purpose:
|
|
|
|
|
|
|
|
Copyright (c) 2000 Climax Development Ltd
|
|
|
|
|
|
|
|
===========================================================================*/
|
|
|
|
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------
|
|
|
|
Includes
|
|
|
|
-------- */
|
2001-08-04 20:42:27 +02:00
|
|
|
#if defined(__VERSION_DEBUG__)
|
2000-09-12 01:52:04 +02:00
|
|
|
|
|
|
|
#include "paul\paul.h"
|
|
|
|
|
|
|
|
#ifndef __SYSTEM_DBG_H__
|
|
|
|
#include "system\dbg.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef __GFX_FONT_H__
|
|
|
|
#include "gfx\font.h"
|
|
|
|
#endif
|
|
|
|
|
2000-09-15 18:51:09 +02:00
|
|
|
#ifndef __MEMORY_HEADER__
|
|
|
|
#include "mem\memory.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef __UTILS_HEADER__
|
|
|
|
#include "utils\utils.h"
|
|
|
|
#endif
|
|
|
|
|
2000-10-05 16:16:09 +02:00
|
|
|
#ifndef __SOUND_SOUND_H__
|
|
|
|
#include "sound\sound.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef __PAD_PADS_H__
|
|
|
|
#include "pad\pads.h"
|
|
|
|
#endif
|
|
|
|
|
2000-10-18 00:04:57 +02:00
|
|
|
#ifndef __GFX_SPRBANK_H__
|
|
|
|
#include "gfx\sprbank.h"
|
|
|
|
#endif
|
|
|
|
|
2000-10-31 17:43:44 +01:00
|
|
|
#ifndef __GUI_GUI_H__
|
|
|
|
#include "gui\gui.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef __GUI_GTEXTBOX_H__
|
|
|
|
#include "gui\gtextbox.h"
|
|
|
|
#endif
|
|
|
|
|
2000-11-02 18:16:10 +01:00
|
|
|
#ifndef __GUI_GFRAME_H__
|
|
|
|
#include "gui\gframe.h"
|
|
|
|
#endif
|
|
|
|
|
2000-10-31 17:43:44 +01:00
|
|
|
#ifndef __GUI_GREADOUT_H__
|
|
|
|
#include "gui\greadout.h"
|
|
|
|
#endif
|
|
|
|
|
2000-11-02 18:16:10 +01:00
|
|
|
#ifndef __GUI_GBUTTON_H__
|
|
|
|
#include "gui\gbutton.h"
|
|
|
|
#endif
|
|
|
|
|
2000-11-20 16:45:17 +01:00
|
|
|
//#ifndef __GUI_GTEXTENT_H__
|
|
|
|
//#include "gui\gtextent.h"
|
|
|
|
//#endif
|
2000-11-07 23:05:42 +01:00
|
|
|
|
2000-10-31 17:43:44 +01:00
|
|
|
#ifndef __LOCALE_TEXTDBASE_H__
|
|
|
|
#include "locale\textdbase.h"
|
|
|
|
#endif
|
|
|
|
|
2000-11-13 18:03:20 +01:00
|
|
|
#ifndef __FRONTEND_SCROLLBG_H__
|
|
|
|
#include "frontend\scrollbg.h"
|
|
|
|
#endif
|
|
|
|
|
2000-12-12 22:33:19 +01:00
|
|
|
#ifndef __SCRIPT_SCRIPT_H__
|
|
|
|
#include "script\script.h"
|
2000-12-12 21:51:59 +01:00
|
|
|
#endif
|
|
|
|
|
2000-09-12 01:52:04 +02:00
|
|
|
|
|
|
|
/* Std Lib
|
|
|
|
------- */
|
|
|
|
|
|
|
|
/* Data
|
|
|
|
---- */
|
|
|
|
|
2001-04-20 16:53:35 +02:00
|
|
|
#ifndef __SPR_SPRITES_H__
|
|
|
|
#include <sprites.h>
|
2000-11-03 01:07:42 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2000-09-12 01:52:04 +02:00
|
|
|
/*----------------------------------------------------------------------
|
|
|
|
Tyepdefs && Defines
|
|
|
|
------------------- */
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------
|
|
|
|
Structure defintions
|
|
|
|
-------------------- */
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------
|
|
|
|
Function Prototypes
|
|
|
|
------------------- */
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------
|
|
|
|
Vars
|
|
|
|
---- */
|
|
|
|
static FontBank s_fontBank;
|
2000-12-12 21:51:59 +01:00
|
|
|
|
2000-09-12 01:52:04 +02:00
|
|
|
/*----------------------------------------------------------------------
|
|
|
|
Function:
|
|
|
|
Purpose:
|
|
|
|
Params:
|
|
|
|
Returns:
|
|
|
|
---------------------------------------------------------------------- */
|
2000-10-31 17:43:44 +01:00
|
|
|
void CPaulScene::init()
|
|
|
|
{
|
2000-11-20 16:45:17 +01:00
|
|
|
s_fontBank.initialise(&standardFont);
|
|
|
|
s_fontBank.setColour(255,255,255);
|
2000-09-12 01:52:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-11-13 18:03:20 +01:00
|
|
|
|
2000-09-12 01:52:04 +02:00
|
|
|
/*----------------------------------------------------------------------
|
|
|
|
Function:
|
|
|
|
Purpose:
|
|
|
|
Params:
|
|
|
|
Returns:
|
|
|
|
---------------------------------------------------------------------- */
|
|
|
|
void CPaulScene::shutdown()
|
|
|
|
{
|
2000-10-31 17:43:44 +01:00
|
|
|
s_fontBank.dump();
|
2000-09-12 01:52:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------
|
|
|
|
Function:
|
|
|
|
Purpose:
|
|
|
|
Params:
|
|
|
|
Returns:
|
|
|
|
---------------------------------------------------------------------- */
|
2000-11-03 01:07:42 +01:00
|
|
|
int showDebugLog=false;
|
2000-09-12 01:52:04 +02:00
|
|
|
void CPaulScene::render()
|
|
|
|
{
|
2001-07-30 16:54:19 +02:00
|
|
|
#if defined(__VERSION_DEBUG__)
|
2000-11-03 01:07:42 +01:00
|
|
|
if(showDebugLog)
|
2000-09-12 01:52:04 +02:00
|
|
|
{
|
2000-11-03 01:07:42 +01:00
|
|
|
int logCount;
|
|
|
|
int i,y,charHeight;
|
|
|
|
logCount=getNumberOfDbgLinesInLog();
|
|
|
|
y=20;
|
|
|
|
charHeight=s_fontBank.getCharHeight();
|
|
|
|
for(i=0;i<logCount;i++)
|
|
|
|
{
|
|
|
|
s_fontBank.print(20,y,getDbgLineFromLog(i));
|
|
|
|
y+=charHeight;
|
|
|
|
}
|
2000-09-12 01:52:04 +02:00
|
|
|
}
|
2001-07-30 16:54:19 +02:00
|
|
|
#endif
|
2000-09-12 01:52:04 +02:00
|
|
|
}
|
|
|
|
|
2000-10-31 17:43:44 +01:00
|
|
|
|
2000-09-12 01:52:04 +02:00
|
|
|
/*----------------------------------------------------------------------
|
|
|
|
Function:
|
|
|
|
Purpose:
|
|
|
|
Params:
|
|
|
|
Returns:
|
|
|
|
---------------------------------------------------------------------- */
|
2001-01-29 18:55:07 +01:00
|
|
|
int sfxNum=0;
|
2000-10-19 17:40:24 +02:00
|
|
|
void CPaulScene::think(int _frames)
|
2000-09-12 01:52:04 +02:00
|
|
|
{
|
2000-11-16 18:23:31 +01:00
|
|
|
if(PadGetHeld(0)&PAD_R1&&PadGetDown(0)&PAD_R2)
|
|
|
|
{
|
|
|
|
showDebugLog=!showDebugLog;
|
|
|
|
}
|
|
|
|
|
2001-01-29 18:55:07 +01:00
|
|
|
int pad=PadGetDown(1);
|
|
|
|
if(pad&PAD_CIRCLE)
|
2000-11-03 17:41:57 +01:00
|
|
|
{
|
2001-01-29 18:55:07 +01:00
|
|
|
CSoundMediator::playSfx((CSoundMediator::SFXID)sfxNum);
|
|
|
|
}
|
|
|
|
else if(pad&PAD_UP)
|
|
|
|
{
|
2001-01-30 22:38:06 +01:00
|
|
|
if(++sfxNum>CSoundMediator::NUM_SFXIDS-1)sfxNum=CSoundMediator::NUM_SFXIDS-1;
|
2001-01-29 18:55:07 +01:00
|
|
|
}
|
|
|
|
else if(pad&PAD_DOWN)
|
|
|
|
{
|
|
|
|
if(--sfxNum<0)sfxNum=0;
|
2000-11-03 17:41:57 +01:00
|
|
|
}
|
2000-09-12 01:52:04 +02:00
|
|
|
}
|
|
|
|
|
2001-08-04 20:42:27 +02:00
|
|
|
#else
|
|
|
|
void PaulDummyStub()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
#endif
|
2000-09-12 01:52:04 +02:00
|
|
|
|
|
|
|
/*===========================================================================
|
2000-11-13 18:03:20 +01:00
|
|
|
end */
|