#ifndef _renderer_api_h #define _renderer_api_h #include #ifdef _CGAME_DLL #include "cgamex86.h" #else #include "gamex86.h" #endif #ifdef WANT_OPENGL #include "ogl\opengl_api.h" #endif #define QUAT_EPSILON 0.00001 #ifndef M_PI #define M_PI 3.1415926535897932384626433832795f #endif #define random() ((rand () & 0x7fff) / ((float)0x7fff)) #define crandom() (2.0 * (random() - 0.5)) #define DEG2RAD( a ) ( ( (a) * M_PI ) / 180.0F ) #define RAD2DEG( a ) ( ( (a) * 180.0f ) / M_PI ) #define ANGLE2SHORT(x) ((int)((x)*65536/360) & 65535) #define SHORT2ANGLE(x) ((x)*(360.0/65536)) #define SUBMAX( a, b ) ( a > b ? ( a - b ) : ( b - a ) ) #define SUBMIN( a, b ) ( a < b ? ( a - b ) : ( b - a ) ) /*#define DotProduct(x,y) ((x)[0]*(y)[0]+(x)[1]*(y)[1]+(x)[2]*(y)[2]) #define VectorSubtract(a,b,c) ((c)[0]=(a)[0]-(b)[0],(c)[1]=(a)[1]-(b)[1],(c)[2]=(a)[2]-(b)[2]) #define VectorAdd(a,b,c) ((c)[0]=(a)[0]+(b)[0],(c)[1]=(a)[1]+(b)[1],(c)[2]=(a)[2]+(b)[2]) #define VectorCopy(a,b) ((b)[0]=(a)[0],(b)[1]=(a)[1],(b)[2]=(a)[2]) #define VectorScale(v, s, o) ((o)[0]=(v)[0]*(s),(o)[1]=(v)[1]*(s),(o)[2]=(v)[2]*(s)) #define VectorMA(v, s, b, o) ((o)[0]=(v)[0]+(b)[0]*(s),(o)[1]=(v)[1]+(b)[1]*(s),(o)[2]=(v)[2]+(b)[2]*(s)) #define VectorCompare(a,b) (((a)[0]==(b)[0])&&((a)[1]==(b)[1])&&((a)[2]==(b)[2])) #define VectorClear(a) ((a)[0]=(a)[1]=(a)[2]=0) #define VectorNegate(a,b) ((b)[0]=-(a)[0],(b)[1]=-(a)[1],(b)[2]=-(a)[2]) #define VectorSet(v, x, y, z) ((v)[0]=(x), (v)[1]=(y), (v)[2]=(z)) #define Vector4Copy(a,b) ((b)[0]=(a)[0],(b)[1]=(a)[1],(b)[2]=(a)[2],(b)[3]=(a)[3])*/ #define VectorInverse(a) ((a)[0]=-(a)[0],(a)[1]=-(a)[1],(a)[2]=-(a)[2]) #define PITCH 0 #define YAW 1 #define ROLL 2 #define RED 0 #define GREEN 1 #define BLUE 2 #define MAX_EFFECTS 10 #define MAX_EFFECTS_LENGTH 64 /* Animation flags */ #define ANIM_RANDOM 0x01 #define ANIM_DELTADRIVEN 0x02 #define ANIM_DONTREPEATE 0x03 #define ANIM_AUTOSTEPS_DOG 0x04 #define ANIM_DEFAULTANGLES 0x08 #define ANIM_NOTIMECHECK 0x10 #define ANIM_AUTOSTEPS_WALK 0x14 #define ANIM_AUTOSTEPS_RUN 0x1C #define GLS_SRCBLEND_ZERO 0x00000001 #define GLS_SRCBLEND_ONE 0x00000002 #define GLS_SRCBLEND_DST_COLOR 0x00000003 #define GLS_SRCBLEND_ONE_MINUS_DST_COLOR 0x00000004 #define GLS_SRCBLEND_SRC_ALPHA 0x00000005 #define GLS_SRCBLEND_ONE_MINUS_SRC_ALPHA 0x00000006 #define GLS_SRCBLEND_DST_ALPHA 0x00000007 #define GLS_SRCBLEND_ONE_MINUS_DST_ALPHA 0x00000008 #define GLS_SRCBLEND_ALPHA_SATURATE 0x00000009 #define GLS_SRCBLEND_BITS 0x0000000f #define GLS_DSTBLEND_ZERO 0x00000010 #define GLS_DSTBLEND_ONE 0x00000020 #define GLS_DSTBLEND_SRC_COLOR 0x00000030 #define GLS_DSTBLEND_ONE_MINUS_SRC_COLOR 0x00000040 #define GLS_DSTBLEND_SRC_ALPHA 0x00000050 #define GLS_DSTBLEND_ONE_MINUS_SRC_ALPHA 0x00000060 #define GLS_DSTBLEND_DST_ALPHA 0x00000070 #define GLS_DSTBLEND_ONE_MINUS_DST_ALPHA 0x00000080 #define GLS_DSTBLEND_BITS 0x000000f0 #define GLS_DEPTHMASK_TRUE 0x00000100 #define GLS_NODEPTH 0x00000200 #define GLS_DEPTH 0x00000300 #define GLS_POLYMODE_LINE 0x00001000 #define GLS_DEPTHTEST_DISABLE 0x00010000 #define GLS_DEPTHFUNC_EQUAL 0x00020000 #define GLS_ATEST_GT_0 0x10000000 #define GLS_ATEST_LT_80 0x20000000 #define GLS_ATEST_GE_80 0x40000000 #define GLS_ATEST_BITS 0x70000000 #define GLS_DEFAULT GLS_DEPTHMASK_TRUE #define ELM_MODELS 0x004b56b3 #define ELM_WALLS 0x004b598e #define ELM_FLAT 0x004b3993 #define ELM_ENTS 0x004b56b3 #define ELM_WORLD 0x004b598e static const char *anim_cmd[] = { "weight", "deltadriven", "default_angles", "notimecheck", "crossblend", "dontrepeate", "random", "autosteps_run", "autosteps_walk", "autosteps_dog", }; static const char *effectName[MAX_EFFECTS] = { "bloom", "blur", "darkwhite", "dof", "invert", "scenecolor", "thermal", "wallhack", "wave", }; qboolean __inline R_IsEffect(const char * fxName) { int i; /* Check if the name is a valid effect name */ for(i=0;i