Create lib/ivis_common/ which is code that is shared between software SDL and OpenGL

implementations. Start by sharing all identical header files, and bug.c for proof of 
concept. This breaks pure makefile builds, will try to fix in next commit.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@236 4a71c877-e1ca-e34f-864e-861f7616d084
master
Per Inge Mathisen 2005-08-08 21:09:37 +00:00
parent 1bc281682e
commit d01c2360f7
50 changed files with 48 additions and 1859 deletions

View File

@ -225,6 +225,7 @@ AC_CONFIG_FILES([Makefile
lib/gamelib/Makefile
lib/ivis_opengl/Makefile
lib/ivis02/Makefile
lib/ivis_common/Makefile
lib/netplay/Makefile
lib/script/Makefile
lib/sequence/Makefile

View File

@ -1,9 +1,8 @@
noinst_LIBRARIES = libivis02.a
AM_CPPFLAGS = -I../framework -I../gamelib -I../..
AM_CPPFLAGS = -I../framework -I../gamelib -I../.. -I../ivis_common
libivis02_a_SOURCES = \
bitimage.c \
bspimd.c \
bug.c \
fbf.c \
imd.c \
imdload.c \
@ -25,13 +24,16 @@ libivis02_a_SOURCES = \
textdraw.c \
v4101_stub.c \
vsr.c \
bspimd.h fbf.h pcx.h piemode.h rendmode.h vid.h \
bug.h geo.h pieblitfunc.h piepalette.h screen.h vsr.h \
imd.h pieclip.h piestate.h \
ivi.h piedef.h pietexture.h tex.h \
bitimage.h dglide.h ivisdef.h piefunc.h pietypes.h textdraw.h \
bspfunc.h ivispatch.h piematrix.h rendfunc.h v4101.h
rendmode.h \
vid.h \
screen.h \
vsr.h \
pietexture.h \
tex.h \
dglide.h \
piematrix.h \
v4101.h
libivis02_a_libs = ../framework/libframework.a
libivis02_a_libs = ../framework/libframework.a ../ivis_common/libivis_common.a
libivis02_a_DEPENDENCIES = $(libivis02_a_libs)
libivis02_a_LIBADD = $(libivis02_a_libs)

View File

@ -1,23 +0,0 @@
#ifndef _bspfunc_h_
#define _bspfunc_h_
#include "ivisdef.h"
#include "bspimd.h"
/***************************************************************************/
extern void GetRealCameraPos(OBJPOS *Camera,SDWORD Distance, iVector *CameraLoc);
extern void DrawBSPIMD( iIMDShape *IMDdef,iVector * pPos, iIMDPoly *ScrVertices);
extern PSBSPTREENODE InitNode(PSBSPTREENODE psBSPNode);
extern void GetPlane( iIMDShape *s, UDWORD PolygonID, PSPLANE psPlane );
#endif

View File

@ -1,54 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include "ivi.h"
#include "bug.h"
//*************************************************************************
void _debug_create_log(void)
{
FILE *fp;
fp = fopen(iV_DEBUG_FILE,"w");
if (fp)
fclose(fp);
}
void iV_Debug(char *string, ...)
{
va_list argptr;
FILE *fp;
fp = fopen(iV_DEBUG_FILE,"a");
if (fp) {
va_start(argptr,string);
vfprintf(fp,string,argptr);
va_end(argptr);
fclose(fp);
}
}
void iV_DisplayLogFile(void)
{
FILE *fp;
int c;
fp = fopen(iV_DEBUG_FILE,"r");
if (fp) {
while ((c = getc(fp)) != EOF)
DBPRINTF(("%c",c));
fclose(fp);
}
}

View File

@ -1,62 +0,0 @@
#ifndef _bug_
#define _bug_
#include <assert.h>
#define iV_DEBUG_FILE "IVI.LOG"
#ifdef _DEBUG
// #define iV_DEBUG
#endif
#ifdef iV_DEBUG
#define iV_DEBUG0(S) iV_Debug((S))
#define iV_DEBUG1(S,A) iV_Debug((S),(A))
#define iV_DEBUG2(S,A,B) iV_Debug((S),(A),(B))
#define iV_DEBUG3(S,A,B,C) iV_Debug((S),(A),(B),(C))
#define iV_DEBUG4(S,A,B,C,D) iV_Debug((S),(A),(B),(C),(D))
#define iV_DEBUG5(S,A,B,C,D,E) iV_Debug((S),(A),(B),(C),(D),(E))
#define iV_DEBUG6(S,A,B,C,D,E,F) iV_Debug((S),(A),(B),(C),(D),(E),(F))
#define iV_DEBUG7(S,A,B,C,D,E,F,G) iV_Debug((S),(A),(B),(C),(D),(E),(F),(G))
#define iV_DEBUG8(S,A,B,C,D,E,F,G,H) iV_Debug((S),(A),(B),(C),(D),(E),(F),(G),(H))
#define iV_DEBUG9(S,A,B,C,D,E,F,G,H,I) iV_Debug((S),(A),(B),(C),(D),(E),(F),(G),(H),(I))
#define iV_DEBUG10(S,A,B,C,D,E,F,G,H,I,J) iV_Debug((S),(A),(B),(C),(D),(E),(F),(G),(H),(I),(J))
#define iV_DEBUG11(S,A,B,C,D,E,F,G,H,I,J,K) iV_Debug((S),(A),(B),(C),(D),(E),(F),(G),(H),(I),(J),(K))
#define iV_DEBUG12(S,A,B,C,D,E,F,G,H,I,J,K,L) iV_Debug((S),(A),(B),(C),(D),(E),(F),(G),(H),(I),(J),(K),(L))
#define iV_DEBUG_CREATE_LOG _debug_create_log()
#define iV_ASSERT(A) assert((A))
#else
#define iV_DEBUG0(S)
#define iV_DEBUG1(S,A)
#define iV_DEBUG2(S,A,B)
#define iV_DEBUG3(S,A,B,C)
#define iV_DEBUG4(S,A,B,C,D)
#define iV_DEBUG5(S,A,B,C,D,E)
#define iV_DEBUG6(S,A,B,C,D,E,F)
#define iV_DEBUG7(S,A,B,C,D,E,F,G)
#define iV_DEBUG8(S,A,B,C,D,E,F,G,H)
#define iV_DEBUG9(S,A,B,C,D,E,F,G,H,I)
#define iV_DEBUG10(S,A,B,C,D,E,F,G,H,I,J)
#define iV_DEBUG11(S,A,B,C,D,E,F,G,H,I,J,K)
#define iV_DEBUG12(S,A,B,C,D,E,F,G,H,I,J,K,L)
#define iV_DEBUG_CREATE_LOG
#define iV_ASSERT(A)
#endif
//*************************************************************************
extern void iV_Debug(char *string, ...);
extern void iV_DebugDisplayLog(void);
//*************************************************************************
extern void _debug_create_log(void);
#endif

View File

@ -1,114 +0,0 @@
#ifndef _imd_
#define _imd_
#include "ivisdef.h"
#define IMD_NAME "IMD"
#define PIE_NAME "PIE" // Pumpkin image export data file
#define IMD_VER 1
#define PIE_VER 2
#ifdef BSPIMD
#define BSPPOLYID_MAXPOLYID (65534)
#define BSPPOLYID_TERMINATE (BSPPOLYID_MAXPOLYID+1) // This is used as a terminator
#include "bspimd.h"
#include "frame.h"
#endif
//*************************************************************************
#define iV_IMD_MAX_POINTS 256
#define iV_IMD_MAX_POLYS 256
#define iV_IMD_MAX_TEXANIM 256
//*************************************************************************
// polygon flags b0..b7: col, b24..b31: anim index
#define iV_IMD_TEX 0x00000200
#define iV_IMD_TEXANIM 0x00004000 // iV_IMD_TEX must be set also
#define iV_IMD_PSXTEX 0x00008000 // - use playstation texture allocation method
#define iV_IMD_BSPFRESH 0x00010000 // Freshly created by the BSP
#define iV_IMD_NOHALFPSXTEX 0x00020000
// shape override flags
// Are any of these really used anymore ?
#define iV_IMD_XEFFECT 0x1 // if this is set DO NOT PROCESS as a normal 3d pie ! (its a psx effect)
#define iV_IMD_XEFFECT_VPLANE 0x2 // Sprite effect drawn in view plane ( always facing player )
#define iV_IMD_XEFFECT_WPLANE 0x4 // Sprite effect drawn in world plane ( always parallel to terrain )
#define iV_IMD_XEFFECT_PROJECTILE 0x8 // Projectile effect.
#define iV_IMD_BINARY 0x10 // This Pie file was loaded as binary ... when freeing up do not free the pointers ... treat as one big chunk
#define iV_IMD_NOCULLSOME 0x20 // Some polys in the object are drawn without culling.
#define iV_IMD_XFLAT 0x00000100
#define iV_IMD_XTEX 0x00000200
#define iV_IMD_XWIRE 0x00000400
#define iV_IMD_XTRANS 0x00000800
#define iV_IMD_XGOUR 0x00001000
#define iV_IMD_XNOCUL 0x00002000
#define iV_IMD_XOUTLINE 0x00004000
#define iV_IMD_XFIXVIEW 0x00008000
// extended draw routines flags
#define iV_IMDX_AXES 0x00000001
#define iV_IMDX_BOUNDXZ 0x00000002
#define iV_IMDX_CHECKPOINT 0x00000004
#define iV_IMDX_POLYNUMBER 0x00000008
#define iV_IMDX_SPHERE 0x00000010
#define iV_IMDX_XGRID 0x00000020
#define iV_IMDX_YGRID 0x00000040
#define iV_IMDX_ZGRID 0x00000080
#define iV_IMDX_GRID (iV_IMDX_XGRID | iV_IMDX_YGRID | iV_IMDX_ZGRID)
//*************************************************************************
extern BOOL iV_setImagePath(char *path);
extern iIMDShape *iV_IMDLoad(char *filename, iBool palkeep);
extern iIMDShape *iV_ProcessIMD(UBYTE **ppFileData, UBYTE *FileDataEnd, UBYTE *IMDpath, UBYTE *PCXpath,iBool palkeep);
iIMDShape *iV_ProcessBPIE(iIMDShape *, UDWORD size);
extern iBool iV_IMDSave(char *filename, iIMDShape *s, BOOL PieIMD);
extern void iV_IMDDebug(iIMDShape *s);
extern void iV_IMDRelease(iIMDShape *s);
// How high up do we want to stop looking
#define DROID_VIS_UPPER 100
// How low do we stop looking?
#define DROID_VIS_LOWER 10
/* not for PIEDRAW
extern void iV_IMDDrawTextured(iIMDShape *s);
extern void iV_PIEDraw(iIMDShape *s,int frame);
extern void iV_IMDDrawTexturedEnv(iIMDShape *shape, iTexture *env);
extern int iV_IMDDrawTexturedExtended(iIMDShape *shape, iPoint *point2d, uint32 flags);
extern void iV_IMDDrawWire(iIMDShape *shape, uint32 col);
extern void iV_IMDDrawWireExtended(iIMDShape *shape, uint32 col, uint32 flags);
extern void iV_IMDDrawTexturedHeightScaled(iIMDShape *shape, float scale);
// utils *****************************************************************
extern void iV_IMDRotateProject(iIMDShape *shape, iPoint *points2d);
extern void iV_IMDDraw2D(iIMDShape *shape, iPoint *points2d, uint32 col);
extern int iV_IMDPointInShape2D(iIMDShape *shape, iPoint *points2d, iPoint *point);
extern iBool iV_IMDPointInBoundXZ(iIMDShape *s, iPoint *point);
extern void iV_IMDDrawTextureRaise(iIMDShape *shape, float scale);
extern void iV_IMDDrawTexturedShade(iIMDShape *shape, int lightLevel);
*/
extern void tpInit(void);
extern void tpAddPIE(char *FileName,iIMDShape *pIMD);
#endif

View File

@ -1,96 +0,0 @@
//*************************************************************************
//*** ivi.h iVi engine definitions. [Sam Kerbeck]
//* 24-04-96.30-07-96 PC
//* 18-11-96.04-12-96 WIN'95
//*
#ifndef _ivi_
#define _ivi_
#include "piedef.h"
#define iV_SWAP(a,b) { (a) ^= (b); (b) ^= (a); (a) ^= (b); }
#ifdef iV_DDX
#define iV_DDX_ERROR 0x1000000
#endif
#define iV_DIVSHIFT 15
#define iV_DIVMULTP (1<<iV_DIVSHIFT)
#define iV_DIVMULTP_2 (1<<(iV_DIVSHIFT-1))
// Simple derived types
typedef union {uint32 *dp; uint8 *bp; uint16 *wp;} iPointer;
extern void iV_Error(long n, char *msge, ...);
// If its a final build we need to undefine iv_error so that it doesn't generate any code !
#ifdef FINALBUILD
#undef iV_Error
#define iV_Error(fmt...) ;
#endif
//*************************************************************************
/***************************************************************************/
/*
* Global Macros
*/
/***************************************************************************/
//* Macros:
//*
#define iV_ASHIFT 4
#define iV_SSHIFT 7
#define iV_RSHIFT 12
#define iV_RMULTP (1L<<iV_RSHIFT)
#define iV_MSHIFT 10
#define iV_MMULTP (1L<<iV_MSHIFT);
#define iV_DIVTABLE_MAX 1024
#define iV_POLY_MAX_POINTS pie_MAX_POLY_SIZE
#define iV_POLY_FLAT (1) // added by TJC
#define iV_POLY_TEXT (2)
#define iV_POLY_TEXT0 (3)
#define iV_POLY_GOUR (4)
#ifdef iV_DDX
#define iV_DDX_ERROR 0x1000000
#endif
/***************************************************************************/
/*
* Global Type Definitions
*/
/***************************************************************************/
// Basic type (replace with framework definitions)
typedef unsigned char uchar;
typedef uint32 ufixed;
typedef struct {int32 w, x, y, z;} iQuat;
typedef struct {int x0, y0, x1, y1;} iBox;
//*************************************************************************
extern iError _iVERROR;
//*************************************************************************
extern void iV_Reset(int bResetPal );
extern void iV_ShutDown(void);
extern void iV_Stop(char *string, ...);
extern void iV_Abort(char *string, ...);
extern void iV_DisplayLogFile(void);
//*************************************************************************
#endif

View File

@ -1,250 +0,0 @@
/***************************************************************************/
/*
* ivisdef.h
*
* type defines for all ivis library functions.
*
*/
/***************************************************************************/
#ifndef _ivisdef_h
#define _ivisdef_h
#include "frame.h"
#include "pietypes.h"
// on the psx we need piepsx defined ... on the pc we need it when creating binary pie's
/***************************************************************************/
/***************************************************************************/
/*
* Global Definitions
*/
/***************************************************************************/
#define BSPIMD // now defined for all versions (optional BSP handled on all formats)
#ifdef WIN32
#define iV_DDX
#endif
#define iV_SCANTABLE_MAX 1024
// texture animation defines
#define iV_IMD_ANIM_LOOP 0
#define iV_IMD_ANIM_RUN 1
#define iV_IMD_ANIM_FRAMES 8
/***************************************************************************/
/*
* Global Macros
*/
/***************************************************************************/
/***************************************************************************/
/*
* Global Type Definitions
*/
/***************************************************************************/
//*************************************************************************
//
// Basic types (now defined in pieTypes.h)
//
//*************************************************************************
//*************************************************************************
//
// Simple derived types (now defined in pieTypes.h)
//
//*************************************************************************
//*************************************************************************
//
// screen surface structure
//
//*************************************************************************
typedef struct iSurface {
int usr;
uint32 flags;
int xcentre;
int ycentre;
int xpshift;
int ypshift;
iClip clip;
uint8 *buffer;
int32 scantable[iV_SCANTABLE_MAX]; // currently uses 4k per structure (!)
int width;
int height;
int32 size;
} iSurface;
//*************************************************************************
//
// texture animation structures
//
//*************************************************************************
typedef struct {
int npoints;
iPoint frame[iV_IMD_ANIM_FRAMES];
} iTexAnimFrame;
typedef struct {
int nFrames;
int playbackRate;
int textureWidth;
int textureHeight;
} iTexAnim;
//*************************************************************************
//
// imd structures
//
//*************************************************************************
#ifdef BSPIMD
typedef uint16 BSPPOLYID; // lets hope this can work as a byte ... that will limit it to 255 polygons in 1 imd
#endif
#include "bspimd.h" //structure defintions only
typedef int VERTEXID; // Size of the entry for vertex id in the imd polygon structure (32bits on pc 16bits on PSX)
// for normal non PSX use ...
typedef struct {
uint32 flags;
int32 zcentre;
int npnts;
iVector normal;
VERTEXID *pindex;
iVertex *vrt;
iTexAnim *pTexAnim; // warning.... this is not used on the playstation version !
#ifdef BSPIMD
BSPPOLYID BSP_NextPoly; // the polygon number for the next in the BSP list ... or BSPPOLYID_TERMINATE for no more
#endif
} iIMDPoly;
// PlayStation special effect structure ... loaded as a PIE (type 9) and cast to iIMDShape
typedef struct iIMDShapeEffect
{
uint32 flags; // This 'flags' can be used to check if the file is a 3d PIE file or a special effect
// the bit that is set is iV_IMD_XEFFECT (see imd.h)
void *ImageFile; // ( cast this to (IMAGEFILE*) when using it). - // When loaded as a binary this contains the hashed value of the text starting frame
UWORD firstframe; // When loaded as binary this contains the file number of the data file to be loaded (see iV_ProcessBPIE)
UWORD numframes;
UWORD xsize;
UWORD ysize;
} iIMDShapeEffect;
#define TRACER_SINGLE 0 // iIMDShapeProjectile types.
#define TRACER_DOUBLE 1
// PlayStation special effect structure ... loaded as a PIE (type 10) and cast to iIMDShape
typedef struct iIMDShapeProjectile
{
uint32 flags; // This 'flags' can be used to check if the file is a 3d PIE file or a special effect
// the bit that is set is iV_IMD_XEFFECT_PROJECTILE (see imd.h)
uint8 Type;
uint8 Radius;
uint8 Seperation;
uint8 Pad0;
uint8 LRed,LGreen,LBlue,Pad1;
uint8 TRed,TGreen,TBlue,Pad2;
} iIMDShapeProjectile;
// PC version
typedef struct iIMDShape {
uint32 flags;
int32 texpage;
int32 oradius, sradius, radius, visRadius, xmin, xmax, ymin, ymax, zmin, zmax;
iVector ocen;
UWORD numFrames;
UWORD animInterval;
int npoints;
int npolys; // After BSP this number is not updated - it stays the number of pre-bsp polys
int nconnectors; // After BSP this number is not updated - it stays the number of pre-bsp polys
iVector *points;
iIMDPoly *polys; // After BSP this is not changed - it stays the original chunk of polys - not all are now used,and others not in this array are, see BSPNode for a tree of all the post BSP polys
iVector *connectors; // After BSP this is not changed - it stays the original chunk of polys - not all are now used,and others not in this array are, see BSPNode for a tree of all the post BSP polys
int ntexanims;
iTexAnim **texanims;
struct iIMDShape *next; // next pie in multilevel pies (NULL for non multilevel !)
#ifdef BSPIMD
PSBSPTREENODE BSPNode; // Start of the BSP tree;
#endif
} iIMDShape;
//*************************************************************************
//
// immitmap image structures
//
//*************************************************************************
typedef struct {
UBYTE Type[4];
UWORD Version;
UWORD ClutSize;
UWORD NumCluts;
UWORD Pad;
} CLUTHEADER;
typedef struct {
UBYTE Type[4];
UWORD Version;
UWORD NumImages;
UWORD BitDepth;
UWORD NumTPages;
UBYTE TPageFiles[16][16];
UBYTE PalFile[16];
} IMAGEHEADER;
typedef struct {
// UDWORD HashValue
UWORD TPageID;
UWORD PalID;
UWORD Tu,Tv;
UWORD Width;
UWORD Height;
SWORD XOffset;
SWORD YOffset;
} IMAGEDEF;
typedef struct {
IMAGEHEADER Header;
iSprite *TexturePages;
UWORD NumCluts;
UWORD TPageIDs[16];
UWORD ClutIDs[48];
IMAGEDEF *ImageDefs;
} IMAGEFILE;
/***************************************************************************/
/*
* Global Variables
*/
/***************************************************************************/
#endif // _ivisdef_h

View File

@ -1,92 +0,0 @@
/***************************************************************************/
/*
* pieBlitFunc.h
*
* patch for exisitng ivis rectangle draw functions.
*
*/
/***************************************************************************/
#ifndef _pieBlitFunc_h
#define _pieBlitFunc_h
/***************************************************************************/
#include "frame.h"
#include "piedef.h"
/***************************************************************************/
/*
* Global Definitions
*/
/***************************************************************************/
#define BACKDROP_WIDTH 640
#define BACKDROP_HEIGHT 480
/***************************************************************************/
/*
* Global Variables
*/
/***************************************************************************/
/***************************************************************************/
/*
* Global ProtoTypes
*/
/***************************************************************************/
extern void pie_Line(int x0, int y0, int x1, int y1, uint32 colour);
extern void pie_Box(int x0,int y0, int x1, int y1, uint32 colour);
extern void pie_BoxFillIndex(int x0,int y0, int x1, int y1, UBYTE colour);
extern void pie_BoxFill(int x0,int y0, int x1, int y1, uint32 colour);
extern void pie_DrawImageFileID(IMAGEFILE *ImageFile,UWORD ID,int x,int y);
extern void pie_ImageFileID(IMAGEFILE *ImageFile,UWORD ID,int x,int y);
extern void pie_ImageFileIDTile(IMAGEFILE *ImageFile,UWORD ID,int x,int y,int x0,int y0,int Width,int Height);
extern void pie_ImageFileIDStretch(IMAGEFILE *ImageFile,UWORD ID,int x,int y,int Width,int Height);
extern void pie_ImageDef(IMAGEDEF *Image,iBitmap *Bmp,UDWORD Modulus,int x,int y,BOOL bBilinear);
extern void pie_TransBoxFill(SDWORD x0, SDWORD y0, SDWORD x1, SDWORD y1);
extern void pie_UniTransBoxFill(SDWORD x0,SDWORD y0, SDWORD x1, SDWORD y1, UDWORD rgb, UDWORD transparency);
extern void pie_DrawRect(SDWORD x0, SDWORD y0, SDWORD x1, SDWORD y1, UDWORD colour, BOOL bClip);
extern BOOL pie_InitRadar(void);
extern BOOL pie_ShutdownRadar(void);
extern void pie_DownLoadRadar(unsigned char *buffer, UDWORD texPageID);
extern void pie_RenderRadar(IMAGEDEF *Image,iBitmap *Bmp,UDWORD Modulus,int x,int y);
extern void pie_RenderRadarRotated(IMAGEDEF *Image,iBitmap *Bmp,UDWORD Modulus,int x,int y,int angle);
extern void pie_UploadDisplayBuffer(UBYTE *DisplayBuffer);
extern void pie_DownloadDisplayBuffer(UBYTE *DisplayBuffer);
extern void pie_ScaleBitmapRGB(UBYTE *DisplayBuffer,int Width,int Height,int ScaleR,int ScaleG,int ScaleB);
extern void pie_D3DSetupRenderForFlip(SDWORD surfaceOffsetX, SDWORD surfaceOffsetY, UWORD* pSrcData, SDWORD srcWidth, SDWORD srcHeight, SDWORD srcStride);
extern void pie_D3DRenderForFlip(void);
extern void pie_SetAdditiveSprites(BOOL val);
extern void pie_SetAdditiveSpriteLevel(UDWORD val);
typedef enum _screenType
{
SCREEN_RANDOMBDROP,
SCREEN_CREDITS,
SCREEN_MISSIONEND,
SCREEN_SLIDE1,
SCREEN_SLIDE2,
SCREEN_SLIDE3,
SCREEN_SLIDE4,
SCREEN_SLIDE5,
SCREEN_COVERMOUNT,
} SCREENTYPE;
extern void pie_LoadBackDrop(SCREENTYPE screenType, BOOL b3DFX);
extern void pie_ResetBackDrop(void);
extern void bufferTo16Bit(UBYTE *origBuffer,UWORD *newBuffer, BOOL b3DFX);
#endif //

View File

@ -1,48 +0,0 @@
/***************************************************************************/
/*
* pieclip.h
*
* clipping for all pumpkin image library functions.
*
*/
/***************************************************************************/
#ifndef _pieclip_h
#define _pieclip_h
/***************************************************************************/
#include "frame.h"
#include "piedef.h"
/***************************************************************************/
/*
* Global Definitions
*/
/***************************************************************************/
#define CLIP_BORDER 0
/***************************************************************************/
/*
* Global Variables
*/
/***************************************************************************/
/***************************************************************************/
/*
* Global ProtoTypes
*/
/***************************************************************************/
extern void pie_Set2DClip(int x0, int y0, int x1, int y1);
extern int pie_PolyClipTex2D(int npoints, iVertex *points, iVertex *clip);
extern int pie_PolyClip2D(int npoints, iVertex *points, iVertex *clip);
extern int pie_ClipTextured(int npoints, PIEVERTEX *points, PIEVERTEX *clip, BOOL bSpecular);
extern int pie_ClipTexturedTriangleFast(PIEVERTEX *v1, PIEVERTEX *v2, PIEVERTEX *v3, PIEVERTEX *clipped, BOOL bSpecular);
extern int pie_ClipFlat2dLine(SDWORD x0, SDWORD y0, SDWORD x1, SDWORD y1);
extern BOOL pie_SetVideoBuffer( UDWORD width, UDWORD height );
extern UDWORD pie_GetVideoBufferWidth ( void );
extern UDWORD pie_GetVideoBufferHeight ( void );
#endif // _pieclip_h

View File

@ -1,210 +0,0 @@
/***************************************************************************/
/*
* piedef.h
*
* type defines for all pumpkin image library functions.
*
*/
/***************************************************************************/
#ifndef _piedef_h
#define _piedef_h
/***************************************************************************/
#include "frame.h"
#include "ivisdef.h"
#include "ivispatch.h"
/***************************************************************************/
/*
* Global Definitions (CONSTANTS)
*/
/***************************************************************************/
#define DEG_360 65536
#define DEG_1 (DEG_360/360)
#define DEG_2 (DEG_360/180)
#define DEG_60 (DEG_360/6)
#define DEG(X) (DEG_1 * (X))
#define FP12_SHIFT 12
#define FP12_MULTIPLIER (1<<12)
#define STRETCHED_Z_SHIFT 10 //stretchs z range for (1000 to 4000) to (8000 to 32000)
#define MAX_Z (32000.0f) //raised to 32000 from 6000 when stretched
#define INV_MAX_Z (0.00003125f) //1/32000
#define MIN_STRETCHED_Z 256
#define LONG_WAY (1<<15)
#define LONG_TEST (1<<14)
#define INTERFACE_DEPTH (MAX_Z - 1.0f)
#define INTERFACE_DEPTH_3DFX (65535)
#define INV_INTERFACE_DEPTH_3DFX (1.0f/65535.0f)
#define BUTTON_DEPTH (2000) //will be stretched to 16000
#define TEXTURE_SIZE (256.0f)
#define INV_TEX_SIZE (0.00390625f)
#define MAX_FILE_PATH 256
#define pie_MAX_POLY_SIZE 16
//Effects
#define pie_MAX_BRIGHT_LEVEL 255
#define pie_BRIGHT_LEVEL_200 200
#define pie_BRIGHT_LEVEL_180 180
#define pie_DROID_BRIGHT_LEVEL 192
//Render style flags for all pie draw functions
#define pie_FLAG_MASK 0xffff
#define pie_FLAT 0x1
#define pie_TRANSLUCENT 0x2
#define pie_ADDITIVE 0x4
#define pie_NO_BILINEAR 0x8
#define pie_HEIGHT_SCALED 0x10
#define pie_RAISE 0x20
#define pie_BUTTON 0x40
#define pie_RAISE_SCALE 256
#define pie_BAND 0x80
#define pie_BAND_RED 0x90
#define pie_BAND_GREEN 0xa0
#define pie_BAND_YELLOW 0xb0
#define pie_BAND_BLUE 0xc0
#define pie_DRAW_DISC 0x800
#define pie_DRAW_DISC_RED 0x900
#define pie_DRAW_DISC_GREEN 0xa00
#define pie_DRAW_DISC_YELLOW 0xb00
#define pie_DRAW_DISC_BLUE 0xc00
#define pie_GLOW 0x8000
#define pie_GLOW_RED 0x9000
#define pie_GLOW_GREEN 0xa000
#define pie_GLOW_YELLOW 0xb000
#define pie_GLOW_BLUE 0xc000
#define pie_GLOW_STRENGTH 63
#define pie_MAX_POINTS 512
#define pie_MAX_POLYS 512
#define pie_MAX_POLY_VERTS 10
#define pie_FILLRED 16
#define pie_FILLGREEN 16
#define pie_FILLBLUE 128
#define pie_FILLTRANS 128
#define MAX_UB_LIGHT ((UBYTE)255)
#define MIN_UB_LIGHT ((UBYTE)0)
#define MAX_LIGHT 0xffffffff
/***************************************************************************/
/*
* Global Definitions (MACROS)
*/
/***************************************************************************/
#define pie_MIN(a,b) (((a) < (b)) ? (a) : (b))
#define pie_MAX(a,b) (((a) > (b)) ? (a) : (b))
#define pie_ABS(a) (((a) < 0) ? (-(a)) : (a))
#define pie_ADDLIGHT(l,x) \
(((l)->byte.r > (MAX_UB_LIGHT - (x))) ? ((l)->byte.r = MAX_UB_LIGHT) : ((l)->byte.r +=(x))); \
(((l)->byte.g > (MAX_UB_LIGHT - (x))) ? ((l)->byte.g = MAX_UB_LIGHT) : ((l)->byte.g +=(x))); \
(((l)->byte.b > (MAX_UB_LIGHT - (x))) ? ((l)->byte.b = MAX_UB_LIGHT) : ((l)->byte.b +=(x)));
#define pie_SUBTRACTLIGHT(l,x) \
(((l->byte.r) < (x)) ? ((l->byte.r) = MIN_UB_LIGHT) : ((l->byte.r) -=(x))); \
(((l->byte.g) < (x)) ? ((l->byte.g) = MIN_UB_LIGHT) : ((l->byte.g) -=(x))); \
(((l->byte.b) < (x)) ? ((l->byte.b) = MIN_UB_LIGHT) : ((l->byte.b) -=(x)));
/***************************************************************************/
/*
* Global Definitions (STRUCTURES)
*/
/***************************************************************************/
typedef struct {UBYTE b,g,r,a;} PIELIGHTBYTES; //for byte fields in a DWORD
typedef union {PIELIGHTBYTES byte; UDWORD argb;} PIELIGHT;
typedef struct {UBYTE r, g, b, a;} PIEVERTLIGHT;
typedef struct {SDWORD sx, sy, sz; UWORD tu, tv; PIELIGHT light, specular;} PIEVERTEX;
typedef struct {float d3dx, d3dy, d3dz;} PIEPIXEL;
typedef struct {SWORD x, y, w, h;} PIERECT; //screen rectangle
typedef struct {SDWORD texPage; SWORD tu, tv, tw, th;} PIEIMAGE; //an area of texture
typedef struct {UDWORD pieFlag; PIELIGHT colour, specular; UBYTE light, trans, scale, height;} PIESTYLE; //render style for pie draw functions
typedef struct {long n; char msge[240];} iError;
typedef int32 fixed;
// This is the new resource loaded structure (TEXPAGE)
typedef struct
{
iSprite *Texture;
iPalette *Palette;
} TEXTUREPAGE;
typedef struct {
UDWORD flags;
SDWORD nVrts;
D3DTLVERTEX *pVrts;
iTexAnim *pTexAnim;
} PIED3DPOLY;
typedef struct {
UDWORD flags;
SDWORD nVrts;
PIEVERTEX *pVrts;
iTexAnim *pTexAnim;
} PIEPOLY;
/***************************************************************************/
/*
* Global Variables
*/
/***************************************************************************/
/***************************************************************************/
/*
* Global ProtoTypes
*/
/***************************************************************************/
extern void pie_Draw3DShape(iIMDShape *shape, int frame, int team, UDWORD colour, UDWORD specular, int pieFlag, int pieData);
//extern void pie_Draw3DIntelShape(iIMDShape *shape, int frame, int team, UDWORD colour, UDWORD specular, int pieFlag, int pieData);
//extern void pie_Draw3DNowShape(iIMDShape *shape, int frame, int team, UDWORD col, UDWORD spec, int pieFlag, int pieFlagData);
extern void pie_DrawImage(PIEIMAGE *image, PIERECT *dest, PIESTYLE *style);
extern void pie_DrawImage270(PIEIMAGE *image, PIERECT *dest, PIESTYLE *style);
//PIEVERTEX line draw for all hardware modes
extern void pie_DrawLine(SDWORD x0, SDWORD y0, SDWORD x1, SDWORD y1, UDWORD colour, BOOL bclip);
//iVetrex triangle draw for software modes
extern void pie_DrawTriangle(iVertex *pv, iTexture* texPage, UDWORD renderFlags, iPoint *offset);
//PIEVERTEX poly draw for all hardware modes
extern void pie_DrawPoly(SDWORD numVrts, PIEVERTEX *aVrts, SDWORD texPage, void* psEffects);
//PIEVERTEX triangle draw (glide specific)
extern void pie_DrawFastTriangle(PIEVERTEX *v1, PIEVERTEX *v2, PIEVERTEX *v3, iTexture* texPage, int pieFlag, int pieFlagData);
extern void pie_GetResetCounts(SDWORD* pPieCount, SDWORD* pTileCount, SDWORD* pPolyCount, SDWORD* pStateCount);
extern int pie_Num3dfxBuffersPending( void );
extern void SetBSPObjectPos(SDWORD x,SDWORD y,SDWORD z);
extern void SetBSPCameraPos(SDWORD x,SDWORD y,SDWORD z);
//piedraw functions used in piefunc.c
extern void pie_D3DPoly(PIED3DPOLY *poly);
//necromancer
extern void pie_DrawTile(PIEVERTEX *pv0, PIEVERTEX *pv1, PIEVERTEX *pv2, PIEVERTEX *pv3, SDWORD texPage);
extern void SetBSPObjectRot(SDWORD Yaw, SDWORD Pitch);
#endif // _piedef_h

View File

@ -1,71 +0,0 @@
/***************************************************************************/
/*
* pieTypes.h
*
* type defines for simple pies.
*
*/
/***************************************************************************/
#ifndef _pieTypes_h
#define _pieTypes_h
#include "frame.h"
/***************************************************************************/
/***************************************************************************/
/*
* Global Definitions
*/
/***************************************************************************/
#define PI 3.141592654
/***************************************************************************/
/*
* Global Macros
*/
/***************************************************************************/
/***************************************************************************/
/*
* Global Type Definitions
*/
/***************************************************************************/
typedef signed char int8;
typedef signed short int16;
typedef int int32;
typedef unsigned char uint8;
typedef unsigned short uint16;
typedef unsigned int uint32;
//*************************************************************************
//
// Simple derived types
//
//*************************************************************************
typedef struct {int left, top, right, bottom;} iClip;
typedef uint8 iBitmap;
typedef struct {uint8 r, g, b;} iColour;
typedef int iBool;
typedef struct {int32 x, y;} iPoint;
typedef struct {int width, height; iBitmap *bmp;} iSprite;
typedef iColour iPalette[256];
typedef struct {uint8 r, g, b, p;} iRGB8;
typedef struct {uint16 r, g, b, p;} iRGB16;
typedef struct {uint32 r, g, b, p;} iRGB32;
typedef struct {int8 x, y;} iPoint8;
typedef struct {int16 x, y;} iPoint16;
typedef struct {int32 x, y;} iPoint32;
typedef struct {int32 x, y, z;} iVector;
typedef struct {double x, y, z;} iVectorf;
typedef struct {int xshift, width, height; iBitmap *bmp;
iColour *pPal; iBool bColourKeyed; } iTexture;
typedef struct {int32 x, y, z, u, v; uint8 g;} iVertex;
typedef struct {FRACT x,y,z;} PIEVECTORF;
typedef struct {iVector p, r;} iView;
#endif // _pieTypes_h

View File

@ -455,12 +455,12 @@ UDWORD pie_GetFormattedTextFlags(void)
static RENDERTEXT_CALLBACK Indirect_pie_DrawText=pie_DrawText;
void SetIndirectDrawTextCallback( RENDERTEXT_CALLBACK *routine)
void SetIndirectDrawTextCallback(RENDERTEXT_CALLBACK routine)
{
Indirect_pie_DrawText=routine;
}
RENDERTEXT_CALLBACK *GetIndirectDrawTextCallback( void)
RENDERTEXT_CALLBACK GetIndirectDrawTextCallback(void)
{
return(Indirect_pie_DrawText);
}

View File

@ -1,78 +0,0 @@
#ifndef _INCLUDED_TEXTDRAW_
#define _INCLUDED_TEXTDRAW_
#include "ivisdef.h"
#define iV_DrawText pie_DrawText
#define iV_DrawText270 pie_DrawText270
#define PIE_TEXT_WHITE (-1)
#define PIE_TEXT_LIGHTBLUE (-2)
#define PIE_TEXT_DARKBLUE (-3)
#define PIE_TEXT_WHITE_COLOUR (0xffffffff)
#define PIE_TEXT_LIGHTBLUE_COLOUR (0xffa0a0ff)
#define PIE_TEXT_DARKBLUE_COLOUR (0xff6060c0)
extern void iV_ClearFonts(void);
extern void iV_SetFont(int FontID);
extern int iV_CreateFontIndirect(IMAGEFILE *ImageFile,UWORD *AsciiTable,int SpaceSize);
extern int iV_CreateFont(IMAGEFILE *ImageFile,UWORD StartID,UWORD EndID,int SpaceSize,BOOL bInGame);
extern void iV_GetTextExtents(unsigned char *String,int *Width,int *y0,int *y1);
extern int iV_GetTextAboveBase(void);
extern int iV_GetTextBelowBase(void);
extern int iV_GetTextLineSize(void);
extern int iV_GetTextWidth(unsigned char *String);
extern int iV_GetCharWidth(unsigned char Char);
extern void iV_SetTextColour(SWORD Index);
#define ASCII_SPACE (32)
#define ASCII_NEWLINE ('@')
#define ASCII_COLOURMODE ('#')
// Valid values for "Justify" argument of pie_DrawFormattedText().
enum {
FTEXT_LEFTJUSTIFY, // Left justify.
FTEXT_CENTRE, // Centre justify.
FTEXT_RIGHTJUSTIFY, // Right justify.
FTEXT_LEFTJUSTIFYAPPEND, // Start from end of last print and then left justify.
};
// Valid values for paramaters for pie_SetFormattedTextFlags().
// Skip leading spaces at the start of each line of text. Improves centre justification
// but may result in unwanted word breaks.
#define FTEXTF_SKIP_LEADING_SPACES 1
// Skip trailing spaces at the end of each line of text, improves centre justification.
#define FTEXTF_SKIP_TRAILING_SPACES 2
// Inserts a space before the first word in the string, usefull when use FTEXT_LEFTJUSTIFYAPPEND
#define FTEXTF_INSERT_SPACE_ON_APPEND 4
extern void pie_SetFormattedTextFlags(UDWORD Flags);
extern UDWORD pie_GetFormattedTextFlags(void);
extern void pie_StartTextExtents(void);
extern void pie_FillTextExtents(int BorderThickness,UBYTE r,UBYTE g,UBYTE b,BOOL Alpha);
extern UDWORD pie_DrawFormattedText(UBYTE *String,UDWORD x,UDWORD y,UDWORD Width,UDWORD Justify,BOOL DrawBack);
extern void pie_DrawText(unsigned char *string,UDWORD x,UDWORD y);
extern void pie_DrawTextToSurface(LPDIRECTDRAWSURFACE4 lpDDSF, unsigned char *String, int XPos, int YPos);
extern void pie_DrawText270(unsigned char *String,int XPos,int YPos);
extern void pie_RenderBlueTintedBitmap(iBitmap *bmp, int x, int y, int w, int h, int ow);
extern void pie_RenderDeepBlueTintedBitmap(iBitmap *bmp, int x, int y, int w, int h, int ow);
void InitClut24(UWORD *InputClut);
typedef void (*RENDERTEXT_CALLBACK)(UBYTE *String, UDWORD X, UDWORD Y);
// routines used for textdraw
void SetIndirectDrawTextCallback( RENDERTEXT_CALLBACK *routine);
RENDERTEXT_CALLBACK *GetIndirectDrawTextCallback( void);
#endif

View File

@ -0,0 +1,29 @@
noinst_LIBRARIES = libivis_common.a
AM_CPPFLAGS = -I../framework -I../gamelib -I../..
libivis_common_a_SOURCES = \
bug.c \
bitimage.h \
bspfunc.h \
bspimd.h \
bug.h \
fbf.h \
geo.h \
imd.h \
ivi.h \
ivisdef.h \
ivispatch.h \
pcx.h \
pieblitfunc.h \
pieclip.h \
piedef.h \
piefunc.h \
piemode.h \
piepalette.h \
piestate.h \
pietypes.h \
rendfunc.h \
textdraw.h
libivis_common_a_libs = ../framework/libframework.a
libivis_common_a_DEPENDENCIES = $(libivis_common_a_libs)
libivis_common_a_LIBADD = $(libivis_common_a_libs)

View File

@ -1,9 +1,8 @@
noinst_LIBRARIES = libivis_opengl.a
AM_CPPFLAGS = -I../framework -I../gamelib -I../..
AM_CPPFLAGS = -I../framework -I../gamelib -I../.. -I../ivis_common
libivis_opengl_a_SOURCES = \
bitimage.c \
bspimd.c \
bug.c \
fbf.c \
imd.c \
imdload.c \
@ -23,35 +22,14 @@ libivis_opengl_a_SOURCES = \
screen.c \
tex.c \
textdraw.c \
bitimage.h \
fbf.h \
ivis02.h \
pieblitfunc.h \
piematrix.h \
pietexture.h \
screen.h \
bspfunc.h \
geo.h \
ivisdef.h \
pieclip.h \
piemode.h \
pietypes.h \
tex.h \
bspimd.h \
imd.h \
ivispatch.h \
piedef.h \
piepalette.h \
rendfunc.h \
textdraw.h \
bug.h \
ivi.h \
pcx.h \
piefunc.h \
piestate.h \
rendmode.h \
vid.h
libivis_opengl_a_libs = ../framework/libframework.a
libivis_opengl_a_libs = ../framework/libframework.a ../ivis_common/libivis_common.a
libivis_opengl_a_DEPENDENCIES = $(libivis_opengl_a_libs)
libivis_opengl_a_LIBADD = $(libivis_opengl_a_libs)

View File

@ -1,30 +0,0 @@
#ifndef __INCLUDED_BITIMAGE__
#define __INCLUDED_BITIMAGE__
typedef struct {
UWORD NumCluts;
UWORD *ClutIDs;
} CLUTLIST;
typedef void (*CLUTCALLBACK)(UWORD *clut);
UWORD iV_GetImageWidth(IMAGEFILE *ImageFile,UWORD ID);
UWORD iV_GetImageHeight(IMAGEFILE *ImageFile,UWORD ID);
UWORD iV_GetImageWidthNoCC(IMAGEFILE *ImageFile,UWORD ID);
UWORD iV_GetImageHeightNoCC(IMAGEFILE *ImageFile,UWORD ID);
SWORD iV_GetImageXOffset(IMAGEFILE *ImageFile,UWORD ID);
SWORD iV_GetImageYOffset(IMAGEFILE *ImageFile,UWORD ID);
UWORD iV_GetImageCenterX(IMAGEFILE *ImageFile,UWORD ID);
UWORD iV_GetImageCenterY(IMAGEFILE *ImageFile,UWORD ID);
IMAGEFILE *iV_LoadImageFile(UBYTE *FileData, UDWORD FileSize);
void iV_FreeImageFile(IMAGEFILE *ImageFile);
// Load a clut file into VRAM.
BOOL iV_LoadClut_PSX(UBYTE *Data,CLUTLIST **ClutList,BOOL HalfBright);
// Free up a clut list alloceted by iV_LoadClut_PSX.
void iV_FreeClut_PSX(CLUTLIST *ClutList);
#endif

View File

@ -1,143 +0,0 @@
#ifndef i_BSPIMD
#define i_BSPIMD
#ifdef PIETOOL // only needed when generating the tree
typedef double HDVAL;
typedef struct {HDVAL x, y, z;} iVectorHD;
#endif
typedef UDWORD WORLDCOORD;
typedef SWORD ANGLE;
typedef struct
{
WORLDCOORD x,y,z;
ANGLE pitch,yaw,roll;
} OBJPOS;
typedef struct NODE
{
struct NODE *pPrev;
struct NODE *pNext;
void *pData;
}
NODE;
typedef NODE* PSNODE;
typedef struct BSPPTRLIST
{
int iNumNodes;
PSNODE pHead;
PSNODE pTail;
PSNODE pCurPosition;
}
BSPPTRLIST, *PSBSPPTRLIST;
#define TREE_OK (0)
#define TREE_FAIL (-1)
#define LEFT 1
#define RIGHT 0
#define BINTREE_STUFF(x) struct x *link[2]
typedef struct BNODE
{
BINTREE_STUFF(BNODE);
}
BNODE, *PSBNODE;
/***************************************************************************/
#define TOLERANCE (10)
typedef struct PLANE
{
// These 1st three entries can NOT NOW be cast into a iVectorf * (iVectorf on PC are doubles)
FRACT a; // these values form the plane equation ax+by+cz=d
FRACT b;
FRACT c;
FRACT d;
iVector vP; // a point on the plane - in normal non-fract format
}
PLANE, *PSPLANE;
#ifdef PIETOOL
enum BINTREEORDER { PREORDER, INORDER, POSTORDER };
typedef struct HDPLANE
{
// These 1st three entries can NOT NOW be cast into a iVectorf * (iVectorf on PC are doubles)
HDVAL a; // these values form the plane equation ax+by+cz=d
HDVAL b;
HDVAL c;
HDVAL d;
iVectorHD vP; // a point on the plane - in normal non-fract format
}
HDPLANE;
typedef int (*COMPFUNC) ( void *node1, void *node2 );
typedef int (*DOFUNC) ( void *node, int level );
typedef int (*DELETEFUNC) ( void *node );
typedef struct BINTREE
{
PSBNODE psBNodeDummyHead;
COMPFUNC Compare;
int DuplicatesOK;
int NodeSize;
}
BINTREE, *PSBINTREE;
#endif
typedef struct BSPTREENODE
{
BINTREE_STUFF( BSPTREENODE );
PLANE Plane;
// points to first polygon in the BSP tree entry ... BSP_NextPoly in the iIMDPoly structure will point to the next entry
BSPPOLYID TriSameDir; // id of the first polygon in the list ... or BSPPOLYID_TERMINATE for none
BSPPOLYID TriOppoDir; // id of the first polygon in the list ... or BSPPOLYID_TERMINATE for none
#ifdef PIETOOL // only needed when generating the tree
HDPLANE *psPlane; // High def version of the plane equation
PSBSPPTRLIST psTriSameDir;
PSBSPPTRLIST psTriOppoDir;
#endif
}
BSPTREENODE, *PSBSPTREENODE;
/***************************************************************************/
#define OPPOSITE_SIDE 0
#define IN_PLANE 1
#define SAME_SIDE 2
#define SPLIT_BY_PLANE 3
#define INTERSECTION_INSIDE_LINE_SEGMENT 4
#define INTERSECTION_OUTSIDE_LINE_SEGMENT 5
#define SPLITTING_ERROR (-1)
/***************************************************************************/
#endif

View File

@ -1,32 +0,0 @@
#ifndef _fbf_
#define _fbf_
#include <stdio.h>
#include "ivisdef.h"
#define iV_FBF_OPENFAILED -1
#define iV_FBF_TOOMANYOPEN -2
#define iV_FBF_OUTOFMEMORY -3
#define iV_FBF_UNKNOWNMODE -4
#define iV_FBF_OK 0
#define iV_FBF_MODE_R 0
#define iV_FBF_MODE_W 1
#define iV_FBF_MODE_WR 2
#define iV_FBF_MODE_CR 3
#define iV_FBF_SEEK_SET SEEK_SET
#define iV_FBF_SEEK_END SEEK_END
#define iV_FBF_DEFAULT_BUFFER -1
//*************************************************************************
extern int iV_FileOpen(char *fname, int mode, int buffersize);
extern int iV_FileGet(int fd);
extern void iV_FileClose(int fd);
extern int iV_FilePut(int fd, int8 c);
extern int iV_FileSeek(int fd, int where, int seek);
extern int32 iV_FileSize(char *filename);
extern int32 iV_FileSizeOpen(int fd);
extern iBool iV_FileLoad(char *filename, uint8 *data);
extern iBool iV_FileSave(char *filename, uint8 *data, int32 size);
#endif

View File

@ -1,6 +0,0 @@
#ifndef _geo_
#define _geo_
#include "piematrix.h"
#endif

View File

@ -1,111 +0,0 @@
/***************************************************************************/
/*
* ivispatch.h
*
* patches old ivis defines to new pie defines allows both definitions to run concurrently .
*
*/
/***************************************************************************/
#ifndef _ivispatch_h
#define _ivispatch_h
#include "frame.h"
#include "pietypes.h"
/***************************************************************************/
/***************************************************************************/
/*
* Global Definitions
*/
/***************************************************************************/
#define iV_POLY_MAX_POINTS pie_MAX_POLY_SIZE
//palette definitions
#define iV_PALETTE_SIZE PALETTE_SIZE
#define iV_PALETTE_SHADE_LEVEL PALETTE_SHADE_LEVEL
#define iV_COL_TRANS COL_TRANS
#define iV_COL_BLACK COL_BLACK
#define iV_COL_BLUE COL_BLUE
#define iV_COL_GREEN COL_GREEN
#define iV_COL_CYAN COL_CYAN
#define iV_COL_RED COL_RED
#define iV_COL_MAGENTA COL_MAGENTA
#define iV_COL_BROWN COL_BROWN
#define iV_COL_GREY COL_GREY
#define iV_COL_DARKGREY COL_DARKGREY
#define iV_COL_LIGHTBLUE COL_LIGHTBLUE
#define iV_COL_LIGHTGREEN COL_LIGHTGREEN
#define iV_COL_LIGHTCYAN COL_LIGHTCYAN
#define iV_COL_LIGHTRED COL_LIGHTRED
#define iV_COL_LIGHTMAGENTA COL_LIGHTMAGENTA
#define iV_COL_YELLOW COL_YELLOW
#define iV_COL_WHITE COL_WHITE
#define _iVPALETTE psCurrentPalette
#define iV_SHADE_TABLE palShades
#define iV_PaletteShadeTableCreate pal_BuildAdjustedShadeTable
#define iV_PaletteNearestColour pal_GetNearestColour
#define iV_PaletteAdd pal_AddNewPalette
#define iV_PaletteSelect pal_SelectPalette
#include "piepalette.h"
//matrixstuff
#define iV_setGeometricOffset pie_setGeometricOffset
#define iV_MatrixBegin pie_MatBegin
#define iV_MatrixEnd pie_MatEnd
#define iV_MatrixRotateX pie_MatRotX
#define iV_MatrixRotateY pie_MatRotY
#define iV_MatrixRotateZ pie_MatRotZ
#define iV_TRANSLATE pie_TRANSLATE
#define iV_SIN SIN
#define iV_COS COS
//#define iV_Clipping2D pie_Set2DClip
//#define iV_PolyClipTex2D pie_PolyClipTex2D
//#define iV_PolyClip2D pie_PolyClip2D
//heap crash
#define iV_HeapAlloc(size) MALLOC(size)
#define iV_HeapFree(pointer,size) FREE(pointer)
/***************************************************************************/
/*
* Global Macros
*/
/***************************************************************************/
/***************************************************************************/
/*
* Global Type Definitions
*/
/***************************************************************************/
//*************************************************************************
//
// Basic types (now defined in pieTypes.h)
//
//*************************************************************************
//*************************************************************************
//
// Simple derived types (now defined in pieTypes.h)
//
//*************************************************************************
//*************************************************************************
//
// screen surface structure
//
//*************************************************************************
/***************************************************************************/
/*
* Global Variables
*/
/***************************************************************************/
#endif // _ivispatch_h

View File

@ -1,12 +0,0 @@
#ifndef _pcx_
#define _pcx_
#include "ivisdef.h"
extern iBool iV_PCXLoad(char *file, iSprite *s, iColour *pal);
extern BOOL pie_PCXLoadToBuffer(char *file, iSprite *s, iColour *pal);
extern iBool iV_PCXLoadMem(int8 *pcximge, iSprite *s, iColour *pal);
extern BOOL pie_PCXLoadMemToBuffer(int8 *pcximge, iSprite *s, iColour *pal);
//extern iBool iV_PCXSave(char *file, iSprite *s, iColour *pal);
#endif /* _pcx_ */

View File

@ -1,56 +0,0 @@
/***************************************************************************/
/*
* piefunc.h
*
* type defines for extended image library functions.
*
*/
/***************************************************************************/
#ifndef _piefunc_h
#define _piefunc_h
/***************************************************************************/
#include "frame.h"
/***************************************************************************/
/*
* Global Definitions
*/
/***************************************************************************/
/***************************************************************************/
/*
* Global Variables
*/
/***************************************************************************/
/***************************************************************************/
/*
* Global ProtoTypes
*/
/***************************************************************************/
extern void pie_DownLoadBufferToScreen(void *srcData, UDWORD destX, UDWORD
destY,UDWORD srcWidth,UDWORD srcHeight,UDWORD srcStride);
extern void pie_RectFilter(SDWORD x0, SDWORD y0, SDWORD x1, SDWORD y1, UDWORD colour);
extern void pie_DrawBoundingDisc(iIMDShape *shape, int pieFlag);
extern void pie_Blit(SDWORD texPage, SDWORD x0, SDWORD y0, SDWORD x1, SDWORD y1);
extern void pie_Sky(SDWORD texPage, PIEVERTEX* aSky );
extern void pie_Water(SDWORD texPage, SDWORD x0, SDWORD y0, SDWORD x1, SDWORD y1, SDWORD height, SDWORD translucency);
extern void pie_AddFogandMist(SDWORD depth, SDWORD height, PIELIGHT* pColour, PIELIGHT* pSpecular);
extern void pie_InitMaths(void);
extern UBYTE pie_ByteScale(UBYTE a, UBYTE b);
extern void pie_CornerBox(SDWORD x0, SDWORD y0, SDWORD x1, SDWORD y1, UDWORD colour,
UBYTE a, UBYTE b, UBYTE c, UBYTE d);
//extern void pie_doWeirdBoxFX(UDWORD x, UDWORD y, UDWORD x2, UDWORD y2);
extern void pie_doWeirdBoxFX(UDWORD x, UDWORD y, UDWORD x2, UDWORD y2, UDWORD trans);
extern void pie_TransColouredTriangle(PIEVERTEX *vrt, UDWORD rgb, UDWORD trans);
extern void pie_RenderImageToSurface(LPDIRECTDRAWSURFACE4 lpDDS4, SDWORD surfaceOffsetX, SDWORD surfaceOffsetY, UWORD* pSrcData, SDWORD srcWidth, SDWORD srcHeight, SDWORD srcStride);
extern void pie_DrawViewingWindow( iVector *v, UDWORD x1, UDWORD y1, UDWORD x2, UDWORD y2,UDWORD colour);
#endif // _piedef_h

View File

@ -1,58 +0,0 @@
/***************************************************************************/
/*
* pieMode.h
*
* renderer control for pumpkin library functions.
*
*/
/***************************************************************************/
#ifndef _pieMode_h
#define _pieMode_h
/***************************************************************************/
#include "frame.h"
/***************************************************************************/
/*
* Global Definitions
*/
/***************************************************************************/
typedef enum CLEAR_MODE
{
CLEAR_OFF,
CLEAR_OFF_AND_NO_BUFFER_DOWNLOAD,
CLEAR_BLACK,
CLEAR_FOG,
}
CLEAR_MODE;
/***************************************************************************/
/*
* Global Variables
*/
/***************************************************************************/
extern int32 _iVPRIM_DIVTABLE[];
/***************************************************************************/
/*
* Global ProtoTypes
*/
/***************************************************************************/
extern BOOL pie_Initialise(SDWORD mode);
extern void pie_ShutDown(void);
extern void pie_ScreenFlip(CLEAR_MODE ClearMode);
extern void pie_Clear(UDWORD colour);
extern void pie_GlobalRenderBegin(void);
extern void pie_GlobalRenderEnd(BOOL bForceClearToBlack);
extern void pie_LocalRenderBegin(void);
extern void pie_LocalRenderEnd(void);
extern UDWORD pie_GetResScalingFactor( void );
extern void pie_SetDitherStatus( BOOL val );
extern BOOL pie_GetDitherStatus( void );
#endif //

View File

@ -1,53 +0,0 @@
#ifndef _piePalette_
#define _piePalette_
#include "piedef.h"
//*************************************************************************
#define PALETTE_MAX 8
#define PALETTE_SIZE 256
#define PALETTE_SHADE_LEVEL 16
#define COL_TRANS 0
#define COL_BLACK colours[0]
#define COL_BLUE colours[1]
#define COL_GREEN colours[2]
#define COL_CYAN colours[3]
#define COL_RED colours[4]
#define COL_MAGENTA colours[5]
#define COL_BROWN colours[6]
#define COL_GREY colours[7]
#define COL_DARKGREY colours[8]
#define COL_LIGHTBLUE colours[9]
#define COL_LIGHTGREEN colours[10]
#define COL_LIGHTCYAN colours[11]
#define COL_LIGHTRED colours[12]
#define COL_LIGHTMAGENTA colours[13]
#define COL_YELLOW colours[14]
#define COL_WHITE colours[15]
//*************************************************************************
extern uint8 colours[];
extern uint8 palShades[PALETTE_SIZE * PALETTE_SHADE_LEVEL];
extern uint8 transLookup[PALETTE_SIZE][PALETTE_SIZE];
extern UWORD palette16Bit[PALETTE_SIZE]; //16 bit version of the present palette
//*************************************************************************
extern void pal_Init(void);
extern void pal_ShutDown(void);
extern void pal_BuildAdjustedShadeTable( void );
extern uint8 pal_GetNearestColour(uint8 r, uint8 g, uint8 b);
extern int pal_AddNewPalette(iColour *pal);
extern void pal_SelectPalette(int n);
extern void pal_PaletteSet(void);
extern BOOL pal_Make16BitPalette(void);
extern iColour* pie_GetGamePal(void);
extern PALETTEENTRY* pie_GetWinPal(void);
extern void pie_BuildSoftwareTransparency( void );
#endif

View File

@ -1,153 +0,0 @@
/***************************************************************************/
/*
* pieState.h
*
* render State controlr all pumpkin image library functions.
*
*/
/***************************************************************************/
#ifndef _piestate_h
#define _piestate_h
/***************************************************************************/
#include "frame.h"
//#include <d3d.h>
#include "piedef.h"
/***************************************************************************/
/*
* Global Definitions
*/
/***************************************************************************/
typedef enum REND_ENGINE
{
ENGINE_UNDEFINED,
ENGINE_16Bit,
ENGINE_4101,
ENGINE_SR,
ENGINE_GLIDE,
ENGINE_D3D,
ENGINE_OPENGL
}
REND_ENGINE;
typedef enum REND_MODE
{
REND_GOURAUD_TEX,
REND_ALPHA_TEX,
REND_ADDITIVE_TEX,
REND_TEXT,
REND_ALPHA_TEXT,
REND_FLAT,
REND_ALPHA_FLAT,
REND_ALPHA_ITERATED,
REND_FILTER_FLAT,
REND_FILTER_ITERATED
}
REND_MODE;
typedef enum DEPTH_MODE
{
DEPTH_CMP_LEQ_WRT_ON,
DEPTH_CMP_ALWAYS_WRT_ON,
DEPTH_CMP_LEQ_WRT_OFF,
DEPTH_CMP_ALWAYS_WRT_OFF
}
DEPTH_MODE;
typedef enum TRANSLUCENCY_MODE
{
TRANS_DECAL,
TRANS_DECAL_FOG,
TRANS_FILTER,
TRANS_ALPHA,
TRANS_ADDITIVE
}
TRANSLUCENCY_MODE;
typedef enum FOG_CAP
{
FOG_CAP_NO,
FOG_CAP_GREY,
FOG_CAP_COLOURED,
FOG_CAP_UNDEFINED
}
FOG_CAP;
typedef enum TEX_CAP
{
TEX_CAP_2M,
TEX_CAP_8BIT,
TEX_CAP_FULL,
TEX_CAP_UNDEFINED
}
TEX_CAP;
#define NO_TEXPAGE -1
#define RADAR_TEXPAGE_D3D 31
#define D3D_CLIP_IN_SOFTWARE
/***************************************************************************/
/*
* Global Variables
*/
/***************************************************************************/
extern SDWORD pieStateCount;
/***************************************************************************/
/*
* Global ProtoTypes
*/
/***************************************************************************/
extern void pie_SetDefaultStates();//Sets all states
//render engine
extern void pie_SetRenderEngine(REND_ENGINE rendEngine);
extern REND_ENGINE pie_GetRenderEngine(void);
extern BOOL pie_Hardware(void);
extern void pie_SetDepthBufferStatus(DEPTH_MODE depthMode);
extern void pie_SetGammaValue(float val);
extern void pie_SetDirectDrawDeviceName(char* pDDDeviceName);
extern char* pie_GetDirectDrawDeviceName(void);
extern void pie_SetDirect3DDeviceName(char* pD3DDeviceName);
extern char* pie_GetDirect3DDeviceName(void);
//renderer capability
extern void pie_SetTranslucent(BOOL val);
extern BOOL pie_Translucent(void);
extern void pie_SetAdditive(BOOL val);
extern BOOL pie_Additive(void);
extern void pie_SetFogCap(FOG_CAP val);
extern FOG_CAP pie_GetFogCap(void);
extern void pie_SetTexCap(TEX_CAP val);
extern TEX_CAP pie_GetTexCap(void);
//fog available
extern void pie_EnableFog(BOOL val);
extern BOOL pie_GetFogEnabled(void);
//fog currently on
extern void pie_SetFogStatus(BOOL val);
extern BOOL pie_GetFogStatus(void);
extern void pie_SetFogColour(UDWORD colour);
extern UDWORD pie_GetFogColour(void);
//render states
extern void pie_SetTexturePage(SDWORD num);
extern void pie_SetBilinear(BOOL bilinearOn);
extern BOOL pie_GetBilinear(void);
extern void pie_SetColourKeyedBlack(BOOL keyingOn);
extern void pie_SetRendMode(REND_MODE rendMode);
extern void pie_SetColour(UDWORD val);
extern UDWORD pie_GetColour(void);
//mouse states
extern void pie_DrawMouse(int x,int y);
extern void pie_SetMouse(IMAGEFILE *ImageFile,UWORD ImageID);
extern UDWORD pie_GetMouseID( void );
extern BOOL pie_SwirlyBoxes( void );
extern void pie_SetSwirlyBoxes( BOOL val );
extern BOOL pie_WaveBlit( void );
extern void pie_SetWaveBlit( BOOL val );
void pie_ResetStates(void);//Sets all states
#endif // _pieState_h

View File

@ -1,70 +0,0 @@
/***************************************************************************/
/*
* rendfunc.h
*
* render functions for base render library.
*
*/
/***************************************************************************/
#ifndef _rendFunc_h
#define _rendFunc_h
/***************************************************************************/
#include "frame.h"
#include "piedef.h"
/***************************************************************************/
/*
* Global Definitions
*/
/***************************************************************************/
/***************************************************************************/
/*
* Global Variables
*/
/***************************************************************************/
/***************************************************************************/
/*
* Global ProtoTypes
*/
/***************************************************************************/
//*************************************************************************
// functions accessed dirtectly from rendmode
//*************************************************************************
extern void line(int x0, int y0, int x1, int y1, uint32 colour);
extern void box(int x0, int y0, int x1, int y1, uint32 colour);
extern void SetTransFilter(UDWORD rgb,UDWORD tablenumber);
extern void TransBoxFill(UDWORD x0, UDWORD y0, UDWORD x1, UDWORD y1);
extern void DrawImageDef(IMAGEDEF *Image,iBitmap *Bmp,UDWORD Modulus,int x,int y);
extern void DrawSemiTransImageDef(IMAGEDEF *Image,iBitmap *Bmp,UDWORD Modulus,int x,int y,int TransRate);
extern void DrawImage(IMAGEFILE *ImageFile,UWORD ID,int x,int y);
extern void DrawImageRect(IMAGEFILE *ImageFile,UWORD ID,int x,int y,int x0,int y0,int Width,int Height);
extern void DrawTransImage(IMAGEFILE *ImageFile,UWORD ID,int x,int y);
extern void DrawTransImageRect(IMAGEFILE *ImageFile,UWORD ID,int x,int y,int x0,int y0,int Width,int Height);
extern void DrawTransColourImage(IMAGEFILE *ImageFile,UWORD ID,int x,int y,SWORD ColourIndex);
extern void iV_SetMousePointer(IMAGEFILE *ImageFile,UWORD ImageID);
extern void iV_DrawMousePointer(int x,int y);
extern void DownLoadRadar(unsigned char *buffer);
extern void UploadDisplayBuffer(UBYTE *DisplayBuffer);
extern void DownloadDisplayBuffer(UBYTE *DisplayBuffer);
extern void ScaleBitmapRGB(UBYTE *DisplayBuffer,int Width,int Height,int ScaleR,int ScaleG,int ScaleB);
extern UDWORD iV_GetMouseFrame(void);
//*************************************************************************
// functions accessed indirectly from rendmode
//*************************************************************************
extern void (*iV_pBox)(int x0, int y0, int x1, int y1, uint32 colour);
extern void (*iV_pBoxFill)(int x0, int y0, int x1, int y1, uint32 colour);
//*************************************************************************
#endif // _rendFunc_h

View File

@ -1,7 +1,7 @@
bin_PROGRAMS = warzone
AM_CPPFLAGS = -I../lib/framework -I../lib/gamelib -I../lib/$(RENDERER) \
-I../lib/netplay -I../lib/script -I../lib/sequence -I../lib/sound \
-I../lib/widget -I..
-I../lib/widget -I../lib/ivis_common -I..
warzone_SOURCES = \
ai.c \
astar.c \
@ -266,6 +266,7 @@ warzone_libs = ../lib/framework/libframework.a \
../lib/sound/libsound.a \
../lib/netplay/libnetplay.a \
../lib/script/libscript.a \
../lib/ivis_common/libivis_common.a \
../lib/$(RENDERER)/lib$(RENDERER).a \
../lib/gamelib/libgamelib.a \
../lib/sequence/libsequence.a \
@ -273,7 +274,7 @@ warzone_libs = ../lib/framework/libframework.a \
warzone_LDFLAGS = -L../lib/framework -L../lib/gamelib -L../lib/$(RENDERER) \
-L../lib/netplay -L../lib/script -L../lib/sequence -L../lib/sound \
-L../lib/widget
-L../lib/widget -L../lib/ivis_common
warzone_DEPENDENCIES = $(warzone_libs)
warzone_LDADD = $(warzone_libs)