mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-13 00:24:12 +00:00
Massive whitespace cleanup.
Lots of trailing whitespace and otherwise blank lines.
This commit is contained in:
parent
01773c7cd3
commit
23a38738fc
254 changed files with 1793 additions and 1793 deletions
|
@ -7,7 +7,7 @@
|
||||||
#define GL_ELEMENT_ARRAY_ATI 0x8768
|
#define GL_ELEMENT_ARRAY_ATI 0x8768
|
||||||
#define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769
|
#define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769
|
||||||
#define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A
|
#define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A
|
||||||
|
|
||||||
typedef GLvoid (GLAPIENTRY *QF_PFNGLELEMENTPOINTERATIPROC)
|
typedef GLvoid (GLAPIENTRY *QF_PFNGLELEMENTPOINTERATIPROC)
|
||||||
(GLenum type, const GLvoid *pointer);
|
(GLenum type, const GLvoid *pointer);
|
||||||
typedef GLvoid (GLAPIENTRY *QF_PFNGLDRAWELEMENTARRAYATIPROC)
|
typedef GLvoid (GLAPIENTRY *QF_PFNGLDRAWELEMENTARRAYATIPROC)
|
||||||
|
@ -186,10 +186,10 @@ typedef GLvoid (GLAPIENTRY *QF_PFNGLALPHAFRAGMENTOP3ATIPROC)
|
||||||
GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);
|
GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);
|
||||||
typedef GLvoid (GLAPIENTRY *QF_PFNGLSETFRAGMENTSHADERCONSTANTATIPROC)
|
typedef GLvoid (GLAPIENTRY *QF_PFNGLSETFRAGMENTSHADERCONSTANTATIPROC)
|
||||||
(GLuint dst, const GLfloat *value);
|
(GLuint dst, const GLfloat *value);
|
||||||
|
|
||||||
#endif // GL_ATI_fragment_shader
|
#endif // GL_ATI_fragment_shader
|
||||||
|
|
||||||
|
|
||||||
// GL_ATI_pn_triangles (Supported on R200+)
|
// GL_ATI_pn_triangles (Supported on R200+)
|
||||||
#ifndef GL_ATI_pn_triangles
|
#ifndef GL_ATI_pn_triangles
|
||||||
#define GL_ATI_pn_triangles 1
|
#define GL_ATI_pn_triangles 1
|
||||||
|
@ -265,7 +265,7 @@ typedef GLvoid (GLAPIENTRY *QF_PFNGLGETVARIANTARRAYOBJECTIVATIPROC)
|
||||||
// GL_ATI_vertex_streams (Rage 128 & R100+)
|
// GL_ATI_vertex_streams (Rage 128 & R100+)
|
||||||
#ifndef GL_ATI_vertex_streams
|
#ifndef GL_ATI_vertex_streams
|
||||||
#define GL_ATI_vertex_streams 1
|
#define GL_ATI_vertex_streams 1
|
||||||
|
|
||||||
#define GL_MAX_VERTEX_STREAMS_ATI 0x876B
|
#define GL_MAX_VERTEX_STREAMS_ATI 0x876B
|
||||||
#define GL_VERTEX_SOURCE_ATI 0x876C
|
#define GL_VERTEX_SOURCE_ATI 0x876C
|
||||||
#define GL_VERTEX_STREAM0_ATI 0x876D
|
#define GL_VERTEX_STREAM0_ATI 0x876D
|
||||||
|
@ -276,7 +276,7 @@ typedef GLvoid (GLAPIENTRY *QF_PFNGLGETVARIANTARRAYOBJECTIVATIPROC)
|
||||||
#define GL_VERTEX_STREAM5_ATI 0x8772
|
#define GL_VERTEX_STREAM5_ATI 0x8772
|
||||||
#define GL_VERTEX_STREAM6_ATI 0x8773
|
#define GL_VERTEX_STREAM6_ATI 0x8773
|
||||||
#define GL_VERTEX_STREAM7_ATI 0x8774
|
#define GL_VERTEX_STREAM7_ATI 0x8774
|
||||||
|
|
||||||
typedef GLvoid (GLAPIENTRY *QF_PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC)
|
typedef GLvoid (GLAPIENTRY *QF_PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC)
|
||||||
(GLenum stream);
|
(GLenum stream);
|
||||||
typedef GLvoid (GLAPIENTRY *QF_PFNGLVERTEXBLENDENVIATIPROC)
|
typedef GLvoid (GLAPIENTRY *QF_PFNGLVERTEXBLENDENVIATIPROC)
|
||||||
|
@ -359,7 +359,7 @@ typedef GLvoid (GLAPIENTRY *QF_PFNGLNORMALSTREAM3DVATIPROC)
|
||||||
// GL_ATIX_point_sprites (R100)
|
// GL_ATIX_point_sprites (R100)
|
||||||
#ifndef GL_ATIX_point_sprites
|
#ifndef GL_ATIX_point_sprites
|
||||||
#define GL_ATIX_point_sprites 1
|
#define GL_ATIX_point_sprites 1
|
||||||
|
|
||||||
#define GL_TEXTURE_POINT_MODE_ATIX 0x60b0
|
#define GL_TEXTURE_POINT_MODE_ATIX 0x60b0
|
||||||
#define GL_TEXTURE_POINT_ONE_COORD_ATIX 0x60b1
|
#define GL_TEXTURE_POINT_ONE_COORD_ATIX 0x60b1
|
||||||
#define GL_TEXTURE_POINT_SPRITE_ATIX 0x60b2
|
#define GL_TEXTURE_POINT_SPRITE_ATIX 0x60b2
|
||||||
|
@ -373,29 +373,29 @@ typedef GLvoid (GLAPIENTRY *QF_PFNGLNORMALSTREAM3DVATIPROC)
|
||||||
// GL_ATIX_texture_env_combine3 (R100)
|
// GL_ATIX_texture_env_combine3 (R100)
|
||||||
#ifndef GL_ATIX_texture_env_combine3
|
#ifndef GL_ATIX_texture_env_combine3
|
||||||
#define GL_ATIX_texture_env_combine3
|
#define GL_ATIX_texture_env_combine3
|
||||||
|
|
||||||
#define GL_MODULATE_ADD_ATIX 0x8744
|
#define GL_MODULATE_ADD_ATIX 0x8744
|
||||||
#define GL_MODULATE_SIGNED_ADD_ATIX 0x8745
|
#define GL_MODULATE_SIGNED_ADD_ATIX 0x8745
|
||||||
#define GL_MODULATE_SUBTRACT_ATIX 0x8746
|
#define GL_MODULATE_SUBTRACT_ATIX 0x8746
|
||||||
|
|
||||||
#endif // GL_ATIX_texture_env_combine3
|
#endif // GL_ATIX_texture_env_combine3
|
||||||
|
|
||||||
|
|
||||||
// GL_ATIX_texture_env_route (R100)
|
// GL_ATIX_texture_env_route (R100)
|
||||||
#ifndef GL_ATIX_texture_env_route
|
#ifndef GL_ATIX_texture_env_route
|
||||||
#define GL_ATIX_texture_env_route 1
|
#define GL_ATIX_texture_env_route 1
|
||||||
|
|
||||||
#define GL_SECONDARY_COLOR_ATIX 0x8747
|
#define GL_SECONDARY_COLOR_ATIX 0x8747
|
||||||
#define GL_TEXTURE_OUTPUT_RGB_ATIX 0x8748
|
#define GL_TEXTURE_OUTPUT_RGB_ATIX 0x8748
|
||||||
#define GL_TEXTURE_OUTPUT_ALPHA_ATIX 0x8749
|
#define GL_TEXTURE_OUTPUT_ALPHA_ATIX 0x8749
|
||||||
|
|
||||||
#endif // GL_ATIX_texture_env_route
|
#endif // GL_ATIX_texture_env_route
|
||||||
|
|
||||||
|
|
||||||
// GL_ATIX_vertex_shader_output_point_size (Rage 128 (sw), R100 (sw) & Chaplin)
|
// GL_ATIX_vertex_shader_output_point_size (Rage 128 (sw), R100 (sw) & Chaplin)
|
||||||
#ifndef GL_ATIX_vertex_shader_output_point_size
|
#ifndef GL_ATIX_vertex_shader_output_point_size
|
||||||
#define GL_ATIX_vertex_shader_output_point_size 1
|
#define GL_ATIX_vertex_shader_output_point_size 1
|
||||||
|
|
||||||
#define GL_OUTPUT_POINT_SIZE_ATIX 0x610E
|
#define GL_OUTPUT_POINT_SIZE_ATIX 0x610E
|
||||||
|
|
||||||
#endif // GL_ATIX_vertex_shader_output_point_size
|
#endif // GL_ATIX_vertex_shader_output_point_size
|
||||||
|
|
|
@ -741,7 +741,7 @@
|
||||||
#define GL_FUNC_REVERSE_SUBTRACT 0x800B
|
#define GL_FUNC_REVERSE_SUBTRACT 0x800B
|
||||||
#define GL_BLEND_COLOR 0x8005
|
#define GL_BLEND_COLOR 0x8005
|
||||||
|
|
||||||
/* glPush/PopAttrib bits */
|
/* glPush/PopAttrib bits */
|
||||||
#define GL_CURRENT_BIT 0x00000001
|
#define GL_CURRENT_BIT 0x00000001
|
||||||
#define GL_POINT_BIT 0x00000002
|
#define GL_POINT_BIT 0x00000002
|
||||||
#define GL_LINE_BIT 0x00000004
|
#define GL_LINE_BIT 0x00000004
|
||||||
|
|
|
@ -51,10 +51,10 @@ typedef struct cbuf_args_s {
|
||||||
|
|
||||||
typedef struct cbuf_s {
|
typedef struct cbuf_s {
|
||||||
cbuf_args_t *args;
|
cbuf_args_t *args;
|
||||||
struct cbuf_interpreter_s *interpreter;
|
struct cbuf_interpreter_s *interpreter;
|
||||||
|
|
||||||
struct cbuf_s *up, *down; // The stack
|
struct cbuf_s *up, *down; // The stack
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
CBUF_STATE_NORMAL = 0, // Normal condition
|
CBUF_STATE_NORMAL = 0, // Normal condition
|
||||||
CBUF_STATE_WAIT, // Buffer is stalled until next frame
|
CBUF_STATE_WAIT, // Buffer is stalled until next frame
|
||||||
|
@ -63,11 +63,11 @@ typedef struct cbuf_s {
|
||||||
CBUF_STATE_STACK, // A buffer has been added to the stack
|
CBUF_STATE_STACK, // A buffer has been added to the stack
|
||||||
CBUF_STATE_JUNK // Buffer can be freed or reused
|
CBUF_STATE_JUNK // Buffer can be freed or reused
|
||||||
} state;
|
} state;
|
||||||
|
|
||||||
int (*unknown_command)(void); // handle unkown commands. !0 = handled
|
int (*unknown_command)(void); // handle unkown commands. !0 = handled
|
||||||
qboolean strict; // Should we tolerate unknown commands?
|
qboolean strict; // Should we tolerate unknown commands?
|
||||||
double resumetime; // Time when stack can be executed again
|
double resumetime; // Time when stack can be executed again
|
||||||
|
|
||||||
void *data; // Pointer to interpreter data
|
void *data; // Pointer to interpreter data
|
||||||
} cbuf_t;
|
} cbuf_t;
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ classDecl (List, Collection,
|
||||||
qboolean methodDecl (List, set, unsigned int index, Object *o);
|
qboolean methodDecl (List, set, unsigned int index, Object *o);
|
||||||
Object * methodDecl (List, get, unsigned int index);
|
Object * methodDecl (List, get, unsigned int index);
|
||||||
qboolean methodDecl (List, insertAt, unsigned int index, Object *o);
|
qboolean methodDecl (List, insertAt, unsigned int index, Object *o);
|
||||||
Object * methodDecl (List, removeAt, unsigned int index);
|
Object * methodDecl (List, removeAt, unsigned int index);
|
||||||
);
|
);
|
||||||
#define LIST(o) ((List *)(o))
|
#define LIST(o) ((List *)(o))
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
|
|
||||||
#include "QF/object.h"
|
#include "QF/object.h"
|
||||||
|
|
||||||
classDecl (String, Object,
|
classDecl (String, Object,
|
||||||
const char *str;
|
const char *str;
|
||||||
);
|
);
|
||||||
#define STRING(o) ((String *)(o))
|
#define STRING(o) ((String *)(o))
|
||||||
|
|
|
@ -42,7 +42,7 @@ typedef struct cvar_s {
|
||||||
const char *default_string; ///< The default value of the cvar.
|
const char *default_string; ///< The default value of the cvar.
|
||||||
int flags; ///< Cvar flags
|
int flags; ///< Cvar flags
|
||||||
/** Callback for when the cvar value changes.
|
/** Callback for when the cvar value changes.
|
||||||
|
|
||||||
This allows for more flexibility in what happens when a cvar is
|
This allows for more flexibility in what happens when a cvar is
|
||||||
nodifed than can be achieved with flags alone. While a similar could
|
nodifed than can be achieved with flags alone. While a similar could
|
||||||
be done using commands, a cvar with a callback and CVAR_ARCHIVE set
|
be done using commands, a cvar with a callback and CVAR_ARCHIVE set
|
||||||
|
|
|
@ -101,7 +101,7 @@ void dstring_replace (dstring_t *dstr, unsigned int pos, unsigned int rlen,
|
||||||
null terminated.
|
null terminated.
|
||||||
*/
|
*/
|
||||||
char *dstring_freeze (dstring_t *dstr);
|
char *dstring_freeze (dstring_t *dstr);
|
||||||
|
|
||||||
// String-specific functions
|
// String-specific functions
|
||||||
//@{
|
//@{
|
||||||
/** Allocate a new dstring pre-initialized as a null terminated string. size
|
/** Allocate a new dstring pre-initialized as a null terminated string. size
|
||||||
|
|
|
@ -174,7 +174,7 @@ void Hash_Free (hashtab_t *tab, void *ele);
|
||||||
/** hash a string.
|
/** hash a string.
|
||||||
\param str the string to hash
|
\param str the string to hash
|
||||||
\return the hash value of the string.
|
\return the hash value of the string.
|
||||||
|
|
||||||
this is the same function as used internally.
|
this is the same function as used internally.
|
||||||
*/
|
*/
|
||||||
unsigned long Hash_String (const char *str);
|
unsigned long Hash_String (const char *str);
|
||||||
|
|
|
@ -79,7 +79,7 @@ typedef enum {
|
||||||
QFK_GREATER = 62,
|
QFK_GREATER = 62,
|
||||||
QFK_QUESTION = 63,
|
QFK_QUESTION = 63,
|
||||||
QFK_AT = 64,
|
QFK_AT = 64,
|
||||||
/*
|
/*
|
||||||
Skip uppercase letters
|
Skip uppercase letters
|
||||||
*/
|
*/
|
||||||
QFK_LEFTBRACKET = 91,
|
QFK_LEFTBRACKET = 91,
|
||||||
|
|
|
@ -73,7 +73,7 @@ typedef struct {
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
float st[2];
|
float st[2];
|
||||||
} tex_coord_t;
|
} tex_coord_t;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int onseam;
|
int onseam;
|
||||||
|
@ -135,7 +135,7 @@ typedef struct {
|
||||||
|
|
||||||
// little-endian "IDPO"
|
// little-endian "IDPO"
|
||||||
#define IDHEADER_MDL (('O'<<24)+('P'<<16)+('D'<<8)+'I')
|
#define IDHEADER_MDL (('O'<<24)+('P'<<16)+('D'<<8)+'I')
|
||||||
|
|
||||||
// little-endian "MD16" -- 16 bit vertices
|
// little-endian "MD16" -- 16 bit vertices
|
||||||
#define HEADER_MDL16 (('6'<<24)+('1'<<16)+('D'<<8)+'M')
|
#define HEADER_MDL16 (('6'<<24)+('1'<<16)+('D'<<8)+'M')
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@ typedef struct
|
||||||
\param data A pointer to the buffer containing the source image
|
\param data A pointer to the buffer containing the source image
|
||||||
\param width The width, in pixels, of the source image
|
\param width The width, in pixels, of the source image
|
||||||
\param height The height, in pixels, of the source image
|
\param height The height, in pixels, of the source image
|
||||||
\param rowbytes The number of bytes in a row of an image (usually the same
|
\param rowbytes The number of bytes in a row of an image (usually the same
|
||||||
as the width)
|
as the width)
|
||||||
\param palette The palette in use for the texture.
|
\param palette The palette in use for the texture.
|
||||||
\param flip If true, flip the order of lines output.
|
\param flip If true, flip the order of lines output.
|
||||||
|
|
|
@ -67,7 +67,7 @@ typedef struct snd_render_funcs_s {
|
||||||
P_S_LocalSound pS_LocalSound;
|
P_S_LocalSound pS_LocalSound;
|
||||||
P_S_BlockSound pS_BlockSound;
|
P_S_BlockSound pS_BlockSound;
|
||||||
P_S_UnblockSound pS_UnblockSound;
|
P_S_UnblockSound pS_UnblockSound;
|
||||||
P_S_LoadSound pS_LoadSound;
|
P_S_LoadSound pS_LoadSound;
|
||||||
P_S_AllocChannel pS_AllocChannel;
|
P_S_AllocChannel pS_AllocChannel;
|
||||||
P_S_ChannelStop pS_ChannelStop;
|
P_S_ChannelStop pS_ChannelStop;
|
||||||
} snd_render_funcs_t;
|
} snd_render_funcs_t;
|
||||||
|
|
|
@ -76,19 +76,19 @@ typedef enum {
|
||||||
OP_ADD_V,
|
OP_ADD_V,
|
||||||
OP_SUB_F,
|
OP_SUB_F,
|
||||||
OP_SUB_V,
|
OP_SUB_V,
|
||||||
|
|
||||||
OP_EQ_F,
|
OP_EQ_F,
|
||||||
OP_EQ_V,
|
OP_EQ_V,
|
||||||
OP_EQ_S,
|
OP_EQ_S,
|
||||||
OP_EQ_E,
|
OP_EQ_E,
|
||||||
OP_EQ_FN,
|
OP_EQ_FN,
|
||||||
|
|
||||||
OP_NE_F,
|
OP_NE_F,
|
||||||
OP_NE_V,
|
OP_NE_V,
|
||||||
OP_NE_S,
|
OP_NE_S,
|
||||||
OP_NE_E,
|
OP_NE_E,
|
||||||
OP_NE_FN,
|
OP_NE_FN,
|
||||||
|
|
||||||
OP_LE_F,
|
OP_LE_F,
|
||||||
OP_GE_F,
|
OP_GE_F,
|
||||||
OP_LT_F,
|
OP_LT_F,
|
||||||
|
@ -138,7 +138,7 @@ typedef enum {
|
||||||
OP_GOTO,
|
OP_GOTO,
|
||||||
OP_AND,
|
OP_AND,
|
||||||
OP_OR,
|
OP_OR,
|
||||||
|
|
||||||
OP_BITAND,
|
OP_BITAND,
|
||||||
OP_BITOR,
|
OP_BITOR,
|
||||||
|
|
||||||
|
@ -331,12 +331,12 @@ typedef struct dfunction_s {
|
||||||
pr_int_t first_statement; // negative numbers are builtins
|
pr_int_t first_statement; // negative numbers are builtins
|
||||||
pr_int_t parm_start;
|
pr_int_t parm_start;
|
||||||
pr_int_t locals; // total ints of parms + locals
|
pr_int_t locals; // total ints of parms + locals
|
||||||
|
|
||||||
pr_int_t profile; // runtime
|
pr_int_t profile; // runtime
|
||||||
|
|
||||||
pr_int_t s_name;
|
pr_int_t s_name;
|
||||||
pr_int_t s_file; // source file defined in
|
pr_int_t s_file; // source file defined in
|
||||||
|
|
||||||
pr_int_t numparms;
|
pr_int_t numparms;
|
||||||
uint8_t parm_size[MAX_PARMS];
|
uint8_t parm_size[MAX_PARMS];
|
||||||
} dfunction_t;
|
} dfunction_t;
|
||||||
|
@ -368,25 +368,25 @@ typedef struct pr_va_list_s {
|
||||||
typedef struct dprograms_s {
|
typedef struct dprograms_s {
|
||||||
pr_uint_t version;
|
pr_uint_t version;
|
||||||
pr_uint_t crc; // check of header file
|
pr_uint_t crc; // check of header file
|
||||||
|
|
||||||
pr_uint_t ofs_statements;
|
pr_uint_t ofs_statements;
|
||||||
pr_uint_t numstatements; // statement 0 is an error
|
pr_uint_t numstatements; // statement 0 is an error
|
||||||
|
|
||||||
pr_uint_t ofs_globaldefs;
|
pr_uint_t ofs_globaldefs;
|
||||||
pr_uint_t numglobaldefs;
|
pr_uint_t numglobaldefs;
|
||||||
|
|
||||||
pr_uint_t ofs_fielddefs;
|
pr_uint_t ofs_fielddefs;
|
||||||
pr_uint_t numfielddefs;
|
pr_uint_t numfielddefs;
|
||||||
|
|
||||||
pr_uint_t ofs_functions;
|
pr_uint_t ofs_functions;
|
||||||
pr_int_t numfunctions; // function 0 is an empty
|
pr_int_t numfunctions; // function 0 is an empty
|
||||||
|
|
||||||
pr_uint_t ofs_strings;
|
pr_uint_t ofs_strings;
|
||||||
pr_int_t numstrings; // first string is a null string
|
pr_int_t numstrings; // first string is a null string
|
||||||
|
|
||||||
pr_uint_t ofs_globals;
|
pr_uint_t ofs_globals;
|
||||||
pr_uint_t numglobals;
|
pr_uint_t numglobals;
|
||||||
|
|
||||||
pr_uint_t entityfields;
|
pr_uint_t entityfields;
|
||||||
} dprograms_t;
|
} dprograms_t;
|
||||||
|
|
||||||
|
|
|
@ -175,7 +175,7 @@ void PR_AddLoadFunc (progs_t *pr, pr_load_func_t *func);
|
||||||
|
|
||||||
/** Register a secondary function to be called after the progs code has been
|
/** Register a secondary function to be called after the progs code has been
|
||||||
loaded. These functions will be forgotten after each load. They will be
|
loaded. These functions will be forgotten after each load. They will be
|
||||||
called in \e reverse order of being registered.
|
called in \e reverse order of being registered.
|
||||||
\param pr pointer to ::progs_t VM struct
|
\param pr pointer to ::progs_t VM struct
|
||||||
\param func function to call
|
\param func function to call
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -54,7 +54,7 @@ typedef enum {
|
||||||
typedef struct plitem_s plitem_t;
|
typedef struct plitem_s plitem_t;
|
||||||
|
|
||||||
/** Create an in-memory representation of the contents of a property list.
|
/** Create an in-memory representation of the contents of a property list.
|
||||||
|
|
||||||
\param string the saved plist, as read from a file.
|
\param string the saved plist, as read from a file.
|
||||||
|
|
||||||
\return Returns an object equivalent to the passed-in string.
|
\return Returns an object equivalent to the passed-in string.
|
||||||
|
|
|
@ -152,7 +152,7 @@ QFile *QFS_WOpen (const char *path, int zip);
|
||||||
|
|
||||||
/** Write a block of data to a file.
|
/** Write a block of data to a file.
|
||||||
|
|
||||||
This is a convenience wrapper for QFS_Open().
|
This is a convenience wrapper for QFS_Open().
|
||||||
|
|
||||||
\param filename Path name of file to open, relative to ::qfs_userpath.
|
\param filename Path name of file to open, relative to ::qfs_userpath.
|
||||||
\param data Pointer to the block of data to be written.
|
\param data Pointer to the block of data to be written.
|
||||||
|
|
|
@ -103,7 +103,7 @@ typedef struct entity_s {
|
||||||
|
|
||||||
int fullbright;
|
int fullbright;
|
||||||
float min_light;
|
float min_light;
|
||||||
|
|
||||||
// FIXME: could turn these into a union
|
// FIXME: could turn these into a union
|
||||||
int trivial_accept;
|
int trivial_accept;
|
||||||
struct mnode_s *topnode; // for bmodels, first world node that
|
struct mnode_s *topnode; // for bmodels, first world node that
|
||||||
|
@ -135,7 +135,7 @@ typedef struct
|
||||||
// right and bottom edges, for clamping
|
// right and bottom edges, for clamping
|
||||||
float fvrectright; // rightmost edge, for Alias clamping
|
float fvrectright; // rightmost edge, for Alias clamping
|
||||||
float fvrectbottom; // bottommost edge, for Alias clamping
|
float fvrectbottom; // bottommost edge, for Alias clamping
|
||||||
float horizontalFieldOfView; // at Z = 1.0, this many X is visible
|
float horizontalFieldOfView; // at Z = 1.0, this many X is visible
|
||||||
// 2.0 = 90 degrees
|
// 2.0 = 90 degrees
|
||||||
float xOrigin; // should probably always be 0.5
|
float xOrigin; // should probably always be 0.5
|
||||||
float yOrigin; // between be around 0.3 to 0.5
|
float yOrigin; // between be around 0.3 to 0.5
|
||||||
|
|
|
@ -60,7 +60,7 @@ extern qboolean hudswap;
|
||||||
extern struct cvar_s *scr_fov;
|
extern struct cvar_s *scr_fov;
|
||||||
extern struct cvar_s *scr_viewsize;
|
extern struct cvar_s *scr_viewsize;
|
||||||
|
|
||||||
// only the refresh window will be updated unless these variables are flagged
|
// only the refresh window will be updated unless these variables are flagged
|
||||||
|
|
||||||
extern struct qpic_s *scr_ram;
|
extern struct qpic_s *scr_ram;
|
||||||
extern struct qpic_s *scr_net;
|
extern struct qpic_s *scr_net;
|
||||||
|
|
|
@ -48,7 +48,7 @@ typedef struct {
|
||||||
unsigned int *colormap32; // 256 * VID_GRADES size
|
unsigned int *colormap32; // 256 * VID_GRADES size
|
||||||
int fullbright; // index of first fullbright color
|
int fullbright; // index of first fullbright color
|
||||||
unsigned int rowbytes; // may be > width if displayed in a window
|
unsigned int rowbytes; // may be > width if displayed in a window
|
||||||
unsigned int width;
|
unsigned int width;
|
||||||
unsigned int height;
|
unsigned int height;
|
||||||
float aspect; // width / height -- < 1 is taller than wide
|
float aspect; // width / height -- < 1 is taller than wide
|
||||||
int numpages;
|
int numpages;
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
/** Control the positioning of a view within its parent. The directions are
|
/** Control the positioning of a view within its parent. The directions are
|
||||||
the standard compass rose (north, east, south, west in clockwise order)
|
the standard compass rose (north, east, south, west in clockwise order)
|
||||||
with north at the top.
|
with north at the top.
|
||||||
|
|
||||||
The origin of the view is taken to be the point corresponding point on the
|
The origin of the view is taken to be the point corresponding point on the
|
||||||
edge of the view (eg, southeast is bottom right), or the view's center for
|
edge of the view (eg, southeast is bottom right), or the view's center for
|
||||||
center gravity. When the relative coordinates of the view are (0,0), the
|
center gravity. When the relative coordinates of the view are (0,0), the
|
||||||
|
|
|
@ -157,7 +157,7 @@
|
||||||
1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00,
|
1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00,
|
||||||
1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00,
|
1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00,
|
||||||
1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00,
|
1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00,
|
||||||
1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00,
|
1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00,
|
||||||
1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00
|
1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
324
include/anorms.h
324
include/anorms.h
|
@ -27,165 +27,165 @@
|
||||||
#if defined(_WIN32) && !defined(__GNUC__)
|
#if defined(_WIN32) && !defined(__GNUC__)
|
||||||
# pragma warning(disable:4305)
|
# pragma warning(disable:4305)
|
||||||
#endif
|
#endif
|
||||||
{-0.525731, 0.000000, 0.850651},
|
{-0.525731, 0.000000, 0.850651},
|
||||||
{-0.442863, 0.238856, 0.864188},
|
{-0.442863, 0.238856, 0.864188},
|
||||||
{-0.295242, 0.000000, 0.955423},
|
{-0.295242, 0.000000, 0.955423},
|
||||||
{-0.309017, 0.500000, 0.809017},
|
{-0.309017, 0.500000, 0.809017},
|
||||||
{-0.162460, 0.262866, 0.951056},
|
{-0.162460, 0.262866, 0.951056},
|
||||||
{0.000000, 0.000000, 1.000000},
|
{0.000000, 0.000000, 1.000000},
|
||||||
{0.000000, 0.850651, 0.525731},
|
{0.000000, 0.850651, 0.525731},
|
||||||
{-0.147621, 0.716567, 0.681718},
|
{-0.147621, 0.716567, 0.681718},
|
||||||
{0.147621, 0.716567, 0.681718},
|
{0.147621, 0.716567, 0.681718},
|
||||||
{0.000000, 0.525731, 0.850651},
|
{0.000000, 0.525731, 0.850651},
|
||||||
{0.309017, 0.500000, 0.809017},
|
{0.309017, 0.500000, 0.809017},
|
||||||
{0.525731, 0.000000, 0.850651},
|
{0.525731, 0.000000, 0.850651},
|
||||||
{0.295242, 0.000000, 0.955423},
|
{0.295242, 0.000000, 0.955423},
|
||||||
{0.442863, 0.238856, 0.864188},
|
{0.442863, 0.238856, 0.864188},
|
||||||
{0.162460, 0.262866, 0.951056},
|
{0.162460, 0.262866, 0.951056},
|
||||||
{-0.681718, 0.147621, 0.716567},
|
{-0.681718, 0.147621, 0.716567},
|
||||||
{-0.809017, 0.309017, 0.500000},
|
{-0.809017, 0.309017, 0.500000},
|
||||||
{-0.587785, 0.425325, 0.688191},
|
{-0.587785, 0.425325, 0.688191},
|
||||||
{-0.850651, 0.525731, 0.000000},
|
{-0.850651, 0.525731, 0.000000},
|
||||||
{-0.864188, 0.442863, 0.238856},
|
{-0.864188, 0.442863, 0.238856},
|
||||||
{-0.716567, 0.681718, 0.147621},
|
{-0.716567, 0.681718, 0.147621},
|
||||||
{-0.688191, 0.587785, 0.425325},
|
{-0.688191, 0.587785, 0.425325},
|
||||||
{-0.500000, 0.809017, 0.309017},
|
{-0.500000, 0.809017, 0.309017},
|
||||||
{-0.238856, 0.864188, 0.442863},
|
{-0.238856, 0.864188, 0.442863},
|
||||||
{-0.425325, 0.688191, 0.587785},
|
{-0.425325, 0.688191, 0.587785},
|
||||||
{-0.716567, 0.681718, -0.147621},
|
{-0.716567, 0.681718, -0.147621},
|
||||||
{-0.500000, 0.809017, -0.309017},
|
{-0.500000, 0.809017, -0.309017},
|
||||||
{-0.525731, 0.850651, 0.000000},
|
{-0.525731, 0.850651, 0.000000},
|
||||||
{0.000000, 0.850651, -0.525731},
|
{0.000000, 0.850651, -0.525731},
|
||||||
{-0.238856, 0.864188, -0.442863},
|
{-0.238856, 0.864188, -0.442863},
|
||||||
{0.000000, 0.955423, -0.295242},
|
{0.000000, 0.955423, -0.295242},
|
||||||
{-0.262866, 0.951056, -0.162460},
|
{-0.262866, 0.951056, -0.162460},
|
||||||
{0.000000, 1.000000, 0.000000},
|
{0.000000, 1.000000, 0.000000},
|
||||||
{0.000000, 0.955423, 0.295242},
|
{0.000000, 0.955423, 0.295242},
|
||||||
{-0.262866, 0.951056, 0.162460},
|
{-0.262866, 0.951056, 0.162460},
|
||||||
{0.238856, 0.864188, 0.442863},
|
{0.238856, 0.864188, 0.442863},
|
||||||
{0.262866, 0.951056, 0.162460},
|
{0.262866, 0.951056, 0.162460},
|
||||||
{0.500000, 0.809017, 0.309017},
|
{0.500000, 0.809017, 0.309017},
|
||||||
{0.238856, 0.864188, -0.442863},
|
{0.238856, 0.864188, -0.442863},
|
||||||
{0.262866, 0.951056, -0.162460},
|
{0.262866, 0.951056, -0.162460},
|
||||||
{0.500000, 0.809017, -0.309017},
|
{0.500000, 0.809017, -0.309017},
|
||||||
{0.850651, 0.525731, 0.000000},
|
{0.850651, 0.525731, 0.000000},
|
||||||
{0.716567, 0.681718, 0.147621},
|
{0.716567, 0.681718, 0.147621},
|
||||||
{0.716567, 0.681718, -0.147621},
|
{0.716567, 0.681718, -0.147621},
|
||||||
{0.525731, 0.850651, 0.000000},
|
{0.525731, 0.850651, 0.000000},
|
||||||
{0.425325, 0.688191, 0.587785},
|
{0.425325, 0.688191, 0.587785},
|
||||||
{0.864188, 0.442863, 0.238856},
|
{0.864188, 0.442863, 0.238856},
|
||||||
{0.688191, 0.587785, 0.425325},
|
{0.688191, 0.587785, 0.425325},
|
||||||
{0.809017, 0.309017, 0.500000},
|
{0.809017, 0.309017, 0.500000},
|
||||||
{0.681718, 0.147621, 0.716567},
|
{0.681718, 0.147621, 0.716567},
|
||||||
{0.587785, 0.425325, 0.688191},
|
{0.587785, 0.425325, 0.688191},
|
||||||
{0.955423, 0.295242, 0.000000},
|
{0.955423, 0.295242, 0.000000},
|
||||||
{1.000000, 0.000000, 0.000000},
|
{1.000000, 0.000000, 0.000000},
|
||||||
{0.951056, 0.162460, 0.262866},
|
{0.951056, 0.162460, 0.262866},
|
||||||
{0.850651, -0.525731, 0.000000},
|
{0.850651, -0.525731, 0.000000},
|
||||||
{0.955423, -0.295242, 0.000000},
|
{0.955423, -0.295242, 0.000000},
|
||||||
{0.864188, -0.442863, 0.238856},
|
{0.864188, -0.442863, 0.238856},
|
||||||
{0.951056, -0.162460, 0.262866},
|
{0.951056, -0.162460, 0.262866},
|
||||||
{0.809017, -0.309017, 0.500000},
|
{0.809017, -0.309017, 0.500000},
|
||||||
{0.681718, -0.147621, 0.716567},
|
{0.681718, -0.147621, 0.716567},
|
||||||
{0.850651, 0.000000, 0.525731},
|
{0.850651, 0.000000, 0.525731},
|
||||||
{0.864188, 0.442863, -0.238856},
|
{0.864188, 0.442863, -0.238856},
|
||||||
{0.809017, 0.309017, -0.500000},
|
{0.809017, 0.309017, -0.500000},
|
||||||
{0.951056, 0.162460, -0.262866},
|
{0.951056, 0.162460, -0.262866},
|
||||||
{0.525731, 0.000000, -0.850651},
|
{0.525731, 0.000000, -0.850651},
|
||||||
{0.681718, 0.147621, -0.716567},
|
{0.681718, 0.147621, -0.716567},
|
||||||
{0.681718, -0.147621, -0.716567},
|
{0.681718, -0.147621, -0.716567},
|
||||||
{0.850651, 0.000000, -0.525731},
|
{0.850651, 0.000000, -0.525731},
|
||||||
{0.809017, -0.309017, -0.500000},
|
{0.809017, -0.309017, -0.500000},
|
||||||
{0.864188, -0.442863, -0.238856},
|
{0.864188, -0.442863, -0.238856},
|
||||||
{0.951056, -0.162460, -0.262866},
|
{0.951056, -0.162460, -0.262866},
|
||||||
{0.147621, 0.716567, -0.681718},
|
{0.147621, 0.716567, -0.681718},
|
||||||
{0.309017, 0.500000, -0.809017},
|
{0.309017, 0.500000, -0.809017},
|
||||||
{0.425325, 0.688191, -0.587785},
|
{0.425325, 0.688191, -0.587785},
|
||||||
{0.442863, 0.238856, -0.864188},
|
{0.442863, 0.238856, -0.864188},
|
||||||
{0.587785, 0.425325, -0.688191},
|
{0.587785, 0.425325, -0.688191},
|
||||||
{0.688191, 0.587785, -0.425325},
|
{0.688191, 0.587785, -0.425325},
|
||||||
{-0.147621, 0.716567, -0.681718},
|
{-0.147621, 0.716567, -0.681718},
|
||||||
{-0.309017, 0.500000, -0.809017},
|
{-0.309017, 0.500000, -0.809017},
|
||||||
{0.000000, 0.525731, -0.850651},
|
{0.000000, 0.525731, -0.850651},
|
||||||
{-0.525731, 0.000000, -0.850651},
|
{-0.525731, 0.000000, -0.850651},
|
||||||
{-0.442863, 0.238856, -0.864188},
|
{-0.442863, 0.238856, -0.864188},
|
||||||
{-0.295242, 0.000000, -0.955423},
|
{-0.295242, 0.000000, -0.955423},
|
||||||
{-0.162460, 0.262866, -0.951056},
|
{-0.162460, 0.262866, -0.951056},
|
||||||
{0.000000, 0.000000, -1.000000},
|
{0.000000, 0.000000, -1.000000},
|
||||||
{0.295242, 0.000000, -0.955423},
|
{0.295242, 0.000000, -0.955423},
|
||||||
{0.162460, 0.262866, -0.951056},
|
{0.162460, 0.262866, -0.951056},
|
||||||
{-0.442863, -0.238856, -0.864188},
|
{-0.442863, -0.238856, -0.864188},
|
||||||
{-0.309017, -0.500000, -0.809017},
|
{-0.309017, -0.500000, -0.809017},
|
||||||
{-0.162460, -0.262866, -0.951056},
|
{-0.162460, -0.262866, -0.951056},
|
||||||
{0.000000, -0.850651, -0.525731},
|
{0.000000, -0.850651, -0.525731},
|
||||||
{-0.147621, -0.716567, -0.681718},
|
{-0.147621, -0.716567, -0.681718},
|
||||||
{0.147621, -0.716567, -0.681718},
|
{0.147621, -0.716567, -0.681718},
|
||||||
{0.000000, -0.525731, -0.850651},
|
{0.000000, -0.525731, -0.850651},
|
||||||
{0.309017, -0.500000, -0.809017},
|
{0.309017, -0.500000, -0.809017},
|
||||||
{0.442863, -0.238856, -0.864188},
|
{0.442863, -0.238856, -0.864188},
|
||||||
{0.162460, -0.262866, -0.951056},
|
{0.162460, -0.262866, -0.951056},
|
||||||
{0.238856, -0.864188, -0.442863},
|
{0.238856, -0.864188, -0.442863},
|
||||||
{0.500000, -0.809017, -0.309017},
|
{0.500000, -0.809017, -0.309017},
|
||||||
{0.425325, -0.688191, -0.587785},
|
{0.425325, -0.688191, -0.587785},
|
||||||
{0.716567, -0.681718, -0.147621},
|
{0.716567, -0.681718, -0.147621},
|
||||||
{0.688191, -0.587785, -0.425325},
|
{0.688191, -0.587785, -0.425325},
|
||||||
{0.587785, -0.425325, -0.688191},
|
{0.587785, -0.425325, -0.688191},
|
||||||
{0.000000, -0.955423, -0.295242},
|
{0.000000, -0.955423, -0.295242},
|
||||||
{0.000000, -1.000000, 0.000000},
|
{0.000000, -1.000000, 0.000000},
|
||||||
{0.262866, -0.951056, -0.162460},
|
{0.262866, -0.951056, -0.162460},
|
||||||
{0.000000, -0.850651, 0.525731},
|
{0.000000, -0.850651, 0.525731},
|
||||||
{0.000000, -0.955423, 0.295242},
|
{0.000000, -0.955423, 0.295242},
|
||||||
{0.238856, -0.864188, 0.442863},
|
{0.238856, -0.864188, 0.442863},
|
||||||
{0.262866, -0.951056, 0.162460},
|
{0.262866, -0.951056, 0.162460},
|
||||||
{0.500000, -0.809017, 0.309017},
|
{0.500000, -0.809017, 0.309017},
|
||||||
{0.716567, -0.681718, 0.147621},
|
{0.716567, -0.681718, 0.147621},
|
||||||
{0.525731, -0.850651, 0.000000},
|
{0.525731, -0.850651, 0.000000},
|
||||||
{-0.238856, -0.864188, -0.442863},
|
{-0.238856, -0.864188, -0.442863},
|
||||||
{-0.500000, -0.809017, -0.309017},
|
{-0.500000, -0.809017, -0.309017},
|
||||||
{-0.262866, -0.951056, -0.162460},
|
{-0.262866, -0.951056, -0.162460},
|
||||||
{-0.850651, -0.525731, 0.000000},
|
{-0.850651, -0.525731, 0.000000},
|
||||||
{-0.716567, -0.681718, -0.147621},
|
{-0.716567, -0.681718, -0.147621},
|
||||||
{-0.716567, -0.681718, 0.147621},
|
{-0.716567, -0.681718, 0.147621},
|
||||||
{-0.525731, -0.850651, 0.000000},
|
{-0.525731, -0.850651, 0.000000},
|
||||||
{-0.500000, -0.809017, 0.309017},
|
{-0.500000, -0.809017, 0.309017},
|
||||||
{-0.238856, -0.864188, 0.442863},
|
{-0.238856, -0.864188, 0.442863},
|
||||||
{-0.262866, -0.951056, 0.162460},
|
{-0.262866, -0.951056, 0.162460},
|
||||||
{-0.864188, -0.442863, 0.238856},
|
{-0.864188, -0.442863, 0.238856},
|
||||||
{-0.809017, -0.309017, 0.500000},
|
{-0.809017, -0.309017, 0.500000},
|
||||||
{-0.688191, -0.587785, 0.425325},
|
{-0.688191, -0.587785, 0.425325},
|
||||||
{-0.681718, -0.147621, 0.716567},
|
{-0.681718, -0.147621, 0.716567},
|
||||||
{-0.442863, -0.238856, 0.864188},
|
{-0.442863, -0.238856, 0.864188},
|
||||||
{-0.587785, -0.425325, 0.688191},
|
{-0.587785, -0.425325, 0.688191},
|
||||||
{-0.309017, -0.500000, 0.809017},
|
{-0.309017, -0.500000, 0.809017},
|
||||||
{-0.147621, -0.716567, 0.681718},
|
{-0.147621, -0.716567, 0.681718},
|
||||||
{-0.425325, -0.688191, 0.587785},
|
{-0.425325, -0.688191, 0.587785},
|
||||||
{-0.162460, -0.262866, 0.951056},
|
{-0.162460, -0.262866, 0.951056},
|
||||||
{0.442863, -0.238856, 0.864188},
|
{0.442863, -0.238856, 0.864188},
|
||||||
{0.162460, -0.262866, 0.951056},
|
{0.162460, -0.262866, 0.951056},
|
||||||
{0.309017, -0.500000, 0.809017},
|
{0.309017, -0.500000, 0.809017},
|
||||||
{0.147621, -0.716567, 0.681718},
|
{0.147621, -0.716567, 0.681718},
|
||||||
{0.000000, -0.525731, 0.850651},
|
{0.000000, -0.525731, 0.850651},
|
||||||
{0.425325, -0.688191, 0.587785},
|
{0.425325, -0.688191, 0.587785},
|
||||||
{0.587785, -0.425325, 0.688191},
|
{0.587785, -0.425325, 0.688191},
|
||||||
{0.688191, -0.587785, 0.425325},
|
{0.688191, -0.587785, 0.425325},
|
||||||
{-0.955423, 0.295242, 0.000000},
|
{-0.955423, 0.295242, 0.000000},
|
||||||
{-0.951056, 0.162460, 0.262866},
|
{-0.951056, 0.162460, 0.262866},
|
||||||
{-1.000000, 0.000000, 0.000000},
|
{-1.000000, 0.000000, 0.000000},
|
||||||
{-0.850651, 0.000000, 0.525731},
|
{-0.850651, 0.000000, 0.525731},
|
||||||
{-0.955423, -0.295242, 0.000000},
|
{-0.955423, -0.295242, 0.000000},
|
||||||
{-0.951056, -0.162460, 0.262866},
|
{-0.951056, -0.162460, 0.262866},
|
||||||
{-0.864188, 0.442863, -0.238856},
|
{-0.864188, 0.442863, -0.238856},
|
||||||
{-0.951056, 0.162460, -0.262866},
|
{-0.951056, 0.162460, -0.262866},
|
||||||
{-0.809017, 0.309017, -0.500000},
|
{-0.809017, 0.309017, -0.500000},
|
||||||
{-0.864188, -0.442863, -0.238856},
|
{-0.864188, -0.442863, -0.238856},
|
||||||
{-0.951056, -0.162460, -0.262866},
|
{-0.951056, -0.162460, -0.262866},
|
||||||
{-0.809017, -0.309017, -0.500000},
|
{-0.809017, -0.309017, -0.500000},
|
||||||
{-0.681718, 0.147621, -0.716567},
|
{-0.681718, 0.147621, -0.716567},
|
||||||
{-0.681718, -0.147621, -0.716567},
|
{-0.681718, -0.147621, -0.716567},
|
||||||
{-0.850651, 0.000000, -0.525731},
|
{-0.850651, 0.000000, -0.525731},
|
||||||
{-0.688191, 0.587785, -0.425325},
|
{-0.688191, 0.587785, -0.425325},
|
||||||
{-0.587785, 0.425325, -0.688191},
|
{-0.587785, 0.425325, -0.688191},
|
||||||
{-0.425325, 0.688191, -0.587785},
|
{-0.425325, 0.688191, -0.587785},
|
||||||
{-0.425325, -0.688191, -0.587785},
|
{-0.425325, -0.688191, -0.587785},
|
||||||
{-0.587785, -0.425325, -0.688191},
|
{-0.587785, -0.425325, -0.688191},
|
||||||
{-0.688191, -0.587785, -0.425325},
|
{-0.688191, -0.587785, -0.425325},
|
||||||
|
|
|
@ -61,7 +61,7 @@
|
||||||
#define spanpackage_t_tfrac 20
|
#define spanpackage_t_tfrac 20
|
||||||
#define spanpackage_t_light 24
|
#define spanpackage_t_light 24
|
||||||
#define spanpackage_t_zi 28
|
#define spanpackage_t_zi 28
|
||||||
#define spanpackage_t_size 32
|
#define spanpackage_t_size 32
|
||||||
|
|
||||||
// edge_t structure
|
// edge_t structure
|
||||||
// !!! if this is changed, it must be changed in r_shared.h too !!!
|
// !!! if this is changed, it must be changed in r_shared.h too !!!
|
||||||
|
|
|
@ -126,7 +126,7 @@ typedef struct {
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
int nump;
|
int nump;
|
||||||
emitpoint_t *pverts; // there's room for an extra element at [nump],
|
emitpoint_t *pverts; // there's room for an extra element at [nump],
|
||||||
// if the driver wants to duplicate element [0] at
|
// if the driver wants to duplicate element [0] at
|
||||||
// element [nump] to avoid dealing with wrapping
|
// element [nump] to avoid dealing with wrapping
|
||||||
mspriteframe_t *pspriteframe;
|
mspriteframe_t *pspriteframe;
|
||||||
|
@ -155,7 +155,7 @@ extern qboolean r_recursiveaffinetriangles; // true if a driver wants to use
|
||||||
// recursive triangular subdivison
|
// recursive triangular subdivison
|
||||||
// and vertex drawing via
|
// and vertex drawing via
|
||||||
// D_PolysetDrawFinalVerts() past
|
// D_PolysetDrawFinalVerts() past
|
||||||
// a certain distance (normally
|
// a certain distance (normally
|
||||||
// used only by the software
|
// used only by the software
|
||||||
// driver)
|
// driver)
|
||||||
extern int r_pixbytes;
|
extern int r_pixbytes;
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
typedef enum {TOKEN_GENERIC, TOKEN_NUM, TOKEN_OP, TOKEN_FUNC, TOKEN_OPAREN, TOKEN_CPAREN, TOKEN_COMMA}
|
typedef enum {TOKEN_GENERIC, TOKEN_NUM, TOKEN_OP, TOKEN_FUNC, TOKEN_OPAREN, TOKEN_CPAREN, TOKEN_COMMA}
|
||||||
token_type;
|
token_type;
|
||||||
typedef enum {EXP_E_NORMAL = 0, EXP_E_PARSE, EXP_E_INVOP, EXP_E_PAREN,
|
typedef enum {EXP_E_NORMAL = 0, EXP_E_PARSE, EXP_E_INVOP, EXP_E_PAREN,
|
||||||
EXP_E_INVPARAM, EXP_E_SYNTAX} exp_error_t;
|
EXP_E_INVPARAM, EXP_E_SYNTAX} exp_error_t;
|
||||||
typedef double (*opfunc) (double op1, double op2);
|
typedef double (*opfunc) (double op1, double op2);
|
||||||
typedef double (*funcfunc) (double *oplist, unsigned int numops);
|
typedef double (*funcfunc) (double *oplist, unsigned int numops);
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
Free Software Foundation, Inc.
|
Free Software Foundation, Inc.
|
||||||
59 Temple Place - Suite 330
|
59 Temple Place - Suite 330
|
||||||
Boston, MA 02111-1307, USA
|
Boston, MA 02111-1307, USA
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __gib_buffer_h
|
#ifndef __gib_buffer_h
|
||||||
|
|
|
@ -54,7 +54,7 @@ void sw_Mod_SpriteLoadTexture (mspriteframe_t *pspriteframe, int framenum);
|
||||||
void Mod_LoadIQM (model_t *mod, void *buffer);
|
void Mod_LoadIQM (model_t *mod, void *buffer);
|
||||||
void Mod_FreeIQM (iqm_t *iqm);
|
void Mod_FreeIQM (iqm_t *iqm);
|
||||||
iqmblend_t *Mod_IQMBuildBlendPalette (iqm_t *iqm, int *size);
|
iqmblend_t *Mod_IQMBuildBlendPalette (iqm_t *iqm, int *size);
|
||||||
void Mod_LoadAliasModel (model_t *mod, void *buffer,
|
void Mod_LoadAliasModel (model_t *mod, void *buffer,
|
||||||
cache_allocator_t allocator);
|
cache_allocator_t allocator);
|
||||||
void Mod_LoadSpriteModel (model_t *mod, void *buffer);
|
void Mod_LoadSpriteModel (model_t *mod, void *buffer);
|
||||||
|
|
||||||
|
|
|
@ -170,7 +170,7 @@ typedef struct qsocket_s {
|
||||||
qboolean canSend; ///< Socket can send a message.
|
qboolean canSend; ///< Socket can send a message.
|
||||||
qboolean sendNext;
|
qboolean sendNext;
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
/// \name socket drivers
|
/// \name socket drivers
|
||||||
//@{
|
//@{
|
||||||
int driver; ///< Net driver used by this socket.
|
int driver; ///< Net driver used by this socket.
|
||||||
|
|
|
@ -215,7 +215,7 @@
|
||||||
.extern fp_64k
|
.extern fp_64k
|
||||||
.extern fp_1m
|
.extern fp_1m
|
||||||
.extern fp_1m_minus_1
|
.extern fp_1m_minus_1
|
||||||
.extern fp_8
|
.extern fp_8
|
||||||
.extern entryvec_table
|
.extern entryvec_table
|
||||||
.extern advancetable
|
.extern advancetable
|
||||||
.extern sstep
|
.extern sstep
|
||||||
|
|
|
@ -106,7 +106,7 @@
|
||||||
#define svc_updateuserinfo 40 // [byte] slot [long] uid [string] userinfo
|
#define svc_updateuserinfo 40 // [byte] slot [long] uid [string] userinfo
|
||||||
#define svc_download 41 // [short] size [size bytes]
|
#define svc_download 41 // [short] size [size bytes]
|
||||||
#define svc_playerinfo 42 // variable
|
#define svc_playerinfo 42 // variable
|
||||||
#define svc_nails 43 // [byte] num [48 bits] xyzpy 12 12 12 4 8
|
#define svc_nails 43 // [byte] num [48 bits] xyzpy 12 12 12 4 8
|
||||||
#define svc_chokecount 44 // [byte] packets choked
|
#define svc_chokecount 44 // [byte] packets choked
|
||||||
#define svc_modellist 45 // [strings]
|
#define svc_modellist 45 // [strings]
|
||||||
#define svc_soundlist 46 // [strings]
|
#define svc_soundlist 46 // [strings]
|
||||||
|
|
|
@ -42,7 +42,7 @@ typedef unsigned reg_syntax_t;
|
||||||
#define RE_BACKSLASH_ESCAPE_IN_LISTS (1)
|
#define RE_BACKSLASH_ESCAPE_IN_LISTS (1)
|
||||||
|
|
||||||
/* If this bit is not set, then + and ? are operators, and \+ and \? are
|
/* If this bit is not set, then + and ? are operators, and \+ and \? are
|
||||||
literals.
|
literals.
|
||||||
If set, then \+ and \? are operators and + and ? are literals. */
|
If set, then \+ and \? are operators and + and ? are literals. */
|
||||||
#define RE_BK_PLUS_QM (RE_BACKSLASH_ESCAPE_IN_LISTS << 1)
|
#define RE_BK_PLUS_QM (RE_BACKSLASH_ESCAPE_IN_LISTS << 1)
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ typedef unsigned reg_syntax_t;
|
||||||
^ is an anchor if it is at the beginning of a regular
|
^ is an anchor if it is at the beginning of a regular
|
||||||
expression or after an open-group or an alternation operator;
|
expression or after an open-group or an alternation operator;
|
||||||
$ is an anchor if it is at the end of a regular expression, or
|
$ is an anchor if it is at the end of a regular expression, or
|
||||||
before a close-group or an alternation operator.
|
before a close-group or an alternation operator.
|
||||||
|
|
||||||
This bit could be (re)combined with RE_CONTEXT_INDEP_OPS, because
|
This bit could be (re)combined with RE_CONTEXT_INDEP_OPS, because
|
||||||
POSIX draft 11.2 says that * etc. in leading positions is undefined.
|
POSIX draft 11.2 says that * etc. in leading positions is undefined.
|
||||||
|
@ -69,7 +69,7 @@ typedef unsigned reg_syntax_t;
|
||||||
/* If this bit is set, then special characters are always special
|
/* If this bit is set, then special characters are always special
|
||||||
regardless of where they are in the pattern.
|
regardless of where they are in the pattern.
|
||||||
If this bit is not set, then special characters are special only in
|
If this bit is not set, then special characters are special only in
|
||||||
some contexts; otherwise they are ordinary. Specifically,
|
some contexts; otherwise they are ordinary. Specifically,
|
||||||
* + ? and intervals are only special when not after the beginning,
|
* + ? and intervals are only special when not after the beginning,
|
||||||
open-group, or alternation operator. */
|
open-group, or alternation operator. */
|
||||||
#define RE_CONTEXT_INDEP_OPS (RE_CONTEXT_INDEP_ANCHORS << 1)
|
#define RE_CONTEXT_INDEP_OPS (RE_CONTEXT_INDEP_ANCHORS << 1)
|
||||||
|
@ -91,7 +91,7 @@ typedef unsigned reg_syntax_t;
|
||||||
#define RE_HAT_LISTS_NOT_NEWLINE (RE_DOT_NOT_NULL << 1)
|
#define RE_HAT_LISTS_NOT_NEWLINE (RE_DOT_NOT_NULL << 1)
|
||||||
|
|
||||||
/* If this bit is set, either \{...\} or {...} defines an
|
/* If this bit is set, either \{...\} or {...} defines an
|
||||||
interval, depending on RE_NO_BK_BRACES.
|
interval, depending on RE_NO_BK_BRACES.
|
||||||
If not set, \{, \}, {, and } are literals. */
|
If not set, \{, \}, {, and } are literals. */
|
||||||
#define RE_INTERVALS (RE_HAT_LISTS_NOT_NEWLINE << 1)
|
#define RE_INTERVALS (RE_HAT_LISTS_NOT_NEWLINE << 1)
|
||||||
|
|
||||||
|
@ -116,7 +116,7 @@ typedef unsigned reg_syntax_t;
|
||||||
If not set, then \<digit> is a back-reference. */
|
If not set, then \<digit> is a back-reference. */
|
||||||
#define RE_NO_BK_REFS (RE_NO_BK_PARENS << 1)
|
#define RE_NO_BK_REFS (RE_NO_BK_PARENS << 1)
|
||||||
|
|
||||||
/* If this bit is set, then | is an alternation operator, and \| is literal.
|
/* If this bit is set, then | is an alternation operator, and \| is literal.
|
||||||
If not set, then \| is an alternation operator, and | is literal. */
|
If not set, then \| is an alternation operator, and | is literal. */
|
||||||
#define RE_NO_BK_VBAR (RE_NO_BK_REFS << 1)
|
#define RE_NO_BK_VBAR (RE_NO_BK_REFS << 1)
|
||||||
|
|
||||||
|
@ -135,10 +135,10 @@ typedef unsigned reg_syntax_t;
|
||||||
stored in the pattern buffer, so changing this does not affect
|
stored in the pattern buffer, so changing this does not affect
|
||||||
already-compiled regexps. */
|
already-compiled regexps. */
|
||||||
extern reg_syntax_t re_syntax_options;
|
extern reg_syntax_t re_syntax_options;
|
||||||
|
|
||||||
/* Define combinations of the above bits for the standard possibilities.
|
/* Define combinations of the above bits for the standard possibilities.
|
||||||
(The [[[ comments delimit what gets put into the Texinfo file, so
|
(The [[[ comments delimit what gets put into the Texinfo file, so
|
||||||
don't delete them!) */
|
don't delete them!) */
|
||||||
/* [[[begin syntaxes]]] */
|
/* [[[begin syntaxes]]] */
|
||||||
#define RE_SYNTAX_EMACS 0
|
#define RE_SYNTAX_EMACS 0
|
||||||
|
|
||||||
|
@ -198,14 +198,14 @@ extern reg_syntax_t re_syntax_options;
|
||||||
| RE_NO_BK_PARENS | RE_NO_BK_REFS \
|
| RE_NO_BK_PARENS | RE_NO_BK_REFS \
|
||||||
| RE_NO_BK_VBAR | RE_UNMATCHED_RIGHT_PAREN_ORD)
|
| RE_NO_BK_VBAR | RE_UNMATCHED_RIGHT_PAREN_ORD)
|
||||||
/* [[[end syntaxes]]] */
|
/* [[[end syntaxes]]] */
|
||||||
|
|
||||||
/* Maximum number of duplicates an interval can allow. Some systems
|
/* Maximum number of duplicates an interval can allow. Some systems
|
||||||
(erroneously) define this in other header files, but we want our
|
(erroneously) define this in other header files, but we want our
|
||||||
value, so remove any previous define. */
|
value, so remove any previous define. */
|
||||||
#ifdef RE_DUP_MAX
|
#ifdef RE_DUP_MAX
|
||||||
#undef RE_DUP_MAX
|
#undef RE_DUP_MAX
|
||||||
#endif
|
#endif
|
||||||
#define RE_DUP_MAX ((1 << 15) - 1)
|
#define RE_DUP_MAX ((1 << 15) - 1)
|
||||||
|
|
||||||
|
|
||||||
/* POSIX `cflags' bits (i.e., information for `regcomp'). */
|
/* POSIX `cflags' bits (i.e., information for `regcomp'). */
|
||||||
|
@ -217,7 +217,7 @@ extern reg_syntax_t re_syntax_options;
|
||||||
/* If this bit is set, then ignore case when matching.
|
/* If this bit is set, then ignore case when matching.
|
||||||
If not set, then case is significant. */
|
If not set, then case is significant. */
|
||||||
#define REG_ICASE (REG_EXTENDED << 1)
|
#define REG_ICASE (REG_EXTENDED << 1)
|
||||||
|
|
||||||
/* If this bit is set, then anchors do not match at newline
|
/* If this bit is set, then anchors do not match at newline
|
||||||
characters in the string.
|
characters in the string.
|
||||||
If not set, then anchors do match at newlines. */
|
If not set, then anchors do match at newlines. */
|
||||||
|
@ -256,7 +256,7 @@ typedef enum
|
||||||
REG_EESCAPE, /* Trailing backslash. */
|
REG_EESCAPE, /* Trailing backslash. */
|
||||||
REG_ESUBREG, /* Invalid back reference. */
|
REG_ESUBREG, /* Invalid back reference. */
|
||||||
REG_EBRACK, /* Unmatched left bracket. */
|
REG_EBRACK, /* Unmatched left bracket. */
|
||||||
REG_EPAREN, /* Parenthesis imbalance. */
|
REG_EPAREN, /* Parenthesis imbalance. */
|
||||||
REG_EBRACE, /* Unmatched \{. */
|
REG_EBRACE, /* Unmatched \{. */
|
||||||
REG_BADBR, /* Invalid contents of \{\}. */
|
REG_BADBR, /* Invalid contents of \{\}. */
|
||||||
REG_ERANGE, /* Invalid range end. */
|
REG_ERANGE, /* Invalid range end. */
|
||||||
|
@ -268,7 +268,7 @@ typedef enum
|
||||||
REG_ESIZE, /* Compiled pattern bigger than 2^16 bytes. */
|
REG_ESIZE, /* Compiled pattern bigger than 2^16 bytes. */
|
||||||
REG_ERPAREN /* Unmatched ) or \); not returned from regcomp. */
|
REG_ERPAREN /* Unmatched ) or \); not returned from regcomp. */
|
||||||
} reg_errcode_t;
|
} reg_errcode_t;
|
||||||
|
|
||||||
/* This data structure represents a compiled pattern. Before calling
|
/* This data structure represents a compiled pattern. Before calling
|
||||||
the pattern compiler, the fields `buffer', `allocated', `fastmap',
|
the pattern compiler, the fields `buffer', `allocated', `fastmap',
|
||||||
`translate', and `no_sub' can be set. After the pattern has been
|
`translate', and `no_sub' can be set. After the pattern has been
|
||||||
|
@ -287,7 +287,7 @@ struct re_pattern_buffer
|
||||||
unsigned long allocated;
|
unsigned long allocated;
|
||||||
|
|
||||||
/* Number of bytes actually used in `buffer'. */
|
/* Number of bytes actually used in `buffer'. */
|
||||||
unsigned long used;
|
unsigned long used;
|
||||||
|
|
||||||
/* Syntax setting with which the pattern was compiled. */
|
/* Syntax setting with which the pattern was compiled. */
|
||||||
reg_syntax_t syntax;
|
reg_syntax_t syntax;
|
||||||
|
@ -331,7 +331,7 @@ struct re_pattern_buffer
|
||||||
unsigned no_sub : 1;
|
unsigned no_sub : 1;
|
||||||
|
|
||||||
/* If set, a beginning-of-line anchor doesn't match at the
|
/* If set, a beginning-of-line anchor doesn't match at the
|
||||||
beginning of the string. */
|
beginning of the string. */
|
||||||
unsigned not_bol : 1;
|
unsigned not_bol : 1;
|
||||||
|
|
||||||
/* Similarly for an end-of-line anchor. */
|
/* Similarly for an end-of-line anchor. */
|
||||||
|
@ -349,7 +349,7 @@ typedef struct re_pattern_buffer regex_t;
|
||||||
/* search.c (search_buffer) in Emacs needs this one opcode value. It is
|
/* search.c (search_buffer) in Emacs needs this one opcode value. It is
|
||||||
defined both in `regex.c' and here. */
|
defined both in `regex.c' and here. */
|
||||||
#define RE_EXACTN_VALUE 1
|
#define RE_EXACTN_VALUE 1
|
||||||
|
|
||||||
/* Type for byte offsets within the string. POSIX mandates this. */
|
/* Type for byte offsets within the string. POSIX mandates this. */
|
||||||
typedef int regoff_t;
|
typedef int regoff_t;
|
||||||
|
|
||||||
|
@ -380,7 +380,7 @@ typedef struct
|
||||||
regoff_t rm_so; /* Byte offset from string's start to substring's start. */
|
regoff_t rm_so; /* Byte offset from string's start to substring's start. */
|
||||||
regoff_t rm_eo; /* Byte offset from string's start to substring's end. */
|
regoff_t rm_eo; /* Byte offset from string's start to substring's end. */
|
||||||
} regmatch_t;
|
} regmatch_t;
|
||||||
|
|
||||||
/* Declarations for routines. */
|
/* Declarations for routines. */
|
||||||
|
|
||||||
/* To avoid duplicating every routine declaration -- once with a
|
/* To avoid duplicating every routine declaration -- once with a
|
||||||
|
@ -443,7 +443,7 @@ extern int re_match
|
||||||
|
|
||||||
|
|
||||||
/* Relates to `re_match' as `re_search_2' relates to `re_search'. */
|
/* Relates to `re_match' as `re_search_2' relates to `re_search'. */
|
||||||
extern int re_match_2
|
extern int re_match_2
|
||||||
_RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1,
|
_RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1,
|
||||||
int length1, const char *string2, int length2,
|
int length1, const char *string2, int length2,
|
||||||
int start, struct re_registers *regs, int stop));
|
int start, struct re_registers *regs, int stop));
|
||||||
|
@ -480,7 +480,7 @@ extern size_t regerror
|
||||||
extern void regfree _RE_ARGS ((regex_t *preg));
|
extern void regfree _RE_ARGS ((regex_t *preg));
|
||||||
|
|
||||||
#endif /* not __REGEXP_LIBRARY_H__ */
|
#endif /* not __REGEXP_LIBRARY_H__ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Local variables:
|
Local variables:
|
||||||
make-backup-files: t
|
make-backup-files: t
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
Stencil for determining fullbright pixels in a skin
|
Stencil for determining fullbright pixels in a skin
|
||||||
|
|
||||||
Derived from base.pcx, Copyright (C) 1996-1997 Id Software, Inc.
|
Derived from base.pcx, Copyright (C) 1996-1997 Id Software, Inc.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
as published by the Free Software Foundation; either version 2
|
as published by the Free Software Foundation; either version 2
|
||||||
|
|
|
@ -246,7 +246,7 @@ extern portable_samplepair_t snd_paintbuffer[PAINTBUFFER_SIZE * 2];
|
||||||
\param info
|
\param info
|
||||||
\param loader
|
\param loader
|
||||||
*/
|
*/
|
||||||
void SND_SFX_Cache (sfx_t *sfx, char *realname, wavinfo_t info,
|
void SND_SFX_Cache (sfx_t *sfx, char *realname, wavinfo_t info,
|
||||||
cache_loader_t loader);
|
cache_loader_t loader);
|
||||||
|
|
||||||
/** Stream sound data. Initializes streaming fields of sfx.
|
/** Stream sound data. Initializes streaming fields of sfx.
|
||||||
|
@ -255,7 +255,7 @@ void SND_SFX_Cache (sfx_t *sfx, char *realname, wavinfo_t info,
|
||||||
\param info
|
\param info
|
||||||
\param open
|
\param open
|
||||||
*/
|
*/
|
||||||
void SND_SFX_Stream (sfx_t *sfx, char *realname, wavinfo_t info,
|
void SND_SFX_Stream (sfx_t *sfx, char *realname, wavinfo_t info,
|
||||||
sfx_t *(*open) (sfx_t *sfx));
|
sfx_t *(*open) (sfx_t *sfx));
|
||||||
|
|
||||||
/** Open a stream for playback.
|
/** Open a stream for playback.
|
||||||
|
|
|
@ -541,14 +541,14 @@ vmode_t vgavidmodes[] = {
|
||||||
NULL,
|
NULL,
|
||||||
"360x200", NULL, 360, 200, (200.0/360.0)*(320.0/240.0),
|
"360x200", NULL, 360, 200, (200.0/360.0)*(320.0/240.0),
|
||||||
384, 1, 1, &extra360x200x256planar, VGA_InitMode,
|
384, 1, 1, &extra360x200x256planar, VGA_InitMode,
|
||||||
VGA_SwapBuffers,
|
VGA_SwapBuffers,
|
||||||
VGA_SetPalette, VGA_BeginDirectRect, VGA_EndDirectRect
|
VGA_SetPalette, VGA_BeginDirectRect, VGA_EndDirectRect
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
NULL,
|
NULL,
|
||||||
"320x240", NULL, 320, 240, (240.0/320.0)*(320.0/240.0),
|
"320x240", NULL, 320, 240, (240.0/320.0)*(320.0/240.0),
|
||||||
320, 1, 1, &extra320x240x256planar, VGA_InitMode,
|
320, 1, 1, &extra320x240x256planar, VGA_InitMode,
|
||||||
VGA_SwapBuffers,
|
VGA_SwapBuffers,
|
||||||
VGA_SetPalette, VGA_BeginDirectRect, VGA_EndDirectRect
|
VGA_SetPalette, VGA_BeginDirectRect, VGA_EndDirectRect
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -562,42 +562,42 @@ vmode_t vgavidmodes[] = {
|
||||||
NULL,
|
NULL,
|
||||||
"320x350", NULL, 320, 350, (350.0/320.0)*(320.0/240.0),
|
"320x350", NULL, 320, 350, (350.0/320.0)*(320.0/240.0),
|
||||||
320, 1, 1, &extra320x350x256planar, VGA_InitMode,
|
320, 1, 1, &extra320x350x256planar, VGA_InitMode,
|
||||||
VGA_SwapBuffers,
|
VGA_SwapBuffers,
|
||||||
VGA_SetPalette, VGA_BeginDirectRect, VGA_EndDirectRect
|
VGA_SetPalette, VGA_BeginDirectRect, VGA_EndDirectRect
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
NULL,
|
NULL,
|
||||||
"360x350", NULL, 360, 350, (350.0/360.0)*(320.0/240.0),
|
"360x350", NULL, 360, 350, (350.0/360.0)*(320.0/240.0),
|
||||||
384, 1, 1, &extra360x350x256planar, VGA_InitMode,
|
384, 1, 1, &extra360x350x256planar, VGA_InitMode,
|
||||||
VGA_SwapBuffers,
|
VGA_SwapBuffers,
|
||||||
VGA_SetPalette, VGA_BeginDirectRect, VGA_EndDirectRect
|
VGA_SetPalette, VGA_BeginDirectRect, VGA_EndDirectRect
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
NULL,
|
NULL,
|
||||||
"320x400", NULL, 320, 400, (400.0/320.0)*(320.0/240.0), 320,
|
"320x400", NULL, 320, 400, (400.0/320.0)*(320.0/240.0), 320,
|
||||||
1, 1, &extra320x400x256planar, VGA_InitMode,
|
1, 1, &extra320x400x256planar, VGA_InitMode,
|
||||||
VGA_SwapBuffers,
|
VGA_SwapBuffers,
|
||||||
VGA_SetPalette, VGA_BeginDirectRect, VGA_EndDirectRect
|
VGA_SetPalette, VGA_BeginDirectRect, VGA_EndDirectRect
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
NULL,
|
NULL,
|
||||||
"360x400", NULL, 360, 400, (400.0/360.0)*(320.0/240.0),
|
"360x400", NULL, 360, 400, (400.0/360.0)*(320.0/240.0),
|
||||||
384, 1, 1, &extra360x400x256planar, VGA_InitMode,
|
384, 1, 1, &extra360x400x256planar, VGA_InitMode,
|
||||||
VGA_SwapBuffers,
|
VGA_SwapBuffers,
|
||||||
VGA_SetPalette, VGA_BeginDirectRect, VGA_EndDirectRect
|
VGA_SetPalette, VGA_BeginDirectRect, VGA_EndDirectRect
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
NULL,
|
NULL,
|
||||||
"320x480", NULL, 320, 480, (480.0/320.0)*(320.0/240.0),
|
"320x480", NULL, 320, 480, (480.0/320.0)*(320.0/240.0),
|
||||||
320, 1, 1, &extra320x480x256planar, VGA_InitMode,
|
320, 1, 1, &extra320x480x256planar, VGA_InitMode,
|
||||||
VGA_SwapBuffers,
|
VGA_SwapBuffers,
|
||||||
VGA_SetPalette, VGA_BeginDirectRect, VGA_EndDirectRect
|
VGA_SetPalette, VGA_BeginDirectRect, VGA_EndDirectRect
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
NULL,
|
NULL,
|
||||||
"360x480", NULL, 360, 480, (480.0/360.0)*(320.0/240.0),
|
"360x480", NULL, 360, 480, (480.0/360.0)*(320.0/240.0),
|
||||||
384, 1, 1, &extra360x480x256planar, VGA_InitMode,
|
384, 1, 1, &extra360x480x256planar, VGA_InitMode,
|
||||||
VGA_SwapBuffers,
|
VGA_SwapBuffers,
|
||||||
VGA_SetPalette, VGA_BeginDirectRect, VGA_EndDirectRect
|
VGA_SetPalette, VGA_BeginDirectRect, VGA_EndDirectRect
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -56,7 +56,7 @@ extern "C" {
|
||||||
/* disk transfer area for this dir */
|
/* disk transfer area for this dir */
|
||||||
struct _finddata_t dd_dta;
|
struct _finddata_t dd_dta;
|
||||||
|
|
||||||
/* dirent struct to return from dir (NOTE: this makes this thread
|
/* dirent struct to return from dir (NOTE: this makes this thread
|
||||||
safe as long as only one thread uses a particular DIR struct
|
safe as long as only one thread uses a particular DIR struct
|
||||||
at a time) */
|
at a time) */
|
||||||
struct dirent dd_dir;
|
struct dirent dd_dir;
|
||||||
|
@ -64,7 +64,7 @@ extern "C" {
|
||||||
/* _findnext handle */
|
/* _findnext handle */
|
||||||
long dd_handle;
|
long dd_handle;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Status of search:
|
* Status of search:
|
||||||
* 0 = not started yet (next entry to read is first entry)
|
* 0 = not started yet (next entry to read is first entry)
|
||||||
* -1 = off the end
|
* -1 = off the end
|
||||||
|
@ -103,7 +103,7 @@ extern "C" {
|
||||||
/* disk transfer area for this dir */
|
/* disk transfer area for this dir */
|
||||||
struct _wfinddata_t dd_dta;
|
struct _wfinddata_t dd_dta;
|
||||||
|
|
||||||
/* dirent struct to return from dir (NOTE: this makes this thread
|
/* dirent struct to return from dir (NOTE: this makes this thread
|
||||||
safe as long as only one thread uses a particular DIR struct
|
safe as long as only one thread uses a particular DIR struct
|
||||||
at a time) */
|
at a time) */
|
||||||
struct _wdirent dd_dir;
|
struct _wdirent dd_dir;
|
||||||
|
@ -111,7 +111,7 @@ extern "C" {
|
||||||
/* _findnext handle */
|
/* _findnext handle */
|
||||||
long dd_handle;
|
long dd_handle;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Status of search:
|
* Status of search:
|
||||||
* 0 = not started yet (next entry to read is first entry)
|
* 0 = not started yet (next entry to read is first entry)
|
||||||
* -1 = off the end
|
* -1 = off the end
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
#define IDC_PROGRESS 1000
|
#define IDC_PROGRESS 1000
|
||||||
|
|
||||||
// Next default values for new objects
|
// Next default values for new objects
|
||||||
//
|
//
|
||||||
#ifdef APSTUDIO_INVOKED
|
#ifdef APSTUDIO_INVOKED
|
||||||
# ifndef APSTUDIO_READONLY_SYMBOLS
|
# ifndef APSTUDIO_READONLY_SYMBOLS
|
||||||
# define _APS_NEXT_RESOURCE_VALUE 115
|
# define _APS_NEXT_RESOURCE_VALUE 115
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
#ifndef _WINQUAKE_H
|
#ifndef _WINQUAKE_H
|
||||||
#define _WINQUAKE_H
|
#define _WINQUAKE_H
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
|
||||||
#ifndef __GNUC__
|
#ifndef __GNUC__
|
||||||
# pragma warning( disable : 4229 ) /* mgraph gets this */
|
# pragma warning( disable : 4229 ) /* mgraph gets this */
|
||||||
|
|
|
@ -115,7 +115,7 @@ I_OGGMus_Stop (void)
|
||||||
{
|
{
|
||||||
if (!tracklist || !mus_enabled || !playing)
|
if (!tracklist || !mus_enabled || !playing)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
playing = false;
|
playing = false;
|
||||||
wasPlaying = false;
|
wasPlaying = false;
|
||||||
|
|
||||||
|
@ -267,7 +267,7 @@ I_OGGMus_Pause (void)
|
||||||
{
|
{
|
||||||
if (!tracklist || !mus_enabled || !playing)
|
if (!tracklist || !mus_enabled || !playing)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (cd_channel)
|
if (cd_channel)
|
||||||
cd_channel->pause = 1;
|
cd_channel->pause = 1;
|
||||||
|
|
||||||
|
|
|
@ -428,7 +428,7 @@ Mus_CDChange (cvar_t *mus_cdaudio)
|
||||||
mus_cdaudio->string, errno);
|
mus_cdaudio->string, errno);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (I_CDAudio_GetAudioDiskInfo ()) {
|
if (I_CDAudio_GetAudioDiskInfo ()) {
|
||||||
Sys_Printf ("CDAudio_Init: No CD in player.\n");
|
Sys_Printf ("CDAudio_Init: No CD in player.\n");
|
||||||
cdValid = false;
|
cdValid = false;
|
||||||
|
|
|
@ -278,7 +278,7 @@ I_CDAudio_Init (void)
|
||||||
|
|
||||||
bgmvolume = Cvar_Get ("bgmvolume", "1", CVAR_ARCHIVE, NULL,
|
bgmvolume = Cvar_Get ("bgmvolume", "1", CVAR_ARCHIVE, NULL,
|
||||||
"Volume of CD music");
|
"Volume of CD music");
|
||||||
|
|
||||||
Sys_Printf ("CD Audio Initialized.\n");
|
Sys_Printf ("CD Audio Initialized.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,11 +42,11 @@
|
||||||
|
|
||||||
#include "compat.h"
|
#include "compat.h"
|
||||||
|
|
||||||
static plugin_t plugin_info;
|
static plugin_t plugin_info;
|
||||||
static plugin_data_t plugin_info_data;
|
static plugin_data_t plugin_info_data;
|
||||||
static plugin_funcs_t plugin_info_funcs;
|
static plugin_funcs_t plugin_info_funcs;
|
||||||
static general_data_t plugin_info_general_data;
|
static general_data_t plugin_info_general_data;
|
||||||
static general_funcs_t plugin_info_general_funcs;
|
static general_funcs_t plugin_info_general_funcs;
|
||||||
static cd_funcs_t plugin_info_cd_funcs;
|
static cd_funcs_t plugin_info_cd_funcs;
|
||||||
|
|
||||||
static qboolean cdValid = false;
|
static qboolean cdValid = false;
|
||||||
|
|
|
@ -155,7 +155,7 @@ I_XMMS_Running (void)
|
||||||
break;
|
break;
|
||||||
default: // Parent
|
default: // Parent
|
||||||
// don't need now :/
|
// don't need now :/
|
||||||
// xmmsPid = res; // so we can kill it later
|
// xmmsPid = res; // so we can kill it later
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
@ -181,7 +181,7 @@ I_XMMS_Stop (void) // stop playing
|
||||||
// Play
|
// Play
|
||||||
// start it playing, (unless disabled)
|
// start it playing, (unless disabled)
|
||||||
static void
|
static void
|
||||||
I_XMMS_Play (int track, qboolean looping) // looping for compatability
|
I_XMMS_Play (int track, qboolean looping) // looping for compatability
|
||||||
{
|
{
|
||||||
if (!musEnabled)
|
if (!musEnabled)
|
||||||
return;
|
return;
|
||||||
|
@ -395,8 +395,8 @@ I_XMMS_Info (void) // this is untested with really long tracks, prolly works
|
||||||
title = xmms_remote_get_playlist_title (sessionNo, pos); // get track title
|
title = xmms_remote_get_playlist_title (sessionNo, pos); // get track title
|
||||||
ctime = xmms_remote_get_output_time (sessionNo); // get track elapsed time
|
ctime = xmms_remote_get_output_time (sessionNo); // get track elapsed time
|
||||||
ttime = xmms_remote_get_playlist_time (sessionNo, pos);
|
ttime = xmms_remote_get_playlist_time (sessionNo, pos);
|
||||||
|
|
||||||
// The time returned by xmms_remote_get_output_time is in milliseconds
|
// The time returned by xmms_remote_get_output_time is in milliseconds
|
||||||
// elapsed, so, divide by (60*1000) to get mins (its an int, no decimals)
|
// elapsed, so, divide by (60*1000) to get mins (its an int, no decimals)
|
||||||
// and divide by 1000 mod 60 to get seconds. its a byte, no decimals too.
|
// and divide by 1000 mod 60 to get seconds. its a byte, no decimals too.
|
||||||
cmin = ctime / 60000;
|
cmin = ctime / 60000;
|
||||||
|
|
|
@ -312,7 +312,7 @@ flac_callback_load (void *object, cache_allocator_t allocator)
|
||||||
flacfile_t *ff;
|
flacfile_t *ff;
|
||||||
|
|
||||||
sfxblock_t *block = (sfxblock_t *) object;
|
sfxblock_t *block = (sfxblock_t *) object;
|
||||||
|
|
||||||
QFS_FOpenFile (block->file, &file);
|
QFS_FOpenFile (block->file, &file);
|
||||||
if (!file)
|
if (!file)
|
||||||
return; //FIXME Sys_Error?
|
return; //FIXME Sys_Error?
|
||||||
|
|
|
@ -121,7 +121,7 @@ midi_stream_seek (sfxstream_t *stream, int pos)
|
||||||
pos *= stream->wavinfo.width * stream->wavinfo.channels;
|
pos *= stream->wavinfo.width * stream->wavinfo.channels;
|
||||||
pos += stream->wavinfo.dataofs;
|
pos += stream->wavinfo.dataofs;
|
||||||
new_pos = pos;
|
new_pos = pos;
|
||||||
|
|
||||||
return WildMidi_FastSeek(stream->file, &new_pos);
|
return WildMidi_FastSeek(stream->file, &new_pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -156,8 +156,8 @@ midi_stream_open (sfx_t *sfx)
|
||||||
|
|
||||||
handle = WildMidi_OpenBuffer(local_buffer, local_buffer_size);
|
handle = WildMidi_OpenBuffer(local_buffer, local_buffer_size);
|
||||||
|
|
||||||
if (handle == NULL)
|
if (handle == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
mf = calloc (sizeof (midi_file_t), 1);
|
mf = calloc (sizeof (midi_file_t), 1);
|
||||||
mf->handle = handle;
|
mf->handle = handle;
|
||||||
|
@ -179,8 +179,8 @@ SND_LoadMidi (QFile *file, sfx_t *sfx, char *realname)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
local_buffer = malloc (local_buffer_size);
|
local_buffer = malloc (local_buffer_size);
|
||||||
Qread (file, local_buffer, local_buffer_size);
|
Qread (file, local_buffer, local_buffer_size);
|
||||||
Qclose (file);
|
Qclose (file);
|
||||||
|
@ -188,7 +188,7 @@ SND_LoadMidi (QFile *file, sfx_t *sfx, char *realname)
|
||||||
// WildMidi takes ownership, so be damned if you touch it
|
// WildMidi takes ownership, so be damned if you touch it
|
||||||
handle = WildMidi_OpenBuffer (local_buffer, local_buffer_size);
|
handle = WildMidi_OpenBuffer (local_buffer, local_buffer_size);
|
||||||
|
|
||||||
if (handle == NULL)
|
if (handle == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
info = midi_get_info (handle);
|
info = midi_get_info (handle);
|
||||||
|
|
|
@ -412,7 +412,7 @@ s_updateAmbientSounds (const byte *ambient_sound_level)
|
||||||
if (!chan)
|
if (!chan)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!chan->sfx) {
|
if (!chan->sfx) {
|
||||||
sfx = sfx->open (sfx);
|
sfx = sfx->open (sfx);
|
||||||
if (!sfx)
|
if (!sfx)
|
||||||
|
@ -533,13 +533,13 @@ SND_SetListener (const vec3_t origin, const vec3_t forward, const vec3_t right,
|
||||||
// update general area ambient sound sources
|
// update general area ambient sound sources
|
||||||
s_updateAmbientSounds (ambient_sound_level);
|
s_updateAmbientSounds (ambient_sound_level);
|
||||||
|
|
||||||
// update spatialization for dynamic sounds
|
// update spatialization for dynamic sounds
|
||||||
for (ch = dynamic_channels; ch; ch = ch->next)
|
for (ch = dynamic_channels; ch; ch = ch->next)
|
||||||
s_update_channel (ch);
|
s_update_channel (ch);
|
||||||
for (ch = looped_dynamic_channels; ch; ch = ch->next)
|
for (ch = looped_dynamic_channels; ch; ch = ch->next)
|
||||||
s_update_channel (ch);
|
s_update_channel (ch);
|
||||||
|
|
||||||
// update spatialization for static sounds
|
// update spatialization for static sounds
|
||||||
combine = 0;
|
combine = 0;
|
||||||
for (i = 0; i < snd_num_statics; i++) {
|
for (i = 0; i < snd_num_statics; i++) {
|
||||||
ch = static_channels[i];
|
ch = static_channels[i];
|
||||||
|
|
|
@ -156,7 +156,7 @@ s_get_soundtime (void)
|
||||||
// calls to s_update. Oh well.
|
// calls to s_update. Oh well.
|
||||||
if ((framepos = snd_output_funcs->pS_O_GetDMAPos ()) == -1)
|
if ((framepos = snd_output_funcs->pS_O_GetDMAPos ()) == -1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (framepos < oldframepos) {
|
if (framepos < oldframepos) {
|
||||||
buffers++; // buffer wrapped
|
buffers++; // buffer wrapped
|
||||||
|
|
||||||
|
|
|
@ -194,7 +194,7 @@ vorbis_callback_load (void *object, cache_allocator_t allocator)
|
||||||
OggVorbis_File vf;
|
OggVorbis_File vf;
|
||||||
|
|
||||||
sfxblock_t *block = (sfxblock_t *) object;
|
sfxblock_t *block = (sfxblock_t *) object;
|
||||||
|
|
||||||
QFS_FOpenFile (block->file, &file);
|
QFS_FOpenFile (block->file, &file);
|
||||||
if (!file)
|
if (!file)
|
||||||
return; //FIXME Sys_Error?
|
return; //FIXME Sys_Error?
|
||||||
|
@ -279,7 +279,7 @@ vorbis_stream_open (sfx_t *sfx)
|
||||||
static void
|
static void
|
||||||
vorbis_stream (sfx_t *sfx, char *realname, OggVorbis_File *vf, wavinfo_t info)
|
vorbis_stream (sfx_t *sfx, char *realname, OggVorbis_File *vf, wavinfo_t info)
|
||||||
{
|
{
|
||||||
ov_clear (vf);
|
ov_clear (vf);
|
||||||
SND_SFX_Stream (sfx, realname, info, vorbis_stream_open);
|
SND_SFX_Stream (sfx, realname, info, vorbis_stream_open);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -244,7 +244,7 @@ wav_get_info (QFile *file)
|
||||||
Sys_Printf ("missing data chunk\n");
|
Sys_Printf ("missing data chunk\n");
|
||||||
goto bail;
|
goto bail;
|
||||||
}
|
}
|
||||||
|
|
||||||
info.rate = dfmt->samples_per_sec;
|
info.rate = dfmt->samples_per_sec;
|
||||||
info.width = dfmt->bits_per_sample / 8;
|
info.width = dfmt->bits_per_sample / 8;
|
||||||
info.channels = dfmt->channels;
|
info.channels = dfmt->channels;
|
||||||
|
|
|
@ -137,11 +137,11 @@ SNDDMA_Submit (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
SNDDMA_BlockSound (void)
|
SNDDMA_BlockSound (void)
|
||||||
{
|
{
|
||||||
++snd_blocked;
|
++snd_blocked;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
SNDDMA_UnblockSound (void)
|
SNDDMA_UnblockSound (void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -207,7 +207,7 @@ try_open (int rw)
|
||||||
close (audio_fd);
|
close (audio_fd);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
tmp = sn.channels;
|
tmp = sn.channels;
|
||||||
rc = ioctl (audio_fd, SNDCTL_DSP_CHANNELS, &tmp);
|
rc = ioctl (audio_fd, SNDCTL_DSP_CHANNELS, &tmp);
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
|
|
|
@ -189,10 +189,10 @@ SNDDMA_InitWav (void)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Allocate and lock memory for the waveform data. The memory
|
Allocate and lock memory for the waveform data. The memory
|
||||||
for waveform data must be globally allocated with
|
for waveform data must be globally allocated with
|
||||||
GMEM_MOVEABLE and GMEM_SHARE flags.
|
GMEM_MOVEABLE and GMEM_SHARE flags.
|
||||||
*/
|
*/
|
||||||
gSndBufSize = WAV_BUFFERS * WAV_BUFFER_SIZE;
|
gSndBufSize = WAV_BUFFERS * WAV_BUFFER_SIZE;
|
||||||
hData = GlobalAlloc (GMEM_MOVEABLE | GMEM_SHARE, gSndBufSize);
|
hData = GlobalAlloc (GMEM_MOVEABLE | GMEM_SHARE, gSndBufSize);
|
||||||
|
@ -209,10 +209,10 @@ SNDDMA_InitWav (void)
|
||||||
}
|
}
|
||||||
memset (lpData, 0, gSndBufSize);
|
memset (lpData, 0, gSndBufSize);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Allocate and lock memory for the header. This memory must
|
* Allocate and lock memory for the header. This memory must
|
||||||
* also be globally allocated with GMEM_MOVEABLE and
|
* also be globally allocated with GMEM_MOVEABLE and
|
||||||
* GMEM_SHARE flags.
|
* GMEM_SHARE flags.
|
||||||
*/
|
*/
|
||||||
hWaveHdr = GlobalAlloc (GMEM_MOVEABLE | GMEM_SHARE,
|
hWaveHdr = GlobalAlloc (GMEM_MOVEABLE | GMEM_SHARE,
|
||||||
(DWORD) sizeof (WAVEHDR) * WAV_BUFFERS);
|
(DWORD) sizeof (WAVEHDR) * WAV_BUFFERS);
|
||||||
|
@ -287,9 +287,9 @@ static int
|
||||||
SNDDMA_GetDMAPos (void)
|
SNDDMA_GetDMAPos (void)
|
||||||
{
|
{
|
||||||
int s = 0;
|
int s = 0;
|
||||||
|
|
||||||
s = snd_sent * WAV_BUFFER_SIZE;
|
s = snd_sent * WAV_BUFFER_SIZE;
|
||||||
|
|
||||||
s >>= sample16;
|
s >>= sample16;
|
||||||
s /= sn.channels;
|
s /= sn.channels;
|
||||||
|
|
||||||
|
@ -329,10 +329,10 @@ SNDDMA_Submit (void)
|
||||||
h = lpWaveHdr + (snd_sent & WAV_MASK);
|
h = lpWaveHdr + (snd_sent & WAV_MASK);
|
||||||
|
|
||||||
snd_sent++;
|
snd_sent++;
|
||||||
/*
|
/*
|
||||||
Now the data block can be sent to the output device. The
|
Now the data block can be sent to the output device. The
|
||||||
waveOutWrite function returns immediately and waveform
|
waveOutWrite function returns immediately and waveform
|
||||||
data is sent to the output device in the background.
|
data is sent to the output device in the background.
|
||||||
*/
|
*/
|
||||||
wResult = waveOutWrite (hWaveOut, h, sizeof (WAVEHDR));
|
wResult = waveOutWrite (hWaveOut, h, sizeof (WAVEHDR));
|
||||||
|
|
||||||
|
|
|
@ -280,7 +280,7 @@ bi_InputLine_SetText (progs_t *pr)
|
||||||
/*
|
/*
|
||||||
bi_InputLine_GetText
|
bi_InputLine_GetText
|
||||||
|
|
||||||
Gets the text from a inputline
|
Gets the text from a inputline
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
bi_InputLine_GetText (progs_t *pr)
|
bi_InputLine_GetText (progs_t *pr)
|
||||||
|
|
|
@ -214,7 +214,7 @@ Resize (old_console_t *con)
|
||||||
say_team_line->width = con_linewidth - 9;
|
say_team_line->width = con_linewidth - 9;
|
||||||
say_line->width = con_linewidth - 4;
|
say_line->width = con_linewidth - 4;
|
||||||
input_line->width = con_linewidth;
|
input_line->width = con_linewidth;
|
||||||
|
|
||||||
con->current = con_totallines - 1;
|
con->current = con_totallines - 1;
|
||||||
con->display = con->current;
|
con->display = con->current;
|
||||||
}
|
}
|
||||||
|
@ -641,7 +641,7 @@ draw_console_text (view_t *view)
|
||||||
y -= 8;
|
y -= 8;
|
||||||
rows--;
|
rows--;
|
||||||
}
|
}
|
||||||
|
|
||||||
row = con->display;
|
row = con->display;
|
||||||
for (i = 0; i < rows; i++, y -= 8, row--) {
|
for (i = 0; i < rows; i++, y -= 8, row--) {
|
||||||
if (row < 0)
|
if (row < 0)
|
||||||
|
@ -905,7 +905,7 @@ C_Init (void)
|
||||||
Cmd_AddCommand ("clear", Clear_f, "Clear the console");
|
Cmd_AddCommand ("clear", Clear_f, "Clear the console");
|
||||||
Cmd_AddCommand ("condump", Condump_f, "dump the console text to a "
|
Cmd_AddCommand ("condump", Condump_f, "dump the console text to a "
|
||||||
"file");
|
"file");
|
||||||
|
|
||||||
// register GIB builtins
|
// register GIB builtins
|
||||||
GIB_Builtin_Add ("HUD::enable", C_GIB_HUD_Enable_f);
|
GIB_Builtin_Add ("HUD::enable", C_GIB_HUD_Enable_f);
|
||||||
GIB_Builtin_Add ("HUD::disable", C_GIB_HUD_Disable_f);
|
GIB_Builtin_Add ("HUD::disable", C_GIB_HUD_Disable_f);
|
||||||
|
|
|
@ -66,7 +66,7 @@ Con_BasicCompleteCommandLine (inputline_t *il)
|
||||||
cbuf_t *cbuf;
|
cbuf_t *cbuf;
|
||||||
|
|
||||||
s = il->lines[il->edit_line] + 1;
|
s = il->lines[il->edit_line] + 1;
|
||||||
|
|
||||||
if (*s == '/')
|
if (*s == '/')
|
||||||
s++;
|
s++;
|
||||||
|
|
||||||
|
@ -75,12 +75,12 @@ Con_BasicCompleteCommandLine (inputline_t *il)
|
||||||
if (cbuf->interpreter->complete) {
|
if (cbuf->interpreter->complete) {
|
||||||
const char **completions = cbuf->interpreter->complete (cbuf, s);
|
const char **completions = cbuf->interpreter->complete (cbuf, s);
|
||||||
const char **com;
|
const char **com;
|
||||||
|
|
||||||
for (o = 0, com = completions; *com; com++, o++)
|
for (o = 0, com = completions; *com; com++, o++)
|
||||||
;
|
;
|
||||||
|
|
||||||
c = v = 0;
|
c = v = 0;
|
||||||
|
|
||||||
list[2] = completions;
|
list[2] = completions;
|
||||||
} else {
|
} else {
|
||||||
// Count number of possible matches
|
// Count number of possible matches
|
||||||
|
@ -88,10 +88,10 @@ Con_BasicCompleteCommandLine (inputline_t *il)
|
||||||
v = Cvar_CompleteCountPossible (s);
|
v = Cvar_CompleteCountPossible (s);
|
||||||
o = 0;
|
o = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(c + v + o)) // No possible matches
|
if (!(c + v + o)) // No possible matches
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (c + v + o == 1) {
|
if (c + v + o == 1) {
|
||||||
if (c) {
|
if (c) {
|
||||||
list[0] = Cmd_CompleteBuildList (s);
|
list[0] = Cmd_CompleteBuildList (s);
|
||||||
|
@ -110,7 +110,7 @@ Con_BasicCompleteCommandLine (inputline_t *il)
|
||||||
cmd = *(list[1] = Cvar_CompleteBuildList (s));
|
cmd = *(list[1] = Cvar_CompleteBuildList (s));
|
||||||
if (o)
|
if (o)
|
||||||
cmd = *(list[2]);
|
cmd = *(list[2]);
|
||||||
|
|
||||||
cmd_len = 0;
|
cmd_len = 0;
|
||||||
do {
|
do {
|
||||||
for (i = 0; i < 3; i++) {
|
for (i = 0; i < 3; i++) {
|
||||||
|
@ -137,7 +137,7 @@ Con_BasicCompleteCommandLine (inputline_t *il)
|
||||||
Sys_Printf ("%i possible command%s\n", c, (c > 1) ? "s: " : ":");
|
Sys_Printf ("%i possible command%s\n", c, (c > 1) ? "s: " : ":");
|
||||||
Con_DisplayList (list[0], con_linewidth);
|
Con_DisplayList (list[0], con_linewidth);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (v) {
|
if (v) {
|
||||||
Sys_Printf ("%i possible variable%s\n", v, (v > 1) ? "s: " : ":");
|
Sys_Printf ("%i possible variable%s\n", v, (v > 1) ? "s: " : ":");
|
||||||
Con_DisplayList (list[1], con_linewidth);
|
Con_DisplayList (list[1], con_linewidth);
|
||||||
|
@ -147,18 +147,18 @@ Con_BasicCompleteCommandLine (inputline_t *il)
|
||||||
Con_DisplayList (list[2], con_linewidth);
|
Con_DisplayList (list[2], con_linewidth);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cmd) {
|
if (cmd) {
|
||||||
unsigned bound = max (0, (int) strlen (s) - (int) cmd_len);
|
unsigned bound = max (0, (int) strlen (s) - (int) cmd_len);
|
||||||
const char *overwrite;
|
const char *overwrite;
|
||||||
|
|
||||||
if (cmd_len > 0)
|
if (cmd_len > 0)
|
||||||
while (bound < strlen (s)
|
while (bound < strlen (s)
|
||||||
&& strncmp (s + bound, cmd, strlen (s + bound)))
|
&& strncmp (s + bound, cmd, strlen (s + bound)))
|
||||||
bound++;
|
bound++;
|
||||||
|
|
||||||
overwrite = va("%.*s%.*s", bound, s, cmd_len, cmd);
|
overwrite = va("%.*s%.*s", bound, s, cmd_len, cmd);
|
||||||
|
|
||||||
il->lines[il->edit_line][1] = '/';
|
il->lines[il->edit_line][1] = '/';
|
||||||
strncpy (il->lines[il->edit_line] + 2, overwrite, il->line_size - 3);
|
strncpy (il->lines[il->edit_line] + 2, overwrite, il->line_size - 3);
|
||||||
il->lines[il->edit_line][il->line_size-1] = 0;
|
il->lines[il->edit_line][il->line_size-1] = 0;
|
||||||
|
|
|
@ -72,7 +72,7 @@ Con_Interp_f (cvar_t *var)
|
||||||
Sys_Printf ("Switching to interpreter '%s'\n", var->string);
|
Sys_Printf ("Switching to interpreter '%s'\n", var->string);
|
||||||
|
|
||||||
new = Cbuf_New (interp);
|
new = Cbuf_New (interp);
|
||||||
|
|
||||||
if (con_module->data->console->cbuf) {
|
if (con_module->data->console->cbuf) {
|
||||||
new->down = con_module->data->console->cbuf;
|
new->down = con_module->data->console->cbuf;
|
||||||
new->state = CBUF_STATE_STACK;
|
new->state = CBUF_STATE_STACK;
|
||||||
|
@ -94,7 +94,7 @@ Con_Init (const char *plugin_name)
|
||||||
} else {
|
} else {
|
||||||
setvbuf (stdout, 0, _IOLBF, BUFSIZ);
|
setvbuf (stdout, 0, _IOLBF, BUFSIZ);
|
||||||
}
|
}
|
||||||
con_interpreter =
|
con_interpreter =
|
||||||
Cvar_Get("con_interpreter", "id", CVAR_NONE, Con_Interp_f,
|
Cvar_Get("con_interpreter", "id", CVAR_NONE, Con_Interp_f,
|
||||||
"Interpreter for the interactive console");
|
"Interpreter for the interactive console");
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
|
|
||||||
/*
|
/*
|
||||||
bi_Key_SetBinding
|
bi_Key_SetBinding
|
||||||
|
|
||||||
QC-Function for set a binding
|
QC-Function for set a binding
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
|
@ -61,7 +61,7 @@ bi_Key_SetBinding (progs_t *pr)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
bi_Key_LookupBinding
|
bi_Key_LookupBinding
|
||||||
|
|
||||||
Perform a reverse-binding-lookup
|
Perform a reverse-binding-lookup
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
|
@ -88,12 +88,12 @@ bi_Key_LookupBinding (progs_t *pr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
R_INT (pr) = keynum;
|
R_INT (pr) = keynum;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
bi_Key_CountBinding
|
bi_Key_CountBinding
|
||||||
|
|
||||||
Counts how often a binding is assigned to a key
|
Counts how often a binding is assigned to a key
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
|
@ -114,13 +114,13 @@ bi_Key_CountBinding (progs_t *pr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
R_INT (pr) = res;
|
R_INT (pr) = res;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
bi_Key_LookupBinding
|
bi_Key_LookupBinding
|
||||||
|
|
||||||
Convertes a keynum to a string
|
Convertes a keynum to a string
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -217,7 +217,7 @@ draw_output (view_t *view)
|
||||||
sv_view_t *sv_view = view->data;
|
sv_view_t *sv_view = view->data;
|
||||||
WINDOW *win = sv_view->win;
|
WINDOW *win = sv_view->win;
|
||||||
con_buffer_t *output_buffer = sv_view->obj;
|
con_buffer_t *output_buffer = sv_view->obj;
|
||||||
|
|
||||||
// this is not the most efficient way to update the screen, but oh well
|
// this is not the most efficient way to update the screen, but oh well
|
||||||
int lines = view->ylen - 1; // leave a blank line
|
int lines = view->ylen - 1; // leave a blank line
|
||||||
int width = view->xlen;
|
int width = view->xlen;
|
||||||
|
@ -247,7 +247,7 @@ draw_output (view_t *view)
|
||||||
if (y > 0) {
|
if (y > 0) {
|
||||||
text += y * width;
|
text += y * width;
|
||||||
len -= y * width;
|
len -= y * width;
|
||||||
y = 0;
|
y = 0;
|
||||||
if (len < 1) {
|
if (len < 1) {
|
||||||
len = 1;
|
len = 1;
|
||||||
text = l->text + l->len - 1;
|
text = l->text + l->len - 1;
|
||||||
|
|
|
@ -451,7 +451,7 @@ PR_Get_Source_Line (progs_t *pr, pr_uint_t addr)
|
||||||
file_t *file;
|
file_t *file;
|
||||||
pr_auxfunction_t *func;
|
pr_auxfunction_t *func;
|
||||||
pr_lineno_t *lineno;
|
pr_lineno_t *lineno;
|
||||||
|
|
||||||
lineno = PR_Find_Lineno (pr, addr);
|
lineno = PR_Find_Lineno (pr, addr);
|
||||||
if (!lineno || PR_Get_Lineno_Addr (pr, lineno) != addr)
|
if (!lineno || PR_Get_Lineno_Addr (pr, lineno) != addr)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -223,7 +223,7 @@ ED_EdictNum (progs_t *pr, pr_int_t n)
|
||||||
|
|
||||||
if (offs < 0 || n >= pr->pr_edictareasize)
|
if (offs < 0 || n >= pr->pr_edictareasize)
|
||||||
PR_RunError (pr, "EDICT_NUM: bad number %d", n);
|
PR_RunError (pr, "EDICT_NUM: bad number %d", n);
|
||||||
|
|
||||||
return PROG_TO_EDICT (pr, offs);
|
return PROG_TO_EDICT (pr, offs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,7 @@ PR_RunError (progs_t * pr, const char *error, ...)
|
||||||
Sys_Printf ("%s\n", string->str);
|
Sys_Printf ("%s\n", string->str);
|
||||||
|
|
||||||
// dump the stack so PR_Error can shutdown functions
|
// dump the stack so PR_Error can shutdown functions
|
||||||
pr->pr_depth = 0;
|
pr->pr_depth = 0;
|
||||||
|
|
||||||
PR_Error (pr, "Program error: %s", string->str);
|
PR_Error (pr, "Program error: %s", string->str);
|
||||||
}
|
}
|
||||||
|
@ -284,7 +284,7 @@ static int
|
||||||
signal_hook (int sig, void *data)
|
signal_hook (int sig, void *data)
|
||||||
{
|
{
|
||||||
progs_t *pr = (progs_t *) data;
|
progs_t *pr = (progs_t *) data;
|
||||||
|
|
||||||
if (sig == SIGFPE && pr_faultchecks->int_val) {
|
if (sig == SIGFPE && pr_faultchecks->int_val) {
|
||||||
dstatement_t *st;
|
dstatement_t *st;
|
||||||
pr_type_t *op_a, *op_b, *op_c;
|
pr_type_t *op_a, *op_b, *op_c;
|
||||||
|
|
|
@ -855,7 +855,7 @@ VISIBLE opcode_t pr_opcodes[] = {
|
||||||
ev_float, ev_float, ev_integer,
|
ev_float, ev_float, ev_integer,
|
||||||
PROG_ID_VERSION,
|
PROG_ID_VERSION,
|
||||||
},
|
},
|
||||||
{"||", "or.f", OP_OR, false,
|
{"||", "or.f", OP_OR, false,
|
||||||
ev_float, ev_float, ev_integer,
|
ev_float, ev_float, ev_integer,
|
||||||
PROG_ID_VERSION,
|
PROG_ID_VERSION,
|
||||||
},
|
},
|
||||||
|
@ -1086,7 +1086,7 @@ static inline void
|
||||||
check_branch (progs_t *pr, dstatement_t *st, opcode_t *op, short offset)
|
check_branch (progs_t *pr, dstatement_t *st, opcode_t *op, short offset)
|
||||||
{
|
{
|
||||||
pr_int_t address = st - pr->pr_statements;
|
pr_int_t address = st - pr->pr_statements;
|
||||||
|
|
||||||
address += offset;
|
address += offset;
|
||||||
if (address < 0 || (pr_uint_t) address >= pr->progs->numstatements)
|
if (address < 0 || (pr_uint_t) address >= pr->progs->numstatements)
|
||||||
PR_Error (pr, "PR_Check_Opcodes: invalid branch (statement %ld: %s)",
|
PR_Error (pr, "PR_Check_Opcodes: invalid branch (statement %ld: %s)",
|
||||||
|
|
|
@ -330,7 +330,7 @@ VISIBLE string_t
|
||||||
PR_SetString (progs_t *pr, const char *s)
|
PR_SetString (progs_t *pr, const char *s)
|
||||||
{
|
{
|
||||||
strref_t *sr;
|
strref_t *sr;
|
||||||
|
|
||||||
if (!s)
|
if (!s)
|
||||||
s = "";
|
s = "";
|
||||||
sr = Hash_Find (pr->strref_hash, s);
|
sr = Hash_Find (pr->strref_hash, s);
|
||||||
|
@ -559,7 +559,7 @@ I_DoPrint (dstring_t *result, fmt_item_t *formatting)
|
||||||
|
|
||||||
doPrecision = -1 != current->precision;
|
doPrecision = -1 != current->precision;
|
||||||
doWidth = 0 != current->minFieldWidth;
|
doWidth = 0 != current->minFieldWidth;
|
||||||
|
|
||||||
dsprintf (tmp, "%%%s%s%s%s%s%s%s",
|
dsprintf (tmp, "%%%s%s%s%s%s%s%s",
|
||||||
(current->flags & FMT_ALTFORM) ? "#" : "", // hash
|
(current->flags & FMT_ALTFORM) ? "#" : "", // hash
|
||||||
(current->flags & FMT_ZEROPAD) ? "0" : "", // zero padding
|
(current->flags & FMT_ZEROPAD) ? "0" : "", // zero padding
|
||||||
|
|
|
@ -97,7 +97,7 @@ GIB_Buffer_Reset (struct cbuf_s *cbuf)
|
||||||
// It just means the buffer is going to be reused.
|
// It just means the buffer is going to be reused.
|
||||||
if (g->dnotify)
|
if (g->dnotify)
|
||||||
g->dnotify (cbuf, g->ddata);
|
g->dnotify (cbuf, g->ddata);
|
||||||
|
|
||||||
if (g->locals)
|
if (g->locals)
|
||||||
Hash_FlushTable (g->locals);
|
Hash_FlushTable (g->locals);
|
||||||
g->globals = gib_globals;
|
g->globals = gib_globals;
|
||||||
|
@ -168,7 +168,7 @@ GIB_Buffer_Add (cbuf_t * cbuf, const char *str)
|
||||||
"|GIB Parse Error|\n"
|
"|GIB Parse Error|\n"
|
||||||
"-----------------\n"
|
"-----------------\n"
|
||||||
"Parse error while adding text to GIB buffer.\n"
|
"Parse error while adding text to GIB buffer.\n"
|
||||||
"Line %u: %s\n",
|
"Line %u: %s\n",
|
||||||
GIB_Buffer_Get_Line_Num (str, GIB_Parse_ErrorPos ()),
|
GIB_Buffer_Get_Line_Num (str, GIB_Parse_ErrorPos ()),
|
||||||
GIB_Parse_ErrorMsg ()
|
GIB_Parse_ErrorMsg ()
|
||||||
);
|
);
|
||||||
|
|
|
@ -88,7 +88,7 @@ GIB_Builtin_Free (void *ele, void *ptr)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
GIB_Builtin_Add
|
GIB_Builtin_Add
|
||||||
|
|
||||||
Registers a new builtin GIB command.
|
Registers a new builtin GIB command.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -124,7 +124,7 @@ GIB_Builtin_Exists (const char *name)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
GIB_Builtin_Find
|
GIB_Builtin_Find
|
||||||
|
|
||||||
Looks up the builtin name in the builtin hash,
|
Looks up the builtin name in the builtin hash,
|
||||||
returning a pointer to the struct on success,
|
returning a pointer to the struct on success,
|
||||||
zero otherwise.
|
zero otherwise.
|
||||||
|
@ -165,7 +165,7 @@ GIB_Error (const char *type, const char *fmt, ...)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
GIB Builtin functions
|
GIB Builtin functions
|
||||||
|
|
||||||
See GIB docs for information.
|
See GIB docs for information.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
|
@ -175,7 +175,7 @@ GIB_Function_f (void)
|
||||||
gib_function_t *func;
|
gib_function_t *func;
|
||||||
int i;
|
int i;
|
||||||
int argc = GIB_Argc ();
|
int argc = GIB_Argc ();
|
||||||
|
|
||||||
if (argc < 3) {
|
if (argc < 3) {
|
||||||
GIB_USAGE ("name [arg1 arg2 ...] program");
|
GIB_USAGE ("name [arg1 arg2 ...] program");
|
||||||
} else {
|
} else {
|
||||||
|
@ -262,7 +262,7 @@ GIB_Shared_f (void)
|
||||||
GIB_Return (GIB_Argv(i));
|
GIB_Return (GIB_Argv(i));
|
||||||
} else for (i = 1; i < GIB_Argc(); i++)
|
} else for (i = 1; i < GIB_Argc(); i++)
|
||||||
var = GIB_Var_Get_Complex (&GIB_DATA (cbuf_active)->globals, &zero,
|
var = GIB_Var_Get_Complex (&GIB_DATA (cbuf_active)->globals, &zero,
|
||||||
GIB_Argv (i), &index, true);
|
GIB_Argv (i), &index, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -273,7 +273,7 @@ GIB_Delete_f (void)
|
||||||
int i;
|
int i;
|
||||||
hashtab_t *source;
|
hashtab_t *source;
|
||||||
char *c;
|
char *c;
|
||||||
|
|
||||||
if (GIB_Argc () < 2) {
|
if (GIB_Argc () < 2) {
|
||||||
GIB_USAGE ("var [var2 var2 ...]");
|
GIB_USAGE ("var [var2 var2 ...]");
|
||||||
} else for (i = 1; i < GIB_Argc(); i++) {
|
} else for (i = 1; i < GIB_Argc(); i++) {
|
||||||
|
@ -326,7 +326,7 @@ GIB_Return_f (void)
|
||||||
|
|
||||||
for (i = 1; i < GIB_Argc(); i++)
|
for (i = 1; i < GIB_Argc(); i++)
|
||||||
argv[i-1] = GIB_Argv(i);
|
argv[i-1] = GIB_Argv(i);
|
||||||
|
|
||||||
GIB_Reply (g->reply.obj, g->reply.mesg, GIB_Argc()-1, argv);
|
GIB_Reply (g->reply.obj, g->reply.mesg, GIB_Argc()-1, argv);
|
||||||
free ((void*)argv);
|
free ((void*)argv);
|
||||||
g->dnotify = NULL;
|
g->dnotify = NULL;
|
||||||
|
@ -437,7 +437,7 @@ GIB_Count_f (void)
|
||||||
if (GIB_CanReturn())
|
if (GIB_CanReturn())
|
||||||
dsprintf (GIB_Return(0), "%u", GIB_Argc() - 1);
|
dsprintf (GIB_Return(0), "%u", GIB_Argc() - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
GIB_Contains_f (void)
|
GIB_Contains_f (void)
|
||||||
|
@ -949,10 +949,10 @@ static void
|
||||||
GIB_Class_f (void)
|
GIB_Class_f (void)
|
||||||
{
|
{
|
||||||
if (GIB_Object_Get (GIB_Argv(1))) {
|
if (GIB_Object_Get (GIB_Argv(1))) {
|
||||||
GIB_Error ("ClassRedefinitionError",
|
GIB_Error ("ClassRedefinitionError",
|
||||||
"Class '%s' already exists", GIB_Argv(1));
|
"Class '%s' already exists", GIB_Argv(1));
|
||||||
} else if (GIB_Argc () == 5)
|
} else if (GIB_Argc () == 5)
|
||||||
GIB_Classes_Build_Scripted (GIB_Argv(1), GIB_Argv(3),
|
GIB_Classes_Build_Scripted (GIB_Argv(1), GIB_Argv(3),
|
||||||
GIB_Argm (4)->children,
|
GIB_Argm (4)->children,
|
||||||
GIB_DATA(cbuf_active)->script);
|
GIB_DATA(cbuf_active)->script);
|
||||||
else
|
else
|
||||||
|
@ -973,10 +973,10 @@ GIB_Emit_f (void)
|
||||||
} else {
|
} else {
|
||||||
int i;
|
int i;
|
||||||
const char **argv = malloc (GIB_Argc () - 1);
|
const char **argv = malloc (GIB_Argc () - 1);
|
||||||
|
|
||||||
for (i = 1; i < GIB_Argc (); i ++)
|
for (i = 1; i < GIB_Argc (); i ++)
|
||||||
argv[i-1] = GIB_Argv (1);
|
argv[i-1] = GIB_Argv (1);
|
||||||
|
|
||||||
GIB_Object_Signal_Emit (GIB_DATA(cbuf_active)->reply.obj,
|
GIB_Object_Signal_Emit (GIB_DATA(cbuf_active)->reply.obj,
|
||||||
GIB_Argc () - 1, argv);
|
GIB_Argc () - 1, argv);
|
||||||
|
|
||||||
|
@ -1013,10 +1013,10 @@ GIB_New_f (void)
|
||||||
} else if (
|
} else if (
|
||||||
!(class = GIB_Object_Get(GIB_Argv(1)))
|
!(class = GIB_Object_Get(GIB_Argv(1)))
|
||||||
|| classobj->class->classobj != classobj) {
|
|| classobj->class->classobj != classobj) {
|
||||||
GIB_Error ("UnknownClassError", "Class '%s' does not exist",
|
GIB_Error ("UnknownClassError", "Class '%s' does not exist",
|
||||||
GIB_Argv(1));
|
GIB_Argv(1));
|
||||||
} else {
|
} else {
|
||||||
GIB_Send (classobj,
|
GIB_Send (classobj,
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -57,7 +57,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
typedef struct baseobj_s {
|
typedef struct baseobj_s {
|
||||||
unsigned long int ref;
|
unsigned long int ref;
|
||||||
} baseobj_t;
|
} baseobj_t;
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -65,7 +65,7 @@ Object_Retain_f (gib_object_t *obj, gib_method_t *method, void *data,
|
||||||
gib_object_t *sender, gib_message_t mesg)
|
gib_object_t *sender, gib_message_t mesg)
|
||||||
{
|
{
|
||||||
baseobj_t *base = data;
|
baseobj_t *base = data;
|
||||||
|
|
||||||
base->ref++;
|
base->ref++;
|
||||||
GIB_Object_Incref (obj);
|
GIB_Object_Incref (obj);
|
||||||
GIB_Reply (obj, mesg, 1, &obj->handstr);
|
GIB_Reply (obj, mesg, 1, &obj->handstr);
|
||||||
|
@ -74,7 +74,7 @@ Object_Retain_f (gib_object_t *obj, gib_method_t *method, void *data,
|
||||||
|
|
||||||
static int
|
static int
|
||||||
Object_Release_f (gib_object_t *obj, gib_method_t *method, void *data,
|
Object_Release_f (gib_object_t *obj, gib_method_t *method, void *data,
|
||||||
gib_object_t *sender, gib_message_t mesg)
|
gib_object_t *sender, gib_message_t mesg)
|
||||||
{
|
{
|
||||||
baseobj_t *base = data;
|
baseobj_t *base = data;
|
||||||
if (base->ref) {
|
if (base->ref) {
|
||||||
|
@ -119,7 +119,7 @@ Object_IsKindOf_f (gib_object_t *obj, gib_method_t *method, void *data,
|
||||||
gib_class_t *c;
|
gib_class_t *c;
|
||||||
static const char *one = "1";
|
static const char *one = "1";
|
||||||
static const char *zero = "0";
|
static const char *zero = "0";
|
||||||
|
|
||||||
if (mesg.argc < 2)
|
if (mesg.argc < 2)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
@ -174,7 +174,7 @@ Object_Class_New_f (gib_object_t *obj, gib_method_t *method, void *data,
|
||||||
{
|
{
|
||||||
const char *old;
|
const char *old;
|
||||||
gib_object_t *new;
|
gib_object_t *new;
|
||||||
|
|
||||||
new = GIB_Object_Create (obj->class->name, false);
|
new = GIB_Object_Create (obj->class->name, false);
|
||||||
old = mesg.argv[0];
|
old = mesg.argv[0];
|
||||||
mesg.argv[0] = "init";
|
mesg.argv[0] = "init";
|
||||||
|
@ -200,7 +200,7 @@ Object_Class_Children_f (gib_object_t *obj, gib_method_t *method, void *data,
|
||||||
unsigned int size;
|
unsigned int size;
|
||||||
|
|
||||||
g_occ_i = 0;
|
g_occ_i = 0;
|
||||||
|
|
||||||
size = llist_size (obj->class->children);
|
size = llist_size (obj->class->children);
|
||||||
if (size) {
|
if (size) {
|
||||||
g_occ_reply = malloc (sizeof (char *) * size);
|
g_occ_reply = malloc (sizeof (char *) * size);
|
||||||
|
@ -210,14 +210,14 @@ Object_Class_Children_f (gib_object_t *obj, gib_method_t *method, void *data,
|
||||||
GIB_Reply (obj, mesg, 0, NULL);
|
GIB_Reply (obj, mesg, 0, NULL);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *
|
static void *
|
||||||
Object_Construct (gib_object_t *obj)
|
Object_Construct (gib_object_t *obj)
|
||||||
{
|
{
|
||||||
baseobj_t *base = malloc (sizeof (baseobj_t));
|
baseobj_t *base = malloc (sizeof (baseobj_t));
|
||||||
|
|
||||||
base->ref = 1;
|
base->ref = 1;
|
||||||
|
|
||||||
return base;
|
return base;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -256,11 +256,11 @@ static gib_classdesc_t Object_class = {
|
||||||
Object_Destruct,
|
Object_Destruct,
|
||||||
Object_methods, Object_class_methods
|
Object_methods, Object_class_methods
|
||||||
};
|
};
|
||||||
|
|
||||||
/* End Object class */
|
|
||||||
|
|
||||||
|
|
||||||
|
/* End Object class */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Begin Thread class
|
Begin Thread class
|
||||||
|
|
||||||
|
@ -273,7 +273,7 @@ static gib_classdesc_t Object_class = {
|
||||||
this case, the object must be released manually later on, but otherwise
|
this case, the object must be released manually later on, but otherwise
|
||||||
will do nothing.
|
will do nothing.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
typedef struct Thread_class_s {
|
typedef struct Thread_class_s {
|
||||||
hashtab_t *methods;
|
hashtab_t *methods;
|
||||||
} Thread_class_t;
|
} Thread_class_t;
|
||||||
|
@ -414,7 +414,7 @@ ObjectHash_Insert_f (gib_object_t *obj, gib_method_t *method, void *data,
|
||||||
|
|
||||||
if (mesg.argc < 3)
|
if (mesg.argc < 3)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
for (i = 2; i < mesg.argc; i++) {
|
for (i = 2; i < mesg.argc; i++) {
|
||||||
if ((ins = GIB_Object_Get (mesg.argv[i]))) {
|
if ((ins = GIB_Object_Get (mesg.argv[i]))) {
|
||||||
new = malloc (sizeof (ObjRef_t));
|
new = malloc (sizeof (ObjRef_t));
|
||||||
|
@ -462,7 +462,7 @@ ObjectHash_Remove_f (gib_object_t *obj, gib_method_t *method, void *data,
|
||||||
ObjectHash_t *objh = data;
|
ObjectHash_t *objh = data;
|
||||||
ObjRef_t **refs, **r;
|
ObjRef_t **refs, **r;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (mesg.argc < 2)
|
if (mesg.argc < 2)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
@ -489,7 +489,7 @@ ObjectHash_Remove_f (gib_object_t *obj, gib_method_t *method, void *data,
|
||||||
}
|
}
|
||||||
GIB_Reply (obj, mesg, 0, NULL);
|
GIB_Reply (obj, mesg, 0, NULL);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gib_methodtab_t ObjectHash_methods[] = {
|
static gib_methodtab_t ObjectHash_methods[] = {
|
||||||
{"insert", ObjectHash_Insert_f, NULL},
|
{"insert", ObjectHash_Insert_f, NULL},
|
||||||
|
@ -536,7 +536,7 @@ Scrobj_Construct (gib_object_t *obj)
|
||||||
|
|
||||||
if (!obj->vars)
|
if (!obj->vars)
|
||||||
obj->vars = GIB_Var_Hash_New ();
|
obj->vars = GIB_Var_Hash_New ();
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -544,9 +544,9 @@ static void *
|
||||||
Scrobj_Class_Construct (gib_object_t *obj)
|
Scrobj_Class_Construct (gib_object_t *obj)
|
||||||
{
|
{
|
||||||
Scrobj_t *new = malloc (sizeof (Scrobj_t));
|
Scrobj_t *new = malloc (sizeof (Scrobj_t));
|
||||||
|
|
||||||
new->shared = GIB_Domain_Get (obj->class->name);
|
new->shared = GIB_Domain_Get (obj->class->name);
|
||||||
|
|
||||||
return new;
|
return new;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -575,7 +575,7 @@ Scrobj_Method_f (gib_object_t *obj, gib_method_t *method, void *data,
|
||||||
cbuf_t *thread = GIB_Thread_New ();
|
cbuf_t *thread = GIB_Thread_New ();
|
||||||
static hashtab_t *nhash = NULL;
|
static hashtab_t *nhash = NULL;
|
||||||
gib_var_t *var;
|
gib_var_t *var;
|
||||||
|
|
||||||
if (GIB_Function_Execute (thread, ((Scrobj_method_t *)method->data)->func,
|
if (GIB_Function_Execute (thread, ((Scrobj_method_t *)method->data)->func,
|
||||||
mesg.argv, mesg.argc))
|
mesg.argv, mesg.argc))
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -598,7 +598,7 @@ Scrobj_Method_f (gib_object_t *obj, gib_method_t *method, void *data,
|
||||||
else
|
else
|
||||||
dstring_copystr (var->array[0].value, "0");
|
dstring_copystr (var->array[0].value, "0");
|
||||||
Cbuf_Execute_Stack (thread);
|
Cbuf_Execute_Stack (thread);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -629,7 +629,7 @@ GIB_Classes_Build_Scripted (const char *name, const char *parentname,
|
||||||
|
|
||||||
g_gcbs_mode = INSTANCE;
|
g_gcbs_mode = INSTANCE;
|
||||||
g_gcbs_name = name;
|
g_gcbs_name = name;
|
||||||
|
|
||||||
methods = llist_new (gcbs_mtabfree, NULL, NULL);
|
methods = llist_new (gcbs_mtabfree, NULL, NULL);
|
||||||
cmethods = llist_new (gcbs_mtabfree, NULL, NULL);
|
cmethods = llist_new (gcbs_mtabfree, NULL, NULL);
|
||||||
|
|
||||||
|
@ -684,7 +684,7 @@ GIB_Classes_Build_Scripted (const char *name, const char *parentname,
|
||||||
|
|
||||||
llist_append (methods, calloc (1, sizeof (gib_methodtab_t)));
|
llist_append (methods, calloc (1, sizeof (gib_methodtab_t)));
|
||||||
llist_append (cmethods, calloc (1, sizeof (gib_methodtab_t)));
|
llist_append (cmethods, calloc (1, sizeof (gib_methodtab_t)));
|
||||||
|
|
||||||
mtab = llist_createarray (methods, sizeof (gib_methodtab_t));
|
mtab = llist_createarray (methods, sizeof (gib_methodtab_t));
|
||||||
cmtab = llist_createarray (cmethods, sizeof (gib_methodtab_t));
|
cmtab = llist_createarray (cmethods, sizeof (gib_methodtab_t));
|
||||||
|
|
||||||
|
@ -703,7 +703,7 @@ GIB_Classes_Build_Scripted (const char *name, const char *parentname,
|
||||||
llist_delete (methods);
|
llist_delete (methods);
|
||||||
llist_delete (cmethods);
|
llist_delete (cmethods);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
GIB_Classes_Init (void)
|
GIB_Classes_Init (void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -296,7 +296,7 @@ GIB_Execute (cbuf_t * cbuf)
|
||||||
g->reply.obj, i - 2, mesg,
|
g->reply.obj, i - 2, mesg,
|
||||||
GIB_Buffer_Reply_Callback,
|
GIB_Buffer_Reply_Callback,
|
||||||
cbuf) : GIB_Send (obj,
|
cbuf) : GIB_Send (obj,
|
||||||
g->reply.obj, i - 2, mesg,
|
g->reply.obj, i - 2, mesg,
|
||||||
GIB_Buffer_Reply_Callback,
|
GIB_Buffer_Reply_Callback,
|
||||||
cbuf);
|
cbuf);
|
||||||
} else {
|
} else {
|
||||||
|
@ -304,8 +304,8 @@ GIB_Execute (cbuf_t * cbuf)
|
||||||
i = super ? GIB_SendToMethod (obj,
|
i = super ? GIB_SendToMethod (obj,
|
||||||
g->reply.method->parent,
|
g->reply.method->parent,
|
||||||
g->reply.obj, i - 2, mesg,
|
g->reply.obj, i - 2, mesg,
|
||||||
NULL, NULL) :
|
NULL, NULL) :
|
||||||
GIB_Send (obj,g->reply.obj,
|
GIB_Send (obj,g->reply.obj,
|
||||||
i - 2, mesg, NULL,
|
i - 2, mesg, NULL,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
@ -338,7 +338,7 @@ GIB_Execute (cbuf_t * cbuf)
|
||||||
if (GIB_Function_Execute_D
|
if (GIB_Function_Execute_D
|
||||||
(new, f,
|
(new, f,
|
||||||
cbuf->args->argv,
|
cbuf->args->argv,
|
||||||
cbuf->args->argc))
|
cbuf->args->argc))
|
||||||
GIB_Error ("syntax", "not "
|
GIB_Error ("syntax", "not "
|
||||||
"enough "
|
"enough "
|
||||||
"arguments to "
|
"arguments to "
|
||||||
|
|
|
@ -49,7 +49,7 @@
|
||||||
|
|
||||||
hashtab_t *gib_functions = 0;
|
hashtab_t *gib_functions = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Hashtable callbacks
|
Hashtable callbacks
|
||||||
*/
|
*/
|
||||||
static const char *
|
static const char *
|
||||||
|
@ -77,7 +77,7 @@ GIB_Function_Free (void *ele, void *ptr)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
GIB_Function_New
|
GIB_Function_New
|
||||||
|
|
||||||
Builds a new function struct and returns
|
Builds a new function struct and returns
|
||||||
a pointer to it.
|
a pointer to it.
|
||||||
*/
|
*/
|
||||||
|
@ -93,7 +93,7 @@ static gib_function_t *
|
||||||
GIB_Function_New (const char *name)
|
GIB_Function_New (const char *name)
|
||||||
{
|
{
|
||||||
gib_function_t *new = calloc (1, sizeof (gib_function_t));
|
gib_function_t *new = calloc (1, sizeof (gib_function_t));
|
||||||
|
|
||||||
new->text = dstring_newstr ();
|
new->text = dstring_newstr ();
|
||||||
new->name = strdup (name);
|
new->name = strdup (name);
|
||||||
new->arglist = llist_new (afree, NULL, NULL);
|
new->arglist = llist_new (afree, NULL, NULL);
|
||||||
|
@ -102,7 +102,7 @@ GIB_Function_New (const char *name)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
GIB_Function_Define
|
GIB_Function_Define
|
||||||
|
|
||||||
Sets the program and text of a GIB function,
|
Sets the program and text of a GIB function,
|
||||||
allocating one and adding it to the functions
|
allocating one and adding it to the functions
|
||||||
hash if needed.
|
hash if needed.
|
||||||
|
@ -143,7 +143,7 @@ GIB_Function_Define (const char *name, const char *text, gib_tree_t * program,
|
||||||
|
|
||||||
/*
|
/*
|
||||||
GIB_Function_Find
|
GIB_Function_Find
|
||||||
|
|
||||||
Looks up a function in the function hash
|
Looks up a function in the function hash
|
||||||
and returns a pointer to it on success,
|
and returns a pointer to it on success,
|
||||||
0 otherwise
|
0 otherwise
|
||||||
|
@ -187,7 +187,7 @@ GIB_Function_Prepare_Args (cbuf_t * cbuf, const char **args, unsigned int
|
||||||
g_fpa_argc = argc;
|
g_fpa_argc = argc;
|
||||||
|
|
||||||
g_fpa_i = 1; llist_iterate (arglist, LLIST_ICAST (fpa_iterate));
|
g_fpa_i = 1; llist_iterate (arglist, LLIST_ICAST (fpa_iterate));
|
||||||
|
|
||||||
var =
|
var =
|
||||||
GIB_Var_Get_Complex (&GIB_DATA (cbuf)->locals, &g_fpa_zero, argss,
|
GIB_Var_Get_Complex (&GIB_DATA (cbuf)->locals, &g_fpa_zero, argss,
|
||||||
&g_fpa_ind, true);
|
&g_fpa_ind, true);
|
||||||
|
@ -233,9 +233,9 @@ GIB_Function_Prepare_Args_D (cbuf_t * cbuf, dstring_t **args, unsigned int
|
||||||
g_fpad_cbuf = cbuf;
|
g_fpad_cbuf = cbuf;
|
||||||
g_fpad_args = args;
|
g_fpad_args = args;
|
||||||
g_fpad_argc = argc;
|
g_fpad_argc = argc;
|
||||||
|
|
||||||
i = 1; llist_iterate (arglist, LLIST_ICAST (fpad_iterate));
|
i = 1; llist_iterate (arglist, LLIST_ICAST (fpad_iterate));
|
||||||
|
|
||||||
var =
|
var =
|
||||||
GIB_Var_Get_Complex (&GIB_DATA (cbuf)->locals, &g_fpad_zero, argss,
|
GIB_Var_Get_Complex (&GIB_DATA (cbuf)->locals, &g_fpad_zero, argss,
|
||||||
&g_fpad_ind, true);
|
&g_fpad_ind, true);
|
||||||
|
@ -253,7 +253,7 @@ GIB_Function_Prepare_Args_D (cbuf_t * cbuf, dstring_t **args, unsigned int
|
||||||
|
|
||||||
/*
|
/*
|
||||||
GIB_Function_Execute
|
GIB_Function_Execute
|
||||||
|
|
||||||
Prepares a buffer to execute
|
Prepares a buffer to execute
|
||||||
a GIB function with certain arguments
|
a GIB function with certain arguments
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -91,8 +91,8 @@ GIB_Signal_Free (void *ele, void *ptr)
|
||||||
{
|
{
|
||||||
gib_signal_t *sig;
|
gib_signal_t *sig;
|
||||||
gib_slot_t *slot;
|
gib_slot_t *slot;
|
||||||
|
|
||||||
sig = (gib_signal_t *) ele;
|
sig = (gib_signal_t *) ele;
|
||||||
slot = llist_remove (llist_getnode (sig->receiver->slots,
|
slot = llist_remove (llist_getnode (sig->receiver->slots,
|
||||||
sig->slot));
|
sig->slot));
|
||||||
|
|
||||||
|
@ -136,10 +136,10 @@ GIB_Method_Build_Hash (gib_class_t *class, hashtab_t *inherited,
|
||||||
method->class = class;
|
method->class = class;
|
||||||
Hash_Add (new, method);
|
Hash_Add (new, method);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (inherited) {
|
if (inherited) {
|
||||||
void **list, **l;
|
void **list, **l;
|
||||||
|
|
||||||
for (l = list = Hash_GetList (inherited); *l; l++)
|
for (l = list = Hash_GetList (inherited); *l; l++)
|
||||||
if (!Hash_Find (new, GIB_Method_Get_Key (*l, NULL)))
|
if (!Hash_Find (new, GIB_Method_Get_Key (*l, NULL)))
|
||||||
Hash_Add (new, *l);
|
Hash_Add (new, *l);
|
||||||
|
@ -172,7 +172,7 @@ GIB_Class_Create (gib_classdesc_t *desc)
|
||||||
class->class_methods = GIB_Method_Build_Hash (class, parent ?
|
class->class_methods = GIB_Method_Build_Hash (class, parent ?
|
||||||
parent->class_methods : NULL, desc->class_methods);
|
parent->class_methods : NULL, desc->class_methods);
|
||||||
class->children = llist_new (NULL, NULL, NULL);
|
class->children = llist_new (NULL, NULL, NULL);
|
||||||
|
|
||||||
Hash_Add (gib_classes, class);
|
Hash_Add (gib_classes, class);
|
||||||
|
|
||||||
// Create a class object
|
// Create a class object
|
||||||
|
@ -209,7 +209,7 @@ GIB_Object_Create (const char *classname, qboolean classobj)
|
||||||
obj->signals = Hash_NewTable (128, GIB_Signal_Get_Key,
|
obj->signals = Hash_NewTable (128, GIB_Signal_Get_Key,
|
||||||
GIB_Signal_Free, NULL);
|
GIB_Signal_Free, NULL);
|
||||||
obj->slots = llist_new (GIB_Slot_Free, NULL, NULL);
|
obj->slots = llist_new (GIB_Slot_Free, NULL, NULL);
|
||||||
|
|
||||||
if (classobj) {
|
if (classobj) {
|
||||||
for (temp = class, i = class->depth; temp; temp = temp->parent, i--)
|
for (temp = class, i = class->depth; temp; temp = temp->parent, i--)
|
||||||
if (temp->class_construct)
|
if (temp->class_construct)
|
||||||
|
@ -279,7 +279,7 @@ GIB_Send (gib_object_t *obj, gib_object_t *sender, int argc, const char
|
||||||
|
|
||||||
if (!(method = Hash_Find (obj->methods, *argv)))
|
if (!(method = Hash_Find (obj->methods, *argv)))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
message.argc = argc;
|
message.argc = argc;
|
||||||
message.argv = argv;
|
message.argv = argv;
|
||||||
message.reply = reply;
|
message.reply = reply;
|
||||||
|
@ -287,7 +287,7 @@ GIB_Send (gib_object_t *obj, gib_object_t *sender, int argc, const char
|
||||||
|
|
||||||
if (reply)
|
if (reply)
|
||||||
GIB_Object_Incref (obj);
|
GIB_Object_Incref (obj);
|
||||||
|
|
||||||
return method->func (obj, method, obj->data[method->class->depth],
|
return method->func (obj, method, obj->data[method->class->depth],
|
||||||
sender, message);
|
sender, message);
|
||||||
}
|
}
|
||||||
|
@ -298,7 +298,7 @@ GIB_SendToMethod (gib_object_t *obj, gib_method_t *method, gib_object_t
|
||||||
void *replydata)
|
void *replydata)
|
||||||
{
|
{
|
||||||
gib_message_t message;
|
gib_message_t message;
|
||||||
|
|
||||||
message.argc = argc;
|
message.argc = argc;
|
||||||
message.argv = argv;
|
message.argv = argv;
|
||||||
message.reply = reply;
|
message.reply = reply;
|
||||||
|
@ -306,7 +306,7 @@ GIB_SendToMethod (gib_object_t *obj, gib_method_t *method, gib_object_t
|
||||||
|
|
||||||
if (reply)
|
if (reply)
|
||||||
GIB_Object_Incref (obj);
|
GIB_Object_Incref (obj);
|
||||||
|
|
||||||
return method->func (obj, method, obj->data[method->class->depth],
|
return method->func (obj, method, obj->data[method->class->depth],
|
||||||
sender, message);
|
sender, message);
|
||||||
}
|
}
|
||||||
|
@ -378,7 +378,7 @@ GIB_Object_Signal_Emit (gib_object_t *sender, int argc, const char **argv)
|
||||||
{
|
{
|
||||||
gib_signal_t **list, **cur;
|
gib_signal_t **list, **cur;
|
||||||
const char *old = *argv;
|
const char *old = *argv;
|
||||||
|
|
||||||
if ((list = (gib_signal_t **) Hash_FindList (sender->signals, *argv))) {
|
if ((list = (gib_signal_t **) Hash_FindList (sender->signals, *argv))) {
|
||||||
for (cur = list; *cur; cur++) {
|
for (cur = list; *cur; cur++) {
|
||||||
*argv = (*cur)->slot->mesg;
|
*argv = (*cur)->slot->mesg;
|
||||||
|
|
|
@ -47,7 +47,7 @@
|
||||||
#include "gib_process.h"
|
#include "gib_process.h"
|
||||||
#include "gib_semantics.h"
|
#include "gib_semantics.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
GIB_Escaped
|
GIB_Escaped
|
||||||
|
|
||||||
Returns true if character i in str is
|
Returns true if character i in str is
|
||||||
|
@ -67,7 +67,7 @@ GIB_Escaped (const char *str, int i)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
GIB_Parse_Match_*
|
GIB_Parse_Match_*
|
||||||
|
|
||||||
These are the workhorses of the GIB parser. They iterate
|
These are the workhorses of the GIB parser. They iterate
|
||||||
an index variable through a string until an appropriate
|
an index variable through a string until an appropriate
|
||||||
matching character is found, calling themselves and their
|
matching character is found, calling themselves and their
|
||||||
|
|
|
@ -43,7 +43,7 @@ static int
|
||||||
GIB_Semantic_Validate_Class (gib_tree_t * tokens)
|
GIB_Semantic_Validate_Class (gib_tree_t * tokens)
|
||||||
{
|
{
|
||||||
gib_tree_t *a_class, *line, *cmd;
|
gib_tree_t *a_class, *line, *cmd;
|
||||||
|
|
||||||
if (!tokens->next || !tokens->next->next) {
|
if (!tokens->next || !tokens->next->next) {
|
||||||
GIB_Parse_Error ("Malformed class definition; expected class "
|
GIB_Parse_Error ("Malformed class definition; expected class "
|
||||||
"name, optional 'extends' and parent class, and "
|
"name, optional 'extends' and parent class, and "
|
||||||
|
@ -95,7 +95,7 @@ GIB_Semantic_Validate_Class (gib_tree_t * tokens)
|
||||||
gib_tree_t *last;
|
gib_tree_t *last;
|
||||||
|
|
||||||
for (last = cmd; last->next; last = last->next);
|
for (last = cmd; last->next; last = last->next);
|
||||||
|
|
||||||
if (!cmd->next || !last || last->delim != '{' ||
|
if (!cmd->next || !last || last->delim != '{' ||
|
||||||
!last->children) {
|
!last->children) {
|
||||||
GIB_Parse_Error ("Malformed function "
|
GIB_Parse_Error ("Malformed function "
|
||||||
|
@ -490,17 +490,17 @@ GIB_Semantic_Label_To_Lines (gib_tree_t *tokens, const char *program,
|
||||||
char *name;
|
char *name;
|
||||||
|
|
||||||
line = GIB_Tree_New (TREE_T_LABEL);
|
line = GIB_Tree_New (TREE_T_LABEL);
|
||||||
|
|
||||||
name = strdup (tokens->str);
|
name = strdup (tokens->str);
|
||||||
name[strlen(name)-1] = '\0';
|
name[strlen(name)-1] = '\0';
|
||||||
line->str = name;
|
line->str = name;
|
||||||
line->flags = flags;
|
line->flags = flags;
|
||||||
|
|
||||||
GIB_Tree_Unref (&tokens);
|
GIB_Tree_Unref (&tokens);
|
||||||
|
|
||||||
return line;
|
return line;
|
||||||
}
|
}
|
||||||
|
|
||||||
gib_tree_t *
|
gib_tree_t *
|
||||||
GIB_Semantic_Tokens_To_Lines (gib_tree_t *tokens, const char *program, gib_tree_flags_t flags, unsigned int start, unsigned int end)
|
GIB_Semantic_Tokens_To_Lines (gib_tree_t *tokens, const char *program, gib_tree_flags_t flags, unsigned int start, unsigned int end)
|
||||||
{
|
{
|
||||||
|
|
|
@ -120,13 +120,13 @@ GIB_Var_Get_Complex (hashtab_t ** first, hashtab_t ** second, char *key,
|
||||||
*first = Hash_NewTable (256, GIB_Var_Get_Key, GIB_Var_Free, 0);
|
*first = Hash_NewTable (256, GIB_Var_Get_Key, GIB_Var_Free, 0);
|
||||||
Hash_Add (*first, var);
|
Hash_Add (*first, var);
|
||||||
}
|
}
|
||||||
|
|
||||||
// We are done looking up/creating var, fix up key
|
// We are done looking up/creating var, fix up key
|
||||||
if (n)
|
if (n)
|
||||||
key[n] = '[';
|
key[n] = '[';
|
||||||
if (i < len)
|
if (i < len)
|
||||||
key[i] = '.';
|
key[i] = '.';
|
||||||
|
|
||||||
// Give up
|
// Give up
|
||||||
if (!var)
|
if (!var)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -163,7 +163,7 @@ GIB_Var_Get_Very_Complex (hashtab_t ** first, hashtab_t ** second, dstring_t *ke
|
||||||
cvar_t *cvar;
|
cvar_t *cvar;
|
||||||
char c, *str;
|
char c, *str;
|
||||||
qboolean done = false;
|
qboolean done = false;
|
||||||
|
|
||||||
for (i = start, protect = 0; !done; i++) {
|
for (i = start, protect = 0; !done; i++) {
|
||||||
if (key->str[i] == '.' || key->str[i] == 0) {
|
if (key->str[i] == '.' || key->str[i] == 0) {
|
||||||
index = 0;
|
index = 0;
|
||||||
|
@ -229,7 +229,7 @@ GIB_Var_Get_Very_Complex (hashtab_t ** first, hashtab_t ** second, dstring_t *ke
|
||||||
}
|
}
|
||||||
i = n;
|
i = n;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if (!var->array[index].value)
|
if (!var->array[index].value)
|
||||||
var->array[index].value = dstring_newstr ();
|
var->array[index].value = dstring_newstr ();
|
||||||
|
|
596
libs/gib/regex.c
596
libs/gib/regex.c
File diff suppressed because it is too large
Load diff
|
@ -27,7 +27,7 @@
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
# include "config.h"
|
# include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_STRING_H
|
#ifdef HAVE_STRING_H
|
||||||
# include <string.h>
|
# include <string.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -178,7 +178,7 @@ EncodePCX (byte * data, int width, int height,
|
||||||
for (i = 0; i < height; i++) {
|
for (i = 0; i < height; i++) {
|
||||||
// from darkplaces lmp2pcx
|
// from darkplaces lmp2pcx
|
||||||
for (dataend = data + width; data < dataend; /* empty */) {
|
for (dataend = data + width; data < dataend; /* empty */) {
|
||||||
for (pix = *data++, run = 0xC1;
|
for (pix = *data++, run = 0xC1;
|
||||||
data < dataend && run < 0xFF && *data == pix;
|
data < dataend && run < 0xFF && *data == pix;
|
||||||
data++, run++)
|
data++, run++)
|
||||||
/* empty */;
|
/* empty */;
|
||||||
|
@ -200,7 +200,7 @@ EncodePCX (byte * data, int width, int height,
|
||||||
for (i = 0; i < 768; i++)
|
for (i = 0; i < 768; i++)
|
||||||
*pack++ = *palette++;
|
*pack++ = *palette++;
|
||||||
|
|
||||||
// write output file
|
// write output file
|
||||||
*length = pack - (byte *) pcx;
|
*length = pack - (byte *) pcx;
|
||||||
return pcx;
|
return pcx;
|
||||||
}
|
}
|
||||||
|
|
|
@ -632,7 +632,7 @@ LoadTGA (QFile *fin)
|
||||||
targa_mark = Hunk_LowMark ();
|
targa_mark = Hunk_LowMark ();
|
||||||
targa = Hunk_AllocName (fsize, "TGA");
|
targa = Hunk_AllocName (fsize, "TGA");
|
||||||
Qread (fin, targa, fsize);
|
Qread (fin, targa, fsize);
|
||||||
|
|
||||||
targa->colormap_index = LittleShort (targa->colormap_index);
|
targa->colormap_index = LittleShort (targa->colormap_index);
|
||||||
targa->colormap_length = LittleShort (targa->colormap_length);
|
targa->colormap_length = LittleShort (targa->colormap_length);
|
||||||
targa->x_origin = LittleShort (targa->x_origin);
|
targa->x_origin = LittleShort (targa->x_origin);
|
||||||
|
|
|
@ -403,7 +403,7 @@ gl_Mod_MakeAliasModelDisplayLists (model_t *m, aliashdr_t *hdr, void *_m,
|
||||||
mdfour_update (&md, (unsigned char *) vo, no * sizeof (vo[0]));
|
mdfour_update (&md, (unsigned char *) vo, no * sizeof (vo[0]));
|
||||||
mdfour_update (&md, d1, MDFOUR_DIGEST_BYTES);
|
mdfour_update (&md, d1, MDFOUR_DIGEST_BYTES);
|
||||||
mdfour_result (&md, mesh_digest);
|
mdfour_result (&md, mesh_digest);
|
||||||
|
|
||||||
if (memcmp (d2, mesh_digest, MDFOUR_DIGEST_BYTES) == 0
|
if (memcmp (d2, mesh_digest, MDFOUR_DIGEST_BYTES) == 0
|
||||||
&& memcmp (d1, model_digest, MDFOUR_DIGEST_BYTES) == 0) {
|
&& memcmp (d1, model_digest, MDFOUR_DIGEST_BYTES) == 0) {
|
||||||
remesh = false;
|
remesh = false;
|
||||||
|
@ -440,7 +440,7 @@ gl_Mod_MakeAliasModelDisplayLists (model_t *m, aliashdr_t *hdr, void *_m,
|
||||||
if (do_cache) {
|
if (do_cache) {
|
||||||
// save out the cached version
|
// save out the cached version
|
||||||
dsprintf (fullpath, "%s/%s", qfs_gamedir->dir.def, cache->str);
|
dsprintf (fullpath, "%s/%s", qfs_gamedir->dir.def, cache->str);
|
||||||
f = QFS_WOpen (fullpath->str, 9);
|
f = QFS_WOpen (fullpath->str, 9);
|
||||||
|
|
||||||
if (f) {
|
if (f) {
|
||||||
struct mdfour md;
|
struct mdfour md;
|
||||||
|
@ -458,7 +458,7 @@ gl_Mod_MakeAliasModelDisplayLists (model_t *m, aliashdr_t *hdr, void *_m,
|
||||||
mdfour_update (&md, (unsigned char *) vertexorder,
|
mdfour_update (&md, (unsigned char *) vertexorder,
|
||||||
numorder * sizeof (vertexorder[0]));
|
numorder * sizeof (vertexorder[0]));
|
||||||
mdfour_update (&md, model_digest, MDFOUR_DIGEST_BYTES);
|
mdfour_update (&md, model_digest, MDFOUR_DIGEST_BYTES);
|
||||||
mdfour_result (&md, mesh_digest);
|
mdfour_result (&md, mesh_digest);
|
||||||
|
|
||||||
Qwrite (f, &vers, sizeof (int));
|
Qwrite (f, &vers, sizeof (int));
|
||||||
Qwrite (f, &len, sizeof (int));
|
Qwrite (f, &len, sizeof (int));
|
||||||
|
@ -471,10 +471,10 @@ gl_Mod_MakeAliasModelDisplayLists (model_t *m, aliashdr_t *hdr, void *_m,
|
||||||
Qclose (f);
|
Qclose (f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// save the data out
|
// save the data out
|
||||||
paliashdr->poseverts = numorder;
|
paliashdr->poseverts = numorder;
|
||||||
|
|
||||||
cmds = Hunk_Alloc (numcommands * sizeof (int));
|
cmds = Hunk_Alloc (numcommands * sizeof (int));
|
||||||
paliashdr->commands = (byte *) cmds - (byte *) paliashdr;
|
paliashdr->commands = (byte *) cmds - (byte *) paliashdr;
|
||||||
|
@ -483,13 +483,13 @@ gl_Mod_MakeAliasModelDisplayLists (model_t *m, aliashdr_t *hdr, void *_m,
|
||||||
} else {
|
} else {
|
||||||
tex_coord_t *tex_coord;
|
tex_coord_t *tex_coord;
|
||||||
|
|
||||||
numorder = 0;
|
numorder = 0;
|
||||||
for (i=0; i < pheader->mdl.numtris; i++) {
|
for (i=0; i < pheader->mdl.numtris; i++) {
|
||||||
add_vertex(triangles[i].vertindex[0]);
|
add_vertex(triangles[i].vertindex[0]);
|
||||||
add_vertex(triangles[i].vertindex[1]);
|
add_vertex(triangles[i].vertindex[1]);
|
||||||
add_vertex(triangles[i].vertindex[2]);
|
add_vertex(triangles[i].vertindex[2]);
|
||||||
}
|
}
|
||||||
paliashdr->poseverts = numorder;
|
paliashdr->poseverts = numorder;
|
||||||
|
|
||||||
tex_coord = Hunk_Alloc (numorder * sizeof(tex_coord_t));
|
tex_coord = Hunk_Alloc (numorder * sizeof(tex_coord_t));
|
||||||
paliashdr->tex_coord = (byte *) tex_coord - (byte *) paliashdr;
|
paliashdr->tex_coord = (byte *) tex_coord - (byte *) paliashdr;
|
||||||
|
|
|
@ -122,7 +122,7 @@ gl_Mod_LoadExternalTextures (model_t *mod)
|
||||||
if (luma) {
|
if (luma) {
|
||||||
tx->gl_fb_texturenum =
|
tx->gl_fb_texturenum =
|
||||||
GL_LoadTexture (va ("fb_%s", tx->name), luma->width,
|
GL_LoadTexture (va ("fb_%s", tx->name), luma->width,
|
||||||
luma->height, luma->data, true, true,
|
luma->height, luma->data, true, true,
|
||||||
luma->format > 2 ? luma->format : 1);
|
luma->format > 2 ? luma->format : 1);
|
||||||
} else if (base->format < 3) {
|
} else if (base->format < 3) {
|
||||||
tx->gl_fb_texturenum =
|
tx->gl_fb_texturenum =
|
||||||
|
|
|
@ -45,7 +45,7 @@ VISIBLE int
|
||||||
Mod_CalcFullbright (byte *in, byte *out, int pixels)
|
Mod_CalcFullbright (byte *in, byte *out, int pixels)
|
||||||
{
|
{
|
||||||
int fb = 0;
|
int fb = 0;
|
||||||
|
|
||||||
while (pixels--) {
|
while (pixels--) {
|
||||||
if (*in >= 256 - 32) {
|
if (*in >= 256 - 32) {
|
||||||
fb = 1;
|
fb = 1;
|
||||||
|
|
|
@ -574,7 +574,7 @@ blend_compare (void *e1, void *e2, void *unused)
|
||||||
|
|
||||||
#define MAX_BLENDS 1024
|
#define MAX_BLENDS 1024
|
||||||
|
|
||||||
iqmblend_t *
|
iqmblend_t *
|
||||||
Mod_IQMBuildBlendPalette (iqm_t *iqm, int *size)
|
Mod_IQMBuildBlendPalette (iqm_t *iqm, int *size)
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
|
@ -296,7 +296,7 @@ run_test (test_t *test)
|
||||||
test->start[0], test->start[1], test->start[2],
|
test->start[0], test->start[1], test->start[2],
|
||||||
test->end[0], test->end[1], test->end[2],
|
test->end[0], test->end[1], test->end[2],
|
||||||
end[0], end[1], end[2],
|
end[0], end[1], end[2],
|
||||||
test->expect.frac,
|
test->expect.frac,
|
||||||
test->expect.allsolid, test->expect.startsolid,
|
test->expect.allsolid, test->expect.startsolid,
|
||||||
test->expect.inopen, test->expect.inwater);
|
test->expect.inopen, test->expect.inwater);
|
||||||
trace_t trace = do_trace (test->box, test->hull, test->start, test->end);
|
trace_t trace = do_trace (test->box, test->hull, test->start, test->end);
|
||||||
|
@ -305,7 +305,7 @@ run_test (test_t *test)
|
||||||
test->start[0], test->start[1], test->start[2],
|
test->start[0], test->start[1], test->start[2],
|
||||||
test->end[0], test->end[1], test->end[2],
|
test->end[0], test->end[1], test->end[2],
|
||||||
trace.endpos[0], trace.endpos[1], trace.endpos[2],
|
trace.endpos[0], trace.endpos[1], trace.endpos[2],
|
||||||
trace.fraction,
|
trace.fraction,
|
||||||
trace.allsolid, trace.startsolid,
|
trace.allsolid, trace.startsolid,
|
||||||
trace.inopen, trace.inwater);
|
trace.inopen, trace.inwater);
|
||||||
if (!(VectorCompare (end, trace.endpos)
|
if (!(VectorCompare (end, trace.endpos)
|
||||||
|
|
|
@ -12,10 +12,10 @@ HullPointContents (hull_t *hull, int num, const vec3_t p)
|
||||||
{
|
{
|
||||||
if (num < hull->firstclipnode || num > hull->lastclipnode)
|
if (num < hull->firstclipnode || num > hull->lastclipnode)
|
||||||
Sys_Error ("HullPointContents: bad node number");
|
Sys_Error ("HullPointContents: bad node number");
|
||||||
|
|
||||||
node = hull->clipnodes + num;
|
node = hull->clipnodes + num;
|
||||||
plane = hull->planes + node->planenum;
|
plane = hull->planes + node->planenum;
|
||||||
|
|
||||||
if (plane->type < 3)
|
if (plane->type < 3)
|
||||||
d = p[plane->type] - plane->dist;
|
d = p[plane->type] - plane->dist;
|
||||||
else
|
else
|
||||||
|
@ -25,7 +25,7 @@ HullPointContents (hull_t *hull, int num, const vec3_t p)
|
||||||
else
|
else
|
||||||
num = node->children[0];
|
num = node->children[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
return num;
|
return num;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,7 +81,7 @@ SV_RecursiveHullCheck (hull_t *hull, int num, float p1f, float p2f, const vec3_t
|
||||||
t1 = DotProduct (plane->normal, p1) - plane->dist;
|
t1 = DotProduct (plane->normal, p1) - plane->dist;
|
||||||
t2 = DotProduct (plane->normal, p2) - plane->dist;
|
t2 = DotProduct (plane->normal, p2) - plane->dist;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (t1 >= 0 && t2 >= 0)
|
if (t1 >= 0 && t2 >= 0)
|
||||||
return SV_RecursiveHullCheck (hull, node->children[0], p1f, p2f, p1, p2, trace);
|
return SV_RecursiveHullCheck (hull, node->children[0], p1f, p2f, p1, p2, trace);
|
||||||
if (t1 < 0 && t2 < 0)
|
if (t1 < 0 && t2 < 0)
|
||||||
|
@ -96,7 +96,7 @@ SV_RecursiveHullCheck (hull_t *hull, int num, float p1f, float p2f, const vec3_t
|
||||||
frac = 0;
|
frac = 0;
|
||||||
if (frac > 1)
|
if (frac > 1)
|
||||||
frac = 1;
|
frac = 1;
|
||||||
|
|
||||||
midf = p1f + (p2f - p1f)*frac;
|
midf = p1f + (p2f - p1f)*frac;
|
||||||
for (i=0 ; i<3 ; i++)
|
for (i=0 ; i<3 ; i++)
|
||||||
mid[i] = p1[i] + frac*(p2[i] - p1[i]);
|
mid[i] = p1[i] + frac*(p2[i] - p1[i]);
|
||||||
|
@ -111,10 +111,10 @@ SV_RecursiveHullCheck (hull_t *hull, int num, float p1f, float p2f, const vec3_t
|
||||||
!= CONTENTS_SOLID)
|
!= CONTENTS_SOLID)
|
||||||
// go past the node
|
// go past the node
|
||||||
return SV_RecursiveHullCheck (hull, node->children[side^1], midf, p2f, mid, p2, trace);
|
return SV_RecursiveHullCheck (hull, node->children[side^1], midf, p2f, mid, p2, trace);
|
||||||
|
|
||||||
if (trace->allsolid)
|
if (trace->allsolid)
|
||||||
return false; // never got out of the solid area
|
return false; // never got out of the solid area
|
||||||
|
|
||||||
//==================
|
//==================
|
||||||
// the other side of the node is solid, this is the impact point
|
// the other side of the node is solid, this is the impact point
|
||||||
//==================
|
//==================
|
||||||
|
|
|
@ -571,7 +571,7 @@ portal_intersect (trace_t *trace, clipport_t *portal, plane_t *plane,
|
||||||
// if both ends of the box edge are on the same side (or touching) the
|
// if both ends of the box edge are on the same side (or touching) the
|
||||||
// plane, the edge does not cross the plane
|
// plane, the edge does not cross the plane
|
||||||
// if only one end of the edge is touching, then we still have to
|
// if only one end of the edge is touching, then we still have to
|
||||||
// check the impact point.
|
// check the impact point.
|
||||||
if ((t1 > 0 && t2 > 0) || (t1 < 0 && t2 < 0) || (t1 == t2))
|
if ((t1 > 0 && t2 > 0) || (t1 < 0 && t2 < 0) || (t1 == t2))
|
||||||
continue;
|
continue;
|
||||||
if (t1 == t2) {
|
if (t1 == t2) {
|
||||||
|
|
|
@ -174,7 +174,7 @@ Netchan_CanPacket (netchan_t *chan)
|
||||||
/*
|
/*
|
||||||
Netchan_CanReliable
|
Netchan_CanReliable
|
||||||
|
|
||||||
Returns true if the bandwidth choke isn't
|
Returns true if the bandwidth choke isn't
|
||||||
*/
|
*/
|
||||||
qboolean
|
qboolean
|
||||||
Netchan_CanReliable (netchan_t *chan)
|
Netchan_CanReliable (netchan_t *chan)
|
||||||
|
@ -346,7 +346,7 @@ Netchan_Process (netchan_t *chan)
|
||||||
chan->reliable_length = 0; // it has been received
|
chan->reliable_length = 0; // it has been received
|
||||||
|
|
||||||
/// If this message contains a reliable message, bump
|
/// If this message contains a reliable message, bump
|
||||||
/// incoming_reliable_sequence
|
/// incoming_reliable_sequence
|
||||||
chan->incoming_sequence = sequence;
|
chan->incoming_sequence = sequence;
|
||||||
chan->incoming_acknowledged = sequence_ack;
|
chan->incoming_acknowledged = sequence_ack;
|
||||||
chan->incoming_reliable_acknowledged = reliable_ack;
|
chan->incoming_reliable_acknowledged = reliable_ack;
|
||||||
|
|
|
@ -1059,7 +1059,7 @@ _Datagram_CheckNewConnections (void)
|
||||||
NET_FreeQSocket (sock);
|
NET_FreeQSocket (sock);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
// everything is allocated, just fill in the details
|
// everything is allocated, just fill in the details
|
||||||
sock->socket = newsock;
|
sock->socket = newsock;
|
||||||
sock->landriver = net_landriverlevel;
|
sock->landriver = net_landriverlevel;
|
||||||
sock->addr = clientaddr;
|
sock->addr = clientaddr;
|
||||||
|
|
|
@ -199,7 +199,7 @@ PF_break (progs_t *pr)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
float (string s) cvar
|
float (string s) cvar
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
PF_cvar (progs_t *pr)
|
PF_cvar (progs_t *pr)
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#include "QF/cmd.h"
|
#include "QF/cmd.h"
|
||||||
#include "QF/hash.h"
|
#include "QF/hash.h"
|
||||||
|
|
|
@ -162,7 +162,7 @@ create_tree_of_subclasses_inherited_from (progs_t *pr, pr_class_t *bottom,
|
||||||
const char *super_class = PR_GetString (pr, bottom->super_class);
|
const char *super_class = PR_GetString (pr, bottom->super_class);
|
||||||
pr_class_t *superclass;
|
pr_class_t *superclass;
|
||||||
class_tree *tree, *prev;
|
class_tree *tree, *prev;
|
||||||
|
|
||||||
superclass = bottom->super_class ? Hash_Find (pr->classes, super_class)
|
superclass = bottom->super_class ? Hash_Find (pr->classes, super_class)
|
||||||
: 0;
|
: 0;
|
||||||
tree = prev = class_tree_new ();
|
tree = prev = class_tree_new ();
|
||||||
|
@ -943,7 +943,7 @@ rua_obj_error (progs_t *pr)
|
||||||
const char *fmt = P_GSTRING (pr, 2);
|
const char *fmt = P_GSTRING (pr, 2);
|
||||||
int count = pr->pr_argc - 3;
|
int count = pr->pr_argc - 3;
|
||||||
pr_type_t *args = pr->pr_params[3];
|
pr_type_t *args = pr->pr_params[3];
|
||||||
|
|
||||||
obj_verror (pr, object, code, fmt, count, args);
|
obj_verror (pr, object, code, fmt, count, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1259,7 +1259,7 @@ rua_class_create_instance (progs_t *pr)
|
||||||
{
|
{
|
||||||
pr_class_t *class = &P_STRUCT (pr, pr_class_t, 0);
|
pr_class_t *class = &P_STRUCT (pr, pr_class_t, 0);
|
||||||
pr_id_t *id = class_create_instance (pr, class);
|
pr_id_t *id = class_create_instance (pr, class);
|
||||||
|
|
||||||
RETURN_POINTER (pr, id);
|
RETURN_POINTER (pr, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1494,7 +1494,7 @@ rua__i_Object_error_error_ (progs_t *pr)
|
||||||
dstring_t *dstr = dstring_new ();
|
dstring_t *dstr = dstring_new ();
|
||||||
int count = pr->pr_argc - 3;
|
int count = pr->pr_argc - 3;
|
||||||
pr_type_t *args = pr->pr_params[3];
|
pr_type_t *args = pr->pr_params[3];
|
||||||
|
|
||||||
dsprintf (dstr, "error: %s (%s)\n%s",
|
dsprintf (dstr, "error: %s (%s)\n%s",
|
||||||
PR_GetString (pr, object_get_class_name (pr, self)),
|
PR_GetString (pr, object_get_class_name (pr, self)),
|
||||||
object_is_instance (pr, self) ? "instance" : "class", fmt);
|
object_is_instance (pr, self) ? "instance" : "class", fmt);
|
||||||
|
@ -1531,7 +1531,7 @@ static builtin_t obj_methods [] = {
|
||||||
{"obj_get_uninstalled_dtable", rua_obj_get_uninstalled_dtable, -1},
|
{"obj_get_uninstalled_dtable", rua_obj_get_uninstalled_dtable, -1},
|
||||||
{"obj_msgSend", rua_obj_msgSend, -1},
|
{"obj_msgSend", rua_obj_msgSend, -1},
|
||||||
{"obj_msgSend_super", rua_obj_msgSend_super, -1},
|
{"obj_msgSend_super", rua_obj_msgSend_super, -1},
|
||||||
|
|
||||||
{"obj_get_class", rua_obj_get_class, -1},
|
{"obj_get_class", rua_obj_get_class, -1},
|
||||||
{"obj_lookup_class", rua_obj_lookup_class, -1},
|
{"obj_lookup_class", rua_obj_lookup_class, -1},
|
||||||
{"obj_next_class", rua_obj_next_class, -1},
|
{"obj_next_class", rua_obj_next_class, -1},
|
||||||
|
|
|
@ -109,7 +109,7 @@ plist_handle (plist_resources_t *res, plitem_t *plitem)
|
||||||
{
|
{
|
||||||
bi_plist_t dummy = {0, 0, plitem, 0};
|
bi_plist_t dummy = {0, 0, plitem, 0};
|
||||||
bi_plist_t *plist = Hash_FindElement (res->plist_tab, &dummy);
|
bi_plist_t *plist = Hash_FindElement (res->plist_tab, &dummy);
|
||||||
|
|
||||||
if (plist)
|
if (plist)
|
||||||
return plist_index (res, plist);
|
return plist_index (res, plist);
|
||||||
|
|
||||||
|
@ -193,8 +193,8 @@ bi_PL_GetFromFile (progs_t *pr)
|
||||||
Qread (file, buf, len);
|
Qread (file, buf, len);
|
||||||
buf[len] = 0;
|
buf[len] = 0;
|
||||||
|
|
||||||
plitem = PL_GetPropertyList (buf);
|
plitem = PL_GetPropertyList (buf);
|
||||||
|
|
||||||
R_INT (pr) = plist_retain (res, plitem);
|
R_INT (pr) = plist_retain (res, plitem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -202,8 +202,8 @@ static void
|
||||||
bi_PL_GetPropertyList (progs_t *pr)
|
bi_PL_GetPropertyList (progs_t *pr)
|
||||||
{
|
{
|
||||||
plist_resources_t *res = PR_Resources_Find (pr, "plist");
|
plist_resources_t *res = PR_Resources_Find (pr, "plist");
|
||||||
plitem_t *plitem = PL_GetPropertyList (P_GSTRING (pr, 0));
|
plitem_t *plitem = PL_GetPropertyList (P_GSTRING (pr, 0));
|
||||||
|
|
||||||
R_INT (pr) = plist_retain (res, plitem);
|
R_INT (pr) = plist_retain (res, plitem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -363,7 +363,7 @@ bi_PL_NewDictionary (progs_t *pr)
|
||||||
{
|
{
|
||||||
plist_resources_t *res = PR_Resources_Find (pr, "plist");
|
plist_resources_t *res = PR_Resources_Find (pr, "plist");
|
||||||
plitem_t *plitem = PL_NewDictionary ();
|
plitem_t *plitem = PL_NewDictionary ();
|
||||||
|
|
||||||
R_INT (pr) = plist_retain (res, plitem);
|
R_INT (pr) = plist_retain (res, plitem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -372,7 +372,7 @@ bi_PL_NewArray (progs_t *pr)
|
||||||
{
|
{
|
||||||
plist_resources_t *res = PR_Resources_Find (pr, "plist");
|
plist_resources_t *res = PR_Resources_Find (pr, "plist");
|
||||||
plitem_t *plitem = PL_NewArray ();
|
plitem_t *plitem = PL_NewArray ();
|
||||||
|
|
||||||
R_INT (pr) = plist_retain (res, plitem);
|
R_INT (pr) = plist_retain (res, plitem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -382,7 +382,7 @@ bi_PL_NewData (progs_t *pr)
|
||||||
//FIXME not safe
|
//FIXME not safe
|
||||||
plist_resources_t *res = PR_Resources_Find (pr, "plist");
|
plist_resources_t *res = PR_Resources_Find (pr, "plist");
|
||||||
plitem_t *plitem = PL_NewData (P_GPOINTER (pr, 0), P_INT (pr, 1));
|
plitem_t *plitem = PL_NewData (P_GPOINTER (pr, 0), P_INT (pr, 1));
|
||||||
|
|
||||||
R_INT (pr) = plist_retain (res, plitem);
|
R_INT (pr) = plist_retain (res, plitem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -391,7 +391,7 @@ bi_PL_NewString (progs_t *pr)
|
||||||
{
|
{
|
||||||
plist_resources_t *res = PR_Resources_Find (pr, "plist");
|
plist_resources_t *res = PR_Resources_Find (pr, "plist");
|
||||||
plitem_t *plitem = PL_NewString (P_GSTRING (pr, 0));
|
plitem_t *plitem = PL_NewString (P_GSTRING (pr, 0));
|
||||||
|
|
||||||
R_INT (pr) = plist_retain (res, plitem);
|
R_INT (pr) = plist_retain (res, plitem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
bspfile.c
|
bspfile.c
|
||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
|
|
||||||
Copyright (C) 1996-1997 Id Software, Inc.
|
Copyright (C) 1996-1997 Id Software, Inc.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
|
@ -73,7 +73,7 @@ swap_bsp (bsp_t *bsp, int todisk, void (*cb) (const bsp_t *, void *),
|
||||||
d->visleafs = LittleLong (d->visleafs);
|
d->visleafs = LittleLong (d->visleafs);
|
||||||
d->firstface = LittleLong (d->firstface);
|
d->firstface = LittleLong (d->firstface);
|
||||||
d->numfaces = LittleLong (d->numfaces);
|
d->numfaces = LittleLong (d->numfaces);
|
||||||
|
|
||||||
for (j=0 ; j<3 ; j++) {
|
for (j=0 ; j<3 ; j++) {
|
||||||
d->mins[j] = LittleFloat(d->mins[j]);
|
d->mins[j] = LittleFloat(d->mins[j]);
|
||||||
d->maxs[j] = LittleFloat(d->maxs[j]);
|
d->maxs[j] = LittleFloat(d->maxs[j]);
|
||||||
|
@ -87,7 +87,7 @@ swap_bsp (bsp_t *bsp, int todisk, void (*cb) (const bsp_t *, void *),
|
||||||
for (j=0 ; j<3 ; j++)
|
for (j=0 ; j<3 ; j++)
|
||||||
vertex->point[j] = LittleFloat (vertex->point[j]);
|
vertex->point[j] = LittleFloat (vertex->point[j]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// planes
|
// planes
|
||||||
for (i=0 ; i<bsp->numplanes ; i++) {
|
for (i=0 ; i<bsp->numplanes ; i++) {
|
||||||
dplane_t *plane = &bsp->planes[i];
|
dplane_t *plane = &bsp->planes[i];
|
||||||
|
@ -96,7 +96,7 @@ swap_bsp (bsp_t *bsp, int todisk, void (*cb) (const bsp_t *, void *),
|
||||||
plane->dist = LittleFloat (plane->dist);
|
plane->dist = LittleFloat (plane->dist);
|
||||||
plane->type = LittleLong (plane->type);
|
plane->type = LittleLong (plane->type);
|
||||||
}
|
}
|
||||||
|
|
||||||
// texinfos
|
// texinfos
|
||||||
for (i=0 ; i<bsp->numtexinfo ; i++) {
|
for (i=0 ; i<bsp->numtexinfo ; i++) {
|
||||||
texinfo_t *texinfo = &bsp->texinfo[i];
|
texinfo_t *texinfo = &bsp->texinfo[i];
|
||||||
|
@ -105,7 +105,7 @@ swap_bsp (bsp_t *bsp, int todisk, void (*cb) (const bsp_t *, void *),
|
||||||
texinfo->miptex = LittleLong (texinfo->miptex);
|
texinfo->miptex = LittleLong (texinfo->miptex);
|
||||||
texinfo->flags = LittleLong (texinfo->flags);
|
texinfo->flags = LittleLong (texinfo->flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
// faces
|
// faces
|
||||||
for (i=0 ; i<bsp->numfaces ; i++) {
|
for (i=0 ; i<bsp->numfaces ; i++) {
|
||||||
dface_t *face = &bsp->faces[i];
|
dface_t *face = &bsp->faces[i];
|
||||||
|
@ -164,7 +164,7 @@ swap_bsp (bsp_t *bsp, int todisk, void (*cb) (const bsp_t *, void *),
|
||||||
for (i=0 ; i<c ; i++)
|
for (i=0 ; i<c ; i++)
|
||||||
mtl->dataofs[i] = LittleLong(mtl->dataofs[i]);
|
mtl->dataofs[i] = LittleLong(mtl->dataofs[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// marksurfaces
|
// marksurfaces
|
||||||
for (i=0 ; i<bsp->nummarksurfaces ; i++) {
|
for (i=0 ; i<bsp->nummarksurfaces ; i++) {
|
||||||
uint16_t *marksurface = &bsp->marksurfaces[i];
|
uint16_t *marksurface = &bsp->marksurfaces[i];
|
||||||
|
|
|
@ -116,7 +116,7 @@ VISIBLE void
|
||||||
Cbuf_DeleteStack (cbuf_t *stack)
|
Cbuf_DeleteStack (cbuf_t *stack)
|
||||||
{
|
{
|
||||||
cbuf_t *next;
|
cbuf_t *next;
|
||||||
|
|
||||||
for (; stack; stack = next) {
|
for (; stack; stack = next) {
|
||||||
next = stack->down;
|
next = stack->down;
|
||||||
Cbuf_Delete (stack);
|
Cbuf_Delete (stack);
|
||||||
|
@ -182,7 +182,7 @@ VISIBLE void
|
||||||
Cbuf_Execute_Stack (cbuf_t *cbuf)
|
Cbuf_Execute_Stack (cbuf_t *cbuf)
|
||||||
{
|
{
|
||||||
cbuf_t *sp;
|
cbuf_t *sp;
|
||||||
|
|
||||||
if (cbuf->resumetime) {
|
if (cbuf->resumetime) {
|
||||||
if (cbuf->resumetime < Sys_DoubleTime())
|
if (cbuf->resumetime < Sys_DoubleTime())
|
||||||
cbuf->resumetime = 0;
|
cbuf->resumetime = 0;
|
||||||
|
@ -208,7 +208,7 @@ Cbuf_Execute_Stack (cbuf_t *cbuf)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sp->state = CBUF_STATE_JUNK;
|
sp->state = CBUF_STATE_JUNK;
|
||||||
sp = sp->up;
|
sp = sp->up;
|
||||||
}
|
}
|
||||||
if (cbuf->down) {
|
if (cbuf->down) {
|
||||||
|
|
|
@ -108,7 +108,7 @@ static byte chktbl[1024 + 4] = {
|
||||||
0x20, 0xf0, 0x3a, 0xfa, 0x80, 0x4d, 0x2c, 0x7d,
|
0x20, 0xf0, 0x3a, 0xfa, 0x80, 0x4d, 0x2c, 0x7d,
|
||||||
0xac, 0x60, 0x09, 0xc0, 0x40, 0xee, 0xb9, 0xeb,
|
0xac, 0x60, 0x09, 0xc0, 0x40, 0xee, 0xb9, 0xeb,
|
||||||
0x13, 0x5b, 0xe8, 0x2b, 0xb1, 0x20, 0xf0, 0xce,
|
0x13, 0x5b, 0xe8, 0x2b, 0xb1, 0x20, 0xf0, 0xce,
|
||||||
0x4c, 0xbd, 0xc6, 0x04, 0x86, 0x70, 0xc6, 0x33,
|
0x4c, 0xbd, 0xc6, 0x04, 0x86, 0x70, 0xc6, 0x33,
|
||||||
0xc3, 0x15, 0x0f, 0x65, 0x19, 0xfd, 0xc2, 0xd3,
|
0xc3, 0x15, 0x0f, 0x65, 0x19, 0xfd, 0xc2, 0xd3,
|
||||||
|
|
||||||
// map checksum goes here
|
// map checksum goes here
|
||||||
|
|
|
@ -610,7 +610,7 @@ Cmd_Init (void)
|
||||||
cmd_warncmd = Cvar_Get ("cmd_warncmd", "0", CVAR_NONE, NULL, "Toggles the "
|
cmd_warncmd = Cvar_Get ("cmd_warncmd", "0", CVAR_NONE, NULL, "Toggles the "
|
||||||
"display of error messages for unknown commands");
|
"display of error messages for unknown commands");
|
||||||
cmd_cbuf = Cbuf_New (&id_interp);
|
cmd_cbuf = Cbuf_New (&id_interp);
|
||||||
|
|
||||||
Cmd_AddProvider("id", &id_interp);
|
Cmd_AddProvider("id", &id_interp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -661,7 +661,7 @@ VISIBLE void
|
||||||
Cmd_AddProvider(const char *name, cbuf_interpreter_t *interp)
|
Cmd_AddProvider(const char *name, cbuf_interpreter_t *interp)
|
||||||
{
|
{
|
||||||
cmd_provider_t *p = (cmd_provider_t *) Hash_Find (cmd_provider_hash, name);
|
cmd_provider_t *p = (cmd_provider_t *) Hash_Find (cmd_provider_hash, name);
|
||||||
|
|
||||||
if (!p)
|
if (!p)
|
||||||
{
|
{
|
||||||
cmd_provider_t *p = malloc(sizeof(cmd_provider_t));
|
cmd_provider_t *p = malloc(sizeof(cmd_provider_t));
|
||||||
|
@ -675,7 +675,7 @@ VISIBLE cbuf_interpreter_t *
|
||||||
Cmd_GetProvider(const char *name)
|
Cmd_GetProvider(const char *name)
|
||||||
{
|
{
|
||||||
cmd_provider_t *p = (cmd_provider_t *) Hash_Find (cmd_provider_hash, name);
|
cmd_provider_t *p = (cmd_provider_t *) Hash_Find (cmd_provider_hash, name);
|
||||||
|
|
||||||
if (!p)
|
if (!p)
|
||||||
return NULL;
|
return NULL;
|
||||||
else
|
else
|
||||||
|
|
|
@ -202,18 +202,18 @@ Cvar_CompleteCountPossible (const char *partial)
|
||||||
cvar_t *cvar;
|
cvar_t *cvar;
|
||||||
int len;
|
int len;
|
||||||
int h;
|
int h;
|
||||||
|
|
||||||
h = 0;
|
h = 0;
|
||||||
len = strlen(partial);
|
len = strlen(partial);
|
||||||
|
|
||||||
if (!len)
|
if (!len)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
// Loop through the cvars and count all possible matches
|
// Loop through the cvars and count all possible matches
|
||||||
for (cvar = cvar_vars; cvar; cvar = cvar->next)
|
for (cvar = cvar_vars; cvar; cvar = cvar->next)
|
||||||
if (!strncmp(partial, cvar->name, len))
|
if (!strncmp(partial, cvar->name, len))
|
||||||
h++;
|
h++;
|
||||||
|
|
||||||
return h;
|
return h;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -245,7 +245,7 @@ Cvar_CompleteBuildList (const char *partial)
|
||||||
|
|
||||||
buf[bpos] = NULL;
|
buf[bpos] = NULL;
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
VISIBLE void
|
VISIBLE void
|
||||||
Cvar_Set (cvar_t *var, const char *value)
|
Cvar_Set (cvar_t *var, const char *value)
|
||||||
|
@ -640,7 +640,7 @@ Cvar_Shutdown (void)
|
||||||
free (var);
|
free (var);
|
||||||
var = next;
|
var = next;
|
||||||
}
|
}
|
||||||
// Free aliases
|
// Free aliases
|
||||||
alias = calias_vars;
|
alias = calias_vars;
|
||||||
while (alias) {
|
while (alias) {
|
||||||
nextalias = alias->next;
|
nextalias = alias->next;
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
/*
|
/*
|
||||||
* dirent.c
|
* dirent.c
|
||||||
*
|
*
|
||||||
* Derived from DIRLIB.C by Matt J. Weinstein
|
* Derived from DIRLIB.C by Matt J. Weinstein
|
||||||
* This note appears in the DIRLIB.H
|
* This note appears in the DIRLIB.H
|
||||||
* DIRLIB.H by M. J. Weinstein Released to public domain 1-Jan-89
|
* DIRLIB.H by M. J. Weinstein Released to public domain 1-Jan-89
|
||||||
*
|
*
|
||||||
* Updated by Jeremy Bettis <jeremy@hksys.com>
|
* Updated by Jeremy Bettis <jeremy@hksys.com>
|
||||||
* Significantly revised and rewinddir, seekdir and telldir added by Colin
|
* Significantly revised and rewinddir, seekdir and telldir added by Colin
|
||||||
* Peters <colin@fu.is.saga-u.ac.jp>
|
* Peters <colin@fu.is.saga-u.ac.jp>
|
||||||
*
|
*
|
||||||
* $Revision$
|
* $Revision$
|
||||||
* $Author$
|
* $Author$
|
||||||
* $Date$
|
* $Date$
|
||||||
|
|
|
@ -329,7 +329,7 @@ _dvsprintf (dstring_t *dstr, int offs, const char *fmt, va_list args)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
dstr->size = size + offs + 2;
|
dstr->size = size + offs + 2;
|
||||||
// "Proper" implementations return the required size
|
// "Proper" implementations return the required size
|
||||||
if (dstr->size > dstr->truesize) {
|
if (dstr->size > dstr->truesize) {
|
||||||
dstring_adjust (dstr);
|
dstring_adjust (dstr);
|
||||||
#ifdef VA_LIST_IS_ARRAY
|
#ifdef VA_LIST_IS_ARRAY
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
Boston, MA 02111-1307, USA. */
|
Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>.
|
/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>.
|
||||||
Ditto for AIX 3.2 and <stdlib.h>. */
|
Ditto for AIX 3.2 and <stdlib.h>. */
|
||||||
#ifndef _NO_PROTO
|
#ifndef _NO_PROTO
|
||||||
|
@ -188,7 +188,7 @@ static enum
|
||||||
|
|
||||||
/* Value of POSIXLY_CORRECT environment variable. */
|
/* Value of POSIXLY_CORRECT environment variable. */
|
||||||
static char *posixly_correct;
|
static char *posixly_correct;
|
||||||
|
|
||||||
#ifdef __GNU_LIBRARY__
|
#ifdef __GNU_LIBRARY__
|
||||||
/* We want to avoid inclusion of string.h with non-GNU libraries
|
/* We want to avoid inclusion of string.h with non-GNU libraries
|
||||||
because there are many ways it can cause trouble.
|
because there are many ways it can cause trouble.
|
||||||
|
@ -241,7 +241,7 @@ extern int strlen (const char *);
|
||||||
#endif /* __GNUC__ */
|
#endif /* __GNUC__ */
|
||||||
|
|
||||||
#endif /* not __GNU_LIBRARY__ */
|
#endif /* not __GNU_LIBRARY__ */
|
||||||
|
|
||||||
/* Handle permutation of arguments. */
|
/* Handle permutation of arguments. */
|
||||||
|
|
||||||
/* Describe the part of ARGV that contains non-options that have
|
/* Describe the part of ARGV that contains non-options that have
|
||||||
|
@ -454,7 +454,7 @@ _getopt_initialize (argc, argv, optstring)
|
||||||
|
|
||||||
return optstring;
|
return optstring;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Scan elements of ARGV (whose length is ARGC) for option characters
|
/* Scan elements of ARGV (whose length is ARGC) for option characters
|
||||||
given in OPTSTRING.
|
given in OPTSTRING.
|
||||||
|
|
||||||
|
@ -984,7 +984,7 @@ getopt (argc, argv, optstring)
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* Not ELIDE_CODE. */
|
#endif /* Not ELIDE_CODE. */
|
||||||
|
|
||||||
#ifdef TEST
|
#ifdef TEST
|
||||||
|
|
||||||
/* Compile with -DTEST to make an executable for use in testing
|
/* Compile with -DTEST to make an executable for use in testing
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
Boston, MA 02111-1307, USA. */
|
Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -92,7 +92,7 @@ getopt_long_only (argc, argv, options, long_options, opt_index)
|
||||||
|
|
||||||
|
|
||||||
#endif /* Not ELIDE_CODE. */
|
#endif /* Not ELIDE_CODE. */
|
||||||
|
|
||||||
#ifdef TEST
|
#ifdef TEST
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
|
@ -104,7 +104,7 @@ Hash_String (const char *str)
|
||||||
}
|
}
|
||||||
return h;
|
return h;
|
||||||
#else
|
#else
|
||||||
// dx_hack_hash
|
// dx_hack_hash
|
||||||
// shamelessly stolen from Daniel Phillips <phillips@innominate.de>
|
// shamelessly stolen from Daniel Phillips <phillips@innominate.de>
|
||||||
// from his post to lkml
|
// from his post to lkml
|
||||||
unsigned long hash0 = 0x12a3fe2d, hash1 = 0x37abe8f9;
|
unsigned long hash0 = 0x12a3fe2d, hash1 = 0x37abe8f9;
|
||||||
|
@ -131,7 +131,7 @@ Hash_Buffer (const void *_buf, int len)
|
||||||
}
|
}
|
||||||
return h;
|
return h;
|
||||||
#else
|
#else
|
||||||
// dx_hack_hash
|
// dx_hack_hash
|
||||||
// shamelessly stolen from Daniel Phillips <phillips@innominate.de>
|
// shamelessly stolen from Daniel Phillips <phillips@innominate.de>
|
||||||
// from his post to lkml
|
// from his post to lkml
|
||||||
unsigned long hash0 = 0x12a3fe2d, hash1 = 0x37abe8f9;
|
unsigned long hash0 = 0x12a3fe2d, hash1 = 0x37abe8f9;
|
||||||
|
@ -163,7 +163,7 @@ get_index (uintptr_t hash, size_t size, size_t bits)
|
||||||
#if 0
|
#if 0
|
||||||
unsigned long mask = ~0UL << bits;
|
unsigned long mask = ~0UL << bits;
|
||||||
unsigned long extract;
|
unsigned long extract;
|
||||||
|
|
||||||
size -= 1;
|
size -= 1;
|
||||||
for (extract = (hash & mask) >> bits;
|
for (extract = (hash & mask) >> bits;
|
||||||
extract;
|
extract;
|
||||||
|
|
|
@ -51,7 +51,7 @@ static void
|
||||||
COM_construct (cbuf_t *cbuf)
|
COM_construct (cbuf_t *cbuf)
|
||||||
{
|
{
|
||||||
idbuf_t *new = calloc (1, sizeof (idbuf_t));
|
idbuf_t *new = calloc (1, sizeof (idbuf_t));
|
||||||
|
|
||||||
new->buf = dstring_newstr();
|
new->buf = dstring_newstr();
|
||||||
new->line = dstring_newstr();
|
new->line = dstring_newstr();
|
||||||
cbuf->data = new;
|
cbuf->data = new;
|
||||||
|
@ -97,7 +97,7 @@ COM_Parse (const char *data)
|
||||||
if (!_com_token)
|
if (!_com_token)
|
||||||
_com_token = dstring_newstr ();
|
_com_token = dstring_newstr ();
|
||||||
com_token = _com_token->str;
|
com_token = _com_token->str;
|
||||||
|
|
||||||
if (!data)
|
if (!data)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|
|
@ -209,7 +209,7 @@ pack_add (pack_t *pack, const char *filename)
|
||||||
return -1;
|
return -1;
|
||||||
if (pack->numfiles == pack->files_size) {
|
if (pack->numfiles == pack->files_size) {
|
||||||
dpackfile_t *f;
|
dpackfile_t *f;
|
||||||
|
|
||||||
pack->files_size += 64;
|
pack->files_size += 64;
|
||||||
|
|
||||||
f = realloc (pack->files, pack->files_size * sizeof (dpackfile_t));
|
f = realloc (pack->files, pack->files_size * sizeof (dpackfile_t));
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue