This commit is contained in:
parent
1966aa6f60
commit
2b171295b5
44 changed files with 588 additions and 603 deletions
|
@ -1,33 +1,7 @@
|
|||
/*=========================================================================
|
||||
|
||||
PAK.CPP
|
||||
|
||||
Author: Gary Liddon @ Climax (from work by Nick Pelling && Carl Muller)
|
||||
Created:
|
||||
Project: Diablo PSX
|
||||
Purpose: PAK decompress \ compress code
|
||||
|
||||
Copyright (c) 1997 Climax Development Ltd
|
||||
|
||||
===========================================================================*/
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Includes
|
||||
-------- */
|
||||
|
||||
/* Std Lib
|
||||
------- */
|
||||
|
||||
/* Glib
|
||||
---- */
|
||||
|
||||
/* Local
|
||||
----- */
|
||||
#include "system\global.h"
|
||||
#include <string.h>
|
||||
#include "pak.h"
|
||||
#include "utils\pak.h"
|
||||
|
||||
/* Graphics
|
||||
-------- */
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Tyepdefs && Defines
|
||||
|
@ -44,7 +18,7 @@
|
|||
struct Block
|
||||
{
|
||||
int data[128];
|
||||
BOOL blockrep;
|
||||
bool blockrep;
|
||||
int blocksize;
|
||||
int blockoffset;
|
||||
|
||||
|
@ -115,7 +89,7 @@ void Block::writeBlock(void)
|
|||
}
|
||||
|
||||
// Get ready for next block
|
||||
blockrep = FALSE;
|
||||
blockrep = false;
|
||||
blockoffset = 0;
|
||||
blocksize = -1;
|
||||
}
|
||||
|
@ -158,7 +132,7 @@ int lowLevelPak(u8 * Dest,u8 const * buffer,int insize,Block & theblock)
|
|||
|
||||
theblock.Dest=Dest;
|
||||
theblock.outsize=0;
|
||||
theblock.blockrep=FALSE;
|
||||
theblock.blockrep=false;
|
||||
|
||||
BACKDIST = -128;
|
||||
FORWARDDIST = 255;
|
||||
|
@ -244,7 +218,7 @@ int lowLevelPak(u8 * Dest,u8 const * buffer,int insize,Block & theblock)
|
|||
{
|
||||
/* We have found a match */
|
||||
theblock.writeBlock();
|
||||
theblock.blockrep = TRUE;
|
||||
theblock.blockrep = true;
|
||||
theblock.blocksize = bestlength;
|
||||
theblock.blockoffset = bestoffset;
|
||||
inpos += bestlength;
|
||||
|
@ -257,7 +231,7 @@ int lowLevelPak(u8 * Dest,u8 const * buffer,int insize,Block & theblock)
|
|||
|
||||
/* Terminate file */
|
||||
|
||||
theblock.blockrep = TRUE;
|
||||
theblock.blockrep = true;
|
||||
theblock.blocksize = 0;
|
||||
theblock.blockoffset = 0;
|
||||
theblock.writeBlock();
|
||||
|
|
|
@ -1,61 +1,12 @@
|
|||
/*=========================================================================
|
||||
|
||||
PAK.H
|
||||
|
||||
Author: Carl Muller (algorithm Nick Pelling && Carl Muller)
|
||||
Created:
|
||||
Project:
|
||||
Purpose:
|
||||
|
||||
Copyright (c) 1997 Climax Development Ltd
|
||||
|
||||
===========================================================================*/
|
||||
|
||||
#ifndef __PAK_PAK_H__
|
||||
#define __PAK_PAK_H__
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Includes
|
||||
-------- */
|
||||
|
||||
/* Std Lib
|
||||
------- */
|
||||
|
||||
/* Glib
|
||||
---- */
|
||||
#include <gtypes.h>
|
||||
|
||||
/* Local
|
||||
----- */
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Tyepdefs && Defines
|
||||
------------------- */
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Structure defintions
|
||||
-------------------- */
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Globals
|
||||
------- */
|
||||
|
||||
/* Vars
|
||||
---- */
|
||||
|
||||
/* Data
|
||||
---- */
|
||||
|
||||
/* Functions
|
||||
--------- */
|
||||
int PAK_doPak(u8 * Dest,u8 const * source,int insize);
|
||||
int PAK_doUnpak(u8 * Dest,u8 const * Source);
|
||||
int PAK_findPakSize(u8 const * souce,int insize);
|
||||
int PAK_getLastAmountOfDataRead(void);
|
||||
|
||||
/*---------------------------------------------------------------------- */
|
||||
|
||||
#endif /* __PAK_PAK_H__ */
|
||||
|
||||
/*===========================================================================
|
||||
end */
|
||||
#endif
|
||||
|
|
|
@ -580,6 +580,7 @@ s32 Dpx, Dpy, Dpz;
|
|||
return (Dpx + Dpy + Dpz);
|
||||
}
|
||||
/*****************************************************************************/
|
||||
/*
|
||||
inline void QuatSlerp(sQuat *s, sQuat *d, int t, sQuat *o)
|
||||
{
|
||||
s32 xx, yy, zz, ww;
|
||||
|
@ -627,8 +628,9 @@ sQuat to;
|
|||
gte_LoadAverageShort12(s, &to, c0, c1, o);
|
||||
o->vw = ((c0 * s->vw) + (c1 * to.vw)) >> 12;
|
||||
}
|
||||
|
||||
*/
|
||||
/*****************************************************************************/
|
||||
/*
|
||||
static const s32 DeltaErr = 1000;
|
||||
inline void NormalizeQuaternion(sQuat *o)
|
||||
{
|
||||
|
@ -646,5 +648,5 @@ s32 t = (u32)((s32)o->vx*o->vx+(s32)o->vy*o->vy+(s32)o->vz*o->vz+(s32)o->vw*o->v
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue