diff --git a/crossplatform/configure.ac b/crossplatform/configure.ac index 6cc908c36..43e4d1b9f 100644 --- a/crossplatform/configure.ac +++ b/crossplatform/configure.ac @@ -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 diff --git a/crossplatform/lib/ivis02/Makefile.am b/crossplatform/lib/ivis02/Makefile.am index f6c947276..1dab7d64b 100644 --- a/crossplatform/lib/ivis02/Makefile.am +++ b/crossplatform/lib/ivis02/Makefile.am @@ -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) diff --git a/crossplatform/lib/ivis02/bspfunc.h b/crossplatform/lib/ivis02/bspfunc.h deleted file mode 100644 index 743f13b91..000000000 --- a/crossplatform/lib/ivis02/bspfunc.h +++ /dev/null @@ -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 - diff --git a/crossplatform/lib/ivis02/bug.c b/crossplatform/lib/ivis02/bug.c deleted file mode 100644 index bfbf92810..000000000 --- a/crossplatform/lib/ivis02/bug.c +++ /dev/null @@ -1,54 +0,0 @@ -#include -#include -#include -#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); - } - -} diff --git a/crossplatform/lib/ivis02/bug.h b/crossplatform/lib/ivis02/bug.h deleted file mode 100644 index fa729481e..000000000 --- a/crossplatform/lib/ivis02/bug.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef _bug_ -#define _bug_ - -#include - -#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 diff --git a/crossplatform/lib/ivis02/imd.h b/crossplatform/lib/ivis02/imd.h deleted file mode 100644 index 7b3bbd841..000000000 --- a/crossplatform/lib/ivis02/imd.h +++ /dev/null @@ -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 diff --git a/crossplatform/lib/ivis02/ivi.h b/crossplatform/lib/ivis02/ivi.h deleted file mode 100644 index 25405810c..000000000 --- a/crossplatform/lib/ivis02/ivi.h +++ /dev/null @@ -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< (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 diff --git a/crossplatform/lib/ivis02/pietypes.h b/crossplatform/lib/ivis02/pietypes.h deleted file mode 100644 index 8b260f595..000000000 --- a/crossplatform/lib/ivis02/pietypes.h +++ /dev/null @@ -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 diff --git a/crossplatform/lib/ivis02/textdraw.c b/crossplatform/lib/ivis02/textdraw.c index c2fb87957..1520a17f8 100644 --- a/crossplatform/lib/ivis02/textdraw.c +++ b/crossplatform/lib/ivis02/textdraw.c @@ -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); } diff --git a/crossplatform/lib/ivis02/textdraw.h b/crossplatform/lib/ivis02/textdraw.h deleted file mode 100644 index ed4dfabcd..000000000 --- a/crossplatform/lib/ivis02/textdraw.h +++ /dev/null @@ -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 diff --git a/crossplatform/lib/ivis_common/Makefile.am b/crossplatform/lib/ivis_common/Makefile.am new file mode 100644 index 000000000..bd95905e0 --- /dev/null +++ b/crossplatform/lib/ivis_common/Makefile.am @@ -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) diff --git a/crossplatform/lib/ivis02/bitimage.h b/crossplatform/lib/ivis_common/bitimage.h similarity index 100% rename from crossplatform/lib/ivis02/bitimage.h rename to crossplatform/lib/ivis_common/bitimage.h diff --git a/crossplatform/lib/ivis_opengl/bspfunc.h b/crossplatform/lib/ivis_common/bspfunc.h similarity index 100% rename from crossplatform/lib/ivis_opengl/bspfunc.h rename to crossplatform/lib/ivis_common/bspfunc.h diff --git a/crossplatform/lib/ivis02/bspimd.h b/crossplatform/lib/ivis_common/bspimd.h similarity index 100% rename from crossplatform/lib/ivis02/bspimd.h rename to crossplatform/lib/ivis_common/bspimd.h diff --git a/crossplatform/lib/ivis_opengl/bug.c b/crossplatform/lib/ivis_common/bug.c similarity index 100% rename from crossplatform/lib/ivis_opengl/bug.c rename to crossplatform/lib/ivis_common/bug.c diff --git a/crossplatform/lib/ivis_opengl/bug.h b/crossplatform/lib/ivis_common/bug.h similarity index 100% rename from crossplatform/lib/ivis_opengl/bug.h rename to crossplatform/lib/ivis_common/bug.h diff --git a/crossplatform/lib/ivis02/fbf.h b/crossplatform/lib/ivis_common/fbf.h similarity index 100% rename from crossplatform/lib/ivis02/fbf.h rename to crossplatform/lib/ivis_common/fbf.h diff --git a/crossplatform/lib/ivis02/geo.h b/crossplatform/lib/ivis_common/geo.h similarity index 100% rename from crossplatform/lib/ivis02/geo.h rename to crossplatform/lib/ivis_common/geo.h diff --git a/crossplatform/lib/ivis_opengl/imd.h b/crossplatform/lib/ivis_common/imd.h similarity index 100% rename from crossplatform/lib/ivis_opengl/imd.h rename to crossplatform/lib/ivis_common/imd.h diff --git a/crossplatform/lib/ivis_opengl/ivi.h b/crossplatform/lib/ivis_common/ivi.h similarity index 100% rename from crossplatform/lib/ivis_opengl/ivi.h rename to crossplatform/lib/ivis_common/ivi.h diff --git a/crossplatform/lib/ivis_opengl/ivisdef.h b/crossplatform/lib/ivis_common/ivisdef.h similarity index 100% rename from crossplatform/lib/ivis_opengl/ivisdef.h rename to crossplatform/lib/ivis_common/ivisdef.h diff --git a/crossplatform/lib/ivis02/ivispatch.h b/crossplatform/lib/ivis_common/ivispatch.h similarity index 100% rename from crossplatform/lib/ivis02/ivispatch.h rename to crossplatform/lib/ivis_common/ivispatch.h diff --git a/crossplatform/lib/ivis02/pcx.h b/crossplatform/lib/ivis_common/pcx.h similarity index 100% rename from crossplatform/lib/ivis02/pcx.h rename to crossplatform/lib/ivis_common/pcx.h diff --git a/crossplatform/lib/ivis_opengl/pieblitfunc.h b/crossplatform/lib/ivis_common/pieblitfunc.h similarity index 100% rename from crossplatform/lib/ivis_opengl/pieblitfunc.h rename to crossplatform/lib/ivis_common/pieblitfunc.h diff --git a/crossplatform/lib/ivis_opengl/pieclip.h b/crossplatform/lib/ivis_common/pieclip.h similarity index 100% rename from crossplatform/lib/ivis_opengl/pieclip.h rename to crossplatform/lib/ivis_common/pieclip.h diff --git a/crossplatform/lib/ivis_opengl/piedef.h b/crossplatform/lib/ivis_common/piedef.h similarity index 100% rename from crossplatform/lib/ivis_opengl/piedef.h rename to crossplatform/lib/ivis_common/piedef.h diff --git a/crossplatform/lib/ivis02/piefunc.h b/crossplatform/lib/ivis_common/piefunc.h similarity index 100% rename from crossplatform/lib/ivis02/piefunc.h rename to crossplatform/lib/ivis_common/piefunc.h diff --git a/crossplatform/lib/ivis02/piemode.h b/crossplatform/lib/ivis_common/piemode.h similarity index 100% rename from crossplatform/lib/ivis02/piemode.h rename to crossplatform/lib/ivis_common/piemode.h diff --git a/crossplatform/lib/ivis02/piepalette.h b/crossplatform/lib/ivis_common/piepalette.h similarity index 100% rename from crossplatform/lib/ivis02/piepalette.h rename to crossplatform/lib/ivis_common/piepalette.h diff --git a/crossplatform/lib/ivis02/piestate.h b/crossplatform/lib/ivis_common/piestate.h similarity index 100% rename from crossplatform/lib/ivis02/piestate.h rename to crossplatform/lib/ivis_common/piestate.h diff --git a/crossplatform/lib/ivis_opengl/pietypes.h b/crossplatform/lib/ivis_common/pietypes.h similarity index 100% rename from crossplatform/lib/ivis_opengl/pietypes.h rename to crossplatform/lib/ivis_common/pietypes.h diff --git a/crossplatform/lib/ivis02/rendfunc.h b/crossplatform/lib/ivis_common/rendfunc.h similarity index 100% rename from crossplatform/lib/ivis02/rendfunc.h rename to crossplatform/lib/ivis_common/rendfunc.h diff --git a/crossplatform/lib/ivis_opengl/textdraw.h b/crossplatform/lib/ivis_common/textdraw.h similarity index 100% rename from crossplatform/lib/ivis_opengl/textdraw.h rename to crossplatform/lib/ivis_common/textdraw.h diff --git a/crossplatform/lib/ivis_opengl/Makefile.am b/crossplatform/lib/ivis_opengl/Makefile.am index d41469ca5..0bc7c2975 100644 --- a/crossplatform/lib/ivis_opengl/Makefile.am +++ b/crossplatform/lib/ivis_opengl/Makefile.am @@ -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) diff --git a/crossplatform/lib/ivis_opengl/bitimage.h b/crossplatform/lib/ivis_opengl/bitimage.h deleted file mode 100644 index 2ab09b149..000000000 --- a/crossplatform/lib/ivis_opengl/bitimage.h +++ /dev/null @@ -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 diff --git a/crossplatform/lib/ivis_opengl/bspimd.h b/crossplatform/lib/ivis_opengl/bspimd.h deleted file mode 100644 index 81a7e9997..000000000 --- a/crossplatform/lib/ivis_opengl/bspimd.h +++ /dev/null @@ -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 - diff --git a/crossplatform/lib/ivis_opengl/fbf.h b/crossplatform/lib/ivis_opengl/fbf.h deleted file mode 100644 index 7b4ae3156..000000000 --- a/crossplatform/lib/ivis_opengl/fbf.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef _fbf_ -#define _fbf_ - -#include -#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 diff --git a/crossplatform/lib/ivis_opengl/geo.h b/crossplatform/lib/ivis_opengl/geo.h deleted file mode 100644 index 29f9dded1..000000000 --- a/crossplatform/lib/ivis_opengl/geo.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef _geo_ -#define _geo_ - -#include "piematrix.h" - -#endif diff --git a/crossplatform/lib/ivis_opengl/ivispatch.h b/crossplatform/lib/ivis_opengl/ivispatch.h deleted file mode 100644 index c42c4d3a1..000000000 --- a/crossplatform/lib/ivis_opengl/ivispatch.h +++ /dev/null @@ -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 diff --git a/crossplatform/lib/ivis_opengl/pcx.h b/crossplatform/lib/ivis_opengl/pcx.h deleted file mode 100644 index 808f48141..000000000 --- a/crossplatform/lib/ivis_opengl/pcx.h +++ /dev/null @@ -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_ */ diff --git a/crossplatform/lib/ivis_opengl/piefunc.h b/crossplatform/lib/ivis_opengl/piefunc.h deleted file mode 100644 index 4e05d4b34..000000000 --- a/crossplatform/lib/ivis_opengl/piefunc.h +++ /dev/null @@ -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 diff --git a/crossplatform/lib/ivis_opengl/piemode.h b/crossplatform/lib/ivis_opengl/piemode.h deleted file mode 100644 index 165e5bed0..000000000 --- a/crossplatform/lib/ivis_opengl/piemode.h +++ /dev/null @@ -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 // diff --git a/crossplatform/lib/ivis_opengl/piepalette.h b/crossplatform/lib/ivis_opengl/piepalette.h deleted file mode 100644 index dcb01f03c..000000000 --- a/crossplatform/lib/ivis_opengl/piepalette.h +++ /dev/null @@ -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 diff --git a/crossplatform/lib/ivis_opengl/piestate.h b/crossplatform/lib/ivis_opengl/piestate.h deleted file mode 100644 index 7b3a3c20a..000000000 --- a/crossplatform/lib/ivis_opengl/piestate.h +++ /dev/null @@ -1,153 +0,0 @@ -/***************************************************************************/ -/* - * pieState.h - * - * render State controlr all pumpkin image library functions. - * - */ -/***************************************************************************/ - -#ifndef _piestate_h -#define _piestate_h - - -/***************************************************************************/ - -#include "frame.h" -//#include -#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 diff --git a/crossplatform/lib/ivis_opengl/rendfunc.h b/crossplatform/lib/ivis_opengl/rendfunc.h deleted file mode 100644 index 9475a9e47..000000000 --- a/crossplatform/lib/ivis_opengl/rendfunc.h +++ /dev/null @@ -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 diff --git a/crossplatform/src/Makefile.am b/crossplatform/src/Makefile.am index 9fcc941f0..e8763d036 100644 --- a/crossplatform/src/Makefile.am +++ b/crossplatform/src/Makefile.am @@ -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)