2007-01-15 12:09:25 -08:00
|
|
|
/*
|
|
|
|
This file is part of Warzone 2100.
|
|
|
|
Copyright (C) 1999-2004 Eidos Interactive
|
2009-02-10 10:01:48 -08:00
|
|
|
Copyright (C) 2005-2009 Warzone Resurrection Project
|
2007-01-15 12:09:25 -08:00
|
|
|
|
|
|
|
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
|
|
|
/***************************************************************************/
|
|
|
|
/*
|
|
|
|
* pieState.h
|
|
|
|
*
|
|
|
|
* render State controlr all pumpkin image library functions.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
/***************************************************************************/
|
|
|
|
|
|
|
|
#ifndef _piestate_h
|
|
|
|
#define _piestate_h
|
|
|
|
|
|
|
|
|
|
|
|
/***************************************************************************/
|
|
|
|
|
2006-05-27 09:37:17 -07:00
|
|
|
#include "lib/framework/frame.h"
|
2007-06-28 10:47:08 -07:00
|
|
|
#include "piedef.h"
|
|
|
|
|
|
|
|
/***************************************************************************/
|
|
|
|
/*
|
|
|
|
* Global Definitions
|
|
|
|
*/
|
|
|
|
/***************************************************************************/
|
|
|
|
|
|
|
|
typedef enum REND_MODE
|
|
|
|
{
|
2010-02-04 01:02:16 -08:00
|
|
|
REND_ALPHA,
|
|
|
|
REND_ADDITIVE,
|
|
|
|
REND_OPAQUE,
|
2010-03-20 19:52:10 -07:00
|
|
|
REND_MULTIPLICATIVE
|
2007-06-28 10:47:08 -07:00
|
|
|
}
|
|
|
|
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_FILTER,
|
|
|
|
TRANS_ALPHA,
|
2010-03-20 19:52:10 -07:00
|
|
|
TRANS_ADDITIVE,
|
|
|
|
TRANS_MULTIPLICATIVE
|
2007-06-28 10:47:08 -07:00
|
|
|
}
|
|
|
|
TRANSLUCENCY_MODE;
|
|
|
|
|
2006-03-17 17:59:59 -08:00
|
|
|
typedef struct RENDER_STATE
|
|
|
|
{
|
|
|
|
BOOL fogEnabled;
|
|
|
|
BOOL fog;
|
2007-11-25 15:06:24 -08:00
|
|
|
PIELIGHT fogColour;
|
2006-03-17 17:59:59 -08:00
|
|
|
SDWORD texPage;
|
|
|
|
REND_MODE rendMode;
|
|
|
|
BOOL keyingOn;
|
|
|
|
TRANSLUCENCY_MODE transMode;
|
|
|
|
}
|
|
|
|
RENDER_STATE;
|
|
|
|
|
2008-03-21 07:34:30 -07:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
TEXPAGE_NONE = -1,
|
|
|
|
TEXPAGE_FONT = -2
|
|
|
|
} TEXPAGE_TYPE;
|
2007-06-28 10:47:08 -07:00
|
|
|
|
2010-03-06 15:06:35 -08:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
SHADER_NONE,
|
|
|
|
SHADER_TCMASK,
|
2010-03-09 14:07:32 -08:00
|
|
|
SHADER_TCMASK_FOGGED,
|
2010-03-06 15:06:35 -08:00
|
|
|
SHADER_MAX
|
|
|
|
} SHADER_MODE;
|
|
|
|
|
2007-06-28 10:47:08 -07:00
|
|
|
/***************************************************************************/
|
|
|
|
/*
|
|
|
|
* Global Variables
|
|
|
|
*/
|
|
|
|
/***************************************************************************/
|
|
|
|
|
2007-07-11 14:09:40 -07:00
|
|
|
extern unsigned int pieStateCount;
|
2009-02-21 15:35:21 -08:00
|
|
|
extern RENDER_STATE rendStates;
|
2007-06-28 10:47:08 -07:00
|
|
|
|
|
|
|
/***************************************************************************/
|
|
|
|
/*
|
|
|
|
* Global ProtoTypes
|
|
|
|
*/
|
|
|
|
/***************************************************************************/
|
2006-09-13 14:11:11 -07:00
|
|
|
extern void pie_SetDefaultStates(void);//Sets all states
|
2007-06-28 10:47:08 -07:00
|
|
|
extern void pie_SetDepthBufferStatus(DEPTH_MODE depthMode);
|
2007-04-05 07:32:13 -07:00
|
|
|
extern void pie_SetDepthOffset(float offset);
|
2007-06-28 10:47:08 -07:00
|
|
|
//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);
|
2007-11-25 15:06:24 -08:00
|
|
|
extern void pie_SetFogColour(PIELIGHT colour);
|
|
|
|
extern PIELIGHT pie_GetFogColour(void) WZ_DECL_PURE;
|
2007-03-20 13:46:26 -07:00
|
|
|
extern void pie_UpdateFogDistance(float begin, float end);
|
2007-06-28 10:47:08 -07:00
|
|
|
//render states
|
|
|
|
extern void pie_SetTexturePage(SDWORD num);
|
2007-12-26 17:05:37 -08:00
|
|
|
extern void pie_SetAlphaTest(BOOL keyingOn);
|
2007-06-28 10:47:08 -07:00
|
|
|
extern void pie_SetRendMode(REND_MODE rendMode);
|
|
|
|
|
2008-03-30 08:44:50 -07:00
|
|
|
extern void pie_InitColourMouse(IMAGEFILE* img, const uint16_t cursorIDs[CURSOR_MAX]);
|
|
|
|
extern void pie_SetMouse(CURSOR cursor, bool coloured);
|
|
|
|
extern void pie_DrawMouse(unsigned int X, unsigned int Y);
|
2008-11-08 13:37:32 -08:00
|
|
|
extern void pie_ShowMouse(bool visible);
|
2008-03-30 08:44:50 -07:00
|
|
|
|
2008-03-28 16:28:44 -07:00
|
|
|
extern void pie_SetTranslucencyMode(TRANSLUCENCY_MODE transMode);
|
|
|
|
|
2010-03-06 15:06:35 -08:00
|
|
|
/* Actually in piestate.c */
|
|
|
|
|
|
|
|
// Shaders control center
|
|
|
|
extern bool pie_GetShadersStatus(void);
|
|
|
|
extern void pie_SetShadersStatus(bool);
|
|
|
|
bool pie_LoadShaders(void);
|
|
|
|
// Actual shaders (we do not want to export these calls)
|
|
|
|
void pie_DeactivateShader(void);
|
|
|
|
void pie_ActivateShader_TCMask(PIELIGHT teamcolour, SDWORD maskpage);
|
|
|
|
|
|
|
|
/* Actually in piedraw.c */
|
|
|
|
|
|
|
|
// Lighting cotrols
|
|
|
|
extern void pie_SetLightingState(bool);
|
|
|
|
extern bool pie_GetLightingState(void);
|
|
|
|
|
|
|
|
/* Errors control routine */
|
2010-01-30 08:57:28 -08:00
|
|
|
#define glErrors() \
|
2009-10-31 14:17:08 -07:00
|
|
|
_glerrors(__FUNCTION__, __FILE__, __LINE__)
|
|
|
|
|
|
|
|
extern bool _glerrors(const char *, const char *, int);
|
|
|
|
|
|
|
|
|
2007-06-28 10:47:08 -07:00
|
|
|
#endif // _pieState_h
|