This commit is contained in:
Daveo 2000-08-29 20:16:17 +00:00
parent 829e58ea1c
commit b87d55be86
13 changed files with 45 additions and 71 deletions

View file

@ -18,7 +18,9 @@
#include "gfx\fdata.h"
#ifndef __FILE_EQUATES_H__
#include "biglump.h"
#endif
#include <UiGfx.h>

View file

@ -18,11 +18,14 @@
Includes
-------- */
#ifndef _GLOBAL_HEADER_
#include "system\global.h"
#ifndef _GLOBAL_HEADER_
#include "system\global.h"
#endif
#ifndef __FILE_EQUATES_H__
#include <biglump.h>
#endif
/* Std Lib
------- */

View file

@ -8,10 +8,12 @@
#ifndef _GLOBAL_HEADER_
#include "system\global.h"
#endif
#ifndef __TPAGE_H__
#include "gfx\tpage.h"
#endif
#define MAX_OT (2048)
#define MAX_PRIMS (2048+512)
#define MAX_PRIMS (1024)
#define USE_NTAGS 1

View file

@ -61,8 +61,6 @@
static SpriteBankInstance *s_bankList = NULL;
//#define SPRITE_BANK_DEBUG
/*----------------------------------------------------------------------
Function:
Purpose:
@ -71,9 +69,6 @@ static SpriteBankInstance *s_bankList = NULL;
---------------------------------------------------------------------- */
SpriteBankInstance::SpriteBankInstance( SpriteBankInstance *_next )
{
#ifdef SPRITE_BANK_DEBUG
printf("SpriteBankInstance()\n");
#endif
m_frameHdr=NULL;
m_file=FileEquate( -1 );
m_refCount=0;
@ -88,9 +83,6 @@ printf("SpriteBankInstance()\n");
---------------------------------------------------------------------- */
SpriteBankInstance::~SpriteBankInstance()
{
#ifdef SPRITE_BANK_DEBUG
printf("~SpriteBankInstance() file=%d\n",m_file);
#endif
ASSERT( !m_frameHdr );
}
@ -100,19 +92,13 @@ printf("~SpriteBankInstance() file=%d\n",m_file);
Params:
Returns:
---------------------------------------------------------------------- */
int loadcount=0;
void SpriteBankInstance::load( FileEquate _file )
{
#ifdef SPRITE_BANK_DEBUG
printf("SpriteBankInstance::load() file=%d\n",_file);
#endif
if( m_refCount )
{
ASSERT( _file == m_file );
m_refCount++;
#ifdef SPRITE_BANK_DEBUG
printf(" loaded reference" );
#endif
}
else
{
@ -120,15 +106,8 @@ printf(" loaded reference" );
m_file=_file;
m_refCount=1;
#ifdef SPRITE_BANK_DEBUG
printf(" loaded physical %d",m_file );
#endif
}
#ifdef SPRITE_BANK_DEBUG
printf(" - refcount=%d\n",m_refCount);
#endif
loadcount++;
}
/*----------------------------------------------------------------------
@ -139,30 +118,17 @@ loadcount++;
---------------------------------------------------------------------- */
int SpriteBankInstance::dump()
{
#ifdef SPRITE_BANK_DEBUG
printf("SpriteBankInstance::dump() file=%d\n",m_file);
#endif
int ret=false;
ASSERT(m_frameHdr);
m_refCount--;
#ifdef SPRITE_BANK_DEBUG
printf(" refcount now %d",m_refCount);
#endif
if( m_refCount == 0 )
{
#ifdef SPRITE_BANK_DEBUG
printf(" ..freeing\n");
#endif
TPFree(m_tpageDesc);
MemFree(m_frameHdr);
m_frameHdr=NULL;
ret=true;
}
#ifdef SPRITE_BANK_DEBUG
printf("\n");
#endif
loadcount--;
return ret;
}

View file

@ -176,14 +176,14 @@ sTPageInfo *Cache;
if (TPage) // Is in cache, no need to load it again :o)
{
DBG_MSG2("TPLoadTex Cached (%i,%i)",TPage,Half);
// DBG_MSG2("TPLoadTex Cached (%i,%i)",TPage,Half);
s_TPCache[TPage].Info[Half].RefCount++;
Cache=&s_TPCache[TPage].Info[Half];
FramePtr=&Cache->AnimTexFrame[0];
}
else
{ // Better load it then
DBG_MSG0("TPLoadTex");
// DBG_MSG0("TPLoadTex");
TPHdr=(sTPageHdr*)CFileIO::loadFile(Filename,"TPLoadTEX");
ASSERT(!TPHdr->NumOfSpareBoxes);
FramePtr=(sFrameHdr*) MakePtr(TPHdr,sizeof(sTPageHdr));
@ -230,13 +230,13 @@ int ReadLeft;
if (TPage) // Found one!!
{
DBG_MSG2("TPLoadTexWithHeaders Cached (%i,%i)",TPage,Half);
// DBG_MSG2("TPLoadTexWithHeaders Cached (%i,%i)",TPage,Half);
s_TPCache[TPage].Info[Half].RefCount++;
Cache=&s_TPCache[TPage].Info[Half];
}
else
{
DBG_MSG0("TPLoadTexWithHeaders");
// DBG_MSG0("TPLoadTexWithHeaders");
CFileIO::OpenFile(Filename);
// Load Main Header
CFileIO::ReadFile((void*)&TPHdr,sizeof(sTPageHdr));

View file

@ -2,10 +2,12 @@
/*** PSX Vram Stuff ***/
/**********************/
#ifndef __VRAM_H__
#define __VRAM_H__
#ifndef __TPAGE_H__
#define __TPAGE_H__
#ifndef __FILE_EQUATES_H__
#include <BigLump.h>
#endif
/*************************************************************************************************/
#define TPAGE_MAX_ANIM_TEX 8