mirror of
https://github.com/YGGverse/hlsdk-portable.git
synced 2025-02-04 11:04:28 +00:00
Merge branch 'master' into echoes
This commit is contained in:
commit
2156175454
@ -825,7 +825,7 @@ bool CHudSpectator::ParseOverviewFile()
|
|||||||
char token[1024] = { 0 };
|
char token[1024] = { 0 };
|
||||||
float height;
|
float height;
|
||||||
|
|
||||||
char *pfile = NULL;
|
char *afile = NULL, *pfile = NULL;
|
||||||
|
|
||||||
memset( &m_OverviewData, 0, sizeof(m_OverviewData) );
|
memset( &m_OverviewData, 0, sizeof(m_OverviewData) );
|
||||||
|
|
||||||
@ -850,7 +850,7 @@ bool CHudSpectator::ParseOverviewFile()
|
|||||||
|
|
||||||
sprintf( filename, "overviews/%s.txt", levelname );
|
sprintf( filename, "overviews/%s.txt", levelname );
|
||||||
|
|
||||||
pfile = (char *)gEngfuncs.COM_LoadFile( filename, 5, NULL );
|
afile = pfile = (char *)gEngfuncs.COM_LoadFile( filename, 5, NULL );
|
||||||
|
|
||||||
if( !pfile )
|
if( !pfile )
|
||||||
{
|
{
|
||||||
@ -963,7 +963,7 @@ bool CHudSpectator::ParseOverviewFile()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gEngfuncs.COM_FreeFile( pfile );
|
gEngfuncs.COM_FreeFile( afile );
|
||||||
|
|
||||||
m_mapZoom = m_OverviewData.zoom;
|
m_mapZoom = m_OverviewData.zoom;
|
||||||
m_mapOrigin = m_OverviewData.origin;
|
m_mapOrigin = m_OverviewData.origin;
|
||||||
|
@ -1,16 +1,17 @@
|
|||||||
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
|
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
|
||||||
//
|
//
|
||||||
// Purpose:
|
// Purpose:
|
||||||
//
|
//
|
||||||
// $NoKeywords: $
|
// $NoKeywords: $
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
#pragma once
|
||||||
#if !defined( WRECTH )
|
#if !defined( WRECTH )
|
||||||
#define WRECTH
|
#define WRECTH
|
||||||
|
|
||||||
typedef struct rect_s
|
typedef struct rect_s
|
||||||
{
|
{
|
||||||
int left, right, top, bottom;
|
int left, right, top, bottom;
|
||||||
} wrect_t;
|
} wrect_t;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -14,33 +14,88 @@ def configure(conf):
|
|||||||
conf.check_cc(lib='dl')
|
conf.check_cc(lib='dl')
|
||||||
|
|
||||||
if conf.env.DEST_OS == 'win32':
|
if conf.env.DEST_OS == 'win32':
|
||||||
conf.check_cxx( lib='user32' )
|
conf.check_cxx(lib='user32')
|
||||||
|
|
||||||
def build(bld):
|
def build(bld):
|
||||||
source = bld.path.parent.ant_glob([
|
source = bld.path.parent.ant_glob([
|
||||||
'pm_shared/*.c',
|
'pm_shared/*.c'
|
||||||
'dlls/crossbow.cpp', 'dlls/crowbar.cpp', 'dlls/egon.cpp', 'dlls/gauss.cpp', 'dlls/handgrenade.cpp',
|
])
|
||||||
'dlls/hornetgun.cpp', 'dlls/mp5.cpp', 'dlls/python.cpp', 'dlls/rpg.cpp', 'dlls/satchel.cpp',
|
source += bld.path.ant_glob([
|
||||||
'dlls/shotgun.cpp', 'dlls/squeakgrenade.cpp', 'dlls/tripmine.cpp', 'dlls/glock.cpp'
|
'hl/*.cpp'
|
||||||
|
])
|
||||||
|
source += bld.path.ant_glob([
|
||||||
|
'dlls/crossbow.cpp',
|
||||||
|
'dlls/crowbar.cpp',
|
||||||
|
'dlls/egon.cpp',
|
||||||
|
'dlls/gauss.cpp',
|
||||||
|
'dlls/glock.cpp',
|
||||||
|
'dlls/handgrenade.cpp',
|
||||||
|
'dlls/hornetgun.cpp',
|
||||||
|
'dlls/mp5.cpp',
|
||||||
|
'dlls/python.cpp',
|
||||||
|
'dlls/rpg.cpp',
|
||||||
|
'dlls/satchel.cpp',
|
||||||
|
'dlls/shotgun.cpp',
|
||||||
|
'dlls/squeakgrenade.cpp',
|
||||||
|
'dlls/tripmine.cpp'
|
||||||
])
|
])
|
||||||
|
|
||||||
source += bld.path.ant_glob(['hl/*.cpp'])
|
|
||||||
source += [
|
source += [
|
||||||
'ev_hldm.cpp', 'ammo.cpp', 'ammo_secondary.cpp', 'ammohistory.cpp',
|
'GameStudioModelRenderer.cpp',
|
||||||
'battery.cpp', 'cdll_int.cpp', 'com_weapons.cpp', 'death.cpp',
|
'MOTD.cpp',
|
||||||
'demo.cpp', 'entity.cpp', 'ev_common.cpp', 'events.cpp',
|
'StudioModelRenderer.cpp',
|
||||||
'flashlight.cpp', 'GameStudioModelRenderer.cpp', 'geiger.cpp',
|
'ammo.cpp',
|
||||||
'health.cpp', 'hud.cpp', 'hud_msg.cpp', 'hud_redraw.cpp',
|
'ammo_secondary.cpp',
|
||||||
'hud_spectator.cpp', 'hud_update.cpp', 'in_camera.cpp',
|
'ammohistory.cpp',
|
||||||
'input.cpp', 'input_goldsource.cpp', 'input_mouse.cpp',
|
'battery.cpp',
|
||||||
'input_xash3d.cpp', 'menu.cpp', 'message.cpp',
|
'cdll_int.cpp',
|
||||||
'overview.cpp', 'parsemsg.cpp', 'saytext.cpp',
|
'com_weapons.cpp',
|
||||||
'status_icons.cpp', 'statusbar.cpp', 'studio_util.cpp',
|
'death.cpp',
|
||||||
'StudioModelRenderer.cpp', 'text_message.cpp', 'train.cpp',
|
'demo.cpp',
|
||||||
'tri.cpp', 'util.cpp', 'view.cpp', 'scoreboard.cpp', 'MOTD.cpp'
|
'entity.cpp',
|
||||||
|
'ev_hldm.cpp',
|
||||||
|
'ev_common.cpp',
|
||||||
|
'events.cpp',
|
||||||
|
'flashlight.cpp',
|
||||||
|
'geiger.cpp',
|
||||||
|
'health.cpp',
|
||||||
|
'hud.cpp',
|
||||||
|
'hud_msg.cpp',
|
||||||
|
'hud_redraw.cpp',
|
||||||
|
'hud_spectator.cpp',
|
||||||
|
'hud_update.cpp',
|
||||||
|
'in_camera.cpp',
|
||||||
|
'input.cpp',
|
||||||
|
'input_goldsource.cpp',
|
||||||
|
'input_mouse.cpp',
|
||||||
|
'input_xash3d.cpp',
|
||||||
|
'menu.cpp',
|
||||||
|
'message.cpp',
|
||||||
|
'overview.cpp',
|
||||||
|
'parsemsg.cpp',
|
||||||
|
'saytext.cpp',
|
||||||
|
'scoreboard.cpp',
|
||||||
|
'status_icons.cpp',
|
||||||
|
'statusbar.cpp',
|
||||||
|
'studio_util.cpp',
|
||||||
|
'text_message.cpp',
|
||||||
|
'train.cpp',
|
||||||
|
'tri.cpp',
|
||||||
|
'util.cpp',
|
||||||
|
'view.cpp'
|
||||||
]
|
]
|
||||||
|
|
||||||
includes = Utils.to_list('. hl/ ../dlls ../dlls/wpn_shared ../common ../engine ../pm_shared ../game_shared ../public ../utils/false_vgui/include')
|
includes = [
|
||||||
|
'.',
|
||||||
|
'hl/',
|
||||||
|
'../dlls',
|
||||||
|
'../dlls/wpn_shared',
|
||||||
|
'../common',
|
||||||
|
'../engine',
|
||||||
|
'../pm_shared',
|
||||||
|
'../game_shared',
|
||||||
|
'../public',
|
||||||
|
'../utils/false_vgui/include'
|
||||||
|
]
|
||||||
|
|
||||||
defines = ['CLIENT_DLL']
|
defines = ['CLIENT_DLL']
|
||||||
if bld.env.GOLDSRC:
|
if bld.env.GOLDSRC:
|
||||||
|
246
common/bspfile.h
246
common/bspfile.h
@ -1,246 +0,0 @@
|
|||||||
/*
|
|
||||||
bspfile.h - BSP format included q1, hl1 support
|
|
||||||
Copyright (C) 2010 Uncle Mike
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
*/
|
|
||||||
#pragma once
|
|
||||||
#ifndef BSPFILE_H
|
|
||||||
#define BSPFILE_H
|
|
||||||
|
|
||||||
/*
|
|
||||||
==============================================================================
|
|
||||||
|
|
||||||
BRUSH MODELS
|
|
||||||
|
|
||||||
.bsp contain level static geometry with including PVS and lightning info
|
|
||||||
==============================================================================
|
|
||||||
*/
|
|
||||||
|
|
||||||
// header
|
|
||||||
#define Q1BSP_VERSION 29 // quake1 regular version (beta is 28)
|
|
||||||
#define HLBSP_VERSION 30 // half-life regular version
|
|
||||||
#define XTBSP_VERSION 31 // extended lightmaps and expanded clipnodes limit
|
|
||||||
|
|
||||||
#define IDEXTRAHEADER (('H'<<24)+('S'<<16)+('A'<<8)+'X') // little-endian "XASH"
|
|
||||||
#define EXTRA_VERSION 2 // because version 1 was occupied by old versions of XashXT
|
|
||||||
|
|
||||||
#define DELUXEMAP_VERSION 1
|
|
||||||
#define IDDELUXEMAPHEADER (('T'<<24)+('I'<<16)+('L'<<8)+'Q') // little-endian "QLIT"
|
|
||||||
|
|
||||||
// worldcraft predefined angles
|
|
||||||
#define ANGLE_UP -1
|
|
||||||
#define ANGLE_DOWN -2
|
|
||||||
|
|
||||||
// bmodel limits
|
|
||||||
#define MAX_MAP_HULLS 4 // MAX_HULLS
|
|
||||||
|
|
||||||
#define SURF_NOCULL BIT( 0 ) // two-sided polygon (e.g. 'water4b')
|
|
||||||
#define SURF_PLANEBACK BIT( 1 ) // plane should be negated
|
|
||||||
#define SURF_DRAWSKY BIT( 2 ) // sky surface
|
|
||||||
#define SURF_WATERCSG BIT( 3 ) // culled by csg (was SURF_DRAWSPRITE)
|
|
||||||
#define SURF_DRAWTURB BIT( 4 ) // warp surface
|
|
||||||
#define SURF_DRAWTILED BIT( 5 ) // face without lighmap
|
|
||||||
#define SURF_CONVEYOR BIT( 6 ) // scrolled texture (was SURF_DRAWBACKGROUND)
|
|
||||||
#define SURF_UNDERWATER BIT( 7 ) // caustics
|
|
||||||
#define SURF_TRANSPARENT BIT( 8 ) // it's a transparent texture (was SURF_DONTWARP)
|
|
||||||
|
|
||||||
#define SURF_REFLECT BIT( 31 ) // reflect surface (mirror)
|
|
||||||
|
|
||||||
// lightstyle management
|
|
||||||
#define LM_STYLES 4 // MAXLIGHTMAPS
|
|
||||||
#define LS_NORMAL 0x00
|
|
||||||
#define LS_UNUSED 0xFE
|
|
||||||
#define LS_NONE 0xFF
|
|
||||||
|
|
||||||
#define MAX_MAP_MODELS 1024 // can be increased up to 2048 if needed
|
|
||||||
#define MAX_MAP_BRUSHES 32768 // unsigned short limit
|
|
||||||
#define MAX_MAP_ENTITIES 8192 // can be increased up to 32768 if needed
|
|
||||||
#define MAX_MAP_ENTSTRING 0x80000 // 512 kB should be enough
|
|
||||||
#define MAX_MAP_PLANES 65536 // can be increased without problems
|
|
||||||
#define MAX_MAP_NODES 32767 // because negative shorts are leafs
|
|
||||||
#define MAX_MAP_CLIPNODES 32767 // because negative shorts are contents
|
|
||||||
#define MAX_MAP_LEAFS 32767 // signed short limit
|
|
||||||
#define MAX_MAP_VERTS 65535 // unsigned short limit
|
|
||||||
#define MAX_MAP_FACES 65535 // unsigned short limit
|
|
||||||
#define MAX_MAP_MARKSURFACES 65535 // unsigned short limit
|
|
||||||
#define MAX_MAP_TEXINFO MAX_MAP_FACES // in theory each face may have personal texinfo
|
|
||||||
#define MAX_MAP_EDGES 0x100000 // can be increased but not needed
|
|
||||||
#define MAX_MAP_SURFEDGES 0x200000 // can be increased but not needed
|
|
||||||
#define MAX_MAP_TEXTURES 2048 // can be increased but not needed
|
|
||||||
#define MAX_MAP_MIPTEX 0x2000000 // 32 Mb internal textures data
|
|
||||||
#define MAX_MAP_LIGHTING 0x2000000 // 32 Mb lightmap raw data (can contain deluxemaps)
|
|
||||||
#define MAX_MAP_VISIBILITY 0x800000 // 8 Mb visdata
|
|
||||||
|
|
||||||
// quake lump ordering
|
|
||||||
#define LUMP_ENTITIES 0
|
|
||||||
#define LUMP_PLANES 1
|
|
||||||
#define LUMP_TEXTURES 2 // internal textures
|
|
||||||
#define LUMP_VERTEXES 3
|
|
||||||
#define LUMP_VISIBILITY 4
|
|
||||||
#define LUMP_NODES 5
|
|
||||||
#define LUMP_TEXINFO 6
|
|
||||||
#define LUMP_FACES 7
|
|
||||||
#define LUMP_LIGHTING 8
|
|
||||||
#define LUMP_CLIPNODES 9
|
|
||||||
#define LUMP_LEAFS 10
|
|
||||||
#define LUMP_MARKSURFACES 11
|
|
||||||
#define LUMP_EDGES 12
|
|
||||||
#define LUMP_SURFEDGES 13
|
|
||||||
#define LUMP_MODELS 14 // internal submodels
|
|
||||||
#define HEADER_LUMPS 15
|
|
||||||
|
|
||||||
// version 31
|
|
||||||
#define LUMP_CLIPNODES2 15 // hull0 goes into LUMP_NODES, hull1 goes into LUMP_CLIPNODES,
|
|
||||||
#define LUMP_CLIPNODES3 16 // hull2 goes into LUMP_CLIPNODES2, hull3 goes into LUMP_CLIPNODES3
|
|
||||||
#define HEADER_LUMPS_31 17
|
|
||||||
|
|
||||||
#define LUMP_FACES_EXTRADATA 0 // extension of dface_t
|
|
||||||
#define LUMP_VERTS_EXTRADATA 1 // extension of dvertex_t
|
|
||||||
#define LUMP_CUBEMAPS 2 // cubemap description
|
|
||||||
|
|
||||||
#define EXTRA_LUMPS 8 // g-cont. just for future expansions
|
|
||||||
|
|
||||||
// texture flags
|
|
||||||
#define TEX_SPECIAL BIT( 0 ) // sky or slime, no lightmap or 256 subdivision
|
|
||||||
|
|
||||||
// ambient sound types
|
|
||||||
enum
|
|
||||||
{
|
|
||||||
AMBIENT_WATER = 0, // waterfall
|
|
||||||
AMBIENT_SKY, // wind
|
|
||||||
AMBIENT_SLIME, // never used in quake
|
|
||||||
AMBIENT_LAVA, // never used in quake
|
|
||||||
NUM_AMBIENTS // automatic ambient sounds
|
|
||||||
};
|
|
||||||
|
|
||||||
//
|
|
||||||
// BSP File Structures
|
|
||||||
//
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
int fileofs;
|
|
||||||
int filelen;
|
|
||||||
} dlump_t;
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
int version;
|
|
||||||
dlump_t lumps[HEADER_LUMPS];
|
|
||||||
} dheader_t;
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
int version;
|
|
||||||
dlump_t lumps[HEADER_LUMPS_31];
|
|
||||||
} dheader31_t;
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
int id; // must be little endian XASH
|
|
||||||
int version;
|
|
||||||
dlump_t lumps[EXTRA_LUMPS];
|
|
||||||
} dextrahdr_t;
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
vec3_t mins;
|
|
||||||
vec3_t maxs;
|
|
||||||
vec3_t origin; // for sounds or lights
|
|
||||||
int headnode[MAX_MAP_HULLS];
|
|
||||||
int visleafs; // not including the solid leaf 0
|
|
||||||
int firstface;
|
|
||||||
int numfaces;
|
|
||||||
} dmodel_t;
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
int nummiptex;
|
|
||||||
int dataofs[4]; // [nummiptex]
|
|
||||||
} dmiptexlump_t;
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
vec3_t point;
|
|
||||||
} dvertex_t;
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
vec3_t normal;
|
|
||||||
float dist;
|
|
||||||
int type; // PLANE_X - PLANE_ANYZ ?
|
|
||||||
} dplane_t;
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
int planenum;
|
|
||||||
short children[2]; // negative numbers are -(leafs + 1), not nodes
|
|
||||||
short mins[3]; // for sphere culling
|
|
||||||
short maxs[3];
|
|
||||||
word firstface;
|
|
||||||
word numfaces; // counting both sides
|
|
||||||
} dnode_t;
|
|
||||||
|
|
||||||
// leaf 0 is the generic CONTENTS_SOLID leaf, used for all solid areas
|
|
||||||
// all other leafs need visibility info
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
int contents;
|
|
||||||
int visofs; // -1 = no visibility info
|
|
||||||
|
|
||||||
short mins[3]; // for frustum culling
|
|
||||||
short maxs[3];
|
|
||||||
word firstmarksurface;
|
|
||||||
word nummarksurfaces;
|
|
||||||
|
|
||||||
// automatic ambient sounds
|
|
||||||
byte ambient_level[NUM_AMBIENTS]; // ambient sound level (0 - 255)
|
|
||||||
} dleaf_t;
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
int planenum;
|
|
||||||
short children[2]; // negative numbers are contents
|
|
||||||
} dclipnode_t;
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
float vecs[2][4]; // texmatrix [s/t][xyz offset]
|
|
||||||
int miptex;
|
|
||||||
int flags;
|
|
||||||
} dtexinfo_t;
|
|
||||||
|
|
||||||
typedef word dmarkface_t; // leaf marksurfaces indexes
|
|
||||||
typedef int dsurfedge_t; // map surfedges
|
|
||||||
|
|
||||||
// NOTE: that edge 0 is never used, because negative edge nums
|
|
||||||
// are used for counterclockwise use of the edge in a face
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
word v[2]; // vertex numbers
|
|
||||||
} dedge_t;
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
word planenum;
|
|
||||||
short side;
|
|
||||||
|
|
||||||
int firstedge; // we must support > 64k edges
|
|
||||||
short numedges;
|
|
||||||
short texinfo;
|
|
||||||
|
|
||||||
// lighting info
|
|
||||||
byte styles[LM_STYLES];
|
|
||||||
int lightofs; // start of [numstyles*surfsize] samples
|
|
||||||
} dface_t;
|
|
||||||
|
|
||||||
#endif//BSPFILE_H
|
|
@ -1,43 +1,41 @@
|
|||||||
/*
|
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
|
||||||
com_model.h - cient model structures
|
//
|
||||||
Copyright (C) 2010 Uncle Mike
|
// Purpose:
|
||||||
|
//
|
||||||
|
// $NoKeywords: $
|
||||||
|
//=============================================================================
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
// com_model.h
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
*/
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#ifndef COM_MODEL_H
|
#if !defined( COM_MODEL_H )
|
||||||
#define COM_MODEL_H
|
#define COM_MODEL_H
|
||||||
|
|
||||||
#include "bspfile.h" // we need some declarations from it
|
#define STUDIO_RENDER 1
|
||||||
|
#define STUDIO_EVENTS 2
|
||||||
|
|
||||||
typedef vec_t vec2_t[2];
|
#define MAX_CLIENTS 32
|
||||||
typedef vec_t vec4_t[4];
|
#define MAX_EDICTS 900
|
||||||
|
|
||||||
/*
|
#define MAX_MODEL_NAME 64
|
||||||
==============================================================================
|
#define MAX_MAP_HULLS 4
|
||||||
|
#define MIPLEVELS 4
|
||||||
|
#define NUM_AMBIENTS 4 // automatic ambient sounds
|
||||||
|
#define MAXLIGHTMAPS 4
|
||||||
|
#define PLANE_ANYZ 5
|
||||||
|
|
||||||
ENGINE MODEL FORMAT
|
#define ALIAS_Z_CLIP_PLANE 5
|
||||||
==============================================================================
|
|
||||||
*/
|
|
||||||
#define STUDIO_RENDER 1
|
|
||||||
#define STUDIO_EVENTS 2
|
|
||||||
|
|
||||||
#define ZISCALE ((float)0x8000)
|
// flags in finalvert_t.flags
|
||||||
|
#define ALIAS_LEFT_CLIP 0x0001
|
||||||
|
#define ALIAS_TOP_CLIP 0x0002
|
||||||
|
#define ALIAS_RIGHT_CLIP 0x0004
|
||||||
|
#define ALIAS_BOTTOM_CLIP 0x0008
|
||||||
|
#define ALIAS_Z_CLIP 0x0010
|
||||||
|
#define ALIAS_ONSEAM 0x0020
|
||||||
|
#define ALIAS_XY_CLIP_MASK 0x000F
|
||||||
|
|
||||||
#define MIPLEVELS 4
|
#define ZISCALE ((float)0x8000)
|
||||||
#define VERTEXSIZE 7
|
|
||||||
#define MAXLIGHTMAPS 4
|
|
||||||
#define NUM_AMBIENTS 4 // automatic ambient sounds
|
|
||||||
|
|
||||||
// model types
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
mod_bad = -1,
|
mod_bad = -1,
|
||||||
@ -47,13 +45,35 @@ typedef enum
|
|||||||
mod_studio
|
mod_studio
|
||||||
} modtype_t;
|
} modtype_t;
|
||||||
|
|
||||||
|
// must match definition in modelgen.h
|
||||||
|
#ifndef SYNCTYPE_T
|
||||||
|
#define SYNCTYPE_T
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
ST_SYNC=0,
|
||||||
|
ST_RAND
|
||||||
|
} synctype_t;
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
float mins[3], maxs[3];
|
||||||
|
float origin[3];
|
||||||
|
int headnode[MAX_MAP_HULLS];
|
||||||
|
int visleafs; // not including the solid leaf 0
|
||||||
|
int firstface, numfaces;
|
||||||
|
} dmodel_t;
|
||||||
|
|
||||||
|
// plane_t structure
|
||||||
typedef struct mplane_s
|
typedef struct mplane_s
|
||||||
{
|
{
|
||||||
vec3_t normal;
|
vec3_t normal; // surface normal
|
||||||
float dist;
|
float dist; // closest appoach to origin
|
||||||
byte type; // for fast side tests
|
byte type; // for texture axis selection and fast side tests
|
||||||
byte signbits; // signx + (signy<<1) + (signz<<1)
|
byte signbits; // signx + signy<<1 + signz<<1
|
||||||
byte pad[2];
|
byte pad[2];
|
||||||
} mplane_t;
|
} mplane_t;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
@ -70,291 +90,246 @@ typedef struct
|
|||||||
typedef struct texture_s
|
typedef struct texture_s
|
||||||
{
|
{
|
||||||
char name[16];
|
char name[16];
|
||||||
unsigned int width, height;
|
unsigned width, height;
|
||||||
int gl_texturenum;
|
int anim_total; // total tenths in sequence ( 0 = no)
|
||||||
struct msurface_s *texturechain; // for gl_texsort drawing
|
int anim_min, anim_max; // time for this frame min <=time< max
|
||||||
int anim_total; // total tenths in sequence ( 0 = no)
|
struct texture_s *anim_next; // in the animation sequence
|
||||||
int anim_min, anim_max; // time for this frame min <=time< max
|
struct texture_s *alternate_anims; // bmodels in frame 1 use these
|
||||||
struct texture_s *anim_next; // in the animation sequence
|
unsigned offsets[MIPLEVELS]; // four mip maps stored
|
||||||
struct texture_s *alternate_anims; // bmodels in frame 1 use these
|
unsigned paloffset;
|
||||||
unsigned short fb_texturenum; // auto-luma texturenum
|
|
||||||
unsigned short dt_texturenum; // detail-texture binding
|
|
||||||
unsigned int unused[3]; // reserved
|
|
||||||
} texture_t;
|
} texture_t;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
float vecs[2][4]; // [s/t] unit vectors in world space.
|
float vecs[2][4]; // [s/t] unit vectors in world space.
|
||||||
// [i][3] is the s/t offset relative to the origin.
|
// [i][3] is the s/t offset relative to the origin.
|
||||||
// s or t = dot( 3Dpoint, vecs[i] ) + vecs[i][3]
|
// s or t = dot(3Dpoint,vecs[i])+vecs[i][3]
|
||||||
float mipadjust; // mipmap limits for very small surfaces
|
float mipadjust; // ?? mipmap limits for very small surfaces
|
||||||
texture_t *texture;
|
texture_t *texture;
|
||||||
int flags; // sky or slime, no lightmap or 256 subdivision
|
int flags; // sky or slime, no lightmap or 256 subdivision
|
||||||
} mtexinfo_t;
|
} mtexinfo_t;
|
||||||
|
|
||||||
// 73 bytes per VBO vertex
|
|
||||||
// FIXME: align to 32 bytes
|
|
||||||
typedef struct glvert_s
|
|
||||||
{
|
|
||||||
vec3_t vertex; // position
|
|
||||||
vec3_t normal; // normal
|
|
||||||
vec2_t stcoord; // ST texture coords
|
|
||||||
vec2_t lmcoord; // ST lightmap coords
|
|
||||||
vec2_t sccoord; // ST scissor coords (decals only) - for normalmap coords migration
|
|
||||||
vec3_t tangent; // tangent
|
|
||||||
vec3_t binormal; // binormal
|
|
||||||
byte color[4]; // colors per vertex
|
|
||||||
} glvert_t;
|
|
||||||
|
|
||||||
typedef struct glpoly_s
|
|
||||||
{
|
|
||||||
struct glpoly_s *next;
|
|
||||||
struct glpoly_s *chain;
|
|
||||||
int numverts;
|
|
||||||
int flags; // for SURF_UNDERWATER
|
|
||||||
float verts[4][VERTEXSIZE]; // variable sized (xyz s1t1 s2t2)
|
|
||||||
} glpoly_t;
|
|
||||||
|
|
||||||
typedef struct mnode_s
|
typedef struct mnode_s
|
||||||
{
|
{
|
||||||
// common with leaf
|
// common with leaf
|
||||||
int contents; // 0, to differentiate from leafs
|
int contents; // 0, to differentiate from leafs
|
||||||
int visframe; // node needs to be traversed if current
|
int visframe; // node needs to be traversed if current
|
||||||
|
|
||||||
|
short minmaxs[6]; // for bounding box culling
|
||||||
|
|
||||||
float minmaxs[6]; // for bounding box culling
|
|
||||||
struct mnode_s *parent;
|
struct mnode_s *parent;
|
||||||
|
|
||||||
// node specific
|
// node specific
|
||||||
mplane_t *plane;
|
mplane_t *plane;
|
||||||
struct mnode_s *children[2];
|
struct mnode_s *children[2];
|
||||||
|
|
||||||
unsigned short firstsurface;
|
unsigned short firstsurface;
|
||||||
unsigned short numsurfaces;
|
unsigned short numsurfaces;
|
||||||
} mnode_t;
|
} mnode_t;
|
||||||
|
|
||||||
typedef struct msurface_s msurface_t;
|
typedef struct msurface_s msurface_t;
|
||||||
typedef struct decal_s decal_t;
|
typedef struct decal_s decal_t;
|
||||||
|
|
||||||
// JAY: Compress this as much as possible
|
// JAY: Compress this as much as possible
|
||||||
struct decal_s
|
struct decal_s
|
||||||
{
|
{
|
||||||
decal_t *pnext; // linked list for each surface
|
decal_t *pnext; // linked list for each surface
|
||||||
msurface_t *psurface; // Surface id for persistence / unlinking
|
msurface_t *psurface; // Surface id for persistence / unlinking
|
||||||
float dx; // local texture coordinates
|
short dx; // Offsets into surface texture (in texture coordinates, so we don't need floats)
|
||||||
float dy; //
|
short dy;
|
||||||
float scale; // Pixel scale
|
|
||||||
short texture; // Decal texture
|
short texture; // Decal texture
|
||||||
byte flags; // Decal flags FDECAL_*
|
byte scale; // Pixel scale
|
||||||
|
byte flags; // Decal flags
|
||||||
|
|
||||||
short entityIndex; // Entity this is attached to
|
short entityIndex; // Entity this is attached to
|
||||||
// Xash3D added
|
|
||||||
vec3_t position; // location of the decal center in world space.
|
|
||||||
vec3_t saxis; // direction of the s axis in world space
|
|
||||||
struct msurfmesh_s *mesh; // decal mesh in local space
|
|
||||||
int reserved[4]; // for future expansions
|
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct mleaf_s
|
typedef struct mleaf_s
|
||||||
{
|
{
|
||||||
// common with node
|
// common with node
|
||||||
int contents;
|
int contents; // wil be a negative contents number
|
||||||
int visframe; // node needs to be traversed if current
|
int visframe; // node needs to be traversed if current
|
||||||
|
|
||||||
float minmaxs[6]; // for bounding box culling
|
short minmaxs[6]; // for bounding box culling
|
||||||
|
|
||||||
struct mnode_s *parent;
|
struct mnode_s *parent;
|
||||||
|
|
||||||
// leaf specific
|
// leaf specific
|
||||||
byte *compressed_vis;
|
byte *compressed_vis;
|
||||||
struct efrag_s *efrags;
|
struct efrag_s *efrags;
|
||||||
|
|
||||||
msurface_t **firstmarksurface;
|
msurface_t **firstmarksurface;
|
||||||
int nummarksurfaces;
|
int nummarksurfaces;
|
||||||
byte *compressed_pas;
|
int key; // BSP sequence number for leaf's contents
|
||||||
byte ambient_sound_level[NUM_AMBIENTS];
|
byte ambient_sound_level[NUM_AMBIENTS];
|
||||||
|
|
||||||
} mleaf_t;
|
} mleaf_t;
|
||||||
|
|
||||||
struct msurface_s
|
struct msurface_s
|
||||||
{
|
{
|
||||||
int visframe; // should be drawn when node is crossed
|
int visframe; // should be drawn when node is crossed
|
||||||
|
|
||||||
int dlightframe; // last frame the surface was checked by an animated light
|
int dlightframe; // last frame the surface was checked by an animated light
|
||||||
int dlightbits; // dynamically generated. Indicates if the surface illumination
|
int dlightbits; // dynamically generated. Indicates if the surface illumination
|
||||||
// is modified by an animated light.
|
// is modified by an animated light.
|
||||||
|
|
||||||
mplane_t *plane; // pointer to shared plane
|
mplane_t *plane; // pointer to shared plane
|
||||||
int flags; // see SURF_ #defines
|
int flags; // see SURF_ #defines
|
||||||
|
|
||||||
int firstedge; // look up in model->surfedges[], negative numbers
|
int firstedge; // look up in model->surfedges[], negative numbers
|
||||||
int numedges; // are backwards edges
|
int numedges; // are backwards edges
|
||||||
|
|
||||||
|
// surface generation data
|
||||||
|
struct surfcache_s *cachespots[MIPLEVELS];
|
||||||
|
|
||||||
short texturemins[2];
|
short texturemins[2]; // smallest s/t position on the surface.
|
||||||
short extents[2];
|
short extents[2]; // ?? s/t texture size, 1..256 for all non-sky surfaces
|
||||||
|
|
||||||
int light_s, light_t; // gl lightmap coordinates
|
mtexinfo_t *texinfo;
|
||||||
|
|
||||||
glpoly_t *polys; // multiple if warped
|
// lighting info
|
||||||
struct msurface_s *texturechain;
|
byte styles[MAXLIGHTMAPS]; // index into d_lightstylevalue[] for animated lights
|
||||||
|
// no one surface can be effected by more than 4
|
||||||
mtexinfo_t *texinfo;
|
// animated lights.
|
||||||
|
color24 *samples;
|
||||||
int lightmaptexturenum;
|
|
||||||
byte styles[MAXLIGHTMAPS];
|
|
||||||
int cached_light[MAXLIGHTMAPS]; // values currently used in lightmap
|
|
||||||
struct msurface_s *lightmapchain; // for new dlights rendering (was cached_dlight)
|
|
||||||
|
|
||||||
color24 *samples; // note: this is the actual lightmap data for this surface
|
|
||||||
decal_t *pdecals;
|
decal_t *pdecals;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct msurfmesh_s
|
typedef struct
|
||||||
{
|
{
|
||||||
unsigned short numVerts;
|
int planenum;
|
||||||
unsigned short numElems; // ~ 20 000 vertex per one surface. Should be enough
|
short children[2]; // negative numbers are contents
|
||||||
unsigned int startVert; // user-variable. may be used for construct world single-VBO
|
} dclipnode_t;
|
||||||
unsigned int startElem; // user-variable. may be used for construct world single-VBO
|
|
||||||
|
|
||||||
glvert_t *verts; // vertexes array
|
|
||||||
unsigned short *elems; // indices
|
|
||||||
|
|
||||||
struct msurface_s *surf; // pointer to parent surface. Just for consistency
|
|
||||||
struct msurfmesh_s *next; // temporary chain of subdivided surfaces
|
|
||||||
} msurfmesh_t;
|
|
||||||
|
|
||||||
// surface extradata stored in cache.data for all brushmodels
|
|
||||||
typedef struct mextrasurf_s
|
|
||||||
{
|
|
||||||
vec3_t mins, maxs;
|
|
||||||
vec3_t origin; // surface origin
|
|
||||||
msurfmesh_t *mesh; // VBO\VA ready surface mesh. Not used by engine but can be used by mod-makers
|
|
||||||
|
|
||||||
int dlight_s, dlight_t; // gl lightmap coordinates for dynamic lightmaps
|
|
||||||
|
|
||||||
int mirrortexturenum; // gl texnum
|
|
||||||
float mirrormatrix[4][4];
|
|
||||||
struct mextrasurf_s *mirrorchain; // for gl_texsort drawing
|
|
||||||
struct mextrasurf_s *detailchain; // for detail textures drawing
|
|
||||||
color24 *deluxemap; // note: this is the actual deluxemap data for this surface
|
|
||||||
|
|
||||||
int reserved[32]; // just for future expansions or mod-makers
|
|
||||||
} mextrasurf_t;
|
|
||||||
|
|
||||||
typedef struct hull_s
|
typedef struct hull_s
|
||||||
{
|
{
|
||||||
dclipnode_t *clipnodes;
|
dclipnode_t *clipnodes;
|
||||||
mplane_t *planes;
|
mplane_t *planes;
|
||||||
int firstclipnode;
|
int firstclipnode;
|
||||||
int lastclipnode;
|
int lastclipnode;
|
||||||
vec3_t clip_mins;
|
vec3_t clip_mins;
|
||||||
vec3_t clip_maxs;
|
vec3_t clip_maxs;
|
||||||
} hull_t;
|
} hull_t;
|
||||||
|
|
||||||
#ifndef CACHE_USER
|
#if !defined( CACHE_USER ) && !defined( QUAKEDEF_H )
|
||||||
#define CACHE_USER
|
#define CACHE_USER
|
||||||
typedef struct cache_user_s
|
typedef struct cache_user_s
|
||||||
{
|
{
|
||||||
void *data; // extradata
|
void *data;
|
||||||
} cache_user_t;
|
} cache_user_t;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct model_s
|
typedef struct model_s
|
||||||
{
|
{
|
||||||
char name[64]; // model name
|
char name[ MAX_MODEL_NAME ];
|
||||||
qboolean needload; // bmodels and sprites don't cache normally
|
qboolean needload; // bmodels and sprites don't cache normally
|
||||||
|
|
||||||
// shared modelinfo
|
modtype_t type;
|
||||||
modtype_t type; // model type
|
int numframes;
|
||||||
int numframes; // sprite's framecount
|
synctype_t synctype;
|
||||||
byte *mempool; // private mempool (was synctype)
|
|
||||||
int flags; // hl compatibility
|
int flags;
|
||||||
|
|
||||||
//
|
//
|
||||||
// volume occupied by the model
|
// volume occupied by the model
|
||||||
//
|
//
|
||||||
vec3_t mins, maxs; // bounding box at angles '0 0 0'
|
vec3_t mins, maxs;
|
||||||
float radius;
|
float radius;
|
||||||
|
|
||||||
// brush model
|
|
||||||
int firstmodelsurface;
|
|
||||||
int nummodelsurfaces;
|
|
||||||
|
|
||||||
int numsubmodels;
|
//
|
||||||
dmodel_t *submodels; // or studio animations
|
// brush model
|
||||||
|
//
|
||||||
|
int firstmodelsurface, nummodelsurfaces;
|
||||||
|
|
||||||
int numplanes;
|
int numsubmodels;
|
||||||
mplane_t *planes;
|
dmodel_t *submodels;
|
||||||
|
|
||||||
int numleafs; // number of visible leafs, not counting 0
|
int numplanes;
|
||||||
mleaf_t *leafs;
|
mplane_t *planes;
|
||||||
|
|
||||||
int numvertexes;
|
int numleafs; // number of visible leafs, not counting 0
|
||||||
mvertex_t *vertexes;
|
struct mleaf_s *leafs;
|
||||||
|
|
||||||
int numedges;
|
int numvertexes;
|
||||||
|
mvertex_t *vertexes;
|
||||||
|
|
||||||
|
int numedges;
|
||||||
medge_t *edges;
|
medge_t *edges;
|
||||||
|
|
||||||
int numnodes;
|
int numnodes;
|
||||||
mnode_t *nodes;
|
mnode_t *nodes;
|
||||||
|
|
||||||
int numtexinfo;
|
int numtexinfo;
|
||||||
mtexinfo_t *texinfo;
|
mtexinfo_t *texinfo;
|
||||||
|
|
||||||
int numsurfaces;
|
int numsurfaces;
|
||||||
msurface_t *surfaces;
|
msurface_t *surfaces;
|
||||||
|
|
||||||
int numsurfedges;
|
int numsurfedges;
|
||||||
int *surfedges;
|
int *surfedges;
|
||||||
|
|
||||||
int numclipnodes;
|
int numclipnodes;
|
||||||
dclipnode_t *clipnodes;
|
dclipnode_t *clipnodes;
|
||||||
|
|
||||||
int nummarksurfaces;
|
int nummarksurfaces;
|
||||||
msurface_t **marksurfaces;
|
msurface_t **marksurfaces;
|
||||||
|
|
||||||
hull_t hulls[MAX_MAP_HULLS];
|
hull_t hulls[MAX_MAP_HULLS];
|
||||||
|
|
||||||
int numtextures;
|
int numtextures;
|
||||||
texture_t **textures;
|
texture_t **textures;
|
||||||
|
|
||||||
byte *visdata;
|
byte *visdata;
|
||||||
|
|
||||||
color24 *lightdata;
|
color24 *lightdata;
|
||||||
|
|
||||||
char *entities;
|
char *entities;
|
||||||
|
|
||||||
//
|
//
|
||||||
// additional model data
|
// additional model data
|
||||||
//
|
//
|
||||||
cache_user_t cache; // only access through Mod_Extradata
|
cache_user_t cache; // only access through Mod_Extradata
|
||||||
|
|
||||||
} model_t;
|
} model_t;
|
||||||
|
|
||||||
|
typedef vec_t vec4_t[4];
|
||||||
|
|
||||||
typedef struct alight_s
|
typedef struct alight_s
|
||||||
{
|
{
|
||||||
int ambientlight; // clip at 128
|
int ambientlight; // clip at 128
|
||||||
int shadelight; // clip at 192 - ambientlight
|
int shadelight; // clip at 192 - ambientlight
|
||||||
vec3_t color;
|
vec3_t color;
|
||||||
float *plightvec;
|
float *plightvec;
|
||||||
} alight_t;
|
} alight_t;
|
||||||
|
|
||||||
typedef struct auxvert_s
|
typedef struct auxvert_s
|
||||||
{
|
{
|
||||||
float fv[3]; // viewspace x, y
|
float fv[3]; // viewspace x, y
|
||||||
} auxvert_t;
|
} auxvert_t;
|
||||||
|
|
||||||
#define MAX_SCOREBOARDNAME 32
|
|
||||||
#define MAX_INFO_STRING 256
|
|
||||||
|
|
||||||
#include "custom.h"
|
#include "custom.h"
|
||||||
|
|
||||||
|
#define MAX_INFO_STRING 256
|
||||||
|
#define MAX_SCOREBOARDNAME 32
|
||||||
typedef struct player_info_s
|
typedef struct player_info_s
|
||||||
{
|
{
|
||||||
int userid; // User id on server
|
// User id on server
|
||||||
char userinfo[MAX_INFO_STRING]; // User info string
|
int userid;
|
||||||
char name[MAX_SCOREBOARDNAME]; // Name (extracted from userinfo)
|
|
||||||
int spectator; // Spectator or not, unused
|
// User info string
|
||||||
|
char userinfo[ MAX_INFO_STRING ];
|
||||||
|
|
||||||
|
// Name
|
||||||
|
char name[ MAX_SCOREBOARDNAME ];
|
||||||
|
|
||||||
|
// Spectator or not, unused
|
||||||
|
int spectator;
|
||||||
|
|
||||||
int ping;
|
int ping;
|
||||||
int packet_loss;
|
int packet_loss;
|
||||||
|
|
||||||
// skin information
|
// skin information
|
||||||
char model[64];
|
char model[MAX_QPATH];
|
||||||
int topcolor;
|
int topcolor;
|
||||||
int bottomcolor;
|
int bottomcolor;
|
||||||
|
|
||||||
@ -363,50 +338,12 @@ typedef struct player_info_s
|
|||||||
|
|
||||||
// Gait frame estimation
|
// Gait frame estimation
|
||||||
int gaitsequence;
|
int gaitsequence;
|
||||||
float gaitframe;
|
float gaitframe;
|
||||||
float gaityaw;
|
float gaityaw;
|
||||||
vec3_t prevgaitorigin;
|
vec3_t prevgaitorigin;
|
||||||
|
|
||||||
customization_t customdata;
|
customization_t customdata;
|
||||||
} player_info_t;
|
} player_info_t;
|
||||||
|
|
||||||
//
|
#endif // COM_MODEL_H
|
||||||
// sprite representation in memory
|
|
||||||
//
|
|
||||||
typedef enum { SPR_SINGLE = 0, SPR_GROUP, SPR_ANGLED } spriteframetype_t;
|
|
||||||
|
|
||||||
typedef struct mspriteframe_s
|
|
||||||
{
|
|
||||||
int width;
|
|
||||||
int height;
|
|
||||||
float up, down, left, right;
|
|
||||||
int gl_texturenum;
|
|
||||||
} mspriteframe_t;
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
int numframes;
|
|
||||||
float *intervals;
|
|
||||||
mspriteframe_t *frames[1];
|
|
||||||
} mspritegroup_t;
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
spriteframetype_t type;
|
|
||||||
mspriteframe_t *frameptr;
|
|
||||||
} mspriteframedesc_t;
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
short type;
|
|
||||||
short texFormat;
|
|
||||||
int maxwidth;
|
|
||||||
int maxheight;
|
|
||||||
int numframes;
|
|
||||||
int radius;
|
|
||||||
int facecull;
|
|
||||||
int synctype;
|
|
||||||
mspriteframedesc_t frames[1];
|
|
||||||
} msprite_t;
|
|
||||||
|
|
||||||
#endif//COM_MODEL_H
|
|
||||||
|
@ -1,49 +0,0 @@
|
|||||||
/*
|
|
||||||
gameinfo.h - current game info
|
|
||||||
Copyright (C) 2010 Uncle Mike
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
*/
|
|
||||||
#pragma once
|
|
||||||
#ifndef GAMEINFO_H
|
|
||||||
#define GAMEINFO_H
|
|
||||||
|
|
||||||
#define GFL_NOMODELS (1<<0)
|
|
||||||
|
|
||||||
/*
|
|
||||||
========================================================================
|
|
||||||
|
|
||||||
GAMEINFO stuff
|
|
||||||
|
|
||||||
internal shared gameinfo structure (readonly for engine parts)
|
|
||||||
========================================================================
|
|
||||||
*/
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
// filesystem info
|
|
||||||
char gamefolder[64]; // used for change game '-game x'
|
|
||||||
char startmap[64]; // map to start singleplayer game
|
|
||||||
char trainmap[64]; // map to start hazard course (if specified)
|
|
||||||
char title[64]; // Game Main Title
|
|
||||||
char version[14]; // game version (optional)
|
|
||||||
short flags; // game flags
|
|
||||||
|
|
||||||
// about mod info
|
|
||||||
char game_url[256]; // link to a developer's site
|
|
||||||
char update_url[256]; // link to updates page
|
|
||||||
char type[64]; // single, toolkit, multiplayer etc
|
|
||||||
char date[64];
|
|
||||||
char size[64]; // displayed mod size
|
|
||||||
|
|
||||||
int gamemode;
|
|
||||||
} GAMEINFO;
|
|
||||||
|
|
||||||
#endif//GAMEINFO_H
|
|
@ -1,29 +0,0 @@
|
|||||||
/*
|
|
||||||
lightstyle.h - lighstyle description
|
|
||||||
Copyright (C) 2011 Uncle Mike
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
*/
|
|
||||||
#pragma once
|
|
||||||
#ifndef LIGHTSTYLE_H
|
|
||||||
#define LIGHTSTYLE_H
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
char pattern[256];
|
|
||||||
float map[256];
|
|
||||||
int length;
|
|
||||||
float value;
|
|
||||||
qboolean interp; // allow to interpolate this lightstyle
|
|
||||||
float time; // local time is gurantee what new style begins from the start, not mid or end of the sequence
|
|
||||||
} lightstyle_t;
|
|
||||||
|
|
||||||
#endif//LIGHTSTYLE_H
|
|
@ -1,261 +0,0 @@
|
|||||||
/*
|
|
||||||
render_api.h - Xash3D extension for client interface
|
|
||||||
Copyright (C) 2011 Uncle Mike
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
*/
|
|
||||||
#pragma once
|
|
||||||
#ifndef RENDER_API_H
|
|
||||||
#define RENDER_API_H
|
|
||||||
|
|
||||||
#include "lightstyle.h"
|
|
||||||
#include "dlight.h"
|
|
||||||
|
|
||||||
// changes for version 28
|
|
||||||
// replace decal_t from software declaration to hardware (matched to normal HL)
|
|
||||||
// mextrasurf_t->increased limit of reserved fields (up from 7 to 32)
|
|
||||||
// replace R_StoreEfrags with him extended version
|
|
||||||
// formed group for BSP decal manipulating
|
|
||||||
// move misc functions at end of the interface
|
|
||||||
// added new export for clearing studio decals
|
|
||||||
|
|
||||||
#define CL_RENDER_INTERFACE_VERSION 35
|
|
||||||
#define MAX_STUDIO_DECALS 4096 // + unused space of BSP decals
|
|
||||||
|
|
||||||
#define SURF_INFO( surf, mod ) ((mextrasurf_t *)mod->cache.data + (surf - mod->surfaces))
|
|
||||||
#define INFO_SURF( surf, mod ) (mod->surfaces + (surf - (mextrasurf_t *)mod->cache.data))
|
|
||||||
|
|
||||||
// render info parms
|
|
||||||
#define PARM_TEX_WIDTH 1 // all parms with prefix 'TEX_' receive arg as texnum
|
|
||||||
#define PARM_TEX_HEIGHT 2 // otherwise it's not used
|
|
||||||
#define PARM_TEX_SRC_WIDTH 3
|
|
||||||
#define PARM_TEX_SRC_HEIGHT 4
|
|
||||||
#define PARM_TEX_SKYBOX 5 // second arg as skybox ordering num
|
|
||||||
#define PARM_TEX_SKYTEXNUM 6 // skytexturenum for quake sky
|
|
||||||
#define PARM_TEX_LIGHTMAP 7 // second arg as number 0 - 128
|
|
||||||
#define PARM_TEX_TARGET 8
|
|
||||||
#define PARM_TEX_TEXNUM 9
|
|
||||||
#define PARM_TEX_FLAGS 10
|
|
||||||
#define PARM_TEX_TYPE 11
|
|
||||||
#define PARM_TEX_CACHEFRAME 12 // compare with worldmodel->needload
|
|
||||||
#define PARM_TEX_GLFORMAT 13 // get a texture GL-format
|
|
||||||
// reserved
|
|
||||||
#define PARM_WORLD_VERSION 16 // return the version of bsp
|
|
||||||
#define PARM_SKY_SPHERE 17 // sky is quake sphere ?
|
|
||||||
#define PARM_MAP_HAS_MIRRORS 18 // current map has mirorrs
|
|
||||||
#define PARM_MAP_HAS_DELUXE 19 // map has deluxedata
|
|
||||||
#define PARM_MAX_ENTITIES 20
|
|
||||||
#define PARM_WIDESCREEN 21
|
|
||||||
#define PARM_FULLSCREEN 22
|
|
||||||
#define PARM_SCREEN_WIDTH 23
|
|
||||||
#define PARM_SCREEN_HEIGHT 24
|
|
||||||
#define PARM_CLIENT_INGAME 25
|
|
||||||
#define PARM_FEATURES 26 // same as movevars->features
|
|
||||||
#define PARM_ACTIVE_TMU 27 // for debug
|
|
||||||
#define PARM_CACHEFRAME 28
|
|
||||||
#define PARM_MAX_IMAGE_UNITS 29
|
|
||||||
#define PARM_CLIENT_ACTIVE 30
|
|
||||||
#define PARM_REBUILD_GAMMA 31 // if true lightmaps rebuilding for gamma change
|
|
||||||
|
|
||||||
enum
|
|
||||||
{
|
|
||||||
// skybox ordering
|
|
||||||
SKYBOX_RIGHT = 0,
|
|
||||||
SKYBOX_BACK,
|
|
||||||
SKYBOX_LEFT,
|
|
||||||
SKYBOX_FORWARD,
|
|
||||||
SKYBOX_UP,
|
|
||||||
SKYBOX_DOWN,
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
TEX_INVALID = 0, // free slot
|
|
||||||
TEX_SYSTEM, // generated by engine
|
|
||||||
TEX_NOMIP, // hud pics, menu etc
|
|
||||||
TEX_BRUSH, // a map texture
|
|
||||||
TEX_SPRITE, // sprite frames
|
|
||||||
TEX_STUDIO, // studio skins
|
|
||||||
TEX_LIGHTMAP, // lightmap textures
|
|
||||||
TEX_DECAL, // decals
|
|
||||||
TEX_VGUI, // vgui fonts or images
|
|
||||||
TEX_CUBEMAP, // cubemap textures (sky)
|
|
||||||
TEX_DETAIL, // detail textures
|
|
||||||
TEX_REMAP, // local copy of remap texture
|
|
||||||
TEX_SCREENCOPY, // keep screen copy e.g. for mirror
|
|
||||||
TEX_CUSTOM, // user created texture
|
|
||||||
TEX_DEPTHMAP // shadowmap texture
|
|
||||||
} texType_t;
|
|
||||||
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
TF_NEAREST = (1<<0), // disable texfilter
|
|
||||||
TF_KEEP_RGBDATA = (1<<1), // some images keep source
|
|
||||||
TF_NOFLIP_TGA = (1<<2), // Steam background completely ignore tga attribute 0x20
|
|
||||||
TF_KEEP_8BIT = (1<<3), // keep original 8-bit image (if present)
|
|
||||||
TF_NOPICMIP = (1<<4), // ignore r_picmip resample rules
|
|
||||||
TF_UNCOMPRESSED = (1<<5), // don't compress texture in video memory
|
|
||||||
TF_CUBEMAP = (1<<6), // it's cubemap texture
|
|
||||||
TF_DEPTHMAP = (1<<7), // custom texture filter used
|
|
||||||
TF_INTENSITY = (1<<8), // monochrome intensity image
|
|
||||||
TF_LUMINANCE = (1<<9), // force image to grayscale
|
|
||||||
TF_SKYSIDE = (1<<10), // this is a part of skybox
|
|
||||||
TF_CLAMP = (1<<11), // clamp texcoords to [0..1] range
|
|
||||||
TF_NOMIPMAP = (1<<12), // don't build mips for this image
|
|
||||||
TF_HAS_LUMA = (1<<13), // sets by GL_UploadTexture
|
|
||||||
TF_MAKELUMA = (1<<14), // create luma from quake texture (only q1 textures contain luma-pixels)
|
|
||||||
TF_NORMALMAP = (1<<15), // is a normalmap
|
|
||||||
TF_HAS_ALPHA = (1<<16), // image has alpha (used only for GL_CreateTexture)
|
|
||||||
TF_FORCE_COLOR = (1<<17), // force upload monochrome textures as RGB (detail textures)
|
|
||||||
TF_TEXTURE_1D = (1<<18), // this is GL_TEXTURE_1D
|
|
||||||
TF_BORDER = (1<<19), // zero clamp for projected textures
|
|
||||||
TF_TEXTURE_3D = (1<<20), // this is GL_TEXTURE_3D
|
|
||||||
TF_STATIC = (1<<21), // a marker for purge mechanism (not used by engine)
|
|
||||||
TF_TEXTURE_RECTANGLE= (1<<22), // this is GL_TEXTURE_RECTANGLE
|
|
||||||
TF_ALPHA_BORDER = (1<<23), // clamp to (0,0,0,255) (probably no difference)
|
|
||||||
TF_IMAGE_PROGRAM = (1<<24), // enable image program support like in Doom3
|
|
||||||
TF_ALPHACONTRAST = (1<<25), // special texture flags for internal usage
|
|
||||||
TF_FLOAT = (1<<26), // float textures
|
|
||||||
TF_NOCOMPARE = (1<<27), // disable comparing for depth textures
|
|
||||||
TF_FLOATDATA = (1<<28), // incoming dataType has type GL_FLOAT
|
|
||||||
} texFlags_t;
|
|
||||||
|
|
||||||
typedef struct beam_s BEAM;
|
|
||||||
typedef struct particle_s particle_t;
|
|
||||||
|
|
||||||
// 12 bytes here
|
|
||||||
typedef struct modelstate_s
|
|
||||||
{
|
|
||||||
short sequence;
|
|
||||||
short frame; // 10 bits multiple by 4, should be enough
|
|
||||||
byte blending[2];
|
|
||||||
byte controller[4];
|
|
||||||
byte body;
|
|
||||||
byte skin;
|
|
||||||
} modelstate_t;
|
|
||||||
|
|
||||||
typedef struct decallist_s
|
|
||||||
{
|
|
||||||
vec3_t position;
|
|
||||||
char name[64];
|
|
||||||
short entityIndex;
|
|
||||||
byte depth;
|
|
||||||
byte flags;
|
|
||||||
float scale;
|
|
||||||
|
|
||||||
// this is the surface plane that we hit so that
|
|
||||||
// we can move certain decals across
|
|
||||||
// transitions if they hit similar geometry
|
|
||||||
vec3_t impactPlaneNormal;
|
|
||||||
|
|
||||||
modelstate_t studio_state; // studio decals only
|
|
||||||
} decallist_t;
|
|
||||||
|
|
||||||
typedef struct render_api_s
|
|
||||||
{
|
|
||||||
// Get renderer info (doesn't changes engine state at all)
|
|
||||||
int (*RenderGetParm)( int parm, int arg ); // generic
|
|
||||||
void (*GetDetailScaleForTexture)( int texture, float *xScale, float *yScale );
|
|
||||||
void (*GetExtraParmsForTexture)( int texture, byte *red, byte *green, byte *blue, byte *alpha );
|
|
||||||
lightstyle_t* (*GetLightStyle)( int number );
|
|
||||||
dlight_t* (*GetDynamicLight)( int number );
|
|
||||||
dlight_t* (*GetEntityLight)( int number );
|
|
||||||
byte (*TextureToTexGamma)( byte color ); // software gamma support
|
|
||||||
void (*GetBeamChains)( BEAM ***active_beams, BEAM ***free_beams, particle_t ***free_trails );
|
|
||||||
|
|
||||||
// Set renderer info (tell engine about changes)
|
|
||||||
void (*R_SetCurrentEntity)( struct cl_entity_s *ent ); // tell engine about both currententity and currentmodel
|
|
||||||
void (*R_SetCurrentModel)( struct model_s *mod ); // change currentmodel but leave currententity unchanged
|
|
||||||
void (*GL_SetWorldviewProjectionMatrix)( const float *glmatrix ); // update viewprojection matrix (tracers uses it)
|
|
||||||
void (*R_StoreEfrags)( struct efrag_s **ppefrag, int framecount );// store efrags for static entities
|
|
||||||
|
|
||||||
// Texture tools
|
|
||||||
int (*GL_FindTexture)( const char *name );
|
|
||||||
const char* (*GL_TextureName)( unsigned int texnum );
|
|
||||||
const byte* (*GL_TextureData)( unsigned int texnum ); // may be NULL
|
|
||||||
int (*GL_LoadTexture)( const char *name, const byte *buf, size_t size, int flags );
|
|
||||||
int (*GL_CreateTexture)( const char *name, int width, int height, const void *buffer, int flags );
|
|
||||||
void (*GL_SetTextureType)( unsigned int texnum, unsigned int type );
|
|
||||||
void (*GL_TextureCacheFrame)( unsigned int texnum );
|
|
||||||
void (*GL_FreeTexture)( unsigned int texnum );
|
|
||||||
|
|
||||||
// Decals manipulating (draw & remove)
|
|
||||||
void (*DrawSingleDecal)( struct decal_s *pDecal, struct msurface_s *fa );
|
|
||||||
float *(*R_DecalSetupVerts)( struct decal_s *pDecal, struct msurface_s *surf, int texture, int *outCount );
|
|
||||||
void (*R_EntityRemoveDecals)( struct model_s *mod ); // remove all the decals from specified entity (BSP only)
|
|
||||||
|
|
||||||
// AVIkit support
|
|
||||||
void *(*AVI_LoadVideo)( const char *filename, int ignore_hwgamma );
|
|
||||||
int (*AVI_GetVideoInfo)( void *Avi, long *xres, long *yres, float *duration );
|
|
||||||
long (*AVI_GetVideoFrameNumber)( void *Avi, float time );
|
|
||||||
byte *(*AVI_GetVideoFrame)( void *Avi, long frame );
|
|
||||||
void (*AVI_UploadRawFrame)( int texture, int cols, int rows, int width, int height, const byte *data );
|
|
||||||
void (*AVI_FreeVideo)( void *Avi );
|
|
||||||
int (*AVI_IsActive)( void *Avi );
|
|
||||||
|
|
||||||
// glState related calls (must use this instead of normal gl-calls to prevent de-synchornize local states between engine and the client)
|
|
||||||
void (*GL_Bind)( int tmu, unsigned int texnum );
|
|
||||||
void (*GL_SelectTexture)( int tmu );
|
|
||||||
void (*GL_LoadTextureMatrix)( const float *glmatrix );
|
|
||||||
void (*GL_TexMatrixIdentity)( void );
|
|
||||||
void (*GL_CleanUpTextureUnits)( int last ); // pass 0 for clear all the texture units
|
|
||||||
void (*GL_TexGen)( unsigned int coord, unsigned int mode );
|
|
||||||
void (*GL_TextureTarget)( unsigned int target ); // change texture unit mode without bind texture
|
|
||||||
void (*GL_TexCoordArrayMode)( unsigned int texmode );
|
|
||||||
void (*GL_Reserved0)( void ); // for potential interface expansion without broken compatibility
|
|
||||||
void (*GL_Reserved1)( void );
|
|
||||||
void (*GL_Reserved2)( void );
|
|
||||||
void (*GL_Reserved3)( void );
|
|
||||||
|
|
||||||
// Misc renderer functions
|
|
||||||
void (*GL_DrawParticles)( const float *vieworg, const float *fwd, const float *rt, const float *up, unsigned int clipFlags );
|
|
||||||
void (*EnvShot)( const float *vieworg, const char *name, qboolean skyshot, int shotsize ); // creates a cubemap or skybox into gfx\env folder
|
|
||||||
int (*COM_CompareFileTime)( const char *filename1, const char *filename2, int *iCompare );
|
|
||||||
void (*Host_Error)( const char *error, ... ); // cause Host Error
|
|
||||||
int (*SPR_LoadExt)( const char *szPicName, unsigned int texFlags ); // extended version of SPR_Load
|
|
||||||
void (*TessPolygon)( struct msurface_s *surf, struct model_s *mod, float tessSize );
|
|
||||||
struct mstudiotex_s *( *StudioGetTexture )( struct cl_entity_s *e );
|
|
||||||
const struct ref_overview_s *( *GetOverviewParms )( void );
|
|
||||||
void (*S_FadeMusicVolume)( float fadePercent ); // fade background track (0-100 percents)
|
|
||||||
void (*SetRandomSeed)( long lSeed ); // set custom seed for RANDOM_FLOAT\RANDOM_LONG for predictable random
|
|
||||||
// static allocations
|
|
||||||
void *(*pfnMemAlloc)( size_t cb, const char *filename, const int fileline );
|
|
||||||
void (*pfnMemFree)( void *mem, const char *filename, const int fileline );
|
|
||||||
// find in files
|
|
||||||
char **(*pfnGetFilesList)( const char *pattern, int *numFiles, int gamedironly );
|
|
||||||
// ONLY ADD NEW FUNCTIONS TO THE END OF THIS STRUCT. INTERFACE VERSION IS FROZEN AT 35
|
|
||||||
} render_api_t;
|
|
||||||
|
|
||||||
// render callbacks
|
|
||||||
typedef struct render_interface_s
|
|
||||||
{
|
|
||||||
int version;
|
|
||||||
// passed through R_RenderFrame (0 - use engine renderer, 1 - use custom client renderer)
|
|
||||||
int (*GL_RenderFrame)( const struct ref_params_s *pparams, qboolean drawWorld );
|
|
||||||
// build all the lightmaps on new level or when gamma is changed
|
|
||||||
void (*GL_BuildLightmaps)( void );
|
|
||||||
// setup map bounds for ortho-projection when we in dev_overview mode
|
|
||||||
void (*GL_OrthoBounds)( const float *mins, const float *maxs );
|
|
||||||
// handle decals which hit mod_studio or mod_sprite
|
|
||||||
void (*R_StudioDecalShoot)( int decalTexture, struct cl_entity_s *ent, const float *start, const float *pos, int flags, modelstate_t *state );
|
|
||||||
// prepare studio decals for save
|
|
||||||
int (*R_CreateStudioDecalList)( decallist_t *pList, int count, qboolean changelevel );
|
|
||||||
// clear decals by engine request (e.g. for demo recording or vid_restart)
|
|
||||||
void (*R_ClearStudioDecals)( void );
|
|
||||||
// grab r_speeds message
|
|
||||||
qboolean (*R_SpeedsMessage)( char *out, size_t size );
|
|
||||||
// replace with built-in R_DrawCubemapView for make skyshots or envshots
|
|
||||||
qboolean (*R_DrawCubemapView)( const float *origin, const float *angles, int size );
|
|
||||||
// alloc or destroy studiomodel custom data
|
|
||||||
void (*Mod_ProcessUserData)( struct model_s *mod, qboolean create, const byte *buffer );
|
|
||||||
} render_interface_t;
|
|
||||||
|
|
||||||
#endif//RENDER_API_H
|
|
@ -1,24 +0,0 @@
|
|||||||
/*
|
|
||||||
wrect.h - rectangle definition
|
|
||||||
Copyright (C) 2010 Uncle Mike
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
*/
|
|
||||||
#pragma once
|
|
||||||
#ifndef WRECT_H
|
|
||||||
#define WRECT_H
|
|
||||||
|
|
||||||
typedef struct wrect_s
|
|
||||||
{
|
|
||||||
int left, right, top, bottom;
|
|
||||||
} wrect_t;
|
|
||||||
|
|
||||||
#endif//WRECT_H
|
|
@ -1002,7 +1002,7 @@ void CBigMomma::StartTask( Task_t *pTask )
|
|||||||
TaskComplete();
|
TaskComplete();
|
||||||
break;
|
break;
|
||||||
case TASK_WAIT_NODE:
|
case TASK_WAIT_NODE:
|
||||||
m_flWait = gpGlobals->time + GetNodeDelay();
|
m_flWaitFinished = gpGlobals->time + GetNodeDelay();
|
||||||
if( m_hTargetEnt->pev->spawnflags & SF_INFOBM_WAIT )
|
if( m_hTargetEnt->pev->spawnflags & SF_INFOBM_WAIT )
|
||||||
ALERT( at_aiconsole, "BM: Wait at node %s forever\n", STRING( pev->netname ) );
|
ALERT( at_aiconsole, "BM: Wait at node %s forever\n", STRING( pev->netname ) );
|
||||||
else
|
else
|
||||||
@ -1078,8 +1078,10 @@ void CBigMomma::RunTask( Task_t *pTask )
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if( gpGlobals->time > m_flWaitFinished )
|
if( gpGlobals->time > m_flWaitFinished )
|
||||||
|
{
|
||||||
TaskComplete();
|
TaskComplete();
|
||||||
ALERT( at_aiconsole, "BM: The WAIT is over!\n" );
|
ALERT( at_aiconsole, "BM: The WAIT is over!\n" );
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case TASK_PLAY_NODE_PRESEQUENCE:
|
case TASK_PLAY_NODE_PRESEQUENCE:
|
||||||
case TASK_PLAY_NODE_SEQUENCE:
|
case TASK_PLAY_NODE_SEQUENCE:
|
||||||
@ -1175,7 +1177,7 @@ void CBMortar::Spawn( void )
|
|||||||
|
|
||||||
UTIL_SetSize( pev, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ) );
|
UTIL_SetSize( pev, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ) );
|
||||||
|
|
||||||
m_maxFrame = (float) MODEL_FRAMES( pev->modelindex ) - 1;
|
m_maxFrame = MODEL_FRAMES( pev->modelindex ) - 1;
|
||||||
pev->dmgtime = gpGlobals->time + 0.4f;
|
pev->dmgtime = gpGlobals->time + 0.4f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ void CSquidSpit::Spawn( void )
|
|||||||
|
|
||||||
UTIL_SetSize( pev, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ) );
|
UTIL_SetSize( pev, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ) );
|
||||||
|
|
||||||
m_maxFrame = (float)MODEL_FRAMES( pev->modelindex ) - 1;
|
m_maxFrame = MODEL_FRAMES( pev->modelindex ) - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSquidSpit::Animate( void )
|
void CSquidSpit::Animate( void )
|
||||||
|
@ -68,7 +68,6 @@ CBaseEntity
|
|||||||
|
|
||||||
extern "C" EXPORT int GetEntityAPI( DLL_FUNCTIONS *pFunctionTable, int interfaceVersion );
|
extern "C" EXPORT int GetEntityAPI( DLL_FUNCTIONS *pFunctionTable, int interfaceVersion );
|
||||||
extern "C" EXPORT int GetEntityAPI2( DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion );
|
extern "C" EXPORT int GetEntityAPI2( DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion );
|
||||||
extern "C" EXPORT int Server_GetPhysicsInterface( int iVersion, server_physics_api_t *pfuncsFromEngine, physics_interface_t *pFunctionTable );
|
|
||||||
|
|
||||||
extern int DispatchSpawn( edict_t *pent );
|
extern int DispatchSpawn( edict_t *pent );
|
||||||
extern void DispatchKeyValue( edict_t *pentKeyvalue, KeyValueData *pkvd );
|
extern void DispatchKeyValue( edict_t *pentKeyvalue, KeyValueData *pkvd );
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
#define BOLT_AIR_VELOCITY 2000
|
#define BOLT_AIR_VELOCITY 2000
|
||||||
#define BOLT_WATER_VELOCITY 1000
|
#define BOLT_WATER_VELOCITY 1000
|
||||||
|
|
||||||
extern BOOL gPhysicsInterfaceInitialized;
|
extern BOOL g_fIsXash3D;
|
||||||
|
|
||||||
// UNDONE: Save/restore this? Don't forget to set classname and LINK_ENTITY_TO_CLASS()
|
// UNDONE: Save/restore this? Don't forget to set classname and LINK_ENTITY_TO_CLASS()
|
||||||
//
|
//
|
||||||
@ -169,7 +169,8 @@ void CCrossbowBolt::BoltTouch( CBaseEntity *pOther )
|
|||||||
pev->angles.z = RANDOM_LONG( 0, 360 );
|
pev->angles.z = RANDOM_LONG( 0, 360 );
|
||||||
SetNextThink( 10.0f );
|
SetNextThink( 10.0f );
|
||||||
|
|
||||||
if (gPhysicsInterfaceInitialized) {
|
if( g_fIsXash3D )
|
||||||
|
{
|
||||||
// g-cont. Setup movewith feature
|
// g-cont. Setup movewith feature
|
||||||
pev->movetype = MOVETYPE_COMPOUND; // set movewith type
|
pev->movetype = MOVETYPE_COMPOUND; // set movewith type
|
||||||
pev->aiment = ENT( pOther->pev ); // set parent
|
pev->aiment = ENT( pOther->pev ); // set parent
|
||||||
|
@ -17,6 +17,8 @@
|
|||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "game.h"
|
#include "game.h"
|
||||||
|
|
||||||
|
BOOL g_fIsXash3D;
|
||||||
|
|
||||||
cvar_t displaysoundlist = {"displaysoundlist","0"};
|
cvar_t displaysoundlist = {"displaysoundlist","0"};
|
||||||
|
|
||||||
// multiplayer server rules
|
// multiplayer server rules
|
||||||
@ -55,6 +57,8 @@ cvar_t *g_psv_gravity = NULL;
|
|||||||
cvar_t *g_psv_aim = NULL;
|
cvar_t *g_psv_aim = NULL;
|
||||||
cvar_t *g_footsteps = NULL;
|
cvar_t *g_footsteps = NULL;
|
||||||
|
|
||||||
|
cvar_t *g_psv_developer;
|
||||||
|
|
||||||
//CVARS FOR SKILL LEVEL SETTINGS
|
//CVARS FOR SKILL LEVEL SETTINGS
|
||||||
// Agrunt
|
// Agrunt
|
||||||
cvar_t sk_agrunt_health1 = {"sk_agrunt_health1","0"};
|
cvar_t sk_agrunt_health1 = {"sk_agrunt_health1","0"};
|
||||||
@ -455,11 +459,15 @@ cvar_t sk_player_leg3 = { "sk_player_leg3","1" };
|
|||||||
void GameDLLInit( void )
|
void GameDLLInit( void )
|
||||||
{
|
{
|
||||||
// Register cvars here:
|
// Register cvars here:
|
||||||
|
if( CVAR_GET_POINTER( "build" ) )
|
||||||
|
g_fIsXash3D = TRUE;
|
||||||
|
|
||||||
g_psv_gravity = CVAR_GET_POINTER( "sv_gravity" );
|
g_psv_gravity = CVAR_GET_POINTER( "sv_gravity" );
|
||||||
g_psv_aim = CVAR_GET_POINTER( "sv_aim" );
|
g_psv_aim = CVAR_GET_POINTER( "sv_aim" );
|
||||||
g_footsteps = CVAR_GET_POINTER( "mp_footsteps" );
|
g_footsteps = CVAR_GET_POINTER( "mp_footsteps" );
|
||||||
|
|
||||||
|
g_psv_developer = CVAR_GET_POINTER( "developer" );
|
||||||
|
|
||||||
CVAR_REGISTER( &displaysoundlist );
|
CVAR_REGISTER( &displaysoundlist );
|
||||||
CVAR_REGISTER( &allow_spectators );
|
CVAR_REGISTER( &allow_spectators );
|
||||||
|
|
||||||
|
@ -43,4 +43,6 @@ extern cvar_t allowmonsters;
|
|||||||
extern cvar_t *g_psv_gravity;
|
extern cvar_t *g_psv_gravity;
|
||||||
extern cvar_t *g_psv_aim;
|
extern cvar_t *g_psv_aim;
|
||||||
extern cvar_t *g_footsteps;
|
extern cvar_t *g_footsteps;
|
||||||
|
|
||||||
|
extern cvar_t *g_psv_developer;
|
||||||
#endif // GAME_H
|
#endif // GAME_H
|
||||||
|
@ -26,9 +26,8 @@
|
|||||||
#include "cbase.h"
|
#include "cbase.h"
|
||||||
|
|
||||||
// Holds engine functionality callbacks
|
// Holds engine functionality callbacks
|
||||||
enginefuncs_t g_engfuncs;
|
enginefuncs_t g_engfuncs;
|
||||||
globalvars_t *gpGlobals;
|
globalvars_t *gpGlobals;
|
||||||
server_physics_api_t g_physfuncs;
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ extern CGraph WorldGraph;
|
|||||||
#define HOUNDEYE_MAX_ATTACK_RADIUS 384.0f
|
#define HOUNDEYE_MAX_ATTACK_RADIUS 384.0f
|
||||||
#define HOUNDEYE_SQUAD_BONUS 1.1f
|
#define HOUNDEYE_SQUAD_BONUS 1.1f
|
||||||
|
|
||||||
#define HOUNDEYE_EYE_FRAMES 4 // how many different switchable maps for the eye
|
#define HOUNDEYE_EYE_FRAMES 3 // how many different switchable maps for the eye
|
||||||
|
|
||||||
#define HOUNDEYE_SOUND_STARTLE_VOLUME 128 // how loud a sound has to be to badly scare a sleeping houndeye
|
#define HOUNDEYE_SOUND_STARTLE_VOLUME 128 // how loud a sound has to be to badly scare a sleeping houndeye
|
||||||
|
|
||||||
@ -791,6 +791,11 @@ void CHoundeye::RunTask( Task_t *pTask )
|
|||||||
{
|
{
|
||||||
pev->skin++;
|
pev->skin++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( pev->skin == HOUNDEYE_EYE_FRAMES - 1 )
|
||||||
|
{
|
||||||
|
TaskComplete();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case TASK_HOUND_HOP_BACK:
|
case TASK_HOUND_HOP_BACK:
|
||||||
@ -960,6 +965,7 @@ Task_t tlHoundSleep[] =
|
|||||||
{ TASK_HOUND_FALL_ASLEEP, (float)0 },
|
{ TASK_HOUND_FALL_ASLEEP, (float)0 },
|
||||||
{ TASK_WAIT_RANDOM, (float)25 },
|
{ TASK_WAIT_RANDOM, (float)25 },
|
||||||
{ TASK_HOUND_CLOSE_EYE, (float)0 },
|
{ TASK_HOUND_CLOSE_EYE, (float)0 },
|
||||||
|
{ TASK_WAIT_INDEFINITE, (float)0 },
|
||||||
//{ TASK_WAIT, (float)10 },
|
//{ TASK_WAIT, (float)10 },
|
||||||
//{ TASK_WAIT_RANDOM, (float)10 },
|
//{ TASK_WAIT_RANDOM, (float)10 },
|
||||||
};
|
};
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
#include "decals.h"
|
#include "decals.h"
|
||||||
#include "soundent.h"
|
#include "soundent.h"
|
||||||
#include "gamerules.h"
|
#include "gamerules.h"
|
||||||
|
#include "game.h"
|
||||||
|
|
||||||
#define MONSTER_CUT_CORNER_DIST 8 // 8 means the monster's bounding box is contained without the box of the node in WC
|
#define MONSTER_CUT_CORNER_DIST 8 // 8 means the monster's bounding box is contained without the box of the node in WC
|
||||||
|
|
||||||
@ -2105,7 +2106,9 @@ void CBaseMonster::StartMonster( void )
|
|||||||
if (!WALK_MOVE ( ENT(pev), 0, 0, WALKMOVE_NORMAL ) && !FBitSet( pev->spawnflags, SF_MONSTER_NO_YELLOW_BLOBS))
|
if (!WALK_MOVE ( ENT(pev), 0, 0, WALKMOVE_NORMAL ) && !FBitSet( pev->spawnflags, SF_MONSTER_NO_YELLOW_BLOBS))
|
||||||
{
|
{
|
||||||
ALERT( at_error, "Monster %s stuck in wall--level design error\n", STRING( pev->classname ) );
|
ALERT( at_error, "Monster %s stuck in wall--level design error\n", STRING( pev->classname ) );
|
||||||
pev->effects = EF_BRIGHTFIELD;
|
|
||||||
|
if( g_psv_developer && g_psv_developer->value )
|
||||||
|
pev->effects = EF_BRIGHTFIELD;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1,33 +0,0 @@
|
|||||||
/***
|
|
||||||
*
|
|
||||||
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
|
|
||||||
*
|
|
||||||
* This product contains software technology licensed from Id
|
|
||||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
|
||||||
* All Rights Reserved.
|
|
||||||
*
|
|
||||||
* Use, distribution, and modification of this source code and/or resulting
|
|
||||||
* object code is restricted to non-commercial enhancements to products from
|
|
||||||
* Valve LLC. All other use, distribution, or modification is prohibited
|
|
||||||
* without written permission from Valve LLC.
|
|
||||||
*
|
|
||||||
****/
|
|
||||||
#pragma once
|
|
||||||
#ifndef PHYSCALLBACK_H
|
|
||||||
#define PHYSCALLBACK_H
|
|
||||||
|
|
||||||
#include "physint.h"
|
|
||||||
|
|
||||||
// Must be provided by user of this code
|
|
||||||
extern server_physics_api_t g_physfuncs;
|
|
||||||
|
|
||||||
// The actual physic callbacks
|
|
||||||
#define LINK_ENTITY (*g_physfuncs.pfnLinkEdict)
|
|
||||||
#define PHYSICS_TIME (*g_physfuncs.pfnGetServerTime)
|
|
||||||
#define HOST_FRAMETIME (*g_physfuncs.pfnGetFrameTime)
|
|
||||||
#define MODEL_HANDLE (*g_physfuncs.pfnGetModel)
|
|
||||||
#define GET_AREANODE (*g_physfuncs.pfnGetHeadnode)
|
|
||||||
#define GET_SERVER_STATE (*g_physfuncs.pfnServerState)
|
|
||||||
#define HOST_ERROR (*g_physfuncs.pfnHost_Error)
|
|
||||||
|
|
||||||
#endif //PHYSCALLBACK_H
|
|
@ -28,10 +28,6 @@
|
|||||||
#include "enginecallback.h"
|
#include "enginecallback.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef PHYSCALLBACK_H
|
|
||||||
#include "physcallback.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
inline void MESSAGE_BEGIN( int msg_dest, int msg_type, const float *pOrigin, entvars_t *ent ); // implementation later in this file
|
inline void MESSAGE_BEGIN( int msg_dest, int msg_type, const float *pOrigin, entvars_t *ent ); // implementation later in this file
|
||||||
|
110
dlls/world.cpp
110
dlls/world.cpp
@ -34,7 +34,6 @@
|
|||||||
#include "gamerules.h"
|
#include "gamerules.h"
|
||||||
#include "teamplay_gamerules.h"
|
#include "teamplay_gamerules.h"
|
||||||
#include "movewith.h" //LRC
|
#include "movewith.h" //LRC
|
||||||
#include "physcallback.h"
|
|
||||||
|
|
||||||
extern CGraph WorldGraph;
|
extern CGraph WorldGraph;
|
||||||
extern CSoundEnt *pSoundEnt;
|
extern CSoundEnt *pSoundEnt;
|
||||||
@ -722,112 +721,3 @@ void CWorld::KeyValue( KeyValueData *pkvd )
|
|||||||
CBaseEntity::KeyValue( pkvd );
|
CBaseEntity::KeyValue( pkvd );
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
// Xash3D physics interface
|
|
||||||
//
|
|
||||||
|
|
||||||
typedef void (*LINK_ENTITY_FN)( entvars_t *pev );
|
|
||||||
|
|
||||||
//
|
|
||||||
// attempt to create custom entity when default method is failed
|
|
||||||
// 0 - attempt to create, -1 - reject to create
|
|
||||||
//
|
|
||||||
int DispatchCreateEntity( edict_t *pent, const char *szName )
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
#ifdef CREATE_ENTITY_TEST
|
|
||||||
// quake armor entities. we just replaced it with item_battery...
|
|
||||||
if( !strcmp( szName, "item_armor1" ) || !strcmp( szName, "item_armor2" ) )
|
|
||||||
{
|
|
||||||
LINK_ENTITY_FN SpawnEdict;
|
|
||||||
|
|
||||||
// ugly method to get acess with himself exports
|
|
||||||
SpawnEdict = (LINK_ENTITY_FN)GetProcAddress( GetModuleHandle( "hl" ), "item_battery" );
|
|
||||||
|
|
||||||
if( SpawnEdict != NULL ) // found the valid spawn
|
|
||||||
{
|
|
||||||
// BUGBUG: old classname hanging in memory
|
|
||||||
pent->v.classname = ALLOC_STRING( "item_battery" );
|
|
||||||
|
|
||||||
//ALERT( at_console, "DispatchCreateEntity: replace %s with %s\n", szName, STRING( pent->v.classname ) );
|
|
||||||
|
|
||||||
SpawnEdict( &pent->v );
|
|
||||||
return 0; // handled
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
*/
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// run custom physics for each entity
|
|
||||||
// return 0 to use built-in engine physic
|
|
||||||
//
|
|
||||||
int DispatchPhysicsEntity( edict_t *pEdict )
|
|
||||||
{
|
|
||||||
CBaseEntity *pEntity = (CBaseEntity *)GET_PRIVATE( pEdict );
|
|
||||||
|
|
||||||
if( !pEntity )
|
|
||||||
{
|
|
||||||
//ALERT( at_console, "skip %s [%i] without private data\n", STRING( pEdict->v.classname ), ENTINDEX( pEdict ) );
|
|
||||||
return 0; // not initialized
|
|
||||||
}
|
|
||||||
|
|
||||||
// NOTE: at this point pEntity assume to be valid
|
|
||||||
/*
|
|
||||||
#ifdef CUSTOM_PHYSICS_TEST
|
|
||||||
// test alien controller without physics, thinking only
|
|
||||||
if( FClassnameIs( pEntity->pev, "monster_alien_controller" ) )
|
|
||||||
{
|
|
||||||
float thinktime;
|
|
||||||
|
|
||||||
thinktime = pEntity->pev->nextthink;
|
|
||||||
if( thinktime <= 0.0f || thinktime > PHYSICS_TIME() + gpGlobals->frametime )
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
if( thinktime < PHYSICS_TIME() )
|
|
||||||
thinktime = PHYSICS_TIME(); // don't let things stay in the past.
|
|
||||||
// it is possible to start that way
|
|
||||||
// by a trigger with a local time.
|
|
||||||
pEntity->pev->nextthink = 0.0f;
|
|
||||||
gpGlobals->time = thinktime;
|
|
||||||
|
|
||||||
DispatchThink( pEdict );
|
|
||||||
|
|
||||||
#ifdef GRAVITY_TEST
|
|
||||||
// stupid fake gravity test
|
|
||||||
pEntity->pev->origin.z -= 1;
|
|
||||||
LINK_ENTITY( pEdict, true );
|
|
||||||
#endif
|
|
||||||
return 1; // handled
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
*/
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static physics_interface_t gPhysicsInterface =
|
|
||||||
{
|
|
||||||
SV_PHYSICS_INTERFACE_VERSION,
|
|
||||||
DispatchCreateEntity,
|
|
||||||
DispatchPhysicsEntity,
|
|
||||||
};
|
|
||||||
|
|
||||||
BOOL gPhysicsInterfaceInitialized = FALSE;
|
|
||||||
|
|
||||||
int Server_GetPhysicsInterface( int iVersion, server_physics_api_t *pfuncsFromEngine, physics_interface_t *pFunctionTable )
|
|
||||||
{
|
|
||||||
if( !pFunctionTable || !pfuncsFromEngine || iVersion != SV_PHYSICS_INTERFACE_VERSION )
|
|
||||||
{
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
// copy new physics interface
|
|
||||||
memcpy( &g_physfuncs, pfuncsFromEngine, sizeof(server_physics_api_t) );
|
|
||||||
|
|
||||||
// fill engine callbacks
|
|
||||||
memcpy( pFunctionTable, &gPhysicsInterface, sizeof(physics_interface_t) );
|
|
||||||
gPhysicsInterfaceInitialized = TRUE;
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
130
dlls/wscript
130
dlls/wscript
@ -27,28 +27,106 @@ def build(bld):
|
|||||||
])
|
])
|
||||||
|
|
||||||
source += [
|
source += [
|
||||||
'agrunt.cpp', 'airtank.cpp', 'aflock.cpp', 'animating.cpp', 'animation.cpp', 'apache.cpp',
|
'agrunt.cpp',
|
||||||
'barnacle.cpp', 'barney.cpp', 'bigmomma.cpp', 'bloater.cpp', 'bmodels.cpp', 'bullsquid.cpp', 'buttons.cpp',
|
'airtank.cpp',
|
||||||
'cbase.cpp', 'client.cpp', 'combat.cpp', 'controller.cpp', 'crossbow.cpp', 'crowbar.cpp',
|
'aflock.cpp',
|
||||||
'defaultai.cpp', 'doors.cpp',
|
'animating.cpp',
|
||||||
'effects.cpp', 'egon.cpp', 'explode.cpp',
|
'animation.cpp',
|
||||||
'flyingmonster.cpp', 'func_break.cpp', 'func_tank.cpp',
|
'apache.cpp',
|
||||||
'game.cpp', 'gamerules.cpp', 'gargantua.cpp', 'gauss.cpp', 'genericmonster.cpp', 'ggrenade.cpp', 'globals.cpp', 'glock.cpp', 'gman.cpp',
|
'barnacle.cpp',
|
||||||
'h_ai.cpp', 'h_battery.cpp', 'h_cine.cpp', 'h_cycler.cpp', 'h_export.cpp', 'handgrenade.cpp', 'hassassin.cpp', 'headcrab.cpp',
|
'barney.cpp',
|
||||||
'healthkit.cpp', 'hgrunt.cpp', 'hornet.cpp', 'hornetgun.cpp', 'houndeye.cpp',
|
'bigmomma.cpp',
|
||||||
'ichthyosaur.cpp', 'islave.cpp', 'items.cpp',
|
'bloater.cpp',
|
||||||
'leech.cpp', 'lights.cpp',
|
'bmodels.cpp',
|
||||||
'maprules.cpp', 'monstermaker.cpp', 'monsters.cpp', 'monsterstate.cpp', 'mortar.cpp', 'mp5.cpp', 'multiplay_gamerules.cpp',
|
'bullsquid.cpp',
|
||||||
'nihilanth.cpp', 'nodes.cpp',
|
'buttons.cpp',
|
||||||
'observer.cpp', 'osprey.cpp',
|
'cbase.cpp',
|
||||||
'pathcorner.cpp', 'plane.cpp', 'plats.cpp', 'player.cpp', 'playermonster.cpp', 'python.cpp',
|
'client.cpp',
|
||||||
'rat.cpp', 'roach.cpp', 'rpg.cpp',
|
'combat.cpp',
|
||||||
'satchel.cpp', 'schedule.cpp', 'scientist.cpp', 'scripted.cpp', 'shotgun.cpp', 'singleplay_gamerules.cpp', 'skill.cpp',
|
'controller.cpp',
|
||||||
'sound.cpp', 'soundent.cpp', 'spectator.cpp', 'squadmonster.cpp', 'squeakgrenade.cpp', 'subs.cpp',
|
'crossbow.cpp',
|
||||||
'talkmonster.cpp', 'teamplay_gamerules.cpp', 'tempmonster.cpp', 'tentacle.cpp',
|
'crowbar.cpp',
|
||||||
'triggers.cpp', 'tripmine.cpp', 'turret.cpp',
|
'defaultai.cpp',
|
||||||
|
'doors.cpp',
|
||||||
|
'effects.cpp',
|
||||||
|
'egon.cpp',
|
||||||
|
'explode.cpp',
|
||||||
|
'flyingmonster.cpp',
|
||||||
|
'func_break.cpp',
|
||||||
|
'func_tank.cpp',
|
||||||
|
'game.cpp',
|
||||||
|
'gamerules.cpp',
|
||||||
|
'gargantua.cpp',
|
||||||
|
'gauss.cpp',
|
||||||
|
'genericmonster.cpp',
|
||||||
|
'ggrenade.cpp',
|
||||||
|
'globals.cpp',
|
||||||
|
'glock.cpp',
|
||||||
|
'gman.cpp',
|
||||||
|
'h_ai.cpp',
|
||||||
|
'h_battery.cpp',
|
||||||
|
'h_cine.cpp',
|
||||||
|
'h_cycler.cpp',
|
||||||
|
'h_export.cpp',
|
||||||
|
'handgrenade.cpp',
|
||||||
|
'hassassin.cpp',
|
||||||
|
'headcrab.cpp',
|
||||||
|
'healthkit.cpp',
|
||||||
|
'hgrunt.cpp',
|
||||||
|
'hornet.cpp',
|
||||||
|
'hornetgun.cpp',
|
||||||
|
'houndeye.cpp',
|
||||||
|
'ichthyosaur.cpp',
|
||||||
|
'islave.cpp',
|
||||||
|
'items.cpp',
|
||||||
|
'leech.cpp',
|
||||||
|
'lights.cpp',
|
||||||
|
'maprules.cpp',
|
||||||
|
'monstermaker.cpp',
|
||||||
|
'monsters.cpp',
|
||||||
|
'monsterstate.cpp',
|
||||||
|
'mortar.cpp',
|
||||||
|
'mp5.cpp',
|
||||||
|
'multiplay_gamerules.cpp',
|
||||||
|
'nihilanth.cpp',
|
||||||
|
'nodes.cpp',
|
||||||
|
'observer.cpp',
|
||||||
|
'osprey.cpp',
|
||||||
|
'pathcorner.cpp',
|
||||||
|
'plane.cpp',
|
||||||
|
'plats.cpp',
|
||||||
|
'player.cpp',
|
||||||
|
'playermonster.cpp',
|
||||||
|
'python.cpp',
|
||||||
|
'rat.cpp',
|
||||||
|
'roach.cpp',
|
||||||
|
'rpg.cpp',
|
||||||
|
'satchel.cpp',
|
||||||
|
'schedule.cpp',
|
||||||
|
'scientist.cpp',
|
||||||
|
'scripted.cpp',
|
||||||
|
'shotgun.cpp',
|
||||||
|
'singleplay_gamerules.cpp',
|
||||||
|
'skill.cpp',
|
||||||
|
'sound.cpp',
|
||||||
|
'soundent.cpp',
|
||||||
|
'spectator.cpp',
|
||||||
|
'squadmonster.cpp',
|
||||||
|
'squeakgrenade.cpp',
|
||||||
|
'subs.cpp',
|
||||||
|
'talkmonster.cpp',
|
||||||
|
'teamplay_gamerules.cpp',
|
||||||
|
'tempmonster.cpp',
|
||||||
|
'tentacle.cpp',
|
||||||
|
'triggers.cpp',
|
||||||
|
'tripmine.cpp',
|
||||||
|
'turret.cpp',
|
||||||
'util.cpp',
|
'util.cpp',
|
||||||
'weapons.cpp', 'world.cpp', 'xen.cpp', 'zombie.cpp']
|
'weapons.cpp',
|
||||||
|
'world.cpp',
|
||||||
|
'xen.cpp',
|
||||||
|
'zombie.cpp'
|
||||||
|
]
|
||||||
|
|
||||||
if bld.env.VOICEMGR:
|
if bld.env.VOICEMGR:
|
||||||
source += bld.path.parent.ant_glob([
|
source += bld.path.parent.ant_glob([
|
||||||
@ -57,7 +135,15 @@ def build(bld):
|
|||||||
else:
|
else:
|
||||||
defines += ['NO_VOICEGAMEMGR']
|
defines += ['NO_VOICEGAMEMGR']
|
||||||
|
|
||||||
includes = Utils.to_list('. wpn_shared ../common ../engine ../pm_shared ../game_shared ../public')
|
includes = [
|
||||||
|
'.',
|
||||||
|
'wpn_shared',
|
||||||
|
'../common',
|
||||||
|
'../engine',
|
||||||
|
'../pm_shared',
|
||||||
|
'../game_shared',
|
||||||
|
'../public'
|
||||||
|
]
|
||||||
|
|
||||||
libs = []
|
libs = []
|
||||||
|
|
||||||
|
@ -1,70 +0,0 @@
|
|||||||
/*
|
|
||||||
cdll_exp.h - exports for client
|
|
||||||
Copyright (C) 2013 Uncle Mike
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
*/
|
|
||||||
#pragma once
|
|
||||||
#ifndef CDLL_EXP_H
|
|
||||||
#define CDLL_EXP_H
|
|
||||||
|
|
||||||
// NOTE: ordering is important!
|
|
||||||
typedef struct cldll_func_s
|
|
||||||
{
|
|
||||||
int (*pfnInitialize)( cl_enginefunc_t *pEnginefuncs, int iVersion );
|
|
||||||
void (*pfnInit)( void );
|
|
||||||
int (*pfnVidInit)( void );
|
|
||||||
int (*pfnRedraw)( float flTime, int intermission );
|
|
||||||
int (*pfnUpdateClientData)( client_data_t *cdata, float flTime );
|
|
||||||
void (*pfnReset)( void );
|
|
||||||
void (*pfnPlayerMove)( struct playermove_s *ppmove, int server );
|
|
||||||
void (*pfnPlayerMoveInit)( struct playermove_s *ppmove );
|
|
||||||
char (*pfnPlayerMoveTexture)( char *name );
|
|
||||||
void (*IN_ActivateMouse)( void );
|
|
||||||
void (*IN_DeactivateMouse)( void );
|
|
||||||
void (*IN_MouseEvent)( int mstate );
|
|
||||||
void (*IN_ClearStates)( void );
|
|
||||||
void (*IN_Accumulate)( void );
|
|
||||||
void (*CL_CreateMove)( float frametime, struct usercmd_s *cmd, int active );
|
|
||||||
int (*CL_IsThirdPerson)( void );
|
|
||||||
void (*CL_CameraOffset)( float *ofs );
|
|
||||||
void *(*KB_Find)( const char *name );
|
|
||||||
void (*CAM_Think)( void ); // camera stuff
|
|
||||||
void (*pfnCalcRefdef)( ref_params_t *pparams );
|
|
||||||
int (*pfnAddEntity)( int type, cl_entity_t *ent, const char *modelname );
|
|
||||||
void (*pfnCreateEntities)( void );
|
|
||||||
void (*pfnDrawNormalTriangles)( void );
|
|
||||||
void (*pfnDrawTransparentTriangles)( void );
|
|
||||||
void (*pfnStudioEvent)( const struct mstudioevent_s *event, const cl_entity_t *entity );
|
|
||||||
void (*pfnPostRunCmd)( struct local_state_s *from, struct local_state_s *to, usercmd_t *cmd, int runfuncs, double time, unsigned int random_seed );
|
|
||||||
void (*pfnShutdown)( void );
|
|
||||||
void (*pfnTxferLocalOverrides)( entity_state_t *state, const clientdata_t *client );
|
|
||||||
void (*pfnProcessPlayerState)( entity_state_t *dst, const entity_state_t *src );
|
|
||||||
void (*pfnTxferPredictionData)( entity_state_t *ps, const entity_state_t *pps, clientdata_t *pcd, const clientdata_t *ppcd, weapon_data_t *wd, const weapon_data_t *pwd );
|
|
||||||
void (*pfnDemo_ReadBuffer)( int size, byte *buffer );
|
|
||||||
int (*pfnConnectionlessPacket)( const struct netadr_s *net_from, const char *args, char *buffer, int *size );
|
|
||||||
int (*pfnGetHullBounds)( int hullnumber, float *mins, float *maxs );
|
|
||||||
void (*pfnFrame)( double time );
|
|
||||||
int (*pfnKey_Event)( int eventcode, int keynum, const char *pszCurrentBinding );
|
|
||||||
void (*pfnTempEntUpdate)( double frametime, double client_time, double cl_gravity, struct tempent_s **ppTempEntFree, struct tempent_s **ppTempEntActive, int ( *Callback_AddVisibleEntity )( cl_entity_t *pEntity ), void ( *Callback_TempEntPlaySound )( struct tempent_s *pTemp, float damp ));
|
|
||||||
cl_entity_t *(*pfnGetUserEntity)( int index );
|
|
||||||
void (*pfnVoiceStatus)( int entindex, qboolean bTalking );
|
|
||||||
void (*pfnDirectorMessage)( int iSize, void *pbuf );
|
|
||||||
int (*pfnGetStudioModelInterface)( int version, struct r_studio_interface_s **ppinterface, struct engine_studio_api_s *pstudio );
|
|
||||||
void (*pfnChatInputPosition)( int *x, int *y );
|
|
||||||
int (*pfnGetPlayerTeam)( int playerIndex );
|
|
||||||
void *(*pfnGetClientFactory)( void );
|
|
||||||
// Xash3D extension
|
|
||||||
int (*pfnGetRenderInterface)( int version, render_api_t *renderfuncs, render_interface_t *callback );
|
|
||||||
void (*pfnClipMoveToEntity)( struct physent_s *pe, const vec3_t start, vec3_t mins, vec3_t maxs, const vec3_t end, struct pmtrace_s *tr );
|
|
||||||
} cldll_func_t;
|
|
||||||
|
|
||||||
#endif//CDLL_EXP_H
|
|
@ -18,6 +18,8 @@
|
|||||||
|
|
||||||
#include "const.h"
|
#include "const.h"
|
||||||
|
|
||||||
|
#define MAX_QPATH 64 // Must match value in quakedefs.h
|
||||||
|
|
||||||
/////////////////
|
/////////////////
|
||||||
// Customization
|
// Customization
|
||||||
// passed to pfnPlayerCustomization
|
// passed to pfnPlayerCustomization
|
||||||
|
@ -1,188 +0,0 @@
|
|||||||
/*
|
|
||||||
menu_int.h - interface between engine and menu
|
|
||||||
Copyright (C) 2010 Uncle Mike
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
*/
|
|
||||||
#pragma once
|
|
||||||
#ifndef MENU_INT_H
|
|
||||||
#define MENU_INT_H
|
|
||||||
|
|
||||||
#include "cvardef.h"
|
|
||||||
#include "gameinfo.h"
|
|
||||||
#include "wrect.h"
|
|
||||||
|
|
||||||
typedef int HIMAGE; // handle to a graphic
|
|
||||||
|
|
||||||
// flags for PIC_Load
|
|
||||||
#define PIC_NEAREST (1<<0) // disable texfilter
|
|
||||||
#define PIC_KEEP_RGBDATA (1<<1) // some images keep source
|
|
||||||
#define PIC_NOFLIP_TGA (1<<2) // Steam background completely ignore tga attribute 0x20
|
|
||||||
#define PIC_KEEP_8BIT (1<<3) // keep original 8-bit image (if present)
|
|
||||||
|
|
||||||
typedef struct ui_globalvars_s
|
|
||||||
{
|
|
||||||
float time; // unclamped host.realtime
|
|
||||||
float frametime;
|
|
||||||
|
|
||||||
int scrWidth; // actual values
|
|
||||||
int scrHeight;
|
|
||||||
|
|
||||||
int maxClients;
|
|
||||||
int developer;
|
|
||||||
int demoplayback;
|
|
||||||
int demorecording;
|
|
||||||
char demoname[64]; // name of currently playing demo
|
|
||||||
char maptitle[64]; // title of active map
|
|
||||||
} ui_globalvars_t;
|
|
||||||
|
|
||||||
typedef struct ui_enginefuncs_s
|
|
||||||
{
|
|
||||||
// image handlers
|
|
||||||
HIMAGE (*pfnPIC_Load)( const char *szPicName, const byte *ucRawImage, long ulRawImageSize, long flags );
|
|
||||||
void (*pfnPIC_Free)( const char *szPicName );
|
|
||||||
int (*pfnPIC_Width)( HIMAGE hPic );
|
|
||||||
int (*pfnPIC_Height)( HIMAGE hPic );
|
|
||||||
void (*pfnPIC_Set)( HIMAGE hPic, int r, int g, int b, int a );
|
|
||||||
void (*pfnPIC_Draw)( int x, int y, int width, int height, const wrect_t *prc );
|
|
||||||
void (*pfnPIC_DrawHoles)( int x, int y, int width, int height, const wrect_t *prc );
|
|
||||||
void (*pfnPIC_DrawTrans)( int x, int y, int width, int height, const wrect_t *prc );
|
|
||||||
void (*pfnPIC_DrawAdditive)( int x, int y, int width, int height, const wrect_t *prc );
|
|
||||||
void (*pfnPIC_EnableScissor)( int x, int y, int width, int height );
|
|
||||||
void (*pfnPIC_DisableScissor)( void );
|
|
||||||
|
|
||||||
// screen handlers
|
|
||||||
void (*pfnFillRGBA)( int x, int y, int width, int height, int r, int g, int b, int a );
|
|
||||||
|
|
||||||
// cvar handlers
|
|
||||||
cvar_t* (*pfnRegisterVariable)( const char *szName, const char *szValue, int flags );
|
|
||||||
float (*pfnGetCvarFloat)( const char *szName );
|
|
||||||
char* (*pfnGetCvarString)( const char *szName );
|
|
||||||
void (*pfnCvarSetString)( const char *szName, const char *szValue );
|
|
||||||
void (*pfnCvarSetValue)( const char *szName, float flValue );
|
|
||||||
|
|
||||||
// command handlers
|
|
||||||
int (*pfnAddCommand)( const char *cmd_name, void (*function)(void) );
|
|
||||||
void (*pfnClientCmd)( int execute_now, const char *szCmdString );
|
|
||||||
void (*pfnDelCommand)( const char *cmd_name );
|
|
||||||
int (*pfnCmdArgc)( void );
|
|
||||||
char* (*pfnCmdArgv)( int argc );
|
|
||||||
char* (*pfnCmd_Args)( void );
|
|
||||||
|
|
||||||
// debug messages (in-menu shows only notify)
|
|
||||||
void (*Con_Printf)( char *fmt, ... );
|
|
||||||
void (*Con_DPrintf)( char *fmt, ... );
|
|
||||||
void (*Con_NPrintf)( int pos, char *fmt, ... );
|
|
||||||
void (*Con_NXPrintf)( struct con_nprint_s *info, char *fmt, ... );
|
|
||||||
|
|
||||||
// sound handlers
|
|
||||||
void (*pfnPlayLocalSound)( const char *szSound );
|
|
||||||
|
|
||||||
// cinematic handlers
|
|
||||||
void (*pfnDrawLogo)( const char *filename, float x, float y, float width, float height );
|
|
||||||
int (*pfnGetLogoWidth)( void );
|
|
||||||
int (*pfnGetLogoHeight)( void );
|
|
||||||
float (*pfnGetLogoLength)( void ); // cinematic duration in seconds
|
|
||||||
|
|
||||||
// text message system
|
|
||||||
void (*pfnDrawCharacter)( int x, int y, int width, int height, int ch, int ulRGBA, HIMAGE hFont );
|
|
||||||
int (*pfnDrawConsoleString)( int x, int y, const char *string );
|
|
||||||
void (*pfnDrawSetTextColor)( int r, int g, int b, int alpha );
|
|
||||||
void (*pfnDrawConsoleStringLen)( const char *string, int *length, int *height );
|
|
||||||
void (*pfnSetConsoleDefaultColor)( int r, int g, int b ); // color must came from colors.lst
|
|
||||||
|
|
||||||
// custom rendering (for playermodel preview)
|
|
||||||
struct cl_entity_s* (*pfnGetPlayerModel)( void ); // for drawing playermodel previews
|
|
||||||
void (*pfnSetModel)( struct cl_entity_s *ed, const char *path );
|
|
||||||
void (*pfnClearScene)( void );
|
|
||||||
void (*pfnRenderScene)( const struct ref_params_s *fd );
|
|
||||||
int (*CL_CreateVisibleEntity)( int type, struct cl_entity_s *ent );
|
|
||||||
|
|
||||||
// misc handlers
|
|
||||||
void (*pfnHostError)( const char *szFmt, ... );
|
|
||||||
int (*pfnFileExists)( const char *filename, int gamedironly );
|
|
||||||
void (*pfnGetGameDir)( char *szGetGameDir );
|
|
||||||
|
|
||||||
// gameinfo handlers
|
|
||||||
int (*pfnCreateMapsList)( int fRefresh );
|
|
||||||
int (*pfnClientInGame)( void );
|
|
||||||
void (*pfnClientJoin)( const struct netadr_s adr );
|
|
||||||
|
|
||||||
// parse txt files
|
|
||||||
byte* (*COM_LoadFile)( const char *filename, int *pLength );
|
|
||||||
char* (*COM_ParseFile)( char *data, char *token );
|
|
||||||
void (*COM_FreeFile)( void *buffer );
|
|
||||||
|
|
||||||
// keyfuncs
|
|
||||||
void (*pfnKeyClearStates)( void ); // call when menu open or close
|
|
||||||
void (*pfnSetKeyDest)( int dest );
|
|
||||||
const char *(*pfnKeynumToString)( int keynum );
|
|
||||||
const char *(*pfnKeyGetBinding)( int keynum );
|
|
||||||
void (*pfnKeySetBinding)( int keynum, const char *binding );
|
|
||||||
int (*pfnKeyIsDown)( int keynum );
|
|
||||||
int (*pfnKeyGetOverstrikeMode)( void );
|
|
||||||
void (*pfnKeySetOverstrikeMode)( int fActive );
|
|
||||||
void *(*pfnKeyGetState)( const char *name ); // for mlook, klook etc
|
|
||||||
|
|
||||||
// engine memory manager
|
|
||||||
void* (*pfnMemAlloc)( size_t cb, const char *filename, const int fileline );
|
|
||||||
void (*pfnMemFree)( void *mem, const char *filename, const int fileline );
|
|
||||||
|
|
||||||
// collect info from engine
|
|
||||||
int (*pfnGetGameInfo)( GAMEINFO *pgameinfo );
|
|
||||||
GAMEINFO **(*pfnGetGamesList)( int *numGames ); // collect info about all mods
|
|
||||||
char **(*pfnGetFilesList)( const char *pattern, int *numFiles, int gamedironly ); // find in files
|
|
||||||
int (*pfnGetSaveComment)( const char *savename, char *comment );
|
|
||||||
int (*pfnGetDemoComment)( const char *demoname, char *comment );
|
|
||||||
int (*pfnCheckGameDll)( void ); // returns false if hl.dll is missed or invalid
|
|
||||||
char *(*pfnGetClipboardData)( void );
|
|
||||||
|
|
||||||
// engine launcher
|
|
||||||
void (*pfnShellExecute)( const char *name, const char *args, int closeEngine );
|
|
||||||
void (*pfnWriteServerConfig)( const char *name );
|
|
||||||
void (*pfnChangeInstance)( const char *newInstance, const char *szFinalMessage );
|
|
||||||
void (*pfnPlayBackgroundTrack)( const char *introName, const char *loopName );
|
|
||||||
void (*pfnHostEndGame)( const char *szFinalMessage );
|
|
||||||
|
|
||||||
// menu interface is freezed at version 0.75
|
|
||||||
// new functions starts here
|
|
||||||
float (*pfnRandomFloat)( float flLow, float flHigh );
|
|
||||||
int (*pfnRandomLong)( int lLow, int lHigh );
|
|
||||||
|
|
||||||
void (*pfnSetCursor)( void *hCursor ); // change cursor
|
|
||||||
int (*pfnIsMapValid)( char *filename );
|
|
||||||
void (*pfnProcessImage)( int texnum, float gamma, int topColor, int bottomColor );
|
|
||||||
int (*pfnCompareFileTime)( char *filename1, char *filename2, int *iCompare );
|
|
||||||
} ui_enginefuncs_t;
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
int (*pfnVidInit)( void );
|
|
||||||
void (*pfnInit)( void );
|
|
||||||
void (*pfnShutdown)( void );
|
|
||||||
void (*pfnRedraw)( float flTime );
|
|
||||||
void (*pfnKeyEvent)( int key, int down );
|
|
||||||
void (*pfnMouseMove)( int x, int y );
|
|
||||||
void (*pfnSetActiveMenu)( int active );
|
|
||||||
void (*pfnAddServerToList)( struct netadr_s adr, const char *info );
|
|
||||||
void (*pfnGetCursorPos)( int *pos_x, int *pos_y );
|
|
||||||
void (*pfnSetCursorPos)( int pos_x, int pos_y );
|
|
||||||
void (*pfnShowCursor)( int show );
|
|
||||||
void (*pfnCharEvent)( int key );
|
|
||||||
int (*pfnMouseInRect)( void ); // mouse entering\leave game window
|
|
||||||
int (*pfnIsVisible)( void );
|
|
||||||
int (*pfnCreditsActive)( void ); // unused
|
|
||||||
void (*pfnFinalCredits)( void ); // show credits + game end
|
|
||||||
} UI_FUNCTIONS;
|
|
||||||
|
|
||||||
typedef int (*MENUAPI)( UI_FUNCTIONS *pFunctionTable, ui_enginefuncs_t* engfuncs, ui_globalvars_t *pGlobals );
|
|
||||||
|
|
||||||
#endif//MENU_INT_H
|
|
114
engine/physint.h
114
engine/physint.h
@ -1,114 +0,0 @@
|
|||||||
/*
|
|
||||||
physint.h - Server Physics Interface
|
|
||||||
Copyright (C) 2011 Uncle Mike
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
*/
|
|
||||||
#pragma once
|
|
||||||
#ifndef PHYSINT_H
|
|
||||||
#define PHYSINT_H
|
|
||||||
|
|
||||||
#define SV_PHYSICS_INTERFACE_VERSION 6
|
|
||||||
|
|
||||||
#define STRUCT_FROM_LINK( l, t, m ) ((t *)((byte *)l - (int)&(((t *)0)->m)))
|
|
||||||
#define EDICT_FROM_AREA( l ) STRUCT_FROM_LINK( l, edict_t, area )
|
|
||||||
|
|
||||||
// values that can be returned with pfnServerState
|
|
||||||
#define SERVER_DEAD 0
|
|
||||||
#define SERVER_LOADING 1
|
|
||||||
#define SERVER_ACTIVE 2
|
|
||||||
|
|
||||||
typedef struct areanode_s
|
|
||||||
{
|
|
||||||
int axis; // -1 = leaf node
|
|
||||||
float dist;
|
|
||||||
struct areanode_s *children[2];
|
|
||||||
link_t trigger_edicts;
|
|
||||||
link_t solid_edicts;
|
|
||||||
link_t water_edicts; // func water
|
|
||||||
} areanode_t;
|
|
||||||
|
|
||||||
typedef struct server_physics_api_s
|
|
||||||
{
|
|
||||||
// unlink edict from old position and link onto new
|
|
||||||
void ( *pfnLinkEdict) ( edict_t *ent, qboolean touch_triggers );
|
|
||||||
double ( *pfnGetServerTime )( void ); // unclamped
|
|
||||||
double ( *pfnGetFrameTime )( void ); // unclamped
|
|
||||||
void* ( *pfnGetModel )( int modelindex );
|
|
||||||
areanode_t* ( *pfnGetHeadnode )( void ); // BSP tree for all physic entities
|
|
||||||
int ( *pfnServerState )( void );
|
|
||||||
void ( *pfnHost_Error )( const char *error, ... ); // cause Host Error
|
|
||||||
// ONLY ADD NEW FUNCTIONS TO THE END OF THIS STRUCT. INTERFACE VERSION IS FROZEN AT 6
|
|
||||||
struct triangleapi_s *pTriAPI; // draw coliisions etc. Only for local system
|
|
||||||
|
|
||||||
// draw debug messages (must be called from DrawOrthoTriangles). Only for local system
|
|
||||||
int ( *pfnDrawConsoleString )( int x, int y, char *string );
|
|
||||||
void ( *pfnDrawSetTextColor )( float r, float g, float b );
|
|
||||||
void ( *pfnDrawConsoleStringLen )( const char *string, int *length, int *height );
|
|
||||||
void ( *Con_NPrintf )( int pos, char *fmt, ... );
|
|
||||||
void ( *Con_NXPrintf )( struct con_nprint_s *info, char *fmt, ... );
|
|
||||||
const char *( *pfnGetLightStyle )( int style ); // read custom appreance for selected lightstyle
|
|
||||||
void ( *pfnUpdateFogSettings )( unsigned int packed_fog );
|
|
||||||
char **(*pfnGetFilesList)( const char *pattern, int *numFiles, int gamedironly );
|
|
||||||
struct msurface_s *(*pfnTraceSurface)( edict_t *pTextureEntity, const float *v1, const float *v2 );
|
|
||||||
const byte *(*pfnGetTextureData)( unsigned int texnum );
|
|
||||||
|
|
||||||
// static allocations
|
|
||||||
void *(*pfnMemAlloc)( size_t cb, const char *filename, const int fileline );
|
|
||||||
void (*pfnMemFree)( void *mem, const char *filename, const int fileline );
|
|
||||||
} server_physics_api_t;
|
|
||||||
|
|
||||||
// physic callbacks
|
|
||||||
typedef struct physics_interface_s
|
|
||||||
{
|
|
||||||
int version;
|
|
||||||
// passed through pfnCreate (0 is attempt to create, -1 is reject)
|
|
||||||
int ( *SV_CreateEntity )( edict_t *pent, const char *szName );
|
|
||||||
// run custom physics for each entity (return 0 to use built-in engine physic)
|
|
||||||
int ( *SV_PhysicsEntity )( edict_t *pEntity );
|
|
||||||
// spawn entities with internal mod function e.g. for re-arrange spawn order (0 - use engine parser, 1 - use mod parser)
|
|
||||||
int ( *SV_LoadEntities )( const char *mapname, char *entities );
|
|
||||||
// update conveyor belt for clients
|
|
||||||
void ( *SV_UpdatePlayerBaseVelocity )( edict_t *ent );
|
|
||||||
// The game .dll should return 1 if save game should be allowed
|
|
||||||
int ( *SV_AllowSaveGame )( void );
|
|
||||||
// ONLY ADD NEW FUNCTIONS TO THE END OF THIS STRUCT. INTERFACE VERSION IS FROZEN AT 6
|
|
||||||
// override trigger area checking and touching
|
|
||||||
int ( *SV_TriggerTouch )( edict_t *pent, edict_t *trigger );
|
|
||||||
// some engine features can be enabled only through this function
|
|
||||||
unsigned int ( *SV_CheckFeatures )( void );
|
|
||||||
// used for draw debug collisions for custom physic engine etc
|
|
||||||
void ( *DrawDebugTriangles )( void );
|
|
||||||
// used for draw debug overlay (textured)
|
|
||||||
void ( *DrawNormalTriangles )( void );
|
|
||||||
// used for draw debug messages (2d mode)
|
|
||||||
void ( *DrawOrthoTriangles )( void );
|
|
||||||
// tracing entities with SOLID_CUSTOM mode on a server (not used by pmove code)
|
|
||||||
void ( *ClipMoveToEntity)( edict_t *ent, const float *start, float *mins, float *maxs, const float *end, trace_t *trace );
|
|
||||||
// tracing entities with SOLID_CUSTOM mode on a server (only used by pmove code)
|
|
||||||
void ( *ClipPMoveToEntity)( struct physent_s *pe, const float *start, float *mins, float *maxs, const float *end, struct pmtrace_s *tr );
|
|
||||||
// called at end the frame of SV_Physics call
|
|
||||||
void ( *SV_EndFrame )( void );
|
|
||||||
// called through save\restore process
|
|
||||||
void (*pfnCreateEntitiesInTransitionList)( SAVERESTOREDATA*, int levelMask );
|
|
||||||
// called through save\restore process
|
|
||||||
void (*pfnCreateEntitiesInRestoreList)( SAVERESTOREDATA*, int createPlayers );
|
|
||||||
// allocate custom string (e.g. using user implementation of stringtable, not engine strings)
|
|
||||||
string_t (*pfnAllocString)( const char *szValue );
|
|
||||||
// make custom string (e.g. using user implementation of stringtable, not engine strings)
|
|
||||||
string_t (*pfnMakeString)( const char *szValue );
|
|
||||||
// read custom string (e.g. using user implementation of stringtable, not engine strings)
|
|
||||||
const char* (*pfnGetString)( string_t iString );
|
|
||||||
// helper for restore custom decals that have custom message (e.g. Paranoia)
|
|
||||||
int (*pfnRestoreDecal)( struct decallist_s *entry, edict_t *pEdict, qboolean adjacent );
|
|
||||||
} physics_interface_t;
|
|
||||||
|
|
||||||
#endif//PHYSINT_H
|
|
@ -1,53 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright (C) 1997-2001 Id Software, Inc.
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
|
||||||
modify it under the terms of the GNU General Public License
|
|
||||||
as published by the Free Software Foundation; either version 2
|
|
||||||
of the License, or (at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
|
|
||||||
See the GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
0.000000, 0.098165, 0.196270, 0.294259, 0.392069, 0.489643, 0.586920, 0.683850,
|
|
||||||
0.780360, 0.876405, 0.971920, 1.066850, 1.161140, 1.254725, 1.347560, 1.439580,
|
|
||||||
1.530735, 1.620965, 1.710220, 1.798445, 1.885585, 1.971595, 2.056410, 2.139990,
|
|
||||||
2.222280, 2.303235, 2.382795, 2.460925, 2.537575, 2.612690, 2.686235, 2.758160,
|
|
||||||
2.828425, 2.896990, 2.963805, 3.028835, 3.092040, 3.153385, 3.212830, 3.270340,
|
|
||||||
3.325880, 3.379415, 3.430915, 3.480350, 3.527685, 3.572895, 3.615955, 3.656840,
|
|
||||||
3.695520, 3.731970, 3.766175, 3.798115, 3.827760, 3.855105, 3.880125, 3.902810,
|
|
||||||
3.923140, 3.941110, 3.956705, 3.969920, 3.980740, 3.989160, 3.995180, 3.998795,
|
|
||||||
4.000000, 3.998795, 3.995180, 3.989160, 3.980740, 3.969920, 3.956705, 3.941110,
|
|
||||||
3.923140, 3.902810, 3.880125, 3.855105, 3.827760, 3.798115, 3.766175, 3.731970,
|
|
||||||
3.695520, 3.656840, 3.615955, 3.572895, 3.527685, 3.480350, 3.430915, 3.379415,
|
|
||||||
3.325880, 3.270340, 3.212830, 3.153385, 3.092040, 3.028835, 2.963805, 2.896990,
|
|
||||||
2.828425, 2.758160, 2.686235, 2.612690, 2.537575, 2.460925, 2.382795, 2.303235,
|
|
||||||
2.222280, 2.139990, 2.056410, 1.971595, 1.885585, 1.798445, 1.710220, 1.620965,
|
|
||||||
1.530735, 1.439580, 1.347560, 1.254725, 1.161140, 1.066850, 0.971920, 0.876405,
|
|
||||||
0.780360, 0.683850, 0.586920, 0.489643, 0.392069, 0.294259, 0.196270, 0.098165,
|
|
||||||
0.000000, -0.098165, -0.196270, -0.294259, -0.392069, -0.489643, -0.586920, -0.683850,
|
|
||||||
-0.780360, -0.876405, -0.971920, -1.066850, -1.161140, -1.254725, -1.347560, -1.439580,
|
|
||||||
-1.530735, -1.620965, -1.710220, -1.798445, -1.885585, -1.971595, -2.056410, -2.139990,
|
|
||||||
-2.222280, -2.303235, -2.382795, -2.460925, -2.537575, -2.612690, -2.686235, -2.758160,
|
|
||||||
-2.828425, -2.896990, -2.963805, -3.028835, -3.092040, -3.153385, -3.212830, -3.270340,
|
|
||||||
-3.325880, -3.379415, -3.430915, -3.480350, -3.527685, -3.572895, -3.615955, -3.656840,
|
|
||||||
-3.695520, -3.731970, -3.766175, -3.798115, -3.827760, -3.855105, -3.880125, -3.902810,
|
|
||||||
-3.923140, -3.941110, -3.956705, -3.969920, -3.980740, -3.989160, -3.995180, -3.998795,
|
|
||||||
-4.000000, -3.998795, -3.995180, -3.989160, -3.980740, -3.969920, -3.956705, -3.941110,
|
|
||||||
-3.923140, -3.902810, -3.880125, -3.855105, -3.827760, -3.798115, -3.766175, -3.731970,
|
|
||||||
-3.695520, -3.656840, -3.615955, -3.572895, -3.527685, -3.480350, -3.430915, -3.379415,
|
|
||||||
-3.325880, -3.270340, -3.212830, -3.153385, -3.092040, -3.028835, -2.963805, -2.896990,
|
|
||||||
-2.828425, -2.758160, -2.686235, -2.612690, -2.537575, -2.460925, -2.382795, -2.303235,
|
|
||||||
-2.222280, -2.139990, -2.056410, -1.971595, -1.885585, -1.798445, -1.710220, -1.620965,
|
|
||||||
-1.530735, -1.439580, -1.347560, -1.254725, -1.161140, -1.066850, -0.971920, -0.876405,
|
|
||||||
-0.780360, -0.683850, -0.586920, -0.489643, -0.392069, -0.294259, -0.196270, -0.098165,
|
|
Loading…
x
Reference in New Issue
Block a user