SBSPSS/source/paul/paul.cpp

151 lines
2.8 KiB
C++
Raw Normal View History

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-09-12 01:52:04 +02:00
/* Std Lib
------- */
/* Data
---- */
/*----------------------------------------------------------------------
Tyepdefs && Defines
------------------- */
/*----------------------------------------------------------------------
Structure defintions
-------------------- */
/*----------------------------------------------------------------------
Function Prototypes
------------------- */
/*----------------------------------------------------------------------
Vars
---- */
static FontBank s_fontBank;
2000-09-15 18:51:09 +02:00
char *s_mem[3];
2000-09-12 01:52:04 +02:00
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CPaulScene::init()
{
setActiveDbgChannels(DC_PAUL);
PAUL_DBGMSG("this is a message..");
PAUL_DBGMSG("this is a message.. 2");
PAUL_DBGMSG("this is a message.. 3");
s_fontBank.initialise(&standardFont);
2000-09-15 18:51:09 +02:00
2000-09-12 01:52:04 +02:00
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CPaulScene::shutdown()
{
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CPaulScene::render()
{
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;
}
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
2000-09-15 18:51:09 +02:00
int trashoff=-1;
int trash=false;
2000-09-12 01:52:04 +02:00
void CPaulScene::think()
{
2000-09-12 01:56:23 +02:00
// static int arse=0;
// PAUL_DBGMSG("%d\n",arse++);
// ASSERT(arse<100);
2000-09-15 18:51:09 +02:00
int i;
int size[3];
for(i=0;i<3;i++)
{
size[i]=32763;//getRndRange(32768);
s_mem[i]=MemAlloc(size[i],"Test");
}
PAUL_DBGMSG("%d %d %d",size[0],size[1],size[2]);
if(trash)
{
*(s_mem[0]+trashoff)=123;
trash=false;
}
for(i=0;i<3;i++)
{
MemFree(s_mem[i]);
}
2000-09-12 01:52:04 +02:00
}
/*===========================================================================
end */