2007-01-15 12:09:25 -08:00
|
|
|
/*
|
|
|
|
This file is part of Warzone 2100.
|
|
|
|
Copyright (C) 1999-2004 Eidos Interactive
|
|
|
|
Copyright (C) 2005-2007 Warzone Resurrection Project
|
|
|
|
|
|
|
|
Warzone 2100 is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
Warzone 2100 is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with Warzone 2100; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*/
|
2007-06-28 10:47:08 -07:00
|
|
|
/***************************************************************************/
|
|
|
|
/*
|
|
|
|
* ivisdef.h
|
|
|
|
*
|
|
|
|
* type defines for all ivis library functions.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
/***************************************************************************/
|
|
|
|
|
|
|
|
#ifndef _ivisdef_h
|
|
|
|
#define _ivisdef_h
|
|
|
|
|
2006-05-27 09:37:17 -07:00
|
|
|
#include "lib/framework/frame.h"
|
2007-06-28 10:47:08 -07:00
|
|
|
#include "pietypes.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***************************************************************************/
|
|
|
|
/***************************************************************************/
|
|
|
|
/*
|
|
|
|
* Global Definitions
|
|
|
|
*/
|
|
|
|
/***************************************************************************/
|
|
|
|
#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
|
|
|
|
|
|
|
|
|
|
|
|
//*************************************************************************
|
|
|
|
//
|
|
|
|
// screen surface structure
|
|
|
|
//
|
|
|
|
//*************************************************************************
|
2007-03-16 09:20:16 -07:00
|
|
|
typedef struct { Sint32 left, top, right, bottom; } iClip;
|
2007-06-28 10:47:08 -07:00
|
|
|
|
|
|
|
typedef struct iSurface {
|
2007-03-16 09:20:16 -07:00
|
|
|
Uint32 flags;
|
2007-06-28 10:47:08 -07:00
|
|
|
int xcentre;
|
|
|
|
int ycentre;
|
|
|
|
int xpshift;
|
|
|
|
int ypshift;
|
|
|
|
iClip clip;
|
|
|
|
|
2007-01-07 15:50:30 -08:00
|
|
|
UBYTE *buffer;
|
2007-03-16 09:20:16 -07:00
|
|
|
Sint32 scantable[iV_SCANTABLE_MAX]; // currently uses 4k per structure (!)
|
2007-06-28 10:47:08 -07:00
|
|
|
|
|
|
|
int width;
|
|
|
|
int height;
|
2007-03-16 09:20:16 -07:00
|
|
|
Sint32 size;
|
2007-06-28 10:47:08 -07:00
|
|
|
} iSurface;
|
|
|
|
|
|
|
|
//*************************************************************************
|
|
|
|
//
|
|
|
|
// texture animation structures
|
|
|
|
//
|
|
|
|
//*************************************************************************
|
|
|
|
typedef struct {
|
|
|
|
int npoints;
|
2007-03-16 09:20:16 -07:00
|
|
|
Vector2i frame[iV_IMD_ANIM_FRAMES];
|
2007-06-28 10:47:08 -07:00
|
|
|
} iTexAnimFrame;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
int nFrames;
|
|
|
|
int playbackRate;
|
2007-07-30 13:20:06 -07:00
|
|
|
int textureWidth;
|
|
|
|
int textureHeight;
|
2007-06-28 10:47:08 -07:00
|
|
|
} iTexAnim;
|
|
|
|
|
|
|
|
|
|
|
|
//*************************************************************************
|
|
|
|
//
|
|
|
|
// imd structures
|
|
|
|
//
|
|
|
|
//*************************************************************************
|
|
|
|
|
2007-07-25 13:58:57 -07:00
|
|
|
/// Stores the from and to verticles from an edge
|
|
|
|
typedef struct edge_
|
|
|
|
{
|
|
|
|
int from, to;
|
|
|
|
} EDGE;
|
|
|
|
|
2006-11-26 03:20:44 -08:00
|
|
|
typedef int VERTEXID; // Size of the entry for vertex id in the imd polygon structure
|
2007-06-28 10:47:08 -07:00
|
|
|
|
|
|
|
typedef struct {
|
2007-03-16 09:20:16 -07:00
|
|
|
Uint32 flags;
|
|
|
|
Sint32 zcentre;
|
2007-06-28 10:47:08 -07:00
|
|
|
int npnts;
|
2007-05-21 12:56:07 -07:00
|
|
|
Vector3f normal;
|
2007-06-28 10:47:08 -07:00
|
|
|
VERTEXID *pindex;
|
2007-07-25 15:37:48 -07:00
|
|
|
Vector2f *texCoord;
|
2007-05-21 11:25:46 -07:00
|
|
|
iTexAnim *pTexAnim;
|
2007-06-28 10:47:08 -07:00
|
|
|
} iIMDPoly;
|
|
|
|
|
|
|
|
typedef struct iIMDShape {
|
2007-07-25 13:58:57 -07:00
|
|
|
int texpage;
|
|
|
|
int sradius, radius, xmin, xmax, ymin, ymax, zmin, zmax;
|
2007-06-28 10:47:08 -07:00
|
|
|
|
2007-05-21 12:56:07 -07:00
|
|
|
Vector3f ocen;
|
2007-07-25 13:58:57 -07:00
|
|
|
unsigned short numFrames;
|
|
|
|
unsigned short animInterval;
|
2007-06-28 10:47:08 -07:00
|
|
|
|
2007-07-25 13:58:57 -07:00
|
|
|
unsigned int npoints;
|
2007-05-21 12:56:07 -07:00
|
|
|
Vector3f *points;
|
2007-06-28 10:47:08 -07:00
|
|
|
|
2007-07-25 13:58:57 -07:00
|
|
|
unsigned int npolys;
|
|
|
|
iIMDPoly *polys;
|
2007-06-28 10:47:08 -07:00
|
|
|
|
2007-07-25 13:58:57 -07:00
|
|
|
unsigned int nconnectors;
|
|
|
|
Vector3f *connectors;
|
2007-06-28 10:47:08 -07:00
|
|
|
|
2007-03-24 15:53:18 -07:00
|
|
|
unsigned int nShadowEdges;
|
2007-07-25 13:58:57 -07:00
|
|
|
EDGE *shadowEdgeList;
|
|
|
|
|
|
|
|
struct iIMDShape *next; // next pie in multilevel pies (NULL for non multilevel !)
|
2007-06-28 10:47:08 -07:00
|
|
|
} iIMDShape;
|
|
|
|
|
|
|
|
|
|
|
|
//*************************************************************************
|
|
|
|
//
|
|
|
|
// immitmap image structures
|
|
|
|
//
|
|
|
|
//*************************************************************************
|
|
|
|
|
|
|
|
typedef struct {
|
2007-05-27 08:50:56 -07:00
|
|
|
uint16_t Version;
|
|
|
|
uint16_t NumImages;
|
|
|
|
uint16_t BitDepth;
|
|
|
|
uint16_t NumTPages;
|
2007-06-05 05:01:59 -07:00
|
|
|
char TPageFiles[16][16];
|
2007-06-28 10:47:08 -07:00
|
|
|
} IMAGEHEADER;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
2007-05-27 08:50:56 -07:00
|
|
|
uint16_t TPageID;
|
2007-07-30 13:20:06 -07:00
|
|
|
uint16_t Tu;
|
|
|
|
uint16_t Tv;
|
2007-05-27 08:50:56 -07:00
|
|
|
uint16_t Width;
|
|
|
|
uint16_t Height;
|
|
|
|
int16_t XOffset;
|
|
|
|
int16_t YOffset;
|
2007-06-28 10:47:08 -07:00
|
|
|
} IMAGEDEF;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
IMAGEHEADER Header;
|
2007-03-16 09:20:16 -07:00
|
|
|
iTexture *TexturePages;
|
2007-05-27 08:50:56 -07:00
|
|
|
unsigned short NumCluts;
|
|
|
|
unsigned short TPageIDs[16];
|
|
|
|
unsigned short ClutIDs[48];
|
2007-06-28 10:47:08 -07:00
|
|
|
IMAGEDEF *ImageDefs;
|
|
|
|
} IMAGEFILE;
|
|
|
|
|
|
|
|
/***************************************************************************/
|
|
|
|
/*
|
|
|
|
* Global Variables
|
|
|
|
*/
|
|
|
|
/***************************************************************************/
|
|
|
|
|
|
|
|
#endif // _ivisdef_h
|