2010-02-15 23:26:55 +00:00
|
|
|
/*
|
|
|
|
Copyright (C) 1996-2001 Id Software, Inc.
|
2014-09-22 08:55:46 +00:00
|
|
|
Copyright (C) 2010-2014 QuakeSpasm developers
|
2010-02-15 23:26:55 +00:00
|
|
|
|
|
|
|
This program 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.
|
|
|
|
|
|
|
|
This program 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 this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
bspfile.h, cdaudio.h, client.h, cmd.h, common.h, console.h, crc.h, cvar.h,
d_ifacea.h, draw.h, gl_texmgr.h, glquake.h, image.h, input.h, keys.h, mathlib.h,
menu.h, modelgen.h, net.h, net_dgrm.h, net_loop.h, net_sdlnet.h, net_udp.h,
net_wins.h, platform.h, pr_comp.h, progdefs.h, progs.h, protocol.h, quakedef.h,
render.h, resource.h, sbar.h, screen.h, server.h, sound.h, spritegn.h, sys.h,
vid.h, view.h, wad.h, world.h, zone.h: added include guards to the headers.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@84 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-02-21 00:01:08 +00:00
|
|
|
#ifndef __PR_COMP_H
|
|
|
|
#define __PR_COMP_H
|
|
|
|
|
2010-02-15 23:26:55 +00:00
|
|
|
// this file is shared by quake and qcc
|
|
|
|
|
2021-03-28 11:14:52 +00:00
|
|
|
typedef unsigned int func_t;
|
2010-02-15 23:26:55 +00:00
|
|
|
typedef int string_t;
|
|
|
|
|
2023-07-06 04:16:32 +00:00
|
|
|
#if _MSC_VER >= 1300
|
|
|
|
#define Q_ALIGN(a) __declspec(align(a))
|
|
|
|
#elif defined(__clang__)
|
|
|
|
#define Q_ALIGN(a) __attribute__((aligned(a)))
|
|
|
|
#elif __GNUC__ >= 3
|
|
|
|
#define Q_ALIGN(a) __attribute__((aligned(a)))
|
|
|
|
#else
|
|
|
|
#define Q_ALIGN(a)
|
|
|
|
#endif
|
|
|
|
//64bit types need alignment hints to ensure we don't get misalignment exceptions on other platforms.
|
|
|
|
typedef Q_ALIGN(4) int64_t qcsint64_t;
|
|
|
|
typedef Q_ALIGN(4) uint64_t qcuint64_t;
|
|
|
|
typedef Q_ALIGN(4) double qcdouble_t;
|
|
|
|
|
2011-12-12 08:56:25 +00:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
ev_bad = -1,
|
|
|
|
ev_void = 0,
|
|
|
|
ev_string,
|
|
|
|
ev_float,
|
|
|
|
ev_vector,
|
|
|
|
ev_entity,
|
|
|
|
ev_field,
|
|
|
|
ev_function,
|
2017-09-17 02:12:53 +00:00
|
|
|
ev_pointer,
|
|
|
|
|
2023-07-06 04:16:32 +00:00
|
|
|
ev_ext_integer,
|
|
|
|
ev_ext_uint32,
|
|
|
|
ev_ext_sint64,
|
|
|
|
ev_ext_uint64,
|
|
|
|
ev_ext_double,
|
2011-12-12 08:56:25 +00:00
|
|
|
} etype_t;
|
2010-02-15 23:26:55 +00:00
|
|
|
|
|
|
|
#define OFS_NULL 0
|
|
|
|
#define OFS_RETURN 1
|
2011-12-12 08:56:25 +00:00
|
|
|
#define OFS_PARM0 4 // leave 3 ofs for each parm to hold vectors
|
2010-02-15 23:26:55 +00:00
|
|
|
#define OFS_PARM1 7
|
|
|
|
#define OFS_PARM2 10
|
|
|
|
#define OFS_PARM3 13
|
|
|
|
#define OFS_PARM4 16
|
|
|
|
#define OFS_PARM5 19
|
|
|
|
#define OFS_PARM6 22
|
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
|
|
|
OP_NOT_S,
|
|
|
|
OP_NOT_ENT,
|
|
|
|
OP_NOT_FNC,
|
|
|
|
OP_IF,
|
|
|
|
OP_IFNOT,
|
|
|
|
OP_CALL0,
|
|
|
|
OP_CALL1,
|
|
|
|
OP_CALL2,
|
|
|
|
OP_CALL3,
|
|
|
|
OP_CALL4,
|
|
|
|
OP_CALL5,
|
|
|
|
OP_CALL6,
|
|
|
|
OP_CALL7,
|
|
|
|
OP_CALL8,
|
|
|
|
OP_STATE,
|
|
|
|
OP_GOTO,
|
|
|
|
OP_AND,
|
|
|
|
OP_OR,
|
|
|
|
|
|
|
|
OP_BITAND,
|
|
|
|
OP_BITOR
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct statement_s
|
|
|
|
{
|
|
|
|
unsigned short op;
|
2011-12-12 08:56:25 +00:00
|
|
|
short a, b, c;
|
2010-02-15 23:26:55 +00:00
|
|
|
} dstatement_t;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
2011-12-12 08:56:25 +00:00
|
|
|
unsigned short type; // if DEF_SAVEGLOBAL bit is set
|
|
|
|
// the variable needs to be saved in savegames
|
2010-02-15 23:26:55 +00:00
|
|
|
unsigned short ofs;
|
2011-12-12 08:56:25 +00:00
|
|
|
int s_name;
|
2010-02-15 23:26:55 +00:00
|
|
|
} ddef_t;
|
2011-12-12 08:56:25 +00:00
|
|
|
|
2010-02-15 23:26:55 +00:00
|
|
|
#define DEF_SAVEGLOBAL (1<<15)
|
|
|
|
|
|
|
|
#define MAX_PARMS 8
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
int first_statement; // negative numbers are builtins
|
|
|
|
int parm_start;
|
2011-12-12 08:56:25 +00:00
|
|
|
int locals; // total ints of parms + locals
|
2010-02-15 23:26:55 +00:00
|
|
|
|
|
|
|
int profile; // runtime
|
|
|
|
|
|
|
|
int s_name;
|
|
|
|
int s_file; // source file defined in
|
|
|
|
|
|
|
|
int numparms;
|
|
|
|
byte parm_size[MAX_PARMS];
|
|
|
|
} dfunction_t;
|
|
|
|
|
|
|
|
|
|
|
|
#define PROG_VERSION 6
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
int version;
|
2011-12-12 08:56:25 +00:00
|
|
|
int crc; // check of header file
|
2010-02-15 23:26:55 +00:00
|
|
|
|
|
|
|
int ofs_statements;
|
|
|
|
int numstatements; // statement 0 is an error
|
|
|
|
|
|
|
|
int ofs_globaldefs;
|
|
|
|
int numglobaldefs;
|
|
|
|
|
|
|
|
int ofs_fielddefs;
|
|
|
|
int numfielddefs;
|
|
|
|
|
|
|
|
int ofs_functions;
|
|
|
|
int numfunctions; // function 0 is an empty
|
|
|
|
|
|
|
|
int ofs_strings;
|
2011-12-12 08:56:25 +00:00
|
|
|
int numstrings; // first string is a null string
|
2010-02-15 23:26:55 +00:00
|
|
|
|
|
|
|
int ofs_globals;
|
|
|
|
int numglobals;
|
|
|
|
|
|
|
|
int entityfields;
|
|
|
|
} dprograms_t;
|
|
|
|
|
bspfile.h, cdaudio.h, client.h, cmd.h, common.h, console.h, crc.h, cvar.h,
d_ifacea.h, draw.h, gl_texmgr.h, glquake.h, image.h, input.h, keys.h, mathlib.h,
menu.h, modelgen.h, net.h, net_dgrm.h, net_loop.h, net_sdlnet.h, net_udp.h,
net_wins.h, platform.h, pr_comp.h, progdefs.h, progs.h, protocol.h, quakedef.h,
render.h, resource.h, sbar.h, screen.h, server.h, sound.h, spritegn.h, sys.h,
vid.h, view.h, wad.h, world.h, zone.h: added include guards to the headers.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@84 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-02-21 00:01:08 +00:00
|
|
|
#endif /* __PR_COMP_H */
|
|
|
|
|