2000-09-12 01:52:04 +02:00
|
|
|
/*=========================================================================
|
|
|
|
|
|
|
|
paul.cpp
|
|
|
|
|
|
|
|
Author: PKG
|
|
|
|
Created:
|
|
|
|
Project: Spongebob
|
|
|
|
Purpose:
|
|
|
|
|
|
|
|
Copyright (c) 2000 Climax Development Ltd
|
|
|
|
|
|
|
|
===========================================================================*/
|
|
|
|
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------
|
|
|
|
Includes
|
|
|
|
-------- */
|
|
|
|
|
|
|
|
#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
|
|
|
|
|
|
|
|
#ifndef __GUI_GREADOUT_H__
|
|
|
|
#include "gui\greadout.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef __LOCALE_TEXTDBASE_H__
|
|
|
|
#include "locale\textdbase.h"
|
|
|
|
#endif
|
|
|
|
|
2000-09-12 01:52:04 +02:00
|
|
|
|
|
|
|
/* Std Lib
|
|
|
|
------- */
|
|
|
|
|
|
|
|
/* Data
|
|
|
|
---- */
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------
|
|
|
|
Tyepdefs && Defines
|
|
|
|
------------------- */
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------
|
|
|
|
Structure defintions
|
|
|
|
-------------------- */
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------
|
|
|
|
Function Prototypes
|
|
|
|
------------------- */
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------
|
|
|
|
Vars
|
|
|
|
---- */
|
|
|
|
static FontBank s_fontBank;
|
|
|
|
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------
|
|
|
|
Function:
|
|
|
|
Purpose:
|
|
|
|
Params:
|
|
|
|
Returns:
|
|
|
|
---------------------------------------------------------------------- */
|
2000-10-31 17:43:44 +01:00
|
|
|
unsigned int str=STR__PAULS_TEST_STRING_1;
|
|
|
|
int w=150;
|
|
|
|
int h=40;
|
2000-10-18 00:04:57 +02:00
|
|
|
|
2000-10-31 17:43:44 +01:00
|
|
|
int testValue=1;
|
|
|
|
CGUITextReadout::TextReadoutData testData[]=
|
2000-09-12 01:52:04 +02:00
|
|
|
{
|
2000-10-31 17:43:44 +01:00
|
|
|
{ 1, STR__PAULS_TEST_STRING_1, },
|
|
|
|
{ 2, STR__PAULS_TEST_STRING_2, },
|
|
|
|
{ 3, STR__PAULS_TEST_STRING_3, },
|
|
|
|
{ 0, 0, },
|
|
|
|
};
|
2000-09-15 18:51:09 +02:00
|
|
|
|
2000-10-06 00:40:39 +02:00
|
|
|
|
2000-10-05 16:16:09 +02:00
|
|
|
|
2000-10-31 17:43:44 +01:00
|
|
|
void CPaulScene::init()
|
|
|
|
{
|
|
|
|
s_fontBank.initialise(&standardFont);
|
|
|
|
guiOpen();
|
|
|
|
|
|
|
|
CGUITextBox *tb;
|
|
|
|
tb=new ("textbox") CGUITextBox();
|
|
|
|
tb->init(1);
|
|
|
|
tb->setObjectXY(200,130);
|
|
|
|
|
|
|
|
CGUITextReadout *tr;
|
|
|
|
tr=new ("textreadout") CGUITextReadout();
|
|
|
|
tr->init(2);
|
|
|
|
tr->setObjectXYWH(40,130,120,80);
|
|
|
|
tr->setReadoutTarget(&testValue);
|
|
|
|
tr->setReadoutData(testData);
|
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();
|
|
|
|
guiClose();
|
2000-09-12 01:52:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------
|
|
|
|
Function:
|
|
|
|
Purpose:
|
|
|
|
Params:
|
|
|
|
Returns:
|
|
|
|
---------------------------------------------------------------------- */
|
|
|
|
void CPaulScene::render()
|
|
|
|
{
|
|
|
|
int logCount;
|
|
|
|
int i,y,charHeight;
|
2000-10-31 17:43:44 +01:00
|
|
|
|
2000-09-12 01:52:04 +02:00
|
|
|
logCount=getNumberOfDbgLinesInLog();
|
|
|
|
y=20;
|
|
|
|
charHeight=s_fontBank.getCharHeight();
|
|
|
|
for(i=0;i<logCount;i++)
|
|
|
|
{
|
|
|
|
s_fontBank.print(20,y,getDbgLineFromLog(i));
|
|
|
|
y+=charHeight;
|
|
|
|
}
|
2000-10-31 17:43:44 +01:00
|
|
|
|
|
|
|
guiRender();
|
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:
|
|
|
|
---------------------------------------------------------------------- */
|
2000-10-19 17:40:24 +02:00
|
|
|
void CPaulScene::think(int _frames)
|
2000-09-12 01:52:04 +02:00
|
|
|
{
|
2000-10-31 17:43:44 +01:00
|
|
|
CGUITextBox *tb;
|
|
|
|
tb=(CGUITextBox *)guiGetItem(1);
|
|
|
|
tb->setObjectWH(w,h);
|
|
|
|
tb->setText(str);
|
2000-10-11 18:47:03 +02:00
|
|
|
|
2000-10-31 17:43:44 +01:00
|
|
|
guiThink(GameState::getFramesSinceLast());
|
2000-09-12 01:52:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*===========================================================================
|
|
|
|
end */
|